basalt-ui 2.23.0 → 2.24.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 +41 -0
- package/MIGRATING.md +225 -12
- package/agent/agents/basalt-design-reviewer.md +2 -2
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/skills/basalt-design/references/catalogue.md +22 -19
- package/agent/skills/basalt-design/references/states.md +39 -0
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +17 -2
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +7 -3
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +32 -6
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/StackedArea.js +5 -1
- package/dist/charts/chart-legend.module.css +16 -0
- package/dist/charts/compile.d.ts +2 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +47 -3
- package/dist/charts/legend.d.ts +0 -6
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +87 -35
- package/dist/charts/sparkline.module.css +59 -6
- package/dist/charts/sparkline.module.css.d.ts +1 -0
- package/dist/charts/state.js +1 -1
- package/dist/charts/types.d.ts +11 -0
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +19 -23
- package/dist/dashboard/bar-list.module.css +3 -15
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/meter-model.d.ts +30 -1
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +74 -5
- package/dist/dashboard/meter-parts.d.ts +8 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +64 -21
- package/dist/dashboard/meter.d.ts +8 -1
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +14 -3
- package/dist/dashboard/meter.module.css +42 -2
- package/dist/dashboard/meter.module.css.d.ts +4 -0
- package/dist/dashboard/query-state.d.ts +7 -3
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +14 -6
- package/dist/dashboard/section.d.ts +2 -1
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.module.css +12 -0
- package/dist/dashboard/settings-section.d.ts +1 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +3 -3
- package/dist/dashboard/stat-card.module.css +24 -10
- package/dist/dashboard/stat-group.module.css +8 -0
- package/dist/dashboard/stat-strip.d.ts +3 -2
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +83 -73
- package/dist/dashboard/stat-strip.module.css +22 -38
- package/dist/dashboard/stat-strip.module.css.d.ts +1 -0
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +19 -1
- package/dist/dashboard/widget-header.module.css +6 -0
- package/dist/guard/index.d.ts +2 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +1 -12
- package/dist/table/data-table.js +1 -1
- package/dist/theme/controls.module.css +7 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +7 -5
- package/dist/tokens/palette.d.ts +2 -2
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +2 -2
- package/llms.txt +3 -2
- package/package.json +1 -1
- package/src/charts/Bars.tsx +29 -2
- package/src/charts/CartesianChart.tsx +7 -3
- package/src/charts/Sparkline.tsx +66 -21
- package/src/charts/StackedArea.tsx +12 -1
- package/src/charts/chart-legend.module.css +16 -0
- package/src/charts/compile.ts +84 -2
- package/src/charts/legend.tsx +70 -3
- package/src/charts/sparkline.module.css +59 -6
- package/src/charts/sparkline.module.css.d.ts +1 -0
- package/src/charts/state.tsx +1 -1
- package/src/charts/types.ts +9 -0
- package/src/cli/shot/measure.ts +27 -27
- package/src/dashboard/bar-list.module.css +3 -15
- package/src/dashboard/empty-state.tsx +4 -2
- package/src/dashboard/meter-model.ts +124 -7
- package/src/dashboard/meter-parts.tsx +127 -31
- package/src/dashboard/meter.module.css +42 -2
- package/src/dashboard/meter.module.css.d.ts +4 -0
- package/src/dashboard/meter.tsx +22 -3
- package/src/dashboard/query-state.tsx +19 -8
- package/src/dashboard/section.module.css +12 -0
- package/src/dashboard/section.tsx +2 -1
- package/src/dashboard/settings-section.tsx +4 -4
- package/src/dashboard/stat-card.module.css +24 -10
- package/src/dashboard/stat-group.module.css +8 -0
- package/src/dashboard/stat-strip.module.css +22 -38
- package/src/dashboard/stat-strip.module.css.d.ts +1 -0
- package/src/dashboard/stat-strip.tsx +63 -43
- package/src/dashboard/widget-header.module.css +6 -0
- package/src/dashboard/widget-header.tsx +28 -1
- package/src/guard/index.ts +3 -14
- package/src/table/data-table.tsx +1 -1
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +6 -6
- package/src/theme/controls.module.css +7 -2
- package/src/theme/index.ts +7 -5
- package/src/tokens/palette.ts +2 -2
package/dist/dashboard/meter.js
CHANGED
|
@@ -25,11 +25,21 @@ function Meter(props) {
|
|
|
25
25
|
warnInvalidTrack(min, max);
|
|
26
26
|
const hostTone = useContext(VisualSlotContext)?.tone;
|
|
27
27
|
const hostColor = hostTone === void 0 ? void 0 : VX.status[hostTone];
|
|
28
|
-
if (props.loading === true)
|
|
28
|
+
if (props.loading === true)
|
|
29
|
+
return /* @__PURE__ */ jsx(MeterLoading, { label, ring, zoned: props.zones !== void 0, shell });
|
|
29
30
|
const segments = props.segments === void 0 ? void 0 : normalizeSegments(props.segments);
|
|
30
31
|
const reading = segments === void 0 ? props.value : segmentReading(segments, min);
|
|
31
32
|
if (!isReading(reading) || segments?.length === 0) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
MeterEmpty,
|
|
35
|
+
{
|
|
36
|
+
label,
|
|
37
|
+
text: props.emptyText,
|
|
38
|
+
ring,
|
|
39
|
+
zoned: props.zones !== void 0,
|
|
40
|
+
shell
|
|
41
|
+
}
|
|
42
|
+
);
|
|
33
43
|
}
|
|
34
44
|
if (props.shape === "ring") {
|
|
35
45
|
return /* @__PURE__ */ jsx(
|
|
@@ -58,7 +68,8 @@ function Meter(props) {
|
|
|
58
68
|
tone: barTone(props.tone, plain),
|
|
59
69
|
forecastCaption: props.segments === void 0 ? void 0 : props.forecastCaption,
|
|
60
70
|
startCaption: props.startCaption,
|
|
61
|
-
endCaption: props.endCaption
|
|
71
|
+
endCaption: props.endCaption,
|
|
72
|
+
readingAt: props.readingAt
|
|
62
73
|
}
|
|
63
74
|
);
|
|
64
75
|
}
|
|
@@ -206,6 +206,14 @@
|
|
|
206
206
|
white-space: nowrap;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
/* `text-wrap` sets the same longhand as `white-space: nowrap`: `.caption`'s `balance`, declared below,
|
|
210
|
+
* would win on source order and let a caption placed at its measured width wrap on a sub-pixel
|
|
211
|
+
* difference. One class more outranks it. */
|
|
212
|
+
.captionsAnchored > :is(.caption) {
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
text-wrap: nowrap;
|
|
215
|
+
}
|
|
216
|
+
|
|
209
217
|
/* Captions never truncate: the row wraps, and a caption wider than the row wraps inside itself. */
|
|
210
218
|
.caption {
|
|
211
219
|
min-width: 0;
|
|
@@ -220,6 +228,19 @@
|
|
|
220
228
|
text-align: end;
|
|
221
229
|
}
|
|
222
230
|
|
|
231
|
+
/* The target figure is one line: it never wraps (the row drops other captions first). A consumer's
|
|
232
|
+
* own end caption is prose and may still wrap. */
|
|
233
|
+
.captionTarget {
|
|
234
|
+
composes: captionEnd;
|
|
235
|
+
flex: none;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* A caption the row has no room for: still laid out (so a resize can measure it again), not shown. */
|
|
240
|
+
.captionsAnchored > [data-hidden] {
|
|
241
|
+
visibility: hidden;
|
|
242
|
+
}
|
|
243
|
+
|
|
223
244
|
/* The visually-hidden summary and loading text are still text: they read the caption size, not the
|
|
224
245
|
* body size they would inherit. */
|
|
225
246
|
.root .summary {
|
|
@@ -250,6 +271,12 @@
|
|
|
250
271
|
white-space: nowrap;
|
|
251
272
|
}
|
|
252
273
|
|
|
274
|
+
/* Not every entry fits one row: a grid with the measured column count, never one entry alone. */
|
|
275
|
+
.partCaptionsGrid {
|
|
276
|
+
display: grid;
|
|
277
|
+
justify-content: start;
|
|
278
|
+
}
|
|
279
|
+
|
|
253
280
|
/* Only an entry wider than the whole row may break (measured), so nothing overflows the card. */
|
|
254
281
|
.partCaptionsWrap > .partCaption {
|
|
255
282
|
flex: 0 1 auto;
|
|
@@ -285,7 +312,20 @@
|
|
|
285
312
|
color: var(--vx-muted);
|
|
286
313
|
}
|
|
287
314
|
|
|
288
|
-
/*
|
|
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. */
|
|
317
|
+
.line {
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
height: 1lh;
|
|
321
|
+
font-size: var(--basalt-meter-caption);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.lineZoned {
|
|
325
|
+
height: 1.25em;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* The skeleton holds the loaded footprint: figure row (zoned), track, caption / zone-name row. */
|
|
289
329
|
.skeletonTrack {
|
|
290
330
|
height: 0.375rem;
|
|
291
331
|
}
|
|
@@ -370,6 +410,6 @@
|
|
|
370
410
|
height: 1lh;
|
|
371
411
|
}
|
|
372
412
|
|
|
373
|
-
.row .
|
|
413
|
+
.row .line {
|
|
374
414
|
display: none;
|
|
375
415
|
}
|
|
@@ -23,13 +23,17 @@ declare const classes: {
|
|
|
23
23
|
readonly captions: string
|
|
24
24
|
readonly caption: string
|
|
25
25
|
readonly captionEnd: string
|
|
26
|
+
readonly captionTarget: string
|
|
26
27
|
readonly captionsAnchored: string
|
|
27
28
|
readonly partCaptions: string
|
|
28
29
|
readonly partCaption: string
|
|
29
30
|
readonly partCaptionsUnder: string
|
|
30
31
|
readonly partCaptionsWrap: string
|
|
32
|
+
readonly partCaptionsGrid: string
|
|
31
33
|
readonly swatch: string
|
|
32
34
|
readonly empty: string
|
|
35
|
+
readonly line: string
|
|
36
|
+
readonly lineZoned: string
|
|
33
37
|
readonly skeletonTrack: string
|
|
34
38
|
readonly skeletonCaption: string
|
|
35
39
|
readonly ringBox: string
|
|
@@ -30,10 +30,14 @@ export type QueryEmptyCopy = {
|
|
|
30
30
|
export type LoadingStateProps = BasaltProps & {
|
|
31
31
|
/** How loud this state is. Default `'page'`. */
|
|
32
32
|
tier?: QueryStateTier;
|
|
33
|
-
/** Accessible name for the
|
|
33
|
+
/** Accessible name for the loading state. Say what is loading. */
|
|
34
34
|
label?: string;
|
|
35
35
|
};
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* `tier="page"` centres a neutral spinner in a generous block (a route body whose shape is unknown);
|
|
38
|
+
* `'section'` is a neutral skeleton, never an accent spinner. A card region that knows its loaded
|
|
39
|
+
* shape passes `loading` to `QueryState` instead.
|
|
40
|
+
*/
|
|
37
41
|
export declare function LoadingState({ tier, label, className, style, }: LoadingStateProps): ReactNode;
|
|
38
42
|
export type ErrorStateProps = BasaltProps & {
|
|
39
43
|
/** Whatever was thrown — the raw Eden/fetch envelope is fine, it gets decoded. */
|
|
@@ -117,7 +121,7 @@ export type QueryStateProps<TData> = BasaltProps & SlotStylesProps<QueryStateSlo
|
|
|
117
121
|
errorAction?: ReactNode;
|
|
118
122
|
/** How loud every branch is. Default `'page'`. */
|
|
119
123
|
tier?: QueryStateTier;
|
|
120
|
-
/** Replace the default
|
|
124
|
+
/** Replace the default loading state (e.g. with a skeleton in the region's loaded shape). */
|
|
121
125
|
loading?: ReactNode;
|
|
122
126
|
};
|
|
123
127
|
/**
|
|
@@ -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,
|
|
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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;;;;;;;;;;;;;;;;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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Center, Group, Loader, Stack, Text } from "@mantine/core";
|
|
2
|
+
import { Center, Group, Loader, Skeleton, Stack, Text, VisuallyHidden } from "@mantine/core";
|
|
3
3
|
import { toErrorMessage } from "../common/errors.js";
|
|
4
4
|
import { cx } from "../common/props.js";
|
|
5
5
|
import { RetryButton } from "../common/retry-button.js";
|
|
@@ -15,13 +15,21 @@ function LoadingState({
|
|
|
15
15
|
}) {
|
|
16
16
|
const resolved = tier ?? "page";
|
|
17
17
|
if (resolved === "section") {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
Stack,
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
component: "output",
|
|
22
|
+
gap: "xs",
|
|
22
23
|
"aria-label": label,
|
|
24
|
+
"aria-busy": "true",
|
|
23
25
|
...className !== void 0 && { className },
|
|
24
|
-
...style !== void 0 && { style }
|
|
26
|
+
...style !== void 0 && { style },
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: label }),
|
|
29
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 14, width: "40%" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 14 }),
|
|
31
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 14, width: "75%" })
|
|
32
|
+
]
|
|
25
33
|
}
|
|
26
34
|
);
|
|
27
35
|
}
|
|
@@ -30,7 +38,7 @@ function LoadingState({
|
|
|
30
38
|
{
|
|
31
39
|
...className !== void 0 && { className },
|
|
32
40
|
style: { paddingBlock: "calc(var(--vx-space-stack-xs, 0.25rem) * 16)", ...style },
|
|
33
|
-
children: /* @__PURE__ */ jsx(Loader, { size: "sm", "aria-label": label })
|
|
41
|
+
children: /* @__PURE__ */ jsx(Loader, { size: "sm", color: VX.muted, "aria-label": label })
|
|
34
42
|
}
|
|
35
43
|
);
|
|
36
44
|
}
|
|
@@ -54,7 +54,8 @@ 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.
|
|
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. */
|
|
58
59
|
summary?: ReactNode;
|
|
59
60
|
/** Turns the root into a scroll anchor (`id` + `scroll-margin-top`). Inside `BasaltShell` the
|
|
60
61
|
* 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,WA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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"}
|
|
@@ -75,6 +75,18 @@
|
|
|
75
75
|
gap: var(--mantine-spacing-xs, 0.625rem);
|
|
76
76
|
}
|
|
77
77
|
|
|
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.
|
|
85
|
+
*/
|
|
86
|
+
.summary > :global(.mantine-Text-root) {
|
|
87
|
+
font-size: var(--vx-text-micro);
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
/*
|
|
79
91
|
* The collapse chevron — a plain control, not a Mantine ActionIcon, so it sits directly in the header
|
|
80
92
|
* row (its own CtlSlot fragment would nest a theme provider around one glyph). It is sized to the
|
|
@@ -23,7 +23,7 @@ export type SettingsRowSlot = 'root' | 'label' | 'control';
|
|
|
23
23
|
export type SettingsRowProps = BasaltProps & SlotStylesProps<SettingsRowSlot> & {
|
|
24
24
|
/** 13px ink label on the left. */
|
|
25
25
|
label: string;
|
|
26
|
-
/** Optional
|
|
26
|
+
/** Optional 12px muted description under the label. */
|
|
27
27
|
description?: string;
|
|
28
28
|
/** Right-aligned control (input/switch/button). */
|
|
29
29
|
control?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/dashboard/settings-section.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAYnE,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAC5C,eAAe,CAAC,mBAAmB,CAAC,GACpC,sBAAsB,GAAG;IACvB,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,oBAAoB,+BAgBtB;AAED,gEAAgE;AAChE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAE1D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GACxC,eAAe,CAAC,eAAe,CAAC,GAAG;IACjC,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EACT,KAAK,EACL,UAAU,GACX,EAAE,gBAAgB,+BAelB;AAED,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAElD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,eAAe,+BAuBjB"}
|
|
@@ -7,7 +7,7 @@ import { cx } from "../common/props.js";
|
|
|
7
7
|
import classes from "./settings-section.module.css";
|
|
8
8
|
const eyebrowStyle = {
|
|
9
9
|
fontFamily: "var(--basalt-font-mono)",
|
|
10
|
-
fontSize: VX.text.
|
|
10
|
+
fontSize: VX.text.xs,
|
|
11
11
|
fontWeight: 500,
|
|
12
12
|
letterSpacing: "0.06em",
|
|
13
13
|
textTransform: "uppercase",
|
|
@@ -55,8 +55,8 @@ function SettingsRow({
|
|
|
55
55
|
...style !== void 0 && { style },
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ jsxs(Stack, { gap: 2, ...classNames?.label !== void 0 && { className: classNames.label }, children: [
|
|
58
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: VX.text.
|
|
59
|
-
description && /* @__PURE__ */ jsx("span", { style: { fontSize: VX.text.
|
|
58
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: VX.text.sm, color: VX.ink }, children: label }),
|
|
59
|
+
description && /* @__PURE__ */ jsx("span", { style: { fontSize: VX.text.xs, color: VX.muted }, children: description })
|
|
60
60
|
] }),
|
|
61
61
|
/* @__PURE__ */ jsx("div", { className: cx(classes.control, classNames?.control), children: control ?? children })
|
|
62
62
|
]
|
|
@@ -96,11 +96,11 @@
|
|
|
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): the qualifier
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
99
|
+
/* A card too narrow to share its caption row (a two-column phone cell, ~170px): the qualifier takes its
|
|
100
|
+
* own line under the caption, where it wraps again rather than truncating (a qualifier can be the only place
|
|
101
|
+
* a band is stated). A card without one reserves the line when a StatGroup row-mate has one, so the values of
|
|
102
|
+
* one StatGroup row share a baseline. The caption keeps its line (it truncates, with
|
|
103
|
+
* its `title`, only when it alone does not fit). */
|
|
104
104
|
@container basalt-card (max-width: 239.9px) {
|
|
105
105
|
.captionMain:has(> .qualifier) {
|
|
106
106
|
--basalt-stat-qualifier-reserve: 1;
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
var(--vx-text-micro) * 1.4 * var(--basalt-stat-qualifier-reserve, 0)
|
|
114
114
|
);
|
|
115
115
|
align-content: flex-start;
|
|
116
|
+
justify-content: flex-start;
|
|
116
117
|
min-height: calc(
|
|
117
118
|
var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1) +
|
|
118
119
|
var(--basalt-stat-qualifier-h)
|
|
@@ -123,12 +124,11 @@
|
|
|
123
124
|
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
/* Always its own line: siblings of one group never place it differently (beside, or under). */
|
|
126
128
|
.qualifier {
|
|
127
|
-
flex:
|
|
128
|
-
overflow: hidden;
|
|
129
|
-
text-overflow: ellipsis;
|
|
130
|
-
white-space: nowrap;
|
|
129
|
+
flex-basis: 100%;
|
|
131
130
|
line-height: 1.4;
|
|
131
|
+
text-wrap: balance;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -252,8 +252,14 @@
|
|
|
252
252
|
gap: var(--basalt-stat-foot-gap);
|
|
253
253
|
margin-top: auto;
|
|
254
254
|
min-width: 0;
|
|
255
|
+
/* The sparkline slot's readout reserve (`.sparklineBleed`): the readout line less the card gap above. */
|
|
256
|
+
--basalt-spark-readout-reserve: max(
|
|
257
|
+
0px,
|
|
258
|
+
calc(var(--basalt-spark-readout-h) - var(--vx-space-stat-card-gap))
|
|
259
|
+
);
|
|
255
260
|
min-height: calc(
|
|
256
|
-
var(--basalt-stat-visual-h) + var(--basalt-
|
|
261
|
+
var(--basalt-stat-visual-h) + var(--basalt-spark-readout-reserve) +
|
|
262
|
+
var(--basalt-stat-foot-gap) + var(--basalt-stat-footer-h)
|
|
257
263
|
);
|
|
258
264
|
}
|
|
259
265
|
|
|
@@ -382,6 +388,14 @@
|
|
|
382
388
|
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
383
389
|
}
|
|
384
390
|
|
|
391
|
+
/* A Sparkline's readout line (`--basalt-spark-readout-h`) above its plot: the card gap already sits
|
|
392
|
+
* above the slot, the slot reserves the rest, so the chip never covers the delta or qualifier row.
|
|
393
|
+
* `.foot` reserves the same, so a card with a sparkline and one without keep the same height. */
|
|
394
|
+
.sparklineBleed:has([data-basalt-sparkline]) {
|
|
395
|
+
box-sizing: content-box;
|
|
396
|
+
padding-top: var(--basalt-spark-readout-reserve);
|
|
397
|
+
}
|
|
398
|
+
|
|
385
399
|
/* A Meter in the visual slot is a block, not a chart: it sizes to its content and keeps the card's
|
|
386
400
|
* inline inset instead of the sparkline's fixed 22px and side bleed. */
|
|
387
401
|
.sparklineBleed:has(> [data-basalt-meter]) {
|
|
@@ -63,6 +63,14 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/* An odd count never leaves one cell alone on a half-empty row: below 480px (two columns) the last
|
|
67
|
+
* odd cell spans the row, as the strip's does. */
|
|
68
|
+
@container basalt-grid (max-width: 479.9px) {
|
|
69
|
+
.root > *:last-child:nth-child(odd) {
|
|
70
|
+
grid-column: 1 / -1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
@container basalt-grid (min-width: 800px) {
|
|
67
75
|
.root {
|
|
68
76
|
grid-template-columns: repeat(var(--basalt-stat-group-cols-sm), minmax(0, 1fr));
|
|
@@ -63,8 +63,9 @@ export type StatStripCell = {
|
|
|
63
63
|
export type StatStripFooterEntry = {
|
|
64
64
|
key: string;
|
|
65
65
|
content: ReactNode;
|
|
66
|
-
/** The `key` of the cell this entry qualifies
|
|
67
|
-
*
|
|
66
|
+
/** The `key` of the cell this entry qualifies: it renders inside that cell, under its content, at
|
|
67
|
+
* every width, as a sibling AFTER the article (outside its `aria-labelledby` region). For a key that
|
|
68
|
+
* names no cell it takes the full width under the grid. */
|
|
68
69
|
under?: string;
|
|
69
70
|
};
|
|
70
71
|
export type StatStripProps = BasaltProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"
|
|
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,EAAE,MAAM,CAAA;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAA;IACb,wDAAwD;IACxD,KAAK,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AK,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;AA6KD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,cAAc,+BA8ChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Card, Skeleton } from "@mantine/core";
|
|
3
3
|
import { useId } from "react";
|
|
4
4
|
import { toErrorMessage } from "../common/errors.js";
|
|
@@ -13,10 +13,10 @@ const absentAttr = (states) => states === void 0 || states.length === 0 ? {} : {
|
|
|
13
13
|
const EMPTY = "\u2014";
|
|
14
14
|
function CellState({ state }) {
|
|
15
15
|
if (state.kind === "empty") {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (state.reason !== void 0) {
|
|
17
|
+
return /* @__PURE__ */ jsx("p", { className: classes.reason, "data-strip-reason": true, children: state.reason });
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx("div", { className: classes.valueRow, children: /* @__PURE__ */ jsx("span", { className: classes.value, "data-strip-value": true, children: EMPTY }) });
|
|
20
20
|
}
|
|
21
21
|
const message = toErrorMessage(state.error, "The request failed.");
|
|
22
22
|
return /* @__PURE__ */ jsxs("div", { className: classes.error, role: "alert", "data-strip-state": "error", children: [
|
|
@@ -28,9 +28,27 @@ function CellState({ state }) {
|
|
|
28
28
|
state.onRetry !== void 0 && /* @__PURE__ */ jsx(RetryButton, { onClick: state.onRetry, retrying: state.retrying ?? false })
|
|
29
29
|
] });
|
|
30
30
|
}
|
|
31
|
+
function FooterCell({
|
|
32
|
+
entry,
|
|
33
|
+
shotAbsent,
|
|
34
|
+
under
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: under ? classes.underCell : classes.footerCell,
|
|
40
|
+
"data-strip-footer-cell": entry.key,
|
|
41
|
+
"data-shot": `strip-footer-${entry.key}`,
|
|
42
|
+
...absentAttr(shotAbsent),
|
|
43
|
+
...under && { "data-under": entry.under },
|
|
44
|
+
children: entry.content
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
31
48
|
function StripCell({
|
|
32
49
|
cell,
|
|
33
|
-
shotAbsent
|
|
50
|
+
shotAbsent,
|
|
51
|
+
under
|
|
34
52
|
}) {
|
|
35
53
|
const captionId = useId();
|
|
36
54
|
const { rows, loading } = cell;
|
|
@@ -53,51 +71,54 @@ function StripCell({
|
|
|
53
71
|
] });
|
|
54
72
|
return (
|
|
55
73
|
// The slot owns the dividers and runs the row; the article inside ends at its content.
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */ jsxs("div", { className: classes.
|
|
71
|
-
/* @__PURE__ */ jsxs("
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: classes.cell, "data-strip-slot": true, children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(
|
|
76
|
+
"article",
|
|
77
|
+
{
|
|
78
|
+
className: classes.content,
|
|
79
|
+
"data-strip-cell": cell.key,
|
|
80
|
+
"data-shot": `strip-${cell.key}`,
|
|
81
|
+
"aria-labelledby": captionId,
|
|
82
|
+
...absentAttr(cell.shotAbsent ?? shotAbsent),
|
|
83
|
+
...state !== void 0 && { "data-strip-has-state": "" },
|
|
84
|
+
...state === void 0 && cell.visual !== void 0 && { "data-strip-has-visual": "" },
|
|
85
|
+
...state === void 0 && rows !== void 0 && { "data-strip-has-rows": "" },
|
|
86
|
+
...cell.stale && { "data-stale": "true" },
|
|
87
|
+
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 })
|
|
102
|
+
] }),
|
|
103
|
+
cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: cell.qualifier })
|
|
83
104
|
] }),
|
|
84
|
-
cell.
|
|
105
|
+
cell.action !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.action, "data-strip-action": true, children: cell.action })
|
|
85
106
|
] }),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
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 }) }),
|
|
110
|
+
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
|
+
/* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
|
|
112
|
+
/* @__PURE__ */ jsx("span", { className: classes.visual, children: row.visual }),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: classes.rowValue, children: row.hideValue ? null : row.value ?? EMPTY }),
|
|
114
|
+
/* @__PURE__ */ jsx("span", { children: row.delta })
|
|
115
|
+
] }, row.key)) })),
|
|
116
|
+
state === void 0 && footerEl
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
under.map((entry) => /* @__PURE__ */ jsx(FooterCell, { entry, shotAbsent, under: true }, entry.key))
|
|
121
|
+
] })
|
|
101
122
|
);
|
|
102
123
|
}
|
|
103
124
|
function StatStrip({
|
|
@@ -111,13 +132,11 @@ function StatStrip({
|
|
|
111
132
|
}) {
|
|
112
133
|
const desktop = cols ?? Math.min(Math.max(cells.length, 2), 6);
|
|
113
134
|
const mid = desktop === 4 ? 2 : Math.min(desktop, 3);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
135
|
+
const keys = new Set(cells.map((cell) => cell.key));
|
|
136
|
+
const underOf = (key) => footer?.filter((entry) => entry.under === key) ?? [];
|
|
137
|
+
const rest = footer?.filter((entry) => entry.under === void 0 || !keys.has(entry.under)) ?? [];
|
|
118
138
|
const hasQualifier = cells.some((cell) => cell.qualifier !== void 0);
|
|
119
139
|
const hasAction = cells.some((cell) => cell.action !== void 0);
|
|
120
|
-
const placed = footer?.some((entry) => columnOf(entry.under) !== void 0) ?? false;
|
|
121
140
|
return /* @__PURE__ */ jsx("div", { className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
|
|
122
141
|
Card.Section,
|
|
123
142
|
{
|
|
@@ -131,25 +150,16 @@ function StatStrip({
|
|
|
131
150
|
"--basalt-strip-cols-sm": mid
|
|
132
151
|
},
|
|
133
152
|
children: [
|
|
134
|
-
/* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
...column !== void 0 && {
|
|
145
|
-
"data-under": entry.under,
|
|
146
|
-
style: { "--basalt-strip-footer-col": column }
|
|
147
|
-
},
|
|
148
|
-
children: entry.content
|
|
149
|
-
},
|
|
150
|
-
entry.key
|
|
151
|
-
);
|
|
152
|
-
}) })
|
|
153
|
+
/* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(
|
|
154
|
+
StripCell,
|
|
155
|
+
{
|
|
156
|
+
cell,
|
|
157
|
+
shotAbsent,
|
|
158
|
+
under: underOf(cell.key)
|
|
159
|
+
},
|
|
160
|
+
cell.key
|
|
161
|
+
)) }),
|
|
162
|
+
rest.length > 0 && /* @__PURE__ */ jsx("div", { className: classes.footerRow, children: rest.map((entry) => /* @__PURE__ */ jsx(FooterCell, { entry, shotAbsent, under: false }, entry.key)) })
|
|
153
163
|
]
|
|
154
164
|
}
|
|
155
165
|
) }) });
|