@angular/material 17.3.0-next.0 → 17.3.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 (177) hide show
  1. package/autocomplete/index.d.ts +5 -0
  2. package/button-toggle/index.d.ts +18 -1
  3. package/core/index.d.ts +57 -13
  4. package/core/theming/_inspection.scss +2 -2
  5. package/core/theming/_theming.scss +4 -3
  6. package/core/tokens/_token-utils.scss +3 -0
  7. package/core/tokens/m2/mat/_datepicker.scss +1 -2
  8. package/core/tokens/m2/mat/_fab-small.scss +32 -13
  9. package/core/tokens/m2/mat/_fab.scss +32 -13
  10. package/core/tokens/m2/mat/_filled-button.scss +24 -10
  11. package/core/tokens/m2/mat/_form-field.scss +5 -5
  12. package/core/tokens/m2/mat/_icon-button.scss +8 -5
  13. package/core/tokens/m2/mat/_menu.scss +2 -2
  14. package/core/tokens/m2/mat/_option.scss +2 -2
  15. package/core/tokens/m2/mat/_outlined-button.scss +8 -5
  16. package/core/tokens/m2/mat/_protected-button.scss +24 -10
  17. package/core/tokens/m2/mat/_radio.scss +1 -3
  18. package/core/tokens/m2/mat/_select.scss +17 -7
  19. package/core/tokens/m2/mat/_switch.scss +1 -0
  20. package/core/tokens/m2/mat/_tab-header.scss +2 -2
  21. package/core/tokens/m2/mat/_text-button.scss +8 -5
  22. package/core/tokens/m2/mdc/_checkbox.scss +14 -12
  23. package/core/tokens/m2/mdc/_chip.scss +3 -9
  24. package/core/tokens/m2/mdc/_dialog.scss +9 -3
  25. package/core/tokens/m2/mdc/_filled-button.scss +19 -9
  26. package/core/tokens/m2/mdc/_filled-text-field.scss +22 -10
  27. package/core/tokens/m2/mdc/_outlined-button.scss +12 -8
  28. package/core/tokens/m2/mdc/_outlined-text-field.scss +21 -10
  29. package/core/tokens/m2/mdc/_protected-button.scss +18 -7
  30. package/core/tokens/m2/mdc/_radio.scss +4 -5
  31. package/core/tokens/m2/mdc/_text-button.scss +3 -3
  32. package/datepicker/index.d.ts +1 -0
  33. package/esm2022/autocomplete/autocomplete-trigger.mjs +34 -19
  34. package/esm2022/autocomplete/autocomplete.mjs +3 -3
  35. package/esm2022/badge/badge.mjs +1 -1
  36. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +1 -1
  37. package/esm2022/button/fab.mjs +1 -1
  38. package/esm2022/button-toggle/button-toggle-module.mjs +2 -2
  39. package/esm2022/button-toggle/button-toggle.mjs +39 -6
  40. package/esm2022/card/card.mjs +1 -1
  41. package/esm2022/checkbox/checkbox.mjs +1 -1
  42. package/esm2022/chips/chip-grid.mjs +1 -1
  43. package/esm2022/chips/chip-listbox.mjs +1 -1
  44. package/esm2022/chips/chip-option.mjs +1 -1
  45. package/esm2022/chips/chip-row.mjs +1 -1
  46. package/esm2022/chips/chip-set.mjs +1 -1
  47. package/esm2022/chips/chip.mjs +1 -1
  48. package/esm2022/core/common-behaviors/color.mjs +1 -1
  49. package/esm2022/core/common-behaviors/disable-ripple.mjs +1 -1
  50. package/esm2022/core/common-behaviors/disabled.mjs +1 -1
  51. package/esm2022/core/common-behaviors/error-state.mjs +1 -1
  52. package/esm2022/core/common-behaviors/initialized.mjs +6 -2
  53. package/esm2022/core/common-behaviors/tabindex.mjs +1 -1
  54. package/esm2022/core/internal-form-field/internal-form-field.mjs +1 -1
  55. package/esm2022/core/option/optgroup.mjs +1 -1
  56. package/esm2022/core/option/option.mjs +1 -1
  57. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +1 -1
  58. package/esm2022/core/version.mjs +1 -1
  59. package/esm2022/datepicker/calendar-body.mjs +1 -1
  60. package/esm2022/datepicker/calendar.mjs +5 -5
  61. package/esm2022/datepicker/date-range-input-parts.mjs +11 -6
  62. package/esm2022/datepicker/date-range-input.mjs +1 -1
  63. package/esm2022/datepicker/datepicker-actions.mjs +1 -1
  64. package/esm2022/datepicker/datepicker-base.mjs +1 -1
  65. package/esm2022/datepicker/datepicker-toggle.mjs +1 -1
  66. package/esm2022/dialog/dialog-container.mjs +1 -1
  67. package/esm2022/divider/divider.mjs +1 -1
  68. package/esm2022/expansion/expansion-panel-header.mjs +1 -1
  69. package/esm2022/expansion/expansion-panel.mjs +35 -25
  70. package/esm2022/form-field/form-field.mjs +3 -3
  71. package/esm2022/grid-list/grid-list.mjs +1 -1
  72. package/esm2022/grid-list/grid-tile.mjs +1 -1
  73. package/esm2022/icon/icon.mjs +1 -1
  74. package/esm2022/list/action-list.mjs +1 -1
  75. package/esm2022/list/list-option.mjs +3 -3
  76. package/esm2022/list/list.mjs +1 -1
  77. package/esm2022/list/nav-list.mjs +1 -1
  78. package/esm2022/list/selection-list.mjs +1 -1
  79. package/esm2022/menu/menu.mjs +1 -1
  80. package/esm2022/paginator/paginator.mjs +1 -1
  81. package/esm2022/progress-bar/progress-bar.mjs +1 -1
  82. package/esm2022/progress-spinner/progress-spinner.mjs +1 -1
  83. package/esm2022/radio/radio.mjs +1 -1
  84. package/esm2022/select/select.mjs +15 -8
  85. package/esm2022/sidenav/drawer.mjs +1 -1
  86. package/esm2022/sidenav/sidenav.mjs +1 -1
  87. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  88. package/esm2022/slider/slider-input.mjs +3 -1
  89. package/esm2022/slider/slider-interface.mjs +1 -1
  90. package/esm2022/slider/slider-thumb.mjs +1 -1
  91. package/esm2022/slider/slider.mjs +1 -1
  92. package/esm2022/snack-bar/simple-snack-bar.mjs +1 -1
  93. package/esm2022/snack-bar/snack-bar-container.mjs +1 -1
  94. package/esm2022/sort/sort-header.mjs +1 -1
  95. package/esm2022/stepper/step-header.mjs +1 -1
  96. package/esm2022/stepper/stepper.mjs +1 -1
  97. package/esm2022/table/cell.mjs +2 -3
  98. package/esm2022/table/row.mjs +16 -7
  99. package/esm2022/table/table.mjs +1 -1
  100. package/esm2022/table/text-column.mjs +2 -2
  101. package/esm2022/tabs/ink-bar.mjs +4 -4
  102. package/esm2022/tabs/tab-body.mjs +1 -1
  103. package/esm2022/tabs/tab-group.mjs +2 -2
  104. package/esm2022/tabs/tab-header.mjs +1 -1
  105. package/esm2022/tabs/tab-label-wrapper.mjs +2 -3
  106. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +1 -1
  107. package/esm2022/toolbar/toolbar.mjs +1 -1
  108. package/esm2022/tooltip/tooltip.mjs +3 -7
  109. package/esm2022/tree/node.mjs +2 -2
  110. package/esm2022/tree/toggle.mjs +2 -2
  111. package/esm2022/tree/tree.mjs +1 -1
  112. package/expansion/index.d.ts +5 -2
  113. package/fesm2022/autocomplete.mjs +36 -21
  114. package/fesm2022/autocomplete.mjs.map +1 -1
  115. package/fesm2022/badge.mjs.map +1 -1
  116. package/fesm2022/bottom-sheet.mjs.map +1 -1
  117. package/fesm2022/button-toggle.mjs +40 -7
  118. package/fesm2022/button-toggle.mjs.map +1 -1
  119. package/fesm2022/button.mjs.map +1 -1
  120. package/fesm2022/card.mjs.map +1 -1
  121. package/fesm2022/checkbox.mjs.map +1 -1
  122. package/fesm2022/chips.mjs.map +1 -1
  123. package/fesm2022/core.mjs +6 -2
  124. package/fesm2022/core.mjs.map +1 -1
  125. package/fesm2022/datepicker.mjs +14 -9
  126. package/fesm2022/datepicker.mjs.map +1 -1
  127. package/fesm2022/dialog.mjs.map +1 -1
  128. package/fesm2022/divider.mjs.map +1 -1
  129. package/fesm2022/expansion.mjs +34 -24
  130. package/fesm2022/expansion.mjs.map +1 -1
  131. package/fesm2022/form-field.mjs +2 -2
  132. package/fesm2022/form-field.mjs.map +1 -1
  133. package/fesm2022/grid-list.mjs.map +1 -1
  134. package/fesm2022/icon.mjs.map +1 -1
  135. package/fesm2022/list.mjs +2 -2
  136. package/fesm2022/list.mjs.map +1 -1
  137. package/fesm2022/menu.mjs.map +1 -1
  138. package/fesm2022/paginator.mjs.map +1 -1
  139. package/fesm2022/progress-bar.mjs.map +1 -1
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio.mjs.map +1 -1
  142. package/fesm2022/select.mjs +11 -4
  143. package/fesm2022/select.mjs.map +1 -1
  144. package/fesm2022/sidenav.mjs.map +1 -1
  145. package/fesm2022/slide-toggle.mjs +2 -2
  146. package/fesm2022/slide-toggle.mjs.map +1 -1
  147. package/fesm2022/slider.mjs +2 -0
  148. package/fesm2022/slider.mjs.map +1 -1
  149. package/fesm2022/snack-bar.mjs.map +1 -1
  150. package/fesm2022/sort.mjs.map +1 -1
  151. package/fesm2022/stepper.mjs.map +1 -1
  152. package/fesm2022/table.mjs +17 -9
  153. package/fesm2022/table.mjs.map +1 -1
  154. package/fesm2022/tabs.mjs +5 -6
  155. package/fesm2022/tabs.mjs.map +1 -1
  156. package/fesm2022/toolbar.mjs.map +1 -1
  157. package/fesm2022/tooltip.mjs +2 -6
  158. package/fesm2022/tooltip.mjs.map +1 -1
  159. package/fesm2022/tree.mjs +2 -2
  160. package/fesm2022/tree.mjs.map +1 -1
  161. package/form-field/_mdc-text-field-structure-overrides.scss +16 -0
  162. package/package.json +7 -7
  163. package/prebuilt-themes/deeppurple-amber.css +1 -1
  164. package/prebuilt-themes/indigo-pink.css +1 -1
  165. package/prebuilt-themes/pink-bluegrey.css +1 -1
  166. package/prebuilt-themes/purple-green.css +1 -1
  167. package/schematics/ng-add/index.js +2 -2
  168. package/schematics/ng-add/index.mjs +2 -2
  169. package/schematics/ng-add/setup-project.js +21 -6
  170. package/schematics/ng-add/setup-project.mjs +21 -6
  171. package/schematics/ng-add/theming/create-custom-theme.js +4 -2
  172. package/schematics/ng-add/theming/create-custom-theme.mjs +4 -2
  173. package/select/index.d.ts +7 -2
  174. package/slider/index.d.ts +2 -0
  175. package/table/index.d.ts +3 -1
  176. package/tabs/index.d.ts +1 -1
  177. package/tooltip/index.d.ts +2 -0
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:meta';
2
3
  @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
