From afc895d57a051f63ac3a42b8ea9e9f7b3f70acb9 Mon Sep 17 00:00:00 2001 From: igor Date: Tue, 6 Feb 2018 10:33:08 +0200 Subject: [PATCH] Separate polymer examples --- examples/polymer-cli/.storybook/addons.js | 1 + examples/polymer-cli/.storybook/config.js | 11 +- examples/polymer-cli/package.json | 1 + .../polymer-cli/src/playground-button.html | 12 +- .../src/stories/addon-actions.stories.js | 15 +++ .../src/stories/addon-knobs.stories.js | 56 ++++++++++ .../src/stories/addon-notes.stories.js | 23 ++++ .../src/stories/advanced.stories.js | 105 ------------------ .../src/stories/custom-decorators.stories.js | 14 +++ .../src/stories/custom-rendering.stories.js | 15 +++ .../polymer-cli/src/stories/index.stories.js | 25 +---- 11 files changed, 148 insertions(+), 130 deletions(-) create mode 100644 examples/polymer-cli/src/stories/addon-actions.stories.js create mode 100644 examples/polymer-cli/src/stories/addon-knobs.stories.js create mode 100644 examples/polymer-cli/src/stories/addon-notes.stories.js delete mode 100644 examples/polymer-cli/src/stories/advanced.stories.js create mode 100644 examples/polymer-cli/src/stories/custom-decorators.stories.js create mode 100644 examples/polymer-cli/src/stories/custom-rendering.stories.js diff --git a/examples/polymer-cli/.storybook/addons.js b/examples/polymer-cli/.storybook/addons.js index 1191fbebf30..40db0321909 100644 --- a/examples/polymer-cli/.storybook/addons.js +++ b/examples/polymer-cli/.storybook/addons.js @@ -2,3 +2,4 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-notes/register'; import '@storybook/addon-knobs/register'; import '@storybook/addon-viewport/register'; +import '@storybook/addon-options/register'; diff --git a/examples/polymer-cli/.storybook/config.js b/examples/polymer-cli/.storybook/config.js index 37ff6501478..ae9f20d8481 100644 --- a/examples/polymer-cli/.storybook/config.js +++ b/examples/polymer-cli/.storybook/config.js @@ -1,10 +1,15 @@ -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - import { configure } from '@storybook/polymer'; +import { setOptions } from '@storybook/addon-options'; + +setOptions({ + hierarchyRootSeparator: /\|/, +}); function loadStories() { require('../src/stories/index.stories'); - require('../src/stories/advanced.stories'); + + const req = require.context('../src/stories', true, /\.stories\.js$/); + req.keys().forEach((filename) => req(filename)); } configure(loadStories, module); diff --git a/examples/polymer-cli/package.json b/examples/polymer-cli/package.json index c91e7010e13..a94adc2a3ca 100644 --- a/examples/polymer-cli/package.json +++ b/examples/polymer-cli/package.json @@ -11,6 +11,7 @@ "@storybook/addon-actions": "^3.4.0-alpha.7", "@storybook/addon-knobs": "^3.4.0-alpha.7", "@storybook/addon-notes": "^3.4.0-alpha.7", + "@storybook/addon-options": "^3.4.0-alpha.7", "@storybook/addon-viewport": "^3.4.0-alpha.7", "@storybook/polymer": "^3.4.0-alpha.7", "@webcomponents/webcomponentsjs": "^1.1.0", diff --git a/examples/polymer-cli/src/playground-button.html b/examples/polymer-cli/src/playground-button.html index 272d6b2acc0..51a4b0ed5da 100644 --- a/examples/polymer-cli/src/playground-button.html +++ b/examples/polymer-cli/src/playground-button.html @@ -4,7 +4,15 @@