diff --git a/examples/angular-cli/.storybook/addons.js b/examples/angular-cli/.storybook/addons.js index c558d2235028..85b68e06ab66 100644 --- a/examples/angular-cli/.storybook/addons.js +++ b/examples/angular-cli/.storybook/addons.js @@ -4,3 +4,4 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; import '@storybook/addon-notes/register'; import '@storybook/addon-knobs/register'; +import '@storybook/addon-options/register'; diff --git a/examples/angular-cli/.storybook/config.js b/examples/angular-cli/.storybook/config.js index 8fb37a998635..b7d5eaf2e962 100644 --- a/examples/angular-cli/.storybook/config.js +++ b/examples/angular-cli/.storybook/config.js @@ -1,15 +1,20 @@ import { configure } from '@storybook/angular'; +import { setOptions } from '@storybook/addon-options'; import addCssWarning from '../src/cssWarning'; addCssWarning(); +setOptions({ + hierarchyRootSeparator: /\|/, +}); + function loadStories() { // put welcome screen at the top of the list so it's the first one displayed require('../src/stories'); // automatically import all story ts files that end with *.stories.ts - const req = require.context('../src/stories', true, /\.stories\.ts$/) - req.keys().forEach((filename) => req(filename)) + const req = require.context('../src/stories', true, /\.stories\.ts$/); + req.keys().forEach((filename) => req(filename)); } configure(loadStories, module); diff --git a/examples/angular-cli/package.json b/examples/angular-cli/package.json index 03fa83d5a7f4..2862fd1d887c 100644 --- a/examples/angular-cli/package.json +++ b/examples/angular-cli/package.json @@ -33,6 +33,7 @@ "@storybook/addon-actions": "^3.4.0-alpha.8", "@storybook/addon-links": "^3.4.0-alpha.8", "@storybook/addon-notes": "^3.4.0-alpha.8", + "@storybook/addon-options": "^3.4.0-alpha.8", "@storybook/addon-storyshots": "^3.4.0-alpha.8", "@storybook/addons": "^3.4.0-alpha.8", "@storybook/angular": "^3.4.0-alpha.8", diff --git a/examples/angular-cli/src/stories/__snapshots__/addon-actions.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/addon-actions.stories.storyshot index 744f3a1be919..252d7be8acc7 100644 --- a/examples/angular-cli/src/stories/__snapshots__/addon-actions.stories.storyshot +++ b/examples/angular-cli/src/stories/__snapshots__/addon-actions.stories.storyshot @@ -1,18 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Storyshots Addon Actions Action and method 1`] = ` +exports[`Storyshots Addon|Actions Action and method 1`] = ` @@ -22,19 +22,19 @@ exports[`Storyshots Addon Actions Action and method 1`] = ` `; -exports[`Storyshots Addon Actions Action only 1`] = ` +exports[`Storyshots Addon|Actions Action only 1`] = ` diff --git a/examples/angular-cli/src/stories/__snapshots__/addon-knobs.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/addon-knobs.stories.storyshot index 59e126d4c6db..c33cc5239ccc 100644 --- a/examples/angular-cli/src/stories/__snapshots__/addon-knobs.stories.storyshot +++ b/examples/angular-cli/src/stories/__snapshots__/addon-knobs.stories.storyshot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Storyshots Addon Knobs All knobs 1`] = ` +exports[`Storyshots Addon|Knobs All knobs 1`] = ` `; -exports[`Storyshots Addon Knobs Simple 1`] = ` +exports[`Storyshots Addon|Knobs Simple 1`] = ` diff --git a/examples/angular-cli/src/stories/__snapshots__/addon-notes.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/addon-notes.stories.storyshot index 94b5ff1c35a0..03dd16736718 100644 --- a/examples/angular-cli/src/stories/__snapshots__/addon-notes.stories.storyshot +++ b/examples/angular-cli/src/stories/__snapshots__/addon-notes.stories.storyshot @@ -1,18 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Storyshots Addon Notes Note with HTML 1`] = ` +exports[`Storyshots Addon|Notes Note with HTML 1`] = ` @@ -22,19 +22,19 @@ exports[`Storyshots Addon Notes Note with HTML 1`] = ` `; -exports[`Storyshots Addon Notes Simple note 1`] = ` +exports[`Storyshots Addon|Notes Simple note 1`] = ` diff --git a/examples/angular-cli/src/stories/__snapshots__/custom-ng-content.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/custom-ng-content.stories.storyshot new file mode 100644 index 000000000000..3616eacf80cd --- /dev/null +++ b/examples/angular-cli/src/stories/__snapshots__/custom-ng-content.stories.storyshot @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Custom|ng-content Default 1`] = ` + + + +
+

+ This is rendered in ng-content +

+
+
+
+
+`; diff --git a/examples/angular-cli/src/stories/__snapshots__/custom-pipes.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/custom-pipes.stories.storyshot new file mode 100644 index 000000000000..b2a69015ad53 --- /dev/null +++ b/examples/angular-cli/src/stories/__snapshots__/custom-pipes.stories.storyshot @@ -0,0 +1,29 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Custom|Pipes Simple 1`] = ` + + +

+ CustomPipe: foobar +

+
+
+`; + +exports[`Storyshots Custom|Pipes With Knobs 1`] = ` + + +

+ CustomPipe: foobar +

+
+
+`; diff --git a/examples/angular-cli/src/stories/__snapshots__/custom-metadata.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/custom-providers.stories.storyshot similarity index 51% rename from examples/angular-cli/src/stories/__snapshots__/custom-metadata.stories.storyshot rename to examples/angular-cli/src/stories/__snapshots__/custom-providers.stories.storyshot index d927a530a22b..97aa11aaed47 100644 --- a/examples/angular-cli/src/stories/__snapshots__/custom-metadata.stories.storyshot +++ b/examples/angular-cli/src/stories/__snapshots__/custom-providers.stories.storyshot @@ -1,34 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Storyshots Custom Pipe Default 1`] = ` - - -

