index.ts 1.3 KB

1234567891011121314151617181920212223242526
  1. import type { VariantProps } from "class-variance-authority"
  2. import { cva } from "class-variance-authority"
  3. export { default as Badge } from "./Badge.vue"
  4. export const badgeVariants = cva(
  5. "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
  6. {
  7. variants: {
  8. variant: {
  9. default:
  10. "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
  11. secondary:
  12. "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
  13. destructive:
  14. "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
  15. outline:
  16. "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
  17. },
  18. },
  19. defaultVariants: {
  20. variant: "default",
  21. },
  22. },
  23. )
  24. export type BadgeVariants = VariantProps<typeof badgeVariants>