@angular/material 20.0.3 → 20.1.0-next.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 (120) hide show
  1. package/_index.scss +0 -1
  2. package/autocomplete/_m2-autocomplete.scss +1 -14
  3. package/badge/_badge-theme.scss +2 -2
  4. package/badge/_m2-badge.scss +13 -34
  5. package/bottom-sheet/_m2-bottom-sheet.scss +2 -15
  6. package/button/_button-theme.scss +2 -2
  7. package/button/_fab-theme.scss +2 -2
  8. package/button/_icon-button-theme.scss +2 -2
  9. package/button/_m2-button.scss +59 -108
  10. package/button/_m2-fab.scss +28 -60
  11. package/button/_m2-icon-button.scss +12 -26
  12. package/button-toggle/_button-toggle-theme.scss +2 -1
  13. package/button-toggle/_m2-button-toggle.scss +24 -49
  14. package/card/_m2-card.scss +9 -18
  15. package/checkbox/_checkbox-theme.scss +4 -3
  16. package/checkbox/_m2-checkbox.scss +31 -59
  17. package/chips/_chips-theme.scss +7 -4
  18. package/chips/_m2-chip.scss +19 -27
  19. package/chips/index.d.ts +56 -4
  20. package/chips/testing/index.d.ts +23 -2
  21. package/core/_m2-app.scss +6 -19
  22. package/core/m2/_theming.scss +55 -9
  23. package/core/option/_m2-optgroup.scss +1 -14
  24. package/core/option/_m2-option.scss +8 -16
  25. package/core/option/_option-theme.scss +3 -3
  26. package/core/ripple/_m2-ripple.scss +0 -13
  27. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -20
  28. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +3 -3
  29. package/core/style/_private.scss +6 -9
  30. package/core/style/_sass-utils.scss +0 -29
  31. package/core/tokens/_m2-utils.scss +20 -42
  32. package/core/tokens/_m3-system.scss +9 -11
  33. package/{date-range-input-harness.d-CaEyN8dT.d.ts → date-range-input-harness.d-CJ4r85Uf.d.ts} +7 -4
  34. package/datepicker/_datepicker-theme.scss +10 -6
  35. package/datepicker/_m2-datepicker.scss +32 -41
  36. package/datepicker/index.d.ts +1 -1
  37. package/datepicker/testing/index.d.ts +3 -3
  38. package/dialog/_m2-dialog.scss +3 -24
  39. package/divider/_m2-divider.scss +1 -14
  40. package/expansion/_m2-expansion.scss +15 -25
  41. package/fesm2022/chips/testing.mjs +26 -1
  42. package/fesm2022/chips/testing.mjs.map +1 -1
  43. package/fesm2022/chips.mjs +131 -13
  44. package/fesm2022/chips.mjs.map +1 -1
  45. package/fesm2022/core.mjs +1 -1
  46. package/fesm2022/core.mjs.map +1 -1
  47. package/fesm2022/{date-range-input-harness-Bp1T4oUe.mjs → date-range-input-harness-DEyfkeOs.mjs} +32 -4
  48. package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -0
  49. package/fesm2022/datepicker/testing.mjs +3 -3
  50. package/fesm2022/datepicker.mjs.map +1 -1
  51. package/fesm2022/form-field/testing/control.mjs +26 -1
  52. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  53. package/fesm2022/form-field/testing.mjs +4 -4
  54. package/fesm2022/input/testing.mjs +7 -4
  55. package/fesm2022/input/testing.mjs.map +1 -1
  56. package/fesm2022/{input-harness-oQzj5EsQ.mjs → input-harness-C5Msdc4-.mjs} +6 -3
  57. package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -0
  58. package/fesm2022/menu.mjs +11 -2
  59. package/fesm2022/menu.mjs.map +1 -1
  60. package/fesm2022/paginator/testing.mjs +2 -3
  61. package/fesm2022/paginator/testing.mjs.map +1 -1
  62. package/fesm2022/select/testing.mjs +8 -5
  63. package/fesm2022/select/testing.mjs.map +1 -1
  64. package/fesm2022/slider.mjs +2 -2
  65. package/fesm2022/slider.mjs.map +1 -1
  66. package/fesm2022/stepper.mjs +2 -2
  67. package/fesm2022/stepper.mjs.map +1 -1
  68. package/form-field/_form-field-theme.scss +2 -2
  69. package/form-field/_m2-form-field.scss +58 -92
  70. package/form-field/testing/control/index.d.ts +8 -5
  71. package/form-field/testing/index.d.ts +5 -5
  72. package/form-field-control-harness.d-BLvFBy6v.d.ts +18 -0
  73. package/grid-list/_m2-grid-list.scss +0 -13
  74. package/icon/_m2-icon.scss +0 -13
  75. package/input/testing/index.d.ts +5 -4
  76. package/{input-harness.d-8fkAAbu2.d.ts → input-harness.d-DVI6ttzl.d.ts} +4 -4
  77. package/list/_list-theme.scss +10 -5
  78. package/list/_m2-list.scss +17 -31
  79. package/menu/_m2-menu.scss +4 -18
  80. package/menu/index.d.ts +2 -0
  81. package/package.json +6 -6
  82. package/paginator/_m2-paginator.scss +6 -18
  83. package/paginator/testing/index.d.ts +2 -3
  84. package/prebuilt-themes/azure-blue.css +1 -1
  85. package/prebuilt-themes/cyan-orange.css +1 -1
  86. package/prebuilt-themes/deeppurple-amber.css +1 -1
  87. package/prebuilt-themes/indigo-pink.css +1 -1
  88. package/prebuilt-themes/magenta-violet.css +1 -1
  89. package/prebuilt-themes/pink-bluegrey.css +1 -1
  90. package/prebuilt-themes/purple-green.css +1 -1
  91. package/prebuilt-themes/rose-red.css +1 -1
  92. package/progress-bar/_m2-progress-bar.scss +11 -20
  93. package/progress-bar/_progress-bar-theme.scss +2 -2
  94. package/progress-spinner/_m2-progress-spinner.scss +7 -15
  95. package/progress-spinner/_progress-spinner-theme.scss +2 -2
  96. package/radio/_m2-radio.scss +21 -32
  97. package/radio/_m3-radio.scss +1 -1
  98. package/radio/_radio-theme.scss +6 -3
  99. package/schematics/ng-add/index.js +2 -2
  100. package/select/_m2-select.scss +12 -35
  101. package/select/testing/index.d.ts +5 -6
  102. package/sidenav/_m2-sidenav.scss +10 -20
  103. package/slide-toggle/_m2-slide-toggle.scss +13 -20
  104. package/slide-toggle/_slide-toggle-theme.scss +3 -2
  105. package/slider/_m2-slider.scss +5 -18
  106. package/snack-bar/_m2-snack-bar.scss +6 -22
  107. package/sort/_m2-sort.scss +1 -34
  108. package/stepper/_m2-stepper.scss +23 -34
  109. package/stepper/_m3-stepper.scss +2 -2
  110. package/stepper/_stepper-theme.scss +2 -2
  111. package/table/_m2-table.scss +4 -17
  112. package/tabs/_m2-tabs.scss +16 -27
  113. package/tabs/_tabs-theme.scss +4 -4
  114. package/timepicker/_m2-timepicker.scss +1 -14
  115. package/toolbar/_m2-toolbar.scss +2 -15
  116. package/tooltip/_m2-tooltip.scss +4 -14
  117. package/tree/_m2-tree.scss +2 -17
  118. package/core/tokens/_m2-tokens.scss +0 -131
  119. package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +0 -1
  120. package/fesm2022/input-harness-oQzj5EsQ.mjs.map +0 -1
