From fbbb12775e0610dea7575c1196ea454a8918cb58 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Fri, 6 Jul 2018 17:04:15 +1000 Subject: [PATCH] Move deprecated stories to their own kinds --- .../stories/addon-actions.stories.js | 7 ++-- .../stories/addon-backgrounds.stories.js | 38 +++++++++---------- .../stories/addon-events.stories.js | 2 +- .../stories/addon-notes.stories.js | 9 ++++- .../stories/addon-viewport.stories.js | 35 +++++++++-------- 5 files changed, 50 insertions(+), 41 deletions(-) diff --git a/examples/official-storybook/stories/addon-actions.stories.js b/examples/official-storybook/stories/addon-actions.stories.js index 62f4cacb43c..2f5422f7006 100644 --- a/examples/official-storybook/stories/addon-actions.stories.js +++ b/examples/official-storybook/stories/addon-actions.stories.js @@ -50,9 +50,6 @@ storiesOf('Addons|Actions', module) Moving away from this story will persist the action logger )) - .add('Decorated Action (deprecated)', () => ( - - )) .add('Circular Payload', () => { const circular = { foo: {} }; circular.foo.circular = circular; @@ -160,3 +157,7 @@ storiesOf('Addons|Actions', module) ); }); + +storiesOf('Addons|Actions.deprecated', module).add('Decorated Action', () => ( + +)); diff --git a/examples/official-storybook/stories/addon-backgrounds.stories.js b/examples/official-storybook/stories/addon-backgrounds.stories.js index de9048fc519..69578df885d 100644 --- a/examples/official-storybook/stories/addon-backgrounds.stories.js +++ b/examples/official-storybook/stories/addon-backgrounds.stories.js @@ -5,25 +5,6 @@ import backgrounds, { withBackgrounds } from '@storybook/addon-backgrounds'; import BaseButton from '../components/BaseButton'; storiesOf('Addons|Backgrounds', module) - .addDecorator( - backgrounds([ - { name: 'twitter', value: '#00aced' }, - { name: 'facebook', value: '#3b5998', default: true }, - ]) - ) - .add('story 1', () => ( - - )) - .add('story 2', () => ) - .add( - 'overriden', - backgrounds([ - { name: 'red', value: '#F44336' }, - { name: 'blue', value: '#2196F3', default: true }, - ])(() => ) - ); - -storiesOf('Addons|Backgrounds, parameters', module) .addDecorator(withBackgrounds) .addParameters({ backgrounds: [ @@ -51,3 +32,22 @@ storiesOf('Addons|Backgrounds, parameters', module) backgrounds: { disable: true }, } ); + +storiesOf('Addons|Backgrounds.deprecated', module) + .addDecorator( + backgrounds([ + { name: 'twitter', value: '#00aced' }, + { name: 'facebook', value: '#3b5998', default: true }, + ]) + ) + .add('story 1', () => ( + + )) + .add('story 2', () => ) + .add( + 'overriden', + backgrounds([ + { name: 'red', value: '#F44336' }, + { name: 'blue', value: '#2196F3', default: true }, + ])(() => ) + ); diff --git a/examples/official-storybook/stories/addon-events.stories.js b/examples/official-storybook/stories/addon-events.stories.js index d83842b8e16..1fc4a76185c 100644 --- a/examples/official-storybook/stories/addon-events.stories.js +++ b/examples/official-storybook/stories/addon-events.stories.js @@ -72,7 +72,7 @@ storiesOf('Addons|Events', module) .add('Logger', () => ); const WithEvents = withEvents; -storiesOf('Addons|Events/WithEvents (deprecated)', module) +storiesOf('Addons|Events.deprecated', module) .addDecorator(story => ( {story()} diff --git a/examples/official-storybook/stories/addon-notes.stories.js b/examples/official-storybook/stories/addon-notes.stories.js index f76e0907a08..da8ce065f78 100644 --- a/examples/official-storybook/stories/addon-notes.stories.js +++ b/examples/official-storybook/stories/addon-notes.stories.js @@ -47,8 +47,13 @@ storiesOf('Addons|Notes', module) .add('withNotes rendering inline, github-flavored markdown', baseStory, { notes: { markdown: markdownString }, }) - .add('using decorator arguments, withNotes', withNotes('Notes into withNotes')(baseStory)) - .add('using decorator arguments, withMarkdownNotes', withMarkdownNotes(markdownString)(baseStory)) .add('with a markdown table', baseStory, { notes: { markdown: markdownTable }, }); + +storiesOf('Addons|Notes.deprecated', module) + .add('using decorator arguments, withNotes', withNotes('Notes into withNotes')(baseStory)) + .add( + 'using decorator arguments, withMarkdownNotes', + withMarkdownNotes(markdownString)(baseStory) + ); diff --git a/examples/official-storybook/stories/addon-viewport.stories.js b/examples/official-storybook/stories/addon-viewport.stories.js index 5ae19140377..b0242fabf8c 100644 --- a/examples/official-storybook/stories/addon-viewport.stories.js +++ b/examples/official-storybook/stories/addon-viewport.stories.js @@ -29,22 +29,7 @@ storiesOf('Addons|Viewport.Custom Default (Kindle Fire 2)', module) ), { viewport: 'ipad' } - ) - .add( - 'Overridden via "withViewport" decorator (deprecated)', - withViewport('iphone6')(() => ( - - I respect my parents but I should be looking good on iPhone 6. - - )) - ) - .add('Overridden via "Viewport" component (deprecated)', () => ( - - - I respect my parents but I should be looking good on iPhone 6 Plus. - - - )); + ); const emitter = new EventEmitter(); @@ -60,3 +45,21 @@ storiesOf('Addons|Viewport.withViewport', module) }) ) .add('onViewportChange', () => ); + +storiesOf('Addons|Viewport.deprecated', module) + .addDecorator(withViewport('kindleFire2')) + .add( + 'Overridden via "withViewport" decorator', + withViewport('iphone6')(() => ( + + I respect my parents but I should be looking good on iPhone 6. + + )) + ) + .add('Overridden via "Viewport" component', () => ( + + + I respect my parents but I should be looking good on iPhone 6 Plus. + + + ));