@angular/material 17.0.0-next.0 → 17.0.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 (204) hide show
  1. package/_index.scss +3 -4
  2. package/autocomplete/_autocomplete-theme.scss +12 -18
  3. package/autocomplete/index.d.ts +15 -24
  4. package/badge/_badge-theme.scss +15 -27
  5. package/badge/index.d.ts +9 -17
  6. package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
  7. package/button/_button-base.scss +3 -3
  8. package/button/_button-theme-private.scss +3 -2
  9. package/button/_button-theme.scss +18 -25
  10. package/button/_fab-theme.scss +31 -49
  11. package/button/_icon-button-theme.scss +19 -26
  12. package/button/index.d.ts +22 -31
  13. package/button-toggle/_button-toggle-theme.scss +17 -28
  14. package/button-toggle/index.d.ts +15 -18
  15. package/card/_card-theme.scss +27 -38
  16. package/checkbox/_checkbox-theme.scss +28 -45
  17. package/checkbox/index.d.ts +21 -27
  18. package/chips/_chips-theme.scss +18 -56
  19. package/core/_core-theme.scss +24 -39
  20. package/core/color/_all-color.scss +7 -15
  21. package/core/density/private/_all-density.scss +34 -39
  22. package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
  23. package/core/focus-indicators/_private.scss +22 -26
  24. package/core/index.d.ts +7 -11
  25. package/core/mdc-helpers/_mdc-helpers.scss +19 -22
  26. package/core/option/_optgroup-theme.scss +13 -23
  27. package/core/option/_option-theme.scss +23 -37
  28. package/core/ripple/_ripple-theme.scss +6 -10
  29. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +17 -24
  30. package/core/style/_form-common.scss +7 -7
  31. package/core/style/_private.scss +5 -7
  32. package/core/style/_sass-utils.scss +7 -0
  33. package/core/testing/index.d.ts +2 -1
  34. package/core/theming/_all-theme.scss +41 -41
  35. package/core/theming/_inspection.scss +133 -59
  36. package/core/theming/_m2-inspection.scss +268 -0
  37. package/core/theming/_theming.scss +59 -20
  38. package/core/tokens/m2/mat/_autocomplete.scss +5 -8
  39. package/core/tokens/m2/mat/_badge.scss +12 -15
  40. package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
  41. package/core/tokens/m2/mat/_card.scss +15 -21
  42. package/core/tokens/m2/mat/_datepicker.scss +28 -38
  43. package/core/tokens/m2/mat/_divider.scss +5 -8
  44. package/core/tokens/m2/mat/_expansion.scss +24 -28
  45. package/core/tokens/m2/mat/_form-field.scss +21 -25
  46. package/core/tokens/m2/mat/_grid-list.scss +8 -8
  47. package/core/tokens/m2/mat/_icon.scss +3 -3
  48. package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
  49. package/core/tokens/m2/mat/_menu.scss +12 -17
  50. package/core/tokens/m2/mat/_optgroup.scss +12 -17
  51. package/core/tokens/m2/mat/_option.scss +16 -28
  52. package/core/tokens/m2/mat/_paginator.scss +16 -18
  53. package/core/tokens/m2/mat/_radio.scss +7 -10
  54. package/core/tokens/m2/mat/_select.scss +15 -29
  55. package/core/tokens/m2/mat/_sidenav.scss +12 -14
  56. package/core/tokens/m2/mat/_slide-toggle.scss +9 -17
  57. package/core/tokens/m2/mat/_slider.scss +5 -5
  58. package/core/tokens/m2/mat/_snack-bar.scss +7 -8
  59. package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
  60. package/core/tokens/m2/mat/_stepper.scss +30 -33
  61. package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
  62. package/core/tokens/m2/mat/_tab-header.scss +13 -18
  63. package/core/tokens/m2/mat/_table.scss +19 -23
  64. package/core/tokens/m2/mat/_toolbar.scss +12 -16
  65. package/core/tokens/m2/mdc/_checkbox.scss +21 -20
  66. package/core/tokens/m2/mdc/_chip.scss +38 -24
  67. package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
  68. package/core/tokens/m2/mdc/_dialog.scss +16 -30
  69. package/core/tokens/m2/mdc/_elevated-card.scss +6 -9
  70. package/core/tokens/m2/mdc/_extended-fab.scss +8 -17
  71. package/core/tokens/m2/mdc/_fab.scss +6 -7
  72. package/core/tokens/m2/mdc/_filled-text-field.scss +16 -22
  73. package/core/tokens/m2/mdc/_icon-button.scss +3 -3
  74. package/core/tokens/m2/mdc/_linear-progress.scss +9 -10
  75. package/core/tokens/m2/mdc/_list.scss +44 -42
  76. package/core/tokens/m2/mdc/_outlined-card.scss +7 -10
  77. package/core/tokens/m2/mdc/_outlined-text-field.scss +14 -20
  78. package/core/tokens/m2/mdc/_plain-tooltip.scss +9 -22
  79. package/core/tokens/m2/mdc/_radio.scss +11 -11
  80. package/core/tokens/m2/mdc/_slider.scss +16 -23
  81. package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
  82. package/core/tokens/m2/mdc/_switch.scss +16 -19
  83. package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
  84. package/core/tokens/m2/mdc/_tab.scss +5 -4
  85. package/core/typography/_all-typography.scss +44 -47
  86. package/core/typography/_definition.scss +258 -0
  87. package/core/typography/_property-getters.scss +63 -0
  88. package/core/typography/_typography-utils.scss +9 -69
  89. package/core/typography/_typography.scss +38 -494
  90. package/core/typography/_versioning.scss +91 -0
  91. package/datepicker/_datepicker-theme.scss +20 -34
  92. package/datepicker/index.d.ts +3 -3
  93. package/dialog/_dialog-theme.scss +22 -23
  94. package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
  95. package/dialog/index.d.ts +2 -0
  96. package/divider/_divider-theme.scss +12 -18
  97. package/esm2022/autocomplete/autocomplete-trigger.mjs +5 -17
  98. package/esm2022/autocomplete/autocomplete.mjs +23 -50
  99. package/esm2022/badge/badge.mjs +11 -29
  100. package/esm2022/button/button-base.mjs +32 -27
  101. package/esm2022/button/button.mjs +6 -6
  102. package/esm2022/button/fab.mjs +23 -31
  103. package/esm2022/button/icon-button.mjs +6 -6
  104. package/esm2022/button/testing/button-harness.mjs +3 -3
  105. package/esm2022/button-toggle/button-toggle.mjs +25 -33
  106. package/esm2022/checkbox/checkbox.mjs +32 -39
  107. package/esm2022/core/option/optgroup.mjs +10 -11
  108. package/esm2022/core/option/option.mjs +6 -6
  109. package/esm2022/core/testing/option-harness.mjs +3 -3
  110. package/esm2022/core/version.mjs +1 -1
  111. package/esm2022/datepicker/calendar.mjs +1 -1
  112. package/esm2022/datepicker/datepicker-base.mjs +2 -2
  113. package/esm2022/datepicker/datepicker-toggle.mjs +1 -1
  114. package/esm2022/datepicker/month-view.mjs +2 -2
  115. package/esm2022/datepicker/multi-year-view.mjs +2 -2
  116. package/esm2022/datepicker/year-view.mjs +2 -2
  117. package/esm2022/dialog/dialog-container.mjs +16 -3
  118. package/esm2022/form-field/form-field.mjs +3 -3
  119. package/esm2022/menu/menu-item.mjs +15 -11
  120. package/esm2022/menu/menu.mjs +9 -22
  121. package/esm2022/paginator/paginator.mjs +1 -1
  122. package/esm2022/select/select.mjs +3 -3
  123. package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
  124. package/esm2022/slider/slider-input.mjs +19 -9
  125. package/esm2022/slider/slider.mjs +2 -2
  126. package/esm2022/snack-bar/simple-snack-bar.mjs +1 -1
  127. package/esm2022/tabs/tab-group.mjs +3 -3
  128. package/expansion/_expansion-theme.scss +16 -24
  129. package/fesm2022/autocomplete.mjs +25 -63
  130. package/fesm2022/autocomplete.mjs.map +1 -1
  131. package/fesm2022/badge.mjs +11 -28
  132. package/fesm2022/badge.mjs.map +1 -1
  133. package/fesm2022/button/testing.mjs +2 -2
  134. package/fesm2022/button/testing.mjs.map +1 -1
  135. package/fesm2022/button-toggle.mjs +25 -32
  136. package/fesm2022/button-toggle.mjs.map +1 -1
  137. package/fesm2022/button.mjs +59 -61
  138. package/fesm2022/button.mjs.map +1 -1
  139. package/fesm2022/checkbox.mjs +31 -38
  140. package/fesm2022/checkbox.mjs.map +1 -1
  141. package/fesm2022/core/testing.mjs +2 -2
  142. package/fesm2022/core/testing.mjs.map +1 -1
  143. package/fesm2022/core.mjs +14 -13
  144. package/fesm2022/core.mjs.map +1 -1
  145. package/fesm2022/datepicker.mjs +6 -6
  146. package/fesm2022/datepicker.mjs.map +1 -1
  147. package/fesm2022/dialog.mjs +15 -2
  148. package/fesm2022/dialog.mjs.map +1 -1
  149. package/fesm2022/form-field.mjs +2 -2
  150. package/fesm2022/form-field.mjs.map +1 -1
  151. package/fesm2022/menu.mjs +23 -31
  152. package/fesm2022/menu.mjs.map +1 -1
  153. package/fesm2022/paginator.mjs +1 -1
  154. package/fesm2022/paginator.mjs.map +1 -1
  155. package/fesm2022/select.mjs +2 -2
  156. package/fesm2022/select.mjs.map +1 -1
  157. package/fesm2022/slide-toggle.mjs +33 -36
  158. package/fesm2022/slide-toggle.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +20 -10
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar.mjs +1 -1
  162. package/fesm2022/snack-bar.mjs.map +1 -1
  163. package/fesm2022/tabs.mjs +2 -2
  164. package/fesm2022/tabs.mjs.map +1 -1
  165. package/form-field/_form-field-density.scss +3 -4
  166. package/form-field/_form-field-focus-overlay.scss +1 -1
  167. package/form-field/_form-field-sizing.scss +1 -1
  168. package/form-field/_form-field-theme.scss +24 -34
  169. package/grid-list/_grid-list-theme.scss +12 -19
  170. package/icon/_icon-theme.scss +17 -25
  171. package/input/_input-theme.scss +11 -23
  172. package/list/_list-theme.scss +27 -42
  173. package/menu/_menu-theme.scss +13 -22
  174. package/menu/index.d.ts +12 -18
  175. package/package.json +2 -2
  176. package/paginator/_paginator-theme.scss +15 -24
  177. package/prebuilt-themes/deeppurple-amber.css +1 -1
  178. package/prebuilt-themes/indigo-pink.css +1 -1
  179. package/prebuilt-themes/pink-bluegrey.css +1 -1
  180. package/prebuilt-themes/purple-green.css +1 -1
  181. package/progress-bar/_progress-bar-theme.scss +17 -24
  182. package/progress-spinner/_progress-spinner-theme.scss +18 -24
  183. package/radio/_radio-theme.scss +23 -38
  184. package/schematics/ng-add/index.js +1 -1
  185. package/schematics/ng-add/index.mjs +1 -1
  186. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  187. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  188. package/schematics/ng-update/index_bundled.js +25 -25
  189. package/select/_select-theme.scss +17 -31
  190. package/sidenav/_sidenav-theme.scss +12 -18
  191. package/slide-toggle/_slide-toggle-theme.scss +23 -40
  192. package/slide-toggle/index.d.ts +20 -23
  193. package/slider/_slider-theme.scss +25 -42
  194. package/snack-bar/_snack-bar-theme.scss +17 -26
  195. package/sort/_sort-theme.scss +13 -22
  196. package/stepper/_stepper-theme.scss +16 -34
  197. package/table/_table-theme.scss +14 -25
  198. package/tabs/_tabs-theme.scss +31 -45
  199. package/toolbar/_toolbar-theme.scss +22 -31
  200. package/tooltip/_tooltip-theme.scss +15 -23
  201. package/tree/_tree-theme.scss +20 -29
  202. package/button-toggle/_button-toggle-variables.scss +0 -16
  203. package/core/typography/_typography-deprecated.scss +0 -39
  204. package/paginator/_paginator-variables.scss +0 -15
