@angular/material 16.0.0-next.2 → 16.0.0-next.3

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 +0 -2
  2. package/card/_card-theme.scss +11 -14
  3. package/checkbox/_checkbox-theme.scss +31 -70
  4. package/core/tokens/_token-utils.scss +33 -20
  5. package/core/tokens/m2/mdc/_checkbox.scss +131 -0
  6. package/core/tokens/m2/mdc/_elevated-card.scss +33 -28
  7. package/core/tokens/m2/mdc/_outlined-card.scss +38 -34
  8. package/datepicker/index.d.ts +2 -0
  9. package/esm2020/card/card.mjs +2 -2
  10. package/esm2020/checkbox/checkbox.mjs +2 -2
  11. package/esm2020/core/option/option.mjs +4 -4
  12. package/esm2020/core/version.mjs +1 -1
  13. package/esm2020/datepicker/date-range-input.mjs +11 -3
  14. package/esm2020/list/list-option.mjs +2 -2
  15. package/esm2020/tooltip/tooltip.mjs +2 -2
  16. package/fesm2015/card.mjs +2 -2
  17. package/fesm2015/card.mjs.map +1 -1
  18. package/fesm2015/checkbox.mjs +2 -2
  19. package/fesm2015/checkbox.mjs.map +1 -1
  20. package/fesm2015/core.mjs +4 -4
  21. package/fesm2015/core.mjs.map +1 -1
  22. package/fesm2015/datepicker.mjs +9 -1
  23. package/fesm2015/datepicker.mjs.map +1 -1
  24. package/fesm2015/list.mjs +2 -2
  25. package/fesm2015/list.mjs.map +1 -1
  26. package/fesm2015/tooltip.mjs +2 -2
  27. package/fesm2015/tooltip.mjs.map +1 -1
  28. package/fesm2020/card.mjs +2 -2
  29. package/fesm2020/card.mjs.map +1 -1
  30. package/fesm2020/checkbox.mjs +2 -2
  31. package/fesm2020/checkbox.mjs.map +1 -1
  32. package/fesm2020/core.mjs +4 -4
  33. package/fesm2020/core.mjs.map +1 -1
  34. package/fesm2020/datepicker.mjs +9 -1
  35. package/fesm2020/datepicker.mjs.map +1 -1
  36. package/fesm2020/list.mjs +2 -2
  37. package/fesm2020/list.mjs.map +1 -1
  38. package/fesm2020/tooltip.mjs +2 -2
  39. package/fesm2020/tooltip.mjs.map +1 -1
  40. package/list/_list-theme.import.scss +0 -3
  41. package/list/_list-theme.scss +40 -16
  42. package/package.json +2 -2
  43. package/prebuilt-themes/deeppurple-amber.css +1 -1
  44. package/prebuilt-themes/indigo-pink.css +1 -1
  45. package/prebuilt-themes/pink-bluegrey.css +1 -1
  46. package/prebuilt-themes/purple-green.css +1 -1
  47. package/schematics/ng-add/index.js +1 -1
  48. package/schematics/ng-add/index.mjs +1 -1
  49. package/checkbox/_checkbox-private.scss +0 -54
  50. package/list/_list-option-theme.import.scss +0 -2
  51. package/list/_list-option-theme.scss +0 -13
package/_index.scss CHANGED
@@ -31,8 +31,6 @@
31
31
  $private-ease-in-out-curve-function, $private-swift-ease-out-duration, $private-xsmall;
32
32
  @forward './core/typography/typography' show private-typography-to-2014-config,
33
33
  private-typography-to-2018-config;
34
- @forward './checkbox/checkbox-private' show private-checkbox-styles-with-color,
35
- $private-checkbox-theme-config;
36
34
  @forward './table/table-flex-styles' show private-table-flex-styles;
37
35
  @forward './core/style/menu-common' as private-menu-common-*;
38
36
  @forward './core/style/button-common' as private-button-common-*;
@@ -1,5 +1,4 @@
1
1
  @use '../core/theming/theming';
2
- @use '../core/style/private';
3
2
  @use '../core/typography/typography';
