basalt-ui 2.21.0 → 2.23.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.
Files changed (254) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/MIGRATING.md +452 -12
  3. package/agent/agents/basalt-design-reviewer.md +1 -1
  4. package/agent/rules/basalt-tokens.md +1 -1
  5. package/agent/skills/basalt-design/SKILL.md +1 -1
  6. package/agent/skills/basalt-design/references/anti-defaults.md +1 -1
  7. package/agent/skills/basalt-design/references/catalogue.md +1 -0
  8. package/dist/charts/BandStrip.d.ts.map +1 -1
  9. package/dist/charts/BandStrip.js +73 -3
  10. package/dist/charts/Bars.d.ts.map +1 -1
  11. package/dist/charts/Bars.js +6 -0
  12. package/dist/charts/CartesianChart.d.ts +10 -0
  13. package/dist/charts/CartesianChart.d.ts.map +1 -1
  14. package/dist/charts/CartesianChart.js +8 -5
  15. package/dist/charts/ChartCard.d.ts +12 -3
  16. package/dist/charts/ChartCard.d.ts.map +1 -1
  17. package/dist/charts/ChartCard.js +39 -8
  18. package/dist/charts/DualPanel.d.ts.map +1 -1
  19. package/dist/charts/DualPanel.js +5 -8
  20. package/dist/charts/Heatmap.d.ts +12 -1
  21. package/dist/charts/Heatmap.d.ts.map +1 -1
  22. package/dist/charts/Heatmap.js +34 -5
  23. package/dist/charts/Lines.d.ts +3 -0
  24. package/dist/charts/Lines.d.ts.map +1 -1
  25. package/dist/charts/Lines.js +29 -6
  26. package/dist/charts/MirroredBars.d.ts.map +1 -1
  27. package/dist/charts/MirroredBars.js +4 -6
  28. package/dist/charts/Sparkline.d.ts +14 -2
  29. package/dist/charts/Sparkline.d.ts.map +1 -1
  30. package/dist/charts/Sparkline.js +101 -22
  31. package/dist/charts/StackedArea.d.ts +4 -1
  32. package/dist/charts/StackedArea.d.ts.map +1 -1
  33. package/dist/charts/StackedArea.js +9 -3
  34. package/dist/charts/band-fold.d.ts +38 -1
  35. package/dist/charts/band-fold.d.ts.map +1 -1
  36. package/dist/charts/band-fold.js +18 -1
  37. package/dist/charts/chart-box.module.css +19 -0
  38. package/dist/charts/chart-card.module.css +25 -0
  39. package/dist/charts/chart-dates.d.ts +12 -0
  40. package/dist/charts/chart-dates.d.ts.map +1 -0
  41. package/dist/charts/chart-dates.js +16 -0
  42. package/dist/charts/chart-legend.module.css +7 -0
  43. package/dist/charts/compile.d.ts +25 -6
  44. package/dist/charts/compile.d.ts.map +1 -1
  45. package/dist/charts/compile.js +152 -72
  46. package/dist/charts/date-tick-format.d.ts +5 -5
  47. package/dist/charts/date-tick-format.d.ts.map +1 -1
  48. package/dist/charts/date-tick-format.js +3 -7
  49. package/dist/charts/labels.d.ts +21 -6
  50. package/dist/charts/labels.d.ts.map +1 -1
  51. package/dist/charts/labels.js +52 -17
  52. package/dist/charts/legend.d.ts +2 -0
  53. package/dist/charts/legend.d.ts.map +1 -1
  54. package/dist/charts/legend.js +7 -21
  55. package/dist/charts/marks.js +1 -1
  56. package/dist/charts/panel.d.ts +0 -6
  57. package/dist/charts/panel.d.ts.map +1 -1
  58. package/dist/charts/panel.js +1 -10
  59. package/dist/charts/ref-label.d.ts +43 -0
  60. package/dist/charts/ref-label.d.ts.map +1 -0
  61. package/dist/charts/ref-label.js +75 -0
  62. package/dist/charts/scales.d.ts +4 -1
  63. package/dist/charts/scales.d.ts.map +1 -1
  64. package/dist/charts/scales.js +14 -3
  65. package/dist/charts/sparkline.module.css +13 -17
  66. package/dist/charts/sparkline.module.css.d.ts +1 -2
  67. package/dist/charts/state.d.ts +2 -0
  68. package/dist/charts/state.d.ts.map +1 -1
  69. package/dist/charts/state.js +5 -2
  70. package/dist/charts/types.d.ts +18 -8
  71. package/dist/charts/types.d.ts.map +1 -1
  72. package/dist/cli/doctor-upgrade.d.ts +1 -0
  73. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  74. package/dist/cli/doctor-upgrade.js +1 -0
  75. package/dist/cli/init.d.ts +2 -0
  76. package/dist/cli/init.d.ts.map +1 -1
  77. package/dist/cli/init.js +68 -4
  78. package/dist/cli/shot/capture.d.ts +21 -2
  79. package/dist/cli/shot/capture.d.ts.map +1 -1
  80. package/dist/cli/shot/capture.js +202 -36
  81. package/dist/cli/shot/detect.d.ts.map +1 -1
  82. package/dist/cli/shot/detect.js +17 -1
  83. package/dist/cli/shot/playwright.d.ts +13 -2
  84. package/dist/cli/shot/playwright.d.ts.map +1 -1
  85. package/dist/cli/shot/playwright.js +5 -1
  86. package/dist/cli/shot/types.d.ts +4 -0
  87. package/dist/cli/shot/types.d.ts.map +1 -1
  88. package/dist/cli/shot/types.js +2 -0
  89. package/dist/cli/tokens-css.d.ts +5 -7
  90. package/dist/cli/tokens-css.d.ts.map +1 -1
  91. package/dist/cli/tokens-css.js +11 -12
  92. package/dist/controls/controls.module.css +11 -1
  93. package/dist/controls/filter-pill.d.ts.map +1 -1
  94. package/dist/controls/filter-pill.js +1 -0
  95. package/dist/controls/sync-button.d.ts.map +1 -1
  96. package/dist/controls/sync-button.js +22 -3
  97. package/dist/controls/sync-button.module.css +34 -2
  98. package/dist/controls/sync-button.module.css.d.ts +1 -0
  99. package/dist/dashboard/bar-list.d.ts +6 -1
  100. package/dist/dashboard/bar-list.d.ts.map +1 -1
  101. package/dist/dashboard/bar-list.js +15 -8
  102. package/dist/dashboard/bar-list.module.css +83 -0
  103. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  104. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  105. package/dist/dashboard/delta-badge.js +2 -2
  106. package/dist/dashboard/index.d.ts +1 -0
  107. package/dist/dashboard/index.d.ts.map +1 -1
  108. package/dist/dashboard/index.js +2 -0
  109. package/dist/dashboard/meter-model.d.ts +84 -5
  110. package/dist/dashboard/meter-model.d.ts.map +1 -1
  111. package/dist/dashboard/meter-model.js +100 -15
  112. package/dist/dashboard/meter-parts.d.ts +9 -1
  113. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  114. package/dist/dashboard/meter-parts.js +276 -74
  115. package/dist/dashboard/meter.d.ts +54 -65
  116. package/dist/dashboard/meter.d.ts.map +1 -1
  117. package/dist/dashboard/meter.js +21 -4
  118. package/dist/dashboard/meter.module.css +76 -0
  119. package/dist/dashboard/meter.module.css.d.ts +6 -0
  120. package/dist/dashboard/page-summary.d.ts +20 -0
  121. package/dist/dashboard/page-summary.d.ts.map +1 -0
  122. package/dist/dashboard/page-summary.js +28 -0
  123. package/dist/dashboard/page-summary.module.css +89 -0
  124. package/dist/dashboard/page-summary.module.css.d.ts +15 -0
  125. package/dist/dashboard/query-state.d.ts.map +1 -1
  126. package/dist/dashboard/query-state.js +1 -1
  127. package/dist/dashboard/section.d.ts +25 -2
  128. package/dist/dashboard/section.d.ts.map +1 -1
  129. package/dist/dashboard/section.js +10 -5
  130. package/dist/dashboard/section.module.css +23 -0
  131. package/dist/dashboard/section.module.css.d.ts +1 -0
  132. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  133. package/dist/dashboard/stat-card-parts.js +1 -1
  134. package/dist/dashboard/stat-card.d.ts +4 -2
  135. package/dist/dashboard/stat-card.d.ts.map +1 -1
  136. package/dist/dashboard/stat-card.js +7 -5
  137. package/dist/dashboard/stat-card.module.css +36 -0
  138. package/dist/dashboard/stat-group.module.css +7 -0
  139. package/dist/dashboard/stat-strip.d.ts +22 -6
  140. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  141. package/dist/dashboard/stat-strip.js +104 -60
  142. package/dist/dashboard/stat-strip.module.css +122 -53
  143. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  144. package/dist/dashboard/visual-slot.d.ts +7 -1
  145. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  146. package/dist/dashboard/visual-slot.js +3 -1
  147. package/dist/guard/index.d.ts.map +1 -1
  148. package/dist/guard/index.js +0 -5
  149. package/dist/guard/vx-names.d.ts.map +1 -1
  150. package/dist/guard/vx-names.js +2 -0
  151. package/dist/index.d.ts +1 -1
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +3 -1
  154. package/dist/styles.css +43 -4
  155. package/dist/theme/chrome-vars.d.ts +20 -5
  156. package/dist/theme/chrome-vars.d.ts.map +1 -1
  157. package/dist/theme/chrome-vars.js +46 -3
  158. package/dist/theme/controls.module.css +37 -0
  159. package/dist/theme/controls.module.css.d.ts +2 -0
  160. package/dist/theme/index.d.ts.map +1 -1
  161. package/dist/theme/index.js +18 -27
  162. package/dist/theme/status-verdict.d.ts.map +1 -1
  163. package/dist/theme/status-verdict.js +9 -1
  164. package/dist/tokens/core.d.ts +2 -1
  165. package/dist/tokens/core.d.ts.map +1 -1
  166. package/dist/tokens/core.js +6 -1
  167. package/dist/tokens/derive.d.ts +3 -1
  168. package/dist/tokens/derive.d.ts.map +1 -1
  169. package/dist/tokens/derive.js +16 -1
  170. package/dist/tokens/palette.d.ts +11 -10
  171. package/dist/tokens/palette.d.ts.map +1 -1
  172. package/dist/tokens/palette.js +11 -10
  173. package/dist/tokens/status-text.d.ts.map +1 -1
  174. package/dist/tokens/status-text.js +3 -1
  175. package/llms.txt +42 -22
  176. package/package.json +1 -1
  177. package/src/charts/BandStrip.tsx +83 -3
  178. package/src/charts/Bars.tsx +7 -0
  179. package/src/charts/CartesianChart.tsx +18 -3
  180. package/src/charts/ChartCard.tsx +54 -13
  181. package/src/charts/DualPanel.tsx +3 -6
  182. package/src/charts/Heatmap.tsx +54 -5
  183. package/src/charts/Lines.tsx +56 -10
  184. package/src/charts/MirroredBars.tsx +3 -5
  185. package/src/charts/Sparkline.tsx +135 -25
  186. package/src/charts/StackedArea.tsx +14 -4
  187. package/src/charts/band-fold.ts +50 -1
  188. package/src/charts/chart-box.module.css +19 -0
  189. package/src/charts/chart-card.module.css +25 -0
  190. package/src/charts/chart-dates.ts +30 -0
  191. package/src/charts/chart-legend.module.css +7 -0
  192. package/src/charts/compile.ts +253 -87
  193. package/src/charts/date-tick-format.ts +10 -13
  194. package/src/charts/labels.ts +81 -26
  195. package/src/charts/legend.tsx +10 -20
  196. package/src/charts/marks.ts +1 -1
  197. package/src/charts/panel.tsx +1 -16
  198. package/src/charts/ref-label.ts +131 -0
  199. package/src/charts/scales.ts +22 -2
  200. package/src/charts/sparkline.module.css +13 -17
  201. package/src/charts/sparkline.module.css.d.ts +1 -2
  202. package/src/charts/state.tsx +9 -4
  203. package/src/charts/types.ts +18 -8
  204. package/src/cli/doctor-upgrade.ts +1 -1
  205. package/src/cli/init.ts +100 -3
  206. package/src/cli/shot/capture.ts +266 -35
  207. package/src/cli/shot/detect.ts +18 -1
  208. package/src/cli/shot/playwright.ts +20 -4
  209. package/src/cli/shot/types.ts +5 -0
  210. package/src/cli/tokens-css.ts +18 -20
  211. package/src/controls/controls.module.css +11 -1
  212. package/src/controls/filter-pill.tsx +2 -0
  213. package/src/controls/sync-button.module.css +34 -2
  214. package/src/controls/sync-button.module.css.d.ts +1 -0
  215. package/src/controls/sync-button.tsx +40 -4
  216. package/src/dashboard/bar-list.module.css +83 -0
  217. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  218. package/src/dashboard/bar-list.tsx +107 -69
  219. package/src/dashboard/delta-badge.tsx +6 -2
  220. package/src/dashboard/index.ts +1 -0
  221. package/src/dashboard/meter-model.ts +207 -24
  222. package/src/dashboard/meter-parts.tsx +349 -67
  223. package/src/dashboard/meter.module.css +76 -0
  224. package/src/dashboard/meter.module.css.d.ts +6 -0
  225. package/src/dashboard/meter.tsx +72 -18
  226. package/src/dashboard/page-summary.module.css +89 -0
  227. package/src/dashboard/page-summary.module.css.d.ts +15 -0
  228. package/src/dashboard/page-summary.tsx +95 -0
  229. package/src/dashboard/query-state.tsx +1 -1
  230. package/src/dashboard/section.module.css +23 -0
  231. package/src/dashboard/section.module.css.d.ts +1 -0
  232. package/src/dashboard/section.tsx +59 -11
  233. package/src/dashboard/stat-card-parts.tsx +5 -1
  234. package/src/dashboard/stat-card.module.css +36 -0
  235. package/src/dashboard/stat-card.tsx +12 -6
  236. package/src/dashboard/stat-group.module.css +7 -0
  237. package/src/dashboard/stat-strip.module.css +122 -53
  238. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  239. package/src/dashboard/stat-strip.tsx +176 -91
  240. package/src/dashboard/visual-slot.ts +12 -3
  241. package/src/guard/index.ts +0 -5
  242. package/src/guard/vx-names.ts +2 -0
  243. package/src/index.ts +2 -0
  244. package/src/styles.css +43 -4
  245. package/src/theme/__snapshots__/plain-theme.test.ts.snap +200 -68
  246. package/src/theme/chrome-vars.ts +77 -8
  247. package/src/theme/controls.module.css +37 -0
  248. package/src/theme/controls.module.css.d.ts +2 -0
  249. package/src/theme/index.ts +22 -32
  250. package/src/theme/status-verdict.tsx +5 -1
  251. package/src/tokens/core.ts +4 -1
  252. package/src/tokens/derive.ts +32 -3
  253. package/src/tokens/palette.ts +11 -10
  254. package/src/tokens/status-text.ts +2 -0
