@angular/material 20.0.0-rc.0 → 20.0.0-rc.2

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 (352) hide show
  1. package/autocomplete/_autocomplete-theme.scss +17 -37
  2. package/autocomplete/_m2-autocomplete.scss +3 -6
  3. package/autocomplete/_m3-autocomplete.scss +14 -9
  4. package/badge/_badge-theme.scss +26 -39
  5. package/badge/_m2-badge.scss +32 -35
  6. package/badge/_m3-badge.scss +41 -70
  7. package/bottom-sheet/_bottom-sheet-theme.scss +16 -27
  8. package/bottom-sheet/_m2-bottom-sheet.scss +11 -11
  9. package/bottom-sheet/_m3-bottom-sheet.scss +18 -17
  10. package/button/_button-theme.scss +29 -46
  11. package/button/_fab-theme.scss +22 -41
  12. package/button/_icon-button-theme.scss +29 -46
  13. package/button/_m2-button.scss +135 -133
  14. package/button/_m2-fab.scss +51 -53
  15. package/button/_m2-icon-button.scss +14 -17
  16. package/button/_m3-button.scss +145 -240
  17. package/button/_m3-fab.scss +69 -166
  18. package/button/_m3-icon-button.scss +28 -56
  19. package/button-toggle/_button-toggle-theme.scss +23 -49
  20. package/button-toggle/_m2-button-toggle.scss +45 -37
  21. package/button-toggle/_m3-button-toggle.scss +53 -53
  22. package/card/_card-theme.scss +16 -37
  23. package/card/_m2-card.scss +24 -25
  24. package/card/_m3-card.scss +32 -36
  25. package/checkbox/_checkbox-theme.scss +25 -52
  26. package/checkbox/_m2-checkbox.scss +32 -35
  27. package/checkbox/_m3-checkbox.scss +49 -84
  28. package/chips/_chips-theme.scss +24 -44
  29. package/chips/_m2-chip.scss +47 -51
  30. package/chips/_m3-chip.scss +63 -110
  31. package/core/_core-theme.scss +58 -56
  32. package/core/_core.scss +15 -18
  33. package/core/_m2-app.scss +3 -7
  34. package/core/_m3-app.scss +37 -24
  35. package/core/color/_all-color.scss +1 -1
  36. package/core/option/_m2-optgroup.scss +6 -9
  37. package/core/option/_m2-option.scss +10 -13
  38. package/core/option/_m3-optgroup.scss +16 -13
  39. package/core/option/_m3-option.scss +28 -48
  40. package/core/option/_optgroup-theme.scss +14 -25
  41. package/core/option/_option-theme.scss +22 -33
  42. package/core/ripple/_m2-ripple.scss +1 -4
  43. package/core/ripple/_m3-ripple.scss +11 -13
  44. package/core/ripple/_ripple-theme.scss +15 -33
  45. package/core/ripple/_ripple.scss +5 -5
  46. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -11
  47. package/core/selection/pseudo-checkbox/_m3-pseudo-checkbox.scss +25 -40
  48. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +16 -27
  49. package/core/style/_sass-utils.scss +0 -29
  50. package/core/theming/_all-theme.scss +41 -0
  51. package/core/theming/_color-api-backwards-compatibility.scss +49 -35
  52. package/core/theming/_definition.scss +78 -72
  53. package/core/theming/_inspection.scss +23 -46
  54. package/core/tokens/_m3-system.scss +106 -112
  55. package/core/tokens/_m3-tokens.scss +30 -354
  56. package/core/tokens/_m3-utils.scss +36 -73
  57. package/core/tokens/_token-utils.scss +53 -226
  58. package/core/tokens/m3/_index.scss +7 -8
  59. package/core/tokens/m3/_md-sys-color.scss +125 -137
  60. package/core/tokens/m3/_md-sys-elevation.scss +7 -7
  61. package/core/tokens/m3/_md-sys-motion.scss +27 -38
  62. package/core/tokens/m3/_md-sys-shape.scss +13 -16
  63. package/core/tokens/m3/_md-sys-state.scss +5 -5
  64. package/core/tokens/m3/_md-sys-typescale.scss +107 -306
  65. package/core/tokens/m3/_theme.scss +47 -0
  66. package/datepicker/_datepicker-theme.scss +24 -39
  67. package/datepicker/_m2-datepicker.scss +55 -50
  68. package/datepicker/_m3-datepicker.scss +65 -113
  69. package/datepicker/index.d.ts +1 -0
  70. package/dialog/_dialog-theme.scss +15 -27
  71. package/dialog/_m2-dialog.scss +25 -26
  72. package/dialog/_m3-dialog.scss +35 -35
  73. package/divider/_divider-theme.scss +14 -25
  74. package/divider/_m2-divider.scss +2 -5
  75. package/divider/_m3-divider.scss +13 -13
  76. package/expansion/_expansion-theme.scss +15 -33
  77. package/expansion/_m2-expansion.scss +28 -27
  78. package/expansion/_m3-expansion.scss +41 -36
  79. package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
  80. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  81. package/fesm2022/autocomplete.mjs +23 -23
  82. package/fesm2022/autocomplete.mjs.map +1 -1
  83. package/fesm2022/badge/testing.mjs.map +1 -1
  84. package/fesm2022/badge.mjs +11 -11
  85. package/fesm2022/badge.mjs.map +1 -1
  86. package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
  87. package/fesm2022/bottom-sheet.mjs +11 -11
  88. package/fesm2022/bottom-sheet.mjs.map +1 -1
  89. package/fesm2022/button/testing.mjs.map +1 -1
  90. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  91. package/fesm2022/button-toggle.mjs +20 -24
  92. package/fesm2022/button-toggle.mjs.map +1 -1
  93. package/fesm2022/button.mjs +21 -21
  94. package/fesm2022/button.mjs.map +1 -1
  95. package/fesm2022/card/testing.mjs.map +1 -1
  96. package/fesm2022/card.mjs +47 -47
  97. package/fesm2022/card.mjs.map +1 -1
  98. package/fesm2022/checkbox/testing.mjs.map +1 -1
  99. package/fesm2022/checkbox.mjs +11 -11
  100. package/fesm2022/checkbox.mjs.map +1 -1
  101. package/fesm2022/chips/testing.mjs.map +1 -1
  102. package/fesm2022/chips.mjs +52 -52
  103. package/fesm2022/chips.mjs.map +1 -1
  104. package/fesm2022/{common-module-DZl8g1kc.mjs → common-module-BeAwwoi6.mjs} +5 -5
  105. package/fesm2022/common-module-BeAwwoi6.mjs.map +1 -0
  106. package/fesm2022/core/testing.mjs.map +1 -1
  107. package/fesm2022/core.mjs +24 -24
  108. package/fesm2022/core.mjs.map +1 -1
  109. package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
  110. package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +1 -1
  111. package/fesm2022/datepicker/testing.mjs.map +1 -1
  112. package/fesm2022/datepicker.mjs +99 -95
  113. package/fesm2022/datepicker.mjs.map +1 -1
  114. package/fesm2022/dialog/testing.mjs +18 -5
  115. package/fesm2022/dialog/testing.mjs.map +1 -1
  116. package/fesm2022/dialog.mjs +2 -2
  117. package/fesm2022/dialog.mjs.map +1 -1
  118. package/fesm2022/divider/testing.mjs.map +1 -1
  119. package/fesm2022/divider.mjs +8 -8
  120. package/fesm2022/divider.mjs.map +1 -1
  121. package/fesm2022/{error-options-BWOa3B4G.mjs → error-options-C79tZCHG.mjs} +7 -7
  122. package/fesm2022/error-options-C79tZCHG.mjs.map +1 -0
  123. package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
  124. package/fesm2022/expansion/testing.mjs.map +1 -1
  125. package/fesm2022/expansion.mjs +28 -28
  126. package/fesm2022/expansion.mjs.map +1 -1
  127. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  128. package/fesm2022/form-field/testing.mjs.map +1 -1
  129. package/fesm2022/{form-field-B3aq6ikj.mjs → form-field-Cdw3iYrm.mjs} +70 -62
  130. package/fesm2022/form-field-Cdw3iYrm.mjs.map +1 -0
  131. package/fesm2022/form-field.mjs +3 -3
  132. package/fesm2022/form-field.mjs.map +1 -1
  133. package/fesm2022/grid-list/testing.mjs.map +1 -1
  134. package/fesm2022/grid-list.mjs +24 -24
  135. package/fesm2022/grid-list.mjs.map +1 -1
  136. package/fesm2022/icon/testing.mjs +8 -8
  137. package/fesm2022/icon/testing.mjs.map +1 -1
  138. package/fesm2022/{icon-button-DH8TBWWr.mjs → icon-button-D5zzuoJc.mjs} +10 -10
  139. package/fesm2022/icon-button-D5zzuoJc.mjs.map +1 -0
  140. package/fesm2022/{icon-registry-Bk5cM8Z5.mjs → icon-registry-DVrJNtTv.mjs} +4 -4
  141. package/fesm2022/icon-registry-DVrJNtTv.mjs.map +1 -0
  142. package/fesm2022/icon.mjs +10 -10
  143. package/fesm2022/icon.mjs.map +1 -1
  144. package/fesm2022/index-CrjYeoWX.mjs +22 -0
  145. package/fesm2022/index-CrjYeoWX.mjs.map +1 -0
  146. package/fesm2022/index-DTIUI_kX.mjs +20 -0
  147. package/fesm2022/index-DTIUI_kX.mjs.map +1 -0
  148. package/fesm2022/input/testing.mjs.map +1 -1
  149. package/fesm2022/input-harness-oQzj5EsQ.mjs.map +1 -1
  150. package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
  151. package/fesm2022/input.mjs +12 -12
  152. package/fesm2022/input.mjs.map +1 -1
  153. package/fesm2022/{internal-form-field-DVvKYBKJ.mjs → internal-form-field-B9_shC5z.mjs} +4 -4
  154. package/fesm2022/internal-form-field-B9_shC5z.mjs.map +1 -0
  155. package/fesm2022/{line-Dwrcg_t9.mjs → line-XysKlyvU.mjs} +9 -9
  156. package/fesm2022/line-XysKlyvU.mjs.map +1 -0
  157. package/fesm2022/list/testing.mjs.map +1 -1
  158. package/fesm2022/list.mjs +55 -55
  159. package/fesm2022/list.mjs.map +1 -1
  160. package/fesm2022/material.mjs.map +1 -1
  161. package/fesm2022/menu/testing.mjs.map +1 -1
  162. package/fesm2022/menu.mjs +20 -20
  163. package/fesm2022/menu.mjs.map +1 -1
  164. package/fesm2022/{module-hX_hFZhs.mjs → module-CVpKZX1V.mjs} +7 -7
  165. package/fesm2022/module-CVpKZX1V.mjs.map +1 -0
  166. package/fesm2022/{module-B-ci3hbc.mjs → module-CdXqcjot.mjs} +28 -28
  167. package/fesm2022/module-CdXqcjot.mjs.map +1 -0
  168. package/fesm2022/{module-X29xYsIk.mjs → module-CwYXiMoV.mjs} +12 -12
  169. package/fesm2022/module-CwYXiMoV.mjs.map +1 -0
  170. package/fesm2022/{module-D9IKGg_w.mjs → module-r2U_2G3G.mjs} +17 -17
  171. package/fesm2022/module-r2U_2G3G.mjs.map +1 -0
  172. package/fesm2022/{option-MOeehkAg.mjs → option-D4ZNnnWi.mjs} +11 -11
  173. package/fesm2022/option-D4ZNnnWi.mjs.map +1 -0
  174. package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
  175. package/fesm2022/paginator/testing.mjs.map +1 -1
  176. package/fesm2022/paginator.mjs +25 -25
  177. package/fesm2022/paginator.mjs.map +1 -1
  178. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  179. package/fesm2022/progress-bar.mjs +8 -8
  180. package/fesm2022/progress-bar.mjs.map +1 -1
  181. package/fesm2022/progress-spinner/testing.mjs.map +1 -1
  182. package/fesm2022/progress-spinner.mjs +8 -8
  183. package/fesm2022/progress-spinner.mjs.map +1 -1
  184. package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs → pseudo-checkbox-DQugCpur.mjs} +4 -4
  185. package/fesm2022/pseudo-checkbox-DQugCpur.mjs.map +1 -0
  186. package/fesm2022/pseudo-checkbox-module-BXWS_-PP.mjs +20 -0
  187. package/fesm2022/pseudo-checkbox-module-BXWS_-PP.mjs.map +1 -0
  188. package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
  189. package/fesm2022/radio/testing.mjs.map +1 -1
  190. package/fesm2022/radio.mjs +19 -16
  191. package/fesm2022/radio.mjs.map +1 -1
  192. package/fesm2022/{ripple-CuyVtN3V.mjs → ripple-BtLhcfGO.mjs} +7 -7
  193. package/fesm2022/ripple-BtLhcfGO.mjs.map +1 -0
  194. package/fesm2022/{ripple-loader-pOctSZby.mjs → ripple-loader-DBdhLqHy.mjs} +5 -5
  195. package/fesm2022/ripple-loader-DBdhLqHy.mjs.map +1 -0
  196. package/fesm2022/select/testing.mjs.map +1 -1
  197. package/fesm2022/select.mjs +12 -12
  198. package/fesm2022/select.mjs.map +1 -1
  199. package/fesm2022/sidenav/testing.mjs.map +1 -1
  200. package/fesm2022/sidenav.mjs +29 -25
  201. package/fesm2022/sidenav.mjs.map +1 -1
  202. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  203. package/fesm2022/slide-toggle.mjs +11 -11
  204. package/fesm2022/slide-toggle.mjs.map +1 -1
  205. package/fesm2022/slider/testing.mjs.map +1 -1
  206. package/fesm2022/slider.mjs +21 -21
  207. package/fesm2022/slider.mjs.map +1 -1
  208. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  209. package/fesm2022/snack-bar.mjs +29 -29
  210. package/fesm2022/snack-bar.mjs.map +1 -1
  211. package/fesm2022/sort/testing.mjs.map +1 -1
  212. package/fesm2022/sort.mjs +15 -15
  213. package/fesm2022/sort.mjs.map +1 -1
  214. package/fesm2022/stepper/testing.mjs.map +1 -1
  215. package/fesm2022/stepper.mjs +38 -38
  216. package/fesm2022/stepper.mjs.map +1 -1
  217. package/fesm2022/{structural-styles-CasigI3l.mjs → structural-styles-DWEe15sC.mjs} +4 -4
  218. package/fesm2022/structural-styles-DWEe15sC.mjs.map +1 -0
  219. package/fesm2022/table/testing.mjs.map +1 -1
  220. package/fesm2022/table.mjs +56 -56
  221. package/fesm2022/table.mjs.map +1 -1
  222. package/fesm2022/tabs/testing.mjs.map +1 -1
  223. package/fesm2022/tabs.mjs +67 -63
  224. package/fesm2022/tabs.mjs.map +1 -1
  225. package/fesm2022/timepicker/testing.mjs.map +1 -1
  226. package/fesm2022/timepicker.mjs +20 -20
  227. package/fesm2022/timepicker.mjs.map +1 -1
  228. package/fesm2022/toolbar/testing.mjs.map +1 -1
  229. package/fesm2022/toolbar.mjs +12 -12
  230. package/fesm2022/toolbar.mjs.map +1 -1
  231. package/fesm2022/tooltip/testing.mjs.map +1 -1
  232. package/fesm2022/tooltip.mjs +2 -2
  233. package/fesm2022/tooltip.mjs.map +1 -1
  234. package/fesm2022/tree/testing.mjs.map +1 -1
  235. package/fesm2022/tree.mjs +26 -26
  236. package/fesm2022/tree.mjs.map +1 -1
  237. package/form-field/_form-field-theme.scss +23 -55
  238. package/form-field/_m2-form-field.scss +112 -91
  239. package/form-field/_m3-form-field.scss +116 -131
  240. package/form-field/index.d.ts +2 -2
  241. package/{form-field.d-CIxjiZIX.d.ts → form-field.d-C6p5uYjG.d.ts} +4 -2
  242. package/grid-list/_grid-list-theme.scss +13 -23
  243. package/grid-list/_m2-grid-list.scss +8 -7
  244. package/grid-list/_m3-grid-list.scss +14 -15
  245. package/icon/_icon-theme.scss +20 -30
  246. package/icon/_m2-icon.scss +1 -4
  247. package/icon/_m3-icon.scss +13 -27
  248. package/input/_input-theme.scss +7 -40
  249. package/input/index.d.ts +4 -4
  250. package/list/_list-theme.scss +22 -52
  251. package/list/_m2-list.scss +56 -55
  252. package/list/_m3-list.scss +69 -67
  253. package/menu/_m2-menu.scss +22 -25
  254. package/menu/_m3-menu.scss +35 -38
  255. package/menu/_menu-theme.scss +15 -27
  256. package/{module.d-CDrqNC7Q.d.ts → module.d-D1Ym5Wf2.d.ts} +1 -1
  257. package/{module.d-DZ8DPHcV.d.ts → module.d-DMabQ4_c.d.ts} +2 -2
  258. package/package.json +2 -2
  259. package/paginator/_m2-paginator.scss +16 -17
  260. package/paginator/_m3-paginator.scss +28 -27
  261. package/paginator/_paginator-theme.scss +14 -40
  262. package/paginator/index.d.ts +5 -5
  263. package/{paginator.d-Ci_wE-RV.d.ts → paginator.d-DuJ-oYgT.d.ts} +1 -1
  264. package/prebuilt-themes/azure-blue.css +1 -1
  265. package/prebuilt-themes/cyan-orange.css +1 -1
  266. package/prebuilt-themes/deeppurple-amber.css +1 -1
  267. package/prebuilt-themes/indigo-pink.css +1 -1
  268. package/prebuilt-themes/magenta-violet.css +1 -1
  269. package/prebuilt-themes/pink-bluegrey.css +1 -1
  270. package/prebuilt-themes/purple-green.css +1 -1
  271. package/prebuilt-themes/rose-red.css +1 -1
  272. package/progress-bar/_m2-progress-bar.scss +5 -8
  273. package/progress-bar/_m3-progress-bar.scss +17 -26
  274. package/progress-bar/_progress-bar-theme.scss +17 -27
  275. package/progress-spinner/_m2-progress-spinner.scss +3 -6
  276. package/progress-spinner/_m3-progress-spinner.scss +15 -22
  277. package/progress-spinner/_progress-spinner-theme.scss +20 -43
  278. package/radio/_m2-radio.scss +24 -27
  279. package/radio/_m3-radio.scss +44 -58
  280. package/radio/_radio-theme.scss +23 -50
  281. package/schematics/ng-add/index.js +1 -1
  282. package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
  283. package/schematics/ng-generate/theme-color/index_bundled.js.map +1 -1
  284. package/schematics/ng-update/index_bundled.js +56 -2
  285. package/schematics/ng-update/index_bundled.js.map +1 -1
  286. package/select/_m2-select.scss +15 -18
  287. package/select/_m3-select.scss +32 -38
  288. package/select/_select-theme.scss +23 -50
  289. package/select/index.d.ts +3 -3
  290. package/sidenav/_m2-sidenav.scss +9 -12
  291. package/sidenav/_m3-sidenav.scss +20 -22
  292. package/sidenav/_sidenav-theme.scss +14 -25
  293. package/slide-toggle/_m2-slide-toggle.scss +82 -83
  294. package/slide-toggle/_m3-slide-toggle.scss +102 -143
  295. package/slide-toggle/_slide-toggle-theme.scss +26 -61
  296. package/slider/_m2-slider.scss +46 -46
  297. package/slider/_m3-slider.scss +54 -109
  298. package/slider/_slider-theme.scss +23 -34
  299. package/snack-bar/_m2-snack-bar.scss +10 -11
  300. package/snack-bar/_m3-snack-bar.scss +20 -19
  301. package/snack-bar/_snack-bar-theme.scss +14 -26
  302. package/sort/_m2-sort.scss +1 -4
  303. package/sort/_m3-sort.scss +11 -9
  304. package/sort/_sort-theme.scss +15 -27
  305. package/stepper/_m2-stepper.scss +32 -31
  306. package/stepper/_m3-stepper.scss +44 -79
  307. package/stepper/_stepper-theme.scss +22 -50
  308. package/table/_m2-table.scss +25 -26
  309. package/table/_m3-table.scss +36 -27
  310. package/table/_table-theme.scss +15 -32
  311. package/table/index.d.ts +2 -2
  312. package/tabs/_m2-tabs.scss +26 -29
  313. package/tabs/_m3-tabs.scss +40 -51
  314. package/tabs/_tabs-theme.scss +37 -58
  315. package/tabs/index.d.ts +5 -3
  316. package/timepicker/_m2-timepicker.scss +3 -6
  317. package/timepicker/_m3-timepicker.scss +14 -15
  318. package/timepicker/_timepicker-theme.scss +20 -45
  319. package/toolbar/_m2-toolbar.scss +11 -12
  320. package/toolbar/_m3-toolbar.scss +22 -17
  321. package/toolbar/_toolbar-theme.scss +13 -37
  322. package/tooltip/_m2-tooltip.scss +9 -11
  323. package/tooltip/_m3-tooltip.scss +19 -19
  324. package/tooltip/_tooltip-theme.scss +17 -35
  325. package/tree/_m2-tree.scss +6 -9
  326. package/tree/_m3-tree.scss +19 -16
  327. package/tree/_tree-theme.scss +14 -36
  328. package/core/tokens/m3/_md-ref-palette.scss +0 -100
  329. package/core/tokens/m3/_md-ref-typeface.scss +0 -14
  330. package/fesm2022/common-module-DZl8g1kc.mjs.map +0 -1
  331. package/fesm2022/error-options-BWOa3B4G.mjs.map +0 -1
  332. package/fesm2022/form-field-B3aq6ikj.mjs.map +0 -1
  333. package/fesm2022/icon-button-DH8TBWWr.mjs.map +0 -1
  334. package/fesm2022/icon-registry-Bk5cM8Z5.mjs.map +0 -1
  335. package/fesm2022/index-BHJ4tVIe.mjs +0 -22
  336. package/fesm2022/index-BHJ4tVIe.mjs.map +0 -1
  337. package/fesm2022/index-D2rZ0V78.mjs +0 -20
  338. package/fesm2022/index-D2rZ0V78.mjs.map +0 -1
  339. package/fesm2022/internal-form-field-DVvKYBKJ.mjs.map +0 -1
  340. package/fesm2022/line-Dwrcg_t9.mjs.map +0 -1
  341. package/fesm2022/module-B-ci3hbc.mjs.map +0 -1
  342. package/fesm2022/module-D9IKGg_w.mjs.map +0 -1
  343. package/fesm2022/module-X29xYsIk.mjs.map +0 -1
  344. package/fesm2022/module-hX_hFZhs.mjs.map +0 -1
  345. package/fesm2022/option-MOeehkAg.mjs.map +0 -1
  346. package/fesm2022/pseudo-checkbox-BFGIaGxz.mjs.map +0 -1
  347. package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs +0 -20
  348. package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs.map +0 -1
  349. package/fesm2022/ripple-CuyVtN3V.mjs.map +0 -1
  350. package/fesm2022/ripple-loader-pOctSZby.mjs.map +0 -1
  351. package/fesm2022/structural-styles-CasigI3l.mjs.map +0 -1
  352. package/schematics/tsconfig.json +0 -26
