@angular/material 16.1.0-next.0 → 16.1.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/_index.scss +7 -4
  2. package/_token-theming.scss +2 -0
  3. package/button/_icon-button-theme.scss +0 -1
  4. package/button/index.d.ts +3 -2
  5. package/card/_card-theme.import.scss +1 -1
  6. package/card/_card-theme.scss +11 -0
  7. package/checkbox/_checkbox-theme.import.scss +1 -1
  8. package/checkbox/_checkbox-theme.scss +18 -3
  9. package/chips/_chips-theme.scss +44 -60
  10. package/core/mdc-helpers/_mdc-helpers.scss +19 -34
  11. package/core/style/_sass-utils.scss +37 -0
  12. package/core/tokens/_token-utils.scss +3 -12
  13. package/core/tokens/m2/_index.scss +84 -0
  14. package/core/tokens/m2/mat/_card.scss +17 -16
  15. package/core/tokens/m2/mat/_radio.scss +6 -5
  16. package/core/tokens/m2/mat/_snack-bar.scss +6 -5
  17. package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -5
  18. package/core/tokens/m2/mat/_tab-header.scss +2 -1
  19. package/core/tokens/m2/mdc/_checkbox.scss +39 -38
  20. package/core/tokens/m2/mdc/_chip.scss +313 -0
  21. package/core/tokens/m2/mdc/_circular-progress.scss +5 -8
  22. package/core/tokens/m2/mdc/_dialog.scss +6 -7
  23. package/core/tokens/m2/mdc/_elevated-card.scss +2 -1
  24. package/core/tokens/m2/mdc/_icon-button.scss +5 -13
  25. package/core/tokens/m2/mdc/_linear-progress.scss +11 -16
  26. package/core/tokens/m2/mdc/_list.scss +102 -101
  27. package/core/tokens/m2/mdc/_outlined-card.scss +2 -1
  28. package/core/tokens/m2/mdc/_plain-tooltip.scss +6 -9
  29. package/core/tokens/m2/mdc/_radio.scss +6 -7
  30. package/core/tokens/m2/mdc/_snack-bar.scss +6 -8
  31. package/core/tokens/m2/mdc/_tab-indicator.scss +6 -6
  32. package/core/tokens/m2/mdc/_tab.scss +6 -6
  33. package/core/typography/_all-typography.scss +1 -154
  34. package/core/typography/_typography.scss +162 -0
  35. package/esm2022/autocomplete/autocomplete.mjs +3 -3
  36. package/esm2022/button/button-base.mjs +7 -11
  37. package/esm2022/button/button.mjs +3 -3
  38. package/esm2022/button/fab.mjs +5 -5
  39. package/esm2022/button/icon-button.mjs +3 -3
  40. package/esm2022/checkbox/checkbox.mjs +2 -2
  41. package/esm2022/chips/chip-grid.mjs +2 -2
  42. package/esm2022/chips/chip-listbox.mjs +5 -5
  43. package/esm2022/chips/chip-option.mjs +3 -3
  44. package/esm2022/chips/chip-row.mjs +2 -2
  45. package/esm2022/chips/chip-set.mjs +2 -2
  46. package/esm2022/chips/chip.mjs +2 -2
  47. package/esm2022/core/version.mjs +1 -1
  48. package/esm2022/datepicker/calendar-body.mjs +29 -16
  49. package/esm2022/datepicker/datepicker-toggle.mjs +3 -3
  50. package/esm2022/form-field/directives/floating-label.mjs +66 -5
  51. package/esm2022/form-field/directives/notched-outline.mjs +14 -16
  52. package/esm2022/form-field/form-field.mjs +30 -36
  53. package/esm2022/icon/testing/icon-harness.mjs +7 -2
  54. package/esm2022/legacy-autocomplete/autocomplete.mjs +3 -3
  55. package/esm2022/legacy-chips/chip-list.mjs +3 -3
  56. package/esm2022/legacy-core/option/optgroup.mjs +3 -3
  57. package/esm2022/legacy-form-field/form-field.mjs +3 -3
  58. package/esm2022/legacy-menu/menu-item.mjs +3 -3
  59. package/esm2022/legacy-menu/menu.mjs +3 -3
  60. package/esm2022/legacy-paginator/paginator.mjs +3 -3
  61. package/esm2022/legacy-select/public-api.mjs +2 -2
  62. package/esm2022/legacy-select/select.mjs +3 -3
  63. package/esm2022/legacy-table/table.mjs +3 -3
  64. package/esm2022/legacy-tabs/tab-group.mjs +3 -3
  65. package/esm2022/list/list-base.mjs +2 -1
  66. package/esm2022/menu/menu-item.mjs +3 -3
  67. package/esm2022/menu/menu.mjs +3 -3
  68. package/esm2022/paginator/paginator.mjs +3 -3
  69. package/esm2022/progress-bar/progress-bar.mjs +2 -2
  70. package/esm2022/select/select.mjs +28 -17
  71. package/esm2022/sidenav/drawer.mjs +7 -7
  72. package/esm2022/sidenav/sidenav.mjs +7 -7
  73. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  74. package/esm2022/slider/slider-input.mjs +21 -9
  75. package/esm2022/stepper/stepper.mjs +3 -3
  76. package/esm2022/table/row.mjs +2 -2
  77. package/esm2022/table/table.mjs +3 -3
  78. package/esm2022/tabs/tab-group.mjs +3 -3
  79. package/esm2022/tooltip/tooltip.mjs +5 -1
  80. package/fesm2022/autocomplete.mjs +2 -2
  81. package/fesm2022/autocomplete.mjs.map +1 -1
  82. package/fesm2022/button.mjs +14 -18
  83. package/fesm2022/button.mjs.map +1 -1
  84. package/fesm2022/checkbox.mjs +2 -2
  85. package/fesm2022/checkbox.mjs.map +1 -1
  86. package/fesm2022/chips.mjs +14 -14
  87. package/fesm2022/chips.mjs.map +1 -1
  88. package/fesm2022/core.mjs +1 -1
  89. package/fesm2022/core.mjs.map +1 -1
  90. package/fesm2022/datepicker.mjs +30 -17
  91. package/fesm2022/datepicker.mjs.map +1 -1
  92. package/fesm2022/form-field.mjs +102 -50
  93. package/fesm2022/form-field.mjs.map +1 -1
  94. package/fesm2022/icon/testing.mjs +6 -1
  95. package/fesm2022/icon/testing.mjs.map +1 -1
  96. package/fesm2022/legacy-autocomplete.mjs +2 -2
  97. package/fesm2022/legacy-autocomplete.mjs.map +1 -1
  98. package/fesm2022/legacy-chips.mjs +2 -2
  99. package/fesm2022/legacy-chips.mjs.map +1 -1
  100. package/fesm2022/legacy-core.mjs +2 -2
  101. package/fesm2022/legacy-core.mjs.map +1 -1
  102. package/fesm2022/legacy-form-field.mjs +2 -2
  103. package/fesm2022/legacy-form-field.mjs.map +1 -1
  104. package/fesm2022/legacy-menu.mjs +4 -4
  105. package/fesm2022/legacy-menu.mjs.map +1 -1
  106. package/fesm2022/legacy-paginator.mjs +2 -2
  107. package/fesm2022/legacy-paginator.mjs.map +1 -1
  108. package/fesm2022/legacy-select.mjs +2 -2
  109. package/fesm2022/legacy-select.mjs.map +1 -1
  110. package/fesm2022/legacy-table.mjs +2 -2
  111. package/fesm2022/legacy-table.mjs.map +1 -1
  112. package/fesm2022/legacy-tabs.mjs +2 -2
  113. package/fesm2022/legacy-tabs.mjs.map +1 -1
  114. package/fesm2022/list.mjs +1 -0
  115. package/fesm2022/list.mjs.map +1 -1
  116. package/fesm2022/menu.mjs +4 -4
  117. package/fesm2022/menu.mjs.map +1 -1
  118. package/fesm2022/paginator.mjs +2 -2
  119. package/fesm2022/paginator.mjs.map +1 -1
  120. package/fesm2022/progress-bar.mjs +2 -2
  121. package/fesm2022/progress-bar.mjs.map +1 -1
  122. package/fesm2022/select.mjs +27 -16
  123. package/fesm2022/select.mjs.map +1 -1
  124. package/fesm2022/sidenav.mjs +12 -12
  125. package/fesm2022/sidenav.mjs.map +1 -1
  126. package/fesm2022/slide-toggle.mjs +2 -2
  127. package/fesm2022/slide-toggle.mjs.map +1 -1
  128. package/fesm2022/slider.mjs +20 -8
  129. package/fesm2022/slider.mjs.map +1 -1
  130. package/fesm2022/stepper.mjs +2 -2
  131. package/fesm2022/stepper.mjs.map +1 -1
  132. package/fesm2022/table.mjs +3 -3
  133. package/fesm2022/table.mjs.map +1 -1
  134. package/fesm2022/tabs.mjs +2 -2
  135. package/fesm2022/tabs.mjs.map +1 -1
  136. package/fesm2022/tooltip.mjs +4 -0
  137. package/fesm2022/tooltip.mjs.map +1 -1
  138. package/form-field/index.d.ts +44 -12
  139. package/legacy-select/index.d.ts +7 -2
  140. package/list/index.d.ts +2 -1
  141. package/package.json +49 -49
  142. package/prebuilt-themes/deeppurple-amber.css +1 -1
  143. package/prebuilt-themes/indigo-pink.css +1 -1
  144. package/prebuilt-themes/pink-bluegrey.css +1 -1
  145. package/prebuilt-themes/purple-green.css +1 -1
  146. package/schematics/ng-add/index.js +1 -1
  147. package/schematics/ng-add/index.mjs +1 -1
  148. package/select/index.d.ts +13 -5
  149. package/slider/index.d.ts +10 -1
  150. package/table/index.d.ts +1 -1
  151. package/tabs/_tabs-theme.scss +0 -1
  152. package/tooltip/index.d.ts +4 -0
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../../token-utils';
3
3
  @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
