@angular/material 17.1.2 → 17.2.0-next.1

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 (304) hide show
  1. package/_index.scss +4 -4
  2. package/badge/_badge-theme.scss +30 -11
  3. package/button/_button-base.scss +50 -10
  4. package/button/_button-theme.scss +92 -51
  5. package/button/_fab-theme.scss +82 -15
  6. package/button/_icon-button-theme.scss +11 -4
  7. package/button-toggle/_button-toggle-theme.scss +26 -11
  8. package/checkbox/_checkbox-theme.scss +41 -23
  9. package/chips/_chips-theme.scss +36 -9
  10. package/core/_core-theme.scss +85 -38
  11. package/core/mdc-helpers/_mdc-helpers.scss +0 -8
  12. package/core/option/_option-theme.scss +24 -10
  13. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +64 -24
  14. package/core/tokens/_token-utils.scss +22 -0
  15. package/core/tokens/m2/_index.scss +16 -0
  16. package/core/tokens/m2/mat/_badge.scss +27 -1
  17. package/core/tokens/m2/mat/_checkbox.scss +45 -0
  18. package/core/tokens/m2/mat/_chip.scss +39 -0
  19. package/core/tokens/m2/mat/_dialog.scss +49 -0
  20. package/core/tokens/m2/mat/_fab-small.scss +95 -0
  21. package/core/tokens/m2/mat/_fab.scss +6 -1
  22. package/core/tokens/m2/mat/_filled-button.scss +17 -2
  23. package/core/tokens/m2/mat/_icon-button.scss +6 -1
  24. package/core/tokens/m2/mat/_outlined-button.scss +17 -2
  25. package/core/tokens/m2/mat/_protected-button.scss +17 -2
  26. package/core/tokens/m2/mat/_radio.scss +6 -1
  27. package/core/tokens/m2/mat/_stepper.scss +6 -1
  28. package/core/tokens/m2/mat/_text-button.scss +20 -2
  29. package/core/tokens/m2/mdc/_chip.scss +8 -8
  30. package/core/tokens/m2/mdc/_extended-fab.scss +3 -2
  31. package/core/tokens/m2/mdc/_fab-small.scss +90 -0
  32. package/core/tokens/m2/mdc/_fab.scss +0 -11
  33. package/core/tokens/m2/mdc/_icon-button.scss +15 -7
  34. package/datepicker/_datepicker-theme.scss +25 -9
  35. package/dialog/_dialog-theme.scss +10 -0
  36. package/dialog/index.d.ts +28 -9
  37. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  38. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  39. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  40. package/esm2022/autocomplete/module.mjs +5 -5
  41. package/esm2022/badge/badge-module.mjs +5 -5
  42. package/esm2022/badge/badge.mjs +8 -8
  43. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  44. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  45. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  46. package/esm2022/button/button-base.mjs +7 -7
  47. package/esm2022/button/button.mjs +9 -9
  48. package/esm2022/button/fab.mjs +17 -17
  49. package/esm2022/button/icon-button.mjs +9 -9
  50. package/esm2022/button/module.mjs +5 -5
  51. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  52. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  53. package/esm2022/card/card.mjs +43 -43
  54. package/esm2022/card/module.mjs +5 -5
  55. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  56. package/esm2022/checkbox/checkbox.mjs +6 -6
  57. package/esm2022/checkbox/module.mjs +9 -9
  58. package/esm2022/chips/chip-action.mjs +4 -4
  59. package/esm2022/chips/chip-edit-input.mjs +4 -4
  60. package/esm2022/chips/chip-grid.mjs +4 -4
  61. package/esm2022/chips/chip-icons.mjs +10 -10
  62. package/esm2022/chips/chip-input.mjs +4 -4
  63. package/esm2022/chips/chip-listbox.mjs +4 -4
  64. package/esm2022/chips/chip-option.mjs +6 -6
  65. package/esm2022/chips/chip-row.mjs +6 -6
  66. package/esm2022/chips/chip-set.mjs +4 -4
  67. package/esm2022/chips/chip.mjs +5 -5
  68. package/esm2022/chips/module.mjs +5 -5
  69. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  70. package/esm2022/core/datetime/index.mjs +9 -9
  71. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  72. package/esm2022/core/error/error-options.mjs +7 -7
  73. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  74. package/esm2022/core/line/line.mjs +8 -8
  75. package/esm2022/core/option/index.mjs +5 -5
  76. package/esm2022/core/option/optgroup.mjs +4 -4
  77. package/esm2022/core/option/option.mjs +5 -5
  78. package/esm2022/core/private/ripple-loader.mjs +4 -4
  79. package/esm2022/core/ripple/index.mjs +5 -5
  80. package/esm2022/core/ripple/ripple.mjs +4 -4
  81. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  82. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  83. package/esm2022/core/version.mjs +1 -1
  84. package/esm2022/datepicker/calendar-body.mjs +4 -4
  85. package/esm2022/datepicker/calendar.mjs +7 -7
  86. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  87. package/esm2022/datepicker/date-range-input.mjs +4 -4
  88. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  89. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  90. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  91. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  92. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  93. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  94. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  95. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  96. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  97. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  98. package/esm2022/datepicker/datepicker.mjs +4 -4
  99. package/esm2022/datepicker/month-view.mjs +4 -4
  100. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  101. package/esm2022/datepicker/year-view.mjs +4 -4
  102. package/esm2022/dialog/dialog-config.mjs +1 -3
  103. package/esm2022/dialog/dialog-container.mjs +16 -5
  104. package/esm2022/dialog/dialog-content-directives.mjs +49 -31
  105. package/esm2022/dialog/dialog-ref.mjs +3 -1
  106. package/esm2022/dialog/dialog.mjs +4 -4
  107. package/esm2022/dialog/module.mjs +5 -5
  108. package/esm2022/dialog/public-api.mjs +2 -2
  109. package/esm2022/divider/divider-module.mjs +5 -5
  110. package/esm2022/divider/divider.mjs +4 -4
  111. package/esm2022/expansion/accordion.mjs +4 -4
  112. package/esm2022/expansion/expansion-module.mjs +5 -5
  113. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  114. package/esm2022/expansion/expansion-panel-header.mjs +10 -10
  115. package/esm2022/expansion/expansion-panel.mjs +7 -7
  116. package/esm2022/form-field/directives/error.mjs +4 -4
  117. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  118. package/esm2022/form-field/directives/hint.mjs +4 -4
  119. package/esm2022/form-field/directives/label.mjs +4 -4
  120. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  121. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  122. package/esm2022/form-field/directives/prefix.mjs +4 -4
  123. package/esm2022/form-field/directives/suffix.mjs +4 -4
  124. package/esm2022/form-field/form-field-control.mjs +4 -4
  125. package/esm2022/form-field/form-field.mjs +4 -4
  126. package/esm2022/form-field/module.mjs +5 -5
  127. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  128. package/esm2022/grid-list/grid-list.mjs +4 -4
  129. package/esm2022/grid-list/grid-tile.mjs +16 -16
  130. package/esm2022/icon/icon-module.mjs +5 -5
  131. package/esm2022/icon/icon-registry.mjs +4 -4
  132. package/esm2022/icon/icon.mjs +4 -4
  133. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  134. package/esm2022/input/input.mjs +4 -4
  135. package/esm2022/input/module.mjs +5 -5
  136. package/esm2022/list/action-list.mjs +4 -4
  137. package/esm2022/list/list-base.mjs +7 -7
  138. package/esm2022/list/list-item-sections.mjs +19 -19
  139. package/esm2022/list/list-module.mjs +5 -5
  140. package/esm2022/list/list-option.mjs +4 -4
  141. package/esm2022/list/list.mjs +7 -7
  142. package/esm2022/list/nav-list.mjs +4 -4
  143. package/esm2022/list/selection-list.mjs +4 -4
  144. package/esm2022/list/subheader.mjs +4 -4
  145. package/esm2022/menu/menu-content.mjs +4 -4
  146. package/esm2022/menu/menu-item.mjs +4 -4
  147. package/esm2022/menu/menu-trigger.mjs +4 -4
  148. package/esm2022/menu/menu.mjs +4 -4
  149. package/esm2022/menu/module.mjs +5 -5
  150. package/esm2022/paginator/module.mjs +5 -5
  151. package/esm2022/paginator/paginator-intl.mjs +4 -4
  152. package/esm2022/paginator/paginator.mjs +4 -4
  153. package/esm2022/progress-bar/module.mjs +5 -5
  154. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  155. package/esm2022/progress-spinner/module.mjs +5 -5
  156. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  157. package/esm2022/radio/module.mjs +5 -5
  158. package/esm2022/radio/radio.mjs +8 -8
  159. package/esm2022/select/module.mjs +5 -5
  160. package/esm2022/select/select.mjs +7 -7
  161. package/esm2022/sidenav/drawer.mjs +10 -10
  162. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  163. package/esm2022/sidenav/sidenav.mjs +10 -10
  164. package/esm2022/slide-toggle/module.mjs +9 -9
  165. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  166. package/esm2022/slide-toggle/slide-toggle.mjs +4 -4
  167. package/esm2022/slider/module.mjs +5 -5
  168. package/esm2022/slider/slider-input.mjs +7 -7
  169. package/esm2022/slider/slider-thumb.mjs +4 -4
  170. package/esm2022/slider/slider.mjs +4 -4
  171. package/esm2022/snack-bar/module.mjs +5 -5
  172. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  173. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  174. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  175. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  176. package/esm2022/sort/sort-header-intl.mjs +4 -4
  177. package/esm2022/sort/sort-header.mjs +4 -4
  178. package/esm2022/sort/sort-module.mjs +5 -5
  179. package/esm2022/sort/sort.mjs +4 -4
  180. package/esm2022/stepper/step-content.mjs +4 -4
  181. package/esm2022/stepper/step-header.mjs +5 -5
  182. package/esm2022/stepper/step-label.mjs +4 -4
  183. package/esm2022/stepper/stepper-button.mjs +7 -7
  184. package/esm2022/stepper/stepper-icon.mjs +4 -4
  185. package/esm2022/stepper/stepper-intl.mjs +4 -4
  186. package/esm2022/stepper/stepper-module.mjs +5 -5
  187. package/esm2022/stepper/stepper.mjs +7 -7
  188. package/esm2022/table/cell.mjs +22 -22
  189. package/esm2022/table/module.mjs +5 -5
  190. package/esm2022/table/row.mjs +22 -22
  191. package/esm2022/table/table.mjs +7 -7
  192. package/esm2022/table/text-column.mjs +4 -4
  193. package/esm2022/tabs/module.mjs +5 -5
  194. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  195. package/esm2022/tabs/tab-body.mjs +7 -7
  196. package/esm2022/tabs/tab-content.mjs +4 -4
  197. package/esm2022/tabs/tab-group.mjs +4 -4
  198. package/esm2022/tabs/tab-header.mjs +4 -4
  199. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  200. package/esm2022/tabs/tab-label.mjs +4 -4
  201. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  202. package/esm2022/tabs/tab.mjs +4 -4
  203. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  204. package/esm2022/toolbar/toolbar.mjs +7 -7
  205. package/esm2022/tooltip/module.mjs +5 -5
  206. package/esm2022/tooltip/tooltip.mjs +7 -7
  207. package/esm2022/tree/node.mjs +10 -10
  208. package/esm2022/tree/outlet.mjs +4 -4
  209. package/esm2022/tree/padding.mjs +4 -4
  210. package/esm2022/tree/toggle.mjs +4 -4
  211. package/esm2022/tree/tree-module.mjs +5 -5
  212. package/esm2022/tree/tree.mjs +4 -4
  213. package/fesm2022/autocomplete.mjs +13 -13
  214. package/fesm2022/autocomplete.mjs.map +1 -1
  215. package/fesm2022/badge.mjs +11 -11
  216. package/fesm2022/badge.mjs.map +1 -1
  217. package/fesm2022/bottom-sheet.mjs +10 -10
  218. package/fesm2022/bottom-sheet.mjs.map +1 -1
  219. package/fesm2022/button-toggle.mjs +10 -10
  220. package/fesm2022/button-toggle.mjs.map +1 -1
  221. package/fesm2022/button.mjs +42 -42
  222. package/fesm2022/button.mjs.map +1 -1
  223. package/fesm2022/card.mjs +46 -46
  224. package/fesm2022/card.mjs.map +1 -1
  225. package/fesm2022/checkbox.mjs +16 -16
  226. package/fesm2022/checkbox.mjs.map +1 -1
  227. package/fesm2022/chips.mjs +45 -45
  228. package/fesm2022/chips.mjs.map +1 -1
  229. package/fesm2022/core.mjs +60 -60
  230. package/fesm2022/core.mjs.map +1 -1
  231. package/fesm2022/datepicker.mjs +82 -82
  232. package/fesm2022/datepicker.mjs.map +1 -1
  233. package/fesm2022/dialog.mjs +72 -43
  234. package/fesm2022/dialog.mjs.map +1 -1
  235. package/fesm2022/divider.mjs +7 -7
  236. package/fesm2022/divider.mjs.map +1 -1
  237. package/fesm2022/expansion.mjs +25 -25
  238. package/fesm2022/expansion.mjs.map +1 -1
  239. package/fesm2022/form-field.mjs +34 -34
  240. package/fesm2022/form-field.mjs.map +1 -1
  241. package/fesm2022/grid-list.mjs +22 -22
  242. package/fesm2022/grid-list.mjs.map +1 -1
  243. package/fesm2022/icon/testing.mjs +7 -7
  244. package/fesm2022/icon/testing.mjs.map +1 -1
  245. package/fesm2022/icon.mjs +10 -10
  246. package/fesm2022/icon.mjs.map +1 -1
  247. package/fesm2022/input.mjs +7 -7
  248. package/fesm2022/input.mjs.map +1 -1
  249. package/fesm2022/list.mjs +49 -49
  250. package/fesm2022/list.mjs.map +1 -1
  251. package/fesm2022/menu.mjs +16 -16
  252. package/fesm2022/menu.mjs.map +1 -1
  253. package/fesm2022/paginator.mjs +10 -10
  254. package/fesm2022/paginator.mjs.map +1 -1
  255. package/fesm2022/progress-bar.mjs +7 -7
  256. package/fesm2022/progress-bar.mjs.map +1 -1
  257. package/fesm2022/progress-spinner.mjs +7 -7
  258. package/fesm2022/progress-spinner.mjs.map +1 -1
  259. package/fesm2022/radio.mjs +11 -11
  260. package/fesm2022/radio.mjs.map +1 -1
  261. package/fesm2022/select.mjs +10 -10
  262. package/fesm2022/select.mjs.map +1 -1
  263. package/fesm2022/sidenav.mjs +22 -22
  264. package/fesm2022/sidenav.mjs.map +1 -1
  265. package/fesm2022/slide-toggle.mjs +14 -14
  266. package/fesm2022/slide-toggle.mjs.map +1 -1
  267. package/fesm2022/slider.mjs +16 -16
  268. package/fesm2022/slider.mjs.map +1 -1
  269. package/fesm2022/snack-bar.mjs +22 -22
  270. package/fesm2022/snack-bar.mjs.map +1 -1
  271. package/fesm2022/sort.mjs +13 -13
  272. package/fesm2022/sort.mjs.map +1 -1
  273. package/fesm2022/stepper.mjs +32 -32
  274. package/fesm2022/stepper.mjs.map +1 -1
  275. package/fesm2022/table.mjs +55 -55
  276. package/fesm2022/table.mjs.map +1 -1
  277. package/fesm2022/tabs.mjs +40 -40
  278. package/fesm2022/tabs.mjs.map +1 -1
  279. package/fesm2022/toolbar.mjs +10 -10
  280. package/fesm2022/toolbar.mjs.map +1 -1
  281. package/fesm2022/tooltip.mjs +10 -10
  282. package/fesm2022/tooltip.mjs.map +1 -1
  283. package/fesm2022/tree.mjs +25 -25
  284. package/fesm2022/tree.mjs.map +1 -1
  285. package/form-field/_form-field-theme.scss +31 -14
  286. package/icon/_icon-theme.scss +2 -2
  287. package/package.json +7 -7
  288. package/paginator/_paginator-theme.scss +10 -16
  289. package/prebuilt-themes/deeppurple-amber.css +1 -1
  290. package/prebuilt-themes/indigo-pink.css +1 -1
  291. package/prebuilt-themes/pink-bluegrey.css +1 -1
  292. package/prebuilt-themes/purple-green.css +1 -1
  293. package/progress-bar/_progress-bar-theme.scss +27 -9
  294. package/progress-spinner/_progress-spinner-theme.scss +38 -17
  295. package/radio/_radio-theme.scss +34 -18
  296. package/schematics/ng-add/index.js +2 -2
  297. package/schematics/ng-add/index.mjs +2 -2
  298. package/schematics/ng-generate/mdc-migration/index_bundled.js +163 -122
  299. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  300. package/select/_select-theme.scss +24 -10
  301. package/slide-toggle/_slide-toggle-theme.scss +29 -9
  302. package/slider/_slider-theme.scss +28 -11
  303. package/stepper/_stepper-theme.scss +28 -7
  304. package/tabs/_tabs-theme.scss +32 -14
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '@material/density' as mdc-density;
3
2
  @use '@material/textfield' as mdc-textfield;
