{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "title": "Badge",
  "description": "A 22px status mark at the 6px radius, with tone variants.",
  "dependencies": [
    "@base-ui/react@^1.7.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@khaeli/utils"
  ],
  "files": [
    {
      "path": "registry/khaeli/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\n/**\n * Status tones: a subtle ground, a ring of the same\n * hue (foundation.css mixes the border from the label colour), a dark ink label\n * and a 6px dot in the status colour, so the state never rests on colour\n * alone and never on the dot alone.\n */\nconst statusDot =\n  \"font-normal before:size-1.5 before:shrink-0 before:rounded-full before:content-['']\"\n\nconst badgeVariants = cva(\n  \"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[6px] border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] 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: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n        secondary:\n          \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n        // White on the solid red reads 4.76:1; red text on its own 10% tint read 3.99:1.\n        destructive:\n          \"bg-destructive-solid text-white focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive-solid-hover\",\n        outline:\n          \"border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n        ghost:\n          \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n        link: \"text-link underline-offset-4 hover:underline\",\n        /** Done, paid, accepted. */\n        positive: cn(statusDot, \"bg-positive-subtle text-positive-ink before:bg-status-done\"),\n        /** In progress, issued, ready. */\n        info: cn(statusDot, \"bg-info-subtle text-info-ink before:bg-status-in-progress\"),\n        /** In review, waiting on someone, due. */\n        warning: cn(statusDot, \"bg-warning-subtle text-warning-ink before:bg-warning\"),\n        /** Overdue, declined, failed. */\n        negative: cn(statusDot, \"bg-destructive-subtle text-destructive-ink before:bg-destructive\"),\n        /** To do, draft, inert or closed. */\n        neutral: cn(statusDot, \"bg-secondary text-muted-foreground before:bg-status-backlog\"),\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nfunction Badge({\n  className,\n  variant = \"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 }), className),\n      },\n      props\n    ),\n    render,\n    state: {\n      slot: \"badge\",\n      variant,\n    },\n  })\n}\n\nexport { Badge, badgeVariants }\n",
      "type": "registry:ui"
    }
  ],
  "docs": "Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.",
  "type": "registry:ui"
}