@angular/material-experimental 16.2.0 → 17.0.0-next.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.
- package/_index.scss +3 -4
- package/esm2022/selection/selection-column.mjs +11 -11
- package/esm2022/selection/selection-module.mjs +5 -5
- package/esm2022/version.mjs +1 -1
- package/fesm2022/material-experimental.mjs +1 -1
- package/fesm2022/material-experimental.mjs.map +1 -1
- package/fesm2022/selection.mjs +13 -13
- package/fesm2022/selection.mjs.map +1 -1
- package/package.json +8 -8
- package/selection/index.d.ts +4 -4
- package/theming/_config-validation.scss +166 -0
- package/theming/_custom-tokens.scss +31 -0
- package/theming/_definition.scss +105 -0
- package/theming/_m3-density.scss +56 -0
- package/theming/_m3-palettes.scss +251 -0
- package/theming/_m3-tokens.scss +190 -70
- package/theming-next/_m3-tokens.scss +146 -0
- package/column-resize/_column-resize.import.scss +0 -9
- package/popover-edit/_popover-edit.import.scss +0 -13
- package/selection/_selection.import.scss +0 -4
- /package/{theming → theming-next}/_card.scss +0 -0
- /package/{theming → theming-next}/_checkbox.scss +0 -0
- /package/{theming → theming-next}/_theming.scss +0 -0
- /package/{theming → theming-next}/_token-resolution.scss +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
/// Sets all of the standard typography tokens for the given token base name to the given typography
|
|
5
|
+
/// level.
|
|
6
|
+
/// @param {Map} $systems The MDC system tokens
|
|
7
|
+
/// @param {String} $base-name The token base name to get the typography tokens for
|
|
8
|
+
/// @param {String} $typography-level The typography level to base the token values on
|
|
9
|
+
/// @return {Map} A map containing the typography tokens for the given base token name
|
|
10
|
+
@function _generate-typography-tokens($systems, $base-name, $typography-level) {
|
|
11
|
+
$result: ();
|
|
12
|
+
@each $prop in (font, line-height, size, tracking, weight) {
|
|
13
|
+
$result: map.set($result, #{$base-name}-#{$prop},
|
|
14
|
+
map.get($systems, md-sys-typescale, #{$typography-level}-#{$prop}));
|
|
15
|
+
}
|
|
16
|
+
@return $result;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Generates custom tokens for the mat-card.
|
|
20
|
+
/// @param {Map} $systems The MDC system tokens
|
|
21
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
22
|
+
/// @return {Map} A set of custom tokens for the mat-card
|
|
23
|
+
@function card($systems, $exclude-hardcoded) {
|
|
24
|
+
@return mat.private-merge-all(
|
|
25
|
+
_generate-typography-tokens($systems, title-text, title-large),
|
|
26
|
+
_generate-typography-tokens($systems, subtitle-text, title-medium),
|
|
27
|
+
(
|
|
28
|
+
subtitle-text-color: map.get($systems, md-ref-color, on-surface)
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// This file contains functions used to define Angular Material theme objects.
|
|
2
|
+
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use '@angular/material' as mat;
|
|
5
|
+
@use './m3-palettes';
|
|
6
|
+
@use './m3-tokens';
|
|
7
|
+
@use './config-validation';
|
|
8
|
+
|
|
9
|
+
/// Map key used to store internals of theme config.
|
|
10
|
+
$internals: _mat-theming-internals-do-not-access;
|
|
11
|
+
/// The theme version of generated themes.
|
|
12
|
+
$theme-version: 1;
|
|
13
|
+
|
|
14
|
+
/// Defines an Angular Material theme object with color, typography, and density settings.
|
|
15
|
+
/// @param {Map} $config The theme configuration
|
|
16
|
+
/// @return {Map} A theme object
|
|
17
|
+
@function define-theme($config: ()) {
|
|
18
|
+
$err: config-validation.validate-theme-config($config);
|
|
19
|
+
@if $err {
|
|
20
|
+
@error $err;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@return mat.private-deep-merge-all(
|
|
24
|
+
define-colors(map.get($config, color) or ()),
|
|
25
|
+
define-typography(map.get($config, typography) or ()),
|
|
26
|
+
define-density(map.get($config, density) or ()),
|
|
27
|
+
($internals: (base-tokens: m3-tokens.generate-base-tokens())),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Defines an Angular Material theme object with color settings.
|
|
32
|
+
/// @param {Map} $config The color configuration
|
|
33
|
+
/// @return {Map} A theme object
|
|
34
|
+
@function define-colors($config: ()) {
|
|
35
|
+
$err: config-validation.validate-color-config($config);
|
|
36
|
+
@if $err {
|
|
37
|
+
@error $err;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
$type: map.get($config, theme-type) or light;
|
|
41
|
+
$primary: map.get($config, primary) or m3-palettes.$indigo-palette;
|
|
42
|
+
$secondary: map.get($config, secondary) or $primary;
|
|
43
|
+
$tertiary: map.get($config, tertiary) or $secondary;
|
|
44
|
+
|
|
45
|
+
@return (
|
|
46
|
+
$internals: (
|
|
47
|
+
theme-version: $theme-version,
|
|
48
|
+
theme-type: $type,
|
|
49
|
+
palettes: (
|
|
50
|
+
primary: map.remove($primary, neutral-variant),
|
|
51
|
+
secondary: map.remove($secondary, neutral-variant),
|
|
52
|
+
tertiary: map.remove($tertiary, neutral-variant),
|
|
53
|
+
neutral: m3-palettes.$neutral-palette,
|
|
54
|
+
neutral-variant: map.get($primary, neutral-variant),
|
|
55
|
+
error: m3-palettes.$red-palette
|
|
56
|
+
),
|
|
57
|
+
color-tokens: m3-tokens.generate-color-tokens($type, $primary, $secondary, $tertiary,
|
|
58
|
+
m3-palettes.$neutral-palette, m3-palettes.$red-palette)
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/// Defines an Angular Material theme object with typography settings.
|
|
64
|
+
/// @param {Map} $config The typography configuration
|
|
65
|
+
/// @return {Map} A theme object
|
|
66
|
+
@function define-typography($config: ()) {
|
|
67
|
+
$err: config-validation.validate-typography-config($config);
|
|
68
|
+
@if $err {
|
|
69
|
+
@error $err;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
$plain: map.get($config, plain-family) or (Roboto, sans-serif);
|
|
73
|
+
$brand: map.get($config, brand-family) or $plain;
|
|
74
|
+
$bold: map.get($config, bold-weight) or 700;
|
|
75
|
+
$medium: map.get($config, medium-weight) or 500;
|
|
76
|
+
$regular: map.get($config, regular-weight) or 400;
|
|
77
|
+
|
|
78
|
+
@return (
|
|
79
|
+
$internals: (
|
|
80
|
+
theme-version: $theme-version,
|
|
81
|
+
typography-tokens: m3-tokens.generate-typography-tokens(
|
|
82
|
+
$brand, $plain, $bold, $medium, $regular)
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/// Defines an Angular Material theme object with density settings.
|
|
88
|
+
/// @param {Map} $config The density configuration
|
|
89
|
+
/// @return {Map} A theme object
|
|
90
|
+
@function define-density($config: ()) {
|
|
91
|
+
$err: config-validation.validate-density-config($config);
|
|
92
|
+
@if $err {
|
|
93
|
+
@error $err;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
$density-scale: map.get($config, scale) or 0;
|
|
97
|
+
|
|
98
|
+
@return (
|
|
99
|
+
$internals: (
|
|
100
|
+
theme-version: $theme-version,
|
|
101
|
+
density-scale: $density-scale,
|
|
102
|
+
density-tokens: m3-tokens.generate-density-tokens($density-scale)
|
|
103
|
+
)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '@angular/material' as mat;
|
|
4
|
+
|
|
5
|
+
/// Maps namespaced tokens to per-density-scale values.
|
|
6
|
+
/// This is used as a temporary solution for density, since Material Design currently does not have
|
|
7
|
+
/// systemized density.
|
|
8
|
+
/// Format:
|
|
9
|
+
/// (
|
|
10
|
+
/// (mdc, comp): (
|
|
11
|
+
/// token: (<scale 0 value>, <scale -1 value>, <scale -2 value>, ...),
|
|
12
|
+
/// ...
|
|
13
|
+
/// ),
|
|
14
|
+
/// ...
|
|
15
|
+
/// )
|
|
16
|
+
// TODO(mmalerba): Add density tokens for remaining components.
|
|
17
|
+
$_density-tokens: (
|
|
18
|
+
(mdc, checkbox): (
|
|
19
|
+
state-layer-size: (40px, 36px, 32px, 28px),
|
|
20
|
+
),
|
|
21
|
+
(mdc, elevated-card): (),
|
|
22
|
+
(mdc, outlined-card): (),
|
|
23
|
+
(mat, card): (),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/// Gets the value for the given density scale from the given set of density values.
|
|
27
|
+
/// @param {List} $density-values The list of values for each density scale.
|
|
28
|
+
/// @param {Number} $scale The density scale to get the value for.
|
|
29
|
+
/// @return {*} The value for the given scale.
|
|
30
|
+
@function _get-value-for-scale($density-values, $scale) {
|
|
31
|
+
$scale: mat.private-clamp-density($scale, -1 * list.length($density-values) + 1);
|
|
32
|
+
$index: -$scale + 1;
|
|
33
|
+
@return list.nth($density-values, $index);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Gets a map of all density tokens for the given scale
|
|
37
|
+
/// @param {Number} $scale The density scale
|
|
38
|
+
/// @return {Map} Map of all fully qualified density tokens for the given scale.
|
|
39
|
+
@function get-tokens-for-scale($scale) {
|
|
40
|
+
$result: ();
|
|
41
|
+
@each $namespace, $tokens in $_density-tokens {
|
|
42
|
+
@each $token, $density-values in $tokens {
|
|
43
|
+
$tokens: map.set($tokens, $token, _get-value-for-scale($density-values, $scale));
|
|
44
|
+
}
|
|
45
|
+
$result: map.set($result, $namespace, $tokens);
|
|
46
|
+
}
|
|
47
|
+
@return $result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/// Checks whether the given token is systemized by Angular Material's made up density system.
|
|
51
|
+
/// @param {List} $namespace The namespace of the token
|
|
52
|
+
/// @param {String} $token The name of the token
|
|
53
|
+
/// @return {Boolean} Whether the token is systemized by the density system
|
|
54
|
+
@function is-systemized($namespace, $token) {
|
|
55
|
+
@return map.get($_density-tokens, $namespace, $token) != null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/// Red color palette to be used as primary, secondary, or tertiary palette.
|
|
2
|
+
$red-palette: (
|
|
3
|
+
0: #000,
|
|
4
|
+
10: #410000,
|
|
5
|
+
20: #690100,
|
|
6
|
+
30: #930100,
|
|
7
|
+
40: #c00100,
|
|
8
|
+
50: #ef0000,
|
|
9
|
+
60: #ff5540,
|
|
10
|
+
70: #ff8a78,
|
|
11
|
+
80: #ffb4a8,
|
|
12
|
+
90: #ffdad4,
|
|
13
|
+
95: #ffedea,
|
|
14
|
+
99: #fffbff,
|
|
15
|
+
100: #fff,
|
|
16
|
+
neutral-variant: (
|
|
17
|
+
0: #000,
|
|
18
|
+
10: #251917,
|
|
19
|
+
20: #3b2d2b,
|
|
20
|
+
30: #534341,
|
|
21
|
+
40: #6c5a58,
|
|
22
|
+
50: #857370,
|
|
23
|
+
60: #a08c89,
|
|
24
|
+
70: #bca7a3,
|
|
25
|
+
80: #d8c2be,
|
|
26
|
+
90: #f5ddda,
|
|
27
|
+
95: #ffedea,
|
|
28
|
+
99: #fffbff,
|
|
29
|
+
100: #fff,
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/// Orange color palette to be used as primary, secondary, or tertiary palette.
|
|
34
|
+
$orange-palette: (
|
|
35
|
+
0: #000,
|
|
36
|
+
10: #2a1700,
|
|
37
|
+
20: #462a00,
|
|
38
|
+
30: #653e00,
|
|
39
|
+
40: #855400,
|
|
40
|
+
50: #a66a00,
|
|
41
|
+
60: #c98100,
|
|
42
|
+
70: #ed9900,
|
|
43
|
+
80: #ffb95c,
|
|
44
|
+
90: #ffddb7,
|
|
45
|
+
95: #ffeede,
|
|
46
|
+
99: #fffbff,
|
|
47
|
+
100: #fff,
|
|
48
|
+
neutral-variant: (
|
|
49
|
+
0: #000,
|
|
50
|
+
10: #221a10,
|
|
51
|
+
20: #382f24,
|
|
52
|
+
30: #504539,
|
|
53
|
+
40: #685c50,
|
|
54
|
+
50: #827568,
|
|
55
|
+
60: #9c8e80,
|
|
56
|
+
70: #b8a99a,
|
|
57
|
+
80: #d4c4b5,
|
|
58
|
+
90: #f0e0d0,
|
|
59
|
+
95: #ffeede,
|
|
60
|
+
99: #fffbff,
|
|
61
|
+
100: #fff,
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
/// Yellow color palette to be used as primary, secondary, or tertiary palette.
|
|
66
|
+
$yellow-palette: (
|
|
67
|
+
0: #000,
|
|
68
|
+
10: #1d1d00,
|
|
69
|
+
20: #323200,
|
|
70
|
+
30: #494900,
|
|
71
|
+
40: #626200,
|
|
72
|
+
50: #7b7b00,
|
|
73
|
+
60: #969600,
|
|
74
|
+
70: #b1b100,
|
|
75
|
+
80: #cdcd00,
|
|
76
|
+
90: #eaea00,
|
|
77
|
+
95: #f9f900,
|
|
78
|
+
99: #fffbff,
|
|
79
|
+
100: #fff,
|
|
80
|
+
neutral-variant: (
|
|
81
|
+
0: #000,
|
|
82
|
+
10: #1c1c11,
|
|
83
|
+
20: #313125,
|
|
84
|
+
30: #48473a,
|
|
85
|
+
40: #605f51,
|
|
86
|
+
50: #797869,
|
|
87
|
+
60: #939182,
|
|
88
|
+
70: #aeac9b,
|
|
89
|
+
80: #cac7b6,
|
|
90
|
+
90: #e6e3d1,
|
|
91
|
+
95: #f4f1df,
|
|
92
|
+
99: #fffbff,
|
|
93
|
+
100: #fff,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
/// Green color palette to be used as primary, secondary, or tertiary palette.
|
|
98
|
+
$green-palette: (
|
|
99
|
+
0: #000,
|
|
100
|
+
10: #002200,
|
|
101
|
+
20: #013a00,
|
|
102
|
+
30: #015300,
|
|
103
|
+
40: #026e00,
|
|
104
|
+
50: #038b00,
|
|
105
|
+
60: #03a800,
|
|
106
|
+
70: #03c700,
|
|
107
|
+
80: #02e600,
|
|
108
|
+
90: #77ff61,
|
|
109
|
+
95: #cbffb8,
|
|
110
|
+
99: #f7ffee,
|
|
111
|
+
100: #fff,
|
|
112
|
+
neutral-variant: (
|
|
113
|
+
0: #000,
|
|
114
|
+
10: #1a1c18,
|
|
115
|
+
20: #2f312d,
|
|
116
|
+
30: #454743,
|
|
117
|
+
40: #5d5f5a,
|
|
118
|
+
50: #767872,
|
|
119
|
+
60: #90918c,
|
|
120
|
+
70: #abaca6,
|
|
121
|
+
80: #c6c7c1,
|
|
122
|
+
90: #e2e3dc,
|
|
123
|
+
95: #f1f1eb,
|
|
124
|
+
99: #fcfdf6,
|
|
125
|
+
100: #fff,
|
|
126
|
+
),
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
/// Blue color palette to be used as primary, secondary, or tertiary palette.
|
|
130
|
+
$blue-palette: (
|
|
131
|
+
0: #000,
|
|
132
|
+
10: #00006e,
|
|
133
|
+
20: #0001ac,
|
|
134
|
+
30: #0000ef,
|
|
135
|
+
40: #343dff,
|
|
136
|
+
50: #5a64ff,
|
|
137
|
+
60: #7c84ff,
|
|
138
|
+
70: #9da3ff,
|
|
139
|
+
80: #bec2ff,
|
|
140
|
+
90: #e0e0ff,
|
|
141
|
+
95: #f1efff,
|
|
142
|
+
99: #fffbff,
|
|
143
|
+
100: #fff,
|
|
144
|
+
neutral-variant: (
|
|
145
|
+
0: #000,
|
|
146
|
+
10: #1b1b23,
|
|
147
|
+
20: #303038,
|
|
148
|
+
30: #46464f,
|
|
149
|
+
40: #5e5d67,
|
|
150
|
+
50: #777680,
|
|
151
|
+
60: #91909a,
|
|
152
|
+
70: #acaab4,
|
|
153
|
+
80: #c7c5d0,
|
|
154
|
+
90: #e4e1ec,
|
|
155
|
+
95: #f2effa,
|
|
156
|
+
99: #fffbff,
|
|
157
|
+
100: #fff,
|
|
158
|
+
),
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
/// Indigo color palette to be used as primary, secondary, or tertiary palette.
|
|
162
|
+
$indigo-palette: (
|
|
163
|
+
0: #000,
|
|
164
|
+
10: #2c0050,
|
|
165
|
+
20: #4a0080,
|
|
166
|
+
30: #622599,
|
|
167
|
+
40: #7b41b3,
|
|
168
|
+
50: #965bce,
|
|
169
|
+
60: #b175ea,
|
|
170
|
+
70: #cb93ff,
|
|
171
|
+
80: #ddb7ff,
|
|
172
|
+
90: #f0dbff,
|
|
173
|
+
95: #faecff,
|
|
174
|
+
99: #fffbff,
|
|
175
|
+
100: #fff,
|
|
176
|
+
neutral-variant: (
|
|
177
|
+
0: #000,
|
|
178
|
+
10: #1e1a22,
|
|
179
|
+
20: #342f37,
|
|
180
|
+
30: #4a454e,
|
|
181
|
+
40: #625c65,
|
|
182
|
+
50: #7c757e,
|
|
183
|
+
60: #968e98,
|
|
184
|
+
70: #b1a8b3,
|
|
185
|
+
80: #cdc4ce,
|
|
186
|
+
90: #e9dfeb,
|
|
187
|
+
95: #f7eef9,
|
|
188
|
+
99: #fffbff,
|
|
189
|
+
100: #fff,
|
|
190
|
+
),
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
/// Violet color palette to be used as primary, secondary, or tertiary palette.
|
|
194
|
+
$violet-palette: (
|
|
195
|
+
0: #000,
|
|
196
|
+
10: #270057,
|
|
197
|
+
20: #42008a,
|
|
198
|
+
30: #5e00c1,
|
|
199
|
+
40: #7d00fa,
|
|
200
|
+
50: #934bff,
|
|
201
|
+
60: #a974ff,
|
|
202
|
+
70: #bf98ff,
|
|
203
|
+
80: #d5baff,
|
|
204
|
+
90: #ecdcff,
|
|
205
|
+
95: #f7edff,
|
|
206
|
+
99: #fffbff,
|
|
207
|
+
100: #fff,
|
|
208
|
+
neutral-variant: (
|
|
209
|
+
0: #000,
|
|
210
|
+
10: #1d1a22,
|
|
211
|
+
20: #332f37,
|
|
212
|
+
30: #49454e,
|
|
213
|
+
40: #615c66,
|
|
214
|
+
50: #7b757f,
|
|
215
|
+
60: #958e99,
|
|
216
|
+
70: #afa9b3,
|
|
217
|
+
80: #cbc4cf,
|
|
218
|
+
90: #e8e0eb,
|
|
219
|
+
95: #f6eef9,
|
|
220
|
+
99: #fffbff,
|
|
221
|
+
100: #fff,
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
/// Gray palette used for backgrounds and surfaces.
|
|
226
|
+
$neutral-palette: (
|
|
227
|
+
0: #000,
|
|
228
|
+
4: #0e0e11,
|
|
229
|
+
6: #141317,
|
|
230
|
+
10: #1c1b1f,
|
|
231
|
+
12: #201f23,
|
|
232
|
+
17: #2b292d,
|
|
233
|
+
20: #313033,
|
|
234
|
+
22: #313033,
|
|
235
|
+
24: #313033,
|
|
236
|
+
30: #484649,
|
|
237
|
+
40: #605d62,
|
|
238
|
+
50: #787579,
|
|
239
|
+
60: #939094,
|
|
240
|
+
70: #aeaaae,
|
|
241
|
+
80: #c9c5ca,
|
|
242
|
+
87: #ddd8dd,
|
|
243
|
+
90: #e6e1e5,
|
|
244
|
+
92: #ece7ec,
|
|
245
|
+
94: #f1ecf1,
|
|
246
|
+
95: #f4eff4,
|
|
247
|
+
96: #f7f2f7,
|
|
248
|
+
98: #fdf8fd,
|
|
249
|
+
99: #fffbfe,
|
|
250
|
+
100: #fff,
|
|
251
|
+
);
|