1a4586e126
Build & Deploy to K8s / build-and-deploy (push) Successful in 4m2s
- Badge: variant를 semantic 토큰화 (bg-green-500 하드코딩 제거 → bg-success 등) - border/hover 제거 (클릭 불가 요소에 hover 불필요) - focus-visible ring (focus → focus-visible) - info variant 추가 + solid (filled primary) 추가 - whitespace-nowrap, gap-1 (아이콘 간격 표준) - Button: success/warning variant 제거 (사용처 0건, 상태는 Badge로) - Dialog: size prop 추가 (sm:420 / md:560[default] / lg:720 / xl:960) - 기존 max-w-lg(512) → md(560). className의 max-w-* 가 오면 우선. - 편집 모달의 좁은 폭 문제 해결 - Input: h-10 → h-9 (Button default 높이와 정합) - v5-atomics.css: DEPRECATION NOTICE 주석 추가. 신규 코드는 shadcn <Button>, <Badge> 등 사용. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import * as React from "react";
|
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const badgeVariants = cva(
|
|
"inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-semibold whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default: "bg-primary/12 text-primary",
|
|
solid: "bg-primary text-primary-foreground",
|
|
secondary: "bg-secondary text-secondary-foreground",
|
|
destructive: "bg-destructive/12 text-destructive",
|
|
outline: "border border-border text-foreground",
|
|
success: "bg-success/12 text-success",
|
|
warning: "bg-warning/12 text-warning",
|
|
info: "bg-info/12 text-info",
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: "default",
|
|
},
|
|
},
|
|
);
|
|
|
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
|
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
}
|
|
|
|
export { Badge, badgeVariants };
|