{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-badge",
  "title": "Status Badge",
  "description": "Presence or state pill with a coloured dot and a tinted body.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/ui/status-badge.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Presence / state pill. The dot carries the semantic token at full strength;\n   the body is a quiet wash of the same hue so a row of these stays calm.\n   Note: no status claims --info — blue is reserved for the selected state. */\nconst statusBadgeVariants = cva(\n  \"group/status-badge inline-flex h-6 w-fit shrink-0 items-center gap-1.5 rounded-full border border-transparent px-2.5 text-caption font-medium whitespace-nowrap transition-all *:data-[slot=status-badge-dot]:size-1.5 *:data-[slot=status-badge-dot]:shrink-0 *:data-[slot=status-badge-dot]:rounded-full\",\n  {\n    variants: {\n      status: {\n        online:\n          \"bg-success/10 text-success *:data-[slot=status-badge-dot]:bg-success\",\n        offline:\n          \"bg-secondary text-muted-foreground *:data-[slot=status-badge-dot]:bg-muted-foreground\",\n        busy: \"bg-destructive/10 text-destructive dark:bg-destructive/20 *:data-[slot=status-badge-dot]:bg-destructive\",\n        /* warning-foreground is near-black — readable on the light wash only,\n           so dark mode falls back to the hue itself */\n        away: \"bg-warning/15 text-warning-ink *:data-[slot=status-badge-dot]:bg-warning\",\n        success:\n          \"bg-success/10 text-success *:data-[slot=status-badge-dot]:bg-success\",\n        warning:\n          \"bg-warning/15 text-warning-ink *:data-[slot=status-badge-dot]:bg-warning\",\n        error:\n          \"bg-destructive/10 text-destructive dark:bg-destructive/20 *:data-[slot=status-badge-dot]:bg-destructive\",\n        neutral:\n          \"bg-secondary text-muted-foreground *:data-[slot=status-badge-dot]:bg-muted-foreground\",\n      },\n    },\n    defaultVariants: {\n      status: \"neutral\",\n    },\n  }\n)\n\n/* Same entrance pop as Badge, same reasoning: opt-in, for a pill that arrives\n   rather than one that has been sitting there since first paint, and `anim-*`\n   so the long entrance does not retime the short colour transition. */\nconst statusBadgeAppear =\n  \"animate-in fade-in zoom-in-90 anim-spring-bouncy ease-spring-bouncy\"\n\n/* Breathing ring around the dot, for a genuinely live status — a running job,\n   a connected peer. A halo that swells and fades reads as \"ongoing\" where a\n   blinking dot reads as \"broken\". `bg-inherit` picks up whatever colour the\n   status variant put on the dot, so the ring never needs its own palette, and\n   the resting opacity is 0 — the keyframes own every frame it is visible, so\n   with motion reduced it simply is not there. */\nconst statusBadgePulse =\n  \"relative after:absolute after:-inset-1 after:animate-pulse-ring after:rounded-full after:bg-inherit after:opacity-0\"\n\nfunction StatusBadge({\n  className,\n  status = \"neutral\",\n  pulse = false,\n  appear = false,\n  children,\n  ...props\n}: React.ComponentProps<\"span\"> & {\n  /* non-nullable so data-status is always a real value for styling hooks */\n  status?: NonNullable<VariantProps<typeof statusBadgeVariants>[\"status\"]>\n  /* Breathe the dot. Reserved for live statuses — online, running — not as a\n     decoration on every pill in a table. */\n  pulse?: boolean\n  /* Play the entrance pop on mount. */\n  appear?: boolean\n}) {\n  return (\n    <span\n      data-slot=\"status-badge\"\n      data-status={status}\n      className={cn(\n        statusBadgeVariants({ status }),\n        appear && statusBadgeAppear,\n        className\n      )}\n      {...props}\n    >\n      <span\n        data-slot=\"status-badge-dot\"\n        aria-hidden=\"true\"\n        className={cn(pulse && statusBadgePulse)}\n      />\n      {children}\n    </span>\n  )\n}\n\nexport { StatusBadge, statusBadgeVariants }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}