import { type ReactElement, type ComponentProps } from "react" import { CircleIcon } from "lucide-react" import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group" import { Radio as RadioPrimitive } from "@base-ui/react/radio" import { cn } from "@/lib/utils" /** * RadioGroup — WealthX Design System (shadcn base) * Figma: https://www.figma.com/design/9V9F0NGVsif8LGmEhVjOcT/Design-System---shadcn?node-id=76-8893 * * Base: official shadcn radio-group (npx shadcn\@latest add radio-group) * WealthX additions: RadioGroupCard (card with radio + label/description) * * Tokens: circle fill=background (white), stroke=primary, checked fill=primary, * indicator=background. Error overrides primary-destructive. */ /* Shared radio circle base classes -- single source for Item & Card */ const CIRCLE_BASE = "inline-flex items-center justify-center aspect-square size-4 shrink-0 rounded-full border border-primary bg-background" /* Shared indicator dot */ const INDICATOR_DOT = "size-2 fill-background text-background" export type RadioGroupProps = RadioGroupPrimitive.Props function RadioGroup({ className, ...props }: RadioGroupProps): ReactElement { return ( ) } export type RadioGroupItemProps = ComponentProps function RadioGroupItem({ className, ...props }: RadioGroupItemProps): ReactElement { return ( ) } /** * RadioGroupCard -- card with radio left, label+description right. * Figma: CardRadio (3039:5971) * Checked: border-primary + bg-primary/5. Error: destructive variant. */ export type RadioGroupCardProps = Omit, "children"> & { label: string description?: string error?: boolean } function RadioGroupCard({ className, value, disabled, error, label, description, ...props }: RadioGroupCardProps): ReactElement { return (
{label} {description ? {description} : null}
) } export { RadioGroup, RadioGroupItem, RadioGroupCard }