{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tag",
  "type": "registry:ui",
  "title": "Tag",
  "description": "Tag is a compact classification label for categories, filters, or user-applied values — distinct from read-only Badge status metadata.",
  "author": "Skrewww",
  "dependencies": [
    "@phosphor-icons/react"
  ],
  "registryDependencies": [
    "@skrewww/foundation"
  ],
  "docs": "Host requirements (assumed already present, not installed by this command): react, react-dom.",
  "files": [
    {
      "path": "components/ui/Tag.tsx",
      "content": "/** @skrewww-component tag */\n\"use client\";\n\nimport { X } from \"@phosphor-icons/react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport styles from \"@/components/ui/tag.module.css\";\n\nexport type TagProps = {\n  children: ReactNode;\n  removable?: boolean;\n  onRemove?: () => void;\n  removeLabel?: string;\n  leadingIcon?: ReactNode;\n  className?: string;\n};\n\nexport function Tag({\n  children,\n  removable = false,\n  onRemove,\n  removeLabel,\n  leadingIcon,\n  className,\n}: TagProps) {\n  const labelText = typeof children === \"string\" ? children : undefined;\n  const accessibleRemoveLabel = removeLabel ?? (labelText ? `Remove ${labelText}` : \"Remove tag\");\n\n  return (\n    <span className={cn(styles.tag, className)}>\n      {leadingIcon ? (\n        <span className={styles.leadingIcon} aria-hidden=\"true\">\n          {leadingIcon}\n        </span>\n      ) : null}\n      <span className={styles.label}>{children}</span>\n      {removable ? (\n        <button\n          type=\"button\"\n          className={styles.remove}\n          aria-label={accessibleRemoveLabel}\n          onClick={onRemove}\n        >\n          <X size={12} aria-hidden=\"true\" />\n        </button>\n      ) : null}\n    </span>\n  );\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/Tag.tsx"
    },
    {
      "path": "components/ui/tag.module.css",
      "content": ".tag {\n  display: inline-flex;\n  align-items: center;\n  gap: var(--tag-gap);\n  max-width: 100%;\n  min-height: var(--tag-min-height);\n  padding: 0 var(--tag-padding-x);\n  border: 1px solid var(--tag-border);\n  border-radius: var(--tag-radius);\n  background-color: var(--tag-surface);\n  background-image: var(--component-surface-gradient-overlay);\n  color: var(--tag-text);\n  font-size: 0.8125rem;\n  line-height: 1.2;\n}\n\n.label {\n  min-width: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.leadingIcon {\n  display: inline-flex;\n  color: var(--semantic-icon-muted);\n}\n\n.leadingIcon :global(svg) {\n  width: var(--tag-icon-size);\n  height: var(--tag-icon-size);\n}\n\n.remove {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  width: var(--tag-remove-size);\n  height: var(--tag-remove-size);\n  margin-right: calc(var(--tag-padding-x) * -0.35);\n  border: 0;\n  border-radius: min(var(--shape-radius-control), 9999px);\n  background: transparent;\n  color: var(--semantic-icon-muted);\n  cursor: pointer;\n}\n\n.remove:focus-visible {\n  outline: 2px solid var(--semantic-focus-ring);\n  outline-offset: 1px;\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/tag.module.css"
    },
    {
      "path": "lib/cn.ts",
      "content": "export function cn(...classes: Array<string | false | null | undefined>): string {\n  return classes.filter(Boolean).join(\" \");\n}\n",
      "type": "registry:lib",
      "target": "~/lib/cn.ts"
    }
  ]
}
