@angular/material 17.0.0 → 17.0.1

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 (41) hide show
  1. package/autocomplete/index.d.ts +0 -2
  2. package/button/_button-theme.scss +4 -0
  3. package/core/ripple/_ripple-theme.scss +51 -19
  4. package/core/tokens/m2/_index.scss +27 -8
  5. package/esm2022/autocomplete/autocomplete-trigger.mjs +7 -7
  6. package/esm2022/core/version.mjs +1 -1
  7. package/esm2022/datepicker/calendar-body.mjs +2 -2
  8. package/esm2022/list/list-base.mjs +6 -6
  9. package/esm2022/select/select.mjs +2 -2
  10. package/fesm2022/autocomplete.mjs +6 -6
  11. package/fesm2022/autocomplete.mjs.map +1 -1
  12. package/fesm2022/core.mjs +1 -1
  13. package/fesm2022/core.mjs.map +1 -1
  14. package/fesm2022/datepicker.mjs +1 -1
  15. package/fesm2022/datepicker.mjs.map +1 -1
  16. package/fesm2022/list.mjs +5 -5
  17. package/fesm2022/list.mjs.map +1 -1
  18. package/fesm2022/select.mjs +1 -1
  19. package/fesm2022/select.mjs.map +1 -1
  20. package/form-field/_form-field-theme.scss +85 -49
  21. package/input/_input-theme.scss +39 -12
  22. package/list/_list-theme.scss +115 -83
  23. package/package.json +2 -2
  24. package/prebuilt-themes/deeppurple-amber.css +1 -1
  25. package/prebuilt-themes/indigo-pink.css +1 -1
  26. package/prebuilt-themes/pink-bluegrey.css +1 -1
  27. package/prebuilt-themes/purple-green.css +1 -1
  28. package/schematics/ng-add/index.js +1 -1
  29. package/schematics/ng-add/index.mjs +1 -1
  30. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -29
  31. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +21 -19
  32. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  33. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +9 -8
  34. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -2
  35. package/schematics/ng-update/index_bundled.js +31 -31
  36. package/slide-toggle/_slide-toggle-theme.scss +78 -44
  37. package/sort/_sort-theme.scss +51 -20
  38. package/stepper/_stepper-theme.scss +58 -25
  39. package/table/_table-theme.scss +53 -20
  40. package/tabs/_tabs-theme.scss +87 -51
  41. package/tree/_tree-theme.scss +53 -21
@@ -2,25 +2,52 @@
2
2
  @use '../core/theming/inspection';
3
3
  @use '../core/typography/typography';
4
4
 
5
- @mixin base($theme) {}
5
+ @mixin base($theme) {
6
+ @if inspection.get-theme-version($theme) == 1 {
7
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
8
+ }
9
+ @else {}
10
+ }
6
11
 
7
- @mixin color($theme) {}
12
+ @mixin color($theme) {
13
+ @if inspection.get-theme-version($theme) == 1 {
14
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
15
+ }
16
+ @else {}
17
+ }
8
18
 
9
- @mixin typography($theme) {}
19
+ @mixin typography($theme) {
20
+ @if inspection.get-theme-version($theme) == 1 {
21
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
22
+ }
23
+ @else {}
24
+ }
10
25
 
11
- @mixin density($theme) {}
26
+ @mixin density($theme) {
27
+ @if inspection.get-theme-version($theme) == 1 {
28
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
29
+ }
30
+ @else {}
31
+ }
12
32
 
13
33
  @mixin theme($theme) {
14
34
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-input') {
15
- @include base($theme);
16
- @if inspection.theme-has($theme, color) {
17
- @include color($theme);
35
+ @if inspection.get-theme-version($theme) == 1 {
36
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
18
37
  }
19
- @if inspection.theme-has($theme, density) {
20
- @include density($theme);
21
- }
22
- @if inspection.theme-has($theme, typography) {
23
- @include typography($theme);
38
+ @else {
39
+ @include base($theme);
40
+ @if inspection.theme-has($theme, color) {
41
+ @include color($theme);
42
+ }
43
+ @if inspection.theme-has($theme, density) {
44
+ @include density($theme);
45
+ }
46
+ @if inspection.theme-has($theme, typography) {
47
+ @include typography($theme);
48
+ }
24
49
  }
25
50
  }
26
51
  }
52
+
53
+ @mixin _theme-from-tokens($tokens) {}
@@ -14,139 +14,171 @@
14
14
 
15
15
  @mixin base($theme) {
16
16
  // Add default values for tokens not related to color, typography, or density.
17
- @include sass-utils.current-selector-or-root() {
18
- @include mdc-list-theme.theme(tokens-mdc-list.get-unthemable-tokens());
17
+ @if inspection.get-theme-version($theme) == 1 {
18
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
19
+ }
20
+ @else {
21
+ @include sass-utils.current-selector-or-root() {
22
+ @include mdc-list-theme.theme(tokens-mdc-list.get-unthemable-tokens());
23
+ }
19
24
  }
20
25
  }
21
26
 
22
27
  @mixin color($theme) {
23
- $mdc-list-color-tokens: tokens-mdc-list.get-color-tokens($theme);
24
-
25
- // Add values for MDC list tokens.
26
- @include sass-utils.current-selector-or-root() {
27
- @include mdc-list-theme.theme($mdc-list-color-tokens);
28
+ @if inspection.get-theme-version($theme) == 1 {
29
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
28
30
  }
31
+ @else {
32
+ $mdc-list-color-tokens: tokens-mdc-list.get-color-tokens($theme);
29
33
 
30
- .mdc-list-item__start,
31
- .mdc-list-item__end {
32
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, primary));
33
- }
34
+ // Add values for MDC list tokens.
35
+ @include sass-utils.current-selector-or-root() {
36
+ @include mdc-list-theme.theme($mdc-list-color-tokens);
37
+ }
34
38
 
35
- .mat-accent {
36
39
  .mdc-list-item__start,
37
40
  .mdc-list-item__end {
38
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, accent));
41
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, primary));
39
42
  }
