{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tag",
  "title": "Tag",
  "description": "The nx-ui Tag component.",
  "dependencies": [
    "@untitledui/icons@^0.0.22",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@nx-ui/utils"
  ],
  "files": [
    {
      "path": "components/ui/tag.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { XClose } from \"@untitledui/icons\"\n\n/**\n * Tag — the Untitled UI pill/chip, ported to nx-ui primitives.\n *\n * A small removable label used for filter chips, selected values and the\n * `tags-input` control. Supports a leading status dot, avatar or checkbox and a\n * trailing count badge or close (X) button. Restyled from the vendored UUI\n * `base/tags/tags.tsx` reference, translating react-aria to a plain `<span>` and\n * swapping the class vocabulary onto nx-ui's shadcn/UUI tokens.\n */\n\nconst tagVariants = cva(\n  \"inline-flex cursor-default items-center gap-1 rounded-md bg-background align-middle font-medium text-secondary-foreground ring-1 ring-border ring-inset\",\n  {\n    variants: {\n      size: {\n        sm: \"px-2 py-0.5 text-xs\",\n        md: \"px-2.5 py-0.5 text-sm\",\n        lg: \"px-2.5 py-1 text-sm\",\n      },\n    },\n    defaultVariants: {\n      size: \"md\",\n    },\n  }\n)\n\nconst dotColour = {\n  gray: \"text-fg-quaternary\",\n  brand: \"text-fg-brand-primary\",\n  success: \"text-fg-success-primary\",\n  warning: \"text-fg-warning-primary\",\n  error: \"text-fg-error-primary\",\n} as const\n\nfunction Tag({\n  className,\n  size = \"md\",\n  children,\n  dot,\n  count,\n  onRemove,\n  ...props\n}: React.ComponentProps<\"span\"> &\n  VariantProps<typeof tagVariants> & {\n    /** Show a leading status dot in the given colour. */\n    dot?: keyof typeof dotColour\n    /** Optional trailing count badge. */\n    count?: React.ReactNode\n    /** When set, renders a trailing close button and calls this on click. */\n    onRemove?: () => void\n  }) {\n  return (\n    <span\n      data-slot=\"tag\"\n      className={cn(\n        tagVariants({ size }),\n        dot && \"pl-1.5\",\n        onRemove && \"pr-1\",\n        className\n      )}\n      {...props}\n    >\n      {dot ? (\n        <svg\n          viewBox=\"0 0 8 8\"\n          aria-hidden=\"true\"\n          className={cn(\"size-2 shrink-0\", dotColour[dot])}\n        >\n          <circle cx=\"4\" cy=\"4\" r=\"3\" fill=\"currentColor\" />\n        </svg>\n      ) : null}\n\n      <span className=\"truncate\">{children}</span>\n\n      {count != null ? (\n        <span className=\"rounded-[3px] bg-muted px-1 text-xs font-medium text-secondary-foreground tabular-nums\">\n          {count}\n        </span>\n      ) : null}\n\n      {onRemove ? (\n        <button\n          type=\"button\"\n          aria-label=\"Remove\"\n          onClick={onRemove}\n          className=\"flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-fg-quaternary transition hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring\"\n        >\n          <XClose className=\"size-3 stroke-[2.5px]\" />\n        </button>\n      ) : null}\n    </span>\n  )\n}\n\nexport { Tag, tagVariants }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}