@patternfly/react-core 4.227.1 → 4.227.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/CHANGELOG.md +24 -0
- package/dist/esm/components/DataList/DataList.d.ts +0 -2
- package/dist/esm/components/DataList/DataList.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataList.js.map +1 -1
- package/dist/esm/components/DataList/DataListItem.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataListItem.js +1 -2
- package/dist/esm/components/DataList/DataListItem.js.map +1 -1
- package/dist/js/components/DataList/DataList.d.ts +0 -2
- package/dist/js/components/DataList/DataList.d.ts.map +1 -1
- package/dist/js/components/DataList/DataList.js.map +1 -1
- package/dist/js/components/DataList/DataListItem.d.ts.map +1 -1
- package/dist/js/components/DataList/DataListItem.js +1 -2
- package/dist/js/components/DataList/DataListItem.js.map +1 -1
- package/dist/umd/react-core.js +1 -2
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/DataList/DataList.tsx +0 -2
- package/src/components/DataList/DataListItem.tsx +1 -3
- package/src/components/DataList/__tests__/DataList.test.tsx +14 -32
- package/src/components/DataList/examples/DataListSelectableRows.tsx +1 -1
- package/src/components/Menu/examples/Menu.md +19 -1290
- package/src/components/Menu/examples/MenuBasic.tsx +51 -0
- package/src/components/Menu/examples/MenuFilteringWithTextInput.tsx +52 -0
- package/src/components/Menu/examples/MenuOptionMultiSelect.tsx +30 -0
- package/src/components/Menu/examples/MenuOptionSingleSelect.tsx +27 -0
- package/src/components/Menu/examples/MenuScrollable.tsx +48 -0
- package/src/components/Menu/examples/MenuScrollableCustomMenuHeight.tsx +48 -0
- package/src/components/Menu/examples/MenuWithActions.tsx +75 -0
- package/src/components/Menu/examples/MenuWithCheckbox.tsx +2 -2
- package/src/components/Menu/examples/MenuWithDescription.tsx +35 -0
- package/src/components/Menu/examples/{MenuDrilldown.tsx → MenuWithDrilldown.tsx} +1 -1
- package/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx +331 -0
- package/src/components/Menu/examples/{MenuDrilldownInitialState.tsx → MenuWithDrilldownInitialState.tsx} +0 -0
- package/src/components/Menu/examples/{MenuDrilldownSubmenuFunctions.tsx → MenuWithDrilldownSubmenuFunctions.tsx} +1 -1
- package/src/components/Menu/examples/MenuWithFavorites.tsx +104 -0
- package/src/components/Menu/examples/MenuWithFooter.tsx +40 -0
- package/src/components/Menu/examples/MenuWithIcons.tsx +33 -0
- package/src/components/Menu/examples/MenuWithLinks.tsx +30 -0
- package/src/components/Menu/examples/MenuWithSeparators.tsx +26 -0
- package/src/components/Menu/examples/MenuWithTitledGroups.tsx +46 -0
- package/src/components/Menu/examples/MenuWithViewMore.tsx +118 -0
- package/src/components/ProgressStepper/examples/ProgressStepper.md +13 -356
- package/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx +21 -0
- package/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx +48 -0
- package/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx +48 -0
- package/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx +59 -0
- package/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx +35 -0
- package/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx +51 -0
- package/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx +35 -0
- package/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx +62 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Menu, MenuList, MenuItem, MenuContent, Spinner } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const MenuWithViewMore: React.FunctionComponent = () => {
|
|
5
|
+
const [activeItem, setActiveItem] = React.useState<number | string>(0);
|
|
6
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
7
|
+
const [numOptions, setNumOptions] = React.useState(3);
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
const [menuOptions, setMenuOptions] = React.useState([
|
|
10
|
+
<MenuItem key={0} itemId={'view-more-0'}>
|
|
11
|
+
Action
|
|
12
|
+
</MenuItem>,
|
|
13
|
+
<MenuItem
|
|
14
|
+
key={1}
|
|
15
|
+
itemId={'view-more-1'}
|
|
16
|
+
to="#default-link2"
|
|
17
|
+
// just for demo so that navigation is not triggered
|
|
18
|
+
onClick={event => event.preventDefault()}
|
|
19
|
+
>
|
|
20
|
+
Link
|
|
21
|
+
</MenuItem>,
|
|
22
|
+
<MenuItem key={2} itemId="view-more-2" isDisabled>
|
|
23
|
+
Disabled action
|
|
24
|
+
</MenuItem>,
|
|
25
|
+
<MenuItem key={3} itemId="view-more-3" isDisabled to="#default-link4">
|
|
26
|
+
Disabled link
|
|
27
|
+
</MenuItem>,
|
|
28
|
+
<MenuItem key={4} itemId="view-more-4">
|
|
29
|
+
Action 2
|
|
30
|
+
</MenuItem>,
|
|
31
|
+
<MenuItem key={5} itemId="view-more-5">
|
|
32
|
+
Action 3
|
|
33
|
+
</MenuItem>,
|
|
34
|
+
<MenuItem key={6} itemId="view-more-6">
|
|
35
|
+
Action 4
|
|
36
|
+
</MenuItem>,
|
|
37
|
+
<MenuItem key={7} itemId="view-more-7">
|
|
38
|
+
Action 5
|
|
39
|
+
</MenuItem>,
|
|
40
|
+
<MenuItem key={8} itemId="view-more-8">
|
|
41
|
+
Final option
|
|
42
|
+
</MenuItem>
|
|
43
|
+
]);
|
|
44
|
+
const [visibleOptions, setVisibleOptions] = React.useState(menuOptions.slice(0, numOptions));
|
|
45
|
+
|
|
46
|
+
const activeItemRef = React.useRef<HTMLElement>(null);
|
|
47
|
+
const viewMoreRef = React.useRef<HTMLElement>(null);
|
|
48
|
+
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
activeItemRef.current?.focus();
|
|
51
|
+
}, [visibleOptions]);
|
|
52
|
+
|
|
53
|
+
const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, itemId: number | string | undefined) => {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.log(`clicked ${itemId}`);
|
|
56
|
+
setActiveItem(itemId as string);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const simulateNetworkCall = (networkCallback: () => void) => {
|
|
60
|
+
setTimeout(networkCallback, 2000);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const getNextValidItem = (startingIndex: number, maxLength: number) => {
|
|
64
|
+
let validItem;
|
|
65
|
+
for (let i = startingIndex; i < maxLength; i++) {
|
|
66
|
+
if (menuOptions[i].props.isDisabled) {
|
|
67
|
+
continue;
|
|
68
|
+
} else {
|
|
69
|
+
validItem = menuOptions[i];
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return validItem;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const loadMoreOptions = () => {
|
|
77
|
+
const newLength = numOptions + 3 <= menuOptions.length ? numOptions + 3 : menuOptions.length;
|
|
78
|
+
const prevPosition = numOptions;
|
|
79
|
+
const nextValidItem = getNextValidItem(prevPosition, newLength);
|
|
80
|
+
|
|
81
|
+
setNumOptions(newLength);
|
|
82
|
+
setIsLoading(false);
|
|
83
|
+
setActiveItem(nextValidItem.props.itemId);
|
|
84
|
+
setVisibleOptions(menuOptions.slice(0, newLength));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const onViewMoreClick = () => {
|
|
88
|
+
setIsLoading(true);
|
|
89
|
+
simulateNetworkCall(() => {
|
|
90
|
+
loadMoreOptions();
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Menu activeItemId={activeItem} onSelect={onSelect}>
|
|
96
|
+
<MenuContent>
|
|
97
|
+
<MenuList>
|
|
98
|
+
{visibleOptions.map(option => {
|
|
99
|
+
const props = option.props;
|
|
100
|
+
|
|
101
|
+
return <MenuItem key={option.key} ref={props.itemId === activeItem ? activeItemRef : null} {...props} />;
|
|
102
|
+
})}
|
|
103
|
+
{numOptions !== menuOptions.length && (
|
|
104
|
+
<MenuItem
|
|
105
|
+
{...(!isLoading && { isLoadButton: true })}
|
|
106
|
+
{...(isLoading && { isLoading: true })}
|
|
107
|
+
onClick={onViewMoreClick}
|
|
108
|
+
itemId="loader"
|
|
109
|
+
ref={viewMoreRef}
|
|
110
|
+
>
|
|
111
|
+
{isLoading ? <Spinner size="lg" /> : 'View more'}
|
|
112
|
+
</MenuItem>
|
|
113
|
+
)}
|
|
114
|
+
</MenuList>
|
|
115
|
+
</MenuContent>
|
|
116
|
+
</Menu>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
@@ -15,387 +15,44 @@ Progress steppers have default icons associated with the `variant` property, and
|
|
|
15
15
|
|
|
16
16
|
### Basic
|
|
17
17
|
|
|
18
|
-
```
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
21
|
-
|
|
22
|
-
<ProgressStepper>
|
|
23
|
-
<ProgressStep
|
|
24
|
-
variant="success"
|
|
25
|
-
id="basic-step1"
|
|
26
|
-
titleId="basic-step1-title"
|
|
27
|
-
aria-label="completed step, step with success"
|
|
28
|
-
>
|
|
29
|
-
First step
|
|
30
|
-
</ProgressStep>
|
|
31
|
-
<ProgressStep
|
|
32
|
-
variant="info"
|
|
33
|
-
isCurrent
|
|
34
|
-
id="basic-step2"
|
|
35
|
-
titleId="basic-step2-title"
|
|
36
|
-
aria-label="step with info"
|
|
37
|
-
>
|
|
38
|
-
Second step
|
|
39
|
-
</ProgressStep>
|
|
40
|
-
<ProgressStep variant="pending" id="basic-step3" titleId="basic-step3-title" aria-label="pending step">
|
|
41
|
-
Third step
|
|
42
|
-
</ProgressStep>
|
|
43
|
-
</ProgressStepper>;
|
|
18
|
+
```ts file="ProgressStepperBasic.tsx"
|
|
44
19
|
```
|
|
45
20
|
|
|
46
|
-
###
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
import React from 'react';
|
|
50
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
21
|
+
### With step descriptions
|
|
51
22
|
|
|
52
|
-
|
|
53
|
-
<ProgressStep
|
|
54
|
-
variant="success"
|
|
55
|
-
description="This is the first thing to happen"
|
|
56
|
-
id="basic-desc-step1"
|
|
57
|
-
titleId="basic-desc-step1-title"
|
|
58
|
-
aria-label="completed step, step with success"
|
|
59
|
-
>
|
|
60
|
-
First step
|
|
61
|
-
</ProgressStep>
|
|
62
|
-
<ProgressStep
|
|
63
|
-
variant="info"
|
|
64
|
-
isCurrent
|
|
65
|
-
description="This is the second thing to happen"
|
|
66
|
-
id="basic-desc-step2"
|
|
67
|
-
titleId="basic-desc-step2-title"
|
|
68
|
-
aria-label="step with info"
|
|
69
|
-
>
|
|
70
|
-
Second step
|
|
71
|
-
</ProgressStep>
|
|
72
|
-
<ProgressStep
|
|
73
|
-
variant="pending"
|
|
74
|
-
description="This is the last thing to happen"
|
|
75
|
-
id="basic-desc-step3"
|
|
76
|
-
titleId="basic-desc-step3-title"
|
|
77
|
-
aria-label="pending step"
|
|
78
|
-
>
|
|
79
|
-
Third step
|
|
80
|
-
</ProgressStep>
|
|
81
|
-
</ProgressStepper>;
|
|
23
|
+
```ts file="ProgressStepperBasicWithDescription.tsx"
|
|
82
24
|
```
|
|
83
25
|
|
|
84
|
-
###
|
|
85
|
-
|
|
86
|
-
```js
|
|
87
|
-
import React from 'react';
|
|
88
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
89
|
-
|
|
90
|
-
<ProgressStepper isCenterAligned>
|
|
91
|
-
<ProgressStep
|
|
92
|
-
variant="success"
|
|
93
|
-
description="This is the first thing to happen"
|
|
94
|
-
id="center-desc-step1"
|
|
95
|
-
titleId="center-desc-step1-title"
|
|
96
|
-
aria-label="completed step, step with success"
|
|
97
|
-
>
|
|
98
|
-
First step
|
|
99
|
-
</ProgressStep>
|
|
100
|
-
<ProgressStep
|
|
101
|
-
variant="info"
|
|
102
|
-
isCurrent
|
|
103
|
-
description="This is the second thing to happen"
|
|
104
|
-
id="center-desc-step2"
|
|
105
|
-
titleId="center-desc-step2-title"
|
|
106
|
-
aria-label="step with info"
|
|
107
|
-
>
|
|
108
|
-
Second step
|
|
109
|
-
</ProgressStep>
|
|
110
|
-
<ProgressStep
|
|
111
|
-
variant="pending"
|
|
112
|
-
description="This is the last thing to happen"
|
|
113
|
-
id="center-desc-step3"
|
|
114
|
-
titleId="center-desc-step3-title"
|
|
115
|
-
aria-label="pending step"
|
|
116
|
-
>
|
|
117
|
-
Third step
|
|
118
|
-
</ProgressStep>
|
|
119
|
-
</ProgressStepper>;
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Vertical with descriptions
|
|
123
|
-
|
|
124
|
-
```js
|
|
125
|
-
import React from 'react';
|
|
126
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
26
|
+
### With alignment
|
|
127
27
|
|
|
128
|
-
|
|
129
|
-
<ProgressStep
|
|
130
|
-
variant="success"
|
|
131
|
-
description="This is the first thing to happen"
|
|
132
|
-
id="vertical-desc-step1"
|
|
133
|
-
titleId="vertical-desc-step1-title"
|
|
134
|
-
aria-label="completed step, step with success"
|
|
135
|
-
>
|
|
136
|
-
First step
|
|
137
|
-
</ProgressStep>
|
|
138
|
-
<ProgressStep
|
|
139
|
-
variant="info"
|
|
140
|
-
isCurrent
|
|
141
|
-
description="This is the second thing to happen"
|
|
142
|
-
id="vertical-desc-step2"
|
|
143
|
-
titleId="vertical-desc-step2-title"
|
|
144
|
-
aria-label="step with info"
|
|
145
|
-
>
|
|
146
|
-
Second step
|
|
147
|
-
</ProgressStep>
|
|
148
|
-
<ProgressStep
|
|
149
|
-
variant="pending"
|
|
150
|
-
description="This is the last thing to happen"
|
|
151
|
-
id="vertical-desc-step3"
|
|
152
|
-
titleId="vertical-desc-step3-title"
|
|
153
|
-
aria-label="pending step"
|
|
154
|
-
>
|
|
155
|
-
Third step
|
|
156
|
-
</ProgressStep>
|
|
157
|
-
</ProgressStepper>;
|
|
28
|
+
```ts file="ProgressStepperBasicWithAlignment.tsx"
|
|
158
29
|
```
|
|
159
30
|
|
|
160
31
|
### Compact
|
|
161
32
|
|
|
162
33
|
Compact progress steppers will only display the current step's `title`, and will not display any steps' `description` texts.
|
|
163
34
|
|
|
164
|
-
```
|
|
165
|
-
import React from 'react';
|
|
166
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
167
|
-
|
|
168
|
-
<ProgressStepper isCompact>
|
|
169
|
-
<ProgressStep
|
|
170
|
-
variant="success"
|
|
171
|
-
id="compact-step1"
|
|
172
|
-
titleId="compact-step1-title"
|
|
173
|
-
aria-label="completed step, step with success"
|
|
174
|
-
>
|
|
175
|
-
First step
|
|
176
|
-
</ProgressStep>
|
|
177
|
-
<ProgressStep
|
|
178
|
-
variant="info"
|
|
179
|
-
isCurrent
|
|
180
|
-
id="compact-step2"
|
|
181
|
-
titleId="compact-step2-title"
|
|
182
|
-
aria-label="step with info"
|
|
183
|
-
>
|
|
184
|
-
Second step
|
|
185
|
-
</ProgressStep>
|
|
186
|
-
<ProgressStep variant="pending" id="compact-step3" titleId="compact-step3-title" aria-label="pending step">
|
|
187
|
-
Third step
|
|
188
|
-
</ProgressStep>
|
|
189
|
-
</ProgressStepper>;
|
|
35
|
+
```ts file="ProgressStepperCompact.tsx"
|
|
190
36
|
```
|
|
191
37
|
|
|
192
|
-
###
|
|
193
|
-
|
|
194
|
-
```js
|
|
195
|
-
import React from 'react';
|
|
196
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
38
|
+
### With an issue
|
|
197
39
|
|
|
198
|
-
|
|
199
|
-
<ProgressStep
|
|
200
|
-
variant="success"
|
|
201
|
-
id="basic-with-issue-step1"
|
|
202
|
-
titleId="basic-with-issue-step1-title"
|
|
203
|
-
aria-label="completed step, step with success"
|
|
204
|
-
>
|
|
205
|
-
First step
|
|
206
|
-
</ProgressStep>
|
|
207
|
-
<ProgressStep
|
|
208
|
-
variant="success"
|
|
209
|
-
id="basic-with-issue-step2"
|
|
210
|
-
titleId="basic-with-issue-step2-title"
|
|
211
|
-
aria-label="completed step, step with success"
|
|
212
|
-
>
|
|
213
|
-
Second step
|
|
214
|
-
</ProgressStep>
|
|
215
|
-
<ProgressStep
|
|
216
|
-
variant="warning"
|
|
217
|
-
id="basic-with-issue-step3"
|
|
218
|
-
titleId="basic-with-issue-step3-title"
|
|
219
|
-
aria-label="completed step, step with warning"
|
|
220
|
-
>
|
|
221
|
-
Third step
|
|
222
|
-
</ProgressStep>
|
|
223
|
-
<ProgressStep
|
|
224
|
-
variant="info"
|
|
225
|
-
isCurrent
|
|
226
|
-
id="basic-with-issue-step4"
|
|
227
|
-
titleId="basic-with-issue-step4-title"
|
|
228
|
-
aria-label="step with info"
|
|
229
|
-
>
|
|
230
|
-
Fourth step
|
|
231
|
-
</ProgressStep>
|
|
232
|
-
<ProgressStep
|
|
233
|
-
variant="pending"
|
|
234
|
-
id="basic-with-issue-step5"
|
|
235
|
-
titleId="basic-with-issue-step5-title"
|
|
236
|
-
aria-label="pending step"
|
|
237
|
-
>
|
|
238
|
-
Fifth step
|
|
239
|
-
</ProgressStep>
|
|
240
|
-
</ProgressStepper>;
|
|
40
|
+
```ts file="ProgressStepperBasicIssue.tsx"
|
|
241
41
|
```
|
|
242
42
|
|
|
243
|
-
###
|
|
43
|
+
### With a failure
|
|
244
44
|
|
|
245
|
-
```
|
|
246
|
-
import React from 'react';
|
|
247
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
248
|
-
|
|
249
|
-
<ProgressStepper>
|
|
250
|
-
<ProgressStep
|
|
251
|
-
variant="success"
|
|
252
|
-
id="basic-with-failure-step1"
|
|
253
|
-
titleId="basic-with-failure-step1-title"
|
|
254
|
-
aria-label="completed step, step with success"
|
|
255
|
-
>
|
|
256
|
-
First step
|
|
257
|
-
</ProgressStep>
|
|
258
|
-
<ProgressStep
|
|
259
|
-
variant="success"
|
|
260
|
-
id="basic-with-failure-step2"
|
|
261
|
-
titleId="basic-with-failure-step2-title"
|
|
262
|
-
aria-label="completed step, step with success"
|
|
263
|
-
>
|
|
264
|
-
Second step
|
|
265
|
-
</ProgressStep>
|
|
266
|
-
<ProgressStep
|
|
267
|
-
variant="success"
|
|
268
|
-
id="basic-with-failure-step3"
|
|
269
|
-
titleId="basic-with-failure-step3-title"
|
|
270
|
-
aria-label="completed step, step with success"
|
|
271
|
-
>
|
|
272
|
-
Third step
|
|
273
|
-
</ProgressStep>
|
|
274
|
-
<ProgressStep
|
|
275
|
-
variant="danger"
|
|
276
|
-
isCurrent
|
|
277
|
-
id="basic-with-failure-step4"
|
|
278
|
-
titleId="basic-with-failure-step4-title"
|
|
279
|
-
aria-label="step with danger"
|
|
280
|
-
>
|
|
281
|
-
Fourth step
|
|
282
|
-
</ProgressStep>
|
|
283
|
-
<ProgressStep
|
|
284
|
-
variant="pending"
|
|
285
|
-
id="basic-with-failure-step5"
|
|
286
|
-
titleId="basic-with-failure-step5-title"
|
|
287
|
-
aria-label="pending step"
|
|
288
|
-
>
|
|
289
|
-
Fifth step
|
|
290
|
-
</ProgressStep>
|
|
291
|
-
</ProgressStepper>;
|
|
45
|
+
```ts file="ProgressStepperBasicFailure.tsx"
|
|
292
46
|
```
|
|
293
47
|
|
|
294
|
-
###
|
|
48
|
+
### With custom icons
|
|
295
49
|
|
|
296
|
-
```
|
|
297
|
-
import React from 'react';
|
|
298
|
-
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
299
|
-
import InProgressIcon from '@patternfly/react-icons/dist/esm/icons/in-progress-icon';
|
|
300
|
-
import PendingIcon from '@patternfly/react-icons/dist/esm/icons/pending-icon';
|
|
301
|
-
|
|
302
|
-
<ProgressStepper>
|
|
303
|
-
<ProgressStep
|
|
304
|
-
variant="success"
|
|
305
|
-
id="custom-step1"
|
|
306
|
-
titleId="custom-step1-title"
|
|
307
|
-
aria-label="completed step, step with success"
|
|
308
|
-
>
|
|
309
|
-
Successful completion
|
|
310
|
-
</ProgressStep>
|
|
311
|
-
<ProgressStep
|
|
312
|
-
isCurrent
|
|
313
|
-
icon={<InProgressIcon />}
|
|
314
|
-
id="custom-step2"
|
|
315
|
-
titleId="custom-step2-title"
|
|
316
|
-
aria-label="in progress"
|
|
317
|
-
>
|
|
318
|
-
In process
|
|
319
|
-
</ProgressStep>
|
|
320
|
-
<ProgressStep
|
|
321
|
-
variant="pending"
|
|
322
|
-
icon={<PendingIcon />}
|
|
323
|
-
id="custom-step3"
|
|
324
|
-
titleId="custom-step3-title"
|
|
325
|
-
aria-label="pending step"
|
|
326
|
-
>
|
|
327
|
-
Pending
|
|
328
|
-
</ProgressStep>
|
|
329
|
-
</ProgressStepper>;
|
|
50
|
+
```ts file="ProgressStepperCustomIcons.tsx"
|
|
330
51
|
```
|
|
331
52
|
|
|
332
53
|
### With help popover
|
|
333
54
|
|
|
334
55
|
To add a popover to a progress step, set the `popoverRender` properties on the `ProgressStep` component.
|
|
335
56
|
|
|
336
|
-
```
|
|
337
|
-
import React from 'react';
|
|
338
|
-
import { ProgressStepper, ProgressStep, Popover } from '@patternfly/react-core';
|
|
339
|
-
|
|
340
|
-
PopoverProgressStep = () => {
|
|
341
|
-
return (
|
|
342
|
-
<ProgressStepper>
|
|
343
|
-
<ProgressStep
|
|
344
|
-
variant="success"
|
|
345
|
-
id="popover-step1"
|
|
346
|
-
titleId="popover-step1-title"
|
|
347
|
-
aria-label="completed step with popover, step with success"
|
|
348
|
-
popoverRender={( stepRef ) => (
|
|
349
|
-
<Popover
|
|
350
|
-
aria-label="First step help"
|
|
351
|
-
headerContent={<div>First step popover</div>}
|
|
352
|
-
bodyContent={<div>Additional info or help text content.</div>}
|
|
353
|
-
reference={stepRef}
|
|
354
|
-
position="right"
|
|
355
|
-
/>
|
|
356
|
-
)}
|
|
357
|
-
>
|
|
358
|
-
First step
|
|
359
|
-
</ProgressStep>
|
|
360
|
-
<ProgressStep
|
|
361
|
-
variant="danger"
|
|
362
|
-
id="popover-step2"
|
|
363
|
-
titleId="popover-step2-title"
|
|
364
|
-
aria-label="completed step with popover, step with danger"
|
|
365
|
-
popoverRender={( stepRef ) => (
|
|
366
|
-
<Popover
|
|
367
|
-
aria-label="Second step help"
|
|
368
|
-
headerContent={<div>Second step popover</div>}
|
|
369
|
-
bodyContent={<div>Additional info or help text content.</div>}
|
|
370
|
-
reference={stepRef}
|
|
371
|
-
position="right"
|
|
372
|
-
/>
|
|
373
|
-
)}
|
|
374
|
-
>
|
|
375
|
-
Second step
|
|
376
|
-
</ProgressStep>
|
|
377
|
-
<ProgressStep
|
|
378
|
-
variant="info"
|
|
379
|
-
id="popover-step3"
|
|
380
|
-
titleId="popover-step3-title"
|
|
381
|
-
aria-label="step with popover"
|
|
382
|
-
popoverRender={(stepRef) => (
|
|
383
|
-
<Popover
|
|
384
|
-
aria-label="Third step help"
|
|
385
|
-
headerContent={<div>Third step popover</div>}
|
|
386
|
-
bodyContent={<div>Additional info or help text content.</div>}
|
|
387
|
-
reference={stepRef}
|
|
388
|
-
position="right"
|
|
389
|
-
/>
|
|
390
|
-
)}
|
|
391
|
-
isCurrent
|
|
392
|
-
>
|
|
393
|
-
Third step
|
|
394
|
-
</ProgressStep>
|
|
395
|
-
<ProgressStep variant="pending" id="popover-step4" titleId="popover-step4-title" aria-label="pending step">
|
|
396
|
-
Fourth step
|
|
397
|
-
</ProgressStep>
|
|
398
|
-
</ProgressStepper>
|
|
399
|
-
);
|
|
400
|
-
};
|
|
57
|
+
```ts file="ProgressStepperHelpPopover.tsx"
|
|
401
58
|
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ProgressStepperBasic: React.FunctionComponent = () => (
|
|
5
|
+
<ProgressStepper>
|
|
6
|
+
<ProgressStep
|
|
7
|
+
variant="success"
|
|
8
|
+
id="basic-step1"
|
|
9
|
+
titleId="basic-step1-title"
|
|
10
|
+
aria-label="completed step, step with success"
|
|
11
|
+
>
|
|
12
|
+
First step
|
|
13
|
+
</ProgressStep>
|
|
14
|
+
<ProgressStep variant="info" isCurrent id="basic-step2" titleId="basic-step2-title" aria-label="step with info">
|
|
15
|
+
Second step
|
|
16
|
+
</ProgressStep>
|
|
17
|
+
<ProgressStep variant="pending" id="basic-step3" titleId="basic-step3-title" aria-label="pending step">
|
|
18
|
+
Third step
|
|
19
|
+
</ProgressStep>
|
|
20
|
+
</ProgressStepper>
|
|
21
|
+
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ProgressStepperBasicFailure: React.FunctionComponent = () => (
|
|
5
|
+
<ProgressStepper>
|
|
6
|
+
<ProgressStep
|
|
7
|
+
variant="success"
|
|
8
|
+
id="basic-with-failure-step1"
|
|
9
|
+
titleId="basic-with-failure-step1-title"
|
|
10
|
+
aria-label="completed step, step with success"
|
|
11
|
+
>
|
|
12
|
+
First step
|
|
13
|
+
</ProgressStep>
|
|
14
|
+
<ProgressStep
|
|
15
|
+
variant="success"
|
|
16
|
+
id="basic-with-failure-step2"
|
|
17
|
+
titleId="basic-with-failure-step2-title"
|
|
18
|
+
aria-label="completed step, step with success"
|
|
19
|
+
>
|
|
20
|
+
Second step
|
|
21
|
+
</ProgressStep>
|
|
22
|
+
<ProgressStep
|
|
23
|
+
variant="success"
|
|
24
|
+
id="basic-with-failure-step3"
|
|
25
|
+
titleId="basic-with-failure-step3-title"
|
|
26
|
+
aria-label="completed step, step with success"
|
|
27
|
+
>
|
|
28
|
+
Third step
|
|
29
|
+
</ProgressStep>
|
|
30
|
+
<ProgressStep
|
|
31
|
+
variant="danger"
|
|
32
|
+
isCurrent
|
|
33
|
+
id="basic-with-failure-step4"
|
|
34
|
+
titleId="basic-with-failure-step4-title"
|
|
35
|
+
aria-label="step with danger"
|
|
36
|
+
>
|
|
37
|
+
Fourth step
|
|
38
|
+
</ProgressStep>
|
|
39
|
+
<ProgressStep
|
|
40
|
+
variant="pending"
|
|
41
|
+
id="basic-with-failure-step5"
|
|
42
|
+
titleId="basic-with-failure-step5-title"
|
|
43
|
+
aria-label="pending step"
|
|
44
|
+
>
|
|
45
|
+
Fifth step
|
|
46
|
+
</ProgressStep>
|
|
47
|
+
</ProgressStepper>
|
|
48
|
+
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ProgressStepperBasicIssue: React.FunctionComponent = () => (
|
|
5
|
+
<ProgressStepper>
|
|
6
|
+
<ProgressStep
|
|
7
|
+
variant="success"
|
|
8
|
+
id="basic-with-issue-step1"
|
|
9
|
+
titleId="basic-with-issue-step1-title"
|
|
10
|
+
aria-label="completed step, step with success"
|
|
11
|
+
>
|
|
12
|
+
First step
|
|
13
|
+
</ProgressStep>
|
|
14
|
+
<ProgressStep
|
|
15
|
+
variant="success"
|
|
16
|
+
id="basic-with-issue-step2"
|
|
17
|
+
titleId="basic-with-issue-step2-title"
|
|
18
|
+
aria-label="completed step, step with success"
|
|
19
|
+
>
|
|
20
|
+
Second step
|
|
21
|
+
</ProgressStep>
|
|
22
|
+
<ProgressStep
|
|
23
|
+
variant="warning"
|
|
24
|
+
id="basic-with-issue-step3"
|
|
25
|
+
titleId="basic-with-issue-step3-title"
|
|
26
|
+
aria-label="completed step, step with warning"
|
|
27
|
+
>
|
|
28
|
+
Third step
|
|
29
|
+
</ProgressStep>
|
|
30
|
+
<ProgressStep
|
|
31
|
+
variant="info"
|
|
32
|
+
isCurrent
|
|
33
|
+
id="basic-with-issue-step4"
|
|
34
|
+
titleId="basic-with-issue-step4-title"
|
|
35
|
+
aria-label="step with info"
|
|
36
|
+
>
|
|
37
|
+
Fourth step
|
|
38
|
+
</ProgressStep>
|
|
39
|
+
<ProgressStep
|
|
40
|
+
variant="pending"
|
|
41
|
+
id="basic-with-issue-step5"
|
|
42
|
+
titleId="basic-with-issue-step5-title"
|
|
43
|
+
aria-label="pending step"
|
|
44
|
+
>
|
|
45
|
+
Fifth step
|
|
46
|
+
</ProgressStep>
|
|
47
|
+
</ProgressStepper>
|
|
48
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressStepper, ProgressStep, Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ProgressStepperBasicWithAlignment: React.FunctionComponent = () => {
|
|
5
|
+
const [isVertical, setIsVertical] = React.useState(false);
|
|
6
|
+
const [isCenterAligned, setIsCenterAligned] = React.useState(false);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<React.Fragment>
|
|
10
|
+
<Checkbox
|
|
11
|
+
label="Vertical alignment"
|
|
12
|
+
isChecked={isVertical}
|
|
13
|
+
onChange={setIsVertical}
|
|
14
|
+
aria-label="Toggle vertical alignment"
|
|
15
|
+
id="toggle-vertical"
|
|
16
|
+
name="toggle-vertical"
|
|
17
|
+
/>
|
|
18
|
+
<Checkbox
|
|
19
|
+
label="Center alignment"
|
|
20
|
+
isChecked={isCenterAligned}
|
|
21
|
+
onChange={setIsCenterAligned}
|
|
22
|
+
aria-label="Toggle center alignment"
|
|
23
|
+
id="toggle-center"
|
|
24
|
+
name="toggle-center"
|
|
25
|
+
/>
|
|
26
|
+
<br />
|
|
27
|
+
<ProgressStepper isVertical={isVertical} isCenterAligned={isCenterAligned}>
|
|
28
|
+
<ProgressStep
|
|
29
|
+
variant="success"
|
|
30
|
+
description="This is the first thing to happen"
|
|
31
|
+
id="basic-alignment-step1"
|
|
32
|
+
titleId="basic-alignment-step1-title"
|
|
33
|
+
aria-label="completed step, step with success"
|
|
34
|
+
>
|
|
35
|
+
First step
|
|
36
|
+
</ProgressStep>
|
|
37
|
+
<ProgressStep
|
|
38
|
+
variant="info"
|
|
39
|
+
isCurrent
|
|
40
|
+
description="This is the second thing to happen"
|
|
41
|
+
id="basic-alignment-step2"
|
|
42
|
+
titleId="basic-alignment-step2-title"
|
|
43
|
+
aria-label="step with info"
|
|
44
|
+
>
|
|
45
|
+
Second step
|
|
46
|
+
</ProgressStep>
|
|
47
|
+
<ProgressStep
|
|
48
|
+
variant="pending"
|
|
49
|
+
description="This is the last thing to happen"
|
|
50
|
+
id="basic-alignment-step3"
|
|
51
|
+
titleId="basic-alignment-step3-title"
|
|
52
|
+
aria-label="pending step"
|
|
53
|
+
>
|
|
54
|
+
Third step
|
|
55
|
+
</ProgressStep>
|
|
56
|
+
</ProgressStepper>
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
);
|
|
59
|
+
};
|