{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "crossfoot-gap",
  "title": "Crossfoot Gap",
  "description": "An editable invoice grid that validates itself the way a bookkeeper crossfoots a ledger: row totals right of a vertical rule, column totals under a horizontal one, and a corner gap whose width (not a warning icon) carries the size of the mismatch.",
  "dependencies": [],
  "files": [
    {
      "path": "registry/core/crossfoot-gap/component.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\n// ---------------------------------------------------------------------------\n// CrossfootGap — an invoice/allocation grid that validates itself the way a\n// bookkeeper crossfoots a paper ledger: foot every row, foot every column,\n// and check the two grand totals meet in the corner. Each ROW carries a\n// stated amount (the ground truth — a receipt total, an invoice line, a\n// budget cap) that is NOT itself computed from the grid; each interior cell\n// is where the user TYPES how that amount splits across columns (cost\n// codes, periods, categories). Because the stated amounts and the typed\n// splits are two independently-sourced numbers, they can genuinely\n// disagree — unlike a plain matrix where row-sums and column-sums of the\n// SAME cells are always identical by construction, this is a real\n// reconciliation: forget to code part of a receipt and the grid falls\n// short by exactly that amount; mistype a digit and it's off by pennies.\n//\n// MECHANISM: one function (computeLedger, below) derives { rowStated,\n// colTotals, sumStated, sumAllocated, diffCents } from props in a single\n// pass — the same object feeds both the printed row/column/grand totals AND\n// the gap's pixel width, so there is no second calculation that could drift\n// out of sync with what's on screen. gapPx = 0 when diffCents === 0,\n// otherwise clamp(3, log1p(|$|)/log1p(10000) * 24, 24) — a floor so a\n// one-cent miss is never rendered as \"closed\", a log curve so a $0.09 typo\n// and a $1,240 dropped line read as visibly different widths, and a 24px\n// ceiling so the gap can never push the table into reflow.\n//\n// GEOMETRY: a single <svg> overlays the table (position:relative wrapper).\n// The horizontal closing rule runs from the table's left edge to\n// cornerX − gap/2 at y = cornerY (the top of the footer row); the vertical\n// closing rule runs from the table's top edge to cornerY − gap/2 at\n// x = cornerX (the left edge of the row-totals column). cornerX/cornerY are\n// measured directly off the grand-total <td> via getBoundingClientRect, so\n// the rules always terminate exactly at its corner regardless of column\n// widths. The signed diff prints in Geist Mono, decorative and aria-hidden,\n// centered on the corner and rotated 45° — along the bisector of the\n// opening between a rule receding left and one receding up. Gap width eases\n// toward its target via a small rAF tween (ease-out-cubic, ~240ms) rather\n// than a CSS transition on raw SVG geometry, so it holds up everywhere.\n// At diffCents === 0 a second pair of hairlines — the accountant's double\n// rule — inks in under the grand-total figure via a pathLength=1\n// stroke-dashoffset keyframe (350ms, ease-out-expo), keyed so it replays\n// every time the ledger newly closes, not just once.\n//\n// A11Y: a real <table>; every interior <input> carries its own aria-label\n// (\"<row> allocated to <column>\"); row/column/grand totals are read-only\n// <td>s with tabIndex=0 so they're reachable but never mistaken for\n// editable fields; the grand-total cell's own visible text states the\n// reconciled status in words (\"Ledger closed\" / \"off by −$0.09\") — the\n// SVG's rotated echo is decoration, not the only channel. A debounced\n// aria-live=polite region mirrors the same status (\"out of balance by\n// −$12.40\" / \"Ledger closed\") without announcing every keystroke. No\n// submit step: every number is live off controlled state. Reduced motion\n// removes the tween (gap width jumps straight to target) and the ink-in\n// keyframe (double rule is simply present, fully drawn).\n// ---------------------------------------------------------------------------\n\nexport interface CrossfootColumn {\n  id: string;\n  /** column header, e.g. a cost code or period */\n  label: string;\n}\n\nexport interface CrossfootRow {\n  id: string;\n  /** row header, e.g. a receipt or line-item description */\n  label: string;\n  /** the stated / ground-truth amount for this line, in dollars */\n  amount: number;\n}\n\nexport interface CrossfootGapProps {\n  columns: CrossfootColumn[];\n  rows: CrossfootRow[];\n  /** controlled split: cells[rowId]?.[colId] = the raw string currently typed into that cell */\n  cells: Record<string, Record<string, string>>;\n  onCellChange: (rowId: string, colId: string, value: string) => void;\n  /** currency symbol prefix for every printed amount. default \"$\" */\n  currency?: string;\n  /** accessible name for the table. default \"Invoice ledger\" */\n  ariaLabel?: string;\n  /** row-header column heading. default \"Line item\" */\n  rowHeaderLabel?: string;\n  /** footer row heading, above the computed column totals. default \"Allocated\" */\n  footerLabel?: string;\n  className?: string;\n}\n\nconst TWEEN_MS = 240;\nconst WIPE_MS = 350;\nconst LIVE_DEBOUNCE_MS = 500;\nconst MIN_GAP_PX = 3;\nconst MAX_GAP_PX = 24;\nconst GAP_SATURATION_DOLLARS = 10000;\n\nfunction toCents(raw: string | undefined): number {\n  if (!raw) return 0;\n  const cleaned = raw.replace(/[^0-9.-]/g, \"\");\n  if (!cleaned) return 0;\n  const n = Number.parseFloat(cleaned);\n  if (!Number.isFinite(n)) return 0;\n  return Math.round(n * 100);\n}\n\nfunction formatCents(cents: number, currency: string): string {\n  // A negative allocation is legitimate bookkeeping (a credit line), so the\n  // input regex in toCents keeps '-' anywhere, not just leading. But\n  // splitting sign off the FLOORED/MODULO'd value, rather than the raw\n  // magnitude, put the sign on the dollars term and left it on the cents\n  // remainder too (JS '%' preserves the dividend's sign): -55025 cents\n  // rendered as \"$-551.-25\" (floor(-550.25) = -551, -55025 % 100 = -25)\n  // instead of \"-$550.25\". Take the sign off the magnitude once, up front,\n  // then floor/mod the absolute value so dollars and cents never carry a\n  // second, independent sign.\n  const sign = cents < 0 ? \"−\" : \"\";\n  const abs = Math.abs(cents);\n  const dollars = Math.floor(abs / 100);\n  const rem = abs % 100;\n  return `${sign}${currency}${dollars.toLocaleString(\"en-US\")}.${String(rem).padStart(2, \"0\")}`;\n}\n\nfunction formatSigned(diffCents: number, currency: string): string {\n  const sign = diffCents < 0 ? \"−\" : \"+\";\n  return `${sign}${formatCents(Math.abs(diffCents), currency)}`;\n}\n\nfunction gapPxFromDiff(diffCents: number): number {\n  if (diffCents === 0) return 0;\n  const dollars = Math.abs(diffCents) / 100;\n  const t = Math.log1p(dollars) / Math.log1p(GAP_SATURATION_DOLLARS);\n  const px = MIN_GAP_PX + t * (MAX_GAP_PX - MIN_GAP_PX);\n  return Math.min(MAX_GAP_PX, Math.max(MIN_GAP_PX, px));\n}\n\nfunction computeLedger(rows: CrossfootRow[], columns: CrossfootColumn[], cells: CrossfootGapProps[\"cells\"]) {\n  const colTotals = columns.map((col) =>\n    rows.reduce((sum, row) => sum + toCents(cells[row.id]?.[col.id]), 0)\n  );\n  const rowStated = rows.map((row) => Math.round(row.amount * 100));\n  const sumStated = rowStated.reduce((a, b) => a + b, 0);\n  const sumAllocated = colTotals.reduce((a, b) => a + b, 0);\n  const diffCents = sumAllocated - sumStated;\n  return { colTotals, rowStated, sumStated, sumAllocated, diffCents, gapPx: gapPxFromDiff(diffCents) };\n}\n\nexport function CrossfootGap({\n  columns,\n  rows,\n  cells,\n  onCellChange,\n  currency = \"$\",\n  ariaLabel = \"Invoice ledger\",\n  rowHeaderLabel = \"Line item\",\n  footerLabel = \"Allocated\",\n  className = \"\",\n}: CrossfootGapProps) {\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const cornerRef = useRef<HTMLTableCellElement>(null);\n  const headlineRef = useRef<HTMLSpanElement>(null);\n\n  const [reducedMotion, setReducedMotion] = useState(false);\n  const [size, setSize] = useState({ w: 0, h: 0 });\n  const [corner, setCorner] = useState({ x: 0, y: 0, w: 0, h: 0 });\n  const [headline, setHeadline] = useState({ y: 0 });\n  const [gapAnim, setGapAnim] = useState(0);\n  const [closedKey, setClosedKey] = useState(0);\n  const [liveMsg, setLiveMsg] = useState(\"\");\n\n  const gapAnimRef = useRef(0);\n  const prevDiffRef = useRef<number | null>(null);\n  const liveTimerRef = useRef<number | undefined>(undefined);\n\n  const ledger = useMemo(() => computeLedger(rows, columns, cells), [rows, columns, cells]);\n  const { colTotals, rowStated, sumStated, diffCents, gapPx } = ledger;\n\n  useEffect(() => {\n    const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n    const update = () => setReducedMotion(mq.matches);\n    update();\n    mq.addEventListener(\"change\", update);\n    return () => mq.removeEventListener(\"change\", update);\n  }, []);\n\n  // Measure the grand-total corner (and the wrap it's positioned against)\n  // straight off the DOM so the closing rules terminate exactly at its\n  // edges no matter how column widths land.\n  useLayoutEffect(() => {\n    function measure() {\n      const wrap = wrapRef.current;\n      const cornerEl = cornerRef.current;\n      if (!wrap || !cornerEl) return;\n      const wrapRect = wrap.getBoundingClientRect();\n      const cRect = cornerEl.getBoundingClientRect();\n      setSize({ w: wrap.scrollWidth, h: wrap.scrollHeight });\n      setCorner({\n        x: cRect.left - wrapRect.left + wrap.scrollLeft,\n        y: cRect.top - wrapRect.top + wrap.scrollTop,\n        w: cRect.width,\n        h: cRect.height,\n      });\n      const hEl = headlineRef.current;\n      if (hEl) {\n        const hRect = hEl.getBoundingClientRect();\n        setHeadline({ y: hRect.bottom - wrapRect.top + wrap.scrollTop });\n      }\n    }\n    measure();\n    const ro = new ResizeObserver(measure);\n    if (wrapRef.current) ro.observe(wrapRef.current);\n    return () => ro.disconnect();\n  }, [rows, columns, cells]);\n\n  // Ease the gap width toward its target instead of snapping — a small\n  // hand-rolled tween rather than a CSS transition on raw SVG attributes,\n  // which does not animate reliably everywhere.\n  useEffect(() => {\n    if (reducedMotion) {\n      setGapAnim(gapPx);\n      gapAnimRef.current = gapPx;\n      return;\n    }\n    let raf = 0;\n    const from = gapAnimRef.current;\n    const to = gapPx;\n    const start = performance.now();\n    function tick(now: number) {\n      const t = Math.min(1, (now - start) / TWEEN_MS);\n      const eased = 1 - (1 - t) ** 3;\n      const val = from + (to - from) * eased;\n      gapAnimRef.current = val;\n      setGapAnim(val);\n      if (t < 1) raf = requestAnimationFrame(tick);\n    }\n    raf = requestAnimationFrame(tick);\n    return () => cancelAnimationFrame(raf);\n  }, [gapPx, reducedMotion]);\n\n  // Replay the double-rule ink-in every time the ledger newly closes, not\n  // just on the first render it happens to already be closed.\n  useEffect(() => {\n    if (prevDiffRef.current !== null && prevDiffRef.current !== 0 && diffCents === 0) {\n      setClosedKey((k) => k + 1);\n    }\n    prevDiffRef.current = diffCents;\n  }, [diffCents]);\n\n  // Debounce the live-region announcement so typing doesn't narrate every\n  // keystroke — the visual gap already updates immediately.\n  useEffect(() => {\n    if (liveTimerRef.current) window.clearTimeout(liveTimerRef.current);\n    liveTimerRef.current = window.setTimeout(() => {\n      setLiveMsg(diffCents === 0 ? \"Ledger closed\" : `out of balance by ${formatSigned(diffCents, currency)}`);\n    }, LIVE_DEBOUNCE_MS);\n    return () => {\n      if (liveTimerRef.current) window.clearTimeout(liveTimerRef.current);\n    };\n  }, [diffCents, currency]);\n\n  const closed = diffCents === 0;\n  const cornerLabel = closed\n    ? `Grand total ${formatCents(sumStated, currency)} — Ledger closed`\n    : `Grand total ${formatCents(sumStated, currency)} — out of balance by ${formatSigned(diffCents, currency)}`;\n\n  const notchX = corner.x + gapAnim * 0.5;\n  const notchY = corner.y + gapAnim * 0.5;\n\n  return (\n    <div className={[\"ns-cf\", className].join(\" \")}>\n      <style>{`\n.ns-cf-scroll{overflow-x:auto}\n.ns-cf-wrap{position:relative}\n.ns-cf table{border-collapse:collapse;width:100%}\n.ns-cf th,.ns-cf td{white-space:nowrap}\n.ns-cf thead th{font:12px/1.3 var(--font-mono, ui-monospace, monospace);text-transform:uppercase;letter-spacing:.08em;color:var(--ns-muted);text-align:right;padding:0 10px 8px;font-weight:500}\n.ns-cf thead th:first-child,.ns-cf tbody th{text-align:left}\n.ns-cf tbody th{font:13px/1.4 var(--font-mono, ui-monospace, monospace);color:var(--foreground);font-weight:400;padding:7px 10px 7px 2px;border-top:1px solid var(--border)}\n.ns-cf tbody td{padding:5px 10px;border-top:1px solid var(--border);text-align:right}\n.ns-cf tbody tr:first-child th,.ns-cf tbody tr:first-child td{border-top:none}\n.ns-cf-input{width:6.4em;text-align:right;background:transparent;color:var(--foreground);font:13px/1.4 var(--font-mono, ui-monospace, monospace);border:1px solid transparent;border-radius:6px;padding:4px 6px;outline:none}\n.ns-cf-input::placeholder{color:var(--ns-muted);opacity:.55}\n.ns-cf-input:hover{border-color:var(--border)}\n.ns-cf-input:focus-visible{border-color:transparent;outline:2px solid var(--ns-accent);outline-offset:1px}\n.ns-cf-rowtotal{font:13px/1.4 var(--font-mono, ui-monospace, monospace);color:var(--ns-muted);padding:5px 2px 5px 10px}\n.ns-cf-rowtotal:focus-visible{outline:2px solid var(--ns-accent);outline-offset:-1px;border-radius:4px}\n.ns-cf-foot th{text-align:left;font:12px/1.3 var(--font-mono, ui-monospace, monospace);color:var(--ns-muted);padding:10px 10px 10px 2px;font-weight:400}\n.ns-cf-foot td{font:13px/1.4 var(--font-mono, ui-monospace, monospace);color:var(--foreground);padding:10px;text-align:right}\n.ns-cf-foot td:focus-visible,.ns-cf-foot th:focus-visible{outline:2px solid var(--ns-accent);outline-offset:-1px;border-radius:4px}\n.ns-cf-corner{vertical-align:top;position:relative}\n/* gap must clear the double rule, which the SVG overlay draws at\n   headline.bottom + 4px and + 7px. At the original 2px the status caption\n   started at +2 and the two rules struck straight through \"Ledger closed\".\n   12px puts the caption 5px below the lower rule, so the corner reads as an\n   accountant's block: figure, double underline, then the status word. */\n.ns-cf-corner-inner{display:inline-flex;flex-direction:column;align-items:flex-end;gap:12px}\n.ns-cf-corner-headline{font-size:14px;color:var(--foreground)}\n.ns-cf-corner-status{font-size:11px;color:var(--ns-muted)}\n.ns-cf-corner[data-closed=\"true\"] .ns-cf-corner-status{color:var(--foreground)}\n.ns-cf-rules{position:absolute;inset:0;pointer-events:none}\n.ns-cf-rule{stroke:var(--border);stroke-width:1;transition:none}\n.ns-cf-double-line{stroke:var(--foreground);stroke-width:1;fill:none;stroke-dasharray:1;stroke-dashoffset:0}\n.ns-cf-double[data-anim=\"true\"] .ns-cf-double-line{animation:ns-cf-wipe ${WIPE_MS}ms cubic-bezier(.16,1,.3,1) forwards}\n@keyframes ns-cf-wipe{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}\n.ns-cf-notch{position:absolute;font:11px/1 var(--font-mono, ui-monospace, monospace);color:var(--foreground);transform:translate(-50%,-50%) rotate(45deg);white-space:nowrap;pointer-events:none}\n@media (prefers-reduced-motion: reduce){\n  .ns-cf-double-line{animation:none!important;stroke-dashoffset:0!important}\n}\n`}</style>\n\n      <div className=\"ns-cf-scroll rounded-xl border border-border bg-background\">\n        <div ref={wrapRef} className=\"ns-cf-wrap px-3 py-3\">\n          <table aria-label={ariaLabel}>\n            <thead>\n              <tr>\n                <th scope=\"col\">{rowHeaderLabel}</th>\n                {columns.map((col) => (\n                  <th scope=\"col\" key={col.id}>\n                    {col.label}\n                  </th>\n                ))}\n                <th scope=\"col\">Total</th>\n              </tr>\n            </thead>\n            <tbody>\n              {rows.map((row, ri) => (\n                <tr key={row.id}>\n                  <th scope=\"row\">{row.label}</th>\n                  {columns.map((col) => (\n                    <td key={col.id}>\n                      <input\n                        type=\"text\"\n                        inputMode=\"decimal\"\n                        className=\"ns-cf-input\"\n                        placeholder=\"0.00\"\n                        aria-label={`${row.label} allocated to ${col.label}`}\n                        data-cell={`${row.id}-${col.id}`}\n                        value={cells[row.id]?.[col.id] ?? \"\"}\n                        onChange={(e) => onCellChange(row.id, col.id, e.target.value)}\n                      />\n                    </td>\n                  ))}\n                  <td\n                    className=\"ns-cf-rowtotal\"\n                    tabIndex={0}\n                    aria-label={`${row.label} total: ${formatCents(rowStated[ri], currency)}`}\n                  >\n                    {formatCents(rowStated[ri], currency)}\n                  </td>\n                </tr>\n              ))}\n            </tbody>\n            <tfoot>\n              <tr className=\"ns-cf-foot\">\n                <th scope=\"row\" tabIndex={0}>\n                  {footerLabel}\n                </th>\n                {columns.map((col, ci) => (\n                  <td key={col.id} tabIndex={0} aria-label={`${col.label} allocated total: ${formatCents(colTotals[ci], currency)}`}>\n                    {formatCents(colTotals[ci], currency)}\n                  </td>\n                ))}\n                <td\n                  ref={cornerRef}\n                  className=\"ns-cf-corner\"\n                  data-closed={closed}\n                  tabIndex={0}\n                  aria-label={cornerLabel}\n                >\n                  <span className=\"ns-cf-corner-inner\">\n                    <span ref={headlineRef} className=\"ns-cf-corner-headline\">\n                      {formatCents(sumStated, currency)}\n                    </span>\n                    <span className=\"ns-cf-corner-status\">{closed ? \"Ledger closed\" : `off by ${formatSigned(diffCents, currency)}`}</span>\n                  </span>\n                </td>\n              </tr>\n            </tfoot>\n          </table>\n\n          <svg aria-hidden=\"true\" className=\"ns-cf-rules\" width={size.w} height={size.h}>\n            <line className=\"ns-cf-rule\" x1={0} y1={corner.y} x2={Math.max(0, corner.x - gapAnim / 2)} y2={corner.y} />\n            <line className=\"ns-cf-rule\" x1={corner.x} y1={0} x2={corner.x} y2={Math.max(0, corner.y - gapAnim / 2)} />\n            {closed && corner.w > 0 ? (\n              <g key={closedKey} className=\"ns-cf-double\" data-anim=\"true\">\n                <line\n                  className=\"ns-cf-double-line\"\n                  pathLength={1}\n                  x1={corner.x + 4}\n                  y1={headline.y + 4}\n                  x2={corner.x + corner.w - 4}\n                  y2={headline.y + 4}\n                />\n                <line\n                  className=\"ns-cf-double-line\"\n                  pathLength={1}\n                  x1={corner.x + 4}\n                  y1={headline.y + 7}\n                  x2={corner.x + corner.w - 4}\n                  y2={headline.y + 7}\n                />\n              </g>\n            ) : null}\n          </svg>\n\n          {!closed && corner.w > 0 ? (\n            <div className=\"ns-cf-notch\" style={{ left: notchX, top: notchY }}>\n              {formatSigned(diffCents, currency)}\n            </div>\n          ) : null}\n        </div>\n      </div>\n\n      <div aria-live=\"polite\" className=\"sr-only\">\n        {liveMsg}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:ui",
      "target": "components/ui/crossfoot-gap.tsx"
    }
  ],
  "cssVars": {
    "theme": {
      "color-ns-muted": "var(--ns-muted)",
      "color-ns-accent": "var(--ns-accent)"
    },
    "light": {
      "ns-muted": "#4d4d4d",
      "ns-accent": "#006bff"
    },
    "dark": {
      "ns-muted": "#8f8f8f"
    }
  },
  "meta": {
    "collection": "core",
    "tags": [
      "table",
      "form",
      "invoice",
      "ledger",
      "reconciliation",
      "svg",
      "aria-live",
      "accessibility",
      "mono",
      "budget"
    ],
    "instruction": "An invoice/allocation grid where each ROW carries a stated ground-truth amount (a receipt total, an invoice line) as a prop, and each interior cell is a native <input inputmode=\"decimal\"> where the user types how that amount splits across the grid's COLUMNS (cost codes, categories, periods). Because the stated amounts and the typed splits are two independently-sourced numbers rather than one matrix summed two ways, they can genuinely disagree: leave part of a receipt uncoded and the ledger falls short by exactly that line's amount; mistype a digit and it's off by pennies. One function (computeLedger) derives { rowStated, colTotals, sumStated, sumAllocated, diffCents } in a single pass from props — that same object feeds both the printed row/column/grand totals AND the gap's pixel width, so there is no second calculation that could drift out of sync with what's on screen. GEOMETRY: rows sit in a real <table> (<th scope=\"row\"> per line item, <th scope=\"col\"> per category) with a read-only, tabIndex=0 row-total cell (the stated amount) at the right of each row and a read-only, tabIndex=0 column-total cell (the computed allocation) in a <tfoot> row; the grand-total <td> at their intersection is measured directly via getBoundingClientRect so an absolutely-positioned <svg> overlay can draw two --border hairlines that terminate exactly at its edges: a horizontal rule from the table's left edge to cornerX − gap/2, a vertical rule from the table's top edge to cornerY − gap/2. gapPx = 0 when diffCents === 0, otherwise clamp(3px floor, log1p(|dollars|)/log1p(10000) scaled to 24px, 24px ceiling) — the floor keeps a one-cent miss from rendering as visually closed, the log curve makes a $0.09 typo and a $1,240 dropped line read as distinguishably different widths, and the 24px cap means the gap can never push the table into reflow. The signed diff prints in Geist Mono, aria-hidden and decorative, centered on the corner and rotated 45° along the bisector of the opening (one rule receding left, the other up). Gap width eases toward its target with a small hand-rolled requestAnimationFrame tween (ease-out-cubic, ~240ms) rather than a CSS transition on raw SVG attributes. The instant diffCents reaches exactly zero, a second pair of hairlines — the accountant's double rule — inks in under the grand-total figure via a pathLength=1 stroke-dashoffset keyframe (350ms, ease-out-expo cubic-bezier(.16,1,.3,1)), re-keyed so it replays every time the ledger newly closes rather than only once. Corner cell text always states the reconciled status in words (\"Ledger closed\" / \"off by −$0.09\") independent of the SVG, and a debounced (500ms) aria-live=\"polite\" region mirrors the same phrasing without narrating every keystroke — the visible gap itself updates immediately as you type. There is no submit step: every total, and the gap itself, is simply what is true of the current controlled state. The corner gap is the ONLY error indicator in the component — no per-cell warning icons, no boolean invalid flag anywhere. Props: columns ({id,label}[]), rows ({id,label,amount}[] — amount is the stated ground truth in dollars), cells (Record<rowId, Record<colId, string>>, controlled), onCellChange(rowId, colId, value), currency (default \"$\"), ariaLabel, rowHeaderLabel (default \"Line item\"), footerLabel (default \"Allocated\"), className. Reduced motion removes the rAF tween (gap width jumps straight to its target) and the ink-in keyframe (the double rule is simply present, fully drawn) — nothing becomes unreachable or unreadable, only motion is removed. Pure DOM + SVG + CSS, no canvas; every color is --background/--foreground/--ns-muted/--border/--ns-accent, --ns-accent used only on input focus rings. Demo: a four-line expense report (hotel receipt split across lodging/meals/transport, three single-category receipts) that foots exactly at rest, plus 'Simulate typo', 'Simulate dropped line' and 'Reset' buttons that put the two named failure magnitudes on tap."
  },
  "type": "registry:ui"
}