@@ -10,14 +10,26 @@
10
10
  *
11
11
  * `state` replaces the readings (hero, visual, rows, footer) with the cell's empty or error body, at
12
12
  * the cell's size. Empty: `—` in the value position and the reason, muted. Error: the shared error
13
- * anatomy compact — status dot, the word `Failed`, the message, the shared Retry. The caption stays.
13
+ * anatomy compact — status dot, the words `Could not load`, the message, the shared Retry. The caption stays.
14
14
  * A `visual` is a hero host: a zoned `Meter` in it does not repeat the value at its marker.
15
15
  *
16
- * Alignment: cells of one row align by PART (caption, value, visual, rows, footer share tracks via
17
- * subgrid), not by stretching; a cell without a visual keeps its footer directly under its content.
16
+ * Alignment: a cell is a plain column that ends at its content (the slot around it runs the whole
17
+ * row, so the dividers do too). Cells of one row share a caption top and a value baseline BY
18
+ * CONSTRUCTION: the caption line is one line (it truncates with a `title`), and when any cell has a
19
+ * qualifier a narrow cell reserves the qualifier's own line, so the parts above the value have equal
20
+ * height. Below the value nothing is shared: a visual starts right under it, rows follow, and a
21
+ * footer rides with the last part it captions, so a short cell never holds a taller sibling's void.
22
+ * `action` sits at the end of the caption line (the caption truncates first); a row with `hideValue`
23
+ * prints its label alone.
18
24
  *
