@angular/material 17.0.0-rc.3 → 17.0.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 (271) hide show
  1. package/autocomplete/index.d.ts +0 -2
  2. package/button/_button-theme.scss +4 -0
  3. package/core/ripple/_ripple-theme.scss +51 -19
  4. package/core/tokens/m2/_index.scss +27 -8
  5. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  6. package/esm2022/autocomplete/autocomplete-trigger.mjs +10 -10
  7. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  8. package/esm2022/autocomplete/module.mjs +5 -5
  9. package/esm2022/badge/badge-module.mjs +5 -5
  10. package/esm2022/badge/badge.mjs +4 -4
  11. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  12. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  13. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  14. package/esm2022/button/button-base.mjs +7 -7
  15. package/esm2022/button/button.mjs +7 -7
  16. package/esm2022/button/fab.mjs +13 -13
  17. package/esm2022/button/icon-button.mjs +7 -7
  18. package/esm2022/button/module.mjs +5 -5
  19. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  20. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  21. package/esm2022/card/card.mjs +43 -43
  22. package/esm2022/card/module.mjs +5 -5
  23. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  24. package/esm2022/checkbox/checkbox.mjs +4 -4
  25. package/esm2022/checkbox/module.mjs +9 -9
  26. package/esm2022/chips/chip-action.mjs +4 -4
  27. package/esm2022/chips/chip-edit-input.mjs +4 -4
  28. package/esm2022/chips/chip-grid.mjs +4 -4
  29. package/esm2022/chips/chip-icons.mjs +10 -10
  30. package/esm2022/chips/chip-input.mjs +4 -4
  31. package/esm2022/chips/chip-listbox.mjs +4 -4
  32. package/esm2022/chips/chip-option.mjs +4 -4
  33. package/esm2022/chips/chip-row.mjs +4 -4
  34. package/esm2022/chips/chip-set.mjs +4 -4
  35. package/esm2022/chips/chip.mjs +4 -4
  36. package/esm2022/chips/module.mjs +5 -5
  37. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  38. package/esm2022/core/datetime/index.mjs +9 -9
  39. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  40. package/esm2022/core/error/error-options.mjs +7 -7
  41. package/esm2022/core/line/line.mjs +8 -8
  42. package/esm2022/core/option/index.mjs +5 -5
  43. package/esm2022/core/option/optgroup.mjs +4 -4
  44. package/esm2022/core/option/option.mjs +4 -4
  45. package/esm2022/core/private/ripple-loader.mjs +4 -4
  46. package/esm2022/core/ripple/index.mjs +5 -5
  47. package/esm2022/core/ripple/ripple.mjs +4 -4
  48. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  49. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  50. package/esm2022/core/version.mjs +1 -1
  51. package/esm2022/datepicker/calendar-body.mjs +5 -5
  52. package/esm2022/datepicker/calendar.mjs +7 -7
  53. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  54. package/esm2022/datepicker/date-range-input.mjs +4 -4
  55. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  56. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  57. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  58. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  59. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  60. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  61. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  62. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  63. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  64. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  65. package/esm2022/datepicker/datepicker.mjs +4 -4
  66. package/esm2022/datepicker/month-view.mjs +4 -4
  67. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  68. package/esm2022/datepicker/year-view.mjs +4 -4
  69. package/esm2022/dialog/dialog-container.mjs +4 -4
  70. package/esm2022/dialog/dialog-content-directives.mjs +13 -13
  71. package/esm2022/dialog/dialog.mjs +4 -4
  72. package/esm2022/dialog/module.mjs +5 -5
  73. package/esm2022/divider/divider-module.mjs +5 -5
  74. package/esm2022/divider/divider.mjs +4 -4
  75. package/esm2022/expansion/accordion.mjs +4 -4
  76. package/esm2022/expansion/expansion-module.mjs +5 -5
  77. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  78. package/esm2022/expansion/expansion-panel-header.mjs +10 -10
  79. package/esm2022/expansion/expansion-panel.mjs +7 -7
  80. package/esm2022/form-field/directives/error.mjs +4 -4
  81. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  82. package/esm2022/form-field/directives/hint.mjs +4 -4
  83. package/esm2022/form-field/directives/label.mjs +4 -4
  84. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  85. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  86. package/esm2022/form-field/directives/prefix.mjs +4 -4
  87. package/esm2022/form-field/directives/suffix.mjs +4 -4
  88. package/esm2022/form-field/form-field-control.mjs +4 -4
  89. package/esm2022/form-field/form-field.mjs +4 -4
  90. package/esm2022/form-field/module.mjs +5 -5
  91. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  92. package/esm2022/grid-list/grid-list.mjs +4 -4
  93. package/esm2022/grid-list/grid-tile.mjs +16 -16
  94. package/esm2022/icon/icon-module.mjs +5 -5
  95. package/esm2022/icon/icon-registry.mjs +4 -4
  96. package/esm2022/icon/icon.mjs +4 -4
  97. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  98. package/esm2022/input/input.mjs +4 -4
  99. package/esm2022/input/module.mjs +5 -5
  100. package/esm2022/list/action-list.mjs +4 -4
  101. package/esm2022/list/list-base.mjs +12 -12
  102. package/esm2022/list/list-item-sections.mjs +19 -19
  103. package/esm2022/list/list-module.mjs +5 -5
  104. package/esm2022/list/list-option.mjs +4 -4
  105. package/esm2022/list/list.mjs +7 -7
  106. package/esm2022/list/nav-list.mjs +4 -4
  107. package/esm2022/list/selection-list.mjs +4 -4
  108. package/esm2022/list/subheader.mjs +4 -4
  109. package/esm2022/menu/menu-content.mjs +4 -4
  110. package/esm2022/menu/menu-item.mjs +4 -4
  111. package/esm2022/menu/menu-trigger.mjs +4 -4
  112. package/esm2022/menu/menu.mjs +4 -4
  113. package/esm2022/menu/module.mjs +5 -5
  114. package/esm2022/paginator/module.mjs +5 -5
  115. package/esm2022/paginator/paginator-intl.mjs +4 -4
  116. package/esm2022/paginator/paginator.mjs +4 -4
  117. package/esm2022/progress-bar/module.mjs +5 -5
  118. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  119. package/esm2022/progress-spinner/module.mjs +5 -5
  120. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  121. package/esm2022/radio/module.mjs +5 -5
  122. package/esm2022/radio/radio.mjs +7 -7
  123. package/esm2022/select/module.mjs +5 -5
  124. package/esm2022/select/select.mjs +8 -8
  125. package/esm2022/sidenav/drawer.mjs +10 -10
  126. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  127. package/esm2022/sidenav/sidenav.mjs +10 -10
  128. package/esm2022/slide-toggle/module.mjs +9 -9
  129. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  130. package/esm2022/slide-toggle/slide-toggle.mjs +4 -4
  131. package/esm2022/slider/module.mjs +5 -5
  132. package/esm2022/slider/slider-input.mjs +7 -7
  133. package/esm2022/slider/slider-thumb.mjs +4 -4
  134. package/esm2022/slider/slider.mjs +4 -4
  135. package/esm2022/snack-bar/module.mjs +5 -5
  136. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  137. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  138. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  139. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  140. package/esm2022/sort/sort-header-intl.mjs +4 -4
  141. package/esm2022/sort/sort-header.mjs +4 -4
  142. package/esm2022/sort/sort-module.mjs +5 -5
  143. package/esm2022/sort/sort.mjs +4 -4
  144. package/esm2022/stepper/step-content.mjs +4 -4
  145. package/esm2022/stepper/step-header.mjs +4 -4
  146. package/esm2022/stepper/step-label.mjs +4 -4
  147. package/esm2022/stepper/stepper-button.mjs +7 -7
  148. package/esm2022/stepper/stepper-icon.mjs +4 -4
  149. package/esm2022/stepper/stepper-intl.mjs +4 -4
  150. package/esm2022/stepper/stepper-module.mjs +5 -5
  151. package/esm2022/stepper/stepper.mjs +7 -7
  152. package/esm2022/table/cell.mjs +22 -22
  153. package/esm2022/table/module.mjs +5 -5
  154. package/esm2022/table/row.mjs +22 -22
  155. package/esm2022/table/table.mjs +7 -7
  156. package/esm2022/table/text-column.mjs +4 -4
  157. package/esm2022/tabs/module.mjs +5 -5
  158. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  159. package/esm2022/tabs/tab-body.mjs +7 -7
  160. package/esm2022/tabs/tab-content.mjs +4 -4
  161. package/esm2022/tabs/tab-group.mjs +4 -4
  162. package/esm2022/tabs/tab-header.mjs +4 -4
  163. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  164. package/esm2022/tabs/tab-label.mjs +4 -4
  165. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  166. package/esm2022/tabs/tab.mjs +4 -4
  167. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  168. package/esm2022/toolbar/toolbar.mjs +7 -7
  169. package/esm2022/tooltip/module.mjs +5 -5
  170. package/esm2022/tooltip/tooltip.mjs +7 -7
  171. package/esm2022/tree/node.mjs +10 -10
  172. package/esm2022/tree/outlet.mjs +4 -4
  173. package/esm2022/tree/padding.mjs +4 -4
  174. package/esm2022/tree/toggle.mjs +4 -4
  175. package/esm2022/tree/tree-module.mjs +5 -5
  176. package/esm2022/tree/tree.mjs +4 -4
  177. package/fesm2022/autocomplete.mjs +19 -19
  178. package/fesm2022/autocomplete.mjs.map +1 -1
  179. package/fesm2022/badge.mjs +7 -7
  180. package/fesm2022/badge.mjs.map +1 -1
  181. package/fesm2022/bottom-sheet.mjs +10 -10
  182. package/fesm2022/bottom-sheet.mjs.map +1 -1
  183. package/fesm2022/button-toggle.mjs +10 -10
  184. package/fesm2022/button-toggle.mjs.map +1 -1
  185. package/fesm2022/button.mjs +34 -34
  186. package/fesm2022/button.mjs.map +1 -1
  187. package/fesm2022/card.mjs +46 -46
  188. package/fesm2022/card.mjs.map +1 -1
  189. package/fesm2022/checkbox.mjs +14 -14
  190. package/fesm2022/checkbox.mjs.map +1 -1
  191. package/fesm2022/chips.mjs +40 -40
  192. package/fesm2022/chips.mjs.map +1 -1
  193. package/fesm2022/core.mjs +56 -56
  194. package/fesm2022/core.mjs.map +1 -1
  195. package/fesm2022/datepicker.mjs +83 -83
  196. package/fesm2022/datepicker.mjs.map +1 -1
  197. package/fesm2022/dialog.mjs +22 -22
  198. package/fesm2022/dialog.mjs.map +1 -1
  199. package/fesm2022/divider.mjs +7 -7
  200. package/fesm2022/divider.mjs.map +1 -1
  201. package/fesm2022/expansion.mjs +25 -25
  202. package/fesm2022/expansion.mjs.map +1 -1
  203. package/fesm2022/form-field.mjs +34 -34
  204. package/fesm2022/form-field.mjs.map +1 -1
  205. package/fesm2022/grid-list.mjs +22 -22
  206. package/fesm2022/grid-list.mjs.map +1 -1
  207. package/fesm2022/icon/testing.mjs +7 -7
  208. package/fesm2022/icon/testing.mjs.map +1 -1
  209. package/fesm2022/icon.mjs +10 -10
  210. package/fesm2022/icon.mjs.map +1 -1
  211. package/fesm2022/input.mjs +7 -7
  212. package/fesm2022/input.mjs.map +1 -1
  213. package/fesm2022/list.mjs +54 -54
  214. package/fesm2022/list.mjs.map +1 -1
  215. package/fesm2022/menu.mjs +16 -16
  216. package/fesm2022/menu.mjs.map +1 -1
  217. package/fesm2022/paginator.mjs +10 -10
  218. package/fesm2022/paginator.mjs.map +1 -1
  219. package/fesm2022/progress-bar.mjs +7 -7
  220. package/fesm2022/progress-bar.mjs.map +1 -1
  221. package/fesm2022/progress-spinner.mjs +7 -7
  222. package/fesm2022/progress-spinner.mjs.map +1 -1
  223. package/fesm2022/radio.mjs +10 -10
  224. package/fesm2022/radio.mjs.map +1 -1
  225. package/fesm2022/select.mjs +11 -11
  226. package/fesm2022/select.mjs.map +1 -1
  227. package/fesm2022/sidenav.mjs +22 -22
  228. package/fesm2022/sidenav.mjs.map +1 -1
  229. package/fesm2022/slide-toggle.mjs +14 -14
  230. package/fesm2022/slide-toggle.mjs.map +1 -1
  231. package/fesm2022/slider.mjs +16 -16
  232. package/fesm2022/slider.mjs.map +1 -1
  233. package/fesm2022/snack-bar.mjs +22 -22
  234. package/fesm2022/snack-bar.mjs.map +1 -1
  235. package/fesm2022/sort.mjs +13 -13
  236. package/fesm2022/sort.mjs.map +1 -1
  237. package/fesm2022/stepper.mjs +31 -31
  238. package/fesm2022/stepper.mjs.map +1 -1
  239. package/fesm2022/table.mjs +55 -55
  240. package/fesm2022/table.mjs.map +1 -1
  241. package/fesm2022/tabs.mjs +40 -40
  242. package/fesm2022/tabs.mjs.map +1 -1
  243. package/fesm2022/toolbar.mjs +10 -10
  244. package/fesm2022/toolbar.mjs.map +1 -1
  245. package/fesm2022/tooltip.mjs +10 -10
  246. package/fesm2022/tooltip.mjs.map +1 -1
  247. package/fesm2022/tree.mjs +25 -25
  248. package/fesm2022/tree.mjs.map +1 -1
  249. package/form-field/_form-field-theme.scss +85 -49
  250. package/input/_input-theme.scss +39 -12
  251. package/list/_list-theme.scss +115 -83
  252. package/package.json +7 -7
  253. package/prebuilt-themes/deeppurple-amber.css +1 -1
  254. package/prebuilt-themes/indigo-pink.css +1 -1
  255. package/prebuilt-themes/pink-bluegrey.css +1 -1
  256. package/prebuilt-themes/purple-green.css +1 -1
  257. package/schematics/ng-add/index.js +2 -2
  258. package/schematics/ng-add/index.mjs +2 -2
  259. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -29
  260. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +21 -19
  261. package/schematics/ng-generate/mdc-migration/index_bundled.js +498 -289
  262. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  263. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +9 -8
  264. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -2
  265. package/schematics/ng-update/index_bundled.js +31 -31
  266. package/slide-toggle/_slide-toggle-theme.scss +78 -44
  267. package/sort/_sort-theme.scss +51 -20
  268. package/stepper/_stepper-theme.scss +58 -25
  269. package/table/_table-theme.scss +53 -20
  270. package/tabs/_tabs-theme.scss +87 -51
  271. package/tree/_tree-theme.scss +53 -21
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../core/tokens/m2/mat/table' as tokens-mat-table;
2
3
  @use '../core/theming/theming';
