material-inspired-component-library 5.0.0 → 6.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.
Files changed (204) hide show
  1. package/README.md +15 -1
  2. package/components/alert/index.scss +4 -4
  3. package/components/appbar/index.scss +3 -2
  4. package/components/badge/index.scss +2 -2
  5. package/components/bottomsheet/index.scss +6 -5
  6. package/components/button/README.md +9 -1
  7. package/components/button/index.scss +20 -20
  8. package/components/button/index.ts +21 -37
  9. package/components/card/index.scss +10 -9
  10. package/components/checkbox/index.scss +11 -11
  11. package/components/datepicker/README.md +146 -0
  12. package/components/datepicker/index.scss +436 -0
  13. package/components/datepicker/index.ts +701 -0
  14. package/components/dialog/README.md +6 -6
  15. package/components/dialog/index.scss +23 -17
  16. package/components/divider/index.scss +2 -0
  17. package/components/iconbutton/README.md +10 -1
  18. package/components/iconbutton/index.scss +18 -17
  19. package/components/iconbutton/index.ts +21 -37
  20. package/components/list/index.scss +10 -10
  21. package/components/menu/index.scss +2 -1
  22. package/components/navigationrail/index.scss +10 -9
  23. package/components/radio/README.md +0 -1
  24. package/components/radio/index.scss +11 -11
  25. package/components/select/index.scss +2 -1
  26. package/components/sidesheet/index.scss +3 -1
  27. package/components/slider/index.scss +7 -7
  28. package/components/stepper/index.scss +5 -4
  29. package/components/switch/README.md +0 -1
  30. package/components/switch/index.scss +21 -21
  31. package/components/textfield/index.scss +6 -5
  32. package/components/textfield/index.ts +63 -6
  33. package/components/timepicker/README.md +8 -9
  34. package/components/timepicker/index.scss +9 -8
  35. package/components/timepicker/index.ts +17 -17
  36. package/dist/alert.css +1 -1
  37. package/dist/appbar.css +1 -1
  38. package/dist/badge.css +1 -1
  39. package/dist/bottomsheet.css +1 -1
  40. package/dist/button.css +1 -1
  41. package/dist/card.css +1 -1
  42. package/dist/checkbox.css +1 -1
  43. package/dist/components/button/index.d.ts +2 -1
  44. package/dist/components/datepicker/index.d.ts +6 -0
  45. package/dist/components/iconbutton/index.d.ts +2 -1
  46. package/dist/datepicker.css +1 -0
  47. package/dist/datepicker.js +1 -0
  48. package/dist/dialog.css +1 -1
  49. package/dist/divider.css +1 -1
  50. package/dist/foundations.css +1 -0
  51. package/dist/foundations.js +1 -0
  52. package/dist/iconbutton.css +1 -1
  53. package/dist/layout.css +1 -1
  54. package/dist/list.css +1 -1
  55. package/dist/menu.css +1 -1
  56. package/dist/micl.css +1 -1
  57. package/dist/micl.js +1 -1
  58. package/dist/navigationrail.css +1 -1
  59. package/dist/radio.css +1 -1
  60. package/dist/scrollbar.css +1 -0
  61. package/dist/scrollbar.js +1 -0
  62. package/dist/select.css +1 -1
  63. package/dist/sidesheet.css +1 -1
  64. package/dist/slider.css +1 -1
  65. package/dist/stepper.css +1 -1
  66. package/dist/switch.css +1 -1
  67. package/dist/textfield.css +1 -1
  68. package/dist/timepicker.css +1 -1
  69. package/docs/accordion.html +3 -1
  70. package/docs/alert.html +3 -1
  71. package/docs/bottomsheet.html +6 -4
  72. package/docs/button.html +19 -17
  73. package/docs/card.html +3 -1
  74. package/docs/checkbox.html +3 -1
  75. package/docs/datepicker.html +275 -0
  76. package/docs/dialog.html +24 -10
  77. package/docs/divider.html +3 -1
  78. package/docs/docs.js +65 -1
  79. package/docs/iconbutton.html +9 -9
  80. package/docs/index.html +6 -3
  81. package/docs/list.html +3 -1
  82. package/docs/menu.html +3 -1
  83. package/docs/micl.css +1 -1
  84. package/docs/micl.js +1 -1
  85. package/docs/navigationrail.html +5 -3
  86. package/docs/radio.html +3 -1
  87. package/docs/select.html +3 -1
  88. package/docs/sidesheet.html +6 -4
  89. package/docs/slider.html +1 -1
  90. package/docs/stepper.html +3 -1
  91. package/docs/switch.html +3 -1
  92. package/docs/textfield.html +3 -1
  93. package/docs/themes/gray/dark-hc.css +51 -0
  94. package/docs/themes/gray/dark-mc.css +51 -0
  95. package/docs/themes/gray/dark.css +51 -0
  96. package/docs/themes/gray/light-hc.css +51 -0
  97. package/docs/themes/gray/light-mc.css +51 -0
  98. package/docs/themes/gray/light.css +51 -0
  99. package/docs/themes/gray/theme.css +306 -0
  100. package/docs/themes/greenery/dark-hc.css +51 -0
  101. package/docs/themes/greenery/dark-mc.css +51 -0
  102. package/docs/themes/greenery/dark.css +51 -0
  103. package/docs/themes/greenery/light-hc.css +51 -0
  104. package/docs/themes/greenery/light-mc.css +51 -0
  105. package/docs/themes/greenery/light.css +51 -0
  106. package/docs/themes/greenery/theme.css +306 -0
  107. package/docs/themes/hermana/dark-hc.css +51 -0
  108. package/docs/themes/hermana/dark-mc.css +51 -0
  109. package/docs/themes/hermana/dark.css +51 -0
  110. package/docs/themes/hermana/light-hc.css +51 -0
  111. package/docs/themes/hermana/light-mc.css +51 -0
  112. package/docs/themes/hermana/light.css +51 -0
  113. package/docs/themes/hermana/theme.css +306 -0
  114. package/docs/themes/illuminating/dark-hc.css +51 -0
  115. package/docs/themes/illuminating/dark-mc.css +51 -0
  116. package/docs/themes/illuminating/dark.css +51 -0
  117. package/docs/themes/illuminating/light-hc.css +51 -0
  118. package/docs/themes/illuminating/light-mc.css +51 -0
  119. package/docs/themes/illuminating/light.css +51 -0
  120. package/docs/themes/illuminating/theme.css +306 -0
  121. package/docs/themes/magenta/dark-hc.css +51 -0
  122. package/docs/themes/magenta/dark-mc.css +51 -0
  123. package/docs/themes/magenta/dark.css +51 -0
  124. package/docs/themes/magenta/light-hc.css +51 -0
  125. package/docs/themes/magenta/light-mc.css +51 -0
  126. package/docs/themes/magenta/light.css +51 -0
  127. package/docs/themes/magenta/theme.css +306 -0
  128. package/docs/themes/mocha/dark-hc.css +51 -0
  129. package/docs/themes/mocha/dark-mc.css +51 -0
  130. package/docs/themes/mocha/dark.css +51 -0
  131. package/docs/themes/mocha/light-hc.css +51 -0
  132. package/docs/themes/mocha/light-mc.css +51 -0
  133. package/docs/themes/mocha/light.css +51 -0
  134. package/docs/themes/mocha/theme.css +306 -0
  135. package/docs/themes/peri/dark-hc.css +51 -0
  136. package/docs/themes/peri/dark-mc.css +51 -0
  137. package/docs/themes/peri/dark.css +51 -0
  138. package/docs/themes/peri/light-hc.css +51 -0
  139. package/docs/themes/peri/light-mc.css +51 -0
  140. package/docs/themes/peri/light.css +51 -0
  141. package/docs/themes/peri/theme.css +306 -0
  142. package/docs/timepicker.html +5 -3
  143. package/foundations/index.scss +102 -0
  144. package/foundations/layout/index.scss +0 -52
  145. package/foundations/scrollbar/index.scss +46 -0
  146. package/intl.d.ts +9 -0
  147. package/micl.ts +18 -8
  148. package/package.json +2 -1
  149. package/styles/README.md +17 -8
  150. package/styles/motion.scss +3 -0
  151. package/styles/shapes.scss +23 -18
  152. package/styles/statelayer.scss +4 -0
  153. package/styles/typography.scss +2 -2
  154. package/styles.scss +3 -26
  155. package/themes/gray/dark-hc.css +51 -0
  156. package/themes/gray/dark-mc.css +51 -0
  157. package/themes/gray/dark.css +51 -0
  158. package/themes/gray/light-hc.css +51 -0
  159. package/themes/gray/light-mc.css +51 -0
  160. package/themes/gray/light.css +51 -0
  161. package/themes/gray/theme.css +306 -0
  162. package/themes/greenery/dark-hc.css +51 -0
  163. package/themes/greenery/dark-mc.css +51 -0
  164. package/themes/greenery/dark.css +51 -0
  165. package/themes/greenery/light-hc.css +51 -0
  166. package/themes/greenery/light-mc.css +51 -0
  167. package/themes/greenery/light.css +51 -0
  168. package/themes/greenery/theme.css +306 -0
  169. package/themes/hermana/dark-hc.css +51 -0
  170. package/themes/hermana/dark-mc.css +51 -0
  171. package/themes/hermana/dark.css +51 -0
  172. package/themes/hermana/light-hc.css +51 -0
  173. package/themes/hermana/light-mc.css +51 -0
  174. package/themes/hermana/light.css +51 -0
  175. package/themes/hermana/theme.css +306 -0
  176. package/themes/illuminating/dark-hc.css +51 -0
  177. package/themes/illuminating/dark-mc.css +51 -0
  178. package/themes/illuminating/dark.css +51 -0
  179. package/themes/illuminating/light-hc.css +51 -0
  180. package/themes/illuminating/light-mc.css +51 -0
  181. package/themes/illuminating/light.css +51 -0
  182. package/themes/illuminating/theme.css +306 -0
  183. package/themes/magenta/dark-hc.css +51 -0
  184. package/themes/magenta/dark-mc.css +51 -0
  185. package/themes/magenta/dark.css +51 -0
  186. package/themes/magenta/light-hc.css +51 -0
  187. package/themes/magenta/light-mc.css +51 -0
  188. package/themes/magenta/light.css +51 -0
  189. package/themes/magenta/theme.css +306 -0
  190. package/themes/mocha/dark-hc.css +51 -0
  191. package/themes/mocha/dark-mc.css +51 -0
  192. package/themes/mocha/dark.css +51 -0
  193. package/themes/mocha/light-hc.css +51 -0
  194. package/themes/mocha/light-mc.css +51 -0
  195. package/themes/mocha/light.css +51 -0
  196. package/themes/mocha/theme.css +306 -0
  197. package/themes/peri/dark-hc.css +51 -0
  198. package/themes/peri/dark-mc.css +51 -0
  199. package/themes/peri/dark.css +51 -0
  200. package/themes/peri/light-hc.css +51 -0
  201. package/themes/peri/light-mc.css +51 -0
  202. package/themes/peri/light.css +51 -0
  203. package/themes/peri/theme.css +306 -0
  204. package/tsconfig.json +2 -2
