@momentum-design/components 0.39.4 → 0.39.6
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 +227 -123
- package/dist/browser/index.js.map +4 -4
- package/dist/components/alertchip/alertchip.component.d.ts +1 -1
- package/dist/components/alertchip/alertchip.component.js +4 -1
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +1 -1
- package/dist/components/avatarbutton/avatarbutton.component.js +4 -1
- package/dist/components/checkbox/checkbox.component.d.ts +1 -1
- package/dist/components/checkbox/checkbox.component.js +4 -1
- package/dist/components/chip/chip.component.d.ts +1 -1
- package/dist/components/chip/chip.component.js +4 -1
- package/dist/components/coachmark/coachmark.component.d.ts +1 -1
- package/dist/components/coachmark/coachmark.component.js +4 -1
- package/dist/components/divider/divider.component.d.ts +1 -1
- package/dist/components/divider/divider.component.js +39 -36
- package/dist/components/filterchip/filterchip.component.d.ts +1 -1
- package/dist/components/filterchip/filterchip.component.js +4 -1
- package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +1 -1
- package/dist/components/formfieldgroup/formfieldgroup.component.js +4 -1
- package/dist/components/listitem/listitem.component.d.ts +1 -1
- package/dist/components/listitem/listitem.component.js +4 -1
- package/dist/components/option/option.component.d.ts +1 -1
- package/dist/components/option/option.component.js +4 -1
- package/dist/components/progressbar/index.d.ts +9 -0
- package/dist/components/progressbar/index.js +6 -0
- package/dist/components/progressbar/progressbar.component.d.ts +79 -0
- package/dist/components/progressbar/progressbar.component.js +160 -0
- package/dist/components/progressbar/progressbar.constants.d.ts +11 -0
- package/dist/components/progressbar/progressbar.constants.js +12 -0
- package/dist/components/progressbar/progressbar.styles.d.ts +2 -0
- package/dist/components/progressbar/progressbar.styles.js +86 -0
- package/dist/components/progressbar/progressbar.types.d.ts +3 -0
- package/dist/components/progressbar/progressbar.types.js +1 -0
- package/dist/components/radio/radio.component.d.ts +1 -1
- package/dist/components/radio/radio.component.js +4 -1
- package/dist/components/tab/tab.component.d.ts +1 -1
- package/dist/components/tab/tab.component.js +4 -1
- package/dist/components/textarea/textarea.component.d.ts +0 -1
- package/dist/components/textarea/textarea.component.js +7 -7
- package/dist/components/toggle/toggle.component.d.ts +1 -1
- package/dist/components/toggle/toggle.component.js +4 -1
- package/dist/components/tooltip/tooltip.component.d.ts +1 -1
- package/dist/components/tooltip/tooltip.component.js +4 -3
- package/dist/components/tooltip/tooltip.constants.d.ts +0 -1
- package/dist/components/tooltip/tooltip.constants.js +1 -2
- package/dist/custom-elements.json +3155 -2750
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +3 -2
- package/dist/react/progressbar/index.d.ts +30 -0
- package/dist/react/progressbar/index.js +39 -0
- package/package.json +1 -1
@@ -0,0 +1,86 @@
|
|
1
|
+
import { css } from 'lit';
|
2
|
+
const styles = [css `
|
3
|
+
:host {
|
4
|
+
--mdc-progressbar-background-color: var(--mds-color-theme-control-indicator-inactive-normal);
|
5
|
+
--mdc-progressbar-active-background-color: var(--mds-color-theme-control-active-normal);
|
6
|
+
--mdc-progressbar-success-color: var(--mds-color-theme-indicator-stable);
|
7
|
+
--mdc-progressbar-error-color: var(--mds-color-theme-indicator-attention);
|
8
|
+
--mdc-progressbar-height: 0.25rem;
|
9
|
+
--mdc-progressbar-border: 0.5px solid transparent;
|
10
|
+
--mdc-progressbar-border-radius: var(--mdc-progressbar-height);
|
11
|
+
|
12
|
+
--mdc-progressbar-label-color: var(--mds-color-theme-text-primary-normal);
|
13
|
+
--mdc-progressbar-label-line-height: var(--mds-font-lineheight-body-midsize);
|
14
|
+
--mdc-progressbar-label-font-size: var(--mds-font-size-body-midsize);
|
15
|
+
--mdc-progressbar-label-font-weight: var(--mds-font-weight-regular);
|
16
|
+
--mdc-progressbar-help-text-color: var(--mds-color-theme-text-secondary-normal);
|
17
|
+
|
18
|
+
display: block;
|
19
|
+
width: 100%;
|
20
|
+
}
|
21
|
+
|
22
|
+
:host::part(label-container) {
|
23
|
+
display: flex;
|
24
|
+
justify-content: space-between;
|
25
|
+
}
|
26
|
+
|
27
|
+
:host::part(inline-label-container) {
|
28
|
+
display: flex;
|
29
|
+
align-items: center;
|
30
|
+
gap: 0.5rem;
|
31
|
+
}
|
32
|
+
|
33
|
+
:host::part(progress-container) {
|
34
|
+
display: flex;
|
35
|
+
align-items: center;
|
36
|
+
width: 100%;
|
37
|
+
height: var(--mdc-progressbar-height);
|
38
|
+
margin: 0.5rem 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
:host::part(gap) {
|
42
|
+
gap: 0.25rem;
|
43
|
+
}
|
44
|
+
|
45
|
+
:host([variant="inline"])::part(label) {
|
46
|
+
overflow: unset;
|
47
|
+
}
|
48
|
+
|
49
|
+
:host::part(progress-bar) {
|
50
|
+
height: 100%;
|
51
|
+
background-color: var(--mdc-progressbar-active-background-color);
|
52
|
+
border-radius: var(--mdc-progressbar-border-radius);
|
53
|
+
transition: width 0.3s ease-in-out;
|
54
|
+
}
|
55
|
+
|
56
|
+
:host::part(success) {
|
57
|
+
background-color: var(--mdc-progressbar-success-color);
|
58
|
+
}
|
59
|
+
|
60
|
+
:host::part(error) {
|
61
|
+
background-color: var(--mdc-progressbar-error-color);
|
62
|
+
}
|
63
|
+
|
64
|
+
:host::part(remaining) {
|
65
|
+
height: 100%;
|
66
|
+
flex-grow: 1;
|
67
|
+
background-color: var(--mdc-progressbar-background-color);
|
68
|
+
border-radius: var(--mdc-progressbar-border-radius);
|
69
|
+
}
|
70
|
+
|
71
|
+
:host::part(label-text), :host::part(help-text), :host::part(percentage) {
|
72
|
+
font-size: var(--mdc-progressbar-label-font-size);
|
73
|
+
font-weight: var(--mdc-progressbar-label-font-weight);
|
74
|
+
line-height: var(--mdc-progressbar-label-line-height);
|
75
|
+
}
|
76
|
+
|
77
|
+
:host([help-text-type="default"])::part(help-text) {
|
78
|
+
color: var(--mdc-progressbar-help-text-color);
|
79
|
+
}
|
80
|
+
|
81
|
+
@media (forced-colors: active) {
|
82
|
+
:host::part(progress-container), :host::part(progress-bar) {
|
83
|
+
border: var(--mdc-progressbar-border);
|
84
|
+
}
|
85
|
+
`];
|
86
|
+
export default styles;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -48,7 +48,7 @@ import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwra
|
|
48
48
|
*/
|
49
49
|
class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
50
50
|
constructor() {
|
51
|
-
super();
|
51
|
+
super(...arguments);
|
52
52
|
/**
|
53
53
|
* Determines whether the radio is selected or unselected.
|
54
54
|
*
|
@@ -75,6 +75,9 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
75
75
|
${this.renderHelperText()}
|
76
76
|
</div>`;
|
77
77
|
};
|
78
|
+
}
|
79
|
+
connectedCallback() {
|
80
|
+
super.connectedCallback();
|
78
81
|
// Radio does not contain helpTextType property.
|
79
82
|
this.helpTextType = undefined;
|
80
83
|
}
|
@@ -112,7 +112,7 @@ declare class Tab extends Tab_base {
|
|
112
112
|
* @internal
|
113
113
|
*/
|
114
114
|
private prevIconName?;
|
115
|
-
|
115
|
+
connectedCallback(): void;
|
116
116
|
/**
|
117
117
|
* Modifies the icon name based on the active state.
|
118
118
|
* If the tab is active, the icon name is suffixed with '-filled'.
|
@@ -106,7 +106,7 @@ import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
|
106
106
|
*/
|
107
107
|
class Tab extends IconNameMixin(Buttonsimple) {
|
108
108
|
constructor() {
|
109
|
-
super();
|
109
|
+
super(...arguments);
|
110
110
|
/**
|
111
111
|
* Tab can have three variants:
|
112
112
|
* - `glass`
|
@@ -117,6 +117,9 @@ class Tab extends IconNameMixin(Buttonsimple) {
|
|
117
117
|
* @default pill
|
118
118
|
*/
|
119
119
|
this.variant = DEFAULTS.VARIANT;
|
120
|
+
}
|
121
|
+
connectedCallback() {
|
122
|
+
super.connectedCallback();
|
120
123
|
this.role = 'tab';
|
121
124
|
this.softDisabled = undefined;
|
122
125
|
this.size = undefined;
|
@@ -115,7 +115,6 @@ declare class Textarea extends Textarea_base {
|
|
115
115
|
inputElement: HTMLTextAreaElement;
|
116
116
|
private characterLimitExceedingFired;
|
117
117
|
protected get textarea(): HTMLTextAreaElement;
|
118
|
-
constructor();
|
119
118
|
connectedCallback(): void;
|
120
119
|
private setTextareaValidity;
|
121
120
|
/** @internal */
|
@@ -67,12 +67,8 @@ import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
|
67
67
|
* @cssproperty --mdc-textarea-focused-border-color - Border color for the textarea container when focused
|
68
68
|
*/
|
69
69
|
class Textarea extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
70
|
-
get textarea() {
|
71
|
-
return this.inputElement;
|
72
|
-
}
|
73
70
|
constructor() {
|
74
|
-
|
75
|
-
super();
|
71
|
+
super(...arguments);
|
76
72
|
/**
|
77
73
|
* readonly attribute of the textarea field. If true, the textarea field is read-only.
|
78
74
|
* @default false
|
@@ -109,11 +105,15 @@ class Textarea extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
|
|
109
105
|
*/
|
110
106
|
this.autofocus = false;
|
111
107
|
this.characterLimitExceedingFired = false;
|
112
|
-
|
113
|
-
|
108
|
+
}
|
109
|
+
get textarea() {
|
110
|
+
return this.inputElement;
|
114
111
|
}
|
115
112
|
connectedCallback() {
|
113
|
+
var _a;
|
116
114
|
super.connectedCallback();
|
115
|
+
// Set the default value to the textarea field if the value is set through the text content directly
|
116
|
+
this.value = ((_a = this.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || this.value;
|
117
117
|
this.updateComplete.then(() => {
|
118
118
|
if (this.textarea) {
|
119
119
|
this.textarea.checkValidity();
|
@@ -58,7 +58,7 @@ declare class Toggle extends Toggle_base implements AssociatedFormControl {
|
|
58
58
|
* @default false
|
59
59
|
*/
|
60
60
|
autofocus: boolean;
|
61
|
-
|
61
|
+
connectedCallback(): void;
|
62
62
|
/** @internal
|
63
63
|
* Resets the checkbox to its initial state.
|
64
64
|
* The checked property is set to false.
|
@@ -54,7 +54,7 @@ import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
|
54
54
|
*/
|
55
55
|
class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
56
56
|
constructor() {
|
57
|
-
super();
|
57
|
+
super(...arguments);
|
58
58
|
/**
|
59
59
|
* Determines whether the toggle is active or inactive.
|
60
60
|
* @default false
|
@@ -73,6 +73,9 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
73
73
|
* @default false
|
74
74
|
*/
|
75
75
|
this.autofocus = false;
|
76
|
+
}
|
77
|
+
connectedCallback() {
|
78
|
+
super.connectedCallback();
|
76
79
|
// Toggle does not contain helpTextType property.
|
77
80
|
this.helpTextType = undefined;
|
78
81
|
}
|
@@ -34,7 +34,7 @@ import { POPOVER_PLACEMENT } from '../popover/popover.constants';
|
|
34
34
|
*/
|
35
35
|
class Tooltip extends Popover {
|
36
36
|
constructor() {
|
37
|
-
super();
|
37
|
+
super(...arguments);
|
38
38
|
/**
|
39
39
|
* The type of tooltip.
|
40
40
|
* - **description** sets aria-describedby on the trigger component which refers to the tooltip id.
|
@@ -43,8 +43,10 @@ class Tooltip extends Popover {
|
|
43
43
|
* @default 'description'
|
44
44
|
*/
|
45
45
|
this.tooltipType = DEFAULTS.TOOLTIP_TYPE;
|
46
|
+
}
|
47
|
+
connectedCallback() {
|
48
|
+
super.connectedCallback();
|
46
49
|
this.backdrop = false;
|
47
|
-
this.color = DEFAULTS.COLOR;
|
48
50
|
this.delay = DEFAULTS.DELAY;
|
49
51
|
this.focusTrap = false;
|
50
52
|
this.hideOnBlur = true;
|
@@ -55,7 +57,6 @@ class Tooltip extends Popover {
|
|
55
57
|
this.role = 'tooltip';
|
56
58
|
this.showArrow = true;
|
57
59
|
this.trigger = 'mouseenter focusin';
|
58
|
-
this.visible = false;
|
59
60
|
this.enabledFocusTrap = false;
|
60
61
|
this.enabledPreventScroll = false;
|
61
62
|
this.flip = true;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import utils from '../../utils/tag-name';
|
2
|
-
import {
|
2
|
+
import { POPOVER_PLACEMENT } from '../popover/popover.constants';
|
3
3
|
const TAG_NAME = utils.constructTagName('tooltip');
|
4
4
|
const TOOLTIP_TYPES = {
|
5
5
|
DESCRIPTION: 'description',
|
@@ -8,7 +8,6 @@ const TOOLTIP_TYPES = {
|
|
8
8
|
};
|
9
9
|
const DEFAULTS = {
|
10
10
|
BACKDROP: false,
|
11
|
-
COLOR: COLOR.TONAL,
|
12
11
|
DELAY: '0,0',
|
13
12
|
OFFSET: 4,
|
14
13
|
PLACEMENT: POPOVER_PLACEMENT.TOP,
|