Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
488f1a6
initial Wizard component
TheSonOfThomp Sep 24, 2025
71cb724
Creates basic Wizard.tsx component
TheSonOfThomp Sep 24, 2025
cf2e9c3
Creates WizardStep and WizardFooter
TheSonOfThomp Sep 24, 2025
85db2a6
footer& step stories
TheSonOfThomp Sep 24, 2025
e3c65c8
temp useWizardControlledValue
TheSonOfThomp Sep 24, 2025
76cb00c
fix useWizardControlledValue
TheSonOfThomp Sep 26, 2025
17a55cc
update Footer
TheSonOfThomp Sep 26, 2025
aef300e
Update package.json
TheSonOfThomp Sep 26, 2025
f5d32af
use typography in Step
TheSonOfThomp Sep 26, 2025
9d5f579
update descendants
TheSonOfThomp Sep 26, 2025
b18d5b9
update packages
TheSonOfThomp Sep 26, 2025
8f62f2e
the rest of the owl
TheSonOfThomp Sep 26, 2025
85fe610
update width
TheSonOfThomp Sep 26, 2025
4f19bf2
fix nits
TheSonOfThomp Sep 30, 2025
326ae5c
Squashed commit of the following:
TheSonOfThomp Sep 30, 2025
3e778c0
adds findChildren
TheSonOfThomp Sep 30, 2025
39c3c64
adds TextNode
TheSonOfThomp Sep 30, 2025
7d6b3ec
Update Wizard.spec.tsx
TheSonOfThomp Sep 30, 2025
212b4fc
minor fixes
TheSonOfThomp Sep 30, 2025
805ba2f
spread rest
TheSonOfThomp Sep 30, 2025
66bf36b
adds wizard context assertions
TheSonOfThomp Sep 30, 2025
f9b446b
fix exports
TheSonOfThomp Sep 30, 2025
e1077db
fix exports
TheSonOfThomp Oct 6, 2025
646d001
Update TextNode.tsx
TheSonOfThomp Oct 7, 2025
16a78f1
creates compound component
TheSonOfThomp Oct 7, 2025
9b01de1
lint
TheSonOfThomp Oct 7, 2025
fec94fd
update CompoundSubComponent api
TheSonOfThomp Oct 7, 2025
f89a0c4
update packages
TheSonOfThomp Oct 7, 2025
63a5490
add WizardProvider
TheSonOfThomp Oct 7, 2025
634ef85
update stories
TheSonOfThomp Oct 7, 2025
7b6a16b
Wizard
TheSonOfThomp Oct 8, 2025
dc93803
update findChild/ren
TheSonOfThomp Oct 8, 2025
48d0429
spread className
TheSonOfThomp Oct 8, 2025
9596f23
add "exceeded steps" warning
TheSonOfThomp Oct 8, 2025
9c99534
adds warning tests
TheSonOfThomp Oct 8, 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
5 changes: 5 additions & 0 deletions .changeset/descendants-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/descendants': minor
---

Exports `Position` enum. Removes type annotation from `Direction` export
5 changes: 5 additions & 0 deletions .changeset/lib-find-children.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/lib': minor
---

