@angular/material 17.1.0 → 17.2.0-next.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 (312) hide show
  1. package/_index.scss +4 -4
  2. package/badge/_badge-theme.scss +30 -180
  3. package/badge/index.d.ts +11 -1
  4. package/button/_button-base.scss +50 -10
  5. package/button/_button-theme.scss +92 -51
  6. package/button/_fab-theme.scss +82 -15
  7. package/button/_icon-button-theme.scss +11 -4
  8. package/button-toggle/_button-toggle-theme.scss +26 -11
  9. package/checkbox/_checkbox-theme.scss +41 -23
  10. package/chips/_chips-theme.scss +25 -9
  11. package/core/_core-theme.scss +85 -38
  12. package/core/index.d.ts +7 -4
  13. package/core/mdc-helpers/_mdc-helpers.scss +0 -8
  14. package/core/option/_option-theme.scss +24 -10
  15. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +64 -24
  16. package/core/tokens/_token-utils.scss +22 -0
  17. package/core/tokens/m2/_index.scss +16 -0
  18. package/core/tokens/m2/mat/_badge.scss +27 -1
  19. package/core/tokens/m2/mat/_checkbox.scss +45 -0
  20. package/core/tokens/m2/mat/_dialog.scss +49 -0
  21. package/core/tokens/m2/mat/_fab-small.scss +95 -0
  22. package/core/tokens/m2/mat/_fab.scss +6 -1
  23. package/core/tokens/m2/mat/_filled-button.scss +17 -2
  24. package/core/tokens/m2/mat/_form-field.scss +15 -0
  25. package/core/tokens/m2/mat/_icon-button.scss +6 -1
  26. package/core/tokens/m2/mat/_outlined-button.scss +17 -2
  27. package/core/tokens/m2/mat/_protected-button.scss +17 -2
  28. package/core/tokens/m2/mat/_radio.scss +6 -1
  29. package/core/tokens/m2/mat/_stepper.scss +6 -1
  30. package/core/tokens/m2/mat/_text-button.scss +20 -2
  31. package/core/tokens/m2/mdc/_extended-fab.scss +3 -2
  32. package/core/tokens/m2/mdc/_fab-small.scss +90 -0
  33. package/core/tokens/m2/mdc/_fab.scss +0 -11
  34. package/core/tokens/m2/mdc/_filled-text-field.scss +8 -8
  35. package/core/tokens/m2/mdc/_icon-button.scss +15 -7
  36. package/core/tokens/m2/mdc/_outlined-text-field.scss +6 -6
  37. package/core/tokens/m2/mdc/_switch.scss +12 -3
  38. package/datepicker/_datepicker-theme.scss +25 -9
  39. package/dialog/_dialog-theme.scss +10 -0
  40. package/dialog/index.d.ts +28 -9
  41. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  42. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  43. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  44. package/esm2022/autocomplete/module.mjs +5 -5
  45. package/esm2022/badge/badge-module.mjs +9 -7
  46. package/esm2022/badge/badge.mjs +32 -6
  47. package/esm2022/badge/public-api.mjs +2 -2
  48. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  49. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  50. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  51. package/esm2022/button/button-base.mjs +7 -7
  52. package/esm2022/button/button.mjs +10 -11
  53. package/esm2022/button/fab.mjs +18 -19
  54. package/esm2022/button/icon-button.mjs +10 -11
  55. package/esm2022/button/module.mjs +5 -5
  56. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  57. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  58. package/esm2022/card/card.mjs +43 -43
  59. package/esm2022/card/module.mjs +5 -5
  60. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  61. package/esm2022/checkbox/checkbox.mjs +7 -8
  62. package/esm2022/checkbox/module.mjs +9 -9
  63. package/esm2022/chips/chip-action.mjs +4 -4
  64. package/esm2022/chips/chip-edit-input.mjs +4 -4
  65. package/esm2022/chips/chip-grid.mjs +4 -4
  66. package/esm2022/chips/chip-icons.mjs +10 -10
  67. package/esm2022/chips/chip-input.mjs +4 -4
  68. package/esm2022/chips/chip-listbox.mjs +4 -4
  69. package/esm2022/chips/chip-option.mjs +4 -4
  70. package/esm2022/chips/chip-row.mjs +5 -6
  71. package/esm2022/chips/chip-set.mjs +4 -4
  72. package/esm2022/chips/chip.mjs +5 -6
  73. package/esm2022/chips/module.mjs +5 -5
  74. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  75. package/esm2022/core/common-behaviors/error-state.mjs +2 -4
  76. package/esm2022/core/datetime/index.mjs +9 -9
  77. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  78. package/esm2022/core/error/error-options.mjs +7 -7
  79. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  80. package/esm2022/core/line/line.mjs +8 -8
  81. package/esm2022/core/option/index.mjs +5 -5
  82. package/esm2022/core/option/optgroup.mjs +4 -4
  83. package/esm2022/core/option/option.mjs +4 -4
  84. package/esm2022/core/private/ripple-loader.mjs +4 -4
  85. package/esm2022/core/ripple/index.mjs +5 -5
  86. package/esm2022/core/ripple/ripple.mjs +5 -6
  87. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  88. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +5 -6
  89. package/esm2022/core/version.mjs +1 -1
  90. package/esm2022/datepicker/calendar-body.mjs +4 -4
  91. package/esm2022/datepicker/calendar.mjs +7 -7
  92. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  93. package/esm2022/datepicker/date-range-input.mjs +4 -4
  94. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  95. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  96. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  97. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  98. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  99. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  100. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  101. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  102. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  103. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  104. package/esm2022/datepicker/datepicker.mjs +4 -4
  105. package/esm2022/datepicker/month-view.mjs +4 -4
  106. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  107. package/esm2022/datepicker/year-view.mjs +4 -4
  108. package/esm2022/dialog/dialog-config.mjs +1 -3
  109. package/esm2022/dialog/dialog-container.mjs +17 -7
  110. package/esm2022/dialog/dialog-content-directives.mjs +49 -31
  111. package/esm2022/dialog/dialog-ref.mjs +3 -1
  112. package/esm2022/dialog/dialog.mjs +4 -4
  113. package/esm2022/dialog/module.mjs +5 -5
  114. package/esm2022/dialog/public-api.mjs +2 -2
  115. package/esm2022/divider/divider-module.mjs +5 -5
  116. package/esm2022/divider/divider.mjs +4 -4
  117. package/esm2022/expansion/accordion.mjs +4 -4
  118. package/esm2022/expansion/expansion-module.mjs +5 -5
  119. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  120. package/esm2022/expansion/expansion-panel-header.mjs +11 -12
  121. package/esm2022/expansion/expansion-panel.mjs +8 -9
  122. package/esm2022/form-field/directives/error.mjs +4 -4
  123. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  124. package/esm2022/form-field/directives/hint.mjs +4 -4
  125. package/esm2022/form-field/directives/label.mjs +4 -4
  126. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  127. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  128. package/esm2022/form-field/directives/prefix.mjs +4 -4
  129. package/esm2022/form-field/directives/suffix.mjs +4 -4
  130. package/esm2022/form-field/form-field-control.mjs +4 -4
  131. package/esm2022/form-field/form-field.mjs +7 -8
  132. package/esm2022/form-field/module.mjs +5 -5
  133. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  134. package/esm2022/grid-list/grid-list.mjs +4 -4
  135. package/esm2022/grid-list/grid-tile.mjs +16 -16
  136. package/esm2022/icon/icon-module.mjs +5 -5
  137. package/esm2022/icon/icon-registry.mjs +4 -4
  138. package/esm2022/icon/icon.mjs +4 -4
  139. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  140. package/esm2022/input/input.mjs +4 -4
  141. package/esm2022/input/module.mjs +5 -5
  142. package/esm2022/list/action-list.mjs +4 -4
  143. package/esm2022/list/list-base.mjs +8 -9
  144. package/esm2022/list/list-item-sections.mjs +19 -19
  145. package/esm2022/list/list-module.mjs +5 -5
  146. package/esm2022/list/list-option.mjs +4 -4
  147. package/esm2022/list/list.mjs +8 -9
  148. package/esm2022/list/nav-list.mjs +4 -4
  149. package/esm2022/list/selection-list.mjs +4 -4
  150. package/esm2022/list/subheader.mjs +4 -4
  151. package/esm2022/menu/menu-content.mjs +4 -4
  152. package/esm2022/menu/menu-item.mjs +4 -4
  153. package/esm2022/menu/menu-trigger.mjs +4 -4
  154. package/esm2022/menu/menu.mjs +4 -4
  155. package/esm2022/menu/module.mjs +5 -5
  156. package/esm2022/paginator/module.mjs +5 -5
  157. package/esm2022/paginator/paginator-intl.mjs +4 -4
  158. package/esm2022/paginator/paginator.mjs +4 -4
  159. package/esm2022/progress-bar/module.mjs +5 -5
  160. package/esm2022/progress-bar/progress-bar.mjs +5 -6
  161. package/esm2022/progress-spinner/module.mjs +5 -5
  162. package/esm2022/progress-spinner/progress-spinner.mjs +5 -6
  163. package/esm2022/radio/module.mjs +5 -5
  164. package/esm2022/radio/radio.mjs +9 -10
  165. package/esm2022/select/module.mjs +5 -5
  166. package/esm2022/select/select.mjs +7 -7
  167. package/esm2022/sidenav/drawer.mjs +11 -12
  168. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  169. package/esm2022/sidenav/sidenav.mjs +10 -10
  170. package/esm2022/slide-toggle/module.mjs +9 -9
  171. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  172. package/esm2022/slide-toggle/slide-toggle.mjs +7 -8
  173. package/esm2022/slider/module.mjs +5 -5
  174. package/esm2022/slider/slider-input.mjs +7 -7
  175. package/esm2022/slider/slider-thumb.mjs +4 -4
  176. package/esm2022/slider/slider.mjs +5 -6
  177. package/esm2022/snack-bar/module.mjs +5 -5
  178. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  179. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  180. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  181. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  182. package/esm2022/sort/sort-header-intl.mjs +4 -4
  183. package/esm2022/sort/sort-header.mjs +4 -4
  184. package/esm2022/sort/sort-module.mjs +5 -5
  185. package/esm2022/sort/sort.mjs +4 -4
  186. package/esm2022/stepper/step-content.mjs +4 -4
  187. package/esm2022/stepper/step-header.mjs +5 -5
  188. package/esm2022/stepper/step-label.mjs +4 -4
  189. package/esm2022/stepper/stepper-button.mjs +7 -7
  190. package/esm2022/stepper/stepper-icon.mjs +4 -4
  191. package/esm2022/stepper/stepper-intl.mjs +4 -4
  192. package/esm2022/stepper/stepper-module.mjs +5 -5
  193. package/esm2022/stepper/stepper.mjs +7 -7
  194. package/esm2022/table/cell.mjs +22 -22
  195. package/esm2022/table/module.mjs +5 -5
  196. package/esm2022/table/row.mjs +22 -22
  197. package/esm2022/table/table.mjs +7 -7
  198. package/esm2022/table/text-column.mjs +4 -4
  199. package/esm2022/tabs/module.mjs +5 -5
  200. package/esm2022/tabs/paginated-tab-header.mjs +5 -6
  201. package/esm2022/tabs/tab-body.mjs +7 -7
  202. package/esm2022/tabs/tab-content.mjs +4 -4
  203. package/esm2022/tabs/tab-group.mjs +5 -6
  204. package/esm2022/tabs/tab-header.mjs +5 -6
  205. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  206. package/esm2022/tabs/tab-label.mjs +4 -4
  207. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +11 -12
  208. package/esm2022/tabs/tab.mjs +4 -4
  209. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  210. package/esm2022/toolbar/toolbar.mjs +7 -7
  211. package/esm2022/tooltip/module.mjs +5 -5
  212. package/esm2022/tooltip/tooltip.mjs +8 -9
  213. package/esm2022/tree/node.mjs +10 -10
  214. package/esm2022/tree/outlet.mjs +4 -4
  215. package/esm2022/tree/padding.mjs +4 -4
  216. package/esm2022/tree/toggle.mjs +4 -4
  217. package/esm2022/tree/tree-module.mjs +5 -5
  218. package/esm2022/tree/tree.mjs +4 -4
  219. package/fesm2022/autocomplete.mjs +13 -13
  220. package/fesm2022/autocomplete.mjs.map +1 -1
  221. package/fesm2022/badge.mjs +38 -10
  222. package/fesm2022/badge.mjs.map +1 -1
  223. package/fesm2022/bottom-sheet.mjs +10 -10
  224. package/fesm2022/bottom-sheet.mjs.map +1 -1
  225. package/fesm2022/button-toggle.mjs +10 -10
  226. package/fesm2022/button-toggle.mjs.map +1 -1
  227. package/fesm2022/button.mjs +43 -44
  228. package/fesm2022/button.mjs.map +1 -1
  229. package/fesm2022/card.mjs +46 -46
  230. package/fesm2022/card.mjs.map +1 -1
  231. package/fesm2022/checkbox.mjs +17 -18
  232. package/fesm2022/checkbox.mjs.map +1 -1
  233. package/fesm2022/chips.mjs +41 -42
  234. package/fesm2022/chips.mjs.map +1 -1
  235. package/fesm2022/core.mjs +62 -65
  236. package/fesm2022/core.mjs.map +1 -1
  237. package/fesm2022/datepicker.mjs +82 -82
  238. package/fesm2022/datepicker.mjs.map +1 -1
  239. package/fesm2022/dialog.mjs +74 -46
  240. package/fesm2022/dialog.mjs.map +1 -1
  241. package/fesm2022/divider.mjs +7 -7
  242. package/fesm2022/divider.mjs.map +1 -1
  243. package/fesm2022/expansion.mjs +26 -27
  244. package/fesm2022/expansion.mjs.map +1 -1
  245. package/fesm2022/form-field.mjs +37 -38
  246. package/fesm2022/form-field.mjs.map +1 -1
  247. package/fesm2022/grid-list.mjs +22 -22
  248. package/fesm2022/grid-list.mjs.map +1 -1
  249. package/fesm2022/icon/testing.mjs +7 -7
  250. package/fesm2022/icon/testing.mjs.map +1 -1
  251. package/fesm2022/icon.mjs +10 -10
  252. package/fesm2022/icon.mjs.map +1 -1
  253. package/fesm2022/input.mjs +7 -7
  254. package/fesm2022/input.mjs.map +1 -1
  255. package/fesm2022/list.mjs +51 -52
  256. package/fesm2022/list.mjs.map +1 -1
  257. package/fesm2022/menu.mjs +16 -16
  258. package/fesm2022/menu.mjs.map +1 -1
  259. package/fesm2022/paginator.mjs +10 -10
  260. package/fesm2022/paginator.mjs.map +1 -1
  261. package/fesm2022/progress-bar.mjs +8 -9
  262. package/fesm2022/progress-bar.mjs.map +1 -1
  263. package/fesm2022/progress-spinner.mjs +8 -9
  264. package/fesm2022/progress-spinner.mjs.map +1 -1
  265. package/fesm2022/radio.mjs +12 -13
  266. package/fesm2022/radio.mjs.map +1 -1
  267. package/fesm2022/select.mjs +10 -10
  268. package/fesm2022/select.mjs.map +1 -1
  269. package/fesm2022/sidenav.mjs +23 -24
  270. package/fesm2022/sidenav.mjs.map +1 -1
  271. package/fesm2022/slide-toggle.mjs +17 -18
  272. package/fesm2022/slide-toggle.mjs.map +1 -1
  273. package/fesm2022/slider.mjs +17 -18
  274. package/fesm2022/slider.mjs.map +1 -1
  275. package/fesm2022/snack-bar.mjs +22 -22
  276. package/fesm2022/snack-bar.mjs.map +1 -1
  277. package/fesm2022/sort.mjs +13 -13
  278. package/fesm2022/sort.mjs.map +1 -1
  279. package/fesm2022/stepper.mjs +32 -32
  280. package/fesm2022/stepper.mjs.map +1 -1
  281. package/fesm2022/table.mjs +55 -55
  282. package/fesm2022/table.mjs.map +1 -1
  283. package/fesm2022/tabs.mjs +41 -42
  284. package/fesm2022/tabs.mjs.map +1 -1
  285. package/fesm2022/toolbar.mjs +10 -10
  286. package/fesm2022/toolbar.mjs.map +1 -1
  287. package/fesm2022/tooltip.mjs +11 -12
  288. package/fesm2022/tooltip.mjs.map +1 -1
  289. package/fesm2022/tree.mjs +25 -25
  290. package/fesm2022/tree.mjs.map +1 -1
  291. package/form-field/_form-field-theme.scss +31 -14
  292. package/icon/_icon-theme.scss +2 -2
  293. package/package.json +7 -7
  294. package/paginator/_paginator-theme.scss +10 -16
  295. package/prebuilt-themes/deeppurple-amber.css +1 -1
  296. package/prebuilt-themes/indigo-pink.css +1 -1
  297. package/prebuilt-themes/pink-bluegrey.css +1 -1
  298. package/prebuilt-themes/purple-green.css +1 -1
  299. package/progress-bar/_progress-bar-theme.scss +27 -9
  300. package/progress-spinner/_progress-spinner-theme.scss +38 -17
  301. package/radio/_radio-theme.scss +34 -18
  302. package/schematics/ng-add/index.js +2 -2
  303. package/schematics/ng-add/index.mjs +2 -2
  304. package/schematics/ng-add/setup-project.js +7 -75
  305. package/schematics/ng-add/setup-project.mjs +7 -75
  306. package/schematics/ng-generate/mdc-migration/index_bundled.js +122 -115
  307. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  308. package/select/_select-theme.scss +24 -10
  309. package/slide-toggle/_slide-toggle-theme.scss +36 -16
  310. package/slider/_slider-theme.scss +28 -11
  311. package/stepper/_stepper-theme.scss +28 -7
  312. package/tabs/_tabs-theme.scss +32 -14
