File size: 1,318 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { cva } from "class-variance-authority";

export const badgeVariants = cva(
  "inline-flex items-center rounded-full border px-3 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
  {
    variants: {
      variant: {
        primary: "border-primary bg-primary text-primary-foreground",
        secondary: "border-secondary bg-secondary text-secondary-foreground",
        error: "border-error bg-error text-error-foreground",
        warning: "border-warning bg-warning text-warning-foreground",
        info: "border-info bg-info text-info-foreground",
        success: "border-success bg-success text-success-foreground",
      },
      outline: {
        true: "bg-transparent",
      },
    },
    compoundVariants: [
      { outline: true, variant: "primary", className: "text-primary" },
      { outline: true, variant: "secondary", className: "text-secondary" },
      { outline: true, variant: "error", className: "text-error" },
      { outline: true, variant: "warning", className: "text-warning" },
      { outline: true, variant: "info", className: "text-info" },
      { outline: true, variant: "success", className: "text-success" },
    ],
    defaultVariants: {
      variant: "primary",
      outline: false,
    },
  },
);