@angular/material 17.0.0 → 17.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/autocomplete/_autocomplete-theme.scss +47 -14
  2. package/autocomplete/index.d.ts +0 -2
  3. package/badge/_badge-theme.scss +67 -35
  4. package/bottom-sheet/_bottom-sheet-theme.scss +51 -18
  5. package/button/_button-theme.scss +7 -0
  6. package/button-toggle/_button-toggle-theme.scss +66 -32
  7. package/chips/_chips-theme.scss +64 -32
  8. package/core/_core-theme.scss +1 -3
  9. package/core/option/_optgroup-theme.scss +47 -16
  10. package/core/option/_option-theme.scss +54 -23
  11. package/core/ripple/_ripple-theme.scss +51 -19
  12. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +18 -58
  13. package/core/tokens/m2/_index.scss +57 -8
  14. package/core/tokens/m2/mat/_full-pseudo-checkbox.scss +49 -0
  15. package/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss +43 -0
  16. package/datepicker/_datepicker-theme.scss +70 -38
  17. package/dialog/_dialog-theme.scss +48 -17
  18. package/divider/_divider-theme.scss +49 -16
  19. package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
  20. package/esm2022/autocomplete/autocomplete-trigger.mjs +19 -10
  21. package/esm2022/autocomplete/autocomplete.mjs +3 -3
  22. package/esm2022/autocomplete/module.mjs +4 -4
  23. package/esm2022/badge/badge-module.mjs +4 -4
  24. package/esm2022/badge/badge.mjs +3 -3
  25. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  26. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +4 -4
  27. package/esm2022/bottom-sheet/bottom-sheet.mjs +3 -3
  28. package/esm2022/button/button-base.mjs +6 -6
  29. package/esm2022/button/button.mjs +6 -6
  30. package/esm2022/button/fab.mjs +12 -12
  31. package/esm2022/button/icon-button.mjs +6 -6
  32. package/esm2022/button/module.mjs +4 -4
  33. package/esm2022/button-toggle/button-toggle-module.mjs +4 -4
  34. package/esm2022/button-toggle/button-toggle.mjs +6 -6
  35. package/esm2022/card/card.mjs +42 -42
  36. package/esm2022/card/module.mjs +4 -4
  37. package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
  38. package/esm2022/checkbox/checkbox.mjs +3 -3
  39. package/esm2022/checkbox/module.mjs +8 -8
  40. package/esm2022/chips/chip-action.mjs +3 -3
  41. package/esm2022/chips/chip-edit-input.mjs +3 -3
  42. package/esm2022/chips/chip-grid.mjs +3 -3
  43. package/esm2022/chips/chip-icons.mjs +9 -9
  44. package/esm2022/chips/chip-input.mjs +3 -3
  45. package/esm2022/chips/chip-listbox.mjs +3 -3
  46. package/esm2022/chips/chip-option.mjs +3 -3
  47. package/esm2022/chips/chip-row.mjs +3 -3
  48. package/esm2022/chips/chip-set.mjs +3 -3
  49. package/esm2022/chips/chip.mjs +3 -3
  50. package/esm2022/chips/module.mjs +4 -4
  51. package/esm2022/core/common-behaviors/common-module.mjs +4 -4
  52. package/esm2022/core/datetime/index.mjs +8 -8
  53. package/esm2022/core/datetime/native-date-adapter.mjs +3 -3
  54. package/esm2022/core/error/error-options.mjs +6 -6
  55. package/esm2022/core/line/line.mjs +7 -7
  56. package/esm2022/core/option/index.mjs +4 -4
  57. package/esm2022/core/option/optgroup.mjs +3 -3
  58. package/esm2022/core/option/option.mjs +3 -3
  59. package/esm2022/core/private/ripple-loader.mjs +3 -3
  60. package/esm2022/core/ripple/index.mjs +4 -4
  61. package/esm2022/core/ripple/ripple.mjs +3 -3
  62. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
  63. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  64. package/esm2022/core/version.mjs +1 -1
  65. package/esm2022/datepicker/calendar-body.mjs +5 -5
  66. package/esm2022/datepicker/calendar.mjs +6 -6
  67. package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
  68. package/esm2022/datepicker/date-range-input.mjs +3 -3
  69. package/esm2022/datepicker/date-range-picker.mjs +3 -3
  70. package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
  71. package/esm2022/datepicker/date-selection-model.mjs +9 -9
  72. package/esm2022/datepicker/datepicker-actions.mjs +9 -9
  73. package/esm2022/datepicker/datepicker-base.mjs +6 -6
  74. package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
  75. package/esm2022/datepicker/datepicker-input.mjs +3 -3
  76. package/esm2022/datepicker/datepicker-intl.mjs +3 -3
  77. package/esm2022/datepicker/datepicker-module.mjs +4 -4
  78. package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
  79. package/esm2022/datepicker/datepicker.mjs +3 -3
  80. package/esm2022/datepicker/month-view.mjs +3 -3
  81. package/esm2022/datepicker/multi-year-view.mjs +3 -3
  82. package/esm2022/datepicker/year-view.mjs +3 -3
  83. package/esm2022/dialog/dialog-container.mjs +3 -3
  84. package/esm2022/dialog/dialog-content-directives.mjs +12 -12
  85. package/esm2022/dialog/dialog.mjs +3 -3
  86. package/esm2022/dialog/module.mjs +4 -4
  87. package/esm2022/divider/divider-module.mjs +4 -4
  88. package/esm2022/divider/divider.mjs +3 -3
  89. package/esm2022/expansion/accordion.mjs +3 -3
  90. package/esm2022/expansion/expansion-module.mjs +4 -4
  91. package/esm2022/expansion/expansion-panel-content.mjs +3 -3
  92. package/esm2022/expansion/expansion-panel-header.mjs +9 -9
  93. package/esm2022/expansion/expansion-panel.mjs +6 -6
  94. package/esm2022/form-field/directives/error.mjs +3 -3
  95. package/esm2022/form-field/directives/floating-label.mjs +3 -3
  96. package/esm2022/form-field/directives/hint.mjs +3 -3
  97. package/esm2022/form-field/directives/label.mjs +3 -3
  98. package/esm2022/form-field/directives/line-ripple.mjs +3 -3
  99. package/esm2022/form-field/directives/notched-outline.mjs +3 -3
  100. package/esm2022/form-field/directives/prefix.mjs +3 -3
  101. package/esm2022/form-field/directives/suffix.mjs +3 -3
  102. package/esm2022/form-field/form-field-control.mjs +3 -3
  103. package/esm2022/form-field/form-field.mjs +3 -3
  104. package/esm2022/form-field/module.mjs +4 -4
  105. package/esm2022/grid-list/grid-list-module.mjs +4 -4
  106. package/esm2022/grid-list/grid-list.mjs +3 -3
  107. package/esm2022/grid-list/grid-tile.mjs +15 -15
  108. package/esm2022/icon/icon-module.mjs +4 -4
  109. package/esm2022/icon/icon-registry.mjs +3 -3
  110. package/esm2022/icon/icon.mjs +3 -3
  111. package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
  112. package/esm2022/input/input.mjs +3 -3
  113. package/esm2022/input/module.mjs +4 -4
  114. package/esm2022/list/action-list.mjs +3 -3
  115. package/esm2022/list/list-base.mjs +12 -12
  116. package/esm2022/list/list-item-sections.mjs +18 -18
  117. package/esm2022/list/list-module.mjs +4 -4
  118. package/esm2022/list/list-option.mjs +3 -3
  119. package/esm2022/list/list.mjs +6 -6
  120. package/esm2022/list/nav-list.mjs +3 -3
  121. package/esm2022/list/selection-list.mjs +3 -3
  122. package/esm2022/list/subheader.mjs +3 -3
  123. package/esm2022/menu/menu-content.mjs +3 -3
  124. package/esm2022/menu/menu-item.mjs +3 -3
  125. package/esm2022/menu/menu-trigger.mjs +3 -3
  126. package/esm2022/menu/menu.mjs +3 -3
  127. package/esm2022/menu/module.mjs +4 -4
  128. package/esm2022/paginator/module.mjs +4 -4
  129. package/esm2022/paginator/paginator-intl.mjs +3 -3
  130. package/esm2022/paginator/paginator.mjs +3 -3
  131. package/esm2022/progress-bar/module.mjs +4 -4
  132. package/esm2022/progress-bar/progress-bar.mjs +3 -3
  133. package/esm2022/progress-spinner/module.mjs +4 -4
  134. package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
  135. package/esm2022/radio/module.mjs +4 -4
  136. package/esm2022/radio/radio.mjs +6 -6
  137. package/esm2022/select/module.mjs +4 -4
  138. package/esm2022/select/select.mjs +8 -8
  139. package/esm2022/sidenav/drawer.mjs +9 -9
  140. package/esm2022/sidenav/sidenav-module.mjs +4 -4
  141. package/esm2022/sidenav/sidenav.mjs +9 -9
  142. package/esm2022/slide-toggle/module.mjs +8 -8
  143. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
  144. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  145. package/esm2022/slider/module.mjs +4 -4
  146. package/esm2022/slider/slider-input.mjs +6 -6
  147. package/esm2022/slider/slider-thumb.mjs +3 -3
  148. package/esm2022/slider/slider.mjs +3 -3
  149. package/esm2022/snack-bar/module.mjs +4 -4
  150. package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
  151. package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
  152. package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
  153. package/esm2022/snack-bar/snack-bar.mjs +3 -3
  154. package/esm2022/sort/sort-header-intl.mjs +3 -3
  155. package/esm2022/sort/sort-header.mjs +3 -3
  156. package/esm2022/sort/sort-module.mjs +4 -4
  157. package/esm2022/sort/sort.mjs +3 -3
  158. package/esm2022/stepper/step-content.mjs +3 -3
  159. package/esm2022/stepper/step-header.mjs +3 -3
  160. package/esm2022/stepper/step-label.mjs +3 -3
  161. package/esm2022/stepper/stepper-button.mjs +6 -6
  162. package/esm2022/stepper/stepper-icon.mjs +3 -3
  163. package/esm2022/stepper/stepper-intl.mjs +3 -3
  164. package/esm2022/stepper/stepper-module.mjs +4 -4
  165. package/esm2022/stepper/stepper.mjs +6 -6
  166. package/esm2022/table/cell.mjs +21 -21
  167. package/esm2022/table/module.mjs +4 -4
  168. package/esm2022/table/row.mjs +21 -21
  169. package/esm2022/table/table.mjs +6 -6
  170. package/esm2022/table/text-column.mjs +3 -3
  171. package/esm2022/tabs/module.mjs +4 -4
  172. package/esm2022/tabs/paginated-tab-header.mjs +3 -3
  173. package/esm2022/tabs/tab-body.mjs +6 -6
  174. package/esm2022/tabs/tab-content.mjs +3 -3
  175. package/esm2022/tabs/tab-group.mjs +3 -3
  176. package/esm2022/tabs/tab-header.mjs +3 -3
  177. package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
  178. package/esm2022/tabs/tab-label.mjs +3 -3
  179. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +9 -9
  180. package/esm2022/tabs/tab.mjs +3 -3
  181. package/esm2022/toolbar/toolbar-module.mjs +4 -4
  182. package/esm2022/toolbar/toolbar.mjs +6 -6
  183. package/esm2022/tooltip/module.mjs +4 -4
  184. package/esm2022/tooltip/tooltip.mjs +7 -7
  185. package/esm2022/tree/node.mjs +9 -9
  186. package/esm2022/tree/outlet.mjs +3 -3
  187. package/esm2022/tree/padding.mjs +3 -3
  188. package/esm2022/tree/toggle.mjs +3 -3
  189. package/esm2022/tree/tree-module.mjs +4 -4
  190. package/esm2022/tree/tree.mjs +3 -3
  191. package/fesm2022/autocomplete.mjs +28 -19
  192. package/fesm2022/autocomplete.mjs.map +1 -1
  193. package/fesm2022/badge.mjs +7 -7
  194. package/fesm2022/bottom-sheet.mjs +10 -10
  195. package/fesm2022/button-toggle.mjs +10 -10
  196. package/fesm2022/button.mjs +34 -34
  197. package/fesm2022/card.mjs +46 -46
  198. package/fesm2022/checkbox.mjs +14 -14
  199. package/fesm2022/chips.mjs +40 -40
  200. package/fesm2022/core.mjs +57 -57
  201. package/fesm2022/core.mjs.map +1 -1
  202. package/fesm2022/datepicker.mjs +83 -83
  203. package/fesm2022/datepicker.mjs.map +1 -1
  204. package/fesm2022/dialog.mjs +22 -22
  205. package/fesm2022/divider.mjs +7 -7
  206. package/fesm2022/expansion.mjs +25 -25
  207. package/fesm2022/form-field.mjs +34 -34
  208. package/fesm2022/grid-list.mjs +22 -22
  209. package/fesm2022/icon/testing.mjs +7 -7
  210. package/fesm2022/icon.mjs +10 -10
  211. package/fesm2022/input.mjs +7 -7
  212. package/fesm2022/list.mjs +54 -54
  213. package/fesm2022/list.mjs.map +1 -1
  214. package/fesm2022/menu.mjs +16 -16
  215. package/fesm2022/paginator.mjs +10 -10
  216. package/fesm2022/progress-bar.mjs +7 -7
  217. package/fesm2022/progress-spinner.mjs +7 -7
  218. package/fesm2022/radio.mjs +10 -10
  219. package/fesm2022/select.mjs +11 -11
  220. package/fesm2022/select.mjs.map +1 -1
  221. package/fesm2022/sidenav.mjs +22 -22
  222. package/fesm2022/slide-toggle.mjs +14 -14
  223. package/fesm2022/slider.mjs +16 -16
  224. package/fesm2022/snack-bar.mjs +22 -22
  225. package/fesm2022/sort.mjs +13 -13
  226. package/fesm2022/stepper.mjs +31 -31
  227. package/fesm2022/table.mjs +55 -55
  228. package/fesm2022/tabs.mjs +40 -40
  229. package/fesm2022/toolbar.mjs +10 -10
  230. package/fesm2022/tooltip.mjs +11 -11
  231. package/fesm2022/tooltip.mjs.map +1 -1
  232. package/fesm2022/tree.mjs +25 -25
  233. package/form-field/_form-field-theme.scss +85 -49
  234. package/grid-list/_grid-list-theme.scss +47 -14
  235. package/icon/_icon-theme.scss +55 -23
  236. package/input/_input-theme.scss +39 -12
  237. package/list/_list-theme.scss +115 -83
  238. package/menu/_menu-theme.scss +50 -18
  239. package/package.json +2 -2
  240. package/paginator/_paginator-theme.scss +62 -29
  241. package/prebuilt-themes/deeppurple-amber.css +1 -1
  242. package/prebuilt-themes/indigo-pink.css +1 -1
  243. package/prebuilt-themes/pink-bluegrey.css +1 -1
  244. package/prebuilt-themes/purple-green.css +1 -1
  245. package/schematics/ng-add/index.js +1 -1
  246. package/schematics/ng-add/index.mjs +1 -1
  247. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -29
  248. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +21 -19
  249. package/schematics/ng-generate/mdc-migration/index_bundled.js +427 -201
  250. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  251. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +9 -8
  252. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -2
  253. package/schematics/ng-update/index_bundled.js +41 -37
  254. package/schematics/ng-update/index_bundled.js.map +2 -2
  255. package/select/_select-theme.scss +71 -38
  256. package/sidenav/_sidenav-theme.scss +49 -16
  257. package/slide-toggle/_slide-toggle-theme.scss +78 -44
  258. package/sort/_sort-theme.scss +51 -20
  259. package/stepper/_stepper-theme.scss +58 -25
  260. package/table/_table-theme.scss +53 -20
  261. package/tabs/_tabs-theme.scss +87 -51
  262. package/tree/_tree-theme.scss +53 -21
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '@material/density' as mdc-density;
2
3
  @use '@material/textfield' as mdc-textfield;
