'use client' import * as RadioGroupPrimitive from '@radix-ui/react-radio-group' import { IconCircle } from '@tabler/icons-react' import * as React from 'react' import { tv } from 'tailwind-variants' import type { Merge } from 'type-fest' const radioGroup = tv({ slots: { root: 'grid gap-2', item: [ 'aspect-square size-4 rounded-full border border-fg', 'disabled:cursor-not-allowed disabled:opacity-50', ], indicatorIcon: 'size-3 fill-current m-auto', }, }) const RadioGroupRoot = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >((props, ref) => { const { root } = radioGroup() return ( ) }) RadioGroupRoot.displayName = RadioGroupPrimitive.Root.displayName const RadioGroupItem = React.forwardRef< React.ElementRef, Merge< React.ComponentPropsWithoutRef, { indicatorIconProps?: React.ComponentProps } > >(({ indicatorIconProps, ...props }, ref) => { const { item, indicatorIcon } = radioGroup() return ( ) }) RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName const RadioGroup = Object.assign(RadioGroupRoot, { Item: RadioGroupItem, }) export default RadioGroup export { radioGroup, RadioGroupPrimitive }