{"version":3,"file":"index.r_XmfNQZ.js","sources":["../../../../../../../node_modules/@babylon/ui-kit-forms/esm/components/inputs/radio-button-group/components/radio-button/index.mjs","../../../../../../../node_modules/@babylon/ui-kit-forms/esm/components/inputs/radio-button-group/styled.mjs","../../../../../../../node_modules/@babylon/ui-kit-forms/esm/components/inputs/radio-button-group/index.mjs"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef, useId } from 'react';\nimport { RadioButtonItemWrapper, RadioButtonInput, RadioButtonLabel, RadioButtonRightContent, RadioButtonLabelCount } from './styled.mjs';\n\nconst RadioButton = /*#__PURE__*/ forwardRef(({ label, id = null, value, checked = false, disabled = false, count, onChange, onClick, onBlur, hasError, className, variant = 'default', extended = false, rightContent, ...rest }, ref)=>{\n const radioId = useId();\n return /*#__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 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 $withCount: typeof count == 'number',\n htmlFor: id ?? radioId,\n $hasError: hasError,\n $disabled: disabled,\n children: [\n /*#__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});\nRadioButton.displayName = 'RadioButton';\n\nexport { RadioButton as default };\n//# sourceMappingURL=index.mjs.map\n","import { FlexMixin, FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport styled, { css } from 'styled-components';\nimport { RadioButtonLabel, RadioButtonItemWrapper } from './components/radio-button/styled.mjs';\n\nconst radioButtonGroupVariants = {\n horizontal: /*#__PURE__*/ css([\n ``,\n ` gap:16px;`\n ], FlexMixin()),\n vertical: /*#__PURE__*/ css([\n ``,\n ` gap:12px;`\n ], FlexMixin({\n direction: 'column'\n }))\n};\nconst RadioButtonWrapper = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"RadioButtonWrapper\"\n})([\n `width:100%;`,\n `{`,\n `{`,\n ` &::before{width:24px;height:24px;}&::after{width:12px;height:12px;left:6px;}}`,\n `{gap:12px;}}`,\n ``\n], ({ theme })=>theme.media.phone.only, RadioButtonLabel, FontMixin({\n height: 'base'\n}), RadioButtonItemWrapper, ({ $variant })=>$variant && radioButtonGroupVariants[$variant]);\n\nexport { RadioButtonWrapper };\n//# sourceMappingURL=styled.mjs.map\n","import { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport ErrorTooltip from '../../others/error-tooltip/index.mjs';\nimport { useInput } from '../../../hooks/useInput/index.mjs';\nimport { forwardRef, useRef, Children } from 'react';\nimport RadioButton from './components/radio-button/index.mjs';\nimport { RadioButtonWrapper } from './styled.mjs';\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 })))\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.mjs.map\n"],"names":["RadioButton","forwardRef","label","id","value","checked","disabled","count","onChange","onClick","onBlur","hasError","className","variant","extended","rightContent","rest","ref","radioId","useId","jsxs","RadioButtonItemWrapper","jsx","RadioButtonInput","RadioButtonLabel","RadioButtonRightContent","RadioButtonLabelCount","radioButtonGroupVariants","css","FlexMixin","RadioButtonWrapper","styled","theme","FontMixin","$variant","RadioButtonGroup","options","radioVariant","error","wrapperRef","useRef","Fragment","Children","radio","ErrorTooltip","FormRadioButtonGroup","props","_isHiddenRequired","field","useInput"],"mappings":"oIAIK,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,GAAGC,CAAI,EAAIC,IAAM,CACrO,MAAMC,EAAUC,EAAAA,QAChB,OAAqBC,EAAAA,KAAKC,EAAwB,CAC9C,WAAY,OAAOd,GAAS,SAC5B,SAAUM,EACV,UAAWC,EACX,UAAWF,EACX,SAAU,CACQU,EAAAA,IAAIC,EAAkB,CAChC,IAAKN,EACL,KAAM,QACN,GAAId,GAAMe,EACV,MAAOd,EACP,QAASC,EACT,SAAUC,EACV,SAAUE,EACV,QAASC,EACT,OAA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