4
3
  @use '../core/tokens/m2/mat/select' as tokens-mat-select;
@@ -9,6 +8,9 @@
9
8
  @use '../core/theming/inspection';
10
9
  @use '../core/typography/typography';
11
10
 
11
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
12
+ /// for the mat-select.
13
+ /// @param {Map} $theme The theme to generate base styles for.
12
14
  @mixin base($theme) {
13
15
  @if inspection.get-theme-version($theme) == 1 {
14
16
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -16,9 +18,14 @@
16
18
  @else {}
17
19
  }
18
20
 
19
- @mixin color($theme) {
21
+ /// Outputs color theme styles for the mat-select.
22
+ /// @param {Map} $theme The theme to generate color styles for.
23
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
24
+ /// $color-variant: The color variant to use for the select arrow: primary, secondary, tertiary,
25
+ /// or error (If not specified, default primary color will be used).
26
+ @mixin color($theme, $options...) {
20
27
  @if inspection.get-theme-version($theme) == 1 {
21
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
28
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
22
29
  }
23
30
  @else {
24
31
  @include sass-utils.current-selector-or-root() {
@@ -38,6 +45,8 @@
38
45
  }
39
46
  }
40
47
 
48
+ /// Outputs typography theme styles for the mat-select.
49
+ /// @param {Map} $theme The theme to generate typography styles for.
41
50
  @mixin typography($theme) {
42
51
  @if inspection.get-theme-version($theme) == 1 {
43
52
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -50,6 +59,8 @@
50
59
  }
51
60
  }
52
61
 
62
+ /// Outputs typography theme styles for the mat-select.
63
+ /// @param {Map} $theme The theme to generate density styles for.
53
64
  @mixin density($theme) {
54
65
  @if inspection.get-theme-version($theme) == 1 {
55
66
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -79,10 +90,15 @@
79
90
  }
80
91
  }
81
92
 
82
- @mixin theme($theme) {
93
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-icon.
94
+ /// @param {Map} $theme The theme to generate styles for.
95
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
96
+ /// $color-variant: The color variant to use for the select arrow: primary, secondary, tertiary,
97
+ /// or error (If not specified, default primary color will be used).
98
+ @mixin theme($theme, $options...) {
83
99
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-select') {
84
100
  @if inspection.get-theme-version($theme) == 1 {
85
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
101
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
86
102
  }
87
103
  @else {
88
104
  @include base($theme);
@@ -99,9 +115,7 @@
99
115
  }
100
116
  }
101
117
 
102
- @mixin _theme-from-tokens($tokens) {
103
- @if ($tokens != ()) {
104
- @include token-utils.create-token-values(
105
- tokens-mat-select.$prefix, map.get($tokens, tokens-mat-select.$prefix));
106
- }
118
+ @mixin _theme-from-tokens($tokens, $options...) {
119
+ $mat-select-tokens: token-utils.get-tokens-for($tokens, tokens-mat-select.$prefix, $options...);
120
+ @include token-utils.create-token-values(tokens-mat-select.$prefix, $mat-select-tokens);
107
121
  }
@@ -1,13 +1,16 @@
1
- @use 'sass:map';
2
1
  @use '@material/switch/switch-theme' as mdc-switch-theme;
3
2
  @use '@material/form-field/form-field-theme' as mdc-form-field-theme;
4
3
  @use '../core/style/sass-utils';
5
4
  @use '../core/theming/theming';
6
5
  @use '../core/theming/inspection';
6
+ @use '../core/tokens/token-utils';
7
7
  @use '../core/typography/typography';
8
8
  @use '../core/tokens/m2/mdc/form-field' as tokens-mdc-form-field;
9
9
  @use '../core/tokens/m2/mdc/switch' as tokens-mdc-switch;
10
10
 
11
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
12
+ /// for the mat-slide-toggle.
13
+ /// @param {Map} $theme The theme to generate base styles for.
11
14
  @mixin base($theme) {
12
15
  @if inspection.get-theme-version($theme) == 1 {
13
16
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -19,9 +22,14 @@
19
22
  }
20
23
  }
21
24
 
22
- @mixin color($theme) {
25
+ /// Outputs color theme styles for the mat-slide-toggle.
26
+ /// @param {Map} $theme The theme to generate color styles for.
27
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
28
+ /// $color-variant: The color variant to use for the slide-toggle: primary, secondary, tertiary,
29
+ /// or error (If not specified, default primary color will be used).
30
+ @mixin color($theme, $options...) {
23
31
  @if inspection.get-theme-version($theme) == 1 {
24
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
32
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
25
33
  }
26
34
  @else {
27
35
  $is-dark: inspection.get-theme-type($theme) == dark;
@@ -56,6 +64,8 @@
56
64
  }
57
65
  }
58
66
 
67
+ /// Outputs typography theme styles for the mat-slide-toggle.
68
+ /// @param {Map} $theme The theme to generate typography styles for.
59
69
  @mixin typography($theme) {
60
70
  @if inspection.get-theme-version($theme) == 1 {
61
71
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -74,6 +84,8 @@
74
84
  }
75
85
  }
76
86
 
87
+ /// Outputs density theme styles for the mat-slide-toggle.
88
+ /// @param {Map} $theme The theme to generate density styles for.
77
89
  @mixin density($theme) {
78
90
  @if inspection.get-theme-version($theme) == 1 {
79
91
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -85,10 +97,15 @@
85
97
  }
86
98
  }
87
99
 
88
- @mixin theme($theme) {
100
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-icon.
101
+ /// @param {Map} $theme The theme to generate styles for.
102
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
103
+ /// $color-variant: The color variant to use for the slide-toggle: primary, secondary, tertiary,
104
+ /// or error (If not specified, default primary color will be used).
105
+ @mixin theme($theme, $options...) {
89
106
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-slide-toggle') {
90
107
  @if inspection.get-theme-version($theme) == 1 {
91
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
108
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
92
109
  }
93
110
  @else {
94
111
  @include base($theme);
@@ -105,8 +122,11 @@
105
122
  }
106
123
  }
107
124
 
108
- @mixin _theme-from-tokens($tokens) {
109
- @if ($tokens != ()) {
110
- @include mdc-switch-theme.theme(map.get($tokens, tokens-mdc-switch.$prefix));
111
- }
125
+ @mixin _theme-from-tokens($tokens, $options...) {
126
+ $mdc-switch-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-switch.$prefix, $options...);
127
+ // Don't pass $options here, since the mdc-form-field doesn't support color options,
128
+ // only the mdc-switch does.
129
+ $mdc-form-field-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-form-field.$prefix);
130
+ @include mdc-switch-theme.theme($mdc-switch-tokens);
131
+ @include mdc-form-field-theme.theme($mdc-form-field-tokens);
112
132
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '@material/slider/slider-theme' as mdc-slider-theme;
3
2
  @use '../core/theming/theming';
4
3
  @use '../core/theming/inspection';
@@ -8,6 +7,9 @@
8
7
  @use '../core/tokens/m2/mat/slider' as tokens-mat-slider;
9
8
  @use '../core/tokens/m2/mdc/slider' as tokens-mdc-slider;
10
9
 
10
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
11
+ /// for the mat-slider.
12
+ /// @param {Map} $theme The theme to generate base styles for.
11
13
  @mixin base($theme) {
12
14
  @if inspection.get-theme-version($theme) == 1 {
13
15
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -22,9 +24,14 @@
22
24
  }
23
25
  }
24
26
 
25
- @mixin color($theme) {
27
+ /// Outputs color theme styles for the mat-slider.
28
+ /// @param {Map} $theme The theme to generate color styles for.
29
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
30
+ /// $color-variant: The color variant to use for the slider: primary, secondary, tertiary,
31
+ /// or error (If not specified, default primary color will be used).
32
+ @mixin color($theme, $options...) {
26
33
  @if inspection.get-theme-version($theme) == 1 {
27
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
34
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
28
35
  }
29
36
  @else {
30
37
  $is-dark: inspection.get-theme-type($theme) == dark;
@@ -66,6 +73,9 @@
66
73
  }
67
74
  }
68
75
 
76
+
77
+ /// Outputs typography theme styles for the mat-slider.
78
+ /// @param {Map} $theme The theme to generate typography styles for.
69
79
  @mixin typography($theme) {
70
80
  @if inspection.get-theme-version($theme) == 1 {
71
81
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -78,6 +88,9 @@
78
88
  }
79
89
  }
80
90
 
91
+
92
+ /// Outputs density theme styles for the mat-slider.
93
+ /// @param {Map} $theme The theme to generate density styles for.
81
94
  @mixin density($theme) {
82
95
  @if inspection.get-theme-version($theme) == 1 {
83
96
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -90,10 +103,15 @@
90
103
  }
91
104
  }
92
105
 
93
- @mixin theme($theme) {
106
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-option.
107
+ /// @param {Map} $theme The theme to generate styles for.
108
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
109
+ /// $color-variant: The color variant to use for the slider: primary, secondary, tertiary,
110
+ /// or error (If not specified, default primary color will be used).
111
+ @mixin theme($theme, $options...) {
94
112
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-slider') {
95
113
  @if inspection.get-theme-version($theme) == 1 {
96
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
114
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
97
115
  }
98
116
  @else {
99
117
  @include base($theme);
@@ -110,10 +128,9 @@
110
128
  }
111
129
  }
112
130
 
113
- @mixin _theme-from-tokens($tokens) {
114
- @if ($tokens != ()) {
115
- @include mdc-slider-theme.theme(map.get($tokens, tokens-mdc-slider.$prefix));
116
- @include token-utils.create-token-values(
117
- tokens-mat-slider.$prefix, map.get($tokens, tokens-mat-slider.$prefix));
118
- }
131
+ @mixin _theme-from-tokens($tokens, $options...) {
132
+ $mdc-slider-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-slider.$prefix, $options...);
133
+ $mat-slider-tokens: token-utils.get-tokens-for($tokens, tokens-mat-slider.$prefix, $options...);
134
+ @include mdc-slider-theme.theme($mdc-slider-tokens);
135
+ @include token-utils.create-token-values(tokens-mat-slider.$prefix, $mat-slider-tokens);
119
136
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '../core/theming/theming';
3
2
  @use '../core/theming/inspection';
4
3
  @use '../core/typography/typography';
@@ -6,6 +5,9 @@
6
5
  @use '../core/tokens/token-utils';
7
6
  @use '../core/tokens/m2/mat/stepper' as tokens-mat-stepper;
8
7
 
8
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
9
+ /// for mat-stepper.
10
+ /// @param {Map} $theme The theme to generate base styles for.
9
11
  @mixin base($theme) {
10
12
  @if inspection.get-theme-version($theme) == 1 {
11
13
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -13,9 +15,14 @@
13
15
  @else {}
14
16
  }
15
17
 
16
- @mixin color($theme) {
18
+ /// Outputs color theme styles for mat-stepper.
19
+ /// @param {Map} $theme The theme to generate color styles for.
20
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
21
+ /// $color-variant: The color variant to use for the stepper: primary, secondary,
22
+ /// tertiary, or error (If not specified, primary color values will be used).
23
+ @mixin color($theme, $options...) {
17
24
  @if inspection.get-theme-version($theme) == 1 {
18
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
25
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
19
26
  }
20
27
  @else {
21
28
  @include sass-utils.current-selector-or-root() {
@@ -35,6 +42,8 @@
35
42
  }
36
43
  }
37
44
 
45
+ /// Outputs typography theme styles for mat-stepper.
46
+ /// @param {Map} $theme The theme to generate typography styles for.
38
47
  @mixin typography($theme) {
39
48
  @if inspection.get-theme-version($theme) == 1 {
40
49
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -47,6 +56,8 @@
47
56
  }
48
57
  }
49
58
 
59
+ /// Outputs density theme styles for mat-stepper.
60
+ /// @param {Map} $theme The theme to generate density styles for.
50
61
  @mixin density($theme) {
51
62
  @if inspection.get-theme-version($theme) == 1 {
52
63
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -59,10 +70,15 @@
59
70
  }
60
71
  }
61
72
 
62
- @mixin theme($theme) {
73
+ /// Outputs all (base, color, typography, and density) theme styles for mat-stepper.
74
+ /// @param {Map} $theme The theme to generate color styles for.
75
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
76
+ /// $color-variant: The color variant to use for the stepper: primary, secondary,
77
+ /// tertiary, or error (If not specified, primary color values will be used).
78
+ @mixin theme($theme, $options...) {
63
79
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') {
64
80
  @if inspection.get-theme-version($theme) == 1 {
65
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
81
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
66
82
  }
67
83
  @else {
68
84
  @include base($theme);
@@ -79,9 +95,14 @@
79
95
  }
80
96
  }
81
97
 
82
- @mixin _theme-from-tokens($tokens) {
98
+ @mixin _theme-from-tokens($tokens, $options...) {
83
99
  @if ($tokens != ()) {
100
+ $mat-stepper-tokens: token-utils.get-tokens-for(
101
+ $tokens,
102
+ tokens-mat-stepper.$prefix,
103
+ $options...
104
+ );
84
105
  @include token-utils.create-token-values(
85
- tokens-mat-stepper.$prefix, map.get($tokens, tokens-mat-stepper.$prefix));
106
+ tokens-mat-stepper.$prefix, $mat-stepper-tokens);
86
107
  }
87
108
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
3
2
  @use '@material/tab/tab-theme' as mdc-tab-theme;
4
3
  @use '../core/style/sass-utils';
@@ -11,6 +10,9 @@
11
10
  @use '../core/typography/typography';
12
11
  @use '../core/tokens/token-utils';
13
12
 
13
+ /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
14
+ /// for the mat-tab.
15
+ /// @param {Map} $theme The theme to generate base styles for.
14
16
  @mixin base($theme) {
15
17
  @if inspection.get-theme-version($theme) == 1 {
16
18
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
@@ -29,9 +31,14 @@
29
31
  }
30
32
  }
31
33
 
32
- @mixin color($theme) {
34
+ /// Outputs color theme styles for the mat-tab.
35
+ /// @param {Map} $theme The theme to generate color styles for.
36
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
37
+ /// $color-variant: The color variant to use for the tab indicator: primary, secondary,
38
+ /// tertiary, or error (If not specified, default primary color will be used).
39
+ @mixin color($theme, $options...) {
33
40
  @if inspection.get-theme-version($theme) == 1 {
34
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
41
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
35
42
  }
36
43
  @else {
37
44
  .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
@@ -74,6 +81,8 @@
74
81
  tokens-mat-tab-header.get-color-tokens($theme, $palette-name));
75
82
  }
76
83
 
84
+ /// Outputs typography theme styles for the mat-tab.
85
+ /// @param {Map} $theme The theme to generate typography styles for.
77
86
  @mixin typography($theme) {
78
87
  @if inspection.get-theme-version($theme) == 1 {
79
88
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
@@ -92,6 +101,8 @@
92
101
  }
93
102
  }
94
103
 
104
+ /// Outputs density theme styles for the mat-tab.
105
+ /// @param {Map} $theme The theme to generate density styles for.
95
106
  @mixin density($theme) {
96
107
  @if inspection.get-theme-version($theme) == 1 {
97
108
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
@@ -110,10 +121,15 @@
110
121
  }
111
122
  }
112
123
 
113
- @mixin theme($theme) {
124
+ /// Outputs all (base, color, typography, and density) theme styles for the mat-tab.
125
+ /// @param {Map} $theme The theme to generate styles for.
126
+ /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
127
+ /// $color-variant: The color variant to use for the tab indicator: primary, secondary,
128
+ /// tertiary, or error (If not specified, default primary color will be used).
129
+ @mixin theme($theme, $options...) {
114
130
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tabs') {
115
131
  @if inspection.get-theme-version($theme) == 1 {
116
- @include _theme-from-tokens(inspection.get-theme-tokens($theme));
132
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
117
133
  }
118
134
  @else {
119
135
  @include base($theme);
@@ -130,13 +146,15 @@
130
146
  }
131
147
  }
132
148
 
133
- @mixin _theme-from-tokens($tokens) {
134
- @if ($tokens != ()) {
135
- @include mdc-tab-theme.secondary-navigation-tab-theme(
136
- map.get($tokens, tokens-mdc-tab.$prefix));
137
- @include mdc-tab-indicator-theme.theme(
138
- map.get($tokens, tokens-mdc-tab-indicator.$prefix));
139
- @include token-utils.create-token-values(
140
- tokens-mat-tab-header.$prefix, map.get($tokens, tokens-mat-tab-header.$prefix));
141
- }
149
+ @mixin _theme-from-tokens($tokens, $options...) {
150
+ $mdc-tab-indicator-tokens: token-utils.get-tokens-for(
151
+ $tokens, tokens-mdc-tab-indicator.$prefix, $options...);
152
+ $mat-tab-header-tokens: token-utils.get-tokens-for(
153
+ $tokens, tokens-mat-tab-header.$prefix, $options...);
154
+ // Don't pass $options here, because the mdc-tab doesn't have color variants,
155
+ // only the mdc-tab-indicator and mat-tab-header do.
156
+ $mdc-tab-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-tab.$prefix);
157
+ @include mdc-tab-theme.secondary-navigation-tab-theme($mdc-tab-tokens);
158
+ @include mdc-tab-indicator-theme.theme($mdc-tab-indicator-tokens);
159
+ @include token-utils.create-token-values(tokens-mat-tab-header.$prefix, $mat-tab-header-tokens);
142
160
  }