basalt-ui 2.25.0 → 2.27.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 (81) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/MIGRATING.md +227 -19
  3. package/configs/oxlint-basalt.json +1 -1
  4. package/configs/oxlint-plugin.js +3 -9
  5. package/configs/oxlint-plugin.test.ts +6 -0
  6. package/dist/charts/Bars.d.ts.map +1 -1
  7. package/dist/charts/Bars.js +37 -1
  8. package/dist/charts/ChartCard.d.ts +13 -5
  9. package/dist/charts/ChartCard.d.ts.map +1 -1
  10. package/dist/charts/ChartCard.js +12 -2
  11. package/dist/charts/Sparkline.d.ts.map +1 -1
  12. package/dist/charts/Sparkline.js +106 -10
  13. package/dist/charts/chart-box.module.css +123 -5
  14. package/dist/charts/chart-box.module.css.d.ts +3 -0
  15. package/dist/charts/chart-card.module.css +34 -0
  16. package/dist/charts/chart-card.module.css.d.ts +2 -0
  17. package/dist/charts/chart-legend.module.css +1 -16
  18. package/dist/charts/compile.d.ts +20 -0
  19. package/dist/charts/compile.d.ts.map +1 -1
  20. package/dist/charts/compile.js +99 -3
  21. package/dist/charts/legend.d.ts.map +1 -1
  22. package/dist/charts/legend.js +54 -71
  23. package/dist/charts/sparkline.module.css +13 -9
  24. package/dist/charts/state.d.ts +7 -0
  25. package/dist/charts/state.d.ts.map +1 -1
  26. package/dist/charts/state.js +17 -1
  27. package/dist/cli/shot/capture.d.ts +32 -3
  28. package/dist/cli/shot/capture.d.ts.map +1 -1
  29. package/dist/cli/shot/capture.js +17 -7
  30. package/dist/dashboard/meter-model.d.ts +19 -3
  31. package/dist/dashboard/meter-model.d.ts.map +1 -1
  32. package/dist/dashboard/meter-model.js +155 -13
  33. package/dist/dashboard/meter-parts.d.ts +4 -7
  34. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  35. package/dist/dashboard/meter-parts.js +130 -90
  36. package/dist/dashboard/meter.d.ts +1 -1
  37. package/dist/dashboard/meter.d.ts.map +1 -1
  38. package/dist/dashboard/meter.js +10 -7
  39. package/dist/dashboard/meter.module.css +55 -13
  40. package/dist/dashboard/meter.module.css.d.ts +1 -2
  41. package/dist/dashboard/section.d.ts +1 -2
  42. package/dist/dashboard/section.d.ts.map +1 -1
  43. package/dist/dashboard/section.module.css +8 -7
  44. package/dist/dashboard/stat-card.module.css +17 -0
  45. package/dist/dashboard/stat-strip.d.ts +9 -1
  46. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  47. package/dist/dashboard/stat-strip.js +121 -27
  48. package/dist/dashboard/stat-strip.module.css +51 -3
  49. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  50. package/dist/dashboard/visual-slot.d.ts +4 -0
  51. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  52. package/dist/dashboard/visual-slot.js +2 -0
  53. package/dist/dashboard/widget-header.module.css +9 -0
  54. package/llms.txt +3 -2
  55. package/package.json +1 -1
  56. package/src/charts/Bars.tsx +50 -2
  57. package/src/charts/ChartCard.tsx +32 -5
  58. package/src/charts/Sparkline.tsx +166 -13
  59. package/src/charts/chart-box.module.css +123 -5
  60. package/src/charts/chart-box.module.css.d.ts +3 -0
  61. package/src/charts/chart-card.module.css +34 -0
  62. package/src/charts/chart-card.module.css.d.ts +2 -0
  63. package/src/charts/chart-legend.module.css +1 -16
  64. package/src/charts/compile.ts +153 -3
  65. package/src/charts/legend.tsx +33 -49
  66. package/src/charts/sparkline.module.css +13 -9
  67. package/src/charts/state.tsx +43 -1
  68. package/src/cli/shot/capture.ts +25 -9
  69. package/src/dashboard/meter-model.ts +248 -22
  70. package/src/dashboard/meter-parts.tsx +124 -69
  71. package/src/dashboard/meter.module.css +55 -13
  72. package/src/dashboard/meter.module.css.d.ts +1 -2
  73. package/src/dashboard/meter.tsx +22 -9
  74. package/src/dashboard/section.module.css +8 -7
  75. package/src/dashboard/section.tsx +1 -2
  76. package/src/dashboard/stat-card.module.css +17 -0
  77. package/src/dashboard/stat-strip.module.css +51 -3
  78. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  79. package/src/dashboard/stat-strip.tsx +162 -33
  80. package/src/dashboard/visual-slot.ts +5 -0
  81. package/src/dashboard/widget-header.module.css +9 -0
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { VX } from "../tokens/index.js";
4
4
  import { isReading, normalizeSegments, segmentReading, spanOf } from "./meter-model.js";
