basalt-ui 2.21.0 → 2.22.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 (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/MIGRATING.md +277 -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 +27 -3
  10. package/dist/charts/Bars.d.ts.map +1 -1
  11. package/dist/charts/Bars.js +5 -0
  12. package/dist/charts/CartesianChart.d.ts +8 -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 +29 -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 +7 -1
  29. package/dist/charts/Sparkline.d.ts.map +1 -1
  30. package/dist/charts/Sparkline.js +39 -14
  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 +20 -1
  35. package/dist/charts/band-fold.d.ts.map +1 -1
  36. package/dist/charts/band-fold.js +9 -0
  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-legend.module.css +7 -0
  40. package/dist/charts/compile.d.ts +17 -6
  41. package/dist/charts/compile.d.ts.map +1 -1
  42. package/dist/charts/compile.js +145 -74
  43. package/dist/charts/labels.d.ts +15 -4
  44. package/dist/charts/labels.d.ts.map +1 -1
  45. package/dist/charts/labels.js +34 -10
  46. package/dist/charts/legend.d.ts +2 -0
  47. package/dist/charts/legend.d.ts.map +1 -1
  48. package/dist/charts/legend.js +7 -21
  49. package/dist/charts/marks.js +1 -1
  50. package/dist/charts/panel.d.ts +0 -6
  51. package/dist/charts/panel.d.ts.map +1 -1
  52. package/dist/charts/panel.js +1 -10
  53. package/dist/charts/ref-label.d.ts +26 -0
  54. package/dist/charts/ref-label.d.ts.map +1 -0
  55. package/dist/charts/ref-label.js +63 -0
  56. package/dist/charts/scales.d.ts +4 -1
  57. package/dist/charts/scales.d.ts.map +1 -1
  58. package/dist/charts/scales.js +14 -3
  59. package/dist/charts/sparkline.module.css +10 -11
  60. package/dist/charts/sparkline.module.css.d.ts +1 -2
  61. package/dist/charts/state.d.ts +2 -0
  62. package/dist/charts/state.d.ts.map +1 -1
  63. package/dist/charts/state.js +2 -1
  64. package/dist/charts/types.d.ts +14 -5
  65. package/dist/charts/types.d.ts.map +1 -1
  66. package/dist/cli/doctor-upgrade.d.ts +1 -0
  67. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  68. package/dist/cli/doctor-upgrade.js +1 -0
  69. package/dist/cli/init.d.ts +2 -0
  70. package/dist/cli/init.d.ts.map +1 -1
  71. package/dist/cli/init.js +68 -4
  72. package/dist/cli/shot/capture.d.ts +21 -2
  73. package/dist/cli/shot/capture.d.ts.map +1 -1
  74. package/dist/cli/shot/capture.js +194 -32
  75. package/dist/cli/shot/detect.d.ts.map +1 -1
  76. package/dist/cli/shot/detect.js +14 -1
  77. package/dist/cli/shot/playwright.d.ts +5 -2
  78. package/dist/cli/shot/playwright.d.ts.map +1 -1
  79. package/dist/cli/shot/types.d.ts +2 -0
  80. package/dist/cli/shot/types.d.ts.map +1 -1
  81. package/dist/cli/shot/types.js +2 -0
  82. package/dist/controls/controls.module.css +11 -1
  83. package/dist/controls/filter-pill.d.ts.map +1 -1
  84. package/dist/controls/filter-pill.js +1 -0
  85. package/dist/controls/sync-button.d.ts.map +1 -1
  86. package/dist/controls/sync-button.js +22 -3
  87. package/dist/controls/sync-button.module.css +34 -2
  88. package/dist/controls/sync-button.module.css.d.ts +1 -0
  89. package/dist/dashboard/bar-list.d.ts.map +1 -1
  90. package/dist/dashboard/bar-list.js +7 -8
  91. package/dist/dashboard/bar-list.module.css +53 -0
  92. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  93. package/dist/dashboard/index.d.ts +1 -0
  94. package/dist/dashboard/index.d.ts.map +1 -1
  95. package/dist/dashboard/index.js +2 -0
  96. package/dist/dashboard/meter-model.d.ts +77 -3
  97. package/dist/dashboard/meter-model.d.ts.map +1 -1
  98. package/dist/dashboard/meter-model.js +88 -15
  99. package/dist/dashboard/meter-parts.d.ts +8 -0
  100. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  101. package/dist/dashboard/meter-parts.js +238 -71
  102. package/dist/dashboard/meter.d.ts +43 -60
  103. package/dist/dashboard/meter.d.ts.map +1 -1
  104. package/dist/dashboard/meter.js +20 -3
  105. package/dist/dashboard/meter.module.css +61 -0
  106. package/dist/dashboard/meter.module.css.d.ts +5 -0
  107. package/dist/dashboard/page-summary.d.ts +20 -0
  108. package/dist/dashboard/page-summary.d.ts.map +1 -0
  109. package/dist/dashboard/page-summary.js +28 -0
  110. package/dist/dashboard/page-summary.module.css +89 -0
  111. package/dist/dashboard/page-summary.module.css.d.ts +15 -0
  112. package/dist/dashboard/section.d.ts +25 -2
  113. package/dist/dashboard/section.d.ts.map +1 -1
  114. package/dist/dashboard/section.js +10 -5
  115. package/dist/dashboard/section.module.css +23 -0
  116. package/dist/dashboard/section.module.css.d.ts +1 -0
  117. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  118. package/dist/dashboard/stat-card-parts.js +1 -1
  119. package/dist/dashboard/stat-card.d.ts +4 -2
  120. package/dist/dashboard/stat-card.d.ts.map +1 -1
  121. package/dist/dashboard/stat-card.js +7 -5
  122. package/dist/dashboard/stat-card.module.css +17 -0
  123. package/dist/dashboard/stat-strip.d.ts +7 -1
  124. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  125. package/dist/dashboard/stat-strip.js +74 -46
  126. package/dist/dashboard/stat-strip.module.css +67 -20
  127. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  128. package/dist/dashboard/visual-slot.d.ts +7 -1
  129. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  130. package/dist/dashboard/visual-slot.js +3 -1
  131. package/dist/guard/vx-names.d.ts.map +1 -1
  132. package/dist/guard/vx-names.js +2 -0
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +3 -1
  136. package/dist/styles.css +34 -2
  137. package/dist/theme/chrome-vars.d.ts +20 -5
  138. package/dist/theme/chrome-vars.d.ts.map +1 -1
  139. package/dist/theme/chrome-vars.js +46 -3
  140. package/dist/theme/controls.module.css +23 -0
  141. package/dist/theme/controls.module.css.d.ts +1 -0
  142. package/dist/theme/index.d.ts.map +1 -1
  143. package/dist/theme/index.js +8 -20
  144. package/dist/tokens/core.d.ts +2 -1
  145. package/dist/tokens/core.d.ts.map +1 -1
  146. package/dist/tokens/core.js +6 -1
  147. package/dist/tokens/derive.d.ts +3 -1
  148. package/dist/tokens/derive.d.ts.map +1 -1
  149. package/dist/tokens/derive.js +16 -1
  150. package/dist/tokens/palette.d.ts +4 -0
  151. package/dist/tokens/palette.d.ts.map +1 -1
  152. package/dist/tokens/palette.js +4 -0
  153. package/dist/tokens/status-text.d.ts.map +1 -1
  154. package/dist/tokens/status-text.js +3 -1
  155. package/llms.txt +38 -20
  156. package/package.json +1 -1
  157. package/src/charts/BandStrip.tsx +33 -3
  158. package/src/charts/Bars.tsx +6 -0
  159. package/src/charts/CartesianChart.tsx +16 -3
  160. package/src/charts/ChartCard.tsx +34 -6
  161. package/src/charts/DualPanel.tsx +3 -6
  162. package/src/charts/Heatmap.tsx +54 -5
  163. package/src/charts/Lines.tsx +56 -10
  164. package/src/charts/MirroredBars.tsx +3 -5
  165. package/src/charts/Sparkline.tsx +50 -13
  166. package/src/charts/StackedArea.tsx +14 -4
  167. package/src/charts/band-fold.ts +31 -1
  168. package/src/charts/chart-box.module.css +19 -0
  169. package/src/charts/chart-card.module.css +25 -0
  170. package/src/charts/chart-legend.module.css +7 -0
  171. package/src/charts/compile.ts +210 -85
  172. package/src/charts/labels.ts +48 -14
  173. package/src/charts/legend.tsx +10 -20
  174. package/src/charts/marks.ts +1 -1
  175. package/src/charts/panel.tsx +1 -16
  176. package/src/charts/ref-label.ts +104 -0
  177. package/src/charts/scales.ts +22 -2
  178. package/src/charts/sparkline.module.css +10 -11
  179. package/src/charts/sparkline.module.css.d.ts +1 -2
  180. package/src/charts/state.tsx +3 -1
  181. package/src/charts/types.ts +14 -5
  182. package/src/cli/doctor-upgrade.ts +1 -1
  183. package/src/cli/init.ts +100 -3
  184. package/src/cli/shot/capture.ts +251 -32
  185. package/src/cli/shot/detect.ts +18 -1
  186. package/src/cli/shot/playwright.ts +2 -2
  187. package/src/cli/shot/types.ts +3 -0
  188. package/src/controls/controls.module.css +11 -1
  189. package/src/controls/filter-pill.tsx +2 -0
  190. package/src/controls/sync-button.module.css +34 -2
  191. package/src/controls/sync-button.module.css.d.ts +1 -0
  192. package/src/controls/sync-button.tsx +40 -4
  193. package/src/dashboard/bar-list.module.css +53 -0
  194. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  195. package/src/dashboard/bar-list.tsx +78 -69
  196. package/src/dashboard/index.ts +1 -0
  197. package/src/dashboard/meter-model.ts +186 -20
  198. package/src/dashboard/meter-parts.tsx +285 -64
  199. package/src/dashboard/meter.module.css +61 -0
  200. package/src/dashboard/meter.module.css.d.ts +5 -0
  201. package/src/dashboard/meter.tsx +60 -10
  202. package/src/dashboard/page-summary.module.css +89 -0
  203. package/src/dashboard/page-summary.module.css.d.ts +15 -0
  204. package/src/dashboard/page-summary.tsx +95 -0
  205. package/src/dashboard/section.module.css +23 -0
  206. package/src/dashboard/section.module.css.d.ts +1 -0
  207. package/src/dashboard/section.tsx +59 -11
  208. package/src/dashboard/stat-card-parts.tsx +5 -1
  209. package/src/dashboard/stat-card.module.css +17 -0
  210. package/src/dashboard/stat-card.tsx +12 -6
  211. package/src/dashboard/stat-strip.module.css +67 -20
  212. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  213. package/src/dashboard/stat-strip.tsx +118 -72
  214. package/src/dashboard/visual-slot.ts +12 -3
  215. package/src/guard/vx-names.ts +2 -0
  216. package/src/index.ts +2 -0
  217. package/src/styles.css +34 -2
  218. package/src/theme/__snapshots__/plain-theme.test.ts.snap +186 -60
  219. package/src/theme/chrome-vars.ts +77 -8
  220. package/src/theme/controls.module.css +23 -0
  221. package/src/theme/controls.module.css.d.ts +1 -0
  222. package/src/theme/index.ts +12 -25
  223. package/src/tokens/core.ts +4 -1
  224. package/src/tokens/derive.ts +32 -3
  225. package/src/tokens/palette.ts +4 -0
  226. package/src/tokens/status-text.ts +2 -0
@@ -13,8 +13,8 @@
13
13
  * pushes a page's own actions into the kebab. The age and the error live in the tooltip; the
14
14
  * accessible name is `label`.
15
15
  * - `scope: 'page'` → `PageBar.sync` (the page's own data). The labelled `Button` with the age
16
- * inline beside it on desktop, icon-only below `sm` where that width is gone — CSS only, one
17
- * mount, never a `visibleFrom` twin (law C9).
16
+ * inline beside it on desktop; below `sm` the label and the long age go and the glyph keeps a
17
+ * SHORT age (`2m`) beside it — CSS only, one mount, never a `visibleFrom` twin (law C9).
18
18
  *
19
19
  * Because the label is hidden rather than unmounted below `sm`, the accessible name comes from
20
20
  * `aria-label` in BOTH forms: `display: none` text is out of the accessibility tree, so a page
@@ -26,6 +26,7 @@ import type { ReactNode } from 'react'
26
26
  import { cx } from '../common/props'
27
27
  import type { BasaltProps } from '../common/props'
28
28
  import { relativeTime } from '../format'
29
+ import { numberFormat } from '../format/shared'
29
30
  import { IconSlot } from '../theme/icon-slot'
30
31
  import { RefreshGlyph } from './glyphs'
31
32
  import classes from './sync-button.module.css'
@@ -69,15 +70,43 @@ function toMillis(at: number | Date | null | undefined): number | undefined {
69
70
  * string (`now`, `1 min. ago`, …), so it is stable across calls within a bucket and a tick only
70
71
  * re-renders when the label changes. With no timestamp there is no subscription and no timer.
71
72
  */
72
- function useRelativeAge(at: number | Date | null | undefined): string | undefined {
73
+ function useRelativeAge(
74
+ at: number | Date | null | undefined,
75
+ format: (timestamp: number) => string = (timestamp) =>
76
+ relativeTime(timestamp, { style: 'short' }),
77
+ ): string | undefined {
73
78
  const timestamp = toMillis(at)
74
79
  return useSyncExternalStore(
75
80
  timestamp === undefined ? subscribeNever : subscribeAgeTick,
76
- () => (timestamp === undefined ? undefined : relativeTime(timestamp, { style: 'short' })),
81
+ () => (timestamp === undefined ? undefined : format(timestamp)),
77
82
  () => undefined,
78
83
  )
79
84
  }
80
85
 
86
+ const COMPACT_UNITS = [
87
+ { unit: 'day', seconds: 86_400 },
88
+ { unit: 'hour', seconds: 3_600 },
89
+ { unit: 'minute', seconds: 60 },
90
+ ] as const
91
+
92
+ /**
93
+ * The phone form's age: one number and a NARROW locale unit (`2m`, `3h`, `2d` in English, `2 Min.`
94
+ * in German), small enough to ride beside the glyph in the button at 390. `Intl.NumberFormat`'s
95
+ * unit style honours the `BasaltProvider` / `defineFormat` locale like every other format here.
96
+ * Under a minute it is the locale's own "now", the same bucket the long age uses, so the two never
97
+ * disagree about whether a sync just landed.
98
+ */
99
+ function compactAge(timestamp: number): string {
100
+ const seconds = Math.max(0, (Date.now() - timestamp) / 1000)
101
+ const step = COMPACT_UNITS.find((u) => seconds >= u.seconds)
102
+ if (step === undefined) return relativeTime(timestamp, { style: 'short' })
103
+ return numberFormat(undefined, {
104
+ style: 'unit',
105
+ unit: step.unit,
106
+ unitDisplay: 'narrow',
107
+ }).format(Math.floor(seconds / step.seconds))
108
+ }
109
+
81
110
  const subscribeNever = (): (() => void) => () => {}
82
111
 
83
112
  function subscribeAgeTick(onTick: () => void): () => void {
@@ -108,6 +137,7 @@ export function SyncButton({
108
137
  style,
109
138
  }: SyncButtonProps): ReactNode {
110
139
  const age = useRelativeAge(lastCompletedAt)
140
+ const shortAge = useRelativeAge(lastCompletedAt, compactAge)
111
141
  // Wherever the label is not painted — every `global` mount, and a `page` mount below `sm` — the
112
142
  // tooltip is where the age lives; an `error` outranks it everywhere. ONE tooltip, one mount.
113
143
  const tooltip = error ?? age
@@ -158,6 +188,7 @@ export function SyncButton({
158
188
  <Button
159
189
  variant="default"
160
190
  className={cx(classes.pageButton, className)}
191
+ {...(age !== undefined && { 'data-with-age': true })}
161
192
  {...(style !== undefined && { style })}
162
193
  leftSection={
163
194
  <IconSlot>
@@ -168,6 +199,11 @@ export function SyncButton({
168
199
  >
169
200
  <span className={classes.label}>{label}</span>
170
201
  {age !== undefined && <span className={classes.age}>{age}</span>}
202
+ {shortAge !== undefined && (
203
+ <span className={classes.ageCompact} data-sync-age="compact">
204
+ {shortAge}
205
+ </span>
206
+ )}
171
207
  </Button>
172
208
  )}
173
209
  </Tooltip>
@@ -5,6 +5,19 @@
5
5
  * row never wraps: the label truncates, the value is nowrap.
6
6
  */
7
7
 
8
+ /*
9
+ * The width container the wide layout keys on (a container cannot restyle its own grid), in every
10
+ * state. It is named `basalt-card` because the theme guard permits only the declared names; that
11
+ * shadows an enclosing card's container for the list's descendants only, and the query below measures
12
+ * the LIST's own inline size, not the card's. `inline-size: 100%` keeps it from collapsing to zero in
13
+ * a flex row or an auto track (size containment ignores content width).
14
+ */
15
+ .frame {
16
+ container: basalt-card / inline-size;
17
+ inline-size: 100%;
18
+ min-width: 0;
19
+ }
20
+
8
21
  .root {
9
22
  display: grid;
10
23
  grid-template-columns: minmax(0, 1fr) auto;
@@ -164,3 +177,43 @@
164
177
  text-overflow: ellipsis;
165
178
  white-space: nowrap;
166
179
  }
180
+
181
+ /*
182
+ * Wide (a container of 480px or more): one row, `[label][value][secondary][track]`. The label column fits the
183
+ * longest label (capped at 40% or 14rem, the rest truncates with its `title`), value and secondary are right-
184
+ * aligned and shared by every row, and the track takes the remaining width on the one scale — a
185
+ * full-scale bar ends at the track end, never under a value. Compact keeps the stacked thin layout.
186
+ */
187
+ @container basalt-card (width >= 480px) {
188
+ .root[data-variant='thin'] {
189
+ grid-template-columns: fit-content(min(40%, 14rem)) auto minmax(0, 1fr);
190
+ column-gap: var(--vx-space-stack-md, 0.75rem);
191
+ }
192
+
193
+ .root[data-variant='thin'][data-secondary] {
194
+ grid-template-columns: fit-content(min(40%, 14rem)) auto fit-content(30%) minmax(0, 1fr);
195
+ }
196
+
197
+ .root[data-variant='thin'] .row {
198
+ grid-template-rows: auto;
199
+ align-items: center;
200
+ padding-block: 0;
201
+ }
202
+
203
+ .root[data-variant='thin'] .track {
204
+ grid-column: auto;
205
+ align-self: center;
206
+ }
207
+
208
+ .root[data-variant='thin'] .label {
209
+ display: block;
210
+ white-space: nowrap;
211
+ text-overflow: ellipsis;
212
+ -webkit-line-clamp: unset;
213
+ line-clamp: unset;
214
+ }
215
+
216
+ .root[data-variant='thin'] .secondary {
217
+ text-align: end;
218
+ }
219
+ }
@@ -3,6 +3,7 @@
3
3
  * signature — so dot access stays verbatim under the package's strict flags.
4
4
  */
5
5
  declare const classes: {
6
+ readonly frame: string
6
7
  readonly root: string
7
8
  readonly row: string
8
9
  readonly track: string
@@ -12,7 +12,10 @@
12
12
  * thin bar with the value right-aligned on the label line; `variant="inline"` is the older heavy track
13
13
  * with the label inside it.
14
14
  *
15
- * Thin rows sit flush: no inline inset on the label or the rail.
15
+ * Thin rows sit flush: no inline inset on the label or the rail. In a container wider than the compact
16
+ * class (480px) a thin row reads `[label][value][secondary][track]` — the label column fits the longest
17
+ * label, the value and secondary columns are right-aligned and shared, and the track takes the rest on
18
+ * the one scale, so a name stays beside its value and a full-scale bar ends at the track end.
16
19
  *
17
20
  * Colour law: bars are neutral. `accentLeader` (opt-in) lets the top row take the accent — the
18
21
  * leader bar, and nothing else. Each value is rendered as text, never only a bar length.
@@ -103,19 +106,23 @@ export function BarList({
103
106
  }: BarListProps) {
104
107
  if (loading) {
105
108
  return (
106
- <div className={cx(classes.root, className)} style={style} aria-busy="true">
107
- <VisuallyHidden>{`Loading ${label}`}</VisuallyHidden>
108
- {Array.from({ length: loadingRows }, (_, i) => (
109
- <Skeleton key={i} className={classes.skeletonRow} data-bar-skeleton />
110
- ))}
109
+ <div className={cx(classes.frame, className)} style={style}>
110
+ <div className={classes.root} aria-busy="true">
111
+ <VisuallyHidden>{`Loading ${label}`}</VisuallyHidden>
112
+ {Array.from({ length: loadingRows }, (_, i) => (
113
+ <Skeleton key={i} className={classes.skeletonRow} data-bar-skeleton />
114
+ ))}
115
+ </div>
111
116
  </div>
112
117
  )
113
118
  }
114
119
  if (items.length === 0) {
115
120
  return (
116
- <output className={cx(classes.root, className)} style={style} aria-label={label}>
117
- <span className={classes.empty}>{emptyText}</span>
118
- </output>
121
+ <div className={cx(classes.frame, className)} style={style}>
122
+ <output className={classes.root} aria-label={label}>
123
+ <span className={classes.empty}>{emptyText}</span>
124
+ </output>
125
+ </div>
119
126
  )
120
127
  }
121
128
 
@@ -128,69 +135,71 @@ export function BarList({
128
135
  const thin = variant === 'thin'
129
136
  const hasSecondary = items.some((i) => hasContent(i.secondary))
130
137
  return (
131
- // The explicit role is deliberate: `list-style: none` makes Safari/VoiceOver drop the implicit one.
132
- <ul
133
- className={cx(classes.root, className)}
134
- style={style}
135
- // oxlint-disable-next-line jsx-a11y/no-redundant-roles
136
- role="list"
137
- aria-label={label}
138
- data-secondary={hasSecondary ? '' : undefined}
139
- data-variant={variant}
140
- >
141
- {items.map((item, i) => {
142
- const isLeader = accentLeader && i === 0
143
- const rowScale = item.max ?? scale
144
- const labelNode = (
145
- <span className={classes.label} title={item.label}>
146
- {item.label}
147
- </span>
148
- )
149
- const tickName =
150
- item.tick === undefined
151
- ? ''
152
- : `${item.tickLabel ?? 'Threshold'} ${format(item.tick, 'value')}`
153
- const track = (
154
- <span className={classes.track} data-bar-track>
155
- {/* theme-allow hidden-inline-style — the width is the row's data (a % of its scale), not styling */}
156
- <span
157
- className={cx(classes.bar, isLeader && classes.leader)}
158
- style={{ width: `${barPercent(item.value, rowScale)}%` }}
159
- data-bar-fill=""
160
- data-bar-leader={isLeader ? '' : undefined}
161
- aria-hidden
162
- />
163
- {item.tick !== undefined && (
164
- // theme-allow hidden-inline-style — the position is the row's data (a % of its scale)
138
+ // The frame is the width container the wide layout keys on (a container cannot restyle its own grid).
139
+ <div className={cx(classes.frame, className)} style={style}>
140
+ {/* The explicit role is deliberate: `list-style: none` makes Safari/VoiceOver drop the implicit one. */}
141
+ <ul
142
+ className={classes.root}
143
+ // oxlint-disable-next-line jsx-a11y/no-redundant-roles
144
+ role="list"
145
+ aria-label={label}
146
+ data-secondary={hasSecondary ? '' : undefined}
147
+ data-variant={variant}
148
+ >
149
+ {items.map((item, i) => {
150
+ const isLeader = accentLeader && i === 0
151
+ const rowScale = item.max ?? scale
152
+ const labelNode = (
153
+ <span className={classes.label} title={item.label}>
154
+ {item.label}
155
+ </span>
156
+ )
157
+ const tickName =
158
+ item.tick === undefined
159
+ ? ''
160
+ : `${item.tickLabel ?? 'Threshold'} ${format(item.tick, 'value')}`
161
+ const track = (
162
+ <span className={classes.track} data-bar-track>
163
+ {/* theme-allow hidden-inline-style — the width is the row's data (a % of its scale), not styling */}
165
164
  <span
166
- className={classes.tick}
167
- style={{ insetInlineStart: `${barPercent(item.tick, rowScale)}%` }}
168
- data-bar-tick=""
165
+ className={cx(classes.bar, isLeader && classes.leader)}
166
+ style={{ width: `${barPercent(item.value, rowScale)}%` }}
167
+ data-bar-fill=""
168
+ data-bar-leader={isLeader ? '' : undefined}
169
169
  aria-hidden
170
170
  />
171
- )}
172
- {!thin && labelNode}
173
- {/* Inside the track so it is never the row's last child (the value/secondary inset). */}
174
- {item.tick !== undefined && <VisuallyHidden>{tickName}</VisuallyHidden>}
175
- </span>
176
- )
177
- return (
178
- <li key={item.key ?? `${item.label}-${i}`} className={classes.row}>
179
- {thin && labelNode}
180
- {!thin && track}
181
- <span className={classes.value}>
182
- {Number.isFinite(item.value)
183
- ? item.max === undefined
184
- ? format(item.value, 'value')
185
- : `${format(item.value, 'value')} / ${format(item.max, 'max')}`
186
- : '—'}
171
+ {item.tick !== undefined && (
172
+ // theme-allow hidden-inline-style — the position is the row's data (a % of its scale)
173
+ <span
174
+ className={classes.tick}
175
+ style={{ insetInlineStart: `${barPercent(item.tick, rowScale)}%` }}
176
+ data-bar-tick=""
177
+ aria-hidden
178
+ />
179
+ )}
180
+ {!thin && labelNode}
181
+ {/* Inside the track so it is never the row's last child (the value/secondary inset). */}
182
+ {item.tick !== undefined && <VisuallyHidden>{tickName}</VisuallyHidden>}
187
183
  </span>
188
- {/* Kept empty on a row without one: the secondary column is shared, so every row has the cell. */}
189
- {hasSecondary && <span className={classes.secondary}>{item.secondary}</span>}
190
- {thin && track}
191
- </li>
192
- )
193
- })}
194
- </ul>
184
+ )
185
+ return (
186
+ <li key={item.key ?? `${item.label}-${i}`} className={classes.row}>
187
+ {thin && labelNode}
188
+ {!thin && track}
189
+ <span className={classes.value}>
190
+ {Number.isFinite(item.value)
191
+ ? item.max === undefined
192
+ ? format(item.value, 'value')
193
+ : `${format(item.value, 'value')} / ${format(item.max, 'max')}`
194
+ : '—'}
195
+ </span>
196
+ {/* Kept empty on a row without one: the secondary column is shared, so every row has the cell. */}
197
+ {hasSecondary && <span className={classes.secondary}>{item.secondary}</span>}
198
+ {thin && track}
199
+ </li>
200
+ )
201
+ })}
202
+ </ul>
203
+ </div>
195
204
  )
196
205
  }
@@ -1,6 +1,7 @@
1
1
  export { WidgetHeader } from './widget-header'
2
2
  export { DeltaBadge } from './delta-badge'
3
3
  export { Section } from './section'
4
+ export { PageSummary, type PageSummaryProps } from './page-summary'
4
5
  export { StatCard, type StatCardBreakdownRow, type StatCardSparklineSize } from './stat-card'
5
6
  export { StatGroup } from './stat-group'
6
7
  export type { StatStripCell, StatStripRow } from './stat-strip'