@@ -1,42 +1,8 @@
1
- @use '../style/elevation';
2
1
  @use '../style/sass-utils';
3
- @use './m3-system';
4
2
  @use 'sass:list';
5
- @use 'sass:meta';
6
3
  @use 'sass:map';
7
4
  @use 'sass:string';
8
5
 
9
- $_tokens: null;
10
- $_component-prefix: null;
11
- $_system-fallbacks: m3-system.create-system-fallbacks();
12
-
13
- // Sets the token prefix and map to use when creating token slots.
14
- @mixin use-tokens($prefix, $tokens) {
15
- $_component-prefix: $prefix !global;
16
- $_tokens: $tokens !global;
17
-
18
- @content;
19
-
20
- $_component-prefix: null !global;
21
- $_tokens: null !global;
22
- }
23
-
24
- // Combines a prefix and a string to generate a CSS variable name for a token.
25
- @function _create-var-name($prefix, $token) {
26
- @if $prefix == null or $token == null {
27
- @error 'Must specify both prefix and name when generating token';
28
- }
29
-
30
- $string-prefix: '';
31
-
32
- // Prefixes are lists so we need to combine them.
33
- @each $part in $prefix {
34
- $string-prefix: if($string-prefix == '', $part, '#{$string-prefix}-#{$part}');
35
- }
36
-
37
- @return string.unquote('--#{$string-prefix}-#{$token}');
38
- }
39
-
40
6
  // Creates a CSS variable, including the fallback if provided.
