refactor: 更新 Badge 组件为医疗健康风格

This commit is contained in:
张翔
2026-02-23 00:10:45 +08:00
parent 9394cbab1b
commit 5f0f642ab6
+9 -8
View File
@@ -5,20 +5,21 @@ import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const badgeVariants = cva(
"inline-flex items-center justify-center rounded-full border px-3 py-1 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-[var(--color-tech-blue)] focus-visible:ring-2 focus-visible:ring-[var(--color-tech-blue)]/50 transition-all duration-300 overflow-hidden",
"inline-flex items-center justify-center rounded-full border px-3 py-1 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-[#005EB8] focus-visible:ring-2 focus-visible:ring-[#005EB8]/50 transition-all duration-300 overflow-hidden",
{
variants: {
variant: {
default: "bg-gradient-to-r from-[var(--color-tech-blue)] to-[var(--color-tech-purple)] text-white border-transparent shadow-lg shadow-[var(--color-tech-blue)]/30",
default: "bg-[#C41E3A] text-white border-transparent shadow-sm",
secondary:
"bg-[var(--color-bg-tertiary)] text-gray-300 border-gray-700 hover:border-[var(--color-tech-blue)] hover:text-[var(--color-tech-blue)]",
"bg-[#005EB8] text-white border-transparent shadow-sm",
destructive:
"bg-red-600 text-white border-transparent hover:bg-red-700",
"bg-[#DC2626] text-white border-transparent hover:bg-[#B91C1C]",
outline:
"border-[var(--color-tech-blue)] text-[var(--color-tech-blue)] hover:bg-[var(--color-tech-blue)]/10 hover:shadow-lg hover:shadow-[var(--color-tech-blue)]/20",
ghost: "text-gray-400 hover:text-[var(--color-tech-blue)] hover:bg-[var(--color-bg-tertiary)]",
success: "bg-green-600 text-white border-transparent hover:bg-green-700",
warning: "bg-yellow-600 text-white border-transparent hover:bg-yellow-700",
"border-[#005EB8] text-[#005EB8] bg-transparent hover:bg-[#E8F4FD]",
ghost: "text-[#718096] hover:text-[#005EB8] hover:bg-[#F5F7FA]",
success: "bg-[#16A34A] text-white border-transparent hover:bg-[#15803D]",
warning: "bg-[#D97706] text-white border-transparent hover:bg-[#B45309]",
info: "bg-[#0284C7] text-white border-transparent hover:bg-[#0369A1]",
},
},
defaultVariants: {