-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff1f640
commit c639f72
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; | ||
|