package/core/_m2-app.scss CHANGED
@@ -1,8 +1,6 @@
1
1
  @use 'sass:map';
2
- @use './tokens/m2-utils';
3
- @use './theming/inspection';
4
- @use './style/sass-utils';
5
2
  @use './style/elevation';
3
+ @use '../core/tokens/m2-utils';
6
4
 
7
5
  // Tokens that can't be configured through Angular Material's current theming API,
8
6
  // but may be in a future version of the theming API.
@@ -12,15 +10,15 @@
12
10
 
13
11
  // Tokens that can be configured through Angular Material's color theming API.
14
12
  @function get-color-tokens($theme) {
13
+ $system: m2-utils.get-system($theme);
14
+
15
15
  $tokens: (
16
- app-background-color: inspection.get-theme-color($theme, background, background),
17
- app-text-color: inspection.get-theme-color($theme, foreground, text),
16
+ app-background-color: map.get($system, background),
17
+ app-text-color: map.get($system, on-surface),
18
18
  );
19
19
 
20
20
  @for $zValue from 0 through 24 {
21
- $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
22
- $shadow: elevation.get-box-shadow($zValue,
23
- if($elevation-color == null, elevation.$color, $elevation-color));
21
+ $shadow: elevation.get-box-shadow($zValue, map.get($system, shadow));
24
22
  $tokens: map.set($tokens, 'app-elevation-shadow-level-#{$zValue}', $shadow);
25
23
  }
26
24
 
@@ -36,14 +34,3 @@
36
34
  @function get-density-tokens($theme) {
37
35
  @return ();
38
36
  }
39
-
40
- // Combines the tokens generated by the above functions into a single map with placeholder values.
41
- // This is used to create token slots.
42
- @function get-token-slots() {
43
- @return sass-utils.deep-merge-all(
44
- get-unthemable-tokens(),
45
- get-color-tokens(m2-utils.$placeholder-color-config),
46
- get-typography-tokens(m2-utils.$placeholder-typography-config),
47
- get-density-tokens(m2-utils.$placeholder-density-config)
48
- );
49
- }
@@ -85,14 +85,16 @@
85
85
  // might be inferred as numbers by Sass. Casting them to string fixes the map lookup.
86
86
  $color: if(map.has-key($palette, $hue), map.get($palette, $hue), map.get($palette, $hue + ''));
87
87
 
88
- @if (meta.type-of($color) != color) {
89
- // If the $color resolved to something different from a color (e.g. a CSS variable),
90
- // we can't apply the opacity anyway so we return the value as is, otherwise Sass can
91
- // throw an error or output something invalid.
88
+ @if ($opacity == null) {
92
89
  @return $color;
93
90
  }
94
91
 
95
- @return rgba($color, if($opacity == null, color.opacity($color), $opacity));
92
+ @if (meta.type-of($color) != color) {
93
+ $opacity: ($opacity * 100) + '%';
94
+ @return #{color-mix(in srgb, #{$color} #{$opacity}, transparent)};
95
+ }
96
+
97
+ @return rgba($color, $opacity);
96
98
  }
97
99
 
98
100
  // Validates the specified theme by ensuring that the optional color config defines
@@ -114,26 +116,70 @@
114
116
  // Creates a light-themed color configuration from the specified
115
117
  // primary, accent and warn palettes.
116
118
  @function _mat-create-light-color-config($primary, $accent, $warn: null) {
119
+ $warn: if($warn != null, $warn, define-palette(palette.$red-palette));
117
120
  @return (
118
121
  primary: $primary,
119
122
  accent: $accent,
120
- warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
123
+ warn: $warn,
121
124
  is-dark: false,
122
125
  foreground: palette.$light-theme-foreground-palette,
123
- background: palette.$light-theme-background-palette
126
+ background: palette.$light-theme-background-palette,
127
+ system: (
128
+ surface: white,
129
+ surface-variant: #f6f6f6,
130
+ on-surface: rgba(black, 0.87),
131
+ on-surface-variant: rgba(black, 0.54),
132
+ background: map.get(palette.$grey-palette, 50),
133
+ inverse-surface: map.get(palette.$grey-palette, 800),
134
+ inverse-on-surface: white,
135
+ outline: rgba(black, 0.12),
136
+ outline-variant: rgba(black, 0.38),
137
+ hover-state-layer-opacity: 0.04,
138
+ focus-state-layer-opacity: 0.12,
139
+ pressed-state-layer-opacity: 0.12,
140
+ shadow: black,
141
+ primary: map.get($primary, default),
142
+ on-primary: map.get($primary, default-contrast),
143
+ secondary: map.get($accent, default),
144
+ on-secondary: map.get($accent, default-contrast),
145
+ error: map.get($warn, default),
146
+ on-error: map.get($warn, default-contrast),
147
+ ),
124
148
  );
125
149
  }
126
150
 
127
151
  // Creates a dark-themed color configuration from the specified
128
152
  // primary, accent and warn palettes.
129
153
  @function _mat-create-dark-color-config($primary, $accent, $warn: null) {
154
+ $warn: if($warn != null, $warn, define-palette(palette.$red-palette));
130
155
  @return (
131
156
  primary: $primary,
132
157
  accent: $accent,
133
- warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
158
+ warn: $warn,
134
159
  is-dark: true,
135
160
  foreground: palette.$dark-theme-foreground-palette,
136
- background: palette.$dark-theme-background-palette
161
+ background: palette.$dark-theme-background-palette,
162
+ system: (
163
+ surface: map.get(palette.$grey-palette, 800),
164
+ surface-variant: #4a4a4a,
165
+ on-surface: white,
166
+ on-surface-variant: rgba(white, 0.7),
167
+ background: #303030,
168
+ inverse-surface: white,
169
+ inverse-on-surface: rgba(black, 0.87),
170
+ outline: rgba(white, 0.12),
171
+ outline-variant: rgba(white, 0.38),
172
+ hover-state-layer-opacity: 0.04,
173
+ focus-state-layer-opacity: 0.12,
174
+ pressed-state-layer-opacity: 0.12,
175
+ shadow: black,
176
+ primary: map.get($primary, default),
177
+ on-primary: map.get($primary, default-contrast),
178
+ secondary: map.get($accent, default),
179
+ on-secondary: map.get($accent, default-contrast),
180
+ error: map.get($warn, default),
181
+ on-error: map.get($warn, default-contrast),
182
+ ),
137
183
  );
138
184
  }
139
185
 
@@ -1,6 +1,4 @@
1
- @use '../style/sass-utils';
2
1
  @use '../theming/inspection';
3
- @use '../tokens/m2-utils';
4
2
 
5
3
  // Tokens that can't be configured through Angular Material's current theming API,
6
4
  // but may be in a future version of the theming API.
@@ -11,7 +9,7 @@
11
9
  // Tokens that can be configured through Angular Material's color theming API.
12
10
  @function get-color-tokens($theme) {
13
11
  @return (
14
- optgroup-label-text-color: inspection.get-theme-color($theme, foreground, text),
12
+ optgroup-label-text-color: inspection.get-theme-color($theme, system, on-surface),
15
13
  );
16
14
  }
17
15
 
@@ -30,14 +28,3 @@
30
28
  @function get-density-tokens($theme) {
31
29
  @return ();
32
30
  }
33
-
34
- // Combines the tokens generated by the above functions into a single map with placeholder values.
35
- // This is used to create token slots.
36
- @function get-token-slots() {
37
- @return sass-utils.deep-merge-all(
38
- get-unthemable-tokens(),
39
- get-color-tokens(m2-utils.$placeholder-color-config),
40
- get-typography-tokens(m2-utils.$placeholder-typography-config),
41
- get-density-tokens(m2-utils.$placeholder-density-config)
42
- );
43
- }
@@ -1,6 +1,7 @@
1
- @use '../tokens/m2-utils';
2
1
  @use '../theming/inspection';
3
- @use '../style/sass-utils';
2
+ @use 'sass:map';
3
+ @use '../tokens/m2-utils';
4
+ @use '../tokens/m3-utils';
4
5
 
5
6
  // Tokens that can't be configured through Angular Material's current theming API,
6
7
  // but may be in a future version of the theming API.
@@ -9,14 +10,16 @@
9
10
  }
