diff --git a/.circleci/config.yml b/.circleci/config.yml index e3f8c3537a9c..4c3ee6045a0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,6 +78,9 @@ jobs: - run: name: Integration Test - Kichen sinks command: yarn test --integration + - store_artifacts: + path: integration/__image_snapshots__ + destination: integration_image_snapshots example-react-native: <<: *defaults steps: diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000000..a5717c95fa5e --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,26 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 85 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 5 +# Issues with these labels will never be considered stale +exemptLabels: + - bug + - 'help wanted' + - 'in progress' + - 'do not merge' + - 'needs review' + +# Label to use when marking an issue as stale +staleLabel: inactive +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + Hi everyone! Seems like there hasn't been much going on in this issue lately. + If there are still questions, comments, or bugs, please feel free to continue + the discussion. We do try to do some housekeeping every once in a while so + inactive issues will get closed after 90 days. Thanks! +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + Hey there, it's me again! I am going to help our maintainers close this issue + so they can focus on development efforts instead. If the issue mentioned is + still a concern, please open a new ticket and mention this old one. Cheers + and thanks for using Storybook! diff --git a/README.md b/README.md index dc645de5f979..8e2301332c59 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ cd my-react-app getstorybook ``` +The `-g` global install is used to run our cli tool in your project directory to generate templates for your existing projects. To avoid the global install and start your project manually, take a look at our [Slow Start Guide](https://storybook.js.org/basics/slow-start-guide/). + Once it's installed, you can `npm run storybook` and it will run the development server on your local machine, and give you a URL to browse some sample stories. **Storybook v2.x migration note**: If you're using Storybook v2.x and want to shift to 3.x version the easiest way is: diff --git a/addons/actions/CHANGELOG.md b/addons/actions/CHANGELOG.md deleted file mode 100644 index 60992dfdfd4c..000000000000 --- a/addons/actions/CHANGELOG.md +++ /dev/null @@ -1,43 +0,0 @@ -## Changelog - -### v1.1.3 - -22 Mar 2017 - -- Fix issue caused by `v1.1.2` where storybook crashes when actions are used without names [PR30](https://github.com/storybooks/storybook-addon-actions/pull/30). - -### v1.1.2 - -21 Mar 2017 - -- Document `decorateAction` function (action decorator). [PR28](https://github.com/storybooks/storybook-addon-actions/pull/28) - -- Set correct Function.name for action handlers [PR24](https://github.com/storybooks/storybook-addon-actions/pull/24) - -### v1.1.1 - -11 Sep 2016 - -- Support arguments with circular references [PR6](https://github.com/kadirahq/storybook-addon-actions/pull/6) - -### v1.1.0 - -11 Sep 2016 - -- Support action decorators [PR3](https://github.com/kadirahq/storybook-addon-actions/pull/3) - -### v1.0.4 - -- Refactor source code (use separate files) - -### v1.0.3 - -- Log all arguments (only the first argument was logged previously) - -### v1.0.2 - -- Style tweak: center counter and inspector elements - -### v1.0.1 - -- First stable release with all features from the storybook action logger such as `action` function, react inspector and grouping log messages. diff --git a/addons/centered/CHANGELOG.md b/addons/centered/CHANGELOG.md deleted file mode 100644 index 8b031d36bf84..000000000000 --- a/addons/centered/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Change Log - -### v1.1.2 - -- Add .npmignore file [#PR9](https://github.com/storybooks/react-storybook-decorator-centered/pull/9) - -### v1.1.1 - -- Remove build directory from the repository [#PR8](https://github.com/storybooks/react-storybook-decorator-centered/pull/8) -- Simplify styles [#PR6](https://github.com/storybooks/react-storybook-decorator-centered/pull/6) -- Add using as addon instructions to Readme [#PR2](https://github.com/storybooks/react-storybook-decorator-centered/pull/8) - -### v1.0.0 - -- Initial release as `@kadira/react-storybook-decorator-centered`. diff --git a/addons/comments/CHANGELOG.md b/addons/comments/CHANGELOG.md deleted file mode 100644 index 7b1cc8111d1f..000000000000 --- a/addons/comments/CHANGELOG.md +++ /dev/null @@ -1,111 +0,0 @@ -## Changelog - -### v1.9.1 - -27-October-2016 - -- Fix comment delete button [PR48](https://github.com/kadirahq/storybook-addon-comments/pull/48) -- Remove app not found console error [PR49](https://github.com/kadirahq/storybook-addon-comments/pull/49) - -### v1.9.0 - -20-October-2016 - -- Show comments for public apps without logging in [PR46](https://github.com/kadirahq/storybook-addon-comments/pull/46) - -### v1.8.0 - -17-October-2016 - -- Add border-radius for comment form [PR44](https://github.com/kadirahq/storybook-addon-comments/pull/44) - -### v1.7.2 - -18-October-2016 - -- Add a loading icon for loading comments for the first time. [PR43](https://github.com/kadirahq/storybook-addon-comments/pull/43) -- Fix some minor bugs. - -### v1.7.1 - -18-October-2016 - -Load comments just after we found the current user. -This fixes the issue of not loading comments for the current story just after reloaded. - -### v1.7.0 - -14-October-2016 - -Improve console errors and signIn process when the user is loggedOut. - -### v1.7.0 - -14-October-2016 - -- Add a confirm box when deleting components. [#38](https://github.com/kadirahq/storybook-addon-comments/pull/38) -- Add the user to the local cache when adding a comment. [#40](https://github.com/kadirahq/storybook-addon-comments/pull/40) - -### v1.6.1 - -12-October-2016 - -Move a few packages from dev-deps to deps. - -### v1.6.0 - -12-October-2016 - -- Implement a better workflow for local users [PR31](https://github.com/kadirahq/storybook-addon-comments/pull/31) -- Set the protected field to true. [PR30](https://github.com/kadirahq/storybook-addon-comments/pull/30) - -### v1.5.1 - -12-October-2016 - -Fix a regression in the latest master. [PR33](https://github.com/kadirahq/storybook-addon-comments/pull/33) - -### v1.5.0 - -12-October-2016 - -Add comment delete feature [PR23](https://github.com/kadirahq/storybook-addon-comments/pull/23) - -### v1.4.0 - -12-October-2016 - -Add a cache invalidation system. [PR28](https://github.com/kadirahq/storybook-addon-comments/pull/28) - -### v1.3.0 - -11-October-2016 - -Add markdown support. [PR24](https://github.com/kadirahq/storybook-addon-comments/pull/24) - -### v1.2.0 - -11-October-2016 - -Add multiline comment support. [PR22](https://github.com/kadirahq/storybook-addon-comments/pull/22) - -### v1.1.1 - -Fix user info bug and remove unused files - -- Remove unused local addon-db files [PR19](https://github.com/kadirahq/storybook-addon-comments/pull/19) -- Update storybook dev dependency to auto export repo info [PR20](https://github.com/kadirahq/storybook-addon-comments/pull/20) -- Fix getUserInfo error by correcting method name [PR21](https://github.com/kadirahq/storybook-addon-comments/pull/21) - -### v1.1.0 - -Add some usability improvements. - -- Change login links to Storybook Hub. [PR12](https://github.com/kadirahq/storybook-addon-comments/pull/12) -- Remove full date text. [PR13](https://github.com/kadirahq/storybook-addon-comments/pull/13) -- Increase font size a bit. [PR14](https://github.com/kadirahq/storybook-addon-comments/pull/14) -- Implement a local comments cache. [PR16](https://github.com/kadirahq/storybook-addon-comments/pull/16) - -### v1.0.0 - -- First stable release diff --git a/addons/events/CHANGELOG.md b/addons/events/CHANGELOG.md deleted file mode 100644 index 1d997b5493bc..000000000000 --- a/addons/events/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChangeLog - -### v1.1.0 - -14-04-2017 - -- Added the ability to edit event payload -- Added live example -- Updated readme - -### v1.0.0 - -13-04-2017 - -- Initial version diff --git a/addons/graphql/CHANGELOG.md b/addons/graphql/CHANGELOG.md deleted file mode 100644 index cbfab56d7fb4..000000000000 --- a/addons/graphql/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -## Changelog - -### v1.0.0 - -- First stable release diff --git a/addons/graphql/package.json b/addons/graphql/package.json index 949134ce6237..bcb4040e1330 100644 --- a/addons/graphql/package.json +++ b/addons/graphql/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "global": "^4.3.2", - "graphiql": "^0.11.6", + "graphiql": "^0.11.10", "graphql": "^0.11.7", "prop-types": "^15.6.0" }, diff --git a/addons/info/CHANGELOG.md b/addons/info/CHANGELOG.md deleted file mode 100644 index 0b2b1a1031d5..000000000000 --- a/addons/info/CHANGELOG.md +++ /dev/null @@ -1,85 +0,0 @@ -# Change Log - -### v3.3.0 - -- Add setDefaults function [PR114](https://github.com/kadirahq/react-storybook-addon-info/pull/114) - -### v3.2.4 - -- Add missing dist files [PR113](https://github.com/kadirahq/react-storybook-addon-info/pull/113) - -### v3.2.3 - -- Handle number type nodes [PR110](https://github.com/kadirahq/react-storybook-addon-info/pull/110) - -### v3.2.2 - -- Use markdown-to-react-components npm package instead of our fork. Our PR to them is merged and published. [PR109](https://github.com/kadirahq/react-storybook-addon-info/pull/109) - -### v3.2.1 - -- Handle false values for types [PR54](https://github.com/kadirahq/react-storybook-addon-info/pull/54) - -### v3.2.0 - -- Support custom MTRC config [PR54](https://github.com/kadirahq/react-storybook-addon-info/pull/54) -- Fix propTables prop validation with a default value [PR55](https://github.com/kadirahq/react-storybook-addon-info/pull/55) - -### v3.1.4 - -- Remove propTables prop validation warning [PR53](https://github.com/kadirahq/react-storybook-addon-info/pull/53) -- Update example storybook [PR52](https://github.com/kadirahq/react-storybook-addon-info/pull/52) - -### v3.1.3 - -- Fix wrong detection of propType when isRequired is set [PR49](https://github.com/kadirahq/react-storybook-addon-info/pull/49) -- Add displayName for Button [PR51](https://github.com/kadirahq/react-storybook-addon-info/pull/51) - -### v3.1.2 - -- Fixed a bug which made the `info` to not display and the `options` parameter to be ignored when `info` is not given.[PR45](https://github.com/kadirahq/react-storybook-addon-info/pull/45) - -### v3.1.1 - -- Add a z-index for rendered items to make the overlay always display on top [PR38](https://github.com/kadirahq/react-storybook-addon-info/pull/38) - -### v3.1.0 - -- Make the `info` argument optional [PR37](https://github.com/kadirahq/react-storybook-addon-info/pull/37) - -### v3.0.10 - -- Render the component inside a div element when on inline mode [PR34](https://github.com/kadirahq/react-storybook-addon-info/pull/34) - -### v3.0.9 - -- Add missing `@kadira/storybook` devDependencies [PR25](https://github.com/kadirahq/react-storybook-addon-info/pull/25) -- Improve prop rendering in jsx source view [PR24](https://github.com/kadirahq/react-storybook-addon-info/pull/24) -- Avoid warning message with "webkitFontSmoothing" [PR30](https://github.com/kadirahq/react-storybook-addon-info/pull/30) -- Remove max-width style rule for wrapper [PR31](https://github.com/kadirahq/react-storybook-addon-info/pull/31) and [PR36](https://github.com/kadirahq/react-storybook-addon-info/pull/36) -- Improve prop table rendering (handle css resets) [PR32](https://github.com/kadirahq/react-storybook-addon-info/pull/32) - -### v3.0.8 - -- Fixed unkeyed array iteration warning in React with: [PR23](https://github.com/kadirahq/react-storybook-addon-info/pull/23) - -### v3.0.7 - -- Improve default display in prop table. See [#16](https://github.com/kadirahq/react-storybook-addon-info/pull/16) - -### v3.0.6 - -- Improve function type and react element type props display. See [#14](https://github.com/kadirahq/react-storybook-addon-info/pull/14) - -### v3.0.5 - -- Over-indentation of ending tag in source code is fixed. See [#13](https://github.com/kadirahq/react-storybook-addon-info/pull/13) - -### v3.0.4 - -- Remove the need to use json-loader with webpack when using this package. - See: [#12](https://github.com/kadirahq/react-storybook-addon-info/issues/12) - -### v3.0.0 - -- Add the version which works as an Storybook addon. diff --git a/addons/knobs/CHANGELOG.md b/addons/knobs/CHANGELOG.md deleted file mode 100644 index 4a02cb017018..000000000000 --- a/addons/knobs/CHANGELOG.md +++ /dev/null @@ -1,105 +0,0 @@ -# Changelog - -### v1.7.1 - -01-December-2016 - -Update style changes in the panel. [PR79](https://github.com/storybooks/storybook-addon-knobs/pull/79) - -### v1.7.0 - -25-November-2016 - -Modify number() to support a range slider as an input type for a knob.[PR77](https://github.com/storybooks/storybook-addon-knobs/pull/77) - -### v1.6.0 - -19-November-2016 - -Add Color as a type. [PR75](https://github.com/storybooks/storybook-addon-knobs/pull/75) - -### v1.5.0 - -8-November-2016 - -Add Array as a type. [PR70](https://github.com/storybooks/storybook-addon-knobs/pull/70). - -### v1.4.1 - -27-October-2016 - -Fix some issues related to typescript declaration. [PR69]() - -### v1.4.0 - -27-October-2016 - -Add TypeScript support [PR65](https://github.com/kadirahq/storybook-addon-knobs/pull/65). - -### v1.3.3 - -13-October-2016 - -Fix issue where hot reloaded updates were not rendered [PR62](https://github.com/kadirahq/storybook-addon-knobs/pull/62). - -### v1.3.2 - -13-October-2016 - -Make the render function of WrapStory pure [PR61](https://github.com/kadirahq/storybook-addon-knobs/pull/61). - -### v1.3.1 - -13-October-2016 - -Show or hide knob from panel depending on whether it was called in the story or not [PR59](https://github.com/kadirahq/storybook-addon-knobs/pull/59). - -### v1.3.0 - -05-October-2016 - -Accept null values for the date type. [PR56](https://github.com/kadirahq/storybook-addon-knobs/pull/56). - -### v1.2.3 - -28-September-2016 - -Remove setting selected prop in options in Select knobs [PR47](https://github.com/kadirahq/storybook-addon-knobs/pull/47) - -### v1.2.2 - -25-September-2016 - -Fix copy-paste error [PR37](https://github.com/kadirahq/storybook-addon-knobs/pull/37) -Remove
wrapper from WrapStory [PR42](https://github.com/kadirahq/storybook-addon-knobs/pull/42) - -### v1.2.1 - -20-September-2016 - -Support to use date type without a default value. [PR32](https://github.com/kadirahq/storybook-addon-knobs/pull/32) - -### v1.2.0 - -19-September-2016 - -Add a knob to get date from the user. [PR26](https://github.com/kadirahq/storybook-addon-knobs/pull/26) - -### v1.1.0 - -11-September-2016 - -Implement the select knob. [PR21](https://github.com/kadirahq/storybook-addon-knobs/pull/21) - -### v1.0.1 - -09-September-2016 - -Allow user to write JSON in the Object knob freely. -Earlier, it's hard to add new fields without creating a JSON error. - -### v1.0.0 - -09-September-2016 - -Initial Release. diff --git a/addons/links/CHANGELOG.md b/addons/links/CHANGELOG.md deleted file mode 100644 index 3d04b2ab3bf2..000000000000 --- a/addons/links/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -## Changelog - -### v1.0.1 - -- Refactor source code -- Update the README file - -### v1.0.0 - -- First stable release with all features from the storybook linkTo function diff --git a/addons/notes/CHANGELOG.md b/addons/notes/CHANGELOG.md deleted file mode 100644 index d1d549f99b5a..000000000000 --- a/addons/notes/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# ChangeLog - -### v1.0.1 - -30-August-2016 - -- Update docs. - -### v1.0.0 - -30-August-2016 - -- Initial version diff --git a/addons/notes/README.md b/addons/notes/README.md index 4daca664ac25..e637e3faa0e7 100644 --- a/addons/notes/README.md +++ b/addons/notes/README.md @@ -43,3 +43,17 @@ import Component from './Component'; storiesOf('Component', module) .add('with some emoji', withNotes('A very simple component')(() => )); ``` + +### Deprecated API +This API is slated for removal in 4.0 + +```js +import { WithNotes } from '@storybook/addon-notes'; + +storiesOf('Addon Notes', module) + .add('using deprecated API', () => ( + + + + )); +``` diff --git a/addons/options/CHANGELOG.md b/addons/options/CHANGELOG.md deleted file mode 100644 index 1ad8d52a97be..000000000000 --- a/addons/options/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -## Changelog - -### v1.0.2 - -13 Mar 2017 - -- Add typescript typings - -### v1.0.1 - -26 Sep 2016 - -- Update dev dependencies - -### v1.0.0 - -23 Sep 2016 - -- First stable release diff --git a/addons/options/README.md b/addons/options/README.md index c6dd84c662b5..9805fb2d1237 100644 --- a/addons/options/README.md +++ b/addons/options/README.md @@ -106,3 +106,4 @@ setOptions({ storybook.configure(() => require('./stories'), module); ``` +It is also possible to call `setOptions()` inside individual stories. Note that this will bring impact story render performance significantly. diff --git a/addons/storyshots/CHANGELOG.md b/addons/storyshots/CHANGELOG.md deleted file mode 100644 index f21d152162e4..000000000000 --- a/addons/storyshots/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# ChangeLog - -### v3.2.2 - -16-February-2016 - -Move set channel to happen before anything runs because addons might init expecting the channel to exist. [PR75](https://github.com/storybooks/storyshots/pull/75) - -### v3.2.1 - -21-January-2016 - -Provide mock Storybook Channel to Storybook addons. [PR72](https://github.com/storybooks/storyshots/pull/72) - -### v3.2.0 - -30-December-2016 - -Add support to filter stories by story name using a regexp. [PR70](https://github.com/storybooks/storyshots/pull/70) - -### v3.1.1 - -27-December-2016 - -Pass storybook context to render function of stories. [PR69](https://github.com/storybooks/storyshots/pull/69) - -### v3.1.0 - -24-December-2016 - -Add support for require.context. [PR67](https://github.com/storybooks/storyshots/pull/67) - -### v3.0.0 - -22-December-2016 - -This is a brand new version of StoryShots where it allows you to use StoryShots inside Jest. Earlier we have also bundled a CLI tool which uses some of the internal modules used by Jest. - -But it seems like we are building an our own Jest with that. That's why we decided to go with this approach. - -If you still like to use our CLI version, use this [version](https://github.com/storybooks/storyshots/tree/v2.1.0). -(It's working but we no longer maintain it.) - -### v2.1.0 - -8-November-2016 - -Default loaders support markdown file [PR56](https://github.com/kadirahq/storyshots/pull/56) - -### v2.0.2 - -7-November-2016 - -- `NODE_ENV` is set to `"development"` by default [PR50](https://github.com/kadirahq/storyshots/pull/50) -- `require.context` regexp test includes the begining `./` of filenames [PR55](https://github.com/kadirahq/storyshots/pull/55) - -### v2.0.1 - -20-October-2016 - -Prepare channel before reading storybook as some addons use it before running stories. [PR41](https://github.com/kadirahq/storyshots/pull/41) - -### v2.0.0 - -11-October-2016 - -- Update `jest-snapshot` to version 16.0.0. [PR39](https://github.com/kadirahq/storyshots/pull/39) -- Use a directory and extension different from regular jest snapshots for storyshots. [PR40](https://github.com/kadirahq/storyshots/pull/40) - -#### Migrating from 1.x.x - -From version 2.0.0 by default storyshot files will be stored in a directory named `__storyshots__` (instead of `__snapshots__`) inside storybook config directory. Further storyshot files will use extension `.shot` instead of `.snap`. - -These changes are important because they allow storyshots to be used with jest in the same project. See [issue#34](https://github.com/kadirahq/storyshots/issues/34) for more info. - -This mean that once storyshots is updated to 2.0.0 it wont check your existing snapshots. It will create new snapshots in the new location and you can delete old ones. - -To update safely, follow these steps. - -1. Run your 1.x.x version of storyshots and make sure all stories pass. -2. Update storyshots. `npm install @kadira/storyshots@^2.0.0 --save-dev` -3. Delete `__snapshots__` directory and contents from your storybook config directory. Also remove it from your version control system. -4. Run updated storyshots and add the newly added `__storyshots__` directory to your version control system. - -Done! - -### v1.1.5 - -9-October-2016 - -Fix issue where `require.context` did not work with regexps for full path. [PR37](https://github.com/kadirahq/storyshots/pull/37) - -### v1.1.4 - -6-October-2016 - -Add support for `require.context` inside storybook config module. The regression introduced in v1.1.2 is addressed. [PR33](https://github.com/kadirahq/storyshots/pull/30) - -### v1.1.3 - -30-September-2016 - -v1.1.2 introduce a [regression](https://github.com/kadirahq/storyshots/pull/30#issuecomment-250805615). So this revert that version. - -### v1.1.2 - -30-September-2016 - -Add support for `require.context` inside storybook config module. [PR30](https://github.com/kadirahq/storyshots/pull/30) - -### v1.1.1 - -28-September-2016 - -- Watch mode Summary shows the stats for the last run only. [PR27](https://github.com/kadirahq/storyshots/pull/27) -- If some tests fail exit with status code 1. [PR28](https://github.com/kadirahq/storyshots/pull/28) - -### v1.1.0 - -27-September-2016 - -Add `--exclude` flag to avoid running stories matching a given regexp. [PR24](https://github.com/kadirahq/storyshots/pull/24) [PR25](https://github.com/kadirahq/storyshots/pull/25) - -### v1.0.5 - -25-September-2016 - -- Fix missing dependencies. [PR21](https://github.com/kadirahq/storyshots/pull/21) -- Context should contain only the story name. [PR20](https://github.com/kadirahq/storyshots/pull/20) - -### v1.0.4 - -Invalid Version. Same as v1.0.3 - -### v1.0.3 - -23-September-2016 - -Fix a typo in the console Summary message. - -### v1.0.1 - -22-September-2016 - -Fix: Allow module loaders to return something. [PR14](https://github.com/kadirahq/storyshots/pull/14) - -### v1.0.1 - -22-September-2016 - -Fix a typo. - -### v1.0.0 - -22-September-2016 - -Initial Release. diff --git a/app/react-native/CHANGELOG.md b/app/react-native/CHANGELOG.md deleted file mode 100644 index d898d5e2a436..000000000000 --- a/app/react-native/CHANGELOG.md +++ /dev/null @@ -1,218 +0,0 @@ -# CHANGELOG - -## v2.3.0 - -- Add support for multiple users [#PR132](https://github.com/storybooks/react-native-storybook/pull/132) - -## v2.2.4 - -- Fix build issue with RN v0.42 [#PR128](https://github.com/storybooks/react-native-storybook/pull/128) and [#PR129](https://github.com/storybooks/react-native-storybook/pull/129) - -## v2.2.3 - -- Support React Native v0.42 [PR #126](https://github.com/kadirahq/react-native-storybook/pull/126). - -## v2.2.2 - -- Load .babelrc from project root directory [PR #125](https://github.com/kadirahq/react-native-storybook/pull/123). - -## v2.2.1 - -- Support React Native v0.41 [PR #121](https://github.com/kadirahq/react-native-storybook/pull/121). - -## v2.2.0 - -- Support React Native v0.39 [PR #114](https://github.com/kadirahq/react-native-storybook/pull/114). -- Support custom express middleware [PR #115](https://github.com/kadirahq/react-native-storybook/pull/115). - -## v2.1.7 - -- Support React Native v0.37 [PR #112](https://github.com/kadirahq/react-native-storybook/pull/112). - -## v2.1.6 - -- Show help message on device if no story is selected [PR #111](https://github.com/kadirahq/react-native-storybook/pull/111). - -## v2.1.5 - -- Support React Native v0.36 [PR #106](https://github.com/kadirahq/react-native-storybook/pull/106). - -## v2.1.4 - -- Make sure that when a story is selected the previous story is completely unmounted and new story is mounted [PR #104](https://github.com/kadirahq/react-native-storybook/pull/104). - -## v2.1.3 - -- Support React Native v0.34 [PR #102](https://github.com/kadirahq/react-native-storybook/pull/102). - -## v2.1.2 - -- Fix bug where context object is missing [PR #83](https://github.com/kadirahq/react-native-storybook/pull/83). - -## v2.1.1 - -- Support React Native v0.33 [PR #71](https://github.com/kadirahq/react-native-storybook/pull/71). - -## v2.1.0 - -- Remove `/dist` directory from the repo -- Support custom preview addons [PR #68](https://github.com/kadirahq/react-native-storybook/pull/68). - -## v2.0.2 - -- Use 7007 as the default port (use in getstorybook tool) [PR #64](https://github.com/kadirahq/react-native-storybook/pull/64). -- Support React Native v0.32 [PR #65](https://github.com/kadirahq/react-native-storybook/pull/65). - -## v2.0.1 - -- Fix storyFn prop validation [PR #59](https://github.com/kadirahq/react-native-storybook/pull/59). -- Support older versions of react-native module [PR #60](https://github.com/kadirahq/react-native-storybook/pull/60). - -## v2.0.0 - -**Rewrite the backend to support new UI and addons** - -- Use webpack dev middleware to serve storybook UI instead of prebuilt manager.js -- Advanced config API is removed (UI customizations can be done with addons easily) -- Removed custom channels and preview modules (moved to separate addons) - -## v1.12.6 - -- Support react native versions 0.27.0 to 0.31.x - -## v1.12.5 - -- Support react native versions 0.27.0 to 0.30.x [PR #55](https://github.com/kadirahq/react-native-storybook/pull/55). - -## v1.12.3 - -- Use channel modules [PR #52](https://github.com/kadirahq/react-native-storybook/pull/52). - -## v1.12.2 - -- Make the `module` argument optional -- Remove unnecessary console.log statement - -## v1.12.1 - -- Disable react warnings (these should be handled in storybook-ui repo) - -## v1.12.0 - -- Add qr-code preview option [PR #49](https://github.com/kadirahq/react-native-storybook/pull/49). - -## v1.11.3 - -- Make `addDecorator` return `this` to make it chainable [PR #47](https://github.com/kadirahq/react-native-storybook/pull/47). - -## v1.11.2 - -- Get rid of the 'unique key prop' warning - -## v1.11.1 - -- Add missing imports for `storybook build` command - -## v1.11.0 - -- Rewrite most of the code to avoid unnecessary event emitters -- Improve code organization and haow it handles storybook config -- Implement `linkTo` feature. - -## v1.10.1 - -- Tweak appetize.io preview (remove frame and autoplay) - -## v1.10.0 - -- Remove android build from the build command [PR #41](https://github.com/kadirahq/react-native-storybook/pull/41). - -## v1.9.0 - -- Abstract the communication layer (as "channels") and add firebase support -- Add in-browser preview with appetize -- Add storybook favicon - -## v1.8.0 - -- Introduce getStorybookUI method to get the UI component class. - -## v1.7.2 - -- Update README related to HMR usage. - -## v1.7.1 - -- Make the getting started process simple. - -## v1.7.0 - -- Minify the manager build to around 350 KB with UglifyJs support. - -## v1.6.0 - -- Add run-ios command [PR #27](https://github.com/kadirahq/react-native-storybook/pull/27). - -## v1.5.0 - -- Pass the context variable [PR #26](https://github.com/kadirahq/react-native-storybook/pull/26). - -## v1.4.0 - -- Implement action logger feature [PR #25](https://github.com/kadirahq/react-native-storybook/pull/25). - -## v1.3.0 - -- Implement decorators feature [PR #24](https://github.com/kadirahq/react-native-storybook/pull/24). - -## v1.2.1 - -- Fix bug where web UI crashes when starting with selection query params [PR #21](https://github.com/kadirahq/react-native-storybook/pull/21). - -## v1.2.0 - -- Support addons [PR #20](https://github.com/kadirahq/react-native-storybook/pull/20). - -## v1.1.4 - -- Add missing `module` argument to template [PR #18](https://github.com/kadirahq/react-native-storybook/pull/18). - -## v1.1.3 - -- Remove socket.io and use plain Websockets [PR #17](https://github.com/kadirahq/react-native-storybook/pull/17). Removes JS debugging requirement. - -## v1.1.2 - -- Partially fix hot module reloading [Issue #8](https://github.com/kadirahq/react-native-storybook/issues/8) with [PR #10](https://github.com/kadirahq/react-native-storybook/pull/10) - -## v1.1.1 - -- Build source files and write README - -## v1.1.0 - -- Replace `PreviewContainer` with `PreviewComponent` where the host and port are configurable - -## v1.0.4 - -- Fix socket.io by using a patched socket.io temporarily [PR #2](https://github.com/kadirahq/react-native-storybook/pull/2) - -## v1.0.3 - -- Fix `window.navigator.userAgent` related issue with socket.io [Issue #1](https://github.com/kadirahq/react-native-storybook/issues/1) - -## v1.0.2 - -- Rename storybook command file from `cli.js` to `storybook.js` - -## v1.0.1 - -- Add missing dependency `commander` to package.json file - -## v1.0.0 - -This is the initial non-poc release of `react-native-storybook`. With this release, users can write stories and check them using an ios-simulator. The address of the storybook `localhost:9001` is hardcoded so for now it does not work on real devices or the android simulator. Also it is not contributor friendly. When used with `npm link`, the node_modules directory should be removed when using the ios simulator. - -- Support ability to write stories using `storiesOf` and `add` without using decorators or addons -- The storybook can be started with `storybook start -h localhost -p 9001` although the port and host should be as given in this example -- The story preview device can be started with the `react-native run-ios` command but the apps `index.*.js` must be edited (for now) diff --git a/app/react-native/package.json b/app/react-native/package.json index cdeb682288d2..efb1ee7019a8 100644 --- a/app/react-native/package.json +++ b/app/react-native/package.json @@ -74,7 +74,7 @@ "babel-cli": "^6.26.0", "react": "^16.0.0", "react-dom": "^16.0.0", - "react-native": "^0.43.3" + "react-native": "^0.49.3" }, "peerDependencies": { "react": "*", diff --git a/app/react-native/readme.md b/app/react-native/readme.md index f4811462bcc7..436e60d621ce 100644 --- a/app/react-native/readme.md +++ b/app/react-native/readme.md @@ -1,1495 +1,101 @@ -# 3.3.0-alpha.0 +# Storybook for React Native -2017-September-06 +[![Build Status on CircleCI](https://circleci.com/gh/storybooks/storybook.svg?style=shield)](https://circleci.com/gh/storybooks/storybook) +[![CodeFactor](https://www.codefactor.io/repository/github/storybooks/storybook/badge)](https://www.codefactor.io/repository/github/storybooks/storybook) +[![Known Vulnerabilities](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847/badge.svg)](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847) +[![BCH compliance](https://bettercodehub.com/edge/badge/storybooks/storybook)](https://bettercodehub.com/results/storybooks/storybook) [![codecov](https://codecov.io/gh/storybooks/storybook/branch/master/graph/badge.svg)](https://codecov.io/gh/storybooks/storybook) +[![Storybook Slack](https://now-examples-slackin-nqnzoygycp.now.sh/badge.svg)](https://now-examples-slackin-nqnzoygycp.now.sh/) +[![Backers on Open Collective](https://opencollective.com/storybook/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/storybook/sponsors/badge.svg)](#sponsors) -#### Features +* * * -- Viewport addon: simulate device sizes in preview window [#1753](https://github.com/storybooks/storybook/pull/1753) -- CLI: Add codemod for deprecated addon-links and addon-actions from app [#1368](https://github.com/storybooks/storybook/pull/1368) -- Info addon: More detailed props table [#1485](https://github.com/storybooks/storybook/pull/1485) -- React native: Add accessibility labels to OnDeviceUI [#1780](https://github.com/storybooks/storybook/pull/1780) -- Stories panel: Stories on each hierarchy level [#1763](https://github.com/storybooks/storybook/pull/1763) -- Storyshots: Generate snapshot per story file [#1584](https://github.com/storybooks/storybook/pull/1584) -- CLI: Add support for Vue projects using Nuxt [#1794](https://github.com/storybooks/storybook/pull/1794) +With Storybook for React Native you can design and develop individual React Native components without running your app. -#### Bug Fixes +![Storybook Screenshot](docs/assets/readme/screenshot.png) -- Import chunks/assets in correct order using HtmlWebpackPlugin [#1775](https://github.com/storybooks/storybook/pull/1775) -- Fix preview scrolling [#1782](https://github.com/storybooks/storybook/pull/1782) -- Height aligned 2 buttons in manager's header [#1769](https://github.com/storybooks/storybook/pull/1769) -- Search box: make found options selectable with click [#1697](https://github.com/storybooks/storybook/pull/1697) -- Info addon: Fix Docgen in static builds [#1725](https://github.com/storybooks/storybook/pull/1725) -- Knobs: allow arrays in object knob proptypes [#1701](https://github.com/storybooks/storybook/pull/1701) +For more information visit: [storybook.js.org](https://storybook.js.org) -#### Documentation +## Getting Started -- Improve linkTo documentation [#1793](https://github.com/storybooks/storybook/pull/1793) -- Add carbon to examples page [#1764](https://github.com/storybooks/storybook/pull/1764) -- Minor grammar fixes and clarification to Vue documentation [#1756](https://github.com/storybooks/storybook/pull/1756) -- Fix incorrect yarn command in docs [#1758](https://github.com/storybooks/storybook/pull/1758) -- Add storybook-chrome-screenshot to addon gallery [#1761](https://github.com/storybooks/storybook/pull/1761) -- Fixing typo on VueJS withNotes Example [#1787](https://github.com/storybooks/storybook/pull/1787) +The `getstorybook` tool can be used to add Storybook to your React Native app. Install the `getstorybook` tool if necessary and run it from your project directory with these commands: -#### Maintenance +```shell +npm -g i @storybook/cli +getstorybook +``` -- Deprecate confusing option names [#1692](https://github.com/storybooks/storybook/pull/1692) -- A CLI for running specific tests suites, like bootstrap CLI [#1752](https://github.com/storybooks/storybook/pull/1752) -- Remove check for sender on channel. [#1407](https://github.com/storybooks/storybook/pull/1407) -- Use yarn instead of NPM [#1703](https://github.com/storybooks/storybook/pull/1703) -- Add config for dependencies.io [#1770](https://github.com/storybooks/storybook/pull/1770) -- Added addon-knobs to crna and vanilla react native. [#1636](https://github.com/storybooks/storybook/pull/1636) -- Fixed Jest warnings [#1744](https://github.com/storybooks/storybook/pull/1744) -- Smoke test master [#1801](https://github.com/storybooks/storybook/pull/1801) +After you have installed, there are additional steps for `create-react-native-app` apps. See the section for details, otherwise skip to [Start Storybook](#start-storybook) +to see the next step. -#### Dependency Upgrades +## Create React Native App (CRNA) -- Upgrade root dependencies and sync with packages [#1802](https://github.com/storybooks/storybook/pull/1802) -- Update jest to the latest version 🚀 [#1799](https://github.com/storybooks/storybook/pull/1799) -- Update eslint-plugin-jest to the latest version 🚀 [#1795](https://github.com/storybooks/storybook/pull/1795) -- Update lerna to the latest version 🚀 [#1768](https://github.com/storybooks/storybook/pull/1768) +If you run `getstorybook` inside a CRNA app, you'll be notified that there is an extra step required to use Storybook. -# 3.2.11 +The easiest way to use Storybook inside CRNA is to simply replace your App with the Storybook UI, which is possible by replacing `App.js` with a single line of code: -2017-September-27 +```js +export default from './storybook'; +``` -#### Features +This will get you up and running quickly, but then you lose your app! +There are multiple options here. for example, you can export conditionally: -- Add two new RN packager configuration options [#1865](https://github.com/storybooks/storybook/pull/1865) +```js +import StorybookUI from './storybook'; -#### Bug Fixes +import App from './app'; -- Addon-info - Fix immutable props issues with React 16 [#1894](https://github.com/storybooks/storybook/pull/1894) -- Update react-inspector to fix #1831 [#1888](https://github.com/storybooks/storybook/pull/1888) +module.exports = __DEV__ ? StorybookUI : App; +``` -#### Documentation +Alternatively, `StorybookUI` is simply a RN `View` component that can be embedded anywhere in your RN application, e.g. on a tab or within an admin screen. -- Updated release process documentation [#1882](https://github.com/storybooks/storybook/pull/1882) +## Start Storybook -# 3.2.10 +After initial setup start the storybook server with the storybook npm script. -2017-September-22 +```shell +npm run storybook +``` -#### Features +Now, you can open to view your storybook menus in the browser. -- Added codemod for deprecated addon-links and addon-actions from app [#1368](https://github.com/storybooks/storybook/pull/1368) -- React native: Added option for custom packager port [#1837](https://github.com/storybooks/storybook/pull/1837) -- CLI: add support for Vue projects using Nuxt [#1794](https://github.com/storybooks/storybook/pull/1794) +## Start App -#### Bug Fixes +To see your Storybook stories on the device, you should start your mobile app for the `` of your choice (typically `ios` or `android`). (Note that due to an implementation detail, your stories will only show up in the left pane of your browser window after your device has connected to this storybook server.) -- Avoid error "storyshots is intended only to be used with storybook" [#1441](https://github.com/storybooks/storybook/pull/1441) -- Log correct url when using --https [#1871](https://github.com/storybooks/storybook/pull/1871) -- Fix broken links in the deprecation warning for RN and Vue apps [#1827](https://github.com/storybooks/storybook/pull/1827) -- Height aligned 2 buttons in manager's header [#1769](https://github.com/storybooks/storybook/pull/1769) -- Add missing regenerator and runtime babel transform pkgs to package.json [#1848](https://github.com/storybooks/storybook/pull/1848) +For CRNA apps: -#### Documentation + npm run -- Update README: mention that addon-links needs to be registered manually [#1835](https://github.com/storybooks/storybook/pull/1835) -- Improve linkTo documentation [#1793](https://github.com/storybooks/storybook/pull/1793) -- Minor grammar fixes and clarification to Vue documentation [#1756](https://github.com/storybooks/storybook/pull/1756) -- Add missing NPM script section to Vue guide [#1824](https://github.com/storybooks/storybook/pull/1824) -- Add storybook-chrome-screenshot to addon gallery [#1761](https://github.com/storybooks/storybook/pull/1761) +For RN apps: -#### Dependency Upgrades + react-native run- -- Update babel-eslint to the latest version 🚀 [#1836](https://github.com/storybooks/storybook/pull/1836) -- UPGRADE root dependencies and SYNC with packages [#1802](https://github.com/storybooks/storybook/pull/1802) -- Update jest to the latest version 🚀 [#1799](https://github.com/storybooks/storybook/pull/1799) -- Update eslint-plugin-jest to the latest version 🚀 [#1795](https://github.com/storybooks/storybook/pull/1795) -- Update lerna to the latest version 🚀 [#1768](https://github.com/storybooks/storybook/pull/1768) +Once your app is started, changing the selected story in web browser will update the story displayed within your mobile app. -#### Maintenance +If you are using Android and you get the following error after running the app: `'websocket: connection error', 'Failed to connect to localhost/127.0.0.1:7007'`, you have to forward the port 7007 on your device/emulator to port 7007 on your local machine with the following command: +`adb reverse tcp:7007 tcp:7007` -- Smoke test master [#1801](https://github.com/storybooks/storybook/pull/1801) -- Fixed Jest warnings [#1744](https://github.com/storybooks/storybook/pull/1744) +## Using Haul-cli -# 3.2.9 +[Haul](https://github.com/callstack-io/haul) is an alternative to the react-native packager and has several advantages in that it allows you to define your own loaders, and handles symlinks better. -2017-August-26 +If you want to use haul instead of the react-native packager, modify the storybook npm script to: -#### Bug Fixes +```sh +storybook start -p 7007 --haul webpack.haul.storybook.js --platform android | ios | all +``` -- Fix getstorybook CLI for React Native projects [#1741](https://github.com/storybooks/storybook/pull/1741) +Where webpack.haul.storybook.js should look something like this: -#### Documentation +```js +module.exports = ({ platform }) => ({ + entry: `./storybook/index.${platform}.js`, + // any other haul config here. +}); +``` -- Improve `addon-info` README options documentation [#1732](https://github.com/storybooks/storybook/pull/1732) +## Learn More -#### Maintenance - -- ADD a CLI for bootstrapping [#1216](https://github.com/storybooks/storybook/pull/1216) - -#### Dependency Upgrades - -- Update lerna to the latest version 🚀 [#1727](https://github.com/storybooks/storybook/pull/1727) - -# 3.2.8 - -2017-August-23 - -#### Bug Fixes - -- Fix storyshots with new babel config [#1721](https://github.com/storybooks/storybook/pull/1721) -- Fix CLI generators export [#1722](https://github.com/storybooks/storybook/pull/1722) - -#### Documentation - -- Add caveat about knobs date defaultValue [#1719](https://github.com/storybooks/storybook/pull/1719) - -# 3.2.7 - -2017-August-23 - -#### Bug Fixes - -- Fix storyshots by moving cacheDirectory to webpack config [#1713](https://github.com/storybooks/storybook/pull/1713) -- Revert "Improved error checking in global addDecorator" [#1716](https://github.com/storybooks/storybook/pull/1716) -- Stricter linting rules for imports [#1676](https://github.com/storybooks/storybook/pull/1676) -- Addon Info: Remove broken prop type sort (keep defined order) [#1711](https://github.com/storybooks/storybook/pull/1711) - -#### Maintenance - -- Enable eslint for vue-related stuff [#1715](https://github.com/storybooks/storybook/pull/1715) -- CLI: ensure explicit dependency on `prop-types` for RN [#1714](https://github.com/storybooks/storybook/pull/1714) - -# 3.2.6 - -2017-August-22 - -#### Features - -- Improve search and highlighting [#1693](https://github.com/storybooks/storybook/pull/1693) -- Add centered decorator for vue [#1595](https://github.com/storybooks/storybook/pull/1595) -- Add react-docgen propTypes to info addon [#1562](https://github.com/storybooks/storybook/pull/1562) - -#### Bug Fixes - -- Fix stories panel resizing bug [#1689](https://github.com/storybooks/storybook/pull/1689) -- Check for React presence when detecting `WEBPACK_REACT` type [#1646](https://github.com/storybooks/storybook/pull/1646) -- Fix Create React App detection [#1645](https://github.com/storybooks/storybook/pull/1645) -- Add dependencies on plugins used by getstorybook CLI [#1652](https://github.com/storybooks/storybook/pull/1652) -- Fix preview window loading non js,css files [#1554](https://github.com/storybooks/storybook/pull/1554) - -#### Documentation - -- Improve the warning given when using channel before it's defined [#1515](https://github.com/storybooks/storybook/pull/1515) -- Remove imports from README that are not necessary with latest API [#1700](https://github.com/storybooks/storybook/pull/1700) -- Add reminders to PR template [#1683](https://github.com/storybooks/storybook/pull/1683) -- Docgen Flow Type Example [#1684](https://github.com/storybooks/storybook/pull/1684) - -#### Maintenance - -- Make lint-staged work properly [#1675](https://github.com/storybooks/storybook/pull/1675) -- Move baseFonts and RoutedLink to `@storybook/components` [#1659](https://github.com/storybooks/storybook/pull/1659) - -#### Dependency Upgrades - -- Switch to babel preset env + async/await/generator support [#1668](https://github.com/storybooks/storybook/pull/1668) -- Upgrade react-native-compat to avoid PropTypes warnings [#1673](https://github.com/storybooks/storybook/pull/1673) -- Change React.PropTypes to prop-types [#1674](https://github.com/storybooks/storybook/pull/1674) [#1710](https://github.com/storybooks/storybook/pull/1710) - -# 3.2.5 - -2017-August-16 - -#### Features - -- Add codemod for deprecated addon-info API [#1582](https://github.com/storybooks/storybook/pull/1582) - -#### Bug Fixes - -- Fixed addon-knobs for RN [#1635](https://github.com/storybooks/storybook/pull/1635) -- Make links navigate in the parent window [#1650](https://github.com/storybooks/storybook/pull/1650) -- Don’t render leftpanel stories tree if stories are empty [#1664](https://github.com/storybooks/storybook/pull/1664) -- Remove double styling for inline stories [#1651](https://github.com/storybooks/storybook/pull/1651) - -#### Dependency Upgrades - -- Upgrade react-modal to v2.2.4 [#1666](https://github.com/storybooks/storybook/pull/1666) - -# 3.2.4 - -2017-August-12 - -#### Features - -- Hierarchy expansion on search [#1598](https://github.com/storybooks/storybook/pull/1598) -- Add sidebarAnimations config prop [#1601](https://github.com/storybooks/storybook/pull/1601) -- Add hrefs to left menu links [#1523](https://github.com/storybooks/storybook/pull/1523) -- Enable many components of same type in addon-info prop tables [#1607](https://github.com/storybooks/storybook/pull/1607) -- Always collapse an expanded kind in tree view without changing selected story [#1590](https://github.com/storybooks/storybook/pull/1590) -- Option to select an addon panel [#1641](https://github.com/storybooks/storybook/pull/1641) - -#### Documentation - -- Document how to use info addon as decorator [#1592](https://github.com/storybooks/storybook/pull/1592) -- Add Android simulator instructions for React Native [#1591](https://github.com/storybooks/storybook/pull/1591) - -#### Maintenance - -- Tree view visual adjustments [#1599](https://github.com/storybooks/storybook/pull/1599) -- Add z-index to shortcuts popup overlay [#1617](https://github.com/storybooks/storybook/pull/1617) -- Use ReactModal for search box [#1548](https://github.com/storybooks/storybook/pull/1548) -- Limit react versions to >=15 [#1613](https://github.com/storybooks/storybook/pull/1613) - -# 3.2.3 - -2017-August-01 - -#### Features - -- Use the React Native packager's host by default [#1568](https://github.com/storybooks/storybook/pull/1568) -- Make onDeviceUI default for RN getstorybook [#1571](https://github.com/storybooks/storybook/pull/1571) - -#### Documentation - -- Add short description to addon-options readme [#1566](https://github.com/storybooks/storybook/pull/1566) - -# 3.2.2 - -2017-July-31 - -#### Bug Fixes - -- Fixed build-storybook for vue [#1564](https://github.com/storybooks/storybook/pull/1564) - -# 3.2.1 - -2017-July-31 - -#### Bug Fixes - -- Check if hierarchySeparator presents in the options object [#1561](https://github.com/storybooks/storybook/pull/1561) -- React Native <0.43 support [#1555](https://github.com/storybooks/storybook/pull/1555) - -#### Documentation - -- Fix typo with Vue README referring to react [#1556](https://github.com/storybooks/storybook/pull/1556) -- Add state-setting FAQ [#1559](https://github.com/storybooks/storybook/pull/1559) - -# 3.2.0 - -2017-July-31 - -Storybook 3.2 is filled with new features to help make your components shine! Headline features: - -- Vue support [#1267](https://github.com/storybooks/storybook/pull/1267) -- Story Hierarchy [#1329](https://github.com/storybooks/storybook/pull/1329) -- React Native On Device UI [#1413](https://github.com/storybooks/storybook/pull/1413) - -Plus many more features, documentation improvements, and bugfixes below! - -#### Features - -- Vue support [#1267](https://github.com/storybooks/storybook/pull/1267) -- Add support for vue in addon-notes [#1278](https://github.com/storybooks/storybook/pull/1278) -- CLI support for Vue [#1287](https://github.com/storybooks/storybook/pull/1287) -- Story Hierarchy [#1329](https://github.com/storybooks/storybook/pull/1329) -- Story Hierarchy UI improvements [#1387](https://github.com/storybooks/storybook/pull/1387) [#1356](https://github.com/storybooks/storybook/pull/1356) -- Story Hierarchy - keyboard accessibility [#1427](https://github.com/storybooks/storybook/pull/1427) -- React Native - On Device UI [#1413](https://github.com/storybooks/storybook/pull/1413) -- Show first story on RN OnDeviceUI startup [#1510](https://github.com/storybooks/storybook/pull/1510) -- Added collapsible RN OnDeviceUI navigation [#1544](https://github.com/storybooks/storybook/pull/1544) -- Add warning when module is missing in storiesOf [#1525](https://github.com/storybooks/storybook/pull/1525) -- Provide styling hook for Addon Info story body [#1308](https://github.com/storybooks/storybook/pull/1308) -- Implement filtering on story-level [#1432](https://github.com/storybooks/storybook/pull/1432) -- Refactoring of `addon-info` [#1452](https://github.com/storybooks/storybook/pull/1452) -- ADD storybook logo for inside terminal for future CLI or easteregg [#1499](https://github.com/storybooks/storybook/pull/1499) -- Improved error checking in global addDecorator [#1481](https://github.com/storybooks/storybook/pull/1481) - -#### Bug Fixes - -- Fix react native example and bootstrapping [#1514](https://github.com/storybooks/storybook/pull/1514) -- Fix a 'funny' hmr issue in cra-kitchen-sink [#1508](https://github.com/storybooks/storybook/pull/1508) -- When timestamps are enabled, it actually checks them before applying changes [#1405](https://github.com/storybooks/storybook/pull/1405) -- Fix issue when extending webpack config [#1468](https://github.com/storybooks/storybook/pull/1468) -- Fix addon notes [#1448](https://github.com/storybooks/storybook/pull/1448) -- Story Hierarchy - initial state bug fix [#1401](https://github.com/storybooks/storybook/pull/1401) -- Remove blue outline when node is focused [#1497](https://github.com/storybooks/storybook/pull/1497) - -#### Documentation - -- Add hierarchySeparator to README [#1445](https://github.com/storybooks/storybook/pull/1445) -- Document null addons channel in FAQ [#1507](https://github.com/storybooks/storybook/pull/1507) - -#### Maintenance - -- Revert knobs API to previous API. [#1527](https://github.com/storybooks/storybook/pull/1527) -- FIX hoist-internals: remove existing folder/link before linking [#1516](https://github.com/storybooks/storybook/pull/1516) -- Update global hook for Vue Devtools [#1376](https://github.com/storybooks/storybook/pull/1376) -- SWITCH to circleci over travisCI && CHANGE lerna bootstrap procedure: [#1486](https://github.com/storybooks/storybook/pull/1486) -- Update cra-kitchen-sink package versions for 3.2-alpha [#1434](https://github.com/storybooks/storybook/pull/1434) -- Updating 3.2 alpha release with patches [#1419](https://github.com/storybooks/storybook/pull/1419) -- Remove typescript typings for @storybook/addon-notes [#1344](https://github.com/storybooks/storybook/pull/1344) -- Remove typescript typings for @storybook/addon-options [#1343](https://github.com/storybooks/storybook/pull/1343) -- Remove typescript typings for @storybook/addon-knobs [#1339](https://github.com/storybooks/storybook/pull/1339) -- Remove typescript typings for @storybook/addon-links [#1342](https://github.com/storybooks/storybook/pull/1342) - -#### Dependency Upgrades - -- Updated babel-plugin-react-docgen version [#1526](https://github.com/storybooks/storybook/pull/1526) -- UPDATE everything (including eslint 4) [#1517](https://github.com/storybooks/storybook/pull/1517) -- Update remark-preset-lint-recommended to the latest version 🚀 [#1512](https://github.com/storybooks/storybook/pull/1512) -- Update remark-cli to the latest version 🚀 [#1498](https://github.com/storybooks/storybook/pull/1498) -- Remove upper bound on react-native peerDependency [#1424](https://github.com/storybooks/storybook/pull/1424) -- Bump `react-split-pane` version [#1495](https://github.com/storybooks/storybook/pull/1495) - -# 3.1.9 - -2017-July-16 - -#### Features - -- React fiber support [#1443](https://github.com/storybooks/storybook/pull/1443) - -#### Documentation - -- Refine docs about loading stories dynamically for react-native [#1420](https://github.com/storybooks/storybook/pull/1420) - -#### Bug Fixes - -- Verify that name is a string in addons/actions [#1415](https://github.com/storybooks/storybook/pull/1415) -- Knobs: fix label alignment [#1471](https://github.com/storybooks/storybook/pull/1471) -- Fix display of large components [#1237](https://github.com/storybooks/storybook/pull/1237) - -#### Dependency Upgrades - -- Dependency updates [#1439](https://github.com/storybooks/storybook/pull/1439) -- chore(package): update husky to version 0.14.3 [#1437](https://github.com/storybooks/storybook/pull/1437) -- Update danger to the latest version 🚀 [#1393](https://github.com/storybooks/storybook/pull/1393) -- Update lerna to the latest version 🚀 [#1423](https://github.com/storybooks/storybook/pull/1423) -- Pin gatsby version and upgrade gh-pages [#1462](https://github.com/storybooks/storybook/pull/1462) - -# 3.1.8 - -2017-July-06 - -#### Documentation - -- Updated addon knob readme. [#1406](https://github.com/storybooks/storybook/pull/1406) -- Add a FAQ entry for shared config with next [#1390](https://github.com/storybooks/storybook/pull/1390) -- Documented webpack customization example for typescript [#1386](https://github.com/storybooks/storybook/pull/1386) - -#### Maintenance - -- Removed empty array, since webpack 2 doesn't support them anymore. [#1381](https://github.com/storybooks/storybook/pull/1381) - -#### Dependency Upgrades - -- Support webpack 3.0.0 [#1410](https://github.com/storybooks/storybook/pull/1410) -- Update react inspector to fix #1385 [#1408](https://github.com/storybooks/storybook/pull/1408) - -# 3.1.7 - -2017-June-28 - -#### Bug Fixes - -- Exit storybook build non-zero on stats errors (e.g. errors in the transpilation pipeline) [#1372](https://github.com/storybooks/storybook/pull/1372) -- Fixed regression: CSS entries were not picked up for storybook pages (e.g. when using exract-text-webpack-plugin) [#1363](https://github.com/storybooks/storybook/pull/1363) - -#### Documentation - -- Document Storybook release process [#1348](https://github.com/storybooks/storybook/pull/1348) - -# 3.1.6 - -2017-June-26 - -#### Bug Fixes - -- Remove the `cacheDirectory` option from babel config [#1350](https://github.com/storybooks/storybook/pull/1350) -- websockets (ws) removed `socket.upgradeReq`, so use `req` instead [#1337](https://github.com/storybooks/storybook/pull/1337) -- Ensure we add the correct version of `react-dom` [#1349](https://github.com/storybooks/storybook/pull/1349) -- Addon Info: Fix invalid prop `node.type` supplied to 'Props' [#1351](https://github.com/storybooks/storybook/pull/1351) -- Addon Info: Omit empty inline info header [#1306](https://github.com/storybooks/storybook/pull/1306) -- Addon Actions: Use uuid for action IDs instead of Math.random (fixes #1109) [#1347](https://github.com/storybooks/storybook/pull/1347) - -#### Documentation - -- Fix welcome instructions to reflect current `getstorybook` [#1358](https://github.com/storybooks/storybook/pull/1358) -- Addon Info: Update README with configuration instructions [#1326](https://github.com/storybooks/storybook/pull/1326) - -#### Dependency Upgrades - -- Update lint-staged to the latest version 🚀 [#1315](https://github.com/storybooks/storybook/pull/1315) - -# 3.1.5 - -2017-June-22 - -#### Features - -- Added flow support to getstorybook upgrade [#1289](https://github.com/storybooks/storybook/pull/1289) -- Added support for the `haul` react-native packager [#1294](https://github.com/storybooks/storybook/pull/1294) - -#### Bug Fixes - -- Fixed addon knobs proptypes deserialization [#1290](https://github.com/storybooks/storybook/pull/1290) - -#### Documentation - -- Added search to docs [#1256](https://github.com/storybooks/storybook/pull/1256) -- snapshot testing inverse regex example documentation [#1317](https://github.com/storybooks/storybook/pull/1317) - -#### Maintenance - -- Refactored storybook component library [#1266](https://github.com/storybooks/storybook/pull/1266) -- Created CRA kitchen sink addons example [#1288](https://github.com/storybooks/storybook/pull/1288) -- Use a pack -> install technique to recreate local packages [#1332](https://github.com/storybooks/storybook/pull/1332) -- Import demo components from @storybook/react [#1303](https://github.com/storybooks/storybook/pull/1303) - -# 3.1.4 - -2017-June-15 - -#### Features - -- IMPROVE design of addon-events [#1249](https://github.com/storybooks/storybook/pull/1249) -- Add a `shallowSnapshot` option for storyshots `test` functions [#1232](https://github.com/storybooks/storybook/pull/1232) - -#### Bug Fixes - -- Fix app entry bug in RN gestorybook [#1280](https://github.com/storybooks/storybook/pull/1280) -- fix(addons/info): Cannot read property 'props' of undefined [#1258](https://github.com/storybooks/storybook/pull/1258) - -#### Documentation - -- Add versions plugin to docs [#1269](https://github.com/storybooks/storybook/pull/1269) - -# 3.1.3 - -2017-June-10 - -#### Bug Fixes - -- Fix `storybook-build` manager-head.html bug [#1248](https://github.com/storybooks/storybook/pull/1248) - -# 3.1.2 - -Minor features including a new "events" addon, as well as the usual bugfixes, cleanup, etc. - -2017-June-09 - -#### Features - -- Add small design update to addon info package [#1213](https://github.com/storybooks/storybook/pull/1213) -- Add display configuration options to info addon [#1157](https://github.com/storybooks/storybook/pull/1157) -- Add support for multiple webpack chunks in iframe [#1083](https://github.com/storybooks/storybook/pull/1083) -- Add events addon [#1130](https://github.com/storybooks/storybook/pull/1130) -- Allow including files just before manager.bundle.js [#1134](https://github.com/storybooks/storybook/pull/1134) - -#### Bug Fixes - -- Fixed knobs addon editing bug [#1233](https://github.com/storybooks/storybook/pull/1233) -- Fix bug in addons/graphql in reIndentQuery [#1207](https://github.com/storybooks/storybook/pull/1207) -- Marksy initialized with mtrcConf intead of marksyConf [#1205](https://github.com/storybooks/storybook/pull/1205) - -#### Documentation - -- Document stories not showing up on storybook UI until device connects [#1221](https://github.com/storybooks/storybook/pull/1221) -- Fixed references to storybook.js.org. [#1211](https://github.com/storybooks/storybook/pull/1211) -- Updated repository URL to address broken npm images [#1197](https://github.com/storybooks/storybook/pull/1197) - -#### Maintenance - -- Added a vanilla React Native example app. [#1202](https://github.com/storybooks/storybook/pull/1202) -- Move typings for @storybook/react to @types package [#1199](https://github.com/storybooks/storybook/pull/1199) -- Set ESlint rules more strict 🚑 [#911](https://github.com/storybooks/storybook/pull/911) - -#### Dependency Upgrades - -- Update babel docgen plugin to generate docs for React.createClass and createReactClass [#1206](https://github.com/storybooks/storybook/pull/1206) -- Update `marksy` dependecy due broken 1.1.0 version [#1204](https://github.com/storybooks/storybook/pull/1204) - -# 3.0.1 - -Minor bug fixes and documentation updates post 3.0.0 release. - -2017-June-06 - -#### Bug Fixes - -- Added error message for `addon-options` [#1194](https://github.com/storybooks/storybook/pull/1194) -- Fix(react-native) add missing `ws` dependency [#1174](https://github.com/storybooks/storybook/pull/1174) -- Fix terminal colors by reset console colors explicitly [#1184](https://github.com/storybooks/storybook/pull/1184) -- Fix addon panel layout styling [#1170](https://github.com/storybooks/storybook/pull/1170) -- ADD https import & remove tracking code remains [#1176](https://github.com/storybooks/storybook/pull/1176) -- Fix incorrect babel config file reading [#1156](https://github.com/storybooks/storybook/pull/1156) -- Fixed withKnobs definition. [#1164](https://github.com/storybooks/storybook/pull/1164) - -#### Documentation - -- Fixed typo in react-native browser instructions [#1189](https://github.com/storybooks/storybook/pull/1189) -- Add instruction for npm install with -D for development dependency [#1168](https://github.com/storybooks/storybook/pull/1168) -- Fix broken link for [addons] in README [#1167](https://github.com/storybooks/storybook/pull/1167) -- Refreshed logo in docs [#1149](https://github.com/storybooks/storybook/pull/1149) -- fix addon broken links in documentation [#1165](https://github.com/storybooks/storybook/pull/1165) -- start-storybook cli - expand commands descriptions [#1161](https://github.com/storybooks/storybook/pull/1161) -- Fix typo in codemod readme [#1158](https://github.com/storybooks/storybook/pull/1158) - -#### Dependency Upgrades - -- Replaced deprecated `markdown-to-react-components` with `marksy` [#1188](https://github.com/storybooks/storybook/pull/1188) - -# 3.0.0 - -Storybook 3.0 is our first fully community-driven release! Notable changes: - -- Moved from `@kadira` to `@storybooks` org across [github](https://github.com/storybooks/storybook/), [npm](https://www.npmjs.com/package/@storybook/react), [docs](https://storybook.js.org/) -- Upgraded to Webpack2! [#637](https://github.com/storybooks/storybook/pull/637) -- Switched to monorepo and overhauled package structure. [#749](https://github.com/storybooks/storybook/pull/749) [#1031](https://github.com/storybooks/storybook/pull/1031) -- Added configuration options to storybooks snapshot testing. [#1090](https://github.com/storybooks/storybook/pull/1090) -- Added `create-react-native-app` support. [#1117](https://github.com/storybooks/storybook/pull/1117) -- Added HTTPS support. [#735](https://github.com/storybooks/storybook/pull/735) - -2017-May-31 - -#### Features - -- Added help text to the react-native preview panel [#1142](https://github.com/storybooks/storybook/pull/1142) -- Added create-react-native-app support [#1117](https://github.com/storybooks/storybook/pull/1117) -- Fixed knobs-addon performance issues [#1039](https://github.com/storybooks/storybook/pull/1039) -- Added `snapshotWithOptions` to configure storyshots rendering options [#1090](https://github.com/storybooks/storybook/pull/1090) -- Added custom `test` function for storyshots [#1035](https://github.com/storybooks/storybook/pull/1035) -- Added typescript definition to addon notes [#989](https://github.com/storybooks/storybook/pull/989) -- Added HTTPS option for dev server [#735](https://github.com/storybooks/storybook/pull/735) - -#### Bug Fixes - -- Use strict equality in action logger [#1144](https://github.com/storybooks/storybook/pull/1144) -- FIX addon info and addon storyshots incompatibility [#1129](https://github.com/storybooks/storybook/pull/1129) -- FIX postcss options missing in default webpack config && UPDATE dependencies [#1087](https://github.com/storybooks/storybook/pull/1087) -- Fix CLI had a package version from storybook hardcoded - now queries npm registry [#1079](https://github.com/storybooks/storybook/pull/1079) -- Fix semi broken \_\_docgenInfo integration in addon info [#1030](https://github.com/storybooks/storybook/pull/1030) -- Fix: build-storybook no longer supports relative paths [#1058](https://github.com/storybooks/storybook/pull/1058) -- Fix for types `number` for addon knobs [#1001](https://github.com/storybooks/storybook/pull/1001) -- Fix webpack overriding && Add an example with local file dependencies [#965](https://github.com/storybooks/storybook/pull/965) - -#### Documentation - -- Add storybook-addon-intl to addon gallery [#1143](https://github.com/storybooks/storybook/pull/1143) -- 3.0.0 release notes && release notes automation [#1047](https://github.com/storybooks/storybook/pull/1047) -- 3.0.0 migration assistance : codemod, update installation and usage instructions [#1093](https://github.com/storybooks/storybook/pull/1093) -- Add ReactSVGPanZoom to examples list [#1139](https://github.com/storybooks/storybook/pull/1139) -- Show webpack 2 config example in docs: rules not loaders [#1137](https://github.com/storybooks/storybook/pull/1137) -- Merge docs repo into this repo: add /docs [#1131](https://github.com/storybooks/storybook/pull/1131) -- Change brand name from “React Storybook” to “Storybook” [#1044](https://github.com/storybooks/storybook/pull/1044) -- Updated issue triage guidelines [#1024](https://github.com/storybooks/storybook/pull/1024) - -#### Maintenance - -- Add typings for links add-on [#1154](https://github.com/storybooks/storybook/pull/1154) -- Add react-dom to the devDependency list for React Native projects [#1102](https://github.com/storybooks/storybook/pull/1102) -- Upgrade React Native to webpack 2 config [#1097](https://github.com/storybooks/storybook/pull/1097) -- Add unit tests for addon storyshots [#971](https://github.com/storybooks/storybook/pull/971) -- Deprecate builtin addons (links and actions) - no longer included by default [#1038](https://github.com/storybooks/storybook/pull/1038) -- change NPM organisation from kadira to storybook in code [#996](https://github.com/storybooks/storybook/pull/996) -- CHANGE folder structure && CHANGE package-names [#1031](https://github.com/storybooks/storybook/pull/1031) -- Add deprecation warnings when addons are required via main package [#1025](https://github.com/storybooks/storybook/pull/1025) -- Remove text transform uppercase for knob labels [#991](https://github.com/storybooks/storybook/pull/991) - -#### Dependency Upgrades - -
- -11 PRs - - -- Update lerna to the latest version 🚀 [#1101](https://github.com/storybooks/storybook/pull/1101) -- CHANGE to prop-types package for notes & test-cra [#1082](https://github.com/storybooks/storybook/pull/1082) -- update dependencies in cra-storybook [#1080](https://github.com/storybooks/storybook/pull/1080) -- Switch back to non-fork of react-inspector [#1026](https://github.com/storybooks/storybook/pull/1026) -- Dependency updates: webpack, babel, react [#1008](https://github.com/storybooks/storybook/pull/1008) -- Update jest to the latest version 🚀 [#998](https://github.com/storybooks/storybook/pull/998) -- Update lerna to the latest version 🚀 [#969](https://github.com/storybooks/storybook/pull/969) -- CHANGE to use react-split-view 0.1.63 over the fork [#956](https://github.com/storybooks/storybook/pull/956) -- Update lerna to the latest version 🚀 [#915](https://github.com/storybooks/storybook/pull/915) -- Use jest for unittesting - standardize unit testing epic [#904](https://github.com/storybooks/storybook/pull/904) -- Update dependencies to enable Greenkeeper 🌴 [#768](https://github.com/storybooks/storybook/pull/768) - -
- -#### Other - -
- -33 PRs - - -- Added an upgrade mode to getstorybook [#1146](https://github.com/storybooks/storybook/pull/1146) -- Update link to Storyshots addon [#1074](https://github.com/storybooks/storybook/pull/1074) -- Added error message for missing or invalid storyName [#747](https://github.com/storybooks/storybook/pull/747) -- Opened an Open Collective Account [#1065](https://github.com/storybooks/storybook/pull/1065) -- Add propTablesExclude option [#924](https://github.com/storybooks/storybook/pull/924) -- addon-info: make the info overlay be fixed [#914](https://github.com/storybooks/storybook/pull/914) -- Handle null elements in getData [#926](https://github.com/storybooks/storybook/pull/926) -- add description field from \_\_docgenInfo for prop table for info plugin [#929](https://github.com/storybooks/storybook/pull/929) -- \#959 add a max-height and center element with alignItems: center [#961](https://github.com/storybooks/storybook/pull/961) -- Switch to the only prepublish script [#903](https://github.com/storybooks/storybook/pull/903) -- PR review policy [#923](https://github.com/storybooks/storybook/pull/923) -- Add typescript definitions for getStorybook() [#753](https://github.com/storybooks/storybook/pull/753) -- Restore deep link for addon docs [#919](https://github.com/storybooks/storybook/pull/919) -- Fix default storybook webpack config [#922](https://github.com/storybooks/storybook/pull/922) -- Render the first story for a kind if no story selected. [#918](https://github.com/storybooks/storybook/pull/918) -- Update docs for monorepo [#913](https://github.com/storybooks/storybook/pull/913) -- Monorepo readme and contributing [#907](https://github.com/storybooks/storybook/pull/907) -- Add story kind regex [#906](https://github.com/storybooks/storybook/pull/906) -- Add examples [#897](https://github.com/storybooks/storybook/pull/897) -- Add missing repos [#882](https://github.com/storybooks/storybook/pull/882) -- Switch to monorepo [#749](https://github.com/storybooks/storybook/pull/749) -- extend devMiddlewareOptions with config.devServer [#723](https://github.com/storybooks/storybook/pull/723) -- Added meta IE=edge [#715](https://github.com/storybooks/storybook/pull/715) -- Replace String.includes with String.indexOf: cross-browsing support [#712](https://github.com/storybooks/storybook/pull/712) -- Issue Triage instructions [#748](https://github.com/storybooks/storybook/pull/748) -- Simple pull request template [#741](https://github.com/storybooks/storybook/pull/741) -- Make return type of StoryDecorator nullable [#680](https://github.com/storybooks/storybook/pull/680) -- Warn if story with a given name already exists [#670](https://github.com/storybooks/storybook/pull/670) -- Fix spelling mistake - "element form the story" to "element from the story" [#702](https://github.com/storybooks/storybook/pull/702) -- Remove broken react-button example [#699](https://github.com/storybooks/storybook/pull/699) -- Fixed spelling error. [#720](https://github.com/storybooks/storybook/pull/720) -- Cleaner error handling for storiesOf [#672](https://github.com/storybooks/storybook/pull/672) -- Update links to point to new organization [#721](https://github.com/storybooks/storybook/pull/721) - -
- -# v2.35.3 - -Allow customConfig to override devtool. [PR668](https://github.com/storybooks/react-storybook/pull/668) - -# v2.35.2 - -03-January-2017 - -Fixes issue [#601](https://github.com/storybooks/react-storybook/issues/601) where it throws error when introduce a propType with a hypen. Add a [fix](https://github.com/kadirahq/babel-plugin-react-docgen/pull/23) to [`babel-plugin-react-docgen`](https://github.com/kadirahq/babel-plugin-react-docgen) to fix this issue. - -This release comes with the updated `babel-plugin-react-docgen`. - -# v2.35.1 - -- Revert [PR653](https://github.com/storybooks/react-storybook/pull/653) where it's causing HMR to not working properly. - -# v2.35.0 - -18-December-2016 - -- Using file-loader to load all the extensions [PR653](https://github.com/storybooks/react-storybook/pull/653) -- Update css-loader dependency [PR648](https://github.com/storybooks/react-storybook/pull/648) -- Check if stories are loaded from Jest [PR644](https://github.com/storybooks/react-storybook/pull/644) - -# v2.34.0 - -05-December-2016 - -Open the express router for developers (middleware.js file). [PR435](https://github.com/storybooks/react-storybook/pull/435) - -# v2.33.1 - -01-December-2016 - -Update Typescript definition file for global addDecorator. [PR634](https://github.com/storybooks/react-storybook/pull/634) - -# v2.33.0 - -28-November-2016 - -Completely avoid re-rendering the preview iframe. [PR631](https://github.com/storybooks/react-storybook/pull/631) - -# v2.32.2 - -28-November-2016 - -Update postmsg channel module version [PR627](https://github.com/storybooks/react-storybook/pull/627) - -# v2.32.1 - -22-November-2016 - -Add support for react_perf comes with React 15.4.0. [PR623](https://github.com/storybooks/react-storybook/pull/623) - -# v2.32.0 - -Incorrect publish (error when running `npm publish`) - -# v2.31.0 - -20-November-2016 - -Add the react-storybook version to the build output. [PR621](https://github.com/storybooks/react-storybook/pull/621) - -# v2.30.1 - -17-November-2016 - -Update the postmsg channel module to fix issue [#555](https://github.com/storybooks/react-storybook/issues/555) with [PR611](https://github.com/storybooks/react-storybook/pull/611) - -# v2.30.0 - -16-November-2016 - -Update to the new Storybook UI which doesn't use Redux. - -# v2.29.7 - -11-November-2016 - -Update @kadira/storybook-ui to the latest. - -# v2.29.6 - -10-November-2016 - -Fix a typo in the story syntax error messages. [PR610](https://github.com/storybooks/react-storybook/pull/610) - -# v2.29.5 - -09-November-2016 - -Check if regex and regex.test is available before calling it. [PR608](https://github.com/storybooks/react-storybook/pull/608) - -# v2.29.3 - -08-November-2016 - -Update webpack-hot-middleware to version 2.13.2 to fix the issue [#543](https://github.com/storybooks/react-storybook/issues/543). - -# v2.29.3 - -03-November-2016 - -Fix a regression caused by v2.29.2. -There was a text called undefined listed always on the top of the preview. - -# v2.29.2 - -03-November-2016 - -Add various fixes. - -- Use webpack chunkhash to enable long-term caching. [PR597](https://github.com/storybooks/react-storybook/pull/597) -- Fixed json loader testing for when test is multiple. [PR598](https://github.com/storybooks/react-storybook/pull/598) -- Fix usage of custom favicon [PR592](https://github.com/storybooks/react-storybook/pull/592) -- Update postcss-loader to v1.1.0 [PR599](https://github.com/storybooks/react-storybook/pull/599) -- fix for `module.hot` is not available in a static build [PR600](https://github.com/storybooks/react-storybook/pull/600) - -# v2.29.1 - -03-November-2016 - -Update babel-plugin-react-docgen to v1.4.1 to fix HOC [issue](https://github.com/kadirahq/babel-plugin-react-docgen/issues/19) - -# v2.29.0 - -01-November-2016 - -Update babel-plugin-react-docgen to 1.4.0. -This will fix some of the compilation issues such as #580. - -# v2.28.1 - -28-October-2016 - -Remove preview decorator support. [PR583](https://github.com/storybooks/react-storybook/pull/583). - -# v2.28.0 - -28-October-2016 - -Add preview decorator support. [PR582](https://github.com/storybooks/react-storybook/pull/582). -This will help us bring storybook designer with some great power. - -# v2.27.0 - -27-October-2016 - -Add a few usability improvements to Storybook. - -- Display storybook version. [PR559](https://github.com/storybooks/react-storybook/pull/559) -- Make the storybooks cacheable. [PR578](https://github.com/storybooks/react-storybook/pull/578) -- Change the devtool to eval and remove the use of source maps. [PR577](https://github.com/storybooks/react-storybook/pull/577) -- Update `babel-preset-react-app` to the latest. [PR576](https://github.com/storybooks/react-storybook/pull/576) -- Ship `json-loader` by default. [PR575](https://github.com/storybooks/react-storybook/pull/575) - -# v2.26.0 - -24-October-2016 - -Get some new features from CRA. - -- Add jsx as a resolve extension [PR563](https://github.com/storybooks/react-storybook/pull/563) -- Allow to use postcss for CSS @imports [PR564](https://github.com/storybooks/react-storybook/pull/564) -- Use process.env as a proper object [PR565](https://github.com/storybooks/react-storybook/pull/565) - -# v2.25.1 - -23-October-2016 - -Add a potential fix to [558](https://github.com/storybooks/react-storybook/issues/558) by updating babel-plugin-react-docgen to the latest(v1.3.2). - -# v2.25.0 - -21-October-2016 - -Add react docgen info into React classes with the react-docgen babel plugin. [PR557](https://github.com/storybooks/react-storybook/pull/557). -With this: - -- We could get docgen info with any React component class using `ClassName.__docgenInfo`. -- From the global collection: `STORYBOOK_REACT_CLASSES` - -Additionally, added `yarn.lock`. - -# v2.24.1 - -19-October-2016 - -Do not show git command output. [PR554](https://github.com/storybooks/react-storybook/pull/554) - -# v2.24.0 - -07-October-2016 - -- Export git repository info to support custom tool integrations [PR536](https://github.com/storybooks/react-storybook/pull/536) - -# v2.23.0 - -06-October-2016 - -- Remove the experimental database addon from react-storybook [PR535](https://github.com/storybooks/react-storybook/pull/535) - -# v2.22.0 - -05-October-2016 - -Add some nice development experiment based on suggestion from Dan Abramov. - -- Set a color to the Storybook URL in the console. [PR533](https://github.com/storybooks/react-storybook/pull/533) -- Add better error message when there's no React element in the story. [PR534](https://github.com/storybooks/react-storybook/pull/534) - -# v2.21.0 - -05-October-2016 - -- Get the latest features from CRA including NODE_PATH support, public folder support and some other minor changes. [#468](https://github.com/storybooks/react-storybook/issues/468) -- Also bumped `@kadira/storybook-channel-postmsg` to `^1.0.3` - -# v2.20.1 - -28-September-2016 - -- Fix story kind order bug [PR499](https://github.com/storybooks/react-storybook/pull/499) -- Prefix config environment variables [PR503](https://github.com/storybooks/react-storybook/pull/503) - -# v2.20.0 - -26-September-2016 - -- Use postMessage channel [PR498](https://github.com/storybooks/react-storybook/pull/498) -- Support dynamic panel titles [PR497](https://github.com/storybooks/react-storybook/pull/497) - -# v2.19.0 - -26-September-2016 - -- Support layout options [PR494](https://github.com/storybooks/react-storybook/pull/494) -- Update Typescript definitions [PR491](https://github.com/storybooks/react-storybook/pull/491) and [PR493](https://github.com/storybooks/react-storybook/pull/493) - -# v2.18.1 - -23-September-2016 - -- Stop uglifyjs from mangling names [PR483](https://github.com/storybooks/react-storybook/pull/483) - -# v2.18.0 - -23-September-2016 - -- Remove `STORYBOOK_` prefix from config env [PR481](https://github.com/storybooks/react-storybook/pull/481) - -# v2.17.0 - -22-September-2016 - -- Add support for StoryShots. [PR479](https://github.com/storybooks/react-storybook/pull/479) -- Fix some typos: [PR477](https://github.com/storybooks/react-storybook/pull/477) & [PR478](https://github.com/storybooks/react-storybook/pull/478) - -# v2.16.1 - -21-September-2016 - -- Fix the 404 error for `addon-db.json` file [PR472](https://github.com/storybooks/react-storybook/pull/472) -- Serve/Bundle the storybook favicon [PR473](https://github.com/storybooks/react-storybook/pull/473) - -# v2.16.0 - -21-September-2016 - -- Move the babel config loading logic into a seperate file. [PR469](https://github.com/storybooks/react-storybook/pull/469) -- Update airbnd eslint rules to the latest. - -# v2.15.1 - -19-September-2016 - -Add a fix to webpack custom resolve.alias not working. [PR465](https://github.com/storybooks/react-storybook/pull/465) - -# v2.15.0 - -19-September-2016 - -- Use @kadira/storybook-addons as a resolve.alias. So, we can support addons for NPM2 too. [PR462](https://github.com/storybooks/react-storybook/pull/462) - -# v2.14.0 - -14-September-2016 - -- Watch missing NPM modules and force webpack rebuild. [PR446](https://github.com/storybooks/react-storybook/pull/446) -- Fix issue on error message hanging after even it solved. [PR447](https://github.com/storybooks/react-storybook/pull/447) -- Allow to reload if HMR goes crazy. [PR448](https://github.com/storybooks/react-storybook/pull/448) -- Add support to get custom env variables. [PR450](https://github.com/storybooks/react-storybook/pull/450) - -# v2.13.1 - -14-September-2016 - -- Fix 404 error when db file does not exist [PR449](https://github.com/storybooks/react-storybook/pull/449) - -# v2.13.0 - -9-September-2016 - -- Fix [#443](https://github.com/storybooks/react-storybook/issues/443) where the static version of Storybook doesn't like Safari. -- Update postcss-loader to 0.13.0. - -# v2.12.1 - -8-September-2016 - -- Parse static directory provided by env as a list. [PR436](https://github.com/storybooks/react-storybook/pull/436) - -# v2.12.0 - -8-September-2016 - -- Do not include addon register file on preview. [PR426](https://github.com/storybooks/react-storybook/pull/426) -- Update css-loader to version 0.25.0. [PR427](https://github.com/storybooks/react-storybook/pull/427) -- Get the head.html values for every page request. [PR432](https://github.com/storybooks/react-storybook/pull/432) - -# v2.11.0 - -4-September-2016 - -- Remove babel-polyfill since we don't use it. -- Update versions with the help from greenkeeper. [PR421](https://github.com/storybooks/react-storybook/pull/421) - -# v2.10.0 - -3-September-2016 - -- Adding airbnb-js-shims again. [PR419](https://github.com/storybooks/react-storybook/pull/419) - -# v2.9.1 - -2-September-2016. - -- Use the config directory to store the addon database file [PR418](https://github.com/storybooks/react-storybook/pull/418). - -# v2.9.0 - -2-September-2016. - -- Copy the addon-db.json file when building static storybooks [PR417](https://github.com/storybooks/react-storybook/pull/417). - -# v2.8.0 - -2-September-2016. - -- Update @kadira/storybook to get the clean query params feature. See [storybook-ui-PR37](https://github.com/kadirahq/storybook-ui/pull/37) - -# v2.7.0 - -1-September-2016 - -- Add addon database feature [PR415](https://github.com/storybooks/react-storybook/pull/415). - -# v2.6.1 - -31-August-2016 - -- Bring back HMR dev logs. [PR412](https://github.com/storybooks/react-storybook/pull/412). - -# v2.6.0 - -30-August-2016 - -- Allow start/build params from env variables. [PR413](https://github.com/storybooks/react-storybook/pull/413) - -# v2.5.2 - -29-August-2016 - -- Remove the use of babel-runtime/core-js modules. [PR410](https://github.com/storybooks/react-storybook/pull/410) - -# v2.5.1 - -24-August-2016 - -- Update @kadira/storybook-ui to v3.3.2 - -# v2.5.0 - -24-August-2016 - -- We are no longer shipping extra polyfills anymore. [PR402](https://github.com/storybooks/react-storybook/pull/402) - -# v2.4.2 - -24-August-2016 - -- Allow file-loader URLs to work on subpaths. [PR401](https://github.com/storybooks/react-storybook/pull/401) - -# v2.4.1 - -24-August-2016 - -- Bump @kadira/storybook ui to v3.3.1 to fix some UI related issues. - -# v2.4.0 - -23-August-2016 - -- Simplify the option to stop tracking. [PR399](https://github.com/storybooks/react-storybook/pull/399) -- Use JSON5 instead of CJSON to parse .babelrc. [PR398](https://github.com/storybooks/react-storybook/pull/398) -- Add webpack2 support by changing the use of OccurenceOrderPlugin. [PR397](https://github.com/storybooks/react-storybook/pull/397) -- Use @kadira/storybook-ui 2.3.0, which has new APIs to set URL for addons. - -# v2.3.0 - -16-August-2016 - -- Implement anonymous usage tracking. [PR384](https://github.com/storybooks/react-storybook/pull/384) - -# v2.2.3 - -15-August-2016 - -- Add a hash to media file's filename. Otherwise, it'll cause issues when there are multiple images with the same filename but in different directories. [PR380](https://github.com/storybooks/react-storybook/pull/380) - -# v2.2.2 - -10-August-2016 - -- Remove unused extract-text-webpack-plugin. This will add webpack2 support. [PR369](https://github.com/storybooks/react-storybook/pull/369). - -# v2.2.1 - -09-August-2016 - -- Use @kadira/storybook-channel modules. [#PR359](https://github.com/storybooks/react-storybook/pull/359). -- Update @kadira/storybook-ui to the latest. - -# v2.2.0 - -05-August-2016 - -This release bring some webpack config related optimizations and the NPM2 support. Here are the notable changes: - -- Use es6-shim directly into webpack config. [PR355](https://github.com/storybooks/react-storybook/pull/355) -- Use the default babel-config based on CRA's config. [PR354](https://github.com/storybooks/react-storybook/pull/354) -- Add NPM2 support. [PR356](https://github.com/storybooks/react-storybook/pull/356) -- Add autofixer defaults. [PR357](https://github.com/storybooks/react-storybook/pull/357) - -# v2.1.1 - -03-August-2016 - -Remove default webpack config for all config types. [PR348](https://github.com/storybooks/react-storybook/pull/348) - -Now we only use the Create React App based config if there's no custom webpack config. -This will fix issues like [#347](https://github.com/storybooks/react-storybook/issues/347). - -# v2.1.0 - -02-August-2016 - -Add support for the addon API. See [PR346](https://github.com/storybooks/react-storybook/pull/346). - -Here after we are using most of the features including actions,links as plugins. -So, this introduced a huge area to add customizations to Storybook. - -Unfortunately, as of this version, there are no docs for this feature. But, you can have a look at these addons: - -- actions addon (powers the action logger): [addon-actions](https://github.com/kadirahq/storybook-addon-actions) -- links addon (powers the linkTo feature): [addon-links](https://github.com/kadirahq/storybook-addon-links) - -Have a look at [here](https://github.com/storybooks/react-storybook/blob/master/src/server/config.js#L88) to how to configure addons. - -# v2.0.0 - -01-August-2016 - -This is the starting of the next major version of Storybook. This version is almost compatible with `v1.x.x` but defaults have been changes as discussed below. That's why we are starting out a new version. - -- Update defaults to match create-react-app. [PR342](https://github.com/storybooks/react-storybook/pull/342). Here are the notable changes: - - Add postcss based CSS loader. - - Add file-loader for images and common types. - - Add url-loader for shorter media files. - - Do not pre-build manager(storybook UI) bundle. - - Continue support for babel's stage-0 preset and add es2016 preset. -- Update @kadira/storybook-ui to v2.6.1 to remove some React warnings. - -# v1.41.0 - -- Fix nodejs require errors [#337](https://github.com/storybooks/react-storybook/pull/337). -- Add getStorybook method to client API [#332](https://github.com/storybooks/react-storybook/pull/332). - -# v1.40.0 - -- Fix duplicate decorator bug [#335](https://github.com/storybooks/react-storybook/pull/335). - -# v1.39.1 - -- Update babel packages [#325](https://github.com/storybooks/react-storybook/pull/325). -- Hide HMR info logs [#331](https://github.com/storybooks/react-storybook/pull/331). - -# v1.39.0 - -- Update @kadira/storybook-ui to get features from [v2.5.0](https://github.com/kadirahq/storybook-ui/blob/master/CHANGELOG.md#v250) and [v2.6.0](https://github.com/kadirahq/storybook-ui/blob/master/CHANGELOG.md#v260). - -# v1.38.3 - -- Add names for action and linkTo functions [#321](https://github.com/storybooks/react-storybook/pull/321). - -# v1.38.2 - -- Fix error in prepublish script [#319](https://github.com/storybooks/react-storybook/pull/319). - -# v1.38.1 - -- Improve Windows support by writing prepublish script using shelljs [#308](https://github.com/storybooks/react-storybook/pull/308). - -# v1.38.0 - -- v1.37.0 was a nightmare since it contains the npm-shrinkwrap.json. Fixed by removing it. See: [#306](https://github.com/storybooks/react-storybook/issues/306) and [#305](https://github.com/storybooks/react-storybook/pull/305). - -# v1.37.0 - -- Update @kadira/storybook-ui to 2.4.0 - -# v1.36.0 - -- Support watchOptions configuration. See: [PR287](https://github.com/storybooks/react-storybook/pull/287) - -# v1.35.2 - -- Add missing font-face to the ErrorDisplay's heading. - -# v1.35.1 - -- Fix issue related to bad error handling. See issue [#275](https://github.com/storybooks/react-storybook/issues/275): - -# v1.35.0 - -- Add fuzzy search powered search box and Redux DevTools support via [@kadira/storybook-ui@2.3.0](https://github.com/kadirahq/storybook-ui/blob/master/CHANGELOG.md#v230). - -# v1.34.1 - -- Don't always override NODE_ENV in build-storybook. [PR272](https://github.com/storybooks/react-storybook/pull/272) - -# v1.34.0 - -- Use storybook-ui v2.2.0 which puts shortcut state into the URL. - -# v1.33.0 - -- Introduce an [extension API](https://github.com/storybooks/react-storybook/blob/master/docs/extensions.md) for Storybook. See: [PR258](https://github.com/storybooks/react-storybook/pull/258) - -# v1.32.1 - -- Extend @kadira/storybook-ui provider from it's base Provider. - -# v1.32.0 - -- Use @kadira/storybook-ui as the manager UI with the implemented provider for React. See `client/manager` for more info. - -# v1.31.0 - -- Pass a `context` argument to stories [PR250](https://github.com/storybooks/react-storybook/pull/250) - -# v1.30.0 - -- Fuzzy search kinds [PR247](https://github.com/storybooks/react-storybook/pull/247) - -# v1.29.5 - -- Update dependency version to fix filter crash [PR246](https://github.com/storybooks/react-storybook/pull/246) - -# v1.29.4 - -- Protect index.html/iframe.html from being overwritten [PR243](https://github.com/storybooks/react-storybook/pull/243) - -# v1.29.3 - -- Update @kadira/storybook-core version [PR241](https://github.com/storybooks/react-storybook/pull/241) -- Add es6-shim by default [PR238](https://github.com/storybooks/react-storybook/pull/238) - -# v1.29.2 - -- Use url.resolve instead of path.join [PR240](https://github.com/storybooks/react-storybook/pull/240) - -# v1.29.1 - -- Copy missed manager.js.map file on static build [PR236](https://github.com/storybooks/react-storybook/pull/236) - -# v1.29.0 - -- Multiple static dirs (comma separated) [PR229](https://github.com/storybooks/react-storybook/pull/229) - -# v1.28.5 - -- Support ECMAScript stage-0 [PR228](https://github.com/storybooks/react-storybook/pull/228) to fix [Issue #227](https://github.com/storybooks/react-storybook/issues/227) - -# v1.28.4 - -- Support custom webpack public path for dev-server and static build started by [PR226](https://github.com/storybooks/react-storybook/pull/226) - -# v1.28.3 - -- Revert [PR226](https://github.com/storybooks/react-storybook/pull/226) - -# v1.28.2 - -- Support custom webpack publicPath [PR226](https://github.com/storybooks/react-storybook/pull/226) - -# v1.28.1 - -- Add charset meta tags to HTML heads [PR216](https://github.com/storybooks/react-storybook/pull/216) - -# v1.28.0 - -- Moved storybook serving code into a middleware to support more advanced use cases. -- Refactored dev server to use storybook middleware [PR211](https://github.com/storybooks/react-storybook/pull/211) - -# v1.27.0 - -- Move modules to storybook-core repo. [PR196](https://github.com/storybooks/react-storybook/pull/196) -- Add stack-source-map again only for Chrome to get better error stacks. -- Add ability to control the hostname. See [PR195](https://github.com/storybooks/react-storybook/pull/195) and [PR198](https://github.com/storybooks/react-storybook/pull/198) - -# v1.26.0 - -12-May-2016 - -- Ensure asset directory exists in the static-builder. - -# v1.25.0 - -11-May-2016 - -- Fix several publishing related issues. See: [#188](https://github.com/storybooks/react-storybook/pull/188). -- Fix babel extends issue. See: [PR185](https://github.com/storybooks/react-storybook/pull/185). -- Fix issue with removing a preset from users babelrc. - - Fixes: [#183](https://github.com/storybooks/react-storybook/issues/183). - - [PR184](https://github.com/storybooks/react-storybook/pull/184) -- Make left panel scrollable with keeping the filterbox always. See: [PR182](https://github.com/storybooks/react-storybook/pull/182). -- Add `qs` as a direct dependency as it's used in preview. - -# v1.24.0 - -10-May-2016 - -- Add a potential fix for the double scrollbar issue. See: [179](https://github.com/storybooks/react-storybook/issues/179). -- Add scrolling support to the left panel. Fixes [#177](https://github.com/storybooks/react-storybook/issues/177). -- Remove NODE_ENV=production flag. Fixes [#158](https://github.com/storybooks/react-storybook/issues/158) - -# v1.23.0 - -09-May-2016 - -- Add shortcuts to jump to previous and next stories. See [PR176](https://github.com/storybooks/react-storybook/pull/176) -- Fix loader concatenation bug specially when custom config doesn't have a loaders section. [PR173](https://github.com/storybooks/react-storybook/pull/173) - -# v1.22.1 - -06-May-2016 - -- Add a potential fix for [#167](https://github.com/storybooks/react-storybook/issues/167) - - basically, this moved back babel-packages required by webpack. - -# v1.22.0 - -06-May-2016 - -- Improve the static builder time. - -# v1.21.0 - -06-May-2016 - -- Add configType argument to custom config function. See: [PR169](https://github.com/storybooks/react-storybook/pull/169) -- Add the unicode version of the Keyboard Shortcut Icon. See: [PR170](https://github.com/storybooks/react-storybook/pull/170) - -# v1.20.0 - -05-May-2016 - -- Allow to configure webpack as the user wants. See [PR160](https://github.com/storybooks/react-storybook/pull/160) -- Add typescript typings support for the core API. See [PR157](https://github.com/storybooks/react-storybook/pull/157) -- Implement Mantra architecture and some new features including permalinks, full screen support. See: [PR165](https://github.com/storybooks/react-storybook/pull/165) -- Remove some typo in docs. See: [PR154](https://github.com/storybooks/react-storybook/pull/154) -- Move UI testing libraries to devDependencies. See: [PR153](https://github.com/storybooks/react-storybook/pull/153) - -# v1.19.0 - -27-April-2016 - -- Add airbnb-js-shims to client-side JS. See: [PR147](https://github.com/storybooks/react-storybook/pull/147) -- Remove self-closing div tag, which is invalid HTML. See: [PR148](https://github.com/storybooks/react-storybook/pull/148) -- Search for a .babelrc in the storybook config directory first, then the project root. See: [PR149](https://github.com/storybooks/react-storybook/pull/149) - -# v1.18.0 - -26-April-2016 - -- Link Storybook menu to the repo. See: [PR137](https://github.com/storybooks/react-storybook/pull/137) -- Implement keyboard shortcuts and fuzzy search. See: [PR141](https://github.com/storybooks/react-storybook/pull/141) - -# v1.17.2 - -25-April-2016 - -- Fix an error which only occurs on Firefox. See: [PR144](https://github.com/storybooks/react-storybook/pull/144) - -# v1.17.1 - -21-April-2016 - -- Fix a regression introduce by `v1.17.0`. See: [PR133](https://github.com/storybooks/react-storybook/pull/133) - -# v1.17.0 - -21-April-2016 - -- Check all the arguments passed to action for events. See: [PR132](https://github.com/storybooks/react-storybook/pull/132) - -# v1.16.1 - -21-April-2016 - -- Fix action logs highlighting issue, which comes as a regression of [PR126](https://github.com/storybooks/react-storybook/pull/126). - -# v1.16.0 - -20-April-2016 - -- Prevent re-rendering the preview iframe when there is an action. - - Related issue: [#116](https://github.com/storybooks/react-storybook/issues/116) - - Related PR: [PR126](https://github.com/storybooks/react-storybook/pull/126) - -# v1.15.0 - -20-April-2016 - -- Improve action logger UI and increase max log count to 10. See [PR123](https://github.com/storybooks/react-storybook/pull/123) - -# v1.14.0 - -19-April-2016 - -- Add syntax highlights to the logger. See: [PR118](https://github.com/storybooks/react-storybook/pull/118) - -# v1.13.0 - -- Add some UI test cases. See [PR103](https://github.com/storybooks/react-storybook/pull/103) -- Implement `.addDecorator()` API. See [PR115](https://github.com/storybooks/react-storybook/pull/115) -- Add code folding support. See [PR111](https://github.com/storybooks/react-storybook/pull/111) - -# v1.12.0 - -14-April-2016 - -- Add support for webpack module preLoaders. See: [PR107](https://github.com/storybooks/react-storybook/pull/107) - -# v1.11.0 - -13-April-2016 - -- Add support for React DevTools. See: [PR104](https://github.com/storybooks/react-storybook/pull/104) - -# v1.10.2 - -12-April-2016 - -Fix various issues related to static bundling. - -- Add custom head generation to static build as well. -- Use relative urls so, static sites can be host with paths (GH Pages) -- Identify SyntheticEvent using feature detection. UglifyJS mangal class names, so we can't use classnames to detect a SyntheticEvent in the static build. - -# v1.10.1 - -- Don't serve index.html in static directory as a site index. See [PR100](https://github.com/storybooks/react-storybook/pull/100) -- Use cjson for parsing .babelrc files (support comments). See [PR98](https://github.com/storybooks/react-storybook/pull/98) -- Remove the dist directory before running babel to avoid older code. See [PR101](https://github.com/storybooks/react-storybook/pull/101) - -# v1.10.0 - -- Add custom head support inside the iframe. See [PR77](https://github.com/storybooks/react-storybook/pull/77) -- Unmount components before rendering into DOM node. Fix: [#81](https://github.com/storybooks/react-storybook/issues/81) -- Add a static file builder. See [PR88](https://github.com/storybooks/react-storybook/pull/88) -- Fix search box's lineHeight to work with all the browsers. See: [PR94](https://github.com/storybooks/react-storybook/pull/94) -- Add the search box. See: [PR91](https://github.com/storybooks/react-storybook/pull/91). - -# v1.9.0 - -Add some minor improvements. - -- Avoid deprecated warning in Chrome Canary. See: [PR85](https://github.com/storybooks/react-storybook/pull/85) -- Fix the React Warning about CSS property. See: [PR84](https://github.com/storybooks/react-storybook/pull/84) -- Transition on latest logged action. See: [PR80](https://github.com/storybooks/react-storybook/pull/80) - -# v1.8.0 - -- Add story linking functionality. - - [Documentation](https://github.com/storybooks/react-storybook/blob/master/docs/api.md#linking-stories). - - Original feature request: [#50](https://github.com/storybooks/react-storybook/issues/50) - - Implementation: [PR86](https://github.com/storybooks/react-storybook/pull/86) - -# v1.7.0 - -- Add support to React v15.0.0. - -# v1.6.0 - -- Make scrollable layout. See: [PR](https://github.com/storybooks/react-storybook/pull/70) -- Add npm3 requirement to the `package.json`. -- Add `react` and `react-dom` to devDependencies. - -# v1.5.0 - -- Add support for most of the custom webpack configuration. See [PR64](https://github.com/storybooks/react-storybook/pull/64) - -# v1.4.0 - -- Add CLI option to specify the config dir. See [PR52](https://github.com/storybooks/react-storybook/pull/52). - -# v1.3.0 - -- Load the `.babelrc` manually. Fixed: [#41](https://github.com/storybooks/react-storybook/issues/41) -- Add a better contributing guide. See [CONTRIBUTING.md](https://github.com/storybooks/react-storybook/blob/master/CONTRIBUTING.md) -- Add a development utility `npm run dev` which watches "src" directory and run `npm run prepublish`. - -# v1.2.0 - -- Add a button to clear logs in the ActionLogger. This is requested in [PR21](https://github.com/storybooks/react-storybook/issues/21). -- Remove navigation list order hijacking. See [commit](https://github.com/storybooks/react-storybook/commit/166365fd38f51f79e69e028a1c11e2620eddcb99). -- Fix a typo in .gitignore. See [PR31](https://github.com/storybooks/react-storybook/pull/31). -- Add support for JSX. See [PR18](https://github.com/storybooks/react-storybook/pull/18). - -# v1.1.0 - -- v1.0.0 was a mistake and it contains very old code. That's why we had to do a 1.1.0 release. - -# v1.0.0 - -- Yeah! +Check the `docs` directory in this repo for more advanced setup guides and other info. diff --git a/app/react-native/src/bin/storybook-start.js b/app/react-native/src/bin/storybook-start.js index 95c6cea0ed32..42d2fe74e7a5 100644 --- a/app/react-native/src/bin/storybook-start.js +++ b/app/react-native/src/bin/storybook-start.js @@ -10,6 +10,7 @@ program .option('-h, --host ', 'host to listen on') .option('-p, --port ', 'port to listen on') .option('--haul ', 'use haul with config file') + .option('--platform ', 'build platform-specific build') .option('-s, --secured', 'whether server is running on https') .option('-c, --config-dir [dir-name]', 'storybook config directory') .option('-e, --environment [environment]', 'DEVELOPMENT/PRODUCTION environment for webpack') @@ -76,7 +77,8 @@ if (!program.skipPackager) { let cliCommand = 'node node_modules/react-native/local-cli/cli.js start'; if (program.haul) { - cliCommand = `node node_modules/.bin/haul start --config ${program.haul} --platform all`; + const platform = program.platform || 'all'; + cliCommand = `node node_modules/.bin/haul start --config ${program.haul} --platform ${platform}`; } // RN packager shelljs.exec( diff --git a/app/react-native/src/preview/components/OnDeviceUI/index.js b/app/react-native/src/preview/components/OnDeviceUI/index.js index aa4fd04f6083..516a41a05264 100644 --- a/app/react-native/src/preview/components/OnDeviceUI/index.js +++ b/app/react-native/src/preview/components/OnDeviceUI/index.js @@ -177,5 +177,9 @@ OnDeviceUI.propTypes = { emit: PropTypes.func.isRequired, removeListener: PropTypes.func.isRequired, }).isRequired, - url: PropTypes.string.isRequired, + url: PropTypes.string, +}; + +OnDeviceUI.defaultProps = { + url: '', }; diff --git a/app/react-native/src/preview/components/StoryView/index.js b/app/react-native/src/preview/components/StoryView/index.js index 6db708df54e8..f0d897929c6f 100644 --- a/app/react-native/src/preview/components/StoryView/index.js +++ b/app/react-native/src/preview/components/StoryView/index.js @@ -24,7 +24,7 @@ export default class StoryView extends Component { renderHelp() { return ( - {this.props.url ? ( + {this.props.url && this.props.url.length ? ( Please open the Storybook UI ( {this.props.url} @@ -58,5 +58,9 @@ StoryView.propTypes = { on: PropTypes.func.isRequired, removeListener: PropTypes.func.isRequired, }).isRequired, - url: PropTypes.string.isRequired, + url: PropTypes.string, +}; + +StoryView.defaultProps = { + url: '', }; diff --git a/app/react/README.md b/app/react/README.md index edf8681ef468..2db0821f4a21 100644 --- a/app/react/README.md +++ b/app/react/README.md @@ -1,11 +1,13 @@ # Storybook for React -[![Greenkeeper badge](https://badges.greenkeeper.io/storybooks/storybook.svg)](https://greenkeeper.io/) -[![Build Status](https://travis-ci.org/storybooks/storybook.svg?branch=master)](https://travis-ci.org/storybooks/storybook) +[![Build Status on CircleCI](https://circleci.com/gh/storybooks/storybook.svg?style=shield)](https://circleci.com/gh/storybooks/storybook) [![CodeFactor](https://www.codefactor.io/repository/github/storybooks/storybook/badge)](https://www.codefactor.io/repository/github/storybooks/storybook) [![Known Vulnerabilities](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847/badge.svg)](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847) -[![BCH compliance](https://bettercodehub.com/edge/badge/storybooks/storybook)](https://bettercodehub.com/results/storybooks/storybook) [![codecov](https://codecov.io/gh/storybooks/storybook/branch/master/graph/badge.svg)](https://codecov.io/gh/storybooks/storybook) -[![Storybook Slack](https://storybooks-slackin.herokuapp.com/badge.svg)](https://storybooks-slackin.herokuapp.com/) +[![BCH compliance](https://bettercodehub.com/edge/badge/storybooks/storybook)](https://bettercodehub.com/results/storybooks/storybook) [![codecov](https://codecov.io/gh/storybooks/storybook/branch/master/graph/badge.svg)](https://codecov.io/gh/storybooks/storybook) +[![Storybook Slack](https://now-examples-slackin-nqnzoygycp.now.sh/badge.svg)](https://now-examples-slackin-nqnzoygycp.now.sh/) +[![Backers on Open Collective](https://opencollective.com/storybook/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/storybook/sponsors/badge.svg)](#sponsors) + +* * * Storybook for React is a UI development environment for your React components. With it, you can visualize different states of your UI components and develop them interactively. diff --git a/app/react/package.json b/app/react/package.json index b60fee00853b..f9fc7aaea65d 100644 --- a/app/react/package.json +++ b/app/react/package.json @@ -51,7 +51,7 @@ "file-loader": "^0.11.2", "find-cache-dir": "^1.0.0", "glamor": "^2.20.40", - "glamorous": "^4.10.0", + "glamorous": "^4.11.0", "global": "^4.3.2", "html-webpack-plugin": "^2.30.1", "json-loader": "^0.5.7", diff --git a/app/vue/README.md b/app/vue/README.md index 6438e3179a24..ce0b83cbf595 100644 --- a/app/vue/README.md +++ b/app/vue/README.md @@ -1,6 +1,5 @@ # Storybook for Vue -[![Greenkeeper badge](https://badges.greenkeeper.io/storybooks/storybook.svg)](https://greenkeeper.io/) [![Build Status on CircleCI](https://circleci.com/gh/storybooks/storybook.svg?style=shield)](https://circleci.com/gh/storybooks/storybook) [![CodeFactor](https://www.codefactor.io/repository/github/storybooks/storybook/badge)](https://www.codefactor.io/repository/github/storybooks/storybook) [![Known Vulnerabilities](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847/badge.svg)](https://snyk.io/test/github/storybooks/storybook/8f36abfd6697e58cd76df3526b52e4b9dc894847) diff --git a/dependencies.yml b/dependencies.yml index bd6995784eac..5374bead1ba7 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -39,8 +39,13 @@ collectors: github_assignees: - Hypnosphi # create issues for new major versions -# - type: repo-issue -# versions: "Y.0.0" + - type: repo-issue + versions: "Y.0.0" + settings: + github_labels: + - dependencies:update + github_assignees: + - Hypnosphi - type: js-npm path: docs @@ -54,5 +59,10 @@ collectors: github_assignees: - Hypnosphi # create issues for new major versions -# - type: repo-issue -# versions: "Y.0.0" + - type: repo-issue + versions: "Y.0.0" + settings: + github_labels: + - dependencies:update + github_assignees: + - Hypnosphi diff --git a/docs/pages/basics/guide-react/index.md b/docs/pages/basics/guide-react/index.md index da950fc4f000..dd955c0dc844 100644 --- a/docs/pages/basics/guide-react/index.md +++ b/docs/pages/basics/guide-react/index.md @@ -31,7 +31,7 @@ npm i --save-dev @storybook/react ## Add react and react-dom -Make sure that you have `react` and `react-dom` in your dependencies as well because we list is as a peerDependency: +Make sure that you have `react` and `react-dom` in your dependencies as well because we list these as a peerDependency: ```sh npm i --save react react-dom diff --git a/docs/pages/basics/quick-start-guide/index.md b/docs/pages/basics/quick-start-guide/index.md index 1d067775639e..1eb1eaa771e4 100644 --- a/docs/pages/basics/quick-start-guide/index.md +++ b/docs/pages/basics/quick-start-guide/index.md @@ -11,6 +11,7 @@ cd my-project-directory npm i -g @storybook/cli getstorybook ``` +The `-g` global install is used to run our cli tool in your project directory to generate templates for your existing projects. To avoid the global install and start your project manually, take a look at our [Slow Start Guide](/basics/slow-start-guide/). This will configure your app for Storybook. After that, you can run your Storybook with: diff --git a/docs/pages/examples/_examples.yml b/docs/pages/examples/_examples.yml index 64247866060e..a57cc7a56a6b 100644 --- a/docs/pages/examples/_examples.yml +++ b/docs/pages/examples/_examples.yml @@ -25,6 +25,13 @@ atlassian: description: Atlassian's official UI library. demo: https://atlaskit.atlassian.com/components site: https://atlaskit.atlassian.com/ +wix: + thumbnail: ./thumbnails/wix.png + title: Wix Style React + description: Components that conform to Wix Style + source: https://github.com/wix/wix-style-react + demo: https://wix.github.io/wix-style-react/ + site: https://wix.com buffer: thumbnail: ./thumbnails/buffer.jpg title: Buffer Components diff --git a/docs/pages/examples/thumbnails/wix.png b/docs/pages/examples/thumbnails/wix.png new file mode 100644 index 000000000000..f0d351c03dd8 Binary files /dev/null and b/docs/pages/examples/thumbnails/wix.png differ diff --git a/examples/cra-kitchen-sink/.storybook/config.js b/examples/cra-kitchen-sink/.storybook/config.js index a90810903681..1ad0ed9875b6 100644 --- a/examples/cra-kitchen-sink/.storybook/config.js +++ b/examples/cra-kitchen-sink/.storybook/config.js @@ -1,5 +1,7 @@ import { configure, setAddon } from '@storybook/react'; import { setOptions } from '@storybook/addon-options'; + +// deprecated usage of infoAddon import infoAddon from '@storybook/addon-info'; setOptions({ @@ -9,16 +11,21 @@ setOptions({ showStoriesPanel: true, showAddonsPanel: true, showSearchBox: false, - addonsPanelInRight: true, + addonPanelInRight: true, sortStoriesByKind: false, hierarchySeparator: /\/|\./, }); +// deprecated usage of infoAddon setAddon(infoAddon); +// put welcome screen at the top of the list so it's the first one displayed +require('../src/stories/welcome'); + +// automatically import all story js files that end with *.stories.js +const req = require.context('../src/stories', true, /\.stories\.js$/) function loadStories() { - require('../src/stories/index'); - require('../src/stories/storybook-components'); + req.keys().forEach((filename) => req(filename)) } configure(loadStories, module); diff --git a/examples/cra-kitchen-sink/package.json b/examples/cra-kitchen-sink/package.json index ebb9c14cb708..47c25ea9b7f9 100644 --- a/examples/cra-kitchen-sink/package.json +++ b/examples/cra-kitchen-sink/package.json @@ -13,7 +13,7 @@ "eventemitter3": "^2.0.3", "format-json": "^1.0.3", "glamor": "^2.20.40", - "glamorous": "^4.10.0", + "glamorous": "^4.11.0", "global": "^4.3.2", "prop-types": "^15.6.0", "react": "^16.0.0", diff --git a/examples/cra-kitchen-sink/src/components/BaseButton.js b/examples/cra-kitchen-sink/src/components/BaseButton.js new file mode 100644 index 000000000000..37a8882dd69a --- /dev/null +++ b/examples/cra-kitchen-sink/src/components/BaseButton.js @@ -0,0 +1,25 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +/** BaseButton component description imported from comments inside the component file */ +const BaseButton = ({ disabled, label, onClick }) => ( + +); + +BaseButton.defaultProps = { + disabled: false, + onClick: () => {}, +}; + +BaseButton.propTypes = { + /** Boolean indicating whether the button should render as disabled */ + disabled: PropTypes.bool, + /** button label. */ + label: PropTypes.string.isRequired, + /** onClick handler */ + onClick: PropTypes.func, +}; + +export default BaseButton; diff --git a/examples/cra-kitchen-sink/src/components/DocgenButton.js b/examples/cra-kitchen-sink/src/components/DocgenButton.js index 898da18dd08b..bf327352abd1 100644 --- a/examples/cra-kitchen-sink/src/components/DocgenButton.js +++ b/examples/cra-kitchen-sink/src/components/DocgenButton.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -/** Button component description */ +/** DocgenButton component description imported from comments inside the component file */ const DocgenButton = ({ disabled, label, onClick }) => (
- AddonInfo.DocgenButton + Addon Info.Decorator

- DocgenButton + Use Info as story decorator

- Some Description + Info could be used as a global or local decorator as well.

@@ -194,37 +194,9 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = ` } > < - DocgenButton + BaseButton - - - - onClick - - - = - - - { - - clicked() - - } - - - - " - Docgen Button + Button " @@ -288,7 +260,7 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = ` } > " - DocgenButton + BaseButton " Component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- one - - - - - - - - - -
- two - - - - - - - - - -
- obj - - - - - - - - - -
- shape - - - - - - - - - -
- arrayOf - - - - - - - - - -
- msg - - - - - - - - - -
- enm - - - - - - - - - -
- union - - - - - - - - - -
@@ -633,7 +405,7 @@ exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = ` `; -exports[`Storyshots AddonInfo.FlowTypeButton FlowTypeButton 1`] = ` +exports[`Storyshots Addon Info.Markdown Displays Markdown in description 1`] = `
- Flow Typed Button + Button
- AddonInfo.FlowTypeButton + Addon Info.Markdown

- FlowTypeButton + Displays Markdown in description

-

- Some Description -

-
-
-

+

- Story Source -

-
+          
+            
+          
+

+ Maybe include a + + link + + to your project as well. +

+
+
+

+ Story Source +

+
                 <
-                FlowTypeButton
+                BaseButton
               
               
                 
@@ -879,7 +702,7 @@ exports[`Storyshots AddonInfo.FlowTypeButton FlowTypeButton 1`] = `
                         }
                       >
                         "
-                        Flow Typed Button
+                        Button
                         "
                       
                     
@@ -921,7 +744,7 @@ exports[`Storyshots AddonInfo.FlowTypeButton FlowTypeButton 1`] = `
               }
             >
               "
-              FlowTypeButton
+              BaseButton
               " Component
             
             
-                    
-                      unknown
-                    
+                    
                   
                   
+                
+                  
+                  
+                  
+                  
+                  
-                  
+ label + + + + yes + + - + +
- - unknown - + `; -exports[`Storyshots AddonInfo.ImportedPropsButton ImportedPropsButton 1`] = ` +exports[`Storyshots Addon Info.Options.header Shows or hides Info Addon header 1`] = ` + + + + +`; + +exports[`Storyshots Addon Info.Options.inline Inlines component inside story 1`] = ` +
+
+
+
+

+ Addon Info.Options.inline +

+

+ Inlines component inside story +

+
+
+
+
+ +
+
+
+
+

+ Component should be inlined between description and PropType table +

+
+
+

+ Story Source +

+
+          
+ + < + BaseButton + + + + + + label + + + = + - - -
+ " + Button + " + + + + + + + + /> + + + + +
+

+ Prop Types +

+
+

+ " + BaseButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + + - + + + { + + false + + } + + +
+ label + + + + yes + + - + +
+ onClick + + + + - + + + { + + onClick() + + } + + +
+
+
+ + + +`; + +exports[`Storyshots Addon Info.Options.propTables Shows additional component prop tables 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ Addon Info.Options.propTables +

+

+ Shows additional component prop tables +

+
+
+

+ There should be a prop table added for a component not included in the story +

+
+
+

+ Story Source +

+
+            
+ + < + BaseButton + + + + + + label + + + = + + + " + Button + " + + + + + + + + /> + +
+
+
+
+

+ Prop Types +

+
+

+ " + BaseButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + + - + + + { + + false + + } + + +
+ label + + + + yes + + - + +
+ onClick + + + + - + + + { + + onClick() + + } + + +
+
+
+

+ " + FlowTypeButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + unknown + + + - + + + { + + false + + } + + +
+ onClick + + + unknown + + + - + + + { + + onClick() + + } + + +
+
+
+
+
+
+
+`; + +exports[`Storyshots Addon Info.Options.propTablesExclude Exclude component from prop tables 1`] = ` +
+
+
+ + +
+
+ + Show Info + +
+ + × + +
+
+
+

+ Addon Info.Options.propTablesExclude +

+

+ Exclude component from prop tables +

+
+
+

+ This can exclude extraneous components from being displayed in prop tables. +

+
+
+

+ Story Source +

+
+            
+
+ + < + div + + + + > + +
+
+ + < + BaseButton + + + + + + label + + + = + + + " + Button + " + + + + + + + + /> + +
+
+ + < + FlowTypeButton + + + + + + label + + + = + + + " + Flow Typed Button + " + + + + + + + + /> + +
+
+ + </ + div + > + +
+
+
+
+
+

+ Prop Types +

+
+

+ " + BaseButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + + - + + + { + + false + + } + + +
+ label + + + + yes + + - + +
+ onClick + + + + - + + + { + + onClick() + + } + +
+
+
+
+
+
+
+`; + +exports[`Storyshots Addon Info.Options.source Shows or hides Info Addon source 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ Addon Info.Options.source +

+

+ Shows or hides Info Addon source +

+
+
+

+ The Info Addon source section should be hidden +

+
+
+

+ Prop Types +

+
+

+ " + BaseButton + " Component +

+ + + + + + + + + + + + + + + + + - + + { + + onClick() + + } + + + + +
+ property + + propType + + required + + default + + description +
- two + disabled - + + { + + false + + } + + +
+ label + + + + yes + @@ -1522,7 +2951,7 @@ exports[`Storyshots AddonInfo.ImportedPropsButton ImportedPropsButton 1`] = ` - obj + onClick - - - -
+
+
+
+
+
+
+
+`; + +exports[`Storyshots Addon Info.Options.styles Change info styles // I think this is broken or I am using it wrong? 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ Addon Info.Options.styles +

+

+ Change info styles // I think this is broken or I am using it wrong? +

+
+ +
+

+ Story Source +

+
+            
+ + < + BaseButton + + + + + + label + + + = + + + " + Button + " + + + + + + + + /> + +
+
+
+
+

+ Prop Types +

+
+

+ " + BaseButton + " Component +

+ + - - - - - - - - - + +
- shape - - - - - - - - - + -
- arrayOf - - - + - - - - + - - - - + + > + description +
- msg + disabled - - + + { + + false + + } + - enm + label - - + yes - union + onClick - - + + { + + onClick() + + } + `; -exports[`Storyshots AddonLink.Button First 1`] = ` - -`; - -exports[`Storyshots AddonLink.Button Second 1`] = ` - -`; - -exports[`Storyshots AddonLink.Href log 1`] = ` - - See action logger - -`; - -exports[`Storyshots AddonLink.Link First 1`] = ` - - Go to Second - -`; - -exports[`Storyshots AddonLink.Link Second 1`] = ` - - Go to First - -`; - -exports[`Storyshots AddonLink.Select First 1`] = ` - - Go back - -`; - -exports[`Storyshots AddonLink.Select Index 1`] = ` - -`; - -exports[`Storyshots AddonLink.Select Second 1`] = ` - - Go back - -`; - -exports[`Storyshots AddonLink.Select Third 1`] = ` - - Go back - -`; - -exports[`Storyshots App full app 1`] = ` -
-
- logo -

- Welcome to React -

-
-

- To get started, edit - - src/App.js - - and save to reload. -

-
-`; - -exports[`Storyshots Button addons composition 1`] = ` +exports[`Storyshots Addon Info.React Docgen Comments from Flow declarations 1`] = `
-
- click the - - - Show Info - - - label in top right for info about " - addons composition - " -
+
-
-

- Button -

-

- addons composition -

-
-
-

- see Notes panel for composition info -

-
-
-

- Story Source -

-
-            
-
- - < - div - - - - > - -
-
- -
-
- - click the - -
-
- - < - InfoButton - - - - /> - -
-
+
+

+ Addon Info.React Docgen +

+

+ Comments from Flow declarations +

+
+
+

+ Comments above the Flow declarations should be extracted from the React component file itself and rendered in the Info Addon prop table +

+
+
+

+ Story Source +

+
+            
- - label in top right for info about " - -
-
+ - - addons composition + < + FlowTypeButton + + + + + + onClick + + + = + + + { + + clicked() + + } + + + -
-
- - " + + + + label + + + = + + + " + Flow Typed Button + " + + + + -
-
+ - - </ - div - > - -
+ /> +
@@ -2181,12 +3668,122 @@ exports[`Storyshots Button addons composition 1`] = ` } > " - InfoButton + FlowTypeButton " Component - - No propTypes defined! - + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + unknown + + + - + + + { + + false + + } + + +
+ onClick + + + unknown + + + - + + + { + + onClick() + + } + + +
@@ -2195,74 +3792,7 @@ exports[`Storyshots Button addons composition 1`] = ` `; -exports[`Storyshots Button with knobs 1`] = ` -
-

- My name is Storyteller, I'm 70 years old, and my favorite fruit is apple. -

-

- My birthday is: - January 20, 2017 -

-

- I have - 2 - children: -

-
    -
  1. - Jane - , - 13 - years old -
  2. -
  3. - John - , - 8 - years old -
  4. -
-

- My wallet contains: $ - 12.50 -

-

- In my backpack, I have: -

-
    -
  • - Laptop -
  • -
  • - Book -
  • -
  • - Whiskey -
  • -
-

- Nice to meet you! -

-
-

- PS. My shirt pocket contains: -

-
  • - No items! -
  • -
    -`; - -exports[`Storyshots Button with new info 1`] = ` +exports[`Storyshots Addon Info.React Docgen Comments from PropType declarations 1`] = `
    - Use the - - info addon - - with its new painless API. + Comments above the PropType declarations should be extracted from the React component file itself and rendered in the Info Addon prop table

    @@ -2474,173 +3970,91 @@ exports[`Storyshots Button with new info 1`] = ` } } > -
    -
    - - < - Container - - - - > - -
    -
    - -
    -
    - - click the - -
    -
    - - < - InfoButton - - - - /> - -
    -
    - - label in top right for info about " - -
    -
    - - with new info - -
    -
    + - - " + < + DocgenButton + + + + + + onClick + + + = + + + { + + clicked() + + } + + + -
    -
    + + + label + + + = + + + " + Docgen Button + " + + + + + + + - - </ - Container - > - -
    + /> +
    @@ -2666,7 +4080,7 @@ exports[`Storyshots Button with new info 1`] = ` } > " - Container + DocgenButton " Component - propType - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
    + + required + + default + + description +
    + disabled + + + + - + + + { + + false + + } + + +
    + label + + + + yes + + - + +
    + onClick + + + + - + + + { + + onClick() + + } + + +
    + one + + + + - + + - + +
    + two + + + + - + + - + +
    + obj + + + + - + + - + +
    + shape + + + - required - - + - default - - + - description - + />
    - children + arrayOf - yes + - - isAmazing + msg - - { - - false - - } - + - - age + enm - - { - - { - - isOld - - : - - { - - false - - } - - , - - value - - : - - { - - 0 - - } - - } - - } - + - - title + union - - " - the best container ever - " - + -
    -
    -

    - " - InfoButton - " Component -

    - - No propTypes defined! - -
    @@ -2911,24 +4425,7 @@ exports[`Storyshots Button with new info 1`] = ` `; -exports[`Storyshots Button with notes 1`] = ` - -`; - -exports[`Storyshots Button with some emoji 1`] = ` - -`; - -exports[`Storyshots Button with some info 1`] = ` +exports[`Storyshots Addon Info.React Docgen Comments from component declaration 1`] = `
    -
    - click the - - - Show Info - - - label in top right for info about " - with some info - " - -
    + Button +
    - Button + Addon Info.React Docgen

    - with some info + Comments from component declaration

    - Use the - - info addon - - with its painful API. + Comments above the component declaration should be extracted from the React component file itself and rendered below the Info Addon heading

    @@ -3140,157 +4603,91 @@ exports[`Storyshots Button with some info 1`] = ` } } > -
    -
    - - < - Container - - - - > - -
    -
    - - click the - -
    -
    - - < - InfoButton - - - - /> - -
    -
    - - label in top right for info about " - -
    -
    + - - with some info + < + BaseButton + + + + + + onClick + + + = + + + { + + clicked() + + } + + + -
    -
    - - " + + + + label + + + = + + + " + Button + " + + + + -
    -
    + - - </ - Container - > - -
    + /> +
    @@ -3316,7 +4713,7 @@ exports[`Storyshots Button with some info 1`] = ` } > " - Container + BaseButton " Component - children - - - - - - -
    - - - yes - - - - -
    - isAmazing + disabled - age + label - - + yes - - { - - { - - isOld - - : - - { - - false - - } - - , - - value - - : - - { - - 0 - - } - - } - - } - + - - title + onClick - + { + + onClick() + } - > - " - the best container ever - "
    -
    -

    - " - InfoButton - " Component -

    - - No propTypes defined! - -
    `; - -exports[`Storyshots Button with text 1`] = ` - -`; - -exports[`Storyshots Cells.Molecules.Atoms with some emoji2 1`] = ` - -`; - -exports[`Storyshots Cells.Molecules.Atoms with text2 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules with some emoji 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules with text 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules.Atoms/simple with some emoji 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules.Atoms/simple with text 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules/Atoms.more with some emoji2 1`] = ` - -`; - -exports[`Storyshots Cells/Molecules/Atoms.more with text2 1`] = ` - -`; - -exports[`Storyshots Some really long story kind description with text 1`] = ` -
    -
    - -
    -
    -`; - -exports[`Storyshots Welcome to Storybook 1`] = ` -
    -

    - Welcome to storybook -

    -

    - This is a UI component dev environment for your app. -

    -

    - We've added some basic stories inside the - - - src/stories - - - directory. -
    - A story is a single state of one or more UI components. You can have as many stories as you want. -
    - (Basically a story is like a visual test case.) -

    -

    - See these sample - - - stories - - - for a component called - - - Button - - . -

    -

    - Just like that, you can add your own components as stories. -
    - You can also edit those components and see changes right away. -
    - (Try editing the - - Button - - stories located at - - src/stories/index.js - - .) -

    -

    - Usually we create stories with smaller UI components in the app. -
    - Have a look at the - - - Writing Stories - - - section in our documentation. -

    -

    - - NOTE: - -
    - Have a look at the - - - .storybook/webpack.config.js - - - to add webpack loaders and plugins you are using in this project. -

    -
    -`; - -exports[`Storyshots WithEvents Logger 1`] = ` -
    -

    - Logger -

    -
    -
    -`; - -exports[`Storyshots component.Button first 1`] = ` - -`; - -exports[`Storyshots component.Button second 1`] = ` - -`; - -exports[`Storyshots component.base.Link first 1`] = ` - - first link - -`; - -exports[`Storyshots component.base.Link second 1`] = ` - - second link - -`; - -exports[`Storyshots component.base.Span first 1`] = ` - - first span - -`; - -exports[`Storyshots component.base.Span second 1`] = ` - - second span - -`; - -exports[`Storyshots component.common.Div first 1`] = ` -
    - first div -
    -`; - -exports[`Storyshots component.common.Div second 1`] = ` -
    - second div -
    -`; - -exports[`Storyshots component.common.Table first 1`] = ` - - - - -
    - first table -
    -`; - -exports[`Storyshots component.common.Table second 1`] = ` - - - - -
    - first table -
    -`; - -exports[`Storyshots withNotes with a button and some emoji 1`] = ` - -`; - -exports[`Storyshots withNotes with old API 1`] = ` - -`; - -exports[`Storyshots withNotes with some emoji 1`] = ` -

    - 🤔😳😯😮 -

    -`; - -exports[`Storyshots withNotes with some text 1`] = ` -
    - Hello guys -
    -`; diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-knobs.stories.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-knobs.stories.storyshot new file mode 100644 index 000000000000..c009dcd4f368 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-knobs.stories.storyshot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Addon Knobs.withKnobs triggers actions via button 1`] = ` +
    +

    + Hit the knob load button and it should trigger an async load after a short delay +

    +

    + No items loaded +

    +
    +`; + +exports[`Storyshots Addon Knobs.withKnobs tweaks static values 1`] = ` +
    +

    + My name is Storyteller, I'm 70 years old, and my favorite fruit is apple. +

    +

    + My birthday is: + January 20, 2017 +

    +

    + My wallet contains: $ + 12.50 +

    +

    + In my backpack, I have: +

    +
      +
    • + Laptop +
    • +
    • + Book +
    • +
    • + Whiskey +
    • +
    +

    + Nice to meet you! +

    +
    +

    + PS. My shirt pocket contains: +

    +
    +`; + +exports[`Storyshots Addon Knobs.withKnobsOptions triggers actions via button with debounce delay 1`] = ` +
    +

    + Hit the knob load button and it should trigger an async load after a short delay +

    +

    + No items loaded +

    +
    +`; + +exports[`Storyshots Addon Knobs.withKnobsOptions tweaks static values with debounce delay 1`] = ` +
    +

    + If you are encountering performance issues with state updating too often, use withKnobsOptions to debounce changes. +

    +

    + My name is Storyteller, I'm 70 years old, and my favorite fruit is apple. +

    +

    + My birthday is: + January 20, 2017 +

    +

    + My wallet contains: $ + 12.50 +

    +

    + In my backpack, I have: +

    +
      +
    • + Laptop +
    • +
    • + Book +
    • +
    • + Whiskey +
    • +
    +

    + Nice to meet you! +

    +
    +

    + PS. My shirt pocket contains: +

    +
    +`; diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-notes.stories.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-notes.stories.storyshot new file mode 100644 index 000000000000..7cc460716147 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/addon-notes.stories.storyshot @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Addon Notes using deprecated API 1`] = ` + +`; + +exports[`Storyshots Addon Notes withNotes 1`] = ` + +`; diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot new file mode 100644 index 000000000000..6a8cc30228d7 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot @@ -0,0 +1,1792 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots App full app 1`] = ` +
    +
    + logo +

    + Welcome to React +

    +
    +

    + To get started, edit + + src/App.js + + and save to reload. +

    +
    +`; + +exports[`Storyshots Button addons composition 1`] = ` +
    +
    +
    + click the + + + Show Info + + + label in top right for info about " + addons composition + " +
    +
    + + Show Info + +
    + + × + +
    +
    +
    +

    + Button +

    +

    + addons composition +

    +
    +
    +

    + see Notes panel for composition info +

    +
    +
    +

    + Story Source +

    +
    +            
    +
    + + < + div + + + + > + +
    +
    + +
    +
    + + click the + +
    +
    + + < + InfoButton + + + + /> + +
    +
    + + label in top right for info about " + +
    +
    + + addons composition + +
    +
    + + " + +
    +
    + + </ + div + > + +
    +
    +
    +
    +
    +

    + Prop Types +

    +
    +

    + " + InfoButton + " Component +

    + + No propTypes defined! + +
    +
    +
    +
    +
    +
    +`; + +exports[`Storyshots Button with new info 1`] = ` +
    +
    +
    + click the + + + Show Info + + + label in top right for info about " + with new info + " + +
    +
    + + Show Info + +
    + + × + +
    +
    +
    +

    + Button +

    +

    + with new info +

    +
    +
    +

    + Use the + + info addon + + with its new painless API. +

    +
    +
    +

    + Story Source +

    +
    +            
    +
    + + < + Container + + + + > + +
    +
    + +
    +
    + + click the + +
    +
    + + < + InfoButton + + + + /> + +
    +
    + + label in top right for info about " + +
    +
    + + with new info + +
    +
    + + " + +
    +
    + + </ + Container + > + +
    +
    +
    +
    +
    +

    + Prop Types +

    +
    +

    + " + Container + " Component +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + property + + propType + + required + + default + + description +
    + children + + + + yes + + - + +
    + isAmazing + + + + - + + + { + + false + + } + + +
    + age + + + + - + + + { + + { + + isOld + + : + + { + + false + + } + + , + + value + + : + + { + + 0 + + } + + } + + } + + +
    + title + + + + - + + + " + the best container ever + " + + +
    +
    +
    +

    + " + InfoButton + " Component +

    + + No propTypes defined! + +
    +
    +
    +
    +
    +
    +`; + +exports[`Storyshots Button with notes 1`] = ` + +`; + +exports[`Storyshots Button with some emoji 1`] = ` + +`; + +exports[`Storyshots Button with some info 1`] = ` +
    +
    +
    + click the + + + Show Info + + + label in top right for info about " + with some info + " + +
    +
    + + Show Info + +
    + + × + +
    +
    +
    +

    + Button +

    +

    + with some info +

    +
    +
    +

    + Use the + + info addon + + with its painful API. +

    +
    +
    +

    + Story Source +

    +
    +            
    +
    + + < + Container + + + + > + +
    +
    + + click the + +
    +
    + + < + InfoButton + + + + /> + +
    +
    + + label in top right for info about " + +
    +
    + + with some info + +
    +
    + + " + +
    +
    + + </ + Container + > + +
    +
    +
    +
    +
    +

    + Prop Types +

    +
    +

    + " + Container + " Component +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + property + + propType + + required + + default + + description +
    + children + + + + yes + + - + +
    + isAmazing + + + + - + + + { + + false + + } + + +
    + age + + + + - + + + { + + { + + isOld + + : + + { + + false + + } + + , + + value + + : + + { + + 0 + + } + + } + + } + + +
    + title + + + + - + + + " + the best container ever + " + + +
    +
    +
    +

    + " + InfoButton + " Component +

    + + No propTypes defined! + +
    +
    +
    +
    +
    +
    +`; + +exports[`Storyshots Button with text 1`] = ` + +`; + +exports[`Storyshots Some really long story kind description with text 1`] = ` +
    +
    + +
    +
    +`; + +exports[`Storyshots WithEvents Logger 1`] = ` +
    +

    + Logger +

    +
    +
    +`; diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/storybook-components.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/storybook-components.stories.storyshot similarity index 100% rename from examples/cra-kitchen-sink/src/stories/__snapshots__/storybook-components.storyshot rename to examples/cra-kitchen-sink/src/stories/__snapshots__/storybook-components.stories.storyshot diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/welcome.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/welcome.storyshot new file mode 100644 index 000000000000..bc6abe86a6e7 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/welcome.storyshot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Welcome to Storybook 1`] = ` +
    +

    + Welcome to storybook +

    +

    + This is a UI component dev environment for your app. +

    +

    + We've added some basic stories inside the + + + src/stories + + + directory. +
    + A story is a single state of one or more UI components. You can have as many stories as you want. +
    + (Basically a story is like a visual test case.) +

    +

    + See these sample + + + stories + + + for a component called + + + Button + + . +

    +

    + Just like that, you can add your own components as stories. +
    + You can also edit those components and see changes right away. +
    + (Try editing the + + Button + + stories located at + + src/stories/index.js + + .) +

    +

    + Usually we create stories with smaller UI components in the app. +
    + Have a look at the + + + Writing Stories + + + section in our documentation. +

    +

    + + NOTE: + +
    + Have a look at the + + + .storybook/webpack.config.js + + + to add webpack loaders and plugins you are using in this project. +

    +
    +`; diff --git a/examples/cra-kitchen-sink/src/stories/addon-info.stories.js b/examples/cra-kitchen-sink/src/stories/addon-info.stories.js new file mode 100644 index 000000000000..0aec884b6d87 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/addon-info.stories.js @@ -0,0 +1,102 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { withInfo } from '@storybook/addon-info'; +import { action } from '@storybook/addon-actions'; + +import DocgenButton from '../components/DocgenButton'; +import FlowTypeButton from '../components/FlowTypeButton'; +import BaseButton from '../components/BaseButton'; + +storiesOf('Addon Info.React Docgen', module) + .add( + 'Comments from PropType declarations', + withInfo( + 'Comments above the PropType declarations should be extracted from the React component file itself and rendered in the Info Addon prop table' + )(() => ) + ) + .add( + 'Comments from Flow declarations', + withInfo( + 'Comments above the Flow declarations should be extracted from the React component file itself and rendered in the Info Addon prop table' + )(() => ) + ) + .add( + 'Comments from component declaration', + withInfo( + 'Comments above the component declaration should be extracted from the React component file itself and rendered below the Info Addon heading' + )(() => ) + ); + +const markdownDescription = ` +#### You can use markdown in your withInfo() description. + +Sometimes you might want to manually include some code examples: +~~~js +const codeblock = []; +~~~ + +Maybe include a [link](http://storybook.js.org) to your project as well. +`; + +storiesOf('Addon Info.Markdown', module).add( + 'Displays Markdown in description', + withInfo(markdownDescription)(() => ) +); + +storiesOf('Addon Info.Options.inline', module).add( + 'Inlines component inside story', + withInfo({ + text: 'Component should be inlined between description and PropType table', + inline: true, // Displays info inline vs click button to view + })(() => ) +); + +storiesOf('Addon Info.Options.header', module).add( + 'Shows or hides Info Addon header', + withInfo({ + text: 'The Info Addon header should be hidden', + header: false, // Toggles display of header with component name and description + })(() => ) +); + +storiesOf('Addon Info.Options.source', module).add( + 'Shows or hides Info Addon source', + withInfo({ + text: 'The Info Addon source section should be hidden', + source: false, // Displays the source of story Component + })(() => ) +); + +storiesOf('Addon Info.Options.propTables', module).add( + 'Shows additional component prop tables', + withInfo({ + text: 'There should be a prop table added for a component not included in the story', + propTables: [FlowTypeButton], + })(() => ) +); + +storiesOf('Addon Info.Options.propTablesExclude', module).add( + 'Exclude component from prop tables', + withInfo({ + text: 'This can exclude extraneous components from being displayed in prop tables.', + propTablesExclude: [FlowTypeButton], + })(() => ( +
    + + +
    + )) +); + +storiesOf('Addon Info.Options.styles', module).add( + 'Change info styles // I think this is broken or I am using it wrong?', + withInfo({ + styles: { backgroundColor: 'blue' }, + })(() => ) +); + +storiesOf('Addon Info.Decorator', module) + .addDecorator((story, context) => + withInfo('Info could be used as a global or local decorator as well.')(story)(context) + ) + .add('Use Info as story decorator', () => ); diff --git a/examples/cra-kitchen-sink/src/stories/addon-knobs.stories.js b/examples/cra-kitchen-sink/src/stories/addon-knobs.stories.js new file mode 100644 index 000000000000..ce2b900e8234 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/addon-knobs.stories.js @@ -0,0 +1,155 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; + +import { + withKnobs, + withKnobsOptions, + text, + number, + boolean, + color, + select, + array, + date, + button, + object, +} from '@storybook/addon-knobs/react'; + +class AsyncItemLoader extends React.Component { + constructor() { + super(); + this.state = { items: [] }; + } + + handleLoadItems() { + this.setState({ + isLoading: true, + items: [], + }); + setTimeout(() => this.setState({ items: ['pencil', 'pen', 'eraser'], isLoading: false }), 1500); + } + + render() { + // this existing example seems like a react anti-pattern? + // perhaps for testing purposes only? + button('Load the items', () => this.handleLoadItems()); + + const { isLoading, items } = this.state; + + if (isLoading) { + return

    Loading data

    ; + } else if (!items.length) { + return

    No items loaded

    ; + } + return
      {items.map(i =>
    • {i}
    • )}
    ; + } +} + +storiesOf('Addon Knobs.withKnobs', module) + .addDecorator(withKnobs) + .add('tweaks static values', () => { + const name = text('Name', 'Storyteller'); + const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 }); + const fruits = { + apple: 'Apple', + banana: 'Banana', + cherry: 'Cherry', + }; + const fruit = select('Fruit', fruits, 'apple'); + const dollars = number('Dollars', 12.5); + + const backgroundColor = color('background', '#ffff00'); + const items = array('Items', ['Laptop', 'Book', 'Whiskey']); + const otherStyles = object('Styles', { + border: '3px solid #ff00ff', + padding: '10px', + }); + const nice = boolean('Nice', true); + + // NOTE: the default value must not change - e.g., do not do date('Label', new Date()) or date('Label') + const defaultBirthday = new Date('Jan 20 2017'); + const birthday = date('Birthday', defaultBirthday); + + const intro = `My name is ${name}, I'm ${age} years old, and my favorite fruit is ${fruit}.`; + const style = { backgroundColor, ...otherStyles }; + const salutation = nice ? 'Nice to meet you!' : 'Leave me alone!'; + const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; + + return ( +
    +

    {intro}

    +

    My birthday is: {new Date(birthday).toLocaleDateString('en-US', dateOptions)}

    +

    My wallet contains: ${dollars.toFixed(2)}

    +

    In my backpack, I have:

    +
      {items.map(item =>
    • {item}
    • )}
    +

    {salutation}

    +
    +

    PS. My shirt pocket contains:

    +
    + ); + }) + .add('triggers actions via button', () => ( +
    +

    Hit the knob load button and it should trigger an async load after a short delay

    + +
    + )); + +storiesOf('Addon Knobs.withKnobsOptions', module) + .addDecorator( + withKnobsOptions({ + debounce: { wait: 100, leading: boolean }, // Same as lodash debounce. + timestamps: true, // Doesn't emit events while user is typing. + }) + ) + .add('tweaks static values with debounce delay', () => { + const name = text('Name', 'Storyteller'); + const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 }); + const fruits = { + apple: 'Apple', + banana: 'Banana', + cherry: 'Cherry', + }; + const fruit = select('Fruit', fruits, 'apple'); + const dollars = number('Dollars', 12.5); + + const backgroundColor = color('background', '#ffff00'); + const items = array('Items', ['Laptop', 'Book', 'Whiskey']); + const otherStyles = object('Styles', { + border: '3px solid #ff00ff', + padding: '10px', + }); + const nice = boolean('Nice', true); + + // NOTE: the default value must not change - e.g., do not do date('Label', new Date()) or date('Label') + const defaultBirthday = new Date('Jan 20 2017'); + const birthday = date('Birthday', defaultBirthday); + + const intro = `My name is ${name}, I'm ${age} years old, and my favorite fruit is ${fruit}.`; + const style = { backgroundColor, ...otherStyles }; + const salutation = nice ? 'Nice to meet you!' : 'Leave me alone!'; + const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; + + return ( +
    +

    + If you are encountering performance issues with state updating too often, use + withKnobsOptions to debounce changes. +

    +

    {intro}

    +

    My birthday is: {new Date(birthday).toLocaleDateString('en-US', dateOptions)}

    +

    My wallet contains: ${dollars.toFixed(2)}

    +

    In my backpack, I have:

    +
      {items.map(item =>
    • {item}
    • )}
    +

    {salutation}

    +
    +

    PS. My shirt pocket contains:

    +
    + ); + }) + .add('triggers actions via button with debounce delay', () => ( +
    +

    Hit the knob load button and it should trigger an async load after a short delay

    + +
    + )); diff --git a/examples/cra-kitchen-sink/src/stories/addon-notes.stories.js b/examples/cra-kitchen-sink/src/stories/addon-notes.stories.js new file mode 100644 index 000000000000..e27c7998de91 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/addon-notes.stories.js @@ -0,0 +1,19 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; + +import { withNotes, WithNotes } from '@storybook/addon-notes'; +import { action } from '@storybook/addon-actions'; +import BaseButton from '../components/BaseButton'; + +storiesOf('Addon Notes', module) + .add( + 'withNotes', + withNotes( + 'This is the notes for a button. This is helpful for adding details about a story in a separate panel.' + )(() => ) + ) + .add('using deprecated API', () => ( + + + + )); diff --git a/examples/cra-kitchen-sink/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js index 5d9983037f48..a40676394ae8 100644 --- a/examples/cra-kitchen-sink/src/stories/index.js +++ b/examples/cra-kitchen-sink/src/stories/index.js @@ -1,377 +1,377 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import EventEmiter from 'eventemitter3'; - -import { storiesOf } from '@storybook/react'; -import { setOptions } from '@storybook/addon-options'; -import { action } from '@storybook/addon-actions'; -import { withNotes, WithNotes } from '@storybook/addon-notes'; -import { LinkTo, linkTo, hrefTo } from '@storybook/addon-links'; -import WithEvents from '@storybook/addon-events'; -import { - withKnobs, - text, - number, - boolean, - color, - select, - array, - date, - button, - object, -} from '@storybook/addon-knobs/react'; -import centered from '@storybook/addon-centered'; -import { withInfo } from '@storybook/addon-info'; - -import { Button, Welcome } from '@storybook/react/demo'; - -import App from '../App'; -import Logger from './Logger'; -import Container from './Container'; -import DocgenButton from '../components/DocgenButton'; -import FlowTypeButton from '../components/FlowTypeButton'; -import ImportedPropsButton from '../components/ImportedPropsButton'; - -const EVENTS = { - TEST_EVENT_1: 'test-event-1', - TEST_EVENT_2: 'test-event-2', - TEST_EVENT_3: 'test-event-3', - TEST_EVENT_4: 'test-event-4', -}; - -const emiter = new EventEmiter(); -const emit = emiter.emit.bind(emiter); - -storiesOf('Welcome', module).add('to Storybook', () => ); - -const InfoButton = () => ( - - {' '} - Show Info{' '} - -); - -class AsyncItemLoader extends React.Component { - constructor() { - super(); - this.state = { items: [] }; - } - - loadItems() { - setTimeout(() => this.setState({ items: ['pencil', 'pen', 'eraser'] }), 1500); - } - - render() { - button('Load the items', () => this.loadItems()); - return this.props.children(this.state.items); - } -} -AsyncItemLoader.propTypes = { children: PropTypes.func.isRequired }; - -storiesOf('Button', module) - .addDecorator(withKnobs) - .add('with text', () => ( - - )) - .add('with some emoji', () => ( - - )) - .add('with notes', () => ( - - - - )) - .add('with knobs', () => { - setOptions({ selectedAddonPanel: 'storybooks/storybook-addon-knobs' }); - const name = text('Name', 'Storyteller'); - const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 }); - const fruits = { - apple: 'Apple', - banana: 'Banana', - cherry: 'Cherry', - }; - const fruit = select('Fruit', fruits, 'apple'); - const dollars = number('Dollars', 12.5); - - // NOTE: color picker is currently broken - const backgroundColor = color('background', '#ffff00'); - const items = array('Items', ['Laptop', 'Book', 'Whiskey']); - const otherStyles = object('Styles', { - border: '3px solid #ff00ff', - padding: '10px', - }); - const nice = boolean('Nice', true); - const children = object('Children', [ - { - name: 'Jane', - age: 13, - }, - { - name: 'John', - age: 8, - }, - ]); - - // NOTE: put this last because it currently breaks everything after it :D - const birthday = date('Birthday', new Date('Jan 20 2017')); - - const intro = `My name is ${name}, I'm ${age} years old, and my favorite fruit is ${fruit}.`; - const style = { backgroundColor, ...otherStyles }; - const salutation = nice ? 'Nice to meet you!' : 'Leave me alone!'; - const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; - - return ( -
    -

    {intro}

    -

    My birthday is: {new Date(birthday).toLocaleDateString('en-US', dateOptions)}

    -

    I have {children.length} children:

    -
      - {children.map(child => ( -
    1. - {child.name}, {child.age} years old -
    2. - ))} -
    -

    My wallet contains: ${dollars.toFixed(2)}

    -

    In my backpack, I have:

    -
      {items.map(item =>
    • {item}
    • )}
    -

    {salutation}

    -
    -

    PS. My shirt pocket contains:

    - - {loadedItems => { - if (!loadedItems.length) return
  • No items!
  • ; - return
      {loadedItems.map(i =>
    • {i}
    • )}
    ; - }} -
    -
    - ); - }) - .addWithInfo( - 'with some info', - 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its painful API.', - context => ( - - click the label in top right for info about "{context.story}" - - ) - ) - .add( - 'with new info', - withInfo( - 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its new painless API.' - )(context => ( - - {setOptions({ selectedAddonPanel: 'storybook/info/info-panel' })} - click the label in top right for info about "{context.story}" - - )) - ) - .add( - 'addons composition', - withInfo('see Notes panel for composition info')( - withNotes('Composition: Info(Notes())')(context => ( -
    - {setOptions({ selectedAddonPanel: 'storybook/notes/panel' })} - click the label in top right for info about "{context.story}" -
    - )) - ) - ); - -storiesOf('AddonLink.Link', module) - .add('First', () => Go to Second) - .add('Second', () => Go to First); - -storiesOf('AddonLink.Button', module) - .add('First', () => ( - - )) - .add('Second', () => ( - - )); - -storiesOf('AddonLink.Select', module) - .add('Index', () => ( - - )) - .add('First', () => Go back) - .add('Second', () => Go back) - .add('Third', () => Go back); - -storiesOf('AddonLink.Href', module).add('log', () => { - hrefTo('AddonLink.Href', 'log').then(action('URL of this story')); - - return See action logger; -}); - -storiesOf('AddonInfo.DocgenButton', module).addWithInfo('DocgenButton', 'Some Description', () => ( - -)); - -storiesOf('AddonInfo.ImportedPropsButton', module).addWithInfo( - 'ImportedPropsButton', - 'Button with PropTypes imported from another file. Should fallback to using PropTypes for data.', - () => -); - -storiesOf('AddonInfo.FlowTypeButton', module).addWithInfo( - 'FlowTypeButton', - 'Some Description', - () => -); - -storiesOf('App', module).add('full app', () => ); - -storiesOf('Some really long story kind description', module) - .addDecorator(centered) - .add('with text', () => ); - -storiesOf('WithEvents', module) - .addDecorator(getStory => ( - - {getStory()} - - )) - .add('Logger', () => ); - -storiesOf('withNotes', module) - .add('with some text', withNotes('Hello guys')(() =>
    Hello guys
    )) - .add('with some emoji', withNotes('My notes on emojies')(() =>

    🤔😳😯😮

    )) - .add( - 'with a button and some emoji', - withNotes('My notes on a button with emojies')(() => ( - - )) - ) - .add('with old API', () => ( - - - - )); - -storiesOf('component.base.Link', module) - .addDecorator(withKnobs) - .add('first', () => {text('firstLink', 'first link')}) - .add('second', () => {text('secondLink', 'second link')}); - -storiesOf('component.base.Span', module) - .add('first', () => first span) - .add('second', () => second span); - -storiesOf('component.common.Div', module) - .add('first', () =>
    first div
    ) - .add('second', () =>
    second div
    ); - -storiesOf('component.common.Table', module) - .add('first', () => ( - - - - -
    first table
    - )) - .add('second', () => ( - - - - -
    first table
    - )); - -storiesOf('component.Button', module) - .add('first', () => ) - .add('second', () => ); - -// Atomic - -storiesOf('Cells/Molecules.Atoms/simple', module) - .addDecorator(withKnobs) - .add('with text', () => ) - .add('with some emoji', () => ); - -storiesOf('Cells/Molecules/Atoms.more', module) - .add('with text2', () => ) - .add('with some emoji2', () => ); - -storiesOf('Cells/Molecules', module) - .add('with text', () => ) - .add('with some emoji', () => ); - -storiesOf('Cells.Molecules.Atoms', module) - .add('with text2', () => ) - .add('with some emoji2', () => ); +// import React from 'react'; +// import PropTypes from 'prop-types'; +// import EventEmiter from 'eventemitter3'; + +// import { storiesOf } from '@storybook/react'; +// import { setOptions } from '@storybook/addon-options'; +// import { action } from '@storybook/addon-actions'; +// import { withNotes, WithNotes } from '@storybook/addon-notes'; +// import { LinkTo, linkTo, hrefTo } from '@storybook/addon-links'; +// import WithEvents from '@storybook/addon-events'; +// import { +// withKnobs, +// text, +// number, +// boolean, +// color, +// select, +// array, +// date, +// button, +// object, +// } from '@storybook/addon-knobs/react'; +// import centered from '@storybook/addon-centered'; +// import { withInfo } from '@storybook/addon-info'; + +// import { Button, Welcome } from '@storybook/react/demo'; + +// import App from '../App'; +// import Logger from './Logger'; +// import Container from './Container'; +// import DocgenButton from '../components/DocgenButton'; +// import FlowTypeButton from '../components/FlowTypeButton'; +// import ImportedPropsButton from '../components/ImportedPropsButton'; + +// const EVENTS = { +// TEST_EVENT_1: 'test-event-1', +// TEST_EVENT_2: 'test-event-2', +// TEST_EVENT_3: 'test-event-3', +// TEST_EVENT_4: 'test-event-4', +// }; + +// const emiter = new EventEmiter(); +// const emit = emiter.emit.bind(emiter); + +// storiesOf('Welcome', module).add('to Storybook', () => ); + +// const InfoButton = () => ( +// +// {' '} +// Show Info{' '} +// +// ); + +// class AsyncItemLoader extends React.Component { +// constructor() { +// super(); +// this.state = { items: [] }; +// } + +// loadItems() { +// setTimeout(() => this.setState({ items: ['pencil', 'pen', 'eraser'] }), 1500); +// } + +// render() { +// button('Load the items', () => this.loadItems()); +// return this.props.children(this.state.items); +// } +// } +// AsyncItemLoader.propTypes = { children: PropTypes.func.isRequired }; + +// storiesOf('Button', module) +// .addDecorator(withKnobs) +// .add('with text', () => ( +// +// )) +// .add('with some emoji', () => ( +// +// )) +// .add('with notes', () => ( +// +// +// +// )) +// .add('with knobs', () => { +// setOptions({ selectedAddonPanel: 'storybooks/storybook-addon-knobs' }); +// const name = text('Name', 'Storyteller'); +// const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 }); +// const fruits = { +// apple: 'Apple', +// banana: 'Banana', +// cherry: 'Cherry', +// }; +// const fruit = select('Fruit', fruits, 'apple'); +// const dollars = number('Dollars', 12.5); + +// // NOTE: color picker is currently broken +// const backgroundColor = color('background', '#ffff00'); +// const items = array('Items', ['Laptop', 'Book', 'Whiskey']); +// const otherStyles = object('Styles', { +// border: '3px solid #ff00ff', +// padding: '10px', +// }); +// const nice = boolean('Nice', true); +// const children = object('Children', [ +// { +// name: 'Jane', +// age: 13, +// }, +// { +// name: 'John', +// age: 8, +// }, +// ]); + +// // NOTE: put this last because it currently breaks everything after it :D +// const birthday = date('Birthday', new Date('Jan 20 2017')); + +// const intro = `My name is ${name}, I'm ${age} years old, and my favorite fruit is ${fruit}.`; +// const style = { backgroundColor, ...otherStyles }; +// const salutation = nice ? 'Nice to meet you!' : 'Leave me alone!'; +// const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; + +// return ( +//
    +//

    {intro}

    +//

    My birthday is: {new Date(birthday).toLocaleDateString('en-US', dateOptions)}

    +//

    I have {children.length} children:

    +//
      +// {children.map(child => ( +//
    1. +// {child.name}, {child.age} years old +//
    2. +// ))} +//
    +//

    My wallet contains: ${dollars.toFixed(2)}

    +//

    In my backpack, I have:

    +//
      {items.map(item =>
    • {item}
    • )}
    +//

    {salutation}

    +//
    +//

    PS. My shirt pocket contains:

    +// +// {loadedItems => { +// if (!loadedItems.length) return
  • No items!
  • ; +// return
      {loadedItems.map(i =>
    • {i}
    • )}
    ; +// }} +//
    +//
    +// ); +// }) +// .addWithInfo( +// 'with some info', +// 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its painful API.', +// context => ( +// +// click the label in top right for info about "{context.story}" +// +// ) +// ) +// .add( +// 'with new info', +// withInfo( +// 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its new painless API.' +// )(context => ( +// +// {setOptions({ selectedAddonPanel: 'storybook/info/info-panel' })} +// click the label in top right for info about "{context.story}" +// +// )) +// ) +// .add( +// 'addons composition', +// withInfo('see Notes panel for composition info')( +// withNotes('Composition: Info(Notes())')(context => ( +//
    +// {setOptions({ selectedAddonPanel: 'storybook/notes/panel' })} +// click the label in top right for info about "{context.story}" +//
    +// )) +// ) +// ); + +// storiesOf('AddonLink.Link', module) +// .add('First', () => Go to Second) +// .add('Second', () => Go to First); + +// storiesOf('AddonLink.Button', module) +// .add('First', () => ( +// +// )) +// .add('Second', () => ( +// +// )); + +// storiesOf('AddonLink.Select', module) +// .add('Index', () => ( +// +// )) +// .add('First', () => Go back) +// .add('Second', () => Go back) +// .add('Third', () => Go back); + +// storiesOf('AddonLink.Href', module).add('log', () => { +// hrefTo('AddonLink.Href', 'log').then(action('URL of this story')); + +// return See action logger; +// }); + +// storiesOf('AddonInfo.DocgenButton', module).addWithInfo('DocgenButton', 'Some Description', () => ( +// +// )); + +// storiesOf('AddonInfo.ImportedPropsButton', module).addWithInfo( +// 'ImportedPropsButton', +// 'Button with PropTypes imported from another file. Should fallback to using PropTypes for data.', +// () => +// ); + +// storiesOf('AddonInfo.FlowTypeButton', module).addWithInfo( +// 'FlowTypeButton', +// 'Some Description', +// () => +// ); + +// storiesOf('App', module).add('full app', () => ); + +// storiesOf('Some really long story kind description', module) +// .addDecorator(centered) +// .add('with text', () => ); + +// storiesOf('WithEvents', module) +// .addDecorator(getStory => ( +// +// {getStory()} +// +// )) +// .add('Logger', () => ); + +// storiesOf('withNotes', module) +// .add('with some text', withNotes('Hello guys')(() =>
    Hello guys
    )) +// .add('with some emoji', withNotes('My notes on emojies')(() =>

    🤔😳😯😮

    )) +// .add( +// 'with a button and some emoji', +// withNotes('My notes on a button with emojies')(() => ( +// +// )) +// ) +// .add('with old API', () => ( +// +// +// +// )); + +// storiesOf('component.base.Link', module) +// .addDecorator(withKnobs) +// .add('first', () => {text('firstLink', 'first link')}) +// .add('second', () => {text('secondLink', 'second link')}); + +// storiesOf('component.base.Span', module) +// .add('first', () => first span) +// .add('second', () => second span); + +// storiesOf('component.common.Div', module) +// .add('first', () =>
    first div
    ) +// .add('second', () =>
    second div
    ); + +// storiesOf('component.common.Table', module) +// .add('first', () => ( +// +// +// +// +//
    first table
    +// )) +// .add('second', () => ( +// +// +// +// +//
    first table
    +// )); + +// storiesOf('component.Button', module) +// .add('first', () => ) +// .add('second', () => ); + +// // Atomic + +// storiesOf('Cells/Molecules.Atoms/simple', module) +// .addDecorator(withKnobs) +// .add('with text', () => ) +// .add('with some emoji', () => ); + +// storiesOf('Cells/Molecules/Atoms.more', module) +// .add('with text2', () => ) +// .add('with some emoji2', () => ); + +// storiesOf('Cells/Molecules', module) +// .add('with text', () => ) +// .add('with some emoji', () => ); + +// storiesOf('Cells.Molecules.Atoms', module) +// .add('with text2', () => ) +// .add('with some emoji2', () => ); diff --git a/examples/cra-kitchen-sink/src/stories/index.stories.js b/examples/cra-kitchen-sink/src/stories/index.stories.js new file mode 100644 index 000000000000..00b11bd18da8 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/index.stories.js @@ -0,0 +1,160 @@ +import React from 'react'; +import EventEmiter from 'eventemitter3'; + +import { storiesOf } from '@storybook/react'; +import { setOptions } from '@storybook/addon-options'; +import { action } from '@storybook/addon-actions'; +import { withNotes, WithNotes } from '@storybook/addon-notes'; +import WithEvents from '@storybook/addon-events'; +import centered from '@storybook/addon-centered'; +import { withInfo } from '@storybook/addon-info'; +import { Button } from '@storybook/react/demo'; + +import App from '../App'; +import Logger from './Logger'; +import Container from './Container'; + +const EVENTS = { + TEST_EVENT_1: 'test-event-1', + TEST_EVENT_2: 'test-event-2', + TEST_EVENT_3: 'test-event-3', + TEST_EVENT_4: 'test-event-4', +}; + +const emiter = new EventEmiter(); +const emit = emiter.emit.bind(emiter); + +const InfoButton = () => ( + + {' '} + Show Info{' '} + +); + +storiesOf('Button', module) + .add('with text', () => ( + + )) + .add('with some emoji', () => ( + + )) + .add('with notes', () => ( + // deprecated usage + + + + )) + .addWithInfo( + 'with some info', + 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its painful API.', + context => ( + + click the label in top right for info about "{context.story}" + + ) + ) + .add( + 'with new info', + withInfo( + 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its new painless API.' + )(context => ( + + {setOptions({ selectedAddonPanel: 'storybook/info/info-panel' })} + click the label in top right for info about "{context.story}" + + )) + ) + .add( + 'addons composition', + withInfo('see Notes panel for composition info')( + withNotes('Composition: Info(Notes())')(context => ( +
    + {setOptions({ selectedAddonPanel: 'storybook/notes/panel' })} + click the label in top right for info about "{context.story}" +
    + )) + ) + ); + +storiesOf('App', module).add('full app', () => ); + +storiesOf('Some really long story kind description', module) + .addDecorator(centered) + .add('with text', () => ); + +storiesOf('WithEvents', module) + .addDecorator(getStory => ( + + {getStory()} + + )) + .add('Logger', () => ); diff --git a/examples/cra-kitchen-sink/src/stories/storybook-components.js b/examples/cra-kitchen-sink/src/stories/storybook-components.stories.js similarity index 100% rename from examples/cra-kitchen-sink/src/stories/storybook-components.js rename to examples/cra-kitchen-sink/src/stories/storybook-components.stories.js diff --git a/examples/cra-kitchen-sink/src/stories/welcome.js b/examples/cra-kitchen-sink/src/stories/welcome.js new file mode 100644 index 000000000000..9610f12d04e9 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/welcome.js @@ -0,0 +1,6 @@ +import React from 'react'; +import { Welcome } from '@storybook/react/demo'; +import { storiesOf } from '@storybook/react'; +import { linkTo } from '@storybook/addon-links'; + +storiesOf('Welcome', module).add('to Storybook', () => ); diff --git a/examples/crna-kitchen-sink/app.json b/examples/crna-kitchen-sink/app.json index 150dcb6e1a82..dc020d30f0d7 100644 --- a/examples/crna-kitchen-sink/app.json +++ b/examples/crna-kitchen-sink/app.json @@ -1,5 +1,5 @@ { "expo": { - "sdkVersion": "19.0.0" + "sdkVersion": "22.0.0" } } diff --git a/examples/crna-kitchen-sink/package.json b/examples/crna-kitchen-sink/package.json index 7553a83afc05..8d4a33c03459 100644 --- a/examples/crna-kitchen-sink/package.json +++ b/examples/crna-kitchen-sink/package.json @@ -9,14 +9,15 @@ "@storybook/addon-options": "file:../../packs/storybook-addon-options.tgz", "@storybook/addon-storyshots": "file:../../packs/storybook-addon-storyshots.tgz", "@storybook/addons": "file:../../packs/storybook-addons.tgz", - "@storybook/channels": "file:../../packs/storybook-channels.tgz", "@storybook/channel-postmessage": "file:../../packs/storybook-channel-postmessage.tgz", + "@storybook/channels": "file:../../packs/storybook-channels.tgz", "@storybook/components": "file:../../packs/storybook-components.tgz", "@storybook/react-native": "file:../../packs/storybook-react-native.tgz", "@storybook/ui": "file:../../packs/storybook-ui.tgz", + "jest-expo": "^22.0.0", "react-native-scripts": "1.1.0", - "jest-expo": "19.0.0", - "react-test-renderer": "16.0.0-alpha.12" + "react-test-renderer": "~16.0.0", + "webpack": "^3.8.1" }, "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", "scripts": { @@ -31,10 +32,9 @@ "preset": "jest-expo" }, "dependencies": { - "expo": "^19.0.0", - "prop-types": "^15.6.0", - "react": "16.0.0-alpha.12", - "react-native": "0.46.1", - "webpack": "^2.5.1 || ^3.0.0" + "expo": "^22.0.0", + "prop-types": "^15.5.0", + "react": "~16.0.0", + "react-native": "~0.49.3" } } diff --git a/examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap b/examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap index 6698ac5b4e2e..f3538f8fcfd3 100644 --- a/examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap +++ b/examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap @@ -19,6 +19,7 @@ exports[`Storyshots Button with some emoji 1`] = ` hasTVPreferredFocus={undefined} hitSlop={undefined} isTVSelectable={true} + nativeID={undefined} onLayout={undefined} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -40,6 +41,7 @@ exports[`Storyshots Button with some emoji 1`] = ` 😀 😎 👍 💯 @@ -67,6 +69,7 @@ exports[`Storyshots Button with text 1`] = ` hasTVPreferredFocus={undefined} hitSlop={undefined} isTVSelectable={true} + nativeID={undefined} onLayout={undefined} onResponderGrant={[Function]} onResponderMove={[Function]} @@ -88,6 +91,7 @@ exports[`Storyshots Button with text 1`] = ` Hello Button @@ -110,6 +114,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` My name is Storyteller, I'm 70 years old, and my favorite fruit is apple. @@ -117,6 +122,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` My birthday is: @@ -125,6 +131,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` My wallet contains: $ @@ -133,6 +140,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` In my backpack, I have: @@ -141,6 +149,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` Laptop @@ -148,6 +157,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` Book @@ -155,6 +165,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` Whiskey @@ -163,6 +174,7 @@ exports[`Storyshots Knobs with knobs 1`] = ` Nice to meet you! @@ -183,6 +195,7 @@ exports[`Storyshots Welcome to Storybook 1`] = ` { let browser = puppeteer.launch(); + let page; describe('sandboxes', () => { + beforeAll(async () => { + browser = await browser; + page = await browser.newPage(); + await page.setViewport({ width: 1400, height: 1000 }); + }); afterAll(() => { browser.close(); }); - it.concurrent( - `Take screenshots for '${name}'`, - async () => { - browser = await browser; - const page = await browser.newPage(); - await page.setViewport({ width: 1400, height: 1000 }); - await page.goto(`http://localhost:${port}`); - await page.waitForSelector('[role="menuitem"][data-name="Welcome"]'); - await page.waitFor(2000); - - const screenshot = await page.screenshot({ fullPage: true }); + it(`Take screenshots for '${name}'`, async () => { + await page.goto(`http://localhost:${port}`); + await page.waitForSelector('[role="menuitem"][data-name="Welcome"]'); + await page.waitFor(2000); - expect(screenshot).toMatchImageSnapshot({ - customDiffConfig: { - threshold: 0.03, // 3% threshold - }, - customSnapshotIdentifier: name.split('/').join('-'), - }); - }, - 1000 * 60 * 10 // 10 minutes for all tests in total - ); + const screenshot = await page.screenshot({ fullPage: true }); + expect(screenshot).toMatchImageSnapshot({ + failureThreshold: 0.04, // 4% threshold, + failureThresholdType: 'percent', + customSnapshotIdentifier: name.split('/').join('-'), + }); + }); }); }); diff --git a/lib/addons/CHANGELOG.md b/lib/addons/CHANGELOG.md deleted file mode 100644 index 063a797e3faa..000000000000 --- a/lib/addons/CHANGELOG.md +++ /dev/null @@ -1,35 +0,0 @@ -## Changelog - -### v1.6.0 - -28 Oct 2016 - -Revert stuff introduce with v1.6.0. It might break react-native-storybook. -We have [another way](https://github.com/kadirahq/react-storybook/pull/582#issuecomment-256840165) to do what we support to do with preview decorators. - -### v1.6.0 - -28 Oct 2016 - -- Add `setPreviewDecorator` and `getPreviewDecorator` methods. -- Now following methods can only be set once and they accept an option name as the second argument. - - setChannel(channel, name) - - setDatabase(database, name) - - setPreview(preview, name) - - setPreviewDecorator(decorator, name) - -### v1.5.0 - -13 Aug 2016 - -- Add `getDatabase` and `setDatabase` methods [PR3](https://github.com/kadirahq/storybook-addons/pull/3) - -### v1.4.0 - -29 Aug 2016 - -- Add `getPreview` and `setPreview` methods [PR2](https://github.com/kadirahq/storybook-addons/pull/2) - -### v1.3.1 - -- First stable release with addon store for loaders, panels and channel. diff --git a/lib/channel-postmessage/CHANGELOG.md b/lib/channel-postmessage/CHANGELOG.md deleted file mode 100644 index ca870ae0c288..000000000000 --- a/lib/channel-postmessage/CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -## Changelog - -### v2.0.1 - -24-Nov-2016 - -- Fix empty story list when loading in an iframe [PR8](https://github.com/kadirahq/storybook-channel-postmsg/pull/8) - -### v2.0.0 - -17-Nov-2016 - -- Identify the page with a parameter [PR7](https://github.com/kadirahq/storybook-channel-postmsg/pull/7) - -### v1.1.0 - -28-Oct-2016 - -- Use a constant key to identify relavent messages [PR6](https://github.com/kadirahq/storybook-channel-postmsg/pull/6) - -### v1.0.4 - -28-Oct-2016 - -- Allow message handlers to throw errors [PR4](https://github.com/kadirahq/storybook-channel-postmsg/pull/4) - -### v1.0.3 - -28-Sep-2016 - -- Serialize data because some objects throw error when sent over postMessage [PR3](https://github.com/kadirahq/storybook-channel-postmsg/pull/3) - -### v1.0.2 - -28-Sep-2016 - -- Do not serialize data because objects can be sent over postMessage [PR1](https://github.com/kadirahq/storybook-channel-postmsg/pull/1) - -### v1.0.1 - -26-Sep-2016 - -- Select the iframe by id (getElementById) - -### v1.0.0 - -26-Sep-2016 - -- Implement send and receive functions diff --git a/lib/channel-websocket/CHANGELOG.md b/lib/channel-websocket/CHANGELOG.md deleted file mode 100644 index abbd2006c59d..000000000000 --- a/lib/channel-websocket/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -## Changelog - -### v1.0.1 - -- Public release - -### v1.0.0 - -- Implement the channel transport interface diff --git a/lib/channels/CHANGELOG.md b/lib/channels/CHANGELOG.md deleted file mode 100644 index 19b49324c3ca..000000000000 --- a/lib/channels/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -## Changelog - -### v1.1.0 - -- Add a new `from` field to events to identify sender. -- Ignore messages originated from itself (check event.from) - -### v1.0.1 - -- Implement an API similar to an EventEmitter diff --git a/lib/cli/CHANGELOG.md b/lib/cli/CHANGELOG.md deleted file mode 100644 index 8722876138de..000000000000 --- a/lib/cli/CHANGELOG.md +++ /dev/null @@ -1,116 +0,0 @@ -# Changelog - -### v1.7.0 - -18-Dec-2016 - -Use a non-hacky way to detect yarn. [PR24](https://github.com/storybooks/getstorybook/pull/24) - -### v1.6.1 - -18-Oct-2016 - -Fix some typos. [PR21](https://github.com/kadirahq/getstorybook/pull/21) - -### v1.6.0 - -12-Oct-2016 - -Add yarn support. Now users could install storybook with yarn and use yarn to install deps: - - yarn global add getstorybook - getstorybook - -For more info check [docs](https://github.com/kadirahq/getstorybook#yarn-support). - -### v1.5.2 - -07-Oct-2016 - -- Update more user friendly welcome screen to REACT_SCRIPTS generator. - -### v1.5.0 - -05-Oct-2016 - -- Update to use the latest storybook. Also update REACT_SCRIPTS generator to support public folder. - -### v1.4.6 - -30-Sep-2016 - -- Remove index.css import from config.js in CRA. - -### v1.4.5 - -06-Aug-2016 - -Fix an issue related to Meteor. - -- Related issue: [kadirahq/react-storybook#423](https://github.com/kadirahq/react-storybook/issues/423) -- The fix: [088eecf](https://github.com/kadirahq/getstorybook/commit/088eecf740bebf522b6608892a3a7e3e34bcfc31) - -### v1.4.4 - -30-Aug-2016 - -- Update @kadira/storybook to version 2.5.2. [PR17](https://github.com/kadirahq/getstorybook/pull/17) -- Add Arial font and remove image from Welcome message. [PR16](https://github.com/kadirahq/getstorybook/pull/16) - -### v1.4.3 - -30-Aug-2016 - -This is a mistakenly published version. - -### v1.4.2 - -28-Aug-2016 - -- React Native: Do not import addons.js on entryfiles.[PR14](https://github.com/kadirahq/getstorybook/pull/14) -- Fix "emojies" typo. [PR15](https://github.com/kadirahq/getstorybook/pull/15) - -### v1.4.1 - -26-Aug-2016 - -- `RN` Automate setting app name on entry files [PR12](https://github.com/kadirahq/getstorybook/pull/12) -- `RN` Add entry javascript file for Android [PR13](https://github.com/kadirahq/getstorybook/pull/13) - -### v1.4.0 - -25-Aug-2016 - -- Add support for React Native apps. [PR11](https://github.com/kadirahq/getstorybook/pull/11) - -### v1.3.0 - -11-Aug-2016 - -- Add support for Webpack React apps. [PR8](https://github.com/kadirahq/getstorybook/pull/8) -- Add support for Meteor. [PR9](https://github.com/kadirahq/getstorybook/pull/9) - -### v1.2.0 - -10-Aug-2016 - -- Add better default stories. [PR7](https://github.com/kadirahq/getstorybook/pull/7) -- Fix an issue with the `-f` option. With `-f`, it was detecting every app as a CRA based app. - -### v1.1.0 - -3-Aug-2016 - -Show some feedback when installing NPM dependencies. Fixes: [#5](https://github.com/kadirahq/getstorybook/issues/5). - -Now we use `childProcess.spawnSync` to run the `npm install` command. - -### v1.0.0 - -2-Aug-2016 - -Add the initial release supporting following project types: - -- Create React App based projects. -- Any other React app. -- Any React component library. diff --git a/lib/cli/generators/REACT_NATIVE/template/storybook/index.js b/lib/cli/generators/REACT_NATIVE/template/storybook/index.js new file mode 100644 index 000000000000..f0513c5a8651 --- /dev/null +++ b/lib/cli/generators/REACT_NATIVE/template/storybook/index.js @@ -0,0 +1,3 @@ +import StorybookUI from './storybook'; + +export default StorybookUI; diff --git a/lib/cli/test/snapshots/react_native/storybook/index.js b/lib/cli/test/snapshots/react_native/storybook/index.js new file mode 100644 index 000000000000..f0513c5a8651 --- /dev/null +++ b/lib/cli/test/snapshots/react_native/storybook/index.js @@ -0,0 +1,3 @@ +import StorybookUI from './storybook'; + +export default StorybookUI; diff --git a/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js b/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js index b96c0bcb5eb3..8253cc11c6ca 100644 --- a/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js +++ b/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js @@ -188,3 +188,11 @@ storiesOf('Button').addWithInfo( } } ) + +storiesOf('shared/ProgressBar', module) + .addDecorator(withKnobs) + .addWithInfo('default style', () => ( + + )); diff --git a/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.js b/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.js index 1da578e189f0..ed3e5f29d7ae 100644 --- a/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.js +++ b/lib/codemod/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.js @@ -184,3 +184,11 @@ storiesOf('Button').add('with custom styles', withInfo({ return stylesheet } })(() =>