blob: 18c025f9dd793edbcee6b7accc46f6e41f8e712e [file] [log] [blame]
giod0026612025-05-08 13:00:36 +00001import * as React from "react";
2import * as LabelPrimitive from "@radix-ui/react-label";
3import { cva, type VariantProps } from "class-variance-authority";
gio5f2f1002025-03-20 18:38:48 +04004
giod0026612025-05-08 13:00:36 +00005import { cn } from "@/lib/utils";
gio5f2f1002025-03-20 18:38:48 +04006
giod0026612025-05-08 13:00:36 +00007const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
gio5f2f1002025-03-20 18:38:48 +04008
9const Label = React.forwardRef<
giod0026612025-05-08 13:00:36 +000010 React.ElementRef<typeof LabelPrimitive.Root>,
11 React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
gio5f2f1002025-03-20 18:38:48 +040012>(({ className, ...props }, ref) => (
giod0026612025-05-08 13:00:36 +000013 <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
14));
15Label.displayName = LabelPrimitive.Root.displayName;
gio5f2f1002025-03-20 18:38:48 +040016
giod0026612025-05-08 13:00:36 +000017export { Label };