@@ -2,6 +2,7 @@
2
2
  @use 'sass:meta';
3
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
4
  @use '../../token-utils';
5
+ @use '../../../theming/theming';
5
6
  @use '../../../theming/inspection';
6
7
  @use '../../../style/sass-utils';
7
8
 
@@ -61,7 +62,11 @@ $prefix: (mat, icon-button);
61
62
 
62
63
  // Tokens that can be configured through Angular Material's density theming API.
63
64
  @function get-density-tokens($theme) {
64
- @return ();
65
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
66
+
67
+ @return (
68
+ touch-target-display: if($density-scale < -1, none, block),
69
+ );
65
70
  }
66
71
 
67
72
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -2,6 +2,7 @@
2
2
  @use 'sass:meta';
3
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
4
  @use '../../token-utils';
5
+ @use '../../../theming/theming';
5
6
  @use '../../../theming/inspection';
6
7
  @use '../../../style/sass-utils';
7
8
 
@@ -11,7 +12,17 @@ $prefix: (mat, outlined-button);
11
12
  // Tokens that can't be configured through Angular Material's current theming API,
12
13
  // but may be in a future version of the theming API.
13
14
  @function get-unthemable-tokens() {
14
- @return ();
15
+ @return (
16
+ // Start/end padding of the button.
17
+ horizontal-padding: 15px, // Normally it's 16px, but -1px for the outline.
18
+
19
+ // Space between the icon and the button's main content.
20
+ icon-spacing: 8px,
21
+
22
+ // Amount by which to offset the icon so that its presence
23
+ // doesn't increase throw off the horizontal padding.
24
+ icon-offset: -4px,
25
+ );
15
26
  }
