basalt-ui 2.26.0 → 2.27.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 (51) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/MIGRATING.md +87 -12
  3. package/dist/charts/Bars.d.ts.map +1 -1
  4. package/dist/charts/Bars.js +37 -1
  5. package/dist/charts/ChartCard.d.ts +8 -2
  6. package/dist/charts/ChartCard.d.ts.map +1 -1
  7. package/dist/charts/ChartCard.js +2 -0
  8. package/dist/charts/Sparkline.d.ts.map +1 -1
  9. package/dist/charts/Sparkline.js +48 -10
  10. package/dist/charts/chart-box.module.css +76 -1
  11. package/dist/charts/chart-box.module.css.d.ts +1 -0
  12. package/dist/charts/chart-legend.module.css +0 -14
  13. package/dist/charts/compile.d.ts +20 -0
  14. package/dist/charts/compile.d.ts.map +1 -1
  15. package/dist/charts/compile.js +82 -12
  16. package/dist/charts/legend.d.ts.map +1 -1
  17. package/dist/charts/legend.js +37 -87
  18. package/dist/charts/state.d.ts +7 -0
  19. package/dist/charts/state.d.ts.map +1 -1
  20. package/dist/charts/state.js +14 -3
  21. package/dist/cli/shot/capture.d.ts +32 -3
  22. package/dist/cli/shot/capture.d.ts.map +1 -1
  23. package/dist/cli/shot/capture.js +17 -7
  24. package/dist/dashboard/meter-model.d.ts +17 -3
  25. package/dist/dashboard/meter-model.d.ts.map +1 -1
  26. package/dist/dashboard/meter-model.js +69 -19
  27. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  28. package/dist/dashboard/meter-parts.js +28 -12
  29. package/dist/dashboard/meter.module.css +12 -1
  30. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  31. package/dist/dashboard/stat-strip.js +89 -21
  32. package/dist/dashboard/stat-strip.module.css +13 -3
  33. package/dist/dashboard/stat-strip.module.css.d.ts +1 -0
  34. package/llms.txt +3 -2
  35. package/package.json +1 -1
  36. package/src/charts/Bars.tsx +50 -2
  37. package/src/charts/ChartCard.tsx +9 -1
  38. package/src/charts/Sparkline.tsx +67 -9
  39. package/src/charts/chart-box.module.css +76 -1
  40. package/src/charts/chart-box.module.css.d.ts +1 -0
  41. package/src/charts/chart-legend.module.css +0 -14
  42. package/src/charts/compile.ts +129 -18
  43. package/src/charts/legend.tsx +10 -74
  44. package/src/charts/state.tsx +30 -5
  45. package/src/cli/shot/capture.ts +25 -9
  46. package/src/dashboard/meter-model.ts +122 -31
  47. package/src/dashboard/meter-parts.tsx +53 -19
  48. package/src/dashboard/meter.module.css +12 -1
  49. package/src/dashboard/stat-strip.module.css +13 -3
  50. package/src/dashboard/stat-strip.module.css.d.ts +1 -0
  51. package/src/dashboard/stat-strip.tsx +113 -25
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [2.27.0](https://github.com/jkrumm/basalt-ui/compare/v2.26.0...v2.27.0) (2026-10-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * card facts gate by state, line and counted pending ghosts ([dcf6a5b](https://github.com/jkrumm/basalt-ui/commit/dcf6a5bcf77a9b10d530205ecbccd9755b726f93))
7
+ * ghost the S2 and S4 charts; cover the goal card ([955f1ab](https://github.com/jkrumm/basalt-ui/commit/955f1ab821d4935f6ab0765c1cf3b08b9d61941f))
8
+ * keep chart tooltips and slotted readouts inside their card ([0346925](https://github.com/jkrumm/basalt-ui/commit/0346925c0989dfbb386d1bc9c34ddab2876417f2))
9
+ * list and Meter cards take loading and empty state ([0296c2d](https://github.com/jkrumm/basalt-ui/commit/0296c2d4086acf33c4cef6c1db37604e60cc3e9e))
10
+ * load the meter and composition cards in their own shape ([112c07c](https://github.com/jkrumm/basalt-ui/commit/112c07ca99f700878350c999696a09d5c14a276f))
11
+ * meter captions drop at 390 instead of taking a second row ([10c1e48](https://github.com/jkrumm/basalt-ui/commit/10c1e48370e2fc471e59d6b90baa7122f319f2f5))
12
+ * pin the facts misuse, inline ghost union, before/now note ([2ea2af8](https://github.com/jkrumm/basalt-ui/commit/2ea2af8d42b7645e19d5dc4e365ca9d8606a2d0d))
13
+ * shot re-measures a crop and fails loud when it is empty ([74b6508](https://github.com/jkrumm/basalt-ui/commit/74b6508ad06731ccab8317481559edf71ecb677a))
14
+ * state each r3 figure and remedy once in S2–S4 ([f5f05d6](https://github.com/jkrumm/basalt-ui/commit/f5f05d6b78641c07585a3cda29d28f8a5f44cd19))
15
+ * strip visuals level on the drawn mark ([99f3ffc](https://github.com/jkrumm/basalt-ui/commit/99f3ffcfd65b585f483d187d865cb83cf9075b8d))
16
+ * the components table card ends at its error body ([3b40b3b](https://github.com/jkrumm/basalt-ui/commit/3b40b3b4e465cfaa81799e7ef1135b35a99dcef0))
17
+
18
+
19
+ ### Features
20
+
21
+ * compact legends never leave a key told apart by hue alone ([c314b43](https://github.com/jkrumm/basalt-ui/commit/c314b43584c7aa5526f258829ccd44da5d024ef7))
22
+ * meter labels never lost at 390, a gap between zone names ([afad8fb](https://github.com/jkrumm/basalt-ui/commit/afad8fbb794d4446586079b59cf6ea5134032b5c))
23
+ * one strip cell anatomy, visuals on a shared line ([8037453](https://github.com/jkrumm/basalt-ui/commit/803745335e527bdb1d37f4fab97fa55c58b8755c))
24
+
1
25
  # [2.26.0](https://github.com/jkrumm/basalt-ui/compare/v2.25.0...v2.26.0) (2026-10-19)
2
26
 
3
27
 
package/MIGRATING.md CHANGED
@@ -66,18 +66,18 @@ There is one row per SURFACE, not per export, and a surface earns a row once any
66
66
  shipped lefthook preset both changed in 1.30.0 with no row that owned them — which is how a
67
67
  consumer read this index, found nothing, and diffed a KPI row that had silently gone 4-up → 2-up.
68
68
 
69
- | Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 2.13.3 | 2.14.0 | 2.15.0 | 2.16.0 | 2.17.0 | 2.18.0 | 2.19.0 | 2.20.0 | 2.21.0 | 2.22.0 | 2.23.0 | 2.24.0 | 2.25.0 | 2.26.0 | Unreleased |
70
- | ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
71
- | **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | spacing, radius, type and the dense tier (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — |
72
- | **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `Lines` linear curve, `naming`, no lone-series legend, locale tooltip header, y gutter, `RefLine.labelPosition`, `StackedArea.fillOpacity` (§ Chart chrome) | — | error fallback `The request failed.` (§ State defaults) | — | — | — |
73
- | **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | expanded gutter 24 (§ 2.16.0) | — | — | light/outline Buttons ink, no status edges (§ 2.19.0) | — | — | — | — | — | — | — | — |
74
- | **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | dense 28 tier at a fine pointer (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — |
75
- | **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
76
- | **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltDataTable` error title `Could not load rows` (§ State defaults) | — | — | — |
77
- | **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | card inset 12/16, `kpi` 22 / 500 (§ 2.16.0) | — | — | StatCard status dot, Meter/BarList refinements (§ 2.19.0) | — | plain `Meter` value bar fill muted (`tone="ink"` to opt out); `BarList` default `thin`, `variant="default"` → `inline` (§ 2.21.0) | — | — | `LoadingState` section skeleton, page spinner neutral (§ State defaults) | — | — | — |
78
- | **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
79
- | **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
80
- | **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | `inline-spacing` steps, `card-inset` accepts both pairs (§ 2.16.0) | — | — | — | — | `series-palette` at `warn` (§ 2.21.0) | — | `series-palette` → `error` (§ Guards) | `raw-spacing`, `inline-spacing` → `error` (§ Guards) | — | `basalt/card-inset` → `error` (§ Guards) | — |
69
+ | Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 2.13.3 | 2.14.0 | 2.15.0 | 2.16.0 | 2.17.0 | 2.18.0 | 2.19.0 | 2.20.0 | 2.21.0 | 2.22.0 | 2.23.0 | 2.24.0 | 2.25.0 | 2.26.0 | 2.27.0 | Unreleased |
70
+ | ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
71
+ | **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | spacing, radius, type and the dense tier (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — |
72
+ | **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `Lines` linear curve, `naming`, no lone-series legend, locale tooltip header, y gutter, `RefLine.labelPosition`, `StackedArea.fillOpacity` (§ Chart chrome) | — | error fallback `The request failed.` (§ State defaults) | — | — | — | — |
73
+ | **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | expanded gutter 24 (§ 2.16.0) | — | — | light/outline Buttons ink, no status edges (§ 2.19.0) | — | — | — | — | — | — | — | — | — |
74
+ | **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | dense 28 tier at a fine pointer (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — |
75
+ | **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
76
+ | **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltDataTable` error title `Could not load rows` (§ State defaults) | — | — | — | — |
77
+ | **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | card inset 12/16, `kpi` 22 / 500 (§ 2.16.0) | — | — | StatCard status dot, Meter/BarList refinements (§ 2.19.0) | — | plain `Meter` value bar fill muted (`tone="ink"` to opt out); `BarList` default `thin`, `variant="default"` → `inline` (§ 2.21.0) | — | — | `LoadingState` section skeleton, page spinner neutral (§ State defaults) | — | — | — | — |
78
+ | **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
79
+ | **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
80
+ | **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | `inline-spacing` steps, `card-inset` accepts both pairs (§ 2.16.0) | — | — | — | — | `series-palette` at `warn` (§ 2.21.0) | — | `series-palette` → `error` (§ Guards) | `raw-spacing`, `inline-spacing` → `error` (§ Guards) | — | `basalt/card-inset` → `error` (§ Guards) | — | — |
81
81
 
82
82
  ---
83
83
 
@@ -1046,6 +1046,81 @@ The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an imp
1046
1046
  _Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
1047
1047
  release renames it and opens a new one here._
1048
1048
 
1049
+ ## 2.27.0 — Wave 38 card facts, Wave 39 argo's friction IV
1050
+
1051
+ ### Card facts and the pending ghost (Wave 38)
1052
+
1053
+ No export is removed. `ChartCard` learns a pending plot's shape and documents the state contract.
1054
+
1055
+ - **Facts show only at rest.** A card's `facts` and basis `subtitle` render when `state` resolves to ready; pending draws the facts skeleton, empty and error draw neither, in every `placeholderHeight` mode. The card knows a state only through its `state` prop. Opt-out: omit `facts` to keep a card state-agnostic.
1056
+
1057
+ | Before | Now |
1058
+ | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
1059
+ | Facts render above the body's own loading or empty line (`Meter loading`, `BarList emptyText`) | Also pass `state={{ pending: true }}` / `state={{ empty }}` to the card; the facts hide or skeleton |
1060
+
1061
+ - **`ChartCard ghost`** (new optional prop): `'bars'` (default), `'line'` for a line or area chart, or a number for the bar count when the loaded data length is known. Opt-out: omit it for the previous eight-bar ghost.
1062
+
1063
+ ### Compact legends name every key (Wave 39)
1064
+
1065
+ No export changes. Below 480px the legend no longer folds zone / reference entries into `+N`: every entry is named at every width, the row wraps between entries (series, then overlays, then references) and an entry never wraps mid-label. `foldLegend`, `--bc-fold` and the `+N` element are deleted (a deliberate reversal of the Wave 38 reference fold).
1066
+
1067
+ | Before | Now |
1068
+ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
1069
+ | At 390, `role: 'reference'` entries (zone keys, reference lines) fold into `+2: …` while wrapped | Every entry shows; the row takes the extra lines |
1070
+ | `[data-legend-more]` / `[data-legend-folded]` exist in the legend markup | Gone: drop any selector or test that reads them |
1071
+
1072
+ Opt-out: `legend: false` (still absolute), or remove the legend-only entries (a zone's `legend`, a refLine's `legend`) you do not want named.
1073
+
1074
+ ### One strip cell anatomy (Wave 39)
1075
+
1076
+ No export is added or removed. A `StatGroup variant="strip"` cell is now a head (caption line, qualifier, value row) over its readings, and a row's visuals share one drawn top.
1077
+
1078
+ | Before | Now |
1079
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1080
+ | A Meter, a Sparkline and Bars in one row sat at different heights (a wrapped qualifier, a delta, the Sparkline's readout line). | The visuals of one row put their drawn top on one line: a visual cell with a shorter head grows its head's `min-height`. A longer qualifier still pushes only its own value down (D40). |
1081
+ | A cell without a visual, a footer `under` and the odd-count phone rule were untouched by a sibling's height. | Unchanged: only cells that have a `visual` are levelled, so a footer still hugs its value and no sibling is stretched. |
1082
+ | A `rows` entry's `visual` had no host: a zoned `Meter` in a row printed its reading at the marker, and a Sparkline readout stacked over its own plotted line. | A row visual is hosted like the cell visual. A zoned `Meter` in a row no longer repeats the row's value at its marker; a Sparkline's hover chip sits above its plot, never over it. Row height is unchanged: a Sparkline row keeps the slot padding it always had. |
1083
+
1084
+ Opt-outs: none for the levelling (it only ever adds head height to a visual cell); omit `visual` on a cell to keep it out. A zoned row `Meter` keeps its marker reading with `reading` set on the `Meter` (the prop overrides the host).
1085
+
1086
+ ### Meter labels at 390 (Wave 39)
1087
+
1088
+ No export is removed. A `Meter` zone name or tick label no longer drops for width. A zone name is tried in this order: its full name on the first label row (the names beside it, the holding one included, slide inside their spans to make room, each keeping the gap step), its full name on a **second label row** directly under the first, its `short` on the first row, its `short` on the second, then hidden. A tick label takes the second row before it hides. A second-row label is centred on its span or mark, clamped inside the track, and keeps the gap step from the other labels on that row. The row exists only while a label stands on it; a Meter whose labels all fit keeps its single `1.25em` row and its loading skeleton. The caption row (start figure, tick captions, pace/forecast) keeps its drop order.
1089
+
1090
+ | Before | Now |
1091
+ | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
1092
+ | A zone name too wide for its span (and its `short`) was hidden: argo's Garmin ACWR meter lost `Caution` at 390 | `Caution` stands on a second row; the other names stay on the first |
1093
+ | Zone names only had to not touch: `OptimalCaution Danger` | Adjacent names keep the gap step; at 1440 (a 203 px cell) all four ACWR names stay full on ONE row, the holding name sliding left |
1094
+ | A name that did not fit fell back to its `short` on the first row, and every sibling's `short` followed | The full name goes on the second row first; the `short` register only starts when no full name can hold either row |
1095
+ | A tick label wider than the room beside its mark, or one touching another label, was hidden | It is shifted inside the track, or stands on the second row (argo's `abandoned at 7 d` at any cell width and reading) |
1096
+
1097
+ Opt-out: give the zone a `short` that fits its span (it is used once the full name holds neither row), or drop the tick's `label` (the mark stays, named in the described-by text). A Meter that needs no second row renders as before. One that now shows a second row is one line (`1.25em`) taller at that width: a card or strip cell that pins the Meter's height should not. At 115 px of track argo's four ACWR zones all show (one a `short` or on the second row); below that the last label hides and stays in the described-by text.
1098
+
1099
+ ### Tooltips and readouts inside the card (Wave 39)
1100
+
1101
+ No export is removed or added; four defaults move.
1102
+
1103
+ - **A chart tooltip stays inside its card on both axes.** A tooltip taller than the room above its anchor used to cross the card's top (over the section heading); it now flips to the other side of its anchor, slides in when neither side fits, and only a tooltip taller than the card overflows, aligned to the card's top. In a card at least 192px wide it also grows to its content, up to the card's width, before a label wraps. Narrower cards (a ~120px strip cell) keep the engine's width and horizontal placement. Opt-out: render the chart outside a `ChartCard`, strip cell or `StatCard` (no card ancestor keeps the engine's viewport placement).
1104
+
1105
+ | Before | Now |
1106
+ | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
1107
+ | A tall tooltip crossed the card top; its width was the room right of `left` | It flips or slides inside the card, and is as wide as its content (up to the card) |
1108
+
1109
+ - **A slotted `Bars` tooltip is the one-line chip.** A `Bars` in a `StatCard` slot or a strip cell opened the engine's titled panel below the plot, hanging out of a cell that sat at the card floor. It keeps the engine's tooltip (hit-test, accessible text, rows) but renders it as the hosted Sparkline's chip: the first row's figure, then the header (`48 pages/h · Mistborn`), one line high (`--basalt-spark-readout-h`), anchored flush above the plot in the line the cell reserves, centred on the bin and held inside the cell; an overlong header ends in an ellipsis. Further rows are hidden in a slot (a chart that needs them belongs in a `ChartCard`). A bin that sums to zero draws no bar, so a baseline marker shows which bin the chip names while it is hovered. Opt-out: render the `Bars` outside the slot to get the card tooltip.
1110
+
1111
+ | Before | Now |
1112
+ | --------------------------------------------------------- | ------------------------------------------------------------------ |
1113
+ | Titled panel under the plot, ~18px below the card at 390 | One-line chip in the reserved line above the plot, inside the cell |
1114
+ | A zero bin: the readout named it, nothing in the plot did | A baseline marker on the hovered empty bin |
1115
+
1116
+ - **Tooltip labels wrap between words.** A label no longer breaks inside a token (`Load (7)` was `Load` / `7)`, `TE 2.1/0.4` could split mid-figure); a single token wider than the card overflows it. Opt-out: `.ts-chart-tooltip__row > span:nth-child(2) { overflow-wrap: anywhere }` in the app's CSS.
1117
+
1118
+ - **A short bare `Sparkline` keeps the one-line readout inside its box.** A line `Sparkline` under 36px outside a `StatCard` slot or a hosted strip visual used to put its chip beside the point (over the line) and stack it into two lines when the box was narrow. The chip now slides with the point like a hosted one, stays one line, and takes the in-box band, top or bottom, farthest from the plotted line. It never leaves the box. Opt-out: host it (a `StatCard` slot; a strip visual) to get the readout line above the plot.
1119
+
1120
+ | Before | Now |
1121
+ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
1122
+ | `<Sparkline height={28} />` bare: chip beside the point, on the line, two lines when narrow | chip slid with the point, one line (`48 bpm · 19 Oct`), in the band farthest from the line |
1123
+
1049
1124
  ## 2.26.0 — Wave 38, argo's friction III
1050
1125
 
1051
1126
  ### Chart card loading (Wave 38)
@@ -1 +1 @@
1
- {"version":3,"file":"Bars.d.ts","sourceRoot":"","sources":["../../src/charts/Bars.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAMzC,OAAO,KAAK,EACV,mBAAmB,EAEnB,WAAW,EACX,MAAM,EAGP,MAAM,SAAS,CAAA;AAEhB,oDAAoD;AACpD,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,IAAI,CAC3B,WAAW,CAAC,CAAC,CAAC,EACd,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,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F"}
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { barY } from "@tanstack/charts/bar";
3
+ import { dot } from "@tanstack/charts/dot";
3
4
  import { group } from "@tanstack/charts/group";
4
5
  import { stack } from "@tanstack/charts/stack";
5
6
  import { useCallback, useContext, useMemo } from "react";
@@ -9,6 +10,7 @@ import { VX } from "../tokens/index.js";
9
10
  import { emphasis, lineMark } from "./marks.js";
10
11
  import { rowX } from "./types.js";
11
12
  const DEFAULT_BAR_OPACITY = 0.85;
13
+ const EMPTY_BIN_R = 2;
12
14
  const SHADE_FLOOR = 0.4;
13
15
  function shadeSharedColors(bars, barOpacity) {
14
16
  if (barOpacity !== void 0) return bars;
@@ -28,12 +30,45 @@ function guardLogStack(layout, onLog) {
28
30
  if (!warnedLogStack) console.error(message);
29
31
  warnedLogStack = true;
30
32
  }
33
+ function emptyBinTicks(rows) {
34
+ const sums = /* @__PURE__ */ new Map();
35
+ for (const row of rows) {
36
+ const key = String(row.x instanceof Date ? row.x.getTime() : row.x);
37
+ const entry = sums.get(key) ?? { row, sum: 0, values: 0 };
38
+ if (row.y !== null && Number.isFinite(row.y)) {
39
+ entry.sum += Math.abs(row.y);
40
+ entry.values += 1;
41
+ }
42
+ sums.set(key, entry);
43
+ }
44
+ const empty = [...sums.values()].filter((e) => e.values > 0 && e.sum === 0).map((e) => e.row);
45
+ if (empty.length === 0) return [];
46
+ return [
47
+ dot(empty, {
48
+ id: "empty-bins",
49
+ x: rowX,
50
+ y: () => 0,
51
+ r: EMPTY_BIN_R,
52
+ fill: VX.muted,
53
+ fillOpacity: 0,
54
+ states: [{ when: { focus: "x" }, style: { fillOpacity: 1 } }]
55
+ })
56
+ ];
57
+ }
58
+ function floorIsZero(y) {
59
+ if (y?.scale === "log") return false;
60
+ const domain = y?.domain;
61
+ if (Array.isArray(domain)) return domain[0] <= 0 && domain[1] >= 0;
62
+ if (typeof domain === "function") return false;
63
+ return (y?.autoMinCeil ?? 0) <= 0;
64
+ }
31
65
  function Bars(props) {
32
66
  const { bars: given, lines, layout = "stacked", barOpacity, ...rest } = props;
33
67
  const bars = useMemo(() => shadeSharedColors(given, barOpacity), [given, barOpacity]);
34
68
  const sharedColor = bars.some((b, i) => bars.findIndex((o) => o.color === b.color) !== i);
35
69
  guardLogStack(layout, bars.length > 0 && rest.y?.scale === "log");
36
70
  const sample = rest.data[0];
71
+ const zeroFloor = floorIsZero(rest.y);
37
72
  const bare = useContext(VisualSlotContext) !== null;
38
73
  const series = useMemo(
39
74
  () => [
@@ -80,13 +115,14 @@ function Bars(props) {
80
115
  layout: layout === "grouped" ? group({ padding: 0.1 }) : stack({ order, ...layout === "normalized" && { offset: "normalize" } })
81
116
  })
82
117
  );
118
+ if (bare && zeroFloor) out.push(...emptyBinTicks(rows));
83
119
  for (const s of plot.visible) {
84
120
  if (barKeys.has(s.key)) continue;
85
121
  out.push(lineMark(plot, s));
86
122
  }
87
123
  return out;
88
124
  },
89
- [bars, layout, barOpacity, sharedColor]
125
+ [bars, layout, barOpacity, sharedColor, bare, zeroFloor]
90
126
  );
91
127
  return /* @__PURE__ */ jsx(
92
128
  CartesianRung,
@@ -36,7 +36,10 @@ type ChartCardBaseProps = BasaltProps & SlotStylesProps<ChartCardSlot> & {
36
36
  /** Right-aligned controls. A `<Text size="xs">` caption here renders at 11 (the chart-text step,
37
37
  * beside the plot's ticks); wrap it in a `span` or give it your own class to opt out. */
38
38
  actions?: ReactNode;
39
- /** A resolved state replaces `children` with its placeholder; the header stays. */
39
+ /** A resolved state replaces `children` with its placeholder; the header stays. The card learns
40
+ * a state only from here: a body that draws its own loading or empty line (`Meter loading`,
41
+ * `BarList emptyText`) must ALSO be reported here (`{ pending: true }`, `{ empty }`), or the
42
+ * `facts` above it render over a state they contradict. */
40
43
  state?: ChartState | undefined;
41
44
  /** Body height while a placeholder shows. Default: the chart height law, i.e. exactly the box an
42
45
  * unsized chart takes — pass the chart's own `height` when it states one, so a `<Suspense
@@ -46,6 +49,9 @@ type ChartCardBaseProps = BasaltProps & SlotStylesProps<ChartCardSlot> & {
46
49
  * its own loading (`BarList loading`, a loading `Meter`); a children-less `<Suspense
47
50
  * fallback>` should pass a numeric height instead. */
48
51
  placeholderHeight?: number | ResponsiveChartHeight | 'content' | undefined;
52
+ /** The pending plot's ghost: `'bars'` (default), `'line'` for a line or area chart, or the bar
53
+ * count when the loaded chart's data length is known. */
54
+ ghost?: 'bars' | 'line' | number | undefined;
49
55
  /** Placeholder data is showing: the facts row dims with the plot (a strip cell's `stale`). */
50
56
  stale?: boolean | undefined;
51
57
  /** What an errored `state` names: "Could not load {stateNoun}". Default: no noun. */
@@ -73,6 +79,6 @@ export type ChartCardProps = ChartCardBaseProps & ({
73
79
  } | {
74
80
  facts?: undefined;
75
81
  });
76
- export declare function ChartCard({ actions, state, placeholderHeight, stateAction, stale, stateNoun, onRetry, retrying, className, classNames, style, children, facts, ...header }: ChartCardProps): ReactElement;
82
+ export declare function ChartCard({ actions, state, placeholderHeight, stateAction, stale, stateNoun, ghost, onRetry, retrying, className, classNames, style, children, facts, ...header }: ChartCardProps): ReactElement;
77
83
  export {};
78
84
  //# sourceMappingURL=ChartCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../src/charts/ChartCard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAM7D,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAkFhE,mGAAmG;AACnG,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,8BAA8B;IA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AAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC5C,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,uFAAuF;IACvF,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,wFAAwF;IACxF,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,CACI;IACE;uDACmD;IACnD,KAAK,EAAE,SAAS,GAAG,SAAS,SAAS,EAAE,CAAA;IACvC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,CACxB,CAAA;AAoEH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,MAAM,EACV,EAAE,cAAc,GAAG,YAAY,CA2D/B"}
@@ -113,6 +113,7 @@ function ChartCard({
113
113
  stateAction,
114
114
  stale,
115
115
  stateNoun,
116
+ ghost,
116
117
  onRetry,
117
118
  retrying,
118
119
  className,
@@ -165,6 +166,7 @@ function ChartCard({
165
166
  state,
166
167
  ...placeholderHeight !== void 0 && { height: placeholderHeight },
167
168
  ...stateNoun !== void 0 && { noun: stateNoun },
169
+ ...ghost !== void 0 && { ghost },
168
170
  ...onRetry !== void 0 && { onRetry },
169
171
  ...retrying !== void 0 && { retrying },
170
172
  action: stateAction
@@ -1 +1 @@
1
- {"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/charts/Sparkline.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAA0D,YAAY,EAAE,MAAM,OAAO,CAAA;AAEjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAclD,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,SAAS,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAA;IACjB;yFACqF;IACrF,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS;QAAE,EAAE,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAClF,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACjC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,4FAA4F;IAC5F,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1B;uDACmD;IACnD,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC;2DACuD;IACvD,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC;oGACgG;IAChG,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC9B;gFAC4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACvC;yBACqB;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,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AA4F;IAC5F,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1B;uDACmD;IACnD,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC;2DACuD;IACvD,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC;oGACgG;IAChG,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC9B;gFAC4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACvC;yBACqB;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAChD;;sCAEkC;IAClC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CACvC,CAAA;AAED,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAmJ5C;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,KAAK,EAAE,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,KAAK,GACnB,SAAS,KAAK,EAAE,CAIlB;AA6SD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA8N7D"}
@@ -25,6 +25,7 @@ const DOT_R = 2.5;
25
25
  const BAR_GAP = 0.15;
26
26
  const READOUT_GAP = 8;
27
27
  const LINE_INSET = 3;
28
+ const SHORT_BOX = 36;
28
29
  const MUTED_LINE = alpha(VX.muted, 0.35);
29
30
  const REFERENCE_LABEL_DX = 3;
30
31
  const LINE_PX_PER_POINT = 1;
@@ -281,7 +282,41 @@ function placeStacked(node, line, fx) {
281
282
  node.style.top = `${fit.top}px`;
282
283
  node.style.marginLeft = `${fit.left - slid}px`;
283
284
  }
284
- function fitReadout(node, line, fx) {
285
+ function lineYAt(pts, x) {
286
+ for (let i = 0; i + 1 < pts.length; i += 1) {
287
+ const [ax, ay] = pts[i];
288
+ const [bx, by] = pts[i + 1];
289
+ if (x >= Math.min(ax, bx) && x <= Math.max(ax, bx))
290
+ return bx === ax ? ay : ay + (by - ay) * (x - ax) / (bx - ax);
291
+ }
292
+ return null;
293
+ }
294
+ function placeInBand(node, line, fx) {
295
+ const layer = node.parentElement;
296
+ if (!layer) return;
297
+ const [W, H, w, h] = [layer.clientWidth, layer.clientHeight, node.offsetWidth, node.offsetHeight];
298
+ if (W <= 0 || H <= 0) return;
299
+ const pts = line().map(([x, y]) => [x * W, y * H]);
300
+ const slid = fx * (W - w);
301
+ const room = (left) => Math.min(Math.max(left, 0), Math.max(W - w, 0));
302
+ const lefts = [slid, room(fx * W + CLEAR * 2), room(fx * W - CLEAR * 2 - w)];
303
+ const bands = [0, Math.max(H - h, 0)];
304
+ const dotY = lineYAt(pts, fx * W);
305
+ const score = (left, top) => {
306
+ const covers = dotY !== null && fx * W + CLEAR > left && fx * W - CLEAR < left + w && dotY + CLEAR > top && dotY - CLEAR < top + h;
307
+ let nearest = Number.POSITIVE_INFINITY;
308
+ for (let x = left; x <= left + w; x += 2) {
309
+ const y = lineYAt(pts, x);
310
+ if (y === null) continue;
311
+ nearest = Math.min(nearest, y < top ? top - y : y > top + h ? y - (top + h) : 0);
312
+ }
313
+ return (covers ? -1e3 : 0) + Math.min(nearest, 999);
314
+ };
315
+ const fit = lefts.flatMap((left) => bands.map((top) => ({ left, top, s: score(left, top) }))).reduce((a, b) => b.s > a.s ? b : a);
316
+ node.style.top = `${fit.top}px`;
317
+ node.style.marginLeft = `${fit.left - slid}px`;
318
+ }
319
+ function fitReadout(node, line, fx, band) {
285
320
  const overflows = () => node.scrollWidth > node.clientWidth;
286
321
  node.removeAttribute("data-tight");
287
322
  node.removeAttribute("data-stacked");
@@ -289,11 +324,13 @@ function fitReadout(node, line, fx) {
289
324
  node.style.removeProperty("top");
290
325
  node.style.removeProperty("margin-left");
291
326
  }
292
- if (!overflows()) return;
293
- node.setAttribute("data-tight", "");
294
- if (!overflows()) return;
295
- node.setAttribute("data-stacked", "");
296
- if (line !== null) placeStacked(node, line, fx);
327
+ if (overflows()) {
328
+ node.setAttribute("data-tight", "");
329
+ if (overflows() && !band) node.setAttribute("data-stacked", "");
330
+ }
331
+ if (line === null) return;
332
+ if (band) placeInBand(node, line, fx);
333
+ else if (node.hasAttribute("data-stacked")) placeStacked(node, line, fx);
297
334
  }
298
335
  function Sparkline(props) {
299
336
  const {
@@ -373,6 +410,7 @@ function Sparkline(props) {
373
410
  fy: (model.frame.y[1] - value) / (model.frame.y[1] - model.frame.y[0]),
374
411
  label: labels?.[active] ?? model.moments?.[active]
375
412
  } : null;
413
+ const short = !hosted && mark === "line" && height < SHORT_BOX;
376
414
  const beside = at === null ? null : at.fx > 0.5 ? "left" : "right";
377
415
  const shown = at !== null;
378
416
  const fxRef = useRef(0);
@@ -382,7 +420,7 @@ function Sparkline(props) {
382
420
  const fitRef = useRef(() => {
383
421
  });
384
422
  useLayoutEffect(() => {
385
- const line = hosted && mark === "line" && model !== null ? () => model.rows.flatMap(
423
+ const line = (hosted || short) && mark === "line" && model !== null ? () => model.rows.flatMap(
386
424
  (r, i) => r.v === null ? [] : [
387
425
  [
388
426
  (i - model.frame.x[0]) / (model.frame.x[1] - model.frame.x[0]),
@@ -391,10 +429,10 @@ function Sparkline(props) {
391
429
  ]
392
430
  ) : null;
393
431
  fitRef.current = () => {
394
- if (readoutRef.current !== null) fitReadout(readoutRef.current, line, fxRef.current);
432
+ if (readoutRef.current !== null) fitReadout(readoutRef.current, line, fxRef.current, short);
395
433
  };
396
434
  fitRef.current();
397
- }, [active, at?.label, at?.value, beside, hosted, mark, model]);
435
+ }, [active, at?.label, at?.value, beside, hosted, short, mark, model]);
398
436
  useEffect(() => {
399
437
  const layer = readoutRef.current?.parentElement;
400
438
  if (!shown || !layer || typeof ResizeObserver === "undefined") return;
@@ -402,7 +440,7 @@ function Sparkline(props) {
402
440
  observer.observe(layer);
403
441
  return () => observer.disconnect();
404
442
  }, [shown]);
405
- const readoutStyle = at === null ? void 0 : hosted ? { left: `${at.fx * 100}%`, translate: `${-at.fx * 100}% 0`, maxWidth: "100%" } : {
443
+ const readoutStyle = at === null ? void 0 : hosted || short ? { left: `${at.fx * 100}%`, translate: `${-at.fx * 100}% 0`, maxWidth: "100%" } : {
406
444
  ...beside === "right" ? {
407
445
  left: `calc(${at.fx * 100}% + ${READOUT_GAP}px)`,
408
446
  maxWidth: `calc(${(1 - at.fx) * 100}% - ${READOUT_GAP}px)`
@@ -115,6 +115,16 @@
115
115
  bottom / 100% 1px no-repeat;
116
116
  }
117
117
 
118
+ .ghostLine {
119
+ width: 100%;
120
+ height: 100%;
121
+ fill: none;
122
+ stroke: color-mix(in srgb, var(--vx-ink) 24%, var(--vx-surface-panel));
123
+ stroke-width: 2px;
124
+ stroke-linecap: round;
125
+ stroke-linejoin: round;
126
+ }
127
+
118
128
  .ghostBar {
119
129
  flex: 1 1 0;
120
130
  min-width: 0;
@@ -135,7 +145,9 @@
135
145
  }
136
146
 
137
147
  :global(.ts-chart-tooltip__row > span:nth-child(2)) {
138
- overflow-wrap: break-word;
148
+ /* Words wrap, tokens do not: the engine's `anywhere` on the card would split `Load (7)` as
149
+ * `Load` / `7)` and `TE 2.1/0.4` mid-figure. A single token wider than the card overflows it. */
150
+ overflow-wrap: normal;
139
151
  white-space: normal;
140
152
  }
141
153
 
@@ -154,3 +166,66 @@
154
166
  )
155
167
  var(--vx-surface-elevated) !important;
156
168
  }
169
+
170
+ /*
171
+ * A slotted `Bars` (`data-basalt-slot`, set by `compile.ts`) is a micro-visual: its tooltip is the
172
+ * Sparkline's one-line chip, `<value> · <x label>` in the line the host reserves above the plot. The
173
+ * first row's figure leads, the header follows it, further rows are hidden (a chart that needs rows
174
+ * lives in a `ChartCard`); an overlong header ends in an ellipsis. Height, type and edge are the
175
+ * chip's (`sparkline.module.css`); the tooltip is portalled out of the host, so its fallbacks stand.
176
+ */
177
+ :global(.ts-chart-tooltip[data-basalt-slot]) {
178
+ display: flex !important;
179
+ align-items: center;
180
+ box-sizing: border-box;
181
+ width: max-content;
182
+ block-size: 1.125rem;
183
+ padding: 0 4px !important;
184
+ overflow: hidden;
185
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
186
+ font-variant-numeric: lining-nums;
187
+ font-size: var(--vx-text-xs);
188
+ line-height: calc(1.125rem - 2px);
189
+ white-space: nowrap !important;
190
+ border-radius: var(--vx-radius-ctrl) !important;
191
+ /* theme-allow css-raw-surface — the chip is flat, like the Sparkline's, not a floating panel */
192
+ box-shadow: none !important;
193
+ }
194
+
195
+ :global(.ts-chart-tooltip[data-basalt-slot]:is([hidden], [popover]:not(:popover-open))) {
196
+ /* The flex above must not beat the engine's own hide. */
197
+ display: none !important;
198
+ }
199
+
200
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__rows) {
201
+ flex: none;
202
+ order: 0;
203
+ }
204
+
205
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__row) {
206
+ display: block !important;
207
+ }
208
+
209
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__row:not(:first-child)),
210
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__row > span:not(:last-child)) {
211
+ display: none;
212
+ }
213
+
214
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__title) {
215
+ display: block !important;
216
+ flex: 0 1 auto;
217
+ min-width: 0;
218
+ order: 1;
219
+ margin: 0 !important;
220
+ overflow: hidden;
221
+ font-weight: inherit !important;
222
+ text-overflow: ellipsis;
223
+ white-space: nowrap;
224
+ overflow-wrap: normal;
225
+ opacity: 0.7;
226
+ }
227
+
228
+ :global(.ts-chart-tooltip[data-basalt-slot] .ts-chart-tooltip__title::before) {
229
+ content: ' · ';
230
+ white-space: pre;
231
+ }
@@ -10,6 +10,7 @@ declare const classes: {
10
10
  readonly state: string
11
11
  readonly grow: string
12
12
  readonly ghost: string
13
+ readonly ghostLine: string
13
14
  readonly ghostBar: string
14
15
  }
15
16
  export default classes
@@ -15,9 +15,7 @@
15
15
  }
16
16
 
17
17
  @container (min-width: 240px) {
18
- /* `foldLegend` (legend.tsx) folds the zones / references that wrap the row into `+N`; series never fold. */
19
18
  .auto {
20
- --bc-fold: 1;
21
19
  flex-wrap: wrap;
22
20
  display: flex;
23
21
  column-gap: var(--bc-dots-gap);
@@ -27,7 +25,6 @@
27
25
 
28
26
  @container (min-width: 480px) {
29
27
  .auto {
30
- --bc-fold: 0;
31
28
  column-gap: var(--bc-legend-gap);
32
29
  --vx-hit-gap: var(--bc-legend-gap);
33
30
  }
@@ -47,14 +44,3 @@
47
44
  display: none;
48
45
  }
49
46
  }
50
-
51
- /* The compact fold (`foldLegend`, which only folds while `--bc-fold` is 1); wide keeps every entry.
52
- * `!important`: an entry's inline `all: unset` (legend.tsx) would otherwise reset `display`. */
53
- .auto [data-legend-folded] {
54
- display: none !important;
55
- }
56
-
57
- .auto [data-legend-more] {
58
- order: 1;
59
- flex: none;
60
- }
@@ -1,3 +1,4 @@
1
+ import type { ChartTooltipPortalPositionContext } from '@tanstack/charts/tooltip/portal';
1
2
  import type { ChartGradient, ChartPositionScaleOptions, ChartTooltipRow as EngineTooltipRow, ChartValue, ResponsiveChartDefinition } from '@tanstack/charts/types/core';
2
3
  import type { ContainerClass } from '../tokens/size-classes.js';
3
4
  import type { PlotSizes } from './plot-context.js';
@@ -121,6 +122,25 @@ export declare function zoneAreaGradient(index: number, zones: readonly ZoneSpec
121
122
  * a clock time (a bucket keyed by local midnight is `22:00` UTC in a UTC+2 zone).
122
123
  */
123
124
  export declare function dayGranular(values: readonly ChartX[]): boolean;
125
+ /**
126
+ * The engine places a portalled tooltip against the viewport, so it opens past the card's edge, over
127
+ * the neighbouring card or the section heading above. Its placements (a hover, and its own resize /
128
+ * scroll repositions, which never pass through `position`) all write the element's inline `left` and
129
+ * `top`, so each write is followed by a settle inside the card (`settleInCard`).
130
+ */
131
+ /** What a card clamp does: `card` a chart tooltip (both axes, the card's width), `slot` a slotted
132
+ * `Bars` chip (flush above its plot), `strip` a `BandStrip`'s (sideways only, as before Wave 39). */
133
+ type TipMode = 'card' | 'slot' | 'strip';
134
+ /**
135
+ * Keeps a tooltip inside its card on both axes. A card with room lets the tooltip grow up to its
136
+ * width before a label wraps, and re-centres it on the anchor at that width. A tooltip that would
137
+ * cross the card's top or bottom flips to the other side of its anchor when that side fits; neither
138
+ * fitting, it slides in; taller than the card, it aligns to the card's top (the only overflow).
139
+ * A `slot` tooltip (a slotted `Bars`, one line) keeps its place above the plot, centred on the
140
+ * anchor, capped at the card's width and held inside the card sideways and at its top. A hidden or unmeasured tooltip is left alone, and an unchanged position
141
+ * is not written back (a write re-runs this).
142
+ */
143
+ export declare function settleInCard(tip: HTMLElement, within: Element, ctx: ChartTooltipPortalPositionContext, mode?: TipMode): void;
124
144
  export declare function compileCartesian<T, X extends ChartX>(input: CartesianInput<T, X>): CartesianDefinition;
125
145
  export {};
126
146
  //# sourceMappingURL=compile.d.ts.map