3
4
  @use '../core/theming/inspection';
@@ -6,44 +7,76 @@
6
7
  @use '../core/style/sass-utils';
7
8
 
8
9
  @mixin base($theme) {
9
- @include sass-utils.current-selector-or-root() {
10
- @include token-utils.create-token-values(
11
- tokens-mat-table.$prefix, tokens-mat-table.get-unthemable-tokens());
10
+ @if inspection.get-theme-version($theme) == 1 {
11
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
+ }
13
+ @else {
14
+ @include sass-utils.current-selector-or-root() {
15
+ @include token-utils.create-token-values(
16
+ tokens-mat-table.$prefix, tokens-mat-table.get-unthemable-tokens());
17
+ }
12
18
  }
13
19
  }
14
20
 
15
21
  @mixin color($theme) {
16
- @include sass-utils.current-selector-or-root() {
17
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
18
- tokens-mat-table.get-color-tokens($theme));
22
+ @if inspection.get-theme-version($theme) == 1 {
23
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
24
+ }
25
+ @else {
26
+ @include sass-utils.current-selector-or-root() {
27
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
28
+ tokens-mat-table.get-color-tokens($theme));
29
+ }
19
30
  }
20
31
  }
21
32
 
22
33
  @mixin typography($theme) {
23
- @include sass-utils.current-selector-or-root() {
24
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
25
- tokens-mat-table.get-typography-tokens($theme));
34
+ @if inspection.get-theme-version($theme) == 1 {
35
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
36
+ }
37
+ @else {
38
+ @include sass-utils.current-selector-or-root() {
39
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
40
+ tokens-mat-table.get-typography-tokens($theme));
41
+ }
26
42
  }
