@angular/material-experimental 17.0.0 → 17.0.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 (34) hide show
  1. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
  2. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +3 -3
  3. package/esm2022/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +3 -3
  4. package/esm2022/column-resize/column-resize-directives/default-enabled-column-resize.mjs +3 -3
  5. package/esm2022/column-resize/column-resize-module.mjs +12 -12
  6. package/esm2022/column-resize/overlay-handle.mjs +3 -3
  7. package/esm2022/column-resize/resizable-directives/default-enabled-resizable.mjs +3 -3
  8. package/esm2022/column-resize/resizable-directives/resizable.mjs +3 -3
  9. package/esm2022/column-resize/resize-strategy.mjs +3 -3
  10. package/esm2022/menubar/menubar-item.mjs +3 -3
  11. package/esm2022/menubar/menubar-module.mjs +4 -4
  12. package/esm2022/menubar/menubar.mjs +3 -3
  13. package/esm2022/popover-edit/lens-directives.mjs +9 -9
  14. package/esm2022/popover-edit/popover-edit-module.mjs +4 -4
  15. package/esm2022/popover-edit/table-directives.mjs +12 -12
  16. package/esm2022/selection/row-selection.mjs +3 -3
  17. package/esm2022/selection/select-all.mjs +3 -3
  18. package/esm2022/selection/selection-column.mjs +3 -3
  19. package/esm2022/selection/selection-module.mjs +4 -4
  20. package/esm2022/selection/selection-toggle.mjs +3 -3
  21. package/esm2022/selection/selection.mjs +3 -3
  22. package/esm2022/version.mjs +1 -1
  23. package/fesm2022/column-resize.mjs +36 -36
  24. package/fesm2022/material-experimental.mjs +1 -1
  25. package/fesm2022/material-experimental.mjs.map +1 -1
  26. package/fesm2022/menubar.mjs +10 -10
  27. package/fesm2022/popover-edit.mjs +25 -25
  28. package/fesm2022/selection.mjs +19 -19
  29. package/package.json +3 -3
  30. package/theming/_custom-tokens.scss +530 -20
  31. package/theming/_definition.scss +8 -8
  32. package/theming/_m3-density.scss +65 -14
  33. package/theming/_m3-palettes.scss +409 -184
  34. package/theming/_m3-tokens.scss +236 -85
@@ -1,6 +1,11 @@
1
1
  @use 'sass:map';
2
2
  @use '@angular/material' as mat;
3
3
 
4
+ /// Hardcode the given value, or null if hardcoded values are excluded.
5
+ @function _hardcode($value, $exclude-hardcoded) {
6
+ @return if($exclude-hardcoded, null, $value);
7
+ }
8
+
4
9
  /// Sets all of the standard typography tokens for the given token base name to the given typography
5
10
  /// level.
6
11
  /// @param {Map} $systems The MDC system tokens
@@ -16,41 +21,426 @@
16
21
  @return $result;
17
22
  }
18
23
 
