@momentum-design/components 0.118.4 → 0.118.5
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 +65 -69
- package/dist/browser/index.js.map +2 -2
- package/dist/components/checkbox/checkbox.component.js +2 -2
- package/dist/components/checkbox/checkbox.styles.js +13 -8
- package/dist/components/combobox/combobox.component.js +1 -1
- package/dist/components/formfieldgroup/formfieldgroup.styles.js +0 -4
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +2 -2
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +5 -7
- package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +22 -16
- package/dist/components/progressbar/progressbar.styles.js +3 -5
- package/dist/components/radio/radio.component.js +2 -2
- package/dist/components/radio/radio.styles.js +8 -12
- package/dist/components/toggle/toggle.component.d.ts +0 -3
- package/dist/components/toggle/toggle.component.js +0 -3
- package/dist/components/toggle/toggle.styles.js +11 -14
- package/dist/custom-elements.json +205 -217
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/toggle/index.d.ts +0 -3
- package/dist/react/toggle/index.js +0 -3
- package/package.json +1 -1
@@ -73,7 +73,7 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
73
73
|
this.renderLabelAndHelperText = () => {
|
74
74
|
if (!this.label)
|
75
75
|
return nothing;
|
76
|
-
return html `<div
|
76
|
+
return html `<div part="text-container">${this.renderLabel()} ${this.renderHelperText()}</div>`;
|
77
77
|
};
|
78
78
|
}
|
79
79
|
connectedCallback() {
|
@@ -187,7 +187,7 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
187
187
|
<input
|
188
188
|
id="${this.inputId}"
|
189
189
|
type="checkbox"
|
190
|
-
|
190
|
+
part="checkbox-input"
|
191
191
|
name="${ifDefined(this.name)}"
|
192
192
|
value="${ifDefined(this.value)}"
|
193
193
|
?required="${this.required}"
|
@@ -12,13 +12,18 @@ const styles = [
|
|
12
12
|
flex-direction: row;
|
13
13
|
align-items: flex-start;
|
14
14
|
}
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
:host::part(label) {
|
17
|
+
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
18
|
+
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
19
|
+
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
20
|
+
}
|
21
|
+
|
22
|
+
:host::part(label) :host::part(checkbox-input) {
|
17
23
|
cursor: pointer;
|
18
24
|
}
|
19
25
|
|
20
|
-
:host([disabled])
|
21
|
-
:host([disabled]) .input {
|
26
|
+
:host([disabled])::part(label) :host([disabled])::part(checkbox-input) {
|
22
27
|
cursor: default;
|
23
28
|
}
|
24
29
|
|
@@ -51,7 +56,7 @@ const styles = [
|
|
51
56
|
position: relative;
|
52
57
|
}
|
53
58
|
|
54
|
-
|
59
|
+
:host::part(checkbox-input) {
|
55
60
|
margin: 0;
|
56
61
|
padding: 0;
|
57
62
|
position: absolute;
|
@@ -62,19 +67,19 @@ const styles = [
|
|
62
67
|
z-index: 1;
|
63
68
|
}
|
64
69
|
|
65
|
-
|
70
|
+
:host::part(checkbox-input) {
|
66
71
|
width: 1rem;
|
67
72
|
height: 1rem;
|
68
73
|
border-radius: 0.125rem;
|
69
74
|
}
|
70
75
|
|
71
|
-
|
76
|
+
:host::part(text-container) {
|
72
77
|
display: flex;
|
73
78
|
flex-direction: column;
|
74
79
|
gap: 0.25rem;
|
75
80
|
}
|
76
81
|
|
77
|
-
|
82
|
+
:host::part(label) {
|
78
83
|
word-break: break-word;
|
79
84
|
white-space: normal;
|
80
85
|
}
|
@@ -692,7 +692,7 @@ class Combobox extends CaptureDestroyEventForChildElement(AutoFocusOnMountMixin(
|
|
692
692
|
`;
|
693
693
|
}
|
694
694
|
}
|
695
|
-
Combobox.styles = [...
|
695
|
+
Combobox.styles = [...Input.styles, ...FormfieldWrapper.styles, ...styles];
|
696
696
|
__decorate([
|
697
697
|
property({ type: String }),
|
698
698
|
__metadata("design:type", String)
|
@@ -82,12 +82,12 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
|
|
82
82
|
*/
|
83
83
|
protected renderHelpText(): import("lit-html").TemplateResult<1> | typeof nothing;
|
84
84
|
/**
|
85
|
-
* renders the
|
85
|
+
* renders the label container that contains the label and labelInfoToggleTip.
|
86
86
|
* @returns void
|
87
87
|
*/
|
88
88
|
protected renderLabel(): import("lit-html").TemplateResult<1> | typeof nothing;
|
89
89
|
/**
|
90
|
-
* renders the
|
90
|
+
* renders the help-text container that contains the helpertext icon and helpertext.
|
91
91
|
* @returns void
|
92
92
|
*/
|
93
93
|
protected renderHelperText(): import("lit-html").TemplateResult<1> | typeof nothing;
|
@@ -72,9 +72,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
72
72
|
return nothing;
|
73
73
|
}
|
74
74
|
return this.shouldRenderLabel
|
75
|
-
? html `<label for="${this.inputId}" id="${DEFAULTS.HEADING_ID}"
|
76
|
-
>${this.label}</label
|
77
|
-
>`
|
75
|
+
? html `<label for="${this.inputId}" id="${DEFAULTS.HEADING_ID}" part="label">${this.label}</label>`
|
78
76
|
: html ` <mdc-text
|
79
77
|
id="${DEFAULTS.HEADING_ID}"
|
80
78
|
tagname="${MDC_TEXT_OPTIONS.TAGNAME}"
|
@@ -119,14 +117,14 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
119
117
|
`;
|
120
118
|
}
|
121
119
|
/**
|
122
|
-
* renders the
|
120
|
+
* renders the label container that contains the label and labelInfoToggleTip.
|
123
121
|
* @returns void
|
124
122
|
*/
|
125
123
|
renderLabel() {
|
126
124
|
if (!this.label)
|
127
125
|
return nothing;
|
128
126
|
const triggerId = `toggletip-trigger-${uuidv4()}`;
|
129
|
-
return html `<div
|
127
|
+
return html `<div part="label-text">
|
130
128
|
<slot name="label">${this.renderLabelElement()}</slot>
|
131
129
|
${this.required ? html `<span part="required-indicator">*</span>` : nothing}
|
132
130
|
<slot name="toggletip">
|
@@ -154,14 +152,14 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
154
152
|
</div>`;
|
155
153
|
}
|
156
154
|
/**
|
157
|
-
* renders the
|
155
|
+
* renders the help-text container that contains the helpertext icon and helpertext.
|
158
156
|
* @returns void
|
159
157
|
*/
|
160
158
|
renderHelperText() {
|
161
159
|
if (!this.helpText) {
|
162
160
|
return nothing;
|
163
161
|
}
|
164
|
-
return html `<div
|
162
|
+
return html `<div part="help-text-container">
|
165
163
|
<slot name="help-icon">${this.renderHelpTextIcon()}</slot>
|
166
164
|
<slot name="help-text">${this.renderHelpText()}</slot>
|
167
165
|
</div>`;
|
@@ -9,13 +9,13 @@ const styles = [
|
|
9
9
|
gap: 0.5rem;
|
10
10
|
}
|
11
11
|
:host([disabled]),
|
12
|
-
:host([disabled])
|
13
|
-
:host([disabled])
|
12
|
+
:host([disabled])::part(label),
|
13
|
+
:host([disabled])::part(help-text-container),
|
14
14
|
:host([disabled])::part(required-indicator),
|
15
|
-
:host([disabled][help-text-type='error'])
|
16
|
-
:host([disabled][help-text-type='success'])
|
17
|
-
:host([disabled][help-text-type='warning'])
|
18
|
-
:host([disabled][help-text-type='priority'])
|
15
|
+
:host([disabled][help-text-type='error'])::part(help-text-container),
|
16
|
+
:host([disabled][help-text-type='success'])::part(help-text-container),
|
17
|
+
:host([disabled][help-text-type='warning'])::part(help-text-container),
|
18
|
+
:host([disabled][help-text-type='priority'])::part(help-text-container) {
|
19
19
|
color: var(--mds-color-theme-text-primary-disabled);
|
20
20
|
}
|
21
21
|
|
@@ -23,29 +23,35 @@ const styles = [
|
|
23
23
|
color: var(--mds-color-theme-text-error-normal);
|
24
24
|
}
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
:host::part(label-text),
|
27
|
+
:host::part(help-text-container) {
|
28
28
|
display: flex;
|
29
29
|
align-items: center;
|
30
30
|
gap: 0.5rem;
|
31
31
|
width: 100%;
|
32
32
|
}
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
:host::part(label) {
|
35
|
+
font-size: var(--mds-font-apps-body-midsize-medium-font-size);
|
36
|
+
font-weight: var(--mds-font-apps-body-midsize-medium-font-weight);
|
37
|
+
line-height: var(--mds-font-apps-body-midsize-medium-line-height);
|
38
|
+
}
|
39
|
+
|
40
|
+
:host::part(help-text),
|
41
|
+
:host::part(help-text-container) {
|
36
42
|
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
37
43
|
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
38
44
|
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
39
45
|
}
|
40
46
|
|
41
|
-
|
47
|
+
:host::part(label) {
|
42
48
|
color: var(--mds-color-theme-text-primary-normal);
|
43
49
|
overflow: hidden;
|
44
50
|
text-overflow: ellipsis;
|
45
51
|
white-space: nowrap;
|
46
52
|
}
|
47
53
|
|
48
|
-
|
54
|
+
:host::part(help-text-container) {
|
49
55
|
color: var(--mds-color-theme-text-secondary-normal);
|
50
56
|
}
|
51
57
|
|
@@ -53,16 +59,16 @@ const styles = [
|
|
53
59
|
align-self: flex-start;
|
54
60
|
}
|
55
61
|
|
56
|
-
:host([help-text-type='error'])
|
62
|
+
:host([help-text-type='error'])::part(help-text-container) {
|
57
63
|
color: var(--mds-color-theme-text-error-normal);
|
58
64
|
}
|
59
|
-
:host([help-text-type='warning'])
|
65
|
+
:host([help-text-type='warning'])::part(help-text-container) {
|
60
66
|
color: var(--mds-color-theme-text-warning-normal);
|
61
67
|
}
|
62
|
-
:host([help-text-type='success'])
|
68
|
+
:host([help-text-type='success'])::part(help-text-container) {
|
63
69
|
color: var(--mds-color-theme-text-success-normal);
|
64
70
|
}
|
65
|
-
:host([help-text-type='priority'])
|
71
|
+
:host([help-text-type='priority'])::part(help-text-container) {
|
66
72
|
color: var(--mds-color-theme-text-accent-normal);
|
67
73
|
}
|
68
74
|
`,
|
@@ -13,9 +13,9 @@ const styles = [
|
|
13
13
|
--mdc-progressbar-border-radius: var(--mdc-progressbar-height);
|
14
14
|
|
15
15
|
--mdc-progressbar-label-color: var(--mds-color-theme-text-primary-normal);
|
16
|
-
--mdc-progressbar-label-line-height: var(--mds-font-
|
17
|
-
--mdc-progressbar-label-font-size: var(--mds-font-
|
18
|
-
--mdc-progressbar-label-font-weight: var(--mds-font-
|
16
|
+
--mdc-progressbar-label-line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
17
|
+
--mdc-progressbar-label-font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
18
|
+
--mdc-progressbar-label-font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
19
19
|
--mdc-progressbar-help-text-color: var(--mds-color-theme-text-secondary-normal);
|
20
20
|
|
21
21
|
width: 100%;
|
@@ -71,8 +71,6 @@ const styles = [
|
|
71
71
|
border-radius: var(--mdc-progressbar-border-radius);
|
72
72
|
}
|
73
73
|
|
74
|
-
:host::part(label-text),
|
75
|
-
:host::part(help-text),
|
76
74
|
:host::part(percentage) {
|
77
75
|
font-size: var(--mdc-progressbar-label-font-size);
|
78
76
|
font-weight: var(--mdc-progressbar-label-font-weight);
|
@@ -64,7 +64,7 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
64
64
|
this.renderLabelAndHelperText = () => {
|
65
65
|
if (!this.label)
|
66
66
|
return nothing;
|
67
|
-
return html `<div
|
67
|
+
return html `<div part="text-container">${this.renderLabel()} ${this.renderHelperText()}</div>`;
|
68
68
|
};
|
69
69
|
}
|
70
70
|
connectedCallback() {
|
@@ -279,6 +279,7 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
279
279
|
>
|
280
280
|
<input
|
281
281
|
id="${this.inputId}"
|
282
|
+
part="radio-input"
|
282
283
|
type="radio"
|
283
284
|
role="${ROLE.RADIO}"
|
284
285
|
?autofocus="${this.autofocus}"
|
@@ -290,7 +291,6 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
290
291
|
?checked=${this.checked}
|
291
292
|
?readonly=${this.readonly}
|
292
293
|
?disabled=${this.disabled}
|
293
|
-
class="mdc-radio__input"
|
294
294
|
aria-checked="${this.checked}"
|
295
295
|
aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
|
296
296
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
@@ -52,25 +52,21 @@ const styles = [
|
|
52
52
|
background-color: var(--mdc-radio-control-active-disabled-background);
|
53
53
|
}
|
54
54
|
|
55
|
-
:host([readonly])
|
56
|
-
:host([
|
57
|
-
:host([disabled]) .mdc-label,
|
58
|
-
:host([readonly]) .mdc-label {
|
55
|
+
:host([readonly])::part(radio-input) :host([disabled])::part(radio-input) :host([disabled])::part(label),
|
56
|
+
:host([readonly])::part(label) {
|
59
57
|
cursor: default;
|
60
58
|
}
|
61
59
|
|
62
|
-
|
60
|
+
:host::part(label) {
|
63
61
|
cursor: pointer;
|
64
62
|
word-break: break-word;
|
65
63
|
white-space: normal;
|
64
|
+
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
65
|
+
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
66
|
+
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
66
67
|
}
|
67
68
|
|
68
|
-
:host(
|
69
|
-
:host([disabled]) .mdc-radio__help-text {
|
70
|
-
color: var(--mdc-radio-text-disabled-color);
|
71
|
-
}
|
72
|
-
|
73
|
-
.mdc-radio__input {
|
69
|
+
:host::part(radio-input) {
|
74
70
|
position: absolute;
|
75
71
|
opacity: 0;
|
76
72
|
margin: 0;
|
@@ -80,7 +76,7 @@ const styles = [
|
|
80
76
|
z-index: 2;
|
81
77
|
}
|
82
78
|
|
83
|
-
|
79
|
+
:host::part(text-container) {
|
84
80
|
display: flex;
|
85
81
|
flex-direction: column;
|
86
82
|
justify-content: center;
|
@@ -28,9 +28,6 @@ declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<
|
|
28
28
|
* @cssproperty --mdc-toggle-height - Height of the toggle
|
29
29
|
* @cssproperty --mdc-toggle-width-compact - Width of the toggle when it's size is compact
|
30
30
|
* @cssproperty --mdc-toggle-height-compact - Height of the toggle when it's size is compact
|
31
|
-
* @cssproperty --mdc-toggle-label-lineheight - Line height of the toggle label
|
32
|
-
* @cssproperty --mdc-toggle-label-fontsize - Font size of the toggle label
|
33
|
-
* @cssproperty --mdc-toggle-label-fontweight - Font weight of the toggle label
|
34
31
|
* @cssproperty --mdc-toggle-label-color-disabled - Color of the toggle label and help text in disabled state
|
35
32
|
* @cssproperty --mdc-toggle-help-text-color - Color of the help text label
|
36
33
|
* @cssproperty --mdc-toggle-active-hover-color - Background color of the active toggle in hover state
|
@@ -44,9 +44,6 @@ import styles from './toggle.styles';
|
|
44
44
|
* @cssproperty --mdc-toggle-height - Height of the toggle
|
45
45
|
* @cssproperty --mdc-toggle-width-compact - Width of the toggle when it's size is compact
|
46
46
|
* @cssproperty --mdc-toggle-height-compact - Height of the toggle when it's size is compact
|
47
|
-
* @cssproperty --mdc-toggle-label-lineheight - Line height of the toggle label
|
48
|
-
* @cssproperty --mdc-toggle-label-fontsize - Font size of the toggle label
|
49
|
-
* @cssproperty --mdc-toggle-label-fontweight - Font weight of the toggle label
|
50
47
|
* @cssproperty --mdc-toggle-label-color-disabled - Color of the toggle label and help text in disabled state
|
51
48
|
* @cssproperty --mdc-toggle-help-text-color - Color of the help text label
|
52
49
|
* @cssproperty --mdc-toggle-active-hover-color - Background color of the active toggle in hover state
|
@@ -9,9 +9,6 @@ const styles = [
|
|
9
9
|
--mdc-toggle-width-compact: 2rem;
|
10
10
|
--mdc-toggle-height-compact: 1rem;
|
11
11
|
|
12
|
-
--mdc-toggle-label-lineheight: var(--mds-font-lineheight-body-midsize);
|
13
|
-
--mdc-toggle-label-fontsize: var(--mds-font-size-body-midsize);
|
14
|
-
--mdc-toggle-label-fontweight: 400;
|
15
12
|
--mdc-toggle-label-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
16
13
|
--mdc-toggle-help-text-color: var(--mds-color-theme-text-secondary-normal);
|
17
14
|
|
@@ -46,30 +43,30 @@ const styles = [
|
|
46
43
|
height: var(--mdc-toggle-height);
|
47
44
|
}
|
48
45
|
|
49
|
-
|
50
|
-
|
51
|
-
font-size: var(--mdc-toggle-label-fontsize);
|
52
|
-
font-weight: var(--mdc-toggle-label-fontweight);
|
53
|
-
line-height: var(--mdc-toggle-label-lineheight);
|
46
|
+
:host::part(label-text),
|
47
|
+
:host::part(help-text-container) {
|
54
48
|
grid-column: 2;
|
55
49
|
}
|
56
50
|
|
57
|
-
|
51
|
+
:host::part(label),
|
58
52
|
:host::part(toggle-input) {
|
59
53
|
cursor: pointer;
|
60
54
|
}
|
61
55
|
|
62
|
-
|
56
|
+
:host::part(label) {
|
63
57
|
word-break: break-word;
|
64
58
|
white-space: normal;
|
59
|
+
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
60
|
+
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
61
|
+
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
65
62
|
}
|
66
63
|
|
67
|
-
:host([disabled])
|
64
|
+
:host([disabled])::part(label),
|
68
65
|
:host([disabled])::part(toggle-input) {
|
69
66
|
cursor: default;
|
70
67
|
}
|
71
68
|
|
72
|
-
|
69
|
+
:host::part(help-text) {
|
73
70
|
color: var(--mdc-toggle-help-text-color);
|
74
71
|
}
|
75
72
|
|
@@ -89,8 +86,8 @@ const styles = [
|
|
89
86
|
background-color: var(--mdc-toggle-active-pressed-color);
|
90
87
|
}
|
91
88
|
|
92
|
-
:host([disabled])
|
93
|
-
:host([disabled])
|
89
|
+
:host([disabled])::part(label-text),
|
90
|
+
:host([disabled])::part(help-text) {
|
94
91
|
color: var(--mdc-toggle-label-color-disabled);
|
95
92
|
}
|
96
93
|
`,
|