basalt-ui 2.9.0 → 2.10.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 +51 -34
- package/MIGRATING.md +43 -12
- package/configs/oxlint.json +4 -0
- package/dist/charts/BandStrip.d.ts +6 -4
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +8 -8
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +4 -3
- package/dist/charts/MirroredBars.d.ts +16 -5
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/MirroredBars.js +46 -9
- package/dist/charts/band-fold.d.ts +6 -0
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +11 -1
- package/dist/charts/legend.d.ts +2 -0
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +14 -10
- package/dist/charts/types.d.ts +7 -1
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +7 -2
- package/dist/cli/doctor-upgrade.d.ts +9 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +14 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +4 -0
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -2
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +6 -0
- package/dist/cli/router-wiring.d.ts +4 -2
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +2 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +11 -4
- package/dist/controls/enum-filter.d.ts +4 -1
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +2 -1
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +2 -0
- package/llms.txt +8 -7
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +17 -15
- package/src/charts/CartesianChart.tsx +3 -2
- package/src/charts/MirroredBars.tsx +71 -18
- package/src/charts/band-fold.ts +21 -0
- package/src/charts/legend.tsx +21 -12
- package/src/charts/types.ts +7 -1
- package/src/cli/config.ts +17 -1
- package/src/cli/doctor-upgrade.ts +23 -1
- package/src/cli/doctor.ts +4 -0
- package/src/cli/index.ts +8 -4
- package/src/cli/init.ts +7 -0
- package/src/cli/router-wiring.ts +6 -2
- package/src/cli/sync.ts +19 -5
- package/src/controls/enum-filter.tsx +5 -1
- package/src/controls/number-filter.tsx +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
# [2.
|
|
1
|
+
# [2.10.0](https://github.com/jkrumm/basalt-ui/compare/v2.9.1...v2.10.0) (2026-10-15)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
* address review of the 1.x compat removal ([8c7918f](https://github.com/jkrumm/basalt-ui/commit/8c7918f08fa66ef1712111ab2ef15a47ea41014e))
|
|
8
|
-
* clear a shell-less page bar from section anchors ([9df0585](https://github.com/jkrumm/basalt-ui/commit/9df0585ccd493fc65372fdc8d4a933db32ea5666)), closes [#anchor](https://github.com/jkrumm/basalt-ui/issues/anchor)
|
|
9
|
-
* guide a settings-row selection to a bound filter ([e1136b7](https://github.com/jkrumm/basalt-ui/commit/e1136b7d4ab362bf094209d0f8752d8a5f9106f4))
|
|
10
|
-
* home a settings-row control prop in the raw-selection-control scan ([d2b955c](https://github.com/jkrumm/basalt-ui/commit/d2b955ca7a38c9982705be285df6db91fac40dca))
|
|
11
|
-
* let sync run from a workspace app and name its bin ([5cf854f](https://github.com/jkrumm/basalt-ui/commit/5cf854f2a0613b3b1a8503d33b94ec95487a7a10))
|
|
12
|
-
* print unions in an llms.txt glossary instead of rewriting signatures ([6b8d917](https://github.com/jkrumm/basalt-ui/commit/6b8d91792781266581c11a4b7dddd39b9ca8e2ab))
|
|
13
|
-
* re-aim a cold hash load once the page bar is measured ([a218a89](https://github.com/jkrumm/basalt-ui/commit/a218a8948a316933b360e98a3b5b39caf0e48a4b))
|
|
14
|
-
* settle a toc click on a quiet scroller, not a fixed deadline ([e14cb8d](https://github.com/jkrumm/basalt-ui/commit/e14cb8d53726d9f18082b7bf28883e93344ee1ae))
|
|
15
|
-
* share one install-root predicate between sync and doctor ([9d85846](https://github.com/jkrumm/basalt-ui/commit/9d858467bd4d71f55b62d0404b0607cc201d3f9f))
|
|
16
|
-
* spell out unions, token maps and constants in llms.txt ([ec1a4e1](https://github.com/jkrumm/basalt-ui/commit/ec1a4e14e328a5caaa513485438e6fe23a2b8156))
|
|
6
|
+
* name the unset state of a preset number filter ([ed43eeb](https://github.com/jkrumm/basalt-ui/commit/ed43eeb0cde5a1ff1bc42ae118ab637d08007d64))
|
|
17
7
|
|
|
18
8
|
|
|
19
9
|
### Features
|
|
20
10
|
|
|
21
|
-
*
|
|
22
|
-
* name the unset state of a number filter ([02ed3ba](https://github.com/jkrumm/basalt-ui/commit/02ed3bacc5094fca61401795a6440513754150aa))
|
|
23
|
-
* remove the 1.x compatibility layer from 2.x ([66f4517](https://github.com/jkrumm/basalt-ui/commit/66f4517df998f5a304a90d2cd9824654772de31d))
|
|
11
|
+
* band charts hide a pending legend and mirror their fills ([22a491e](https://github.com/jkrumm/basalt-ui/commit/22a491ef5cfdbcd9bfac1c5284c8566f453b50af))
|
|
24
12
|
|
|
25
|
-
## [2.
|
|
13
|
+
## [2.9.1](https://github.com/jkrumm/basalt-ui/compare/v2.9.0...v2.9.1) (2026-10-15)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- declare shell-less apps with basalt.shell, scope the route override ([0ea148d](https://github.com/jkrumm/basalt-ui/commit/0ea148d8949a37a65e91b5d0cf9ffaa04c6f98c7))
|
|
18
|
+
- route files lint clean under the shipped preset ([a51c1ee](https://github.com/jkrumm/basalt-ui/commit/a51c1ee4e9f6c1b9d81902e74d87340be73caaaa))
|
|
19
|
+
- shell-less apps get no nav seed ([9944893](https://github.com/jkrumm/basalt-ui/commit/994489391b46ee944acb57032de99746aae35019))
|
|
20
|
+
|
|
21
|
+
# [2.9.0](https://github.com/jkrumm/basalt-ui/compare/v2.8.1...v2.9.0) (2026-10-15)
|
|
26
22
|
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- activate the last toc entry at the end of the scroll ([797f41d](https://github.com/jkrumm/basalt-ui/commit/797f41df602cd8835629f430ae26fc03a3c14909))
|
|
26
|
+
- address review of the 1.x compat removal ([8c7918f](https://github.com/jkrumm/basalt-ui/commit/8c7918f08fa66ef1712111ab2ef15a47ea41014e))
|
|
27
|
+
- clear a shell-less page bar from section anchors ([9df0585](https://github.com/jkrumm/basalt-ui/commit/9df0585ccd493fc65372fdc8d4a933db32ea5666)), closes [#anchor](https://github.com/jkrumm/basalt-ui/issues/anchor)
|
|
28
|
+
- guide a settings-row selection to a bound filter ([e1136b7](https://github.com/jkrumm/basalt-ui/commit/e1136b7d4ab362bf094209d0f8752d8a5f9106f4))
|
|
29
|
+
- home a settings-row control prop in the raw-selection-control scan ([d2b955c](https://github.com/jkrumm/basalt-ui/commit/d2b955ca7a38c9982705be285df6db91fac40dca))
|
|
30
|
+
- let sync run from a workspace app and name its bin ([5cf854f](https://github.com/jkrumm/basalt-ui/commit/5cf854f2a0613b3b1a8503d33b94ec95487a7a10))
|
|
31
|
+
- print unions in an llms.txt glossary instead of rewriting signatures ([6b8d917](https://github.com/jkrumm/basalt-ui/commit/6b8d91792781266581c11a4b7dddd39b9ca8e2ab))
|
|
32
|
+
- re-aim a cold hash load once the page bar is measured ([a218a89](https://github.com/jkrumm/basalt-ui/commit/a218a8948a316933b360e98a3b5b39caf0e48a4b))
|
|
33
|
+
- settle a toc click on a quiet scroller, not a fixed deadline ([e14cb8d](https://github.com/jkrumm/basalt-ui/commit/e14cb8d53726d9f18082b7bf28883e93344ee1ae))
|
|
34
|
+
- share one install-root predicate between sync and doctor ([9d85846](https://github.com/jkrumm/basalt-ui/commit/9d858467bd4d71f55b62d0404b0607cc201d3f9f))
|
|
35
|
+
- spell out unions, token maps and constants in llms.txt ([ec1a4e1](https://github.com/jkrumm/basalt-ui/commit/ec1a4e14e328a5caaa513485438e6fe23a2b8156))
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- export foldBands for testing a band merge ([8343f19](https://github.com/jkrumm/basalt-ui/commit/8343f1985fffef07447ce202f512b17ebbf3ce7c))
|
|
40
|
+
- name the unset state of a number filter ([02ed3ba](https://github.com/jkrumm/basalt-ui/commit/02ed3bacc5094fca61401795a6440513754150aa))
|
|
41
|
+
- remove the 1.x compatibility layer from 2.x ([66f4517](https://github.com/jkrumm/basalt-ui/commit/66f4517df998f5a304a90d2cd9824654772de31d))
|
|
42
|
+
|
|
43
|
+
## [2.8.1](https://github.com/jkrumm/basalt-ui/compare/v2.8.0...v2.8.1) (2026-10-15)
|
|
27
44
|
|
|
28
45
|
### Bug Fixes
|
|
29
46
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
- anchor code-routed detection to real imports and calls ([115f8b4](https://github.com/jkrumm/basalt-ui/commit/115f8b40b2013b5dc613c83c6ec112b4e8b7e111))
|
|
48
|
+
- bound the mermaid import matcher and widen sanitizer tests ([4f6f39a](https://github.com/jkrumm/basalt-ui/commit/4f6f39a4469527277b5f0d3ec476d5f7c597858f))
|
|
49
|
+
- classify code-routed apps by wiring, keep seeds self-healing ([e07d38b](https://github.com/jkrumm/basalt-ui/commit/e07d38b13436485d13f07ceb4e5f6029e77aa5b9))
|
|
50
|
+
- keep dev-only chunks out of production builds ([fab9b09](https://github.com/jkrumm/basalt-ui/commit/fab9b0927aadbc0bbf93d88466ed15dd2dbadba4))
|
|
51
|
+
- keep the code block copy button clear of the first line ([c02498a](https://github.com/jkrumm/basalt-ui/commit/c02498aab9c1c38f5fb1f195a2aa02d10cabd09c))
|
|
52
|
+
- let sync and doctor accept a code-defined route tree ([9bb8571](https://github.com/jkrumm/basalt-ui/commit/9bb857153a2a441293dec3271fa3db45f11ed561))
|
|
53
|
+
- move router detection into a leaf module and require calls ([fb147a7](https://github.com/jkrumm/basalt-ui/commit/fb147a7ff571afe9a47c6f4f237cd2a937c98d9c))
|
|
54
|
+
- one code-routed predicate for init, sync and doctor ([9611d34](https://github.com/jkrumm/basalt-ui/commit/9611d34ecee1bcdf1c8e9c9260d52037403efd0c))
|
|
55
|
+
- paint the stored color scheme before the app boots ([14dd4ff](https://github.com/jkrumm/basalt-ui/commit/14dd4ff1dac2fbd8feaf8258594c60e349afd0b1))
|
|
56
|
+
- reset the fallback pre margin and pin the copy button reserve ([4955f4f](https://github.com/jkrumm/basalt-ui/commit/4955f4f1e30a88c7f64bb02c4b0259f4390c974d))
|
|
57
|
+
- run dropped-subpaths for tokens-only consumers in doctor ([2da07a7](https://github.com/jkrumm/basalt-ui/commit/2da07a7497e1c1c2bcdb72f8c9cd8ad6858118d9))
|
|
58
|
+
- scope the boot script, move the boot subsystem to vite-boot.ts ([b37a44e](https://github.com/jkrumm/basalt-ui/commit/b37a44e1dd9acdd6243ad1cdd592597cd40f4d12))
|
|
59
|
+
- scope the mermaid font sanitizer to style blocks ([e0dacfe](https://github.com/jkrumm/basalt-ui/commit/e0dacfefc3e6afa40794d27b58494c20e9f9c1f2))
|
|
60
|
+
- stop calling a code-defined route tree generated in doctor output ([838e3f3](https://github.com/jkrumm/basalt-ui/commit/838e3f3cee83ceaa3f5ad1b3b05fdd3ebf7d2e47))
|
|
61
|
+
- strip the remote font import from mermaid diagrams ([5e5fc8f](https://github.com/jkrumm/basalt-ui/commit/5e5fc8f3c346c58aadc5640ad87e429379a92bc7))
|
|
62
|
+
- tighten the boot subsystem types and share the plugin test fixtures ([d3f828a](https://github.com/jkrumm/basalt-ui/commit/d3f828a5598e9c0a98e9cff597ce5caf76ea2761))
|
|
63
|
+
- tighten the dev-chunk gate and the provider ceiling ([0b280b0](https://github.com/jkrumm/basalt-ui/commit/0b280b0bf15034d7edfebab567a5877afdea99fb))
|
|
64
|
+
- unquote the font-family var in mermaid diagrams ([9c2e485](https://github.com/jkrumm/basalt-ui/commit/9c2e485c415d6c3df4eefd4e3d5406e415c71d47))
|
|
48
65
|
|
|
49
66
|
# [2.8.0](https://github.com/jkrumm/basalt-ui/compare/v2.7.3...v2.8.0) (2026-10-15)
|
|
50
67
|
|
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 | 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 | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 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`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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 | — |
|
|
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 | — |
|
|
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 | 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 | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 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`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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 | — | — | — |
|
|
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 | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -1046,6 +1046,18 @@ 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.10.0 — preset filters honour `.labels()`
|
|
1050
|
+
|
|
1051
|
+
- `NumberFilter` with `options`: a value `.labels()` names (`{ 0: 'Any' }`) now reads as that name in the pill though it is not an option, as the stepper form already did; no `Any` row needed. **Opt-out: none — drop the literal row if you added one.**
|
|
1052
|
+
- **A `state` chart hides its legend (every kind).** `pending`, `error` and `empty` conceal the legend (`visibility: hidden`, plus `aria-hidden`) instead of listing series over a plot with no marks; its row is kept, so the chart does not shift when the data arrives (layout-probed: `Lines`, `BandStrip`, `MirroredBars`; error and empty on `BandStrip`). **Opt-out: none.**
|
|
1053
|
+
- **`MirroredBars` takes `absentState`** (a `series` key, as `BandStrip.absentState`): that entry's colour (and `fillOpacity`) fills the absent share and its legend entry labels it; hiding the entry in the legend widens the measured bars to the full cell. Unset, the share stays `--vx-neutral` with no legend entry. A key naming no entry throws in dev and falls back to unset in production.
|
|
1054
|
+
- **`BandStrip` legend swatches mirror a state's `fillOpacity`** (a state at 0.14 no longer draws a solid swatch over a pale plot).
|
|
1055
|
+
- **`height` is the frame in every kind** (documented, nothing changes): a `BandStrip` or `MirroredBars` frame is the plot plus the x axis, so a band of a given height is `height` less the axis (about 21 px at the default font and density: a 44 px band is `height: 65`). No `plotHeight` prop.
|
|
1056
|
+
|
|
1057
|
+
## 2.9.1
|
|
1058
|
+
|
|
1059
|
+
_Nothing to migrate in this release._
|
|
1060
|
+
|
|
1049
1061
|
## 2.9.0 — 1.x compatibility layer removed
|
|
1050
1062
|
|
|
1051
1063
|
2.x carried leftovers of the 1.x line; each one is gone, and each has one replacement. **Opt-out: none — use the replacement.** The 1.x → 2.0 upgrade tooling (`RETIRED_RULE_IDS`, the retired-lint-rules and dropped-subpath fixes, the older `unknown-vx-token` removals) is unchanged.
|
|
@@ -1079,6 +1091,25 @@ release renames it and opens a new one here._
|
|
|
1079
1091
|
|
|
1080
1092
|
`NumberFilter`'s stepper pill prints a value `.labels()` names — `createSearchStore(…).labels({ minDuration: { 0: 'Any' } })` reads "Any" at the default (a number field's `options` now lists exactly the labelled values); unlabelled, it prints the number as before — nothing to migrate.
|
|
1081
1093
|
|
|
1094
|
+
New config key `basalt.shell: false` (default `true`) for an app that never renders `BasaltShell`: `init`/`sync` then place neither `src/lib/nav.tsx` nor `src/routes/__root.tsx` (the root route imports the nav module) and retire a tracked entry with a notice, leaving the file yours; `doctor` warns if the app still renders `<BasaltShell`. Declared, not inferred.
|
|
1095
|
+
|
|
1096
|
+
The shipped oxlint preset turns `react(only-export-components)` off under `**/routes/**` and `__root.tsx`: the TanStack router plugin owns fast refresh for route files, and `allowExportNames: ['Route']` alone still warned on the file's local component. Other files keep the warning.
|
|
1097
|
+
|
|
1098
|
+
tsconfig: the preset's `exactOptionalPropertyTypes` rejects `x | undefined` for Mantine props typed without `| undefined` (`c`, `td`, `pl`, `style`). Spread conditionally:
|
|
1099
|
+
|
|
1100
|
+
```tsx
|
|
1101
|
+
<Text {...(color !== undefined && { c: color })} {...(style !== undefined && { style })} />
|
|
1102
|
+
```
|
|
1103
|
+
|
|
1104
|
+
lint: the 2.x preset's `react/refs` errors on the render-time `ref.current = value` latest-value pattern. Write it in an effect, or read it through `useEffectEvent`:
|
|
1105
|
+
|
|
1106
|
+
```tsx
|
|
1107
|
+
useEffect(() => {
|
|
1108
|
+
latest.current = value
|
|
1109
|
+
}) // instead of `latest.current = value` in render
|
|
1110
|
+
const onTick = useEffectEvent(() => handler(value)) // or: no ref at all, call from effects
|
|
1111
|
+
```
|
|
1112
|
+
|
|
1082
1113
|
## 2.8.1 — boot paint follows the stored scheme
|
|
1083
1114
|
|
|
1084
1115
|
`basaltAppPlugin` now injects a tiny inline head script that reads Mantine's stored color scheme
|
package/configs/oxlint.json
CHANGED
|
@@ -42,8 +42,10 @@ export type BandFold<T> = {
|
|
|
42
42
|
*/
|
|
43
43
|
merge: (group: T[]) => T;
|
|
44
44
|
};
|
|
45
|
-
export type BandStripProps<T, X extends ChartX = ChartX> = Omit<CartesianChartProps<T, X>, 'marks' | 'series' | 'y' | 'y2' | 'zones' | 'xZones' | 'refLines'> & {
|
|
46
|
-
states: readonly BandStripSeries<T>
|
|
45
|
+
export type BandStripProps<T, X extends ChartX = ChartX, K extends string = string> = Omit<CartesianChartProps<T, X>, 'marks' | 'series' | 'y' | 'y2' | 'zones' | 'xZones' | 'refLines'> & {
|
|
46
|
+
states: readonly (BandStripSeries<T> & {
|
|
47
|
+
key: K;
|
|
48
|
+
})[];
|
|
47
49
|
/** Which state, fill and marker each datum has. Memoize it: a new function recompiles the chart. */
|
|
48
50
|
getBand: (d: T) => BandSpan;
|
|
49
51
|
fold?: BandFold<T> | undefined;
|
|
@@ -53,7 +55,7 @@ export type BandStripProps<T, X extends ChartX = ChartX> = Omit<CartesianChartPr
|
|
|
53
55
|
* tooltip adds this state's row. Absent stays a legended, flat state, never a
|
|
54
56
|
* hatch: it reads as "no data" by hue and by sitting at the band's right edge, not as zero.
|
|
55
57
|
*/
|
|
56
|
-
absentState?:
|
|
58
|
+
absentState?: K | undefined;
|
|
57
59
|
};
|
|
58
|
-
export declare function BandStrip<T, X extends ChartX = ChartX>(props: BandStripProps<T, X>): ReactElement;
|
|
60
|
+
export declare function BandStrip<T, X extends ChartX = ChartX, K extends string = string>(props: BandStripProps<T, X, K>): ReactElement;
|
|
59
61
|
//# 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":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AASzC,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,GAA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AAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAC/E,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC7B,YAAY,CA+Id"}
|
package/dist/charts/BandStrip.js
CHANGED
|
@@ -7,7 +7,7 @@ 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";
|
|
10
|
-
import { groupsOf } from "./band-fold.js";
|
|
10
|
+
import { groupsOf, resolveNamedState } from "./band-fold.js";
|
|
11
11
|
import { emphasis } from "./marks.js";
|
|
12
12
|
import { rowX } from "./types.js";
|
|
13
13
|
const DEFAULT_MIN_BAND_PX = 3;
|
|
@@ -119,19 +119,19 @@ function BandStrip(props) {
|
|
|
119
119
|
...rest
|
|
120
120
|
} = props;
|
|
121
121
|
const { data, x } = rest;
|
|
122
|
-
const absentKey =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
);
|
|
122
|
+
const absentKey = resolveNamedState(
|
|
123
|
+
"BandStrip",
|
|
124
|
+
"BandStrip.absentState",
|
|
125
|
+
absentState,
|
|
126
|
+
states.map((s) => s.key)
|
|
127
|
+
);
|
|
129
128
|
const series = useMemo(
|
|
130
129
|
() => states.map((s) => ({
|
|
131
130
|
key: s.key,
|
|
132
131
|
label: s.label,
|
|
133
132
|
color: s.color,
|
|
134
133
|
mark: "bar",
|
|
134
|
+
...s.fillOpacity !== void 0 && { fillOpacity: s.fillOpacity },
|
|
135
135
|
...s.tooltip !== void 0 && { tooltip: s.tooltip },
|
|
136
136
|
...s.legend !== void 0 && { legend: s.legend },
|
|
137
137
|
...s.note !== void 0 && { note: s.note },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../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CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CAwErE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAC/C,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,WAAW,GAC7C,YAAY,CAwBd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChD,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,YAAY,CAEd"}
|
|
@@ -48,6 +48,7 @@ function ChartShell(props) {
|
|
|
48
48
|
return next;
|
|
49
49
|
});
|
|
50
50
|
}, []);
|
|
51
|
+
const resolved = resolveChartState(state);
|
|
51
52
|
const legendNode = useMemo(
|
|
52
53
|
() => shown ? /* @__PURE__ */ jsx(
|
|
53
54
|
ChartLegend,
|
|
@@ -58,14 +59,14 @@ function ChartShell(props) {
|
|
|
58
59
|
groups: config?.groups === true,
|
|
59
60
|
toggle,
|
|
60
61
|
onToggle,
|
|
61
|
-
onHighlight: setHighlighted
|
|
62
|
+
onHighlight: setHighlighted,
|
|
63
|
+
concealed: resolved !== null
|
|
62
64
|
}
|
|
63
65
|
) : null,
|
|
64
|
-
[shown, series, hidden, config?.groups, toggle, onToggle]
|
|
66
|
+
[shown, series, hidden, config?.groups, toggle, onToggle, resolved]
|
|
65
67
|
);
|
|
66
68
|
const atTop = config?.placement === "top" || config?.placement === "header";
|
|
67
69
|
const asHeaderRow = config?.placement === "header" && inCard;
|
|
68
|
-
const resolved = resolveChartState(state);
|
|
69
70
|
return /* @__PURE__ */ jsxs(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
@@ -15,18 +15,29 @@ export type MirroredBarPane = {
|
|
|
15
15
|
format: (v: number) => string;
|
|
16
16
|
};
|
|
17
17
|
/** A bar series. Any entry that is neither pane is legend-only (give it `getValue: () => null`). */
|
|
18
|
-
export type MirroredBarsSeries<T> = Pick<ChartSeries<T>, '
|
|
19
|
-
|
|
18
|
+
export type MirroredBarsSeries<T, K extends string = string> = Pick<ChartSeries<T>, 'label' | 'color' | 'getValue' | 'formatValue' | 'tooltip' | 'legend' | 'role' | 'note'> & {
|
|
19
|
+
key: K;
|
|
20
|
+
/** Read for the `absentState` entry only (its fill and swatch); the panes draw at full colour. */
|
|
21
|
+
fillOpacity?: number | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type MirroredBarsProps<T, X extends ChartX = ChartX, K extends string = string> = Pick<CartesianChartProps<T, X>, 'ariaLabel' | 'data' | 'x' | 'formatX' | 'legend' | 'height' | 'state' | 'cursorGroup' | 'tooltip' | 'className' | 'style'> & {
|
|
20
24
|
/** The single source of colours, legend entries and tooltip rows. */
|
|
21
|
-
series: readonly MirroredBarsSeries<T>[];
|
|
25
|
+
series: readonly MirroredBarsSeries<T, K>[];
|
|
22
26
|
/** Drawn above the baseline. */
|
|
23
27
|
up: MirroredBarPane;
|
|
24
28
|
/** Drawn below the baseline. */
|
|
25
29
|
down: MirroredBarPane;
|
|
26
30
|
/** The up pane's share of the height. Default 0.35: the pair is usually asymmetric. */
|
|
27
31
|
upFraction?: number | undefined;
|
|
28
|
-
/** 0..1 of a bar's width that no source sample covers, drawn
|
|
32
|
+
/** 0..1 of a bar's width that no source sample covers, drawn across both panes. */
|
|
29
33
|
getAbsentFraction?: ((d: T) => number) | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The `series` key that names the absent share: its colour fills it and its legend entry labels
|
|
36
|
+
* it (give it `getValue: () => null`, it is legend-only). `BandStrip.absentState`'s shape. Its
|
|
37
|
+
* colour must differ from every measured series', not only by alpha. Default: a flat
|
|
38
|
+
* `--vx-neutral` with no legend entry. A key naming no entry throws.
|
|
39
|
+
*/
|
|
40
|
+
absentState?: K | undefined;
|
|
30
41
|
/** Per-datum bar opacity: a real but qualified measurement (a short bucket) drawn dimmer. */
|
|
31
42
|
getBarOpacity?: ((d: T) => number) | undefined;
|
|
32
43
|
/**
|
|
@@ -40,5 +51,5 @@ export type MirroredBarsProps<T, X extends ChartX = ChartX> = Pick<CartesianChar
|
|
|
40
51
|
/** Default `'leading'`: x is a slot's start. */
|
|
41
52
|
cursorResolution?: CartesianChartProps<T, X>['cursorResolution'] | undefined;
|
|
42
53
|
};
|
|
43
|
-
export declare function MirroredBars<T, X extends ChartX = ChartX>(props: MirroredBarsProps<T, X>): ReactElement;
|
|
54
|
+
export declare function MirroredBars<T, X extends ChartX = ChartX, K extends string = string>(props: MirroredBarsProps<T, X, K>): ReactElement;
|
|
44
55
|
//# sourceMappingURL=MirroredBars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MirroredBars.d.ts","sourceRoot":"","sources":["../../src/charts/MirroredBars.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAUzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,EAAW,MAAM,SAAS,CAAA;AAEhF,4BAA4B;AAC5B,MAAM,MAAM,eAAe,GAAG;IAC5B;8EAC0E;IAC1E,GAAG,EAAE,MAAM,CAAA;IACX,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACjC,sGAAsG;IACtG,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,2DAA2D;IAC3D,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAC9B,CAAA;AAED,oGAAoG;AACpG,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"MirroredBars.d.ts","sourceRoot":"","sources":["../../src/charts/MirroredBars.tsx"],"names":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AE,CAAC,CAAC,EAAE,CAAA;IAC3C,gCAAgC;IAChC,EAAE,EAAE,eAAe,CAAA;IACnB,gCAAgC;IAChC,IAAI,EAAE,eAAe,CAAA;IACrB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAClD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,SAAS,CAAA;IAC3B,6FAA6F;IAC7F,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAC9C;;;OAGG;IACH,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;KAAE,GAAG,SAAS,CAAA;IAC/E,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAA;CAC7E,CAAA;AAsCD,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAClF,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAChC,YAAY,CAoNd"}
|
|
@@ -10,7 +10,7 @@ import { defaultFormatX, defaultNumberFormat, seriesRow, visibleSeries } from ".
|
|
|
10
10
|
import { barMark, emphasis } from "./marks.js";
|
|
11
11
|
import { PanelRung, chartHeightOf, paneX, paneY, rowsOf } from "./panel.js";
|
|
12
12
|
import { xScaleFor } from "./scales.js";
|
|
13
|
-
import { foldBands } from "./band-fold.js";
|
|
13
|
+
import { foldBands, resolveNamedState } from "./band-fold.js";
|
|
14
14
|
import { rowX } from "./types.js";
|
|
15
15
|
const DEFAULT_UP_FRACTION = 0.35;
|
|
16
16
|
const DEFAULT_PANE_TICKS = 3;
|
|
@@ -36,14 +36,37 @@ function assertPaneKey(side, key, series) {
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
function MirroredBars(props) {
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const {
|
|
40
|
+
data,
|
|
41
|
+
x,
|
|
42
|
+
series,
|
|
43
|
+
up,
|
|
44
|
+
down,
|
|
45
|
+
upFraction = DEFAULT_UP_FRACTION,
|
|
46
|
+
getAbsentFraction,
|
|
47
|
+
getBarOpacity,
|
|
48
|
+
fold: foldConfig,
|
|
49
|
+
cursorResolution = "leading",
|
|
50
|
+
absentState,
|
|
51
|
+
...rung
|
|
52
|
+
} = props;
|
|
42
53
|
const { formatX } = rung;
|
|
54
|
+
const absentKey = resolveNamedState(
|
|
55
|
+
"MirroredBars",
|
|
56
|
+
"absentState",
|
|
57
|
+
absentState,
|
|
58
|
+
series.map((s) => s.key)
|
|
59
|
+
);
|
|
43
60
|
const bars = useMemo(
|
|
44
|
-
() => series.map((s) => ({
|
|
45
|
-
|
|
61
|
+
() => series.map((s) => ({
|
|
62
|
+
...s,
|
|
63
|
+
mark: "bar",
|
|
64
|
+
// A pane draws at full colour, so its swatch must not claim an opacity the plot lacks.
|
|
65
|
+
...s.key !== absentKey && { fillOpacity: void 0 }
|
|
66
|
+
})),
|
|
67
|
+
[series, absentKey]
|
|
46
68
|
);
|
|
69
|
+
const absentEntry = bars.find((s) => s.key === absentKey);
|
|
47
70
|
const plan = useCallback(
|
|
48
71
|
({ hidden, highlighted, width }) => {
|
|
49
72
|
const upSeries = assertPaneKey("up", up.key, bars);
|
|
@@ -55,6 +78,8 @@ function MirroredBars(props) {
|
|
|
55
78
|
) : data;
|
|
56
79
|
const model = xScaleFor(drawn.map(x), true);
|
|
57
80
|
const visible = visibleSeries(bars, hidden);
|
|
81
|
+
const absentOn = !absentEntry || visible.includes(absentEntry);
|
|
82
|
+
const absentFill = absentEntry ? alpha(absentEntry.color, absentEntry.fillOpacity ?? 1) : VX.neutral;
|
|
58
83
|
const upOn = visible.includes(upSeries);
|
|
59
84
|
const downOn = visible.includes(downSeries);
|
|
60
85
|
const format = (v) => formatX ? formatX(v) : defaultFormatX(v);
|
|
@@ -69,7 +94,7 @@ function MirroredBars(props) {
|
|
|
69
94
|
const rows = on ? rowsOf(drawn, x, s) : [];
|
|
70
95
|
const opacity = (d) => (getBarOpacity?.(d) ?? BAR_OPACITY) * emphasis(highlighted, s);
|
|
71
96
|
const left = (row) => (model.fraction(row.x) ?? 0) - bandWidth / 2;
|
|
72
|
-
const absent = (d) => clamp01(getAbsentFraction?.(d));
|
|
97
|
+
const absent = (d) => absentOn ? clamp01(getAbsentFraction?.(d)) : 0;
|
|
73
98
|
const measured = rows.filter(
|
|
74
99
|
(r) => r.y !== null && absent(r.datum) > 0 && absent(r.datum) < 1
|
|
75
100
|
);
|
|
@@ -125,7 +150,7 @@ function MirroredBars(props) {
|
|
|
125
150
|
y1: () => 0,
|
|
126
151
|
y2: () => max,
|
|
127
152
|
xScale: "zx",
|
|
128
|
-
fill:
|
|
153
|
+
fill: absentFill,
|
|
129
154
|
inset: 0
|
|
130
155
|
})
|
|
131
156
|
)
|
|
@@ -168,7 +193,19 @@ function MirroredBars(props) {
|
|
|
168
193
|
}
|
|
169
194
|
};
|
|
170
195
|
},
|
|
171
|
-
[
|
|
196
|
+
[
|
|
197
|
+
data,
|
|
198
|
+
x,
|
|
199
|
+
bars,
|
|
200
|
+
up,
|
|
201
|
+
down,
|
|
202
|
+
upFraction,
|
|
203
|
+
getAbsentFraction,
|
|
204
|
+
getBarOpacity,
|
|
205
|
+
foldConfig,
|
|
206
|
+
formatX,
|
|
207
|
+
absentEntry
|
|
208
|
+
]
|
|
172
209
|
);
|
|
173
210
|
return /* @__PURE__ */ jsx(
|
|
174
211
|
PanelRung,
|
|
@@ -12,4 +12,10 @@ export declare function groupsOf<T>(data: readonly T[], cap: number): Group<T>[]
|
|
|
12
12
|
* `floor(width / minBandPx)`.
|
|
13
13
|
*/
|
|
14
14
|
export declare function foldBands<T>(data: readonly T[], cap: number, merge: (group: T[]) => T): T[];
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a prop that names a `series` / `states` key (`absentState`): the key when it names an
|
|
17
|
+
* entry, `undefined` when it is unset. A key naming nothing throws in dev, naming the valid set;
|
|
18
|
+
* in production the chart degrades to the unset behaviour.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveNamedState<K extends string>(component: string, prop: string, requested: K | undefined, known: readonly string[]): K | undefined;
|
|
15
21
|
//# sourceMappingURL=band-fold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"band-fold.d.ts","sourceRoot":"","sources":["../../src/charts/band-fold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"band-fold.d.ts","sourceRoot":"","sources":["../../src/charts/band-fold.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,CAAA;CAAE,CAAA;AAEpD,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CASvE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAI3F;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAChD,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,CAAC,GAAG,SAAS,EACxB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,CAAC,GAAG,SAAS,CAOf"}
|
package/dist/charts/band-fold.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { oneOf } from "../common/errors.js";
|
|
1
2
|
function groupsOf(data, cap) {
|
|
2
3
|
const size = Math.max(1, Math.ceil(data.length / Math.max(cap, 1)));
|
|
3
4
|
const out = [];
|
|
@@ -13,7 +14,16 @@ function foldBands(data, cap, merge) {
|
|
|
13
14
|
if (data.length <= cap) return [...data];
|
|
14
15
|
return groupsOf(data, cap).map((g) => merge(g.items));
|
|
15
16
|
}
|
|
17
|
+
function resolveNamedState(component, prop, requested, known) {
|
|
18
|
+
if (requested === void 0) return void 0;
|
|
19
|
+
if (known.includes(requested)) return requested;
|
|
20
|
+
if (process.env.NODE_ENV !== "production") {
|
|
21
|
+
throw new Error(oneOf(component, prop, [...known], requested));
|
|
22
|
+
}
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
16
25
|
export {
|
|
17
26
|
foldBands,
|
|
18
|
-
groupsOf
|
|
27
|
+
groupsOf,
|
|
28
|
+
resolveNamedState
|
|
19
29
|
};
|
package/dist/charts/legend.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export type ChartLegendProps<T> = {
|
|
|
31
31
|
toggle: boolean;
|
|
32
32
|
onToggle: (key: string) => void;
|
|
33
33
|
onHighlight: (key: string | null) => void;
|
|
34
|
+
/** Keeps the legend's box but shows and offers nothing: a chart with no marks names no series. */
|
|
35
|
+
concealed?: boolean;
|
|
34
36
|
};
|
|
35
37
|
export declare function ChartLegend<T>(props: ChartLegendProps<T>): ReactElement | null;
|
|
36
38
|
//# sourceMappingURL=legend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/charts/legend.tsx"],"names":[],"mappings":"AAAA;;;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AA;IACf,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACzC,kGAAkG;IAClG,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CA2D9E"}
|
package/dist/charts/legend.js
CHANGED
|
@@ -28,6 +28,18 @@ const autoRowStyle = {
|
|
|
28
28
|
"--bc-legend-gap": `${VX.legendGap}px`,
|
|
29
29
|
"--bc-dots-gap": `${DOTS_GAP}px`
|
|
30
30
|
};
|
|
31
|
+
function rowLayout(mode, concealed) {
|
|
32
|
+
const hide = concealed ? { visibility: "hidden" } : {};
|
|
33
|
+
if (mode === "auto") return { ...autoRowStyle, ...hide };
|
|
34
|
+
const gap = mode === "dots" ? DOTS_GAP : VX.legendGap;
|
|
35
|
+
return {
|
|
36
|
+
...rowStyle,
|
|
37
|
+
columnGap: gap,
|
|
38
|
+
// Caps each entry's `[data-basalt-hit]` overlay at the real gap between entries.
|
|
39
|
+
...{ "--vx-hit-gap": `${gap}px` },
|
|
40
|
+
...hide
|
|
41
|
+
};
|
|
42
|
+
}
|
|
31
43
|
const dividerStyle = { width: 1, alignSelf: "stretch", background: VX.divider };
|
|
32
44
|
const buttonStyle = {
|
|
33
45
|
all: "unset",
|
|
@@ -103,22 +115,14 @@ function ChartLegend(props) {
|
|
|
103
115
|
const groups = legendEntries(props.series, props.groups);
|
|
104
116
|
if (groups.length === 0) return null;
|
|
105
117
|
const auto = props.mode === "auto";
|
|
106
|
-
const gap = props.mode === "dots" ? DOTS_GAP : VX.legendGap;
|
|
107
118
|
return /* @__PURE__ */ jsx(
|
|
108
119
|
"fieldset",
|
|
109
120
|
{
|
|
110
121
|
"aria-label": "Legend",
|
|
111
122
|
"data-basalt-chart-legend": props.mode,
|
|
123
|
+
...props.concealed && { "aria-hidden": true },
|
|
112
124
|
...auto && { className: classes.auto },
|
|
113
|
-
style:
|
|
114
|
-
// `display` and the gaps are the stylesheet's: the container picks them by width.
|
|
115
|
-
autoRowStyle
|
|
116
|
-
) : {
|
|
117
|
-
...rowStyle,
|
|
118
|
-
columnGap: gap,
|
|
119
|
-
// Caps each entry's `[data-basalt-hit]` overlay at the real gap between entries.
|
|
120
|
-
...{ "--vx-hit-gap": `${gap}px` }
|
|
121
|
-
},
|
|
125
|
+
style: rowLayout(props.mode, props.concealed === true),
|
|
122
126
|
children: groups.map((group, gi) => [
|
|
123
127
|
gi > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, style: dividerStyle }, `divider-${gi}`),
|
|
124
128
|
...group.map((s) => {
|
package/dist/charts/types.d.ts
CHANGED
|
@@ -252,7 +252,13 @@ export type CartesianChartProps<T, X extends ChartX = ChartX> = BasaltProps & {
|
|
|
252
252
|
refLines?: readonly RefLine[] | undefined;
|
|
253
253
|
/** `false` hides the legend. */
|
|
254
254
|
legend?: ChartLegendConfig | false | undefined;
|
|
255
|
-
/**
|
|
255
|
+
/**
|
|
256
|
+
* Default: the height law (measured width × class ratio, 160–420px, ≤ 45vh on touch). Always the
|
|
257
|
+
* FRAME, in every kind: the plot plus the axis the engine measures. A `BandStrip` band is the
|
|
258
|
+
* frame less the x axis (about 21 px at the default font and density, so `height: 65` for a
|
|
259
|
+
* 44 px band). There is no separate plot height: the box is CSS-owned before any measurement
|
|
260
|
+
* exists, and a plot height would add a guess to it.
|
|
261
|
+
*/
|
|
256
262
|
height?: number | ResponsiveChartHeight | undefined;
|
|
257
263
|
state?: ChartState | undefined;
|
|
258
264
|
/** Joins a named cursor group instead of the page-shared default. */
|