5
- import { MeterBar, MeterEmpty, MeterLoading, MeterRing } from "./meter-parts.js";
5
+ import { MeterBar, MeterEmpty, MeterRing, MeterRingLoading } from "./meter-parts.js";
6
6
  import { asText } from "./scale.js";
7
7
  import { VisualSlotContext } from "./visual-slot.js";
8
8
  let warnedTrack = false;
@@ -23,12 +23,14 @@ function Meter(props) {
23
23
  const shell = { className, style, row };
24
24
  const ring = props.shape === "ring";
25
25
  warnInvalidTrack(min, max);
26
- const hostTone = useContext(VisualSlotContext)?.tone;
26
+ const host = useContext(VisualSlotContext);
27
+ const hostTone = host?.tone;
27
28
  const hostColor = hostTone === void 0 ? void 0 : VX.status[hostTone];
28
- if (props.loading === true)
29
- return /* @__PURE__ */ jsx(MeterLoading, { label, ring, zoned: props.zones !== void 0, shell });
30
- const segments = props.segments === void 0 ? void 0 : normalizeSegments(props.segments);
31
- const reading = segments === void 0 ? props.value : segmentReading(segments, min);
29
+ const loading = props.loading === true || host?.loading === true;
30
+ if (loading && ring) return /* @__PURE__ */ jsx(MeterRingLoading, { label, shell });
31
+ const segments = props.segments === void 0 || loading && props.segments.length === 0 ? void 0 : normalizeSegments(props.segments);
32
+ const placeholder = props.zones !== void 0 && props.zones.length > 0 ? min + spanOf(min, max).span / 2 : min;
33
+ const reading = loading ? segments === void 0 ? placeholder : segmentReading(segments, min) : segments === void 0 ? props.value : segmentReading(segments, min);
32
34
  if (!isReading(reading) || segments?.length === 0) {
33
35
  return /* @__PURE__ */ jsx(
34
36
  MeterEmpty,
@@ -69,7 +71,8 @@ function Meter(props) {
69
71
  forecastCaption: props.segments === void 0 ? void 0 : props.forecastCaption,
70
72
  startCaption: props.startCaption,
71
73
  endCaption: props.endCaption,
72
- readingAt: props.readingAt
74
+ readingAt: props.readingAt,
75
+ loading
73
76
  }
74
77
  );
75
78
  }
@@ -101,10 +101,21 @@
101
101
  --basalt-reading-dir: -1;
102
102
  }
103
103
 
104
+ /* A label that cannot hold its place on the first row stands on a second, directly under it. */
105
+ .labelRow[data-meter-rows='2'] {
106
+ height: 2.5em;
107
+ }
108
+
109
+ .rowLabel[data-row2] {
110
+ top: 1.25em;
111
+ }
112
+
104
113
  .rowLabel {
105
114
  position: absolute;
106
115
  top: 0;
107
116
  white-space: nowrap;
117
+ /* The placement's physical offset (a label kept inside the row): both anchors, either direction. */
118
+ translate: var(--basalt-nudge, 0px) 0;
108
119
  }
109
120
 