10
11
 
11
12
  // Tokens that can be configured through Angular Material's color theming API.
12
- @function get-color-tokens($theme, $palette-name: primary) {
13
+ @function get-color-tokens($theme, $color-variant) {
13
14
  $is-dark: inspection.get-theme-type($theme) == dark;
14
15
  $active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
15
16
  if($is-dark, 0.08, 0.04));
17
+ $system: m2-utils.get-system($theme);
18
+ $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
16
19
 
17
20
  @return (
18
- option-selected-state-label-text-color: inspection.get-theme-color($theme, $palette-name),
19
- option-label-text-color: inspection.get-theme-color($theme, foreground, text),
21
+ option-selected-state-label-text-color: map.get($system, primary),
22
+ option-label-text-color: inspection.get-theme-color($theme, system, on-surface),
20
23
  option-hover-state-layer-color: $active-state-layer-color,
21
24
  option-focus-state-layer-color: $active-state-layer-color,
22
25
  option-selected-state-layer-color: $active-state-layer-color,
@@ -38,14 +41,3 @@
38
41
  @function get-density-tokens($theme) {
39
42
  @return ();
40
43
  }
41
-
42
- // Combines the tokens generated by the above functions into a single map with placeholder values.
43
- // This is used to create token slots.
44
- @function get-token-slots() {
45
- @return sass-utils.deep-merge-all(
46
- get-unthemable-tokens(),
47
- get-color-tokens(m2-utils.$placeholder-color-config),
48
- get-typography-tokens(m2-utils.$placeholder-typography-config),
49
- get-density-tokens(m2-utils.$placeholder-density-config)
50
- );
51
- }
@@ -26,15 +26,15 @@
26
26
  map.get(m3-option.get-tokens($theme, $color-variant), color));
27
27
  } @else {
28
28
  @include sass-utils.current-selector-or-root() {
29
- @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme));
29
+ @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, primary));
30
30
  }