24
+ /// Generates custom tokens for the mat-autocomplete.
25
+ /// @param {Map} $systems The MDC system tokens
26
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
27
+ /// @return {Map} A set of custom tokens for the mat-autocomplete
28
+ @function autocomplete($systems, $exclude-hardcoded) {
29
+ @return (
30
+ background-color: map.get($systems, md-sys-color, surface-container),
31
+ );
32
+ }
33
+
34
+ /// Generates custom tokens for the mat-badge.
35
+ /// @param {Map} $systems The MDC system tokens
36
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
37
+ /// @return {Map} A set of custom tokens for the mat-badge
38
+ @function badge($systems, $exclude-hardcoded) {
39
+ @return (
40
+ background-color: map.get($systems, md-sys-color, error),
41
+ text-color: map.get($systems, md-sys-color, on-error),
42
+ disabled-state-background-color: mat.private-safe-color-change(
43
+ map.get($systems, md-sys-color, error),
44
+ $alpha: 0.38,
45
+ ),
46
+ disabled-state-text-color: map.get($systems, md-sys-color, on-error),
47
+ text-font: map.get($systems, md-sys-typescale, label-small-font),
48
+ text-size: map.get($systems, md-sys-typescale, label-small-size),
49
+ text-weight: map.get($systems, md-sys-typescale, label-small-weight),
50
+ small-size-text-size: _hardcode(0, $exclude-hardcoded),
51
+ large-size-text-size: map.get($systems, md-sys-typescale, label-small-size),
52
+ );
53
+ }
54
+
55
+ /// Generates custom tokens for the mat-bottom-sheet.
56
+ /// @param {Map} $systems The MDC system tokens
57
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
58
+ /// @return {Map} A set of custom tokens for the mat-bottom-sheet
59
+ @function bottom-sheet($systems, $exclude-hardcoded) {
60
+ @return mat.private-merge-all(
61
+ _generate-typography-tokens($systems, container-text, body-large),
62
+ (
63
+ container-shape: _hardcode(28px, $exclude-hardcoded),
64
+ container-text-color: map.get($systems, md-sys-color, on-surface),
65
+ container-background-color: map.get($systems, md-sys-color, surface-container-low),
66
+ ),
67
+ );
68
+ }
69
+
70
+ /// Generates custom tokens for the mat-button-toggle.
71
+ /// @param {Map} $systems The MDC system tokens
72
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
73
+ /// @return {Map} A set of custom tokens for the mat-button-toggle
74
+ @function button-toggle($systems, $exclude-hardcoded) {
75
+ @return (
76
+ shape: _hardcode(9999px, $exclude-hardcoded),
77
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
78
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
79
+ text-color: map.get($systems, md-sys-color, on-surface),
80
+ background-color: _hardcode(transparent, $exclude-hardcoded),
81
+ state-layer-color: map.get($systems, md-sys-color, on-surface),
82
+ selected-state-background-color: map.get($systems, md-sys-color, secondary-container),
83
+ selected-state-text-color: map.get($systems, md-sys-color, on-secondary-container),
84
+ disabled-state-text-color: mat.private-safe-color-change(
85
+ map.get($systems, md-sys-color, on-surface),
86
+ $alpha: 0.38,
87
+ ),
88
+ disabled-state-background-color: _hardcode(transparent, $exclude-hardcoded),
89
+ disabled-selected-state-text-color: mat.private-safe-color-change(
90
+ map.get($systems, md-sys-color, on-surface),
91
+ $alpha: 0.38,
92
+ ),
93
+ disabled-selected-state-background-color: mat.private-safe-color-change(
94
+ map.get($systems, md-sys-color, on-surface),
95
+ $alpha: 0.12,
96
+ ),
97
+ divider-color: map.get($systems, md-sys-color, outline),
98
+ text-font: map.get($systems, md-sys-typescale, label-large-font),
99
+ );
100
+ }
101
+
19
102
  /// Generates custom tokens for the mat-card.
20
103
  /// @param {Map} $systems The MDC system tokens
21
104
  /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
22
105
  /// @return {Map} A set of custom tokens for the mat-card
23
106
  @function card($systems, $exclude-hardcoded) {
24
107
  @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-sys-color, on-surface)
29
- )
108
+ _generate-typography-tokens($systems, title-text, title-large),
109
+ _generate-typography-tokens($systems, subtitle-text, title-medium),
110
+ (
111
+ subtitle-text-color: map.get($systems, md-sys-color, on-surface)
112
+ )
30
113
  );
31
114
  }
32
115
 
33
- /// Generates custom tokens for the mat-toolbar.
116
+ /// Generates custom tokens for the mdc-chip. (MDC has a chip component, but they
117
+ /// seem to have made up the tokens rather than using ones generated from the token database,
118
+ /// therefore we need a custom token function for it).
34
119
  /// @param {Map} $systems The MDC system tokens
35
120
  /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
