{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sparkline",
  "title": "Sparkline",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "A trend inside text, a table cell or a stat, whose name says where the values went. Works in Server Components.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.5",
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://uiset.dev/r/uiset.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/sparkline.tsx",
      "content": "import { createElement, type CSSProperties, type ReactNode } from \"react\"\nimport { sparklineColor, sparklinePlot, type SparklineOptions } from \"./chart/plots/sparkline\"\nimport type { VChild } from \"./chart/vnode\"\nimport \"./chart/tokens.css\"\nimport \"./chart/chart.css\"\n\ntype SparklineProps = SparklineOptions & {\n  /** A chart slot (1-8) for the color; defaults to the first. */\n  slot?: number\n  className?: string\n}\n\n// The drawing's nodes as React elements, here rather than from the chart frame, so a\n// sparkline stays a Server Component.\nconst nodes = (children: readonly VChild[]): ReactNode[] =>\n  children.map((child, i) => {\n    if (child === null || child === undefined || child === false) return null\n    if (typeof child !== \"object\") return child\n    const props: Record<string, unknown> = { key: child.key ?? i }\n    // Node attributes use React's names already (className, textAnchor).\n    Object.assign(props, child.attrs)\n    return createElement(child.tag, props, ...nodes(child.children))\n  })\n\n/** A trend in a line of text, a table cell or a stat. Its name says where it went. */\nfunction Sparkline({ width = 96, height = 28, slot = 1, className, ...options }: SparklineProps) {\n  const { name, svg } = sparklinePlot({ ...options, width, height })\n  return (\n    <svg\n      className={[\"sparkline\", className].filter(Boolean).join(\" \")}\n      role=\"img\"\n      aria-label={name}\n      width={width}\n      height={height}\n      viewBox={`0 0 ${width} ${height}`}\n      style={{ \"--series\": sparklineColor(slot) } as CSSProperties}\n    >\n      {nodes(svg)}\n    </svg>\n  )\n}\n\nexport { Sparkline }\nexport type { SparklineProps }\n",
      "type": "registry:ui",
      "target": "@ui/sparkline.tsx"
    },
    {
      "path": "registry/uiset/ui/chart/scale.ts",
      "content": "// Framework-free scales and ticks for UISet charts. Pure functions, so they run on a\n// server and in tests, and every chart shares one idea of \"a nice axis\".\n\ntype Linear = {\n  (value: number): number\n  domain: [number, number]\n  range: [number, number]\n  ticks: number[]\n  invert: (pixel: number) => number\n}\n\n// 1, 2, 2.5, 5 × 10^n: steps people read without effort.\nfunction niceStep(span: number, count: number) {\n  const raw = span / Math.max(1, count)\n  const power = 10 ** Math.floor(Math.log10(raw))\n  const fraction = raw / power\n  const nice = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 2.5 ? 2.5 : fraction <= 5 ? 5 : 10\n  return nice * power\n}\n\n/** Rounds a domain out to nice steps and lists its ticks. Zero stays in when asked. */\nfunction niceDomain(min: number, max: number, count = 5, zero = true) {\n  let lo = zero ? Math.min(0, min) : min\n  let hi = zero ? Math.max(0, max) : max\n  if (lo === hi) {\n    hi = lo === 0 ? 1 : lo + Math.abs(lo) * 0.5\n    if (!zero) lo -= Math.abs(lo) * 0.5 || 1\n  }\n  const step = niceStep(hi - lo, count)\n  lo = Math.floor(lo / step) * step\n  hi = Math.ceil(hi / step) * step\n  const ticks: number[] = []\n  for (let v = lo; v <= hi + step / 2; v += step) ticks.push(Number(v.toFixed(10)))\n  return { domain: [lo, hi] as [number, number], ticks }\n}\n\n/** The smallest and largest finite values, or undefined for none. A loop, so any length works. */\nfunction extent(values: readonly (number | null | undefined)[]): [number | undefined, number | undefined] {\n  let lo: number | undefined\n  let hi: number | undefined\n  for (const v of values) {\n    if (v === null || v === undefined || !Number.isFinite(v)) continue\n    if (lo === undefined || v < lo) lo = v\n    if (hi === undefined || v > hi) hi = v\n  }\n  return [lo, hi]\n}\n\nfunction linear(\n  values: readonly number[],\n  range: [number, number],\n  { count = 5, zero = true, domain }: { count?: number; zero?: boolean; domain?: [number, number] } = {},\n): Linear {\n  const [lo, hi] = extent(values)\n  const nice = domain\n    ? niceDomain(domain[0], domain[1], count, false)\n    : niceDomain(lo ?? 0, hi ?? 1, count, zero)\n  const [d0, d1] = nice.domain\n  const [r0, r1] = range\n  const scale = ((value: number) => r0 + ((value - d0) / (d1 - d0 || 1)) * (r1 - r0)) as Linear\n  scale.domain = nice.domain\n  scale.range = range\n  scale.ticks = nice.ticks\n  scale.invert = (pixel) => d0 + ((pixel - r0) / (r1 - r0 || 1)) * (d1 - d0)\n  return scale\n}\n\ntype Band = {\n  (key: string): number\n  bandwidth: number\n  step: number\n  keys: readonly string[]\n}\n\n/** Even bands for categories, with an inner gap between them and an outer margin. */\nfunction band(keys: readonly string[], range: [number, number], padding = 0.3): Band {\n  const [r0, r1] = range\n  const n = Math.max(1, keys.length)\n  const step = (r1 - r0) / (n + padding)\n  const bandwidth = step * (1 - padding)\n  const index = new Map(keys.map((key, i) => [key, i]))\n  const scale = ((key: string) => r0 + step * padding + step * (index.get(key) ?? 0)) as Band\n  scale.bandwidth = bandwidth\n  scale.step = step\n  scale.keys = keys\n  return scale\n}\n\n/** Points spread evenly across the range, for x positions of a line. */\nfunction point(count: number, range: [number, number]) {\n  const [r0, r1] = range\n  return (index: number) => (count <= 1 ? (r0 + r1) / 2 : r0 + ((r1 - r0) * index) / (count - 1))\n}\n\n/** Axis labels: full under 10,000, compact past it (10K, 1.2M), one style per axis. */\nfunction tickFormatter(ticks: readonly number[], locale?: string) {\n  const top = Math.max(...ticks.map(Math.abs))\n  const compact = top >= 10000\n  const step = ticks.length > 1 ? Math.abs(ticks[1]! - ticks[0]!) : 1\n  // As many decimals as the step has (0.25 → 2), so ticks never round onto each other.\n  const digits = Math.min(4, (String(Number(step.toFixed(10))).split(\".\")[1] ?? \"\").length)\n  const format = new Intl.NumberFormat(locale, {\n    notation: compact ? \"compact\" : \"standard\",\n    maximumFractionDigits: compact ? 1 : digits,\n  })\n  return (value: number) => format.format(value)\n}\n\n/** Picks up to `count` evenly spaced indexes to label, always keeping the first and last. */\nfunction labelIndexes(length: number, count: number) {\n  if (length <= count) return Array.from({ length }, (_, i) => i)\n  const step = Math.ceil((length - 1) / (count - 1))\n  const picked: number[] = []\n  for (let i = 0; i < length; i += step) picked.push(i)\n  if (picked.at(-1) !== length - 1) {\n    if (length - 1 - picked.at(-1)! < step / 2) picked.pop()\n    picked.push(length - 1)\n  }\n  return picked\n}\n\ntype ChartValue = number | null | undefined\n\n/**\n * A value formatter: yours, or plain numbers in `locale`. Pass a locale when rendering on\n * a server, so server and browser print the same digits.\n */\nfunction numberFormat(locale?: string, format?: (value: number) => string): (value: number) => string {\n  return format ?? new Intl.NumberFormat(locale, { maximumFractionDigits: 2 }).format\n}\n\n/** A value as a person reads it, or \"No data\" for a gap. */\nfunction formatValue(value: ChartValue, format?: (value: number) => string, locale?: string) {\n  return value === null || value === undefined || !Number.isFinite(value)\n    ? \"No data\"\n    : numberFormat(locale, format)(value)\n}\n\nexport {\n  band,\n  extent,\n  formatValue,\n  labelIndexes,\n  linear,\n  niceDomain,\n  niceStep,\n  numberFormat,\n  point,\n  tickFormatter,\n}\nexport type { Band, ChartValue, Linear }\n",
      "type": "registry:file",
      "target": "@ui/chart/scale.ts"
    },
    {
      "path": "registry/uiset/ui/chart/vnode.ts",
      "content": "// A chart's drawing as plain data: what to draw, not how. Each chart computes its geometry\n// once, into these nodes; the React frame turns them into elements and the web elements into\n// DOM, so both draw exactly the same thing.\n\ntype VAttrs = Record<string, string | number | boolean | null | undefined | Record<string, string | number>>\n\ntype VNode = { tag: string; attrs: VAttrs; children: VChild[]; key?: string | number }\ntype VChild = VNode | string | number | null | undefined | false\n\n/** v(\"circle\", { className: \"chart-dot\", cx, cy, r: 4 }) */\nfunction v(tag: string, attrs: VAttrs & { key?: string | number } = {}, ...children: (VChild | VChild[])[]): VNode {\n  const { key, ...rest } = attrs\n  return { tag, attrs: rest as VAttrs, children: children.flat() as VChild[], key: key as string | number | undefined }\n}\n\n/** A tooltip row: a key in the series color, the value strong, the name after. */\nfunction tooltipRow(color: string, value: string, label: string, shape: \"line\" | \"rect\" | \"dot\" = \"line\", key?: string) {\n  return v(\n    \"span\",\n    { key, className: \"chart-tooltip-row\", style: { \"--series\": color } },\n    v(\"span\", { className: \"chart-swatch\", \"data-shape\": shape }),\n    v(\"strong\", {}, value),\n    v(\"span\", {}, label),\n  )\n}\n\n/** The attribute a DOM element takes for a node's attribute name. */\nconst domName = (name: string) => (name === \"className\" ? \"class\" : name === \"textAnchor\" ? \"text-anchor\" : name)\n\nexport { domName, tooltipRow, v }\nexport type { VAttrs, VChild, VNode }\n",
      "type": "registry:file",
      "target": "@ui/chart/vnode.ts"
    },
    {
      "path": "registry/uiset/ui/chart/plots/sparkline.ts",
      "content": "// The sparkline's geometry: a line, an area or bars in a small box, and a name that says\n// where the values went. React and the web element draw the same nodes.\nimport { extent, formatValue } from \"../scale\"\nimport { v, type VChild } from \"../vnode\"\n\ntype SparklineOptions = {\n  /** The values, oldest first. Gaps (null) break the line. */\n  values: readonly (number | null)[]\n  /** What the values are, for the accessible name: \"Revenue, last 12 weeks\". */\n  label: string\n  format?: (value: number) => string\n  /** Reads numbers in this locale; pass it when rendering on a server. */\n  locale?: string\n  /** \"line\" (default), \"area\" for a wash under it, or \"bar\" for counts. */\n  variant?: \"line\" | \"area\" | \"bar\"\n  width?: number\n  height?: number\n}\n\n/** The sparkline's accessible name and its drawing. */\nfunction sparklinePlot({ values, label, format, locale, variant = \"line\", width = 96, height = 28 }: SparklineOptions): { name: string; svg: VChild[] } {\n  const finite = values.filter((n): n is number => n !== null && Number.isFinite(n))\n  const first = finite[0]\n  const last = finite.at(-1)\n  const [low, high] = extent(finite)\n  const min = low ?? 0\n  const max = high ?? 0\n  const read = (n: number | undefined) => formatValue(n, format, locale)\n  const name = first === undefined ? `${label}: no data` : `${label}: from ${read(first)} to ${read(last)}, low ${read(min)}, high ${read(max)}`\n  const pad = 3\n  // Bars grow from zero, so zero is always inside the box, below or above every bar.\n  const lo = variant === \"bar\" ? Math.min(0, min) : min\n  const hi = variant === \"bar\" ? Math.max(0, max) : max\n  const span = hi - lo || 1\n  const y = (n: number) => height - pad - ((n - lo) / span) * (height - pad * 2)\n  const step = values.length > 1 ? (width - pad * 2) / (values.length - 1) : 0\n  const x = (i: number) => (values.length > 1 ? pad + i * step : width / 2)\n  // A line, and an area per unbroken run, so a gap stays a gap.\n  let d = \"\"\n  let wash = \"\"\n  let run: number[] = []\n  const closeRun = () => {\n    if (run.length > 1)\n      wash += `M${run.map((i) => `${x(i).toFixed(1)},${y(values[i]!).toFixed(1)}`).join(\"L\")}L${x(run.at(-1)!).toFixed(1)},${height - pad}L${x(run[0]!).toFixed(1)},${height - pad}Z`\n    run = []\n  }\n  values.forEach((n, i) => {\n    if (n === null || !Number.isFinite(n)) {\n      closeRun()\n      return\n    }\n    d += `${run.length ? \"L\" : \"M\"}${x(i).toFixed(1)},${y(n).toFixed(1)}`\n    run.push(i)\n  })\n  closeRun()\n  const lastIndex = values.findLastIndex((n) => n !== null && Number.isFinite(n))\n  const barWidth = Math.max(1, Math.min(6, (width - pad * 2) / values.length - 1))\n  const svg: VChild[] =\n    variant === \"bar\"\n      ? values.map((n, i) =>\n          n === null || !Number.isFinite(n)\n            ? null\n            : v(\"rect\", { key: i, className: \"chart-bar\", x: pad + (i * (width - pad * 2)) / values.length, y: Math.min(y(n), y(0)), width: barWidth, height: Math.max(1, Math.abs(y(n) - y(0))), rx: 1 }),\n        )\n      : [\n          variant === \"area\" && wash ? v(\"path\", { key: \"area\", className: \"chart-area\", d: wash }) : null,\n          v(\"path\", { key: \"line\", className: \"chart-line sparkline-line\", d }),\n          lastIndex >= 0 ? v(\"circle\", { key: \"end\", className: \"chart-dot\", cx: x(lastIndex), cy: y(values[lastIndex]!), r: 2.75 }) : null,\n        ]\n  return { name, svg }\n}\n\n/** The chart slot's color, 1 to 8. */\nconst sparklineColor = (slot = 1) => `var(--chart-${Math.min(8, Math.max(1, slot))})`\n\nexport { sparklineColor, sparklinePlot }\nexport type { SparklineOptions }\n",
      "type": "registry:file",
      "target": "@ui/chart/plots/sparkline.ts"
    },
    {
      "path": "registry/uiset/ui/chart/tokens.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n/*\n  Chart colors, validated per surface with the dataviz six-checks script (docs/charts.md):\n  categorical slots in a fixed order (never cycled, never by rank), one-hue sequential\n  steps, a diverging pair with a gray midpoint, and quiet chrome. Text never uses these;\n  it stays in --ui-foreground and --ui-muted-foreground.\n*/\n\n@layer uiset.tokens {\n  :where([data-uiset]) {\n    --chart-1: light-dark(oklch(0.575 0.163 255.5), oklch(0.622 0.161 255.1));\n    --chart-2: light-dark(oklch(0.671 0.175 40.6), oklch(0.622 0.173 40.1));\n    --chart-3: light-dark(oklch(0.669 0.141 162.1), oklch(0.621 0.128 163.1));\n    --chart-4: light-dark(oklch(0.764 0.161 75.1), oklch(0.67 0.143 73.2));\n    --chart-5: light-dark(oklch(0.716 0.141 357.4), oklch(0.622 0.171 0.8));\n    --chart-6: light-dark(oklch(0.529 0.18 142.5), oklch(0.529 0.18 142.5));\n    --chart-7: light-dark(oklch(0.527 0.197 283.4), oklch(0.67 0.145 286.8));\n    --chart-8: light-dark(oklch(0.623 0.191 24.9), oklch(0.669 0.159 22.3));\n    /* \"Other\" and de-emphasized series: a gray that never reads as a slot. */\n    --chart-other: color-mix(in oklch, var(--ui-muted-foreground) 70%, var(--ui-background));\n\n    /* Sequential, one hue: step 1 is \"little\", step 7 is \"most\". Dark mode runs the same\n       ramp from the surface up, so \"most\" is always the loudest. */\n    --chart-seq-1: light-dark(oklch(0.905 0.041 252.8), oklch(0.338 0.103 256.9));\n    --chart-seq-2: light-dark(oklch(0.812 0.079 253.4), oklch(0.433 0.128 256.5));\n    --chart-seq-3: light-dark(oklch(0.717 0.118 253.6), oklch(0.527 0.15 255.9));\n    --chart-seq-4: light-dark(oklch(0.622 0.161 255.1), oklch(0.622 0.161 255.1));\n    --chart-seq-5: light-dark(oklch(0.527 0.15 255.9), oklch(0.717 0.118 253.6));\n    --chart-seq-6: light-dark(oklch(0.433 0.128 256.5), oklch(0.812 0.079 253.4));\n    --chart-seq-7: light-dark(oklch(0.338 0.103 256.9), oklch(0.905 0.041 252.8));\n\n    /* Diverging: two poles that read as opposite, a gray middle that reads as nothing. */\n    --chart-neg: var(--chart-8);\n    --chart-mid: light-dark(oklch(0.951 0.004 95), oklch(0.34 0.005 106.7));\n    --chart-pos: var(--chart-1);\n\n    /* Chrome: hairlines one step off the surface, solid, never dashed. */\n    --chart-grid: color-mix(in oklch, var(--ui-foreground) 9%, var(--ui-background));\n    --chart-axis: color-mix(in oklch, var(--ui-foreground) 24%, var(--ui-background));\n    --chart-surface: var(--ui-background);\n    --chart-crosshair: color-mix(in oklch, var(--ui-foreground) 45%, var(--ui-background));\n    --chart-area-opacity: 0.1;\n  }\n}\n\n@layer uiset.skin {\n  /* Blueprint paper is mid blue (L 0.36): its set sits above the usual dark band so every\n     slot keeps 3:1 on the paper. Adjacent pairs: CVD ΔE 14.6, normal 18.7. The first six\n     (a segmented bar's most parts) also clear every pair: CVD 9.3, normal 17.3. */\n  [data-uiset][data-skin=\"blueprint\"] {\n    --chart-1: oklch(0.74 0.11 279.9);\n    --chart-2: oklch(0.86 0.14 159.9);\n    --chart-3: oklch(0.739 0.17 49.8);\n    --chart-4: oklch(0.7 0.2 351);\n    --chart-5: oklch(0.89 0.18 96);\n    --chart-6: oklch(0.89 0.1 327);\n    --chart-7: oklch(0.859 0.14 130.1);\n    --chart-8: oklch(0.789 0.117 242.6);\n    --chart-seq-1: color-mix(in oklab, var(--blueprint-line) 14%, var(--blueprint-paper));\n    --chart-seq-2: color-mix(in oklab, var(--blueprint-line) 28%, var(--blueprint-paper));\n    --chart-seq-3: color-mix(in oklab, var(--blueprint-line) 42%, var(--blueprint-paper));\n    --chart-seq-4: color-mix(in oklab, var(--blueprint-line) 56%, var(--blueprint-paper));\n    --chart-seq-5: color-mix(in oklab, var(--blueprint-line) 70%, var(--blueprint-paper));\n    --chart-seq-6: color-mix(in oklab, var(--blueprint-line) 85%, var(--blueprint-paper));\n    --chart-seq-7: var(--blueprint-line);\n    --chart-neg: var(--chart-3);\n    --chart-pos: var(--chart-2);\n    --chart-mid: color-mix(in oklab, var(--blueprint-line) 20%, var(--blueprint-paper));\n    --chart-grid: var(--blueprint-faint);\n    --chart-axis: color-mix(in oklab, var(--blueprint-line) 55%, var(--blueprint-paper));\n    --chart-crosshair: var(--blueprint-line);\n    --chart-area-opacity: 0.16;\n  }\n\n  /* Studio keeps the validated dark set and lights its sequential ramp like a lamp.\n     Ramps mix in OKLab: OKLCH would swing the hue from amber through pink to the panel. */\n  [data-uiset][data-skin=\"studio\"] {\n    --chart-seq-1: color-mix(in oklab, var(--studio-lamp) 14%, var(--studio-panel));\n    --chart-seq-2: color-mix(in oklab, var(--studio-lamp) 28%, var(--studio-panel));\n    --chart-seq-3: color-mix(in oklab, var(--studio-lamp) 42%, var(--studio-panel));\n    --chart-seq-4: color-mix(in oklab, var(--studio-lamp) 56%, var(--studio-panel));\n    --chart-seq-5: color-mix(in oklab, var(--studio-lamp) 70%, var(--studio-panel));\n    --chart-seq-6: color-mix(in oklab, var(--studio-lamp) 85%, var(--studio-panel));\n    --chart-seq-7: var(--studio-lamp);\n    --chart-crosshair: var(--studio-lamp);\n  }\n  /* Phosphor: the tube's own green first, then the other phosphors (blue, P3 amber, P22\n     red, P4 white, lavender, cyan, pink), each 3:1 or more on the tube. Adjacent pairs:\n     CVD ΔE ≥ 9.5, normal ≥ 17; the first six clear every pair (CVD 9.4, normal 19.6). */\n  [data-uiset][data-skin=\"phosphor\"] {\n    --chart-1: oklch(0.88 0.17 148);\n    --chart-2: oklch(0.72 0.2 250);\n    --chart-3: oklch(0.84 0.17 75);\n    --chart-4: oklch(0.68 0.17 28);\n    --chart-5: oklch(0.96 0.02 150);\n    --chart-6: oklch(0.84 0.11 300);\n    --chart-7: oklch(0.92 0.11 195);\n    --chart-8: oklch(0.76 0.14 355);\n    --chart-seq-1: color-mix(in oklab, var(--phosphor-glow) 14%, var(--phosphor-tube));\n    --chart-seq-2: color-mix(in oklab, var(--phosphor-glow) 28%, var(--phosphor-tube));\n    --chart-seq-3: color-mix(in oklab, var(--phosphor-glow) 42%, var(--phosphor-tube));\n    --chart-seq-4: color-mix(in oklab, var(--phosphor-glow) 56%, var(--phosphor-tube));\n    --chart-seq-5: color-mix(in oklab, var(--phosphor-glow) 70%, var(--phosphor-tube));\n    --chart-seq-6: color-mix(in oklab, var(--phosphor-glow) 85%, var(--phosphor-tube));\n    --chart-seq-7: var(--phosphor-glow);\n    --chart-neg: var(--chart-4);\n    --chart-pos: var(--chart-2);\n    --chart-mid: color-mix(in oklab, var(--phosphor-dim) 30%, var(--phosphor-tube));\n    --chart-grid: oklch(0.75 0.11 150 / 0.2);\n    --chart-axis: color-mix(in oklab, var(--phosphor-dim) 70%, var(--phosphor-tube));\n    --chart-crosshair: var(--phosphor-glow);\n    --chart-area-opacity: 0.14;\n  }\n\n  /* Ink: data is the one place with color, a muted print-like set, like color e-paper:\n     ink first, then blue, orange, sage, dark red, purple, teal, mustard, each 3:1 or more\n     on the screen. Adjacent pairs: CVD ΔE ≥ 9.8, normal ≥ 16; the first six clear every\n     pair (CVD 9.8, normal 16.5). Sequential steps are ink on the screen. */\n  [data-uiset][data-skin=\"ink\"] {\n    --chart-1: oklch(0.2 0 0);\n    --chart-2: oklch(0.5 0.12 250);\n    --chart-3: oklch(0.58 0.15 55);\n    --chart-4: oklch(0.58 0.06 150);\n    --chart-5: oklch(0.42 0.15 25);\n    --chart-6: oklch(0.38 0.15 300);\n    --chart-7: oklch(0.58 0.09 195);\n    --chart-8: oklch(0.58 0.12 95);\n    --chart-seq-1: color-mix(in oklab, var(--ink-ink) 14%, var(--ink-screen));\n    --chart-seq-2: color-mix(in oklab, var(--ink-ink) 28%, var(--ink-screen));\n    --chart-seq-3: color-mix(in oklab, var(--ink-ink) 42%, var(--ink-screen));\n    --chart-seq-4: color-mix(in oklab, var(--ink-ink) 56%, var(--ink-screen));\n    --chart-seq-5: color-mix(in oklab, var(--ink-ink) 70%, var(--ink-screen));\n    --chart-seq-6: color-mix(in oklab, var(--ink-ink) 85%, var(--ink-screen));\n    --chart-seq-7: var(--ink-ink);\n    --chart-neg: var(--chart-5);\n    --chart-pos: var(--chart-2);\n    --chart-mid: var(--ink-tint);\n    --chart-grid: oklch(0.82 0 0);\n    --chart-axis: oklch(0.55 0 0);\n    --chart-crosshair: var(--ink-ink);\n    --chart-area-opacity: 0.12;\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/chart/tokens.css"
    },
    {
      "path": "registry/uiset/ui/chart/chart.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  .chart {\n    display: grid;\n    align-content: start;\n    gap: 0.75rem;\n    min-width: 0;\n    margin: 0;\n    color: var(--ui-foreground);\n    font-size: 0.875rem;\n  }\n\n  .chart-header {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: start;\n    justify-content: space-between;\n    gap: 0.5rem 1rem;\n  }\n\n  .chart-heading {\n    display: grid;\n    gap: 0.125rem;\n    min-width: 0;\n  }\n\n  .chart-title {\n    font-size: 0.9375rem;\n    font-weight: 600;\n  }\n\n  .chart-description {\n    color: var(--ui-muted-foreground);\n    font-size: 0.8125rem;\n  }\n\n  .chart-actions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.5rem;\n\n    [data-slot=\"segmented-control\"] {\n      font-size: 0.8125rem;\n    }\n  }\n\n  /* Legend: the identity channel, and a filter. Pressing one isolates its series. */\n  .chart-legend {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.25rem 0.75rem;\n  }\n\n  .chart-legend-item {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.4rem;\n    min-block-size: 1.5rem;\n    padding: 0.125rem 0.375rem;\n    margin-inline-start: -0.375rem;\n    border: 0;\n    border-radius: var(--ui-radius);\n    background: transparent;\n    color: var(--ui-foreground);\n    font: inherit;\n    font-size: 0.8125rem;\n    cursor: pointer;\n\n    &:hover {\n      background: color-mix(in oklch, var(--ui-foreground) 6%, transparent);\n    }\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 1px;\n    }\n\n    &[aria-pressed=\"true\"] {\n      font-weight: 600;\n    }\n\n    &[data-dimmed] {\n      color: var(--ui-muted-foreground);\n\n      .chart-swatch {\n        opacity: 0.35;\n      }\n    }\n  }\n\n  /* A swatch mirrors its mark: a short line for lines, a block for bars and areas. */\n  .chart-swatch {\n    flex-shrink: 0;\n    inline-size: 0.75rem;\n    block-size: 0.75rem;\n    border-radius: 3px;\n    background: var(--series);\n\n    &[data-shape=\"line\"] {\n      block-size: 3px;\n      border-radius: 2px;\n    }\n\n    &[data-shape=\"dot\"] {\n      inline-size: 0.625rem;\n      block-size: 0.625rem;\n      border-radius: 50%;\n    }\n  }\n\n  .chart-plot {\n    position: relative;\n    min-width: 0;\n\n    &[hidden] {\n      display: none;\n    }\n  }\n\n  /* Charts draw left to right in every language (the arrows follow the drawing), and\n     never overflow their box before the first measure. */\n  .chart-svg {\n    display: block;\n    max-inline-size: 100%;\n    block-size: auto;\n    overflow: visible;\n    direction: ltr;\n    font-family: inherit;\n  }\n\n  .chart-grid line {\n    stroke: var(--chart-grid);\n    stroke-width: 1;\n    shape-rendering: crispEdges;\n\n    &[data-zero] {\n      stroke: var(--chart-axis);\n    }\n  }\n\n  .chart-axis-labels text {\n    fill: var(--ui-muted-foreground);\n    font-size: 11.5px;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .chart-end-label {\n    fill: var(--ui-foreground);\n    font-size: 12px;\n    font-weight: 500;\n  }\n\n  .chart-value-label {\n    fill: var(--ui-foreground);\n    font-size: 11.5px;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .chart-crosshair {\n    stroke: var(--chart-crosshair);\n    stroke-width: 1;\n    shape-rendering: crispEdges;\n  }\n\n  .chart-line {\n    fill: none;\n    stroke: var(--series);\n    stroke-width: 2;\n    stroke-linejoin: round;\n    stroke-linecap: round;\n  }\n\n  .chart-area {\n    fill: var(--series);\n    fill-opacity: var(--chart-area-opacity);\n  }\n\n  /* Stacked bands: a light wash each, with the series line along its top edge. */\n  .line-chart.chart-stacked .chart-area {\n    fill-opacity: calc(var(--chart-area-opacity) * 2.2);\n  }\n\n  /* Dots carry a 2px ring in the surface color, so they read where lines cross. */\n  .chart-dot {\n    fill: var(--series);\n    stroke: var(--chart-surface);\n    stroke-width: 2;\n  }\n\n  .chart-bar {\n    fill: var(--series);\n\n    &[data-dim] {\n      opacity: 0.5;\n    }\n  }\n\n  .chart-series[data-dim] {\n    opacity: 0.25;\n  }\n\n  /* The layer people and assistive tech use: one target per data position. */\n  .chart-points {\n    position: absolute;\n    inset: 0;\n    outline: none;\n  }\n\n  .chart-point {\n    position: absolute;\n    border-radius: calc(var(--ui-radius) - 1px);\n    outline: none;\n    cursor: crosshair;\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: -2px;\n    }\n\n    &[data-selected] {\n      background: color-mix(in oklch, var(--ui-foreground) 5%, transparent);\n    }\n\n    .bar-chart &,\n    .segmented-bar &,\n    .heatmap & {\n      cursor: pointer;\n    }\n  }\n\n  .chart-tooltip {\n    position: absolute;\n    z-index: 2;\n    display: grid;\n    gap: 0.25rem;\n    min-inline-size: 8rem;\n    max-inline-size: 16rem;\n    padding: 0.5rem 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-radius: var(--uiset-popup-radius, calc(var(--ui-radius) + 4px));\n    background: var(--ui-background);\n    box-shadow: var(--ui-shadow);\n    font-size: 0.8125rem;\n    pointer-events: none;\n    translate: 12px calc(-100% - 8px);\n\n    &[data-flip] {\n      translate: calc(-100% - 12px) calc(-100% - 8px);\n    }\n  }\n\n  .chart-tooltip-title {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  /* Values lead, names follow; a line key carries the identity. */\n  .chart-tooltip-row {\n    display: grid;\n    grid-template-columns: 0.75rem auto 1fr;\n    align-items: center;\n    gap: 0.5rem;\n\n    strong {\n      font-weight: 600;\n      font-variant-numeric: tabular-nums;\n    }\n\n    span:last-child {\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .chart-tooltip-total {\n    padding-block-start: 0.25rem;\n    border-block-start: 1px solid var(--ui-border);\n    color: var(--ui-muted-foreground);\n\n    strong {\n      color: var(--ui-foreground);\n      font-variant-numeric: tabular-nums;\n    }\n  }\n\n  .chart-axis-title {\n    fill: var(--ui-muted-foreground);\n    font-size: 11.5px;\n    font-weight: 600;\n  }\n\n  .chart-dot[data-dim] {\n    opacity: 0.45;\n  }\n\n  .scatter-chart .chart-point {\n    border-radius: 50%;\n  }\n\n  /* Segmented bar: a share printed inside its block, in white or near-black by the fill. */\n  /* Above L 0.56 near-black reads better than white; every slot clears 4.5:1 either way. */\n  .segmented-bar-label {\n    fill: white;\n    fill: oklch(from var(--series) clamp(0, (0.56 - l) * 1000, 1) 0 0);\n    font-size: 12px;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .heatmap-cell {\n    fill: var(--cell, var(--chart-grid));\n\n    &[data-empty] {\n      fill: var(--chart-grid);\n    }\n\n    &[data-active] {\n      stroke: var(--ui-foreground);\n      stroke-width: 2;\n    }\n  }\n\n  .heatmap-scale-label {\n    fill: var(--ui-muted-foreground);\n    font-size: 11.5px;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .heatmap-tooltip-row {\n    grid-template-columns: auto 1fr;\n  }\n\n  .sparkline {\n    display: inline-block;\n    vertical-align: middle;\n    overflow: visible;\n\n    .chart-dot {\n      stroke-width: 1.5;\n    }\n  }\n\n  /* The table twin. */\n  .chart-table-scroller {\n    max-block-size: 22rem;\n    overflow: auto;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius) + 2px);\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 2px;\n    }\n  }\n\n  .chart-table {\n    inline-size: 100%;\n    border-collapse: collapse;\n    font-size: 0.8125rem;\n\n    th,\n    td {\n      padding: 0.375rem 0.75rem;\n      border-block-end: 1px solid var(--ui-border);\n      text-align: start;\n      white-space: nowrap;\n    }\n\n    thead th {\n      position: sticky;\n      top: 0;\n      background: color-mix(in oklch, var(--ui-muted) 60%, var(--ui-background));\n      color: var(--ui-muted-foreground);\n      font-weight: 600;\n    }\n\n    tbody th {\n      font-weight: 500;\n    }\n\n    [data-numeric] {\n      text-align: end;\n      font-variant-numeric: tabular-nums;\n    }\n  }\n\n  /* Series keep their colors in forced colors; chrome takes the system's. */\n  @media (forced-colors: active) {\n    .chart-svg .chart-series,\n    .chart-svg .chart-bar,\n    .chart-swatch {\n      forced-color-adjust: none;\n    }\n\n    .chart-crosshair {\n      stroke: CanvasText;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/chart/chart.css"
    }
  ],
  "type": "registry:ui"
}