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
package/README.md CHANGED
@@ -78,6 +78,15 @@ Copy the main `micl.js` file to your distribution folder and include it in your
78
78
  ```
79
79
  This will initialize all MICL components, including those that will be added to the DOM later on.
80
80
 
81
+ ### 4. Add a font
82
+ MICL uses the [**Google Sans**](https://fonts.google.com/specimen/Google+Sans) as its default font. Include a reference to this font in your application.
83
+
84
+ ```HTML
85
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap">
86
+ ```
87
+
88
+ The [Styles guide](styles/README.md) describes how to change the default font.
89
+
81
90
  ## Foundations 🪟
82
91
  A separate CSS file, based on the [Material Design Layout Foundation](https://m3.material.io/foundations/layout/understanding-layout/overview), provides styles for an adaptive layout. It includes styles for the **window frame**, **body region** and **panes** that adjust to the available screen space, ensuring your layout follows Material Design's responsive guidelines.
83
92
 
@@ -93,6 +102,7 @@ The library currently consists of the following components:
93
102
  - [x] [Button](components/button/README.md)
94
103
  - [x] [Card](components/card/README.md)
95
104
  - [x] [Checkbox](components/checkbox/README.md)
105
+ - [x] [Date picker](components/datepicker/README.md)
96
106
  - [x] [Dialog](components/dialog/README.md)
97
107
  - [x] [Divider](components/divider/README.md)
98
108
  - [x] [Icon button](components/iconbutton/README.md)
@@ -110,11 +120,15 @@ The library currently consists of the following components:
110
120
 
111
121
  ## Change Log ↪️
112
122
 
123
+ ### 6.0.0 (23.12.2025)
124
+ - **BREAKING**: Use command-attribute to control toggle buttons.
125
+ - **Date picker**: New component.
126
+
113
127
  ### 5.0.0 (02.12.2025)
114
128
  - **Time picker**: New component.
115
129
 
116
130
  ### 4.0.0 (27.10.2025)
117
- - **BREAKING**: Moved layout.scss til sub-folder.
131
+ - **BREAKING**: Moved layout.scss to sub-folder.
118
132
  - **Alert**: New component.
119
133
  - **Stepper**: New component.
120
134
 
@@ -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/shapes';
24
24
  @use '../../styles/typography';
25
25
 
@@ -46,9 +46,9 @@
46
46
  color: var(--md-sys-alert-color);
47
47
 
48
48
  .micl-alert__icon {
49
- block-size: var(--md-sys-layout-icon-size, 24px);
50
- inline-size: var(--md-sys-layout-icon-size, 24px);
51
- font-size: var(--md-sys-layout-icon-size, 24px);
49
+ block-size: var(--md-sys-icon-size, 24px);
50
+ inline-size: var(--md-sys-icon-size, 24px);
51
+ font-size: var(--md-sys-icon-size, 24px);
52
52
  }
53
53
  .micl-alert__text {
54
54
  display: flex;
@@ -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/shapes';
@@ -66,7 +67,7 @@
66
67
  }
67
68
  .micl-appbar__leading-icon {
68
69
  grid-area: appbar-leading;
69
- margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-layout-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
70
+ margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
70
71
  color: var(--md-sys-color-on-surface);
71
72
  }
72
73
  .micl-appbar__headline {
@@ -103,7 +104,7 @@
103
104
  }
104
105
  .micl-appbar__trailing-icon {
105
106
  grid-area: appbar-trailing;
106
- margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-layout-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
107
+ margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
107
108
  color: var(--md-sys-color-on-surface-variant);
108
109
  }
109
110
  &.micl-appbar--medium {
@@ -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/typography';
24
24
 
25
25
  :root {
@@ -68,7 +68,7 @@
68
68
  margin-block: calc(12px + var(--md-sys-badge-block-offset)) auto;
69
69
 
70
70
  &.micl-badge--small {
71
- margin-inline-start: calc(var(--md-sys-layout-icon-size) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
71
+ margin-inline-start: calc(var(--md-sys-icon-size) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
72
72
  }
73
73
  &:not(.micl-badge--small) {
74
74
  margin-inline-start: calc(12px - var(--md-sys-badge-inline-offset));
@@ -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';
@@ -64,7 +65,7 @@ dialog.micl-bottomsheet {
64
65
  display: flex;
65
66
  align-items: center;
66
67
  inline-size: 100%;
67
- block-size: var(--md-sys-target-size);
68
+ block-size: var(--md-sys-target-size, 48px);
68
69
  justify-content: center;
69
70
  cursor: grab;
70
71
 
@@ -72,7 +73,7 @@ dialog.micl-bottomsheet {
72
73
  box-sizing: content-box;
73
74
  inline-size: var(--md-sys-bottomsheet-handle-width);
74
75
  block-size: var(--md-sys-bottomsheet-handle-height);
75
- padding: 16px calc((var(--md-sys-target-size) - var(--md-sys-bottomsheet-handle-width)) / 2);
76
+ padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-sys-bottomsheet-handle-width)) / 2);
76
77
  border: none;
77
78
  border-radius: var(--md-sys-shape-corner-small);
78
79
  background-color: var(--md-sys-color-on-surface-variant);
@@ -80,8 +81,8 @@ dialog.micl-bottomsheet {
80
81
  cursor: pointer;
81
82
 
82
83
  &:focus-visible {
83
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
84
- outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
84
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
85
+ outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
85
86
  }
86
87
  }
87
88
  }
@@ -119,7 +120,7 @@ dialog.micl-bottomsheet {
119
120
  }
120
121
  }
121
122
  &[open]::backdrop {
122
- background-color: rgba(0, 0, 0, 0.2);
123
+ background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
123
124
 
124
125
  @starting-style {
125
126
  background-color: rgba(0, 0, 0, 0);
@@ -63,9 +63,17 @@ A toggle button has two states: **on** (selected) and **off** (unselected). To c
63
63
  **Example: A selected toggle button**
64
64
 
65
65
  ```HTML
