storybook/examples/official-storybook/stories/addon-notes.stories.js
Norbert de Langen 9eb3cae404
Merge branch 'next' into tech/overhaul-ui
# Conflicts:
#	.eslintrc.js
#	addons/notes/package.json
#	addons/notes/src/index.ts
#	addons/notes/src/register.js
#	yarn.lock
2018-12-10 12:16:14 +01:00

51 lines
1.3 KiB
JavaScript

import React from 'react';
import { storiesOf } from '@storybook/react';
import BaseButton from '../components/BaseButton';
import markdownNotes from './notes/notes.md';
const baseStory = () => (
<BaseButton label="Button with notes - check the notes panel for details" />
);
const markdownString = `
# Documentation
This is inline github-flavored markdown!
## Example Usage
~~~js
storiesOf('Addons|Notes', module)
.add(
'withNotes rendering imported markdown',
withNotes(markdownNotes)(() => (
<BaseButton label="Button with notes - check the notes panel for details" />
))
)
~~~
`;
const markdownTable = `
| Column1 | Column2 | Column3 |
|---------|---------|---------|
| Row1.1 | Row1.2 | Row1.3 |
| Row2.1 | Row2.2 | Row2.3 |
| Row3.1 | Row3.2 | Row3.3 |
| Row4.1 | Row4.2 | Row4.3 |
`;
storiesOf('Addons|Notes', module)
.add('withNotes', baseStory, {
notes:
'This is the notes for a button. This is helpful for adding details about a story in a separate panel.',
})
.add('withNotes rendering imported markdown', baseStory, {
notes: { markdown: markdownNotes },
})
.add('withNotes rendering inline, github-flavored markdown', baseStory, {
notes: { markdown: markdownString },
})
.add('with a markdown table', baseStory, {
notes: { markdown: markdownTable },
});