| 1 |
import { |
| 2 |
Card, |
| 3 |
CardBody, |
| 4 |
Gallery, |
| 5 |
GalleryItem, |
| 6 |
PageSection, |
| 7 |
Modal, |
| 8 |
ModalVariant, |
| 9 |
Wizard, |
| 10 |
WizardHeader, |
| 11 |
WizardStep |
| 12 |
} from '@patternfly/react-core'; |
| 13 |
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; |
| 14 |
|
| 15 |
export const WizardInModalDemo: React.FunctionComponent = () => ( |
| 16 |
<> |
| 17 |
<DashboardWrapper hasPageTemplateTitle> |
| 18 |
<PageSection isWidthLimited aria-label="Card gallery"> |
| 19 |
<Gallery hasGutter> |
| 20 |
{Array.from({ length: 10 }).map((_value, index) => ( |
| 21 |
<GalleryItem key={index}> |
| 22 |
<Card> |
| 23 |
<CardBody>This is a card</CardBody> |
| 24 |
</Card> |
| 25 |
</GalleryItem> |
| 26 |
))} |
| 27 |
</Gallery> |
| 28 |
</PageSection> |
| 29 |
</DashboardWrapper> |
| 30 |
<Modal |
| 31 |
isOpen |
| 32 |
variant={ModalVariant.large} |
| 33 |
showClose={false} |
| 34 |
hasNoBodyWrapper |
| 35 |
aria-describedby="wiz-modal-demo-description" |
| 36 |
aria-labelledby="wiz-modal-demo-title" |
| 37 |
> |
| 38 |
<Wizard |
| 39 |
header={ |
| 40 |
<WizardHeader |
| 41 |
title="Wizard in modal" |
| 42 |
titleId="wiz-modal-demo-title" |
| 43 |
description="Simple wizard description" |
| 44 |
descriptionId="wiz-modal-demo-description" |
| 45 |
closeButtonAriaLabel="Close wizard" |
| 46 |
/> |
| 47 |
} |
| 48 |
> |
| 49 |
<WizardStep name="Information" id="wizard-step-1"> |
| 50 |
<p>Step 1 content</p> |
| 51 |
</WizardStep> |
| 52 |
<WizardStep |
| 53 |
name="Configuration" |
| 54 |
id="wizard-step-2" |
| 55 |
steps={[ |
| 56 |
<WizardStep name="Substep A" id="wizard-step-2a" key="wizard-step-2a"> |
| 57 |
<p>Configuration substep A</p> |
| 58 |
</WizardStep>, |
| 59 |
<WizardStep name="Substep B" id="wizard-step-2b" key="wizard-step-2b"> |
| 60 |
<p>Configuration substep B</p> |
| 61 |
</WizardStep> |
| 62 |
]} |
| 63 |
/> |
| 64 |
<WizardStep name="Additional" id="wizard-step-3"> |
| 65 |
<p>Step 3 content</p> |
| 66 |
</WizardStep> |
| 67 |
<WizardStep name="Review" id="wizard-step-4" footer={{ nextButtonText: 'Finish' }}> |
| 68 |
<p>Review step content</p> |
| 69 |
</WizardStep> |
| 70 |
</Wizard> |
| 71 |
</Modal> |
| 72 |
</> |
| 73 |
); |