@angular/material 17.0.0-next.0 → 17.0.0-next.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 (204) hide show
  1. package/_index.scss +3 -4
  2. package/autocomplete/_autocomplete-theme.scss +12 -18
  3. package/autocomplete/index.d.ts +15 -24
  4. package/badge/_badge-theme.scss +15 -27
  5. package/badge/index.d.ts +9 -17
  6. package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
  7. package/button/_button-base.scss +3 -3
  8. package/button/_button-theme-private.scss +3 -2
  9. package/button/_button-theme.scss +18 -25
  10. package/button/_fab-theme.scss +31 -49
  11. package/button/_icon-button-theme.scss +19 -26
  12. package/button/index.d.ts +22 -31
  13. package/button-toggle/_button-toggle-theme.scss +17 -28
  14. package/button-toggle/index.d.ts +15 -18
  15. package/card/_card-theme.scss +27 -38
  16. package/checkbox/_checkbox-theme.scss +28 -45
  17. package/checkbox/index.d.ts +21 -27
  18. package/chips/_chips-theme.scss +18 -56
  19. package/core/_core-theme.scss +24 -39
  20. package/core/color/_all-color.scss +7 -15
  21. package/core/density/private/_all-density.scss +34 -39
  22. package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
  23. package/core/focus-indicators/_private.scss +22 -26
  24. package/core/index.d.ts +7 -11
  25. package/core/mdc-helpers/_mdc-helpers.scss +19 -22
  26. package/core/option/_optgroup-theme.scss +13 -23
  27. package/core/option/_option-theme.scss +23 -37
  28. package/core/ripple/_ripple-theme.scss +6 -10
  29. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +17 -24
  30. package/core/style/_form-common.scss +7 -7
  31. package/core/style/_private.scss +5 -7
  32. package/core/style/_sass-utils.scss +7 -0
  33. package/core/testing/index.d.ts +2 -1
  34. package/core/theming/_all-theme.scss +41 -41
  35. package/core/theming/_inspection.scss +133 -59
  36. package/core/theming/_m2-inspection.scss +268 -0
  37. package/core/theming/_theming.scss +59 -20
  38. package/core/tokens/m2/mat/_autocomplete.scss +5 -8
  39. package/core/tokens/m2/mat/_badge.scss +12 -15
  40. package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
  41. package/core/tokens/m2/mat/_card.scss +15 -21
  42. package/core/tokens/m2/mat/_datepicker.scss +28 -38
  43. package/core/tokens/m2/mat/_divider.scss +5 -8
  44. package/core/tokens/m2/mat/_expansion.scss +24 -28
  45. package/core/tokens/m2/mat/_form-field.scss +21 -25
  46. package/core/tokens/m2/mat/_grid-list.scss +8 -8
  47. package/core/tokens/m2/mat/_icon.scss +3 -3
  48. package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
  49. package/core/tokens/m2/mat/_menu.scss +12 -17
  50. package/core/tokens/m2/mat/_optgroup.scss +12 -17
  51. package/core/tokens/m2/mat/_option.scss +16 -28
  52. package/core/tokens/m2/mat/_paginator.scss +16 -18
  53. package/core/tokens/m2/mat/_radio.scss +7 -10
  54. package/core/tokens/m2/mat/_select.scss +15 -29
  55. package/core/tokens/m2/mat/_sidenav.scss +12 -14
  56. package/core/tokens/m2/mat/_slide-toggle.scss +9 -17
  57. package/core/tokens/m2/mat/_slider.scss +5 -5
  58. package/core/tokens/m2/mat/_snack-bar.scss +7 -8
  59. package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
  60. package/core/tokens/m2/mat/_stepper.scss +30 -33
  61. package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
  62. package/core/tokens/m2/mat/_tab-header.scss +13 -18
  63. package/core/tokens/m2/mat/_table.scss +19 -23
  64. package/core/tokens/m2/mat/_toolbar.scss +12 -16
  65. package/core/tokens/m2/mdc/_checkbox.scss +21 -20
  66. package/core/tokens/m2/mdc/_chip.scss +38 -24
  67. package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
  68. package/core/tokens/m2/mdc/_dialog.scss +16 -30
  69. package/core/tokens/m2/mdc/_elevated-card.scss +6 -9
  70. package/core/tokens/m2/mdc/_extended-fab.scss +8 -17
  71. package/core/tokens/m2/mdc/_fab.scss +6 -7
  72. package/core/tokens/m2/mdc/_filled-text-field.scss +16 -22
  73. package/core/tokens/m2/mdc/_icon-button.scss +3 -3
  74. package/core/tokens/m2/mdc/_linear-progress.scss +9 -10
  75. package/core/tokens/m2/mdc/_list.scss +44 -42
  76. package/core/tokens/m2/mdc/_outlined-card.scss +7 -10
  77. package/core/tokens/m2/mdc/_outlined-text-field.scss +14 -20
  78. package/core/tokens/m2/mdc/_plain-tooltip.scss +9 -22
  79. package/core/tokens/m2/mdc/_radio.scss +11 -11
  80. package/core/tokens/m2/mdc/_slider.scss +16 -23
  81. package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
  82. package/core/tokens/m2/mdc/_switch.scss +16 -19
  83. package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
  84. package/core/tokens/m2/mdc/_tab.scss +5 -4
  85. package/core/typography/_all-typography.scss +44 -47
  86. package/core/typography/_definition.scss +258 -0
  87. package/core/typography/_property-getters.scss +63 -0
  88. package/core/typography/_typography-utils.scss +9 -69
  89. package/core/typography/_typography.scss +38 -494
  90. package/core/typography/_versioning.scss +91 -0
  91. package/datepicker/_datepicker-theme.scss +20 -34
  92. package/datepicker/index.d.ts +3 -3
  93. package/dialog/_dialog-theme.scss +22 -23
  94. package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
  95. package/dialog/index.d.ts +2 -0
  96. package/divider/_divider-theme.scss +12 -18
  97. package/esm2022/autocomplete/autocomplete-trigger.mjs +5 -17
  98. package/esm2022/autocomplete/autocomplete.mjs +23 -50
  99. package/esm2022/badge/badge.mjs +11 -29
  100. package/esm2022/button/button-base.mjs +32 -27
  101. package/esm2022/button/button.mjs +6 -6
  102. package/esm2022/button/fab.mjs +23 -31
  103. package/esm2022/button/icon-button.mjs +6 -6
  104. package/esm2022/button/testing/button-harness.mjs +3 -3
  105. package/esm2022/button-toggle/button-toggle.mjs +25 -33
  106. package/esm2022/checkbox/checkbox.mjs +32 -39
  107. package/esm2022/core/option/optgroup.mjs +10 -11
  108. package/esm2022/core/option/option.mjs +6 -6
  109. package/esm2022/core/testing/option-harness.mjs +3 -3
  110. package/esm2022/core/version.mjs +1 -1
  111. package/esm2022/datepicker/calendar.mjs +1 -1
  112. package/esm2022/datepicker/datepicker-base.mjs +2 -2
  113. package/esm2022/datepicker/datepicker-toggle.mjs +1 -1
  114. package/esm2022/datepicker/month-view.mjs +2 -2
  115. package/esm2022/datepicker/multi-year-view.mjs +2 -2
  116. package/esm2022/datepicker/year-view.mjs +2 -2
  117. package/esm2022/dialog/dialog-container.mjs +16 -3
  118. package/esm2022/form-field/form-field.mjs +3 -3
  119. package/esm2022/menu/menu-item.mjs +15 -11
  120. package/esm2022/menu/menu.mjs +9 -22
  121. package/esm2022/paginator/paginator.mjs +1 -1
  122. package/esm2022/select/select.mjs +3 -3
  123. package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
  124. package/esm2022/slider/slider-input.mjs +19 -9
  125. package/esm2022/slider/slider.mjs +2 -2
  126. package/esm2022/snack-bar/simple-snack-bar.mjs +1 -1
  127. package/esm2022/tabs/tab-group.mjs +3 -3
  128. package/expansion/_expansion-theme.scss +16 -24
  129. package/fesm2022/autocomplete.mjs +25 -63
  130. package/fesm2022/autocomplete.mjs.map +1 -1
  131. package/fesm2022/badge.mjs +11 -28
  132. package/fesm2022/badge.mjs.map +1 -1
  133. package/fesm2022/button/testing.mjs +2 -2
  134. package/fesm2022/button/testing.mjs.map +1 -1
  135. package/fesm2022/button-toggle.mjs +25 -32
  136. package/fesm2022/button-toggle.mjs.map +1 -1
  137. package/fesm2022/button.mjs +59 -61
  138. package/fesm2022/button.mjs.map +1 -1
  139. package/fesm2022/checkbox.mjs +31 -38
  140. package/fesm2022/checkbox.mjs.map +1 -1
  141. package/fesm2022/core/testing.mjs +2 -2
  142. package/fesm2022/core/testing.mjs.map +1 -1
  143. package/fesm2022/core.mjs +14 -13
  144. package/fesm2022/core.mjs.map +1 -1
  145. package/fesm2022/datepicker.mjs +6 -6
  146. package/fesm2022/datepicker.mjs.map +1 -1
  147. package/fesm2022/dialog.mjs +15 -2
  148. package/fesm2022/dialog.mjs.map +1 -1
  149. package/fesm2022/form-field.mjs +2 -2
  150. package/fesm2022/form-field.mjs.map +1 -1
  151. package/fesm2022/menu.mjs +23 -31
  152. package/fesm2022/menu.mjs.map +1 -1
  153. package/fesm2022/paginator.mjs +1 -1
  154. package/fesm2022/paginator.mjs.map +1 -1
  155. package/fesm2022/select.mjs +2 -2
  156. package/fesm2022/select.mjs.map +1 -1
  157. package/fesm2022/slide-toggle.mjs +33 -36
  158. package/fesm2022/slide-toggle.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +20 -10
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar.mjs +1 -1
  162. package/fesm2022/snack-bar.mjs.map +1 -1
  163. package/fesm2022/tabs.mjs +2 -2
  164. package/fesm2022/tabs.mjs.map +1 -1
  165. package/form-field/_form-field-density.scss +3 -4
  166. package/form-field/_form-field-focus-overlay.scss +1 -1
  167. package/form-field/_form-field-sizing.scss +1 -1
  168. package/form-field/_form-field-theme.scss +24 -34
  169. package/grid-list/_grid-list-theme.scss +12 -19
  170. package/icon/_icon-theme.scss +17 -25
  171. package/input/_input-theme.scss +11 -23
  172. package/list/_list-theme.scss +27 -42
  173. package/menu/_menu-theme.scss +13 -22
  174. package/menu/index.d.ts +12 -18
  175. package/package.json +2 -2
  176. package/paginator/_paginator-theme.scss +15 -24
  177. package/prebuilt-themes/deeppurple-amber.css +1 -1
  178. package/prebuilt-themes/indigo-pink.css +1 -1
  179. package/prebuilt-themes/pink-bluegrey.css +1 -1
  180. package/prebuilt-themes/purple-green.css +1 -1
  181. package/progress-bar/_progress-bar-theme.scss +17 -24
  182. package/progress-spinner/_progress-spinner-theme.scss +18 -24
  183. package/radio/_radio-theme.scss +23 -38
  184. package/schematics/ng-add/index.js +1 -1
  185. package/schematics/ng-add/index.mjs +1 -1
  186. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  187. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  188. package/schematics/ng-update/index_bundled.js +25 -25
  189. package/select/_select-theme.scss +17 -31
  190. package/sidenav/_sidenav-theme.scss +12 -18
  191. package/slide-toggle/_slide-toggle-theme.scss +23 -40
  192. package/slide-toggle/index.d.ts +20 -23
  193. package/slider/_slider-theme.scss +25 -42
  194. package/snack-bar/_snack-bar-theme.scss +17 -26
  195. package/sort/_sort-theme.scss +13 -22
  196. package/stepper/_stepper-theme.scss +16 -34
  197. package/table/_table-theme.scss +14 -25
  198. package/tabs/_tabs-theme.scss +31 -45
  199. package/toolbar/_toolbar-theme.scss +22 -31
  200. package/tooltip/_tooltip-theme.scss +15 -23
  201. package/tree/_tree-theme.scss +20 -29
  202. package/button-toggle/_button-toggle-variables.scss +0 -16
  203. package/core/typography/_typography-deprecated.scss +0 -39
  204. package/paginator/_paginator-variables.scss +0 -15