4
5
 
5
6
  // The prefix used to generate the fully qualified name for tokens in this file.
6
7
  $prefix: (mat, radio);
@@ -37,10 +38,10 @@ $prefix: (mat, radio);
37
38
  // Combines the tokens generated by the above functions into a single map with placeholder values.
38
39
  // This is used to create token slots.
39
40
  @function get-token-slots() {
40
- @return token-utils.merge-all(
41
- get-unthemable-tokens(),
42
- get-color-tokens(token-utils.$placeholder-color-config),
43
- get-typography-tokens(token-utils.$placeholder-typography-config),
44
- get-density-tokens(token-utils.$placeholder-density-config)
41
+ @return sass-utils.deep-merge-all(
42
+ get-unthemable-tokens(),
43
+ get-color-tokens(token-utils.$placeholder-color-config),
44
+ get-typography-tokens(token-utils.$placeholder-typography-config),
45
+ get-density-tokens(token-utils.$placeholder-density-config)
45
46
  );
46
47
  }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../../token-utils';
3
3
  @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
4
5
 
5
6
  // The prefix used to generate the fully qualified name for tokens in this file.
6
7
  $prefix: (mat, snack-bar);
@@ -34,10 +35,10 @@ $prefix: (mat, snack-bar);
34
35
  // Combines the tokens generated by the above functions into a single map with placeholder values.
35
36
  // This is used to create token slots.
36
37
  @function get-token-slots() {
37
- @return token-utils.merge-all(
38
- get-unthemable-tokens(),
39
- get-color-tokens(token-utils.$placeholder-color-config),
40
- get-typography-tokens(token-utils.$placeholder-typography-config),
41
- get-density-tokens(token-utils.$placeholder-density-config)
38
+ @return sass-utils.deep-merge-all(
39
+ get-unthemable-tokens(),
40
+ get-color-tokens(token-utils.$placeholder-color-config),
41
+ get-typography-tokens(token-utils.$placeholder-typography-config),
42
+ get-density-tokens(token-utils.$placeholder-density-config)
42
43
  );
43
44
  }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../../token-utils';
3
3
  @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
4
5
 
5
6
  // The prefix used to generate the fully qualified name for tokens in this file.
6
7
  $prefix: (mat, tab-header-with-background);
@@ -34,10 +35,10 @@ $prefix: (mat, tab-header-with-background);
34
35
  // Combines the tokens generated by the above functions into a single map with placeholder values.
35
36
  // This is used to create token slots.
36
37
  @function get-token-slots() {
37
- @return token-utils.merge-all(
38
- get-unthemable-tokens(),
39
- get-color-tokens(token-utils.$placeholder-color-config),
40
- get-typography-tokens(token-utils.$placeholder-typography-config),
41
- get-density-tokens(token-utils.$placeholder-density-config)
38
+ @return sass-utils.deep-merge-all(
39
+ get-unthemable-tokens(),
40
+ get-color-tokens(token-utils.$placeholder-color-config),
41
+ get-typography-tokens(token-utils.$placeholder-typography-config),
42
+ get-density-tokens(token-utils.$placeholder-density-config)
42
43
  );
43
44
  }
@@ -2,6 +2,7 @@
2
2
  @use '../../token-utils';
3
3
  @use '../../../theming/theming';
4
4
  @use '../../../typography/typography-utils';
5
+ @use '../../../style/sass-utils';
5
6
 
6
7
  // The prefix used to generate the fully qualified name for tokens in this file.
7
8
  $prefix: (mat, tab-header);
@@ -62,7 +63,7 @@ $prefix: (mat, tab-header);
62
63
  // Combines the tokens generated by the above functions into a single map with placeholder values.
63
64
  // This is used to create token slots.
64
65
  @function get-token-slots() {
65
- @return token-utils.merge-all(
66
+ @return sass-utils.deep-merge-all(
66
67
  get-unthemable-tokens(),
67
68
  get-color-tokens(token-utils.$placeholder-color-config),
68
69
  get-typography-tokens(token-utils.$placeholder-typography-config),
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../../../theming/palette';
3
3
  @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
4
5
  @use '../../token-utils';
5
6
  @use '@material/theme/theme-color' as mdc-theme-color;
6
7
 
@@ -26,25 +27,25 @@ $prefix: (mdc, checkbox);
26
27
  @function get-unthemable-tokens() {
27
28
  @return (
28
29
  // The color of the checkmark when the checkbox is selected and disabled.
29
- disabled-selected-checkmark-color: #fff,
30
+ disabled-selected-checkmark-color: #fff,
30
31
  // The opacity of the ripple when the checkbox is selected and focused.
31
- selected-focus-state-layer-opacity: 0.16,
32
+ selected-focus-state-layer-opacity: 0.16,
32
33
  // The opacity of the ripple when the checkbox is selected and hovered.
33
- selected-hover-state-layer-opacity: 0.04,
34
+ selected-hover-state-layer-opacity: 0.04,
34
35
  // The opacity of the ripple when the checkbox is selected and pressed.
35
- selected-pressed-state-layer-opacity: 0.16,
36
+ selected-pressed-state-layer-opacity: 0.16,
36
37
  // The opacity of the ripple when the checkbox is unselected and focused.
37
- unselected-focus-state-layer-opacity: 0.16,
38
+ unselected-focus-state-layer-opacity: 0.16,
38
39
  // The opacity of the ripple when the checkbox is unselected and hovered.
39
- unselected-hover-state-layer-opacity: 0.04,
40
+ unselected-hover-state-layer-opacity: 0.04,
40
41
  // The opacity of the ripple when the checkbox is unselected and pressed.
41
- unselected-pressed-state-layer-opacity: 0.16,
42
+ unselected-pressed-state-layer-opacity: 0.16,
42
43
  // =============================================================================================
43
44
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
44
45
  // =============================================================================================
45
46
  // MDC currently doesn't output a slot for these tokens.
46
- disabled-selected-icon-opacity: null,
47
- disabled-unselected-icon-opacity: null,
47
+ disabled-selected-icon-opacity: null,
48
+ disabled-unselected-icon-opacity: null,
48
49
  );
49
50
  }
50
51
 
@@ -59,43 +60,43 @@ $prefix: (mdc, checkbox);
59
60
  $selected-color: theming.get-color-from-palette($accent);
60
61
  $border-color: theming.get-color-from-palette($foreground, base, 0.54);
61
62
  $active-border-color:
62
- theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
63
+ theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
63
64
 
64
65
  @return (
65
66
  // The color of the checkbox fill when the checkbox is selected and disabled.
66
- disabled-selected-icon-color: $disabled-color,
67
+ disabled-selected-icon-color: $disabled-color,
67
68
  // The color of the checkbox border when the checkbox is unselected and disabled.
68
- disabled-unselected-icon-color: $disabled-color,
69
+ disabled-unselected-icon-color: $disabled-color,
69
70
  // The color of the checkmark when the checkbox is selected.
70
- selected-checkmark-color: _contrast-tone($selected-color, $is-dark),
71
+ selected-checkmark-color: _contrast-tone($selected-color, $is-dark),
71
72
  // The color of the checkbox fill when the checkbox is selected and focused.
72
- selected-focus-icon-color: $selected-color,
73
+ selected-focus-icon-color: $selected-color,
73
74
  // The color of the checkbox fill when the checkbox is selected and hovered.
74
- selected-hover-icon-color: $selected-color,
75
+ selected-hover-icon-color: $selected-color,
75
76
  // The color of the checkbox fill when the checkbox is selected.
76
- selected-icon-color: $selected-color,
77
+ selected-icon-color: $selected-color,
77
78
  // The color of the checkbox fill when the checkbox is selected an pressed.
78
- selected-pressed-icon-color: $selected-color,
79
+ selected-pressed-icon-color: $selected-color,
79
80
  // The color of the checkbox border when the checkbox is unselected and focused.
80
- unselected-focus-icon-color: $active-border-color,
81
+ unselected-focus-icon-color: $active-border-color,
81
82
  // The color of the checkbox border when the checkbox is unselected and hovered.
82
- unselected-hover-icon-color: $active-border-color,
83
+ unselected-hover-icon-color: $active-border-color,
83
84
  // The color of the checkbox border when the checkbox is unselected.
84
- unselected-icon-color: $border-color,
85
+ unselected-icon-color: $border-color,
85
86
  // The color of the checkbox border when the checkbox is unselected and pressed.
86
- unselected-pressed-icon-color: $border-color,
87
+ unselected-pressed-icon-color: $border-color,
87
88
  // The color of the ripple when the checkbox is selected and focused.
88
- selected-focus-state-layer-color: $accent-default,
89
+ selected-focus-state-layer-color: $accent-default,
89
90
  // The color of the ripple when the checkbox is selected and hovered.
90
- selected-hover-state-layer-color: $accent-default,
91
+ selected-hover-state-layer-color: $accent-default,
91
92
  // The color of the ripple when the checkbox is selected and pressed.
92
- selected-pressed-state-layer-color: $accent-default,
93
+ selected-pressed-state-layer-color: $accent-default,
93
94
  // The color of the ripple when the checkbox is unselected and focused.
94
- unselected-focus-state-layer-color: $foreground-base,
95
+ unselected-focus-state-layer-color: $foreground-base,
95
96
  // The color of the ripple when the checkbox is unselected and hovered.
96
- unselected-hover-state-layer-color: $foreground-base,
97
+ unselected-hover-state-layer-color: $foreground-base,
97
98
  // The color of the ripple when the checkbox is unselected and pressed.
98
- unselected-pressed-state-layer-color: $foreground-base,
99
+ unselected-pressed-state-layer-color: $foreground-base,
99
100
  );
100
101
  }
101
102
 
@@ -110,22 +111,22 @@ $prefix: (mdc, checkbox);
110
111
 
111
112
  @return (
112
113
  // The diameter of the checkbox's ripple.
113
- state-layer-size: map.get((
114
- 0: 40px,
115
- -1: 36px,
116
- -2: 32px,
117
- -3: 28px,
118
- ), $scale)
114
+ state-layer-size: map.get((
115
+ 0: 40px,
116
+ -1: 36px,
117
+ -2: 32px,
118
+ -3: 28px,
119
+ ), $scale)
119
120
  );
120
121
  }
121
122
 
122
123
  // Combines the tokens generated by the above functions into a single map with placeholder values.
123
124
  // This is used to create token slots.
124
125
  @function get-token-slots() {
125
- @return token-utils.merge-all(
126
- get-unthemable-tokens(),
127
- get-color-tokens(token-utils.$placeholder-color-config),
128
- get-typography-tokens(token-utils.$placeholder-typography-config),
129
- get-density-tokens(token-utils.$placeholder-density-config)
126
+ @return sass-utils.deep-merge-all(
127
+ get-unthemable-tokens(),
128
+ get-color-tokens(token-utils.$placeholder-color-config),
129
+ get-typography-tokens(token-utils.$placeholder-typography-config),
130
+ get-density-tokens(token-utils.$placeholder-density-config)
130
131
  );
131
132
  }
@@ -0,0 +1,313 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../mdc-helpers/mdc-helpers';
4
+ @use '../../../style/sass-utils';
5
+ @use '../../../theming/theming';
6
+ @use '../../../typography/typography-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mdc, chip);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ //
14
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
15
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
16
+ // our CSS.
17
+ @function get-unthemable-tokens() {
18
+ @return (
19
+ // The shape & radius of the chip.
20
+ container-shape:
21
+ (
22
+ family: 'rounded',
23
+ radius: (
24
+ 16px 16px 16px 16px,
25
+ )
26
+ ),
27
+ // The shape & radius of the avatar.
28
+ with-avatar-avatar-shape:
29
+ (
30
+ family: 'rounded',
31
+ radius: (
32
+ 14px 14px 14px 14px,
33
+ )
34
+ ),
35
+ // The width & height of the chip avatar.
36
+ with-avatar-avatar-size: 28px,
37
+ // The width & height of the chip icon.
38
+ with-icon-icon-size: 18px,
39
+ // Not used by MDC.
40
+ disabled-label-text-opacity: null,
41
+ // Not used by MDC.
42
+ disabled-outline-opacity: null,
43
+ // Not used by MDC.
44
+ elevated-disabled-container-opacity: null,
45
+ // Not used by MDC.
46
+ flat-disabled-outline-opacity: null,
47
+ // Not used by MDC.
48
+ flat-disabled-unselected-outline-opacity: null,
49
+ // Our chips do not have a border.
50
+ flat-outline-width: null,
51
+ // Our chips do not have a border.
52
+ flat-selected-outline-width: null,
53
+ // Our chips do not have a border.
54
+ flat-unselected-outline-width: null,
55
+ // Our chips do not have a border.
56
+ outline-width: null,
57
+ // Not used by MDC.
58
+ with-avatar-disabled-avatar-opacity: null,
59
+ // Not used by MDC.
60
+ with-icon-disabled-icon-opacity: null,
61
+ // Not used by MDC.
62
+ with-leading-icon-disabled-leading-icon-opacity: null,
63
+ // Not used by MDC.
64
+ with-leading-icon-leading-icon-size: null,
65
+ // Not used by MDC.
66
+ with-trailing-icon-disabled-trailing-icon-opacity: null,
67
+ // Not used by MDC.
68
+ with-trailing-icon-trailing-icon-size: null,
69
+ // Elevated chips not implemented.
70
+ container-elevation: null,
71
+ // Elevated chips not implemented.
72
+ container-shadow-color: null,
73
+ // Our chips do not have a border.
74
+ disabled-outline-color: null,
75
+ // Elevated chips not implemented.
76
+ elevated-container-elevation: null,
77
+ // Elevated chips not implemented.
78
+ elevated-container-shadow-color: null,
79
+ // Elevated chips not implemented.
80
+ container-surface-tint-layer-color: null,
81
+ // Elevated chips not implemented.
82
+ elevated-disabled-container-elevation: null,
83
+ // Elevated chips not implemented.
84
+ elevated-focus-container-elevation: null,
85
+ // Elevated chips not implemented.
86
+ elevated-hover-container-elevation: null,
87
+ // Elevated chips not implemented.
88
+ elevated-pressed-container-elevation: null,
89
+ // Elevated chips not implemented.
90
+ elevated-selected-container-color: null,
91
+ // Elevated chips not implemented.
92
+ elevated-selected-container-elevation: null,
93
+ // Elevated chips not implemented.
94
+ elevated-unselected-container-color: null,
95
+ // Elevated chips not implemented.
96
+ flat-container-elevation: null,
97
+ // Our chips do not have a border.
98
+ flat-disabled-outline-color: null,
99
+ // Not providing this uses
100
+ flat-disabled-selected-container-color: null,
101
+ // Not used by MDC.
102
+ flat-disabled-selected-container-opacity: null,
103
+ // Unused.
104
+ flat-disabled-selected-outline-color: null,
105
+ // Unused.
106
+ flat-disabled-selected-outline-opacity: null,
107
+ // Unused.
108
+ flat-disabled-unselected-outline-color: null,
109
+ // Unused.
110
+ flat-focus-outline-color: null,
111
+ // Unused.
112
+ flat-outline-color: null,
113
+ // Unused.
114
+ flat-selected-container-color: null,
115
+ // Unused.
116
+ flat-selected-focus-container-elevation: null,
117
+ // Unused.
118
+ flat-selected-hover-container-elevation: null,
119
+ // Unused.
120
+ flat-selected-outline-color: null,
121
+ // Unused.
122
+ flat-selected-pressed-container-elevation: null,
123
+ // Unused.
124
+ flat-unselected-focus-container-elevation: null,
125
+ // Unused.
126
+ flat-unselected-focus-outline-color: null,
127
+ // Unused.
128
+ flat-unselected-hover-container-elevation: null,
129
+ // Unused.
130
+ flat-unselected-outline-color: null,
131
+ // Unused.
132
+ flat-unselected-pressed-container-elevation: null,
133
+ // Unused.
134
+ focus-label-text-color: null,
135
+ // Unused.
136
+ focus-outline-color: null,
137
+ // Unused.
138
+ focus-state-layer-color: null,
139
+ // Unused.
140
+ focus-state-layer-opacity: null,
141
+ // Unused.
142
+ hover-label-text-color: null,
143
+ // Unused.
144
+ hover-state-layer-color: null,
145
+ // Unused.
146
+ hover-state-layer-opacity: null,
147
+ // Unused.
148
+ outline-color: null,
149
+ // Unused.
150
+ pressed-label-text-color: null,
151
+ // Unused.
152
+ pressed-state-layer-color: null,
153
+ // Unused.
154
+ pressed-state-layer-opacity: null,
155
+ // Unused.
156
+ selected-focus-label-text-color: null,
157
+ // Unused.
158
+ selected-focus-state-layer-color: null,
159
+ // Unused.
160
+ selected-focus-state-layer-opacity: null,
161
+ // Unused.
162
+ selected-hover-label-text-color: null,
163
+ // Unused.
164
+ selected-hover-state-layer-color: null,
165
+ // Unused.
166
+ selected-hover-state-layer-opacity: null,
167
+ // Unused.
168
+ selected-label-text-color: null,
169
+ // Unused.
170
+ selected-pressed-label-text-color: null,
171
+ // Unused.
172
+ selected-pressed-state-layer-color: null,
173
+ // Unused.
174
+ selected-pressed-state-layer-opacity: null,
175
+ // Unused.
176
+ unselected-focus-label-text-color: null,
177
+ // Unused.
178
+ unselected-focus-state-layer-color: null,
179
+ // Unused.
180
+ unselected-focus-state-layer-opacity: null,
181
+ // Unused.
182
+ unselected-hover-label-text-color: null,
183
+ // Unused.
184
+ unselected-hover-state-layer-color: null,
185
+ // Unused.
186
+ unselected-hover-state-layer-opacity: null,
187
+ // Unused.
188
+ unselected-label-text-color: null,
189
+ // Unused.
190
+ unselected-pressed-label-text-color: null,
191
+ // Unused.
192
+ unselected-pressed-state-layer-color: null,
193
+ // Unused.
194
+ unselected-pressed-state-layer-opacity: null,
195
+ // Unused.
196
+ with-icon-focus-icon-color: null,
197
+ // Unused.
198
+ with-icon-hover-icon-color: null,
199
+ // Unused.
200
+ with-icon-pressed-icon-color: null,
201
+ // Unused.
202
+ with-icon-selected-focus-icon-color: null,
203
+ // Unused.
204
+ with-icon-selected-hover-icon-color: null,
205
+ // Unused.
206
+ with-icon-selected-pressed-icon-color: null,
207
+ // Unused.
208
+ with-icon-unselected-focus-icon-color: null,
209
+ // Unused.
210
+ with-icon-unselected-hover-icon-color: null,
211
+ // Unused.
212
+ with-icon-unselected-icon-color: null,
213
+ // Unused.
214
+ with-icon-unselected-pressed-icon-color: null,
215
+ // Unused.
216
+ with-leading-icon-disabled-leading-icon-color: null,
217
+ // Unused.
218
+ with-leading-icon-focus-leading-icon-color: null,
219
+ // Unused.
220
+ with-leading-icon-hover-leading-icon-color: null,
221
+ // Unused.
222
+ with-leading-icon-leading-icon-color: null,
223
+ // Unused.
224
+ with-leading-icon-pressed-leading-icon-color: null,
225
+ // Unused.
226
+ with-trailing-icon-focus-trailing-icon-color: null,
227
+ // Unused.
228
+ with-trailing-icon-hover-trailing-icon-color: null,
229
+ // Unused.
230
+ with-trailing-icon-pressed-trailing-icon-color: null
231
+ );
232
+ }
233
+
234
+ // Tokens that can be configured through Angular Material's color theming API.
235
+ @function get-color-tokens($config) {
236
+ $palette: map.get($config, primary);
237
+ $background: theming.get-color-from-palette($palette);
238
+ $foreground: theming.get-color-from-palette($palette, default-contrast);
239
+
240
+ @return (
241
+ // The text color of a disabled chip.
242
+ disabled-label-text-color: $foreground,
243
+ // The background-color of the chip.
244
+ elevated-container-color: $background,
245
+ // The background-color of a disabled chip.
246
+ elevated-disabled-container-color: $background,
247
+ // The chip text color.
248
+ label-text-color: $foreground,
249
+ // The icon color of a chip.
250
+ with-icon-icon-color: $foreground,
251
+ // The color of the icon of a disabled chip.
252
+ with-icon-disabled-icon-color: $foreground,
253
+ // The color of the icon of a selected chip.
254
+ with-icon-selected-icon-color: $foreground,
255
+ // The color of the icon at the end of a disabled chip.
256
+ with-trailing-icon-disabled-trailing-icon-color: $foreground,
257
+ // The color of the icon at the end of the chip.
258
+ with-trailing-icon-trailing-icon-color: $foreground
259
+ );
260
+ }
261
+
262
+ // Tokens that can be configured through Angular Material's typography theming API.
263
+ @function get-typography-tokens($config) {
264
+ // TODO(wagnermaciel): The earlier implementation of the chip used MDC's APIs to create the
265
+ // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
266
+ // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
267
+ // fallback.
268
+ @if ($config == null) {
269
+ $config: mdc-helpers.private-fallback-typography-from-mdc();
270
+ }
271
+
272
+ @return (
273
+ // The font family of the chip text.
274
+ label-text-font: typography-utils.font-family($config, body-2) or
275
+ typography-utils.font-family($config),
276
+ // The line height of the chip text.
277
+ label-text-line-height: typography-utils.line-height($config, body-2),
278
+ // The font size of the chip text.
279
+ label-text-size: typography-utils.font-size($config, body-2),
280
+ // The letter spacing of the chip label.
281
+ label-text-tracking: typography-utils.letter-spacing($config, body-2),
282
+ // The font weight of the chip text.
283
+ label-text-weight: typography-utils.font-weight($config, body-2)
284
+ );
285
+ }
286
+
287
+ // Tokens that can be configured through Angular Material's density theming API.
288
+ @function get-density-tokens($config) {
289
+ $scale: theming.clamp-density($config, -2);
290
+ @return (
291
+ // The height of the chip.
292
+ container-height:
293
+ map.get(
294
+ (
295
+ 0: 32px,
296
+ -1: 28px,
297
+ -2: 24px,
298
+ ),
299
+ $scale
300
+ )
301
+ );
302
+ }
303
+
304
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
305
+ // This is used to create token slots.
306
+ @function get-token-slots() {
307
+ @return sass-utils.deep-merge-all(
308
+ get-unthemable-tokens(),
309
+ get-color-tokens(token-utils.$placeholder-color-config),
310
+ get-typography-tokens(token-utils.$placeholder-typography-config),
311
+ get-density-tokens(token-utils.$placeholder-density-config)
312
+ );
313
+ }
@@ -1,5 +1,6 @@
1
1
  @use 'sass:map';
2
2
  @use '../../../theming/theming';
3
+ @use '../../../style/sass-utils';
3
4
  @use '../../token-utils';
4
5
 
5
6
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -52,14 +53,10 @@ $prefix: (mdc, circular-progress);
52
53
  // Combines the tokens generated by the above functions into a single map with placeholder values.
53
54
  // This is used to create token slots.
54
55
  @function get-token-slots() {
55
- @return map.merge(
56
- get-unthemable-tokens(),
57
- map.merge(
56
+ @return sass-utils.deep-merge-all(
57
+ get-unthemable-tokens(),
58
58
  get-color-tokens(token-utils.$placeholder-color-config),
59
- map.merge(
60
- get-typography-tokens(token-utils.$placeholder-typography-config),
61
- get-density-tokens(token-utils.$placeholder-density-config)
62
- )
63
- )
59
+ get-typography-tokens(token-utils.$placeholder-typography-config),
60
+ get-density-tokens(token-utils.$placeholder-density-config)
64
61
  );
65
62
  }
@@ -2,6 +2,7 @@
2
2
  @use '../../../theming/theming';
3
3
  @use '../../../typography/typography-utils';
4
4
  @use '../../../mdc-helpers/mdc-helpers';
5
+ @use '../../../style/sass-utils';
5
6
  @use '../../token-utils';
6
7
 
7
8
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -21,7 +22,6 @@ $prefix: (mdc, dialog);
21
22
  container-shadow-color: #000,
22
23
  // Border radius of the container.
23
24
  container-shape: 4px,
24
-
25
25
  // =============================================================================================
26
26
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
27
27
  // =============================================================================================
@@ -87,7 +87,6 @@ $prefix: (mdc, dialog);
87
87
  subhead-size: typography-utils.font-size($config, headline-6),
88
88
  subhead-weight: typography-utils.font-weight($config, headline-6),
89
89
  subhead-tracking: typography-utils.letter-spacing($config, headline-6),
90
-
91
90
  // Typography of the dialog body text.
92
91
  supporting-text-font: typography-utils.font-family($config, body-1)
93
92
  or typography-utils.font-family($config),
@@ -106,10 +105,10 @@ $prefix: (mdc, dialog);
106
105
  // Combines the tokens generated by the above functions into a single map with placeholder values.
107
106
  // This is used to create token slots.
108
107
  @function get-token-slots() {
109
- @return token-utils.merge-all(
110
- get-unthemable-tokens(),
111
- get-color-tokens(token-utils.$placeholder-color-config),
112
- get-typography-tokens(token-utils.$placeholder-typography-config),
113
- get-density-tokens(token-utils.$placeholder-density-config)
108
+ @return sass-utils.deep-merge-all(
109
+ get-unthemable-tokens(),
110
+ get-color-tokens(token-utils.$placeholder-color-config),
111
+ get-typography-tokens(token-utils.$placeholder-typography-config),
112
+ get-density-tokens(token-utils.$placeholder-density-config)
114
113
  );
115
114
  }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use '../../../style/elevation';
3
3
  @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
4
5
  @use '../../token-utils';
5
6
 
6
7
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -74,7 +75,7 @@ $prefix: (mdc, elevated-card);
74
75
  // Combines the tokens generated by the above functions into a single map with placeholder values.
75
76
  // This is used to create token slots.
76
77
  @function get-token-slots() {
77
- @return token-utils.merge-all(
78
+ @return sass-utils.deep-merge-all(
78
79
  get-unthemable-tokens(),
79
80
  get-color-tokens(token-utils.$placeholder-color-config),
80
81
  get-typography-tokens(token-utils.$placeholder-typography-config),
@@ -1,4 +1,4 @@
1
- @use 'sass:map';
1
+ @use '../../../style/sass-utils';
2
2
  @use '../../token-utils';
3
3
 
4
4
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -18,18 +18,14 @@ $prefix: (mdc, icon-button);
18
18
  // Determines the size of the icon. Name is inaccurate - applies to the whole component,
19
19
  // not just the state layer.
20
20
  state-layer-size: 48px,
21
-
22
21
  // MDC's icon size applied to svg and img elements inside the component
23
22
  icon-size: 24px,
24
-
25
23
  // Only applies to :disabled icons, but Angular Components uses [disabled] since :disabled
26
24
  // wouldn't work on <a> tags.
27
25
  disabled-icon-color: black,
28
-
29
26
  // Angular version applies an opacity 1 with a color change, and this only applies with
30
27
  // :disabled anyways.
31
28
  disabled-icon-opacity: 0.38,
32
-
33
29
  // =============================================================================================
34
30
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
35
31
  // =============================================================================================
@@ -66,14 +62,10 @@ $prefix: (mdc, icon-button);
66
62
  // Combines the tokens generated by the above functions into a single map with placeholder values.
67
63
  // This is used to create token slots.
68
64
  @function get-token-slots() {
69
- @return map.merge(
65
+ @return sass-utils.deep-merge-all(
70
66
  get-unthemable-tokens(),
71
- map.merge(
72
- get-color-tokens(token-utils.$placeholder-color-config),
73
- map.merge(
74
- get-typography-tokens(token-utils.$placeholder-typography-config),
75
- get-density-tokens(token-utils.$placeholder-density-config)
76
- )
77
- )
67
+ get-color-tokens(token-utils.$placeholder-color-config),
68
+ get-typography-tokens(token-utils.$placeholder-typography-config),
69
+ get-density-tokens(token-utils.$placeholder-density-config)
78
70
  );
79
71
  }