@angular/material 18.1.0-next.4 → 18.1.0-rc.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 (97) hide show
  1. package/badge/index.d.ts +5 -2
  2. package/button/_fab-theme.scss +16 -16
  3. package/button/_icon-button-theme.scss +14 -20
  4. package/button/index.d.ts +7 -0
  5. package/card/_card-theme.scss +25 -52
  6. package/checkbox/index.d.ts +4 -2
  7. package/chips/_chips-theme.scss +22 -24
  8. package/core/m2/_typography.scss +5 -2
  9. package/core/mdc-helpers/_mdc-helpers.scss +2 -2
  10. package/core/style/_elevation.scss +5 -0
  11. package/core/tokens/_token-utils.scss +2 -2
  12. package/core/tokens/m2/mat/_app.scss +1 -2
  13. package/core/tokens/m2/mat/_autocomplete.scss +2 -2
  14. package/core/tokens/m2/mat/_datepicker.scss +3 -3
  15. package/core/tokens/m2/mat/_dialog.scss +2 -2
  16. package/core/tokens/m2/mat/_fab-small.scss +3 -9
  17. package/core/tokens/m2/mat/_fab.scss +3 -9
  18. package/core/tokens/m2/mat/_filled-button.scss +3 -9
  19. package/core/tokens/m2/mat/_form-field.scss +9 -6
  20. package/core/tokens/m2/mat/_icon-button.scss +3 -9
  21. package/core/tokens/m2/mat/_outlined-button.scss +3 -9
  22. package/core/tokens/m2/mat/_paginator.scss +10 -6
  23. package/core/tokens/m2/mat/_protected-button.scss +3 -9
  24. package/core/tokens/m2/mat/_select.scss +2 -2
  25. package/core/tokens/m2/mat/_sidenav.scss +2 -2
  26. package/core/tokens/m2/mat/_text-button.scss +3 -9
  27. package/core/tokens/m2/mdc/_chip.scss +2 -14
  28. package/core/tokens/m2/mdc/_elevated-card.scss +3 -7
  29. package/core/tokens/m2/mdc/_extended-fab.scss +12 -8
  30. package/core/tokens/m2/mdc/_fab-small.scss +15 -13
  31. package/core/tokens/m2/mdc/_fab.scss +15 -13
  32. package/core/tokens/m2/mdc/_outlined-card.scss +2 -6
  33. package/core/tokens/m3/mat/_app.scss +2 -2
  34. package/core/tokens/m3/mat/_autocomplete.scss +2 -2
  35. package/core/tokens/m3/mat/_datepicker.scss +3 -3
  36. package/core/tokens/m3/mat/_select.scss +2 -2
  37. package/core/tokens/m3/mdc/_chip.scss +1 -4
  38. package/core/tokens/m3/mdc/_elevated-card.scss +9 -2
  39. package/core/tokens/m3/mdc/_extended-fab.scss +19 -2
  40. package/core/tokens/m3/mdc/_fab-small.scss +19 -2
  41. package/core/tokens/m3/mdc/_fab.scss +19 -2
  42. package/core/tokens/m3/mdc/_outlined-card.scss +9 -2
  43. package/datepicker/index.d.ts +8 -4
  44. package/esm2022/badge/badge.mjs +6 -3
  45. package/esm2022/button/button-base.mjs +3 -3
  46. package/esm2022/button/fab.mjs +9 -9
  47. package/esm2022/button/icon-button.mjs +4 -4
  48. package/esm2022/card/card.mjs +2 -2
  49. package/esm2022/checkbox/checkbox-config.mjs +1 -1
  50. package/esm2022/chips/chip-grid.mjs +2 -2
  51. package/esm2022/chips/chip-listbox.mjs +2 -2
  52. package/esm2022/chips/chip-option.mjs +3 -3
  53. package/esm2022/chips/chip-row.mjs +3 -3
  54. package/esm2022/chips/chip-set.mjs +2 -2
  55. package/esm2022/chips/chip.mjs +3 -3
  56. package/esm2022/core/ripple/ripple-renderer.mjs +21 -3
  57. package/esm2022/core/version.mjs +1 -1
  58. package/esm2022/datepicker/datepicker-base.mjs +6 -4
  59. package/esm2022/dialog/dialog-container.mjs +3 -3
  60. package/esm2022/form-field/form-field.mjs +9 -18
  61. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  62. package/fesm2022/badge.mjs +5 -2
  63. package/fesm2022/badge.mjs.map +1 -1
  64. package/fesm2022/button.mjs +14 -14
  65. package/fesm2022/button.mjs.map +1 -1
  66. package/fesm2022/card.mjs +2 -2
  67. package/fesm2022/card.mjs.map +1 -1
  68. package/fesm2022/checkbox.mjs.map +1 -1
  69. package/fesm2022/chips.mjs +12 -12
  70. package/fesm2022/chips.mjs.map +1 -1
  71. package/fesm2022/core.mjs +21 -3
  72. package/fesm2022/core.mjs.map +1 -1
  73. package/fesm2022/datepicker.mjs +5 -3
  74. package/fesm2022/datepicker.mjs.map +1 -1
  75. package/fesm2022/dialog.mjs +2 -2
  76. package/fesm2022/dialog.mjs.map +1 -1
  77. package/fesm2022/form-field.mjs +8 -17
  78. package/fesm2022/form-field.mjs.map +1 -1
  79. package/fesm2022/slide-toggle.mjs +2 -2
  80. package/fesm2022/slide-toggle.mjs.map +1 -1
  81. package/form-field/_form-field-subscript.scss +2 -2
  82. package/form-field/_mdc-text-field-structure-overrides.scss +2 -3
  83. package/form-field/index.d.ts +9 -7
  84. package/list/_list-option-trailing-avatar-compat.scss +26 -25
  85. package/package.json +2 -2
  86. package/prebuilt-themes/azure-blue.css +1 -1
  87. package/prebuilt-themes/cyan-orange.css +1 -1
  88. package/prebuilt-themes/deeppurple-amber.css +1 -1
  89. package/prebuilt-themes/indigo-pink.css +1 -1
  90. package/prebuilt-themes/magenta-violet.css +1 -1
  91. package/prebuilt-themes/pink-bluegrey.css +1 -1
  92. package/prebuilt-themes/purple-green.css +1 -1
  93. package/prebuilt-themes/rose-red.css +1 -1
  94. package/schematics/ng-add/index.js +1 -1
  95. package/schematics/ng-add/index.mjs +1 -1
  96. package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
  97. package/schematics/ng-update/index_bundled.js +31 -31
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,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.
@@ -1,11 +1,11 @@
1
1
  @use 'sass:list';
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
- @use '@material/elevation/elevation-theme' as mdc-elevation-theme;
5
4
  @use '@material/theme/custom-properties' as mdc-custom-properties;
