├── .prettierrc ├── packages ├── storybook-readme │ ├── src │ │ ├── with-docs.js │ │ ├── backwardCompatibility │ │ │ ├── with-docs.js │ │ │ ├── with-readme.js │ │ │ └── env │ │ │ │ ├── common │ │ │ │ └── index.js │ │ │ │ └── react │ │ │ │ └── index.js │ │ ├── with-readme.js │ │ ├── services │ │ │ ├── marked.js │ │ │ ├── transformEmojis.js │ │ │ ├── config.js │ │ │ ├── getParameters.js │ │ │ ├── highlite.js │ │ │ └── getPropsTables │ │ │ │ └── excludePropTable.js │ │ ├── vue │ │ │ ├── components │ │ │ │ └── Preview │ │ │ │ │ ├── DocPreview.js │ │ │ │ │ ├── FooterPreview.js │ │ │ │ │ ├── HeaderPreview.js │ │ │ │ │ ├── index.js │ │ │ │ │ └── StoryPreview.js │ │ │ ├── docs-loader.js │ │ │ └── updateWebpackConfig.js │ │ ├── components │ │ │ ├── Preview │ │ │ │ ├── DocPreview.js │ │ │ │ ├── FooterPreview.js │ │ │ │ ├── HeaderPreview.js │ │ │ │ ├── index.js │ │ │ │ └── StoryPreview.js │ │ │ └── Marked │ │ │ │ └── index.js │ │ ├── register.js │ │ ├── styles │ │ │ ├── codeThemes │ │ │ │ ├── darkula.css.js │ │ │ │ ├── ascetic.css.js │ │ │ │ ├── mono-blue.css.js │ │ │ │ ├── dark.css.js │ │ │ │ ├── androidstudio.css.js │ │ │ │ ├── codepen-embed.css.js │ │ │ │ ├── vs.css.js │ │ │ │ ├── far.css.js │ │ │ │ ├── arta.css.js │ │ │ │ ├── ir-black.css.js │ │ │ │ ├── color-brewer.css.js │ │ │ │ ├── magula.css.js │ │ │ │ ├── github-gist.css.js │ │ │ │ ├── monokai.css.js │ │ │ │ ├── darcula.css.js │ │ │ │ ├── gml.css.js │ │ │ │ ├── tomorrow.css.js │ │ │ │ ├── zenburn.css.js │ │ │ │ ├── ocean.css.js │ │ │ │ ├── paraiso-dark.css.js │ │ │ │ ├── paraiso-light.css.js │ │ │ │ ├── dracula.css.js │ │ │ │ ├── qtcreator_dark.css.js │ │ │ │ ├── qtcreator_light.css.js │ │ │ │ ├── rainbow.css.js │ │ │ │ ├── kimbie.dark.css.js │ │ │ │ ├── kimbie.light.css.js │ │ │ │ ├── atelier-dune-dark.css.js │ │ │ │ ├── monokai-sublime.css.js │ │ │ │ ├── atelier-dune-light.css.js │ │ │ │ ├── atelier-heath-dark.css.js │ │ │ │ ├── atelier-heath-light.css.js │ │ │ │ ├── atelier-forest-dark.css.js │ │ │ │ ├── atelier-forest-light.css.js │ │ │ │ ├── tomorrow-night-bright.css.js │ │ │ │ ├── tomorrow-night-eighties.css.js │ │ │ │ ├── atelier-seaside-dark.css.js │ │ │ │ ├── atelier-seaside-light.css.js │ │ │ │ ├── hopscotch.css.js │ │ │ │ ├── lightfair.css.js │ │ │ │ ├── atelier-lakeside-dark.css.js │ │ │ │ ├── atelier-lakeside-light.css.js │ │ │ │ ├── atelier-sulphurpool-dark.css.js │ │ │ │ ├── atelier-sulphurpool-light.css.js │ │ │ │ ├── tomorrow-night.css.js │ │ │ │ ├── tomorrow-night-blue.css.js │ │ │ │ ├── solarized-dark.css.js │ │ │ │ ├── solarized-light.css.js │ │ │ │ ├── arduino-light.css.js │ │ │ │ ├── googlecode.css.js │ │ │ │ ├── xt256.css.js │ │ │ │ ├── obsidian.css.js │ │ │ │ ├── foundation.css.js │ │ │ │ ├── atelier-cave-dark.css.js │ │ │ │ ├── an-old-hope.css.js │ │ │ │ ├── docco.css.js │ │ │ │ ├── atelier-cave-light.css.js │ │ │ │ ├── atelier-estuary-dark.css.js │ │ │ │ ├── atelier-plateau-dark.css.js │ │ │ │ ├── atelier-savanna-dark.css.js │ │ │ │ ├── atelier-estuary-light.css.js │ │ │ │ ├── atelier-plateau-light.css.js │ │ │ │ ├── atelier-savanna-light.css.js │ │ │ │ ├── github.css.js │ │ │ │ ├── idea.css.js │ │ │ │ ├── default.css.js │ │ │ │ ├── sunburst.css.js │ │ │ │ ├── xcode.css.js │ │ │ │ ├── atom-one-dark.css.js │ │ │ │ ├── atom-one-light.css.js │ │ │ │ ├── railscasts.css.js │ │ │ │ ├── routeros.css.js │ │ │ │ ├── agate.css.js │ │ │ │ ├── hybrid.css.js │ │ │ │ ├── shades-of-purple.css.js │ │ │ │ ├── atom-one-dark-reasonable.css.js │ │ │ │ ├── a11y-dark.css.js │ │ │ │ ├── a11y-light.css.js │ │ │ │ ├── isbl-editor-dark.css.js │ │ │ │ └── isbl-editor-light.css.js │ │ │ └── styleFactory.js │ │ ├── const.js │ │ ├── registerWithPanelTitle.js │ │ └── html │ │ │ └── index.js │ ├── scripts │ │ ├── _themeTemplate │ │ ├── buildHighlightThemes.js │ │ └── buildPrismHighlightThemes.js │ ├── .babelrc │ ├── LICENSE │ └── package.json ├── example-html │ ├── .storybook │ │ ├── addons.js │ │ └── config.js │ ├── package.json │ └── stories │ │ └── index.js ├── example-react │ ├── stories │ │ ├── storyshots.test.js │ │ ├── withPropsTable │ │ │ ├── index.js │ │ │ ├── basic.js │ │ │ ├── excludeGlobally.js │ │ │ └── renderPropPattern.js │ │ ├── withCustomTheme.js │ │ ├── Button.js │ │ ├── LocalCodeTheme.md │ │ ├── withCustomCodeTheme.js │ │ ├── withEmoji.js │ │ ├── GlobalCodeTheme.md │ │ ├── withOldApi.js │ │ ├── index.js │ │ ├── withContentDocs.js │ │ ├── withSidebarDocs.js │ │ └── withCustomPreview.js │ ├── .storybook │ │ ├── addons.js │ │ └── config.js │ ├── jest.config.js │ ├── babel.config.js │ ├── components │ │ ├── Button │ │ │ ├── USAGE.md │ │ │ ├── README.md │ │ │ └── index.js │ │ └── PropTables │ │ │ ├── withHOC.js │ │ │ ├── SmallComponentOne.js │ │ │ ├── SmallComponentTwo.js │ │ │ ├── SmallComponentThree.js │ │ │ └── WrapperComponent.js │ ├── package-storybook-v3.json │ └── package.json └── example-vue │ ├── stories │ ├── storyshots.test.js │ ├── withVueDocs.js │ ├── withCustomTheme.js │ ├── withCustomCodeTheme.js │ ├── withEmoji.js │ ├── Button.js │ ├── index.js │ ├── withOldApi.js │ ├── withCustomPreview.js │ └── withContentDocs.js │ ├── .storybook │ ├── addons.js │ ├── webpack.config.js │ └── config.js │ ├── jest.config.js │ ├── babel.config.js │ ├── components │ └── MyButton │ │ ├── USAGE.md │ │ ├── DOCS.md │ │ ├── README.md │ │ └── MyButton.vue │ └── package.json ├── lerna.json ├── .github └── FUNDING.yml ├── .gitignore ├── .vscode └── settings.json ├── LICENSE └── package.json /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/with-docs.js: -------------------------------------------------------------------------------- 1 | export { default } from './backwardCompatibility/with-docs'; 2 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/backwardCompatibility/with-docs.js: -------------------------------------------------------------------------------- 1 | export { withDocs as default } from './'; 2 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/with-readme.js: -------------------------------------------------------------------------------- 1 | export { default } from './backwardCompatibility/with-readme'; 2 | -------------------------------------------------------------------------------- /packages/example-html/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addons'; 2 | import 'storybook-readme/register'; 3 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/backwardCompatibility/with-readme.js: -------------------------------------------------------------------------------- 1 | export { withReadme as default } from './'; 2 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/services/marked.js: -------------------------------------------------------------------------------- 1 | import marked from 'marked'; 2 | 3 | export default md => marked(md); 4 | -------------------------------------------------------------------------------- /packages/example-react/stories/storyshots.test.js: -------------------------------------------------------------------------------- 1 | import initStoryshots from '@storybook/addon-storyshots'; 2 | initStoryshots(); 3 | -------------------------------------------------------------------------------- /packages/example-vue/stories/storyshots.test.js: -------------------------------------------------------------------------------- 1 | import initStoryshots from '@storybook/addon-storyshots'; 2 | initStoryshots(); 3 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/components/Preview/DocPreview.js: -------------------------------------------------------------------------------- 1 | export default { 2 | template: `
`, 3 | }; 4 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/components/Preview/FooterPreview.js: -------------------------------------------------------------------------------- 1 | export default { 2 | template: `
`, 3 | }; 4 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/components/Preview/HeaderPreview.js: -------------------------------------------------------------------------------- 1 | export default { 2 | template: `
`, 3 | }; 4 | -------------------------------------------------------------------------------- /packages/storybook-readme/scripts/_themeTemplate: -------------------------------------------------------------------------------- 1 | import stringRaw from 'string-raw'; 2 | 3 | export default stringRaw` 4 | 5 | %css% 6 | 7 | `; 8 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/components/Preview/DocPreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default props =>
{props.children}
; 4 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/components/Preview/FooterPreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default props =>
{props.children}
; 4 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/components/Preview/HeaderPreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default props =>
{props.children}
; 4 | -------------------------------------------------------------------------------- /packages/example-react/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addons'; 2 | import '@storybook/addon-knobs/register'; 3 | import 'storybook-readme/register'; 4 | -------------------------------------------------------------------------------- /packages/example-vue/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addons'; 2 | import '@storybook/addon-knobs/register'; 3 | import 'storybook-readme/register'; 4 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmClient": "yarn", 3 | "useWorkspaces": true, 4 | "packages": ["packages/*"], 5 | "independent": true, 6 | "version": "independent" 7 | } 8 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/register.js: -------------------------------------------------------------------------------- 1 | import registerWithPanelTitle from './registerWithPanelTitle'; 2 | 3 | const title = 'Readme'; 4 | registerWithPanelTitle(title); 5 | -------------------------------------------------------------------------------- /packages/storybook-readme/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["react-app", { "absoluteRuntime": false, "useESModules": false }]], 3 | "plugins": ["@babel/plugin-transform-modules-commonjs"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/example-react/stories/withPropsTable/index.js: -------------------------------------------------------------------------------- 1 | import './basic'; 2 | import './multipleComponents'; 3 | import './hocPattern'; 4 | import './renderPropPattern'; 5 | import './excludeGlobally'; 6 | import './includeLocally'; 7 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/docs-loader.js: -------------------------------------------------------------------------------- 1 | module.exports = function(source, map) { 2 | this.callback( 3 | null, 4 | 'module.exports = function(Component) {Component.options.__docs = ' + 5 | source + 6 | '}', 7 | map 8 | ); 9 | }; 10 | -------------------------------------------------------------------------------- /packages/example-react/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testURL: 'http://localhost', 3 | transform: { 4 | '^.+\\.md?$': 'markdown-loader-jest', 5 | '^.+\\.js?$': 'babel-jest', 6 | }, 7 | transformIgnorePatterns: ['/node_modules/(?!(@babel/runtime)/).*/'], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/example-vue/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testURL: 'http://localhost', 3 | transform: { 4 | '^.+\\.md?$': 'markdown-loader-jest', 5 | '^.+\\.js?$': 'babel-jest', 6 | }, 7 | transformIgnorePatterns: ['/node_modules/(?!(@babel/runtime)/).*/'], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/components/Preview/index.js: -------------------------------------------------------------------------------- 1 | export { default as StoryPreview } from './StoryPreview'; 2 | export { default as FooterPreview } from './FooterPreview'; 3 | export { default as HeaderPreview } from './HeaderPreview'; 4 | export { default as DocPreview } from './DocPreview'; 5 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/components/Preview/index.js: -------------------------------------------------------------------------------- 1 | export { default as StoryPreview } from './StoryPreview'; 2 | export { default as FooterPreview } from './FooterPreview'; 3 | export { default as HeaderPreview } from './HeaderPreview'; 4 | export { default as DocPreview } from './DocPreview'; 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [sdoomz, tuchk4] 4 | patreon: # 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: tuchk4 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | custom: # Replace with a single custom sponsorship URL 9 | -------------------------------------------------------------------------------- /packages/example-vue/babel.config.js: -------------------------------------------------------------------------------- 1 | // babel.config.js 2 | module.exports = { 3 | presets: [ 4 | [ 5 | '@babel/preset-env', 6 | { 7 | modules: 'commonjs', 8 | targets: { 9 | node: 'current', 10 | }, 11 | }, 12 | ], 13 | ], 14 | plugins: ['@babel/plugin-syntax-dynamic-import'], 15 | }; 16 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/styles/codeThemes/darkula.css.js: -------------------------------------------------------------------------------- 1 | import stringRaw from 'string-raw'; 2 | 3 | export default stringRaw` 4 | 5 | 6 | 7 | /* 8 | Deprecated due to a typo in the name and left here for compatibility purpose only. 9 | Please use darcula.css instead. 10 | */ 11 | 12 | @import url('darcula.css'); 13 | 14 | 15 | 16 | 17 | `; 18 | -------------------------------------------------------------------------------- /packages/example-react/babel.config.js: -------------------------------------------------------------------------------- 1 | // babel.config.js 2 | module.exports = { 3 | presets: [ 4 | [ 5 | '@babel/preset-env', 6 | { 7 | modules: 'commonjs', 8 | targets: { 9 | node: 'current', 10 | }, 11 | }, 12 | ], 13 | '@babel/react', 14 | ], 15 | plugins: ['@babel/plugin-syntax-dynamic-import'], 16 | }; 17 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/components/Preview/StoryPreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default props => ( 4 |
14 |
{props.children}
15 |
16 | ); 17 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/components/Preview/StoryPreview.js: -------------------------------------------------------------------------------- 1 | export default { 2 | data() { 3 | return { 4 | styles: { 5 | // display: 'flex', 6 | // alignItems: 'center', 7 | // justifyContent: 'center', 8 | // margin: '32px 0', 9 | }, 10 | }; 11 | }, 12 | template: `
`, 13 | }; 14 | -------------------------------------------------------------------------------- /packages/example-html/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-html", 3 | "private": true, 4 | "version": "5.0.9", 5 | "main": "index.js", 6 | "license": "MIT", 7 | "scripts": { 8 | "storybook": "start-storybook" 9 | }, 10 | "dependencies": { 11 | "@babel/core": "^7.4.4", 12 | "@storybook/html": "^5.0.11", 13 | "babel-loader": "^8.0.5", 14 | "storybook-readme": "^5.0.9" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/example-vue/components/MyButton/USAGE.md: -------------------------------------------------------------------------------- 1 | ### :smile: Usage 2 | 3 | Buttons allow users to take actions, and make choices, with a single tap. Supports all default HTML Button properties. See Material Design Button for UI/UX information. 4 | 5 | Button variants could be imported separately. 6 | 7 | ```js 8 | import { OutlinedButton, ContainedButton, TextButton } from 'Button'; 9 | ``` 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/example-react/components/Button/USAGE.md: -------------------------------------------------------------------------------- 1 | ### :smile: Usage 2 | 3 | Buttons allow users to take actions, and make choices, with a single tap. Supports all default HTML Button properties. See Material Design Button for UI/UX information. 4 | 5 | Button variants could be imported separately. 6 | 7 | ```js 8 | import { 9 | SuccessButton, 10 | AlertButton, 11 | WarningButton, 12 | AccentButton, 13 | } from 'Button'; 14 | ``` 15 | 16 | 17 | -------------------------------------------------------------------------------- /packages/storybook-readme/src/vue/updateWebpackConfig.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const docsLoader = path.resolve(__dirname, 'docs-loader'); 4 | 5 | module.exports = function(config, configType) { 6 | // if (configType === 'PRODUCTION') { 7 | // 8 | // } 9 | 10 | config.module.rules.push({ 11 | resourceQuery: /blockType=docs/, 12 | loaders: [ 13 | // 'storybook-readme/vue/docs-loader', 14 | docsLoader, 15 | 'html-loader', 16 | 'markdown-loader', 17 | ], 18 | }); 19 | 20 | return config; 21 | }; 22 | -------------------------------------------------------------------------------- /packages/example-html/stories/index.js: -------------------------------------------------------------------------------- 1 | import { storiesOf } from '@storybook/html'; 2 | 3 | storiesOf('Button', module) 4 | .addParameters({ 5 | readme: { 6 | sidebar: ` 7 | ## Hello World :rocket: 8 | 9 | - 1 10 | - 2 11 | - 3 12 | 13 | \`\`\`html 14 | 15 | \`\`\` 16 | `, 17 | }, 18 | }) 19 | .add('with text', () => '') 20 | .add('with emoji', () => { 21 | const button = document.createElement('button'); 22 | button.innerText = '😀 😎 👍 💯'; 23 | return button; 24 | }); 25 | -------------------------------------------------------------------------------- /packages/example-react/stories/withCustomTheme.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { storiesOf } from '@storybook/react'; 3 | 4 | import Button from '../components/Button'; 5 | 6 | import ButtonReadme from '../components/Button/README.md'; 7 | import ButtonUsage from '../components/Button/USAGE.md'; 8 | 9 | storiesOf('Custom Theme', module) 10 | .addParameters({ 11 | readme: { 12 | content: ButtonReadme, 13 | theme: { 14 | textColor: 'blue', 15 | }, 16 | }, 17 | }) 18 | .add('Button', () => 19 | 20 | ); 21 | } 22 | ``` 23 | 24 | #### Button types 25 | 26 | Means `OutlinedButton`, `ContainedButton`, `TextButton`. It is possible to import as standalone component or pass `variant` property. Defautl value is `contained`. 27 | 28 | ```js 29 | 31 | 32 | ); 33 | } 34 | ``` 35 | 36 | #### Button types 37 | 38 | Means `OutlinedButton`, `ContainedButton`, `TextButton`. It is possible to import as standalone component or pass `variant` property. Defautl value is `contained`. 39 | 40 | ```js 41 |