@@ -2,7 +2,7 @@
2
2
  @use 'sass:math';
3
3
  @use '@material/density' as mdc-density;
4
4
  @use '@material/textfield' as mdc-textfield;
5
- @use '../core/theming/theming';
5
+ @use '../core/theming/inspection';
6
6
 
7
7
  @use './form-field-sizing';
8
8
 
@@ -39,12 +39,11 @@
39
39
  // provide spacing that makes arbitrary controls align as specified in the Material Design
40
40
  // specification. In order to support density, we need to adjust the vertical spacing to be
41
41
  // based on the density scale.
42
- @mixin private-form-field-density($config-or-theme) {
43
- $density-scale: theming.get-density-config($config-or-theme);
42
+ @mixin private-form-field-density($theme) {
44
43
  // Height of the form field that is based on the current density scale.
45
44
  $height: mdc-density.prop-value(
46
45
  $density-config: mdc-textfield.$density-config,
47
- $density-scale: $density-scale,
46
+ $density-scale: inspection.get-theme-density($theme),
48
47
  $property-name: height,
49
48
  );
50
49
 
@@ -19,7 +19,7 @@
19
19
  tokens-mat-form-field.$prefix, tokens-mat-form-field.get-token-slots()) {
20
20
  @include token-utils.create-token-slot(background-color, state-layer-color);
21
21
 
22
- .mat-mdc-form-field:hover & {
22
+ .mat-mdc-text-field-wrapper:hover & {
23
23
  @include token-utils.create-token-slot(opacity, hover-state-layer-opacity);
24
24
  }
25
25
 
@@ -3,7 +3,7 @@
3
3
  $mat-form-field-outline-top-spacing: 12px;
4
4
 
5
5
  // Infix stretches to fit the container, but naturally wants to be this wide. We set
6
- // this in order to have a a consistent natural size for the various types of controls
6
+ // this in order to have a consistent natural size for the various types of controls
7
7
  // that can go in a form field.
8
8
  $mat-form-field-default-infix-width: 180px !default;
9
9
 
@@ -5,76 +5,66 @@
5
5
  @use '../core/tokens/m2/mdc/outlined-text-field' as tokens-mdc-outlined-text-field;
6
6
  @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field;
7
7
  @use '../core/theming/theming';
8
+ @use '../core/theming/inspection';
8
9
  @use '../core/typography/typography';
9
10
  @use '../core/style/sass-utils';
10
11
  @use '../core/tokens/token-utils';
11
12
  @use './form-field-density';
12
13
 
13
- @mixin color($config-or-theme) {
14
- $config: theming.get-color-config($config-or-theme);
15
-
14
+ @mixin color($theme) {
16
15
  @include sass-utils.current-selector-or-root() {
17
16
  @include mdc-filled-text-field-theme.theme(
18
- tokens-mdc-filled-text-field.get-color-tokens($config));
17
+ tokens-mdc-filled-text-field.get-color-tokens($theme));
19
18
  @include mdc-outlined-text-field-theme.theme(
20
- tokens-mdc-outlined-text-field.get-color-tokens($config));
19
+ tokens-mdc-outlined-text-field.get-color-tokens($theme));
21
20
  @include token-utils.create-token-values(tokens-mat-form-field.$prefix,
22
- tokens-mat-form-field.get-color-tokens($config));
21
+ tokens-mat-form-field.get-color-tokens($theme));
23
22
  }
24
23
 
25
24
  .mat-mdc-form-field.mat-accent {
26
25
  @include mdc-filled-text-field-theme.theme(
27
- tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($config, accent));
26
+ tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($theme, accent));
28
27
  @include mdc-outlined-text-field-theme.theme(
29
- tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($config, accent));
28
+ tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($theme, accent));
30
29
  @include token-utils.create-token-values(tokens-mat-form-field.$prefix,
31
- tokens-mat-form-field.private-get-color-palette-color-tokens($config, accent));
30
+ tokens-mat-form-field.private-get-color-palette-color-tokens($theme, accent));
32
31
  }
