@angular/material 20.1.0-next.1 → 20.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +28 -37
  3. package/autocomplete/_m2-autocomplete.scss +10 -22
  4. package/badge/_badge-theme.scss +35 -44
  5. package/badge/_m2-badge.scss +46 -59
  6. package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
  7. package/bottom-sheet/_m2-bottom-sheet.scss +16 -33
  8. package/button/_button-theme.scss +37 -55
  9. package/button/_fab-theme.scss +42 -56
  10. package/button/_icon-button-theme.scss +33 -49
  11. package/button/_m2-button.scss +135 -158
  12. package/button/_m2-fab.scss +60 -69
  13. package/button/_m2-icon-button.scss +30 -50
  14. package/button/_m3-button.scss +1 -2
  15. package/button/_m3-fab.scss +1 -2
  16. package/button/_m3-icon-button.scss +1 -2
  17. package/button/testing/index.d.ts +1 -0
  18. package/button-toggle/_button-toggle-theme.scss +29 -44
  19. package/button-toggle/_m2-button-toggle.scss +58 -81
  20. package/button-toggle/_m3-button-toggle.scss +1 -2
  21. package/card/_card-theme.scss +28 -36
  22. package/card/_m2-card.scss +30 -45
  23. package/checkbox/_checkbox-theme.scss +37 -50
  24. package/checkbox/_m2-checkbox.scss +30 -40
  25. package/checkbox/_m3-checkbox.scss +1 -2
  26. package/chips/_chips-theme.scss +27 -30
  27. package/chips/_m2-chip.scss +40 -53
  28. package/chips/_m3-chip.scss +1 -2
  29. package/core/_core-theme.scss +48 -67
  30. package/core/_m2-app.scss +11 -23
  31. package/core/focus-indicators/_private.scss +2 -5
  32. package/core/m2/_theming.scss +36 -41
  33. package/core/option/_m2-optgroup.scss +13 -25
  34. package/core/option/_m2-option.scss +16 -22
  35. package/core/option/_optgroup-theme.scss +28 -30
  36. package/core/option/_option-theme.scss +35 -34
  37. package/core/ripple/_m2-ripple.scss +8 -20
  38. package/core/ripple/_ripple-theme.scss +28 -33
  39. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
  40. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
  41. package/core/theming/_all-theme.scss +38 -42
  42. package/core/theming/_definition.scss +22 -13
  43. package/core/theming/_inspection.scss +0 -12
  44. package/core/theming/_m2-inspection.scss +0 -33
  45. package/core/theming/_theming.scss +4 -172
  46. package/core/tokens/_m2-utils.scss +16 -68
  47. package/core/tokens/_m3-utils.scss +2 -14
  48. package/core/tokens/_token-utils.scss +7 -27
  49. package/core/tokens/m2/_index.scss +6 -0
  50. package/core/tokens/m2/_md-sys-color.scss +123 -0
  51. package/core/tokens/m2/_md-sys-elevation.scss +16 -0
  52. package/core/tokens/m2/_md-sys-motion.scss +36 -0
  53. package/core/tokens/m2/_md-sys-shape.scss +22 -0
  54. package/core/tokens/m2/_md-sys-state.scss +15 -0
  55. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  56. package/core/tokens/m3/_md-sys-color.scss +2 -2
  57. package/core/tokens/m3/_md-sys-typescale.scss +1 -1
  58. package/core/tokens/m3/_theme.scss +14 -26
  59. package/datepicker/_datepicker-theme.scss +38 -40
  60. package/datepicker/_m2-datepicker.scss +26 -40
  61. package/dialog/_dialog-theme.scss +28 -34
  62. package/dialog/_m2-dialog.scss +34 -48
  63. package/divider/_divider-theme.scss +28 -30
  64. package/divider/_m2-divider.scss +10 -21
  65. package/expansion/_expansion-theme.scss +28 -39
  66. package/expansion/_m2-expansion.scss +52 -67
  67. package/expansion/_m3-expansion.scss +3 -2
  68. package/fesm2022/autocomplete.mjs +1 -1
  69. package/fesm2022/button/testing.mjs +7 -4
  70. package/fesm2022/button/testing.mjs.map +1 -1
  71. package/fesm2022/chips.mjs +1 -1
  72. package/fesm2022/core.mjs +1 -1
  73. package/fesm2022/core.mjs.map +1 -1
  74. package/fesm2022/datepicker.mjs +1 -1
  75. package/fesm2022/expansion.mjs +2 -2
  76. package/fesm2022/expansion.mjs.map +1 -1
  77. package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
  78. package/fesm2022/{form-field-C9DZXojn.mjs.map → form-field-CFbrnFED.mjs.map} +1 -1
  79. package/fesm2022/form-field.mjs +2 -2
  80. package/fesm2022/input.mjs +3 -27
  81. package/fesm2022/input.mjs.map +1 -1
  82. package/fesm2022/menu/testing.mjs +97 -13
  83. package/fesm2022/menu/testing.mjs.map +1 -1
  84. package/fesm2022/menu.mjs +343 -122
  85. package/fesm2022/menu.mjs.map +1 -1
  86. package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
  87. package/fesm2022/{module-BDiw_nWS.mjs.map → module-B0CLRw5e.mjs.map} +1 -1
  88. package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
  89. package/fesm2022/{module-DzZHEh7B.mjs.map → module-B62K-792.mjs.map} +1 -1
  90. package/fesm2022/paginator.mjs +3 -3
  91. package/fesm2022/select.mjs +3 -3
  92. package/fesm2022/sidenav.mjs +2 -4
  93. package/fesm2022/sidenav.mjs.map +1 -1
  94. package/fesm2022/slide-toggle.mjs +2 -2
  95. package/fesm2022/slide-toggle.mjs.map +1 -1
  96. package/fesm2022/snack-bar.mjs +2 -2
  97. package/fesm2022/timepicker.mjs +1 -1
  98. package/form-field/_form-field-theme.scss +35 -51
  99. package/form-field/_m2-form-field.scss +125 -146
  100. package/form-field/_m3-form-field.scss +1 -2
  101. package/grid-list/_grid-list-theme.scss +28 -28
  102. package/grid-list/_m2-grid-list.scss +16 -29
  103. package/icon/_icon-theme.scss +40 -41
  104. package/icon/_m2-icon.scss +7 -21
  105. package/input/_input-theme.scss +1 -4
  106. package/input/index.d.ts +0 -11
  107. package/list/_list-theme.scss +57 -53
  108. package/list/_m2-list.scss +84 -108
  109. package/list/_m3-list.scss +1 -2
  110. package/menu/_m2-menu.scss +33 -46
  111. package/menu/_menu-theme.scss +28 -33
  112. package/menu/index.d.ts +145 -61
  113. package/menu/testing/index.d.ts +50 -2
  114. package/package.json +2 -2
  115. package/paginator/_m2-paginator.scss +38 -58
  116. package/paginator/_m3-paginator.scss +1 -2
  117. package/paginator/_paginator-theme.scss +28 -33
  118. package/prebuilt-themes/deeppurple-amber.css +1 -1
  119. package/prebuilt-themes/indigo-pink.css +1 -1
  120. package/prebuilt-themes/pink-bluegrey.css +1 -1
  121. package/prebuilt-themes/purple-green.css +1 -1
  122. package/progress-bar/_m2-progress-bar.scss +11 -24
  123. package/progress-bar/_progress-bar-theme.scss +35 -43
  124. package/progress-spinner/_m2-progress-spinner.scss +9 -20
  125. package/progress-spinner/_progress-spinner-theme.scss +42 -43
  126. package/radio/_m2-radio.scss +30 -40
  127. package/radio/_m3-radio.scss +1 -2
  128. package/radio/_radio-theme.scss +33 -46
  129. package/schematics/ng-add/index.js +1 -1
  130. package/schematics/ng-generate/theme-color/schema.json +1 -1
  131. package/select/_m2-select.scss +23 -30
  132. package/select/_m3-select.scss +1 -2
  133. package/select/_select-theme.scss +38 -51
  134. package/sidenav/_m2-sidenav.scss +26 -36
  135. package/sidenav/_sidenav-theme.scss +28 -30
  136. package/slide-toggle/_m2-slide-toggle.scss +111 -143
  137. package/slide-toggle/_m3-slide-toggle.scss +1 -0
  138. package/slide-toggle/_slide-toggle-theme.scss +42 -80
  139. package/slider/_m2-slider.scss +34 -55
  140. package/slider/_slider-theme.scss +38 -45
  141. package/snack-bar/_m2-snack-bar.scss +16 -36
  142. package/snack-bar/_snack-bar-theme.scss +28 -31
  143. package/sort/_m2-sort.scss +7 -18
  144. package/sort/_sort-theme.scss +28 -33
  145. package/stepper/_m2-stepper.scss +39 -57
  146. package/stepper/_m3-stepper.scss +1 -2
  147. package/stepper/_stepper-theme.scss +41 -49
  148. package/table/_m2-table.scss +54 -72
  149. package/table/_m3-table.scss +1 -2
  150. package/table/_table-theme.scss +28 -36
  151. package/tabs/_m2-tabs.scss +31 -46
  152. package/tabs/_m3-tabs.scss +1 -2
  153. package/tabs/_tabs-theme.scss +41 -49
  154. package/timepicker/_m2-timepicker.scss +10 -22
  155. package/timepicker/_timepicker-theme.scss +28 -46
  156. package/toolbar/_m2-toolbar.scss +26 -46
  157. package/toolbar/_m3-toolbar.scss +1 -2
  158. package/toolbar/_toolbar-theme.scss +55 -46
  159. package/tooltip/_m2-tooltip.scss +16 -34
  160. package/tooltip/_tooltip-theme.scss +28 -37
  161. package/tree/_m2-tree.scss +21 -38
  162. package/tree/_m3-tree.scss +1 -2
  163. package/tree/_tree-theme.scss +28 -38
  164. package/core/tokens/_format-tokens.scss +0 -5