4
3
  @use '../core/tokens/token-utils';
5
4
  @use '../core/tokens/m2/mat/card' as tokens-mat-card;
@@ -10,8 +9,16 @@
10
9
 
11
10
  @mixin color($config-or-theme) {
12
11
  $config: theming.get-color-config($config-or-theme);
13
- $mdc-elevated-card-color-tokens: tokens-mdc-elevated-card.get-color-tokens($config);
14
- $mdc-outlined-card-color-tokens: tokens-mdc-outlined-card.get-color-tokens($config);
12
+ $mdc-elevated-card-color-tokens: token-utils.resolve-elevation(
13
+ tokens-mdc-elevated-card.get-color-tokens($config),
14
+ container-elevation,
15
+ container-shadow-color
16
+ );
17
+ $mdc-outlined-card-color-tokens: token-utils.resolve-elevation(
18
+ tokens-mdc-outlined-card.get-color-tokens($config),
19
+ container-elevation,
20
+ container-shadow-color,
21
+ );
15
22
  $mat-card-color-tokens: tokens-mat-card.get-color-tokens($config);
16
23
 
17
24
  // Add values for card tokens.
@@ -19,22 +26,12 @@
19
26
  @include mdc-elevated-card-theme.theme($mdc-elevated-card-color-tokens);
20
27
  @include mdc-outlined-card-theme.theme($mdc-outlined-card-color-tokens);
21
28
  @include token-utils.create-token-values(tokens-mat-card.$prefix, $mat-card-color-tokens);
22
-
23
- // TODO(mmalerba): This should be based on tokens, but the elevation tokens don't seem to be
24
- // working currently. They wind up setting values like `box-shadow: var(--e); --e: 1`
25
- @include private.private-theme-elevation(1, $config);
26
- }
27
-
28
- .mat-mdc-card-outlined {
29
- // TODO(mmalerba): This should be based on tokens, but the elevation tokens don't seem to be
30
- // working currently. They wind up setting values like `box-shadow: var(--e); --e: 1`
31
- @include private.private-theme-elevation(0, $config);
32
29
  }
33
30
  }
34
31
 
35
32
  @mixin typography($config-or-theme) {
36
33
  $config: typography.private-typography-to-2018-config(
37
- theming.get-typography-config($config-or-theme));
34
+ theming.get-typography-config($config-or-theme));
38
35
  $mdc-elevated-card-typography-tokens: tokens-mdc-elevated-card.get-typography-tokens($config);
39
36
  $mdc-outlined-card-typography-tokens: tokens-mdc-outlined-card.get-typography-tokens($config);
40
37
  $mat-card-typography-tokens: tokens-mat-card.get-typography-tokens($config);
@@ -1,74 +1,36 @@
1
- @use '@material/checkbox/checkbox' as mdc-checkbox;
1
+ @use 'sass:map';
2
2
  @use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
3
3
  @use '@material/form-field' as mdc-form-field;
4
- @use '@material/theme/theme-color' as mdc-theme-color;
5
- @use '@material/theme/theme';
6
- @use 'sass:map';
7
- @use 'sass:color';
8
- @use '../core/ripple/ripple-theme';
9
4
  @use '../core/theming/theming';
10
5
  @use '../core/typography/typography';
11
6
  @use '../core/mdc-helpers/mdc-helpers';
12
- @use './checkbox-private';
13
-
14
- // Apply ripple colors to the MatRipple element and the MDC ripple element when the
15
- // checkbox is selected.
16
- @mixin _selected-ripple-colors($theme, $mdc-color) {
17
- .mdc-checkbox--selected ~ {
18
- .mat-mdc-checkbox-ripple {
19
- @include ripple-theme.color((
20
- foreground: (
21
- base: mdc-theme-color.prop-value($mdc-color)
22
- ),
23
- ));
24
- }
25
-
26
- .mdc-checkbox__ripple {
27
- background: $theme;
28
- }
29
- }
30
- }
7
+ @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
31
8
 