40
- }
41
43
 
42
- .mat-warn {
43
- .mdc-list-item__start,
44
- .mdc-list-item__end {
45
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, warn));
44
+ .mat-accent {
45
+ .mdc-list-item__start,
46
+ .mdc-list-item__end {
47
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, accent));
48
+ }
46
49
  }
47
- }
48
50
 
49
- .mat-mdc-list-option {
50
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, primary));
51
- }
52
- .mat-mdc-list-option.mat-accent {
53
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, accent));
54
- }
55
- .mat-mdc-list-option.mat-warn {
56
- @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
57
- }
51
+ .mat-warn {
52
+ .mdc-list-item__start,
53
+ .mdc-list-item__end {
54
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-color-tokens($theme, warn));
55
+ }
56
+ }
58
57
 
59
- // There is no token for activated color on nav list.
60
- // TODO(mmalerba): Add a token to MDC or make a custom one.
61
- .mat-mdc-list-base.mat-mdc-list-base {
62
- @include evolution-mixins.list-selected-ink-color(inspection.get-theme-color($theme, primary));
63
- }
58
+ .mat-mdc-list-option {
59
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, primary));
60
+ }
61
+ .mat-mdc-list-option.mat-accent {
62
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, accent));
63
+ }
64
+ .mat-mdc-list-option.mat-warn {
65
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
66
+ }
64
67
 
65
- // TODO(mmalerba): Leaking styles from the old MDC list mixins used in other components can cause
66
- // opacity issues, so we need this override for now. We can remove it when all Angular Material
67
- // components stop using the old MDC mixins.
68
- .mat-mdc-list-base .mdc-list-item--disabled {
69
- .mdc-list-item__start,
70
- .mdc-list-item__content,
71
- .mdc-list-item__end {
72
- opacity: 1;
68
+ // There is no token for activated color on nav list.
69
+ // TODO(mmalerba): Add a token to MDC or make a custom one.
70
+ .mat-mdc-list-base.mat-mdc-list-base {
71
+ @include evolution-mixins.list-selected-ink-color(
72
+ inspection.get-theme-color($theme, primary));
73
+ }
74
+
75
+ // TODO(mmalerba): Leaking styles from the old MDC list mixins used in other components can
76
+ // cause opacity issues, so we need this override for now. We can remove it when all
77
+ // Angular Material components stop using the old MDC mixins.
78
+ .mat-mdc-list-base .mdc-list-item--disabled {
79
+ .mdc-list-item__start,
80
+ .mdc-list-item__content,
81
+ .mdc-list-item__end {
82
+ opacity: 1;
83
+ }
73
84
  }
74
85
  }
75
86
  }
76
87
 