Adds `findChildren` utility to `lib`. Also adds `unwrapRootFragment` and `isChildWithProperty` helpers
13 changes: 7 additions & 6 deletions packages/descendants/src/Highlight/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export type {
export {
Direction,
HighlightChangeHandler,
HighlightContextProps,
HighlightHookReturnType,
Index,
UseHighlightOptions,
type HighlightChangeHandler,
type HighlightContextProps,
type HighlightHookReturnType,
type Index,
Position,
type UseHighlightOptions,
} from './highlight.types';
export {
createHighlightContext,
Expand Down
3 changes: 2 additions & 1 deletion packages/descendants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ export {
// Highlight
export {
createHighlightContext,
type Direction,
Direction,
type HighlightChangeHandler,
type HighlightContextProps,
type HighlightContextType,
type HighlightHookReturnType,
HighlightProvider,
type Index,
Position,
useHighlight,
useHighlightContext,
type UseHighlightOptions,
Expand Down
3 changes: 1 addition & 2 deletions packages/wizard/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Wizard

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

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

## Installation
Expand All @@ -23,4 +23,3 @@ yarn add @leafygreen-ui/wizard
```shell
npm install @leafygreen-ui/wizard
```

7 changes: 7 additions & 0 deletions packages/wizard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@
"access": "public"
},
"dependencies": {
"@leafygreen-ui/button": "workspace:^",
"@leafygreen-ui/emotion": "workspace:^",
"@leafygreen-ui/form-footer": "workspace:^",
"@leafygreen-ui/lib": "workspace:^",
"@leafygreen-ui/typography": "workspace:^",
"@lg-tools/test-harnesses": "workspace:^"
},
"devDependencies" : {
"@leafygreen-ui/icon": "workspace:^",
"@faker-js/faker": "^8.0.0"
},
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/wizard",
"repository": {
"type": "git",
Expand Down
112 changes: 103 additions & 9 deletions packages/wizard/src/Wizard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,111 @@

/* eslint-disable no-console */
import React from 'react';
import { StoryFn } from '@storybook/react';
import { faker } from '@faker-js/faker';
import { StoryMetaType } from '@lg-tools/storybook-utils';
import { StoryObj } from '@storybook/react';

import Card from '@leafygreen-ui/card';

import { Wizard } from '.';

faker.seed(0);

export default {
title: 'Components/Wizard',
title: 'Composition/Data Display/Wizard',
component: Wizard,
}

const Template: StoryFn<typeof Wizard> = (props) => (
<Wizard {...props} />
);
parameters: {
default: 'LiveExample',
},
decorators: [
Fn => (
<div style={{ margin: -100, height: '100vh', width: '100vw' }}>
<Fn />
</div>
),
],
} satisfies StoryMetaType<typeof Wizard>;

export const Basic = Template.bind({});
export const LiveExample: StoryObj<typeof Wizard> = {
parameters: {
controls: {
exclude: ['children', 'activeStep', 'onStepChange'],
},
},
render: props => (
<Wizard {...props}>
{['Apple', 'Banana', 'Carrot'].map((title, i) => (
<Wizard.Step
key={i}
title={`Step ${i + 1}: ${title}`}
description={faker.lorem.paragraph()}
>
<Card>{faker.lorem.paragraph(10)}</Card>
</Wizard.Step>
))}
<Wizard.Footer
backButtonProps={{
onClick: () => console.log('[Storybook] Clicked Back'),
}}
cancelButtonProps={{
children: 'Cancel',
onClick: () => console.log('[Storybook] Clicked Cancel'),
}}
primaryButtonProps={{
children: 'Primary',
onClick: () => console.log('[Storybook] Clicked Primary'),
}}
/>
</Wizard>
),
};

export const Controlled: StoryObj<typeof Wizard> = {
parameters: {
controls: {
exclude: ['children', 'onStepChange'],
},
},
args: {
activeStep: 0,
},
render: ({ activeStep, ...props }) => {
return (
<Wizard
activeStep={activeStep}
onStepChange={x =>
console.log(`[Storybook] activeStep should change to ${x}`)
}
{...props}
>
{['Apple', 'Banana', 'Carrot'].map((title, i) => (
<Wizard.Step
key={i}
title={`Step ${i + 1}: ${title}`}
description={faker.lorem.paragraph()}
>
<Card>
<p>
This Wizard is controlled. Clicking the buttons will not do
anything. Use the Storybook controls to see the next step
</p>
{faker.lorem.paragraph(10)}
</Card>
</Wizard.Step>
))}
<Wizard.Footer
backButtonProps={{
onClick: () => console.log('[Storybook] Clicked Back'),
}}
cancelButtonProps={{
children: 'Cancel',
onClick: () => console.log('[Storybook] Clicked Cancel'),
}}
primaryButtonProps={{
children: 'Primary',
onClick: () => console.log('[Storybook] Clicked Primary'),
}}
/>
</Wizard>
);
},
};
Loading
Loading