basalt-ui 2.17.0 → 2.19.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 +58 -0
- package/MIGRATING.md +108 -12
- package/agent/agents/basalt-design-reviewer.md +2 -2
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/dist/cli/help.d.ts +1 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -2
- package/dist/cli/shot/capture.d.ts +12 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +72 -10
- package/dist/cli/shot/index.d.ts +10 -1
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +40 -5
- package/dist/cli/shot/real-data.d.ts +35 -0
- package/dist/cli/shot/real-data.d.ts.map +1 -0
- package/dist/cli/shot/real-data.js +120 -0
- package/dist/cli/shot/serve.d.ts +2 -2
- package/dist/cli/shot/serve.d.ts.map +1 -1
- package/dist/cli/shot/serve.js +16 -2
- package/dist/commands/notifications/center.d.ts.map +1 -1
- package/dist/commands/notifications/center.js +18 -26
- package/dist/content/callout.d.ts +1 -1
- package/dist/content/callout.d.ts.map +1 -1
- package/dist/content/callout.js +10 -1
- package/dist/content/callout.module.css +15 -3
- package/dist/content/callout.module.css.d.ts +1 -0
- package/dist/dashboard/bar-list.d.ts +29 -0
- package/dist/dashboard/bar-list.d.ts.map +1 -0
- package/dist/dashboard/bar-list.js +65 -0
- package/dist/dashboard/bar-list.module.css +91 -0
- package/dist/dashboard/bar-list.module.css.d.ts +17 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -0
- package/dist/dashboard/meter-model.d.ts +126 -0
- package/dist/dashboard/meter-model.d.ts.map +1 -0
- package/dist/dashboard/meter-model.js +135 -0
- package/dist/dashboard/meter-parts.d.ts +42 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -0
- package/dist/dashboard/meter-parts.js +297 -0
- package/dist/dashboard/meter.d.ts +123 -0
- package/dist/dashboard/meter.d.ts.map +1 -0
- package/dist/dashboard/meter.js +43 -0
- package/dist/dashboard/meter.module.css +268 -0
- package/dist/dashboard/meter.module.css.d.ts +39 -0
- package/dist/dashboard/scale.d.ts +9 -0
- package/dist/dashboard/scale.d.ts.map +1 -0
- package/dist/dashboard/scale.js +10 -0
- package/dist/dashboard/stat-card-parts.d.ts +3 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +18 -3
- package/dist/dashboard/stat-card.d.ts +6 -5
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +48 -77
- package/dist/dashboard/stat-card.module.css +27 -7
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +2 -1
- package/dist/dashboard/widget-header.module.css +28 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/theme/chrome-vars.d.ts +29 -17
- package/dist/theme/chrome-vars.d.ts.map +1 -1
- package/dist/theme/chrome-vars.js +18 -8
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +9 -5
- package/dist/theme/status-dot.d.ts +6 -0
- package/dist/theme/status-dot.d.ts.map +1 -0
- package/dist/theme/status-dot.js +9 -0
- package/dist/theme/status-dot.module.css +9 -0
- package/dist/theme/status-dot.module.css.d.ts +8 -0
- package/dist/theme/status-verdict.d.ts +9 -0
- package/dist/theme/status-verdict.d.ts.map +1 -0
- package/dist/theme/status-verdict.js +13 -0
- package/dist/theme/status-verdict.module.css +23 -0
- package/dist/theme/status-verdict.module.css.d.ts +9 -0
- package/dist/tokens/derive.d.ts +11 -1
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/derive.js +9 -24
- package/dist/tokens/status-text.d.ts +26 -0
- package/dist/tokens/status-text.d.ts.map +1 -0
- package/dist/tokens/status-text.js +68 -0
- package/llms.txt +32 -3
- package/package.json +1 -1
- package/src/cli/help.ts +22 -2
- package/src/cli/shot/capture.ts +98 -9
- package/src/cli/shot/index.ts +50 -4
- package/src/cli/shot/real-data.ts +165 -0
- package/src/cli/shot/serve.ts +28 -3
- package/src/commands/notifications/center.tsx +29 -32
- package/src/content/callout.module.css +15 -3
- package/src/content/callout.module.css.d.ts +1 -0
- package/src/content/callout.tsx +15 -2
- package/src/dashboard/bar-list.module.css +91 -0
- package/src/dashboard/bar-list.module.css.d.ts +17 -0
- package/src/dashboard/bar-list.tsx +125 -0
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-model.ts +254 -0
- package/src/dashboard/meter-parts.tsx +407 -0
- package/src/dashboard/meter.module.css +268 -0
- package/src/dashboard/meter.module.css.d.ts +39 -0
- package/src/dashboard/meter.tsx +173 -0
- package/src/dashboard/scale.ts +13 -0
- package/src/dashboard/stat-card-parts.tsx +22 -2
- package/src/dashboard/stat-card.module.css +27 -7
- package/src/dashboard/stat-card.tsx +18 -52
- package/src/dashboard/widget-header.module.css +28 -1
- package/src/dashboard/widget-header.tsx +4 -1
- package/src/index.ts +4 -0
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +88 -16
- package/src/theme/chrome-vars.ts +48 -23
- package/src/theme/index.ts +10 -6
- package/src/theme/status-dot.module.css +9 -0
- package/src/theme/status-dot.module.css.d.ts +8 -0
- package/src/theme/status-dot.tsx +19 -0
- package/src/theme/status-verdict.module.css +23 -0
- package/src/theme/status-verdict.module.css.d.ts +9 -0
- package/src/theme/status-verdict.tsx +27 -0
- package/src/tokens/derive.ts +19 -31
- package/src/tokens/status-text.ts +85 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
+
# [2.19.0](https://github.com/jkrumm/basalt-ui/compare/v2.18.0...v2.19.0) (2026-10-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* address round 1 on the S2 and S4 scenarios ([8ebc318](https://github.com/jkrumm/basalt-ui/commit/8ebc318b93c4ef1971705752c31378b943842667))
|
|
7
|
+
* address round 2 on the S2 and S4 scenarios ([48e992c](https://github.com/jkrumm/basalt-ui/commit/48e992cc8c65304ae87080b477a40974915185d2))
|
|
8
|
+
* anchor the zone reading at its marker and inset skeletons ([0f734ae](https://github.com/jkrumm/basalt-ui/commit/0f734ae56fabc5600d0c9e1e45330b650e983b63))
|
|
9
|
+
* caption Meter segments, wrap captions, size Meter in StatCard ([8125541](https://github.com/jkrumm/basalt-ui/commit/81255416395fbb01062a830a87114b5f1e6c9592))
|
|
10
|
+
* centre the zone reading logically and pin it in RTL ([6176606](https://github.com/jkrumm/basalt-ui/commit/61766066b3bd6f0c8ab58cc4e2720d9007908d8b))
|
|
11
|
+
* close review round 2 on Meter captions and the StatCard slot ([421ac71](https://github.com/jkrumm/basalt-ui/commit/421ac7144518a80b11e0f7f0a846d19be798500d))
|
|
12
|
+
* draw the info focus ring on a glyph-sized pseudo-element ([f11bf1c](https://github.com/jkrumm/basalt-ui/commit/f11bf1cc1a6ed03e28b7987d61be06839510a657))
|
|
13
|
+
* drop the shot hover from sparkline wrappers ([a2e2f5c](https://github.com/jkrumm/basalt-ui/commit/a2e2f5cf914ec6b08fb16afbf010b6562d85fd02))
|
|
14
|
+
* harden Meter caption modes and pin the layout in a browser ([0ab822d](https://github.com/jkrumm/basalt-ui/commit/0ab822ddc38ea62085dd2664edcc0fdcf28ec78c))
|
|
15
|
+
* keep the BarList bar inside the label column ([a227c53](https://github.com/jkrumm/basalt-ui/commit/a227c53be55e7692f1312367f63dfe3d0d1b406a))
|
|
16
|
+
* keep the fixture month labels independent of ICU data ([a226543](https://github.com/jkrumm/basalt-ui/commit/a226543d6f5b5bb1b3d91b582bfee77e6f356180))
|
|
17
|
+
* keep the info glyph focus ring off the caption text ([d66d178](https://github.com/jkrumm/basalt-ui/commit/d66d1782d479520edd1b6cd1267189f5f516368a))
|
|
18
|
+
* keep the loading skeleton inset in the narrow right slot ([cda6c98](https://github.com/jkrumm/basalt-ui/commit/cda6c98da806f61a88259783d81d1a1b1cc65579))
|
|
19
|
+
* key the Meter zone fit on the holding zone and test fonts ([7854b74](https://github.com/jkrumm/basalt-ui/commit/7854b74aa6eed8a9034d3f9fa7f41bd6686f2336))
|
|
20
|
+
* name the info glyph ring knobs and harden its layout test ([c7fb542](https://github.com/jkrumm/basalt-ui/commit/c7fb5428b68fa1805d1ae03eab497b937074d0d1))
|
|
21
|
+
* name the Meter zones on the band ([b321399](https://github.com/jkrumm/basalt-ui/commit/b321399230b86f6f4ae5160fc5bed401606374c1))
|
|
22
|
+
* name the S2 pace unit and hover specimens on /components ([d0a014d](https://github.com/jkrumm/basalt-ui/commit/d0a014d056c782a2ba5349629c116a3b6ab02136))
|
|
23
|
+
* name the status in words and share one StatusDot ([d3a16b8](https://github.com/jkrumm/basalt-ui/commit/d3a16b867037468296d07e435f638ec8c913f8c5))
|
|
24
|
+
* name the window under the S4 month-to-date sparkline ([67b59d0](https://github.com/jkrumm/basalt-ui/commit/67b59d0b981aa36b56155dbaace61bb2513a82d6))
|
|
25
|
+
* put the Meter ring padding on a spacing token ([ed28b4a](https://github.com/jkrumm/basalt-ui/commit/ed28b4a106170fa2179bfe56721b4d6fe9e82c36))
|
|
26
|
+
* re-measure Meter zone names on font load and prove the fit ([2390900](https://github.com/jkrumm/basalt-ui/commit/23909008a1aa6536d18a6314d46c37607225ca85))
|
|
27
|
+
* render the sparkline directly in the StatCard slot ([1c56983](https://github.com/jkrumm/basalt-ui/commit/1c56983f62d2c15e31a175efa0a7ca2c729a6fc4))
|
|
28
|
+
* show the notification intent word and share StatusVerdict ([64bb580](https://github.com/jkrumm/basalt-ui/commit/64bb5809a7ddef74afcf26c6e4f009ed8c6ade2d))
|
|
29
|
+
* treat an empty or null color as unnamed for ink vars ([4930bda](https://github.com/jkrumm/basalt-ui/commit/4930bdaff6f05d94aa359f5b174bbc05ab30390d))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* build the S2 training-log scenario ([94a7f91](https://github.com/jkrumm/basalt-ui/commit/94a7f9122ef47d5272889c6f7acd484ade06c69b))
|
|
35
|
+
* ink the light button on the subtle surface and add edge tests ([6fe99fa](https://github.com/jkrumm/basalt-ui/commit/6fe99fa2194337d4a7bb36993c5d59ea0c8c31f1))
|
|
36
|
+
* name the Callout and notification-center edges in MIGRATING ([2da8c8d](https://github.com/jkrumm/basalt-ui/commit/2da8c8d9ba2836ba3094efe497c02c3cc61c0813))
|
|
37
|
+
* paint light and outline buttons in ink by default ([47d566b](https://github.com/jkrumm/basalt-ui/commit/47d566b9b8b79351a0218a9f14ac53a2196a6090))
|
|
38
|
+
* put the S4 spend scenario on Meter and BarList ([37530a9](https://github.com/jkrumm/basalt-ui/commit/37530a9a54f6ed353c8e2a3faf0fcdbb1de22875))
|
|
39
|
+
* state a StatCard verdict as a dot and a word, not a rail ([1a4085d](https://github.com/jkrumm/basalt-ui/commit/1a4085db453aa05fd3195adf9436c7b3edecb0cc))
|
|
40
|
+
|
|
41
|
+
# [2.18.0](https://github.com/jkrumm/basalt-ui/compare/v2.17.0...v2.18.0) (2026-10-17)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* clamp surface levels and extract the status text solver ([94c2dea](https://github.com/jkrumm/basalt-ui/commit/94c2dea643c4a8d332bdf227d5b4e94f1fb311f4))
|
|
47
|
+
* harden Meter and BarList against negative and non-finite input ([ecbd177](https://github.com/jkrumm/basalt-ui/commit/ecbd177ba0272f7147d89587841e9be27cf2a7f7))
|
|
48
|
+
* scope shot's data checks to one page visit ([918129c](https://github.com/jkrumm/basalt-ui/commit/918129cf0a5f062e897eb8d4cf601e27ab49a003))
|
|
49
|
+
* validate surface levels and tighten the status text walk ([865e4a2](https://github.com/jkrumm/basalt-ui/commit/865e4a2c7c410810124576b4b4b48233395ddb5b))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* add Meter and BarList to the dashboard layer ([499ffd6](https://github.com/jkrumm/basalt-ui/commit/499ffd6a269c0de0e29a1352eeebeccf551b88ef))
|
|
55
|
+
* add Meter zones and state the overage past a target ([d429496](https://github.com/jkrumm/basalt-ui/commit/d429496e0572743bc24ae2e91aeffcae9d1eb149))
|
|
56
|
+
* derive the status text stops per surface ([aceea2a](https://github.com/jkrumm/basalt-ui/commit/aceea2a62cbbdfb1f0fe408334b4f1368675648f))
|
|
57
|
+
* shot captures a real, authenticated app ([027a905](https://github.com/jkrumm/basalt-ui/commit/027a9050a315cc72882ff5ef2571c73e25000fa4))
|
|
58
|
+
|
|
1
59
|
# [2.17.0](https://github.com/jkrumm/basalt-ui/compare/v2.16.0...v2.17.0) (2026-10-17)
|
|
2
60
|
|
|
3
61
|
|
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 | 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) | — | — |
|
|
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 | 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) | — | — | 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`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — |
|
|
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,102 @@ 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.19.0 — the status dot, ink buttons and Meter refinements
|
|
1050
|
+
|
|
1051
|
+
### Status is a dot and a word, not an edge stripe (`StatCard`, `Callout`, notification centre)
|
|
1052
|
+
|
|
1053
|
+
Wave 34. `StatCard`'s `tone` no longer draws a 3 px coloured rail down the card's leading edge. It
|
|
1054
|
+
now puts a 6 px status dot and a short word on the caption row, after the title and `info` glyph:
|
|
1055
|
+
`good` → `OK`, `warn` → `Watch`, `bad` → `Over`. The dot carries the colour (`VX.status[tone]`);
|
|
1056
|
+
the word is muted ink and carries the meaning, so the verdict no longer rides on colour alone. Screen
|
|
1057
|
+
readers still hear the full phrase ("Past the severe threshold") from a visually hidden sibling, not a
|
|
1058
|
+
bare "Over".
|
|
1059
|
+
|
|
1060
|
+
Two other shipped status edges went the same way, each visible without any prop change:
|
|
1061
|
+
|
|
1062
|
+
- **`Callout`** loses its 2 px coloured left border. The tint, icon and title still carry the kind's
|
|
1063
|
+
colour (`info` / `good` / `warn` / `bad`), and a visually hidden kind word ("Info", "Success",
|
|
1064
|
+
"Warning", "Error") means a title-less callout is never tint-only. A consumer's CSS that restyled
|
|
1065
|
+
the border has nothing to target.
|
|
1066
|
+
- **Notification-centre rows** (`NotificationCenter`) lose their 3 px coloured leading border and show
|
|
1067
|
+
a 6 px status dot plus the intent as a visible muted word ("Success", "Error", "Warning", "Info")
|
|
1068
|
+
before the title, or before the message on an untitled row. The `info` dot is neutral ink, not the
|
|
1069
|
+
accent.
|
|
1070
|
+
|
|
1071
|
+
`tone?: 'good' | 'warn' | 'bad'` keeps its API, and omitting it still renders neither dot nor word.
|
|
1072
|
+
There is no opt-out: a coloured edge for status is retired (owner decision). A consumer's own
|
|
1073
|
+
`[data-tone]` CSS that targeted the rail element should target the card (`[data-tone]` stays on the
|
|
1074
|
+
root) or drop the rule.
|
|
1075
|
+
|
|
1076
|
+
The shipped `basalt-design-reviewer` now fails a status drawn as a coloured edge stripe (Craft 4,
|
|
1077
|
+
Expression 3), so boards that passed before this release can fail now: re-score them. The verdict
|
|
1078
|
+
words (`OK`, `Watch`, `Over`, and the phrases screen readers hear) are fixed English; for i18n, omit
|
|
1079
|
+
`tone` and render your own dot and word.
|
|
1080
|
+
|
|
1081
|
+
### Light and outline Buttons are ink
|
|
1082
|
+
|
|
1083
|
+
A `Button` or `ActionIcon` with `variant="light"` or `variant="outline"` and no `color` used to paint
|
|
1084
|
+
the primary (accent) colour. It is now ink: `light` takes the subtle surface (hover one ink step) with
|
|
1085
|
+
an ink label; `outline` takes the surface border with an ink label and the subtle-surface hover.
|
|
1086
|
+
Only `variant="filled"` and any explicit `color=` carry the accent. `default`, `filled`,
|
|
1087
|
+
`transparent` and `white` are unchanged, as are disabled, loading and focus-ring behaviour.
|
|
1088
|
+
|
|
1089
|
+
An empty or `null` `color` now counts as unnamed everywhere, matching Mantine's own
|
|
1090
|
+
`color || primaryColor`: `subtle` Buttons and ActionIcons and the `Tabs` underline with `color=""` or
|
|
1091
|
+
`color={null}` take ink too, where they kept the accent before.
|
|
1092
|
+
|
|
1093
|
+
Opt out: name the primary colour explicitly — `color="<primary>"`, your theme's `primaryColor` name.
|
|
1094
|
+
Omitting `color`, or passing `""` or `null`, does not restore the accent.
|
|
1095
|
+
|
|
1096
|
+
### `Meter` and `BarList` refinements since 2.18.0
|
|
1097
|
+
|
|
1098
|
+
No export, prop or type changes; the rendering moved after the Wave 34 board rounds:
|
|
1099
|
+
|
|
1100
|
+
- **`Meter` categorical `segments`** (no forecast part) caption every part under the track (swatch, name,
|
|
1101
|
+
value) and drop the default start caption that stated the total; pass `startCaption` to keep a total.
|
|
1102
|
+
- **`Meter` zones** name every zone on the band (the holding zone in ink and a weight step, a wrapped list
|
|
1103
|
+
when the names would collide) and anchor the reading at the marker; the start caption is the bare reading,
|
|
1104
|
+
no longer `Zone · reading`.
|
|
1105
|
+
- **`Meter` captions** wrap and never truncate; the ring value is on the hero type role and the ring grows
|
|
1106
|
+
square when the value is wider than its inner circle; ticks and the marker take the `fine` radius.
|
|
1107
|
+
- **`Meter` in a `StatCard` visual (`sparkline`) slot** sizes to its content and keeps the card inset
|
|
1108
|
+
instead of a 22 px bleed. The slot's loading skeleton keeps the card inset on both sides.
|
|
1109
|
+
- **`BarList`**: the bar spans the label column only, so a full-scale bar ends before its value; value and
|
|
1110
|
+
secondary are shared grid columns, and the secondary is `sm`.
|
|
1111
|
+
- A selector that targeted the old markup (`li > span[aria-hidden]` for a BarList bar) needs `[data-bar-track]`.
|
|
1112
|
+
|
|
1113
|
+
## 2.18.0
|
|
1114
|
+
|
|
1115
|
+
### Status text derived per surface
|
|
1116
|
+
|
|
1117
|
+
Wave 34 of the design-parity track (`docs/waves/design-parity/SPEC.md` § 12 D22). No export is
|
|
1118
|
+
added, removed or renamed.
|
|
1119
|
+
|
|
1120
|
+
`--vx-status-good`, `--vx-status-warn` and `--vx-status-bad` (light and dark) are painted as text
|
|
1121
|
+
(`DeltaBadge`, a toned row), but their tones were fixed while the surfaces move with `lightLevel`,
|
|
1122
|
+
`darkLevel` and `neutral`; off the defaults they read 3.2–3.9:1. Each solid is now derived from the
|
|
1123
|
+
surfaces the palette produced: **it shifts in lightness only when needed to restore the 4.5:1
|
|
1124
|
+
floor** on every text surface (`bg`, `panel`, `panelHover`, `elevated`, `subtle`, `field`). Light
|
|
1125
|
+
darkens, dark lightens; hue is preserved and chroma may clip at the gamut edge.
|
|
1126
|
+
|
|
1127
|
+
- **Defaults are unchanged**: at the default config every status hex is byte-identical.
|
|
1128
|
+
- At a non-default `lightLevel`, `darkLevel` or `neutral` the status solids shift in lightness only as far as the floor needs.
|
|
1129
|
+
- `lightLevel` / `darkLevel` outside -5..5 are clamped to the nearest bound (non-finite becomes 0).
|
|
1130
|
+
- No opt-out is needed. A consumer that pins a status hex at a non-default config passes its own
|
|
1131
|
+
colour and owns the contrast.
|
|
1132
|
+
|
|
1133
|
+
### `shot` on a real app
|
|
1134
|
+
|
|
1135
|
+
- `basalt-ui shot` captures a signed-in app with live data. `--local-storage <key>=<@env:NAME|@file:path>` seeds
|
|
1136
|
+
localStorage on the app origin before any page script (an argo-style bearer token); `--api /api=https://app.example.com`
|
|
1137
|
+
makes the `--dist` server proxy GET/HEAD under that prefix (other methods get 405 unless `--api-allow-writes`);
|
|
1138
|
+
`--header authorization=@env:NAME` is added to every proxied request, to every `--api` origin (https required), never
|
|
1139
|
+
to a page navigation; `--wait <ms>` adds a settle after `networkidle` (default none); `--auto-anchors` crops every
|
|
1140
|
+
Card, Paper and table over 120×60 px on a page with no `data-shot`. A redirect, 401/403/404, 5xx or unreachable API fails every shot of that page; a localStorage key the app already holds is not overwritten; `--header` is refused when `--api` names more than one origin; any secret (`--header` or `--local-storage`) requires an https `--api` origin.
|
|
1141
|
+
Secret values are never printed or written to `board.html` or `metrics.json`. Shots of real data reach the reviewer
|
|
1142
|
+
subagent's model provider: point `--api` at staging or synthetic data for an app holding third parties' data. No
|
|
1143
|
+
action needed; every flag is opt-in.
|
|
1144
|
+
|
|
1049
1145
|
## 2.17.0 — the metric card and chrome
|
|
1050
1146
|
|
|
1051
1147
|
Wave 33 of the design-parity track (`docs/waves/design-parity/SPEC.md` § 6.10, § 6.12). No export is
|
|
@@ -35,7 +35,7 @@ Score per component, then add one line per page for the page items (Communicatio
|
|
|
35
35
|
1. **[measured]** Every inset, gap and radius is a step in `metrics.json` `scale`; nested surfaces step by at least 3 px of radius. No `scale` → `unverified`. Never invent steps.
|
|
36
36
|
2. **[measured]** No more than three font sizes inside one component: `fontSizes` with more than 3 distinct values fails.
|
|
37
37
|
3. No empty region of 40 % or more of the component's height — **[measured]**: `emptyRatio` ≥ 0.4 fails; no dense-list row wraps at 390 — judged from the 390 crop.
|
|
38
|
-
4. One ring per surface, no bare hairline borders on cards, no accent on chrome: look at every crop for an accent hue on a tab underline, a selected row, a secondary button, a card ring or a solid-filled badge. The accent sites are the primary data series, active-nav icons and active child labels, links, primary buttons, focus rings and the leader bar in meters; chrome (borders, inactive states, backgrounds, general icons) stays neutral, and selection state (active nav row, selected tab) never takes the accent. A
|
|
38
|
+
4. One ring per surface, no bare hairline borders on cards, no accent on chrome: look at every crop for an accent hue on a tab underline, a selected row, a secondary button, a card ring or a solid-filled badge. The accent sites are the primary data series, active-nav icons and active child labels, links, primary buttons, focus rings and the leader bar in meters; chrome (borders, inactive states, backgrounds, general icons) stays neutral, and selection state (active nav row, selected tab) never takes the accent. A status is a dot plus a word, or the value's own ink; a coloured edge stripe or rail down a card, row or callout for status fails here (Craft 4), and a card's `tone` dot-and-word verdict passes.
|
|
39
39
|
5. **[measured]** Text and meaningful marks meet contrast in both schemes (a non-empty `contrast.failures` fails); nothing is told apart only by colour.
|
|
40
40
|
6. Nothing overflows, clips or truncates a value at 1440 or 390.
|
|
41
41
|
7. Hover, focus and tooltip states are present in the shots; focus is the 2 px outline.
|
|
@@ -44,7 +44,7 @@ Score per component, then add one line per page for the page items (Communicatio
|
|
|
44
44
|
|
|
45
45
|
1. Name the data's shape and the encoding used; both must match a row of the encoding table (the catalogue) in the `/basalt-design` skill.
|
|
46
46
|
2. Every visual answers the question its caption names; a decorative visual fails.
|
|
47
|
-
3. A hue appears only for a trend, a status or a category; a single metric is neutral. A delta is text in its trend colour with a direction glyph and no fill: a fill or a badge on a delta fails here and Craft 4.
|
|
47
|
+
3. A hue appears only for a trend, a status or a category; a single metric is neutral. A delta is text in its trend colour with a direction glyph and no fill: a fill or a badge on a delta fails here and Craft 4. A status drawn as a coloured leading-edge stripe fails here too: it is decoration, where the dot and the word carry the verdict in shape and text.
|
|
48
48
|
4. A number with a target shows the target; a number with a history shows it; a whole with parts shows the parts.
|
|
49
49
|
5. No axis repeats a label; ticks fit the span.
|
|
50
50
|
|
|
@@ -28,7 +28,7 @@ Method only; the law is `.claude/rules/basalt-*.md` and `./DESIGN.md`.
|
|
|
28
28
|
4. Build with Mantine primitives and the composites; every color from `VX.*` or a series token. Tune by eye in the theme lab (`dev.theme` Spotlight command, dev only) in both schemes, then bake values into the `derive` knobs of `createBasaltTheme` and series colors into `src/lib/series.ts`.
|
|
29
29
|
5. **Mark up for the board.** Tag each scored component `data-shot="<name>"`; hover and tooltip targets inside it get `data-shot-hover` / `data-shot-tooltip`; when the target's centre paints no readout (a donut's hole), add `data-shot-at="x,y"` (fractions of its box, e.g. `0.25,0.2`) and the shot hovers there. Declare supported states with `data-shot-states="empty loading error"` and render them when the `shot-state` URL param asks.
|
|
30
30
|
6. **Rounds, at least three.** Playwright is the app's dev dependency: `bun add -d playwright && bunx playwright install chromium`. Then:
|
|
31
|
-
- `basalt-ui shot <routes> --dist <built app>` (or `--base <url>` for a running server);
|
|
31
|
+
- `basalt-ui shot <routes> --dist <built app>` (or `--base <url>` for a running server); a real, signed-in app (live data, no `data-shot` yet): `basalt-ui shot /overview --dist dist --api /api=https://app.example.com --local-storage auth-token=@env:APP_TOKEN --auto-anchors` seeds the token (app origin only; `@env:`/`@file:`, never inline), proxies GET/HEAD under `/api` (writes get 405 unless `--api-allow-writes`) and crops every large Card, Paper and table. One `--header authorization=@env:NAME` goes to EVERY `--api` origin (https required for any secret), never on a navigation. A redirect, 401/403/404, 5xx or dead API fails every shot of that page; a key the app already holds is never overwritten. These shots reach the reviewer subagent's model provider, the session's own: an app holding third parties' data should point `--api` at staging or synthetic data;
|
|
32
32
|
- hand the out dir (`.basalt/shots`) to the `basalt-design-reviewer` subagent by name; it reads each component's contact sheet (`png/*__sheet.png`) and every page shot;
|
|
33
33
|
- revise every failing item at its source, rebuild, and shoot again.
|
|
34
34
|
Boards stay local (gitignored); the scored verdict and notes are worth committing.
|
package/dist/cli/help.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const COMMAND_OPTIONS: Record<string, Record<string, {
|
|
2
2
|
type: 'string' | 'boolean';
|
|
3
|
+
multiple?: boolean;
|
|
3
4
|
}>>;
|
|
4
5
|
/** The first flag `cmd` does not accept, or null. Unknown commands return null — the dispatcher's
|
|
5
6
|
* default branch already names those. */
|
package/dist/cli/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA4CnE,CAAA;AAED;yCACyC;AACzC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAWhF;AAED,0GAA0G;AAC1G,eAAO,MAAM,KAAK,QAmD0E,CAAA"}
|
package/dist/cli/help.js
CHANGED
|
@@ -34,7 +34,13 @@ const COMMAND_OPTIONS = {
|
|
|
34
34
|
base: { type: "string" },
|
|
35
35
|
dist: { type: "string" },
|
|
36
36
|
out: { type: "string" },
|
|
37
|
-
states: { type: "string" }
|
|
37
|
+
states: { type: "string" },
|
|
38
|
+
"local-storage": { type: "string", multiple: true },
|
|
39
|
+
api: { type: "string", multiple: true },
|
|
40
|
+
header: { type: "string", multiple: true },
|
|
41
|
+
wait: { type: "string" },
|
|
42
|
+
"auto-anchors": { type: "boolean" },
|
|
43
|
+
"api-allow-writes": { type: "boolean" }
|
|
38
44
|
}
|
|
39
45
|
};
|
|
40
46
|
function unknownFlag(cmd, flags) {
|
|
@@ -49,7 +55,7 @@ function unknownFlag(cmd, flags) {
|
|
|
49
55
|
return match?.[1] ?? flags.find((f) => f.startsWith("-")) ?? flags[0] ?? null;
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
|
-
const USAGE = "Usage: basalt-ui <--version | init [--no-merge-lint] |\n sync [--force] [--check] [--verbose] [--tokens-only|--framework] |\n check-theme [--audit-allows] |\n doctor [--tokens-only|--framework] | guard-hook | tokens:css | fonts:css |\n shot <route\u2026> | help>\n\ncheck-theme [--tokens-only|--framework] [--audit-allows]\n --audit-allows reports instead of scanning: every `theme-allow` annotation and every\n `basalt.exemptRules` entry, with what each one still suppresses \u2014 proved by re-running the\n guard with that one waiver neutralized, not by reading its text. Exits 1 on a waiver that\n suppresses nothing (dead), which is what makes it usable as a CI gate.\n\ntokens:css [--out <path>] [--check] [--selector-attribute <attr> | --selector-class <class>]\n [--light-class <class>] [--dark-value <v>] [--light-value <v>]\n [--default-scheme <dark|light|none>] [--media-fallback] [--only <core|all>]\n Emit the --vx-* stylesheet (stdout unless --out). Defaults emit the stock identity; commit the output as your tokens file.\n --selector-class emits `:root.dark` instead of an attribute selector (the Tailwind convention).\n --check writes nothing and exits 1 when --out differs from what would be emitted (a CI gate).\n\nfonts:css [--out <path>] [--check]\n Emit the shipped --basalt-font-* stacks as plain CSS \u2014 the typeface half of the token layer,\n otherwise reachable only by importing styles.css.\n\nshot <route\u2026> (--base <url> | --dist <dir>) [--out <dir>] [--states <list>]\n Render routes in Chromium (Playwright from YOUR project: bun add -d playwright) and write\n board.html, metrics.json and png/* \u2014 every data-shot anchor \xD7 light/dark \xD7 desktop/mobile \xD7\n rest, hover, focus, tooltip, empty, loading, error. --dist serves a built SPA dir itself.\n Default --out .basalt/shots (emptied each run); .basalt/shots/last.json names the last out dir.\n\ndoctor [--tokens-only|--framework]\n Checks THIS project only: the manifest exists, the oxlint preset is wired, the pre-commit\n hook runs check-theme (via `lefthook dump`), and the ai package major is consistent within\n this package.json. Profile is DECLARED, same as check-theme \u2014 never inferred.\n\nsync [--force] [--check] [--verbose] [--tokens-only|--framework]\n Refreshes an EXISTING install; it never creates one (that is init). A tokens-only consumer\n has no scaffold to reconcile, so sync reports n/a and exits 0 there \u2014 as doctor does.\n --check prints the permanent placement skips as a COUNT; --verbose spells them out again.\n\ncheck-theme / doctor / sync all resolve their project the same way: BASALT_CWD, else the\ninvocation cwd \u2014 nothing inferred, nothing ascended or descended into.\n--tokens-only and --framework are alternatives; passing both is an error.\n\nEvery subcommand accepts --help / -h to print this message and exit without running.\n--version / -v prints the resolved package version and exits 0 \u2014 the one command that proves\nWHICH basalt-ui ran, which a `bunx` cache can otherwise make a lie. An unknown command or an\nunrecognized flag exits 1 and names what it did not understand; neither is ever ignored.";
|
|
58
|
+
const USAGE = "Usage: basalt-ui <--version | init [--no-merge-lint] |\n sync [--force] [--check] [--verbose] [--tokens-only|--framework] |\n check-theme [--audit-allows] |\n doctor [--tokens-only|--framework] | guard-hook | tokens:css | fonts:css |\n shot <route\u2026> | help>\n\ncheck-theme [--tokens-only|--framework] [--audit-allows]\n --audit-allows reports instead of scanning: every `theme-allow` annotation and every\n `basalt.exemptRules` entry, with what each one still suppresses \u2014 proved by re-running the\n guard with that one waiver neutralized, not by reading its text. Exits 1 on a waiver that\n suppresses nothing (dead), which is what makes it usable as a CI gate.\n\ntokens:css [--out <path>] [--check] [--selector-attribute <attr> | --selector-class <class>]\n [--light-class <class>] [--dark-value <v>] [--light-value <v>]\n [--default-scheme <dark|light|none>] [--media-fallback] [--only <core|all>]\n Emit the --vx-* stylesheet (stdout unless --out). Defaults emit the stock identity; commit the output as your tokens file.\n --selector-class emits `:root.dark` instead of an attribute selector (the Tailwind convention).\n --check writes nothing and exits 1 when --out differs from what would be emitted (a CI gate).\n\nfonts:css [--out <path>] [--check]\n Emit the shipped --basalt-font-* stacks as plain CSS \u2014 the typeface half of the token layer,\n otherwise reachable only by importing styles.css.\n\nshot <route\u2026> (--base <url> | --dist <dir>) [--out <dir>] [--states <list>]\n Render routes in Chromium (Playwright from YOUR project: bun add -d playwright) and write\n board.html, metrics.json and png/* \u2014 every data-shot anchor \xD7 light/dark \xD7 desktop/mobile \xD7\n rest, hover, focus, tooltip, empty, loading, error. --dist serves a built SPA dir itself.\n Default --out .basalt/shots (emptied each run); .basalt/shots/last.json names the last out dir.\n A real, signed-in app: [--local-storage <key>=<@env:NAME|@file:path>]\u2026 seeds localStorage (app origin\n only) before any page script; [--api <prefix>=<origin>]\u2026 (with --dist) proxies GET/HEAD under that\n prefix to the origin (other methods get 405 unless --api-allow-writes); [--header <name>=@env:NAME]\u2026 is\n added to every proxied request, to EVERY --api origin (never on a navigation; https required);\n [--wait <ms|networkidle>] adds ms of settle AFTER networkidle (default none); [--auto-anchors] crops\n each Card, Paper and table over 120\xD760 px on a page with no data-shot. Values are never printed or\n written; a redirect, 401/403/404, 5xx or dead API fails every shot of that page. Shots of real data go to the\n reviewer subagent and so to its model provider: point --api at staging or synthetic data when the\n app holds other people's data. Example:\n basalt-ui shot /overview --dist dist --api /api=https://app.example.com \\\n --local-storage auth-token=@env:APP_TOKEN --header authorization=@env:APP_BEARER --auto-anchors\n\ndoctor [--tokens-only|--framework]\n Checks THIS project only: the manifest exists, the oxlint preset is wired, the pre-commit\n hook runs check-theme (via `lefthook dump`), and the ai package major is consistent within\n this package.json. Profile is DECLARED, same as check-theme \u2014 never inferred.\n\nsync [--force] [--check] [--verbose] [--tokens-only|--framework]\n Refreshes an EXISTING install; it never creates one (that is init). A tokens-only consumer\n has no scaffold to reconcile, so sync reports n/a and exits 0 there \u2014 as doctor does.\n --check prints the permanent placement skips as a COUNT; --verbose spells them out again.\n\ncheck-theme / doctor / sync all resolve their project the same way: BASALT_CWD, else the\ninvocation cwd \u2014 nothing inferred, nothing ascended or descended into.\n--tokens-only and --framework are alternatives; passing both is an error.\n\nEvery subcommand accepts --help / -h to print this message and exit without running.\n--version / -v prints the resolved package version and exits 0 \u2014 the one command that proves\nWHICH basalt-ui ran, which a `bunx` cache can otherwise make a lie. An unknown command or an\nunrecognized flag exits 1 and names what it did not understand; neither is ever ignored.";
|
|
53
59
|
export {
|
|
54
60
|
COMMAND_OPTIONS,
|
|
55
61
|
USAGE,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Pair } from './real-data.js';
|
|
1
2
|
import type { Box, PwBrowser, PwContext, PwLocator } from './playwright.js';
|
|
2
3
|
import type { AnchorMetrics, Measurement, Scale, Scheme, ShotRecord, ShotState, Viewport } from './types.js';
|
|
3
4
|
export type CaptureInput = {
|
|
@@ -6,6 +7,14 @@ export type CaptureInput = {
|
|
|
6
7
|
routes: readonly string[];
|
|
7
8
|
states: readonly ShotState[];
|
|
8
9
|
pngDir: string;
|
|
10
|
+
/** Seeded before any page script runs (values may be secrets: never logged or written). */
|
|
11
|
+
localStorage?: readonly Pair[];
|
|
12
|
+
/** Extra settle in ms after `networkidle`; omitted: none. */
|
|
13
|
+
wait?: number;
|
|
14
|
+
/** Drains the proxied calls that failed since the last read (401/403, no answer). */
|
|
15
|
+
apiProblems?: () => string[];
|
|
16
|
+
/** On a page with no `data-shot`, tag each large Card, Paper and table as an anchor. */
|
|
17
|
+
autoAnchors?: boolean;
|
|
9
18
|
/** Replaces the in-page measurer (tests). */
|
|
10
19
|
measure?: (anchor: PwLocator) => Promise<Measurement>;
|
|
11
20
|
log: (line: string) => void;
|
|
@@ -16,6 +25,8 @@ export declare const fileName: (route: string, name: string, scheme: Scheme, vie
|
|
|
16
25
|
export declare function withParam(route: string, state: ShotState): string;
|
|
17
26
|
/** The rect union of `boxes`, grown by `margin` and clamped to the viewport. */
|
|
18
27
|
export declare function unionClip(boxes: readonly Box[], margin: number, viewport: Viewport): Box;
|
|
28
|
+
/** Runs in the page: numbers every Card, Paper and table in DOM order, tagging those over 120×60 px as anchors. */
|
|
29
|
+
export declare function tagAutoAnchors(): void;
|
|
19
30
|
/**
|
|
20
31
|
* Runs in the page: forgets the previous marks, then marks every tooltip that is visible now, so
|
|
21
32
|
* a tooltip another component already holds open is never taken for the one a trigger opens.
|
|
@@ -62,7 +73,7 @@ export declare function readScaleInPage(steps: string[]): ScaleRead;
|
|
|
62
73
|
/** Sorts the page's `--vx-*` readings into the three kinds; a step of 0 px (or an unresolvable one) is not a step. */
|
|
63
74
|
export declare function groupScale({ mantine, vx }: ScaleRead): Steps;
|
|
64
75
|
/** A fresh context for one scheme × viewport: the colour scheme is set on the context AND in storage before load. */
|
|
65
|
-
export declare function openContext<C extends PwContext>(browser: PwBrowser<C>, scheme: Scheme, viewport: Viewport): Promise<C>;
|
|
76
|
+
export declare function openContext<C extends PwContext>(browser: PwBrowser<C>, scheme: Scheme, viewport: Viewport, seeded?: readonly Pair[], origin?: string): Promise<C>;
|
|
66
77
|
/** `<route>-<hash>__<name>-<hash>__sheet.png`: one contact sheet per anchor, beside its crops. */
|
|
67
78
|
export declare const sheetName: (route: string, name: string) => string;
|
|
68
79
|
export declare function capture(input: CaptureInput): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/capture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/capture.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGvC,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAA;AAE7F,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,KAAK,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACT,MAAM,SAAS,CAAA;AAWhB,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,2FAA2F;IAC3F,YAAY,CAAC,EAAE,SAAS,IAAI,EAAE,CAAA;IAC9B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,MAAM,EAAE,CAAA;IAC5B,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IACrD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5B,CAAA;AAwCD,kGAAkG;AAClG,eAAO,MAAM,QAAQ,GACnB,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,UAAU,QAAQ,EAClB,OAAO,SAAS,KACf,MAC2G,CAAA;AAE9G,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAIjE;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAOxF;AA+BD,mHAAmH;AACnH,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAwHD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAQ1C;AAED,+GAA+G;AAC/G,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAGxD;AAED,4FAA4F;AAC5F,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM,KAAG,MAGR,CAAA;AAE9C,kHAAkH;AAClH,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,KAAG,MACV,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAEpD;AAID;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKzE;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAKnE;AA6DD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAcrD;AAiFD,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAA;AAC5D,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAA;AAE/D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAyD1D;AAED,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,GAAG,KAAK,CAY5D;AAgED,qHAAqH;AACrH,wBAAsB,WAAW,CAAC,CAAC,SAAS,SAAS,EACnD,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,GAAE,SAAS,IAAI,EAAO,EAC5B,MAAM,SAAK,GACV,OAAO,CAAC,CAAC,CAAC,CAaZ;AAID,kGAAkG;AAClG,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAC2B,CAAA;AAsDnF,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;IAC1D,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,KAAK,EAAE,KAAK,EAAE,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC,CAmDD"}
|
package/dist/cli/shot/capture.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { basename, join } from "node:path";
|
|
4
4
|
import { buildSheet } from "./board.js";
|
|
5
|
+
import { SEED_FLAG, seedScript } from "./real-data.js";
|
|
5
6
|
import { finishMeasurement, measureAnchor } from "./measure.js";
|
|
6
7
|
import { PAGE_ANCHOR, SCHEMES, URL_STATES, VIEWPORTS, VIEWPORT_SPECS } from "./types.js";
|
|
7
8
|
const NAV_TIMEOUT_MS = 3e4;
|
|
@@ -49,14 +50,58 @@ function record(c, { name, state, status, file, note }) {
|
|
|
49
50
|
if (status === "error")
|
|
50
51
|
c.input.log(`[shot] ${route} ${name} ${scheme}/${viewport}/${state}: ${note}`);
|
|
51
52
|
}
|
|
52
|
-
async function load(page, url) {
|
|
53
|
+
async function load(page, url, settle = 0) {
|
|
53
54
|
await page.goto(url, { waitUntil: "networkidle" });
|
|
54
55
|
await page.evaluate("document.fonts.ready.then(() => undefined)");
|
|
56
|
+
if (settle > 0) await new Promise((done) => setTimeout(done, settle));
|
|
57
|
+
}
|
|
58
|
+
function tagAutoAnchors() {
|
|
59
|
+
const found = document.querySelectorAll(".mantine-Card-root, .mantine-Paper-root, table");
|
|
60
|
+
Array.from(found).forEach((el, i) => {
|
|
61
|
+
const { width, height } = el.getBoundingClientRect();
|
|
62
|
+
if (width > 120 && height > 60)
|
|
63
|
+
el.setAttribute("data-shot", `auto-${String(i + 1).padStart(2, "0")}`);
|
|
64
|
+
});
|
|
55
65
|
}
|
|
56
66
|
const readFacts = (page) => page.evaluate(`(() => ({
|
|
57
67
|
anchors: [...new Set([...document.querySelectorAll('[data-shot]')].map((e) => e.getAttribute('data-shot')).filter(Boolean))],
|
|
58
68
|
declared: [...document.querySelectorAll('[data-shot-states]')].flatMap((e) => (e.getAttribute('data-shot-states') ?? '').split(/\\s+/)).filter(Boolean),
|
|
59
69
|
}))()`);
|
|
70
|
+
const addProblem = (c, problem) => {
|
|
71
|
+
if (!c.problems.includes(problem)) c.problems.push(problem);
|
|
72
|
+
};
|
|
73
|
+
const collect = (c) => {
|
|
74
|
+
for (const problem of c.input.apiProblems?.() ?? []) addProblem(c, problem);
|
|
75
|
+
};
|
|
76
|
+
async function visit(c, url) {
|
|
77
|
+
const { input, page } = c;
|
|
78
|
+
await load(page, url, input.wait);
|
|
79
|
+
let facts = await readFacts(page);
|
|
80
|
+
if (input.autoAnchors && facts.anchors.length === 0) {
|
|
81
|
+
await page.evaluate(tagAutoAnchors, void 0);
|
|
82
|
+
facts = await readFacts(page);
|
|
83
|
+
}
|
|
84
|
+
collect(c);
|
|
85
|
+
if (input.localStorage?.length) {
|
|
86
|
+
const failed = await page.evaluate(`globalThis.${SEED_FLAG} ?? ''`);
|
|
87
|
+
if (failed === "origin") {
|
|
88
|
+
input.log(`[shot] ${c.route}: page left the app origin; not seeded`);
|
|
89
|
+
} else if (typeof failed === "string" && failed !== "") {
|
|
90
|
+
addProblem(c, `localStorage seed failed (${failed})`);
|
|
91
|
+
input.log(`[shot] ${c.route}: localStorage seed failed (${failed})`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return facts;
|
|
95
|
+
}
|
|
96
|
+
function flagProblems(c) {
|
|
97
|
+
if (c.problems.length === 0) return;
|
|
98
|
+
const note = c.problems.join("; ");
|
|
99
|
+
for (const shot of c.shots)
|
|
100
|
+
if (shot.status === "ok") Object.assign(shot, { status: "error", note });
|
|
101
|
+
if (!c.shots.some((s) => s.name === PAGE_ANCHOR && s.state === "rest"))
|
|
102
|
+
record(c, { name: PAGE_ANCHOR, state: "rest", status: "error", note });
|
|
103
|
+
c.input.log(`[shot] ${c.route} ${c.scheme}/${c.viewport}: ${note}`);
|
|
104
|
+
}
|
|
60
105
|
async function reveal(anchor) {
|
|
61
106
|
if (await anchor.count() === 0) throw new Error("anchor not found");
|
|
62
107
|
await anchor.scrollIntoViewIfNeeded();
|
|
@@ -242,8 +287,7 @@ async function captureUrlState(c, state) {
|
|
|
242
287
|
}
|
|
243
288
|
let here;
|
|
244
289
|
try {
|
|
245
|
-
await
|
|
246
|
-
here = await readFacts(c.page);
|
|
290
|
+
here = await visit(c, c.input.base + withParam(c.route, state));
|
|
247
291
|
} catch (error) {
|
|
248
292
|
for (const name of restNames)
|
|
249
293
|
record(c, { name, state, status: "error", note: `load failed: ${firstLine(error)}` });
|
|
@@ -332,12 +376,13 @@ async function capturePage(args) {
|
|
|
332
376
|
facts: { anchors: [], declared: [] },
|
|
333
377
|
anchors: [],
|
|
334
378
|
shots: [],
|
|
335
|
-
measured: /* @__PURE__ */ new Set()
|
|
379
|
+
measured: /* @__PURE__ */ new Set(),
|
|
380
|
+
problems: []
|
|
336
381
|
};
|
|
337
382
|
const { input, route } = c;
|
|
383
|
+
input.apiProblems?.();
|
|
338
384
|
try {
|
|
339
|
-
await
|
|
340
|
-
c.facts = await readFacts(c.page);
|
|
385
|
+
c.facts = await visit(c, input.base + route);
|
|
341
386
|
} catch (error) {
|
|
342
387
|
record(c, {
|
|
343
388
|
name: PAGE_ANCHOR,
|
|
@@ -370,15 +415,23 @@ async function capturePage(args) {
|
|
|
370
415
|
(path) => snap(c.page, path, { fullPage: true }).then(() => void 0)
|
|
371
416
|
);
|
|
372
417
|
}
|
|
418
|
+
flagProblems(c);
|
|
373
419
|
for (const name of usable) {
|
|
374
420
|
for (const [state, capture2] of Object.entries(POINTER_STATES)) {
|
|
375
|
-
if (input.states.includes(state))
|
|
421
|
+
if (!input.states.includes(state)) continue;
|
|
422
|
+
await capture2(c, name);
|
|
423
|
+
collect(c);
|
|
376
424
|
}
|
|
377
425
|
}
|
|
378
|
-
for (const state of URL_STATES)
|
|
426
|
+
for (const state of URL_STATES) {
|
|
427
|
+
if (!input.states.includes(state)) continue;
|
|
428
|
+
await captureUrlState(c, state);
|
|
429
|
+
collect(c);
|
|
430
|
+
}
|
|
431
|
+
flagProblems(c);
|
|
379
432
|
return c;
|
|
380
433
|
}
|
|
381
|
-
async function openContext(browser, scheme, viewport) {
|
|
434
|
+
async function openContext(browser, scheme, viewport, seeded = [], origin = "") {
|
|
382
435
|
const spec = VIEWPORT_SPECS[viewport];
|
|
383
436
|
const context = await browser.newContext({
|
|
384
437
|
viewport: { width: spec.width, height: spec.height },
|
|
@@ -389,6 +442,7 @@ async function openContext(browser, scheme, viewport) {
|
|
|
389
442
|
reducedMotion: "reduce"
|
|
390
443
|
});
|
|
391
444
|
await context.addInitScript(`localStorage.setItem('mantine-color-scheme-value', '${scheme}')`);
|
|
445
|
+
if (seeded.length > 0) await context.addInitScript(seedScript(seeded, origin));
|
|
392
446
|
return context;
|
|
393
447
|
}
|
|
394
448
|
const SHEET_WIDTH_PX = 2e3;
|
|
@@ -439,7 +493,14 @@ async function capture(input) {
|
|
|
439
493
|
};
|
|
440
494
|
for (const scheme of SCHEMES) {
|
|
441
495
|
for (const viewport of VIEWPORTS) {
|
|
442
|
-
|
|
496
|
+
input.apiProblems?.();
|
|
497
|
+
const context = await openContext(
|
|
498
|
+
input.browser,
|
|
499
|
+
scheme,
|
|
500
|
+
viewport,
|
|
501
|
+
input.localStorage,
|
|
502
|
+
new URL(input.base).origin
|
|
503
|
+
);
|
|
443
504
|
try {
|
|
444
505
|
const page = await context.newPage();
|
|
445
506
|
page.setDefaultTimeout(NAV_TIMEOUT_MS);
|
|
@@ -487,6 +548,7 @@ export {
|
|
|
487
548
|
parseHoverAt,
|
|
488
549
|
readScaleInPage,
|
|
489
550
|
sheetName,
|
|
551
|
+
tagAutoAnchors,
|
|
490
552
|
tooltipSelector,
|
|
491
553
|
unionClip,
|
|
492
554
|
visibleTooltip,
|
package/dist/cli/shot/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { capture } from './capture.js';
|
|
2
2
|
import type { PlaywrightResolver } from './playwright.js';
|
|
3
|
+
import type { ApiRoute, Pair, Source } from './real-data.js';
|
|
3
4
|
import type { ShotState } from './types.js';
|
|
4
5
|
export type ShotDeps = {
|
|
5
6
|
resolve?: PlaywrightResolver;
|
|
@@ -14,9 +15,17 @@ export type ShotArgs = {
|
|
|
14
15
|
dist?: string;
|
|
15
16
|
out: string;
|
|
16
17
|
states: ShotState[];
|
|
18
|
+
/** Resolved secrets: held for the browser only, never written anywhere. */
|
|
19
|
+
localStorage: Pair[];
|
|
20
|
+
api: ApiRoute[];
|
|
21
|
+
headers: Pair[];
|
|
22
|
+
/** Extra settle in ms after networkidle. */
|
|
23
|
+
wait: number;
|
|
24
|
+
allowWrites: boolean;
|
|
25
|
+
autoAnchors: boolean;
|
|
17
26
|
};
|
|
18
27
|
/** Parses argv; throws `ShotError` with the one-line reason. */
|
|
19
|
-
export declare function parseShotArgs(flags: readonly string[]): ShotArgs;
|
|
28
|
+
export declare function parseShotArgs(flags: readonly string[], src?: Source): ShotArgs;
|
|
20
29
|
/**
|
|
21
30
|
* Validates `out` WITHOUT touching it and returns its absolute path. A shot only ever empties what
|
|
22
31
|
* it wrote: the dir must be absent, empty, or hold a previous run's `metrics.json` (`version: 1`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAElE,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,SAAS,CAAA;AAQrD,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;IAChB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,2EAA2E;IAC3E,YAAY,EAAE,IAAI,EAAE,CAAA;IACpB,GAAG,EAAE,QAAQ,EAAE,CAAA;IACf,OAAO,EAAE,IAAI,EAAE,CAAA;IACf,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,GAAG,GAAE,MAAiD,GACrD,QAAQ,CAgEV;AAmCD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAgCxD;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAcD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,EACT,KAAK,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAkB,GACzC,IAAI,CAoBN;AAKD,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,IAAI,GACR,IAAI,CA0BN;AAkBD,wBAAsB,IAAI,CACxB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,QAAa,GAClB,OAAO,CAAC,MAAM,CAAC,CAmFjB;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|