41
7
  @function _create-var($name, $fallback: null) {
42
8
  @if ($fallback) {
@@ -46,186 +12,98 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
46
12
  }
47
13
  }
48
14
 
49
- // Gets the value of the token given the current global context state.
50
- @function _get-token-value($token, $fallback) {
51
- $var-name: _create-var-name($_component-prefix, $token);
52
- $fallback: _get-token-fallback($token, $fallback);
53
- @return _create-var($var-name, $fallback);
15
+ // Returns a list of overrides for the given M3 get-tokens mixin and prefix. Each token has its
16
+ // prefix removed since the overrides API expects its absence. The returned map includes "all" for
17
+ // all override tokens, and also the subsets with keys base, color, typography, and density.
18
+ @function get-overrides($tokens, $prefix) {
19
+ $base: remove-token-prefixes(map.get($tokens, base), $prefix);
20
+ $color: remove-token-prefixes(map.get($tokens, color), $prefix);
21
+ $typography: remove-token-prefixes(map.get($tokens, typography), $prefix);
22
+ $density: remove-token-prefixes(map.get($tokens, density), $prefix);
23
+ $all: ();
24
+ @each $map in ($base, $color, $typography, $density) {
25
+ $all: map.merge($all, $map);
26
+ }
27
+
28
+ @return (
29
+ all: $all,
30
+ base: $base,
31
+ color: $color,
32
+ typography: $typography,
33
+ density: $density,
34
+ );
54
35
  }
55
36
 
56
- // Assertion mixin that throws an error if the global state has not been set up by wrapping
57
- // calls with `use-tokens`.
58
- @function _assert-use-tokens($token) {
59
- @if $_component-prefix == null or $_tokens == null {
60
- @error 'Function was not called within a wrapping call of `use-tokens`';
61
- }
62
- @if not map.has-key($_tokens, $token) {
63
- @error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
37
+ // Removes a prefix from each component token in the provided map of prefixed tokens.
38
+ @function remove-token-prefixes($prefixed-tokens: (), $prefix) {
39
+ $tokens: ();
40
+ @each $prefixed-token, $value in $prefixed-tokens {
41
+ $token: string.slice($prefixed-token, string.length($prefix) + 2);
42
+ $tokens: map.set($tokens, $token, $value);
64
43
  }
65
-
66
- @return true;
44
+ @return $tokens;
67
45
  }
68
46
 
69
47
  // Returns the token slot value.
70
48
  // Accepts an optional fallback parameter to include in the CSS variable.
71
49
  // If $fallback is `true`, then use the tokens map to get the fallback.
72
- // TODO: Remove the use case where we accept "true" and handle any failing client screenshots
73
- @function slot($token, $fallback: null) {
74
- $_assert: _assert-use-tokens($token);
75
- @return _get-token-value($token, $fallback);
76
- }
77
-
78
- // Returns the name of a token including the current prefix. Intended to be used in calculations
79
- // involving tokens. `create-token-slot` should be used when outputting tokens.
80
- @function get-token-variable-name($token) {
81
- $_assert: _assert-use-tokens($token);
82
- @return _create-var-name($_component-prefix, $token);
83
- }
84
-
85
- // Gets the token's fallback value. Prefers adding a system-level fallback if one exists, otherwise
86
- // use the provided fallback.
87
- @function _get-token-fallback($token, $fallback: null) {
88
- // If the $fallback is `true`, this is the component's signal to use the current token map value
89
- @if ($fallback == true) {
90
- $fallback: map.get($_tokens, $token);
50
+ @function slot($token, $fallbacks, $fallback: null) {
51
+ // Fallbacks are a map of base, color, typography, and density tokens. To simplify
52
+ // lookup, flatten these token groups into a single map.
53
+ $fallbacks-flattened: ();
54
+ @each $tokens in map.values($fallbacks) {
55
+ @each $token, $value in $tokens {
56
+ $fallbacks-flattened: map.set($fallbacks-flattened, $token, $value);
57
+ }
91
58
  }
92
-
93
- // Check whether there's a system-level fallback. If not, return the optional
94
- // provided fallback (otherwise null).
95
- $sys-fallback: map.get($_system-fallbacks, $_component-prefix, $token);
96
- @if (not $sys-fallback) {
97
- @return $fallback;
59
+ @if not map.has-key($fallbacks-flattened, $token) {
60
+ @error 'Token #{$token} does not exist. Configured tokens are:' +
61
+ #{map.keys($fallbacks-flattened)};
98
62
  }
99
63
 
64
+ $sys-fallback: map.get($fallbacks-flattened, $token);
100
65
  @if (sass-utils.is-css-var-name($sys-fallback)) {
101
- @return _create-var($sys-fallback, $fallback);
66
+ $sys-fallback: _create-var($sys-fallback, $fallback);
102
67
  }
103
68
 
104
- @return $sys-fallback;
69
+ @return _create-var(--mat-#{$token}, $sys-fallback);
105
70
  }
106
71
 
107
- // Outputs a map of tokens under a specific prefix.
108
- @mixin create-token-values($prefix, $tokens) {
109
- @include _create-token-values-internal($prefix, $tokens, false);
72
+ // Outputs a map of tokens.
73
+ @mixin create-token-values($tokens) {
74
+ @include _create-token-values-internal($tokens, false);
110
75
  }
111
76
 
112
77
  // Outputs a map of tokens under a specific prefix in scenarios where tokens may be mixed with
113
78
  // other declarations (e.g. M2 themes). Used to avoid https://sass-lang.com/documentation/breaking-changes/mixed-decls/
114
- @mixin create-token-values-mixed($prefix, $tokens) {
115
- @include _create-token-values-internal($prefix, $tokens, true);
79
+ @mixin create-token-values-mixed($tokens) {
80
+ @include _create-token-values-internal($tokens, true);
116
81
  }
117
82
 
118
- @mixin _create-token-values-internal($prefix, $tokens, $in-place) {
83
+ @mixin _create-token-values-internal($tokens, $in-place) {
119
84
  @if ($tokens != null) {
120
85
  @if ($in-place) {
121
86
  & {
122
87
  @each $key, $value in $tokens {
123
88
  @if $value != null {
124
- @include define-css_var($prefix, $key, $value);
89
+ --mat-#{$key}: #{$value};
125
90
  }
126
91
  }
127
92
  }
128
93
  } @else {
129
94
  @each $key, $value in $tokens {
130
95
  @if $value != null {
131
- @include define-css-var($prefix, $key, $value);
96
+ --mat-#{$key}: #{$value};
132
97
  }
133
98
  }
134
99
  }
135
100
  }
136
101
  }
137
102
 
138
- @mixin define-css-var($prefix, $key, $value) {
139
- $name: _create-var-name($prefix, $key);
140
- #{$name}: #{$value};
141
- }
142
-
143
- // MDC doesn't currently handle elevation tokens properly. As a temporary workaround we can combine
144
- // the elevation and shadow-color tokens into a full box-shadow and use it as the value for the
145
- // elevation token.
146
- @function resolve-elevation($tokens, $elevation-token, $shadow-color-token) {
147
- $elevation: map.get($tokens, $elevation-token);
148
- $shadow-color: map.get($tokens, $shadow-color-token);
149
- @return map.merge(
150
- $tokens,
151
- (
152
- $elevation-token: elevation.get-box-shadow($elevation, $shadow-color),
153
- $shadow-color-token: null,
154
- )
155
- );
156
- }
157
-
158
- /// Checks whether a list starts wih a given prefix
159
- /// @param {List} $list The list value to check the prefix of.
160
- /// @param {List} $prefix The prefix to check.
161
- /// @return {Boolean} Whether the list starts with the prefix.
162
- @function _is-prefix($list, $prefix) {
163
- @for $i from 1 through list.length($prefix) {
164
- @if list.nth($list, $i) != list.nth($prefix, $i) {
165
- @return false;
166
- }
167
- }
168
- @return true;
169
- }
170
-
171
- /// Gets the supported color variants in the given token set for the given prefix.
172
- /// @param {Map} $tokens The full token map.
173
- /// @param {List} $prefix The component prefix to get color variants for.
174
- /// @return {List} The supported color variants.
175
- @function _supported-color-variants($tokens, $prefix) {
176
- $result: ();
177
- @each $namespace in map.keys($tokens) {
178
- @if list.length($prefix) == list.length($namespace) - 1 and _is-prefix($namespace, $prefix) {
179
- $result: list.append($result, list.nth($namespace, list.length($namespace)), comma);
180
- }
181
- }
182
- @return $result;
183
- }
184
-
185
- /// Gets the token values for the given components prefix with the given options.
186
- /// @param {Map} $tokens The full token map.
187
- /// @param {List} $prefix The component prefix to get the token values for.
188
- /// @param {ArgList} Any additional options
189
- /// Currently the additional supported options are:
190
- // - $color-variant - The color variant to use for the component
191
- // - $emit-overrides-only - Whether to emit *only* the overrides for the
192
- // specific color variant, or all color styles. Defaults to false.
193
- /// @throws If given options are invalid
194
- /// @return {Map} The token values for the requested component.
195
- @function get-tokens-for($tokens, $prefix, $options...) {
196
- $options: sass-utils.validate-keyword-args($options, (color-variant, emit-overrides-only));
197
- @if $tokens == () {
198
- @return ();
199
- }
200
- $values: map.get($tokens, $prefix);
201
- @if ($values == null) {
202
- @return ();
203
- }
204
-
205
- $color-variant: map.get($options, color-variant);
206
- $emit-overrides-only: map.get($options, emit-overrides-only);
207
- @if $color-variant == null {
208
- @return $values;
209
- }
210
- $overrides: map.get($tokens, list.append($prefix, $color-variant));
211
- @if $overrides == null {
212
- $variants: _supported-color-variants($tokens, $prefix);
213
- $secondary-message: if(
214
- $variants == (),
215
- 'Mixin does not support color variants',
216
- 'Supported color variants are: #{$variants}'
217
- );
218
-
219
- @error 'Invalid color variant: #{$color-variant}. #{$secondary-message}.';
220
- }
221
-
222
- @return if($emit-overrides-only, $overrides, map.merge($values, $overrides));
223
- }
224
-
225
103
  /// Emits new token values for the given token overrides.
226
104
  /// Verifies that the overrides passed in are valid tokens.
227
105
  /// New token values are emitted under the current selector or root.
228
- @mixin batch-create-token-values($overrides: (), $namespace-configs...) {
106
+ @mixin batch-create-token-values($overrides: (), $namespace-configs) {
229
107
  @include sass-utils.current-selector-or-root() {
230
108
  $prefixed-name-data: ();
231
109
  $all-names: ();
@@ -233,7 +111,7 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
233
111
  @each $config in $namespace-configs {
234
112
  $namespace: map.get($config, namespace);
235
113
  $prefix: if(map.has-key($config, prefix), map.get($config, prefix), '');
236
- $tokens: _filter-nulls(map.get($config, tokens));
114
+ $tokens: map.get(map.get($config, tokens), all);
237
115
  @each $name, $value in $tokens {
238
116
  $prefixed-name: $prefix + $name;
239
117
  $all-names: list.append($all-names, $prefixed-name, $separator: comma);
@@ -246,62 +124,11 @@ $_system-fallbacks: m3-system.create-system-fallbacks();
246
124
  $data: map.get($prefixed-name-data, $name);
247
125
  $namespace: list.nth($data, 1);
248
126
  $name: list.nth($data, 2);
249
- @include create-token-values(
250
- $namespace,
251
- (
252
- $name: $value,
253
- )
254
- );
127
+ $prefixed-name: $namespace + '-' + $name;
128
+ @include create-token-values(($prefixed-name: $value));
255
129
  } @else {
256
130
  @error #{'Invalid token name `'}#{$name}#{'`. '}#{'Valid tokens are: '}#{$all-names};
257
131
  }
258
132
  }
259
133
  }
260
134
  }
261
-
262
- /// Filters keys with a null value out of the map.
263
- /// @param {Map} $map The map to filter.
264
- /// @return {Map} The given map with all of the null keys filtered out.
265
- @function _filter-nulls($map) {
266
- $result: ();
267
- @each $key, $val in $map {
268
- @if $val != null {
269
- $result: map.set($result, $key, $val);
270
- }
271
- }
272
- @return $result;
273
- }
274
-
275
- /// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
276
- /// @param {List} $prefix The token prefix for the given tokens.
277
- /// @param {Map|(Map, Map)} $values A map of M3 token values for the given prefix.
278
- /// This param may also be a tuple of maps, the first one representing the default M3 token values,
279
- // and the second containing overrides for different color variants.
280
- // Single map example:
281
- // (token1: green, token2: 2px)
282
- // Tuple example:
283
- // (
284
- // (token1: green, token2: 2px),
285
- // (
286
- // secondary: (token1: blue),
287
- // error: (token1: red),
288
- // )
289
- // )
290
- /// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
291
- /// @param {String|null} $variant The name of the variant the token values are for.
292
- /// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
293
- @function namespace-tokens($prefix, $values, $slots, $variant: null) {
294
- $result: ();
295
- @if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
296
- $variants: list.nth($values, 2);
297
- $values: list.nth($values, 1);
298
- @each $variant, $overrides in $variants {
299
-
300
- $result: map.merge($result, namespace-tokens($prefix, $overrides, $slots, $variant));
301
- }
302
- }
303
- $used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
304
- $used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
305
- $prefix: if($variant == null, $prefix, list.append($prefix, $variant));
306
- @return map.merge($result, ($prefix: $used-m3-tokens));
307
- }
@@ -1,8 +1,7 @@
1
- @forward './md-ref-palette' as md-ref-palette-*;
2
- @forward './md-ref-typeface' as md-ref-typeface-*;
3
- @forward './md-sys-color' as md-sys-color-*;
4
- @forward './md-sys-elevation' as md-sys-elevation-*;
5
- @forward './md-sys-motion' as md-sys-motion-*;
6
- @forward './md-sys-shape' as md-sys-shape-*;
7
- @forward './md-sys-state' as md-sys-state-*;
8
- @forward './md-sys-typescale' as md-sys-typescale-*;
1
+ @forward './md-sys-color';
2
+ @forward './md-sys-elevation';
3
+ @forward './md-sys-motion';
4
+ @forward './md-sys-shape';
5
+ @forward './md-sys-state';
6
+ @forward './md-sys-typescale';
7
+ @forward './theme';