16
27
 
17
28
  // Tokens that can be configured through Angular Material's color theming API.
@@ -61,7 +72,11 @@ $prefix: (mat, outlined-button);
61
72
 
62
73
  // Tokens that can be configured through Angular Material's density theming API.
63
74
  @function get-density-tokens($theme) {
64
- @return ();
75
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
76
+
77
+ @return (
78
+ touch-target-display: if($density-scale < -1, none, block),
79
+ );
65
80
  }
66
81
 
67
82
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
3
  @use '../../token-utils';
4
+ @use '../../../theming/theming';
4
5
  @use '../../../theming/inspection';
5
6
  @use '../../../style/sass-utils';
6
7
  @use '../../../mdc-helpers/mdc-helpers';
@@ -11,7 +12,17 @@ $prefix: (mat, protected-button);
11
12
  // Tokens that can't be configured through Angular Material's current theming API,
12
13
  // but may be in a future version of the theming API.
13
14
  @function get-unthemable-tokens() {
14
- @return ();
15
+ @return (
16
+ // Start/end padding of the button.
17
+ horizontal-padding: 16px,
18
+
19
+ // Space between the icon and the button's main content.
20
+ icon-spacing: 8px,
21
+
22
+ // Amount by which to offset the icon so that its presence
23
+ // doesn't increase throw off the horizontal padding.
24
+ icon-offset: -4px,
25
+ );
15
26
  }
