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.
Files changed (284) hide show
  1. package/README.md +106 -18
  2. package/components/README.md +1 -1
  3. package/components/accordion/README.md +6 -6
  4. package/components/alert/README.md +10 -10
  5. package/components/alert/index.scss +27 -52
  6. package/components/appbar/README.md +19 -6
  7. package/components/appbar/index.scss +40 -44
  8. package/components/badge/README.md +12 -10
  9. package/components/badge/index.scss +21 -25
  10. package/components/bottomsheet/README.md +26 -1
  11. package/components/bottomsheet/index.scss +58 -44
  12. package/components/button/README.md +70 -10
  13. package/components/button/_shared.scss +210 -0
  14. package/components/button/index.scss +75 -389
  15. package/components/card/README.md +97 -85
  16. package/components/card/index.scss +46 -65
  17. package/components/checkbox/README.md +25 -14
  18. package/{tools/shapes/check.mjs → components/checkbox/_label.scss} +37 -42
  19. package/components/checkbox/index.scss +66 -66
  20. package/components/chip/README.md +186 -0
  21. package/components/chip/index.scss +285 -0
  22. package/components/datepicker/README.md +79 -0
  23. package/components/datepicker/index.scss +346 -315
  24. package/components/dialog/README.md +20 -10
  25. package/components/dialog/index.scss +55 -66
  26. package/components/divider/README.md +16 -15
  27. package/components/divider/index.scss +9 -25
  28. package/components/iconbutton/README.md +63 -12
  29. package/components/iconbutton/index.scss +142 -303
  30. package/components/list/README.md +89 -156
  31. package/components/list/index.scss +34 -36
  32. package/components/menu/README.md +81 -155
  33. package/components/menu/index.scss +52 -58
  34. package/components/navigationbar/README.md +108 -0
  35. package/components/navigationbar/index.scss +185 -0
  36. package/components/navigationrail/README.md +62 -37
  37. package/components/navigationrail/_navitem.scss +96 -0
  38. package/components/navigationrail/index.scss +78 -132
  39. package/components/progressindicator/README.md +83 -47
  40. package/components/progressindicator/index.scss +622 -172
  41. package/components/radio/README.md +11 -9
  42. package/components/radio/index.scss +36 -33
  43. package/components/select/README.md +12 -7
  44. package/components/select/index.scss +26 -34
  45. package/components/shapes/README.md +3 -3
  46. package/components/shapes/index.scss +0 -1
  47. package/components/sidesheet/README.md +21 -9
  48. package/components/sidesheet/index.scss +38 -46
  49. package/components/slider/README.md +21 -0
  50. package/components/slider/index.scss +108 -139
  51. package/components/snackbar/README.md +32 -35
  52. package/components/snackbar/index.scss +10 -22
  53. package/components/stepper/README.md +14 -7
  54. package/components/stepper/index.scss +58 -39
  55. package/components/switch/README.md +22 -15
  56. package/components/switch/index.scss +68 -60
  57. package/components/textfield/README.md +48 -5
  58. package/components/textfield/index.scss +192 -248
  59. package/components/timepicker/README.md +53 -23
  60. package/components/timepicker/index.scss +110 -128
  61. package/dist/alert.css +1 -1
  62. package/dist/alert.js +1 -1
  63. package/dist/appbar.css +1 -1
  64. package/dist/appbar.js +1 -1
  65. package/dist/badge.css +1 -1
  66. package/dist/badge.js +1 -1
  67. package/dist/base.css +1 -0
  68. package/dist/base.js +1 -0
  69. package/dist/bottomsheet.css +1 -1
  70. package/dist/bottomsheet.js +1 -1
  71. package/dist/button.css +1 -1
  72. package/dist/button.js +1 -1
  73. package/dist/card.css +1 -1
  74. package/dist/card.js +1 -1
  75. package/dist/checkbox.css +1 -1
  76. package/dist/checkbox.js +1 -1
  77. package/dist/chip.css +1 -0
  78. package/dist/chip.js +1 -0
  79. package/dist/components/button/index.d.ts +1 -1
  80. package/dist/components/iconbutton/index.d.ts +2 -7
  81. package/dist/components/slider/index.d.ts +1 -1
  82. package/dist/components/textfield/index.d.ts +2 -2
  83. package/dist/datepicker.css +1 -1
  84. package/dist/datepicker.js +1 -1
  85. package/dist/dialog.css +1 -1
  86. package/dist/dialog.js +1 -1
  87. package/dist/divider.css +1 -1
  88. package/dist/divider.js +1 -1
  89. package/dist/field.css +1 -0
  90. package/dist/field.js +1 -0
  91. package/dist/foundations/form/index.js +1 -1
  92. package/dist/foundations/runtime.d.ts +15 -0
  93. package/dist/foundations/runtime.js +1 -0
  94. package/dist/iconbutton.css +1 -1
  95. package/dist/iconbutton.js +1 -1
  96. package/dist/layout.css +1 -1
  97. package/dist/layout.js +1 -1
  98. package/dist/list.css +1 -1
  99. package/dist/list.js +1 -1
  100. package/dist/menu.css +1 -1
  101. package/dist/menu.js +1 -1
  102. package/dist/micl.css +1 -1
  103. package/dist/micl.d.ts +14 -5
  104. package/dist/micl.js +1 -1
  105. package/dist/navigationbar.css +1 -0
  106. package/dist/navigationbar.js +1 -0
  107. package/dist/navigationrail.css +1 -1
  108. package/dist/navigationrail.js +1 -1
  109. package/dist/progressindicator.css +1 -1
  110. package/dist/progressindicator.js +1 -1
  111. package/dist/radio.css +1 -1
  112. package/dist/radio.js +1 -1
  113. package/dist/scrollbar.js +1 -1
  114. package/dist/select.css +1 -1
  115. package/dist/select.js +1 -1
  116. package/dist/shapes.css +1 -1
  117. package/dist/shapes.js +1 -1
  118. package/dist/sidesheet.css +1 -1
  119. package/dist/sidesheet.js +1 -1
  120. package/dist/slider.css +1 -1
  121. package/dist/slider.js +1 -1
  122. package/dist/snackbar.css +1 -1
  123. package/dist/snackbar.js +1 -1
  124. package/dist/stepper.css +1 -1
  125. package/dist/stepper.js +1 -1
  126. package/dist/switch.css +1 -1
  127. package/dist/switch.js +1 -1
  128. package/dist/textfield.css +1 -1
  129. package/dist/textfield.js +1 -1
  130. package/dist/timepicker.css +1 -1
  131. package/dist/timepicker.js +1 -1
  132. package/foundations/_index.scss +35 -0
  133. package/foundations/{index.scss → base/index.scss} +21 -56
  134. package/foundations/field/index.scss +37 -0
  135. package/foundations/layout/index.scss +64 -65
  136. package/package.json +23 -9
  137. package/styles/statelayer.scss +20 -5
  138. package/styles.scss +5 -2
  139. package/.claude/settings.local.json +0 -14
  140. package/.editorconfig +0 -12
  141. package/.gitattributes +0 -9
  142. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  143. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  144. package/CLAUDE.md +0 -53
  145. package/CODE_OF_CONDUCT.md +0 -128
  146. package/components/bottomsheet/index.ts +0 -153
  147. package/components/button/index.ts +0 -79
  148. package/components/checkbox/index.ts +0 -148
  149. package/components/datepicker/index.ts +0 -693
  150. package/components/iconbutton/index.ts +0 -77
  151. package/components/list/index.ts +0 -138
  152. package/components/menu/index.ts +0 -145
  153. package/components/navigationrail/index.ts +0 -87
  154. package/components/progressindicator/index.ts +0 -77
  155. package/components/slider/index.ts +0 -149
  156. package/components/snackbar/index.ts +0 -118
  157. package/components/stepper/index.ts +0 -248
  158. package/components/textfield/index.ts +0 -188
  159. package/components/timepicker/index.ts +0 -413
  160. package/dist/components/progressindicator/index.d.ts +0 -6
  161. package/dist/foundations.css +0 -1
  162. package/dist/foundations.js +0 -1
  163. package/docs/accordion.html +0 -344
  164. package/docs/alert.html +0 -177
  165. package/docs/bottomsheet.html +0 -240
  166. package/docs/button.html +0 -290
  167. package/docs/card-awards.webp +0 -0
  168. package/docs/card-cabinet.webp +0 -0
  169. package/docs/card-city.webp +0 -0
  170. package/docs/card-fingerprint.webp +0 -0
  171. package/docs/card-holiday.webp +0 -0
  172. package/docs/card-names.webp +0 -0
  173. package/docs/card.html +0 -159
  174. package/docs/checkbox.html +0 -147
  175. package/docs/datepicker.html +0 -274
  176. package/docs/dialog.html +0 -195
  177. package/docs/divider.html +0 -139
  178. package/docs/docs.css +0 -26
  179. package/docs/docs.js +0 -139
  180. package/docs/iconbutton.html +0 -329
  181. package/docs/index.html +0 -431
  182. package/docs/list.html +0 -310
  183. package/docs/menu.html +0 -574
  184. package/docs/micl.css +0 -1
  185. package/docs/micl.js +0 -1
  186. package/docs/navigationrail.html +0 -138
  187. package/docs/progressindicator.html +0 -288
  188. package/docs/radio.html +0 -123
  189. package/docs/select.html +0 -337
  190. package/docs/shapes.css +0 -1
  191. package/docs/shapes.html +0 -159
  192. package/docs/shapes.js +0 -1
  193. package/docs/sidesheet.html +0 -149
  194. package/docs/slider.html +0 -141
  195. package/docs/snackbar.html +0 -102
  196. package/docs/stepper.html +0 -319
  197. package/docs/switch.html +0 -196
  198. package/docs/textfield.html +0 -208
  199. package/docs/themes/airblue/dark-hc.css +0 -51
  200. package/docs/themes/airblue/dark-mc.css +0 -51
  201. package/docs/themes/airblue/dark.css +0 -51
  202. package/docs/themes/airblue/light-hc.css +0 -51
  203. package/docs/themes/airblue/light-mc.css +0 -51
  204. package/docs/themes/airblue/light.css +0 -51
  205. package/docs/themes/airblue/theme.css +0 -306
  206. package/docs/themes/barnred/dark-hc.css +0 -51
  207. package/docs/themes/barnred/dark-mc.css +0 -51
  208. package/docs/themes/barnred/dark.css +0 -51
  209. package/docs/themes/barnred/light-hc.css +0 -51
  210. package/docs/themes/barnred/light-mc.css +0 -51
  211. package/docs/themes/barnred/light.css +0 -51
  212. package/docs/themes/barnred/theme.css +0 -306
  213. package/docs/themes/citrine/dark-hc.css +0 -51
  214. package/docs/themes/citrine/dark-mc.css +0 -51
  215. package/docs/themes/citrine/dark.css +0 -51
  216. package/docs/themes/citrine/light-hc.css +0 -51
  217. package/docs/themes/citrine/light-mc.css +0 -51
  218. package/docs/themes/citrine/light.css +0 -51
  219. package/docs/themes/citrine/theme.css +0 -306
  220. package/docs/themes/gray/dark-hc.css +0 -51
  221. package/docs/themes/gray/dark-mc.css +0 -51
  222. package/docs/themes/gray/dark.css +0 -51
  223. package/docs/themes/gray/light-hc.css +0 -51
  224. package/docs/themes/gray/light-mc.css +0 -51
  225. package/docs/themes/gray/light.css +0 -51
  226. package/docs/themes/gray/theme.css +0 -306
  227. package/docs/themes/greenery/dark-hc.css +0 -51
  228. package/docs/themes/greenery/dark-mc.css +0 -51
  229. package/docs/themes/greenery/dark.css +0 -51
  230. package/docs/themes/greenery/light-hc.css +0 -51
  231. package/docs/themes/greenery/light-mc.css +0 -51
  232. package/docs/themes/greenery/light.css +0 -51
  233. package/docs/themes/greenery/theme.css +0 -306
  234. package/docs/themes/hermana/dark-hc.css +0 -51
  235. package/docs/themes/hermana/dark-mc.css +0 -51
  236. package/docs/themes/hermana/dark.css +0 -51
  237. package/docs/themes/hermana/light-hc.css +0 -51
  238. package/docs/themes/hermana/light-mc.css +0 -51
  239. package/docs/themes/hermana/light.css +0 -51
  240. package/docs/themes/hermana/theme.css +0 -306
  241. package/docs/themes/illuminating/dark-hc.css +0 -51
  242. package/docs/themes/illuminating/dark-mc.css +0 -51
  243. package/docs/themes/illuminating/dark.css +0 -51
  244. package/docs/themes/illuminating/light-hc.css +0 -51
  245. package/docs/themes/illuminating/light-mc.css +0 -51
  246. package/docs/themes/illuminating/light.css +0 -51
  247. package/docs/themes/illuminating/theme.css +0 -306
  248. package/docs/themes/magenta/dark-hc.css +0 -51
  249. package/docs/themes/magenta/dark-mc.css +0 -51
  250. package/docs/themes/magenta/dark.css +0 -51
  251. package/docs/themes/magenta/light-hc.css +0 -51
  252. package/docs/themes/magenta/light-mc.css +0 -51
  253. package/docs/themes/magenta/light.css +0 -51
  254. package/docs/themes/magenta/theme.css +0 -306
  255. package/docs/themes/mocha/dark-hc.css +0 -51
  256. package/docs/themes/mocha/dark-mc.css +0 -51
  257. package/docs/themes/mocha/dark.css +0 -51
  258. package/docs/themes/mocha/light-hc.css +0 -51
  259. package/docs/themes/mocha/light-mc.css +0 -51
  260. package/docs/themes/mocha/light.css +0 -51
  261. package/docs/themes/mocha/theme.css +0 -306
  262. package/docs/themes/olivegreen/dark-hc.css +0 -51
  263. package/docs/themes/olivegreen/dark-mc.css +0 -51
  264. package/docs/themes/olivegreen/dark.css +0 -51
  265. package/docs/themes/olivegreen/light-hc.css +0 -51
  266. package/docs/themes/olivegreen/light-mc.css +0 -51
  267. package/docs/themes/olivegreen/light.css +0 -51
  268. package/docs/themes/olivegreen/theme.css +0 -306
  269. package/docs/themes/peri/dark-hc.css +0 -51
  270. package/docs/themes/peri/dark-mc.css +0 -51
  271. package/docs/themes/peri/dark.css +0 -51
  272. package/docs/themes/peri/light-hc.css +0 -51
  273. package/docs/themes/peri/light-mc.css +0 -51
  274. package/docs/themes/peri/light.css +0 -51
  275. package/docs/themes/peri/theme.css +0 -306
  276. package/docs/timepicker.html +0 -160
  277. package/foundations/form/index.ts +0 -174
  278. package/foundations/layout/README.md +0 -127
  279. package/intl.d.ts +0 -9
  280. package/micl.ts +0 -221
  281. package/styles/README.md +0 -196
  282. package/tools/shapes/generate.mjs +0 -828
  283. package/tsconfig.json +0 -116
  284. 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
