@ng-matero/extensions 20.2.1 → 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.
Files changed (51) hide show
  1. package/_index.scss +2 -2
  2. package/colorpicker/index.d.ts +4 -3
  3. package/core/m2/_typography.scss +216 -0
  4. package/core/theming/_definition.scss +22 -13
  5. package/core/theming/_m2-inspection.scss +235 -0
  6. package/core/theming/prebuilt/azure-blue.scss +2 -2
  7. package/core/theming/prebuilt/cyan-orange.scss +2 -2
  8. package/core/theming/prebuilt/magenta-violet.scss +2 -2
  9. package/core/theming/prebuilt/rose-red.scss +2 -2
  10. package/core/tokens/_m3-utils.scss +2 -14
  11. package/core/tokens/{_m3-system.scss → _system.scss} +74 -0
  12. package/core/tokens/m2/_index.scss +6 -0
  13. package/core/tokens/m2/_md-sys-color.scss +114 -0
  14. package/core/tokens/m2/_md-sys-elevation.scss +10 -0
  15. package/core/tokens/m2/_md-sys-motion.scss +30 -0
  16. package/core/tokens/m2/_md-sys-shape.scss +16 -0
  17. package/core/tokens/m2/_md-sys-state.scss +8 -0
  18. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  19. package/core/tokens/m3/_md-sys-color.scss +2 -14
  20. package/core/tokens/m3/_md-sys-typescale.scss +1 -1
  21. package/core/tokens/m3/_theme.scss +14 -26
  22. package/core/typography/_versioning.scss +91 -0
  23. package/datetimepicker/index.d.ts +4 -1
  24. package/fesm2022/mtxAlert.mjs +7 -7
  25. package/fesm2022/mtxButton.mjs +7 -7
  26. package/fesm2022/mtxCheckboxGroup.mjs +7 -7
  27. package/fesm2022/mtxColorpicker.mjs +29 -22
  28. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  29. package/fesm2022/mtxColumnResize.mjs +43 -43
  30. package/fesm2022/mtxCore.mjs +21 -21
  31. package/fesm2022/mtxDatetimepicker.mjs +70 -65
  32. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  33. package/fesm2022/mtxDialog.mjs +10 -10
  34. package/fesm2022/mtxDrawer.mjs +10 -10
  35. package/fesm2022/mtxGrid.mjs +69 -69
  36. package/fesm2022/mtxLoader.mjs +7 -7
  37. package/fesm2022/mtxPhotoviewer.mjs +7 -7
  38. package/fesm2022/mtxPopover.mjs +19 -19
  39. package/fesm2022/mtxProgress.mjs +7 -7
  40. package/fesm2022/mtxSelect.mjs +52 -52
  41. package/fesm2022/mtxSplit.mjs +10 -10
  42. package/fesm2022/mtxTooltip.mjs +10 -10
  43. package/package.json +20 -20
  44. package/prebuilt-themes/azure-blue.css +1 -1
  45. package/prebuilt-themes/cyan-orange.css +1 -1
  46. package/prebuilt-themes/deeppurple-amber.css +1 -1
  47. package/prebuilt-themes/indigo-pink.css +1 -1
  48. package/prebuilt-themes/magenta-violet.css +1 -1
  49. package/prebuilt-themes/pink-bluegrey.css +1 -1
  50. package/prebuilt-themes/purple-green.css +1 -1
  51. package/prebuilt-themes/rose-red.css +1 -1
@@ -1,3 +1,4 @@
1
+ @use 'sass:list';
1
2
  @use 'sass:map';
2
3
  @use 'sass:meta';
3
4
  @use '@angular/material' as mat;
@@ -16,6 +17,8 @@
16
17
  @use '../theming/config-validation';
17
18
  @use '../theming/definition';
18
19
  @use '../theming/palettes';
20
+ @use '../theming/m2-inspection';
21
+ @use './m2';
19
22
  @use './m3';
20
23
 
21
24
  /// Emits necessary CSS variables for Material's system level values for the values defined in the
@@ -110,6 +113,7 @@
110
113
  $regular: map.get($typography, regular-weight) or $regular;
