@patternfly/react-core 4.224.3 → 4.224.4

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.
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { Modal, ModalVariant, Button, Wizard } from '@patternfly/react-core';
3
+
4
+ export const ModalWithWizard: React.FunctionComponent = () => {
5
+ const [isModalOpen, setIsModalOpen] = React.useState(false);
6
+
7
+ const handleModalToggle = () => {
8
+ setIsModalOpen(!isModalOpen);
9
+ };
10
+
11
+ const steps = [
12
+ { name: 'Step 1', component: <p>Step 1</p> },
13
+ { name: 'Step 2', component: <p>Step 2</p> },
14
+ { name: 'Step 3', component: <p>Step 3</p> },
15
+ { name: 'Step 4', component: <p>Step 4</p> },
16
+ { name: 'Review', component: <p>Review Step</p>, nextButtonText: 'Finish' }
17
+ ];
18
+
19
+ return (
20
+ <React.Fragment>
21
+ <Button variant="primary" onClick={handleModalToggle}>
22
+ Show wizard modal
23
+ </Button>
24
+ <Modal
25
+ variant={ModalVariant.large}
26
+ showClose={false}
27
+ isOpen={isModalOpen}
28
+ aria-labelledby="modal-wizard-label"
29
+ aria-describedby="modal-wizard-description"
30
+ onClose={handleModalToggle}
31
+ hasNoBodyWrapper
32
+ >
33
+ <Wizard
34
+ titleId="modal-wizard-label"
35
+ descriptionId="modal-wizard-description"
36
+ title="Wizard modal"
37
+ description="This is a wizard inside of a modal."
38
+ steps={steps}
39
+ onClose={handleModalToggle}
40
+ height={400}
41
+ />
42
+ </Modal>
43
+ </React.Fragment>
44
+ );
45
+ };