basalt-ui 2.7.3 → 2.8.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.
- package/CHANGELOG.md +26 -0
- package/MIGRATING.md +97 -15
- package/agent/rules/basalt-batteries.md +1 -1
- package/agent/rules/basalt-controls.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/skills/basalt-app/SKILL.md +7 -7
- package/agent/templates/AGENTS-block.md.tpl +1 -1
- package/dist/charts/BandStrip.d.ts +13 -0
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +142 -44
- package/dist/cli/doctor-upgrade.d.ts +11 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +122 -10
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +4 -0
- package/dist/cli/help.js +1 -1
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +7 -4
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +27 -2
- package/dist/provider/index.d.ts +22 -4
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +21 -6
- package/dist/provider/test-router.d.ts +2 -1
- package/dist/provider/test-router.d.ts.map +1 -1
- package/dist/provider/test-router.js +6 -7
- package/llms.txt +35 -3
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +223 -48
- package/src/cli/doctor-upgrade.ts +171 -15
- package/src/cli/doctor.ts +4 -0
- package/src/cli/help.ts +1 -1
- package/src/cli/index.ts +16 -0
- package/src/cli/init.ts +7 -6
- package/src/cli/sync.ts +29 -2
- package/src/provider/index.tsx +65 -15
- package/src/provider/test-router.tsx +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [2.8.0](https://github.com/jkrumm/basalt-ui/compare/v2.7.3...v2.8.0) (2026-10-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* close the BandStrip absent-state review gaps ([72ebf19](https://github.com/jkrumm/basalt-ui/commit/72ebf192f30df36c00525f8dd76b3a9b452a24f3))
|
|
7
|
+
* close the doctor gaps from the fleet probes ([16fcf0c](https://github.com/jkrumm/basalt-ui/commit/16fcf0cbcb16d85fd6861e9f3be310d5e0c0ddb1))
|
|
8
|
+
* fail any router= provider in a Start root route, warn on stale seeds ([9e27b35](https://github.com/jkrumm/basalt-ui/commit/9e27b35141dec4c3e395e295955a7c55147f9a51))
|
|
9
|
+
* fold the argo loop's remaining learnings into the shipped rules and skills ([9d19009](https://github.com/jkrumm/basalt-ui/commit/9d19009e9cdb0e9d2e9c5832d7c92e2c637d710f))
|
|
10
|
+
* harden the oxlint floor and the dropped-subpaths scan ([73ecbaf](https://github.com/jkrumm/basalt-ui/commit/73ecbaff2bb9a7caa144f0514228a6bbb1302569))
|
|
11
|
+
* honor a state's tooltip opt-out on the re-added BandStrip row ([6091201](https://github.com/jkrumm/basalt-ui/commit/6091201f617a9fa19f771af57e244e3a846247d0))
|
|
12
|
+
* ignore a literal provider, match any-width spreads, split stale seeds ([88e8e9e](https://github.com/jkrumm/basalt-ui/commit/88e8e9e7718dcfad7924c00f472e20966a551cb5))
|
|
13
|
+
* reject a router= provider in a Start root route, name llms modes by literal ([d16db36](https://github.com/jkrumm/basalt-ui/commit/d16db36e76fd2928214abd67d9ea12a7e3ee2074))
|
|
14
|
+
* render union-typed props in llms.txt signatures ([7b6d347](https://github.com/jkrumm/basalt-ui/commit/7b6d347d74b742b4a7170c11103f7a1770edabd1))
|
|
15
|
+
* resolve BandStrip absent visibility per portion ([ffe853e](https://github.com/jkrumm/basalt-ui/commit/ffe853eaefe8e707ffeb9c5f7f5308570c08fbe5))
|
|
16
|
+
* share the Start seed skip and resolve the router without a cast ([5f128d8](https://github.com/jkrumm/basalt-ui/commit/5f128d87df6c272944eef5bfcbb67461eddec373))
|
|
17
|
+
* strip build metadata in the oxlint floor and blank CSS strings ([6915fb7](https://github.com/jkrumm/basalt-ui/commit/6915fb7b02dbbba333da3eee3a7ce1a529c46f73))
|
|
18
|
+
* unify BandStrip absent resolution across paint, hits and tooltip ([311e0cf](https://github.com/jkrumm/basalt-ui/commit/311e0cfc1dcb88b02ed8817769575881871684d1))
|
|
19
|
+
* wire doctor and the provider for Start apps, merge union props in llms ([102d213](https://github.com/jkrumm/basalt-ui/commit/102d213eb1c5bf8c74d26fa2e5fad77ca71d8e6c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* give BandStrip an absent state ([6ed20bd](https://github.com/jkrumm/basalt-ui/commit/6ed20bdb01df2b4105bfb7936ae4296c6da674bc))
|
|
25
|
+
* let BasaltProvider live inside a router it does not own ([d108547](https://github.com/jkrumm/basalt-ui/commit/d108547b2c4e57adf66f5abbbc79e07ef7da7b3e))
|
|
26
|
+
|
|
1
27
|
## [2.7.3](https://github.com/jkrumm/basalt-ui/compare/v2.7.2...v2.7.3) (2026-10-15)
|
|
2
28
|
|
|
3
29
|
|
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 | 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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
-
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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 | 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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — |
|
|
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) | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
+
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -828,7 +828,7 @@ Lint: `basalt/visx-boundary`, `basalt/visx-tooltip`, `basalt/hand-rolled-plot`,
|
|
|
828
828
|
| `basalt-ui/charts`: `CartesianChart` | kept, new contract: `children(ctx)` → `marks(plot)`, `getX` + `chartId` → `x`, `isPending` → `state`, `ariaLabel` is required | a definition compiler plus one host (V2-SPEC § 9.2) |
|
|
829
829
|
| `basalt-ui/charts`: `CartesianChartProps` | kept names, new contract | V2-SPEC § 9.2 |
|
|
830
830
|
| `basalt-ui/charts`: `AxisConfig` | kept names, new contract | V2-SPEC § 9.2 |
|
|
831
|
-
| `basalt-ui/charts`: `PlotContext` | kept
|
|
831
|
+
| `basalt-ui/charts`: `PlotContext` | kept name, new contract: per-field map under the table | V2-SPEC § 9.2 |
|
|
832
832
|
| `basalt-ui/charts`: `resolveAxisDomain` | internal | the rung owns the y domains |
|
|
833
833
|
| `basalt-ui/charts`: `ChartFrame` | deleted; the host is private. A bespoke body moves to `CartesianChart` `marks`, a matrix to W5 `Heatmap` | the engine owns the frame |
|
|
834
834
|
| `basalt-ui/charts`: `ChartFrameProps` | deleted; the host is private. A bespoke body moves to `CartesianChart` `marks`, a matrix to W5 `Heatmap` | the engine owns the frame |
|
|
@@ -940,6 +940,58 @@ Lint: `basalt/visx-boundary`, `basalt/visx-tooltip`, `basalt/hand-rolled-plot`,
|
|
|
940
940
|
| `basalt-ui/charts`: `useVxTheme` | deleted; every chart paint is a `var(--vx-*)` reference | no theme context |
|
|
941
941
|
| `basalt-ui/charts`: `VxTheme` | deleted; every chart paint is a `var(--vx-*)` reference | no theme context |
|
|
942
942
|
|
|
943
|
+
### `PlotContext`, field by field
|
|
944
|
+
|
|
945
|
+
`marks(plot)` replaces the 1.x `children(ctx)` render prop. The engine owns the scales, so no pixel scale reaches the callback; marks are declared in data space and the host positions them.
|
|
946
|
+
|
|
947
|
+
| 1.x `ctx.` | 2.x `plot.` | Note |
|
|
948
|
+
| -------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
949
|
+
| `data` | `rows(key)` | `PlotRow { x, y, series, datum }[]`; `[]` for a hidden series |
|
|
950
|
+
| `visible` | `visible` | unchanged: series minus what the legend toggled off |
|
|
951
|
+
| `hidden` | none | not exposed: it is your own `series` minus `plot.visible` (`rows(key)` is `[]` for a hidden key) |
|
|
952
|
+
| `xScale` | none | pass `x: 'x'` on `rows(key)`; the engine scales it |
|
|
953
|
+
| `yScale` | none (`yDomain` is the resolved domain) | a mark on the default axis takes no scale argument |
|
|
954
|
+
| `y2Scale` | `y2` (`'y2' \| undefined`) | a mark opts in with `yScale: plot.y2`, else it draws on the left; `y2Domain` is the domain |
|
|
955
|
+
| `xMax`, `yMax` | `width`, `height` | the chart box in px, not the plot rect |
|
|
956
|
+
| `margin` | none | margins are the host's; there is no margin prop |
|
|
957
|
+
| `cursorPoint` | none (`chartCursor(group?).getState()` is the closest) | `getState()` is engine coordinates (`scene` / `normalized` / `value`), not a datum: there is no direct replacement; for a cursor dot use `ChartSeries.cursorValue` |
|
|
958
|
+
| `highlighted` | `highlighted` | unchanged |
|
|
959
|
+
| new | `containerClass` | the measured container class |
|
|
960
|
+
|
|
961
|
+
### Overlays that were drawn from pixel scales
|
|
962
|
+
|
|
963
|
+
A 1.x overlay that called `ctx.xScale(x)` / `ctx.yScale(y)` and returned `<line>` / `<rect>` / `<text>` has one 2.x route: declare it as a mark in data space from `@tanstack/charts/{line,rule,dot,text,rect,link,arrow,…}` (the `basalt/chart-engine-boundary` allowlist) and return it from `marks`. The engine runs the scales, so the overlay tracks resize and the legend. It does **not** follow `y2` on its own: a mark draws on the left axis unless it carries `yScale: plot.y2` (`undefined` without a `y2` config, which the mark options accept as is: no guard needed).
|
|
964
|
+
|
|
965
|
+
```tsx
|
|
966
|
+
import { lineY } from '@tanstack/charts/line'
|
|
967
|
+
import { ruleY } from '@tanstack/charts/rule'
|
|
968
|
+
import { CartesianChart } from 'basalt-ui/charts'
|
|
969
|
+
import { VX } from 'basalt-ui/tokens'
|
|
970
|
+
|
|
971
|
+
;<CartesianChart
|
|
972
|
+
data={data}
|
|
973
|
+
x={(d) => d.at}
|
|
974
|
+
series={series}
|
|
975
|
+
y2={{}}
|
|
976
|
+
ariaLabel="Latency"
|
|
977
|
+
marks={(plot) => [
|
|
978
|
+
...plot.visible.map((s) =>
|
|
979
|
+
lineY(plot.rows(s.key), {
|
|
980
|
+
x: 'x',
|
|
981
|
+
y: 'y',
|
|
982
|
+
z: 'series',
|
|
983
|
+
stroke: s.color,
|
|
984
|
+
...(s.axis === 'right' && { yScale: plot.y2 }),
|
|
985
|
+
}),
|
|
986
|
+
),
|
|
987
|
+
ruleY([250], { stroke: VX.status.warn }), // left axis, data space
|
|
988
|
+
ruleY([5], { yScale: plot.y2, stroke: VX.status.warn }), // right axis
|
|
989
|
+
]}
|
|
990
|
+
/>
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
Fixed thresholds and bands need no mark: use `refLines`, `zones` and `xZones` data. **There is no route for an overlay positioned in raw pixels** (a free-floating SVG/HTML node placed from a pixel scale, or a mark whose position is computed from the plot rect): `PlotContext` exposes no scale or plot rect and `ChartMarks` takes engine marks only. Express it in data coordinates, or it is unsupported in 2.x.
|
|
994
|
+
|
|
943
995
|
### Subpaths, peers and gates (W3 gates)
|
|
944
996
|
|
|
945
997
|
| 1.41 import | 2.0 | Reason |
|
|
@@ -977,10 +1029,12 @@ optional, subpath-required peers.
|
|
|
977
1029
|
|
|
978
1030
|
### Router bridge (`basalt-ui/router-tanstack`)
|
|
979
1031
|
|
|
1032
|
+
The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an import from it fails to resolve (`doctor`'s `dropped-subpaths` reports `file:line`). Each symbol now lives at exactly one other path, named in the table. Nothing is re-exported from the old subpath.
|
|
1033
|
+
|
|
980
1034
|
| Old import | New / deleted | Why |
|
|
981
1035
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
982
|
-
| `defineNav`, `navGroup`, `navTarget`, `flattenNav`, `useBasaltNav`, `NavItemId` |
|
|
983
|
-
| `createSearchStore` | `basalt-ui/state` | the
|
|
1036
|
+
| `defineNav`, `navGroup`, `navTarget`, `flattenNav`, `useBasaltNav`, `NavItemId` | import from `basalt-ui` (the root barrel) | the subpath is removed; nav lives in the root barrel |
|
|
1037
|
+
| `createSearchStore` | `basalt-ui/state` | the subpath is removed; stores live in `./state` |
|
|
984
1038
|
| `field` and the 20 `Field`/`Range*`/`Search*` types re-exported here | `basalt-ui/state` (same names) | one import path per symbol |
|
|
985
1039
|
| `defineNav(config)` without the `Register` augmentation | compile error: the parameter becomes `'basalt: declare Register { router }'` | the definition validated nothing (V2-SPEC § 3) |
|
|
986
1040
|
| `useRouterBreadcrumbs`, `BasaltBreadcrumb`, `BasaltNav` | deleted | shell-internal / unnamed |
|
|
@@ -992,6 +1046,34 @@ optional, subpath-required peers.
|
|
|
992
1046
|
_Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
|
|
993
1047
|
release renames it and opens a new one here._
|
|
994
1048
|
|
|
1049
|
+
## 2.8.0 — the fleet probe fixes
|
|
1050
|
+
|
|
1051
|
+
Ledger rows 61-67 (`docs/waves/argo-friction.md`), found while the rest of the fleet probed 1.x → 2.x.
|
|
1052
|
+
|
|
1053
|
+
- **`doctor` may report new failures (CLI).** `dropped-subpaths` now also scans CSS `@import`s
|
|
1054
|
+
(`'…'`, `"…"`, `url(…)`) and fails on `basalt-ui/tokens.css` and `basalt-ui/router-tanstack` even
|
|
1055
|
+
when the resolved install is a stale 1.x that still exports them (a `.claude/worktrees` tree
|
|
1056
|
+
without its own `node_modules` walks up to the main checkout's). Fix: commit
|
|
1057
|
+
`basalt-ui tokens:css --out src/tokens.css` and import that file; import nav symbols from
|
|
1058
|
+
`basalt-ui`, stores from `basalt-ui/state`.
|
|
1059
|
+
- **`doctor` `oxlint-floor` (CLI).** With a `.oxlintrc.json`, oxlint below `1.79.0` fails: older
|
|
1060
|
+
versions reject the shipped preset's `react/*` rules. Fix: `bun add -D oxlint@^1.79.0`.
|
|
1061
|
+
- **`BasaltProvider` embedded mode (shell).** Pass `children` instead of `router` to render inside a
|
|
1062
|
+
router the app does not own (TanStack Start): `<BasaltProvider><Outlet /></BasaltProvider>` in the
|
|
1063
|
+
root route component, with `getRouter()` putting a `QueryClient` in `context.queryClient`.
|
|
1064
|
+
`router=` usage is unchanged. Type-level: `BasaltProviderProps['router']` is now
|
|
1065
|
+
`BasaltRouter | undefined`; name `BasaltRouter` directly instead of indexing the prop.
|
|
1066
|
+
- **Start apps in `init`/`sync`/`doctor` (CLI).** With `@tanstack/react-start` in the app's
|
|
1067
|
+
dependencies, `init`/`sync` seed no `src/main.tsx`, `src/lib/nav.tsx` or `src/routes/__root.tsx`,
|
|
1068
|
+
and `doctor`'s `app-wiring` checks the root route mounts `<BasaltProvider>` without `router=`.
|
|
1069
|
+
- **`spotlight={false}` (shell).** `BasaltProvider` gains `spotlight?: boolean` (default `true`);
|
|
1070
|
+
`false` mounts no Spotlight and builds no actions, for an app with its own Cmd+K (1.x
|
|
1071
|
+
`BasaltOverlays spotlight={false}`).
|
|
1072
|
+
- **`BandStrip` absent share (charts).** 1.x `BandSpan.absentFraction` returns, with
|
|
1073
|
+
`absentState="<states key>"` on the strip: a band's unmeasured share is painted flat in that
|
|
1074
|
+
state's color (color it `VX.neutral`) from the band's right edge, legended, with its own tooltip
|
|
1075
|
+
row. No hatch: `hatchFill`, `HatchPattern` and `hatchSizeFor` stay removed.
|
|
1076
|
+
|
|
995
1077
|
## 2.7.3
|
|
996
1078
|
|
|
997
1079
|
_Nothing to migrate in this release._
|
|
@@ -37,6 +37,6 @@ paths:
|
|
|
37
37
|
|
|
38
38
|
## Agent
|
|
39
39
|
|
|
40
|
-
- Chat uses `basalt-ui/agent` (`useAgentThreadRuns`, `ThreadFeed`, `Composer`); never `useChat` or `Chat` from `@ai-sdk/react`. [basalt/agent-no-raw-usechat]
|
|
40
|
+
- Chat uses `basalt-ui/agent` (`useAgentThreadRuns`, `ThreadFeed`, `Composer`); never `useChat` or `Chat` from `@ai-sdk/react`. A turn is live only while `runs.get(id)?.status` is `'submitted'` or `'streaming'`; a failed turn keeps its entry as `'error'`. [basalt/agent-no-raw-usechat] [type ThreadRunState]
|
|
41
41
|
- Keep `ai` and `@ai-sdk/*` on one major across packages; an intentional split is waived with `basalt-agent-allow`, never `theme-allow`. [basalt/ai-sdk-major]
|
|
42
42
|
- End every switch over `AgentPart` with `default: return part satisfies never`. [type AgentPart]
|
|
@@ -24,7 +24,7 @@ A control has one home and takes its state from a store field; the home sets its
|
|
|
24
24
|
- A control lives in exactly one home: a `PageBar` slot (`actions`, `sync`, `filters`, `filtersEnd`, `tabs`), a `Section` slot (`actions`, `tabs`), a `WidgetHeader`/`ChartCard`/`StatCard`/`BasaltDataTable` `actions` slot, or a form row (`SettingsRow.control`, `FormRow`, `FormGroup`). A per-row action is `BasaltDataTable rowActions` (typed data: `label`, `icon`, `onClick(row)`, `danger`, `disabled(row)`), never a `Menu`/`ActionIcon` in a column `cell`/`display` renderer. [basalt/control-outside-home]
|
|
25
25
|
- A raw Mantine selection control (`Select`, `SegmentedControl`, …) in a home slot is a filter without a `field`. [basalt/hand-rolled-filter] [check-theme raw-selection-control]
|
|
26
26
|
- A basalt filter outside a slot, `FilterSet`, `PageAside` or form row has no home. [basalt/bound-control-outside-home]
|
|
27
|
-
- `PageBar` `actions` holds at most 5 entries with exactly one `primary
|
|
27
|
+
- `PageBar` `actions` holds at most 5 entries with exactly one `primary` (date navigation is `filtersEnd`, not an action); a `Section` holds at most 3 `actions`. [type PageBar] [type Section]
|
|
28
28
|
- A control in a home slot carries no `size`, `w`, `fullWidth`, `visibleFrom` or `hiddenFrom`; the home sizes it. [basalt/control-size-literal]
|
|
29
29
|
- Never render the same control twice under `visibleFrom`/`hiddenFrom`; the control swaps itself in CSS. [basalt/responsive-twin]
|
|
30
30
|
- A section, card or table title is a `WidgetHeader`; no in-body `<Title order={1|2}>`. [basalt/in-body-page-title]
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
|
|
19
19
|
## Provider
|
|
20
20
|
|
|
21
|
-
- Mount once: `createBasaltRouter({ routeTree })`, then `<BasaltProvider router={router}
|
|
21
|
+
- Mount once: `createBasaltRouter({ routeTree })`, then `<BasaltProvider router={router} />`; in a router you do not own (TanStack Start root route) pass `children` instead, with `context.queryClient`. `spotlight={false}` for an app with its own Cmd+K. It owns Mantine, Query, modals, notifications and Spotlight. [type BasaltProvider]
|
|
22
22
|
- Never pass `cssVariablesResolver` to `BasaltProvider`; retune with `theme={createBasaltTheme(...)}`. [type BasaltProvider]
|
|
23
23
|
- Read and write the color scheme with `useMantineColorScheme()` only. [check-theme localstorage-theme]
|
|
24
24
|
|
|
@@ -9,7 +9,7 @@ Procedure only; the law is `.claude/rules/basalt-*.md`.
|
|
|
9
9
|
## Scaffold
|
|
10
10
|
|
|
11
11
|
1. `bun add basalt-ui && bunx basalt-ui init` (the only `bunx` call; use `./node_modules/.bin/basalt-ui` after).
|
|
12
|
-
2. Check the seeded `src/main.tsx` (`init` writes it when absent); `basalt-ui/styles.css` is the only stylesheet import:
|
|
12
|
+
2. Check the seeded `src/main.tsx` (`init` writes it when absent; on a TanStack Start app it seeds none: render `<BasaltProvider><Outlet /></BasaltProvider>` with no `router` in the root route component, `context.queryClient` set in `getRouter()`); `spotlight={false}` drops Basalt's Cmd+K for an app with its own. `basalt-ui/styles.css` is the only stylesheet import:
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
15
|
// @check
|
|
@@ -30,7 +30,7 @@ createRoot(document.getElementById('root')!).render(<BasaltProvider router={rout
|
|
|
30
30
|
4. Install the peers of each subpath you import: read its `Install: bun add …` line in `node_modules/basalt-ui/llms.txt`; a subpath with no `Install:` line needs only the required peers listed at the top of that file.
|
|
31
31
|
5. In `vite.config.ts` spread `...basaltViteConfig({ port, apiTarget })` and register, in this order, `plugins: [tanstackRouter({ target: 'react', autoCodeSplitting: true }), react(), ...basaltAppPlugin({ name, description })]`. Run `bun add -d @tanstack/router-plugin` and import `tanstackRouter` from `@tanstack/router-plugin/vite`.
|
|
32
32
|
6. Run `vite build` once so the router plugin writes `src/routeTree.gen.ts` (`tsc -b` fails without it). Follow the repo's own convention for that file: commit it or gitignore it, never both.
|
|
33
|
-
7. In `src/routes/__root.tsx`: `<BasaltShell brand={{ name }} nav={NAV}><Outlet /></BasaltShell>`; build `NAV` with `defineNav` in `src/lib/nav.tsx`.
|
|
33
|
+
7. In `src/routes/__root.tsx`: `<BasaltShell brand={{ name }} nav={NAV}><Outlet /></BasaltShell>`; build `NAV` with `defineNav` in `src/lib/nav.tsx`. basalt has no auth seam and loaders fire before any gate component renders: gate an authenticated app in the root route's `beforeLoad` (throw `redirect`).
|
|
34
34
|
8. Add a page as a file route, and link to it with `navTarget`:
|
|
35
35
|
|
|
36
36
|
```tsx
|
|
@@ -287,12 +287,12 @@ export function Chat() {
|
|
|
287
287
|
|
|
288
288
|
1. `./node_modules/.bin/basalt-ui sync` (`--check` in CI, `--force` overwrites local edits); read its output: edited files are skipped, retired files are deleted, the AGENTS.md block is rewritten.
|
|
289
289
|
|
|
290
|
-
## Upgrade 1.x to 2.
|
|
290
|
+
## Upgrade 1.x to 2.x
|
|
291
291
|
|
|
292
|
-
1. `bun add basalt-ui@latest`, then `./node_modules/.bin/basalt-ui sync
|
|
293
|
-
2. `./node_modules/.bin/basalt-ui doctor`;
|
|
294
|
-
3.
|
|
295
|
-
4.
|
|
292
|
+
1. Be on `1.41.0` with its deprecations cleared and the gate green first (2.0 retires the deprecation lifecycle, so a consumer below 1.41 stalls on removed names). Then `bun add basalt-ui@latest`, the peers each imported subpath needs from its `Install:` line in `llms.txt` (exact pins: `bun add` accepts a mismatch silently, `doctor` `exact-peers` names it) and an `oxlint` the shipped preset supports; then `./node_modules/.bin/basalt-ui sync` (prunes retired managed files, rewrites the AGENTS.md block).
|
|
293
|
+
2. `./node_modules/.bin/basalt-ui doctor`; in a monorepo it targets the app package (`basalt.app` in the root `package.json` when two qualify). Fix each check: a tsconfig that does not extend the shipped base, retired `basalt/*` rule ids, dead `basalt` config keys, dropped subpaths.
|
|
294
|
+
3. Fix `tsc` in this order, because errors cascade: (a) specifier moves, mechanical, CSS imports included (`MIGRATING.md` § Subpaths, peers and gates; `basalt-ui/tokens.css` is gone and only `vite build` reports it: emit `basalt-ui tokens:css --out src/tokens.css` and import that file); (b) wiring: `createBasaltRouter` + `BasaltProvider` + `interface Register` (until `Register` exists every router and query-client use is `never`: dozens of unrelated errors); (c) removed root exports; (d) charts, one file at a time, not mechanical: hand-composed marks become `Lines`/`Bars`/`Sparkline`/`Heatmap` or `CartesianChart`.
|
|
295
|
+
4. Read what compiles clean but behaves differently (`MIGRATING.md` § Agent runtime: `runs.has(id)` no longer means live; § Table v9: closed sort registry, debounced search; § Transitions) and grep your code for each. Fix the preset's newly-`error` React rules (`react/refs`, `react/set-state-in-effect`, `react/immutability`, `react/globals`) at the source, never with a waiver. Then run the Verify steps above.
|
|
296
296
|
|
|
297
297
|
## Not a React app
|
|
298
298
|
|
|
@@ -16,7 +16,7 @@ that enforces it; skills are procedure, not law.
|
|
|
16
16
|
one exception.
|
|
17
17
|
|
|
18
18
|
**Before guessing an import, read the installed `llms.txt`** at the install directory (in a workspace,
|
|
19
|
-
under the depending package; `basalt-ui doctor` prints where).
|
|
19
|
+
under the depending package; `basalt-ui doctor` prints where; a fresh worktree needs `bun install` first).
|
|
20
20
|
|
|
21
21
|
@./DESIGN.md
|
|
22
22
|
|
|
@@ -14,6 +14,12 @@ export type BandSpan = {
|
|
|
14
14
|
state: string;
|
|
15
15
|
/** Overrides the state's fill — an intensity ramp WITHIN a state. `alpha(VX.*, …)`, never a hex. */
|
|
16
16
|
fill?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 0..1 of the band's width that no source sample covers, painted from its right edge in the
|
|
19
|
+
* `absentState` color. A fold owes the reader this: a band whose merge reports the one measured
|
|
20
|
+
* member of three would otherwise read as fully measured. Needs `absentState` on the strip.
|
|
21
|
+
*/
|
|
22
|
+
absentFraction?: number | undefined;
|
|
17
23
|
/**
|
|
18
24
|
* A shorter, inset bar over the band, for a fact that must not be read off the fill ramp (a
|
|
19
25
|
* renegotiation, a restart). Its color is a `states` entry, so the legend names it.
|
|
@@ -41,6 +47,13 @@ export type BandStripProps<T, X extends ChartX = ChartX> = Omit<CartesianChartPr
|
|
|
41
47
|
/** Which state, fill and marker each datum has. Memoize it: a new function recompiles the chart. */
|
|
42
48
|
getBand: (d: T) => BandSpan;
|
|
43
49
|
fold?: BandFold<T> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The `states` key that means "not measured". A band in it is flat-filled like any state; a
|
|
52
|
+
* band in another state paints its `absentFraction` share in this state's color, and the
|
|
53
|
+
* tooltip adds this state's row. Absent stays a legended, flat `VX.neutral` state, never a
|
|
54
|
+
* hatch: it reads as "no data" by hue and by sitting at the band's right edge, not as zero.
|
|
55
|
+
*/
|
|
56
|
+
absentState?: string | undefined;
|
|
44
57
|
};
|
|
45
58
|
export declare function BandStrip<T, X extends ChartX = ChartX>(props: BandStripProps<T, X>): ReactElement;
|
|
46
59
|
//# sourceMappingURL=BandStrip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../src/charts/BandStrip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../src/charts/BandStrip.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAOzC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,WAAW,EACX,MAAM,EAGP,MAAM,SAAS,CAAA;AAEhB,gGAAgG;AAChG,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CACnC,WAAW,CAAC,CAAC,CAAC,EACd,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,CAC1E,GAAG;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;CACpD,CAAA;AAED,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG;IACrB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC;;;OAGG;IACH,MAAM,CAAC,EACH;QACE,0CAA0C;QAC1C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC1B,uEAAuE;QACvE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,GACD,SAAS,CAAA;CACd,CAAA;AAED,yFAAyF;AACzF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;IACxB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B;;;;OAIG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAC7D,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACzB,OAAO,GAAG,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAClE,GAAG;IACF,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,oGAAoG;IACpG,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAA;IAC3B,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC9B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAA;AAkND,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAgJjG"}
|
package/dist/charts/BandStrip.js
CHANGED
|
@@ -3,7 +3,7 @@ import { barY } from "@tanstack/charts/bar";
|
|
|
3
3
|
import { decorative } from "@tanstack/charts/mark/decorative";
|
|
4
4
|
import { rect } from "@tanstack/charts/rect";
|
|
5
5
|
import { useCallback, useMemo } from "react";
|
|
6
|
-
import { oneOf } from "../common/errors.js";
|
|
6
|
+
import { oneOf, requiredProp } from "../common/errors.js";
|
|
7
7
|
import { NON_FINITE } from "../format/shared.js";
|
|
8
8
|
import { VX, alpha } from "../tokens/index.js";
|
|
9
9
|
import { CartesianRung } from "./CartesianChart.js";
|
|
@@ -34,51 +34,107 @@ function paintInto(layers, fill, opacity, cell) {
|
|
|
34
34
|
if (layer) layer.cells.push(cell);
|
|
35
35
|
else layers.set(key, { fill, opacity, cells: [cell] });
|
|
36
36
|
}
|
|
37
|
+
const clampFraction = (f) => f === void 0 || Number.isNaN(f) ? 0 : Math.min(1, Math.max(0, f));
|
|
38
|
+
function absentShareOf(span, absentKey) {
|
|
39
|
+
return absentKey === void 0 || span.state === absentKey ? 0 : clampFraction(span.absentFraction);
|
|
40
|
+
}
|
|
41
|
+
function resolveAbsent(span, absentKey, isVisible) {
|
|
42
|
+
const share = absentKey !== void 0 && isVisible(absentKey) ? absentShareOf(span, absentKey) : 0;
|
|
43
|
+
return { share, primaryShown: share < 1 && isVisible(span.state) };
|
|
44
|
+
}
|
|
45
|
+
const stateValue = (s, d) => s.formatValue ? s.formatValue(d) ?? NON_FINITE : "";
|
|
37
46
|
const unknownState = (prop, got, known) => new Error(oneOf("BandStrip", prop, [...known], got));
|
|
47
|
+
function paintSpan(ctx, span, cell) {
|
|
48
|
+
const { states, visible, absentKey } = ctx;
|
|
49
|
+
const state = states.get(span.state);
|
|
50
|
+
if (!state && process.env.NODE_ENV !== "production")
|
|
51
|
+
throw unknownState("BandSpan.state", span.state, states.keys());
|
|
52
|
+
if (absentKey === void 0 && clampFraction(span.absentFraction) > 0 && process.env.NODE_ENV !== "production")
|
|
53
|
+
throw new Error(
|
|
54
|
+
requiredProp("BandStrip", "absentState", "a BandSpan carries an absentFraction")
|
|
55
|
+
);
|
|
56
|
+
const { share, primaryShown } = resolveAbsent(span, absentKey, (k) => visible.has(k));
|
|
57
|
+
const primary = state ? primaryShown : share < 1;
|
|
58
|
+
const absentStyle = absentKey === void 0 ? void 0 : states.get(absentKey);
|
|
59
|
+
const split = cell.f1 - (cell.f1 - cell.f0) * share;
|
|
60
|
+
if (primary)
|
|
61
|
+
paintInto(
|
|
62
|
+
ctx.base,
|
|
63
|
+
span.fill ?? (state ? alpha(state.color, state.fillOpacity ?? 1) : UNKNOWN_FILL),
|
|
64
|
+
ctx.emphasis(span.state),
|
|
65
|
+
{ ...cell, f1: split, y0: 0, y1: 1 }
|
|
66
|
+
);
|
|
67
|
+
if (share > 0 && absentStyle && absentKey !== void 0)
|
|
68
|
+
paintInto(
|
|
69
|
+
ctx.base,
|
|
70
|
+
alpha(absentStyle.color, absentStyle.fillOpacity ?? 1),
|
|
71
|
+
ctx.emphasis(absentKey),
|
|
72
|
+
{ f0: split, f1: cell.f1, y0: 0, y1: 1 }
|
|
73
|
+
);
|
|
74
|
+
if (span.marker && primary) {
|
|
75
|
+
const markerKey = span.marker.state ?? span.state;
|
|
76
|
+
const markerState = states.get(markerKey);
|
|
77
|
+
if (!markerState && process.env.NODE_ENV !== "production")
|
|
78
|
+
throw unknownState("BandSpan.marker.state", markerKey, states.keys());
|
|
79
|
+
if (!markerState || visible.has(markerKey)) {
|
|
80
|
+
const inset = (span.marker.inset ?? DEFAULT_MARKER_INSET) / Math.max(ctx.height, 1);
|
|
81
|
+
paintInto(ctx.markers, markerState?.color ?? UNKNOWN_FILL, ctx.emphasis(markerKey), {
|
|
82
|
+
...cell,
|
|
83
|
+
f1: split,
|
|
84
|
+
y0: inset,
|
|
85
|
+
y1: 1 - inset
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { primary: primary && state !== void 0, absent: share > 0 };
|
|
90
|
+
}
|
|
38
91
|
function layoutBands(input) {
|
|
39
|
-
const { data, getBand, fold,
|
|
92
|
+
const { data, getBand, fold, absentState: absentKey } = input;
|
|
40
93
|
const cap = Math.floor(input.width / (fold?.minBandPx ?? DEFAULT_MIN_BAND_PX));
|
|
41
94
|
const groups = fold && data.length > cap ? groupsOf(data, cap) : data.map((d, start) => ({ start, items: [d] }));
|
|
42
|
-
const
|
|
43
|
-
|
|
95
|
+
const ctx = {
|
|
96
|
+
base: /* @__PURE__ */ new Map(),
|
|
97
|
+
markers: /* @__PURE__ */ new Map(),
|
|
98
|
+
states: input.states,
|
|
99
|
+
visible: input.visible,
|
|
100
|
+
height: input.height,
|
|
101
|
+
emphasis: input.emphasis,
|
|
102
|
+
absentKey
|
|
103
|
+
};
|
|
44
104
|
const hits = [];
|
|
45
105
|
for (const g of groups) {
|
|
46
106
|
const datum = fold && g.items.length > 1 ? fold.merge(g.items) : g.items[0];
|
|
47
107
|
if (datum === void 0) continue;
|
|
48
108
|
const span = getBand(datum);
|
|
49
|
-
const state = states.get(span.state);
|
|
50
|
-
if (!state && process.env.NODE_ENV !== "production")
|
|
51
|
-
throw unknownState("BandSpan.state", span.state, states.keys());
|
|
52
|
-
if (state && !visible.has(span.state)) continue;
|
|
53
109
|
const cell = { f0: g.start / data.length, f1: (g.start + g.items.length) / data.length };
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
61
|
-
if (span.marker) {
|
|
62
|
-
const markerKey = span.marker.state ?? span.state;
|
|
63
|
-
const markerState = states.get(markerKey);
|
|
64
|
-
if (!markerState && process.env.NODE_ENV !== "production")
|
|
65
|
-
throw unknownState("BandSpan.marker.state", markerKey, states.keys());
|
|
66
|
-
if (!markerState || visible.has(markerKey)) {
|
|
67
|
-
const inset = (span.marker.inset ?? DEFAULT_MARKER_INSET) / Math.max(input.height, 1);
|
|
68
|
-
paintInto(markers, markerState?.color ?? UNKNOWN_FILL, input.emphasis(markerKey), {
|
|
69
|
-
...cell,
|
|
70
|
-
y0: inset,
|
|
71
|
-
y1: 1 - inset
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (state) for (const source of g.items) hits.push({ source, state: span.state, datum });
|
|
110
|
+
const answers = paintSpan(ctx, span, cell);
|
|
111
|
+
g.items.forEach((source, i) => {
|
|
112
|
+
const slot = g.start + i;
|
|
113
|
+
if (answers.primary) hits.push({ slot, source, state: span.state, datum });
|
|
114
|
+
if (answers.absent && absentKey !== void 0)
|
|
115
|
+
hits.push({ slot, source, state: absentKey, datum });
|
|
116
|
+
});
|
|
76
117
|
}
|
|
77
|
-
return { base: [...base.values()], markers: [...markers.values()], hits };
|
|
118
|
+
return { base: [...ctx.base.values()], markers: [...ctx.markers.values()], hits };
|
|
78
119
|
}
|
|
79
120
|
function BandStrip(props) {
|
|
80
|
-
const {
|
|
121
|
+
const {
|
|
122
|
+
states,
|
|
123
|
+
getBand,
|
|
124
|
+
fold,
|
|
125
|
+
absentState,
|
|
126
|
+
cursorResolution = "leading",
|
|
127
|
+
tooltip,
|
|
128
|
+
...rest
|
|
129
|
+
} = props;
|
|
81
130
|
const { data, x } = rest;
|
|
131
|
+
const absentKey = absentState !== void 0 && states.some((s) => s.key === absentState) ? absentState : void 0;
|
|
132
|
+
if (absentState !== void 0 && absentKey === void 0 && process.env.NODE_ENV !== "production")
|
|
133
|
+
throw unknownState(
|
|
134
|
+
"BandStrip.absentState",
|
|
135
|
+
absentState,
|
|
136
|
+
states.map((s) => s.key)
|
|
137
|
+
);
|
|
82
138
|
const series = useMemo(
|
|
83
139
|
() => states.map((s) => ({
|
|
84
140
|
key: s.key,
|
|
@@ -88,10 +144,15 @@ function BandStrip(props) {
|
|
|
88
144
|
...s.tooltip !== void 0 && { tooltip: s.tooltip },
|
|
89
145
|
...s.legend !== void 0 && { legend: s.legend },
|
|
90
146
|
...s.note !== void 0 && { note: s.note },
|
|
91
|
-
getValue: (d) =>
|
|
92
|
-
|
|
147
|
+
getValue: (d) => {
|
|
148
|
+
const span = getBand(d);
|
|
149
|
+
const share = absentShareOf(span, absentKey);
|
|
150
|
+
if (span.state === s.key) return share < 1 ? 1 : null;
|
|
151
|
+
return s.key === absentKey && share > 0 ? 1 : null;
|
|
152
|
+
},
|
|
153
|
+
formatValue: (_v, d) => stateValue(s, d)
|
|
93
154
|
})),
|
|
94
|
-
[states, getBand]
|
|
155
|
+
[states, getBand, absentKey]
|
|
95
156
|
);
|
|
96
157
|
const marks = useCallback(
|
|
97
158
|
(plot) => {
|
|
@@ -99,18 +160,19 @@ function BandStrip(props) {
|
|
|
99
160
|
data,
|
|
100
161
|
getBand,
|
|
101
162
|
fold,
|
|
163
|
+
absentState: absentKey,
|
|
102
164
|
states: new Map(states.map((s) => [s.key, s])),
|
|
103
165
|
visible: new Set(plot.visible.map((s) => s.key)),
|
|
104
166
|
width: plot.width,
|
|
105
167
|
height: plot.height,
|
|
106
168
|
emphasis: (key) => emphasis(plot.highlighted, { key })
|
|
107
169
|
});
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
y: 1,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
})
|
|
170
|
+
const rowKeys = /* @__PURE__ */ new Map();
|
|
171
|
+
const rows = hits.map((h) => {
|
|
172
|
+
const row = { x: x(h.source), y: 1, series: h.state, datum: h.datum };
|
|
173
|
+
rowKeys.set(row, `${h.slot}|${h.state}`);
|
|
174
|
+
return row;
|
|
175
|
+
});
|
|
114
176
|
return [
|
|
115
177
|
...[...base, ...markers].map(
|
|
116
178
|
({ fill, opacity, cells }, i) => decorative(
|
|
@@ -127,11 +189,47 @@ function BandStrip(props) {
|
|
|
127
189
|
})
|
|
128
190
|
)
|
|
129
191
|
),
|
|
130
|
-
...rows.length > 0 ? [
|
|
192
|
+
...rows.length > 0 ? [
|
|
193
|
+
barY(rows, {
|
|
194
|
+
id: "hit",
|
|
195
|
+
// One row per source slot and state, whatever the x values look like.
|
|
196
|
+
key: (r) => rowKeys.get(r) ?? "",
|
|
197
|
+
x: rowX,
|
|
198
|
+
y1: 0,
|
|
199
|
+
y2: 1,
|
|
200
|
+
fill: "transparent"
|
|
201
|
+
})
|
|
202
|
+
] : []
|
|
131
203
|
];
|
|
132
204
|
},
|
|
133
|
-
[states, getBand, fold, data, x]
|
|
205
|
+
[states, getBand, fold, absentKey, data, x]
|
|
134
206
|
);
|
|
207
|
+
const tooltipWithPrimary = useMemo(() => {
|
|
208
|
+
if (tooltip === false || absentKey === void 0) return tooltip;
|
|
209
|
+
return {
|
|
210
|
+
...tooltip,
|
|
211
|
+
rows: (d, ctx) => {
|
|
212
|
+
const span = getBand(d);
|
|
213
|
+
const primary = states.find((s) => s.key === span.state);
|
|
214
|
+
const { primaryShown } = resolveAbsent(
|
|
215
|
+
span,
|
|
216
|
+
absentKey,
|
|
217
|
+
(k) => ctx.visible.some((s) => s.key === k)
|
|
218
|
+
);
|
|
219
|
+
const readdPrimary = primary?.tooltip !== false && primary && primaryShown && absentShareOf(span, absentKey) === 1;
|
|
220
|
+
return [
|
|
221
|
+
...readdPrimary ? [
|
|
222
|
+
{
|
|
223
|
+
label: primary.note === void 0 ? primary.label : `${primary.label} \xB7 ${primary.note}`,
|
|
224
|
+
value: stateValue(primary, d),
|
|
225
|
+
color: primary.color
|
|
226
|
+
}
|
|
227
|
+
] : [],
|
|
228
|
+
...tooltip?.rows?.(d, ctx) ?? []
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}, [tooltip, absentKey, getBand, states]);
|
|
135
233
|
return /* @__PURE__ */ jsx(
|
|
136
234
|
CartesianRung,
|
|
137
235
|
{
|
|
@@ -142,7 +240,7 @@ function BandStrip(props) {
|
|
|
142
240
|
y: STRIP_AXIS,
|
|
143
241
|
xZones: ZX_ANCHOR,
|
|
144
242
|
cursorResolution,
|
|
145
|
-
...
|
|
243
|
+
...tooltipWithPrimary !== void 0 && { tooltip: tooltipWithPrimary }
|
|
146
244
|
}
|
|
147
245
|
);
|
|
148
246
|
}
|
|
@@ -13,6 +13,11 @@ export declare function tsconfigBaseCheck(cwd: string): Check;
|
|
|
13
13
|
export declare function retiredLintRulesCheck(cwd: string, install: BasaltInstall): Check;
|
|
14
14
|
/** `dropped-subpaths`: `basalt-ui/<subpath>` imports the installed `exports` map does not have. */
|
|
15
15
|
export declare function droppedSubpathsCheck(cwd: string, cfg: BasaltConfig, install: BasaltInstall): Check;
|
|
16
|
+
/**
|
|
17
|
+
* `oxlint-floor`: fails when the nearest installed oxlint is older than {@link OXLINT_FLOOR}, which
|
|
18
|
+
* cannot parse the preset. Reads `cwd`, as `oxlint-preset` does; a missing oxlint is that check's job.
|
|
19
|
+
*/
|
|
20
|
+
export declare function oxlintFloorCheck(cwd: string): Check;
|
|
16
21
|
/**
|
|
17
22
|
* `init`'s tsconfig step: make the tsconfig that covers `src` (`tsconfig.json`, or the reference that
|
|
18
23
|
* includes `src` in a stock Vite app) extend the preset, by inserting the key textually (the file is
|
|
@@ -20,6 +25,12 @@ export declare function droppedSubpathsCheck(cwd: string, cfg: BasaltConfig, ins
|
|
|
20
25
|
* needs saying.
|
|
21
26
|
*/
|
|
22
27
|
export declare function seedTsconfigExtends(cwd: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Warnings for a Start app's embedded provider; heuristics, not proofs. A `{...spread}` on the tag
|
|
30
|
+
* could carry a `router`; `src/router.tsx` never mentioning `queryClient` means the embedded
|
|
31
|
+
* provider will find no `context.queryClient`. Empty when there is nothing to judge.
|
|
32
|
+
*/
|
|
33
|
+
export declare function startWiringWarnings(cwd: string): string[];
|
|
23
34
|
/**
|
|
24
35
|
* `app-wiring`: the entry module `index.html` loads (default src/main.tsx) mounts `BasaltProvider`
|
|
25
36
|
* on a `createBasaltRouter` router (called in the entry or a module it imports), and the router tree is generated: the vite config calls a
|