111
114
  } @else {
112
115
  $plain: $typography;
116
+ $brand: $typography;
113
117
  }
114
118
  $typography-config: (
115
119
  definition.$internals: (
@@ -295,3 +299,73 @@
295
299
  }
296
300
  @return $result;
297
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,6 @@
1
+ @forward './md-sys-color';
2
+ @forward './md-sys-elevation';
3
+ @forward './md-sys-motion';
4
+ @forward './md-sys-shape';
5
+ @forward './md-sys-state';
6
+ @forward './md-sys-typescale';
@@ -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,10 @@
1
+ @function md-sys-elevation-values() {
2
+ @return (
3
+ level0: 0,
4
+ level1: 1,
5
+ level2: 3,
6
+ level3: 6,
7
+ level4: 8,
8
+ level5: 12
9
+ );
10
+ }
@@ -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,8 @@
1
+ @function md-sys-state-values($exclude-hardcoded-values: false) {
2
+ @return (
3
+ dragged-state-layer-opacity: 0.16,
4
+ focus-state-layer-opacity: 0.12,
5
+ hover-state-layer-opacity: 0.04,
6
+ pressed-state-layer-opacity: 0.12,
7
+ );
8
+ }
@@ -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
- /// Map key used to store internals of theme config.
21
- $internals: _mat-theming-internals-do-not-access;
22
-
23
- $placeholder-palettes: md-sys-color.md-sys-color-values-light(palettes.$blue-palette);
24
- $placeholder-palettes: map.set($placeholder-palettes, primary, palettes.$blue-palette);
25
- $app-vars: (
26
- 'md-sys-color': _create-system-app-vars-map(
27
- md-sys-color.md-sys-color-values-light($placeholder-palettes)),
28
- 'md-sys-typescale': _create-system-app-vars-map(md-sys-typescale.md-sys-typescale-values((
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
- $sys-theme: ($internals: $app-vars);
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
  /**
@@ -22,10 +22,10 @@ class MtxAlert {
22
22
  this._changeDetectorRef.markForCheck();
23
23
  this.closed.emit(this);
24
24
  }
25
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MtxAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
26
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.0", type: MtxAlert, isStandalone: true, selector: "mtx-alert", inputs: { type: "type", dismissible: ["dismissible", "dismissible", booleanAttribute], elevation: "elevation" }, outputs: { closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class": "hostClassList", "class.mtx-alert-dismissible": "dismissible" } }, exportAs: ["mtxAlert"], ngImport: i0, template: "<ng-content></ng-content>\n@if (dismissible) {\n <div class=\"mtx-alert-close\">\n <button mat-icon-button type=\"button\" aria-label=\"Close\" (click)=\"_onClosed()\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\"\n />\n </svg>\n </button>\n </div>\n}\n", styles: [".mtx-alert{position:relative;display:block;padding:.75rem 1rem;margin-bottom:1rem;line-height:1.5;border:1px solid var(--mtx-alert-outline-color, var(--mat-sys-outline-variant));border-radius:var(--mtx-alert-container-shape, var(--mat-sys-corner-small));background-color:var(--mtx-alert-background-color, var(--mat-sys-surface-container));color:var(--mtx-alert-text-color, var(--mat-sys-on-surface))}.mtx-alert.mtx-alert-info{border-color:var(--mtx-alert-info-outline-color, light-dark(#abc7ff, #005cbb));background-color:var(--mtx-alert-info-background-color, light-dark(#d7e3ff, #002f65));color:var(--mtx-alert-info-text-color, light-dark(#002f65, #d7e3ff))}.mtx-alert.mtx-alert-success{border-color:var(--mtx-alert-success-outline-color, light-dark(#02e600, #026e00));background-color:var(--mtx-alert-success-background-color, light-dark(#cbffb8, #013a00));color:var(--mtx-alert-success-text-color, light-dark(#013a00, #cbffb8))}.mtx-alert.mtx-alert-warning{border-color:var(--mtx-alert-warning-outline-color, light-dark(#cdcd00, #626200));background-color:var(--mtx-alert-warning-background-color, light-dark(#fffeac, #323200));color:var(--mtx-alert-warning-text-color, light-dark(#323200, #fffeac))}.mtx-alert.mtx-alert-danger{border-color:var(--mtx-alert-danger-outline-color, light-dark(#ffb4a8, #c00100));background-color:var(--mtx-alert-danger-background-color, light-dark(#ffdad4, #690100));color:var(--mtx-alert-danger-text-color, light-dark(#690100, #ffdad4))}.mtx-alert-close{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem}[dir=rtl] .mtx-alert-close{right:auto;left:0}.mtx-alert-dismissible{padding-right:3rem}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
25
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MtxAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
26
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: MtxAlert, isStandalone: true, selector: "mtx-alert", inputs: { type: "type", dismissible: ["dismissible", "dismissible", booleanAttribute], elevation: "elevation" }, outputs: { closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class": "hostClassList", "class.mtx-alert-dismissible": "dismissible" } }, exportAs: ["mtxAlert"], ngImport: i0, template: "<ng-content></ng-content>\n@if (dismissible) {\n <div class=\"mtx-alert-close\">\n <button mat-icon-button type=\"button\" aria-label=\"Close\" (click)=\"_onClosed()\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\"\n />\n </svg>\n </button>\n </div>\n}\n", styles: [".mtx-alert{position:relative;display:block;padding:.75rem 1rem;margin-bottom:1rem;line-height:1.5;border:1px solid var(--mtx-alert-outline-color, var(--mat-sys-outline-variant));border-radius:var(--mtx-alert-container-shape, var(--mat-sys-corner-small));background-color:var(--mtx-alert-background-color, var(--mat-sys-surface-container));color:var(--mtx-alert-text-color, var(--mat-sys-on-surface))}.mtx-alert.mtx-alert-info{border-color:var(--mtx-alert-info-outline-color, light-dark(#abc7ff, #005cbb));background-color:var(--mtx-alert-info-background-color, light-dark(#d7e3ff, #002f65));color:var(--mtx-alert-info-text-color, light-dark(#002f65, #d7e3ff))}.mtx-alert.mtx-alert-success{border-color:var(--mtx-alert-success-outline-color, light-dark(#02e600, #026e00));background-color:var(--mtx-alert-success-background-color, light-dark(#cbffb8, #013a00));color:var(--mtx-alert-success-text-color, light-dark(#013a00, #cbffb8))}.mtx-alert.mtx-alert-warning{border-color:var(--mtx-alert-warning-outline-color, light-dark(#cdcd00, #626200));background-color:var(--mtx-alert-warning-background-color, light-dark(#fffeac, #323200));color:var(--mtx-alert-warning-text-color, light-dark(#323200, #fffeac))}.mtx-alert.mtx-alert-danger{border-color:var(--mtx-alert-danger-outline-color, light-dark(#ffb4a8, #c00100));background-color:var(--mtx-alert-danger-background-color, light-dark(#ffdad4, #690100));color:var(--mtx-alert-danger-text-color, light-dark(#690100, #ffdad4))}.mtx-alert-close{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem}[dir=rtl] .mtx-alert-close{right:auto;left:0}.mtx-alert-dismissible{padding-right:3rem}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
27
27
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MtxAlert, decorators: [{
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MtxAlert, decorators: [{
29
29
  type: Component,
30
30
  args: [{ selector: 'mtx-alert', exportAs: 'mtxAlert', host: {
31
31
  '[class]': 'hostClassList',
@@ -44,11 +44,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
44
44
  }] } });
45
45
 
46
46
  class MtxAlertModule {
47
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MtxAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
48
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0", ngImport: i0, type: MtxAlertModule, imports: [CommonModule, MtxAlert], exports: [MtxAlert] }); }
49
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MtxAlertModule, imports: [CommonModule, MtxAlert] }); }
47
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MtxAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
48
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: MtxAlertModule, imports: [CommonModule, MtxAlert], exports: [MtxAlert] }); }
49
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MtxAlertModule, imports: [CommonModule, MtxAlert] }); }
50
50
  }
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: MtxAlertModule, decorators: [{
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MtxAlertModule, decorators: [{
52
52
  type: NgModule,
53
53
  args: [{
54
54
  imports: [CommonModule, MtxAlert],