Merge branch 'next' into fix-react-native-server

This commit is contained in:
Michael Shilman 2019-06-29 10:23:12 +08:00
commit ea238476af
320 changed files with 7317 additions and 4914 deletions

View File

@ -1,3 +1,17 @@
## 5.2.0-alpha.31 (June 27, 2019)
### Breaking Changes
* Module format: story field for name/parameters annotation ([#7202](https://github.com/storybookjs/storybook/pull/7202))
### Features
* Core: Story sorting ([#6472](https://github.com/storybookjs/storybook/pull/6472))
### Maintenance
* Addon-docs: Fix source-loader CI errors ([#7203](https://github.com/storybookjs/storybook/pull/7203))
## 5.2.0-alpha.30 (June 25, 2019)
This release merges `release/docs-technical-preview` branch back into `next` through a series of PRs. It also contains other changes that came in on `next` since the last alpha.
@ -34,6 +48,19 @@ This release merges `release/docs-technical-preview` branch back into `next` thr
* Upgrade core-js to 3.x in devkits ([#7171](https://github.com/storybookjs/storybook/pull/7171))
* UPGRADE lazy-universal-dotenv ([#7151](https://github.com/storybookjs/storybook/pull/7151))
## 5.1.9 (June 20, 2019)
### Bug Fixes
* Core: Fix JSON babel config error reporting ([#7104](https://github.com/storybookjs/storybook/pull/7104))
* UI: Fix about page version check message ([#7105](https://github.com/storybookjs/storybook/pull/7105))
### Dependency Upgrades
* Add missing dependencies to ui/react ([#7081](https://github.com/storybookjs/storybook/pull/7081))
* UPGRADE lazy-universal-dotenv ([#7151](https://github.com/storybookjs/storybook/pull/7151))
* Make compatible with yarn Pnp ([#6922](https://github.com/storybookjs/storybook/pull/6922))
## 5.2.0-alpha.29 (June 17, 2019)
### Features
@ -65,6 +92,31 @@ Publish failed
* CLI: improve bootstrap list ([#6993](https://github.com/storybookjs/storybook/pull/6993))
* CLI: replaced merge-dirs dependency by fs-extra ([#7100](https://github.com/storybookjs/storybook/pull/7100))
## 5.1.8 (June 14, 2019)
### Bug Fixes
* CLI: Fix RN template to not import addons ([#7096](https://github.com/storybookjs/storybook/pull/7096))
## 5.1.7 (June 14, 2019)
### Bug Fixes
* UI: Fix warning of loading prop not being a string ([#7080](https://github.com/storybookjs/storybook/pull/7080))
## 5.1.6 (June 14, 2019)
Publish failed
## 5.1.5 (June 14, 2019)
### Bug Fixes
* Core: Upgrade plugin core-js fix ([#7086](https://github.com/storybookjs/storybook/pull/7086))
* UI: Fix sidebar loading visibility ([#7073](https://github.com/storybookjs/storybook/pull/7073))
* UI: Fix unnecessary large bundlesize ([#7091](https://github.com/storybookjs/storybook/pull/7091))
* Addon-contexts, RN-server: Add core-js dep ([#7094](https://github.com/storybookjs/storybook/pull/7094))
## 5.2.0-alpha.26 (June 14, 2019)
- Merge in changes from 5.1.7/next branch.
@ -76,6 +128,19 @@ Publish failed
Publish failed
## 5.1.4 (June 13, 2019)
### Bug Fixes
* Core: Fix core-js 3 errors ([#7051](https://github.com/storybookjs/storybook/pull/7051))
* UI: Fix syntax highlighter plain text not visible ([#7057](https://github.com/storybookjs/storybook/pull/7057))
* Addon-actions: Add default options to action(s) ([#6438](https://github.com/storybookjs/storybook/pull/6438))
### Dependency Upgrades
* fix: add missing core-js dependency ([#7016](https://github.com/storybookjs/storybook/pull/7016))
* chore: set react version to 16.8.3 to match react native ([#7008](https://github.com/storybookjs/storybook/pull/7008))
## 5.2.0-alpha.24 (June 13, 2019)
Merge in changes from 5.1.3/next branch.
@ -91,134 +156,17 @@ Merge in changes from 5.1.3/next branch. Releasing from the addon-docs branch to
- Inline stories respect height prop
- Export Description block
## 5.2.0-alpha.21 (June 2, 2019)
## 5.1.3 (June 6, 2019)
- Core: Convert module format to use default export for metadata
- Addon-docs: Compile MDX to default export modules format
- Source-loader: Support parameter injection for default export metadata
### Bug Fixes
## 5.2.0-alpha.20 (May 31, 2019)
* UI: Fix links that are not working with plain left click ([#6970](https://github.com/storybookjs/storybook/pull/6970))
* Core: Don't redefine `process` variable ([#6991](https://github.com/storybookjs/storybook/pull/6991))
* Core: Don't mutate user's babel config ([#6987](https://github.com/storybookjs/storybook/pull/6987))
- Addon-docs: Use Meta doc block instead of exporting componentMeta
## 5.1.2 (June 6, 2019)
## 5.2.0-alpha.19 (May 28, 2019)
- Source-loader: Fix bad package dependencies
## 5.2.0-alpha.18 (May 26, 2019)
- Addon-docs: Codemod for adding component parameters
- Core: Babel config loading bugfix ([#6878](https://github.com/storybookjs/storybook/pull/6878))
## 5.2.0-alpha.17 (May 26, 2019)
- Addon-docs: Refer to selected story/component with `id="."` / `of="."`
## 5.2.0-alpha.16 (May 25, 2019)
- Addon-docs: Auto-configure `inlineStories` & `getPropDefs` based on framework
## 5.2.0-alpha.15 (May 25, 2019)
- Addon-docs: Expanded Vue support
- Props table support
- iframeHeight configuration parameter
## 5.2.0-alpha.14 (May 25, 2019)
- Addon-docs: Expanded source formats via `@storybook/source-loader`
- Legacy `storiesOf` format x (JS / TSX)
- Component modules format x (JS / TSX)
- Component MDX format
## 5.2.0-alpha.13 (May 24, 2019)
- Addon-docs: Add documentation-only `--docs` option to build storybook
## 5.2.0-alpha.12 (May 21, 2019)
- Addon-docs: Fix regression in preview source for legacy stories
## 5.2.0-alpha.11 (May 21, 2019)
- Addon-docs:
- Source refer to stories by name
- Source support for multi-story previews
- Fix loader bug for plaintext stories
## 5.2.0-alpha.10 (May 19, 2019)
- Addon-docs: Display source dropdown in preview component
## 5.2.0-alpha.9 (May 17, 2019)
- Addon-docs bugfixes:
- Fix broken components stories
- Fix regression in iframe preview
- Fix docgen props block
- Fix margin styling on docs page
## 5.2.0-alpha.8 (May 15, 2019)
- Addon-docs: Optimize docs pane rerendering
## 5.2.0-alpha.7 (May 15, 2019)
- Addon-docs: Docs page bugfix
- Addon-docs: Fix source block for legacy stories
NOTE: use `@storybook/addon-storysource/loader` with option `injectParameters: true` for legacy source
## 5.2.0-alpha.6 (May 14, 2019)
- Addon-docs: Docs page content update
- Addon-docs: Preview component redefinition
#### Breaking changes
Preview behavior has been updated. Docs page content has been updated.
Before:
- `<Story name="a">` defines a story, `<Preview id="x--a"/>` references it
After:
- `<Story name="a">` defines a story, `<Story id="x--a"/>` references it
- `<Preview><Story .../><Story .../><Component/></Preview>` shows one or more stories in a grid
## 5.2.0-alpha.5 (May 12, 2019)
- Addon-docs: Description block refactor and bugfixes
## 5.2.0-alpha.4 (May 11, 2019)
- Addon-docs: Source, Props, DocsPage doc blocks
#### Breaking changes
- Doc blocks & presets have moved. Update your MDX stories and `presets.js` file accordingly:
- `import { Preview, Story } from '@storybook/addon-docs/blocks';
- `module.exports = ['@storybook/addon-docs/common/preset'];`
## 5.2.0-alpha.3 (May 1, 2019)
- Addon-docs: Add Story decorator and parameter support
- Addon-docs: Remove need for extra project babelrc
## 5.2.0-alpha.2 (April 30, 2019)
- Addon-docs: Streamline setup, fix MDX dependencies, improve MDX import, and update guide
## 5.2.0-alpha.0 (April 29, 2019)
Storybook Docs technical preview:
- Docs addon
- MDX story format
- Module story format
- Load API
- [Guide](https://docs.google.com/document/d/1un6YX7xDKEKl5-MVb-egnOYN8dynb5Hf7mq0hipk8JE/edit?usp=sharing)
Publish failed
## 5.1.1 (June 5, 2019)
@ -264,6 +212,16 @@ Publish failed
* Core: Fix webpack `process.*` variable definitions ([#6946](https://github.com/storybookjs/storybook/pull/6946))
* Angular: Fix tsconfig.app.json detection for Angular 8 ([#6940](https://github.com/storybookjs/storybook/pull/6940))
## 5.2.0-alpha.21 (June 2, 2019)
- Core: Convert module format to use default export for metadata
- Addon-docs: Compile MDX to default export modules format
- Source-loader: Support parameter injection for default export metadata
## 5.2.0-alpha.20 (May 31, 2019)
- Addon-docs: Use Meta doc block instead of exporting componentMeta
## 5.1.0-rc.3 (May 29, 2019)
### Features
@ -284,12 +242,46 @@ Publish failed
* Bump ts-node from 8.1.0 to 8.2.0 ([#6890](https://github.com/storybookjs/storybook/pull/6890))
* Bump svelte from 3.4.2 to 3.4.4 ([#6892](https://github.com/storybookjs/storybook/pull/6892))
## 5.2.0-alpha.19 (May 28, 2019)
- Source-loader: Fix bad package dependencies
## 5.1.0-rc.2 (May 27, 2019)
### Bug Fixes
* Core: Fix JS/JSON loading babel config ([#6878](https://github.com/storybookjs/storybook/pull/6878))
## 5.2.0-alpha.18 (May 26, 2019)
- Addon-docs: Codemod for adding component parameters
- Core: Babel config loading bugfix ([#6878](https://github.com/storybookjs/storybook/pull/6878))
## 5.2.0-alpha.17 (May 26, 2019)
- Addon-docs: Refer to selected story/component with `id="."` / `of="."`
## 5.2.0-alpha.16 (May 25, 2019)
- Addon-docs: Auto-configure `inlineStories` & `getPropDefs` based on framework
## 5.2.0-alpha.15 (May 25, 2019)
- Addon-docs: Expanded Vue support
- Props table support
- iframeHeight configuration parameter
## 5.2.0-alpha.14 (May 25, 2019)
- Addon-docs: Expanded source formats via `@storybook/source-loader`
- Legacy `storiesOf` format x (JS / TSX)
- Component modules format x (JS / TSX)
- Component MDX format
## 5.2.0-alpha.13 (May 24, 2019)
- Addon-docs: Add documentation-only `--docs` option to build storybook
## 5.1.0-rc.1 (May 24, 2019)
### Features
@ -344,6 +336,29 @@ Publish failed
* Bump svelte from 3.4.1 to 3.4.2 ([#6838](https://github.com/storybookjs/storybook/pull/6838))
* Misc upgrades ([#6820](https://github.com/storybookjs/storybook/pull/6820))
## 5.2.0-alpha.12 (May 21, 2019)
- Addon-docs: Fix regression in preview source for legacy stories
## 5.2.0-alpha.11 (May 21, 2019)
- Addon-docs:
- Source refer to stories by name
- Source support for multi-story previews
- Fix loader bug for plaintext stories
## 5.2.0-alpha.10 (May 19, 2019)
- Addon-docs: Display source dropdown in preview component
## 5.2.0-alpha.9 (May 17, 2019)
- Addon-docs bugfixes:
- Fix broken components stories
- Fix regression in iframe preview
- Fix docgen props block
- Fix margin styling on docs page
## 5.1.0-beta.1 (May 16, 2019)
### Bug Fixes
@ -361,6 +376,49 @@ Publish failed
* Bump fs-extra from 7.0.1 to 8.0.1 ([#6776](https://github.com/storybookjs/storybook/pull/6776))
## 5.2.0-alpha.8 (May 15, 2019)
- Addon-docs: Optimize docs pane rerendering
## 5.2.0-alpha.7 (May 15, 2019)
- Addon-docs: Docs page bugfix
- Addon-docs: Fix source block for legacy stories
NOTE: use `@storybook/addon-storysource/loader` with option `injectParameters: true` for legacy source
## 5.2.0-alpha.6 (May 14, 2019)
- Addon-docs: Docs page content update
- Addon-docs: Preview component redefinition
#### Breaking changes
Preview behavior has been updated. Docs page content has been updated.
Before:
- `<Story name="a">` defines a story, `<Preview id="x--a"/>` references it
After:
- `<Story name="a">` defines a story, `<Story id="x--a"/>` references it
- `<Preview><Story .../><Story .../><Component/></Preview>` shows one or more stories in a grid
## 5.2.0-alpha.5 (May 12, 2019)
- Addon-docs: Description block refactor and bugfixes
## 5.2.0-alpha.4 (May 11, 2019)
- Addon-docs: Source, Props, DocsPage doc blocks
#### Breaking changes
- Doc blocks & presets have moved. Update your MDX stories and `presets.js` file accordingly:
- `import { Preview, Story } from '@storybook/addon-docs/blocks';
- `module.exports = ['@storybook/addon-docs/common/preset'];`
## 5.1.0-beta.0 (May 10, 2019)
Welcome to the 5.1 beta! Feature development's done; `beta.0` kicks off the stabilization process for the 5.1 final release. 🚀
@ -426,6 +484,25 @@ Failed publish
- CLI: Refactor how we install dev dependencies in cli ([#6695](https://github.com/storybookjs/storybook/pull/6695))
## 5.2.0-alpha.3 (May 1, 2019)
- Addon-docs: Add Story decorator and parameter support
- Addon-docs: Remove need for extra project babelrc
## 5.2.0-alpha.2 (April 30, 2019)
- Addon-docs: Streamline setup, fix MDX dependencies, improve MDX import, and update guide
## 5.2.0-alpha.0 (April 29, 2019)
Storybook Docs technical preview:
- Docs addon
- MDX story format
- Module story format
- Load API
- [Guide](https://docs.google.com/document/d/1un6YX7xDKEKl5-MVb-egnOYN8dynb5Hf7mq0hipk8JE/edit?usp=sharing)
## 5.0.11 (April 28, 2019)
### Bug Fixes

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
@ -26,12 +26,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"axe-core": "^3.2.2",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
@ -21,11 +21,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"fast-deep-equal": "^2.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
@ -25,12 +25,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"memoizerific": "^1.11.3",
"react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-centered",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook decorator to center components",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-contexts",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook Addon Contexts",
"keywords": [
"storybook",
@ -28,10 +28,10 @@
"dev:check-types": "tsc --noEmit"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^3.0.1"
},
"peerDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-cssresources",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
@ -25,10 +25,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-design-assets",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Design asset preview for storybook",
"keywords": [
"addon",
@ -27,12 +27,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -90,7 +90,8 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.parameters = { mdxSource: \`<Button>One</Button>\` };
one.story = {};
one.story.parameters = { mdxSource: \`<Button>One</Button>\` };
const componentMeta = {
title: 'Button',
@ -159,11 +160,13 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.parameters = { mdxSource: \`<Button>One</Button>\` };
one.story = {};
one.story.parameters = { mdxSource: \`<Button>One</Button>\` };
export const helloStory = () => <Button>Hello button</Button>;
helloStory.title = 'hello story';
helloStory.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
helloStory.story = {};
helloStory.story.name = 'hello story';
helloStory.story.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
const componentMeta = { title: 'Button', includeStories: ['one', 'helloStory'] };
@ -229,8 +232,9 @@ export const toStorybook = () => ({
declarations: [Welcome],
},
});
toStorybook.title = 'to storybook';
toStorybook.parameters = {
toStorybook.story = {};
toStorybook.story.name = 'to storybook';
toStorybook.story.parameters = {
mdxSource: \`{
template: \\\\\`<storybook-welcome-component (showApp)=\\"showApp()\\"></storybook-welcome-component>\\\\\`,
props: {
@ -304,12 +308,14 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const componentNotes = () => <Button>Component notes</Button>;
componentNotes.title = 'component notes';
componentNotes.parameters = { mdxSource: \`<Button>Component notes</Button>\` };
componentNotes.story = {};
componentNotes.story.name = 'component notes';
componentNotes.story.parameters = { mdxSource: \`<Button>Component notes</Button>\` };
export const storyNotes = () => <Button>Story notes</Button>;
storyNotes.title = 'story notes';
storyNotes.parameters = {
storyNotes.story = {};
storyNotes.story.name = 'story notes';
storyNotes.story.parameters = {
mdxSource: \`<Button>Story notes</Button>\`,
...{
notes: 'story notes',
@ -385,11 +391,13 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const helloButton = () => <Button>Hello button</Button>;
helloButton.title = 'hello button';
helloButton.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
helloButton.story = {};
helloButton.story.name = 'hello button';
helloButton.story.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
export const two = () => <Button>Two</Button>;
two.parameters = { mdxSource: \`<Button>Two</Button>\` };
two.story = {};
two.story.parameters = { mdxSource: \`<Button>Two</Button>\` };
const componentMeta = {
title: 'Button',
@ -448,11 +456,13 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.parameters = { mdxSource: \`<Button>One</Button>\` };
one.story = {};
one.story.parameters = { mdxSource: \`<Button>One</Button>\` };
export const helloStory = () => <Button>Hello button</Button>;
helloStory.title = 'hello story';
helloStory.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
helloStory.story = {};
helloStory.story.name = 'hello story';
helloStory.story.parameters = { mdxSource: \`<Button>Hello button</Button>\` };
const componentMeta = { title: 'Button', includeStories: ['one', 'helloStory'] };
@ -542,7 +552,8 @@ function MDXContent({ components, ...props }) {
MDXContent.isMDXComponent = true;
export const text = () => 'Plain text';
text.parameters = { mdxSource: \`'Plain text'\` };
text.story = {};
text.story.parameters = { mdxSource: \`'Plain text'\` };
const componentMeta = { title: 'Text', includeStories: ['text'] };

View File

@ -26,20 +26,8 @@ function webpack(webpackConfig = {}, options = {}) {
...module,
rules: [
...(module.rules || []),
// {
// test: [/\.stories\.(jsx?$|ts?$)/],
// enforce: 'pre',
// use: [
// {
// loader: require.resolve('@storybook/addon-storysource/loader'),
// options: {
// injectParameters: true,
// },
// },
// ],
// },
{
test: /\.stories.mdx$/,
test: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
@ -55,7 +43,7 @@ function webpack(webpackConfig = {}, options = {}) {
},
{
test: /\.mdx$/,
exclude: /\.stories.mdx$/,
exclude: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
@ -72,11 +60,7 @@ function webpack(webpackConfig = {}, options = {}) {
}
function addons(entry = []) {
return [
...entry,
// require.resolve('@storybook/addon-storysource/register'),
require.resolve('../register'),
];
return [...entry, require.resolve('../register')];
}
module.exports = { webpack, addons };

View File

@ -65,9 +65,10 @@ function genStoryExport(ast, counter) {
${storyCode}
);`
);
statements.push(`${storyKey}.story = {};`);
if (storyName !== storyKey) {
statements.push(`${storyKey}.title = '${storyName}';`);
statements.push(`${storyKey}.story.name = '${storyName}';`);
}
let parameters = getAttr(ast.openingElement, 'parameters');
@ -76,9 +77,9 @@ function genStoryExport(ast, counter) {
if (parameters) {
const { code: params } = generate(parameters, {});
// FIXME: hack in the story's source as a parameter
statements.push(`${storyKey}.parameters = { mdxSource: ${source}, ...${params} };`);
statements.push(`${storyKey}.story.parameters = { mdxSource: ${source}, ...${params} };`);
} else {
statements.push(`${storyKey}.parameters = { mdxSource: ${source} };`);
statements.push(`${storyKey}.story.parameters = { mdxSource: ${source} };`);
}
// console.log(statements);

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Superior documentation for your components",
"keywords": [
"addon",
@ -28,11 +28,11 @@
"@mdx-js/loader": "^1.0.0",
"@mdx-js/mdx": "^1.0.0",
"@mdx-js/react": "^1.0.16",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/router": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/router": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"lodash": "^4.17.11",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
@ -24,9 +24,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"format-json": "^1.0.3",
"lodash": "^4.17.11",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-google-analytics",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
@ -20,8 +20,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react-ga": "^2.5.7"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
@ -22,8 +22,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"graphiql": "^0.13.0",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-info",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A Storybook addon to show additional information for your stories.",
"keywords": [
"addon",
@ -22,10 +22,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"jsx-to-string": "^1.4.0",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
@ -28,11 +28,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook Addon Prop Editor Component",
"keywords": [
"addon",
@ -22,11 +22,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/client-api": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/client-api": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.0.1",
"escape-html": "^1.0.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Story Links addon for storybook",
"keywords": [
"addon",
@ -22,9 +22,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/router": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/router": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-notes",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
@ -23,13 +23,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/router": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/router": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"markdown-to-jsx": "^6.9.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-ondevice-actions",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Action Logger addon for react-native storybook",
"keywords": [
"storybook"
@ -19,13 +19,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^2.5.7",
"fast-deep-equal": "^2.0.1"
},
"devDependencies": {
"@storybook/addon-actions": "5.2.0-alpha.30"
"@storybook/addon-actions": "5.2.0-alpha.31"
},
"peerDependencies": {
"@storybook/addon-actions": "*",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-ondevice-backgrounds",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A react-native storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
@ -24,7 +24,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"prop-types": "^15.7.2"
},

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-ondevice-knobs",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Display storybook story knobs on your deviced.",
"keywords": [
"addon",
@ -21,8 +21,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"deep-equal": "^1.0.1",
"prop-types": "^15.7.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-ondevice-notes",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Write notes for your react-native Storybook stories.",
"keywords": [
"addon",
@ -20,7 +20,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"prop-types": "^15.7.2",
"react-native-simple-markdown": "^1.1.0"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-options",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Options addon for storybook",
"keywords": [
"addon",
@ -22,7 +22,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"util-deprecate": "^1.0.2"
},

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-queryparams",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@ -23,12 +23,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
"keywords": [
"addon",
@ -25,7 +25,7 @@
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"glob": "^7.1.3",
"global": "^4.3.2",

View File

@ -16,7 +16,8 @@ function integrityTest(integrityOptions, stories2snapsConverter) {
const possibleStoriesFiles = stories2snapsConverter.getPossibleStoriesFiles(fileName);
return !possibleStoriesFiles.some(fs.existsSync);
});
expect(abandonedStoryshots.length).toBe(0);
expect(abandonedStoryshots).toEqual([]);
});
});
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots-puppeteer",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Image snappshots addition to StoryShots base on puppeteer",
"keywords": [
"addon",
@ -22,8 +22,8 @@
"prepare": "node ../../../scripts/prepare.js"
},
"dependencies": {
"@storybook/node-logger": "5.2.0-alpha.30",
"@storybook/router": "5.2.0-alpha.30",
"@storybook/node-logger": "5.2.0-alpha.31",
"@storybook/router": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"jest-image-snapshot": "^2.8.2",
"regenerator-runtime": "^0.12.1"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Stories addon for storybook",
"keywords": [
"addon",
@ -22,10 +22,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/router": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/router": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"estraverse": "^4.2.0",
"loader-utils": "^1.2.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook addon to change the viewport size to mobile",
"keywords": [
"addon",
@ -21,12 +21,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"global": "^4.3.2",
"memoizerific": "^1.11.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -26,8 +26,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/node-logger": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"@storybook/node-logger": "5.2.0-alpha.31",
"angular2-template-loader": "^0.6.2",
"core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^1.3.4",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
"bugs": {
@ -24,7 +24,7 @@
},
"dependencies": {
"@ember/test-helpers": "^1.5.0",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/marko",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -26,7 +26,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/mithril",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
"keywords": [
"storybook"
@ -27,7 +27,7 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/polymer",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"@webcomponents/webcomponentsjs": "^1.2.0",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
@ -27,7 +27,7 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/rax",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Rax: Develop Rax Component in isolation.",
"keywords": [
"storybook",
@ -27,7 +27,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"babel-preset-rax": "^1.0.0-beta.0",
"common-tags": "^1.8.0",
"core-js": "^2.6.2",

View File

@ -7,4 +7,5 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

View File

@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';
const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;
const framework = 'rax';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);
export const { configure } = configApi;
export { forceReRender };

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-native-server",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A better way to develop React Native Components for your app",
"keywords": [
"react",
@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/channel-websocket": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/ui": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/channel-websocket": "5.2.0-alpha.31",
"@storybook/core": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/ui": "5.2.0-alpha.31",
"commander": "^2.19.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-native",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "A better way to develop React Native Components for your app",
"keywords": [
"react",
@ -23,11 +23,11 @@
},
"dependencies": {
"@emotion/native": "^10.0.10",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/channel-websocket": "5.2.0-alpha.30",
"@storybook/channels": "5.2.0-alpha.30",
"@storybook/client-api": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/channel-websocket": "5.2.0-alpha.31",
"@storybook/channels": "5.2.0-alpha.31",
"@storybook/client-api": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"core-js": "^3.0.1",
"react-native-swipe-gestures": "^1.0.3",
"rn-host-detect": "^1.1.5"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -29,8 +29,8 @@
"@babel/plugin-transform-react-constant-elements": "^7.2.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/node-logger": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"@storybook/node-logger": "5.2.0-alpha.31",
"@svgr/webpack": "^4.0.3",
"babel-plugin-add-react-displayname": "^0.0.5",
"babel-plugin-named-asset-import": "^0.3.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/riot",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -26,7 +26,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -26,7 +26,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-parameter",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "parameter addon for storybook",
"keywords": [
"devkit",
@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-roundtrip",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"description": "roundtrip addon for storybook",
"keywords": [
"devkit",
@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/api": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/api": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -74,6 +74,14 @@ addParameters({
* theme storybook, see link below
*/
theme: undefined,
/**
* function to sort stories in the tree view
* common use is alphabetical `(a, b) => a[1].id.localeCompare(b[1].id)`
* if left undefined, then the order in which the stories are imported will
* be the order they display
* @type {Function}
*/
storySort: undefined
},
});
```

View File

@ -1 +1 @@
{"version":"5.2.0-alpha.30","info":{"plain":"This release merges `release/docs-technical-preview` branch back into `next` through a series of PRs. It also contains other changes that came in on `next` since the last alpha.\n\n### Features\n\n* CLI: Add info command to print environment information ([#6937](https://github.com/storybookjs/storybook/pull/6937))\n* CLI: Use process.env.CI if available ([#7118](https://github.com/storybookjs/storybook/pull/7118))\n* Addon-docs: Source loader library ([#7117](https://github.com/storybookjs/storybook/pull/7117))\n* Addon-docs: Support non-story exports in MDX ([#7188](https://github.com/storybookjs/storybook/pull/7188))\n* Addon-docs: Support non-story exports in module format ([#7185](https://github.com/storybookjs/storybook/pull/7185))\n* Addon-docs: Docs mode with `--docs` flag ([#7154](https://github.com/storybookjs/storybook/pull/7154))\n* Addon-docs: Convert to module format codemod ([#7174](https://github.com/storybookjs/storybook/pull/7174))\n* Addon-docs: MDX support ([#7145](https://github.com/storybookjs/storybook/pull/7145))\n* Addon-docs: Component parameter codemod ([#7155](https://github.com/storybookjs/storybook/pull/7155))\n* Addon-docs: DocsPage and doc blocks ([#7119](https://github.com/storybookjs/storybook/pull/7119))\n* Addon-docs: Module story format & framework param ([#7110](https://github.com/storybookjs/storybook/pull/7110))\n* Addon-docs: Basic skeleton, UI viewMode handling ([#7107](https://github.com/storybookjs/storybook/pull/7107))\n\n### Bug Fixes\n\n* Addon-backgrounds: Fix unstretched preview background wrapper ([#7173](https://github.com/storybookjs/storybook/pull/7173))\n* Addon-notes/info: Fix indenting on markdown code blocks ([#7158](https://github.com/storybookjs/storybook/pull/7158))\n* Core: Improve HMR error reporting, no refreshes needed for error recovery ([#6972](https://github.com/storybookjs/storybook/pull/6972))\n* Addon-info: change stylesheetBase info height from 110vh to 100vh ([#7141](https://github.com/storybookjs/storybook/pull/7141))\n\n### Maintenance\n\n* Typescript: Migrate addon viewport ([#7177](https://github.com/storybookjs/storybook/pull/7177))\n\n### Dependency Upgrades\n\n* Bump css-loader from 2.1.1 to 3.0.0 ([#7122](https://github.com/storybookjs/storybook/pull/7122))\n* Upgrade core-js to 3.x in devkits ([#7171](https://github.com/storybookjs/storybook/pull/7171))\n* UPGRADE lazy-universal-dotenv ([#7151](https://github.com/storybookjs/storybook/pull/7151))"}}
{"version":"5.2.0-alpha.31","info":{"plain":"### Breaking Changes\n\n* Module format: story field for name/parameters annotation ([#7202](https://github.com/storybookjs/storybook/pull/7202))\n\n### Features\n\n* Core: Story sorting ([#6472](https://github.com/storybookjs/storybook/pull/6472))\n\n### Maintenance\n\n* Addon-docs: Fix source-loader CI errors ([#7203](https://github.com/storybookjs/storybook/pull/7203))"}}

View File

@ -1,6 +1,6 @@
{
"name": "crna-kitchen-sink",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
@ -24,14 +24,14 @@
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-transform-react-jsx-source": "^7.2.0",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-knobs": "5.2.0-alpha.30",
"@storybook/addon-ondevice-actions": "5.2.0-alpha.30",
"@storybook/addon-ondevice-backgrounds": "5.2.0-alpha.30",
"@storybook/addon-ondevice-knobs": "5.2.0-alpha.30",
"@storybook/addon-ondevice-notes": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/react-native": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-knobs": "5.2.0-alpha.31",
"@storybook/addon-ondevice-actions": "5.2.0-alpha.31",
"@storybook/addon-ondevice-backgrounds": "5.2.0-alpha.31",
"@storybook/addon-ondevice-knobs": "5.2.0-alpha.31",
"@storybook/addon-ondevice-notes": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/react-native": "5.2.0-alpha.31",
"babel-loader": "^8.0.4",
"babel-plugin-module-resolver": "^3.2.0",
"babel-preset-expo": "^5.1.1",

View File

@ -5,7 +5,7 @@ module.exports = async ({ config }: { config: any }) => {
test: [/\.stories\.tsx?$/, /index\.ts$/],
loaders: [
{
loader: require.resolve('@storybook/source-loader'),
loader: require.resolve('@storybook/addon-storysource/loader'),
options: {
parser: 'typescript',
},

View File

@ -1,6 +1,6 @@
{
"name": "angular-cli",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"license": "MIT",
"scripts": {
@ -34,19 +34,19 @@
"@angular-devkit/build-angular": "^0.13.4",
"@angular/cli": "^7.3.6",
"@angular/compiler-cli": "^7.2.6",
"@storybook/addon-a11y": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-backgrounds": "5.2.0-alpha.30",
"@storybook/addon-centered": "5.2.0-alpha.30",
"@storybook/addon-jest": "5.2.0-alpha.30",
"@storybook/addon-knobs": "5.2.0-alpha.30",
"@storybook/addon-links": "5.2.0-alpha.30",
"@storybook/addon-notes": "5.2.0-alpha.30",
"@storybook/addon-options": "5.2.0-alpha.30",
"@storybook/addon-storyshots": "5.2.0-alpha.30",
"@storybook/addon-storysource": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/angular": "5.2.0-alpha.30",
"@storybook/addon-a11y": "5.2.0-alpha.31",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-backgrounds": "5.2.0-alpha.31",
"@storybook/addon-centered": "5.2.0-alpha.31",
"@storybook/addon-jest": "5.2.0-alpha.31",
"@storybook/addon-knobs": "5.2.0-alpha.31",
"@storybook/addon-links": "5.2.0-alpha.31",
"@storybook/addon-notes": "5.2.0-alpha.31",
"@storybook/addon-options": "5.2.0-alpha.31",
"@storybook/addon-storyshots": "5.2.0-alpha.31",
"@storybook/addon-storysource": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/angular": "5.2.0-alpha.31",
"@types/core-js": "^2.5.0",
"@types/jest": "^24.0.11",
"@types/node": "~12.0.2",

View File

@ -1,4 +1,4 @@
import { configure, addParameters, addDecorator } from '@storybook/react';
import { load, addParameters, addDecorator } from '@storybook/react';
import { create } from '@storybook/theming';
import { withA11y } from '@storybook/addon-a11y';
@ -18,16 +18,8 @@ addParameters({
brandUrl: 'https://github.com/storybookjs/storybook/tree/master/examples/cra-kitchen-sink',
gridCellSize: 12,
}),
storySort: (a, b) => a[1].id.localeCompare(b[1].id),
},
});
function loadStories() {
// 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$/);
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
load(require.context('../src/stories', true, /\.stories\.js$/), module);

View File

@ -1,6 +1,6 @@
{
"name": "cra-kitchen-sink",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -19,22 +19,22 @@
"react-lifecycles-compat": "^3.0.4"
},
"devDependencies": {
"@storybook/addon-a11y": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-backgrounds": "5.2.0-alpha.30",
"@storybook/addon-centered": "5.2.0-alpha.30",
"@storybook/addon-events": "5.2.0-alpha.30",
"@storybook/addon-info": "5.2.0-alpha.30",
"@storybook/addon-jest": "5.2.0-alpha.30",
"@storybook/addon-knobs": "5.2.0-alpha.30",
"@storybook/addon-links": "5.2.0-alpha.30",
"@storybook/addon-notes": "5.2.0-alpha.30",
"@storybook/addon-options": "5.2.0-alpha.30",
"@storybook/addon-storyshots": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/client-logger": "5.2.0-alpha.30",
"@storybook/react": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addon-a11y": "5.2.0-alpha.31",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-backgrounds": "5.2.0-alpha.31",
"@storybook/addon-centered": "5.2.0-alpha.31",
"@storybook/addon-events": "5.2.0-alpha.31",
"@storybook/addon-info": "5.2.0-alpha.31",
"@storybook/addon-jest": "5.2.0-alpha.31",
"@storybook/addon-knobs": "5.2.0-alpha.31",
"@storybook/addon-links": "5.2.0-alpha.31",
"@storybook/addon-notes": "5.2.0-alpha.31",
"@storybook/addon-options": "5.2.0-alpha.31",
"@storybook/addon-storyshots": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/client-logger": "5.2.0-alpha.31",
"@storybook/react": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"react-scripts": "^3.0.1"
}
}

View File

@ -1,8 +1,15 @@
// FIXME: svgr issue @igor-dv
import React from 'react';
import { storiesOf } from '@storybook/react';
import App from '../App';
storiesOf('App', module).add('full app', () => <App />);
export default {
title: 'App',
};
export const fullApp = () => <App />;
fullApp.story = {
name: 'full app',
};

View File

@ -1,5 +1,8 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import LifecycleLogger from '../components/LifecycleLogger';
storiesOf('Lifecycle', module).add('logging', () => <LifecycleLogger />);
export default {
title: 'Lifecycle',
};
export const logging = () => <LifecycleLogger />;

View File

@ -1,9 +1,13 @@
import React from 'react';
import { storiesOf, forceReRender } from '@storybook/react';
import { forceReRender } from '@storybook/react';
let Component;
storiesOf('CRA', module).add('Dynamic import', () => {
export default {
title: 'CRA',
};
export const story1 = () => {
if (!Component) {
import('@storybook/react/demo').then(({ Button }) => {
Component = Button;
@ -14,4 +18,6 @@ storiesOf('CRA', module).add('Dynamic import', () => {
}
return <Component>Hello Button</Component>;
});
};
story1.story = { name: 'Dynamic import' };

View File

@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf, forceReRender } from '@storybook/react';
import { forceReRender } from '@storybook/react';
let count = 0;
const increment = () => {
@ -7,8 +7,12 @@ const increment = () => {
forceReRender();
};
storiesOf('Force ReRender', module).add('button', () => (
export default {
title: 'Force ReRender',
};
export const button = () => (
<button type="button" onClick={increment}>
Click me to increment: {count}
</button>
));
);

View File

@ -1,5 +1,5 @@
/* eslint-disable react/destructuring-assignment */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withInfo } from '@storybook/addon-info';
import { Button } from '@storybook/react/demo';
@ -23,46 +23,61 @@ const InfoButton = () => (
</span>
);
storiesOf('Button', module)
.addParameters({
export default {
title: 'Button',
parameters: {
component: Button,
})
.add('with text', () => <Button onClick={action('clicked', { depth: 1 })}>Hello Button</Button>, {
},
};
export const story1 = () => <Button onClick={action('clicked', { depth: 1 })}>Hello Button</Button>;
story1.story = {
name: 'with text',
parameters: {
options: { selectedPanel: 'storybook/actions/panel' },
})
.add(
'with some emoji',
() => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="yolo">
😀 😎 👍 💯
</span>
</Button>
),
{
options: { selectedPanel: 'storybook/actions/panel' },
}
)
.add('with notes', () => <Button>Check my notes in the notes panel</Button>, {
},
};
export const story2 = () => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="yolo">
😀 😎 👍 💯
</span>
</Button>
);
story2.story = {
name: 'with some emoji',
parameters: {
options: { selectedPanel: 'storybook/actions/panel' },
},
};
export const story3 = () => <Button>Check my notes in the notes panel</Button>;
story3.story = {
name: 'with notes',
parameters: {
notes: 'A very simple button',
options: { selectedPanel: 'storybook/notes/panel' },
})
.add(
'with new info',
context => (
<Container>
<span>
click the <InfoButton /> label in top right for info about "{context.name}"
</span>
</Container>
),
{
notes: 'Composition: Info(Notes())',
options: { selectedPanel: 'storybook/info/panel' },
decorators: [
withInfo(
'Use the [info addon](https://github.com/storybookjs/storybook/tree/master/addons/info) with its new painless API.'
),
],
}
);
},
};
export const story4 = context => (
<Container>
<span>
click the <InfoButton /> label in top right for info about "{context.name}"
</span>
</Container>
);
story4.story = {
name: 'with new info',
parameters: {
notes: 'Composition: Info(Notes())',
options: { selectedPanel: 'storybook/info/panel' },
decorators: [
withInfo(
'Use the [info addon](https://github.com/storybookjs/storybook/tree/master/addons/info) with its new painless API.'
),
],
},
};

View File

@ -1,9 +1,12 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import centered from '@storybook/addon-centered/react';
import { Button } from '@storybook/react/demo';
storiesOf('Some really long story kind description', module)
.addDecorator(centered)
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>);
export default {
title: 'Some really long story kind description',
decorators: [centered],
};
export const story1 = () => <Button onClick={action('clicked')}>Hello Button</Button>;
story1.story = { name: 'with text' };

View File

@ -1,10 +1,14 @@
import React from 'react';
import { Welcome } from '@storybook/react/demo';
import { storiesOf } from '@storybook/react';
import { linkTo } from '@storybook/addon-links';
storiesOf('Welcome', module)
.addParameters({
export default {
title: 'Welcome',
parameters: {
component: Welcome,
})
.add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
},
};
export const story1 = () => <Welcome showApp={linkTo('Button')} />;
story1.title = 'to Storybook';

View File

@ -1,14 +1,10 @@
import { configure, addParameters } from '@storybook/react';
import { load, addParameters } from '@storybook/react';
import { create } from '@storybook/theming/create';
function loadStories() {
require('../src/stories');
}
addParameters({
options: {
theme: create({ colorPrimary: 'hotpink', colorSecondary: 'orangered' }),
},
});
configure(loadStories, module);
load(require.context('../src/stories', true, /\.stories\.js$/), module);

View File

@ -1,6 +1,6 @@
{
"name": "cra-react15",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"dependencies": {
"babel-loader": "8.0.6",
@ -19,10 +19,10 @@
"build-storybook": "build-storybook -s public"
},
"devDependencies": {
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-links": "5.2.0-alpha.30",
"@storybook/react": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-links": "5.2.0-alpha.31",
"@storybook/react": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"babel-core": "6",
"babel-runtime": "6"
}

View File

@ -0,0 +1,22 @@
import React from 'react';
import { action } from '@storybook/addon-actions';
import { Button } from '@storybook/react/demo';
export default {
title: 'Button',
parameters: {
component: Button,
},
};
export const story1 = () => <Button onClick={action('clicked')}>Hello Button</Button>;
story1.story = { name: 'with text' };
export const story2 = () => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
);
story2.story = { name: 'with some emoji' };

View File

@ -1,26 +0,0 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module)
.addParameters({
component: Welcome,
})
.add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
storiesOf('Button', module)
.addParameters({
component: Button,
})
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
.add('with some emoji', () => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
));

View File

@ -0,0 +1,13 @@
import React from 'react';
import { linkTo } from '@storybook/addon-links';
import { Welcome } from '@storybook/react/demo';
export default {
title: 'Welcome',
parameters: {
component: Welcome,
},
};
export const story1 = () => <Welcome showApp={linkTo('Button')} />;
story1.story = { name: 'to Storybook' };

View File

@ -1,6 +1,6 @@
{
"name": "cra-ts-kitchen-sink",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"scripts": {
"build-storybook": "build-storybook -s public",
@ -14,12 +14,12 @@
"react-dom": "^16.8.3"
},
"devDependencies": {
"@storybook/addon-a11y": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-info": "5.2.0-alpha.30",
"@storybook/addon-options": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/react": "5.2.0-alpha.30",
"@storybook/addon-a11y": "5.2.0-alpha.31",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-info": "5.2.0-alpha.31",
"@storybook/addon-options": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/react": "5.2.0-alpha.31",
"@types/enzyme": "^3.9.0",
"@types/react": "^16.8.3",
"@types/react-dom": "^16.8.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/example-devkits",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"scripts": {
"build-storybook": "build-storybook -c ./ -s built-storybooks",
@ -8,14 +8,14 @@
"storybook": "start-storybook -p 9011 -c ./"
},
"devDependencies": {
"@storybook/addon-parameter": "5.2.0-alpha.30",
"@storybook/addon-roundtrip": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/components": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/node-logger": "5.2.0-alpha.30",
"@storybook/react": "5.2.0-alpha.30",
"@storybook/theming": "5.2.0-alpha.30",
"@storybook/addon-parameter": "5.2.0-alpha.31",
"@storybook/addon-roundtrip": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/components": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/node-logger": "5.2.0-alpha.31",
"@storybook/react": "5.2.0-alpha.31",
"@storybook/theming": "5.2.0-alpha.31",
"cors": "^2.8.5",
"cross-env": "^5.2.0",
"enzyme-to-json": "^3.3.5",

View File

@ -1,4 +1,4 @@
import { configure, addParameters, addDecorator } from '@storybook/ember';
import { load, addParameters, addDecorator } from '@storybook/ember';
import { withA11y } from '@storybook/addon-a11y';
addDecorator(withA11y);
@ -9,11 +9,4 @@ addParameters({
},
});
function loadStories() {
require('../stories/index.stories');
const req = require.context('../stories', true, /\.stories\.js$/);
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
load(require.context('../stories', true, /\.stories\.js$/), module);

View File

@ -3,7 +3,7 @@ const path = require('path');
module.exports = async ({ config }) => {
config.module.rules.push({
test: [/\.stories\.js$/, /index\.js$/],
loaders: [require.resolve('@storybook/source-loader')],
loaders: [require.resolve('@storybook/addon-storysource/loader')],
include: [path.resolve(__dirname, '../')],
enforce: 'pre',
});

View File

@ -1,6 +1,6 @@
{
"name": "ember-example",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"scripts": {
"build": "ember build",
@ -15,19 +15,19 @@
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@storybook/addon-a11y": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-backgrounds": "5.2.0-alpha.30",
"@storybook/addon-centered": "5.2.0-alpha.30",
"@storybook/addon-knobs": "5.2.0-alpha.30",
"@storybook/addon-links": "5.2.0-alpha.30",
"@storybook/addon-notes": "5.2.0-alpha.30",
"@storybook/addon-options": "5.2.0-alpha.30",
"@storybook/addon-storysource": "5.2.0-alpha.30",
"@storybook/addon-viewport": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/ember": "5.2.0-alpha.30",
"@storybook/source-loader": "5.2.0-alpha.30",
"@storybook/addon-a11y": "5.2.0-alpha.31",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-backgrounds": "5.2.0-alpha.31",
"@storybook/addon-centered": "5.2.0-alpha.31",
"@storybook/addon-knobs": "5.2.0-alpha.31",
"@storybook/addon-links": "5.2.0-alpha.31",
"@storybook/addon-notes": "5.2.0-alpha.31",
"@storybook/addon-options": "5.2.0-alpha.31",
"@storybook/addon-storysource": "5.2.0-alpha.31",
"@storybook/addon-viewport": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/ember": "5.2.0-alpha.31",
"@storybook/source-loader": "5.2.0-alpha.31",
"babel-loader": "^8",
"broccoli-asset-rev": "^3.0.0",
"cross-env": "^5.2.0",

View File

@ -1,15 +1,22 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { checkA11y } from '@storybook/addon-a11y';
storiesOf('Addon|a11y', module)
.addDecorator(checkA11y)
.addParameters({ options: { selectedPanel: '@storybook/a11y/panel' } })
.add('Default', () => hbs`<button></button>`)
.add('Label', () => hbs`<button>Testing the a11y addon</button>`)
.add('Disabled', () => hbs`<button disabled>Testing the a11y addon</button>`)
.add(
'Invalid contrast',
() =>
hbs`<button style="color: black; background-color: brown;">Testing the a11y addon</button>`
);
export default {
title: 'Addon|a11y',
decorators: [checkA11y],
parameters: {
options: { selectedPanel: '@storybook/a11y/panel' },
},
};
export const Default = () => hbs`<button></button>`;
export const Label = () => hbs`<button>Testing the a11y addon</button>`;
export const Disabled = () => hbs`<button disabled>Testing the a11y addon</button>`;
export const invalidContrast = () =>
hbs`<button style="color: black; background-color: brown;">Testing the a11y addon</button>`;
invalidContrast.story = {
name: 'Invalid contrast',
};

View File

@ -1,16 +1,19 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { action } from '@storybook/addon-actions';
storiesOf('Addon|Actions', module)
.addParameters({
export default {
title: 'Addon|Actions',
parameters: {
options: {
selectedPanel: 'storybook/actions/panel',
},
})
.add('button', () => ({
template: hbs`<button {{action onClick}}>Click Me</button>`,
context: {
onClick: action('clicked'),
},
}));
},
};
export const button = () => ({
template: hbs`<button {{action onClick}}>Click Me</button>`,
context: {
onClick: action('clicked'),
},
});

View File

@ -1,16 +1,28 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
storiesOf('Addon|Backgrounds', module)
.addParameters({
export default {
title: 'Addon|Backgrounds',
parameters: {
backgrounds: [
{ name: 'light', value: '#eeeeee' },
{ name: 'dark', value: '#222222', default: true },
],
})
.add('story 1', () => ({
template: hbs`<button>You should be able to switch backgrounds for this story</button>`,
}))
.add('story 2', () => ({
template: hbs`<button>This one too!</button>`,
}));
},
};
export const story1 = () => ({
template: hbs`<button>You should be able to switch backgrounds for this story</button>`,
});
story1.story = {
name: 'story 1',
};
export const story2 = () => ({
template: hbs`<button>This one too!</button>`,
});
story2.story = {
name: 'story 2',
};

View File

@ -1,12 +1,15 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import Centered from '@storybook/addon-centered/ember';
storiesOf('Addon|Centered', module)
.addParameters({
export default {
title: 'Addon|Centered',
decorators: [Centered],
parameters: {
component: Centered,
})
.addDecorator(Centered)
.add('button', () => ({
template: hbs`<button>A Button</button>`,
}));
},
};
export const button = () => ({
template: hbs`<button>A Button</button>`,
});

View File

@ -1,13 +1,18 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { withKnobs, text, color, boolean } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
storiesOf('Addon|Knobs', module)
.addDecorator(withKnobs)
.addParameters({ options: { selectedPanel: 'storybookjs/knobs/panel' } })
.add('with text', () => ({
template: hbs`
export default {
title: 'Addon|Knobs',
decorators: [withKnobs],
parameters: {
options: { selectedPanel: 'storybookjs/knobs/panel' },
},
};
export const withText = () => ({
template: hbs`
{{welcome-banner
style=(if hidden "display: none")
backgroundColor=backgroundColor
@ -18,13 +23,17 @@ storiesOf('Addon|Knobs', module)
click=(action onClick)
}}
`,
context: {
hidden: boolean('hidden', false),
backgroundColor: color('backgroundColor', '#FDF4E7'),
titleColor: color('titleColor', '#DF4D37'),
subTitleColor: color('subTitleColor', '#B8854F'),
title: text('title', 'Welcome to storybook'),
subtitle: text('subtitle', 'This environment is completely editable'),
onClick: action('clicked'),
},
}));
context: {
hidden: boolean('hidden', false),
backgroundColor: color('backgroundColor', '#FDF4E7'),
titleColor: color('titleColor', '#DF4D37'),
subTitleColor: color('subTitleColor', '#B8854F'),
title: text('title', 'Welcome to storybook'),
subtitle: text('subtitle', 'This environment is completely editable'),
onClick: action('clicked'),
},
});
withText.story = {
name: 'with text',
};

View File

@ -1,10 +1,17 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { linkTo } from '@storybook/addon-links';
storiesOf('Addon|Links', module).add('Go to welcome', () => ({
export default {
title: 'Addon|Links',
};
export const goToWelcome = () => ({
template: hbs`<button {{action onClick}}>This button brings you to welcome</button>`,
context: {
onClick: linkTo('Welcome'),
},
}));
});
goToWelcome.story = {
name: 'Go to welcome',
};

View File

@ -1,26 +1,32 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
storiesOf('Addon|Notes', module)
.add(
'Simple note',
() => ({
template: hbs`<p><strong>Etiam vulputate elit eu venenatis eleifend. Duis nec lectus augue. Morbi egestas diam sed vulputate mollis. Fusce egestas pretium vehicula. Integer sed neque diam. Donec consectetur velit vitae enim varius, ut placerat arcu imperdiet. Praesent sed faucibus arcu. Nullam sit amet nibh a enim eleifend rhoncus. Donec pretium elementum leo at fermentum. Nulla sollicitudin, mauris quis semper tempus, sem metus tristique diam, efficitur pulvinar mi urna id urna.</strong></p>`,
}),
{ notes: 'My notes on some bold text' }
)
.add(
'Note with HTML',
() => ({
template: hbs`<p>🤔😳😯😮<br/>😄😩😓😱<br/>🤓😑😶😊</p>`,
}),
{
notes: `
<h2>My notes on emojies</h2>
export default {
title: 'Addon|Notes',
};
<em>It's not all that important to be honest, but..</em>
export const simpleNote = () => ({
template: hbs`<p><strong>Etiam vulputate elit eu venenatis eleifend. Duis nec lectus augue. Morbi egestas diam sed vulputate mollis. Fusce egestas pretium vehicula. Integer sed neque diam. Donec consectetur velit vitae enim varius, ut placerat arcu imperdiet. Praesent sed faucibus arcu. Nullam sit amet nibh a enim eleifend rhoncus. Donec pretium elementum leo at fermentum. Nulla sollicitudin, mauris quis semper tempus, sem metus tristique diam, efficitur pulvinar mi urna id urna.</strong></p>`,
});
Emojis are great, I love emojis, in fact I like using them in my Component notes too! 😇
`,
}
);
simpleNote.story = {
name: 'Simple note',
parameters: { notes: 'My notes on some bold text' },
};
export const noteWithHtml = () => ({
template: hbs`<p>🤔😳😯😮<br/>😄😩😓😱<br/>🤓😑😶😊</p>`,
});
noteWithHtml.story = {
name: 'Note with HTML',
parameters: {
notes: `
<h2>My notes on emojies</h2>
<em>It's not all that important to be honest, but..</em>
Emojis are great, I love emojis, in fact I like using them in my Component notes too! 😇
`,
},
};

View File

@ -1,10 +1,15 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
storiesOf('Welcome', module)
.addParameters({ options: { showPanel: false } })
.add('basic', () => ({
template: hbs`
export default {
title: 'Welcome',
parameters: {
options: { showPanel: false },
},
};
export const basic = () => ({
template: hbs`
{{welcome-page}}
`,
}));
});

View File

@ -1,8 +1,11 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { action } from '@storybook/addon-actions';
storiesOf('welcome-banner', module).add('basic', () => ({
export default {
title: 'welcome-banner',
};
export const basic = () => ({
template: hbs`
{{welcome-banner
backgroundColor=backgroundColor
@ -21,4 +24,4 @@ storiesOf('welcome-banner', module).add('basic', () => ({
subtitle: 'This environment is completely editable',
onClick: action('clicked'),
},
}));
});

View File

@ -1,4 +1,4 @@
import { configure, addParameters, addDecorator } from '@storybook/html';
import { load, addParameters, addDecorator } from '@storybook/html';
import { withA11y } from '@storybook/addon-a11y';
addDecorator(withA11y);
@ -16,12 +16,4 @@ addParameters({
},
});
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
// Make welcome story default
require('../stories/index.stories');
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
load(require.context('../stories', true, /\.stories\.js$/), module);

View File

@ -3,7 +3,7 @@ const path = require('path');
module.exports = async ({ config }) => {
config.module.rules.push({
test: [/\.stories\.js$/, /index\.js$/],
loaders: [require.resolve('@storybook/source-loader')],
loaders: [require.resolve('@storybook/addon-storysource/loader')],
include: [path.resolve(__dirname, '../stories')],
enforce: 'pre',
});

View File

@ -1,6 +1,6 @@
{
"name": "html-kitchen-sink",
"version": "5.2.0-alpha.30",
"version": "5.2.0-alpha.31",
"private": true,
"description": "",
"keywords": [],
@ -14,24 +14,24 @@
"storybook": "start-storybook -p 9006"
},
"devDependencies": {
"@storybook/addon-a11y": "5.2.0-alpha.30",
"@storybook/addon-actions": "5.2.0-alpha.30",
"@storybook/addon-backgrounds": "5.2.0-alpha.30",
"@storybook/addon-centered": "5.2.0-alpha.30",
"@storybook/addon-events": "5.2.0-alpha.30",
"@storybook/addon-jest": "5.2.0-alpha.30",
"@storybook/addon-knobs": "5.2.0-alpha.30",
"@storybook/addon-links": "5.2.0-alpha.30",
"@storybook/addon-notes": "5.2.0-alpha.30",
"@storybook/addon-options": "5.2.0-alpha.30",
"@storybook/addon-storyshots": "5.2.0-alpha.30",
"@storybook/addon-storysource": "5.2.0-alpha.30",
"@storybook/addon-viewport": "5.2.0-alpha.30",
"@storybook/addons": "5.2.0-alpha.30",
"@storybook/core": "5.2.0-alpha.30",
"@storybook/core-events": "5.2.0-alpha.30",
"@storybook/html": "5.2.0-alpha.30",
"@storybook/source-loader": "5.2.0-alpha.30",
"@storybook/addon-a11y": "5.2.0-alpha.31",
"@storybook/addon-actions": "5.2.0-alpha.31",
"@storybook/addon-backgrounds": "5.2.0-alpha.31",
"@storybook/addon-centered": "5.2.0-alpha.31",
"@storybook/addon-events": "5.2.0-alpha.31",
"@storybook/addon-jest": "5.2.0-alpha.31",
"@storybook/addon-knobs": "5.2.0-alpha.31",
"@storybook/addon-links": "5.2.0-alpha.31",
"@storybook/addon-notes": "5.2.0-alpha.31",
"@storybook/addon-options": "5.2.0-alpha.31",
"@storybook/addon-storyshots": "5.2.0-alpha.31",
"@storybook/addon-storysource": "5.2.0-alpha.31",
"@storybook/addon-viewport": "5.2.0-alpha.31",
"@storybook/addons": "5.2.0-alpha.31",
"@storybook/core": "5.2.0-alpha.31",
"@storybook/core-events": "5.2.0-alpha.31",
"@storybook/html": "5.2.0-alpha.31",
"@storybook/source-loader": "5.2.0-alpha.31",
"eventemitter3": "^3.1.0",
"format-json": "^1.0.3",
"global": "^4.3.2"

View File

@ -1,27 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|a11y Default 1`] = `<button />`;
exports[`Storyshots Addons|a11y Delayed render 1`] = `<div />`;
exports[`Storyshots Addons|a11y Disabled 1`] = `
<button
disabled=""
>
Testing the a11y addon
</button>
`;
exports[`Storyshots Addons|a11y Invalid contrast 1`] = `
<button
style="color: black; background-color: brown;"
>
Testing the a11y addon
</button>
`;
exports[`Storyshots Addons|a11y Label 1`] = `
<button>
Testing the a11y addon
</button>
`;

View File

@ -1,62 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Actions Decorated actions + config 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Decorated actions 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Hello World 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Multiple actions + config 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Multiple actions 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Multiple actions, object + config 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Multiple actions, object 1`] = `
<button
type="button"
>
Hello World
</button>
`;
exports[`Storyshots Addons|Actions Multiple actions, selector 1`] = `
`;

View File

@ -1,17 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Backgrounds story 1 1`] = `
<span
style="color: white"
>
You should be able to switch backgrounds for this story
</span>
`;
exports[`Storyshots Addons|Backgrounds story 2 1`] = `
<span
style="color: white"
>
This one too!
</span>
`;

View File

@ -1,17 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Centered button in center 1`] = `
<div
id="sb-addon-centered-wrapper"
style="position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; display: flex; align-items: center; overflow: auto;"
>
<div
id="sb-addon-centered-inner"
style="margin: auto; max-height: 100%;"
>
<button>
I am a Button !
</button>
</div>
</div>
`;

View File

@ -1,6 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Events Logger 1`] = `
`;

View File

@ -1,3 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Jest withTests 1`] = `This story shows test results`;

View File

@ -1,70 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Knobs All knobs 1`] = `
<div
style="border: 2px dotted deeppink; padding: 8px 22px; border-radius: 8px"
>
<h1>
My name is Jane,
</h1>
<h3>
today is January 20, 2017
</h3>
<p>
I have a stock of 20 apples, costing $2.25 each.
</p>
<p>
Also, I have:
</p>
<ul>
<li>
Laptop
</li>
<li>
Book
</li>
<li>
Whiskey
</li>
</ul>
<p>
Nice to meet you!
</p>
</div>
`;
exports[`Storyshots Addons|Knobs CSS transitions 1`] = `
<p
style="transition: color 0.5s ease-out; color: orangered;"
>
John Doe
</p>
`;
exports[`Storyshots Addons|Knobs DOM 1`] = `
<p>
John Doe
</p>
`;
exports[`Storyshots Addons|Knobs Simple 1`] = `
<div>
I am John Doe and I'm 44 years old.
</div>
`;
exports[`Storyshots Addons|Knobs XSS safety 1`] = `&lt;img src=x onerror="alert('XSS Attack')" &gt;`;

View File

@ -1,15 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Addons|Notes Simple note 1`] = `
<p>
<strong>
This is a fragment of HTML
</strong>
</p>
`;

View File

@ -1,34 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Storyshots Demo button 1`] = `
<button>
Hello Button
</button>
`;
exports[`Storyshots Demo heading 1`] = `
<h1>
Hello World
</h1>
`;
exports[`Storyshots Demo headings 1`] = `
<section>
<h1>
Hello World
</h1>
<h2>
Hello World
</h2>
<h3>
Hello World
</h3>
<h4>
Hello World
</h4>
</section>
`;
exports[`Storyshots Welcome Welcome 1`] = `
<div
class="main"

View File

@ -1,23 +1,28 @@
import { document, setTimeout } from 'global';
import { storiesOf } from '@storybook/html';
import { withA11y } from '@storybook/addon-a11y';
const text = 'Testing the a11y addon';
storiesOf('Addons|a11y', module)
.addDecorator(withA11y)
.addParameters({ options: { selectedPanel: 'storybook/a11y/panel' } })
.add('Default', () => `<button></button>`)
.add('Label', () => `<button>${text}</button>`)
.add('Disabled', () => `<button disabled>${text}</button>`)
.add(
'Invalid contrast',
() => `<button style="color: black; background-color: brown;">${text}</button>`
)
.add('Delayed render', () => {
const div = document.createElement('div');
setTimeout(() => {
div.innerHTML = `<button>This button has a delayed render of 1s</button>`;
}, 1000);
return div;
});
export default {
title: 'Addons|a11y',
decorators: [withA11y],
parameters: {
options: { selectedPanel: 'storybook/a11y/panel' },
},
};
export const Default = () => `<button></button>`;
export const Label = () => `<button>${text}</button>`;
export const Disabled = () => `<button disabled>${text}</button>`;
export const story4 = () =>
`<button style="color: black; background-color: brown;">${text}</button>`;
story4.story = { name: 'Invalid contrast' };
export const story5 = () => {
const div = document.createElement('div');
setTimeout(() => {
div.innerHTML = `<button>This button has a delayed render of 1s</button>`;
}, 1000);
return div;
};
story5.story = { name: 'Delayed render' };

View File

@ -1,34 +1,44 @@
import { storiesOf } from '@storybook/html';
import { withActions, decorate } from '@storybook/addon-actions';
const pickTarget = decorate([args => [args[0].target]]);
const button = () => `<button type="button">Hello World</button>`;
storiesOf('Addons|Actions', module)
.add('Hello World', () => withActions('click')(button))
.add('Multiple actions', () => withActions('click', 'contextmenu')(button))
.add('Multiple actions + config', () =>
withActions('click', 'contextmenu', { clearOnStoryChange: false })(button)
)
.add('Multiple actions, object', () =>
withActions({ click: 'clicked', contextmenu: 'right clicked' })(button)
)
.add('Multiple actions, selector', () =>
withActions({ 'click .btn': 'clicked', contextmenu: 'right clicked' })(
() => `
export default {
title: 'Addons|Actions',
};
export const story1 = () => withActions('click')(button);
story1.story = { name: 'Hello World' };
export const story2 = () => withActions('click', 'contextmenu')(button);
story2.story = { name: 'Multiple actions' };
export const story3 = () =>
withActions('click', 'contextmenu', { clearOnStoryChange: false })(button);
story3.story = { name: 'Multiple actions + config' };
export const story4 = () => withActions({ click: 'clicked', contextmenu: 'right clicked' })(button);
story4.story = { name: 'Multiple actions, object' };
export const story5 = () =>
withActions({ 'click .btn': 'clicked', contextmenu: 'right clicked' })(
() => `
<div>
Clicks on this button will be logged: <button class="btn" type="button">Button</button>
</div>
`
)
)
.add('Multiple actions, object + config', () =>
withActions({ click: 'clicked', contextmenu: 'right clicked' }, { clearOnStoryChange: false })(
button
)
)
.add('Decorated actions', () => pickTarget.withActions('click', 'contextmenu')(button))
.add('Decorated actions + config', () =>
pickTarget.withActions('click', 'contextmenu', { clearOnStoryChange: false })(button)
);
story5.story = { name: 'Multiple actions, selector' };
export const story6 = () =>
withActions({ click: 'clicked', contextmenu: 'right clicked' }, { clearOnStoryChange: false })(
button
);
story6.story = { name: 'Multiple actions, object + config' };
export const story7 = () => pickTarget.withActions('click', 'contextmenu')(button);
story7.story = { name: 'Decorated actions' };
export const story8 = () =>
pickTarget.withActions('click', 'contextmenu', { clearOnStoryChange: false })(button);
story8.story = { name: 'Decorated actions + config' };

View File

@ -1,15 +1,16 @@
import { storiesOf } from '@storybook/html';
storiesOf('Addons|Backgrounds', module)
.addParameters({
export default {
title: 'Addons|Backgrounds',
parameters: {
backgrounds: [
{ name: 'light', value: '#eeeeee' },
{ name: 'dark', value: '#222222', default: true },
],
})
.add(
'story 1',
() =>
'<span style="color: white">You should be able to switch backgrounds for this story</span>'
)
.add('story 2', () => '<span style="color: white">This one too!</span>');
},
};
export const story1 = () =>
'<span style="color: white">You should be able to switch backgrounds for this story</span>';
story1.story = { name: 'story 1' };
export const story2 = () => '<span style="color: white">This one too!</span>';
story2.story = { name: 'story 2' };

View File

@ -1,6 +1,9 @@
import { storiesOf } from '@storybook/html';
import centered from '@storybook/addon-centered/html';
storiesOf('Addons|Centered', module)
.addDecorator(centered)
.add('button in center', () => '<button>I am a Button !</button>');
export default {
title: 'Addons|Centered',
decorators: [centered],
};
export const story1 = () => '<button>I am a Button !</button>';
story1.story = { name: 'button in center' };

View File

@ -1,5 +1,4 @@
import EventEmitter from 'eventemitter3';
import { storiesOf } from '@storybook/html';
import addons from '@storybook/addons';
import CoreEvents from '@storybook/core-events';
import json from 'format-json';
@ -32,8 +31,9 @@ const subscription = () => {
return () => eventHandlers.forEach(({ name, handler }) => emitter.removeListener(name, handler));
};
storiesOf('Addons|Events', module)
.addDecorator(
export default {
title: 'Addons|Events',
decorators: [
withEvents({
emit,
events: [
@ -83,33 +83,32 @@ storiesOf('Addons|Events', module)
],
},
],
})
)
.addDecorator(storyFn => {
addons.getChannel().emit(CoreEvents.REGISTER_SUBSCRIPTION, subscription);
return storyFn();
})
.add(
'Logger',
() => `
<div class="wrapper">
<h1 class="title">Logger</h1>
<dl>
${events
.map(
({ name, payload }) => `
<div class="item">
<dt>
<b>Event name:</b> ${name}
</dt>
<dd>
<b>Event payload:</b> ${json.plain(payload)}
</dd>
</div>
`
)
.join('')}
</dl>
</div>
`
);
}),
storyFn => {
addons.getChannel().emit(CoreEvents.REGISTER_SUBSCRIPTION, subscription);
return storyFn();
},
],
};
export const Logger = () => `
<div class="wrapper">
<h1 class="title">Logger</h1>
<dl>
${events
.map(
({ name, payload }) => `
<div class="item">
<dt>
<b>Event name:</b> ${name}
</dt>
<dd>
<b>Event payload:</b> ${json.plain(payload)}
</dd>
</div>
`
)
.join('')}
</dl>
</div>
`;

View File

@ -1,8 +1,10 @@
import { storiesOf } from '@storybook/html';
import { withTests } from '@storybook/addon-jest';
import { withTests as wt } from '@storybook/addon-jest';
import results from './addon-jest.testresults.json';
storiesOf('Addons|Jest', module)
.addDecorator(withTests({ results }))
.add('withTests', () => 'This story shows test results', { jest: 'addon-jest' });
export default {
title: 'Addons|Jest',
decorators: [wt({ results })],
};
export const withTests = () => 'This story shows test results';
withTests.parameters = { jest: 'addon-jest' };

Some files were not shown because too many files have changed in this diff Show More