Files
CODE_ASSISTANT/2_frontend/src/shared/ui/button.tsx
T
lee-hyeon-cheolandClaude Fable 5.1 458a828409 style(frontend): taste-skill 반영 — 오프블랙 글씨, 버튼 알약/카드 10px 분리, 눌림 피드백
- .agents/skills: Leonxlnx/taste-skill 3개 설치(랜딩용이라 채팅 앱엔 일부만 적용)
- samsung 팔레트: foreground #000→#111. 전역 --radius 20 을 10 으로 내리고 --radius-pill 로 버튼만 알약
- Button: rounded-[var(--radius-pill,var(--radius-md))], active:scale-[0.98]

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 15:21:32 +09:00

51 lines
2.1 KiB
TypeScript

import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils/cn"
const buttonVariants = cva(
// rounded-[var(--radius-pill,var(--radius-md))]: 팔레트가 --radius-pill 을 주면 알약, 아니면 기존 md.
// active:scale-[0.98]: 눌림 피드백(정적 hover 만 있으면 밋밋함).
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-pill,var(--radius-md))] text-sm font-medium ring-offset-background transition-[color,background-color,transform] active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 px-3",
lg: "h-11 px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
)
}
)
Button.displayName = "Button"
export { Button, buttonVariants }