import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" // 디자인시스템 텍스트 토큰. 페이지마다 text-2xl/font-bold/tracking-...를 // 직접 박지 말고 variant로 통일한다. 실제로 코드에 흩어져 있던 조합을 그대로 토큰화함. const typographyVariants = cva("", { variants: { variant: { h1: "text-4xl font-bold tracking-tight text-foreground", h2: "text-2xl font-bold tracking-tight text-foreground", h3: "text-xl font-bold text-foreground", h4: "text-lg font-semibold text-foreground", body: "text-base text-foreground", small: "text-sm text-foreground", muted: "text-sm text-muted-foreground leading-relaxed", // 폼 라벨: 대문자 트래킹 (login의 label 패턴) label: "text-xs font-semibold uppercase tracking-wider text-foreground", // 모노 캡션: 콘솔/메타 텍스트 (login 서브타이틀, 푸터 등) mono: "text-xs font-mono uppercase tracking-wider text-muted-foreground", // 사이드바/헤더 등 chrome 메타텍스트: type scale 최소(text-xs=12px)보다 작은 11px 캡션 caption: "text-[11px] text-muted-foreground leading-normal", }, }, defaultVariants: { variant: "body" }, }) const defaultTag: Record["variant"]>, React.ElementType> = { h1: "h1", h2: "h2", h3: "h3", h4: "h4", body: "p", small: "p", muted: "p", label: "span", mono: "span", caption: "span", } type TypographyProps = React.HTMLAttributes & VariantProps & { /** 의미상 태그를 강제로 바꾸고 싶을 때 (예: label variant를