@angular/material 16.1.2 → 16.2.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 (41) hide show
  1. package/button/index.d.ts +11 -35
  2. package/card/_card-theme.scss +4 -7
  3. package/checkbox/_checkbox-theme.scss +1 -4
  4. package/core/index.d.ts +37 -0
  5. package/core/style/_sass-utils.scss +12 -0
  6. package/core/tokens/_token-utils.scss +11 -2
  7. package/core/tokens/m2/mat/_slide-toggle.scss +52 -0
  8. package/core/tokens/m2/mat/_table.scss +97 -0
  9. package/core/tokens/m2/mdc/_switch.scss +182 -0
  10. package/esm2022/button/button-base.mjs +32 -17
  11. package/esm2022/button/button.mjs +3 -3
  12. package/esm2022/button/fab.mjs +5 -5
  13. package/esm2022/button/icon-button.mjs +4 -15
  14. package/esm2022/core/private/index.mjs +9 -0
  15. package/esm2022/core/private/ripple-loader.mjs +133 -0
  16. package/esm2022/core/public-api.mjs +2 -1
  17. package/esm2022/core/version.mjs +1 -1
  18. package/esm2022/legacy-autocomplete/autocomplete-trigger.mjs +2 -2
  19. package/esm2022/slide-toggle/slide-toggle-config.mjs +2 -2
  20. package/esm2022/slide-toggle/slide-toggle.mjs +16 -4
  21. package/esm2022/table/table.mjs +2 -2
  22. package/fesm2022/button.mjs +57 -156
  23. package/fesm2022/button.mjs.map +1 -1
  24. package/fesm2022/core.mjs +124 -3
  25. package/fesm2022/core.mjs.map +1 -1
  26. package/fesm2022/legacy-autocomplete.mjs.map +1 -1
  27. package/fesm2022/slide-toggle.mjs +16 -4
  28. package/fesm2022/slide-toggle.mjs.map +1 -1
  29. package/fesm2022/table.mjs +2 -2
  30. package/fesm2022/table.mjs.map +1 -1
  31. package/package.json +7 -7
  32. package/prebuilt-themes/deeppurple-amber.css +1 -1
  33. package/prebuilt-themes/indigo-pink.css +1 -1
  34. package/prebuilt-themes/pink-bluegrey.css +1 -1
  35. package/prebuilt-themes/purple-green.css +1 -1
  36. package/schematics/ng-add/index.js +2 -2
  37. package/schematics/ng-add/index.mjs +2 -2
  38. package/slide-toggle/_slide-toggle-theme.scss +26 -75
  39. package/slide-toggle/index.d.ts +7 -1
  40. package/table/_table-theme.scss +24 -40
  41. package/esm2022/button/button-lazy-loader.mjs +0 -113
package/button/index.d.ts CHANGED
@@ -11,8 +11,8 @@ import * as i0 from '@angular/core';
11
11
  import * as i4 from '@angular/material/core';
12
12
  import { InjectionToken } from '@angular/core';
13
13
  import { MatRipple } from '@angular/material/core';
14
+ import { MatRippleLoader } from '@angular/material/core';
14
15
  import { NgZone } from '@angular/core';
15
- import { OnChanges } from '@angular/core';
16
16
  import { OnDestroy } from '@angular/core';
17
17
  import { OnInit } from '@angular/core';
18
18
  import { Platform } from '@angular/cdk/platform';
@@ -95,7 +95,7 @@ export declare class MatButton extends MatButtonBase {
95
95
  }
96
96
 
97
97
  /** Base class for all buttons. */
