@patternfly/react-core 5.0.0-alpha.74 → 5.0.0-alpha.76

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 (266) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/esm/components/AboutModal/package.json +1 -1
  3. package/dist/esm/components/Accordion/package.json +1 -1
  4. package/dist/esm/components/ActionList/package.json +1 -1
  5. package/dist/esm/components/Alert/package.json +1 -1
  6. package/dist/esm/components/Avatar/package.json +1 -1
  7. package/dist/esm/components/BackToTop/package.json +1 -1
  8. package/dist/esm/components/Backdrop/package.json +1 -1
  9. package/dist/esm/components/BackgroundImage/package.json +1 -1
  10. package/dist/esm/components/Badge/package.json +1 -1
  11. package/dist/esm/components/Banner/package.json +1 -1
  12. package/dist/esm/components/Brand/package.json +1 -1
  13. package/dist/esm/components/Breadcrumb/package.json +1 -1
  14. package/dist/esm/components/Button/package.json +1 -1
  15. package/dist/esm/components/CalendarMonth/package.json +1 -1
  16. package/dist/esm/components/Card/package.json +1 -1
  17. package/dist/esm/components/Checkbox/package.json +1 -1
  18. package/dist/esm/components/Chip/package.json +1 -1
  19. package/dist/esm/components/ChipGroup/package.json +1 -1
  20. package/dist/esm/components/ClipboardCopy/package.json +1 -1
  21. package/dist/esm/components/CodeBlock/package.json +1 -1
  22. package/dist/esm/components/DataList/package.json +1 -1
  23. package/dist/esm/components/DatePicker/package.json +1 -1
  24. package/dist/esm/components/DescriptionList/package.json +1 -1
  25. package/dist/esm/components/Divider/package.json +1 -1
  26. package/dist/esm/components/DragDrop/package.json +1 -1
  27. package/dist/esm/components/Drawer/package.json +1 -1
  28. package/dist/esm/components/Dropdown/package.json +1 -1
  29. package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  30. package/dist/esm/components/DualListSelector/DualListSelectorPane.js +1 -1
  31. package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  32. package/dist/esm/components/DualListSelector/package.json +1 -1
  33. package/dist/esm/components/EmptyState/package.json +1 -1
  34. package/dist/esm/components/ExpandableSection/package.json +1 -1
  35. package/dist/esm/components/FileUpload/FileUpload.d.ts +1 -1
  36. package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
  37. package/dist/esm/components/FileUpload/FileUploadField.d.ts +1 -1
  38. package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
  39. package/dist/esm/components/FileUpload/FileUploadField.js +3 -3
  40. package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
  41. package/dist/esm/components/FileUpload/package.json +1 -1
  42. package/dist/esm/components/Form/package.json +1 -1
  43. package/dist/esm/components/FormSelect/package.json +1 -1
  44. package/dist/esm/components/HelperText/package.json +1 -1
  45. package/dist/esm/components/Hint/package.json +1 -1
  46. package/dist/esm/components/Icon/package.json +1 -1
  47. package/dist/esm/components/InputGroup/package.json +1 -1
  48. package/dist/esm/components/JumpLinks/package.json +1 -1
  49. package/dist/esm/components/Label/package.json +1 -1
  50. package/dist/esm/components/LabelGroup/package.json +1 -1
  51. package/dist/esm/components/List/package.json +1 -1
  52. package/dist/esm/components/LoginPage/package.json +1 -1
  53. package/dist/esm/components/Masthead/package.json +1 -1
  54. package/dist/esm/components/Menu/package.json +1 -1
  55. package/dist/esm/components/MenuToggle/package.json +1 -1
  56. package/dist/esm/components/Modal/package.json +1 -1
  57. package/dist/esm/components/MultipleFileUpload/package.json +1 -1
  58. package/dist/esm/components/Nav/package.json +1 -1
  59. package/dist/esm/components/NotificationBadge/package.json +1 -1
  60. package/dist/esm/components/NotificationDrawer/package.json +1 -1
  61. package/dist/esm/components/NumberInput/package.json +1 -1
  62. package/dist/esm/components/OverflowMenu/package.json +1 -1
  63. package/dist/esm/components/Page/package.json +1 -1
  64. package/dist/esm/components/Pagination/package.json +1 -1
  65. package/dist/esm/components/Panel/package.json +1 -1
  66. package/dist/esm/components/Popover/package.json +1 -1
  67. package/dist/esm/components/Progress/package.json +1 -1
  68. package/dist/esm/components/ProgressStepper/package.json +1 -1
  69. package/dist/esm/components/Radio/package.json +1 -1
  70. package/dist/esm/components/SearchInput/SearchInput.d.ts +0 -2
  71. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  72. package/dist/esm/components/SearchInput/SearchInput.js +2 -2
  73. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  74. package/dist/esm/components/SearchInput/package.json +1 -1
  75. package/dist/esm/components/Select/package.json +1 -1
  76. package/dist/esm/components/Sidebar/package.json +1 -1
  77. package/dist/esm/components/SimpleList/package.json +1 -1
  78. package/dist/esm/components/Skeleton/package.json +1 -1
  79. package/dist/esm/components/SkipToContent/package.json +1 -1
  80. package/dist/esm/components/Slider/package.json +1 -1
  81. package/dist/esm/components/Spinner/package.json +1 -1
  82. package/dist/esm/components/Switch/package.json +1 -1
  83. package/dist/esm/components/Tabs/package.json +1 -1
  84. package/dist/esm/components/Text/package.json +1 -1
  85. package/dist/esm/components/TextArea/package.json +1 -1
  86. package/dist/esm/components/TextInput/package.json +1 -1
  87. package/dist/esm/components/TextInputGroup/package.json +1 -1
  88. package/dist/esm/components/Tile/package.json +1 -1
  89. package/dist/esm/components/TimePicker/package.json +1 -1
  90. package/dist/esm/components/Timestamp/package.json +1 -1
  91. package/dist/esm/components/Title/package.json +1 -1
  92. package/dist/esm/components/ToggleGroup/package.json +1 -1
  93. package/dist/esm/components/Toolbar/package.json +1 -1
  94. package/dist/esm/components/Tooltip/package.json +1 -1
  95. package/dist/esm/components/TreeView/package.json +1 -1
  96. package/dist/esm/components/Truncate/package.json +1 -1
  97. package/dist/esm/components/Wizard/hooks/package.json +1 -1
  98. package/dist/esm/components/Wizard/package.json +1 -1
  99. package/dist/esm/components/package.json +1 -1
  100. package/dist/esm/deprecated/components/ApplicationLauncher/package.json +1 -1
  101. package/dist/esm/deprecated/components/ContextSelector/ContextSelector.d.ts.map +1 -1
  102. package/dist/esm/deprecated/components/ContextSelector/ContextSelector.js +1 -1
  103. package/dist/esm/deprecated/components/ContextSelector/ContextSelector.js.map +1 -1
  104. package/dist/esm/deprecated/components/ContextSelector/package.json +1 -1
  105. package/dist/esm/deprecated/components/Dropdown/package.json +1 -1
  106. package/dist/esm/deprecated/components/OptionsMenu/package.json +1 -1
  107. package/dist/esm/deprecated/components/PageHeader/package.json +1 -1
  108. package/dist/esm/deprecated/components/Select/package.json +1 -1
  109. package/dist/esm/deprecated/components/Wizard/package.json +1 -1
  110. package/dist/esm/deprecated/components/package.json +1 -1
  111. package/dist/esm/deprecated/package.json +1 -1
  112. package/dist/esm/helpers/Popper/thirdparty/popper-core/package.json +1 -1
  113. package/dist/esm/helpers/package.json +1 -1
  114. package/dist/esm/layouts/Bullseye/package.json +1 -1
  115. package/dist/esm/layouts/Flex/package.json +1 -1
  116. package/dist/esm/layouts/Gallery/package.json +1 -1
  117. package/dist/esm/layouts/Grid/package.json +1 -1
  118. package/dist/esm/layouts/Level/package.json +1 -1
  119. package/dist/esm/layouts/Split/package.json +1 -1
  120. package/dist/esm/layouts/Stack/package.json +1 -1
  121. package/dist/esm/layouts/package.json +1 -1
  122. package/dist/esm/next/components/package.json +1 -1
  123. package/dist/esm/next/package.json +1 -1
  124. package/dist/esm/package.json +1 -1
  125. package/dist/js/components/AboutModal/package.json +1 -1
  126. package/dist/js/components/Accordion/package.json +1 -1
  127. package/dist/js/components/ActionList/package.json +1 -1
  128. package/dist/js/components/Alert/package.json +1 -1
  129. package/dist/js/components/Avatar/package.json +1 -1
  130. package/dist/js/components/BackToTop/package.json +1 -1
  131. package/dist/js/components/Backdrop/package.json +1 -1
  132. package/dist/js/components/BackgroundImage/package.json +1 -1
  133. package/dist/js/components/Badge/package.json +1 -1
  134. package/dist/js/components/Banner/package.json +1 -1
  135. package/dist/js/components/Brand/package.json +1 -1
  136. package/dist/js/components/Breadcrumb/package.json +1 -1
  137. package/dist/js/components/Button/package.json +1 -1
  138. package/dist/js/components/CalendarMonth/package.json +1 -1
  139. package/dist/js/components/Card/package.json +1 -1
  140. package/dist/js/components/Checkbox/package.json +1 -1
  141. package/dist/js/components/Chip/package.json +1 -1
  142. package/dist/js/components/ChipGroup/package.json +1 -1
  143. package/dist/js/components/ClipboardCopy/package.json +1 -1
  144. package/dist/js/components/CodeBlock/package.json +1 -1
  145. package/dist/js/components/DataList/package.json +1 -1
  146. package/dist/js/components/DatePicker/package.json +1 -1
  147. package/dist/js/components/DescriptionList/package.json +1 -1
  148. package/dist/js/components/Divider/package.json +1 -1
  149. package/dist/js/components/DragDrop/package.json +1 -1
  150. package/dist/js/components/Drawer/package.json +1 -1
  151. package/dist/js/components/Dropdown/package.json +1 -1
  152. package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  153. package/dist/js/components/DualListSelector/DualListSelectorPane.js +1 -1
  154. package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  155. package/dist/js/components/DualListSelector/package.json +1 -1
  156. package/dist/js/components/EmptyState/package.json +1 -1
  157. package/dist/js/components/ExpandableSection/package.json +1 -1
  158. package/dist/js/components/FileUpload/FileUpload.d.ts +1 -1
  159. package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
  160. package/dist/js/components/FileUpload/FileUploadField.d.ts +1 -1
  161. package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
  162. package/dist/js/components/FileUpload/FileUploadField.js +3 -3
  163. package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
  164. package/dist/js/components/FileUpload/package.json +1 -1
  165. package/dist/js/components/Form/package.json +1 -1
  166. package/dist/js/components/FormSelect/package.json +1 -1
  167. package/dist/js/components/HelperText/package.json +1 -1
  168. package/dist/js/components/Hint/package.json +1 -1
  169. package/dist/js/components/Icon/package.json +1 -1
  170. package/dist/js/components/InputGroup/package.json +1 -1
  171. package/dist/js/components/JumpLinks/package.json +1 -1
  172. package/dist/js/components/Label/package.json +1 -1
  173. package/dist/js/components/LabelGroup/package.json +1 -1
  174. package/dist/js/components/List/package.json +1 -1
  175. package/dist/js/components/LoginPage/package.json +1 -1
  176. package/dist/js/components/Masthead/package.json +1 -1
  177. package/dist/js/components/Menu/package.json +1 -1
  178. package/dist/js/components/MenuToggle/package.json +1 -1
  179. package/dist/js/components/Modal/package.json +1 -1
  180. package/dist/js/components/MultipleFileUpload/package.json +1 -1
  181. package/dist/js/components/Nav/package.json +1 -1
  182. package/dist/js/components/NotificationBadge/package.json +1 -1
  183. package/dist/js/components/NotificationDrawer/package.json +1 -1
  184. package/dist/js/components/NumberInput/package.json +1 -1
  185. package/dist/js/components/OverflowMenu/package.json +1 -1
  186. package/dist/js/components/Page/package.json +1 -1
  187. package/dist/js/components/Pagination/package.json +1 -1
  188. package/dist/js/components/Panel/package.json +1 -1
  189. package/dist/js/components/Popover/package.json +1 -1
  190. package/dist/js/components/Progress/package.json +1 -1
  191. package/dist/js/components/ProgressStepper/package.json +1 -1
  192. package/dist/js/components/Radio/package.json +1 -1
  193. package/dist/js/components/SearchInput/SearchInput.d.ts +0 -2
  194. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  195. package/dist/js/components/SearchInput/SearchInput.js +2 -2
  196. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  197. package/dist/js/components/SearchInput/package.json +1 -1
  198. package/dist/js/components/Select/package.json +1 -1
  199. package/dist/js/components/Sidebar/package.json +1 -1
  200. package/dist/js/components/SimpleList/package.json +1 -1
  201. package/dist/js/components/Skeleton/package.json +1 -1
  202. package/dist/js/components/SkipToContent/package.json +1 -1
  203. package/dist/js/components/Slider/package.json +1 -1
  204. package/dist/js/components/Spinner/package.json +1 -1
  205. package/dist/js/components/Switch/package.json +1 -1
  206. package/dist/js/components/Tabs/package.json +1 -1
  207. package/dist/js/components/Text/package.json +1 -1
  208. package/dist/js/components/TextArea/package.json +1 -1
  209. package/dist/js/components/TextInput/package.json +1 -1
  210. package/dist/js/components/TextInputGroup/package.json +1 -1
  211. package/dist/js/components/Tile/package.json +1 -1
  212. package/dist/js/components/TimePicker/package.json +1 -1
  213. package/dist/js/components/Timestamp/package.json +1 -1
  214. package/dist/js/components/Title/package.json +1 -1
  215. package/dist/js/components/ToggleGroup/package.json +1 -1
  216. package/dist/js/components/Toolbar/package.json +1 -1
  217. package/dist/js/components/Tooltip/package.json +1 -1
  218. package/dist/js/components/TreeView/package.json +1 -1
  219. package/dist/js/components/Truncate/package.json +1 -1
  220. package/dist/js/components/Wizard/hooks/package.json +1 -1
  221. package/dist/js/components/Wizard/package.json +1 -1
  222. package/dist/js/components/package.json +1 -1
  223. package/dist/js/deprecated/components/ApplicationLauncher/package.json +1 -1
  224. package/dist/js/deprecated/components/ContextSelector/ContextSelector.d.ts.map +1 -1
  225. package/dist/js/deprecated/components/ContextSelector/ContextSelector.js +1 -1
  226. package/dist/js/deprecated/components/ContextSelector/ContextSelector.js.map +1 -1
  227. package/dist/js/deprecated/components/ContextSelector/package.json +1 -1
  228. package/dist/js/deprecated/components/Dropdown/package.json +1 -1
  229. package/dist/js/deprecated/components/OptionsMenu/package.json +1 -1
  230. package/dist/js/deprecated/components/PageHeader/package.json +1 -1
  231. package/dist/js/deprecated/components/Select/package.json +1 -1
  232. package/dist/js/deprecated/components/Wizard/package.json +1 -1
  233. package/dist/js/deprecated/components/package.json +1 -1
  234. package/dist/js/deprecated/package.json +1 -1
  235. package/dist/js/helpers/Popper/thirdparty/popper-core/package.json +1 -1
  236. package/dist/js/helpers/package.json +1 -1
  237. package/dist/js/layouts/Bullseye/package.json +1 -1
  238. package/dist/js/layouts/Flex/package.json +1 -1
  239. package/dist/js/layouts/Gallery/package.json +1 -1
  240. package/dist/js/layouts/Grid/package.json +1 -1
  241. package/dist/js/layouts/Level/package.json +1 -1
  242. package/dist/js/layouts/Split/package.json +1 -1
  243. package/dist/js/layouts/Stack/package.json +1 -1
  244. package/dist/js/layouts/package.json +1 -1
  245. package/dist/js/next/components/package.json +1 -1
  246. package/dist/js/next/package.json +1 -1
  247. package/dist/js/package.json +1 -1
  248. package/dist/umd/react-core.min.js +1 -1
  249. package/package.json +2 -2
  250. package/src/components/DualListSelector/DualListSelectorPane.tsx +0 -1
  251. package/src/components/DualListSelector/__tests__/__snapshots__/DualListSelector.test.tsx.snap +2 -2
  252. package/src/components/FileUpload/FileUpload.tsx +1 -1
  253. package/src/components/FileUpload/FileUploadField.tsx +4 -4
  254. package/src/components/FileUpload/examples/FileUploadCustomUpload.tsx +1 -1
  255. package/src/components/FileUpload/examples/FileUploadSimpleText.tsx +7 -3
  256. package/src/components/FileUpload/examples/FileUploadTextWithEdits.tsx +7 -3
  257. package/src/components/FileUpload/examples/FileUploadTextWithRestrictions.tsx +7 -3
  258. package/src/components/Menu/examples/MenuFilterDrilldown.tsx +0 -1
  259. package/src/components/Menu/examples/MenuFilteringWithSearchInput.tsx +0 -1
  260. package/src/components/SearchInput/SearchInput.tsx +0 -15
  261. package/src/demos/ComposableMenu/examples/ComposableApplicationLauncher.tsx +1 -1
  262. package/src/demos/ComposableMenu/examples/ComposableContextSelector.tsx +2 -3
  263. package/src/demos/Wizard/WizardDemo.md +290 -717
  264. package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +1 -1
  265. package/src/deprecated/components/ContextSelector/ContextSelector.tsx +0 -1
  266. package/src/deprecated/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +2 -2
