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
|
@@ -25,6 +25,8 @@ To create a basic dialog, use the `<dialog>` element with the `micl-dialog` clas
|
|
|
25
25
|
Import the dialog styles into your project:
|
|
26
26
|
|
|
27
27
|
```CSS
|
|
28
|
+
@use "material-inspired-component-library/dist/button";
|
|
29
|
+
@use "material-inspired-component-library/dist/iconbutton";
|
|
28
30
|
@use "material-inspired-component-library/dist/dialog";
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -117,20 +119,28 @@ A full-screen dialog covers the entire viewport, primarily on smaller screens. O
|
|
|
117
119
|
|
|
118
120
|
- When not in full-screen mode (e.g., on wider screens), the `micl-dialog__fullscreen` buttons are hidden, and the standard dialog actions (`micl-dialog__actions`) are visible.
|
|
119
121
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
|
124
|
-
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
122
|
+
## Theming
|
|
123
|
+
Each dialog 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 dialogs.
|
|
124
|
+
|
|
125
|
+
| Custom property | Meaning | Default |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| `--md-comp-dialog-min-width` | The minimum width of a dialog | `280px` |
|
|
128
|
+
| `--md-comp-dialog-max-width` | The maximum width of a dialog | `560px` |
|
|
129
|
+
| `--md-comp-dialog-padding` | The inner padding between the dialog's edge and its content | `24px` |
|
|
130
|
+
| `--md-comp-dialog-headline-space` | The vertical spacing between the elements in the header | `16px` |
|
|
131
|
+
| `--md-comp-dialog-container-color` | The background color of the dialog | `--md-sys-color-surface-container-high` |
|
|
132
|
+
| `--md-comp-dialog-container-shape` | The corner rounding of the dialog | `--md-sys-shape-corner-extra-large` |
|
|
133
|
+
| `--md-comp-dialog-container-elevation` | The shadow (elevation) of the dialog | `--md-sys-elevation-level3` |
|
|
134
|
+
| `--md-comp-dialog-headline-color` | The text color of the headline | `--md-sys-color-on-surface` |
|
|
135
|
+
| `--md-comp-dialog-supporting-text-color` | The text color of the supporting text | `--md-sys-color-on-surface-variant` |
|
|
136
|
+
| `--md-comp-dialog-icon-color` | The color of the dialog icon | `--md-sys-color-secondary` |
|
|
137
|
+
| `--md-comp-dialog-icon-size` | The size of the dialog icon | `--md-sys-icon-size` |
|
|
138
|
+
| `--md-comp-full-screen-dialog-container-color` | The background color of a full-screen dialog | `--md-sys-color-surface` |
|
|
129
139
|
|
|
130
140
|
**Example: Changing the dialog padding**
|
|
131
141
|
|
|
132
142
|
```HTML
|
|
133
|
-
<div style="--md-
|
|
143
|
+
<div style="--md-comp-dialog-padding:16px">
|
|
134
144
|
<dialog class="micl-dialog">
|
|
135
145
|
</dialog>
|
|
136
146
|
</div>
|
|
@@ -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';
|
|
@@ -43,56 +42,55 @@
|
|
|
43
42
|
@include typography.scale('body-medium');
|
|
44
43
|
|
|
45
44
|
:root {
|
|
46
|
-
--
|
|
47
|
-
--md-sys-dialog-max-width: 560px;
|
|
48
|
-
--md-sys-dialog-padding: 24px;
|
|
49
|
-
--md-sys-dialog-headline-space: 16px;
|
|
50
|
-
--md-sys-dialog-dir-factor: 1;
|
|
45
|
+
--_dialog-dir-factor: 1;
|
|
51
46
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
--md-sys-dialog-dir-factor: -1;
|
|
47
|
+
:dir(rtl) {
|
|
48
|
+
--_dialog-dir-factor: -1;
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
dialog.micl-dialog {
|
|
58
52
|
--statelayer-color: var(--md-sys-color-primary);
|
|
59
|
-
--md-
|
|
60
|
-
--md-
|
|
61
|
-
|
|
53
|
+
--md-comp-dialog-motion-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
|
|
54
|
+
--md-comp-dialog-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
|
|
55
|
+
|
|
56
|
+
--micl-duration: var(--md-comp-dialog-motion-duration-reverse);
|
|
57
|
+
--micl-easing: #{motion.$md-sys-motion-easing-emphasized-decelerate};
|
|
62
58
|
|
|
63
|
-
--_dialog-background-color: var(--md-sys-color-surface-container-high);
|
|
59
|
+
--_dialog-background-color: var(--md-comp-dialog-container-color, var(--md-sys-color-surface-container-high));
|
|
60
|
+
--_padding: var(--md-comp-dialog-padding, 24px);
|
|
61
|
+
--_translate: translate(calc(var(--_dialog-dir-factor, 1) * -50%), -50%);
|
|
64
62
|
|
|
65
63
|
box-sizing: border-box;
|
|
66
64
|
display: none;
|
|
67
65
|
flex-direction: column;
|
|
68
|
-
min-inline-size: var(--md-
|
|
69
|
-
max-inline-size: var(--md-
|
|
66
|
+
min-inline-size: var(--md-comp-dialog-min-width, 280px);
|
|
67
|
+
max-inline-size: var(--md-comp-dialog-max-width, 560px);
|
|
70
68
|
max-block-size: 100vh;
|
|
71
69
|
inset-block-start: anchor(start);
|
|
72
70
|
inset-inline-start: anchor(start);
|
|
73
|
-
transform:
|
|
71
|
+
transform: var(--_translate) scale(50%);
|
|
74
72
|
padding: 0;
|
|
75
73
|
margin: 0;
|
|
76
74
|
outline: none;
|
|
77
75
|
border: none;
|
|
78
|
-
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
76
|
+
border-radius: var(--md-comp-dialog-container-shape, var(--md-sys-shape-corner-extra-large));
|
|
79
77
|
background-color: var(--_dialog-background-color);
|
|
80
78
|
background-image: linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
81
79
|
background-repeat: no-repeat;
|
|
82
|
-
box-shadow: var(--md-sys-elevation-level3);
|
|
80
|
+
box-shadow: var(--md-comp-dialog-container-elevation, var(--md-sys-elevation-level3));
|
|
83
81
|
opacity: 0;
|
|
84
82
|
overflow: hidden;
|
|
85
83
|
interpolate-size: allow-keywords;
|
|
86
84
|
transition:
|
|
87
|
-
inset-block-start var(--
|
|
88
|
-
inset-inline-start var(--
|
|
89
|
-
inline-size var(--
|
|
90
|
-
block-size var(--
|
|
91
|
-
transform var(--
|
|
92
|
-
opacity var(--
|
|
93
|
-
overlay var(--
|
|
94
|
-
display var(--
|
|
95
|
-
--statelayer-opacity var(--md-
|
|
85
|
+
inset-block-start var(--micl-duration) linear,
|
|
86
|
+
inset-inline-start var(--micl-duration) linear,
|
|
87
|
+
inline-size var(--micl-duration) linear,
|
|
88
|
+
block-size var(--micl-duration) linear,
|
|
89
|
+
transform var(--micl-duration) linear,
|
|
90
|
+
opacity var(--micl-duration) var(--micl-easing),
|
|
91
|
+
overlay var(--micl-duration) linear allow-discrete,
|
|
92
|
+
display var(--micl-duration) linear allow-discrete,
|
|
93
|
+
--statelayer-opacity var(--md-comp-dialog-motion-duration) linear;
|
|
96
94
|
|
|
97
95
|
@starting-style {
|
|
98
96
|
block-size: fit-content;
|
|
@@ -100,31 +98,25 @@ dialog.micl-dialog {
|
|
|
100
98
|
inset-block-start: anchor(start);
|
|
101
99
|
inset-inline-start: anchor(start);
|
|
102
100
|
opacity: 0;
|
|
103
|
-
transform:
|
|
101
|
+
transform: var(--_translate) scale(50%);
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
&:popover-open,
|
|
107
105
|
&[open] {
|
|
106
|
+
--micl-duration: var(--md-comp-dialog-motion-duration);
|
|
107
|
+
--micl-easing: #{motion.$md-sys-motion-easing-emphasized-accelerate};
|
|
108
|
+
|
|
108
109
|
display: flex;
|
|
109
110
|
inset-block-start: 50%;
|
|
110
111
|
inset-inline-start: 50%;
|
|
111
112
|
opacity: 1;
|
|
112
|
-
transform:
|
|
113
|
-
transition:
|
|
114
|
-
inset-block-start var(--md-sys-dialog-motion-duration) linear,
|
|
115
|
-
inset-inline-start var(--md-sys-dialog-motion-duration) linear,
|
|
116
|
-
inline-size var(--md-sys-dialog-motion-duration) linear,
|
|
117
|
-
block-size var(--md-sys-dialog-motion-duration) linear,
|
|
118
|
-
transform var(--md-sys-dialog-motion-duration) linear,
|
|
119
|
-
opacity var(--md-sys-dialog-motion-duration) motion.$md-sys-motion-easing-emphasized-accelerate,
|
|
120
|
-
overlay var(--md-sys-dialog-motion-duration) linear allow-discrete,
|
|
121
|
-
display var(--md-sys-dialog-motion-duration) linear allow-discrete;
|
|
113
|
+
transform: var(--_translate) scale(100%);
|
|
122
114
|
|
|
123
115
|
@starting-style {
|
|
124
116
|
inset-block-start: anchor(start);
|
|
125
117
|
inset-inline-start: anchor(start);
|
|
126
118
|
opacity: 0;
|
|
127
|
-
transform:
|
|
119
|
+
transform: var(--_translate) scale(50%);
|
|
128
120
|
}
|
|
129
121
|
}
|
|
130
122
|
&:not([popover]) {
|
|
@@ -148,9 +140,9 @@ dialog.micl-dialog {
|
|
|
148
140
|
&::backdrop {
|
|
149
141
|
background-color: rgba(0, 0, 0, 0);
|
|
150
142
|
transition:
|
|
151
|
-
background-color var(--md-
|
|
152
|
-
overlay var(--md-
|
|
153
|
-
display var(--md-
|
|
143
|
+
background-color var(--md-comp-dialog-motion-duration) linear,
|
|
144
|
+
overlay var(--md-comp-dialog-motion-duration) linear allow-discrete,
|
|
145
|
+
display var(--md-comp-dialog-motion-duration) linear allow-discrete;
|
|
154
146
|
}
|
|
155
147
|
&[open]::backdrop {
|
|
156
148
|
background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
|
|
@@ -169,40 +161,38 @@ dialog.micl-dialog {
|
|
|
169
161
|
position-try-fallbacks: flip-block;
|
|
170
162
|
}
|
|
171
163
|
|
|
172
|
-
// &:hover {
|
|
173
|
-
// --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
174
|
-
// }
|
|
175
|
-
|
|
176
164
|
.micl-dialog__headline {
|
|
177
165
|
display: flex;
|
|
178
166
|
flex-direction: column;
|
|
179
167
|
flex-shrink: 0;
|
|
180
168
|
align-items: flex-start;
|
|
181
169
|
gap: 16px;
|
|
182
|
-
padding-block: var(--
|
|
183
|
-
padding-inline: var(--
|
|
170
|
+
padding-block: var(--_padding) var(--md-comp-dialog-headline-space, 16px);
|
|
171
|
+
padding-inline: var(--_padding);
|
|
184
172
|
background-color: transparent;
|
|
185
173
|
|
|
186
174
|
&:has(> .micl-dialog__icon) {
|
|
187
175
|
align-items: center;
|
|
188
176
|
}
|
|
189
177
|
.micl-dialog__icon {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
178
|
+
--_icon-size: var(--md-comp-dialog-icon-size, var(--md-sys-icon-size, 24px));
|
|
179
|
+
|
|
180
|
+
inline-size: var(--_icon-size);
|
|
181
|
+
block-size: var(--_icon-size);
|
|
182
|
+
font-size: var(--_icon-size);
|
|
183
|
+
color: var(--md-comp-dialog-icon-color, var(--md-sys-color-secondary));
|
|
194
184
|
}
|
|
195
|
-
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
185
|
+
:is(h1, h2, h3, h4, h5, h6, .micl-heading) {
|
|
196
186
|
@include typography.headline-small;
|
|
197
187
|
|
|
198
188
|
flex: 1 1 100%;
|
|
199
189
|
margin: 0;
|
|
200
|
-
color: var(--md-sys-color-on-surface);
|
|
190
|
+
color: var(--md-comp-dialog-headline-color, var(--md-sys-color-on-surface));
|
|
201
191
|
}
|
|
202
192
|
.micl-dialog__subhead {
|
|
203
193
|
@include typography.title-medium;
|
|
204
194
|
|
|
205
|
-
padding-inline: var(--
|
|
195
|
+
padding-inline: var(--_padding);
|
|
206
196
|
overflow: hidden;
|
|
207
197
|
text-overflow: ellipsis;
|
|
208
198
|
white-space: nowrap;
|
|
@@ -215,11 +205,11 @@ dialog.micl-dialog {
|
|
|
215
205
|
.micl-dialog__supporting-text {
|
|
216
206
|
@include typography.body-medium;
|
|
217
207
|
|
|
218
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
208
|
+
color: var(--md-comp-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant));
|
|
219
209
|
}
|
|
220
210
|
.micl-dialog__content {
|
|
221
211
|
flex-shrink: 1;
|
|
222
|
-
padding-inline: var(--
|
|
212
|
+
padding-inline: var(--_padding);
|
|
223
213
|
overflow-y: auto;
|
|
224
214
|
}
|
|
225
215
|
.micl-dialog__actions {
|
|
@@ -227,18 +217,18 @@ dialog.micl-dialog {
|
|
|
227
217
|
flex-shrink: 0;
|
|
228
218
|
justify-content: flex-end;
|
|
229
219
|
column-gap: 8px;
|
|
230
|
-
padding: var(--
|
|
220
|
+
padding: var(--_padding);
|
|
231
221
|
opacity: 1;
|
|
232
222
|
transition:
|
|
233
|
-
opacity var(--md-
|
|
234
|
-
overlay var(--md-
|
|
235
|
-
display var(--md-
|
|
223
|
+
opacity var(--md-comp-dialog-motion-duration) linear allow-discrete,
|
|
224
|
+
overlay var(--md-comp-dialog-motion-duration) linear allow-discrete,
|
|
225
|
+
display var(--md-comp-dialog-motion-duration) linear allow-discrete;
|
|
236
226
|
}
|
|
237
227
|
}
|
|
238
228
|
|
|
239
229
|
dialog.micl-dialog.micl-dialog--fullscreen {
|
|
240
230
|
@media (max-width: 560px) {
|
|
241
|
-
--_dialog-background-color: var(--md-sys-color-surface);
|
|
231
|
+
--_dialog-background-color: var(--md-comp-full-screen-dialog-container-color, var(--md-sys-color-surface));
|
|
242
232
|
|
|
243
233
|
inline-size: 100vw;
|
|
244
234
|
block-size: 100vh;
|
|
@@ -247,10 +237,9 @@ dialog.micl-dialog.micl-dialog--fullscreen {
|
|
|
247
237
|
box-shadow: var(--md-sys-elevation-level0);
|
|
248
238
|
timeline-scope: --headlineTimeline;
|
|
249
239
|
|
|
250
|
-
// &:hover {
|
|
251
|
-
// --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
252
|
-
// }
|
|
253
240
|
.micl-dialog__headline {
|
|
241
|
+
// border-box: the 56px of the spec include the block padding
|
|
242
|
+
box-sizing: border-box;
|
|
254
243
|
block-size: 56px;
|
|
255
244
|
flex-direction: row;
|
|
256
245
|
align-items: center;
|
|
@@ -264,7 +253,7 @@ dialog.micl-dialog.micl-dialog--fullscreen {
|
|
|
264
253
|
animation-range: 0% 20%;
|
|
265
254
|
z-index: 1;
|
|
266
255
|
|
|
267
|
-
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
256
|
+
:is(h1, h2, h3, h4, h5, h6, .micl-heading) {
|
|
268
257
|
@include typography.title-large;
|
|
269
258
|
|
|
270
259
|
margin: 0;
|
|
@@ -33,25 +33,26 @@ The Divider component offers five CSS classes for different divider styles:
|
|
|
33
33
|
|
|
34
34
|
| CSS class | Description |
|
|
35
35
|
| --------- | ----------- |
|
|
36
|
-
| micl-divider | A standard, full-width divider |
|
|
37
|
-
| micl-divider-inset | Indented equally on both the left and right sides |
|
|
38
|
-
| micl-divider-inset-start | Indented only on the left (start) side |
|
|
39
|
-
| micl-divider-inset-end | Indented only on the right (end) side |
|
|
40
|
-
| micl-divider-vertical | A vertical divider |
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
36
|
+
| `micl-divider` | A standard, full-width divider |
|
|
37
|
+
| `micl-divider-inset` | Indented equally on both the left and right sides |
|
|
38
|
+
| `micl-divider-inset-start` | Indented only on the left (start) side |
|
|
39
|
+
| `micl-divider-inset-end` | Indented only on the right (end) side |
|
|
40
|
+
| `micl-divider-vertical` | A vertical divider |
|
|
41
|
+
|
|
42
|
+
## Theming
|
|
43
|
+
Each divider can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention.
|
|
44
|
+
|
|
45
|
+
| Custom property | Meaning | Default |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `--md-comp-divider-color` | The color of the divider | `--md-sys-color-outline-variant` |
|
|
48
|
+
| `--md-comp-divider-thickness` | Controls the thickness (height for horizontal, width for vertical) of the divider | `1px` |
|
|
49
|
+
| `--md-comp-divider-inset-margin` | Defines the indentation distance for inset dividers | `16px` |
|
|
50
|
+
| `--md-comp-divider-space` | Sets the spacing between the divider and adjacent text or elements | `4px` |
|
|
50
51
|
|
|
51
52
|
**Example: Changing the inset margin**
|
|
52
53
|
|
|
53
54
|
```HTML
|
|
54
|
-
<div style="--md-
|
|
55
|
+
<div style="--md-comp-divider-inset-margin:32px">
|
|
55
56
|
<hr class="micl-divider-inset">
|
|
56
57
|
</div>
|
|
57
58
|
```
|
|
@@ -19,55 +19,39 @@
|
|
|
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
|
|
|
24
|
-
:root {
|
|
25
|
-
--md-sys-divider-thickness: 1px;
|
|
26
|
-
--md-sys-divider-inset-margin: 16px;
|
|
27
|
-
--md-sys-divider-space: 4px;
|
|
28
|
-
}
|
|
29
23
|
body {
|
|
30
|
-
--md-
|
|
24
|
+
--md-comp-divider-color: var(--md-sys-color-outline-variant, gray);
|
|
31
25
|
}
|
|
32
26
|
|
|
33
27
|
.micl-divider,
|
|
34
28
|
.micl-divider-inset,
|
|
35
29
|
.micl-divider-inset-start,
|
|
36
30
|
.micl-divider-inset-end {
|
|
37
|
-
|
|
38
|
-
block-size: 0;
|
|
39
|
-
margin-block: calc(var(--md-sys-divider-space, 4px) - 0.5px) calc(var(--md-sys-divider-space, 4px) - 0.5px);
|
|
31
|
+
margin-block: calc(var(--md-comp-divider-space, 4px) - 0.5px);
|
|
40
32
|
margin-inline: 0;
|
|
41
33
|
border: none;
|
|
42
|
-
border-block-start: var(--md-
|
|
34
|
+
border-block-start: var(--md-comp-divider-thickness, 1px) solid var(--md-comp-divider-color);
|
|
35
|
+
list-style: none;
|
|
43
36
|
}
|
|
44
37
|
|
|
45
38
|
.micl-divider-inset {
|
|
46
|
-
inline
|
|
47
|
-
margin-inline: var(--md-sys-divider-inset-margin);
|
|
39
|
+
margin-inline: var(--md-comp-divider-inset-margin, 16px);
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
.micl-divider-inset-start {
|
|
51
|
-
inline-
|
|
52
|
-
margin-inline-start: var(--md-sys-divider-inset-margin, 16px);
|
|
43
|
+
margin-inline-start: var(--md-comp-divider-inset-margin, 16px);
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
.micl-divider-inset-end {
|
|
56
|
-
inline-
|
|
57
|
-
margin-inline-end: var(--md-sys-divider-inset-margin, 16px);
|
|
47
|
+
margin-inline-end: var(--md-comp-divider-inset-margin, 16px);
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
.micl-divider-vertical {
|
|
61
51
|
min-block-size: 100%;
|
|
62
52
|
inline-size: 0;
|
|
63
53
|
margin-block: 0;
|
|
64
|
-
margin-inline: calc(2 * var(--md-
|
|
54
|
+
margin-inline: calc(2 * var(--md-comp-divider-space, 4px));
|
|
65
55
|
border: none;
|
|
66
|
-
border-inline-start: var(--md-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
li.micl-divider {
|
|
70
|
-
list-style: none;
|
|
71
|
-
box-shadow: 0 calc(-1 * var(--md-sys-divider-space, 4px) / 2) 0 calc(var(--md-sys-divider-space, 4px) / 2) var(--md-sys-list-item-container-color),
|
|
72
|
-
0 calc(var(--md-sys-divider-space, 4px) / 2) 0 calc(var(--md-sys-divider-space, 4px) / 2) var(--md-sys-list-item-container-color);
|
|
56
|
+
border-inline-start: var(--md-comp-divider-thickness, 1px) solid var(--md-comp-divider-color);
|
|
73
57
|
}
|
|
@@ -7,7 +7,8 @@ This component implements the [Material Design 3 Expressive Icon button](https:/
|
|
|
7
7
|
To create a basic icon button, use the `<button>` element with a class that specifies its style and size. This example uses a small standard icon button with a Material Symbol:
|
|
8
8
|
|
|
9
9
|
```HTML
|
|
10
|
-
<button type="button" class="micl-iconbutton-standard-s material-symbols-outlined"
|
|
10
|
+
<button type="button" class="micl-iconbutton-standard-s material-symbols-outlined"
|
|
11
|
+
aria-label="Control Panel">settings</button>
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
**Important**: The `aria-label` attribute is crucial for accessibility, as it provides a descriptive text for screen readers.
|
|
@@ -25,7 +26,7 @@ Or import all MICL styles:
|
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
### JavaScript
|
|
28
|
-
This component requires JavaScript for
|
|
29
|
+
This component requires JavaScript for to support the **toggle logic**:
|
|
29
30
|
|
|
30
31
|
```JavaScript
|
|
31
32
|
import micl from "material-inspired-component-library/dist/micl";
|
|
@@ -42,7 +43,8 @@ Icon buttons come in **five sizes**: extra small (`xs`), small (`s`), medium (`m
|
|
|
42
43
|
**Example: An extra-large icon button**
|
|
43
44
|
|
|
44
45
|
```HTML
|
|
45
|
-
<button type="button" class="micl-iconbutton-standard-xl material-symbols-outlined"
|
|
46
|
+
<button type="button" class="micl-iconbutton-standard-xl material-symbols-outlined"
|
|
47
|
+
aria-label="Control Panel">settings</button>
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
Material Design provides **four distinct styles**: `standard`, `filled`, `tonal` and `outlined`. To use a style other than the `standard` style used above, apply the corresponding class to the button:
|
|
@@ -50,7 +52,8 @@ Material Design provides **four distinct styles**: `standard`, `filled`, `tonal`
|
|
|
50
52
|
**Example: A medium-sized filled icon button**
|
|
51
53
|
|
|
52
54
|
```HTML
|
|
53
|
-
<button type="button" class="micl-iconbutton-filled-m material-symbols-outlined"
|
|
55
|
+
<button type="button" class="micl-iconbutton-filled-m material-symbols-outlined"
|
|
56
|
+
aria-label="Control Panel">settings</button>
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
By default, icon buttons have a **rounded shape**. For a more square-like appearance, add the `micl-button--square` class.
|
|
@@ -60,9 +63,9 @@ To reduce the width of an icon button, add the `micl-iconbutton--narrow` class.
|
|
|
60
63
|
Adding the `disabled` boolean attribute to the button causes the button to be displayed in a disabled state.
|
|
61
64
|
|
|
62
65
|
### Toggle Button
|
|
63
|
-
A toggle button has two states: **on** (
|
|
64
|
-
- **Off state**: The button has the `micl-button--toggle` class
|
|
65
|
-
- **On state**: The button has
|
|
66
|
+
A toggle button has two states: **on** (pressed) and **off** (unpressed). To create one, add the `micl-button--toggle` class and an `aria-pressed` attribute.
|
|
67
|
+
- **Off state**: The button has the `micl-button--toggle` class and `aria-pressed="false"`.
|
|
68
|
+
- **On state**: The button has the `micl-button--toggle` class and `aria-pressed="true"`.
|
|
66
69
|
|
|
67
70
|
**Example: A selected toggle button**
|
|
68
71
|
|
|
@@ -70,21 +73,22 @@ A toggle button has two states: **on** (selected) and **off** (unselected). To c
|
|
|
70
73
|
<button
|
|
71
74
|
type="button"
|
|
72
75
|
id="id0"
|
|
73
|
-
class="micl-iconbutton-outlined-l micl-button--toggle
|
|
76
|
+
class="micl-iconbutton-outlined-l micl-button--toggle material-symbols-outlined"
|
|
77
|
+
aria-pressed="true"
|
|
74
78
|
commandfor="id0"
|
|
75
79
|
command="--micl-toggle"
|
|
76
80
|
aria-label="Control Panel"
|
|
77
81
|
>settings</button>
|
|
78
82
|
```
|
|
79
83
|
|
|
80
|
-
The self-targeting `command` property (`--micl-toggle`)
|
|
84
|
+
The self-targeting `command` property (`--micl-toggle`) flips `aria-pressed` whenever the user interacts with the button.
|
|
81
85
|
|
|
82
|
-
To use different icons for the **on** state and the **off** state, remove the icon name from the button and add the `data-miclicon` (the name of the **
|
|
86
|
+
To use different icons for the **on** state and the **off** state, remove the icon name from the button and add the `data-miclicon` (the name of the **off** icon) and `data-micliconselected` (the name of the **on** icon) attributes:
|
|
83
87
|
|
|
84
88
|
```HTML
|
|
85
89
|
...
|
|
86
|
-
data-miclicon="
|
|
87
|
-
data-micliconselected="
|
|
90
|
+
data-miclicon="icon_for_off"
|
|
91
|
+
data-micliconselected="icon_for_on"
|
|
88
92
|
></button>
|
|
89
93
|
```
|
|
90
94
|
|
|
@@ -105,5 +109,52 @@ You can also use other icon libraries. For example, with the [Bootstrap Icons li
|
|
|
105
109
|
</button>
|
|
106
110
|
```
|
|
107
111
|
|
|
112
|
+
## Theming
|
|
113
|
+
Each icon button style can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. Note that the `selected-*` and `unselected-*` properties only apply to [toggle buttons](#toggle-button).
|
|
114
|
+
|
|
115
|
+
### Standard
|
|
116
|
+
| Custom property | Meaning | Default |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| `--md-comp-icon-button-icon-color` | Icon colour | `--md-sys-color-on-surface-variant` |
|
|
119
|
+
| `--md-comp-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-primary` |
|
|
120
|
+
| `--md-comp-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
121
|
+
| `--md-comp-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
122
|
+
|
|
123
|
+
### Filled
|
|
124
|
+
| Custom property | Meaning | Default |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| `--md-comp-filled-icon-button-container-color` | Container background (also the selected state) | `--md-sys-color-primary` |
|
|
127
|
+
| `--md-comp-filled-icon-button-icon-color` | Icon colour (also the selected state) | `--md-sys-color-on-primary` |
|
|
128
|
+
| `--md-comp-filled-icon-button-unselected-container-color` | Container background when an unselected toggle | `--md-sys-color-surface-container` |
|
|
129
|
+
| `--md-comp-filled-icon-button-unselected-icon-color` | Icon colour when an unselected toggle | `--md-sys-color-on-surface-variant` |
|
|
130
|
+
| `--md-comp-filled-icon-button-disabled-container-color` | Container background when disabled | `--md-sys-color-on-surface` |
|
|
131
|
+
| `--md-comp-filled-icon-button-disabled-container-opacity` | Container opacity when disabled | `10%` |
|
|
132
|
+
| `--md-comp-filled-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
133
|
+
| `--md-comp-filled-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
134
|
+
|
|
135
|
+
### Tonal
|
|
136
|
+
| Custom property | Meaning | Default |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| `--md-comp-filled-tonal-icon-button-container-color` | Container background | `--md-sys-color-secondary-container` |
|
|
139
|
+
| `--md-comp-filled-tonal-icon-button-icon-color` | Icon colour | `--md-sys-color-on-secondary-container` |
|
|
140
|
+
| `--md-comp-filled-tonal-icon-button-selected-container-color` | Container background when selected | `--md-sys-color-secondary` |
|
|
141
|
+
| `--md-comp-filled-tonal-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-on-secondary` |
|
|
142
|
+
| `--md-comp-filled-tonal-icon-button-disabled-container-color` | Container background when disabled | `--md-sys-color-on-surface` |
|
|
143
|
+
| `--md-comp-filled-tonal-icon-button-disabled-container-opacity` | Container opacity when disabled | `10%` |
|
|
144
|
+
| `--md-comp-filled-tonal-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
145
|
+
| `--md-comp-filled-tonal-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
146
|
+
|
|
147
|
+
### Outlined
|
|
148
|
+
| Custom property | Meaning | Default |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `--md-comp-outlined-icon-button-icon-color` | Icon colour | `--md-sys-color-on-surface-variant` |
|
|
151
|
+
| `--md-comp-outlined-icon-button-outline-color` | Outline (border) colour | `--md-sys-color-outline-variant` |
|
|
152
|
+
| `--md-comp-outlined-icon-button-selected-container-color` | Container background when selected | `--md-sys-color-inverse-surface` |
|
|
153
|
+
| `--md-comp-outlined-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-inverse-on-surface` |
|
|
154
|
+
| `--md-comp-outlined-icon-button-selected-disabled-container-color` | Container background when selected and disabled | `--md-sys-color-on-surface` |
|
|
155
|
+
| `--md-comp-outlined-icon-button-selected-disabled-container-opacity` | Container opacity when selected and disabled | `10%` |
|
|
156
|
+
| `--md-comp-outlined-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
157
|
+
| `--md-comp-outlined-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
158
|
+
|
|
108
159
|
## Compatibility
|
|
109
160
|
This component utilizes relative RGB color values, which may not be fully supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
|