6
5
  @use '@material/theme/theme' as mdc-theme;
7
6
  @use '@material/theme/keys' as mdc-keys;
8
7
  @use '@material/tokens/v0_161' as mdc-tokens;
8
+ @use '../style/elevation';
9
9
  @use '../style/sass-utils';
10
10
  @use '../m2/palette' as m2-palette;
11
11
  @use '../m2/theming' as m2-theming;
@@ -161,7 +161,7 @@ $_component-prefix: null;
161
161
  $elevation: map.get($tokens, $elevation-token);
162
162
  $shadow-color: map.get($tokens, $shadow-color-token);
163
163
  @return map.merge($tokens, (
164
- $elevation-token: mdc-elevation-theme.elevation-box-shadow($elevation, $shadow-color),
164
+ $elevation-token: elevation.get-box-shadow($elevation, $shadow-color),
165
165
  $shadow-color-token: null,
166
166
  ));
167
167
  }
@@ -1,4 +1,3 @@
1
- @use '@material/elevation/elevation-theme' as mdc-elevation;
2
1
  @use 'sass:map';
3
2
  @use '../../token-utils';
4
3
  @use '../../../theming/inspection';
@@ -23,7 +22,7 @@ $prefix: (mat, app);
23
22
 
24
23
  @for $zValue from 0 through 24 {
25
24
  $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
26
- $shadow: mdc-elevation.elevation-box-shadow($zValue,
25
+ $shadow: elevation.get-box-shadow($zValue,
27
26
  if($elevation-color == null, elevation.$color, $elevation-color));
28
27
  $tokens: map.set($tokens, 'elevation-shadow-level-#{$zValue}', $shadow);
29
28
  }
@@ -1,6 +1,6 @@
1
- @use '@material/elevation/elevation-theme' as mdc-elevation;
2
1
  @use '../../token-utils';
3
2
  @use '../../../theming/inspection';
3
+ @use '../../../style/elevation';
4
4
  @use '../../../style/sass-utils';
5
5
 
6
6
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -11,7 +11,7 @@ $prefix: (mat, autocomplete);
11
11
  @function get-unthemable-tokens() {
12
12
  @return (
13
13
  container-shape: 4px,
14
- container-elevation-shadow: mdc-elevation.elevation-box-shadow(8),
14
+ container-elevation-shadow: elevation.get-box-shadow(8),
15
15
  );
16
16
  }
17
17
 
@@ -1,9 +1,9 @@
1
- @use '@material/elevation/elevation-theme' as mdc-elevation;
2
1
  @use 'sass:color';
3
2
  @use 'sass:meta';
4
3
  @use 'sass:math';
5
4
  @use '../../token-utils';
6
5
  @use '../../../theming/inspection';
6
+ @use '../../../style/elevation';
7
7
  @use '../../../style/sass-utils';
8
8
 
9
9
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -34,8 +34,8 @@ $private-default-overlap-color: #a8dab5;
34
34
  @return (
35
35
  calendar-container-shape: 4px,
36
36
  calendar-container-touch-shape: 4px,
37
- calendar-container-elevation-shadow: mdc-elevation.elevation-box-shadow(4),
38
- calendar-container-touch-elevation-shadow: mdc-elevation.elevation-box-shadow(24),
37
+ calendar-container-elevation-shadow: elevation.get-box-shadow(4),
38
+ calendar-container-touch-elevation-shadow: elevation.get-box-shadow(24),
39
39
  );
40
40
  }