@@ -7,7 +7,6 @@ source: react-demos
7
7
  import imgBrand from './imgBrand.svg';
8
8
  import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
9
9
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
10
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
11
10
 
12
11
  ## Demos
13
12
 
@@ -20,54 +19,21 @@ import {
20
19
  CardBody,
21
20
  Gallery,
22
21
  GalleryItem,
23
- Nav,
24
- NavItem,
25
- NavList,
26
22
  PageSection,
27
23
  Modal,
28
- ModalVariant
24
+ ModalVariant,
25
+ Wizard,
26
+ WizardHeader,
27
+ WizardStep
29
28
  } from '@patternfly/react-core';
30
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
31
29
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
32
30
 
33
- class BasicWizardDemo extends React.Component {
31
+ class WizardInModalDemo extends React.Component {
34
32
  constructor(props) {
35
33
  super(props);
36
- this.state = {
37
- activeItem: 0
38
- };
39
- this.onNavSelect = result => {
40
- this.setState({
41
- activeItem: result.itemId
42
- });
43
- };
44
34
  }
45
- render() {
46
- const { activeItem } = this.state;
47
35
 
48
- const steps = [
49
- { id: 0, name: 'Information', component: <p>Step 1 content</p> },
50
- {
51
- id: 1,
52
- name: 'Configuration',
53
- steps: [
54
- {
55
- id: 2,
56
- name: 'Substep A',
57
- component: <p>Configuration substep A</p>
58
- },
59
- {
60
- id: 3,
61
- name: 'Substep B',
62
- component: <p>Configuration substep B</p>
63
- }
64
- ],
65
- component: <p>Step 2 content</p>
66
- },
67
- { id: 4, name: 'Additional', component: <p>Step 3 content</p> },
68
- { id: 5, name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }
69
- ];
70
- const title = 'Basic wizard';
36
+ render() {
71
37
  return (
72
38
  <React.Fragment>
73
39
  <DashboardWrapper hasPageTemplateTitle>
@@ -91,16 +57,40 @@ class BasicWizardDemo extends React.Component {
91
57
  aria-describedby="wiz-modal-demo-description"
92
58
  aria-labelledby="wiz-modal-demo-title"
93
59
  >
94
- <WizardDeprecated
95
- navAriaLabel={`${title} steps`}
96
- mainAriaLabel={`${title} content`}
97
- titleId="wiz-modal-demo-title"
98
- descriptionId="wiz-modal-demo-description"
99
- title="Simple wizard in modal"
100
- description="Simple wizard description"
101
- steps={steps}
60
+ <Wizard
61
+ header={
62
+ <WizardHeader
63
+ title="Wizard in modal"
64
+ titleId="wiz-modal-demo-title"
65
+ description="Simple wizard description"
66
+ descriptionId="wiz-modal-demo-description"
67
+ closeButtonAriaLabel="Close wizard"
68
+ />
69
+ }
102
70
  height={400}
103
- />
71
+ >
72
+ <WizardStep name="Information" id="wizard-step-1">
73
+ <p>Step 1 content</p>
74
+ </WizardStep>
75
+ <WizardStep
76
+ name="Configuration"
77
+ id="wizard-step-2"
78
+ steps={[
79
+ <WizardStep name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
80
+ <p>Configuration substep A</p>
81
+ </WizardStep>,
82
+ <WizardStep name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
83
+ <p>Configuration substep B</p>
84
+ </WizardStep>
85
+ ]}
86
+ />
87
+ <WizardStep name="Additional" id="wizard-step-3">
88
+ <p>Step 3 content</p>
89
+ </WizardStep>
90
+ <WizardStep name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
91
+ <p>Review step content</p>
92
+ </WizardStep>
93
+ </Wizard>
104
94
  </Modal>
105
95
  </React.Fragment>
106
96
  );
@@ -114,14 +104,18 @@ class BasicWizardDemo extends React.Component {
114
104
  import React from 'react';
115
105
  import {
116
106
  Button,
107
+ Drawer,
117
108
  DrawerActions,
118
109
  DrawerCloseButton,
110
+ DrawerContent,
119
111
  DrawerPanelContent,
120
112
  DrawerHead,
121
113
  Modal,
122
- ModalVariant
114
+ ModalVariant,
115
+ Wizard,
116
+ WizardHeader,
117
+ WizardStep
123
118
  } from '@patternfly/react-core';
124
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
125
119
 
126
120
  class WizardModalWithDrawerDemo extends React.Component {
127
121
  constructor(props) {
@@ -151,131 +145,30 @@ class WizardModalWithDrawerDemo extends React.Component {
151
145
  render() {
152
146
  const { isDrawerExpanded } = this.state;
153
147
 
154
- const informationPanelContent = (
155
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
156
- <DrawerHead>
157
- <span tabIndex={0} ref={this.drawerRef}>
158
- Information panel content
159
- </span>
160
- <DrawerActions>
161
- <DrawerCloseButton onClick={this.onCloseClick} />
162
- </DrawerActions>
163
- </DrawerHead>
164
- </DrawerPanelContent>
165
- );
166
-
167
- const configSubstepAPanelContent = (
168
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
169
- <DrawerHead>
170
- <span tabIndex={0} ref={this.drawerRef}>
171
- Configuration substep A content
172
- </span>
173
- <DrawerActions>
174
- <DrawerCloseButton onClick={this.onCloseClick} />
175
- </DrawerActions>
176
- </DrawerHead>
177
- </DrawerPanelContent>
178
- );
179
-
180
- const configSubstepBPanelContent = (
181
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
182
- <DrawerHead>
183
- <span tabIndex={0} ref={this.drawerRef}>
184
- Configuration substep B content
185
- </span>
186
- <DrawerActions>
187
- <DrawerCloseButton onClick={this.onCloseClick} />
188
- </DrawerActions>
189
- </DrawerHead>
190
- </DrawerPanelContent>
191
- );
192
-
193
- const additionalPanelContent = (
194
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
195
- <DrawerHead>
196
- <span tabIndex={0} ref={this.drawerRef}>
197
- Additional panel content
198
- </span>
199
- <DrawerActions>
200
- <DrawerCloseButton onClick={this.onCloseClick} />
201
- </DrawerActions>
202
- </DrawerHead>
203
- </DrawerPanelContent>
204
- );
205
-
206
- const reviewPanelContent = (
207
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
208
- <DrawerHead>
209
- <span tabIndex={0} ref={this.drawerRef}>
210
- Review panel content
211
- </span>
212
- <DrawerActions>
213
- <DrawerCloseButton onClick={this.onCloseClick} />
214
- </DrawerActions>
215
- </DrawerHead>
216
- </DrawerPanelContent>
217
- );
218
-
219
- const drawerToggleButton = (
220
- <Button className="pf-u-float-right pf-u-ml-md" isInline variant="link" onClick={this.onOpenClick}>
221
- Open drawer
222
- </Button>
223
- );
224
-
225
- const steps = [
226
- {
227
- id: 0,
228
- name: 'Information',
229
- component: <p>Step 1 content</p>,
230
- drawerPanelContent: informationPanelContent,
231
- drawerToggleButton: drawerToggleButton
232
- },
233
- {
234
- id: 1,
235
- name: 'Configuration',
236
- steps: [
237
- {
238
- id: 2,
239
- name: 'Substep A',
240
- component: <p>Configuration substep A</p>,
241
- drawerPanelContent: configSubstepAPanelContent,
242
- drawerToggleButton: drawerToggleButton
243
- },
244
- {
245
- id: 3,
246
- name: 'Substep B',
247
- component: <p>Configuration substep B</p>,
248
- drawerPanelContent: configSubstepBPanelContent,
249
- drawerToggleButton: drawerToggleButton
148
+ const createStepContentWithDrawer = (stepName) => (
149
+ <Drawer isInline isExpanded={isDrawerExpanded} onExpand={this.onExpand}>
150
+ <DrawerContent
151
+ panelContent={
152
+ <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
153
+ <DrawerHead>
154
+ <span tabIndex={isDrawerExpanded ? 0 : -1} ref={this.drawerRef}>
155
+ Drawer content: {stepName}
156
+ </span>
157
+ <DrawerActions>
158
+ <DrawerCloseButton onClick={this.onCloseClick} />
159
+ </DrawerActions>
160
+ </DrawerHead>
161
+ </DrawerPanelContent>
250
162
  }
251
- ]
252
- },
253
- {
254
- id: 4,
255
- name: 'Additional',
256
- component: <p>Step 3 content</p>,
257
- drawerPanelContent: additionalPanelContent,
258
- drawerToggleButton: drawerToggleButton
259
- },
260
- {
261
- id: 5,
262
- name: 'Review',
263
- component: <p>Review step content</p>,
264
- drawerPanelContent: reviewPanelContent,
265
- drawerToggleButton: drawerToggleButton,
266
- nextButtonText: 'Finish'
267
- }
268
- ];
269
- const title = 'Wizard modal with Drawer';
270
-
271
- const panelContent = (
272
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
273
- <DrawerHead>
274
- <span tabIndex={0} ref={this.drawerRef}>
275
- drawer-panel
276
- </span>
277
- </DrawerHead>
278
- </DrawerPanelContent>
163
+ >
164
+ {!isDrawerExpanded && (
165
+ <Button isInline variant="link" onClick={this.onOpenClick}>
166
+ Open drawer
167
+ </Button>
168
+ )}
169
+ <div>{stepName} content</div>
170
+ </DrawerContent>
171
+ </Drawer>
279
172
  );
280
173
 
281
174
  return (
@@ -287,19 +180,40 @@ class WizardModalWithDrawerDemo extends React.Component {
287
180
  aria-describedby="wiz-modal-demo-description"
288
181
  aria-labelledby="wiz-modal-demo-title"
289
182
  >
290
- <WizardDeprecated
291
- navAriaLabel={`${title} steps`}
292
- hasDrawer
293
- isDrawerExpanded={isDrawerExpanded}
294
- onExpandDrawer={this.onExpand}
295
- mainAriaLabel={`${title} content`}
296
- titleId="wiz-modal-demo-title"
297
- descriptionId="wiz-modal-demo-description"
298
- title="Simple wizard in modal"
299
- description="Simple wizard description"
300
- steps={steps}
183
+ <Wizard
184
+ header={
185
+ <WizardHeader
186
+ closeButtonAriaLabel="Close wizard"
187
+ title="Wizard in modal with drawer"
188
+ titleId="wiz-modal-demo-title"
189
+ description="Simple wizard description"
190
+ descriptionId="wiz-modal-demo-description"
191
+ />
192
+ }
301
193
  height={400}
302
- />
194
+ >
195
+ <WizardStep body={null} name="Information" id="wizard-step-1">
196
+ {createStepContentWithDrawer('Information step')}
197
+ </WizardStep>
198
+ <WizardStep
199
+ name="Configuration"
200
+ id="wizard-step-2"
201
+ steps={[
202
+ <WizardStep body={null} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
203
+ {createStepContentWithDrawer('Configuration substep A')}
204
+ </WizardStep>,
205
+ <WizardStep body={null} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
206
+ {createStepContentWithDrawer('Configuration substep B')}
207
+ </WizardStep>
208
+ ]}
209
+ />
210
+ <WizardStep body={null} name="Additional" id="wizard-step-3">
211
+ {createStepContentWithDrawer('Additional step')}
212
+ </WizardStep>
213
+ <WizardStep body={null} name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
214
+ {createStepContentWithDrawer('Review step')}
215
+ </WizardStep>
216
+ </Wizard>
303
217
  </Modal>
304
218
  );
305
219
  }
@@ -312,18 +226,22 @@ class WizardModalWithDrawerDemo extends React.Component {
312
226
  import React from 'react';
313
227
  import {
314
228
  Button,
229
+ Drawer,
315
230
  DrawerActions,
316
231
  DrawerCloseButton,
232
+ DrawerContent,
317
233
  DrawerPanelContent,
318
234
  DrawerHead,
319
235
  Modal,
320
236
  ModalVariant,
321
237
  Text,
322
- TextContent
238
+ TextContent,
239
+ Wizard,
240
+ WizardHeader,
241
+ WizardStep
323
242
  } from '@patternfly/react-core';
324
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
325
243
 
326
- class WizardModalWithDrawerDemo extends React.Component {
244
+ class WizardModalWithDrawerInfoStepDemo extends React.Component {
327
245
  constructor(props) {
328
246
  super(props);
329
247
  this.state = {
@@ -351,84 +269,24 @@ class WizardModalWithDrawerDemo extends React.Component {
351
269
  render() {
352
270
  const { isDrawerExpanded } = this.state;
353
271
 
354
- const informationPanelContent = (
355
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
356
- <DrawerHead>
357
- <span tabIndex={0} ref={this.drawerRef}>
358
- Information panel content
359
- </span>
360
- <DrawerActions>
361
- <DrawerCloseButton onClick={this.onCloseClick} />
362
- </DrawerActions>
363
- </DrawerHead>
364
- </DrawerPanelContent>
365
- );
366
-
367
- const configSubstepAPanelContent = (
368
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
369
- <DrawerHead>
370
- <span tabIndex={0} ref={this.drawerRef}>
371
- Configuration substep A content
372
- </span>
373
- <DrawerActions>
374
- <DrawerCloseButton onClick={this.onCloseClick} />
375
- </DrawerActions>
376
- </DrawerHead>
377
- </DrawerPanelContent>
378
- );
379
-
380
- const configSubstepBPanelContent = (
381
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
382
- <DrawerHead>
383
- <span tabIndex={0} ref={this.drawerRef}>
384
- Configuration substep B content
385
- </span>
386
- <DrawerActions>
387
- <DrawerCloseButton onClick={this.onCloseClick} />
388
- </DrawerActions>
389
- </DrawerHead>
390
- </DrawerPanelContent>
391
- );
392
-
393
- const additionalPanelContent = (
394
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
395
- <DrawerHead>
396
- <span tabIndex={0} ref={this.drawerRef}>
397
- Additional panel content
398
- </span>
399
- <DrawerActions>
400
- <DrawerCloseButton onClick={this.onCloseClick} />
401
- </DrawerActions>
402
- </DrawerHead>
403
- </DrawerPanelContent>
404
- );
405
-
406
- const reviewPanelContent = (
407
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
408
- <DrawerHead>
409
- <span tabIndex={0} ref={this.drawerRef}>
410
- Review panel content
411
- </span>
412
- <DrawerActions>
413
- <DrawerCloseButton onClick={this.onCloseClick} />
414
- </DrawerActions>
415
- </DrawerHead>
416
- </DrawerPanelContent>
417
- );
418
-
419
- const drawerToggleButton = (
420
- <Button className="pf-u-float-right pf-u-ml-md" isInline variant="link" onClick={this.onOpenClick}>
421
- Open drawer
422
- </Button>
423
- );
424
-
425
- const steps = [
426
- {
427
- id: 0,
428
- name: 'Information',
429
- component: (
272
+ const createStepContentWithDrawer = (stepName) => (
273
+ <Drawer isInline isExpanded={isDrawerExpanded} onExpand={this.onExpand}>
274
+ <DrawerContent
275
+ panelContent={
276
+ <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
277
+ <DrawerHead>
278
+ <span tabIndex={isDrawerExpanded ? 0 : -1} ref={this.drawerRef}>
279
+ Drawer content: {stepName}
280
+ </span>
281
+ <DrawerActions>
282
+ <DrawerCloseButton onClick={this.onCloseClick} />
283
+ </DrawerActions>
284
+ </DrawerHead>
285
+ </DrawerPanelContent>
286
+ }
287
+ >
430
288
  <TextContent>
431
- <Text component={TextVariants.h1}>Information step content</Text>
289
+ <Text component={TextVariants.h1}>{stepName} content</Text>
432
290
  <p>
433
291
  Wizard description goes here. If you need more assistance,{' '}
434
292
  <Button isInline variant="link" onClick={this.onOpenClick}>
@@ -437,96 +295,8 @@ class WizardModalWithDrawerDemo extends React.Component {
437
295
  in the side drawer.{' '}
438
296
  </p>
439
297
  </TextContent>
440
- ),
441
- drawerPanelContent: informationPanelContent
442
- },
443
- {
444
- id: 1,
445
- name: 'Configuration',
446
- steps: [
447
- {
448
- id: 2,
449
- name: 'Substep A',
450
- component: (
451
- <TextContent>
452
- <Text component={TextVariants.h1}>Configuration substep A content</Text>
453
- <p>
454
- Wizard description goes here. If you need more assistance,
455
- <Button isInline variant="link" onClick={this.onOpenClick}>
456
- see more information
457
- </Button>
458
- in the side drawer.
459
- </p>
460
- </TextContent>
461
- ),
462
- drawerPanelContent: configSubstepAPanelContent
463
- },
464
- {
465
- id: 3,
466
- name: 'Substep B',
467
- component: (
468
- <TextContent>
469
- <Text component={TextVariants.h1}>Configuration substep B content</Text>
470
- <p>
471
- Wizard description goes here. If you need more assistance,
472
- <Button isInline variant="link" onClick={this.onOpenClick}>
473
- see more information
474
- </Button>
475
- in the side drawer.
476
- </p>
477
- </TextContent>
478
- ),
479
- drawerPanelContent: configSubstepBPanelContent
480
- }
481
- ]
482
- },
483
- {
484
- id: 4,
485
- name: 'Additional',
486
- component: (
487
- <TextContent>
488
- <Text component={TextVariants.h1}>Additional step content</Text>
489
- <p>
490
- Wizard description goes here. If you need more assistance,
491
- <Button isInline variant="link" onClick={this.onOpenClick}>
492
- see more information
493
- </Button>
494
- in the side drawer.
495
- </p>
496
- </TextContent>
497
- ),
498
- drawerPanelContent: additionalPanelContent
499
- },
500
- {
501
- id: 5,
502
- name: 'Review',
503
- component: (
504
- <TextContent>
505
- <Text component={TextVariants.h1}>Review step content</Text>
506
- <p>
507
- Wizard description goes here. If you need more assistance,
508
- <Button isInline variant="link" onClick={this.onOpenClick}>
509
- see more information
510
- </Button>
511
- in the side drawer.
512
- </p>
513
- </TextContent>
514
- ),
515
- nextButtonText: 'Finish',
516
- drawerPanelContent: reviewPanelContent
517
- }
518
- ];
519
-
520
- const title = 'Wizard modal with Drawer';
521
-
522
- const panelContent = (
523
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
524
- <DrawerHead>
525
- <span tabIndex={0} ref={this.drawerRef}>
526
- drawer-panel
527
- </span>
528
- </DrawerHead>
529
- </DrawerPanelContent>
298
+ </DrawerContent>
299
+ </Drawer>
530
300
  );
531
301
 
532
302
  return (
@@ -538,19 +308,40 @@ class WizardModalWithDrawerDemo extends React.Component {
538
308
  aria-describedby="wiz-modal-demo-description"
539
309
  aria-labelledby="wiz-modal-demo-title"
540
310
  >
541
- <WizardDeprecated
542
- navAriaLabel={`${title} steps`}
543
- hasDrawer
544
- isDrawerExpanded={isDrawerExpanded}
545
- onExpandDrawer={this.onExpand}
546
- mainAriaLabel={`${title} content`}
547
- titleId="wiz-modal-demo-title"
548
- descriptionId="wiz-modal-demo-description"
549
- title="Simple wizard in modal"
550
- description="Simple wizard description"
551
- steps={steps}
311
+ <Wizard
312
+ header={
313
+ <WizardHeader
314
+ closeButtonAriaLabel="Close wizard"
315
+ title="Wizard in modal with drawer and info step"
316
+ titleId="wiz-modal-demo-title"
317
+ description="Simple wizard description"
318
+ descriptionId="wiz-modal-demo-description"
319
+ />
320
+ }
552
321
  height={400}
553
- />
322
+ >
323
+ <WizardStep body={null} name="Information" id="wizard-step-1">
324
+ {createStepContentWithDrawer('Information step')}
325
+ </WizardStep>
326
+ <WizardStep
327
+ name="Configuration"
328
+ id="wizard-step-2"
329
+ steps={[
330
+ <WizardStep body={null} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
331
+ {createStepContentWithDrawer('Configuration substep A')}
332
+ </WizardStep>,
333
+ <WizardStep body={null} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
334
+ {createStepContentWithDrawer('Configuration substep B')}
335
+ </WizardStep>
336
+ ]}
337
+ />
338
+ <WizardStep body={null} name="Additional" id="wizard-step-3">
339
+ {createStepContentWithDrawer('Additional step')}
340
+ </WizardStep>
341
+ <WizardStep body={null} name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
342
+ {createStepContentWithDrawer('Review step')}
343
+ </WizardStep>
344
+ </Wizard>
554
345
  </Modal>
555
346
  );
556
347
  }
@@ -561,63 +352,41 @@ class WizardModalWithDrawerDemo extends React.Component {
561
352
 
562
353
  ```js isFullscreen
563
354
  import React from 'react';
564
- import {
565
- Nav,
566
- NavItem,
567
- NavList,
568
- PageSection,
569
- PageSectionTypes,
570
- PageSectionVariants
571
- } from '@patternfly/react-core';
572
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
573
- import imgBrand from './imgBrand.svg';
574
- import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
355
+ import { PageSection, PageSectionTypes, PageSectionVariants, Wizard, WizardStep } from '@patternfly/react-core';
575
356
  import DashboardWrapper from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
576
357
 
577
- class FullPageWizard extends React.Component {
358
+ class WizardFullPage extends React.Component {
578
359
  constructor(props) {
579
360
  super(props);
580
- this.state = {
581
- activeItem: 0
582
- };
583
- this.onNavSelect = result => {
584
- this.setState({
585
- activeItem: result.itemId
586
- });
587
- };
588
361
  }
589
362
  render() {
590
- const { activeItem } = this.state;
591
-
592
- const steps = [
593
- { id: 0, name: 'Information', component: <p>Step 1 content</p> },
594
- {
595
- id: 1,
596
- name: 'Configuration',
597
- steps: [
598
- {
599
- id: 2,
600
- name: 'Substep A',
601
- component: <p>Configuration substep A</p>
602
- },
603
- {
604
- id: 3,
605
- name: 'Substep B',
606
- component: <p>Configuration substep B</p>
607
- }
608
- ],
609
- component: <p>Step 2 content</p>
610
- },
611
- { id: 4, name: 'Additional', component: <p>Step 3 content</p> },
612
- { id: 5, name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }
613
- ];
614
- const title = 'Basic wizard';
615
-
616
363
  return (
617
364
  <React.Fragment>
618
365
  <DashboardWrapper hasPageTemplateTitle>
619
366
  <PageSection type={PageSectionTypes.wizard} variant={PageSectionVariants.light}>
620
- <WizardDeprecated navAriaLabel={`${title} steps`} mainAriaLabel={`${title} content`} steps={steps} />
367
+ <Wizard>
368
+ <WizardStep name="Information" id="wizard-step-1">
369
+ <p>Step 1 content</p>
370
+ </WizardStep>
371
+ <WizardStep
372
+ name="Configuration"
373
+ id="wizard-step-2"
374
+ steps={[
375
+ <WizardStep name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
376
+ <p>Configuration substep A</p>
377
+ </WizardStep>,
378
+ <WizardStep name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
379
+ <p>Configuration substep B</p>
380
+ </WizardStep>
381
+ ]}
382
+ />
383
+ <WizardStep name="Additional" id="wizard-step-3">
384
+ <p>Step 3 content</p>
385
+ </WizardStep>
386
+ <WizardStep name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
387
+ <p>Review step content</p>
388
+ </WizardStep>
389
+ </Wizard>
621
390
  </PageSection>
622
391
  </DashboardWrapper>
623
392
  </React.Fragment>
@@ -635,10 +404,12 @@ import {
635
404
  Breadcrumb,
636
405
  BreadcrumbItem,
637
406
  Button,
407
+ Drawer,
638
408
  DrawerActions,
639
409
  DrawerCloseButton,
640
- DrawerHead,
410
+ DrawerContent,
641
411
  DrawerPanelContent,
412
+ DrawerHead,
642
413
  Nav,
643
414
  NavItem,
644
415
  NavList,
@@ -647,22 +418,21 @@ import {
647
418
  PageSectionTypes,
648
419
  PageSectionVariants,
649
420
  PageSidebar,
650
- Progress,
651
421
  SkipToContent,
652
422
  Text,
653
423
  TextContent,
654
- Title,
655
424
  Masthead,
656
425
  PageToggleButton,
657
426
  MastheadToggle,
658
427
  MastheadMain,
659
- MastheadBrand
428
+ MastheadBrand,
429
+ Wizard,
430
+ WizardStep
660
431
  } from '@patternfly/react-core';
661
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
662
432
  import imgBrand from './imgBrand.svg';
663
433
  import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
664
434
 
665
- class FullPageWizard extends React.Component {
435
+ class WizardFullPageWithDrawerDemo extends React.Component {
666
436
  constructor(props) {
667
437
  super(props);
668
438
  this.state = {
@@ -687,7 +457,7 @@ class FullPageWizard extends React.Component {
687
457
  isDrawerExpanded: false
688
458
  });
689
459
  };
690
- this.onNavSelect = result => {
460
+ this.onNavSelect = (result) => {
691
461
  this.setState({
692
462
  activeItem: result.itemId
693
463
  });
@@ -744,122 +514,31 @@ class FullPageWizard extends React.Component {
744
514
  </Breadcrumb>
745
515
  );
746
516
 
747
- const informationPanelContent = (
748
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
749
- <DrawerHead>
750
- <span tabIndex={0} ref={this.drawerRef}>
751
- Information panel content
752
- </span>
753
- <DrawerActions>
754
- <DrawerCloseButton onClick={this.onCloseClick} />
755
- </DrawerActions>
756
- </DrawerHead>
757
- </DrawerPanelContent>
758
- );
759
-
760
- const configSubstepAPanelContent = (
761
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
762
- <DrawerHead>
763
- <span tabIndex={0} ref={this.drawerRef}>
764
- Configuration substep A content
765
- </span>
766
- <DrawerActions>
767
- <DrawerCloseButton onClick={this.onCloseClick} />
768
- </DrawerActions>
769
- </DrawerHead>
770
- </DrawerPanelContent>
771
- );
772
-
773
- const configSubstepBPanelContent = (
774
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
775
- <DrawerHead>
776
- <span tabIndex={0} ref={this.drawerRef}>
777
- Configuration substep B content
778
- </span>
779
- <DrawerActions>
780
- <DrawerCloseButton onClick={this.onCloseClick} />
781
- </DrawerActions>
782
- </DrawerHead>
783
- </DrawerPanelContent>
784
- );
785
-
786
- const additionalPanelContent = (
787
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
788
- <DrawerHead>
789
- <span tabIndex={0} ref={this.drawerRef}>
790
- Additional panel content
791
- </span>
792
- <DrawerActions>
793
- <DrawerCloseButton onClick={this.onCloseClick} />
794
- </DrawerActions>
795
- </DrawerHead>
796
- </DrawerPanelContent>
797
- );
798
-
799
- const reviewPanelContent = (
800
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
801
- <DrawerHead>
802
- <span tabIndex={0} ref={this.drawerRef}>
803
- Review panel content
804
- </span>
805
- <DrawerActions>
806
- <DrawerCloseButton onClick={this.onCloseClick} />
807
- </DrawerActions>
808
- </DrawerHead>
809
- </DrawerPanelContent>
810
- );
811
-
812
- const drawerToggleButton = (
813
- <Button className="pf-u-float-right pf-u-ml-md" isInline variant="link" onClick={this.onOpenClick}>
814
- Open drawer
815
- </Button>
816
- );
817
-
818
- const steps = [
819
- {
820
- id: 0,
821
- name: 'Information',
822
- component: <p>Step 1 content</p>,
823
- drawerPanelContent: informationPanelContent,
824
- drawerToggleButton: drawerToggleButton
825
- },
826
- {
827
- id: 1,
828
- name: 'Configuration',
829
- steps: [
830
- {
831
- id: 2,
832
- name: 'Substep A',
833
- component: <p>Configuration substep A</p>,
834
- drawerPanelContent: configSubstepAPanelContent,
835
- drawerToggleButton: drawerToggleButton
836
- },
837
- {
838
- id: 3,
839
- name: 'Substep B',
840
- component: <p>Configuration substep B</p>,
841
- drawerPanelContent: configSubstepBPanelContent,
842
- drawerToggleButton: drawerToggleButton
517
+ const createStepContentWithDrawer = (stepName) => (
518
+ <Drawer isInline isExpanded={isDrawerExpanded} onExpand={this.onExpand}>
519
+ <DrawerContent
520
+ panelContent={
521
+ <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
522
+ <DrawerHead>
523
+ <span tabIndex={isDrawerExpanded ? 0 : -1} ref={this.drawerRef}>
524
+ Drawer content: {stepName}
525
+ </span>
526
+ <DrawerActions>
527
+ <DrawerCloseButton onClick={this.onCloseClick} />
528
+ </DrawerActions>
529
+ </DrawerHead>
530
+ </DrawerPanelContent>
843
531
  }
844
- ]
845
- },
846
- {
847
- id: 4,
848
- name: 'Additional',
849
- component: <p>Step 3 content</p>,
850
- drawerPanelContent: additionalPanelContent,
851
- drawerToggleButton: drawerToggleButton
852
- },
853
- {
854
- id: 5,
855
- name: 'Review',
856
- component: <p>Review step content</p>,
857
- nextButtonText: 'Finish',
858
- drawerPanelContent: reviewPanelContent,
859
- drawerToggleButton: drawerToggleButton
860
- }
861
- ];
862
- const title = 'Basic wizard';
532
+ >
533
+ {!isDrawerExpanded && (
534
+ <Button isInline variant="link" onClick={this.onOpenClick}>
535
+ Open drawer
536
+ </Button>
537
+ )}
538
+ <div>{stepName} content</div>
539
+ </DrawerContent>
540
+ </Drawer>
541
+ );
863
542
 
864
543
  return (
865
544
  <React.Fragment>
@@ -878,14 +557,29 @@ class FullPageWizard extends React.Component {
878
557
  </TextContent>
879
558
  </PageSection>
880
559
  <PageSection type={PageSectionTypes.wizard} variant={PageSectionVariants.light}>
881
- <WizardDeprecated
882
- hasDrawer
883
- isDrawerExpanded={isDrawerExpanded}
884
- onExpandDrawer={this.onExpand}
885
- navAriaLabel={`${title} steps`}
886
- mainAriaLabel={`${title} content`}
887
- steps={steps}
888
- />
560
+ <Wizard>
561
+ <WizardStep body={null} name="Information" id="wizard-step-1">
562
+ {createStepContentWithDrawer('Information step')}
563
+ </WizardStep>
564
+ <WizardStep
565
+ name="Configuration"
566
+ id="wizard-step-2"
567
+ steps={[
568
+ <WizardStep body={null} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
569
+ {createStepContentWithDrawer('Configuration substep A')}
570
+ </WizardStep>,
571
+ <WizardStep body={null} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
572
+ {createStepContentWithDrawer('Configuration substep B')}
573
+ </WizardStep>
574
+ ]}
575
+ />
576
+ <WizardStep body={null} name="Additional" id="wizard-step-3">
577
+ {createStepContentWithDrawer('Additional step')}
578
+ </WizardStep>
579
+ <WizardStep body={null} name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
580
+ {createStepContentWithDrawer('Review step')}
581
+ </WizardStep>
582
+ </Wizard>
889
583
  </PageSection>
890
584
  </Page>
891
585
  </React.Fragment>
@@ -903,8 +597,10 @@ import {
903
597
  Breadcrumb,
904
598
  BreadcrumbItem,
905
599
  Button,
600
+ Drawer,
906
601
  DrawerActions,
907
602
  DrawerCloseButton,
603
+ DrawerContent,
908
604
  DrawerHead,
909
605
  DrawerPanelContent,
910
606
  Nav,
@@ -915,22 +611,21 @@ import {
915
611
  PageSectionTypes,
916
612
  PageSectionVariants,
917
613
  PageSidebar,
918
- Progress,
919
614
  SkipToContent,
920
615
  Text,
921
616
  TextContent,
922
- Title,
923
617
  Masthead,
924
618
  PageToggleButton,
925
619
  MastheadToggle,
926
620
  MastheadMain,
927
- MastheadBrand
621
+ MastheadBrand,
622
+ Wizard,
623
+ WizardStep
928
624
  } from '@patternfly/react-core';
929
- import { Wizard as WizardDeprecated } from '@patternfly/react-core/deprecated';
930
625
  import imgBrand from './imgBrand.svg';
931
626
  import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
932
627
 
933
- class FullPageWizard extends React.Component {
628
+ class WizardFullPageWithDrawerInfoStepDemo extends React.Component {
934
629
  constructor(props) {
935
630
  super(props);
936
631
  this.state = {
@@ -955,7 +650,7 @@ class FullPageWizard extends React.Component {
955
650
  isDrawerExpanded: false
956
651
  });
957
652
  };
958
- this.onNavSelect = result => {
653
+ this.onNavSelect = (result) => {
959
654
  this.setState({
960
655
  activeItem: result.itemId
961
656
  });
@@ -1012,84 +707,24 @@ class FullPageWizard extends React.Component {
1012
707
  </Breadcrumb>
1013
708
  );
1014
709
 
1015
- const informationPanelContent = (
1016
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
1017
- <DrawerHead>
1018
- <span tabIndex={0} ref={this.drawerRef}>
1019
- Information panel content
1020
- </span>
1021
- <DrawerActions>
1022
- <DrawerCloseButton onClick={this.onCloseClick} />
1023
- </DrawerActions>
1024
- </DrawerHead>
1025
- </DrawerPanelContent>
1026
- );
1027
-
1028
- const configSubstepAPanelContent = (
1029
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
1030
- <DrawerHead>
1031
- <span tabIndex={0} ref={this.drawerRef}>
1032
- Configuration substep A content
1033
- </span>
1034
- <DrawerActions>
1035
- <DrawerCloseButton onClick={this.onCloseClick} />
1036
- </DrawerActions>
1037
- </DrawerHead>
1038
- </DrawerPanelContent>
1039
- );
1040
-
1041
- const configSubstepBPanelContent = (
1042
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
1043
- <DrawerHead>
1044
- <span tabIndex={0} ref={this.drawerRef}>
1045
- Configuration substep B content
1046
- </span>
1047
- <DrawerActions>
1048
- <DrawerCloseButton onClick={this.onCloseClick} />
1049
- </DrawerActions>
1050
- </DrawerHead>
1051
- </DrawerPanelContent>
1052
- );
1053
-
1054
- const additionalPanelContent = (
1055
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
1056
- <DrawerHead>
1057
- <span tabIndex={0} ref={this.drawerRef}>
1058
- Additional panel content
1059
- </span>
1060
- <DrawerActions>
1061
- <DrawerCloseButton onClick={this.onCloseClick} />
1062
- </DrawerActions>
1063
- </DrawerHead>
1064
- </DrawerPanelContent>
1065
- );
1066
-
1067
- const reviewPanelContent = (
1068
- <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
1069
- <DrawerHead>
1070
- <span tabIndex={0} ref={this.drawerRef}>
1071
- Review panel content
1072
- </span>
1073
- <DrawerActions>
1074
- <DrawerCloseButton onClick={this.onCloseClick} />
1075
- </DrawerActions>
1076
- </DrawerHead>
1077
- </DrawerPanelContent>
1078
- );
1079
-
1080
- const drawerToggleButton = (
1081
- <Button className="pf-u-float-right pf-u-ml-md" isInline variant="link" onClick={this.onOpenClick}>
1082
- Open drawer
1083
- </Button>
1084
- );
1085
-
1086
- const steps = [
1087
- {
1088
- id: 0,
1089
- name: 'Information',
1090
- component: (
710
+ const createStepContentWithDrawer = (stepName) => (
711
+ <Drawer isInline isExpanded={isDrawerExpanded} onExpand={this.onExpand}>
712
+ <DrawerContent
713
+ panelContent={
714
+ <DrawerPanelContent widths={{ default: 'width_33' }} colorVariant={DrawerColorVariant.light200}>
715
+ <DrawerHead>
716
+ <span tabIndex={isDrawerExpanded ? 0 : -1} ref={this.drawerRef}>
717
+ Drawer content: {stepName}
718
+ </span>
719
+ <DrawerActions>
720
+ <DrawerCloseButton onClick={this.onCloseClick} />
721
+ </DrawerActions>
722
+ </DrawerHead>
723
+ </DrawerPanelContent>
724
+ }
725
+ >
1091
726
  <TextContent>
1092
- <Text component={TextVariants.h1}>Information step content</Text>
727
+ <Text component={TextVariants.h1}>{stepName} content</Text>
1093
728
  <p>
1094
729
  Wizard description goes here. If you need more assistance,{' '}
1095
730
  <Button isInline variant="link" onClick={this.onOpenClick}>
@@ -1098,86 +733,9 @@ class FullPageWizard extends React.Component {
1098
733
  in the side drawer.{' '}
1099
734
  </p>
1100
735
  </TextContent>
1101
- ),
1102
- drawerPanelContent: informationPanelContent
1103
- },
1104
- {
1105
- id: 1,
1106
- name: 'Configuration',
1107
- steps: [
1108
- {
1109
- id: 2,
1110
- name: 'Substep A',
1111
- component: (
1112
- <TextContent>
1113
- <Text component={TextVariants.h1}>Configuration substep A content</Text>
1114
- <p>
1115
- Wizard description goes here. If you need more assistance,
1116
- <Button isInline variant="link" onClick={this.onOpenClick}>
1117
- see more information
1118
- </Button>
1119
- in the side drawer.
1120
- </p>
1121
- </TextContent>
1122
- ),
1123
- drawerPanelContent: configSubstepAPanelContent
1124
- },
1125
- {
1126
- id: 3,
1127
- name: 'Substep B',
1128
- component: (
1129
- <TextContent>
1130
- <Text component={TextVariants.h1}>Configuration substep B content</Text>
1131
- <p>
1132
- Wizard description goes here. If you need more assistance,
1133
- <Button isInline variant="link" onClick={this.onOpenClick}>
1134
- see more information
1135
- </Button>
1136
- in the side drawer.
1137
- </p>
1138
- </TextContent>
1139
- ),
1140
- drawerPanelContent: configSubstepBPanelContent
1141
- }
1142
- ]
1143
- },
1144
- {
1145
- id: 4,
1146
- name: 'Additional',
1147
- component: (
1148
- <TextContent>
1149
- <Text component={TextVariants.h1}>Additional step content</Text>
1150
- <p>
1151
- Wizard description goes here. If you need more assistance,
1152
- <Button isInline variant="link" onClick={this.onOpenClick}>
1153
- see more information
1154
- </Button>
1155
- in the side drawer.
1156
- </p>
1157
- </TextContent>
1158
- ),
1159
- drawerPanelContent: additionalPanelContent
1160
- },
1161
- {
1162
- id: 5,
1163
- name: 'Review',
1164
- component: (
1165
- <TextContent>
1166
- <Text component={TextVariants.h1}>Review step content</Text>
1167
- <p>
1168
- Wizard description goes here. If you need more assistance,
1169
- <Button isInline variant="link" onClick={this.onOpenClick}>
1170
- see more information
1171
- </Button>
1172
- in the side drawer.
1173
- </p>
1174
- </TextContent>
1175
- ),
1176
- nextButtonText: 'Finish',
1177
- drawerPanelContent: reviewPanelContent
1178
- }
1179
- ];
1180
- const title = 'Basic wizard';
736
+ </DrawerContent>
737
+ </Drawer>
738
+ );
1181
739
 
1182
740
  return (
1183
741
  <React.Fragment>
@@ -1196,14 +754,29 @@ class FullPageWizard extends React.Component {
1196
754
  </TextContent>
1197
755
  </PageSection>
1198
756
  <PageSection type={PageSectionTypes.wizard} variant={PageSectionVariants.light}>
1199
- <WizardDeprecated
1200
- hasDrawer
1201
- isDrawerExpanded={isDrawerExpanded}
1202
- onExpandDrawer={this.onExpand}
1203
- navAriaLabel={`${title} steps`}
1204
- mainAriaLabel={`${title} content`}
1205
- steps={steps}
1206
- />
757
+ <Wizard>
758
+ <WizardStep body={null} name="Information" id="wizard-step-1">
759
+ {createStepContentWithDrawer('Information step')}
760
+ </WizardStep>
761
+ <WizardStep
762
+ name="Configuration"
763
+ id="wizard-step-2"
764
+ steps={[
765
+ <WizardStep body={null} name="Substep A" id="wizard-step-2a" key="wizard-step-2a">
766
+ {createStepContentWithDrawer('Configuration substep A')}
767
+ </WizardStep>,
768
+ <WizardStep body={null} name="Substep B" id="wizard-step-2b" key="wizard-step-2b">
769
+ {createStepContentWithDrawer('Configuration substep B')}
770
+ </WizardStep>
771
+ ]}
772
+ />
773
+ <WizardStep body={null} name="Additional" id="wizard-step-3">
774
+ {createStepContentWithDrawer('Additional step')}
775
+ </WizardStep>
776
+ <WizardStep body={null} name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}>
777
+ {createStepContentWithDrawer('Review step')}
778
+ </WizardStep>
779
+ </Wizard>
1207
780
  </PageSection>
1208
781
  </Page>
1209
782
  </React.Fragment>