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

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 +6 -0
  2. package/LICENSE +21 -0
  3. package/package.json +12 -11
  4. package/patternfly-docs/generated/components/about-modal/react.js +0 -149
  5. package/patternfly-docs/generated/components/accordion/react.js +0 -262
  6. package/patternfly-docs/generated/components/action-list/react.js +0 -144
  7. package/patternfly-docs/generated/components/alert/react-demos.js +0 -56
  8. package/patternfly-docs/generated/components/alert/react.js +0 -1433
  9. package/patternfly-docs/generated/components/avatar/react.js +0 -166
  10. package/patternfly-docs/generated/components/back-to-top/react-demos.js +0 -60
  11. package/patternfly-docs/generated/components/back-to-top/react.js +0 -77
  12. package/patternfly-docs/generated/components/backdrop/react.js +0 -64
  13. package/patternfly-docs/generated/components/background-image/react.js +0 -62
  14. package/patternfly-docs/generated/components/badge/react.js +0 -97
  15. package/patternfly-docs/generated/components/banner/react-demos.js +0 -57
  16. package/patternfly-docs/generated/components/banner/react.js +0 -148
  17. package/patternfly-docs/generated/components/brand/react.js +0 -142
  18. package/patternfly-docs/generated/components/breadcrumb/react.js +0 -206
  19. package/patternfly-docs/generated/components/button/react-demos.js +0 -57
  20. package/patternfly-docs/generated/components/button/react.js +0 -826
  21. package/patternfly-docs/generated/components/card/react-demos.js +0 -201
  22. package/patternfly-docs/generated/components/card/react.js +0 -1015
  23. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +0 -1350
  24. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +0 -1334
  25. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +0 -1282
  26. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +0 -848
  27. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +0 -192
  28. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +0 -426
  29. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +0 -804
  30. package/patternfly-docs/generated/components/charts/legends/-Victory.js +0 -3230
  31. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +0 -1178
  32. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +0 -525
  33. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +0 -3382
  34. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +0 -377
  35. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +0 -2475
  36. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +0 -538
  37. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +0 -1551
  38. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +0 -4115
  39. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +0 -955
  40. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +0 -1173
  41. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +0 -1166
  42. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +0 -413
  43. package/patternfly-docs/generated/components/chip/react-deprecated.js +0 -323
  44. package/patternfly-docs/generated/components/clipboard-copy/react.js +0 -373
  45. package/patternfly-docs/generated/components/code-block/react.js +0 -148
  46. package/patternfly-docs/generated/components/code-editor/react.js +0 -659
  47. package/patternfly-docs/generated/components/compass/react-demos.js +0 -147
  48. package/patternfly-docs/generated/components/compass/react.js +0 -440
  49. package/patternfly-docs/generated/components/content/react.js +0 -248
  50. package/patternfly-docs/generated/components/data-list/react-demos.js +0 -90
  51. package/patternfly-docs/generated/components/data-list/react.js +0 -709
  52. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +0 -283
  53. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +0 -64
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +0 -83
  55. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +0 -395
  56. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +0 -241
  57. package/patternfly-docs/generated/components/description-list/react-demos.js +0 -58
  58. package/patternfly-docs/generated/components/description-list/react.js +0 -743
  59. package/patternfly-docs/generated/components/divider/react.js +0 -126
  60. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +0 -351
  61. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +0 -184
  62. package/patternfly-docs/generated/components/drag-and-drop/react.js +0 -137
  63. package/patternfly-docs/generated/components/drawer/react.js +0 -598
  64. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +0 -772
  65. package/patternfly-docs/generated/components/dual-list-selector/react.js +0 -594
  66. package/patternfly-docs/generated/components/empty-state/react.js +0 -199
  67. package/patternfly-docs/generated/components/expandable-section/react-demos.js +0 -65
  68. package/patternfly-docs/generated/components/expandable-section/react.js +0 -408
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +0 -52
  70. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +0 -398
  71. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +0 -749
  72. package/patternfly-docs/generated/components/forms/checkbox/react.js +0 -222
  73. package/patternfly-docs/generated/components/forms/form/react.js +0 -1106
  74. package/patternfly-docs/generated/components/forms/form-select/react.js +0 -208
  75. package/patternfly-docs/generated/components/forms/radio/react.js +0 -212
  76. package/patternfly-docs/generated/components/forms/text-area/react.js +0 -160
  77. package/patternfly-docs/generated/components/forms/text-input/react.js +0 -216
  78. package/patternfly-docs/generated/components/helper-text/react-demos.js +0 -180
  79. package/patternfly-docs/generated/components/helper-text/react.js +0 -164
  80. package/patternfly-docs/generated/components/hero/react.js +0 -88
  81. package/patternfly-docs/generated/components/hint/react.js +0 -169
  82. package/patternfly-docs/generated/components/icon/react.js +0 -215
  83. package/patternfly-docs/generated/components/input-group/react.js +0 -182
  84. package/patternfly-docs/generated/components/jump-links/react-demos.js +0 -154
  85. package/patternfly-docs/generated/components/jump-links/react.js +0 -212
  86. package/patternfly-docs/generated/components/label/react-demos.js +0 -57
  87. package/patternfly-docs/generated/components/label/react.js +0 -417
  88. package/patternfly-docs/generated/components/list/react.js +0 -175
  89. package/patternfly-docs/generated/components/login-page/react.js +0 -587
  90. package/patternfly-docs/generated/components/masthead/react-demos.js +0 -79
  91. package/patternfly-docs/generated/components/masthead/react.js +0 -291
  92. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +0 -769
  93. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +0 -665
  94. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +0 -187
  95. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +0 -163
  96. package/patternfly-docs/generated/components/menus/dropdown/react.js +0 -998
  97. package/patternfly-docs/generated/components/menus/menu/react.js +0 -1540
  98. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +0 -747
  99. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +0 -508
  100. package/patternfly-docs/generated/components/menus/select/react-templates.js +0 -257
  101. package/patternfly-docs/generated/components/menus/select/react.js +0 -998
  102. package/patternfly-docs/generated/components/modal/react-deprecated.js +0 -554
  103. package/patternfly-docs/generated/components/modal/react.js +0 -597
  104. package/patternfly-docs/generated/components/navigation/react-demos.js +0 -356
  105. package/patternfly-docs/generated/components/navigation/react.js +0 -409
  106. package/patternfly-docs/generated/components/notification-badge/react.js +0 -196
  107. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +0 -107
  108. package/patternfly-docs/generated/components/notification-drawer/react.js +0 -394
  109. package/patternfly-docs/generated/components/number-input/react.js +0 -210
  110. package/patternfly-docs/generated/components/overflow-menu/react.js +0 -274
  111. package/patternfly-docs/generated/components/page/react-demos.js +0 -149
  112. package/patternfly-docs/generated/components/page/react.js +0 -1352
  113. package/patternfly-docs/generated/components/pagination/react.js +0 -492
  114. package/patternfly-docs/generated/components/panel/react.js +0 -236
  115. package/patternfly-docs/generated/components/popover/react.js +0 -390
  116. package/patternfly-docs/generated/components/progress/react-demos.js +0 -59
  117. package/patternfly-docs/generated/components/progress/react.js +0 -283
  118. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +0 -45
  119. package/patternfly-docs/generated/components/progress-stepper/react.js +0 -219
  120. package/patternfly-docs/generated/components/search-input/react-demos.js +0 -113
  121. package/patternfly-docs/generated/components/search-input/react.js +0 -263
  122. package/patternfly-docs/generated/components/sidebar/react.js +0 -236
  123. package/patternfly-docs/generated/components/simple-list/react.js +0 -200
  124. package/patternfly-docs/generated/components/skeleton/react-demos.js +0 -44
  125. package/patternfly-docs/generated/components/skeleton/react.js +0 -122
  126. package/patternfly-docs/generated/components/skip-to-content/react.js +0 -73
  127. package/patternfly-docs/generated/components/slider/react.js +0 -309
  128. package/patternfly-docs/generated/components/spinner/react.js +0 -111
  129. package/patternfly-docs/generated/components/switch/react.js +0 -163
  130. package/patternfly-docs/generated/components/table/react-demos.js +0 -355
  131. package/patternfly-docs/generated/components/table/react-deprecated.js +0 -1350
  132. package/patternfly-docs/generated/components/table/react.js +0 -3241
  133. package/patternfly-docs/generated/components/tabs/react-demos.js +0 -108
  134. package/patternfly-docs/generated/components/tabs/react.js +0 -1359
  135. package/patternfly-docs/generated/components/text-input-group/react-demos.js +0 -152
  136. package/patternfly-docs/generated/components/text-input-group/react.js +0 -278
  137. package/patternfly-docs/generated/components/tile/react-deprecated.js +0 -242
  138. package/patternfly-docs/generated/components/timestamp/react.js +0 -283
  139. package/patternfly-docs/generated/components/title/react.js +0 -94
  140. package/patternfly-docs/generated/components/toggle-group/react.js +0 -299
  141. package/patternfly-docs/generated/components/toolbar/react-demos.js +0 -66
  142. package/patternfly-docs/generated/components/toolbar/react.js +0 -932
  143. package/patternfly-docs/generated/components/tooltip/react.js +0 -241
  144. package/patternfly-docs/generated/components/tree-view/react.js +0 -429
  145. package/patternfly-docs/generated/components/truncate/react.js +0 -211
  146. package/patternfly-docs/generated/components/wizard/react-demos.js +0 -87
  147. package/patternfly-docs/generated/components/wizard/react-deprecated.js +0 -788
  148. package/patternfly-docs/generated/components/wizard/react.js +0 -986
  149. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +0 -285
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +0 -70
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +0 -506
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +0 -94
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +0 -272
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +0 -87
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +0 -124
  156. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +0 -112
  157. package/patternfly-docs/generated/index.js +0 -1769
  158. package/patternfly-docs/generated/patterns/card-view/react-demos.js +0 -78
  159. package/patternfly-docs/generated/patterns/filters/react-demos.js +0 -141
  160. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +0 -51
  161. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +0 -61
  162. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +0 -124
  163. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +0 -81