- ## Customizations
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.
122
-
123
- | Variable name | Default Value | Description |
124
- | ------------- | ----- | ----------- |
125
- | --md-sys-dialog-min-width | 280px | The minimum width of a dialog |
126
- | --md-sys-dialog-max-width | 560px | The maximum width of a dialog |
127
- | --md-sys-dialog-padding | 24px | The inner padding between the dialog's edge and its content |
128
- | --md-sys-dialog-headline-space | 16px | The vertical spacing between the elements in the header |
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-sys-dialog-padding:16px">
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
- --md-sys-dialog-min-width: 280px;
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
- [dir=rtl] {
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-sys-dialog-motion-spatial: #{motion.$md-sys-motion-expressive-fast-spatial};
60
- --md-sys-dialog-motion-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
61
- --md-sys-dialog-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
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-sys-dialog-min-width, 280px);
69
- max-inline-size: var(--md-sys-dialog-max-width, 560px);
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: translate(calc(var(--md-sys-dialog-dir-factor, 1) * -50%), -50%) scale(50%);
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(--md-sys-dialog-motion-duration-reverse) linear,
88
- inset-inline-start var(--md-sys-dialog-motion-duration-reverse) linear,
89
- inline-size var(--md-sys-dialog-motion-duration-reverse) linear,
90
- block-size var(--md-sys-dialog-motion-duration-reverse) linear,
91
- transform var(--md-sys-dialog-motion-duration-reverse) linear,
92
- opacity var(--md-sys-dialog-motion-duration-reverse) motion.$md-sys-motion-easing-emphasized-decelerate,
93
- overlay var(--md-sys-dialog-motion-duration-reverse) linear allow-discrete,
94
- display var(--md-sys-dialog-motion-duration-reverse) linear allow-discrete,
95
- --statelayer-opacity var(--md-sys-dialog-motion-duration) linear;
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: translate(calc(var(--md-sys-dialog-dir-factor, 1) * -50%), -50%) scale(50%);
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: translate(calc(var(--md-sys-dialog-dir-factor, 1) * -50%), -50%) scale(100%);
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: translate(calc(var(--md-sys-dialog-dir-factor, 1) * -50%), -50%) scale(50%);
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-sys-dialog-motion-duration) linear,
152
- overlay var(--md-sys-dialog-motion-duration) linear allow-discrete,
153
- display var(--md-sys-dialog-motion-duration) linear allow-discrete;
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(--md-sys-dialog-padding, 24px) var(--md-sys-dialog-headline-space, 16px);
183
- padding-inline: var(--md-sys-dialog-padding, 24px);
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
- inline-size: var(--md-sys-icon-size, 24px);
191
- block-size: var(--md-sys-icon-size, 24px);
192
- font-size: var(--md-sys-icon-size, 24px);
193
- color: var(--md-sys-color-secondary);
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(--md-sys-dialog-padding, 24px);
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(--md-sys-dialog-padding, 24px);
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(--md-sys-dialog-padding, 24px);
220
+ padding: var(--_padding);
231
221
  opacity: 1;