32
9
  @mixin color($config-or-theme) {
33
10
  $config: theming.get-color-config($config-or-theme);
34
- $primary: theming.get-color-from-palette(map.get($config, primary));
35
- $accent: theming.get-color-from-palette(map.get($config, accent));
36
- $warn: theming.get-color-from-palette(map.get($config, warn));
11
+ $primary: map.get($config, primary);
12
+ $warn: map.get($config, warn);
37
13
  $foreground: map.get($config, foreground);
38
14
 
39
- @include mdc-helpers.using-mdc-theme($config) {
40
- .mat-mdc-checkbox {
41
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
42
- @include ripple-theme.color((
43
- foreground: (
44
- base: mdc-theme-color.prop-value(on-surface)
45
- ),
46
- ));
15
+ .mat-mdc-checkbox {
16
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($config));
47
17
 
48
- .mdc-checkbox__ripple {
49
- background: mdc-theme-color.prop-value(on-surface);
50
- }
51
-
52
- // MDC's checkbox doesn't support a `color` property. We add support for it by adding a CSS
53
- // class for accent and warn style, and applying the appropriate overrides below. Since we
54
- // don't use MDC's ripple, we also need to set the color for our replacement ripple.
55
- &.mat-primary {
56
- @include checkbox-private.private-checkbox-styles-with-color($config, $primary, primary);
57
- @include _selected-ripple-colors($primary, primary);
58
- }
18
+ &.mat-primary {
19
+ $primary-config: map.merge($config, (accent: $primary));
20
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($primary-config));
21
+ }
59
22
 
60
- &.mat-accent {
61
- @include checkbox-private.private-checkbox-styles-with-color($config, $accent, secondary);
62
- @include _selected-ripple-colors($accent, secondary);
63
- }
23
+ &.mat-warn {
24
+ $warn-config: map.merge($config, (accent: $warn));
25
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($warn-config));
26
+ }
64
27
 
65
- &.mat-warn {
66
- @include checkbox-private.private-checkbox-styles-with-color($config, $warn, error);
67
- @include _selected-ripple-colors($warn, error);
68
- }
28
+ @include mdc-helpers.using-mdc-theme($config) {
29
+ // TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
30
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
69
31
  }
70
32
 
71
- .mat-mdc-checkbox-disabled label {
33
+ &.mat-mdc-checkbox-disabled label {
72
34
  // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
73
35
  color: theming.get-color-from-palette($foreground, disabled-text);
74
36
  }
@@ -78,27 +40,26 @@
78
40
  @mixin typography($config-or-theme) {
79
41
  $config: typography.private-typography-to-2018-config(
80
42
  theming.get-typography-config($config-or-theme));
81
- @include mdc-helpers.using-mdc-typography($config) {
82
- @include mdc-checkbox.without-ripple($query: mdc-helpers.$mdc-typography-styles-query);
83
- @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
43
+ .mat-mdc-checkbox {
44
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-typography-tokens($config));
45
+
46
+ @include mdc-helpers.using-mdc-typography($config) {
47
+ // TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
48
+ @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
49
+ }
84
50
  }
85
51
  }
86
52
 
87
53
  @mixin density($config-or-theme) {
88
54
  $density-scale: theming.get-density-config($config-or-theme);
89
55
 
90
- @include mdc-helpers.disable-mdc-fallback-declarations {
91
- .mat-mdc-checkbox .mdc-checkbox {
92
- @include mdc-checkbox-theme.density(
93
- $density-scale,
94
- $query: mdc-helpers.$mdc-base-styles-query
95
- );
96
- }
56
+ .mat-mdc-checkbox {
57
+ @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-density-tokens($density-scale));
58
+ }
97
59
 
98
- @include mdc-helpers.if-touch-targets-unsupported($density-scale) {
99
- .mat-mdc-checkbox-touch-target {
100
- display: none;
101
- }
60
+ @include mdc-helpers.if-touch-targets-unsupported($density-scale) {
61
+ .mat-mdc-checkbox-touch-target {
62
+ display: none;
102
63
  }
103
64
  }
104
65
  }
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use '@material/elevation/elevation-theme' as mdc-elevation-theme;
2
3
  @use '@material/theme/custom-properties' as mdc-custom-properties;
3
4
  @use '@material/theme/theme' as mdc-theme;
4
5
  @use '@material/theme/keys' as mdc-keys;
@@ -11,12 +12,12 @@ $_placeholder-color-palette: theming.define-palette(palette.$red-palette);
11
12
  // Placeholder color config that can be passed to token getter functions when generating token
12
13
  // slots.
13
14
  $placeholder-color-config: (
14
- primary: $_placeholder-color-palette,
15
- accent: $_placeholder-color-palette,
16
- warn: $_placeholder-color-palette,
17
- is-dark: false,
18
- foreground: palette.$light-theme-foreground-palette,
19
- background: palette.$light-theme-background-palette,
15
+ primary: $_placeholder-color-palette,
16
+ accent: $_placeholder-color-palette,
17
+ warn: $_placeholder-color-palette,
18
+ is-dark: false,
19
+ foreground: palette.$light-theme-foreground-palette,
20
+ background: palette.$light-theme-background-palette,
20
21
  );
21
22
 
22
23
  $_placeholder-typography-level-config: mdc-helpers.typography-config-level-from-mdc(body1);
@@ -24,20 +25,20 @@ $_placeholder-typography-level-config: mdc-helpers.typography-config-level-from-
24
25
  // Placeholder typography config that can be passed to token getter functions when generating token
25
26
  // slots.
26
27
  $placeholder-typography-config: (
27
- font-family: Roboto,
28
- headline-1: $_placeholder-typography-level-config,
29
- headline-2: $_placeholder-typography-level-config,
30
- headline-3: $_placeholder-typography-level-config,
31
- headline-4: $_placeholder-typography-level-config,
32
- headline-5: $_placeholder-typography-level-config,
33
- headline-6: $_placeholder-typography-level-config,
34
- subtitle-1: $_placeholder-typography-level-config,
35
- subtitle-2: $_placeholder-typography-level-config,
36
- body-1: $_placeholder-typography-level-config,
37
- body-2: $_placeholder-typography-level-config,
38
- caption: $_placeholder-typography-level-config,
39
- button: $_placeholder-typography-level-config,
40
- overline: $_placeholder-typography-level-config,
28
+ font-family: Roboto,
29
+ headline-1: $_placeholder-typography-level-config,
30
+ headline-2: $_placeholder-typography-level-config,
31
+ headline-3: $_placeholder-typography-level-config,
32
+ headline-4: $_placeholder-typography-level-config,
33
+ headline-5: $_placeholder-typography-level-config,
34
+ headline-6: $_placeholder-typography-level-config,
35
+ subtitle-1: $_placeholder-typography-level-config,
36
+ subtitle-2: $_placeholder-typography-level-config,
37
+ body-1: $_placeholder-typography-level-config,
38
+ body-2: $_placeholder-typography-level-config,
39
+ caption: $_placeholder-typography-level-config,
40
+ button: $_placeholder-typography-level-config,
41
+ overline: $_placeholder-typography-level-config,
41
42
  );
42
43
 
43
44
  // Placeholder density config that can be passed to token getter functions when generating token
@@ -94,3 +95,15 @@ $_component-prefix: null;
94
95
  }
95
96
  @return $result;
96
97
  }
98
+
99
+ // MDC doesn't currently handle elevation tokens properly. As a temporary workaround we can combine
100
+ // the elevation and shadow-color tokens into a full box-shadow and use it as the value for the
101
+ // elevation token.
102
+ @function resolve-elevation($tokens, $elevation-token, $shadow-color-token) {
103
+ $elevation: map.get($tokens, $elevation-token);
104
+ $shadow-color: map.get($tokens, $shadow-color-token);
105
+ @return map.merge($tokens, (
106
+ $elevation-token: mdc-elevation-theme.elevation-box-shadow($elevation, $shadow-color),
107
+ $shadow-color-token: null,
108
+ ));
109
+ }
@@ -0,0 +1,131 @@
1
+ @use 'sass:map';
2
+ @use '../../../theming/palette';
3
+ @use '../../../theming/theming';
4
+ @use '../../token-utils';
5
+ @use '@material/theme/theme-color' as mdc-theme-color;
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mdc, checkbox);
9
+
10
+ // MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
11
+ // This function falls back to determining the tone based on whether the theme is light or dark.
12
+ @function _contrast-tone($value, $is-dark, $light-color: '#fff', $dark-color: '#000') {
13
+ @if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
14
+ @return if(mdc-theme-color.contrast-tone($value) == 'dark', $dark-color, $light-color);
15
+ }
16
+
17
+ @return if($is-dark, $light-color, $dark-color);
18
+ }
19
+
20
+ // Tokens that can't be configured through Angular Material's current theming API,
21
+ // but may be in a future version of the theming API.
22
+ //
23
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
24
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
25
+ // our CSS.
26
+ @function get-unthemable-tokens() {
27
+ @return (
28
+ // The color of the checkmark when the checkbox is selected and disabled.
29
+ disabled-selected-checkmark-color: #fff,
30
+ // The opacity of the ripple when the checkbox is selected and focused.
31
+ selected-focus-state-layer-opacity: 0.16,
32
+ // The opacity of the ripple when the checkbox is selected and hovered.
33
+ selected-hover-state-layer-opacity: 0.04,
34
+ // The opacity of the ripple when the checkbox is selected and pressed.
35
+ selected-pressed-state-layer-opacity: 0.16,
36
+ // The opacity of the ripple when the checkbox is unselected and focused.
37
+ unselected-focus-state-layer-opacity: 0.16,
38
+ // The opacity of the ripple when the checkbox is unselected and hovered.
39
+ unselected-hover-state-layer-opacity: 0.04,
40
+ // The opacity of the ripple when the checkbox is unselected and pressed.
41
+ unselected-pressed-state-layer-opacity: 0.16,
42
+ // =============================================================================================
43
+ // = TOKENS NOT USED IN ANGULAR MATERIAL =
44
+ // =============================================================================================
45
+ // MDC currently doesn't output a slot for these tokens.
46
+ disabled-selected-icon-opacity: null,
47
+ disabled-unselected-icon-opacity: null,
48
+ );
49
+ }
50
+
51
+ // Tokens that can be configured through Angular Material's color theming API.
52
+ @function get-color-tokens($config) {
53
+ $foreground: map.get($config, foreground);
54
+ $accent: map.get($config, accent);
55
+ $is-dark: map.get($config, is-dark);
56
+ $foreground-base: theming.get-color-from-palette($foreground, base);
57
+ $accent-default: theming.get-color-from-palette($accent, default);
58
+ $disabled-color: theming.get-color-from-palette($foreground, base, 0.38);
59
+ $selected-color: theming.get-color-from-palette($accent);
60
+ $border-color: theming.get-color-from-palette($foreground, base, 0.54);
61
+ $active-border-color:
62
+ theming.get-color-from-palette(palette.$gray-palette, if($is-dark, 200, 900));
63
+
64
+ @return (
65
+ // The color of the checkbox fill when the checkbox is selected and disabled.
66
+ disabled-selected-icon-color: $disabled-color,
67
+ // The color of the checkbox border when the checkbox is unselected and disabled.
68
+ disabled-unselected-icon-color: $disabled-color,
69
+ // The color of the checkmark when the checkbox is selected.
70
+ selected-checkmark-color: _contrast-tone($selected-color, $is-dark),
71
+ // The color of the checkbox fill when the checkbox is selected and focused.
72
+ selected-focus-icon-color: $selected-color,
73
+ // The color of the checkbox fill when the checkbox is selected and hovered.
74
+ selected-hover-icon-color: $selected-color,
75
+ // The color of the checkbox fill when the checkbox is selected.
76
+ selected-icon-color: $selected-color,
77
+ // The color of the checkbox fill when the checkbox is selected an pressed.
78
+ selected-pressed-icon-color: $selected-color,
79
+ // The color of the checkbox border when the checkbox is unselected and focused.
80
+ unselected-focus-icon-color: $active-border-color,
81
+ // The color of the checkbox border when the checkbox is unselected and hovered.
82
+ unselected-hover-icon-color: $active-border-color,
83
+ // The color of the checkbox border when the checkbox is unselected.
84
+ unselected-icon-color: $border-color,
85
+ // The color of the checkbox border when the checkbox is unselected and pressed.
86
+ unselected-pressed-icon-color: $border-color,
87
+ // The color of the ripple when the checkbox is selected and focused.
88
+ selected-focus-state-layer-color: $accent-default,
89
+ // The color of the ripple when the checkbox is selected and hovered.
90
+ selected-hover-state-layer-color: $accent-default,
91
+ // The color of the ripple when the checkbox is selected and pressed.
92
+ selected-pressed-state-layer-color: $accent-default,
93
+ // The color of the ripple when the checkbox is unselected and focused.
94
+ unselected-focus-state-layer-color: $foreground-base,
95
+ // The color of the ripple when the checkbox is unselected and hovered.
96
+ unselected-hover-state-layer-color: $foreground-base,
97
+ // The color of the ripple when the checkbox is unselected and pressed.
98
+ unselected-pressed-state-layer-color: $foreground-base,
99
+ );
100
+ }
101
+
102
+ // Tokens that can be configured through Angular Material's typography theming API.
103
+ @function get-typography-tokens($config) {
104
+ @return ();
105
+ }
106
+
107
+ // Tokens that can be configured through Angular Material's density theming API.
108
+ @function get-density-tokens($config) {
109
+ $scale: theming.clamp-density($config, -3);
110
+
111
+ @return (
112
+ // The diameter of the checkbox's ripple.
113
+ state-layer-size: map.get((
114
+ 0: 40px,
115
+ -1: 36px,
116
+ -2: 32px,
117
+ -3: 28px,
118
+ ), $scale)
119
+ );
120
+ }
121
+
122
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
123
+ // This is used to create token slots.
124
+ @function get-token-slots() {
125
+ @return token-utils.merge-all(
126
+ get-unthemable-tokens(),
127
+ get-color-tokens(token-utils.$placeholder-color-config),
128
+ get-typography-tokens(token-utils.$placeholder-typography-config),
129
+ get-density-tokens(token-utils.$placeholder-density-config)
130
+ );
131
+ }
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use '../../../style/elevation';
2
3
  @use '../../../theming/theming';
