OpChan/app/src/components/ui/label.tsx

25 lines
718 B
TypeScript
Raw Normal View History

2025-08-30 18:34:50 +05:30
import * as React from 'react';
import * as LabelPrimitive from '@radix-ui/react-label';
import { cva, type VariantProps } from 'class-variance-authority';
2025-04-15 16:28:03 +05:30
2025-10-03 19:00:01 +05:30
import { cn } from '../../utils';
2025-04-15 16:28:03 +05:30
const labelVariants = cva(
2025-08-30 18:34:50 +05:30
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
);
2025-04-15 16:28:03 +05:30
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}
/>
2025-08-30 18:34:50 +05:30
));
Label.displayName = LabelPrimitive.Root.displayName;
2025-04-15 16:28:03 +05:30
2025-08-30 18:34:50 +05:30
export { Label };