{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tag",
  "title": "Tag",
  "description": "A small tinted tag for a count or short word beside a sidebar link, tab, menu item or group heading, or an item's label with its dot: neutral, or a status tone when it needs attention.",
  "registryDependencies": [
    "https://www.dashboardblocks.com/r/radix/format.json",
    "https://www.dashboardblocks.com/r/radix/status-label.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/tag.tsx",
      "content": "import type { StatusTone } from '@/registry/components/dashboardblocks/status-label'\nimport { formatNumber } from '@/registry/lib/dashboardblocks/format'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst tagToneClasses: Record<StatusTone, string> = {\n  bad: 'bg-red-500/5 text-red-800 dark:bg-red-500/10 dark:text-red-400',\n  good: 'bg-emerald-500/5 text-emerald-800 dark:bg-emerald-500/10 dark:text-emerald-400',\n  info: 'bg-sky-500/5 text-sky-800 dark:bg-sky-500/10 dark:text-sky-400',\n  neutral: 'text-foreground/70 bg-current/10',\n  warning: 'bg-orange-500/5 text-orange-800 dark:bg-orange-500/10 dark:text-orange-400',\n}\n\ninterface TagProps extends ComponentProps<'span'> {\n  /** Drawn before the count, such as a live dot. */\n  indicator?: ReactNode\n  /** `neutral` for a plain count; another tone when it needs attention. @default 'neutral' */\n  tone?: StatusTone\n}\n\nfunction Tag({ children, className, indicator, tone = 'neutral', ...props }: TagProps) {\n  return (\n    <span\n      data-slot='tag'\n      data-tone={tone}\n      className={cn(\n        'inline-flex h-5 min-w-5 shrink-0 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-medium whitespace-nowrap tabular-nums',\n        tagToneClasses[tone],\n        className,\n      )}\n      {...props}\n    >\n      {indicator}\n      {children}\n    </span>\n  )\n}\n\n/** Draws a plain number or string as a `Tag`; any other node as it is. */\nfunction renderTag(badge: ReactNode) {\n  if (typeof badge === 'number') return <Tag>{formatNumber(badge)}</Tag>\n  if (typeof badge === 'string') return <Tag>{badge}</Tag>\n  return badge\n}\n\nexport { Tag, renderTag, tagToneClasses }\n\nexport type { TagProps }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/tag.tsx"
    }
  ],
  "type": "registry:component"
}
