@momentum-design/components 0.57.0 → 0.58.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/dist/browser/index.js +304 -283
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/button/button.component.d.ts +3 -56
  4. package/dist/components/button/button.component.js +3 -96
  5. package/dist/components/buttonlink/buttonlink.component.d.ts +59 -0
  6. package/dist/components/buttonlink/buttonlink.component.js +106 -0
  7. package/dist/components/buttonlink/buttonlink.constants.d.ts +2 -0
  8. package/dist/components/buttonlink/buttonlink.constants.js +3 -0
  9. package/dist/components/buttonlink/buttonlink.types.d.ts +7 -0
  10. package/dist/components/buttonlink/buttonlink.types.js +1 -0
  11. package/dist/components/buttonlink/index.d.ts +8 -0
  12. package/dist/components/buttonlink/index.js +5 -0
  13. package/dist/components/statictoggle/index.d.ts +8 -0
  14. package/dist/components/statictoggle/index.js +5 -0
  15. package/dist/components/statictoggle/statictoggle.component.d.ts +48 -0
  16. package/dist/components/statictoggle/statictoggle.component.js +82 -0
  17. package/dist/components/statictoggle/statictoggle.constants.d.ts +17 -0
  18. package/dist/components/statictoggle/statictoggle.constants.js +18 -0
  19. package/dist/components/statictoggle/statictoggle.styles.d.ts +2 -0
  20. package/dist/components/statictoggle/statictoggle.styles.js +82 -0
  21. package/dist/components/statictoggle/statictoggle.types.d.ts +4 -0
  22. package/dist/components/statictoggle/statictoggle.types.js +1 -0
  23. package/dist/components/toggle/index.d.ts +2 -1
  24. package/dist/components/toggle/index.js +2 -1
  25. package/dist/components/toggle/toggle.component.d.ts +16 -20
  26. package/dist/components/toggle/toggle.component.js +27 -33
  27. package/dist/components/toggle/toggle.styles.js +26 -96
  28. package/dist/custom-elements.json +1806 -828
  29. package/dist/index.d.ts +3 -1
  30. package/dist/index.js +3 -1
  31. package/dist/react/buttonlink/index.d.ts +30 -0
  32. package/dist/react/buttonlink/index.js +38 -0
  33. package/dist/react/index.d.ts +3 -1
  34. package/dist/react/index.js +3 -1
  35. package/dist/react/statictoggle/index.d.ts +30 -0
  36. package/dist/react/statictoggle/index.js +39 -0
  37. package/dist/react/toggle/index.d.ts +14 -18
  38. package/dist/react/toggle/index.js +14 -18
  39. package/dist/utils/mixins/ButtonComponentMixin.d.ts +16 -0
  40. package/dist/utils/mixins/ButtonComponentMixin.js +114 -0
  41. package/package.json +1 -1
