{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "title": "Badge",
  "description": "Small status or count label with neutral, semantic, outline, ghost and link variants.",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "radix-ui@^1.6.7"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/ui/badge.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* The font size lives only in the variants, one per variant: cva joins base and\n   variant without merging, so a size in both would leave the winner of\n   badgeVariants() used without cn() to stylesheet order. cva returns no variant\n   class for a null variant, so a compound variant restores the base size there:\n   badgeVariants({ variant: null }) still carries exactly one size class. */\nconst badgeVariants = cva(\n  \"group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"bg-primary text-caption text-primary-foreground [a]:hover:bg-primary/80\",\n        /* Ink is --secondary-foreground, matching every other filled variant\n           here: a fill token travels with its own foreground token. This one\n           reached for --muted-foreground instead — a *text* role, never\n           declared as the ink for this surface — and landed at 3.26:1. */\n        secondary:\n          \"bg-secondary text-caption text-secondary-foreground [a]:hover:bg-secondary/80\",\n        count:\n          \"h-5 min-w-5 justify-center bg-info px-1 text-micro font-semibold text-info-foreground tabular-nums\",\n        /* The tinted trio takes --<tone>-ink, not --<tone>. The fill token is\n           chosen to be a vivid fill and cannot also be legible on a 10% wash\n           of itself — see the note beside the tokens in index.css. */\n        info: \"bg-info/10 text-caption text-info-ink\",\n        success: \"bg-success/10 text-caption text-success-ink\",\n        warning: \"bg-warning/15 text-caption text-warning-ink\",\n        destructive:\n          \"bg-destructive/10 text-caption text-destructive-ink focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20\",\n        outline:\n          \"border-border text-caption text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n        ghost:\n          \"text-caption hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n        link: \"text-caption text-primary underline-offset-4 hover:underline\",\n      },\n    },\n    compoundVariants: [{ variant: null, class: \"text-caption\" }],\n    defaultVariants: {\n      variant: \"default\",\n    },\n  },\n)\n\n/* Entrance pop — 0.9 → 1 with the opacity, on the bouncy spring. A badge is\n   small, arrives rarely, and carries news (\"3 new\", \"Live\"), which is exactly\n   the low-frequency moment overshoot is reserved for.\n\n   Opt-in, because the animation fires on mount and a badge that is simply\n   always there has not *appeared* — a wall of them popping on first paint is\n   the failure mode. Reach for it when the badge shows up in response to\n   something: a count landing, a status flipping, a filter chip being added.\n\n   `anim-*` rather than `duration-*`: the pill already carries `transition-all`\n   for its colour, and the entrance runs long while that stays short. */\nconst badgeAppear =\n  \"animate-in fade-in zoom-in-90 anim-spring-bouncy ease-spring-bouncy\"\n\nfunction Badge({\n  className,\n  variant = \"default\",\n  asChild = false,\n  appear = false,\n  ...props\n}: React.ComponentProps<\"span\"> &\n  VariantProps<typeof badgeVariants> & {\n    asChild?: boolean\n    /* Play the entrance pop on mount. For badges that arrive, not ones that\n       are always on screen. */\n    appear?: boolean\n  }) {\n  const Comp = asChild ? Slot.Root : \"span\"\n\n  return (\n    <Comp\n      data-slot=\"badge\"\n      data-variant={variant}\n      className={cn(badgeVariants({ variant }), appear && badgeAppear, className)}\n      {...props}\n    />\n  )\n}\n\nexport { Badge, badgeVariants }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}