98
- declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanColor, CanDisableRipple, AfterViewInit, OnChanges, OnDestroy {
98
+ declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanColor, CanDisableRipple, AfterViewInit, OnDestroy {
99
99
  _platform: Platform;
100
100
  _ngZone: NgZone;
101
101
  _animationMode?: string | undefined;
@@ -104,7 +104,7 @@ declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanCo
104
104
  * Handles the lazy creation of the MatButton ripple.
105
105
  * Used to improve initial load time of large applications.
106
106
  */
107
- _rippleLoader: MatButtonLazyLoader;
107
+ _rippleLoader: MatRippleLoader;
108
108
  /** Whether this button is a FAB. Used to apply the correct class on the ripple. */
109
109
  _isFab: boolean;
110
110
  /**
@@ -114,43 +114,25 @@ declare class MatButtonBase extends _MatButtonMixin implements CanDisable, CanCo
114
114
  */
115
115
  get ripple(): MatRipple;
116
116
  set ripple(v: MatRipple);
117
- /** @docs-private Reference to the MatRipple instance of the button. */
118
- protected _ripple?: MatRipple;
117
+ /** Whether the ripple effect is disabled or not. */
118
+ get disableRipple(): boolean;
119
+ set disableRipple(value: any);
120
+ private _disableRipple;
121
+ get disabled(): boolean;
122
+ set disabled(value: any);
123
+ private _disabled;
119
124
  constructor(elementRef: ElementRef, _platform: Platform, _ngZone: NgZone, _animationMode?: string | undefined);
120
125
  ngAfterViewInit(): void;
121
- ngOnChanges(): void;
122
126
  ngOnDestroy(): void;
123
127
  /** Focuses the button. */
124
128
  focus(_origin?: FocusOrigin, options?: FocusOptions): void;
125
129
  /** Gets whether the button has one of the given attributes. */
126
130
  private _hasHostAttributes;
131
+ private _updateRippleDisabled;
127
132
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonBase, never>;
128
133
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonBase, never, never, {}, {}, never, never, false, never>;
129
134
  }
130
135
 
131
- /**
132
- * Handles attaching the MatButton's ripple on demand.
133
- *
134
- * This service allows us to avoid eagerly creating & attaching the MatButton's ripple.
135
- * It works by creating & attaching the ripple only when a MatButton is first interacted with.
136
- */
137
- declare class MatButtonLazyLoader implements OnDestroy {
138
- private _document;
139
- private _animationMode;
140
- private _globalRippleOptions;
141
- private _platform;
142
- private _ngZone;
143
- constructor();
144
- ngOnDestroy(): void;
145
- /** Handles creating and attaching button internals when a button is initially interacted with. */
146
- private _onInteraction;
147
- /** Creates a MatButtonRipple and appends it to the given button element. */
148
- private _appendRipple;
149
- _createMatRipple(button: HTMLElement): MatRipple | undefined;
150
- static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonLazyLoader, never>;
151
- static ɵprov: i0.ɵɵInjectableDeclaration<MatButtonLazyLoader>;
152
- }
153
-
154
136
  /** @docs-private */
155
137
  declare const _MatButtonMixin: _Constructor<CanColor> & _AbstractConstructor<CanColor> & _Constructor<CanDisable> & _AbstractConstructor<CanDisable> & _Constructor<CanDisableRipple> & _AbstractConstructor<CanDisableRipple> & {
156
138
  new (_elementRef: ElementRef): {
@@ -222,12 +204,6 @@ export declare class MatIconAnchor extends MatAnchorBase {
222
204
  * See https://material.io/develop/web/components/buttons/icon-buttons/
223
205
  */
224
206
  export declare class MatIconButton extends MatButtonBase {
225
- /**
226
- * Reference to the MatRipple instance of the button.
227
- * @deprecated Considered an implementation detail. To be removed.
228
- * @breaking-change 17.0.0
229
- */
230
- get ripple(): MatRipple;
231
207
  constructor(elementRef: ElementRef, platform: Platform, ngZone: NgZone, animationMode?: string);
232
208
  static ɵfac: i0.ɵɵFactoryDeclaration<MatIconButton, [null, null, null, { optional: true; }]>;
233
209
  static ɵcmp: i0.ɵɵComponentDeclaration<MatIconButton, "button[mat-icon-button]", ["matButton"], { "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], false, never>;
@@ -79,11 +79,8 @@
79
79
  }
80
80
 
81
81
  @mixin theme-from-tokens($tokens) {
82
- // Add values for card tokens.
83
- .mat-mdc-card {
84
- @include mdc-elevated-card-theme.theme(map.get($tokens, tokens-mdc-elevated-card.$prefix));
85
- @include mdc-outlined-card-theme.theme(map.get($tokens, tokens-mdc-outlined-card.$prefix));
86
- @include token-utils.create-token-values(
87
- tokens-mat-card.$prefix, map.get($tokens, tokens-mat-card.$prefix));
88
- }
82
+ @include mdc-elevated-card-theme.theme(map.get($tokens, tokens-mdc-elevated-card.$prefix));
83
+ @include mdc-outlined-card-theme.theme(map.get($tokens, tokens-mdc-outlined-card.$prefix));
84
+ @include token-utils.create-token-values(
85
+ tokens-mat-card.$prefix, map.get($tokens, tokens-mat-card.$prefix));
89
86
  }
@@ -92,8 +92,5 @@
92
92
  @mixin theme-from-tokens($tokens) {
93
93
  // TODO(mmalerba): Some of the theme styles above are not represented in terms of tokens,
94
94
  // so this mixin is currently incomplete.
95
-
96
- .mat-mdc-checkbox {
97
- @include mdc-checkbox-theme.theme(map.get($tokens, tokens-mdc-checkbox.$prefix));
98
- }
95
+ @include mdc-checkbox-theme.theme(map.get($tokens, tokens-mdc-checkbox.$prefix));
99
96
  }
package/core/index.d.ts CHANGED
@@ -797,6 +797,43 @@ export declare class MatRipple implements OnInit, OnDestroy, RippleTarget {
797
797
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatRipple, "[mat-ripple], [matRipple]", ["matRipple"], { "color": { "alias": "matRippleColor"; "required": false; }; "unbounded": { "alias": "matRippleUnbounded"; "required": false; }; "centered": { "alias": "matRippleCentered"; "required": false; }; "radius": { "alias": "matRippleRadius"; "required": false; }; "animation": { "alias": "matRippleAnimation"; "required": false; }; "disabled": { "alias": "matRippleDisabled"; "required": false; }; "trigger": { "alias": "matRippleTrigger"; "required": false; }; }, {}, never, never, false, never>;
798
798
  }
799
799
 
800
+ /**
801
+ * Handles attaching ripples on demand.
802
+ *
803
+ * This service allows us to avoid eagerly creating & attaching MatRipples.
804
+ * It works by creating & attaching a ripple only when a component is first interacted with.
805
+ */
806
+ export declare class MatRippleLoader implements OnDestroy {
807
+ private _document;
808
+ private _animationMode;
809
+ private _globalRippleOptions;
810
+ private _platform;
811
+ private _ngZone;
812
+ constructor();
813
+ ngOnDestroy(): void;
814
+ /**
815
+ * Configures the ripple that will be rendered by the ripple loader.
816
+ *
817
+ * Stores the given information about how the ripple should be configured on the host
818
+ * element so that it can later be retrived & used when the ripple is actually created.
819
+ */
820
+ configureRipple(host: HTMLElement, config: {
821
+ className?: string;
822
+ centered?: boolean;
823
+ }): void;
824
+ /** Returns the ripple instance for the given host element. */
825
+ getRipple(host: HTMLElement): MatRipple | undefined;
826
+ /** Sets the disabled state on the ripple instance corresponding to the given host element. */
827
+ setDisabled(host: HTMLElement, disabled: boolean): void;
828
+ /** Handles creating and attaching component internals when a component it is initially interacted with. */
829
+ private _onInteraction;
830
+ /** Creates a MatRipple and appends it to the given element. */
831
+ createRipple(host: HTMLElement): MatRipple | undefined;
832
+ attachRipple(host: Element, ripple: MatRipple): void;
833
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatRippleLoader, never>;
834
+ static ɵprov: i0.ɵɵInjectableDeclaration<MatRippleLoader>;
835
+ }
836
+
800
837
  export declare class MatRippleModule {
801
838
  static ɵfac: i0.ɵɵFactoryDeclaration<MatRippleModule, never>;
802
839
  static ɵmod: i0.ɵɵNgModuleDeclaration<MatRippleModule, [typeof i1_4.MatRipple], [typeof i1_2.MatCommonModule], [typeof i1_4.MatRipple, typeof i1_2.MatCommonModule]>;
@@ -14,6 +14,18 @@
14
14
  }
15
15
  }
16
16
 
17
+ /// A version of the standard `map.merge` function that takes a variable number of arguments.
18
+ /// Each argument is merged into the final result from left to right.
19
+ /// @param {List} $maps The maps to combine with map.merge
20
+ /// @return {Map} The combined result of successively calling map.merge with each parameter.
21
+ @function merge-all($maps...) {
22
+ $result: ();
23
+ @each $map in $maps {
24
+ $result: map.merge($result, $map);
25
+ }
26
+ @return $result;
27
+ }
28
+
17
29
  /// A version of the standard `map.deep-merge` function that takes a variable number of arguments.
18
30
  /// Each argument is deep-merged into the final result from left to right.
19
31
  /// @param {List} $maps The maps to combine with map.deep-merge
@@ -71,12 +71,21 @@ $_component-prefix: null;
71
71
 
72
72
  // Emits a slot for the given token, provided that it has a non-null value in the token map passed
73
73
  // to `use-tokens`.
74
- @mixin create-token-slot($property, $token) {
74
+ @mixin create-token-slot($property, $token, $emit-fallback: false) {
75
75
  @if $_component-prefix == null or $_tokens == null {
76
76
  @error '`create-token-slot` must be used within `use-tokens`';
77
77
  }
78
78
  @if map.get($_tokens, $token) != null {
79
- $value: mdc-custom-properties.create('#{$_component-prefix}-#{$token}');
79
+ $fallback: null;
80
+
81
+ @if ($emit-fallback == true) {
82
+ $fallback: map.get($_tokens, $token);
83
+ }
84
+ @else if ($emit-fallback) {
85
+ $fallback: $emit-fallback;
86
+ }
87
+
88
+ $value: mdc-custom-properties.create('#{$_component-prefix}-#{$token}', $fallback: $fallback);
80
89
  @include mdc-theme.property($property, $value);
81
90
  }
82
91
  }
@@ -0,0 +1,52 @@
1
+ @use '../../token-utils';
2
+ @use '../../../style/sass-utils';
3
+ @use '../../../typography/typography-utils';
4
+
5
+ // The prefix used to generate the fully qualified name for tokens in this file.
6
+ $prefix: (mat, slide-toggle);
7
+
8
+ // Tokens that can't be configured through Angular Material's current theming API,
9
+ // but may be in a future version of the theming API.
10
+ @function get-unthemable-tokens() {
11
+ @return ();
12
+ }
13
+
14
+ // Tokens that can be configured through Angular Material's color theming API.
15
+ @function get-color-tokens($config) {
16
+ @return ();
17
+ }
18
+
19
+ // Tokens that can be configured through Angular Material's typography theming API.
20
+ @function get-typography-tokens($config) {
21
+ // TODO(amysorto): The earlier implementation of the slide-toggle used MDC's APIs to create the
22
+ // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
23
+ // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
24
+ // fallback.
25
+ @if ($config == null) {
26
+ $config: mdc-helpers.private-fallback-typography-from-mdc();
27
+ }
28
+
29
+ @return (
30
+ label-text-font: typography-utils.font-family($config),
31
+ label-text-size: typography-utils.font-size($config, body-2),
32
+ label-text-letter-spacing: typography-utils.letter-spacing($config, body-2),
33
+ label-text-line-height: typography-utils.line-height($config, body-2),
34
+ label-text-weight: typography-utils.font-weight($config, body-2),
35
+ );
36
+ }
37
+
38
+ // Tokens that can be configured through Angular Material's density theming API.
39
+ @function get-density-tokens($config) {
40
+ @return ();
41
+ }
42
+
43
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
44
+ // This is used to create token slots.
45
+ @function get-token-slots() {
46
+ @return sass-utils.deep-merge-all(
47
+ get-unthemable-tokens(),
48
+ get-color-tokens(token-utils.$placeholder-color-config),
49
+ get-typography-tokens(token-utils.$placeholder-typography-config),
50
+ get-density-tokens(token-utils.$placeholder-density-config)
51
+ );
52
+ }
@@ -0,0 +1,97 @@
1
+ @use 'sass:map';
2
+ @use '../../../theming/theming';
3
+ @use '../../../typography/typography-utils';
4
+ @use '../../token-utils';
5
+ @use '../../../style/sass-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, table);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ @function get-unthemable-tokens() {
13
+ @return (
14
+ row-item-outline-width: 1px,
15
+ );
16
+ }
17
+
18
+ // Tokens that can be configured through Angular Material's color theming API.
19
+ @function get-color-tokens($config) {
20
+ $foreground: map.get($config, foreground);
21
+ $background: map.get($config, background);
22
+
23
+ @return (
24
+ background-color: theming.get-color-from-palette($background, 'card'),
25
+
26
+ header-headline-color: theming.get-color-from-palette($foreground, text),
27
+ row-item-label-text-color: theming.get-color-from-palette($foreground, text),
28
+ row-item-outline-color: theming.get-color-from-palette($foreground, divider),
29
+ );
30
+ }
31
+
32
+ // Tokens that can be configured through Angular Material's typography theming API.
33
+ @function get-typography-tokens($config) {
34
+ $fallback-font: typography-utils.font-family($config);
35
+ $cell-font-family: typography-utils.font-family($config, body-2) or $fallback-font;
36
+ $cell-line-height: typography-utils.line-height($config, body-2);
37
+ $cell-font-size: typography-utils.font-size($config, body-2);
38
+ $cell-font-weight: typography-utils.font-weight($config, body-2);
39
+ $cell-letter-spacing: typography-utils.letter-spacing($config, body-2);
40
+
41
+ @return (
42
+ header-headline-font: typography-utils.font-family($config, subtitle-2) or $fallback-font,
43
+ header-headline-line-height: typography-utils.line-height($config, subtitle-2),
44
+ header-headline-size: typography-utils.font-size($config, subtitle-2),
45
+ header-headline-weight: typography-utils.font-weight($config, subtitle-2),
46
+ header-headline-tracking: typography-utils.letter-spacing($config, subtitle-2),
47
+
48
+ // Plain cells and footer cells have the same typography.
49
+ row-item-label-text-font: $cell-font-family,
50
+ row-item-label-text-line-height: $cell-line-height,
51
+ row-item-label-text-size: $cell-font-size,
52
+ row-item-label-text-weight: $cell-font-weight,
53
+ row-item-label-text-tracking: $cell-letter-spacing,
54
+
55
+ footer-supporting-text-font: $cell-font-family,
56
+ footer-supporting-text-line-height: $cell-line-height,
57
+ footer-supporting-text-size: $cell-font-size,
58
+ footer-supporting-text-weight: $cell-font-weight,
59
+ footer-supporting-text-tracking: $cell-letter-spacing,
60
+ );
61
+ }
62
+
63
+ // Tokens that can be configured through Angular Material's density theming API.
64
+ @function get-density-tokens($config) {
65
+ $scale: theming.clamp-density($config, -4);
66
+ $header-scale: (
67
+ 0: 56px,
68
+ -1: 52px,
69
+ -2: 48px,
70
+ -3: 44px,
71
+ -4: 40px
72
+ );
73
+ $cell-scale: (
74
+ 0: 52px,
75
+ -1: 48px,
76
+ -2: 44px,
77
+ -3: 40px,
78
+ -4: 36px
79
+ );
80
+
81
+ @return (
82
+ header-container-height: map.get($header-scale, $scale),
83
+ footer-container-height: map.get($cell-scale, $scale),
84
+ row-item-container-height: map.get($cell-scale, $scale),
85
+ );
86
+ }
87
+
88
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
89
+ // This is used to create token slots.
90
+ @function get-token-slots() {
91
+ @return sass-utils.deep-merge-all(
92
+ get-unthemable-tokens(),
93
+ get-color-tokens(token-utils.$placeholder-color-config),
94
+ get-typography-tokens(token-utils.$placeholder-typography-config),
95
+ get-density-tokens(token-utils.$placeholder-density-config)
96
+ );
97
+ }
@@ -0,0 +1,182 @@
1
+ @use 'sass:map';
2
+ @use '../../../style/elevation';
3
+ @use '../../../style/sass-utils';
4
+ @use '../../../theming/theming';
5
+ @use '../../token-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mdc, switch);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ //
13
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
14
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
15
+ // our CSS.
16
+
17
+ @function get-unthemable-tokens() {
18
+ @return (
19
+ // Opacity of handle when disabled.
20
+ disabled-handle-opacity: 0.38,
21
+ // Opacity of icon when disabled and selected.
22
+ disabled-selected-icon-opacity: 0.38,
23
+ // Opacity of track when disabled.
24
+ disabled-track-opacity: 0.12,
25
+ // Opacity of icon when disabled and unselected.
26
+ disabled-unselected-icon-opacity: 0.38,
27
+ // Height of handle.
28
+ handle-height: 20px,
29
+ // Border radius of handle.
30
+ handle-shape: 10px,
31
+ // Width of handle.
32
+ handle-width: 20px,
33
+ // Width and height of icon when selected.
34
+ selected-icon-size: 18px,
35
+ // Height of track.
36
+ track-height: 14px,
37
+ // Border radius of track.
38
+ track-shape: 7px,
39
+ // Width of track.
40
+ track-width: 36px,
41
+ // Width and height of icon when unselected.
42
+ unselected-icon-size: 18px,
43
+ // The diameter of the handle ripple.
44
+ state-layer-size: 40px,
45
+ // Opacity of ripple when selected and focused.
46
+ selected-focus-state-layer-opacity: 0.12,
47
+ // Opacity of ripple when selected and on hover.
48
+ selected-hover-state-layer-opacity: 0.04,
49
+ // Opacity of ripple when selected and pressed.
50
+ selected-pressed-state-layer-opacity: 0.1,
51
+ // Opacity of ripple when unselected and focused.
52
+ unselected-focus-state-layer-opacity: 0.12,
53
+ // Opacity of ripple when unselected and on hover.
54
+ unselected-hover-state-layer-opacity: 0.04,
55
+ // Opacity of ripple when unselected and pressed.
56
+ unselected-pressed-state-layer-opacity: 0.1,
57
+ );
58
+ }
59
+
60
+ // Tokens that can be configured through Angular Material's color theming API.
61
+ @function get-color-tokens($config) {
62
+ $foreground: map.get($config, foreground);
63
+ $elevation: theming.get-color-from-palette($foreground, elevation);
64
+ $is-dark: map.get($config, is-dark);
65
+ $on-surface: if($is-dark, #f5f5f5, #424242);
66
+ $hairline: if($is-dark, #616161, #e0e0e0);
67
+ $on-surface-variant: if($is-dark, #9e9e9e, #616161);
68
+ $on-surface-state-content: if($is-dark, #fafafa, #212121);
69
+ $disabled-handle-color: if($is-dark, #000, #424242);
70
+ $icon-color: if($is-dark, #212121, #fff);
71
+
72
+ // The default for tokens that rely on the theme will use the primary palette
73
+ $theme-color-tokens: private-get-color-palette-color-tokens(
74
+ map.get($config, primary),
75
+ $is-dark
76
+ );
77
+
78
+ @return map.merge(
79
+ $theme-color-tokens,
80
+ (
81
+ // Color of handle when selected while disabled.
82
+ disabled-selected-handle-color: $disabled-handle-color,
83
+ // Color of handle when selected while disabled.
84
+ disabled-selected-icon-color: $icon-color,
85
+ // Color of track when selected while disabled.
86
+ disabled-selected-track-color: $on-surface,
87
+ // Color of handle when unselected while disabled.
88
+ disabled-unselected-handle-color: $disabled-handle-color,
89
+ // Color of icon when unselected while disabled.
90
+ disabled-unselected-icon-color: $icon-color,
91
+ // Color of track when disabled.
92
+ disabled-unselected-track-color: $on-surface,
93
+ // Color of slide-toggle handle's surface.
94
+ handle-surface-color: surface,
95
+ // Elevation level for handle.
96
+ handle-elevation: 1,
97
+ // Color of handle's shadow
98
+ handle-shadow-color: if($elevation != null, $elevation, elevation.$color),
99
+ // Elevation level for handle when disabled.
100
+ disabled-handle-elevation: 0,
101
+ // Color of icon (ex. checkmark) when selected
102
+ selected-icon-color: $icon-color,
103
+ // Color of handle when unselected and focused.
104
+ unselected-focus-handle-color: $on-surface-state-content,
105
+ // Color of ripple when unselected and focused.
106
+ unselected-focus-state-layer-color: $on-surface,
107
+ // Color of track when unselected and focused.
108
+ unselected-focus-track-color: $hairline,
109
+ // Color of handle when unselected.
110
+ unselected-handle-color: $on-surface-variant,
111
+ // Color of handle when unselected and on hover.
112
+ unselected-hover-handle-color: $on-surface-state-content,
113
+ // Color of ripple when unselected and on hover.
114
+ unselected-hover-state-layer-color: $on-surface,
115
+ // Color of track when unselected and on hover.
116
+ unselected-hover-track-color: $hairline,
117
+ // Color of icon color when unselected.
118
+ unselected-icon-color: $icon-color,
119
+ // Color of handle when unselected and pressed.
120
+ unselected-pressed-handle-color: $on-surface-state-content,
121
+ // Color of ripple when unselected and pressed.
122
+ unselected-pressed-state-layer-color: $on-surface,
123
+ // Color of track when unselected and pressed.
124
+ unselected-pressed-track-color: $hairline,
125
+ // Color of track when selected.
126
+ unselected-track-color: $hairline,
127
+ )
128
+ );
129
+ }
130
+
131
+ // Generates the mapping for the properties that change based on the slide toggle color.
132
+ @function private-get-color-palette-color-tokens($color-palette, $is-dark) {
133
+ $primary: theming.get-color-from-palette($color-palette, if($is-dark, 300, 600));
134
+ $state-content: theming.get-color-from-palette($color-palette, if($is-dark, 200, 900));
135
+ $inverse: theming.get-color-from-palette($color-palette, if($is-dark, 600, 300));
136
+
137
+ @return (
138
+ // Color of ripple when selected and focused.
139
+ selected-focus-state-layer-color: $primary,
140
+ // Color of handle when selected
141
+ selected-handle-color: $primary,
142
+ // Color of ripple when selected and on hover.
143
+ selected-hover-state-layer-color: $primary,
144
+ // Color of ripple when selected and pressed.
145
+ selected-pressed-state-layer-color: $primary,
146
+ // Color of handle when selected and focused.
147
+ selected-focus-handle-color: $state-content,
148
+ // Color of handle when selected and on hover.
149
+ selected-hover-handle-color: $state-content,
150
+ // Color of handle when selected and pressed.
151
+ selected-pressed-handle-color: $state-content,
152
+ // Color of track when selected and focused.
153
+ selected-focus-track-color: $inverse,
154
+ // Color of track when selected and on hover.
155
+ selected-hover-track-color: $inverse,
156
+ /// Color of track when selected and pressed.
157
+ selected-pressed-track-color: $inverse,
158
+ // Color of track when selected.
159
+ selected-track-color: $inverse,
160
+ );
161
+ }
162
+
163
+ // Tokens that can be configured through Angular Material's typography theming API.
164
+ @function get-typography-tokens($config) {
165
+ @return ();
166
+ }
167
+
168
+ // Tokens that can be configured through Angular Material's density theming API.
169
+ @function get-density-tokens($config) {
170
+ @return ();
171
+ }
172
+
173
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
174
+ // This is used to create token slots.
175
+ @function get-token-slots() {
176
+ @return sass-utils.deep-merge-all(
177
+ get-unthemable-tokens(),
178
+ get-color-tokens(token-utils.$placeholder-color-config),
179
+ get-typography-tokens(token-utils.$placeholder-typography-config),
180
+ get-density-tokens(token-utils.$placeholder-density-config)
181
+ );
182
+ }