31
31
 
32
32
  .mat-accent {
33
- @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, accent));
33
+ @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, secondary));
34
34
  }
35
35
 
36
36
  .mat-warn {
37
- @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, warn));
37
+ @include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, error));
38
38
  }
39
39
  }
40
40
  }
@@ -1,7 +1,5 @@
1
1
  @use 'sass:meta';
2
- @use '../tokens/m2-utils';
3
2
  @use '../theming/inspection';
4
- @use '../style/sass-utils';
5
3
 
6
4
  // Tokens that can't be configured through Angular Material's current theming API,
7
5
  // but may be in a future version of the theming API.
@@ -33,14 +31,3 @@
33
31
  @function get-density-tokens($theme) {
34
32
  @return ();
35
33
  }
36
-
37
- // Combines the tokens generated by the above functions into a single map with placeholder values.
38
- // This is used to create token slots.
39
- @function get-token-slots() {
40
- @return sass-utils.deep-merge-all(
41
- get-unthemable-tokens(),
42
- get-color-tokens(m2-utils.$placeholder-color-config),
43
- get-typography-tokens(m2-utils.$placeholder-typography-config),
44
- get-density-tokens(m2-utils.$placeholder-density-config)
45
- );
46
- }
@@ -1,6 +1,7 @@
1
- @use '../../tokens/m2-utils';
2
1
  @use '../../theming/inspection';