@@ -1,62 +1,56 @@
1
- @use '../core/style/sass-utils';
2
- @use '../core/theming/theming';
3
1
  @use '../core/theming/inspection';
4
2
  @use '../core/tokens/token-utils';
5
3
  @use './m2-progress-bar';
6
4
  @use './m3-progress-bar';
7
5
  @use 'sass:map';
8
6
 
9
- /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
10
- /// for the mat-progress-bar.
11
- /// @param {Map} $theme The theme to generate base styles for.
12
7
  @mixin base($theme) {
8
+ $tokens: map.get(m2-progress-bar.get-tokens($theme), base);
13
9
  @if inspection.get-theme-version($theme) == 1 {
14
- @include token-utils.create-token-values(map.get(m3-progress-bar.get-tokens($theme), base));
15
- } @else {
16
- // Add default values for tokens not related to color, typography, or density.
17
- @include sass-utils.current-selector-or-root() {
18
- @include token-utils.create-token-values-mixed(m2-progress-bar.get-unthemable-tokens());
19
- }
10
+ $tokens: map.get(m3-progress-bar.get-tokens($theme), base);
20
11
  }
21
- }
22
12
 
23
- @mixin _palette-styles($theme, $palette-name) {
24
- @include token-utils.create-token-values-mixed(
25
- m2-progress-bar.get-color-tokens($theme, $palette-name));
13
+ @include token-utils.values($tokens);
26
14
  }
