Skip to content
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 cra-kitchen-sink and crna-getstorybook #1259

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add knobs to test-cra kitchen sink (NOT WORKING)
Currently knobs show up, but editing the knobs does not update the URL
properly
  • Loading branch information
shilman committed Jun 8, 2017
commit ffc8696ab69fec42684c9b82f33e28ce1a52cedd
1 change: 1 addition & 0 deletions examples/test-cra/.storybook/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-notes/register';
import '@storybook/addon-options/register';
import '@storybook/addon-knobs/register';
1 change: 1 addition & 0 deletions examples/test-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@storybook/addon-actions": "file:../../addons/actions",
"@storybook/addon-info": "file:../../addons/info",
"@storybook/addon-knobs": "file:../../addons/knobs",
"@storybook/addon-links": "file:../../addons/links",
"@storybook/addon-notes": "file:../../addons/notes",
"@storybook/addon-options": "file:../../addons/options",
Expand Down
14 changes: 11 additions & 3 deletions examples/test-cra/src/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { WithNotes } from '@storybook/addon-notes';
import { withKnobs, text, number } from '@storybook/addon-knobs';

import Button from './Button';
import Welcome from './Welcome';
Expand All @@ -14,12 +15,19 @@ import ComponentWithRef from './ComponentWithRef';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);

storiesOf('Button', module)
.add('with text', () =>
.addDecorator(withKnobs)
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>)
.add('with notes', () =>
<WithNotes notes={'A very simple button'}>
<Button onClick={action('clicked')}>Hello Button</Button>
<Button>Check my notes in the notes panel</Button>
</WithNotes>
)
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>)
.add('with knobs', () => {
const label = text('Label', 'Edit me in knobs panel');
const num = number('Number', 1);
return <Button>{label} {num}</Button>;
})
.addWithInfo('with some info', 'Use the info addon with its painful API.', () =>
<Button>click the "?" in top right for info</Button>
);
Expand Down