33
32
 
34
33
  .mat-mdc-form-field.mat-warn {
35
34
  @include mdc-filled-text-field-theme.theme(
36
- tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($config, warn));
35
+ tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($theme, warn));
37
36
  @include mdc-outlined-text-field-theme.theme(
38
- tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($config, warn));
37
+ tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($theme, warn));
39
38
  @include token-utils.create-token-values(tokens-mat-form-field.$prefix,
40
- tokens-mat-form-field.private-get-color-palette-color-tokens($config, warn));
39
+ tokens-mat-form-field.private-get-color-palette-color-tokens($theme, warn));
41
40
  }
42
41
  }
43
42
 
44
- @mixin typography($config-or-theme) {
45
- $config: typography.private-typography-to-2018-config(
46
- theming.get-typography-config($config-or-theme));
47
-
43
+ @mixin typography($theme) {
48
44
  @include sass-utils.current-selector-or-root() {
49
45
  @include mdc-filled-text-field-theme.theme(
50
- tokens-mdc-filled-text-field.get-typography-tokens($config));
46
+ tokens-mdc-filled-text-field.get-typography-tokens($theme));
51
47
  @include mdc-outlined-text-field-theme.theme(
52
- tokens-mdc-outlined-text-field.get-typography-tokens($config));
48
+ tokens-mdc-outlined-text-field.get-typography-tokens($theme));
53
49
  @include token-utils.create-token-values(tokens-mat-form-field.$prefix,
54
- tokens-mat-form-field.get-typography-tokens($config));
50
+ tokens-mat-form-field.get-typography-tokens($theme));
55
51
  }