110
121
  .rowLabel[data-hidden] {
@@ -113,7 +124,7 @@
113
124
 
114
125
  /* A zone name is centred on its span: the physical `translate` flips sign in RTL. */
115
126
  .zoneLabel {
116
- translate: calc(-50% * var(--basalt-reading-dir)) 0;
127
+ translate: calc(-50% * var(--basalt-reading-dir) + var(--basalt-nudge, 0px)) 0;
117
128
  }
118
129
 
119
130
  .zoneLabelHolding {
@@ -312,8 +323,7 @@
312
323
  color: var(--vx-muted);
313
324
  }
314
325
 
315
- /* One caption-height line: a blank caption row (empty) or the home of a skeleton line (loading), so
316
- * both stand at the loaded Meter's height. */
326
+ /* One caption-height line: a blank caption row of an empty Meter, so it stands at the loaded height. */
317
327
  .line {
318
328
  display: flex;
319
329
  align-items: center;
@@ -325,14 +335,50 @@
325
335
  height: 1.25em;
326
336
  }
327
337
 
328
- /* The skeleton holds the loaded footprint: figure row (zoned), track, caption / zone-name row. */
329
- .skeletonTrack {
330
- height: 0.375rem;
338
+ /* Loading is the loaded tree (`MeterBar` with `loading`): every row stands where it will and the
339
+ * height is the loaded one. Text is painted as skeleton in place: transparent ink on a pulsing pill
340
+ * the width of the caption, the track a pulsing bar. A caption the layout dropped stays hidden. */
341
+ .hold {
342
+ display: contents;
343
+ }
344
+
345
+ [data-meter-loading] {
346
+ --basalt-meter-skeleton: color-mix(in srgb, var(--vx-muted) 28%, transparent);
347
+ }
348
+
349
+ [data-meter-loading]
350
+ :is(.rowLabel, .caption, .captionEnd, .captionTarget, .zoneReading, .partCaption) {
351
+ color: transparent;
352
+ background: var(--basalt-meter-skeleton);
353
+ border-radius: var(--vx-radius-fine);
354
+ animation: meterPulse 1500ms linear infinite;
331
355
  }
332
356
 
333
- .skeletonCaption {
334
- width: 40%;
335
- height: 0.75rem;
357
+ [data-meter-loading] .swatch {
358
+ visibility: hidden;
359
+ }
360
+
361
+ [data-meter-loading] .track {
362
+ background: var(--basalt-meter-skeleton);
363
+ animation: meterPulse 1500ms linear infinite;
364
+ }
365
+
366
+ @keyframes meterPulse {
367
+ 0%,
368
+ 100% {
369
+ opacity: 0.4;
370
+ }
371
+
372
+ 50% {
373
+ opacity: 1;
374
+ }
375
+ }
376
+
377
+ @media (prefers-reduced-motion: reduce) {
378
+ [data-meter-loading]
379
+ :is(.rowLabel, .caption, .captionEnd, .captionTarget, .zoneReading, .partCaption, .track) {
380
+ animation: none;
381
+ }
336
382
  }
337
383
 
338
384
  /* ── ring ────────────────────────────────────────────────────────────────────────────────────── */
@@ -406,10 +452,6 @@
406
452
  height: 1lh;
407
453
  }
408
454
 
409
- .row .skeletonTrack {
410
- height: 1lh;
411
- }
412
-
413
455
  .row .line {
414
456
  display: none;
415
457
  }
@@ -34,8 +34,7 @@ declare const classes: {
34
34
  readonly empty: string
35
35
  readonly line: string
36
36
  readonly lineZoned: string
37
- readonly skeletonTrack: string
38
- readonly skeletonCaption: string
37
+ readonly hold: string
39
38
  readonly ringBox: string
40
39
  readonly ring: string
41
40
  readonly ringTrack: string
@@ -54,8 +54,7 @@ type SectionBaseProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'actions
54
54
  defaultOpen?: boolean;
55
55
  /** Rendered directly under the header and ALWAYS visible, collapsed or not: a collapsed section
56
56
  * still states its headline figures, which is what makes collapsing it a real option. Keep it to
57
- * one row — the body is what `children` is for. Section owns the summary text size (11 px, the
58
- * chart-text step): a `size` prop on a bare `Text` here is ignored — wrap it to opt out. */
57
+ * one row — the body is what `children` is for. A `Text` here renders at 11 (the chart-text step); wrap it to opt out. */
59
58
  summary?: ReactNode;
60
59
  /** Turns the root into a scroll anchor (`id` + `scroll-margin-top`). Inside `BasaltShell` the
61
60
  * offset is the clearance token; without a shell it also clears `PageBar`, which assumes the
@@ -1 +1 @@
1
- {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/dashboard/section.tsx"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGxD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAMpD,iGAAiG;AACjG,KAAK,aAAa,GACd,MAAM,GACN,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,aAAa,GACb,eAAe,GACf,aAAa,GACb,YAAY,GACZ,WAAW,GACX,OAAO,CAAA;AAEX,KAAK,gBAAgB,GAAG,IAAI,CAC1B,iBAAiB,EACjB,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAC5D,GACC,WAAW,GACX,eAAe,CAAC,WAAW,CAAC,GAAG;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;;;;;;;;OASG;IACH,KAAK,C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EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;uGACmG;IACnG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;8HAE0H;IAC1H,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;qCAEiC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GACzC,CACI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAClF,CAAC;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;KAC9D,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,KAAK;CAC7B,CAAC,CACL,CAAA;AA6CH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAmB,EACnB,UAAU,EACV,WAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,OAAO,EACP,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EAAE,SAAS,EACvB,GAAG,WAAW,EACf,EAAE,YAAY,+BA8Gd"}
@@ -76,15 +76,16 @@
76
76
  }
77
77
 
78
78
  /*
79
- * A bare `<Text size="xs">` summary line (argo's strength diagnostics shell: title 15 + chart-card
80
- * title 13 + summary 12 + chart ticks and legend 11 = four sizes) joins the chart text step, so the
81
- * shell stays at three: 15, 13, 11. Mantine's `Text` writes `--text-fz` inline from its `size` prop,
82
- * so no inherited custom property can reach it: this rule sets `font-size` itself, and the inline
83
- * `--text-fz` is then unused. Only a direct `Text` child is capped; a `Group` of stats keeps
84
- * the sizes its own parts ask for.
79
+ * A `Text` summary line (argo's strength diagnostics shell: title 15 + chart-card title 13 + summary
80
+ * 12 + chart ticks and legend 11 = four sizes) joins the chart text step, so the shell stays at
81
+ * three: 15, 13, 11. The cap is the `--text-fz` variable Mantine's `Text` reads for its font size,
82
+ * pinned `!important` so it outranks the inline value a `size` prop writes; a `Text` sized by the
83
+ * consumer's own CLASS sets `font-size` directly, never reads the variable, and keeps that size
84
+ * (argo's reading backlog `.facts`, 13). Only a direct `Text` child is capped; a `Group` of stats
85
+ * keeps the sizes its own parts ask for.
85
86
  */
86
87
  .summary > :global(.mantine-Text-root) {
87
- font-size: var(--vx-text-micro);
88
+ --text-fz: var(--vx-text-micro) !important;
88
89
  }
89
90
 
90
91
  /*
@@ -194,6 +194,23 @@
194
194
  }
195
195
  }
196
196
 
197
+ /* Cards of one StatGroup share ONE figure size. In the two-column phone state the last odd card spans the
198
+ * row, so its own width would size its numeral 22 against its row-mates' 16; the group's columns (a
199
+ * narrow card's size) set it for every card instead, whether or not a qualifier sits on its own line.
200
+ * `--basalt-stat-group-figure` on the group (or a wrapper) replaces that size. */
201
+ @container basalt-grid (max-width: 479.9px) {
202
+ [data-sm-cols] .body {
203
+ --basalt-stat-figure-size: var(--basalt-stat-group-figure, var(--vx-text-lg));
204
+ }
205
+ }
206
+
207
+ /* A one-column group (under 260px) has no spanning card: each keeps its own width's clamp. */
208
+ @container basalt-grid (max-width: 259.9px) {
209
+ [data-sm-cols] .body {
210
+ --basalt-stat-figure-size: clamp(var(--vx-text-lg), 8cqi, var(--vx-text-kpi));
211
+ }
212
+ }
213
+
197
214
  /* ── states ──────────────────────────────────────────────────────────────────────────────────── */
198
215
 
199
216
  /* The empty branch: one muted line in the figure's place, at the figure row's height. */
@@ -51,7 +51,12 @@ export type StatStripCell = {
51
51
  rows?: readonly StatStripRow[];
52
52
  /** Inks the value only — set it when the reading is a verdict. */
53
53
  tone?: Tone;
54
- /** Skeleton in place of the readings. */
54
+ /**
55
+ * Skeleton in place of the readings, in the loaded shape: the value bar, the `visual` slot and the
56
+ * `footer` line keep the height they have loaded. Pass the same `visual` and `footer` as at rest
57
+ * (empty data is fine): the slot is measured, never shown — a `Meter` in it draws its own loading
58
+ * rows, any other visual is covered by one skeleton.
59
+ */
55
60
  loading?: boolean;
56
61
  /** Dims the cell while placeholder data shows. */
57
62
  stale?: boolean;
@@ -67,6 +72,9 @@ export type StatStripFooterEntry = {
67
72
  * every width, as a sibling AFTER the article (outside its `aria-labelledby` region). For a key that
68
73
  * names no cell it takes the full width under the grid. */
69
74
  under?: string;
75
+ /** The shot states this entry is absent in; replaces the strip's `shotAbsent` (an entry production
76
+ * omits where the strip itself shows, e.g. a fact that needs data the empty state lacks). */
77
+ shotAbsent?: readonly StatStripShotState[];
70
78
  };
71
79
  export type StatStripProps = BasaltProps & {
72
80
  /** The strip's accessible name. */
@@ -1 +1 @@
1
- {"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQxD,uFAAuF;AACvF,KAAK,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAKvD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wFAAwF;AACxF,KAAK,kBAAkB,GACnB;IACE,IAAI,EAAE,OAAO,CAAA;IACb,qEAAqE;IACrE,MAAM,CAAC,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CAAA;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACxC,sEAAsE;IACtE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB,sGAAsG;IACtG,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAC3C,CAAA;AAyPD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,cAAc,+BAuFhB"}
@@ -1,14 +1,15 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Card, Skeleton } from "@mantine/core";
3
- import { useId } from "react";
3
+ import { useId, useRef } from "react";
4
4
  import { toErrorMessage } from "../common/errors.js";
5
+ import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
5
6
  import { cx } from "../common/props.js";
6
7
  import { RetryButton } from "../common/retry-button.js";
7
8
  import { StatusDot } from "../theme/status-dot.js";
8
9
  import { VX } from "../tokens/index.js";
9
10
  import { InfoGlyph } from "./widget-header.js";
10
11
  import classes from "./stat-strip.module.css";
11
- import { HOSTED, VisualSlotContext } from "./visual-slot.js";
12
+ import { HOSTED, HOSTED_LOADING, VisualSlotContext } from "./visual-slot.js";
12
13
  const absentAttr = (states) => states === void 0 || states.length === 0 ? {} : { "data-shot-absent": states.join(" ") };
13
14
  const EMPTY = "\u2014";
14
15
  function CellState({ state }) {
@@ -39,7 +40,7 @@ function FooterCell({
39
40
  className: under ? classes.underCell : classes.footerCell,
40
41
  "data-strip-footer-cell": entry.key,
41
42
  "data-shot": `strip-footer-${entry.key}`,
42
- ...absentAttr(shotAbsent),
43
+ ...absentAttr(entry.shotAbsent ?? shotAbsent),
43
44
  ...under && { "data-under": entry.under },
44
45
  children: entry.content
45
46
  }
@@ -54,9 +55,24 @@ function StripCell({
54
55
  const { rows, loading } = cell;
55
56
  const state = loading ? void 0 : cell.state;
56
57
  const hasHero = cell.value !== void 0 || rows === void 0;
57
- const hostSlot = !hasHero ? null : cell.tone === void 0 ? HOSTED : { tone: cell.tone };
58
- const footerEl = cell.footer !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.footer, "data-strip-footer": true, children: cell.footer });
59
- const heroEl = loading ? /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonValue, radius: "sm" }) : /* @__PURE__ */ jsxs("div", { className: classes.valueRow, children: [
58
+ const hostSlot = !hasHero ? loading ? HOSTED_LOADING : null : cell.tone === void 0 ? loading ? HOSTED_LOADING : HOSTED : { tone: cell.tone, ...loading && { loading } };
59
+ const footerEl = cell.footer !== void 0 && /* @__PURE__ */ jsxs(
60
+ "div",
61
+ {
62
+ className: cx(classes.footer, loading && classes.hold),
63
+ "data-strip-footer": true,
64
+ ...loading && { "aria-hidden": true, inert: true },
65
+ children: [
66
+ cell.footer,
67
+ loading && /* @__PURE__ */ jsx(Skeleton, { className: classes.holdSkeleton, radius: "sm" })
68
+ ]
69
+ }
70
+ );
71
+ const heroEl = loading ? cell.delta === void 0 ? /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonValue, radius: "sm" }) : /* @__PURE__ */ jsxs("div", { className: cx(classes.valueRow, classes.hold), "aria-hidden": true, inert: true, children: [
72
+ /* @__PURE__ */ jsx("span", { className: classes.value, children: cell.value ?? EMPTY }),
73
+ cell.delta,
74
+ /* @__PURE__ */ jsx(Skeleton, { className: classes.holdHero, radius: "sm" })
75
+ ] }) : /* @__PURE__ */ jsxs("div", { className: classes.valueRow, children: [
60
76
  /* @__PURE__ */ jsx(
61
77
  "span",
62
78
  {
@@ -85,31 +101,44 @@ function StripCell({
85
101
  ...state === void 0 && rows !== void 0 && { "data-strip-has-rows": "" },
86
102
  ...cell.stale && { "data-stale": "true" },
87
103
  children: [
88
- /* @__PURE__ */ jsxs("div", { className: classes.captionLine, children: [
89
- /* @__PURE__ */ jsxs("div", { className: classes.captionMain, children: [
90
- /* @__PURE__ */ jsxs("span", { className: classes.lead, children: [
91
- /* @__PURE__ */ jsx(
92
- "span",
93
- {
94
- className: classes.caption,
95
- id: captionId,
96
- title: cell.caption,
97
- "data-strip-caption": true,
98
- children: cell.caption
99
- }
100
- ),
101
- cell.info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: cell.info })
104
+ /* @__PURE__ */ jsxs("div", { className: classes.head, "data-strip-head": true, children: [
105
+ /* @__PURE__ */ jsxs("div", { className: classes.captionLine, children: [
106
+ /* @__PURE__ */ jsxs("div", { className: classes.captionMain, children: [
107
+ /* @__PURE__ */ jsxs("span", { className: classes.lead, children: [
108
+ /* @__PURE__ */ jsx(
109
+ "span",
110
+ {
111
+ className: classes.caption,
112
+ id: captionId,
113
+ title: cell.caption,
114
+ "data-strip-caption": true,
115
+ children: cell.caption
116
+ }
117
+ ),
118
+ cell.info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: cell.info })
119
+ ] }),
120
+ cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: cell.qualifier })
102
121
  ] }),
103
- cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: cell.qualifier })
122
+ cell.action !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.action, "data-strip-action": true, children: cell.action })
104
123
  ] }),
105
- cell.action !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.action, "data-strip-action": true, children: cell.action })
124
+ state !== void 0 && /* @__PURE__ */ jsx(CellState, { state }),
125
+ state === void 0 && hasHero && heroEl
106
126
  ] }),
107
- state !== void 0 && /* @__PURE__ */ jsx(CellState, { state }),
108
- state === void 0 && hasHero && heroEl,
109
- state === void 0 && cell.visual !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.visual, "data-strip-visual": true, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: hostSlot, children: cell.visual }) }),
127
+ state === void 0 && cell.visual !== void 0 && /* @__PURE__ */ jsxs(
128
+ "div",
129
+ {
130
+ className: cx(classes.visual, loading && classes.hold),
131
+ "data-strip-visual": true,
132
+ ...loading && { "aria-hidden": true, inert: true },
133
+ children: [
134
+ /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: hostSlot, children: cell.visual }),
135
+ loading && /* @__PURE__ */ jsx(Skeleton, { className: classes.holdSkeleton, radius: "sm" })
136
+ ]
137
+ }
138
+ ),
110
139
  state === void 0 && rows !== void 0 && (loading ? /* @__PURE__ */ jsx("div", { className: classes.rows, "aria-hidden": "true", children: rows.map((row) => /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRow, radius: "sm" }, row.key)) }) : /* @__PURE__ */ jsx("ul", { className: classes.rows, "data-strip-rows": true, children: rows.map((row) => /* @__PURE__ */ jsxs("li", { className: classes.row, "data-strip-row": row.key, children: [
111
140
  /* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
112
- /* @__PURE__ */ jsx("span", { className: classes.visual, children: row.visual }),
141
+ /* @__PURE__ */ jsx("span", { className: classes.visual, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: HOSTED, children: row.visual }) }),
113
142
  /* @__PURE__ */ jsx("span", { className: classes.rowValue, children: row.hideValue ? null : row.value ?? EMPTY }),
114
143
  /* @__PURE__ */ jsx("span", { children: row.delta })
115
144
  ] }, row.key)) })),