- CustomPipe: foobar -

-
-
-`; - -exports[`Storyshots Custom Pipe/With Knobs NameComponent 1`] = ` - - -

- CustomPipe: foobar -

-
-
-`; - -exports[`Storyshots Custom ngModule metadata simple 1`] = ` +exports[`Storyshots Custom|Providers Simple 1`] = ` `; -exports[`Storyshots Custom ngModule metadata with knobs 1`] = ` +exports[`Storyshots Custom|Providers With knobs 1`] = ` @@ -25,24 +25,24 @@ exports[`Storyshots Custom Style Default 1`] = ` `; -exports[`Storyshots Custom Style With Knobs 1`] = ` +exports[`Storyshots Custom|Style With Knobs 1`] = ` diff --git a/examples/angular-cli/src/stories/__snapshots__/index.storyshot b/examples/angular-cli/src/stories/__snapshots__/index.storyshot index 4b9cce2ec8be..30483889802a 100644 --- a/examples/angular-cli/src/stories/__snapshots__/index.storyshot +++ b/examples/angular-cli/src/stories/__snapshots__/index.storyshot @@ -6,19 +6,22 @@ exports[`Storyshots Button with some emoji 1`] = ` data={[Function Object]} target={[Function ViewContainerRef_]} > - - - - - + + + + - + + `; @@ -29,13 +32,6 @@ exports[`Storyshots Button with text 1`] = ` target={[Function ViewContainerRef_]} > - - -

- This is a template -

- - - - +
+
+`; + +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 @@ -90,14 +95,14 @@ exports[`Storyshots Button with text 1`] = ` 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.) @@ -106,12 +111,12 @@ exports[`Storyshots Button with text 1`] = `

See these sample @@ -120,7 +125,7 @@ exports[`Storyshots Button with text 1`] = ` for a component called Button @@ -131,24 +136,24 @@ exports[`Storyshots Button with text 1`] = `

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 @@ -156,7 +161,7 @@ exports[`Storyshots Button with text 1`] = ` stories located at src/stories/index.js @@ -167,17 +172,17 @@ exports[`Storyshots Button with text 1`] = `

