{"version":3,"file":"radio-group.cjs","sources":["../../../src/components/radio-group.tsx"],"sourcesContent":["import React, { type ReactElement, type ReactNode, useId } from \"react\";\nimport { BaseInputWrapper, type BaseInputWrapperProps } from \"./commons/input\";\nimport { Typography } from \"./typography\";\nimport { mergedCva } from \"../utils/components\";\n\nexport interface RadioGroupProps\n    extends Omit<BaseInputWrapperProps, \"className\" | \"id\" | \"loading\"> {\n    id?: string;\n    className?: BaseInputWrapperProps[\"className\"] & {\n        radioInputsWrapper?: string;\n    };\n    children: ReactNode[];\n}\n\nconst radioInputsWrapperStyles = mergedCva([\"flex\", \"gap-4\"]);\n\nexport const RadioGroup = ({\n    id,\n    label,\n    error,\n    errorText,\n    info,\n    children,\n    className,\n}: RadioGroupProps): ReactElement => {\n    const generatedId = useId();\n\n    const resolvedId = id || generatedId;\n\n    return (\n        <BaseInputWrapper\n            id={resolvedId}\n            error={error}\n            errorText={errorText}\n            info={info}\n            className={className}\n        >\n            <Typography className={className?.labelText}>{label}</Typography>\n            <div\n                className={radioInputsWrapperStyles({\n                    className: className?.radioInputsWrapper,\n                })}\n            >\n                {children}\n            </div>\n        </BaseInputWrapper>\n    );\n};\n"],"names":["mergedCva","useId","BaseInputWrapper","Typography"],"mappings":";;;;;;;AAcA,MAAM,wBAA2B,GAAAA,oBAAA,CAAU,CAAC,MAAA,EAAQ,OAAO,CAAC,CAAA,CAAA;AAErD,MAAM,aAAa,CAAC;AAAA,EACvB,EAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AACJ,CAAqC,KAAA;AACjC,EAAA,MAAM,cAAcC,WAAM,EAAA,CAAA;AAE1B,EAAA,MAAM,aAAa,EAAM,IAAA,WAAA,CAAA;AAEzB,EACI,uBAAA,KAAA,CAAA,aAAA;AAAA,IAACC,sBAAA;AAAA,IAAA;AAAA,MACG,EAAI,EAAA,UAAA;AAAA,MACJ,KAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,KAAA;AAAA,oBAEC,KAAA,CAAA,aAAA,CAAAC,qBAAA,EAAA,EAAW,SAAW,EAAA,SAAA,EAAW,aAAY,KAAM,CAAA;AAAA,oBACpD,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACG,WAAW,wBAAyB,CAAA;AAAA,UAChC,WAAW,SAAW,EAAA,kBAAA;AAAA,SACzB,CAAA;AAAA,OAAA;AAAA,MAEA,QAAA;AAAA,KACL;AAAA,GACJ,CAAA;AAER;;;;"}