41
41
 
@@ -1,5 +1,5 @@
1
- @use '@material/elevation/elevation-theme' as mdc-elevation;
2
1
  @use '../../token-utils';
2
+ @use '../../../style/elevation';
3
3
  @use '../../../style/sass-utils';
4
4
 
5
5
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -9,7 +9,7 @@ $prefix: (mat, dialog);
9
9
  // but may be in a future version of the theming API.
10
10
  @function get-unthemable-tokens() {
11
11
  @return (
12
- container-elevation-shadow: mdc-elevation.elevation-box-shadow(24),
12
+ container-elevation-shadow: elevation.get-box-shadow(24),
13
13
  container-max-width: 80vw,
14
14
  container-small-max-width: 80vw,
15
15
  container-min-width: 0,
@@ -1,6 +1,4 @@
1
- @use 'sass:map';
2
1
  @use 'sass:meta';
3
- @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
2
  @use '../../token-utils';
5
3
  @use '../../../theming/theming';
6
4
  @use '../../../theming/inspection';
@@ -19,10 +17,6 @@ $prefix: (mat, fab-small);
19
17
  // Tokens that can be configured through Angular Material's color theming API.
20
18
  @function get-color-tokens($theme) {
21
19
  $is-dark: inspection.get-theme-type($theme) == dark;
22
- $ripple-opacities: if($is-dark,
23
- mdc-ripple-theme.$light-ink-opacities,
24
- mdc-ripple-theme.$dark-ink-opacities
25
- );
26
20
 
27
21
  @return (
28
22
  // Color of icons and text projected into a FAB.
@@ -38,13 +32,13 @@ $prefix: (mat, fab-small);
38
32
  ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
39
33
 
40
34
  // Opacity of the ripple when the button is hovered.
41
- hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+ hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
42
36
 
43
37
  // Opacity of the ripple when the button is focused.
44
- focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+ focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
45
39
 
46
40
  // Opacity of the ripple when the button is pressed.
47
- pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
48
42
 
49
43
  // MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
50
44
  // Background color of the container when the FAB is disabled.
@@ -1,6 +1,4 @@
1
- @use 'sass:map';
2
1
  @use 'sass:meta';
3
- @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
2
  @use '../../token-utils';
5
3
  @use '../../../theming/theming';
6
4
  @use '../../../theming/inspection';
@@ -19,10 +17,6 @@ $prefix: (mat, fab);
19
17
  // Tokens that can be configured through Angular Material's color theming API.
20
18
  @function get-color-tokens($theme) {
21
19
  $is-dark: inspection.get-theme-type($theme) == dark;
22
- $ripple-opacities: if($is-dark,
23
- mdc-ripple-theme.$light-ink-opacities,
24
- mdc-ripple-theme.$dark-ink-opacities
25
- );
26
20
 
27
21
  @return (
28
22
  // Color of icons and text projected into a FAB.
@@ -38,13 +32,13 @@ $prefix: (mat, fab);
38
32
  ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
39
33
 
40
34
  // Opacity of the ripple when the button is hovered.
41
- hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+ hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
42
36
 
43
37
  // Opacity of the ripple when the button is focused.
44
- focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+ focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
45
39
 
46
40
  // Opacity of the ripple when the button is pressed.
47
- pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
48
42
 
49
43
  // MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
50
44
  // Background color of the container when the FAB is disabled.