Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions packages/wizard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

# 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

### PNPM

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

### Yarn

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

### NPM

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

43 changes: 43 additions & 0 deletions packages/wizard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

{
"name": "@leafygreen-ui/wizard",
"version": "0.1.0",
"description": "LeafyGreen UI Kit 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/emotion": "workspace:^",
"@leafygreen-ui/lib": "workspace:^",
"@lg-tools/test-harnesses": "workspace:^"
},
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/wizard",
"repository": {
"type": "git",
"url": "https://github.com/mongodb/leafygreen-ui"
},
"bugs": {
"url": "https://jira.mongodb.org/projects/LG/summary"
}
}
17 changes: 17 additions & 0 deletions packages/wizard/src/Wizard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import React from 'react';
import { StoryFn } from '@storybook/react';

import { Wizard } from '.';

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

const Template: StoryFn<typeof Wizard> = (props) => (
<Wizard {...props} />
);

export const Basic = Template.bind({});

11 changes: 11 additions & 0 deletions packages/wizard/src/Wizard/Wizard.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import React from 'react';

Check warning on line 2 in packages/wizard/src/Wizard/Wizard.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'React' is defined but never used. Allowed unused vars must match /^_/u
import { render } from '@testing-library/react';

Check warning on line 3 in packages/wizard/src/Wizard/Wizard.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'render' is defined but never used. Allowed unused vars must match /^_/u

import { Wizard } from '.';

Check warning on line 5 in packages/wizard/src/Wizard/Wizard.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'Wizard' is defined but never used. Allowed unused vars must match /^_/u

describe('packages/wizard', () => {
test('condition', () => {

})
})
4 changes: 4 additions & 0 deletions packages/wizard/src/Wizard/Wizard.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

import { css } from '@leafygreen-ui/emotion';

export const baseStyles = css``;
8 changes: 8 additions & 0 deletions packages/wizard/src/Wizard/Wizard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

Check failure on line 1 in packages/wizard/src/Wizard/Wizard.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Run autofix to sort these imports!
import { WizardProps } from './Wizard.types';

export function Wizard({}: WizardProps) {

Check failure on line 4 in packages/wizard/src/Wizard/Wizard.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Unexpected empty object pattern
return <div>your content here</div>;
}

Wizard.displayName = 'Wizard';
1 change: 1 addition & 0 deletions packages/wizard/src/Wizard/Wizard.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export interface WizardProps {}
3 changes: 3 additions & 0 deletions packages/wizard/src/Wizard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

export { Wizard } from './Wizard';
export { type WizardProps } from './Wizard.types';
11 changes: 11 additions & 0 deletions packages/wizard/src/WizardFooter/WizardFooter.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import React from 'react';

Check warning on line 2 in packages/wizard/src/WizardFooter/WizardFooter.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'React' is defined but never used. Allowed unused vars must match /^_/u
import { render } from '@testing-library/react';

Check warning on line 3 in packages/wizard/src/WizardFooter/WizardFooter.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'render' is defined but never used. Allowed unused vars must match /^_/u

import { WizardFooter } from '.';

Check warning on line 5 in packages/wizard/src/WizardFooter/WizardFooter.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'WizardFooter' is defined but never used. Allowed unused vars must match /^_/u

describe('packages/wizard-footer', () => {
test('condition', () => {

})
})
4 changes: 4 additions & 0 deletions packages/wizard/src/WizardFooter/WizardFooter.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

import { css } from '@leafygreen-ui/emotion';

export const baseStyles = css``;
8 changes: 8 additions & 0 deletions packages/wizard/src/WizardFooter/WizardFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

Check failure on line 1 in packages/wizard/src/WizardFooter/WizardFooter.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Run autofix to sort these imports!
import { WizardFooterProps } from './WizardFooter.types';

export function WizardFooter({}: WizardFooterProps) {

Check failure on line 4 in packages/wizard/src/WizardFooter/WizardFooter.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Unexpected empty object pattern
return <div>your content here</div>;
}

WizardFooter.displayName = 'WizardFooter';
1 change: 1 addition & 0 deletions packages/wizard/src/WizardFooter/WizardFooter.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export interface WizardFooterProps {}
3 changes: 3 additions & 0 deletions packages/wizard/src/WizardFooter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

export { WizardFooter } from './WizardFooter';
export { type WizardFooterProps } from './WizardFooter.types';
11 changes: 11 additions & 0 deletions packages/wizard/src/WizardStep/WizardStep.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import React from 'react';