@@ -0,0 +1,82 @@
1
+ import { css } from 'lit';
2
+ const styles = [css `
3
+ :host {
4
+ --mdc-statictoggle-width: 3rem;
5
+ --mdc-statictoggle-height: 1.5rem;
6
+ --mdc-statictoggle-width-compact: 2rem;
7
+ --mdc-statictoggle-height-compact: 1rem;
8
+ --mdc-statictoggle-border-radius: 0.75rem;
9
+ --mdc-statictoggle-border-radius-compact: 0.5rem;
10
+ --mdc-statictoggle-border: 1px solid var(--mds-color-theme-outline-input-normal);
11
+
12
+ --mdc-statictoggle-inactive-rest-color: var(--mds-color-theme-control-inactive-normal);
13
+ --mdc-statictoggle-inactive-disabled-color: var(--mds-color-theme-control-inactive-disabled);
14
+ --mdc-statictoggle-active-rest-color: var(--mds-color-theme-control-active-normal);
15
+ --mdc-statictoggle-active-disabled-color: var(--mds-color-theme-control-active-disabled);
16
+
17
+ --mdc-statictoggle-icon-color-normal: var(--mds-color-theme-common-inverted-text-primary-normal);
18
+ --mdc-statictoggle-icon-color-disabled: var(--mds-color-theme-common-inverted-text-primary-disabled);
19
+ --mdc-statictoggle-icon-background-color-normal: var(--mds-color-theme-common-text-primary-normal);
20
+ --mdc-statictoggle-icon-background-color-disabled: var(--mds-color-theme-common-text-primary-disabled);
21
+
22
+ border-radius: var(--mdc-statictoggle-border-radius);
23
+ }
24
+
25
+ :host::part(slider) {
26
+ width: var(--mdc-statictoggle-width);
27
+ height: var(--mdc-statictoggle-height);
28
+ background: var(--mdc-statictoggle-inactive-rest-color);
29
+ border-radius: var(--mdc-statictoggle-border-radius);
30
+ border: var(--mdc-statictoggle-border);
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: flex-start;
34
+ transition: background-color 0.3s ease;
35
+ outline: none;
36
+ padding: 1px;
37
+ }
38
+
39
+ :host([checked])::part(slider) {
40
+ background-color: var(--mdc-statictoggle-active-rest-color);
41
+ justify-content: flex-end;
42
+ border-color: transparent;
43
+ }
44
+
45
+ :host([size='compact'])::part(slider) {
46
+ width: var(--mdc-statictoggle-width-compact);
47
+ height: var(--mdc-statictoggle-height-compact);
48
+ border-radius: var(--mdc-statictoggle-border-radius-compact);
49
+ }
50
+
51
+ .icon {
52
+ padding: 0.25rem;
53
+ --mdc-icon-fill-color: var(--mdc-statictoggle-icon-color-normal);
54
+ background-color: var(--mdc-statictoggle-icon-background-color-normal);
55
+ border-radius: 50%;
56
+ }
57
+
58
+ :host([disabled]) .icon {
59
+ --mdc-icon-fill-color: var(--mdc-statictoggle-icon-color-disabled);
60
+ background-color: var(--mdc-statictoggle-icon-background-color-disabled);
61
+ }
62
+
63
+ :host([size='compact']) .icon {
64
+ padding: 0.125rem;
65
+ }
66
+
67
+ :host([disabled])::part(slider) {
68
+ background-color: var(--mdc-statictoggle-inactive-disabled-color);
69
+ }
70
+
71
+ :host([disabled][checked])::part(slider) {
72
+ background-color: var(--mdc-statictoggle-active-disabled-color);
73
+ }
74
+
75
+ /* High Contrast Mode */
76
+ @media (forced-colors: active) {
77
+ :host([checked])::part(slider), .icon {
78
+ border: var(--mdc-statictoggle-border);
79
+ }
80
+ }
81
+ `];
82
+ export default styles;
@@ -0,0 +1,4 @@
1
+ import type { ValueOf } from '../../utils/types';
2
+ import { TOGGLE_SIZE } from './statictoggle.constants';
3
+ type ToggleSize = ValueOf<typeof TOGGLE_SIZE>;
4
+ export type { ToggleSize };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
- import Toggle from './toggle.component';
2
1
  import '../icon';
