Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-BcutgqC9.cjs`),t=require(`./utils-8yHOSEWy.cjs`),n=require(`./checkbox-ClFbPyyD.cjs`);let r=require(`react`);r=e.n(r,1);let i=require(`react/jsx-runtime`);var a=r.default.createContext({selectedValues:[],onValueChange:()=>{},color:void 0,variant:void 0}),o=r.default.forwardRef(({className:e,children:n,value:o,variant:s,color:c,onValueChange:l,defaultValue:u,...d},f)=>{let[p,m]=r.default.useState(u||[]),h=o===void 0?p:o,g=r.default.useCallback((e,t)=>{let n=t?[...h,e]:h.filter(t=>t!==e);o===void 0&&m(n),l?.(n)},[h,o,l]),_=r.default.useMemo(()=>({selectedValues:h,color:c,variant:s,onValueChange:g}),[h,g,c,s]);return(0,i.jsx)(a.Provider,{value:_,children:(0,i.jsx)(`div`,{...d,className:t.t(`flex gap-x-4 gap-y-2 flex-row flex-wrap`,e),ref:f,children:n})})});o.displayName=`CheckboxGroup`;var s=r.default.forwardRef(({value:e,...t},o)=>{let{selectedValues:s,onValueChange:c,color:l,variant:u}=r.default.useContext(a);return(0,i.jsx)(n.t,{ref:o,...t,value:e,color:l,variant:u,checked:s.includes(e),onCheckedChange:t=>c(e,t===!0)})});s.displayName=`CheckboxGroupItem`,exports.CheckboxGroup=o,exports.CheckboxGroupItem=s;
//# sourceMappingURL=CheckboxGroup.cjs.map