| 1 | import * as React from "react"; |
| 2 | import * as LabelPrimitive from "@radix-ui/react-label"; |
| 3 | import { cva, type VariantProps } from "class-variance-authority"; |
| 4 | |
| 5 | import { cn } from "@/lib/utils"; |
| 6 | |
| 7 | const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"); |
| 8 | |
| 9 | const Label = React.forwardRef< |
| 10 | React.ElementRef<typeof LabelPrimitive.Root>, |
| 11 | React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants> |
| 12 | >(({ className, ...props }, ref) => ( |
| 13 | <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} /> |
| 14 | )); |
| 15 | Label.displayName = LabelPrimitive.Root.displayName; |
| 16 | |
| 17 | export { Label }; |