import type { ElementType, ReactNode } from 'react'; type LabelVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body2' | 'caption' | 'error' | 'code'; type LabelProps = { variant?: LabelVariant; as?: T; className?: string; children: ReactNode; }; const variantClassMap: Record = { h1: 'ui-title text-3xl font-bold', h2: 'ui-title text-2xl font-semibold', h3: 'ui-title text-xl font-semibold', h4: 'ui-title text-base font-semibold', body: 'ui-body-primary text-sm', body2: 'ui-body-secondary text-sm', caption: 'ui-kicker text-xs font-semibold uppercase tracking-[0.12em]', error: 'ui-error text-sm', code: 'ui-code text-sm font-mono', }; const variantTagMap: Record = { h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h3', body: 'p', body2: 'p', caption: 'p', error: 'p', code: 'code', }; export function Label({ variant = 'body', as, className = '', children, }: Readonly>) { const Component = as ?? variantTagMap[variant]; const classes = `${variantClassMap[variant]} ${className}`.trim(); return {children}; }