import { type ReactElement, useState, type ComponentProps } from "react"; import { CheckIcon, MinusIcon } from "lucide-react"; import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"; import { cn } from "@/lib/utils"; /** * Checkbox — shadcn/WealthX Design System * Figma: https://www.figma.com/design/9V9F0NGVsif8LGmEhVjOcT/Design-System---shadcn?node-id=72-2723 * * States: unchecked | checked | indeterminate × default | disabled | error * White-label: checked/indeterminate use `primary` token → adapts to tenant color. * Error+checked/indeterminate: stacked variant overrides primary with destructive (higher specificity). */ export type CheckboxProps = ComponentProps; function Checkbox({ className, ...props }: CheckboxProps): ReactElement { return ( ); } /** * CheckboxCard — card wrapper with label + optional description. * Figma: Checkbox_card (3029:12381) * * Card background: primary/5 when checked/indeterminate; destructive/5 when error+checked. * White-label: opacity modifier on primary token → adapts to tenant color. */ export type CheckboxCardProps = ComponentProps< typeof CheckboxPrimitive.Root > & { label: string; description?: string; error?: boolean; }; function CheckboxCard({ className, checked, defaultChecked, onCheckedChange, disabled, error, label, description, ...props }: CheckboxCardProps): ReactElement { const [internalChecked, setInternalChecked] = useState( Boolean(defaultChecked), ); const resolvedChecked = checked ?? internalChecked; const isTinted = resolvedChecked; return ( ); } export { Checkbox, CheckboxCard };