@@ -64,10 +64,10 @@ Removing the `popover` attribute creates a more intrusive **modal** dialog. This
64
64
 
65
65
  - The `closedby="closerequest"` attribute restricts closing methods, typically requiring an explicit action within the dialog.
66
66
 
67
- By default, modal dialogs open in the center of the screen. You can anchor a modal dialog to a control element, causing it to open relative to that element:
67
+ By default, modal dialogs open in the center of the screen. You can anchor a modal dialog to a control element using the `micl-dialog--docked` class and CSS Anchor settings, causing it to open relative to that element:
68
68
 
69
69
  ```HTML
70
- <dialog id="mydialog" class="micl-dialog" style="position-anchor:--myanchor">
70
+ <dialog id="mydialog" class="micl-dialog micl-dialog--docked" style="position-anchor:--myanchor">
71
71
  </dialog>
72
72
 
73
73
  <button type="button" popovertarget="mydialog" style="anchor-name:--myanchor">Open Modal Dialog</button>
@@ -96,10 +96,10 @@ A full-screen dialog covers the entire viewport, primarily on smaller screens. O
96
96
  ```HTML
97
97
  <dialog id="mydialog" class="micl-dialog micl-dialog--fullscreen" closedby="none" popover aria-labelledby="mytitle" aria-describedby="mydesc">
