{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ascii-spark",
  "title": "ASCII Spark",
  "description": "Block-element bars (░–█); a copyable plain-text sparkline.",
  "dependencies": [],
  "registryDependencies": [
    "@atroui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/ascii-spark.tsx",
      "content": "import * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport type AsciiSparkProps = {\n  /** Series, lowest first or not — bars are value-driven, time-free. */\n  data?: number[]\n  /** Ceiling for bar height. Defaults to the series max. */\n  max?: number\n  /** Accessible one-line summary. Defaults to first → last. */\n  label?: string\n  className?: string\n}\n\nconst BARS = \"▁▂▃▄▅▆▇█\"\n\n/**\n * ASCII Spark — a series compressed to block-element bars (▁ through █).\n * Zero animation, zero JS state: it is just text, so a values-only series\n * works server-side. Sits inline with trailing prose or headline numbers.\n */\nexport function AsciiSpark({\n  data = [4, 9, 7, 12, 10, 15, 11, 18, 13, 17, 22, 19],\n  max,\n  label,\n  className,\n}: AsciiSparkProps) {\n  const series = data\n  const top = Math.max(1, max ?? Math.max(...series))\n  const bars = React.useMemo(\n    () =>\n      series\n        .map((v) =>\n          BARS[\n            Math.min(\n              BARS.length - 1,\n              Math.max(0, Math.round((v / top) * (BARS.length - 1)))\n            )\n          ]\n        )\n        .join(\"\"),\n    [series, top]\n  )\n  const summary =\n    label ??\n    `${series[0]} → ${series[series.length - 1]} over ${series.length} points`\n\n  return (\n    <pre\n      aria-label={summary}\n      role=\"img\"\n      title={summary}\n      className={cn(\n        \"m-0 inline-block select-none whitespace-pre font-mono text-[13px] leading-none text-primary\",\n        className\n      )}\n    >\n      {bars}\n    </pre>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/ui/ascii-spark.tsx"
    }
  ],
  "type": "registry:ui"
}