import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" // CTA 버튼 토큰. 랜딩의 CTA 는 전부 앵커 스크롤이라 href 를 주면 로 렌더한다 // (SSG 특성상 하이드레이션 전에도 동작). const buttonVariants = cva( /* transition-colors 로 좁힌다. transition-all 이면 헤더 CTA 가 무대↔라이트로 variant 를 통째로 바꿀 때 배경이 투명에서 차오르며 플리커로 읽힌다. */ "inline-flex items-center justify-center gap-2 transition-colors duration-200 cursor-pointer disabled:opacity-50", { variants: { variant: { primary: "bg-primary hover:bg-primary-deep text-white", secondary: "bg-fill hover:bg-fill-hover text-ink-soft hover:text-ink", // 밝은 배경 위 반투명 보조 버튼 (글라스 히어로) glass: "bg-white/70 hover:bg-white text-ink-soft hover:text-ink border border-white shadow-sm", // 다크 무대 위 1차 CTA stage: "bg-primary hover:bg-primary-deep text-white", // 다크 무대 위 2차 CTA — 흰 알약 stageGhost: "bg-transparent hover:bg-white text-white hover:text-stage border border-stage-line hover:border-white", }, /* 레퍼런스(statworx) 실측: 10.4px / 600 / 알약(radius 39px) / 패딩 12·24 / 높이 33px. 작고 조밀한 버튼이 확신 있어 보인다 — 크고 굵은 버튼은 설득이 아니라 호소로 읽힌다. 한글 보정: 10.4px 는 판독이 어려워 12~13px 로 올리고 높이도 터치 타깃까지 확보한다. (기존 주석의 "알약형 금지" 규칙은 레퍼런스 채택으로 폐기했다.) */ size: { pill: "px-5 py-2.5 text-[12px] font-semibold rounded-full", md: "px-6 py-3 text-[12px] font-semibold rounded-full", lg: "px-7 py-3.5 text-[13px] font-semibold rounded-full", xl: "px-8 py-4 text-[14px] font-semibold rounded-full", stageRound: "px-7 py-3.5 text-[13px] font-semibold rounded-full", }, }, defaultVariants: { variant: "primary", size: "lg" }, }, ) type ButtonProps = VariantProps & React.ButtonHTMLAttributes & React.AnchorHTMLAttributes & { href?: string } function Button({ className, variant, size, href, ...props }: ButtonProps) { const Comp: React.ElementType = href ? "a" : "button" return } export { Button, buttonVariants }