basalt-ui 2.15.0 → 2.16.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 +29 -0
- package/MIGRATING.md +74 -12
- package/agent/agents/basalt-design-reviewer.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/configs/card-inset.test.ts +57 -0
- package/configs/oxlint-basalt.json +1 -1
- package/configs/oxlint-plugin.js +42 -18
- package/configs/oxlint-plugin.test.ts +37 -6
- package/dist/agent/chat/thread-message.js +1 -1
- package/dist/agent/chat/thread-outcome-card.js +1 -1
- package/dist/charts/ChartCard.js +1 -1
- package/dist/charts/chart-card.module.css +2 -2
- package/dist/cli/shot/board.js +1 -1
- package/dist/cli/shot/measure.d.ts +21 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +20 -5
- package/dist/cli/shot/types.d.ts +3 -2
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +5 -2
- package/dist/dashboard/stat-card.js +12 -12
- package/dist/dashboard/stat-card.module.css +4 -4
- package/dist/dashboard/widget-header.module.css +3 -3
- package/dist/guard/guard-hook.d.ts.map +1 -1
- package/dist/guard/index.d.ts +4 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +18 -4
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +1 -0
- package/dist/shell/app-mobile-nav.module.css +2 -2
- package/dist/shell/app-sidebar-account.js +1 -1
- package/dist/shell/app-sidebar.js +2 -2
- package/dist/shell/app-sidebar.module.css +8 -8
- package/dist/shell/index.js +5 -1
- package/dist/shell/page-bar.js +1 -1
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +3 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +31 -21
- package/dist/tokens/core.d.ts +10 -4
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +16 -10
- package/dist/tokens/ctl-vars.d.ts +15 -0
- package/dist/tokens/ctl-vars.d.ts.map +1 -0
- package/dist/tokens/ctl-vars.js +22 -0
- package/dist/tokens/palette.d.ts +37 -29
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +32 -21
- package/dist/tokens/space-scale.d.ts +14 -0
- package/dist/tokens/space-scale.d.ts.map +1 -0
- package/dist/tokens/space-scale.js +10 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +1 -1
- package/src/agent/chat/thread-outcome-card.tsx +2 -2
- package/src/charts/ChartCard.tsx +1 -1
- package/src/charts/chart-card.module.css +2 -2
- package/src/cli/shot/board.ts +1 -1
- package/src/cli/shot/measure.ts +33 -6
- package/src/cli/shot/types.ts +3 -2
- package/src/dashboard/settings-section.tsx +5 -2
- package/src/dashboard/stat-card.module.css +4 -4
- package/src/dashboard/stat-card.tsx +13 -13
- package/src/dashboard/widget-header.module.css +3 -3
- package/src/guard/guard-hook.ts +3 -1
- package/src/guard/index.ts +27 -13
- package/src/guard/vx-names.ts +1 -0
- package/src/shell/app-mobile-nav.module.css +2 -2
- package/src/shell/app-sidebar-account.tsx +1 -1
- package/src/shell/app-sidebar.module.css +8 -8
- package/src/shell/app-sidebar.tsx +2 -2
- package/src/shell/index.tsx +10 -4
- package/src/shell/page-bar.tsx +1 -1
- package/src/table/data-table.tsx +10 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +57 -45
- package/src/theme/ctl-theme.tsx +1 -1
- package/src/theme/index.ts +43 -23
- package/src/tokens/core.ts +16 -8
- package/src/tokens/ctl-vars.ts +32 -0
- package/src/tokens/palette.ts +40 -29
- package/src/tokens/space-scale.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
# [2.16.0](https://github.com/jkrumm/basalt-ui/compare/v2.15.0...v2.16.0) (2026-10-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* derive the guard's spacing steps and micro ceiling from the scale ([233530a](https://github.com/jkrumm/basalt-ui/commit/233530a1e8af571920846fd6692311380f0f3a52))
|
|
7
|
+
* derive the latency histogram copy from the measured hours ([b706787](https://github.com/jkrumm/basalt-ui/commit/b706787e1d6420b3eddf1e0246c56788eabae81b))
|
|
8
|
+
* derive the nav row from the sm step and drop the stale 13.5px notes ([3d17c7d](https://github.com/jkrumm/basalt-ui/commit/3d17c7d46073a0f6520a1b543faefd2d6fefedf0))
|
|
9
|
+
* drop restated token fallbacks, round line heights and settle comments ([69980e7](https://github.com/jkrumm/basalt-ui/commit/69980e734c30d78fc300fe2c68a833bf786ef340))
|
|
10
|
+
* emit the dense tier from the palette CSS builder, typed over one var list ([ce2b60c](https://github.com/jkrumm/basalt-ui/commit/ce2b60c03281364e96cdba52950bb6ef8a946a38))
|
|
11
|
+
* keep the card-inset consistency test where the plugin is typed ([374a25d](https://github.com/jkrumm/basalt-ui/commit/374a25dcff14ba3949ef83f305886f1ba867806e))
|
|
12
|
+
* keep the card-inset fallbacks on the chart and stat cards ([0e9d08f](https://github.com/jkrumm/basalt-ui/commit/0e9d08f51d1de7db8763b12f998d23a224d71598))
|
|
13
|
+
* keep the pack-test fixtures off the new spacing grid ([65247f4](https://github.com/jkrumm/basalt-ui/commit/65247f4711cfcdec1c3318e5dea23db9a345d4ca))
|
|
14
|
+
* make basalt/card-inset accept only the sm/md pair ([c0b5526](https://github.com/jkrumm/basalt-ui/commit/c0b55266fb072f6c62731974085d2e0ab016a9e5))
|
|
15
|
+
* mobile menu and child rows follow the sm step; reflow two comments ([be1e462](https://github.com/jkrumm/basalt-ui/commit/be1e462ac79090b121271a582b9939b3450bb1e3))
|
|
16
|
+
* null every reading in an outage hour and share the scenario fixture helpers ([7a523ce](https://github.com/jkrumm/basalt-ui/commit/7a523ce09c70fcad37a2a59f4e9108aa15dc075c))
|
|
17
|
+
* one card-inset fallback rule, pinned against the scale ([fa68c1c](https://github.com/jkrumm/basalt-ui/commit/fa68c1ca4f248c6bbe70968584aeed21c69342b0))
|
|
18
|
+
* report a fully rounded radius as full in shot ([a19d93f](https://github.com/jkrumm/basalt-ui/commit/a19d93f3c8b298eebc7af7658f8c02c06ee2a79c))
|
|
19
|
+
* scope the dense control tier to the hosting row and generate its overrides ([b604b07](https://github.com/jkrumm/basalt-ui/commit/b604b0722e2e6ae983919f177a0920938b0a596b))
|
|
20
|
+
* shot reads a zero-size box as 0 and a percentage radius by its percentage ([421ab83](https://github.com/jkrumm/basalt-ui/commit/421ab83b0933306f8296097671ece1e5ef04ed93))
|
|
21
|
+
* sort the guard's default steps and state what the guard may import ([ad4a407](https://github.com/jkrumm/basalt-ui/commit/ad4a4070862225ef751b0e2019f57fa4817d061b))
|
|
22
|
+
* tighten card-inset to the whole pair and ship it through a grace minor ([3968892](https://github.com/jkrumm/basalt-ui/commit/3968892ebdd38b7e0c20b6f240063fc8232fdaba))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* add the S1 ops-monitor scenario fixture to the playground ([429457e](https://github.com/jkrumm/basalt-ui/commit/429457e29f5e41e8e0bbb6ecba15a9b09ec49bc5))
|
|
28
|
+
* move spacing, inset, radius and type scales onto an even-pixel grid ([b13526b](https://github.com/jkrumm/basalt-ui/commit/b13526b4ab93086309b593e3283e4915d75a066a))
|
|
29
|
+
|
|
1
30
|
# [2.15.0](https://github.com/jkrumm/basalt-ui/compare/v2.14.0...v2.15.0) (2026-10-16)
|
|
2
31
|
|
|
3
32
|
|
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 | 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 | 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 | 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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — |
|
|
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`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — |
|
|
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) | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -1046,6 +1046,68 @@ 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.16.0 — the even-pixel grid
|
|
1050
|
+
|
|
1051
|
+
Wave 32 of the design-parity track moves the spacing, inset, radius and type scales onto an
|
|
1052
|
+
even-pixel grid (`docs/waves/design-parity/SPEC.md` § 5). No export is removed or renamed; **every
|
|
1053
|
+
number below changes at level 0**, so a layout that was tuned against the old scale moves. Plain
|
|
1054
|
+
`feat:` — the way back is **partial**: `density` and `radius` bring back some numbers (last table), the page gutter, the type sizes and the faint ink have no knob.
|
|
1055
|
+
|
|
1056
|
+
| What | Old | New |
|
|
1057
|
+
| ------------------------------------------------ | ---------------------------- | -------------------------------------- |
|
|
1058
|
+
| Mantine spacing `xs / sm / md / lg / xl` | 11 / 13 / 18 / 20 / 26 | 8 / 12 / 16 / 20 / 24 |
|
|
1059
|
+
| `inline-spacing` guard default steps | 11, 13, 18, 20, 26 | 8, 12, 16, 20, 24 |
|
|
1060
|
+
| Card inset (`--vx-space-card-inset-y` / `-x`) | 11 / 13 | 12 / 16 |
|
|
1061
|
+
| Card horizontal inset below `sm` | 11 | 12 |
|
|
1062
|
+
| Page gutter, expanded size class (≥ 1200) | 16 | 24 (medium 16, compact 8 unchanged) |
|
|
1063
|
+
| `--vx-radius-card` | 7 | 10 |
|
|
1064
|
+
| `--vx-radius-floating` (card + 1) | 8 | 11 |
|
|
1065
|
+
| `SegmentedControl` track / indicator radius | 7 (card) / 5 (tight) | 6 (ctrl) / 4 (fine) |
|
|
1066
|
+
| Type `sm` (dense rows, table cells, menu items) | 13.5, line 1.45 | 13, 20px line |
|
|
1067
|
+
| Type `xs` | 12.5, line 1.4 | 12, 16px line |
|
|
1068
|
+
| Type `kpi` (hero numeral) | 24, weight 600 | 22, weight 500 |
|
|
1069
|
+
| Nav row / menu item / timeline font | `md` 15 | `sm` 13 (nav row stays 32 tall) |
|
|
1070
|
+
| `--vx-space-row-line-height` | 1.35 | 1.54 (a 20px line at `sm`) |
|
|
1071
|
+
| Table body cell font | inherited body | `sm` 13 (row 40 / header 36 unchanged) |
|
|
1072
|
+
| Table toolbar and `FilterSet` controls, fine ptr | 32 | 28 (`--vx-space-control-height-dense`) |
|
|
1073
|
+
| Axis ticks / chart small labels (`--vx-axis`) | ink at 60% — 4.06:1 on light | the `faint` ink — ≥ 4.5:1 both schemes |
|
|
1074
|
+
|
|
1075
|
+
- **Behaviour: spacing props and `--mantine-spacing-*` reads shrink.** `p="xs"` is 8 (was 11), `"sm"` 12 (was 13), `"md"` 16 (was 18), `"xl"` 24 (was 26); `"lg"` is unchanged. Hand-written `px={18}` / `gap={26}` no longer equal a step, and `raw-spacing` reports them.
|
|
1076
|
+
- **Behaviour: the CSS sub-scale ceiling of `inline-spacing` drops from 10px to 7px** (it sits one below the smallest stop, now 8). A CSS `padding: 8px` or `10px` is now a finding; 2 / 4 / 6px clusters stay legal.
|
|
1077
|
+
- **Behaviour: `basalt/card-inset` is strict.** The only accepted inset is the pair `py="sm" px="md"` (12/16) or leaving both to the theme. Uniform `p`/`padding` (any value) and every other pair, including the old `py="xs" px="sm"` (now 8/12), are findings. **Severity: `warn` for this minor, `error` from 2.17.0** (`PLUGIN_RULE_GRACE`, one entry for the rule); that also demotes the rule's older findings (explicit `radius`, `p="lg"`) to `warn` for the minor, because a level is per rule id. Also flagged now: numeric or non-literal `py`/`px`, and a lone `py="sm"` or `px="md"` without its partner. Move each `<Card py="xs" px="sm">` to `py="sm" px="md"`.
|
|
1078
|
+
- **Behaviour: the compact card inset reads `--vx-space-card-inset-x` below `sm`**, and `StatCard`'s full-bleed sparkline now bleeds by the card inset tokens rather than the `sm`/`xs` scale stops, so the bleed matches the inset at every width.
|
|
1079
|
+
- **Behaviour: the `SegmentedControl` concentricity law restated.** `RADIUS.card === RADIUS_STEP.tight + segmentedTrackInset` could not hold at card 10, so the track now takes the control radius and the indicator the `fine` tier: `RADIUS.ctrl === RADIUS_STEP.fine + 2`, exact down to `radius: -4` (at `-5`, `fine` clamps to 0 against a 1px track).
|
|
1080
|
+
- **Behaviour: `shot` `metrics.json` `radius` may be the string `"full"`** (also on `nested[]`) for a fully rounded box (a `50%` circle or `9999px` pill); it was the number `50` or `9999`. A consumer reading it as a number checks the type first.
|
|
1081
|
+
- **Behaviour: `deriveSpacing(0).rowLineHeight` is 1.54** (was 1.35); the additive range across `density` −3..+3 is 1.44..1.64.
|
|
1082
|
+
- **Behaviour: the dense control tier is internal.** `PageBar`'s filter row (the `pills` line) and the `BasaltDataTable` toolbar carry `data-basalt-dense`; at a fine pointer their `ctl` controls resolve to 28. A coarse pointer keeps 32 and the 44px hit overlay. `--vx-space-control-height-dense` is the only new name.
|
|
1083
|
+
- **Added: `--vx-space-control-height-dense`.** An emitted token (28, floored at 24 by `density`); not exported from `basalt-ui/tokens`.
|
|
1084
|
+
- **Behaviour: the page gutter is a trial at the expanded class** (SPEC D7). `appShellInsetExpanded` is one constant in `tokens/palette.ts`; setting it equal to `appShellInset` reverts it.
|
|
1085
|
+
|
|
1086
|
+
### Migrating the guards
|
|
1087
|
+
|
|
1088
|
+
`raw-spacing` and `inline-spacing` ship at **`warn` for this minor and `error` from 2.17.0** (`GRACE_PERIOD_KINDS`, since 2.16.0): their steps follow the new scale, so after the upgrade `p={16}` and `gap={24}` are findings (use `"md"` / `"xl"`) and `p={18}` / `gap={26}` are no longer flagged. To migrate on your own schedule, in the consumer's `package.json`:
|
|
1089
|
+
|
|
1090
|
+
```json
|
|
1091
|
+
"basalt": {
|
|
1092
|
+
"spacingSteps": [11, 13, 18, 20, 26],
|
|
1093
|
+
"severity": { "raw-spacing": "warn", "inline-spacing": "warn" }
|
|
1094
|
+
}
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
`spacingSteps` keeps the guard on the old numbers (matching a scale you have not moved off yet); `severity` pins both at `warn` past 2.17.0, when the grace entries are deleted and they become `error`. Drop both once the call sites read tokens. The CSS sub-scale ceiling (10 → 7px: a CSS `padding: 8px` or `10px` is now a finding) has no switch of its own; it rides on `inline-spacing`'s severity.
|
|
1098
|
+
|
|
1099
|
+
### Restoring the old feel
|
|
1100
|
+
|
|
1101
|
+
| Dimension | Knob | Closest level, honestly |
|
|
1102
|
+
| ------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1103
|
+
| Spacing scale | `density` | `+1` gives 9 / 13 / 18 / 22 / 26 — matches old `sm`, `md`, `xl`, misses `xs` (9 vs 11) and `lg` (22 vs 20). It also scales every other density-tracking number: control height 35, table row 44, gutter 26. |
|
|
1104
|
+
| Card inset | `density` | No level restores 11/13: `-1` gives 11/14, `0` gives 12/16. A consumer that wants the old inset sets `--vx-space-card-inset-y: 11px; --vx-space-card-inset-x: 13px` in its own `:root` CSS. |
|
|
1105
|
+
| Card radius | `radius` | `-3` gives card 7 / floating 8 — and control 3, tight 2, fine 1, which is not the old control radius (6). No level moves card alone. Set `--vx-radius-card: 7px` in `:root` to restore just the card. |
|
|
1106
|
+
| Floating radius (Tooltip, Popover, Modal, Notification) | none | These four take a numeric Mantine `radius` from the theme, not the CSS var, so `--vx-radius-floating` does not reach them: there is no CSS-only restore. Pass `createBasaltTheme({ components: { Tooltip: { defaultProps: { radius: 8 } } } })` per component (or `radius={8}` at the call site). |
|
|
1107
|
+
| Type `sm` / `xs` / `kpi` | none | The `fonts` knob changes families, not sizes. A consumer that needs 13.5 / 12.5 / 24 at one site writes the size at that site with a `theme-allow`. |
|
|
1108
|
+
| Faint chart ink | none | `derive` retunes the whole neutral ramp; there is no separate knob for the axis ink, and a lighter axis fails the 4.5:1 gate by construction. |
|
|
1109
|
+
| Page gutter | none | The expanded gutter is a constant; `density` scales it (`-1` gives 22). |
|
|
1110
|
+
|
|
1049
1111
|
## 2.15.0 — the reviewer subagent and the ViewTabs law
|
|
1050
1112
|
|
|
1051
1113
|
- **Behaviour: `basalt/bound-control-outside-home` now reports a `ViewTabs` in every `PageBar` slot except `tabs` (`actions`, `filters`, `filtersEnd`, `sync`), in `Section.actions`, or inside a `FilterSet`.** It was accepted there (any slot was a home). A `ViewTabs` that switches a page or a section belongs in a `tabs` slot (`PageBar.tabs`, `Section.tabs`); one that switches only a card's view belongs in that `ChartCard` / `WidgetHeader` `actions` slot (still allowed). **Fix: move it to `tabs`.** The lint is structural: only a `ViewTabs` written inside the slot (JSX attribute or object spread) is seen; one passed through a hoisted `const` is not.
|
|
@@ -12,7 +12,7 @@ You score a rendered UI. You did not build it. Do not read the app's source to e
|
|
|
12
12
|
A shot out dir (default `.basalt/shots`, or the `out` in `.basalt/shots/last.json`):
|
|
13
13
|
|
|
14
14
|
- `board.html` — every crop, labelled by component, scheme, viewport and state.
|
|
15
|
-
- `metrics.json` — per anchor: `padding`, `gap`, `radius
|
|
15
|
+
- `metrics.json` — per anchor: `padding`, `gap`, `radius` (px, or `"full"` for a fully rounded box such as a `50%` circle or pill), `nested`, `fontSizes`, `emptyRatio`, `contrast`, `sheet`; `scale` (the theme's resolved spacing, radius and font-size steps) and `scaleError`; `shots[]` with each file's `status`.
|
|
16
16
|
- `png/*.png` — the crops, images you can see. Each anchor has a contact sheet (`sheet`: one image holding that anchor's crop for every state × scheme × viewport, each labelled, with the status text where a crop does not exist) and each route a full-page shot (`_page`). Score every anchor in both schemes and both viewports.
|
|
17
17
|
- A layout-suite result, only if the out dir has one.
|
|
18
18
|
|
|
@@ -32,7 +32,7 @@ paths:
|
|
|
32
32
|
## Surfaces
|
|
33
33
|
|
|
34
34
|
- Never pass `withBorder` to `Card` or `Paper`; the theme draws the ring (`<Card.Section withBorder>` is fine). [check-theme card-with-border]
|
|
35
|
-
- Card/Paper insets are `py="
|
|
35
|
+
- Card/Paper insets are `py="sm" px="md"` with the theme radius; no explicit `p`, `padding` or `radius`. [basalt/card-inset]
|
|
36
36
|
- Lay out with `Box`/`Flex`/`Grid`/`Stack`/`Group`, not a `<div>` with `style`. [check-theme raw-html-layout] [check-theme hidden-inline-style]
|
|
37
37
|
- No inline `display: flex|grid`; no inline spacing; spacing props take `xs..xl`. [check-theme inline-display] [check-theme inline-spacing] [check-theme raw-spacing]
|
|
38
38
|
- Inputs come from `@mantine/core`, never `<input>`, `<select>` or `<textarea>`. [check-theme raw-form-control]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card inset is stated in four places that must agree: the token (`cardInsetY`/`cardInsetX`,
|
|
3
|
+
* level 0), the fallback literal every reader of `--vx-space-card-inset-*` carries (a Mantine-free
|
|
4
|
+
* chart layer or a head-injected palette renders before the var exists), and the `py`/`px` pair the
|
|
5
|
+
* `basalt/card-inset` rule accepts. One scale, so one test.
|
|
6
|
+
*/
|
|
7
|
+
import { expect, test } from 'bun:test'
|
|
8
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs'
|
|
9
|
+
import { join } from 'node:path'
|
|
10
|
+
import { SPACE_SCALE, SPACE_STEP } from '../src/tokens/palette'
|
|
11
|
+
import { CARD_INSET_PX, CARD_INSET_PY } from './oxlint-plugin.js'
|
|
12
|
+
|
|
13
|
+
const SRC = join(import.meta.dirname, '..', 'src')
|
|
14
|
+
|
|
15
|
+
function sources(dir: string): string[] {
|
|
16
|
+
return readdirSync(dir).flatMap((name) => {
|
|
17
|
+
const path = join(dir, name)
|
|
18
|
+
if (statSync(path).isDirectory()) return sources(path)
|
|
19
|
+
return /\.(tsx?|css)$/.test(name) && !/\.test\./.test(name) ? [path] : []
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const toPx = (value: string, unit: string): number =>
|
|
24
|
+
unit === 'rem' ? Number(value) * 16 : Number(value)
|
|
25
|
+
|
|
26
|
+
test('every --vx-space-card-inset-* fallback literal equals the level-0 inset', () => {
|
|
27
|
+
const found: [string, string, number][] = []
|
|
28
|
+
for (const file of sources(SRC)) {
|
|
29
|
+
const text = readFileSync(file, 'utf8')
|
|
30
|
+
for (const m of text.matchAll(/var\(--vx-space-card-inset-([xy]),\s*([\d.]+)(px|rem)\)/g)) {
|
|
31
|
+
found.push([file.slice(SRC.length), m[1] as string, toPx(m[2] as string, m[3] as string)])
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
expect(found.length).toBeGreaterThan(8)
|
|
35
|
+
for (const [file, axis, px] of found) {
|
|
36
|
+
expect([file, axis, px]).toEqual([
|
|
37
|
+
file,
|
|
38
|
+
axis,
|
|
39
|
+
axis === 'x' ? SPACE_STEP.cardInsetX : SPACE_STEP.cardInsetY,
|
|
40
|
+
])
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('every bare reader of --vx-space-card-inset-* carries a fallback', () => {
|
|
45
|
+
for (const file of sources(SRC)) {
|
|
46
|
+
if (/tokens\/core\.ts$|guard\/vx-names\.ts$/.test(file)) continue
|
|
47
|
+
const text = readFileSync(file, 'utf8')
|
|
48
|
+
for (const m of text.matchAll(/var\(--vx-space-card-inset-[xy]\)/g)) {
|
|
49
|
+
throw new Error(`${file.slice(SRC.length)}: ${m[0]} has no fallback`)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test("the rule's py/px pair names the scale steps the inset tokens are", () => {
|
|
55
|
+
expect(SPACE_STEP.cardInsetY).toBe(SPACE_SCALE[CARD_INSET_PY as keyof typeof SPACE_SCALE])
|
|
56
|
+
expect(SPACE_STEP.cardInsetX).toBe(SPACE_SCALE[CARD_INSET_PX as keyof typeof SPACE_SCALE])
|
|
57
|
+
})
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"rules": {
|
|
4
4
|
"basalt/no-raw-font-size": "error",
|
|
5
5
|
"basalt/raw-size-literal": "error",
|
|
6
|
-
"basalt/card-inset": "
|
|
6
|
+
"basalt/card-inset": "warn",
|
|
7
7
|
"basalt/chart-in-raw-surface": "error",
|
|
8
8
|
"basalt/shadow-basalt-export": "error",
|
|
9
9
|
"basalt/hand-rolled-shell": "error",
|
package/configs/oxlint-plugin.js
CHANGED
|
@@ -588,9 +588,15 @@ const rawSizeLiteral = {
|
|
|
588
588
|
|
|
589
589
|
const CARD_TAGS = new Set(['Card', 'Paper'])
|
|
590
590
|
|
|
591
|
+
// The idiom is the PAIR py="sm" px="md" (12/16), or leaving both to the theme. Never a uniform
|
|
592
|
+
// `p`/`padding` (whatever its value or form), never one half of the pair alone, never a number, an
|
|
593
|
+
// expression or any other step. The pair is the level-0 inset (`cardInsetY`/`cardInsetX` =
|
|
594
|
+
// `SPACE_SCALE.sm`/`.md`); `tokens/space-scale.test.ts` pins that.
|
|
595
|
+
export const CARD_INSET_PY = 'sm'
|
|
596
|
+
export const CARD_INSET_PX = 'md'
|
|
591
597
|
const CARD_INSET_MESSAGE =
|
|
592
|
-
'Card/Paper is off the card idiom — use the spacing
|
|
593
|
-
"theme's card radius, not an explicit p/padding or radius. (basalt/card-inset)"
|
|
598
|
+
'Card/Paper is off the card idiom — use the spacing sm/md inset together (py="sm" px="md") and ' +
|
|
599
|
+
"the theme's card radius, not an explicit p/padding, a lone py/px, or a radius. (basalt/card-inset)"
|
|
594
600
|
|
|
595
601
|
function isStringLiteral(node) {
|
|
596
602
|
return node !== null && node.type === 'Literal' && typeof node.value === 'string'
|
|
@@ -600,7 +606,7 @@ function attrValue(attr) {
|
|
|
600
606
|
return unwrapExpressionContainer(attr.value)
|
|
601
607
|
}
|
|
602
608
|
|
|
603
|
-
// Ships:
|
|
609
|
+
// Ships: warn (grace → 2.17.0)
|
|
604
610
|
const cardInset = {
|
|
605
611
|
meta: {
|
|
606
612
|
type: 'suggestion',
|
|
@@ -612,23 +618,35 @@ const cardInset = {
|
|
|
612
618
|
create(context) {
|
|
613
619
|
return {
|
|
614
620
|
JSXOpeningElement(node) {
|
|
615
|
-
|
|
616
|
-
if (!CARD_TAGS.has(tagName)) return
|
|
621
|
+
if (!CARD_TAGS.has(node.name?.name)) return
|
|
617
622
|
|
|
623
|
+
/** @type {Map<string, any>} */
|
|
624
|
+
const attrs = new Map()
|
|
618
625
|
for (const attr of node.attributes) {
|
|
619
|
-
if (attr.type
|
|
620
|
-
|
|
626
|
+
if (attr.type === 'JSXAttribute' && typeof attr.name?.name === 'string') {
|
|
627
|
+
attrs.set(attr.name.name, attr)
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
const isExactly = (attr, expected) => {
|
|
631
|
+
if (!attr) return false
|
|
621
632
|
const value = attrValue(attr)
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
633
|
+
return isStringLiteral(value) && value.value === expected
|
|
634
|
+
}
|
|
635
|
+
const py = attrs.get('py')
|
|
636
|
+
const px = attrs.get('px')
|
|
637
|
+
const offenders = []
|
|
638
|
+
// A uniform inset is never the idiom, in any form (string, number, expression).
|
|
639
|
+
for (const name of ['p', 'padding', 'radius']) {
|
|
640
|
+
if (attrs.has(name)) offenders.push(attrs.get(name))
|
|
641
|
+
}
|
|
642
|
+
// The pair stands or falls together: each half must be exactly its step, and neither
|
|
643
|
+
// may appear without the other.
|
|
644
|
+
const pyOk = isExactly(py, CARD_INSET_PY)
|
|
645
|
+
const pxOk = isExactly(px, CARD_INSET_PX)
|
|
646
|
+
if (py && !(pyOk && pxOk)) offenders.push(py)
|
|
647
|
+
if (px && !(pyOk && pxOk)) offenders.push(px)
|
|
648
|
+
|
|
649
|
+
for (const attr of offenders) {
|
|
632
650
|
if (hasThemeAllow(context, attr, 'card-inset')) continue
|
|
633
651
|
context.report({ node: attr, message: CARD_INSET_MESSAGE })
|
|
634
652
|
}
|
|
@@ -4203,7 +4221,13 @@ const routeViewTransition = {
|
|
|
4203
4221
|
*
|
|
4204
4222
|
* @type {Record<string, GraceEntry>}
|
|
4205
4223
|
*/
|
|
4206
|
-
export const PLUGIN_RULE_GRACE = {
|
|
4224
|
+
export const PLUGIN_RULE_GRACE = {
|
|
4225
|
+
'card-inset': {
|
|
4226
|
+
since: '2.16.0',
|
|
4227
|
+
promote: '2.17.0',
|
|
4228
|
+
why: 'Tightened in 2.16.0: only py="sm" px="md" together (or neither) passes; uniform p/padding, a lone half, numbers and expressions are findings.',
|
|
4229
|
+
},
|
|
4230
|
+
}
|
|
4207
4231
|
|
|
4208
4232
|
// ── Plugin export ───────────────────────────────────────────────────────────────────────────────
|
|
4209
4233
|
|
|
@@ -225,17 +225,44 @@ describe('basalt/raw-size-literal', () => {
|
|
|
225
225
|
// ── card-inset ───────────────────────────────────────────────────────────────
|
|
226
226
|
|
|
227
227
|
describe('basalt/card-inset', () => {
|
|
228
|
-
it(
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
it.each([
|
|
229
|
+
['uniform p="lg"', '<Card p="lg" />'],
|
|
230
|
+
['uniform p="md"', '<Card p="md" />'],
|
|
231
|
+
['uniform p="sm"', '<Card p="sm" />'],
|
|
232
|
+
['uniform padding="sm"', '<Card padding="sm" />'],
|
|
233
|
+
['uniform padding={12}', '<Card padding={12} />'],
|
|
234
|
+
['uniform p={0}', '<Card p={0} />'],
|
|
235
|
+
['a non-literal p', '<Card p={gap} />'],
|
|
236
|
+
['py="md"', '<Paper py="md" px="md" />'],
|
|
237
|
+
['px="xs"', '<Paper py="sm" px="xs" />'],
|
|
238
|
+
['the old xs/sm pair', '<Paper py="xs" px="sm" />'],
|
|
239
|
+
['numeric py/px {8} {12}', '<Paper py={8} px={12} />'],
|
|
240
|
+
['numeric py/px {13} {4}', '<Paper py={13} px={4} />'],
|
|
241
|
+
['a non-literal py', '<Paper py={y} px="md" />'],
|
|
242
|
+
['a non-literal px', '<Paper py="sm" px={x} />'],
|
|
243
|
+
['a lone py="sm"', '<Paper py="sm" />'],
|
|
244
|
+
['a lone px="md"', '<Paper px="md" />'],
|
|
245
|
+
['an explicit radius', '<Card radius="md" />'],
|
|
246
|
+
])('flags %s', (_name, jsx) => {
|
|
247
|
+
const { rules } = run(`export const C = () => ${jsx}\n`)
|
|
231
248
|
expect(rules).toContain('card-inset')
|
|
232
249
|
})
|
|
233
250
|
|
|
234
|
-
it(
|
|
235
|
-
|
|
236
|
-
|
|
251
|
+
it.each([
|
|
252
|
+
['the sm/md pair', '<Paper py="sm" px="md" />'],
|
|
253
|
+
['the pair in either order', '<Card px="md" py="sm" />'],
|
|
254
|
+
['no padding at all', '<Card />'],
|
|
255
|
+
])('does NOT flag %s', (_name, jsx) => {
|
|
256
|
+
const { rules } = run(`export const C = () => ${jsx}\n`)
|
|
237
257
|
expect(rules).not.toContain('card-inset')
|
|
238
258
|
})
|
|
259
|
+
|
|
260
|
+
it('ships warn through its grace minor, so a flagged card does not fail the run', () => {
|
|
261
|
+
const { code, rules } = run(`export const C = () => <Card p="lg" />\n`)
|
|
262
|
+
// The fixture config sets the rule to error; the SHIPPED level is pinned by the ledger tests.
|
|
263
|
+
expect(rules).toContain('card-inset')
|
|
264
|
+
expect(code).toBe(1)
|
|
265
|
+
})
|
|
239
266
|
})
|
|
240
267
|
|
|
241
268
|
// ── chart-in-raw-surface ──────────────────────────────────────────────────────
|
|
@@ -1430,6 +1457,9 @@ describe('assertGraceLedger', () => {
|
|
|
1430
1457
|
const pluginGrace = PLUGIN_RULE_GRACE as Record<string, GraceEntry>
|
|
1431
1458
|
const guardGrace = GRACE_PERIOD_KINDS as Record<string, GraceEntry>
|
|
1432
1459
|
|
|
1460
|
+
/** A guard message that NAMES a plugin rule in its remedy without being that rule's twin. */
|
|
1461
|
+
const REFERRALS = new Set(['card-with-border:card-inset'])
|
|
1462
|
+
|
|
1433
1463
|
function twinLanes(): Array<[kind: string, rule: string]> {
|
|
1434
1464
|
const pairs = new Map<string, string>()
|
|
1435
1465
|
for (const [kind, aliases] of Object.entries(WAIVER_ID_ALIASES)) {
|
|
@@ -1438,6 +1468,7 @@ function twinLanes(): Array<[kind: string, rule: string]> {
|
|
|
1438
1468
|
}
|
|
1439
1469
|
for (const [kind, rule] of Object.entries(GUARD_RULES)) {
|
|
1440
1470
|
for (const m of rule.message.matchAll(/basalt\/([a-z-]+)/g)) {
|
|
1471
|
+
if (REFERRALS.has(`${kind}:${m[1]}`)) continue
|
|
1441
1472
|
if (m[1] !== undefined && m[1] in basaltPlugin.rules) pairs.set(kind, m[1])
|
|
1442
1473
|
}
|
|
1443
1474
|
}
|
|
@@ -140,7 +140,7 @@ function MessageAffordanceRow({
|
|
|
140
140
|
return /* @__PURE__ */ jsxs(
|
|
141
141
|
Group,
|
|
142
142
|
{
|
|
143
|
-
gap:
|
|
143
|
+
gap: "xs",
|
|
144
144
|
"data-testid": `message-affordances-${message.id}`,
|
|
145
145
|
style: { opacity: visible ? 1 : 0, transition: "opacity 120ms ease" },
|
|
146
146
|
children: [
|
|
@@ -96,7 +96,7 @@ function ThreadOutcomeCard({
|
|
|
96
96
|
className: cx(className),
|
|
97
97
|
style: {
|
|
98
98
|
display: "block",
|
|
99
|
-
padding: "var(--
|
|
99
|
+
padding: "var(--vx-space-card-inset-y, 0.75rem) var(--vx-space-card-inset-x, 1rem)",
|
|
100
100
|
borderRadius: VX.radiusCard,
|
|
101
101
|
boxShadow: VX.shadowCard,
|
|
102
102
|
backgroundColor: background,
|
package/dist/charts/ChartCard.js
CHANGED
|
@@ -53,7 +53,7 @@ const bodyClipStyle = {
|
|
|
53
53
|
minHeight: 0,
|
|
54
54
|
display: "flex",
|
|
55
55
|
flexDirection: "column",
|
|
56
|
-
padding: "2px var(--vx-space-card-inset-x,
|
|
56
|
+
padding: "2px var(--vx-space-card-inset-x, 1rem) var(--vx-space-card-inset-y, 0.75rem)"
|
|
57
57
|
};
|
|
58
58
|
const definedOnly = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
|
|
59
59
|
const HEADER_TRIGGERS = ["title", "info", "value", "icon", "count"];
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
.header {
|
|
10
|
-
padding: 4px var(--vx-space-card-inset-x,
|
|
10
|
+
padding: 4px var(--vx-space-card-inset-x, 1rem) 4px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@container (min-width: 480px) {
|
|
14
14
|
.header {
|
|
15
|
-
padding-top: var(--vx-space-card-inset-y, 0.
|
|
15
|
+
padding-top: var(--vx-space-card-inset-y, 0.75rem);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
package/dist/cli/shot/board.js
CHANGED
|
@@ -38,7 +38,7 @@ const metricsTable = (rows) => {
|
|
|
38
38
|
);
|
|
39
39
|
const assumed = rows.filter((a) => a.contrast.backdrop === "assumed-white").map((a) => `${a.scheme}/${a.viewport}`);
|
|
40
40
|
const nested = rows.filter((a) => a.nested.length > 0).map(
|
|
41
|
-
(a) => `<li>${a.scheme}/${a.viewport}<ul>${a.nested.map((n) => `<li>${esc(n.path)} r${n.radius} p ${sides(n.padding)}</li>`).join("")}</ul></li>`
|
|
41
|
+
(a) => `<li>${a.scheme}/${a.viewport}<ul>${a.nested.map((n) => `<li>${esc(n.path)} r${n.radius === "full" ? " full" : n.radius} p ${sides(n.padding)}</li>`).join("")}</ul></li>`
|
|
42
42
|
);
|
|
43
43
|
return `<table><tr><th></th><th>box</th><th>padding</th><th>gap r/c</th><th>radius</th><th>border</th><th>font px</th><th>empty</th><th>contrast min</th></tr>${rows.map(metricsRow).join("")}</table>` + (assumed.length ? `<p class="bad">backdrop assumed white (no opaque ancestor background): ${assumed.join(", ")}</p>` : "") + (failures.length ? `<h4>Contrast failures</h4><ul class="bad">${failures.join("")}</ul>` : "") + (nested.length ? `<h4>Nested surfaces</h4><ul>${nested.join("")}</ul>` : "");
|
|
44
44
|
};
|
|
@@ -16,13 +16,32 @@ export type TextReading = {
|
|
|
16
16
|
/** No opaque ancestor background was found: `bg` is white by assumption. */
|
|
17
17
|
assumedWhite: boolean;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
/** A computed `border-top-left-radius` as the page read it, with the box it rounds. */
|
|
20
|
+
export type RawRadius = {
|
|
21
|
+
value: string;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
export type Reading = Omit<Measurement, 'contrast' | 'radius' | 'nested'> & {
|
|
26
|
+
radius: RawRadius;
|
|
27
|
+
nested: {
|
|
28
|
+
path: string;
|
|
29
|
+
radius: RawRadius;
|
|
30
|
+
padding: Measurement['padding'];
|
|
31
|
+
}[];
|
|
20
32
|
texts: TextReading[];
|
|
21
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* A radius in px, or `'full'` when it rounds the box completely: a percentage of 50 or more
|
|
36
|
+
* (`50%` is a circle/pill however the box is shaped), or a px radius of at least half the shorter
|
|
37
|
+
* side (`9999px`). A zero-size box has nothing to round: 0. A smaller percentage stays a number,
|
|
38
|
+
* resolved against the shorter side — the radius a reader sees on a wide, short box.
|
|
39
|
+
*/
|
|
40
|
+
export declare function radiusReading({ value, width, height }: RawRadius): number | 'full';
|
|
22
41
|
/**
|
|
23
42
|
* Contrast per text reading: `min` over all, `failures` below the WCAG AA threshold. The threshold
|
|
24
43
|
* is tested on the UNROUNDED ratio; only the stored value is rounded.
|
|
25
44
|
*/
|
|
26
|
-
export declare function finishMeasurement({ texts, ...rest }: Reading): Measurement;
|
|
45
|
+
export declare function finishMeasurement({ texts, radius, nested, ...rest }: Reading): Measurement;
|
|
27
46
|
export declare function measureAnchor(root: Element): Reading;
|
|
28
47
|
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/measure.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,SAAS,CAAA;AAS3D,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAGhF;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAEzE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,EAAE,CAAA;IACZ,EAAE,EAAE,MAAM,EAAE,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,OAAO,CAAA;IACb,4EAA4E;IAC5E,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/measure.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,SAAS,CAAA;AAS3D,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAGhF;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAEzE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,EAAE,CAAA;IACZ,EAAE,EAAE,MAAM,EAAE,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,OAAO,CAAA;IACb,4EAA4E;IAC5E,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AACD,uFAAuF;AACvF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AACxE,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG;IAC1E,MAAM,EAAE,SAAS,CAAA;IACjB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,CAAC;QAAC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;KAAE,EAAE,CAAA;IAC9E,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAQlF;AASD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,GAAG,WAAW,CAkB1F;AAGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAgKpD"}
|
package/dist/cli/shot/measure.js
CHANGED
|
@@ -10,8 +10,17 @@ function contrastRatio(a, b) {
|
|
|
10
10
|
function contrastThreshold(fontSize, bold) {
|
|
11
11
|
return fontSize >= 24 || bold && fontSize >= 18.66 ? 3 : 4.5;
|
|
12
12
|
}
|
|
13
|
+
function radiusReading({ value, width, height }) {
|
|
14
|
+
const first = value.trim();
|
|
15
|
+
const n = Number.parseFloat(first);
|
|
16
|
+
if (width <= 0 || height <= 0 || !Number.isFinite(n) || n <= 0) return 0;
|
|
17
|
+
if (first.endsWith("%"))
|
|
18
|
+
return n >= 50 ? "full" : Math.round(n / 100 * Math.min(width, height) * 100) / 100;
|
|
19
|
+
if (n >= Math.min(width, height) / 2) return "full";
|
|
20
|
+
return Math.round(n * 100) / 100;
|
|
21
|
+
}
|
|
13
22
|
const hex = (c) => "#" + c.slice(0, 3).map((n) => Math.round(n).toString(16).padStart(2, "0")).join("");
|
|
14
|
-
function finishMeasurement({ texts, ...rest }) {
|
|
23
|
+
function finishMeasurement({ texts, radius, nested, ...rest }) {
|
|
15
24
|
const failures = [];
|
|
16
25
|
let min = null;
|
|
17
26
|
for (const t of texts) {
|
|
@@ -23,7 +32,12 @@ function finishMeasurement({ texts, ...rest }) {
|
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
34
|
const backdrop = texts.some((t) => t.assumedWhite) ? { backdrop: "assumed-white" } : {};
|
|
26
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
...rest,
|
|
37
|
+
radius: radiusReading(radius),
|
|
38
|
+
nested: nested.map((n) => ({ ...n, radius: radiusReading(n.radius) })),
|
|
39
|
+
contrast: { min, failures, ...backdrop }
|
|
40
|
+
};
|
|
27
41
|
}
|
|
28
42
|
function measureAnchor(root) {
|
|
29
43
|
const px = (v) => Math.round(parseFloat(String(v)) * 100) / 100;
|
|
@@ -118,7 +132,7 @@ function measureAnchor(root) {
|
|
|
118
132
|
if (el !== root && (hasBg || hasBorder) && nested.length < 60) {
|
|
119
133
|
nested.push({
|
|
120
134
|
path: pathOf(el),
|
|
121
|
-
radius: px(
|
|
135
|
+
radius: { value: s.borderTopLeftRadius, width: px(r.width), height: px(r.height) },
|
|
122
136
|
padding: sides(s, "padding")
|
|
123
137
|
});
|
|
124
138
|
}
|
|
@@ -160,7 +174,7 @@ function measureAnchor(root) {
|
|
|
160
174
|
box: { width: px(rect.width), height: px(rect.height) },
|
|
161
175
|
padding: sides(cs, "padding"),
|
|
162
176
|
gap,
|
|
163
|
-
radius: px(
|
|
177
|
+
radius: { value: cs.borderTopLeftRadius, width: px(rect.width), height: px(rect.height) },
|
|
164
178
|
borderWidth: widest,
|
|
165
179
|
fontSizes: [...fontSizes].toSorted((a, b) => a - b),
|
|
166
180
|
nested,
|
|
@@ -172,5 +186,6 @@ export {
|
|
|
172
186
|
contrastRatio,
|
|
173
187
|
contrastThreshold,
|
|
174
188
|
finishMeasurement,
|
|
175
|
-
measureAnchor
|
|
189
|
+
measureAnchor,
|
|
190
|
+
radiusReading
|
|
176
191
|
};
|
package/dist/cli/shot/types.d.ts
CHANGED
|
@@ -37,12 +37,13 @@ export type Measurement = {
|
|
|
37
37
|
row: number;
|
|
38
38
|
column: number;
|
|
39
39
|
};
|
|
40
|
-
radius
|
|
40
|
+
/** px, or `'full'` for a radius that rounds the box completely (`50%`, `9999px`). */
|
|
41
|
+
radius: number | 'full';
|
|
41
42
|
borderWidth: number;
|
|
42
43
|
fontSizes: number[];
|
|
43
44
|
nested: {
|
|
44
45
|
path: string;
|
|
45
|
-
radius: number;
|
|
46
|
+
radius: number | 'full';
|
|
46
47
|
padding: Sides;
|
|
47
48
|
}[];
|
|
48
49
|
emptyRatio: number;
|