Usually we create stories with smaller UI components in the app.
Have a look at the
NOTE:
Have a look at the .storybook/webpack.config.js @@ -225,190 +230,6 @@ exports[`Storyshots Button 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. - -

- - -
- - - - -`; diff --git a/examples/angular-cli/src/stories/addon-actions.stories.ts b/examples/angular-cli/src/stories/addon-actions.stories.ts index 6820b38ce4cb..6e20fd02b1ac 100644 --- a/examples/angular-cli/src/stories/addon-actions.stories.ts +++ b/examples/angular-cli/src/stories/addon-actions.stories.ts @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/angular'; import { action } from '@storybook/addon-actions'; import { Button } from '@storybook/angular/demo'; -storiesOf('Addon Actions', module) +storiesOf('Addon|Actions', module) .add('Action only', () => ({ component: Button, props: { diff --git a/examples/angular-cli/src/stories/addon-knobs.stories.ts b/examples/angular-cli/src/stories/addon-knobs.stories.ts index 29708d2a8bb7..f4a1cd90b38c 100644 --- a/examples/angular-cli/src/stories/addon-knobs.stories.ts +++ b/examples/angular-cli/src/stories/addon-knobs.stories.ts @@ -16,7 +16,7 @@ import { import { SimpleKnobsComponent } from './knobs.component'; import { AllKnobsComponent } from './all-knobs.component'; -storiesOf('Addon Knobs', module) +storiesOf('Addon|Knobs', module) .addDecorator(withKnobs) .add('Simple', () => { const name = text('name', 'John Doe'); diff --git a/examples/angular-cli/src/stories/addon-links.stories.ts b/examples/angular-cli/src/stories/addon-links.stories.ts index c33f82b72565..61c583d620aa 100644 --- a/examples/angular-cli/src/stories/addon-links.stories.ts +++ b/examples/angular-cli/src/stories/addon-links.stories.ts @@ -2,7 +2,7 @@ import { linkTo } from '@storybook/addon-links'; import { storiesOf } from '@storybook/angular'; import { Button } from '@storybook/angular/demo'; -storiesOf('Another Button', module).add('button with link to another story', () => ({ +storiesOf('Addon|Links', module).add('button with link to another story', () => ({ component: Button, props: { text: 'Go to Welcome Story', diff --git a/examples/angular-cli/src/stories/addon-notes.stories.ts b/examples/angular-cli/src/stories/addon-notes.stories.ts index 64468bb5e256..c47e63d39cba 100644 --- a/examples/angular-cli/src/stories/addon-notes.stories.ts +++ b/examples/angular-cli/src/stories/addon-notes.stories.ts @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/angular'; import { withNotes } from '@storybook/addon-notes'; import { Button } from '@storybook/angular/demo'; -storiesOf('Addon Notes', module) +storiesOf('Addon|Notes', module) .add( 'Simple note', withNotes({ text: 'My notes on some button' })(() => ({ diff --git a/examples/angular-cli/src/stories/component-with-di/__snapshots__/di.component.stories.storyshot b/examples/angular-cli/src/stories/component-with-di/__snapshots__/di.component.stories.storyshot index 84e7b5be377d..eb31a6b0eec5 100644 --- a/examples/angular-cli/src/stories/component-with-di/__snapshots__/di.component.stories.storyshot +++ b/examples/angular-cli/src/stories/component-with-di/__snapshots__/di.component.stories.storyshot @@ -89,3 +89,93 @@ exports[`Storyshots Component dependencies inputs and inject dependencies with k `; + +exports[`Storyshots Custom|Dependencies inputs and inject dependencies 1`] = ` + + +
+ + +
+ All dependencies are defined: true +
+ + +
+ Title: Component dependencies +
+ + +
+ Injector: function Injector_(view, elDef) { + this.view = view; + this.elDef = elDef; + } +
+ + +
+ ElementRef: {"nativeElement":{}} +
+ + +
+ TestToken: 123 +
+ + +
+ + +
+
+`; + +exports[`Storyshots Custom|Dependencies inputs and inject dependencies with knobs 1`] = ` + + +
+ + +
+ All dependencies are defined: true +
+ + +
+ Title: Component dependencies +
+ + +
+ Injector: function Injector_(view, elDef) { + this.view = view; + this.elDef = elDef; + } +
+ + +
+ ElementRef: {"nativeElement":{}} +
+ + +
+ TestToken: 123 +
+ + +
+ + +
+
+`; diff --git a/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts b/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts index e17f46d47c23..f72fd8e040a9 100644 --- a/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts +++ b/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/angular'; import { withKnobs, text } from '@storybook/addon-knobs/angular'; import { DiComponent } from './di.component'; -storiesOf('Component dependencies', module) +storiesOf('Custom|Dependencies', module) .add('inputs and inject dependencies', () => ({ component: DiComponent, props: { diff --git a/examples/angular-cli/src/stories/component-with-style/__snapshots__/styled.component.stories.storyshot b/examples/angular-cli/src/stories/component-with-style/__snapshots__/styled.component.stories.storyshot index d2a95b1f3523..937109ba6e3b 100644 --- a/examples/angular-cli/src/stories/component-with-style/__snapshots__/styled.component.stories.storyshot +++ b/examples/angular-cli/src/stories/component-with-style/__snapshots__/styled.component.stories.storyshot @@ -37,3 +37,41 @@ exports[`Storyshots Component styles Component with styles 1`] = ` `; + +exports[`Storyshots Custom|styleUrls Component with styles 1`] = ` + + +
+ + +

+ Styled with scoped CSS +

+ + +

+ Styled with scoped SCSS +

+ + +

+ Styled with global CSS +

+ + +
+ + +
+
+`; diff --git a/examples/angular-cli/src/stories/component-with-style/styled.component.stories.ts b/examples/angular-cli/src/stories/component-with-style/styled.component.stories.ts index b1ec85245c3a..6df1a5405b29 100644 --- a/examples/angular-cli/src/stories/component-with-style/styled.component.stories.ts +++ b/examples/angular-cli/src/stories/component-with-style/styled.component.stories.ts @@ -1,6 +1,6 @@ import { storiesOf } from '@storybook/angular'; import { StyledComponent } from './styled.component'; -storiesOf('Component styles', module).add('Component with styles', () => ({ +storiesOf('Custom|styleUrls', module).add('Component with styles', () => ({ component: StyledComponent, })); diff --git a/examples/angular-cli/src/stories/custom-metadata.stories.ts b/examples/angular-cli/src/stories/custom-metadata.stories.ts deleted file mode 100644 index 48c03a3ed644..000000000000 --- a/examples/angular-cli/src/stories/custom-metadata.stories.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { storiesOf } from '@storybook/angular'; -import { withKnobs, text } from '@storybook/addon-knobs/angular'; - -import { NameComponent } from './moduleMetadata/name.component'; -import { CustomPipePipe } from './moduleMetadata/custom.pipe'; -import { DummyService } from './moduleMetadata/dummy.service'; -import { ServiceComponent } from './moduleMetadata/service.component'; - -storiesOf('Custom Pipe', module).add('Default', () => ({ - component: NameComponent, - props: { - field: 'foobar', - }, - moduleMetadata: { - imports: [], - schemas: [], - declarations: [CustomPipePipe], - providers: [], - }, -})); - -storiesOf('Custom Pipe/With Knobs', module) - .addDecorator(withKnobs) - .add('NameComponent', () => ({ - component: NameComponent, - props: { - field: text('field', 'foobar'), - }, - moduleMetadata: { - imports: [], - schemas: [], - declarations: [CustomPipePipe], - providers: [], - }, - })); - -storiesOf('Custom ngModule metadata', module) - .add('simple', () => ({ - component: ServiceComponent, - props: { - name: 'Static name', - }, - moduleMetadata: { - imports: [], - schemas: [], - declarations: [], - providers: [DummyService], - }, - })) - .addDecorator(withKnobs) - .add('with knobs', () => { - const name = text('name', 'Dynamic knob'); - - return { - component: ServiceComponent, - props: { - name, - }, - moduleMetadata: { - imports: [], - schemas: [], - declarations: [], - providers: [DummyService], - }, - }; - }); diff --git a/examples/angular-cli/src/stories/custom-ng-content.stories.ts b/examples/angular-cli/src/stories/custom-ng-content.stories.ts new file mode 100644 index 000000000000..5baa440d797b --- /dev/null +++ b/examples/angular-cli/src/stories/custom-ng-content.stories.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; +import { storiesOf } from '@storybook/angular'; + +@Component({ + selector: 'storybook-with-ng-content', + template: `
`, +}) +class WithNgContentComponent {} + +storiesOf('Custom|ng-content', module).add('Default', () => ({ + template: `

This is rendered in ng-content

`, + moduleMetadata: { + declarations: [WithNgContentComponent], + }, +})); diff --git a/examples/angular-cli/src/stories/custom-pipes.stories.ts b/examples/angular-cli/src/stories/custom-pipes.stories.ts new file mode 100644 index 000000000000..45b84c68ff0e --- /dev/null +++ b/examples/angular-cli/src/stories/custom-pipes.stories.ts @@ -0,0 +1,32 @@ +import { storiesOf } from '@storybook/angular'; +import { withKnobs, text } from '@storybook/addon-knobs/angular'; + +import { NameComponent } from './moduleMetadata/name.component'; +import { CustomPipePipe } from './moduleMetadata/custom.pipe'; + +storiesOf('Custom|Pipes', module) + .add('Simple', () => ({ + component: NameComponent, + props: { + field: 'foobar', + }, + moduleMetadata: { + imports: [], + schemas: [], + declarations: [CustomPipePipe], + providers: [], + }, + })) + .addDecorator(withKnobs) + .add('With Knobs', () => ({ + component: NameComponent, + props: { + field: text('field', 'foobar'), + }, + moduleMetadata: { + imports: [], + schemas: [], + declarations: [CustomPipePipe], + providers: [], + }, + })); diff --git a/examples/angular-cli/src/stories/custom-providers.stories.ts b/examples/angular-cli/src/stories/custom-providers.stories.ts new file mode 100644 index 000000000000..420c2f1c64a2 --- /dev/null +++ b/examples/angular-cli/src/stories/custom-providers.stories.ts @@ -0,0 +1,36 @@ +import { storiesOf } from '@storybook/angular'; +import { withKnobs, text } from '@storybook/addon-knobs/angular'; + +import { DummyService } from './moduleMetadata/dummy.service'; +import { ServiceComponent } from './moduleMetadata/service.component'; + +storiesOf('Custom|Providers', module) + .add('Simple', () => ({ + component: ServiceComponent, + props: { + name: 'Static name', + }, + moduleMetadata: { + imports: [], + schemas: [], + declarations: [], + providers: [DummyService], + }, + })) + .addDecorator(withKnobs) + .add('With knobs', () => { + const name = text('name', 'Dynamic knob'); + + return { + component: ServiceComponent, + props: { + name, + }, + moduleMetadata: { + imports: [], + schemas: [], + declarations: [], + providers: [DummyService], + }, + }; + }); diff --git a/examples/angular-cli/src/stories/custom-styles.stories.ts b/examples/angular-cli/src/stories/custom-styles.stories.ts index 7bf4e59958c0..6d8cabd8f2df 100644 --- a/examples/angular-cli/src/stories/custom-styles.stories.ts +++ b/examples/angular-cli/src/stories/custom-styles.stories.ts @@ -3,7 +3,7 @@ import { action } from '@storybook/addon-actions'; import { withKnobs, text } from '@storybook/addon-knobs/angular'; import { Button } from '@storybook/angular/demo'; -storiesOf('Custom Style', module) +storiesOf('Custom|Style', module) .add('Default', () => ({ template: ``, moduleMetadata: { diff --git a/examples/angular-cli/src/stories/customControlValueAccessor/__snapshots__/custom-cva-component.stories.storyshot b/examples/angular-cli/src/stories/customControlValueAccessor/__snapshots__/custom-cva-component.stories.storyshot index 63c11a12c5e8..1efc604e67ad 100644 --- a/examples/angular-cli/src/stories/customControlValueAccessor/__snapshots__/custom-cva-component.stories.storyshot +++ b/examples/angular-cli/src/stories/customControlValueAccessor/__snapshots__/custom-cva-component.stories.storyshot @@ -1,5 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Storyshots Custom|ngModel custom ControlValueAccessor 1`] = ` + + + + +
+ Type anything +
+ + + + + +
+
+`; + exports[`Storyshots ngModel custom ControlValueAccessor 1`] = ` ({ component: CustomCvaComponent, diff --git a/examples/angular-cli/src/stories/index.ts b/examples/angular-cli/src/stories/index.ts index 08fc7eac3698..625a86f6bc64 100644 --- a/examples/angular-cli/src/stories/index.ts +++ b/examples/angular-cli/src/stories/index.ts @@ -2,14 +2,18 @@ import { storiesOf } from '@storybook/angular'; import { Welcome, Button } from '@storybook/angular/demo'; storiesOf('Welcome', module).add('to Storybook', () => ({ - component: Welcome, + template: ``, props: {}, + moduleMetadata: { + declarations: [Welcome], + }, })); storiesOf('Button', module) .add('with text', () => ({ + template: ``, moduleMetadata: { - declarations: [Button, Welcome], + declarations: [Button], }, props: { text: 'Hello Button', @@ -18,14 +22,12 @@ storiesOf('Button', module) console.log(event); }, }, - template: ` -

This is a template

- - - `, })) .add('with some emoji', () => ({ - component: Button, + template: ``, + moduleMetadata: { + declarations: [Button], + }, props: { text: '😀 😎 👍 💯', onClick: () => {}, diff --git a/examples/angular-cli/src/stories/inheritance/__snapshots__/inheritance.stories.storyshot b/examples/angular-cli/src/stories/inheritance/__snapshots__/inheritance.stories.storyshot index 67e21a5c1f77..720d41b34c54 100644 --- a/examples/angular-cli/src/stories/inheritance/__snapshots__/inheritance.stories.storyshot +++ b/examples/angular-cli/src/stories/inheritance/__snapshots__/inheritance.stories.storyshot @@ -1,5 +1,41 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Storyshots Custom|Inheritance base button 1`] = ` + + + + + + + + + +`; + +exports[`Storyshots Custom|Inheritance icon button 1`] = ` + + + + + + + + + +`; + exports[`Storyshots Inheritance base button 1`] = ` ({ component: IconButtonComponent, props: { diff --git a/examples/polymer-cli/.storybook/addons.js b/examples/polymer-cli/.storybook/addons.js index 1191fbebf304..40db03219095 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 37ff65014786..ae9f20d8481b 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 e697232008a6..da064a39a126 100644 --- a/examples/polymer-cli/package.json +++ b/examples/polymer-cli/package.json @@ -11,6 +11,7 @@ "@storybook/addon-actions": "^3.4.0-alpha.8", "@storybook/addon-knobs": "^3.4.0-alpha.8", "@storybook/addon-notes": "^3.4.0-alpha.8", + "@storybook/addon-options": "^3.4.0-alpha.8", "@storybook/addon-viewport": "^3.4.0-alpha.8", "@storybook/polymer": "^3.4.0-alpha.8", "@webcomponents/webcomponentsjs": "^1.1.0", diff --git a/examples/polymer-cli/src/playground-button.html b/examples/polymer-cli/src/playground-button.html index 272d6b2acc0d..51a4b0ed5daa 100644 --- a/examples/polymer-cli/src/playground-button.html +++ b/examples/polymer-cli/src/playground-button.html @@ -4,7 +4,15 @@