@momentum-design/components 0.120.31 → 0.120.32

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 (73) hide show
  1. package/dist/browser/index.js +227 -367
  2. package/dist/browser/index.js.map +2 -2
  3. package/dist/components/checkbox/checkbox.component.d.ts +2 -0
  4. package/dist/components/checkbox/checkbox.component.js +3 -0
  5. package/dist/components/checkbox/checkbox.styles.js +14 -52
  6. package/dist/components/combobox/combobox.component.d.ts +1 -0
  7. package/dist/components/combobox/combobox.component.js +1 -0
  8. package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +1 -0
  9. package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -0
  10. package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +1 -0
  11. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +1 -0
  12. package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +8 -4
  13. package/dist/components/input/input.component.d.ts +1 -0
  14. package/dist/components/input/input.component.js +1 -0
  15. package/dist/components/password/password.component.d.ts +1 -0
  16. package/dist/components/password/password.component.js +1 -0
  17. package/dist/components/progressbar/progressbar.component.d.ts +1 -0
  18. package/dist/components/progressbar/progressbar.component.js +1 -0
  19. package/dist/components/radio/radio.component.d.ts +5 -8
  20. package/dist/components/radio/radio.component.js +6 -8
  21. package/dist/components/radio/radio.styles.js +16 -74
  22. package/dist/components/searchfield/searchfield.component.d.ts +1 -0
  23. package/dist/components/searchfield/searchfield.component.js +1 -0
  24. package/dist/components/select/select.component.d.ts +1 -0
  25. package/dist/components/select/select.component.js +1 -0
  26. package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +4 -9
  27. package/dist/components/staticcheckbox/staticcheckbox.component.js +4 -9
  28. package/dist/components/staticcheckbox/staticcheckbox.styles.js +54 -56
  29. package/dist/components/staticradio/staticradio.component.d.ts +5 -12
  30. package/dist/components/staticradio/staticradio.component.js +5 -12
  31. package/dist/components/staticradio/staticradio.styles.js +65 -58
  32. package/dist/components/statictoggle/statictoggle.component.d.ts +7 -15
  33. package/dist/components/statictoggle/statictoggle.component.js +7 -15
  34. package/dist/components/statictoggle/statictoggle.styles.js +55 -64
  35. package/dist/components/textarea/textarea.component.d.ts +1 -0
  36. package/dist/components/textarea/textarea.component.js +1 -0
  37. package/dist/components/toggle/toggle.component.d.ts +8 -11
  38. package/dist/components/toggle/toggle.component.js +10 -13
  39. package/dist/components/toggle/toggle.styles.js +12 -58
  40. package/dist/custom-elements.json +1916 -1900
  41. package/dist/react/checkbox/index.d.ts +2 -0
  42. package/dist/react/checkbox/index.js +2 -0
  43. package/dist/react/combobox/index.d.ts +1 -0
  44. package/dist/react/combobox/index.js +1 -0
  45. package/dist/react/formfieldgroup/index.d.ts +1 -0
  46. package/dist/react/formfieldgroup/index.js +1 -0
  47. package/dist/react/formfieldwrapper/index.d.ts +1 -0
  48. package/dist/react/formfieldwrapper/index.js +1 -0
  49. package/dist/react/index.d.ts +4 -4
  50. package/dist/react/index.js +4 -4
  51. package/dist/react/input/index.d.ts +1 -0
  52. package/dist/react/input/index.js +1 -0
  53. package/dist/react/password/index.d.ts +1 -0
  54. package/dist/react/password/index.js +1 -0
  55. package/dist/react/progressbar/index.d.ts +1 -0
  56. package/dist/react/progressbar/index.js +1 -0
  57. package/dist/react/radio/index.d.ts +5 -8
  58. package/dist/react/radio/index.js +5 -8
  59. package/dist/react/searchfield/index.d.ts +1 -0
  60. package/dist/react/searchfield/index.js +1 -0
  61. package/dist/react/select/index.d.ts +1 -0
  62. package/dist/react/select/index.js +1 -0
  63. package/dist/react/staticcheckbox/index.d.ts +4 -9
  64. package/dist/react/staticcheckbox/index.js +4 -9
  65. package/dist/react/staticradio/index.d.ts +5 -12
  66. package/dist/react/staticradio/index.js +5 -12
  67. package/dist/react/statictoggle/index.d.ts +7 -15
  68. package/dist/react/statictoggle/index.js +7 -15
  69. package/dist/react/textarea/index.d.ts +1 -0
  70. package/dist/react/textarea/index.js +1 -0
  71. package/dist/react/toggle/index.d.ts +8 -11
  72. package/dist/react/toggle/index.js +8 -11
  73. package/package.json +1 -1