98
98
  <form method="dialog" class="micl-dialog__headline">
99
- <button type="button" class="micl-iconbutton-s material-symbols-outlined" popovertarget="mydialog" aria-label="Close">close</button>
99
+ <button type="button" class="micl-dialog__fullscreen micl-iconbutton-s material-symbols-outlined" popovertarget="mydialog" aria-label="Close">close</button>
100
100
  <span class="micl-dialog__icon material-symbols-outlined" aria-hidden="true">person</span>
101
101
  <h2 id="mytitle">Full-screen dialog</h2>
102
- <button class="micl-button-text-s" value="dosave">Save</button>
102
+ <button class="micl-dialog__fullscreen micl-button-text-s" value="dosave">Save</button>
103
103
  </form>
104
104
  <div class="micl-dialog__content">
105
105
  <span id="mydesc" class="micl-dialog__supporting-text">This dialog covers the whole screen.</span>
@@ -113,9 +113,9 @@ A full-screen dialog covers the entire viewport, primarily on smaller screens. O
113
113
  <button type="button" popovertarget="mydialog">Open Full-Screen Dialog</button>
114
114
  ```
115
115
 
116
- - In full-screen mode, buttons placed directly within the `micl-dialog__headline` become visible, while the `micl-dialog__icon` and `micl-dialog__actions` at the bottom are hidden.
116
+ - In full-screen mode, `micl-dialog__fullscreen` buttons placed directly within the `micl-dialog__headline` become visible, while the `micl-dialog__icon` and `micl-dialog__actions` at the bottom are hidden.
117
117
 
118
- - When not in full-screen mode (e.g., on wider screens), the `micl-dialog__headline` buttons are hidden, and the standard dialog actions (`micl-dialog__actions`) are visible.
118
+ - 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
119
 
120
120
  ## Customizations
121
121
  You can customize the appearance of the Dialog component by overriding its global CSS variables. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child dialogs.
@@ -19,7 +19,7 @@
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/layout';
22
+ @use '../../foundations';
23
23
  @use '../../styles/elevation';
24
24
  @use '../../styles/motion';
25
25
  @use '../../styles/shapes';
@@ -55,6 +55,7 @@ dialog.micl-dialog {
55
55
  transform: translate(calc(var(--md-sys-dialog-dir-factor, 1) * -50%), -50%) scale(50%);
56
56
  padding: 0;
57
57
  margin: 0;
58
+ outline: none;
58
59
  border: none;
59
60
  border-radius: var(--md-sys-shape-corner-extra-large);
60
61
  background-color: var(--md-sys-color-surface-container-high);
@@ -134,14 +135,24 @@ dialog.micl-dialog {
134
135
  display var(--md-sys-dialog-motion-duration) linear allow-discrete;
135
136
  }
136
137
  &[open]::backdrop {
137
- background-color: rgba(0, 0, 0, 0.2);
138
+ background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
138
139
 
139
140
  @starting-style {
140
141
  background-color: rgba(0, 0, 0, 0);
141
142
  }
142
143
  }
144
+
145
+ &.micl-dialog--docked {
146
+ position-anchor: auto;
147
+ inset-block: anchor(end) auto;
148
+ inset-inline: anchor(start) auto;
149
+ transform: none;
150
+ transition: none;
151
+ position-try-fallbacks: flip-block;
152
+ }
153
+
143
154
  // &:hover {
144
- // --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
155
+ // --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
145
156
  // }
146
157
 
147
158
  .micl-dialog__headline {
@@ -158,9 +169,9 @@ dialog.micl-dialog {
158
169
  align-items: center;
159
170
  }
160
171
  .micl-dialog__icon {
161
- inline-size: var(--md-sys-layout-icon-size, 24px);
162
- block-size: var(--md-sys-layout-icon-size, 24px);
163
- font-size: var(--md-sys-layout-icon-size, 24px);
172
+ inline-size: var(--md-sys-icon-size, 24px);
173
+ block-size: var(--md-sys-icon-size, 24px);
174
+ font-size: var(--md-sys-icon-size, 24px);
164
175
  color: var(--md-sys-color-secondary);
165
176
  }
166
177
  h1, h2, h3, h4, h5, h6, .micl-heading {
@@ -170,9 +181,6 @@ dialog.micl-dialog {
170
181
  margin: 0;
171
182
  color: var(--md-sys-color-on-surface);
172
183
  }
173
- button {
174
- display: none;
175
- }
176
184
  .micl-dialog__subhead {
177
185
  @include typography.title-medium;
178
186
 
@@ -222,7 +230,7 @@ dialog.micl-dialog.micl-dialog--fullscreen {
222
230
  timeline-scope: --headlineTimeline;
223
231
 
224
232
  // &:hover {
225
- // --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
233
+ // --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
226
234
  // }
227
235
  .micl-dialog__headline {
228
236
  block-size: 56px;
@@ -249,13 +257,6 @@ dialog.micl-dialog.micl-dialog--fullscreen {
249
257
  .micl-dialog__icon {
250
258
  display:none;
251
259
  }
252
- button {
253
- display: block;
254
-
255
- &.micl-button {
256
- margin-inline-end: 16px;
257
- }
258
- }
259
260
  }
260
261
  .micl-dialog__content {
261
262
  scroll-timeline: --headlineTimeline block;
@@ -266,6 +267,11 @@ dialog.micl-dialog.micl-dialog--fullscreen {
266
267
  opacity: 0;
267
268
  }
268
269
  }
270
+ @media (min-width: 561px) {
271
+ .micl-dialog__fullscreen {
272
+ display: none;
273
+ }
274
+ }
269
275
  }
270
276
 
271
277
  @media (max-width: 560px) {
@@ -19,6 +19,8 @@
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 {
23
25
  --md-sys-divider-thickness: 1px;
24
26
  --md-sys-divider-inset-margin: 16px;
@@ -67,9 +67,18 @@ A toggle button has two states: **on** (selected) and **off** (unselected). To c
67
67
  **Example: A selected toggle button**
68
68
 
69
69
  ```HTML
