{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-label",
  "title": "Status Label",
  "description": "A status written as a coloured word: good, warning, bad, info and neutral tones in the shades every block uses.",
  "files": [
    {
      "path": "registry/components/dashboardblocks/status-label.tsx",
      "content": "import type { ComponentProps, ReactNode } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype StatusTone = 'good' | 'warning' | 'bad' | 'info' | 'neutral'\n\nconst statusToneClasses: Record<StatusTone, string> = {\n  bad: 'text-red-700 dark:text-red-400',\n  good: 'text-emerald-700 dark:text-emerald-400',\n  info: 'text-sky-700 dark:text-sky-400',\n  neutral: 'text-muted-foreground',\n  warning: 'text-orange-700 dark:text-orange-400',\n}\n\ninterface StatusLabelProps extends ComponentProps<'span'> {\n  /** Drawn before the label in a badge, in place of the dot. */\n  indicator?: ReactNode\n  tone: StatusTone\n  /**\n   * `badge` for a status that stands on its own; `text` for one inside a\n   * sentence or a `Details` line.\n   * @default 'badge'\n   */\n  variant?: 'badge' | 'text'\n}\n\nfunction StatusLabel({\n  children,\n  className,\n  indicator,\n  tone,\n  variant = 'badge',\n  ...props\n}: StatusLabelProps) {\n  return (\n    <span\n      data-slot='status-label'\n      data-tone={tone}\n      data-variant={variant}\n      className={cn(\n        'font-medium whitespace-nowrap',\n        variant === 'badge'\n          ? 'inline-flex h-fit w-fit items-center gap-1.5 rounded-md border px-1.5 py-0.5 text-xs [&_svg]:size-3.5 [&_svg]:shrink-0'\n          : 'text-sm',\n        statusToneClasses[tone],\n        className,\n      )}\n      {...props}\n    >\n      {variant === 'badge' &&\n        (indicator ?? (\n          <span aria-hidden className='size-1.5 shrink-0 rounded-full bg-current' />\n        ))}\n      {children}\n    </span>\n  )\n}\n\nexport { StatusLabel, statusToneClasses }\n\nexport type { StatusLabelProps, StatusTone }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/status-label.tsx"
    }
  ],
  "type": "registry:component"
}
