@patternfly/react-core 4.227.0 → 4.227.3

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 (31) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/DataList/DataList.d.ts +0 -2
  3. package/dist/esm/components/DataList/DataList.d.ts.map +1 -1
  4. package/dist/esm/components/DataList/DataList.js.map +1 -1
  5. package/dist/esm/components/DataList/DataListItem.d.ts.map +1 -1
  6. package/dist/esm/components/DataList/DataListItem.js +1 -2
  7. package/dist/esm/components/DataList/DataListItem.js.map +1 -1
  8. package/dist/js/components/DataList/DataList.d.ts +0 -2
  9. package/dist/js/components/DataList/DataList.d.ts.map +1 -1
  10. package/dist/js/components/DataList/DataList.js.map +1 -1
  11. package/dist/js/components/DataList/DataListItem.d.ts.map +1 -1
  12. package/dist/js/components/DataList/DataListItem.js +1 -2
  13. package/dist/js/components/DataList/DataListItem.js.map +1 -1
  14. package/dist/umd/react-core.css +160 -160
  15. package/dist/umd/react-core.js +1 -2
  16. package/dist/umd/react-core.min.js +1 -1
  17. package/package.json +5 -5
  18. package/src/components/DataList/DataList.tsx +0 -2
  19. package/src/components/DataList/DataListItem.tsx +1 -3
  20. package/src/components/DataList/__tests__/DataList.test.tsx +14 -32
  21. package/src/components/DataList/examples/DataListSelectableRows.tsx +1 -1
  22. package/src/components/Page/examples/Page.md +25 -12
  23. package/src/components/ProgressStepper/examples/ProgressStepper.md +13 -356
  24. package/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx +21 -0
  25. package/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx +48 -0
  26. package/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx +48 -0
  27. package/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx +59 -0
  28. package/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx +35 -0
  29. package/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx +51 -0
  30. package/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx +35 -0
  31. 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.227.0",
3
+ "version": "4.227.3",
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.78.0",
38
- "@patternfly/react-styles": "^4.77.0",
39
- "@patternfly/react-tokens": "^4.79.0",
37
+ "@patternfly/react-icons": "^4.78.3",
38
+ "@patternfly/react-styles": "^4.77.3",
39
+ "@patternfly/react-tokens": "^4.79.3",
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": "9ab68189931ffebc2eb1d2dd3a39ad5d8bc88b58"
63
+ "gitHead": "1f3a381413227fade8f0551512fcdc5a47436e7c"
64
64
  }
@@ -21,8 +21,6 @@ export enum DataListWrapModifier {
21
21
  }
22
22
 
23
23
  export interface SelectableRowObject {
24
- /** Determines if only one of the selectable rows should be selectable at a time */
25
- type: 'multiple' | 'single';
26
24
  /** Callback that executes when the screen reader accessible element receives a change event */
27
25
  onChange: (id: string, event: React.FormEvent<HTMLInputElement>) => void;
28
26
  }
