diff --git a/packages/components/src/stories/Button.jsx b/packages/components/src/stories/Button.jsx deleted file mode 100644 index 15dde392..00000000 --- a/packages/components/src/stories/Button.jsx +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './button.css'; - -/** - * Primary UI component for user interaction - */ -export const Button = ({ primary, backgroundColor, size, label, ...props }) => { - const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; - return ( - - ); -}; - -Button.propTypes = { - /** - * Is this the principal call to action on the page? - */ - primary: PropTypes.bool, - /** - * What background color to use - */ - backgroundColor: PropTypes.string, - /** - * How large should the button be? - */ - size: PropTypes.oneOf(['small', 'medium', 'large']), - /** - * Button contents - */ - label: PropTypes.string.isRequired, - /** - * Optional click handler - */ - onClick: PropTypes.func, -}; - -Button.defaultProps = { - backgroundColor: null, - primary: false, - size: 'medium', - onClick: undefined, -}; diff --git a/packages/components/src/stories/Button.stories.js b/packages/components/src/stories/Button.stories.js deleted file mode 100644 index 0f57d469..00000000 --- a/packages/components/src/stories/Button.stories.js +++ /dev/null @@ -1,39 +0,0 @@ -import { Button } from './Button'; - -// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction -export default { - title: 'Example/Button', - component: Button, - tags: ['autodocs'], - argTypes: { - backgroundColor: { control: 'color' }, - }, -}; - -// More on writing stories with args: https://storybook.js.org/docs/7.0/react/writing-stories/args -export const Primary = { - args: { - primary: true, - label: 'Button', - }, -}; - -export const Secondary = { - args: { - label: 'Button', - }, -}; - -export const Large = { - args: { - size: 'large', - label: 'Button', - }, -}; - -export const Small = { - args: { - size: 'small', - label: 'Button', - }, -}; diff --git a/packages/components/src/stories/Header.jsx b/packages/components/src/stories/Header.jsx deleted file mode 100644 index 3862422e..00000000 --- a/packages/components/src/stories/Header.jsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import { Button } from './Button'; -import './header.css'; - -export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => ( -
-
-
- - - - - - - -

Acme