3
- @use '../../style/sass-utils';
2
+ @use 'sass:map';
3
+ @use '../../tokens/m2-utils';
4
+ @use '../../tokens/m3-utils';
4
5
 
5
6
  // Tokens that can't be configured through Angular Material's current theming API,
6
7
  // but may be in a future version of the theming API.
@@ -9,21 +10,21 @@
9
10
  }
10
11
 
11
12
  // Tokens that can be configured through Angular Material's color theming API.
12
- @function get-color-tokens($theme, $palette-name: accent) {
13
+ @function get-color-tokens($theme, $color-variant) {
13
14
  $is-dark: inspection.get-theme-type($theme) == dark;
14
15
  $disabled-color: if($is-dark, #686868, #b0b0b0);
15
- $checkmark-color: inspection.get-theme-color($theme, background, background);
16
+ $checkmark-color: inspection.get-theme-color($theme, system, background);
17
+ $system: m2-utils.get-system($theme);
18
+ $system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
16
19
 
17
20
  @return (
18
- pseudo-checkbox-full-selected-icon-color: inspection.get-theme-color($theme, $palette-name),
21
+ pseudo-checkbox-full-selected-icon-color: map.get($system, secondary),
19
22
  pseudo-checkbox-full-selected-checkmark-color: $checkmark-color,
20
- pseudo-checkbox-full-unselected-icon-color:
21
- inspection.get-theme-color($theme, foreground, secondary-text),
23
+ pseudo-checkbox-full-unselected-icon-color: map.get($system, on-surface-variant),
22
24
  pseudo-checkbox-full-disabled-selected-checkmark-color: $checkmark-color,
23
25
  pseudo-checkbox-full-disabled-unselected-icon-color: $disabled-color,
24
26
  pseudo-checkbox-full-disabled-selected-icon-color: $disabled-color,
25
- pseudo-checkbox-minimal-selected-checkmark-color:
26
- inspection.get-theme-color($theme, $palette-name),
27
+ pseudo-checkbox-minimal-selected-checkmark-color: map.get($system, secondary),
27
28
  pseudo-checkbox-minimal-disabled-selected-checkmark-color: if($is-dark, #686868, #b0b0b0),
28
29
  );
29
30
  }
@@ -37,14 +38,3 @@
37
38
  @function get-density-tokens($theme) {
38
39
  @return ();
39
40
  }
40
-
41
- // Combines the tokens generated by the above functions into a single map with placeholder values.
42
- // This is used to create token slots.
43
- @function get-token-slots() {
44
- @return sass-utils.deep-merge-all(
45
- get-unthemable-tokens(),
46
- get-color-tokens(m2-utils.$placeholder-color-config),
47
- get-typography-tokens(m2-utils.$placeholder-typography-config),
48
- get-density-tokens(m2-utils.$placeholder-density-config)
49
- );
50
- }
@@ -48,18 +48,18 @@
48
48
  // don't attach to the `mat-*` classes. Also note that this needs to be below `.mat-primary`
49
49
  // in order to allow for the color to be overwritten if the checkbox is inside a parent that
50
50
  // has `mat-accent` and is placed inside another parent that has `mat-primary`.
51
- @include _palette-styles($theme, accent);
51
+ @include _palette-styles($theme, secondary);
52
52
 
53
53
  .mat-primary {
54
54
  @include _palette-styles($theme, primary);
55
55
  }
56
56
 
57
57
  .mat-accent {
58
- @include _palette-styles($theme, accent);
58
+ @include _palette-styles($theme, secondary);
59
59
  }
60
60
 
61
61
  .mat-warn {
62
- @include _palette-styles($theme, warn);
62
+ @include _palette-styles($theme, error);
63
63
  }
64
64
  }
65
65
  }
@@ -1,18 +1,15 @@
1
1
  @use './elevation';
2
- @use '../theming/inspection';
2
+ @use '../tokens/m2-utils';
3
+ @use 'sass:map';
3
4
 
4
5
  @mixin private-theme-elevation($zValue, $theme) {
5
- $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
6
- $elevation-color-or-default: if($elevation-color == null, elevation.$color, $elevation-color);
7
-
8
- @include elevation.elevation($zValue, $elevation-color-or-default);
6
+ $system: m2-utils.get-system($theme);
7
+ @include elevation.elevation($zValue, map.get($system, shadow));
9
8
  }
10
9
 
11
10
  @mixin private-theme-overridable-elevation($zValue, $theme) {
12
- $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
13
- $elevation-color-or-default: if($elevation-color == null, elevation.$color, $elevation-color);
14
-
15
- @include elevation.overridable-elevation($zValue, $elevation-color-or-default);
11
+ $system: m2-utils.get-system($theme);
12
+ @include elevation.overridable-elevation($zValue, map.get($system, shadow));
16
13
  }
17
14
 
18
15
  // If the mat-animation-noop class is present on the components root element,
@@ -1,4 +1,3 @@
1
- @use 'sass:color';
2
1
  @use 'sass:string';
3
2
  @use 'sass:map';
4
3
  @use 'sass:meta';
@@ -51,34 +50,6 @@ $use-system-typography-variables: false;
51
50
  @return $result;
52
51
  }