@@ -115,8 +115,6 @@ export class DataListItem extends React.Component<DataListItemProps> {
115
115
  ? { 'aria-label': selectableInputAriaLabel }
116
116
  : { 'aria-labelledby': ariaLabelledBy };
117
117
 
118
- const selectableInputType = selectableRow?.type === 'multiple' ? 'checkbox' : 'radio';
119
-
120
118
  return (
121
119
  <li
122
120
  id={id}
@@ -136,7 +134,7 @@ export class DataListItem extends React.Component<DataListItemProps> {
136
134
  {selectableRow && (
137
135
  <input
138
136
  className="pf-screen-reader"
139
- type={selectableInputType}
137
+ type="radio"
140
138
  checked={isSelected}
141
139
  onChange={event => selectableRow.onChange(id, event)}
142
140
  tabIndex={-1}
@@ -50,7 +50,7 @@ describe('DataList', () => {
50
50
 
51
51
  test('List renders with a hidden input to improve a11y when selectableRow is passed', () => {
52
52
  render(
53
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: () => {} }}>
53
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: () => {} }}>
54
54
  <DataListItem>
55
55
  <DataListItemRow aria-labelledby="test-id">
56
56
  <p id="test-id">Test</p>
@@ -59,7 +59,7 @@ describe('DataList', () => {
59
59
  </DataList>
60
60
  );
61
61
 
62
- const selectableInput = screen.getByRole('checkbox', { hidden: true });
62
+ const selectableInput = screen.getByRole('radio', { hidden: true });
63
63
 
64
64
  expect(selectableInput).toBeInTheDocument();
65
65
  });
@@ -75,35 +75,17 @@ describe('DataList', () => {
75
75
  </DataList>
76
76
  );
77
77
 
78
- const selectableInput = screen.queryByRole('checkbox', { hidden: true });
78
+ const selectableInput = screen.queryByRole('radio', { hidden: true });
79
79
 
80
80
  expect(selectableInput).not.toBeInTheDocument();
81
81
  });
82
82
 
83
- test('List hidden input renders as a radio when selectableRow.type is radio', () => {
84
- render(
85
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'single', onChange: () => {} }}>
86
- <DataListItem>
87
- <DataListItemRow aria-labelledby="test-id">
88
- <p id="test-id">Test</p>
89
- </DataListItemRow>
90
- </DataListItem>
91
- </DataList>
92
- );
93
-
94
- const selectableRadioInput = screen.getByRole('radio', { hidden: true });
95
- const selectableCheckboxInput = screen.queryByRole('checkbox', { hidden: true });
96
-
97
- expect(selectableRadioInput).toBeInTheDocument();
98
- expect(selectableCheckboxInput).not.toBeInTheDocument();
99
- });
100
-
101
83
  test('List calls selectableRow.onChange when the selectable input changes', () => {
102
84
  const mock = jest.fn();
103
85
 
104
86
  render(
105
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: mock }}>
106
- <DataListItem>
87
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: mock }} selectedDataListItemId=''>
88
+ <DataListItem id='item-test-id'>
107
89
  <DataListItemRow aria-labelledby="test-id">
108
90
  <p id="test-id">Test</p>
109
91
  </DataListItemRow>
@@ -111,7 +93,7 @@ describe('DataList', () => {
111
93
  </DataList>
112
94
  );
113
95
 
114
- const selectableInput = screen.getByRole('checkbox', { hidden: true });
96
+ const selectableInput = screen.getByRole('radio', { hidden: true });
115
97
  userEvent.click(selectableInput);
116
98
 
117
99
  expect(mock).toHaveBeenCalled();
@@ -121,8 +103,8 @@ describe('DataList', () => {
121
103
  const mock = jest.fn();
122
104
 
123
105
  render(
124
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: mock }}>
125
- <DataListItem>
106
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: mock }} selectedDataListItemId=''>
107
+ <DataListItem id='item-test-id'>
126
108
  <DataListItemRow aria-labelledby="test-id">
127
109
  <p id="test-id">Test</p>
128
110
  </DataListItemRow>
@@ -135,7 +117,7 @@ describe('DataList', () => {
135
117
 
136
118
  test('Item applies selectableInputAriaLabel to the hidden input', () => {
137
119
  render(
138
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: () => {} }}>
120
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: () => {} }}>
139
121
  <DataListItem selectableInputAriaLabel="Data list item label test">
140
122
  <DataListItemRow aria-labelledby="test-id">
141
123
  <p id="test-id">Test</p>
@@ -144,35 +126,35 @@ describe('DataList', () => {
144
126
  </DataList>
145
127
  );
146
128
 
147
- const selectableInput = screen.getByRole('checkbox', { hidden: true });
129
+ const selectableInput = screen.getByRole('radio', { hidden: true });
148
130
 
149
131
  expect(selectableInput).toHaveAccessibleName('Data list item label test');
150
132
  });
151
133
 
152
134
  test('Item defaults to labelling its input using its aria-labelledby prop', () => {
153
135
  render(
154
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: () => {} }}>
136
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: () => {} }}>
155
137
  <DataListItem aria-labelledby="test-id">
156
138
  <p id="test-id">Test cell content</p>
157
139
  </DataListItem>
158
140
  </DataList>
159
141
  );
160
142
 
161
- const selectableInput = screen.getByRole('checkbox', { hidden: true });
143
+ const selectableInput = screen.getByRole('radio', { hidden: true });
162
144
 
163
145
  expect(selectableInput).toHaveAccessibleName('Test cell content');
164
146
  });
165
147
 
166
148
  test('Item prioritizes selectableInputAriaLabel over aria-labelledby prop', () => {
167
149
  render(
168
- <DataList aria-label="this is a simple list" selectableRow={{ type: 'multiple', onChange: () => {} }}>
150
+ <DataList aria-label="this is a simple list" selectableRow={{ onChange: () => {} }}>
169
151
  <DataListItem aria-labelledby="test-id" selectableInputAriaLabel="Data list item label test">
170
152
  <p id="test-id">Test cell content</p>
171
153
  </DataListItem>
172
154
  </DataList>
173
155
  );
174
156
 
175
- const selectableInput = screen.getByRole('checkbox', { hidden: true });
157
+ const selectableInput = screen.getByRole('radio', { hidden: true });
176
158
 
177
159
  expect(selectableInput).toHaveAccessibleName('Data list item label test');
178
160
  });
@@ -47,7 +47,7 @@ export const DataListSelectableRows: React.FunctionComponent = () => {
47
47
  aria-label="selectable data list example"
48
48
  selectedDataListItemId={selectedDataListItemId}
49
49
  onSelectDataListItem={onSelectDataListItem}
50
- selectableRow={{ type: 'single', onChange: handleInputChange }}
50
+ selectableRow={{ onChange: handleInputChange }}
51
51
  >
52
52
  <DataListItem aria-labelledby="selectable-action-item1" id="item1">
53
53
  <DataListItemRow>
@@ -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
  ```