{"version":3,"file":"index.tKTWIBVD.js","sources":["../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/radio-button-group/components/radio-button/index.js","../../../../../../../node_modules/@babylon/ui-kit-forms/components/inputs/radio-button-group/index.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef, useId } from 'react';\nimport { RadioButtonItemWrapper, RadioButtonInput, RadioButtonLabel, RadioButtonRightContent, RadioButtonLabelCount } from './styled.js';\n\nconst RadioButton = /*#__PURE__*/ forwardRef(({ label, id = null, value, checked = false, disabled = false, count, onChange, onClick, onBlur, hasError, className, variant = 'default', extended = false, rightContent, dropdownContent, ...rest }, ref)=>{\n    const radioId = useId();\n    return /*#__PURE__*/ jsxs(\"div\", {\n        children: [\n            /*#__PURE__*/ jsxs(RadioButtonItemWrapper, {\n                $withCount: typeof count == 'number',\n                $variant: variant,\n                $extended: extended,\n                className: className,\n                children: [\n                    /*#__PURE__*/ jsx(RadioButtonInput, {\n                        ref: ref,\n                        type: \"radio\",\n                        id: id ?? radioId,\n                        value: value,\n                        checked: checked,\n                        $variant: variant,\n                        disabled: disabled,\n                        onChange: onChange,\n                        onClick: onClick,\n                        onBlur: onBlur,\n                        role: \"radio\",\n                        \"data-testid\": \"RadioButton\",\n                        ...rest\n                    }),\n                    /*#__PURE__*/ jsxs(RadioButtonLabel, {\n                        $checked: checked,\n                        $variant: variant,\n                        $extended: extended,\n                        $withCount: typeof count == 'number',\n                        htmlFor: id ?? radioId,\n                        $hasError: hasError,\n                        $disabled: disabled,\n                        children: [\n                            label && /*#__PURE__*/ jsx(\"span\", {\n                                children: label\n                            }),\n                            rightContent && /*#__PURE__*/ jsx(RadioButtonRightContent, {\n                                children: rightContent\n                            }),\n                            count && /*#__PURE__*/ jsx(RadioButtonLabelCount, {\n                                children: count\n                            })\n                        ]\n                    })\n                ]\n            }),\n            dropdownContent\n        ]\n    });\n});\nRadioButton.displayName = 'RadioButton';\n\nexport { RadioButton as default };\n//# sourceMappingURL=index.js.map\n","import { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport ErrorTooltip from '../../others/error-tooltip/index.js';\nimport { useInput } from '../../../hooks/useInput/index.js';\nimport { forwardRef, useRef, Children } from 'react';\nimport RadioButton from './components/radio-button/index.js';\nimport { RadioButtonWrapper } from './styled.js';\n\nconst RadioButtonGroup = /*#__PURE__*/ forwardRef(({ options, onChange, onClick, disabled = false, className, variant = 'horizontal', radioVariant, error, hasError, ...rest }, ref)=>{\n    const wrapperRef = useRef(null);\n    return /*#__PURE__*/ jsxs(Fragment, {\n        children: [\n            /*#__PURE__*/ jsx(RadioButtonWrapper, {\n                ref: wrapperRef,\n                \"data-testid\": \"RadioButtonGroup\",\n                className: className,\n                $variant: variant,\n                ...rest,\n                children: Children.toArray(options.map((radio)=>/*#__PURE__*/ jsx(RadioButton, {\n                        label: radio.label,\n                        name: radio.name,\n                        value: radio.value,\n                        checked: typeof rest.value === 'undefined' ? radio.checked : String(rest.value) === String(radio.value),\n                        onChange: onChange,\n                        onClick: onClick,\n                        count: radio.count,\n                        rightContent: radio.rightContent,\n                        disabled: disabled,\n                        variant: radioVariant,\n                        hasError: hasError,\n                        ref: ref,\n                        extended: options.length <= 2,\n                        dropdownContent: radio?.dropdownContent\n                    })))\n            }),\n            /*#__PURE__*/ jsx(ErrorTooltip, {\n                referenceElement: wrapperRef.current,\n                error: error,\n                isVisible: !!hasError\n            })\n        ]\n    });\n});\nRadioButtonGroup.displayName = 'RadioButtonGroup';\nconst FormRadioButtonGroup = (props)=>{\n    const { isHiddenRequired: _isHiddenRequired, ...rest } = props;\n    const { field, error, hasError } = useInput(props);\n    return /*#__PURE__*/ jsx(RadioButtonGroup, {\n        ...rest,\n        ...field,\n        error: error,\n        hasError: hasError\n    });\n};\n\nexport { FormRadioButtonGroup, RadioButtonGroup as default };\n//# sourceMappingURL=index.js.map\n"],"names":["RadioButton","forwardRef","label","id","value","checked","disabled","count","onChange","onClick","onBlur","hasError","className","variant","extended","rightContent","dropdownContent","rest","ref","radioId","useId","jsxs","RadioButtonItemWrapper","jsx","RadioButtonInput","RadioButtonLabel","RadioButtonRightContent","RadioButtonLabelCount","RadioButtonGroup","options","radioVariant","error","wrapperRef","useRef","Fragment","RadioButtonWrapper","Children","radio","ErrorTooltip","FormRadioButtonGroup","props","_isHiddenRequired","field","useInput"],"mappings":"8GAIK,MAACA,EAA4BC,EAAU,WAAC,CAAC,CAAE,MAAAC,EAAO,GAAAC,EAAK,KAAM,MAAAC,EAAO,QAAAC,EAAU,GAAO,SAAAC,EAAW,GAAO,MAAAC,EAAO,SAAAC,EAAU,QAAAC,EAAS,OAAAC,EAAQ,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,UAAW,SAAAC,EAAW,GAAO,aAAAC,EAAc,gBAAAC,EAAiB,GAAGC,CAAI,EAAIC,IAAM,CACtP,MAAMC,EAAUC,EAAAA,MAAO,EACvB,OAAqBC,EAAAA,KAAK,MAAO,CAC7B,SAAU,CACQA,EAAAA,KAAKC,EAAwB,CACvC,WAAY,OAAOf,GAAS,SAC5B,SAAUM,EACV,UAAWC,EACX,UAAWF,EACX,SAAU,CACQW,EAAAA,IAAIC,EAAkB,CAChC,IAAKN,EACL,KAAM,QACN,GAAIf,GAAMgB,EACV,MAAOf,EACP,QAASC,EACT,SAAUQ,EACV,SAAUP,EACV,SAAUE,EACV,QAASC,EACT,OAAQC,EACR,KAAM,QACN,cAAe,cACf,GAAGO,CAC3B,CAAqB,EACaI,EAAAA,KAAKI,EAAkB,CACjC,SAAUpB,EACV,SAAUQ,EACV,UAAWC,EACX,WAAY,OAAOP,GAAS,SAC5B,QAASJ,GAAMgB,EACf,UAAWR,EACX,UAAWL,EACX,SAAU,CACNJ,GAAuBqB,EAAG,IAAC,OAAQ,CAC/B,SAAUrB,CAC1C,CAA6B,EACDa,GAA8BQ,EAAG,IAACG,EAAyB,CACvD,SAAUX,CAC1C,CAA6B,EACDR,GAAuBgB,EAAG,IAACI,EAAuB,CAC9C,SAA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