16
27
 
17
28
  // Tokens that can be configured through Angular Material's color theming API.
@@ -64,7 +75,11 @@ $prefix: (mat, protected-button);
64
75
 
65
76
  // Tokens that can be configured through Angular Material's density theming API.
66
77
  @function get-density-tokens($theme) {
67
- @return ();
78
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
79
+
80
+ @return (
81
+ touch-target-display: if($density-scale < -1, none, block),
82
+ );
68
83
  }
69
84
 
70
85
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -1,4 +1,5 @@
1
1
  @use '../../token-utils';
2
+ @use '../../../theming/theming';
2
3
  @use '../../../theming/inspection';
3
4
  @use '../../../style/sass-utils';
4
5
 
@@ -29,7 +30,11 @@ $prefix: (mat, radio);
29
30
 
30
31
  // Tokens that can be configured through Angular Material's density theming API.
31
32
  @function get-density-tokens($theme) {
32
- @return ();
33
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
34
+
35
+ @return (
36
+ touch-target-display: if($density-scale < -1, none, block),
37
+ );
33
38
  }
34
39
 
35
40
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -10,7 +10,12 @@ $prefix: (mat, stepper);
10
10
  // Tokens that can't be configured through Angular Material's current theming API,
11
11
  // but may be in a future version of the theming API.
