@patternfly/react-core 4.226.2 → 4.227.2

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.
Files changed (26) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/esm/components/Dropdown/DropdownToggle.d.ts.map +1 -1
  3. package/dist/esm/components/Dropdown/DropdownToggle.js +1 -1
  4. package/dist/esm/components/Dropdown/DropdownToggle.js.map +1 -1
  5. package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
  6. package/dist/js/components/Dropdown/DropdownToggle.js +1 -1
  7. package/dist/js/components/Dropdown/DropdownToggle.js.map +1 -1
  8. package/dist/umd/react-core.js +1 -1
  9. package/dist/umd/react-core.min.css +2763 -2763
  10. package/dist/umd/react-core.min.js +1 -1
  11. package/package.json +5 -5
  12. package/src/components/Dropdown/DropdownToggle.tsx +1 -0
  13. package/src/components/Dropdown/__tests__/DropdownToggle.test.tsx +18 -0
  14. package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +1 -1
  15. package/src/components/Dropdown/examples/Dropdown.md +5 -0
  16. package/src/components/Dropdown/examples/DropdownSplitButtonActionSecondary.tsx +107 -0
  17. package/src/components/Page/examples/Page.md +25 -12
  18. package/src/components/ProgressStepper/examples/ProgressStepper.md +13 -356
  19. package/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx +21 -0
  20. package/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx +48 -0
  21. package/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx +48 -0
  22. package/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx +59 -0
  23. package/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx +35 -0
  24. package/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx +51 -0
  25. package/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx +35 -0
  26. package/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx +62 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.226.2",
3
+ "version": "4.227.2",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.77.2",
38
- "@patternfly/react-styles": "^4.76.2",
39
- "@patternfly/react-tokens": "^4.78.2",
37
+ "@patternfly/react-icons": "^4.78.2",
38
+ "@patternfly/react-styles": "^4.77.2",
39
+ "@patternfly/react-tokens": "^4.79.2",
40
40
  "focus-trap": "6.9.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "fb67d6b2dfbfd2b4080e1313101f4d663a0a09c3"
63
+ "gitHead": "cf751b0d9ad160595567d4d13942ba2d06813f29"
64
64
  }
@@ -120,6 +120,7 @@ export const DropdownToggle: React.FunctionComponent<DropdownToggleProps> = ({
120
120
  styles.modifiers.splitButton,
121
121
  splitButtonVariant === 'action' && styles.modifiers.action,
122
122
  (toggleVariant === 'primary' || isPrimary) && splitButtonVariant === 'action' && styles.modifiers.primary,
123
+ toggleVariant === 'secondary' && splitButtonVariant === 'action' && styles.modifiers.secondary,
123
124
  isDisabled && styles.modifiers.disabled
124
125
  )}
125
126
  >
@@ -184,6 +184,24 @@ describe('DropdownToggle', () => {
184
184
  expect(asFragment()).toMatchSnapshot();
185
185
  });
186
186
 
