@patternfly/react-docs 7.6.0-prerelease.6 → 7.6.0-prerelease.8

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 (163) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +12 -13
  3. package/patternfly-docs/generated/components/about-modal/react.js +149 -0
  4. package/patternfly-docs/generated/components/accordion/react.js +262 -0
  5. package/patternfly-docs/generated/components/action-list/react.js +144 -0
  6. package/patternfly-docs/generated/components/alert/react-demos.js +56 -0
  7. package/patternfly-docs/generated/components/alert/react.js +1433 -0
  8. package/patternfly-docs/generated/components/avatar/react.js +166 -0
  9. package/patternfly-docs/generated/components/back-to-top/react-demos.js +60 -0
  10. package/patternfly-docs/generated/components/back-to-top/react.js +77 -0
  11. package/patternfly-docs/generated/components/backdrop/react.js +64 -0
  12. package/patternfly-docs/generated/components/background-image/react.js +62 -0
  13. package/patternfly-docs/generated/components/badge/react.js +97 -0
  14. package/patternfly-docs/generated/components/banner/react-demos.js +57 -0
  15. package/patternfly-docs/generated/components/banner/react.js +148 -0
  16. package/patternfly-docs/generated/components/brand/react.js +142 -0
  17. package/patternfly-docs/generated/components/breadcrumb/react.js +206 -0
  18. package/patternfly-docs/generated/components/button/react-demos.js +57 -0
  19. package/patternfly-docs/generated/components/button/react.js +826 -0
  20. package/patternfly-docs/generated/components/card/react-demos.js +201 -0
  21. package/patternfly-docs/generated/components/card/react.js +1015 -0
  22. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +1350 -0
  23. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +1334 -0
  24. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +1282 -0
  25. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +848 -0
  26. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +192 -0
  27. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +426 -0
  28. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +804 -0
  29. package/patternfly-docs/generated/components/charts/legends/-Victory.js +3230 -0
  30. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +1178 -0
  31. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +525 -0
  32. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +3382 -0
  33. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +377 -0
  34. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +2475 -0
  35. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +538 -0
  36. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +1551 -0
  37. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +4115 -0
  38. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +955 -0
  39. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +1173 -0
  40. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +1166 -0
  41. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +413 -0
  42. package/patternfly-docs/generated/components/chip/react-deprecated.js +323 -0
  43. package/patternfly-docs/generated/components/clipboard-copy/react.js +373 -0
  44. package/patternfly-docs/generated/components/code-block/react.js +148 -0
  45. package/patternfly-docs/generated/components/code-editor/react.js +659 -0
  46. package/patternfly-docs/generated/components/compass/react-demos.js +147 -0
  47. package/patternfly-docs/generated/components/compass/react.js +440 -0
  48. package/patternfly-docs/generated/components/content/react.js +248 -0
  49. package/patternfly-docs/generated/components/data-list/react-demos.js +90 -0
  50. package/patternfly-docs/generated/components/data-list/react.js +709 -0
  51. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +283 -0
  52. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +64 -0
  53. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +83 -0
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +395 -0
  55. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +241 -0
  56. package/patternfly-docs/generated/components/description-list/react-demos.js +58 -0
  57. package/patternfly-docs/generated/components/description-list/react.js +743 -0
  58. package/patternfly-docs/generated/components/divider/react.js +126 -0
  59. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +351 -0
  60. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +184 -0
  61. package/patternfly-docs/generated/components/drag-and-drop/react.js +137 -0
  62. package/patternfly-docs/generated/components/drawer/react.js +598 -0
  63. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +772 -0
  64. package/patternfly-docs/generated/components/dual-list-selector/react.js +594 -0
  65. package/patternfly-docs/generated/components/empty-state/react.js +199 -0
  66. package/patternfly-docs/generated/components/expandable-section/react-demos.js +65 -0
  67. package/patternfly-docs/generated/components/expandable-section/react.js +408 -0
  68. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +52 -0
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +398 -0
  70. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +749 -0
  71. package/patternfly-docs/generated/components/forms/checkbox/react.js +222 -0
  72. package/patternfly-docs/generated/components/forms/form/react.js +1106 -0
  73. package/patternfly-docs/generated/components/forms/form-select/react.js +208 -0
  74. package/patternfly-docs/generated/components/forms/radio/react.js +212 -0
  75. package/patternfly-docs/generated/components/forms/text-area/react.js +160 -0
  76. package/patternfly-docs/generated/components/forms/text-input/react.js +216 -0
  77. package/patternfly-docs/generated/components/helper-text/react-demos.js +180 -0
  78. package/patternfly-docs/generated/components/helper-text/react.js +164 -0
  79. package/patternfly-docs/generated/components/hero/react.js +88 -0
  80. package/patternfly-docs/generated/components/hint/react.js +169 -0
  81. package/patternfly-docs/generated/components/icon/react.js +215 -0
  82. package/patternfly-docs/generated/components/input-group/react.js +182 -0
  83. package/patternfly-docs/generated/components/jump-links/react-demos.js +154 -0
  84. package/patternfly-docs/generated/components/jump-links/react.js +212 -0
  85. package/patternfly-docs/generated/components/label/react-demos.js +57 -0
  86. package/patternfly-docs/generated/components/label/react.js +417 -0
  87. package/patternfly-docs/generated/components/list/react.js +175 -0
  88. package/patternfly-docs/generated/components/login-page/react.js +587 -0
  89. package/patternfly-docs/generated/components/masthead/react-demos.js +79 -0
  90. package/patternfly-docs/generated/components/masthead/react.js +291 -0
  91. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +769 -0
  92. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +665 -0
  93. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +187 -0
  94. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +163 -0
  95. package/patternfly-docs/generated/components/menus/dropdown/react.js +998 -0
  96. package/patternfly-docs/generated/components/menus/menu/react.js +1540 -0
  97. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +747 -0
  98. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +508 -0
  99. package/patternfly-docs/generated/components/menus/select/react-templates.js +257 -0
  100. package/patternfly-docs/generated/components/menus/select/react.js +998 -0
  101. package/patternfly-docs/generated/components/modal/react-deprecated.js +554 -0
  102. package/patternfly-docs/generated/components/modal/react.js +597 -0
  103. package/patternfly-docs/generated/components/navigation/react-demos.js +356 -0
  104. package/patternfly-docs/generated/components/navigation/react.js +409 -0
  105. package/patternfly-docs/generated/components/notification-badge/react.js +196 -0
  106. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +107 -0
  107. package/patternfly-docs/generated/components/notification-drawer/react.js +394 -0
  108. package/patternfly-docs/generated/components/number-input/react.js +210 -0
  109. package/patternfly-docs/generated/components/overflow-menu/react.js +274 -0
  110. package/patternfly-docs/generated/components/page/react-demos.js +149 -0
  111. package/patternfly-docs/generated/components/page/react.js +1352 -0
  112. package/patternfly-docs/generated/components/pagination/react.js +492 -0
  113. package/patternfly-docs/generated/components/panel/react.js +236 -0
  114. package/patternfly-docs/generated/components/popover/react.js +390 -0
  115. package/patternfly-docs/generated/components/progress/react-demos.js +59 -0
  116. package/patternfly-docs/generated/components/progress/react.js +283 -0
  117. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +45 -0
  118. package/patternfly-docs/generated/components/progress-stepper/react.js +219 -0
  119. package/patternfly-docs/generated/components/search-input/react-demos.js +113 -0
  120. package/patternfly-docs/generated/components/search-input/react.js +263 -0
  121. package/patternfly-docs/generated/components/sidebar/react.js +236 -0
  122. package/patternfly-docs/generated/components/simple-list/react.js +200 -0
  123. package/patternfly-docs/generated/components/skeleton/react-demos.js +44 -0
  124. package/patternfly-docs/generated/components/skeleton/react.js +122 -0
  125. package/patternfly-docs/generated/components/skip-to-content/react.js +73 -0
  126. package/patternfly-docs/generated/components/slider/react.js +309 -0
  127. package/patternfly-docs/generated/components/spinner/react.js +111 -0
  128. package/patternfly-docs/generated/components/switch/react.js +163 -0
  129. package/patternfly-docs/generated/components/table/react-demos.js +355 -0
  130. package/patternfly-docs/generated/components/table/react-deprecated.js +1350 -0
  131. package/patternfly-docs/generated/components/table/react.js +3241 -0
  132. package/patternfly-docs/generated/components/tabs/react-demos.js +108 -0
  133. package/patternfly-docs/generated/components/tabs/react.js +1359 -0
  134. package/patternfly-docs/generated/components/text-input-group/react-demos.js +152 -0
  135. package/patternfly-docs/generated/components/text-input-group/react.js +278 -0
  136. package/patternfly-docs/generated/components/tile/react-deprecated.js +242 -0
  137. package/patternfly-docs/generated/components/timestamp/react.js +283 -0
  138. package/patternfly-docs/generated/components/title/react.js +94 -0
  139. package/patternfly-docs/generated/components/toggle-group/react.js +299 -0
  140. package/patternfly-docs/generated/components/toolbar/react-demos.js +66 -0
  141. package/patternfly-docs/generated/components/toolbar/react.js +932 -0
  142. package/patternfly-docs/generated/components/tooltip/react.js +241 -0
  143. package/patternfly-docs/generated/components/tree-view/react.js +429 -0
  144. package/patternfly-docs/generated/components/truncate/react.js +211 -0
  145. package/patternfly-docs/generated/components/wizard/react-demos.js +87 -0
  146. package/patternfly-docs/generated/components/wizard/react-deprecated.js +788 -0
  147. package/patternfly-docs/generated/components/wizard/react.js +986 -0
  148. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +285 -0
  149. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +70 -0
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +506 -0
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +94 -0
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +272 -0
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +87 -0
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +124 -0
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +112 -0
  156. package/patternfly-docs/generated/index.js +1769 -0
  157. package/patternfly-docs/generated/patterns/card-view/react-demos.js +78 -0
  158. package/patternfly-docs/generated/patterns/filters/react-demos.js +141 -0
  159. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +51 -0
  160. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +61 -0
  161. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +124 -0
  162. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +81 -0
  163. package/LICENSE +0 -21