12
12
  @function get-unthemable-tokens() {
13
- @return ();
13
+ @return (
14
+ // Border radius for step header on focus
15
+ header-focus-state-layer-shape: 0,
16
+ // Border radius for step header on hover
17
+ header-hover-state-layer-shape: 0,
18
+ );
14
19
  }
15
20
 
16
21
  // Tokens that can be configured through Angular Material's color theming API.
@@ -2,6 +2,7 @@
2
2
  @use 'sass:meta';
3
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
4
  @use '../../token-utils';
5
+ @use '../../../theming/theming';
5
6
  @use '../../../theming/inspection';
6
7
  @use '../../../style/sass-utils';
7
8
 
@@ -11,7 +12,20 @@ $prefix: (mat, text-button);
11
12
  // Tokens that can't be configured through Angular Material's current theming API,
12
13
  // but may be in a future version of the theming API.
13
14
  @function get-unthemable-tokens() {
14
- @return ();
15
+ @return (
16
+ // Start/end padding of the button.
17
+ horizontal-padding: 8px,
18
+
19
+ // Start/end padding of the button when it has an icon.
20
+ with-icon-horizontal-padding: 8px,
21
+
22
+ // Space between the icon and the button's main content.
23
+ icon-spacing: 8px,
24
+
25
+ // Amount by which to offset the icon so that its presence
26
+ // doesn't increase throw off the horizontal padding.
27
+ icon-offset: 0,
28
+ );
15
29
  }
16
30
 
17
31
  // Tokens that can be configured through Angular Material's color theming API.
@@ -61,7 +75,11 @@ $prefix: (mat, text-button);
61
75
 
62
76
  // Tokens that can be configured through Angular Material's density theming API.
63
77
  @function get-density-tokens($theme) {
64
- @return ();
78
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
79
+
80
+ @return (
81
+ touch-target-display: if($density-scale < -1, none, block),
82
+ );
65
83
  }
66
84
 
67
85
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -8,12 +8,13 @@ $prefix: (mdc, extended-fab);
8
8
 