-
-
- {user ? ( - <> - - Welcome, {user.name}! - -
-
-
-); - -Header.propTypes = { - user: PropTypes.shape({ - name: PropTypes.string.isRequired, - }), - onLogin: PropTypes.func.isRequired, - onLogout: PropTypes.func.isRequired, - onCreateAccount: PropTypes.func.isRequired, -}; - -Header.defaultProps = { - user: null, -}; diff --git a/packages/components/src/stories/Header.stories.js b/packages/components/src/stories/Header.stories.js deleted file mode 100644 index 1c326bc0..00000000 --- a/packages/components/src/stories/Header.stories.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Header } from './Header'; - -export default { - title: 'Example/Header', - component: Header, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/7.0/react/writing-docs/docs-page - tags: ['autodocs'], - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout - layout: 'fullscreen', - }, -}; - -export const LoggedIn = { - args: { - user: { - name: 'Jane Doe', - }, - }, -}; - -export const LoggedOut = {}; diff --git a/packages/components/src/stories/Introduction.mdx b/packages/components/src/stories/Introduction.mdx deleted file mode 100644 index 2097f913..00000000 --- a/packages/components/src/stories/Introduction.mdx +++ /dev/null @@ -1,211 +0,0 @@ -import { Meta } from '@storybook/blocks'; -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- -
- - plugin - - Presets for popular tools - Easy setup for TypeScript, SCSS and more. - - - - Build - - Build configuration - How to customize webpack and Babel - - - - colors - - Styling - How to load and configure CSS libraries - - - - flow - - Data - Providers and mocking for data libraries - - -
- -
Learn
- -
- - repo - - Storybook documentation - Configure, customize, and extend - - - - direction - - In-depth guides - Best practices from leading teams - - - - code - - GitHub project - View the source and add issues - - - - comments - - Discord chat - Chat with maintainers and the community - - -
- -
- TipEdit the Markdown in{' '} - stories/Introduction.stories.mdx -
diff --git a/packages/components/src/stories/Page.jsx b/packages/components/src/stories/Page.jsx deleted file mode 100644 index c5fffe95..00000000 --- a/packages/components/src/stories/Page.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; - -import { Header } from './Header'; -import './page.css'; - -export const Page = () => { - const [user, setUser] = React.useState(); - - return ( -
-
setUser({ name: 'Jane Doe' })} - onLogout={() => setUser(undefined)} - onCreateAccount={() => setUser({ name: 'Jane Doe' })} - /> - -
-

Pages in Storybook

-

- We recommend building UIs with a{' '} - - component-driven - {' '} - process starting with atomic components and ending with pages. -

-

- Render pages with mock data. This makes it easy to build and review page states without - needing to navigate to them in your app. Here are some handy patterns for managing page - data in Storybook: -

-
    -
  • - Use a higher-level connected component. Storybook helps you compose such data from the - "args" of child component stories -
  • -
  • - Assemble data in the page component from your services. You can mock these services out - using Storybook. -
  • -
-

- Get a guided tutorial on component-driven development at{' '} - - Storybook tutorials - - . Read more in the{' '} - - docs - - . -

-
- Tip Adjust the width of the canvas with the{' '} - - - - - - Viewports addon in the toolbar -
-
-
- ); -}; diff --git a/packages/components/src/stories/Page.stories.js b/packages/components/src/stories/Page.stories.js deleted file mode 100644 index 90531e3c..00000000 --- a/packages/components/src/stories/Page.stories.js +++ /dev/null @@ -1,25 +0,0 @@ -import { userEvent, within } from '@storybook/testing-library' - -import { Page } from './Page' - -export default { - title: 'Example/Page', - component: Page, - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout - layout: 'fullscreen', - }, -} - -export const LoggedOut = {} - -// More on interaction testing: https://storybook.js.org/docs/7.0/react/writing-tests/interaction-testing -export const LoggedIn = { - play: async ({ canvasElement }) => { - const canvas = within(canvasElement) - const loginButton = await canvas.getByRole('button', { - name: /Log in/i, - }) - await userEvent.click(loginButton) - }, -} diff --git a/packages/components/src/stories/assets/code-brackets.svg b/packages/components/src/stories/assets/code-brackets.svg deleted file mode 100644 index 73de9477..00000000 --- a/packages/components/src/stories/assets/code-brackets.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/code-brackets \ No newline at end of file diff --git a/packages/components/src/stories/assets/colors.svg b/packages/components/src/stories/assets/colors.svg deleted file mode 100644 index 17d58d51..00000000 --- a/packages/components/src/stories/assets/colors.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/colors \ No newline at end of file diff --git a/packages/components/src/stories/assets/comments.svg b/packages/components/src/stories/assets/comments.svg deleted file mode 100644 index 6493a139..00000000 --- a/packages/components/src/stories/assets/comments.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/comments \ No newline at end of file diff --git a/packages/components/src/stories/assets/direction.svg b/packages/components/src/stories/assets/direction.svg deleted file mode 100644 index 65676ac2..00000000 --- a/packages/components/src/stories/assets/direction.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/direction \ No newline at end of file diff --git a/packages/components/src/stories/assets/flow.svg b/packages/components/src/stories/assets/flow.svg deleted file mode 100644 index 8ac27db4..00000000 --- a/packages/components/src/stories/assets/flow.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/flow \ No newline at end of file diff --git a/packages/components/src/stories/assets/plugin.svg b/packages/components/src/stories/assets/plugin.svg deleted file mode 100644 index 29e5c690..00000000 --- a/packages/components/src/stories/assets/plugin.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/plugin \ No newline at end of file diff --git a/packages/components/src/stories/assets/repo.svg b/packages/components/src/stories/assets/repo.svg deleted file mode 100644 index f386ee90..00000000 --- a/packages/components/src/stories/assets/repo.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/repo \ No newline at end of file diff --git a/packages/components/src/stories/assets/stackalt.svg b/packages/components/src/stories/assets/stackalt.svg deleted file mode 100644 index 9b7ad274..00000000 --- a/packages/components/src/stories/assets/stackalt.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/stackalt \ No newline at end of file diff --git a/packages/components/src/stories/button.css b/packages/components/src/stories/button.css deleted file mode 100644 index dc91dc76..00000000 --- a/packages/components/src/stories/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 700; - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; - line-height: 1; -} -.storybook-button--primary { - color: white; - background-color: #1ea7fd; -} -.storybook-button--secondary { - color: #333; - background-color: transparent; - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; -} -.storybook-button--small { - font-size: 12px; - padding: 10px 16px; -} -.storybook-button--medium { - font-size: 14px; - padding: 11px 20px; -} -.storybook-button--large { - font-size: 16px; - padding: 12px 24px; -} diff --git a/packages/components/src/stories/header.css b/packages/components/src/stories/header.css deleted file mode 100644 index 830610e6..00000000 --- a/packages/components/src/stories/header.css +++ /dev/null @@ -1,32 +0,0 @@ -.wrapper { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - display: flex; - align-items: center; - justify-content: space-between; -} - -svg { - display: inline-block; - vertical-align: top; -} - -h1 { - font-weight: 900; - font-size: 20px; - line-height: 1; - margin: 6px 0 6px 10px; - display: inline-block; - vertical-align: top; -} - -button + button { - margin-left: 10px; -} - -.welcome { - color: #333; - font-size: 14px; - margin-right: 10px; -} diff --git a/packages/components/src/stories/page.css b/packages/components/src/stories/page.css deleted file mode 100644 index fbc32aea..00000000 --- a/packages/components/src/stories/page.css +++ /dev/null @@ -1,69 +0,0 @@ -section { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 24px; - padding: 48px 20px; - margin: 0 auto; - max-width: 600px; - color: #333; -} - -section h2 { - font-weight: 900; - font-size: 32px; - line-height: 1; - margin: 0 0 4px; - display: inline-block; - vertical-align: top; -} - -section p { - margin: 1em 0; -} - -section a { - text-decoration: none; - color: #1ea7fd; -} - -section ul { - padding-left: 30px; - margin: 1em 0; -} - -section li { - margin-bottom: 8px; -} - -section .tip { - display: inline-block; - border-radius: 1em; - font-size: 11px; - line-height: 12px; - font-weight: 700; - background: #e7fdd8; - color: #66bf3c; - padding: 4px 12px; - margin-right: 10px; - vertical-align: top; -} - -section .tip-wrapper { - font-size: 13px; - line-height: 20px; - margin-top: 40px; - margin-bottom: 40px; -} - -section .tip-wrapper svg { - display: inline-block; - height: 12px; - width: 12px; - margin-right: 4px; - vertical-align: top; - margin-top: 3px; -} - -section .tip-wrapper svg path { - fill: #1ea7fd; -}