var R=Object.defineProperty;var d=(t,o)=>R(t,"name",{value:o,configurable:!0});import{R as B,r as m,j as c,F as y,a as g}from"./jsx-runtime.33077135.js";const b="_containerLabel_18nbr_1",S="_radioButton_18nbr_7",_={containerLabel:b,radioButton:S},f=B.createContext(null),l=d(({defaultValue:t,disabled:o,onSelection:n,value:a,children:r})=>{const[e,p]=m.exports.useState(t),u=d(i=>{p(i),n==null||n(i)},"dispatcher");return c("div",{children:c(f.Provider,{value:[a!=null?a:e,o!=null?o:!1,u],children:r})})},"RadioButtonGroup"),h=l;try{l.displayName="RadioButtonGroup",l.__docgenInfo={description:"",displayName:"RadioButtonGroup",props:{disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"string"}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"string"}},onSelection:{defaultValue:null,description:"",name:"onSelection",required:!1,type:{name:"((value: string) => unknown)"}}}},typeof STORYBOOK_REACT_CLASSES<"u"&&(STORYBOOK_REACT_CLASSES["src/components/radio/group/RadioButtonGroup.tsx#RadioButtonGroup"]={docgenInfo:l.__docgenInfo,name:"RadioButtonGroup",path:"src/components/radio/group/RadioButtonGroup.tsx#RadioButtonGroup"})}catch{}const s=d(({onClick:t,checked:o,disabled:n,label:a,value:r})=>{var u;const e=m.exports.useContext(f),p=d(i=>{t==null||t(i),e==null||e[2](r)},"localOnClick");return c(y,{children:g("label",{className:_.containerLabel,children:[c("input",{className:_.radioButton,type:"radio",value:r,checked:e?e[0]===r:o,disabled:(u=e==null?void 0:e[1])!=null?u:n,onClick:p}),a]})})},"RadioButton"),E=s;try{s.displayName="RadioButton",s.__docgenInfo={description:"",displayName:"RadioButton",props:{disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"FormEventHandler<HTMLInputElement>"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},checked:{defaultValue:null,description:"",name:"checked",required:!1,type:{name:"boolean"}}}},typeof STORYBOOK_REACT_CLASSES<"u"&&(STORYBOOK_REACT_CLASSES["src/components/radio/button/RadioButton.tsx#RadioButton"]={docgenInfo:s.__docgenInfo,name:"RadioButton",path:"src/components/radio/button/RadioButton.tsx#RadioButton"})}catch{}export{E as R,h as a};
//# sourceMappingURL=RadioButton.401ca4bf.js.map
