@slotted/styles 0.1.0-beta.3 → 0.1.0-beta.30
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/package.json +13 -1
- package/src/accordion/accordion.css +11 -11
- package/src/action-bar/action-bar.css +47 -44
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +39 -39
- package/src/alert/alert.css +96 -96
- package/src/alert/alert.tokens.json +5 -0
- package/src/app-shell/app-shell.css +455 -328
- package/src/app-shell/app-shell.tokens.json +5 -2
- package/src/aspect-ratio/aspect-ratio.css +9 -9
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +96 -66
- package/src/avatar/avatar.tokens.json +7 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +54 -46
- package/src/badge/badge.tokens.json +5 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +137 -89
- package/src/button/button.tokens.json +5 -0
- package/src/button-group/button-group.css +80 -79
- package/src/button-group/button-group.tokens.json +1 -0
- package/src/calendar/calendar.css +139 -109
- package/src/calendar/calendar.tokens.json +5 -1
- package/src/card/card.css +68 -65
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +158 -157
- package/src/cascader/cascader.tokens.json +1 -0
- package/src/chart/chart.css +288 -267
- package/src/chart/chart.tokens.json +4 -0
- package/src/checkbox/checkbox.css +143 -148
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +76 -80
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +203 -130
- package/src/combobox/combobox.tokens.json +3 -0
- package/src/command-palette/command-palette.css +155 -102
- package/src/command-palette/command-palette.tokens.json +2 -0
- package/src/container/container.css +27 -27
- package/src/context-menu/context-menu.css +9 -9
- package/src/currency-field/currency-field.css +119 -119
- package/src/currency-field/currency-field.tokens.json +1 -0
- package/src/dashboard-grid/dashboard-grid.css +185 -115
- package/src/data-grid/data-grid.css +598 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +82 -71
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +62 -57
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +117 -58
- package/src/date-picker/date-picker.tokens.json +5 -0
- package/src/date-range-picker/date-range-picker.css +157 -127
- package/src/date-range-picker/date-range-picker.tokens.json +4 -0
- package/src/datetime-field/datetime-field.css +90 -90
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +123 -70
- package/src/datetime-picker/datetime-picker.tokens.json +4 -1
- package/src/datetime-range-picker/datetime-range-picker.css +191 -163
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +4 -0
- package/src/description-list/description-list.css +105 -75
- package/src/description-list/description-list.tokens.json +1 -0
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +434 -198
- package/src/dialog/dialog.tokens.json +7 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +597 -236
- package/src/drawer/drawer.tokens.json +13 -0
- package/src/entity-picker/entity-picker.css +323 -270
- package/src/entity-picker/entity-picker.tokens.json +3 -0
- package/src/event-calendar/event-calendar.css +357 -399
- package/src/field/field.css +106 -93
- package/src/field/field.tokens.json +2 -0
- package/src/field-group/field-group.css +43 -33
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +200 -216
- package/src/form/form.css +99 -25
- package/src/form/form.tokens.json +5 -0
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +29 -29
- package/src/highlight/highlight.css +11 -11
- package/src/hover-card/hover-card.css +9 -9
- package/src/icon/icon.css +67 -20
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +42 -42
- package/src/import-export-center/import-export-center.css +144 -165
- package/src/inline/inline.css +28 -28
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +4 -0
- package/src/kbd/kbd.css +62 -50
- package/src/kbd/kbd.tokens.json +3 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +23 -23
- package/src/list-item/list-item.css +89 -75
- package/src/list-item/list-item.tokens.json +7 -0
- package/src/listbox/listbox.css +71 -70
- package/src/listbox/listbox.tokens.json +0 -1
- package/src/loading-overlay/loading-overlay.css +86 -103
- package/src/markdown/markdown.css +20 -20
- package/src/media-viewer/media-viewer.css +790 -0
- package/src/media-viewer/media-viewer.tokens.json +53 -0
- package/src/menu/menu.css +162 -82
- package/src/menu/menu.tokens.json +2 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1250 -1253
- package/src/message/message.tokens.json +5 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/multi-select/multi-select.css +230 -172
- package/src/multi-select/multi-select.tokens.json +2 -0
- package/src/navigation-menu/navigation-menu.css +169 -190
- package/src/notification-center/notification-center.css +153 -161
- package/src/notification-center/notification-center.tokens.json +3 -0
- package/src/number-field/number-field.css +93 -93
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +74 -64
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +41 -27
- package/src/page/page.tokens.json +1 -0
- package/src/page-header/page-header.css +341 -286
- package/src/page-header/page-header.tokens.json +5 -0
- package/src/pagination/pagination.css +75 -79
- package/src/popover/popover.css +81 -64
- package/src/popover/popover.tokens.json +1 -0
- package/src/progress-indicator/progress-indicator.css +192 -136
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +260 -113
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +77 -82
- package/src/radio-group/radio-group.css +107 -112
- package/src/rating/rating.css +146 -142
- package/src/rating/rating.tokens.json +1 -0
- package/src/result-state/result-state.css +94 -101
- package/src/runtime-properties.mjs +19 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +44 -37
- package/src/section/section.css +178 -43
- package/src/section/section.tokens.json +8 -2
- package/src/segmented-control/segmented-control.css +210 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +210 -147
- package/src/select/select.tokens.json +3 -0
- package/src/side-navigation/side-navigation.css +193 -196
- package/src/side-navigation/side-navigation.tokens.json +1 -0
- package/src/skeleton/skeleton.css +57 -58
- package/src/slider/slider.css +101 -103
- package/src/sparkline/sparkline.css +75 -53
- package/src/sparkline/sparkline.tokens.json +2 -0
- package/src/spinner/spinner.css +83 -180
- package/src/spinner/spinner.tokens.json +0 -1
- package/src/split-button/split-button.css +34 -35
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +47 -48
- package/src/stack/stack.css +25 -25
- package/src/stat-card/stat-card.css +415 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +124 -100
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +100 -106
- package/src/table/table.css +270 -198
- package/src/table/table.tokens.json +2 -0
- package/src/table-of-contents/table-of-contents.css +60 -59
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +327 -294
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +109 -88
- package/src/tag/tag.tokens.json +10 -0
- package/src/tags-input/tags-input.css +152 -87
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +146 -148
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +38 -33
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +82 -77
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +116 -64
- package/src/time-picker/time-picker.tokens.json +4 -1
- package/src/time-range-picker/time-range-picker.css +168 -140
- package/src/time-range-picker/time-range-picker.tokens.json +4 -0
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +138 -121
- package/src/toast/toast.tokens.json +6 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +33 -38
- package/src/tooltip/tooltip.css +65 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +252 -268
- package/src/tour/tour.css +64 -73
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +113 -121
- package/src/typography/typography.css +42 -38
- package/src/typography/typography.tokens.json +1 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* in: a container cannot change its own tracks
|
|
11
11
|
* (`docs/build-briefing.md`, _Decisions already taken_).
|
|
12
12
|
*/
|
|
13
|
-
[data-ui
|
|
13
|
+
[data-ui-stat-card] {
|
|
14
14
|
--_edge-width: var(--slotted-stat-card-border-width, var(--slotted-border-width-thin, 1px));
|
|
15
15
|
--_radius: var(--slotted-stat-card-radius, var(--slotted-radius-lg, 8px));
|
|
16
16
|
--_inset-block: var(--slotted-stat-card-padding-block, var(--slotted-space-6, 1rem));
|
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
--slotted-stat-card-trend-inline-size,
|
|
29
29
|
calc(var(--slotted-space-12, 4rem) * 1.5)
|
|
30
30
|
);
|
|
31
|
+
/* The trend's height when it takes the last row and the card's whole
|
|
32
|
+
width: one step above the sparkline's own, because a line as wide as
|
|
33
|
+
the card at the sparkline's height reads flat. */
|
|
34
|
+
--_trend-block: var(--slotted-stat-card-trend-block-size, var(--slotted-space-11, 3rem));
|
|
35
|
+
/* The least height of a trend beside the figure, which otherwise takes
|
|
36
|
+
the figure's height: the sparkline's own step. */
|
|
37
|
+
--_trend-floor: var(--slotted-sparkline-block-size, var(--slotted-space-9, 2rem));
|
|
31
38
|
|
|
32
39
|
--_surface: var(--slotted-stat-card-background, var(--slotted-surface-raised, Canvas));
|
|
33
40
|
--_edge: var(--slotted-stat-card-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
@@ -87,7 +94,7 @@
|
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
/* The edge, out of flow, so a frame that changes width moves no text. */
|
|
90
|
-
[data-ui
|
|
97
|
+
[data-ui-stat-card]::before {
|
|
91
98
|
border: var(--_edge-width) solid var(--_edge);
|
|
92
99
|
border-radius: inherit;
|
|
93
100
|
content: '';
|
|
@@ -96,12 +103,14 @@
|
|
|
96
103
|
position: absolute;
|
|
97
104
|
}
|
|
98
105
|
|
|
99
|
-
[data-ui
|
|
106
|
+
[data-ui-stat-card][data-size='sm'] {
|
|
100
107
|
--_inset-block: var(--slotted-stat-card-padding-block-sm, var(--slotted-space-5, 0.75rem));
|
|
101
108
|
--_inset-inline: var(--slotted-stat-card-padding-inline-sm, var(--slotted-space-5, 0.75rem));
|
|
102
109
|
--_region-gap: var(--slotted-stat-card-region-gap-sm, var(--slotted-space-2, 0.25rem));
|
|
103
110
|
--_trend-gap: var(--slotted-stat-card-trend-gap-sm, var(--slotted-space-5, 0.75rem));
|
|
104
111
|
--_trend-size: var(--slotted-stat-card-trend-inline-size-sm, var(--slotted-space-12, 4rem));
|
|
112
|
+
--_trend-block: var(--slotted-stat-card-trend-block-size-sm, var(--slotted-space-9, 2rem));
|
|
113
|
+
--_trend-floor: var(--slotted-sparkline-block-size-sm, var(--slotted-space-7, 1.25rem));
|
|
105
114
|
--_value-size: var(
|
|
106
115
|
--slotted-stat-card-value-font-size-sm,
|
|
107
116
|
var(--slotted-font-size-2xl, 1.25rem)
|
|
@@ -126,7 +135,7 @@
|
|
|
126
135
|
--_value-line-narrow: var(--slotted-line-height-xl, 1.45);
|
|
127
136
|
}
|
|
128
137
|
|
|
129
|
-
[data-ui
|
|
138
|
+
[data-ui-stat-card][data-size='lg'] {
|
|
130
139
|
--_inset-block: var(--slotted-stat-card-padding-block-lg, var(--slotted-space-8, 1.5rem));
|
|
131
140
|
--_inset-inline: var(--slotted-stat-card-padding-inline-lg, var(--slotted-space-8, 1.5rem));
|
|
132
141
|
--_region-gap: var(--slotted-stat-card-region-gap-lg, var(--slotted-space-4, 0.5rem));
|
|
@@ -135,6 +144,8 @@
|
|
|
135
144
|
--slotted-stat-card-trend-inline-size-lg,
|
|
136
145
|
calc(var(--slotted-space-12, 4rem) * 2)
|
|
137
146
|
);
|
|
147
|
+
--_trend-block: var(--slotted-stat-card-trend-block-size-lg, var(--slotted-space-12, 4rem));
|
|
148
|
+
--_trend-floor: var(--slotted-sparkline-block-size-lg, var(--slotted-space-11, 3rem));
|
|
138
149
|
--_value-size: var(--slotted-stat-card-value-font-size-lg, var(--slotted-font-size-4xl, 2rem));
|
|
139
150
|
--_value-line: var(
|
|
140
151
|
--slotted-stat-card-value-line-height-lg,
|
|
@@ -170,11 +181,11 @@
|
|
|
170
181
|
|
|
171
182
|
/* ── Fill: the three frames a card has, and none ─────────────────────── */
|
|
172
183
|
|
|
173
|
-
[data-ui
|
|
184
|
+
[data-ui-stat-card][data-fill='elevated'] {
|
|
174
185
|
--_shadow: var(--slotted-stat-card-shadow-elevated, var(--slotted-shadow-md));
|
|
175
186
|
}
|
|
176
187
|
|
|
177
|
-
[data-ui
|
|
188
|
+
[data-ui-stat-card][data-fill='subtle'] {
|
|
178
189
|
--_surface: var(--slotted-stat-card-background-subtle, var(--slotted-surface-sunken, Canvas));
|
|
179
190
|
}
|
|
180
191
|
|
|
@@ -183,7 +194,7 @@
|
|
|
183
194
|
* of metrics separated by dividers, inside a card that is already a card.
|
|
184
195
|
* It keeps no inset either, because the host's inset is the inset.
|
|
185
196
|
*/
|
|
186
|
-
[data-ui
|
|
197
|
+
[data-ui-stat-card][data-fill='plain'] {
|
|
187
198
|
--_surface: transparent;
|
|
188
199
|
--_edge: transparent;
|
|
189
200
|
--_shadow: none;
|
|
@@ -192,6 +203,33 @@
|
|
|
192
203
|
--_radius: var(--slotted-radius-none, 0px);
|
|
193
204
|
}
|
|
194
205
|
|
|
206
|
+
/* ── Attention: a figure past a threshold the product states ─────────── */
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The value and the edge take the tone; the delta keeps the tone of its
|
|
210
|
+
* change, and the trend the root's `tone`. The binding writes the
|
|
211
|
+
* attribute on a ready value only. A `plain` card has no edge to paint.
|
|
212
|
+
*/
|
|
213
|
+
[data-ui-stat-card][data-attention='warning'] {
|
|
214
|
+
--_attention-ink: var(--slotted-stat-card-attention-ink, var(--slotted-tone-warning-text));
|
|
215
|
+
--_attention-edge: var(
|
|
216
|
+
--slotted-stat-card-attention-border-color,
|
|
217
|
+
var(--slotted-tone-warning-border)
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[data-ui-stat-card][data-attention='danger'] {
|
|
222
|
+
--_attention-ink: var(--slotted-stat-card-attention-ink, var(--slotted-tone-danger-text));
|
|
223
|
+
--_attention-edge: var(
|
|
224
|
+
--slotted-stat-card-attention-border-color,
|
|
225
|
+
var(--slotted-tone-danger-border)
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
[data-ui-stat-card][data-attention]:not([data-fill='plain']) {
|
|
230
|
+
--_edge: var(--_attention-edge);
|
|
231
|
+
}
|
|
232
|
+
|
|
195
233
|
/* ── The body ─────────────────────────────────────────────────────────── */
|
|
196
234
|
|
|
197
235
|
/**
|
|
@@ -218,28 +256,32 @@
|
|
|
218
256
|
* number is broken only when it is wider than the card itself. A floor on
|
|
219
257
|
* the trend was tried and pushed the trend through the card's edge.
|
|
220
258
|
*/
|
|
221
|
-
[data-ui
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
259
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
260
|
+
:scope [data-part-body] {
|
|
261
|
+
column-gap: var(--_trend-gap);
|
|
262
|
+
display: grid;
|
|
263
|
+
flex: 1 1 auto;
|
|
264
|
+
grid-template-areas:
|
|
265
|
+
'header header'
|
|
266
|
+
'figure trend'
|
|
267
|
+
'message message';
|
|
268
|
+
grid-template-columns: minmax(min-content, 1fr) minmax(0, var(--_trend-size));
|
|
269
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
270
|
+
min-inline-size: 0;
|
|
271
|
+
row-gap: var(--_region-gap);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
276
|
+
:scope[data-layout='stacked'] [data-part-body] {
|
|
277
|
+
grid-template-areas:
|
|
278
|
+
'header'
|
|
279
|
+
'figure'
|
|
280
|
+
'message'
|
|
281
|
+
'trend';
|
|
282
|
+
grid-template-columns: minmax(0, 1fr);
|
|
283
|
+
grid-template-rows: auto minmax(0, 1fr) auto auto;
|
|
284
|
+
}
|
|
243
285
|
}
|
|
244
286
|
|
|
245
287
|
/**
|
|
@@ -250,15 +292,19 @@
|
|
|
250
292
|
* inline axis gives these regions no intrinsic width: the figure alone
|
|
251
293
|
* decides the column, and the text is cut or wrapped by the card's width.
|
|
252
294
|
*/
|
|
253
|
-
[data-ui
|
|
254
|
-
|
|
255
|
-
|
|
295
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
296
|
+
:scope [data-part-header] {
|
|
297
|
+
contain: inline-size;
|
|
298
|
+
grid-area: header;
|
|
299
|
+
}
|
|
256
300
|
}
|
|
257
301
|
|
|
258
|
-
[data-ui
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
302
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
303
|
+
:scope [data-part-figure] {
|
|
304
|
+
align-self: start;
|
|
305
|
+
grid-area: figure;
|
|
306
|
+
min-inline-size: 0;
|
|
307
|
+
}
|
|
262
308
|
}
|
|
263
309
|
|
|
264
310
|
/**
|
|
@@ -268,32 +314,62 @@
|
|
|
268
314
|
* width is the space a wide value left, which a query on the card cannot
|
|
269
315
|
* see.
|
|
270
316
|
*/
|
|
271
|
-
[data-ui
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
317
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
318
|
+
:scope [data-part-trend] {
|
|
319
|
+
/* The marker's ring is the card's ground, not the page's. */
|
|
320
|
+
--slotted-sparkline-ring-color: var(--_surface);
|
|
321
|
+
|
|
322
|
+
align-self: stretch;
|
|
323
|
+
container-name: stat-card-trend;
|
|
324
|
+
container-type: inline-size;
|
|
325
|
+
grid-area: trend;
|
|
326
|
+
inline-size: 100%;
|
|
327
|
+
min-inline-size: 0;
|
|
328
|
+
}
|
|
281
329
|
}
|
|
282
330
|
|
|
283
331
|
@container stat-card-trend (max-width: 39px) {
|
|
284
|
-
[data-ui
|
|
285
|
-
|
|
332
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
333
|
+
:scope [data-part-trend] > * {
|
|
334
|
+
visibility: hidden;
|
|
335
|
+
}
|
|
286
336
|
}
|
|
287
337
|
}
|
|
288
338
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
339
|
+
/**
|
|
340
|
+
* On the last row the trend reaches the card's edges: its sides and its
|
|
341
|
+
* bottom bleed through the inset, and the card's corners round it. A line
|
|
342
|
+
* drawn inside the inset ends a gutter short of each edge and reads as a
|
|
343
|
+
* picture placed in the card; a line that runs to the frame reads as the
|
|
344
|
+
* card's ground. The edge is drawn over it, out of flow. A plain card has
|
|
345
|
+
* no inset, so the margins are nought there.
|
|
346
|
+
*/
|
|
347
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
348
|
+
:scope[data-layout='stacked'] [data-part-trend] {
|
|
349
|
+
align-self: end;
|
|
350
|
+
border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
|
|
351
|
+
border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
|
|
352
|
+
margin-block-end: calc(-1 * var(--_inset-block));
|
|
353
|
+
margin-block-start: var(--slotted-space-2, 0.25rem);
|
|
354
|
+
margin-inline: calc(-1 * var(--_inset-inline));
|
|
355
|
+
overflow: clip;
|
|
356
|
+
/* The region is wider than the column by the two insets. */
|
|
357
|
+
inline-size: auto;
|
|
358
|
+
}
|
|
292
359
|
}
|
|
293
360
|
|
|
294
|
-
[data-ui
|
|
295
|
-
|
|
296
|
-
|
|
361
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
362
|
+
:scope[data-layout='stacked'] [data-part-trend] > * {
|
|
363
|
+
block-size: var(--_trend-block);
|
|
364
|
+
min-block-size: 0;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
369
|
+
:scope [data-part-message] {
|
|
370
|
+
contain: inline-size;
|
|
371
|
+
grid-area: message;
|
|
372
|
+
}
|
|
297
373
|
}
|
|
298
374
|
|
|
299
375
|
/**
|
|
@@ -303,47 +379,71 @@
|
|
|
303
379
|
* (`docs/token-foundation.md`, rule 4).
|
|
304
380
|
*/
|
|
305
381
|
@container stat-card (max-width: 219px) {
|
|
306
|
-
[data-ui
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
382
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
383
|
+
:scope [data-part-body] {
|
|
384
|
+
grid-template-areas:
|
|
385
|
+
'header'
|
|
386
|
+
'figure'
|
|
387
|
+
'message'
|
|
388
|
+
'trend';
|
|
389
|
+
grid-template-columns: minmax(0, 1fr);
|
|
390
|
+
grid-template-rows: auto minmax(0, 1fr) auto auto;
|
|
391
|
+
}
|
|
314
392
|
}
|
|
315
393
|
|
|
316
|
-
[data-ui
|
|
317
|
-
|
|
318
|
-
|
|
394
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
395
|
+
:scope [data-part-trend] {
|
|
396
|
+
align-self: end;
|
|
397
|
+
border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
|
|
398
|
+
border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
|
|
399
|
+
margin-block-end: calc(-1 * var(--_inset-block));
|
|
400
|
+
margin-block-start: var(--slotted-space-2, 0.25rem);
|
|
401
|
+
margin-inline: calc(-1 * var(--_inset-inline));
|
|
402
|
+
overflow: clip;
|
|
403
|
+
/* The region is wider than the column by the two insets. */
|
|
404
|
+
inline-size: auto;
|
|
405
|
+
}
|
|
319
406
|
}
|
|
320
407
|
|
|
321
|
-
[data-ui
|
|
322
|
-
|
|
323
|
-
|
|
408
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
409
|
+
:scope [data-part-trend] > * {
|
|
410
|
+
block-size: var(--_trend-block);
|
|
411
|
+
min-block-size: 0;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
416
|
+
:scope [data-part-value] {
|
|
417
|
+
font-size: var(--_value-size-narrow);
|
|
418
|
+
line-height: var(--_value-line-narrow);
|
|
419
|
+
}
|
|
324
420
|
}
|
|
325
421
|
|
|
326
422
|
/* The value steps down here, and so does the line its placeholder keeps. */
|
|
327
|
-
[data-ui
|
|
328
|
-
|
|
423
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
424
|
+
:scope[data-loading] [data-part-value] {
|
|
425
|
+
min-block-size: calc(var(--_value-size-narrow) * var(--_value-line-narrow));
|
|
426
|
+
}
|
|
329
427
|
}
|
|
330
428
|
}
|
|
331
429
|
|
|
332
430
|
/* ── Header: the name, a status beside it, an action at the end ──────── */
|
|
333
431
|
|
|
334
432
|
/**
|
|
335
|
-
* On the baseline rather than
|
|
433
|
+
* On the baseline rather than centerd: a label that wraps to two lines
|
|
336
434
|
* keeps its status and its action on its first line, where the eye reads
|
|
337
435
|
* them as part of the name, instead of floating them at the middle of the
|
|
338
436
|
* block.
|
|
339
437
|
*/
|
|
340
|
-
[data-ui
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
438
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
439
|
+
:scope [data-part-header] {
|
|
440
|
+
align-items: baseline;
|
|
441
|
+
column-gap: var(--slotted-space-3, 0.375rem);
|
|
442
|
+
display: flex;
|
|
443
|
+
flex-wrap: wrap;
|
|
444
|
+
min-inline-size: 0;
|
|
445
|
+
row-gap: var(--slotted-space-2, 0.25rem);
|
|
446
|
+
}
|
|
347
447
|
}
|
|
348
448
|
|
|
349
449
|
/**
|
|
@@ -355,49 +455,60 @@
|
|
|
355
455
|
* proportion of the type rather than a scale step: it is a width of
|
|
356
456
|
* words, and it scales with them.
|
|
357
457
|
*/
|
|
358
|
-
[data-ui
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
458
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
459
|
+
:scope [data-part-label] {
|
|
460
|
+
color: var(--_ink-muted);
|
|
461
|
+
flex: 1 1 0%;
|
|
462
|
+
font-size: var(--_label-size);
|
|
463
|
+
font-weight: var(--slotted-font-weight-medium, 500);
|
|
464
|
+
line-height: var(--_label-line);
|
|
465
|
+
margin: 0;
|
|
466
|
+
min-inline-size: min(100%, 10rem);
|
|
467
|
+
overflow-wrap: break-word;
|
|
468
|
+
}
|
|
367
469
|
}
|
|
368
470
|
|
|
369
|
-
[data-ui
|
|
370
|
-
|
|
371
|
-
|
|
471
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
472
|
+
:scope [data-part-status] {
|
|
473
|
+
display: inline-flex;
|
|
474
|
+
flex: none;
|
|
475
|
+
}
|
|
372
476
|
}
|
|
373
477
|
|
|
374
478
|
/* The action takes the end of the header's first line and stays there
|
|
375
479
|
when the label wraps: it is the one thing on the card the reader presses,
|
|
376
480
|
and a corner is where a control is looked for. */
|
|
377
|
-
[data-ui
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
481
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
482
|
+
:scope [data-part-action] {
|
|
483
|
+
/* An action slot states one size for the links it holds. */
|
|
484
|
+
--slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
485
|
+
|
|
486
|
+
flex: none;
|
|
487
|
+
/* The label's line, so a link here is as tall in the fallback face as in
|
|
488
|
+
the web face and the header does not grow when the font arrives. */
|
|
489
|
+
font-size: var(--_label-size);
|
|
490
|
+
line-height: var(--_label-line);
|
|
491
|
+
margin-inline-start: auto;
|
|
492
|
+
}
|
|
384
493
|
}
|
|
385
494
|
|
|
386
495
|
/* On a finger the card's one control is a full target among 44-pixel
|
|
387
|
-
controls: a transparent `::before`
|
|
496
|
+
controls: a transparent `::before` centerd on the link or button — the
|
|
388
497
|
part itself when `render` made it one — reaches
|
|
389
498
|
the comfortable size in both axes, and the header keeps its height. */
|
|
390
499
|
@media (pointer: coarse) {
|
|
391
|
-
[data-ui
|
|
392
|
-
:is([data-part
|
|
393
|
-
|
|
500
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
501
|
+
:scope :is([data-part-action]:is(a, button), [data-part-action] > :is(a, button)) {
|
|
502
|
+
position: relative;
|
|
503
|
+
}
|
|
394
504
|
}
|
|
395
505
|
|
|
396
|
-
[data-ui
|
|
397
|
-
:is([data-part
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
506
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
507
|
+
:scope :is([data-part-action]:is(a, button), [data-part-action] > :is(a, button))::before {
|
|
508
|
+
content: '';
|
|
509
|
+
inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
|
|
510
|
+
position: absolute;
|
|
511
|
+
}
|
|
401
512
|
}
|
|
402
513
|
}
|
|
403
514
|
|
|
@@ -409,17 +520,21 @@
|
|
|
409
520
|
* so a delta that does not fit beside a wide number drops under it rather
|
|
410
521
|
* than pushing the number.
|
|
411
522
|
*/
|
|
412
|
-
[data-ui
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
523
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
524
|
+
:scope [data-part-figure] {
|
|
525
|
+
align-items: baseline;
|
|
526
|
+
column-gap: var(--slotted-space-3, 0.375rem);
|
|
527
|
+
display: flex;
|
|
528
|
+
flex-wrap: wrap;
|
|
529
|
+
row-gap: 0;
|
|
530
|
+
}
|
|
418
531
|
}
|
|
419
532
|
|
|
420
|
-
[data-ui
|
|
421
|
-
|
|
422
|
-
|
|
533
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
534
|
+
:scope [data-part-comparison] {
|
|
535
|
+
contain: inline-size;
|
|
536
|
+
flex: 1 1 100%;
|
|
537
|
+
}
|
|
423
538
|
}
|
|
424
539
|
|
|
425
540
|
/**
|
|
@@ -432,40 +547,50 @@
|
|
|
432
547
|
* to pull a large numeral's counters back together, and it is the same
|
|
433
548
|
* fraction at every size.
|
|
434
549
|
*/
|
|
435
|
-
[data-ui
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
550
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
551
|
+
:scope [data-part-value] {
|
|
552
|
+
/* The figure and its unit are two flex items on one baseline — the text
|
|
553
|
+
node is an item of its own — so the gap spaces the unit from the digit
|
|
554
|
+
on whichever side it stands. A margin on the unit, reset by
|
|
555
|
+
`:first-child` for a leading unit, hugged a trailing one: after a bare
|
|
556
|
+
figure the unit is the first element child. */
|
|
557
|
+
align-items: baseline;
|
|
558
|
+
color: var(--_ink);
|
|
559
|
+
display: inline-flex;
|
|
560
|
+
flex-wrap: wrap;
|
|
561
|
+
gap: 0.15em;
|
|
562
|
+
font-size: var(--_value-size);
|
|
563
|
+
font-variant-numeric: proportional-nums;
|
|
564
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
565
|
+
/* The figure is set at the 3xl or 4xl step, where the theme's tighter
|
|
566
|
+
tracking applies. */
|
|
567
|
+
letter-spacing: var(--slotted-letter-spacing-tighter, -0.03em);
|
|
568
|
+
unicode-bidi: plaintext;
|
|
569
|
+
line-height: var(--_value-line);
|
|
570
|
+
margin: 0;
|
|
571
|
+
min-inline-size: 0;
|
|
572
|
+
/* A number is never truncated: a value wider than its column breaks
|
|
573
|
+
rather than clips, and a consumer who wants it whole formats it
|
|
574
|
+
compact or stacks the card. */
|
|
575
|
+
overflow-wrap: break-word;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
580
|
+
:scope[data-attention] [data-part-value] {
|
|
581
|
+
color: var(--_attention-ink);
|
|
582
|
+
}
|
|
460
583
|
}
|
|
461
584
|
|
|
462
585
|
/* The unit is in the value's own line, a step down in size and weight, so
|
|
463
586
|
`$` and `%` read as annotation of the number rather than as digits. */
|
|
464
|
-
[data-ui
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
587
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
588
|
+
:scope [data-part-unit] {
|
|
589
|
+
color: var(--_ink-muted);
|
|
590
|
+
font-size: var(--_delta-size);
|
|
591
|
+
font-weight: var(--slotted-font-weight-medium, 500);
|
|
592
|
+
letter-spacing: 0;
|
|
593
|
+
}
|
|
469
594
|
}
|
|
470
595
|
|
|
471
596
|
/**
|
|
@@ -474,44 +599,62 @@
|
|
|
474
599
|
* metrics, and the tone's text role already clears the reading ratio on
|
|
475
600
|
* the surface. It sits on the value's baseline.
|
|
476
601
|
*/
|
|
477
|
-
[data-ui
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
602
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
603
|
+
:scope [data-part-delta] {
|
|
604
|
+
align-items: center;
|
|
605
|
+
color: var(--_tone-text);
|
|
606
|
+
column-gap: var(--slotted-space-1, 0.125rem);
|
|
607
|
+
display: inline-flex;
|
|
608
|
+
font-size: var(--_delta-size);
|
|
609
|
+
font-variant-numeric: tabular-nums;
|
|
610
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
611
|
+
line-height: 1;
|
|
612
|
+
/* A signed number is a run of its own: in a right-to-left document the
|
|
613
|
+
sign of `+12.4%` is a neutral character and drifts to the far end of
|
|
614
|
+
the run, so the run is laid out by its own content. */
|
|
615
|
+
unicode-bidi: plaintext;
|
|
616
|
+
white-space: nowrap;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
621
|
+
:scope [data-part-delta][data-tone='neutral'] {
|
|
622
|
+
--_tone-text: var(--_ink-muted);
|
|
623
|
+
}
|
|
495
624
|
}
|
|
496
625
|
|
|
497
|
-
[data-ui
|
|
498
|
-
|
|
626
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
627
|
+
:scope [data-part-delta][data-tone='accent'] {
|
|
628
|
+
--_tone-text: var(--slotted-tone-accent-text);
|
|
629
|
+
}
|
|
499
630
|
}
|
|
500
631
|
|
|
501
|
-
[data-ui
|
|
502
|
-
|
|
632
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
633
|
+
:scope [data-part-delta][data-tone='secondary'] {
|
|
634
|
+
--_tone-text: var(--slotted-tone-secondary-text);
|
|
635
|
+
}
|
|
503
636
|
}
|
|
504
637
|
|
|
505
|
-
[data-ui
|
|
506
|
-
|
|
638
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
639
|
+
:scope [data-part-delta][data-tone='success'] {
|
|
640
|
+
--_tone-text: var(--slotted-tone-success-text);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
:scope [data-part-delta][data-tone='info'] {
|
|
644
|
+
--_tone-text: var(--slotted-tone-info-text);
|
|
645
|
+
}
|
|
507
646
|
}
|
|
508
647
|
|
|
509
|
-
[data-ui
|
|
510
|
-
|
|
648
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
649
|
+
:scope [data-part-delta][data-tone='warning'] {
|
|
650
|
+
--_tone-text: var(--slotted-tone-warning-text);
|
|
651
|
+
}
|
|
511
652
|
}
|
|
512
653
|
|
|
513
|
-
[data-ui
|
|
514
|
-
|
|
654
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
655
|
+
:scope [data-part-delta][data-tone='danger'] {
|
|
656
|
+
--_tone-text: var(--slotted-tone-danger-text);
|
|
657
|
+
}
|
|
515
658
|
}
|
|
516
659
|
|
|
517
660
|
/**
|
|
@@ -522,38 +665,43 @@
|
|
|
522
665
|
* change draws `minus`. The binding renders the glyph inside the icon box;
|
|
523
666
|
* the part hands the box its size, and the box inherits the delta's ink.
|
|
524
667
|
*/
|
|
525
|
-
[data-ui
|
|
526
|
-
|
|
668
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
669
|
+
:scope [data-part-indicator] {
|
|
670
|
+
--slotted-icon-size: var(--_indicator-size);
|
|
527
671
|
|
|
528
|
-
|
|
529
|
-
|
|
672
|
+
display: inline-flex;
|
|
673
|
+
flex: none;
|
|
674
|
+
}
|
|
530
675
|
}
|
|
531
676
|
|
|
532
677
|
/* A reflection across the horizontal axis, not motion: nothing travels when
|
|
533
678
|
a rise becomes a fall. Time runs from the right in a right-to-left
|
|
534
679
|
document, so the rise points the other way there, as the sparkline beside
|
|
535
680
|
it does — the `directional` icon box the binding draws does that. */
|
|
536
|
-
[data-ui
|
|
537
|
-
[data-part
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
rotate: x 180deg;
|
|
681
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
682
|
+
:scope [data-part-delta][data-trend='down'] [data-part-indicator] > [data-ui-icon] {
|
|
683
|
+
rotate: x 180deg;
|
|
684
|
+
}
|
|
541
685
|
}
|
|
542
686
|
|
|
543
687
|
/* ── Comparison: the prose under the figure ───────────────────────────── */
|
|
544
688
|
|
|
545
|
-
[data-ui
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
689
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
690
|
+
:scope [data-part-comparison] {
|
|
691
|
+
color: var(--_ink-muted);
|
|
692
|
+
font-size: var(--_prose-size);
|
|
693
|
+
line-height: var(--_prose-line);
|
|
694
|
+
margin-block-start: var(--_region-gap);
|
|
695
|
+
margin: 0;
|
|
696
|
+
min-inline-size: 0;
|
|
697
|
+
overflow-wrap: anywhere;
|
|
698
|
+
}
|
|
553
699
|
}
|
|
554
700
|
|
|
555
|
-
[data-ui
|
|
556
|
-
|
|
701
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
702
|
+
:scope [data-part-period] {
|
|
703
|
+
color: var(--_ink-muted);
|
|
704
|
+
}
|
|
557
705
|
}
|
|
558
706
|
|
|
559
707
|
/* ── Trend: where a sparkline goes ────────────────────────────────────── */
|
|
@@ -566,64 +714,105 @@
|
|
|
566
714
|
* — a card with no delta, or a metric with no valence, draws its trend in
|
|
567
715
|
* the theme's blue and not in grey.
|
|
568
716
|
*/
|
|
569
|
-
[data-ui
|
|
570
|
-
|
|
571
|
-
|
|
717
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
718
|
+
:scope [data-part-trend] {
|
|
719
|
+
display: flex;
|
|
720
|
+
}
|
|
572
721
|
}
|
|
573
722
|
|
|
574
|
-
|
|
575
|
-
|
|
723
|
+
/**
|
|
724
|
+
* Beside the figure the trend is as tall as the figure — the value, the
|
|
725
|
+
* delta and the comparison under them — so its last point is read level
|
|
726
|
+
* with the number it ends at, and no gap opens above or below a line of a
|
|
727
|
+
* fixed height centerd on a taller column. The sparkline's own step is the
|
|
728
|
+
* floor, for a figure with no comparison.
|
|
729
|
+
*/
|
|
730
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
731
|
+
:scope [data-part-trend] > * {
|
|
732
|
+
block-size: auto;
|
|
733
|
+
/* No height of its own to give the row: the drawing would otherwise
|
|
734
|
+
make the figure's row taller than the figure. */
|
|
735
|
+
contain: size;
|
|
736
|
+
min-block-size: var(--_trend-floor);
|
|
737
|
+
}
|
|
576
738
|
}
|
|
577
739
|
|
|
578
|
-
[data-ui
|
|
579
|
-
|
|
740
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
741
|
+
:scope[data-tone='success'] [data-part-trend] {
|
|
742
|
+
--slotted-sparkline-color: var(--slotted-tone-success-text);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
:scope[data-tone='info'] [data-part-trend] {
|
|
746
|
+
--slotted-sparkline-color: var(--slotted-tone-info-text);
|
|
747
|
+
}
|
|
580
748
|
}
|
|
581
749
|
|
|
582
|
-
[data-ui
|
|
583
|
-
|
|
750
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
751
|
+
:scope[data-tone='danger'] [data-part-trend] {
|
|
752
|
+
--slotted-sparkline-color: var(--slotted-tone-danger-text);
|
|
753
|
+
}
|
|
584
754
|
}
|
|
585
755
|
|
|
586
|
-
[data-ui
|
|
587
|
-
|
|
756
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
757
|
+
:scope[data-tone='warning'] [data-part-trend] {
|
|
758
|
+
--slotted-sparkline-color: var(--slotted-tone-warning-text);
|
|
759
|
+
}
|
|
588
760
|
}
|
|
589
761
|
|
|
590
|
-
[data-ui
|
|
591
|
-
|
|
762
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
763
|
+
:scope[data-tone='accent'] [data-part-trend] {
|
|
764
|
+
--slotted-sparkline-color: var(--slotted-tone-accent-text);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
769
|
+
:scope[data-tone='secondary'] [data-part-trend] {
|
|
770
|
+
--slotted-sparkline-color: var(--slotted-tone-secondary-text);
|
|
771
|
+
}
|
|
592
772
|
}
|
|
593
773
|
|
|
594
|
-
[data-ui
|
|
595
|
-
|
|
774
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
775
|
+
:scope[data-fill='plain'] [data-part-trend] {
|
|
776
|
+
--slotted-sparkline-ring-color: var(--slotted-surface-raised, Canvas);
|
|
777
|
+
}
|
|
596
778
|
}
|
|
597
779
|
|
|
598
780
|
/* ── Message: what stands in for a value that is missing or failed ────── */
|
|
599
781
|
|
|
600
|
-
[data-ui
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
782
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
783
|
+
:scope [data-part-message] {
|
|
784
|
+
color: var(--_ink-muted);
|
|
785
|
+
font-size: var(--_prose-size);
|
|
786
|
+
line-height: var(--_prose-line);
|
|
787
|
+
margin: 0;
|
|
788
|
+
min-inline-size: 0;
|
|
789
|
+
overflow-wrap: anywhere;
|
|
790
|
+
}
|
|
607
791
|
}
|
|
608
792
|
|
|
609
|
-
[data-ui
|
|
610
|
-
|
|
793
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
794
|
+
:scope[data-status='error'] [data-part-message] {
|
|
795
|
+
color: var(--slotted-tone-danger-text);
|
|
796
|
+
}
|
|
611
797
|
}
|
|
612
798
|
|
|
613
799
|
/* A value that is not there is a dash in the muted step, at the value's
|
|
614
800
|
own size, so the row keeps its height and its rhythm. */
|
|
615
|
-
[data-ui
|
|
616
|
-
|
|
617
|
-
|
|
801
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
802
|
+
:scope[data-status='empty'] [data-part-value],
|
|
803
|
+
:scope[data-status='error'] [data-part-value] {
|
|
804
|
+
color: var(--_ink-muted);
|
|
805
|
+
}
|
|
618
806
|
}
|
|
619
807
|
|
|
620
808
|
/* ── Loading ──────────────────────────────────────────────────────────── */
|
|
621
809
|
|
|
622
810
|
/**
|
|
623
811
|
* The binding renders a `skeleton` in place of each text part and a block
|
|
624
|
-
* in the trend
|
|
625
|
-
*
|
|
626
|
-
*
|
|
812
|
+
* in the trend. The block is the trend region's child, so the rules that
|
|
813
|
+
* size a sparkline there size it too: the figure's height beside the
|
|
814
|
+
* figure, the card's width and `--_trend-block` on the last row. The card
|
|
815
|
+
* does not change size when the line arrives.
|
|
627
816
|
*/
|
|
628
817
|
/**
|
|
629
818
|
* The value's box is an inline flex line, so its height is its content's.
|
|
@@ -634,28 +823,9 @@
|
|
|
634
823
|
* arrived. The floor is one line of the value's own type, so the two states
|
|
635
824
|
* occupy the same box.
|
|
636
825
|
*/
|
|
637
|
-
[data-ui
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
[data-ui='stat-card'][data-loading] [data-part='trend'] {
|
|
642
|
-
--slotted-skeleton-block-size: var(
|
|
643
|
-
--slotted-sparkline-block-size,
|
|
644
|
-
var(--slotted-space-9, 2rem)
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
[data-ui='stat-card'][data-loading][data-size='sm'] [data-part='trend'] {
|
|
649
|
-
--slotted-skeleton-block-size: var(
|
|
650
|
-
--slotted-sparkline-block-size-sm,
|
|
651
|
-
var(--slotted-space-7, 1.25rem)
|
|
652
|
-
);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
[data-ui='stat-card'][data-loading][data-size='lg'] [data-part='trend'] {
|
|
656
|
-
--slotted-skeleton-block-size: var(
|
|
657
|
-
--slotted-sparkline-block-size-lg,
|
|
658
|
-
var(--slotted-space-11, 3rem)
|
|
659
|
-
);
|
|
826
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
827
|
+
:scope[data-loading] [data-part-value] {
|
|
828
|
+
min-block-size: calc(var(--_value-size) * var(--_value-line));
|
|
829
|
+
}
|
|
660
830
|
}
|
|
661
831
|
}
|