9
9
  @function get-unthemable-tokens() {
10
10
  @return (
11
+ container-height: 48px,
12
+ container-shape: 24px,
13
+
11
14
  // =============================================================================================
12
15
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
13
16
  // =============================================================================================
14
17
  container-color: null,
15
- container-height: null,
16
- container-shape: null,
17
18
  container-surface-tint-layer-color: null,
18
19
  focus-icon-color: null,
19
20
  focus-label-text-color: null,
@@ -0,0 +1,90 @@
1
+ @use '../../../theming/inspection';
2
+ @use '../../token-utils';
3
+
4
+ @use 'sass:map';
5
+
6
+ // The prefix used to generate the fully qualified name for tokens in this file.
7
+ $prefix: (mdc, fab-small);
8
+
9
+ @function get-unthemable-tokens() {
10
+ @return (
11
+ container-shape: 50%,
12
+ icon-size: 24px,
13
+
14
+ // We don't use this token, because it doesn't set the color of any text inside the FAB.
15
+ // We create a custom token for it instead.
16
+ icon-color: null,
17
+
18
+ // =============================================================================================
19
+ // = TOKENS NOT USED IN ANGULAR MATERIAL =
20
+ // =============================================================================================
21
+ container-height: null,
22
+ container-width: null,
23
+
24
+ focus-icon-color: null,
25
+ focus-outline-color: null,
26
+ focus-outline-width: null,
27
+ focus-state-layer-color: null,
28
+ focus-state-layer-opacity: null,
29
+
30
+ hover-icon-color: null,
31
+ hover-state-layer-color: null,
32
+ hover-state-layer-opacity: null,
33
+
34
+ lowered-container-elevation: null,
35
+ lowered-focus-container-elevation: null,
36
+ lowered-hover-container-elevation: null,
37
+ lowered-pressed-container-elevation: null,
38
+
39
+ pressed-icon-color: null,
40
+ pressed-ripple-color: null,
41
+ pressed-ripple-opacity: null,
42
+ pressed-state-layer-color: null,
43
+ pressed-state-layer-opacity: null
44
+ );
45
+ }
46
+
47
+ // Tokens that can be configured through Angular Material's color theming API.
48
+ @function get-color-tokens($theme) {
49
+ @return (
50
+ // Background color of the FAB.
51
+ container-color: inspection.get-theme-color($theme, background, card),
52
+ container-elevation: 6,
53
+ focus-container-elevation: 8,
54
+ hover-container-elevation: 8,
55
+ pressed-container-elevation: 12,
56
+ container-shadow-color: #000,
57
+ );
58
+ }
59
+
60
+ // Generates the mapping for the properties that change based on the FAB palette color.
61
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
62
+ @return (
63
+ container-color: inspection.get-theme-color($theme, $palette-name, default),
64
+ );
65
+ }
66
+
67
+ // Tokens that can be configured through Angular Material's typography theming API.
68
+ @function get-typography-tokens($theme) {
69
+ @return ();
70
+ }
71
+
72
+ // Tokens that can be configured through Angular Material's density theming API.
73
+ @function get-density-tokens($theme) {
74
+ @return ();
75
+ }
76
+
77
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
78
+ // This is used to create token slots.
79
+ @function get-token-slots() {
80
+ @return map.merge(
81
+ get-unthemable-tokens(),
82
+ map.merge(
83
+ get-color-tokens(token-utils.$placeholder-color-config),
84
+ map.merge(
85
+ get-typography-tokens(token-utils.$placeholder-typography-config),
86
+ get-density-tokens(token-utils.$placeholder-density-config)
87
+ )
88
+ )
89
+ );
90
+ }
@@ -6,17 +6,6 @@
6
6
  // The prefix used to generate the fully qualified name for tokens in this file.
7
7
  $prefix: (mdc, fab);
8
8
 
9
- // Tokens that can't be configured through Angular Material's current theming API,
10
- // but may be in a future version of the theming API.
11
- //
12
- // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
13
- // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
14
- // our CSS.
15
- $height: 56px;
16
- $mini-height: 40px;
17
- $shape-radius: 50%;
18
- $ripple-target: '.mdc-fab__ripple';
19
-
20
9
  @function get-unthemable-tokens() {
21
10
  @return (
22
11
  container-shape: 50%,
@@ -34,8 +34,6 @@ $prefix: (mdc, filled-text-field);
34
34
  label-text-populated-size: null,
35
35
  label-text-type: null,
36
36
  disabled-label-text-opacity: null,
37
- hover-label-text-color: null,
38
- error-hover-label-text-color: null,
39
37
  supporting-text-color: null,
40
38
  supporting-text-font: null,
41
39
  supporting-text-line-height: null,
@@ -50,7 +48,11 @@ $prefix: (mdc, filled-text-field);
50
48
  focus-supporting-text-color: null,
51
49
  hover-supporting-text-color: null,
52
50
  input-text-prefix-color: null,
51
+ input-text-suffix-color: null,
53
52
  container-height: null,
53
+ trailing-icon-size: null,
54
+ leading-icon-size: null,
55
+ trailing-icon-color: null,
54
56
  disabled-trailing-icon-color: null,
55
57
  disabled-trailing-icon-opacity: null,
56
58
  error-focus-trailing-icon-color: null,
@@ -58,19 +60,15 @@ $prefix: (mdc, filled-text-field);
58
60
  error-trailing-icon-color: null,
59
61
  focus-trailing-icon-color: null,
60
62
  hover-trailing-icon-color: null,
61
- trailing-icon-color: null,
62
- trailing-icon-size: null,
63
- disabled-leading-icon-color: null,
63
+ leading-icon-color: null,
64
64
  disabled-leading-icon-opacity: null,
65
+ disabled-leading-icon-color: null,
65
66
  error-focus-leading-icon-color: null,
66
67
  error-hover-leading-icon-color: null,
67
68
  error-leading-icon-color: null,
68
69
  focus-leading-icon-color: null,
69
70
  hover-leading-icon-color: null,
70
- leading-icon-color: null,
71
- leading-icon-size: null,
72
71
  input-text-type: null,
73
- input-text-suffix-color: null,
74
72
  input-text-font: null,
75
73
  input-text-line-height: null,
76
74
  input-text-size: null,
@@ -104,12 +102,14 @@ $prefix: (mdc, filled-text-field);
104
102
  disabled-container-color: _variable-safe-mix($on-surface, $surface, 2%),
105
103
 
106
104
  label-text-color: rgba($on-surface, 0.6),
105
+ hover-label-text-color: rgba($on-surface, 0.6),
107
106
  disabled-label-text-color: rgba($on-surface, 0.38),
108
107
 
109
108
  input-text-color: rgba($on-surface, 0.87),
110
109
  disabled-input-text-color: rgba($on-surface, 0.38),
111
110
  input-text-placeholder-color: rgba($on-surface, 0.6),
112
111
 
112
+ error-hover-label-text-color: $warn-color,
113
113
  error-focus-label-text-color: $warn-color,
114
114
  error-label-text-color: $warn-color,
115
115
  error-caret-color: $warn-color,
@@ -1,4 +1,6 @@
1
+ @use 'sass:map';
1
2
  @use '../../../style/sass-utils';
3
+ @use '../../../theming/theming';
2
4
  @use '../../../theming/inspection';
3
5
  @use '../../token-utils';
4
6
 
@@ -13,12 +15,6 @@ $prefix: (mdc, icon-button);
13
15
  // our CSS.
14
16
  @function get-unthemable-tokens() {
15
17
  @return (
16
- // =============================================================================================
17
- // = TOKENS THAT SHOULD NOT BE CUSTOMIZABLE =
18
- // =============================================================================================
19
- // Determines the size of the icon. Name is inaccurate - applies to the whole component,
20
- // not just the state layer.
21
- state-layer-size: 48px,
22
18
  // MDC's icon size applied to svg and img elements inside the component
23
19
  icon-size: 24px,
24
20
 
@@ -68,7 +64,19 @@ $prefix: (mdc, icon-button);
68
64
 
69
65
  // Tokens that can be configured through Angular Material's density theming API.
70
66
  @function get-density-tokens($theme) {
71
- @return ();
67
+ $scale: theming.clamp-density(inspection.get-theme-density($theme), -5);
68
+
69
+ @return (
70
+ // The diameter of the checkbox's ripple.
71
+ state-layer-size: map.get((
72
+ 0: 48px,
73
+ -1: 44px,
74
+ -2: 40px,
75
+ -3: 36px,
76
+ -4: 32px,
77
+ -5: 28px,
78
+ ), $scale)
79
+ );
72
80
  }
73
81
 
74
82
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -31,8 +31,6 @@ $prefix: (mdc, outlined-text-field);
31
31
  label-text-type: null,
32
32
  label-text-populated-line-height: null,
33
33
  label-text-populated-size: null,
34
- hover-label-text-color: null,
35
- error-hover-label-text-color: null,
36
34
  disabled-label-text-opacity: null,
37
35
  disabled-supporting-text-color: null,
38
36
  disabled-supporting-text-opacity: null,
@@ -48,6 +46,9 @@ $prefix: (mdc, outlined-text-field);
48
46
  supporting-text-tracking: null,
49
47
  supporting-text-type: null,
50
48
  supporting-text-weight: null,
49
+ leading-icon-size: null,
50
+ trailing-icon-size: null,
51
+ leading-icon-color: null,
51
52
  disabled-leading-icon-color: null,
52
53
  disabled-leading-icon-opacity: null,
53
54
  error-focus-leading-icon-color: null,
@@ -55,8 +56,7 @@ $prefix: (mdc, outlined-text-field);
55
56
  error-leading-icon-color: null,
56
57
  focus-leading-icon-color: null,
57
58
  hover-leading-icon-color: null,
58
- leading-icon-color: null,
59
- leading-icon-size: null,
59
+ trailing-icon-color: null,
60
60
  disabled-trailing-icon-color: null,
61
61
  disabled-trailing-icon-opacity: null,
62
62
  error-focus-trailing-icon-color: null,
@@ -64,8 +64,6 @@ $prefix: (mdc, outlined-text-field);
64
64
  error-trailing-icon-color: null,
65
65
  focus-trailing-icon-color: null,
66
66
  hover-trailing-icon-color: null,
67
- trailing-icon-color: null,
68
- trailing-icon-size: null,
69
67
  input-text-prefix-color: null,
70
68
  input-text-type: null,
71
69
  container-height: null,
@@ -94,6 +92,7 @@ $prefix: (mdc, outlined-text-field);
94
92
 
95
93
  @return map.merge($color-tokens, (
96
94
  label-text-color: rgba($on-surface, 0.6),
95
+ hover-label-text-color: rgba($on-surface, 0.6),
97
96
  disabled-label-text-color: rgba($on-surface, 0.38),
98
97
 
99
98
  input-text-color: rgba($on-surface, 0.87),
@@ -103,6 +102,7 @@ $prefix: (mdc, outlined-text-field);
103
102
  error-caret-color: $warn-color,
104
103
  error-focus-label-text-color: $warn-color,
105
104
  error-label-text-color: $warn-color,
105
+ error-hover-label-text-color: $warn-color,
106
106
 
107
107
  // Outline tokens
108
108
  outline-color: rgba($on-surface, 0.38),
@@ -2,6 +2,7 @@
2
2
  @use '../../../style/elevation';
3
3
  @use '../../../style/sass-utils';
4
4
  @use '../../../theming/inspection';
5
+ @use '../../../theming/theming';
5
6
  @use '../../token-utils';
6
7
 
7
8
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -40,8 +41,6 @@ $prefix: (mdc, switch);
40
41
  track-width: 36px,
41
42
  // Width and height of icon when unselected.
42
43
  unselected-icon-size: 18px,
43
- // The diameter of the handle ripple.
44
- state-layer-size: 40px,
45
44
  // Opacity of ripple when selected and focused.
46
45
  selected-focus-state-layer-opacity: 0.12,
47
46
  // Opacity of ripple when selected and on hover.
@@ -164,7 +163,17 @@ $prefix: (mdc, switch);
164
163
 
165
164
  // Tokens that can be configured through Angular Material's density theming API.
166
165
  @function get-density-tokens($theme) {
167
- @return ();
166
+ $scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
167
+
168
+ @return (
169
+ // The diameter of the handle ripple.
170
+ state-layer-size: map.get((
171
+ 0: 40px,
172
+ -1: 36px,
173
+ -2: 32px,
174
+ -3: 28px,
175
+ ), $scale)
176
+ );
168
177
  }
169
178
 
170
179
  // Combines the tokens generated by the above functions into a single map with placeholder values.
@@ -27,6 +27,9 @@ $calendar-weekday-table-font-size: 11px !default;
27
27
  map.merge($calendar-tokens, $range-tokens));
28
28
  }
29
29
 
30
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
31
+ /// for the mat-datepicker.
32
+ /// @param {Map} $theme The theme to generate base styles for.
30
33
  @mixin base($theme) {
31
34
  @if inspection.get-theme-version($theme) == 1 {
32
35
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -34,9 +37,14 @@ $calendar-weekday-table-font-size: 11px !default;
34
37
  @else {}
35
38
  }
36
39
 
37
- @mixin color($theme) {
40
+ /// Outputs color theme styles for the mat-datepicker.
41
+ /// @param {Map} $theme The theme to generate color styles for.
42
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
43
+ /// $color-variant: The color variant to use for the main selection: primary, secondary, tertiary,
44
+ /// or error (If not specified, default primary color will be used).
45
+ @mixin color($theme, $options...) {
38
46
  @if inspection.get-theme-version($theme) == 1 {
39
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
47
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
40
48
  }
41
49
  @else {
42
50
  @include sass-utils.current-selector-or-root() {
@@ -70,6 +78,8 @@ $calendar-weekday-table-font-size: 11px !default;
70
78
  }
71
79
  }
72
80
 
81
+ /// Outputs typography theme styles for the mat-datepicker.
82
+ /// @param {Map} $theme The theme to generate typography styles for.
73
83
  @mixin typography($theme) {
74
84
  @if inspection.get-theme-version($theme) == 1 {
75
85
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -100,6 +110,8 @@ $calendar-weekday-table-font-size: 11px !default;
100
110
  }
101
111
  }
102
112
 
113
+ /// Outputs density theme styles for the mat-datepicker.
114
+ /// @param {Map} $theme The theme to generate density styles for.
103
115
  @mixin density($theme) {
104
116
  @if inspection.get-theme-version($theme) == 1 {
105
117
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -116,10 +128,15 @@ $calendar-weekday-table-font-size: 11px !default;
116
128
  }
117
129
  }
118
130
 
119
- @mixin theme($theme) {
131
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-datepicker.
132
+ /// @param {Map} $theme The theme to generate styles for.
133
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
134
+ /// $color-variant: The color variant to use for the main selection: primary, secondary, tertiary,
135
+ /// or error (If not specified, default primary color will be used).
136
+ @mixin theme($theme, $options...) {
120
137
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-datepicker') {
121
138
  @if inspection.get-theme-version($theme) == 1 {
122
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
139
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
123
140
  }
124
141
  @else {
125
142
  @include base($theme);
@@ -136,9 +153,8 @@ $calendar-weekday-table-font-size: 11px !default;
136
153
  }
137
154
  }
138
155
 
139
- @mixin _theme-from-tokens($tokens) {
140
- @if ($tokens != ()) {
141
- @include token-utils.create-token-values(
142
- tokens-mat-datepicker.$prefix, map.get($tokens, tokens-mat-datepicker.$prefix));
143
- }
156
+ @mixin _theme-from-tokens($tokens, $options...) {
157
+ $mat-datepicker-tokens:
158
+ token-utils.get-tokens-for($tokens, tokens-mat-datepicker.$prefix, $options...);
159
+ @include token-utils.create-token-values(tokens-mat-datepicker.$prefix, $mat-datepicker-tokens);
144
160
  }
@@ -2,6 +2,8 @@
2
2
  @use '@material/dialog/dialog-theme' as mdc-dialog-theme;
3
3
  @use '../core/style/sass-utils';
4
4
  @use '../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog;
5
+ @use '../core/tokens/m2/mat/dialog' as tokens-mat-dialog;
6
+ @use '../core/tokens/token-utils';
5
7
  @use '../core/theming/theming';
6
8
  @use '../core/theming/inspection';
7
9
  @use '../core/typography/typography';
@@ -14,6 +16,8 @@
14
16
  // Add default values for tokens not related to color, typography, or density.
15
17
  @include sass-utils.current-selector-or-root() {
16
18
  @include mdc-dialog-theme.theme(tokens-mdc-dialog.get-unthemable-tokens());
19
+ @include token-utils.create-token-values(
20
+ tokens-mat-dialog.$prefix, tokens-mat-dialog.get-unthemable-tokens());
17
21
  }
18
22
  }
19
23
  }
@@ -25,6 +29,8 @@
25
29
  @else {
26
30
  @include sass-utils.current-selector-or-root() {
27
31
  @include mdc-dialog-theme.theme(tokens-mdc-dialog.get-color-tokens($theme));
32
+ @include token-utils.create-token-values(
33
+ tokens-mat-dialog.$prefix, tokens-mat-dialog.get-color-tokens($theme));
28
34
  }
29
35
  }
30
36
  }
@@ -36,6 +42,8 @@
36
42
  @else {
37
43
  @include sass-utils.current-selector-or-root() {
38
44
  @include mdc-dialog-theme.theme(tokens-mdc-dialog.get-typography-tokens($theme));
45
+ @include token-utils.create-token-values(
46
+ tokens-mat-dialog.$prefix, tokens-mat-dialog.get-typography-tokens($theme));
39
47
  }
40
48
  }
41
49
  }
@@ -70,5 +78,7 @@
70
78
  @mixin _theme-from-tokens($tokens) {
71
79
  @if ($tokens != ()) {
72
80
  @include mdc-dialog-theme.theme(map.get($tokens, tokens-mdc-dialog.$prefix));
81
+ @include token-utils.create-token-values(
82
+ tokens-mat-dialog.$prefix, map.get($tokens, tokens-mat-dialog.$prefix));
73
83
  }
74
84
  }