| 7 | import { cn } from "../lib/utils"; |
| 8 | |
| 9 | function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) { |
| 10 | return ( |
| 11 | <CheckboxPrimitive.Root |
| 12 | data-slot="checkbox" |
| 13 | className={cn( |
| 14 | "peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary", |
| 15 | className, |
| 16 | )} |
| 17 | {...props} |
| 18 | > |
| 19 | <CheckboxPrimitive.Indicator |
| 20 | data-slot="checkbox-indicator" |
| 21 | className="grid place-content-center text-current transition-none" |
| 22 | > |
| 23 | <CheckIcon className="size-3.5" /> |
| 24 | </CheckboxPrimitive.Indicator> |
| 25 | </CheckboxPrimitive.Root> |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | export { Checkbox }; |