@@ -0,0 +1,986 @@
1
+ import React from 'react';
2
+ import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
+ import { createContext, useCallback, useContext, useRef, useState } from 'react';
4
+ import {
5
+ FormGroup,
6
+ TextInput,
7
+ Drawer,
8
+ DrawerContent,
9
+ Button,
10
+ Title,
11
+ Flex,
12
+ Checkbox,
13
+ DrawerPanelContent,
14
+ DrawerColorVariant,
15
+ DrawerHead,
16
+ DrawerActions,
17
+ DrawerCloseButton,
18
+ Modal,
19
+ ModalVariant,
20
+ Wizard,
21
+ WizardFooter,
22
+ WizardFooterWrapper,
23
+ WizardToggle,
24
+ WizardStep,
25
+ WizardBody,
26
+ useWizardFooter,
27
+ useWizardContext,
28
+ WizardNavItem,
29
+ WizardNav,
30
+ WizardHeader
31
+ } from '@patternfly/react-core';
32
+ import RhMicronsExternalLinkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-external-link-icon';
33
+ import SlackHashIcon from '@patternfly/react-icons/dist/esm/icons/slack-hash-icon';
34
+ import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon';
35
+ import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
36
+ import layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
37
+ const pageData = {
38
+ "id": "Wizard",
39
+ "section": "components",
40
+ "subsection": "",
41
+ "deprecated": false,
42
+ "template": false,
43
+ "beta": false,
44
+ "demo": false,
45
+ "newImplementationLink": false,
46
+ "source": "react",
47
+ "tabName": null,
48
+ "slug": "/components/wizard/react",
49
+ "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/Wizard/examples/Wizard.md",
50
+ "relPath": "packages/react-core/src/components/Wizard/examples/Wizard.md",
51
+ "propComponents": [
52
+ {
53
+ "name": "Wizard",
54
+ "description": "Wrapper for all steps and hosts state, including navigation helpers, within context.\nThe WizardContext provided by default gives any child of wizard access to those resources.",
55
+ "props": [
56
+ {
57
+ "name": "children",
58
+ "type": "React.ReactNode",
59
+ "description": "Step components",
60
+ "required": true
61
+ },
62
+ {
63
+ "name": "className",
64
+ "type": "string",
65
+ "description": "Additional classes spread to the wizard"
66
+ },
67
+ {
68
+ "name": "footer",
69
+ "type": "Partial<WizardFooterProps> | CustomWizardFooterFunction | React.ReactElement<any>",
70
+ "description": "Wizard footer"
71
+ },
72
+ {
73
+ "name": "header",
74
+ "type": "React.ReactNode",
75
+ "description": "Wizard header"
76
+ },
77
+ {
78
+ "name": "height",
79
+ "type": "number | string",
80
+ "description": "Custom height of the wizard"
81
+ },
82
+ {
83
+ "name": "isNoPlainOnGlass",
84
+ "type": "boolean",
85
+ "description": "Prevents the wizard from automatically applying plain styling when glass theme is enabled.",
86
+ "defaultValue": "false",
87
+ "beta": true
88
+ },
89
+ {
90
+ "name": "isPlain",
91
+ "type": "boolean",
92
+ "description": "Adds plain styling to the wizard.",
93
+ "defaultValue": "false"
94
+ },
95
+ {
96
+ "name": "isProgressive",
97
+ "type": "boolean",
98
+ "description": "Progressively shows steps, where all steps following the active step are hidden. Defaults to false.",
99
+ "defaultValue": "false"
100
+ },
101
+ {
102
+ "name": "isVisitRequired",
103
+ "type": "boolean",
104
+ "description": "Disables steps that haven't been visited. Defaults to false.",
105
+ "defaultValue": "false"
106
+ },
107
+ {
108
+ "name": "nav",
109
+ "type": "Partial<WizardNavProps> | CustomWizardNavFunction | React.ReactElement<any>",
110
+ "description": "Wizard navigation"
111
+ },
112
+ {
113
+ "name": "navAriaLabel",
114
+ "type": "string",
115
+ "description": "Aria-label for the Nav"
116
+ },
117
+ {
118
+ "name": "onClose",
119
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void",
120
+ "description": "Callback function to close the wizard"
121
+ },
122
+ {
123
+ "name": "onSave",
124
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>",
125
+ "description": "Callback function to save at the end of the wizard, if not specified uses onClose"
126
+ },
127
+ {
128
+ "name": "onStepChange",
129
+ "type": "(\n event: React.MouseEvent<HTMLButtonElement>,\n currentStep: WizardStepType,\n prevStep: WizardStepType,\n scope: WizardStepChangeScope\n) => void | Promise<void>",
130
+ "description": "Callback function when navigating between steps"
131
+ },
132
+ {
133
+ "name": "shouldFocusContent",
134
+ "type": "boolean",
135
+ "description": "Flag indicating whether the wizard content should be focused after the onNext or onBack callbacks\nare called.",
136
+ "defaultValue": "true"
137
+ },
138
+ {
139
+ "name": "startIndex",
140
+ "type": "number",
141
+ "description": "The initial index the wizard is to start on (1 or higher). Defaults to 1.",
142
+ "defaultValue": "1"
143
+ },
144
+ {
145
+ "name": "width",
146
+ "type": "number | string",
147
+ "description": "Custom width of the wizard"
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "name": "WizardFooter",
153
+ "description": "Hosts the standard structure of a footer with ties to the active step so that text for buttons can vary from step to step.",
154
+ "props": [
155
+ {
156
+ "name": "activeStep",
157
+ "type": "WizardBasicStep | WizardParentStep | WizardSubStep",
158
+ "description": "The active step",
159
+ "required": true
160
+ },
161
+ {
162
+ "name": "backButtonProps",
163
+ "type": "Omit<WizardFooterButtonProps, 'isDisabled'>",
164
+ "description": "Additional props for the Back button."
165
+ },
166
+ {
167
+ "name": "backButtonText",
168
+ "type": "React.ReactNode",
169
+ "description": "Custom text for the Back button"
170
+ },
171
+ {
172
+ "name": "cancelButtonProps",
173
+ "type": "Omit<ButtonProps, 'children' | 'variant' | 'onClick'>",
174
+ "description": "Additional props for the Cancel button."
175
+ },
176
+ {
177
+ "name": "cancelButtonText",
178
+ "type": "React.ReactNode",
179
+ "description": "Custom text for the Cancel link"
180
+ },
181
+ {
182
+ "name": "className",
183
+ "type": "string",
184
+ "description": "Additional classes spread to the wizard footer"
185
+ },
186
+ {
187
+ "name": "isBackDisabled",
188
+ "type": "boolean",
189
+ "description": "Flag to disable the back button"
190
+ },
191
+ {
192
+ "name": "isBackHidden",
193
+ "type": "boolean",
194
+ "description": "Flag to hide the back button"
195
+ },
196
+ {
197
+ "name": "isCancelHidden",
198
+ "type": "boolean",
199
+ "description": "Flag to hide the cancel button"
200
+ },
201
+ {
202
+ "name": "isNextDisabled",
203
+ "type": "boolean",
204
+ "description": "Flag to disable the next button"
205
+ },
206
+ {
207
+ "name": "nextButtonProps",
208
+ "type": "Omit<WizardFooterButtonProps, 'isDisabled' | 'type'>",
209
+ "description": "Additional props for the Next button."
210
+ },
211
+ {
212
+ "name": "nextButtonText",
213
+ "type": "React.ReactNode",
214
+ "description": "Custom text for the Next button. The current step's nextButtonText takes precedence."
215
+ },
216
+ {
217
+ "name": "onBack",
218
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>",
219
+ "description": "Back button callback",
220
+ "required": true
221
+ },
222
+ {
223
+ "name": "onClose",
224
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void",
225
+ "description": "Cancel link callback",
226
+ "required": true
227
+ },
228
+ {
229
+ "name": "onNext",
230
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>",
231
+ "description": "Next button callback",
232
+ "required": true
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "name": "WizardFooterWrapper",
238
+ "description": "Applies default wizard footer styling any number of child elements.",
239
+ "props": [
240
+ {
241
+ "name": "children",
242
+ "type": "React.ReactNode",
243
+ "description": "",
244
+ "required": true
245
+ },
246
+ {
247
+ "name": "className",
248
+ "type": "string",
249
+ "description": ""
250
+ }
251
+ ]
252
+ },
253
+ {
254
+ "name": "WizardToggle",
255
+ "description": "Used to toggle between step content, including the body and footer. This is also where the navigation and its expandability is controlled.",
256
+ "props": [
257
+ {
258
+ "name": "activeStep",
259
+ "type": "WizardBasicStep | WizardParentStep | WizardSubStep",
260
+ "description": "The current step",
261
+ "required": true
262
+ },
263
+ {
264
+ "name": "aria-label",
265
+ "type": "string",
266
+ "description": "The expandable dropdown button's aria-label",
267
+ "defaultValue": "'Wizard toggle'"
268
+ },
269
+ {
270
+ "name": "footer",
271
+ "type": "React.ReactElement<any>",
272
+ "description": "Wizard footer",
273
+ "required": true
274
+ },
275
+ {
276
+ "name": "isNavExpanded",
277
+ "type": "boolean",
278
+ "description": "Flag to determine whether the dropdown navigation is expanded"
279
+ },
280
+ {
281
+ "name": "nav",
282
+ "type": "React.ReactElement<WizardNavProps>",
283
+ "description": "Wizard navigation",
284
+ "required": true
285
+ },
286
+ {
287
+ "name": "steps",
288
+ "type": "WizardStepType[]",
289
+ "description": "List of steps and/or sub-steps",
290
+ "required": true
291
+ },
292
+ {
293
+ "name": "toggleNavExpanded",
294
+ "type": "(event: React.MouseEvent<HTMLButtonElement> | KeyboardEvent) => void",
295
+ "description": "Callback to expand or collapse the dropdown navigation"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "name": "WizardStep",
301
+ "description": "The primary child component for Wizard. Step props are used for the list of steps managed in context.",
302
+ "props": [
303
+ {
304
+ "name": "body",
305
+ "type": "Omit<Omit<WizardBodyProps, 'children'>, 'children'>",
306
+ "description": "Props for WizardBody that wraps content by default."
307
+ },
308
+ {
309
+ "name": "children",
310
+ "type": "React.ReactNode | undefined",
311
+ "description": "Optional for when the step is used as a parent to sub-steps"
312
+ },
313
+ {
314
+ "name": "footer",
315
+ "type": "React.ReactElement<any> | Partial<WizardFooterProps>",
316
+ "description": "Replaces the step's footer. The step's footer takes precedence over the wizard's footer."
317
+ },
318
+ {
319
+ "name": "id",
320
+ "type": "string | number",
321
+ "description": "Unique identifier",
322
+ "required": true
323
+ },
324
+ {
325
+ "name": "isDisabled",
326
+ "type": "boolean",
327
+ "description": "Flag to disable the step's navigation item"
328
+ },
329
+ {
330
+ "name": "isExpandable",
331
+ "type": "boolean",
332
+ "description": "Flag to determine whether parent steps can expand or not. Defaults to false."
333
+ },
334
+ {
335
+ "name": "isHidden",
336
+ "type": "boolean",
337
+ "description": "Flag to determine whether the step is hidden"
338
+ },
339
+ {
340
+ "name": "name",
341
+ "type": "React.ReactNode",
342
+ "description": "Name of the step's navigation item",
343
+ "required": true
344
+ },
345
+ {
346
+ "name": "navItem",
347
+ "type": "Partial<WizardNavItemProps> | CustomWizardNavItemFunction | React.ReactElement<any>",
348
+ "description": "Replaces the step's navigation item or its properties."
349
+ },
350
+ {
351
+ "name": "status",
352
+ "type": "'default' | 'error' | 'success' | 'warning'",
353
+ "description": "Used to determine icon next to the step's navigation item"
354
+ },
355
+ {
356
+ "name": "steps",
357
+ "type": "React.ReactElement<WizardStepProps>[]",
358
+ "description": "Optional list of sub-steps"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ "name": "WizardBody",
364
+ "description": "Used as a wrapper for WizardStep content, where the wrapping element is customizable.",
365
+ "props": [
366
+ {
367
+ "name": "aria-label",
368
+ "type": "string",
369
+ "description": "Adds an accessible name to the wrapper element when the content overflows and renders\na scrollbar."
370
+ },
371
+ {
372
+ "name": "aria-labelledby",
373
+ "type": "string",
374
+ "description": "Adds an accessible name to the wrapper element by passing the the id of one or more elements.\nThe aria-labelledby will only be applied when the content overflows and renders a scrollbar."
375
+ },
376
+ {
377
+ "name": "children",
378
+ "type": "React.ReactNode",
379
+ "description": "Anything that can be rendered in the Wizard body",
380
+ "required": true
381
+ },
382
+ {
383
+ "name": "className",
384
+ "type": "string",
385
+ "description": "Additional classes spread to the wizard body"
386
+ },
387
+ {
388
+ "name": "component",
389
+ "type": "React.ElementType",
390
+ "description": "Component used as the wrapping content container",
391
+ "defaultValue": "'div'"
392
+ },
393
+ {
394
+ "name": "hasNoPadding",
395
+ "type": "boolean",
396
+ "description": "Flag to remove the default body padding",
397
+ "defaultValue": "false"
398
+ }
399
+ ]
400
+ },
401
+ {
402
+ "name": "WizardHeader",
403
+ "description": "",
404
+ "props": [
405
+ {
406
+ "name": "className",
407
+ "type": "string",
408
+ "description": "Additional classes spread to the wizard header"
409
+ },
410
+ {
411
+ "name": "closeButtonAriaLabel",
412
+ "type": "string",
413
+ "description": "Aria-label applied to the X (Close) button"
414
+ },
415
+ {
416
+ "name": "description",
417
+ "type": "React.ReactNode",
418
+ "description": "Description of the wizard"
419
+ },
420
+ {
421
+ "name": "descriptionComponent",
422
+ "type": "'div' | 'p'",
423
+ "description": "Component type of the description",
424
+ "defaultValue": "'div'"
425
+ },
426
+ {
427
+ "name": "descriptionId",
428
+ "type": "string",
429
+ "description": "id for the description"
430
+ },
431
+ {
432
+ "name": "isCloseHidden",
433
+ "type": "boolean",
434
+ "description": "Flag indicating whether the close button should be in the header"
435
+ },
436
+ {
437
+ "name": "onClose",
438
+ "type": "(event: React.MouseEvent<HTMLButtonElement>) => void",
439
+ "description": "Callback function called when the X (Close) button is clicked",
440
+ "defaultValue": "() => undefined"
441
+ },
442
+ {
443
+ "name": "title",
444
+ "type": "string",
445
+ "description": "Title of the wizard",
446
+ "required": true
447
+ },
448
+ {
449
+ "name": "titleId",
450
+ "type": "string",
451
+ "description": "id for the title"
452
+ }
453
+ ]
454
+ },
455
+ {
456
+ "name": "WizardNav",
457
+ "description": "",
458
+ "props": [
459
+ {
460
+ "name": "aria-label",
461
+ "type": "string",
462
+ "description": "Aria-label applied to the navigation element"
463
+ },
464
+ {
465
+ "name": "aria-labelledby",
466
+ "type": "string",
467
+ "description": "Sets the aria-labelledby attribute on the navigation element"
468
+ },
469
+ {
470
+ "name": "children",
471
+ "type": "any",
472
+ "description": "children should be WizardNavItem components"
473
+ },
474
+ {
475
+ "name": "className",
476
+ "type": "string",
477
+ "description": "Additional classes spread to the wizard nav"
478
+ },
479
+ {
480
+ "name": "isExpanded",
481
+ "type": "boolean",
482
+ "description": "Whether the navigation is expanded",
483
+ "defaultValue": "false"
484
+ },
485
+ {
486
+ "name": "isInnerList",
487
+ "type": "boolean",
488
+ "description": "True to return the inner list without the wrapping navigation element",
489
+ "defaultValue": "false"
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ "name": "WizardNavItem",
495
+ "description": "",
496
+ "props": [
497
+ {
498
+ "name": "children",
499
+ "type": "React.ReactNode",
500
+ "description": "Can nest a WizardNav component for substeps",
501
+ "defaultValue": "null"
502
+ },
503
+ {
504
+ "name": "className",
505
+ "type": "string",
506
+ "description": "Additional classes spread to the wizard nav item"
507
+ },
508
+ {
509
+ "name": "component",
510
+ "type": "'button' | 'a'",
511
+ "description": "Component used to render WizardNavItem",
512
+ "defaultValue": "'button'"
513
+ },
514
+ {
515
+ "name": "content",
516
+ "type": "React.ReactNode",
517
+ "description": "The content to display in the navigation item",
518
+ "defaultValue": "''"
519
+ },
520
+ {
521
+ "name": "href",
522
+ "type": "string",
523
+ "description": "An optional url to use for when using an anchor component"
524
+ },
525
+ {
526
+ "name": "id",
527
+ "type": "string | number",
528
+ "description": "The id for the navigation item"
529
+ },
530
+ {
531
+ "name": "isCurrent",
532
+ "type": "boolean",
533
+ "description": "Whether the navigation item is the currently active item",
534
+ "defaultValue": "false"
535
+ },
536
+ {
537
+ "name": "isDisabled",
538
+ "type": "boolean",
539
+ "description": "Whether the navigation item is disabled",
540
+ "defaultValue": "false"
541
+ },
542
+ {
543
+ "name": "isExpandable",
544
+ "type": "boolean",
545
+ "description": "Flag indicating that this NavItem has child steps and is expandable",
546
+ "defaultValue": "false"
547
+ },
548
+ {
549
+ "name": "isVisited",
550
+ "type": "boolean",
551
+ "description": "Whether the navigation item has been visited",
552
+ "defaultValue": "false"
553
+ },
554
+ {
555
+ "name": "onClick",
556
+ "type": "(event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, index: number) => any",
557
+ "description": "Callback for when the navigation item is clicked"
558
+ },
559
+ {
560
+ "name": "ouiaId",
561
+ "type": "number | string",
562
+ "description": ""
563
+ },
564
+ {
565
+ "name": "ouiaSafe",
566
+ "type": "boolean",
567
+ "description": "",
568
+ "defaultValue": "true"
569
+ },
570
+ {
571
+ "name": "status",
572
+ "type": "'default' | 'error' | 'success' | 'warning'",
573
+ "description": "Used to determine the icon displayed next to content. Default has no icon.",
574
+ "defaultValue": "'default'"
575
+ },
576
+ {
577
+ "name": "stepIndex",
578
+ "type": "number",
579
+ "description": "The step index passed into the onNavItemClick callback",
580
+ "required": true
581
+ },
582
+ {
583
+ "name": "target",
584
+ "type": "React.HTMLAttributeAnchorTarget",
585
+ "description": "Where to display the linked URL when using an anchor component"
586
+ }
587
+ ]
588
+ },
589
+ {
590
+ "name": "WizardContextProps",
591
+ "description": "",
592
+ "props": [
593
+ {
594
+ "name": "activeStep",
595
+ "type": "WizardStepType",
596
+ "description": "Current step",
597
+ "required": true
598
+ },
599
+ {
600
+ "name": "close",
601
+ "type": "() => void",
602
+ "description": "Close the wizard",
603
+ "required": true
604
+ },
605
+ {
606
+ "name": "footer",
607
+ "type": "React.ReactElement<any>",
608
+ "description": "Footer element",
609
+ "required": true
610
+ },
611
+ {
612
+ "name": "getStep",
613
+ "type": "(stepId: number | string) => WizardStepType",
614
+ "description": "Get step by ID",
615
+ "required": true
616
+ },
617
+ {
618
+ "name": "goToNextStep",
619
+ "type": "() => void | Promise<void>",
620
+ "description": "Navigate to the next step",
621
+ "required": true
622
+ },
623
+ {
624
+ "name": "goToPrevStep",
625
+ "type": "() => void | Promise<void>",
626
+ "description": "Navigate to the previous step",
627
+ "required": true
628
+ },
629
+ {
630
+ "name": "goToStepById",
631
+ "type": "(id: number | string) => void",
632
+ "description": "Navigate to step by ID",
633
+ "required": true
634
+ },
635
+ {
636
+ "name": "goToStepByIndex",
637
+ "type": "(index: number) => void",
638
+ "description": "Navigate to step by index",
639
+ "required": true
640
+ },
641
+ {
642
+ "name": "goToStepByName",
643
+ "type": "(name: string) => void",
644
+ "description": "Navigate to step by name",
645
+ "required": true
646
+ },
647
+ {
648
+ "name": "mainWrapperRef",
649
+ "type": "React.RefObject<HTMLElement | null>",
650
+ "description": "Ref for main wizard content element.",
651
+ "required": true
652
+ },
653
+ {
654
+ "name": "setFooter",
655
+ "type": "(footer: React.ReactElement<any> | Partial<WizardFooterProps>) => void",
656
+ "description": "Update the footer with any react element",
657
+ "required": true
658
+ },
659
+ {
660
+ "name": "setStep",
661
+ "type": "(step: Pick<WizardStepType, 'id'> & Partial<WizardStepType>) => void",
662
+ "description": "Set step by ID",
663
+ "required": true
664
+ },
665
+ {
666
+ "name": "shouldFocusContent",
667
+ "type": "boolean",
668
+ "description": "Flag indicating whether the wizard content should be focused after the onNext or onBack callbacks\nare called.",
669
+ "required": true
670
+ },
671
+ {
672
+ "name": "steps",
673
+ "type": "WizardStepType[]",
674
+ "description": "List of steps",
675
+ "required": true
676
+ }
677
+ ]
678
+ },
679
+ {
680
+ "name": "WizardBasicStep",
681
+ "description": "Type used to define 'basic' steps, or in other words, steps that are neither parents or children of parents.",
682
+ "props": [
683
+ {
684
+ "name": "component",
685
+ "type": "React.ReactElement<any>",
686
+ "description": "Content shown when the step's navigation item is selected. When treated as a parent step, only sub-step content will be shown."
687
+ },
688
+ {
689
+ "name": "footer",
690
+ "type": "React.ReactElement<any> | Partial<WizardFooterProps>",
691
+ "description": "Replaces the step's footer. The step's footer takes precedence over the wizard's footer."
692
+ },
693
+ {
694
+ "name": "id",
695
+ "type": "string | number",
696
+ "description": "Unique identifier",
697
+ "required": true
698
+ },
699
+ {
700
+ "name": "index",
701
+ "type": "number",
702
+ "description": "Order index of step (starts at 1)",
703
+ "required": true
704
+ },
705
+ {
706
+ "name": "isDisabled",
707
+ "type": "boolean",
708
+ "description": "Flag to disable the step's navigation item"
709
+ },
710
+ {
711
+ "name": "isHidden",
712
+ "type": "boolean",
713
+ "description": "Flag to determine whether the step is hidden"
714
+ },
715
+ {
716
+ "name": "isVisited",
717
+ "type": "boolean",
718
+ "description": "Flag to represent whether the step has been visited (navigated to)"
719
+ },
720
+ {
721
+ "name": "name",
722
+ "type": "React.ReactNode",
723
+ "description": "Name of the step's navigation item",
724
+ "required": true
725
+ },
726
+ {
727
+ "name": "navItem",
728
+ "type": "WizardNavItemType",
729
+ "description": "Replaces the step's navigation item or its properties."
730
+ },
731
+ {
732
+ "name": "status",
733
+ "type": "'default' | 'error' | 'success' | 'warning'",
734
+ "description": "Used to determine icon next to the step's navItem"
735
+ }
736
+ ]
737
+ },
738
+ {
739
+ "name": "WizardParentStep",
740
+ "description": "Type used to define parent steps.",
741
+ "props": [
742
+ {
743
+ "name": "isExpandable",
744
+ "type": "boolean",
745
+ "description": "Flag to determine whether the step can expand or not."
746
+ },
747
+ {
748
+ "name": "subStepIds",
749
+ "type": "(string | number)[]",
750
+ "description": "Nested step IDs",
751
+ "required": true
752
+ }
753
+ ]
754
+ },
755
+ {
756
+ "name": "WizardSubStep",
757
+ "description": "Type used to define sub-steps.",
758
+ "props": [
759
+ {
760
+ "name": "parentId",
761
+ "type": "string | number",
762
+ "description": "Unique identifier of the parent step",
763
+ "required": true
764
+ }
765
+ ]
766
+ }
767
+ ],
768
+ "cssPrefix": [
769
+ "pf-v6-c-wizard"
770
+ ],
771
+ "examples": [
772
+ "Basic",
773
+ "Plain",
774
+ "Focus content on next/back",
775
+ "Basic with disabled steps",
776
+ "Anchors for nav items",
777
+ "Incrementally enabled steps",
778
+ "Expandable steps",
779
+ "Progress after submission",
780
+ "Enabled on form validation",
781
+ "Validate on button press",
782
+ "Progressive steps",
783
+ "Get current step",
784
+ "Within modal",
785
+ "Step drawer content",
786
+ "Custom navigation",
787
+ "Header",
788
+ "Custom footer",
789
+ "Custom navigation item",
790
+ "Toggle step visibility",
791
+ "Step status"
792
+ ]
793
+ };
794
+ pageData.liveContext = {
795
+ createContext,
796
+ useCallback,
797
+ useContext,
798
+ useRef,
799
+ useState,
800
+ FormGroup,
801
+ TextInput,
802
+ Drawer,
803
+ DrawerContent,
804
+ Button,
805
+ Title,
806
+ Flex,
807
+ Checkbox,
808
+ DrawerPanelContent,
809
+ DrawerColorVariant,
810
+ DrawerHead,
811
+ DrawerActions,
812
+ DrawerCloseButton,
813
+ Modal,
814
+ ModalVariant,
815
+ Wizard,
816
+ WizardFooter,
817
+ WizardFooterWrapper,
818
+ WizardToggle,
819
+ WizardStep,
820
+ WizardBody,
821
+ useWizardFooter,
822
+ useWizardContext,
823
+ WizardNavItem,
824
+ WizardNav,
825
+ WizardHeader,
826
+ RhMicronsExternalLinkIcon,
827
+ SlackHashIcon,
828
+ CogsIcon,
829
+ styles,
830
+ layout
831
+ };
832
+ pageData.examples = {
833
+ 'Basic': props =>
834
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardBasic: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Basic wizard\">\n <WizardStep name=\"Step 1\" id=\"basic-first-step\">\n <p>\n The content of this step overflows and creates a scrollbar, which causes a tabindex of \"0\", a role of \"region\",\n and an aria-label or aria-labelledby to be applied.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer bibendum in neque nec pharetra. Duis lacinia\n vel sapien ut imperdiet. Nunc ultrices mollis dictum. Duis tempus, massa nec tincidunt tempor, enim ex porttitor\n odio, eu facilisis dolor tortor id sapien. Etiam sit amet molestie lacus. Nulla facilisi. Duis eget finibus\n ipsum. Quisque dictum enim sed sodales porta. Curabitur eget orci eu risus posuere pulvinar id nec turpis. Morbi\n mattis orci vel posuere tincidunt. Fusce bibendum et libero a auctor.\n </p>\n <p>\n Proin elementum commodo sodales. Quisque eget libero mattis, ornare augue at, egestas nisi. Mauris ultrices orci\n fringilla pretium mattis. Aliquam erat volutpat. Sed pharetra condimentum dui, nec bibendum ante. Vestibulum\n sollicitudin, sem accumsan pharetra molestie, purus turpis lacinia lorem, commodo sodales quam lectus a urna.\n Nam gravida, felis a lacinia varius, ex ipsum ultrices orci, non egestas diam velit in mi. Ut sit amet commodo\n orci. Duis sed diam odio. Duis mi metus, dignissim in odio nec, ornare aliquet libero. Sed luctus elit nibh.\n Quisque et felis diam. Integer ac metus dolor.\n </p>\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"basic-second-step\">\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"basic-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Basic","lang":"ts","className":""}}>
835
+
836
+ </Example>,
837
+ 'Plain': props =>
838
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardPlain: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Plain wizard\" isPlain>\n <WizardStep name=\"Step 1\" id=\"plain-first-step\">\n <p>Step 1 content</p>\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"plain-second-step\">\n <p>Step 2 content</p>\n </WizardStep>\n <WizardStep name=\"Review\" id=\"plain-review-step\" footer={{ nextButtonText: 'Finish' }}>\n <p>Review step content</p>\n </WizardStep>\n </Wizard>\n);\n","title":"Plain","lang":"ts","className":""}}>
839
+
840
+ </Example>,
841
+ 'Focus content on next/back': props =>
842
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardFocusOnNextBack: React.FunctionComponent = () => (\n <Wizard shouldFocusContent title=\"Wizard that focuses content on next or back click\">\n <WizardStep name=\"Step 1\" id=\"wizard-focus-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"wizard-focus-second-step\">\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"wizard-focus-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Focus content on next/back","lang":"ts","className":""}}>
843
+
844
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
845
+ {`To focus the main content element of the `}
846
+
847
+ <code {...{"className":"ws-code "}}>
848
+ {`Wizard`}
849
+ </code>
850
+ {`, pass in the `}
851
+
852
+ <code {...{"className":"ws-code "}}>
853
+ {`shouldFocusContent`}
854
+ </code>
855
+ {` property. It is recommended that this is passed in so that users can navigate through a `}
856
+
857
+ <code {...{"className":"ws-code "}}>
858
+ {`WizardStep`}
859
+ </code>
860
+ {` content in order.`}
861
+ </p>
862
+ </Example>,
863
+ 'Basic with disabled steps': props =>
864
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardBasicDisabledSteps: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Basic disabled wizard\">\n <WizardStep name=\"Step 1\" id=\"bdisabled-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"bdisabled-second-step\" isDisabled>\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Step 3\" id=\"bdisabled-third-step\">\n Step 3 content\n </WizardStep>\n <WizardStep name=\"Step 4\" id=\"bdisabled-fourth-step\" isDisabled>\n Step 4 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"bdisabled-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Basic with disabled steps","lang":"ts","className":""}}>
865
+
866
+ </Example>,
867
+ 'Anchors for nav items': props =>
868
+ <Example {...pageData} {...props} {...{"code":"import { Button, Wizard, WizardStep } from '@patternfly/react-core';\nimport RhMicronsExternalLinkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-external-link-icon';\nimport SlackHashIcon from '@patternfly/react-icons/dist/esm/icons/slack-hash-icon';\n\nexport const WizardWithNavAnchors: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Anchor link wizard\">\n <WizardStep\n name={\n <>\n <RhMicronsExternalLinkIcon /> PF3\n </>\n }\n id=\"navanchors-pf3-step\"\n navItem={{ component: 'a', href: 'https://www.patternfly.org/v3', target: '_blank' }}\n >\n Step 1: Read about PF3\n </WizardStep>\n <WizardStep\n name={\n <>\n <RhMicronsExternalLinkIcon /> PF4\n </>\n }\n id=\"navanchors-pf4-step\"\n navItem={{ component: 'a', href: 'https://www.patternfly.org/v4', target: '_blank' }}\n >\n Step 2: Read about PF4\n </WizardStep>\n <WizardStep\n name={\n <>\n <SlackHashIcon /> Join us on slack\n </>\n }\n id=\"navanchors-slack-step\"\n navItem={{ component: 'a', href: 'https://patternfly.slack.com', target: '_blank' }}\n >\n <Button variant=\"link\" component=\"a\" target=\"_blank\" href=\"https://patternfly.slack.com\">\n Join the conversation\n </Button>\n </WizardStep>\n </Wizard>\n);\n","title":"Anchors for nav items","lang":"ts","className":""}}>
869
+
870
+ </Example>,
871
+ 'Incrementally enabled steps': props =>
872
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardStepVisitRequired: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Incrementally enabled steps wizard\" isVisitRequired>\n <WizardStep name=\"Step 1\" id=\"req-visit-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"req-visit-second-step\">\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Step 3\" id=\"req-visit-third-step\">\n Step 3 content\n </WizardStep>\n <WizardStep name=\"Step 4\" id=\"req-visit-fourth-step\">\n Step 4 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"req-visit-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Incrementally enabled steps","lang":"ts","className":""}}>
873
+
874
+ </Example>,
875
+ 'Expandable steps': props =>
876
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardExpandableSteps: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Expandable steps wizard\" nav={{ isExpanded: true }}>\n <WizardStep\n name=\"Step 1\"\n id=\"expand-steps-1\"\n isExpandable\n steps={[\n <WizardStep name=\"Substep A\" id=\"expand-steps-sub-a\" key=\"expand-steps-sub-a\">\n Substep A content\n </WizardStep>,\n <WizardStep name=\"Substep B\" id=\"expand-steps-sub-b\" key=\"expand-steps-sub-b\">\n Substep B content\n </WizardStep>\n ]}\n />\n <WizardStep name=\"Step 2\" id=\"expand-steps-2\">\n Step 2 content\n </WizardStep>\n <WizardStep\n name=\"Step 3\"\n id=\"expand-steps-3\"\n isExpandable\n steps={[\n <WizardStep name=\"Substep C\" id=\"expand-steps-sub-c\" key=\"expand-steps-sub-c\">\n Substep C content\n </WizardStep>,\n <WizardStep name=\"Substep D\" id=\"expand-steps-sub-d\" key=\"expand-steps-sub-d\">\n Substep D content\n </WizardStep>\n ]}\n />\n <WizardStep name=\"Step 4\" id=\"expand-steps-4\">\n Step 4 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"expand-steps-review\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Expandable steps","lang":"ts","className":""}}>
877
+
878
+ </Example>,
879
+ 'Progress after submission': props =>
880
+ <Example {...pageData} {...props} {...{"code":"import { useCallback, useEffect, useState } from 'react';\nimport {\n EmptyState,\n EmptyStateFooter,\n EmptyStateBody,\n EmptyStateActions,\n Progress,\n Button,\n Wizard,\n WizardStep\n} from '@patternfly/react-core';\nimport CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon';\nimport layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';\n\ninterface ValidationProgressProps {\n onClose(): void;\n}\n\nconst ValidationProgress: React.FunctionComponent<ValidationProgressProps> = ({ onClose }) => {\n const [percentValidated, setPercentValidated] = useState(0);\n\n const tick = useCallback(() => {\n if (percentValidated < 100) {\n setPercentValidated((prevValue) => prevValue + 20);\n }\n }, [percentValidated]);\n\n useEffect(() => {\n const interval = setInterval(() => tick(), 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, [tick]);\n\n return (\n <div className={layout.bullseye}>\n <EmptyState\n headingLevel=\"h4\"\n titleText={percentValidated === 100 ? 'Validation complete' : 'Validating credentials'}\n icon={CogsIcon}\n variant=\"lg\"\n >\n <EmptyStateBody>\n <Progress value={percentValidated} measureLocation=\"outside\" aria-label=\"Wizard validation progress\" />\n </EmptyStateBody>\n <EmptyStateBody>\n Description can be used to further elaborate on the validation step, or give the user a better idea of how\n long the process will take.\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button isDisabled={percentValidated !== 100} onClick={onClose}>\n Log to console\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </div>\n );\n};\n\nexport const WizardWithSubmitProgress: React.FunctionComponent = () => {\n const [isSubmitted, setIsSubmitted] = useState(false);\n\n // eslint-disable-next-line no-console\n const onClose = () => console.log('Some close action occurs here.');\n\n if (isSubmitted) {\n return <ValidationProgress onClose={onClose} />;\n }\n\n return (\n <Wizard height={400} title=\"Submit progress wizard\" onClose={onClose}>\n <WizardStep name=\"Step 1\" id=\"submit-progress-step-1\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"submit-progress-step-2\">\n Step 2 content\n </WizardStep>\n <WizardStep\n name=\"Review\"\n id=\"submit-progress-review\"\n footer={{ nextButtonText: 'Finish', onNext: () => setIsSubmitted(true) }}\n >\n Review step content\n </WizardStep>\n </Wizard>\n );\n};\n","title":"Progress after submission","lang":"ts","className":""}}>
881
+
882
+ </Example>,
883
+ 'Enabled on form validation': props =>
884
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Form,\n FormGroup,\n FormHelperText,\n HelperText,\n HelperTextItem,\n TextInput,\n Wizard,\n WizardStep\n} from '@patternfly/react-core';\n\ninterface SampleFormProps {\n value: string;\n isValid: boolean;\n setValue: (value: string) => void;\n setIsValid: (isValid: boolean) => void;\n}\n\nconst SampleForm: React.FunctionComponent<SampleFormProps> = ({ value, isValid, setValue, setIsValid }) => {\n const validated = isValid ? 'default' : 'error';\n\n const handleTextInputChange = (_event, value: string) => {\n const isValid = /^\\d+$/.test(value);\n\n setValue(value);\n setIsValid(isValid);\n };\n\n return (\n <Form>\n <FormGroup label=\"Age:\" type=\"number\" fieldId=\"age\">\n <TextInput\n validated={validated}\n value={value}\n id=\"age\"\n aria-describedby=\"age-helper\"\n onChange={handleTextInputChange}\n />\n <FormHelperText>\n <HelperText>\n <HelperTextItem variant={validated}>\n {validated === 'error' ? 'Age has to be a number' : 'Write your age in numbers.'}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n </FormGroup>\n </Form>\n );\n};\n\nexport const WizardEnabledOnFormValidation: React.FunctionComponent = () => {\n const [ageValue, setAgeValue] = useState('Thirty');\n const [isSubAFormValid, setIsSubAFormValid] = useState(false);\n\n const onSave = () => alert(`Wow, you look a lot younger than ${ageValue}.`);\n\n return (\n <Wizard isVisitRequired height={400} title=\"Enabled on form validation wizard\" onSave={onSave}>\n <WizardStep name=\"Information\" id=\"form-valid-info\">\n Information content\n </WizardStep>\n <WizardStep\n name=\"Configuration\"\n id=\"form-valid-config\"\n steps={[\n <WizardStep\n name=\"Substep A with validation\"\n id=\"form-valid-sub-a\"\n key=\"form-valid-sub-a\"\n footer={{ isNextDisabled: !isSubAFormValid }}\n >\n <SampleForm\n value={ageValue}\n setValue={setAgeValue}\n isValid={isSubAFormValid}\n setIsValid={setIsSubAFormValid}\n />\n </WizardStep>,\n <WizardStep name=\"Substep B\" id=\"form-valid-sub-b\" key=\"form-valid-sub-b\">\n Substep B content\n </WizardStep>\n ]}\n />\n <WizardStep name=\"Additional\" id=\"form-valid-additional\">\n Additional step content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"form-valid-review\" footer={{ nextButtonText: 'Submit form' }}></WizardStep>\n </Wizard>\n );\n};\n","title":"Enabled on form validation","lang":"ts","className":""}}>
885
+
886
+ </Example>,
887
+ 'Validate on button press': props =>
888
+ <Example {...pageData} {...props} {...{"code":"import { useCallback, useEffect, useState } from 'react';\nimport {\n Button,\n ActionList,\n ActionListGroup,\n ActionListItem,\n Alert,\n EmptyState,\n EmptyStateFooter,\n EmptyStateBody,\n EmptyStateActions,\n Progress,\n Form,\n FormGroup,\n TextInput,\n HelperText,\n HelperTextItem,\n FormHelperText,\n Wizard,\n WizardStep,\n WizardFooterWrapper,\n useWizardContext\n} from '@patternfly/react-core';\nimport CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon';\nimport layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';\n\ninterface ValidationProgressProps {\n onClose(): void;\n}\n\nconst ValidationProgress: React.FunctionComponent<ValidationProgressProps> = ({ onClose }) => {\n const [percentValidated, setPercentValidated] = useState(0);\n\n const tick = useCallback(() => {\n if (percentValidated < 100) {\n setPercentValidated((prevValue) => prevValue + 20);\n }\n }, [percentValidated]);\n\n useEffect(() => {\n const interval = setInterval(() => tick(), 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, [tick]);\n\n return (\n <div className={layout.bullseye}>\n <EmptyState\n headingLevel=\"h4\"\n titleText={percentValidated === 100 ? 'Validation complete' : 'Validating credentials'}\n icon={CogsIcon}\n variant=\"lg\"\n >\n <EmptyStateBody>\n <Progress value={percentValidated} measureLocation=\"outside\" aria-label=\"Wizard validation progress\" />\n </EmptyStateBody>\n <EmptyStateBody>\n Description can be used to further elaborate on the validation step, or give the user a better idea of how\n long the process will take.\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button isDisabled={percentValidated !== 100} onClick={onClose}>\n Log to console\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </div>\n );\n};\n\ninterface LastStepFooterProps {\n isValid: boolean;\n setIsSubmitted(isSubmitted: boolean): void;\n setHasErrorOnSubmit(isSubmitted: boolean): void;\n}\n\nconst LastStepFooter: React.FunctionComponent<LastStepFooterProps> = ({\n isValid,\n setIsSubmitted,\n setHasErrorOnSubmit\n}) => {\n const { goToNextStep, goToPrevStep } = useWizardContext();\n\n const onValidate = () => {\n setIsSubmitted(true);\n\n if (!isValid) {\n setIsSubmitted(false);\n setHasErrorOnSubmit(true);\n } else {\n goToNextStep();\n }\n };\n\n return (\n <WizardFooterWrapper>\n <ActionList>\n <ActionListGroup>\n <ActionListItem>\n <Button variant=\"secondary\" onClick={goToPrevStep}>\n Back\n </Button>\n </ActionListItem>\n <ActionListItem>\n <Button onClick={onValidate}>Validate</Button>\n </ActionListItem>\n </ActionListGroup>\n </ActionList>\n </WizardFooterWrapper>\n );\n};\n\ninterface SampleFormProps {\n value: string;\n isValid: boolean;\n setValue: (value: string) => void;\n setIsValid: (isValid: boolean) => void;\n}\n\nconst SampleForm: React.FunctionComponent<SampleFormProps> = ({ value, isValid, setValue, setIsValid }) => {\n const validated = isValid ? 'default' : 'error';\n\n const handleTextInputChange = (_event, value: string) => {\n const isValid = /^\\d+$/.test(value);\n\n setValue(value);\n setIsValid(isValid);\n };\n\n return (\n <Form>\n <FormGroup label=\"Age:\" type=\"number\" fieldId=\"age\">\n <TextInput\n validated={validated}\n value={value}\n id=\"age\"\n aria-describedby=\"age-helper\"\n onChange={handleTextInputChange}\n />\n <FormHelperText>\n <HelperText>\n <HelperTextItem variant={validated}>\n {validated === 'error' ? 'Age has to be a number' : 'Write your age in numbers.'}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n </FormGroup>\n </Form>\n );\n};\n\nexport const WizardValidateOnButtonPress: React.FunctionComponent = () => {\n const [ageValue, setAgeValue] = useState('Thirty');\n const [isSubmitted, setIsSubmitted] = useState(false);\n const [isFirstStepValid, setIsFirstStepValid] = useState(false);\n const [hasErrorOnSubmit, setHasErrorOnSubmit] = useState(false);\n\n // eslint-disable-next-line no-console\n const onClose = () => console.log('Some close action occurs here.');\n\n if (isSubmitted && isFirstStepValid) {\n return <ValidationProgress onClose={onClose} />;\n }\n\n return (\n <Wizard title=\"Validate on button press wizard\" onClose={onClose} height={400}>\n <WizardStep name=\"Step 1\" id=\"validate-btn-step-1\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"validate-btn-step-2\">\n Step 2 content\n </WizardStep>\n <WizardStep\n name=\"Final Step\"\n id=\"validate-btn-finish-step\"\n footer={\n <LastStepFooter\n isValid={isFirstStepValid}\n setIsSubmitted={setIsSubmitted}\n setHasErrorOnSubmit={setHasErrorOnSubmit}\n />\n }\n >\n {hasErrorOnSubmit && (\n <div style={{ padding: '15px 0' }}>\n <Alert isInline variant=\"danger\" title=\"Validation failed, please try again.\" />\n </div>\n )}\n <SampleForm\n value={ageValue}\n setValue={(value) => setAgeValue(value)}\n isValid={!hasErrorOnSubmit || isFirstStepValid}\n setIsValid={setIsFirstStepValid}\n />\n </WizardStep>\n </Wizard>\n );\n};\n","title":"Validate on button press","lang":"ts","className":""}}>
889
+
890
+ </Example>,
891
+ 'Progressive steps': props =>
892
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardProgressiveSteps: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Progressive steps wizard\" isProgressive>\n <WizardStep id=\"progressive-step-1\" name=\"Get started\">\n Get started content\n </WizardStep>\n <WizardStep id=\"progressive-step-2\" name=\"Update options\">\n Update options content\n </WizardStep>\n <WizardStep\n id=\"progressive-step-3\"\n name=\"Quick options\"\n steps={[\n <WizardStep key=\"progressive-substep-1\" id=\"progressive-substep-1\" name=\"Substep 1\">\n Substep 1 content\n </WizardStep>,\n <WizardStep key=\"progressive-substep-2\" id=\"progressive-substep-2\" name=\"Substep 2\">\n Substep 2 content\n </WizardStep>,\n <WizardStep key=\"progressive-substep-3\" id=\"progressive-substep-3\" name=\"Substep 3\">\n Substep 3 content\n </WizardStep>\n ]}\n />\n <WizardStep id=\"progressive-step-4\" name=\"Review\" footer={{ nextButtonText: 'Finish' }}>\n Review content\n </WizardStep>\n </Wizard>\n);\n","title":"Progressive steps","lang":"ts","className":""}}>
893
+
894
+ </Example>,
895
+ 'Get current step': props =>
896
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n DescriptionList,\n DescriptionListGroup,\n DescriptionListTerm,\n DescriptionListDescription,\n Wizard,\n WizardStep,\n WizardStepType\n} from '@patternfly/react-core';\n\nconst CurrentStepDescriptionList = ({ currentStep }: { currentStep: WizardStepType | undefined }) => (\n <DescriptionList isHorizontal isCompact aria-label={`${currentStep?.name} prop data`}>\n <DescriptionListGroup>\n <DescriptionListTerm>Index</DescriptionListTerm>\n <DescriptionListDescription>{currentStep?.index}</DescriptionListDescription>\n </DescriptionListGroup>\n\n <DescriptionListGroup>\n <DescriptionListTerm>ID</DescriptionListTerm>\n <DescriptionListDescription>{currentStep?.id}</DescriptionListDescription>\n </DescriptionListGroup>\n\n <DescriptionListGroup>\n <DescriptionListTerm>Name</DescriptionListTerm>\n <DescriptionListDescription>{currentStep?.name}</DescriptionListDescription>\n </DescriptionListGroup>\n\n <DescriptionListGroup>\n <DescriptionListTerm>Visited</DescriptionListTerm>\n <DescriptionListDescription>{currentStep?.isVisited ? 'true' : 'false'}</DescriptionListDescription>\n </DescriptionListGroup>\n </DescriptionList>\n);\n\nexport const GetCurrentStepWizard: React.FunctionComponent = () => {\n const [currentStep, setCurrentStep] = useState<WizardStepType>();\n\n const onStepChange = (_event: React.MouseEvent<HTMLButtonElement>, currentStep: WizardStepType) =>\n setCurrentStep(currentStep);\n\n return (\n <Wizard height={400} title=\"Get current step wizard\" onStepChange={onStepChange}>\n <WizardStep name=\"Step 1\" id=\"get-current-step-1\">\n {currentStep ? <CurrentStepDescriptionList currentStep={currentStep} /> : 'Step 1 content'}\n </WizardStep>\n <WizardStep\n name=\"Step 2\"\n id=\"get-current-step-2\"\n isDisabled\n steps={[\n <WizardStep name=\"Substep 1\" id=\"get-current-substep-1\" key=\"get-current-substep-1\">\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>,\n <WizardStep name=\"Substep 2\" id=\"get-current-substep-2\" key=\"get-current-substep-2\">\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>\n ]}\n />\n <WizardStep\n name=\"Step 3\"\n id=\"get-current-step-3\"\n steps={[\n <WizardStep name=\"Substep 3\" id=\"get-current-substep-3\" key=\"get-current-substep-3\">\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>,\n <WizardStep name=\"Substep 4\" id=\"get-current-substep-4\" key=\"get-current-substep-4\">\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>\n ]}\n />\n <WizardStep\n name=\"Step 4\"\n id=\"get-current-step-4\"\n steps={[\n <WizardStep name=\"Substep 5\" id=\"get-current-substep-5\" key=\"get-current-substep-5\" isHidden>\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>,\n <WizardStep name=\"Substep 6\" id=\"get-current-substep-6\" key=\"get-current-substep-6\">\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>\n ]}\n />\n <WizardStep name=\"Review\" id=\"get-current-review-step\" footer={{ nextButtonText: 'Finish' }}>\n <CurrentStepDescriptionList currentStep={currentStep} />\n </WizardStep>\n </Wizard>\n );\n};\n","title":"Get current step","lang":"ts","className":""}}>
897
+
898
+ </Example>,
899
+ 'Within modal': props =>
900
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Button, Modal, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core';\n\nexport const WizardWithinModal: React.FunctionComponent = () => {\n const [isModelOpen, setIsModalOpen] = useState(false);\n\n return (\n <>\n <Button onClick={() => setIsModalOpen(true)}>Show Modal</Button>\n\n <Modal\n isOpen={isModelOpen}\n aria-label=\"Wizard modal\"\n onEscapePress={() => setIsModalOpen(false)}\n variant={ModalVariant.medium}\n >\n <Wizard\n height={400}\n onClose={() => setIsModalOpen(false)}\n title=\"In modal wizard\"\n header={\n <WizardHeader\n onClose={() => setIsModalOpen(false)}\n title=\"Wizard in modal\"\n description=\"Simple wizard description\"\n />\n }\n >\n <WizardStep name=\"Step 1\" id=\"in-modal-step-1\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"in-modal-step-2\">\n Step 2 content\n </WizardStep>\n <WizardStep\n name=\"Review\"\n id=\"in-modal-review-step\"\n footer={{ nextButtonText: 'Finish', onNext: () => setIsModalOpen(false) }}\n >\n Review step content\n </WizardStep>\n </Wizard>\n </Modal>\n </>\n );\n};\n","title":"Within modal","lang":"ts","className":""}}>
901
+
902
+ </Example>,
903
+ 'Step drawer content': props =>
904
+ <Example {...pageData} {...props} {...{"code":"import { useRef, useState } from 'react';\nimport {\n Drawer,\n DrawerContent,\n DrawerPanelContent,\n DrawerColorVariant,\n DrawerHead,\n DrawerActions,\n DrawerCloseButton,\n Flex,\n Button,\n useWizardContext,\n Wizard,\n WizardStep\n} from '@patternfly/react-core';\nimport styles from '@patternfly/react-styles/css/components/Wizard/wizard';\n\nconst StepContentWithDrawer: React.FunctionComponent = () => {\n const [isDrawerExpanded, setIsDrawerExpanded] = useState(false);\n const { activeStep } = useWizardContext();\n const drawerRef = useRef<HTMLSpanElement>(null);\n\n const onWizardExpand = () => drawerRef.current && drawerRef.current.focus();\n\n return (\n <Drawer isInline isExpanded={isDrawerExpanded} onExpand={onWizardExpand}>\n <DrawerContent\n panelContent={\n <DrawerPanelContent widths={{ default: 'width_50' }} colorVariant={DrawerColorVariant.secondary}>\n <DrawerHead>\n <span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>\n Drawer content: <strong>{activeStep?.name}</strong>\n </span>\n <DrawerActions>\n <DrawerCloseButton onClick={() => setIsDrawerExpanded(false)} />\n </DrawerActions>\n </DrawerHead>\n </DrawerPanelContent>\n }\n >\n <Flex\n className={styles.wizardMainBody}\n direction={{ default: 'column' }}\n spaceItems={{ default: 'spaceItemsLg' }}\n height=\"100%\"\n >\n {!isDrawerExpanded && (\n <Button isInline variant=\"link\" onClick={() => setIsDrawerExpanded((prevExpanded) => !prevExpanded)}>\n Open drawer\n </Button>\n )}\n <div>{activeStep?.name} content</div>\n </Flex>\n </DrawerContent>\n </Drawer>\n );\n};\n\nexport const WizardStepDrawerContent: React.FunctionComponent = () => (\n <Wizard height={400} title=\"With drawer wizard\">\n <WizardStep body={{ hasNoPadding: true }} name=\"Step 1\" id=\"with-drawer-step-1\">\n <StepContentWithDrawer />\n </WizardStep>\n <WizardStep\n name=\"Step 2\"\n id=\"with-drawer-step-2\"\n steps={[\n <WizardStep\n body={{ hasNoPadding: true }}\n key=\"with-drawer-substep-1\"\n name=\"Substep 1\"\n id=\"with-drawer-substep-1\"\n >\n <StepContentWithDrawer />\n </WizardStep>,\n <WizardStep\n body={{ hasNoPadding: true }}\n key=\"with-drawer-substep-2\"\n name=\"Substep 2\"\n id=\"with-drawer-substep-2\"\n >\n <StepContentWithDrawer />\n </WizardStep>\n ]}\n >\n <StepContentWithDrawer />\n </WizardStep>\n <WizardStep name=\"Review\" id=\"with-drawer-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Step drawer content","lang":"ts","className":""}}>
905
+
906
+ </Example>,
907
+ 'Custom navigation': props =>
908
+ <Example {...pageData} {...props} {...{"code":"import {\n Wizard,\n WizardStep,\n WizardStepType,\n CustomWizardNavFunction,\n WizardNav,\n WizardNavItem\n} from '@patternfly/react-core';\n\nexport const WizardWithCustomNav: React.FunctionComponent = () => {\n const nav: CustomWizardNavFunction = (\n isExpanded: boolean,\n steps: WizardStepType[],\n activeStep: WizardStepType,\n goToStepByIndex: (index: number) => void\n ) => (\n <WizardNav isExpanded={isExpanded}>\n {steps.map((step) => (\n <WizardNavItem\n key={step.id}\n id={step.id}\n content={step.name}\n isCurrent={activeStep.id === step.id}\n isDisabled={step.isDisabled}\n stepIndex={step.index}\n onClick={() => goToStepByIndex(step.index)}\n />\n ))}\n </WizardNav>\n );\n\n return (\n <Wizard height={400} nav={nav}>\n <WizardStep name=\"Step 1\" id=\"custom-nav-first-step\">\n Did you say...custom nav?\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"custom-nav-second-step\">\n Oh, you didn't?\n </WizardStep>\n <WizardStep name=\"Review\" id=\"custom-nav-review-step\" footer={{ nextButtonText: 'Wrap it up' }}>\n Well, this is awkward.\n </WizardStep>\n </Wizard>\n );\n};\n","title":"Custom navigation","lang":"ts","className":""}}>
909
+
910
+ </Example>,
911
+ 'Header': props =>
912
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardHeader, WizardStep } from '@patternfly/react-core';\n\nexport const WizardWithHeader: React.FunctionComponent = () => (\n <Wizard\n height={400}\n title=\"Header wizard\"\n header={\n <WizardHeader\n title=\"You're a wizard, Harry\"\n description=\"To be clear, all those not named Harry are not wizards.\"\n closeButtonAriaLabel=\"Close header\"\n />\n }\n >\n <WizardStep name=\"Step 1\" id=\"header-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"header-second-step\">\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"header-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Header","lang":"ts","className":""}}>
913
+
914
+ </Example>,
915
+ 'Custom footer': props =>
916
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n ActionList,\n ActionListGroup,\n ActionListItem,\n Button,\n Flex,\n FlexItem,\n Spinner,\n useWizardContext,\n Wizard,\n WizardFooter,\n WizardFooterWrapper,\n WizardStep\n} from '@patternfly/react-core';\n\nconst CustomWizardFooter = () => {\n const { activeStep, goToNextStep, goToPrevStep, close } = useWizardContext();\n\n return (\n <WizardFooter\n activeStep={activeStep}\n onNext={goToNextStep}\n onBack={goToPrevStep}\n onClose={close}\n isBackDisabled={activeStep.index === 1}\n />\n );\n};\n\nconst CustomStepTwoFooter = () => {\n const { goToNextStep, goToPrevStep, close } = useWizardContext();\n const [isLoading, setIsLoading] = useState(false);\n\n async function onNext() {\n setIsLoading(true);\n await new Promise((resolve) => setTimeout(resolve, 2000));\n setIsLoading(false);\n\n goToNextStep();\n }\n\n return (\n <WizardFooterWrapper>\n <ActionList>\n <ActionListGroup>\n <ActionListItem>\n <Button variant=\"secondary\" onClick={goToPrevStep} isDisabled={isLoading}>\n Back\n </Button>\n </ActionListItem>\n <ActionListItem>\n <Button variant=\"primary\" onClick={onNext} isLoading={isLoading} isDisabled={isLoading}>\n Async Next\n </Button>\n </ActionListItem>\n </ActionListGroup>\n <ActionListGroup>\n <ActionListItem>\n <Button variant=\"link\" onClick={close} isDisabled={isLoading}>\n Cancel\n </Button>\n </ActionListItem>\n </ActionListGroup>\n </ActionList>\n </WizardFooterWrapper>\n );\n};\n\ninterface ReviewStepContentProps {\n isSubmitting: boolean | undefined;\n}\n\nconst ReviewStepContent: React.FunctionComponent<ReviewStepContentProps> = ({ isSubmitting }) => {\n if (isSubmitting === undefined) {\n return <FlexItem alignSelf={{ default: 'alignSelfFlexStart' }}>Review step content</FlexItem>;\n }\n\n if (isSubmitting) {\n return (\n <>\n <div>Calculating wizard score...</div>\n <Spinner />\n </>\n );\n }\n\n return <>50 points to Gryffindor!</>;\n};\n\nexport const WizardWithCustomFooter: React.FunctionComponent = () => {\n const [isSubmitting, setIsSubmitting] = useState<boolean>();\n\n async function onSubmit(): Promise<void> {\n setIsSubmitting(true);\n\n await new Promise((resolve) => setTimeout(resolve, 5000));\n\n setIsSubmitting(false);\n }\n\n return (\n <Wizard height={400} title=\"Custom footer wizard\" footer={<CustomWizardFooter />}>\n <WizardStep name=\"Step 1\" id=\"custom-footer-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep id=\"custom-footer-second-step\" name=\"Step 2\" footer={<CustomStepTwoFooter />}>\n Step 2 content with a custom async footer\n </WizardStep>\n <WizardStep\n id=\"custom-footer-review-step\"\n name=\"Review\"\n footer={{\n nextButtonText: 'Submit',\n onNext: onSubmit,\n isNextDisabled: isSubmitting,\n isBackDisabled: isSubmitting\n }}\n >\n <Flex\n direction={{ default: 'column' }}\n alignItems={{ default: 'alignItemsCenter' }}\n spaceItems={{ default: 'spaceItemsLg' }}\n >\n <ReviewStepContent isSubmitting={isSubmitting} />\n </Flex>\n </WizardStep>\n </Wizard>\n );\n};\n","title":"Custom footer","lang":"ts","className":""}}>
917
+
918
+ </Example>,
919
+ 'Custom navigation item': props =>
920
+ <Example {...pageData} {...props} {...{"code":"import { Wizard, WizardStep } from '@patternfly/react-core';\n\nexport const WizardWithCustomNavItem: React.FunctionComponent = () => (\n <Wizard height={400} title=\"Custom navigation item wizard\">\n <WizardStep name=\"Step 1\" id=\"custom-nav-item-first-step\">\n Step 1 content\n </WizardStep>\n <WizardStep\n id=\"custom-nav-item-second-step\"\n name=\"Step 2\"\n navItem={{\n content: <span>Custom item</span>\n }}\n >\n Step 2 content with a custom navigation item\n </WizardStep>\n <WizardStep name=\"Review\" id=\"custom-nav-item-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n);\n","title":"Custom navigation item","lang":"ts","className":""}}>
921
+
922
+ </Example>,
923
+ 'Toggle step visibility': props =>
924
+ <Example {...pageData} {...props} {...{"code":"import { createContext, useContext, useState } from 'react';\nimport { Checkbox, Wizard, WizardStep } from '@patternfly/react-core';\n\ninterface SomeContextProps {\n isToggleStepChecked: boolean;\n setIsToggleStepChecked(isHidden: boolean): void;\n}\ntype SomeContextRenderProps = Pick<SomeContextProps, 'isToggleStepChecked'>;\ninterface SomeContextProviderProps {\n children: (context: SomeContextRenderProps) => React.ReactElement<any>;\n}\n\nconst SomeContext: React.Context<SomeContextProps> = createContext({} as SomeContextProps);\n\nconst SomeContextProvider: React.FunctionComponent<SomeContextProviderProps> = ({ children }) => {\n const [isToggleStepChecked, setIsToggleStepChecked] = useState(false);\n\n return (\n <SomeContext.Provider value={{ isToggleStepChecked, setIsToggleStepChecked }}>\n {children({ isToggleStepChecked })}\n </SomeContext.Provider>\n );\n};\n\nconst StepContentWithAction: React.FunctionComponent = () => {\n const { isToggleStepChecked, setIsToggleStepChecked } = useContext(SomeContext);\n\n return (\n <Checkbox\n label=\"Toggle visibility of the next step\"\n isChecked={isToggleStepChecked}\n onChange={(_event, checked) => setIsToggleStepChecked(checked)}\n id=\"toggle-hide-step-checkbox\"\n name=\"Toggle Hide Step Checkbox\"\n />\n );\n};\n\nexport const WizardToggleStepVisibility: React.FunctionComponent = () => (\n <SomeContextProvider>\n {({ isToggleStepChecked }) => (\n <Wizard height={400} title=\"Toggle step visibility wizard\">\n <WizardStep name=\"Hidden action step\" id=\"toggle-visible-step-1\">\n <StepContentWithAction />\n </WizardStep>\n <WizardStep name=\"Step 2\" id=\"toggle-visible-step-2\" isHidden={isToggleStepChecked}>\n Step 2 content\n </WizardStep>\n <WizardStep name=\"Review\" id=\"toggle-visible-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n )}\n </SomeContextProvider>\n);\n","title":"Toggle step visibility","lang":"ts","className":""}}>
925
+
926
+ </Example>,
927
+ 'Step status': props =>
928
+ <Example {...pageData} {...props} {...{"code":"import { createContext, useContext, useState } from 'react';\nimport { Radio, Wizard, WizardStep } from '@patternfly/react-core';\n\ninterface SomeContextProps {\n errorMessage: string | undefined;\n setErrorMessage(error: string | undefined): void;\n successMessage: string | undefined;\n setSuccessMessage(error: string | undefined): void;\n warningMessage: string | undefined;\n setWarningMessage(error: string | undefined): void;\n}\ntype SomeContextRenderProps = Pick<SomeContextProps, 'successMessage', 'errorMessage', 'warningMessage'>;\ninterface SomeContextProviderProps {\n children: (context: SomeContextRenderProps) => React.ReactElement<any>;\n}\n\nconst SomeContext: React.Context<SomeContextProps> = createContext({} as SomeContextProps);\n\nconst SomeContextProvider = ({ children }: SomeContextProviderProps) => {\n const [errorMessage, setErrorMessage] = useState<string>();\n const [successMessage, setSuccessMessage] = useState<string>();\n const [warningMessage, setWarningMessage] = useState<string>();\n\n return (\n <SomeContext.Provider\n value={{ errorMessage, setErrorMessage, successMessage, setSuccessMessage, warningMessage, setWarningMessage }}\n >\n {children({ errorMessage, successMessage, warningMessage })}\n </SomeContext.Provider>\n );\n};\n\nconst StepContentWithAction = () => {\n const { errorMessage, setErrorMessage, successMessage, setSuccessMessage, warningMessage, setWarningMessage } =\n useContext(SomeContext);\n\n return (\n <>\n <Radio\n label=\"Give step 1 an error status\"\n isChecked={!!errorMessage}\n onChange={(_event, checked) => {\n setErrorMessage(checked ? 'Some error message' : undefined);\n setSuccessMessage(checked ? undefined : successMessage);\n setWarningMessage(checked ? undefined : warningMessage);\n }}\n id=\"toggle-error-checkbox\"\n name=\"Toggle Status\"\n />\n <Radio\n label=\"Give step 1 a success status\"\n isChecked={!!successMessage}\n onChange={(_event, checked) => {\n setSuccessMessage(checked ? 'Some success message' : undefined);\n setErrorMessage(checked ? undefined : errorMessage);\n setWarningMessage(checked ? undefined : warningMessage);\n }}\n id=\"toggle-success-checkbox\"\n name=\"Toggle Status\"\n />\n <Radio\n label=\"Give step 1 a warning status\"\n isChecked={!!warningMessage}\n onChange={(_event, checked) => {\n setWarningMessage(checked ? 'Some warning message' : undefined);\n setErrorMessage(checked ? undefined : errorMessage);\n setSuccessMessage(checked ? undefined : successMessage);\n }}\n id=\"toggle-warning-checkbox\"\n name=\"Toggle Status\"\n />\n </>\n );\n};\n\nexport const WizardStepStatus: React.FunctionComponent = () => (\n <SomeContextProvider>\n {({ errorMessage, successMessage, warningMessage }) => {\n let status = 'default';\n if (errorMessage) {\n status = 'error';\n } else if (successMessage) {\n status = 'success';\n } else if (warningMessage) {\n status = 'warning';\n }\n return (\n <Wizard height={400} title=\"Step status wizard\">\n <WizardStep status={status} id=\"status-step-1\" name=\"Step 1\">\n Step 1 content\n </WizardStep>\n <WizardStep name=\"Status step\" id=\"error-status-step-2\">\n <StepContentWithAction />\n </WizardStep>\n <WizardStep name=\"Review\" id=\"status-review-step\" footer={{ nextButtonText: 'Finish' }}>\n Review step content\n </WizardStep>\n </Wizard>\n );\n }}\n </SomeContextProvider>\n);\n","title":"Step status","lang":"ts","className":""}}>
929
+
930
+ </Example>
931
+ };
932
+
933
+ const Component = () => (
934
+ <React.Fragment>
935
+ <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
936
+ {`Examples`}
937
+ </AutoLinkHeader>
938
+ {React.createElement(pageData.examples["Basic"])}
939
+ {React.createElement(pageData.examples["Plain"])}
940
+ {React.createElement(pageData.examples["Focus content on next/back"])}
941
+ {React.createElement(pageData.examples["Basic with disabled steps"])}
942
+ {React.createElement(pageData.examples["Anchors for nav items"])}
943
+ {React.createElement(pageData.examples["Incrementally enabled steps"])}
944
+ {React.createElement(pageData.examples["Expandable steps"])}
945
+ {React.createElement(pageData.examples["Progress after submission"])}
946
+ {React.createElement(pageData.examples["Enabled on form validation"])}
947
+ {React.createElement(pageData.examples["Validate on button press"])}
948
+ {React.createElement(pageData.examples["Progressive steps"])}
949
+ {React.createElement(pageData.examples["Get current step"])}
950
+ {React.createElement(pageData.examples["Within modal"])}
951
+ {React.createElement(pageData.examples["Step drawer content"])}
952
+ {React.createElement(pageData.examples["Custom navigation"])}
953
+ {React.createElement(pageData.examples["Header"])}
954
+ {React.createElement(pageData.examples["Custom footer"])}
955
+ {React.createElement(pageData.examples["Custom navigation item"])}
956
+ {React.createElement(pageData.examples["Toggle step visibility"])}
957
+ {React.createElement(pageData.examples["Step status"])}
958
+ <AutoLinkHeader {...{"id":"hooks","headingLevel":"h2","className":"ws-title ws-h2"}}>
959
+ {`Hooks`}
960
+ </AutoLinkHeader>
961
+ <AutoLinkHeader {...{"id":"usewizardcontext","headingLevel":"h3","className":"ws-title ws-h3"}}>
962
+ {`useWizardContext`}
963
+ </AutoLinkHeader>
964
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
965
+ {`Used to access any property of `}
966
+ <PatternflyThemeLink {...{"to":"#wizardcontextprops","className":""}}>
967
+ {`WizardContext`}
968
+ </PatternflyThemeLink>
969
+ {`:`}
970
+ </p>
971
+ <Example {...{"code":"import { useWizardContext } from '@patternfly/react-core';\n\nconst StepContent = () => {\n const { activeStep } = useWizardContext();\n return <>This is the current step: {activeStep}</>;\n}","lang":"noLive","className":""}}>
972
+ </Example>
973
+ <AutoLinkHeader {...{"id":"usewizardfooter","headingLevel":"h3","className":"ws-title ws-h3"}}>
974
+ {`useWizardFooter`}
975
+ </AutoLinkHeader>
976
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
977
+ {`Used to set a unique footer for the wizard on any given step.`}
978
+ </p>
979
+ <Example {...{"code":"import { useWizardFooter } from '@patternfly/react-core';\n\nconst StepContent = () => {\n useWizardFooter(<>Some footer</>);\n return <>Step content</>;\n}","lang":"noLive","className":""}}>
980
+ </Example>
981
+ </React.Fragment>
982
+ );
983
+ Component.displayName = 'ComponentsWizardReactDocs';
984
+ Component.pageData = pageData;
985
+
986
+ export default Component;