첫 커밋: 로컬 프로젝트 업로드
This commit is contained in:
28
baron-sso/common/ui/badge.ts
Normal file
28
baron-sso/common/ui/badge.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
export const commonBadgeBaseClass =
|
||||
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2";
|
||||
|
||||
export const commonBadgeVariantClasses = {
|
||||
default:
|
||||
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
||||
secondary:
|
||||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||
outline: "text-foreground",
|
||||
muted: "border-border bg-secondary/60 text-muted-foreground",
|
||||
success:
|
||||
"border-transparent bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",
|
||||
warning:
|
||||
"border-transparent bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-200",
|
||||
destructive:
|
||||
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
||||
info: "border-transparent bg-blue-500 text-white hover:bg-blue-500/90",
|
||||
} as const;
|
||||
|
||||
export type CommonBadgeVariant = keyof typeof commonBadgeVariantClasses;
|
||||
|
||||
export function getCommonBadgeClasses({
|
||||
variant = "default",
|
||||
}: {
|
||||
variant?: CommonBadgeVariant;
|
||||
}) {
|
||||
return [commonBadgeBaseClass, commonBadgeVariantClasses[variant]].join(" ");
|
||||
}
|
||||
Reference in New Issue
Block a user