@momentum-design/components 0.141.3 → 0.141.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 +107 -96
- package/dist/browser/index.js.map +2 -2
- package/dist/components/cardradio/cardradio.component.js +1 -1
- package/dist/components/stepperitem/index.d.ts +1 -0
- package/dist/components/stepperitem/index.js +1 -0
- package/dist/components/stepperitem/stepperitem.component.d.ts +9 -2
- package/dist/components/stepperitem/stepperitem.component.js +14 -2
- package/dist/components/stepperitem/stepperitem.constants.d.ts +1 -0
- package/dist/components/stepperitem/stepperitem.constants.js +1 -0
- package/dist/components/stepperitem/stepperitem.styles.js +14 -3
- package/dist/custom-elements.json +11 -6
- package/dist/react/stepperitem/index.d.ts +4 -1
- package/dist/react/stepperitem/index.js +3 -1
- package/package.json +1 -1
|
@@ -194,7 +194,7 @@ __decorate([
|
|
|
194
194
|
__metadata("design:type", Object)
|
|
195
195
|
], CardRadio.prototype, "checked", void 0);
|
|
196
196
|
__decorate([
|
|
197
|
-
property({ type: String }),
|
|
197
|
+
property({ type: String, reflect: true }),
|
|
198
198
|
__metadata("design:type", Object)
|
|
199
199
|
], CardRadio.prototype, "name", void 0);
|
|
200
200
|
export default CardRadio;
|
|
@@ -10,6 +10,7 @@ declare const StepperItem_base: import("../../utils/mixins/index.types").Constru
|
|
|
10
10
|
*
|
|
11
11
|
* - Use `mdc-stepperitem` for each stage of an `mdc-stepper` sequence, one item per step.
|
|
12
12
|
* - Use `mdc-stepperitem` `completed`, `current`, and `not-started` to reflect where the user is in the flow so status reads at a glance.
|
|
13
|
+
* - Use `mdc-stepperitem` `loading` when a step is processing and its completion percentage is unknown, such as generating a staffing plan.
|
|
13
14
|
* - Use `mdc-stepperitem` `error-current` or `error-incomplete` to flag a step with unresolved problems the user must fix before finishing.
|
|
14
15
|
*
|
|
15
16
|
* **When not to use**
|
|
@@ -21,16 +22,18 @@ declare const StepperItem_base: import("../../utils/mixins/index.types").Constru
|
|
|
21
22
|
* @tagname mdc-stepperitem
|
|
22
23
|
*
|
|
23
24
|
* @dependency mdc-icon
|
|
25
|
+
* @dependency mdc-spinner
|
|
24
26
|
* @dependency mdc-text
|
|
25
27
|
*
|
|
26
28
|
* @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.
|
|
27
29
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.
|
|
28
30
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.
|
|
29
31
|
*
|
|
30
|
-
* @csspart status-container - The container for the status icon or
|
|
32
|
+
* @csspart status-container - The container for the status icon, step number, or loading spinner.
|
|
31
33
|
* @csspart label-container - The container for the label and help text.
|
|
32
34
|
* @csspart help-text-container - The container for the help text and error icon when applicable.
|
|
33
35
|
* @csspart status-icon - The icon representing the status of the stepper item.
|
|
36
|
+
* @csspart status-spinner - The inset spinner displayed in place of the status indicator while loading.
|
|
34
37
|
* @csspart step-number - The text representing the step number.
|
|
35
38
|
* @csspart label - The text representing the label of the stepper item.
|
|
36
39
|
* @csspart help-text - The text providing additional information about the stepper item.
|
|
@@ -49,7 +52,10 @@ declare class StepperItem extends StepperItem_base {
|
|
|
49
52
|
*/
|
|
50
53
|
variant: VariantType;
|
|
51
54
|
/**
|
|
52
|
-
* The status of the stepper item
|
|
55
|
+
* The status of the stepper item: `completed`, `current`, `loading`, `not-started`, `error-current`, or `error-incomplete`.
|
|
56
|
+
* Loading replaces the indicator with an inset spinner and sets aria-busy without changing disabled.
|
|
57
|
+
* Consumers must include the loading state in the accessible label and provide application live regions
|
|
58
|
+
* when progress announcements are needed.
|
|
53
59
|
* @default 'not-started'
|
|
54
60
|
*/
|
|
55
61
|
status: StatusType;
|
|
@@ -107,6 +113,7 @@ declare class StepperItem extends StepperItem_base {
|
|
|
107
113
|
private handleKeyUp;
|
|
108
114
|
/**
|
|
109
115
|
* Renders the status icon based on the current status of the stepper item.
|
|
116
|
+
* - If the status is `loading`, it renders an inset spinner.
|
|
110
117
|
* - If the status is `completed`, it renders a check icon.
|
|
111
118
|
* - If the status is `current` or `error-current`, it renders a pencil icon.
|
|
112
119
|
* - If the status is `not-started` or `error-incomplete`, it renders the step number.
|
|
@@ -24,16 +24,18 @@ import { DEFAULT, STATUS, STATUS_ICON } from './stepperitem.constants';
|
|
|
24
24
|
* @tagname mdc-stepperitem
|
|
25
25
|
*
|
|
26
26
|
* @dependency mdc-icon
|
|
27
|
+
* @dependency mdc-spinner
|
|
27
28
|
* @dependency mdc-text
|
|
28
29
|
*
|
|
29
30
|
* @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.
|
|
30
31
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.
|
|
31
32
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.
|
|
32
33
|
*
|
|
33
|
-
* @csspart status-container - The container for the status icon or
|
|
34
|
+
* @csspart status-container - The container for the status icon, step number, or loading spinner.
|
|
34
35
|
* @csspart label-container - The container for the label and help text.
|
|
35
36
|
* @csspart help-text-container - The container for the help text and error icon when applicable.
|
|
36
37
|
* @csspart status-icon - The icon representing the status of the stepper item.
|
|
38
|
+
* @csspart status-spinner - The inset spinner displayed in place of the status indicator while loading.
|
|
37
39
|
* @csspart step-number - The text representing the step number.
|
|
38
40
|
* @csspart label - The text representing the label of the stepper item.
|
|
39
41
|
* @csspart help-text - The text providing additional information about the stepper item.
|
|
@@ -66,7 +68,10 @@ class StepperItem extends KeyDownHandledMixin(KeyToActionMixin(TabIndexMixin(Dis
|
|
|
66
68
|
*/
|
|
67
69
|
this.variant = DEFAULT.VARIANT;
|
|
68
70
|
/**
|
|
69
|
-
* The status of the stepper item
|
|
71
|
+
* The status of the stepper item: `completed`, `current`, `loading`, `not-started`, `error-current`, or `error-incomplete`.
|
|
72
|
+
* Loading replaces the indicator with an inset spinner and sets aria-busy without changing disabled.
|
|
73
|
+
* Consumers must include the loading state in the accessible label and provide application live regions
|
|
74
|
+
* when progress announcements are needed.
|
|
70
75
|
* @default 'not-started'
|
|
71
76
|
*/
|
|
72
77
|
this.status = DEFAULT.STATUS;
|
|
@@ -148,6 +153,7 @@ class StepperItem extends KeyDownHandledMixin(KeyToActionMixin(TabIndexMixin(Dis
|
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
155
|
* Renders the status icon based on the current status of the stepper item.
|
|
156
|
+
* - If the status is `loading`, it renders an inset spinner.
|
|
151
157
|
* - If the status is `completed`, it renders a check icon.
|
|
152
158
|
* - If the status is `current` or `error-current`, it renders a pencil icon.
|
|
153
159
|
* - If the status is `not-started` or `error-incomplete`, it renders the step number.
|
|
@@ -155,6 +161,9 @@ class StepperItem extends KeyDownHandledMixin(KeyToActionMixin(TabIndexMixin(Dis
|
|
|
155
161
|
* @returns A template literal that renders the status icon based on the current status of the stepper item.
|
|
156
162
|
*/
|
|
157
163
|
renderStatusIcon() {
|
|
164
|
+
if (this.status === STATUS.LOADING) {
|
|
165
|
+
return html `<mdc-spinner part="status-spinner"></mdc-spinner>`;
|
|
166
|
+
}
|
|
158
167
|
if (this.status === STATUS.COMPLETED) {
|
|
159
168
|
return html `<mdc-icon part="status-icon" name=${STATUS_ICON.COMPLETED} length-unit="rem" size="1"></mdc-icon>`;
|
|
160
169
|
}
|
|
@@ -193,6 +202,9 @@ class StepperItem extends KeyDownHandledMixin(KeyToActionMixin(TabIndexMixin(Dis
|
|
|
193
202
|
}
|
|
194
203
|
update(changedProperties) {
|
|
195
204
|
super.update(changedProperties);
|
|
205
|
+
if (changedProperties.has('status')) {
|
|
206
|
+
this.ariaBusy = this.status === STATUS.LOADING ? 'true' : null;
|
|
207
|
+
}
|
|
196
208
|
if (changedProperties.has('disabled')) {
|
|
197
209
|
this.tabIndex = this.disabled ? -1 : 0;
|
|
198
210
|
this.classList.remove('pressed');
|
|
@@ -7,6 +7,7 @@ declare const VARIANT: {
|
|
|
7
7
|
declare const STATUS: {
|
|
8
8
|
readonly COMPLETED: "completed";
|
|
9
9
|
readonly CURRENT: "current";
|
|
10
|
+
readonly LOADING: "loading";
|
|
10
11
|
readonly ERROR_CURRENT: "error-current";
|
|
11
12
|
readonly ERROR_INCOMPLETE: "error-incomplete";
|
|
12
13
|
readonly NOT_STARTED: "not-started";
|
|
@@ -41,6 +41,10 @@ const styles = css `
|
|
|
41
41
|
color: var(--mdc-stepperitem-label-color);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
:host::part(status-spinner) {
|
|
45
|
+
--mdc-spinner-size: 1rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
:host::part(label-container) {
|
|
45
49
|
background-color: var(--mdc-stepperitem-label-container-background);
|
|
46
50
|
border-radius: 0.5rem;
|
|
@@ -67,7 +71,8 @@ const styles = css `
|
|
|
67
71
|
:host([status='completed'])::part(status-icon) {
|
|
68
72
|
--mdc-icon-fill-color: var(--mds-color-theme-inverted-text-primary-normal);
|
|
69
73
|
}
|
|
70
|
-
:host([status='current'])::part(status-container)
|
|
74
|
+
:host([status='current'])::part(status-container),
|
|
75
|
+
:host([status='loading'])::part(status-container) {
|
|
71
76
|
--mdc-stepperitem-status-container-border-color: var(--mds-color-theme-control-active-normal);
|
|
72
77
|
}
|
|
73
78
|
:host([status='error-current'])::part(status-container) {
|
|
@@ -100,11 +105,13 @@ const styles = css `
|
|
|
100
105
|
--mdc-stepperitem-status-container-background: var(--mds-color-theme-control-active-active);
|
|
101
106
|
}
|
|
102
107
|
|
|
103
|
-
:host([status='current']:hover)::part(status-container)
|
|
108
|
+
:host([status='current']:hover)::part(status-container),
|
|
109
|
+
:host([status='loading']:hover)::part(status-container) {
|
|
104
110
|
--mdc-stepperitem-status-container-background: var(--mds-color-theme-outline-secondary-normal);
|
|
105
111
|
--mdc-stepperitem-status-container-border-color: var(--mds-color-theme-control-active-hover);
|
|
106
112
|
}
|
|
107
|
-
:host([status='current']:active)::part(status-container)
|
|
113
|
+
:host([status='current']:active)::part(status-container),
|
|
114
|
+
:host([status='loading']:active)::part(status-container) {
|
|
108
115
|
--mdc-stepperitem-status-container-background: var(--mds-color-theme-background-secondary-active);
|
|
109
116
|
--mdc-stepperitem-status-container-border-color: var(--mds-color-theme-control-active-hover);
|
|
110
117
|
}
|
|
@@ -202,5 +209,9 @@ const styles = css `
|
|
|
202
209
|
:host([disabled][status='completed'])::part(status-icon) {
|
|
203
210
|
--mdc-icon-fill-color: var(--mds-color-theme-inverted-text-primary-disabled);
|
|
204
211
|
}
|
|
212
|
+
|
|
213
|
+
:host([disabled])::part(status-spinner) {
|
|
214
|
+
--mdc-spinner-default-color: var(--mds-color-theme-text-primary-disabled);
|
|
215
|
+
}
|
|
205
216
|
`;
|
|
206
217
|
export default [hostFitContentStyles, styles, ...hostFocusRingStyles()];
|
|
@@ -10568,7 +10568,8 @@
|
|
|
10568
10568
|
},
|
|
10569
10569
|
"default": "''",
|
|
10570
10570
|
"description": "The name of the radio group. Cards with the same name are grouped together,\nensuring only one card in the group can be selected at a time.",
|
|
10571
|
-
"attribute": "name"
|
|
10571
|
+
"attribute": "name",
|
|
10572
|
+
"reflects": true
|
|
10572
10573
|
},
|
|
10573
10574
|
{
|
|
10574
10575
|
"kind": "field",
|
|
@@ -49613,7 +49614,7 @@
|
|
|
49613
49614
|
],
|
|
49614
49615
|
"cssParts": [
|
|
49615
49616
|
{
|
|
49616
|
-
"description": "The container for the status icon or
|
|
49617
|
+
"description": "The container for the status icon, step number, or loading spinner.",
|
|
49617
49618
|
"name": "status-container"
|
|
49618
49619
|
},
|
|
49619
49620
|
{
|
|
@@ -49628,6 +49629,10 @@
|
|
|
49628
49629
|
"description": "The icon representing the status of the stepper item.",
|
|
49629
49630
|
"name": "status-icon"
|
|
49630
49631
|
},
|
|
49632
|
+
{
|
|
49633
|
+
"description": "The inset spinner displayed in place of the status indicator while loading.",
|
|
49634
|
+
"name": "status-spinner"
|
|
49635
|
+
},
|
|
49631
49636
|
{
|
|
49632
49637
|
"description": "The text representing the step number.",
|
|
49633
49638
|
"name": "step-number"
|
|
@@ -49748,7 +49753,7 @@
|
|
|
49748
49753
|
"kind": "method",
|
|
49749
49754
|
"name": "renderStatusIcon",
|
|
49750
49755
|
"privacy": "private",
|
|
49751
|
-
"description": "Renders the status icon based on the current status of the stepper item.\n- If the status is `completed`, it renders a check icon.\n- If the status is `current` or `error-current`, it renders a pencil icon.\n- If the status is `not-started` or `error-incomplete`, it renders the step number.\n- If the status is anything else, it renders nothing.",
|
|
49756
|
+
"description": "Renders the status icon based on the current status of the stepper item.\n- If the status is `loading`, it renders an inset spinner.\n- If the status is `completed`, it renders a check icon.\n- If the status is `current` or `error-current`, it renders a pencil icon.\n- If the status is `not-started` or `error-incomplete`, it renders the step number.\n- If the status is anything else, it renders nothing.",
|
|
49752
49757
|
"return": {
|
|
49753
49758
|
"type": {
|
|
49754
49759
|
"text": ""
|
|
@@ -49761,7 +49766,7 @@
|
|
|
49761
49766
|
"type": {
|
|
49762
49767
|
"text": "StatusType"
|
|
49763
49768
|
},
|
|
49764
|
-
"description": "The status of the stepper item
|
|
49769
|
+
"description": "The status of the stepper item: `completed`, `current`, `loading`, `not-started`, `error-current`, or `error-incomplete`.\nLoading replaces the indicator with an inset spinner and sets aria-busy without changing disabled.\nConsumers must include the loading state in the accessible label and provide application live regions\nwhen progress announcements are needed.",
|
|
49765
49770
|
"default": "'not-started'",
|
|
49766
49771
|
"attribute": "status",
|
|
49767
49772
|
"reflects": true
|
|
@@ -49842,7 +49847,7 @@
|
|
|
49842
49847
|
"type": {
|
|
49843
49848
|
"text": "StatusType"
|
|
49844
49849
|
},
|
|
49845
|
-
"description": "The status of the stepper item
|
|
49850
|
+
"description": "The status of the stepper item: `completed`, `current`, `loading`, `not-started`, `error-current`, or `error-incomplete`.\nLoading replaces the indicator with an inset spinner and sets aria-busy without changing disabled.\nConsumers must include the loading state in the accessible label and provide application live regions\nwhen progress announcements are needed.",
|
|
49846
49851
|
"default": "'not-started'",
|
|
49847
49852
|
"fieldName": "status"
|
|
49848
49853
|
},
|
|
@@ -49923,7 +49928,7 @@
|
|
|
49923
49928
|
"module": "/src/models"
|
|
49924
49929
|
},
|
|
49925
49930
|
"tagName": "mdc-stepperitem",
|
|
49926
|
-
"jsDoc": "/**\n * @tagname mdc-stepperitem\n *\n * @dependency mdc-icon\n * @dependency mdc-text\n *\n * @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.\n *\n * @csspart status-container - The container for the status icon or
|
|
49931
|
+
"jsDoc": "/**\n * @tagname mdc-stepperitem\n *\n * @dependency mdc-icon\n * @dependency mdc-spinner\n * @dependency mdc-text\n *\n * @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.\n *\n * @csspart status-container - The container for the status icon, step number, or loading spinner.\n * @csspart label-container - The container for the label and help text.\n * @csspart help-text-container - The container for the help text and error icon when applicable.\n * @csspart status-icon - The icon representing the status of the stepper item.\n * @csspart status-spinner - The inset spinner displayed in place of the status indicator while loading.\n * @csspart step-number - The text representing the step number.\n * @csspart label - The text representing the label of the stepper item.\n * @csspart help-text - The text providing additional information about the stepper item.\n * @csspart help-icon - The icon representing an error in the stepper item.\n *\n * @cssproperty --mdc-stepperitem-status-container-background - The background color of the status container.\n * @cssproperty --mdc-stepperitem-status-container-border-color - The border color of the status container.\n * @cssproperty --mdc-stepperitem-label-color - The color of the label text.\n * @cssproperty --mdc-stepperitem-help-text-color - The color of the optional label text.\n * @cssproperty --mdc-stepperitem-label-container-background - The background color of the label container.\n */",
|
|
49927
49932
|
"customElement": true
|
|
49928
49933
|
}
|
|
49929
49934
|
],
|
|
@@ -8,6 +8,7 @@ import type { Events } from '../../components/stepperitem/stepperitem.types';
|
|
|
8
8
|
*
|
|
9
9
|
* - Use `mdc-stepperitem` for each stage of an `mdc-stepper` sequence, one item per step.
|
|
10
10
|
* - Use `mdc-stepperitem` `completed`, `current`, and `not-started` to reflect where the user is in the flow so status reads at a glance.
|
|
11
|
+
* - Use `mdc-stepperitem` `loading` when a step is processing and its completion percentage is unknown, such as generating a staffing plan.
|
|
11
12
|
* - Use `mdc-stepperitem` `error-current` or `error-incomplete` to flag a step with unresolved problems the user must fix before finishing.
|
|
12
13
|
*
|
|
13
14
|
* **When not to use**
|
|
@@ -19,16 +20,18 @@ import type { Events } from '../../components/stepperitem/stepperitem.types';
|
|
|
19
20
|
* @tagname mdc-stepperitem
|
|
20
21
|
*
|
|
21
22
|
* @dependency mdc-icon
|
|
23
|
+
* @dependency mdc-spinner
|
|
22
24
|
* @dependency mdc-text
|
|
23
25
|
*
|
|
24
26
|
* @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.
|
|
25
27
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.
|
|
26
28
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.
|
|
27
29
|
*
|
|
28
|
-
* @csspart status-container - The container for the status icon or
|
|
30
|
+
* @csspart status-container - The container for the status icon, step number, or loading spinner.
|
|
29
31
|
* @csspart label-container - The container for the label and help text.
|
|
30
32
|
* @csspart help-text-container - The container for the help text and error icon when applicable.
|
|
31
33
|
* @csspart status-icon - The icon representing the status of the stepper item.
|
|
34
|
+
* @csspart status-spinner - The inset spinner displayed in place of the status indicator while loading.
|
|
32
35
|
* @csspart step-number - The text representing the step number.
|
|
33
36
|
* @csspart label - The text representing the label of the stepper item.
|
|
34
37
|
* @csspart help-text - The text providing additional information about the stepper item.
|
|
@@ -6,16 +6,18 @@ import { TAG_NAME } from '../../components/stepperitem/stepperitem.constants';
|
|
|
6
6
|
* @tagname mdc-stepperitem
|
|
7
7
|
*
|
|
8
8
|
* @dependency mdc-icon
|
|
9
|
+
* @dependency mdc-spinner
|
|
9
10
|
* @dependency mdc-text
|
|
10
11
|
*
|
|
11
12
|
* @event click - (React: onClick) This event is dispatched when the stepperitem is clicked.
|
|
12
13
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the stepperitem.
|
|
13
14
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the stepperitem.
|
|
14
15
|
*
|
|
15
|
-
* @csspart status-container - The container for the status icon or
|
|
16
|
+
* @csspart status-container - The container for the status icon, step number, or loading spinner.
|
|
16
17
|
* @csspart label-container - The container for the label and help text.
|
|
17
18
|
* @csspart help-text-container - The container for the help text and error icon when applicable.
|
|
18
19
|
* @csspart status-icon - The icon representing the status of the stepper item.
|
|
20
|
+
* @csspart status-spinner - The inset spinner displayed in place of the status indicator while loading.
|
|
19
21
|
* @csspart step-number - The text representing the step number.
|
|
20
22
|
* @csspart label - The text representing the label of the stepper item.
|
|
21
23
|
* @csspart help-text - The text providing additional information about the stepper item.
|