@@ -40,16 +40,13 @@ import styles from './toggle.styles';
40
40
  * @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
41
41
  * @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
42
42
  *
43
- * @cssproperty --mdc-toggle-width - Width of the toggle
44
- * @cssproperty --mdc-toggle-height - Height of the toggle
45
- * @cssproperty --mdc-toggle-width-compact - Width of the toggle when it's size is compact
46
- * @cssproperty --mdc-toggle-height-compact - Height of the toggle when it's size is compact
47
- * @cssproperty --mdc-toggle-label-color-disabled - Color of the toggle label and help text in disabled state
48
- * @cssproperty --mdc-toggle-help-text-color - Color of the help text label
49
- * @cssproperty --mdc-toggle-active-hover-color - Background color of the active toggle in hover state
50
- * @cssproperty --mdc-toggle-active-pressed-color - Background color of the active toggle in pressed state
51
- * @cssproperty --mdc-toggle-inactive-hover-color - Background color of the inactive toggle in hover state
52
- * @cssproperty --mdc-toggle-inactive-pressed-color - Background color of the inactive toggle in pressed state
43
+ * @cssproperty --mdc-toggle-width - The width of the toggle
44
+ * @cssproperty --mdc-toggle-height - The height of the toggle
45
+ * @cssproperty --mdc-toggle-border-radius - The border radius of the toggle
46
+ * @cssproperty --mdc-toggle-border-color - The border color of the toggle
47
+ * @cssproperty --mdc-toggle-background-color - The background color of the toggle
48
+ * @cssproperty --mdc-toggle-icon-color - The icon color of the toggle
49
+ * @cssproperty --mdc-toggle-icon-background-color - The icon background color of the toggle
53
50
  *
54
51
  * @csspart label - The label element.
55
52
  * @csspart label-text - The container for the label and required indicator elements.
@@ -59,7 +56,7 @@ import styles from './toggle.styles';
59
56
  * @csspart help-text - The helper/validation text element.
60
57
  * @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
61
58
  * @csspart help-text-container - The container for the helper/validation icon and text elements.
62
- * @csspart container - The container element that wraps the toggle input.
59
+ * @csspart static-toggle - The static-toggle element that wraps the toggle input.
63
60
  * @csspart toggle-input - The native checkbox input element styled as a toggle switch.
64
61
  */
65
62
  class Toggle extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))) {
@@ -80,7 +77,7 @@ class Toggle extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin
80
77
  }
81
78
  connectedCallback() {
82
79
  super.connectedCallback();
83
- // Toggle does not contain helpTextType property.
80
+ // Toggle does not contain helpTextType property.
84
81
  this.helpTextType = undefined;
85
82
  }