@@ -121,6 +150,34 @@ function StripCell({
121
150
  ] })
122
151
  );
123
152
  }
153
+ const DRAWN_MARK = "[data-meter-track], [data-basalt-sparkline], [data-basalt-chart]";
154
+ function alignVisuals(root) {
155
+ const rows = /* @__PURE__ */ new Map();
156
+ for (const head of root.querySelectorAll("[data-strip-head]")) {
157
+ const article = head.parentElement;
158
+ const visual = article?.querySelector("[data-strip-visual]");
159
+ const plot = visual?.querySelector(DRAWN_MARK) ?? visual?.firstElementChild;
160
+ const last = head.lastElementChild;
161
+ if (!article || !plot || !last) continue;
162
+ const { top, bottom } = head.getBoundingClientRect();
163
+ const articleTop = article.getBoundingClientRect().top;
164
+ const natural = last.getBoundingClientRect().bottom - top;
165
+ const grown = bottom - top - natural;
166
+ const key = Math.round(articleTop);
167
+ rows.set(key, [
168
+ ...rows.get(key) ?? [],
169
+ { head, natural, offset: plot.getBoundingClientRect().top - articleTop - Math.max(grown, 0) }
170
+ ]);
171
+ }
172
+ for (const cells of rows.values()) {
173
+ const target = cells.length < 2 ? 0 : Math.max(...cells.map((c) => c.offset));
174
+ for (const { head, natural, offset } of cells) {
175
+ const grow = target - offset;
176
+ const next = grow > 0.5 ? `${natural + grow}px` : "";
177
+ if (head.style.minHeight !== next) head.style.minHeight = next;
178
+ }
179
+ }
180
+ }
124
181
  function StatStrip({
125
182
  label,
126
183
  cells,
@@ -137,6 +194,43 @@ function StatStrip({
137
194
  const rest = footer?.filter((entry) => entry.under === void 0 || !keys.has(entry.under)) ?? [];
138
195
  const hasQualifier = cells.some((cell) => cell.qualifier !== void 0);
139
196
  const hasAction = cells.some((cell) => cell.action !== void 0);
197
+ const gridRef = useRef(null);
198
+ const observerRef = useRef(null);
199
+ const watched = useRef("");
200
+ useIsomorphicLayoutEffect(() => {
201
+ const grid = gridRef.current;
202
+ if (!grid || typeof ResizeObserver === "undefined") return;
203
+ let frame = 0;
204
+ let live = true;
205
+ const schedule = () => {
206
+ cancelAnimationFrame(frame);
207
+ frame = requestAnimationFrame(() => alignVisuals(grid));
208
+ };
209
+ const observer = new ResizeObserver(schedule);
210
+ observerRef.current = observer;
211
+ void document.fonts?.ready?.then(() => {
212
+ if (live) schedule();
213
+ });
214
+ return () => {
215
+ live = false;
216
+ cancelAnimationFrame(frame);
217
+ observer.disconnect();
218
+ observerRef.current = null;
219
+ watched.current = "";
220
+ };
221
+ }, []);
222
+ useIsomorphicLayoutEffect(() => {
223
+ const grid = gridRef.current;
224
+ if (!grid) return;
225
+ alignVisuals(grid);
226
+ const observer = observerRef.current;
227
+ const key = cells.map((cell) => cell.key).join("|");
228
+ if (!observer || watched.current === key) return;
229
+ watched.current = key;
230
+ observer.disconnect();
231
+ observer.observe(grid);
232
+ for (const head of grid.querySelectorAll("[data-strip-head]")) observer.observe(head);
233
+ }, [cells, footer]);
140
234
  return /* @__PURE__ */ jsx("div", { className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
141
235
  Card.Section,
142
236
  {
@@ -150,7 +244,7 @@ function StatStrip({
150
244
  "--basalt-strip-cols-sm": mid
151
245
  },
152
246
  children: [
153
- /* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(
247
+ /* @__PURE__ */ jsx("div", { ref: gridRef, className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(
154
248
  StripCell,
155
249
  {
156
250
  cell,
@@ -66,11 +66,22 @@
66
66
  * every cell of a row (one caption line; a reserved qualifier line in a narrow cell when any cell has
67
67
  * a qualifier), so a row shares one caption top and one value baseline. Below the value each cell
68
68
  * stacks its own parts and ends at its last one. */
69
- .content > * {
69
+ /* The HEAD (caption line, qualifier, value row) is one block with its own height: a longer qualifier
70
+ * pushes only its own value down. A visual cell whose head is shorter than a sibling's visual offset
71
+ * grows its head's min-height (`alignVisuals`), so the drawn visuals of a row share one top. */
72
+ .head {
73
+ display: flex;
74
+ flex-direction: column;
75
+ min-width: 0;
76
+ }
77
+
78
+ .content > *,
79
+ .head > * {
70
80
  min-width: 0;
71
81
  }
72
82
 
73
- .content > :not(.captionLine) {
83
+ .content > :not(.head),
84
+ .head > :not(.captionLine) {
74
85
  margin-block-start: var(--vx-space-stack-sm);
75
86
  }
76
87
 
@@ -223,6 +234,44 @@
223
234
  min-width: 0;
224
235
  }
225
236
 
237
+ /* Loading keeps the slot's or footer's own box (the consumer's visual or footer, laid out as loaded) and
238
+ * hides it under a skeleton, so the cell has its loaded height. A `Meter` inside draws its own loading
239
+ * rows and so stays visible; any other visual is covered by the one skeleton bar. */
240
+ .hold {
241
+ position: relative;
242
+ visibility: hidden;
243
+ }
244
+
245
+ .hold [data-basalt-meter],
246
+ .holdSkeleton {
247
+ visibility: visible;
248
+ }
249
+
250
+ .holdSkeleton {
251
+ position: absolute;
252
+ inset-block: 0.25rem;
253
+ inset-inline-start: 0;
254
+ width: 55%;
255
+ }
256
+
257
+ /* The hero's bar: the value row's first line, as the plain skeleton. */
258
+ .holdHero {
259
+ composes: holdSkeleton;
260
+ inset-block: 0 auto;
261
+ width: 45%;
262
+ height: calc(var(--vx-text-kpi) * 1.25);
263
+ }
264
+
265
+ .visual.hold > .holdSkeleton {
266
+ inset-block-start: max(0px, calc(var(--basalt-spark-readout-h) - var(--vx-space-stack-sm)));
267
+ inset-block-end: 0;
268
+ width: 100%;
269
+ }
270
+
271
+ .hold:has([data-basalt-meter]) > .holdSkeleton {
272
+ display: none;
273
+ }
274
+
226
275
  /* A Sparkline's hover readout takes this line above its plot (`charts/sparkline.module.css`). The
227
276
  * cell's own stack gap already sits above it; the slot reserves the rest, so the chip never covers
228
277
  * the value. */
@@ -234,7 +283,6 @@
234
283
  .visual:has([data-basalt-sparkline], [data-basalt-chart]) {
235
284
  padding-top: max(0px, calc(var(--basalt-spark-readout-h) - var(--vx-space-stack-sm)));
236
285
  }
237
-
238
286
  /* The state copy keeps the cell's inset on every side: the article ends at its own last track, so the
239
287
  * foot inset (carried by the row-high slot, further down) cannot reach it. */
240
288
  .content[data-strip-has-state] {
@@ -10,6 +10,7 @@ declare const classes: {
10
10
  readonly content: string
11
11
  readonly action: string
12
12
  readonly captionLine: string
13
+ readonly head: string
13
14
  readonly captionMain: string
14
15
  readonly lead: string
15
16
  readonly caption: string
@@ -21,6 +22,9 @@ declare const classes: {
21
22
  readonly skeletonValue: string
22
23
  readonly skeletonRow: string
23
24
  readonly visual: string
25
+ readonly hold: string
26
+ readonly holdSkeleton: string
27
+ readonly holdHero: string
24
28
  readonly visualStack: string
25
29
  readonly reason: string
26
30
  readonly error: string
@@ -1,8 +1,12 @@
1
1
  import type { Tone } from '../common/props.js';
2
2
  export interface VisualSlot {
3
3
  readonly tone?: Tone;
4
+ /** The host is loading: a `Meter` in the slot draws its loading state without its own `loading`. */
5
+ readonly loading?: boolean;
4
6
  }
5
7
  /** A host with no verdict of its own: one shared object, so a provider never re-renders its readers. */
6
8
  export declare const HOSTED: VisualSlot;
9
+ /** `HOSTED` while the host loads. */
10
+ export declare const HOSTED_LOADING: VisualSlot;
7
11
  export declare const VisualSlotContext: import("react").Context<VisualSlot | null>;
8
12
  //# sourceMappingURL=visual-slot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-slot.d.ts","sourceRoot":"","sources":["../../src/dashboard/visual-slot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CACrB;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,EAAE,UAAe,CAAA;AAEpC,eAAO,MAAM,iBAAiB,4CAAyC,CAAA"}
1
+ {"version":3,"file":"visual-slot.d.ts","sourceRoot":"","sources":["../../src/dashboard/visual-slot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,oGAAoG;IACpG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,EAAE,UAAe,CAAA;AAEpC,qCAAqC;AACrC,eAAO,MAAM,cAAc,EAAE,UAA8B,CAAA;AAE3D,eAAO,MAAM,iBAAiB,4CAAyC,CAAA"}
@@ -1,7 +1,9 @@
1
1
  import { createContext } from "react";
2
2
  const HOSTED = {};
3
+ const HOSTED_LOADING = { loading: true };
3
4
  const VisualSlotContext = createContext(null);
4
5
  export {
5
6
  HOSTED,
7
+ HOSTED_LOADING,
6
8
  VisualSlotContext
7
9
  };
@@ -221,6 +221,15 @@
221
221
  min-width: 0;
222
222
  }
223
223
 
224
+ /* A `widget` tier (ChartCard) caption in `actions` — `<Text size="xs">`, 12 — joins the chart text
225
+ * step beside the plot's ticks and legend (argo's strength cards: title 13 + caption 12 + ticks 11
226
+ * + section title 15 was four sizes). The cap is the `--text-fz` variable `Text` reads, pinned
227
+ * `!important` over the inline value its `size` prop writes; other sizes (`md` figures, `sm`) are
228
+ * not touched, and a `Text` sized by a consumer class never reads the variable. */
229
+ .root[data-tier='widget'] .actions :global(.mantine-Text-root[style*='--mantine-font-size-xs']) {
230
+ --text-fz: var(--vx-text-micro) !important;
231
+ }
232
+
224
233
  /* Directly under the title row, 4px off it — 1px put it inside the title's own line box, so a
225
234
  * section with both read as a two-line heading rather than a heading plus a note. */
226
235
  .subtitle {
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # basalt-ui v2.25.0
1
+ # basalt-ui v2.27.0
2
2
  # Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
3
3
  #
4
4
  # Entry points: use the exact import specifier below; do not guess.
@@ -13,7 +13,7 @@
13
13
  # A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
14
14
 
15
15
  Package: basalt-ui
16
- Version: 2.25.0
16
+ Version: 2.27.0
17
17
 
18
18
  ## basalt-ui
19
19
  Import: import { ... } from 'basalt-ui'
@@ -385,6 +385,7 @@ Signature: ChartCard(props: ChartCardProps): ReactElement<unknown, string | JSXE
385
385
  actions?: ReactNode
386
386
  state?: ChartState
387
387
  placeholderHeight?: number | ResponsiveChartHeight | "content"
388
+ ghost?: number | "line" | "bars"
388
389
  stale?: boolean
389
390
  stateNoun?: string
390
391
  onRetry?: (() => void)