// https://ui.shadcn.com/docs/components/label import * as LabelPrimitive from '@radix-ui/react-label' import { Slot } from '@radix-ui/react-slot' import { cva, type VariantProps } from 'class-variance-authority' import type * as React from 'react' import { cn } from '../../utils/cn' import { typographyVariants } from '../Typography' const labelVariants = cva('flex gap-1 items-center', { variants: { size: { default: typographyVariants({ variant: 'body-semi-s', color: 'muted', }), sm: typographyVariants({ variant: 'body-semi-xs', color: 'muted' }), xs: typographyVariants({ variant: 'body-semi-xs', color: 'muted' }), }, }, defaultVariants: { size: 'default', }, }) type LabelProps = React.ComponentPropsWithoutRef & VariantProps & { asChild?: boolean ref?: React.Ref> } const Label = ({ className, size, asChild, ref, ...props }: LabelProps) => { const Comp = asChild ? Slot : LabelPrimitive.Root return ( ) } Label.displayName = LabelPrimitive.Root.displayName export { Label, labelVariants }