56
52
  }
57
53
 
58
- @mixin density($config-or-theme) {
59
- $density-scale: theming.get-density-config($config-or-theme);
60
- @include form-field-density.private-form-field-density($density-scale);
54
+ @mixin density($theme) {
55
+ @include form-field-density.private-form-field-density($theme);
61
56
  }
62
57
 
63
- @mixin theme($theme-or-color-config) {
64
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
58
+ @mixin theme($theme) {
65
59
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-form-field') {
66
- $color: theming.get-color-config($theme);
67
- $density: theming.get-density-config($theme);
68
- $typography: theming.get-typography-config($theme);
69
-
70
- @if $color != null {
71
- @include color($color);
60
+ @if inspection.theme-has($theme, color) {
61
+ @include color($theme);
72
62
  }
73
- @if $density != null {
74
- @include density($density);
63
+ @if inspection.theme-has($theme, density) {
64
+ @include density($theme);
75
65
  }
76
- @if $typography != null {
77
- @include typography($typography);
66
+ @if inspection.theme-has($theme, typography) {
67
+ @include typography($theme);
78
68
  }
79
69
  }
80
70
  }
@@ -1,4 +1,5 @@
1
1
  @use '../core/theming/theming';
2
+ @use '../core/theming/inspection';
2
3
  @use '../core/typography/typography';
3
4
  @use '../core/tokens/m2/mat/grid-list' as tokens-mat-grid-list;
4
5
  @use '../core/style/sass-utils';
@@ -6,35 +7,27 @@
6
7
 
7
8
 
8
9
  // Include this empty mixin for consistency with the other components.
9
- @mixin color($config-or-theme) {}
10
-
11
- @mixin typography($config-or-theme) {
12
- $config: typography.private-typography-to-2014-config(
13
- theming.get-typography-config($config-or-theme));
10
+ @mixin color($theme) {}
14
11
 
12
+ @mixin typography($theme) {
15
13
  @include sass-utils.current-selector-or-root() {
16
14
  @include token-utils.create-token-values(tokens-mat-grid-list.$prefix,
17
- tokens-mat-grid-list.get-typography-tokens($config));
15
+ tokens-mat-grid-list.get-typography-tokens($theme));
18
16
  }
19
17
  }
20
18
 
21
- @mixin density($config-or-theme) {}
19
+ @mixin density($theme) {}
22
20
 
23
- @mixin theme($theme-or-color-config) {
24
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
21
+ @mixin theme($theme) {
25
22
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-grid-list') {
26
- $color: theming.get-color-config($theme);
27
- $density: theming.get-density-config($theme);
28
- $typography: theming.get-typography-config($theme);
29
-
30
- @if $color != null {
31
- @include color($color);
23
+ @if inspection.theme-has($theme, color) {
24
+ @include color($theme);
32
25
  }
33
- @if $density != null {
34
- @include density($density);
26
+ @if inspection.theme-has($theme, density) {
27
+ @include density($theme);
35
28
  }
36
- @if $typography != null {
37
- @include typography($typography);
29
+ @if inspection.theme-has($theme, typography) {
30
+ @include typography($theme);
38
31
  }
39
32
  }
40
33
  }
@@ -1,58 +1,50 @@
1
- @use 'sass:map';
2
1
  @use '../core/theming/theming';
2
+ @use '../core/theming/inspection';
3
3
  @use '../core/tokens/m2/mat/icon' as tokens-mat-icon;
4
4
  @use '../core/tokens/token-utils';
5
5
  @use '../core/style/sass-utils';
6
6
 
7
- @mixin _palette-colors($config, $palette-name) {
8
- $palette: map.get($config, $palette-name);
9
- $color: theming.get-color-from-palette($palette, text);
7
+ @mixin _palette-colors($theme, $palette-name) {
8
+ $color: inspection.get-theme-color($theme, $palette-name, text);
10
9
  $tokens: tokens-mat-icon.private-get-icon-color-tokens($color);
11
10
  @include token-utils.create-token-values(tokens-mat-icon.$prefix, $tokens);
12
11
  }
13
12
 
14
- @mixin color($config-or-theme) {
15
- $config: theming.get-color-config($config-or-theme);
16
-
13
+ @mixin color($theme) {
17
14
  @include sass-utils.current-selector-or-root() {
18
15
  @include token-utils.create-token-values(tokens-mat-icon.$prefix,
19
- tokens-mat-icon.get-color-tokens($config));
16
+ tokens-mat-icon.get-color-tokens($theme));
20
17
  }
21
18
 
22
19
  .mat-icon {
23
20
  &.mat-primary {
24
- @include _palette-colors($config, primary);
21
+ @include _palette-colors($theme, primary);
25
22
  }
26
23
 
27
24
  &.mat-accent {
28
- @include _palette-colors($config, accent);
25
+ @include _palette-colors($theme, accent);
29
26
  }
30
27
 
31
28
  &.mat-warn {
32
- @include _palette-colors($config, warn);
29
+ @include _palette-colors($theme, warn);
33
30
  }
34
31
  }
35
32
  }
36
33
 
37
- @mixin typography($config-or-theme) {}
34
+ @mixin typography($theme) {}
38
35
 
39
- @mixin density($config-or-theme) {}
36
+ @mixin density($theme) {}
40
37
 
41
- @mixin theme($theme-or-color-config) {
42
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
38
+ @mixin theme($theme) {
43
39
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon') {
44
- $color: theming.get-color-config($theme);
45
- $density: theming.get-density-config($theme);
46
- $typography: theming.get-typography-config($theme);
47
-
48
- @if $color != null {
49
- @include color($color);
40
+ @if inspection.theme-has($theme, color) {
41
+ @include color($theme);
50
42
  }
51
- @if $density != null {
52
- @include density($density);
43
+ @if inspection.theme-has($theme, density) {
44
+ @include density($theme);
53
45
  }
54
- @if $typography != null {
55
- @include typography($typography);
46
+ @if inspection.theme-has($theme, typography) {
47
+ @include typography($theme);
56
48
  }
57
49
  }
58
50
  }
@@ -1,35 +1,23 @@
1
1
  @use '../core/theming/theming';
2
+ @use '../core/theming/inspection';
2
3
  @use '../core/typography/typography';
3
- @use '../core/mdc-helpers/mdc-helpers';
4
4
 
5
- @mixin color($config-or-theme) {
6
- $config: theming.get-color-config($config-or-theme);
7
- @include mdc-helpers.using-mdc-theme($config) {}
8
- }
5
+ @mixin color($theme) {}
9
6
 
10
- @mixin typography($config-or-theme) {
11
- $config: typography.private-typography-to-2018-config(
12
- theming.get-typography-config($config-or-theme));
13
- @include mdc-helpers.using-mdc-typography($config) {}
14
- }
7
+ @mixin typography($theme) {}
15
8
 
16
- @mixin density($config-or-theme) {}
9
+ @mixin density($theme) {}
17
10
 
18
- @mixin theme($theme-or-color-config) {
19
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
11
+ @mixin theme($theme) {
20
12
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-input') {
21
- $color: theming.get-color-config($theme);
22
- $density: theming.get-density-config($theme);
23
- $typography: theming.get-typography-config($theme);
24
-
25
- @if $color != null {
26
- @include color($color);
13
+ @if inspection.theme-has($theme, color) {
14
+ @include color($theme);
27
15
  }
28
- @if $density != null {
29
- @include density($density);
16
+ @if inspection.theme-has($theme, density) {
17
+ @include density($theme);
30
18
  }
31
- @if $typography != null {
32
- @include typography($typography);
19
+ @if inspection.theme-has($theme, typography) {
20
+ @include typography($theme);
33
21
  }
34
22
  }
35
23
  }
@@ -6,29 +6,21 @@
6
6
 
7
7
  @use '../core/style/sass-utils';
8
8
  @use '../core/theming/theming';
9
+ @use '../core/theming/inspection';
9
10
  @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
10
11
  @use '../core/tokens/m2/mdc/radio' as tokens-mdc-radio;
11
12
  @use '../core/tokens/m2/mdc/list' as tokens-mdc-list;
12
13
  @use '../core/typography/typography';
13
- @use '../core/typography/typography-utils';
14
14
 
15
- @mixin base($config-or-theme) {
15
+ @mixin base($theme) {
16
16
  // Add default values for tokens not related to color, typography, or density.
17
17
  @include sass-utils.current-selector-or-root() {
18
18
  @include mdc-list-theme.theme(tokens-mdc-list.get-unthemable-tokens());
19
19
  }
20
20
  }
21
21
 
22
- @mixin color($config-or-theme) {
23
- $config: theming.get-color-config($config-or-theme);
24
- $primary: map.get($config, primary);
25
- $accent: map.get($config, accent);
26
- $warn: map.get($config, warn);
27
- $mdc-list-color-tokens: tokens-mdc-list.get-color-tokens($config);
28
- $inner-control-primary: map.merge($config, (accent: $primary));
29
- $inner-control-accent: map.merge($config, (accent: $accent));
30
- $inner-control-warn: map.merge($config, (accent: $warn));
31
-
22
+ @mixin color($theme) {
23
+ $mdc-list-color-tokens: tokens-mdc-list.get-color-tokens($theme);
32
24
 
33
25
  // Add values for MDC list tokens.
34
26
  .mat-mdc-list-base {
@@ -37,37 +29,37 @@
37
29
 
38
30
  .mdc-list-item__start,
39
31
  .mdc-list-item__end {
40
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($inner-control-primary));
32
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, primary));
41
33
  }
42
34
 
43
35
  .mat-accent {
44
36
  .mdc-list-item__start,
45
37
  .mdc-list-item__end {
46
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($inner-control-accent));
38
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, accent));
47
39
  }
48
40
  }
49
41
 
50
42
  .mat-warn {
51
43
  .mdc-list-item__start,
52
44
  .mdc-list-item__end {
53
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($inner-control-warn));
45
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, warn));
54
46
  }
55
47
  }
56
48
 
57
49
  .mat-mdc-list-option {
58
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($inner-control-primary));
50
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, primary));
59
51
  }
60
52
  .mat-mdc-list-option.mat-accent {
61
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($inner-control-accent));
53
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, accent));
62
54
  }
63
55
  .mat-mdc-list-option.mat-warn {
64
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($inner-control-warn));
56
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
65
57
  }
66
58
 
67
59
  // There is no token for activated color on nav list.
68
60
  // TODO(mmalerba): Add a token to MDC or make a custom one.
69
61
  .mat-mdc-list-base.mat-mdc-list-base {
70
- @include evolution-mixins.list-selected-ink-color(theming.get-color-from-palette($primary));
62
+ @include evolution-mixins.list-selected-ink-color(inspection.get-theme-color($theme, primary));
71
63
  }
72
64
 
73
65
  // TODO(mmalerba): Leaking styles from the old MDC list mixins used in other components can cause
@@ -82,9 +74,9 @@
82
74
  }
83
75
  }
