basalt-ui 2.22.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 +68 -0
- package/MIGRATING.md +400 -12
- package/agent/agents/basalt-design-reviewer.md +3 -3
- package/agent/skills/basalt-design/SKILL.md +2 -2
- package/agent/skills/basalt-design/references/catalogue.md +22 -19
- package/agent/skills/basalt-design/references/states.md +39 -0
- 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 +19 -3
- package/dist/charts/CartesianChart.d.ts +2 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +7 -3
- 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 +95 -15
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/StackedArea.js +5 -1
- 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/chart-legend.module.css +16 -0
- package/dist/charts/compile.d.ts +10 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +77 -24
- 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/legend.d.ts +0 -6
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +87 -35
- 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 +62 -12
- package/dist/charts/sparkline.module.css.d.ts +1 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +4 -2
- package/dist/charts/types.d.ts +15 -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/measure.js +19 -23
- 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 +18 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/meter-model.d.ts +55 -21
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +98 -17
- package/dist/dashboard/meter-parts.d.ts +9 -2
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +99 -21
- package/dist/dashboard/meter.d.ts +21 -8
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +14 -3
- package/dist/dashboard/meter.module.css +57 -2
- package/dist/dashboard/meter.module.css.d.ts +5 -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 +15 -7
- 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-parts.js +1 -1
- package/dist/dashboard/stat-card.module.css +43 -10
- package/dist/dashboard/stat-group.module.css +15 -0
- package/dist/dashboard/stat-strip.d.ts +16 -5
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +100 -74
- package/dist/dashboard/stat-strip.module.css +68 -62
- 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 -17
- package/dist/styles.css +18 -11
- package/dist/table/data-table.js +1 -1
- package/dist/theme/controls.module.css +19 -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 +12 -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 +7 -4
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +55 -5
- package/src/charts/Bars.tsx +31 -3
- package/src/charts/CartesianChart.tsx +9 -3
- package/src/charts/ChartCard.tsx +32 -19
- package/src/charts/Sparkline.tsx +139 -21
- package/src/charts/StackedArea.tsx +12 -1
- package/src/charts/band-fold.ts +25 -6
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/chart-legend.module.css +16 -0
- package/src/charts/compile.ts +148 -25
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +43 -22
- package/src/charts/legend.tsx +70 -3
- package/src/charts/ref-label.ts +27 -0
- package/src/charts/sparkline.module.css +62 -12
- package/src/charts/sparkline.module.css.d.ts +1 -0
- package/src/charts/state.tsx +7 -4
- package/src/charts/types.ts +13 -3
- package/src/cli/shot/capture.ts +15 -3
- package/src/cli/shot/detect.ts +9 -9
- package/src/cli/shot/measure.ts +27 -27
- 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 +18 -0
- package/src/dashboard/bar-list.tsx +29 -0
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/empty-state.tsx +4 -2
- package/src/dashboard/meter-model.ts +181 -47
- package/src/dashboard/meter-parts.tsx +187 -30
- package/src/dashboard/meter.module.css +57 -2
- package/src/dashboard/meter.module.css.d.ts +5 -0
- package/src/dashboard/meter.tsx +33 -10
- package/src/dashboard/query-state.tsx +20 -9
- 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-parts.tsx +1 -1
- package/src/dashboard/stat-card.module.css +43 -10
- package/src/dashboard/stat-group.module.css +15 -0
- package/src/dashboard/stat-strip.module.css +68 -62
- package/src/dashboard/stat-strip.module.css.d.ts +1 -0
- package/src/dashboard/stat-strip.tsx +118 -59
- package/src/dashboard/widget-header.module.css +6 -0
- package/src/dashboard/widget-header.tsx +28 -1
- package/src/guard/index.ts +3 -19
- package/src/styles.css +18 -11
- package/src/table/data-table.tsx +1 -1
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +14 -8
- package/src/theme/controls.module.css +19 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +12 -7
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/palette.ts +7 -10
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* the re-derivation this exists to delete. `LoadingState` / `ErrorState` ship alongside as the
|
|
15
15
|
* escape hatch for a page that must place its branches in different DOM positions.
|
|
16
16
|
*/
|
|
17
|
-
import { Center, Group, Loader, Stack, Text } from '@mantine/core'
|
|
17
|
+
import { Center, Group, Loader, Skeleton, Stack, Text, VisuallyHidden } from '@mantine/core'
|
|
18
18
|
import type { CSSProperties, ReactNode } from 'react'
|
|
19
19
|
import { toErrorMessage } from '../common/errors'
|
|
20
20
|
import { cx } from '../common/props'
|
|
@@ -60,11 +60,15 @@ export type QueryEmptyCopy = {
|
|
|
60
60
|
export type LoadingStateProps = BasaltProps & {
|
|
61
61
|
/** How loud this state is. Default `'page'`. */
|
|
62
62
|
tier?: QueryStateTier
|
|
63
|
-
/** Accessible name for the
|
|
63
|
+
/** Accessible name for the loading state. Say what is loading. */
|
|
64
64
|
label?: string
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* `tier="page"` centres a neutral spinner in a generous block (a route body whose shape is unknown);
|
|
69
|
+
* `'section'` is a neutral skeleton, never an accent spinner. A card region that knows its loaded
|
|
70
|
+
* shape passes `loading` to `QueryState` instead.
|
|
71
|
+
*/
|
|
68
72
|
export function LoadingState({
|
|
69
73
|
tier,
|
|
70
74
|
label = 'Loading',
|
|
@@ -74,12 +78,19 @@ export function LoadingState({
|
|
|
74
78
|
const resolved = tier ?? 'page'
|
|
75
79
|
if (resolved === 'section') {
|
|
76
80
|
return (
|
|
77
|
-
<
|
|
78
|
-
|
|
81
|
+
<Stack
|
|
82
|
+
component="output"
|
|
83
|
+
gap="xs"
|
|
79
84
|
aria-label={label}
|
|
85
|
+
aria-busy="true"
|
|
80
86
|
{...(className !== undefined && { className })}
|
|
81
87
|
{...(style !== undefined && { style })}
|
|
82
|
-
|
|
88
|
+
>
|
|
89
|
+
<VisuallyHidden>{label}</VisuallyHidden>
|
|
90
|
+
<Skeleton height={14} width="40%" />
|
|
91
|
+
<Skeleton height={14} />
|
|
92
|
+
<Skeleton height={14} width="75%" />
|
|
93
|
+
</Stack>
|
|
83
94
|
)
|
|
84
95
|
}
|
|
85
96
|
// Same page-level vertical inset `EmptyState`'s `'page'` variant uses (`empty-state.tsx`'s
|
|
@@ -90,7 +101,7 @@ export function LoadingState({
|
|
|
90
101
|
{...(className !== undefined && { className })}
|
|
91
102
|
style={{ paddingBlock: 'calc(var(--vx-space-stack-xs, 0.25rem) * 16)', ...style }}
|
|
92
103
|
>
|
|
93
|
-
<Loader size="sm" aria-label={label} />
|
|
104
|
+
<Loader size="sm" color={VX.muted} aria-label={label} />
|
|
94
105
|
</Center>
|
|
95
106
|
)
|
|
96
107
|
}
|
|
@@ -119,7 +130,7 @@ export type ErrorStateProps = BasaltProps & {
|
|
|
119
130
|
*/
|
|
120
131
|
export function ErrorState({
|
|
121
132
|
error,
|
|
122
|
-
title = '
|
|
133
|
+
title = 'Could not load',
|
|
123
134
|
fallback = 'The request failed.',
|
|
124
135
|
onRetry,
|
|
125
136
|
retrying = false,
|
|
@@ -246,7 +257,7 @@ export type QueryStateProps<TData> = BasaltProps &
|
|
|
246
257
|
errorAction?: ReactNode
|
|
247
258
|
/** How loud every branch is. Default `'page'`. */
|
|
248
259
|
tier?: QueryStateTier
|
|
249
|
-
/** Replace the default
|
|
260
|
+
/** Replace the default loading state (e.g. with a skeleton in the region's loaded shape). */
|
|
250
261
|
loading?: ReactNode
|
|
251
262
|
}
|
|
252
263
|
|
|
@@ -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
|
|
@@ -137,7 +137,8 @@ type SectionBaseProps = Omit<
|
|
|
137
137
|
defaultOpen?: boolean
|
|
138
138
|
/** Rendered directly under the header and ALWAYS visible, collapsed or not: a collapsed section
|
|
139
139
|
* still states its headline figures, which is what makes collapsing it a real option. Keep it to
|
|
140
|
-
* one row — the body is what `children` is for.
|
|
140
|
+
* one row — the body is what `children` is for. Section owns the summary text size (11 px, the
|
|
141
|
+
* chart-text step): a `size` prop on a bare `Text` here is ignored — wrap it to opt out. */
|
|
141
142
|
summary?: ReactNode
|
|
142
143
|
/** Turns the root into a scroll anchor (`id` + `scroll-margin-top`). Inside `BasaltShell` the
|
|
143
144
|
* offset is the clearance token; without a shell it also clears `PageBar`, which assumes the
|
|
@@ -40,7 +40,7 @@ import classes from './settings-section.module.css'
|
|
|
40
40
|
|
|
41
41
|
const eyebrowStyle = {
|
|
42
42
|
fontFamily: 'var(--basalt-font-mono)',
|
|
43
|
-
fontSize: VX.text.
|
|
43
|
+
fontSize: VX.text.xs,
|
|
44
44
|
fontWeight: 500,
|
|
45
45
|
letterSpacing: '0.06em',
|
|
46
46
|
textTransform: 'uppercase' as const,
|
|
@@ -102,7 +102,7 @@ export type SettingsRowProps = BasaltProps &
|
|
|
102
102
|
SlotStylesProps<SettingsRowSlot> & {
|
|
103
103
|
/** 13px ink label on the left. */
|
|
104
104
|
label: string
|
|
105
|
-
/** Optional
|
|
105
|
+
/** Optional 12px muted description under the label. */
|
|
106
106
|
description?: string
|
|
107
107
|
/** Right-aligned control (input/switch/button). */
|
|
108
108
|
control?: ReactNode
|
|
@@ -125,9 +125,9 @@ export function SettingsRow({
|
|
|
125
125
|
{...(style !== undefined && { style })}
|
|
126
126
|
>
|
|
127
127
|
<Stack gap={2} {...(classNames?.label !== undefined && { className: classNames.label })}>
|
|
128
|
-
<span style={{ fontSize: VX.text.
|
|
128
|
+
<span style={{ fontSize: VX.text.sm, color: VX.ink }}>{label}</span>
|
|
129
129
|
{description && (
|
|
130
|
-
<span style={{ fontSize: VX.text.
|
|
130
|
+
<span style={{ fontSize: VX.text.xs, color: VX.muted }}>{description}</span>
|
|
131
131
|
)}
|
|
132
132
|
</Stack>
|
|
133
133
|
<div className={cx(classes.control, classNames?.control)}>{control ?? children}</div>
|
|
@@ -56,7 +56,7 @@ export function CaptionRow({ title, icon, info, qualifier, tone, actions }: Capt
|
|
|
56
56
|
)}
|
|
57
57
|
</div>
|
|
58
58
|
{qualifier !== undefined && (
|
|
59
|
-
<span className={classes.qualifier} title={qualifier}>
|
|
59
|
+
<span className={classes.qualifier} title={qualifier} data-stat-qualifier>
|
|
60
60
|
{qualifier}
|
|
61
61
|
</span>
|
|
62
62
|
)}
|
|
@@ -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 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). */
|
|
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
|
+
justify-content: flex-start;
|
|
117
|
+
min-height: calc(
|
|
118
|
+
var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1) +
|
|
119
|
+
var(--basalt-stat-qualifier-h)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.lead {
|
|
124
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
105
125
|
}
|
|
106
126
|
|
|
127
|
+
/* Always its own line: siblings of one group never place it differently (beside, or under). */
|
|
107
128
|
.qualifier {
|
|
108
|
-
flex:
|
|
109
|
-
|
|
110
|
-
text-
|
|
111
|
-
white-space: nowrap;
|
|
112
|
-
text-align: end;
|
|
129
|
+
flex-basis: 100%;
|
|
130
|
+
line-height: 1.4;
|
|
131
|
+
text-wrap: balance;
|
|
113
132
|
}
|
|
114
133
|
}
|
|
115
134
|
|
|
@@ -233,8 +252,14 @@
|
|
|
233
252
|
gap: var(--basalt-stat-foot-gap);
|
|
234
253
|
margin-top: auto;
|
|
235
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
|
+
);
|
|
236
260
|
min-height: calc(
|
|
237
|
-
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)
|
|
238
263
|
);
|
|
239
264
|
}
|
|
240
265
|
|
|
@@ -363,6 +388,14 @@
|
|
|
363
388
|
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
364
389
|
}
|
|
365
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
|
+
|
|
366
399
|
/* A Meter in the visual slot is a block, not a chart: it sizes to its content and keeps the card's
|
|
367
400
|
* inline inset instead of the sparkline's fixed 22px and side bleed. */
|
|
368
401
|
.sparklineBleed:has(> [data-basalt-meter]) {
|
|
@@ -43,6 +43,13 @@
|
|
|
43
43
|
gap: var(--vx-space-stack-md);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/* A card with a qualifier tells its row-mates to reserve the qualifier line in a narrow card, so the
|
|
47
|
+
* values of one group share a baseline (`stat-card.module.css`). Group-wide, not per row: the row a
|
|
48
|
+
* card lands in depends on the container, which a selector cannot read. */
|
|
49
|
+
.root:has([data-stat-qualifier]) {
|
|
50
|
+
--basalt-stat-qualifier-reserve: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
/* 260px is StatGroup's own literal (docs/DESIGN-CORE.md § Layout, elevation, shapes), not a container class: one column below it,
|
|
47
54
|
* so every cell leads a row and the rail draws no leading hairline at all. */
|
|
48
55
|
@container basalt-grid (max-width: 259.9px) {
|
|
@@ -56,6 +63,14 @@
|
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
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
|
+
|
|
59
74
|
@container basalt-grid (min-width: 800px) {
|
|
60
75
|
.root {
|
|
61
76
|
grid-template-columns: repeat(var(--basalt-stat-group-cols-sm), minmax(0, 1fr));
|
|
@@ -28,27 +28,26 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* The CELL is the row-high column: it owns the hairlines, so they run the whole row however short
|
|
31
|
-
* the cell inside it ends. It paints nothing else — the one surface stays the Card's.
|
|
31
|
+
* the cell inside it ends. It paints nothing else — the one surface stays the Card's. It is also the
|
|
32
|
+
* size container the caption line answers to (a cell is ~170px at 390, ~250px at 1440). */
|
|
32
33
|
.cell {
|
|
33
34
|
display: grid;
|
|
34
|
-
|
|
35
|
-
grid-template-rows: subgrid;
|
|
35
|
+
align-content: start;
|
|
36
36
|
min-width: 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
container-type: inline-size;
|
|
38
|
+
container-name: basalt-card;
|
|
39
|
+
/* The foot inset lives HERE, on the row-high slot, so a cell that ends early keeps the strip's
|
|
40
|
+
* surface under it. */
|
|
40
41
|
padding-block-end: var(--vx-space-stack-md);
|
|
41
42
|
box-shadow:
|
|
42
43
|
-1px 0 0 var(--vx-divider),
|
|
43
44
|
0 -1px 0 var(--vx-divider);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
/* The CONTENT
|
|
47
|
-
* so its own box ends at its content instead of at the row's bottom. */
|
|
47
|
+
/* The CONTENT is a plain column: its box ends at its content, whatever a sibling holds below. */
|
|
48
48
|
.content {
|
|
49
|
-
display:
|
|
50
|
-
|
|
51
|
-
grid-template-rows: subgrid;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
52
51
|
align-self: start;
|
|
53
52
|
min-width: 0;
|
|
54
53
|
padding: var(--vx-space-stack-md) var(--vx-space-stack-md) 0;
|
|
@@ -63,18 +62,11 @@
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
/* Cells align by
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* row. A part a cell lacks collapses its track (the spacing is a margin on the part, not a gap).
|
|
71
|
-
* A footer rides with what it captions: under a hero alone it takes the hero-footer track right
|
|
72
|
-
* below the hero, under a visual it rides in the visual track (`.visualStack`); only a rows
|
|
73
|
-
* cell's footer uses the shared footer track. A hero-less cell (rows only) starts its rows in the
|
|
74
|
-
* visual track, so the hero track above them is the one void, and only as tall as a sibling's
|
|
75
|
-
* value. */
|
|
65
|
+
/* Cells align by CONSTRUCTION, not by shared tracks: the parts above the value have equal height in
|
|
66
|
+
* every cell of a row (one caption line; a reserved qualifier line in a narrow cell when any cell has
|
|
67
|
+
* a qualifier), so a row shares one caption top and one value baseline. Below the value each cell
|
|
68
|
+
* stacks its own parts and ends at its last one. */
|
|
76
69
|
.content > * {
|
|
77
|
-
grid-column: 1;
|
|
78
70
|
min-width: 0;
|
|
79
71
|
}
|
|
80
72
|
|
|
@@ -82,33 +74,6 @@
|
|
|
82
74
|
margin-block-start: var(--vx-space-stack-sm);
|
|
83
75
|
}
|
|
84
76
|
|
|
85
|
-
.valueRow,
|
|
86
|
-
.skeletonValue,
|
|
87
|
-
.error {
|
|
88
|
-
grid-row: 2;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* A hero's footer has its own track right under the hero track, so it hugs the value however tall a
|
|
92
|
-
* sibling's visual is, and a cell without a footer never spans (or reserves) it. */
|
|
93
|
-
.content > .heroFooter {
|
|
94
|
-
grid-row: 3;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.content > .visualStack,
|
|
98
|
-
.content > .reason,
|
|
99
|
-
.content > .rows {
|
|
100
|
-
grid-row: 4;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.content[data-strip-has-visual] > .rows {
|
|
104
|
-
grid-row: 5;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.content > .footer:not(.heroFooter) {
|
|
108
|
-
grid-row: 6;
|
|
109
|
-
align-self: start;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
77
|
@container basalt-grid (max-width: 479.9px) {
|
|
113
78
|
.cells {
|
|
114
79
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
@@ -126,20 +91,27 @@
|
|
|
126
91
|
}
|
|
127
92
|
|
|
128
93
|
.captionLine {
|
|
129
|
-
grid-row: 1;
|
|
130
94
|
display: flex;
|
|
131
95
|
flex-wrap: nowrap;
|
|
132
|
-
align-items:
|
|
96
|
+
align-items: flex-start;
|
|
133
97
|
column-gap: var(--vx-space-control-gap);
|
|
134
98
|
min-width: 0;
|
|
135
99
|
}
|
|
136
100
|
|
|
137
|
-
/*
|
|
101
|
+
/* A cell with an action reserves the control's height on every caption line of the strip, so the
|
|
102
|
+
* values stay level whichever cell carries one. */
|
|
103
|
+
[data-strip-action-row] .captionLine {
|
|
104
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Caption and qualifier share one line while the qualifier fits; when it does not it wraps whole under the
|
|
108
|
+
* caption and wraps again rather than truncating (it can be the only place a band is stated). */
|
|
138
109
|
.captionMain {
|
|
139
110
|
display: flex;
|
|
140
111
|
flex: 1 1 0;
|
|
141
112
|
flex-wrap: wrap;
|
|
142
|
-
align-items:
|
|
113
|
+
align-items: baseline;
|
|
114
|
+
align-content: flex-start;
|
|
143
115
|
column-gap: var(--vx-space-control-gap);
|
|
144
116
|
min-width: 0;
|
|
145
117
|
}
|
|
@@ -162,17 +134,38 @@
|
|
|
162
134
|
font-family: var(--basalt-font-mono);
|
|
163
135
|
font-size: var(--vx-text-micro);
|
|
164
136
|
font-weight: 500;
|
|
137
|
+
line-height: 1.4;
|
|
165
138
|
letter-spacing: 0.06em;
|
|
166
139
|
text-transform: uppercase;
|
|
167
140
|
color: var(--vx-faint);
|
|
168
141
|
}
|
|
169
142
|
|
|
170
|
-
/* The lowercase qualifier is the muted sans (mono is for the UPPERCASE caption only).
|
|
171
|
-
* item, so when it does not fit beside the caption it wraps WHOLE onto its own line below. */
|
|
143
|
+
/* The lowercase qualifier is the muted sans (mono is for the UPPERCASE caption only). */
|
|
172
144
|
.qualifier {
|
|
145
|
+
flex: 0 1 auto;
|
|
146
|
+
min-width: 0;
|
|
147
|
+
overflow-wrap: anywhere;
|
|
148
|
+
text-wrap: balance;
|
|
173
149
|
font-size: var(--vx-text-micro);
|
|
150
|
+
line-height: 1.4;
|
|
174
151
|
color: var(--vx-muted);
|
|
175
|
-
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* A narrow cell (~170px at 390): when any cell of the strip has a qualifier every cell reserves one line for
|
|
155
|
+
* it, whether it sat beside the caption or wrapped under it, so values share a baseline. */
|
|
156
|
+
@container basalt-card (max-width: 239.9px) {
|
|
157
|
+
.qualifier {
|
|
158
|
+
line-height: 1.25;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
[data-strip-qualifier] .captionMain {
|
|
162
|
+
min-height: calc(var(--vx-text-micro) * (1.4 + 1.25));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* The two caption lines read as one block: the value follows at the tight step. */
|
|
166
|
+
[data-strip-qualifier] .captionLine + * {
|
|
167
|
+
margin-block-start: var(--vx-space-stack-xs);
|
|
168
|
+
}
|
|
176
169
|
}
|
|
177
170
|
|
|
178
171
|
/* A control at the end of the caption line: it keeps its size, the caption truncates first. */
|
|
@@ -230,10 +223,6 @@
|
|
|
230
223
|
min-width: 0;
|
|
231
224
|
}
|
|
232
225
|
|
|
233
|
-
.visualStack > .footer {
|
|
234
|
-
margin-block-start: var(--vx-space-stack-sm);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
226
|
/* A Sparkline's hover readout takes this line above its plot (`charts/sparkline.module.css`). The
|
|
238
227
|
* cell's own stack gap already sits above it; the slot reserves the rest, so the chip never covers
|
|
239
228
|
* the value. */
|
|
@@ -245,6 +234,12 @@
|
|
|
245
234
|
padding-top: max(0px, calc(var(--basalt-spark-readout-h) - var(--vx-space-stack-sm)));
|
|
246
235
|
}
|
|
247
236
|
|
|
237
|
+
/* The state copy keeps the cell's inset on every side: the article ends at its own last track, so the
|
|
238
|
+
* foot inset (carried by the row-high slot, further down) cannot reach it. */
|
|
239
|
+
.content[data-strip-has-state] {
|
|
240
|
+
padding-block-end: var(--vx-space-stack-md);
|
|
241
|
+
}
|
|
242
|
+
|
|
248
243
|
/* An empty cell's reason and an errored cell's message: one muted `sm` line, wrapping rather than
|
|
249
244
|
* clipping (a 390px two-column cell is ~170px wide). */
|
|
250
245
|
.reason {
|
|
@@ -319,12 +314,14 @@
|
|
|
319
314
|
}
|
|
320
315
|
|
|
321
316
|
/* A meter's start and end captions read as one phrase (name, then value) however wide the track. */
|
|
322
|
-
.footerCell [data-meter-captions]
|
|
317
|
+
.footerCell [data-meter-captions],
|
|
318
|
+
.underCell [data-meter-captions] {
|
|
323
319
|
justify-content: flex-start;
|
|
324
320
|
column-gap: var(--vx-space-stack-md);
|
|
325
321
|
}
|
|
326
322
|
|
|
327
|
-
.footerCell [data-meter-captions] >
|
|
323
|
+
.footerCell [data-meter-captions] > *,
|
|
324
|
+
.underCell [data-meter-captions] > * {
|
|
328
325
|
margin-inline-start: 0;
|
|
329
326
|
text-align: start;
|
|
330
327
|
}
|
|
@@ -336,3 +333,12 @@
|
|
|
336
333
|
border-inline-start: 1px solid var(--vx-divider);
|
|
337
334
|
border-block-start: 1px solid var(--vx-divider);
|
|
338
335
|
}
|
|
336
|
+
|
|
337
|
+
/* A footer entry `under` a cell is part of that cell: it sits in the slot under the article, inset like
|
|
338
|
+
* the article, split from the readings by the strip's own hairline. */
|
|
339
|
+
.underCell {
|
|
340
|
+
min-width: 0;
|
|
341
|
+
margin: var(--vx-space-stack-md) var(--vx-space-stack-md) 0;
|
|
342
|
+
padding-block-start: var(--vx-space-stack-sm);
|
|
343
|
+
border-block-start: 1px solid var(--vx-divider);
|
|
344
|
+
}
|