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
@@ -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 '../../foundations/layout';
24
23
  @use '../../styles/elevation';
25
24
  @use '../../styles/shape';
@@ -35,23 +34,23 @@
35
34
  @include typography.scale('headline-medium');
36
35
  @include typography.scale('title-large');
37
36
  @include typography.scale('title-medium');
38
- @include typography.scale('title-small');
37
+ @include typography.scale('label-large');
39
38
  @include typography.scale('label-medium');
40
39
 
41
40
  @mixin appbar-sticky() {
42
41
  position: sticky;
43
42
  inset: unset;
44
- inset-block-start: 0;
43
+ inset-block-start: env(safe-area-inset-top, 0px);
45
44
  inset-inline-start: 0;
46
45
  animation: 1ms linear alternate appbar-background;
47
46
  animation-timeline: scroll(root);
48
47
  }
49
48
 
50
49
  .micl-appbar {
51
- --md-sys-appbar-height: 64px;
52
- --md-sys-appbar-padding-block-start: 0px;
53
- --md-sys-appbar-padding-block-end: 0px;
54
- --md-sys-appbar-padding-inline: 0px;
50
+ --_height: 64px;
51
+ --_padding-block-start: 0px;
52
+ --_padding-block-end: 0px;
53
+ --_padding-inline: 0px;
55
54
 
56
55
  box-sizing: border-box;
57
56
  display: grid;
@@ -62,12 +61,12 @@
62
61
  grid-template-rows: 64px max-content;
63
62
  column-gap: 4px;
64
63
  align-items: center;
65
- min-block-size: var(--md-sys-appbar-height);
66
- padding-block: var(--md-sys-appbar-padding-block-start) var(--md-sys-appbar-padding-block-end);
67
- padding-inline: var(--md-sys-appbar-padding-inline);
64
+ min-block-size: var(--_height);
65
+ padding-block: var(--_padding-block-start) var(--_padding-block-end);
66
+ padding-inline: var(--_padding-inline);
68
67
  border-start-start-radius: inherit;
69
68
  border-start-end-radius: inherit;
70
- background-color: inherit;
69
+ background-color: var(--md-comp-app-bar-container-color, inherit);
71
70
  box-shadow: var(--md-sys-elevation-level0);
72
71
  z-index: 8;
73
72
 
@@ -81,7 +80,7 @@
81
80
  .micl-appbar__leading-icon {
82
81
  grid-area: appbar-leading;
83
82
  margin-inline-start: var(--md-sys-layout-window-margin);
84
- color: var(--md-sys-color-on-surface);
83
+ color: var(--md-comp-app-bar-leading-icon-color, var(--md-sys-color-on-surface));
85
84
  }
86
85
  .micl-appbar__headline {
87
86
  display: flex;
@@ -90,25 +89,22 @@
90
89
  align-items: flex-start;
91
90
  margin: 8px 0;
92
91
  border-radius: var(--md-sys-shape-corner-none);
93
- color: var(--md-sys-color-on-surface);
92
+ color: var(--md-comp-app-bar-title-color, var(--md-sys-color-on-surface));
94
93
 
95
94
  &.micl-appbar__headline--center {
96
95
  align-items: center;
97
96
  text-align: center;
98
97
  }
99
- h1, h2, h3, h4, h5, h6, .micl-heading {
98
+ :is(h1, h2, h3, h4, h5, h6, .micl-heading) {
100
99
  @include typography.title-large;
101
100
 
102
101
  margin: 0;
103
102
  }
104
- .micl-appbar__subtitle {
105
- margin: 0;
106
- color: var(--md-sys-color-on-surface-variant);
107
- }
108
- }
109
- &:has(.micl-appbar__subtitle) {
110
103
  .micl-appbar__subtitle {
111
104
  @include typography.label-medium;
105
+
106
+ margin: 0;
107
+ color: var(--md-comp-app-bar-subtitle-color, var(--md-sys-color-on-surface-variant));
112
108
  }
113
109
  }
114
110
  .micl-appbar__trailing {
@@ -118,11 +114,11 @@
118
114
  .micl-appbar__trailing-icon {
119
115
  grid-area: appbar-trailing;
120
116
  margin-inline-end: var(--md-sys-layout-window-margin);
121
- color: var(--md-sys-color-on-surface-variant);
117
+ color: var(--md-comp-app-bar-trailing-icon-color, var(--md-sys-color-on-surface-variant));
122
118
  }
123
119
  &.micl-appbar--medium {
124
- --md-sys-appbar-height: 112px;
125
- --md-sys-appbar-padding-block-end: 12px;
120
+ --_height: 112px;
121
+ --_padding-block-end: 12px;
126
122
 
127
123
  padding-inline-start: 0;
128
124
 
@@ -131,21 +127,21 @@
131
127
  margin: 0;
132
128
  padding-inline-start: var(--md-sys-layout-window-margin);
133
129
 
134
- h1, h2, h3, h4, h5, h6, .micl-heading {
130
+ :is(h1, h2, h3, h4, h5, h6, .micl-heading) {
135
131
  @include typography.headline-medium;
136
132
  }
137
133
  }
138
134
  &:has(.micl-appbar__subtitle) {
139
- --md-sys-appbar-height: 136px;
135
+ --_height: 136px;
140
136
 
141
137
  .micl-appbar__subtitle {
142
- @include typography.title-small;
138
+ @include typography.label-large;
143
139
  }
144
140
  }
145
141
  }
146
142
  &.micl-appbar--large {
147
- --md-sys-appbar-height: 120px;
148
- --md-sys-appbar-padding-block-end: 12px;
143
+ --_height: 120px;
144
+ --_padding-block-end: 12px;
149
145
 
150
146
  padding-inline-start: 0;
151
147
 
@@ -154,12 +150,12 @@
154
150
  margin: 0;
155
151
  padding-inline-start: var(--md-sys-layout-window-margin);
156
152
 
157
- h1, h2, h3, h4, h5, h6, .micl-heading {
153
+ :is(h1, h2, h3, h4, h5, h6, .micl-heading) {
158
154
  @include typography.display-small;
159
155
  }
160
156
  }
161
157
  &:has(.micl-appbar__subtitle) {
162
- --md-sys-appbar-height: 152px;
158
+ --_height: 152px;
163
159
 
164
160
  .micl-appbar__subtitle {
165
161
  @include typography.title-medium;
@@ -168,36 +164,36 @@
168
164
  }
169
165
  }
170
166
 
171
- .micl-body:not(:has(> .micl-pane:nth-child(2))) {
167
+ .micl-panes:not(:has(> .micl-pane:nth-child(2))) {
172
168
  .micl-appbar:not(.micl-appbar--not-sticky) {
173
169
  @include appbar-sticky;
174
170
  }
175
171
  }
176
- .micl-body:has(> .micl-pane:nth-child(2)) {
177
- @media (max-width: layout.$md-sys-window-medium-min) {
172
+ .micl-panes:has(> .micl-pane:nth-child(2)) {
173
+ @media (max-width: layout.$md-sys-breakpoint-medium-min) {
178
174
  .micl-appbar:not(.micl-appbar--not-sticky) {
179
175
  @include appbar-sticky;
180
176
  }
181
177
  }
182
- @media (min-width: layout.$md-sys-window-medium-min) and (max-width: layout.$md-sys-window-medium-max) {
183
- &.micl-body--stacked-to-expanded,
184
- &.micl-body--stacked-to-large,
185
- &.micl-body--stacked-to-extralarge {
178
+ @media (min-width: layout.$md-sys-breakpoint-medium-min) and (max-width: layout.$md-sys-breakpoint-medium-max) {
179
+ &.micl-panes--stacked-to-expanded,
180
+ &.micl-panes--stacked-to-large,
181
+ &.micl-panes--stacked-to-extralarge {
186
182
  .micl-appbar:not(.micl-appbar--not-sticky) {
187
183
  @include appbar-sticky;
188
184
  }
189
185
  }
190
186
  }
191
- @media (min-width: layout.$md-sys-window-expanded-min) and (max-width: layout.$md-sys-window-expanded-max) {
192
- &.micl-body--stacked-to-large,
193
- &.micl-body--stacked-to-extralarge {
187
+ @media (min-width: layout.$md-sys-breakpoint-expanded-min) and (max-width: layout.$md-sys-breakpoint-expanded-max) {
188
+ &.micl-panes--stacked-to-large,
189
+ &.micl-panes--stacked-to-extralarge {
194
190
  .micl-appbar:not(.micl-appbar--not-sticky) {
195
191
  @include appbar-sticky;
196
192
  }
197
193
  }
198
194
  }
199
- @media (min-width: layout.$md-sys-window-large-min) and (max-width: layout.$md-sys-window-large-max) {
200
- &.micl-body--stacked-to-extralarge {
195
+ @media (min-width: layout.$md-sys-breakpoint-large-min) and (max-width: layout.$md-sys-breakpoint-large-max) {
196
+ &.micl-panes--stacked-to-extralarge {
201
197
  .micl-appbar:not(.micl-appbar--not-sticky) {
202
198
  @include appbar-sticky;
203
199
  }
@@ -212,7 +208,7 @@
212
208
  border-start-end-radius: inherit;
213
209
  }
214
210
  10% {
215
- background-color: var(--md-sys-color-surface-container);
211
+ background-color: var(--md-comp-app-bar-on-scroll-container-color, var(--md-sys-color-surface-container));
216
212
  box-shadow: var(--md-sys-elevation-level2);
217
213
  }
218
214
  50% {
@@ -220,7 +216,7 @@
220
216
  border-start-end-radius: 0;
221
217
  }
222
218
  100% {
223
- background-color: var(--md-sys-color-surface-container);
219
+ background-color: var(--md-comp-app-bar-on-scroll-container-color, var(--md-sys-color-surface-container));
224
220
  box-shadow: var(--md-sys-elevation-level2);
225
221
  border-start-start-radius: 0;
226
222
  border-start-end-radius: 0;
@@ -45,23 +45,25 @@ You can fine-tune the badge's position relative to its anchor using the followin
45
45
 
46
46
  | Variable name | Default Value | Description |
47
47
  | ------------- | ------------- | ----------- |
48
- | --md-sys-badge-inline-offset | 0px | Adjusts the horizontal position of the badge |
49
- | --md-sys-badge-block-offset | 0px | Adjusts the vertical position of the badge |
48
+ | `--md-comp-badge-inline-offset` | `0px` | Adjusts the horizontal position of the badge |
49
+ | `--md-comp-badge-block-offset` | `0px` | Adjusts the vertical position of the badge |
50
50
 
51
51
 
52
- ## Customizations
53
- You can customize the appearance of the Badge 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 badges.
52
+ ## Theming
53
+ Each badge 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 badges.
54
54
 
55
- | Variable name | Default Value | Description |
56
- | ------------- | ------------- | ----------- |
57
- | --md-sys-badge-small-size | 6px | The height and width of the small badge |
58
- | --md-sys-badge-large-size | 16px | The height and minimum width of the large badge |
59
- | --md-sys-badge-large-padding | 4px | The horizontal padding used for the large badge |
55
+ | Custom property | Meaning | Default |
56
+ |---|---|---|
57
+ | `--md-comp-badge-size` | The height and width of the small badge | `6px` |
58
+ | `--md-comp-badge-large-size` | The height and minimum width of the large badge | `16px` |
59
+ | `--md-comp-badge-large-padding` | The horizontal padding used for the large badge | `4px` |
60
+ | `--md-comp-badge-color` | The background color of the badge | `--md-sys-color-error` |
61
+ | `--md-comp-badge-large-label-text-color` | The text color of the large badge | `--md-sys-color-on-error` |
60
62
 
61
63
  **Example: Changing the size of the small badge**
62
64
 
63
65
  ```HTML
64
- <div style="--md-sys-badge-small-size:8px">
66
+ <div style="--md-comp-badge-size:8px">
65
67
  <span class="micl-badge micl-badge--small"></span>
66
68
  </div>
67
69
  ```
@@ -19,47 +19,43 @@
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/typography';
24
23
 
25
24
  @include typography.scale('label-small');
26
25
 
27
- :root {
28
- --md-sys-badge-small-size: 6px;
29
- --md-sys-badge-large-size: 16px;
30
- --md-sys-badge-large-padding: 4px;
31
- --md-sys-badge-inline-offset: 0px;
32
- --md-sys-badge-block-offset: 0px;
33
- }
34
-
35
26
  .micl-badge {
27
+ --_size: var(--md-comp-badge-size, 6px);
28
+ --_large-size: var(--md-comp-badge-large-size, 16px);
29
+ --_dx: var(--md-comp-badge-inline-offset, 0px);
30
+ --_dy: var(--md-comp-badge-block-offset, 0px);
31
+
36
32
  box-sizing: border-box;
37
33
  position: fixed;
38
34
  inset: 0;
39
35
  margin: 0;
40
36
  overflow-x: hidden;
41
- background-color: var(--md-sys-color-error);
42
- color: var(--md-sys-color-on-error);
37
+ background-color: var(--md-comp-badge-color, var(--md-sys-color-error));
38
+ color: var(--md-comp-badge-large-label-text-color, var(--md-sys-color-on-error));
43
39
 
44
40
  &.micl-badge--small {
45
- inline-size: var(--md-sys-badge-small-size);
46
- block-size: var(--md-sys-badge-small-size);
47
- inset-block-start: calc(anchor(start) + var(--md-sys-badge-block-offset));
48
- inset-inline-start: calc(anchor(end) - var(--md-sys-badge-small-size) + var(--md-sys-badge-inline-offset));
41
+ inline-size: var(--_size);
42
+ block-size: var(--_size);
43
+ inset-block-start: calc(anchor(start) + var(--_dy));
44
+ inset-inline-start: calc(anchor(end) - var(--_size) + var(--_dx));
49
45
  padding: 0;
50
- border-radius: calc(var(--md-sys-badge-small-size) / 2);
46
+ border-radius: calc(var(--_size) / 2);
51
47
  }
52
48
  &:not(.micl-badge--small) {
53
49
  @include typography.label-small;
54
50
 
55
51
  inline-size: fit-content;
56
52
  max-inline-size: 34px;
57
- min-inline-size: var(--md-sys-badge-large-size);
58
- block-size: var(--md-sys-badge-large-size);
59
- inset-block-start: calc(anchor(start) - (var(--md-sys-badge-large-size) - 14px) + var(--md-sys-badge-block-offset));
60
- inset-inline-start: calc(anchor(end) - 12px + var(--md-sys-badge-inline-offset));
61
- padding-inline: var(--md-sys-badge-large-padding);
62
- border-radius: calc(var(--md-sys-badge-large-size) / 2);
53
+ min-inline-size: var(--_large-size);
54
+ block-size: var(--_large-size);
55
+ inset-block-start: calc(anchor(start) - (var(--_large-size) - 14px) + var(--_dy));
56
+ inset-inline-start: calc(anchor(end) - 12px + var(--_dx));
57
+ padding-inline: var(--md-comp-badge-large-padding, 4px);
58
+ border-radius: calc(var(--_large-size) / 2);
63
59
  }
64
60
  }
65
61
 
@@ -67,13 +63,13 @@
67
63
  .micl-badge {
68
64
  position: absolute;
69
65
  inset: 0 !important;
70
- margin-block: calc(12px + var(--md-sys-badge-block-offset)) auto;
66
+ margin-block: calc(12px + var(--_dy)) auto;
71
67
 
72
68
  &.micl-badge--small {
73
- margin-inline-start: calc(var(--md-sys-icon-size) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
69
+ margin-inline-start: calc(var(--md-sys-icon-size, 24px) - var(--_size) - var(--_dx));
74
70
  }
75
71
  &:not(.micl-badge--small) {
76
- margin-inline-start: calc(12px - var(--md-sys-badge-inline-offset));
72
+ margin-inline-start: calc(12px - var(--_dx));
77
73
  }
78
74
  }
79
75
  }
@@ -86,7 +86,32 @@ The initial height is determined by its content and capped at 50% of the screen'
86
86
  <dialog data-miclsnapheights="0,200,420" ...>
87
87
  ```
88
88
 
89
- The value `0` is equivalent to closing the bottom sheet. When a user clicks the drag-handle, the bottom sheet toggles between these preset heights and its initial height. The bottom sheet will also snap to these preset heights as a user drags the heading.
89
+ The value `0` is equivalent to closing the bottom sheet. When a user clicks the drag-handle, the bottom sheet toggles between these preset heights and its initial height. The bottom sheet will also snap to these preset heights as a user drags the heading, and settles on the nearest preset when released. Dragging the bottom sheet down to less than 48px closes it.
90
+
91
+ ## Theming
92
+ Each bottom sheet style can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. The properties are declared on the component itself and can be changed on any appropriate parent element to affect its child bottom sheets.
93
+
94
+ | Custom property | Meaning | Default |
95
+ |---|---|---|
96
+ | `--md-comp-bottomsheet-height` | The height of the opened bottom sheet (managed by the library for resizable bottom sheets) | `max-content` |
97
+ | `--md-comp-bottomsheet-margin` | The space between the bottom sheet and the sides of the screen, on screens wider than 640px | `56px` |
98
+ | `--md-comp-bottomsheet-margin-top` | The minimum space between the bottom sheet and the top of the screen | `72px` |
99
+ | `--md-comp-bottomsheet-padding` | The amount of space between the edges and the content | `24px` |
100
+ | `--md-comp-bottomsheet-container-color` | The background color of the bottom sheet | `--md-sys-color-surface-container-low` |
101
+ | `--md-comp-bottomsheet-container-shape` | The corner rounding of the bottom sheet | `--md-sys-shape-corner-extra-large-top` |
102
+ | `--md-comp-bottomsheet-container-elevation` | The shadow (elevation) of the bottom sheet | `--md-sys-elevation-level1` |
103
+ | `--md-comp-bottomsheet-drag-handle-width` | The width of the drag handle | `32px` |
104
+ | `--md-comp-bottomsheet-drag-handle-height` | The height of the drag handle | `4px` |
105
+ | `--md-comp-bottomsheet-drag-handle-color` | The color of the drag handle | `--md-sys-color-on-surface-variant` |
106
+ | `--md-comp-bottomsheet-focus-indicator-color` | The color of the drag handle's keyboard-focus outline | `--md-sys-color-secondary` |
107
+
108
+ **Example: Changing the background color of the bottom sheet**
109
+
110
+ ```HTML
111
+ <dialog class="micl-bottomsheet" popover style="--md-comp-bottomsheet-container-color:var(--md-sys-color-surface-container)">
112
+ ...
113
+ </dialog>
114
+ ```
90
115
 
91
116
  ## Compatibility
92
117
  This component uses the Popover API, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API#api.htmlelement.popover) for details.
@@ -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';
@@ -27,23 +26,26 @@
27
26
 
28
27
  @include elevation.level(1);
29
28
 
29
+ @include shape.corner('extra-large-top');
30
30
  @include shape.corner('extra-large');
31
- @include shape.corner('small');
32
31
 
33
32
  @include statelayer.token('focus-indicator-thickness');
34
33
  @include statelayer.token('focus-indicator-outer-offset');
35
34
  @include statelayer.token('backdrop-opacity');
36
35
 
37
36
  dialog.micl-bottomsheet {
38
- --md-sys-bottomsheet-height: max-content;
39
- --md-sys-bottomsheet-margin: 56px;
40
- --md-sys-bottomsheet-margin-top: 72px;
41
- --md-sys-bottomsheet-padding: 24px;
42
- --md-sys-bottomsheet-handle-width: 32px;
43
- --md-sys-bottomsheet-handle-height: 4px;
44
- --md-sys-bottomsheet-motion-spatial: #{motion.$md-sys-motion-expressive-slow-spatial};
45
- --md-sys-bottomsheet-motion-duration: #{motion.$md-sys-motion-expressive-slow-spatial-duration};
46
- --md-sys-bottomsheet-motion-duration-reverse: #{motion.$md-sys-motion-expressive-default-spatial-duration};
37
+ --md-comp-bottomsheet-height: max-content;
38
+ --md-comp-bottomsheet-margin: 56px;
39
+ --md-comp-bottomsheet-margin-top: 72px;
40
+ --md-comp-bottomsheet-padding: 24px;
41
+ --md-comp-bottomsheet-drag-handle-width: 32px;
42
+ --md-comp-bottomsheet-drag-handle-height: 4px;
43
+ --md-comp-bottomsheet-motion-spatial: #{motion.$md-sys-motion-expressive-slow-spatial};
44
+ --md-comp-bottomsheet-motion-duration: #{motion.$md-sys-motion-expressive-slow-spatial-duration};
45
+ --md-comp-bottomsheet-motion-duration-reverse: #{motion.$md-sys-motion-expressive-default-spatial-duration};
46
+
47
+ --micl-duration: var(--md-comp-bottomsheet-motion-duration-reverse);
48
+ --micl-easing: #{motion.$md-sys-motion-easing-emphasized-accelerate};
47
49
 
48
50
  box-sizing: border-box;
49
51
  position: fixed;
@@ -51,46 +53,59 @@ dialog.micl-bottomsheet {
51
53
  block-size: 0;
52
54
  max-block-size: 50vh;
53
55
  inline-size: 100%;
56
+
57
+ &[data-miclfitheight] {
58
+ max-block-size: calc(100vh - var(--md-comp-bottomsheet-margin-top));
59
+ }
54
60
  min-inline-size: 100%;
55
- margin: var(--md-sys-bottomsheet-margin-top) 0 0 0 ;
61
+ margin: var(--md-comp-bottomsheet-margin-top) 0 0 0 ;
56
62
  padding: 0;
57
63
  border: none;
58
- border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
59
- background-color: var(--md-sys-color-surface-container-low);
60
- box-shadow: var(--md-sys-elevation-level1);
64
+ border-radius: var(--md-comp-bottomsheet-container-shape, var(--md-sys-shape-corner-extra-large-top));
65
+ background-color: var(--md-comp-bottomsheet-container-color, var(--md-sys-color-surface-container-low));
66
+ box-shadow: var(--md-comp-bottomsheet-container-elevation, var(--md-sys-elevation-level1));
61
67
  opacity: 0;
62
68
  overflow-y: hidden;
63
69
  interpolate-size: allow-keywords;
64
70
 
65
71
  &:not(.micl-bottomsheet--resizing) {
66
72
  transition:
67
- opacity var(--md-sys-bottomsheet-motion-duration-reverse) motion.$md-sys-motion-easing-emphasized-accelerate,
68
- block-size var(--md-sys-bottomsheet-motion-duration-reverse) var(--md-sys-bottomsheet-motion-spatial),
69
- overlay var(--md-sys-bottomsheet-motion-duration-reverse) linear allow-discrete,
70
- display var(--md-sys-bottomsheet-motion-duration-reverse) linear allow-discrete;
73
+ opacity var(--micl-duration) var(--micl-easing),
74
+ block-size var(--micl-duration) var(--md-comp-bottomsheet-motion-spatial),
75
+ overlay var(--micl-duration) linear allow-discrete,
76
+ display var(--micl-duration) linear allow-discrete;
71
77
  }
72
78
  .micl-bottomsheet__headline {
73
79
  box-sizing: border-box;
74
80
  display: flex;
81
+ flex-shrink: 0;
75
82
  align-items: center;
76
83
  inline-size: 100%;
77
84
  block-size: var(--md-sys-target-size, 48px);
78
85
  justify-content: center;
79
86
  cursor: grab;
87
+ touch-action: none;
80
88
 
81
89
  .micl-bottomsheet__draghandle {
82
90
  box-sizing: content-box;
83
- inline-size: var(--md-sys-bottomsheet-handle-width);
84
- block-size: var(--md-sys-bottomsheet-handle-height);
85
- padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-sys-bottomsheet-handle-width)) / 2);
91
+ inline-size: var(--md-comp-bottomsheet-drag-handle-width);
92
+ block-size: var(--md-comp-bottomsheet-drag-handle-height);
93
+ padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-comp-bottomsheet-drag-handle-width)) / 2);
86
94
  border: none;
87
- border-radius: var(--md-sys-shape-corner-small);
88
- background-color: var(--md-sys-color-on-surface-variant);
89
- background-clip: content-box;
95
+ // only shapes the focus ring; the visible handle is the ::before below
96
+ border-radius: var(--md-sys-shape-corner-extra-large);
97
+ background: none;
90
98
  cursor: pointer;
91
99
 
100
+ &::before {
101
+ content: '';
102
+ display: block;
103
+ block-size: 100%;
104
+ border-radius: calc(var(--md-comp-bottomsheet-drag-handle-height) / 2);
105
+ background-color: var(--md-comp-bottomsheet-drag-handle-color, var(--md-sys-color-on-surface-variant));
106
+ }
92
107
  &:focus-visible {
93
- outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
108
+ outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-comp-bottomsheet-focus-indicator-color, var(--md-sys-color-secondary));
94
109
  outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
95
110
  }
96
111
  }
@@ -100,29 +115,28 @@ dialog.micl-bottomsheet {
100
115
  }
101
116
 
102
117
  .micl-bottomsheet__content {
103
- padding: 0 var(--md-sys-bottomsheet-padding) var(--md-sys-bottomsheet-padding) var(--md-sys-bottomsheet-padding);
118
+ flex: 1 1 auto;
119
+ padding: 0 var(--md-comp-bottomsheet-padding) var(--md-comp-bottomsheet-padding) var(--md-comp-bottomsheet-padding);
120
+ overflow: hidden auto;
104
121
  }
105
122
 
106
123
  &::backdrop {
107
124
  background-color: rgba(0, 0, 0, 0);
108
125
  transition:
109
- overlay var(--md-sys-bottomsheet-motion-duration) linear allow-discrete,
110
- display var(--md-sys-bottomsheet-motion-duration) linear allow-discrete,
111
- background-color var(--md-sys-bottomsheet-motion-duration) linear;
126
+ overlay var(--micl-duration) linear allow-discrete,
127
+ display var(--micl-duration) linear allow-discrete,
128
+ background-color var(--micl-duration) linear;
112
129
  }
113
130
  &:popover-open,
114
131
  &[open] {
115
- block-size: var(--md-sys-bottomsheet-height);
132
+ --micl-duration: var(--md-comp-bottomsheet-motion-duration);
133
+ --micl-easing: #{motion.$md-sys-motion-easing-emphasized-decelerate};
134
+
135
+ display: flex;
136
+ flex-direction: column;
137
+ block-size: var(--md-comp-bottomsheet-height);
116
138
  opacity: 100%;
117
- // overflow-y: auto;
118
-
119
- &:not(.micl-bottomsheet--resizing) {
120
- transition:
121
- opacity var(--md-sys-bottomsheet-motion-duration) motion.$md-sys-motion-easing-emphasized-decelerate,
122
- block-size var(--md-sys-bottomsheet-motion-duration) var(--md-sys-bottomsheet-motion-spatial),
123
- overlay var(--md-sys-bottomsheet-motion-duration) linear allow-discrete,
124
- display var(--md-sys-bottomsheet-motion-duration) linear allow-discrete;
125
- }
139
+
126
140
  @starting-style {
127
141
  block-size: 0;
128
142
  opacity: 0;
@@ -139,11 +153,11 @@ dialog.micl-bottomsheet {
139
153
 
140
154
  @media (min-width: 641px) {
141
155
  dialog.micl-bottomsheet {
142
- inline-size: min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px);
156
+ inline-size: min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px);
143
157
  max-inline-size: 640px;
144
- min-inline-size: min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px);
145
- inset-inline-start: calc(((100vw - min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px)) / 2) - var(--md-sys-bottomsheet-margin));
146
- margin: var(--md-sys-bottomsheet-margin);
158
+ min-inline-size: min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px);
159
+ inset-inline-start: calc(((100vw - min(100vw - (2 * var(--md-comp-bottomsheet-margin)), 640px)) / 2) - var(--md-comp-bottomsheet-margin));
160
+ margin: var(--md-comp-bottomsheet-margin);
147
161
  margin-block-end: 0;
148
162
  }
149
163
  }