-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSX docs view to all components #122
Changes from 5 commits
597a0eb
f3af83f
00749c7
86355e7
f9803b8
ff951d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { addParameters, storiesOf } from '@storybook/react'; | ||
import { boolean, select, text } from '@storybook/addon-knobs/react'; | ||
import Alert from './index'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { callback } from '../storyUtils'; | ||
|
||
addParameters({ | ||
jsx: { skip: 0 }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @nicko-winner, what's the purpose of this line again? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This creates a global param, and sets the arguments for storybook. We are telling the JSX plugin that is being applied globally to all stories to skip: 0 times, which means, do not exclude any markup from the JSX window display: If you had markup that looks like this:
skip: 1. would skip the outermost div:
skip: 2 would skip the outer 2 tags:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks for the explanation above. 🙄 |
||
}); | ||
|
||
const TYPES = { | ||
info: 'info', | ||
|
@@ -24,8 +29,8 @@ storiesOf('Alert', module).add('All Knobs', () => { | |
{...(status && { status })} | ||
{...(persist && { persist })} | ||
{...(type && { type })} | ||
onDismiss={action('onDismiss')} | ||
onSubmit={action('onSubmit')} | ||
onDismiss={callback(action('onDismiss'))} | ||
onSubmit={callback(action('onSubmit'))} | ||
> | ||
{content} | ||
</Alert> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,13 @@ import Button from './'; | |
import { Icons } from '../Icon'; | ||
import React from 'react'; | ||
import centered from '@storybook/addon-centered/react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { addParameters, storiesOf } from '@storybook/react'; | ||
import { boolean, select, text } from '@storybook/addon-knobs/react'; | ||
|
||
addParameters({ | ||
jsx: { skip: 2 }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see earlier response. |
||
}); | ||
|
||
const SIZES = { | ||
small: 'Small', | ||
'': 'Medium', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we add a separate contribution guide, please change to something like "Setting up a Local Dev Environment", for new contributors. 🙂 You can move it towards the end of README if that makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure