@angular/material 18.1.0-next.4 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/badge/index.d.ts +5 -2
  2. package/button/_button-base.scss +13 -6
  3. package/button/_button-theme.scss +26 -27
  4. package/button/_fab-theme.scss +16 -16
  5. package/button/_icon-button-theme.scss +14 -20
  6. package/button/index.d.ts +7 -0
  7. package/card/_card-theme.scss +25 -52
  8. package/checkbox/index.d.ts +4 -2
  9. package/chips/_chips-theme.scss +22 -24
  10. package/core/m2/_typography.scss +5 -2
  11. package/core/mdc-helpers/_mdc-helpers.scss +2 -2
  12. package/core/style/_elevation.scss +5 -0
  13. package/core/tokens/_token-utils.scss +2 -2
  14. package/core/tokens/m2/mat/_app.scss +1 -2
  15. package/core/tokens/m2/mat/_autocomplete.scss +2 -2
  16. package/core/tokens/m2/mat/_datepicker.scss +3 -3
  17. package/core/tokens/m2/mat/_dialog.scss +2 -2
  18. package/core/tokens/m2/mat/_fab-small.scss +3 -9
  19. package/core/tokens/m2/mat/_fab.scss +3 -9
  20. package/core/tokens/m2/mat/_filled-button.scss +3 -9
  21. package/core/tokens/m2/mat/_form-field.scss +9 -6
  22. package/core/tokens/m2/mat/_icon-button.scss +3 -9
  23. package/core/tokens/m2/mat/_outlined-button.scss +3 -9
  24. package/core/tokens/m2/mat/_paginator.scss +10 -6
  25. package/core/tokens/m2/mat/_protected-button.scss +3 -9
  26. package/core/tokens/m2/mat/_select.scss +2 -2
  27. package/core/tokens/m2/mat/_sidenav.scss +2 -2
  28. package/core/tokens/m2/mat/_text-button.scss +3 -9
  29. package/core/tokens/m2/mdc/_chip.scss +2 -14
  30. package/core/tokens/m2/mdc/_elevated-card.scss +3 -7
  31. package/core/tokens/m2/mdc/_extended-fab.scss +13 -10
  32. package/core/tokens/m2/mdc/_fab-small.scss +15 -13
  33. package/core/tokens/m2/mdc/_fab.scss +15 -13
  34. package/core/tokens/m2/mdc/_outlined-card.scss +2 -6
  35. package/core/tokens/m2/mdc/_protected-button.scss +13 -7
  36. package/core/tokens/m3/mat/_app.scss +2 -2
  37. package/core/tokens/m3/mat/_autocomplete.scss +2 -2
  38. package/core/tokens/m3/mat/_datepicker.scss +3 -3
  39. package/core/tokens/m3/mat/_select.scss +2 -2
  40. package/core/tokens/m3/mdc/_chip.scss +1 -4
  41. package/core/tokens/m3/mdc/_elevated-card.scss +9 -2
  42. package/core/tokens/m3/mdc/_extended-fab.scss +19 -2
  43. package/core/tokens/m3/mdc/_fab-small.scss +19 -2
  44. package/core/tokens/m3/mdc/_fab.scss +19 -2
  45. package/core/tokens/m3/mdc/_outlined-card.scss +9 -2
  46. package/core/tokens/m3/mdc/_protected-button.scss +22 -5
  47. package/datepicker/index.d.ts +13 -5
  48. package/esm2022/badge/badge.mjs +6 -3
  49. package/esm2022/button/button-base.mjs +3 -3
  50. package/esm2022/button/button.mjs +4 -4
  51. package/esm2022/button/fab.mjs +9 -9
  52. package/esm2022/button/icon-button.mjs +4 -4
  53. package/esm2022/card/card.mjs +2 -2
  54. package/esm2022/checkbox/checkbox-config.mjs +1 -1
  55. package/esm2022/chips/chip-grid.mjs +26 -8
  56. package/esm2022/chips/chip-listbox.mjs +2 -2
  57. package/esm2022/chips/chip-option.mjs +3 -3
  58. package/esm2022/chips/chip-row.mjs +3 -3
  59. package/esm2022/chips/chip-set.mjs +2 -2
  60. package/esm2022/chips/chip.mjs +3 -3
  61. package/esm2022/core/internal-form-field/internal-form-field.mjs +2 -2
  62. package/esm2022/core/ripple/ripple-renderer.mjs +21 -3
  63. package/esm2022/core/version.mjs +1 -1
  64. package/esm2022/datepicker/datepicker-base.mjs +6 -4
  65. package/esm2022/datepicker/datepicker-input-base.mjs +1 -1
  66. package/esm2022/dialog/dialog-container.mjs +3 -3
  67. package/esm2022/form-field/form-field.mjs +9 -18
  68. package/esm2022/list/action-list.mjs +2 -2
  69. package/esm2022/list/list-option.mjs +18 -4
  70. package/esm2022/list/list.mjs +10 -4
  71. package/esm2022/list/nav-list.mjs +2 -2
  72. package/esm2022/list/selection-list.mjs +2 -2
  73. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  74. package/esm2022/tabs/tabs-animations.mjs +2 -2
  75. package/fesm2022/badge.mjs +5 -2
  76. package/fesm2022/badge.mjs.map +1 -1
  77. package/fesm2022/button.mjs +18 -18
  78. package/fesm2022/button.mjs.map +1 -1
  79. package/fesm2022/card.mjs +2 -2
  80. package/fesm2022/card.mjs.map +1 -1
  81. package/fesm2022/checkbox.mjs.map +1 -1
  82. package/fesm2022/chips.mjs +35 -17
  83. package/fesm2022/chips.mjs.map +1 -1
  84. package/fesm2022/core.mjs +23 -5
  85. package/fesm2022/core.mjs.map +1 -1
  86. package/fesm2022/datepicker.mjs +5 -3
  87. package/fesm2022/datepicker.mjs.map +1 -1
  88. package/fesm2022/dialog.mjs +2 -2
  89. package/fesm2022/dialog.mjs.map +1 -1
  90. package/fesm2022/form-field.mjs +8 -17
  91. package/fesm2022/form-field.mjs.map +1 -1
  92. package/fesm2022/list.mjs +32 -12
  93. package/fesm2022/list.mjs.map +1 -1
  94. package/fesm2022/slide-toggle.mjs +2 -2
  95. package/fesm2022/slide-toggle.mjs.map +1 -1
  96. package/fesm2022/tabs.mjs +1 -1
  97. package/fesm2022/tabs.mjs.map +1 -1
  98. package/form-field/_form-field-subscript.scss +2 -2
  99. package/form-field/_mdc-text-field-structure-overrides.scss +2 -3
  100. package/form-field/index.d.ts +9 -7
  101. package/list/_list-inherited-structure.scss +516 -0
  102. package/list/_list-item-hcm-indicator.scss +2 -3
  103. package/list/_list-theme.scss +17 -18
  104. package/list/index.d.ts +2 -0
  105. package/package.json +7 -7
  106. package/prebuilt-themes/azure-blue.css +1 -1
  107. package/prebuilt-themes/cyan-orange.css +1 -1
  108. package/prebuilt-themes/deeppurple-amber.css +1 -1
  109. package/prebuilt-themes/indigo-pink.css +1 -1
  110. package/prebuilt-themes/magenta-violet.css +1 -1
  111. package/prebuilt-themes/pink-bluegrey.css +1 -1
  112. package/prebuilt-themes/purple-green.css +1 -1
  113. package/prebuilt-themes/rose-red.css +1 -1
  114. package/schematics/ng-add/index.js +2 -2
  115. package/schematics/ng-add/index.mjs +2 -2
  116. package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
  117. package/schematics/ng-update/index_bundled.js +31 -31
  118. package/list/_list-option-trailing-avatar-compat.scss +0 -58
package/badge/index.d.ts CHANGED
@@ -26,8 +26,11 @@ export declare class MatBadge implements OnInit, OnDestroy {
26
26
  private _renderer;
27
27
  private _animationMode?;
28
28
  /**
29
- * The color of the badge. Can be `primary`, `accent`, or `warn`.
30
- * Not recommended in M3, for more information see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants.
29
+ * Theme color of the badge. This API is supported in M2 themes only, it
30
+ * has no effect in M3 themes.
31
+ *
32
+ * For information on applying color variants in M3, see
33
+ * https://material.angular.io/guide/theming#using-component-color-variants.
31
34
  */
32
35
  get color(): ThemePalette;
33
36
  set color(value: ThemePalette);
@@ -1,8 +1,5 @@
1
- @use '@material/touch-target' as mdc-touch-target;
2
-
3
1
  @use '../core/tokens/token-utils';
4
2
  @use '../core/style/layout-common';
5
- @use '../core/mdc-helpers/mdc-helpers';
6
3
 
7
4
  // Adds styles necessary to provide stateful interactions with the button. This includes providing
8
5
  // content for the state container's ::before and ::after so that they can be given a background
@@ -126,9 +123,19 @@
126
123
  // the button itself would require us to wrap it in another div. See:
127
124
  // https://github.com/material-components/material-components-web/tree/master/packages/mdc-button#making-buttons-accessible
128
125
  .mat-mdc-button-touch-target {
129
- @include mdc-touch-target.touch-target(
130
- $set-width: $is-square,
131
- $query: mdc-helpers.$mdc-base-styles-query);
126
+ position: absolute;
127
+ top: 50%;
128
+ height: 48px;
129
+
130
+ @if $is-square {
131
+ left: 50%;
132
+ width: 48px;
133
+ transform: translate(-50%, -50%);
134
+ } @else {
135
+ left: 0;
136
+ right: 0;
137
+ transform: translateY(-50%);
138
+ }
132
139
 
133
140
  @include token-utils.use-tokens($prefix, $slots) {
134
141
  @include token-utils.create-token-slot(display, touch-target-display);
@@ -1,8 +1,3 @@
1
- @use '@material/button/button-text-theme' as mdc-button-text-theme;
2
- @use '@material/button/button-filled-theme' as mdc-button-filled-theme;
3
- @use '@material/button/button-protected-theme' as mdc-button-protected-theme;
4
- @use '@material/button/button-outlined-theme' as mdc-button-outlined-theme;
5
-
6
1
  @use '../core/theming/theming';
7
2
  @use '../core/theming/inspection';
8
3
  @use '../core/theming/validation';
@@ -29,7 +24,7 @@
29
24
  tokens-mat-text-button.get-color-tokens($theme)
30
25
  );
31
26
 
32
- @include mdc-button-text-theme.theme($mdc-tokens);
27
+ @include token-utils.create-token-values(tokens-mdc-text-button.$prefix, $mdc-tokens);
33
28
  @include token-utils.create-token-values(tokens-mat-text-button.$prefix, $mat-tokens);
34
29
  }
35
30
 
@@ -44,7 +39,7 @@
44
39
  tokens-mat-filled-button.get-color-tokens($theme)
45
40
  );
46
41
 
47
- @include mdc-button-filled-theme.theme($mdc-tokens);
42
+ @include token-utils.create-token-values(tokens-mdc-filled-button.$prefix, $mdc-tokens);
48
43
  @include token-utils.create-token-values(tokens-mat-filled-button.$prefix, $mat-tokens);
49
44
  }
50
45
 
@@ -59,7 +54,7 @@
59
54
  tokens-mat-protected-button.get-color-tokens($theme)
60
55
  );
61
56
 
62
- @include mdc-button-protected-theme.theme($mdc-tokens);
57
+ @include token-utils.create-token-values(tokens-mdc-protected-button.$prefix, $mdc-tokens);
63
58
  @include token-utils.create-token-values(tokens-mat-protected-button.$prefix, $mat-tokens);
64
59
  }
65
60
 
@@ -74,7 +69,7 @@
74
69
  tokens-mat-outlined-button.get-color-tokens($theme)
75
70
  );
76
71
 
77
- @include mdc-button-outlined-theme.theme($mdc-tokens);
72
+ @include token-utils.create-token-values(tokens-mdc-outlined-button.$prefix, $mdc-tokens);
78
73
  @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix, $mat-tokens);
79
74
  }
80
75
 
@@ -97,10 +92,14 @@
97
92
  token-utils.get-tokens-for($tokens, tokens-mat-filled-button.$prefix, $options...);
98
93
  $mat-outlined-button-tokens:
99
94
  token-utils.get-tokens-for($tokens, tokens-mat-outlined-button.$prefix, $options...);
100
- @include mdc-button-text-theme.theme($mdc-text-button-tokens);
101
- @include mdc-button-protected-theme.theme($mdc-protected-button-tokens);
102
- @include mdc-button-filled-theme.theme($mdc-filled-button-tokens);
103
- @include mdc-button-outlined-theme.theme($mdc-outlined-button-tokens);
95
+
96
+ @include token-utils.create-token-values(tokens-mdc-text-button.$prefix, $mdc-text-button-tokens);
97
+ @include token-utils.create-token-values(
98
+ tokens-mdc-protected-button.$prefix, $mdc-protected-button-tokens);
99
+ @include token-utils.create-token-values(
100
+ tokens-mdc-filled-button.$prefix, $mdc-filled-button-tokens);
101
+ @include token-utils.create-token-values(
102
+ tokens-mdc-outlined-button.$prefix, $mdc-outlined-button-tokens);
104
103
  @include token-utils.create-token-values(tokens-mat-text-button.$prefix, $mat-text-button-tokens);
105
104
  @include token-utils.create-token-values(
106
105
  tokens-mat-protected-button.$prefix, $mat-protected-button-tokens);
@@ -119,13 +118,13 @@
119
118
  }
