@momentum-design/components 0.120.2 → 0.120.4
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.
- package/dist/browser/index.js +71 -70
- package/dist/browser/index.js.map +2 -2
- package/dist/components/checkbox/checkbox.component.d.ts +11 -0
- package/dist/components/checkbox/checkbox.component.js +11 -0
- package/dist/components/combobox/combobox.component.d.ts +9 -1
- package/dist/components/combobox/combobox.component.js +10 -3
- package/dist/components/combobox/combobox.styles.js +1 -1
- package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +11 -0
- package/dist/components/formfieldgroup/formfieldgroup.component.js +11 -0
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +9 -0
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +9 -0
- package/dist/components/input/input.component.d.ts +14 -0
- package/dist/components/input/input.component.js +18 -6
- package/dist/components/input/input.styles.js +32 -32
- package/dist/components/password/password.component.d.ts +12 -0
- package/dist/components/password/password.component.js +12 -0
- package/dist/components/popover/popover.component.js +2 -2
- package/dist/components/popover/popover.styles.js +1 -1
- package/dist/components/progressbar/progressbar.component.d.ts +6 -0
- package/dist/components/progressbar/progressbar.component.js +6 -0
- package/dist/components/radio/radio.component.d.ts +10 -0
- package/dist/components/radio/radio.component.js +10 -0
- package/dist/components/searchfield/searchfield.component.d.ts +8 -0
- package/dist/components/searchfield/searchfield.component.js +8 -1
- package/dist/components/select/select.component.d.ts +15 -0
- package/dist/components/select/select.component.js +15 -0
- package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +3 -0
- package/dist/components/staticcheckbox/staticcheckbox.component.js +4 -1
- package/dist/components/staticcheckbox/staticcheckbox.styles.js +4 -3
- package/dist/components/staticradio/staticradio.component.d.ts +4 -0
- package/dist/components/staticradio/staticradio.component.js +5 -1
- package/dist/components/staticradio/staticradio.styles.js +13 -13
- package/dist/components/statictoggle/statictoggle.component.d.ts +5 -0
- package/dist/components/statictoggle/statictoggle.component.js +6 -1
- package/dist/components/statictoggle/statictoggle.styles.js +7 -4
- package/dist/components/textarea/textarea.component.d.ts +11 -0
- package/dist/components/textarea/textarea.component.js +11 -0
- package/dist/components/toast/toast.component.d.ts +1 -0
- package/dist/components/toast/toast.component.js +2 -1
- package/dist/components/toast/toast.styles.js +1 -1
- package/dist/components/toggle/toggle.component.d.ts +11 -0
- package/dist/components/toggle/toggle.component.js +11 -0
- package/dist/custom-elements.json +1280 -152
- package/dist/react/checkbox/index.d.ts +11 -0
- package/dist/react/checkbox/index.js +11 -0
- package/dist/react/combobox/index.d.ts +9 -1
- package/dist/react/combobox/index.js +9 -1
- package/dist/react/formfieldgroup/index.d.ts +11 -0
- package/dist/react/formfieldgroup/index.js +11 -0
- package/dist/react/formfieldwrapper/index.d.ts +9 -0
- package/dist/react/formfieldwrapper/index.js +9 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/input/index.d.ts +14 -0
- package/dist/react/input/index.js +14 -0
- package/dist/react/password/index.d.ts +12 -0
- package/dist/react/password/index.js +12 -0
- package/dist/react/progressbar/index.d.ts +6 -0
- package/dist/react/progressbar/index.js +6 -0
- package/dist/react/radio/index.d.ts +10 -0
- package/dist/react/radio/index.js +10 -0
- package/dist/react/searchfield/index.d.ts +8 -0
- package/dist/react/searchfield/index.js +8 -0
- package/dist/react/select/index.d.ts +15 -0
- package/dist/react/select/index.js +15 -0
- package/dist/react/staticcheckbox/index.d.ts +3 -0
- package/dist/react/staticcheckbox/index.js +3 -0
- package/dist/react/staticradio/index.d.ts +4 -0
- package/dist/react/staticradio/index.js +4 -0
- package/dist/react/statictoggle/index.d.ts +5 -0
- package/dist/react/statictoggle/index.js +5 -0
- package/dist/react/textarea/index.d.ts +11 -0
- package/dist/react/textarea/index.js +11 -0
- package/dist/react/toast/index.d.ts +1 -0
- package/dist/react/toast/index.js +1 -0
- package/dist/react/toggle/index.d.ts +11 -0
- package/dist/react/toggle/index.js +11 -0
- package/package.json +1 -1
@@ -35,6 +35,9 @@ import { ICON_NAME } from './staticcheckbox.constants';
|
|
35
35
|
* @cssproperty --mdc-staticcheckbox-icon-color - Icon color for an unselected checkbox.
|
36
36
|
*
|
37
37
|
* @csspart icon-container - The container for the checkbox icon.
|
38
|
+
* @csspart checkbox-icon - The checkbox icon.
|
39
|
+
*
|
40
|
+
* @slot - Default slot for adding label text.
|
38
41
|
*/
|
39
42
|
class StaticCheckbox extends DisabledMixin(Component) {
|
40
43
|
constructor() {
|
@@ -56,7 +59,7 @@ class StaticCheckbox extends DisabledMixin(Component) {
|
|
56
59
|
const checkboxIconContent = this.checked || this.indeterminate
|
57
60
|
? html `
|
58
61
|
<mdc-icon
|
59
|
-
|
62
|
+
part="checkbox-icon"
|
60
63
|
name="${this.indeterminate ? ICON_NAME.INDETERMINATE : ICON_NAME.CHECKED}"
|
61
64
|
size="1"
|
62
65
|
length-unit="rem"
|
@@ -42,17 +42,18 @@ const styles = [
|
|
42
42
|
border-radius: 0.125rem;
|
43
43
|
}
|
44
44
|
|
45
|
-
|
45
|
+
:host::part(checkbox-icon) {
|
46
46
|
--mdc-icon-fill-color: var(--mdc-staticcheckbox-icon-color);
|
47
47
|
}
|
48
48
|
|
49
|
-
:host([disabled])
|
49
|
+
:host([disabled])::part(checkbox-icon) {
|
50
50
|
--mdc-icon-fill-color: var(--mdc-staticcheckbox-disabled-icon-color);
|
51
51
|
}
|
52
52
|
|
53
53
|
/* High Contrast Mode */
|
54
54
|
@media (forced-colors: active) {
|
55
|
-
:host([checked])::part(icon-container)
|
55
|
+
:host([checked])::part(icon-container),
|
56
|
+
:host([indeterminate])::part(icon-container) {
|
56
57
|
border: 0.0625rem solid var(--mdc-staticcheckbox-border-color);
|
57
58
|
}
|
58
59
|
}
|
@@ -21,6 +21,10 @@ declare const StaticRadio_base: import("../../utils/mixins/index.types").Constru
|
|
21
21
|
* @cssproperty --mdc-staticradio-control-active-color - color of the radio button when active
|
22
22
|
* @cssproperty --mdc-staticradio-control-active-disabled-background - background color of the radio button
|
23
23
|
* when active and disabled
|
24
|
+
*
|
25
|
+
* @csspart radio-icon - The radio icon.
|
26
|
+
*
|
27
|
+
* @slot - Default slot for the label of the radio.
|
24
28
|
*/
|
25
29
|
declare class StaticRadio extends StaticRadio_base {
|
26
30
|
/**
|
@@ -32,6 +32,10 @@ import styles from './staticradio.styles';
|
|
32
32
|
* @cssproperty --mdc-staticradio-control-active-color - color of the radio button when active
|
33
33
|
* @cssproperty --mdc-staticradio-control-active-disabled-background - background color of the radio button
|
34
34
|
* when active and disabled
|
35
|
+
*
|
36
|
+
* @csspart radio-icon - The radio icon.
|
37
|
+
*
|
38
|
+
* @slot - Default slot for the label of the radio.
|
35
39
|
*/
|
36
40
|
class StaticRadio extends DisabledMixin(Component) {
|
37
41
|
constructor() {
|
@@ -51,7 +55,7 @@ class StaticRadio extends DisabledMixin(Component) {
|
|
51
55
|
}
|
52
56
|
render() {
|
53
57
|
return html ` <slot></slot>
|
54
|
-
<span part="radio-icon" class="icon"></span>`;
|
58
|
+
<span part="radio-icon" class="radio-icon"></span>`;
|
55
59
|
}
|
56
60
|
}
|
57
61
|
StaticRadio.styles = [...Component.styles, ...styles];
|
@@ -21,30 +21,30 @@ const styles = [
|
|
21
21
|
--mdc-staticradio-control-active-disabled-background: var(--mds-color-theme-control-active-disabled);
|
22
22
|
}
|
23
23
|
|
24
|
-
.icon:after {
|
24
|
+
.radio-icon:after {
|
25
25
|
content: '';
|
26
26
|
position: absolute;
|
27
27
|
display: none;
|
28
28
|
}
|
29
29
|
|
30
|
-
:host([disabled])
|
31
|
-
:host([disabled][readonly])
|
30
|
+
:host([disabled])::part(radio-icon),
|
31
|
+
:host([disabled][readonly])::part(radio-icon) {
|
32
32
|
border-color: var(--mdc-staticradio-disabled-border-color);
|
33
33
|
background: var(--mdc-staticradio-control-inactive-disabled-background);
|
34
34
|
}
|
35
35
|
|
36
|
-
:host([disabled][checked])
|
37
|
-
:host([disabled][readonly][checked])
|
36
|
+
:host([disabled][checked])::part(radio-icon),
|
37
|
+
:host([disabled][readonly][checked])::part(radio-icon) {
|
38
38
|
border: var(--mdc-staticradio-control-active-disabled-background);
|
39
39
|
background: var(--mdc-staticradio-control-active-disabled-background);
|
40
40
|
}
|
41
41
|
|
42
|
-
:host([disabled][checked]) .icon:after,
|
43
|
-
:host([disabled][readonly][checked]) .icon:after {
|
42
|
+
:host([disabled][checked]) .radio-icon:after,
|
43
|
+
:host([disabled][readonly][checked]) .radio-icon:after {
|
44
44
|
background: var(--mdc-staticradio-inner-circle-disabled-background);
|
45
45
|
}
|
46
46
|
|
47
|
-
|
47
|
+
:host::part(radio-icon) {
|
48
48
|
position: absolute;
|
49
49
|
top: 0;
|
50
50
|
left: 0;
|
@@ -55,12 +55,12 @@ const styles = [
|
|
55
55
|
border-radius: 50%;
|
56
56
|
}
|
57
57
|
|
58
|
-
:host([checked])
|
58
|
+
:host([checked])::part(radio-icon) {
|
59
59
|
border-color: var(--mdc-staticradio-control-active-color);
|
60
60
|
background-color: var(--mdc-staticradio-control-active-color);
|
61
61
|
}
|
62
62
|
|
63
|
-
:host([checked]) .icon:after {
|
63
|
+
:host([checked]) .radio-icon:after {
|
64
64
|
display: block;
|
65
65
|
top: 50%;
|
66
66
|
left: 50%;
|
@@ -71,16 +71,16 @@ const styles = [
|
|
71
71
|
background: var(--mdc-staticradio-inner-circle-normal-background);
|
72
72
|
}
|
73
73
|
|
74
|
-
:host([readonly])
|
74
|
+
:host([readonly])::part(radio-icon) {
|
75
75
|
border-color: var(--mdc-staticradio-normal-border-color);
|
76
76
|
background-color: var(--mdc-staticradio-control-inactive-color);
|
77
77
|
}
|
78
78
|
|
79
|
-
:host([readonly][checked])
|
79
|
+
:host([readonly][checked])::part(radio-icon) {
|
80
80
|
border-color: var(--mdc-staticradio-normal-border-color);
|
81
81
|
}
|
82
82
|
|
83
|
-
:host([readonly][checked]) .icon:after {
|
83
|
+
:host([readonly][checked]) .radio-icon:after {
|
84
84
|
background-color: var(--mdc-staticradio-text-disabled-color);
|
85
85
|
}
|
86
86
|
`,
|
@@ -28,6 +28,11 @@ declare const StaticToggle_base: import("../../utils/mixins/index.types").Constr
|
|
28
28
|
* @cssproperty --mdc-statictoggle-icon-color-disabled - Color of the icon in disabled state
|
29
29
|
* @cssproperty --mdc-statictoggle-icon-background-color-normal - Background color of the icon in normal state
|
30
30
|
* @cssproperty --mdc-statictoggle-icon-background-color-disabled - Background color of the icon in disabled state
|
31
|
+
*
|
32
|
+
* @csspart slider - The slider part of the toggle
|
33
|
+
* @csspart toggle-icon - The icon part of the toggle
|
34
|
+
*
|
35
|
+
* @slot - Default slot for adding label text.
|
31
36
|
*/
|
32
37
|
declare class StaticToggle extends StaticToggle_base {
|
33
38
|
/**
|
@@ -39,6 +39,11 @@ import styles from './statictoggle.styles';
|
|
39
39
|
* @cssproperty --mdc-statictoggle-icon-color-disabled - Color of the icon in disabled state
|
40
40
|
* @cssproperty --mdc-statictoggle-icon-background-color-normal - Background color of the icon in normal state
|
41
41
|
* @cssproperty --mdc-statictoggle-icon-background-color-disabled - Background color of the icon in disabled state
|
42
|
+
*
|
43
|
+
* @csspart slider - The slider part of the toggle
|
44
|
+
* @csspart toggle-icon - The icon part of the toggle
|
45
|
+
*
|
46
|
+
* @slot - Default slot for adding label text.
|
42
47
|
*/
|
43
48
|
class StaticToggle extends DisabledMixin(Component) {
|
44
49
|
constructor() {
|
@@ -62,7 +67,7 @@ class StaticToggle extends DisabledMixin(Component) {
|
|
62
67
|
<div part="slider">
|
63
68
|
<mdc-icon
|
64
69
|
name="${this.checked ? ICON_NAME.CHECKED : ICON_NAME.UNCHECKED}"
|
65
|
-
|
70
|
+
part="toggle-icon"
|
66
71
|
length-unit="rem"
|
67
72
|
size="${ICON_SIZE_IN_REM[this.size]}"
|
68
73
|
></mdc-icon>
|
@@ -49,19 +49,19 @@ const styles = [
|
|
49
49
|
border-radius: var(--mdc-statictoggle-border-radius-compact);
|
50
50
|
}
|
51
51
|
|
52
|
-
|
52
|
+
:host::part(toggle-icon) {
|
53
53
|
padding: 0.25rem;
|
54
54
|
--mdc-icon-fill-color: var(--mdc-statictoggle-icon-color-normal);
|
55
55
|
background-color: var(--mdc-statictoggle-icon-background-color-normal);
|
56
56
|
border-radius: 50%;
|
57
57
|
}
|
58
58
|
|
59
|
-
:host([disabled])
|
59
|
+
:host([disabled])::part(toggle-icon) {
|
60
60
|
--mdc-icon-fill-color: var(--mdc-statictoggle-icon-color-disabled);
|
61
61
|
background-color: var(--mdc-statictoggle-icon-background-color-disabled);
|
62
62
|
}
|
63
63
|
|
64
|
-
:host([size='compact'])
|
64
|
+
:host([size='compact'])::part(toggle-icon) {
|
65
65
|
padding: 0.125rem;
|
66
66
|
}
|
67
67
|
|
@@ -76,9 +76,12 @@ const styles = [
|
|
76
76
|
/* High Contrast Mode */
|
77
77
|
@media (forced-colors: active) {
|
78
78
|
:host([checked])::part(slider),
|
79
|
-
|
79
|
+
:host::part(toggle-icon) {
|
80
80
|
border: var(--mdc-statictoggle-border);
|
81
81
|
}
|
82
|
+
:host::part(toggle-icon) {
|
83
|
+
--mdc-icon-fill-color: CanvasText;
|
84
|
+
}
|
82
85
|
}
|
83
86
|
`,
|
84
87
|
];
|
@@ -52,7 +52,18 @@ declare const Textarea_base: import("../../utils/mixins/index.types").Constructo
|
|
52
52
|
* @cssproperty --mdc-textarea-focused-background-color - Background color for the textarea container when focused
|
53
53
|
* @cssproperty --mdc-textarea-focused-border-color - Border color for the textarea container when focused
|
54
54
|
*
|
55
|
+
* @csspart label - The label element.
|
56
|
+
* @csspart label-text - The container for the label and required indicator elements.
|
57
|
+
* @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
|
58
|
+
* @csspart info-icon-btn - The info icon button element that is displayed next to the label when the `toggletip-text` property is set.
|
59
|
+
* @csspart label-toggletip - The toggletip element that is displayed when the info icon button is clicked.
|
60
|
+
* @csspart help-text - The helper/validation text element.
|
61
|
+
* @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
|
62
|
+
* @csspart help-text-container - The container for the helper/validation icon and text elements.
|
63
|
+
* @csspart character-counter - The character counter element that is displayed when the `max-character-limit` property is set.
|
64
|
+
* @csspart textarea-footer - The container for the help text and character counter elements.
|
55
65
|
* @csspart textarea-container - The textarea container
|
66
|
+
* @csspart textarea - The textarea field element.
|
56
67
|
*/
|
57
68
|
declare class Textarea extends Textarea_base {
|
58
69
|
/**
|
@@ -67,7 +67,18 @@ import styles from './textarea.styles';
|
|
67
67
|
* @cssproperty --mdc-textarea-focused-background-color - Background color for the textarea container when focused
|
68
68
|
* @cssproperty --mdc-textarea-focused-border-color - Border color for the textarea container when focused
|
69
69
|
*
|
70
|
+
* @csspart label - The label element.
|
71
|
+
* @csspart label-text - The container for the label and required indicator elements.
|
72
|
+
* @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
|
73
|
+
* @csspart info-icon-btn - The info icon button element that is displayed next to the label when the `toggletip-text` property is set.
|
74
|
+
* @csspart label-toggletip - The toggletip element that is displayed when the info icon button is clicked.
|
75
|
+
* @csspart help-text - The helper/validation text element.
|
76
|
+
* @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
|
77
|
+
* @csspart help-text-container - The container for the helper/validation icon and text elements.
|
78
|
+
* @csspart character-counter - The character counter element that is displayed when the `max-character-limit` property is set.
|
79
|
+
* @csspart textarea-footer - The container for the help text and character counter elements.
|
70
80
|
* @csspart textarea-container - The textarea container
|
81
|
+
* @csspart textarea - The textarea field element.
|
71
82
|
*/
|
72
83
|
class Textarea extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))) {
|
73
84
|
constructor() {
|
@@ -33,6 +33,7 @@ declare const Toast_base: import("../../utils/mixins/index.types").Constructor<i
|
|
33
33
|
* @csspart footer - The container for the toast's footer, including toggle and action buttons.
|
34
34
|
* @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.
|
35
35
|
* @csspart toast-close-btn - The close button for the toast.
|
36
|
+
* @csspart has-footer-buttons - Applied to the footer when it contains buttons or a toggle button.
|
36
37
|
*
|
37
38
|
* @cssproperty --mdc-toast-background-color - Background color of the toast.
|
38
39
|
* @cssproperty --mdc-toast-border-color - Border color of the toast.
|
@@ -45,6 +45,7 @@ import styles from './toast.styles';
|
|
45
45
|
* @csspart footer - The container for the toast's footer, including toggle and action buttons.
|
46
46
|
* @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.
|
47
47
|
* @csspart toast-close-btn - The close button for the toast.
|
48
|
+
* @csspart has-footer-buttons - Applied to the footer when it contains buttons or a toggle button.
|
48
49
|
*
|
49
50
|
* @cssproperty --mdc-toast-background-color - Background color of the toast.
|
50
51
|
* @cssproperty --mdc-toast-border-color - Border color of the toast.
|
@@ -151,7 +152,7 @@ class Toast extends FooterMixin(Component) {
|
|
151
152
|
renderFooter() {
|
152
153
|
this.updateFooterButtonsPresence();
|
153
154
|
return html ` <slot name="footer">
|
154
|
-
<div part="footer
|
155
|
+
<div part="footer ${this.hasFooterButtons}">
|
155
156
|
${this.renderToggleDetailButton()}
|
156
157
|
<slot
|
157
158
|
name="footer-button-secondary"
|
@@ -34,6 +34,17 @@ declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<
|
|
34
34
|
* @cssproperty --mdc-toggle-active-pressed-color - Background color of the active toggle in pressed state
|
35
35
|
* @cssproperty --mdc-toggle-inactive-hover-color - Background color of the inactive toggle in hover state
|
36
36
|
* @cssproperty --mdc-toggle-inactive-pressed-color - Background color of the inactive toggle in pressed state
|
37
|
+
*
|
38
|
+
* @csspart label - The label element.
|
39
|
+
* @csspart label-text - The container for the label and required indicator elements.
|
40
|
+
* @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
|
41
|
+
* @csspart info-icon-btn - The info icon button element that is displayed next to the label when the `toggletip-text` property is set.
|
42
|
+
* @csspart label-toggletip - The toggletip element that is displayed when the info icon button is clicked.
|
43
|
+
* @csspart help-text - The helper/validation text element.
|
44
|
+
* @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
|
45
|
+
* @csspart help-text-container - The container for the helper/validation icon and text elements.
|
46
|
+
* @csspart container - The container element that wraps the toggle input.
|
47
|
+
* @csspart toggle-input - The native checkbox input element styled as a toggle switch.
|
37
48
|
*/
|
38
49
|
declare class Toggle extends Toggle_base implements AssociatedFormControl {
|
39
50
|
/**
|
@@ -50,6 +50,17 @@ import styles from './toggle.styles';
|
|
50
50
|
* @cssproperty --mdc-toggle-active-pressed-color - Background color of the active toggle in pressed state
|
51
51
|
* @cssproperty --mdc-toggle-inactive-hover-color - Background color of the inactive toggle in hover state
|
52
52
|
* @cssproperty --mdc-toggle-inactive-pressed-color - Background color of the inactive toggle in pressed state
|
53
|
+
*
|
54
|
+
* @csspart label - The label element.
|
55
|
+
* @csspart label-text - The container for the label and required indicator elements.
|
56
|
+
* @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
|
57
|
+
* @csspart info-icon-btn - The info icon button element that is displayed next to the label when the `toggletip-text` property is set.
|
58
|
+
* @csspart label-toggletip - The toggletip element that is displayed when the info icon button is clicked.
|
59
|
+
* @csspart help-text - The helper/validation text element.
|
60
|
+
* @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
|
61
|
+
* @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.
|
63
|
+
* @csspart toggle-input - The native checkbox input element styled as a toggle switch.
|
53
64
|
*/
|
54
65
|
class Toggle extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))) {
|
55
66
|
constructor() {
|