Check warning on line 2 in packages/wizard/src/WizardStep/WizardStep.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'React' is defined but never used. Allowed unused vars must match /^_/u
import { render } from '@testing-library/react';

Check warning on line 3 in packages/wizard/src/WizardStep/WizardStep.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'render' is defined but never used. Allowed unused vars must match /^_/u

import { WizardStep } from '.';

Check warning on line 5 in packages/wizard/src/WizardStep/WizardStep.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'WizardStep' is defined but never used. Allowed unused vars must match /^_/u

describe('packages/wizard-step', () => {
test('condition', () => {

})
})
4 changes: 4 additions & 0 deletions packages/wizard/src/WizardStep/WizardStep.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

import { css } from '@leafygreen-ui/emotion';

export const baseStyles = css``;
8 changes: 8 additions & 0 deletions packages/wizard/src/WizardStep/WizardStep.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

Check failure on line 1 in packages/wizard/src/WizardStep/WizardStep.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Run autofix to sort these imports!
import { WizardStepProps } from './WizardStep.types';

export function WizardStep({}: WizardStepProps) {

Check failure on line 4 in packages/wizard/src/WizardStep/WizardStep.tsx

View workflow job for this annotation

GitHub Actions / Check lints

Unexpected empty object pattern
return <div>your content here</div>;
}

WizardStep.displayName = 'WizardStep';
1 change: 1 addition & 0 deletions packages/wizard/src/WizardStep/WizardStep.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export interface WizardStepProps {}
3 changes: 3 additions & 0 deletions packages/wizard/src/WizardStep/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

export { WizardStep } from './WizardStep';
export { type WizardStepProps } from './WizardStep.types';
1 change: 1 addition & 0 deletions packages/wizard/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Wizard, type WizardProps } from './Wizard';
10 changes: 10 additions & 0 deletions packages/wizard/src/testing/getTestUtils.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

Check warning on line 1 in packages/wizard/src/testing/getTestUtils.spec.tsx

View workflow job for this annotation

GitHub Actions / Check lints

'React' is defined but never used. Allowed unused vars must match /^_/u
import { render } from '@testing-library/react';

import { Wizard } from '.';

describe('packages/wizard/getTestUtils', () => {
test('condition', () => {

})
})
15 changes: 15 additions & 0 deletions packages/wizard/src/testing/getTestUtils.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { findByLgId, getByLgId, queryByLgId } from '@lg-tools/test-harnesses';

import { LgIdString } from '@leafygreen-ui/lib';

import { DEFAULT_LGID_ROOT, getLgIds } from '../utils/getLgIds';

import { TestUtilsReturnType } from './getTestUtils.types';

export const getTestUtils = (
lgId: LgIdString = DEFAULT_LGID_ROOT,
): TestUtilsReturnType => {
const lgIds = getLgIds(lgId);

return {};
};
1 change: 1 addition & 0 deletions packages/wizard/src/testing/getTestUtils.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export interface TestUtilsReturnType {}
2 changes: 2 additions & 0 deletions packages/wizard/src/testing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { getTestUtils } from './getTestUtils';
export { type TestUtilsReturnType } from './getTestUtils.types';
12 changes: 12 additions & 0 deletions packages/wizard/src/utils/getLgIds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { LgIdString } from '@leafygreen-ui/lib';

export const DEFAULT_LGID_ROOT = 'lg-wizard';

export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => {
const ids = {
root,
} as const;
return ids;
};

export type GetLgIdsReturnType = ReturnType<typeof getLgIds>;
22 changes: 22 additions & 0 deletions packages/wizard/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "@lg-tools/build/config/package.tsconfig.json",
"compilerOptions": {
"paths": {
"@leafygreen-ui/icon/dist/*": ["../icon/src/generated/*"],
"@leafygreen-ui/*": ["../*/src"]
}
},
"include": ["src/**/*"],
"exclude": ["**/*.spec.*", "**/*.stories.*"],
"references": [
{
"path": "../emotion"
},
{
"path": "../lib"
},
{
"path": "../../tools/test-harnesses"
}
]
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/install/src/ALL_PACKAGES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const ALL_PACKAGES = [
'@leafygreen-ui/toolbar',
'@leafygreen-ui/tooltip',
'@leafygreen-ui/typography',
'@leafygreen-ui/wizard',
'@leafygreen-ui/vertical-stepper',
'@lg-charts/chart-card',
'@lg-charts/colors',
Expand Down
Loading