3
4
  @use '../../token-utils';
4
5
 
@@ -14,45 +15,49 @@ $prefix: (mdc, elevated-card);
14
15
  @function get-unthemable-tokens() {
15
16
  @return (
16
17
  // The border-radius of the card.
17
- container-shape: 4px,
18
+ container-shape: 4px,
18
19
  // =============================================================================================
19
20
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
20
21
  // =============================================================================================
21
- // TODO(mmalerba): The elevation tokens don't seem to work currently.
22
- // Should work with MDC to figure out what's wrong.
23
- container-elevation: null,
24
- container-shadow-color: null,
25
22
  // Angular Material's card is not an interactive element, and therefore does not support states.
26
- disabled-container-color: null,
27
- disabled-container-elevation: null,
28
- disabled-container-opacity: null,
29
- dragged-container-elevation: null,
30
- dragged-state-layer-color: null,
31
- dragged-state-layer-opacity: null,
32
- focus-container-elevation: null,
33
- focus-state-layer-color:null,
34
- focus-state-layer-opacity: null,
35
- hover-container-elevation: null,
36
- hover-state-layer-color: null,
37
- hover-state-layer-opacity: null,
38
- pressed-container-elevation: null,
39
- pressed-state-layer-color: null,
40
- pressed-state-layer-opacity: null,
23
+ disabled-container-color: null,
24
+ disabled-container-elevation: null,
25
+ disabled-container-opacity: null,
26
+ dragged-container-elevation: null,
27
+ dragged-state-layer-color: null,
28
+ dragged-state-layer-opacity: null,
29
+ focus-container-elevation: null,
30
+ focus-state-layer-color:null,
31
+ focus-state-layer-opacity: null,
32
+ hover-container-elevation: null,
33
+ hover-state-layer-color: null,
34
+ hover-state-layer-opacity: null,
35
+ pressed-container-elevation: null,
36
+ pressed-state-layer-color: null,
37
+ pressed-state-layer-opacity: null,
41
38
  // Angular Material does not currently support surface tint.
42
- container-surface-tint-layer-color: null,
39
+ container-surface-tint-layer-color: null,
43
40
  // MDC does not seem to use these tokens.
44
- icon-color: null,
45
- icon-size: null,
41
+ icon-color: null,
42
+ icon-size: null,
46
43
  );
47
44
  }