@@ -1,4 +1,4 @@
1
- @use '../../theming/theming';
1
+ @use '../../theming/inspection';
2
2
  @use '../../../button/button-theme';
3
3
  @use '../../../button/icon-button-theme';
4
4
  @use '../../../button/fab-theme';
@@ -30,13 +30,8 @@
30
30
  @use '../../../table/table-theme';
31
31
 
32
32
  // Includes all of the density styles.
33
- @mixin all-component-densities($config-or-theme) {
34
- // In case a theme object has been passed instead of a configuration for
35
- // the density system, extract the density config from the theme object.
36
- $config: if(theming.private-is-theme-object($config-or-theme),
37
- theming.get-density-config($config-or-theme), $config-or-theme);
38
-
39
- @if $config == null {
33
+ @mixin all-component-densities($theme) {
34
+ @if not inspection.theme-has($theme, density) {
40
35
  @error 'No density configuration specified.';
41
36
  }
42
37
 
@@ -45,39 +40,39 @@
45
40
  // not possible as it would introduce a circular dependency for density because the `mat-core`
46
41
  // mixin that is transitively loaded by the `all-theme` file, imports `all-density` which
47
42
  // would then load `all-theme` again. This ultimately results a circular dependency.
48
- @include form-field-theme.density($config);
49
- @include card-theme.density($config);
50
- @include progress-bar-theme.density($config);
51
- @include progress-spinner-theme.density($config);
52
- @include tooltip-theme.density($config);
53
- @include input-theme.density($config);
54
- @include core-theme.density($config);
55
- @include select-theme.density($config);
56
- @include checkbox-theme.density($config);
57
- @include autocomplete-theme.density($config);
58
- @include dialog-theme.density($config);
59
- @include chips-theme.density($config);
60
- @include slide-toggle-theme.density($config);
61
- @include radio-theme.density($config);
62
- @include slider-theme.density($config);
63
- @include menu-theme.density($config);
64
- @include list-theme.density($config);
65
- @include paginator-theme.density($config);
66
- @include tabs-theme.density($config);
67
- @include snack-bar-theme.density($config);
68
- @include button-theme.density($config);
69
- @include icon-button-theme.density($config);
70
- @include fab-theme.density($config);
71
- @include table-theme.density($config);
72
- @include expansion-theme.density($config);
73
- @include stepper-theme.density($config);
74
- @include toolbar-theme.density($config);
75
- @include tree-theme.density($config);
76
- @include button-toggle-theme.density($config);
43
+ @include form-field-theme.density($theme);
44
+ @include card-theme.density($theme);
45
+ @include progress-bar-theme.density($theme);
46
+ @include progress-spinner-theme.density($theme);
47
+ @include tooltip-theme.density($theme);
48
+ @include input-theme.density($theme);
49
+ @include core-theme.density($theme);
50
+ @include select-theme.density($theme);
51
+ @include checkbox-theme.density($theme);
52
+ @include autocomplete-theme.density($theme);
53
+ @include dialog-theme.density($theme);
54
+ @include chips-theme.density($theme);
55
+ @include slide-toggle-theme.density($theme);
56
+ @include radio-theme.density($theme);
57
+ @include slider-theme.density($theme);
58
+ @include menu-theme.density($theme);
59
+ @include list-theme.density($theme);
60
+ @include paginator-theme.density($theme);
61
+ @include tabs-theme.density($theme);
62
+ @include snack-bar-theme.density($theme);
63
+ @include button-theme.density($theme);
64
+ @include icon-button-theme.density($theme);
65
+ @include fab-theme.density($theme);
66
+ @include table-theme.density($theme);
67
+ @include expansion-theme.density($theme);
68
+ @include stepper-theme.density($theme);
69
+ @include toolbar-theme.density($theme);
70
+ @include tree-theme.density($theme);
71
+ @include button-toggle-theme.density($theme);
77
72
  }
78
73
 
79
74
 
80
75
  // @deprecated Use `all-component-densities`.
81
- @mixin angular-material-density($config-or-theme) {
82
- @include all-component-densities($config-or-theme);
76
+ @mixin angular-material-density($theme) {
77
+ @include all-component-densities($theme);
83
78
  }
@@ -1,13 +1,11 @@
1
1
  @use './private';
2
2
 
3
- // stylelint-disable-next-line material/theme-mixin-api
4
- @mixin color($config-or-theme-or-color) {
5
- @include private.strong-focus-indicators-color($config-or-theme-or-color);
6
- @include private.mdc-strong-focus-indicators-color($config-or-theme-or-color);
3
+ @mixin color($theme) {
4
+ @include private.strong-focus-indicators-color($theme);
5
+ @include private.mdc-strong-focus-indicators-color($theme);
7
6
  }
8
7
 
9
- // stylelint-disable-next-line material/theme-mixin-api
10
- @mixin theme($theme-or-color-config-or-color) {
11
- @include private.strong-focus-indicators-theme($theme-or-color-config-or-color);
12
- @include private.mdc-strong-focus-indicators-theme($theme-or-color-config-or-color);
8
+ @mixin theme($theme) {
9
+ @include private.strong-focus-indicators-theme($theme);
10
+ @include private.mdc-strong-focus-indicators-theme($theme);
13
11
  }
@@ -3,6 +3,7 @@
3
3
  @use '@angular/cdk';
4
4
  @use '../style/layout-common';
5
5
  @use '../theming/theming';
6
+ @use '../theming/inspection';
6
7
 
7
8
  // Private sass variables that will be used as reference throughout component stylesheets.
8
9
  $default-border-width: 3px;
@@ -113,65 +114,60 @@ $default-border-radius: 4px;
113
114
  @include customize-focus-indicators($config, 'mat-mdc');
114
115
  }
115
116
 
116
- @mixin strong-focus-indicators-color($config-or-theme-or-color) {
117
- @if meta.type-of($config-or-theme-or-color) == 'color' {
117
+ @mixin strong-focus-indicators-color($theme-or-color) {
118
+ @if meta.type-of($theme-or-color) == 'color' {
118
119
  @include customize-focus-indicators((
119
- border-color: $config-or-theme-or-color
120
+ border-color: $theme-or-color
120
121
  ), 'mat');
121
122
  }
122
123
  @else {
123
- $config: theming.get-color-config($config-or-theme-or-color);
124
- $border-color: theming.get-color-from-palette(map.get($config, primary));
124
+ $border-color: inspection.get-theme-color($theme-or-color, primary);
125
125
  @include customize-focus-indicators((
126
126
  border-color: $border-color
127
127
  ), 'mat');
128
128
  }
129
129
  }
130
130
 
131
- @mixin strong-focus-indicators-theme($theme-or-color-config-or-color) {
132
- @if meta.type-of($theme-or-color-config-or-color) == 'color' {
131
+ @mixin strong-focus-indicators-theme($theme-or-color) {
132
+ @if meta.type-of($theme-or-color) == 'color' {
133
133
  @include customize-focus-indicators((
134
- border-color: $theme-or-color-config-or-color
134
+ border-color: $theme-or-color
135
135
  ), 'mat');
136
136
  }
137
137
  @else {
138
- $theme: theming.private-legacy-get-theme($theme-or-color-config-or-color);
139
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-focus-indicators') {
140
- $color: theming.get-color-config($theme);
141
- @if $color != null {
142
- @include strong-focus-indicators-color($color);
138
+ @include theming.private-check-duplicate-theme-styles($theme-or-color, 'mat-focus-indicators') {
139
+ @if inspection.theme-has($theme-or-color, color) {
140
+ @include strong-focus-indicators-color($theme-or-color);
143
141
  }
144
142
  }
145
143
  }
146
144
  }
147
145
 
148
- @mixin mdc-strong-focus-indicators-color($config-or-theme-or-color) {
149
- @if meta.type-of($config-or-theme-or-color) == 'color' {
146
+ @mixin mdc-strong-focus-indicators-color($theme-or-color) {
147
+ @if meta.type-of($theme-or-color) == 'color' {
150
148
  @include customize-focus-indicators((
151
- border-color: $config-or-theme-or-color
149
+ border-color: $theme-or-color
152
150
  ), 'mat-mdc');
153
151
  }
154
152
  @else {
155
- $config: theming.get-color-config($config-or-theme-or-color);
156
- $border-color: theming.get-color-from-palette(map.get($config, primary));
153
+ $border-color: inspection.get-theme-color($theme-or-color, primary);
157
154
  @include customize-focus-indicators((
158
155
  border-color: $border-color
159
156
  ), 'mat-mdc');
160
157
  }
161
158
  }
162
159
 
163
- @mixin mdc-strong-focus-indicators-theme($theme-or-color-config-or-color) {
164
- @if meta.type-of($theme-or-color-config-or-color) == 'color' {
160
+ @mixin mdc-strong-focus-indicators-theme($theme-or-color) {
161
+ @if meta.type-of($theme-or-color) == 'color' {
165
162
  @include customize-focus-indicators((
166
- border-color: $theme-or-color-config-or-color
163
+ border-color: $theme-or-color
167
164
  ), 'mat-mdc');
168
165
  }
169
166
  @else {
170
- $theme: theming.private-legacy-get-theme($theme-or-color-config-or-color);
171
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-focus-indicators') {
172
- $color: theming.get-color-config($theme);
173
- @if $color != null {
174
- @include mdc-strong-focus-indicators-color($color);
167
+ @include theming.private-check-duplicate-theme-styles(
168
+ $theme-or-color, 'mat-mdc-focus-indicators') {
169
+ @if inspection.theme-has($theme-or-color, color) {
170
+ @include mdc-strong-focus-indicators-color($theme-or-color);
175
171
  }
176
172
  }
177
173
  }
package/core/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import { _AbstractConstructor as _AbstractConstructor_2 } from '@angular/material/core';
2
1
  import { AbstractControl } from '@angular/forms';
3
2
  import { AfterViewChecked } from '@angular/core';
4
- import { BooleanInput } from '@angular/cdk/coercion';
5
3
  import { ChangeDetectorRef } from '@angular/core';
6
- import { _Constructor as _Constructor_2 } from '@angular/material/core';
7
4
  import { ElementRef } from '@angular/core';
8
5
  import { EventEmitter } from '@angular/core';
9
6
  import { FocusableOption } from '@angular/cdk/a11y';
@@ -529,23 +526,21 @@ export declare class MatNativeDateModule {
529
526
  /**
530
527
  * Component that is used to group instances of `mat-option`.
531
528
  */
532
- export declare class MatOptgroup extends _MatOptgroupMixinBase implements CanDisable {
529
+ export declare class MatOptgroup {
533
530
  /** Label for the option group. */
534
531
  label: string;
532
+ /** whether the option group is disabled. */
533
+ disabled: boolean;
535
534
  /** Unique id for the underlying label. */
536
535
  _labelId: string;
537
536
  /** Whether the group is in inert a11y mode. */
538
537
  _inert: boolean;
539
538
  constructor(parent?: MatOptionParentComponent);
540
539
  static ɵfac: i0.ɵɵFactoryDeclaration<MatOptgroup, [{ optional: true; }]>;
541
- static ɵcmp: i0.ɵɵComponentDeclaration<MatOptgroup, "mat-optgroup", ["matOptgroup"], { "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, {}, never, ["*", "mat-option, ng-container"], false, never>;
540
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatOptgroup, "mat-optgroup", ["matOptgroup"], { "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, ["*", "mat-option, ng-container"], false, never>;
541
+ static ngAcceptInputType_disabled: unknown;
542
542
  }
543
543
 
544
- /** @docs-private */
545
- declare const _MatOptgroupMixinBase: _Constructor_2<CanDisable> & _AbstractConstructor_2<CanDisable> & {
546
- new (): {};
547
- };
548
-
549
544
  /**
550
545
  * Single option inside of a `<mat-select>` element.
551
546
  */
@@ -568,7 +563,7 @@ export declare class MatOption<T = any> implements FocusableOption, AfterViewChe
568
563
  id: string;
569
564
  /** Whether the option is disabled. */
570
565
  get disabled(): boolean;
571
- set disabled(value: BooleanInput);
566
+ set disabled(value: boolean);
572
567
  /** Whether ripples for the option are disabled. */
573
568
  get disableRipple(): boolean;
574
569
  /** Whether to display checkmark for single-selection. */
@@ -629,6 +624,7 @@ export declare class MatOption<T = any> implements FocusableOption, AfterViewChe
629
624
  private _emitSelectionChangeEvent;
630
625
  static ɵfac: i0.ɵɵFactoryDeclaration<MatOption<any>, [null, null, { optional: true; }, { optional: true; }]>;
631
626
  static ɵcmp: i0.ɵɵComponentDeclaration<MatOption<any>, "mat-option", ["matOption"], { "value": { "alias": "value"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onSelectionChange": "onSelectionChange"; }, never, ["mat-icon", "*"], false, never>;
627
+ static ngAcceptInputType_disabled: unknown;
632
628
  }
633
629
 
634
630
  export declare class MatOptionModule {
@@ -1,9 +1,7 @@
1
1
  // TODO(mmalerba): this file should be split into separate cohesive partials for things like
2
2
  // "theming", "typography", "core".
3
-
4
- @use '../theming/theming';
3
+ @use '../theming/inspection';
5
4
  @use '../typography/typography';
6
- @use '../typography/typography-utils';
7
5
  @use '@material/feature-targeting' as mdc-feature-targeting;
8
6
  @use '@material/typography' as mdc-typography;
9
7
  @use '@material/theme/theme-color' as mdc-theme-color;
@@ -36,7 +34,7 @@ $mat-typography-mdc-level-mappings: (
36
34
  );
37
35
 
38
36
  // Converts an Angular Material typography level config to an MDC one.
39
- @function typography-level-config-to-mdc($mat-config, $mat-level) {
37
+ @function typography-level-config-to-mdc($theme, $mat-level) {
40
38
  $mdc-level: map.get($mat-typography-mdc-level-mappings, $mat-level);
41
39
 
42
40
  $result-with-nulls: map.merge(
@@ -49,11 +47,11 @@ $mat-typography-mdc-level-mappings: (
49
47
  )),
50
48
  if($mat-level,
51
49
  (
52
- font-size: typography-utils.font-size($mat-config, $mat-level),
53
- line-height: typography-utils.line-height($mat-config, $mat-level),
54
- font-weight: typography-utils.font-weight($mat-config, $mat-level),
55
- letter-spacing: typography-utils.letter-spacing($mat-config, $mat-level),
56
- font-family: typography-utils.font-family($mat-config, $mat-level),
50
+ font-size: inspection.get-theme-typography($theme, $mat-level, font-size),
51
+ line-height: inspection.get-theme-typography($theme, $mat-level, line-height),
52
+ font-weight: inspection.get-theme-typography($theme, $mat-level, font-weight),
53
+ letter-spacing: inspection.get-theme-typography($theme, $mat-level, letter-spacing),
54
+ font-family: inspection.get-theme-typography($theme, $mat-level, font-family),
57
55
  // Angular Material doesn't use text-transform, so disable it.
58
56
  text-transform: none,
59
57
  ),
@@ -71,13 +69,13 @@ $mat-typography-mdc-level-mappings: (
71
69
  }
72
70
 
73
71
  // Converts an Angular Material typography config to an MDC one.
74
- @function typography-config-to-mdc($mat-config) {
72
+ @function typography-config-to-mdc($theme) {
75
73
  $mdc-config: ();
76
74
 
77
75
  @each $mat-level, $mdc-level in $mat-typography-mdc-level-mappings {
78
76
  $mdc-config: map.merge(
79
77
  $mdc-config,
80
- ($mdc-level: typography-level-config-to-mdc($mat-config, $mat-level)));
78
+ ($mdc-level: typography-level-config-to-mdc($theme, $mat-level)));
81
79
  }
82
80
 
83
81
  @return $mdc-config;
@@ -100,12 +98,11 @@ $mat-typography-mdc-level-mappings: (
100
98
 
101
99
  // Configures MDC's global variables to reflect the given theme, applies the given styles,
102
100
  // then resets the global variables to prevent unintended side effects.
103
- @mixin using-mdc-theme($config) {
104
- $primary: theming.get-color-from-palette(map.get($config, primary));
105
- $accent: theming.get-color-from-palette(map.get($config, accent));
106
- $warn: theming.get-color-from-palette(map.get($config, warn));
107
- $background-palette: map.get($config, background);
108
- $is-dark: map.get($config, is-dark);
101
+ @mixin using-mdc-theme($theme) {
102
+ $primary: inspection.get-theme-color($theme, primary);
103
+ $accent: inspection.get-theme-color($theme, accent);
104
+ $warn: inspection.get-theme-color($theme, warn);
105
+ $is-dark: inspection.get-theme-type($theme) == dark;
109
106
 
110
107
  // Save the original values.
111
108
  $orig-primary: mdc-theme-color.$primary;
@@ -126,8 +123,8 @@ $mat-typography-mdc-level-mappings: (
126
123
  mdc-theme-color.$secondary: $accent;
127
124
  mdc-theme-color.$on-secondary:
128
125
  if(variable-safe-contrast-tone(mdc-theme-color.$secondary, $is-dark) == 'dark', #000, #fff);
129
- mdc-theme-color.$background: theming.get-color-from-palette($background-palette, background);
130
- mdc-theme-color.$surface: theming.get-color-from-palette($background-palette, card);
126
+ mdc-theme-color.$background: inspection.get-theme-color($theme, background, background);
127
+ mdc-theme-color.$surface: inspection.get-theme-color($theme, background, card);
131
128
  mdc-theme-color.$on-surface:
132
129
  if(variable-safe-contrast-tone(mdc-theme-color.$surface, $is-dark) == 'dark', #000, #fff);
133
130
  mdc-theme-color.$error: $warn;
@@ -193,13 +190,13 @@ $mat-typography-mdc-level-mappings: (
193
190
 
194
191
  // Configures MDC's global variables to reflect the given typography config,
195
192
  // applies the given styles, then resets the global variables to prevent unintended side effects.
196
- @mixin using-mdc-typography($config) {
193
+ @mixin using-mdc-typography($theme) {
197
194
  // Save the original values.
198
195
  $orig-mdc-typography-styles: mdc-typography.$styles;
199
196
 
200
197
  // Set new values based on the given Angular Material typography configuration.
201
- @if $config {
202
- mdc-typography.$styles: typography-config-to-mdc($config);
198
+ @if inspection.theme-has($theme, typography) {
199
+ mdc-typography.$styles: typography-config-to-mdc($theme);
203
200
  }
204
201
 
205
202
  // Apply given rules.
@@ -3,46 +3,36 @@
3
3
  @use '../style/sass-utils';
4
4
 
5
5
  @use '../theming/theming';
6
+ @use '../theming/inspection';
6
7
  @use '../typography/typography';
7
8
 
8
- @mixin color($config-or-theme) {
9
- $config: theming.get-color-config($config-or-theme);
10
-
9
+ @mixin color($theme) {
11
10
  @include sass-utils.current-selector-or-root() {
12
11
  @include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
13
- tokens-mat-optgroup.get-color-tokens($config));
12
+ tokens-mat-optgroup.get-color-tokens($theme));
14
13
  }
15
14
  }
16
15
 
17
- @mixin typography($config-or-theme) {
18
- $config: typography.private-typography-to-2018-config(
19
- theming.get-typography-config($config-or-theme));
20
-
16
+ @mixin typography($theme) {
21
17
  @include sass-utils.current-selector-or-root() {
22
18
  @include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
23
- tokens-mat-optgroup.get-typography-tokens($config));
19
+ tokens-mat-optgroup.get-typography-tokens($theme));
24
20
  }
25
21
  }
26
22
 
27
- @mixin density($config-or-theme) {
28
- $density-scale: theming.get-density-config($config-or-theme);
23
+ @mixin density($theme) {
29
24
  }
30
25
 
31
- @mixin theme($theme-or-color-config) {
32
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
26
+ @mixin theme($theme) {
33
27
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-optgroup') {
34
- $color: theming.get-color-config($theme);
35
- $density: theming.get-density-config($theme);
36
- $typography: theming.get-typography-config($theme);
37
-
38
- @if $color != null {
39
- @include color($color);
28
+ @if inspection.theme-has($theme, color) {
29
+ @include color($theme);
40
30
  }
41
- @if $density != null {
42
- @include density($density);
31
+ @if inspection.theme-has($theme, density) {
32
+ @include density($theme);
43
33
  }
44
- @if $typography != null {
45
- @include typography($typography);
34
+ @if inspection.theme-has($theme, typography) {
35
+ @include typography($theme);
46
36
  }
47
37
  }
48
38
  }
@@ -1,62 +1,48 @@
1
- @use 'sass:map';
2
1
  @use '../tokens/m2/mat/option' as tokens-mat-option;
3
2
  @use '../tokens/token-utils';
4
3
  @use '../style/sass-utils';
5
4
 
6
5
  @use '../theming/theming';
6
+ @use '../theming/inspection';
7
7
  @use '../typography/typography';
8
- @use '../mdc-helpers/mdc-helpers';
9
8
 
10
- @mixin color($config-or-theme) {
11
- $config: theming.get-color-config($config-or-theme);
12
-
13
- @include mdc-helpers.using-mdc-theme($config) {
14
- @include sass-utils.current-selector-or-root() {
15
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
16
- tokens-mat-option.get-color-tokens($config));
17
- }
9
+ @mixin color($theme) {
10
+ @include sass-utils.current-selector-or-root() {
11
+ @include token-utils.create-token-values(tokens-mat-option.$prefix,
12
+ tokens-mat-option.get-color-tokens($theme));
13
+ }
18
14
 
19
- .mat-accent {
20
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
21
- tokens-mat-option.private-get-color-palette-color-tokens(map.get($config, accent)));
22
- }
15
+ .mat-accent {
16
+ @include token-utils.create-token-values(tokens-mat-option.$prefix,
17
+ tokens-mat-option.get-color-tokens($theme, accent));
18
+ }
23
19
 
24
- .mat-warn {
25
- @include token-utils.create-token-values(tokens-mat-option.$prefix,
26
- tokens-mat-option.private-get-color-palette-color-tokens(map.get($config, warn)));
27
- }
20
+ .mat-warn {
21
+ @include token-utils.create-token-values(tokens-mat-option.$prefix,
22
+ tokens-mat-option.get-color-tokens($theme, warn));
28
23
  }
29
24
  }
30
25
 
31
- @mixin typography($config-or-theme) {
32
- $config: typography.private-typography-to-2018-config(
33
- theming.get-typography-config($config-or-theme));
34
-
26
+ @mixin typography($theme) {
35
27
  @include sass-utils.current-selector-or-root() {
36
28
  @include token-utils.create-token-values(tokens-mat-option.$prefix,
37
- tokens-mat-option.get-typography-tokens($config));
29
+ tokens-mat-option.get-typography-tokens($theme));
38
30
  }
39
31
  }
40
32
 
41
- @mixin density($config-or-theme) {
42
- $density-scale: theming.get-density-config($config-or-theme);
33
+ @mixin density($theme) {
43
34
  }
44
35
 
45
- @mixin theme($theme-or-color-config) {
46
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
36
+ @mixin theme($theme) {
47
37
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-option') {
48
- $color: theming.get-color-config($theme);
49
- $density: theming.get-density-config($theme);
50
- $typography: theming.get-typography-config($theme);
51
-
52
- @if $color != null {
53
- @include color($color);
38
+ @if inspection.theme-has($theme, color) {
39
+ @include color($theme);
54
40
  }
55
- @if $density != null {
56
- @include density($density);
41
+ @if inspection.theme-has($theme, density) {
42
+ @include density($theme);
57
43
  }
58
- @if $typography != null {
59
- @include typography($typography);
44
+ @if inspection.theme-has($theme, typography) {
45
+ @include typography($theme);
60
46
  }
61
47
  }
62
48
  }
@@ -1,12 +1,10 @@
1
- @use 'sass:map';
2
1
  @use 'sass:meta';
3
2
  @use '../theming/theming';
3
+ @use '../theming/inspection';
4
4
 
5
5
  // Colors for the ripple elements.
6
- @mixin color($config-or-theme) {
7
- $config: theming.get-color-config($config-or-theme);
8
- $foreground: map.get($config, foreground);
9
- $foreground-base: map.get($foreground, base);
6
+ @mixin color($theme) {
7
+ $foreground-base: inspection.get-theme-color($theme, foreground, base);
10
8
  $color-opacity: 0.1;
11
9
 
12
10
  .mat-ripple-element {
@@ -22,12 +20,10 @@
22
20
  }
23
21
  }
24
22
 
25
- @mixin theme($theme-or-color-config) {
26
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
23
+ @mixin theme($theme) {
27
24
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') {
28
- $color: theming.get-color-config($theme);
29
- @if $color != null {
30
- @include color($color);
25
+ @if inspection.theme-has($theme, color) {
26
+ @include color($theme);
31
27
  }
32
28
  }
33
29
  }
@@ -1,5 +1,5 @@
1
- @use 'sass:map';
2
1
  @use '../../theming/theming';
2
+ @use '../../theming/inspection';
3
3
 
4
4
  @mixin _psuedo-checkbox-styles-with-color($text-color, $background) {
5
5
  .mat-pseudo-checkbox-checked,
@@ -19,15 +19,13 @@
19
19
  }
20
20
  }
21
21
 
22
- @mixin color($config-or-theme) {
23
- $config: theming.get-color-config($config-or-theme);
24
- $is-dark-theme: map.get($config, is-dark);
25
-
26
- $primary: theming.get-color-from-palette(map.get($config, primary));
27
- $accent: theming.get-color-from-palette(map.get($config, accent));
28
- $warn: theming.get-color-from-palette(map.get($config, warn));
29
- $background: theming.get-color-from-palette(map.get($config, background), background);
30
- $secondary-text: theming.get-color-from-palette(map.get($config, foreground), secondary-text);
22
+ @mixin color($theme) {
23
+ $is-dark-theme: inspection.get-theme-type($theme) == dark;
24
+ $primary: inspection.get-theme-color($theme, primary);
25
+ $accent: inspection.get-theme-color($theme, accent);
26
+ $warn: inspection.get-theme-color($theme, warn);
27
+ $background: inspection.get-theme-color($theme, background, background);
28
+ $secondary-text: inspection.get-theme-color($theme, foreground, secondary-text);
31
29
 
32
30
  // NOTE(traviskaufman): While the spec calls for translucent blacks/whites for disabled colors,
33
31
  // this does not work well with elements layered on top of one another. To get around this we
@@ -74,25 +72,20 @@
74
72
  }
75
73
  }
76
74
 
77
- @mixin typography($config-or-theme) {}
75
+ @mixin typography($theme) {}
78
76
 
79
- @mixin _density($config-or-theme) {}
77
+ @mixin _density($theme) {}
80
78
 
81
- @mixin theme($theme-or-color-config) {
82
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
79
+ @mixin theme($theme) {
83
80
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') {
84
- $color: theming.get-color-config($theme);
85
- $density: theming.get-density-config($theme);
86
- $typography: theming.get-typography-config($theme);
87
-
88
- @if $color != null {
89
- @include color($color);
81
+ @if inspection.theme-has($theme, color) {
82
+ @include color($theme);
90
83
  }
91
- @if $density != null {
92
- @include _density($density);
84
+ @if inspection.theme-has($theme, density) {
85
+ @include _density($theme);
93
86
  }
94
- @if $typography != null {
95
- @include typography($typography);
87
+ @if inspection.theme-has($theme, typography) {
88
+ @include typography($theme);
96
89
  }
97
90
  }
98
91
  }
@@ -1,5 +1,5 @@
1
- @use 'sass:map';
2
- @use '../theming/theming';
1
+ @use '../theming/inspection';
2
+ @use './sass-utils';
3
3
 
4
4
  // Renders a gradient for showing the dashed line when the input is disabled.
5
5
  // Unlike using a border, a gradient allows us to adjust the spacing of the dotted line
@@ -13,9 +13,9 @@
13
13
  // Figures out the color of the placeholder for a form control.
14
14
  // Used primarily to prevent the various form controls from
15
15
  // becoming out of sync since these colors aren't in a palette.
16
- @function private-control-placeholder-color($config) {
17
- $foreground: map.get($config, foreground);
18
- $is-dark-theme: map.get($config, is-dark);
19
- @return theming.get-color-from-palette($foreground, secondary-text,
20
- if($is-dark-theme, 0.5, 0.42));
16
+ @function private-control-placeholder-color($theme) {
17
+ $is-dark-theme: inspection.get-theme-type($theme) == dark;
18
+ @return sass-utils.safe-color-change(
19
+ inspection.get-theme-color($theme, foreground, secondary-text),
20
+ $alpha: if($is-dark-theme, 0.5, 0.42));
21
21
  }