{"version":3,"file":"index.CRUjjmqa.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","import { FlexMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport styled, { css } from 'styled-components';\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 componentId: \"sc-9537c470-0\"\n})([\n `width:100%;`,\n ``\n], ({ $variant })=>$variant && radioButtonGroupVariants[$variant]);\n\nexport { RadioButtonWrapper };\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"],"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","$variant","RadioButtonGroup","options","radioVariant","error","wrapperRef","useRef","Fragment","Children","radio","ErrorTooltip","FormRadioButtonGroup","props","_isHiddenRequired","field","useInput"],"mappings":"6HAIK,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,OAAQC,EACR,KAAM,QACN,cAAe,cACf,GAAGM,CACnB,CAAa,EACaI,EAAAA,KAAKI,EAAkB,CACjC,SAAUnB,EACV,WAAY,OAAOE,GAAS,SAC5B,QAASJ,GAAMe,EACf,UAAWP,EACX,UAAWL,EACX,SAAU,CACQgB,EAAAA,IAAI,OAAQ,CACtB,SAAUpB,CAClC,CAAqB,EACDa,GAA8BO,EAAG,IAACG,EAAyB,CACvD,SAAUV,C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