|
2 | 2 | '@lg-templates/delete-wizard': minor |
3 | 3 | --- |
4 | 4 |
|
5 | | -Initial release of `DeleteWizard` |
| 5 | +Initial release of `DeleteWizard`. |
| 6 | + |
| 7 | +```tsx |
| 8 | +<DeleteWizard> |
| 9 | + <DeleteWizard.Header |
| 10 | + pageTitle="Demo Delete Wizard" |
| 11 | + /> |
| 12 | + <DeleteWizard.Step requiresAcknowledgement> |
| 13 | + <DeleteWizard.StepContent> |
| 14 | + <div>Step 1 contents<div> |
| 15 | + </DeleteWizard.StepContent> |
| 16 | + <DeleteWizard.Footer |
| 17 | + primaryButtonProps={{ |
| 18 | + children: 'Continue to next step', |
| 19 | + }} |
| 20 | + /> |
| 21 | + </DeleteWizard.Step> |
| 22 | + |
| 23 | + <DeleteWizard.Step requiresAcknowledgement> |
| 24 | + <DeleteWizard.StepContent> |
| 25 | + <div>Step 2 contents<div> |
| 26 | + </DeleteWizard.StepContent> |
| 27 | + <DeleteWizard.Footer |
| 28 | + primaryButtonProps={{ |
| 29 | + leftGlyph: <TrashIcon />, |
| 30 | + variant: 'danger', |
| 31 | + children: 'Delete my thing', |
| 32 | + onClick: handleDelete, |
| 33 | + }} |
| 34 | + /> |
| 35 | + </DeleteWizard.Step> |
| 36 | +</DeleteWizard> |
| 37 | +``` |
| 38 | + |
| 39 | +### DeleteWizard |
| 40 | +Establishes a context, and only renders the `activeStep` (managed internally, or provided with the `activeStep` prop). Accepts a `DeleteWizard.Header` and any number of `DeleteWizard.Step`s as children. |
| 41 | + |
| 42 | +`DeleteWizard` and all sub-components include template styling. |
| 43 | + |
| 44 | + |
| 45 | +### DeleteWizard.Header |
| 46 | +A convenience wrapper around `CanvasHeader` |
| 47 | + |
| 48 | +### DeleteWizard.Step |
| 49 | +A convenience wrapper around `Wizard.Step` to ensure the correct context. |
| 50 | +Like the basic `Wizard.Step`, of `requiresAcknowledgement` is true, the step must have `isAcknowledged` set in context, (or passed in as a controlled prop) for the Footer's primary button to be enabled. (see the Wizard and DeleteWizard demos in Storybook) |
| 51 | + |
| 52 | + |
| 53 | +### DeleteWizard.StepContent |
| 54 | +A styled `div` for use inside a `DeleteWizard.Step` to ensure proper page scrolling and footer positioning |
| 55 | + |
| 56 | +### DeleteWizard.Footer |
| 57 | +A wrapper around Wizard.Footer with embedded styles for the DeleteWizard template |
0 commit comments