basalt-ui 2.28.0 → 2.29.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 +461 -401
- package/MIGRATING.md +202 -12
- package/agent/skills/basalt-app/SKILL.md +3 -3
- package/agent/skills/basalt-charts/SKILL.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +11 -5
- package/agent/skills/basalt-design/references/catalogue.md +3 -1
- package/agent/skills/basalt-design/references/recipes.md +1 -1
- package/agent/skills/basalt-design/references/states.md +1 -1
- package/configs/oxlint-plugin.js +2 -1
- package/configs/oxlint.json +1 -0
- package/dist/charts/ChartCard.d.ts +9 -5
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +68 -12
- package/dist/charts/Sparkline.d.ts +5 -0
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +53 -5
- package/dist/charts/chart-box.module.css +9 -2
- package/dist/charts/chart-card.module.css +16 -13
- package/dist/charts/chart-card.module.css.d.ts +2 -0
- package/dist/charts/compile.d.ts +1 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +18 -9
- package/dist/charts/ref-label.d.ts +6 -0
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +19 -5
- package/dist/charts/sparkline.module.css +44 -0
- package/dist/charts/sparkline.module.css.d.ts +3 -0
- package/dist/charts/state.d.ts +1 -1
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +3 -3
- package/dist/cli/doctor-upgrade.d.ts +11 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +54 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -3
- package/dist/cli/index.d.ts +13 -13
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -2
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +118 -27
- package/dist/cli/router-wiring.d.ts +3 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +2 -0
- package/dist/cli/shot/capture.d.ts +28 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +77 -7
- package/dist/cli/shot/detect.d.ts +4 -1
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +38 -16
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +9 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +11 -2
- package/dist/cli/shot/types.d.ts +4 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +10 -2
- package/dist/common/could-not-load.d.ts +13 -0
- package/dist/common/could-not-load.d.ts.map +1 -0
- package/dist/common/could-not-load.js +14 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/props.d.ts +20 -0
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/props.js +13 -1
- package/dist/common/retry-button.module.css +7 -3
- package/dist/dashboard/bar-list.d.ts +4 -4
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +10 -7
- package/dist/dashboard/bar-list.module.css +21 -3
- package/dist/dashboard/board.d.ts +2 -2
- package/dist/dashboard/board.d.ts.map +1 -1
- package/dist/dashboard/board.js +31 -12
- package/dist/dashboard/board.module.css +19 -0
- package/dist/dashboard/board.module.css.d.ts +2 -0
- package/dist/dashboard/empty-state.d.ts +3 -3
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +4 -2
- package/dist/dashboard/event-list-model.d.ts +3 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -1
- package/dist/dashboard/event-list-model.js +5 -1
- package/dist/dashboard/event-list-rows.d.ts.map +1 -1
- package/dist/dashboard/event-list-rows.js +2 -6
- package/dist/dashboard/event-list-scroll.d.ts +32 -4
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -1
- package/dist/dashboard/event-list-scroll.js +117 -4
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -1
- package/dist/dashboard/event-list-skeleton.js +2 -4
- package/dist/dashboard/event-list.d.ts +4 -4
- package/dist/dashboard/event-list.d.ts.map +1 -1
- package/dist/dashboard/event-list.js +53 -23
- package/dist/dashboard/event-list.module.css +90 -37
- package/dist/dashboard/event-list.module.css.d.ts +1 -0
- package/dist/dashboard/meter-model.d.ts +6 -3
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +9 -4
- package/dist/dashboard/meter-parts.d.ts +3 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +32 -4
- package/dist/dashboard/meter.d.ts +3 -3
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +10 -2
- package/dist/dashboard/meter.module.css +18 -11
- package/dist/dashboard/meter.module.css.d.ts +0 -1
- package/dist/dashboard/page-summary.d.ts +3 -3
- package/dist/dashboard/page-summary.d.ts.map +1 -1
- package/dist/dashboard/page-summary.js +7 -2
- package/dist/dashboard/page-summary.module.css +5 -2
- package/dist/dashboard/query-state.d.ts +9 -8
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +28 -10
- package/dist/dashboard/section.d.ts +11 -3
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +34 -7
- package/dist/dashboard/settings-section.d.ts +4 -4
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +11 -7
- package/dist/dashboard/settings-section.module.css +6 -0
- package/dist/dashboard/settings-section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card.d.ts +3 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +24 -8
- package/dist/dashboard/stat-card.module.css +11 -0
- package/dist/dashboard/stat-group.d.ts +2 -2
- package/dist/dashboard/stat-group.d.ts.map +1 -1
- package/dist/dashboard/stat-group.js +10 -3
- package/dist/dashboard/stat-strip.d.ts +5 -4
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +41 -31
- package/dist/dashboard/stat-strip.module.css +4 -5
- package/dist/dashboard/visual-slot.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +2 -0
- package/dist/dashboard/widget-header.d.ts +6 -6
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +4 -2
- package/dist/dashboard/widget-header.module.css +6 -25
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +24 -1
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -1
- package/dist/styles.css +23 -0
- package/dist/table/cell-kinds.d.ts +10 -7
- package/dist/table/cell-kinds.d.ts.map +1 -1
- package/dist/table/cell-kinds.js +18 -7
- package/dist/table/data-table-fold.d.ts +13 -5
- package/dist/table/data-table-fold.d.ts.map +1 -1
- package/dist/table/data-table-fold.js +48 -16
- package/dist/table/data-table.d.ts +2 -2
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +16 -9
- package/dist/table/data-table.module.css +74 -2
- package/dist/table/data-table.module.css.d.ts +4 -0
- package/dist/theme/controls.module.css +23 -2
- package/llms.txt +263 -2
- package/package.json +1 -1
- package/src/charts/ChartCard.tsx +98 -16
- package/src/charts/Sparkline.tsx +84 -5
- package/src/charts/chart-box.module.css +9 -2
- package/src/charts/chart-card.module.css +16 -13
- package/src/charts/chart-card.module.css.d.ts +2 -0
- package/src/charts/compile.ts +37 -15
- package/src/charts/ref-label.ts +36 -9
- package/src/charts/sparkline.module.css +44 -0
- package/src/charts/sparkline.module.css.d.ts +3 -0
- package/src/charts/state.tsx +4 -3
- package/src/cli/doctor-upgrade.ts +75 -0
- package/src/cli/doctor.ts +36 -0
- package/src/cli/help.ts +16 -6
- package/src/cli/index.ts +73 -67
- package/src/cli/init.ts +157 -36
- package/src/cli/router-wiring.ts +2 -2
- package/src/cli/shot/capture.ts +109 -10
- package/src/cli/shot/detect.ts +46 -22
- package/src/cli/shot/index.ts +8 -2
- package/src/cli/shot/measure.ts +11 -2
- package/src/cli/shot/types.ts +4 -1
- package/src/cli/sync.ts +12 -2
- package/src/common/could-not-load.ts +22 -0
- package/src/common/index.ts +1 -0
- package/src/common/props.ts +30 -0
- package/src/common/retry-button.module.css +7 -3
- package/src/dashboard/bar-list.module.css +21 -3
- package/src/dashboard/bar-list.tsx +46 -41
- package/src/dashboard/board.module.css +19 -0
- package/src/dashboard/board.module.css.d.ts +2 -0
- package/src/dashboard/board.tsx +69 -48
- package/src/dashboard/empty-state.tsx +5 -2
- package/src/dashboard/event-list-model.ts +13 -1
- package/src/dashboard/event-list-rows.tsx +3 -6
- package/src/dashboard/event-list-scroll.ts +154 -8
- package/src/dashboard/event-list-skeleton.tsx +5 -1
- package/src/dashboard/event-list.module.css +90 -37
- package/src/dashboard/event-list.module.css.d.ts +1 -0
- package/src/dashboard/event-list.tsx +92 -65
- package/src/dashboard/meter-model.ts +16 -7
- package/src/dashboard/meter-parts.tsx +45 -13
- package/src/dashboard/meter.module.css +18 -11
- package/src/dashboard/meter.module.css.d.ts +0 -1
- package/src/dashboard/meter.tsx +36 -18
- package/src/dashboard/page-summary.module.css +5 -2
- package/src/dashboard/page-summary.tsx +13 -6
- package/src/dashboard/query-state.tsx +54 -29
- package/src/dashboard/section.tsx +83 -41
- package/src/dashboard/settings-section.module.css +6 -0
- package/src/dashboard/settings-section.module.css.d.ts +1 -0
- package/src/dashboard/settings-section.tsx +11 -6
- package/src/dashboard/stat-card.module.css +11 -0
- package/src/dashboard/stat-card.tsx +31 -8
- package/src/dashboard/stat-group.tsx +22 -14
- package/src/dashboard/stat-strip.module.css +4 -5
- package/src/dashboard/stat-strip.tsx +29 -20
- package/src/dashboard/visual-slot.ts +5 -0
- package/src/dashboard/widget-header.module.css +6 -25
- package/src/dashboard/widget-header.tsx +8 -5
- package/src/format/shared.ts +30 -1
- package/src/guard/index.ts +5 -1
- package/src/styles.css +23 -0
- package/src/table/cell-kinds.tsx +42 -13
- package/src/table/data-table-fold.tsx +65 -12
- package/src/table/data-table.module.css +74 -2
- package/src/table/data-table.module.css.d.ts +4 -0
- package/src/table/data-table.tsx +34 -13
- package/src/theme/controls.module.css +23 -2
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* EventList (docs/waves/design-parity/SPEC.md § 6.7). One row shape for the plain and the virtualised
|
|
3
3
|
* path: nothing here keys on a parent selector, so the seam's wrapper divs change no geometry.
|
|
4
|
-
* Two
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Two type rungs: the row size (actor, sentence, body, leading glyph) and the micro size (day header,
|
|
5
|
+
* time, chips; a chip Badge is pinned to it whatever `size` it asks for).
|
|
6
|
+
* Line one is the glyph and the sentence at full width; line two leads with the mono time, then the
|
|
7
|
+
* body (it wraps, never truncates); the chips, when a row has any, sit on a line of their own under the
|
|
8
|
+
* time, so their place never depends on the body.
|
|
7
9
|
*/
|
|
8
10
|
.frame {
|
|
9
11
|
inline-size: 100%;
|
|
@@ -27,6 +29,65 @@
|
|
|
27
29
|
overflow-anchor: none;
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
/* A bottom fade while more rows sit below the fold (`data-more`); it overlays the last rows and adds no height. */
|
|
33
|
+
.scroll[data-more]::after {
|
|
34
|
+
content: '';
|
|
35
|
+
display: block;
|
|
36
|
+
position: sticky;
|
|
37
|
+
inset-block-end: 0;
|
|
38
|
+
block-size: var(--vx-space-stack-lg, 1.5rem);
|
|
39
|
+
margin-block-start: calc(var(--vx-space-stack-lg, 1.5rem) * -1);
|
|
40
|
+
background: linear-gradient(transparent, var(--event-list-bg));
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The count of rows out of view each way (`data-above` / `data-below`, set by `useScrolledEdge`): small mono
|
|
45
|
+
text at the end of the edge, over the sticky header (top) and the fade (bottom). Zero height: no shift. */
|
|
46
|
+
.scroll[data-above]::before {
|
|
47
|
+
content: '↑ ' attr(data-above) ' above';
|
|
48
|
+
display: block;
|
|
49
|
+
position: sticky;
|
|
50
|
+
inset-block-start: 0;
|
|
51
|
+
z-index: 2;
|
|
52
|
+
block-size: 0;
|
|
53
|
+
/* Moved, not padded: padding would add height to the content. */
|
|
54
|
+
translate: 0 var(--vx-space-stack-xs);
|
|
55
|
+
text-align: end;
|
|
56
|
+
/* Inside the box: flush text lost its last glyph edge to the clip at 390. */
|
|
57
|
+
padding-inline-end: var(--vx-space-stack-xs);
|
|
58
|
+
font-family: var(--basalt-font-mono);
|
|
59
|
+
font-size: var(--vx-text-micro);
|
|
60
|
+
line-height: 1.4;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
color: var(--vx-muted);
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.scroll[data-below]::after {
|
|
67
|
+
content: '↓ ' attr(data-below) ' below';
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: flex-end;
|
|
70
|
+
justify-content: flex-end;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
padding-inline-end: var(--vx-space-stack-xs);
|
|
73
|
+
/* Self-contained, like the fade it shares the pseudo with: sticky and cancelled, so it adds no height. */
|
|
74
|
+
position: sticky;
|
|
75
|
+
inset-block-end: 0;
|
|
76
|
+
block-size: var(--vx-space-stack-lg, 1.5rem);
|
|
77
|
+
margin-block-start: calc(var(--vx-space-stack-lg, 1.5rem) * -1);
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
font-family: var(--basalt-font-mono);
|
|
80
|
+
font-size: var(--vx-text-micro);
|
|
81
|
+
line-height: 1.4;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
color: var(--vx-muted);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Loading after rows: the skeleton keeps their last height, so the box does not collapse. */
|
|
87
|
+
.skeleton {
|
|
88
|
+
min-block-size: var(--event-list-held, var(--event-list-last, 0px));
|
|
89
|
+
}
|
|
90
|
+
|
|
30
91
|
.virtual {
|
|
31
92
|
min-width: 0;
|
|
32
93
|
/* The plain rows' last height (see useHeldHeight): no collapse while the seam loads. */
|
|
@@ -83,7 +144,8 @@
|
|
|
83
144
|
grid-template-columns: auto minmax(0, 1fr);
|
|
84
145
|
grid-template-areas:
|
|
85
146
|
'line line'
|
|
86
|
-
'time meta'
|
|
147
|
+
'time meta'
|
|
148
|
+
'chips chips';
|
|
87
149
|
column-gap: var(--vx-space-stack-md);
|
|
88
150
|
padding-block: var(--vx-space-stack-xs);
|
|
89
151
|
font-size: var(--vx-text-sm);
|
|
@@ -91,6 +153,13 @@
|
|
|
91
153
|
color: var(--vx-ink);
|
|
92
154
|
}
|
|
93
155
|
|
|
156
|
+
/* A consistent gap between the rows of a feed (a rail row has its rail; a hairline would be a divider the
|
|
157
|
+
divider law does not list): nine rows of one day read as nine. Padding, not margin: the windowed seam
|
|
158
|
+
measures a row's own box, and the same on every row, so a prepend moves nothing. */
|
|
159
|
+
.row:not([data-rail]) {
|
|
160
|
+
padding-block: calc(var(--vx-space-stack-xs) * 1.5);
|
|
161
|
+
}
|
|
162
|
+
|
|
94
163
|
.row[data-density='timeline'] {
|
|
95
164
|
padding-block: var(--vx-space-stack-sm);
|
|
96
165
|
}
|
|
@@ -99,34 +168,23 @@
|
|
|
99
168
|
grid-template-columns: var(--event-list-lead) auto minmax(0, 1fr);
|
|
100
169
|
grid-template-areas:
|
|
101
170
|
'lead line line'
|
|
102
|
-
'. time meta'
|
|
171
|
+
'. time meta'
|
|
172
|
+
'. chips chips';
|
|
103
173
|
}
|
|
104
174
|
|
|
105
175
|
/* An untimed row has no time to lead the meta line: the meta takes the whole line. */
|
|
106
176
|
.row[data-untimed] {
|
|
107
177
|
grid-template-areas:
|
|
108
178
|
'line line'
|
|
109
|
-
'meta meta'
|
|
179
|
+
'meta meta'
|
|
180
|
+
'chips chips';
|
|
110
181
|
}
|
|
111
182
|
|
|
112
183
|
.row[data-lead][data-untimed] {
|
|
113
184
|
grid-template-areas:
|
|
114
185
|
'lead line line'
|
|
115
|
-
'. meta meta'
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/* The chips follow the sentence's last word, not the row's far edge: the sentence's track grows to
|
|
119
|
-
its content (and shrinks, wrapping, when the chips need the room), the chips' track hugs them. */
|
|
120
|
-
.row[data-chips-only] {
|
|
121
|
-
grid-template-columns: minmax(0, max-content) auto;
|
|
122
|
-
grid-template-areas: 'line meta';
|
|
123
|
-
justify-content: start;
|
|
124
|
-
align-items: start;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.row[data-lead][data-chips-only] {
|
|
128
|
-
grid-template-columns: var(--event-list-lead) minmax(0, max-content) auto;
|
|
129
|
-
grid-template-areas: 'lead line meta';
|
|
186
|
+
'. meta meta'
|
|
187
|
+
'. chips chips';
|
|
130
188
|
}
|
|
131
189
|
|
|
132
190
|
.leading {
|
|
@@ -135,6 +193,8 @@
|
|
|
135
193
|
align-items: center;
|
|
136
194
|
justify-content: center;
|
|
137
195
|
min-height: 1.4em;
|
|
196
|
+
/* A glyph or avatar initial rides the row size, never a size of its own. */
|
|
197
|
+
font-size: var(--vx-text-sm);
|
|
138
198
|
color: var(--vx-muted);
|
|
139
199
|
}
|
|
140
200
|
|
|
@@ -193,37 +253,35 @@
|
|
|
193
253
|
block-size: calc(var(--vx-text-sm) * 1.4);
|
|
194
254
|
}
|
|
195
255
|
|
|
196
|
-
/* The meta line: the body
|
|
197
|
-
it on the first line, never on a line of their own; body text is never truncated. */
|
|
256
|
+
/* The meta line: the body wraps (never truncated) beside the time. */
|
|
198
257
|
.meta {
|
|
199
258
|
grid-area: meta;
|
|
200
|
-
display: flex;
|
|
201
|
-
flex-wrap: nowrap;
|
|
202
|
-
align-items: flex-start;
|
|
203
|
-
gap: var(--vx-space-stack-xs) var(--vx-space-control-gap);
|
|
204
259
|
min-width: 0;
|
|
205
260
|
color: var(--vx-muted);
|
|
206
261
|
}
|
|
207
262
|
|
|
208
263
|
.body {
|
|
209
|
-
flex: 0 1 auto;
|
|
210
264
|
min-width: 0;
|
|
211
|
-
max-inline-size: 100%;
|
|
212
265
|
overflow-wrap: anywhere;
|
|
213
266
|
}
|
|
214
267
|
|
|
268
|
+
/* The chips: one fixed line under the time (the row's third), whatever the body holds. */
|
|
215
269
|
.chips {
|
|
216
|
-
|
|
217
|
-
|
|
270
|
+
grid-area: chips;
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-wrap: wrap;
|
|
218
273
|
align-items: center;
|
|
219
|
-
align-self: flex-start;
|
|
220
274
|
gap: var(--vx-space-control-gap);
|
|
275
|
+
padding-block-start: var(--vx-space-stack-xs);
|
|
221
276
|
font-size: var(--vx-text-micro);
|
|
222
277
|
}
|
|
223
278
|
|
|
224
279
|
/* A neutral chip needs a visible surface in light as well: the theme's subtle fill is the page. */
|
|
225
280
|
.chips :global(.mantine-Badge-root) {
|
|
226
281
|
background: var(--event-list-tint);
|
|
282
|
+
/* A chip is always the micro rung: Mantine writes `--badge-fz` inline from `size`, so the pin is the
|
|
283
|
+
property itself, which the class beats and the inline custom property does not reach. */
|
|
284
|
+
font-size: var(--vx-text-micro);
|
|
227
285
|
}
|
|
228
286
|
|
|
229
287
|
.earlier {
|
|
@@ -232,11 +290,6 @@
|
|
|
232
290
|
padding-block: var(--vx-space-stack-xs);
|
|
233
291
|
}
|
|
234
292
|
|
|
235
|
-
.earlierButton {
|
|
236
|
-
/* The label starts on the rows' edge: cancel the button's own inline padding. */
|
|
237
|
-
margin-inline-start: calc(var(--button-padding-x, 0px) * -1);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
293
|
.earlierButton:hover:not(:disabled, [data-disabled]) {
|
|
241
294
|
background: var(--event-list-hover);
|
|
242
295
|
}
|
|
@@ -8,8 +8,9 @@ export type MeterSegment = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
color?: string;
|
|
10
10
|
/**
|
|
11
|
-
* `'muted'`: the part takes the one flat muted fill every muted part shares, a
|
|
12
|
-
* between neighbours (never a lightness step). A `color` wins.
|
|
11
|
+
* `'muted'`: the part takes the one flat muted fill every muted part shares, a visible 2px
|
|
12
|
+
* separator between neighbours (never a lightness step). A `color` wins. Give each categorical part its own
|
|
13
|
+
* series `color`; `muted` is for a tail "other" part, and a bar of only muted parts reads as one slab.
|
|
13
14
|
*/
|
|
14
15
|
tone?: 'muted';
|
|
15
16
|
forecast?: boolean;
|
|
@@ -75,7 +76,7 @@ export type Part = {
|
|
|
75
76
|
readonly size: number;
|
|
76
77
|
readonly color: string | undefined;
|
|
77
78
|
readonly forecast: boolean;
|
|
78
|
-
/** A
|
|
79
|
+
/** A categorical part right after another: a 2px separator (not a hairline) keeps neighbours, muted ones included, apart. */
|
|
79
80
|
readonly seam: boolean;
|
|
80
81
|
readonly label: string;
|
|
81
82
|
/** The segment's own (normalised) amount, in the reading's units — what its caption states. */
|
|
@@ -136,6 +137,8 @@ export declare function ariaValues(reading: number, min: number, max: number, fo
|
|
|
136
137
|
* track, the captions and `aria-valuenow` all derive from what this returns.
|
|
137
138
|
*/
|
|
138
139
|
export declare function normalizeSegments(segments: readonly MeterSegment[]): MeterSegment[];
|
|
140
|
+
/** Three or more categorical parts that all take the one muted fill read as a single slab. */
|
|
141
|
+
export declare function allPartsMuted(segments: readonly MeterSegment[]): boolean;
|
|
139
142
|
/** Segment amounts (already normalised) accumulate from `min`; a part never passes the track end. */
|
|
140
143
|
export declare function layoutSegments(segments: readonly MeterSegment[], span: number): Part[];
|
|
141
144
|
/** `from` is inclusive; a value on the last band's `to` belongs to that band. */
|
|
@@ -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
|
|
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;;;;OAIG;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;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AACD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE,qGAAqG;AACrG,KAAK,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;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C/B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,GAAG,IAAI,CAuBjB;AAED,8GAA8G;AAC9G,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,IAAI,CA6C/D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAW5F;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"}
|
|
@@ -62,10 +62,14 @@ function ariaValues(reading, min, max, format) {
|
|
|
62
62
|
function normalizeSegments(segments) {
|
|
63
63
|
return segments.map((s) => ({ ...s, value: Number.isFinite(s.value) ? Math.max(0, s.value) : 0 }));
|
|
64
64
|
}
|
|
65
|
+
const isMuted = (s) => s.tone === "muted" && s.color === void 0 && !s.forecast;
|
|
66
|
+
function allPartsMuted(segments) {
|
|
67
|
+
const parts = segments.filter((s) => s.forecast !== true);
|
|
68
|
+
return parts.length >= 3 && parts.every(isMuted);
|
|
69
|
+
}
|
|
65
70
|
function layoutSegments(segments, span) {
|
|
66
71
|
let cursor = 0;
|
|
67
|
-
|
|
68
|
-
let prevMuted = false;
|
|
72
|
+
let prevCategorical = false;
|
|
69
73
|
return segments.map((s) => {
|
|
70
74
|
const size = Math.max(0, Math.min(clamp01(s.value / span), 1 - cursor));
|
|
71
75
|
const forecast = s.forecast === true;
|
|
@@ -74,12 +78,12 @@ function layoutSegments(segments, span) {
|
|
|
74
78
|
size,
|
|
75
79
|
color: forecast ? void 0 : isMuted(s) ? mutedFill(MUTED_PART) : s.color,
|
|
76
80
|
forecast,
|
|
77
|
-
seam:
|
|
81
|
+
seam: !forecast && prevCategorical,
|
|
78
82
|
label: s.label,
|
|
79
83
|
amount: s.value
|
|
80
84
|
};
|
|
81
85
|
cursor += size;
|
|
82
|
-
|
|
86
|
+
if (size > 0) prevCategorical = !forecast;
|
|
83
87
|
return part;
|
|
84
88
|
});
|
|
85
89
|
}
|
|
@@ -455,6 +459,7 @@ export {
|
|
|
455
459
|
RAMP_MAX,
|
|
456
460
|
RAMP_MIN_STEP,
|
|
457
461
|
RAMP_ZONE,
|
|
462
|
+
allPartsMuted,
|
|
458
463
|
ariaValues,
|
|
459
464
|
findHoldingZone,
|
|
460
465
|
isReading,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { DataAttributes } from '../common/props.js';
|
|
2
3
|
import type { MeterSegment, MeterTick, MeterZone } from './meter-model.js';
|
|
3
4
|
export type Shell = {
|
|
4
5
|
className: string | undefined;
|
|
5
6
|
style: CSSProperties | undefined;
|
|
6
7
|
/** `size="row"`: one text line tall, no caption rows. */
|
|
7
8
|
row: boolean;
|
|
9
|
+
/** The consumer's `data-*` (`data-shot`), on the root of every state. */
|
|
10
|
+
data: DataAttributes;
|
|
8
11
|
};
|
|
9
12
|
/** The ring's loading state: one skeleton disc at the ring's size. A bar loads through `MeterBar`. */
|
|
10
13
|
export declare function MeterRingLoading({ label, shell }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter-parts.tsx"],"names":[],"mapp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,CAAA;IACvC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,+BAsBA;AA4dD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,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,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACvC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb,+BAmPA"}
|
|
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Skeleton, VisuallyHidden } from "@mantine/core";
|
|
3
3
|
import { useContext, useId, useRef, useState } from "react";
|
|
4
4
|
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
5
|
+
import { splitEmptyCopy } from "../common/empty-copy.js";
|
|
5
6
|
import { cx } from "../common/props.js";
|
|
6
7
|
import {
|
|
7
8
|
ariaValues,
|
|
@@ -17,10 +18,12 @@ import {
|
|
|
17
18
|
zoneFill
|
|
18
19
|
} from "./meter-model.js";
|
|
19
20
|
import classes from "./meter.module.css";
|
|
21
|
+
import { EmptyState } from "./empty-state.js";
|
|
20
22
|
import { VisualSlotContext } from "./visual-slot.js";
|
|
21
23
|
import { toPct } from "./scale.js";
|
|
22
24
|
function rootProps(shell) {
|
|
23
25
|
return {
|
|
26
|
+
...shell.data,
|
|
24
27
|
className: cx(classes.root, shell.row && classes.row, shell.className),
|
|
25
28
|
style: shell.style,
|
|
26
29
|
"data-basalt-meter": ""
|
|
@@ -95,6 +98,20 @@ function MeterRingLoading({ label, shell }) {
|
|
|
95
98
|
const EMPTY_READING = "\u2014";
|
|
96
99
|
function MeterEmpty(props) {
|
|
97
100
|
const { label, text, ring, zoned, shell } = props;
|
|
101
|
+
if (text !== void 0 && text.trim() !== "") {
|
|
102
|
+
const copy = splitEmptyCopy(text);
|
|
103
|
+
return (
|
|
104
|
+
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a polite live region named by the Meter's label; `<output>` cannot hold the tile's block content
|
|
105
|
+
/* @__PURE__ */ jsx("div", { ...rootProps(shell), role: "status", "aria-label": label, children: /* @__PURE__ */ jsx(
|
|
106
|
+
EmptyState,
|
|
107
|
+
{
|
|
108
|
+
tier: "section",
|
|
109
|
+
title: copy.title,
|
|
110
|
+
...copy.description !== void 0 && { description: copy.description }
|
|
111
|
+
}
|
|
112
|
+
) })
|
|
113
|
+
);
|
|
114
|
+
}
|
|
98
115
|
return /* @__PURE__ */ jsxs("output", { ...rootProps(shell), "aria-label": label, children: [
|
|
99
116
|
ring ? /* @__PURE__ */ jsxs("span", { className: classes.ringBox, children: [
|
|
100
117
|
/* @__PURE__ */ jsx(RingSvg, {}),
|
|
@@ -103,7 +120,7 @@ function MeterEmpty(props) {
|
|
|
103
120
|
zoned && !shell.row && /* @__PURE__ */ jsx(Line, { zoned: true }),
|
|
104
121
|
/* @__PURE__ */ jsx("div", { className: classes.trackBox, children: /* @__PURE__ */ jsx("div", { className: classes.track, "data-meter-track": true }) })
|
|
105
122
|
] }),
|
|
106
|
-
|
|
123
|
+
!ring && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
124
|
/* @__PURE__ */ jsx(VisuallyHidden, { className: classes.summary, children: "No reading" }),
|
|
108
125
|
!shell.row && /* @__PURE__ */ jsx(Line, { zoned })
|
|
109
126
|
] })
|
|
@@ -511,7 +528,9 @@ function MeterBar(props) {
|
|
|
511
528
|
{
|
|
512
529
|
key: "start",
|
|
513
530
|
node: glue(start),
|
|
514
|
-
|
|
531
|
+
// `readingAt="start"` labels the track's start edge ("60-day low"), not the reading: it stays
|
|
532
|
+
// at the edge instead of sitting centred under the reading tick as if it were its caption.
|
|
533
|
+
...readingInRow && props.readingAt !== "start" && model.markerPct !== void 0 && { pct: model.markerPct },
|
|
515
534
|
// The reading sits at its fill's end (clamped inside the track); `readingAt="start"` keeps the old start edge.
|
|
516
535
|
...props.readingAt !== "start" && !readingInRow && model.fillEndPct !== void 0 && {
|
|
517
536
|
pct: model.fillEndPct,
|
|
@@ -524,8 +543,9 @@ function MeterBar(props) {
|
|
|
524
543
|
key: "forecast",
|
|
525
544
|
node: glue(model.forecastText),
|
|
526
545
|
drop: 2,
|
|
527
|
-
// The reading ends at the boundary, the forecast ends where its fill does
|
|
528
|
-
// If that
|
|
546
|
+
// The reading ends at the boundary, the forecast ends where its fill does (a tick
|
|
547
|
+
// marks that end). If that would cover the reading, it falls back to starting at the
|
|
548
|
+
// boundary before it drops.
|
|
529
549
|
...props.readingAt !== "start" && model.forecastEndPct !== void 0 ? {
|
|
530
550
|
pct: model.forecastEndPct,
|
|
531
551
|
align: "end",
|
|
@@ -620,6 +640,14 @@ function MeterBar(props) {
|
|
|
620
640
|
!loading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
621
641
|
/* @__PURE__ */ jsx(Tick, { kind: "marker", className: classes.marker, pct: model.markerPct }),
|
|
622
642
|
/* @__PURE__ */ jsx(Tick, { kind: "boundary", className: classes.boundaryTick, pct: model.boundaryPct }),
|
|
643
|
+
/* @__PURE__ */ jsx(
|
|
644
|
+
Tick,
|
|
645
|
+
{
|
|
646
|
+
kind: "forecastEnd",
|
|
647
|
+
className: classes.boundaryTick,
|
|
648
|
+
pct: model.forecastEndPct !== void 0 && model.forecastEndPct < 100 ? model.forecastEndPct : void 0
|
|
649
|
+
}
|
|
650
|
+
),
|
|
623
651
|
model.ticks.map((t) => /* @__PURE__ */ jsx(Tick, { kind: "tick", className: classes.tick, pct: t.pct }, t.key)),
|
|
624
652
|
/* @__PURE__ */ jsx(Tick, { kind: "target", className: classes.tick, pct: model.targetPct })
|
|
625
653
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BasaltProps } from '../common/props.js';
|
|
2
|
+
import type { BasaltProps, DataAttributes } from '../common/props.js';
|
|
3
3
|
import type { MeterSegment, MeterTick, MeterZone } from './meter-model.js';
|
|
4
|
-
type Common = BasaltProps & {
|
|
4
|
+
type Common = BasaltProps & DataAttributes & {
|
|
5
5
|
/** Accessible name (`aria-label`). Required: a meter without one is announced as a bare number. */
|
|
6
6
|
label: string;
|
|
7
7
|
/** Track start. Default 0. */
|
|
@@ -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
|
-
/**
|
|
15
|
+
/** The empty box shown when there is no reading (the same `EmptyState` tile `BarList` and `EventList` draw, no track; the first sentence is its title, the rest its muted line). None by default: the muted track stands alone, caption rows blank. */
|
|
16
16
|
emptyText?: string;
|
|
17
17
|
};
|
|
18
18
|
type BarCommon = Common & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/dashboard/meter.tsx"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIlE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAKvE,KAAK,MAAM,GAAG,WAAW,GACvB,cAAc,GAAG;IACf,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,uPAAuP;IACvP,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAEH,KAAK,SAAS,GAAG,MAAM,GAAG;IACxB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB;;;;;O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CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uGAAuG;IACvG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sFAAsF;IACtF,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAC,CAAA;AAkBN,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BA6EtC"}
|
package/dist/dashboard/meter.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
+
import { pickDataAttributes } from "../common/props.js";
|
|
3
4
|
import { VX } from "../tokens/index.js";
|
|
4
|
-
import {
|
|
5
|
+
import { reportOnce } from "../common/validate.js";
|
|
6
|
+
import { allPartsMuted, isReading, normalizeSegments, segmentReading, spanOf } from "./meter-model.js";
|
|
5
7
|
import { MeterBar, MeterEmpty, MeterRing, MeterRingLoading } from "./meter-parts.js";
|
|
6
8
|
import { asText } from "./scale.js";
|
|
7
9
|
import { VisualSlotContext } from "./visual-slot.js";
|
|
@@ -20,7 +22,7 @@ function barTone(tone, plain) {
|
|
|
20
22
|
function Meter(props) {
|
|
21
23
|
const { label, min = 0, max = 100, format = asText, className, style } = props;
|
|
22
24
|
const row = props.size === "row";
|
|
23
|
-
const shell = { className, style, row };
|
|
25
|
+
const shell = { className, style, row, data: pickDataAttributes(props) };
|
|
24
26
|
const ring = props.shape === "ring";
|
|
25
27
|
warnInvalidTrack(min, max);
|
|
26
28
|
const host = useContext(VisualSlotContext);
|
|
@@ -29,6 +31,12 @@ function Meter(props) {
|
|
|
29
31
|
const loading = props.loading === true || host?.loading === true;
|
|
30
32
|
if (loading && ring) return /* @__PURE__ */ jsx(MeterRingLoading, { label, shell });
|
|
31
33
|
const segments = props.segments === void 0 || loading && props.segments.length === 0 ? void 0 : normalizeSegments(props.segments);
|
|
34
|
+
if (segments !== void 0 && allPartsMuted(segments)) {
|
|
35
|
+
reportOnce(
|
|
36
|
+
"Meter",
|
|
37
|
+
'[basalt] Meter: every segment is tone="muted", so the parts read as one slab; give each part its own series colour (muted is for a tail "other" part)'
|
|
38
|
+
);
|
|
39
|
+
}
|
|
32
40
|
const placeholder = props.zones !== void 0 && props.zones.length > 0 ? min + spanOf(min, max).span / 2 : min;
|
|
33
41
|
const reading = loading ? segments === void 0 ? placeholder : segmentReading(segments, min) : segments === void 0 ? props.value : segmentReading(segments, min);
|
|
34
42
|
if (!isReading(reading) || segments?.length === 0) {
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
--basalt-meter-caption: var(--vx-text-micro);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/* A bar fills its container's width: as a flex item (a StatCard visual, a strip cell) it would
|
|
18
|
+
* otherwise size to its captions and stop part-way across the card. */
|
|
19
|
+
.root:has(> .trackBox) {
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
.track {
|
|
18
24
|
position: relative;
|
|
19
25
|
display: flex;
|
|
@@ -62,10 +68,10 @@
|
|
|
62
68
|
background: color-mix(in srgb, var(--vx-muted) 65%, transparent);
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
/*
|
|
71
|
+
/* Adjacent categorical parts (muted ones share one fill): a track-coloured gap, not a hairline, tells them apart. */
|
|
66
72
|
.fill[data-meter-seam] {
|
|
67
73
|
box-sizing: border-box;
|
|
68
|
-
border-inline-start:
|
|
74
|
+
border-inline-start: 2px solid var(--vx-surface-subtle);
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
/* The committed/forecast pair: the same neutral at two strengths. Flat, never hatched. */
|
|
@@ -168,7 +174,11 @@
|
|
|
168
174
|
translate: none;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
/*
|
|
177
|
+
/*
|
|
178
|
+
* The reading on a zone track: a notch standing proud of the bands. A panel core in an ink ring, so
|
|
179
|
+
* one of the two always contrasts with the fill under it: the core on an ink fill, the ring on a
|
|
180
|
+
* light one (an ink core on an ink track vanished).
|
|
181
|
+
*/
|
|
172
182
|
.marker {
|
|
173
183
|
position: absolute;
|
|
174
184
|
top: -3px;
|
|
@@ -176,7 +186,8 @@
|
|
|
176
186
|
width: 3px;
|
|
177
187
|
margin-inline-start: -1.5px;
|
|
178
188
|
border-radius: var(--vx-radius-fine);
|
|
179
|
-
background: var(--vx-
|
|
189
|
+
background: var(--vx-surface-panel);
|
|
190
|
+
box-shadow: 0 0 0 1.5px var(--vx-ink);
|
|
180
191
|
}
|
|
181
192
|
|
|
182
193
|
.tick {
|
|
@@ -187,8 +198,9 @@
|
|
|
187
198
|
margin-inline-start: -1px;
|
|
188
199
|
border-radius: var(--vx-radius-fine);
|
|
189
200
|
background: var(--vx-ink);
|
|
190
|
-
/* A
|
|
191
|
-
|
|
201
|
+
/* A panel-coloured 2px halo (the opposite pole of ink in both schemes) keeps the tick readable on
|
|
202
|
+
* a fill that is itself near-ink: `tone="ink"`, or --vx-line in dark. */
|
|
203
|
+
box-shadow: 0 0 0 2px var(--vx-surface-panel);
|
|
192
204
|
}
|
|
193
205
|
|
|
194
206
|
.boundaryTick {
|
|
@@ -324,11 +336,6 @@
|
|
|
324
336
|
border-radius: var(--vx-radius-fine);
|
|
325
337
|
}
|
|
326
338
|
|
|
327
|
-
.empty {
|
|
328
|
-
font-size: var(--basalt-meter-caption);
|
|
329
|
-
color: var(--vx-muted);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
339
|
/* One caption-height line: a blank caption row of an empty Meter, so it stands at the loaded height. */
|
|
333
340
|
.line {
|
|
334
341
|
display: flex;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BasaltProps } from '../common/props.js';
|
|
2
|
+
import type { BasaltProps, DataAttributes } from '../common/props.js';
|
|
3
3
|
type Fact = ReactNode | null | false | undefined;
|
|
4
4
|
type PageSummaryContent = {
|
|
5
5
|
/** The headline sentence. It must state a live number — never describe the page. */
|
|
6
6
|
sentence: ReactNode;
|
|
7
7
|
/** Short facts under the headline, e.g. `['3 need you', oldest && `oldest ${oldest}`]`. */
|
|
8
8
|
facts?: readonly Fact[];
|
|
9
|
-
/**
|
|
9
|
+
/** After the headline: a date or a freshness word. */
|
|
10
10
|
aside?: ReactNode;
|
|
11
11
|
loading?: false;
|
|
12
12
|
};
|
|
@@ -14,7 +14,7 @@ type PageSummaryContent = {
|
|
|
14
14
|
type PageSummaryLoading = Partial<Omit<PageSummaryContent, 'loading'>> & {
|
|
15
15
|
loading: true;
|
|
16
16
|
};
|
|
17
|
-
export type PageSummaryProps = BasaltProps & (PageSummaryContent | PageSummaryLoading);
|
|
17
|
+
export type PageSummaryProps = BasaltProps & DataAttributes & (PageSummaryContent | PageSummaryLoading);
|
|
18
18
|
export declare function PageSummary(props: PageSummaryProps): import("react").JSX.Element;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=page-summary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-summary.d.ts","sourceRoot":"","sources":["../../src/dashboard/page-summary.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"page-summary.d.ts","sourceRoot":"","sources":["../../src/dashboard/page-summary.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGlE,KAAK,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAA;AAEhD,KAAK,kBAAkB,GAAG;IACxB,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAA;IACnB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAA;IACvB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,8FAA8F;AAC9F,KAAK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAA;AAE1F,MAAM,MAAM,gBAAgB,GAAG,WAAW,GACxC,cAAc,GACd,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,CAAA;AAO3C,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAuClD"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from "@mantine/core";
|
|
3
|
-
import { cx } from "../common/props.js";
|
|
3
|
+
import { cx, pickDataAttributes } from "../common/props.js";
|
|
4
4
|
import classes from "./page-summary.module.css";
|
|
5
5
|
const NO_FACTS = [];
|
|
6
6
|
const isShown = (fact) => fact !== null && fact !== false && fact !== void 0 && fact !== "";
|
|
7
7
|
function PageSummary(props) {
|
|
8
8
|
const { className, style } = props;
|
|
9
|
-
const common = {
|
|
9
|
+
const common = {
|
|
10
|
+
...pickDataAttributes(props),
|
|
11
|
+
className: cx(classes.root, className),
|
|
12
|
+
"data-page-summary": "",
|
|
13
|
+
style
|
|
14
|
+
};
|
|
10
15
|
if (props.loading === true) {
|
|
11
16
|
return /* @__PURE__ */ jsxs("div", { ...common, "aria-busy": "true", children: [
|
|
12
17
|
/* @__PURE__ */ jsx(Skeleton, { className: classes.sentenceSkeleton, width: "55%", radius: "sm" }),
|