187
+ test('action split button - renders secondary variant', () => {
188
+ const { asFragment } = render(
189
+ <DropdownToggle
190
+ id="Dropdown Toggle"
191
+ toggleVariant="secondary"
192
+ splitButtonItems={[<div key="1">test</div>]}
193
+ splitButtonVariant="action"
194
+ parentRef={document.createElement('div')}
195
+ >
196
+ Dropdown
197
+ </DropdownToggle>
198
+ );
199
+
200
+ const dropdownToggle = screen.getByRole('button').parentElement;
201
+
202
+ expect(dropdownToggle).toHaveClass('pf-m-secondary');
203
+ });
204
+
187
205
  test('class changes', () => {
188
206
  const { asFragment } = render(
189
207
  <DropdownContext.Provider
@@ -198,7 +198,7 @@ exports[`DropdownToggle state class changes 1`] = `
198
198
  <button
199
199
  aria-expanded="false"
200
200
  class="pf-c-dropdown__toggle"
201
- data-ouia-component-id="OUIA-Generated-DropdownToggle-13"
201
+ data-ouia-component-id="OUIA-Generated-DropdownToggle-14"
202
202
  data-ouia-component-type="PF4/DropdownToggle"
203
203
  data-ouia-safe="true"
204
204
  id="Dropdown Toggle"
@@ -113,6 +113,11 @@ import avatarImg from '../../Avatar/examples/avatarImg.svg';
113
113
  ```ts file="./DropdownSplitButtonActionPrimary.tsx"
114
114
  ```
115
115
 
116
+ ### Split button secondary action
117
+
118
+ ```ts file="./DropdownSplitButtonActionSecondary.tsx"
119
+ ```
120
+
116
121
  ### Basic panel
117
122
 
118
123
  ```ts file="./DropdownBasicPanel.tsx"
@@ -0,0 +1,107 @@
1
+ import React from 'react';
2
+ import { Dropdown, DropdownToggle, DropdownToggleAction, DropdownItem } from '@patternfly/react-core';
3
+ import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
4
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
5
+ import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
6
+
7
+ export const DropdownSplitButtonActionSecondary: React.FunctionComponent = () => {
8
+ const [isActionOpen, setIsActionOpen] = React.useState(false);
9
+ const [isCogOpen, setIsCogOpen] = React.useState(false);
10
+
11
+ const onActionToggle = (isActionOpen: boolean) => {
12
+ setIsActionOpen(isActionOpen);
13
+ };
14
+ const onCogToggle = (isCogOpen: boolean) => {
15
+ setIsCogOpen(isCogOpen);
16
+ };
17
+
18
+ const onActionClick = () => {
19
+ window.alert('You selected an action button!');
20
+ };
21
+ const onCogClick = () => {
22
+ window.alert('You selected the Cog!');
23
+ };
24
+
25
+ const onActionFocus = () => {
26
+ const element = document.getElementById('toggle-split-button-action-secondary');
27
+ element.focus();
28
+ };
29
+ const onCogFocus = () => {
30
+ const element = document.getElementById('toggle-split-button-cog-secondary');
31
+ element.focus();
32
+ };
33
+
34
+ const onActionSelect = () => {
35
+ setIsActionOpen(false);
36
+ onActionFocus();
37
+ };
38
+ const onCogSelect = () => {
39
+ setIsCogOpen(false);
40
+ onCogFocus();
41
+ };
42
+
43
+ const dropdownItems = [
44
+ <DropdownItem key="action" component="button" onClick={onActionClick}>
45
+ Action
46
+ </DropdownItem>,
47
+ <DropdownItem key="disabled link" component="button" isDisabled onClick={onActionClick}>
48
+ Disabled action
49
+ </DropdownItem>,
50
+ <DropdownItem key="other action" component="button" onClick={onActionClick}>
51
+ Other action
52
+ </DropdownItem>
53
+ ];
54
+
55
+ const dropdownIconItems = [
56
+ <DropdownItem key="action" component="button" icon={<CogIcon />} onClick={onActionClick}>
57
+ Action
58
+ </DropdownItem>,
59
+ <DropdownItem key="disabled link" component="button" icon={<BellIcon />} isDisabled onClick={onActionClick}>
60
+ Disabled action
61
+ </DropdownItem>,
62
+ <DropdownItem key="other action" component="button" icon={<CubesIcon />} onClick={onActionClick}>
63
+ Other action
64
+ </DropdownItem>
65
+ ];
66
+
67
+ return (
68
+ <React.Fragment>
69
+ <Dropdown
70
+ onSelect={onActionSelect}
71
+ toggle={
72
+ <DropdownToggle
73
+ id="toggle-split-button-action-secondary"
74
+ splitButtonItems={[
75
+ <DropdownToggleAction key="action" onClick={onActionClick}>
76
+ Action
77
+ </DropdownToggleAction>
78
+ ]}
79
+ toggleVariant="secondary"
80
+ splitButtonVariant="action"
81
+ onToggle={onActionToggle}
82
+ />
83
+ }
84
+ isOpen={isActionOpen}
85
+ dropdownItems={dropdownItems}
86
+ />{' '}
87
+ <Dropdown
88
+ onSelect={onCogSelect}
89
+ toggle={
90
+ <DropdownToggle
91
+ id="toggle-split-button-cog-secondary"
92
+ splitButtonItems={[
93
+ <DropdownToggleAction key="cog-action" aria-label="Action" onClick={onCogClick}>
94
+ <CogIcon />
95
+ </DropdownToggleAction>
96
+ ]}
97
+ toggleVariant="secondary"
98
+ splitButtonVariant="action"
99
+ onToggle={onCogToggle}
100
+ />
101
+ }
102
+ isOpen={isCogOpen}
103
+ dropdownItems={dropdownIconItems}
104
+ />
105
+ </React.Fragment>
106
+ );
107
+ };
@@ -89,7 +89,7 @@ class VerticalPage extends React.Component {
89
89
  <MastheadContent>{headerToolbar}</MastheadContent>
90
90
  </Masthead>
91
91
  );
92
- const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="vertical-sidebar"/>;
92
+ const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="vertical-sidebar" />;
93
93
 
94
94
  return (
95
95
  <Page header={Header} sidebar={Sidebar}>
@@ -262,7 +262,7 @@ class FillPage extends React.Component {
262
262
  <MastheadContent>{headerToolbar}</MastheadContent>
263
263
  </Masthead>
264
264
  );
265
- const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="fill-sidebar"/>;
265
+ const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="fill-sidebar" />;
266
266
 
267
267
  return (
268
268
  <Page header={Header} sidebar={Sidebar}>
@@ -344,7 +344,7 @@ class VerticalPage extends React.Component {
344
344
  <MastheadContent>{headerToolbar}</MastheadContent>
345
345
  </Masthead>
346
346
  );
347
- const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar"/>;
347
+ const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar" />;
348
348
 
349
349
  return (
350
350
  <Page header={Header} sidebar={Sidebar}>
@@ -410,7 +410,7 @@ class UncontrolledNavPage extends React.Component {
410
410
  <MastheadContent>{headerToolbar}</MastheadContent>
411
411
  </Masthead>
412
412
  );
413
- const Sidebar = <PageSidebar nav="Navigation" id="uncontrolled-sidebar"/>;
413
+ const Sidebar = <PageSidebar nav="Navigation" id="uncontrolled-sidebar" />;
414
414
 
415
415
  return (
416
416
  <Page isManagedSidebar header={Header} sidebar={Sidebar}>
@@ -497,7 +497,7 @@ class GroupPage extends React.Component {
497
497
  <MastheadContent>{headerToolbar}</MastheadContent>
498
498
  </Masthead>
499
499
  );
500
- const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="group-section-sidebar"/>;
500
+ const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="group-section-sidebar" />;
501
501
 
502
502
  return (
503
503
  <Page header={Header} sidebar={Sidebar}>
@@ -505,13 +505,21 @@ class GroupPage extends React.Component {
505
505
  <PageNavigation>
506
506
  <Nav aria-label="Group section navigation" variant="tertiary">
507
507
  <NavList>
508
- <NavItem itemId={0} isActive>
508
+ <NavItem href="#" itemId={0} isActive>
509
509
  System panel
510
510
  </NavItem>
511
- <NavItem itemId={1}>Policy</NavItem>
512
- <NavItem itemId={2}>Authentication</NavItem>
513
- <NavItem itemId={3}>Network services</NavItem>
514
- <NavItem itemId={4}>Server</NavItem>
511
+ <NavItem href="#" itemId={1}>
512
+ Policy
513
+ </NavItem>
514
+ <NavItem href="#" itemId={2}>
515
+ Authentication
516
+ </NavItem>
517
+ <NavItem href="#" itemId={3}>
518
+ Network services
519
+ </NavItem>
520
+ <NavItem href="#" itemId={4}>
521
+ Server
522
+ </NavItem>
515
523
  </NavList>
516
524
  </Nav>
517
525
  </PageNavigation>
@@ -582,7 +590,7 @@ class VerticalPage extends React.Component {
582
590
  navToggleId="vertical-pageheader-toggle"
583
591
  />
584
592
  );
585
- const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="vertical-pageheader-sidebar"/>;
593
+ const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="vertical-pageheader-sidebar" />;
586
594
 
587
595
  return (
588
596
  <Page header={Header} sidebar={Sidebar}>
@@ -630,7 +638,12 @@ CenterAlignedPageSection = () => {
630
638
  const Header = (
631
639
  <Masthead>
632
640
  <MastheadToggle>
633
- <PageToggleButton variant="plain" aria-label="Global navigation" onNavToggle={this.onNavToggle} id="centered-nav-toggle">
641
+ <PageToggleButton
642
+ variant="plain"
643
+ aria-label="Global navigation"
644
+ onNavToggle={this.onNavToggle}
645
+ id="centered-nav-toggle"
646
+ >
634
647
  <BarsIcon />
635
648
  </PageToggleButton>
636
649
  </MastheadToggle>
@@ -15,387 +15,44 @@ Progress steppers have default icons associated with the `variant` property, and
15
15
 
16
16
  ### Basic
17
17
 
18
- ```js
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
- ### Basic with descriptions
47
-
48
- ```js
49
- import React from 'react';
50
- import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
21
+ ### With step descriptions
51
22
 
52
- <ProgressStepper>
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
- ### Center aligned with descriptions
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
- <ProgressStepper isVertical>
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
- ```js
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
- ### Basic with an issue
193
-
194
- ```js
195
- import React from 'react';
196
- import { ProgressStepper, ProgressStep } from '@patternfly/react-core';
38
+ ### With an issue
197
39
 
198
- <ProgressStepper>
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
- ### Basic with a failure
43
+ ### With a failure
244
44
 
245
- ```js
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
- ### Basic with Patternfly icons
48
+ ### With custom icons
295
49
 
296
- ```js
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
- ```js
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
  ```