{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "title": "Badge",
  "description": "A short, non-interactive label that tags an object with a status, category or count.",
  "dependencies": [
    "@base-ui/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://www.prfct.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "components/ui/badge.tsx",
      "content": "import { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n  [\n    \"group/badge inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent font-medium whitespace-nowrap\",\n    \"transition-[background-color,border-color,color] duration-fast ease-standard\",\n    \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\",\n    \"[&>svg]:pointer-events-none [&>svg]:size-3\",\n  ],\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/88\",\n        secondary:\n          \"bg-secondary text-gray-11 [a]:hover:bg-gray-4 [a]:hover:text-foreground\",\n        outline: \"border-border-strong text-foreground [a]:hover:bg-accent\",\n        brand: \"bg-brand-3 text-brand-11 [a]:hover:bg-brand-4\",\n        success: \"bg-success-3 text-success-11 [a]:hover:bg-success-4\",\n        warning: \"bg-warning-3 text-warning-11 [a]:hover:bg-warning-4\",\n        destructive: \"bg-danger-3 text-danger-11 [a]:hover:bg-danger-4\",\n        info: \"bg-info-3 text-info-11 [a]:hover:bg-info-4\",\n        ghost: \"text-muted-foreground hover:bg-accent hover:text-foreground\",\n        link: \"text-link underline-offset-4 hover:underline\",\n      },\n      size: {\n        sm: \"h-[1.125rem] px-1.5 text-[0.6875rem] has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1\",\n        default:\n          \"h-5 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5\",\n        lg: \"h-6 px-2.5 text-[0.8125rem] has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&>svg]:size-3.5\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Badge({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  render,\n  ...props\n}: useRender.ComponentProps<\"span\"> & VariantProps<typeof badgeVariants>) {\n  return useRender({\n    defaultTagName: \"span\",\n    props: mergeProps<\"span\">(\n      {\n        className: cn(badgeVariants({ variant, size }), className),\n      },\n      props\n    ),\n    render,\n    state: {\n      slot: \"badge\",\n      variant,\n    },\n  })\n}\n\n/** A status dot that inherits the badge's color. Pulses when `live`. */\nfunction BadgeDot({\n  className,\n  live = false,\n  ...props\n}: React.ComponentProps<\"span\"> & { live?: boolean }) {\n  return (\n    <span\n      data-slot=\"badge-dot\"\n      aria-hidden=\"true\"\n      className={cn(\"relative flex size-1.5 shrink-0\", className)}\n      {...props}\n    >\n      {live && (\n        <span className=\"absolute inset-0 animate-ping rounded-full bg-current opacity-60\" />\n      )}\n      <span className=\"relative size-1.5 rounded-full bg-current\" />\n    </span>\n  )\n}\n\nexport { Badge, BadgeDot, badgeVariants }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}