@angular/material 18.2.0-next.2 → 18.2.0-rc.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 (417) hide show
  1. package/_index.scss +3 -1
  2. package/button/_button-base.scss +5 -5
  3. package/button-toggle/index.d.ts +14 -2
  4. package/checkbox/_checkbox-common.scss +25 -11
  5. package/chips/index.d.ts +3 -8
  6. package/core/ripple/_ripple.scss +1 -1
  7. package/core/style/_elevation.scss +5 -0
  8. package/core/style/_sass-utils.scss +20 -2
  9. package/core/theming/_definition.scss +2 -0
  10. package/core/tokens/_m3-tokens.scss +106 -10
  11. package/core/tokens/_token-definition.scss +272 -0
  12. package/core/tokens/_token-utils.scss +68 -302
  13. package/core/tokens/m2/mat/_app.scss +4 -4
  14. package/core/tokens/m2/mat/_autocomplete.scss +4 -4
  15. package/core/tokens/m2/mat/_badge.scss +4 -4
  16. package/core/tokens/m2/mat/_bottom-sheet.scss +4 -4
  17. package/core/tokens/m2/mat/_card.scss +4 -4
  18. package/core/tokens/m2/mat/_checkbox.scss +4 -4
  19. package/core/tokens/m2/mat/_chip.scss +4 -4
  20. package/core/tokens/m2/mat/_datepicker.scss +4 -4
  21. package/core/tokens/m2/mat/_dialog.scss +4 -4
  22. package/core/tokens/m2/mat/_divider.scss +4 -4
  23. package/core/tokens/m2/mat/_expansion.scss +4 -4
  24. package/core/tokens/m2/mat/_fab-small.scss +7 -6
  25. package/core/tokens/m2/mat/_fab.scss +7 -6
  26. package/core/tokens/m2/mat/_filled-button.scss +7 -6
  27. package/core/tokens/m2/mat/_form-field.scss +4 -4
  28. package/core/tokens/m2/mat/_full-pseudo-checkbox.scss +4 -4
  29. package/core/tokens/m2/mat/_grid-list.scss +4 -4
  30. package/core/tokens/m2/mat/_icon-button.scss +4 -4
  31. package/core/tokens/m2/mat/_icon.scss +4 -4
  32. package/core/tokens/m2/mat/_legacy-button-toggle.scss +4 -4
  33. package/core/tokens/m2/mat/_list.scss +4 -4
  34. package/core/tokens/m2/mat/_menu.scss +4 -4
  35. package/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss +4 -4
  36. package/core/tokens/m2/mat/_optgroup.scss +4 -4
  37. package/core/tokens/m2/mat/_option.scss +4 -4
  38. package/core/tokens/m2/mat/_outlined-button.scss +4 -4
  39. package/core/tokens/m2/mat/_paginator.scss +4 -4
  40. package/core/tokens/m2/mat/_protected-button.scss +7 -6
  41. package/core/tokens/m2/mat/_radio.scss +4 -4
  42. package/core/tokens/m2/mat/_ripple.scss +4 -4
  43. package/core/tokens/m2/mat/_select.scss +7 -7
  44. package/core/tokens/m2/mat/_sidenav.scss +4 -4
  45. package/core/tokens/m2/mat/_slider.scss +4 -4
  46. package/core/tokens/m2/mat/_snack-bar.scss +4 -4
  47. package/core/tokens/m2/mat/_sort.scss +4 -4
  48. package/core/tokens/m2/mat/_standard-button-toggle.scss +4 -4
  49. package/core/tokens/m2/mat/_stepper.scss +4 -4
  50. package/core/tokens/m2/mat/_switch.scss +4 -4
  51. package/core/tokens/m2/mat/_tab-header-with-background.scss +4 -4
  52. package/core/tokens/m2/mat/_tab-header.scss +4 -4
  53. package/core/tokens/m2/mat/_table.scss +4 -4
  54. package/core/tokens/m2/mat/_text-button.scss +4 -4
  55. package/core/tokens/m2/mat/_toolbar.scss +4 -4
  56. package/core/tokens/m2/mat/_tree.scss +4 -4
  57. package/core/tokens/m2/mdc/_checkbox.scss +6 -6
  58. package/core/tokens/m2/mdc/_chip.scss +4 -4
  59. package/core/tokens/m2/mdc/_circular-progress.scss +4 -4
  60. package/core/tokens/m2/mdc/_dialog.scss +5 -5
  61. package/core/tokens/m2/mdc/_elevated-card.scss +4 -4
  62. package/core/tokens/m2/mdc/_extended-fab.scss +4 -4
  63. package/core/tokens/m2/mdc/_fab-small.scss +4 -4
  64. package/core/tokens/m2/mdc/_fab.scss +4 -4
  65. package/core/tokens/m2/mdc/_filled-button.scss +6 -6
  66. package/core/tokens/m2/mdc/_filled-text-field.scss +7 -7
  67. package/core/tokens/m2/mdc/_icon-button.scss +4 -4
  68. package/core/tokens/m2/mdc/_linear-progress.scss +4 -4
  69. package/core/tokens/m2/mdc/_list.scss +4 -4
  70. package/core/tokens/m2/mdc/_outlined-button.scss +5 -5
  71. package/core/tokens/m2/mdc/_outlined-card.scss +4 -4
  72. package/core/tokens/m2/mdc/_outlined-text-field.scss +7 -7
  73. package/core/tokens/m2/mdc/_plain-tooltip.scss +4 -4
  74. package/core/tokens/m2/mdc/_protected-button.scss +6 -6
  75. package/core/tokens/m2/mdc/_radio.scss +4 -4
  76. package/core/tokens/m2/mdc/_secondary-navigation-tab.scss +4 -4
  77. package/core/tokens/m2/mdc/_slider.scss +4 -4
  78. package/core/tokens/m2/mdc/_snack-bar.scss +4 -4
  79. package/core/tokens/m2/mdc/_switch.scss +4 -4
  80. package/core/tokens/m2/mdc/_tab-indicator.scss +4 -4
  81. package/core/tokens/m2/mdc/_text-button.scss +4 -4
  82. package/core/tokens/m3/mat/_app.scss +6 -3
  83. package/core/tokens/m3/mat/_autocomplete.scss +3 -4
  84. package/core/tokens/m3/mat/_badge.scss +18 -18
  85. package/core/tokens/m3/mat/_bottom-sheet.scss +4 -4
  86. package/core/tokens/m3/mat/_card.scss +4 -4
  87. package/core/tokens/m3/mat/_checkbox.scss +2 -2
  88. package/core/tokens/m3/mat/_chip.scss +5 -5
  89. package/core/tokens/m3/mat/_datepicker.scss +7 -7
  90. package/core/tokens/m3/mat/_dialog.scss +12 -11
  91. package/core/tokens/m3/mat/_divider.scss +3 -3
  92. package/core/tokens/m3/mat/_expansion.scss +7 -7
  93. package/core/tokens/m3/mat/_fab-small.scss +2 -2
  94. package/core/tokens/m3/mat/_fab.scss +2 -2
  95. package/core/tokens/m3/mat/_filled-button.scss +5 -5
  96. package/core/tokens/m3/mat/_form-field.scss +5 -5
  97. package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +2 -2
  98. package/core/tokens/m3/mat/_grid-list.scss +2 -2
  99. package/core/tokens/m3/mat/_icon-button.scss +2 -2
  100. package/core/tokens/m3/mat/_icon.scss +3 -3
  101. package/core/tokens/m3/mat/_list.scss +2 -2
  102. package/core/tokens/m3/mat/_menu.scss +12 -12
  103. package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +2 -2
  104. package/core/tokens/m3/mat/_optgroup.scss +3 -3
  105. package/core/tokens/m3/mat/_option.scss +2 -2
  106. package/core/tokens/m3/mat/_outlined-button.scss +5 -5
  107. package/core/tokens/m3/mat/_paginator.scss +3 -3
  108. package/core/tokens/m3/mat/_protected-button.scss +5 -5
  109. package/core/tokens/m3/mat/_radio.scss +2 -2
  110. package/core/tokens/m3/mat/_ripple.scss +2 -2
  111. package/core/tokens/m3/mat/_select.scss +4 -4
  112. package/core/tokens/m3/mat/_sidenav.scss +6 -5
  113. package/core/tokens/m3/mat/_slider.scss +12 -10
  114. package/core/tokens/m3/mat/_snack-bar.scss +2 -2
  115. package/core/tokens/m3/mat/_sort.scss +2 -2
  116. package/core/tokens/m3/mat/_standard-button-toggle.scss +6 -5
  117. package/core/tokens/m3/mat/_stepper.scss +3 -3
  118. package/core/tokens/m3/mat/_switch.scss +27 -22
  119. package/core/tokens/m3/mat/_tab-header.scss +4 -4
  120. package/core/tokens/m3/mat/_table.scss +7 -6
  121. package/core/tokens/m3/mat/_text-button.scss +6 -6
  122. package/core/tokens/m3/mat/_toolbar.scss +3 -3
  123. package/core/tokens/m3/mat/_tree.scss +2 -2
  124. package/core/tokens/m3/mdc/_checkbox.scss +10 -8
  125. package/core/tokens/m3/mdc/_chip.scss +16 -11
  126. package/core/tokens/m3/mdc/_circular-progress.scss +5 -4
  127. package/core/tokens/m3/mdc/_dialog.scss +4 -4
  128. package/core/tokens/m3/mdc/_elevated-card.scss +3 -3
  129. package/core/tokens/m3/mdc/_extended-fab.scss +9 -5
  130. package/core/tokens/m3/mdc/_fab-small.scss +8 -5
  131. package/core/tokens/m3/mdc/_fab.scss +6 -5
  132. package/core/tokens/m3/mdc/_filled-button.scss +6 -6
  133. package/core/tokens/m3/mdc/_filled-text-field.scss +7 -6
  134. package/core/tokens/m3/mdc/_icon-button.scss +10 -8
  135. package/core/tokens/m3/mdc/_linear-progress.scss +5 -4
  136. package/core/tokens/m3/mdc/_list.scss +3 -3
  137. package/core/tokens/m3/mdc/_outlined-button.scss +7 -6
  138. package/core/tokens/m3/mdc/_outlined-card.scss +3 -3
  139. package/core/tokens/m3/mdc/_outlined-text-field.scss +7 -6
  140. package/core/tokens/m3/mdc/_plain-tooltip.scss +3 -3
  141. package/core/tokens/m3/mdc/_protected-button.scss +6 -6
  142. package/core/tokens/m3/mdc/_radio.scss +4 -3
  143. package/core/tokens/m3/mdc/_secondary-navigation-tab.scss +4 -3
  144. package/core/tokens/m3/mdc/_slider.scss +4 -3
  145. package/core/tokens/m3/mdc/_snack-bar.scss +3 -3
  146. package/core/tokens/m3/mdc/_switch.scss +4 -3
  147. package/core/tokens/m3/mdc/_tab-indicator.scss +5 -4
  148. package/core/tokens/m3/mdc/_text-button.scss +6 -6
  149. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  150. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  151. package/esm2022/autocomplete/autocomplete.mjs +5 -5
  152. package/esm2022/autocomplete/module.mjs +5 -5
  153. package/esm2022/badge/badge-module.mjs +5 -5
  154. package/esm2022/badge/badge.mjs +8 -8
  155. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +5 -5
  156. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  157. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  158. package/esm2022/button/button-base.mjs +7 -7
  159. package/esm2022/button/button.mjs +9 -9
  160. package/esm2022/button/fab.mjs +17 -17
  161. package/esm2022/button/icon-button.mjs +9 -9
  162. package/esm2022/button/module.mjs +5 -5
  163. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  164. package/esm2022/button-toggle/button-toggle.mjs +37 -8
  165. package/esm2022/button-toggle/testing/button-toggle-harness.mjs +3 -3
  166. package/esm2022/card/card.mjs +44 -44
  167. package/esm2022/card/module.mjs +5 -5
  168. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  169. package/esm2022/checkbox/checkbox.mjs +6 -6
  170. package/esm2022/checkbox/module.mjs +9 -9
  171. package/esm2022/chips/chip-action.mjs +4 -4
  172. package/esm2022/chips/chip-edit-input.mjs +4 -4
  173. package/esm2022/chips/chip-grid.mjs +4 -4
  174. package/esm2022/chips/chip-icons.mjs +10 -10
  175. package/esm2022/chips/chip-input.mjs +4 -4
  176. package/esm2022/chips/chip-listbox.mjs +4 -4
  177. package/esm2022/chips/chip-option.mjs +6 -6
  178. package/esm2022/chips/chip-row.mjs +7 -7
  179. package/esm2022/chips/chip-set.mjs +4 -4
  180. package/esm2022/chips/chip.mjs +7 -28
  181. package/esm2022/chips/module.mjs +5 -5
  182. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  183. package/esm2022/core/datetime/index.mjs +9 -9
  184. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  185. package/esm2022/core/error/error-options.mjs +7 -7
  186. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  187. package/esm2022/core/line/line.mjs +8 -8
  188. package/esm2022/core/option/index.mjs +5 -5
  189. package/esm2022/core/option/optgroup.mjs +5 -5
  190. package/esm2022/core/option/option.mjs +5 -5
  191. package/esm2022/core/private/ripple-loader.mjs +4 -4
  192. package/esm2022/core/ripple/index.mjs +5 -5
  193. package/esm2022/core/ripple/ripple.mjs +4 -4
  194. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  195. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +5 -5
  196. package/esm2022/core/version.mjs +1 -1
  197. package/esm2022/datepicker/calendar-body.mjs +5 -5
  198. package/esm2022/datepicker/calendar.mjs +8 -8
  199. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  200. package/esm2022/datepicker/date-range-input.mjs +6 -6
  201. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  202. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  203. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  204. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  205. package/esm2022/datepicker/datepicker-base.mjs +8 -8
  206. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  207. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  208. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  209. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  210. package/esm2022/datepicker/datepicker-toggle.mjs +8 -8
  211. package/esm2022/datepicker/datepicker.mjs +4 -4
  212. package/esm2022/datepicker/month-view.mjs +4 -4
  213. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  214. package/esm2022/datepicker/year-view.mjs +4 -4
  215. package/esm2022/dialog/dialog-container.mjs +5 -5
  216. package/esm2022/dialog/dialog-content-directives.mjs +16 -16
  217. package/esm2022/dialog/dialog.mjs +4 -4
  218. package/esm2022/dialog/module.mjs +5 -5
  219. package/esm2022/divider/divider-module.mjs +5 -5
  220. package/esm2022/divider/divider.mjs +5 -5
  221. package/esm2022/expansion/accordion.mjs +4 -4
  222. package/esm2022/expansion/expansion-module.mjs +5 -5
  223. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  224. package/esm2022/expansion/expansion-panel-header.mjs +11 -11
  225. package/esm2022/expansion/expansion-panel.mjs +9 -9
  226. package/esm2022/form-field/directives/error.mjs +4 -4
  227. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  228. package/esm2022/form-field/directives/hint.mjs +4 -4
  229. package/esm2022/form-field/directives/label.mjs +4 -4
  230. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  231. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  232. package/esm2022/form-field/directives/prefix.mjs +4 -4
  233. package/esm2022/form-field/directives/suffix.mjs +4 -4
  234. package/esm2022/form-field/form-field-control.mjs +4 -4
  235. package/esm2022/form-field/form-field.mjs +6 -6
  236. package/esm2022/form-field/module.mjs +5 -5
  237. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  238. package/esm2022/grid-list/grid-list.mjs +6 -6
  239. package/esm2022/grid-list/grid-tile.mjs +17 -17
  240. package/esm2022/icon/icon-module.mjs +5 -5
  241. package/esm2022/icon/icon-registry.mjs +4 -4
  242. package/esm2022/icon/icon.mjs +4 -4
  243. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  244. package/esm2022/input/input.mjs +4 -4
  245. package/esm2022/input/module.mjs +5 -5
  246. package/esm2022/list/action-list.mjs +5 -5
  247. package/esm2022/list/list-base.mjs +7 -7
  248. package/esm2022/list/list-item-sections.mjs +19 -19
  249. package/esm2022/list/list-module.mjs +5 -5
  250. package/esm2022/list/list-option.mjs +6 -6
  251. package/esm2022/list/list.mjs +8 -8
  252. package/esm2022/list/nav-list.mjs +5 -5
  253. package/esm2022/list/selection-list.mjs +6 -6
  254. package/esm2022/list/subheader.mjs +4 -4
  255. package/esm2022/menu/menu-content.mjs +4 -4
  256. package/esm2022/menu/menu-item.mjs +4 -4
  257. package/esm2022/menu/menu-trigger.mjs +4 -4
  258. package/esm2022/menu/menu.mjs +5 -5
  259. package/esm2022/menu/module.mjs +5 -5
  260. package/esm2022/paginator/module.mjs +5 -5
  261. package/esm2022/paginator/paginator-intl.mjs +4 -4
  262. package/esm2022/paginator/paginator.mjs +5 -5
  263. package/esm2022/progress-bar/module.mjs +5 -5
  264. package/esm2022/progress-bar/progress-bar.mjs +5 -5
  265. package/esm2022/progress-spinner/module.mjs +5 -5
  266. package/esm2022/progress-spinner/progress-spinner.mjs +5 -5
  267. package/esm2022/radio/module.mjs +5 -5
  268. package/esm2022/radio/radio.mjs +62 -24
  269. package/esm2022/select/module.mjs +5 -5
  270. package/esm2022/select/select.mjs +9 -9
  271. package/esm2022/sidenav/drawer.mjs +13 -13
  272. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  273. package/esm2022/sidenav/sidenav.mjs +12 -12
  274. package/esm2022/slide-toggle/module.mjs +9 -9
  275. package/esm2022/slide-toggle/slide-toggle-config.mjs +2 -2
  276. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  277. package/esm2022/slide-toggle/slide-toggle.mjs +17 -11
  278. package/esm2022/slider/module.mjs +5 -5
  279. package/esm2022/slider/slider-input.mjs +7 -7
  280. package/esm2022/slider/slider-thumb.mjs +4 -4
  281. package/esm2022/slider/slider.mjs +5 -5
  282. package/esm2022/snack-bar/module.mjs +5 -5
  283. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  284. package/esm2022/snack-bar/snack-bar-container.mjs +5 -5
  285. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  286. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  287. package/esm2022/sort/sort-header-intl.mjs +4 -4
  288. package/esm2022/sort/sort-header.mjs +5 -5
  289. package/esm2022/sort/sort-module.mjs +5 -5
  290. package/esm2022/sort/sort.mjs +4 -4
  291. package/esm2022/stepper/step-content.mjs +4 -4
  292. package/esm2022/stepper/step-header.mjs +5 -5
  293. package/esm2022/stepper/step-label.mjs +4 -4
  294. package/esm2022/stepper/stepper-button.mjs +7 -7
  295. package/esm2022/stepper/stepper-icon.mjs +4 -4
  296. package/esm2022/stepper/stepper-intl.mjs +4 -4
  297. package/esm2022/stepper/stepper-module.mjs +5 -5
  298. package/esm2022/stepper/stepper.mjs +8 -8
  299. package/esm2022/table/cell.mjs +22 -22
  300. package/esm2022/table/module.mjs +5 -5
  301. package/esm2022/table/row.mjs +22 -22
  302. package/esm2022/table/table.mjs +9 -9
  303. package/esm2022/table/text-column.mjs +4 -4
  304. package/esm2022/tabs/ink-bar.mjs +4 -4
  305. package/esm2022/tabs/module.mjs +5 -5
  306. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  307. package/esm2022/tabs/tab-body.mjs +7 -7
  308. package/esm2022/tabs/tab-content.mjs +4 -4
  309. package/esm2022/tabs/tab-group.mjs +6 -6
  310. package/esm2022/tabs/tab-header.mjs +5 -5
  311. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  312. package/esm2022/tabs/tab-label.mjs +4 -4
  313. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +12 -12
  314. package/esm2022/tabs/tab.mjs +4 -4
  315. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  316. package/esm2022/toolbar/toolbar.mjs +8 -8
  317. package/esm2022/tooltip/module.mjs +5 -5
  318. package/esm2022/tooltip/tooltip.mjs +41 -25
  319. package/esm2022/tree/node.mjs +10 -10
  320. package/esm2022/tree/outlet.mjs +4 -4
  321. package/esm2022/tree/padding.mjs +4 -4
  322. package/esm2022/tree/toggle.mjs +4 -4
  323. package/esm2022/tree/tree-module.mjs +5 -5
  324. package/esm2022/tree/tree.mjs +5 -5
  325. package/fesm2022/autocomplete.mjs +14 -14
  326. package/fesm2022/autocomplete.mjs.map +1 -1
  327. package/fesm2022/badge.mjs +11 -11
  328. package/fesm2022/badge.mjs.map +1 -1
  329. package/fesm2022/bottom-sheet.mjs +11 -11
  330. package/fesm2022/bottom-sheet.mjs.map +1 -1
  331. package/fesm2022/button-toggle/testing.mjs +2 -2
  332. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  333. package/fesm2022/button-toggle.mjs +40 -11
  334. package/fesm2022/button-toggle.mjs.map +1 -1
  335. package/fesm2022/button.mjs +42 -42
  336. package/fesm2022/button.mjs.map +1 -1
  337. package/fesm2022/card.mjs +47 -47
  338. package/fesm2022/card.mjs.map +1 -1
  339. package/fesm2022/checkbox.mjs +16 -16
  340. package/fesm2022/checkbox.mjs.map +1 -1
  341. package/fesm2022/chips.mjs +48 -69
  342. package/fesm2022/chips.mjs.map +1 -1
  343. package/fesm2022/core.mjs +62 -62
  344. package/fesm2022/core.mjs.map +1 -1
  345. package/fesm2022/datepicker.mjs +88 -88
  346. package/fesm2022/datepicker.mjs.map +1 -1
  347. package/fesm2022/dialog.mjs +26 -26
  348. package/fesm2022/dialog.mjs.map +1 -1
  349. package/fesm2022/divider.mjs +8 -8
  350. package/fesm2022/divider.mjs.map +1 -1
  351. package/fesm2022/expansion.mjs +28 -28
  352. package/fesm2022/expansion.mjs.map +1 -1
  353. package/fesm2022/form-field.mjs +36 -36
  354. package/fesm2022/form-field.mjs.map +1 -1
  355. package/fesm2022/grid-list.mjs +25 -25
  356. package/fesm2022/grid-list.mjs.map +1 -1
  357. package/fesm2022/icon/testing.mjs +7 -7
  358. package/fesm2022/icon/testing.mjs.map +1 -1
  359. package/fesm2022/icon.mjs +10 -10
  360. package/fesm2022/icon.mjs.map +1 -1
  361. package/fesm2022/input.mjs +7 -7
  362. package/fesm2022/input.mjs.map +1 -1
  363. package/fesm2022/list.mjs +56 -56
  364. package/fesm2022/list.mjs.map +1 -1
  365. package/fesm2022/menu.mjs +17 -17
  366. package/fesm2022/menu.mjs.map +1 -1
  367. package/fesm2022/paginator.mjs +11 -11
  368. package/fesm2022/paginator.mjs.map +1 -1
  369. package/fesm2022/progress-bar.mjs +8 -8
  370. package/fesm2022/progress-bar.mjs.map +1 -1
  371. package/fesm2022/progress-spinner.mjs +8 -8
  372. package/fesm2022/progress-spinner.mjs.map +1 -1
  373. package/fesm2022/radio.mjs +65 -27
  374. package/fesm2022/radio.mjs.map +1 -1
  375. package/fesm2022/select.mjs +12 -12
  376. package/fesm2022/select.mjs.map +1 -1
  377. package/fesm2022/sidenav.mjs +27 -27
  378. package/fesm2022/sidenav.mjs.map +1 -1
  379. package/fesm2022/slide-toggle.mjs +28 -22
  380. package/fesm2022/slide-toggle.mjs.map +1 -1
  381. package/fesm2022/slider.mjs +17 -17
  382. package/fesm2022/slider.mjs.map +1 -1
  383. package/fesm2022/snack-bar.mjs +23 -23
  384. package/fesm2022/snack-bar.mjs.map +1 -1
  385. package/fesm2022/sort.mjs +14 -14
  386. package/fesm2022/sort.mjs.map +1 -1
  387. package/fesm2022/stepper.mjs +33 -33
  388. package/fesm2022/stepper.mjs.map +1 -1
  389. package/fesm2022/table.mjs +57 -57
  390. package/fesm2022/table.mjs.map +1 -1
  391. package/fesm2022/tabs.mjs +48 -48
  392. package/fesm2022/tabs.mjs.map +1 -1
  393. package/fesm2022/toolbar.mjs +11 -11
  394. package/fesm2022/toolbar.mjs.map +1 -1
  395. package/fesm2022/tooltip.mjs +44 -28
  396. package/fesm2022/tooltip.mjs.map +1 -1
  397. package/fesm2022/tree.mjs +26 -26
  398. package/fesm2022/tree.mjs.map +1 -1
  399. package/form-field/_mdc-text-field-density-overrides.scss +4 -4
  400. package/form-field/_mdc-text-field-structure.scss +6 -6
  401. package/package.json +2 -2
  402. package/prebuilt-themes/azure-blue.css +1 -1
  403. package/prebuilt-themes/cyan-orange.css +1 -1
  404. package/prebuilt-themes/deeppurple-amber.css +1 -1
  405. package/prebuilt-themes/indigo-pink.css +1 -1
  406. package/prebuilt-themes/magenta-violet.css +1 -1
  407. package/prebuilt-themes/pink-bluegrey.css +1 -1
  408. package/prebuilt-themes/purple-green.css +1 -1
  409. package/prebuilt-themes/rose-red.css +1 -1
  410. package/radio/_radio-common.scss +26 -8
  411. package/radio/index.d.ts +19 -5
  412. package/schematics/ng-add/index.js +1 -1
  413. package/schematics/ng-add/index.mjs +1 -1
  414. package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
  415. package/schematics/ng-update/index_bundled.js +31 -31
  416. package/slide-toggle/index.d.ts +6 -1
  417. package/tooltip/index.d.ts +3 -0
