import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; import { CircleIcon } from "lucide-react"; import { type ComponentRef, forwardRef, type ReactElement } from "react"; import { useThemedVariants } from "../../theme/use-themed-variants/use-themed-variants.js"; import { cn } from "../../utils/cn/cn.js"; import type { RadioGroupItemProps, RadioGroupProps, } from "./radio-group.types.js"; import { radioGroupItemVariants, radioGroupVariants, } from "./radio-group.variants.js"; /** * `` — chassis radio-group container built on * `@radix-ui/react-radio-group`. * * Radix supplies the a11y semantics (`role="radiogroup"`, roving * tabindex across items, arrow-key navigation, native `Space` * activation, controlled `value` propagation). The chassis layers a * vertical-stack flex/gap layout via cva. * * Per shadcn convention, items always sit inside the group via * ``; rendering an item without a group is * unsupported. */ export const RadioGroup = forwardRef< ComponentRef, RadioGroupProps >(function RadioGroup(props, ref): ReactElement { const { className, ...rest } = props; const variants = useThemedVariants("RadioGroup", radioGroupVariants); const classes = cn(variants(), className); return ; }); RadioGroup.displayName = "RadioGroup"; /** * `` — single radio inside ``. Renders a * Radix Item containing the circular indicator (`` filled * with the current text colour) when checked. * * Refs are forwarded to the Radix Item (the rendered `