{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "metric-delta",
  "type": "registry:ui",
  "title": "Metric delta",
  "description": "A tiny percentage change indicator with an up arrow in green for gains and a down arrow in red for losses. Pair it with stat cards, KPI tiles and table cells.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/metric-delta.tsx",
      "type": "registry:ui",
      "target": "components/ui/metric-delta.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { ArrowDownIcon, ArrowUpIcon } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\n\nfunction MetricDelta({\n  value,\n  className,\n}: {\n  value: number\n  className?: string\n}) {\n  const up = value >= 0\n  return (\n    <span\n      data-slot=\"metric-delta\"\n      className={cn(\n        \"inline-flex items-center gap-0.5 text-xs font-medium tabular-nums\",\n        up ? \"text-success\" : \"text-danger\",\n        className\n      )}\n    >\n      {up ? <ArrowUpIcon className=\"size-3\" /> : <ArrowDownIcon className=\"size-3\" />}\n      {Math.abs(value)}%\n    </span>\n  )\n}\nexport { MetricDelta }\n"
    }
  ]
}
