2024-09-07 09:12:48 +02:00
|
|
|
"use client";
|
2024-06-20 17:37:45 +02:00
|
|
|
|
2024-09-07 09:12:48 +02:00
|
|
|
import * as React from "react";
|
|
|
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
|
|
import { cva, type VariantProps } from "class-variance-authority";
|
2024-06-20 17:37:45 +02:00
|
|
|
|
2024-09-07 09:12:48 +02:00
|
|
|
import { cn } from "@/lib/utils";
|
2024-06-20 17:37:45 +02:00
|
|
|
|
|
|
|
const labelVariants = cva(
|
|
|
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
2024-09-07 09:12:48 +02:00
|
|
|
);
|
2024-06-20 17:37:45 +02:00
|
|
|
|
|
|
|
const Label = React.forwardRef<
|
|
|
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
|
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
|
|
VariantProps<typeof labelVariants>
|
|
|
|
>(({ className, ...props }, ref) => (
|
|
|
|
<LabelPrimitive.Root
|
|
|
|
ref={ref}
|
|
|
|
className={cn(labelVariants(), className)}
|
|
|
|
{...props}
|
|
|
|
/>
|
2024-09-07 09:12:48 +02:00
|
|
|
));
|
|
|
|
Label.displayName = LabelPrimitive.Root.displayName;
|
2024-06-20 17:37:45 +02:00
|
|
|
|
2024-09-07 09:12:48 +02:00
|
|
|
export { Label };
|