48
45
 
49
46
  // Tokens that can be configured through Angular Material's color theming API.
50
47
  @function get-color-tokens($config) {
51
48
  $background: map.get($config, background);
49
+ $foreground: map.get($config, foreground);
50
+ $elevation: theming.get-color-from-palette($foreground, elevation);
52
51
 
53
52
  @return (
54
53
  // The background color of the card.
55
- container-color: theming.get-color-from-palette($background, card),
54
+ container-color: theming.get-color-from-palette($background, card),
55
+ // The elevation level of the card.
56
+ // (Part of the color tokens because it needs to be combined with the shadow color to generate
57
+ // the final box-shadow).
58
+ container-elevation: 1,
59
+ // The color of the card's shadow.
60
+ container-shadow-color: if($elevation != null, $elevation, elevation.$color),
56
61
  );
57
62
  }
58
63
 
@@ -70,9 +75,9 @@ $prefix: (mdc, elevated-card);
70
75
  // This is used to create token slots.
71
76
  @function get-token-slots() {
72
77
  @return token-utils.merge-all(
73
- get-unthemable-tokens(),
74
- get-color-tokens(token-utils.$placeholder-color-config),
75
- get-typography-tokens(token-utils.$placeholder-typography-config),
76
- get-density-tokens(token-utils.$placeholder-density-config)
78
+ get-unthemable-tokens(),
79
+ get-color-tokens(token-utils.$placeholder-color-config),
80
+ get-typography-tokens(token-utils.$placeholder-typography-config),
81
+ get-density-tokens(token-utils.$placeholder-density-config)
77
82
  );
78
83
  }
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use '../../../style/elevation';
2
3
  @use '../../../theming/theming';
