basalt-ui 2.19.0 → 2.21.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 (234) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/MIGRATING.md +291 -12
  3. package/agent/agents/basalt-design-reviewer.md +22 -5
  4. package/agent/rules/basalt-charts.md +1 -1
  5. package/agent/rules/basalt-mantine.md +1 -1
  6. package/agent/rules/basalt-tokens.md +2 -2
  7. package/agent/skills/basalt-app/SKILL.md +1 -1
  8. package/agent/skills/basalt-design/SKILL.md +10 -23
  9. package/agent/skills/basalt-design/references/anti-defaults.md +24 -0
  10. package/agent/skills/basalt-design/references/catalogue.md +48 -0
  11. package/agent/skills/basalt-design/references/concept.md +36 -0
  12. package/agent/skills/basalt-design/references/encoding-rules.md +45 -0
  13. package/agent/skills/basalt-design/references/stat-tile.md +24 -0
  14. package/agent/templates/AGENTS-block.md.tpl +3 -3
  15. package/agent/templates/DESIGN.md.tpl +1 -1
  16. package/configs/oxlint-plugin.js +34 -19
  17. package/configs/oxlint-plugin.test.ts +32 -2
  18. package/dist/charts/ChartCard.d.ts +33 -4
  19. package/dist/charts/ChartCard.d.ts.map +1 -1
  20. package/dist/charts/ChartCard.js +37 -11
  21. package/dist/charts/Donut.d.ts.map +1 -1
  22. package/dist/charts/Donut.js +13 -1
  23. package/dist/charts/Heatmap.js +1 -1
  24. package/dist/charts/Sparkline.d.ts +7 -1
  25. package/dist/charts/Sparkline.d.ts.map +1 -1
  26. package/dist/charts/Sparkline.js +137 -18
  27. package/dist/charts/box.d.ts +2 -0
  28. package/dist/charts/box.d.ts.map +1 -1
  29. package/dist/charts/box.js +2 -0
  30. package/dist/charts/chart-box.module.css +30 -0
  31. package/dist/charts/chart-box.module.css.d.ts +1 -0
  32. package/dist/charts/chart-card.module.css +47 -0
  33. package/dist/charts/chart-card.module.css.d.ts +7 -0
  34. package/dist/charts/compile.d.ts.map +1 -1
  35. package/dist/charts/compile.js +35 -8
  36. package/dist/charts/host.d.ts.map +1 -1
  37. package/dist/charts/host.js +2 -1
  38. package/dist/charts/index.d.ts +1 -1
  39. package/dist/charts/index.d.ts.map +1 -1
  40. package/dist/charts/sparkline.module.css +59 -0
  41. package/dist/charts/sparkline.module.css.d.ts +13 -0
  42. package/dist/charts/state.d.ts +5 -0
  43. package/dist/charts/state.d.ts.map +1 -1
  44. package/dist/charts/state.js +34 -4
  45. package/dist/charts/types.d.ts +6 -0
  46. package/dist/charts/types.d.ts.map +1 -1
  47. package/dist/cli/check-theme.d.ts.map +1 -1
  48. package/dist/cli/check-theme.js +3 -0
  49. package/dist/cli/help.d.ts.map +1 -1
  50. package/dist/cli/help.js +3 -2
  51. package/dist/cli/index.d.ts +4 -2
  52. package/dist/cli/index.d.ts.map +1 -1
  53. package/dist/cli/index.js +27 -15
  54. package/dist/cli/init.d.ts.map +1 -1
  55. package/dist/cli/init.js +3 -2
  56. package/dist/cli/shot/capture.d.ts.map +1 -1
  57. package/dist/cli/shot/capture.js +6 -1
  58. package/dist/cli/shot/detect.d.ts +51 -0
  59. package/dist/cli/shot/detect.d.ts.map +1 -0
  60. package/dist/cli/shot/detect.js +396 -0
  61. package/dist/cli/shot/index.d.ts.map +1 -1
  62. package/dist/cli/shot/index.js +7 -4
  63. package/dist/cli/shot/measure.d.ts +2 -0
  64. package/dist/cli/shot/measure.d.ts.map +1 -1
  65. package/dist/cli/shot/measure.js +2 -0
  66. package/dist/cli/shot/types.d.ts +4 -1
  67. package/dist/cli/shot/types.d.ts.map +1 -1
  68. package/dist/cli/shot/types.js +2 -0
  69. package/dist/cli/sync.d.ts +2 -0
  70. package/dist/cli/sync.d.ts.map +1 -1
  71. package/dist/cli/sync.js +2 -2
  72. package/dist/common/retry-button.d.ts +12 -0
  73. package/dist/common/retry-button.d.ts.map +1 -0
  74. package/dist/common/retry-button.js +22 -0
  75. package/dist/common/retry-button.module.css +58 -0
  76. package/dist/common/retry-button.module.css.d.ts +8 -0
  77. package/dist/controls/sync-button.d.ts +3 -0
  78. package/dist/controls/sync-button.d.ts.map +1 -1
  79. package/dist/dashboard/bar-list.d.ts +18 -4
  80. package/dist/dashboard/bar-list.d.ts.map +1 -1
  81. package/dist/dashboard/bar-list.js +39 -15
  82. package/dist/dashboard/bar-list.module.css +77 -2
  83. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  84. package/dist/dashboard/delta-badge.d.ts +8 -3
  85. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  86. package/dist/dashboard/delta-badge.js +9 -2
  87. package/dist/dashboard/index.d.ts +2 -0
  88. package/dist/dashboard/index.d.ts.map +1 -1
  89. package/dist/dashboard/meter-model.d.ts +53 -6
  90. package/dist/dashboard/meter-model.d.ts.map +1 -1
  91. package/dist/dashboard/meter-model.js +62 -14
  92. package/dist/dashboard/meter-parts.d.ts +5 -1
  93. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  94. package/dist/dashboard/meter-parts.js +140 -68
  95. package/dist/dashboard/meter.d.ts +29 -4
  96. package/dist/dashboard/meter.d.ts.map +1 -1
  97. package/dist/dashboard/meter.js +8 -1
  98. package/dist/dashboard/meter.module.css +74 -43
  99. package/dist/dashboard/meter.module.css.d.ts +4 -4
  100. package/dist/dashboard/query-state.d.ts +1 -1
  101. package/dist/dashboard/query-state.d.ts.map +1 -1
  102. package/dist/dashboard/query-state.js +16 -10
  103. package/dist/dashboard/settings-section.d.ts.map +1 -1
  104. package/dist/dashboard/settings-section.js +14 -25
  105. package/dist/dashboard/stat-card-parts.js +1 -1
  106. package/dist/dashboard/stat-card.d.ts +1 -1
  107. package/dist/dashboard/stat-card.d.ts.map +1 -1
  108. package/dist/dashboard/stat-card.js +5 -7
  109. package/dist/dashboard/stat-card.module.css +15 -7
  110. package/dist/dashboard/stat-group.d.ts +11 -2
  111. package/dist/dashboard/stat-group.d.ts.map +1 -1
  112. package/dist/dashboard/stat-group.js +9 -7
  113. package/dist/dashboard/stat-strip.d.ts +67 -0
  114. package/dist/dashboard/stat-strip.d.ts.map +1 -0
  115. package/dist/dashboard/stat-strip.js +115 -0
  116. package/dist/dashboard/stat-strip.module.css +291 -0
  117. package/dist/dashboard/stat-strip.module.css.d.ts +32 -0
  118. package/dist/dashboard/visual-slot.d.ts +2 -0
  119. package/dist/dashboard/visual-slot.d.ts.map +1 -0
  120. package/dist/dashboard/visual-slot.js +5 -0
  121. package/dist/dashboard/widget-header.d.ts +3 -3
  122. package/dist/dashboard/widget-header.module.css +10 -6
  123. package/dist/format/date.d.ts.map +1 -1
  124. package/dist/format/date.js +4 -3
  125. package/dist/format/shared.d.ts +6 -0
  126. package/dist/format/shared.d.ts.map +1 -1
  127. package/dist/format/shared.js +6 -2
  128. package/dist/guard/index.d.ts +16 -3
  129. package/dist/guard/index.d.ts.map +1 -1
  130. package/dist/guard/index.js +15 -1
  131. package/dist/guard/palette.d.ts +51 -0
  132. package/dist/guard/palette.d.ts.map +1 -0
  133. package/dist/guard/palette.js +190 -0
  134. package/dist/guard/series-file.d.ts +15 -0
  135. package/dist/guard/series-file.d.ts.map +1 -0
  136. package/dist/guard/series-file.js +29 -0
  137. package/dist/guard/types.d.ts +3 -3
  138. package/dist/guard/types.d.ts.map +1 -1
  139. package/dist/index.d.ts +3 -1
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +4 -0
  142. package/dist/styles.css +6 -0
  143. package/dist/surfaces.d.ts +1 -1
  144. package/dist/surfaces.d.ts.map +1 -1
  145. package/dist/surfaces.js +2 -0
  146. package/dist/theme/card-inset.module.css +76 -0
  147. package/dist/theme/card-inset.module.css.d.ts +9 -0
  148. package/dist/theme/controls.module.css +13 -0
  149. package/dist/theme/index.d.ts.map +1 -1
  150. package/dist/theme/index.js +41 -0
  151. package/dist/theme/nav-link.module.css +8 -10
  152. package/dist/theme/status-dot.d.ts +3 -2
  153. package/dist/theme/status-dot.d.ts.map +1 -1
  154. package/dist/theme/status-dot.js +12 -3
  155. package/dist/theme/status-verdict.d.ts +3 -2
  156. package/dist/theme/status-verdict.d.ts.map +1 -1
  157. package/dist/theme/status-verdict.js +3 -2
  158. package/dist/theme/status-verdict.module.css +4 -2
  159. package/dist/tokens/oklab.d.ts +28 -0
  160. package/dist/tokens/oklab.d.ts.map +1 -0
  161. package/dist/tokens/oklab.js +73 -0
  162. package/llms.txt +33 -7
  163. package/package.json +1 -1
  164. package/src/charts/ChartCard.tsx +79 -5
  165. package/src/charts/Donut.tsx +9 -1
  166. package/src/charts/Heatmap.tsx +1 -1
  167. package/src/charts/Sparkline.tsx +180 -18
  168. package/src/charts/box.tsx +2 -0
  169. package/src/charts/chart-box.module.css +30 -0
  170. package/src/charts/chart-box.module.css.d.ts +1 -0
  171. package/src/charts/chart-card.module.css +47 -0
  172. package/src/charts/chart-card.module.css.d.ts +7 -0
  173. package/src/charts/compile.ts +42 -9
  174. package/src/charts/host.tsx +6 -3
  175. package/src/charts/index.ts +1 -1
  176. package/src/charts/sparkline.module.css +59 -0
  177. package/src/charts/sparkline.module.css.d.ts +13 -0
  178. package/src/charts/state.tsx +53 -4
  179. package/src/charts/types.ts +6 -0
  180. package/src/cli/check-theme.ts +3 -0
  181. package/src/cli/help.ts +18 -1
  182. package/src/cli/index.ts +48 -17
  183. package/src/cli/init.ts +2 -1
  184. package/src/cli/shot/capture.ts +15 -2
  185. package/src/cli/shot/detect.ts +533 -0
  186. package/src/cli/shot/index.ts +8 -4
  187. package/src/cli/shot/measure.ts +4 -0
  188. package/src/cli/shot/types.ts +5 -1
  189. package/src/cli/sync.ts +4 -2
  190. package/src/common/retry-button.module.css +58 -0
  191. package/src/common/retry-button.module.css.d.ts +8 -0
  192. package/src/common/retry-button.tsx +29 -0
  193. package/src/controls/sync-button.tsx +3 -0
  194. package/src/dashboard/bar-list.module.css +77 -2
  195. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  196. package/src/dashboard/bar-list.tsx +89 -18
  197. package/src/dashboard/delta-badge.tsx +21 -5
  198. package/src/dashboard/index.ts +2 -0
  199. package/src/dashboard/meter-model.ts +126 -20
  200. package/src/dashboard/meter-parts.tsx +224 -88
  201. package/src/dashboard/meter.module.css +74 -43
  202. package/src/dashboard/meter.module.css.d.ts +4 -4
  203. package/src/dashboard/meter.tsx +39 -5
  204. package/src/dashboard/query-state.tsx +26 -20
  205. package/src/dashboard/settings-section.tsx +1 -8
  206. package/src/dashboard/stat-card-parts.tsx +1 -1
  207. package/src/dashboard/stat-card.module.css +15 -7
  208. package/src/dashboard/stat-card.tsx +9 -9
  209. package/src/dashboard/stat-group.tsx +19 -8
  210. package/src/dashboard/stat-strip.module.css +291 -0
  211. package/src/dashboard/stat-strip.module.css.d.ts +32 -0
  212. package/src/dashboard/stat-strip.tsx +263 -0
  213. package/src/dashboard/visual-slot.ts +8 -0
  214. package/src/dashboard/widget-header.module.css +10 -6
  215. package/src/dashboard/widget-header.tsx +3 -3
  216. package/src/format/date.ts +6 -3
  217. package/src/format/shared.ts +11 -2
  218. package/src/guard/index.ts +17 -5
  219. package/src/guard/palette.ts +261 -0
  220. package/src/guard/series-file.ts +51 -0
  221. package/src/guard/types.ts +3 -2
  222. package/src/index.ts +7 -0
  223. package/src/styles.css +6 -0
  224. package/src/surfaces.ts +2 -0
  225. package/src/theme/__snapshots__/plain-theme.test.ts.snap +202 -24
  226. package/src/theme/card-inset.module.css +76 -0
  227. package/src/theme/card-inset.module.css.d.ts +9 -0
  228. package/src/theme/controls.module.css +13 -0
  229. package/src/theme/index.ts +56 -0
  230. package/src/theme/nav-link.module.css +8 -10
  231. package/src/theme/status-dot.tsx +17 -5
  232. package/src/theme/status-verdict.module.css +4 -2
  233. package/src/theme/status-verdict.tsx +9 -4
  234. package/src/tokens/oklab.ts +97 -0
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Skeleton, VisuallyHidden } from "@mantine/core";
3
- import { useId, useRef, useState } from "react";
3
+ import { useContext, useId, useRef, useState } from "react";
4
4
  import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
