Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
2de5769
scaffolds wizard package
TheSonOfThomp Sep 24, 2025
e453185
Update pnpm-lock.yaml
TheSonOfThomp Sep 24, 2025
998c5af
scaffold WizardFooter
TheSonOfThomp Sep 24, 2025
2096173
scaffold wizard step
TheSonOfThomp Sep 24, 2025
95c816e
[LG-5563] feat(Wizard) Adds Wizard (#3161)
TheSonOfThomp Oct 8, 2025
10532af
chore(Wizard) Updates wizard utilities to use `hooks` and `compound-c…
TheSonOfThomp Oct 9, 2025
c6a94ec
init wizard changeset
TheSonOfThomp Oct 10, 2025
b48488b
refactor(WizardFooter): simplify props by extending FormFooterProps
TheSonOfThomp Oct 21, 2025
d8ab48d
[LG-5562] feat(Wizard) Updates `Wizard` API (#3336)
TheSonOfThomp Nov 26, 2025
c462dca
[LG-5566] tests(Wizard) Implement TestUtils & LGIDs for `Wizard` (#3338)
TheSonOfThomp Nov 26, 2025
f1da308
rm step wrapper
TheSonOfThomp Oct 22, 2025
1c67385
rm descendants dep
TheSonOfThomp Oct 22, 2025
79c4d84
export WizardProvider
TheSonOfThomp Oct 22, 2025
aab32ab
delete-wizard-demo
TheSonOfThomp Nov 4, 2025
b8758f4
Update pnpm
TheSonOfThomp Nov 7, 2025
7757e2a
fix wizard changes
TheSonOfThomp Nov 14, 2025
aef3a30
Adds `requiresAcknowledgement` prop to Wizard.Step
TheSonOfThomp Nov 21, 2025
76920c5
Implements `isAcknowledged` state inside provider
TheSonOfThomp Nov 21, 2025
674a76b
rm delete demo
TheSonOfThomp Nov 21, 2025
9c33bd0
rm temp changesets
TheSonOfThomp Nov 21, 2025
84b4317
footer tests
TheSonOfThomp Nov 21, 2025
d7c0135
revert toast changes?
TheSonOfThomp Nov 21, 2025
2879a58
Update .npmrc
TheSonOfThomp Nov 21, 2025
954b44e
adds `totalSteps` to wizard context
TheSonOfThomp Nov 24, 2025
59dc8f1
fix bad merge
TheSonOfThomp Nov 24, 2025
1a5f046
adds LGIDs
TheSonOfThomp Nov 21, 2025
b65d792
lint
TheSonOfThomp Nov 21, 2025
2100c5b
fix bad merge
TheSonOfThomp Nov 24, 2025
2ace0b5
removes Step test utils
TheSonOfThomp Nov 24, 2025
3ee6b63
add layout comments
TheSonOfThomp Nov 24, 2025
2be7f1d
Squashed commit of the following:
TheSonOfThomp Nov 25, 2025
4cbc815
update provider props
TheSonOfThomp Nov 21, 2025
b3de848
add templates scope
TheSonOfThomp Nov 20, 2025
d918251
init delete wizard
TheSonOfThomp Nov 19, 2025
2a5fb7f
initial port of delete wizard
TheSonOfThomp Nov 20, 2025
ce5d1f0
adds DeleteWizardStepContents
TheSonOfThomp Nov 20, 2025
ccb74db
Exports DeleteWizard . Header and Step wrappers
TheSonOfThomp Nov 21, 2025
43ff5eb
Create delete-wizard-3.md
TheSonOfThomp Nov 21, 2025
c6c09c6
updates delete-wizard changeset
TheSonOfThomp Nov 21, 2025
ed43e5b
rm temp changesets
TheSonOfThomp Nov 21, 2025
c7a1cfe
build
TheSonOfThomp Nov 21, 2025
2ebe1cb
Update README.md
TheSonOfThomp Nov 21, 2025
d4579b1
lint
TheSonOfThomp Nov 21, 2025
a6a7da9
Adds onCancel/onDelete handlers
TheSonOfThomp Nov 24, 2025
973a365
rm DeleteWizardStepContent
TheSonOfThomp Nov 24, 2025
3160611
fixes dependencies
TheSonOfThomp Nov 25, 2025
c9ba506
fixes dependencies
TheSonOfThomp Nov 26, 2025
9f3b30d
adds lgids and test utils
TheSonOfThomp Nov 26, 2025
51228b9
creates delete wizard tests
TheSonOfThomp Nov 26, 2025
5f74d60
add stories
TheSonOfThomp Nov 26, 2025
306b717
Squashed commit of the following:
TheSonOfThomp Nov 26, 2025
36ae864
reset versions
TheSonOfThomp Nov 26, 2025
7853e5b
mv to @lg-ui
TheSonOfThomp Dec 1, 2025
8fd73fa
lint fix
TheSonOfThomp Dec 3, 2025
7bb0c88
Squashed commit of the following:
TheSonOfThomp Dec 3, 2025
65bb2f2
Merge branch 'main' into at/uxe-33-deletion-wizard
TheSonOfThomp Dec 9, 2025
1c755b9
Squashed commit of the following:
TheSonOfThomp Dec 9, 2025
be041c6
[LG-5789] chore: update placeholder color tokens (#3372)
adamrasheed Dec 10, 2025
2491b56
[LG-5794] chore: Added id prop support for ConfirmationModel buttons …
adamrasheed Dec 10, 2025
c8fced5
[LG-5686] fix(avatar): use unique gradient IDs in AssistantAvatar (#3…
stephl3 Dec 11, 2025
51ae066
chore(docs) Adds OIDC docs (#3374)
TheSonOfThomp Dec 11, 2025
c292340
chore: removes MCP-UI from @lg (#3376)
TheSonOfThomp Dec 11, 2025
4027791
updates token colors (#3388)
bruugey Dec 15, 2025
9041932
Update pnpm-lock.yaml
TheSonOfThomp Dec 15, 2025
dd3f071
merge main
TheSonOfThomp Dec 15, 2025
bc1d02b
Update delete-wizard.md
TheSonOfThomp Dec 15, 2025
d3be0c0
Merge branch 'main' into at/uxe-33-deletion-wizard
TheSonOfThomp Dec 15, 2025
eea6378
update Spinner
TheSonOfThomp Dec 9, 2025
6a076f5
Adds RecommendationCard
TheSonOfThomp Dec 9, 2025
bdbf933
adds ReviewCard
TheSonOfThomp Dec 9, 2025
b609238
add basic card for non-review states
TheSonOfThomp Dec 9, 2025
c7143c8
Create delete-wizard-cards.md
TheSonOfThomp Dec 15, 2025
960555a
adds missing dependencies
TheSonOfThomp Dec 16, 2025
b881757
fix types for r17
TheSonOfThomp Dec 16, 2025
35dd31e
Create wizard-exports.md
TheSonOfThomp Dec 16, 2025
36e03b7
add dark mode stories
TheSonOfThomp Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .changeset/delete-wizard-cards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
'@leafygreen-ui/delete-wizard': minor
---

Creates reusable `RecommendationCard` & `ReviewCard` for Deletion Wizards

```tsx
<RecommendationCard
category="Things"
title="Do a thing"
description="Before deleting, you need to do a thing."
link={<Link href="https://mongodb.design">mongodb.design</Link>}
/>,
```

```tsx
<ReviewCard
title={
<ReviewCardTitleWithCountEmphasis
verb="Terminate"
count={6}
resource="clusters"
/>
}
description="Completing this action will terminate all clusters"
>
<Table>...</Table>
</ReviewCard>
```
64 changes: 64 additions & 0 deletions .changeset/delete-wizard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
'@leafygreen-ui/delete-wizard': minor
---

Initial release of `DeleteWizard`.

```tsx
<DeleteWizard
onStepChange={...}
onCancel={...}
onDelete={...}
>
<DeleteWizard.Header
pageTitle="Demo Delete Wizard"
/>
<DeleteWizard.Step requiresAcknowledgement>
<DeleteWizard.StepContent>
<div>Step 1 contents<div>
</DeleteWizard.StepContent>
<DeleteWizard.Footer
backButtonText="Go back"
cancelButtonText="Cancel flow"
primaryButtonText='Continue to next step'
/>
</DeleteWizard.Step>

<DeleteWizard.Step requiresAcknowledgement>
<DeleteWizard.StepContent>
<div>Step 2 contents<div>
</DeleteWizard.StepContent>
<DeleteWizard.Footer
backButtonText="Go back"
cancelButtonText="Cancel flow"
primaryButtonText='Delete my thing'
/>
</DeleteWizard.Step>
</DeleteWizard>
```

### DeleteWizard
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.

`DeleteWizard` and all sub-components include template styling.

### DeleteWizard.Header
A convenience wrapper around `CanvasHeader`

### DeleteWizard.Step
A convenience wrapper around `Wizard.Step` to ensure the correct context.
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)


### DeleteWizard.StepContent
A styled `div` for use inside a `DeleteWizard.Step` to ensure proper page scrolling and footer positioning

### DeleteWizard.Footer
A wrapper around `Wizard.Footer` with embedded styles and convenience props for the DeleteWizard template.
`DeleteWizard.Footer` accepts optional `backButtonText`, `cancelButtonText` and `primaryButtonText` props for simpler wizard creation.
The primary button variant is defined based on the `activeStep`— `"danger"` for the final steps, and `"primary"` for all preceding steps.
Also defines the `leftGlyph` to <TrashIcon /> for the final step.

You can override this behavior by providing the button props object (see FormFooter).

Use the top level `onDelete`, `onCancel` and `onStepChange` callbacks to handle footer button clicks.
5 changes: 5 additions & 0 deletions .changeset/wizard-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/wizard': patch
---

Exports `WizardSubComponentProperties` type
80 changes: 80 additions & 0 deletions packages/delete-wizard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Delete Wizard

![npm (scoped)](https://img.shields.io/npm/v/@leafygreen-ui/delete-wizard.svg)

#### [View on MongoDB.design](https://www.mongodb.design/component/delete-wizard/live-example/)

## Installation

### PNPM

```shell
pnpm add @leafygreen-ui/delete-wizard
```

### Yarn

```shell
yarn add @leafygreen-ui/delete-wizard
```

### NPM

```shell
npm install @leafygreen-ui/delete-wizard
```

```tsx
<DeleteWizard>
<DeleteWizard.Header
pageTitle="Demo Delete Wizard"
/>
<DeleteWizard.Step requiresAcknowledgement>
<DeleteWizard.StepContent>
<div>Step 1 contents<div>
</DeleteWizard.StepContent>
<DeleteWizard.Footer
primaryButtonProps={{
children: 'Continue to next step',
}}
/>
</DeleteWizard.Step>

<DeleteWizard.Step requiresAcknowledgement>
<DeleteWizard.StepContent>
<div>Step 2 contents<div>
</DeleteWizard.StepContent>
<DeleteWizard.Footer
primaryButtonProps={{
leftGlyph: <TrashIcon />,
variant: 'danger',
children: 'Delete my thing',
onClick: handleDelete,
}}
/>
</DeleteWizard.Step>
</DeleteWizard>
```

### DeleteWizard

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.

`DeleteWizard` and all sub-components include template styling.

### DeleteWizard.Header

A convenience wrapper around `CanvasHeader`

### DeleteWizard.Step

A convenience wrapper around `Wizard.Step` to ensure the correct context.
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)

### DeleteWizard.StepContent

A styled `div` for use inside a `DeleteWizard.Step` to ensure proper page scrolling and footer positioning

### DeleteWizard.Footer

A wrapper around Wizard.Footer with embedded styles for the DeleteWizard template
60 changes: 60 additions & 0 deletions packages/delete-wizard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@leafygreen-ui/delete-wizard",
"version": "0.0.1",
"description": "LeafyGreen UI Kit Delete Wizard",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"license": "Apache-2.0",
"exports": {
".": {
"require": "./dist/umd/index.js",
"import": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts"
},
"./testing": {
"require": "./dist/umd/testing/index.js",
"import": "./dist/esm/testing/index.js",
"types": "./dist/types/testing/index.d.ts"
}
},
"scripts": {
"build": "lg-build bundle",
"tsc": "lg-build tsc",
"docs": "lg-build docs"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@leafygreen-ui/badge": "workspace:^",
"@leafygreen-ui/canvas-header": "workspace:^",
"@leafygreen-ui/card": "workspace:^",
"@leafygreen-ui/expandable-card": "workspace:^",
"@leafygreen-ui/compound-component": "workspace:^",
"@leafygreen-ui/form-footer": "workspace:^",
"@leafygreen-ui/icon": "workspace:^",
"@leafygreen-ui/lib": "workspace:^",
"@leafygreen-ui/loading-indicator": "workspace:^",
"@leafygreen-ui/skeleton-loader": "workspace:^",
"@leafygreen-ui/tokens": "workspace:^",
"@leafygreen-ui/typography": "workspace:^",
"@leafygreen-ui/wizard": "workspace:^",
"@lg-tools/test-harnesses": "workspace:^"
},
"peerDependencies": {
"@leafygreen-ui/emotion": "workspace:^5.0.0",
"@leafygreen-ui/leafygreen-provider": "workspace:^5.0.0 || ^4.0.0 || ^3.2.0"
},
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/delete-wizard",
"repository": {
"type": "git",
"url": "https://github.com/mongodb/leafygreen-ui"
},
"bugs": {
"url": "https://jira.mongodb.org/projects/LG/summary"
},
"devDependencies": {
"@faker-js/faker": "^10.1.0"
}
}
144 changes: 144 additions & 0 deletions packages/delete-wizard/src/DeleteWizard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/* eslint-disable no-console */
import React from 'react';
import { faker } from '@faker-js/faker';
import { StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/test';

import { css } from '@leafygreen-ui/emotion';
import BeakerIcon from '@leafygreen-ui/icon/Beaker';
import { BackLink, Body } from '@leafygreen-ui/typography';

import { ExampleStepContent } from './testUtils/ExampleStepContent';
import { DeleteWizard } from '.';

faker.seed(0);
const demoResourceName = faker.database.mongodbObjectId();
const demoSteps = [
{
description: faker.lorem.paragraph(),
content: faker.lorem.paragraphs(24),
},
{
description: faker.lorem.paragraph(),
content: faker.lorem.paragraphs(24),
},
];

export default {
title: 'Templates/DeleteWizard',
component: DeleteWizard,
};

export const LiveExample: StoryObj<typeof DeleteWizard> = {
parameters: {
controls: {
exclude: ['children', 'onStepChange'],
},
chromatic: {
disableSnapshot: true,
},
},
args: {
activeStep: undefined,
},
render: args => {
const handleCancel = () => {
console.log('[STORYBOOK]: Cancelling wizard. Reloading iFrame');
window.location.reload();
};

const handleDelete = () => {
alert('[STORYBOOK]: Deleting thing!');
console.log('[STORYBOOK]: Deleting thing! Reloading iFrame');
window.location.reload();
};

const handleStepChange = (step: number) => {
console.log('[STORYBOOK] step changed to ', step);
};

return (
<div
className={css`
margin: -100px;
`}
>
<DeleteWizard
activeStep={args.activeStep}
onStepChange={handleStepChange}
onCancel={handleCancel}
onDelete={handleDelete}
className={css`
height: 100vh;
width: 100vw;
`}
>
<DeleteWizard.Header
pageTitle="Demo Delete Wizard"
resourceName={demoResourceName}
resourceIcon={<BeakerIcon />}
backLink={<BackLink href="#">Back</BackLink>}
className={css`
margin-inline: 72px;
`}
/>
<DeleteWizard.Step>
<ExampleStepContent
index={0}
description={demoSteps[0].description}
content={demoSteps[0].content.split('\n').map((p, i) => (
<Body key={i}>{p}</Body>
))}
/>
<DeleteWizard.Footer
cancelButtonText="Cancel wizard"
primaryButtonText="Continue to next step"
/>
</DeleteWizard.Step>

<DeleteWizard.Step requiresAcknowledgement>
<ExampleStepContent
index={1}
description={demoSteps[1].description}
content={demoSteps[1].content.split('\n').map((p, i) => (
<Body key={i}>{p}</Body>
))}
/>
<DeleteWizard.Footer
backButtonText="Go back"
cancelButtonText="Cancel wizard"
primaryButtonText="Delete the thing"
/>
</DeleteWizard.Step>
</DeleteWizard>
</div>
);
},
};

export const Step1: StoryObj<typeof DeleteWizard> = {
args: {
activeStep: 0,
},
render: LiveExample.render,
};

export const Step2Default: StoryObj<typeof DeleteWizard> = {
args: {
activeStep: 1,
},
render: LiveExample.render,
};

export const Step2Acknowledged: StoryObj<typeof DeleteWizard> = {
args: {
activeStep: 1,
},
play: ({ canvasElement }) => {
const checkbox = within(canvasElement).getByTestId(
'acknowledgement-checkbox',
);
userEvent.click(checkbox);
},
render: LiveExample.render,
};
Loading
Loading