4
  @use '../../token-utils';
4
5
  @use '../../../theming/theming';
@@ -28,7 +29,6 @@ $prefix: (mat, protected-button);
28
29
  // Tokens that can be configured through Angular Material's color theming API.
29
30
  @function get-color-tokens($theme) {
30
31
  $is-dark: inspection.get-theme-type($theme) == dark;
31
- $on-surface: if($is-dark, #fff, #000);
32
32
  $ripple-opacities: if($is-dark,
33
33
  mdc-ripple-theme.$light-ink-opacities,
34
34
  mdc-ripple-theme.$dark-ink-opacities
@@ -36,13 +36,13 @@ $prefix: (mat, protected-button);
36
36
 
37
37
  @return (
38
38
  // Color of the element that shows the hover, focus and pressed states.
39
- state-layer-color: $on-surface,
39
+ state-layer-color: inspection.get-theme-color($theme, foreground, base),
40
40
 
41
41
  // Color of the element that shows the hover, focus and pressed states while disabled.
42
- disabled-state-layer-color: $on-surface,
42
+ disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
43
43
 
44
44
  // Color of the ripple element.
45
- ripple-color: rgba($on-surface, 0.1),
45
+ ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
46
46
 
47
47
  // Opacity of the ripple when the button is hovered.
48
48
  hover-state-layer-opacity: map.get($ripple-opacities, hover),
@@ -57,14 +57,28 @@ $prefix: (mat, protected-button);
57
57
 
58
58
  // Generates the mapping for the properties that change based on the button palette color.
59
59
  @function private-get-color-palette-color-tokens($theme, $palette-name) {
60
- $is-dark: inspection.get-theme-type($theme) == dark;
61
- $container-color: inspection.get-theme-color($theme, $palette-name);
62
- $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
63
- $color: if($contrast-tone == 'dark', #000, #fff);
60
+ $state-layer-color: null;
61
+ $ripple-color: null;
62
+ $contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
63
+
64
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
65
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
66
+ @if (token-utils.$private-is-internal-build or meta.type-of($contrast-color) != 'color') {
67
+ $is-dark: inspection.get-theme-type($theme) == dark;
68
+ $container-color: inspection.get-theme-color($theme, $palette-name);
69
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
70
+ $color: if($contrast-tone == 'dark', #000, #fff);
71
+ $state-layer-color: $color;
72
+ $ripple-color: rgba($color, 0.1);
73
+ }
74
+ @else {
75
+ $state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
76
+ $ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
77
+ }
64
78
 
65
79
  @return (
66
- state-layer-color: $color,
67
- ripple-color: rgba($color, 0.1),
80
+ state-layer-color: $state-layer-color,
81
+ ripple-color: $ripple-color,
68
82
  );
69
83
  }
70
84
 
@@ -14,10 +14,8 @@ $prefix: (mat, radio);
14
14
 
15
15
  // Tokens that can be configured through Angular Material's color theming API.
16
16
  @function get-color-tokens($theme, $palette-name: accent) {
17
- $is-dark: inspection.get-theme-type($theme) == dark;
18
-
19
17
  @return (
20
- ripple-color: if($is-dark, #fff, #000),
18
+ ripple-color: inspection.get-theme-color($theme, foreground, base),
21
19
  checked-ripple-color: inspection.get-theme-color($theme, $palette-name, default),
22
20
  disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
23
21
  );
@@ -19,19 +19,29 @@ $prefix: (mat, select);
19
19
  // Tokens that can be configured through Angular Material's color theming API.
20
20
  @function get-color-tokens($theme, $palette-name: primary) {
21
21
  $is-dark: inspection.get-theme-type($theme) == dark;
22
+
23
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
24
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
22
25
  $on-surface: if($is-dark, #fff, #000);
26
+ $text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
27
+ inspection.get-theme-color($theme, foreground, text, 1));
28
+ $disabled-text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
29
+ inspection.get-theme-color($theme, foreground, disabled-text, 1));
30
+ $icon-color-base: if(token-utils.$private-is-internal-build, $on-surface,
31
+ inspection.get-theme-color($theme, foreground, divider, 1));
23
32
 
24
33
  @return (
25
34
  panel-background-color: inspection.get-theme-color($theme, background, card),
26
- enabled-trigger-text-color: rgba($on-surface, 0.87),
27
- disabled-trigger-text-color: rgba($on-surface, 0.38),
28
- placeholder-text-color: rgba($on-surface, 0.6),
29
- enabled-arrow-color: rgba($on-surface, 0.54),
30
- disabled-arrow-color: rgba($on-surface, 0.38),
35
+ enabled-trigger-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.87),
36
+ disabled-trigger-text-color:
37
+ sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),
38
+ placeholder-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
39
+ enabled-arrow-color: sass-utils.safe-color-change($icon-color-base, $alpha: 0.54),
40
+ disabled-arrow-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.38),
31
41
  focused-arrow-color: sass-utils.safe-color-change(
32
- inspection.get-theme-color($theme, $palette-name, default), $alpha: 0.87),
42
+ inspection.get-theme-color($theme, $palette-name, default), $alpha: 0.87),
33
43
  invalid-arrow-color: sass-utils.safe-color-change(
34
- inspection.get-theme-color($theme, warn, default), $alpha: 0.87),
44
+ inspection.get-theme-color($theme, warn, default), $alpha: 0.87),
35
45
  );
36
46
  }
37
47
 
@@ -37,6 +37,7 @@ $prefix: (mat, switch);
37
37
 
38
38
  track-outline-width: 1px,
39
39
  track-outline-color: transparent,
40
+ selected-track-outline-width: 1px,
40
41
  disabled-unselected-track-outline-width: 1px,
41
42
  disabled-unselected-track-outline-color: transparent,
42
43
  );
@@ -19,13 +19,13 @@ $prefix: (mat, tab-header);
19
19
  // Tokens that can be configured through Angular Material's color theming API.
20
20
  @function get-color-tokens($theme, $palette-name: primary) {
21
21
  $is-dark: inspection.get-theme-type($theme) == dark;
22
- $inactive-label-text-color: rgba(if($is-dark, #fff, #000), 0.6);
22
+ $inactive-label-text-color: inspection.get-theme-color($theme, foreground, text, 0.6);
23
23
  $active-label-text-color: inspection.get-theme-color($theme, $palette-name, default);
24
24
  $ripple-color: inspection.get-theme-color($theme, $palette-name, default);
25
25
 
26
26
  @return (
27
27
  disabled-ripple-color: inspection.get-theme-color($theme, foreground, disabled),
28
- pagination-icon-color: if($is-dark, #fff, #000),
28
+ pagination-icon-color: inspection.get-theme-color($theme, foreground, icon, 1),
29
29
 
30
30
  // Note: MDC has equivalents of these tokens, but they lead to much higher selector specificity.
31
31
  inactive-label-text-color: $inactive-label-text-color,
@@ -31,7 +31,6 @@ $prefix: (mat, text-button);
31
31
  // Tokens that can be configured through Angular Material's color theming API.
32
32
  @function get-color-tokens($theme) {
33
33
  $is-dark: inspection.get-theme-type($theme) == dark;
34
- $on-surface: if($is-dark, #fff, #000);
35
34
  $ripple-opacities: if($is-dark,
36
35
  mdc-ripple-theme.$light-ink-opacities,
37
36
  mdc-ripple-theme.$dark-ink-opacities
@@ -39,13 +38,13 @@ $prefix: (mat, text-button);
39
38
 
40
39
  @return (
41
40
  // Color of the element that shows the hover, focus and pressed states.
42
- state-layer-color: $on-surface,
41
+ state-layer-color: inspection.get-theme-color($theme, foreground, base),
43
42
 
44
43
  // Color of the element that shows the hover, focus and pressed states while disabled.
45
- disabled-state-layer-color: $on-surface,
44
+ disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
46
45
 
47
46
  // Color of the ripple element.
48
- ripple-color: rgba($on-surface, 0.1),
47
+ ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
49
48
 
50
49
  // Opacity of the ripple when the button is hovered.
51
50
  hover-state-layer-opacity: map.get($ripple-opacities, hover),
@@ -61,10 +60,14 @@ $prefix: (mat, text-button);
61
60
  // Generates the mapping for the properties that change based on the button palette color.
62
61
  @function private-get-color-palette-color-tokens($theme, $palette-name) {
63
62
  $color: inspection.get-theme-color($theme, $palette-name);
63
+ $ripple-opacity: 0.1;
64
64
 
65
65
  @return (
66
66
  state-layer-color: $color,
67
- ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
67
+ ripple-color: if(
68
+ meta.type-of($color) == color,
69
+ rgba($color, $ripple-opacity),
70
+ inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
68
71
  );
69
72
  }
70
73
 
@@ -3,22 +3,12 @@
3
3
  @use '../../../theming/theming';
4
4
  @use '../../../theming/inspection';
5
5
  @use '../../../style/sass-utils';
6
+ @use '../../../mdc-helpers/mdc-helpers';
6
7
  @use '../../token-utils';
7
- @use '@material/theme/theme-color' as mdc-theme-color;
8
8
 
9
9
  // The prefix used to generate the fully qualified name for tokens in this file.
10
10
  $prefix: (mdc, checkbox);
11
11
 
12
- // MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
13
- // This function falls back to determining the tone based on whether the theme is light or dark.
14
- @function _contrast-tone($value, $is-dark, $light-color: '#fff', $dark-color: '#000') {
15
- @if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
16
- @return if(mdc-theme-color.contrast-tone($value) == 'dark', $dark-color, $light-color);
17
- }
18
-
19
- @return if($is-dark, $light-color, $dark-color);
20
- }
21
-
22
12
  // Tokens that can't be configured through Angular Material's current theming API,
23
13
  // but may be in a future version of the theming API.
24
14
  //
@@ -62,6 +52,18 @@ $prefix: (mdc, checkbox);
62
52
  inspection.get-theme-color($theme, foreground, base), $alpha: 0.54);
63
53
  $active-border-color:
64
54
  theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
55
+ $selected-checkmark-color: null;
56
+
57
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
58
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
59
+ @if (token-utils.$private-is-internal-build) {
60
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($palette-selected, $is-dark);
61
+ $selected-checkmark-color: if($contrast-tone == 'dark', #000, #fff);
62
+ }
63
+ @else {
64
+ $selected-checkmark-color:
65
+ inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
66
+ }
65
67
 
66
68
  @return (
67
69
  // The color of the checkbox fill when the checkbox is selected and disabled.
@@ -69,7 +71,7 @@ $prefix: (mdc, checkbox);
69
71
  // The color of the checkbox border when the checkbox is unselected and disabled.
70
72
  disabled-unselected-icon-color: $disabled-color,
71
73
  // The color of the checkmark when the checkbox is selected.
72
- selected-checkmark-color: _contrast-tone($palette-selected, $is-dark),
74
+ selected-checkmark-color: $selected-checkmark-color,
73
75
  // The color of the checkbox fill when the checkbox is selected and focused.
74
76
  selected-focus-icon-color: $palette-selected,
75
77
  // The color of the checkbox fill when the checkbox is selected and hovered.
@@ -2,7 +2,6 @@
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
4
  @use '../../token-utils';
5
- @use '../../../mdc-helpers/mdc-helpers';
6
5
  @use '../../../style/sass-utils';
7
6
  @use '../../../theming/theming';
8
7
  @use '../../../theming/inspection';
@@ -230,15 +229,10 @@ $prefix: (mdc, chip);
230
229
  $foreground: if($is-dark, $grey-50, $grey-900);
231
230
 
232
231
  $surface: inspection.get-theme-color($theme, background, card);
233
- $on-surface: if(
234
- mdc-helpers.variable-safe-contrast-tone($surface, $is-dark) == 'dark',
235
- #000,
236
- #fff
237
- );
238
232
  $background: if(
239
- meta.type-of($on-surface) == color and meta.type-of($surface) == color,
240
- color.mix($on-surface, $surface, 12%),
241
- $on-surface
233
+ meta.type-of($state-layer-color) == color and meta.type-of($surface) == color,
234
+ color.mix($state-layer-color, $surface, 12%),
235
+ $state-layer-color
242
236
  );
243
237
  }
244
238
  @else {
@@ -55,15 +55,21 @@ $prefix: (mdc, dialog);
55
55
  // Tokens that can be configured through Angular Material's color theming API.
56
56
  @function get-color-tokens($theme) {
57
57
  $is-dark: inspection.get-theme-type($theme) == dark;
58
- $on-surface: if($is-dark, #fff, #000);
58
+
59
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
60
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
61
+ $text-base: if(token-utils.$private-is-internal-build,
62
+ if($is-dark, #fff, #000),
63
+ inspection.get-theme-color($theme, foreground, text, 1)
64
+ );
59
65
 
60
66
  @return (
61
67
  // Background color of the container.
62
68
  container-color: inspection.get-theme-color($theme, background, dialog),
63
69
  // Color of the dialog header.
64
- subhead-color: rgba($on-surface, 0.87),
70
+ subhead-color: sass-utils.safe-color-change($text-base, $alpha: 0.87),
65
71
  // Color of the dialog body text.
66
- supporting-text-color: rgba($on-surface, 0.6),
72
+ supporting-text-color: sass-utils.safe-color-change($text-base, $alpha: 0.6),
67
73
  );
68
74
  }
69
75
 
@@ -51,26 +51,36 @@ $prefix: (mdc, filled-button);
51
51
  // Tokens that can be configured through Angular Material's color theming API.
52
52
  @function get-color-tokens($theme) {
53
53
  $is-dark: inspection.get-theme-type($theme) == dark;
54
- $surface: inspection.get-theme-color($theme, background, card);
55
- $on-surface: if($is-dark, #fff, #000);
56
54
 
57
55
  @return (
58
- container-color: $surface,
59
- label-text-color: $on-surface,
60
- disabled-container-color: rgba($on-surface, 0.12),
61
- disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
56
+ container-color: inspection.get-theme-color($theme, background, card),
57
+ label-text-color: inspection.get-theme-color($theme, foreground, text, 1),
58
+ disabled-container-color: inspection.get-theme-color($theme, foreground, disabled-button,
59
+ 0.12),
60
+ disabled-label-text-color: inspection.get-theme-color($theme, foreground, disabled-button,
61
+ if($is-dark, 0.5, 0.38)),
62
62
  );
63
63
  }
64
64
 
65
65
  // Generates the mapping for the properties that change based on the button palette color.
66
66
  @function private-get-color-palette-color-tokens($theme, $palette-name) {
67
- $is-dark: inspection.get-theme-type($theme) == dark;
68
67
  $container-color: inspection.get-theme-color($theme, $palette-name, default);
69
- $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
68
+ $label-text-color: null;
69
+
70
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
71
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
72
+ @if (token-utils.$private-is-internal-build) {
73
+ $is-dark: inspection.get-theme-type($theme) == dark;
74
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
75
+ $label-text-color: if($contrast-tone == 'dark', #000, #fff);
76
+ }
77
+ @else {
78
+ $label-text-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
79
+ }
70
80
 
71
81
  @return (
72
82
  container-color: $container-color,
73
- label-text-color: if($contrast-tone == 'dark', #000, #fff),
83
+ label-text-color: $label-text-color,
74
84
  );
75
85
  }
76
86
 
@@ -93,30 +93,42 @@ $prefix: (mdc, filled-text-field);
93
93
  @function get-color-tokens($theme) {
94
94
  $is-dark: inspection.get-theme-type($theme) == dark;
95
95
  $surface: inspection.get-theme-color($theme, background, card);
96
- $on-surface: if($is-dark, #fff, #000);
97
96
  $warn-color: inspection.get-theme-color($theme, warn);
98
97
  $color-tokens: private-get-color-palette-color-tokens($theme, primary);
98
+ $on-surface: if($is-dark, #fff, #000);
99
+
100
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
101
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
102
+ $text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
103
+ inspection.get-theme-color($theme, foreground, text, 1));
104
+ $disabled-text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
105
+ inspection.get-theme-color($theme, foreground, disabled-text, 1));
106
+ $divider-base: if(token-utils.$private-is-internal-build, $on-surface,
107
+ inspection.get-theme-color($theme, foreground, divider, 1));
99
108
 
100
109
  @return map.merge($color-tokens, (
101
110
  container-color: _variable-safe-mix($on-surface, $surface, 4%),
102
111
  disabled-container-color: _variable-safe-mix($on-surface, $surface, 2%),
103
112
 
104
- label-text-color: rgba($on-surface, 0.6),
105
- hover-label-text-color: rgba($on-surface, 0.6),
106
- disabled-label-text-color: rgba($on-surface, 0.38),
113
+ label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
114
+ hover-label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
115
+ disabled-label-text-color:
116
+ sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),
107
117
 
108
- input-text-color: rgba($on-surface, 0.87),
109
- disabled-input-text-color: rgba($on-surface, 0.38),
110
- input-text-placeholder-color: rgba($on-surface, 0.6),
118
+ input-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.87),
119
+ disabled-input-text-color:
120
+ sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),
121
+ input-text-placeholder-color:
122
+ sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
111
123
 
112
124
  error-hover-label-text-color: $warn-color,
113
125
  error-focus-label-text-color: $warn-color,
114
126
  error-label-text-color: $warn-color,
115
127
  error-caret-color: $warn-color,
116
128
 
117
- active-indicator-color: rgba($on-surface, 0.42),
118
- disabled-active-indicator-color: rgba($on-surface, 0.06),
119
- hover-active-indicator-color: rgba($on-surface, 0.87),
129
+ active-indicator-color: sass-utils.safe-color-change($divider-base, $alpha: 0.42),
130
+ disabled-active-indicator-color: sass-utils.safe-color-change($divider-base, $alpha: 0.06),
131
+ hover-active-indicator-color: sass-utils.safe-color-change($divider-base, $alpha: 0.87),
120
132
  error-active-indicator-color: $warn-color,
121
133
  error-focus-active-indicator-color: $warn-color,
122
134
  error-hover-active-indicator-color: $warn-color,
@@ -3,7 +3,6 @@
3
3
  @use '../../../style/sass-utils';
4
4
  @use '../../../theming/inspection';
5
5
  @use '../../../theming/theming';
6
- @use '../../../mdc-helpers/mdc-helpers';
7
6
 
8
7
  // The prefix used to generate the fully qualified name for tokens in this file.
9
8
  $prefix: (mdc, outlined-button);
@@ -55,15 +54,20 @@ $prefix: (mdc, outlined-button);
55
54
  // Tokens that can be configured through Angular Material's color theming API.
56
55
  @function get-color-tokens($theme) {
57
56
  $is-dark: inspection.get-theme-type($theme) == dark;
58
- $surface: inspection.get-theme-color($theme, background, card);
59
- $contrast-tone: mdc-helpers.variable-safe-contrast-tone($surface, $is-dark);
60
- $on-surface: if($contrast-tone == 'dark', #000, #fff);
57
+
58
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
59
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
60
+ $outline: if(token-utils.$private-is-internal-build,
61
+ rgba(if($is-dark, #fff, #000), 0.12),
62
+ inspection.get-theme-color($theme, foreground, divider)
63
+ );
61
64
 
62
65
  @return (
63
- disabled-outline-color: rgba($on-surface, 0.12),
64
- disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
65
- label-text-color: if($is-dark, #fff, #000),
66
- outline-color: rgba($on-surface, 0.12)
66
+ disabled-outline-color: $outline,
67
+ disabled-label-text-color: inspection.get-theme-color($theme, foreground, disabled-button,
68
+ if($is-dark, 0.5, 0.38)),
69
+ label-text-color: inspection.get-theme-color($theme, foreground, text, 1),
70
+ outline-color: $outline,
67
71
  );
68
72
  }
69
73
 
@@ -86,18 +86,29 @@ $prefix: (mdc, outlined-text-field);
86
86
  // Tokens that can be configured through Angular Material's color theming API.
87
87
  @function get-color-tokens($theme) {
88
88
  $is-dark: inspection.get-theme-type($theme) == dark;
89
- $on-surface: if($is-dark, #fff, #000);
90
89
  $warn-color: inspection.get-theme-color($theme, warn);
91
90
  $color-tokens: private-get-color-palette-color-tokens($theme, primary);
92
91
 
92
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
93
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
94
+ $on-surface: if($is-dark, #fff, #000);
95
+ $text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
96
+ inspection.get-theme-color($theme, foreground, text, 1));
97
+ $disabled-text-color-base: if(token-utils.$private-is-internal-build, $on-surface,
98
+ inspection.get-theme-color($theme, foreground, disabled-text, 1));
99
+ $divider-base: if(token-utils.$private-is-internal-build, $on-surface,
100
+ inspection.get-theme-color($theme, foreground, divider, 1));
101
+
93
102
  @return map.merge($color-tokens, (
94
- label-text-color: rgba($on-surface, 0.6),
95
- hover-label-text-color: rgba($on-surface, 0.6),
96
- disabled-label-text-color: rgba($on-surface, 0.38),
103
+ label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
104
+ hover-label-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
105
+ disabled-label-text-color:
106
+ sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),
97
107
 
98
- input-text-color: rgba($on-surface, 0.87),
99
- disabled-input-text-color: rgba($on-surface, 0.38),
100
- input-text-placeholder-color: rgba($on-surface, 0.6),
108
+ input-text-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.87),
109
+ disabled-input-text-color:
110
+ sass-utils.safe-color-change($disabled-text-color-base, $alpha: 0.38),
111
+ input-text-placeholder-color: sass-utils.safe-color-change($text-color-base, $alpha: 0.6),
101
112
 
102
113
  error-caret-color: $warn-color,
103
114
  error-focus-label-text-color: $warn-color,
@@ -105,9 +116,9 @@ $prefix: (mdc, outlined-text-field);
105
116
  error-hover-label-text-color: $warn-color,
106
117
 
107
118
  // Outline tokens
108
- outline-color: rgba($on-surface, 0.38),
109
- disabled-outline-color: rgba($on-surface, 0.06),
110
- hover-outline-color: rgba($on-surface, 0.87),
119
+ outline-color: sass-utils.safe-color-change($divider-base, $alpha: 0.38),
120
+ disabled-outline-color: sass-utils.safe-color-change($divider-base, $alpha: 0.06),
121
+ hover-outline-color: sass-utils.safe-color-change($divider-base, $alpha: 0.87),
111
122
  error-focus-outline-color: $warn-color,
112
123
  error-hover-outline-color: $warn-color,
113
124
  error-outline-color: $warn-color,
@@ -45,13 +45,14 @@ $prefix: (mdc, protected-button);
45
45
  // Tokens that can be configured through Angular Material's color theming API.
46
46
  @function get-color-tokens($theme) {
47
47
  $is-dark: inspection.get-theme-type($theme) == dark;
48
- $on-surface: if($is-dark, #fff, #000);
49
48
 
50
49
  @return (
51
50
  container-color: inspection.get-theme-color($theme, background, card),
52
- label-text-color: $on-surface,
53
- disabled-container-color: rgba($on-surface, 0.12),
54
- disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
51
+ label-text-color: inspection.get-theme-color($theme, foreground, text, 1),
52
+ disabled-container-color: inspection.get-theme-color($theme, foreground, disabled-button,
53
+ 0.12),
54
+ disabled-label-text-color: inspection.get-theme-color($theme, foreground, disabled-button,
55
+ if($is-dark, 0.5, 0.38)),
55
56
  container-elevation: 2,
56
57
  disabled-container-elevation: 0,
57
58
  focus-container-elevation: 4,
@@ -63,13 +64,23 @@ $prefix: (mdc, protected-button);
63
64
 
64
65
  // Generates the mapping for the properties that change based on the button palette color.
65
66
  @function private-get-color-palette-color-tokens($theme, $palette-name) {
66
- $is-dark: inspection.get-theme-type($theme) == dark;
67
67
  $container-color: inspection.get-theme-color($theme, $palette-name, default);
68
- $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
68
+ $label-text-color: null;
69
+
70
+ // Ideally we would derive all values directly from the theme, but it causes a lot of regressions
71
+ // internally. For now we fall back to the old hardcoded behavior only for internal apps.
72
+ @if (token-utils.$private-is-internal-build) {
73
+ $is-dark: inspection.get-theme-type($theme) == dark;
74
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
75
+ $label-text-color: if($contrast-tone == 'dark', #000, #fff);
76
+ }
77
+ @else {
78
+ $label-text-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
79
+ }
69
80
 
70
81
  @return (
71
82
  container-color: $container-color,
72
- label-text-color: if($contrast-tone == 'dark', #000, #fff),
83
+ label-text-color: $label-text-color,
73
84
  );
74
85
  }
75
86
 
@@ -45,15 +45,14 @@ $prefix: (mdc, radio);
45
45
  @function get-color-tokens($theme, $palette-name: accent) {
46
46
  $is-dark: inspection.get-theme-type($theme) == dark;
47
47
  $palette-color: inspection.get-theme-color($theme, $palette-name, default);
48
- $on-surface: if($is-dark, #fff, #000);
49
48
  $icon-color: theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
50
49
 
51
50
  @return (
52
- disabled-selected-icon-color: $on-surface,
53
- disabled-unselected-icon-color: $on-surface,
51
+ disabled-selected-icon-color: inspection.get-theme-color($theme, foreground, icon, 1),
52
+ disabled-unselected-icon-color: inspection.get-theme-color($theme, foreground, icon, 1),
54
53
  unselected-hover-icon-color: $icon-color,
55
- unselected-icon-color: rgba($on-surface, 0.54),
56
- unselected-pressed-icon-color: rgba($on-surface, 0.54),
54
+ unselected-icon-color: inspection.get-theme-color($theme, foreground, icon, 0.54),
55
+ unselected-pressed-icon-color: inspection.get-theme-color($theme, foreground, icon, 0.54),
57
56
  selected-focus-icon-color: $palette-color,
58
57
  selected-hover-icon-color: $palette-color,
59
58
  selected-icon-color: $palette-color,
@@ -44,11 +44,11 @@ $prefix: (mdc, text-button);
44
44
  // Tokens that can be configured through Angular Material's color theming API.
45
45
  @function get-color-tokens($theme) {
46
46
  $is-dark: inspection.get-theme-type($theme) == dark;
47
- $on-surface: if($is-dark, #fff, #000);
48
47
 
49
48
  @return (
50
- label-text-color: $on-surface,
51
- disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
49
+ label-text-color: inspection.get-theme-color($theme, foreground, text, 1),
50
+ disabled-label-text-color: inspection.get-theme-color($theme, foreground, disabled-button,
51
+ if($is-dark, 0.5, 0.38)),
52
52
  );
53
53
  }
54
54
 
@@ -1481,6 +1481,7 @@ export declare class MatEndDate<D> extends MatDateRangeInputPartBase<D> {
1481
1481
  protected _getValueFromModel(modelValue: DateRange<D>): D | null;
1482
1482
  protected _shouldHandleChangeEvent(change: DateSelectionModelChange<DateRange<D>>): boolean;
1483
1483
  protected _assignValueToModel(value: D | null): void;
1484
+ private _moveCaretToEndOfStartInput;
1484
1485
  _onKeydown(event: KeyboardEvent): void;
1485
1486
  static ɵfac: i0.ɵɵFactoryDeclaration<MatEndDate<any>, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
1486
1487
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatEndDate<any>, "input[matEndDate]", never, {}, { "dateChange": "dateChange"; "dateInput": "dateInput"; }, never, never, true, never>;