| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 1 | import * as React from "react"; |
| 2 | import * as LabelPrimitive from "@radix-ui/react-label"; |
| 3 | import { cva, type VariantProps } from "class-variance-authority"; |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 4 | |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 5 | import { cn } from "@/lib/utils"; |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 6 | |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 7 | const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"); |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 8 | |
| 9 | const Label = React.forwardRef< |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 10 | React.ElementRef<typeof LabelPrimitive.Root>, |
| 11 | React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants> |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 12 | >(({ className, ...props }, ref) => ( |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 13 | <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} /> |
| 14 | )); |
| 15 | Label.displayName = LabelPrimitive.Root.displayName; |
| gio | 5f2f100 | 2025-03-20 18:38:48 +0400 | [diff] [blame] | 16 | |
| gio | d002661 | 2025-05-08 13:00:36 +0000 | [diff] [blame] | 17 | export { Label }; |