66
- <button type="button" class="micl-button-tonal-s micl-button--toggle micl-button--selected">Selected</button>
66
+ <button
67
+ type="button"
68
+ id="id0"
69
+ class="micl-button-tonal-s micl-button--toggle micl-button--selected"
70
+ commandfor="id0"
71
+ command="--micl-toggle"
72
+ >Selected</button>
67
73
  ```
68
74
 
75
+ The self-targeting `command` property (`--micl-toggle`) toggles the button state whenever the user interacts with the button.
76
+
69
77
  ## Icons
70
78
  To add a leading icon to a button, include an element with the `micl-button__icon` class inside the `<button>`:
71
79
 
@@ -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';
@@ -82,13 +82,13 @@ button.micl-button-outlined-xl {
82
82
 
83
83
  &:disabled {
84
84
  background-color: rgb(from var(--md-sys-color-on-surface) r g b / 10%);
85
- color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
85
+ color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
86
86
  box-shadow: var(--md-sys-elevation-level0);
87
87
  cursor: default;
88
88
  }
89
89
  &:not(:disabled) {
90
90
  &:focus-visible {
91
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
91
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
92
92
  outline-offset: 3px;
93
93
  }
94
94
  &:active {
@@ -230,8 +230,8 @@ button.micl-button-outlined-m {
230
230
  }
231
231
  }
232
232
  .micl-button__icon {
233
- font-size: var(--md-sys-layout-icon-size, 24px);
234
- inline-size: var(--md-sys-layout-icon-size, 24px);
233
+ font-size: var(--md-sys-icon-size, 24px);
234
+ inline-size: var(--md-sys-icon-size, 24px);
235
235
  }
236
236
  }
237
237
 
@@ -324,17 +324,17 @@ button.micl-button-text-xl {
324
324
 
325
325
  &:not(:disabled) {
326
326
  &:hover {
327
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
327
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
328
328
 
329
329
  .micl-button__icon {
330
330
  font-variation-settings: 'FILL' 1;
331
331
  }
332
332
  }
333
333
  &:focus-visible {
334
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
334
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
335
335
  }
336
336
  &:active {
337
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
337
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
338
338
  }
339
339
  }
340
340
  }
@@ -362,17 +362,17 @@ button.micl-button-elevated-xl {
362
362
  }
363
363
  }
364
364
  &:hover {
365
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
365
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
366
366
 
367
367
  .micl-button__icon {
368
368
  font-variation-settings: 'FILL' 1;
369
369
  }
370
370
  }
371
371
  &:focus-visible {
372
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
372
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
373
373
  }
374
374
  &:active {
375
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
375
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
376
376
  }
377
377
  }
378
378
  }
@@ -408,17 +408,17 @@ button.micl-button-filled-xl {
408
408
  color: var(--md-sys-color-on-surface-variant);
409
409
  }
410
410
  &:hover {
411
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
411
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
412
412
 
413
413
  .micl-button__icon {
414
414
  font-variation-settings: 'FILL' 1;
415
415
  }
416
416
  }
417
417
  &:focus-visible {
418
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
418
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
419
419
  }
420
420
  &:active {
421
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
421
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
422
422
  }
423
423
  }
424
424
  }
@@ -445,17 +445,17 @@ button.micl-button-tonal-xl {
445
445
  }
446
446
  }
447
447
  &:hover {
448
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
448
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
449
449
 
450
450
  .micl-button__icon {
451
451
  font-variation-settings: 'FILL' 1;
452
452
  }
453
453
  }
454
454
  &:focus-visible {
455
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
455
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
456
456
  }
457
457
  &:active {
458
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
458
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
459
459
  }
460
460
  }
461
461
  }
@@ -482,17 +482,17 @@ button.micl-button-outlined-xl {
482
482
  }
483
483
  }
484
484
  &:hover {
485
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
485
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
486
486
 
487
487
  .micl-button__icon {
488
488
  font-variation-settings: 'FILL' 1;
489
489
  }
490
490
  }
491
491
  &:focus-visible {
492
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
492
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
493
493
  }
494
494
  &:active {
495
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
495
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
496
496
  }
497
497
  }
498
498
  }
@@ -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,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';
@@ -61,25 +62,25 @@
61
62
  --statelayer-opacity var(--md-sys-card-motion-duration) linear;
62
63
 
63
64
  &:hover {
64
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
65
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
65
66
 
66
67
  box-shadow: var(--md-sys-elevation-level1);
67
68
  cursor: pointer;
68
69
  }
69
70
  &:focus-visible {
70
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
71
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
71
72
 
72
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
73
- outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
73
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
74
+ outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
74
75
  }
75
76
  &:active {
76
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
77
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
77
78
 
78
79
  background-size: 0%, 100%;
79
80
  transition: background-size 0ms;
80
81
  }
81
82
  &.micl-card--dragging {
82
- --statelayer-opacity: var(--md-sys-state-dragged-state-layer-opacity);
83
+ --statelayer-opacity: var(--md-sys-state-dragged-state-layer-opacity, 16%);
83
84
 
84
85
  box-shadow: var(--md-sys-elevation-level3);
85
86
  cursor: grabbing;
@@ -89,8 +90,8 @@
89
90
  }
90
91
  }
91
92
  &:not([tabindex='0']):not(.micl-card--disabled):has(> summary:focus-visible) {
92
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
93
- outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
93
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
94
+ outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
94
95
  }
95
96
  &::details-content {
96
97
  block-size: 0;
@@ -145,7 +146,7 @@
145
146
  }
146
147
 
147
148
  .micl-card--disabled {
148
- opacity: 38%;
149
+ opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
149
150
  pointer-events: none;
150
151
 
151
152
  &.micl-card-elevated {
@@ -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/statelayer';
24
25
  @use '../../styles/typography';
@@ -27,7 +28,6 @@
27
28
  --md-sys-checkbox-border-width: 2px;
28
29
  --md-sys-checkbox-check-thickness: 2px;
29
30
  --md-sys-checkbox-container-size: 18px;
30
- --md-sys-checkbox-state-layer-size: 40px;
31
31
  }
32
32
 
33
33
  input[type=checkbox].micl-checkbox {
@@ -40,12 +40,12 @@ input[type=checkbox].micl-checkbox {
40
40
  appearance: none;
41
41
  box-sizing: border-box;
42
42
  position: relative;
43
- inline-size: var(--md-sys-target-size);
44
- min-inline-size: var(--md-sys-target-size);
45
- block-size: var(--md-sys-target-size);
46
- min-block-size: var(--md-sys-target-size);
43
+ inline-size: var(--md-sys-target-size, 48px);
44
+ min-inline-size: var(--md-sys-target-size, 48px);
45
+ block-size: var(--md-sys-target-size, 48px);
46
+ min-block-size: var(--md-sys-target-size, 48px);
47
47
  margin: 0;
48
- border: calc((var(--md-sys-target-size) - var(--md-sys-checkbox-state-layer-size)) / 2) solid transparent;
48
+ border: calc((var(--md-sys-target-size, 48px) - var(--md-sys-state-layer-size, 40px)) / 2) solid transparent;
49
49
  background-clip: content-box;
50
50
  background-color: transparent;
51
51
  -webkit-tap-highlight-color: transparent;
@@ -168,16 +168,16 @@ input[type=checkbox].micl-checkbox {
168
168
  --statelayer-opacity var(--md-sys-checkbox-motion-duration) linear;
169
169
 
170
170
  &:hover {
171
- --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
171
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
172
172
 
173
173
  &:not(:checked):not(:indeterminate)::after {
174
174
  --md-sys-checkbox-border-color: var(--md-sys-color-on-surface);
175
175
  }
176
176
  }
177
177
  &:focus-visible {
178
- --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
178
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
179
179
 
180
- outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
180
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
181
181
 
182
182
  &:not(:checked):not(:indeterminate)::after {
183
183
  --md-sys-checkbox-border-color: var(--md-sys-color-on-surface);
@@ -185,7 +185,7 @@ input[type=checkbox].micl-checkbox {
185
185
  }
186
186
  &:active {
187
187
  --statelayer-color: var(--md-sys-color-on-surface);
188
- --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
188
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
189
189
 
190
190
  background-size: 0%, 100%;
191
191
  transition: background-size 0ms;
@@ -200,7 +200,7 @@ input[type=checkbox].micl-checkbox {
200
200
  }
201
201
  }
202
202
  &:disabled {
203
- opacity: 38%;
203
+ opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
204
204
 
205
205
  &:checked,
206
206
  &:indeterminate {