2024-02-16 01:49:19 +00:00
|
|
|
'use client';
|
2024-02-15 02:30:10 +00:00
|
|
|
|
2024-02-16 01:49:19 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
|
|
import { cva, type VariantProps } from 'class-variance-authority';
|
2024-02-15 02:30:10 +00:00
|
|
|
|
2024-02-16 01:49:19 +00:00
|
|
|
import { cn } from '@/lib/utils';
|
2024-02-15 02:30:10 +00:00
|
|
|
|
|
|
|
const labelVariants = cva(
|
2024-02-16 01:49:19 +00:00
|
|
|
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
|
|
|
|
);
|
2024-02-15 02:30:10 +00:00
|
|
|
|
|
|
|
const Label = React.forwardRef<
|
2024-11-01 01:58:40 +00:00
|
|
|
React.ComponentRef<typeof LabelPrimitive.Root>,
|
2024-02-15 02:30:10 +00:00
|
|
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
|
|
VariantProps<typeof labelVariants>
|
|
|
|
>(({ className, ...props }, ref) => (
|
|
|
|
<LabelPrimitive.Root
|
|
|
|
ref={ref}
|
|
|
|
className={cn(labelVariants(), className)}
|
|
|
|
{...props}
|
|
|
|
/>
|
2024-02-16 01:49:19 +00:00
|
|
|
));
|
|
|
|
Label.displayName = LabelPrimitive.Root.displayName;
|
2024-02-15 02:30:10 +00:00
|
|
|
|
2024-02-16 01:49:19 +00:00
|
|
|
export { Label };
|