material-inspired-component-library 8.1.1 → 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 +7 -5
- package/components/button/_shared.scss +210 -0
- package/components/button/index.scss +49 -283
- 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 +8 -3
- package/components/iconbutton/index.scss +83 -186
- 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 +60 -36
- package/components/navigationrail/_navitem.scss +96 -0
- package/components/navigationrail/index.scss +76 -130
- 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/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 -17
- 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 -291
- 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 -331
- 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 -159
|
@@ -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';
|
|
@@ -51,19 +50,27 @@
|
|
|
51
50
|
@include typography.scale('body-medium');
|
|
52
51
|
@include typography.scale('label-small');
|
|
53
52
|
|
|
54
|
-
:root {
|
|
55
|
-
--md-comp-accordion-item-space: 0px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
53
|
$item-padding-block: var(--md-comp-list-item-top-space, 10px) var(--md-comp-list-item-bottom-space, 10px);
|
|
59
54
|
$item-padding-inline: var(--md-comp-list-item-leading-space, 16px) var(--md-comp-list-item-trailing-space, 16px);
|
|
60
55
|
|
|
61
56
|
$open-accordion: ':where(details[open] > *)';
|
|
62
57
|
|
|
58
|
+
// Each selector group compiles to a single selector.
|
|
59
|
+
$items: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-three)';
|
|
60
|
+
|
|
61
|
+
// An item is selected when it is a checked option, contains a checked checkbox/switch,
|
|
62
|
+
// or is the summary of an open accordion.
|
|
63
|
+
$selected: ':is(:checked, :has(input[type=checkbox]:checked), #{$open-accordion})';
|
|
64
|
+
$unselected: ':not(:checked, :has(input[type=checkbox]:checked), #{$open-accordion})';
|
|
65
|
+
|
|
63
66
|
%shared-interactive-states {
|
|
64
67
|
cursor: pointer;
|
|
65
68
|
|
|
66
|
-
&:
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: var(--md-comp-list-item-focus-indicator-thickness, var(--md-sys-state-focus-indicator-thickness, 3px)) solid var(--md-comp-list-item-focus-indicator-color, var(--md-sys-color-secondary));
|
|
71
|
+
outline-offset: var(--md-comp-list-item-focus-indicator-offset, var(--md-sys-state-focus-indicator-inner-offset, -3px));
|
|
72
|
+
}
|
|
73
|
+
&#{$unselected} {
|
|
67
74
|
&:hover {
|
|
68
75
|
--_list-item-shape: var(--md-comp-list-item-container-hovered-expressive-shape, var(--md-sys-shape-corner-medium, 12px));
|
|
69
76
|
--_headline-color: var(--md-comp-list-item-hover-label-text-color, var(--md-sys-color-on-surface));
|
|
@@ -83,9 +90,6 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
83
90
|
--_trailing-text-color: var(--md-comp-list-item-focus-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant));
|
|
84
91
|
--statelayer-color: var(--md-comp-list-item-focus-state-layer-color, var(--md-sys-color-on-surface));
|
|
85
92
|
--statelayer-opacity: var(--md-comp-list-item-focus-state-layer-opacity, var(--md-sys-state-focus-state-layer-opacity, 10%));
|
|
86
|
-
|
|
87
|
-
outline: var(--md-comp-list-item-focus-indicator-thickness, var(--md-sys-state-focus-indicator-thickness, 3px)) solid var(--md-comp-list-item-focus-indicator-color, var(--md-sys-color-secondary));
|
|
88
|
-
outline-offset: var(--md-comp-list-item-focus-indicator-offset, var(--md-sys-state-focus-indicator-inner-offset, -3px));
|
|
89
93
|
}
|
|
90
94
|
&:active {
|
|
91
95
|
--_list-item-shape: var(--md-comp-list-item-container-pressed-expressive-shape, var(--md-sys-shape-corner-large, 16px));
|
|
@@ -111,7 +115,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
111
115
|
cursor: grabbing;
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
|
-
|
|
118
|
+
&#{$selected} {
|
|
115
119
|
&:hover {
|
|
116
120
|
--_list-item-shape: var(--md-comp-list-item-container-selected-hovered-expressive-shape, var(--md-sys-shape-corner-large, 16px));
|
|
117
121
|
--_headline-color: var(--md-comp-list-item-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container));
|
|
@@ -131,9 +135,6 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
131
135
|
--_trailing-text-color: var(--md-comp-list-item-selected-focus-trailing-supporting-text-color, var(--md-sys-color-on-surface));
|
|
132
136
|
--statelayer-color: var(--md-comp-list-item-selected-focus-state-layer-color, var(--md-sys-color-on-surface));
|
|
133
137
|
--statelayer-opacity: var(--md-comp-list-item-selected-focus-state-layer-opacity, var(--md-sys-state-focus-state-layer-opacity, 10%));
|
|
134
|
-
|
|
135
|
-
outline: var(--md-comp-list-item-focus-indicator-thickness, var(--md-sys-state-focus-indicator-thickness, 3px)) solid var(--md-comp-list-item-focus-indicator-color, var(--md-sys-color-secondary));
|
|
136
|
-
outline-offset: var(--md-comp-list-item-focus-indicator-offset, var(--md-sys-state-focus-indicator-inner-offset, -3px));
|
|
137
138
|
}
|
|
138
139
|
&:active {
|
|
139
140
|
--_list-item-shape: var(--md-comp-list-item-container-selected-pressed-expressive-shape, var(--md-sys-shape-corner-large, 16px));
|
|
@@ -159,7 +160,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
&.micl-rippling {
|
|
162
|
-
animation: micl-ripple var(--md-sys-state-ripple-duration)
|
|
163
|
+
animation: micl-ripple calc(var(--md-sys-state-ripple-duration) * 1.333);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
|
|
@@ -168,7 +169,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
168
169
|
--md-comp-list-motion-duration: #{motion.$md-sys-motion-expressive-default-effects-duration};
|
|
169
170
|
--md-comp-accordion-motion-spatial: #{motion.$md-sys-motion-expressive-default-spatial};
|
|
170
171
|
--md-comp-accordion-motion-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
|
|
171
|
-
--md-
|
|
172
|
+
--md-comp-divider-space: 0.5px;
|
|
172
173
|
--_list-shape: var(--md-comp-list-container-shape, var(--md-sys-shape-corner-large, 16px));
|
|
173
174
|
--_list-item-background-color: var(--md-comp-list-item-container-color, transparent);
|
|
174
175
|
--_list-item-background-opacity: 0%;
|
|
@@ -205,9 +206,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
205
206
|
transform: rotate(180deg);
|
|
206
207
|
}
|
|
207
208
|
|
|
208
|
-
&> summary
|
|
209
|
-
&> summary.micl-list-item-two,
|
|
210
|
-
&> summary.micl-list-item-three {
|
|
209
|
+
&> summary#{$items} {
|
|
211
210
|
position: relative;
|
|
212
211
|
|
|
213
212
|
&::-webkit-details-marker {
|
|
@@ -216,9 +215,6 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
216
215
|
&.micl-list-item--disabled {
|
|
217
216
|
pointer-events: none;
|
|
218
217
|
}
|
|
219
|
-
&:not(.micl-list-item--disabled) {
|
|
220
|
-
@extend %shared-interactive-states;
|
|
221
|
-
}
|
|
222
218
|
}
|
|
223
219
|
.micl-list-item__content {
|
|
224
220
|
box-sizing: border-box;
|
|
@@ -229,17 +225,18 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
229
225
|
}
|
|
230
226
|
}
|
|
231
227
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
228
|
+
// This single extend site keeps every interactive-state rule at one compiled selector.
|
|
229
|
+
// Interactive items are the summaries of accordions, the children of a list that holds a
|
|
230
|
+
// tabindex-marked item (see the README), and the options of a select — with `optgroup`
|
|
231
|
+
// covering grouped options, which are not direct children of their select.
|
|
232
|
+
:is(
|
|
233
|
+
.micl-list > details > summary#{$items},
|
|
234
|
+
:is(.micl-list:has(> #{$items}[tabindex]), select, optgroup) > #{$items}
|
|
235
|
+
):not(:disabled, .micl-list-item--disabled) {
|
|
236
|
+
@extend %shared-interactive-states;
|
|
238
237
|
}
|
|
239
238
|
|
|
240
|
-
|
|
241
|
-
.micl-list-item-two,
|
|
242
|
-
.micl-list-item-three {
|
|
239
|
+
#{$items} {
|
|
243
240
|
--statelayer-color: var(--md-sys-color-on-surface);
|
|
244
241
|
--_list-item-shape: var(--md-comp-list-item-container-expressive-shape, var(--md-sys-shape-corner-extra-small, 4px));
|
|
245
242
|
--_overline-color: var(--md-comp-list-item-overline-color, var(--md-sys-color-on-surface-variant));
|
|
@@ -268,6 +265,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
268
265
|
),
|
|
269
266
|
linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
270
267
|
background-repeat: no-repeat;
|
|
268
|
+
background-position: var(--micl-x, center) var(--micl-y, center), 0 0;
|
|
271
269
|
background-size: 0%, 100%;
|
|
272
270
|
list-style: none;
|
|
273
271
|
transition:
|
|
@@ -329,7 +327,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
329
327
|
opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
|
|
330
328
|
}
|
|
331
329
|
|
|
332
|
-
|
|
330
|
+
&#{$selected} {
|
|
333
331
|
--_list-item-background-color: var(--md-comp-list-item-selected-disabled-container-color, var(--md-sys-color-on-surface));
|
|
334
332
|
--_list-item-background-opacity: var(--md-comp-list-item-selected-disabled-container-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
|
|
335
333
|
--_list-item-shape: var(--md-comp-list-item-container-selected-disabled-expressive-shape, var(--md-sys-shape-corner-large, 16px));
|
|
@@ -343,7 +341,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
343
341
|
--statelayer-opacity: var(--md-comp-list-item-selected-disabled-state-layer-opacity, 0%);
|
|
344
342
|
}
|
|
345
343
|
}
|
|
346
|
-
|
|
344
|
+
&#{$selected} {
|
|
347
345
|
--_list-item-background-color: var(--md-comp-list-item-selected-container-color, var(--md-sys-color-secondary-container));
|
|
348
346
|
--_list-item-background-opacity: 100%;
|
|
349
347
|
--_overline-color: var(--md-comp-list-item-selected-overline-color, var(--md-sys-color-on-secondary-container));
|
|
@@ -353,8 +351,8 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
353
351
|
--_trailing-text-color: var(--md-comp-list-item-selected-trailing-supporting-text-color, var(--md-sys-color-on-secondary-container));
|
|
354
352
|
--_trailing-icon-color: var(--md-comp-list-item-selected-trailing-icon-color, var(--md-sys-color-on-secondary-container));
|
|
355
353
|
}
|
|
356
|
-
&:not(:disabled
|
|
357
|
-
|
|
354
|
+
&:not(:disabled, .micl-list-item--disabled) {
|
|
355
|
+
&#{$selected} {
|
|
358
356
|
--_list-item-shape: var(--md-comp-list-item-container-selected-expressive-shape, var(--md-sys-shape-corner-large, 16px));
|
|
359
357
|
}
|
|
360
358
|
input[type=checkbox]:not(:disabled):hover,
|
|
@@ -391,7 +389,7 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
391
389
|
-webkit-line-clamp: 2;
|
|
392
390
|
}
|
|
393
391
|
}
|
|
394
|
-
|
|
392
|
+
#{$items} {
|
|
395
393
|
input[type=checkbox].micl-checkbox {
|
|
396
394
|
block-size: 24px;
|
|
397
395
|
min-block-size: 24px;
|
|
@@ -483,6 +481,6 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
483
481
|
color: var(--_trailing-text-color);
|
|
484
482
|
}
|
|
485
483
|
|
|
486
|
-
|
|
484
|
+
.micl-list details[open] .micl-list-item__icon--expander:dir(rtl) {
|
|
487
485
|
transform: rotate(-180deg);
|
|
488
486
|
}
|
|
@@ -41,6 +41,7 @@ This component requires JavaScript for functionality:
|
|
|
41
41
|
```JavaScript
|
|
42
42
|
import micl from "material-inspired-component-library/dist/micl";
|
|
43
43
|
```
|
|
44
|
+
When loading individual JavaScript files, also load `dist/list` — it provides the keyboard navigation of the menu items.
|
|
44
45
|
|
|
45
46
|
This will initialize any Menu component, including those that will be added to the DOM later on.
|
|
46
47
|
|
|
@@ -176,161 +177,86 @@ Menu items can be grouped by including a [Divider component](../divider/README.m
|
|
|
176
177
|
|
|
177
178
|
You may include an `<li>` with the `micl-menu__section` class to give the menu item group a descriptive title.
|
|
178
179
|
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
|
210
|
-
|
|
211
|
-
|
|
|
212
|
-
|
|
|
213
|
-
|
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
|
|
|
217
|
-
|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
220
|
-
|
|
|
221
|
-
|
|
|
222
|
-
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
|
243
|
-
|
|
244
|
-
|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
| --md-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
|
253
|
-
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
|
|
|
258
|
-
|
|
|
259
|
-
| --md-comp-menu-vibrant-menu-item-hovered-trailing-icon-color |
|
|
260
|
-
| --md-comp-menu-vibrant-menu-item-hovered-trailing-supporting-text-color |
|
|
261
|
-
| --md-comp-menu-vibrant-menu-item-pressed-label-text-color |
|
|
262
|
-
| --md-comp-menu-vibrant-menu-item-pressed-leading-icon-color |
|
|
263
|
-
| --md-comp-menu-vibrant-menu-item-pressed-state-layer-color |
|
|
264
|
-
| --md-comp-menu-vibrant-menu-item-pressed-state-layer-opacity |
|
|
265
|
-
| --md-comp-menu-vibrant-menu-item-pressed-supporting-text-color |
|
|
266
|
-
| --md-comp-menu-vibrant-menu-item-pressed-trailing-icon-color |
|
|
267
|
-
| --md-comp-menu-vibrant-menu-item-pressed-trailing-supporting-text-color |
|
|
268
|
-
| --md-comp-menu-vibrant-menu-item-label-text-color |
|
|
269
|
-
| --md-comp-menu-vibrant-menu-item-leading-icon-color |
|
|
270
|
-
| --md-comp-menu-vibrant-menu-item-supporting-text-color |
|
|
271
|
-
| --md-comp-menu-vibrant-menu-item-trailing-icon-color |
|
|
272
|
-
| --md-comp-menu-vibrant-menu-item-trailing-supporting-text-color |
|
|
273
|
-
| --md-comp-menu-vibrant-section-label-text-color |
|
|
274
|
-
| |
|
|
275
|
-
| --md-comp-menu-standard-menu-item-selected-container-color |
|
|
276
|
-
| --md-comp-menu-standard-menu-item-selected-label-text-color |
|
|
277
|
-
| --md-comp-menu-standard-menu-item-selected-leading-icon-color |
|
|
278
|
-
| --md-comp-menu-standard-menu-item-selected-supporting-text-color |
|
|
279
|
-
| --md-comp-menu-standard-menu-item-selected-trailing-icon-color |
|
|
280
|
-
| --md-comp-menu-standard-menu-item-selected-trailing-supporting-text-color |
|
|
281
|
-
| |
|
|
282
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-container-color |
|
|
283
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-container-opacity |
|
|
284
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-label-text-color |
|
|
285
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-label-text-opacity |
|
|
286
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-leading-icon-color |
|
|
287
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-leading-icon-opacity |
|
|
288
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-trailing-icon-color |
|
|
289
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-trailing-icon-opacity |
|
|
290
|
-
| --md-comp-menu-standard-menu-item-selected-disabled-trailing-supporting-text-color |
|
|
291
|
-
| --md-comp-menu-standard-menu-item-selected-focused-label-text-color |
|
|
292
|
-
| --md-comp-menu-standard-menu-item-selected-focused-leading-icon-color |
|
|
293
|
-
| --md-comp-menu-standard-menu-item-selected-focused-state-layer-color |
|
|
294
|
-
| --md-comp-menu-standard-menu-item-selected-focused-state-layer-opacity |
|
|
295
|
-
| --md-comp-menu-standard-menu-item-selected-focused-supporting-text-color |
|
|
296
|
-
| --md-comp-menu-standard-menu-item-selected-focused-trailing-icon-color |
|
|
297
|
-
| --md-comp-menu-standard-menu-item-selected-focused-trailing-supporting-text-color |
|
|
298
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-label-text-color |
|
|
299
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-leading-icon-color |
|
|
300
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-state-layer-color |
|
|
301
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-state-layer-opacity |
|
|
302
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-supporting-text-color |
|
|
303
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-trailing-icon-color |
|
|
304
|
-
| --md-comp-menu-standard-menu-item-selected-hovered-trailing-supporting-text-color |
|
|
305
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-label-text-color |
|
|
306
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-leading-icon-color |
|
|
307
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-state-layer-color |
|
|
308
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-state-layer-opacity |
|
|
309
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-supporting-text-color |
|
|
310
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-trailing-icon-color |
|
|
311
|
-
| --md-comp-menu-standard-menu-item-selected-pressed-trailing-supporting-text-color |
|
|
312
|
-
| |
|
|
313
|
-
| --md-comp-menu-vibrant-menu-item-selected-container-color |
|
|
314
|
-
| --md-comp-menu-vibrant-menu-item-selected-label-text-color |
|
|
315
|
-
| --md-comp-menu-vibrant-menu-item-selected-leading-icon-color |
|
|
316
|
-
| --md-comp-menu-vibrant-menu-item-selected-supporting-text-color |
|
|
317
|
-
| --md-comp-menu-vibrant-menu-item-selected-trailing-icon-color |
|
|
318
|
-
| --md-comp-menu-vibrant-menu-item-selected-trailing-supporting-text-color |
|
|
319
|
-
| |
|
|
320
|
-
| --md-comp-menu-vibrant-menu-item-selected-disabled-label-text-opacity |
|
|
321
|
-
| --md-comp-menu-vibrant-menu-item-selected-disabled-leading-icon-opacity |
|
|
322
|
-
| --md-comp-menu-vibrant-menu-item-selected-disabled-supporting-text-opacity |
|
|
323
|
-
| --md-comp-menu-vibrant-menu-item-selected-disabled-trailing-icon-opacity |
|
|
324
|
-
| --md-comp-menu-vibrant-menu-item-selected-disabled-trailing-supporting-text-opacity |
|
|
325
|
-
| --md-comp-menu-vibrant-menu-item-selected-focused-state-layer-color |
|
|
326
|
-
| --md-comp-menu-vibrant-menu-item-selected-focused-state-layer-opacity |
|
|
327
|
-
| --md-comp-menu-vibrant-menu-item-selected-focused-label-text-color |
|
|
328
|
-
| --md-comp-menu-vibrant-menu-item-selected-hovered-state-layer-color |
|
|
329
|
-
| --md-comp-menu-vibrant-menu-item-selected-hovered-state-layer-opacity |
|
|
330
|
-
| --md-comp-menu-vibrant-menu-item-selected-hovered-label-text-color |
|
|
331
|
-
| --md-comp-menu-vibrant-menu-item-selected-pressed-state-layer-color |
|
|
332
|
-
| --md-comp-menu-vibrant-menu-item-selected-pressed-state-layer-opacity |
|
|
333
|
-
| --md-comp-menu-vibrant-menu-item-selected-pressed-label-text-color |
|
|
180
|
+
## Theming
|
|
181
|
+
Each menu can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention, as defined in the [Material Design 3 Expressive Menu Specification](https://m3.material.io/components/menus/specs). Set them on any appropriate parent element to affect its child menus.
|
|
182
|
+
|
|
183
|
+
### Container
|
|
184
|
+
|
|
185
|
+
| Custom property | Meaning | Default |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| `--md-comp-menu-width-min` | The minimum width of a menu | `112px` |
|
|
188
|
+
| `--md-comp-menu-width-max` | The maximum width of a menu | `320px` |
|
|
189
|
+
| `--md-comp-menu-container-elevation` | The shadow (elevation) of the menu surface | `--md-sys-elevation-level2` |
|
|
190
|
+
| `--md-comp-menu-container-shape` | The corner rounding of the menu surface | `--md-sys-shape-corner-large` |
|
|
191
|
+
| `--md-comp-menu-active-container-shape` | The corner rounding while the menu is the frontmost menu | `--md-comp-menu-container-shape` |
|
|
192
|
+
| `--md-comp-menu-inactive-container-shape` | The corner rounding while one of its submenus is open | `--md-sys-shape-corner-small` |
|
|
193
|
+
| `--md-comp-menu-standard-container-color` | The background color of a standard menu | `--md-sys-color-surface-container-low` |
|
|
194
|
+
| `--md-comp-menu-vibrant-container-color` | The background color of a vibrant menu | `--md-sys-color-tertiary-container` |
|
|
195
|
+
|
|
196
|
+
### Item groups and section labels
|
|
197
|
+
|
|
198
|
+
| Custom property | Meaning | Default |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| `--md-comp-menu-gap` | The gap between the item groups (the lists) of a menu | `2px` |
|
|
201
|
+
| `--md-comp-menu-group-padding` | The vertical padding inside an item group | `4px` |
|
|
202
|
+
| `--md-comp-menu-group-shape` | The corner rounding of the edges where two item groups meet | `--md-sys-shape-corner-small` |
|
|
203
|
+
| `--md-comp-menu-section-label-top-space` | The padding above a section label | `8px` |
|
|
204
|
+
| `--md-comp-menu-section-label-bottom-space` | The padding below a section label | `8px` |
|
|
205
|
+
| `--md-comp-menu-standard-section-label-text-color` | The text color of a section label in a standard menu | `--md-sys-color-on-surface-variant` |
|
|
206
|
+
| `--md-comp-menu-vibrant-section-label-text-color` | The text color of a section label in a vibrant menu | `--md-sys-color-on-tertiary-container` |
|
|
207
|
+
|
|
208
|
+
### Item layout
|
|
209
|
+
|
|
210
|
+
| Custom property | Meaning | Default |
|
|
211
|
+
|---|---|---|
|
|
212
|
+
| `--md-comp-menu-item-height` | The height of a menu item | `44px` |
|
|
213
|
+
| `--md-comp-menu-item-top-space` | The padding above the item content | `8px` |
|
|
214
|
+
| `--md-comp-menu-item-bottom-space` | The padding below the item content | `8px` |
|
|
215
|
+
| `--md-comp-menu-item-leading-space` | The padding before the item content | `16px` |
|
|
216
|
+
| `--md-comp-menu-item-trailing-space` | The padding after the item content | `16px` |
|
|
217
|
+
| `--md-comp-menu-item-leading-icon-size` | The size of a leading icon | `20px` |
|
|
218
|
+
| `--md-comp-menu-item-trailing-icon-size` | The size of a trailing icon | `20px` |
|
|
219
|
+
| `--md-comp-menu-item-shape` | The corner rounding of a menu item | `--md-sys-shape-corner-small` |
|
|
220
|
+
| `--md-comp-menu-item-selected-shape` | The corner rounding of a selected menu item | `--md-sys-shape-corner-large` |
|
|
221
|
+
| `--md-comp-menu-item-focus-indicator-color` | The color of the keyboard focus indicator | `--md-sys-color-secondary` |
|
|
222
|
+
| `--md-comp-menu-item-focus-indicator-thickness` | The thickness of the keyboard focus indicator | `3px` |
|
|
223
|
+
| `--md-comp-menu-item-focus-indicator-offset` | The offset of the keyboard focus indicator | `-3px` |
|
|
224
|
+
|
|
225
|
+
### Item colors
|
|
226
|
+
The colors of menu items follow a naming pattern that combines the menu variant, the item's selection and interaction state, and the colored part:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
--md-comp-menu-<variant>-menu-item[-selected][-<state>]-<part>-color
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
- `<variant>` is `standard` or `vibrant`.
|
|
233
|
+
- `selected` targets items that are checked or contain a checked checkbox or switch.
|
|
234
|
+
- `<state>` is one of `hovered`, `focused`, `pressed` or `disabled`; omit it for the resting state.
|
|
235
|
+
- `<part>` is one of `container`, `label-text`, `leading-icon`, `supporting-text`, `trailing-icon`, `trailing-supporting-text` or `state-layer`.
|
|
236
|
+
|
|
237
|
+
Every `state-layer` color has an `-opacity` companion (defaults: hovered 8%, focused 10%, pressed 10%), and so does every color of a `disabled` state (default: --md-sys-state-disabled-state-layer-opacity, 38%). The `container` part exists for the resting, `selected` and `selected-disabled` combinations only. For example, `--md-comp-menu-standard-menu-item-selected-hovered-label-text-color` is the label color of a hovered selected item in a standard menu.
|
|
238
|
+
|
|
239
|
+
Inside a menu these tokens take precedence over the item color tokens of the [List component](../list/README.md). The defaults per part:
|
|
240
|
+
|
|
241
|
+
**Standard menu**
|
|
242
|
+
|
|
243
|
+
| Part | Resting | Hovered, focused, pressed | Selected (all states) | Disabled |
|
|
244
|
+
|---|---|---|---|---|
|
|
245
|
+
| container | `--md-sys-color-surface-container-low` | | `--md-sys-color-tertiary-container` | selected colors at `38%` |
|
|
246
|
+
| label-text | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-surface` at `38%` |
|
|
247
|
+
| leading-icon, trailing-icon | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-surface` at `38%` |
|
|
248
|
+
| supporting-text, trailing-supporting-text | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-tertiary-container | --md-sys-color-on-surface` at `38%` |
|
|
249
|
+
| state-layer | | --md-sys-color-on-surface | `--md-sys-color-on-tertiary-container` | |
|
|
250
|
+
|
|
251
|
+
**Vibrant menu**
|
|
252
|
+
|
|
253
|
+
| Part | Resting | Hovered, focused, pressed | Selected (all states) | Disabled |
|
|
254
|
+
|---|---|---|---|---|
|
|
255
|
+
| container | `--md-sys-color-tertiary-container` | | `--md-sys-color-tertiary` | selected colors at `38%` |
|
|
256
|
+
| label-text | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
|
|
257
|
+
| leading-icon, trailing-icon | `--md-sys-color-on-tertiary-container` | `--md-sys-color-tertiary` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
|
|
258
|
+
| supporting-text, trailing-supporting-text | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
|
|
259
|
+
| state-layer | | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | |
|
|
334
260
|
|
|
335
261
|
**Example: Changing the maximum width**
|
|
336
262
|
|