gridsmith-ui 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/charts.js +3 -3
  2. package/dist/charts.js.map +1 -1
  3. package/dist/chat.js +4 -4
  4. package/dist/{chunk-CIVSNXFG.js → chunk-6MXHGH3D.js} +54 -15
  5. package/dist/chunk-6MXHGH3D.js.map +1 -0
  6. package/dist/{chunk-XGSQOMEY.js → chunk-EQDR57AM.js} +4 -4
  7. package/dist/{chunk-XGSQOMEY.js.map → chunk-EQDR57AM.js.map} +1 -1
  8. package/dist/{chunk-EMCSARQO.js → chunk-ILIODA7W.js} +3 -3
  9. package/dist/{chunk-EMCSARQO.js.map → chunk-ILIODA7W.js.map} +1 -1
  10. package/dist/{chunk-OENJCGTJ.js → chunk-JN37OVTP.js} +4 -4
  11. package/dist/{chunk-OENJCGTJ.js.map → chunk-JN37OVTP.js.map} +1 -1
  12. package/dist/{chunk-4KVFH5KC.js → chunk-M2QRNBDQ.js} +4 -3
  13. package/dist/chunk-M2QRNBDQ.js.map +1 -0
  14. package/dist/{chunk-Z63OSN64.js → chunk-NCIZQYXQ.js} +7 -4
  15. package/dist/chunk-NCIZQYXQ.js.map +1 -0
  16. package/dist/chunk-XVB55M3N.js +42 -0
  17. package/dist/chunk-XVB55M3N.js.map +1 -0
  18. package/dist/{chunk-PVTGMCVR.js → chunk-XYDIBW3J.js} +4 -4
  19. package/dist/{chunk-PVTGMCVR.js.map → chunk-XYDIBW3J.js.map} +1 -1
  20. package/dist/data-grid.js +3 -3
  21. package/dist/editor.d.ts +38 -2
  22. package/dist/editor.js +86 -10
  23. package/dist/editor.js.map +1 -1
  24. package/dist/index.d.ts +332 -92
  25. package/dist/index.js +1404 -542
  26. package/dist/index.js.map +1 -1
  27. package/dist/kanban.js +3 -3
  28. package/dist/resizable.d.ts +8 -1
  29. package/dist/resizable.js +35 -15
  30. package/dist/resizable.js.map +1 -1
  31. package/dist/roots.css +164 -2
  32. package/dist/tailwind.css +14 -0
  33. package/dist/utils.js +1 -1
  34. package/dist/virtualized.js +1 -1
  35. package/dist-static/tailwind.css +14 -0
  36. package/package.json +1 -1
  37. package/dist/chunk-4KVFH5KC.js.map +0 -1
  38. package/dist/chunk-CIVSNXFG.js.map +0 -1
  39. package/dist/chunk-Z63OSN64.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../showcase/src/lib/chart-utils.ts","../../../showcase/src/lib/chart-categories.ts","../../../showcase/src/components/charts/ChartWrapper.tsx","../../../showcase/src/components/charts/ChartPrimitives.tsx","../../../showcase/src/components/charts/BarChart.tsx","../../../showcase/src/components/charts/LineChart.tsx","../../../showcase/src/components/charts/AreaChart.tsx","../../../showcase/src/components/charts/PieChart.tsx","../../../showcase/src/components/charts/CompositeChart.tsx","../../../showcase/src/components/charts/ScatterChart.tsx","../../../showcase/src/components/charts/RadarChart.tsx","../../../showcase/src/components/charts/RadialBarChart.tsx","../../../showcase/src/components/charts/FunnelChart.tsx","../../../showcase/src/components/charts/TreemapChart.tsx","../../../showcase/src/components/charts/SankeyChart.tsx","../../../showcase/src/components/charts/Sparkline.tsx","../../../showcase/src/components/ChartContainer.tsx"],"names":["k","ChartWrapper","categoryKind","useState","useLayoutEffect","useContext","jsxs","jsx","useMemo","useEffect","forwardRef","BarChart","useRef","RechartsBarChart","Fragment","LineChart","ResponsiveContainer","RechartsLineChart","CartesianGrid","XAxis","YAxis","Tooltip","AreaChart","RechartsAreaChart","PieChart","RechartsPieChart","CompositeChart","Bar","Line","ScatterChart","RechartsScatterChart","RadarChart","RechartsRadarChart","RadialBarChart","RechartsRadialBarChart","FunnelChart","RechartsFunnelChart","TreemapChart","SankeyChart","RechartsSankey","Sparkline","useId","Area"],"mappings":";;;;;;;;AAEA,IAAM,YAAA,GAAe;AAAA,EACnB,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cA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AAA,EAAiB,QAAA,EAAS,CAAA,EAC3C;AAAA,KAAA,EAEJ,CAAA;AAAA,EAEJ,WAAW,UAAA,EAAY;AACrB,IAAA,IAAA,mBAAOA,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,2CAA2C,QAAA,EAAA,UAAA,EAAW,CAAA;AAAA,EAC9E;AAEA,EAAA,uBACED,IAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,EAAA;AAAA,MACV,SAAA,EAAQ,OAAA;AAAA,MACR,SAAA,EAAW,EAAA;AAAA,QACT,eAAA;AAAA,QACA,OAAA,KAAY,UACR,gBAAA,GACA,EAAA;AAAA;AAAA,UAEE,+CAAA;AAAA,UACA,mGAAA;AAAA,UACA;AAAA,SACF;AAAA,QACJ;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA,QAAA,KAAA,oBACCC,GAAAA,CAAC,IAAA,EAAA,EAAG,EAAA,EAAI,OAAA,EAAS,WAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA,EAC1D,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,wBAEFA,GAAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,iBAAA,EAAgB,EAAA;AAAA,YAChB,SAAA,EAAU,gCAAA;AAAA,YACV,OAAO,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,WAAA,GAAc,SAAY,IAAA,EAAK;AAAA,YAElE,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"charts.js","sourcesContent":["import { useState, useLayoutEffect, useSyncExternalStore } from \"react\";\n\nconst CHART_TOKENS = [\n \"--ds-chart-1\",\n \"--ds-chart-2\",\n \"--ds-chart-3\",\n \"--ds-chart-4\",\n \"--ds-chart-5\",\n \"--ds-chart-6\",\n] as const;\n\nconst CHART_TOKENS_SOFT = [\n \"--ds-chart-1-soft\",\n \"--ds-chart-2-soft\",\n \"--ds-chart-3-soft\",\n \"--ds-chart-4-soft\",\n \"--ds-chart-5-soft\",\n \"--ds-chart-6-soft\",\n] as const;\n\nconst FALLBACK_COLORS: Record<string, string> = {\n \"--ds-chart-1\": \"#6366f1\",\n \"--ds-chart-2\": \"#d97706\",\n \"--ds-chart-3\": \"#059669\",\n \"--ds-chart-4\": \"#dc2626\",\n \"--ds-chart-5\": \"#0891b2\",\n \"--ds-chart-6\": \"#7c3aed\",\n \"--ds-chart-1-soft\": \"rgba(99, 102, 241, 0.3)\",\n \"--ds-chart-2-soft\": \"rgba(217, 119, 6, 0.3)\",\n \"--ds-chart-3-soft\": \"rgba(5, 150, 105, 0.3)\",\n \"--ds-chart-4-soft\": \"rgba(220, 38, 38, 0.3)\",\n \"--ds-chart-5-soft\": \"rgba(8, 145, 178, 0.3)\",\n \"--ds-chart-6-soft\": \"rgba(124, 58, 237, 0.3)\",\n \"--ds-bg-surface\": \"#ffffff\",\n \"--ds-border-subtle\": \"#e5e7eb\",\n \"--ds-text-primary\": \"#111827\",\n \"--ds-text-secondary\": \"#6b7280\",\n \"--ds-text-muted\": \"#9ca3af\",\n};\n\ntype Subscriber = () => void;\n\nlet modeVersion = 0;\nconst subscribers = new Set<Subscriber>();\nlet observerAttached = false;\n\nfunction attachObserver() {\n if (observerAttached || typeof document === \"undefined\") return;\n observerAttached = true;\n\n const observer = new MutationObserver((mutations) => {\n for (const m of mutations) {\n if (m.attributeName === \"data-mode\") {\n modeVersion++;\n for (const sub of subscribers) sub();\n break;\n }\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-mode\"],\n });\n}\n\nfunction subscribe(cb: Subscriber) {\n attachObserver();\n subscribers.add(cb);\n return () => { subscribers.delete(cb); };\n}\n\nfunction getSnapshot() {\n return modeVersion;\n}\n\nfunction getServerSnapshot() {\n return 0;\n}\n\nexport function resolveToken(token: string): string {\n if (typeof document === \"undefined\") return FALLBACK_COLORS[token] ?? \"#6366f1\";\n const val = getComputedStyle(document.documentElement).getPropertyValue(token).trim();\n return val || FALLBACK_COLORS[token] || \"#6366f1\";\n}\n\nexport function useChartColors(count: number, soft = false): string[] {\n const version = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n const [colors, setColors] = useState<string[]>(() => fallbackColors(count, soft));\n\n // Reads computed CSS custom properties, which only exist after the theme's\n // style tag is committed — this has to be a post-layout effect.\n /* eslint-disable react-hooks/set-state-in-effect -- token resolution is a DOM read after commit */\n useLayoutEffect(() => {\n setColors(resolveColors(count, soft));\n }, [count, soft, version]);\n /* eslint-enable react-hooks/set-state-in-effect */\n\n return colors;\n}\n\nfunction fallbackColors(count: number, soft: boolean): string[] {\n const tokens = soft ? CHART_TOKENS_SOFT : CHART_TOKENS;\n const result: string[] = [];\n for (let i = 0; i < count; i++) {\n const token = tokens[i % tokens.length];\n result.push(FALLBACK_COLORS[token] ?? \"#6366f1\");\n }\n return result;\n}\n\nfunction resolveColors(count: number, soft: boolean): string[] {\n const tokens = soft ? CHART_TOKENS_SOFT : CHART_TOKENS;\n const result: string[] = [];\n for (let i = 0; i < count; i++) {\n const token = tokens[i % tokens.length];\n result.push(resolveToken(token));\n }\n return result;\n}\n\nexport function useResolvedToken(token: string): string {\n const version = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n const [value, setValue] = useState(() => FALLBACK_COLORS[token] ?? \"#6366f1\");\n\n /* eslint-disable react-hooks/set-state-in-effect -- token resolution is a DOM read after commit */\n useLayoutEffect(() => {\n setValue(resolveToken(token));\n }, [token, version]);\n /* eslint-enable react-hooks/set-state-in-effect */\n\n return value;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(() => {\n if (typeof window === \"undefined\") return false;\n return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n });\n\n useLayoutEffect(() => {\n const mql = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const handler = (e: MediaQueryListEvent) => setReduced(e.matches);\n mql.addEventListener(\"change\", handler);\n return () => mql.removeEventListener(\"change\", handler);\n }, []);\n\n return reduced;\n}\n\nexport const useChartAnimation = (animated?: boolean): boolean => {\n const reduced = useReducedMotion();\n return animated !== false && !reduced;\n};\n","/**\n * Sprint 25.9, A3 — what a chart's category axis holds, and how its labels fit. No Recharts here: the charts entry and\n * the tests import it, and it never measures on its own (the measurer is handed in).\n *\n * - `categoryKind(labels)`: \"scale\" when every non-empty label is a date, a time, a period or a number, else \"names\".\n * Anchored patterns only — never `Date.parse`, which V8 lets read \"Tier 1\", \"Sprint 1\" and \"Northern Region 2\" as dates.\n * - `createAxisMeasurer(el)`: canvas text widths in the axis's resolved font, read from a probe that carries\n * `font-size: var(--ds-font-size-xs)`, so a `calc()` token (`calc(16px * .75)`, a 14 px base) measures right.\n * - `fitLabel(name, width, measure)`: one line; else two lines split at a space; else \"…\" on the second. Never drops it.\n */\n\nexport type CategoryKind = \"names\" | \"scale\";\n\n/** A text's width in px in the axis font. */\nexport type Measure = (text: string) => number;\n\nconst ENGLISH_MONTHS = [\n \"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\",\n \"jan\", \"feb\", \"mar\", \"apr\", \"jun\", \"jul\", \"aug\", \"sep\", \"sept\", \"oct\", \"nov\", \"dec\",\n];\nconst ENGLISH_WEEKDAYS = [\n \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\",\n \"mon\", \"tue\", \"tues\", \"wed\", \"thu\", \"thur\", \"thurs\", \"fri\", \"sat\", \"sun\",\n];\n\nconst escape = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nconst clean = (s: string) => s.trim().toLowerCase().replace(/\\.$/, \"\");\n\nfunction intlNames(locale: string, kind: \"month\" | \"weekday\"): string[] {\n const out: string[] = [];\n try {\n for (const width of [\"short\", \"long\"] as const) {\n const fmt = new Intl.DateTimeFormat(locale, kind === \"month\" ? { month: width, timeZone: \"UTC\" } : { weekday: width, timeZone: \"UTC\" });\n // 2026-01-05 is a Monday: seven days give the weekdays, the 15th of each month the months\n const count = kind === \"month\" ? 12 : 7;\n for (let i = 0; i < count; i++) {\n const date = kind === \"month\" ? new Date(Date.UTC(2026, i, 15)) : new Date(Date.UTC(2026, 0, 5 + i));\n out.push(clean(fmt.format(date)));\n }\n }\n } catch {\n // an unknown locale tag: English covers it\n }\n return out;\n}\n\nfunction locales(): string[] {\n const out = new Set<string>([\"en\"]);\n try { out.add(new Intl.DateTimeFormat().resolvedOptions().locale); } catch { /* no Intl locale */ }\n if (typeof navigator !== \"undefined\" && navigator.language) out.add(navigator.language);\n if (typeof document !== \"undefined\" && document.documentElement?.lang) out.add(document.documentElement.lang);\n return [...out];\n}\n\ninterface Patterns { key: string; list: RegExp[] }\nlet cached: Patterns | null = null;\n\nfunction patterns(): Patterns {\n const tags = locales();\n const key = tags.join(\"|\");\n if (cached?.key === key) return cached;\n const months = new Set(ENGLISH_MONTHS);\n const weekdays = new Set(ENGLISH_WEEKDAYS);\n for (const tag of tags) {\n for (const m of intlNames(tag, \"month\")) if (m) months.add(m);\n for (const d of intlNames(tag, \"weekday\")) if (d) weekdays.add(d);\n }\n // the longest first, so \"sept\" wins over \"sep\" and \"june\" over \"jun\"\n const alt = (set: Set<string>) => [...set].sort((a, b) => b.length - a.length).map(escape).join(\"|\");\n const M = `(?:${alt(months)})\\\\.?`;\n const D = `(?:${alt(weekdays)})\\\\.?`;\n const day = String.raw`\\d{1,2}(?:st|nd|rd|th|\\.)?`;\n const year = String.raw`'?\\d{2,4}`;\n const list = [\n // dates in digits: 2026-09-21, 21/09, 09/21/2026, 21.09.2026, an ISO date-time\n /^\\d{4}[-/.]\\d{1,2}(?:[-/.]\\d{1,2})?$/,\n /^\\d{1,2}[-/.]\\d{1,2}(?:[-/.]\\d{2,4})?$/,\n /^\\d{4}-\\d{2}-\\d{2}[T ]\\d{1,2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})?$/,\n // a day and a month in either order, and a month alone or with its year: 16 Sep, 21. Sept., Sept 21, March 2026\n new RegExp(`^${day}\\\\s*${M}(?:,?\\\\s+${year})?$`, \"iu\"),\n new RegExp(`^${M}\\\\s*${day}(?:,?\\\\s+${year})?$`, \"iu\"),\n new RegExp(`^${M}(?:\\\\s*${year})?$`, \"iu\"),\n // CJK dates: 9月21日, 2026年9月, 9월 21일\n /^(?:\\d{4}年)?\\d{1,2}月(?:\\d{1,2}日)?$/u,\n /^\\d{4}年(?:\\d{1,2}月)?$/u,\n /^(?:\\d{4}년\\s?)?\\d{1,2}월(?:\\s?\\d{1,2}일)?$/u,\n // a quarter or a half: Q3, Q3 2026, Q3 FY26, 2026 Q3, 3Q26, H1 2026\n /^Q[1-4](?:\\s*[-/']?\\s*(?:FY\\s?)?'?\\d{2,4})?$/i,\n /^[1-4]Q\\s*'?\\d{0,4}$/i,\n /^(?:FY\\s?)?'?\\d{2,4}\\s*[-/]?\\s*Q[1-4]$/i,\n /^H[12](?:\\s*'?\\d{2,4})?$/i,\n // a year or a fiscal year: 2026, FY26, FY 2025/26, 2025/26, 2025-2026\n /^(?:19|20)\\d{2}$/,\n /^FY\\s?'?\\d{2,4}(?:\\s?[-/]\\s?'?\\d{2,4})?$/i,\n /^(?:19|20)\\d{2}\\s?[-/–]\\s?(?:(?:19|20)?\\d{2})$/,\n // a week: W12, Wk 3, Week 12, Week 12 2026, 2026-W12\n /^(?:W|Wk|Week)\\.?\\s?\\d{1,2}(?:\\s*[,/-]?\\s*\\d{4})?$/i,\n /^\\d{4}-?W\\d{1,2}(?:-?\\d)?$/i,\n // a weekday: Mon, Tuesday, and the runtime and page locales' own\n new RegExp(`^${D}$`, \"iu\"),\n // a time: 09:00, 9:30 pm, 9am, 14h\n /^\\d{1,2}:\\d{2}(?::\\d{2})?\\s?(?:[ap]\\.?m\\.?)?$/i,\n /^\\d{1,2}\\s?[ap]\\.?m\\.?$/i,\n /^\\d{1,2}h(?:\\d{2})?$/i,\n // a number, a percentage or an amount: 12, -3.5, 1,200, 12%, $5k, €1.2m, 5 €, a bin (10–20, <10, 50+)\n /^[<>≤≥~]?\\s?[+\\-−]?\\s?[$€£¥₹]?\\s?\\d[\\d,. \\u00a0\\u202f]*(?:\\s?(?:k|m|mn|bn|b|t))?\\s?(?:%|[$€£¥₹])?\\+?$/iu,\n /^[$€£¥₹]?\\d[\\d,.]*\\s?[-–]\\s?[$€£¥₹]?\\d[\\d,.]*\\s?(?:k|m|bn|%)?$/iu,\n ];\n cached = { key, list };\n return cached;\n}\n\n/**\n * Whether a category axis holds names or a scale (dates, times, periods, numbers). Every non-empty label must match an\n * anchored pattern to be \"scale\"; an all-empty set is \"scale\". LineChart and AreaChart are always \"scale\"; BarChart and\n * CompositeChart guess with this, and their `categoryKind` prop overrides the guess.\n */\nexport function categoryKind(labels: ReadonlyArray<unknown>): CategoryKind {\n const { list } = patterns();\n for (const raw of labels) {\n if (raw == null) continue;\n if (typeof raw === \"number\") { if (Number.isFinite(raw)) continue; return \"names\"; }\n if (raw instanceof Date) continue;\n const text = String(raw).trim();\n if (!text) continue;\n if (!list.some((re) => re.test(text))) return \"names\";\n }\n return \"scale\";\n}\n\n/* ── Measuring ──────────────────────────────────────────────────────────── */\n\n/** The axis font as the page resolves it: size and family from a probe carrying the chart's tick tokens. */\nexport function resolvedAxisFont(el: Element): { font: string; px: number } {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n let probe = el.querySelector<HTMLElement>(\"[data-chart-probe]\");\n let temporary = false;\n if (!probe) {\n probe = doc.createElement(\"span\");\n probe.setAttribute(\"aria-hidden\", \"true\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none;white-space:nowrap;font-size:var(--ds-font-size-xs);font-family:var(--ds-font-sans)\";\n el.appendChild(probe);\n temporary = true;\n }\n const cs = view?.getComputedStyle(probe);\n const px = parseFloat(cs?.fontSize ?? \"\") || 12;\n const family = (cs?.fontFamily ?? \"\").trim() || \"sans-serif\";\n const style = cs?.fontStyle && cs.fontStyle !== \"normal\" ? `${cs.fontStyle} ` : \"\";\n const weight = cs?.fontWeight && cs.fontWeight !== \"400\" && cs.fontWeight !== \"normal\" ? `${cs.fontWeight} ` : \"\";\n if (temporary) probe.remove();\n return { font: `${style}${weight}${px}px ${family}`, px };\n}\n\n/** One 2D context for every chart, kept per getContext implementation (a test may swap it for a stub). */\nlet shared: { getContext: unknown; ctx: CanvasRenderingContext2D | null } | null = null;\n\nfunction canvasContext(): CanvasRenderingContext2D | null {\n if (typeof document === \"undefined\") return null;\n const getContext = (globalThis as { HTMLCanvasElement?: { prototype: { getContext?: unknown } } }).HTMLCanvasElement?.prototype.getContext;\n if (shared && shared.getContext === getContext) return shared.ctx;\n let ctx: CanvasRenderingContext2D | null = null;\n try { ctx = document.createElement(\"canvas\").getContext?.(\"2d\") ?? null; } catch { ctx = null; }\n shared = { getContext, ctx };\n return ctx;\n}\n\n/**\n * A text measurer in the chart's own axis font, or null where there is no canvas (jsdom): the charts then show every\n * label in full on one line and leave the thinning to nobody.\n */\nexport function createAxisMeasurer(el: Element): { measure: Measure; px: number; font: string } | null {\n const ctx = canvasContext();\n if (!ctx) return null;\n const { font, px } = resolvedAxisFont(el);\n ctx.font = font;\n const widths = new Map<string, number>();\n const measure: Measure = (text) => {\n let w = widths.get(text);\n if (w === undefined) {\n // the context is shared: another chart may have set its own font since\n ctx.font = font;\n w = ctx.measureText(text).width;\n widths.set(text, w);\n }\n return w;\n };\n return { measure, px, font };\n}\n\n/* ── Fitting a name ─────────────────────────────────────────────────────── */\n\nexport const ELLIPSIS = \"…\";\n\nexport interface FittedLabel {\n /** One or two lines; the second ends with \"…\" when the name was cut. */\n lines: string[];\n cut: boolean;\n /** Characters of the name that show, spaces and the ellipsis left out. */\n shown: number;\n}\n\nconst letters = (s: string) => s.replace(/\\s+/g, \"\").replace(/…/g, \"\").length;\n\n/** The longest prefix of `text` that fits `width` (at least one character). */\nfunction prefixThatFits(text: string, width: number, measure: Measure, suffix = \"\"): number {\n let lo = 1;\n let hi = text.length;\n let best = 0;\n while (lo <= hi) {\n const mid = (lo + hi) >> 1;\n if (measure(text.slice(0, mid).trimEnd() + suffix) <= width) { best = mid; lo = mid + 1; } else hi = mid - 1;\n }\n return best;\n}\n\n/**\n * A name fitted to `width`: one line when it fits; else two lines split at a space; else the second line ends with \"…\".\n * A first word wider than the line breaks where the line ends, with a hyphen, so it reads as one word going on. The\n * name is never dropped, and without a measurer it shows in full on one line.\n */\nexport function fitLabel(name: string, width: number, measure: Measure | null): FittedLabel {\n const text = name.replace(/\\s+/g, \" \").trim();\n if (!measure || !text || width <= 0 || measure(text) <= width) return { lines: [text], cut: false, shown: letters(text) };\n const words = text.split(\" \");\n let first = \"\";\n let firstShown = \"\";\n let rest = \"\";\n for (let i = words.length - 1; i >= 1; i--) {\n const candidate = words.slice(0, i).join(\" \");\n if (measure(candidate) <= width) { first = firstShown = candidate; rest = words.slice(i).join(\" \"); break; }\n }\n if (!first) {\n // the first word alone is too wide: the first line holds what fits of it and a hyphen\n const k = Math.max(1, prefixThatFits(text, width, measure, \"-\"));\n firstShown = text.slice(0, k).trimEnd();\n rest = text.slice(k).trimStart();\n first = rest && !text.slice(k - 1, k + 1).includes(\" \") ? `${firstShown}-` : firstShown;\n }\n if (!rest) return { lines: [first], cut: false, shown: letters(firstShown) };\n if (measure(rest) <= width) return { lines: [first, rest], cut: false, shown: letters(firstShown) + letters(rest) };\n const k = prefixThatFits(rest, width, measure, ELLIPSIS);\n const kept = k > 0 ? rest.slice(0, k).trimEnd() : \"\";\n return { lines: [first, kept + ELLIPSIS], cut: true, shown: letters(firstShown) + letters(kept) };\n}\n\n/** D8: fewer visible characters than this on a cut name turns an upright chart of names sideways. */\nexport const MIN_NAME_CHARS = 6;\n\n/** Whether any name, fitted to `width`, would be cut to fewer than MIN_NAME_CHARS characters. */\nexport function namesCutShort(names: ReadonlyArray<string>, width: number, measure: Measure): boolean {\n return names.some((n) => {\n const fit = fitLabel(n, width, measure);\n return fit.cut && fit.shown < MIN_NAME_CHARS;\n });\n}\n","import {\n Children, createContext, forwardRef, isValidElement, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState,\n type CSSProperties, type KeyboardEvent, type ReactNode, type Ref,\n} from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { mergeRefs } from \"../../lib/slot\";\n\n/* ── Heights ────────────────────────────────────────────────────────────── */\n\n/** A chart's height: \"auto\" (the default) sizes it from its type and its data; a preset or a number overrides. */\nexport type ChartHeight = \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n\nexport const CHART_HEIGHTS = {\n sm: \"var(--ds-chart-height-sm)\",\n md: \"var(--ds-chart-height-md)\",\n lg: \"var(--ds-chart-height-lg)\",\n} as const;\n\n/** One row of a row chart (a sideways bar, a funnel stage). */\nexport const CHART_ROW = \"var(--ds-chart-row, 2rem)\";\n\n/** A preset or a number as a CSS height; \"auto\" and \"fill\" have none (the chart sizes itself). */\nexport function fixedChartHeight(height: ChartHeight | \"fill\" | undefined): string | undefined {\n if (typeof height === \"number\") return `${height}px`;\n if (height === \"sm\" || height === \"md\" || height === \"lg\") return CHART_HEIGHTS[height];\n return undefined;\n}\n\n/**\n * How a chart sizes itself (Sprint 25.9, A2, P2):\n * - \"rows\" (a sideways BarChart, a FunnelChart): a row per item, never under sm; `units` rows, `lines` extra label lines\n * (a two-line name makes its row one line taller), `axis` the value axis and titles below or above the rows;\n * - \"ratio\" (charts over dates or numbers, Treemap, Sankey): two wide to one high, between sm and lg;\n * - \"square\" (Pie, Radar, RadialBar): as tall as wide, between sm and lg.\n */\nexport type ChartSize =\n | { model: \"ratio\" }\n | { model: \"square\" }\n | { model: \"rows\"; units: number; lines?: number; axis?: string };\n\nconst SM = CHART_HEIGHTS.sm;\nconst LG = CHART_HEIGHTS.lg;\n\n/**\n * The plot box's height and its bound in a row. `cqi` resolves against the chart's wrapper, the size container, because\n * the plot box is its child (on the wrapper itself it would read the page's container). The box is `flex: 1 0 auto`,\n * never `flex-1`: its drawing is absolute, so a zero basis would collapse it (R5). In a row it grows to the row's\n * height up to a bound: a ratio chart to square, a row chart to twice its height, a round chart not at all.\n */\nexport function plotBoxStyle(size: ChartSize, fixed: string | undefined): CSSProperties {\n if (size.model === \"square\") {\n return { height: fixed ?? `clamp(${SM}, 100cqi, ${LG})`, flex: \"0 0 auto\" };\n }\n if (size.model === \"rows\") {\n const lines = size.lines ? ` + ${size.lines} * 1.25 * var(--ds-font-size-xs)` : \"\";\n const height = fixed ?? `max(${SM}, calc(${size.units} * ${CHART_ROW}${lines} + ${size.axis ?? CHART_ROW}))`;\n return { height, maxHeight: `calc(2 * ${height})`, flex: \"1 0 auto\" };\n }\n return { height: fixed ?? `clamp(${SM}, 50cqi, ${LG})`, maxHeight: `max(${fixed ?? LG}, 100cqi)`, flex: \"1 0 auto\" };\n}\n\n/* ── The chart mark ─────────────────────────────────────────────────────── */\n\n/**\n * Marks the library's charts, so ChartContainer knows its child sizes itself and needs no minimum area of its own.\n * `Symbol.for`, as PAGE_HEADER_MARK, so a second copy of the module still matches. A hand-built chart, an EmptyState\n * or a Sparkline carries no mark and keeps the container's area.\n */\nexport const CHART_MARK: unique symbol = Symbol.for(\"gridsmith.Chart\") as never;\n\nexport function markChart<T extends object>(component: T): T {\n Object.assign(component, { [CHART_MARK]: true });\n return component;\n}\n\n/** A single library chart (not a Fragment, a wrapper of the builder's or a list of children). */\nexport function isLibraryChart(children: ReactNode): boolean {\n const kids = Children.toArray(children);\n if (kids.length !== 1) return false;\n const only = kids[0];\n if (!isValidElement(only)) return false;\n const type = only.type as unknown as Record<symbol, unknown> | string | null;\n return !!type && typeof type !== \"string\" && type[CHART_MARK] === true;\n}\n\n/* ── Context ────────────────────────────────────────────────────────────── */\n\nexport interface ChartContainerValue {\n /** The container's own height (a preset or a number, as CSS): it beats the chart's. */\n height?: string;\n /** The container title's id: the chart's graphic is named by it. */\n titleId?: string;\n /** The chart is not the container's only child (or is wrapped): it fills the container's area instead of sizing itself. */\n fillArea?: boolean;\n}\n\nexport const ChartContainerContext = createContext<ChartContainerValue | null>(null);\n\nexport function useInsideChartContainer(): boolean {\n return useContext(ChartContainerContext) !== null;\n}\n\n/** The chart's slots outside its drawing: the legend (Recharts' Legend portals into it) and the tooltip's live region. */\nexport interface ChartFrame {\n legend: HTMLElement | null;\n live: HTMLElement | null;\n}\n\nexport const ChartFrameContext = createContext<ChartFrame>({ legend: null, live: null });\n\n/* ── Keyboard ───────────────────────────────────────────────────────────── */\n\nconst REMAPPED = new WeakSet<Event>();\n\n/**\n * A sideways chart lists its rows top to bottom. Recharts maps only ArrowLeft and ArrowRight, and in that layout reads\n * ArrowRight as the row above. Down and Right move to the next row, Up and Left to the one before, in reading order.\n */\nfunction remapRowKeys(e: KeyboardEvent<HTMLDivElement>) {\n if (REMAPPED.has(e.nativeEvent)) return;\n const next = e.key === \"ArrowDown\" || e.key === \"ArrowRight\";\n const previous = e.key === \"ArrowUp\" || e.key === \"ArrowLeft\";\n if (!next && !previous) return;\n const target = e.target as Element;\n if (!target.closest?.(\".recharts-wrapper\")) return;\n e.preventDefault();\n e.stopPropagation();\n const View = target.ownerDocument.defaultView ?? window;\n const event = new View.KeyboardEvent(\"keydown\", { key: next ? \"ArrowLeft\" : \"ArrowRight\", bubbles: true, cancelable: true });\n REMAPPED.add(event);\n target.dispatchEvent(event);\n}\n\n/* ── The wrapper ────────────────────────────────────────────────────────── */\n\nexport interface ChartWrapperProps {\n /** The chart's own height prop. A ChartContainer's preset or number beats it. */\n height?: ChartHeight;\n /** How the chart sizes itself when no height is set. */\n size: ChartSize;\n /** The chart type, for `data-gs-chart` (the bench reads it). */\n chart: string;\n /** A cartesian category axis: its kind and its categories (`data-category-kind`, `data-categories`). */\n categoryKind?: \"names\" | \"scale\";\n categories?: number;\n /** Which axis carries the categories, for the label counts (`data-labels-shown`, `data-labels-cut`). */\n categoryAxis?: \"x\" | \"y\";\n /** The rows run top to bottom (a sideways BarChart): the arrow keys follow them. */\n sideways?: boolean;\n /** The value axis's title, drawn horizontally above the axis (the chart leaves room at the top). */\n axisTitle?: string;\n className?: string;\n children: ReactNode;\n \"aria-label\"?: string;\n}\n\n/**\n * Sprint 25.9, A2: the chart's frame and its size container. It holds the plot box (the Recharts drawing sits absolutely\n * inside it), the legend's slot below and the tooltip's live region, and owns the height, with or without a\n * ChartContainer. `min-inline-size` keeps a shrink-to-fit parent from collapsing it.\n */\nexport const ChartWrapper = forwardRef<HTMLDivElement, ChartWrapperProps>(function ChartWrapper({\n height = \"auto\",\n size,\n chart,\n categoryKind,\n categories,\n categoryAxis,\n sideways = false,\n axisTitle,\n className,\n children,\n \"aria-label\": ariaLabel,\n}, ref) {\n const container = useContext(ChartContainerContext);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const plotRef = useRef<HTMLDivElement | null>(null);\n const [legend, setLegend] = useState<HTMLDivElement | null>(null);\n const [live, setLive] = useState<HTMLDivElement | null>(null);\n const frame = useMemo<ChartFrame>(() => ({ legend, live }), [legend, live]);\n // The drawing never shrinks below the plot box's last real size. A box sized with `cqi` reports a width of 0 for a\n // moment while headless Chrome takes a full-page screenshot; handed to Recharts, that cleared the drawing, so the\n // screenshot showed an empty chart or bars growing again from zero (measured). A reading of 0 is no layout: the\n // drawing keeps its size, grows at once and shrinks a frame later.\n const [drawn, setDrawn] = useState<{ width: number; height: number } | null>(null);\n useLayoutEffect(() => {\n const plot = plotRef.current;\n if (!plot || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver((entries) => {\n const box = entries[entries.length - 1]?.contentRect;\n if (!box || box.width <= 0 || box.height <= 0) return;\n setDrawn((prev) => (prev && Math.abs(prev.width - box.width) < 0.5 && Math.abs(prev.height - box.height) < 0.5 ? prev : { width: box.width, height: box.height }));\n });\n observer.observe(plot);\n return () => observer.disconnect();\n }, []);\n\n const fill = container?.fillArea === true;\n const fixed = container?.height ?? fixedChartHeight(height);\n const plotStyle: CSSProperties = fill ? { flex: \"1 1 0%\", minHeight: 0 } : plotBoxStyle(size, fixed);\n\n // The graphic is named by the chart's own label, else by its container's title (A1).\n const named = ariaLabel\n ? { role: \"img\", \"aria-label\": ariaLabel }\n : container?.titleId\n ? { role: \"img\", \"aria-labelledby\": container.titleId }\n : {};\n\n // A8: how many category labels show, and how many were shortened, counted on the rendered ticks.\n useEffect(() => {\n const root = rootRef.current;\n const plot = plotRef.current;\n if (!root || !plot || !categoryAxis || typeof MutationObserver === \"undefined\") return;\n const selector = `.recharts-${categoryAxis}Axis-tick-labels .recharts-cartesian-axis-tick-value`;\n const count = () => {\n const labels = Array.from(plot.querySelectorAll(selector)).filter((el) => (el.textContent ?? \"\").trim() !== \"\");\n const shown = String(labels.length);\n const cut = String(labels.filter((el) => el.hasAttribute(\"data-cut\")).length);\n if (root.getAttribute(\"data-labels-shown\") !== shown) root.setAttribute(\"data-labels-shown\", shown);\n if (root.getAttribute(\"data-labels-cut\") !== cut) root.setAttribute(\"data-labels-cut\", cut);\n };\n count();\n const observer = new MutationObserver(count);\n observer.observe(plot, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: [\"data-cut\"] });\n return () => observer.disconnect();\n }, [categoryAxis]);\n\n return (\n <div\n ref={mergeRefs(ref as Ref<HTMLElement>, rootRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n data-gs-chart={chart}\n data-category-kind={categoryKind}\n data-categories={categories}\n className={cn(\"relative flex w-full flex-col\", fill && \"h-full\", className)}\n style={{ containerType: \"inline-size\", minInlineSize: \"min(100%, 16rem)\", ...(fill ? {} : { flex: \"1 0 auto\" }) }}\n >\n <div\n ref={plotRef}\n data-chart-plot=\"\"\n className=\"relative w-full\"\n style={plotStyle}\n onKeyDownCapture={sideways ? remapRowKeys : undefined}\n {...named}\n >\n {axisTitle && (\n <span data-chart-axis-title=\"\" className=\"absolute left-0 top-0 whitespace-nowrap text-xs text-[var(--ds-text-muted)] font-[family-name:var(--ds-font-sans)] leading-normal\">\n {axisTitle}\n </span>\n )}\n <div className=\"absolute inset-0\" style={drawn ? { minWidth: drawn.width, minHeight: drawn.height } : undefined}>\n <ChartFrameContext.Provider value={frame}>{children}</ChartFrameContext.Provider>\n </div>\n </div>\n <div ref={setLegend} data-chart-legend=\"\" />\n <div ref={setLive} role=\"status\" aria-live=\"polite\" className=\"sr-only\" />\n {/* the axis font and one row, as the page resolves them (useAxisMeasure reads it) */}\n <span\n data-chart-probe=\"\"\n aria-hidden=\"true\"\n className=\"pointer-events-none invisible absolute left-0 top-0\"\n style={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", height: CHART_ROW, width: 0 }}\n />\n </div>\n );\n});\n","import { useContext, useEffect, useLayoutEffect, useMemo, useState, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Legend, Text } from \"recharts\";\nimport { useResolvedToken } from \"../../lib/chart-utils\";\nimport { createAxisMeasurer, fitLabel, namesCutShort, type CategoryKind, type Measure } from \"../../lib/chart-categories\";\nimport { ChartFrameContext } from \"./ChartWrapper\";\n\ninterface TooltipEntry {\n name: string;\n value: number | string;\n color: string;\n dataKey?: string;\n payload?: Record<string, unknown>;\n}\n\ninterface ChartTooltipContentProps {\n active?: boolean;\n payload?: TooltipEntry[];\n label?: string;\n}\n\nconst hasLabel = (label: unknown) => label != null && label !== \"\" && typeof label !== \"number\";\n/**\n * A series' name. A chart without a category label (a pie's slice, a funnel's stage, a treemap's tile) names the item by\n * its row's `name`; on an axis chart the row's `name` is the category, already shown as the label, so the series keeps\n * its own (a row keyed by `name` read \"Alice: Alice 20\" instead of \"Alice: Hours 20\").\n */\nconst entryName = (entry: TooltipEntry, label: unknown) =>\n (!hasLabel(label) && typeof entry.payload?.name === \"string\" && entry.payload.name) || entry.name;\nconst entryValue = (entry: TooltipEntry) => (typeof entry.value === \"number\" ? entry.value.toLocaleString() : entry.value);\n\n/** What the live region says for the active point: its category, then each series' name and value. */\nexport function tooltipAnnouncement(label: unknown, payload: TooltipEntry[] | undefined): string {\n if (!payload?.length) return \"\";\n const values = payload.map((entry) => `${entryName(entry, label)} ${entryValue(entry)}`).join(\", \");\n return hasLabel(label) ? `${String(label)}: ${values}` : values;\n}\n\n/**\n * The chart's tooltip box. What it shows is also said in the chart's `role=\"status\"` `aria-live=\"polite\"` region, which\n * sits outside the drawing (a graphic's children are presentational) and starts empty, so the category and the values\n * are heard as the pointer or the arrow keys move (WCAG 4.1.3). Outside a library chart the region wraps the box.\n */\nexport function ChartTooltipContent({ active, payload, label }: ChartTooltipContentProps) {\n const bgSurface = useResolvedToken(\"--ds-bg-surface\");\n const borderSubtle = useResolvedToken(\"--ds-border-subtle\");\n const textPrimary = useResolvedToken(\"--ds-text-primary\");\n const textSecondary = useResolvedToken(\"--ds-text-secondary\");\n const { live } = useContext(ChartFrameContext);\n\n const on = !!active && !!payload?.length;\n const showLabel = hasLabel(label);\n\n const box = on ? (\n <div\n className=\"rounded-[var(--ds-radius-md)] shadow-[var(--ds-shadow-popover)] font-[family-name:var(--ds-font-sans)] text-sm\"\n style={{\n backgroundColor: bgSurface,\n border: `var(--ds-border-width) solid ${borderSubtle}`,\n padding: \"var(--ds-space-2) var(--ds-space-3)\",\n }}\n >\n {showLabel && (\n <p className=\"font-medium mb-ds-1\" style={{ color: textPrimary }}>\n {label}\n </p>\n )}\n {payload!.map((entry, i) => {\n const dotColor = (entry.payload?.fill as string) || entry.color || textSecondary;\n return (\n <div key={i} className=\"flex items-center gap-ds-2\" style={{ marginTop: i > 0 ? 2 : 0 }}>\n <span\n className=\"shrink-0 rounded-[var(--ds-radius-full)]\"\n style={{ width: 8, height: 8, backgroundColor: dotColor }}\n />\n <span style={{ color: textSecondary }}>{entryName(entry, label)}:</span>\n <span className=\"tabular-nums\" style={{ color: textPrimary }}>\n {entryValue(entry)}\n </span>\n </div>\n );\n })}\n </div>\n ) : null;\n\n if (live) {\n return (\n <>\n {box}\n {createPortal(on ? tooltipAnnouncement(label, payload) : \"\", live)}\n </>\n );\n }\n return (\n <div role=\"status\" aria-live=\"polite\">\n {box}\n </div>\n );\n}\n\ninterface ChartLegendContentProps {\n payload?: Array<{\n value: string;\n color: string;\n dataKey?: string;\n }>;\n}\n\n/** A legend entry's outline: the series' stroke when it has one (a soft bar's solid edge, a line), else its colour. */\nfunction swatchEdge(entry: { color?: string; payload?: unknown }): string | undefined {\n const stroke = (entry.payload as { stroke?: unknown } | undefined)?.stroke;\n return typeof stroke === \"string\" ? stroke : entry.color;\n}\n\nexport function ChartLegendContent({ payload }: ChartLegendContentProps) {\n const textSecondary = useResolvedToken(\"--ds-text-secondary\");\n\n if (!payload?.length) return null;\n\n return (\n <div className=\"flex flex-wrap justify-center gap-y-ds-1 gap-x-ds-4 font-[family-name:var(--ds-font-sans)] text-sm\">\n {payload.map((entry, i) => (\n <div key={i} className=\"flex items-center gap-ds-1.5\">\n <span\n className=\"shrink-0 rounded-[var(--ds-radius-full)]\"\n // the series' own fill inside its outline (a soft bar's solid stroke), so a 30% tint stays visible (C4)\n style={{ width: 10, height: 10, backgroundColor: entry.color, border: `1.5px solid ${swatchEdge(entry)}` }}\n />\n <span style={{ color: textSecondary }}>{entry.value}</span>\n </div>\n ))}\n </div>\n );\n}\n\n/** Legend items in the order the chart draws its series: by dataKey (bars, lines, areas, radars) or by name (a pie's slices). */\nexport function seriesSorter(order: ReadonlyArray<string>, by: \"dataKey\" | \"value\" = \"dataKey\") {\n return (item: { dataKey?: unknown; value?: unknown }) => {\n const key = by === \"dataKey\" ? item.dataKey : item.value;\n const i = order.indexOf(String(key));\n return i < 0 ? order.length : i;\n };\n}\n\n/**\n * Sprint 25.9, A2: the chart's legend is Recharts' own Legend portalled into the slot below the drawing, so it no longer\n * takes its height from the plot. It keeps ChartLegendContent and its swatch, and follows the series' order, not the\n * alphabet (Recharts' default `itemSorter: \"value\"`). Rendered once the slot exists, so it never lands in the drawing.\n */\nexport function ChartLegend({ order, by = \"dataKey\" }: { order: ReadonlyArray<string>; by?: \"dataKey\" | \"value\" }) {\n const { legend } = useContext(ChartFrameContext);\n const orderKey = order.join(\"\\u0001\");\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the order is compared by value\n const sorter = useMemo(() => seriesSorter(order, by), [orderKey, by]);\n if (!legend) return null;\n return <Legend portal={legend} content={<ChartLegendContent />} itemSorter={sorter} wrapperStyle={{ paddingTop: \"var(--ds-space-3)\" }} />;\n}\n\nexport function useGridStroke(): string {\n return useResolvedToken(\"--ds-border-subtle\");\n}\n\nexport function useAxisStyle() {\n const textMuted = useResolvedToken(\"--ds-text-muted\");\n\n return {\n tick: {\n fontSize: \"var(--ds-font-size-xs)\",\n fontFamily: \"var(--ds-font-sans)\",\n fill: textMuted,\n // Sprint 25.9: Recharts paints a default tick's text with the axis stroke (#666 unless set), not with fill, so the\n // value axes drew their numbers at about 2.6:1 on dark cards (WCAG 1.4.3 asks 4.5:1). Every axis that spreads this\n // hides its axis and tick lines, so the stroke only colours the text.\n stroke: textMuted,\n },\n };\n}\n\nexport function useRadius(): number {\n const val = useResolvedToken(\"--ds-radius-md\");\n const parsed = parseInt(val, 10);\n return isNaN(parsed) ? 6 : parsed;\n}\n/**\n * Recharts' `tick` prop as an object only passes SVG-valid properties.\n * Props like `maxLines`, `verticalAnchor` are stripped. We must use a\n * function to pass them to the internal Text component.\n */\nexport function xAxisTick(props: Record<string, unknown>) {\n // No width box (Sprint 25.3 C12): with one, Recharts measured \"20 Aug\" in a hidden span that did not carry the\n // chart's font, judged it too wide for its share of the axis and wrapped or truncated it. Without a width Text never\n // wraps or truncates; `interval` (preserveStartEnd) thins colliding ticks and keeps the first and last. Recharts' own\n // Text keeps the axis's auto height right, which a bare <text> does not (the label was clipped 8px in the pass).\n // Scale axes (dates, numbers) keep this tick; a names axis takes namesTick.\n const { x, y, payload, width: _width, visibleTicksCount: _count, ...rest } = props as {\n x: number; y: number; payload: { value: string };\n width?: number; visibleTicksCount?: number; [k: string]: unknown;\n };\n return (\n <Text {...rest} x={x} y={y} textAnchor=\"middle\" verticalAnchor=\"start\">\n {payload.value}\n </Text>\n );\n}\n\nexport function yAxisTick(props: Record<string, unknown>) {\n const { x, y, payload, ...rest } = props as { x: number; y: number; payload: { value: string };[k: string]: unknown };\n return (\n <Text {...rest} x={x} y={y} textAnchor=\"end\" verticalAnchor=\"middle\" width={200} maxLines={2}>\n {payload.value}\n </Text>\n );\n}\n\n/* ── Names on a category axis (Sprint 25.9, A3) ─────────────────────────── */\n\n/** The line height of a two-line name, in em. */\nconst LINE_EM = 1.2;\n/** The least space between two names under an upright chart. */\nexport const NAME_GAP = 8;\n/**\n * A sideways name's inset from its column: Recharts draws it tickSize + tickMargin (8 px) left of the axis edge, and\n * the chart's own margin leaves 4 px on the left.\n */\nexport const NAME_COLUMN_INSET = 12;\n\n/**\n * The tick for a names axis: each name fitted to its band — one line; else two lines split at a space; else \"…\" on\n * the second — inside one `<g className={props.className}>`, so Recharts sizes the axis for both lines (two Texts each\n * carrying the tick's class leave the axis sized for one, and the second line clipped). The full name is the label's\n * `<title>`. Upright, the band is the axis width over the ticks it draws; sideways it is the name column the chart sets.\n * Without a measurer (no canvas) every name shows in full on one line.\n */\nexport function namesTick(measure: Measure | null, orientation: \"x\" | \"y\", column?: number) {\n return function NamesTick(props: Record<string, unknown>) {\n const { x, y, payload, width, visibleTicksCount, className, fill, fontSize, fontFamily } = props as {\n x: number; y: number; payload?: { value?: unknown }; width?: number; visibleTicksCount?: number;\n className?: string; fill?: string; fontSize?: string | number; fontFamily?: string;\n };\n const name = String(payload?.value ?? \"\");\n const room = orientation === \"x\"\n ? (Number(width) || 0) / Math.max(1, Number(visibleTicksCount) || 1) - NAME_GAP\n : (column ?? (Number(width) || 0)) - NAME_COLUMN_INSET;\n const fit = fitLabel(name, room, measure);\n const text = { fill, fontSize, fontFamily, stroke: \"none\" };\n // upright: the first line's top at y (Recharts' verticalAnchor \"start\"); sideways: the lines centred on the row\n const firstDy = orientation === \"x\" ? 0.71 : 0.355 - ((fit.lines.length - 1) * LINE_EM) / 2;\n return (\n <g className={className} data-cut={fit.cut ? \"\" : undefined} data-lines={fit.lines.length}>\n <title>{name}</title>\n {fit.lines.map((line, i) => (\n <text key={i} x={x} y={y} dy={`${firstDy + i * LINE_EM}em`} textAnchor={orientation === \"x\" ? \"middle\" : \"end\"} {...text}>\n {line}\n </text>\n ))}\n </g>\n );\n };\n}\n\nexport type XAxisInterval = number | \"preserveStart\" | \"preserveEnd\" | \"preserveStartEnd\" | \"equidistantPreserveStart\";\n\nexport interface AxisMeasure {\n /** Text widths in the axis's resolved font, or null (no canvas: jsdom). */\n measure: Measure | null;\n /** The resolved axis font size, px. */\n px: number;\n /** One row of a row chart, px (--ds-chart-row as the page resolves it). */\n rowPx: number;\n /** The chart wrapper's width, px. */\n width: number;\n}\n\ntype FontSet = { ready: Promise<unknown>; addEventListener?: (t: string, f: () => void) => void; removeEventListener?: (t: string, f: () => void) => void };\n\n/**\n * The chart's measurer: the axis font read from the wrapper's probe (so `calc()` font tokens measure right), and the\n * wrapper's width. Re-read when the wrapper resizes and when web fonts land (the same font string then measures\n * differently, so the cache starts again).\n */\nexport function useAxisMeasure(ref: RefObject<HTMLDivElement | null>, enabled = true): AxisMeasure {\n const [state, setState] = useState<AxisMeasure>({ measure: null, px: 12, rowPx: 32, width: 0 });\n useLayoutEffect(() => {\n const el = ref.current;\n if (!enabled || !el) return;\n let live = true;\n let font = \"\";\n const update = (fresh = false) => {\n if (!live) return;\n const measured = el.clientWidth;\n const probe = el.querySelector<HTMLElement>(\"[data-chart-probe]\");\n const row = probe?.getBoundingClientRect().height ?? 0;\n const next = createAxisMeasurer(el);\n setState((prev) => {\n // no width is no layout (a hidden tab, or the moment headless Chrome takes a full-page screenshot): keep the last\n const width = measured > 0 ? measured : prev.width;\n const rowPx = row > 0 ? row : prev.rowPx;\n if (!next) return prev.width === width ? prev : { ...prev, width };\n if (!fresh && next.font === font && prev.measure && prev.width === width && prev.rowPx === rowPx) return prev;\n const keep = !fresh && next.font === font && prev.measure;\n font = next.font;\n return { measure: keep ? prev.measure : next.measure, px: next.px, rowPx, width };\n });\n };\n update(true);\n const ro = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(() => update()) : null;\n ro?.observe(el);\n const fonts = (typeof document !== \"undefined\" ? (document as Document & { fonts?: FontSet }).fonts : undefined);\n const landed = () => update(true);\n fonts?.ready.then(landed, () => {});\n fonts?.addEventListener?.(\"loadingdone\", landed);\n return () => {\n live = false;\n ro?.disconnect();\n fonts?.removeEventListener?.(\"loadingdone\", landed);\n };\n }, [ref, enabled]);\n return state;\n}\n\n/** The value axis's width on an upright chart, estimated from its widest tick label (Recharts rounds the top up). */\nexport function valueAxisWidth(values: number[], measure: Measure): number {\n const finite = values.filter(Number.isFinite);\n const max = finite.length ? Math.max(...finite.map(Math.abs)) : 0;\n const magnitude = max > 0 ? 10 ** Math.floor(Math.log10(max)) : 1;\n const top = Math.ceil(max / magnitude) * magnitude;\n const negative = finite.some((v) => v < 0) ? \"-\" : \"\";\n return Math.ceil(measure(`${negative}${top}`)) + 8;\n}\n\n/** How far the switch looks back before turning an automatic sideways chart upright again (no flip at the boundary). */\nconst SWITCH_HYSTERESIS = 32;\n\n/**\n * D8: an upright chart of names turns sideways when a name would be cut to fewer than six characters at the chart's\n * width, and back when there's room: it turns upright again only once names would also fit a little narrower, so a\n * scrollbar appearing does not flip it back. The last decision is kept as state (information from the previous render).\n */\nexport function useSidewaysSwitch(enabled: boolean, names: string[], m: AxisMeasure, axisWidth: number, sideMargins: number): boolean {\n const [turned, setTurned] = useState(false);\n const key = names.join(\"\\u0001\");\n const cut = useMemo(() => {\n if (!enabled || !m.measure || m.width <= 0 || names.length === 0) return { here: false, narrower: false };\n const cutAt = (width: number) => namesCutShort(names, (width - sideMargins - axisWidth) / names.length - NAME_GAP, m.measure!);\n return { here: cutAt(m.width), narrower: cutAt(m.width - SWITCH_HYSTERESIS) };\n // names are compared by value\n }, [enabled, key, m.measure, m.width, axisWidth, sideMargins]); // eslint-disable-line react-hooks/exhaustive-deps\n // sideways as soon as names are cut short here; upright only when they fit here and a little narrower (no flip-flop)\n const decision = turned ? cut.here || cut.narrower : cut.here;\n if (decision !== turned) setTurned(decision);\n return decision;\n}\n\n/** A sideways chart's name column: its widest name, at most a third of the chart's width. */\nexport function nameColumn(names: string[], m: AxisMeasure): number | undefined {\n if (!m.measure || m.width <= 0) return undefined;\n const widest = names.reduce((w, n) => Math.max(w, m.measure!(n.replace(/\\s+/g, \" \").trim())), 0);\n return Math.max(24, Math.min(Math.ceil(widest) + NAME_COLUMN_INSET, Math.floor(m.width / 3)));\n}\n\n/** How many names take two lines in a name column (each makes its row one line taller). */\nexport function twoLineNames(names: string[], column: number | undefined, m: AxisMeasure): number {\n if (!m.measure || column === undefined) return 0;\n return names.filter((n) => fitLabel(n, column - NAME_COLUMN_INSET, m.measure).lines.length > 1).length;\n}\n\n/** The widest label in the chart's own axis font (canvas measureText), or null where there is no canvas (jsdom). */\nfunction widestLabel(el: HTMLElement, labels: string[]): number | null {\n const measurer = createAxisMeasurer(el);\n if (!measurer) return null;\n return labels.reduce((w, l) => Math.max(w, measurer.measure(l)), 0);\n}\n\nconst TICK_GAP = 12; // the least space between two labels\nconst AXIS_RESERVE = 48; // the y-axis column and the chart's side margins\n\n/**\n * Sprint 25.4 C-11 (decision 7): the category ticks a chart shows. Recharts' preserveStartEnd thins colliding ticks\n * by its own measurement (without the chart's font) and keeps the last tick, so the labels fall unevenly (round 5:\n * 14 and 15 September missing). The chart measures its widest label with the resolved axis font, picks the step\n * that fits the axis width, and labels every step from the first category — the last only when it falls on the step.\n * Re-measured when the wrapper resizes and when the web fonts land. A numeric `override` (the chart's xAxisInterval\n * prop) is every Nth category and skips the measurement; the Recharts strings are treated as \"measured\" (round 13).\n *\n * Sprint 25.9, A3: this thinning is for dates and numbers only. A names axis (`kind` \"names\") is never thinned: every\n * name from the first render (interval 0, no explicit ticks, so duplicate names keep their own bands), each fitted to\n * its band by namesTick. The font is the axis font as the page resolves it (a probe), so `calc()` tokens measure right.\n */\nexport function useCategoryTicks(\n data: ReadonlyArray<Record<string, unknown>> | undefined,\n xAxisKey: string,\n ref: RefObject<HTMLDivElement | null>,\n override?: XAxisInterval,\n kind: CategoryKind = \"scale\",\n): { ticks?: string[]; interval: XAxisInterval; endMargin: number } {\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const labelsKey = labels.join(\"\\u0001\");\n const [ticks, setTicks] = useState<string[] | undefined>(undefined);\n // Half the widest label: the chart's right margin, so the last label (centred on the last point) is not clipped.\n const [endMargin, setEndMargin] = useState(4);\n // Only a number is an override (every Nth category). The Recharts strings — \"preserveStartEnd\" and friends — are the\n // thinning this hook replaced (round 13: a builder passed the old default by name and got uneven labels again), so\n // they mean \"measured\" too.\n const numeric = typeof override === \"number\" ? override : undefined;\n const names = kind === \"names\";\n useEffect(() => {\n const el = ref.current;\n if (names || numeric !== undefined || !el || labels.length === 0) return;\n let live = true;\n const compute = () => {\n if (!live) return;\n // no width is no layout (a hidden tab, or the moment headless Chrome takes a full-page screenshot): keep the last\n if (el.clientWidth <= 0) return;\n const widest = widestLabel(el, labels);\n const plot = el.clientWidth - AXIS_RESERVE;\n if (widest == null || plot <= 0) { setTicks(undefined); return; }\n setEndMargin(Math.max(4, Math.ceil(widest / 2)));\n const fits = Math.max(1, Math.floor(plot / (widest + TICK_GAP)));\n const step = Math.ceil(labels.length / fits);\n // every k-th label from the first, explicitly — an explicit list keeps Recharts from thinning on its own\n // measurement even when every label fits (round 5: \"16 Sep\" dropped at full width)\n setTicks(labels.filter((_, i) => i % step === 0));\n };\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(compute);\n ro.observe(el);\n const fonts = (document as Document & { fonts?: { ready: Promise<unknown> } }).fonts;\n fonts?.ready.then(compute, () => {});\n return () => { live = false; ro.disconnect(); };\n // labels are compared by value\n }, [labelsKey, numeric, names, ref]); // eslint-disable-line react-hooks/exhaustive-deps\n if (names) return { interval: 0, endMargin: 4 };\n if (numeric !== undefined) return { interval: numeric, endMargin: 4 };\n return ticks ? { ticks, interval: 0, endMargin } : { interval: \"preserveStartEnd\", endMargin: 4 };\n}\n","import { forwardRef, useMemo, useRef, type Ref } from \"react\";\nimport {\n BarChart as RechartsBarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Rectangle,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { categoryKind as guessCategoryKind } from \"../../lib/chart-categories\";\nimport {\n ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useRadius, xAxisTick, namesTick, useCategoryTicks,\n useAxisMeasure, useSidewaysSwitch, valueAxisWidth, nameColumn, twoLineNames, type XAxisInterval,\n} from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, CHART_ROW, markChart } from \"./ChartWrapper\";\n\nexport interface BarDef {\n dataKey: string;\n label?: string;\n soft?: boolean;\n /**\n * Bars with the same stackId stack into one column (Sprint 25.7, C4); a bar without one stands alone. BarChart's\n * `stacked` puts every bar without a stackId into one stack. The same field works in CompositeChart, where lines\n * draw over the stacks.\n */\n stackId?: string;\n}\n\n/** The stack a bar joins: its own stackId, else the one `stacked` makes for every bar. */\nexport function barStackOf(bar: BarDef, stacked: boolean): string | undefined {\n return bar.stackId ?? (stacked ? \"stack\" : undefined);\n}\n\n/** Some bar stacks. Its chart then stacks both ways from zero (stackOffset \"sign\"), so a negative series sits below it. */\nexport function anyStack(bars: BarDef[], stacked: boolean): boolean {\n return bars.some((bar) => barStackOf(bar, stacked) != null);\n}\n\n/** How many bars stand side by side in one category: one per stack, one per bar on its own. */\nexport function barGroups(bars: BarDef[], stacked: boolean): number {\n return Math.max(1, new Set(bars.map((bar, i) => barStackOf(bar, stacked) ?? `\\u0000${i}`)).size);\n}\n\n/**\n * The bar's shape: only the end segment of each stack is rounded, per column and per side of zero — the top of the\n * positive side, the bottom of the negative one — so a stack whose last series is zero in a column rounds the segment\n * that ends it there. A bar on its own rounds its end.\n */\nexport function barShape(bars: BarDef[], index: number, stacked: boolean, radius: number, horizontal = false) {\n const round: [number, number, number, number] = horizontal ? [0, radius, radius, 0] : [radius, radius, 0, 0];\n const square: [number, number, number, number] = [0, 0, 0, 0];\n const stack = barStackOf(bars[index], stacked);\n const above = stack == null ? [] : bars.filter((b, j) => j > index && barStackOf(b, stacked) === stack);\n // Recharts hands the shape the bar's geometry and its row of data; it draws a negative bar's rounded corners at its\n // far end itself\n const Shape = (props: unknown) => {\n const p = props as { payload?: Record<string, unknown> };\n const row = p.payload ?? {};\n const down = Number(row[bars[index].dataKey]) < 0;\n const onTop = above.every((b) => {\n const value = Number(row[b.dataKey]);\n return !(down ? value < 0 : value > 0);\n });\n return <Rectangle {...(props as object)} radius={onTop ? round : square} />;\n };\n return Shape;\n}\n\n/** The values the value axis must reach: each bar on its own, and each stack's total per category. */\nfunction valueExtent(data: Record<string, unknown>[], bars: BarDef[], stacked: boolean): number[] {\n return data.flatMap((row) => {\n const own: number[] = [];\n const stacks = new Map<string, number>();\n for (const bar of bars) {\n const v = Number(row[bar.dataKey]);\n if (!Number.isFinite(v)) continue;\n const stack = barStackOf(bar, stacked);\n if (stack == null) own.push(v);\n else stacks.set(stack, (stacks.get(stack) ?? 0) + v);\n }\n return [...own, ...stacks.values()];\n });\n}\n\n/** A title line's height, px, in the axis font. */\nconst titleLine = (px: number) => Math.ceil(px * 1.5) + 4;\n/** The same in CSS, for a row chart's height. */\nconst TITLE_LINE_CSS = \"calc(1.5 * var(--ds-font-size-xs) + 4px)\";\n\nexport interface BarChartProps {\n /**\n * Which category ticks show on an axis of dates or numbers. Leave it out: the chart measures its widest label with\n * the chart's font and labels every k-th category from the first, the last only when it falls on the step (Sprint\n * 25.4 C-11, decision 7). A number labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are\n * accepted for compatibility and mean the same measured labelling (round 13). A names axis is never thinned.\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n bars: BarDef[];\n xAxisKey: string;\n /**\n * \"auto\" (the default): the chart sizes itself — sideways, a row per category; upright, two wide to one high. A\n * preset or a number overrides it; inside a ChartContainer, the container's own height wins.\n */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n /** Every bar without a stackId joins one stack. */\n stacked?: boolean;\n /**\n * Bars running sideways, one row per category. Leave it out: an upright chart of names turns itself sideways when a\n * name would be cut to fewer than six characters, and back when there's room (D8). true or false forces either.\n */\n horizontal?: boolean;\n /**\n * What the categories are. \"names\" are never skipped: each wraps onto two lines, then ends with \"…\", with the full\n * name on hover. \"scale\" (dates, times, numbers) is labelled at an even step. Leave it out: guessed from the labels.\n */\n categoryKind?: \"names\" | \"scale\";\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /** The category axis's title, as drawn upright (below it). A sideways chart puts the category title above its names. */\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const BarChart = markChart(forwardRef<HTMLDivElement, BarChartProps>(function BarChart({\n data,\n bars,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n horizontal,\n categoryKind,\n showGrid = true,\n showTooltip = true,\n showLegend,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const kind = categoryKind ?? guessCategoryKind((data ?? []).map((d) => d[xAxisKey]));\n const names = kind === \"names\";\n const measured = useAxisMeasure(wrapperRef, (data?.length ?? 0) > 0);\n const axisWidth = useMemo(\n () => (measured.measure ? valueAxisWidth(valueExtent(data ?? [], bars, stacked), measured.measure) : 0),\n [measured.measure, data, bars, stacked],\n );\n const turned = useSidewaysSwitch(horizontal === undefined && names, labels, measured, axisWidth, 8);\n const sideways = horizontal ?? turned;\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, sideways || names ? \"names\" : \"scale\");\n const column = sideways ? nameColumn(labels, measured) : undefined;\n const upright = useMemo(() => namesTick(measured.measure, \"x\"), [measured.measure]);\n const rows = useMemo(() => namesTick(measured.measure, \"y\", column), [measured.measure, column]);\n const solidColors = useChartColors(bars.length, false);\n const softColors = useChartColors(bars.length, true);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n const legendVisible = showLegend ?? bars.length >= 2;\n\n // Axis titles follow their data: a chart that turned itself sideways moves the value title under the value axis and\n // the category title above the names. Every title is horizontal (Analysis Function; data_visualisation#22).\n const valueTitle = horizontal === true ? xAxisLabel : yAxisLabel;\n const categoryTitle = horizontal === true ? yAxisLabel : xAxisLabel;\n const topTitle = sideways ? categoryTitle : valueTitle;\n const bottomTitle = sideways ? valueTitle : categoryTitle;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const bottomLabel = bottomTitle ? { value: bottomTitle, position: \"insideBottom\" as const, offset: -2, style: axisLabelStyle } : undefined;\n\n const groups = barGroups(bars, stacked);\n const perCategory = 1 + 0.5 * (groups - 1);\n const titles = [topTitle, bottomTitle].filter(Boolean).length;\n const size = sideways\n ? {\n model: \"rows\" as const,\n units: labels.length * perCategory,\n lines: twoLineNames(labels, column, measured),\n axis: titles ? `calc(${CHART_ROW} + ${titles} * ${TITLE_LINE_CSS})` : CHART_ROW,\n }\n : { model: \"ratio\" as const };\n // bars keep their thickness when the chart grows in a row: the rows spread instead\n const maxBarSize = sideways ? Math.max(4, Math.round((measured.rowPx * perCategory * 0.7) / groups)) : undefined;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={size}\n chart=\"bar\"\n categoryKind={kind}\n categories={data.length}\n categoryAxis={sideways ? \"y\" : \"x\"}\n sideways={sideways}\n axisTitle={topTitle}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsBarChart\n data={data}\n layout={sideways ? \"vertical\" : \"horizontal\"}\n stackOffset={anyStack(bars, stacked) ? \"sign\" : undefined}\n // names are fitted to their bands, so nothing hangs past the last bar: 4 px, not a margin sized from them\n margin={{ top: 4 + (topTitle ? titleLine(measured.px) : 0), right: sideways || names ? 4 : xTicks.endMargin, bottom: 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && (\n <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} vertical={!sideways} horizontal />\n )}\n {sideways ? (\n <>\n <XAxis type=\"number\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" label={bottomLabel} />\n <YAxis\n dataKey={xAxisKey}\n type=\"category\"\n width={column ?? \"auto\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n interval={0}\n tick={rows}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={names ? upright : xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={bottomLabel}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n </>\n )}\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={{ fill: \"var(--ds-bg-muted)\", opacity: 0.5 }} />}\n {legendVisible && <ChartLegend order={bars.map((b) => b.dataKey)} />}\n {bars.map((bar, i) => (\n <Bar\n key={bar.dataKey}\n dataKey={bar.dataKey}\n name={bar.label ?? bar.dataKey}\n fill={bar.soft ? softColors[i] : solidColors[i]}\n // a soft fill is a 30% tint: the solid outline keeps the bar's edge at the colour's own contrast (WCAG 1.4.11)\n stroke={bar.soft ? solidColors[i] : undefined}\n strokeWidth={bar.soft ? 1 : undefined}\n shape={barShape(bars, i, stacked, radius, sideways)}\n stackId={barStackOf(bar, stacked)}\n maxBarSize={maxBarSize}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsBarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useRef, type Ref } from \"react\";\nimport {\n LineChart as RechartsLineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, xAxisTick, useCategoryTicks, useAxisMeasure, type XAxisInterval } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface LineDef {\n dataKey: string;\n label?: string;\n dashed?: boolean;\n}\n\nexport interface LineChartProps {\n /**\n * Which category ticks show. Leave it out: the chart measures its widest label with the chart's font and labels every\n * k-th category from the first, the last only when it falls on the step (Sprint 25.4 C-11, decision 7). A number\n * labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are accepted for compatibility and\n * mean the same measured labelling — they never hand the ticks back to Recharts' thinning (round 13).\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n lines: LineDef[];\n xAxisKey: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n curved?: boolean;\n showDots?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const LineChart = markChart(forwardRef<HTMLDivElement, LineChartProps>(function LineChart({\n data,\n lines,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n curved = true,\n showDots = false,\n showGrid = true,\n showTooltip = true,\n showLegend,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n // a line runs over a scale (dates, times, numbers): its labels are thinned at an even step, never fitted as names\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, \"scale\");\n const measured = useAxisMeasure(wrapperRef, !!yAxisLabel && (data?.length ?? 0) > 0);\n const colors = useChartColors(lines.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? lines.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const top = 4 + (yAxisLabel ? Math.ceil(measured.px * 1.5) + 4 : 0);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"line\"\n categoryKind=\"scale\"\n categories={data.length}\n categoryAxis=\"x\"\n axisTitle={yAxisLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsLineChart data={data} margin={{ top, right: xTicks.endMargin, bottom: 4, left: 4 }} accessibilityLayer>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={xAxisLabel ? { value: xAxisLabel, position: \"insideBottom\", offset: -2, style: axisLabelStyle } : undefined}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={lines.map((l) => l.dataKey)} />}\n {lines.map((line, i) => (\n <Line\n key={line.dataKey}\n type={curved ? \"monotone\" : \"linear\"}\n dataKey={line.dataKey}\n name={line.label ?? line.dataKey}\n stroke={colors[i]}\n strokeWidth={2}\n strokeDasharray={line.dashed ? \"5 5\" : undefined}\n dot={showDots}\n activeDot={{ r: 5, strokeWidth: 2 }}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsLineChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useId, useRef, type Ref } from \"react\";\nimport {\n AreaChart as RechartsAreaChart,\n Area,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, xAxisTick, useCategoryTicks, useAxisMeasure, type XAxisInterval } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface AreaDef {\n dataKey: string;\n label?: string;\n}\n\nexport interface AreaChartProps {\n /**\n * Which category ticks show. Leave it out: the chart measures its widest label with the chart's font and labels every\n * k-th category from the first, the last only when it falls on the step (Sprint 25.4 C-11, decision 7). A number\n * labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are accepted for compatibility and\n * mean the same measured labelling — they never hand the ticks back to Recharts' thinning (round 13).\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n areas: AreaDef[];\n xAxisKey: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n stacked?: boolean;\n curved?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n gradient?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const AreaChart = markChart(forwardRef<HTMLDivElement, AreaChartProps>(function AreaChart({\n data,\n areas,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n curved = true,\n showGrid = true,\n showTooltip = true,\n showLegend,\n gradient = true,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n // an area runs over a scale (dates, times, numbers): its labels are thinned at an even step, never fitted as names\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, \"scale\");\n const measured = useAxisMeasure(wrapperRef, !!yAxisLabel && (data?.length ?? 0) > 0);\n const instanceId = useId();\n const solidColors = useChartColors(areas.length, false);\n const softColors = useChartColors(areas.length, true);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? areas.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const top = 4 + (yAxisLabel ? Math.ceil(measured.px * 1.5) + 4 : 0);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"area\"\n categoryKind=\"scale\"\n categories={data.length}\n categoryAxis=\"x\"\n axisTitle={yAxisLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsAreaChart data={data} margin={{ top, right: xTicks.endMargin, bottom: 4, left: 4 }} accessibilityLayer>\n <defs>\n {areas.map((area, i) => (\n <linearGradient key={area.dataKey} id={`gradient-${instanceId}-${area.dataKey}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={softColors[i]} stopOpacity={1} />\n <stop offset=\"95%\" stopColor={softColors[i]} stopOpacity={0.1} />\n </linearGradient>\n ))}\n </defs>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={xAxisLabel ? { value: xAxisLabel, position: \"insideBottom\", offset: -2, style: axisLabelStyle } : undefined}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={areas.map((a) => a.dataKey)} />}\n {areas.map((area, i) => (\n <Area\n key={area.dataKey}\n type={curved ? \"monotone\" : \"linear\"}\n dataKey={area.dataKey}\n name={area.label ?? area.dataKey}\n stroke={solidColors[i]}\n strokeWidth={2}\n fill={gradient ? `url(#gradient-${instanceId}-${area.dataKey})` : softColors[i]}\n stackId={stacked ? \"stack\" : undefined}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsAreaChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n PieChart as RechartsPieChart,\n Pie,\n Cell,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface PieChartProps {\n data: { name: string; value: number; [key: string]: unknown }[];\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n donut?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n showLabels?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const PieChart = markChart(forwardRef<HTMLDivElement, PieChartProps>(function PieChart({\n data,\n height = \"auto\",\n donut = false,\n showTooltip = true,\n showLegend = true,\n showLabels = false,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const renderLabel = showLabels\n ? ({ percent }: { percent?: number }) => `${((percent ?? 0) * 100).toFixed(0)}%`\n : false;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"pie\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart accessibilityLayer>\n <Pie\n data={data}\n dataKey=\"value\"\n nameKey=\"name\"\n cx=\"50%\"\n cy=\"50%\"\n outerRadius=\"75%\"\n innerRadius={donut ? \"55%\" : 0}\n label={renderLabel}\n labelLine={showLabels}\n isAnimationActive={isAnimated}\n fontSize=\"var(--ds-font-size-xs)\"\n fontFamily=\"var(--ds-font-sans)\"\n >\n {data.map((_, i) => (\n <Cell key={i} fill={colors[i % colors.length]} />\n ))}\n </Pie>\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={data.map((d) => d.name)} by=\"value\" />}\n </RechartsPieChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useMemo, useRef, type Ref } from \"react\";\nimport {\n ComposedChart,\n Bar,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { categoryKind as guessCategoryKind } from \"../../lib/chart-categories\";\nimport {\n ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useRadius, xAxisTick, namesTick, useCategoryTicks,\n useAxisMeasure, useSidewaysSwitch, valueAxisWidth, nameColumn, twoLineNames, type XAxisInterval,\n} from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, CHART_ROW, markChart } from \"./ChartWrapper\";\nimport { anyStack, barGroups, barShape, barStackOf, type BarDef } from \"./BarChart\";\nimport type { LineDef } from \"./LineChart\";\n\nexport interface CompositeChartProps {\n /**\n * Which category ticks show on an axis of dates or numbers. Leave it out: the chart measures its widest label with\n * the chart's font and labels every k-th category from the first, the last only when it falls on the step (Sprint\n * 25.4 C-11, decision 7). A number labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are\n * accepted for compatibility and mean the same measured labelling (round 13). A names axis is never thinned.\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n bars: BarDef[];\n lines: LineDef[];\n xAxisKey: string;\n /**\n * \"auto\" (the default): two wide to one high; sideways, a row per category. A preset or a number overrides it; a\n * ChartContainer's own height wins.\n */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n /** Every bar without a stackId joins one stack; lines draw over it (Sprint 25.7, C4). A bar's stackId works too. */\n stacked?: boolean;\n /**\n * The lines on a second axis of their own, on the right, for a line whose unit differs from the bars'. Default: true\n * for bars side by side, false once the bars stack (`stacked` or a bar's stackId), so a capacity or a target line\n * reads against the stack's own scale. An explicit value wins.\n */\n dualAxis?: boolean;\n /**\n * What the categories are. \"names\" are never skipped: each wraps onto two lines, then ends with \"…\", with the full\n * name on hover. \"scale\" (dates, times, numbers) is labelled at an even step. Leave it out: guessed from the labels.\n */\n categoryKind?: \"names\" | \"scale\";\n /**\n * Bars running sideways, one row per category, with the lines crossing the rows. Leave it out: a chart of names turns\n * itself sideways when a name would be cut to fewer than six characters, and back when there's room (D8). true or\n * false forces either.\n */\n horizontal?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const CompositeChart = markChart(forwardRef<HTMLDivElement, CompositeChartProps>(function CompositeChart({\n data,\n bars,\n lines,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n dualAxis = !anyStack(bars, stacked),\n categoryKind,\n horizontal,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const kind = categoryKind ?? guessCategoryKind((data ?? []).map((d) => d[xAxisKey]));\n const names = kind === \"names\";\n const measured = useAxisMeasure(wrapperRef, (data?.length ?? 0) > 0);\n // the bars' axis sets the left column's width; with a second axis the lines' ticks take the right edge\n const axisWidth = useMemo(() => {\n if (!measured.measure) return 0;\n const values = (data ?? []).flatMap((row) => {\n const stacks = new Map<string, number>();\n const own: number[] = [];\n for (const bar of bars) {\n const v = Number(row[bar.dataKey]);\n if (!Number.isFinite(v)) continue;\n const stack = barStackOf(bar, stacked);\n if (stack == null) own.push(v); else stacks.set(stack, (stacks.get(stack) ?? 0) + v);\n }\n return [...own, ...stacks.values(), ...(dualAxis ? [] : lines.map((l) => Number(row[l.dataKey])))];\n });\n const lineValues = (data ?? []).flatMap((row) => lines.map((l) => Number(row[l.dataKey])));\n return valueAxisWidth(values, measured.measure) + (dualAxis ? valueAxisWidth(lineValues, measured.measure) : 0);\n }, [measured.measure, data, bars, lines, stacked, dualAxis]);\n const turned = useSidewaysSwitch(horizontal === undefined && names, labels, measured, axisWidth, 8);\n const sideways = horizontal ?? turned;\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, sideways ? \"names\" : kind);\n const column = sideways ? nameColumn(labels, measured) : undefined;\n const tick = useMemo(() => (names ? namesTick(measured.measure, \"x\") : xAxisTick), [names, measured.measure]);\n const rows = useMemo(() => namesTick(measured.measure, \"y\", column), [measured.measure, column]);\n const barSoftColors = useChartColors(bars.length, true);\n const barSolidColors = useChartColors(bars.length, false);\n const lineColors = useChartColors(lines.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n // axis titles follow their data: sideways, the value title goes under the value axis, the category title above the names\n const topTitle = sideways ? xAxisLabel : yAxisLabel;\n const bottomTitle = sideways ? yAxisLabel : xAxisLabel;\n const bottomLabel = bottomTitle ? { value: bottomTitle, position: \"insideBottom\" as const, offset: -2, style: axisLabelStyle } : undefined;\n const top = 4 + (topTitle ? Math.ceil(measured.px * 1.5) + 4 : 0);\n const groups = barGroups(bars, stacked);\n const perCategory = 1 + 0.5 * (groups - 1);\n const titles = [topTitle, bottomTitle].filter(Boolean).length + (sideways && dualAxis ? 1 : 0);\n const size = sideways\n ? {\n model: \"rows\" as const,\n units: labels.length * perCategory,\n lines: twoLineNames(labels, column, measured),\n axis: titles ? `calc(${CHART_ROW} + ${titles} * calc(1.5 * var(--ds-font-size-xs) + 4px))` : CHART_ROW,\n }\n : { model: \"ratio\" as const };\n const maxBarSize = sideways ? Math.max(4, Math.round((measured.rowPx * perCategory * 0.7) / groups)) : undefined;\n // the bars read against the left (or bottom) axis; the lines against their own when dualAxis\n const barAxis = sideways ? { xAxisId: \"left\" } : { yAxisId: \"left\" };\n const lineAxis = sideways ? { xAxisId: dualAxis ? \"right\" : \"left\" } : { yAxisId: dualAxis ? \"right\" : \"left\" };\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={size}\n chart=\"composite\"\n categoryKind={kind}\n categories={data.length}\n categoryAxis={sideways ? \"y\" : \"x\"}\n sideways={sideways}\n axisTitle={topTitle}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <ComposedChart\n data={data}\n layout={sideways ? \"vertical\" : \"horizontal\"}\n stackOffset={anyStack(bars, stacked) ? \"sign\" : undefined}\n // names are fitted to their bands, so nothing hangs past the last bar\n margin={{ top, right: sideways || names ? 4 : xTicks.endMargin, bottom: 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} vertical={!sideways} horizontal />}\n {sideways ? (\n <>\n <XAxis xAxisId=\"left\" type=\"number\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" label={bottomLabel} />\n {dualAxis && <XAxis xAxisId=\"right\" type=\"number\" orientation=\"top\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" />}\n <YAxis\n dataKey={xAxisKey}\n type=\"category\"\n width={column ?? \"auto\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n interval={0}\n tick={rows}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={tick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={bottomLabel}\n />\n <YAxis yAxisId=\"left\" width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {dualAxis && (\n <YAxis yAxisId=\"right\" orientation=\"right\" width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n )}\n </>\n )}\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={[...bars.map((b) => b.dataKey), ...lines.map((l) => l.dataKey)]} />}\n {bars.map((bar, i) => (\n <Bar\n key={bar.dataKey}\n dataKey={bar.dataKey}\n name={bar.label ?? bar.dataKey}\n fill={barSoftColors[i]}\n // the soft fill is a 30% tint (1.3–1.4:1 on a dark card, Sprint 25.7 C4): the solid outline keeps the bar's\n // edge at the colour's own contrast against the card (WCAG 1.4.11), and separates stacked segments\n stroke={barSolidColors[i]}\n strokeWidth={1}\n shape={barShape(bars, i, stacked, radius, sideways)}\n stackId={barStackOf(bar, stacked)}\n maxBarSize={maxBarSize}\n {...barAxis}\n isAnimationActive={isAnimated}\n />\n ))}\n {lines.map((line, i) => (\n <Line\n key={line.dataKey}\n type=\"monotone\"\n dataKey={line.dataKey}\n name={line.label ?? line.dataKey}\n stroke={lineColors[i]}\n strokeWidth={2}\n strokeDasharray={line.dashed ? \"5 5\" : undefined}\n dot={false}\n {...lineAxis}\n isAnimationActive={isAnimated}\n />\n ))}\n </ComposedChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useRef, type Ref } from \"react\";\nimport {\n ScatterChart as RechartsScatterChart,\n Scatter,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n ZAxis,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useAxisMeasure } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface ScatterSeries {\n name: string;\n points: { x: number; y: number; z?: number }[];\n}\n\nexport interface ScatterChartProps {\n data: ScatterSeries[];\n xLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yLabel?: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const ScatterChart = markChart(forwardRef<HTMLDivElement, ScatterChartProps>(function ScatterChart({\n data,\n xLabel,\n yLabel,\n height = \"auto\",\n showGrid = true,\n showTooltip = true,\n showLegend,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const measured = useAxisMeasure(wrapperRef, !!yLabel && (data?.length ?? 0) > 0);\n const colors = useChartColors(data.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? data.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"scatter\"\n axisTitle={yLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsScatterChart\n margin={{ top: 8 + (yLabel ? Math.ceil(measured.px * 1.5) + 4 : 0), right: 8, bottom: xLabel ? 20 : 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n type=\"number\"\n dataKey=\"x\"\n name={xLabel ?? \"x\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n label={xLabel ? { value: xLabel, position: \"bottom\", offset: 0, style: { ...axisLabelStyle, textAnchor: \"middle\" } } : undefined}\n />\n <YAxis\n type=\"number\"\n dataKey=\"y\"\n name={yLabel ?? \"y\"}\n width=\"auto\"\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n />\n <ZAxis type=\"number\" dataKey=\"z\" range={[40, 400]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={data.map((s) => s.name)} by=\"value\" />}\n {data.map((series, i) => (\n <Scatter\n key={series.name}\n name={series.name}\n data={series.points}\n fill={colors[i]}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsScatterChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n RadarChart as RechartsRadarChart,\n Radar,\n PolarGrid,\n PolarAngleAxis,\n PolarRadiusAxis,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface RadarDataKey {\n key: string;\n label?: string;\n}\n\nexport interface RadarChartProps {\n data: Record<string, unknown>[];\n dataKeys: RadarDataKey[];\n axisKey: string;\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n filled?: boolean;\n showDots?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const RadarChart = markChart(forwardRef<HTMLDivElement, RadarChartProps>(function RadarChart({\n data,\n dataKeys,\n axisKey,\n height = \"auto\",\n filled = true,\n showDots = true,\n showTooltip = true,\n showLegend,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const solidColors = useChartColors(dataKeys.length, false);\n const softColors = useChartColors(dataKeys.length, true);\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? dataKeys.length >= 2;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"radar\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsRadarChart data={data} cx=\"50%\" cy=\"50%\" outerRadius=\"75%\" accessibilityLayer>\n <PolarGrid stroke=\"var(--ds-border-subtle)\" />\n <PolarAngleAxis\n dataKey={axisKey}\n tick={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: \"var(--ds-text-muted)\" }}\n />\n <PolarRadiusAxis\n tick={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: \"var(--ds-text-muted)\" }}\n axisLine={false}\n />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={dataKeys.map((dk) => dk.key)} />}\n {dataKeys.map((dk, i) => (\n <Radar\n key={dk.key}\n name={dk.label ?? dk.key}\n dataKey={dk.key}\n stroke={solidColors[i]}\n fill={filled ? softColors[i] : \"transparent\"}\n strokeWidth={2}\n dot={showDots ? { r: 3, fill: solidColors[i] } : false}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsRadarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n RadialBarChart as RechartsRadialBarChart,\n RadialBar,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface RadialBarChartProps {\n data: { name: string; value: number; max?: number; [key: string]: unknown }[];\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n showLegend?: boolean;\n showLabels?: boolean;\n startAngle?: number;\n endAngle?: number;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const RadialBarChart = markChart(forwardRef<HTMLDivElement, RadialBarChartProps>(function RadialBarChart({\n data,\n height = \"auto\",\n showTooltip = true,\n showLegend = true,\n showLabels = false,\n startAngle = 90,\n endAngle = -270,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const chartData = data.map((d, i) => ({\n ...d,\n fill: colors[i % colors.length],\n }));\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"radial-bar\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsRadialBarChart\n data={chartData}\n cx=\"50%\"\n cy=\"50%\"\n innerRadius=\"20%\"\n outerRadius=\"90%\"\n startAngle={startAngle}\n endAngle={endAngle}\n accessibilityLayer\n >\n <RadialBar\n dataKey=\"value\"\n background={{ fill: \"var(--ds-bg-muted)\" }}\n label={showLabels ? { position: \"insideStart\", fill: \"var(--ds-text-primary)\", fontSize: \"var(--ds-font-size-xs)\" } : false}\n isAnimationActive={isAnimated}\n />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={data.map((d) => d.name)} by=\"value\" />}\n </RechartsRadialBarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n FunnelChart as RechartsFunnelChart,\n Funnel,\n Tooltip,\n LabelList,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\n/** A funnel stage takes a taller row than a sideways bar (Sprint 25.9, A2). */\nconst STAGE_ROWS = 1.5;\n\nexport interface FunnelChartProps {\n data: { name: string; value: number; [key: string]: unknown }[];\n /** \"auto\" (the default): a row per stage. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n /** Kept for compatibility: a funnel has no legend, its labels name the stages (Recharts gives it no legend entries). */\n showLegend?: boolean;\n showLabels?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const FunnelChart = markChart(forwardRef<HTMLDivElement, FunnelChartProps>(function FunnelChart({\n data,\n height = \"auto\",\n showTooltip = true,\n showLabels = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const chartData = data.map((d, i) => ({\n ...d,\n fill: colors[i % colors.length],\n }));\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"rows\", units: data.length * STAGE_ROWS, axis: \"16px\" }} chart=\"funnel\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsFunnelChart accessibilityLayer>\n <Funnel dataKey=\"value\" data={chartData} isAnimationActive={isAnimated}>\n {showLabels && (\n <LabelList\n dataKey=\"name\"\n position=\"right\"\n fill=\"var(--ds-text-primary)\"\n fontSize=\"var(--ds-font-size-sm)\"\n fontFamily=\"var(--ds-font-sans)\"\n />\n )}\n </Funnel>\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </RechartsFunnelChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n Treemap,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, useRadius } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface TreemapNode {\n name: string;\n value?: number;\n children?: TreemapNode[];\n [key: string]: unknown;\n}\n\nexport interface TreemapChartProps {\n data: TreemapNode[];\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\ninterface TreemapContentProps {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n name?: string;\n depth?: number;\n colors: string[];\n radius: number;\n index?: number;\n}\n\nfunction contrastColor(hex: string): string {\n const c = hex.replace(\"#\", \"\");\n if (c.length < 6) return \"#ffffff\";\n const r = parseInt(c.substring(0, 2), 16);\n const g = parseInt(c.substring(2, 4), 16);\n const b = parseInt(c.substring(4, 6), 16);\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return luminance > 0.55 ? \"#1f2937\" : \"#ffffff\";\n}\n\nfunction TreemapContent({ x = 0, y = 0, width = 0, height: h = 0, name, depth, colors, radius, index = 0 }: TreemapContentProps) {\n const fill = colors[index % colors.length];\n const showLabel = width > 40 && h > 20;\n const labelColor = contrastColor(fill);\n\n return (\n <g>\n <rect\n x={x}\n y={y}\n width={width}\n height={h}\n fill={fill}\n stroke=\"var(--ds-bg-surface)\"\n strokeWidth={2}\n rx={depth === 1 ? radius : 0}\n style={{ opacity: depth === 1 ? 1 : 0.85 }}\n />\n {showLabel && (\n <text\n x={x + width / 2}\n y={y + h / 2}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fill={labelColor}\n stroke=\"none\"\n fontSize=\"var(--ds-font-size-xs)\"\n fontFamily=\"var(--ds-font-sans)\"\n style={{ pointerEvents: \"none\" }}\n >\n {name}\n </text>\n )}\n </g>\n );\n}\n\nfunction addFillToNodes(nodes: TreemapNode[], colors: string[], counter = { i: 0 }): TreemapNode[] {\n return nodes.map((node) => {\n if (node.children) {\n return { ...node, children: addFillToNodes(node.children, colors, counter) };\n }\n const fill = colors[counter.i % colors.length];\n counter.i++;\n return { ...node, fill };\n });\n}\n\nexport const TreemapChart = markChart(forwardRef<HTMLDivElement, TreemapChartProps>(function TreemapChart({\n data,\n height = \"auto\",\n showTooltip = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(6, false);\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n\n const chartData = addFillToNodes(data, colors);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"ratio\" }} chart=\"treemap\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <Treemap\n data={chartData}\n dataKey=\"value\"\n nameKey=\"name\"\n aspectRatio={4 / 3}\n stroke=\"var(--ds-bg-surface)\"\n isAnimationActive={isAnimated}\n content={<TreemapContent colors={colors} radius={radius} />}\n >\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </Treemap>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n Sankey as RechartsSankey,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useResolvedToken } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface SankeyChartProps {\n data: {\n nodes: { name: string }[];\n links: { source: number; target: number; value: number }[];\n };\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const SankeyChart = markChart(forwardRef<HTMLDivElement, SankeyChartProps>(function SankeyChart({\n data,\n height = \"auto\",\n showTooltip = true,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.nodes.length, false);\n const linkStroke = useResolvedToken(\"--ds-border-subtle\");\n\n const nodesWithColor = data.nodes.map((node, i) => ({\n ...node,\n fill: colors[i % colors.length],\n }));\n\n const sankeyData = {\n nodes: nodesWithColor,\n links: data.links,\n };\n\n if (!data?.nodes?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"ratio\" }} chart=\"sankey\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsSankey\n data={sankeyData}\n nodeWidth={10}\n nodePadding={24}\n margin={{ top: 8, right: 8, bottom: 8, left: 8 }}\n link={{ stroke: linkStroke, strokeOpacity: 0.4 }}\n >\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </RechartsSankey>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useId } from \"react\";\nimport {\n LineChart,\n Line,\n AreaChart,\n Area,\n BarChart,\n Bar,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { useResolvedToken, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { useInsideChartContainer } from \"./ChartWrapper\";\n\nexport interface SparklineProps {\n data: number[];\n variant?: \"line\" | \"area\" | \"bar\";\n color?: 1 | 2 | 3 | 4 | 5 | 6;\n height?: number;\n width?: number | \"100%\";\n showTooltip?: boolean;\n curved?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const Sparkline = forwardRef<HTMLDivElement, SparklineProps>(function Sparkline({\n data,\n variant = \"line\",\n color = 1,\n height = 40,\n width = \"100%\",\n showTooltip = false,\n curved = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const instanceId = useId();\n const isAnimated = useChartAnimation(animated);\n const insideContainer = useInsideChartContainer();\n\n const tokenName = `--ds-chart-${color}` as const;\n const softTokenName = `--ds-chart-${color}-soft` as const;\n const chartColor = useResolvedToken(tokenName);\n const softColor = useResolvedToken(softTokenName);\n const chartData = data.map((value, i) => ({ value, index: i }));\n\n const containerStyle = insideContainer\n ? { width: \"100%\", height: \"100%\" }\n : { width: typeof width === \"number\" ? `${width}px` : width, height: `${height}px` };\n\n if (!data?.length) return null;\n\n if (variant === \"bar\") {\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <BarChart data={chartData} margin={{ top: 0, right: 0, bottom: 0, left: 0 }}>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Bar\n dataKey=\"value\"\n fill={chartColor}\n radius={[2, 2, 0, 0]}\n isAnimationActive={isAnimated}\n />\n </BarChart>\n </ResponsiveContainer>\n </div>\n );\n }\n\n if (variant === \"area\") {\n const gradientId = `sparkline-gradient-${instanceId}-${color}`;\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <AreaChart data={chartData} margin={{ top: 2, right: 2, bottom: 2, left: 2 }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={softColor} stopOpacity={1} />\n <stop offset=\"95%\" stopColor={softColor} stopOpacity={0.1} />\n </linearGradient>\n </defs>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide domain={[\"dataMin - 1\", \"dataMax + 1\"]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Area\n type={curved ? \"monotone\" : \"linear\"}\n dataKey=\"value\"\n stroke={chartColor}\n strokeWidth={1.5}\n fill={`url(#${gradientId})`}\n dot={false}\n activeDot={showTooltip ? { r: 3, fill: chartColor } : false}\n isAnimationActive={isAnimated}\n />\n </AreaChart>\n </ResponsiveContainer>\n </div>\n );\n }\n\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <LineChart data={chartData} margin={{ top: 2, right: 2, bottom: 2, left: 2 }}>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide domain={[\"dataMin - 1\", \"dataMax + 1\"]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Line\n type={curved ? \"monotone\" : \"linear\"}\n dataKey=\"value\"\n stroke={chartColor}\n strokeWidth={1.5}\n dot={false}\n activeDot={showTooltip ? { r: 3, fill: chartColor } : false}\n isAnimationActive={isAnimated}\n />\n </LineChart>\n </ResponsiveContainer>\n </div>\n );\n});\n","import { useId, useMemo, type ReactNode } from \"react\";\nimport { cn, GLASS_SURFACE } from \"../lib/utils\";\nimport { Skeleton } from \"./Skeleton\";\nimport { CHART_HEIGHTS, ChartContainerContext, fixedChartHeight, isLibraryChart, type ChartContainerValue } from \"./charts/ChartWrapper\";\n\n/**\n * CardTitle's classes (Card.tsx) without its line clamp: a chart's title states its insight, its message\n * (data_visualisation#3), so it is never cut. Kept equal to CardTitle's by a test.\n */\nexport const CHART_TITLE_CLASSES = \"font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]\";\n\nexport interface ChartContainerProps {\n /**\n * \"auto\" (the default): the chart sizes itself from its type and its data (Sprint 25.9, A2) — a row per item for\n * sideways bars and funnels, two wide to one high for charts over dates or numbers, square for round charts — and in\n * a row its frame matches the tallest block while the chart grows only to its bound. \"fill\" means the same as \"auto\".\n * A preset (sm, md, lg) or a number of px sets this chart's height instead, and beats the chart's own.\n */\n height?: \"auto\" | \"fill\" | \"sm\" | \"md\" | \"lg\" | number;\n /** The insight, as a heading (h3) in the card-title style, never cut. The chart's graphic is named by it. */\n title?: string;\n loading?: boolean;\n emptyState?: ReactNode;\n /** \"default\" is a card surface. \"ghost\" drops surface, border, shadow and padding for charts embedded in another container. */\n variant?: \"default\" | \"ghost\";\n children: ReactNode;\n className?: string;\n}\n\nexport function ChartContainer({\n height = \"auto\",\n title,\n loading = false,\n emptyState,\n variant = \"default\",\n children,\n className,\n}: ChartContainerProps) {\n const titleId = useId();\n const fixed = fixedChartHeight(height);\n // A library chart sizes itself (its mark). Anything else — a hand-built chart, an EmptyState, a Sparkline, several\n // children — keeps an area of the preset's height, else md, and fills it.\n const sizesItself = !loading && !!children && isLibraryChart(children);\n const area = fixed ?? CHART_HEIGHTS.md;\n const context = useMemo<ChartContainerValue>(\n () => ({ height: fixed, titleId: title ? titleId : undefined, fillArea: !sizesItself }),\n [fixed, title, titleId, sizesItself],\n );\n\n let body: ReactNode = null;\n if (loading) {\n body = (\n <div className=\"absolute inset-0 flex flex-col justify-end gap-ds-2 px-ds-2\">\n <div className=\"flex items-end h-full gap-ds-1\">\n {[65, 40, 80, 55, 72, 45, 60].map((h, i) => (\n <Skeleton key={i} variant=\"custom\" className=\"flex-1\" height={`${h}%`} />\n ))}\n </div>\n <Skeleton variant=\"text\" lines={1} className=\"w-full\" />\n </div>\n );\n } else if (children) {\n body = (\n <ChartContainerContext.Provider value={context}>\n {sizesItself ? children : (\n // the area is absolute, so a child that fills 100% has a definite height to fill\n <div className=\"absolute inset-0\">\n <div className=\"h-full w-full\">{children}</div>\n </div>\n )}\n </ChartContainerContext.Provider>\n );\n } else if (emptyState) {\n body = <div className=\"flex flex-1 items-center justify-center\">{emptyState}</div>;\n }\n\n return (\n <div\n data-card=\"\"\n data-gs=\"chart\"\n className={cn(\n \"flex flex-col\",\n variant === \"ghost\"\n ? \"bg-transparent\"\n : cn(\n // CardHeader's inset, so titles inside frames line up in a row (A1)\n \"rounded-[var(--ds-radius-md)] px-ds-5 py-ds-4\",\n \"bg-[var(--ds-bg-surface)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n GLASS_SURFACE,\n ),\n className,\n )}\n >\n {title && (\n <h3 id={titleId} className={cn(CHART_TITLE_CLASSES, \"mb-ds-4\")}>\n {title}\n </h3>\n )}\n <div\n data-chart-body=\"\"\n className=\"relative flex min-w-0 flex-col\"\n style={{ flex: \"1 1 0%\", minHeight: sizesItself ? undefined : area }}\n >\n {body}\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../showcase/src/lib/chart-utils.ts","../../../showcase/src/lib/chart-categories.ts","../../../showcase/src/components/charts/ChartWrapper.tsx","../../../showcase/src/components/charts/ChartPrimitives.tsx","../../../showcase/src/components/charts/BarChart.tsx","../../../showcase/src/components/charts/LineChart.tsx","../../../showcase/src/components/charts/AreaChart.tsx","../../../showcase/src/components/charts/PieChart.tsx","../../../showcase/src/components/charts/CompositeChart.tsx","../../../showcase/src/components/charts/ScatterChart.tsx","../../../showcase/src/components/charts/RadarChart.tsx","../../../showcase/src/components/charts/RadialBarChart.tsx","../../../showcase/src/components/charts/FunnelChart.tsx","../../../showcase/src/components/charts/TreemapChart.tsx","../../../showcase/src/components/charts/SankeyChart.tsx","../../../showcase/src/components/charts/Sparkline.tsx","../../../showcase/src/components/ChartContainer.tsx"],"names":["k","ChartWrapper","categoryKind","useState","useLayoutEffect","useContext","jsxs","jsx","useMemo","useEffect","forwardRef","BarChart","useRef","RechartsBarChart","Fragment","LineChart","ResponsiveContainer","RechartsLineChart","CartesianGrid","XAxis","YAxis","Tooltip","AreaChart","RechartsAreaChart","PieChart","RechartsPieChart","CompositeChart","Bar","Line","ScatterChart","RechartsScatterChart","RadarChart","RechartsRadarChart","RadialBarChart","RechartsRadialBarChart","FunnelChart","RechartsFunnelChart","TreemapChart","SankeyChart","RechartsSankey","Sparkline","useId","Area"],"mappings":";;;;;;;;AAEA,IAAM,YAAA,GAAe;AAAA,EACnB,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,iBAAA,GAAoB;AAAA,EACxB,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,eAAA,GAA0C;AAAA,EAC9C,cAAA,EAAgB,SAAA;AAAA,EAChB,cAAA,EAAgB,SAAA;AAAA,EAChB,cAAA,EAAgB,SAAA;AAAA,EAChB,cAAA,EAAgB,SAAA;AAAA,EAChB,cAAA,EAAgB,SAAA;AAAA,EAChB,cAAA,EAAgB,SAAA;AAAA,EAChB,mBAAA,EAAqB,yBAAA;AAAA,EACrB,mBAAA,EAAqB,wBAAA;AAAA,EACrB,mBAAA,EAAqB,wBAAA;AAAA,EACrB,mBAAA,EAAqB,wBAAA;AAAA,EACrB,mBAAA,EAAqB,wBAAA;AAAA,EACrB,mBAAA,EAAqB,yBAAA;AAAA,EACrB,iBAAA,EAAmB,SAAA;AAAA,EACnB,oBAAA,EAAsB,SAAA;AAAA,E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AA,EAC1D,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,wBAEFA,GAAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,iBAAA,EAAgB,EAAA;AAAA,YAChB,SAAA,EAAU,gCAAA;AAAA,YACV,OAAO,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,WAAA,GAAc,SAAY,IAAA,EAAK;AAAA,YAElE,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"charts.js","sourcesContent":["import { useState, useLayoutEffect, useSyncExternalStore } from \"react\";\n\nconst CHART_TOKENS = [\n \"--ds-chart-1\",\n \"--ds-chart-2\",\n \"--ds-chart-3\",\n \"--ds-chart-4\",\n \"--ds-chart-5\",\n \"--ds-chart-6\",\n] as const;\n\nconst CHART_TOKENS_SOFT = [\n \"--ds-chart-1-soft\",\n \"--ds-chart-2-soft\",\n \"--ds-chart-3-soft\",\n \"--ds-chart-4-soft\",\n \"--ds-chart-5-soft\",\n \"--ds-chart-6-soft\",\n] as const;\n\nconst FALLBACK_COLORS: Record<string, string> = {\n \"--ds-chart-1\": \"#6366f1\",\n \"--ds-chart-2\": \"#d97706\",\n \"--ds-chart-3\": \"#059669\",\n \"--ds-chart-4\": \"#dc2626\",\n \"--ds-chart-5\": \"#0891b2\",\n \"--ds-chart-6\": \"#7c3aed\",\n \"--ds-chart-1-soft\": \"rgba(99, 102, 241, 0.3)\",\n \"--ds-chart-2-soft\": \"rgba(217, 119, 6, 0.3)\",\n \"--ds-chart-3-soft\": \"rgba(5, 150, 105, 0.3)\",\n \"--ds-chart-4-soft\": \"rgba(220, 38, 38, 0.3)\",\n \"--ds-chart-5-soft\": \"rgba(8, 145, 178, 0.3)\",\n \"--ds-chart-6-soft\": \"rgba(124, 58, 237, 0.3)\",\n \"--ds-bg-surface\": \"#ffffff\",\n \"--ds-border-subtle\": \"#e5e7eb\",\n \"--ds-text-primary\": \"#111827\",\n \"--ds-text-secondary\": \"#6b7280\",\n \"--ds-text-muted\": \"#9ca3af\",\n};\n\ntype Subscriber = () => void;\n\nlet modeVersion = 0;\nconst subscribers = new Set<Subscriber>();\nlet observerAttached = false;\n\nfunction attachObserver() {\n if (observerAttached || typeof document === \"undefined\") return;\n observerAttached = true;\n\n const observer = new MutationObserver((mutations) => {\n for (const m of mutations) {\n if (m.attributeName === \"data-mode\") {\n modeVersion++;\n for (const sub of subscribers) sub();\n break;\n }\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-mode\"],\n });\n}\n\nfunction subscribe(cb: Subscriber) {\n attachObserver();\n subscribers.add(cb);\n return () => { subscribers.delete(cb); };\n}\n\nfunction getSnapshot() {\n return modeVersion;\n}\n\nfunction getServerSnapshot() {\n return 0;\n}\n\nexport function resolveToken(token: string): string {\n if (typeof document === \"undefined\") return FALLBACK_COLORS[token] ?? \"#6366f1\";\n const val = getComputedStyle(document.documentElement).getPropertyValue(token).trim();\n return val || FALLBACK_COLORS[token] || \"#6366f1\";\n}\n\nexport function useChartColors(count: number, soft = false): string[] {\n const version = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n const [colors, setColors] = useState<string[]>(() => fallbackColors(count, soft));\n\n // Reads computed CSS custom properties, which only exist after the theme's\n // style tag is committed — this has to be a post-layout effect.\n /* eslint-disable react-hooks/set-state-in-effect -- token resolution is a DOM read after commit */\n useLayoutEffect(() => {\n setColors(resolveColors(count, soft));\n }, [count, soft, version]);\n /* eslint-enable react-hooks/set-state-in-effect */\n\n return colors;\n}\n\nfunction fallbackColors(count: number, soft: boolean): string[] {\n const tokens = soft ? CHART_TOKENS_SOFT : CHART_TOKENS;\n const result: string[] = [];\n for (let i = 0; i < count; i++) {\n const token = tokens[i % tokens.length];\n result.push(FALLBACK_COLORS[token] ?? \"#6366f1\");\n }\n return result;\n}\n\nfunction resolveColors(count: number, soft: boolean): string[] {\n const tokens = soft ? CHART_TOKENS_SOFT : CHART_TOKENS;\n const result: string[] = [];\n for (let i = 0; i < count; i++) {\n const token = tokens[i % tokens.length];\n result.push(resolveToken(token));\n }\n return result;\n}\n\nexport function useResolvedToken(token: string): string {\n const version = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n const [value, setValue] = useState(() => FALLBACK_COLORS[token] ?? \"#6366f1\");\n\n /* eslint-disable react-hooks/set-state-in-effect -- token resolution is a DOM read after commit */\n useLayoutEffect(() => {\n setValue(resolveToken(token));\n }, [token, version]);\n /* eslint-enable react-hooks/set-state-in-effect */\n\n return value;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(() => {\n if (typeof window === \"undefined\") return false;\n return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n });\n\n useLayoutEffect(() => {\n const mql = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const handler = (e: MediaQueryListEvent) => setReduced(e.matches);\n mql.addEventListener(\"change\", handler);\n return () => mql.removeEventListener(\"change\", handler);\n }, []);\n\n return reduced;\n}\n\nexport const useChartAnimation = (animated?: boolean): boolean => {\n const reduced = useReducedMotion();\n return animated !== false && !reduced;\n};\n","/**\n * Sprint 25.9, A3 — what a chart's category axis holds, and how its labels fit. No Recharts here: the charts entry and\n * the tests import it, and it never measures on its own (the measurer is handed in).\n *\n * - `categoryKind(labels)`: \"scale\" when every non-empty label is a date, a time, a period or a number, else \"names\".\n * Anchored patterns only — never `Date.parse`, which V8 lets read \"Tier 1\", \"Sprint 1\" and \"Northern Region 2\" as dates.\n * - `createAxisMeasurer(el)`: canvas text widths in the axis's resolved font, read from a probe that carries\n * `font-size: var(--ds-font-size-xs)`, so a `calc()` token (`calc(16px * .75)`, a 14 px base) measures right.\n * - `fitLabel(name, width, measure)`: one line; else two lines split at a space; else \"…\" on the second. Never drops it.\n */\n\nexport type CategoryKind = \"names\" | \"scale\";\n\n/** A text's width in px in the axis font. */\nexport type Measure = (text: string) => number;\n\nconst ENGLISH_MONTHS = [\n \"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\",\n \"jan\", \"feb\", \"mar\", \"apr\", \"jun\", \"jul\", \"aug\", \"sep\", \"sept\", \"oct\", \"nov\", \"dec\",\n];\nconst ENGLISH_WEEKDAYS = [\n \"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\",\n \"mon\", \"tue\", \"tues\", \"wed\", \"thu\", \"thur\", \"thurs\", \"fri\", \"sat\", \"sun\",\n];\n\nconst escape = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nconst clean = (s: string) => s.trim().toLowerCase().replace(/\\.$/, \"\");\n\nfunction intlNames(locale: string, kind: \"month\" | \"weekday\"): string[] {\n const out: string[] = [];\n try {\n for (const width of [\"short\", \"long\"] as const) {\n const fmt = new Intl.DateTimeFormat(locale, kind === \"month\" ? { month: width, timeZone: \"UTC\" } : { weekday: width, timeZone: \"UTC\" });\n // 2026-01-05 is a Monday: seven days give the weekdays, the 15th of each month the months\n const count = kind === \"month\" ? 12 : 7;\n for (let i = 0; i < count; i++) {\n const date = kind === \"month\" ? new Date(Date.UTC(2026, i, 15)) : new Date(Date.UTC(2026, 0, 5 + i));\n out.push(clean(fmt.format(date)));\n }\n }\n } catch {\n // an unknown locale tag: English covers it\n }\n return out;\n}\n\nfunction locales(): string[] {\n const out = new Set<string>([\"en\"]);\n try { out.add(new Intl.DateTimeFormat().resolvedOptions().locale); } catch { /* no Intl locale */ }\n if (typeof navigator !== \"undefined\" && navigator.language) out.add(navigator.language);\n if (typeof document !== \"undefined\" && document.documentElement?.lang) out.add(document.documentElement.lang);\n return [...out];\n}\n\ninterface Patterns { key: string; list: RegExp[] }\nlet cached: Patterns | null = null;\n\nfunction patterns(): Patterns {\n const tags = locales();\n const key = tags.join(\"|\");\n if (cached?.key === key) return cached;\n const months = new Set(ENGLISH_MONTHS);\n const weekdays = new Set(ENGLISH_WEEKDAYS);\n for (const tag of tags) {\n for (const m of intlNames(tag, \"month\")) if (m) months.add(m);\n for (const d of intlNames(tag, \"weekday\")) if (d) weekdays.add(d);\n }\n // the longest first, so \"sept\" wins over \"sep\" and \"june\" over \"jun\"\n const alt = (set: Set<string>) => [...set].sort((a, b) => b.length - a.length).map(escape).join(\"|\");\n const M = `(?:${alt(months)})\\\\.?`;\n const D = `(?:${alt(weekdays)})\\\\.?`;\n const day = String.raw`\\d{1,2}(?:st|nd|rd|th|\\.)?`;\n const year = String.raw`'?\\d{2,4}`;\n const list = [\n // dates in digits: 2026-09-21, 21/09, 09/21/2026, 21.09.2026, an ISO date-time\n /^\\d{4}[-/.]\\d{1,2}(?:[-/.]\\d{1,2})?$/,\n /^\\d{1,2}[-/.]\\d{1,2}(?:[-/.]\\d{2,4})?$/,\n /^\\d{4}-\\d{2}-\\d{2}[T ]\\d{1,2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})?$/,\n // a day and a month in either order, and a month alone or with its year: 16 Sep, 21. Sept., Sept 21, March 2026\n new RegExp(`^${day}\\\\s*${M}(?:,?\\\\s+${year})?$`, \"iu\"),\n new RegExp(`^${M}\\\\s*${day}(?:,?\\\\s+${year})?$`, \"iu\"),\n new RegExp(`^${M}(?:\\\\s*${year})?$`, \"iu\"),\n // CJK dates: 9月21日, 2026年9月, 9월 21일\n /^(?:\\d{4}年)?\\d{1,2}月(?:\\d{1,2}日)?$/u,\n /^\\d{4}年(?:\\d{1,2}月)?$/u,\n /^(?:\\d{4}년\\s?)?\\d{1,2}월(?:\\s?\\d{1,2}일)?$/u,\n // a quarter or a half: Q3, Q3 2026, Q3 FY26, 2026 Q3, 3Q26, H1 2026\n /^Q[1-4](?:\\s*[-/']?\\s*(?:FY\\s?)?'?\\d{2,4})?$/i,\n /^[1-4]Q\\s*'?\\d{0,4}$/i,\n /^(?:FY\\s?)?'?\\d{2,4}\\s*[-/]?\\s*Q[1-4]$/i,\n /^H[12](?:\\s*'?\\d{2,4})?$/i,\n // a year or a fiscal year: 2026, FY26, FY 2025/26, 2025/26, 2025-2026\n /^(?:19|20)\\d{2}$/,\n /^FY\\s?'?\\d{2,4}(?:\\s?[-/]\\s?'?\\d{2,4})?$/i,\n /^(?:19|20)\\d{2}\\s?[-/–]\\s?(?:(?:19|20)?\\d{2})$/,\n // a week: W12, Wk 3, Week 12, Week 12 2026, 2026-W12\n /^(?:W|Wk|Week)\\.?\\s?\\d{1,2}(?:\\s*[,/-]?\\s*\\d{4})?$/i,\n /^\\d{4}-?W\\d{1,2}(?:-?\\d)?$/i,\n // a weekday: Mon, Tuesday, and the runtime and page locales' own\n new RegExp(`^${D}$`, \"iu\"),\n // a time: 09:00, 9:30 pm, 9am, 14h\n /^\\d{1,2}:\\d{2}(?::\\d{2})?\\s?(?:[ap]\\.?m\\.?)?$/i,\n /^\\d{1,2}\\s?[ap]\\.?m\\.?$/i,\n /^\\d{1,2}h(?:\\d{2})?$/i,\n // a number, a percentage or an amount: 12, -3.5, 1,200, 12%, $5k, €1.2m, 5 €, a bin (10–20, <10, 50+)\n /^[<>≤≥~]?\\s?[+\\-−]?\\s?[$€£¥₹]?\\s?\\d[\\d,. \\u00a0\\u202f]*(?:\\s?(?:k|m|mn|bn|b|t))?\\s?(?:%|[$€£¥₹])?\\+?$/iu,\n /^[$€£¥₹]?\\d[\\d,.]*\\s?[-–]\\s?[$€£¥₹]?\\d[\\d,.]*\\s?(?:k|m|bn|%)?$/iu,\n ];\n cached = { key, list };\n return cached;\n}\n\n/**\n * Whether a category axis holds names or a scale (dates, times, periods, numbers). Every non-empty label must match an\n * anchored pattern to be \"scale\"; an all-empty set is \"scale\". LineChart and AreaChart are always \"scale\"; BarChart and\n * CompositeChart guess with this, and their `categoryKind` prop overrides the guess.\n */\nexport function categoryKind(labels: ReadonlyArray<unknown>): CategoryKind {\n const { list } = patterns();\n for (const raw of labels) {\n if (raw == null) continue;\n if (typeof raw === \"number\") { if (Number.isFinite(raw)) continue; return \"names\"; }\n if (raw instanceof Date) continue;\n const text = String(raw).trim();\n if (!text) continue;\n if (!list.some((re) => re.test(text))) return \"names\";\n }\n return \"scale\";\n}\n\n/* ── Measuring ──────────────────────────────────────────────────────────── */\n\n/** The axis font as the page resolves it: size and family from a probe carrying the chart's tick tokens. */\nexport function resolvedAxisFont(el: Element): { font: string; px: number } {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n let probe = el.querySelector<HTMLElement>(\"[data-chart-probe]\");\n let temporary = false;\n if (!probe) {\n probe = doc.createElement(\"span\");\n probe.setAttribute(\"aria-hidden\", \"true\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none;white-space:nowrap;font-size:var(--ds-font-size-xs);font-family:var(--ds-font-sans)\";\n el.appendChild(probe);\n temporary = true;\n }\n const cs = view?.getComputedStyle(probe);\n const px = parseFloat(cs?.fontSize ?? \"\") || 12;\n const family = (cs?.fontFamily ?? \"\").trim() || \"sans-serif\";\n const style = cs?.fontStyle && cs.fontStyle !== \"normal\" ? `${cs.fontStyle} ` : \"\";\n const weight = cs?.fontWeight && cs.fontWeight !== \"400\" && cs.fontWeight !== \"normal\" ? `${cs.fontWeight} ` : \"\";\n if (temporary) probe.remove();\n return { font: `${style}${weight}${px}px ${family}`, px };\n}\n\n/** One 2D context for every chart, kept per getContext implementation (a test may swap it for a stub). */\nlet shared: { getContext: unknown; ctx: CanvasRenderingContext2D | null } | null = null;\n\nfunction canvasContext(): CanvasRenderingContext2D | null {\n if (typeof document === \"undefined\") return null;\n const getContext = (globalThis as { HTMLCanvasElement?: { prototype: { getContext?: unknown } } }).HTMLCanvasElement?.prototype.getContext;\n if (shared && shared.getContext === getContext) return shared.ctx;\n let ctx: CanvasRenderingContext2D | null = null;\n try { ctx = document.createElement(\"canvas\").getContext?.(\"2d\") ?? null; } catch { ctx = null; }\n shared = { getContext, ctx };\n return ctx;\n}\n\n/**\n * A text measurer in the chart's own axis font, or null where there is no canvas (jsdom): the charts then show every\n * label in full on one line and leave the thinning to nobody.\n */\nexport function createAxisMeasurer(el: Element): { measure: Measure; px: number; font: string } | null {\n const ctx = canvasContext();\n if (!ctx) return null;\n const { font, px } = resolvedAxisFont(el);\n ctx.font = font;\n const widths = new Map<string, number>();\n const measure: Measure = (text) => {\n let w = widths.get(text);\n if (w === undefined) {\n // the context is shared: another chart may have set its own font since\n ctx.font = font;\n w = ctx.measureText(text).width;\n widths.set(text, w);\n }\n return w;\n };\n return { measure, px, font };\n}\n\n/* ── Fitting a name ─────────────────────────────────────────────────────── */\n\nexport const ELLIPSIS = \"…\";\n\nexport interface FittedLabel {\n /** One or two lines; the second ends with \"…\" when the name was cut. */\n lines: string[];\n cut: boolean;\n /** Characters of the name that show, spaces and the ellipsis left out. */\n shown: number;\n}\n\nconst letters = (s: string) => s.replace(/\\s+/g, \"\").replace(/…/g, \"\").length;\n\n/** The longest prefix of `text` that fits `width` (at least one character). */\nfunction prefixThatFits(text: string, width: number, measure: Measure, suffix = \"\"): number {\n let lo = 1;\n let hi = text.length;\n let best = 0;\n while (lo <= hi) {\n const mid = (lo + hi) >> 1;\n if (measure(text.slice(0, mid).trimEnd() + suffix) <= width) { best = mid; lo = mid + 1; } else hi = mid - 1;\n }\n return best;\n}\n\n/**\n * A name fitted to `width`: one line when it fits; else two lines split at a space; else the second line ends with \"…\".\n * A first word wider than the line breaks where the line ends, with a hyphen, so it reads as one word going on. The\n * name is never dropped, and without a measurer it shows in full on one line.\n */\nexport function fitLabel(name: string, width: number, measure: Measure | null): FittedLabel {\n const text = name.replace(/\\s+/g, \" \").trim();\n if (!measure || !text || width <= 0 || measure(text) <= width) return { lines: [text], cut: false, shown: letters(text) };\n const words = text.split(\" \");\n let first = \"\";\n let firstShown = \"\";\n let rest = \"\";\n for (let i = words.length - 1; i >= 1; i--) {\n const candidate = words.slice(0, i).join(\" \");\n if (measure(candidate) <= width) { first = firstShown = candidate; rest = words.slice(i).join(\" \"); break; }\n }\n if (!first) {\n // the first word alone is too wide: the first line holds what fits of it and a hyphen\n const k = Math.max(1, prefixThatFits(text, width, measure, \"-\"));\n firstShown = text.slice(0, k).trimEnd();\n rest = text.slice(k).trimStart();\n first = rest && !text.slice(k - 1, k + 1).includes(\" \") ? `${firstShown}-` : firstShown;\n }\n if (!rest) return { lines: [first], cut: false, shown: letters(firstShown) };\n if (measure(rest) <= width) return { lines: [first, rest], cut: false, shown: letters(firstShown) + letters(rest) };\n const k = prefixThatFits(rest, width, measure, ELLIPSIS);\n const kept = k > 0 ? rest.slice(0, k).trimEnd() : \"\";\n return { lines: [first, kept + ELLIPSIS], cut: true, shown: letters(firstShown) + letters(kept) };\n}\n\n/** D8: fewer visible characters than this on a cut name turns an upright chart of names sideways. */\nexport const MIN_NAME_CHARS = 6;\n\n/** Whether any name, fitted to `width`, would be cut to fewer than MIN_NAME_CHARS characters. */\nexport function namesCutShort(names: ReadonlyArray<string>, width: number, measure: Measure): boolean {\n return names.some((n) => {\n const fit = fitLabel(n, width, measure);\n return fit.cut && fit.shown < MIN_NAME_CHARS;\n });\n}\n","import {\n Children, createContext, forwardRef, isValidElement, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState,\n type CSSProperties, type KeyboardEvent, type ReactNode, type Ref,\n} from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { mergeRefs } from \"../../lib/slot\";\n\n/* ── Heights ────────────────────────────────────────────────────────────── */\n\n/** A chart's height: \"auto\" (the default) sizes it from its type and its data; a preset or a number overrides. */\nexport type ChartHeight = \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n\nexport const CHART_HEIGHTS = {\n sm: \"var(--ds-chart-height-sm)\",\n md: \"var(--ds-chart-height-md)\",\n lg: \"var(--ds-chart-height-lg)\",\n} as const;\n\n/** One row of a row chart (a sideways bar, a funnel stage). */\nexport const CHART_ROW = \"var(--ds-chart-row, 2rem)\";\n\n/** A preset or a number as a CSS height; \"auto\" and \"fill\" have none (the chart sizes itself). */\nexport function fixedChartHeight(height: ChartHeight | \"fill\" | undefined): string | undefined {\n if (typeof height === \"number\") return `${height}px`;\n if (height === \"sm\" || height === \"md\" || height === \"lg\") return CHART_HEIGHTS[height];\n return undefined;\n}\n\n/**\n * How a chart sizes itself (Sprint 25.9, A2, P2):\n * - \"rows\" (a sideways BarChart, a FunnelChart): a row per item, never under sm; `units` rows, `lines` extra label lines\n * (a two-line name makes its row one line taller), `axis` the value axis and titles below or above the rows;\n * - \"ratio\" (charts over dates or numbers, Treemap, Sankey): two wide to one high, between sm and lg;\n * - \"square\" (Pie, Radar, RadialBar): as tall as wide, between sm and lg.\n */\nexport type ChartSize =\n | { model: \"ratio\" }\n | { model: \"square\" }\n | { model: \"rows\"; units: number; lines?: number; axis?: string };\n\nconst SM = CHART_HEIGHTS.sm;\nconst LG = CHART_HEIGHTS.lg;\n\n/**\n * The plot box's height and its bound in a row. `cqi` resolves against the chart's wrapper, the size container, because\n * the plot box is its child (on the wrapper itself it would read the page's container). The box is `flex: 1 0 auto`,\n * never `flex-1`: its drawing is absolute, so a zero basis would collapse it (R5). In a row it grows to the row's\n * height up to a bound: a ratio chart to square, a row chart to twice its height, a round chart not at all.\n */\nexport function plotBoxStyle(size: ChartSize, fixed: string | undefined): CSSProperties {\n if (size.model === \"square\") {\n return { height: fixed ?? `clamp(${SM}, 100cqi, ${LG})`, flex: \"0 0 auto\" };\n }\n if (size.model === \"rows\") {\n const lines = size.lines ? ` + ${size.lines} * 1.25 * var(--ds-font-size-xs)` : \"\";\n const height = fixed ?? `max(${SM}, calc(${size.units} * ${CHART_ROW}${lines} + ${size.axis ?? CHART_ROW}))`;\n return { height, maxHeight: `calc(2 * ${height})`, flex: \"1 0 auto\" };\n }\n return { height: fixed ?? `clamp(${SM}, 50cqi, ${LG})`, maxHeight: `max(${fixed ?? LG}, 100cqi)`, flex: \"1 0 auto\" };\n}\n\n/* ── The chart mark ─────────────────────────────────────────────────────── */\n\n/**\n * Marks the library's charts, so ChartContainer knows its child sizes itself and needs no minimum area of its own.\n * `Symbol.for`, as PAGE_HEADER_MARK, so a second copy of the module still matches. A hand-built chart, an EmptyState\n * or a Sparkline carries no mark and keeps the container's area.\n */\nexport const CHART_MARK: unique symbol = Symbol.for(\"gridsmith.Chart\") as never;\n\nexport function markChart<T extends object>(component: T): T {\n Object.assign(component, { [CHART_MARK]: true });\n return component;\n}\n\n/** A single library chart (not a Fragment, a wrapper of the builder's or a list of children). */\nexport function isLibraryChart(children: ReactNode): boolean {\n const kids = Children.toArray(children);\n if (kids.length !== 1) return false;\n const only = kids[0];\n if (!isValidElement(only)) return false;\n const type = only.type as unknown as Record<symbol, unknown> | string | null;\n return !!type && typeof type !== \"string\" && type[CHART_MARK] === true;\n}\n\n/* ── Context ────────────────────────────────────────────────────────────── */\n\nexport interface ChartContainerValue {\n /** The container's own height (a preset or a number, as CSS): it beats the chart's. */\n height?: string;\n /** The container title's id: the chart's graphic is named by it. */\n titleId?: string;\n /** The chart is not the container's only child (or is wrapped): it fills the container's area instead of sizing itself. */\n fillArea?: boolean;\n}\n\nexport const ChartContainerContext = createContext<ChartContainerValue | null>(null);\n\nexport function useInsideChartContainer(): boolean {\n return useContext(ChartContainerContext) !== null;\n}\n\n/** The chart's slots outside its drawing: the legend (Recharts' Legend portals into it) and the tooltip's live region. */\nexport interface ChartFrame {\n legend: HTMLElement | null;\n live: HTMLElement | null;\n}\n\nexport const ChartFrameContext = createContext<ChartFrame>({ legend: null, live: null });\n\n/* ── Keyboard ───────────────────────────────────────────────────────────── */\n\nconst REMAPPED = new WeakSet<Event>();\n\n/**\n * A sideways chart lists its rows top to bottom. Recharts maps only ArrowLeft and ArrowRight, and in that layout reads\n * ArrowRight as the row above. Down and Right move to the next row, Up and Left to the one before, in reading order.\n */\nfunction remapRowKeys(e: KeyboardEvent<HTMLDivElement>) {\n if (REMAPPED.has(e.nativeEvent)) return;\n const next = e.key === \"ArrowDown\" || e.key === \"ArrowRight\";\n const previous = e.key === \"ArrowUp\" || e.key === \"ArrowLeft\";\n if (!next && !previous) return;\n const target = e.target as Element;\n if (!target.closest?.(\".recharts-wrapper\")) return;\n e.preventDefault();\n e.stopPropagation();\n const View = target.ownerDocument.defaultView ?? window;\n const event = new View.KeyboardEvent(\"keydown\", { key: next ? \"ArrowLeft\" : \"ArrowRight\", bubbles: true, cancelable: true });\n REMAPPED.add(event);\n target.dispatchEvent(event);\n}\n\n/* ── The wrapper ────────────────────────────────────────────────────────── */\n\nexport interface ChartWrapperProps {\n /** The chart's own height prop. A ChartContainer's preset or number beats it. */\n height?: ChartHeight;\n /** How the chart sizes itself when no height is set. */\n size: ChartSize;\n /** The chart type, for `data-gs-chart` (the bench reads it). */\n chart: string;\n /** A cartesian category axis: its kind and its categories (`data-category-kind`, `data-categories`). */\n categoryKind?: \"names\" | \"scale\";\n categories?: number;\n /** Which axis carries the categories, for the label counts (`data-labels-shown`, `data-labels-cut`). */\n categoryAxis?: \"x\" | \"y\";\n /** The rows run top to bottom (a sideways BarChart): the arrow keys follow them. */\n sideways?: boolean;\n /** The value axis's title, drawn horizontally above the axis (the chart leaves room at the top). */\n axisTitle?: string;\n className?: string;\n children: ReactNode;\n \"aria-label\"?: string;\n}\n\n/**\n * Sprint 25.9, A2: the chart's frame and its size container. It holds the plot box (the Recharts drawing sits absolutely\n * inside it), the legend's slot below and the tooltip's live region, and owns the height, with or without a\n * ChartContainer. `min-inline-size` keeps a shrink-to-fit parent from collapsing it.\n */\nexport const ChartWrapper = forwardRef<HTMLDivElement, ChartWrapperProps>(function ChartWrapper({\n height = \"auto\",\n size,\n chart,\n categoryKind,\n categories,\n categoryAxis,\n sideways = false,\n axisTitle,\n className,\n children,\n \"aria-label\": ariaLabel,\n}, ref) {\n const container = useContext(ChartContainerContext);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const plotRef = useRef<HTMLDivElement | null>(null);\n const [legend, setLegend] = useState<HTMLDivElement | null>(null);\n const [live, setLive] = useState<HTMLDivElement | null>(null);\n const frame = useMemo<ChartFrame>(() => ({ legend, live }), [legend, live]);\n // The drawing never shrinks below the plot box's last real size. A box sized with `cqi` reports a width of 0 for a\n // moment while headless Chrome takes a full-page screenshot; handed to Recharts, that cleared the drawing, so the\n // screenshot showed an empty chart or bars growing again from zero (measured). A reading of 0 is no layout: the\n // drawing keeps its size, grows at once and shrinks a frame later.\n const [drawn, setDrawn] = useState<{ width: number; height: number } | null>(null);\n useLayoutEffect(() => {\n const plot = plotRef.current;\n if (!plot || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver((entries) => {\n const box = entries[entries.length - 1]?.contentRect;\n if (!box || box.width <= 0 || box.height <= 0) return;\n setDrawn((prev) => (prev && Math.abs(prev.width - box.width) < 0.5 && Math.abs(prev.height - box.height) < 0.5 ? prev : { width: box.width, height: box.height }));\n });\n observer.observe(plot);\n return () => observer.disconnect();\n }, []);\n\n const fill = container?.fillArea === true;\n const fixed = container?.height ?? fixedChartHeight(height);\n const plotStyle: CSSProperties = fill ? { flex: \"1 1 0%\", minHeight: 0 } : plotBoxStyle(size, fixed);\n\n // The graphic is named by the chart's own label, else by its container's title (A1).\n const named = ariaLabel\n ? { role: \"img\", \"aria-label\": ariaLabel }\n : container?.titleId\n ? { role: \"img\", \"aria-labelledby\": container.titleId }\n : {};\n\n // A8: how many category labels show, and how many were shortened, counted on the rendered ticks.\n useEffect(() => {\n const root = rootRef.current;\n const plot = plotRef.current;\n if (!root || !plot || !categoryAxis || typeof MutationObserver === \"undefined\") return;\n const selector = `.recharts-${categoryAxis}Axis-tick-labels .recharts-cartesian-axis-tick-value`;\n const count = () => {\n const labels = Array.from(plot.querySelectorAll(selector)).filter((el) => (el.textContent ?? \"\").trim() !== \"\");\n const shown = String(labels.length);\n const cut = String(labels.filter((el) => el.hasAttribute(\"data-cut\")).length);\n if (root.getAttribute(\"data-labels-shown\") !== shown) root.setAttribute(\"data-labels-shown\", shown);\n if (root.getAttribute(\"data-labels-cut\") !== cut) root.setAttribute(\"data-labels-cut\", cut);\n };\n count();\n const observer = new MutationObserver(count);\n observer.observe(plot, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: [\"data-cut\"] });\n return () => observer.disconnect();\n }, [categoryAxis]);\n\n return (\n <div\n ref={mergeRefs(ref as Ref<HTMLElement>, rootRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n data-gs-chart={chart}\n data-category-kind={categoryKind}\n data-categories={categories}\n className={cn(\"relative flex w-full flex-col\", fill && \"h-full\", className)}\n style={{ containerType: \"inline-size\", minInlineSize: \"min(100%, 16rem)\", ...(fill ? {} : { flex: \"1 0 auto\" }) }}\n >\n <div\n ref={plotRef}\n data-chart-plot=\"\"\n className=\"relative w-full\"\n style={plotStyle}\n onKeyDownCapture={sideways ? remapRowKeys : undefined}\n {...named}\n >\n {axisTitle && (\n <span data-chart-axis-title=\"\" className=\"absolute left-0 top-0 whitespace-nowrap text-xs text-[var(--ds-text-muted)] font-[family-name:var(--ds-font-sans)] leading-normal\">\n {axisTitle}\n </span>\n )}\n <div className=\"absolute inset-0\" style={drawn ? { minWidth: drawn.width, minHeight: drawn.height } : undefined}>\n <ChartFrameContext.Provider value={frame}>{children}</ChartFrameContext.Provider>\n </div>\n </div>\n <div ref={setLegend} data-chart-legend=\"\" />\n <div ref={setLive} role=\"status\" aria-live=\"polite\" className=\"sr-only\" />\n {/* the axis font and one row, as the page resolves them (useAxisMeasure reads it) */}\n <span\n data-chart-probe=\"\"\n aria-hidden=\"true\"\n className=\"pointer-events-none invisible absolute left-0 top-0\"\n style={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", height: CHART_ROW, width: 0 }}\n />\n </div>\n );\n});\n","import { useContext, useEffect, useLayoutEffect, useMemo, useState, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Legend, Text } from \"recharts\";\nimport { useResolvedToken } from \"../../lib/chart-utils\";\nimport { createAxisMeasurer, fitLabel, namesCutShort, type CategoryKind, type Measure } from \"../../lib/chart-categories\";\nimport { ChartFrameContext } from \"./ChartWrapper\";\n\ninterface TooltipEntry {\n name: string;\n value: number | string;\n color: string;\n dataKey?: string;\n payload?: Record<string, unknown>;\n}\n\ninterface ChartTooltipContentProps {\n active?: boolean;\n payload?: TooltipEntry[];\n label?: string;\n}\n\nconst hasLabel = (label: unknown) => label != null && label !== \"\" && typeof label !== \"number\";\n/**\n * A series' name. A chart without a category label (a pie's slice, a funnel's stage, a treemap's tile) names the item by\n * its row's `name`; on an axis chart the row's `name` is the category, already shown as the label, so the series keeps\n * its own (a row keyed by `name` read \"Alice: Alice 20\" instead of \"Alice: Hours 20\").\n */\nconst entryName = (entry: TooltipEntry, label: unknown) =>\n (!hasLabel(label) && typeof entry.payload?.name === \"string\" && entry.payload.name) || entry.name;\nconst entryValue = (entry: TooltipEntry) => (typeof entry.value === \"number\" ? entry.value.toLocaleString() : entry.value);\n\n/** What the live region says for the active point: its category, then each series' name and value. */\nexport function tooltipAnnouncement(label: unknown, payload: TooltipEntry[] | undefined): string {\n if (!payload?.length) return \"\";\n const values = payload.map((entry) => `${entryName(entry, label)} ${entryValue(entry)}`).join(\", \");\n return hasLabel(label) ? `${String(label)}: ${values}` : values;\n}\n\n/**\n * The chart's tooltip box. What it shows is also said in the chart's `role=\"status\"` `aria-live=\"polite\"` region, which\n * sits outside the drawing (a graphic's children are presentational) and starts empty, so the category and the values\n * are heard as the pointer or the arrow keys move (WCAG 4.1.3). Outside a library chart the region wraps the box.\n */\nexport function ChartTooltipContent({ active, payload, label }: ChartTooltipContentProps) {\n const bgSurface = useResolvedToken(\"--ds-bg-surface\");\n const borderSubtle = useResolvedToken(\"--ds-border-subtle\");\n const textPrimary = useResolvedToken(\"--ds-text-primary\");\n const textSecondary = useResolvedToken(\"--ds-text-secondary\");\n const { live } = useContext(ChartFrameContext);\n\n const on = !!active && !!payload?.length;\n const showLabel = hasLabel(label);\n\n const box = on ? (\n <div\n className=\"rounded-[var(--ds-radius-md)] shadow-[var(--ds-shadow-popover)] font-[family-name:var(--ds-font-sans)] text-sm\"\n style={{\n backgroundColor: bgSurface,\n border: `var(--ds-border-width) solid ${borderSubtle}`,\n padding: \"var(--ds-space-2) var(--ds-space-3)\",\n }}\n >\n {showLabel && (\n <p className=\"font-medium mb-ds-1\" style={{ color: textPrimary }}>\n {label}\n </p>\n )}\n {payload!.map((entry, i) => {\n const dotColor = (entry.payload?.fill as string) || entry.color || textSecondary;\n return (\n <div key={i} className=\"flex items-center gap-ds-2\" style={{ marginTop: i > 0 ? 2 : 0 }}>\n <span\n className=\"shrink-0 rounded-[var(--ds-radius-full)]\"\n style={{ width: 8, height: 8, backgroundColor: dotColor }}\n />\n <span style={{ color: textSecondary }}>{entryName(entry, label)}:</span>\n <span className=\"tabular-nums\" style={{ color: textPrimary }}>\n {entryValue(entry)}\n </span>\n </div>\n );\n })}\n </div>\n ) : null;\n\n if (live) {\n return (\n <>\n {box}\n {createPortal(on ? tooltipAnnouncement(label, payload) : \"\", live)}\n </>\n );\n }\n return (\n <div role=\"status\" aria-live=\"polite\">\n {box}\n </div>\n );\n}\n\ninterface ChartLegendContentProps {\n payload?: Array<{\n value: string;\n color: string;\n dataKey?: string;\n }>;\n}\n\n/** A legend entry's outline: the series' stroke when it has one (a soft bar's solid edge, a line), else its colour. */\nfunction swatchEdge(entry: { color?: string; payload?: unknown }): string | undefined {\n const stroke = (entry.payload as { stroke?: unknown } | undefined)?.stroke;\n return typeof stroke === \"string\" ? stroke : entry.color;\n}\n\nexport function ChartLegendContent({ payload }: ChartLegendContentProps) {\n const textSecondary = useResolvedToken(\"--ds-text-secondary\");\n\n if (!payload?.length) return null;\n\n return (\n <div className=\"flex flex-wrap justify-center gap-y-ds-1 gap-x-ds-4 font-[family-name:var(--ds-font-sans)] text-sm\">\n {payload.map((entry, i) => (\n <div key={i} className=\"flex items-center gap-ds-1.5\">\n <span\n className=\"shrink-0 rounded-[var(--ds-radius-full)]\"\n // the series' own fill inside its outline (a soft bar's solid stroke), so a 30% tint stays visible (C4)\n style={{ width: 10, height: 10, backgroundColor: entry.color, border: `1.5px solid ${swatchEdge(entry)}` }}\n />\n <span style={{ color: textSecondary }}>{entry.value}</span>\n </div>\n ))}\n </div>\n );\n}\n\n/** Legend items in the order the chart draws its series: by dataKey (bars, lines, areas, radars) or by name (a pie's slices). */\nexport function seriesSorter(order: ReadonlyArray<string>, by: \"dataKey\" | \"value\" = \"dataKey\") {\n return (item: { dataKey?: unknown; value?: unknown }) => {\n const key = by === \"dataKey\" ? item.dataKey : item.value;\n const i = order.indexOf(String(key));\n return i < 0 ? order.length : i;\n };\n}\n\n/**\n * Sprint 25.9, A2: the chart's legend is Recharts' own Legend portalled into the slot below the drawing, so it no longer\n * takes its height from the plot. It keeps ChartLegendContent and its swatch, and follows the series' order, not the\n * alphabet (Recharts' default `itemSorter: \"value\"`). Rendered once the slot exists, so it never lands in the drawing.\n */\nexport function ChartLegend({ order, by = \"dataKey\" }: { order: ReadonlyArray<string>; by?: \"dataKey\" | \"value\" }) {\n const { legend } = useContext(ChartFrameContext);\n const orderKey = order.join(\"\\u0001\");\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the order is compared by value\n const sorter = useMemo(() => seriesSorter(order, by), [orderKey, by]);\n if (!legend) return null;\n return <Legend portal={legend} content={<ChartLegendContent />} itemSorter={sorter} wrapperStyle={{ paddingTop: \"var(--ds-space-3)\" }} />;\n}\n\nexport function useGridStroke(): string {\n return useResolvedToken(\"--ds-border-subtle\");\n}\n\nexport function useAxisStyle() {\n const textMuted = useResolvedToken(\"--ds-text-muted\");\n\n return {\n tick: {\n fontSize: \"var(--ds-font-size-xs)\",\n fontFamily: \"var(--ds-font-sans)\",\n fill: textMuted,\n // Sprint 25.9: Recharts paints a default tick's text with the axis stroke (#666 unless set), not with fill, so the\n // value axes drew their numbers at about 2.6:1 on dark cards (WCAG 1.4.3 asks 4.5:1). Every axis that spreads this\n // hides its axis and tick lines, so the stroke only colours the text.\n stroke: textMuted,\n },\n };\n}\n\nexport function useRadius(): number {\n const val = useResolvedToken(\"--ds-radius-md\");\n const parsed = parseInt(val, 10);\n return isNaN(parsed) ? 6 : parsed;\n}\n/**\n * Recharts' `tick` prop as an object only passes SVG-valid properties.\n * Props like `maxLines`, `verticalAnchor` are stripped. We must use a\n * function to pass them to the internal Text component.\n */\nexport function xAxisTick(props: Record<string, unknown>) {\n // No width box (Sprint 25.3 C12): with one, Recharts measured \"20 Aug\" in a hidden span that did not carry the\n // chart's font, judged it too wide for its share of the axis and wrapped or truncated it. Without a width Text never\n // wraps or truncates; `interval` (preserveStartEnd) thins colliding ticks and keeps the first and last. Recharts' own\n // Text keeps the axis's auto height right, which a bare <text> does not (the label was clipped 8px in the pass).\n // Scale axes (dates, numbers) keep this tick; a names axis takes namesTick.\n const { x, y, payload, width: _width, visibleTicksCount: _count, ...rest } = props as {\n x: number; y: number; payload: { value: string };\n width?: number; visibleTicksCount?: number; [k: string]: unknown;\n };\n return (\n <Text {...rest} x={x} y={y} textAnchor=\"middle\" verticalAnchor=\"start\">\n {payload.value}\n </Text>\n );\n}\n\nexport function yAxisTick(props: Record<string, unknown>) {\n const { x, y, payload, ...rest } = props as { x: number; y: number; payload: { value: string };[k: string]: unknown };\n return (\n <Text {...rest} x={x} y={y} textAnchor=\"end\" verticalAnchor=\"middle\" width={200} maxLines={2}>\n {payload.value}\n </Text>\n );\n}\n\n/* ── Names on a category axis (Sprint 25.9, A3) ─────────────────────────── */\n\n/** The line height of a two-line name, in em. */\nconst LINE_EM = 1.2;\n/** The least space between two names under an upright chart. */\nexport const NAME_GAP = 8;\n/**\n * A sideways name's inset from its column: Recharts draws it tickSize + tickMargin (8 px) left of the axis edge, and\n * the chart's own margin leaves 4 px on the left.\n */\nexport const NAME_COLUMN_INSET = 12;\n\n/**\n * The tick for a names axis: each name fitted to its band — one line; else two lines split at a space; else \"…\" on\n * the second — inside one `<g className={props.className}>`, so Recharts sizes the axis for both lines (two Texts each\n * carrying the tick's class leave the axis sized for one, and the second line clipped). The full name is the label's\n * `<title>`. Upright, the band is the axis width over the ticks it draws; sideways it is the name column the chart sets.\n * Without a measurer (no canvas) every name shows in full on one line.\n */\nexport function namesTick(measure: Measure | null, orientation: \"x\" | \"y\", column?: number) {\n return function NamesTick(props: Record<string, unknown>) {\n const { x, y, payload, width, visibleTicksCount, className, fill, fontSize, fontFamily } = props as {\n x: number; y: number; payload?: { value?: unknown }; width?: number; visibleTicksCount?: number;\n className?: string; fill?: string; fontSize?: string | number; fontFamily?: string;\n };\n const name = String(payload?.value ?? \"\");\n const room = orientation === \"x\"\n ? (Number(width) || 0) / Math.max(1, Number(visibleTicksCount) || 1) - NAME_GAP\n : (column ?? (Number(width) || 0)) - NAME_COLUMN_INSET;\n const fit = fitLabel(name, room, measure);\n const text = { fill, fontSize, fontFamily, stroke: \"none\" };\n // upright: the first line's top at y (Recharts' verticalAnchor \"start\"); sideways: the lines centred on the row\n const firstDy = orientation === \"x\" ? 0.71 : 0.355 - ((fit.lines.length - 1) * LINE_EM) / 2;\n return (\n <g className={className} data-cut={fit.cut ? \"\" : undefined} data-lines={fit.lines.length}>\n <title>{name}</title>\n {fit.lines.map((line, i) => (\n <text key={i} x={x} y={y} dy={`${firstDy + i * LINE_EM}em`} textAnchor={orientation === \"x\" ? \"middle\" : \"end\"} {...text}>\n {line}\n </text>\n ))}\n </g>\n );\n };\n}\n\nexport type XAxisInterval = number | \"preserveStart\" | \"preserveEnd\" | \"preserveStartEnd\" | \"equidistantPreserveStart\";\n\nexport interface AxisMeasure {\n /** Text widths in the axis's resolved font, or null (no canvas: jsdom). */\n measure: Measure | null;\n /** The resolved axis font size, px. */\n px: number;\n /** One row of a row chart, px (--ds-chart-row as the page resolves it). */\n rowPx: number;\n /** The chart wrapper's width, px. */\n width: number;\n}\n\ntype FontSet = { ready: Promise<unknown>; addEventListener?: (t: string, f: () => void) => void; removeEventListener?: (t: string, f: () => void) => void };\n\n/**\n * The chart's measurer: the axis font read from the wrapper's probe (so `calc()` font tokens measure right), and the\n * wrapper's width. Re-read when the wrapper resizes and when web fonts land (the same font string then measures\n * differently, so the cache starts again).\n */\nexport function useAxisMeasure(ref: RefObject<HTMLDivElement | null>, enabled = true): AxisMeasure {\n const [state, setState] = useState<AxisMeasure>({ measure: null, px: 12, rowPx: 32, width: 0 });\n useLayoutEffect(() => {\n const el = ref.current;\n if (!enabled || !el) return;\n let live = true;\n let font = \"\";\n const update = (fresh = false) => {\n if (!live) return;\n const measured = el.clientWidth;\n const probe = el.querySelector<HTMLElement>(\"[data-chart-probe]\");\n const row = probe?.getBoundingClientRect().height ?? 0;\n const next = createAxisMeasurer(el);\n setState((prev) => {\n // no width is no layout (a hidden tab, or the moment headless Chrome takes a full-page screenshot): keep the last\n const width = measured > 0 ? measured : prev.width;\n const rowPx = row > 0 ? row : prev.rowPx;\n if (!next) return prev.width === width ? prev : { ...prev, width };\n if (!fresh && next.font === font && prev.measure && prev.width === width && prev.rowPx === rowPx) return prev;\n const keep = !fresh && next.font === font && prev.measure;\n font = next.font;\n return { measure: keep ? prev.measure : next.measure, px: next.px, rowPx, width };\n });\n };\n update(true);\n const ro = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(() => update()) : null;\n ro?.observe(el);\n const fonts = (typeof document !== \"undefined\" ? (document as Document & { fonts?: FontSet }).fonts : undefined);\n const landed = () => update(true);\n fonts?.ready.then(landed, () => {});\n fonts?.addEventListener?.(\"loadingdone\", landed);\n return () => {\n live = false;\n ro?.disconnect();\n fonts?.removeEventListener?.(\"loadingdone\", landed);\n };\n }, [ref, enabled]);\n return state;\n}\n\n/** The value axis's width on an upright chart, estimated from its widest tick label (Recharts rounds the top up). */\nexport function valueAxisWidth(values: number[], measure: Measure): number {\n const finite = values.filter(Number.isFinite);\n const max = finite.length ? Math.max(...finite.map(Math.abs)) : 0;\n const magnitude = max > 0 ? 10 ** Math.floor(Math.log10(max)) : 1;\n const top = Math.ceil(max / magnitude) * magnitude;\n const negative = finite.some((v) => v < 0) ? \"-\" : \"\";\n return Math.ceil(measure(`${negative}${top}`)) + 8;\n}\n\n/** How far the switch looks back before turning an automatic sideways chart upright again (no flip at the boundary). */\nconst SWITCH_HYSTERESIS = 32;\n\n/**\n * D8: an upright chart of names turns sideways when a name would be cut to fewer than six characters at the chart's\n * width, and back when there's room: it turns upright again only once names would also fit a little narrower, so a\n * scrollbar appearing does not flip it back. The last decision is kept as state (information from the previous render).\n */\nexport function useSidewaysSwitch(enabled: boolean, names: string[], m: AxisMeasure, axisWidth: number, sideMargins: number): boolean {\n const [turned, setTurned] = useState(false);\n const key = names.join(\"\\u0001\");\n const cut = useMemo(() => {\n if (!enabled || !m.measure || m.width <= 0 || names.length === 0) return { here: false, narrower: false };\n const cutAt = (width: number) => namesCutShort(names, (width - sideMargins - axisWidth) / names.length - NAME_GAP, m.measure!);\n return { here: cutAt(m.width), narrower: cutAt(m.width - SWITCH_HYSTERESIS) };\n // names are compared by value\n }, [enabled, key, m.measure, m.width, axisWidth, sideMargins]); // eslint-disable-line react-hooks/exhaustive-deps\n // sideways as soon as names are cut short here; upright only when they fit here and a little narrower (no flip-flop)\n const decision = turned ? cut.here || cut.narrower : cut.here;\n if (decision !== turned) setTurned(decision);\n return decision;\n}\n\n/** A sideways chart's name column: its widest name, at most a third of the chart's width. */\nexport function nameColumn(names: string[], m: AxisMeasure): number | undefined {\n if (!m.measure || m.width <= 0) return undefined;\n const widest = names.reduce((w, n) => Math.max(w, m.measure!(n.replace(/\\s+/g, \" \").trim())), 0);\n return Math.max(24, Math.min(Math.ceil(widest) + NAME_COLUMN_INSET, Math.floor(m.width / 3)));\n}\n\n/** How many names take two lines in a name column (each makes its row one line taller). */\nexport function twoLineNames(names: string[], column: number | undefined, m: AxisMeasure): number {\n if (!m.measure || column === undefined) return 0;\n return names.filter((n) => fitLabel(n, column - NAME_COLUMN_INSET, m.measure).lines.length > 1).length;\n}\n\n/** The widest label in the chart's own axis font (canvas measureText), or null where there is no canvas (jsdom). */\nfunction widestLabel(el: HTMLElement, labels: string[]): number | null {\n const measurer = createAxisMeasurer(el);\n if (!measurer) return null;\n return labels.reduce((w, l) => Math.max(w, measurer.measure(l)), 0);\n}\n\nconst TICK_GAP = 12; // the least space between two labels\nconst AXIS_RESERVE = 48; // the y-axis column and the chart's side margins\n\n/**\n * Sprint 25.4 C-11 (decision 7): the category ticks a chart shows. Recharts' preserveStartEnd thins colliding ticks\n * by its own measurement (without the chart's font) and keeps the last tick, so the labels fall unevenly (round 5:\n * 14 and 15 September missing). The chart measures its widest label with the resolved axis font, picks the step\n * that fits the axis width, and labels every step from the first category — the last only when it falls on the step.\n * Re-measured when the wrapper resizes and when the web fonts land. A numeric `override` (the chart's xAxisInterval\n * prop) is every Nth category and skips the measurement; the Recharts strings are treated as \"measured\" (round 13).\n *\n * Sprint 25.9, A3: this thinning is for dates and numbers only. A names axis (`kind` \"names\") is never thinned: every\n * name from the first render (interval 0, no explicit ticks, so duplicate names keep their own bands), each fitted to\n * its band by namesTick. The font is the axis font as the page resolves it (a probe), so `calc()` tokens measure right.\n */\nexport function useCategoryTicks(\n data: ReadonlyArray<Record<string, unknown>> | undefined,\n xAxisKey: string,\n ref: RefObject<HTMLDivElement | null>,\n override?: XAxisInterval,\n kind: CategoryKind = \"scale\",\n): { ticks?: string[]; interval: XAxisInterval; endMargin: number } {\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const labelsKey = labels.join(\"\\u0001\");\n const [ticks, setTicks] = useState<string[] | undefined>(undefined);\n // Half the widest label: the chart's right margin, so the last label (centred on the last point) is not clipped.\n const [endMargin, setEndMargin] = useState(4);\n // Only a number is an override (every Nth category). The Recharts strings — \"preserveStartEnd\" and friends — are the\n // thinning this hook replaced (round 13: a builder passed the old default by name and got uneven labels again), so\n // they mean \"measured\" too.\n const numeric = typeof override === \"number\" ? override : undefined;\n const names = kind === \"names\";\n useEffect(() => {\n const el = ref.current;\n if (names || numeric !== undefined || !el || labels.length === 0) return;\n let live = true;\n const compute = () => {\n if (!live) return;\n // no width is no layout (a hidden tab, or the moment headless Chrome takes a full-page screenshot): keep the last\n if (el.clientWidth <= 0) return;\n const widest = widestLabel(el, labels);\n const plot = el.clientWidth - AXIS_RESERVE;\n if (widest == null || plot <= 0) { setTicks(undefined); return; }\n setEndMargin(Math.max(4, Math.ceil(widest / 2)));\n const fits = Math.max(1, Math.floor(plot / (widest + TICK_GAP)));\n const step = Math.ceil(labels.length / fits);\n // every k-th label from the first, explicitly — an explicit list keeps Recharts from thinning on its own\n // measurement even when every label fits (round 5: \"16 Sep\" dropped at full width)\n setTicks(labels.filter((_, i) => i % step === 0));\n };\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(compute);\n ro.observe(el);\n const fonts = (document as Document & { fonts?: { ready: Promise<unknown> } }).fonts;\n fonts?.ready.then(compute, () => {});\n return () => { live = false; ro.disconnect(); };\n // labels are compared by value\n }, [labelsKey, numeric, names, ref]); // eslint-disable-line react-hooks/exhaustive-deps\n if (names) return { interval: 0, endMargin: 4 };\n if (numeric !== undefined) return { interval: numeric, endMargin: 4 };\n return ticks ? { ticks, interval: 0, endMargin } : { interval: \"preserveStartEnd\", endMargin: 4 };\n}\n","import { forwardRef, useMemo, useRef, type Ref } from \"react\";\nimport {\n BarChart as RechartsBarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Rectangle,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { categoryKind as guessCategoryKind } from \"../../lib/chart-categories\";\nimport {\n ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useRadius, xAxisTick, namesTick, useCategoryTicks,\n useAxisMeasure, useSidewaysSwitch, valueAxisWidth, nameColumn, twoLineNames, type XAxisInterval,\n} from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, CHART_ROW, markChart } from \"./ChartWrapper\";\n\nexport interface BarDef {\n dataKey: string;\n label?: string;\n soft?: boolean;\n /**\n * Bars with the same stackId stack into one column (Sprint 25.7, C4); a bar without one stands alone. BarChart's\n * `stacked` puts every bar without a stackId into one stack. The same field works in CompositeChart, where lines\n * draw over the stacks.\n */\n stackId?: string;\n}\n\n/** The stack a bar joins: its own stackId, else the one `stacked` makes for every bar. */\nexport function barStackOf(bar: BarDef, stacked: boolean): string | undefined {\n return bar.stackId ?? (stacked ? \"stack\" : undefined);\n}\n\n/** Some bar stacks. Its chart then stacks both ways from zero (stackOffset \"sign\"), so a negative series sits below it. */\nexport function anyStack(bars: BarDef[], stacked: boolean): boolean {\n return bars.some((bar) => barStackOf(bar, stacked) != null);\n}\n\n/** How many bars stand side by side in one category: one per stack, one per bar on its own. */\nexport function barGroups(bars: BarDef[], stacked: boolean): number {\n return Math.max(1, new Set(bars.map((bar, i) => barStackOf(bar, stacked) ?? `\\u0000${i}`)).size);\n}\n\n/**\n * The bar's shape: only the end segment of each stack is rounded, per column and per side of zero — the top of the\n * positive side, the bottom of the negative one — so a stack whose last series is zero in a column rounds the segment\n * that ends it there. A bar on its own rounds its end.\n */\nexport function barShape(bars: BarDef[], index: number, stacked: boolean, radius: number, horizontal = false) {\n const round: [number, number, number, number] = horizontal ? [0, radius, radius, 0] : [radius, radius, 0, 0];\n const square: [number, number, number, number] = [0, 0, 0, 0];\n const stack = barStackOf(bars[index], stacked);\n const above = stack == null ? [] : bars.filter((b, j) => j > index && barStackOf(b, stacked) === stack);\n // Recharts hands the shape the bar's geometry and its row of data; it draws a negative bar's rounded corners at its\n // far end itself\n const Shape = (props: unknown) => {\n const p = props as { payload?: Record<string, unknown> };\n const row = p.payload ?? {};\n const down = Number(row[bars[index].dataKey]) < 0;\n const onTop = above.every((b) => {\n const value = Number(row[b.dataKey]);\n return !(down ? value < 0 : value > 0);\n });\n return <Rectangle {...(props as object)} radius={onTop ? round : square} />;\n };\n return Shape;\n}\n\n/** The values the value axis must reach: each bar on its own, and each stack's total per category. */\nfunction valueExtent(data: Record<string, unknown>[], bars: BarDef[], stacked: boolean): number[] {\n return data.flatMap((row) => {\n const own: number[] = [];\n const stacks = new Map<string, number>();\n for (const bar of bars) {\n const v = Number(row[bar.dataKey]);\n if (!Number.isFinite(v)) continue;\n const stack = barStackOf(bar, stacked);\n if (stack == null) own.push(v);\n else stacks.set(stack, (stacks.get(stack) ?? 0) + v);\n }\n return [...own, ...stacks.values()];\n });\n}\n\n/** A title line's height, px, in the axis font. */\nconst titleLine = (px: number) => Math.ceil(px * 1.5) + 4;\n/** The same in CSS, for a row chart's height. */\nconst TITLE_LINE_CSS = \"calc(1.5 * var(--ds-font-size-xs) + 4px)\";\n\nexport interface BarChartProps {\n /**\n * Which category ticks show on an axis of dates or numbers. Leave it out: the chart measures its widest label with\n * the chart's font and labels every k-th category from the first, the last only when it falls on the step (Sprint\n * 25.4 C-11, decision 7). A number labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are\n * accepted for compatibility and mean the same measured labelling (round 13). A names axis is never thinned.\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n bars: BarDef[];\n xAxisKey: string;\n /**\n * \"auto\" (the default): the chart sizes itself — sideways, a row per category; upright, two wide to one high. A\n * preset or a number overrides it; inside a ChartContainer, the container's own height wins.\n */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n /** Every bar without a stackId joins one stack. */\n stacked?: boolean;\n /**\n * Bars running sideways, one row per category. Leave it out: an upright chart of names turns itself sideways when a\n * name would be cut to fewer than six characters, and back when there's room (D8). true or false forces either.\n */\n horizontal?: boolean;\n /**\n * What the categories are. \"names\" are never skipped: each wraps onto two lines, then ends with \"…\", with the full\n * name on hover. \"scale\" (dates, times, numbers) is labelled at an even step. Leave it out: guessed from the labels.\n */\n categoryKind?: \"names\" | \"scale\";\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /** The category axis's title, as drawn upright (below it). A sideways chart puts the category title above its names. */\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const BarChart = markChart(forwardRef<HTMLDivElement, BarChartProps>(function BarChart({\n data,\n bars,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n horizontal,\n categoryKind,\n showGrid = true,\n showTooltip = true,\n showLegend,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const kind = categoryKind ?? guessCategoryKind((data ?? []).map((d) => d[xAxisKey]));\n const names = kind === \"names\";\n const measured = useAxisMeasure(wrapperRef, (data?.length ?? 0) > 0);\n const axisWidth = useMemo(\n () => (measured.measure ? valueAxisWidth(valueExtent(data ?? [], bars, stacked), measured.measure) : 0),\n [measured.measure, data, bars, stacked],\n );\n const turned = useSidewaysSwitch(horizontal === undefined && names, labels, measured, axisWidth, 8);\n const sideways = horizontal ?? turned;\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, sideways || names ? \"names\" : \"scale\");\n const column = sideways ? nameColumn(labels, measured) : undefined;\n const upright = useMemo(() => namesTick(measured.measure, \"x\"), [measured.measure]);\n const rows = useMemo(() => namesTick(measured.measure, \"y\", column), [measured.measure, column]);\n const solidColors = useChartColors(bars.length, false);\n const softColors = useChartColors(bars.length, true);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n const legendVisible = showLegend ?? bars.length >= 2;\n\n // Axis titles follow their data: a chart that turned itself sideways moves the value title under the value axis and\n // the category title above the names. Every title is horizontal (Analysis Function; data_visualisation#22).\n const valueTitle = horizontal === true ? xAxisLabel : yAxisLabel;\n const categoryTitle = horizontal === true ? yAxisLabel : xAxisLabel;\n const topTitle = sideways ? categoryTitle : valueTitle;\n const bottomTitle = sideways ? valueTitle : categoryTitle;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const bottomLabel = bottomTitle ? { value: bottomTitle, position: \"insideBottom\" as const, offset: -2, style: axisLabelStyle } : undefined;\n\n const groups = barGroups(bars, stacked);\n const perCategory = 1 + 0.5 * (groups - 1);\n const titles = [topTitle, bottomTitle].filter(Boolean).length;\n const size = sideways\n ? {\n model: \"rows\" as const,\n units: labels.length * perCategory,\n lines: twoLineNames(labels, column, measured),\n axis: titles ? `calc(${CHART_ROW} + ${titles} * ${TITLE_LINE_CSS})` : CHART_ROW,\n }\n : { model: \"ratio\" as const };\n // bars keep their thickness when the chart grows in a row: the rows spread instead\n const maxBarSize = sideways ? Math.max(4, Math.round((measured.rowPx * perCategory * 0.7) / groups)) : undefined;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={size}\n chart=\"bar\"\n categoryKind={kind}\n categories={data.length}\n categoryAxis={sideways ? \"y\" : \"x\"}\n sideways={sideways}\n axisTitle={topTitle}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsBarChart\n data={data}\n layout={sideways ? \"vertical\" : \"horizontal\"}\n stackOffset={anyStack(bars, stacked) ? \"sign\" : undefined}\n // names are fitted to their bands, so nothing hangs past the last bar: 4 px, not a margin sized from them\n margin={{ top: 4 + (topTitle ? titleLine(measured.px) : 0), right: sideways || names ? 4 : xTicks.endMargin, bottom: 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && (\n <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} vertical={!sideways} horizontal />\n )}\n {sideways ? (\n <>\n <XAxis type=\"number\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" label={bottomLabel} />\n <YAxis\n dataKey={xAxisKey}\n type=\"category\"\n width={column ?? \"auto\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n interval={0}\n tick={rows}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={names ? upright : xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={bottomLabel}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n </>\n )}\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={{ fill: \"var(--ds-bg-muted)\", opacity: 0.5 }} />}\n {legendVisible && <ChartLegend order={bars.map((b) => b.dataKey)} />}\n {bars.map((bar, i) => (\n <Bar\n key={bar.dataKey}\n dataKey={bar.dataKey}\n name={bar.label ?? bar.dataKey}\n fill={bar.soft ? softColors[i] : solidColors[i]}\n // a soft fill is a 30% tint: the solid outline keeps the bar's edge at the colour's own contrast (WCAG 1.4.11)\n stroke={bar.soft ? solidColors[i] : undefined}\n strokeWidth={bar.soft ? 1 : undefined}\n shape={barShape(bars, i, stacked, radius, sideways)}\n stackId={barStackOf(bar, stacked)}\n maxBarSize={maxBarSize}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsBarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useRef, type Ref } from \"react\";\nimport {\n LineChart as RechartsLineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, xAxisTick, useCategoryTicks, useAxisMeasure, type XAxisInterval } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface LineDef {\n dataKey: string;\n label?: string;\n dashed?: boolean;\n}\n\nexport interface LineChartProps {\n /**\n * Which category ticks show. Leave it out: the chart measures its widest label with the chart's font and labels every\n * k-th category from the first, the last only when it falls on the step (Sprint 25.4 C-11, decision 7). A number\n * labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are accepted for compatibility and\n * mean the same measured labelling — they never hand the ticks back to Recharts' thinning (round 13).\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n lines: LineDef[];\n xAxisKey: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n curved?: boolean;\n showDots?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const LineChart = markChart(forwardRef<HTMLDivElement, LineChartProps>(function LineChart({\n data,\n lines,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n curved = true,\n showDots = false,\n showGrid = true,\n showTooltip = true,\n showLegend,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n // a line runs over a scale (dates, times, numbers): its labels are thinned at an even step, never fitted as names\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, \"scale\");\n const measured = useAxisMeasure(wrapperRef, !!yAxisLabel && (data?.length ?? 0) > 0);\n const colors = useChartColors(lines.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? lines.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const top = 4 + (yAxisLabel ? Math.ceil(measured.px * 1.5) + 4 : 0);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"line\"\n categoryKind=\"scale\"\n categories={data.length}\n categoryAxis=\"x\"\n axisTitle={yAxisLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsLineChart data={data} margin={{ top, right: xTicks.endMargin, bottom: 4, left: 4 }} accessibilityLayer>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={xAxisLabel ? { value: xAxisLabel, position: \"insideBottom\", offset: -2, style: axisLabelStyle } : undefined}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={lines.map((l) => l.dataKey)} />}\n {lines.map((line, i) => (\n <Line\n key={line.dataKey}\n type={curved ? \"monotone\" : \"linear\"}\n dataKey={line.dataKey}\n name={line.label ?? line.dataKey}\n stroke={colors[i]}\n strokeWidth={2}\n strokeDasharray={line.dashed ? \"5 5\" : undefined}\n dot={showDots}\n activeDot={{ r: 5, strokeWidth: 2 }}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsLineChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useId, useRef, type Ref } from \"react\";\nimport {\n AreaChart as RechartsAreaChart,\n Area,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, xAxisTick, useCategoryTicks, useAxisMeasure, type XAxisInterval } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface AreaDef {\n dataKey: string;\n label?: string;\n}\n\nexport interface AreaChartProps {\n /**\n * Which category ticks show. Leave it out: the chart measures its widest label with the chart's font and labels every\n * k-th category from the first, the last only when it falls on the step (Sprint 25.4 C-11, decision 7). A number\n * labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are accepted for compatibility and\n * mean the same measured labelling — they never hand the ticks back to Recharts' thinning (round 13).\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n areas: AreaDef[];\n xAxisKey: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n stacked?: boolean;\n curved?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n gradient?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const AreaChart = markChart(forwardRef<HTMLDivElement, AreaChartProps>(function AreaChart({\n data,\n areas,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n curved = true,\n showGrid = true,\n showTooltip = true,\n showLegend,\n gradient = true,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n // an area runs over a scale (dates, times, numbers): its labels are thinned at an even step, never fitted as names\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, \"scale\");\n const measured = useAxisMeasure(wrapperRef, !!yAxisLabel && (data?.length ?? 0) > 0);\n const instanceId = useId();\n const solidColors = useChartColors(areas.length, false);\n const softColors = useChartColors(areas.length, true);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? areas.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n const top = 4 + (yAxisLabel ? Math.ceil(measured.px * 1.5) + 4 : 0);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"area\"\n categoryKind=\"scale\"\n categories={data.length}\n categoryAxis=\"x\"\n axisTitle={yAxisLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsAreaChart data={data} margin={{ top, right: xTicks.endMargin, bottom: 4, left: 4 }} accessibilityLayer>\n <defs>\n {areas.map((area, i) => (\n <linearGradient key={area.dataKey} id={`gradient-${instanceId}-${area.dataKey}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={softColors[i]} stopOpacity={1} />\n <stop offset=\"95%\" stopColor={softColors[i]} stopOpacity={0.1} />\n </linearGradient>\n ))}\n </defs>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={xAxisTick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={xAxisLabel ? { value: xAxisLabel, position: \"insideBottom\", offset: -2, style: axisLabelStyle } : undefined}\n />\n <YAxis width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={areas.map((a) => a.dataKey)} />}\n {areas.map((area, i) => (\n <Area\n key={area.dataKey}\n type={curved ? \"monotone\" : \"linear\"}\n dataKey={area.dataKey}\n name={area.label ?? area.dataKey}\n stroke={solidColors[i]}\n strokeWidth={2}\n fill={gradient ? `url(#gradient-${instanceId}-${area.dataKey})` : softColors[i]}\n stackId={stacked ? \"stack\" : undefined}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsAreaChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n PieChart as RechartsPieChart,\n Pie,\n Cell,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface PieChartProps {\n data: { name: string; value: number; [key: string]: unknown }[];\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n donut?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n showLabels?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const PieChart = markChart(forwardRef<HTMLDivElement, PieChartProps>(function PieChart({\n data,\n height = \"auto\",\n donut = false,\n showTooltip = true,\n showLegend = true,\n showLabels = false,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const renderLabel = showLabels\n ? ({ percent }: { percent?: number }) => `${((percent ?? 0) * 100).toFixed(0)}%`\n : false;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"pie\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart accessibilityLayer>\n <Pie\n data={data}\n dataKey=\"value\"\n nameKey=\"name\"\n cx=\"50%\"\n cy=\"50%\"\n outerRadius=\"75%\"\n innerRadius={donut ? \"55%\" : 0}\n label={renderLabel}\n labelLine={showLabels}\n isAnimationActive={isAnimated}\n fontSize=\"var(--ds-font-size-xs)\"\n fontFamily=\"var(--ds-font-sans)\"\n >\n {data.map((_, i) => (\n <Cell key={i} fill={colors[i % colors.length]} />\n ))}\n </Pie>\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={data.map((d) => d.name)} by=\"value\" />}\n </RechartsPieChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useMemo, useRef, type Ref } from \"react\";\nimport {\n ComposedChart,\n Bar,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { categoryKind as guessCategoryKind } from \"../../lib/chart-categories\";\nimport {\n ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useRadius, xAxisTick, namesTick, useCategoryTicks,\n useAxisMeasure, useSidewaysSwitch, valueAxisWidth, nameColumn, twoLineNames, type XAxisInterval,\n} from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, CHART_ROW, markChart } from \"./ChartWrapper\";\nimport { anyStack, barGroups, barShape, barStackOf, type BarDef } from \"./BarChart\";\nimport type { LineDef } from \"./LineChart\";\n\nexport interface CompositeChartProps {\n /**\n * Which category ticks show on an axis of dates or numbers. Leave it out: the chart measures its widest label with\n * the chart's font and labels every k-th category from the first, the last only when it falls on the step (Sprint\n * 25.4 C-11, decision 7). A number labels every Nth category instead. The Recharts strings (\"preserveStartEnd\") are\n * accepted for compatibility and mean the same measured labelling (round 13). A names axis is never thinned.\n */\n xAxisInterval?: XAxisInterval;\n data: Record<string, unknown>[];\n bars: BarDef[];\n lines: LineDef[];\n xAxisKey: string;\n /**\n * \"auto\" (the default): two wide to one high; sideways, a row per category. A preset or a number overrides it; a\n * ChartContainer's own height wins.\n */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n /** Every bar without a stackId joins one stack; lines draw over it (Sprint 25.7, C4). A bar's stackId works too. */\n stacked?: boolean;\n /**\n * The lines on a second axis of their own, on the right, for a line whose unit differs from the bars'. Default: true\n * for bars side by side, false once the bars stack (`stacked` or a bar's stackId), so a capacity or a target line\n * reads against the stack's own scale. An explicit value wins.\n */\n dualAxis?: boolean;\n /**\n * What the categories are. \"names\" are never skipped: each wraps onto two lines, then ends with \"…\", with the full\n * name on hover. \"scale\" (dates, times, numbers) is labelled at an even step. Leave it out: guessed from the labels.\n */\n categoryKind?: \"names\" | \"scale\";\n /**\n * Bars running sideways, one row per category, with the lines crossing the rows. Leave it out: a chart of names turns\n * itself sideways when a name would be cut to fewer than six characters, and back when there's room (D8). true or\n * false forces either.\n */\n horizontal?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n xAxisLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yAxisLabel?: string;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const CompositeChart = markChart(forwardRef<HTMLDivElement, CompositeChartProps>(function CompositeChart({\n data,\n bars,\n lines,\n xAxisKey,\n xAxisInterval,\n height = \"auto\",\n stacked = false,\n dualAxis = !anyStack(bars, stacked),\n categoryKind,\n horizontal,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n xAxisLabel,\n yAxisLabel,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const labels = useMemo(() => (data ?? []).map((d) => String(d[xAxisKey] ?? \"\")), [data, xAxisKey]);\n const kind = categoryKind ?? guessCategoryKind((data ?? []).map((d) => d[xAxisKey]));\n const names = kind === \"names\";\n const measured = useAxisMeasure(wrapperRef, (data?.length ?? 0) > 0);\n // the bars' axis sets the left column's width; with a second axis the lines' ticks take the right edge\n const axisWidth = useMemo(() => {\n if (!measured.measure) return 0;\n const values = (data ?? []).flatMap((row) => {\n const stacks = new Map<string, number>();\n const own: number[] = [];\n for (const bar of bars) {\n const v = Number(row[bar.dataKey]);\n if (!Number.isFinite(v)) continue;\n const stack = barStackOf(bar, stacked);\n if (stack == null) own.push(v); else stacks.set(stack, (stacks.get(stack) ?? 0) + v);\n }\n return [...own, ...stacks.values(), ...(dualAxis ? [] : lines.map((l) => Number(row[l.dataKey])))];\n });\n const lineValues = (data ?? []).flatMap((row) => lines.map((l) => Number(row[l.dataKey])));\n return valueAxisWidth(values, measured.measure) + (dualAxis ? valueAxisWidth(lineValues, measured.measure) : 0);\n }, [measured.measure, data, bars, lines, stacked, dualAxis]);\n const turned = useSidewaysSwitch(horizontal === undefined && names, labels, measured, axisWidth, 8);\n const sideways = horizontal ?? turned;\n const xTicks = useCategoryTicks(data, xAxisKey, wrapperRef, xAxisInterval, sideways ? \"names\" : kind);\n const column = sideways ? nameColumn(labels, measured) : undefined;\n const tick = useMemo(() => (names ? namesTick(measured.measure, \"x\") : xAxisTick), [names, measured.measure]);\n const rows = useMemo(() => namesTick(measured.measure, \"y\", column), [measured.measure, column]);\n const barSoftColors = useChartColors(bars.length, true);\n const barSolidColors = useChartColors(bars.length, false);\n const lineColors = useChartColors(lines.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n // axis titles follow their data: sideways, the value title goes under the value axis, the category title above the names\n const topTitle = sideways ? xAxisLabel : yAxisLabel;\n const bottomTitle = sideways ? yAxisLabel : xAxisLabel;\n const bottomLabel = bottomTitle ? { value: bottomTitle, position: \"insideBottom\" as const, offset: -2, style: axisLabelStyle } : undefined;\n const top = 4 + (topTitle ? Math.ceil(measured.px * 1.5) + 4 : 0);\n const groups = barGroups(bars, stacked);\n const perCategory = 1 + 0.5 * (groups - 1);\n const titles = [topTitle, bottomTitle].filter(Boolean).length + (sideways && dualAxis ? 1 : 0);\n const size = sideways\n ? {\n model: \"rows\" as const,\n units: labels.length * perCategory,\n lines: twoLineNames(labels, column, measured),\n axis: titles ? `calc(${CHART_ROW} + ${titles} * calc(1.5 * var(--ds-font-size-xs) + 4px))` : CHART_ROW,\n }\n : { model: \"ratio\" as const };\n const maxBarSize = sideways ? Math.max(4, Math.round((measured.rowPx * perCategory * 0.7) / groups)) : undefined;\n // the bars read against the left (or bottom) axis; the lines against their own when dualAxis\n const barAxis = sideways ? { xAxisId: \"left\" } : { yAxisId: \"left\" };\n const lineAxis = sideways ? { xAxisId: dualAxis ? \"right\" : \"left\" } : { yAxisId: dualAxis ? \"right\" : \"left\" };\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={size}\n chart=\"composite\"\n categoryKind={kind}\n categories={data.length}\n categoryAxis={sideways ? \"y\" : \"x\"}\n sideways={sideways}\n axisTitle={topTitle}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <ComposedChart\n data={data}\n layout={sideways ? \"vertical\" : \"horizontal\"}\n stackOffset={anyStack(bars, stacked) ? \"sign\" : undefined}\n // names are fitted to their bands, so nothing hangs past the last bar\n margin={{ top, right: sideways || names ? 4 : xTicks.endMargin, bottom: 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} vertical={!sideways} horizontal />}\n {sideways ? (\n <>\n <XAxis xAxisId=\"left\" type=\"number\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" label={bottomLabel} />\n {dualAxis && <XAxis xAxisId=\"right\" type=\"number\" orientation=\"top\" {...axisStyle.tick} axisLine={false} tickLine={false} height=\"auto\" />}\n <YAxis\n dataKey={xAxisKey}\n type=\"category\"\n width={column ?? \"auto\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n interval={0}\n tick={rows}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xAxisKey}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n tick={tick}\n interval={xTicks.interval}\n ticks={xTicks.ticks}\n height=\"auto\"\n label={bottomLabel}\n />\n <YAxis yAxisId=\"left\" width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n {dualAxis && (\n <YAxis yAxisId=\"right\" orientation=\"right\" width=\"auto\" {...axisStyle.tick} axisLine={false} tickLine={false} />\n )}\n </>\n )}\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={[...bars.map((b) => b.dataKey), ...lines.map((l) => l.dataKey)]} />}\n {bars.map((bar, i) => (\n <Bar\n key={bar.dataKey}\n dataKey={bar.dataKey}\n name={bar.label ?? bar.dataKey}\n fill={barSoftColors[i]}\n // the soft fill is a 30% tint (1.3–1.4:1 on a dark card, Sprint 25.7 C4): the solid outline keeps the bar's\n // edge at the colour's own contrast against the card (WCAG 1.4.11), and separates stacked segments\n stroke={barSolidColors[i]}\n strokeWidth={1}\n shape={barShape(bars, i, stacked, radius, sideways)}\n stackId={barStackOf(bar, stacked)}\n maxBarSize={maxBarSize}\n {...barAxis}\n isAnimationActive={isAnimated}\n />\n ))}\n {lines.map((line, i) => (\n <Line\n key={line.dataKey}\n type=\"monotone\"\n dataKey={line.dataKey}\n name={line.label ?? line.dataKey}\n stroke={lineColors[i]}\n strokeWidth={2}\n strokeDasharray={line.dashed ? \"5 5\" : undefined}\n dot={false}\n {...lineAxis}\n isAnimationActive={isAnimated}\n />\n ))}\n </ComposedChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useRef, type Ref } from \"react\";\nimport {\n ScatterChart as RechartsScatterChart,\n Scatter,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n ZAxis,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend, useGridStroke, useAxisStyle, useAxisMeasure } from \"./ChartPrimitives\";\nimport { mergeRefs } from \"../../lib/slot\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface ScatterSeries {\n name: string;\n points: { x: number; y: number; z?: number }[];\n}\n\nexport interface ScatterChartProps {\n data: ScatterSeries[];\n xLabel?: string;\n /** The value axis's title, drawn horizontally above the axis. */\n yLabel?: string;\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const ScatterChart = markChart(forwardRef<HTMLDivElement, ScatterChartProps>(function ScatterChart({\n data,\n xLabel,\n yLabel,\n height = \"auto\",\n showGrid = true,\n showTooltip = true,\n showLegend,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const measured = useAxisMeasure(wrapperRef, !!yLabel && (data?.length ?? 0) > 0);\n const colors = useChartColors(data.length, false);\n const gridStroke = useGridStroke();\n const axisStyle = useAxisStyle();\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? data.length >= 2;\n const axisLabelStyle = { fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: axisStyle.tick.fill };\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper\n ref={mergeRefs(ref as Ref<HTMLElement>, wrapperRef as Ref<HTMLElement>) as Ref<HTMLDivElement>}\n height={height}\n size={{ model: \"ratio\" }}\n chart=\"scatter\"\n axisTitle={yLabel}\n className={className}\n aria-label={ariaLabel}\n >\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsScatterChart\n margin={{ top: 8 + (yLabel ? Math.ceil(measured.px * 1.5) + 4 : 0), right: 8, bottom: xLabel ? 20 : 4, left: 4 }}\n accessibilityLayer\n >\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" stroke={gridStroke} />}\n <XAxis\n type=\"number\"\n dataKey=\"x\"\n name={xLabel ?? \"x\"}\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n label={xLabel ? { value: xLabel, position: \"bottom\", offset: 0, style: { ...axisLabelStyle, textAnchor: \"middle\" } } : undefined}\n />\n <YAxis\n type=\"number\"\n dataKey=\"y\"\n name={yLabel ?? \"y\"}\n width=\"auto\"\n {...axisStyle.tick}\n axisLine={false}\n tickLine={false}\n />\n <ZAxis type=\"number\" dataKey=\"z\" range={[40, 400]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={data.map((s) => s.name)} by=\"value\" />}\n {data.map((series, i) => (\n <Scatter\n key={series.name}\n name={series.name}\n data={series.points}\n fill={colors[i]}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsScatterChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n RadarChart as RechartsRadarChart,\n Radar,\n PolarGrid,\n PolarAngleAxis,\n PolarRadiusAxis,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface RadarDataKey {\n key: string;\n label?: string;\n}\n\nexport interface RadarChartProps {\n data: Record<string, unknown>[];\n dataKeys: RadarDataKey[];\n axisKey: string;\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n filled?: boolean;\n showDots?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const RadarChart = markChart(forwardRef<HTMLDivElement, RadarChartProps>(function RadarChart({\n data,\n dataKeys,\n axisKey,\n height = \"auto\",\n filled = true,\n showDots = true,\n showTooltip = true,\n showLegend,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const solidColors = useChartColors(dataKeys.length, false);\n const softColors = useChartColors(dataKeys.length, true);\n const isAnimated = useChartAnimation(animated);\n const legendVisible = showLegend ?? dataKeys.length >= 2;\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"radar\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsRadarChart data={data} cx=\"50%\" cy=\"50%\" outerRadius=\"75%\" accessibilityLayer>\n <PolarGrid stroke=\"var(--ds-border-subtle)\" />\n <PolarAngleAxis\n dataKey={axisKey}\n tick={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: \"var(--ds-text-muted)\" }}\n />\n <PolarRadiusAxis\n tick={{ fontSize: \"var(--ds-font-size-xs)\", fontFamily: \"var(--ds-font-sans)\", fill: \"var(--ds-text-muted)\" }}\n axisLine={false}\n />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {legendVisible && <ChartLegend order={dataKeys.map((dk) => dk.key)} />}\n {dataKeys.map((dk, i) => (\n <Radar\n key={dk.key}\n name={dk.label ?? dk.key}\n dataKey={dk.key}\n stroke={solidColors[i]}\n fill={filled ? softColors[i] : \"transparent\"}\n strokeWidth={2}\n dot={showDots ? { r: 3, fill: solidColors[i] } : false}\n isAnimationActive={isAnimated}\n />\n ))}\n </RechartsRadarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n RadialBarChart as RechartsRadialBarChart,\n RadialBar,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, ChartLegend } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface RadialBarChartProps {\n data: { name: string; value: number; max?: number; [key: string]: unknown }[];\n /** \"auto\" (the default): square. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n showLegend?: boolean;\n showLabels?: boolean;\n startAngle?: number;\n endAngle?: number;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const RadialBarChart = markChart(forwardRef<HTMLDivElement, RadialBarChartProps>(function RadialBarChart({\n data,\n height = \"auto\",\n showTooltip = true,\n showLegend = true,\n showLabels = false,\n startAngle = 90,\n endAngle = -270,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const chartData = data.map((d, i) => ({\n ...d,\n fill: colors[i % colors.length],\n }));\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"square\" }} chart=\"radial-bar\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsRadialBarChart\n data={chartData}\n cx=\"50%\"\n cy=\"50%\"\n innerRadius=\"20%\"\n outerRadius=\"90%\"\n startAngle={startAngle}\n endAngle={endAngle}\n accessibilityLayer\n >\n <RadialBar\n dataKey=\"value\"\n background={{ fill: \"var(--ds-bg-muted)\" }}\n label={showLabels ? { position: \"insideStart\", fill: \"var(--ds-text-primary)\", fontSize: \"var(--ds-font-size-xs)\" } : false}\n isAnimationActive={isAnimated}\n />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend order={data.map((d) => d.name)} by=\"value\" />}\n </RechartsRadialBarChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n FunnelChart as RechartsFunnelChart,\n Funnel,\n Tooltip,\n LabelList,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\n/** A funnel stage takes a taller row than a sideways bar (Sprint 25.9, A2). */\nconst STAGE_ROWS = 1.5;\n\nexport interface FunnelChartProps {\n data: { name: string; value: number; [key: string]: unknown }[];\n /** \"auto\" (the default): a row per stage. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n /** Kept for compatibility: a funnel has no legend, its labels name the stages (Recharts gives it no legend entries). */\n showLegend?: boolean;\n showLabels?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const FunnelChart = markChart(forwardRef<HTMLDivElement, FunnelChartProps>(function FunnelChart({\n data,\n height = \"auto\",\n showTooltip = true,\n showLabels = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.length, false);\n const isAnimated = useChartAnimation(animated);\n\n const chartData = data.map((d, i) => ({\n ...d,\n fill: colors[i % colors.length],\n }));\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"rows\", units: data.length * STAGE_ROWS, axis: \"16px\" }} chart=\"funnel\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsFunnelChart accessibilityLayer>\n <Funnel dataKey=\"value\" data={chartData} isAnimationActive={isAnimated}>\n {showLabels && (\n <LabelList\n dataKey=\"name\"\n position=\"right\"\n fill=\"var(--ds-text-primary)\"\n fontSize=\"var(--ds-font-size-sm)\"\n fontFamily=\"var(--ds-font-sans)\"\n />\n )}\n </Funnel>\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </RechartsFunnelChart>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n Treemap,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent, useRadius } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface TreemapNode {\n name: string;\n value?: number;\n children?: TreemapNode[];\n [key: string]: unknown;\n}\n\nexport interface TreemapChartProps {\n data: TreemapNode[];\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\ninterface TreemapContentProps {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n name?: string;\n depth?: number;\n colors: string[];\n radius: number;\n index?: number;\n}\n\nfunction contrastColor(hex: string): string {\n const c = hex.replace(\"#\", \"\");\n if (c.length < 6) return \"#ffffff\";\n const r = parseInt(c.substring(0, 2), 16);\n const g = parseInt(c.substring(2, 4), 16);\n const b = parseInt(c.substring(4, 6), 16);\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return luminance > 0.55 ? \"#1f2937\" : \"#ffffff\";\n}\n\nfunction TreemapContent({ x = 0, y = 0, width = 0, height: h = 0, name, depth, colors, radius, index = 0 }: TreemapContentProps) {\n const fill = colors[index % colors.length];\n const showLabel = width > 40 && h > 20;\n const labelColor = contrastColor(fill);\n\n return (\n <g>\n <rect\n x={x}\n y={y}\n width={width}\n height={h}\n fill={fill}\n stroke=\"var(--ds-bg-surface)\"\n strokeWidth={2}\n rx={depth === 1 ? radius : 0}\n style={{ opacity: depth === 1 ? 1 : 0.85 }}\n />\n {showLabel && (\n <text\n x={x + width / 2}\n y={y + h / 2}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fill={labelColor}\n stroke=\"none\"\n fontSize=\"var(--ds-font-size-xs)\"\n fontFamily=\"var(--ds-font-sans)\"\n style={{ pointerEvents: \"none\" }}\n >\n {name}\n </text>\n )}\n </g>\n );\n}\n\nfunction addFillToNodes(nodes: TreemapNode[], colors: string[], counter = { i: 0 }): TreemapNode[] {\n return nodes.map((node) => {\n if (node.children) {\n return { ...node, children: addFillToNodes(node.children, colors, counter) };\n }\n const fill = colors[counter.i % colors.length];\n counter.i++;\n return { ...node, fill };\n });\n}\n\nexport const TreemapChart = markChart(forwardRef<HTMLDivElement, TreemapChartProps>(function TreemapChart({\n data,\n height = \"auto\",\n showTooltip = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(6, false);\n const isAnimated = useChartAnimation(animated);\n const radius = useRadius();\n\n const chartData = addFillToNodes(data, colors);\n\n if (!data?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"ratio\" }} chart=\"treemap\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <Treemap\n data={chartData}\n dataKey=\"value\"\n nameKey=\"name\"\n aspectRatio={4 / 3}\n stroke=\"var(--ds-bg-surface)\"\n isAnimationActive={isAnimated}\n content={<TreemapContent colors={colors} radius={radius} />}\n >\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </Treemap>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef } from \"react\";\nimport {\n Sankey as RechartsSankey,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport { useChartColors, useResolvedToken } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { ChartWrapper, markChart } from \"./ChartWrapper\";\n\nexport interface SankeyChartProps {\n data: {\n nodes: { name: string }[];\n links: { source: number; target: number; value: number }[];\n };\n /** \"auto\" (the default): two wide to one high. A preset or a number overrides it; a ChartContainer's own height wins. */\n height?: \"auto\" | \"sm\" | \"md\" | \"lg\" | number;\n showTooltip?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const SankeyChart = markChart(forwardRef<HTMLDivElement, SankeyChartProps>(function SankeyChart({\n data,\n height = \"auto\",\n showTooltip = true,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const colors = useChartColors(data.nodes.length, false);\n const linkStroke = useResolvedToken(\"--ds-border-subtle\");\n\n const nodesWithColor = data.nodes.map((node, i) => ({\n ...node,\n fill: colors[i % colors.length],\n }));\n\n const sankeyData = {\n nodes: nodesWithColor,\n links: data.links,\n };\n\n if (!data?.nodes?.length) return null;\n\n return (\n <ChartWrapper ref={ref} height={height} size={{ model: \"ratio\" }} chart=\"sankey\" className={className} aria-label={ariaLabel}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsSankey\n data={sankeyData}\n nodeWidth={10}\n nodePadding={24}\n margin={{ top: 8, right: 8, bottom: 8, left: 8 }}\n link={{ stroke: linkStroke, strokeOpacity: 0.4 }}\n >\n {showTooltip && <Tooltip content={<ChartTooltipContent />} />}\n </RechartsSankey>\n </ResponsiveContainer>\n </ChartWrapper>\n );\n}));\n","import { forwardRef, useId } from \"react\";\nimport {\n LineChart,\n Line,\n AreaChart,\n Area,\n BarChart,\n Bar,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { useResolvedToken, useChartAnimation } from \"../../lib/chart-utils\";\nimport { ChartTooltipContent } from \"./ChartPrimitives\";\nimport { useInsideChartContainer } from \"./ChartWrapper\";\n\nexport interface SparklineProps {\n data: number[];\n variant?: \"line\" | \"area\" | \"bar\";\n color?: 1 | 2 | 3 | 4 | 5 | 6;\n height?: number;\n width?: number | \"100%\";\n showTooltip?: boolean;\n curved?: boolean;\n animated?: boolean;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport const Sparkline = forwardRef<HTMLDivElement, SparklineProps>(function Sparkline({\n data,\n variant = \"line\",\n color = 1,\n height = 40,\n width = \"100%\",\n showTooltip = false,\n curved = true,\n animated,\n \"aria-label\": ariaLabel,\n className,\n}, ref) {\n const instanceId = useId();\n const isAnimated = useChartAnimation(animated);\n const insideContainer = useInsideChartContainer();\n\n const tokenName = `--ds-chart-${color}` as const;\n const softTokenName = `--ds-chart-${color}-soft` as const;\n const chartColor = useResolvedToken(tokenName);\n const softColor = useResolvedToken(softTokenName);\n const chartData = data.map((value, i) => ({ value, index: i }));\n\n const containerStyle = insideContainer\n ? { width: \"100%\", height: \"100%\" }\n : { width: typeof width === \"number\" ? `${width}px` : width, height: `${height}px` };\n\n if (!data?.length) return null;\n\n if (variant === \"bar\") {\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <BarChart data={chartData} margin={{ top: 0, right: 0, bottom: 0, left: 0 }}>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Bar\n dataKey=\"value\"\n fill={chartColor}\n radius={[2, 2, 0, 0]}\n isAnimationActive={isAnimated}\n />\n </BarChart>\n </ResponsiveContainer>\n </div>\n );\n }\n\n if (variant === \"area\") {\n const gradientId = `sparkline-gradient-${instanceId}-${color}`;\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <AreaChart data={chartData} margin={{ top: 2, right: 2, bottom: 2, left: 2 }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={softColor} stopOpacity={1} />\n <stop offset=\"95%\" stopColor={softColor} stopOpacity={0.1} />\n </linearGradient>\n </defs>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide domain={[\"dataMin - 1\", \"dataMax + 1\"]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Area\n type={curved ? \"monotone\" : \"linear\"}\n dataKey=\"value\"\n stroke={chartColor}\n strokeWidth={1.5}\n fill={`url(#${gradientId})`}\n dot={false}\n activeDot={showTooltip ? { r: 3, fill: chartColor } : false}\n isAnimationActive={isAnimated}\n />\n </AreaChart>\n </ResponsiveContainer>\n </div>\n );\n }\n\n return (\n <div ref={ref} style={containerStyle} className={className} {...(ariaLabel ? { role: \"img\", \"aria-label\": ariaLabel } : {})}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <LineChart data={chartData} margin={{ top: 2, right: 2, bottom: 2, left: 2 }}>\n <XAxis dataKey=\"index\" hide />\n <YAxis hide domain={[\"dataMin - 1\", \"dataMax + 1\"]} />\n {showTooltip && <Tooltip content={<ChartTooltipContent />} cursor={false} />}\n <Line\n type={curved ? \"monotone\" : \"linear\"}\n dataKey=\"value\"\n stroke={chartColor}\n strokeWidth={1.5}\n dot={false}\n activeDot={showTooltip ? { r: 3, fill: chartColor } : false}\n isAnimationActive={isAnimated}\n />\n </LineChart>\n </ResponsiveContainer>\n </div>\n );\n});\n","import { useId, useMemo, type ReactNode } from \"react\";\nimport { cn, GLASS_SURFACE } from \"../lib/utils\";\nimport { TITLE_TEXT } from \"../lib/title-text\";\nimport { Skeleton } from \"./Skeleton\";\nimport { CHART_HEIGHTS, ChartContainerContext, fixedChartHeight, isLibraryChart, type ChartContainerValue } from \"./charts/ChartWrapper\";\n\n/**\n * CardTitle's classes (Card.tsx) without its line clamp: a chart's title states its insight, its message\n * (data_visualisation#3), so it is never cut. Kept equal to CardTitle's by a test.\n */\nexport const CHART_TITLE_CLASSES = TITLE_TEXT;\n\nexport interface ChartContainerProps {\n /**\n * \"auto\" (the default): the chart sizes itself from its type and its data (Sprint 25.9, A2) — a row per item for\n * sideways bars and funnels, two wide to one high for charts over dates or numbers, square for round charts — and in\n * a row its frame matches the tallest block while the chart grows only to its bound. \"fill\" means the same as \"auto\".\n * A preset (sm, md, lg) or a number of px sets this chart's height instead, and beats the chart's own.\n */\n height?: \"auto\" | \"fill\" | \"sm\" | \"md\" | \"lg\" | number;\n /** The insight, as a heading (h3) in the card-title style, never cut. The chart's graphic is named by it. */\n title?: string;\n loading?: boolean;\n emptyState?: ReactNode;\n /** \"default\" is a card surface. \"ghost\" drops surface, border, shadow and padding for charts embedded in another container. */\n variant?: \"default\" | \"ghost\";\n children: ReactNode;\n className?: string;\n}\n\nexport function ChartContainer({\n height = \"auto\",\n title,\n loading = false,\n emptyState,\n variant = \"default\",\n children,\n className,\n}: ChartContainerProps) {\n const titleId = useId();\n const fixed = fixedChartHeight(height);\n // A library chart sizes itself (its mark). Anything else — a hand-built chart, an EmptyState, a Sparkline, several\n // children — keeps an area of the preset's height, else md, and fills it.\n const sizesItself = !loading && !!children && isLibraryChart(children);\n const area = fixed ?? CHART_HEIGHTS.md;\n const context = useMemo<ChartContainerValue>(\n () => ({ height: fixed, titleId: title ? titleId : undefined, fillArea: !sizesItself }),\n [fixed, title, titleId, sizesItself],\n );\n\n let body: ReactNode = null;\n if (loading) {\n body = (\n <div className=\"absolute inset-0 flex flex-col justify-end gap-ds-2 px-ds-2\">\n <div className=\"flex items-end h-full gap-ds-1\">\n {[65, 40, 80, 55, 72, 45, 60].map((h, i) => (\n <Skeleton key={i} variant=\"custom\" className=\"flex-1\" height={`${h}%`} />\n ))}\n </div>\n <Skeleton variant=\"text\" lines={1} className=\"w-full\" />\n </div>\n );\n } else if (children) {\n body = (\n <ChartContainerContext.Provider value={context}>\n {sizesItself ? children : (\n // the area is absolute, so a child that fills 100% has a definite height to fill\n <div className=\"absolute inset-0\">\n <div className=\"h-full w-full\">{children}</div>\n </div>\n )}\n </ChartContainerContext.Provider>\n );\n } else if (emptyState) {\n body = <div className=\"flex flex-1 items-center justify-center\">{emptyState}</div>;\n }\n\n return (\n <div\n data-card=\"\"\n data-gs=\"chart\"\n className={cn(\n \"flex flex-col\",\n variant === \"ghost\"\n ? \"bg-transparent\"\n : cn(\n // CardHeader's inset, so titles inside frames line up in a row (A1)\n \"rounded-[var(--ds-radius-md)] px-ds-5 py-ds-4\",\n \"bg-[var(--ds-bg-surface)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n GLASS_SURFACE,\n ),\n className,\n )}\n >\n {title && (\n <h3 id={titleId} className={cn(CHART_TITLE_CLASSES, \"mb-ds-4\")}>\n {title}\n </h3>\n )}\n <div\n data-chart-body=\"\"\n className=\"relative flex min-w-0 flex-col\"\n style={{ flex: \"1 1 0%\", minHeight: sizesItself ? undefined : area }}\n >\n {body}\n </div>\n </div>\n );\n}\n"]}