{"version":3,"file":"radioGroupContext.cjs","sources":["../../../../src/components/radio-button/radioGroupContext.tsx"],"sourcesContent":["import React, {\n    createContext,\n    useContext,\n    type ChangeEventHandler,\n} from \"react\";\nimport type { WithChildren } from \"../../core/types.js\";\n\ntype RadioGroupContext = {\n    name: string | undefined;\n    value: string | undefined;\n    inline: boolean;\n    invalid: boolean;\n    onChange: ChangeEventHandler<HTMLInputElement> | undefined;\n};\n\nconst radioGroupContext = createContext<RadioGroupContext>({\n    name: undefined,\n    value: undefined,\n    onChange: () => {\n        return;\n    },\n    inline: false,\n    invalid: false,\n});\n\nexport const useRadioGroupContext = (): RadioGroupContext =>\n    useContext(radioGroupContext);\n\ninterface Props extends WithChildren {\n    state: RadioGroupContext;\n}\n\nexport const RadioGroupContextProvider: React.FC<Props> = ({\n    state,\n    children,\n}) => (\n    <radioGroupContext.Provider value={state}>\n        {children}\n    </radioGroupContext.Provider>\n);\n"],"names":["radioGroupContext","createContext","name","value","onChange","inline","invalid","state","children","Provider","useContext"],"mappings":"wIAeMA,EAAoBC,EAAAA,cAAiC,CACvDC,UAAM,EACNC,WAAO,EACPC,SAAU,OAGVC,QAAQ,EACRC,SAAS,sCAU6C,EACtDC,MAAAA,EACAC,SAAAA,WAECR,EAAkBS,SAAlB,CAA2BN,MAAOI,EAC9BC,SAAAA,iCAZ2B,IAChCE,EAAAA,WAAWV"}