@@ -1,788 +0,0 @@
1
- import React from 'react';
2
- import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
- import { Fragment, useEffect, useRef, useState } from 'react';
4
- import { Button, Drawer, DrawerActions, DrawerCloseButton, DrawerColorVariant,
5
- DrawerContent, DrawerContentBody, DrawerHead, DrawerPanelContent, DrawerSection, ModalVariant, Alert, EmptyState, EmptyStateFooter, EmptyStateBody, EmptyStateActions, Title, Progress, Form, FormGroup, TextInput } from '@patternfly/react-core';
6
- import { Wizard as WizardDeprecated, WizardFooter as WizardFooterDeprecated, WizardContextConsumer as WizardContextConsumerDeprecated } from '@patternfly/react-core/deprecated';
7
- import RhMicronsExternalLinkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-external-link-icon';
8
- import SlackHashIcon from '@patternfly/react-icons/dist/esm/icons/slack-hash-icon';
9
- import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon';
10
- const pageData = {
11
- "id": "Wizard",
12
- "section": "components",
13
- "subsection": "",
14
- "deprecated": true,
15
- "template": false,
16
- "beta": false,
17
- "demo": false,
18
- "newImplementationLink": false,
19
- "source": "react-deprecated",
20
- "tabName": null,
21
- "slug": "/components/wizard/react-deprecated",
22
- "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/deprecated/components/Wizard/examples/Wizard.md",
23
- "relPath": "packages/react-core/src/deprecated/components/Wizard/examples/Wizard.md",
24
- "propComponents": [
25
- {
26
- "name": "Wizard",
27
- "description": "",
28
- "props": [
29
- {
30
- "name": "appendTo",
31
- "type": "HTMLElement | (() => HTMLElement)",
32
- "description": "The parent container to append the modal to. Defaults to document.body",
33
- "defaultValue": "null"
34
- },
35
- {
36
- "name": "backButtonText",
37
- "type": "React.ReactNode",
38
- "description": "(Unused if footer is controlled) The Back button text",
39
- "defaultValue": "'Back'"
40
- },
41
- {
42
- "name": "cancelButtonText",
43
- "type": "React.ReactNode",
44
- "description": "(Unused if footer is controlled) The Cancel button text",
45
- "defaultValue": "'Cancel'"
46
- },
47
- {
48
- "name": "className",
49
- "type": "string",
50
- "description": "Additional classes spread to the Wizard",
51
- "defaultValue": "''"
52
- },
53
- {
54
- "name": "closeButtonAriaLabel",
55
- "type": "string",
56
- "description": "(Unused if footer is controlled) aria-label for the close button",
57
- "defaultValue": "'Close'"
58
- },
59
- {
60
- "name": "description",
61
- "type": "React.ReactNode",
62
- "description": "The wizard description",
63
- "defaultValue": "''"
64
- },
65
- {
66
- "name": "descriptionComponent",
67
- "type": "'div' | 'p'",
68
- "description": "Component type of the description",
69
- "defaultValue": "'p'"
70
- },
71
- {
72
- "name": "descriptionId",
73
- "type": "string",
74
- "description": "An optional id for the description"
75
- },
76
- {
77
- "name": "footer",
78
- "type": "React.ReactNode",
79
- "description": "(Use to control the footer) Passing in a footer component lets you control the buttons yourself",
80
- "defaultValue": "null"
81
- },
82
- {
83
- "name": "hasDrawer",
84
- "type": "boolean",
85
- "description": "Flag indicating the wizard has a drawer for at least one of the wizard steps",
86
- "defaultValue": "false"
87
- },
88
- {
89
- "name": "hasNoBodyPadding",
90
- "type": "boolean",
91
- "description": "Can remove the default padding around the main body content by setting this to true",
92
- "defaultValue": "false"
93
- },
94
- {
95
- "name": "height",
96
- "type": "number | string",
97
- "description": "Custom height of the wizard",
98
- "defaultValue": "null"
99
- },
100
- {
101
- "name": "hideClose",
102
- "type": "boolean",
103
- "description": "Flag indicating whether the close button should be in the header",
104
- "defaultValue": "false"
105
- },
106
- {
107
- "name": "isDrawerExpanded",
108
- "type": "boolean",
109
- "description": "Flag indicating the wizard drawer is expanded",
110
- "defaultValue": "false"
111
- },
112
- {
113
- "name": "isNavExpandable",
114
- "type": "boolean",
115
- "description": "Flag indicating nav items with sub steps are expandable",
116
- "defaultValue": "false"
117
- },
118
- {
119
- "name": "isOpen",
120
- "type": "boolean",
121
- "description": "Flag indicating Wizard modal is open. Wizard will be placed into a modal if this prop is provided",
122
- "defaultValue": "undefined"
123
- },
124
- {
125
- "name": "mainAriaLabel",
126
- "type": "string",
127
- "description": "Adds an accessible name to the wizard body when the body content overflows and renders\na scrollbar.",
128
- "defaultValue": "null"
129
- },
130
- {
131
- "name": "mainAriaLabelledBy",
132
- "type": "string",
133
- "description": "Adds an accessible name to the wizard body by passing the the id of one or more elements.\nThe aria-labelledby will only be applied when the body content overflows and renders a scrollbar.",
134
- "defaultValue": "null"
135
- },
136
- {
137
- "name": "navAriaLabel",
138
- "type": "string",
139
- "description": "Aria-label for the Nav",
140
- "defaultValue": "null"
141
- },
142
- {
143
- "name": "navAriaLabelledBy",
144
- "type": "string",
145
- "description": "Sets aria-labelledby on nav element",
146
- "defaultValue": "null"
147
- },
148
- {
149
- "name": "nextButtonText",
150
- "type": "React.ReactNode",
151
- "description": "(Unused if footer is controlled) The Next button text",
152
- "defaultValue": "'Next'"
153
- },
154
- {
155
- "name": "onBack",
156
- "type": "(\n newStep: { id?: string | number; name: React.ReactNode },\n prevStep: { prevId?: string | number; prevName: React.ReactNode }\n) => void",
157
- "description": "(Unused if footer is controlled) Callback function after Back button is clicked",
158
- "defaultValue": "null"
159
- },
160
- {
161
- "name": "onClose",
162
- "type": "() => void",
163
- "description": "Callback function to close the wizard",
164
- "defaultValue": "() => undefined as any"
165
- },
166
- {
167
- "name": "onCurrentStepChanged",
168
- "type": "(step: WizardStep) => void",
169
- "description": "Callback function to signal the current step in the wizard"
170
- },
171
- {
172
- "name": "onExpandDrawer",
173
- "type": "() => void",
174
- "description": "Callback function for when the drawer is toggled. Can be used to set browser focus in the drawer.",
175
- "defaultValue": "() => undefined as any"
176
- },
177
- {
178
- "name": "onGoToStep",
179
- "type": "(\n newStep: { id?: string | number; name: React.ReactNode },\n prevStep: { prevId?: string | number; prevName: React.ReactNode }\n) => void",
180
- "description": "Callback function when a step in the nav is clicked",
181
- "defaultValue": "null"
182
- },
183
- {
184
- "name": "onNext",
185
- "type": "(\n newStep: { id?: string | number; name: React.ReactNode },\n prevStep: { prevId?: string | number; prevName: React.ReactNode }\n) => void",
186
- "description": "(Unused if footer is controlled) Callback function after Next button is clicked",
187
- "defaultValue": "null"
188
- },
189
- {
190
- "name": "onSave",
191
- "type": "() => void",
192
- "description": "(Unused if footer is controlled) Callback function to save at the end of the wizard, if not specified uses onClose"
193
- },
194
- {
195
- "name": "startAtStep",
196
- "type": "number",
197
- "description": "The current step the wizard is on (1 or higher)",
198
- "defaultValue": "1"
199
- },
200
- {
201
- "name": "steps",
202
- "type": "WizardStep[]",
203
- "description": "The wizard steps configuration object",
204
- "required": true
205
- },
206
- {
207
- "name": "title",
208
- "type": "string",
209
- "description": "The wizard title to display if header is desired",
210
- "defaultValue": "null"
211
- },
212
- {
213
- "name": "titleId",
214
- "type": "string",
215
- "description": "An optional id for the title"
216
- },
217
- {
218
- "name": "width",
219
- "type": "number | string",
220
- "description": "Custom width of the wizard",
221
- "defaultValue": "null"
222
- }
223
- ]
224
- },
225
- {
226
- "name": "WizardNav",
227
- "description": "",
228
- "props": [
229
- {
230
- "name": "aria-label",
231
- "type": "string",
232
- "description": "Aria-label applied to the nav element"
233
- },
234
- {
235
- "name": "aria-labelledby",
236
- "type": "string",
237
- "description": "Sets the aria-labelledby attribute on the nav element"
238
- },
239
- {
240
- "name": "children",
241
- "type": "any",
242
- "description": "children should be WizardNavItem components"
243
- },
244
- {
245
- "name": "isOpen",
246
- "type": "boolean",
247
- "description": "Whether the nav is expanded",
248
- "defaultValue": "false"
249
- },
250
- {
251
- "name": "ouiaId",
252
- "type": "number | string",
253
- "description": ""
254
- },
255
- {
256
- "name": "ouiaSafe",
257
- "type": "boolean",
258
- "description": "",
259
- "defaultValue": "true"
260
- },
261
- {
262
- "name": "returnList",
263
- "type": "boolean",
264
- "description": "True to return the inner list without the wrapping nav element",
265
- "defaultValue": "false"
266
- }
267
- ]
268
- },
269
- {
270
- "name": "WizardNavItem",
271
- "description": "",
272
- "props": [
273
- {
274
- "name": "children",
275
- "type": "React.ReactNode",
276
- "description": "Can nest a WizardNav component for substeps",
277
- "defaultValue": "null"
278
- },
279
- {
280
- "name": "content",
281
- "type": "React.ReactNode",
282
- "description": "The content to display in the nav item",
283
- "defaultValue": "''"
284
- },
285
- {
286
- "name": "href",
287
- "type": "string",
288
- "description": "An optional url to use for when using an anchor component",
289
- "defaultValue": "null"
290
- },
291
- {
292
- "name": "id",
293
- "type": "string | number",
294
- "description": "The id for the nav item"
295
- },
296
- {
297
- "name": "isCurrent",
298
- "type": "boolean",
299
- "description": "Whether the nav item is the currently active item",
300
- "defaultValue": "false"
301
- },
302
- {
303
- "name": "isDisabled",
304
- "type": "boolean",
305
- "description": "Whether the nav item is disabled",
306
- "defaultValue": "false"
307
- },
308
- {
309
- "name": "isExpandable",
310
- "type": "boolean",
311
- "description": "Flag indicating that this NavItem has child steps and is expandable",
312
- "defaultValue": "false"
313
- },
314
- {
315
- "name": "navItemComponent",
316
- "type": "'button' | 'a'",
317
- "description": "Component used to render WizardNavItem",
318
- "defaultValue": "'button'"
319
- },
320
- {
321
- "name": "onNavItemClick",
322
- "type": "(step: number) => any",
323
- "description": "Callback for when the nav item is clicked",
324
- "defaultValue": "() => undefined"
325
- },
326
- {
327
- "name": "ouiaId",
328
- "type": "number | string",
329
- "description": ""
330
- },
331
- {
332
- "name": "ouiaSafe",
333
- "type": "boolean",
334
- "description": "",
335
- "defaultValue": "true"
336
- },
337
- {
338
- "name": "step",
339
- "type": "number",
340
- "description": "The step passed into the onNavItemClick callback",
341
- "required": true
342
- }
343
- ]
344
- },
345
- {
346
- "name": "WizardHeader",
347
- "description": "",
348
- "props": [
349
- {
350
- "name": "closeButtonAriaLabel",
351
- "type": "string",
352
- "description": "Aria-label applied to the X (Close) button"
353
- },
354
- {
355
- "name": "description",
356
- "type": "React.ReactNode",
357
- "description": "Description of the wizard"
358
- },
359
- {
360
- "name": "descriptionComponent",
361
- "type": "'div' | 'p'",
362
- "description": "Component type of the description",
363
- "defaultValue": "'div'"
364
- },
365
- {
366
- "name": "descriptionId",
367
- "type": "string",
368
- "description": "id for the description"
369
- },
370
- {
371
- "name": "hideClose",
372
- "type": "boolean",
373
- "description": "Flag indicating whether the close button should be in the header"
374
- },
375
- {
376
- "name": "onClose",
377
- "type": "() => void",
378
- "description": "Callback function called when the X (Close) button is clicked",
379
- "defaultValue": "() => undefined"
380
- },
381
- {
382
- "name": "title",
383
- "type": "string",
384
- "description": "Title of the wizard",
385
- "required": true
386
- },
387
- {
388
- "name": "titleId",
389
- "type": "string",
390
- "description": "id for the title"
391
- }
392
- ]
393
- },
394
- {
395
- "name": "WizardBody",
396
- "description": "",
397
- "props": [
398
- {
399
- "name": "activeStep",
400
- "type": "WizardStep",
401
- "description": "The currently active WizardStep",
402
- "required": true
403
- },
404
- {
405
- "name": "aria-label",
406
- "type": "string",
407
- "description": "Adds an accessible name to the wizard body when the body content overflows and renders\na scrollbar."
408
- },
409
- {
410
- "name": "aria-labelledby",
411
- "type": "string",
412
- "description": "Adds an accessible name to the wizard body by passing the the id of one or more elements.\nThe aria-labelledby will only be applied when the body content overflows and renders a scrollbar.",
413
- "required": true
414
- },
415
- {
416
- "name": "children",
417
- "type": "any",
418
- "description": "Anything that can be rendered in the Wizard body",
419
- "required": true
420
- },
421
- {
422
- "name": "hasDrawer",
423
- "type": "boolean",
424
- "description": ""
425
- },
426
- {
427
- "name": "hasNoBodyPadding",
428
- "type": "boolean",
429
- "description": "Set to true to remove the default body padding",
430
- "defaultValue": "false"
431
- },
432
- {
433
- "name": "isDrawerExpanded",
434
- "type": "boolean",
435
- "description": "Flag indicating the wizard drawer is expanded"
436
- },
437
- {
438
- "name": "mainComponent",
439
- "type": "React.ElementType",
440
- "description": "Component used as the primary content container",
441
- "defaultValue": "'div'"
442
- },
443
- {
444
- "name": "onExpandDrawer",
445
- "type": "() => void",
446
- "description": "Callback function for when the drawer is toggled"
447
- }
448
- ]
449
- },
450
- {
451
- "name": "WizardFooter",
452
- "description": "",
453
- "props": [
454
- {
455
- "name": "children",
456
- "type": "any",
457
- "description": "Buttons in the footer",
458
- "required": true
459
- }
460
- ]
461
- },
462
- {
463
- "name": "WizardToggle",
464
- "description": "",
465
- "props": [
466
- {
467
- "name": "activeStep",
468
- "type": "WizardStep",
469
- "description": "The currently active WizardStep",
470
- "required": true
471
- },
472
- {
473
- "name": "aria-label",
474
- "type": "string",
475
- "description": "The button's aria-label",
476
- "defaultValue": "'Wizard Toggle'"
477
- },
478
- {
479
- "name": "children",
480
- "type": "React.ReactNode",
481
- "description": "The WizardFooter"
482
- },
483
- {
484
- "name": "hasDrawer",
485
- "type": "boolean",
486
- "description": "Flag indicating the wizard has a drawer for at least one of the wizard steps"
487
- },
488
- {
489
- "name": "hasNoBodyPadding",
490
- "type": "boolean",
491
- "description": "Set to true to remove body padding",
492
- "defaultValue": "false"
493
- },
494
- {
495
- "name": "isDrawerExpanded",
496
- "type": "boolean",
497
- "description": "Flag indicating the wizard drawer is expanded"
498
- },
499
- {
500
- "name": "isInPage",
501
- "type": "boolean",
502
- "description": "If the wizard is in-page",
503
- "defaultValue": "true"
504
- },
505
- {
506
- "name": "isNavOpen",
507
- "type": "boolean",
508
- "description": "If the nav is open",
509
- "required": true
510
- },
511
- {
512
- "name": "mainAriaLabel",
513
- "type": "string",
514
- "description": "Adds an accessible name to the wizard body when the body content overflows and renders\na scrollbar.",
515
- "defaultValue": "null"
516
- },
517
- {
518
- "name": "mainAriaLabelledBy",
519
- "type": "string",
520
- "description": "Adds an accessible name to the wizard body by passing the the id of one or more elements.\nThe aria-labelledby will only be applied when the body content overflows and renders a scrollbar.",
521
- "defaultValue": "null"
522
- },
523
- {
524
- "name": "nav",
525
- "type": "(isWizardNavOpen: boolean) => React.ReactElement<any>",
526
- "description": "Function that returns the WizardNav component",
527
- "required": true
528
- },
529
- {
530
- "name": "onExpandDrawer",
531
- "type": "() => void",
532
- "description": "Callback function for when the drawer is toggled"
533
- },
534
- {
535
- "name": "onNavToggle",
536
- "type": "(isOpen: boolean) => void",
537
- "description": "Callback function for when the nav is toggled",
538
- "required": true
539
- },
540
- {
541
- "name": "steps",
542
- "type": "WizardStep[]",
543
- "description": "The wizard steps",
544
- "required": true
545
- }
546
- ]
547
- },
548
- {
549
- "name": "WizardStep",
550
- "description": "",
551
- "props": [
552
- {
553
- "name": "canJumpTo",
554
- "type": "boolean",
555
- "description": "Enables or disables the step in the navigation. Enabled by default."
556
- },
557
- {
558
- "name": "component",
559
- "type": "any",
560
- "description": "The component to render in the main body"
561
- },
562
- {
563
- "name": "drawerPanelContent",
564
- "type": "any",
565
- "description": "The content to render in the drawer panel (use when hasDrawer prop is set on the wizard)."
566
- },
567
- {
568
- "name": "drawerToggleButton",
569
- "type": "React.ReactNode",
570
- "description": "Custom drawer toggle button that opens the drawer."
571
- },
572
- {
573
- "name": "enableNext",
574
- "type": "boolean",
575
- "description": "(Unused if footer is controlled) The condition needed to enable the Next button"
576
- },
577
- {
578
- "name": "hideBackButton",
579
- "type": "boolean",
580
- "description": "(Unused if footer is controlled) True to hide the Back button"
581
- },
582
- {
583
- "name": "hideCancelButton",
584
- "type": "boolean",
585
- "description": "(Unused if footer is controlled) True to hide the Cancel button"
586
- },
587
- {
588
- "name": "id",
589
- "type": "string | number",
590
- "description": "Optional identifier"
591
- },
592
- {
593
- "name": "isDisabled",
594
- "type": "boolean",
595
- "description": "Flag to disable the step in the navigation"
596
- },
597
- {
598
- "name": "isFinishedStep",
599
- "type": "boolean",
600
- "description": "Setting to true hides the side nav and footer"
601
- },
602
- {
603
- "name": "name",
604
- "type": "React.ReactNode",
605
- "description": "The name of the step",
606
- "required": true
607
- },
608
- {
609
- "name": "nextButtonText",
610
- "type": "React.ReactNode",
611
- "description": "(Unused if footer is controlled) Can change the Next button text. If nextButtonText is also set for the Wizard, this step specific one overrides it."
612
- },
613
- {
614
- "name": "stepNavItemProps",
615
- "type": "React.HTMLProps<HTMLButtonElement | HTMLAnchorElement> | WizardNavItemProps",
616
- "description": "Props to pass to the WizardNavItem"
617
- },
618
- {
619
- "name": "steps",
620
- "type": "WizardStep[]",
621
- "description": "Sub steps"
622
- }
623
- ]
624
- }
625
- ],
626
- "cssPrefix": [
627
- "pf-v6-c-wizard"
628
- ],
629
- "examples": [
630
- "Basic",
631
- "Basic with disabled steps",
632
- "Anchors for nav items",
633
- "Incrementally enabled steps",
634
- "Expandable steps",
635
- "Finished",
636
- "Enabled on form validation",
637
- "Validate on button press",
638
- "Progressive steps",
639
- "Get current step",
640
- "Wizard in modal",
641
- "Wizard with drawer"
642
- ]
643
- };
644
- pageData.liveContext = {
645
- Fragment,
646
- useEffect,
647
- useRef,
648
- useState,
649
- Button,
650
- Drawer,
651
- DrawerActions,
652
- DrawerCloseButton,
653
- DrawerColorVariant,
654
- DrawerContent,
655
- DrawerContentBody,
656
- DrawerHead,
657
- DrawerPanelContent,
658
- DrawerSection,
659
- ModalVariant,
660
- Alert,
661
- EmptyState,
662
- EmptyStateFooter,
663
- EmptyStateBody,
664
- EmptyStateActions,
665
- Title,
666
- Progress,
667
- Form,
668
- FormGroup,
669
- TextInput,
670
- WizardDeprecated,
671
- WizardFooterDeprecated,
672
- WizardContextConsumerDeprecated,
673
- RhMicronsExternalLinkIcon,
674
- SlackHashIcon,
675
- CogsIcon
676
- };
677
- pageData.examples = {
678
- 'Basic': props =>
679
- <Example {...pageData} {...props} {...{"code":"import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n\nexport const WizardBasic: React.FunctionComponent = () => {\n const steps = [\n {\n name: 'First step',\n component: (\n <>\n <p>\n The content of this step overflows and creates a scrollbar, which causes a tabindex of \"0\", a role of\n \"region\", 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\n lacinia vel sapien ut imperdiet. Nunc ultrices mollis dictum. Duis tempus, massa nec tincidunt tempor, enim\n ex porttitor odio, eu facilisis dolor tortor id sapien. Etiam sit amet molestie lacus. Nulla facilisi. Duis\n eget finibus ipsum. Quisque dictum enim sed sodales porta. Curabitur eget orci eu risus posuere pulvinar id\n nec turpis. Morbi 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\n orci fringilla pretium mattis. Aliquam erat volutpat. Sed pharetra condimentum dui, nec bibendum ante.\n Vestibulum sollicitudin, sem accumsan pharetra molestie, purus turpis lacinia lorem, commodo sodales quam\n lectus a urna. Nam gravida, felis a lacinia varius, ex ipsum ultrices orci, non egestas diam velit in mi. Ut\n sit amet commodo orci. Duis sed diam odio. Duis mi metus, dignissim in odio nec, ornare aliquet libero. Sed\n luctus elit nibh. Quisque et felis diam. Integer ac metus dolor.\n </p>\n </>\n )\n },\n { name: 'Second step', component: <p>Step 2 content</p> },\n { name: 'Third step', component: <p>Step 3 content</p> },\n { name: 'Fourth step', component: <p>Step 4 content</p> },\n { name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }\n ];\n const title = 'Basic wizard example';\n return (\n <WizardDeprecated navAriaLabel={`${title} steps`} mainAriaLabel={`${title} content`} steps={steps} height={400} />\n );\n};\n","title":"Basic","lang":"js","className":""}}>
680
-
681
- </Example>,
682
- 'Basic with disabled steps': props =>
683
- <Example {...pageData} {...props} {...{"code":"import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n\nexport const WizardBasicWithDisabledSteps: React.FunctionComponent = () => {\n const steps = [\n { name: 'First step', component: <p>Step 1 content</p> },\n { name: 'Second step', component: <p>Step 2 content</p>, isDisabled: true },\n { name: 'Third step', component: <p>Step 3 content</p> },\n { name: 'Fourth step', component: <p>Step 4 content</p>, isDisabled: true },\n { name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }\n ];\n const title = 'Basic wizard with disabled steps example';\n return (\n <WizardDeprecated navAriaLabel={`${title} steps`} mainAriaLabel={`${title} content`} steps={steps} height={400} />\n );\n};\n","title":"Basic with disabled steps","lang":"js","className":""}}>
684
-
685
- </Example>,
686
- 'Anchors for nav items': props =>
687
- <Example {...pageData} {...props} {...{"code":"import { Button } from '@patternfly/react-core';\nimport { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\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 const steps = [\n {\n name: (\n <div>\n <RhMicronsExternalLinkIcon /> PF3\n </div>\n ),\n component: <p>Step 1: Read about PF3</p>,\n stepNavItemProps: { navItemComponent: 'a', href: 'https://www.patternfly.org/v3/', target: '_blank' }\n },\n {\n name: (\n <div>\n <RhMicronsExternalLinkIcon /> PF4\n </div>\n ),\n component: <p>Step 2: Read about PF4</p>,\n stepNavItemProps: { navItemComponent: 'a', href: 'https://www.patternfly.org/v4/', target: '_blank' }\n },\n {\n name: (\n <div>\n <SlackHashIcon /> Join us on slack\n </div>\n ),\n component: (\n <Button variant=\"link\" component=\"a\" target=\"_blank\" href=\"https://patternfly.slack.com/\">\n Join the conversation\n </Button>\n ),\n stepNavItemProps: { navItemComponent: 'a', href: 'https://patternfly.slack.com/', target: '_blank' }\n }\n ];\n const title = 'Anchor link wizard example';\n return (\n <WizardDeprecated navAriaLabel={`${title} steps`} mainAriaLabel={`${title} content`} steps={steps} height={400} />\n );\n};\n","title":"Anchors for nav items","lang":"js","className":""}}>
688
-
689
- </Example>,
690
- 'Incrementally enabled steps': props =>
691
- <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Wizard as WizardDeprecated, WizardStep } from '@patternfly/react-core/deprecated';\n\nexport const WizardIncrementallyEnabledSteps: React.FunctionComponent = () => {\n const [stepIdReached, setStepIdReached] = useState(1);\n\n const onNext = ({ id }: WizardStep) => {\n if (id) {\n if (typeof id === 'string') {\n const [, orderIndex] = id.split('-');\n id = parseInt(orderIndex);\n }\n setStepIdReached(stepIdReached < id ? id : stepIdReached);\n }\n };\n\n const closeWizard = () => {\n // eslint-disable-next-line no-console\n console.log('close wizard');\n };\n\n const steps = [\n { id: 'incrementallyEnabled-1', name: 'First step', component: <p>Step 1 content</p> },\n {\n id: 'incrementallyEnabled-2',\n name: 'Second step',\n component: <p>Step 2 content</p>,\n canJumpTo: stepIdReached >= 2\n },\n {\n id: 'incrementallyEnabled-3',\n name: 'Third step',\n component: <p>Step 3 content</p>,\n canJumpTo: stepIdReached >= 3\n },\n {\n id: 'incrementallyEnabled-4',\n name: 'Fourth step',\n component: <p>Step 4 content</p>,\n canJumpTo: stepIdReached >= 4\n },\n {\n id: 'incrementallyEnabled-5',\n name: 'Review',\n component: <p>Review step content</p>,\n nextButtonText: 'Finish',\n canJumpTo: stepIdReached >= 5\n }\n ];\n const title = 'Incrementally enabled wizard example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={closeWizard}\n steps={steps}\n onNext={onNext}\n height={400}\n />\n );\n};\n","title":"Incrementally enabled steps","lang":"js","className":""}}>
692
-
693
- </Example>,
694
- 'Expandable steps': props =>
695
- <Example {...pageData} {...props} {...{"code":"import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n\nexport const WizardExpandableSteps: React.FunctionComponent = () => {\n const steps = [\n {\n name: 'First step',\n steps: [\n { name: 'Substep A', component: <p>Substep A content</p> },\n { name: 'Substep B', component: <p>Substep B content</p> }\n ]\n },\n { name: 'Second step', component: <p>Step 2 content</p> },\n {\n name: 'Third step',\n steps: [\n { name: 'Substep C', component: <p>Substep C content</p> },\n { name: 'Substep D', component: <p>Substep D content</p> }\n ]\n },\n { name: 'Fourth step', component: <p>Step 4 content</p> },\n { name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }\n ];\n const title = 'Expandable wizard example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n steps={steps}\n height={400}\n isNavExpandable\n />\n );\n};\n","title":"Expandable steps","lang":"js","className":""}}>
696
-
697
- </Example>,
698
- 'Finished': props =>
699
- <Example {...pageData} {...props} {...{"code":"import { useEffect, useState } from 'react';\nimport {\n EmptyState,\n EmptyStateFooter,\n EmptyStateBody,\n EmptyStateActions,\n Progress,\n Button\n} from '@patternfly/react-core';\nimport { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n// eslint-disable-next-line patternfly-react/import-tokens-icons\nimport { CogsIcon } from '@patternfly/react-icons';\nimport layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';\n\ninterface finishedProps {\n onClose: () => void;\n}\n\nconst FinishedStep: React.FunctionComponent<finishedProps> = (props: finishedProps) => {\n const [percent, setPercent] = useState(0);\n\n const tick = () => {\n setPercent((prevPercent) => {\n if (prevPercent < 100) {\n return prevPercent + 20;\n } else {\n return prevPercent;\n }\n });\n };\n\n useEffect(() => {\n const interval = setInterval(() => tick(), 1000);\n\n if (percent >= 100) {\n clearInterval(interval);\n }\n\n return () => clearInterval(interval);\n }, [percent]);\n\n return (\n <div className={layout.bullseye}>\n <EmptyState\n headingLevel=\"h4\"\n titleText={percent === 100 ? 'Validation complete' : 'Validating credentials'}\n icon={CogsIcon}\n variant=\"lg\"\n >\n <EmptyStateBody>\n <Progress value={percent} measureLocation=\"outside\" aria-label=\"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={percent !== 100} onClick={props.onClose}>\n Log to console\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </div>\n );\n};\n\nexport const WizardFinished: React.FunctionComponent = () => {\n const closeWizard = () => {\n // eslint-disable-next-line no-console\n console.log('close wizard');\n };\n\n const steps = [\n { name: 'First step', component: <p>Step 1 content</p> },\n { name: 'Second step', component: <p>Step 2 content</p> },\n { name: 'Third step', component: <p>Step 3 content</p> },\n { name: 'Fourth step', component: <p>Step 4 content</p> },\n { name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' },\n { name: 'Finish', component: <FinishedStep onClose={closeWizard} />, isFinishedStep: true }\n ];\n const title = 'Finished wizard example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={closeWizard}\n steps={steps}\n height={400}\n />\n );\n};\n","title":"Finished","lang":"js","className":""}}>
700
-
701
- </Example>,
702
- 'Enabled on form validation': props =>
703
- <Example {...pageData} {...props} {...{"code":"import { useEffect, useState } from 'react';\nimport { Form, FormGroup, TextInput } from '@patternfly/react-core';\nimport { Wizard as WizardDeprecated, WizardStep } from '@patternfly/react-core/deprecated';\ninterface PrevStepInfo {\n prevId?: string | number;\n prevName: React.ReactNode;\n}\n\ninterface sampleFormProps {\n formValue: string;\n isFormValid: boolean;\n onChange?: (isValid: boolean, value: string) => void;\n}\n\nconst SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormProps) => {\n const [value, setValue] = useState(props.formValue);\n const [isValid, setIsValid] = useState(props.isFormValid);\n\n const handleTextInputChange = (_event, value: string) => {\n const valid = /^\\d+$/.test(value);\n setValue(value);\n setIsValid(valid);\n props.onChange && props.onChange(valid, value);\n };\n\n const validated = isValid ? 'default' : 'error';\n\n return (\n <Form>\n <FormGroup\n label=\"Age:\"\n type=\"number\"\n helperText=\"Write your age in numbers.\"\n helperTextInvalid=\"Age has to be a number\"\n fieldId=\"age\"\n validated={validated}\n >\n <TextInput\n validated={validated}\n value={value}\n id=\"age-input\"\n aria-describedby=\"age-helper\"\n onChange={handleTextInputChange}\n />\n </FormGroup>\n </Form>\n );\n};\n\nexport const WizardFormValidation: React.FunctionComponent = () => {\n const [isFormValid, setIsFormValid] = useState(false);\n const [formValue, setFormValue] = useState('Thirty');\n const [allStepsValid, setAllStepsValid] = useState(false);\n const [stepIdReached, setStepIdReached] = useState(1);\n\n useEffect(() => {\n setAllStepsValid(isFormValid);\n }, [isFormValid, stepIdReached]);\n\n const closeWizard = () => {\n // eslint-disable-next-line no-console\n console.log('close wizard');\n };\n\n const onFormChange = (isValid: boolean, value: string) => {\n setIsFormValid(isValid);\n setFormValue(value);\n };\n\n const areAllStepsValid = () => {\n setAllStepsValid(isFormValid);\n };\n\n const onNext = ({ id, name }: WizardStep, { prevId, prevName }: PrevStepInfo) => {\n // eslint-disable-next-line no-console\n console.log(`current id: ${id}, current name: ${name}, previous id: ${prevId}, previous name: ${prevName}`);\n if (id) {\n if (typeof id === 'string') {\n const [, orderIndex] = id.split('-');\n id = parseInt(orderIndex);\n }\n setStepIdReached(stepIdReached < id ? id : stepIdReached);\n }\n };\n\n const onBack = ({ id, name }: WizardStep, { prevId, prevName }: PrevStepInfo) => {\n // eslint-disable-next-line no-console\n console.log(`current id: ${id}, current name: ${name}, previous id: ${prevId}, previous name: ${prevName}`);\n areAllStepsValid();\n };\n\n const onGoToStep = ({ id, name }: WizardStep, { prevId, prevName }: PrevStepInfo) => {\n // eslint-disable-next-line no-console\n console.log(`current id: ${id}, current name: ${name}, previous id: ${prevId}, previous name: ${prevName}`);\n };\n\n const steps = [\n { id: 'validated-1', name: 'Information', component: <p>Step 1 content</p> },\n {\n name: 'Configuration',\n steps: [\n {\n id: 'validated-2',\n name: 'Substep A with validation',\n component: <SampleForm formValue={formValue} isFormValid={isFormValid} onChange={onFormChange} />,\n enableNext: isFormValid,\n canJumpTo: stepIdReached >= 2\n },\n { id: 'validated-3', name: 'Substep B', component: <p>Substep B</p>, canJumpTo: stepIdReached >= 3 }\n ]\n },\n {\n id: 'validated-4',\n name: 'Additional',\n component: <p>Step 3 content</p>,\n enableNext: allStepsValid,\n canJumpTo: stepIdReached >= 4\n },\n {\n id: 'validated-5',\n name: 'Review',\n component: <p>Step 4 content</p>,\n nextButtonText: 'Finish',\n canJumpTo: stepIdReached >= 5\n }\n ];\n const title = 'Wizard enabled on form validation example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={closeWizard}\n steps={steps}\n onNext={onNext}\n onBack={onBack}\n onGoToStep={onGoToStep}\n height={400}\n />\n );\n};\n","title":"Enabled on form validation","lang":"js","className":""}}>
704
-
705
- </Example>,
706
- 'Validate on button press': props =>
707
- <Example {...pageData} {...props} {...{"code":"import { useEffect, useState } from 'react';\nimport {\n EmptyState,\n EmptyStateFooter,\n EmptyStateBody,\n EmptyStateActions,\n Form,\n FormGroup,\n TextInput,\n Progress,\n Button,\n Alert\n} from '@patternfly/react-core';\nimport {\n Wizard as WizardDeprecated,\n WizardFooter as WizardFooterDeprecated,\n WizardContextConsumer as WizardContextConsumerDeprecated\n} from '@patternfly/react-core/deprecated';\nimport layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';\n\n// eslint-disable-next-line patternfly-react/import-tokens-icons\nimport { CogsIcon } from '@patternfly/react-icons';\n\ninterface finishedProps {\n onClose: () => void;\n}\n\nconst FinishedStep: React.FunctionComponent<finishedProps> = (props: finishedProps) => {\n const [percent, setPercent] = useState(0);\n\n const tick = () => {\n setPercent((prevPercent) => {\n if (prevPercent < 100) {\n return prevPercent + 20;\n } else {\n return prevPercent;\n }\n });\n };\n\n useEffect(() => {\n const interval = setInterval(() => tick(), 1000);\n\n if (percent >= 100) {\n clearInterval(interval);\n }\n\n return () => clearInterval(interval);\n }, [percent]);\n\n return (\n <div className={layout.bullseye}>\n <EmptyState\n headingLevel=\"h4\"\n titleText={percent === 100 ? 'Validation complete' : 'Validating credentials'}\n icon={CogsIcon}\n variant=\"lg\"\n >\n <EmptyStateBody>\n <Progress value={percent} measureLocation=\"outside\" aria-label=\"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={percent !== 100} onClick={props.onClose}>\n Log to console\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </div>\n );\n};\n\ninterface sampleFormProps {\n formValue: string;\n isFormValid: boolean;\n onChange?: (isValid: boolean, value: string) => void;\n}\n\nconst SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormProps) => {\n const [value, setValue] = useState(props.formValue);\n const [isValid, setIsValid] = useState(props.isFormValid);\n\n const handleTextInputChange = (_event, value: string) => {\n const valid = /^\\d+$/.test(value);\n setValue(value);\n setIsValid(valid);\n props.onChange && props.onChange(valid, value);\n };\n\n const validated = isValid ? 'default' : 'error';\n\n return (\n <Form>\n <FormGroup\n label=\"Age:\"\n type=\"number\"\n helperText=\"Write your age in numbers.\"\n helperTextInvalid=\"Age has to be a number\"\n fieldId=\"age\"\n validated={validated}\n >\n <TextInput\n validated={validated}\n value={value}\n id=\"age\"\n aria-describedby=\"age-helper\"\n onChange={handleTextInputChange}\n />\n </FormGroup>\n </Form>\n );\n};\n\nexport const WizardValidateButtonPress: React.FunctionComponent = () => {\n const [isFormValid, setIsFormValid] = useState(false);\n const [formValue, setFormValue] = useState('Validating on button press');\n const [stepsValid, setStepsValid] = useState(0);\n const [errorText, setErrorText] = useState(false);\n\n const closeWizard = () => {\n // eslint-disable-next-line no-console\n console.log('close wizard');\n };\n\n const onFormChange = (isValid: boolean, value: string) => {\n setIsFormValid(isValid);\n setFormValue(value);\n };\n\n const validateLastStep: (onNext: () => void) => void = (onNext) => {\n if (stepsValid !== 1 && !isFormValid) {\n setErrorText(true);\n } else {\n setStepsValid(1);\n setErrorText(false);\n onNext();\n }\n };\n\n const steps = [\n { name: 'First step', component: <p>Step 1 content</p> },\n { name: 'Second step', component: <p>Step 2 content</p> },\n {\n name: 'Final Step',\n component: (\n <>\n {errorText && (\n <div style={{ padding: '15px 0' }}>\n <Alert variant=\"warning\" title=\"Validation failed, please try again\" />\n </div>\n )}\n <SampleForm formValue={formValue} isFormValid={stepsValid !== 1} onChange={onFormChange} />\n </>\n )\n },\n { name: 'Finish', component: <FinishedStep onClose={closeWizard} />, isFinishedStep: true }\n ];\n\n const CustomFooter = (\n <WizardFooterDeprecated>\n <WizardContextConsumerDeprecated>\n {({ activeStep, goToStepByName, onNext, onBack, onClose }) => {\n if (activeStep.name !== 'Final Step') {\n return (\n <>\n <Button variant=\"primary\" type=\"submit\" onClick={onNext}>\n Forward\n </Button>\n <Button\n variant=\"secondary\"\n onClick={onBack}\n className={activeStep.name === 'First step' ? 'pf-m-disabled' : ''}\n >\n Backward\n </Button>\n <Button variant=\"link\" onClick={onClose}>\n Cancel\n </Button>\n </>\n );\n }\n // Final step buttons\n return (\n <>\n <Button onClick={() => validateLastStep(onNext)}>Validate</Button>\n <Button onClick={() => goToStepByName('First step')}>Go to Beginning</Button>\n </>\n );\n }}\n </WizardContextConsumerDeprecated>\n </WizardFooterDeprecated>\n );\n\n const title = 'Validate on button press wizard example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={closeWizard}\n footer={CustomFooter}\n steps={steps}\n height={400}\n />\n );\n};\n","title":"Validate on button press","lang":"js","className":""}}>
708
-
709
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
710
- {`This example demonstrates how to use the `}
711
-
712
- <code {...{"className":"ws-code "}}>
713
- {`WizardContextConsumer`}
714
- </code>
715
- {` to consume the `}
716
-
717
- <code {...{"className":"ws-code "}}>
718
- {`WizardContext`}
719
- </code>
720
- {`. `}
721
-
722
- <code {...{"className":"ws-code "}}>
723
- {`WizardContext`}
724
- </code>
725
- {` can be used to imperatively move to a specific wizard step.`}
726
- </p>
727
-
728
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
729
- {`The definition of the `}
730
-
731
- <code {...{"className":"ws-code "}}>
732
- {`WizardContext`}
733
- </code>
734
- {` is as follows:`}
735
- </p>
736
-
737
- <Example {...{"code":"interface WizardContext {\n goToStepById: (stepId: number | string) => void;\n goToStepByName: (stepName: string) => void;\n onNext: () => void;\n onBack: () => void;\n onClose: () => void;\n activeStep: WizardStep;\n}","className":""}}>
738
-
739
- </Example>
740
- </Example>,
741
- 'Progressive steps': props =>
742
- <Example {...pageData} {...props} {...{"code":"import { Button, Radio, Alert } from '@patternfly/react-core';\nimport {\n Wizard as WizardDeprecated,\n WizardFooter as WizardFooterDeprecated,\n WizardContextConsumer as WizardContextConsumerDeprecated\n} from '@patternfly/react-core/deprecated';\n\nclass ProgressiveWizard extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n showCreateStep: false,\n showUpdateStep: false,\n showOptionsStep: false,\n showReviewStep: false,\n getStartedStepRadio: 'Create',\n createStepRadio: 'Quick',\n updateStepRadio: 'Quick'\n };\n this.closeWizard = () => {\n console.log('close wizard');\n };\n this.onGoToStep = ({ id, name }, { prevId, prevName }) => {\n // Remove steps after the currently clicked step\n if (name === 'Get started') {\n this.setState({\n showReviewStep: false,\n showOptionsStep: false,\n showCreateStep: false,\n showUpdateStep: false\n });\n } else if (name === 'Create options' || name === 'Update options') {\n this.setState({\n showReviewStep: false,\n showOptionsStep: false\n });\n } else if (name.indexOf('Substep') > -1) {\n this.setState({\n showReviewStep: false\n });\n }\n };\n this.getNextStep = (activeStep, callback) => {\n if (activeStep.name === 'Get started') {\n if (this.state.getStartedStepRadio === 'Create') {\n this.setState(\n {\n showCreateStep: true,\n showUpdateStep: false,\n showOptionsStep: false,\n showReviewStep: false\n },\n () => {\n callback();\n }\n );\n } else {\n this.setState(\n {\n showCreateStep: false,\n showUpdateStep: true,\n showOptionsStep: false,\n showReviewStep: false\n },\n () => {\n callback();\n }\n );\n }\n } else if (activeStep.name === 'Create options' || activeStep.name === 'Update options') {\n this.setState(\n {\n showOptionsStep: true,\n showReviewStep: false\n },\n () => {\n callback();\n }\n );\n } else if (activeStep.name === 'Substep 3') {\n this.setState(\n {\n showReviewStep: true\n },\n () => {\n callback();\n }\n );\n } else {\n callback();\n }\n };\n this.getPreviousStep = (activeStep, callback) => {\n if (activeStep.name === 'Review') {\n this.setState(\n {\n showReviewStep: false\n },\n () => {\n callback();\n }\n );\n } else if (activeStep.name === 'Substep 1') {\n this.setState(\n {\n showOptionsStep: false\n },\n () => {\n callback();\n }\n );\n } else if (activeStep.name === 'Create options') {\n this.setState(\n {\n showCreateStep: false\n },\n () => {\n callback();\n }\n );\n } else if (activeStep.name === 'Update options') {\n this.setState(\n {\n showUpdateStep: false\n },\n () => {\n callback();\n }\n );\n } else {\n callback();\n }\n };\n }\n render() {\n const {\n stepsValid,\n getStartedStepRadio,\n createStepRadio,\n updateStepRadio,\n showCreateStep,\n showUpdateStep,\n showOptionsStep,\n showReviewStep\n } = this.state;\n const getStartedStep = {\n name: 'Get started',\n component: (\n <div>\n <Radio\n value=\"Create\"\n isChecked={getStartedStepRadio === 'Create'}\n onChange={(event) => this.setState({ getStartedStepRadio: event.currentTarget.value })}\n label=\"Create a new thing\"\n name=\"radio-step-start\"\n id=\"radio-step-start-1\"\n />{' '}\n <Radio\n value=\"Update\"\n isChecked={getStartedStepRadio === 'Update'}\n onChange={(event) => this.setState({ getStartedStepRadio: event.currentTarget.value })}\n label=\"Update an existing thing\"\n name=\"radio-step-start\"\n id=\"radio-step-start-2\"\n />\n </div>\n )\n };\n const createStep = {\n name: 'Create options',\n component: (\n <div>\n <Radio\n value=\"Quick\"\n isChecked={createStepRadio === 'Quick'}\n onChange={(event) => this.setState({ createStepRadio: event.currentTarget.value })}\n label=\"Quick create\"\n name=\"radio-step-create\"\n id=\"radio-step-create-1\"\n />{' '}\n <Radio\n value=\"Custom\"\n isChecked={createStepRadio === 'Custom'}\n onChange={(event) => this.setState({ createStepRadio: event.currentTarget.value })}\n label=\"Custom create\"\n name=\"radio-step-create\"\n id=\"radio-step-create-2\"\n />\n </div>\n )\n };\n const updateStep = {\n name: 'Update options',\n component: (\n <div>\n <Radio\n value=\"Quick\"\n isChecked={updateStepRadio === 'Quick'}\n onChange={(event) => this.setState({ updateStepRadio: event.currentTarget.value })}\n label=\"Quick update\"\n name=\"radio-step-update\"\n id=\"radio-step-update-1\"\n />{' '}\n <Radio\n value=\"Custom\"\n isChecked={updateStepRadio === 'Custom'}\n onChange={(event) => this.setState({ updateStepRadio: event.currentTarget.value })}\n label=\"Custom update\"\n name=\"radio-step-update\"\n id=\"radio-step-update-2\"\n />\n </div>\n )\n };\n const optionsStep = {\n name: showCreateStep ? `${createStepRadio} Options` : `${updateStepRadio} Options`,\n steps: [\n {\n name: 'Substep 1',\n component: 'Substep 1'\n },\n {\n name: 'Substep 2',\n component: 'Substep 2'\n },\n {\n name: 'Substep 3',\n component: 'Substep 3'\n }\n ]\n };\n const reviewStep = {\n name: 'Review',\n component: (\n <div>\n <div>First choice: {getStartedStepRadio}</div>\n <div>Second choice: {showCreateStep ? createStepRadio : updateStepRadio}</div>\n </div>\n )\n };\n const steps = [\n getStartedStep,\n ...(showCreateStep ? [createStep] : []),\n ...(showUpdateStep ? [updateStep] : []),\n ...(showOptionsStep ? [optionsStep] : []),\n ...(showReviewStep ? [reviewStep] : [])\n ];\n const CustomFooter = (\n <WizardFooterDeprecated>\n <WizardContextConsumerDeprecated>\n {({ activeStep, goToStepByName, goToStepById, onNext, onBack, onClose }) => {\n return (\n <>\n <Button\n variant=\"secondary\"\n onClick={() => this.getPreviousStep(activeStep, onBack)}\n className={activeStep.name === 'Get started' ? 'pf-m-disabled' : ''}\n >\n Back\n </Button>\n <Button variant=\"primary\" type=\"submit\" onClick={() => this.getNextStep(activeStep, onNext)}>\n {activeStep.name === 'Review' ? 'Finish' : 'Next'}\n </Button>\n <Button variant=\"link\" onClick={onClose}>\n Cancel\n </Button>\n </>\n );\n }}\n </WizardContextConsumerDeprecated>\n </WizardFooterDeprecated>\n );\n const title = 'Progressive wizard';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={this.closeWizard}\n footer={CustomFooter}\n onGoToStep={this.onGoToStep}\n steps={steps}\n height={400}\n />\n );\n }\n}","title":"Progressive steps","lang":"js","className":""}}>
743
-
744
- </Example>,
745
- 'Get current step': props =>
746
- <Example {...pageData} {...props} {...{"code":"import { Wizard as WizardDeprecated, WizardStep } from '@patternfly/react-core/deprecated';\n\nexport const WizardGetCurrentStep: React.FunctionComponent = () => {\n const onCurrentStepChanged = ({ id }: WizardStep) => {\n // eslint-disable-next-line no-console\n console.log(id);\n };\n const closeWizard = () => {\n // eslint-disable-next-line no-console\n console.log('close wizard');\n };\n\n const steps = [\n { id: 1, name: 'First step', component: <p>Step 1 content</p> },\n { id: 2, name: 'Second step', component: <p>Step 2 content</p> },\n { id: 3, name: 'Third step', component: <p>Step 3 content</p> },\n { id: 4, name: 'Fourth step', component: <p>Step 4 content</p> },\n { id: 5, name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }\n ];\n const title = 'Get current step wizard example';\n return (\n <WizardDeprecated\n navAriaLabel={`${title} steps`}\n mainAriaLabel={`${title} content`}\n onClose={closeWizard}\n description=\"Simple Wizard Description\"\n steps={steps}\n height={400}\n onCurrentStepChanged={onCurrentStepChanged}\n />\n );\n};\n","title":"Get current step","lang":"js","className":""}}>
747
-
748
- </Example>,
749
- 'Wizard in modal': props =>
750
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport { Button } from '@patternfly/react-core';\nimport { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n\nexport const WizardInModal: React.FunctionComponent = () => {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleModalToggle = (_event: KeyboardEvent | React.MouseEvent) => {\n setIsOpen(!isOpen);\n };\n\n const handleWizardToggle = () => {\n setIsOpen(!isOpen);\n };\n\n const steps = [\n { name: 'First step', component: <p>Step 1 content</p> },\n { name: 'Second step', component: <p>Step 2 content</p> },\n { name: 'Third step', component: <p>Step 3 content</p> },\n { name: 'Fourth step', component: <p>Step 4 content</p> },\n { name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }\n ];\n\n const title = 'Wizard in modal example';\n\n return (\n <Fragment>\n <Button variant=\"primary\" onClick={handleModalToggle}>\n Show Modal\n </Button>\n <WizardDeprecated\n title={title}\n description=\"Simple Wizard Description\"\n descriptionComponent=\"div\"\n steps={steps}\n onClose={handleWizardToggle}\n isOpen={isOpen}\n />\n </Fragment>\n );\n};\n","title":"Wizard in modal","lang":"js","className":""}}>
751
-
752
- </Example>,
753
- 'Wizard with drawer': props =>
754
- <Example {...pageData} {...props} {...{"code":"import { Fragment, useRef, useState } from 'react';\nimport {\n Button,\n DrawerActions,\n DrawerCloseButton,\n DrawerHead,\n DrawerPanelContent,\n DrawerColorVariant\n} from '@patternfly/react-core';\nimport { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';\n\nexport const WizardWithDrawer: React.FunctionComponent = () => {\n const [isDrawerExpanded, setIsDrawerExpanded] = useState(false);\n\n const drawerRef = useRef<HTMLSpanElement>(null);\n\n const onExpandDrawer = () => {\n drawerRef.current && drawerRef.current.focus();\n };\n\n const onOpenClick = () => {\n setIsDrawerExpanded(true);\n };\n\n const onCloseClick = () => {\n setIsDrawerExpanded(false);\n };\n\n const panel1Content = (\n <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.secondary}>\n <DrawerHead>\n <span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>\n drawer-panel-1 content\n </span>\n <DrawerActions>\n <DrawerCloseButton onClick={onCloseClick} />\n </DrawerActions>\n </DrawerHead>\n </DrawerPanelContent>\n );\n\n const panel2Content = (\n <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.secondary}>\n <DrawerHead>\n <span tabIndex={0} ref={drawerRef}>\n drawer-panel-2 content\n </span>\n <DrawerActions>\n <DrawerCloseButton onClick={onCloseClick} />\n </DrawerActions>\n </DrawerHead>\n </DrawerPanelContent>\n );\n\n const panel3Content = (\n <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.secondary}>\n <DrawerHead>\n <span tabIndex={0} ref={drawerRef}>\n drawer-panel-3 content\n </span>\n <DrawerActions>\n <DrawerCloseButton onClick={onCloseClick} />\n </DrawerActions>\n </DrawerHead>\n </DrawerPanelContent>\n );\n\n const drawerToggleButton = (\n <Button isInline variant=\"link\" onClick={onOpenClick}>\n Open Drawer\n </Button>\n );\n\n const steps = [\n {\n name: 'Information',\n component: <p>Information step content</p>,\n drawerPanelContent: panel1Content,\n drawerToggleButton\n },\n {\n name: 'Configuration',\n steps: [\n {\n name: 'Substep A',\n component: <p>Substep A content</p>,\n drawerPanelContent: panel2Content,\n drawerToggleButton\n },\n {\n name: 'Substep B',\n component: <p>Substep B content</p>,\n drawerPanelContent: panel2Content,\n drawerToggleButton\n },\n {\n name: 'Substep C',\n component: <p>Substep C content</p>,\n drawerPanelContent: panel2Content,\n drawerToggleButton\n }\n ]\n },\n {\n name: 'Additional',\n component: <p>Additional step content</p>,\n drawerPanelContent: panel3Content,\n drawerToggleButton\n },\n {\n name: 'Review',\n component: <p>Review step content</p>,\n nextButtonText: 'Finish'\n }\n ];\n\n const title = 'Wizard with drawer example';\n\n return (\n <Fragment>\n <WizardDeprecated\n height={400}\n isDrawerExpanded={isDrawerExpanded}\n onExpandDrawer={onExpandDrawer}\n hasDrawer\n navAriaLabel={`${title} steps`}\n steps={steps}\n />\n </Fragment>\n );\n};\n","title":"Wizard with drawer","lang":"js","className":""}}>
755
-
756
- </Example>
757
- };
758
-
759
- const Component = () => (
760
- <React.Fragment>
761
- <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
762
- {`If you seek a wizard solution that allows for more composition, see the `}
763
- <PatternflyThemeLink {...{"to":"/components/wizard","className":""}}>
764
- {`React`}
765
- </PatternflyThemeLink>
766
- {` tab.`}
767
- </p>
768
- <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
769
- {`Examples`}
770
- </AutoLinkHeader>
771
- {React.createElement(pageData.examples["Basic"])}
772
- {React.createElement(pageData.examples["Basic with disabled steps"])}
773
- {React.createElement(pageData.examples["Anchors for nav items"])}
774
- {React.createElement(pageData.examples["Incrementally enabled steps"])}
775
- {React.createElement(pageData.examples["Expandable steps"])}
776
- {React.createElement(pageData.examples["Finished"])}
777
- {React.createElement(pageData.examples["Enabled on form validation"])}
778
- {React.createElement(pageData.examples["Validate on button press"])}
779
- {React.createElement(pageData.examples["Progressive steps"])}
780
- {React.createElement(pageData.examples["Get current step"])}
781
- {React.createElement(pageData.examples["Wizard in modal"])}
782
- {React.createElement(pageData.examples["Wizard with drawer"])}
783
- </React.Fragment>
784
- );
785
- Component.displayName = 'ComponentsWizardReactDeprecatedDocs';
786
- Component.pageData = pageData;
787
-
788
- export default Component;