{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "trend-pill",
  "title": "Trend Pill",
  "description": "Delta chip with a direction arrow and a sentiment colour.",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "lucide-react@^1.27.0"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/components/trend-pill.tsx",
      "content": "import * as React from \"react\"\nimport { cva } from \"class-variance-authority\"\nimport { ArrowDownRight, ArrowUpRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* A washed delta chip — \"↗ 12%\" — for the corner of a KPI tile.\n\n   Direction and sentiment are separate props because they are separate facts.\n   The arrow says which way the number moved; the colour says whether that is\n   good. A falling error rate points down and paints green, so deriving the\n   tone from the direction would get every \"lower is better\" metric wrong.\n\n   Not `metricDeltaVariants`: that is bare coloured text with a 16px glyph,\n   sized to sit under a figure. This is a pill with its own wash, sized to sit\n   beside a label. No leading is set, so the chip takes its parent's line\n   height and lines up with whatever text it sits next to. */\nconst trendPillVariants = cva(\n  \"inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-caption-sm font-medium tabular-nums\",\n  {\n    variants: {\n      sentiment: {\n        positive: \"bg-success/10 text-success-ink\",\n        negative: \"bg-destructive/10 text-destructive-ink\",\n      },\n    },\n    defaultVariants: {\n      sentiment: \"positive\",\n    },\n  },\n)\n\ntype TrendDirection = \"up\" | \"down\"\ntype TrendSentiment = \"positive\" | \"negative\"\n\ntype TrendPillProps = React.ComponentProps<\"span\"> & {\n  direction: TrendDirection\n  sentiment?: TrendSentiment\n  /** Spoken before the figure, e.g. \"Up\" — the arrow itself is silent. Rendered\n   *  only when given. */\n  srLabel?: string\n  children: React.ReactNode\n}\n\nfunction TrendPill({\n  direction,\n  sentiment = \"positive\",\n  srLabel,\n  className,\n  children,\n  ...props\n}: TrendPillProps) {\n  const Arrow = direction === \"up\" ? ArrowUpRight : ArrowDownRight\n  return (\n    <span\n      data-slot=\"trend-pill\"\n      data-direction={direction}\n      data-sentiment={sentiment}\n      className={cn(trendPillVariants({ sentiment }), className)}\n      {...props}\n    >\n      <Arrow data-slot=\"trend-pill-icon\" className=\"size-3\" strokeWidth={2.5} />\n      {srLabel ? <span className=\"sr-only\">{srLabel} </span> : null}\n      {children}\n    </span>\n  )\n}\n\nexport { TrendPill, trendPillVariants }\nexport type { TrendPillProps, TrendDirection, TrendSentiment }\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}