84
76
 
85
- @mixin density($config-or-theme) {
86
- $density-scale: theming.get-density-config($config-or-theme);
87
- $mdc-list-density-tokens: tokens-mdc-list.get-density-tokens($density-scale);
77
+ @mixin density($theme) {
78
+ $density-scale: inspection.get-theme-density($theme);
79
+ $mdc-list-density-tokens: tokens-mdc-list.get-density-tokens($theme);
88
80
 
89
81
  // Add values for MDC list tokens.
90
82
  .mat-mdc-list-base {
@@ -94,7 +86,6 @@
94
86
  // TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based API,
95
87
  // to avoid screenshot diffs. We should remove it in favor of following MDC's current style, or
96
88
  // add custom tokens for it.
97
- $clamped-density-scale: theming.clamp-density($density-scale, -5);
98
89
  .mat-mdc-list-item {
99
90
  &.mdc-list-item--with-leading-avatar,
100
91
  &.mdc-list-item--with-leading-checkbox,
@@ -107,7 +98,7 @@
107
98
  -3: 44px,
108
99
  -4: 40px,
109
100
  -5: 40px,
110
- ), $clamped-density-scale);
101
+ ), $density-scale);
111
102
  }
112
103
 
113
104
  &.mdc-list-item--with-two-lines {
@@ -118,16 +109,14 @@
118
109
  -3: 60px,
119
110
  -4: 56px,
120
111
  -5: 56px,
121
- ), $clamped-density-scale);
112
+ ), $density-scale);
122
113
  }
