@angular/material 16.1.0-next.0 → 16.1.0-next.1

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 (112) hide show
  1. package/button/index.d.ts +3 -2
  2. package/checkbox/_checkbox-theme.scss +9 -3
  3. package/chips/_chips-theme.scss +44 -60
  4. package/core/mdc-helpers/_mdc-helpers.scss +6 -6
  5. package/core/style/_sass-utils.scss +7 -0
  6. package/core/tokens/m2/mdc/_chip.scss +313 -0
  7. package/core/tokens/m2/mdc/_linear-progress.scss +2 -5
  8. package/esm2022/autocomplete/autocomplete.mjs +3 -3
  9. package/esm2022/button/button-base.mjs +7 -11
  10. package/esm2022/button/button.mjs +3 -3
  11. package/esm2022/button/fab.mjs +5 -5
  12. package/esm2022/button/icon-button.mjs +3 -3
  13. package/esm2022/checkbox/checkbox.mjs +2 -2
  14. package/esm2022/chips/chip-listbox.mjs +3 -3
  15. package/esm2022/chips/chip-option.mjs +3 -3
  16. package/esm2022/chips/chip-row.mjs +2 -2
  17. package/esm2022/chips/chip.mjs +2 -2
  18. package/esm2022/core/version.mjs +1 -1
  19. package/esm2022/datepicker/calendar-body.mjs +29 -16
  20. package/esm2022/datepicker/datepicker-toggle.mjs +3 -3
  21. package/esm2022/form-field/directives/floating-label.mjs +66 -5
  22. package/esm2022/form-field/directives/notched-outline.mjs +14 -16
  23. package/esm2022/form-field/form-field.mjs +30 -36
  24. package/esm2022/icon/testing/icon-harness.mjs +7 -2
  25. package/esm2022/legacy-autocomplete/autocomplete.mjs +3 -3
  26. package/esm2022/legacy-chips/chip-list.mjs +3 -3
  27. package/esm2022/legacy-core/option/optgroup.mjs +3 -3
  28. package/esm2022/legacy-form-field/form-field.mjs +3 -3
  29. package/esm2022/legacy-menu/menu-item.mjs +3 -3
  30. package/esm2022/legacy-menu/menu.mjs +3 -3
  31. package/esm2022/legacy-paginator/paginator.mjs +3 -3
  32. package/esm2022/legacy-select/select.mjs +3 -3
  33. package/esm2022/legacy-table/table.mjs +3 -3
  34. package/esm2022/legacy-tabs/tab-group.mjs +3 -3
  35. package/esm2022/list/list-base.mjs +2 -1
  36. package/esm2022/menu/menu-item.mjs +3 -3
  37. package/esm2022/menu/menu.mjs +3 -3
  38. package/esm2022/paginator/paginator.mjs +3 -3
  39. package/esm2022/select/select.mjs +5 -5
  40. package/esm2022/sidenav/drawer.mjs +7 -7
  41. package/esm2022/sidenav/sidenav.mjs +7 -7
  42. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  43. package/esm2022/stepper/stepper.mjs +3 -3
  44. package/esm2022/table/table.mjs +3 -3
  45. package/esm2022/tabs/tab-group.mjs +3 -3
  46. package/esm2022/tooltip/tooltip.mjs +5 -1
  47. package/fesm2022/autocomplete.mjs +2 -2
  48. package/fesm2022/autocomplete.mjs.map +1 -1
  49. package/fesm2022/button.mjs +14 -18
  50. package/fesm2022/button.mjs.map +1 -1
  51. package/fesm2022/checkbox.mjs +2 -2
  52. package/fesm2022/checkbox.mjs.map +1 -1
  53. package/fesm2022/chips.mjs +8 -8
  54. package/fesm2022/chips.mjs.map +1 -1
  55. package/fesm2022/core.mjs +1 -1
  56. package/fesm2022/core.mjs.map +1 -1
  57. package/fesm2022/datepicker.mjs +30 -17
  58. package/fesm2022/datepicker.mjs.map +1 -1
  59. package/fesm2022/form-field.mjs +102 -50
  60. package/fesm2022/form-field.mjs.map +1 -1
  61. package/fesm2022/icon/testing.mjs +6 -1
  62. package/fesm2022/icon/testing.mjs.map +1 -1
  63. package/fesm2022/legacy-autocomplete.mjs +2 -2
  64. package/fesm2022/legacy-autocomplete.mjs.map +1 -1
  65. package/fesm2022/legacy-chips.mjs +2 -2
  66. package/fesm2022/legacy-chips.mjs.map +1 -1
  67. package/fesm2022/legacy-core.mjs +2 -2
  68. package/fesm2022/legacy-core.mjs.map +1 -1
  69. package/fesm2022/legacy-form-field.mjs +2 -2
  70. package/fesm2022/legacy-form-field.mjs.map +1 -1
  71. package/fesm2022/legacy-menu.mjs +4 -4
  72. package/fesm2022/legacy-menu.mjs.map +1 -1
  73. package/fesm2022/legacy-paginator.mjs +2 -2
  74. package/fesm2022/legacy-paginator.mjs.map +1 -1
  75. package/fesm2022/legacy-select.mjs +2 -2
  76. package/fesm2022/legacy-select.mjs.map +1 -1
  77. package/fesm2022/legacy-table.mjs +2 -2
  78. package/fesm2022/legacy-table.mjs.map +1 -1
  79. package/fesm2022/legacy-tabs.mjs +2 -2
  80. package/fesm2022/legacy-tabs.mjs.map +1 -1
  81. package/fesm2022/list.mjs +1 -0
  82. package/fesm2022/list.mjs.map +1 -1
  83. package/fesm2022/menu.mjs +4 -4
  84. package/fesm2022/menu.mjs.map +1 -1
  85. package/fesm2022/paginator.mjs +2 -2
  86. package/fesm2022/paginator.mjs.map +1 -1
  87. package/fesm2022/select.mjs +4 -4
  88. package/fesm2022/select.mjs.map +1 -1
  89. package/fesm2022/sidenav.mjs +12 -12
  90. package/fesm2022/sidenav.mjs.map +1 -1
  91. package/fesm2022/slide-toggle.mjs +2 -2
  92. package/fesm2022/slide-toggle.mjs.map +1 -1
  93. package/fesm2022/stepper.mjs +2 -2
  94. package/fesm2022/stepper.mjs.map +1 -1
  95. package/fesm2022/table.mjs +2 -2
  96. package/fesm2022/table.mjs.map +1 -1
  97. package/fesm2022/tabs.mjs +2 -2
  98. package/fesm2022/tabs.mjs.map +1 -1
  99. package/fesm2022/tooltip.mjs +4 -0
  100. package/fesm2022/tooltip.mjs.map +1 -1
  101. package/form-field/index.d.ts +44 -12
  102. package/list/index.d.ts +2 -1
  103. package/package.json +49 -49
  104. package/prebuilt-themes/deeppurple-amber.css +1 -1
  105. package/prebuilt-themes/indigo-pink.css +1 -1
  106. package/prebuilt-themes/pink-bluegrey.css +1 -1
  107. package/prebuilt-themes/purple-green.css +1 -1
  108. package/schematics/ng-add/index.js +1 -1
  109. package/schematics/ng-add/index.mjs +1 -1
  110. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  111. package/schematics/ng-update/index_bundled.js +25 -25
  112. package/tooltip/index.d.ts +4 -0