3
4
  @use '../../token-utils';
4
5
 
@@ -14,41 +15,37 @@ $prefix: (mdc, outlined-card);
14
15
  @function get-unthemable-tokens() {
15
16
  @return (
16
17
  // The border-radius of the card.
17
- container-shape: 4px,
18
+ container-shape: 4px,
18
19
  // The thickness of the card's border.
19
- outline-width: 1px,
20
+ outline-width: 1px,
20
21
  // =============================================================================================
21
22
  // = TOKENS NOT USED IN ANGULAR MATERIAL =
22
23
  // =============================================================================================
23
- // TODO(mmalerba): The elevation tokens don't seem to work currently.
24
- // Should work with MDC to figure out what's wrong.
25
- container-elevation: null,
26
- container-shadow-color: null,
27
24
  // Angular Material's card is not an interactive element, and therefore does not support states.
28
- disabled-container-elevation: null,
29
- disabled-outline-color: null,
30
- disabled-outline-opacity: null,
31
- dragged-container-elevation: null,
32
- dragged-outline-color: null,
33
- dragged-state-layer-color: null,
34
- dragged-state-layer-opacity: null,
35
- focus-container-elevation: null,
36
- focus-outline-color: null,
37
- focus-state-layer-color: null,
38
- focus-state-layer-opacity: null,
39
- hover-container-elevation: null,
40
- hover-outline-color: null,
41
- hover-state-layer-color: null,
42
- hover-state-layer-opacity: null,
43
- pressed-container-elevation: null,
44
- pressed-outline-color: null,
45
- pressed-state-layer-color: null,
46
- pressed-state-layer-opacity: null,
25
+ disabled-container-elevation: null,
26
+ disabled-outline-color: null,
27
+ disabled-outline-opacity: null,
28
+ dragged-container-elevation: null,
29
+ dragged-outline-color: null,
30
+ dragged-state-layer-color: null,
31
+ dragged-state-layer-opacity: null,
32
+ focus-container-elevation: null,
33
+ focus-outline-color: null,
34
+ focus-state-layer-color: null,
35
+ focus-state-layer-opacity: null,
36
+ hover-container-elevation: null,
37
+ hover-outline-color: null,
38
+ hover-state-layer-color: null,
39
+ hover-state-layer-opacity: null,
40
+ pressed-container-elevation: null,
41
+ pressed-outline-color: null,
42
+ pressed-state-layer-color: null,
43
+ pressed-state-layer-opacity: null,
47
44
  // Angular Material does not currently support surface tint.
48
- container-surface-tint-layer-color: null,
45
+ container-surface-tint-layer-color: null,
49
46
  // MDC does not seem to use these tokens.
50
- icon-color: null,
51
- icon-size: null,
47
+ icon-color: null,
48
+ icon-size: null,
52
49
  );
53
50
  }