123
114
  }
124
115
  }
125
116
  }
126
117
 
127
- @mixin typography($config-or-theme) {
128
- $config: typography.private-typography-to-2018-config(
129
- theming.get-typography-config($config-or-theme));
130
- $mdc-list-typography-tokens: tokens-mdc-list.get-typography-tokens($config);
118
+ @mixin typography($theme) {
119
+ $mdc-list-typography-tokens: tokens-mdc-list.get-typography-tokens($theme);
131
120
 
132
121
  // Add values for MDC list tokens.
133
122
  .mat-mdc-list-base {
@@ -137,26 +126,22 @@
137
126
  // MDC does not have tokens for the subheader.
138
127
  // TODO(mmalerba): Discuss with MDC about adding them, or create custom tokens.
139
128
  .mdc-list-group__subheader {
140
- @include typography-utils.typography-level($config, subtitle-1);
129
+ font: inspection.get-theme-typography($theme, subtitle-1, font);
130
+ letter-spacing: inspection.get-theme-typography($theme, subtitle-1, letter-spacing);
141
131
  }
142
132
  }
143
133
 
144
- @mixin theme($theme-or-color-config) {
145
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
134
+ @mixin theme($theme) {
146
135
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-list') {
147
- $color: theming.get-color-config($theme);
148
- $density: theming.get-density-config($theme);
149
- $typography: theming.get-typography-config($theme);
150
-
151
136
  @include base($theme);
152
- @if $color != null {
153
- @include color($color);
137
+ @if inspection.theme-has($theme, color) {
138
+ @include color($theme);
154
139
  }
155
- @if $density != null {
156
- @include density($density);
140
+ @if inspection.theme-has($theme, density) {
141
+ @include density($theme);
157
142
  }
158
- @if $typography != null {
159
- @include typography($typography);
143
+ @if inspection.theme-has($theme, typography) {
144
+ @include typography($theme);
160
145
  }
161
146
  }
162
147
  }
@@ -2,44 +2,35 @@
2
2
  @use '../core/style/sass-utils';
3
3
  @use '../core/tokens/token-utils';
4
4
  @use '../core/theming/theming';
5
+ @use '../core/theming/inspection';
5
6
  @use '../core/typography/typography';
6
7
 
7
-
8
- @mixin color($config-or-theme) {
9
- $config: theming.get-color-config($config-or-theme);
10
-
8
+ @mixin color($theme) {
11
9
  @include sass-utils.current-selector-or-root() {
12
10
  @include token-utils.create-token-values(tokens-mat-menu.$prefix,
13
- tokens-mat-menu.get-color-tokens($config));
11
+ tokens-mat-menu.get-color-tokens($theme));
14
12
  }
15
13
  }
16
14
 
17
- @mixin typography($config-or-theme) {
18
- $config: typography.private-typography-to-2018-config(
19
- theming.get-typography-config($config-or-theme));
15
+ @mixin typography($theme) {
20
16
  @include sass-utils.current-selector-or-root() {
21
17
  @include token-utils.create-token-values(tokens-mat-menu.$prefix,
22
- tokens-mat-menu.get-typography-tokens($config));
18
+ tokens-mat-menu.get-typography-tokens($theme));
23
19
  }
24
20
  }
25
21
 
26
- @mixin density($config-or-theme) {}
22
+ @mixin density($theme) {}
27
23
 
28
- @mixin theme($theme-or-color-config) {
29
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
24
+ @mixin theme($theme) {
30
25
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-menu') {
31
- $color: theming.get-color-config($theme);
32
- $density: theming.get-density-config($theme);
33
- $typography: theming.get-typography-config($theme);
34
-
35
- @if $color != null {
36
- @include color($color);
26
+ @if inspection.theme-has($theme, color) {
27
+ @include color($theme);
37
28
  }
38
- @if $density != null {
39
- @include density($density);
29
+ @if inspection.theme-has($theme, density) {
30
+ @include density($theme);
40
31
  }
41
- @if $typography != null {
42
- @include typography($typography);
32
+ @if inspection.theme-has($theme, typography) {
33
+ @include typography($theme);
43
34
  }
44
35
  }
45
36
  }
package/menu/index.d.ts CHANGED
@@ -1,15 +1,10 @@
1
- import { _AbstractConstructor } from '@angular/material/core';
2
1
  import { AfterContentInit } from '@angular/core';
3
2
  import { AfterViewInit } from '@angular/core';
4
3
  import { AnimationEvent as AnimationEvent_2 } from '@angular/animations';
5
4
  import { AnimationTriggerMetadata } from '@angular/animations';
6
5
  import { ApplicationRef } from '@angular/core';
7
- import { BooleanInput } from '@angular/cdk/coercion';
8
- import { CanDisable } from '@angular/material/core';
9
- import { CanDisableRipple } from '@angular/material/core';
10
6
  import { ChangeDetectorRef } from '@angular/core';
11
7
  import { ComponentFactoryResolver } from '@angular/core';
12
- import { _Constructor } from '@angular/material/core';
13
8
  import { Direction } from '@angular/cdk/bidi';
14
9
  import { Directionality } from '@angular/cdk/bidi';
15
10
  import { ElementRef } from '@angular/core';
@@ -166,13 +161,9 @@ export declare class MatMenu implements AfterContentInit, MatMenuPanel<MatMenuIt
166
161
  */
167
162
  lazyContent: MatMenuContent;
168
163
  /** Whether the menu should overlap its trigger. */
169
- get overlapTrigger(): boolean;
170
- set overlapTrigger(value: BooleanInput);
171
- private _overlapTrigger;
164
+ overlapTrigger: boolean;
172
165
  /** Whether the menu has a backdrop. */
173
- get hasBackdrop(): boolean | undefined;
174
- set hasBackdrop(value: BooleanInput);
175
- private _hasBackdrop;
166
+ hasBackdrop?: boolean;
176
167
  /**
177
168
  * This method takes classes set on the host mat-menu element and applies them on the
178
169
  * menu template that displays in the overlay container. Otherwise, it's difficult
@@ -259,6 +250,8 @@ export declare class MatMenu implements AfterContentInit, MatMenuPanel<MatMenuIt
259
250
  private _updateDirectDescendants;
260
251
  static ɵfac: i0.ɵɵFactoryDeclaration<MatMenu, never>;
261
252
  static ɵcmp: i0.ɵɵComponentDeclaration<MatMenu, "mat-menu", ["matMenu"], { "backdropClass": { "alias": "backdropClass"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "overlapTrigger": { "alias": "overlapTrigger"; "required": false; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; "panelClass": { "alias": "class"; "required": false; }; "classList": { "alias": "classList"; "required": false; }; }, { "closed": "closed"; "close": "close"; }, ["lazyContent", "_allItems", "items"], ["*"], false, never>;
253
+ static ngAcceptInputType_overlapTrigger: unknown;
254
+ static ngAcceptInputType_hasBackdrop: any;
262
255
  }
263
256
 
264
257
  /**
@@ -325,7 +318,7 @@ export declare interface MatMenuDefaultOptions {
325
318
  /**
326
319
  * Single item inside a `mat-menu`. Provides the menu item styling and accessibility treatment.
327
320
  */
328
- export declare class MatMenuItem extends _MatMenuItemBase implements FocusableOption, CanDisable, CanDisableRipple, AfterViewInit, OnDestroy {
321
+ export declare class MatMenuItem implements FocusableOption, AfterViewInit, OnDestroy {
329
322
  private _elementRef;
330
323
  private _document?;
331
324
  private _focusMonitor?;
@@ -333,6 +326,10 @@ export declare class MatMenuItem extends _MatMenuItemBase implements FocusableOp
333
326
  private _changeDetectorRef?;
334
327
  /** ARIA role for the menu item. */
335
328
  role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox';
329
+ /** Whether the menu item is disabled. */
330
+ disabled: boolean;
331
+ /** Whether ripples are disabled on the menu item. */
332
+ disableRipple: boolean;
336
333
  /** Stream that emits when the menu item is hovered. */
337
334
  readonly _hovered: Subject<MatMenuItem>;
338
335
  /** Stream that emits when the menu item is focused. */
@@ -365,14 +362,11 @@ export declare class MatMenuItem extends _MatMenuItemBase implements FocusableOp
365
362
  _setTriggersSubmenu(triggersSubmenu: boolean): void;
366
363
  _hasFocus(): boolean;
367
364
  static ɵfac: i0.ɵɵFactoryDeclaration<MatMenuItem, [null, null, null, { optional: true; }, null]>;
368
- static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "role": { "alias": "role"; "required": false; }; }, {}, never, ["mat-icon, [matMenuItemIcon]", "*"], false, never>;
365
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; }, {}, never, ["mat-icon, [matMenuItemIcon]", "*"], false, never>;
366
+ static ngAcceptInputType_disabled: unknown;
367
+ static ngAcceptInputType_disableRipple: unknown;
369
368
  }
370
369
 
371
- /** @docs-private */
372
- declare const _MatMenuItemBase: _Constructor<CanDisableRipple> & _AbstractConstructor<CanDisableRipple> & _Constructor<CanDisable> & _AbstractConstructor<CanDisable> & {
373
- new (): {};
374
- };
375
-
376
370
  export declare class MatMenuModule {
377
371
  static ɵfac: i0.ɵɵFactoryDeclaration<MatMenuModule, never>;
378
372
  static ɵmod: i0.ɵɵNgModuleDeclaration<MatMenuModule, [typeof i1.MatMenu, typeof i2.MatMenuItem, typeof i3.MatMenuContent, typeof i4.MatMenuTrigger], [typeof i5.CommonModule, typeof i6.MatRippleModule, typeof i6.MatCommonModule, typeof i7.OverlayModule], [typeof i8.CdkScrollableModule, typeof i1.MatMenu, typeof i6.MatCommonModule, typeof i2.MatMenuItem, typeof i3.MatMenuContent, typeof i4.MatMenuTrigger]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material",
3
- "version": "17.0.0-next.0",
3
+ "version": "17.0.0-next.2",
4
4
  "description": "Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -478,7 +478,7 @@
478
478
  },
479
479
  "peerDependencies": {
480
480
  "@angular/animations": "^17.0.0-0 || ^17.1.0-0 || ^17.2.0-0 || ^17.3.0-0 || ^18.0.0-0",
481
- "@angular/cdk": "17.0.0-next.0",
481
+ "@angular/cdk": "17.0.0-next.2",
482
482
  "@angular/core": "^17.0.0-0 || ^17.1.0-0 || ^17.2.0-0 || ^17.3.0-0 || ^18.0.0-0",
483
483
  "@angular/common": "^17.0.0-0 || ^17.1.0-0 || ^17.2.0-0 || ^17.3.0-0 || ^18.0.0-0",
484
484
  "@angular/forms": "^17.0.0-0 || ^17.1.0-0 || ^17.2.0-0 || ^17.3.0-0 || ^18.0.0-0",