forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a storybook with callout component (github#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
15 changed files
with
38,868 additions
and
17,100 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dist/ | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
Oops, something went wrong.