Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Create a storybook with callout component (#20902)
* Create a storybook with callout component * Add to dist/storybook * Remove references to dist dir, storybook takes place * Update Callout.stories.tsx * Update Dockerfile * Update Dockerfile
- Loading branch information
Showing
with
38,868 additions
and 17,100 deletions.
- +1 −1 .eslintignore
- +1 −0 .gitignore
- +9 −0 .storybook/main.js
- +11 −0 .storybook/preview.js
- +1 −0 Dockerfile
- +30 −0 components/stories/Callout.stories.tsx
- +12 −0 components/stories/Introduction.stories.mdx
- +1 −1 contributing/development.md
- +5 −0 middleware/csp.js
- +5 −4 middleware/index.js
- +1 −3 nodemon.json
- +38,779 −17,082 package-lock.json
- +10 −1 package.json
- +1 −7 stylesheets/README.md
- +1 −1 tests/meta/repository-references.js
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1 +1 @@ | ||
| storybook/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -10,6 +10,7 @@ coverage/ | ||
| /data/early-access | ||
| .next | ||
| .eslintcache | ||
| /storybook/ | ||
|
|
||
| # blc: broken link checker | ||
| blc_output.log | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,9 @@ | ||
| const path = require('path') | ||
|
|
||
| module.exports = { | ||
| stories: [ | ||
| '../components/stories/**/*.stories.mdx', | ||
| '../components/stories/**/*.stories.@(js|jsx|ts|tsx)', | ||
| ], | ||
| addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-scss'], | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,11 @@ | ||
| import '../stylesheets/index.scss' | ||
|
|
||
| export const parameters = { | ||
| actions: { argTypesRegex: '^on[A-Z].*' }, | ||
| controls: { | ||
| matchers: { | ||
| color: /(background|color)$/i, | ||
| date: /Date$/, | ||
| }, | ||
| }, | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,30 @@ | ||
| import React from 'react' | ||
| import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
|
||
| // @ts-ignore | ||
| import { Callout } from '../ui/Callout.tsx' | ||
|
|
||
| export default { | ||
| title: 'UI/Callout', | ||
| component: Callout, | ||
| } as ComponentMeta<typeof Callout> | ||
|
|
||
| const Template: ComponentStory<typeof Callout> = (args) => <Callout {...args} /> | ||
|
|
||
| export const Success = Template.bind({}) | ||
| Success.args = { | ||
| variant: 'success', | ||
| children: <p>Hello!</p>, | ||
| } | ||
|
|
||
| export const Info = Template.bind({}) | ||
| Info.args = { | ||
| variant: 'info', | ||
| children: <p>Hello!</p>, | ||
| } | ||
|
|
||
| export const Warning = Template.bind({}) | ||
| Warning.args = { | ||
| variant: 'warning', | ||
| children: <p>Hello!</p>, | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,12 @@ | ||
| import { Meta } from '@storybook/addon-docs'; | ||
|
|
||
| <Meta title="Example/Introduction" /> | ||
|
|
||
| # 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 `src/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -2,10 +2,8 @@ | ||
| "ext": "js,json,yml,md,html,scss", | ||
| "ignore": [ | ||
| "assets", | ||
| "script", | ||
| "translations", | ||
| "stylesheets", | ||
| "tests" | ||
| ] | ||
Oops, something went wrong.