material-inspired-component-library 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -18
- package/components/README.md +1 -1
- package/components/accordion/README.md +6 -6
- package/components/alert/README.md +10 -10
- package/components/alert/index.scss +27 -52
- package/components/appbar/README.md +19 -6
- package/components/appbar/index.scss +40 -44
- package/components/badge/README.md +12 -10
- package/components/badge/index.scss +21 -25
- package/components/bottomsheet/README.md +26 -1
- package/components/bottomsheet/index.scss +58 -44
- package/components/button/README.md +70 -10
- package/components/button/_shared.scss +210 -0
- package/components/button/index.scss +75 -389
- package/components/card/README.md +97 -85
- package/components/card/index.scss +46 -65
- package/components/checkbox/README.md +25 -14
- package/{tools/shapes/check.mjs → components/checkbox/_label.scss} +37 -42
- package/components/checkbox/index.scss +66 -66
- package/components/chip/README.md +186 -0
- package/components/chip/index.scss +285 -0
- package/components/datepicker/README.md +79 -0
- package/components/datepicker/index.scss +346 -315
- package/components/dialog/README.md +20 -10
- package/components/dialog/index.scss +55 -66
- package/components/divider/README.md +16 -15
- package/components/divider/index.scss +9 -25
- package/components/iconbutton/README.md +63 -12
- package/components/iconbutton/index.scss +142 -303
- package/components/list/README.md +89 -156
- package/components/list/index.scss +34 -36
- package/components/menu/README.md +81 -155
- package/components/menu/index.scss +52 -58
- package/components/navigationbar/README.md +108 -0
- package/components/navigationbar/index.scss +185 -0
- package/components/navigationrail/README.md +62 -37
- package/components/navigationrail/_navitem.scss +96 -0
- package/components/navigationrail/index.scss +78 -132
- package/components/progressindicator/README.md +83 -47
- package/components/progressindicator/index.scss +622 -172
- package/components/radio/README.md +11 -9
- package/components/radio/index.scss +36 -33
- package/components/select/README.md +12 -7
- package/components/select/index.scss +26 -34
- package/components/shapes/README.md +3 -3
- package/components/shapes/index.scss +0 -1
- package/components/sidesheet/README.md +21 -9
- package/components/sidesheet/index.scss +38 -46
- package/components/slider/README.md +21 -0
- package/components/slider/index.scss +108 -139
- package/components/snackbar/README.md +32 -35
- package/components/snackbar/index.scss +10 -22
- package/components/stepper/README.md +14 -7
- package/components/stepper/index.scss +58 -39
- package/components/switch/README.md +22 -15
- package/components/switch/index.scss +68 -60
- package/components/textfield/README.md +48 -5
- package/components/textfield/index.scss +192 -248
- package/components/timepicker/README.md +53 -23
- package/components/timepicker/index.scss +110 -128
- package/dist/alert.css +1 -1
- package/dist/alert.js +1 -1
- package/dist/appbar.css +1 -1
- package/dist/appbar.js +1 -1
- package/dist/badge.css +1 -1
- package/dist/badge.js +1 -1
- package/dist/base.css +1 -0
- package/dist/base.js +1 -0
- package/dist/bottomsheet.css +1 -1
- package/dist/bottomsheet.js +1 -1
- package/dist/button.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.css +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.css +1 -0
- package/dist/chip.js +1 -0
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/iconbutton/index.d.ts +2 -7
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/textfield/index.d.ts +2 -2
- package/dist/datepicker.css +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +1 -1
- package/dist/divider.css +1 -1
- package/dist/divider.js +1 -1
- package/dist/field.css +1 -0
- package/dist/field.js +1 -0
- package/dist/foundations/form/index.js +1 -1
- package/dist/foundations/runtime.d.ts +15 -0
- package/dist/foundations/runtime.js +1 -0
- package/dist/iconbutton.css +1 -1
- package/dist/iconbutton.js +1 -1
- package/dist/layout.css +1 -1
- package/dist/layout.js +1 -1
- package/dist/list.css +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.css +1 -1
- package/dist/menu.js +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.d.ts +14 -5
- package/dist/micl.js +1 -1
- package/dist/navigationbar.css +1 -0
- package/dist/navigationbar.js +1 -0
- package/dist/navigationrail.css +1 -1
- package/dist/navigationrail.js +1 -1
- package/dist/progressindicator.css +1 -1
- package/dist/progressindicator.js +1 -1
- package/dist/radio.css +1 -1
- package/dist/radio.js +1 -1
- package/dist/scrollbar.js +1 -1
- package/dist/select.css +1 -1
- package/dist/select.js +1 -1
- package/dist/shapes.css +1 -1
- package/dist/shapes.js +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/sidesheet.js +1 -1
- package/dist/slider.css +1 -1
- package/dist/slider.js +1 -1
- package/dist/snackbar.css +1 -1
- package/dist/snackbar.js +1 -1
- package/dist/stepper.css +1 -1
- package/dist/stepper.js +1 -1
- package/dist/switch.css +1 -1
- package/dist/switch.js +1 -1
- package/dist/textfield.css +1 -1
- package/dist/textfield.js +1 -1
- package/dist/timepicker.css +1 -1
- package/dist/timepicker.js +1 -1
- package/foundations/_index.scss +35 -0
- package/foundations/{index.scss → base/index.scss} +21 -56
- package/foundations/field/index.scss +37 -0
- package/foundations/layout/index.scss +64 -65
- package/package.json +23 -9
- package/styles/statelayer.scss +20 -5
- package/styles.scss +5 -2
- package/.claude/settings.local.json +0 -14
- package/.editorconfig +0 -12
- package/.gitattributes +0 -9
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/CLAUDE.md +0 -53
- package/CODE_OF_CONDUCT.md +0 -128
- package/components/bottomsheet/index.ts +0 -153
- package/components/button/index.ts +0 -79
- package/components/checkbox/index.ts +0 -148
- package/components/datepicker/index.ts +0 -693
- package/components/iconbutton/index.ts +0 -77
- package/components/list/index.ts +0 -138
- package/components/menu/index.ts +0 -145
- package/components/navigationrail/index.ts +0 -87
- package/components/progressindicator/index.ts +0 -77
- package/components/slider/index.ts +0 -149
- package/components/snackbar/index.ts +0 -118
- package/components/stepper/index.ts +0 -248
- package/components/textfield/index.ts +0 -188
- package/components/timepicker/index.ts +0 -413
- package/dist/components/progressindicator/index.d.ts +0 -6
- package/dist/foundations.css +0 -1
- package/dist/foundations.js +0 -1
- package/docs/accordion.html +0 -344
- package/docs/alert.html +0 -177
- package/docs/bottomsheet.html +0 -240
- package/docs/button.html +0 -290
- package/docs/card-awards.webp +0 -0
- package/docs/card-cabinet.webp +0 -0
- package/docs/card-city.webp +0 -0
- package/docs/card-fingerprint.webp +0 -0
- package/docs/card-holiday.webp +0 -0
- package/docs/card-names.webp +0 -0
- package/docs/card.html +0 -159
- package/docs/checkbox.html +0 -147
- package/docs/datepicker.html +0 -274
- package/docs/dialog.html +0 -195
- package/docs/divider.html +0 -139
- package/docs/docs.css +0 -26
- package/docs/docs.js +0 -139
- package/docs/iconbutton.html +0 -329
- package/docs/index.html +0 -431
- package/docs/list.html +0 -310
- package/docs/menu.html +0 -574
- package/docs/micl.css +0 -1
- package/docs/micl.js +0 -1
- package/docs/navigationrail.html +0 -138
- package/docs/progressindicator.html +0 -288
- package/docs/radio.html +0 -123
- package/docs/select.html +0 -337
- package/docs/shapes.css +0 -1
- package/docs/shapes.html +0 -159
- package/docs/shapes.js +0 -1
- package/docs/sidesheet.html +0 -149
- package/docs/slider.html +0 -141
- package/docs/snackbar.html +0 -102
- package/docs/stepper.html +0 -319
- package/docs/switch.html +0 -196
- package/docs/textfield.html +0 -208
- package/docs/themes/airblue/dark-hc.css +0 -51
- package/docs/themes/airblue/dark-mc.css +0 -51
- package/docs/themes/airblue/dark.css +0 -51
- package/docs/themes/airblue/light-hc.css +0 -51
- package/docs/themes/airblue/light-mc.css +0 -51
- package/docs/themes/airblue/light.css +0 -51
- package/docs/themes/airblue/theme.css +0 -306
- package/docs/themes/barnred/dark-hc.css +0 -51
- package/docs/themes/barnred/dark-mc.css +0 -51
- package/docs/themes/barnred/dark.css +0 -51
- package/docs/themes/barnred/light-hc.css +0 -51
- package/docs/themes/barnred/light-mc.css +0 -51
- package/docs/themes/barnred/light.css +0 -51
- package/docs/themes/barnred/theme.css +0 -306
- package/docs/themes/citrine/dark-hc.css +0 -51
- package/docs/themes/citrine/dark-mc.css +0 -51
- package/docs/themes/citrine/dark.css +0 -51
- package/docs/themes/citrine/light-hc.css +0 -51
- package/docs/themes/citrine/light-mc.css +0 -51
- package/docs/themes/citrine/light.css +0 -51
- package/docs/themes/citrine/theme.css +0 -306
- package/docs/themes/gray/dark-hc.css +0 -51
- package/docs/themes/gray/dark-mc.css +0 -51
- package/docs/themes/gray/dark.css +0 -51
- package/docs/themes/gray/light-hc.css +0 -51
- package/docs/themes/gray/light-mc.css +0 -51
- package/docs/themes/gray/light.css +0 -51
- package/docs/themes/gray/theme.css +0 -306
- package/docs/themes/greenery/dark-hc.css +0 -51
- package/docs/themes/greenery/dark-mc.css +0 -51
- package/docs/themes/greenery/dark.css +0 -51
- package/docs/themes/greenery/light-hc.css +0 -51
- package/docs/themes/greenery/light-mc.css +0 -51
- package/docs/themes/greenery/light.css +0 -51
- package/docs/themes/greenery/theme.css +0 -306
- package/docs/themes/hermana/dark-hc.css +0 -51
- package/docs/themes/hermana/dark-mc.css +0 -51
- package/docs/themes/hermana/dark.css +0 -51
- package/docs/themes/hermana/light-hc.css +0 -51
- package/docs/themes/hermana/light-mc.css +0 -51
- package/docs/themes/hermana/light.css +0 -51
- package/docs/themes/hermana/theme.css +0 -306
- package/docs/themes/illuminating/dark-hc.css +0 -51
- package/docs/themes/illuminating/dark-mc.css +0 -51
- package/docs/themes/illuminating/dark.css +0 -51
- package/docs/themes/illuminating/light-hc.css +0 -51
- package/docs/themes/illuminating/light-mc.css +0 -51
- package/docs/themes/illuminating/light.css +0 -51
- package/docs/themes/illuminating/theme.css +0 -306
- package/docs/themes/magenta/dark-hc.css +0 -51
- package/docs/themes/magenta/dark-mc.css +0 -51
- package/docs/themes/magenta/dark.css +0 -51
- package/docs/themes/magenta/light-hc.css +0 -51
- package/docs/themes/magenta/light-mc.css +0 -51
- package/docs/themes/magenta/light.css +0 -51
- package/docs/themes/magenta/theme.css +0 -306
- package/docs/themes/mocha/dark-hc.css +0 -51
- package/docs/themes/mocha/dark-mc.css +0 -51
- package/docs/themes/mocha/dark.css +0 -51
- package/docs/themes/mocha/light-hc.css +0 -51
- package/docs/themes/mocha/light-mc.css +0 -51
- package/docs/themes/mocha/light.css +0 -51
- package/docs/themes/mocha/theme.css +0 -306
- package/docs/themes/olivegreen/dark-hc.css +0 -51
- package/docs/themes/olivegreen/dark-mc.css +0 -51
- package/docs/themes/olivegreen/dark.css +0 -51
- package/docs/themes/olivegreen/light-hc.css +0 -51
- package/docs/themes/olivegreen/light-mc.css +0 -51
- package/docs/themes/olivegreen/light.css +0 -51
- package/docs/themes/olivegreen/theme.css +0 -306
- package/docs/themes/peri/dark-hc.css +0 -51
- package/docs/themes/peri/dark-mc.css +0 -51
- package/docs/themes/peri/dark.css +0 -51
- package/docs/themes/peri/light-hc.css +0 -51
- package/docs/themes/peri/light-mc.css +0 -51
- package/docs/themes/peri/light.css +0 -51
- package/docs/themes/peri/theme.css +0 -306
- package/docs/timepicker.html +0 -160
- package/foundations/form/index.ts +0 -174
- package/foundations/layout/README.md +0 -127
- package/intl.d.ts +0 -9
- package/micl.ts +0 -221
- package/styles/README.md +0 -196
- package/tools/shapes/generate.mjs +0 -828
- package/tsconfig.json +0 -116
- package/webpack.config.js +0 -104
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations';
|
|
23
22
|
@use '../../foundations/layout';
|
|
24
23
|
@use '../../styles/elevation';
|
|
25
24
|
@use '../../styles/shape';
|
|
@@ -35,23 +34,23 @@
|
|
|
35
34
|
@include typography.scale('headline-medium');
|
|
36
35
|
@include typography.scale('title-large');
|
|
37
36
|
@include typography.scale('title-medium');
|
|
38
|
-
@include typography.scale('
|
|
37
|
+
@include typography.scale('label-large');
|
|
39
38
|
@include typography.scale('label-medium');
|
|
40
39
|
|
|
41
40
|
@mixin appbar-sticky() {
|
|
42
41
|
position: sticky;
|
|
43
42
|
inset: unset;
|
|
44
|
-
inset-block-start:
|
|
43
|
+
inset-block-start: env(safe-area-inset-top, 0px);
|
|
45
44
|
inset-inline-start: 0;
|
|
46
45
|
animation: 1ms linear alternate appbar-background;
|
|
47
46
|
animation-timeline: scroll(root);
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
.micl-appbar {
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
-
--
|
|
54
|
-
--
|
|
50
|
+
--_height: 64px;
|
|
51
|
+
--_padding-block-start: 0px;
|
|
52
|
+
--_padding-block-end: 0px;
|
|
53
|
+
--_padding-inline: 0px;
|
|
55
54
|
|
|
56
55
|
box-sizing: border-box;
|
|
57
56
|
display: grid;
|
|
@@ -62,12 +61,12 @@
|
|
|
62
61
|
grid-template-rows: 64px max-content;
|
|
63
62
|
column-gap: 4px;
|
|
64
63
|
align-items: center;
|
|
65
|
-
min-block-size: var(--
|
|
66
|
-
padding-block: var(--
|
|
67
|
-
padding-inline: var(--
|
|
64
|
+
min-block-size: var(--_height);
|
|
65
|
+
padding-block: var(--_padding-block-start) var(--_padding-block-end);
|
|
66
|
+
padding-inline: var(--_padding-inline);
|
|
68
67
|
border-start-start-radius: inherit;
|
|
69
68
|
border-start-end-radius: inherit;
|
|
70
|
-
background-color: inherit;
|
|
69
|
+
background-color: var(--md-comp-app-bar-container-color, inherit);
|
|
71
70
|
box-shadow: var(--md-sys-elevation-level0);
|
|
72
71
|
z-index: 8;
|
|
73
72
|
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
.micl-appbar__leading-icon {
|
|
82
81
|
grid-area: appbar-leading;
|
|
83
82
|
margin-inline-start: var(--md-sys-layout-window-margin);
|
|
84
|
-
color: var(--md-sys-color-on-surface);
|
|
83
|
+
color: var(--md-comp-app-bar-leading-icon-color, var(--md-sys-color-on-surface));
|
|
85
84
|
}
|
|
86
85
|
.micl-appbar__headline {
|
|
87
86
|
display: flex;
|
|
@@ -90,25 +89,22 @@
|
|
|
90
89
|
align-items: flex-start;
|
|
91
90
|
margin: 8px 0;
|
|
92
91
|
border-radius: var(--md-sys-shape-corner-none);
|
|
93
|
-
color: var(--md-sys-color-on-surface);
|
|
92
|
+
color: var(--md-comp-app-bar-title-color, var(--md-sys-color-on-surface));
|
|
94
93
|
|
|
95
94
|
&.micl-appbar__headline--center {
|
|
96
95
|
align-items: center;
|
|
97
96
|
text-align: center;
|
|
98
97
|
}
|
|
99
|
-
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
98
|
+
:is(h1, h2, h3, h4, h5, h6, .micl-heading) {
|
|
100
99
|
@include typography.title-large;
|
|
101
100
|
|
|
102
101
|
margin: 0;
|
|
103
102
|
}
|
|
104
|
-
.micl-appbar__subtitle {
|
|
105
|
-
margin: 0;
|
|
106
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
&:has(.micl-appbar__subtitle) {
|
|
110
103
|
.micl-appbar__subtitle {
|
|
111
104
|
@include typography.label-medium;
|
|
105
|
+
|
|
106
|
+
margin: 0;
|
|
107
|
+
color: var(--md-comp-app-bar-subtitle-color, var(--md-sys-color-on-surface-variant));
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
110
|
.micl-appbar__trailing {
|
|
@@ -118,11 +114,11 @@
|
|
|
118
114
|
.micl-appbar__trailing-icon {
|
|
119
115
|
grid-area: appbar-trailing;
|
|
120
116
|
margin-inline-end: var(--md-sys-layout-window-margin);
|
|
121
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
117
|
+
color: var(--md-comp-app-bar-trailing-icon-color, var(--md-sys-color-on-surface-variant));
|
|
122
118
|
}
|
|
123
119
|
&.micl-appbar--medium {
|
|
124
|
-
--
|
|
125
|
-
--
|
|
120
|
+
--_height: 112px;
|
|
121
|
+
--_padding-block-end: 12px;
|
|
126
122
|
|
|
127
123
|
padding-inline-start: 0;
|
|
128
124
|
|
|
@@ -131,21 +127,21 @@
|
|
|
131
127
|
margin: 0;
|
|
132
128
|
padding-inline-start: var(--md-sys-layout-window-margin);
|
|
133
129
|
|
|
134
|
-
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
130
|
+
:is(h1, h2, h3, h4, h5, h6, .micl-heading) {
|
|
135
131
|
@include typography.headline-medium;
|
|
136
132
|
}
|
|
137
133
|
}
|
|
138
134
|
&:has(.micl-appbar__subtitle) {
|
|
139
|
-
--
|
|
135
|
+
--_height: 136px;
|
|
140
136
|
|
|
141
137
|
.micl-appbar__subtitle {
|
|
142
|
-
@include typography.
|
|
138
|
+
@include typography.label-large;
|
|
143
139
|
}
|
|
144
140
|
}
|
|
145
141
|
}
|
|
146
142
|
&.micl-appbar--large {
|
|
147
|
-
--
|
|
148
|
-
--
|
|
143
|
+
--_height: 120px;
|
|
144
|
+
--_padding-block-end: 12px;
|
|
149
145
|
|
|
150
146
|
padding-inline-start: 0;
|
|
151
147
|
|
|
@@ -154,12 +150,12 @@
|
|
|
154
150
|
margin: 0;
|
|
155
151
|
padding-inline-start: var(--md-sys-layout-window-margin);
|
|
156
152
|
|
|
157
|
-
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
153
|
+
:is(h1, h2, h3, h4, h5, h6, .micl-heading) {
|
|
158
154
|
@include typography.display-small;
|
|
159
155
|
}
|
|
160
156
|
}
|
|
161
157
|
&:has(.micl-appbar__subtitle) {
|
|
162
|
-
--
|
|
158
|
+
--_height: 152px;
|
|
163
159
|
|
|
164
160
|
.micl-appbar__subtitle {
|
|
165
161
|
@include typography.title-medium;
|
|
@@ -168,36 +164,36 @@
|
|
|
168
164
|
}
|
|
169
165
|
}
|
|
170
166
|
|
|
171
|
-
.micl-
|
|
167
|
+
.micl-panes:not(:has(> .micl-pane:nth-child(2))) {
|
|
172
168
|
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
173
169
|
@include appbar-sticky;
|
|
174
170
|
}
|
|
175
171
|
}
|
|
176
|
-
.micl-
|
|
177
|
-
@media (max-width: layout.$md-sys-
|
|
172
|
+
.micl-panes:has(> .micl-pane:nth-child(2)) {
|
|
173
|
+
@media (max-width: layout.$md-sys-breakpoint-medium-min) {
|
|
178
174
|
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
179
175
|
@include appbar-sticky;
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
|
-
@media (min-width: layout.$md-sys-
|
|
183
|
-
&.micl-
|
|
184
|
-
&.micl-
|
|
185
|
-
&.micl-
|
|
178
|
+
@media (min-width: layout.$md-sys-breakpoint-medium-min) and (max-width: layout.$md-sys-breakpoint-medium-max) {
|
|
179
|
+
&.micl-panes--stacked-to-expanded,
|
|
180
|
+
&.micl-panes--stacked-to-large,
|
|
181
|
+
&.micl-panes--stacked-to-extralarge {
|
|
186
182
|
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
187
183
|
@include appbar-sticky;
|
|
188
184
|
}
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
|
-
@media (min-width: layout.$md-sys-
|
|
192
|
-
&.micl-
|
|
193
|
-
&.micl-
|
|
187
|
+
@media (min-width: layout.$md-sys-breakpoint-expanded-min) and (max-width: layout.$md-sys-breakpoint-expanded-max) {
|
|
188
|
+
&.micl-panes--stacked-to-large,
|
|
189
|
+
&.micl-panes--stacked-to-extralarge {
|
|
194
190
|
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
195
191
|
@include appbar-sticky;
|
|
196
192
|
}
|
|
197
193
|
}
|
|
198
194
|
}
|
|
199
|
-
@media (min-width: layout.$md-sys-
|
|
200
|
-
&.micl-
|
|
195
|
+
@media (min-width: layout.$md-sys-breakpoint-large-min) and (max-width: layout.$md-sys-breakpoint-large-max) {
|
|
196
|
+
&.micl-panes--stacked-to-extralarge {
|
|
201
197
|
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
202
198
|
@include appbar-sticky;
|
|
203
199
|
}
|
|
@@ -212,7 +208,7 @@
|
|
|
212
208
|
border-start-end-radius: inherit;
|
|
213
209
|
}
|
|
214
210
|
10% {
|
|
215
|
-
background-color: var(--md-sys-color-surface-container);
|
|
211
|
+
background-color: var(--md-comp-app-bar-on-scroll-container-color, var(--md-sys-color-surface-container));
|
|
216
212
|
box-shadow: var(--md-sys-elevation-level2);
|
|
217
213
|
}
|
|
218
214
|
50% {
|
|
@@ -220,7 +216,7 @@
|
|
|
220
216
|
border-start-end-radius: 0;
|
|
221
217
|
}
|
|
222
218
|
100% {
|
|
223
|
-
background-color: var(--md-sys-color-surface-container);
|
|
219
|
+
background-color: var(--md-comp-app-bar-on-scroll-container-color, var(--md-sys-color-surface-container));
|
|
224
220
|
box-shadow: var(--md-sys-elevation-level2);
|
|
225
221
|
border-start-start-radius: 0;
|
|
226
222
|
border-start-end-radius: 0;
|
|
@@ -45,23 +45,25 @@ You can fine-tune the badge's position relative to its anchor using the followin
|
|
|
45
45
|
|
|
46
46
|
| Variable name | Default Value | Description |
|
|
47
47
|
| ------------- | ------------- | ----------- |
|
|
48
|
-
|
|
|
49
|
-
|
|
|
48
|
+
| `--md-comp-badge-inline-offset` | `0px` | Adjusts the horizontal position of the badge |
|
|
49
|
+
| `--md-comp-badge-block-offset` | `0px` | Adjusts the vertical position of the badge |
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
##
|
|
53
|
-
|
|
52
|
+
## Theming
|
|
53
|
+
Each badge can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. Set them on any appropriate parent element to affect its child badges.
|
|
54
54
|
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
55
|
+
| Custom property | Meaning | Default |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `--md-comp-badge-size` | The height and width of the small badge | `6px` |
|
|
58
|
+
| `--md-comp-badge-large-size` | The height and minimum width of the large badge | `16px` |
|
|
59
|
+
| `--md-comp-badge-large-padding` | The horizontal padding used for the large badge | `4px` |
|
|
60
|
+
| `--md-comp-badge-color` | The background color of the badge | `--md-sys-color-error` |
|
|
61
|
+
| `--md-comp-badge-large-label-text-color` | The text color of the large badge | `--md-sys-color-on-error` |
|
|
60
62
|
|
|
61
63
|
**Example: Changing the size of the small badge**
|
|
62
64
|
|
|
63
65
|
```HTML
|
|
64
|
-
<div style="--md-
|
|
66
|
+
<div style="--md-comp-badge-size:8px">
|
|
65
67
|
<span class="micl-badge micl-badge--small"></span>
|
|
66
68
|
</div>
|
|
67
69
|
```
|
|
@@ -19,47 +19,43 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations';
|
|
23
22
|
@use '../../styles/typography';
|
|
24
23
|
|
|
25
24
|
@include typography.scale('label-small');
|
|
26
25
|
|
|
27
|
-
:root {
|
|
28
|
-
--md-sys-badge-small-size: 6px;
|
|
29
|
-
--md-sys-badge-large-size: 16px;
|
|
30
|
-
--md-sys-badge-large-padding: 4px;
|
|
31
|
-
--md-sys-badge-inline-offset: 0px;
|
|
32
|
-
--md-sys-badge-block-offset: 0px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
26
|
.micl-badge {
|
|
27
|
+
--_size: var(--md-comp-badge-size, 6px);
|
|
28
|
+
--_large-size: var(--md-comp-badge-large-size, 16px);
|
|
29
|
+
--_dx: var(--md-comp-badge-inline-offset, 0px);
|
|
30
|
+
--_dy: var(--md-comp-badge-block-offset, 0px);
|
|
31
|
+
|
|
36
32
|
box-sizing: border-box;
|
|
37
33
|
position: fixed;
|
|
38
34
|
inset: 0;
|
|
39
35
|
margin: 0;
|
|
40
36
|
overflow-x: hidden;
|
|
41
|
-
background-color: var(--md-sys-color-error);
|
|
42
|
-
color: var(--md-sys-color-on-error);
|
|
37
|
+
background-color: var(--md-comp-badge-color, var(--md-sys-color-error));
|
|
38
|
+
color: var(--md-comp-badge-large-label-text-color, var(--md-sys-color-on-error));
|
|
43
39
|
|
|
44
40
|
&.micl-badge--small {
|
|
45
|
-
inline-size: var(--
|
|
46
|
-
block-size: var(--
|
|
47
|
-
inset-block-start: calc(anchor(start) + var(--
|
|
48
|
-
inset-inline-start: calc(anchor(end) - var(--
|
|
41
|
+
inline-size: var(--_size);
|
|
42
|
+
block-size: var(--_size);
|
|
43
|
+
inset-block-start: calc(anchor(start) + var(--_dy));
|
|
44
|
+
inset-inline-start: calc(anchor(end) - var(--_size) + var(--_dx));
|
|
49
45
|
padding: 0;
|
|
50
|
-
border-radius: calc(var(--
|
|
46
|
+
border-radius: calc(var(--_size) / 2);
|
|
51
47
|
}
|
|
52
48
|
&:not(.micl-badge--small) {
|
|
53
49
|
@include typography.label-small;
|
|
54
50
|
|
|
55
51
|
inline-size: fit-content;
|
|
56
52
|
max-inline-size: 34px;
|
|
57
|
-
min-inline-size: var(--
|
|
58
|
-
block-size: var(--
|
|
59
|
-
inset-block-start: calc(anchor(start) - (var(--
|
|
60
|
-
inset-inline-start: calc(anchor(end) - 12px + var(--
|
|
61
|
-
padding-inline: var(--md-
|
|
62
|
-
border-radius: calc(var(--
|
|
53
|
+
min-inline-size: var(--_large-size);
|
|
54
|
+
block-size: var(--_large-size);
|
|
55
|
+
inset-block-start: calc(anchor(start) - (var(--_large-size) - 14px) + var(--_dy));
|
|
56
|
+
inset-inline-start: calc(anchor(end) - 12px + var(--_dx));
|
|
57
|
+
padding-inline: var(--md-comp-badge-large-padding, 4px);
|
|
58
|
+
border-radius: calc(var(--_large-size) / 2);
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
|
|
@@ -67,13 +63,13 @@
|
|
|
67
63
|
.micl-badge {
|
|
68
64
|
position: absolute;
|
|
69
65
|
inset: 0 !important;
|
|
70
|
-
margin-block: calc(12px + var(--
|
|
66
|
+
margin-block: calc(12px + var(--_dy)) auto;
|
|
71
67
|
|
|
72
68
|
&.micl-badge--small {
|
|
73
|
-
margin-inline-start: calc(var(--md-sys-icon-size) - var(--
|
|
69
|
+
margin-inline-start: calc(var(--md-sys-icon-size, 24px) - var(--_size) - var(--_dx));
|
|
74
70
|
}
|
|
75
71
|
&:not(.micl-badge--small) {
|
|
76
|
-
margin-inline-start: calc(12px - var(--
|
|
72
|
+
margin-inline-start: calc(12px - var(--_dx));
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
}
|
|
@@ -86,7 +86,32 @@ The initial height is determined by its content and capped at 50% of the screen'
|
|
|
86
86
|
<dialog data-miclsnapheights="0,200,420" ...>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
The value `0` is equivalent to closing the bottom sheet. When a user clicks the drag-handle, the bottom sheet toggles between these preset heights and its initial height. The bottom sheet will also snap to these preset heights as a user drags the heading.
|
|
89
|
+
The value `0` is equivalent to closing the bottom sheet. When a user clicks the drag-handle, the bottom sheet toggles between these preset heights and its initial height. The bottom sheet will also snap to these preset heights as a user drags the heading, and settles on the nearest preset when released. Dragging the bottom sheet down to less than 48px closes it.
|
|
90
|
+
|
|
91
|
+
## Theming
|
|
92
|
+
Each bottom sheet style can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. The properties are declared on the component itself and can be changed on any appropriate parent element to affect its child bottom sheets.
|
|
93
|
+
|
|
94
|
+
| Custom property | Meaning | Default |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `--md-comp-bottomsheet-height` | The height of the opened bottom sheet (managed by the library for resizable bottom sheets) | `max-content` |
|
|
97
|
+
| `--md-comp-bottomsheet-margin` | The space between the bottom sheet and the sides of the screen, on screens wider than 640px | `56px` |
|
|
98
|
+
| `--md-comp-bottomsheet-margin-top` | The minimum space between the bottom sheet and the top of the screen | `72px` |
|
|
99
|
+
| `--md-comp-bottomsheet-padding` | The amount of space between the edges and the content | `24px` |
|
|
100
|
+
| `--md-comp-bottomsheet-container-color` | The background color of the bottom sheet | `--md-sys-color-surface-container-low` |
|
|
101
|
+
| `--md-comp-bottomsheet-container-shape` | The corner rounding of the bottom sheet | `--md-sys-shape-corner-extra-large-top` |
|
|
102
|
+
| `--md-comp-bottomsheet-container-elevation` | The shadow (elevation) of the bottom sheet | `--md-sys-elevation-level1` |
|
|
103
|
+
| `--md-comp-bottomsheet-drag-handle-width` | The width of the drag handle | `32px` |
|
|
104
|
+
| `--md-comp-bottomsheet-drag-handle-height` | The height of the drag handle | `4px` |
|
|
105
|
+
| `--md-comp-bottomsheet-drag-handle-color` | The color of the drag handle | `--md-sys-color-on-surface-variant` |
|
|
106
|
+
| `--md-comp-bottomsheet-focus-indicator-color` | The color of the drag handle's keyboard-focus outline | `--md-sys-color-secondary` |
|
|
107
|
+
|
|
108
|
+
**Example: Changing the background color of the bottom sheet**
|
|
109
|
+
|
|
110
|
+
```HTML
|
|
111
|
+
<dialog class="micl-bottomsheet" popover style="--md-comp-bottomsheet-container-color:var(--md-sys-color-surface-container)">
|
|
112
|
+
...
|
|
113
|
+
</dialog>
|
|
114
|
+
```
|
|
90
115
|
|
|
91
116
|
## Compatibility
|
|
92
117
|
This component uses the Popover API, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API#api.htmlelement.popover) for details.
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations';
|
|
23
22
|
@use '../../styles/elevation';
|
|
24
23
|
@use '../../styles/motion';
|
|
25
24
|
@use '../../styles/shape';
|
|
@@ -27,23 +26,26 @@
|
|
|
27
26
|
|
|
28
27
|
@include elevation.level(1);
|
|
29
28
|
|
|
29
|
+
@include shape.corner('extra-large-top');
|
|
30
30
|
@include shape.corner('extra-large');
|
|
31
|
-
@include shape.corner('small');
|
|
32
31
|
|
|
33
32
|
@include statelayer.token('focus-indicator-thickness');
|
|
34
33
|
@include statelayer.token('focus-indicator-outer-offset');
|
|
35
34
|
@include statelayer.token('backdrop-opacity');
|
|
36
35
|
|
|
37
36
|
dialog.micl-bottomsheet {
|
|
38
|
-
--md-
|
|
39
|
-
--md-
|
|
40
|
-
--md-
|
|
41
|
-
--md-
|
|
42
|
-
--md-
|
|
43
|
-
--md-
|
|
44
|
-
--md-
|
|
45
|
-
--md-
|
|
46
|
-
--md-
|
|
37
|
+
--md-comp-bottomsheet-height: max-content;
|
|
38
|
+
--md-comp-bottomsheet-margin: 56px;
|
|
39
|
+
--md-comp-bottomsheet-margin-top: 72px;
|
|
40
|
+
--md-comp-bottomsheet-padding: 24px;
|
|
41
|
+
--md-comp-bottomsheet-drag-handle-width: 32px;
|
|
42
|
+
--md-comp-bottomsheet-drag-handle-height: 4px;
|
|
43
|
+
--md-comp-bottomsheet-motion-spatial: #{motion.$md-sys-motion-expressive-slow-spatial};
|
|
44
|
+
--md-comp-bottomsheet-motion-duration: #{motion.$md-sys-motion-expressive-slow-spatial-duration};
|
|
45
|
+
--md-comp-bottomsheet-motion-duration-reverse: #{motion.$md-sys-motion-expressive-default-spatial-duration};
|
|
46
|
+
|
|
47
|
+
--micl-duration: var(--md-comp-bottomsheet-motion-duration-reverse);
|
|
48
|
+
--micl-easing: #{motion.$md-sys-motion-easing-emphasized-accelerate};
|
|
47
49
|
|
|
48
50
|
box-sizing: border-box;
|
|
49
51
|
position: fixed;
|
|
@@ -51,46 +53,59 @@ dialog.micl-bottomsheet {
|
|
|
51
53
|
block-size: 0;
|
|
52
54
|
max-block-size: 50vh;
|
|
53
55
|
inline-size: 100%;
|
|
56
|
+
|
|
57
|
+
&[data-miclfitheight] {
|
|
58
|
+
max-block-size: calc(100vh - var(--md-comp-bottomsheet-margin-top));
|
|
59
|
+
}
|
|
54
60
|
min-inline-size: 100%;
|
|
55
|
-
margin: var(--md-
|
|
61
|
+
margin: var(--md-comp-bottomsheet-margin-top) 0 0 0 ;
|
|
56
62
|
padding: 0;
|
|
57
63
|
border: none;
|
|
58
|
-
border-radius: var(--md-
|
|
59
|
-
background-color: var(--md-sys-color-surface-container-low);
|
|
60
|
-
box-shadow: var(--md-sys-elevation-level1);
|
|
64
|
+
border-radius: var(--md-comp-bottomsheet-container-shape, var(--md-sys-shape-corner-extra-large-top));
|
|
65
|
+
background-color: var(--md-comp-bottomsheet-container-color, var(--md-sys-color-surface-container-low));
|
|
66
|
+
box-shadow: var(--md-comp-bottomsheet-container-elevation, var(--md-sys-elevation-level1));
|
|
61
67
|
opacity: 0;
|
|
62
68
|
overflow-y: hidden;
|
|
63
69
|
interpolate-size: allow-keywords;
|
|
64
70
|
|
|
65
71
|
&:not(.micl-bottomsheet--resizing) {
|
|
66
72
|
transition:
|
|
67
|
-
opacity var(--
|
|
68
|
-
block-size var(--
|
|
69
|
-
overlay var(--
|
|
70
|
-
display var(--
|
|
73
|
+
opacity var(--micl-duration) var(--micl-easing),
|
|
74
|
+
block-size var(--micl-duration) var(--md-comp-bottomsheet-motion-spatial),
|
|
75
|
+
overlay var(--micl-duration) linear allow-discrete,
|
|
76
|
+
display var(--micl-duration) linear allow-discrete;
|
|
71
77
|
}
|
|
72
78
|
.micl-bottomsheet__headline {
|
|
73
79
|
box-sizing: border-box;
|
|
74
80
|
display: flex;
|
|
81
|
+
flex-shrink: 0;
|
|
75
82
|
align-items: center;
|
|
76
83
|
inline-size: 100%;
|
|
77
84
|
block-size: var(--md-sys-target-size, 48px);
|
|
78
85
|
justify-content: center;
|
|
79
86
|
cursor: grab;
|
|
87
|
+
touch-action: none;
|
|
80
88
|
|
|
81
89
|
.micl-bottomsheet__draghandle {
|
|
82
90
|
box-sizing: content-box;
|
|
83
|
-
inline-size: var(--md-
|
|
84
|
-
block-size: var(--md-
|
|
85
|
-
padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-
|
|
91
|
+
inline-size: var(--md-comp-bottomsheet-drag-handle-width);
|
|
92
|
+
block-size: var(--md-comp-bottomsheet-drag-handle-height);
|
|
93
|
+
padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-comp-bottomsheet-drag-handle-width)) / 2);
|
|
86
94
|
border: none;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
background
|
|
95
|
+
// only shapes the focus ring; the visible handle is the ::before below
|
|
96
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
97
|
+
background: none;
|
|
90
98
|
cursor: pointer;
|
|
91
99
|
|
|
100
|
+
&::before {
|
|
101
|
+
content: '';
|
|
102
|
+
display: block;
|
|
103
|
+
block-size: 100%;
|
|
104
|
+
border-radius: calc(var(--md-comp-bottomsheet-drag-handle-height) / 2);
|
|
105
|
+
background-color: var(--md-comp-bottomsheet-drag-handle-color, var(--md-sys-color-on-surface-variant));
|
|
106
|
+
}
|
|
92
107
|
&:focus-visible {
|
|
93
|
-
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
108
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-comp-bottomsheet-focus-indicator-color, var(--md-sys-color-secondary));
|
|
94
109
|
outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
|
|
95
110
|
}
|
|
96
111
|
}
|
|
@@ -100,29 +115,28 @@ dialog.micl-bottomsheet {
|
|
|
100
115
|
}
|
|
101
116
|
|
|
102
117
|
.micl-bottomsheet__content {
|
|
103
|
-
|
|
118
|
+
flex: 1 1 auto;
|
|
119
|
+
padding: 0 var(--md-comp-bottomsheet-padding) var(--md-comp-bottomsheet-padding) var(--md-comp-bottomsheet-padding);
|
|
120
|
+
overflow: hidden auto;
|
|
104
121
|
}
|
|
105
122
|
|
|
106
123
|
&::backdrop {
|
|
107
124
|
background-color: rgba(0, 0, 0, 0);
|
|
108
125
|
transition:
|
|
109
|
-
overlay var(--
|
|
110
|
-
display var(--
|
|
111
|
-
background-color var(--
|
|
126
|
+
overlay var(--micl-duration) linear allow-discrete,
|
|
127
|
+
display var(--micl-duration) linear allow-discrete,
|
|
128
|
+
background-color var(--micl-duration) linear;
|
|
112
129
|
}
|
|
113
130
|
&:popover-open,
|
|
114
131
|
&[open] {
|
|
115
|
-
|
|
132
|
+
--micl-duration: var(--md-comp-bottomsheet-motion-duration);
|
|
133
|
+
--micl-easing: #{motion.$md-sys-motion-easing-emphasized-decelerate};
|
|
134
|
+
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
block-size: var(--md-comp-bottomsheet-height);
|
|
116
138
|
opacity: 100%;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
&:not(.micl-bottomsheet--resizing) {
|
|
120
|
-
transition:
|
|
121
|
-
opacity var(--md-sys-bottomsheet-motion-duration) motion.$md-sys-motion-easing-emphasized-decelerate,
|
|
122
|
-
block-size var(--md-sys-bottomsheet-motion-duration) var(--md-sys-bottomsheet-motion-spatial),
|
|
123
|
-
overlay var(--md-sys-bottomsheet-motion-duration) linear allow-discrete,
|
|
124
|
-
display var(--md-sys-bottomsheet-motion-duration) linear allow-discrete;
|
|
125
|
-
}
|
|
139
|
+
|
|
126
140
|
@starting-style {
|
|
127
141
|
block-size: 0;
|
|
128
142
|
opacity: 0;
|
|
@@ -139,11 +153,11 @@ dialog.micl-bottomsheet {
|
|
|
139
153
|
|
|
140
154
|
@media (min-width: 641px) {
|
|
141
155
|
dialog.micl-bottomsheet {
|
|
142
|
-
inline-size: min(100vw - (2 * var(--md-
|
|
156
|
+
inline-size: min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px);
|
|
143
157
|
max-inline-size: 640px;
|
|
144
|
-
min-inline-size: min(100vw - (2 * var(--md-
|
|
145
|
-
inset-inline-start: calc(((100vw - min(100vw - (2 * var(--md-
|
|
146
|
-
margin: var(--md-
|
|
158
|
+
min-inline-size: min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px);
|
|
159
|
+
inset-inline-start: calc(((100vw - min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px)) / 2) - var(--md-comp-bottomsheet-margin));
|
|
160
|
+
margin: var(--md-comp-bottomsheet-margin);
|
|
147
161
|
margin-block-end: 0;
|
|
148
162
|
}
|
|
149
163
|
}
|