2
+ import '../statictoggle';
3
+ import Toggle from './toggle.component';
3
4
  declare global {
4
5
  interface HTMLElementTagNameMap {
5
6
  ['mdc-toggle']: Toggle;
@@ -1,5 +1,6 @@
1
+ import '../icon';
2
+ import '../statictoggle';
1
3
  import Toggle from './toggle.component';
2
4
  import { TAG_NAME } from './toggle.constants';
3
- import '../icon';
4
5
  Toggle.register(TAG_NAME);
5
6
  export default Toggle;
@@ -1,7 +1,7 @@
1
1
  import { CSSResult, PropertyValueMap } from 'lit';
2
- import FormfieldWrapper from '../formfieldwrapper';
3
- import { ToggleSize } from './toggle.types';
4
2
  import { AssociatedFormControl } from '../../utils/mixins/FormInternalsMixin';
3
+ import FormfieldWrapper from '../formfieldwrapper';
4
+ import type { ToggleSize } from './toggle.types';
5
5
  declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/FormInternalsMixin").FormInternalsMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelMixin").DataAriaLabelMixinInterface> & typeof FormfieldWrapper;
6
6
  /**
7
7
  * Toggle Component is an interactive control used to switch between two mutually exclusive options,
@@ -14,30 +14,26 @@ declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<
14
14
  * Note: It internally renders a checkbox styled as a toggle switch.
15
15
  *
16
16
  * @dependency mdc-icon
17
+ * @dependency mdc-statictoggle
17
18
  *
18
19
  * @tagname mdc-toggle
19
20
  *
20
21
  * @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
21
22
  * @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
22
23
  *
23
- * @cssproperty --mdc-toggle-width - width of the toggle
24
- * @cssproperty --mdc-toggle-height - height of the toggle
25
- * @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
26
- * @cssproperty --mdc-toggle-height-compact - height of the toggle when it's size is compact
27
- * @cssproperty --mdc-toggle-border-radius - border radius of the toggle
28
- * @cssproperty --mdc-toggle-border-radius-compact - border radius of the toggle when it's size is compact
29
- * @cssproperty --mdc-toggle-border - border of the toggle
30
- * @cssproperty --mdc-toggle-inactive-rest-color - background color of the inactive toggle in rest state
31
- * @cssproperty --mdc-toggle-inactive-hover-color - background color of the inactive toggle in hover state
32
- * @cssproperty --mdc-toggle-inactive-pressed-color - background color of the inactive toggle in pressed state
33
- * @cssproperty --mdc-toggle-inactive-disabled-color - background color of the inactive toggle in disabled state
34
- * @cssproperty --mdc-toggle-active-rest-color - background color of the active toggle in rest state
35
- * @cssproperty --mdc-toggle-active-hover-color - background color of the active toggle in hover state
36
- * @cssproperty --mdc-toggle-active-pressed-color - background color of the active toggle in pressed state
37
- * @cssproperty --mdc-toggle-active-disabled-color - background color of the active toggle in disabled state
38
- * @cssproperty --mdc-toggle-help-text-color - color of the help text label
39
- * @cssproperty --mdc-toggle-label-color-disabled - color of the toggle label and help text in disabled state
40
- *
24
+ * @cssproperty --mdc-toggle-width - Width of the toggle
25
+ * @cssproperty --mdc-toggle-height - Height of the toggle
26
+ * @cssproperty --mdc-toggle-width-compact - Width of the toggle when it's size is compact
27
+ * @cssproperty --mdc-toggle-height-compact - Height of the toggle when it's size is compact
28
+ * @cssproperty --mdc-toggle-label-lineheight - Line height of the toggle label
29
+ * @cssproperty --mdc-toggle-label-fontsize - Font size of the toggle label
30
+ * @cssproperty --mdc-toggle-label-fontweight - Font weight of the toggle label
31
+ * @cssproperty --mdc-toggle-label-color-disabled - Color of the toggle label and help text in disabled state
32
+ * @cssproperty --mdc-toggle-help-text-color - Color of the help text label
33
+ * @cssproperty --mdc-toggle-active-hover-color - Background color of the active toggle in hover state
34
+ * @cssproperty --mdc-toggle-active-pressed-color - Background color of the active toggle in pressed state
35
+ * @cssproperty --mdc-toggle-inactive-hover-color - Background color of the inactive toggle in hover state
36
+ * @cssproperty --mdc-toggle-inactive-pressed-color - Background color of the inactive toggle in pressed state
41
37
  */
42
38
  declare class Toggle extends Toggle_base implements AssociatedFormControl {
43
39
  /**
@@ -10,12 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
- import styles from './toggle.styles';
14
- import FormfieldWrapper from '../formfieldwrapper';
15
- import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
16
- import { DEFAULTS, ICON_NAME, ICON_SIZE_IN_REM, TOGGLE_SIZE } from './toggle.constants';
17
13
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
18
14
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
15
+ import FormfieldWrapper from '../formfieldwrapper';
16
+ import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
17
+ import { DEFAULTS, TOGGLE_SIZE } from './toggle.constants';
18
+ import styles from './toggle.styles';
19
19
  /**
20
20
  * Toggle Component is an interactive control used to switch between two mutually exclusive options,
21
21
  * such as On/Off, Active/Inactive. These are commonly used in settings panels, forms, and preference selections
@@ -27,30 +27,26 @@ import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
27
27
  * Note: It internally renders a checkbox styled as a toggle switch.
28
28
  *
29
29
  * @dependency mdc-icon
30
+ * @dependency mdc-statictoggle
30
31
  *
31
32
  * @tagname mdc-toggle
32
33
  *
33
34
  * @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
34
35
  * @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
35
36
  *
36
- * @cssproperty --mdc-toggle-width - width of the toggle
37
- * @cssproperty --mdc-toggle-height - height of the toggle
38
- * @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
39
- * @cssproperty --mdc-toggle-height-compact - height of the toggle when it's size is compact
40
- * @cssproperty --mdc-toggle-border-radius - border radius of the toggle
41
- * @cssproperty --mdc-toggle-border-radius-compact - border radius of the toggle when it's size is compact
42
- * @cssproperty --mdc-toggle-border - border of the toggle
43
- * @cssproperty --mdc-toggle-inactive-rest-color - background color of the inactive toggle in rest state
44
- * @cssproperty --mdc-toggle-inactive-hover-color - background color of the inactive toggle in hover state
45
- * @cssproperty --mdc-toggle-inactive-pressed-color - background color of the inactive toggle in pressed state
46
- * @cssproperty --mdc-toggle-inactive-disabled-color - background color of the inactive toggle in disabled state
47
- * @cssproperty --mdc-toggle-active-rest-color - background color of the active toggle in rest state
48
- * @cssproperty --mdc-toggle-active-hover-color - background color of the active toggle in hover state
49
- * @cssproperty --mdc-toggle-active-pressed-color - background color of the active toggle in pressed state
50
- * @cssproperty --mdc-toggle-active-disabled-color - background color of the active toggle in disabled state
51
- * @cssproperty --mdc-toggle-help-text-color - color of the help text label
52
- * @cssproperty --mdc-toggle-label-color-disabled - color of the toggle label and help text in disabled state
53
- *
37
+ * @cssproperty --mdc-toggle-width - Width of the toggle
38
+ * @cssproperty --mdc-toggle-height - Height of the toggle
39
+ * @cssproperty --mdc-toggle-width-compact - Width of the toggle when it's size is compact
40
+ * @cssproperty --mdc-toggle-height-compact - Height of the toggle when it's size is compact
41
+ * @cssproperty --mdc-toggle-label-lineheight - Line height of the toggle label
42
+ * @cssproperty --mdc-toggle-label-fontsize - Font size of the toggle label
43
+ * @cssproperty --mdc-toggle-label-fontweight - Font weight of the toggle label
44
+ * @cssproperty --mdc-toggle-label-color-disabled - Color of the toggle label and help text in disabled state
45
+ * @cssproperty --mdc-toggle-help-text-color - Color of the help text label
46
+ * @cssproperty --mdc-toggle-active-hover-color - Background color of the active toggle in hover state
47
+ * @cssproperty --mdc-toggle-active-pressed-color - Background color of the active toggle in pressed state
48
+ * @cssproperty --mdc-toggle-inactive-hover-color - Background color of the inactive toggle in hover state
49
+ * @cssproperty --mdc-toggle-inactive-pressed-color - Background color of the inactive toggle in pressed state
54
50
  */
55
51
  class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
56
52
  constructor() {
@@ -177,11 +173,17 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
177
173
  render() {
178
174
  var _a;
179
175
  return html `
180
- <div class="mdc-toggle__container mdc-focus-ring">
176
+ <mdc-statictoggle
177
+ ?checked="${this.checked}"
178
+ ?disabled="${this.disabled}"
179
+ size="${this.size}"
180
+ class="mdc-focus-ring"
181
+ part="container"
182
+ >
181
183
  <input
182
184
  id="${this.id}"
183
185
  type="checkbox"
184
- class="mdc-toggle__input"
186
+ part="toggle-input"
185
187
  role="switch"
186
188
  ?autofocus="${this.autofocus}"
187
189
  ?required="${!!this.requiredLabel}"
@@ -196,15 +198,7 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
196
198
  @change="${this.handleChange}"
197
199
  @keydown="${this.handleKeyDown}"
198
200
  />
199
- <div class="mdc-toggle__slider">
200
- <mdc-icon
201
- name="${this.checked ? ICON_NAME.CHECKED : ICON_NAME.UNCHECKED}"
202
- class="mdc-toggle__icon"
203
- length-unit="rem"
204
- size="${ICON_SIZE_IN_REM[this.size]}"
205
- ></mdc-icon>
206
- </div>
207
- </div>
201
+ </mdc-statictoggle>
208
202
  ${this.renderLabel()}
209
203
  ${this.renderHelperText()}
210
204
  `;
@@ -6,18 +6,6 @@ const styles = [hostFitContentStyles, css `
6
6
  --mdc-toggle-height: 1.5rem;
7
7
  --mdc-toggle-width-compact: 2rem;
8
8
  --mdc-toggle-height-compact: 1rem;
9
- --mdc-toggle-border-radius: 0.75rem;
10
- --mdc-toggle-border-radius-compact: 0.5rem;
11
- --mdc-toggle-border: 0.0625rem solid var(--mds-color-theme-outline-input-normal);
12
-
13
- --mdc-toggle-inactive-rest-color: var(--mds-color-theme-control-inactive-normal);
14
- --mdc-toggle-inactive-hover-color: var(--mds-color-theme-control-inactive-hover);
15
- --mdc-toggle-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
16
- --mdc-toggle-inactive-disabled-color: var(--mds-color-theme-control-inactive-disabled);
17
- --mdc-toggle-active-rest-color: var(--mds-color-theme-control-active-normal);
18
- --mdc-toggle-active-hover-color: var(--mds-color-theme-control-active-hover);
19
- --mdc-toggle-active-pressed-color: var(--mds-color-theme-control-active-pressed);
20
- --mdc-toggle-active-disabled-color: var(--mds-color-theme-control-active-disabled);
21
9
 
22
10
  --mdc-toggle-label-lineheight: var(--mds-font-lineheight-body-midsize);
23
11
  --mdc-toggle-label-fontsize: var(--mds-font-size-body-midsize);
@@ -25,10 +13,10 @@ const styles = [hostFitContentStyles, css `
25
13
  --mdc-toggle-label-color-disabled: var(--mds-color-theme-text-primary-disabled);
26
14
  --mdc-toggle-help-text-color: var(--mds-color-theme-text-secondary-normal);
27
15
 
28
- --mdc-toggle-icon-color-normal: var(--mds-color-theme-common-inverted-text-primary-normal);
29
- --mdc-toggle-icon-color-disabled: var(--mds-color-theme-common-inverted-text-primary-disabled);
30
- --mdc-toggle-icon-background-color-normal: var(--mds-color-theme-common-text-primary-normal);
31
- --mdc-toggle-icon-background-color-disabled: var(--mds-color-theme-common-text-primary-disabled);
16
+ --mdc-toggle-active-hover-color: var(--mds-color-theme-control-active-hover);
17
+ --mdc-toggle-active-pressed-color: var(--mds-color-theme-control-active-pressed);
18
+ --mdc-toggle-inactive-hover-color: var(--mds-color-theme-control-inactive-hover);
19
+ --mdc-toggle-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
32
20
  }
33
21
 
34
22
  :host([label]), :host([help-text]){
@@ -44,113 +32,55 @@ const styles = [hostFitContentStyles, css `
44
32
  row-gap: 0rem;
45
33
  }
46
34
 
47
- .mdc-toggle__container {
48
- position: relative;
49
- border-radius: var(--mdc-toggle-border-radius);
50
- }
51
-
52
- .mdc-toggle__input {
53
- opacity: 0;
54
- position: absolute;
55
- cursor: pointer;
35
+ :host::part(toggle-input) {
56
36
  margin: 0;
37
+ padding: 0;
38
+ position: absolute;
39
+ opacity: 0.1%;
40
+ overflow: visible;
41
+ z-index: 1;
57
42
  width: var(--mdc-toggle-width);
58
43
  height: var(--mdc-toggle-height);
59
44
  }
60
45
 
61
- .mdc-toggle__slider {
62
- width: var(--mdc-toggle-width);
63
- height: var(--mdc-toggle-height);
64
- background: var(--mdc-toggle-inactive-rest-color);
65
- border-radius: var(--mdc-toggle-border-radius);
66
- border: var(--mdc-toggle-border);
67
- display: flex;
68
- align-items: center;
69
- justify-content: flex-start;
70
- transition: background-color 0.3s ease;
71
- outline: none;
72
- padding: 0.0625rem;
73
- }
74
-
75
- :host([checked]) .mdc-toggle__slider {
76
- background-color: var(--mdc-toggle-active-rest-color);
77
- justify-content: flex-end;
78
- border-color: transparent;
79
- }
80
-
81
- :host([size='compact']) .mdc-toggle__slider {
82
- width: var(--mdc-toggle-width-compact);
83
- height: var(--mdc-toggle-height-compact);
84
- border-radius: var(--mdc-toggle-border-radius-compact);
85
- }
86
- :host([size='compact']) .mdc-toggle__input {
87
- width: var(--mdc-toggle-width-compact);
88
- height: var(--mdc-toggle-height-compact);
46
+ .mdc-label-text, .mdc-help-text {
47
+ font-size: var(--mdc-toggle-label-fontsize);
48
+ font-weight: var(--mdc-toggle-label-fontweight);
49
+ line-height: var(--mdc-toggle-label-lineheight);
50
+ grid-column: 2;
89
51
  }
90
52
 
91
- .mdc-toggle__icon {
92
- padding: 0.25rem;
93
- --mdc-icon-fill-color: var(--mdc-toggle-icon-color-normal);
94
- background-color: var(--mdc-toggle-icon-background-color-normal);
95
- border-radius: 50%;
53
+ .mdc-label, :host::part(toggle-input) {
54
+ cursor: pointer;
96
55
  }
97
56
 
98
- :host([disabled]) .mdc-toggle__icon {
99
- --mdc-icon-fill-color: var(--mdc-toggle-icon-color-disabled);
57
+ :host([disabled]) .mdc-label,
58
+ :host([disabled])::part(toggle-input) {
59
+ cursor: default;
100
60
  }
101
61
 
102
- :host([size='compact']) .mdc-toggle__icon {
103
- padding: 0.125rem;
62
+ .mdc-help-text {
63
+ color: var(--mdc-toggle-help-text-color);
104
64
  }
105
65
 
106
- :host(:not([disabled])) .mdc-toggle__container:hover .mdc-toggle__slider {
66
+ :host(:hover:not([disabled]))::part(container) {
107
67
  background-color: var(--mdc-toggle-inactive-hover-color);
108
68
  }
109
69
 
110
- :host(:not([disabled])) .mdc-toggle__container:active .mdc-toggle__slider {
70
+ :host(:active:not([disabled]))::part(container) {
111
71
  background-color: var(--mdc-toggle-inactive-pressed-color);
112
72
  }
113
73
 
114
- :host(:not([disabled])[checked]) .mdc-toggle__container:hover .mdc-toggle__slider {
74
+ :host(:hover:not([disabled])[checked])::part(container) {
115
75
  background-color: var(--mdc-toggle-active-hover-color);
116
76
  }
117
77
 
118
- :host(:not([disabled])[checked]) .mdc-toggle__container:active .mdc-toggle__slider {
78
+ :host(:active:not([disabled])[checked])::part(container) {
119
79
  background-color: var(--mdc-toggle-active-pressed-color);
120
80
  }
121
81
 
122
- :host([disabled]) .mdc-toggle__slider {
123
- background-color: var(--mdc-toggle-inactive-disabled-color);
124
- }
125
-
126
- :host([disabled][checked]) .mdc-toggle__slider {
127
- background-color: var(--mdc-toggle-active-disabled-color);
128
- }
129
-
130
- :host([disabled]) .mdc-toggle__icon {
131
- background-color: var(--mdc-toggle-icon-background-color-disabled);
132
- }
133
-
134
- .mdc-label-text, .mdc-help-text {
135
- font-size: var(--mdc-toggle-label-fontsize);
136
- font-weight: var(--mdc-toggle-label-fontweight);
137
- line-height: var(--mdc-toggle-label-lineheight);
138
- grid-column: 2;
139
- }
140
-
141
- .mdc-help-text {
142
- color: var(--mdc-toggle-help-text-color);
143
- }
144
-
145
82
  :host([disabled]) .mdc-label-text, :host([disabled]) .mdc-help-text {
146
83
  color: var(--mdc-toggle-label-color-disabled);
147
84
  }
148
-
149
- /* High Contrast Mode */
150
- @media (forced-colors: active) {
151
- :host([checked]) .mdc-toggle__slider, .mdc-toggle__icon {
152
- border: var(--mdc-toggle-border);
153
- }
154
- }
155
85
  `, ...hostFocusRingStyles(true)];
156
86
  export default styles;