{
  "name": "sparkline",
  "type": "ui:component",
  "title": "Sparkline",
  "description": "Compact inline SVG trend sparkline for table cells and compact KPI badges.",
  "dependencies": [],
  "registryDependencies": [
    "theme"
  ],
  "files": [
    {
      "path": "src/ui/sparkline.tsx",
      "target": "src/ui/sparkline.tsx",
      "sha256": "a5d2b938b1c60b6081b366eb126bf5727eaf43281cdf88f3a661fdde403bd499",
      "content": "import './theme.css';\nimport { scope } from '@fierst/aster';\n\nconst spScope = scope`\n  :scope { display: inline-block; vertical-align: middle; }\n  polyline { fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }\n`;\n\nexport function Sparkline({\n  values,\n  width = 88,\n  height = 24,\n  tone = 'primary',\n  class: extraClass,\n}: {\n  values: readonly number[];\n  width?: number;\n  height?: number;\n  tone?: 'primary' | 'success' | 'warning' | 'danger';\n  class?: string;\n}) {\n  if (values.length < 2) return null;\n  const min = Math.min(...values);\n  const max = Math.max(...values);\n  const span = max - min || 1;\n  const pts = values\n    .map((v, i) => {\n      const x = (i / (values.length - 1)) * width;\n      const y = height - 3 - ((v - min) / span) * (height - 6);\n      return `${x.toFixed(1)},${y.toFixed(1)}`;\n    })\n    .join(' ');\n  const stroke =\n    tone === 'success'\n      ? 'var(--aster-success)'\n      : tone === 'warning'\n        ? 'var(--aster-warning)'\n        : tone === 'danger'\n          ? 'var(--aster-danger)'\n          : 'var(--aster-primary)';\n\n  return (\n    <svg\n      class={[spScope, extraClass].filter(Boolean).join(' ')}\n      width={width}\n      height={height}\n      viewBox={`0 0 ${width} ${height}`}\n      aria-hidden=\"true\"\n    >\n      <polyline points={pts} stroke={stroke} />\n    </svg>\n  );\n}\n"
    }
  ]
}