19
25
  * Anchors: each cell is `data-shot="strip-<key>"` and each footer cell
20
- * `data-shot="strip-footer-<key>"` (derived — a consumer cannot choose another name).
26
+ * `data-shot="strip-footer-<key>"` (derived — a consumer cannot choose another name). A footer entry
27
+ * with `under: '<cell key>'` qualifies that one cell: from 800px it sits in the cell's column (an
28
+ * entry without `under` then takes the full row); below, every entry is full width under the grid.
29
+ *
30
+ * Absence: a page that hides the strip in a declared shot state sets `shotAbsent` on the group
31
+ * (`['empty']`): every derived anchor, cells and footer cells, then carries `data-shot-absent`. A
32
+ * cell's own `shotAbsent` replaces the group's for that cell (the exception).
21
33
  *
22
34
  * Mapping from a prototype: warden's JSX `qualifier` line UNDER the value is `footer`; the cell
23
35
  * `qualifier` is the short `· text` on the caption line. Cells are equal-weight: unequal column
@@ -34,7 +46,13 @@ import { StatusDot } from '../theme/status-dot'
34
46
  import { VX } from '../tokens'
35
47
  import { InfoGlyph } from './widget-header'
36
48
  import classes from './stat-strip.module.css'
37
- import { VisualSlotContext } from './visual-slot'
49
+ import { HOSTED, VisualSlotContext } from './visual-slot'
50
+
51
+ /** The URL shot states an anchor can declare itself absent in (`data-shot-absent`). */
52
+ type StatStripShotState = 'empty' | 'loading' | 'error'
53
+
54
+ const absentAttr = (states: readonly StatStripShotState[] | undefined) =>
55
+ states === undefined || states.length === 0 ? {} : { 'data-shot-absent': states.join(' ') }
38
56
 
