"use client"; import * as React from "react"; import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; import { Check } from "lucide-react"; import { cn } from "@/lib/utils"; interface CheckboxProps extends Omit, "checked" | "defaultChecked"> { checked?: boolean | "indeterminate"; defaultChecked?: boolean | "indeterminate"; onCheckedChange?: (checked: boolean) => void; required?: boolean; } const CheckboxRoot = CheckboxPrimitive.Root as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; } & React.RefAttributes >; const CheckboxIndicator = CheckboxPrimitive.Indicator as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; } & React.RefAttributes >; const Checkbox = React.forwardRef( ({ className, onCheckedChange, children: _children, ...props }, ref) => ( { // Handle indeterminate state by treating it as false for consumers expecting boolean if (onCheckedChange) { onCheckedChange(checked === true); } }} {...props} > ) ); Checkbox.displayName = CheckboxPrimitive.Root.displayName; export { Checkbox };