27
15
 
28
- /// Outputs color theme styles for the mat-progress-bar.
29
- /// @param {Map} $theme The theme to generate color styles for.
30
- /// @param {ArgList} Additional optional arguments (only supported for M3 themes):
31
- /// $color-variant: The color variant to use for the progress bar: primary, secondary, tertiary,
32
- /// or error (If not specified, default primary color will be used).
33
16
  @mixin color($theme, $color-variant: null) {
34
17
  @if inspection.get-theme-version($theme) == 1 {
35
- @include token-utils.create-token-values(
18
+ @include token-utils.values(
36
19
  map.get(m3-progress-bar.get-tokens($theme, $color-variant), color));
37
20
  } @else {
38
21
  .mat-mdc-progress-bar {
39
- @include _palette-styles($theme, primary);
22
+ $tokens: m2-progress-bar.private-get-color-palette-color-tokens($theme, primary);
23
+ @include token-utils.values($tokens);
40
24
 
41
25
  &.mat-accent {
42
- @include _palette-styles($theme, secondary);
26
+ $tokens: m2-progress-bar.private-get-color-palette-color-tokens($theme, secondary);
27
+ @include token-utils.values($tokens);
43
28
  }
44
29
 
45
30
  &.mat-warn {
46
- @include _palette-styles($theme, error);
31
+ $tokens: m2-progress-bar.private-get-color-palette-color-tokens($theme, error);
32
+ @include token-utils.values($tokens);
47
33
  }
48
34
  }
49
35
  }
50
36
  }
51
37
 
52
- /// Outputs typography theme styles for the mat-progress-bar.
53
- /// @param {Map} $theme The theme to generate typography styles for.
54
38
  @mixin typography($theme) {
39
+ $tokens: map.get(m2-progress-bar.get-tokens($theme), typography);
40
+ @if inspection.get-theme-version($theme) == 1 {
41
+ $tokens: map.get(m3-progress-bar.get-tokens($theme), typography);
42
+ }
43
+
44
+ @include token-utils.values($tokens);
55
45
  }
56
46
 
57
- /// Outputs density theme styles for the mat-progress-bar.
58
- /// @param {Map} $theme The theme to generate density styles for.
59
47
  @mixin density($theme) {
48
+ $tokens: map.get(m2-progress-bar.get-tokens($theme), density);
49
+ @if inspection.get-theme-version($theme) == 1 {
50
+ $tokens: map.get(m3-progress-bar.get-tokens($theme), density);
51
+ }
52
+
53
+ @include token-utils.values($tokens);
60
54
  }
61
55
 
62
56
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -79,23 +73,21 @@
79
73
  /// @param {Map} $theme The theme to generate styles for.
80
74
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
81
75
  @mixin theme($theme, $color-variant: null) {
82
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-progress-bar') {
83
- @if inspection.get-theme-version($theme) == 1 {
84
- @include base($theme);
85
- @include color($theme, $color-variant);
76
+ @if inspection.get-theme-version($theme) == 1 {
77
+ @include base($theme);
78
+ @include color($theme, $color-variant);
79
+ @include density($theme);
80
+ @include typography($theme);
81
+ } @else {
82
+ @include base($theme);
83
+ @if inspection.theme-has($theme, color) {
84
+ @include color($theme);
85
+ }
86
+ @if inspection.theme-has($theme, density) {
86
87
  @include density($theme);
88
+ }
89
+ @if inspection.theme-has($theme, typography) {
87
90
  @include typography($theme);
88
- } @else {
89
- @include base($theme);
90
- @if inspection.theme-has($theme, color) {
91
- @include color($theme);
92
- }
93
- @if inspection.theme-has($theme, density) {
94
- @include density($theme);
95
- }
96
- @if inspection.theme-has($theme, typography) {
97
- @include typography($theme);
98
- }
99
91
  }
100
92
  }
101
93
  }
@@ -2,21 +2,20 @@
2
2
  @use '../core/tokens/m3-utils';
3
3
  @use 'sass:map';
4
4
 
5
- // Tokens that can't be configured through Angular Material's current theming API,
6
- // but may be in a future version of the theming API.
7
- //
8
- // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
9
- // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
10
- // our CSS.
11
- @function get-unthemable-tokens() {
5
+ @function get-tokens($theme) {
12
6
  @return (
13
- progress-spinner-active-indicator-width: 4px,
14
- progress-spinner-size: 48px,
7
+ base: (
8
+ progress-spinner-active-indicator-width: 4px,
9
+ progress-spinner-size: 48px,
10
+ ),
11
+ color: private-get-color-palette-color-tokens($theme, primary),
12
+ typography: (),
13
+ density: (),
15
14
  );
16
15
  }
17
16
 
18
17
  // Tokens that can be configured through Angular Material's color theming API.
19
- @function get-color-tokens($theme, $color-variant) {
18
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
20
19
  $system: m2-utils.get-system($theme);
21
20
  $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
22
21
 
@@ -24,13 +23,3 @@
24
23
  progress-spinner-active-indicator-color: map.get($system, primary)
25
24
  );
26
25
  }
27
-
28
- // Tokens that can be configured through Angular Material's typography theming API.
29
- @function get-typography-tokens($theme) {
30
- @return ();
31
- }
32
-
33
- // Tokens that can be configured through Angular Material's density theming API.
34
- @function get-density-tokens($theme) {
35
- @return ();
36
- }
@@ -1,57 +1,58 @@
1
- @use '../core/style/sass-utils';
2
- @use '../core/theming/theming';
3
1
  @use '../core/theming/inspection';
4
2
  @use '../core/tokens/token-utils';
5
3
  @use './m2-progress-spinner';
6
4
  @use './m3-progress-spinner';
7
5
  @use 'sass:map';
8
6
 
9
- /// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
10
- /// for the mat-progress-spinner.
11
- /// @param {Map} $theme The theme to generate base styles for.
12
7
  @mixin base($theme) {
8
+ $tokens: map.get(m2-progress-spinner.get-tokens($theme), base);
13
9
  @if inspection.get-theme-version($theme) == 1 {
14
- @include token-utils.create-token-values(map.get(m3-progress-spinner.get-tokens($theme), base));
15
- } @else {
16
- @include sass-utils.current-selector-or-root() {
17
- @include token-utils.create-token-values-mixed(m2-progress-spinner.get-unthemable-tokens());
18
- }
10
+ $tokens: map.get(m3-progress-spinner.get-tokens($theme), base);
19
11
  }
12
+
13
+ @include token-utils.values($tokens);
20
14
  }
21
15
 
22
16
  /// Outputs color theme styles for the mat-progress-spinner.
23
17
  /// @param {Map} $theme The theme to generate color styles for.
24
18
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
25
19
  @mixin color($theme, $color-variant: null) {
20
+ $tokens: map.get(m2-progress-spinner.get-tokens($theme), color);
26
21
  @if inspection.get-theme-version($theme) == 1 {
27
- @include token-utils.create-token-values(
28
- map.get(m3-progress-spinner.get-tokens($theme, $color-variant), color));
29
- } @else {
30
- @include sass-utils.current-selector-or-root() {
31
- @include token-utils.create-token-values-mixed(
32
- m2-progress-spinner.get-color-tokens($theme, primary));
22
+ $tokens: map.get(m3-progress-spinner.get-tokens($theme, $color-variant), color);
23
+ }
33
24
 
34
- .mat-accent {
35
- @include token-utils.create-token-values-mixed(
36
- m2-progress-spinner.get-color-tokens($theme, secondary));
37
- }
25
+ @include token-utils.values($tokens);
38
26
 
39
- .mat-warn {
40
- @include token-utils.create-token-values-mixed(
41
- m2-progress-spinner.get-color-tokens($theme, error));
42
- }
27
+ @if inspection.get-theme-version($theme) != 1 {
28
+ .mat-accent {
29
+ $tokens: m2-progress-spinner.private-get-color-palette-color-tokens($theme, secondary);
30
+ @include token-utils.values($tokens);
31
+ }
32
+
33
+ .mat-warn {
34
+ $tokens: m2-progress-spinner.private-get-color-palette-color-tokens($theme, error);
35
+ @include token-utils.values($tokens);
43
36
  }
44
37
  }
45
38
  }
46
39
 
47
- /// Outputs typography theme styles for the mat-progress-spinner.
48
- /// @param {Map} $theme The theme to generate typography styles for.
49
40
  @mixin typography($theme) {
41
+ $tokens: map.get(m2-progress-spinner.get-tokens($theme), typography);
42
+ @if inspection.get-theme-version($theme) == 1 {
43
+ $tokens: map.get(m3-progress-spinner.get-tokens($theme), typography);
44
+ }
45
+
46
+ @include token-utils.values($tokens);
50
47
  }
51
48
 
52
- /// Outputs density theme styles for the mat-progress-spinner.
53
- /// @param {Map} $theme The theme to generate density styles for.
54
49
  @mixin density($theme) {
50
+ $tokens: map.get(m2-progress-spinner.get-tokens($theme), density);
51
+ @if inspection.get-theme-version($theme) == 1 {
52
+ $tokens: map.get(m3-progress-spinner.get-tokens($theme), density);
53
+ }
54
+
55
+ @include token-utils.values($tokens);
55
56
  }
56
57
 
57
58
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -74,23 +75,21 @@
74
75
  /// @param {Map} $theme The theme to generate styles for.
75
76
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
76
77
  @mixin theme($theme, $color-variant: null) {
77
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-progress-spinner') {
78
- @if inspection.get-theme-version($theme) == 1 {
79
- @include base($theme);
80
- @include color($theme, $color-variant);
78
+ @if inspection.get-theme-version($theme) == 1 {
79
+ @include base($theme);
80
+ @include color($theme, $color-variant);
81
+ @include density($theme);
82
+ @include typography($theme);
83
+ } @else {
84
+ @include base($theme);
85
+ @if inspection.theme-has($theme, color) {
86
+ @include color($theme);
87
+ }
88
+ @if inspection.theme-has($theme, density) {
81
89
  @include density($theme);
90
+ }
91
+ @if inspection.theme-has($theme, typography) {
82
92
  @include typography($theme);
83
- } @else {
84
- @include base($theme);
85
- @if inspection.theme-has($theme, color) {
86
- @include color($theme);
87
- }
88
- @if inspection.theme-has($theme, density) {
89
- @include density($theme);
90
- }
91
- @if inspection.theme-has($theme, typography) {
92
- @include typography($theme);
93
- }
94
93
  }
95
94
  }
96
95
  }
@@ -1,26 +1,43 @@
1
1
  @use 'sass:map';
2
2
  @use '../core/theming/theming';
3
- @use '../core/theming/inspection';
4
3
  @use '../core/tokens/m2-utils';
5
4
  @use '../core/tokens/m3-utils';
6
5
 
7
- // Tokens that can't be configured through Angular Material's current theming API,
8
- // but may be in a future version of the theming API.
9
- @function get-unthemable-tokens() {
6
+ @function get-tokens($theme) {
7
+ $system: m2-utils.get-system($theme);
8
+ $density-scale: theming.clamp-density(map.get($system, density-scale), -3);
9
+
10
10
  @return (
11
- radio-disabled-selected-icon-opacity: 0.38,
12
- radio-disabled-unselected-icon-opacity: 0.38,
13
- // This is specified both here and in the density tokens, because it
14
- // determines the size of the radio button itself and there are internal
15
- // tests who don't configure the theme correctly.
16
- radio-state-layer-size: 40px,
11
+ base: (
12
+ radio-disabled-selected-icon-opacity: 0.38,
13
+ radio-disabled-unselected-icon-opacity: 0.38,
14
+ // This is specified both here and in the density tokens, because it
15
+ // determines the size of the radio button itself and there are internal
16
+ // tests who don't configure the theme correctly.
17
+ radio-state-layer-size: 40px,
18
+ ),
19
+ color: private-get-color-palette-color-tokens($theme, secondary),
20
+ typography: (
21
+ radio-label-text-font: map.get($system, body-medium-font),
22
+ radio-label-text-line-height: map.get($system, body-medium-line-height),
23
+ radio-label-text-size: map.get($system, body-medium-size),
24
+ radio-label-text-tracking: map.get($system, body-medium-tracking),
25
+ radio-label-text-weight: map.get($system, body-medium-weight)
26
+ ),
27
+ density: (
28
+ radio-state-layer-size: map.get((
29
+ 0: 40px,
30
+ -1: 36px,
31
+ -2: 32px,
32
+ -3: 28px,
33
+ ), $density-scale),
34
+ radio-touch-target-display: if($density-scale < -1, none, block)
35
+ ),
17
36
  );
18
37
  }
19
38
 
20
39
  // Tokens that can be configured through Angular Material's color theming API.
21
- @function get-color-tokens($theme, $color-variant) {
22
- $system: m2-utils.get-system($theme);
23
- $is-dark: inspection.get-theme-type($theme) == dark;
40
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
24
41
  $system: m2-utils.get-system($theme);
25
42
  $system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
26
43
  $disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
@@ -42,30 +59,3 @@
42
59
  radio-unselected-pressed-icon-color: map.get($system, on-surface),
43
60
  );
44
61
  }
45
-
46
- // Tokens that can be configured through Angular Material's typography theming API.
47
- @function get-typography-tokens($theme) {
48
- @return (
49
- radio-label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
50
- radio-label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
51
- radio-label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
52
- radio-label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
53
- radio-label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
54
- );
55
- }
56
-
57
- // Tokens that can be configured through Angular Material's density theming API.
58
- @function get-density-tokens($theme) {
59
- $scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
60
-
61
- @return (
62
- // The diameter of the radio's ripple.
63
- radio-state-layer-size: map.get((
64
- 0: 40px,
65
- -1: 36px,
66
- -2: 32px,
67
- -3: 28px,
68
- ), $scale),
69
- radio-touch-target-display: if($scale < -1, none, block)
70
- );
71
- }
@@ -2,7 +2,6 @@
2
2
  @use 'sass:list';
3
3
  @use '../core/tokens/m3-utils';
4
4
  @use '../core/theming/theming';
5
- @use '../core/theming/inspection';
6
5
  @use '../core/tokens/m3';
7
6
 
8
7
  /// Generates custom tokens for the mat-radio.
@@ -41,7 +40,7 @@
41
40
  radio-label-text-tracking: map.get($system, body-medium-tracking),
42
41
  radio-label-text-weight: map.get($system, body-medium-weight),
43
42
  ),
44
- density: get-density-tokens(map.get($theme, inspection.$internals, density-scale)),
43
+ density: get-density-tokens(map.get($system, density-scale)),
45
44
  );
46
45
 
47
46
  // Temporary removal where color variants previously did not include the
@@ -1,5 +1,3 @@
1
- @use '../core/style/sass-utils';
2
- @use '../core/theming/theming';
3
1
  @use '../core/theming/inspection';
4
2
  @use '../core/tokens/token-utils';
5
3
  @use '../core/typography/typography';
@@ -11,13 +9,12 @@
11
9
  /// for the mat-radio.
12
10
  /// @param {Map} $theme The theme to generate base styles for.
13
11
  @mixin base($theme) {
12
+ $tokens: map.get(m2-radio.get-tokens($theme), base);
14
13
  @if inspection.get-theme-version($theme) == 1 {
15
- @include token-utils.create-token-values(map.get(m3-radio.get-tokens($theme), base));
16
- } @else {
17
- @include sass-utils.current-selector-or-root() {
18
- @include token-utils.create-token-values-mixed(m2-radio.get-unthemable-tokens());
19
- }
14
+ $tokens: map.get(m3-radio.get-tokens($theme), base);
20
15
  }
16
+
17
+ @include token-utils.values($tokens);
21
18
  }
22
19
 
23
20
  /// Outputs color theme styles for the mat-radio.
@@ -25,52 +22,44 @@
25
22
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
26
23
  @mixin color($theme, $color-variant: null) {
27
24
  @if inspection.get-theme-version($theme) == 1 {
28
- @include token-utils.create-token-values(
29
- map.get(m3-radio.get-tokens($theme, $color-variant), color));
25
+ $tokens: map.get(m3-radio.get-tokens($theme, $color-variant), color);
26
+ @include token-utils.values($tokens);
30
27
  } @else {
31
28
  .mat-mdc-radio-button {
32
29
  &.mat-primary {
33
- @include token-utils.create-token-values-mixed(
34
- m2-radio.get-color-tokens($theme, primary));
30
+ $tokens: m2-radio.private-get-color-palette-color-tokens($theme, primary);
31
+ @include token-utils.values($tokens);
35
32
  }
36
33
 
37
34
  &.mat-accent {
38
- @include token-utils.create-token-values-mixed(
39
- m2-radio.get-color-tokens($theme, secondary));
35
+ $tokens: m2-radio.private-get-color-palette-color-tokens($theme, secondary);
36
+ @include token-utils.values($tokens);
40
37
  }
41
38
 
42
39
  &.mat-warn {
43
- @include token-utils.create-token-values-mixed(
44
- m2-radio.get-color-tokens($theme, error));
40
+ $tokens: m2-radio.private-get-color-palette-color-tokens($theme, error);
41
+ @include token-utils.values($tokens);
45
42
  }
46
43
  }
47
44
  }
48
45
  }
49
46
 
50
- /// Outputs typography theme styles for the mat-radio.
51
- /// @param {Map} $theme The theme to generate typography styles for.
52
47
  @mixin typography($theme) {
48
+ $tokens: map.get(m2-radio.get-tokens($theme), typography);
53
49
  @if inspection.get-theme-version($theme) == 1 {
54
- @include token-utils.create-token-values(map.get(m3-radio.get-tokens($theme), typography));
55
- } @else {
56
- @include sass-utils.current-selector-or-root() {
57
- @include token-utils.create-token-values-mixed(m2-radio.get-typography-tokens($theme));
58
- }
50
+ $tokens: map.get(m3-radio.get-tokens($theme), typography);
59
51
  }
52
+
53
+ @include token-utils.values($tokens);
60
54
  }
61
55
 
62
- /// Outputs typography theme styles for the mat-radio.
63
- /// @param {Map} $theme The theme to generate density styles for.
64
56
  @mixin density($theme) {
57
+ $tokens: map.get(m2-radio.get-tokens($theme), density);
65
58
  @if inspection.get-theme-version($theme) == 1 {
66
- @include token-utils.create-token-values(map.get(m3-radio.get-tokens($theme), density));
67
- } @else {
68
- $density-scale: inspection.get-theme-density($theme);
69
-
70
- @include sass-utils.current-selector-or-root() {
71
- @include token-utils.create-token-values-mixed(m2-radio.get-density-tokens($theme));
72
- }
59
+ $tokens: map.get(m3-radio.get-tokens($theme), density);
73
60
  }
61
+
62
+ @include token-utils.values($tokens);
74
63
  }
75
64
 
76
65
  /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
@@ -93,23 +82,21 @@
93
82
  /// @param {Map} $theme The theme to generate styles for.
94
83
  /// @param {String} $color-variant The color variant to use for the component (M3 only)
95
84
  @mixin theme($theme, $color-variant: null) {
96
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-radio') {
97
- @if inspection.get-theme-version($theme) == 1 {
98
- @include base($theme);
99
- @include color($theme, $color-variant);
85
+ @if inspection.get-theme-version($theme) == 1 {
86
+ @include base($theme);
87
+ @include color($theme, $color-variant);
88
+ @include density($theme);
89
+ @include typography($theme);
90
+ } @else {
91
+ @include base($theme);
92
+ @if inspection.theme-has($theme, color) {
93
+ @include color($theme);
94
+ }
95
+ @if inspection.theme-has($theme, density) {
100
96
  @include density($theme);
97
+ }
98
+ @if inspection.theme-has($theme, typography) {
101
99
  @include typography($theme);
102
- } @else {
103
- @include base($theme);
104
- @if inspection.theme-has($theme, color) {
105
- @include color($theme);
106
- }
107
- @if inspection.theme-has($theme, density) {
108
- @include density($theme);
109
- }
110
- @if inspection.theme-has($theme, typography) {
111
- @include typography($theme);
112
- }
113
100
  }
114
101
  }
115
102
  }
@@ -19,7 +19,7 @@ const package_config_1 = require("./package-config");
19
19
  * Note that the fallback version range does not use caret, but tilde because that is
20
20
  * the default for Angular framework dependencies in CLI projects.
21
21
  */
22
- const fallbackMaterialVersionRange = `~20.1.0-next.1`;
22
+ const fallbackMaterialVersionRange = `~20.1.0-rc.0`;
23
23
  /**
24
24
  * Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
25
25
  * automatically executed if developers run `ng add @angular/material`.
@@ -49,7 +49,7 @@
49
49
  "type": "boolean",
50
50
  "default": true,
51
51
  "description": "Whether to generate output file in scss or CSS",
52
- "x-prompt": "Do you want to generated file to be a scss file? This is the recommended way of setting up theming in your application. If not, a CSS file will be generated with all the system variables defined. (Leave blank to generate a scss file)"
52
+ "x-prompt": "Do you want the generated file to be a scss file? This is the recommended way of setting up theming in your application. If not, a CSS file will be generated with all the system variables defined. (Leave blank to generate a scss file)"
53
53
  }
54
54
  }
55
55
  }
@@ -1,20 +1,37 @@
1
1
  @use 'sass:map';
2
- @use '../core/theming/inspection';
3
2
  @use '../core/theming/theming';
4
3
  @use '../core/style/elevation';
5
4
  @use '../core/tokens/m2-utils';
6
5
  @use '../core/tokens/m3-utils';
7
6
 
8
- // Tokens that can't be configured through Angular Material's current theming API,
9
- // but may be in a future version of the theming API.
10
- @function get-unthemable-tokens() {
7
+ @function get-tokens($theme) {
8
+ $system: m2-utils.get-system($theme);
9
+ $density-scale: theming.clamp-density(map.get($system, density-scale), -2);
10
+
11
11
  @return (
12
- select-container-elevation-shadow: elevation.get-box-shadow(8),
12
+ base: (
13
+ select-container-elevation-shadow: elevation.get-box-shadow(8),
14
+ ),
15
+ color: private-get-color-palette-color-tokens($theme, primary),
16
+ typography: (
17
+ select-trigger-text-font: map.get($system, body-large-font),
18
+ select-trigger-text-line-height: map.get($system, body-large-line-height),
19
+ select-trigger-text-size: map.get($system, body-large-size),
20
+ select-trigger-text-tracking: map.get($system, body-large-tracking),
21
+ select-trigger-text-weight: map.get($system, body-large-weight)
22
+ ),
23
+ density: (
24
+ select-arrow-transform: map.get((
25
+ 0: translateY(-8px),
26
+ -1: translateY(-8px),
27
+ -2: none,
28
+ ), $density-scale),
29
+ ),
13
30
  );
14
31
  }
15
32
 
16
33
  // Tokens that can be configured through Angular Material's color theming API.
17
- @function get-color-tokens($theme, $color-variant) {
34
+ @function private-get-color-palette-color-tokens($theme, $color-variant) {
18
35
  $system: m2-utils.get-system($theme);
19
36
  $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
20
37
  $disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
@@ -30,27 +47,3 @@
30
47
  select-invalid-arrow-color: map.get($system, error),
31
48
  );
32
49
  }
33
-
34
- // Tokens that can be configured through Angular Material's typography theming API.
35
- @function get-typography-tokens($theme) {
36
- @return (
37
- select-trigger-text-font: inspection.get-theme-typography($theme, body-1, font-family),
38
- select-trigger-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
39
- select-trigger-text-size: inspection.get-theme-typography($theme, body-1, font-size),
40
- select-trigger-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
41
- select-trigger-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
42
- );
43
- }
44
-
45
- // Tokens that can be configured through Angular Material's density theming API.
46
- @function get-density-tokens($theme) {
47
- $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -2);
48
-
49
- @return (
50
- select-arrow-transform: map.get((
51
- 0: translateY(-8px),
52
- -1: translateY(-8px),
53
- -2: none,
54
- ), $density-scale),
55
- );
56
- }
@@ -3,7 +3,6 @@
3
3
  @use '../core/style/elevation';
4
4
  @use '../core/tokens/m3-utils';
5
5
  @use '../core/theming/theming';
6
- @use '../core/theming/inspection';
7
6
  @use '../core/tokens/m3';
8
7
 
9
8
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -40,7 +39,7 @@ $prefix: (mat, select);
40
39
  select-trigger-text-tracking: map.get($system, body-large-tracking),
41
40
  select-trigger-text-weight: map.get($system, body-large-weight),
42
41
  ),
43
- density: get-density-tokens(map.get($theme, inspection.$internals, density-scale)),
42
+ density: get-density-tokens(map.get($system, density-scale)),
44
43
  );
45
44
  }
46
45