32 lines
1.7 KiB
TypeScript
32 lines
1.7 KiB
TypeScript
import type { VariantProps } from "class-variance-authority";
|
|
import { cva } from "class-variance-authority";
|
|
|
|
export { default as Badge } from "./Badge.vue";
|
|
|
|
export const badgeVariants = cva(
|
|
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2.5 py-1 text-label whitespace-nowrap transition-[background-color,border-color,color,box-shadow] outline-none [&>svg]:pointer-events-none [&>svg]:size-3 [&>svg]:shrink-0 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default:
|
|
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
secondary:
|
|
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80",
|
|
destructive:
|
|
"border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/35",
|
|
outline:
|
|
"border-border bg-card text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
success:
|
|
"border-transparent bg-success text-success-foreground [a&]:hover:brightness-95",
|
|
warning:
|
|
"border-transparent bg-warning text-warning-foreground [a&]:hover:brightness-95",
|
|
info: "border-transparent bg-info text-info-foreground [a&]:hover:brightness-95",
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: "default",
|
|
},
|
|
},
|
|
);
|
|
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|