@slotted/styles 0.1.0-beta.16 → 0.1.0-beta.18
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 +1 -1
- package/src/app-shell/app-shell.css +76 -12
- package/src/app-shell/app-shell.tokens.json +5 -2
- package/src/dashboard-grid/dashboard-grid.css +30 -6
- package/src/description-list/description-list.css +22 -4
- package/src/stat-card/stat-card.css +73 -36
- package/src/stat-card/stat-card.tokens.json +3 -0
package/package.json
CHANGED
|
@@ -735,29 +735,39 @@
|
|
|
735
735
|
* under `scroll="content"`, and a scroll container clips what stands outside
|
|
736
736
|
* it. The strip is the rows' own inset wide, so it covers padding and no
|
|
737
737
|
* content. `::before` is the reach, transparent and the WCAG 2.2 floor wide.
|
|
738
|
-
*
|
|
739
|
-
*
|
|
738
|
+
*
|
|
739
|
+
* It draws the `splitter` family's mark from that family's tokens: two
|
|
740
|
+
* hairlines fading away from a grip, visible at rest. Under the hand, the
|
|
741
|
+
* drag and the keyboard the lines run the strip in the active step, and the
|
|
742
|
+
* keyboard alone adds the ring. The measures are `splitter.css`'s.
|
|
740
743
|
*/
|
|
741
744
|
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer] {
|
|
742
745
|
--_resizer-thickness: var(--slotted-space-6, 1rem);
|
|
743
746
|
--_resizer-reach: var(--slotted-target-min, 24px);
|
|
747
|
+
--_resizer-gap: min(var(--slotted-space-9, 2rem), 12%);
|
|
748
|
+
--_resizer-dot: var(--slotted-space-2, 0.25rem);
|
|
749
|
+
--_resizer-rest: var(--slotted-splitter-line-color, var(--slotted-border-strong, ButtonBorder));
|
|
750
|
+
--_resizer-active: var(
|
|
751
|
+
--slotted-splitter-line-active-color,
|
|
752
|
+
var(--slotted-text-muted, ButtonText)
|
|
753
|
+
);
|
|
754
|
+
align-items: center;
|
|
744
755
|
background: transparent;
|
|
745
|
-
border: 0 solid transparent;
|
|
746
|
-
border-inline-start-width: var(--slotted-border-width-thick, 2px);
|
|
747
756
|
box-sizing: border-box;
|
|
748
757
|
cursor: col-resize;
|
|
749
758
|
display: none;
|
|
759
|
+
flex-direction: column;
|
|
760
|
+
gap: var(--_resizer-gap);
|
|
750
761
|
inline-size: var(--_resizer-thickness);
|
|
751
762
|
inset-block: 0;
|
|
752
763
|
inset-inline-start: 0;
|
|
764
|
+
justify-content: center;
|
|
753
765
|
position: absolute;
|
|
754
766
|
touch-action: none;
|
|
755
|
-
transition:
|
|
767
|
+
transition: gap var(--_duration) var(--_easing);
|
|
756
768
|
z-index: 1;
|
|
757
769
|
}
|
|
758
770
|
[data-ui-app-shell][data-nav-side='end'] > [data-part-aside] > [data-part-aside-resizer] {
|
|
759
|
-
border-inline-end-width: var(--slotted-border-width-thick, 2px);
|
|
760
|
-
border-inline-start-width: 0;
|
|
761
771
|
inset-inline-end: 0;
|
|
762
772
|
inset-inline-start: auto;
|
|
763
773
|
}
|
|
@@ -767,13 +777,57 @@
|
|
|
767
777
|
inset-inline: calc((var(--_resizer-reach) - var(--_resizer-thickness)) / -2);
|
|
768
778
|
position: absolute;
|
|
769
779
|
}
|
|
780
|
+
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer] > [data-part-line] {
|
|
781
|
+
border-radius: var(--slotted-radius-sm, 2px);
|
|
782
|
+
flex: 0 1 min(var(--slotted-space-12, 4rem), 20%);
|
|
783
|
+
inline-size: var(--slotted-border-width-thin, 1px);
|
|
784
|
+
min-block-size: 0;
|
|
785
|
+
transition:
|
|
786
|
+
flex-basis var(--_duration) var(--_easing),
|
|
787
|
+
background-color var(--_duration) var(--_easing);
|
|
788
|
+
}
|
|
789
|
+
[data-ui-app-shell]
|
|
790
|
+
> [data-part-aside]
|
|
791
|
+
> [data-part-aside-resizer]
|
|
792
|
+
> [data-part-line]:first-child {
|
|
793
|
+
background: linear-gradient(to bottom, transparent, var(--_resizer-rest));
|
|
794
|
+
}
|
|
795
|
+
[data-ui-app-shell]
|
|
796
|
+
> [data-part-aside]
|
|
797
|
+
> [data-part-aside-resizer]
|
|
798
|
+
> [data-part-line]:last-child {
|
|
799
|
+
background: linear-gradient(to top, transparent, var(--_resizer-rest));
|
|
800
|
+
}
|
|
801
|
+
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer] > [data-part-grip] {
|
|
802
|
+
background-image: radial-gradient(circle at center, currentColor 40%, transparent 42%);
|
|
803
|
+
background-repeat: repeat;
|
|
804
|
+
background-size: var(--_resizer-dot) var(--_resizer-dot);
|
|
805
|
+
block-size: calc(3 * var(--_resizer-dot));
|
|
806
|
+
color: var(--_resizer-rest);
|
|
807
|
+
flex: none;
|
|
808
|
+
inline-size: calc(2 * var(--_resizer-dot));
|
|
809
|
+
transition: color var(--_duration) var(--_easing);
|
|
810
|
+
}
|
|
770
811
|
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer]:not([data-disabled]):hover,
|
|
771
812
|
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer]:focus-visible,
|
|
772
813
|
[data-ui-app-shell][data-dragging] > [data-part-aside] > [data-part-aside-resizer] {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
814
|
+
--_resizer-gap: var(--slotted-space-4, 0.5rem);
|
|
815
|
+
--_resizer-rest: var(--_resizer-active);
|
|
816
|
+
}
|
|
817
|
+
[data-ui-app-shell]
|
|
818
|
+
> [data-part-aside]
|
|
819
|
+
> [data-part-aside-resizer]:not([data-disabled]):hover
|
|
820
|
+
> [data-part-line],
|
|
821
|
+
[data-ui-app-shell]
|
|
822
|
+
> [data-part-aside]
|
|
823
|
+
> [data-part-aside-resizer]:focus-visible
|
|
824
|
+
> [data-part-line],
|
|
825
|
+
[data-ui-app-shell][data-dragging]
|
|
826
|
+
> [data-part-aside]
|
|
827
|
+
> [data-part-aside-resizer]
|
|
828
|
+
> [data-part-line] {
|
|
829
|
+
background: var(--_resizer-active);
|
|
830
|
+
flex-basis: 100%;
|
|
777
831
|
}
|
|
778
832
|
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer]:focus-visible {
|
|
779
833
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
@@ -1437,6 +1491,16 @@
|
|
|
1437
1491
|
--_seam: var(--_rule-width) solid CanvasText;
|
|
1438
1492
|
--_seam-width: var(--_rule-width);
|
|
1439
1493
|
}
|
|
1494
|
+
/* A gradient resolves to nothing here, so the edge's mark takes flat system colours. */
|
|
1495
|
+
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer] > [data-part-line] {
|
|
1496
|
+
background: ButtonBorder;
|
|
1497
|
+
forced-color-adjust: none;
|
|
1498
|
+
}
|
|
1499
|
+
[data-ui-app-shell] > [data-part-aside] > [data-part-aside-resizer] > [data-part-grip] {
|
|
1500
|
+
background-color: ButtonBorder;
|
|
1501
|
+
background-image: none;
|
|
1502
|
+
forced-color-adjust: none;
|
|
1503
|
+
}
|
|
1440
1504
|
}
|
|
1441
1505
|
|
|
1442
1506
|
/* ── The disclosure controls ─────────────────────────────────────────── */
|
|
@@ -1834,7 +1898,7 @@
|
|
|
1834
1898
|
[data-ui-app-shell]:not([data-aside-mode='overlay'])
|
|
1835
1899
|
> [data-part-aside]
|
|
1836
1900
|
> [data-part-aside-resizer]:not([hidden]) {
|
|
1837
|
-
display:
|
|
1901
|
+
display: flex;
|
|
1838
1902
|
}
|
|
1839
1903
|
[data-ui-app-shell]:not([data-aside-mode='overlay'])[data-nav-side='end'] > [data-part-aside] {
|
|
1840
1904
|
grid-area: 2 / 1 / 3 / 2;
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"--slotted-app-shell-nav-surface",
|
|
30
30
|
"--slotted-app-shell-radius",
|
|
31
31
|
"--slotted-app-shell-rail-size",
|
|
32
|
-
"--slotted-app-shell-resizer-color",
|
|
33
32
|
"--slotted-app-shell-row-inset-size",
|
|
34
33
|
"--slotted-app-shell-row-mark-size",
|
|
35
34
|
"--slotted-app-shell-row-text-line-height",
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
"--slotted-app-shell-tone-surface",
|
|
41
40
|
"--slotted-border-strong",
|
|
42
41
|
"--slotted-border-subtle",
|
|
43
|
-
"--slotted-border-width-thick",
|
|
44
42
|
"--slotted-border-width-thin",
|
|
45
43
|
"--slotted-control-font-size-md",
|
|
46
44
|
"--slotted-control-font-size-sm",
|
|
@@ -66,16 +64,21 @@
|
|
|
66
64
|
"--slotted-font-weight-semibold",
|
|
67
65
|
"--slotted-line-height-sm",
|
|
68
66
|
"--slotted-radius-lg",
|
|
67
|
+
"--slotted-radius-sm",
|
|
69
68
|
"--slotted-scrim",
|
|
70
69
|
"--slotted-shadow-lg",
|
|
71
70
|
"--slotted-shadow-md",
|
|
72
71
|
"--slotted-shadow-xs",
|
|
73
72
|
"--slotted-space-1",
|
|
73
|
+
"--slotted-space-12",
|
|
74
74
|
"--slotted-space-2",
|
|
75
75
|
"--slotted-space-3",
|
|
76
76
|
"--slotted-space-4",
|
|
77
77
|
"--slotted-space-5",
|
|
78
78
|
"--slotted-space-6",
|
|
79
|
+
"--slotted-space-9",
|
|
80
|
+
"--slotted-splitter-line-active-color",
|
|
81
|
+
"--slotted-splitter-line-color",
|
|
79
82
|
"--slotted-surface",
|
|
80
83
|
"--slotted-surface-sunken",
|
|
81
84
|
"--slotted-target-min",
|
|
@@ -29,10 +29,20 @@
|
|
|
29
29
|
min-inline-size: 0;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A row is the unit a reader moves and resizes by; the tracks are twelve
|
|
34
|
+
* times finer (`DASHBOARD_SUBROWS` in `@slotted/core/dashboard-grid`), so a
|
|
35
|
+
* widget sized by its content ends within a twelfth of a row's step of it.
|
|
36
|
+
* The tracks have no gap between them: each widget draws the gap as its
|
|
37
|
+
* margin below, inside its own cells, and the grid takes the last one back.
|
|
38
|
+
* A widget of `h` rows is `h` rows and `h - 1` gaps tall, as before.
|
|
39
|
+
*/
|
|
32
40
|
[data-ui-dashboard-grid] > [data-part-grid] {
|
|
41
|
+
column-gap: var(--_gap);
|
|
33
42
|
display: grid;
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
grid-auto-rows: calc((var(--_row) + var(--_gap)) / 12);
|
|
44
|
+
margin-block-end: calc(-1 * var(--_gap));
|
|
45
|
+
row-gap: 0;
|
|
36
46
|
grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
|
|
37
47
|
list-style: none;
|
|
38
48
|
margin: 0;
|
|
@@ -54,7 +64,8 @@
|
|
|
54
64
|
*/
|
|
55
65
|
[data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
|
|
56
66
|
grid-column: var(--_dg-x, auto) / span var(--_dg-w, 4);
|
|
57
|
-
grid-row: var(--_dg-y, auto) / span var(--_dg-h,
|
|
67
|
+
grid-row: var(--_dg-y, auto) / span var(--_dg-h, 24);
|
|
68
|
+
margin-block-end: var(--_gap);
|
|
58
69
|
min-block-size: 0;
|
|
59
70
|
min-inline-size: 0;
|
|
60
71
|
}
|
|
@@ -82,7 +93,7 @@
|
|
|
82
93
|
[data-ui-dashboard-grid]:not([data-size-class])
|
|
83
94
|
:is([data-part-widget], [data-part-placeholder]) {
|
|
84
95
|
grid-column: auto / span var(--_dg-span-medium, 3);
|
|
85
|
-
grid-row: auto / span var(--_dg-h,
|
|
96
|
+
grid-row: auto / span var(--_dg-h, 24);
|
|
86
97
|
}
|
|
87
98
|
}
|
|
88
99
|
|
|
@@ -94,7 +105,7 @@
|
|
|
94
105
|
[data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
|
|
95
106
|
:is([data-part-widget], [data-part-placeholder]) {
|
|
96
107
|
grid-column: auto / span var(--_dg-span-medium, 3);
|
|
97
|
-
grid-row: auto / span var(--_dg-h,
|
|
108
|
+
grid-row: auto / span var(--_dg-h, 24);
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
@container dashboard-grid (width < 600px) {
|
|
@@ -148,8 +159,11 @@
|
|
|
148
159
|
|
|
149
160
|
[data-ui-dashboard-grid] [data-part-widget] > [data-ui-card] > [data-part-body] {
|
|
150
161
|
/* A chart's plot takes whatever height the widget leaves it, down to a
|
|
151
|
-
floor of one and a half rows, instead of its own size step
|
|
162
|
+
floor of one and a half rows, instead of its own size step: the
|
|
163
|
+
reader sizes a widget, and every step answers to that size. */
|
|
152
164
|
--slotted-chart-plot-block-size: calc(var(--_row) * 1.5);
|
|
165
|
+
--slotted-chart-plot-block-size-sm: calc(var(--_row) * 1.5);
|
|
166
|
+
--slotted-chart-plot-block-size-lg: calc(var(--_row) * 1.5);
|
|
153
167
|
|
|
154
168
|
display: flex;
|
|
155
169
|
flex-direction: column;
|
|
@@ -168,6 +182,16 @@
|
|
|
168
182
|
flex: 1 0 auto;
|
|
169
183
|
}
|
|
170
184
|
|
|
185
|
+
/* A widget sized by its content is measured by it: what its body holds
|
|
186
|
+
keeps its own height, and the cell is that height to a twelfth of a row. */
|
|
187
|
+
[data-ui-dashboard-grid]
|
|
188
|
+
[data-part-widget][data-rows='auto']
|
|
189
|
+
> [data-ui-card]
|
|
190
|
+
> [data-part-body]
|
|
191
|
+
> :not([data-part-busy-indicator]) {
|
|
192
|
+
flex-grow: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
171
195
|
/**
|
|
172
196
|
* The title is the widget's name and a card header's first line: the
|
|
173
197
|
* medium step, semibold, two lines and then an ellipsis. The clamp never
|
|
@@ -587,7 +587,9 @@
|
|
|
587
587
|
* before it gives up on the row.
|
|
588
588
|
*
|
|
589
589
|
* The breakpoints are literals because a container condition cannot read a
|
|
590
|
-
* custom property, which rule 4 of `docs/token-foundation.md` states.
|
|
590
|
+
* custom property, which rule 4 of `docs/token-foundation.md` states. That is
|
|
591
|
+
* why `data-min-column-width` is a step and not a length: `md` folds at
|
|
592
|
+
* sixteen and seventeen rem a column, `sm` at twelve and a half.
|
|
591
593
|
*/
|
|
592
594
|
/**
|
|
593
595
|
* A span is stated in tracks, so it collapses with the count that produced
|
|
@@ -598,15 +600,31 @@
|
|
|
598
600
|
* of a four-track grid.
|
|
599
601
|
*/
|
|
600
602
|
@container slotted-description-list (max-width: 48rem) {
|
|
601
|
-
[data-ui-description-list][data-columns='3'] [data-part-list] {
|
|
603
|
+
[data-ui-description-list][data-min-column-width='md'][data-columns='3'] [data-part-list] {
|
|
602
604
|
--_cols: repeat(2, var(--_pair));
|
|
603
605
|
--_span-3: var(--_span-2);
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
608
|
|
|
609
|
+
@container slotted-description-list (max-width: 37.5rem) {
|
|
610
|
+
[data-ui-description-list][data-min-column-width='sm'][data-columns='3'] [data-part-list] {
|
|
611
|
+
--_cols: repeat(2, var(--_pair));
|
|
612
|
+
--_span-3: var(--_span-2);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
@container slotted-description-list (max-width: 25rem) {
|
|
617
|
+
[data-ui-description-list][data-min-column-width='sm'][data-columns='2'] [data-part-list],
|
|
618
|
+
[data-ui-description-list][data-min-column-width='sm'][data-columns='3'] [data-part-list] {
|
|
619
|
+
--_cols: var(--_pair);
|
|
620
|
+
--_span-2: var(--_span-1);
|
|
621
|
+
--_span-3: var(--_span-1);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
607
625
|
@container slotted-description-list (max-width: 34rem) {
|
|
608
|
-
[data-ui-description-list][data-columns='2'] [data-part-list],
|
|
609
|
-
[data-ui-description-list][data-columns='3'] [data-part-list] {
|
|
626
|
+
[data-ui-description-list][data-min-column-width='md'][data-columns='2'] [data-part-list],
|
|
627
|
+
[data-ui-description-list][data-min-column-width='md'][data-columns='3'] [data-part-list] {
|
|
610
628
|
--_cols: var(--_pair);
|
|
611
629
|
--_span-2: var(--_span-1);
|
|
612
630
|
--_span-3: var(--_span-1);
|
|
@@ -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));
|
|
@@ -102,6 +109,8 @@
|
|
|
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)
|
|
@@ -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,
|
|
@@ -239,8 +250,8 @@
|
|
|
239
250
|
grid-template-areas:
|
|
240
251
|
'header'
|
|
241
252
|
'figure'
|
|
242
|
-
'
|
|
243
|
-
'
|
|
253
|
+
'message'
|
|
254
|
+
'trend';
|
|
244
255
|
grid-template-columns: minmax(0, 1fr);
|
|
245
256
|
grid-template-rows: auto minmax(0, 1fr) auto auto;
|
|
246
257
|
}
|
|
@@ -281,7 +292,7 @@
|
|
|
281
292
|
/* The marker's ring is the card's ground, not the page's. */
|
|
282
293
|
--slotted-sparkline-ring-color: var(--_surface);
|
|
283
294
|
|
|
284
|
-
align-self:
|
|
295
|
+
align-self: stretch;
|
|
285
296
|
container-name: stat-card-trend;
|
|
286
297
|
container-type: inline-size;
|
|
287
298
|
grid-area: trend;
|
|
@@ -298,10 +309,32 @@
|
|
|
298
309
|
}
|
|
299
310
|
}
|
|
300
311
|
|
|
312
|
+
/**
|
|
313
|
+
* On the last row the trend reaches the card's edges: its sides and its
|
|
314
|
+
* bottom bleed through the inset, and the card's corners round it. A line
|
|
315
|
+
* drawn inside the inset ends a gutter short of each edge and reads as a
|
|
316
|
+
* picture placed in the card; a line that runs to the frame reads as the
|
|
317
|
+
* card's ground. The edge is drawn over it, out of flow. A plain card has
|
|
318
|
+
* no inset, so the margins are nought there.
|
|
319
|
+
*/
|
|
301
320
|
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
302
321
|
:scope[data-layout='stacked'] [data-part-trend] {
|
|
303
322
|
align-self: end;
|
|
323
|
+
border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
|
|
324
|
+
border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
|
|
325
|
+
margin-block-end: calc(-1 * var(--_inset-block));
|
|
304
326
|
margin-block-start: var(--slotted-space-2, 0.25rem);
|
|
327
|
+
margin-inline: calc(-1 * var(--_inset-inline));
|
|
328
|
+
overflow: clip;
|
|
329
|
+
/* The region is wider than the column by the two insets. */
|
|
330
|
+
inline-size: auto;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
335
|
+
:scope[data-layout='stacked'] [data-part-trend] > * {
|
|
336
|
+
block-size: var(--_trend-block);
|
|
337
|
+
min-block-size: 0;
|
|
305
338
|
}
|
|
306
339
|
}
|
|
307
340
|
|
|
@@ -324,8 +357,8 @@
|
|
|
324
357
|
grid-template-areas:
|
|
325
358
|
'header'
|
|
326
359
|
'figure'
|
|
327
|
-
'
|
|
328
|
-
'
|
|
360
|
+
'message'
|
|
361
|
+
'trend';
|
|
329
362
|
grid-template-columns: minmax(0, 1fr);
|
|
330
363
|
grid-template-rows: auto minmax(0, 1fr) auto auto;
|
|
331
364
|
}
|
|
@@ -334,7 +367,21 @@
|
|
|
334
367
|
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
335
368
|
:scope [data-part-trend] {
|
|
336
369
|
align-self: end;
|
|
370
|
+
border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
|
|
371
|
+
border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
|
|
372
|
+
margin-block-end: calc(-1 * var(--_inset-block));
|
|
337
373
|
margin-block-start: var(--slotted-space-2, 0.25rem);
|
|
374
|
+
margin-inline: calc(-1 * var(--_inset-inline));
|
|
375
|
+
overflow: clip;
|
|
376
|
+
/* The region is wider than the column by the two insets. */
|
|
377
|
+
inline-size: auto;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
382
|
+
:scope [data-part-trend] > * {
|
|
383
|
+
block-size: var(--_trend-block);
|
|
384
|
+
min-block-size: 0;
|
|
338
385
|
}
|
|
339
386
|
}
|
|
340
387
|
|
|
@@ -636,11 +683,27 @@
|
|
|
636
683
|
*/
|
|
637
684
|
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
638
685
|
:scope [data-part-trend] {
|
|
639
|
-
align-self: center;
|
|
640
686
|
display: flex;
|
|
641
687
|
}
|
|
642
688
|
}
|
|
643
689
|
|
|
690
|
+
/**
|
|
691
|
+
* Beside the figure the trend is as tall as the figure — the value, the
|
|
692
|
+
* delta and the comparison under them — so its last point is read level
|
|
693
|
+
* with the number it ends at, and no gap opens above or below a line of a
|
|
694
|
+
* fixed height centred on a taller column. The sparkline's own step is the
|
|
695
|
+
* floor, for a figure with no comparison.
|
|
696
|
+
*/
|
|
697
|
+
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
698
|
+
:scope [data-part-trend] > * {
|
|
699
|
+
block-size: auto;
|
|
700
|
+
/* No height of its own to give the row: the drawing would otherwise
|
|
701
|
+
make the figure's row taller than the figure. */
|
|
702
|
+
contain: size;
|
|
703
|
+
min-block-size: var(--_trend-floor);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
644
707
|
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
645
708
|
:scope[data-tone='success'] [data-part-trend] {
|
|
646
709
|
--slotted-sparkline-color: var(--slotted-tone-success-text);
|
|
@@ -713,9 +776,10 @@
|
|
|
713
776
|
|
|
714
777
|
/**
|
|
715
778
|
* The binding renders a `skeleton` in place of each text part and a block
|
|
716
|
-
* in the trend
|
|
717
|
-
*
|
|
718
|
-
*
|
|
779
|
+
* in the trend. The block is the trend region's child, so the rules that
|
|
780
|
+
* size a sparkline there size it too: the figure's height beside the
|
|
781
|
+
* figure, the card's width and `--_trend-block` on the last row. The card
|
|
782
|
+
* does not change size when the line arrives.
|
|
719
783
|
*/
|
|
720
784
|
/**
|
|
721
785
|
* The value's box is an inline flex line, so its height is its content's.
|
|
@@ -731,31 +795,4 @@
|
|
|
731
795
|
min-block-size: calc(var(--_value-size) * var(--_value-line));
|
|
732
796
|
}
|
|
733
797
|
}
|
|
734
|
-
|
|
735
|
-
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
736
|
-
:scope[data-loading] [data-part-trend] {
|
|
737
|
-
--slotted-skeleton-block-size: var(
|
|
738
|
-
--slotted-sparkline-block-size,
|
|
739
|
-
var(--slotted-space-9, 2rem)
|
|
740
|
-
);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
745
|
-
:scope[data-loading][data-size='sm'] [data-part-trend] {
|
|
746
|
-
--slotted-skeleton-block-size: var(
|
|
747
|
-
--slotted-sparkline-block-size-sm,
|
|
748
|
-
var(--slotted-space-7, 1.25rem)
|
|
749
|
-
);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
@scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
|
|
754
|
-
:scope[data-loading][data-size='lg'] [data-part-trend] {
|
|
755
|
-
--slotted-skeleton-block-size: var(
|
|
756
|
-
--slotted-sparkline-block-size-lg,
|
|
757
|
-
var(--slotted-space-11, 3rem)
|
|
758
|
-
);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
798
|
}
|
|
@@ -72,6 +72,9 @@
|
|
|
72
72
|
"--slotted-stat-card-region-gap-sm",
|
|
73
73
|
"--slotted-stat-card-shadow",
|
|
74
74
|
"--slotted-stat-card-shadow-elevated",
|
|
75
|
+
"--slotted-stat-card-trend-block-size",
|
|
76
|
+
"--slotted-stat-card-trend-block-size-lg",
|
|
77
|
+
"--slotted-stat-card-trend-block-size-sm",
|
|
75
78
|
"--slotted-stat-card-trend-gap",
|
|
76
79
|
"--slotted-stat-card-trend-gap-lg",
|
|
77
80
|
"--slotted-stat-card-trend-gap-sm",
|