Skip to content

Commit

Permalink
fix(#273): add Label.tsx file
Browse files Browse the repository at this point in the history
  • Loading branch information
CorinaMurg committed Jul 18, 2024
1 parent ff1f640 commit c639f72
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions components/Label/Label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

'use client';

import * as React from 'react';
import * as LabelPrimitive from '@radix-ui/react-label';
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '../../utils/utils';

const labelVariants = cva(
'font-normal leading-none w-full transition',
{
variants: {
variant: {
weeklyPickButtonLabel: 'text-base text-zinc-50 cursor-pointer rounded-xl items-center py-4 px-3 border-2 border-zinc-800 peer-aria-checked:border-orange-600 peer-hover:bg-zinc-800 flex gap-2',
inputLabel: 'text-sm text-zinc-900 cursor-text flex-col gap-1.5',
}
},
defaultVariants: {
variant: 'inputLabel'
}
}
);

const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
VariantProps<typeof labelVariants>
>(({ className, variant, ...props }, ref) => (
<LabelPrimitive.Root
ref={ref}
className={cn(labelVariants({ variant }), className)}
{...props}
/>
));
Label.displayName = LabelPrimitive.Root.displayName;

export { Label };

0 comments on commit c639f72

Please sign in to comment.