@ng-matero/extensions 20.2.0 → 20.3.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 +2 -2
- package/alert/_alert-theme.scss +1 -1
- package/colorpicker/_colorpicker-theme.scss +1 -1
- package/colorpicker/index.d.ts +4 -3
- package/core/m2/_typography.scss +216 -0
- package/core/theming/_definition.scss +22 -13
- package/core/theming/_m2-inspection.scss +235 -0
- package/core/theming/prebuilt/azure-blue.scss +2 -2
- package/core/theming/prebuilt/cyan-orange.scss +2 -2
- package/core/theming/prebuilt/magenta-violet.scss +2 -2
- package/core/theming/prebuilt/rose-red.scss +2 -2
- package/core/tokens/_m3-utils.scss +2 -14
- package/core/tokens/{_m3-system.scss → _system.scss} +85 -9
- package/core/tokens/m2/_index.scss +6 -0
- package/core/tokens/m2/_md-sys-color.scss +114 -0
- package/core/tokens/m2/_md-sys-elevation.scss +10 -0
- package/core/tokens/m2/_md-sys-motion.scss +30 -0
- package/core/tokens/m2/_md-sys-shape.scss +16 -0
- package/core/tokens/m2/_md-sys-state.scss +8 -0
- package/core/tokens/m2/_md-sys-typescale.scss +68 -0
- package/core/tokens/m3/_md-sys-color.scss +2 -14
- package/core/tokens/m3/_md-sys-typescale.scss +1 -1
- package/core/tokens/m3/_theme.scss +14 -26
- package/core/typography/_versioning.scss +91 -0
- package/datetimepicker/_datetimepicker-theme.scss +1 -1
- package/datetimepicker/index.d.ts +4 -1
- package/fesm2022/mtxAlert.mjs +7 -7
- package/fesm2022/mtxButton.mjs +7 -7
- package/fesm2022/mtxCheckboxGroup.mjs +7 -7
- package/fesm2022/mtxColorpicker.mjs +29 -22
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +43 -43
- package/fesm2022/mtxCore.mjs +21 -21
- package/fesm2022/mtxDatetimepicker.mjs +70 -65
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +10 -10
- package/fesm2022/mtxDrawer.mjs +10 -10
- package/fesm2022/mtxGrid.mjs +69 -69
- package/fesm2022/mtxLoader.mjs +7 -7
- package/fesm2022/mtxPhotoviewer.mjs +7 -7
- package/fesm2022/mtxPopover.mjs +19 -19
- package/fesm2022/mtxProgress.mjs +7 -7
- package/fesm2022/mtxSelect.mjs +52 -52
- package/fesm2022/mtxSplit.mjs +10 -10
- package/fesm2022/mtxTooltip.mjs +10 -10
- package/package.json +22 -22
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
1
2
|
@use 'sass:map';
|
|
2
3
|
@use 'sass:meta';
|
|
4
|
+
@use '@angular/material' as mat;
|
|
3
5
|
@use '../../alert/m3-alert';
|
|
4
6
|
@use '../../colorpicker/m3-colorpicker';
|
|
5
7
|
@use '../../datetimepicker/m3-datetimepicker';
|
|
@@ -15,6 +17,8 @@
|
|
|
15
17
|
@use '../theming/config-validation';
|
|
16
18
|
@use '../theming/definition';
|
|
17
19
|
@use '../theming/palettes';
|
|
20
|
+
@use '../theming/m2-inspection';
|
|
21
|
+
@use './m2';
|
|
18
22
|
@use './m3';
|
|
19
23
|
|
|
20
24
|
/// Emits necessary CSS variables for Material's system level values for the values defined in the
|
|
@@ -109,6 +113,7 @@
|
|
|
109
113
|
$regular: map.get($typography, regular-weight) or $regular;
|
|
110
114
|
} @else {
|
|
111
115
|
$plain: $typography;
|
|
116
|
+
$brand: $typography;
|
|
112
117
|
}
|
|
113
118
|
$typography-config: (
|
|
114
119
|
definition.$internals: (
|
|
@@ -183,7 +188,7 @@
|
|
|
183
188
|
m3.md-sys-shape-values(),
|
|
184
189
|
m3.md-sys-state-values());
|
|
185
190
|
|
|
186
|
-
|
|
191
|
+
@include mat.private-current-selector-or-root {
|
|
187
192
|
@each $name, $value in $overrides {
|
|
188
193
|
@if (map.has-key($sys-names, $name)) {
|
|
189
194
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name)};
|
|
@@ -209,7 +214,7 @@
|
|
|
209
214
|
$sys-colors: map.set($sys-colors, neutral-variant20, map.get($palettes, neutral-variant, 20));
|
|
210
215
|
$sys-colors: map.set($sys-colors, neutral10, map.get($palettes, neutral, 10));
|
|
211
216
|
|
|
212
|
-
|
|
217
|
+
@include mat.private-current-selector-or-root {
|
|
213
218
|
@each $name, $value in $sys-colors {
|
|
214
219
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
215
220
|
}
|
|
@@ -248,7 +253,7 @@
|
|
|
248
253
|
typography-system-variables-prefix) or definition.$system-level-prefix;
|
|
249
254
|
}
|
|
250
255
|
|
|
251
|
-
|
|
256
|
+
@include mat.private-current-selector-or-root {
|
|
252
257
|
@each $name, $value in m3.md-sys-typescale-values($font-definition) {
|
|
253
258
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
254
259
|
}
|
|
@@ -259,18 +264,19 @@
|
|
|
259
264
|
$shadow-color: map.get(
|
|
260
265
|
$theme, definition.$internals, palettes, neutral, 0);
|
|
261
266
|
|
|
262
|
-
@each $name, $value in m3.md-sys-elevation-values() {
|
|
263
|
-
$level: map.get($overrides, $name) or $value;
|
|
264
|
-
$value: elevation.get-box-shadow($level, $shadow-color);
|
|
265
267
|
|
|
266
|
-
|
|
268
|
+
@include mat.private-current-selector-or-root {
|
|
269
|
+
@each $name, $value in m3.md-sys-elevation-values() {
|
|
270
|
+
$level: map.get($overrides, $name) or $value;
|
|
271
|
+
$value: elevation.get-box-shadow($level, $shadow-color);
|
|
272
|
+
|
|
267
273
|
--#{$prefix}-#{$name}: #{$value};
|
|
268
274
|
}
|
|
269
275
|
}
|
|
270
276
|
}
|
|
271
277
|
|
|
272
278
|
@mixin system-level-shape($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
273
|
-
|
|
279
|
+
@include mat.private-current-selector-or-root {
|
|
274
280
|
@each $name, $value in m3.md-sys-shape-values() {
|
|
275
281
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
276
282
|
}
|
|
@@ -278,7 +284,7 @@
|
|
|
278
284
|
}
|
|
279
285
|
|
|
280
286
|
@mixin system-level-state($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
281
|
-
|
|
287
|
+
@include mat.private-current-selector-or-root {
|
|
282
288
|
@each $name, $value in m3.md-sys-state-values() {
|
|
283
289
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
284
290
|
}
|
|
@@ -293,3 +299,73 @@
|
|
|
293
299
|
}
|
|
294
300
|
@return $result;
|
|
295
301
|
}
|
|
302
|
+
|
|
303
|
+
// Defines Angular Material system variables using M2 values provided by
|
|
304
|
+
// an M2 theme config created with `mat.m2-define-light-theme` or `mat.m2-define-dark-theme`.
|
|
305
|
+
//
|
|
306
|
+
// This enables applications to style custom components with system-level CSS
|
|
307
|
+
// variables instead of creating a separate component theme mixin that relies on
|
|
308
|
+
// the theme config.
|
|
309
|
+
//
|
|
310
|
+
// For example, use `var(--mat-sys-primary)` to get a theme's primary color instead of
|
|
311
|
+
// pulling it from the theme with `m2-get-color-from-palette($primary-palette, default)`.
|
|
312
|
+
//
|
|
313
|
+
// Unlike M3's `mat.theme()`, this mixin does not replace the need to call
|
|
314
|
+
// individual component theme mixins for Angular Material components.
|
|
315
|
+
@mixin m2-theme($theme-config, $overrides: ()) {
|
|
316
|
+
@if mat.get-theme-version($theme-config) == 1 {
|
|
317
|
+
@error '`m2-theme` mixin should only be called for M2 theme ' +
|
|
318
|
+
'configs created with define-light-theme or define-dark-theme';
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Check whether any override keys do not match keys in the theme
|
|
322
|
+
// config system map.
|
|
323
|
+
$invalid-keys: ();
|
|
324
|
+
$config-system: map.get($theme-config, _mat-system);
|
|
325
|
+
@each $key, $value in $overrides {
|
|
326
|
+
@if (not map.has-key($config-system, $key)) {
|
|
327
|
+
$invalid-keys: list.append($invalid-keys, $key);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
@if (list.length($invalid-keys) > 0) {
|
|
331
|
+
@error 'The following overrides are not valid system variables: #{$invalid-keys}. ' +
|
|
332
|
+
'Valid keys are: #{map.keys($config-system)}';
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
$config: m2-inspection.get-m2-config($theme-config);
|
|
336
|
+
|
|
337
|
+
$color: map.get($config, color);
|
|
338
|
+
@if (m2-inspection.theme-has($theme-config, color)) {
|
|
339
|
+
$system-colors: if(map.get($color, is-dark),
|
|
340
|
+
m2.md-sys-color-values-dark($color),
|
|
341
|
+
m2.md-sys-color-values-light($color),
|
|
342
|
+
);
|
|
343
|
+
@include _define-m2-system-vars($system-colors, $overrides);
|
|
344
|
+
|
|
345
|
+
$shadow: map.get($theme-config, _mat-system, shadow);
|
|
346
|
+
$system-elevations: ();
|
|
347
|
+
@each $name, $value in m2.md-sys-elevation-values() {
|
|
348
|
+
$level: map.get($overrides, $name) or $value;
|
|
349
|
+
$value: elevation.get-box-shadow($level, $shadow);
|
|
350
|
+
$system-elevations: map.set($system-elevations, $name, $value);
|
|
351
|
+
}
|
|
352
|
+
@include _define-m2-system-vars($system-elevations, $overrides);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
$typography: map.get($config, typography);
|
|
356
|
+
@if ($typography) {
|
|
357
|
+
$system-typography: m2.md-sys-typescale-values($typography);
|
|
358
|
+
@include _define-m2-system-vars($system-typography, $overrides);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@include _define-m2-system-vars(m2.md-sys-shape-values(), $overrides);
|
|
362
|
+
@include _define-m2-system-vars(m2.md-sys-state-values(), $overrides);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
@mixin _define-m2-system-vars($vars, $overrides) {
|
|
366
|
+
@include mat.private-current-selector-or-root {
|
|
367
|
+
@each $name, $value in $vars {
|
|
368
|
+
--#{definition.$system-fallback-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@function md-sys-color-values-dark($palettes) {
|
|
5
|
+
@return (
|
|
6
|
+
primary: map.get($palettes, primary, default),
|
|
7
|
+
on-primary: map.get($palettes, primary, default-contrast),
|
|
8
|
+
inverse-primary: map.get($palettes, primary, 600),
|
|
9
|
+
secondary: map.get($palettes, accent, default),
|
|
10
|
+
on-secondary: map.get($palettes, accent, default-contrast),
|
|
11
|
+
inverse-secondary: map.get($palettes, accent, 600),
|
|
12
|
+
error: map.get($palettes, warn, default),
|
|
13
|
+
on-error: map.get($palettes, warn, default-contrast),
|
|
14
|
+
inverse-error: map.get($palettes, warn, 600),
|
|
15
|
+
shadow: black,
|
|
16
|
+
surface: map.get(mat.$m2-grey-palette, 800),
|
|
17
|
+
on-surface: white,
|
|
18
|
+
surface-variant: #4a4a4a,
|
|
19
|
+
on-surface-variant: rgba(white, 0.7),
|
|
20
|
+
background: #303030,
|
|
21
|
+
inverse-surface: white,
|
|
22
|
+
inverse-on-surface: rgba(black, 0.87),
|
|
23
|
+
outline: rgba(white, 0.12),
|
|
24
|
+
outline-variant: rgba(white, 0.38),
|
|
25
|
+
error-container: map.get($palettes, warn, default),
|
|
26
|
+
on-background: white,
|
|
27
|
+
on-error-container: map.get($palettes, warn, default-contrast),
|
|
28
|
+
on-primary-container: map.get($palettes, primary, default-contrast),
|
|
29
|
+
on-primary-fixed: map.get($palettes, primary, default-contrast),
|
|
30
|
+
on-primary-fixed-variant: map.get($palettes, primary, default-contrast),
|
|
31
|
+
on-secondary-container: map.get($palettes, accent, default-contrast),
|
|
32
|
+
on-secondary-fixed: map.get($palettes, accent, default-contrast),
|
|
33
|
+
on-secondary-fixed-variant: map.get($palettes, accent, default-contrast),
|
|
34
|
+
on-tertiary: map.get($palettes, accent, default-contrast),
|
|
35
|
+
on-tertiary-container: map.get($palettes, accent, default-contrast),
|
|
36
|
+
on-tertiary-fixed: map.get($palettes, accent, default-contrast),
|
|
37
|
+
on-tertiary-fixed-variant: map.get($palettes, accent, default-contrast),
|
|
38
|
+
primary-container: map.get($palettes, primary, default),
|
|
39
|
+
primary-fixed: map.get($palettes, primary, default),
|
|
40
|
+
primary-fixed-dim: map.get($palettes, primary, default),
|
|
41
|
+
scrim: black,
|
|
42
|
+
secondary-container: map.get($palettes, accent, default),
|
|
43
|
+
secondary-fixed: map.get($palettes, accent, default),
|
|
44
|
+
secondary-fixed-dim: map.get($palettes, accent, default),
|
|
45
|
+
surface-bright: map.get(mat.$m2-grey-palette, 800),
|
|
46
|
+
surface-container: map.get(mat.$m2-grey-palette, 800),
|
|
47
|
+
surface-container-high: map.get(mat.$m2-grey-palette, 800),
|
|
48
|
+
surface-container-highest: map.get(mat.$m2-grey-palette, 800),
|
|
49
|
+
surface-container-low: map.get(mat.$m2-grey-palette, 800),
|
|
50
|
+
surface-container-lowest: map.get(mat.$m2-grey-palette, 800),
|
|
51
|
+
surface-dim: map.get(mat.$m2-grey-palette, 800),
|
|
52
|
+
surface-tint: map.get(mat.$m2-grey-palette, 800),
|
|
53
|
+
tertiary: map.get($palettes, accent, default),
|
|
54
|
+
tertiary-container: map.get($palettes, accent, default),
|
|
55
|
+
tertiary-fixed: map.get($palettes, accent, default),
|
|
56
|
+
tertiary-fixed-dim: map.get($palettes, accent, default),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@function md-sys-color-values-light($palettes) {
|
|
61
|
+
@return (
|
|
62
|
+
primary: map.get($palettes, primary, default),
|
|
63
|
+
on-primary: map.get($palettes, primary, default-contrast),
|
|
64
|
+
inverse-primary: map.get($palettes, primary, 300),
|
|
65
|
+
secondary: map.get($palettes, accent, default),
|
|
66
|
+
on-secondary: map.get($palettes, accent, default-contrast),
|
|
67
|
+
inverse-secondary: map.get($palettes, accent, 300),
|
|
68
|
+
error: map.get($palettes, warn, default),
|
|
69
|
+
on-error: map.get($palettes, warn, default-contrast),
|
|
70
|
+
inverse-error: map.get($palettes, warn, 300),
|
|
71
|
+
shadow: black,
|
|
72
|
+
surface: white,
|
|
73
|
+
on-surface: rgba(black, 0.87),
|
|
74
|
+
surface-variant: #f6f6f6,
|
|
75
|
+
on-surface-variant: rgba(black, 0.54),
|
|
76
|
+
background: map.get(mat.$m2-grey-palette, 50),
|
|
77
|
+
inverse-surface: map.get(mat.$m2-grey-palette, 800),
|
|
78
|
+
inverse-on-surface: white,
|
|
79
|
+
outline: rgba(black, 0.12),
|
|
80
|
+
outline-variant: rgba(black, 0.38),
|
|
81
|
+
error-container: map.get($palettes, warn, default),
|
|
82
|
+
on-background: rgba(black, 0.87),
|
|
83
|
+
on-error-container: map.get($palettes, warn, default-contrast),
|
|
84
|
+
on-primary-container: map.get($palettes, primary, default-contrast),
|
|
85
|
+
on-primary-fixed: map.get($palettes, primary, default-contrast),
|
|
86
|
+
on-primary-fixed-variant: map.get($palettes, primary, default-contrast),
|
|
87
|
+
on-secondary-container: map.get($palettes, accent, default-contrast),
|
|
88
|
+
on-secondary-fixed: map.get($palettes, accent, default-contrast),
|
|
89
|
+
on-secondary-fixed-variant: map.get($palettes, accent, default-contrast),
|
|
90
|
+
on-tertiary: map.get($palettes, accent, default-contrast),
|
|
91
|
+
on-tertiary-container: map.get($palettes, accent, default-contrast),
|
|
92
|
+
on-tertiary-fixed: map.get($palettes, accent, default-contrast),
|
|
93
|
+
on-tertiary-fixed-variant: map.get($palettes, accent, default-contrast),
|
|
94
|
+
primary-container: map.get($palettes, primary, default),
|
|
95
|
+
primary-fixed: map.get($palettes, primary, default),
|
|
96
|
+
primary-fixed-dim: map.get($palettes, primary, default),
|
|
97
|
+
scrim: black,
|
|
98
|
+
secondary-container: map.get($palettes, accent, default),
|
|
99
|
+
secondary-fixed: map.get($palettes, accent, default),
|
|
100
|
+
secondary-fixed-dim: map.get($palettes, accent, default),
|
|
101
|
+
surface-bright: white,
|
|
102
|
+
surface-container: white,
|
|
103
|
+
surface-container-high: white,
|
|
104
|
+
surface-container-highest: white,
|
|
105
|
+
surface-container-low: white,
|
|
106
|
+
surface-container-lowest: white,
|
|
107
|
+
surface-dim: white,
|
|
108
|
+
surface-tint: white,
|
|
109
|
+
tertiary: map.get($palettes, accent, default),
|
|
110
|
+
tertiary-container: map.get($palettes, accent, default),
|
|
111
|
+
tertiary-fixed: map.get($palettes, accent, default),
|
|
112
|
+
tertiary-fixed-dim: map.get($palettes, accent, default),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@function md-sys-motion-values() {
|
|
2
|
+
@return (
|
|
3
|
+
duration-extra-long1: 700ms,
|
|
4
|
+
duration-extra-long2: 800ms,
|
|
5
|
+
duration-extra-long3: 900ms,
|
|
6
|
+
duration-extra-long4: 1000ms,
|
|
7
|
+
duration-long1: 450ms,
|
|
8
|
+
duration-long2: 500ms,
|
|
9
|
+
duration-long3: 550ms,
|
|
10
|
+
duration-long4: 600ms,
|
|
11
|
+
duration-medium1: 250ms,
|
|
12
|
+
duration-medium2: 300ms,
|
|
13
|
+
duration-medium3: 350ms,
|
|
14
|
+
duration-medium4: 400ms,
|
|
15
|
+
duration-short1: 50ms,
|
|
16
|
+
duration-short2: 100ms,
|
|
17
|
+
duration-short3: 150ms,
|
|
18
|
+
duration-short4: 200ms,
|
|
19
|
+
easing-emphasized: cubic-bezier(0.2, 0, 0, 1),
|
|
20
|
+
easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15),
|
|
21
|
+
easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1),
|
|
22
|
+
easing-legacy: cubic-bezier(0.4, 0, 0.2, 1),
|
|
23
|
+
easing-legacy-accelerate: cubic-bezier(0.4, 0, 1, 1),
|
|
24
|
+
easing-legacy-decelerate: cubic-bezier(0, 0, 0.2, 1),
|
|
25
|
+
easing-linear: cubic-bezier(0, 0, 1, 1),
|
|
26
|
+
easing-standard: cubic-bezier(0.2, 0, 0, 1),
|
|
27
|
+
easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1),
|
|
28
|
+
easing-standard-decelerate: cubic-bezier(0, 0, 0, 1)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@function md-sys-shape-values() {
|
|
2
|
+
@return (
|
|
3
|
+
corner-extra-large: 28px,
|
|
4
|
+
corner-extra-large-top: (28px 28px 0 0),
|
|
5
|
+
corner-extra-small: 4px,
|
|
6
|
+
corner-extra-small-top: (4px 4px 0 0),
|
|
7
|
+
corner-full: 9999px,
|
|
8
|
+
corner-large: 16px,
|
|
9
|
+
corner-large-end: (0 16px 16px 0),
|
|
10
|
+
corner-large-start: (16px 0 0 16px),
|
|
11
|
+
corner-large-top: (16px 16px 0 0),
|
|
12
|
+
corner-medium: 12px,
|
|
13
|
+
corner-none: 0,
|
|
14
|
+
corner-small: 8px
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
|
|
5
|
+
@function md-sys-typescale-values($config) {
|
|
6
|
+
// Mapping is according to the old 2014 version of the typography spec.
|
|
7
|
+
$sys-to-config: (
|
|
8
|
+
body-large: subheading-1,
|
|
9
|
+
body-medium: body-1,
|
|
10
|
+
body-small: caption,
|
|
11
|
+
display-large: display-4,
|
|
12
|
+
display-medium: display-4,
|
|
13
|
+
display-small: display-4,
|
|
14
|
+
headline-large: display-3,
|
|
15
|
+
headline-medium: display-2,
|
|
16
|
+
headline-small: display-1,
|
|
17
|
+
label-large: subheading-2,
|
|
18
|
+
label-medium: body-2,
|
|
19
|
+
label-small: button,
|
|
20
|
+
title-large: headline,
|
|
21
|
+
title-medium: headline,
|
|
22
|
+
title-small: title,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// If the config is based on the updated 2018 version of the typography spec, then
|
|
26
|
+
// use the correct config keys mapping.
|
|
27
|
+
@if (map.get($config, headline-1) != null) {
|
|
28
|
+
$sys-to-config: (
|
|
29
|
+
body-large: body-1,
|
|
30
|
+
body-medium: body-2,
|
|
31
|
+
body-small: caption,
|
|
32
|
+
label-large: subtitle-1,
|
|
33
|
+
label-medium: subtitle-2,
|
|
34
|
+
label-small: button,
|
|
35
|
+
display-large: headline-1,
|
|
36
|
+
display-medium: headline-1,
|
|
37
|
+
display-small: headline-1,
|
|
38
|
+
headline-large: headline-2,
|
|
39
|
+
headline-medium: headline-3,
|
|
40
|
+
headline-small: headline-4,
|
|
41
|
+
title-large: headline-5,
|
|
42
|
+
title-medium: headline-5,
|
|
43
|
+
title-small: headline-6,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$typography: ();
|
|
48
|
+
@each $sys-key, $config-key in $sys-to-config {
|
|
49
|
+
$font: map.get($config, $config-key, font-family);
|
|
50
|
+
@if (meta.type-of($font) == 'string') {
|
|
51
|
+
$font: string.unquote($font);
|
|
52
|
+
}
|
|
53
|
+
$line-height: map.get($config, $config-key, line-height);
|
|
54
|
+
$size: map.get($config, $config-key, font-size);
|
|
55
|
+
$tracking: map.get($config, $config-key, letter-spacing);
|
|
56
|
+
$weight: map.get($config, $config-key, font-weight);
|
|
57
|
+
$typography: map.merge($typography, (
|
|
58
|
+
#{$sys-key}: $weight $size #{'/'} $line-height $font,
|
|
59
|
+
#{$sys-key}-font: $font,
|
|
60
|
+
#{$sys-key}-line-height: $line-height,
|
|
61
|
+
#{$sys-key}-size: $size,
|
|
62
|
+
#{$sys-key}-tracking: $tracking,
|
|
63
|
+
#{$sys-key}-weight: $weight,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@return $typography;
|
|
68
|
+
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Design system display name: Material 3
|
|
3
|
-
// Design system version: v0.161
|
|
4
|
-
//
|
|
5
|
-
|
|
6
1
|
@use 'sass:map';
|
|
7
2
|
|
|
8
3
|
// Indicates whether alternative tokens should be used
|
|
9
4
|
$_alternate-tokens: false;
|
|
10
5
|
|
|
11
|
-
@function md-sys-color-values-dark($palettes) {
|
|
6
|
+
@function md-sys-color-values-dark($palettes: ()) {
|
|
12
7
|
$values: (
|
|
13
8
|
background: map.get($palettes, neutral, 6),
|
|
14
9
|
error: map.get($palettes, error, 80),
|
|
@@ -63,9 +58,7 @@ $_alternate-tokens: false;
|
|
|
63
58
|
|
|
64
59
|
@if ($_alternate-tokens) {
|
|
65
60
|
$values: map.merge($values, (
|
|
66
|
-
background: map.get($palettes, neutral, 10),
|
|
67
61
|
on-surface-variant: map.get($palettes, neutral-variant, 80),
|
|
68
|
-
surface: map.get($palettes, neutral, 10),
|
|
69
62
|
surface-bright: #37393b,
|
|
70
63
|
surface-container: #1e1f20,
|
|
71
64
|
surface-container-high: #282a2c,
|
|
@@ -80,7 +73,7 @@ $_alternate-tokens: false;
|
|
|
80
73
|
@return $values;
|
|
81
74
|
}
|
|
82
75
|
|
|
83
|
-
@function md-sys-color-values-light($palettes) {
|
|
76
|
+
@function md-sys-color-values-light($palettes: ()) {
|
|
84
77
|
$values: (
|
|
85
78
|
background: map.get($palettes, neutral, 98),
|
|
86
79
|
error: map.get($palettes, error, 40),
|
|
@@ -136,17 +129,12 @@ $_alternate-tokens: false;
|
|
|
136
129
|
@if ($_alternate-tokens) {
|
|
137
130
|
$values: map.merge($values, (
|
|
138
131
|
background: map.get($palettes, neutral, 100),
|
|
139
|
-
on-error-container: map.get($palettes, error, 10),
|
|
140
|
-
on-primary-container: map.get($palettes, primary, 10),
|
|
141
|
-
on-secondary-container: map.get($palettes, secondary, 10),
|
|
142
|
-
on-tertiary-container: map.get($palettes, tertiary, 10),
|
|
143
132
|
surface: map.get($palettes, neutral, 100),
|
|
144
133
|
surface-bright: map.get($palettes, neutral, 100),
|
|
145
134
|
surface-container: #f0f4f9,
|
|
146
135
|
surface-container-high: #e9eef6,
|
|
147
136
|
surface-container-highest: #dde3ea,
|
|
148
137
|
surface-container-low: #f8fafd,
|
|
149
|
-
surface-container-lowest: map.get($palettes, primary, 100),
|
|
150
138
|
surface-dim: #d3dbe5,
|
|
151
139
|
surface-tint: #6991d6,
|
|
152
140
|
));
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// Indicates whether alternative tokens should be used
|
|
9
9
|
$_alternate-tokens: false;
|
|
10
10
|
|
|
11
|
-
@function md-sys-typescale-values($typography) {
|
|
11
|
+
@function md-sys-typescale-values($typography: ()) {
|
|
12
12
|
$plain: map.get($typography, plain);
|
|
13
13
|
$brand: map.get($typography, brand);
|
|
14
14
|
$bold: map.get($typography, bold);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use '../../theming/palettes';
|
|
2
1
|
@use './md-sys-color';
|
|
3
2
|
@use './md-sys-elevation';
|
|
4
3
|
@use './md-sys-shape';
|
|
@@ -17,31 +16,20 @@
|
|
|
17
16
|
@return $new-map;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
brand: (Roboto),
|
|
30
|
-
plain: (Roboto),
|
|
31
|
-
bold: 700,
|
|
32
|
-
medium: 500,
|
|
33
|
-
regular: 400
|
|
34
|
-
))),
|
|
35
|
-
'md-sys-elevation': _create-system-app-vars-map(md-sys-elevation.md-sys-elevation-values()),
|
|
36
|
-
'md-sys-state': _create-system-app-vars-map(md-sys-state.md-sys-state-values()),
|
|
37
|
-
'md-sys-shape': _create-system-app-vars-map(md-sys-shape.md-sys-shape-values()),
|
|
38
|
-
// Add a subset of palette-specific colors used by components instead of system values
|
|
39
|
-
'md-ref-palette': _create-system-app-vars-map(
|
|
40
|
-
(
|
|
41
|
-
neutral10: '', // Form field native select option text color
|
|
42
|
-
neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
|
|
43
|
-
)
|
|
19
|
+
$_sys-maps: (
|
|
20
|
+
md-sys-color.md-sys-color-values-light(),
|
|
21
|
+
md-sys-typescale.md-sys-typescale-values(),
|
|
22
|
+
md-sys-elevation.md-sys-elevation-values(),
|
|
23
|
+
md-sys-state.md-sys-state-values(),
|
|
24
|
+
md-sys-shape.md-sys-shape-values(),
|
|
25
|
+
(
|
|
26
|
+
neutral10: '', // Form field native select option text color
|
|
27
|
+
neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
|
|
44
28
|
),
|
|
45
29
|
);
|
|
46
30
|
|
|
47
|
-
$
|
|
31
|
+
$_system: (density-scale: 0);
|
|
32
|
+
@each $sys-map in $_sys-maps {
|
|
33
|
+
$_system: map.merge($_system, _create-system-app-vars-map($sys-map));
|
|
34
|
+
}
|
|
35
|
+
$sys-theme: (_mat-system: $_system);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../m2/typography' as m2-typography;
|
|
3
|
+
|
|
4
|
+
// Whether a config is for the Material Design 2018 typography system.
|
|
5
|
+
@function private-typography-is-2018-config($config) {
|
|
6
|
+
@return map.get($config, headline-1) != null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Whether a config is for the Material Design 2014 typography system.
|
|
10
|
+
@function private-typography-is-2014-config($config) {
|
|
11
|
+
@return map.get($config, headline) != null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Given a config for either the 2014 or 2018 Material Design typography system,
|
|
15
|
+
// produces a normalized typography config for the 2014 Material Design typography system.
|
|
16
|
+
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
|
|
17
|
+
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
|
|
18
|
+
//
|
|
19
|
+
// Components using this function should be migrated to normalize to the 2018 style config instead.
|
|
20
|
+
// New components should not use this function.
|
|
21
|
+
@function private-typography-to-2014-config($config) {
|
|
22
|
+
@if $config == null {
|
|
23
|
+
@return null;
|
|
24
|
+
}
|
|
25
|
+
@if not private-typography-is-2014-config($config) {
|
|
26
|
+
$args: (
|
|
27
|
+
display-4: map.get($config, headline-1),
|
|
28
|
+
display-3: map.get($config, headline-2),
|
|
29
|
+
display-2: map.get($config, headline-3),
|
|
30
|
+
display-1: map.get($config, headline-4),
|
|
31
|
+
headline: map.get($config, headline-5),
|
|
32
|
+
title: map.get($config, headline-6),
|
|
33
|
+
subheading-2: map.get($config, subtitle-1),
|
|
34
|
+
subheading-1: map.get($config, subtitle-2),
|
|
35
|
+
body-2: map.get($config, body-1),
|
|
36
|
+
body-1: map.get($config, body-2),
|
|
37
|
+
button: map.get($config, button),
|
|
38
|
+
caption: map.get($config, caption),
|
|
39
|
+
font-family: map.get($config, font-family),
|
|
40
|
+
);
|
|
41
|
+
$non-null-args: ();
|
|
42
|
+
@each $key, $value in $args {
|
|
43
|
+
@if $value != null {
|
|
44
|
+
$non-null-args: map.merge($non-null-args, ($key: $value));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
@return m2-typography.define-legacy-typography-config($non-null-args...);
|
|
48
|
+
}
|
|
49
|
+
@return $config;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Given a config for either the 2014 or 2018 Material Design typography system,
|
|
53
|
+
// produces a normalized typography config for the 2018 Material Design typography system.
|
|
54
|
+
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
|
|
55
|
+
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
|
|
56
|
+
//
|
|
57
|
+
// The $force option is used to allow components to specify that they want to re-map the keys, even
|
|
58
|
+
// if the 2018 keys are already present. This allows those components to preserve the (incorrect)
|
|
59
|
+
// behavior they had previously, when they called `private-typography-to-2014-config`. Eventually we
|
|
60
|
+
// should clean this up, remove the $force option, and reconcile any screen diffs.
|
|
61
|
+
@function private-typography-to-2018-config($config, $force: false) {
|
|
62
|
+
@if $config == null {
|
|
63
|
+
@return null;
|
|
64
|
+
}
|
|
65
|
+
@if $force or not private-typography-is-2018-config($config) {
|
|
66
|
+
@return (
|
|
67
|
+
headline-1: map.get($config, display-4),
|
|
68
|
+
headline-2: map.get($config, display-3),
|
|
69
|
+
headline-3: map.get($config, display-2),
|
|
70
|
+
headline-4: map.get($config, display-1),
|
|
71
|
+
headline-5: map.get($config, headline),
|
|
72
|
+
headline-6: map.get($config, title),
|
|
73
|
+
subtitle-1: map.get($config, subheading-2),
|
|
74
|
+
font-family: map.get($config, font-family),
|
|
75
|
+
|
|
76
|
+
// These mappings are odd, but body-2 in the 2014 system actually looks closer to subtitle-2
|
|
77
|
+
// in the 2018 system, and subeading-1 in the 2014 system looks more like body-1 in the 2018
|
|
78
|
+
// system.
|
|
79
|
+
subtitle-2: map.get($config, body-2),
|
|
80
|
+
body-1: map.get($config, subheading-1),
|
|
81
|
+
|
|
82
|
+
body-2: map.get($config, body-1),
|
|
83
|
+
button: map.get($config, button),
|
|
84
|
+
caption: map.get($config, caption),
|
|
85
|
+
overline: if(map.get($config, overline), map.get($config, overline),
|
|
86
|
+
m2-typography.define-typography-level(12px, 32px, 500)
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
@return $config;
|
|
91
|
+
}
|
|
@@ -150,6 +150,8 @@ declare class MtxCalendarBody implements OnChanges {
|
|
|
150
150
|
label: string;
|
|
151
151
|
/** The cells to display in the table. */
|
|
152
152
|
rows: MtxCalendarCell[][];
|
|
153
|
+
/** Whether to show week numbers */
|
|
154
|
+
showWeekNumbers: boolean;
|
|
153
155
|
/**
|
|
154
156
|
* The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
|
|
155
157
|
* maintained even as the table resizes.
|
|
@@ -187,7 +189,8 @@ declare class MtxCalendarBody implements OnChanges {
|
|
|
187
189
|
ngOnChanges(changes: SimpleChanges): void;
|
|
188
190
|
_focusActiveCell(movePreview?: boolean): void;
|
|
189
191
|
static ɵfac: i0.ɵɵFactoryDeclaration<MtxCalendarBody, never>;
|
|
190
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendarBody, "[mtx-calendar-body]", ["mtxCalendarBody"], { "label": { "alias": "label"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "cellAspectRatio": { "alias": "cellAspectRatio"; "required": false; }; "todayValue": { "alias": "todayValue"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "labelMinRequiredCells": { "alias": "labelMinRequiredCells"; "required": false; }; "numCols": { "alias": "numCols"; "required": false; }; "allowDisabledSelection": { "alias": "allowDisabledSelection"; "required": false; }; "activeCell": { "alias": "activeCell"; "required": false; }; }, { "selectedValueChange": "selectedValueChange"; }, never, never, true, never>;
|
|
192
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendarBody, "[mtx-calendar-body]", ["mtxCalendarBody"], { "label": { "alias": "label"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; }; "cellAspectRatio": { "alias": "cellAspectRatio"; "required": false; }; "todayValue": { "alias": "todayValue"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "labelMinRequiredCells": { "alias": "labelMinRequiredCells"; "required": false; }; "numCols": { "alias": "numCols"; "required": false; }; "allowDisabledSelection": { "alias": "allowDisabledSelection"; "required": false; }; "activeCell": { "alias": "activeCell"; "required": false; }; }, { "selectedValueChange": "selectedValueChange"; }, never, never, true, never>;
|
|
193
|
+
static ngAcceptInputType_showWeekNumbers: unknown;
|
|
191
194
|
}
|
|
192
195
|
|
|
193
196
|
/**
|