@expressivecss/expressive 0.12.0 → 0.13.1
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 +231 -1
- package/README.md +37 -1
- package/dist/css/expressive.css +5111 -36
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/{chunk-HLDXZ7XB.mjs → chunk-3CLXLPYS.mjs} +2 -2
- package/dist/js/chunks/chunk-3DHK5CZU.mjs +105 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs.map +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs.map +7 -0
- package/dist/js/chunks/{chunk-HB6IW7QQ.mjs → chunk-55IA2XUC.mjs} +2 -2
- package/dist/js/chunks/chunk-CCWDV5CR.mjs +292 -0
- package/dist/js/chunks/chunk-CCWDV5CR.mjs.map +7 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs +270 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs.map +7 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs +47 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs.map +7 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs +48 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs.map +7 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs +262 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs.map +7 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs +163 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs.map +7 -0
- package/dist/js/chunks/chunk-NQLC3YMW.mjs +1 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs +406 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs +166 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs.map +7 -0
- package/dist/js/chunks/{chunk-H2WA4XHH.mjs → chunk-PLYXLSH3.mjs} +4 -4
- package/dist/js/chunks/chunk-QKWPQK5N.mjs +179 -0
- package/dist/js/chunks/chunk-QKWPQK5N.mjs.map +7 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs +139 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs.map +7 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs +59 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs.map +7 -0
- package/dist/js/chunks/{chunk-YSBCHYXP.mjs → chunk-U2OTHOTI.mjs} +116 -12
- package/dist/js/chunks/chunk-U2OTHOTI.mjs.map +7 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs +124 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-RFZZCYVU.mjs → chunk-XGHORT7J.mjs} +2 -2
- package/dist/js/chunks/{chunk-HNFSMIBY.mjs → chunk-XH6BEEMY.mjs} +69 -16
- package/dist/js/chunks/chunk-XH6BEEMY.mjs.map +7 -0
- package/dist/js/expressive.cjs +2209 -32
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +2209 -32
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +10 -10
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +68 -20
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/forms.mjs +1 -1
- package/dist/js/internal/components/autocomplete.mjs +2 -2
- package/dist/js/internal/components/barChart.mjs +10 -0
- package/dist/js/internal/components/barChart.mjs.map +7 -0
- package/dist/js/internal/components/chips.mjs +3 -3
- package/dist/js/internal/components/columnChart.mjs +9 -0
- package/dist/js/internal/components/columnChart.mjs.map +7 -0
- package/dist/js/internal/components/commandPalette.mjs +9 -0
- package/dist/js/internal/components/commandPalette.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +3 -3
- package/dist/js/internal/components/heatmapChart.mjs +9 -0
- package/dist/js/internal/components/heatmapChart.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +65 -17
- package/dist/js/internal/components/lineChart.mjs +12 -0
- package/dist/js/internal/components/lineChart.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +1 -1
- package/dist/js/internal/components/messageScroller.mjs +9 -0
- package/dist/js/internal/components/messageScroller.mjs.map +7 -0
- package/dist/js/internal/components/mixedChart.mjs +10 -0
- package/dist/js/internal/components/mixedChart.mjs.map +7 -0
- package/dist/js/internal/components/pieChart.mjs +9 -0
- package/dist/js/internal/components/pieChart.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +9 -0
- package/dist/js/internal/components/questionnaire.mjs.map +7 -0
- package/dist/js/internal/components/radarChart.mjs +9 -0
- package/dist/js/internal/components/radarChart.mjs.map +7 -0
- package/dist/js/internal/components/radialChart.mjs +9 -0
- package/dist/js/internal/components/radialChart.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +23 -11
- package/dist/js/internal/components/richTextEditor.mjs +9 -0
- package/dist/js/internal/components/richTextEditor.mjs.map +7 -0
- package/dist/js/internal/components/select.mjs +2 -2
- package/dist/js/modular.mjs +68 -20
- package/dist/types/behaviors/forms.d.ts +22 -0
- package/dist/types/components/barChart.d.ts +24 -0
- package/dist/types/components/columnChart.d.ts +21 -0
- package/dist/types/components/commandPalette.d.ts +96 -0
- package/dist/types/components/heatmapChart.d.ts +49 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/lineChart.d.ts +134 -0
- package/dist/types/components/menu.d.ts +31 -0
- package/dist/types/components/messageScroller.d.ts +111 -0
- package/dist/types/components/mixedChart.d.ts +25 -0
- package/dist/types/components/pieChart.d.ts +40 -0
- package/dist/types/components/questionnaire.d.ts +96 -0
- package/dist/types/components/radarChart.d.ts +39 -0
- package/dist/types/components/radialChart.d.ts +45 -0
- package/dist/types/components/registry.d.ts +44 -0
- package/dist/types/components/richTextEditor.d.ts +71 -0
- package/dist/types/modular.d.ts +10 -1
- package/package.json +4 -1
- package/src/sass/README.md +3 -6
- package/src/sass/abstracts/_index.scss +1 -1
- package/src/sass/abstracts/_mixins.scss +226 -0
- package/src/sass/abstracts/_variables.scss +14 -0
- package/src/sass/base/_typography.scss +45 -0
- package/src/sass/components/_accordion.scss +161 -0
- package/src/sass/components/_aura.scss +119 -0
- package/src/sass/components/_avatar.scss +86 -0
- package/src/sass/components/_bar-chart.scss +285 -0
- package/src/sass/components/_bottom-sheet.scss +1 -0
- package/src/sass/components/_button-groups.scss +13 -3
- package/src/sass/components/_cards.scss +16 -13
- package/src/sass/components/_column-chart.scss +134 -0
- package/src/sass/components/_command-palette.scss +140 -0
- package/src/sass/components/_countdown.scss +89 -0
- package/src/sass/components/_data-table.scss +188 -0
- package/src/sass/components/_dialog.scss +1 -0
- package/src/sass/components/_empty-state.scss +78 -0
- package/src/sass/components/_expanding-card.scss +3 -0
- package/src/sass/components/_heatmap-chart.scss +156 -0
- package/src/sass/components/_index.scss +27 -0
- package/src/sass/components/_kpi.scss +162 -0
- package/src/sass/components/_line-chart.scss +102 -0
- package/src/sass/components/_marquee.scss +111 -0
- package/src/sass/components/_menu.scss +10 -0
- package/src/sass/components/_message-scroller.scss +66 -0
- package/src/sass/components/_message.scss +202 -0
- package/src/sass/components/_mixed-chart.scss +157 -0
- package/src/sass/components/_navigation-bar.scss +1 -0
- package/src/sass/components/_navigation-rail.scss +9 -0
- package/src/sass/components/_pie-chart.scss +203 -0
- package/src/sass/components/_popover.scss +112 -0
- package/src/sass/components/_questionnaire.scss +144 -0
- package/src/sass/components/_radar-chart.scss +205 -0
- package/src/sass/components/_radial-chart.scss +174 -0
- package/src/sass/components/_rich-text-editor.scss +99 -0
- package/src/sass/components/_search.scss +1 -0
- package/src/sass/components/_side-sheet.scss +1 -0
- package/src/sass/components/_skeleton.scss +81 -0
- package/src/sass/components/_snackbar.scss +1 -0
- package/src/sass/components/_stat.scss +86 -0
- package/src/sass/components/_stepper.scss +190 -0
- package/src/sass/components/_timeline.scss +114 -0
- package/src/sass/components/_toolbar.scss +1 -0
- package/src/sass/components/_tooltip.scss +2 -0
- package/src/sass/components/_tree.scss +139 -0
- package/src/sass/components/forms/_drop-zone.scss +128 -0
- package/src/sass/components/forms/_index.scss +2 -0
- package/src/sass/components/forms/_input-fields.scss +133 -2
- package/src/sass/components/forms/_rating.scss +165 -0
- package/src/sass/tokens/_reference.scss +3 -15
- package/src/sass/utilities/_index.scss +2 -0
- package/src/sass/utilities/_scroll-area.scss +35 -0
- package/src/sass/utilities/_shapes.scss +164 -0
- package/dist/js/chunks/chunk-G3I5H2U3.mjs +0 -7
- package/dist/js/chunks/chunk-G3I5H2U3.mjs.map +0 -7
- package/dist/js/chunks/chunk-HNFSMIBY.mjs.map +0 -7
- package/dist/js/chunks/chunk-PSSHQWCX.mjs +0 -100
- package/dist/js/chunks/chunk-PSSHQWCX.mjs.map +0 -7
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +0 -1
- package/dist/js/chunks/chunk-YSBCHYXP.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-HLDXZ7XB.mjs.map → chunk-3CLXLPYS.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-HB6IW7QQ.mjs.map → chunk-55IA2XUC.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-WWPAPHMA.mjs.map → chunk-NQLC3YMW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-H2WA4XHH.mjs.map → chunk-PLYXLSH3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-RFZZCYVU.mjs.map → chunk-XGHORT7J.mjs.map} +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
3
|
+
// Mixed chart. The same <figure>, <figcaption> and <table> as a line
|
|
4
|
+
// chart; MixedChart draws each series by its header cell's class: `column`
|
|
5
|
+
// as columns from zero, `area` as a line over a fading fill, and anything
|
|
6
|
+
// else as a line. `dashed` dashes a line. A series with `end` is drawn
|
|
7
|
+
// against a second scale, set by data-end-min and data-end-max on the
|
|
8
|
+
// figure. The plot, tooltip, labels and legend come from chart().
|
|
9
|
+
//
|
|
10
|
+
// Columns are full-height spans clipped to their value, as in the column
|
|
11
|
+
// chart, behind an SVG of the lines and areas, as in the line chart.
|
|
12
|
+
// Points on the cursor mark each line; the cursor bands the whole row.
|
|
13
|
+
//
|
|
14
|
+
// Tokens:
|
|
15
|
+
// --md-comp-mixed-chart-height 240px (sparkline 48px)
|
|
16
|
+
// --md-comp-mixed-chart-column-width 50% of each row's width
|
|
17
|
+
// --md-comp-mixed-chart-shape 4px, the column's end radius
|
|
18
|
+
// --md-comp-mixed-chart-line-width 3px (sparkline 2px)
|
|
19
|
+
// --md-comp-mixed-chart-grid-color outline-variant
|
|
20
|
+
// --md-comp-mixed-chart-color-1..4 primary, tertiary, secondary,
|
|
21
|
+
// on-surface-variant
|
|
22
|
+
|
|
23
|
+
@include chart("mixed-chart");
|
|
24
|
+
|
|
25
|
+
.mixed-chart {
|
|
26
|
+
--md-comp-mixed-chart-column-width: 50%;
|
|
27
|
+
--md-comp-mixed-chart-shape: 4px;
|
|
28
|
+
--md-comp-mixed-chart-line-width: 3px;
|
|
29
|
+
|
|
30
|
+
&.sparkline {
|
|
31
|
+
--md-comp-mixed-chart-line-width: 2px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mixed-chart-plot {
|
|
36
|
+
isolation: isolate;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.mixed-chart-marks,
|
|
40
|
+
.mixed-chart-marks > * {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.mixed-chart-marks > svg {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
overflow: visible;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.mixed-chart-columns {
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
54
|
+
grid-auto-flow: column;
|
|
55
|
+
|
|
56
|
+
// A row: its columns side by side.
|
|
57
|
+
> div {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
60
|
+
grid-auto-flow: column;
|
|
61
|
+
gap: 2px;
|
|
62
|
+
justify-self: center;
|
|
63
|
+
width: var(--md-comp-mixed-chart-column-width);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
> div > span {
|
|
67
|
+
--mixed-chart-ends: var(--md-comp-mixed-chart-shape) var(--md-comp-mixed-chart-shape) 0 0;
|
|
68
|
+
|
|
69
|
+
background-color: var(--mixed-chart-color);
|
|
70
|
+
clip-path: inset(var(--top, 100%) 0 var(--bottom, 0%) round var(--mixed-chart-ends));
|
|
71
|
+
|
|
72
|
+
// A column below zero has its tip at the bottom.
|
|
73
|
+
&.negative {
|
|
74
|
+
--mixed-chart-ends: 0 0 var(--md-comp-mixed-chart-shape) var(--md-comp-mixed-chart-shape);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
79
|
+
> div > span {
|
|
80
|
+
transition: clip-path 400ms cubic-bezier(0.2, 0, 0, 1);
|
|
81
|
+
|
|
82
|
+
@starting-style {
|
|
83
|
+
clip-path: inset(var(--zero, 100%) 0 calc(100% - var(--zero, 100%)) round var(--mixed-chart-ends));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mixed-chart-line {
|
|
90
|
+
fill: none;
|
|
91
|
+
stroke: var(--mixed-chart-color);
|
|
92
|
+
stroke-width: var(--md-comp-mixed-chart-line-width);
|
|
93
|
+
stroke-linecap: round;
|
|
94
|
+
stroke-linejoin: round;
|
|
95
|
+
vector-effect: non-scaling-stroke;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mixed-chart-series.dashed .mixed-chart-line {
|
|
99
|
+
stroke-dasharray: 2 8;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.mixed-chart-series:not(.area) .mixed-chart-area {
|
|
103
|
+
display: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.mixed-chart-series stop {
|
|
107
|
+
stop-color: var(--mixed-chart-color);
|
|
108
|
+
stop-opacity: 0;
|
|
109
|
+
|
|
110
|
+
&:first-child {
|
|
111
|
+
stop-opacity: 0.24;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// A band behind the highlighted row, with a point over each line. The
|
|
116
|
+
// cursor makes no stacking context, so the band can go behind the marks
|
|
117
|
+
// and the points in front of them.
|
|
118
|
+
.mixed-chart-cursor {
|
|
119
|
+
width: calc(100% / var(--rows, 1));
|
|
120
|
+
margin-left: calc(-50% / var(--rows, 1));
|
|
121
|
+
|
|
122
|
+
&::before {
|
|
123
|
+
content: "";
|
|
124
|
+
position: absolute;
|
|
125
|
+
inset: 0;
|
|
126
|
+
z-index: -1;
|
|
127
|
+
border-radius: var(--md-comp-mixed-chart-shape);
|
|
128
|
+
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) state-opacity("hover"), transparent);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
> span {
|
|
132
|
+
position: absolute;
|
|
133
|
+
left: 50%;
|
|
134
|
+
z-index: 1;
|
|
135
|
+
width: 10px;
|
|
136
|
+
height: 10px;
|
|
137
|
+
border: 2px solid var(--md-sys-color-surface);
|
|
138
|
+
border-radius: 50%;
|
|
139
|
+
background-color: var(--mixed-chart-color);
|
|
140
|
+
translate: -50% -50%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
> .column {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@media (forced-colors: active) {
|
|
149
|
+
.mixed-chart-columns > div > span,
|
|
150
|
+
.mixed-chart-cursor > span {
|
|
151
|
+
forced-color-adjust: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.mixed-chart-cursor::before {
|
|
155
|
+
outline: 1px solid CanvasText;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
|
|
48
48
|
background-color: var(--md-comp-nav-bar-container-color);
|
|
49
49
|
color: var(--md-sys-color-on-surface);
|
|
50
|
+
@include glass(var(--md-comp-nav-bar-container-color));
|
|
50
51
|
|
|
51
52
|
> :is(a, button) {
|
|
52
53
|
position: relative;
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
transition: width var(--md-comp-nav-rail-duration) ease,
|
|
58
58
|
min-width var(--md-comp-nav-rail-duration) ease,
|
|
59
59
|
padding var(--md-comp-nav-rail-duration) ease;
|
|
60
|
+
@include glass(var(--md-sys-color-surface-container));
|
|
60
61
|
|
|
61
62
|
// Menu toggle.
|
|
62
63
|
> button:not(.button, .icon-button):first-child {
|
|
@@ -282,6 +283,11 @@
|
|
|
282
283
|
z-index: 998;
|
|
283
284
|
@include z-depth("1");
|
|
284
285
|
|
|
286
|
+
// A blurred rail would become the containing block of the fixed scrim
|
|
287
|
+
// below and clip it to the rail, so a modal rail stays solid.
|
|
288
|
+
background-color: var(--md-sys-color-surface-container);
|
|
289
|
+
backdrop-filter: none;
|
|
290
|
+
|
|
285
291
|
&::before {
|
|
286
292
|
content: "";
|
|
287
293
|
position: fixed;
|
|
@@ -298,6 +304,9 @@
|
|
|
298
304
|
z-index: 998;
|
|
299
305
|
@include z-depth("1");
|
|
300
306
|
|
|
307
|
+
background-color: var(--md-sys-color-surface-container);
|
|
308
|
+
backdrop-filter: none;
|
|
309
|
+
|
|
301
310
|
&::before {
|
|
302
311
|
content: "";
|
|
303
312
|
position: fixed;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
3
|
+
// Pie chart. The same <figure>, <figcaption> and <table> as a line chart;
|
|
4
|
+
// PieChart draws the first value column as slices of the whole, clockwise
|
|
5
|
+
// from the top, with a legend of every row, its cell and its share. The
|
|
6
|
+
// plot, tooltip and legend swatches come from chart(); the plot is a square
|
|
7
|
+
// as wide as --md-comp-pie-chart-height.
|
|
8
|
+
//
|
|
9
|
+
// The slices are SVG in a -50 to 50 box with a radius of 46, under a mask
|
|
10
|
+
// whose lines cut the gaps and whose circle, scaled here, cuts the donut's
|
|
11
|
+
// hole. The value labels and the tooltip sit on a slice's middle from the
|
|
12
|
+
// --turn PieChart sets, a fraction of a turn clockwise from the top.
|
|
13
|
+
//
|
|
14
|
+
// Modifiers: .donut cuts a hole and shows a <tfoot> total in it, .values
|
|
15
|
+
// writes each slice's share on it, .sparkline is a small pie with no
|
|
16
|
+
// legend or tooltip.
|
|
17
|
+
//
|
|
18
|
+
// Tokens:
|
|
19
|
+
// --md-comp-pie-chart-height 240px, the pie's diameter (sparkline 48px)
|
|
20
|
+
// --md-comp-pie-chart-hole 0.6, the donut hole's share of the diameter
|
|
21
|
+
// --md-comp-pie-chart-gap 1.5, the gap between slices in hundredths
|
|
22
|
+
// of the plot's width
|
|
23
|
+
// --md-comp-pie-chart-color-1..6 primary, tertiary, secondary,
|
|
24
|
+
// on-surface-variant, primary-container,
|
|
25
|
+
// tertiary-container
|
|
26
|
+
// --md-comp-pie-chart-on-color-1..6 on-primary, on-tertiary, on-secondary,
|
|
27
|
+
// surface, on-primary-container,
|
|
28
|
+
// on-tertiary-container; .values text
|
|
29
|
+
|
|
30
|
+
@include chart("pie-chart");
|
|
31
|
+
|
|
32
|
+
.pie-chart {
|
|
33
|
+
--md-comp-pie-chart-hole: 0.6;
|
|
34
|
+
--md-comp-pie-chart-gap: 1.5;
|
|
35
|
+
--md-comp-pie-chart-color-5: var(--md-sys-color-primary-container);
|
|
36
|
+
--md-comp-pie-chart-color-6: var(--md-sys-color-tertiary-container);
|
|
37
|
+
--md-comp-pie-chart-on-color-1: var(--md-sys-color-on-primary);
|
|
38
|
+
--md-comp-pie-chart-on-color-2: var(--md-sys-color-on-tertiary);
|
|
39
|
+
--md-comp-pie-chart-on-color-3: var(--md-sys-color-on-secondary);
|
|
40
|
+
--md-comp-pie-chart-on-color-4: var(--md-sys-color-surface);
|
|
41
|
+
--md-comp-pie-chart-on-color-5: var(--md-sys-color-on-primary-container);
|
|
42
|
+
--md-comp-pie-chart-on-color-6: var(--md-sys-color-on-tertiary-container);
|
|
43
|
+
// Where labels and the tooltip sit, as a share of the radius.
|
|
44
|
+
--pie-chart-label-at: 0.62;
|
|
45
|
+
|
|
46
|
+
gap: 16px;
|
|
47
|
+
|
|
48
|
+
&.donut {
|
|
49
|
+
// The middle of the ring.
|
|
50
|
+
--pie-chart-label-at: calc((1 + var(--md-comp-pie-chart-hole)) / 2);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@for $i from 1 through 6 {
|
|
55
|
+
.pie-chart [data-series="#{$i}"] {
|
|
56
|
+
--pie-chart-color: var(--md-comp-pie-chart-color-#{$i});
|
|
57
|
+
--pie-chart-on-color: var(--md-comp-pie-chart-on-color-#{$i});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.pie-chart-plot {
|
|
62
|
+
width: min(100%, var(--md-comp-pie-chart-height));
|
|
63
|
+
height: auto;
|
|
64
|
+
aspect-ratio: 1;
|
|
65
|
+
margin-inline: auto;
|
|
66
|
+
border: 0;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
background: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pie-chart-pie {
|
|
72
|
+
position: absolute;
|
|
73
|
+
inset: 0;
|
|
74
|
+
|
|
75
|
+
> svg {
|
|
76
|
+
display: block;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// The origin of an SVG transform is the box's middle, (0, 0).
|
|
83
|
+
.pie-chart-hole {
|
|
84
|
+
transform: scale(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.pie-chart.donut .pie-chart-hole {
|
|
88
|
+
transform: scale(var(--md-comp-pie-chart-hole));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.pie-chart-gaps {
|
|
92
|
+
stroke-width: var(--md-comp-pie-chart-gap);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.pie-chart-slice {
|
|
96
|
+
fill: var(--pie-chart-color);
|
|
97
|
+
|
|
98
|
+
// GROWN in pieChart.ts.
|
|
99
|
+
&.active {
|
|
100
|
+
transform: scale(1.06);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
104
|
+
transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), opacity 400ms cubic-bezier(0.2, 0, 0, 1);
|
|
105
|
+
|
|
106
|
+
@starting-style {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
transform: scale(0.8);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.pie-chart-values > span,
|
|
114
|
+
.pie-chart-tooltip {
|
|
115
|
+
--pie-chart-angle: calc(var(--turn, 0) * 1turn);
|
|
116
|
+
|
|
117
|
+
position: absolute;
|
|
118
|
+
left: calc(50% + sin(var(--pie-chart-angle)) * var(--pie-chart-label-at) * 46%);
|
|
119
|
+
top: calc(50% - cos(var(--pie-chart-angle)) * var(--pie-chart-label-at) * 46%);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pie-chart-values > span {
|
|
123
|
+
translate: -50% -50%;
|
|
124
|
+
color: var(--pie-chart-on-color);
|
|
125
|
+
@include typescale("label-medium");
|
|
126
|
+
font-variant-numeric: tabular-nums;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.pie-chart-tooltip {
|
|
131
|
+
translate: 12px -50%;
|
|
132
|
+
|
|
133
|
+
&.end {
|
|
134
|
+
translate: calc(-100% - 12px) -50%;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pie-chart-total {
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset: 0;
|
|
141
|
+
display: none;
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
text-align: center;
|
|
146
|
+
|
|
147
|
+
> * {
|
|
148
|
+
max-width: calc(80% * var(--md-comp-pie-chart-hole));
|
|
149
|
+
overflow-wrap: anywhere;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
> strong {
|
|
153
|
+
color: var(--md-sys-color-on-surface);
|
|
154
|
+
@include typescale("headline-small");
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
> span {
|
|
158
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
159
|
+
@include typescale("body-small");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.pie-chart.donut .pie-chart-total {
|
|
164
|
+
display: flex;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// One row per slice: swatch, name, cell and share in aligned columns.
|
|
168
|
+
.pie-chart-legend {
|
|
169
|
+
display: grid;
|
|
170
|
+
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 8px;
|
|
173
|
+
|
|
174
|
+
> li {
|
|
175
|
+
display: contents;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
> li > span:first-child {
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
text-overflow: ellipsis;
|
|
181
|
+
white-space: nowrap;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
> li > span:not(:first-child) {
|
|
185
|
+
text-align: end;
|
|
186
|
+
font-variant-numeric: tabular-nums;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
> li > span:nth-child(2) {
|
|
190
|
+
color: var(--md-sys-color-on-surface);
|
|
191
|
+
font-weight: 500;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.pie-chart.sparkline .pie-chart-plot {
|
|
196
|
+
margin-inline: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media (forced-colors: active) {
|
|
200
|
+
.pie-chart-pie {
|
|
201
|
+
forced-color-adjust: none;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
3
|
+
// Popover. A .popover is a native [popover] panel opened by the button that
|
|
4
|
+
// names it with popovertarget (or commandfor). The browser owns opening,
|
|
5
|
+
// light dismiss, Escape, the top layer and the button's expanded state; CSS
|
|
6
|
+
// anchor positioning places the panel against that button, so there is no
|
|
7
|
+
// JavaScript.
|
|
8
|
+
//
|
|
9
|
+
// It looks like an M3 rich tooltip, but it is a disclosure: it opens on
|
|
10
|
+
// press, stays open while the user reads or acts, and can hold links and
|
|
11
|
+
// buttons. A small one behind an info button is a toggletip.
|
|
12
|
+
//
|
|
13
|
+
// Placement (the panel flips to the other side when it would not fit):
|
|
14
|
+
// (default) below, start edges aligned
|
|
15
|
+
// .top above, start edges aligned
|
|
16
|
+
// .start before the button, centered on it
|
|
17
|
+
// .end after the button, centered on it
|
|
18
|
+
//
|
|
19
|
+
// Tokens:
|
|
20
|
+
// --md-comp-popover-container-color surface-container
|
|
21
|
+
// --md-comp-popover-shape 12px
|
|
22
|
+
// --md-comp-popover-padding 12px 16px
|
|
23
|
+
// --md-comp-popover-max-width 320px
|
|
24
|
+
// --md-comp-popover-gap 4px (from the button)
|
|
25
|
+
|
|
26
|
+
.popover {
|
|
27
|
+
--md-comp-popover-container-color: var(--md-sys-color-surface-container);
|
|
28
|
+
--md-comp-popover-shape: 12px;
|
|
29
|
+
--md-comp-popover-padding: 12px 16px;
|
|
30
|
+
--md-comp-popover-max-width: 320px;
|
|
31
|
+
--md-comp-popover-gap: 4px;
|
|
32
|
+
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
width: max-content;
|
|
35
|
+
max-width: min(var(--md-comp-popover-max-width), calc(100vw - 16px));
|
|
36
|
+
inset: auto;
|
|
37
|
+
margin: var(--md-comp-popover-gap) 0;
|
|
38
|
+
padding: var(--md-comp-popover-padding);
|
|
39
|
+
overflow: visible;
|
|
40
|
+
border: 0;
|
|
41
|
+
border-radius: var(--md-comp-popover-shape);
|
|
42
|
+
background-color: var(--md-comp-popover-container-color);
|
|
43
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
44
|
+
@include z-depth("2");
|
|
45
|
+
@include typescale("body-medium");
|
|
46
|
+
|
|
47
|
+
position-area: block-end span-inline-end;
|
|
48
|
+
position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
|
|
49
|
+
|
|
50
|
+
opacity: 0;
|
|
51
|
+
transition:
|
|
52
|
+
opacity 150ms ease-out,
|
|
53
|
+
display 150ms allow-discrete,
|
|
54
|
+
overlay 150ms allow-discrete;
|
|
55
|
+
@include glass(var(--md-comp-popover-container-color));
|
|
56
|
+
|
|
57
|
+
&:popover-open {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
|
|
60
|
+
@starting-style {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.top {
|
|
66
|
+
position-area: block-start span-inline-end;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.start,
|
|
70
|
+
&.end {
|
|
71
|
+
margin: 0 var(--md-comp-popover-gap);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.start {
|
|
75
|
+
position-area: center inline-start;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.end {
|
|
79
|
+
position-area: center inline-end;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
> :is(h1, h2, h3, h4, h5, h6) {
|
|
83
|
+
margin: 0 0 4px;
|
|
84
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
85
|
+
@include typescale("title-small");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
> p {
|
|
89
|
+
margin: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
> p + p {
|
|
93
|
+
margin-block-start: 8px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Text buttons carry their own inset, so the row starts under the text.
|
|
97
|
+
> .popover-actions {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-wrap: wrap;
|
|
100
|
+
gap: 8px;
|
|
101
|
+
margin: 12px 0 -4px;
|
|
102
|
+
margin-inline-start: -12px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (prefers-reduced-motion: reduce) {
|
|
106
|
+
transition: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (forced-colors: active) {
|
|
110
|
+
border: 1px solid CanvasText;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
3
|
+
// Questionnaire. A <form class="questionnaire"> asks one question at a time.
|
|
4
|
+
// Each <fieldset> child is a question: its <legend> is the prompt, a <p> is
|
|
5
|
+
// the description, and the answers are radio or checkbox labels (a <small>
|
|
6
|
+
// in a label describes that answer) or a text field. A
|
|
7
|
+
// <p class="questionnaire-error"> shows when the question needs an answer. A
|
|
8
|
+
// <footer> holds the buttons: value="previous", "skip" and "next", and a
|
|
9
|
+
// submit button.
|
|
10
|
+
//
|
|
11
|
+
// The Questionnaire component hides every question but the current one,
|
|
12
|
+
// adds the progress row above them and shows only the buttons that apply.
|
|
13
|
+
// Without it every question shows, the navigation buttons stay hidden and
|
|
14
|
+
// the submit button sends the form.
|
|
15
|
+
//
|
|
16
|
+
// Choices are outlined rows; a selected one fills with secondary-container,
|
|
17
|
+
// the M3 colour for a selected item in a list.
|
|
18
|
+
//
|
|
19
|
+
// Tokens:
|
|
20
|
+
// --md-comp-questionnaire-choice-shape 12px
|
|
21
|
+
// --md-comp-questionnaire-choice-outline-color outline-variant
|
|
22
|
+
// --md-comp-questionnaire-choice-selected-color secondary-container
|
|
23
|
+
|
|
24
|
+
.questionnaire {
|
|
25
|
+
--md-comp-questionnaire-choice-shape: 12px;
|
|
26
|
+
--md-comp-questionnaire-choice-outline-color: var(--md-sys-color-outline-variant);
|
|
27
|
+
--md-comp-questionnaire-choice-selected-color: var(--md-sys-color-secondary-container);
|
|
28
|
+
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 24px;
|
|
32
|
+
|
|
33
|
+
> .questionnaire-progress {
|
|
34
|
+
display: grid;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
37
|
+
@include typescale("label-large");
|
|
38
|
+
|
|
39
|
+
> .progress {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
> fieldset {
|
|
45
|
+
margin: 0;
|
|
46
|
+
padding: 0;
|
|
47
|
+
border: 0;
|
|
48
|
+
|
|
49
|
+
> legend {
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
margin: 0 0 8px;
|
|
52
|
+
padding: 0;
|
|
53
|
+
@include typescale("title-large");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
> p {
|
|
57
|
+
margin: 0;
|
|
58
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
59
|
+
@include typescale("body-medium");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
> .questionnaire-error {
|
|
63
|
+
margin-block-start: 8px;
|
|
64
|
+
color: var(--md-sys-color-error);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:not(.invalid) > .questionnaire-error {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
> label:has(> :is([type="radio"], [type="checkbox"])) {
|
|
72
|
+
display: grid;
|
|
73
|
+
grid-template-columns: auto 1fr;
|
|
74
|
+
align-items: center;
|
|
75
|
+
column-gap: 16px;
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
min-height: 56px;
|
|
78
|
+
margin: 8px 0 0;
|
|
79
|
+
padding: 8px 16px;
|
|
80
|
+
border: 1px solid var(--md-comp-questionnaire-choice-outline-color);
|
|
81
|
+
border-radius: var(--md-comp-questionnaire-choice-shape);
|
|
82
|
+
transition: background-color .2s ease, border-color .2s ease;
|
|
83
|
+
|
|
84
|
+
p + & {
|
|
85
|
+
margin-block-start: 16px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// The checkbox draws its tick on the label at left: 0; follow the
|
|
89
|
+
// padding, on either side.
|
|
90
|
+
&:has(> [type="checkbox"])::before {
|
|
91
|
+
left: auto;
|
|
92
|
+
inset-inline-start: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:has(> :checked) {
|
|
96
|
+
border-color: transparent;
|
|
97
|
+
background-color: var(--md-comp-questionnaire-choice-selected-color);
|
|
98
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:has(> :disabled) {
|
|
102
|
+
border-color: color-mix(in oklab, var(--md-sys-color-on-surface) 12%, transparent);
|
|
103
|
+
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&:has(> small) > input {
|
|
107
|
+
grid-row: span 2;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> small {
|
|
111
|
+
grid-column: 2;
|
|
112
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
113
|
+
@include typescale("body-medium");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// The selector matches the page footer's, which every <footer> gets.
|
|
119
|
+
> footer:not(:has(> .navigation-bar:only-child)) {
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 0;
|
|
122
|
+
border: 0;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
justify-content: flex-end;
|
|
126
|
+
gap: 8px;
|
|
127
|
+
|
|
128
|
+
> [value="previous"] {
|
|
129
|
+
margin-inline-end: auto;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Buttons set their own display, which would beat the [hidden] the
|
|
134
|
+
// component writes.
|
|
135
|
+
> fieldset[hidden],
|
|
136
|
+
> footer > button[hidden] {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Before the component runs, every question shows and only submit applies.
|
|
141
|
+
&:not(:has(> .questionnaire-progress)) > footer > :is([value="previous"], [value="skip"], [value="next"]) {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
}
|