120
119
  @else {
121
120
  @include sass-utils.current-selector-or-root() {
122
- @include mdc-button-text-theme.theme(
121
+ @include token-utils.create-token-values(tokens-mdc-text-button.$prefix,
123
122
  tokens-mdc-text-button.get-unthemable-tokens());
124
- @include mdc-button-filled-theme.theme(
123
+ @include token-utils.create-token-values(tokens-mdc-filled-button.$prefix,
125
124
  tokens-mdc-filled-button.get-unthemable-tokens());
126
- @include mdc-button-protected-theme.theme(
125
+ @include token-utils.create-token-values(tokens-mdc-protected-button.$prefix,
127
126
  tokens-mdc-protected-button.get-unthemable-tokens());
128
- @include mdc-button-outlined-theme.theme(
127
+ @include token-utils.create-token-values(tokens-mdc-outlined-button.$prefix,
129
128
  tokens-mdc-outlined-button.get-unthemable-tokens());
130
129
 
131
130
  @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
@@ -223,14 +222,14 @@
223
222
  }
224
223
  @else {
225
224
  @include sass-utils.current-selector-or-root() {
226
- @include mdc-button-text-theme.theme(
225
+ @include token-utils.create-token-values(tokens-mdc-text-button.$prefix,
227
226
  tokens-mdc-text-button.get-typography-tokens($theme));
228
- @include mdc-button-filled-theme.theme(
227
+ @include token-utils.create-token-values(tokens-mdc-filled-button.$prefix,
229
228
  tokens-mdc-filled-button.get-typography-tokens($theme));
230
- @include mdc-button-outlined-theme.theme(
231
- tokens-mdc-outlined-button.get-typography-tokens($theme));
232
- @include mdc-button-protected-theme.theme(
229
+ @include token-utils.create-token-values(tokens-mdc-protected-button.$prefix,
233
230
  tokens-mdc-protected-button.get-typography-tokens($theme));
231
+ @include token-utils.create-token-values(tokens-mdc-outlined-button.$prefix,
232
+ tokens-mdc-outlined-button.get-typography-tokens($theme));
234
233
 
235
234
  @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
236
235
  tokens-mat-text-button.get-typography-tokens($theme));
@@ -252,14 +251,14 @@
252
251
  }
253
252
  @else {
254
253
  @include sass-utils.current-selector-or-root() {
255
- @include mdc-button-text-theme.theme(
254
+ @include token-utils.create-token-values(tokens-mdc-text-button.$prefix,
256
255
  tokens-mdc-text-button.get-density-tokens($theme));
257
- @include mdc-button-filled-theme.theme(
256
+ @include token-utils.create-token-values(tokens-mdc-filled-button.$prefix,
258
257
  tokens-mdc-filled-button.get-density-tokens($theme));
259
- @include mdc-button-outlined-theme.theme(
260
- tokens-mdc-outlined-button.get-density-tokens($theme));
261
- @include mdc-button-protected-theme.theme(
258
+ @include token-utils.create-token-values(tokens-mdc-protected-button.$prefix,
262
259
  tokens-mdc-protected-button.get-density-tokens($theme));
260
+ @include token-utils.create-token-values(tokens-mdc-outlined-button.$prefix,
261
+ tokens-mdc-outlined-button.get-density-tokens($theme));
263
262
 
264
263
  @include token-utils.create-token-values(tokens-mat-text-button.$prefix,
265
264
  tokens-mat-text-button.get-density-tokens($theme));
@@ -1,6 +1,3 @@
1
- @use '@material/fab/fab-theme' as mdc-fab-theme;
2
- @use '@material/fab/fab-small-theme' as mdc-fab-small-theme;
3
- @use '@material/fab/extended-fab-theme' as mdc-extended-fab-theme;
4
1
  @use '../core/style/sass-utils';
5
2
  @use '../core/theming/theming';
6
3
  @use '../core/theming/inspection';
@@ -21,13 +18,13 @@
21
18
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
22
19
  }
23
20
  @else {
24
- // Add default values for tokens not related to color, typography, or density.
25
21
  @include sass-utils.current-selector-or-root() {
26
- @include mdc-fab-theme.theme(tokens-mdc-fab.get-unthemable-tokens());
27
- @include mdc-fab-small-theme.theme(tokens-mdc-fab-small.get-unthemable-tokens());
28
- @include mdc-extended-fab-theme.theme(
29
- tokens-mdc-extended-fab.get-unthemable-tokens()
30
- );
22
+ @include token-utils.create-token-values(
23
+ tokens-mdc-fab.$prefix, tokens-mdc-fab.get-unthemable-tokens());
24
+ @include token-utils.create-token-values(
25
+ tokens-mdc-fab-small.$prefix, tokens-mdc-fab-small.get-unthemable-tokens());
26
+ @include token-utils.create-token-values(
27
+ tokens-mdc-extended-fab.$prefix, tokens-mdc-extended-fab.get-unthemable-tokens());
31
28
  }
32
29
  }
33
30
  }
@@ -43,7 +40,7 @@
43
40
  tokens-mat-fab.get-color-tokens($theme)
44
41
  );
45
42
 
46
- @include mdc-fab-theme.theme($mdc-tokens);
43
+ @include token-utils.create-token-values(tokens-mdc-fab.$prefix, $mdc-tokens);
47
44
  @include token-utils.create-token-values(tokens-mat-fab.$prefix, $mat-tokens);
48
45
  }
49
46
 
@@ -58,7 +55,7 @@
58
55
  tokens-mat-fab-small.get-color-tokens($theme)
59
56
  );
60
57
 
61
- @include mdc-fab-small-theme.theme($mdc-tokens);
58
+ @include token-utils.create-token-values(tokens-mdc-fab-small.$prefix, $mdc-tokens);
62
59
  @include token-utils.create-token-values(tokens-mat-fab-small.$prefix, $mat-tokens);
63
60
  }
64
61
 
@@ -75,7 +72,8 @@
75
72
  @include sass-utils.current-selector-or-root() {
76
73
  @include _fab-variant($theme, null);
77
74
  @include _fab-small-variant($theme, null);
78
- @include mdc-extended-fab-theme.theme(tokens-mdc-extended-fab.get-color-tokens($theme));
75
+ @include token-utils.create-token-values(
76
+ tokens-mdc-extended-fab.$prefix, tokens-mdc-extended-fab.get-color-tokens($theme));
79
77
 
80
78
  .mat-mdc-fab {
81
79
  &.mat-primary {
@@ -116,7 +114,8 @@
116
114
  }
117
115
  @else {
118
116
  @include sass-utils.current-selector-or-root() {
119
- @include mdc-extended-fab-theme.theme(tokens-mdc-extended-fab.get-typography-tokens($theme));
117
+ @include token-utils.create-token-values(tokens-mdc-extended-fab.$prefix,
118
+ tokens-mdc-extended-fab.get-typography-tokens($theme));
120
119
  @include token-utils.create-token-values(tokens-mat-fab.$prefix,
121
120
  tokens-mat-fab.get-typography-tokens($theme));
122
121
  @include token-utils.create-token-values(tokens-mat-fab-small.$prefix,
@@ -190,9 +189,10 @@
190
189
  $mat-fab-tokens: token-utils.get-tokens-for($tokens, tokens-mat-fab.$prefix, $options...);
191
190
  $mat-fab-small-tokens: token-utils.get-tokens-for($tokens, tokens-mat-fab-small.$prefix,
192
191
  $options...);
193
- @include mdc-extended-fab-theme.theme($mdc-extended-fab-tokens);
194
- @include mdc-fab-theme.theme($mdc-fab-tokens);
195
- @include mdc-fab-small-theme.theme($mdc-fab-small-tokens);
192
+ @include token-utils.create-token-values(tokens-mdc-extended-fab.$prefix,
193
+ $mdc-extended-fab-tokens);
194
+ @include token-utils.create-token-values(tokens-mdc-fab.$prefix, $mdc-fab-tokens);
195
+ @include token-utils.create-token-values(tokens-mdc-fab-small.$prefix, $mdc-fab-small-tokens);
196
196
  @include token-utils.create-token-values(tokens-mat-fab.$prefix, $mat-fab-tokens);
197
197
  @include token-utils.create-token-values(tokens-mat-fab-small.$prefix, $mat-fab-small-tokens);
198
198
  }
@@ -1,7 +1,5 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:math';
3
- @use '@material/density/functions' as mdc-density-functions;
4
- @use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme;
5
3
  @use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button;
6
4
  @use '../core/tokens/m2/mat/icon-button' as tokens-mat-icon-button;
7
5
  @use '../core/style/sass-utils';
@@ -18,7 +16,8 @@
18
16
  @else {
19
17
  // Add default values for tokens not related to color, typography, or density.
20
18
  @include sass-utils.current-selector-or-root() {
21
- @include mdc-icon-button-theme.theme(tokens-mdc-icon-button.get-unthemable-tokens());
19
+ @include token-utils.create-token-values(tokens-mdc-icon-button.$prefix,
20
+ tokens-mdc-icon-button.get-unthemable-tokens());
22
21
  }
23
22
  }
24
23
  }
@@ -34,7 +33,7 @@
34
33
  tokens-mat-icon-button.get-color-tokens($theme)
35
34
  );
36
35
 
37
- @include mdc-icon-button-theme.theme($mdc-tokens);
36
+ @include token-utils.create-token-values(tokens-mdc-icon-button.$prefix, $mdc-tokens);
38
37
  @include token-utils.create-token-values(tokens-mat-icon-button.$prefix, $mat-tokens);
39
38
  }
40
39
 
@@ -82,19 +81,15 @@
82
81
  @else {
83
82
  $icon-size: 24px;
84
83
  $density-scale: inspection.get-theme-density($theme);
85
- // Manually apply the expected density theming, and include the padding
86
- // as it was applied before
87
- $calculated-size: mdc-density-functions.prop-value(
88
- $density-config: (
89
- size: (
90
- default: 48px,
91
- maximum: 48px,
92
- minimum: 28px,
93
- ),
94
- ),
95
- $density-scale: $density-scale,
96
- $property-name: size,
84
+ $size-map: (
85
+ 0: 48px,
86
+ -1: 44px,
87
+ -2: 40px,
88
+ -3: 36px,
89
+ -4: 32px,
90
+ -5: 28px,
97
91
  );
92
+ $calculated-size: map.get($size-map, $density-scale);
98
93
 
99
94
  @include sass-utils.current-selector-or-root() {
100
95
  @include token-utils.create-token-values(tokens-mat-icon-button.$prefix,
@@ -105,9 +100,7 @@
105
100
  .mat-mdc-icon-button.mat-mdc-button-base {
106
101
  // Match the styles that used to be present. This is necessary for backwards
107
102
  // compat to match the previous implementations selector count (two classes).
108
- @include mdc-icon-button-theme.theme((
109
- state-layer-size: $calculated-size,
110
- ));
103
+ --mdc-icon-button-state-layer-size: #{$calculated-size};
111
104
 
112
105
  // TODO: Switch calculated-size to "var(--mdc-icon-button-state-layer-size)"
113
106
  // Currently fails validation because the variable is "undefined"
@@ -153,7 +146,8 @@
153
146
  @include validation.selector-defined(
154
147
  'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
155
148
  @if ($tokens != ()) {
156
- @include mdc-icon-button-theme.theme(map.get($tokens, tokens-mdc-icon-button.$prefix));
149
+ @include token-utils.create-token-values(
150
+ tokens-mdc-icon-button.$prefix, map.get($tokens, tokens-mdc-icon-button.$prefix));
157
151
  @include token-utils.create-token-values(
158
152
  tokens-mat-icon-button.$prefix, map.get($tokens, tokens-mat-icon-button.$prefix));
159
153
  }
package/button/index.d.ts CHANGED
@@ -210,6 +210,13 @@ export declare class MatFabButton extends MatButtonBase {
210
210
 
211
211
  /** Default FAB options that can be overridden. */
212
212
  export declare interface MatFabDefaultOptions {
213
+ /**
214
+ * Default theme color of the button. This API is supported in M2 themes
215
+ * only, it has no effect in M3 themes.
216
+ *
217
+ * For information on applying color variants in M3, see
218
+ * https://material.angular.io/guide/theming#using-component-color-variants
219
+ */
213
220
  color?: ThemePalette;
214
221
  }
215
222
 
@@ -8,8 +8,6 @@
8
8
  @use '../core/tokens/m2/mat/card' as tokens-mat-card;
9
9
  @use '../core/tokens/m2/mdc/elevated-card' as tokens-mdc-elevated-card;
10
10
  @use '../core/tokens/m2/mdc/outlined-card' as tokens-mdc-outlined-card;
11
- @use '@material/card/elevated-card-theme' as mdc-elevated-card-theme;
12
- @use '@material/card/outlined-card-theme' as mdc-outlined-card-theme;
13
11
 
14
12
  @mixin base($theme) {
15
13
  @if inspection.get-theme-version($theme) == 1 {
@@ -17,8 +15,10 @@
17
15
  }
18
16
  @else {
19
17
  @include sass-utils.current-selector-or-root() {
20
- @include mdc-elevated-card-theme.theme(tokens-mdc-elevated-card.get-unthemable-tokens());
21
- @include mdc-outlined-card-theme.theme(tokens-mdc-outlined-card.get-unthemable-tokens());
18
+ @include token-utils.create-token-values(
19
+ tokens-mdc-elevated-card.$prefix, tokens-mdc-elevated-card.get-unthemable-tokens());
20
+ @include token-utils.create-token-values(
21
+ tokens-mdc-outlined-card.$prefix, tokens-mdc-outlined-card.get-unthemable-tokens());
22
22
  @include token-utils.create-token-values(
23
23
  tokens-mat-card.$prefix, tokens-mat-card.get-unthemable-tokens());
24
24
  }
@@ -30,23 +30,13 @@
30
30
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
31
31
  }
32
32
  @else {
33
- $mdc-elevated-card-color-tokens: token-utils.resolve-elevation(
34
- tokens-mdc-elevated-card.get-color-tokens($theme),
35
- container-elevation,
36
- container-shadow-color
37
- );
38
- $mdc-outlined-card-color-tokens: token-utils.resolve-elevation(
39
- tokens-mdc-outlined-card.get-color-tokens($theme),
40
- container-elevation,
41
- container-shadow-color,
42
- );
43
- $mat-card-color-tokens: tokens-mat-card.get-color-tokens($theme);
44
-
45
- // Add values for card tokens.
46
33
  @include sass-utils.current-selector-or-root() {
47
- @include mdc-elevated-card-theme.theme($mdc-elevated-card-color-tokens);
48
- @include mdc-outlined-card-theme.theme($mdc-outlined-card-color-tokens);
49
- @include token-utils.create-token-values(tokens-mat-card.$prefix, $mat-card-color-tokens);
34
+ @include token-utils.create-token-values(tokens-mdc-elevated-card.$prefix,
35
+ tokens-mdc-elevated-card.get-color-tokens($theme));
36
+ @include token-utils.create-token-values(tokens-mdc-outlined-card.$prefix,
37
+ tokens-mdc-outlined-card.get-color-tokens($theme));
38
+ @include token-utils.create-token-values(tokens-mat-card.$prefix,
39
+ tokens-mat-card.get-color-tokens($theme));
50
40
  }
51
41
  }
52
42
  }
@@ -56,16 +46,13 @@
56
46
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
57
47
  }
58
48
  @else {
59
- $mdc-elevated-card-typography-tokens: tokens-mdc-elevated-card.get-typography-tokens($theme);
60
- $mdc-outlined-card-typography-tokens: tokens-mdc-outlined-card.get-typography-tokens($theme);
61
- $mat-card-typography-tokens: tokens-mat-card.get-typography-tokens($theme);
62
-
63
- // Add values for card tokens.
64
49
  @include sass-utils.current-selector-or-root() {
65
- @include mdc-elevated-card-theme.theme($mdc-elevated-card-typography-tokens);
66
- @include mdc-outlined-card-theme.theme($mdc-outlined-card-typography-tokens);
67
50
  @include token-utils.create-token-values(
68
- tokens-mat-card.$prefix, $mat-card-typography-tokens);
51
+ tokens-mdc-elevated-card.$prefix, tokens-mdc-elevated-card.get-typography-tokens($theme));
52
+ @include token-utils.create-token-values(
53
+ tokens-mdc-outlined-card.$prefix, tokens-mdc-outlined-card.get-typography-tokens($theme));
54
+ @include token-utils.create-token-values(
55
+ tokens-mat-card.$prefix, tokens-mat-card.get-typography-tokens($theme));
69
56
  }
70
57
  }
71
58
  }
@@ -75,15 +62,13 @@
75
62
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
76
63
  }
77
64
  @else {
78
- $mdc-elevated-card-density-tokens: tokens-mdc-elevated-card.get-density-tokens($theme);
79
- $mdc-outlined-card-density-tokens: tokens-mdc-outlined-card.get-density-tokens($theme);
80
- $mat-card-density-tokens: tokens-mat-card.get-density-tokens($theme);
81
-
82
- // Add values for card tokens.
83
65
  @include sass-utils.current-selector-or-root() {
84
- @include mdc-elevated-card-theme.theme($mdc-elevated-card-density-tokens);
85
- @include mdc-outlined-card-theme.theme($mdc-outlined-card-density-tokens);
86
- @include token-utils.create-token-values(tokens-mat-card.$prefix, $mat-card-density-tokens);
66
+ @include token-utils.create-token-values(tokens-mdc-elevated-card.$prefix,
67
+ tokens-mdc-elevated-card.get-density-tokens($theme));
68
+ @include token-utils.create-token-values(tokens-mdc-outlined-card.$prefix,
69
+ tokens-mdc-outlined-card.get-density-tokens($theme));
70
+ @include token-utils.create-token-values(tokens-mat-card.$prefix,
71
+ tokens-mat-card.get-density-tokens($theme));
87
72
  }
88
73
  }
89
74
  }
@@ -121,22 +106,10 @@
121
106
  @include validation.selector-defined(
122
107
  'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
123
108
  @if ($tokens != ()) {
124
- $elevated-card-tokens: map.get($tokens, tokens-mdc-elevated-card.$prefix);
125
- // Work around a bug in MDC where the elevation is not resolved to an actual shadow value.
126
- $elevated-card-tokens: token-utils.resolve-elevation(
127
- $elevated-card-tokens,
128
- container-elevation,
129
- container-shadow-color
130
- );
131
- $outlined-card-tokens: map.get($tokens, tokens-mdc-outlined-card.$prefix);
132
- // Work around a bug in MDC where the elevation is not resolved to an actual shadow value.
133
- $outlined-card-tokens: token-utils.resolve-elevation(
134
- $outlined-card-tokens,
135
- container-elevation,
136
- container-shadow-color
137
- );
138
- @include mdc-elevated-card-theme.theme($elevated-card-tokens);
139
- @include mdc-outlined-card-theme.theme($outlined-card-tokens);
109
+ @include token-utils.create-token-values(
110
+ tokens-mdc-elevated-card.$prefix, map.get($tokens, tokens-mdc-elevated-card.$prefix));
111
+ @include token-utils.create-token-values(
112
+ tokens-mdc-outlined-card.$prefix, map.get($tokens, tokens-mdc-outlined-card.$prefix));
140
113
  @include token-utils.create-token-values(
141
114
  tokens-mat-card.$prefix, map.get($tokens, tokens-mat-card.$prefix));
142
115
  }
@@ -218,8 +218,10 @@ export declare type MatCheckboxClickAction = 'noop' | 'check' | 'check-indetermi
218
218
  /** Default `mat-checkbox` options that can be overridden. */
219
219
  export declare interface MatCheckboxDefaultOptions {
220
220
  /**
221
- * Default theme color palette to be used for checkboxes. This API is supported in M2 themes
222
- * only, it has no effect in M3 themes. For information on applying color variants in M3, see
221
+ * Default theme color of the checkbox. This API is supported in M2 themes
222
+ * only, it has no effect in M3 themes.
223
+ *
224
+ * For information on applying color variants in M3, see
223
225
  * https://material.angular.io/guide/theming#using-component-color-variants
224
226
  */
225
227
  color?: ThemePalette;
@@ -1,5 +1,4 @@
1
1
  @use 'sass:color';
2
- @use '@material/chips/chip-theme' as mdc-chip-theme;
3
2
  @use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
4
3
  @use '../core/tokens/m2/mat/chip' as tokens-mat-chip;
5
4
  @use '../core/tokens/token-utils';
@@ -17,9 +16,10 @@
17
16
  }
18
17
  @else {
19
18
  .mat-mdc-standard-chip {
20
- @include mdc-chip-theme.theme(tokens-mdc-chip.get-unthemable-tokens());
21
19
  @include token-utils.create-token-values(
22
- tokens-mat-chip.$prefix, tokens-mat-chip.get-unthemable-tokens());
20
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-unthemable-tokens());
21
+ @include token-utils.create-token-values(
22
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-unthemable-tokens());
23
23
  }
24
24
  }
25
25
  }
@@ -35,32 +35,32 @@
35
35
  }
36
36
  @else {
37
37
  .mat-mdc-standard-chip {
38
- $default-color-tokens: tokens-mdc-chip.get-color-tokens($theme);
39
- @include mdc-chip-theme.theme($default-color-tokens);
40
38
  @include token-utils.create-token-values(
41
- tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme));
39
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-color-tokens($theme));
40
+ @include token-utils.create-token-values(
41
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme));
42
42
 
43
43
  &.mat-mdc-chip-selected,
44
44
  &.mat-mdc-chip-highlighted {
45
45
  &.mat-primary {
46
- $primary-color-tokens: tokens-mdc-chip.get-color-tokens($theme, primary);
47
- @include mdc-chip-theme.theme($primary-color-tokens);
48
46
  @include token-utils.create-token-values(
49
- tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, primary));
47
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-color-tokens($theme, primary));
48
+ @include token-utils.create-token-values(
49
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, primary));
50
50
  }
51
51
 
52
52
  &.mat-accent {
53
- $accent-color-tokens: tokens-mdc-chip.get-color-tokens($theme, accent);
54
- @include mdc-chip-theme.theme($accent-color-tokens);
55
53
  @include token-utils.create-token-values(
56
- tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, accent));
54
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-color-tokens($theme, accent));
55
+ @include token-utils.create-token-values(
56
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, accent));
57
57
  }
58
58
 
59
59
  &.mat-warn {
60
- $warn-color-tokens: tokens-mdc-chip.get-color-tokens($theme, warn);
61
- @include mdc-chip-theme.theme($warn-color-tokens);
62
60
  @include token-utils.create-token-values(
63
- tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, warn));
61
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-color-tokens($theme, warn));
62
+ @include token-utils.create-token-values(
63
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, warn));
64
64
  }