5
5
  import { cx } from "../common/props.js";
6
6
  import {
@@ -8,14 +8,15 @@ import {
8
8
  modelBar,
9
9
  ringFraction,
10
10
  startCaptionText,
11
- zoneBand,
12
- zoneLabelsFit
11
+ placeRowLabels,
12
+ zoneBand
13
13
  } from "./meter-model.js";
14
14
  import classes from "./meter.module.css";
15
+ import { VisualSlotContext } from "./visual-slot.js";
15
16
  import { toPct } from "./scale.js";
16
17
  function rootProps(shell) {
17
18
  return {
18
- className: cx(classes.root, shell.className),
19
+ className: cx(classes.root, shell.row && classes.row, shell.className),
19
20
  style: shell.style,
20
21
  "data-basalt-meter": ""
21
22
  };
@@ -51,13 +52,18 @@ function RingSvg({ fraction, color }) {
51
52
  )
52
53
  ] });
53
54
  }
55
+ const UNITS = "h|d|w|mo|y|s|ms|min|m|km|mi|g|kg|%|\u20AC|pts|bpm|AU|kcal|KB|MB|GB|TB";
56
+ const UNIT_AFTER_NUMBER = new RegExp(`(\\d) (?=(?:${UNITS})(?![\\p{L}\\d]))`, "gu");
57
+ const SHORT_LAST_WORD = /([^ ]) ([^ ]{1,6})$/u;
58
+ const glueUnits = (text) => typeof text === "string" ? text.replace(UNIT_AFTER_NUMBER, "$1\xA0") : text;
59
+ const glue = (text) => typeof text === "string" ? String(glueUnits(text)).replace(SHORT_LAST_WORD, "$1\xA0$2") : text;
54
60
  function MeterLoading({
55
61
  label,
56
62
  ring,
57
63
  shell
58
64
  }) {
59
65
  return /* @__PURE__ */ jsxs("div", { ...rootProps(shell), "aria-busy": "true", children: [
60
- /* @__PURE__ */ jsx(VisuallyHidden, { children: `Loading ${label}` }),
66
+ /* @__PURE__ */ jsx(VisuallyHidden, { className: classes.summary, children: `Loading ${label}` }),
61
67
  ring ? /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRing, circle: true }) : /* @__PURE__ */ jsxs(Fragment, { children: [
62
68
  /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonTrack }),
63
69
  /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonCaption, radius: "sm" })
@@ -103,19 +109,48 @@ function zoneStyle(zone, index, count, min, span) {
103
109
  background: zone.color ?? `color-mix(in srgb, var(--vx-line) ${strength}%, transparent)`
104
110
  };
105
111
  }