3
4
  @use '../core/tokens/m2/mat/select' as tokens-mat-select;
@@ -8,67 +9,99 @@
8
9
  @use '../core/theming/inspection';
9
10
  @use '../core/typography/typography';
10
11
 
11
- @mixin base($theme) {}
12
+ @mixin base($theme) {
13
+ @if inspection.get-theme-version($theme) == 1 {
14
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
15
+ }
16
+ @else {}
17
+ }
12
18
 
13
19
  @mixin color($theme) {
14
- @include sass-utils.current-selector-or-root() {
15
- @include token-utils.create-token-values(tokens-mat-select.$prefix,
16
- tokens-mat-select.get-color-tokens($theme));
17
-
18
- .mat-mdc-form-field.mat-accent {
20
+ @if inspection.get-theme-version($theme) == 1 {
21
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
22
+ }
23
+ @else {
24
+ @include sass-utils.current-selector-or-root() {
19
25
  @include token-utils.create-token-values(tokens-mat-select.$prefix,
20
- tokens-mat-select.get-color-tokens($theme, accent));
21
- }
26
+ tokens-mat-select.get-color-tokens($theme));
22
27
 
23
- .mat-mdc-form-field.mat-warn {
24
- @include token-utils.create-token-values(tokens-mat-select.$prefix,
25
- tokens-mat-select.get-color-tokens($theme, warn));
28
+ .mat-mdc-form-field.mat-accent {
29
+ @include token-utils.create-token-values(tokens-mat-select.$prefix,
30
+ tokens-mat-select.get-color-tokens($theme, accent));
31
+ }
32
+
33
+ .mat-mdc-form-field.mat-warn {
34
+ @include token-utils.create-token-values(tokens-mat-select.$prefix,
35
+ tokens-mat-select.get-color-tokens($theme, warn));
36
+ }
26
37
  }
27
38
  }
28
39
  }
29
40
 
30
41
  @mixin typography($theme) {
31
- @include sass-utils.current-selector-or-root() {
32
- @include token-utils.create-token-values(tokens-mat-select.$prefix,
33
- tokens-mat-select.get-typography-tokens($theme));
42
+ @if inspection.get-theme-version($theme) == 1 {
43
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
44
+ }
45
+ @else {
46
+ @include sass-utils.current-selector-or-root() {
47
+ @include token-utils.create-token-values(tokens-mat-select.$prefix,
48
+ tokens-mat-select.get-typography-tokens($theme));
49
+ }
34
50
  }
35
51
  }
36
52
 
37
53
  @mixin density($theme) {
38
- $density-scale: inspection.get-theme-density($theme);
54
+ @if inspection.get-theme-version($theme) == 1 {
55
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
56
+ }
57
+ @else {
58
+ $density-scale: inspection.get-theme-density($theme);
39
59
 
40
- // Density is clamped at -5 here, because MDC's form field throws an error for anything lower.
41
- $form-field-height: mdc-density.prop-value(
42
- $density-config: mdc-textfield.$density-config,
43
- $density-scale: theming.clamp-density($density-scale, -5),
44
- $property-name: height,
45
- );
60
+ // Density is clamped at -5 here, because MDC's form field throws an error for anything lower.
61
+ $form-field-height: mdc-density.prop-value(
62
+ $density-config: mdc-textfield.$density-config,
63
+ $density-scale: theming.clamp-density($density-scale, -5),
64
+ $property-name: height,
65
+ );
46
66
 
47
- // On lower densities the filled form field hides its label which causes the label to
48
- // be misaligned. Remove the additional offset that was added because of the label.
49
- @if ($form-field-height < mdc-textfield.$minimum-height-for-filled-label) {
50
- .mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper {
51
- transform: none;
67
+ // On lower densities the filled form field hides its label which causes the label to
68
+ // be misaligned. Remove the additional offset that was added because of the label.
69
+ @if ($form-field-height < mdc-textfield.$minimum-height-for-filled-label) {
70
+ .mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper {
71
+ transform: none;
72
+ }
52
73
  }
53
- }
54
74
 
55
- @include sass-utils.current-selector-or-root() {
56
- @include token-utils.create-token-values(tokens-mat-select.$prefix,
57
- tokens-mat-select.get-density-tokens($theme));
75
+ @include sass-utils.current-selector-or-root() {
76
+ @include token-utils.create-token-values(tokens-mat-select.$prefix,
77
+ tokens-mat-select.get-density-tokens($theme));
78
+ }
58
79
  }
59
80
  }
60
81
 
61
82
  @mixin theme($theme) {
62
83
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-select') {
63
- @include base($theme);
64
- @if inspection.theme-has($theme, color) {
65
- @include color($theme);
84
+ @if inspection.get-theme-version($theme) == 1 {
85
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
66
86
  }
67
- @if inspection.theme-has($theme, density) {
68
- @include density($theme);
69
- }
70
- @if inspection.theme-has($theme, typography) {
71
- @include typography($theme);
87
+ @else {
88
+ @include base($theme);
89
+ @if inspection.theme-has($theme, color) {
90
+ @include color($theme);
91
+ }
92
+ @if inspection.theme-has($theme, density) {
93
+ @include density($theme);
94
+ }
95
+ @if inspection.theme-has($theme, typography) {
96
+ @include typography($theme);
97
+ }
72
98
  }
73
99
  }
74
100
  }
101
+
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
+ }
107
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/theming/theming';
2
3
  @use '../core/theming/inspection';
3
4
  @use '../core/tokens/m2/mat/sidenav' as tokens-mat-sidenav;
@@ -5,34 +6,66 @@
5
6
  @use '../core/style/sass-utils';
6
7
 
7
8
  @mixin base($theme) {
8
- @include sass-utils.current-selector-or-root() {
9
- @include token-utils.create-token-values(
10
- tokens-mat-sidenav.$prefix, tokens-mat-sidenav.get-unthemable-tokens());
9
+ @if inspection.get-theme-version($theme) == 1 {
10
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
11
+ }
12
+ @else {
13
+ @include sass-utils.current-selector-or-root() {
14
+ @include token-utils.create-token-values(
15
+ tokens-mat-sidenav.$prefix, tokens-mat-sidenav.get-unthemable-tokens());
16
+ }
11
17
  }
12
18
  }
13
19
 
14
20
  @mixin color($theme) {
15
- @include sass-utils.current-selector-or-root() {
16
- @include token-utils.create-token-values(tokens-mat-sidenav.$prefix,
17
- tokens-mat-sidenav.get-color-tokens($theme));
21
+ @if inspection.get-theme-version($theme) == 1 {
22
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
23
+ }
24
+ @else {
25
+ @include sass-utils.current-selector-or-root() {
26
+ @include token-utils.create-token-values(tokens-mat-sidenav.$prefix,
27
+ tokens-mat-sidenav.get-color-tokens($theme));
28
+ }
18
29
  }
19
30
  }
20
31
 
21
- @mixin typography($theme) {}
32
+ @mixin typography($theme) {
33
+ @if inspection.get-theme-version($theme) == 1 {
34
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
35
+ }
36
+ @else {}
37
+ }
22
38
 
23
- @mixin density($theme) {}
39
+ @mixin density($theme) {
40
+ @if inspection.get-theme-version($theme) == 1 {
41
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
42
+ }
43
+ @else {}
44
+ }
24
45
 
25
46
  @mixin theme($theme) {
26
47
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-sidenav') {
27
- @include base($theme);
28
- @if inspection.theme-has($theme, color) {
29
- @include color($theme);
48
+ @if inspection.get-theme-version($theme) == 1 {
49
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
30
50
  }
31
- @if inspection.theme-has($theme, density) {
32
- @include density($theme);
33
- }
34
- @if inspection.theme-has($theme, typography) {
35
- @include typography($theme);
51
+ @else {
52
+ @include base($theme);
53
+ @if inspection.theme-has($theme, color) {
54
+ @include color($theme);
55
+ }
56
+ @if inspection.theme-has($theme, density) {
57
+ @include density($theme);
58
+ }
59
+ @if inspection.theme-has($theme, typography) {
60
+ @include typography($theme);
61
+ }
36
62
  }
37
63
  }
38
64
  }
65
+
66
+ @mixin _theme-from-tokens($tokens) {
67
+ @if ($tokens != ()) {
68
+ @include token-utils.create-token-values(
69
+ tokens-mat-sidenav.$prefix, map.get($tokens, tokens-mat-sidenav.$prefix));
70
+ }
71
+ }
@@ -1,82 +1,116 @@
1
+ @use 'sass:map';
1
2
  @use '@material/switch/switch-theme' as mdc-switch-theme;
2
3
  @use '@material/form-field' as mdc-form-field;
3
4
  @use '../core/theming/theming';
4
5
  @use '../core/theming/inspection';
5
6
  @use '../core/mdc-helpers/mdc-helpers';
6
7
  @use '../core/typography/typography';
7
- @use '../core/tokens/m2/mdc/switch' as m2-mdc-switch;
8
- @use '../core/tokens/m2/mat/slide-toggle' as m2-mat-slide-toggle;
8
+ @use '../core/tokens/m2/mdc/switch' as tokens-mdc-switch;
9
+ @use '../core/tokens/m2/mat/slide-toggle' as tokens-mat-slide-toggle;
9
10
  @use '../core/tokens/token-utils';
10
11
 
11
12
  @mixin base($theme) {
12
- .mdc-switch {
13
- @include mdc-switch-theme.theme(m2-mdc-switch.get-unthemable-tokens());
13
+ @if inspection.get-theme-version($theme) == 1 {
14
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
15
+ }
16
+ @else {
17
+ .mdc-switch {
18
+ @include mdc-switch-theme.theme(tokens-mdc-switch.get-unthemable-tokens());
19
+ }
14
20
  }
15
21
  }
16
22
 
17
23
  @mixin color($theme) {
18
- $is-dark: inspection.get-theme-type($theme) == dark;
19
- $mdc-switch-color-tokens: m2-mdc-switch.get-color-tokens($theme);
24
+ @if inspection.get-theme-version($theme) == 1 {
25
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
26
+ }
27
+ @else {
28
+ $is-dark: inspection.get-theme-type($theme) == dark;
29
+ $mdc-switch-color-tokens: tokens-mdc-switch.get-color-tokens($theme);
20
30
 
21
- @include mdc-helpers.using-mdc-theme($theme) {
22
- // Add values for MDC slide toggles tokens
23
- .mat-mdc-slide-toggle {
24
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
25
- @include mdc-switch-theme.theme($mdc-switch-color-tokens);
31
+ @include mdc-helpers.using-mdc-theme($theme) {
32
+ // Add values for MDC slide toggles tokens
33
+ .mat-mdc-slide-toggle {
34
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
35
+ @include mdc-switch-theme.theme($mdc-switch-color-tokens);
26
36
 
27
- // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
28
- .mdc-switch--disabled + label {
29
- color: inspection.get-theme-color($theme, foreground, disabled-text);
30
- }
37
+ // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
38
+ .mdc-switch--disabled + label {
39
+ color: inspection.get-theme-color($theme, foreground, disabled-text);
40
+ }
31
41
 
32
- // Change the color palette related tokens to accent or warn if applicable
33
- &.mat-accent {
34
- @include mdc-switch-theme.theme(
35
- m2-mdc-switch.private-get-color-palette-color-tokens($theme, accent));
36
- }
42
+ // Change the color palette related tokens to accent or warn if applicable
43
+ &.mat-accent {
44
+ @include mdc-switch-theme.theme(
45
+ tokens-mdc-switch.private-get-color-palette-color-tokens($theme, accent));
46
+ }
37
47
 
38
- &.mat-warn {
39
- @include mdc-switch-theme.theme(
40
- m2-mdc-switch.private-get-color-palette-color-tokens($theme, warn));
48
+ &.mat-warn {
49
+ @include mdc-switch-theme.theme(
50
+ tokens-mdc-switch.private-get-color-palette-color-tokens($theme, warn));
51
+ }
41
52
  }
42
53
  }
43
54
  }
44
55
  }
45
56
 
46
57
  @mixin typography($theme) {
47
- $mdc-switch-typography-tokens: m2-mdc-switch.get-typography-tokens($theme);
48
- $mat-slide-toggle-typography-tokens: m2-mat-slide-toggle.get-typography-tokens($theme);
58
+ @if inspection.get-theme-version($theme) == 1 {
59
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
60
+ }
61
+ @else {
62
+ $mdc-switch-typography-tokens: tokens-mdc-switch.get-typography-tokens($theme);
63
+ $mat-slide-toggle-typography-tokens: tokens-mat-slide-toggle.get-typography-tokens($theme);
49
64
 
50
- //Add values for MDC slide toggle tokens
51
- .mat-mdc-slide-toggle {
52
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
53
- @include mdc-switch-theme.theme($mdc-switch-typography-tokens);
54
- @include token-utils.create-token-values(
55
- m2-mat-slide-toggle.$prefix,
56
- $mat-slide-toggle-typography-tokens
57
- );
65
+ //Add values for MDC slide toggle tokens
66
+ .mat-mdc-slide-toggle {
67
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
68
+ @include mdc-switch-theme.theme($mdc-switch-typography-tokens);
69
+ @include token-utils.create-token-values(
70
+ tokens-mat-slide-toggle.$prefix,
71
+ $mat-slide-toggle-typography-tokens
72
+ );
73
+ }
58
74
  }
59
75
  }
60
76
 
61
77
  @mixin density($theme) {
62
- $density-scale: inspection.get-theme-density($theme);
78
+ @if inspection.get-theme-version($theme) == 1 {
79
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
80
+ }
81
+ @else {
82
+ $density-scale: inspection.get-theme-density($theme);
63
83
 
64
- .mat-mdc-slide-toggle {
65
- @include mdc-switch-theme.theme(mdc-switch-theme.density($density-scale));
84
+ .mat-mdc-slide-toggle {
85
+ @include mdc-switch-theme.theme(mdc-switch-theme.density($density-scale));
86
+ }
66
87
  }
67
88
  }
68
89
 
69
90
  @mixin theme($theme) {
70
91
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-slide-toggle') {
71
- @include base($theme);
72
- @if inspection.theme-has($theme, color) {
73
- @include color($theme);
74
- }
75
- @if inspection.theme-has($theme, density) {
76
- @include density($theme);
92
+ @if inspection.get-theme-version($theme) == 1 {
93
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
77
94
  }
78
- @if inspection.theme-has($theme, typography) {
79
- @include typography($theme);
95
+ @else {
96
+ @include base($theme);
97
+ @if inspection.theme-has($theme, color) {
98
+ @include color($theme);
99
+ }
100
+ @if inspection.theme-has($theme, density) {
101
+ @include density($theme);
102
+ }
103
+ @if inspection.theme-has($theme, typography) {
104
+ @include typography($theme);
105
+ }
80
106
  }
81
107
  }
82
108
  }
109
+
110
+ @mixin _theme-from-tokens($tokens) {
111
+ @if ($tokens != ()) {
112
+ @include mdc-switch-theme.theme(map.get($tokens, tokens-mdc-switch.$prefix));
113
+ @include token-utils.create-token-values(
114
+ tokens-mat-slide-toggle.$prefix, map.get($tokens, tokens-mat-slide-toggle.$prefix));
115
+ }
116
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/tokens/m2/mat/sort' as tokens-mat-sort;
2
3
  @use '../core/style/sass-utils';
3
4
  @use '../core/typography/typography';
@@ -5,42 +6,72 @@
5
6
  @use '../core/theming/inspection';
6
7
  @use '../core/tokens/token-utils';
7
8
 
8
- @mixin base($theme) {}
9
+ @mixin base($theme) {
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {}
14
+ }
9
15
 
10
16
  @mixin color($theme) {
11
- @include sass-utils.current-selector-or-root() {
12
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
13
- tokens-mat-sort.get-color-tokens($theme));
17
+ @if inspection.get-theme-version($theme) == 1 {
18
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
19
+ }
20
+ @else {
21
+ @include sass-utils.current-selector-or-root() {
22
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
23
+ tokens-mat-sort.get-color-tokens($theme));
24
+ }
14
25
  }
15
26
  }
16
27
 
17
28
  @mixin typography($theme) {
18
- @include sass-utils.current-selector-or-root() {
19
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
20
- tokens-mat-sort.get-typography-tokens($theme));
29
+ @if inspection.get-theme-version($theme) == 1 {
30
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
31
+ }
32
+ @else {
33
+ @include sass-utils.current-selector-or-root() {
34
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
35
+ tokens-mat-sort.get-typography-tokens($theme));
36
+ }
21
37
  }
22
38
  }
23
39
 
24
40
  @mixin density($theme) {
25
- $density-scale: inspection.get-theme-density($theme);
26
-
27
- @include sass-utils.current-selector-or-root() {
28
- @include token-utils.create-token-values(tokens-mat-sort.$prefix,
29
- tokens-mat-sort.get-density-tokens($theme));
41
+ @if inspection.get-theme-version($theme) == 1 {
42
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
43
+ }
44
+ @else {
45
+ @include sass-utils.current-selector-or-root() {
46
+ @include token-utils.create-token-values(tokens-mat-sort.$prefix,
47
+ tokens-mat-sort.get-density-tokens($theme));
48
+ }
30
49
  }
31
50
  }
32
51
 
33
52
  @mixin theme($theme) {
34
53
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-sort') {
35
- @include base($theme);
36
- @if inspection.theme-has($theme, color) {
37
- @include color($theme);
38
- }
39
- @if inspection.theme-has($theme, density) {
40
- @include density($theme);
54
+ @if inspection.get-theme-version($theme) == 1 {
55
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
41
56
  }
42
- @if inspection.theme-has($theme, typography) {
43
- @include typography($theme);
57
+ @else {
58
+ @include base($theme);
59
+ @if inspection.theme-has($theme, color) {
60
+ @include color($theme);
61
+ }
62
+ @if inspection.theme-has($theme, density) {
63
+ @include density($theme);
64
+ }
65
+ @if inspection.theme-has($theme, typography) {
66
+ @include typography($theme);
67
+ }
44
68
  }
45
69
  }
46
70
  }
71
+
72
+ @mixin _theme-from-tokens($tokens) {
73
+ @if ($tokens != ()) {
74
+ @include token-utils.create-token-values(
75
+ tokens-mat-sort.$prefix, map.get($tokens, tokens-mat-sort.$prefix));
76
+ }
77
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/theming/theming';
2
3
  @use '../core/theming/inspection';
3
4
  @use '../core/typography/typography';
@@ -5,50 +6,82 @@
5
6
  @use '../core/tokens/token-utils';
6
7
  @use '../core/tokens/m2/mat/stepper' as tokens-mat-stepper;
7
8
 
8
- @mixin base($theme) {}
9
+ @mixin base($theme) {
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {}
14
+ }
9
15
 
10
16
  @mixin color($theme) {
11
- @include sass-utils.current-selector-or-root() {
12
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
13
- tokens-mat-stepper.get-color-tokens($theme));
14
-
15
- .mat-step-header.mat-accent {
17
+ @if inspection.get-theme-version($theme) == 1 {
18
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
19
+ }
20
+ @else {
21
+ @include sass-utils.current-selector-or-root() {
16
22
  @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
17
- tokens-mat-stepper.private-get-color-palette-color-tokens($theme, accent));
18
- }
23
+ tokens-mat-stepper.get-color-tokens($theme));
19
24
 
20
- .mat-step-header.mat-warn {
21
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
22
- tokens-mat-stepper.private-get-color-palette-color-tokens($theme, warn));
25
+ .mat-step-header.mat-accent {
26
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
27
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, accent));
28
+ }
29
+
30
+ .mat-step-header.mat-warn {
31
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
32
+ tokens-mat-stepper.private-get-color-palette-color-tokens($theme, warn));
33
+ }
23
34
  }
24
35
  }
25
36
  }
26
37
 
27
38
  @mixin typography($theme) {
28
- @include sass-utils.current-selector-or-root() {
29
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
30
- tokens-mat-stepper.get-typography-tokens($theme));
39
+ @if inspection.get-theme-version($theme) == 1 {
40
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
41
+ }
42
+ @else {
43
+ @include sass-utils.current-selector-or-root() {
44
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
45
+ tokens-mat-stepper.get-typography-tokens($theme));
46
+ }
31
47
  }
32
48
  }
33
49
 
34
50
  @mixin density($theme) {
35
- @include sass-utils.current-selector-or-root() {
36
- @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
37
- tokens-mat-stepper.get-density-tokens($theme));
51
+ @if inspection.get-theme-version($theme) == 1 {
52
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
53
+ }
54
+ @else {
55
+ @include sass-utils.current-selector-or-root() {
56
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
57
+ tokens-mat-stepper.get-density-tokens($theme));
58
+ }
38
59
  }
39
60
  }
40
61
 
41
62
  @mixin theme($theme) {
42
63
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') {
43
- @include base($theme);
44
- @if inspection.theme-has($theme, color) {
45
- @include color($theme);
64
+ @if inspection.get-theme-version($theme) == 1 {
65
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
46
66
  }
47
- @if inspection.theme-has($theme, density) {
48
- @include density($theme);
49
- }
50
- @if inspection.theme-has($theme, typography) {
51
- @include typography($theme);
67
+ @else {
68
+ @include base($theme);
69
+ @if inspection.theme-has($theme, color) {
70
+ @include color($theme);
71
+ }
72
+ @if inspection.theme-has($theme, density) {
73
+ @include density($theme);
74
+ }
75
+ @if inspection.theme-has($theme, typography) {
76
+ @include typography($theme);
77
+ }
52
78
  }
53
79
  }
54
80
  }
81
+
82
+ @mixin _theme-from-tokens($tokens) {
83
+ @if ($tokens != ()) {
84
+ @include token-utils.create-token-values(
85
+ tokens-mat-stepper.$prefix, map.get($tokens, tokens-mat-stepper.$prefix));
86
+ }
87
+ }