Line data Source code
1 : import type { VariantProps } from 'cva'
2 : import { cva } from 'cva'
3 :
4 2356 : export const badgeVariants = cva({
5 : base: 'inline-flex shrink-0 items-center justify-center gap-1 font-medium whitespace-nowrap',
6 : variants: {
7 : variant: {
8 : tag: 'rounded-md px-2 py-1 text-sm font-bold',
9 : chip: 'min-h-7 rounded-full px-2 py-1 text-sm',
10 : badge: 'min-h-5 min-w-5 rounded-full px-1.5 text-xs',
11 : compact: 'h-5 rounded-full px-2 py-0.5 text-xs normal-case',
12 : label: 'h-3.5 rounded-full px-1 text-3xs font-semibold uppercase',
13 : circle: 'size-3.5 rounded-full text-3xs font-semibold',
14 : outline: 'rounded-sm border px-1.5 py-0.5 text-2xs',
15 : square: 'rounded-sm px-1.5 py-0.5 text-xs',
16 : pill: 'rounded-full px-2 py-0.5 text-2xs',
17 : dot: 'size-2 rounded-full p-0'
18 : },
19 : severity: {
20 : default: 'bg-primary text-foreground',
21 : contrast: 'bg-foreground text-background',
22 : primary: 'bg-primary/10 text-foreground',
23 : secondary: 'bg-secondary text-foreground',
24 : muted: 'bg-muted text-muted-foreground',
25 : danger: 'bg-destructive text-foreground',
26 : info: 'bg-primary/20 text-foreground',
27 : success: 'bg-success/15 text-foreground',
28 : warning: 'bg-warning text-warning-foreground'
29 : }
30 : },
31 : compoundVariants: [
32 : { variant: 'outline', class: 'bg-transparent text-foreground' }
33 : ],
34 : defaultVariants: { variant: 'tag', severity: 'secondary' }
35 : })
36 :
37 : export type BadgeVariants = VariantProps<typeof badgeVariants>
|