106
- const labelsKey = (labels) => labels.map((l) => l.label + (l.holding ? "*" : "")).join("\0");
107
- function useZoneLabelLayout(rowRef, key) {
108
- const [fits, setFits] = useState(true);
112
+ const sameLayout = (a, b) => a.shown.length === b.shown.length && a.shown.every(
113
+ (v, i) => v === b.shown[i] && a.short[i] === b.short[i] && a.shift[i] === b.shift[i]
114
+ );
115
+ function useRowLabelLayout(rowRef, slots, shortOf, key) {
116
+ const [layout, setLayout] = useState({ shown: [], short: [], shift: [] });
117
+ const slotsRef = useRef(slots);
118
+ const shortOfRef = useRef(shortOf);
119
+ useIsomorphicLayoutEffect(() => {
120
+ slotsRef.current = slots;
121
+ shortOfRef.current = shortOf;
122
+ });
109
123
  useIsomorphicLayoutEffect(() => {
110
124
  const row = rowRef.current;
111
125
  if (!row) return;
112
126
  const measure = () => {
113
127
  const origin = row.getBoundingClientRect();
114
- const boxes = [...row.children].map((c) => {
128
+ const rtl = getComputedStyle(row).direction === "rtl";
129
+ const edge = (pct) => origin.width * (rtl ? 100 - pct : pct) / 100;
130
+ const children = [...row.children];
131
+ const labels = children.slice(0, slotsRef.current.length).map((c, i) => {
115
132
  const r = c.getBoundingClientRect();
116
- return { left: r.left - origin.left, right: r.right - origin.left };
133
+ const slot = slotsRef.current[i];
134
+ const pct = slot?.spanPct;
135
+ const [a, b] = pct ? [edge(pct[0]), edge(pct[1])] : [];
136
+ return {
137
+ box: { left: r.left - origin.left, right: r.right - origin.left },
138
+ ...a !== void 0 && b !== void 0 && { span: { left: Math.min(a, b), right: Math.max(a, b) } },
139
+ ...slot?.holding && { holding: true }
140
+ };
141
+ });
142
+ shortOfRef.current.forEach((labelIndex, n) => {
143
+ const r = children[slotsRef.current.length + n]?.getBoundingClientRect();
144
+ const label = labels[labelIndex];
145
+ if (r && label) label.short = { left: r.left - origin.left, right: r.right - origin.left };
117
146
  });
118
- setFits(zoneLabelsFit(boxes, origin.width));
147
+ const placed = placeRowLabels(labels, origin.width);
148
+ const next = {
149
+ shown: placed.shown,
150
+ short: placed.short,
151
+ shift: placed.shift.map((v) => rtl ? -v : v)
152
+ };
153
+ setLayout((prev) => sameLayout(prev, next) ? prev : next);
119
154
  };
120
155
  measure();
121
156
  const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
@@ -130,7 +165,7 @@ function useZoneLabelLayout(rowRef, key) {
130
165
  fonts?.removeEventListener?.("loadingdone", measure);
131
166
  };
132
167
  }, [rowRef, key]);
133
- return fits;
168
+ return layout;
134
169
  }
135
170
  function ZoneReading({ pct, children }) {
136
171
  const rowRef = useRef(null);
@@ -164,56 +199,96 @@ function ZoneReading({ pct, children }) {
164
199
  }
165
200
  ) });
166
201
  }