70
- <button type="button" class="micl-iconbutton-outlined-l micl-button--toggle micl-button--selected material-symbols-outlined" aria-label="Control Panel">settings</button>
70
+ <button
71
+ type="button"
72
+ id="id0"
73
+ class="micl-iconbutton-outlined-l micl-button--toggle micl-button--selected material-symbols-outlined"
74
+ commandfor="id0"
75
+ command="--micl-toggle"
76
+ aria-label="Control Panel"
77
+ >settings</button>
71
78
  ```
72
79
 
80
+ The self-targeting `command` property (`--micl-toggle`) toggles the button state whenever the user interacts with the button.
81
+
73
82
  ## Icons
74
83
  The examples above use [Google Material Symbols](https://fonts.google.com/icons). For buttons using these icons, a fill-style of `1` is applied when the button is active or hovered over. To enable this effect, ensure your `link` tag includes `FILL@0..1`.
75
84
 
@@ -19,7 +19,7 @@
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/layout';
22
+ @use '../../foundations';
23
23
  @use '../../styles/elevation';
24
24
  @use '../../styles/motion';
25
25
  @use '../../styles/shapes';
@@ -53,6 +53,7 @@ button.micl-iconbutton-outlined-xl {
53
53
  --md-sys-iconbutton-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
54
54
  --micl-ripple: 1;
55
55
 
56
+ align-items: center;
56
57
  padding: 0;
57
58
  border: none;
58
59
  border-radius: var(--md-sys-shape-corner-full);
@@ -74,13 +75,13 @@ button.micl-iconbutton-outlined-xl {
74
75
 
75
76
  &:disabled {
76
77
  background-color: rgb(from var(--md-sys-color-on-surface) r g b / 10%);
77
- color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
78
+ color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
78
79
  box-shadow: var(--md-sys-elevation-level0);
79
80
  cursor: default;
80
81
  }
81
82
  &:not(:disabled) {
82
83
  &:focus-visible {
83
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
84
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
84
85
  outline-offset: 3px;
85
86
  }
86
87
  &:active {
@@ -154,7 +155,7 @@ button.micl-iconbutton-outlined-s {
154
155
  inline-size: var(--micl-width);
155
156
  min-inline-size: var(--micl-width);
156
157
  block-size: var(--micl-height);
157
- font-size: var(--md-sys-layout-icon-size, 24px);
158
+ font-size: var(--md-sys-icon-size, 24px);
158
159
 
159
160
  &::before {
160
161
  content: "";
@@ -201,7 +202,7 @@ button.micl-iconbutton-outlined-m {
201
202
  inline-size: var(--micl-width);
202
203
  min-inline-size: var(--micl-width);
203
204
  block-size: var(--micl-height);
204
- font-size: var(--md-sys-layout-icon-size, 24px);
205
+ font-size: var(--md-sys-icon-size, 24px);
205
206
 
206
207
  &.micl-button--toggle.micl-button--selected {
207
208
  border-radius: var(--md-sys-shape-corner-large);
@@ -322,13 +323,13 @@ button.micl-iconbutton-standard-xl {
322
323
  color: var(--md-sys-color-primary);
323
324
  }
324
325
  &:hover {
325
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
326
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
326
327
  }
327
328
  &:focus-visible {
328
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
329
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
329
330
  }
330
331
  &:active {
331
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
332
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
332
333
  }
333
334
  }
334
335
  }
@@ -352,13 +353,13 @@ button.micl-iconbutton-filled-xl {
352
353
  color: var(--md-sys-color-on-surface-variant);
353
354
  }
354
355
  &:hover {
355
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
356
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
356
357
  }
357
358
  &:focus-visible {
358
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
359
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
359
360
  }
360
361
  &:active {
361
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
362
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
362
363
  }
363
364
  }
364
365
  }
@@ -381,13 +382,13 @@ button.micl-iconbutton-tonal-xl {
381
382
  color: var(--md-sys-color-on-secondary);
382
383
  }
383
384
  &:hover {
384
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
385
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
385
386
  }
386
387
  &:focus-visible {
387
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
388
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
388
389
  }
389
390
  &:active {
390
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
391
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
391
392
  }
392
393
  }
393
394
  }
@@ -427,13 +428,13 @@ button.micl-iconbutton-outlined-xl {
427
428
  color: var(--md-sys-color-inverse-on-surface);
428
429
  }
429
430
  &:hover {
430
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
431
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
431
432
  }
432
433
  &:focus-visible {
433
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
434
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
434
435
  }
435
436
  &:active {
436
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
437
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
437
438
  }
438
439
  }
439
440
  }
@@ -19,58 +19,42 @@
19
19
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
  // SOFTWARE.
21
21
 
22
- export const buttonSelector = 'button[popovertarget],button.micl-button--toggle';
22
+ export const buttonSelector = 'button.micl-button--toggle';
23
23
 
24
24
  export default (() =>
25
25
  {
26
- const onClick = (event: Event) =>
27
- {
28
- if (!event.target || !(event.target instanceof HTMLButtonElement)) {
29
- return;
30
- }
31
- if (event.target.popoverTargetElement instanceof HTMLDialogElement) {
32
- if (event.target.popoverTargetElement.open) {
33
- event.target.popoverTargetElement.close();
34
- }
35
- else {
36
- event.target.popoverTargetElement.showModal();
37
- }
38
- }
39
- if (event.target.classList.contains('micl-button--toggle')) {
40
- event.target.classList.add('micl-button--toggled');
41
- event.target.classList.toggle('micl-button--selected');
42
- if (!!event.target.dataset.miclalt) {
43
- [event.target.textContent, event.target.dataset.miclalt] =
44
- [event.target.dataset.miclalt, event.target.textContent];
26
+ return {
27
+ command: (event: Event): void =>
28
+ {
29
+ const target = event.target as HTMLButtonElement;
30
+
31
+ if (
32
+ target.matches(buttonSelector)
33
+ && !target.disabled
34
+ && (event as any).command === '--micl-toggle'
35
+ ) {
36
+ target.classList.add('micl-button--toggled');
37
+ target.classList.toggle('micl-button--selected');
45
38
  }
46
- }
47
- };
39
+ },
48
40
 
49
- return {
50
- initialize: (element: HTMLButtonElement) =>
41
+ initialize: function(element: HTMLButtonElement): void
51
42
  {
52
43
  if (
53
- !element.matches('button[popovertarget],button.micl-button--toggle')
44
+ !element.matches(buttonSelector)
54
45
  || element.dataset.miclinitialized
55
46
  ) {
56
47
  return;
57
48
  }
58
49
  element.dataset.miclinitialized = '1';
59
50
 
60
- if (
61
- (element.popoverTargetElement instanceof HTMLDialogElement)
62
- && !element.popoverTargetElement.hasAttribute('popover')
63
- ) {
64
- element.addEventListener('click', onClick);
65
- }
66
- else if (element.classList.contains('micl-button--toggle')) {
67
- element.addEventListener('click', onClick);
68
- }
51
+ element.addEventListener('command', this.command);
69
52
  },
70
- cleanup: (element: HTMLButtonElement) =>
53
+
54
+ cleanup: function(element: HTMLButtonElement): void
71
55
  {
72
- if (element.matches('button[popovertarget],button.micl-button--toggle')) {
73
- document.removeEventListener('click', onClick);
56
+ if (element.matches(buttonSelector)) {
57
+ document.removeEventListener('command', this.command);
74
58
  delete element.dataset.miclinitialized;
75
59
  }
76
60
  }
@@ -19,7 +19,7 @@
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/layout';
22
+ @use '../../foundations';
23
23
  @use '../../styles/motion';
24
24
  @use '../../styles/shapes';
25
25
  @use '../../styles/statelayer';
@@ -100,24 +100,24 @@ select {
100
100
  cursor: pointer;
101
101
 
102
102
  &:hover {
103
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
103
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
104
104
 
105
105
  .micl-list-item__icon {
106
106
  font-variation-settings: 'FILL' 1;
107
107
  }
108
108
  }
109
109
  &:focus-visible {
110
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
110
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
111
111
 
112
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
113
- outline-offset: var(--md-sys-state-focus-indicator-inner-offset);
112
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
113
+ outline-offset: var(--md-sys-state-focus-indicator-inner-offset, -3px);
114
114
 
115
115
  .micl-list-item__icon {
116
116
  font-variation-settings: 'FILL' 1;
117
117
  }
118
118
  }
119
119
  &:active {
120
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
120
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
121
121
 
122
122
  background-size: 0%, 100%;
123
123
  transition: background-size 0ms;
@@ -184,11 +184,11 @@ select {
184
184
  .micl-list-item__text,
185
185
  .micl-list-item__text::after,
186
186
  .micl-list-item__trailing-text {
187
- color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
187
+ color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
188
188
  }
189
189
  .micl-list-item__image,
190
190
  .micl-list-item__thumbnail {
191
- opacity: 38%;
191
+ opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
192
192
  }
193
193
  a, button, label {
194
194
  pointer-events: none;
@@ -323,8 +323,8 @@ select {
323
323
  }
324
324
 
325
325
  .micl-list-item__icon {
326
- min-inline-size: var(--md-sys-layout-icon-size, 24px);
327
- font-size: var(--md-sys-layout-icon-size, 24px);
326
+ min-inline-size: var(--md-sys-icon-size, 24px);
327
+ font-size: var(--md-sys-icon-size, 24px);
328
328
  font-variation-settings: 'FILL' 0;
329
329
  color: var(--md-sys-color-on-surface-variant);
330
330
  transition: font-variation-settings var(--md-sys-list-motion-duration) linear;
@@ -19,6 +19,7 @@
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';
22
23
  @use '../../styles/elevation';
23
24
  @use '../../styles/motion';
24
25
  @use '../../styles/shapes';
@@ -69,7 +70,7 @@
69
70
  transform: scaleY(0);
70
71
  }
71
72
  &::backdrop {
72
- background-color: rgba(0, 0, 0, 0.2);
73
+ background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
73
74
 
74
75
  @starting-style {
75
76
  background-color: rgba(0, 0, 0, 0);
@@ -19,6 +19,7 @@
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';
22
23
  @use '../../foundations/layout';
23
24
  @use '../../styles/elevation';
24
25
  @use '../../styles/motion';
@@ -119,8 +120,8 @@
119
120
  &> .micl-navigationrail__icon {
120
121
  --micl-ripple: 1;
121
122
 
122
- font-size: var(--md-sys-layout-icon-size, 24px);
123
- inline-size: var(--md-sys-layout-icon-size, 24px);
123
+ font-size: var(--md-sys-icon-size, 24px);
124
+ inline-size: var(--md-sys-icon-size, 24px);
124
125
  margin: 0;
125
126
  padding-block: 4px;
126
127
  padding-inline: 16px;
@@ -188,15 +189,15 @@ nav.micl-navigationrail:has(> .micl-navigationrail__headline .micl-button--toggl
188
189
  background-color: transparent;
189
190
  }
190
191
  &:hover {
191
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
192
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
192
193
  }
193
194
  &:focus-visible {
194
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
195
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
195
196
  }
196
197
  &:active {
197
198
  background-size: 0%, 100%;
198
199
  transition: background-size 0ms;
199
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
200
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
200
201
  }
201
202
  &> .micl-navigationrail__text {
202
203
  @include typography.label-large;
@@ -273,17 +274,17 @@ nav.micl-navigationrail:has(> .micl-navigationrail__headline .micl-button--toggl
273
274
  &> .micl-navigationrail__content > label.micl-navigationrail__item {
274
275
  &:hover {
275
276
  &> .micl-navigationrail__icon {
276
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
277
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
277
278
  }
278
279
  }
279
280
  &:focus-visible {
280
281
  &> .micl-navigationrail__icon {
281
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
282
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
282
283
  }
283
284
  }
284
285
  &:active {
285
286
  &> .micl-navigationrail__icon {
286
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
287
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
287
288
 
288
289
  background-size: 0%, 100%;
289
290
  transition:
@@ -346,7 +347,7 @@ nav.micl-navigationrail[popover] {
346
347
  display var(--md-sys-navigationrail-motion-duration) linear allow-discrete;
347
348
 
348
349
  &::backdrop {
349
- background-color: rgba(0, 0, 0, 0.2);
350
+ background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
350
351
 
351
352
  @starting-style {
352
353
  background-color: rgba(0, 0, 0, 0);
@@ -43,7 +43,6 @@ You can customize the appearance of the Radio Button component by overriding its
43
43
  | ------------- | ------------- | ----------- |
44
44
  | --md-sys-radio-border-width | 2px | Controls the thickness of the radio button's border |
45
45
  | --md-sys-radio-container-size | 20px | Defines the diameter of the radio button itself |
46
- | --md-sys-radio-state-layer-size | 40px | Sets the size of the interactive area that indicates the component's current state (e.g., hover, focus, press) |
47
46
 
48
47
  **Example: Changing the size of the radio button**
49
48
 
@@ -19,6 +19,7 @@
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';
22
23
  @use '../../styles/motion';
23
24
  @use '../../styles/shapes';
24
25
  @use '../../styles/statelayer';
@@ -26,7 +27,6 @@
26
27
  :root {
27
28
  --md-sys-radio-border-width: 2px;
28
29
  --md-sys-radio-container-size: 20px;
29
- --md-sys-radio-state-layer-size: 40px;
30
30
  }
31
31
 
32
32
  input[type=radio].micl-radio {
@@ -37,12 +37,12 @@ input[type=radio].micl-radio {
37
37
  appearance: none;
38
38
  box-sizing: border-box;
39
39
  position: relative;
40
- inline-size: var(--md-sys-target-size);
41
- min-inline-size: var(--md-sys-target-size);
42
- block-size: var(--md-sys-target-size);
43
- min-block-size: var(--md-sys-target-size);
40
+ inline-size: var(--md-sys-target-size, 48px);
41
+ min-inline-size: var(--md-sys-target-size, 48px);
42
+ block-size: var(--md-sys-target-size, 48px);
43
+ min-block-size: var(--md-sys-target-size, 48px);
44
44
  margin: 0;
45
- border: calc((var(--md-sys-target-size) - var(--md-sys-radio-state-layer-size)) / 2) solid transparent;
45
+ border: calc((var(--md-sys-target-size, 48px) - var(--md-sys-state-layer-size, 40px)) / 2) solid transparent;
46
46
  background-clip: content-box;
47
47
  background-color: transparent;
48
48
  -webkit-tap-highlight-color: transparent;
@@ -102,22 +102,22 @@ input[type=radio].micl-radio {
102
102
  }
103
103
  }
104
104
  &:hover {
105
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
105
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
106
106
  }
107
107
  &:focus-visible {
108
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
108
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
109
109
 
110
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
110
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
111
111
  }
112
112
  &:active {
113
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
113
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
114
114
 
115
115
  background-size: 0%, 100%;
116
116
  transition: background-size 0ms;
117
117
  }
118
118
  }
119
119
  &:disabled {
120
- opacity: 38%;
120
+ opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
121
121
 
122
122
  &::after {
123
123
  border-color: var(--md-sys-color-on-surface);
@@ -19,6 +19,7 @@
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';
22
23
  @use '../../styles/elevation';
23
24
  @use '../../styles/motion';
24
25
  @use '../../styles/shapes';
@@ -114,7 +115,7 @@
114
115
  }
115
116
  }
116
117
  &:focus-visible {
117
- outline-offset: calc(-1 * var(--md-sys-state-focus-indicator-thickness));
118
+ outline-offset: calc(-1 * var(--md-sys-state-focus-indicator-thickness, 3px));
118
119
  z-index: 1;
119
120
  }
120
121
 
@@ -19,6 +19,8 @@
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
+ @use '../../foundations/layout';
22
24
  @use '../../styles/elevation';
23
25
  @use '../../styles/motion';
24
26
  @use '../../styles/shapes';
@@ -140,7 +142,7 @@ dialog.micl-sidesheet {
140
142
  transition: background-color var(--md-sys-sidesheet-motion-duration-reverse) linear;
141
143
  }
142
144
  &[open]::backdrop {
143
- background-color: rgba(0, 0, 0, 0.2);
145
+ background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
144
146
  transition: background-color var(--md-sys-sidesheet-motion-duration) linear;
145
147
 
146
148
  @starting-style {