From e0084b534748e4eefc30f9c7f68175af0a747d6f Mon Sep 17 00:00:00 2001 From: MJ Meinders Date: Fri, 8 Dec 2017 20:59:29 +0100 Subject: [PATCH 01/18] enable multiple hierarchies --- lib/ui/src/modules/api/index.js | 1 + .../ui/components/stories_panel/index.js | 30 ++++--- .../ui/components/stories_panel/index.test.js | 54 ++++++++++-- .../stories_panel/stories_tree/index.test.js | 16 ++-- .../ui/components/stories_panel/sub_header.js | 36 ++++++++ .../modules/ui/containers/stories_panel.js | 22 +++-- .../ui/containers/stories_panel.test.js | 6 +- lib/ui/src/modules/ui/libs/hierarchy.js | 39 +++++++-- lib/ui/src/modules/ui/libs/hierarchy.test.js | 85 +++++++++++++++---- 9 files changed, 230 insertions(+), 59 deletions(-) create mode 100644 lib/ui/src/modules/ui/components/stories_panel/sub_header.js diff --git a/lib/ui/src/modules/api/index.js b/lib/ui/src/modules/api/index.js index 123b7beaac83..a164a1d6f564 100755 --- a/lib/ui/src/modules/api/index.js +++ b/lib/ui/src/modules/api/index.js @@ -9,6 +9,7 @@ export default { url: 'https://github.com/storybooks/storybook', sortStoriesByKind: false, hierarchySeparator: '/', + rootSeparator: false, sidebarAnimations: true, }, }, diff --git a/lib/ui/src/modules/ui/components/stories_panel/index.js b/lib/ui/src/modules/ui/components/stories_panel/index.js index 6e1bc12615a0..71d705a3cfdc 100755 --- a/lib/ui/src/modules/ui/components/stories_panel/index.js +++ b/lib/ui/src/modules/ui/components/stories_panel/index.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import pick from 'lodash-es/pick'; import Header from './header'; +import SubHeader from './sub_header'; import Stories from './stories_tree'; import TextFilter from './text_filter'; @@ -16,7 +17,6 @@ const mainStyle = { }; const storyProps = [ - 'storiesHierarchy', 'selectedKind', 'selectedHierarchy', 'selectedStory', @@ -36,7 +36,7 @@ class StoriesPanel extends Component { name, onStoryFilter, openShortcutsHelp, - storiesHierarchy, + storiesHierarchies, storyFilter, url, } = this.props; @@ -50,9 +50,15 @@ class StoriesPanel extends Component { onChange={text => onStoryFilter(text)} />
- {hierarchyContainsStories(storiesHierarchy) ? ( - - ) : null} + {storiesHierarchies.map( + hierarchy => + hierarchyContainsStories(hierarchy) && ( +
+ {hierarchy.name && } + +
+ ) + )}
); @@ -60,7 +66,7 @@ class StoriesPanel extends Component { } StoriesPanel.defaultProps = { - storiesHierarchy: null, + storiesHierarchies: [], storyFilter: null, onStoryFilter: () => {}, openShortcutsHelp: null, @@ -69,11 +75,13 @@ StoriesPanel.defaultProps = { }; StoriesPanel.propTypes = { - storiesHierarchy: PropTypes.shape({ - namespaces: PropTypes.arrayOf(PropTypes.string), - name: PropTypes.string, - map: PropTypes.object, - }), + storiesHierarchies: PropTypes.arrayOf( + PropTypes.shape({ + namespaces: PropTypes.arrayOf(PropTypes.string), + name: PropTypes.string, + map: PropTypes.object, + }) + ), storyFilter: PropTypes.string, onStoryFilter: PropTypes.func, diff --git a/lib/ui/src/modules/ui/components/stories_panel/index.test.js b/lib/ui/src/modules/ui/components/stories_panel/index.test.js index c618b6b4ae25..664af54aa4ee 100755 --- a/lib/ui/src/modules/ui/components/stories_panel/index.test.js +++ b/lib/ui/src/modules/ui/components/stories_panel/index.test.js @@ -4,7 +4,7 @@ import StoriesPanel from './index'; import Header from './header'; import TextFilter from './text_filter'; import Stories from './stories_tree'; -import { createHierarchy } from '../../libs/hierarchy'; +import { createHierarchies } from '../../libs/hierarchy'; describe('manager.ui.components.stories_panel.index', () => { test('should render Header and TextFilter by default', () => { @@ -23,30 +23,66 @@ describe('manager.ui.components.stories_panel.index', () => { expect(wrap.find(Stories)).toBeEmpty(); }); - test('should render stories only if storiesHierarchy prop exists', () => { + test('should render stories only if storiesHierarchies prop exists', () => { const selectedKind = 'kk'; const selectedStory = 'bb'; - const storiesHierarchy = createHierarchy([{ kind: 'kk', namespaces: ['kk'], stories: ['bb'] }]); + const storiesHierarchies = createHierarchies([{ kind: 'kk', namespaces: ['kk'], stories: ['bb'] }]); const wrap = shallow( ); - const header = wrap.find(Stories).first(); - expect(header.props()).toMatchObject({ - storiesHierarchy, + expect(wrap.find(Stories)).toHaveLength(1); + + const element = wrap.find(Stories).first(); + expect(element.props()).toMatchObject({ + storiesHierarchy: storiesHierarchies[0], + selectedKind, + selectedStory, + }); + }); + + test('should render multiple stories if multiple storiesHierarchies exist', () => { + const selectedKind = 'kk'; + const selectedStory = 'bb'; + const stories = [ + { kind: 'kk', namespaces: ['kk'], stories: ['bb'], rootName: 'a' }, + { kind: 'kk', namespaces: ['kk'], stories: ['bb'], rootName: 'b' }, + ]; + const storiesHierarchies = createHierarchies(stories); + const wrap = shallow( + + ); + + expect(wrap.find(Stories)).toHaveLength(2); + + const first = wrap.find(Stories).first(); + expect(first.props()).toMatchObject({ + storiesHierarchy: storiesHierarchies[0], + selectedKind, + selectedStory, + }); + + const second = wrap.find(Stories).at(1); + expect(second.props()).toMatchObject({ + storiesHierarchy: storiesHierarchies[1], selectedKind, selectedStory, }); }); test('should not render stories if storiesHierarchy exists but is empty', () => { - const storiesHierarchy = createHierarchy([]); - const wrap = shallow(); + const storiesHierarchies = createHierarchies([]); + const wrap = shallow(); expect(wrap.find(Stories).exists()).toBe(false); }); diff --git a/lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js b/lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js index 6cca86627cfe..649f8a046557 100644 --- a/lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js +++ b/lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js @@ -2,7 +2,7 @@ import { shallow, mount } from 'enzyme'; import React from 'react'; import Stories from './index'; import { setContext } from '../../../../../compose'; -import { createHierarchy, prepareStoriesForHierarchy } from '../../../libs/hierarchy'; +import { createHierarchies, createHierarchyRoot, prepareStoriesForHierarchy } from '../../../libs/hierarchy'; import { storyFilter } from '../../../libs/filters'; const leftClick = { button: 0 }; @@ -21,10 +21,10 @@ describe('manager.ui.components.left_panel.stories', () => { afterEach(() => setContext(null)); - const data = createHierarchy([ + const data = createHierarchies([ { kind: 'a', name: 'a', namespaces: ['a'], stories: ['a1', 'a2'] }, { kind: 'b', name: 'b', namespaces: ['b'], stories: ['b1', 'b2'] }, - ]); + ])[0]; const initialData = [ { @@ -37,14 +37,14 @@ describe('manager.ui.components.left_panel.stories', () => { }, ]; - const dataWithoutSeparator = createHierarchy(prepareStoriesForHierarchy(initialData)); - const dataWithSeparator = createHierarchy(prepareStoriesForHierarchy(initialData, '\\.')); + const dataWithoutSeparator = createHierarchies(prepareStoriesForHierarchy(initialData))[0]; + const dataWithSeparator = createHierarchies(prepareStoriesForHierarchy(initialData, '\\.'))[0]; describe('render', () => { test('should render stories - empty', () => { const wrap = shallow( { selectedKind ); - const filteredDataHierarchy = createHierarchy(filteredData); + const filteredDataHierarchy = createHierarchies(filteredData); const wrap = mount( ( +
+

{name}

+
+); + +SubHeader.defaultProps = { + name: '', +}; + +SubHeader.propTypes = { + name: PropTypes.string, +}; + +export default SubHeader; diff --git a/lib/ui/src/modules/ui/containers/stories_panel.js b/lib/ui/src/modules/ui/containers/stories_panel.js index c8b95e99419e..48afa93ea9d3 100755 --- a/lib/ui/src/modules/ui/containers/stories_panel.js +++ b/lib/ui/src/modules/ui/containers/stories_panel.js @@ -6,16 +6,24 @@ import compose from '../../../compose'; import { prepareStoriesForHierarchy, resolveStoryHierarchy, - createHierarchy, + resolveStoryRoots, + createHierarchies, } from '../libs/hierarchy'; export const mapper = (state, props, { actions }) => { const actionMap = actions(); const { stories, selectedKind, selectedStory, uiOptions, storyFilter } = state; - const { name, url, sortStoriesByKind, hierarchySeparator, sidebarAnimations } = uiOptions; + const { + name, + url, + sortStoriesByKind, + hierarchySeparator, + rootSeparator, + sidebarAnimations, + } = uiOptions; - const preparedStories = prepareStoriesForHierarchy(stories, hierarchySeparator); + const preparedStories = prepareStoriesForHierarchy(stories, hierarchySeparator, rootSeparator); const filteredStories = filters.storyFilter( preparedStories, @@ -25,11 +33,13 @@ export const mapper = (state, props, { actions }) => { sortStoriesByKind ); - const storiesHierarchy = createHierarchy(filteredStories); - const selectedHierarchy = resolveStoryHierarchy(selectedKind, hierarchySeparator); + const storiesHierarchies = createHierarchies(filteredStories); + + const [, storyName] = resolveStoryRoots(selectedKind, rootSeparator); + const selectedHierarchy = resolveStoryHierarchy(storyName, hierarchySeparator); return { - storiesHierarchy, + storiesHierarchies, selectedKind, selectedStory, selectedHierarchy, diff --git a/lib/ui/src/modules/ui/containers/stories_panel.test.js b/lib/ui/src/modules/ui/containers/stories_panel.test.js index d599c25b13f9..a95ff17d36a6 100755 --- a/lib/ui/src/modules/ui/containers/stories_panel.test.js +++ b/lib/ui/src/modules/ui/containers/stories_panel.test.js @@ -35,7 +35,7 @@ describe('manager.ui.containers.stories_panel', () => { }; const result = mapper(state, props, env); - expect(result.storiesHierarchy.map).toEqual( + expect(result.storiesHierarchies[0].map).toEqual( new Map([ [ 'sk', @@ -96,7 +96,7 @@ describe('manager.ui.containers.stories_panel', () => { }; const result = mapper(state, props, env); - expect(result.storiesHierarchy.map).toEqual( + expect(result.storiesHierarchies[0].map).toEqual( new Map([ [ 'pk', // selected kind is always there. That's why this is here. @@ -163,7 +163,7 @@ describe('manager.ui.containers.stories_panel', () => { }; const result = mapper(state, props, env); - expect(result.storiesHierarchy.map).toEqual( + expect(result.storiesHierarchies[0].map).toEqual( new Map([ // selected kind is always there. That's why this is here. [ diff --git a/lib/ui/src/modules/ui/libs/hierarchy.js b/lib/ui/src/modules/ui/libs/hierarchy.js index d0cb54ca91aa..43e56e0961bc 100644 --- a/lib/ui/src/modules/ui/libs/hierarchy.js +++ b/lib/ui/src/modules/ui/libs/hierarchy.js @@ -46,24 +46,47 @@ function fillHierarchy(namespaces, hierarchy, story) { fillHierarchy(namespaces.slice(1), childHierarchy, story); } -export function createHierarchy(stories) { - const hierarchyRoot = { +export function createHierarchyRoot(name = '') { + return { isNamespace: true, namespaces: [], - name: '', + name, map: new Map(), }; +} + +export function createHierarchies(stories) { + const rootMap = {}; if (stories) { stories.forEach(story => { - const { namespaces } = story; + const { rootName = '', namespaces } = story; const name = namespaces[namespaces.length - 1]; + const hierarchyRoot = + rootMap[rootName] || (rootMap[rootName] = createHierarchyRoot(rootName)); fillHierarchy(namespaces, hierarchyRoot, { ...story, name }); }); } - return hierarchyRoot; + return Object.keys(rootMap).map(rootName => rootMap[rootName]); +} + +export function resolveStoryRoots(storyName = '', rootSeparator) { + if (!rootSeparator) { + return ['', storyName]; + } + + const segments = storyName.split(new RegExp(rootSeparator)); + + switch (segments.length) { + case 1: + return ['', storyName]; + case 2: + return segments; + default: + throw new Error(`multiple root separators found in story name: ${storyName}`); + } } export function resolveStoryHierarchy(storyName = '', hierarchySeparator) { @@ -74,16 +97,18 @@ export function resolveStoryHierarchy(storyName = '', hierarchySeparator) { return storyName.split(new RegExp(hierarchySeparator)); } -export function prepareStoriesForHierarchy(stories, hierarchySeparator) { +export function prepareStoriesForHierarchy(stories, hierarchySeparator, rootSeparator) { if (!stories) { return null; } return stories.map(story => { - const namespaces = resolveStoryHierarchy(story.kind, hierarchySeparator); + const [rootName, storyName] = resolveStoryRoots(story.kind, rootSeparator); + const namespaces = resolveStoryHierarchy(storyName, hierarchySeparator); return { ...story, + rootName, namespaces, }; }); diff --git a/lib/ui/src/modules/ui/libs/hierarchy.test.js b/lib/ui/src/modules/ui/libs/hierarchy.test.js index 83869495ea16..dd4d7b4e114f 100644 --- a/lib/ui/src/modules/ui/libs/hierarchy.test.js +++ b/lib/ui/src/modules/ui/libs/hierarchy.test.js @@ -1,9 +1,15 @@ -import { createHierarchy, resolveStoryHierarchy, prepareStoriesForHierarchy } from './hierarchy'; +import { + createHierarchyRoot, + createHierarchies, + resolveStoryHierarchy, + resolveStoryRoots, + prepareStoriesForHierarchy, +} from './hierarchy'; describe('manager.ui.libs.hierarchy', () => { - describe('createHierarchy', () => { - test('should return root hierarchy node if stories are undefined', () => { - const result = createHierarchy(); + describe('createHierarchyRoot', () => { + test('should return root hierarchy node', () => { + const result = createHierarchyRoot(); expect(result).toEqual({ namespaces: [], @@ -13,16 +19,30 @@ describe('manager.ui.libs.hierarchy', () => { }); }); - test('should return root hierarchy node if stories are empty', () => { - const result = createHierarchy([]); + test('should return root hierarchy node with root name', () => { + const result = createHierarchyRoot('root name'); expect(result).toEqual({ namespaces: [], - name: '', + name: 'root name', isNamespace: true, map: new Map(), }); }); + }); + + describe('createHierarchies', () => { + test('should return empty array if stories are undefined', () => { + const result = createHierarchies(); + + expect(result).toHaveLength(0); + }); + + test('should return empty array if stories are empty', () => { + const result = createHierarchies([]); + + expect(result).toHaveLength(0); + }); test('should return flat hierarchy if kind is not separated', () => { const stories = [ @@ -38,7 +58,7 @@ describe('manager.ui.libs.hierarchy', () => { }, ]; - const result = createHierarchy(stories); + const result = createHierarchies(stories); const expected = [ [ @@ -67,7 +87,8 @@ describe('manager.ui.libs.hierarchy', () => { ], ]; - expect(result.map).toEqual(new Map(expected)); + expect(result).toHaveLength(1); + expect(result[0].map).toEqual(new Map(expected)); }); test('should return hierarchy if kind is separated', () => { @@ -84,7 +105,7 @@ describe('manager.ui.libs.hierarchy', () => { }, ]; - const result = createHierarchy(stories, '\\.'); + const result = createHierarchies(stories, '\\.'); const expected = new Map([ [ @@ -157,7 +178,8 @@ describe('manager.ui.libs.hierarchy', () => { ], ]); - expect(result.map).toEqual(expected); + expect(result).toHaveLength(1); + expect(result[0].map).toEqual(expected); }); }); @@ -175,6 +197,28 @@ describe('manager.ui.libs.hierarchy', () => { }); }); + describe('resolveStoryRoots', () => { + test('should return empty root name when rootSeparator is undefined', () => { + const [rootName, storyName] = resolveStoryRoots('some|name.item1'); + + expect(rootName).toEqual(''); + expect(storyName).toEqual('some|name.item1'); + }); + + test('should return array with separated root name and story name when rootSeparator is defined', () => { + const [rootName, storyName] = resolveStoryRoots('some|name.item1', '\\|'); + + expect(rootName).toEqual('some'); + expect(storyName).toEqual('name.item1'); + }); + + test('should throw error when rootSeparator is found multiple times', () => { + expect(() => { + resolveStoryRoots('some|name|item1', '\\|'); + }).toThrow(); + }); + }); + describe('prepareStoriesForHierarchy', () => { test('should return null when nothing provided', () => { const result = prepareStoriesForHierarchy(); @@ -188,8 +232,8 @@ describe('manager.ui.libs.hierarchy', () => { const result = prepareStoriesForHierarchy(stories); expect(result).toEqual([ - { kind: 'some.name.item1', namespaces: ['some.name.item1'] }, - { kind: 'another.space.20', namespaces: ['another.space.20'] }, + { kind: 'some.name.item1', namespaces: ['some.name.item1'], 'rootName': '' }, + { kind: 'another.space.20', namespaces: ['another.space.20'], 'rootName': '' }, ]); }); @@ -199,8 +243,19 @@ describe('manager.ui.libs.hierarchy', () => { const result = prepareStoriesForHierarchy(stories, '\\.'); expect(result).toEqual([ - { kind: 'some.name.item1', namespaces: ['some', 'name', 'item1'] }, - { kind: 'another.space.20', namespaces: ['another', 'space', '20'] }, + { kind: 'some.name.item1', namespaces: ['some', 'name', 'item1'], 'rootName': '' }, + { kind: 'another.space.20', namespaces: ['another', 'space', '20'], 'rootName': '' }, + ]); + }); + + test('should return filled root name when root separator is provided', () => { + const stories = [{ kind: 'some|name.item1' }, { kind: 'another.space.20' }]; + + const result = prepareStoriesForHierarchy(stories, '\\.', '\\|'); + + expect(result).toEqual([ + { kind: 'some|name.item1', namespaces: ['name', 'item1'], rootName: 'some' }, + { kind: 'another.space.20', namespaces: ['another', 'space', '20'], rootName: '' }, ]); }); }); From dbaf4e56908f8d208db849150978fd6ddfcc51c9 Mon Sep 17 00:00:00 2001 From: MJ Meinders Date: Fri, 8 Dec 2017 21:00:51 +0100 Subject: [PATCH 02/18] extend kitchen sink example with multiple hierarchies --- .../cra-kitchen-sink/.storybook/config.js | 3 ++- .../src/stories/addon-actions.stories.js | 20 +++++++++++++++++++ .../stories/addon-a11y.stories.js | 2 +- .../stories/addon-actions.stories.js | 2 +- .../stories/addon-backgrounds.stories.js | 2 +- .../stories/addon-info.stories.js | 20 +++++++++---------- .../stories/addon-jest.stories.js | 2 +- .../stories/addon-knobs.stories.js | 4 ++-- .../stories/addon-notes.stories.js | 2 +- 9 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 examples/cra-kitchen-sink/src/stories/addon-actions.stories.js diff --git a/examples/cra-kitchen-sink/.storybook/config.js b/examples/cra-kitchen-sink/.storybook/config.js index 631e70c75c1f..03436ba44ed9 100644 --- a/examples/cra-kitchen-sink/.storybook/config.js +++ b/examples/cra-kitchen-sink/.storybook/config.js @@ -13,7 +13,8 @@ setOptions({ showSearchBox: false, addonPanelInRight: true, sortStoriesByKind: false, - hierarchySeparator: /\/|\./, + hierarchySeparator: /\./, + rootSeparator: /\|/, }); // deprecated usage of infoAddon diff --git a/examples/cra-kitchen-sink/src/stories/addon-actions.stories.js b/examples/cra-kitchen-sink/src/stories/addon-actions.stories.js new file mode 100644 index 000000000000..2da2917090f6 --- /dev/null +++ b/examples/cra-kitchen-sink/src/stories/addon-actions.stories.js @@ -0,0 +1,20 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { action, decorateAction } from '@storybook/addon-actions'; +import { Button } from '@storybook/react/demo'; + +const pickFirst = decorateAction([args => args.slice(0, 1)]); + +storiesOf('Addons|Addon Actions', module) + .add('Hello World', () => ) + .add('Decorated Action', () => ) + .add('Circular Payload', () => { + const circular = { foo: {} }; + circular.foo.circular = circular; + return ; + }) + .add('Function Name', () => { + const fn = action('fnName'); + return ; + }) + .add('Reserved keyword as name', () => ); diff --git a/examples/official-storybook/stories/addon-a11y.stories.js b/examples/official-storybook/stories/addon-a11y.stories.js index d1892ec7a7bb..ca0509706d89 100644 --- a/examples/official-storybook/stories/addon-a11y.stories.js +++ b/examples/official-storybook/stories/addon-a11y.stories.js @@ -6,7 +6,7 @@ import BaseButton from '../components/BaseButton'; const text = 'Testing the a11y addon'; -storiesOf('Addon a11y', module) +storiesOf('Addons|Addon a11y', module) .addDecorator(checkA11y) .add('Default', () => ) .add('Label', () => ) diff --git a/examples/official-storybook/stories/addon-actions.stories.js b/examples/official-storybook/stories/addon-actions.stories.js index ba9355f9f928..b353ddaf3014 100644 --- a/examples/official-storybook/stories/addon-actions.stories.js +++ b/examples/official-storybook/stories/addon-actions.stories.js @@ -8,7 +8,7 @@ import { File } from 'global'; const pickFirst = decorateAction([args => args.slice(0, 1)]); -storiesOf('Addon Actions', module) +storiesOf('Addons|Actions', module) .add('Hello World', () => ) .add('Decorated Action', () => ) .add('Circular Payload', () => { diff --git a/examples/official-storybook/stories/addon-backgrounds.stories.js b/examples/official-storybook/stories/addon-backgrounds.stories.js index 9a0627118bb9..442e8acb40d2 100644 --- a/examples/official-storybook/stories/addon-backgrounds.stories.js +++ b/examples/official-storybook/stories/addon-backgrounds.stories.js @@ -4,7 +4,7 @@ import { storiesOf } from '@storybook/react'; import backgrounds from '@storybook/addon-backgrounds'; import BaseButton from '../components/BaseButton'; -storiesOf('Addon Backgrounds', module) +storiesOf('Addons|Addon Backgrounds', module) .addDecorator( backgrounds([ { name: 'twitter', value: '#00aced' }, diff --git a/examples/official-storybook/stories/addon-info.stories.js b/examples/official-storybook/stories/addon-info.stories.js index d6fad18d2c58..131f3a5fe16d 100644 --- a/examples/official-storybook/stories/addon-info.stories.js +++ b/examples/official-storybook/stories/addon-info.stories.js @@ -8,7 +8,7 @@ import FlowTypeButton from '../components/FlowTypeButton'; import BaseButton from '../components/BaseButton'; import TableComponent from '../components/TableComponent'; -storiesOf('Addon Info.React Docgen', module) +storiesOf('Addons|Addon Info.React Docgen', module) .add( 'Comments from PropType declarations', withInfo( @@ -39,12 +39,12 @@ const Button = () => ) .add('Decorated Action', () => ) .add('Circular Payload', () => { diff --git a/examples/official-storybook/stories/addon-a11y.stories.js b/examples/official-storybook/stories/addon-a11y.stories.js index ca0509706d89..18ea68caad68 100644 --- a/examples/official-storybook/stories/addon-a11y.stories.js +++ b/examples/official-storybook/stories/addon-a11y.stories.js @@ -6,7 +6,7 @@ import BaseButton from '../components/BaseButton'; const text = 'Testing the a11y addon'; -storiesOf('Addons|Addon a11y', module) +storiesOf('Addons|a11y', module) .addDecorator(checkA11y) .add('Default', () => ) .add('Label', () => ) diff --git a/examples/official-storybook/stories/addon-backgrounds.stories.js b/examples/official-storybook/stories/addon-backgrounds.stories.js index 442e8acb40d2..f1458f4d81dd 100644 --- a/examples/official-storybook/stories/addon-backgrounds.stories.js +++ b/examples/official-storybook/stories/addon-backgrounds.stories.js @@ -4,7 +4,7 @@ import { storiesOf } from '@storybook/react'; import backgrounds from '@storybook/addon-backgrounds'; import BaseButton from '../components/BaseButton'; -storiesOf('Addons|Addon Backgrounds', module) +storiesOf('Addons|Backgrounds', module) .addDecorator( backgrounds([ { name: 'twitter', value: '#00aced' }, diff --git a/examples/official-storybook/stories/addon-info.stories.js b/examples/official-storybook/stories/addon-info.stories.js index 131f3a5fe16d..c85aa9078169 100644 --- a/examples/official-storybook/stories/addon-info.stories.js +++ b/examples/official-storybook/stories/addon-info.stories.js @@ -8,7 +8,7 @@ import FlowTypeButton from '../components/FlowTypeButton'; import BaseButton from '../components/BaseButton'; import TableComponent from '../components/TableComponent'; -storiesOf('Addons|Addon Info.React Docgen', module) +storiesOf('Addons|Info.React Docgen', module) .add( 'Comments from PropType declarations', withInfo( @@ -39,12 +39,12 @@ const Button = () => )) @@ -16,7 +16,7 @@ storiesOf('Addon Links.Button', module) )); -storiesOf('Addon Links.Select', module) +storiesOf('Addons|Links.Select', module) .add('Index', () => (