77
88
  @mixin density($theme) {
78
- $density-scale: inspection.get-theme-density($theme);
79
- $mdc-list-density-tokens: tokens-mdc-list.get-density-tokens($theme);
80
-
81
- // Add values for MDC list tokens.
82
- @include sass-utils.current-selector-or-root() {
83
- @include mdc-list-theme.theme($mdc-list-density-tokens);
89
+ @if inspection.get-theme-version($theme) == 1 {
90
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
84
91
  }
92
+ @else {
93
+ $density-scale: inspection.get-theme-density($theme);
94
+ $mdc-list-density-tokens: tokens-mdc-list.get-density-tokens($theme);
85
95
 
86
- .mdc-list-item__start,
87
- .mdc-list-item__end {
88
- @include mdc-radio-theme.theme(tokens-mdc-radio.get-density-tokens($theme));
89
- }
96
+ // Add values for MDC list tokens.
97
+ @include sass-utils.current-selector-or-root() {
98
+ @include mdc-list-theme.theme($mdc-list-density-tokens);
99
+ }
90
100
 
91
- // TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based API,
92
- // to avoid screenshot diffs. We should remove it in favor of following MDC's current style, or
93
- // add custom tokens for it.
94
- .mat-mdc-list-item {
95
- &.mdc-list-item--with-leading-avatar,
96
- &.mdc-list-item--with-leading-checkbox,
97
- &.mdc-list-item--with-leading-icon {
98
- &.mdc-list-item--with-one-line {
99
- height: map.get((
101
+ .mdc-list-item__start,
102
+ .mdc-list-item__end {
103
+ @include mdc-radio-theme.theme(tokens-mdc-radio.get-density-tokens($theme));
104
+ }
105
+
106
+ // TODO(mmalerba): This is added to maintain the same style MDC used prior to the token-based
107
+ // API, to avoid screenshot diffs. We should remove it in favor of following MDC's current
108
+ // style, or add custom tokens for it.
109
+ .mat-mdc-list-item {
110
+ &.mdc-list-item--with-leading-avatar,
111
+ &.mdc-list-item--with-leading-checkbox,
112
+ &.mdc-list-item--with-leading-icon {
113
+ &.mdc-list-item--with-one-line {
114
+ height: map.get((
100
115
  0: 56px,
101
116
  -1: 52px,
102
117
  -2: 48px,
103
118
  -3: 44px,
104
119
  -4: 40px,
105
120
  -5: 40px,
106
- ), $density-scale);
107
- }
121
+ ), $density-scale);
122
+ }
108
123
 
109
- &.mdc-list-item--with-two-lines {
110
- height: map.get((
124
+ &.mdc-list-item--with-two-lines {
125
+ height: map.get((
111
126
  0: 72px,
112
127
  -1: 68px,
113
128
  -2: 64px,
114
129
  -3: 60px,
115
130
  -4: 56px,
116
131
  -5: 56px,
117
- ), $density-scale);
132
+ ), $density-scale);
133
+ }
118
134
  }
119
135
  }
120
136
  }
121
137
  }
122
138
 
123
139
  @mixin typography($theme) {
124
- $mdc-list-typography-tokens: tokens-mdc-list.get-typography-tokens($theme);
125
-
126
- // Add values for MDC list tokens.
127
- @include sass-utils.current-selector-or-root() {
128
- @include mdc-list-theme.theme($mdc-list-typography-tokens);
140
+ @if inspection.get-theme-version($theme) == 1 {
141
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
129
142
  }
143
+ @else {
144
+ $mdc-list-typography-tokens: tokens-mdc-list.get-typography-tokens($theme);
130
145
 
131
- // MDC does not have tokens for the subheader.
132
- // TODO(mmalerba): Discuss with MDC about adding them, or create custom tokens.
133
- .mdc-list-group__subheader {
134
- font: inspection.get-theme-typography($theme, subtitle-1, font);
135
- letter-spacing: inspection.get-theme-typography($theme, subtitle-1, letter-spacing);
146
+ // Add values for MDC list tokens.
147
+ @include sass-utils.current-selector-or-root() {
148
+ @include mdc-list-theme.theme($mdc-list-typography-tokens);
149
+ }
150
+
151
+ // MDC does not have tokens for the subheader.
152
+ // TODO(mmalerba): Discuss with MDC about adding them, or create custom tokens.
153
+ .mdc-list-group__subheader {
154
+ font: inspection.get-theme-typography($theme, subtitle-1, font);
155
+ letter-spacing: inspection.get-theme-typography($theme, subtitle-1, letter-spacing);
156
+ }
136
157
  }
137
158
  }
138
159
 
139
160
  @mixin theme($theme) {
140
161
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-list') {
141
- @include base($theme);
142
- @if inspection.theme-has($theme, color) {
143
- @include color($theme);
162
+ @if inspection.get-theme-version($theme) == 1 {
163
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
144
164
  }
145
- @if inspection.theme-has($theme, density) {
146
- @include density($theme);
147
- }
148
- @if inspection.theme-has($theme, typography) {
149
- @include typography($theme);
165
+ @else {
166
+ @include base($theme);
167
+ @if inspection.theme-has($theme, color) {
168
+ @include color($theme);
169
+ }
170
+ @if inspection.theme-has($theme, density) {
171
+ @include density($theme);
172
+ }
173
+ @if inspection.theme-has($theme, typography) {
174
+ @include typography($theme);
175
+ }
150
176
  }
151
177
  }
152
178
  }
179
+
180
+ @mixin _theme-from-tokens($tokens) {
181
+ @if ($tokens != ()) {
182
+ @include mdc-list-theme.theme(map.get($tokens, tokens-mdc-list.$prefix));
183
+ }
184
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material",
3
- "version": "17.0.0",
3
+ "version": "17.0.1",
4
4
  "description": "Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -478,7 +478,7 @@
478
478
  },
479
479
  "peerDependencies": {
480
480
  "@angular/animations": "^17.0.0 || ^18.0.0",
481
- "@angular/cdk": "17.0.0",
481
+ "@angular/cdk": "17.0.1",
482
482
  "@angular/core": "^17.0.0 || ^18.0.0",
483
483
  "@angular/common": "^17.0.0 || ^18.0.0",
484
484
  "@angular/forms": "^17.0.0 || ^18.0.0",