27
43
  }
28
44
 
29
45
  @mixin density($theme) {
30
- @include sass-utils.current-selector-or-root() {
31
- @include token-utils.create-token-values(tokens-mat-table.$prefix,
32
- tokens-mat-table.get-density-tokens($theme));
46
+ @if inspection.get-theme-version($theme) == 1 {
47
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
48
+ }
49
+ @else {
50
+ @include sass-utils.current-selector-or-root() {
51
+ @include token-utils.create-token-values(tokens-mat-table.$prefix,
52
+ tokens-mat-table.get-density-tokens($theme));
53
+ }
33
54
  }
34
55
  }
35
56
 
36
57
  @mixin theme($theme) {
37
58
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-table') {
38
- @include base($theme);
39
- @if inspection.theme-has($theme, color) {
40
- @include color($theme);
59
+ @if inspection.get-theme-version($theme) == 1 {
60
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
41
61
  }
42
- @if inspection.theme-has($theme, density) {
43
- @include density($theme);
44
- }
45
- @if inspection.theme-has($theme, typography) {
46
- @include typography($theme);
62
+ @else {
63
+ @include base($theme);
64
+ @if inspection.theme-has($theme, color) {
65
+ @include color($theme);
66
+ }
67
+ @if inspection.theme-has($theme, density) {
68
+ @include density($theme);
69
+ }
70
+ @if inspection.theme-has($theme, typography) {
71
+ @include typography($theme);
72
+ }
47
73
  }
48
74
  }
49
75
  }
76
+
77
+ @mixin _theme-from-tokens($tokens) {
78
+ @if ($tokens != ()) {
79
+ @include token-utils.create-token-values(
80
+ tokens-mat-table.$prefix, map.get($tokens, tokens-mat-table.$prefix));
81
+ }
82
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '@material/tab-indicator/tab-indicator-theme' as mdc-tab-indicator-theme;
2
3
  @use '@material/tab/tab-theme' as mdc-tab-theme;
3
4
  @use '../core/style/sass-utils';
@@ -11,40 +12,50 @@
11
12
  @use '../core/tokens/token-utils';
12
13
 
13
14
  @mixin base($theme) {
14
- @include sass-utils.current-selector-or-root() {
15
- @include mdc-tab-indicator-theme.theme(tokens-mdc-tab-indicator.get-unthemable-tokens());
16
- @include mdc-tab-theme.secondary-navigation-tab-theme(tokens-mdc-tab.get-unthemable-tokens());
17
- @include token-utils.create-token-values(
18
- tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
19
- @include token-utils.create-token-values(
20
- tokens-mat-tab-header-with-background.$prefix,
21
- tokens-mat-tab-header-with-background.get-unthemable-tokens()
22
- );
15
+ @if inspection.get-theme-version($theme) == 1 {
16
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
17
+ }
18
+ @else {
19
+ @include sass-utils.current-selector-or-root() {
20
+ @include mdc-tab-indicator-theme.theme(tokens-mdc-tab-indicator.get-unthemable-tokens());
21
+ @include mdc-tab-theme.secondary-navigation-tab-theme(tokens-mdc-tab.get-unthemable-tokens());
22
+ @include token-utils.create-token-values(
23
+ tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
24
+ @include token-utils.create-token-values(
25
+ tokens-mat-tab-header-with-background.$prefix,
26
+ tokens-mat-tab-header-with-background.get-unthemable-tokens()
27
+ );
28
+ }
23
29
  }
24
30
  }
25
31
 
26
32
  @mixin color($theme) {
27
- .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
28
- @include _palette-styles($theme, primary);
33
+ @if inspection.get-theme-version($theme) == 1 {
34
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
35
+ }
36
+ @else {
37
+ .mat-mdc-tab-group, .mat-mdc-tab-nav-bar {
38
+ @include _palette-styles($theme, primary);
29
39
 
30
- &.mat-accent {
31
- @include _palette-styles($theme, accent);
32
- }
40
+ &.mat-accent {
41
+ @include _palette-styles($theme, accent);
42
+ }
33
43
 
34
- &.mat-warn {
35
- @include _palette-styles($theme, warn);
36
- }
44
+ &.mat-warn {
45
+ @include _palette-styles($theme, warn);
46
+ }
37
47
 
38
- &.mat-background-primary {
39
- @include _background-styles($theme, primary);
40
- }
48
+ &.mat-background-primary {
49
+ @include _background-styles($theme, primary);
50
+ }
41
51
 
42
- &.mat-background-accent {
43
- @include _background-styles($theme, accent);
44
- }
52
+ &.mat-background-accent {
53
+ @include _background-styles($theme, accent);
54
+ }
45
55
 
46
- &.mat-background-warn {
47
- @include _background-styles($theme, warn);
56
+ &.mat-background-warn {
57
+ @include _background-styles($theme, warn);
58
+ }
48
59
  }
49
60
  }
50
61
  }
@@ -64,43 +75,68 @@
64
75
  }
65
76
 
66
77
  @mixin typography($theme) {
67
- .mat-mdc-tab-header {
68
- @include mdc-tab-theme.secondary-navigation-tab-theme(
69
- tokens-mdc-tab.get-typography-tokens($theme));
70
- @include mdc-tab-indicator-theme.theme(
71
- tokens-mdc-tab-indicator.get-typography-tokens($theme));
72
- @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
73
- tokens-mat-tab-header.get-typography-tokens($theme));
74
- @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
75
- tokens-mat-tab-header-with-background.get-typography-tokens($theme));
78
+ @if inspection.get-theme-version($theme) == 1 {
79
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
80
+ }
81
+ @else {
82
+ .mat-mdc-tab-header {
83
+ @include mdc-tab-theme.secondary-navigation-tab-theme(
84
+ tokens-mdc-tab.get-typography-tokens($theme));
85
+ @include mdc-tab-indicator-theme.theme(
86
+ tokens-mdc-tab-indicator.get-typography-tokens($theme));
87
+ @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
88
+ tokens-mat-tab-header.get-typography-tokens($theme));
89
+ @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
90
+ tokens-mat-tab-header-with-background.get-typography-tokens($theme));
91
+ }
76
92
  }
77
93
  }
78
94
 
79
95
  @mixin density($theme) {
80
- .mat-mdc-tab-header {
81
- @include mdc-tab-theme.secondary-navigation-tab-theme(
82
- tokens-mdc-tab.get-density-tokens($theme));
83
- @include mdc-tab-indicator-theme.theme(
84
- tokens-mdc-tab-indicator.get-density-tokens($theme));
85
- @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
86
- tokens-mat-tab-header.get-density-tokens($theme));
87
- @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
88
- tokens-mat-tab-header-with-background.get-density-tokens($theme));
96
+ @if inspection.get-theme-version($theme) == 1 {
97
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
98
+ }
99
+ @else {
100
+ .mat-mdc-tab-header {
101
+ @include mdc-tab-theme.secondary-navigation-tab-theme(
102
+ tokens-mdc-tab.get-density-tokens($theme));
103
+ @include mdc-tab-indicator-theme.theme(
104
+ tokens-mdc-tab-indicator.get-density-tokens($theme));
105
+ @include token-utils.create-token-values(tokens-mat-tab-header.$prefix,
106
+ tokens-mat-tab-header.get-density-tokens($theme));
107
+ @include token-utils.create-token-values(tokens-mat-tab-header-with-background.$prefix,
108
+ tokens-mat-tab-header-with-background.get-density-tokens($theme));
109
+ }
89
110
  }
90
111
  }
91
112
 
92
113
  @mixin theme($theme) {
93
114
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tabs') {
94
- @include base($theme);
95
- @if inspection.theme-has($theme, color) {
96
- @include color($theme);
97
- }
98
- @if inspection.theme-has($theme, density) {
99
- @include density($theme);
115
+ @if inspection.get-theme-version($theme) == 1 {
116
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
100
117
  }
101
- @if inspection.theme-has($theme, typography) {
102
- @include typography($theme);
118
+ @else {
119
+ @include base($theme);
120
+ @if inspection.theme-has($theme, color) {
121
+ @include color($theme);
122
+ }
123
+ @if inspection.theme-has($theme, density) {
124
+ @include density($theme);
125
+ }
126
+ @if inspection.theme-has($theme, typography) {
127
+ @include typography($theme);
128
+ }
103
129
  }
104
130
  }
105
131
  }
106
132
 
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
+ }
142
+ }
@@ -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,46 +6,77 @@
5
6
  @use '../core/tokens/token-utils';
6
7
  @use '../core/tokens/m2/mat/tree' as tokens-mat-tree;
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-tree.$prefix,
13
- tokens-mat-tree.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-tree.$prefix,
23
+ tokens-mat-tree.get-color-tokens($theme));
24
+ }
14
25
  }