53
52
 
54
- /// A version of the Sass `color.change` function that is safe ot use with CSS variables.
55
- @function safe-color-change($color, $args...) {
56
- $args: meta.keywords($args);
57
- $use-color-mix: $use-system-color-variables or
58
- (is-css-var-name($color) and string.index($color, '--mat') == 1);
59
- @if (meta.type-of($color) == 'color') {
60
- @return color.change($color, $args...);
61
- }
62
- @else if ($color != null and
63
- map.get($args, alpha) != null and $use-color-mix) {
64
- $opacity: map.get($args, alpha);
65
- @if meta.type-of($opacity) == number {
66
- $opacity: ($opacity * 100) + '%';
67
- }
68
-
69
- @if (is-css-var-name($opacity)) {
70
- $opacity: calc(var($opacity) * 100%);
71
- }
72
-
73
- @if (is-css-var-name($color)) {
74
- $color: var($color);
75
- }
76
-
77
- @return #{color-mix(in srgb, #{$color} #{$opacity}, transparent)};
78
- }
79
- @return $color;
80
- }
81
-
82
53
  // Returns whether the $value is a CSS variable name based on whether it's a string prefixed
83
54
  // by "--".
84
55
  @function is-css-var-name($value) {
@@ -1,52 +1,30 @@
1
- @use '../m2/palette';
2
- @use '../m2/theming';
3
- @use '../m2/typography';
4
1
  @use 'sass:color';
5
2
  @use 'sass:math';
6
3
  @use 'sass:meta';
7
-
8
- $_placeholder-color-palette: theming.define-palette(palette.$red-palette);
4
+ @use 'sass:map';
9
5
 
10
6
  // Indicates whether we're building internally. Used for backwards compatibility.
11
7
  $private-is-internal-build: false;
12
8
 
13
- // Placeholder color config that can be passed to token getter functions when generating token
14
- // slots.
15
- $placeholder-color-config: (
16
- primary: $_placeholder-color-palette,
17
- accent: $_placeholder-color-palette,
18
- warn: $_placeholder-color-palette,
19
- is-dark: false,
20
- foreground: palette.$light-theme-foreground-palette,
21
- background: palette.$light-theme-background-palette,
22
- );
23
-
24
- $_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);
25
-
26
- // Placeholder typography config that can be passed to token getter functions when generating token
27
- // slots.
28
- $placeholder-typography-config: (
29
- font-family: 'Roboto, sans-serif',
30
- headline-1: $_placeholder-typography-level-config,
31
- headline-2: $_placeholder-typography-level-config,
32
- headline-3: $_placeholder-typography-level-config,
33
- headline-4: $_placeholder-typography-level-config,
34
- headline-5: $_placeholder-typography-level-config,
35
- headline-6: $_placeholder-typography-level-config,
36
- subtitle-1: $_placeholder-typography-level-config,
37
- subtitle-2: $_placeholder-typography-level-config,
38
- body-1: $_placeholder-typography-level-config,
39
- body-2: $_placeholder-typography-level-config,
40
- caption: $_placeholder-typography-level-config,
41
- button: $_placeholder-typography-level-config,
42
- overline: $_placeholder-typography-level-config,
43
- subheading-1: $_placeholder-typography-level-config,
44
- title: $_placeholder-typography-level-config,
45
- );
46
-
47
- // Placeholder density config that can be passed to token getter functions when generating token
48
- // slots.
49
- $placeholder-density-config: 0;
9
+ // Gets the theme's system values as a flat map.
10
+ @function get-system($theme) {
11
+ $system: map.get($theme, _mat-theming-internals-do-not-access, m2-config, color, system);
12
+ @if $system {
13
+ @return $system;
14
+ }
15
+
16
+ $system: map.get($theme, system);
17
+ @if $system {
18
+ @return $system;
19
+ }
20
+
21
+ $system: map.get($theme, color, system);
22
+ @if $system {
23
+ @return $system;
24
+ }
25
+
26
+ @return ();
27
+ }
50
28
 
