basalt-ui 2.22.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/MIGRATING.md +187 -12
- package/agent/agents/basalt-design-reviewer.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +51 -5
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +2 -1
- package/dist/charts/CartesianChart.d.ts +2 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/ChartCard.d.ts +1 -1
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +25 -15
- package/dist/charts/Sparkline.d.ts +8 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +67 -13
- package/dist/charts/band-fold.d.ts +22 -4
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +10 -2
- package/dist/charts/chart-dates.d.ts +12 -0
- package/dist/charts/chart-dates.d.ts.map +1 -0
- package/dist/charts/chart-dates.js +16 -0
- package/dist/charts/compile.d.ts +8 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +30 -21
- package/dist/charts/date-tick-format.d.ts +5 -5
- package/dist/charts/date-tick-format.d.ts.map +1 -1
- package/dist/charts/date-tick-format.js +3 -7
- package/dist/charts/labels.d.ts +7 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +28 -17
- package/dist/charts/ref-label.d.ts +17 -0
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +13 -1
- package/dist/charts/sparkline.module.css +8 -11
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +3 -1
- package/dist/charts/types.d.ts +4 -3
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +9 -5
- package/dist/cli/shot/detect.js +8 -5
- package/dist/cli/shot/playwright.d.ts +8 -0
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/playwright.js +5 -1
- package/dist/cli/shot/types.d.ts +2 -0
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/tokens-css.d.ts +5 -7
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +11 -12
- package/dist/dashboard/bar-list.d.ts +6 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +8 -0
- package/dist/dashboard/bar-list.module.css +30 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- package/dist/dashboard/meter-model.d.ts +25 -20
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +24 -12
- package/dist/dashboard/meter-parts.d.ts +1 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +39 -4
- package/dist/dashboard/meter.d.ts +14 -8
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +1 -1
- package/dist/dashboard/meter.module.css +15 -0
- package/dist/dashboard/meter.module.css.d.ts +1 -0
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +1 -1
- package/dist/dashboard/stat-card-parts.js +1 -1
- package/dist/dashboard/stat-card.module.css +25 -6
- package/dist/dashboard/stat-group.module.css +7 -0
- package/dist/dashboard/stat-strip.d.ts +15 -5
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +50 -34
- package/dist/dashboard/stat-strip.module.css +83 -61
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +0 -5
- package/dist/styles.css +18 -11
- package/dist/theme/controls.module.css +14 -0
- package/dist/theme/controls.module.css.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +10 -7
- package/dist/theme/status-verdict.d.ts.map +1 -1
- package/dist/theme/status-verdict.js +9 -1
- package/dist/tokens/palette.d.ts +7 -10
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +7 -10
- package/llms.txt +6 -4
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +55 -5
- package/src/charts/Bars.tsx +2 -1
- package/src/charts/CartesianChart.tsx +2 -0
- package/src/charts/ChartCard.tsx +32 -19
- package/src/charts/Sparkline.tsx +92 -19
- package/src/charts/band-fold.ts +25 -6
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/compile.ts +64 -23
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +43 -22
- package/src/charts/ref-label.ts +27 -0
- package/src/charts/sparkline.module.css +8 -11
- package/src/charts/state.tsx +6 -3
- package/src/charts/types.ts +4 -3
- package/src/cli/shot/capture.ts +15 -3
- package/src/cli/shot/detect.ts +9 -9
- package/src/cli/shot/playwright.ts +18 -2
- package/src/cli/shot/types.ts +2 -0
- package/src/cli/tokens-css.ts +18 -20
- package/src/dashboard/bar-list.module.css +30 -0
- package/src/dashboard/bar-list.tsx +29 -0
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/meter-model.ts +58 -41
- package/src/dashboard/meter-parts.tsx +66 -5
- package/src/dashboard/meter.module.css +15 -0
- package/src/dashboard/meter.module.css.d.ts +1 -0
- package/src/dashboard/meter.tsx +15 -11
- package/src/dashboard/query-state.tsx +1 -1
- package/src/dashboard/stat-card-parts.tsx +1 -1
- package/src/dashboard/stat-card.module.css +25 -6
- package/src/dashboard/stat-group.module.css +7 -0
- package/src/dashboard/stat-strip.module.css +83 -61
- package/src/dashboard/stat-strip.tsx +93 -54
- package/src/guard/index.ts +0 -5
- package/src/styles.css +18 -11
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +14 -8
- package/src/theme/controls.module.css +14 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +10 -7
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/palette.ts +7 -10
|
@@ -171,6 +171,11 @@
|
|
|
171
171
|
text-overflow: ellipsis;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
/* The dot + word never outgrows its cell: the word truncates (its cell carries the full text in `title`). */
|
|
175
|
+
.root[data-variant='thin'] .secondary > :first-child {
|
|
176
|
+
max-inline-size: 100%;
|
|
177
|
+
}
|
|
178
|
+
|
|
174
179
|
.root[data-variant='thin'] .secondary [data-verdict-word] {
|
|
175
180
|
min-width: 0;
|
|
176
181
|
overflow: hidden;
|
|
@@ -216,4 +221,29 @@
|
|
|
216
221
|
.root[data-variant='thin'] .secondary {
|
|
217
222
|
text-align: end;
|
|
218
223
|
}
|
|
224
|
+
|
|
225
|
+
.root[data-variant='thin'][data-secondary-align='start'] .secondary {
|
|
226
|
+
text-align: start;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/*
|
|
231
|
+
* A column of DeltaBadges: a two-column grid, the glyph in a fixed-width slot and the figure (the badge's
|
|
232
|
+
* bare text) end-aligned in a tabular slot of four characters, so "▲ 9%" and "▲13%" share both their glyph
|
|
233
|
+
* x and their right edge. A zero delta has no glyph; an empty `::before` holds its slot. Scoped here because
|
|
234
|
+
* a hero metric has no column to line up with (D33: tabular figures only in a table-like column).
|
|
235
|
+
*/
|
|
236
|
+
.secondary [data-delta] {
|
|
237
|
+
display: inline-grid;
|
|
238
|
+
grid-template-columns: 1em minmax(4ch, auto);
|
|
239
|
+
justify-items: end;
|
|
240
|
+
font-variant-numeric: tabular-nums;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.secondary [data-delta]:not(:has([data-delta-glyph]))::before {
|
|
244
|
+
content: '';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.secondary [data-delta-glyph] {
|
|
248
|
+
justify-self: center;
|
|
219
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta-badge.d.ts","sourceRoot":"","sources":["../../src/dashboard/delta-badge.tsx"],"names":[],"mappings":"AA8BA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,CAAA;IACb;;;kCAG8B;IAC9B,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,4FAA4F;IAC5F,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;gGAG4F;IAC5F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;8BAC0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAwBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAoB,EACpB,MAAsB,EACtB,SAAgB,EAChB,MAAM,EACN,YAAmB,GACpB,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"delta-badge.d.ts","sourceRoot":"","sources":["../../src/dashboard/delta-badge.tsx"],"names":[],"mappings":"AA8BA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,CAAA;IACb;;;kCAG8B;IAC9B,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,4FAA4F;IAC5F,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;gGAG4F;IAC5F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;8BAC0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAwBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAoB,EACpB,MAAsB,EACtB,SAAgB,EAChB,MAAM,EACN,YAAmB,GACpB,EAAE,eAAe,+BAmBjB"}
|
|
@@ -29,8 +29,8 @@ function DeltaBadge({
|
|
|
29
29
|
const tone = resolveTone(value, polarity);
|
|
30
30
|
const glyph = directionGlyph(value);
|
|
31
31
|
const showGlyph = withGlyph && glyph !== void 0;
|
|
32
|
-
return /* @__PURE__ */ jsxs("span", { className: classes.deltaBadge, style: { color: tone }, children: [
|
|
33
|
-
showGlyph && /* @__PURE__ */ jsx("span", { className: classes.deltaGlyph, children: glyph }),
|
|
32
|
+
return /* @__PURE__ */ jsxs("span", { className: classes.deltaBadge, style: { color: tone }, "data-delta": "", children: [
|
|
33
|
+
showGlyph && /* @__PURE__ */ jsx("span", { className: classes.deltaGlyph, "data-delta-glyph": "", children: glyph }),
|
|
34
34
|
format(value),
|
|
35
35
|
period !== void 0 && " ",
|
|
36
36
|
period !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.deltaPeriod, children: composePeriod(period, periodPrefix) })
|
|
@@ -8,8 +8,8 @@ export type MeterSegment = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
color?: string;
|
|
10
10
|
/**
|
|
11
|
-
* `'muted'`: the part takes
|
|
12
|
-
*
|
|
11
|
+
* `'muted'`: the part takes the one flat muted fill every muted part shares, a hairline seam
|
|
12
|
+
* between neighbours (never a lightness step). A `color` wins.
|
|
13
13
|
*/
|
|
14
14
|
tone?: 'muted';
|
|
15
15
|
forecast?: boolean;
|
|
@@ -19,8 +19,8 @@ export type MeterZone = {
|
|
|
19
19
|
to: number;
|
|
20
20
|
label: string;
|
|
21
21
|
/**
|
|
22
|
-
* `'muted'`: the band takes
|
|
23
|
-
*
|
|
22
|
+
* `'muted'`: the band takes the one flat muted fill every muted zone shares, a hairline gap
|
|
23
|
+
* between neighbours (never a lightness step): a non-verdict band is not a value bar. A `color` wins.
|
|
24
24
|
*/
|
|
25
25
|
tone?: 'muted';
|
|
26
26
|
/**
|
|
@@ -30,10 +30,14 @@ export type MeterZone = {
|
|
|
30
30
|
short?: string;
|
|
31
31
|
color?: string;
|
|
32
32
|
};
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A mark on the track at `at` (in the reading's units). A `label` is captioned beside it, above the
|
|
35
|
+
* track; a `caption` sits under the track, centred on the mark and clamped inside the track.
|
|
36
|
+
*/
|
|
34
37
|
export type MeterTick = {
|
|
35
38
|
at: number;
|
|
36
39
|
label?: string;
|
|
40
|
+
caption?: string;
|
|
37
41
|
};
|
|
38
42
|
/** A colour of a `stops` gradient at `at` (in the reading's units); the colour is the consumer's. */
|
|
39
43
|
type MeterStop = {
|
|
@@ -46,27 +50,23 @@ export declare const RAMP_ZONE: {
|
|
|
46
50
|
step: number;
|
|
47
51
|
solo: number;
|
|
48
52
|
};
|
|
49
|
-
export declare const RAMP_PART: {
|
|
50
|
-
lo: number;
|
|
51
|
-
step: number;
|
|
52
|
-
solo: number;
|
|
53
|
-
};
|
|
54
53
|
/** Neighbouring steps stay at least this far apart (the contrast the zone ramp always had), up to `RAMP_MAX`. */
|
|
55
54
|
export declare const RAMP_MIN_STEP = 15;
|
|
56
55
|
export declare const RAMP_MAX = 95;
|
|
57
56
|
/**
|
|
58
57
|
* Step `index` of `count`. The spread is floored at `RAMP_MIN_STEP` per step, so a ramp stays
|
|
59
|
-
* distinguishable by lightness up to six zones
|
|
58
|
+
* distinguishable by lightness up to six zones; past that the last steps clamp at
|
|
60
59
|
* `RAMP_MAX` and merge, which is the cue to group parts.
|
|
61
60
|
*/
|
|
62
61
|
export declare function rampStrength(index: number, count: number, ramp: typeof RAMP_ZONE): number;
|
|
63
|
-
/** A zone's fill: its own colour, else
|
|
62
|
+
/** A zone's fill: its own colour, else the one flat muted fill (`tone="muted"`), else its step of the line ramp. */
|
|
64
63
|
export declare function zoneFill(zone: MeterZone, index: number, count: number): string;
|
|
65
64
|
/** One tick on the track: its percent position and what it says (caption `label`, aria `text`). */
|
|
66
65
|
export type TickMark = {
|
|
67
66
|
key: string;
|
|
68
67
|
pct: number;
|
|
69
68
|
label: string | undefined;
|
|
69
|
+
caption: string | undefined;
|
|
70
70
|
text: string;
|
|
71
71
|
};
|
|
72
72
|
/** A fill on the track, as fractions (0–1) of the span, with the segment it was laid out from. */
|
|
@@ -75,6 +75,8 @@ export type Part = {
|
|
|
75
75
|
readonly size: number;
|
|
76
76
|
readonly color: string | undefined;
|
|
77
77
|
readonly forecast: boolean;
|
|
78
|
+
/** A muted part right after another muted part: a hairline seam keeps the shared fill apart. */
|
|
79
|
+
readonly seam: boolean;
|
|
78
80
|
readonly label: string;
|
|
79
81
|
/** The segment's own (normalised) amount, in the reading's units — what its caption states. */
|
|
80
82
|
readonly amount: number;
|
|
@@ -153,7 +155,7 @@ export type RowLabel = {
|
|
|
153
155
|
box: LabelBox;
|
|
154
156
|
span?: LabelBox;
|
|
155
157
|
holding?: boolean;
|
|
156
|
-
/** A tick at the track's start or end: it
|
|
158
|
+
/** A tick at the track's start or end: it keeps its place over every zone name it would touch. */
|
|
157
159
|
end?: boolean;
|
|
158
160
|
short?: LabelBox;
|
|
159
161
|
};
|
|
@@ -168,11 +170,12 @@ export type RowPlacement = {
|
|
|
168
170
|
/**
|
|
169
171
|
* Which labels of the row show, in input order. The holding zone's name claims its place first (it
|
|
170
172
|
* is the reading's verdict, so it never hides for width: it may spill past its span, shifted inside
|
|
171
|
-
* the row); the other ticks go next
|
|
172
|
-
* when it lies inside the row and its own span and
|
|
173
|
-
* name
|
|
174
|
-
*
|
|
175
|
-
*
|
|
173
|
+
* the row); the other ticks go next, then the end ticks (at the track's start or end: a scale's
|
|
174
|
+
* figures); every other zone name then shows only when it lies inside the row and its own span and
|
|
175
|
+
* clears every label already kept, trying its full name, then its `short` box, then hiding. An end
|
|
176
|
+
* figure hides only when it cannot clear the holding name, an interior tick or the other end. A tick
|
|
177
|
+
* keeps at least `gap` px (one gap step of the host's spacing) from every other label; zone names
|
|
178
|
+
* among themselves only must not touch. A hidden name is still named in the described-by text.
|
|
176
179
|
*/
|
|
177
180
|
export declare function placeRowLabels(labels: readonly RowLabel[], rowWidth: number, gap?: number): RowPlacement;
|
|
178
181
|
/** A zone band as left edge + width in percent, clipped to the track. */
|
|
@@ -231,8 +234,10 @@ export type MarkItem = {
|
|
|
231
234
|
/**
|
|
232
235
|
* Where each caption of the marks row starts (px, logical start edge), index-aligned with `items`: an
|
|
233
236
|
* anchored caption is centred on its mark and clamped inside the row, the others sit at the start (or,
|
|
234
|
-
* `edge: 'end'`, the end). `
|
|
235
|
-
*
|
|
237
|
+
* `edge: 'end'`, the end). Two captions closer than `gap` are pushed apart, in order, the least that
|
|
238
|
+
* clears them, so a caption stays as near its mark as the row allows. `null` when nothing is anchored,
|
|
239
|
+
* the row is unmeasured, a caption is wider than the row, or the captions cannot all clear each other
|
|
240
|
+
* inside the row: the row then flows and wraps instead.
|
|
236
241
|
*/
|
|
237
242
|
export declare function placeMarkCaptions(items: readonly MarkItem[], rowWidth: number, gap: number): number[] | null;
|
|
238
243
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter-model.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AACD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb;;;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AC3F,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,YAAY,EAAE,EAAE,KAAK,MAAM,KAAG,MAC/B,CAAA;AA2BjD,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAG5F;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CA8DlD;AAED,8DAA8D;AAC9D,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MACvB,CAAA;AAElD,uGAAuG;AACvG,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAEpE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,GAAG,IAAI,CAqBjB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACrD,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAQT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { clamp01, toPct } from "./scale.js";
|
|
2
2
|
const RAMP_ZONE = { lo: 15, step: 45, solo: 40 };
|
|
3
|
-
const
|
|
3
|
+
const MUTED_ZONE = 35;
|
|
4
|
+
const MUTED_PART = 65;
|
|
4
5
|
const RAMP_MIN_STEP = 15;
|
|
5
6
|
const RAMP_MAX = 95;
|
|
6
7
|
function rampStrength(index, count, ramp) {
|
|
@@ -10,8 +11,10 @@ function rampStrength(index, count, ramp) {
|
|
|
10
11
|
function rampFill(base, index, count, ramp) {
|
|
11
12
|
return `color-mix(in srgb, var(--vx-${base}) ${rampStrength(index, count, ramp)}%, transparent)`;
|
|
12
13
|
}
|
|
14
|
+
const mutedFill = (pct) => `color-mix(in srgb, var(--vx-muted) ${pct}%, transparent)`;
|
|
13
15
|
function zoneFill(zone, index, count) {
|
|
14
|
-
|
|
16
|
+
if (zone.color !== void 0) return zone.color;
|
|
17
|
+
return zone.tone === "muted" ? mutedFill(MUTED_ZONE) : rampFill("line", index, count, RAMP_ZONE);
|
|
15
18
|
}
|
|
16
19
|
function tickMarks(ticks, min, max, format) {
|
|
17
20
|
const { span } = spanOf(min, max);
|
|
@@ -21,6 +24,7 @@ function tickMarks(ticks, min, max, format) {
|
|
|
21
24
|
key: String(i),
|
|
22
25
|
pct: toPct((t.at - min) / span),
|
|
23
26
|
label: t.label,
|
|
27
|
+
caption: t.caption,
|
|
24
28
|
text: `${t.label ?? "Tick"} ${format(t.at)}`
|
|
25
29
|
}
|
|
26
30
|
] : []
|
|
@@ -61,20 +65,21 @@ function normalizeSegments(segments) {
|
|
|
61
65
|
function layoutSegments(segments, span) {
|
|
62
66
|
let cursor = 0;
|
|
63
67
|
const isMuted = (s) => s.tone === "muted" && s.color === void 0 && !s.forecast;
|
|
64
|
-
|
|
65
|
-
let muted = 0;
|
|
68
|
+
let prevMuted = false;
|
|
66
69
|
return segments.map((s) => {
|
|
67
70
|
const size = Math.max(0, Math.min(clamp01(s.value / span), 1 - cursor));
|
|
68
71
|
const forecast = s.forecast === true;
|
|
69
72
|
const part = {
|
|
70
73
|
start: cursor,
|
|
71
74
|
size,
|
|
72
|
-
color: forecast ? void 0 : isMuted(s) ?
|
|
75
|
+
color: forecast ? void 0 : isMuted(s) ? mutedFill(MUTED_PART) : s.color,
|
|
73
76
|
forecast,
|
|
77
|
+
seam: isMuted(s) && prevMuted,
|
|
74
78
|
label: s.label,
|
|
75
79
|
amount: s.value
|
|
76
80
|
};
|
|
77
81
|
cursor += size;
|
|
82
|
+
prevMuted = isMuted(s);
|
|
78
83
|
return part;
|
|
79
84
|
});
|
|
80
85
|
}
|
|
@@ -88,7 +93,7 @@ function placeRowLabels(labels, rowWidth, gap = 0) {
|
|
|
88
93
|
const short = labels.map(() => false);
|
|
89
94
|
const shift = labels.map(() => 0);
|
|
90
95
|
const kept = [];
|
|
91
|
-
const rank = (l) => l.holding ? 0 : l.
|
|
96
|
+
const rank = (l) => l.holding ? 0 : l.span ? 3 : l.end ? 2 : 1;
|
|
92
97
|
const order = labels.map((_, i) => i).toSorted((a, b) => rank(labels[a]) - rank(labels[b]));
|
|
93
98
|
const clears = (b, tick) => !kept.some(({ box: k, tick: kTick }) => {
|
|
94
99
|
const pad = tick || kTick ? gap : 0;
|
|
@@ -213,11 +218,19 @@ function placeMarkCaptions(items, rowWidth, gap) {
|
|
|
213
218
|
return Math.max(0, Math.min(rowWidth * i.pct / 100 - i.width / 2, rowWidth - i.width));
|
|
214
219
|
});
|
|
215
220
|
const order = lefts.map((_, i) => i).toSorted((a, b) => (lefts[a] ?? 0) - (lefts[b] ?? 0));
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
const widthOf = (i) => items[i]?.width ?? 0;
|
|
222
|
+
for (const [n, i] of order.entries()) {
|
|
223
|
+
const prev = order[n - 1];
|
|
224
|
+
if (prev !== void 0)
|
|
225
|
+
lefts[i] = Math.max(lefts[i] ?? 0, (lefts[prev] ?? 0) + widthOf(prev) + gap);
|
|
226
|
+
}
|
|
227
|
+
for (const [n, i] of order.toReversed().entries()) {
|
|
228
|
+
const next = order.toReversed()[n - 1];
|
|
229
|
+
const limit = next === void 0 ? rowWidth : (lefts[next] ?? 0) - gap;
|
|
230
|
+
lefts[i] = Math.min(lefts[i] ?? 0, limit - widthOf(i));
|
|
231
|
+
}
|
|
232
|
+
const first = order[0];
|
|
233
|
+
return first !== void 0 && (lefts[first] ?? 0) < -LABEL_SUBPIXEL ? null : lefts;
|
|
221
234
|
}
|
|
222
235
|
function partsFitUnder(parts, rowWidth, gap) {
|
|
223
236
|
if (rowWidth <= 0) return false;
|
|
@@ -232,7 +245,6 @@ export {
|
|
|
232
245
|
LABEL_SUBPIXEL,
|
|
233
246
|
RAMP_MAX,
|
|
234
247
|
RAMP_MIN_STEP,
|
|
235
|
-
RAMP_PART,
|
|
236
248
|
RAMP_ZONE,
|
|
237
249
|
ariaValues,
|
|
238
250
|
findHoldingZone,
|
|
@@ -13,7 +13,7 @@ export declare function MeterLoading({ label, ring, shell, }: {
|
|
|
13
13
|
}): import("react").JSX.Element;
|
|
14
14
|
export declare function MeterEmpty(props: {
|
|
15
15
|
label: string;
|
|
16
|
-
text: string;
|
|
16
|
+
text: string | undefined;
|
|
17
17
|
ring: boolean;
|
|
18
18
|
shell: Shell;
|
|
19
19
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter-parts.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAehE,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EACT,SAAS,EAMV,MAAM,eAAe,CAAA;AAKtB,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,KAAK,EAAE,aAAa,GAAG,SAAS,CAAA;IAChC,yDAAyD;IACzD,GAAG,EAAE,OAAO,CAAA;CACb,CAAA;AA0FD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb,+BAcA;
|
|
1
|
+
{"version":3,"file":"meter-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter-par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E,MAAM,CAAA;IACX,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAA;IAC7C,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,CAAA;IACvC,KAAK,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,SAAS,CAAA;IAC3D,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,CAAA;IACvC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAA;IACzB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,YAAY,EAAE,SAAS,CAAA;IACvB,UAAU,EAAE,SAAS,CAAA;IACrB,KAAK,EAAE,KAAK,CAAA;CACb,+BAwKA"}
|
|
@@ -95,11 +95,15 @@ function MeterLoading({
|
|
|
95
95
|
] })
|
|
96
96
|
] });
|
|
97
97
|
}
|
|
98
|
+
const EMPTY_READING = "\u2014";
|
|
98
99
|
function MeterEmpty(props) {
|
|
99
100
|
const { label, text, ring, shell } = props;
|
|
100
101
|
return /* @__PURE__ */ jsxs("output", { ...rootProps(shell), "aria-label": label, children: [
|
|
101
|
-
ring ? /* @__PURE__ */
|
|
102
|
-
|
|
102
|
+
ring ? /* @__PURE__ */ jsxs("span", { className: classes.ringBox, children: [
|
|
103
|
+
/* @__PURE__ */ jsx(RingSvg, {}),
|
|
104
|
+
/* @__PURE__ */ jsx("span", { className: classes.ringValue, children: EMPTY_READING })
|
|
105
|
+
] }) : /* @__PURE__ */ jsx("div", { className: classes.trackBox, children: /* @__PURE__ */ jsx("div", { className: classes.track, "data-meter-track": true }) }),
|
|
106
|
+
(!ring || text !== void 0) && /* @__PURE__ */ jsx("span", { className: classes.empty, children: text ?? EMPTY_READING })
|
|
103
107
|
] });
|
|
104
108
|
}
|
|
105
109
|
function MeterRing(props) {
|
|
@@ -375,10 +379,12 @@ function CaptionRow({ items }) {
|
|
|
375
379
|
function PartCaptions({ captions }) {
|
|
376
380
|
const rowRef = useRef(null);
|
|
377
381
|
const [under, setUnder] = useState(false);
|
|
382
|
+
const [overwide, setOverwide] = useState(false);
|
|
378
383
|
useMeasured(
|
|
379
384
|
rowRef,
|
|
380
385
|
(row) => {
|
|
381
386
|
const { widths, rowWidth, gap } = measureItems(row);
|
|
387
|
+
setOverwide(widths.some((w) => w > rowWidth));
|
|
382
388
|
const fits = partsFitUnder(
|
|
383
389
|
captions.map((c, i) => ({ startPct: c.startPct, width: widths[i] ?? 0 })),
|
|
384
390
|
rowWidth,
|
|
@@ -392,7 +398,11 @@ function PartCaptions({ captions }) {
|
|
|
392
398
|
"ul",
|
|
393
399
|
{
|
|
394
400
|
ref: rowRef,
|
|
395
|
-
className: cx(
|
|
401
|
+
className: cx(
|
|
402
|
+
classes.partCaptions,
|
|
403
|
+
under && classes.partCaptionsUnder,
|
|
404
|
+
overwide && classes.partCaptionsWrap
|
|
405
|
+
),
|
|
396
406
|
role: "list",
|
|
397
407
|
"data-meter-parts": true,
|
|
398
408
|
"data-anchored": under ? "" : void 0,
|
|
@@ -430,7 +440,21 @@ function MeterBar(props) {
|
|
|
430
440
|
const anchored = marked && start !== null;
|
|
431
441
|
const trackHidden = props.track === false && model.parts.length === 1 && props.segments === void 0 && props.target === void 0 && model.ticks.length === 0;
|
|
432
442
|
const hasParts = model.partCaptions.length > 0;
|
|
433
|
-
const
|
|
443
|
+
const zoned = zones !== void 0 && zones.length > 0;
|
|
444
|
+
const labelled = model.ticks.filter((t) => t.label !== void 0);
|
|
445
|
+
const startFigure = !compact && !zoned && props.startCaption !== null && (model.ticks.length > 0 || model.targetPct !== void 0) && !labelled.some((t) => t.pct <= 0);
|
|
446
|
+
const tickLabels = compact ? [] : [
|
|
447
|
+
...startFigure ? [
|
|
448
|
+
{
|
|
449
|
+
key: "start",
|
|
450
|
+
pct: 0,
|
|
451
|
+
label: format(min),
|
|
452
|
+
caption: void 0,
|
|
453
|
+
text: ""
|
|
454
|
+
}
|
|
455
|
+
] : [],
|
|
456
|
+
...labelled
|
|
457
|
+
];
|
|
434
458
|
const zoneLabels = compact ? [] : model.zoneLabels;
|
|
435
459
|
const describedBy = model.describedByText === null ? {} : { "aria-describedby": describedId };
|
|
436
460
|
const endOverride = props.endCaption !== void 0;
|
|
@@ -445,6 +469,15 @@ function MeterBar(props) {
|
|
|
445
469
|
...model.boundaryPct !== void 0 && { pct: model.boundaryPct }
|
|
446
470
|
}
|
|
447
471
|
] : [],
|
|
472
|
+
...compact ? [] : model.ticks.flatMap(
|
|
473
|
+
(t) => t.caption === void 0 ? [] : [
|
|
474
|
+
{
|
|
475
|
+
key: `tick${t.key}`,
|
|
476
|
+
node: glue(t.caption),
|
|
477
|
+
pct: t.pct
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
),
|
|
448
481
|
...end !== null ? [
|
|
449
482
|
{
|
|
450
483
|
key: "end",
|
|
@@ -483,6 +516,7 @@ function MeterBar(props) {
|
|
|
483
516
|
{
|
|
484
517
|
className: classes.zone,
|
|
485
518
|
"data-meter-zone": z.label,
|
|
519
|
+
...i > 0 && zones[i - 1]?.tone === "muted" && z.tone === "muted" && { "data-meter-zone-seam": "" },
|
|
486
520
|
style: zoneStyle(z, i, zones.length, min, model.span)
|
|
487
521
|
},
|
|
488
522
|
i
|
|
@@ -493,6 +527,7 @@ function MeterBar(props) {
|
|
|
493
527
|
{
|
|
494
528
|
className: cx(classes.fill, p.forecast && classes.forecastFill),
|
|
495
529
|
"data-meter-fill": p.forecast ? "forecast" : "committed",
|
|
530
|
+
...p.seam && { "data-meter-seam": "" },
|
|
496
531
|
"data-tone": props.tone === "muted" && p.color === void 0 && !p.forecast ? "muted" : void 0,
|
|
497
532
|
style: fillStyle(p)
|
|
498
533
|
},
|
|
@@ -12,7 +12,7 @@ type Common = BasaltProps & {
|
|
|
12
12
|
format?: (value: number) => string;
|
|
13
13
|
/** Renders a skeleton with the meter's footprint. */
|
|
14
14
|
loading?: boolean;
|
|
15
|
-
/** Muted line shown when there is no reading. The track stays so the footprint holds. */
|
|
15
|
+
/** Muted line shown when there is no reading; none by default (the reading is `—`). The track stays so the footprint holds. */
|
|
16
16
|
emptyText?: string;
|
|
17
17
|
};
|
|
18
18
|
type BarCommon = Common & {
|
|
@@ -21,10 +21,13 @@ type BarCommon = Common & {
|
|
|
21
21
|
target?: number;
|
|
22
22
|
/**
|
|
23
23
|
* More marks on the track (cut-offs, a window mean). Each is drawn at `at`; a `label` is captioned
|
|
24
|
-
* above the track, or on a zoned Meter in the zone-name row (the end ticks at the row's ends)
|
|
25
|
-
* caption
|
|
26
|
-
*
|
|
27
|
-
* and `target`.
|
|
24
|
+
* above the track, or on a zoned Meter in the zone-name row (the end ticks at the row's ends); a
|
|
25
|
+
* `caption` sits under the track, centred on the mark and clamped inside it. A label that would
|
|
26
|
+
* collide with another hides. A tick outside `[min, max]` is dropped, not clamped. All are listed
|
|
27
|
+
* in the accessible description. Works with `value`, `zones`, `segments` and `target`.
|
|
28
|
+
*
|
|
29
|
+
* Given `ticks` (or a `target`), a plain or segmented bar also labels where its track starts: the
|
|
30
|
+
* start figure `format(min)`, above the track. `startCaption={null}` drops it.
|
|
28
31
|
*/
|
|
29
32
|
ticks?: readonly MeterTick[];
|
|
30
33
|
/**
|
|
@@ -41,11 +44,14 @@ type BarCommon = Common & {
|
|
|
41
44
|
* Put the value beside it in your own layout.
|
|
42
45
|
*/
|
|
43
46
|
size?: 'row';
|
|
44
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Start caption (default: the formatted reading). `null` drops it, and the start figure that
|
|
49
|
+
* `ticks`/`target` add above the track; zone labels stay.
|
|
50
|
+
*/
|
|
45
51
|
startCaption?: ReactNode;
|
|
46
52
|
/**
|
|
47
|
-
* End caption (default: `Target <target
|
|
48
|
-
* when it fits). `null` drops it; zone labels stay.
|
|
53
|
+
* End caption (default: `Target <target>` with the Meter's `format`, drawn at the target's tick
|
|
54
|
+
* rather than the track end when it fits). `null` drops it; zone labels stay.
|
|
49
55
|
*/
|
|
50
56
|
endCaption?: ReactNode;
|
|
51
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAKvE,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
|
|
1
|
+
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter.tsx"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAKvE,KAAK,MAAM,GAAG,WAAW,GAAG;IAC1B,mGAAmG;IACnG,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BAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BA8CtC"}
|
package/dist/dashboard/meter.js
CHANGED
|
@@ -29,7 +29,7 @@ function Meter(props) {
|
|
|
29
29
|
const segments = props.segments === void 0 ? void 0 : normalizeSegments(props.segments);
|
|
30
30
|
const reading = segments === void 0 ? props.value : segmentReading(segments, min);
|
|
31
31
|
if (!isReading(reading) || segments?.length === 0) {
|
|
32
|
-
return /* @__PURE__ */ jsx(MeterEmpty, { label, text: props.emptyText
|
|
32
|
+
return /* @__PURE__ */ jsx(MeterEmpty, { label, text: props.emptyText, ring, shell });
|
|
33
33
|
}
|
|
34
34
|
if (props.shape === "ring") {
|
|
35
35
|
return /* @__PURE__ */ jsx(
|
|
@@ -62,6 +62,12 @@
|
|
|
62
62
|
background: color-mix(in srgb, var(--vx-muted) 65%, transparent);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/* Muted parts share one flat fill: a track-coloured hairline at the shared edge tells them apart. */
|
|
66
|
+
.fill[data-meter-seam] {
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
border-inline-start: 1px solid var(--vx-surface-subtle);
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
/* The committed/forecast pair: the same neutral at two strengths. Flat, never hatched. */
|
|
66
72
|
.forecastFill {
|
|
67
73
|
background: color-mix(in srgb, var(--vx-line) 45%, transparent);
|
|
@@ -235,11 +241,20 @@
|
|
|
235
241
|
color: var(--vx-muted);
|
|
236
242
|
}
|
|
237
243
|
|
|
244
|
+
/* An entry is one line: swatch, name and value never break apart; the row wraps between entries. */
|
|
238
245
|
.partCaption {
|
|
239
246
|
display: inline-flex;
|
|
247
|
+
flex: none;
|
|
240
248
|
align-items: baseline;
|
|
241
249
|
gap: var(--vx-space-control-gap, 0.375rem);
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* Only an entry wider than the whole row may break (measured), so nothing overflows the card. */
|
|
254
|
+
.partCaptionsWrap > .partCaption {
|
|
255
|
+
flex: 0 1 auto;
|
|
242
256
|
min-width: 0;
|
|
257
|
+
white-space: normal;
|
|
243
258
|
overflow-wrap: anywhere;
|
|
244
259
|
}
|
|
245
260
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-state.d.ts","sourceRoot":"","sources":["../../src/dashboard/query-state.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAA;AAE/C;;;;;GAKG;AACH,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAID,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,gDAAgD;IAChD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAiB,EACjB,SAAS,EACT,KAAK,GACN,EAAE,iBAAiB,GAAG,SAAS,CAuB/B;AAID,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,kFAAkF;IAClF,KAAK,EAAE,OAAO,CAAA;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE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IAAI,EAAE,KAAK,KAAK,OAAwB,GACjD,WAAW,CAAC,KAAK,CAAC,CASpB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAEnC,MAAM,MAAM,eAAe,CAAC,KAAK,IAAI,WAAW,GAC9C,eAAe,CAAC,cAAc,CAAC,GAAG;IAChC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;IAC5B,wFAAwF;IACxF,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAA;IAClD,uDAAuD;IACvD,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAA;IAClC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uDAAuD;IACvD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,kDAAkD;IAClD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,EAChC,KAAK,EACL,QAAQ,EACR,KAAK,EACL,OAAO,EACP,UAA6B,EAC7B,aAAqC,EACrC,WAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,SAAS,CAqEpC"}
|
|
@@ -29,7 +29,7 @@ function CaptionRow({ title, icon, info, qualifier, tone, actions }) {
|
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
] }),
|
|
32
|
-
qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, title: qualifier, children: qualifier })
|
|
32
|
+
qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, title: qualifier, "data-stat-qualifier": true, children: qualifier })
|
|
33
33
|
] }),
|
|
34
34
|
actions !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.actions, "data-basalt-hit-scope": true, children: /* @__PURE__ */ jsx(CtlSlot, { tier: "widget", children: actions }) })
|
|
35
35
|
] });
|
|
@@ -96,20 +96,39 @@
|
|
|
96
96
|
min-width: 0;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
/* A card too narrow to share its caption row (a two-column phone cell, ~170px)
|
|
100
|
-
*
|
|
101
|
-
*
|
|
99
|
+
/* A card too narrow to share its caption row (a two-column phone cell, ~170px): the qualifier is ALWAYS
|
|
100
|
+
* on its own line under the caption, and a card with one (or a StatGroup row-mate's) reserves that line, so the values of one StatGroup
|
|
101
|
+
* row share a baseline whether or not a sibling has a qualifier. The caption keeps the whole first
|
|
102
|
+
* line (it truncates, with its `title`, only when it alone does not fit); the qualifier is one line
|
|
103
|
+
* too (it truncates with its `title` only when it alone does not fit THAT line). */
|
|
102
104
|
@container basalt-card (max-width: 239.9px) {
|
|
105
|
+
.captionMain:has(> .qualifier) {
|
|
106
|
+
--basalt-stat-qualifier-reserve: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
103
109
|
.captionMain {
|
|
104
|
-
|
|
110
|
+
/* 1 when this card has a qualifier or a StatGroup sibling does (`stat-group.module.css`), else 0:
|
|
111
|
+
* a card nobody shares a row with a qualifier to reserves nothing. */
|
|
112
|
+
--basalt-stat-qualifier-h: calc(
|
|
113
|
+
var(--vx-text-micro) * 1.4 * var(--basalt-stat-qualifier-reserve, 0)
|
|
114
|
+
);
|
|
115
|
+
align-content: flex-start;
|
|
116
|
+
min-height: calc(
|
|
117
|
+
var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1) +
|
|
118
|
+
var(--basalt-stat-qualifier-h)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.lead {
|
|
123
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
105
124
|
}
|
|
106
125
|
|
|
107
126
|
.qualifier {
|
|
108
|
-
flex: 0
|
|
127
|
+
flex: 0 0 100%;
|
|
109
128
|
overflow: hidden;
|
|
110
129
|
text-overflow: ellipsis;
|
|
111
130
|
white-space: nowrap;
|
|
112
|
-
|
|
131
|
+
line-height: 1.4;
|
|
113
132
|
}
|
|
114
133
|
}
|
|
115
134
|
|