167
- function ZoneName({ label, ...rest }) {
168
- return /* @__PURE__ */ jsx(
169
- "span",
170
- {
171
- ...rest,
172
- className: cx(rest.className, label.holding && classes.zoneLabelHolding),
173
- "data-meter-zone-label": label.label,
174
- "data-holding": label.holding || void 0,
175
- children: label.label
176
- }
177
- );
178
- }
179
- function ZoneLabels({ labels }) {
202
+ const TICK_LABEL_FLIP_PCT = 50;
203
+ function LabelRow({ zones, ticks }) {
180
204
  const rowRef = useRef(null);
181
- const fits = useZoneLabelLayout(rowRef, labelsKey(labels));
182
- return /* @__PURE__ */ jsxs(Fragment, { children: [
183
- /* @__PURE__ */ jsx(
184
- "div",
185
- {
186
- ref: rowRef,
187
- className: classes.zoneBand,
188
- "data-meter-zone-band": true,
189
- "data-collapsed": fits ? void 0 : "",
190
- "aria-hidden": true,
191
- children: labels.map((l) => /* @__PURE__ */ jsx(
192
- ZoneName,
205
+ const slots = [
206
+ ...ticks.map(() => ({})),
207
+ ...zones.map((z) => ({
208
+ spanPct: [z.centrePct - z.widthPct / 2, z.centrePct + z.widthPct / 2],
209
+ holding: z.holding
210
+ }))
211
+ ];
212
+ const key = [
213
+ ...ticks.map((t) => `${t.label}@${t.pct}`),
214
+ ...zones.map((z) => `${z.label}${z.holding ? "*" : ""}@${z.centrePct}`)
215
+ ].join("\0");
216
+ const twins = zones.flatMap((z, i) => z.short !== void 0 && !z.holding ? [i] : []);
217
+ const { shown, short, shift } = useRowLabelLayout(
218
+ rowRef,
219
+ slots,
220
+ twins.map((i) => ticks.length + i),
221
+ `${key}${twins.map((i) => zones[i]?.short).join("\0")}`
222
+ );
223
+ const hidden = (i) => shown[i] === false || short[i] === true ? "" : void 0;
224
+ const nudge = (i) => shift[i] ? { marginInlineStart: `${shift[i]}px` } : {};
225
+ return /* @__PURE__ */ jsxs(
226
+ "div",
227
+ {
228
+ ref: rowRef,
229
+ className: classes.labelRow,
230
+ ...zones.length > 0 ? { "data-meter-zone-band": "" } : { "data-meter-tick-band": "" },
231
+ "aria-hidden": true,
232
+ children: [
233
+ ticks.map((t, i) => /* @__PURE__ */ jsx(
234
+ "span",
193
235
  {
194
- label: l,
195
- className: classes.zoneLabel,
196
- style: { insetInlineStart: `${l.startPct}%` }
236
+ className: classes.rowLabel,
237
+ "data-meter-tick-label": "",
238
+ "data-hidden": hidden(i),
239
+ style: t.pct > TICK_LABEL_FLIP_PCT ? { insetInlineEnd: `${100 - t.pct}%` } : { insetInlineStart: `${t.pct}%` },
240
+ children: t.label
197
241
  },
198
- l.key
199
- ))
200
- }
201
- ),
202
- !fits && /* @__PURE__ */ jsx("div", { className: classes.zoneList, "data-meter-zone-list": true, "aria-hidden": true, children: labels.map((l) => /* @__PURE__ */ jsx(ZoneName, { label: l, className: classes.zoneListItem }, l.key)) })
203
- ] });
242
+ `t${t.key}`
243
+ )),
244
+ zones.map((z, i) => /* @__PURE__ */ jsx(
245
+ "span",
246
+ {
247
+ className: cx(classes.rowLabel, classes.zoneLabel, z.holding && classes.zoneLabelHolding),
248
+ "data-meter-zone-label": z.label,
249
+ "data-holding": z.holding || void 0,
250
+ "data-hidden": hidden(ticks.length + i),
251
+ style: { insetInlineStart: `${z.centrePct}%`, ...nudge(ticks.length + i) },
252
+ children: z.label
253
+ },
254
+ `z${z.key}`
255
+ )),
256
+ twins.map((zi) => {
257
+ const z = zones[zi];
258
+ const i = ticks.length + zi;
259
+ return /* @__PURE__ */ jsx(
260
+ "span",
261
+ {
262
+ className: cx(classes.rowLabel, classes.zoneLabel),
263
+ "data-meter-zone-short": z.label,
264
+ "data-hidden": short[i] === true ? void 0 : "",
265
+ style: { insetInlineStart: `${z.centrePct}%`, ...nudge(i) },
266
+ children: z.short
267
+ },
268
+ `s${z.key}`
269
+ );
270
+ })
271
+ ]
272
+ }
273
+ );
204
274
  }
205
275
  function MeterBar(props) {
206
276
  const { label, reading, min, max, format, zones, shell } = props;
207
277
  const describedId = useId();
208
278
  const model = modelBar(props);
209
- const start = startCaptionText(model, props.startCaption);
210
- const end = props.endCaption === void 0 ? model.endText : props.endCaption;
279
+ const compact = shell.row;
280
+ const hosted = useContext(VisualSlotContext) && model.markerPct !== void 0 && props.startCaption === void 0;
281
+ const start = compact || hosted ? null : startCaptionText(model, props.startCaption);
282
+ const end = compact ? null : props.endCaption === void 0 ? model.endText : props.endCaption;
211
283
  const anchored = model.markerPct !== void 0 && start !== null;
212
- const hasCaptions = start !== null && !anchored || end !== null || model.forecastText !== null;
213
- const hasParts = model.partCaptions.length > 0;
284
+ const hasCaptions = start !== null && !anchored || end !== null || !compact && model.forecastText !== null;
285
+ const hasParts = !compact && model.partCaptions.length > 0;
286
+ const tickLabels = compact ? [] : model.ticks.filter((t) => t.label !== void 0);
287
+ const zoneLabels = compact ? [] : model.zoneLabels;
214
288
  const describedBy = model.describedByText === null ? {} : { "aria-describedby": describedId };
215
289
  const root = rootProps(shell);
216
- return /* @__PURE__ */ jsxs("div", { ...root, className: cx(root.className, model.zoneLabels.length > 0 && classes.zoned), children: [
290
+ return /* @__PURE__ */ jsxs("div", { ...root, className: root.className, children: [
291
+ tickLabels.length > 0 && zoneLabels.length === 0 && /* @__PURE__ */ jsx(LabelRow, { zones: zoneLabels, ticks: tickLabels }),
217
292
  /* @__PURE__ */ jsxs(
218
293
  "div",
219
294
  {
@@ -237,6 +312,7 @@ function MeterBar(props) {
237
312
  {
238
313
  className: cx(classes.fill, p.forecast && classes.forecastFill),
239
314
  "data-meter-fill": p.forecast ? "forecast" : "committed",
315
+ "data-tone": props.tone === "muted" && p.color === void 0 && !p.forecast ? "muted" : void 0,
240
316
  style: fillStyle(p)
241
317
  },
242
318
  i
@@ -244,13 +320,14 @@ function MeterBar(props) {
244
320
  ] }),
245
321
  /* @__PURE__ */ jsx(Tick, { kind: "marker", className: classes.marker, pct: model.markerPct }),
246
322
  /* @__PURE__ */ jsx(Tick, { kind: "boundary", className: classes.boundaryTick, pct: model.boundaryPct }),
323
+ model.ticks.map((t) => /* @__PURE__ */ jsx(Tick, { kind: "tick", className: classes.tick, pct: t.pct }, t.key)),
247
324
  /* @__PURE__ */ jsx(Tick, { kind: "target", className: classes.tick, pct: model.targetPct })
248
325
  ]
249
326
  }
250
327
  ),
251
- model.zoneLabels.length > 0 && /* @__PURE__ */ jsx(ZoneLabels, { labels: model.zoneLabels }),
328
+ zoneLabels.length > 0 && /* @__PURE__ */ jsx(LabelRow, { zones: zoneLabels, ticks: tickLabels }),
252
329
  anchored && /* @__PURE__ */ jsx(ZoneReading, { pct: model.markerPct ?? 0, children: start }),
253
- model.describedByText !== null && /* @__PURE__ */ jsx(VisuallyHidden, { id: describedId, children: model.describedByText }),
330
+ model.describedByText !== null && /* @__PURE__ */ jsx(VisuallyHidden, { id: describedId, className: classes.summary, children: model.describedByText }),
254
331
  hasParts && // The explicit role is deliberate: `list-style: none` makes Safari/VoiceOver drop the implicit one.
255
332
  // oxlint-disable-next-line jsx-a11y/no-redundant-roles
256
333
  /* @__PURE__ */ jsx("ul", { className: classes.partCaptions, role: "list", "data-meter-parts": true, children: model.partCaptions.map((c) => /* @__PURE__ */ jsxs("li", { className: classes.partCaption, children: [
@@ -262,32 +339,27 @@ function MeterBar(props) {
262
339
  "aria-hidden": true
263
340
  }
264
341
  ),
265
- c.label,
266
- " ",
267
- c.text
342
+ glueUnits(`${c.label} ${c.text}`)
268
343
  ] }, c.key)) }),
269
344
  hasCaptions && /* @__PURE__ */ jsxs("div", { className: classes.captions, "data-meter-captions": true, children: [
270
- start !== null && !anchored && /* @__PURE__ */ jsx("span", { className: classes.caption, children: start }),
271
- model.forecastText !== null && /* @__PURE__ */ jsx("span", { className: classes.caption, children: model.forecastText }),
272
- end !== null && /* @__PURE__ */ jsx("span", { className: classes.captionEnd, children: end })
345
+ start !== null && !anchored && /* @__PURE__ */ jsx("span", { className: classes.caption, children: glue(start) }),
346
+ !compact && model.forecastText !== null && /* @__PURE__ */ jsx("span", { className: classes.caption, children: glue(model.forecastText) }),
347
+ end !== null && /* @__PURE__ */ jsx("span", { className: classes.captionEnd, children: glue(end) })
273
348
  ] })
274
349
  ] });
275
350
  }
351
+ const TICK_WIDTH = "2px";
352
+ function tickPosition(kind, pct) {
353
+ if (pct < 100 || kind === "marker" || kind === "boundary") return { insetInlineStart: `${pct}%` };
354
+ return { insetInlineStart: `calc(100% - ${TICK_WIDTH})`, marginInlineStart: 0 };
355
+ }
276
356
  function Tick({
277
357
  kind,
278
358
  className,
279
359
  pct
280
360
  }) {
281
361
  if (pct === void 0) return null;
282
- return /* @__PURE__ */ jsx(
283
- "div",
284
- {
285
- className,
286
- "data-meter-tick": kind,
287
- style: { insetInlineStart: `${pct}%` },
288
- "aria-hidden": true
289
- }
290
- );
362
+ return /* @__PURE__ */ jsx("div", { className, "data-meter-tick": kind, style: tickPosition(kind, pct), "aria-hidden": true });
291
363
  }
292
364
  export {
293
365
  MeterBar,
@@ -4,9 +4,10 @@
4
4
  * along is this against a limit"; choose `BarList` for a ranking and a chart for a trend. An HTML/CSS
5
5
  * primitive, not a chart kind (no scale, axis or tooltip).
6
6
  *
7
- * Colour law: the fill is neutral (`VX.line`). `color` is for a VERDICT only (over budget, below
8
- * target) and is a status colour the consumer passes; categorical `segments` take the consumer's
9
- * series colours. Committed vs forecast is the same neutral at two strengths — never colour alone: a
7
+ * Colour law: a plain `value` bar's fill is neutral (`--vx-muted` at a strength that holds 3:1 on
8
+ * the track; `tone="ink"` for full ink); `segments` and `zones` keep their own fills. `color` is
9
+ * for a VERDICT only (over budget, below target) and is a status colour the consumer passes;
10
+ * categorical `segments` take the consumer's series colours. Committed vs forecast is the same neutral at two strengths — never colour alone: a
10
11
  * tick marks the boundary and a caption names the forecast. A value past `max` clamps the fill at the
11
12
  * track end; the caption still states the real value.
12
13
  *
@@ -52,7 +53,7 @@
52
53
  */
53
54
  import type { ReactNode } from 'react';
54
55
  import type { BasaltProps } from '../common/props.js';
55
- import type { MeterSegment, MeterZone } from './meter-model.js';
56
+ import type { MeterSegment, MeterTick, MeterZone } from './meter-model.js';
56
57
  type Common = BasaltProps & {
57
58
  /** Accessible name (`aria-label`). Required: a meter without one is announced as a bare number. */
58
59
  label: string;
@@ -71,6 +72,27 @@ type BarCommon = Common & {
71
72
  shape?: 'bar';
72
73
  /** Target position; draws a tick and states it in the end caption (with the overage past it). */
73
74
  target?: number;
75
+ /**
76
+ * More marks on the track (cut-offs, a window mean). Each is drawn at `at`; a `label` is captioned
77
+ * above the track, or on a zoned Meter in the zone-name row (the end ticks at the row's ends). A
78
+ * caption that would collide with another hides. A tick outside `[min, max]` is dropped, not
79
+ * clamped. All are listed in the accessible description. Works with `value`, `zones`, `segments`
80
+ * and `target`.
81
+ */
82
+ ticks?: readonly MeterTick[];
83
+ /**
84
+ * `'muted'` (default for a plain `value` bar; `segments` and `zones` keep their fills): a
85
+ * non-verdict fill (a load, not a verdict) in `--vx-muted` at a strength that holds 3:1 against
86
+ * the track in both schemes — the ink fill is near-white in dark. `'ink'` restores the full-ink
87
+ * `--vx-line` fill. A `color` wins over both.
88
+ */
89
+ tone?: 'muted' | 'ink';
90
+ /**
91
+ * `'row'`: in-line use — a track one text line tall and no caption rows (reading, target, forecast,
92
+ * part, zone and tick captions). The label stays as `aria-label`; the described-by text keeps the
93
+ * rest. Put the value beside it in your own layout.
94
+ */
95
+ size?: 'row';
74
96
  /** Start caption (default: the formatted reading). `null` drops it. */
75
97
  startCaption?: ReactNode;
76
98
  /** End caption (default: `Target <target>`). `null` drops it. */
@@ -115,6 +137,9 @@ export type MeterProps = (BarCommon & {
115
137
  segments?: never;
116
138
  zones?: never;
117
139
  target?: never;
140
+ ticks?: never;
141
+ tone?: never;
142
+ size?: never;
118
143
  startCaption?: never;
119
144
  endCaption?: never;
120
145
  });
@@ -1 +1 @@
1
- {"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI5D,KAAK,MAAM,GAAG,WAAW,GAAG;IAC1B,mGAAmG;IACnG,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,0FAA0F;IAC1F,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,SAAS,GAAG,MAAM,GAAG;IACxB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,YAAY,CAAC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}) must be greater than min (${min}); drawing an empty track`
11
11
  );
12
12
  }
13
+ function barTone(tone, plain) {
14
+ if (tone === "ink") return void 0;
15
+ return tone === "muted" || plain ? "muted" : void 0;
16
+ }
13
17
  function Meter(props) {
14
18
  const { label, min = 0, max = 100, format = asText, className, style } = props;
15
- const shell = { className, style };
19
+ const row = props.size === "row";
20
+ const shell = { className, style, row };
16
21
  const ring = props.shape === "ring";
17
22
  warnInvalidTrack(min, max);
18
23
  if (props.loading === true) return /* @__PURE__ */ jsx(MeterLoading, { label, ring, shell });
@@ -32,6 +37,8 @@ function Meter(props) {
32
37
  segments,
33
38
  zones: props.zones,
34
39
  target: isReading(props.target) ? props.target : void 0,
40
+ ticks: props.ticks,
41
+ tone: barTone(props.tone, props.segments === void 0 && props.zones === void 0),
35
42
  forecastCaption: props.segments === void 0 ? void 0 : props.forecastCaption,
36
43
  startCaption: props.startCaption,
37
44
  endCaption: props.endCaption
@@ -9,10 +9,9 @@
9
9
  flex-direction: column;
10
10
  gap: var(--vx-space-stack-xs, 0.25rem);
11
11
  min-width: 0;
12
- }
13
-
14
- .root.zoned {
15
- position: relative;
12
+ /* The ONE caption size: every caption below reads it. A host that wants captions at its own text
13
+ * size sets `--basalt-meter-caption: 1em` on the Meter. */
14
+ --basalt-meter-caption: var(--vx-text-micro);
16
15
  }
17
16
 
18
17
  .track {
@@ -35,6 +34,14 @@
35
34
  background: var(--vx-line);
36
35
  }
37
36
 
37
+ /*
38
+ * A non-verdict reading: --vx-muted at 65%. 35% (argo's alpha) measures 1.7:1 (light) / 2.4:1 (dark)
39
+ * against the track; 65% clears 3:1 in both, and is not the near-white of --vx-line in dark.
40
+ */
41
+ .fill[data-tone='muted'] {
42
+ background: color-mix(in srgb, var(--vx-muted) 65%, transparent);
43
+ }
44
+
38
45
  /* The committed/forecast pair: the same neutral at two strengths. Flat, never hatched. */
39
46
  .forecastFill {
40
47
  background: color-mix(in srgb, var(--vx-line) 45%, transparent);
@@ -46,54 +53,44 @@
46
53
  }
47
54
 
48
55
  /*
49
- * Zone names under the band: absolutely placed at each band start so they stay on the band. When
50
- * they would collide the band collapses (hidden but still laid out, so it can be re-measured) and the
51
- * same names wrap as a list. The holding zone is ink, the rest muted.
56
+ * The one label row under (or, for a plain tick Meter, above) the track: zone names centred on their
57
+ * spans, labelled ticks hugging their marks, all absolutely placed on one baseline. A label that does
58
+ * not fit is hidden but stays laid out, so a resize can measure it again.
52
59
  */
53
- .zoneBand {
60
+ .labelRow {
61
+ --basalt-reading-dir: 1;
54
62
  position: relative;
55
- /* Labels are absolutely placed, so the row needs its own line height. */
63
+ /* A hidden name keeps its box (so it can be measured again) and may sit past the row's end. */
64
+ overflow-x: clip;
56
65
  height: 1.25em;
57
- font-family: var(--basalt-font-mono);
58
- font-size: var(--vx-text-micro);
66
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
67
+ font-variant-numeric: lining-nums;
68
+ font-size: var(--basalt-meter-caption);
59
69
  color: var(--vx-muted);
60
70
  }
61
71
 
62
- /*
63
- * Hidden but laid out, so a resize can measure it again. Absolute against `.root.zoned`, which has
64
- * no inline padding, so `inset-inline: 0` gives the band the same width as when it was in flow.
65
- */
66
- .zoneBand[data-collapsed] {
67
- position: absolute;
68
- top: 0;
69
- inset-inline: 0;
70
- visibility: hidden;
71
- pointer-events: none;
72
+ .labelRow:dir(rtl) {
73
+ --basalt-reading-dir: -1;
72
74
  }
73
75
 
74
- .zoneLabel {
76
+ .rowLabel {
75
77
  position: absolute;
76
78
  top: 0;
77
79
  white-space: nowrap;
78
80
  }
79
81
 
80
- .zoneLabelHolding {
81
- font-weight: 500;
82
- color: var(--vx-ink);
82
+ .rowLabel[data-hidden] {
83
+ visibility: hidden;
83
84
  }
84
85
 
85
- .zoneList {
86
- display: flex;
87
- flex-wrap: wrap;
88
- gap: var(--vx-space-stack-xs) var(--vx-space-stack-sm);
89
- font-family: var(--basalt-font-mono);
90
- font-size: var(--vx-text-micro);
91
- color: var(--vx-muted);
86
+ /* A zone name is centred on its span: the physical `translate` flips sign in RTL. */
87
+ .zoneLabel {
88
+ translate: calc(-50% * var(--basalt-reading-dir)) 0;
92
89
  }
93
90
 
94
- .zoneListItem {
95
- min-width: 0;
96
- overflow-wrap: anywhere;
91
+ .zoneLabelHolding {
92
+ font-weight: 500;
93
+ color: var(--vx-ink);
97
94
  }
98
95
 
99
96
  /* The reading under the band, centred on the marker. Clipped so it never widens the row before the first measure. */
@@ -102,8 +99,9 @@
102
99
  position: relative;
103
100
  height: 1.25em;
104
101
  overflow: clip;
105
- font-family: var(--basalt-font-mono);
106
- font-size: var(--vx-text-micro);
102
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
103
+ font-variant-numeric: lining-nums;
104
+ font-size: var(--basalt-meter-caption);
107
105
  }
108
106
 
109
107
  .zoneReadingRow:dir(rtl) {
@@ -144,6 +142,8 @@
144
142
  margin-inline-start: -1px;
145
143
  border-radius: var(--vx-radius-fine);
146
144
  background: var(--vx-ink);
145
+ /* A track-coloured halo keeps an ink tick readable on a fill that is itself near-ink (dark). */
146
+ box-shadow: 0 0 0 1px var(--vx-surface-subtle);
147
147
  }
148
148
 
149
149
  .boundaryTick {
@@ -157,14 +157,17 @@
157
157
  align-items: baseline;
158
158
  justify-content: space-between;
159
159
  gap: var(--vx-space-control-gap, 0.375rem);
160
- font-family: var(--basalt-font-mono);
161
- font-size: var(--vx-text-micro);
160
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
161
+ font-variant-numeric: lining-nums;
162
+ font-size: var(--basalt-meter-caption);
163
+ text-wrap: balance;
162
164
  color: var(--vx-muted);
163
165
  }
164
166
 
165
167
  /* Captions never truncate: the row wraps, and a caption wider than the row wraps inside itself. */
166
168
  .caption {
167
169
  min-width: 0;
170
+ text-wrap: balance;
168
171
  overflow-wrap: anywhere;
169
172
  }
170
173
 
@@ -175,6 +178,12 @@
175
178
  text-align: end;
176
179
  }
177
180
 
181
+ /* The visually-hidden summary and loading text are still text: they read the caption size, not the
182
+ * body size they would inherit. */
183
+ .root .summary {
184
+ font-size: var(--basalt-meter-caption);
185
+ }
186
+
178
187
  /* Categorical segments: one caption per part under the track, wrapping at narrow widths. */
179
188
  .partCaptions {
180
189
  display: flex;
@@ -183,8 +192,10 @@
183
192
  margin: 0;
184
193
  padding: 0;
185
194
  list-style: none;
186
- font-family: var(--basalt-font-mono);
187
- font-size: var(--vx-text-micro);
195
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
196
+ font-variant-numeric: lining-nums;
197
+ font-size: var(--basalt-meter-caption);
198
+ text-wrap: balance;
188
199
  color: var(--vx-muted);
189
200
  }
190
201
 
@@ -205,7 +216,7 @@
205
216
  }
206
217
 
207
218
  .empty {
208
- font-size: var(--vx-text-sm);
219
+ font-size: var(--basalt-meter-caption);
209
220
  color: var(--vx-muted);
210
221
  }
211
222
 
@@ -256,7 +267,8 @@
256
267
 
257
268
  .ringValue {
258
269
  position: relative;
259
- font-family: var(--basalt-font-mono);
270
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
271
+ font-variant-numeric: lining-nums;
260
272
  font-size: var(--vx-text-kpi);
261
273
  font-weight: 500;
262
274
  color: var(--vx-ink);
@@ -266,3 +278,22 @@
266
278
  width: 5rem;
267
279
  height: 5rem;
268
280
  }
281
+
282
+ /* ── size="row" ──────────────────────────────────────────────────────────────────────────────── */
283
+
284
+ .row {
285
+ gap: 0;
286
+ justify-content: center;
287
+ }
288
+
289
+ .row .track {
290
+ height: 1lh;
291
+ }
292
+
293
+ .row .skeletonTrack {
294
+ height: 1lh;
295
+ }
296
+
297
+ .row .skeletonCaption {
298
+ display: none;
299
+ }
@@ -4,17 +4,16 @@
4
4
  */
5
5
  declare const classes: {
6
6
  readonly root: string
7
- readonly zoned: string
7
+ readonly summary: string
8
8
  readonly track: string
9
9
  readonly trackBox: string
10
10
  readonly fill: string
11
11
  readonly forecastFill: string
12
12
  readonly zone: string
13
- readonly zoneBand: string
13
+ readonly labelRow: string
14
+ readonly rowLabel: string
14
15
  readonly zoneLabel: string
15
16
  readonly zoneLabelHolding: string
16
- readonly zoneList: string
17
- readonly zoneListItem: string
18
17
  readonly zoneReadingRow: string
19
18
  readonly zoneReading: string
20
19
  readonly marker: string
@@ -35,5 +34,6 @@ declare const classes: {
35
34
  readonly ringArc: string
36
35
  readonly ringValue: string
37
36
  readonly skeletonRing: string
37
+ readonly row: string
38
38
  }
39
39
  export default classes
@@ -43,7 +43,7 @@ export type ErrorStateProps = BasaltProps & {
43
43
  /** Shown only when the server body carries no readable message. */
44
44
  fallback?: string;
45
45
  onRetry?: () => void;
46
- /** Disables/spins the retry button while a refetch is in flight. */
46
+ /** Disables the retry button while a refetch is in flight. */
47
47
  retrying?: boolean;
48
48
  /** How loud this state is. Default `'page'`. */
49
49
  tier?: QueryStateTier;