36
- /// @return {Map} A set of custom tokens for the mat-toolbar
37
- @function toolbar($systems, $exclude-hardcoded) {
121
+ /// @return {Map} A set of custom tokens for the mdc-chip
122
+ @function chip($systems, $exclude-hardcoded) {
38
123
  @return mat.private-merge-all(
39
- _generate-typography-tokens($systems, title-text, title-large),
40
- (
41
- container-background-color: map.get($systems, md-sys-color, surface),
42
- container-text-color: map.get($systems, md-sys-color, on-surface),
43
- )
124
+ _generate-typography-tokens($systems, label-text, label-large),
125
+ (
126
+ container-shape: _hardcode((
127
+ family: rounded,
128
+ radius: 8px,
129
+ ), $exclude-hardcoded),
130
+ with-avatar-avatar-size: _hardcode(24px, $exclude-hardcoded),
131
+ elevated-container-color: map.get($systems, md-sys-color, surface-container-low),
132
+ elevated-disabled-container-color: mat.private-safe-color-change(
133
+ map.get($systems, md-sys-color, on-surface),
134
+ $alpha: 0.12,
135
+ ),
136
+ label-text-color: map.get($systems, md-sys-color, on-surface-variant),
137
+ disabled-label-text-color: mat.private-safe-color-change(
138
+ map.get($systems, md-sys-color, on-surface),
139
+ $alpha: 0.38,
140
+ ),
141
+ with-icon-icon-size: _hardcode(18px, $exclude-hardcoded),
142
+ with-icon-icon-color: map.get($systems, md-sys-color, on-surface-variant),
143
+ with-icon-disabled-icon-color: mat.private-safe-color-change(
144
+ map.get($systems, md-sys-color, on-surface),
145
+ $alpha: 0.38,
146
+ ),
147
+ with-icon-selected-icon-color: map.get($systems, md-sys-color, on-secondary-container),
148
+ with-trailing-icon-trailing-icon-color: map.get($systems, md-sys-color, on-surface-variant),
149
+ with-trailing-icon-disabled-trailing-icon-color: mat.private-safe-color-change(
150
+ map.get($systems, md-sys-color, on-surface),
151
+ $alpha: 0.38,
152
+ ),
153
+ focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
154
+ focus-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
155
+ ),
156
+ );
157
+ }
158
+
159
+ /// Generates custom tokens for the mat-datepicker.
160
+ /// @param {Map} $systems The MDC system tokens
161
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
162
+ /// @return {Map} A set of custom tokens for the mat-datepicker
163
+ @function datepicker($systems, $exclude-hardcoded) {
164
+ @return (
165
+ calendar-date-in-range-state-background-color:
166
+ map.get($systems, md-sys-color, primary-container),
167
+ calendar-date-in-comparison-range-state-background-color:
168
+ map.get($systems, md-sys-color, secondary-container),
169
+ calendar-date-in-overlap-range-state-background-color:
170
+ map.get($systems, md-sys-color, tertiary-container),
171
+ calendar-date-in-overlap-range-selected-state-background-color:
172
+ map.get($systems, md-sys-color, tertiary),
173
+ calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-primary),
174
+ calendar-date-selected-state-background-color: map.get($systems, md-sys-color, primary),
175
+ calendar-date-selected-disabled-state-background-color: mat.private-safe-color-change(
176
+ map.get($systems, md-sys-color, on-surface),
177
+ $alpha: 0.38
178
+ ),
179
+ calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, primary),
180
+ calendar-date-focus-state-background-color: mat.private-safe-color-change(
181
+ map.get($systems, md-sys-color, on-surface),
182
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
183
+ ),
184
+ calendar-date-hover-state-background-color: mat.private-safe-color-change(
185
+ map.get($systems, md-sys-color, on-surface),
186
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
187
+ ),
188
+ toggle-active-state-icon-color: map.get($systems, md-sys-color, on-surface-variant),
189
+ toggle-icon-color: map.get($systems, md-sys-color, on-surface-variant),
190
+ calendar-body-label-text-color: map.get($systems, md-sys-color, on-surface),
191
+ calendar-period-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
192
+ calendar-navigation-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
193
+ calendar-header-divider-color: map.get($systems, md-sys-color, outline-variant),
194
+ calendar-header-text-color: map.get($systems, md-sys-color, on-surface-variant),
195
+ calendar-date-today-outline-color: map.get($systems, md-sys-color, primary),
196
+ calendar-date-today-disabled-state-outline-color: mat.private-safe-color-change(
197
+ map.get($systems, md-sys-color, on-surface),
198
+ $alpha: 0.38
199
+ ),
200
+ calendar-date-text-color: map.get($systems, md-sys-color, on-surface),
201
+ calendar-date-outline-color: _hardcode(transparent, $exclude-hardcoded),
202
+ calendar-date-disabled-state-text-color: mat.private-safe-color-change(
203
+ map.get($systems, md-sys-color, on-surface),
204
+ $alpha: 0.38
205
+ ),
206
+ calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, primary),
207
+ range-input-separator-color: map.get($systems, md-sys-color, on-surface),
208
+ range-input-disabled-state-separator-color: mat.private-safe-color-change(
209
+ map.get($systems, md-sys-color, on-surface),
210
+ $alpha: 0.38
211
+ ),
212
+ range-input-disabled-state-text-color: mat.private-safe-color-change(
213
+ map.get($systems, md-sys-color, on-surface),
214
+ $alpha: 0.38
215
+ ),
216
+ calendar-container-background-color: map.get($systems, md-sys-color, surface-container-high),
217
+ calendar-container-text-color: map.get($systems, md-sys-color, on-surface),
218
+ calendar-text-font: map.get($systems, md-sys-typescale, body-large-font),
219
+ calendar-text-size: map.get($systems, md-sys-typescale, body-large-size),
220
+ calendar-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
221
+ calendar-body-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
222
+ calendar-period-button-text-size: map.get($systems, md-sys-typescale, title-small-size),
223
+ calendar-period-button-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
224
+ calendar-header-text-size: map.get($systems, md-sys-typescale, title-small-size),
225
+ calendar-header-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
226
+ );
227
+ }
228
+
229
+ /// Generates custom tokens for the mat-divider.
230
+ /// @param {Map} $systems The MDC system tokens
231
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
232
+ /// @return {Map} A set of custom tokens for the mat-divider
233
+ @function divider($systems, $exclude-hardcoded) {
234
+ @return (
235
+ width: _hardcode(1px, $exclude-hardcoded),
236
+ color: map.get($systems, md-sys-color, outline-variant),
237
+ );
238
+ }
239
+
240
+ /// Generates custom tokens for the mat-form-field.
241
+ /// @param {Map} $systems The MDC system tokens
242
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
243
+ /// @return {Map} A set of custom tokens for the mat-form-field
244
+ @function form-field($systems, $exclude-hardcoded) {
245
+ @return mat.private-merge-all(
246
+ _generate-typography-tokens($systems, container-text, body-large),
247
+ _generate-typography-tokens($systems, subscript-text, body-small),
248
+ (
249
+ disabled-input-text-placeholder-color: mat.private-safe-color-change(
250
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
251
+ state-layer-color: map.get($systems, md-sys-color, on-surface),
252
+ error-text-color: map.get($systems, md-sys-color, error),
253
+ select-option-text-color: map.get($systems, md-ref-palette, neutral10),
254
+ select-disabled-option-text-color: mat.private-safe-color-change(
255
+ map.get($systems, md-ref-palette, neutral10), $alpha: 0.38),
256
+ enabled-select-arrow-color: map.get($systems, md-sys-color, on-surface-variant),
257
+ disabled-select-arrow-color: mat.private-safe-color-change(
258
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
259
+ hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
260
+ focus-state-layer-opacity: _hardcode(0, $exclude-hardcoded),
261
+ focus-select-arrow-color: map.get($systems, md-sys-color, primary),
262
+ outlined-label-text-populated-size: map.get($systems, md-sys-typeface, body-large-size),
263
+ )
264
+ );
265
+ }
266
+
267
+ /// Generates custom tokens for the mat-grid-list.
268
+ /// @param {Map} $systems The MDC system tokens
269
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
270
+ /// @return {Map} A set of custom tokens for the mat-grid-list
271
+ @function grid-list($systems, $exclude-hardcoded) {
272
+ @return (
273
+ tile-header-primary-text-size: map.get($systems, md-sys-typescale, body-large),
274
+ tile-header-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
275
+ tile-footer-primary-text-size: map.get($systems, md-sys-typescale, body-large),
276
+ tile-footer-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
277
+ );
278
+ }
279
+
280
+ /// Generates custom tokens for the mat-icon.
281
+ /// @param {Map} $systems The MDC system tokens
282
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
283
+ /// @return {Map} A set of custom tokens for the mat-icon
284
+ @function icon($systems, $exclude-hardcoded) {
285
+ @return (
286
+ color: _hardcode(inherit, $exclude-hardcoded),
287
+ );
288
+ }
289
+
290
+ /// Generates custom tokens for the mat-menu.
291
+ /// @param {Map} $systems The MDC system tokens
292
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
293
+ /// @return {Map} A set of custom tokens for the mat-menu
294
+ @function menu($systems, $exclude-hardcoded) {
295
+ @return mat.private-merge-all(
296
+ _generate-typography-tokens($systems, item-label-text, label-large),
297
+ (
298
+ container-shape: _hardcode(4px, $exclude-hardcoded),
299
+ item-label-text-color: map.get($systems, md-sys-color, on-surface),
300
+ item-icon-color: map.get($systems, md-sys-color, on-surface-variant),
301
+ item-hover-state-layer-color: mat.private-safe-color-change(
302
+ map.get($systems, md-sys-color, on-surface),
303
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
304
+ ),
305
+ item-focus-state-layer-color: mat.private-safe-color-change(
306
+ map.get($systems, md-sys-color, on-surface),
307
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
308
+ ),
309
+ container-color: map.get($systems, md-sys-color, surface-container),
310
+ )
311
+ );
312
+ }
313
+
314
+ /// Generates custom tokens for the mat-optgroup.
315
+ /// @param {Map} $systems The MDC system tokens
316
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
317
+ /// @return {Map} A set of custom tokens for the mat-optgroup
318
+ @function optgroup($systems, $exclude-hardcoded) {
319
+ @return mat.private-merge-all(
320
+ _generate-typography-tokens($systems, label-text, title-small),
321
+ (
322
+ label-text-color: map.get($systems, md-sys-color, on-surface-variant),
323
+ )
44
324
  );
45
325
  }
46
326
 
327
+ /// Generates custom tokens for the mat-option.
328
+ /// @param {Map} $systems The MDC system tokens
329
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
330
+ /// @return {Map} A set of custom tokens for the mat-option
331
+ @function option($systems, $exclude-hardcoded) {
332
+ @return mat.private-merge-all(
333
+ _generate-typography-tokens($systems, label-text, label-large),
334
+ (
335
+ selected-state-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
336
+ label-text-color: map.get($systems, md-sys-color, on-surface),
337
+ hover-state-layer-color: mat.private-safe-color-change(
338
+ map.get($systems, md-sys-color, on-surface),
339
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
340
+ ),
341
+ focus-state-layer-color: mat.private-safe-color-change(
342
+ map.get($systems, md-sys-color, on-surface),
343
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
344
+ ),
345
+ selected-state-layer-color: map.get($systems, md-sys-color, secondary-container),
346
+ ),
347
+ );
348
+ }
349
+
350
+ /// Generates custom tokens for the mat-paginator.
351
+ /// @param {Map} $systems The MDC system tokens
352
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
353
+ /// @return {Map} A set of custom tokens for the mat-paginator
354
+ @function paginator($systems, $exclude-hardcoded) {
355
+ @return mat.private-merge-all(
356
+ _generate-typography-tokens($systems, container-text, body-small),
357
+ (
358
+ container-text-color: map.get($systems, md-sys-color, on-surface),
359
+ container-background-color: map.get($systems, md-sys-color, surface),
360
+ enabled-icon-color: map.get($systems, md-sys-color, on-surface-variant),
361
+ disabled-icon-color: mat.private-safe-color-change(
362
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
363
+ select-trigger-text-size: map.get($systems, md-sys-typescale, body-small-size),
364
+ )
365
+ );
366
+ }
367
+
368
+ /// Generates custom tokens for the mat-radio.
369
+ /// @param {Map} $systems The MDC system tokens
370
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
371
+ /// @return {Map} A set of custom tokens for the mat-radio
372
+ @function radio($systems, $exclude-hardcoded) {
373
+ @return (
374
+ ripple-color: map.get($systems, md-sys-color, on-surface),
375
+ checked-ripple-color: map.get($systems, md-sys-color, primary),
376
+ disabled-label-color: map.get($systems, md-sys-color, on-surface),
377
+ );
378
+ }
379
+
380
+ /// Generates custom tokens for the mat-ripple.
381
+ /// @param {Map} $systems The MDC system tokens
382
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
383
+ /// @return {Map} A set of custom tokens for the mat-ripple
384
+ @function ripple($systems, $exclude-hardcoded) {
385
+ @return (
386
+ color: mat.private-safe-color-change(map.get($systems, md-sys-color, on-surface), $alpha: 0.1),
387
+ );
388
+ }
389
+
390
+ /// Generates custom tokens for the mat-select.
391
+ /// @param {Map} $systems The MDC system tokens
392
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
393
+ /// @return {Map} A set of custom tokens for the mat-select
394
+ @function select($systems, $exclude-hardcoded) {
395
+ @return mat.private-merge-all(
396
+ _generate-typography-tokens($systems, trigger-text, body-large),
397
+ (
398
+ panel-background-color: map.get($systems, md-sys-color, surface-container),
399
+ enabled-trigger-text-color: map.get($systems, md-sys-color, on-surface),
400
+ disabled-trigger-text-color: mat.private-safe-color-change(
401
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
402
+ placeholder-text-color: map.get($systems, md-sys-color, on-surface-variant),
403
+ enabled-arrow-color: map.get($systems, md-sys-color, on-surface-variant),
404
+ disabled-arrow-color: mat.private-safe-color-change(
405
+ map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
406
+ focused-arrow-color: map.get($systems, md-sys-color, primary),
407
+ invalid-arrow-color: map.get($systems, md-sys-color, error),
408
+ )
409
+ );
410
+ }
411
+
412
+ /// Generates custom tokens for the mat-sidenav.
413
+ /// @param {Map} $systems The MDC system tokens
414
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
415
+ /// @return {Map} A set of custom tokens for the mat-sidenav
416
+ @function sidenav($systems, $exclude-hardcoded) {
417
+ @return (
418
+ container-shape: 16px,
419
+ container-divider-color: map.get($systems, md-sys-color, outline),
420
+ container-background-color: map.get($systems, md-sys-color, surface),
421
+ container-text-color: map.get($systems, md-sys-color, on-surface-variant),
422
+ content-background-color: _hardcode(inherit, $exclude-hardcoded),
423
+ content-text-color: _hardcode(inherit, $exclude-hardcoded),
424
+ scrim-color: mat.private-safe-color-change(
425
+ map.get($systems, md-ref-palette, neutral-variant20), $alpha: 0.4),
426
+ );
427
+ }
428
+
429
+ /// Generates custom tokens for the mat-slide-toggle.
430
+ /// @param {Map} $systems The MDC system tokens
431
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
432
+ /// @return {Map} A set of custom tokens for the mat-slide-toggle
433
+ @function slide-toggle($systems, $exclude-hardcoded) {
434
+ @return _generate-typography-tokens($systems, label-text, label-large);
435
+ }
436
+
47
437
  /// Generates custom tokens for the mat-slider.
48
438
  /// @param {Map} $systems The MDC system tokens
49
439
  /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
50
440
  /// @return {Map} A set of custom tokens for the mat-slider
51
441
  @function slider($systems, $exclude-hardcoded) {
52
442
  @return (
53
- value-indicator-opacity: 1,
443
+ value-indicator-opacity: _hardcode(1, $exclude-hardcoded),
54
444
  );
55
445
  }
56
446
 
@@ -64,14 +454,134 @@
64
454
  );
65
455
  }
66
456
 
67
- /// Generates custom tokens for the mat-radio.
457
+ /// Generates custom tokens for the mat-sort.
68
458
  /// @param {Map} $systems The MDC system tokens
69
459
  /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
70
- /// @return {Map} A set of custom tokens for the mat-radio
71
- @function radio($systems, $exclude-hardcoded) {
460
+ /// @return {Map} A set of custom tokens for the mat-sort
461
+ @function sort($systems, $exclude-hardcoded) {
72
462
  @return (
73
- ripple-color: map.get($systems, md-sys-color, on-surface),
74
- checked-ripple-color: map.get($systems, md-sys-color, primary),
75
- disabled-label-color: map.get($systems, md-sys-color, on-surface),
463
+ arrow-color: map.get($systems, md-sys-color, on-surface),
464
+ );
465
+ }
466
+
467
+ /// Generates custom tokens for the mat-stepper.
468
+ /// @param {Map} $systems The MDC system tokens
469
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
470
+ /// @return {Map} A set of custom tokens for the mat-stepper
471
+ @function stepper($systems, $exclude-hardcoded) {
472
+ @return mat.private-merge-all(
473
+ (
474
+ container-color: map.get($systems, md-sys-color, surface),
475
+ line-color: map.get($systems, md-sys-color, outline-variant),
476
+ header-hover-state-layer-color: mat.private-safe-color-change(
477
+ map.get($systems, md-sys-color, inverse-surface),
478
+ $alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
479
+ ),
480
+ header-focus-state-layer-color: mat.private-safe-color-change(
481
+ map.get($systems, md-sys-color, inverse-surface),
482
+ $alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
483
+ ),
484
+ header-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
485
+ header-optional-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
486
+ header-selected-state-label-text-color: map.get($systems, md-sys-color, on-surface),
487
+ header-icon-background-color: map.get($systems, md-sys-color, inverse-surface),
488
+ header-icon-foreground-color: map.get($systems, md-sys-color, inverse-on-surface),
489
+ header-error-state-label-text-color: map.get($systems, md-sys-color, error),
490
+ header-error-state-icon-foreground-color: map.get($systems, md-sys-color, error),
491
+ header-error-state-icon-background-color: _hardcode(transparent, $exclude-hardcoded),
492
+ container-text-font: map.get($systems, md-sys-typescale, body-medium-font),
493
+ header-label-text-font: map.get($systems, md-sys-typescale, title-small-font),
494
+ header-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
495
+ header-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
496
+ header-error-state-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
497
+ header-selected-state-label-text-size: map.get($systems, md-sys-typescale, title-small-szie),
498
+ header-selected-state-label-text-weight: map.get(
499
+ $systems, md-sys-typescale, title-small-weight),
500
+ ),
501
+ );
502
+ }
503
+
504
+ /// Generates custom tokens for the mat-tab-header.
505
+ /// @param {Map} $systems The MDC system tokens
506
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
507
+ /// @return {Map} A set of custom tokens for the mat-tab-header
508
+ @function tab-header($systems, $exclude-hardcoded) {
509
+ @return mat.private-merge-all(
510
+ _generate-typography-tokens($systems, label-text, title-small),
511
+ (
512
+ disabled-ripple-color: null, // TODO(mmalerba): Figure out correct value.
513
+ pagination-icon-color: map.get($systems, md-sys-color, on-surface),
514
+ inactive-label-text-color: map.get($systems, md-sys-color, on-surface),
515
+ active-label-text-color: map.get($systems, md-sys-color, on-surface),
516
+ active-ripple-color: map.get($systems, md-sys-color, on-surface),
517
+ inactive-ripple-color: map.get($systems, md-sys-color, on-surface),
518
+ inactive-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
519
+ inactive-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
520
+ active-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
521
+ active-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
522
+ active-focus-indicator-color: map.get($systems, md-sys-color, primary),
523
+ active-hover-indicator-color: map.get($systems, md-sys-color, primary),
524
+ ),
525
+ );
526
+ }
527
+
528
+ /// Generates custom tokens for the mdc-tab-indicator. (MDC has a tab-indicator component, but they
529
+ /// seem to have made up the tokens rather than using ones generated from the token database,
530
+ /// therefore we need a custom token function for it).
531
+ /// @param {Map} $systems The MDC system tokens
532
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
533
+ /// @return {Map} A set of custom tokens for the mdc-tab-indicator
534
+ @function tab-indicator($systems, $exclude-hardcoded) {
535
+ @return (
536
+ active-indicator-height: _hardcode(2px, $exclude-hardcoded),
537
+ active-indicator-shape: _hardcode(0, $exclude-hardcoded),
538
+ active-indicator-color: map.get($systems, md-sys-color, primary),
539
+ );
540
+ }
541
+
542
+ /// Generates custom tokens for the mat-table.
543
+ /// @param {Map} $systems The MDC system tokens
544
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
545
+ /// @return {Map} A set of custom tokens for the mat-table
546
+ @function table($systems, $exclude-hardcoded) {
547
+ @return mat.private-merge-all(
548
+ _generate-typography-tokens($systems, header-headline, title-small),
549
+ _generate-typography-tokens($systems, row-item-label-text, body-medium),
550
+ _generate-typography-tokens($systems, footer-supporting-text, body-medium),
551
+ (
552
+ row-item-outline-width: _hardcode(1px, $exclude-hardcoded),
553
+ background-color: map.get($systems, md-sys-color, surface),
554
+ header-headline-color: map.get($systems, md-sys-color, on-surface),
555
+ row-item-label-text-color: map.get($systems, md-sys-color, on-surface),
556
+ row-item-outline-color: map.get($systems, md-sys-color, outline-variant),
557
+ ),
558
+ );
559
+ }
560
+
561
+ /// Generates custom tokens for the mat-toolbar.
562
+ /// @param {Map} $systems The MDC system tokens
563
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
564
+ /// @return {Map} A set of custom tokens for the mat-toolbar
565
+ @function toolbar($systems, $exclude-hardcoded) {
566
+ @return mat.private-merge-all(
567
+ _generate-typography-tokens($systems, title-text, title-large),
568
+ (
569
+ container-background-color: map.get($systems, md-sys-color, surface),
570
+ container-text-color: map.get($systems, md-sys-color, on-surface),
571
+ )
572
+ );
573
+ }
574
+
575
+ /// Generates custom tokens for the mat-tree.
576
+ /// @param {Map} $systems The MDC system tokens
577
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
578
+ /// @return {Map} A set of custom tokens for the mat-tree
579
+ @function tree($systems, $exclude-hardcoded) {
580
+ @return (
581
+ container-background-color: map.get($systems, md-sys-color, surface),
582
+ node-text-color: map.get($systems, md-sys-color, on-surface),
583
+ node-text-font: map.get($systems, md-sys-typescale, body-large-font),
584
+ node-text-size: map.get($systems, md-sys-typescale, body-large-size),
585
+ node-text-weight: map.get($systems, md-sys-typescale, body-large-weight),
76
586
  );
77
587
  }
@@ -38,7 +38,7 @@ $theme-version: 1;
38
38
  }
39
39
 
40
40
  $type: map.get($config, theme-type) or light;
41
- $primary: map.get($config, primary) or m3-palettes.$indigo-palette;
41
+ $primary: map.get($config, primary) or m3-palettes.$purple-palette;
42
42
  $secondary: map.get($config, secondary) or $primary;
43
43
  $tertiary: map.get($config, tertiary) or $secondary;
44
44
 
@@ -47,15 +47,15 @@ $theme-version: 1;
47
47
  theme-version: $theme-version,
48
48
  theme-type: $type,
49
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,
50
+ primary: map.remove($primary, neutral, neutral-variant),
51
+ secondary: map.remove($secondary, neutral, neutral-variant),
52
+ tertiary: map.remove($tertiary, neutral, neutral-variant),
53
+ neutral: map.get($primary, neutral),
54
54
  neutral-variant: map.get($primary, neutral-variant),
55
- error: m3-palettes.$red-palette
55
+ error: map.remove(m3-palettes.$red-palette, neutral, neutral-variant),
56
56
  ),
57
- color-tokens: m3-tokens.generate-color-tokens($type, $primary, $secondary, $tertiary,
58
- m3-palettes.$neutral-palette, m3-palettes.$red-palette)
57
+ color-tokens: m3-tokens.generate-color-tokens(
58
+ $type, $primary, $secondary, $tertiary, m3-palettes.$red-palette)
59
59
  )
60
60
  );
61
61
  }