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components/dls/Forms/RadioGroup/Item.module.scss","webpack://quran.com/./src/components/dls/Forms/RadioGroup/RadioGroup.module.scss","webpack://quran.com/./src/components/dls/Forms/RadioGroup/Root.module.scss","webpack://quran.com/./src/components/dls/Forms/RadioGroup/Item.tsx","webpack://quran.com/./src/components/dls/Forms/RadioGroup/RadioGroup.tsx","webpack://quran.com/./src/components/dls/Forms/RadioGroup/Root.tsx"],"sourcesContent":["// Exports\nmodule.exports = {\n\t\"indicator\": \"Item_indicator__x6BoJ\",\n\t\"radioItem\": \"Item_radioItem__DEP6h\"\n};\n","// Exports\nmodule.exports = {\n\t\"radioItemContainer\": \"RadioGroup_radioItemContainer__Zpb6v\",\n\t\"label\": \"RadioGroup_label__h0v1C\",\n\t\"disabled\": \"RadioGroup_disabled__aU243\"\n};\n","// Exports\nmodule.exports = {\n\t\"container\": \"Root_container__FbYRt\"\n};\n","import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport classNames from 'classnames';\n\nimport styles from './Item.module.scss';\n\ninterface Props extends RadioGroupPrimitive.RadioGroupItemProps {\n indicatorClassName?: string;\n}\n\nconst Item = ({ className, indicatorClassName, ...props }: Props) => (\n <RadioGroupPrimitive.Item className={classNames(styles.radioItem, className)} {...props}>\n <RadioGroupPrimitive.Indicator className={classNames(styles.indicator, indicatorClassName)} />\n </RadioGroupPrimitive.Item>\n);\n\nexport default Item;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Item from './Item';\nimport styles from './RadioGroup.module.scss';\nimport Root, { Props as RootProps } from './Root';\n\nexport interface RadioItem {\n value: string;\n id: string;\n label: string;\n disabled?: boolean;\n required?: boolean;\n}\n\ninterface Props extends RootProps {\n items: RadioItem[];\n disabled?: boolean;\n}\n\nconst RadioGroup = ({ items, disabled = false, ...props }: Props) => {\n return (\n <Root {...props}>\n {items.map((item) => {\n const isDisabled = disabled === true || item.disabled === true;\n return (\n <div className={styles.radioItemContainer} key={item.id}>\n <Item\n value={item.value}\n id={item.id}\n disabled={isDisabled}\n required={item.required || false}\n />\n\n <label\n htmlFor={item.id}\n className={classNames(styles.label, { [styles.disabled]: isDisabled })}\n >\n {item.label}\n </label>\n </div>\n );\n })}\n </Root>\n );\n};\n\nRadioGroup.Root = Root;\nRadioGroup.Item = Item;\n\n// export `RadioGroupOrientation` type from here so that files that are using it don't break\nexport { RadioRootOrientation as RadioGroupOrientation } from './Root';\n\nexport default RadioGroup;\n","import React from 'react';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport classNames from 'classnames';\n\nimport styles from './Root.module.scss';\n\nimport useDirection from '@/hooks/useDirection';\nimport { Direction } from '@/utils/locale';\n\nexport enum RadioRootOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport interface Props {\n orientation?: RadioRootOrientation;\n label: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n value?: string;\n name?: string;\n required?: boolean;\n className?: string;\n children?: React.ReactNode;\n}\n\nconst Root: React.FC<Props> = ({\n className,\n label,\n orientation = RadioRootOrientation.Vertical,\n onChange,\n defaultValue,\n value,\n name,\n required,\n children,\n}) => {\n const direction = useDirection();\n\n return (\n <RadioGroupPrimitive.Root\n className={classNames(styles.container, className)}\n dir={direction as Direction}\n aria-label={label}\n orientation={orientation}\n {...(onChange && { onValueChange: onChange })}\n {...(defaultValue && { defaultValue })}\n {...(value && { value })}\n {...(name && { name })}\n {...(required && { required })}\n >\n {children}\n </RadioGroupPrimitive.Root>\n );\n};\n\nexport default Root;\n"],"names":["RadioGroupPrimitive","classNames","styles","Item","className","indicatorClassName","props","radioItem","Indicator","indicator","React","Root","RadioGroup","items","disabled","map","item","isDisabled","div","radioItemContainer","value","id","required","label","htmlFor","RadioRootOrientation","RadioGroupOrientation","useDirection","Horizontal","Vertical","orientation","onChange","defaultValue","name","children","direction","container","dir","aria-label","onValueChange"],"sourceRoot":""}
|