15
26
  }
16
27
 
17
28
  @mixin typography($theme) {
18
- // TODO(mmalerba): Stop calling this and resolve resulting screen diffs.
19
- $theme: inspection.private-get-typography-back-compat-theme($theme);
29
+ @if inspection.get-theme-version($theme) == 1 {
30
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
31
+ }
32
+ @else {
33
+ // TODO(mmalerba): Stop calling this and resolve resulting screen diffs.
34
+ $theme: inspection.private-get-typography-back-compat-theme($theme);
20
35
 
21
- @include sass-utils.current-selector-or-root() {
22
- @include token-utils.create-token-values(tokens-mat-tree.$prefix,
23
- tokens-mat-tree.get-typography-tokens($theme));
36
+ @include sass-utils.current-selector-or-root() {
37
+ @include token-utils.create-token-values(tokens-mat-tree.$prefix,
38
+ tokens-mat-tree.get-typography-tokens($theme));
39
+ }
24
40
  }
25
41
  }
26
42
 
27
43
  @mixin density($theme) {
28
- $density-scale: inspection.get-theme-density($theme);
44
+ @if inspection.get-theme-version($theme) == 1 {
45
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
46
+ }
47
+ @else {
48
+ $density-scale: inspection.get-theme-density($theme);
29
49
 
30
- @include sass-utils.current-selector-or-root() {
31
- @include token-utils.create-token-values(tokens-mat-tree.$prefix,
32
- tokens-mat-tree.get-density-tokens($theme));
50
+ @include sass-utils.current-selector-or-root() {
51
+ @include token-utils.create-token-values(tokens-mat-tree.$prefix,
52
+ tokens-mat-tree.get-density-tokens($theme));
53
+ }
33
54
  }
34
55
  }
35
56
 
36
57
  @mixin theme($theme) {
37
58
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-tree') {
38
- @include base($theme);
39
- @if inspection.theme-has($theme, color) {
40
- @include color($theme);
41
- }
42
- @if inspection.theme-has($theme, density) {
43
- @include density($theme);
59
+ @if inspection.get-theme-version($theme) == 1 {
60
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
44
61
  }
45
- @if inspection.theme-has($theme, typography) {
46
- @include typography($theme);
62
+ @else {
63
+ @include base($theme);
64
+ @if inspection.theme-has($theme, color) {
65
+ @include color($theme);
66
+ }
67
+ @if inspection.theme-has($theme, density) {
68
+ @include density($theme);
69
+ }
70
+ @if inspection.theme-has($theme, typography) {
71
+ @include typography($theme);
72
+ }
47
73
  }
48
74
  }
49
75
  }
50
76
 
77
+ @mixin _theme-from-tokens($tokens) {
78
+ @if ($tokens != ()) {
79
+ @include token-utils.create-token-values(
80
+ tokens-mat-tree.$prefix, map.get($tokens, tokens-mat-tree.$prefix));
81
+ }
82
+ }