package/button/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import * as i4 from '@angular/material/core';
12
12
  import { InjectionToken } from '@angular/core';
13
13
  import { MatRipple } from '@angular/material/core';
14
14
  import { NgZone } from '@angular/core';
15
+ import { OnChanges } from '@angular/core';
15
16
  import { OnDestroy } from '@angular/core';
16
17
  import { OnInit } from '@angular/core';
17
18
  import { Platform } from '@angular/cdk/platform';
@@ -94,7 +95,7 @@ export declare class MatButton extends MatButtonBase {
94
95
  }
95
96
 
96
97
  /** Base class for all buttons. */
97
- declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanColor, CanDisableRipple, AfterViewInit, OnDestroy {
98
+ declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanColor, CanDisableRipple, AfterViewInit, OnChanges, OnDestroy {
98
99
  _platform: Platform;
99
100
  _ngZone: NgZone;
100
101
  _animationMode?: string | undefined;
@@ -117,12 +118,12 @@ declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanCo
117
118
  protected _ripple?: MatRipple;
118
119
  constructor(elementRef: ElementRef, _platform: Platform, _ngZone: NgZone, _animationMode?: string | undefined);
119
120
  ngAfterViewInit(): void;
121
+ ngOnChanges(): void;
120
122
  ngOnDestroy(): void;
121
123
  /** Focuses the button. */
122
124
  focus(_origin?: FocusOrigin, options?: FocusOptions): void;
123
125
  /** Gets whether the button has one of the given attributes. */
124
126
  private _hasHostAttributes;
125
- _isRippleDisabled(): void;
126
127
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonBase, never>;
127
128
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonBase, never, never, {}, {}, never, never, false, never>;
128
129
  }
@@ -1,6 +1,7 @@
1
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 '../core/style/sass-utils';
4
5
  @use '../core/theming/theming';
5
6
  @use '../core/typography/typography';
6
7
  @use '../core/mdc-helpers/mdc-helpers';
@@ -12,9 +13,11 @@
12
13
  $warn: map.get($config, warn);
13
14
  $foreground: map.get($config, foreground);
14
15
 
15
- .mat-mdc-checkbox {
16
+ @include sass-utils.current-selector-or-root() {
16
17
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($config));
18
+ }
17
19
 
20
+ .mat-mdc-checkbox {
18
21
  &.mat-primary {
19
22
  $primary-config: map.merge($config, (accent: $primary));
20
23
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($primary-config));
@@ -40,9 +43,12 @@
40
43
  @mixin typography($config-or-theme) {
41
44
  $config: typography.private-typography-to-2018-config(
42
45
  theming.get-typography-config($config-or-theme));
43
- .mat-mdc-checkbox {
46
+
47
+ @include sass-utils.current-selector-or-root() {
44
48
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-typography-tokens($config));
49
+ }
45
50
 
51
+ .mat-mdc-checkbox {
46
52
  @include mdc-helpers.using-mdc-typography($config) {
47
53
  // TODO(mmalerba): Switch to static-styles, theme-styles, and theme once they're available.
48
54
  @include mdc-form-field.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
@@ -53,7 +59,7 @@
53
59
  @mixin density($config-or-theme) {
54
60
  $density-scale: theming.get-density-config($config-or-theme);
55
61
 
56
- .mat-mdc-checkbox {
62
+ @include sass-utils.current-selector-or-root() {
57
63
  @include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-density-tokens($density-scale));
58
64
  }
59
65
 
@@ -2,100 +2,84 @@
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
4
  @use '@material/chips/chip-theme' as mdc-chip-theme;
5
- @use '@material/chips/chip-set' as mdc-chip-set;
6
- @use '@material/theme/theme-color' as mdc-theme-color;
7
- @use '@material/theme/color-palette' as mdc-color-palette;
8
- @use '@material/typography' as mdc-typography;
9
- @use '../core/mdc-helpers/mdc-helpers';
5
+ @use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
6
+ @use '../core/theming/palette';
10
7
  @use '../core/theming/theming';
11
8
  @use '../core/typography/typography';
9
+ @use '../core/mdc-helpers/mdc-helpers';
12
10
 
13
- @mixin _chip-variant($background, $foreground) {
14
- @include mdc-chip-theme.theme((
15
- elevated-container-color: $background,
16
- elevated-disabled-container-color: $background,
17
- label-text-color: $foreground,
18
- disabled-label-text-color: $foreground,
19
- with-icon-icon-color: $foreground,
20
- with-icon-disabled-icon-color: $foreground,
21
- with-trailing-icon-disabled-trailing-icon-color: $foreground,
22
- with-trailing-icon-trailing-icon-color: $foreground,
23
- with-icon-selected-icon-color: $foreground,
24
- ));
25
- }
11
+ @function _get-default-palette($config) {
12
+ $is-dark: map.get($config, is-dark);
13
+ $grey-50: map.get(palette.$grey-palette, 50);
14
+ $grey-900: map.get(palette.$grey-palette, 900);
15
+ $default-foreground: if($is-dark, $grey-50, $grey-900);
26
16
 
27
- @mixin _colored-chip($palette) {
28
- $background: theming.get-color-from-palette($palette);
29
- $foreground: theming.get-color-from-palette($palette, default-contrast);
17
+ $surface: map.get(map.get($config, background), card);
18
+ $on-surface: if(
19
+ mdc-helpers.variable-safe-contrast-tone($surface, $is-dark) == 'dark',
20
+ #000,
21
+ #fff
22
+ );
23
+ $default-background: if(
24
+ meta.type-of($on-surface) == color and meta.type-of($surface) == color,
25
+ color.mix($on-surface, $surface, 12%),
26
+ $on-surface
27
+ );
30
28
 
31
- &.mat-mdc-chip-selected,
32
- &.mat-mdc-chip-highlighted {
33
- @include _chip-variant($background, $foreground);
34
- }
29
+ @return (default: $default-background, default-contrast: $default-foreground);
35
30
  }
36
31
 
37
32
  @mixin color($config-or-theme) {
38
33
  $config: theming.get-color-config($config-or-theme);
39
- $primary: map.get($config, primary);
40
- $accent: map.get($config, accent);
41
- $warn: map.get($config, warn);
42
- $foreground: map.get($config, foreground);
43
- $is-dark: map.get($config, is-dark);
44
-
45
- @include mdc-helpers.using-mdc-theme($config) {
46
- $on-surface: mdc-theme-color.prop-value(on-surface);
47
- $surface: mdc-theme-color.prop-value(surface);
48
-
49
- .mat-mdc-standard-chip {
50
- $standard-background: if(
51
- meta.type-of($on-surface) == color and meta.type-of($surface) == color,
52
- color.mix($on-surface, $surface, 12%),
53
- $on-surface
54
- );
55
34
 
56
- @include _chip-variant(
57
- $standard-background,
58
- if($is-dark, mdc-color-palette.$grey-50, mdc-color-palette.$grey-900)
59
- );
35
+ .mat-mdc-standard-chip {
36
+ $default-palette: _get-default-palette($config);
37
+ $default-config: map.merge($config, (primary: $default-palette));
38
+ $default-color-tokens: tokens-mdc-chip.get-color-tokens($default-config);
39
+ @include mdc-chip-theme.theme($default-color-tokens);
60
40
 
41
+ &.mat-mdc-chip-selected,
42
+ &.mat-mdc-chip-highlighted {
61
43
  &.mat-primary {
62
- @include _colored-chip($primary);
44
+ $primary-color-tokens: tokens-mdc-chip.get-color-tokens($config);
45
+ @include mdc-chip-theme.theme($primary-color-tokens);
63
46
  }
64
47
 
65
48
  &.mat-accent {
66
- @include _colored-chip($accent);
49
+ $accent-config: map.merge($config, (primary: map.get($config, accent)));
50
+ $accent-color-tokens: tokens-mdc-chip.get-color-tokens($accent-config);
51
+ @include mdc-chip-theme.theme($accent-color-tokens);
67
52
  }
68
53
 
69
54
  &.mat-warn {
70
- @include _colored-chip($warn);
55
+ $warn-config: map.merge($config, (primary: map.get($config, warn)));
56
+ $warn-color-tokens: tokens-mdc-chip.get-color-tokens($warn-config);
57
+ @include mdc-chip-theme.theme($warn-color-tokens);
71
58
  }
72
59
  }
73
60
  }
74
61
 
75
62
  .mat-mdc-chip-focus-overlay {
76
- background: map.get($foreground, base);
63
+ background: map.get(map.get($config, foreground), base);
77
64
  }
78
65
  }
79
66
 
80
67
  @mixin typography($config-or-theme) {
81
68
  $config: typography.private-typography-to-2018-config(
82
- theming.get-typography-config($config-or-theme));
83
- @include mdc-chip-set.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
84
- @include mdc-helpers.using-mdc-typography($config) {
85
- // Note that we don't go through MDC's typography mixin, because it assigns the styles to
86
- // an inner element which makes it difficult for clients to customize. Instead we apply the
87
- // same styles ourselves to the root.
88
- .mat-mdc-standard-chip {
89
- @include mdc-typography.typography(body2, $query: mdc-helpers.$mdc-typography-styles-query);
90
- }
69
+ theming.get-typography-config($config-or-theme)
70
+ );
71
+ $typography-tokens: tokens-mdc-chip.get-typography-tokens($config);
72
+
73
+ .mat-mdc-standard-chip {
74
+ @include mdc-chip-theme.theme($typography-tokens);
91
75
  }
92
76
  }
93
77
 
94
78
  @mixin density($config-or-theme) {
95
79
  $density-scale: theming.get-density-config($config-or-theme);
96
- $density-scale: theming.clamp-density($density-scale, -2);
80
+ $density-tokens: tokens-mdc-chip.get-density-tokens($density-scale);
97
81
  .mat-mdc-chip.mat-mdc-standard-chip {
98
- @include mdc-chip-theme.density($density-scale, $query: mdc-helpers.$mdc-base-styles-query);
82
+ @include mdc-chip-theme.theme($density-tokens);
99
83
  }
100
84
  }
101
85
 
@@ -100,7 +100,7 @@ $mat-typography-mdc-level-mappings: (
100
100
 
101
101
  // MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
102
102
  // This function falls back to determining the tone based on whether the theme is light or dark.
103
- @function _variable-safe-contrast-tone($value, $is-dark) {
103
+ @function variable-safe-contrast-tone($value, $is-dark) {
104
104
  @if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
105
105
  @return mdc-theme-color.contrast-tone($value);
106
106
  }
@@ -109,7 +109,7 @@ $mat-typography-mdc-level-mappings: (
109
109
  }
110
110
 
111
111
  @function _variable-safe-ink-color-for-fill($text-style, $fill-color, $is-dark) {
112
- $contrast-tone: _variable-safe-contrast-tone($fill-color, $is-dark);
112
+ $contrast-tone: variable-safe-contrast-tone($fill-color, $is-dark);
113
113
  @return map.get(map.get(mdc-theme-color.$text-colors, $contrast-tone), $text-style);
114
114
  }
115
115
 
@@ -137,17 +137,17 @@ $mat-typography-mdc-level-mappings: (
137
137
  // Set new values based on the given Angular Material theme.
138
138
  mdc-theme-color.$primary: $primary;
139
139
  mdc-theme-color.$on-primary:
140
- if(_variable-safe-contrast-tone(mdc-theme-color.$primary, $is-dark) == 'dark', #000, #fff);
140
+ if(variable-safe-contrast-tone(mdc-theme-color.$primary, $is-dark) == 'dark', #000, #fff);
141
141
  mdc-theme-color.$secondary: $accent;
142
142
  mdc-theme-color.$on-secondary:
143
- if(_variable-safe-contrast-tone(mdc-theme-color.$secondary, $is-dark) == 'dark', #000, #fff);
143
+ if(variable-safe-contrast-tone(mdc-theme-color.$secondary, $is-dark) == 'dark', #000, #fff);
144
144
  mdc-theme-color.$background: theming.get-color-from-palette($background-palette, background);
145
145
  mdc-theme-color.$surface: theming.get-color-from-palette($background-palette, card);
146
146
  mdc-theme-color.$on-surface:
147
- if(_variable-safe-contrast-tone(mdc-theme-color.$surface, $is-dark) == 'dark', #000, #fff);
147
+ if(variable-safe-contrast-tone(mdc-theme-color.$surface, $is-dark) == 'dark', #000, #fff);
148
148
  mdc-theme-color.$error: $warn;
149
149
  mdc-theme-color.$on-error:
150
- if(_variable-safe-contrast-tone(mdc-theme-color.$error, $is-dark) == 'dark', #000, #fff);
150
+ if(variable-safe-contrast-tone(mdc-theme-color.$error, $is-dark) == 'dark', #000, #fff);
151
151
  mdc-theme-color.$property-values: (
152
152
  // Primary
153
153
  primary: mdc-theme-color.$primary,
@@ -0,0 +1,7 @@
1
+ // Include content under the current selector (&) or the document root if there is no current
2
+ // selector.
3
+ @mixin current-selector-or-root($root: html) {
4
+ @at-root #{& or $root} {
5
+ @content;
6
+ }
7
+ }
@@ -0,0 +1,313 @@
1
+ @use 'sass:color';
2
+ @use 'sass:map';
3
+ @use '../../token-utils';
4
+ @use '../../../mdc-helpers/mdc-helpers';
5
+ @use '../../../theming/theming';
6
+ @use '../../../typography/typography-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mdc, chip);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ //
14
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
15
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
16
+ // our CSS.
17
+ @function get-unthemable-tokens() {
18
+ @return (
19
+ // The shape & radius of the chip.
20
+ container-shape:
21
+ (
22
+ family: 'rounded',
23
+ radius: (
24
+ 16px 16px 16px 16px,
25
+ )
26
+ ),
27
+ // The shape & radius of the avatar.
28
+ with-avatar-avatar-shape:
29
+ (
30
+ family: 'rounded',
31
+ radius: (
32
+ 14px 14px 14px 14px,
33
+ )
34
+ ),
35
+ // The width & height of the chip avatar.
36
+ with-avatar-avatar-size: 28px,
37
+ // The width & height of the chip icon.
38
+ with-icon-icon-size: 18px,
39
+ // Not used by MDC.
40
+ disabled-label-text-opacity: null,
41
+ // Not used by MDC.
42
+ disabled-outline-opacity: null,
43
+ // Not used by MDC.
44
+ elevated-disabled-container-opacity: null,
45
+ // Not used by MDC.
46
+ flat-disabled-outline-opacity: null,
47
+ // Not used by MDC.
48
+ flat-disabled-unselected-outline-opacity: null,
49
+ // Our chips do not have a border.
50
+ flat-outline-width: null,
51
+ // Our chips do not have a border.
52
+ flat-selected-outline-width: null,
53
+ // Our chips do not have a border.
54
+ flat-unselected-outline-width: null,
55
+ // Our chips do not have a border.
56
+ outline-width: null,
57
+ // Not used by MDC.
58
+ with-avatar-disabled-avatar-opacity: null,
59
+ // Not used by MDC.
60
+ with-icon-disabled-icon-opacity: null,
61
+ // Not used by MDC.
62
+ with-leading-icon-disabled-leading-icon-opacity: null,
63
+ // Not used by MDC.
64
+ with-leading-icon-leading-icon-size: null,
65
+ // Not used by MDC.
66
+ with-trailing-icon-disabled-trailing-icon-opacity: null,
67
+ // Not used by MDC.
68
+ with-trailing-icon-trailing-icon-size: null,
69
+ // Elevated chips not implemented.
70
+ container-elevation: null,
71
+ // Elevated chips not implemented.
72
+ container-shadow-color: null,
73
+ // Our chips do not have a border.
74
+ disabled-outline-color: null,
75
+ // Elevated chips not implemented.
76
+ elevated-container-elevation: null,
77
+ // Elevated chips not implemented.
78
+ elevated-container-shadow-color: null,
79
+ // Elevated chips not implemented.
80
+ container-surface-tint-layer-color: null,
81
+ // Elevated chips not implemented.
82
+ elevated-disabled-container-elevation: null,
83
+ // Elevated chips not implemented.
84
+ elevated-focus-container-elevation: null,
85
+ // Elevated chips not implemented.
86
+ elevated-hover-container-elevation: null,
87
+ // Elevated chips not implemented.
88
+ elevated-pressed-container-elevation: null,
89
+ // Elevated chips not implemented.
90
+ elevated-selected-container-color: null,
91
+ // Elevated chips not implemented.
92
+ elevated-selected-container-elevation: null,
93
+ // Elevated chips not implemented.
94
+ elevated-unselected-container-color: null,
95
+ // Elevated chips not implemented.
96
+ flat-container-elevation: null,
97
+ // Our chips do not have a border.
98
+ flat-disabled-outline-color: null,
99
+ // Not providing this uses
100
+ flat-disabled-selected-container-color: null,
101
+ // Not used by MDC.
102
+ flat-disabled-selected-container-opacity: null,
103
+ // Unused.
104
+ flat-disabled-selected-outline-color: null,
105
+ // Unused.
106
+ flat-disabled-selected-outline-opacity: null,
107
+ // Unused.
108
+ flat-disabled-unselected-outline-color: null,
109
+ // Unused.
110
+ flat-focus-outline-color: null,
111
+ // Unused.
112
+ flat-outline-color: null,
113
+ // Unused.
114
+ flat-selected-container-color: null,
115
+ // Unused.
116
+ flat-selected-focus-container-elevation: null,
117
+ // Unused.
118
+ flat-selected-hover-container-elevation: null,
119
+ // Unused.
120
+ flat-selected-outline-color: null,
121
+ // Unused.
122
+ flat-selected-pressed-container-elevation: null,
123
+ // Unused.
124
+ flat-unselected-focus-container-elevation: null,
125
+ // Unused.
126
+ flat-unselected-focus-outline-color: null,
127
+ // Unused.
128
+ flat-unselected-hover-container-elevation: null,
129
+ // Unused.
130
+ flat-unselected-outline-color: null,
131
+ // Unused.
132
+ flat-unselected-pressed-container-elevation: null,
133
+ // Unused.
134
+ focus-label-text-color: null,
135
+ // Unused.
136
+ focus-outline-color: null,
137
+ // Unused.
138
+ focus-state-layer-color: null,
139
+ // Unused.
140
+ focus-state-layer-opacity: null,
141
+ // Unused.
142
+ hover-label-text-color: null,
143
+ // Unused.
144
+ hover-state-layer-color: null,
145
+ // Unused.
146
+ hover-state-layer-opacity: null,
147
+ // Unused.
148
+ outline-color: null,
149
+ // Unused.
150
+ pressed-label-text-color: null,
151
+ // Unused.
152
+ pressed-state-layer-color: null,
153
+ // Unused.
154
+ pressed-state-layer-opacity: null,
155
+ // Unused.
156
+ selected-focus-label-text-color: null,
157
+ // Unused.
158
+ selected-focus-state-layer-color: null,
159
+ // Unused.
160
+ selected-focus-state-layer-opacity: null,
161
+ // Unused.
162
+ selected-hover-label-text-color: null,
163
+ // Unused.
164
+ selected-hover-state-layer-color: null,
165
+ // Unused.
166
+ selected-hover-state-layer-opacity: null,
167
+ // Unused.
168
+ selected-label-text-color: null,
169
+ // Unused.
170
+ selected-pressed-label-text-color: null,
171
+ // Unused.
172
+ selected-pressed-state-layer-color: null,
173
+ // Unused.
174
+ selected-pressed-state-layer-opacity: null,
175
+ // Unused.
176
+ unselected-focus-label-text-color: null,
177
+ // Unused.
178
+ unselected-focus-state-layer-color: null,
179
+ // Unused.
180
+ unselected-focus-state-layer-opacity: null,
181
+ // Unused.
182
+ unselected-hover-label-text-color: null,
183
+ // Unused.
184
+ unselected-hover-state-layer-color: null,
185
+ // Unused.
186
+ unselected-hover-state-layer-opacity: null,
187
+ // Unused.
188
+ unselected-label-text-color: null,
189
+ // Unused.
190
+ unselected-pressed-label-text-color: null,
191
+ // Unused.
192
+ unselected-pressed-state-layer-color: null,
193
+ // Unused.
194
+ unselected-pressed-state-layer-opacity: null,
195
+ // Unused.
196
+ with-icon-focus-icon-color: null,
197
+ // Unused.
198
+ with-icon-hover-icon-color: null,
199
+ // Unused.
200
+ with-icon-pressed-icon-color: null,
201
+ // Unused.
202
+ with-icon-selected-focus-icon-color: null,
203
+ // Unused.
204
+ with-icon-selected-hover-icon-color: null,
205
+ // Unused.
206
+ with-icon-selected-pressed-icon-color: null,
207
+ // Unused.
208
+ with-icon-unselected-focus-icon-color: null,
209
+ // Unused.
210
+ with-icon-unselected-hover-icon-color: null,
211
+ // Unused.
212
+ with-icon-unselected-icon-color: null,
213
+ // Unused.
214
+ with-icon-unselected-pressed-icon-color: null,
215
+ // Unused.
216
+ with-leading-icon-disabled-leading-icon-color: null,
217
+ // Unused.
218
+ with-leading-icon-focus-leading-icon-color: null,
219
+ // Unused.
220
+ with-leading-icon-hover-leading-icon-color: null,
221
+ // Unused.
222
+ with-leading-icon-leading-icon-color: null,
223
+ // Unused.
224
+ with-leading-icon-pressed-leading-icon-color: null,
225
+ // Unused.
226
+ with-trailing-icon-focus-trailing-icon-color: null,
227
+ // Unused.
228
+ with-trailing-icon-hover-trailing-icon-color: null,
229
+ // Unused.
230
+ with-trailing-icon-pressed-trailing-icon-color: null
231
+ );
232
+ }
233
+
234
+ // Tokens that can be configured through Angular Material's color theming API.
235
+ @function get-color-tokens($config) {
236
+ $palette: map.get($config, primary);
237
+ $background: theming.get-color-from-palette($palette);
238
+ $foreground: theming.get-color-from-palette($palette, default-contrast);
239
+
240
+ @return (
241
+ // The text color of a disabled chip.
242
+ disabled-label-text-color: $foreground,
243
+ // The background-color of the chip.
244
+ elevated-container-color: $background,
245
+ // The background-color of a disabled chip.
246
+ elevated-disabled-container-color: $background,
247
+ // The chip text color.
248
+ label-text-color: $foreground,
249
+ // The icon color of a chip.
250
+ with-icon-icon-color: $foreground,
251
+ // The color of the icon of a disabled chip.
252
+ with-icon-disabled-icon-color: $foreground,
253
+ // The color of the icon of a selected chip.
254
+ with-icon-selected-icon-color: $foreground,
255
+ // The color of the icon at the end of a disabled chip.
256
+ with-trailing-icon-disabled-trailing-icon-color: $foreground,
257
+ // The color of the icon at the end of the chip.
258
+ with-trailing-icon-trailing-icon-color: $foreground
259
+ );
260
+ }
261
+
262
+ // Tokens that can be configured through Angular Material's typography theming API.
263
+ @function get-typography-tokens($config) {
264
+ // TODO(wagnermaciel): The earlier implementation of the chip used MDC's APIs to create the
265
+ // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
266
+ // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
267
+ // fallback.
268
+ @if ($config == null) {
269
+ $config: mdc-helpers.private-fallback-typography-from-mdc();
270
+ }
271
+
272
+ @return (
273
+ // The font family of the chip text.
274
+ label-text-font: typography-utils.font-family($config, body-2) or
275
+ typography-utils.font-family($config),
276
+ // The line height of the chip text.
277
+ label-text-line-height: typography-utils.line-height($config, body-2),
278
+ // The font size of the chip text.
279
+ label-text-size: typography-utils.font-size($config, body-2),
280
+ // The letter spacing of the chip label.
281
+ label-text-tracking: typography-utils.letter-spacing($config, body-2),
282
+ // The font weight of the chip text.
283
+ label-text-weight: typography-utils.font-weight($config, body-2)
284
+ );
285
+ }
286
+
287
+ // Tokens that can be configured through Angular Material's density theming API.
288
+ @function get-density-tokens($config) {
289
+ $scale: theming.clamp-density($config, -2);
290
+ @return (
291
+ // The height of the chip.
292
+ container-height:
293
+ map.get(
294
+ (
295
+ 0: 32px,
296
+ -1: 28px,
297
+ -2: 24px,
298
+ ),
299
+ $scale
300
+ )
301
+ );
302
+ }
303
+
304
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
305
+ // This is used to create token slots.
306
+ @function get-token-slots() {
307
+ @return token-utils.merge-all(
308
+ get-unthemable-tokens(),
309
+ get-color-tokens(token-utils.$placeholder-color-config),
310
+ get-typography-tokens(token-utils.$placeholder-typography-config),
311
+ get-density-tokens(token-utils.$placeholder-density-config)
312
+ );
313
+ }
@@ -17,12 +17,9 @@ $prefix: (mdc, linear-progress);
17
17
  $height: 4px;
18
18
 
19
19
  @return (
20
- // The height of the progress bar. MDC has three tokens with the goal
21
- // of having `track-height` apply only to the track. In our case, all three
22
- // are always the same. Specify all three while the transition is in
23
- // progress.
20
+ // The height of the progress bar. `active-indicator-height` applies to the
21
+ // bar and `track-height` applies to the track.
24
22
  active-indicator-height: $height,
25
- bar-and-track-height: $height,
26
23
  track-height: $height,
27
24
  );
28
25
  }