232
222
  transition:
233
- opacity var(--md-sys-dialog-motion-duration) linear allow-discrete,
234
- overlay var(--md-sys-dialog-motion-duration) linear allow-discrete,
235
- display var(--md-sys-dialog-motion-duration) linear allow-discrete;
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
- ## Customizations
43
- You can customize the appearance of the Divider 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 dividers.
44
-
45
- | Variable name | Default Value | Description |
46
- | ------------- | ----- | ----------- |
47
- | --md-sys-divider-thickness | 1px | Controls the thickness (height for horizontal, width for vertical) of the divider |
48
- | --md-sys-divider-inset-margin | 16px | Defines the indentation distance for inset dividers |
49
- | --md-sys-divider-space | 4px | Sets the spacing between the divider and adjacent text or elements |
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-sys-divider-inset-margin:32px">
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-sys-divider-color: var(--md-sys-color-outline-variant, gray);
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
- inline-size: 100%;
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-sys-divider-thickness, 1px) solid var(--md-sys-divider-color, gray);
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-size: calc(100% - 2 * var(--md-sys-divider-inset-margin, 16px));
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-size: calc(100% - var(--md-sys-divider-inset-margin, 16px));
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-size: calc(100% - var(--md-sys-divider-inset-margin, 16px));
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-sys-divider-space, 4px));
54
+ margin-inline: calc(2 * var(--md-comp-divider-space, 4px));
65
55
  border: none;
66
- border-inline-start: var(--md-sys-divider-thickness, 1px) solid var(--md-sys-divider-color, gray);
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" aria-label="Control Panel">settings</button>
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 interactive features like the **toggle logic**:
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" aria-label="Control Panel">settings</button>
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" aria-label="Control Panel">settings</button>
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** (selected) and **off** (unselected). To create one, add the `micl-button--toggle` class.
64
- - **Off state**: The button has the `micl-button--toggle` class.
65
- - **On state**: The button has both the `micl-button--toggle` and `micl-button--selected` classes.
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 micl-button--selected material-symbols-outlined"
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`) toggles the button state whenever the user interacts with the button.
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 **on** icon) and `data-micliconselected` (the name of the **off** icon) attributes:
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="icon_for_on"
87
- data-micliconselected="icon_for_off"
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.