65
65
  }
66
66
  }
@@ -74,12 +74,11 @@
74
74
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
75
75
  }
76
76
  @else {
77
- $typography-tokens: tokens-mdc-chip.get-typography-tokens($theme);
78
-
79
77
  .mat-mdc-standard-chip {
80
- @include mdc-chip-theme.theme($typography-tokens);
81
78
  @include token-utils.create-token-values(
82
- tokens-mat-chip.$prefix, tokens-mat-chip.get-typography-tokens($theme));
79
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-typography-tokens($theme));
80
+ @include token-utils.create-token-values(
81
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-typography-tokens($theme));
83
82
  }
84
83
  }
85
84
  }
@@ -91,12 +90,11 @@
91
90
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
92
91
  }
93
92
  @else {
94
- $density-tokens: tokens-mdc-chip.get-density-tokens($theme);
95
-
96
93
  .mat-mdc-chip.mat-mdc-standard-chip {
97
- @include mdc-chip-theme.theme($density-tokens);
98
94
  @include token-utils.create-token-values(
99
- tokens-mat-chip.$prefix, tokens-mat-chip.get-density-tokens($theme));
95
+ tokens-mdc-chip.$prefix, tokens-mdc-chip.get-density-tokens($theme));
96
+ @include token-utils.create-token-values(
97
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-density-tokens($theme));
100
98
  }
