UNPKG

wix-style-react

Version:
87 lines (71 loc) 1.98 kB
import React from 'react'; import { header, tabs, tab, description, importExample, title, divider, example, playground, api, testkit, } from 'wix-storybook-utils/Sections'; import { storySettings } from '../test/storySettings'; import * as examples from './examples'; import Timeline from '..'; const oneItem = [{ label: 'Item 1' }]; const twoItems = [...oneItem, { label: 'Item 2' }]; const threeItems = [...twoItems, { label: 'Item 3' }]; export default { category: `${storySettings.category}|${storySettings.storyName}`, storyName: 'Timeline', component: Timeline, componentPath: '..', componentProps: { items: oneItem, }, exampleProps: { items: [ { label: '1 item', value: oneItem }, { label: '2 items', value: twoItems }, { label: '3 items', value: threeItems }, ], }, sections: [ header({ sourceUrl: `https://github.com/wix-private/wix-design-systems/tree/master/packages/wix-style-react/src/${Timeline.displayName}/`, component: <Timeline items={twoItems} />, }), tabs([ tab({ title: 'Description', sections: [ description({ title: 'Description', text: 'A component to display events in a vertical timeline format', }), importExample(), divider(), title('Examples'), example({ title: 'Simple Usage', text: 'A simple example with compact preview', source: examples.simple, }), example({ title: 'Custom Content', text: "Component's label allows to insert any content to build custom layouts.", source: examples.customExample, }), ], }), ...[ { title: 'API', sections: [api()] }, { title: 'Testkit', sections: [testkit()] }, { title: 'Playground', sections: [playground()] }, ].map(tab), ]), ], };