package/_index.scss CHANGED
@@ -18,7 +18,9 @@
18
18
  @forward './core/typography/typography' show typography-hierarchy;
19
19
  @forward './core/typography/typography-utils' show font-shorthand;
20
20
  @forward './core/tokens/m2' show m2-tokens-from-theme;
21
- @forward './core/tokens/m3-tokens' show system-level-colors, system-level-typography;
21
+ @forward './core/tokens/m3-tokens' show system-level-colors,
22
+ system-level-typography, system-level-elevation, system-level-shape,
23
+ system-level-motion, system-level-state;
22
24
 
23
25
  // Private/Internal
24
26
  @forward './core/density/private/all-density' show all-component-densities;
@@ -112,7 +112,7 @@
112
112
  // Adds an elevation shadow to a button.
113
113
  @mixin mat-private-button-elevation($token-name) {
114
114
  // MDC outputs a variable that is the same as the token name, but suffixed with `-shadow`.
115
- box-shadow: var(#{token-utils.get-token-variable($token-name) + '-shadow'});
115
+ box-shadow: token-utils.get-token-variable($token-name + '-shadow');
116
116
  }
117
117
 
118
118
  @mixin mat-private-button-touch-target($is-square, $prefix, $slots) {
@@ -139,14 +139,14 @@
139
139
 
140
140
  @mixin mat-private-button-horizontal-layout($prefix, $slots, $has-with-icon-padding) {
141
141
  @include token-utils.use-tokens($prefix, $slots) {
142
- $icon-spacing: token-utils.get-token-variable-reference(icon-spacing, true);
143
- $icon-offset: token-utils.get-token-variable-reference(icon-offset, true);
144
- $horizontal-padding: token-utils.get-token-variable-reference(horizontal-padding, true);
142
+ $icon-spacing: token-utils.get-token-variable(icon-spacing, true);
143
+ $icon-offset: token-utils.get-token-variable(icon-offset, true);
144
+ $horizontal-padding: token-utils.get-token-variable(horizontal-padding, true);
145
145
  padding: 0 $horizontal-padding;
146
146
 
147
147
  @if ($has-with-icon-padding) {
148
148
  $with-icon-horizontal-padding:
149
- token-utils.get-token-variable-reference(with-icon-horizontal-padding, true);
149
+ token-utils.get-token-variable(with-icon-horizontal-padding, true);
150
150
 
151
151
  // stylelint-disable-next-line selector-class-pattern
152
152
  &:has(.material-icons, mat-icon, [matButtonIcon]) {
@@ -95,6 +95,10 @@ export declare class MatButtonToggle implements OnInit, AfterViewInit, OnDestroy
95
95
  get disabled(): boolean;
96
96
  set disabled(value: boolean);
97
97
  private _disabled;
98
+ /** Whether the button should remain interactive when it is disabled. */
99
+ get disabledInteractive(): boolean;
100
+ set disabledInteractive(value: boolean);
101
+ private _disabledInteractive;
98
102
  /** Event emitted when the group value changes. */
99
103
  readonly change: EventEmitter<MatButtonToggleChange>;
100
104
  constructor(toggleGroup: MatButtonToggleGroup, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _focusMonitor: FocusMonitor, defaultTabIndex: string, defaultOptions?: MatButtonToggleDefaultOptions);
@@ -116,10 +120,11 @@ export declare class MatButtonToggle implements OnInit, AfterViewInit, OnDestroy
116
120
  /** Whether the toggle is in single selection mode. */
117
121
  isSingleSelector(): boolean;
118
122
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonToggle, [{ optional: true; }, null, null, null, { attribute: "tabindex"; }, { optional: true; }]>;
119
- static ɵcmp: i0.ɵɵComponentDeclaration<MatButtonToggle, "mat-button-toggle", ["matButtonToggle"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "change": "change"; }, never, ["*"], true, never>;
123
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatButtonToggle, "mat-button-toggle", ["matButtonToggle"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, { "change": "change"; }, never, ["*"], true, never>;
120
124
  static ngAcceptInputType_disableRipple: unknown;
121
125
  static ngAcceptInputType_checked: unknown;
122
126
  static ngAcceptInputType_disabled: unknown;
127
+ static ngAcceptInputType_disabledInteractive: unknown;
123
128
  }
124
129
 
125
130
  /** Possible appearance styles for the button toggle. */
@@ -152,6 +157,8 @@ export declare interface MatButtonToggleDefaultOptions {
152
157
  hideSingleSelectionIndicator?: boolean;
153
158
  /** Whether icon indicators should be hidden for multiple-selection button toggle groups. */
154
159
  hideMultipleSelectionIndicator?: boolean;
160
+ /** Whether disabled toggle buttons should be interactive. */
161
+ disabledInteractive?: boolean;
155
162
  }
156
163
 
157
164
  /** Exclusive selection button toggle group that behaves like a radio-button group. */
@@ -160,6 +167,7 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
160
167
  private _dir?;
161
168
  private _multiple;
162
169
  private _disabled;
170
+ private _disabledInteractive;
163
171
  private _selectionModel;
164
172
  /**
165
173
  * Reference to the raw value that the consumer tried to assign. The real
@@ -202,6 +210,9 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
202
210
  /** Whether multiple button toggle group is disabled. */
203
211
  get disabled(): boolean;
204
212
  set disabled(value: boolean);
213
+ /** Whether buttons in the group should be interactive while they're disabled. */
214
+ get disabledInteractive(): boolean;
215
+ set disabledInteractive(value: boolean);
205
216
  /** The layout direction of the toggle button group. */
206
217
  get dir(): Direction;
207
218
  /** Event emitted when the group's value changes. */
@@ -256,10 +267,11 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
256
267
  /** Marks all of the child button toggles to be checked. */
257
268
  private _markButtonsForCheck;
258
269
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonToggleGroup, [null, { optional: true; }, { optional: true; }]>;
259
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonToggleGroup, "mat-button-toggle-group", ["matButtonToggleGroup"], { "appearance": { "alias": "appearance"; "required": false; }; "name": { "alias": "name"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, ["_buttonToggles"], never, true, never>;
270
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonToggleGroup, "mat-button-toggle-group", ["matButtonToggleGroup"], { "appearance": { "alias": "appearance"; "required": false; }; "name": { "alias": "name"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, ["_buttonToggles"], never, true, never>;
260
271
  static ngAcceptInputType_vertical: unknown;
261
272
  static ngAcceptInputType_multiple: unknown;
262
273
  static ngAcceptInputType_disabled: unknown;
274
+ static ngAcceptInputType_disabledInteractive: unknown;
263
275
  static ngAcceptInputType_hideSingleSelectionIndicator: unknown;
264
276
  static ngAcceptInputType_hideMultipleSelectionIndicator: unknown;
265
277
  }
@@ -2,6 +2,7 @@
2
2
  @use '@angular/cdk';
3
3
  @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
4
4
  @use '../core/tokens/token-utils';
5
+ @use '../core/style/vendor-prefixes';
5
6
 
6
7
  $_path-length: 29.7833385;
7
8
  $_transition-duration: 90ms;
@@ -31,10 +32,9 @@ $_fallback-size: 40px;
31
32
  vertical-align: bottom;
32
33
 
33
34
  @include token-utils.use-tokens($prefix, $slots) {
34
- $layer-size: token-utils.get-token-variable(state-layer-size);
35
- padding: calc((var(#{$layer-size}, #{$_fallback-size}) - #{$_icon-size}) / 2);
36
- margin: calc((var(#{$layer-size}, #{$_fallback-size}) -
37
- var(#{$layer-size}, #{$_fallback-size})) / 2);
35
+ $layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
36
+ padding: calc((#{$layer-size} - #{$_icon-size}) / 2);
37
+ margin: calc((#{$layer-size} - #{$layer-size}) / 2);
38
38
 
39
39
  @if ($include-state-layer-styles) {
40
40
  @include _state-layer-styles;
@@ -51,11 +51,10 @@ $_fallback-size: 40px;
51
51
  cursor: inherit;
52
52
 
53
53
  @include token-utils.use-tokens($prefix, $slots) {
54
- $layer-size: token-utils.get-token-variable(state-layer-size);
55
- $offset: calc((var(#{$layer-size}, #{$_fallback-size}) -
56
- var(#{$layer-size}, #{$_fallback-size})) / 2);
57
- width: var(#{$layer-size}, #{$_fallback-size});
58
- height: var(#{$layer-size}, #{$_fallback-size});
54
+ $layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
55
+ $offset: calc((#{$layer-size} - #{$layer-size}) / 2);
56
+ width: $layer-size;
57
+ height: $layer-size;
59
58
  top: $offset;
60
59
  right: $offset;
61
60
  left: $offset;
@@ -66,6 +65,10 @@ $_fallback-size: 40px;
66
65
  .mdc-checkbox--disabled {
67
66
  cursor: default;
68
67
  pointer-events: none;
68
+
69
+ @include cdk.high-contrast(active, off) {
70
+ opacity: 0.5;
71
+ }
69
72
  }
70
73
 
71
74
  .mdc-checkbox__background {
@@ -84,9 +87,12 @@ $_fallback-size: 40px;
84
87
  transition: background-color $_transition-duration $_exit-curve,
85
88
  border-color $_transition-duration $_exit-curve;
86
89
 
90
+ // Force browser to show background-color when using the print function
91
+ @include vendor-prefixes.color-adjust(exact);
92
+
87
93
  @include token-utils.use-tokens($prefix, $slots) {
88
- $layer-size: token-utils.get-token-variable(state-layer-size);
89
- $offset: calc((var(#{$layer-size}, $_fallback-size) - #{$_icon-size}) / 2);
94
+ $layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
95
+ $offset: calc((#{$layer-size} - #{$_icon-size}) / 2);
90
96
 
91
97
  @include token-utils.create-token-slot(border-color, unselected-icon-color);
92
98
  top: $offset;
@@ -169,6 +175,10 @@ $_fallback-size: 40px;
169
175
  // Always apply the color since the element becomes `opacity: 0`
170
176
  // when unchecked. This makes the animation look better.
171
177
  @include token-utils.create-token-slot(color, selected-checkmark-color);
178
+
179
+ @include cdk.high-contrast(active, off) {
180
+ color: CanvasText;
181
+ }
172
182
  }
173
183
  }
174
184
 
@@ -177,6 +187,10 @@ $_fallback-size: 40px;
177
187
  &, &.mat-mdc-checkbox-disabled-interactive {
178
188
  .mdc-checkbox__checkmark {
179
189
  @include token-utils.create-token-slot(color, disabled-selected-checkmark-color);
190
+
191
+ @include cdk.high-contrast(active, off) {
192
+ color: CanvasText;
193
+ }
180
194
  }
181
195
  }
182
196
  }
package/chips/index.d.ts CHANGED
@@ -205,8 +205,6 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
205
205
  disableRipple: boolean;
206
206
  /** Whether the chip is disabled. */
207
207
  disabled: boolean;
208
- /** Tab index of the chip. */
209
- tabIndex: number;
210
208
  /** Emitted when a chip is to be removed. */
211
209
  readonly removed: EventEmitter<MatChipEvent>;
212
210
  /** Emitted when the chip is destroyed. */
@@ -234,7 +232,7 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
234
232
  */
235
233
  _rippleLoader: MatRippleLoader;
236
234
  protected _injector: Injector;
237
- constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined, tabIndex?: string);
235
+ constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined);
238
236
  ngOnInit(): void;
239
237
  ngAfterViewInit(): void;
240
238
  ngAfterContentInit(): void;
@@ -260,17 +258,14 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
260
258
  _getActions(): MatChipAction[];
261
259
  /** Handles interactions with the primary action of the chip. */
262
260
  _handlePrimaryActionInteraction(): void;
263
- /** Gets the tabindex of the chip. */
264
- _getTabIndex(): number | null;
265
261
  /** Starts the focus monitoring process on the chip. */
266
262
  private _monitorFocus;
267
- static ɵfac: i0.ɵɵFactoryDeclaration<MatChip, [null, null, null, null, null, { optional: true; }, { optional: true; }, { attribute: "tabindex"; }]>;
268
- static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, { "removed": "removed"; "destroyed": "destroyed"; }, ["leadingIcon", "trailingIcon", "removeIcon", "_allLeadingIcons", "_allTrailingIcons", "_allRemoveIcons"], ["mat-chip-avatar, [matChipAvatar]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
263
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatChip, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
264
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "removed": "removed"; "destroyed": "destroyed"; }, ["leadingIcon", "trailingIcon", "removeIcon", "_allLeadingIcons", "_allTrailingIcons", "_allRemoveIcons"], ["mat-chip-avatar, [matChipAvatar]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
269
265
  static ngAcceptInputType_removable: unknown;
270
266
  static ngAcceptInputType_highlighted: unknown;
271
267
  static ngAcceptInputType_disableRipple: unknown;
272
268
  static ngAcceptInputType_disabled: unknown;
273
- static ngAcceptInputType_tabIndex: unknown;
274
269
  }
275
270
 
276
271
  /**
@@ -40,7 +40,7 @@
40
40
  @include token-utils.use-tokens(
41
41
  tokens-mat-ripple.$prefix, tokens-mat-ripple.get-token-slots()) {
42
42
  // We have to emit a fallback value here, because some internal builds depend on it.
43
- background-color: var(#{token-utils.get-token-variable(color)}, rgba(#000, 0.1));
43
+ background-color: token-utils.get-token-variable(color, $fallback: rgba(#000, 0.1));
44
44
  }
45
45
 
46
46
  // In high contrast mode the ripple is opaque, causing it to obstruct the content.
@@ -3,6 +3,7 @@
3
3
  @use 'sass:meta';
4
4
  @use 'sass:string';
5
5
  @use './variables';
6
+ @use './sass-utils';
6
7
 
7
8
  $_umbra-opacity: 0.2;
8
9
  $_penumbra-opacity: 0.14;
@@ -143,6 +144,10 @@ $prefix: 'mat-elevation-z';
143
144
  @return null;
144
145
  }
145
146
 
147
+ @if (sass-utils.is-css-var-name($zValue)) {
148
+ @return $zValue;
149
+ }
150
+
146
151
  @if meta.type-of($zValue) != number or not math.is-unitless($zValue) {
147
152
  @error '$zValue must be a unitless number, but received `#{$zValue}`';
148
153
  }
@@ -1,4 +1,5 @@
1
1
  @use 'sass:color';
2
+ @use 'sass:string';
2
3
  @use 'sass:list';
3
4
  @use 'sass:map';
4
5
  @use 'sass:meta';
@@ -64,12 +65,23 @@ $use-system-typography-variables: false;
64
65
  /// A version of the Sass `color.change` function that is safe ot use with CSS variables.
65
66
  @function safe-color-change($color, $args...) {
66
67
  $args: meta.keywords($args);
68
+ $use-color-mix: $use-system-color-variables or
69
+ (is-css-var-name($color) and string.index($color, '--mat') == 1);
67
70
  @if (meta.type-of($color) == 'color') {
68
71
  @return color.change($color, $args...);
69
72
  }
70
- @else if ($color != null and map.get($args, alpha) != null and $use-system-color-variables) {
73
+ @else if ($color != null and
74
+ map.get($args, alpha) != null and $use-color-mix) {
71
75
  $opacity: map.get($args, alpha);
72
- @return #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)};
76
+ @if meta.type-of($opacity) == number {
77
+ $opacity: ($opacity * 100) + '%';
78
+ }
79
+
80
+ @if (is-css-var-name($color)) {
81
+ $color: var($color);
82
+ }
83
+
84
+ @return #{color-mix(in srgb, #{$color} #{$opacity}, transparent)};
73
85
  }
74
86
  @return $color;
75
87
  }
@@ -91,3 +103,9 @@ $use-system-typography-variables: false;
91
103
  }
92
104
  @return $kwargs;
93
105
  }
106
+
107
+ // Returns whether the $value is a CSS variable name based on whether it's a string prefixed
108
+ // by "--".
109
+ @function is-css-var-name($value) {
110
+ @return meta.type-of($value) == string and string.index($value, '--') == 1;
111
+ }
@@ -55,6 +55,7 @@ $theme-version: 1;
55
55
  neutral-variant: map.get($primary, neutral-variant),
56
56
  error: map.get($primary, error),
57
57
  ),
58
+ color-system-variables-prefix: $system-variables-prefix,
58
59
  color-tokens: m3-tokens.generate-color-tokens(
59
60
  $type, $primary, $tertiary, map.get($primary, error), $system-variables-prefix)
60
61
  )
@@ -88,6 +89,7 @@ $theme-version: 1;
88
89
  medium: $medium,
89
90
  regular: $regular,
90
91
  ),
92
+ typography-system-variables-prefix: $system-variables-prefix,
91
93
  typography-tokens: m3-tokens.generate-typography-tokens(
92
94
  $brand, $plain, $bold, $medium, $regular, $system-variables-prefix)
93
95
  )
@@ -4,9 +4,17 @@
4
4
  @use './m3';
5
5
  @use './m3/definitions' as m3-token-definitions;
6
6
  @use '../tokens/m2' as m2-tokens;
7
+ @use '../style/elevation';
7
8
  @use './density';
8
9
  @use './format-tokens';
9
10
 
11
+ // Default system level prefix to use when directly calling the `system-level-*` mixins
12
+ $_system-level-prefix: sys;
13
+
14
+ // Prefix used for component token fallback variables, e.g.
15
+ // `color: var(--mdc-text-button-label-text-color, var(--mat-app-primary));`
16
+ $_system-fallback-prefix: mat-app;
17
+
10
18
  /// Generates tokens for the given palette with the given prefix.
11
19
  /// @param {Map} $palette The palette to generate tokens for
12
20
  /// @param {String} $prefix The key prefix used to name the tokens
@@ -86,8 +94,9 @@ $_cached-token-slots: null;
86
94
  /// Generates a set of namespaced tokens for all components.
87
95
  /// @param {Map} $systems The MDC system tokens
88
96
  /// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
97
+ /// @param {Boolean} $include-density Whether to include density tokens
89
98
  /// @return {Map} A map of namespaced tokens
90
- @function _generate-tokens($systems, $include-non-systemized: false) {
99
+ @function _generate-tokens($systems, $include-non-systemized: false, $include-density: false) {
91
100
  $systems: map.merge((
92
101
  md-sys-color: (),
93
102
  md-sys-elevation: (),
@@ -116,16 +125,63 @@ $_cached-token-slots: null;
116
125
  // Strip out tokens that are systemized by our made up density system.
117
126
  @each $namespace, $tokens in $result {
118
127
  @each $token, $value in $tokens {
119
- @if density.is-systemized($namespace, $token) {
128
+ @if density.is-systemized($namespace, $token) and not $include-density {
120
129
  $tokens: map.remove($tokens, $token);
121
130
  }
122
131
  }
123
132
  $result: map.set($result, $namespace, $tokens);
124
133
  }
134
+
125
135
  @return $result;
126
136
  }
127
137
 
128
- @mixin system-level-colors($theme, $overrides: ()) {
138
+ // Return a new map where the values are the same as the provided map's
139
+ // keys, prefixed with "--mat-app-". For example:
140
+ // (key1: '', key2: '') --> (key1: --mat-app-key1, key2: --mat-app-key2)
141
+ @function _create-system-app-vars-map($map) {
142
+ $new-map: ();
143
+ @each $key, $value in $map {
144
+ $new-map: map.set($new-map, $key, --#{$_system-fallback-prefix}-#{$key});
145
+ }
146
+ @return $new-map;
147
+ }
148
+
149
+ // Create a components tokens map where values are based on
150
+ // system fallback variables referencing Material's system keys.
151
+ // Includes density token fallbacks where density is 0.
152
+ @function create-system-fallbacks() {
153
+ $app-vars: (
154
+ 'md-sys-color':
155
+ _create-system-app-vars-map(m3-token-definitions.md-sys-color-values-light()),
156
+ 'md-sys-typescale':
157
+ _create-system-app-vars-map(m3-token-definitions.md-sys-typescale-values()),
158
+ 'md-sys-elevation':
159
+ _create-system-app-vars-map(m3-token-definitions.md-sys-elevation-values()),
160
+ 'md-sys-state':
161
+ _create-system-app-vars-map(m3-token-definitions.md-sys-state-values()),
162
+ 'md-sys-shape':
163
+ _create-system-app-vars-map(m3-token-definitions.md-sys-shape-values()),
164
+ );
165
+
166
+ @return sass-utils.deep-merge-all(
167
+ _generate-tokens($app-vars, true, true),
168
+ generate-density-tokens(0)
169
+ );
170
+ }
171
+
172
+ // Emits CSS variables for Material's system level values. Uses the
173
+ // namespace prefix in $_system-fallback-prefix.
174
+ // e.g. --mat-app-surface: #E5E5E5
175
+ @mixin theme($theme, $overrides: ()) {
176
+ @include system-level-colors($theme, $overrides, $_system-fallback-prefix);
177
+ @include system-level-typography($theme, $overrides, $_system-fallback-prefix);
178
+ @include system-level-elevation($theme, $overrides, $_system-fallback-prefix);
179
+ @include system-level-shape($theme, $overrides, $_system-fallback-prefix);
180
+ @include system-level-motion($theme, $overrides, $_system-fallback-prefix);
181
+ @include system-level-state($theme, $overrides, $_system-fallback-prefix);
182
+ }
183
+
184
+ @mixin system-level-colors($theme, $overrides: (), $prefix: null) {
129
185
  $palettes: map.get($theme, _mat-theming-internals-do-not-access, palettes);
130
186
  $base-palettes: (
131
187
  neutral: map.get($palettes, neutral),
@@ -135,11 +191,15 @@ $_cached-token-slots: null;
135
191
  );
136
192
 
137
193
  $type: map.get($theme, _mat-theming-internals-do-not-access, theme-type);
138
- $system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
139
194
  $primary: map.merge(map.get($palettes, primary), $base-palettes);
140
195
  $tertiary: map.merge(map.get($palettes, tertiary), $base-palettes);
141
196
  $error: map.get($palettes, error);
142
197
 
198
+ @if (not $prefix) {
199
+ $prefix: map.get($theme, _mat-theming-internals-do-not-access,
200
+ color-system-variables-prefix) or $_system-level-prefix;
201
+ }
202
+
143
203
  $ref: (
144
204
  md-ref-palette: _generate-ref-palette-tokens($primary, $tertiary, $error)
145
205
  );
@@ -149,26 +209,28 @@ $_cached-token-slots: null;
149
209
  m3-token-definitions.md-sys-color-values-light($ref));
150
210
 
151
211
  @each $name, $value in $sys-colors {
152
- --#{$system-variables-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
212
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
153
213
  }
154
214
  }
155
215
 
156
- @mixin system-level-typography($theme, $overrides: ()) {
216
+ @mixin system-level-typography($theme, $overrides: (), $prefix: null) {
157
217
  $font-definition: map.get($theme, _mat-theming-internals-do-not-access, font-definition);
158
218
  $brand: map.get($font-definition, brand);
159
219
  $plain: map.get($font-definition, plain);
160
220
  $bold: map.get($font-definition, bold);
161
221
  $medium: map.get($font-definition, medium);
162
222
  $regular: map.get($font-definition, regular);
163
- $system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
164
223
  $ref: (
165
224
  md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
166
225
  );
167
226
 
168
- $sys-typescale: m3-token-definitions.md-sys-typescale-values($ref);
227
+ @if (not $prefix) {
228
+ $prefix: map.get($theme, _mat-theming-internals-do-not-access,
229
+ typography-system-variables-prefix) or $_system-level-prefix;
230
+ }
169
231
 
170
- @each $name, $value in $sys-typescale {
171
- --#{$system-variables-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
232
+ @each $name, $value in m3-token-definitions.md-sys-typescale-values($ref) {
233
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
172
234
  }
173
235
  }
174
236
 
@@ -180,6 +242,40 @@ $_cached-token-slots: null;
180
242
  @return $result;
181
243
  }
182
244
 
245
+ @mixin system-level-elevation($theme, $overrides: (), $prefix: $_system-level-prefix) {
246
+ $shadow-color: map.get(
247
+ $theme, _mat-theming-internals-do-not-access, color-tokens, (mdc, theme), shadow);
248
+
249
+ @for $level from 0 through 24 {
250
+ $value: elevation.get-box-shadow($level, $shadow-color);
251
+ --#{$prefix}-elevation-shadow-level-#{$level}: #{$value};
252
+ }
253
+
254
+ @each $name, $value in m3-token-definitions.md-sys-elevation-values() {
255
+ $level: map.get($overrides, $name) or $value;
256
+ $value: elevation.get-box-shadow($level, $shadow-color);
257
+ --#{$prefix}-#{$name}: #{$value};
258
+ }
259
+ }
260
+
261
+ @mixin system-level-shape($theme, $overrides: (), $prefix: $_system-level-prefix) {
262
+ @each $name, $value in m3-token-definitions.md-sys-shape-values() {
263
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
264
+ }
265
+ }
266
+
267
+ @mixin system-level-state($theme, $overrides: (), $prefix: $_system-level-prefix) {
268
+ @each $name, $value in m3-token-definitions.md-sys-state-values() {
269
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
270
+ }
271
+ }
272
+
273
+ @mixin system-level-motion($theme, $overrides: (), $prefix: $_system-level-prefix) {
274
+ @each $name, $value in m3-token-definitions.md-sys-motion-values() {
275
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
276
+ }
277
+ }
278
+
183
279
  @function _get-sys-color($type, $ref, $prefix) {
184
280
  $mdc-sys-color: if($type == dark,
185
281
  m3-token-definitions.md-sys-color-values-dark($ref),