101
99
  }
102
100
  }
@@ -141,6 +139,6 @@
141
139
  'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
142
140
  $mdc-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-chip.$prefix, $options...);
143
141
  $mat-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mat-chip.$prefix, $options...);
144
- @include mdc-chip-theme.theme($mdc-chip-tokens);
142
+ @include token-utils.create-token-values(tokens-mdc-chip.$prefix, $mdc-chip-tokens);
145
143
  @include token-utils.create-token-values(tokens-mat-chip.$prefix, $mat-chip-tokens);
146
144
  }
@@ -1,8 +1,11 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:math';
3
3
  @use 'sass:meta';
4
+ @use 'sass:string';
4
5
  @use '@material/typography' as mdc-typography;
5
6
 
7
+ $_default-font-family: string.unquote('Roboto, sans-serif');
8
+
6
9
  /// Defines a typography level from the Material Design spec.
7
10
  /// @param {String} $font-size The font-size for this level.
8
11
  /// @param {String | Number} $line-height The line-height for this level.
@@ -123,7 +126,7 @@
123
126
  @function define-typography-config(
124
127
  // TODO(mmalerba): rename this function to define-typography-config,
125
128
  // and create a predefined px based config for people that need it.
126
- $font-family: mdc-typography.$font-family,
129
+ $font-family: $_default-font-family,
127
130
  $headline-1: null,
128
131
  $headline-2: null,
129
132
  $headline-3: null,
@@ -180,7 +183,7 @@
180
183
  @function define-rem-typography-config(
181
184
  // TODO(mmalerba): rename this function to define-typography-config,
182
185
  // and create a predefined px based config for people that need it.
183
- $font-family: mdc-typography.$font-family,
186
+ $font-family: $_default-font-family,
184
187
  $headline-1: null,
185
188
  $headline-2: null,
186
189
  $headline-3: null,
@@ -1,8 +1,8 @@
1
1
  // TODO(mmalerba): this file should be split into separate cohesive partials for things like
2
2
  // "theming", "typography", "core".
3
+ @use 'sass:string';
3
4
  @use '../typography/typography';
4
5
  @use '@material/feature-targeting' as mdc-feature-targeting;
5
- @use '@material/typography' as mdc-typography;
6
6
  @use '@material/theme/theme-color' as mdc-theme-color;
7
7
  @use '@material/theme/css' as mdc-theme-css;
8
8
 
@@ -32,7 +32,7 @@ $mdc-typography-styles-query: typography;
32
32
  @function private-fallback-typography-from-mdc() {
33
33
  // This is very close to what we have in `define-typography-config`, but we can't use it here,
34
34
  // because it would cause a circular import and moving it here doesn't make sense.
35
- $font-family: mdc-typography.$font-family;
35
+ $font-family: string.unquote('Roboto, sans-serif');
36
36
  @return (
37
37
  font-family: $font-family,
38
38
  headline-1: typography.typography-config-level-from-mdc(headline1, $font-family),
@@ -70,6 +70,11 @@ $prefix: 'mat-elevation-z';
70
70
  }
71
71
  }
72
72
 
73
+ // Gets the box shadow value for a specific elevation.
74
+ @function get-box-shadow($z-value, $shadow-color: black) {
75
+ @return mdc-elevation.elevation-box-shadow($z-value, $shadow-color);
76
+ }
77
+
73
78
  // Returns a string that can be used as the value for a transition property for elevation.
74
79
  // Calling this function directly is useful in situations where a component needs to transition
75
80
  // more than one property.