import{j as r}from"./jsx-runtime-Dfk2JFgj.js";import{r as m}from"./index-CWN_QRa1.js";import{v as y}from"./v4-CtRu48qb.js";const f=({id:n,label:i=null,checked:l=!1,isIndeterminate:p=!1,isDisabled:o=!1,value:d,onClick:c,onChange:t})=>{const e=n||y();return r.jsxs("div",{className:"wrapper-gtc-rc",children:[r.jsxs("div",{className:"checkbox-gtc-rc-div",children:[r.jsx("input",{className:`checkbox-gtc-rc ${p?"indeterminate-gtc-rc":""}`,type:"checkbox",id:e,value:d,checked:l,disabled:o,onClick:c,onChange:a=>t==null?void 0:t(a.target.checked)}),r.jsx("label",{htmlFor:e,className:`cb-gtc-rc ${o?"cb-gtc-rc-disabled":""}`})]}),i]})};f.__docgenInfo={description:"",methods:[],displayName:"Checkbox",props:{checked:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},label:{required:!1,tsType:{name:"union",raw:"ReactNode | string",elements:[{name:"ReactNode"},{name:"string"}]},description:"",defaultValue:{value:"null",computed:!1}},value:{required:!1,tsType:{name:"string"},description:""},id:{required:!1,tsType:{name:"string"},description:""},isIndeterminate:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},isDisabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: boolean | any) => void",signature:{arguments:[{type:{name:"union",raw:"boolean | any",elements:[{name:"boolean"},{name:"any"}]},name:"event"}],return:{name:"void"}}},description:""},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}};const g=({list:n,onChange:i,value:l,labelDir:p,isDisabled:o})=>{const[d,c]=m.useState(new Array(n.length).fill(!1));m.useEffect(()=>{l||c(Array(n.length).fill(!1))},[l]);const t=e=>{const a=d.map((u,s)=>s===e?!u:u);c(a),i&&i(a)};return r.jsx("div",{style:{display:"flex",width:"100%",flexDirection:p},children:n.map(({label:e,value:a,id:u},s)=>r.jsx(f,{id:u,label:e,value:a,checked:d[s],isDisabled:o,onChange:()=>t(s)},s))})};g.__docgenInfo={description:"",methods:[],displayName:"CheckGroup",props:{checked:{required:!1,tsType:{name:"boolean"},description:""},label:{required:!1,tsType:{name:"string"},description:""},value:{required:!1,tsType:{name:"string"},description:""},id:{required:!1,tsType:{name:"string"},description:""},isIndeterminate:{required:!1,tsType:{name:"boolean"},description:""},isDisabled:{required:!1,tsType:{name:"boolean"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: any) => void",signature:{arguments:[{type:{name:"any"},name:"e"}],return:{name:"void"}}},description:""},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},list:{required:!0,tsType:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ label: string, value: string }",signature:{properties:[{key:"label",value:{name:"string",required:!0}},{key:"value",value:{name:"string",required:!0}}]}}],raw:"Array<{ label: string, value: string }>"},description:""},labelDir:{required:!1,tsType:{name:"union",raw:"'column' | 'row'",elements:[{name:"literal",value:"'column'"},{name:"literal",value:"'row'"}]},description:""}}};export{f as C,g as a};
