From 78e0050af167e250728b69506a5f8b415283f62f Mon Sep 17 00:00:00 2001 From: Filipp Riabchun Date: Mon, 18 Nov 2019 01:15:42 +0100 Subject: [PATCH 1/5] storiesof-to-csf: avoid id changes after migration --- lib/codemod/src/lib/utils.js | 10 ++----- lib/codemod/src/lib/utils.test.js | 15 ++++------ .../mdx-to-csf/basic.output.snapshot | 19 +++++++----- .../mdx-to-csf/component-id.output.snapshot | 6 +++- .../mdx-to-csf/decorators.output.snapshot | 4 +-- .../exclude-stories.output.snapshot | 17 +++++++---- .../mdx-to-csf/parameters.output.snapshot | 4 +-- .../mdx-to-csf/plaintext.output.snapshot | 6 +++- .../mdx-to-csf/story-function.output.snapshot | 4 +-- .../story-parameters.output.snapshot | 10 ++++--- .../mdx-to-csf/story-refs.output.snapshot | 4 +-- .../storiesof-to-csf/basic.output.snapshot | 18 +++++------ .../storiesof-to-csf/collision.input.js | 12 ++++---- .../collision.output.snapshot | 30 +++++++++---------- .../storiesof-to-csf/const.output.snapshot | 4 +-- .../decorators.output.snapshot | 4 +-- .../storiesof-to-csf/default.output.snapshot | 4 +-- .../storiesof-to-csf/exports.output.snapshot | 4 +-- .../storiesof-to-csf/multi.output.snapshot | 16 +++++----- .../parameters.output.snapshot | 4 +-- .../story-decorators.output.snapshot | 8 ++--- .../story-parameters.output.snapshot | 8 ++--- .../src/transforms/storiesof-to-csf.js | 7 ++--- 23 files changed, 112 insertions(+), 106 deletions(-) diff --git a/lib/codemod/src/lib/utils.js b/lib/codemod/src/lib/utils.js index 4d782569a215..c16dd0592522 100644 --- a/lib/codemod/src/lib/utils.js +++ b/lib/codemod/src/lib/utils.js @@ -1,14 +1,8 @@ import camelCase from 'lodash/camelCase'; - -const RESERVED = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|await|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/; - -export const isReserved = name => RESERVED.exec(name); +import upperFirst from 'lodash/upperFirst'; export const sanitizeName = name => { - let key = camelCase(name); - if (isReserved(key)) { - key = `${key}Story`; - } + let key = upperFirst(camelCase(name)); // prepend _ if name starts with a digit if (/^\d/.test(key)) { key = `_${key}`; diff --git a/lib/codemod/src/lib/utils.test.js b/lib/codemod/src/lib/utils.test.js index efeffdfb8806..588ed7f3ad45 100644 --- a/lib/codemod/src/lib/utils.test.js +++ b/lib/codemod/src/lib/utils.test.js @@ -1,14 +1,9 @@ import { sanitizeName } from './utils'; it('should sanitize names', () => { - const testCases = [ - ['basic', 'basic'], - ['with space', 'withSpace'], - ['default', 'defaultStory'], - ['w/punctuation', 'wPunctuation'], - ]; - testCases.forEach(testCase => { - const [input, out] = testCase; - expect(sanitizeName(input)).toBe(out); - }); + expect(sanitizeName('basic')).toMatchInlineSnapshot(`"Basic"`); + expect(sanitizeName('with space')).toMatchInlineSnapshot(`"WithSpace"`); + expect(sanitizeName('default')).toMatchInlineSnapshot(`"Default"`); + expect(sanitizeName('w/punctuation')).toMatchInlineSnapshot(`"WPunctuation"`); + expect(sanitizeName('5')).toMatchInlineSnapshot(`"_5"`); }); diff --git a/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot b/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot index 62ab723f1bda..8f502e342d30 100644 --- a/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot +++ b/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot @@ -9,27 +9,32 @@ export default { title: 'Button', }; -export const story1 = () => ; +export const SoloStory = () => ; -soloStory.story = { +SoloStory.story = { name: 'solo story', };" `; diff --git a/lib/codemod/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot b/lib/codemod/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot index 3e04e63a0db8..6b26bc238044 100644 --- a/lib/codemod/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot +++ b/lib/codemod/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot @@ -12,34 +12,34 @@ export default { title: 'Button', }; -export const story1 = () => ; -story1.story = { +export const Story1 = () => ; +Story1.story = { name: 'with text', parameters: { options: { selectedPanel: 'storybook/actions/panel' }, }, }; -export const story2 = () => ( +export const Story2 = () => ( ); -story2.story = { +Story2.story = { name: 'with some emoji', parameters: { options: { selectedPanel: 'storybook/actions/panel' }, }, }; -export const story3 = () => ; -story3.story = { +export const Story3 = () => ; +Story3.story = { name: 'with notes', parameters: { notes: 'A very simple button', @@ -59,14 +59,14 @@ story3.story = { }, }; -export const story4 = context => ( +export const Story4 = context => ( click the label in top right for info about "{context.name}" ); -story4.story = { +Story4.story = { name: 'with new info', parameters: { notes: 'Composition: Info(Notes())', diff --git a/examples/cra-kitchen-sink/src/stories/cra-dynamic-import.stories.js b/examples/cra-kitchen-sink/src/stories/cra-dynamic-import.stories.js index 45fb81c14241..24b6f340196d 100644 --- a/examples/cra-kitchen-sink/src/stories/cra-dynamic-import.stories.js +++ b/examples/cra-kitchen-sink/src/stories/cra-dynamic-import.stories.js @@ -7,7 +7,7 @@ export default { title: 'CRA', }; -export const story1 = () => { +export const Story1 = () => { if (!Component) { import('@storybook/react/demo').then(({ Button }) => { Component = Button; @@ -20,4 +20,4 @@ export const story1 = () => { return Hello Button; }; -story1.story = { name: 'Dynamic import' }; +Story1.story = { name: 'Dynamic import' }; diff --git a/examples/cra-kitchen-sink/src/stories/force-rerender.stories.js b/examples/cra-kitchen-sink/src/stories/force-rerender.stories.js index ad1c9edb4f68..c46682a20c51 100644 --- a/examples/cra-kitchen-sink/src/stories/force-rerender.stories.js +++ b/examples/cra-kitchen-sink/src/stories/force-rerender.stories.js @@ -11,8 +11,8 @@ export default { title: 'Force ReRender', }; -export const button = () => ( - + ); diff --git a/examples/cra-kitchen-sink/src/stories/long-description.stories.js b/examples/cra-kitchen-sink/src/stories/long-description.stories.js index 02b61f388686..2fc4ffe73949 100644 --- a/examples/cra-kitchen-sink/src/stories/long-description.stories.js +++ b/examples/cra-kitchen-sink/src/stories/long-description.stories.js @@ -8,5 +8,5 @@ export default { decorators: [centered], }; -export const story1 = () => ; -story1.story = { name: 'with text' }; +export const Story1 = () => ; +Story1.story = { name: 'with text' }; diff --git a/examples/cra-kitchen-sink/src/stories/welcome.stories.js b/examples/cra-kitchen-sink/src/stories/welcome.stories.js index a7203b79b87d..878844fa562c 100644 --- a/examples/cra-kitchen-sink/src/stories/welcome.stories.js +++ b/examples/cra-kitchen-sink/src/stories/welcome.stories.js @@ -7,5 +7,5 @@ export default { component: Welcome, }; -export const story1 = () => ; -story1.title = 'to Storybook'; +export const Story1 = () => ; +Story1.title = 'to Storybook'; diff --git a/examples/cra-react15/src/stories/button.stories.js b/examples/cra-react15/src/stories/button.stories.js index 3c443e29464f..1b35a0e35f1f 100644 --- a/examples/cra-react15/src/stories/button.stories.js +++ b/examples/cra-react15/src/stories/button.stories.js @@ -9,14 +9,14 @@ export default { }, }; -export const story1 = () => ; -story1.story = { name: 'with text' }; +export const Story1 = () => ; +Story1.story = { name: 'with text' }; -export const story2 = () => ( +export const Story2 = () => ( ); -story2.story = { name: 'with some emoji' }; +Story2.story = { name: 'with some emoji' }; diff --git a/examples/cra-ts-kitchen-sink/src/components/Button.stories.tsx b/examples/cra-ts-kitchen-sink/src/components/Button.stories.tsx index f7da6411c637..d058304c95f1 100644 --- a/examples/cra-ts-kitchen-sink/src/components/Button.stories.tsx +++ b/examples/cra-ts-kitchen-sink/src/components/Button.stories.tsx @@ -10,7 +10,7 @@ export default { type Story = () => any; -export const simpleButton: Story = () => { +export const SimpleButton: Story = () => { const x = 0; return ; }; @@ -20,6 +20,6 @@ const typeOptions = { Action: 'action', }; -export const withType = () => ( +export const WithType = () => ( ); diff --git a/examples/cra-ts-kitchen-sink/src/stories/0-Welcome.stories.tsx b/examples/cra-ts-kitchen-sink/src/stories/0-Welcome.stories.tsx index fa267f24c316..c76f45f3b4be 100644 --- a/examples/cra-ts-kitchen-sink/src/stories/0-Welcome.stories.tsx +++ b/examples/cra-ts-kitchen-sink/src/stories/0-Welcome.stories.tsx @@ -7,8 +7,8 @@ export default { component: Welcome, }; -export const toStorybook = () => ; +export const ToStorybook = () => ; -toStorybook.story = { +ToStorybook.story = { name: 'to Storybook', }; diff --git a/examples/cra-ts-kitchen-sink/src/stories/1-Button.stories.tsx b/examples/cra-ts-kitchen-sink/src/stories/1-Button.stories.tsx index b4608d78e926..f9cd3c5119d3 100644 --- a/examples/cra-ts-kitchen-sink/src/stories/1-Button.stories.tsx +++ b/examples/cra-ts-kitchen-sink/src/stories/1-Button.stories.tsx @@ -7,9 +7,9 @@ export default { component: Button, }; -export const text = () => ; +export const Text = () => ; -export const emoji = () => ( +export const Emoji = () => ( `; export const Label = () => hbs``; export const Disabled = () => hbs``; -export const invalidContrast = () => +export const InvalidContrast = () => hbs``; -invalidContrast.story = { +InvalidContrast.story = { name: 'Invalid contrast', }; diff --git a/examples/ember-cli/stories/addon-actions.stories.js b/examples/ember-cli/stories/addon-actions.stories.js index aab9fd86f064..60b66a0377dc 100644 --- a/examples/ember-cli/stories/addon-actions.stories.js +++ b/examples/ember-cli/stories/addon-actions.stories.js @@ -11,7 +11,7 @@ export default { }, }; -export const button = () => ({ +export const Button = () => ({ template: hbs``, context: { onClick: action('clicked'), diff --git a/examples/ember-cli/stories/addon-backgrounds.stories.js b/examples/ember-cli/stories/addon-backgrounds.stories.js index 0f8ab7df34b3..7f17ebeea6c5 100644 --- a/examples/ember-cli/stories/addon-backgrounds.stories.js +++ b/examples/ember-cli/stories/addon-backgrounds.stories.js @@ -11,18 +11,18 @@ export default { }, }; -export const story1 = () => ({ +export const Story1 = () => ({ template: hbs``, }); -story1.story = { +Story1.story = { name: 'story 1', }; -export const story2 = () => ({ +export const Story2 = () => ({ template: hbs``, }); -story2.story = { +Story2.story = { name: 'story 2', }; diff --git a/examples/ember-cli/stories/addon-centered.stories.js b/examples/ember-cli/stories/addon-centered.stories.js index 797e882feda2..2382a0b83b87 100644 --- a/examples/ember-cli/stories/addon-centered.stories.js +++ b/examples/ember-cli/stories/addon-centered.stories.js @@ -10,6 +10,6 @@ export default { }, }; -export const button = () => ({ +export const Button = () => ({ template: hbs``, }); diff --git a/examples/ember-cli/stories/addon-knobs.stories.js b/examples/ember-cli/stories/addon-knobs.stories.js index 7cc3806665d6..a379a495814b 100644 --- a/examples/ember-cli/stories/addon-knobs.stories.js +++ b/examples/ember-cli/stories/addon-knobs.stories.js @@ -11,7 +11,7 @@ export default { }, }; -export const withText = () => ({ +export const WithText = () => ({ template: hbs` {{welcome-banner style=(if hidden "display: none") @@ -34,6 +34,6 @@ export const withText = () => ({ }, }); -withText.story = { +WithText.story = { name: 'with text', }; diff --git a/examples/ember-cli/stories/addon-links.stories.js b/examples/ember-cli/stories/addon-links.stories.js index 8aba44e70029..539a821fe43b 100644 --- a/examples/ember-cli/stories/addon-links.stories.js +++ b/examples/ember-cli/stories/addon-links.stories.js @@ -5,13 +5,13 @@ export default { title: 'Addon/Links', }; -export const goToWelcome = () => ({ +export const GoToWelcome = () => ({ template: hbs``, context: { onClick: linkTo('Welcome'), }, }); -goToWelcome.story = { +GoToWelcome.story = { name: 'Go to welcome', }; diff --git a/examples/ember-cli/stories/addon-notes.stories.js b/examples/ember-cli/stories/addon-notes.stories.js index 25ebe7cf591b..a2b963b58dac 100644 --- a/examples/ember-cli/stories/addon-notes.stories.js +++ b/examples/ember-cli/stories/addon-notes.stories.js @@ -4,20 +4,20 @@ export default { title: 'Addon/Notes', }; -export const simpleNote = () => ({ +export const SimpleNote = () => ({ template: hbs`

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.

`, }); -simpleNote.story = { +SimpleNote.story = { name: 'Simple note', parameters: { notes: 'My notes on some bold text' }, }; -export const noteWithHtml = () => ({ +export const NoteWithHtml = () => ({ template: hbs`

🤔😳😯😮
😄😩😓😱
🤓😑😶😊

`, }); -noteWithHtml.story = { +NoteWithHtml.story = { name: 'Note with HTML', parameters: { diff --git a/examples/ember-cli/stories/index.stories.js b/examples/ember-cli/stories/index.stories.js index 4c194a8a2dde..8b3f32fce523 100644 --- a/examples/ember-cli/stories/index.stories.js +++ b/examples/ember-cli/stories/index.stories.js @@ -8,7 +8,7 @@ export default { }, }; -export const basic = () => ({ +export const Basic = () => ({ template: hbs` {{welcome-page}} `, diff --git a/examples/ember-cli/stories/welcome-banner.stories.js b/examples/ember-cli/stories/welcome-banner.stories.js index 3a914a80b414..6b5f3d0bbf89 100644 --- a/examples/ember-cli/stories/welcome-banner.stories.js +++ b/examples/ember-cli/stories/welcome-banner.stories.js @@ -5,7 +5,7 @@ export default { title: 'welcome-banner', }; -export const basic = () => ({ +export const Basic = () => ({ template: hbs` {{welcome-banner backgroundColor=backgroundColor diff --git a/examples/html-kitchen-sink/stories/addon-a11y.stories.js b/examples/html-kitchen-sink/stories/addon-a11y.stories.js index 89942adb7cf2..a811c0cee73f 100644 --- a/examples/html-kitchen-sink/stories/addon-a11y.stories.js +++ b/examples/html-kitchen-sink/stories/addon-a11y.stories.js @@ -14,15 +14,15 @@ export default { export const Default = () => ``; export const Label = () => ``; export const Disabled = () => ``; -export const story4 = () => +export const Story4 = () => ``; -story4.story = { name: 'Invalid contrast' }; +Story4.story = { name: 'Invalid contrast' }; -export const story5 = () => { +export const Story5 = () => { const div = document.createElement('div'); setTimeout(() => { div.innerHTML = ``; }, 1000); return div; }; -story5.story = { name: 'Delayed render' }; +Story5.story = { name: 'Delayed render' }; diff --git a/examples/html-kitchen-sink/stories/addon-actions.stories.js b/examples/html-kitchen-sink/stories/addon-actions.stories.js index 4b7f110b639b..40ec7cb6eba0 100644 --- a/examples/html-kitchen-sink/stories/addon-actions.stories.js +++ b/examples/html-kitchen-sink/stories/addon-actions.stories.js @@ -8,19 +8,19 @@ 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 Story1 = () => withActions('click')(button); +Story1.story = { name: 'Hello World' }; +export const Story2 = () => withActions('click', 'contextmenu')(button); +Story2.story = { name: 'Multiple actions' }; -export const story3 = () => +export const Story3 = () => withActions('click', 'contextmenu', { clearOnStoryChange: false })(button); -story3.story = { name: 'Multiple actions + config' }; +Story3.story = { name: 'Multiple actions + config' }; -export const story4 = () => withActions({ click: 'clicked', contextmenu: 'right clicked' })(button); -story4.story = { name: 'Multiple actions, object' }; +export const Story4 = () => withActions({ click: 'clicked', contextmenu: 'right clicked' })(button); +Story4.story = { name: 'Multiple actions, object' }; -export const story5 = () => +export const Story5 = () => withActions({ 'click .btn': 'clicked', contextmenu: 'right clicked' })( () => `
@@ -28,18 +28,18 @@ export const story5 = () =>
` ); -story5.story = { name: 'Multiple actions, selector' }; +Story5.story = { name: 'Multiple actions, selector' }; -export const story6 = () => +export const Story6 = () => withActions( { click: 'clicked', contextmenu: 'right clicked' }, { clearOnStoryChange: false } )(button); -story6.story = { name: 'Multiple actions, object + config' }; +Story6.story = { name: 'Multiple actions, object + config' }; -export const story7 = () => pickTarget.withActions('click', 'contextmenu')(button); -story7.story = { name: 'Decorated actions' }; +export const Story7 = () => pickTarget.withActions('click', 'contextmenu')(button); +Story7.story = { name: 'Decorated actions' }; -export const story8 = () => +export const Story8 = () => pickTarget.withActions('click', 'contextmenu', { clearOnStoryChange: false })(button); -story8.story = { name: 'Decorated actions + config' }; +Story8.story = { name: 'Decorated actions + config' }; diff --git a/examples/html-kitchen-sink/stories/addon-backgrounds.stories.js b/examples/html-kitchen-sink/stories/addon-backgrounds.stories.js index 6a2d799ac4c3..fdfdb6b9954b 100644 --- a/examples/html-kitchen-sink/stories/addon-backgrounds.stories.js +++ b/examples/html-kitchen-sink/stories/addon-backgrounds.stories.js @@ -8,9 +8,9 @@ export default { }, }; -export const story1 = () => +export const Story1 = () => 'You should be able to switch backgrounds for this story'; -story1.story = { name: 'story 1' }; +Story1.story = { name: 'story 1' }; -export const story2 = () => 'This one too!'; -story2.story = { name: 'story 2' }; +export const Story2 = () => 'This one too!'; +Story2.story = { name: 'story 2' }; diff --git a/examples/html-kitchen-sink/stories/addon-centered.stories.js b/examples/html-kitchen-sink/stories/addon-centered.stories.js index 858709b9a324..611afd934335 100644 --- a/examples/html-kitchen-sink/stories/addon-centered.stories.js +++ b/examples/html-kitchen-sink/stories/addon-centered.stories.js @@ -5,5 +5,5 @@ export default { decorators: [centered], }; -export const story1 = () => ''; -story1.story = { name: 'button in center' }; +export const Story1 = () => ''; +Story1.story = { name: 'button in center' }; diff --git a/examples/html-kitchen-sink/stories/addon-jest.stories.js b/examples/html-kitchen-sink/stories/addon-jest.stories.js index f2dee19b5239..eb80009be86b 100644 --- a/examples/html-kitchen-sink/stories/addon-jest.stories.js +++ b/examples/html-kitchen-sink/stories/addon-jest.stories.js @@ -6,5 +6,5 @@ export default { decorators: [wt({ results })], }; -export const withTests = () => 'This story shows test results'; -withTests.parameters = { jest: 'addon-jest' }; +export const WithTests = () => 'This story shows test results'; +WithTests.parameters = { jest: 'addon-jest' }; diff --git a/examples/html-kitchen-sink/stories/addon-knobs.stories.js b/examples/html-kitchen-sink/stories/addon-knobs.stories.js index e97a4608cdcf..7b529a6c4101 100644 --- a/examples/html-kitchen-sink/stories/addon-knobs.stories.js +++ b/examples/html-kitchen-sink/stories/addon-knobs.stories.js @@ -34,7 +34,7 @@ export const DOM = () => { return container; }; -export const story3 = () => { +export const Story3 = () => { const name = text('Name', 'John Doe'); const textColor = color('Text color', 'orangered'); cachedContainer.textContent = name; @@ -42,9 +42,9 @@ export const story3 = () => { cachedContainer.style.color = textColor; return cachedContainer; }; -story3.story = { name: 'CSS transitions' }; +Story3.story = { name: 'CSS transitions' }; -export const story4 = () => { +export const Story4 = () => { const name = text('Name', 'Jane'); const stock = number('Stock', 20, { range: true, @@ -85,7 +85,7 @@ export const story4 = () => { `; }; -story4.story = { name: 'All knobs' }; +Story4.story = { name: 'All knobs' }; -export const story5 = () => text('Rendered string', ''); -story5.story = { name: 'XSS safety' }; +export const Story5 = () => text('Rendered string', ''); +Story5.story = { name: 'XSS safety' }; diff --git a/examples/html-kitchen-sink/stories/addon-notes.stories.js b/examples/html-kitchen-sink/stories/addon-notes.stories.js index 795a21fe7a92..9129457c82d5 100644 --- a/examples/html-kitchen-sink/stories/addon-notes.stories.js +++ b/examples/html-kitchen-sink/stories/addon-notes.stories.js @@ -2,13 +2,13 @@ export default { title: 'Addons/Notes', }; -export const story1 = () => +export const Story1 = () => `

This is a fragment of HTML

`; -story1.story = { +Story1.story = { name: 'Simple note', parameters: { notes: 'My notes on some bold text', diff --git a/examples/html-kitchen-sink/stories/button.stories.js b/examples/html-kitchen-sink/stories/button.stories.js index 72627d513e5f..bf4c9ea5f998 100644 --- a/examples/html-kitchen-sink/stories/button.stories.js +++ b/examples/html-kitchen-sink/stories/button.stories.js @@ -6,18 +6,18 @@ export default { title: 'Demo', }; -export const heading = () => '

Hello World

'; -export const headings = () => +export const Heading = () => '

Hello World

'; +export const Headings = () => '

Hello World

Hello World

Hello World

Hello World

'; -export const button = () => { +export const Button = () => { const btn = document.createElement('button'); btn.innerHTML = 'Hello Button'; btn.addEventListener('click', action('Click')); return btn; }; -export const effect = () => { +export const Effect = () => { useEffect(() => { document.getElementById('button').style.backgroundColor = 'yellow'; }); diff --git a/examples/marko-cli/src/stories/hello.stories.js b/examples/marko-cli/src/stories/hello.stories.js index 4c9e74866c69..a6a717560ad8 100644 --- a/examples/marko-cli/src/stories/hello.stories.js +++ b/examples/marko-cli/src/stories/hello.stories.js @@ -8,5 +8,5 @@ export default { }; export const Simple = () => ({ input: { name: 'abc', age: 20 } }); -export const story2 = () => 'NOT A MARKO RENDER_RESULT'; -story2.story = { name: 'with ERROR!' }; +export const Story2 = () => 'NOT A MARKO RENDER_RESULT'; +Story2.story = { name: 'with ERROR!' }; diff --git a/examples/mithril-kitchen-sink/src/stories/addon-actions.stories.js b/examples/mithril-kitchen-sink/src/stories/addon-actions.stories.js index 193629f7ef81..aa033b382be5 100644 --- a/examples/mithril-kitchen-sink/src/stories/addon-actions.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/addon-actions.stories.js @@ -8,28 +8,28 @@ export default { title: 'Addons/Actions', }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => , }); -story1.story = { name: 'Action only' }; +Story1.story = { name: 'Action only' }; -export const story2 = () => ({ +export const Story2 = () => ({ view: () => ( ), }); -story2.story = { name: 'Multiple actions' }; +Story2.story = { name: 'Multiple actions' }; -export const story3 = () => ({ +export const Story3 = () => ({ view: () => ( ), }); -story3.story = { name: 'Multiple actions, object' }; +Story3.story = { name: 'Multiple actions, object' }; -export const story4 = () => ({ +export const Story4 = () => ({ view: () => ( ), }); -story4.story = { name: 'Action and method' }; +Story4.story = { name: 'Action and method' }; diff --git a/examples/mithril-kitchen-sink/src/stories/addon-backgrounds.stories.js b/examples/mithril-kitchen-sink/src/stories/addon-backgrounds.stories.js index 7423669b09aa..48c158691950 100644 --- a/examples/mithril-kitchen-sink/src/stories/addon-backgrounds.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/addon-backgrounds.stories.js @@ -13,12 +13,12 @@ export default { }, }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => , }); -story1.story = { name: 'story 1' }; +Story1.story = { name: 'story 1' }; -export const story2 = () => ({ +export const Story2 = () => ({ view: () => , }); -story2.story = { name: 'story 2' }; +Story2.story = { name: 'story 2' }; diff --git a/examples/mithril-kitchen-sink/src/stories/addon-knobs.stories.js b/examples/mithril-kitchen-sink/src/stories/addon-knobs.stories.js index 6d8b76d6ace1..4cf79669f6a0 100644 --- a/examples/mithril-kitchen-sink/src/stories/addon-knobs.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/addon-knobs.stories.js @@ -29,7 +29,7 @@ export const Simple = () => { }; }; -export const story2 = () => { +export const Story2 = () => { const name = text('Name', 'Jane'); const stock = number('Stock', 20, { range: true, @@ -75,9 +75,9 @@ export const story2 = () => { ), }; }; -story2.story = { name: 'All knobs' }; +Story2.story = { name: 'All knobs' }; -export const story3 = () => ({ +export const Story3 = () => ({ view: () => text('Rendered string', ''), }); -story3.story = { name: 'XSS safety' }; +Story3.story = { name: 'XSS safety' }; diff --git a/examples/mithril-kitchen-sink/src/stories/addon-links.stories.js b/examples/mithril-kitchen-sink/src/stories/addon-links.stories.js index 72589574ae1a..ea20da6fa529 100644 --- a/examples/mithril-kitchen-sink/src/stories/addon-links.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/addon-links.stories.js @@ -9,7 +9,7 @@ export default { title: 'Addons/Links', }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => , }); -story1.story = { name: 'Go to welcome' }; +Story1.story = { name: 'Go to welcome' }; diff --git a/examples/mithril-kitchen-sink/src/stories/addon-notes.stories.js b/examples/mithril-kitchen-sink/src/stories/addon-notes.stories.js index 6801d66fcecd..26a9b8a401db 100644 --- a/examples/mithril-kitchen-sink/src/stories/addon-notes.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/addon-notes.stories.js @@ -6,7 +6,7 @@ export default { title: 'Addons/Notes', }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => (

@@ -21,12 +21,12 @@ export const story1 = () => ({ ), }); -story1.story = { +Story1.story = { name: 'Simple note', parameters: { notes: 'My notes on some bold text' }, }; -export const story2 = () => ({ +export const Story2 = () => ({ view: () => (

🤔😳😯😮 @@ -38,7 +38,7 @@ export const story2 = () => ({ ), }); -story2.story = { +Story2.story = { name: 'Note with HTML', parameters: { notes: ` diff --git a/examples/mithril-kitchen-sink/src/stories/button.stories.js b/examples/mithril-kitchen-sink/src/stories/button.stories.js index ef051b16dec0..f172c6abe7fc 100644 --- a/examples/mithril-kitchen-sink/src/stories/button.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/button.stories.js @@ -12,12 +12,12 @@ export default { }, }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => m(Button, { onclick: action('clicked') }, 'Hello Button'), }); -story1.story = { name: 'with text' }; +Story1.story = { name: 'with text' }; -export const story2 = () => ({ +export const Story2 = () => ({ view: () => m( Button, @@ -25,4 +25,4 @@ export const story2 = () => ({ m('span', { role: 'img', ariaLabel: 'so cool' }, '😀 😎 👍 💯') ), }); -story2.story = { name: 'with some emoji' }; +Story2.story = { name: 'with some emoji' }; diff --git a/examples/mithril-kitchen-sink/src/stories/welcome.stories.js b/examples/mithril-kitchen-sink/src/stories/welcome.stories.js index 60ead95a694f..c30203e117c4 100644 --- a/examples/mithril-kitchen-sink/src/stories/welcome.stories.js +++ b/examples/mithril-kitchen-sink/src/stories/welcome.stories.js @@ -7,7 +7,7 @@ export default { component: Welcome, }; -export const story1 = () => ({ +export const Story1 = () => ({ view: () => m(Welcome, { showApp: linkTo('Button') }), }); -story1.story = { name: 'to Storybook' }; +Story1.story = { name: 'to Storybook' }; diff --git a/examples/official-storybook/stories/addon-a11y/base-button.stories.js b/examples/official-storybook/stories/addon-a11y/base-button.stories.js index cfdac38ea8be..64f1aded15ca 100644 --- a/examples/official-storybook/stories/addon-a11y/base-button.stories.js +++ b/examples/official-storybook/stories/addon-a11y/base-button.stories.js @@ -16,11 +16,11 @@ export const Default = () => ; export const Label = () => ; export const Disabled = () => ; -export const invalidContrast = () => ( +export const InvalidContrast = () => ( // FIXME: has no effect on score ); -invalidContrast.story = { +InvalidContrast.story = { name: 'Invalid contrast', }; diff --git a/examples/official-storybook/stories/addon-a11y/button.stories.js b/examples/official-storybook/stories/addon-a11y/button.stories.js index 6f030c88bec3..a59bd7a48603 100644 --- a/examples/official-storybook/stories/addon-a11y/button.stories.js +++ b/examples/official-storybook/stories/addon-a11y/button.stories.js @@ -15,7 +15,7 @@ export const Default = () => ; +export const BasicExample = () => ; -basicExample.story = { +BasicExample.story = { name: 'Basic example', }; -export const multipleActions = () => ( +export const MultipleActions = () => ( ); -multipleActions.story = { +MultipleActions.story = { name: 'Multiple actions', }; -export const multipleActionsConfig = () => ( +export const MultipleActionsConfig = () => ( ); -multipleActionsConfig.story = { +MultipleActionsConfig.story = { name: 'Multiple actions + config', }; -export const multipleActionsAsObject = () => ( +export const MultipleActionsAsObject = () => ( ); -multipleActionsAsObject.story = { +MultipleActionsAsObject.story = { name: 'Multiple actions as object', }; -export const multipleActionsObjectConfig = () => ( +export const MultipleActionsObjectConfig = () => ( ); -multipleActionsObjectConfig.story = { +MultipleActionsObjectConfig.story = { name: 'Multiple actions, object + config', }; -export const decoratedAction = () => ( +export const DecoratedAction = () => ( ); -decoratedAction.story = { +DecoratedAction.story = { name: 'Decorated action', }; -export const decoratedActionConfig = () => ( +export const DecoratedActionConfig = () => ( ); -decoratedActionConfig.story = { +DecoratedActionConfig.story = { name: 'Decorated action + config', }; -export const decoratedActions = () => ( +export const DecoratedActions = () => ( ); -decoratedActions.story = { +DecoratedActions.story = { name: 'Decorated actions', }; -export const decoratedActionsConfig = () => ( +export const DecoratedActionsConfig = () => ( ); -decoratedActionsConfig.story = { +DecoratedActionsConfig.story = { name: 'Decorated actions + config', }; -export const circularPayload = () => { +export const CircularPayload = () => { const circular = { foo: {} }; circular.foo.circular = circular; return ; }; -circularPayload.story = { +CircularPayload.story = { name: 'Circular Payload', }; -export const reservedKeywordAsName = () => ; +export const ReservedKeywordAsName = () => ; -reservedKeywordAsName.story = { +ReservedKeywordAsName.story = { name: 'Reserved keyword as name', }; -export const allTypes = () => { +export const AllTypes = () => { function A() {} function B() {} @@ -185,11 +185,11 @@ export const allTypes = () => { ); }; -allTypes.story = { +AllTypes.story = { name: 'All types', }; -export const configureActionsDepth = () => { +export const ConfigureActionsDepth = () => { configureActions({ depth: 2, }); @@ -201,7 +201,7 @@ export const configureActionsDepth = () => { ); }; -export const persistingTheActionLogger = () => ( +export const PersistingTheActionLogger = () => (

Moving away from this story will persist the action logger

); -primaryLargeButton.story = { +PrimaryLargeButton.story = { name: 'Primary Large Button', parameters: { cssresources: [ @@ -30,8 +30,8 @@ primaryLargeButton.story = { }, }; -export const cameraIcon = () => Camera Icon; -cameraIcon.story = { +export const CameraIcon = () => Camera Icon; +CameraIcon.story = { name: 'Camera Icon', parameters: { cssresources: [ diff --git a/examples/official-storybook/stories/addon-design-assets.stories.js b/examples/official-storybook/stories/addon-design-assets.stories.js index b0f928195c99..6d858132d683 100644 --- a/examples/official-storybook/stories/addon-design-assets.stories.js +++ b/examples/official-storybook/stories/addon-design-assets.stories.js @@ -10,9 +10,9 @@ export default { }, }; -export const singleImage = () =>
This story should a single image in the assets panel
; +export const SingleImage = () =>
This story should a single image in the assets panel
; -singleImage.story = { +SingleImage.story = { name: 'single image', parameters: { @@ -20,9 +20,9 @@ singleImage.story = { }, }; -export const singleWebpage = () =>
This story should a single image in the assets panel
; +export const SingleWebpage = () =>
This story should a single image in the assets panel
; -singleWebpage.story = { +SingleWebpage.story = { name: 'single webpage', parameters: { @@ -30,9 +30,9 @@ singleWebpage.story = { }, }; -export const youtubeVideo = () =>
This story should a single image in the assets panel
; +export const YoutubeVideo = () =>
This story should a single image in the assets panel
; -youtubeVideo.story = { +YoutubeVideo.story = { name: 'youtube video', parameters: { @@ -40,11 +40,11 @@ youtubeVideo.story = { }, }; -export const multipleImages = () => ( +export const MultipleImages = () => (
This story should a multiple images in the assets panel
); -multipleImages.story = { +MultipleImages.story = { name: 'multiple images', parameters: { @@ -55,9 +55,9 @@ multipleImages.story = { }, }; -export const namedAssets = () =>
This story should a single image in the assets panel
; +export const NamedAssets = () =>
This story should a single image in the assets panel
; -namedAssets.story = { +NamedAssets.story = { name: 'named assets', parameters: { @@ -74,11 +74,11 @@ namedAssets.story = { }, }; -export const urlReplacement = () => ( +export const UrlReplacement = () => (
This story should have a webpge, with within it's url the storyId
); -urlReplacement.story = { +UrlReplacement.story = { name: 'url replacement', parameters: { diff --git a/examples/official-storybook/stories/addon-docs/addon-docs.stories.js b/examples/official-storybook/stories/addon-docs/addon-docs.stories.js index 1b06f9bfc190..c82415db5022 100644 --- a/examples/official-storybook/stories/addon-docs/addon-docs.stories.js +++ b/examples/official-storybook/stories/addon-docs/addon-docs.stories.js @@ -8,49 +8,49 @@ export default { component: DocgenButton, }; -export const basic = () =>
Click docs tab to see basic docs
; +export const Basic = () =>
Click docs tab to see basic docs
; -export const noDocs = () =>
Click docs tab to see no docs error
; -noDocs.story = { +export const NoDocs = () =>
Click docs tab to see no docs error
; +NoDocs.story = { name: 'no docs', parameters: { docs: { page: null } }, }; -export const withNotes = () =>
Click docs tab to see DocsPage docs
; -withNotes.story = { +export const WithNotes = () =>
Click docs tab to see DocsPage docs
; +WithNotes.story = { name: 'with notes', parameters: { notes }, }; -export const withInfo = () =>
Click docs tab to see DocsPage docs
; -withInfo.story = { +export const WithInfo = () =>
Click docs tab to see DocsPage docs
; +WithInfo.story = { name: 'with info', parameters: { info: 'some user info string', }, }; -export const mdxOverride = () =>
Click docs tab to see MDX-overridden docs
; -mdxOverride.story = { +export const MdxOverride = () =>
Click docs tab to see MDX-overridden docs
; +MdxOverride.story = { name: 'mdx override', parameters: { docs: { page: mdxNotes }, }, }; -export const jsxOverride = () =>
Click docs tab to see JSX-overridden docs
; -jsxOverride.story = { +export const JsxOverride = () =>
Click docs tab to see JSX-overridden docs
; +JsxOverride.story = { name: 'jsx override', parameters: { docs: { page: () =>
Hello docs
}, }, }; -export const docsDisable = () =>
This story shouldn't show up in DocsPage
; -docsDisable.story = { +export const DocsDisable = () =>
This story shouldn't show up in DocsPage
; +DocsDisable.story = { parameters: { docs: { disable: true }, }, }; -export const largerThanPreview = () =>
HUGE
; +export const LargerThanPreview = () =>
HUGE
; diff --git a/examples/official-storybook/stories/addon-docs/mdx.stories.js b/examples/official-storybook/stories/addon-docs/mdx.stories.js index c4cab584e45a..e2563d4825fe 100644 --- a/examples/official-storybook/stories/addon-docs/mdx.stories.js +++ b/examples/official-storybook/stories/addon-docs/mdx.stories.js @@ -8,7 +8,7 @@ export default { }; // This renders the contents of the docs panel into story content -export const typography = () => { +export const Typography = () => { const Docs = markdown.parameters.docs.page; return ; }; diff --git a/examples/official-storybook/stories/addon-graphql.stories.js b/examples/official-storybook/stories/addon-graphql.stories.js index f1e8044e0d93..ceab150d2f7e 100644 --- a/examples/official-storybook/stories/addon-graphql.stories.js +++ b/examples/official-storybook/stories/addon-graphql.stories.js @@ -4,9 +4,9 @@ export default { title: 'Addons/GraphQL', }; -export const getPikachu = () =>
hello
; +export const GetPikachu = () =>
hello
; -getPikachu.story = { +GetPikachu.story = { name: 'get Pikachu', parameters: { graphiql: { diff --git a/examples/official-storybook/stories/addon-info/decorators.stories.js b/examples/official-storybook/stories/addon-info/decorators.stories.js index 0d3774ffdcc0..780fb3a0b6db 100644 --- a/examples/official-storybook/stories/addon-info/decorators.stories.js +++ b/examples/official-storybook/stories/addon-info/decorators.stories.js @@ -7,5 +7,5 @@ export default { decorators: [withInfo('Info can take options via the global or local decorator as well.')], }; -export const useInfo = () => ; -useInfo.story = { name: 'Use Info as story decorator' }; +export const UseInfo = () => ; +UseInfo.story = { name: 'Use Info as story decorator' }; diff --git a/examples/official-storybook/stories/addon-info/forward-ref.stories.js b/examples/official-storybook/stories/addon-info/forward-ref.stories.js index 21fdcd5ac6d6..1aa8da24c022 100644 --- a/examples/official-storybook/stories/addon-info/forward-ref.stories.js +++ b/examples/official-storybook/stories/addon-info/forward-ref.stories.js @@ -8,10 +8,10 @@ export default { decorators: [withInfo], }; -export const displaysCorrectly = () => ; -displaysCorrectly.story = { name: 'Displays forwarded ref components correctly' }; +export const DisplaysCorrectly = () => ; +DisplaysCorrectly.story = { name: 'Displays forwarded ref components correctly' }; -export const displayName = () => ( +export const DisplayName = () => ( ); -displayName.story = { name: 'Uses forwardRef displayName if available' }; +DisplayName.story = { name: 'Uses forwardRef displayName if available' }; diff --git a/examples/official-storybook/stories/addon-info/jsx.stories.js b/examples/official-storybook/stories/addon-info/jsx.stories.js index 5052bf5f241c..7db0a4ee09b5 100644 --- a/examples/official-storybook/stories/addon-info/jsx.stories.js +++ b/examples/official-storybook/stories/addon-info/jsx.stories.js @@ -25,11 +25,11 @@ export default { decorators: [withInfo], }; -export const displaysJsxInDescription = () => ( +export const DisplaysJsxInDescription = () => ( ); -displaysJsxInDescription.story = { +DisplaysJsxInDescription.story = { name: 'Displays JSX in description', parameters: { diff --git a/examples/official-storybook/stories/addon-info/markdown.stories.js b/examples/official-storybook/stories/addon-info/markdown.stories.js index 208b5c84ffee..38038e50703f 100644 --- a/examples/official-storybook/stories/addon-info/markdown.stories.js +++ b/examples/official-storybook/stories/addon-info/markdown.stories.js @@ -47,20 +47,20 @@ html with special formatting Maybe include a [link](http://storybook.js.org) to your project as well. `; -export const displaysMarkdownInDescription = () => ( +export const DisplaysMarkdownInDescription = () => ( ); -displaysMarkdownInDescription.story = { +DisplaysMarkdownInDescription.story = { name: 'Displays Markdown in description', parameters: { info: markdownDescription }, }; -export const fromInternalMarkdownFile = () => ( +export const FromInternalMarkdownFile = () => ( ); -fromInternalMarkdownFile.story = { +FromInternalMarkdownFile.story = { name: 'From internal Markdown file', parameters: { @@ -72,11 +72,11 @@ fromInternalMarkdownFile.story = { }, }; -export const fromExternalMarkdownFile = () => ( +export const FromExternalMarkdownFile = () => ( ); -fromExternalMarkdownFile.story = { +FromExternalMarkdownFile.story = { name: 'From external Markdown file', parameters: { info: externalMdDocs }, }; diff --git a/examples/official-storybook/stories/addon-info/options.stories.js b/examples/official-storybook/stories/addon-info/options.stories.js index 632518c932f3..f75e3b825607 100644 --- a/examples/official-storybook/stories/addon-info/options.stories.js +++ b/examples/official-storybook/stories/addon-info/options.stories.js @@ -12,8 +12,8 @@ export default { decorators: [withInfo], }; -export const inlinesComponentInsideStory = () => ; -inlinesComponentInsideStory.story = { +export const InlinesComponentInsideStory = () => ; +InlinesComponentInsideStory.story = { name: 'Inlines component inside story', parameters: { info: { @@ -23,10 +23,10 @@ inlinesComponentInsideStory.story = { }, }; -export const excludesPropTypesThatAreInTheExcludedPropTypesArray = () => ( +export const ExcludesPropTypesThatAreInTheExcludedPropTypesArray = () => ( ); -excludesPropTypesThatAreInTheExcludedPropTypesArray.story = { +ExcludesPropTypesThatAreInTheExcludedPropTypesArray.story = { name: 'Excludes propTypes that are in the excludedPropTypes array', parameters: { info: { @@ -36,8 +36,8 @@ excludesPropTypesThatAreInTheExcludedPropTypesArray.story = { }, }; -export const showsOrHidesInfoAddonHeader = () => ; -showsOrHidesInfoAddonHeader.story = { +export const ShowsOrHidesInfoAddonHeader = () => ; +ShowsOrHidesInfoAddonHeader.story = { name: 'Shows or hides Info Addon header', parameters: { info: { @@ -47,8 +47,8 @@ showsOrHidesInfoAddonHeader.story = { }, }; -export const showsOrHidesInfoAddonSource = () => ; -showsOrHidesInfoAddonSource.story = { +export const ShowsOrHidesInfoAddonSource = () => ; +ShowsOrHidesInfoAddonSource.story = { name: 'Shows or hides Info Addon source', parameters: { info: { @@ -58,8 +58,8 @@ showsOrHidesInfoAddonSource.story = { }, }; -export const showsAdditionalComponentPropTables = () => ; -showsAdditionalComponentPropTables.story = { +export const ShowsAdditionalComponentPropTables = () => ; +ShowsAdditionalComponentPropTables.story = { name: 'Shows additional component prop tables', parameters: { info: { @@ -69,13 +69,13 @@ showsAdditionalComponentPropTables.story = { }, }; -export const excludeComponentFromPropTables = () => ( +export const ExcludeComponentFromPropTables = () => (
); -excludeComponentFromPropTables.story = { +ExcludeComponentFromPropTables.story = { name: 'Exclude component from prop tables', parameters: { info: { @@ -85,8 +85,8 @@ excludeComponentFromPropTables.story = { }, }; -export const extendInfoStylesWithAnObject = () => ; -extendInfoStylesWithAnObject.story = { +export const ExtendInfoStylesWithAnObject = () => ; +ExtendInfoStylesWithAnObject.story = { name: 'Extend info styles with an object', parameters: { info: { @@ -106,8 +106,8 @@ extendInfoStylesWithAnObject.story = { }, }; -export const fullControlOverStylesUsingAFunction = () => ; -fullControlOverStylesUsingAFunction.story = { +export const FullControlOverStylesUsingAFunction = () => ; +FullControlOverStylesUsingAFunction.story = { name: 'Full control over styles using a function', parameters: { info: { @@ -125,8 +125,8 @@ fullControlOverStylesUsingAFunction.story = { }, }; -export const useACustomComponentForTheTable = () => ; -useACustomComponentForTheTable.story = { +export const UseACustomComponentForTheTable = () => ; +UseACustomComponentForTheTable.story = { name: 'Use a custom component for the table', component: TableComponent, parameters: { @@ -136,22 +136,22 @@ useACustomComponentForTheTable.story = { }, }; -export const useInfoAsStoryDecorator = () => ; +export const UseInfoAsStoryDecorator = () => ; -useInfoAsStoryDecorator.story = { +UseInfoAsStoryDecorator.story = { name: 'Use Info as story decorator', decorators: [withInfo('Info can take options via the global or local decorator as well.')], }; -export const usingParametersAcrossAllStories = () => ; -usingParametersAcrossAllStories.story = { +export const UsingParametersAcrossAllStories = () => ; +UsingParametersAcrossAllStories.story = { name: 'Using parameters across all stories', }; -export const overwritingAndExtendingTheParametersAndOptionsSetStoriesWise = () => ( +export const OverwritingAndExtendingTheParametersAndOptionsSetStoriesWise = () => ( ); -overwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { +OverwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { name: 'Overwriting and extending the parameters and options set stories-wise', parameters: { info: { @@ -161,20 +161,20 @@ overwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { }, }; -export const overwriteTheParametersWithMarkdownVariable = () => ( +export const OverwriteTheParametersWithMarkdownVariable = () => ( ); -overwriteTheParametersWithMarkdownVariable.story = { +OverwriteTheParametersWithMarkdownVariable.story = { name: 'Overwrite the parameters with markdown variable', parameters: { info: markdownDescription }, }; -export const overwriteTheTextParameterWithMarkdownInline = () => ( +export const OverwriteTheTextParameterWithMarkdownInline = () => ( ); -overwriteTheTextParameterWithMarkdownInline.story = { +OverwriteTheTextParameterWithMarkdownInline.story = { name: 'Overwrite the text parameter with markdown inline', parameters: { info: { @@ -189,10 +189,10 @@ overwriteTheTextParameterWithMarkdownInline.story = { }, }; -export const disableTheAddonEntirely = () => ( +export const DisableTheAddonEntirely = () => ( ); -disableTheAddonEntirely.story = { +DisableTheAddonEntirely.story = { name: 'Disable the addon entirely', parameters: { info: { disable: true } }, }; diff --git a/examples/official-storybook/stories/addon-info/parameters.stories.js b/examples/official-storybook/stories/addon-info/parameters.stories.js index 257c165f9937..9e36b966b5f7 100644 --- a/examples/official-storybook/stories/addon-info/parameters.stories.js +++ b/examples/official-storybook/stories/addon-info/parameters.stories.js @@ -27,15 +27,15 @@ export default { }, }; -export const usingParametersAcrossAllStories = () => ; -usingParametersAcrossAllStories.story = { +export const UsingParametersAcrossAllStories = () => ; +UsingParametersAcrossAllStories.story = { name: 'Using parameters across all stories', }; -export const overwritingAndExtendingTheParametersAndOptionsSetStoriesWise = () => ( +export const OverwritingAndExtendingTheParametersAndOptionsSetStoriesWise = () => ( ); -overwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { +OverwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { name: 'Overwriting and extending the parameters and options set stories-wise', parameters: { info: { @@ -45,18 +45,18 @@ overwritingAndExtendingTheParametersAndOptionsSetStoriesWise.story = { }, }; -export const overwriteTheParametersWithMarkdownVariable = () => ( +export const OverwriteTheParametersWithMarkdownVariable = () => ( ); -overwriteTheParametersWithMarkdownVariable.story = { +OverwriteTheParametersWithMarkdownVariable.story = { name: 'Overwrite the parameters with markdown variable', parameters: { info: markdownDescription }, }; -export const overwriteTheTextParameterWithMarkdownInline = () => ( +export const OverwriteTheTextParameterWithMarkdownInline = () => ( ); -overwriteTheTextParameterWithMarkdownInline.story = { +OverwriteTheTextParameterWithMarkdownInline.story = { name: 'Overwrite the text parameter with markdown inline', parameters: { info: { @@ -71,10 +71,10 @@ overwriteTheTextParameterWithMarkdownInline.story = { }, }; -export const disableTheAddonEntirely = () => ( +export const DisableTheAddonEntirely = () => ( ); -disableTheAddonEntirely.story = { +DisableTheAddonEntirely.story = { name: 'Disable the addon entirely', parameters: { info: { disable: true } }, }; diff --git a/examples/official-storybook/stories/addon-info/react-docgen.stories.js b/examples/official-storybook/stories/addon-info/react-docgen.stories.js index bbb6412abeba..deef915f0478 100644 --- a/examples/official-storybook/stories/addon-info/react-docgen.stories.js +++ b/examples/official-storybook/stories/addon-info/react-docgen.stories.js @@ -13,7 +13,7 @@ export default { decorators: [withInfo], }; -export const commentsFromPropTypeDeclarations = () => ( +export const CommentsFromPropTypeDeclarations = () => ( ( /> ); -commentsFromPropTypeDeclarations.story = { +CommentsFromPropTypeDeclarations.story = { name: 'Comments from PropType declarations', parameters: { @@ -42,11 +42,11 @@ commentsFromPropTypeDeclarations.story = { }, }; -export const commentsFromFlowDeclarations = () => ( +export const CommentsFromFlowDeclarations = () => ( ); -commentsFromFlowDeclarations.story = { +CommentsFromFlowDeclarations.story = { name: 'Comments from Flow declarations', parameters: { @@ -55,11 +55,11 @@ commentsFromFlowDeclarations.story = { }, }; -export const commentsFromComponentDeclaration = () => ( +export const CommentsFromComponentDeclaration = () => ( ); -commentsFromComponentDeclaration.story = { +CommentsFromComponentDeclaration.story = { name: 'Comments from component declaration', parameters: { @@ -68,11 +68,11 @@ commentsFromComponentDeclaration.story = { }, }; -export const commentsFromNamedExportComponentDeclaration = () => ( +export const CommentsFromNamedExportComponentDeclaration = () => ( ); -commentsFromNamedExportComponentDeclaration.story = { +CommentsFromNamedExportComponentDeclaration.story = { name: 'Comments from named export component declaration', parameters: { diff --git a/examples/official-storybook/stories/addon-info/story-source.stories.js b/examples/official-storybook/stories/addon-info/story-source.stories.js index fb2a42ece90e..8c8f3dd4ec78 100644 --- a/examples/official-storybook/stories/addon-info/story-source.stories.js +++ b/examples/official-storybook/stories/addon-info/story-source.stories.js @@ -10,21 +10,21 @@ export default { decorators: [withInfo], }; -export const oneProp = () => ; -oneProp.story = { name: 'One prop' }; +export const OneProp = () => ; +OneProp.story = { name: 'One prop' }; -export const manyProps = () => ; -manyProps.story = { name: 'Many props' }; +export const ManyProps = () => ; +ManyProps.story = { name: 'Many props' }; -export const children = () => ( +export const Children = () => (

Here is my nice button:

); -children.story = { name: 'Children' }; +Children.story = { name: 'Children' }; -export const arrayProp = () => { +export const ArrayProp = () => { const propDefs = [ { property: 'label', @@ -55,9 +55,9 @@ export const arrayProp = () => { ]; return ; }; -arrayProp.story = { name: 'Array prop' }; +ArrayProp.story = { name: 'Array prop' }; -export const objectProp = () => ( +export const ObjectProp = () => ( ( }} /> ); -objectProp.story = { name: 'Object prop' }; +ObjectProp.story = { name: 'Object prop' }; diff --git a/examples/official-storybook/stories/addon-jest.stories.js b/examples/official-storybook/stories/addon-jest.stories.js index b0226b4cd8f2..e488a6e6f75a 100644 --- a/examples/official-storybook/stories/addon-jest.stories.js +++ b/examples/official-storybook/stories/addon-jest.stories.js @@ -8,7 +8,7 @@ export default { decorators: [withTestsHOC({ results })], }; -export const withTests = () =>

Hello

; -withTests.story = { +export const WithTests = () =>

Hello

; +WithTests.story = { parameters: { jest: 'addon-jest' }, }; diff --git a/examples/official-storybook/stories/addon-knobs/with-knobs-decorators.stories.js b/examples/official-storybook/stories/addon-knobs/with-knobs-decorators.stories.js index 1a9a5a6d7ba9..478b21d5ef07 100644 --- a/examples/official-storybook/stories/addon-knobs/with-knobs-decorators.stories.js +++ b/examples/official-storybook/stories/addon-knobs/with-knobs-decorators.stories.js @@ -4,10 +4,10 @@ export default { title: 'Addons/Knobs/with decorators', }; -export const withDecoratorCallingStoryFunctionMoreThanOnce = () => { +export const WithDecoratorCallingStoryFunctionMoreThanOnce = () => { return text('Text', 'Hello'); }; -withDecoratorCallingStoryFunctionMoreThanOnce.story = { +WithDecoratorCallingStoryFunctionMoreThanOnce.story = { decorators: [ withKnobs, storyFn => { diff --git a/examples/official-storybook/stories/addon-knobs/with-knobs-options.stories.js b/examples/official-storybook/stories/addon-knobs/with-knobs-options.stories.js index d4ee216a4fd4..df29629444bb 100644 --- a/examples/official-storybook/stories/addon-knobs/with-knobs-options.stories.js +++ b/examples/official-storybook/stories/addon-knobs/with-knobs-options.stories.js @@ -10,7 +10,7 @@ export default { ], }; -export const acceptsOptions = () =>
{text('Rendered string', '

Hello

')}
; -acceptsOptions.story = { +export const AcceptsOptions = () =>
{text('Rendered string', '

Hello

')}
; +AcceptsOptions.story = { name: 'accepts options', }; diff --git a/examples/official-storybook/stories/addon-knobs/with-knobs.stories.js b/examples/official-storybook/stories/addon-knobs/with-knobs.stories.js index c6209f09a214..3a94cd0d34d8 100644 --- a/examples/official-storybook/stories/addon-knobs/with-knobs.stories.js +++ b/examples/official-storybook/stories/addon-knobs/with-knobs.stories.js @@ -14,7 +14,7 @@ import { button, object, files, - optionsKnob as options, + OptionsKnob as options, } from '@storybook/addon-knobs'; const ItemLoader = ({ isLoading, items }) => { @@ -45,7 +45,7 @@ export default { decorators: [withKnobs], }; -export const tweaksStaticValues = () => { +export const TweaksStaticValues = () => { const name = text('Name', 'Storyteller'); const age = number('Age', 70, { range: true, min: 0, max: 90, step: 5 }); const fruits = { @@ -119,11 +119,11 @@ export const tweaksStaticValues = () => { ); }; -tweaksStaticValues.story = { +TweaksStaticValues.story = { name: 'tweaks static values', }; -export const tweaksStaticValuesOrganizedInGroups = () => { +export const TweaksStaticValuesOrganizedInGroups = () => { const GROUP_IDS = { DISPLAY: 'Display', GENERAL: 'General', @@ -206,11 +206,11 @@ export const tweaksStaticValuesOrganizedInGroups = () => { ); }; -tweaksStaticValuesOrganizedInGroups.story = { +TweaksStaticValuesOrganizedInGroups.story = { name: 'tweaks static values organized in groups', }; -export const dynamicKnobs = () => { +export const DynamicKnobs = () => { const showOptional = select('Show optional', ['yes', 'no'], 'yes'); return ( @@ -219,11 +219,11 @@ export const dynamicKnobs = () => { ); }; -dynamicKnobs.story = { +DynamicKnobs.story = { name: 'dynamic knobs', }; -export const complexSelect = () => { +export const ComplexSelect = () => { const m = select( 'complex', { @@ -243,11 +243,11 @@ export const complexSelect = () => { ); }; -complexSelect.story = { +ComplexSelect.story = { name: 'complex select', }; -export const optionsKnob = () => { +export const OptionsKnob = () => { const valuesRadio = { Monday: 'Monday', Tuesday: 'Tuesday', @@ -322,7 +322,7 @@ export const optionsKnob = () => { ); }; -export const triggersActionsViaButton = () => { +export const TriggersActionsViaButton = () => { button('Toggle item list state', () => { if (!injectedIsLoading && injectedItems.length === 0) { injectedIsLoading = true; @@ -346,18 +346,18 @@ export const triggersActionsViaButton = () => { ); }; -triggersActionsViaButton.story = { +TriggersActionsViaButton.story = { name: 'triggers actions via button', }; -export const buttonWithReactUseState = () => { +export const ButtonWithReactUseState = () => { const [counter, setCounter] = React.useState(0); button('increment', () => setCounter(counter + 1)); button('decrement', () => setCounter(counter - 1)); return counter; }; -export const xssSafety = () => ( +export const XssSafety = () => (
( }} /> ); -xssSafety.story = { +XssSafety.story = { name: 'XSS safety', }; -export const acceptsStoryParameters = () =>
{text('Rendered string', '

Hello

')}
; -acceptsStoryParameters.story = { +export const AcceptsStoryParameters = () =>
{text('Rendered string', '

Hello

')}
; +AcceptsStoryParameters.story = { name: 'accepts story parameters', parameters: { @@ -378,7 +378,7 @@ acceptsStoryParameters.story = { }, }; -export const withDuplicateDecorator = () => { +export const WithDuplicateDecorator = () => { return text('Text', 'Hello'); }; -withDuplicateDecorator.story = { decorators: [withKnobs] }; +WithDuplicateDecorator.story = { decorators: [withKnobs] }; diff --git a/examples/official-storybook/stories/addon-links/href.stories.js b/examples/official-storybook/stories/addon-links/href.stories.js index 98dc6fb4a891..fc2f79bae16b 100644 --- a/examples/official-storybook/stories/addon-links/href.stories.js +++ b/examples/official-storybook/stories/addon-links/href.stories.js @@ -6,12 +6,12 @@ export default { title: 'Addons/Links/Href', }; -export const log = () => { +export const Log = () => { hrefTo('Addons|Links.Href', 'log').then(href => action('URL of this story')(href)); return See action logger; }; -log.story = { +Log.story = { parameters: { options: { panel: 'storybook/actions/panel', diff --git a/examples/official-storybook/stories/addon-notes.stories.js b/examples/official-storybook/stories/addon-notes.stories.js index f6053091f722..b9d05dd35035 100644 --- a/examples/official-storybook/stories/addon-notes.stories.js +++ b/examples/official-storybook/stories/addon-notes.stories.js @@ -77,11 +77,11 @@ export default { title: 'Addons/Notes', }; -export const addonNotes = () => ( +export const AddonNotes = () => ( ); -addonNotes.story = { +AddonNotes.story = { name: 'addon notes', parameters: { notes: @@ -89,44 +89,44 @@ addonNotes.story = { }, }; -export const addonNotesRenderingImportedMarkdown = () => ( +export const AddonNotesRenderingImportedMarkdown = () => ( ); -addonNotesRenderingImportedMarkdown.story = { +AddonNotesRenderingImportedMarkdown.story = { name: 'addon notes rendering imported markdown', parameters: { notes: { markdown: markdownNotes }, }, }; -export const addonNotesRenderingInlineGithubFlavoredMarkdown = () => ( +export const AddonNotesRenderingInlineGithubFlavoredMarkdown = () => ( ); -addonNotesRenderingInlineGithubFlavoredMarkdown.story = { +AddonNotesRenderingInlineGithubFlavoredMarkdown.story = { name: 'addon notes rendering inline, github-flavored markdown', parameters: { notes: { markdown: markdownString }, }, }; -export const withAMarkdownTable = () => ( +export const WithAMarkdownTable = () => ( ); -withAMarkdownTable.story = { +WithAMarkdownTable.story = { name: 'with a markdown table', parameters: { notes: { markdown: markdownTable }, }, }; -export const withAMarkdownGiphy = () => ( +export const WithAMarkdownGiphy = () => ( ); -withAMarkdownGiphy.story = { +WithAMarkdownGiphy.story = { name: 'with a markdown giphy', parameters: { notes: { markdown: giphyMarkdown }, diff --git a/examples/official-storybook/stories/addon-options.stories.js b/examples/official-storybook/stories/addon-options.stories.js index 358abb41b2f6..b8cafe157faf 100644 --- a/examples/official-storybook/stories/addon-options.stories.js +++ b/examples/official-storybook/stories/addon-options.stories.js @@ -4,11 +4,11 @@ export default { title: 'Addons/Options', }; -export const settingName = () => ( +export const SettingName = () => (
This story should have changed the name of the storybook
); -settingName.story = { +SettingName.story = { name: 'setting name', parameters: { @@ -18,11 +18,11 @@ settingName.story = { }, }; -export const hidingAddonPanel = () => ( +export const HidingAddonPanel = () => (
This story should have changed hidden the addons panel
); -hidingAddonPanel.story = { +HidingAddonPanel.story = { name: 'hiding addon panel', parameters: { diff --git a/examples/official-storybook/stories/addon-queryparams.stories.js b/examples/official-storybook/stories/addon-queryparams.stories.js index 8fe633c230f0..3d5c515fb2ae 100644 --- a/examples/official-storybook/stories/addon-queryparams.stories.js +++ b/examples/official-storybook/stories/addon-queryparams.stories.js @@ -13,19 +13,19 @@ export default { }, }; -export const mockIsTrue = () => ( +export const MockIsTrue = () => (
This story should have an extra url query param: {document.location.search}
); -mockIsTrue.story = { +MockIsTrue.story = { name: 'mock is true', }; -export const mockIs4 = () => ( +export const MockIs4 = () => (
This story should have an extra url query param: {document.location.search}
); -mockIs4.story = { +MockIs4.story = { name: 'mock is 4', parameters: { query: { mock: 4 } }, }; diff --git a/examples/official-storybook/stories/addon-viewport/custom-default.stories.js b/examples/official-storybook/stories/addon-viewport/custom-default.stories.js index aa98e44191f1..b75528e380bc 100644 --- a/examples/official-storybook/stories/addon-viewport/custom-default.stories.js +++ b/examples/official-storybook/stories/addon-viewport/custom-default.stories.js @@ -28,12 +28,12 @@ export const Inherited = () => ( ); -export const overriddenViaWithViewportParameterizedDecorator = () => ( +export const OverriddenViaWithViewportParameterizedDecorator = () => ( I respect my parents but I should be looking good on iPad. ); -overriddenViaWithViewportParameterizedDecorator.story = { +OverriddenViaWithViewportParameterizedDecorator.story = { name: 'Overridden via "withViewport" parameterized decorator', parameters: { viewport: { defaultViewport: 'ipad' } }, }; diff --git a/examples/official-storybook/stories/addon-viewport/default.stories.js b/examples/official-storybook/stories/addon-viewport/default.stories.js index 945473987ad6..31c43a42c866 100644 --- a/examples/official-storybook/stories/addon-viewport/default.stories.js +++ b/examples/official-storybook/stories/addon-viewport/default.stories.js @@ -12,7 +12,7 @@ export default { }, }, }; -export const defaultFn = () => ( +export const DefaultFn = () => ( I don't have problems being rendered using the default viewport. ); -defaultFn.story = { name: 'default' }; +DefaultFn.story = { name: 'default' }; diff --git a/examples/official-storybook/stories/core/decorators.stories.js b/examples/official-storybook/stories/core/decorators.stories.js index be0c8c2071e7..15af07f7bde9 100644 --- a/examples/official-storybook/stories/core/decorators.stories.js +++ b/examples/official-storybook/stories/core/decorators.stories.js @@ -26,8 +26,8 @@ export default { ], }; -export const all = () =>

Story

; -all.story = { +export const All = () =>

Story

; +All.story = { decorators: [ s => ( <> @@ -38,8 +38,8 @@ all.story = { ], }; -export const deprecated = () =>

Story

; -deprecated.story = { +export const Deprecated = () =>

Story

; +Deprecated.story = { parameters: { decorators: [ s => ( diff --git a/examples/official-storybook/stories/core/errors.stories.js b/examples/official-storybook/stories/core/errors.stories.js index 54950d178087..00c6c19bf082 100644 --- a/examples/official-storybook/stories/core/errors.stories.js +++ b/examples/official-storybook/stories/core/errors.stories.js @@ -7,10 +7,10 @@ export default { title: 'Core/Errors', }; -export const exception = () => { +export const Exception = () => { throw new Error('storyFn threw an error! WHOOPS'); }; -exception.story = { +Exception.story = { name: 'story throws exception', parameters: { storyshots: { disable: true }, @@ -33,8 +33,8 @@ badComponent.story = { }, }; -export const badStory = () => badOutput; -badStory.story = { +export const BadStory = () => badOutput; +BadStory.story = { name: 'story errors - story un-renderable type', parameters: { notes: 'Story does not return something react can render', diff --git a/examples/official-storybook/stories/core/events.stories.js b/examples/official-storybook/stories/core/events.stories.js index 4da37afffc0d..7f193d263b39 100644 --- a/examples/official-storybook/stories/core/events.stories.js +++ b/examples/official-storybook/stories/core/events.stories.js @@ -13,5 +13,5 @@ export default { title: 'Core/Events', }; -export const force = () => ; -force.story = { name: 'Force re-render' }; +export const Force = () => ; +Force.story = { name: 'Force re-render' }; diff --git a/examples/official-storybook/stories/core/parameters.stories.js b/examples/official-storybook/stories/core/parameters.stories.js index 25c93dadf61b..2afcde8a13ad 100644 --- a/examples/official-storybook/stories/core/parameters.stories.js +++ b/examples/official-storybook/stories/core/parameters.stories.js @@ -19,10 +19,10 @@ export default { // I'm not sure what we should recommend regarding propTypes? are they a good idea for examples? // Given we sort of control the props, should we export a prop type? -export const passed = ({ parameters: { options, fileName, ...parameters }, ...rest }) => ( +export const Passed = ({ parameters: { options, fileName, ...parameters }, ...rest }) => (
Parameters: {JSON.stringify(parameters, null, 2)}
); -passed.story = { +Passed.story = { name: 'passed to story', parameters: { storyParameter: 'storyParameter' }, }; diff --git a/examples/official-storybook/stories/core/scroll.stories.js b/examples/official-storybook/stories/core/scroll.stories.js index 4b619f0af7c0..73b7b4bca47c 100644 --- a/examples/official-storybook/stories/core/scroll.stories.js +++ b/examples/official-storybook/stories/core/scroll.stories.js @@ -13,7 +13,7 @@ const Horizontal = styled(props => )({ }); const Vertical = styled(props => )({}); -export const story1 = () => ( +export const Story1 = () => (
START, when switching stories, you should be able to read this at the top of the page
middle
@@ -23,9 +23,9 @@ export const story1 = () => (
); -story1.story = { name: 'story with 100vh padding 1' }; +Story1.story = { name: 'story with 100vh padding 1' }; -export const story2 = () => ( +export const Story2 = () => (
START, when switching stories, you should be able to read this at the top of the page
middle
@@ -35,22 +35,22 @@ export const story2 = () => (
); -story2.story = { name: 'story with 100vh padding 2' }; +Story2.story = { name: 'story with 100vh padding 2' }; -export const story3 = () => ( +export const Story3 = () => (
START
middle
END
); -story3.story = { name: 'story with 100vw+' }; +Story3.story = { name: 'story with 100vw+' }; -export const story4 = () => ( +export const Story4 = () => (
START
middle
END
); -story4.story = { name: 'story with 100vw+ 2' }; +Story4.story = { name: 'story with 100vw+ 2' }; diff --git a/examples/official-storybook/stories/demo/button.stories.js b/examples/official-storybook/stories/demo/button.stories.js index ed9e74c27d4c..d641ccae0054 100644 --- a/examples/official-storybook/stories/demo/button.stories.js +++ b/examples/official-storybook/stories/demo/button.stories.js @@ -13,29 +13,29 @@ export default { }, }; -export const withText = () => ; -withText.story = { +export const WithText = () => ; +WithText.story = { name: 'with text', }; -export const withSomeEmoji = () => ( +export const WithSomeEmoji = () => ( ); -withSomeEmoji.story = { +WithSomeEmoji.story = { name: 'with some emoji', }; -export const withCounter = () => { +export const WithCounter = () => { const [counter, setCounter] = useState(0); const label = `Testing: ${counter}`; return ; }; -withCounter.story = { +WithCounter.story = { name: 'with counter', parameters: { docs: { diff --git a/examples/official-storybook/stories/demo/csf-embedding.test.js b/examples/official-storybook/stories/demo/csf-embedding.test.js index b5f566e3257e..ba26d54e53d3 100644 --- a/examples/official-storybook/stories/demo/csf-embedding.test.js +++ b/examples/official-storybook/stories/demo/csf-embedding.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; -import { withText as WithText, withCounter as WithCounter } from './button.stories'; +import { WithText, WithCounter } from './button.stories'; const mockAction = jest.fn(); jest.mock('@storybook/addon-actions', () => ({ diff --git a/examples/official-storybook/stories/demo/welcome.stories.js b/examples/official-storybook/stories/demo/welcome.stories.js index b0b56a55bc04..7d13665f6f22 100644 --- a/examples/official-storybook/stories/demo/welcome.stories.js +++ b/examples/official-storybook/stories/demo/welcome.stories.js @@ -7,7 +7,7 @@ export default { component: Welcome, }; -export const toStorybook = () => ; -toStorybook.story = { +export const ToStorybook = () => ; +ToStorybook.story = { name: 'to Storybook', }; diff --git a/examples/official-storybook/stories/deprecated/addon-actions.stories.js b/examples/official-storybook/stories/deprecated/addon-actions.stories.js index 0da9183e3d70..eb04f408d1de 100644 --- a/examples/official-storybook/stories/deprecated/addon-actions.stories.js +++ b/examples/official-storybook/stories/deprecated/addon-actions.stories.js @@ -18,10 +18,10 @@ export default { title: 'Addons/Actions/deprecated', }; -export const decoratedAction = () => ( +export const DecoratedAction = () => ( ); -decoratedAction.story = { +DecoratedAction.story = { name: 'Decorated Action', }; diff --git a/examples/official-storybook/stories/deprecated/addon-info.stories.js b/examples/official-storybook/stories/deprecated/addon-info.stories.js index 4180d2ed88d0..f63fadce4b12 100644 --- a/examples/official-storybook/stories/deprecated/addon-info.stories.js +++ b/examples/official-storybook/stories/deprecated/addon-info.stories.js @@ -9,8 +9,8 @@ export default { title: 'Addons/Info/deprecated', }; -export const displaysMarkdown = withInfo(markdownDescription)(() => ( +export const DisplaysMarkdown = withInfo(markdownDescription)(() => ( )); -displaysMarkdown.story = { name: 'Displays Markdown in description' }; +DisplaysMarkdown.story = { name: 'Displays Markdown in description' }; diff --git a/examples/official-storybook/stories/hooks.stories.js b/examples/official-storybook/stories/hooks.stories.js index 3f349858e254..6f705a024982 100644 --- a/examples/official-storybook/stories/hooks.stories.js +++ b/examples/official-storybook/stories/hooks.stories.js @@ -20,7 +20,7 @@ export const Input = () => { return setText(e.target.value)} />; }; -export const effect = () => { +export const Effect = () => { const ref = useRef(); useEffect(() => { if (ref.current != null) { @@ -35,7 +35,7 @@ export const effect = () => { ); }; -export const reactHookCheckbox = () => { +export const ReactHookCheckbox = () => { const [on, setOn] = React.useState(false); return (