import*as t from"react";import{createContext as e}from"../../../react-utils/dist/esm/context.js";import{__DEV__ as r}from"../../../utils/dist/esm/assertion.js";import{forwardRef as s}from"../../../system/dist/esm/forward-ref.js";import{cx as o}from"../../../utils/dist/esm/dom.js";import{chakra as a}from"../../../system/dist/esm/system.js";function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t}).apply(this,arguments)}var[n,m]=e({strict:!1,name:"ButtonGroupContext"}),l=s(((e,r)=>{var{size:s,colorScheme:m,variant:l,className:c,spacing:f="0.5rem",isAttached:p,isDisabled:u}=e,d=function(t,e){if(null==t)return{};var r,s,o={},a=Object.keys(t);for(s=0;s<a.length;s++)r=a[s],e.indexOf(r)>=0||(o[r]=t[r]);return o}(e,["size","colorScheme","variant","className","spacing","isAttached","isDisabled"]),y=o("chakra-button__group",c),v=t.useMemo((()=>({size:s,colorScheme:m,variant:l,isDisabled:u})),[s,m,l,u]),b={display:"inline-flex"};return b=i({},b,p?{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:{"& > *:not(style) ~ *:not(style)":{marginStart:f}}),t.createElement(n,{value:v},t.createElement(a.div,i({ref:r,role:"group",__css:b,className:y},d)))}));r&&(l.displayName="ButtonGroup");export{l as ButtonGroup,m as useButtonGroup};
//# sourceMappingURL=button-group.js.map