39
57
  export type StatStripRow = {
40
58
  key: string
@@ -44,6 +62,8 @@ export type StatStripRow = {
44
62
  visual?: ReactNode
45
63
  /** A `DeltaBadge`. */
46
64
  delta?: ReactNode
65
+ /** The reading is already shown (the hero): print the label alone. `value` is ignored. */
66
+ hideValue?: boolean
47
67
  }
48
68
 
49
69
  /** What a cell shows instead of its readings. Mirrors `StatCard`'s `query` branches. */
@@ -66,8 +86,12 @@ type StatStripCellState =
66
86
  export type StatStripCell = {
67
87
  key: string
68
88
  caption: string
69
- /** Muted, on the caption line: `CAPTION · qualifier`. */
89
+ /** Muted, on the caption line: `CAPTION · qualifier`. It wraps whole under the caption when it
90
+ * does not fit (by design: no truncation, so no `title`). */
70
91
  qualifier?: string
92
+ /** A control at the end of the caption line (a popover trigger). Never wraps the line: the
93
+ * caption truncates first. */
94
+ action?: ReactNode
71
95
  /** The definition behind the caption, in the info-glyph tooltip. */
72
96
  info?: string
73
97
  /** `null` = no reading, printed as `—`. Omit only when `rows` carries the cell. */
@@ -89,6 +113,16 @@ export type StatStripCell = {
89
113
  stale?: boolean
90
114
  /** Empty or failed: replaces the readings; `loading` wins while pending. */
91
115
  state?: StatStripCellState
116
+ /** The shot states this cell's anchor is absent in; replaces the group's `shotAbsent`. */
117
+ shotAbsent?: readonly StatStripShotState[]
118
+ }
119
+
120
+ export type StatStripFooterEntry = {
121
+ key: string
122
+ content: ReactNode
123
+ /** The `key` of the cell this entry qualifies. From the full desktop width (800px) it sits in that
124
+ * cell's column; below it, and for a key that names no cell, it takes the full width under the grid. */
125
+ under?: string
92
126
  }
93
127
 
94
128
  export type StatStripProps = BasaltProps & {
@@ -96,9 +130,11 @@ export type StatStripProps = BasaltProps & {
96
130
  label: string
97
131
  cells: readonly StatStripCell[]
98
132
  /** Wider cells under the cells. */
99
- footer?: readonly { key: string; content: ReactNode }[]
133
+ footer?: readonly StatStripFooterEntry[]
100
134
  /** The DESKTOP column count. Default: the cell count, capped at 6. */
101
135
  cols?: 2 | 3 | 4 | 5 | 6
136
+ /** The shot states the page hides the whole strip in (`data-shot-absent` on every derived anchor). */
137
+ shotAbsent?: readonly StatStripShotState[]
102
138
  }
103
139
 
104
140
  const EMPTY = '—'
@@ -121,7 +157,7 @@ function CellState({ state }: { state: StatStripCellState }) {
121
157
  <div className={classes.error} role="alert" data-strip-state="error">
122
158
  <span className={classes.errorHead}>
123
159
  <StatusDot color={VX.status.bad} />
124
- Failed
160
+ Could not load
125
161
  </span>
126
162
  <p className={classes.reason}>{message}</p>
127
163
  {state.onRetry !== undefined && (
@@ -131,98 +167,137 @@ function CellState({ state }: { state: StatStripCellState }) {
131
167
  )
132
168
  }
133
169
 
134
- function StripCell({ cell }: { cell: StatStripCell }) {
170
+ function StripCell({
171
+ cell,
172
+ shotAbsent,
173
+ }: {
174
+ cell: StatStripCell
175
+ shotAbsent: readonly StatStripShotState[] | undefined
176
+ }) {
135
177
  const captionId = useId()
136
178
  const { rows, loading } = cell
137
179
  const state = loading ? undefined : cell.state
138
180
  const hasHero = cell.value !== undefined || rows === undefined
139
- // A footer under a visual (and no rows) rides with it, so it hugs that visual instead of dropping
140
- // to a taller sibling's; under rows, or with neither, it takes the row's shared footer track.
141
- const ownFooter = cell.visual !== undefined && rows === undefined
181
+ // The cell's verdict colours a plain Meter in its visual too (a hero host only).
182
+ const hostSlot = !hasHero ? null : cell.tone === undefined ? HOSTED : { tone: cell.tone }
183
+ // A footer rides with what it captions: it follows the cell's last part, whatever a sibling holds.
142
184
  const footerEl = cell.footer !== undefined && (
143
185
  <div className={classes.footer} data-strip-footer>
144
186
  {cell.footer}
145
187
  </div>
146
188
  )
189
+ const heroEl = loading ? (
190
+ <Skeleton className={classes.skeletonValue} radius="sm" />
191
+ ) : (
192
+ <div className={classes.valueRow}>
193
+ <span
194
+ className={classes.value}
195
+ data-strip-value
196
+ style={cell.tone !== undefined ? { color: VX.status[cell.tone] } : undefined}
197
+ >
198
+ {cell.value ?? EMPTY}
199
+ </span>
200
+ {cell.value !== undefined && cell.value !== null && cell.unit !== undefined && (
201
+ <span className={classes.unit}>{cell.unit}</span>
202
+ )}
203
+ {cell.delta}
204
+ </div>
205
+ )
147
206
  return (
148
- <article
149
- className={classes.cell}
150
- data-strip-cell={cell.key}
151
- data-shot={`strip-${cell.key}`}
152
- aria-labelledby={captionId}
153
- {...(state === undefined && cell.visual !== undefined && { 'data-strip-has-visual': '' })}
154
- {...(state === undefined && rows !== undefined && { 'data-strip-has-rows': '' })}
155
- {...(cell.stale && { 'data-stale': 'true' })}
156
- >
157
- <div className={classes.captionLine}>
158
- {/* The caption and its info glyph are one unit: the qualifier wraps whole, never between them. */}
159
- <span className={classes.lead}>
160
- <span className={classes.caption} id={captionId} title={cell.caption} data-strip-caption>
161
- {cell.caption}
162
- </span>
163
- {cell.info !== undefined && <InfoGlyph text={cell.info} />}
164
- </span>
165
- {cell.qualifier !== undefined && (
166
- <span className={classes.qualifier}>{cell.qualifier}</span>
167
- )}
168
- </div>
169
- {state !== undefined && <CellState state={state} />}
170
- {state === undefined &&
171
- hasHero &&
172
- (loading ? (
173
- <Skeleton className={classes.skeletonValue} radius="sm" />
174
- ) : (
175
- <div className={classes.valueRow}>
176
- <span
177
- className={classes.value}
178
- data-strip-value
179
- style={cell.tone !== undefined ? { color: VX.status[cell.tone] } : undefined}
180
- >
181
- {cell.value ?? EMPTY}
207
+ // The slot owns the dividers and runs the row; the article inside ends at its content.
208
+ <div className={classes.cell} data-strip-slot>
209
+ <article
210
+ className={classes.content}
211
+ data-strip-cell={cell.key}
212
+ data-shot={`strip-${cell.key}`}
213
+ aria-labelledby={captionId}
214
+ {...absentAttr(cell.shotAbsent ?? shotAbsent)}
215
+ {...(state !== undefined && { 'data-strip-has-state': '' })}
216
+ {...(state === undefined && cell.visual !== undefined && { 'data-strip-has-visual': '' })}
217
+ {...(state === undefined && rows !== undefined && { 'data-strip-has-rows': '' })}
218
+ {...(cell.stale && { 'data-stale': 'true' })}
219
+ >
220
+ <div className={classes.captionLine}>
221
+ <div className={classes.captionMain}>
222
+ {/* The caption and its info glyph are one unit: the qualifier wraps whole, never between them. */}
223
+ <span className={classes.lead}>
224
+ <span
225
+ className={classes.caption}
226
+ id={captionId}
227
+ title={cell.caption}
228
+ data-strip-caption
229
+ >
230
+ {cell.caption}
231
+ </span>
232
+ {cell.info !== undefined && <InfoGlyph text={cell.info} />}
182
233
  </span>
183
- {cell.value !== undefined && cell.value !== null && cell.unit !== undefined && (
184
- <span className={classes.unit}>{cell.unit}</span>
234
+ {cell.qualifier !== undefined && (
235
+ <span className={classes.qualifier} title={cell.qualifier}>
236
+ {cell.qualifier}
237
+ </span>
185
238
  )}
186
- {cell.delta}
187
- </div>
188
- ))}
189
- {state === undefined && cell.visual !== undefined && (
190
- <div className={classes.visualStack}>
191
- <div className={classes.visual} data-strip-visual>
192
- <VisualSlotContext.Provider value={hasHero}>{cell.visual}</VisualSlotContext.Provider>
193
239
  </div>
194
- {ownFooter && footerEl}
240
+ {cell.action !== undefined && (
241
+ <span className={classes.action} data-strip-action>
242
+ {cell.action}
243
+ </span>
244
+ )}
195
245
  </div>
196
- )}
197
- {state === undefined &&
198
- rows !== undefined &&
199
- (loading ? (
200
- <div className={classes.rows} aria-hidden="true">
201
- {rows.map((row) => (
202
- <Skeleton key={row.key} className={classes.skeletonRow} radius="sm" />
203
- ))}
246
+ {state !== undefined && <CellState state={state} />}
247
+ {state === undefined && hasHero && heroEl}
248
+ {state === undefined && cell.visual !== undefined && (
249
+ <div className={classes.visual} data-strip-visual>
250
+ <VisualSlotContext.Provider value={hostSlot}>{cell.visual}</VisualSlotContext.Provider>
204
251
  </div>
205
- ) : (
206
- <ul className={classes.rows} data-strip-rows>
207
- {rows.map((row) => (
208
- <li key={row.key} className={classes.row} data-strip-row={row.key}>
209
- <span className={classes.rowLabel}>{row.label}</span>
210
- <span className={classes.visual}>{row.visual}</span>
211
- <span className={classes.rowValue}>{row.value ?? EMPTY}</span>
212
- <span>{row.delta}</span>
213
- </li>
214
- ))}
215
- </ul>
216
- ))}
217
- {state === undefined && !ownFooter && footerEl}
218
- </article>
252
+ )}
253
+ {state === undefined &&
254
+ rows !== undefined &&
255
+ (loading ? (
256
+ <div className={classes.rows} aria-hidden="true">
257
+ {rows.map((row) => (
258
+ <Skeleton key={row.key} className={classes.skeletonRow} radius="sm" />
259
+ ))}
260
+ </div>
261
+ ) : (
262
+ <ul className={classes.rows} data-strip-rows>
263
+ {rows.map((row) => (
264
+ <li key={row.key} className={classes.row} data-strip-row={row.key}>
265
+ <span className={classes.rowLabel}>{row.label}</span>
266
+ <span className={classes.visual}>{row.visual}</span>
267
+ <span className={classes.rowValue}>
268
+ {row.hideValue ? null : (row.value ?? EMPTY)}
269
+ </span>
270
+ <span>{row.delta}</span>
271
+ </li>
272
+ ))}
273
+ </ul>
274
+ ))}
275
+ {state === undefined && footerEl}
276
+ </article>
277
+ </div>
219
278
  )
220
279
  }
221
280
 
222
- export function StatStrip({ label, cells, footer, cols, className, style }: StatStripProps) {
281
+ export function StatStrip({
282
+ label,
283
+ cells,
284
+ footer,
285
+ cols,
286
+ shotAbsent,
287
+ className,
288
+ style,
289
+ }: StatStripProps) {
223
290
  const desktop = cols ?? Math.min(Math.max(cells.length, 2), 6)
224
291
  // `StatGroup`'s rule: four is 2 + 2 below the full count, never 3 + 1.
225
292
  const mid = desktop === 4 ? 2 : Math.min(desktop, 3)
293
+ // A cell's column at the full count; `undefined` for a key that names no cell.
294
+ const columnOf = (key: string | undefined) => {
295
+ const at = cells.findIndex((cell) => cell.key === key)
296
+ return at < 0 ? undefined : (at % desktop) + 1
297
+ }
298
+ const hasQualifier = cells.some((cell) => cell.qualifier !== undefined)
299
+ const hasAction = cells.some((cell) => cell.action !== undefined)
300
+ const placed = footer?.some((entry) => columnOf(entry.under) !== undefined) ?? false
226
301
  return (
227
302
  <div className={cx(classes.container, className)} style={style}>
228
303
  <Card>
@@ -230,6 +305,8 @@ export function StatStrip({ label, cells, footer, cols, className, style }: Stat
230
305
  component="section"
231
306
  aria-label={label}
232
307
  className={classes.clip}
308
+ {...(hasQualifier && { 'data-strip-qualifier': '' })}
309
+ {...(hasAction && { 'data-strip-action-row': '' })}
233
310
  style={
234
311
  {
235
312
  '--basalt-strip-cols': desktop,
@@ -239,21 +316,29 @@ export function StatStrip({ label, cells, footer, cols, className, style }: Stat
239
316
  >
240
317
  <div className={classes.cells}>
241
318
  {cells.map((cell) => (
242
- <StripCell key={cell.key} cell={cell} />
319
+ <StripCell key={cell.key} cell={cell} shotAbsent={shotAbsent} />
243
320
  ))}
244
321
  </div>
245
322
  {footer !== undefined && footer.length > 0 && (
246
- <div className={classes.footerRow}>
247
- {footer.map((entry) => (
248
- <div
249
- key={entry.key}
250
- className={classes.footerCell}
251
- data-strip-footer-cell={entry.key}
252
- data-shot={`strip-footer-${entry.key}`}
253
- >
254
- {entry.content}
255
- </div>
256
- ))}
323
+ <div className={classes.footerRow} {...(placed && { 'data-placed': '' })}>
324
+ {footer.map((entry) => {
325
+ const column = columnOf(entry.under)
326
+ return (
327
+ <div
328
+ key={entry.key}
329
+ className={classes.footerCell}
330
+ data-strip-footer-cell={entry.key}
331
+ data-shot={`strip-footer-${entry.key}`}
332
+ {...absentAttr(shotAbsent)}
333
+ {...(column !== undefined && {
334
+ 'data-under': entry.under,
335
+ style: { '--basalt-strip-footer-col': column } as CSSProperties,
336
+ })}
337
+ >
338
+ {entry.content}
339
+ </div>
340
+ )
341
+ })}
257
342
  </div>
258
343
  )}
259
344
  </Card.Section>
@@ -1,8 +1,17 @@
1
1
  /**
2
2
  * Set by a host that already shows the reading as its hero (a `StatCard` sparkline slot, a strip
3
- * cell's `visual`). A `Meter` in zones mode reads it and drops the reading it would draw at the
4
- * marker, so the headline value is not printed twice. Internal: never exported.
3
+ * cell's `visual`). A `Meter` reads it: a zoned track drops the reading it would draw at the marker
4
+ * (the headline is not printed twice; `reading` overrides), and a plain bar or ring with no `tone` or
5
+ * `color` of its own takes the host's `tone` as its verdict colour. Internal: never exported.
5
6
  */
6
7
  import { createContext } from 'react'
8
+ import type { Tone } from '../common/props'
7
9
 
8
- export const VisualSlotContext = createContext(false)
10
+ export interface VisualSlot {
11
+ readonly tone?: Tone
12
+ }
13
+
14
+ /** A host with no verdict of its own: one shared object, so a provider never re-renders its readers. */
15
+ export const HOSTED: VisualSlot = {}
16
+
17
+ export const VisualSlotContext = createContext<VisualSlot | null>(null)
@@ -911,11 +911,6 @@ export const GRACE_PERIOD_KINDS: Partial<Record<GuardKind, GraceEntry>> = {
911
911
  promote: '2.24.0',
912
912
  why: 'The scale moved to 8/12/16/20/24 and the CSS micro ceiling dropped 10 → 7 in 2.16.0: a literal 8px/10px in CSS is newly a finding.',
913
913
  },
914
- 'series-palette': {
915
- since: '2.21.0',
916
- promote: '2.23.0',
917
- why: 'New in 2.21.0: the series file is judged by computed lightness, chroma, colour-blind separation and contrast; a palette that was tuned by eye is newly a finding.',
918
- },
919
914
  }
920
915
 
921
916
  /** A kind's effective severity: consumer override first, then the grace table, then `error`. */
@@ -203,6 +203,8 @@ export const BASALT_VX_NAMES: readonly string[] = [
203
203
  '--vx-surface-overlay',
204
204
  '--vx-surface-panel',
205
205
  '--vx-surface-panel-hover',
206
+ '--vx-surface-row-hover',
207
+ '--vx-surface-row-selected',
206
208
  '--vx-surface-subtle',
207
209
  '--vx-text-display',
208
210
  '--vx-text-h1',
package/src/index.ts CHANGED
@@ -59,6 +59,8 @@ export {
59
59
  type MeterZone,
60
60
  BarList,
61
61
  type BarListProps,
62
+ PageSummary,
63
+ type PageSummaryProps,
62
64
  } from './dashboard'
63
65
  export { unwrap } from './unwrap'
64
66
 
package/src/styles.css CHANGED
@@ -31,6 +31,21 @@
31
31
  @import '@fontsource-variable/hubot-sans';
32
32
  @import '@fontsource-variable/jetbrains-mono';
33
33
 
34
+ /* Hubot Sans has no `zero` OpenType feature and its default zero is slashed, so a head-face "2026" or
35
+ * "90 days" cannot be fixed with `font-feature-settings`. Digits come from the sans instead: this
36
+ * face covers U+0030-0039 only, cut from the Nunito Sans variable file, and leads
37
+ * `--basalt-font-head`, so Hubot draws every letter and Nunito every digit. */
38
+ @font-face {
39
+ /* theme-allow raw-font-family — declares the face, uses nothing */
40
+ font-family: 'Basalt Head Digits';
41
+ font-style: normal;
42
+ font-display: swap;
43
+ font-weight: 200 1000;
44
+ src: url('@fontsource-variable/nunito-sans/files/nunito-sans-latin-wght-normal.woff2')
45
+ format('woff2-variations');
46
+ unicode-range: U+0030-0039;
47
+ }
48
+
34
49
  /* Font stack — overridable via the --basalt-font-* custom properties. */
35
50
  @layer base {
36
51
  :root {
@@ -42,9 +57,10 @@
42
57
  --basalt-font-sans:
43
58
  'Nunito Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
44
59
  Helvetica, Arial, sans-serif;
60
+ /* A consumer that sets its own head family replaces this stack, digit face included, by design. */
45
61
  --basalt-font-head:
46
- 'Hubot Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
47
- Arial, sans-serif;
62
+ 'Basalt Head Digits', 'Hubot Sans Variable', ui-sans-serif, system-ui, -apple-system,
63
+ 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
48
64
  --basalt-font-mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
49
65
  /* Hero values, unit/count/delta text, bar-list and meter figures: proportional sans, lining
50
66
  figures. Set to `var(--basalt-font-mono)` to restore the pre-Wave-35 mono numerals. */
@@ -67,6 +83,23 @@
67
83
  text-size-adjust: 100%;
68
84
  }
69
85
 
86
+ /* Mono data text drops its ligatures: `<>` in a facts line is two characters, not a diamond. Reaches
87
+ the mono stack by element (code, kbd, samp, pre), by contract (`data-numeric`, `data-monospace`),
88
+ by Mantine's `ff="monospace"` inline style, and by the stack's own var in an inline style. Body
89
+ sans keeps its ligatures. A CSS-module class that only sets the mono family is out of reach. */
90
+ code,
91
+ kbd,
92
+ samp,
93
+ pre,
94
+ [data-numeric],
95
+ [data-monospace],
96
+ [style*='font-family-monospace'],
97
+ [style*='basalt-font-mono'],
98
+ .mantine-Code-root,
99
+ .mantine-Kbd-root {
100
+ font-variant-ligatures: none;
101
+ }
102
+
70
103
  /* Removes the grey tap-highlight flash on iOS/Android for anything actually tappable. Scoped to
71
104
  the interactive roles/tags rather than `*` (argo's own rule): a highlight on non-interactive
72
105
  content is not the flash this exists to remove, and `*` would also numb a consumer's own
@@ -144,6 +177,14 @@
144
177
  outline-color: var(--vx-accent);
145
178
  }
146
179
 
180
+ /* The chart host is a focusable element Mantine does not own, so no `mantine-focus-*` class reaches
181
+ it and the UA ring paints instead: a white double ring in dark (argo strength strip and
182
+ diagnostics at dark 390). There is no media or pointer branch behind it. */
183
+ .basalt-chart:focus-visible {
184
+ outline: 2px solid var(--vx-accent);
185
+ outline-offset: calc(0.125rem * var(--mantine-scale));
186
+ }
187
+
147
188
  /* Hubot Sans is a condensed display face — the spec pins it at 88% font-stretch everywhere it
148
189
  lands (headings + the Mantine Title component). Read from the knob declared above rather than
149
190
  hardcoded here, so a consumer retunes it in one declaration instead of fighting these bare
@@ -156,8 +197,6 @@
156
197
  h6,
157
198
  .mantine-Title-root {
158
199
  font-stretch: var(--basalt-font-head-stretch, 88%);
159
- /* Hubot Sans draws a slashed zero by default; a heading numeral is a figure, not code. */
160
- font-feature-settings: 'zero' 0;
161
200
  font-variant-numeric: lining-nums;
162
201
  }
163
202