54
51
 
@@ -56,12 +53,19 @@ $prefix: (mdc, outlined-card);
56
53
  @function get-color-tokens($config) {
57
54
  $background: map.get($config, background);
58
55
  $foreground: map.get($config, foreground);
56
+ $elevation: theming.get-color-from-palette($foreground, elevation);
59
57
 
60
58
  @return (
61
59
  // The background color of the card.
62
- container-color: theming.get-color-from-palette($background, card),
60
+ container-color: theming.get-color-from-palette($background, card),
63
61
  // The border color of the card.
64
- outline-color: theming.get-color-from-palette($foreground, base, 0.12),
62
+ outline-color: theming.get-color-from-palette($foreground, base, 0.12),
63
+ // The elevation level of the card.
64
+ // (Part of the color tokens because it needs to be combined with the shadow color to generate
65
+ // the final box-shadow).
66
+ container-elevation: 0,
67
+ // The color of the card's shadow.
68
+ container-shadow-color: if($elevation != null, $elevation, elevation.$color),
65
69
  );
66
70
  }
67
71
 
@@ -79,9 +83,9 @@ $prefix: (mdc, outlined-card);
79
83
  // This is used to create token slots.
80
84
  @function get-token-slots() {
81
85
  @return token-utils.merge-all(
82
- get-unthemable-tokens(),
83
- get-color-tokens(token-utils.$placeholder-color-config),
84
- get-typography-tokens(token-utils.$placeholder-typography-config),
85
- get-density-tokens(token-utils.$placeholder-density-config)
86
+ get-unthemable-tokens(),
87
+ get-color-tokens(token-utils.$placeholder-color-config),
88
+ get-typography-tokens(token-utils.$placeholder-typography-config),
89
+ get-density-tokens(token-utils.$placeholder-density-config)
86
90
  );
87
91
  }
@@ -1310,6 +1310,8 @@ export declare class MatDateRangeInput<D> implements MatFormFieldControl<DateRan
1310
1310
  private _revalidate;
1311
1311
  /** Registers the current date selection model with the start/end inputs. */
1312
1312
  private _registerModel;
1313
+ /** Checks whether a specific range input directive is required. */
1314
+ private _isTargetRequired;
1313
1315
  static ɵfac: i0.ɵɵFactoryDeclaration<MatDateRangeInput<any>, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }]>;
1314
1316
  static ɵcmp: i0.ɵɵComponentDeclaration<MatDateRangeInput<any>, "mat-date-range-input", ["matDateRangeInput"], { "rangePicker": "rangePicker"; "required": "required"; "dateFilter": "dateFilter"; "min": "min"; "max": "max"; "disabled": "disabled"; "separator": "separator"; "comparisonStart": "comparisonStart"; "comparisonEnd": "comparisonEnd"; }, {}, ["_startInput", "_endInput"], ["input[matStartDate]", "input[matEndDate]"], false, never>;
1315
1317
  }