basalt-ui 2.27.2 → 2.29.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 +466 -307
- package/MIGRATING.md +358 -12
- package/agent/rules/basalt-batteries.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/rules/basalt-tokens.md +2 -2
- package/agent/skills/basalt-app/SKILL.md +3 -3
- package/agent/skills/basalt-charts/SKILL.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +12 -6
- package/agent/skills/basalt-design/references/catalogue.md +42 -36
- package/agent/skills/basalt-design/references/recipes.md +47 -0
- package/agent/skills/basalt-design/references/states.md +1 -1
- package/configs/oxlint-basalt.json +2 -1
- package/configs/oxlint-plugin.js +112 -3
- package/configs/oxlint-plugin.test.ts +99 -4
- package/configs/oxlint.json +1 -0
- package/dist/agent/chat/thread-message.d.ts +1 -160
- package/dist/agent/chat/thread-message.d.ts.map +1 -1
- package/dist/agent/chat/thread-message.js +7 -162
- package/dist/agent/chat/virtualize.d.ts +5 -5
- package/dist/charts/ChartCard.d.ts +14 -7
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +112 -23
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +11 -4
- package/dist/charts/Sparkline.d.ts +14 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +155 -44
- package/dist/charts/chart-box.module.css +59 -2
- package/dist/charts/chart-box.module.css.d.ts +5 -0
- package/dist/charts/chart-card.module.css +28 -17
- package/dist/charts/chart-card.module.css.d.ts +3 -0
- package/dist/charts/compile.d.ts +1 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +38 -27
- package/dist/charts/labels.d.ts +13 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +131 -20
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +1 -1
- package/dist/charts/ref-label.d.ts +37 -8
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +55 -10
- package/dist/charts/sparkline.module.css +50 -0
- package/dist/charts/sparkline.module.css.d.ts +3 -0
- package/dist/charts/state.d.ts +4 -4
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +23 -5
- package/dist/cli/doctor-upgrade.d.ts +11 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +54 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -3
- package/dist/cli/index.d.ts +13 -13
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -2
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +118 -27
- package/dist/cli/router-wiring.d.ts +3 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +2 -0
- package/dist/cli/shot/capture.d.ts +34 -2
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +95 -12
- package/dist/cli/shot/detect.d.ts +4 -1
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +38 -16
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +9 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +11 -2
- package/dist/cli/shot/types.d.ts +4 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +10 -2
- package/dist/common/could-not-load.d.ts +13 -0
- package/dist/common/could-not-load.d.ts.map +1 -0
- package/dist/common/could-not-load.js +14 -0
- package/dist/common/empty-copy.d.ts +16 -0
- package/dist/common/empty-copy.d.ts.map +1 -0
- package/dist/common/empty-copy.js +9 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/props.d.ts +20 -0
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/props.js +13 -1
- package/dist/common/retry-button.module.css +7 -3
- package/dist/common/virtual-rows.d.ts +196 -0
- package/dist/common/virtual-rows.d.ts.map +1 -0
- package/dist/common/virtual-rows.js +290 -0
- package/dist/controls/controls.module.css +33 -1
- package/dist/controls/controls.module.css.d.ts +2 -0
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +8 -2
- package/dist/controls/filter-pill.d.ts +27 -3
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +15 -4
- package/dist/controls/form-layout.d.ts +9 -3
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +74 -12
- package/dist/controls/form-layout.module.css +112 -7
- package/dist/controls/form-layout.module.css.d.ts +1 -0
- package/dist/controls/multi-select-filter.d.ts +2 -2
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +12 -6
- package/dist/controls/range-filter.d.ts +1 -1
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +8 -2
- package/dist/dashboard/bar-list.d.ts +5 -5
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +15 -8
- package/dist/dashboard/bar-list.module.css +21 -5
- package/dist/dashboard/board-nav.d.ts +22 -0
- package/dist/dashboard/board-nav.d.ts.map +1 -0
- package/dist/dashboard/board-nav.js +49 -0
- package/dist/dashboard/board.d.ts +52 -0
- package/dist/dashboard/board.d.ts.map +1 -0
- package/dist/dashboard/board.js +247 -0
- package/dist/dashboard/board.module.css +179 -0
- package/dist/dashboard/board.module.css.d.ts +28 -0
- package/dist/dashboard/empty-state.d.ts +6 -6
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +17 -8
- package/dist/dashboard/event-list-model.d.ts +54 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -0
- package/dist/dashboard/event-list-model.js +76 -0
- package/dist/dashboard/event-list-rows.d.ts +23 -0
- package/dist/dashboard/event-list-rows.d.ts.map +1 -0
- package/dist/dashboard/event-list-rows.js +89 -0
- package/dist/dashboard/event-list-scroll.d.ts +55 -0
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
- package/dist/dashboard/event-list-scroll.js +216 -0
- package/dist/dashboard/event-list-skeleton.d.ts +10 -0
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
- package/dist/dashboard/event-list-skeleton.js +34 -0
- package/dist/dashboard/event-list.d.ts +65 -0
- package/dist/dashboard/event-list.d.ts.map +1 -0
- package/dist/dashboard/event-list.js +208 -0
- package/dist/dashboard/event-list.module.css +336 -0
- package/dist/dashboard/event-list.module.css.d.ts +34 -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 +6 -3
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +9 -4
- package/dist/dashboard/meter-parts.d.ts +3 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +36 -6
- package/dist/dashboard/meter.d.ts +3 -3
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +10 -2
- package/dist/dashboard/meter.module.css +20 -12
- package/dist/dashboard/meter.module.css.d.ts +0 -1
- package/dist/dashboard/page-summary.d.ts +3 -3
- package/dist/dashboard/page-summary.d.ts.map +1 -1
- package/dist/dashboard/page-summary.js +7 -2
- package/dist/dashboard/page-summary.module.css +5 -2
- package/dist/dashboard/query-state.d.ts +9 -8
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +29 -11
- package/dist/dashboard/section.d.ts +11 -3
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +34 -7
- package/dist/dashboard/settings-section.d.ts +8 -5
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +12 -8
- package/dist/dashboard/settings-section.module.css +25 -4
- package/dist/dashboard/settings-section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card-parts.d.ts +5 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +8 -3
- package/dist/dashboard/stat-card.d.ts +3 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +47 -12
- package/dist/dashboard/stat-card.module.css +42 -7
- package/dist/dashboard/stat-card.module.css.d.ts +3 -0
- package/dist/dashboard/stat-group.d.ts +2 -2
- package/dist/dashboard/stat-group.d.ts.map +1 -1
- package/dist/dashboard/stat-group.js +10 -3
- package/dist/dashboard/stat-strip.d.ts +5 -4
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +41 -31
- package/dist/dashboard/stat-strip.module.css +8 -6
- package/dist/dashboard/visual-slot.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +2 -0
- package/dist/dashboard/widget-header.d.ts +6 -6
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +4 -2
- package/dist/dashboard/widget-header.module.css +12 -15
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +24 -1
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/shell/app-main.module.css +18 -0
- package/dist/styles.css +69 -0
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +8 -2
- package/dist/table/cell-kinds.d.ts +47 -0
- package/dist/table/cell-kinds.d.ts.map +1 -0
- package/dist/table/cell-kinds.js +180 -0
- package/dist/table/cell-kinds.module.css +55 -0
- package/dist/table/cell-kinds.module.css.d.ts +15 -0
- package/dist/table/data-table-fold.d.ts +155 -0
- package/dist/table/data-table-fold.d.ts.map +1 -0
- package/dist/table/data-table-fold.js +320 -0
- package/dist/table/data-table-state.d.ts +10 -3
- package/dist/table/data-table-state.d.ts.map +1 -1
- package/dist/table/data-table-state.js +11 -6
- package/dist/table/data-table.d.ts +13 -28
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +362 -255
- package/dist/table/data-table.module.css +282 -3
- package/dist/table/data-table.module.css.d.ts +16 -0
- package/dist/table/table-features.d.ts +34 -4
- package/dist/table/table-features.d.ts.map +1 -1
- package/dist/table/table-features.js +10 -0
- package/dist/theme/card-inset.module.css +35 -0
- package/dist/theme/controls.module.css +55 -2
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +5 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +14 -10
- package/dist/tokens/core.d.ts +1 -0
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +1 -0
- package/dist/tokens/derive.js +1 -1
- package/dist/tokens/palette.d.ts +2 -1
- package/dist/tokens/palette.d.ts.map +1 -1
- package/llms.txt +295 -5
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +10 -403
- package/src/agent/chat/virtualize.ts +5 -5
- package/src/charts/ChartCard.tsx +175 -31
- package/src/charts/Lines.tsx +13 -4
- package/src/charts/Sparkline.tsx +213 -48
- package/src/charts/chart-box.module.css +59 -2
- package/src/charts/chart-box.module.css.d.ts +5 -0
- package/src/charts/chart-card.module.css +28 -17
- package/src/charts/chart-card.module.css.d.ts +3 -0
- package/src/charts/compile.ts +59 -33
- package/src/charts/labels.ts +175 -24
- package/src/charts/legend.tsx +3 -2
- package/src/charts/ref-label.ts +114 -18
- package/src/charts/sparkline.module.css +50 -0
- package/src/charts/sparkline.module.css.d.ts +3 -0
- package/src/charts/state.tsx +40 -10
- package/src/cli/doctor-upgrade.ts +75 -0
- package/src/cli/doctor.ts +36 -0
- package/src/cli/help.ts +16 -6
- package/src/cli/index.ts +73 -67
- package/src/cli/init.ts +157 -36
- package/src/cli/router-wiring.ts +2 -2
- package/src/cli/shot/capture.ts +138 -16
- package/src/cli/shot/detect.ts +46 -22
- package/src/cli/shot/index.ts +8 -2
- package/src/cli/shot/measure.ts +11 -2
- package/src/cli/shot/types.ts +4 -1
- package/src/cli/sync.ts +12 -2
- package/src/common/could-not-load.ts +22 -0
- package/src/common/empty-copy.ts +17 -0
- package/src/common/index.ts +1 -0
- package/src/common/props.ts +30 -0
- package/src/common/retry-button.module.css +7 -3
- package/src/common/virtual-rows.tsx +682 -0
- package/src/controls/controls.module.css +33 -1
- package/src/controls/controls.module.css.d.ts +2 -0
- package/src/controls/enum-filter.tsx +8 -2
- package/src/controls/filter-pill.tsx +80 -27
- package/src/controls/form-layout.module.css +112 -7
- package/src/controls/form-layout.module.css.d.ts +1 -0
- package/src/controls/form-layout.tsx +115 -22
- package/src/controls/multi-select-filter.tsx +22 -11
- package/src/controls/range-filter.tsx +9 -3
- package/src/dashboard/bar-list.module.css +21 -5
- package/src/dashboard/bar-list.tsx +53 -45
- package/src/dashboard/board-nav.ts +67 -0
- package/src/dashboard/board.module.css +179 -0
- package/src/dashboard/board.module.css.d.ts +28 -0
- package/src/dashboard/board.tsx +415 -0
- package/src/dashboard/empty-state.tsx +21 -11
- package/src/dashboard/event-list-model.ts +125 -0
- package/src/dashboard/event-list-rows.tsx +117 -0
- package/src/dashboard/event-list-scroll.ts +291 -0
- package/src/dashboard/event-list-skeleton.tsx +62 -0
- package/src/dashboard/event-list.module.css +336 -0
- package/src/dashboard/event-list.module.css.d.ts +34 -0
- package/src/dashboard/event-list.tsx +336 -0
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-model.ts +16 -7
- package/src/dashboard/meter-parts.tsx +53 -14
- package/src/dashboard/meter.module.css +20 -12
- package/src/dashboard/meter.module.css.d.ts +0 -1
- package/src/dashboard/meter.tsx +36 -18
- package/src/dashboard/page-summary.module.css +5 -2
- package/src/dashboard/page-summary.tsx +13 -6
- package/src/dashboard/query-state.tsx +55 -30
- package/src/dashboard/section.tsx +83 -41
- package/src/dashboard/settings-section.module.css +25 -4
- package/src/dashboard/settings-section.module.css.d.ts +1 -0
- package/src/dashboard/settings-section.tsx +18 -8
- package/src/dashboard/stat-card-parts.tsx +20 -3
- package/src/dashboard/stat-card.module.css +42 -7
- package/src/dashboard/stat-card.module.css.d.ts +3 -0
- package/src/dashboard/stat-card.tsx +55 -13
- package/src/dashboard/stat-group.tsx +22 -14
- package/src/dashboard/stat-strip.module.css +8 -6
- package/src/dashboard/stat-strip.tsx +29 -20
- package/src/dashboard/visual-slot.ts +5 -0
- package/src/dashboard/widget-header.module.css +12 -15
- package/src/dashboard/widget-header.tsx +8 -5
- package/src/format/shared.ts +30 -1
- package/src/guard/index.ts +7 -1
- package/src/index.ts +4 -0
- package/src/shell/app-main.module.css +18 -0
- package/src/styles.css +69 -0
- package/src/surfaces.ts +7 -1
- package/src/table/cell-kinds.module.css +55 -0
- package/src/table/cell-kinds.module.css.d.ts +15 -0
- package/src/table/cell-kinds.tsx +263 -0
- package/src/table/data-table-fold.tsx +567 -0
- package/src/table/data-table-state.ts +24 -13
- package/src/table/data-table.module.css +282 -3
- package/src/table/data-table.module.css.d.ts +16 -0
- package/src/table/data-table.tsx +430 -362
- package/src/table/table-features.ts +44 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
- package/src/theme/card-inset.module.css +35 -0
- package/src/theme/controls.module.css +55 -2
- package/src/theme/ctl-theme.tsx +8 -0
- package/src/theme/index.ts +12 -8
- package/src/tokens/core.ts +1 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/palette.ts +4 -1
|
@@ -6,47 +6,53 @@ Shipped composites: `StatCard`, `ChartCard`, `Section`, `WidgetHeader`, `BasaltD
|
|
|
6
6
|
|
|
7
7
|
Run this first. A "yes, chart" answer sends you to § 2.
|
|
8
8
|
|
|
9
|
-
| The data is
|
|
10
|
-
|
|
|
11
|
-
| One current value
|
|
12
|
-
| A handful of headline numbers
|
|
13
|
-
| One ratio against a limit
|
|
14
|
-
| More than ~7 meaningful classes
|
|
15
|
-
| Fewer than 4 points
|
|
16
|
-
| 3–10 target-vs-actual metrics
|
|
9
|
+
| The data is | Not this | Use |
|
|
10
|
+
| --------------------------------- | ---------------- | ------------------------------------------------------- |
|
|
11
|
+
| One current value | A one-bar chart | `StatCard` (`stat-tile.md`) |
|
|
12
|
+
| A handful of headline numbers | A grouped bar | `StatGroup variant="strip"` or a row of `StatCard` |
|
|
13
|
+
| One ratio against a limit | A two-slice pie | `Meter` with a target tick |
|
|
14
|
+
| More than ~7 meaningful classes | More colours | `BasaltDataTable` |
|
|
15
|
+
| Fewer than 4 points | A line | `StatCard` |
|
|
16
|
+
| 3–10 target-vs-actual metrics | A bar per metric | A grid of `Meter`s with `target` (basalt's bullet form) |
|
|
17
|
+
| A few regions compared | A choropleth | `Bars` in a `ChartCard` |
|
|
18
|
+
| A set of points (sites, stations) | A map of dots | `BasaltDataTable` |
|
|
17
19
|
|
|
18
20
|
## 2. Data shape to expression
|
|
19
21
|
|
|
20
|
-
| Data shape
|
|
21
|
-
|
|
|
22
|
-
| Single value with a trend
|
|
23
|
-
| Progress to a target
|
|
24
|
-
| Committed vs forecast
|
|
25
|
-
| Headline ratio where the shape is the message
|
|
26
|
-
| Reading in named bands (low / ok / high)
|
|
27
|
-
| Part of a whole, 2–6 parts
|
|
28
|
-
| Part of a whole when the parts are the page's subject
|
|
29
|
-
| Ranked list, top N (5–10)
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
| Distribution as a
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
22
|
+
| Data shape | Encoding | basalt export (import path) | Not this |
|
|
23
|
+
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
24
|
+
| Single value with a trend | Figure, text delta, `qualifier`, axis-less sparkline with end dot along the bottom | `StatCard` (`basalt-ui`) + `sparkline` slot with `Sparkline` (`basalt-ui/charts`) | A bare number in a box |
|
|
25
|
+
| Progress to a target | Filled track, target tick, end captions; extra cut-offs as `ticks` | `Meter` (`basalt-ui`) with `target`, `ticks` | A hand-rolled progress bar |
|
|
26
|
+
| Committed vs forecast | Two segments, the forecast lighter, a tick and a caption at the boundary | `Meter` `segments`, `forecastCaption` | Two cards |
|
|
27
|
+
| Headline ratio where the shape is the message | Ring, value centred, one per row | `Meter shape="ring"` | A donut plus a total card |
|
|
28
|
+
| Reading in named bands (low / ok / high) | Zoned bar with the reading as a marker; each zone names its `short` label for a narrow track; `ticks` mark cut-offs or a window mean | `Meter` `zones`, `ticks` | Colour-only thresholds |
|
|
29
|
+
| Part of a whole, 2–6 parts | One segmented bar, parts in order, a series `color` per part (`tone: 'muted'` is one shared fill: an "Other" tail only), captions under the segments | `Meter` `segments`; `Bars` stacked | A row of N `StatCard`s; a donut |
|
|
30
|
+
| Part of a whole when the parts are the page's subject | Donut | `Donut` (`basalt-ui/charts`) | Donut beside a total card |
|
|
31
|
+
| Ranked list, top N (5–10) | Label, bar on a shared scale, right-aligned value | `BarList` (`basalt-ui`), its default thin-track rows | A table with a `%` column |
|
|
32
|
+
| Event sequence (activity, history) | Day groups, actor and sentence, then a line leading with the time; a rail for a record's timeline | `EventList` (`basalt-ui`), `density="feed"` or `"timeline"` | A table with a date column |
|
|
33
|
+
| Value over time | Line; stacked area for parts of a total | `Lines` / `StackedArea` in a `ChartCard` | A bar per day |
|
|
34
|
+
| Spend over a period against a budget | Cumulative line against the budget line; the forecast end labelled with its figure and date, the budget crossing labelled. Strip form: `Meter` with the reading at the fill end and the target figure on the tick via `caption` | `Lines` + `refLines` in a `ChartCard`; `Meter` `target`, `ticks` | A daily bar per day; an unlabelled forecast |
|
|
35
|
+
| Compare categories | Bars | `Bars layout="grouped"` in a `ChartCard` | A pie |
|
|
36
|
+
| Distribution as a slot micro-visual (`StatCard`, strip cell) | Small axis-less histogram | `Bars`, no axes, in the slot | A mean alone |
|
|
37
|
+
| Distribution as a card's subject | One bar per bin, x labelled with the bin range ("€0–50"), y axis optional | `Bars` in a `ChartCard` | A mean alone; an axis-less histogram |
|
|
38
|
+
| Status over time | Band strip; heat grid for daily data | `BandStrip` / `Heatmap` (`basalt-ui/charts`) | A table of dates |
|
|
39
|
+
| Categorical status per cell (up, degraded, down) | Flat status fills; a glyph on warn and bad, never hue alone | `Heatmap` `states` with a `tone` each, no hex; `BandStrip` `glyph` | A hue-only grid |
|
|
40
|
+
| A set of KPIs about one record | One joined surface, cells split by hairlines | `StatGroup variant="strip"` | N unrelated cards |
|
|
41
|
+
| Many rows, several attributes | Table, right-aligned figures | `BasaltDataTable` (`basalt-ui/table`) | Cards per row |
|
|
42
|
+
| Record facts in a table row | Cell kinds: entity (avatar + name, no wrap), status chip, right-aligned figure, relative time, inline meter | `BasaltDataTable` column `meta.kind` | Text in every cell |
|
|
43
|
+
| A geographic field: a raster or grid of values over an area, read as a pattern | A map canvas filling its card flush (the Mantine flush card variant), with a key rail at its edge (beside it or overlaid): the colour ramp, its unit and 3–5 labelled stops; the time scrubber and any legend float over the canvas as panels, whose radius steps down by itself | The map library's canvas in that card; `height: var(--basalt-main-content-h)` for a page-high map | A choropleth of a few regions; a point set; a ramp with no unit or stops |
|
|
44
|
+
| Work items by status (columns with counts) | Columns with a count each, cards inside | `Board` (`basalt-ui`) | A table with a status column; a chart of counts |
|
|
45
|
+
| A record, a pending decision, an entity or a list row | The recipe in `recipes.md` | `StatGroup`, `EventList`, `PageAside`, `PageSummary` (`basalt-ui`) | A card per section; a hand-rolled facts layout |
|
|
46
|
+
| Nothing yet / failed | Why and what to do | `EmptyState`, or the component's own `query` state | "No data" |
|
|
40
47
|
|
|
41
48
|
Sections that sit side by side use one title size; a `Section` beside a `ChartCard` does not step a size down.
|
|
42
49
|
|
|
50
|
+
A `Section` has no surface of its own. A lone `BarList`, `EventList` or `Meter` in a grid beside `ChartCard`s goes in a `ChartCard` (`placeholderHeight="content"`), so the row reads as one surface level; a `Section` holding several figures or cards stays flat.
|
|
51
|
+
|
|
43
52
|
## Not shipped — report the gap, don't hand-roll
|
|
44
53
|
|
|
45
|
-
| Shape
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
| Bounded score inside a row | tick meter |
|
|
51
|
-
| Daily data over months with month labels | calendar grid |
|
|
52
|
-
| Gapless histogram with bin-edge ticks | histogram kind |
|
|
54
|
+
| Shape | Missing |
|
|
55
|
+
| ---------------------------------------- | -------------- |
|
|
56
|
+
| Bounded score inside a row | tick meter |
|
|
57
|
+
| Daily data over months with month labels | calendar grid |
|
|
58
|
+
| Gapless histogram with bin-edge ticks | histogram kind |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Recipes
|
|
2
|
+
|
|
3
|
+
Shapes composed from shipped exports, not components of their own. Compose them; never hand-roll a variant. A recipe is promoted to a component only when two apps converge on it. Routing by data shape lives in `catalogue.md`.
|
|
4
|
+
|
|
5
|
+
## Record page
|
|
6
|
+
|
|
7
|
+
`StatGroup variant="strip"` under the header, `EventList` under the decision card, `PageAside` for the rest.
|
|
8
|
+
|
|
9
|
+
header: avatar tile · title · ≤2 Badges · one mono facts line · actions right
|
|
10
|
+
strip: StatGroup variant="strip"
|
|
11
|
+
main: pending decision card, then EventList (rail density for a timeline)
|
|
12
|
+
aside: PageAside
|
|
13
|
+
|
|
14
|
+
Not this: a card per section, or facts spread over the header, strip and aside.
|
|
15
|
+
|
|
16
|
+
## Decision card
|
|
17
|
+
|
|
18
|
+
The question is the headline (`md`, 500). Facts sit under it on one `xs` muted line, `·`-separated. Evidence goes in an inset panel on `VX.surface.field` with the control radius. The action row holds one filled primary, one subtle secondary and one quiet (menu or ghost), each with a key hint.
|
|
19
|
+
|
|
20
|
+
Not this: a topic title as the headline, or three filled buttons.
|
|
21
|
+
|
|
22
|
+
## Entity card
|
|
23
|
+
|
|
24
|
+
A card whose header is avatar, name and a status badge. Under it a 2×2 `StatGroup variant="strip"` (caption, value, unit per cell), then one status line ("Now …").
|
|
25
|
+
|
|
26
|
+
Not this: a bespoke facts layout per entity kind.
|
|
27
|
+
|
|
28
|
+
## Distribution in a card
|
|
29
|
+
|
|
30
|
+
One `Bars` in a `ChartCard`: one bar per level on a shared scale, the level's series colour as the swatch, the count right-aligned at the bar's end. 2–6 parts of one whole: `Meter` `segments` with captions instead, each part a series `color` (muted parts share one fill and read as one slab).
|
|
31
|
+
|
|
32
|
+
Not this: a hand-built swatch-and-count list, or a donut when the parts are not the page's subject.
|
|
33
|
+
|
|
34
|
+
## Page summary
|
|
35
|
+
|
|
36
|
+
`PageSummary`: a headline, then one sentence carrying at least one live number ("3 decisions pending, oldest 4 d"). No sentence without a number.
|
|
37
|
+
|
|
38
|
+
Not this: a prose welcome line, or a figure the summary leads with restated as a second card.
|
|
39
|
+
|
|
40
|
+
## List row
|
|
41
|
+
|
|
42
|
+
Leading glyph, title, one muted meta line, a trailing affordance (chevron, count or menu). Inset 6 × 8, control radius, hover on the neutral ink step.
|
|
43
|
+
|
|
44
|
+
[glyph] Title ›
|
|
45
|
+
meta · meta
|
|
46
|
+
|
|
47
|
+
Not this: inline SVG icons with custom CSS per panel, or a second meta line.
|
|
@@ -12,7 +12,7 @@ Every empty, loading and error state answers two things: why, and what the reade
|
|
|
12
12
|
|
|
13
13
|
One wording per repeated gap: the same missing source reads the same on every card that depends on it. Write it once and pass it to each (`emptyText`, `ChartCard` `state`), never rephrase per card.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
A titled host names the thing itself (`StatCard`, a strip cell, `ChartCard`, the data table: "Could not load revenue" from the title). A `Section` names a nested error too (its `query`, or a `QueryState.errorTitle`-less one in its body); outside a titled host the title must name it ("Could not load <thing>"): `QueryState.errorTitle` / `QueryState.errorFallback`, `ErrorState.title` / `ErrorState.fallback`, and `ChartCard` `stateNoun` on a chart. "The request failed." is the fallback only, never a cause: the real cause is the server message or the fallback prop. The table's empty default ("No data to display.") is a fallback too; pass `emptyState` with the cause and the next step.
|
|
16
16
|
|
|
17
17
|
## Do / don't, on three shapes
|
|
18
18
|
|
package/configs/oxlint-plugin.js
CHANGED
|
@@ -152,6 +152,7 @@ export const KNOWN_RULE_IDS = new Set([
|
|
|
152
152
|
'raw-breakpoint',
|
|
153
153
|
'no-dev-helper',
|
|
154
154
|
'route-view-transition',
|
|
155
|
+
'status-fill-as-text',
|
|
155
156
|
// These two honour `basalt-agent-allow`, never `theme-allow` — but they are real ids, so an
|
|
156
157
|
// annotation naming one must parse as a (useless) scoped annotation rather than as prose.
|
|
157
158
|
'agent-no-raw-usechat',
|
|
@@ -600,7 +601,8 @@ export const CARD_INSET_PX = 'md'
|
|
|
600
601
|
const CARD_INSET_MESSAGE =
|
|
601
602
|
'Card/Paper is off the card idiom — the theme owns the 12/16 inset and radius, so write no ' +
|
|
602
603
|
'p/padding/py/px/radius. Flush whole card: variant="flush"; full-bleed region in a padded card: ' +
|
|
603
|
-
'<Card.Section>; a deliberate exception: {/* theme-allow card-inset — reason */}.
|
|
604
|
+
'<Card.Section>; a deliberate exception: {/* theme-allow card-inset — reason */}. The older ' +
|
|
605
|
+
'py="xs" px="sm" idiom is off-idiom too — delete it. (basalt/card-inset)'
|
|
604
606
|
const CARD_INSET_REDUNDANT_MESSAGE =
|
|
605
607
|
'Card/Paper inset is redundant — the theme owns it (12/16, density-scaled); delete ' +
|
|
606
608
|
'py="sm" px="md". (basalt/card-inset)'
|
|
@@ -2709,6 +2711,9 @@ export const CTL_THEME_TAGS = new Set([
|
|
|
2709
2711
|
'MultiSelect',
|
|
2710
2712
|
'SegmentedControl',
|
|
2711
2713
|
'NativeSelect',
|
|
2714
|
+
'NumberInput',
|
|
2715
|
+
'PasswordInput',
|
|
2716
|
+
'Textarea',
|
|
2712
2717
|
'Radio',
|
|
2713
2718
|
'RadioGroup',
|
|
2714
2719
|
'Checkbox',
|
|
@@ -2720,8 +2725,8 @@ export const CTL_THEME_TAGS = new Set([
|
|
|
2720
2725
|
/**
|
|
2721
2726
|
* A size/width/breakpoint prop on a control the slot theme tiers. The slot's hoisted
|
|
2722
2727
|
* `MantineThemeProvider` already resolves the tier with no prop. A `SettingsRow`'s `control` is NOT
|
|
2723
|
-
* a tiered slot (see {@link SLOT_ATTRS}):
|
|
2724
|
-
* there is
|
|
2728
|
+
* a tiered slot for this rule (see {@link SLOT_ATTRS}): it mounts its own `CtlSlot` (Wave 46), but a
|
|
2729
|
+
* `size="md"` written there is the documented opt-out back to Mantine's `md`, so it stays legal.
|
|
2725
2730
|
*
|
|
2726
2731
|
* Scoped to `RAW_FILTER_TAGS` ∪ `BOUND_TAGS` (basalt's own controls, by name) ∪ a Mantine-imported
|
|
2727
2732
|
* {@link CTL_THEME_TAGS} member, and skipped under an overlay ({@link hostedInsideSlot}) — see
|
|
@@ -4208,6 +4213,109 @@ const routeViewTransition = {
|
|
|
4208
4213
|
},
|
|
4209
4214
|
}
|
|
4210
4215
|
|
|
4216
|
+
// ── Rule 36 — status-fill-as-text ───────────────────────────────────────────────────────────────
|
|
4217
|
+
|
|
4218
|
+
const STATUS_FILL_AS_TEXT_MESSAGE =
|
|
4219
|
+
'VX.status.excellent is a FILL (about 3:1 on a light card) and fails AA as text. Paint zone words and ' +
|
|
4220
|
+
'numerals with VX.status.good (solved to AA) and keep excellent on a swatch, band or heatmap ' +
|
|
4221
|
+
'cell (bg / fill / backgroundColor). (basalt/status-fill-as-text)'
|
|
4222
|
+
|
|
4223
|
+
const EXCELLENT_CSS_VAR = /var\(\s*--vx-status-excellent\b/
|
|
4224
|
+
|
|
4225
|
+
/** Strips parentheses-equivalent wrappers: TS `as` / `satisfies` / `!` and the JSX expression container. */
|
|
4226
|
+
function unwrapExpression(node) {
|
|
4227
|
+
let current = unwrapExpressionContainer(node)
|
|
4228
|
+
while (
|
|
4229
|
+
current &&
|
|
4230
|
+
(current.type === 'TSAsExpression' ||
|
|
4231
|
+
current.type === 'TSSatisfiesExpression' ||
|
|
4232
|
+
current.type === 'TSNonNullExpression' ||
|
|
4233
|
+
current.type === 'ParenthesizedExpression')
|
|
4234
|
+
) {
|
|
4235
|
+
current = current.expression
|
|
4236
|
+
}
|
|
4237
|
+
return current
|
|
4238
|
+
}
|
|
4239
|
+
|
|
4240
|
+
/** True when `node` is `VX.status.excellent` or the string `var(--vx-status-excellent)`. */
|
|
4241
|
+
function isExcellentToken(node) {
|
|
4242
|
+
if (node?.type === 'MemberExpression' && !node.computed) {
|
|
4243
|
+
const status = node.object
|
|
4244
|
+
return (
|
|
4245
|
+
node.property?.name === 'excellent' &&
|
|
4246
|
+
status?.type === 'MemberExpression' &&
|
|
4247
|
+
!status.computed &&
|
|
4248
|
+
status.property?.name === 'status' &&
|
|
4249
|
+
status.object?.type === 'Identifier' &&
|
|
4250
|
+
status.object.name === 'VX'
|
|
4251
|
+
)
|
|
4252
|
+
}
|
|
4253
|
+
if (isStringLiteral(node)) return EXCELLENT_CSS_VAR.test(node.value)
|
|
4254
|
+
if (node?.type === 'TemplateLiteral') {
|
|
4255
|
+
return node.quasis.some((quasi) => EXCELLENT_CSS_VAR.test(quasi.value.cooked ?? ''))
|
|
4256
|
+
}
|
|
4257
|
+
return false
|
|
4258
|
+
}
|
|
4259
|
+
|
|
4260
|
+
/** True when any value `node` can evaluate to (through ternaries and `??` / `||` / `&&`) is the token. */
|
|
4261
|
+
function mayBeExcellentToken(node) {
|
|
4262
|
+
const value = unwrapExpression(node)
|
|
4263
|
+
if (value?.type === 'ConditionalExpression') {
|
|
4264
|
+
return mayBeExcellentToken(value.consequent) || mayBeExcellentToken(value.alternate)
|
|
4265
|
+
}
|
|
4266
|
+
if (value?.type === 'LogicalExpression') {
|
|
4267
|
+
return mayBeExcellentToken(value.left) || mayBeExcellentToken(value.right)
|
|
4268
|
+
}
|
|
4269
|
+
return isExcellentToken(value)
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
/** True when an object literal is, or sits inside, the value of a `style` / `styles` JSX prop. */
|
|
4273
|
+
function insideStyleProp(objectNode) {
|
|
4274
|
+
for (let up = objectNode.parent; up; up = up.parent) {
|
|
4275
|
+
if (up.type === 'JSXAttribute') {
|
|
4276
|
+
return (
|
|
4277
|
+
up.name?.type === 'JSXIdentifier' && (up.name.name === 'style' || up.name.name === 'styles')
|
|
4278
|
+
)
|
|
4279
|
+
}
|
|
4280
|
+
if (up.type === 'JSXElement' || up.type === 'Program') return false
|
|
4281
|
+
}
|
|
4282
|
+
return false
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
// A static check: it sees the token written at the text position, not a map read later
|
|
4286
|
+
// (`c={ZONE_COLORS[grade]}`). `color=` is deliberately not judged — on a Mantine Badge/Button/
|
|
4287
|
+
// ThemeIcon or a chart mark it is a fill — so a `<Text color=…>` / `<Title color=…>` is a known
|
|
4288
|
+
// false negative. Only `c=` and a `color:` key under a `style`/`styles` prop are text: the key is
|
|
4289
|
+
// the CSS `color` property, so it paints text on whichever part it sits (`styles={{ section: … }}`
|
|
4290
|
+
// included).
|
|
4291
|
+
// Ships: error
|
|
4292
|
+
const statusFillAsText = {
|
|
4293
|
+
meta: {
|
|
4294
|
+
type: 'problem',
|
|
4295
|
+
docs: {
|
|
4296
|
+
description: 'Disallow the fill-only VX.status.excellent in a text-colour position.',
|
|
4297
|
+
},
|
|
4298
|
+
schema: [],
|
|
4299
|
+
},
|
|
4300
|
+
create(context) {
|
|
4301
|
+
if (isTestFile(context)) return {}
|
|
4302
|
+
const report = (node) => {
|
|
4303
|
+
if (hasThemeAllow(context, node, 'status-fill-as-text')) return
|
|
4304
|
+
context.report({ node, message: STATUS_FILL_AS_TEXT_MESSAGE })
|
|
4305
|
+
}
|
|
4306
|
+
return {
|
|
4307
|
+
JSXAttribute(node) {
|
|
4308
|
+
if (node.name?.type !== 'JSXIdentifier' || node.name.name !== 'c') return
|
|
4309
|
+
if (node.value && mayBeExcellentToken(node.value)) report(node)
|
|
4310
|
+
},
|
|
4311
|
+
Property(node) {
|
|
4312
|
+
if (propertyKeyName(node) !== 'color' || !mayBeExcellentToken(node.value)) return
|
|
4313
|
+
if (node.parent?.type === 'ObjectExpression' && insideStyleProp(node.parent)) report(node)
|
|
4314
|
+
},
|
|
4315
|
+
}
|
|
4316
|
+
},
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4211
4319
|
// ── Grace ledger ────────────────────────────────────────────────────────────────────────────────
|
|
4212
4320
|
|
|
4213
4321
|
/**
|
|
@@ -4269,5 +4377,6 @@ export default {
|
|
|
4269
4377
|
'raw-breakpoint': rawBreakpoint,
|
|
4270
4378
|
'no-dev-helper': noDevHelper,
|
|
4271
4379
|
'route-view-transition': routeViewTransition,
|
|
4380
|
+
'status-fill-as-text': statusFillAsText,
|
|
4272
4381
|
},
|
|
4273
4382
|
}
|
|
@@ -71,6 +71,7 @@ beforeEach(() => {
|
|
|
71
71
|
'basalt/raw-breakpoint': 'error',
|
|
72
72
|
'basalt/no-dev-helper': 'error',
|
|
73
73
|
'basalt/route-view-transition': 'error',
|
|
74
|
+
'basalt/status-fill-as-text': 'error',
|
|
74
75
|
},
|
|
75
76
|
}),
|
|
76
77
|
)
|
|
@@ -1875,9 +1876,10 @@ describe('basalt/hand-rolled-filter', () => {
|
|
|
1875
1876
|
expect(rules).not.toContain('hand-rolled-filter')
|
|
1876
1877
|
})
|
|
1877
1878
|
|
|
1878
|
-
// The settled reading of law C1's THIRD home (docs/CONTROLS-SPEC.md §5/§6): a form row
|
|
1879
|
-
//
|
|
1880
|
-
// `
|
|
1879
|
+
// The settled reading of law C1's THIRD home (docs/CONTROLS-SPEC.md §5/§6): a form row is not a
|
|
1880
|
+
// chrome slot, so a raw input bound to a setting is right there (it mounts its own `CtlSlot` since
|
|
1881
|
+
// Wave 46, and a `size` on the control is the opt-out) — `control` / `SettingsRow` are absent from
|
|
1882
|
+
// the slot set for exactly that reason.
|
|
1881
1883
|
it("does NOT flag a raw Select in a SettingsRow's control — the form-row home", () => {
|
|
1882
1884
|
const { code, rules } = run(
|
|
1883
1885
|
`${BASALT_IMPORT}${MANTINE_IMPORT}export const C = () => (\n <SettingsSection title="S">\n <SettingsRow label="Channel" control={<Select data={[]} />} />\n </SettingsSection>\n)\n`,
|
|
@@ -2645,7 +2647,7 @@ describe('basalt/control-size-literal', () => {
|
|
|
2645
2647
|
expect(rules).toContain('control-size-literal')
|
|
2646
2648
|
})
|
|
2647
2649
|
|
|
2648
|
-
it(
|
|
2650
|
+
it('does NOT flag a size prop in a SettingsRow\'s control — it is a form row, and size="md" is the opt-out of its ctl tier', () => {
|
|
2649
2651
|
const { code, rules } = run(
|
|
2650
2652
|
`${MANTINE_IMPORT}export const C = () => (\n <SettingsRow label="L" control={<Button size="compact-sm">Go</Button>} />\n)\n`,
|
|
2651
2653
|
)
|
|
@@ -4281,6 +4283,99 @@ describe('basalt/route-view-transition', () => {
|
|
|
4281
4283
|
})
|
|
4282
4284
|
})
|
|
4283
4285
|
|
|
4286
|
+
// ── status-fill-as-text ──────────────────────────────────────────────────────
|
|
4287
|
+
|
|
4288
|
+
describe('basalt/status-fill-as-text', () => {
|
|
4289
|
+
const VXI = `import { VX } from 'basalt-ui/tokens'\n`
|
|
4290
|
+
it.each([
|
|
4291
|
+
[
|
|
4292
|
+
'c= on a Text',
|
|
4293
|
+
`${VXI}export const C = () => <Text c={VX.status.excellent}>Excellent</Text>\n`,
|
|
4294
|
+
],
|
|
4295
|
+
[
|
|
4296
|
+
'c= with the CSS var',
|
|
4297
|
+
`export const C = () => <Text c="var(--vx-status-excellent)">x</Text>\n`,
|
|
4298
|
+
],
|
|
4299
|
+
[
|
|
4300
|
+
'c= through a ternary',
|
|
4301
|
+
`${VXI}export const C = (p: { ok: boolean }) => <Text c={p.ok ? VX.status.excellent : VX.status.warn}>x</Text>\n`,
|
|
4302
|
+
],
|
|
4303
|
+
[
|
|
4304
|
+
'a style color key',
|
|
4305
|
+
`${VXI}export const C = () => <span style={{ color: VX.status.excellent }}>x</span>\n`,
|
|
4306
|
+
],
|
|
4307
|
+
[
|
|
4308
|
+
'a styles-prop color key',
|
|
4309
|
+
`${VXI}export const C = () => <Badge styles={{ label: { color: VX.status.excellent } }}>x</Badge>\n`,
|
|
4310
|
+
],
|
|
4311
|
+
[
|
|
4312
|
+
'a nested styles key on a non-text part (the CSS color property paints its text)',
|
|
4313
|
+
`${VXI}export const C = () => <Progress styles={{ section: { color: VX.status.excellent } }} />\n`,
|
|
4314
|
+
],
|
|
4315
|
+
[
|
|
4316
|
+
'a style color with the CSS var',
|
|
4317
|
+
`export const C = () => <span style={{ color: 'var(--vx-status-excellent)' }}>x</span>\n`,
|
|
4318
|
+
],
|
|
4319
|
+
])('flags %s', (_name, source) => {
|
|
4320
|
+
const { code, rules } = run(source, 'lib.tsx')
|
|
4321
|
+
expect(code).toBe(1)
|
|
4322
|
+
expect(rules).toContain('status-fill-as-text')
|
|
4323
|
+
})
|
|
4324
|
+
|
|
4325
|
+
it.each([
|
|
4326
|
+
['bg=', `${VXI}export const C = () => <Box bg={VX.status.excellent} />\n`],
|
|
4327
|
+
[
|
|
4328
|
+
'a swatch backgroundColor',
|
|
4329
|
+
`${VXI}export const C = () => <i style={{ backgroundColor: VX.status.excellent }} />\n`,
|
|
4330
|
+
],
|
|
4331
|
+
[
|
|
4332
|
+
'a style borderColor',
|
|
4333
|
+
`${VXI}export const C = () => <i style={{ borderColor: VX.status.excellent }} />\n`,
|
|
4334
|
+
],
|
|
4335
|
+
[
|
|
4336
|
+
'fill= and stroke=',
|
|
4337
|
+
`${VXI}export const C = () => <rect fill={VX.status.excellent} stroke={VX.status.excellent} />\n`,
|
|
4338
|
+
],
|
|
4339
|
+
[
|
|
4340
|
+
'alpha() on a fill',
|
|
4341
|
+
`${VXI}export const C = () => <Box bg={alpha(VX.status.excellent, 0.2)} />\n`,
|
|
4342
|
+
],
|
|
4343
|
+
[
|
|
4344
|
+
'c= with the solved text token',
|
|
4345
|
+
`${VXI}export const C = () => <Text c={VX.status.good}>x</Text>\n`,
|
|
4346
|
+
],
|
|
4347
|
+
[
|
|
4348
|
+
'a chart series color key',
|
|
4349
|
+
`${VXI}export const S = { zone: { color: VX.status.excellent } }\n`,
|
|
4350
|
+
],
|
|
4351
|
+
[
|
|
4352
|
+
'a Badge color prop (fill)',
|
|
4353
|
+
`${VXI}export const C = () => <Badge color={VX.status.excellent}>x</Badge>\n`,
|
|
4354
|
+
],
|
|
4355
|
+
[
|
|
4356
|
+
'a Progress/Badge color prop and its styles background (fills)',
|
|
4357
|
+
`${VXI}export const C = () => <Progress color={VX.status.excellent} styles={{ section: { backgroundColor: VX.status.excellent } }} />\n`,
|
|
4358
|
+
],
|
|
4359
|
+
// Out of static reach: argo's ZONE_COLORS map, read later — `c={ZONE_COLORS[grade]}`.
|
|
4360
|
+
[
|
|
4361
|
+
'a map value consumed through a lookup (statically out of reach)',
|
|
4362
|
+
`${VXI}const ZONE_COLORS = { excellent: VX.status.excellent } as const\nexport const C = () => <Text c={ZONE_COLORS.excellent}>x</Text>\n`,
|
|
4363
|
+
],
|
|
4364
|
+
])('does NOT flag %s', (_name, source) => {
|
|
4365
|
+
expect(run(source, 'lib.tsx').rules).not.toContain('status-fill-as-text')
|
|
4366
|
+
})
|
|
4367
|
+
|
|
4368
|
+
it('does not apply in test files', () => {
|
|
4369
|
+
const source = `${VXI}export const C = () => <Text c={VX.status.excellent}>x</Text>\n`
|
|
4370
|
+
expect(run(source, 'lib.test.tsx').rules).not.toContain('status-fill-as-text')
|
|
4371
|
+
})
|
|
4372
|
+
|
|
4373
|
+
it('honours a theme-allow annotation naming the rule', () => {
|
|
4374
|
+
const source = `${VXI}export const C = () => (\n // theme-allow status-fill-as-text: decorative large display numeral\n <Text c={VX.status.excellent}>x</Text>\n)\n`
|
|
4375
|
+
expect(run(source, 'lib.tsx').rules).not.toContain('status-fill-as-text')
|
|
4376
|
+
})
|
|
4377
|
+
})
|
|
4378
|
+
|
|
4284
4379
|
describe('rule level locks', () => {
|
|
4285
4380
|
const levels = (path: string) =>
|
|
4286
4381
|
(JSON.parse(readFileSync(path, 'utf8')) as { rules: Record<string, unknown> }).rules
|