Skip to content

Commit e5c39d6

Browse files
TheSonOfThompshaneezaadamrasheedstephl3bruugey
authored
[UXE-33] feat(Template) Creates DeleteWizard template package (#3291)
* scaffolds wizard package * Update pnpm-lock.yaml * scaffold WizardFooter * scaffold wizard step * [LG-5563] feat(Wizard) Adds Wizard (#3161) * initial Wizard component * Creates basic Wizard.tsx component Prompt: In the newly created package, create the Wizard component. Note: these docs mention `Wizard.Step` and `Wizard.Footer`. DO NOT create these yet. They will be created later The `@leafygreen-ui/wizard` is a general-purpose, multi-step page template, designed to create guided in-app flows and wizards: Based on the MultiStepWizard component in MMS, and intended to be used in the Product Deletion template. Feature Overview: - Takes in all Steps in the flow as children. - Renders the appropriate content for the current step - Internally handles step changing (with optional external control) Non-goals: - We will not be implementing this across MMS (MultiStepWizard is currently used in 26 files) - This will not support different url routes per step Wizard component The root flow component. Controls the rendering of the appropriate step based on a controlled prop, or uncontrolled internal state. Example ```tsx const [activeStep, setActiveStep] = useState(0) <Wizard activeStep={activeStep}> <Wizard.Step title="Step 1" description={<>Some description with a <Link>link</Link></>} > Some Content. Lorem ipsum dolor. </Wizard.Step> <Wizard.Step /> <Wizard.Step /> <Wizard.Footer backButtonProps={{ onClick: setActiveStep(x--) }} cancelButtonProps={{}} primaryButtonProps={{ onClick: setActiveStep(x++), variant: 'danger', disabled }} /> </Wizard> ``` Props: ```ts activeStep?: number; onStepChange?: (step: number) => void showStepper?: boolean; // omit for v1 ``` State: `[activeStep, setActiveStep] = useState<number> // if none provided as a prop` Events: - `onStepChange` : fired when the activeStep changes - this should still fire when controlled? Rendering: - Renders the appropriate Step based on the activeStep prop/state - Renders the Footer element, with enabled/hidden buttons based on the activeStep - If activeStep === 0, hides back button - Injects setActiveStep into Back and Primary buttons (if uncontrolled) * Creates WizardStep and WizardFooter Prompt: The Footer and Step components have been scaffolded. Create both components with the following spec: Step: A single Step in the multi-step flow. Must be rendered within a Wizard. ```ts title: ReactNode; description: ReactNode; children: ReactNode; ``` Footer: The footer element for the Wizard. A wrapper around LeafyGreen `FormFooter`, but allows us to optionally inject event handlers into the buttons. ``` backButtonProps: ButtonProps; cancelButtonProps: ButtonProps; primaryButtonProps: ButtonProps; ``` * footer& step stories * temp useWizardControlledValue * fix useWizardControlledValue * update Footer * Update package.json * use typography in Step * update descendants * update packages * the rest of the owl * update width * fix nits * Squashed commit of the following: commit c826033 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Tue Sep 30 15:54:03 2025 -0400 Update isChildWithProperty.spec.tsx commit 01585d3 Merge: f3570c4 94745fb Author: Adam Thompson <adam.thompson@mongodb.com> Date: Tue Sep 30 13:28:59 2025 -0400 Merge branch 'main' into ac/cc-utils commit f3570c4 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Tue Sep 30 13:28:37 2025 -0400 rm todo commit becf667 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Fri Sep 26 16:50:05 2025 -0400 rm wizard commit f8463ac Author: Adam Thompson <adam.thompson@mongodb.com> Date: Fri Sep 26 16:50:00 2025 -0400 update index files commit 5e0d157 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Fri Sep 26 16:49:50 2025 -0400 adds 2 level fragment test commit caf8a93 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Sep 26 16:39:09 2025 -0400 Update packages/lib/src/childQueries/findChildren/findChildren.ts Co-authored-by: Stephen Lee <stephen.lee@mongodb.com> commit ee977a1 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Sep 26 16:38:18 2025 -0400 Update packages/lib/src/childQueries/findChild/findChild.tsx Co-authored-by: Stephen Lee <stephen.lee@mongodb.com> commit ee32a26 Merge: ac2c485 366e851 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Thu Sep 25 15:20:23 2025 -0400 Merge branch 'main' into ac/cc-utils commit ac2c485 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 14:03:09 2025 -0400 Create lib-find-children.md commit 9cd7489 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 14:00:05 2025 -0400 Update findChildren.ts commit 90e8208 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 13:59:35 2025 -0400 Update findChildren.ts commit d7ae970 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 13:52:04 2025 -0400 update findChild/children with unwrapRootFragment commit a64ff9e Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 13:49:27 2025 -0400 Creates unwrapRootFragment commit 000f713 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Thu Sep 25 13:05:35 2025 -0400 Apply suggestions from code review `allChildren.length === 1` Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit c6d9c9d Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 13:00:30 2025 -0400 Update index.ts commit c369957 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 13:00:12 2025 -0400 mv child queries commit 5fe4f9d Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 12:59:35 2025 -0400 update index files commit c9261c8 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 12:58:48 2025 -0400 mv componentQueries commit be05c4d Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 12:55:19 2025 -0400 Update findChildren.spec.tsx commit f493f6d Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 12:46:47 2025 -0400 update findChild tests commit 74f5f7e Author: Adam Thompson <adam.thompson@mongodb.com> Date: Thu Sep 25 12:46:28 2025 -0400 Fix isChildWithProperty tests commit 5439034 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Wed Sep 24 19:05:18 2025 -0400 findChildren commit aa89584 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Wed Sep 24 19:05:10 2025 -0400 Update findChild.tsx commit dda7ad5 Author: Adam Thompson <adam.thompson@mongodb.com> Date: Wed Sep 24 19:05:01 2025 -0400 isChildWithProperty commit ae3a41b Author: Adam Thompson <adam.thompson@mongodb.com> Date: Wed Sep 24 17:02:37 2025 -0400 mv existing utils * adds findChildren * adds TextNode * Update Wizard.spec.tsx * minor fixes * spread rest * adds wizard context assertions * fix exports * fix exports * Update TextNode.tsx * creates compound component * lint * update CompoundSubComponent api * update packages * add WizardProvider * update stories * Wizard * update findChild/ren * spread className * add "exceeded steps" warning * adds warning tests * chore(Wizard) Updates wizard utilities to use `hooks` and `compound-components` (#3200) * install cc * use CC in wiz * useControlled * rm isControlled check * lint * init wizard changeset * refactor(WizardFooter): simplify props by extending FormFooterProps * [LG-5562] feat(Wizard) Updates `Wizard` API (#3336) * rm step wrapper * rm descendants dep * export WizardProvider * delete-wizard-demo private endpoints useFetchRequiredActionTableData renam ReqAct cards composable basic table stream processing card federated db card applications card clusters card wizard step context Delete requiredActionsConfig.tsx re-enable wizard add useRequiredActionAcknowledgements mv required action. add skeleton Update ModelApiKeysCard.tsx * Update pnpm Update package.json * fix wizard changes * Adds `requiresAcknowledgement` prop to Wizard.Step * Implements `isAcknowledged` state inside provider * Update Wizard.stories.tsx * rm delete demo * Update wizard.md * rm temp changesets * Update README.md * Update WizardStep.spec.tsx * footer tests * Update Wizard.spec.tsx * update package json * update provider props * revert toast changes? * Update .npmrc * Update pnpm-lock.yaml * Update WizardStep.spec.tsx * exports form footer types * Update WizardFooter.types.ts * adds `totalSteps` to wizard context * fix bad merge * updates readme * updates tsdoc * fixes tests * fixes ack reset test * Update WizardStep.spec.tsx * fixes stories * [LG-5566] tests(Wizard) Implement TestUtils & LGIDs for `Wizard` (#3338) * rm step wrapper * rm descendants dep * export WizardProvider * delete-wizard-demo private endpoints useFetchRequiredActionTableData renam ReqAct cards composable basic table stream processing card federated db card applications card clusters card wizard step context Delete requiredActionsConfig.tsx re-enable wizard add useRequiredActionAcknowledgements mv required action. add skeleton Update ModelApiKeysCard.tsx * Update pnpm Update package.json * fix wizard changes * Adds `requiresAcknowledgement` prop to Wizard.Step * Implements `isAcknowledged` state inside provider * Update Wizard.stories.tsx * rm delete demo * Update wizard.md * rm temp changesets * Update README.md * Update WizardStep.spec.tsx * footer tests * Update Wizard.spec.tsx * update package json * update provider props * revert toast changes? * Update .npmrc * Update pnpm-lock.yaml * Update WizardStep.spec.tsx * exports form footer types * Update WizardFooter.types.ts * adds `totalSteps` to wizard context * fix bad merge * adds LGIDs * adds test utils * lint * fix bad merge * removes Step test utils * add layout comments * form-footer lgids * updates wizard testids * updates readme * updates tsdoc * fixes tests * fixes ack reset test * Squashed commit of the following: commit 4fd3668 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:18:59 2025 -0500 fixes ack reset test commit 4f024b1 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:35 2025 -0500 fixes tests commit f919ecc Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:29 2025 -0500 updates tsdoc commit 6842bbb Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:02:43 2025 -0500 updates readme * Update WizardStep.spec.tsx * Update WizardContext.tsx * Update WizardStep.spec.tsx * Squashed commit of the following: commit 982ef72 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:52:15 2025 -0500 Update WizardStep.spec.tsx * fixes stories * Squashed commit of the following: commit 4b32ed6 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 17:49:16 2025 -0500 fixes stories commit 982ef72 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:52:15 2025 -0500 Update WizardStep.spec.tsx * Update WizardStep.stories.tsx * Update packages/wizard/src/testing/getTestUtils.tsx Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com> * Update README.md * use Button test utils * use test utils * Update pnpm-lock.yaml --------- Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com> * rm step wrapper * rm descendants dep * export WizardProvider * delete-wizard-demo private endpoints useFetchRequiredActionTableData renam ReqAct cards composable basic table stream processing card federated db card applications card clusters card wizard step context Delete requiredActionsConfig.tsx re-enable wizard add useRequiredActionAcknowledgements mv required action. add skeleton Update ModelApiKeysCard.tsx * Update pnpm Update package.json * fix wizard changes * Adds `requiresAcknowledgement` prop to Wizard.Step * Implements `isAcknowledged` state inside provider * rm delete demo * rm temp changesets * footer tests * revert toast changes? * Update .npmrc * adds `totalSteps` to wizard context * fix bad merge * adds LGIDs * lint * fix bad merge * removes Step test utils * add layout comments * Squashed commit of the following: commit 4fd3668 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:18:59 2025 -0500 fixes ack reset test commit 4f024b1 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:35 2025 -0500 fixes tests commit f919ecc Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:29 2025 -0500 updates tsdoc commit 6842bbb Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:02:43 2025 -0500 updates readme * update provider props * add templates scope * init delete wizard * initial port of delete wizard * adds DeleteWizardStepContents * Exports DeleteWizard . Header and Step wrappers * Create delete-wizard-3.md * updates delete-wizard changeset * rm temp changesets rm delete wizard changesets * build * Update README.md * lint * Adds onCancel/onDelete handlers * rm DeleteWizardStepContent * fixes dependencies * fixes dependencies * adds lgids and test utils * creates delete wizard tests * add stories * Squashed commit of the following: commit 8a1373e Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Nov 26 15:59:13 2025 -0500 [LG-5566] tests(Wizard) Implement TestUtils & LGIDs for `Wizard` (#3338) * rm step wrapper * rm descendants dep * export WizardProvider * delete-wizard-demo private endpoints useFetchRequiredActionTableData renam ReqAct cards composable basic table stream processing card federated db card applications card clusters card wizard step context Delete requiredActionsConfig.tsx re-enable wizard add useRequiredActionAcknowledgements mv required action. add skeleton Update ModelApiKeysCard.tsx * Update pnpm Update package.json * fix wizard changes * Adds `requiresAcknowledgement` prop to Wizard.Step * Implements `isAcknowledged` state inside provider * Update Wizard.stories.tsx * rm delete demo * Update wizard.md * rm temp changesets * Update README.md * Update WizardStep.spec.tsx * footer tests * Update Wizard.spec.tsx * update package json * update provider props * revert toast changes? * Update .npmrc * Update pnpm-lock.yaml * Update WizardStep.spec.tsx * exports form footer types * Update WizardFooter.types.ts * adds `totalSteps` to wizard context * fix bad merge * adds LGIDs * adds test utils * lint * fix bad merge * removes Step test utils * add layout comments * form-footer lgids * updates wizard testids * updates readme * updates tsdoc * fixes tests * fixes ack reset test * Squashed commit of the following: commit 4fd3668 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:18:59 2025 -0500 fixes ack reset test commit 4f024b1 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:35 2025 -0500 fixes tests commit f919ecc Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:11:29 2025 -0500 updates tsdoc commit 6842bbb Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:02:43 2025 -0500 updates readme * Update WizardStep.spec.tsx * Update WizardContext.tsx * Update WizardStep.spec.tsx * Squashed commit of the following: commit 982ef72 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:52:15 2025 -0500 Update WizardStep.spec.tsx * fixes stories * Squashed commit of the following: commit 4b32ed6 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 17:49:16 2025 -0500 fixes stories commit 982ef72 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Nov 25 13:52:15 2025 -0500 Update WizardStep.spec.tsx * Update WizardStep.stories.tsx * Update packages/wizard/src/testing/getTestUtils.tsx Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com> * Update README.md * use Button test utils * use test utils * Update pnpm-lock.yaml --------- Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com> * reset versions * mv to @lg-ui * lint fix * Squashed commit of the following: commit cb03690 Merge: f201865 dbf5b75 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Wed Dec 3 14:26:43 2025 -0500 Merge branch 'main' into at/wizard-integration commit f201865 Merge: 814af43 7a1b203 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Wed Dec 3 14:26:14 2025 -0500 Merge branch 'at/wizard-integration' of https://github.com/mongodb/leafygreen-ui into at/wizard-integration commit 814af43 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Wed Dec 3 14:26:03 2025 -0500 Update getTestUtils.tsx commit 7a1b203 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Dec 3 14:25:00 2025 -0500 Update packages/wizard/src/WizardStep/WizardStep.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit 83f936e Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Dec 3 14:24:54 2025 -0500 Update packages/lib/src/childQueries/findChildren/findChildren.spec.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit f4a1e3d Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Dec 3 14:24:33 2025 -0500 Update packages/lib/src/childQueries/findChild/findChild.spec.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit a219fae Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Dec 3 14:24:23 2025 -0500 Update packages/wizard/src/Wizard/Wizard.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit dbf5b75 Author: Stephen Lee <stephen.lee@mongodb.com> Date: Wed Dec 3 10:16:56 2025 -0800 fix: publish script (#3356) commit 918b3a5 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed Dec 3 01:41:06 2025 +0000 Version Packages (#3354) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit 0c523f5 Author: Stephen Lee <stephen.lee@mongodb.com> Date: Tue Dec 2 15:12:23 2025 -0800 chore: update release pipeline (#3355) * chore: update release pipeline * refactor: update publish script commit 0c42aba Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Mon Dec 1 19:03:38 2025 -0500 LG-3879: fix(DatePicker) Updates DatePicker Next/Prev button aria-labels (#3224) * updates chevron button labels * update select labels * update calendar cell label * Create date-picker-aria.md * Update DatePickerMenu.spec.tsx * Update DatePicker.testutils.tsx * Update date-picker-aria.md * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @TheSonOfThomp --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit 6e49fef Merge: c462dca 9e5932c Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Mon Dec 1 18:27:25 2025 -0500 Merge branch 'main' into at/wizard-integration commit 9e5932c Author: Adam Rasheed <adam.rasheed@mongodb.com> Date: Mon Dec 1 13:28:47 2025 -0600 [LG-5760] chore: FormFooter Sticky Styling (#3344) * [LG-5760] chore: FormFooter Sticky Styling * updated story * updates pt1 * updated story, style cleanup * cleanup, added changeset commit fa89f65 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed Nov 26 23:12:40 2025 +0000 Version Packages (#3353) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit 837a0e7 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Wed Nov 26 16:10:48 2025 -0500 Update pr.yml (#3352) commit 651c0bb Author: Nima Taheri <nima.taheri@mongodb.com> Date: Wed Nov 26 13:05:53 2025 -0800 LG-5588 Fix array field updates in chart options merge (#3351) * feat: correctly merge array-fields (choose full override, no recursive) * docs * Squashed commit of the following: commit 818667f Merge: f1b36e1 5d0e771 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Tue Dec 9 17:54:44 2025 -0500 Merge branch 'main' into at/spinner-description commit f1b36e1 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Tue Dec 9 17:54:22 2025 -0500 address comments commit e194c79 Merge: c02bb80 ae8ba32 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Dec 5 13:35:10 2025 -0500 Merge branch 'main' into at/spinner-description commit c02bb80 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Dec 5 13:34:58 2025 -0500 Update tools/codemods/src/codemods/loading-spinner-v5/transform.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit 2325d02 Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Dec 5 13:34:51 2025 -0500 Update .changeset/spinner-description-direction.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> commit adbf779 Merge: 3325491 6c7c2dc Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri Dec 5 11:58:10 2025 -0500 Merge branch 'main' into at/spinner-description commit 3325491 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 18:46:51 2025 -0500 Create loading-spinner-v5-codemod.md commit a70c630 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 18:18:57 2025 -0500 updates codemod commit 598e194 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 16:10:04 2025 -0500 update changeset commit d7aeb1a Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 12:30:04 2025 -0500 changeset commit 9557e68 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 10:55:05 2025 -0500 adds dynamic gap commit 1e97cc8 Author: Adam Michael Thompson <adam.thompson@mongodb.com> Date: Thu Dec 4 10:48:15 2025 -0500 adds description & direction prop to spinner * [LG-5789] chore: update placeholder color tokens (#3372) * [LG-5789] chore: update placeholder color tokens * added changeset * [LG-5794] chore: Added id prop support for ConfirmationModel buttons (#3362) * [LG-5794] chore: Added id prop support for ConfirmationModel buttons * cleanup * more cleanup * updated types and added test * updated changeset, cleaned up types, rm test assertion * cleanup * added ts assertions * [LG-5686] fix(avatar): use unique gradient IDs in AssistantAvatar (#3373) * chore(avatar): add @leafygreen-ui/hooks dep * fix(avatar): use unique id for AssistantAvatar gradient * chore(docs) Adds OIDC docs (#3374) * update node * update node in actions yaml * Update release.yml * feat: Add initial publish instructions to package creation * printInitialPublishInstructions * changeset * changeset patch * Update initial publish instructions in README and DEVELOPER.md for clarity and consistency * chore: removes MCP-UI from @lg (#3376) * removes mcp ui from leafygreen repo * update configs * updates token colors (#3388) * Update pnpm-lock.yaml * merge main * Update delete-wizard.md * export more wizard types * Create wizard-types.md * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/delete-wizard/README.md * lint --------- Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com> Co-authored-by: Adam Rasheed <adam.rasheed@mongodb.com> Co-authored-by: Stephen Lee <stephen.lee@mongodb.com> Co-authored-by: Brooke Scarlett Yalof <brooke.yalof@mongodb.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e153936 commit e5c39d6

27 files changed

+1271
-4
lines changed

.changeset/delete-wizard.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
'@leafygreen-ui/delete-wizard': minor
3+
---
4+
5+
Initial release of `DeleteWizard`.
6+
7+
```tsx
8+
<DeleteWizard
9+
onStepChange={...}
10+
onCancel={...}
11+
onDelete={...}
12+
>
13+
<DeleteWizard.Header
14+
pageTitle="Demo Delete Wizard"
15+
/>
16+
<DeleteWizard.Step requiresAcknowledgement>
17+
<DeleteWizard.StepContent>
18+
<div>Step 1 contents</div>
19+
</DeleteWizard.StepContent>
20+
<DeleteWizard.Footer
21+
backButtonText="Go back"
22+
cancelButtonText="Cancel flow"
23+
primaryButtonText='Continue to next step'
24+
/>
25+
</DeleteWizard.Step>
26+
27+
<DeleteWizard.Step requiresAcknowledgement>
28+
<DeleteWizard.StepContent>
29+
<div>Step 2 contents</div>
30+
</DeleteWizard.StepContent>
31+
<DeleteWizard.Footer
32+
backButtonText="Go back"
33+
cancelButtonText="Cancel flow"
34+
primaryButtonText='Delete my thing'
35+
/>
36+
</DeleteWizard.Step>
37+
</DeleteWizard>
38+
```
39+
40+
### DeleteWizard
41+
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.
42+
43+
`DeleteWizard` and all sub-components include template styling.
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`, if `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 and convenience props for the DeleteWizard template.
58+
`DeleteWizard.Footer` accepts optional `backButtonText`, `cancelButtonText` and `primaryButtonText` props for simpler wizard creation.
59+
The primary button variant is defined based on the `activeStep``"danger"` for the final steps, and `"primary"` for all preceding steps.
60+
Also defines the `leftGlyph` to <TrashIcon /> for the final step.
61+
62+
You can override this behavior by providing the button props object (see FormFooter).
63+
64+
Use the top level `onDelete`, `onCancel` and `onStepChange` callbacks to handle footer button clicks.

.changeset/wizard-types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@leafygreen-ui/wizard': patch
3+
---
4+
5+
Exports `WizardStepContext` & `WizardStepContextData` types

packages/delete-wizard/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Delete Wizard
2+
3+
![npm (scoped)](https://img.shields.io/npm/v/@leafygreen-ui/delete-wizard.svg)
4+
5+
#### [View on MongoDB.design](https://www.mongodb.design/component/delete-wizard/live-example/)
6+
7+
## Installation
8+
9+
### PNPM
10+
11+
```shell
12+
pnpm add @leafygreen-ui/delete-wizard
13+
```
14+
15+
### Yarn
16+
17+
```shell
18+
yarn add @leafygreen-ui/delete-wizard
19+
```
20+
21+
### NPM
22+
23+
```shell
24+
npm install @leafygreen-ui/delete-wizard
25+
```
26+
27+
```tsx
28+
<DeleteWizard>
29+
<DeleteWizard.Header
30+
pageTitle="Demo Delete Wizard"
31+
/>
32+
<DeleteWizard.Step requiresAcknowledgement>
33+
<DeleteWizard.StepContent>
34+
<div>Step 1 contents<div>
35+
</DeleteWizard.StepContent>
36+
<DeleteWizard.Footer
37+
primaryButtonProps={{
38+
children: 'Continue to next step',
39+
}}
40+
/>
41+
</DeleteWizard.Step>
42+
43+
<DeleteWizard.Step requiresAcknowledgement>
44+
<DeleteWizard.StepContent>
45+
<div>Step 2 contents</div>
46+
</DeleteWizard.StepContent>
47+
<DeleteWizard.Footer
48+
primaryButtonProps={{
49+
leftGlyph: <TrashIcon />,
50+
variant: 'danger',
51+
children: 'Delete my thing',
52+
onClick: handleDelete,
53+
}}
54+
/>
55+
</DeleteWizard.Step>
56+
</DeleteWizard>
57+
```
58+
59+
### DeleteWizard
60+
61+
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.
62+
63+
`DeleteWizard` and all sub-components include template styling.
64+
65+
### DeleteWizard.Header
66+
67+
A convenience wrapper around `CanvasHeader`
68+
69+
### DeleteWizard.Step
70+
71+
A convenience wrapper around `Wizard.Step` to ensure the correct context.
72+
Like the basic `Wizard.Step`, if `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)
73+
74+
### DeleteWizard.Footer
75+
76+
A wrapper around Wizard.Footer with embedded styles for the DeleteWizard template
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@leafygreen-ui/delete-wizard",
3+
"version": "0.0.1",
4+
"description": "LeafyGreen UI Kit Delete Wizard",
5+
"main": "./dist/umd/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "./dist/types/index.d.ts",
8+
"license": "Apache-2.0",
9+
"exports": {
10+
".": {
11+
"require": "./dist/umd/index.js",
12+
"import": "./dist/esm/index.js",
13+
"types": "./dist/types/index.d.ts"
14+
},
15+
"./testing": {
16+
"require": "./dist/umd/testing/index.js",
17+
"import": "./dist/esm/testing/index.js",
18+
"types": "./dist/types/testing/index.d.ts"
19+
}
20+
},
21+
"scripts": {
22+
"build": "lg-build bundle",
23+
"tsc": "lg-build tsc",
24+
"docs": "lg-build docs"
25+
},
26+
"publishConfig": {
27+
"access": "public"
28+
},
29+
"dependencies": {
30+
"@leafygreen-ui/canvas-header": "workspace:^",
31+
"@leafygreen-ui/compound-component": "workspace:^",
32+
"@leafygreen-ui/emotion": "workspace:^",
33+
"@leafygreen-ui/form-footer": "workspace:^",
34+
"@leafygreen-ui/icon": "workspace:^",
35+
"@leafygreen-ui/lib": "workspace:^",
36+
"@leafygreen-ui/tokens": "workspace:^",
37+
"@leafygreen-ui/wizard": "workspace:^",
38+
"@lg-tools/test-harnesses": "workspace:^"
39+
},
40+
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/delete-wizard",
41+
"repository": {
42+
"type": "git",
43+
"url": "https://github.com/mongodb/leafygreen-ui"
44+
},
45+
"bugs": {
46+
"url": "https://jira.mongodb.org/projects/LG/summary"
47+
},
48+
"devDependencies": {
49+
"@faker-js/faker": "^10.1.0",
50+
"@leafygreen-ui/typography": "workspace:^"
51+
}
52+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/* eslint-disable no-console */
2+
import React from 'react';
3+
import { faker } from '@faker-js/faker';
4+
import { StoryObj } from '@storybook/react';
5+
import { userEvent, within } from '@storybook/test';
6+
7+
import { css } from '@leafygreen-ui/emotion';
8+
import BeakerIcon from '@leafygreen-ui/icon/Beaker';
9+
import { BackLink, Body } from '@leafygreen-ui/typography';
10+
11+
import { ExampleStepContent } from './testUtils/ExampleStepContent';
12+
import { DeleteWizard } from '.';
13+
14+
faker.seed(0);
15+
const demoResourceName = faker.database.mongodbObjectId();
16+
const demoSteps = [
17+
{
18+
description: faker.lorem.paragraph(),
19+
content: faker.lorem.paragraphs(24),
20+
},
21+
{
22+
description: faker.lorem.paragraph(),
23+
content: faker.lorem.paragraphs(24),
24+
},
25+
];
26+
27+
export default {
28+
title: 'Templates/DeleteWizard',
29+
component: DeleteWizard,
30+
};
31+
32+
export const LiveExample: StoryObj<typeof DeleteWizard> = {
33+
parameters: {
34+
controls: {
35+
exclude: ['children', 'onStepChange'],
36+
},
37+
chromatic: {
38+
disableSnapshot: true,
39+
},
40+
},
41+
args: {
42+
activeStep: undefined,
43+
},
44+
render: args => {
45+
const handleCancel = () => {
46+
console.log('[STORYBOOK]: Cancelling wizard. Reloading iFrame');
47+
window.location.reload();
48+
};
49+
50+
const handleDelete = () => {
51+
alert('[STORYBOOK]: Deleting thing!');
52+
console.log('[STORYBOOK]: Deleting thing! Reloading iFrame');
53+
window.location.reload();
54+
};
55+
56+
const handleStepChange = step => {
57+
console.log('[STORYBOOK] step changed to ', step);
58+
};
59+
60+
return (
61+
<div
62+
className={css`
63+
margin: -100px;
64+
`}
65+
>
66+
<DeleteWizard
67+
activeStep={args.activeStep}
68+
onStepChange={handleStepChange}
69+
onCancel={handleCancel}
70+
onDelete={handleDelete}
71+
className={css`
72+
height: 100vh;
73+
width: 100vw;
74+
`}
75+
>
76+
<DeleteWizard.Header
77+
pageTitle="Demo Delete Wizard"
78+
resourceName={demoResourceName}
79+
resourceIcon={<BeakerIcon />}
80+
backLink={<BackLink href="#">Back</BackLink>}
81+
className={css`
82+
margin-inline: 72px;
83+
`}
84+
/>
85+
<DeleteWizard.Step>
86+
<ExampleStepContent
87+
index={0}
88+
description={demoSteps[0].description}
89+
content={demoSteps[0].content.split('\n').map((p, i) => (
90+
<Body key={i}>{p}</Body>
91+
))}
92+
/>
93+
<DeleteWizard.Footer
94+
cancelButtonText="Cancel wizard"
95+
primaryButtonText="Continue to next step"
96+
/>
97+
</DeleteWizard.Step>
98+
99+
<DeleteWizard.Step requiresAcknowledgement>
100+
<ExampleStepContent
101+
index={1}
102+
description={demoSteps[1].description}
103+
content={demoSteps[1].content.split('\n').map((p, i) => (
104+
<Body key={i}>{p}</Body>
105+
))}
106+
/>
107+
<DeleteWizard.Footer
108+
backButtonText="Go back"
109+
cancelButtonText="Cancel wizard"
110+
primaryButtonText="Delete the thing"
111+
/>
112+
</DeleteWizard.Step>
113+
</DeleteWizard>
114+
</div>
115+
);
116+
},
117+
};
118+
119+
export const Step1: StoryObj<typeof DeleteWizard> = {
120+
args: {
121+
activeStep: 0,
122+
},
123+
render: LiveExample.render,
124+
};
125+
126+
export const Step2Default: StoryObj<typeof DeleteWizard> = {
127+
args: {
128+
activeStep: 1,
129+
},
130+
render: LiveExample.render,
131+
};
132+
133+
export const Step2Acknowledged: StoryObj<typeof DeleteWizard> = {
134+
args: {
135+
activeStep: 1,
136+
},
137+
play: ({ canvasElement }) => {
138+
const checkbox = within(canvasElement).getByTestId(
139+
'acknowledgement-checkbox',
140+
);
141+
userEvent.click(checkbox);
142+
},
143+
render: LiveExample.render,
144+
};

0 commit comments

Comments
 (0)