86
83
  firstUpdated(_changedProperties) {
@@ -202,7 +199,7 @@ class Toggle extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin
202
199
  ?soft-disabled="${this.softDisabled}"
203
200
  size="${this.size}"
204
201
  class="mdc-focus-ring"
205
- part="container"
202
+ part="static-toggle"
206
203
  >
207
204
  <input
208
205
  id="${this.inputId}"
@@ -3,22 +3,6 @@ import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
3
3
  const styles = [
4
4
  hostFitContentStyles,
5
5
  css `
6
- /* Base styles and CSS custom properties */
7
- :host {
8
- --mdc-toggle-width: 3rem;
9
- --mdc-toggle-height: 1.5rem;
10
- --mdc-toggle-width-compact: 2rem;
11
- --mdc-toggle-height-compact: 1rem;
12
-
13
- --mdc-toggle-label-color-disabled: var(--mds-color-theme-text-primary-disabled);
14
- --mdc-toggle-help-text-color: var(--mds-color-theme-text-secondary-normal);
15
-
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);
20
- }
21
-
22
6
  /* Grid layout for labeled toggles */
23
7
  :host([label]),
24
8
  :host([help-text]) {
@@ -54,13 +38,9 @@ const styles = [
54
38
  :host::part(label) {
55
39
  word-break: break-word;
56
40
  white-space: normal;
57
- font-size: var(--mds-font-apps-body-midsize-regular-font-size);
58
- font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
59
- line-height: var(--mds-font-apps-body-midsize-regular-line-height);
60
- }
61
-
62
- :host::part(help-text) {
63
- color: var(--mdc-toggle-help-text-color);
41
+ --mdc-label-font-size: var(--mds-font-apps-body-midsize-regular-font-size);
42
+ --mdc-label-font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
43
+ --mdc-label-line-height: var(--mds-font-apps-body-midsize-regular-line-height);
64
44
  }
65
45
 
66
46
  /* Default interactive states */
@@ -69,54 +49,28 @@ const styles = [
69
49
  cursor: pointer;
70
50
  }
71
51
 
72
- :host(:hover)::part(container) {
73
- background-color: var(--mdc-toggle-inactive-hover-color);
52
+ :host(:hover)::part(static-toggle) {
53
+ --mdc-toggle-background-color: var(--mds-color-theme-control-inactive-hover);
74
54
  }
75
55
 
76
- :host(:active)::part(container) {
77
- background-color: var(--mdc-toggle-inactive-pressed-color);
56
+ :host(:active)::part(static-toggle) {
57
+ --mdc-toggle-background-color: var(--mds-color-theme-control-inactive-pressed);
78
58
  }
79
59
 
80
- :host([checked]:hover)::part(container) {
81
- background-color: var(--mdc-toggle-active-hover-color);
60
+ :host([checked]:hover)::part(static-toggle) {
61
+ --mdc-toggle-background-color: var(--mds-color-theme-control-active-hover);
82
62
  }
83
63
 
84
- :host([checked]:active)::part(container) {
85
- background-color: var(--mdc-toggle-active-pressed-color);
64
+ :host([checked]:active)::part(static-toggle) {
65
+ --mdc-toggle-background-color: var(--mds-color-theme-control-active-pressed);
86
66
  }
87
67
 
88
68
  /* Readonly state - disables pointer events */
89
69
  :host([readonly]),
70
+ :host([disabled]),
90
71
  :host([soft-disabled]) {
91
72
  pointer-events: none;
92
73
  }
93
-
94
- /* Disabled states override interactive styles */
95
- :host([disabled])::part(label),
96
- :host([disabled])::part(toggle-input),
97
- :host([soft-disabled])::part(label),
98
- :host([soft-disabled])::part(toggle-input) {
99
- cursor: default;
100
- }
101
-
102
- :host([disabled]:hover)::part(container),
103
- :host([disabled]:active)::part(container),
104
- :host([disabled][checked]:hover)::part(container),
105
- :host([disabled][checked]:active)::part(container),
106
- :host([soft-disabled]:hover)::part(container),
107
- :host([soft-disabled]:active)::part(container),
108
- :host([soft-disabled][checked]:hover)::part(container),
109
- :host([soft-disabled][checked]:active)::part(container) {
110
- background-color: unset;
111
- }
112
-
113
- :host([disabled])::part(label-text),
114
- :host([disabled])::part(help-text),
115
- :host([soft-disabled])::part(label),
116
- :host([soft-disabled])::part(label-text),
117
- :host([soft-disabled])::part(help-text) {
118
- color: var(--mdc-toggle-label-color-disabled);
119
- }
120
74
  `,
121
75
  ...hostFocusRingStyles(true),
122
76
  ];