{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spark-line",
  "type": "registry:item",
  "title": "Spark Line",
  "description": "A small line of recent values, green when it ends higher than it started, red when lower.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "display"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/spark-line.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/spark-line.js",
      "content": "// Generated by zubra from spark-line.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"spark-line\";\n\nexport default $define(tag, {\n  props: {\n    \"points\": { attribute: \"points\", default: [], required: false },\n    \"label\": { attribute: \"label\", default: \"Trend\", required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [],\n  events: [],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (spark-line) to ([data-zb-slotted=\\\"spark-line\\\"]) {\\n  :scope { display: block; height: 2rem; }\\n  svg { display: block; width: 100%; height: 100%; overflow: visible; }\\n  polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }\\n  .up { stroke: var(--up, #12805c); } .down { stroke: var(--down, #c4320a); } .flat { stroke: var(--muted-foreground, #667085); }\\n}\\n}\\n\",\n  template: \"\\n  <svg viewBox=\\\"0 0 100 30\\\" preserveAspectRatio=\\\"none\\\" role=\\\"img\\\"><polyline></polyline></svg>\\n\",\n  setup($p, $emit) {\n  const low = __zubraComputed(() => (Math.min(...$p.points)))\n  const high = __zubraComputed(() => (Math.max(...$p.points)))\n  const span = __zubraComputed(() => (high.get() - low.get() || 1))\n  const path = __zubraComputed(() => ($p.points.map((value, index) => `${(index / Math.max(1, $p.points.length - 1)) * 100},${28 - ((value - low.get()) / span.get()) * 26}`).join(\" \")))\n  const trend = __zubraComputed(() => ($p.points.length < 2 ? \"flat\" : $p.points[$p.points.length - 1] >= $p.points[0] ? \"up\" : \"down\"))\n    return [\n      { path: [0], attribute: \"aria-label\", value: () => (`${$p.label}: ${trend.get()}`) },\n      { path: [0, 0], attribute: \"class\", value: () => $r(trend) },\n      { path: [0, 0], attribute: \"points\", value: () => $r(path) },\n    ];\n  },\n});\n"
    }
  ]
}