51
29
  /// Inherited function from MDC that computes which contrast tone to use on top of a color.
52
30
  /// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
@@ -19,7 +19,6 @@
19
19
  @use '../theming/config-validation';
20
20
  @use '../theming/definition';
21
21
  @use '../theming/palettes';
22
- @use '../style/sass-utils';
23
22
  @use './m3';
24
23
  @use 'sass:map';
25
24
  @use 'sass:meta';
@@ -197,7 +196,7 @@
197
196
  m3.md-sys-shape-values(),
198
197
  m3.md-sys-state-values());
199
198
 
200
- @include sass-utils.current-selector-or-root {
199
+ & {
201
200
  @each $name, $value in $overrides {
202
201
  @if (map.has-key($sys-names, $name)) {
203
202
  --#{$prefix}-#{$name}: #{map.get($overrides, $name)};
@@ -223,7 +222,7 @@
223
222
  $sys-colors: map.set($sys-colors, neutral-variant20, map.get($palettes, neutral-variant, 20));
224
223
  $sys-colors: map.set($sys-colors, neutral10, map.get($palettes, neutral, 10));
225
224
 
226
- @include sass-utils.current-selector-or-root {
225
+ & {
227
226
  @each $name, $value in $sys-colors {
228
227
  --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
229
228
  }
@@ -262,7 +261,7 @@
262
261
  typography-system-variables-prefix) or definition.$system-level-prefix;
263
262
  }
264
263
 
265
- @include sass-utils.current-selector-or-root {
264
+ & {
266
265
  @each $name, $value in m3.md-sys-typescale-values($font-definition) {
267
266
  --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
268
267
  }
@@ -273,18 +272,17 @@
273
272
  $shadow-color: map.get(
274
273
  $theme, definition.$internals, palettes, neutral, 0);
275
274
 
276
-
277
- @include sass-utils.current-selector-or-root {
278
- @each $name, $value in m3.md-sys-elevation-values() {
279
- $level: map.get($overrides, $name) or $value;
280
- $value: elevation.get-box-shadow($level, $shadow-color);
275
+ @each $name, $value in m3.md-sys-elevation-values() {
276
+ $level: map.get($overrides, $name) or $value;
277
+ $value: elevation.get-box-shadow($level, $shadow-color);
278
+ & {
281
279
  --#{$prefix}-#{$name}: #{$value};
282
280
  }
283
281
  }
284
282
  }
285
283
 
286
284
  @mixin system-level-shape($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
287
- @include sass-utils.current-selector-or-root {
285
+ & {
288
286
  @each $name, $value in m3.md-sys-shape-values() {
289
287
  --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
290
288
  }
@@ -292,7 +290,7 @@
292
290
  }
293
291
 
294
292
  @mixin system-level-state($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
295
- @include sass-utils.current-selector-or-root {
293
+ & {
296
294
  @each $name, $value in m3.md-sys-state-values() {
297
295
  --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
298
296
  }
@@ -1,8 +1,8 @@
1
1
  import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
- import { MatFormFieldControlHarness } from './form-field/testing/control/index.js';
2
+ import { MatFormFieldControlHarnessFilters, MatFormFieldControlHarnessBase } from '@angular/material/form-field/testing/control';
3
3
 
4
4
  /** A set of criteria that can be used to filter a list of datepicker input instances. */
5
- interface DatepickerInputHarnessFilters extends BaseHarnessFilters {
5
+ interface DatepickerInputHarnessFilters extends MatFormFieldControlHarnessFilters {
6
6
  /** Filters based on the value of the input. */
7
7
  value?: string | RegExp;
8
8
  /** Filters based on the placeholder text of the input. */
@@ -34,13 +34,13 @@ interface CalendarCellHarnessFilters extends BaseHarnessFilters {
34
34
  inPreviewRange?: boolean;
35
35
  }
36
36
  /** A set of criteria that can be used to filter a list of date range input instances. */
37
- interface DateRangeInputHarnessFilters extends BaseHarnessFilters {
37
+ interface DateRangeInputHarnessFilters extends MatFormFieldControlHarnessFilters {
38
38
  /** Filters based on the value of the input. */
39
39
  value?: string | RegExp;
40
40
  }
41
41
 
42
42
  /** Base class for datepicker input harnesses. */
43
- declare abstract class MatDatepickerInputHarnessBase extends MatFormFieldControlHarness {
43
+ declare abstract class MatDatepickerInputHarnessBase extends MatFormFieldControlHarnessBase {
44
44
  /** Whether the input is disabled. */
45
45
  isDisabled(): Promise<boolean>;
46
46
  /** Whether the input is required. */
@@ -251,6 +251,7 @@ declare class MatEndDateHarness extends MatDatepickerInputHarnessBase {
251
251
  /** Harness for interacting with a standard Material date range input in tests. */
252
252
  declare class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase {
253
253
  static hostSelector: string;
254
+ private readonly _floatingLabelSelector;
254
255
  /**
255
256
  * Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness`
256
257
  * that meets certain criteria.
@@ -264,6 +265,8 @@ declare class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase {
264
265
  getStartInput(): Promise<MatStartDateHarness>;
265
266
  /** Gets the inner start date input inside the range input. */
266
267
  getEndInput(): Promise<MatEndDateHarness>;
268
+ /** Gets the floating label text for the range input, if it exists. */
269
+ getLabel(): Promise<string | null>;
267
270
  /** Gets the separator text between the values of the two inputs. */
268
271
  getSeparator(): Promise<string>;
269
272
  /** Gets whether the range input is disabled. */
@@ -8,6 +8,8 @@
8
8
  @use '../core/style/sass-utils';
9
9
  @use '../core/typography/typography';
10
10
  @use '../button/icon-button-theme';
11
+ @use '../core/tokens/m2-utils';
12
+ @use '../core/tokens/m3-utils';
11
13
 
12
14
  // TODO(crisbeto): these variables aren't used anymore and should be removed.
13
15
  $selected-today-box-shadow-width: 1px;
@@ -17,13 +19,15 @@ $today-fade-amount: 0.2;
17
19
  $calendar-body-font-size: 13px !default;
18
20
  $calendar-weekday-table-font-size: 11px !default;
19
21
 
20
- @mixin _calendar-color($theme, $palette-name) {
21
- $palette-color: inspection.get-theme-color($theme, $palette-name);
22
- $range-color: m2-datepicker.private-get-range-background-color($palette-color);
22
+ @mixin _calendar-color($theme, $color-variant) {
23
+ $system: m2-utils.get-system($theme);
24
+ $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
25
+
26
+ $range-color: m2-datepicker.private-get-range-background-color(map.get($system, primary));
23
27
  $range-tokens: m2-datepicker.get-range-color-tokens($range-color);
24
28
  $calendar-tokens: m2-datepicker.private-get-calendar-color-palette-color-tokens(
25
29
  $theme,
26
- $palette-name
30
+ $color-variant
27
31
  );
28
32
 
29
33
  @include token-utils.create-token-values-mixed(map.merge($calendar-tokens, $range-tokens));
@@ -56,11 +60,11 @@ $calendar-weekday-table-font-size: 11px !default;
56
60
 
57
61
  .mat-datepicker-content {
58
62
  &.mat-accent {
59
- @include _calendar-color($theme, accent);
63
+ @include _calendar-color($theme, secondary);
60
64
  }
61
65
 
62
66
  &.mat-warn {
63
- @include _calendar-color($theme, warn);
67
+ @include _calendar-color($theme, error);
64
68
  }
65
69
  }
66
70