basalt-ui 2.27.0 → 2.27.1
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 +10 -0
- package/MIGRATING.md +16 -12
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +32 -9
- package/dist/charts/chart-box.module.css +6 -4
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +5 -2
- package/dist/charts/sparkline.module.css +4 -0
- package/dist/dashboard/meter.module.css +7 -2
- package/dist/dashboard/stat-strip.js +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/charts/Sparkline.tsx +51 -16
- package/src/charts/chart-box.module.css +6 -4
- package/src/charts/compile.ts +15 -4
- package/src/charts/sparkline.module.css +4 -0
- package/src/dashboard/meter.module.css +7 -2
- package/src/dashboard/stat-strip.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [2.27.1](https://github.com/jkrumm/basalt-ui/compare/v2.27.0...v2.27.1) (2026-10-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* a hosted row sparkline readout stays one line inside its own row at 390 ([1fd8231](https://github.com/jkrumm/basalt-ui/commit/1fd8231e89a5dbc4944214677ddf261e8fa9cfa8))
|
|
7
|
+
* meter label rows stand a stack step apart ([2df16eb](https://github.com/jkrumm/basalt-ui/commit/2df16eb55ae1c52406f947755784e1c1e95e2eed))
|
|
8
|
+
* slotted bars chip clears the focus ring ([3a31e5f](https://github.com/jkrumm/basalt-ui/commit/3a31e5fd48f57a485c200ae6bea7d3aa7059f997))
|
|
9
|
+
* tooltips stay off the card headline facts ([73cec28](https://github.com/jkrumm/basalt-ui/commit/73cec283570a76b96fdd92aac185bb393825fb0e))
|
|
10
|
+
|
|
1
11
|
# [2.27.0](https://github.com/jkrumm/basalt-ui/compare/v2.26.0...v2.27.0) (2026-10-19)
|
|
2
12
|
|
|
3
13
|
|
package/MIGRATING.md
CHANGED
|
@@ -66,18 +66,18 @@ There is one row per SURFACE, not per export, and a surface earns a row once any
|
|
|
66
66
|
shipped lefthook preset both changed in 1.30.0 with no row that owned them — which is how a
|
|
67
67
|
consumer read this index, found nothing, and diffed a KPI row that had silently gone 4-up → 2-up.
|
|
68
68
|
|
|
69
|
-
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 2.13.3 | 2.14.0 | 2.15.0 | 2.16.0 | 2.17.0 | 2.18.0 | 2.19.0 | 2.20.0 | 2.21.0 | 2.22.0 | 2.23.0 | 2.24.0 | 2.25.0 | 2.26.0 | 2.27.0 | Unreleased |
|
|
70
|
-
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
-
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | spacing, radius, type and the dense tier (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
72
|
-
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `Lines` linear curve, `naming`, no lone-series legend, locale tooltip header, y gutter, `RefLine.labelPosition`, `StackedArea.fillOpacity` (§ Chart chrome) | — | error fallback `The request failed.` (§ State defaults) | — | — | — | — |
|
|
73
|
-
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | expanded gutter 24 (§ 2.16.0) | — | — | light/outline Buttons ink, no status edges (§ 2.19.0) | — | — | — | — | — | — | — | — | — |
|
|
74
|
-
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | dense 28 tier at a fine pointer (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
-
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
-
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltDataTable` error title `Could not load rows` (§ State defaults) | — | — | — | — |
|
|
77
|
-
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | card inset 12/16, `kpi` 22 / 500 (§ 2.16.0) | — | — | StatCard status dot, Meter/BarList refinements (§ 2.19.0) | — | plain `Meter` value bar fill muted (`tone="ink"` to opt out); `BarList` default `thin`, `variant="default"` → `inline` (§ 2.21.0) | — | — | `LoadingState` section skeleton, page spinner neutral (§ State defaults) | — | — | — | — |
|
|
78
|
-
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
-
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
80
|
-
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | `inline-spacing` steps, `card-inset` accepts both pairs (§ 2.16.0) | — | — | — | — | `series-palette` at `warn` (§ 2.21.0) | — | `series-palette` → `error` (§ Guards) | `raw-spacing`, `inline-spacing` → `error` (§ Guards) | — | `basalt/card-inset` → `error` (§ Guards) | — | — |
|
|
69
|
+
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 2.13.3 | 2.14.0 | 2.15.0 | 2.16.0 | 2.17.0 | 2.18.0 | 2.19.0 | 2.20.0 | 2.21.0 | 2.22.0 | 2.23.0 | 2.24.0 | 2.25.0 | 2.26.0 | 2.27.0 | 2.27.1 | Unreleased |
|
|
70
|
+
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
+
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | spacing, radius, type and the dense tier (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
72
|
+
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `Lines` linear curve, `naming`, no lone-series legend, locale tooltip header, y gutter, `RefLine.labelPosition`, `StackedArea.fillOpacity` (§ Chart chrome) | — | error fallback `The request failed.` (§ State defaults) | — | — | — | — | — |
|
|
73
|
+
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | expanded gutter 24 (§ 2.16.0) | — | — | light/outline Buttons ink, no status edges (§ 2.19.0) | — | — | — | — | — | — | — | — | — | — |
|
|
74
|
+
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | dense 28 tier at a fine pointer (§ 2.16.0) | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
+
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
+
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltDataTable` error title `Could not load rows` (§ State defaults) | — | — | — | — | — |
|
|
77
|
+
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | card inset 12/16, `kpi` 22 / 500 (§ 2.16.0) | — | — | StatCard status dot, Meter/BarList refinements (§ 2.19.0) | — | plain `Meter` value bar fill muted (`tone="ink"` to opt out); `BarList` default `thin`, `variant="default"` → `inline` (§ 2.21.0) | — | — | `LoadingState` section skeleton, page spinner neutral (§ State defaults) | — | — | — | — | — |
|
|
78
|
+
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
+
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
80
|
+
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — | — | — | — | `inline-spacing` steps, `card-inset` accepts both pairs (§ 2.16.0) | — | — | — | — | `series-palette` at `warn` (§ 2.21.0) | — | `series-palette` → `error` (§ Guards) | `raw-spacing`, `inline-spacing` → `error` (§ Guards) | — | `basalt/card-inset` → `error` (§ Guards) | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -1046,6 +1046,10 @@ The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an imp
|
|
|
1046
1046
|
_Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
|
|
1047
1047
|
release renames it and opens a new one here._
|
|
1048
1048
|
|
|
1049
|
+
## 2.27.1
|
|
1050
|
+
|
|
1051
|
+
_Nothing to migrate in this release._
|
|
1052
|
+
|
|
1049
1053
|
## 2.27.0 — Wave 38 card facts, Wave 39 argo's friction IV
|
|
1050
1054
|
|
|
1051
1055
|
### Card facts and the pending ghost (Wave 38)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/charts/Sparkline.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAA0D,YAAY,EAAE,MAAM,OAAO,CAAA;AAEjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAclD,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,SAAS,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG,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nC,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAChD;;sCAEkC;IAClC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CACvC,CAAA;AAED,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAmJ5C;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,KAAK,EAAE,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,KAAK,GACnB,SAAS,KAAK,EAAE,CAIlB;AAgVD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA8N7D"}
|
package/dist/charts/Sparkline.js
CHANGED
|
@@ -266,21 +266,19 @@ function lineHits(pts, box) {
|
|
|
266
266
|
}
|
|
267
267
|
function placeStacked(node, line, fx) {
|
|
268
268
|
const layer = node.parentElement;
|
|
269
|
-
if (!layer) return;
|
|
269
|
+
if (!layer) return true;
|
|
270
270
|
const [W, H, w, h] = [layer.clientWidth, layer.clientHeight, node.offsetWidth, node.offsetHeight];
|
|
271
|
-
if (W <= 0 || H <= 0) return;
|
|
271
|
+
if (W <= 0 || H <= 0) return true;
|
|
272
272
|
const pts = line().map(([x, y]) => [x * W, y * H]);
|
|
273
273
|
const slid = fx * (W - w);
|
|
274
274
|
const room = (left) => Math.min(Math.max(left, 0), Math.max(W - w, 0));
|
|
275
275
|
const lefts = [slid, room(fx * W + CLEAR * 2), room(fx * W - CLEAR * 2 - w)];
|
|
276
276
|
const tops = [0, Math.max(H - h, 0)];
|
|
277
277
|
const fit = lefts.flatMap((left) => tops.map((top) => ({ left, top, w, h }))).find((box) => !lineHits(pts, box));
|
|
278
|
-
if (!fit)
|
|
279
|
-
node.style.top = `${H + CLEAR}px`;
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
278
|
+
if (!fit) return false;
|
|
282
279
|
node.style.top = `${fit.top}px`;
|
|
283
280
|
node.style.marginLeft = `${fit.left - slid}px`;
|
|
281
|
+
return true;
|
|
284
282
|
}
|
|
285
283
|
function lineYAt(pts, x) {
|
|
286
284
|
for (let i = 0; i + 1 < pts.length; i += 1) {
|
|
@@ -316,21 +314,46 @@ function placeInBand(node, line, fx) {
|
|
|
316
314
|
node.style.top = `${fit.top}px`;
|
|
317
315
|
node.style.marginLeft = `${fit.left - slid}px`;
|
|
318
316
|
}
|
|
317
|
+
function rowSpan(node) {
|
|
318
|
+
const row = node.closest("[data-strip-row]");
|
|
319
|
+
if (row === null) return null;
|
|
320
|
+
const box = row.getBoundingClientRect();
|
|
321
|
+
const value = row.querySelector("[data-strip-row-value]");
|
|
322
|
+
const end = value === null ? box.right : value.getBoundingClientRect().left;
|
|
323
|
+
return [box.left, Math.max(box.left, end - CLEAR)];
|
|
324
|
+
}
|
|
319
325
|
function fitReadout(node, line, fx, band) {
|
|
320
326
|
const overflows = () => node.scrollWidth > node.clientWidth;
|
|
321
327
|
node.removeAttribute("data-tight");
|
|
322
328
|
node.removeAttribute("data-stacked");
|
|
329
|
+
node.removeAttribute("data-short");
|
|
323
330
|
if (line !== null) {
|
|
324
331
|
node.style.removeProperty("top");
|
|
325
332
|
node.style.removeProperty("margin-left");
|
|
326
333
|
}
|
|
334
|
+
const span = line !== null && !band ? rowSpan(node) : null;
|
|
335
|
+
if (line !== null && !band) node.style.maxWidth = "100%";
|
|
336
|
+
if (span !== null && span[1] > span[0]) node.style.maxWidth = `${span[1] - span[0]}px`;
|
|
327
337
|
if (overflows()) {
|
|
328
338
|
node.setAttribute("data-tight", "");
|
|
329
|
-
if (overflows()
|
|
339
|
+
if (overflows()) {
|
|
340
|
+
if (span !== null) node.setAttribute("data-short", "");
|
|
341
|
+
else if (!band) node.setAttribute("data-stacked", "");
|
|
342
|
+
}
|
|
330
343
|
}
|
|
331
344
|
if (line === null) return;
|
|
332
|
-
if (band)
|
|
333
|
-
|
|
345
|
+
if (band) {
|
|
346
|
+
placeInBand(node, line, fx);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (span === null) {
|
|
350
|
+
if (node.hasAttribute("data-stacked") && !placeStacked(node, line, fx))
|
|
351
|
+
node.style.top = `${(node.parentElement?.clientHeight ?? 0) + CLEAR}px`;
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
const { left, width } = node.getBoundingClientRect();
|
|
355
|
+
const inside = Math.min(Math.max(left, span[0]), Math.max(span[1] - width, span[0]));
|
|
356
|
+
if (inside !== left) node.style.marginLeft = `${inside - left}px`;
|
|
334
357
|
}
|
|
335
358
|
function Sparkline(props) {
|
|
336
359
|
const {
|
|
@@ -171,21 +171,23 @@
|
|
|
171
171
|
* A slotted `Bars` (`data-basalt-slot`, set by `compile.ts`) is a micro-visual: its tooltip is the
|
|
172
172
|
* Sparkline's one-line chip, `<value> · <x label>` in the line the host reserves above the plot. The
|
|
173
173
|
* first row's figure leads, the header follows it, further rows are hidden (a chart that needs rows
|
|
174
|
-
* lives in a `ChartCard`); an overlong header ends in an ellipsis.
|
|
175
|
-
* chip's (`sparkline.module.css`); the tooltip is portalled out of the host, so its fallbacks stand.
|
|
174
|
+
* lives in a `ChartCard`); an overlong header ends in an ellipsis. Type and edge are the
|
|
175
|
+
* chip's (`sparkline.module.css`), its height that less the focus ring's clearance; the tooltip is portalled out of the host, so its fallbacks stand.
|
|
176
176
|
*/
|
|
177
177
|
:global(.ts-chart-tooltip[data-basalt-slot]) {
|
|
178
178
|
display: flex !important;
|
|
179
179
|
align-items: center;
|
|
180
180
|
box-sizing: border-box;
|
|
181
181
|
width: max-content;
|
|
182
|
-
|
|
182
|
+
/* The line the cell reserves (1.125rem) less the focus ring's clearance (2px outline + 0.125rem offset), so
|
|
183
|
+
* the chip sits clear of the ring and still inside the reserve. */
|
|
184
|
+
block-size: calc(1.125rem - 0.25rem);
|
|
183
185
|
padding: 0 4px !important;
|
|
184
186
|
overflow: hidden;
|
|
185
187
|
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
186
188
|
font-variant-numeric: lining-nums;
|
|
187
189
|
font-size: var(--vx-text-xs);
|
|
188
|
-
line-height: calc(1.125rem - 2px);
|
|
190
|
+
line-height: calc(1.125rem - 0.25rem - 2px);
|
|
189
191
|
white-space: nowrap !important;
|
|
190
192
|
border-radius: var(--vx-radius-ctrl) !important;
|
|
191
193
|
/* theme-allow css-raw-surface — the chip is flat, like the Sparkline's, not a floating panel */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/charts/compile.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAEV,iCAAiC,EAClC,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAGV,aAAa,EAEb,yBAAyB,EACzB,eAAe,IAAI,gBAAgB,EACnC,UAAU,EACV,yBAAyB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAO5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EAEnB,WAAW,EACX,eAAe,EACf,MAAM,EAEN,OAAO,EAEP,QAAQ,EACT,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;AAE/F,gGAAgG;AAChG,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,IAAI,CACpD,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACvB,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OA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AY,CAC1B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,iCAAiC,EACtC,IAAI,GAAE,OAAgB,GACrB,IAAI,CA4EN;AA0ED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,mBAAmB,CA2HrB"}
|
package/dist/charts/compile.js
CHANGED
|
@@ -607,6 +607,7 @@ const slotAnchor = (points, { plot }) => {
|
|
|
607
607
|
return { x: (Math.min(...xs) + Math.max(...xs)) / 2, y: plot.y };
|
|
608
608
|
};
|
|
609
609
|
const SLOT_TOOLTIP_PLACEMENT = ["top"];
|
|
610
|
+
const SLOT_RING_CLEARANCE = 2 + 2;
|
|
610
611
|
const TIP_CHROME = 30;
|
|
611
612
|
const TIP_ROW = 18;
|
|
612
613
|
const TIP_TOP_AIR = 4;
|
|
@@ -688,11 +689,13 @@ function settleInCard(tip, within, ctx, mode = "card") {
|
|
|
688
689
|
const [w, h] = [tip.offsetWidth, tip.offsetHeight];
|
|
689
690
|
const anchor = toClient(ctx.anchor);
|
|
690
691
|
const gap = Math.max(0, Number.isFinite(ctx.offset) ? ctx.offset ?? 10 : 10);
|
|
691
|
-
const minTop = card.top + TIP_CARD_AIR;
|
|
692
692
|
const maxTop = card.bottom - TIP_CARD_AIR - h;
|
|
693
|
+
const headerBottom = slot ? void 0 : within.closest(TIP_CARD)?.querySelector("[data-basalt-facts]")?.parentElement?.getBoundingClientRect().bottom;
|
|
694
|
+
const belowHeader = headerBottom === void 0 ? void 0 : headerBottom + TIP_CARD_AIR;
|
|
695
|
+
const minTop = belowHeader !== void 0 && belowHeader <= maxTop ? belowHeader : card.top + TIP_CARD_AIR;
|
|
693
696
|
const side = tip.dataset["placement"];
|
|
694
697
|
if (slot) {
|
|
695
|
-
top = Math.max(anchor.y - gap - h, card.top);
|
|
698
|
+
top = Math.max(anchor.y - gap - SLOT_RING_CLEARANCE - h, card.top);
|
|
696
699
|
left = anchor.x - w / 2;
|
|
697
700
|
} else if (side === "top" || side === "bottom") {
|
|
698
701
|
const above = anchor.y - gap - h;
|
|
@@ -103,11 +103,16 @@
|
|
|
103
103
|
|
|
104
104
|
/* A label that cannot hold its place on the first row stands on a second, directly under it. */
|
|
105
105
|
.labelRow[data-meter-rows='2'] {
|
|
106
|
-
height: 2.5em;
|
|
106
|
+
height: calc(2.5em + var(--vx-space-stack-xs, 0.25rem));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.labelRow[data-meter-rows='2'] .rowLabel {
|
|
110
|
+
/* The label's box is its row (1.25em), so the rows' gap is the gap between their boxes. */
|
|
111
|
+
line-height: 1.25em;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
.rowLabel[data-row2] {
|
|
110
|
-
top: 1.25em;
|
|
115
|
+
top: calc(1.25em + var(--vx-space-stack-xs, 0.25rem));
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
.rowLabel {
|
|
@@ -139,7 +139,7 @@ function StripCell({
|
|
|
139
139
|
state === void 0 && rows !== void 0 && (loading ? /* @__PURE__ */ jsx("div", { className: classes.rows, "aria-hidden": "true", children: rows.map((row) => /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRow, radius: "sm" }, row.key)) }) : /* @__PURE__ */ jsx("ul", { className: classes.rows, "data-strip-rows": true, children: rows.map((row) => /* @__PURE__ */ jsxs("li", { className: classes.row, "data-strip-row": row.key, children: [
|
|
140
140
|
/* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
|
|
141
141
|
/* @__PURE__ */ jsx("span", { className: classes.visual, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: HOSTED, children: row.visual }) }),
|
|
142
|
-
/* @__PURE__ */ jsx("span", { className: classes.rowValue, children: row.hideValue ? null : row.value ?? EMPTY }),
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: classes.rowValue, "data-strip-row-value": true, children: row.hideValue ? null : row.value ?? EMPTY }),
|
|
143
143
|
/* @__PURE__ */ jsx("span", { children: row.delta })
|
|
144
144
|
] }, row.key)) })),
|
|
145
145
|
state === void 0 && footerEl
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.27.
|
|
1
|
+
# basalt-ui v2.27.1
|
|
2
2
|
# Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
|
|
3
3
|
#
|
|
4
4
|
# Entry points: use the exact import specifier below; do not guess.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
|
|
14
14
|
|
|
15
15
|
Package: basalt-ui
|
|
16
|
-
Version: 2.27.
|
|
16
|
+
Version: 2.27.1
|
|
17
17
|
|
|
18
18
|
## basalt-ui
|
|
19
19
|
Import: import { ... } from 'basalt-ui'
|
package/package.json
CHANGED
package/src/charts/Sparkline.tsx
CHANGED
|
@@ -426,16 +426,17 @@ function lineHits(
|
|
|
426
426
|
* A hosted line's stacked chip is two lines tall, more than the host's one reserved line, so it sits
|
|
427
427
|
* in the plot, and never on the plotted line: first at the cursor (slid with it) at the plot's top,
|
|
428
428
|
* then its bottom, then to the right and to the left of the cursor at either edge, the first of
|
|
429
|
-
* those the line misses. A plot too short for the chip
|
|
430
|
-
* chip
|
|
431
|
-
*
|
|
429
|
+
* those the line misses. A plot too short for the chip has no such spot: it returns false and the
|
|
430
|
+
* chip hangs from the plot's bottom edge, over the host's footer or card padding: a hover covers the
|
|
431
|
+
* figure's secondary text before it covers the data or the figure's delta above. Not for a strip
|
|
432
|
+
* row (`fitReadout` never stacks there: a chip hung below the plot lands on the next row).
|
|
432
433
|
* Offsets go on `margin-left` and `top`, which React's `left` / `translate` do not own.
|
|
433
434
|
*/
|
|
434
|
-
function placeStacked(node: HTMLElement, line: () => readonly LinePoint[], fx: number):
|
|
435
|
+
function placeStacked(node: HTMLElement, line: () => readonly LinePoint[], fx: number): boolean {
|
|
435
436
|
const layer = node.parentElement
|
|
436
|
-
if (!layer) return
|
|
437
|
+
if (!layer) return true
|
|
437
438
|
const [W, H, w, h] = [layer.clientWidth, layer.clientHeight, node.offsetWidth, node.offsetHeight]
|
|
438
|
-
if (W <= 0 || H <= 0) return
|
|
439
|
+
if (W <= 0 || H <= 0) return true
|
|
439
440
|
const pts = line().map(([x, y]): [number, number] => [x * W, y * H])
|
|
440
441
|
const slid = fx * (W - w)
|
|
441
442
|
const room = (left: number): number => Math.min(Math.max(left, 0), Math.max(W - w, 0))
|
|
@@ -444,12 +445,10 @@ function placeStacked(node: HTMLElement, line: () => readonly LinePoint[], fx: n
|
|
|
444
445
|
const fit = lefts
|
|
445
446
|
.flatMap((left) => tops.map((top) => ({ left, top, w, h })))
|
|
446
447
|
.find((box) => !lineHits(pts, box))
|
|
447
|
-
if (!fit)
|
|
448
|
-
node.style.top = `${H + CLEAR}px`
|
|
449
|
-
return
|
|
450
|
-
}
|
|
448
|
+
if (!fit) return false
|
|
451
449
|
node.style.top = `${fit.top}px`
|
|
452
450
|
node.style.marginLeft = `${fit.left - slid}px`
|
|
451
|
+
return true
|
|
453
452
|
}
|
|
454
453
|
|
|
455
454
|
/** The plotted line's y (fraction of the box) at x, interpolated along the polyline; null outside it. */
|
|
@@ -502,11 +501,27 @@ function placeInBand(node: HTMLElement, line: () => readonly LinePoint[], fx: nu
|
|
|
502
501
|
node.style.marginLeft = `${fit.left - slid}px`
|
|
503
502
|
}
|
|
504
503
|
|
|
504
|
+
/**
|
|
505
|
+
* A hosted chip in a strip row measures against the row, not the narrow visual column it is drawn
|
|
506
|
+
* in: it stays on the reserved line above the plot and slides over the label column, up to the row's
|
|
507
|
+
* own value. Returns that `[left, right]` in viewport px; null outside a strip row.
|
|
508
|
+
*/
|
|
509
|
+
function rowSpan(node: HTMLElement): readonly [number, number] | null {
|
|
510
|
+
const row = node.closest('[data-strip-row]')
|
|
511
|
+
if (row === null) return null
|
|
512
|
+
const box = row.getBoundingClientRect()
|
|
513
|
+
const value = row.querySelector('[data-strip-row-value]')
|
|
514
|
+
const end = value === null ? box.right : value.getBoundingClientRect().left
|
|
515
|
+
return [box.left, Math.max(box.left, end - CLEAR)]
|
|
516
|
+
}
|
|
517
|
+
|
|
505
518
|
/**
|
|
506
519
|
* A readout never loses its separator or its date to an ellipsis: when the one-line chip overflows
|
|
507
520
|
* its box it first tightens (`data-tight`: less padding, the separator's air stays), then stacks
|
|
508
|
-
* (`data-stacked`: the date on its own line, placed off the plotted line when `line` is given).
|
|
509
|
-
*
|
|
521
|
+
* (`data-stacked`: the date on its own line, placed off the plotted line when `line` is given). A
|
|
522
|
+
* chip in a strip row never stacks (a second line, or a hang below the plot, lands on the next row):
|
|
523
|
+
* it measures against the row, tightens, then drops its date (`data-short`). Set on the node, so a
|
|
524
|
+
* measure never re-renders.
|
|
510
525
|
*/
|
|
511
526
|
function fitReadout(
|
|
512
527
|
node: HTMLElement,
|
|
@@ -517,19 +532,39 @@ function fitReadout(
|
|
|
517
532
|
const overflows = (): boolean => node.scrollWidth > node.clientWidth
|
|
518
533
|
node.removeAttribute('data-tight')
|
|
519
534
|
node.removeAttribute('data-stacked')
|
|
535
|
+
node.removeAttribute('data-short')
|
|
520
536
|
// `top` is React's on a bare chip; a hosted line's chip is the only one `placeStacked` writes to.
|
|
521
537
|
if (line !== null) {
|
|
522
538
|
node.style.removeProperty('top')
|
|
523
539
|
node.style.removeProperty('margin-left')
|
|
524
540
|
}
|
|
541
|
+
// `max-width` is React's on every chip; a strip row's chip is the only one widened past it.
|
|
542
|
+
const span = line !== null && !band ? rowSpan(node) : null
|
|
543
|
+
if (line !== null && !band) node.style.maxWidth = '100%'
|
|
544
|
+
if (span !== null && span[1] > span[0]) node.style.maxWidth = `${span[1] - span[0]}px`
|
|
525
545
|
if (overflows()) {
|
|
526
546
|
node.setAttribute('data-tight', '')
|
|
527
|
-
|
|
528
|
-
|
|
547
|
+
if (overflows()) {
|
|
548
|
+
// A short bare box has no room for two lines: it stays one line, tight.
|
|
549
|
+
if (span !== null) node.setAttribute('data-short', '')
|
|
550
|
+
else if (!band) node.setAttribute('data-stacked', '')
|
|
551
|
+
}
|
|
529
552
|
}
|
|
530
553
|
if (line === null) return
|
|
531
|
-
if (band)
|
|
532
|
-
|
|
554
|
+
if (band) {
|
|
555
|
+
placeInBand(node, line, fx)
|
|
556
|
+
return
|
|
557
|
+
}
|
|
558
|
+
if (span === null) {
|
|
559
|
+
// Not in a strip row: the chip hangs from the plot's bottom edge, over the host's footer.
|
|
560
|
+
if (node.hasAttribute('data-stacked') && !placeStacked(node, line, fx))
|
|
561
|
+
node.style.top = `${(node.parentElement?.clientHeight ?? 0) + CLEAR}px`
|
|
562
|
+
return
|
|
563
|
+
}
|
|
564
|
+
// Slide the one-line chip back inside the row (`margin-left` on top of the point's own slide).
|
|
565
|
+
const { left, width } = node.getBoundingClientRect()
|
|
566
|
+
const inside = Math.min(Math.max(left, span[0]), Math.max(span[1] - width, span[0]))
|
|
567
|
+
if (inside !== left) node.style.marginLeft = `${inside - left}px`
|
|
533
568
|
}
|
|
534
569
|
|
|
535
570
|
export function Sparkline(props: SparklineProps): ReactElement {
|
|
@@ -171,21 +171,23 @@
|
|
|
171
171
|
* A slotted `Bars` (`data-basalt-slot`, set by `compile.ts`) is a micro-visual: its tooltip is the
|
|
172
172
|
* Sparkline's one-line chip, `<value> · <x label>` in the line the host reserves above the plot. The
|
|
173
173
|
* first row's figure leads, the header follows it, further rows are hidden (a chart that needs rows
|
|
174
|
-
* lives in a `ChartCard`); an overlong header ends in an ellipsis.
|
|
175
|
-
* chip's (`sparkline.module.css`); the tooltip is portalled out of the host, so its fallbacks stand.
|
|
174
|
+
* lives in a `ChartCard`); an overlong header ends in an ellipsis. Type and edge are the
|
|
175
|
+
* chip's (`sparkline.module.css`), its height that less the focus ring's clearance; the tooltip is portalled out of the host, so its fallbacks stand.
|
|
176
176
|
*/
|
|
177
177
|
:global(.ts-chart-tooltip[data-basalt-slot]) {
|
|
178
178
|
display: flex !important;
|
|
179
179
|
align-items: center;
|
|
180
180
|
box-sizing: border-box;
|
|
181
181
|
width: max-content;
|
|
182
|
-
|
|
182
|
+
/* The line the cell reserves (1.125rem) less the focus ring's clearance (2px outline + 0.125rem offset), so
|
|
183
|
+
* the chip sits clear of the ring and still inside the reserve. */
|
|
184
|
+
block-size: calc(1.125rem - 0.25rem);
|
|
183
185
|
padding: 0 4px !important;
|
|
184
186
|
overflow: hidden;
|
|
185
187
|
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
186
188
|
font-variant-numeric: lining-nums;
|
|
187
189
|
font-size: var(--vx-text-xs);
|
|
188
|
-
line-height: calc(1.125rem - 2px);
|
|
190
|
+
line-height: calc(1.125rem - 0.25rem - 2px);
|
|
189
191
|
white-space: nowrap !important;
|
|
190
192
|
border-radius: var(--vx-radius-ctrl) !important;
|
|
191
193
|
/* theme-allow css-raw-surface — the chip is flat, like the Sparkline's, not a floating panel */
|
package/src/charts/compile.ts
CHANGED
|
@@ -1030,7 +1030,7 @@ const STRIP_TOOLTIP_OFFSET = 8
|
|
|
1030
1030
|
/**
|
|
1031
1031
|
* A slotted `Bars` (`tooltipBelow` and `bare`): a micro-visual whose tooltip is the one-line chip
|
|
1032
1032
|
* (`chart-box.module.css`, `data-basalt-slot`) in the line the cell reserves above the plot. It
|
|
1033
|
-
* anchors to the plot's top edge,
|
|
1033
|
+
* anchors to the plot's top edge, clear of the focus ring, and opens upward, never below the plot and never over the
|
|
1034
1034
|
* bars; the card clamp's vertical flip does not apply to it.
|
|
1035
1035
|
*/
|
|
1036
1036
|
const slotAnchor = (
|
|
@@ -1041,6 +1041,8 @@ const slotAnchor = (
|
|
|
1041
1041
|
return { x: (Math.min(...xs) + Math.max(...xs)) / 2, y: plot.y }
|
|
1042
1042
|
}
|
|
1043
1043
|
const SLOT_TOOLTIP_PLACEMENT = ['top'] as const
|
|
1044
|
+
/** The host's focus ring sits outside the plot: `.basalt-chart:focus-visible` is a 2px outline at a 0.125rem offset. */
|
|
1045
|
+
const SLOT_RING_CLEARANCE = 2 + 2
|
|
1044
1046
|
|
|
1045
1047
|
/** A tooltip's chrome (title row, padding) and each series row, px: the guess the bar anchor reserves. */
|
|
1046
1048
|
const TIP_CHROME = 30
|
|
@@ -1175,12 +1177,21 @@ export function settleInCard(
|
|
|
1175
1177
|
const [w, h] = [tip.offsetWidth, tip.offsetHeight]
|
|
1176
1178
|
const anchor = toClient(ctx.anchor)
|
|
1177
1179
|
const gap = Math.max(0, Number.isFinite(ctx.offset) ? (ctx.offset ?? 10) : 10)
|
|
1178
|
-
const minTop = card.top + TIP_CARD_AIR
|
|
1179
1180
|
const maxTop = card.bottom - TIP_CARD_AIR - h
|
|
1181
|
+
// The card's header (title and facts) is off-limits while the plot area below it can hold the tooltip.
|
|
1182
|
+
const headerBottom = slot
|
|
1183
|
+
? undefined
|
|
1184
|
+
: within
|
|
1185
|
+
.closest(TIP_CARD)
|
|
1186
|
+
?.querySelector('[data-basalt-facts]')
|
|
1187
|
+
?.parentElement?.getBoundingClientRect().bottom
|
|
1188
|
+
const belowHeader = headerBottom === undefined ? undefined : headerBottom + TIP_CARD_AIR
|
|
1189
|
+
const minTop =
|
|
1190
|
+
belowHeader !== undefined && belowHeader <= maxTop ? belowHeader : card.top + TIP_CARD_AIR
|
|
1180
1191
|
const side = tip.dataset['placement']
|
|
1181
1192
|
if (slot) {
|
|
1182
|
-
//
|
|
1183
|
-
top = Math.max(anchor.y - gap - h, card.top)
|
|
1193
|
+
// Above the plot, in the reserved line, clear of the focus ring: no flip, never pushed down over the bars.
|
|
1194
|
+
top = Math.max(anchor.y - gap - SLOT_RING_CLEARANCE - h, card.top)
|
|
1184
1195
|
left = anchor.x - w / 2
|
|
1185
1196
|
} else if (side === 'top' || side === 'bottom') {
|
|
1186
1197
|
const above = anchor.y - gap - h
|
|
@@ -103,11 +103,16 @@
|
|
|
103
103
|
|
|
104
104
|
/* A label that cannot hold its place on the first row stands on a second, directly under it. */
|
|
105
105
|
.labelRow[data-meter-rows='2'] {
|
|
106
|
-
height: 2.5em;
|
|
106
|
+
height: calc(2.5em + var(--vx-space-stack-xs, 0.25rem));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.labelRow[data-meter-rows='2'] .rowLabel {
|
|
110
|
+
/* The label's box is its row (1.25em), so the rows' gap is the gap between their boxes. */
|
|
111
|
+
line-height: 1.25em;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
.rowLabel[data-row2] {
|
|
110
|
-
top: 1.25em;
|
|
115
|
+
top: calc(1.25em + var(--vx-space-stack-xs, 0.25rem));
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
.rowLabel {
|
|
@@ -342,7 +342,7 @@ function StripCell({
|
|
|
342
342
|
{row.visual}
|
|
343
343
|
</VisualSlotContext.Provider>
|
|
344
344
|
</span>
|
|
345
|
-
<span className={classes.rowValue}>
|
|
345
|
+
<span className={classes.rowValue} data-strip-row-value>
|
|
346
346
|
{row.hideValue ? null : (row.value ?? EMPTY)}
|
|
347
347
|
</span>
|
|
348
348
|
<span>{row.delta}</span>
|