├── .DS_Store ├── .babelrc ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── .vscode └── settings.json ├── README.md ├── example ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── index.html │ └── manifest.json ├── src │ ├── App.js │ ├── SimpleButton.js │ ├── index.css │ └── index.js └── yarn.lock ├── package.json ├── rollup.config.js ├── src ├── components │ ├── ComponentStory.js │ ├── Knob.js │ └── theme.js └── index.js └── yarn.lock /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveruizok/short-story/f711d579d2e1813f4ad97d81ef80f64dec96ddab/.DS_Store -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "modules": false, 7 | "displayName": true 8 | } 9 | ], 10 | "stage-0", 11 | "react" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/ignore-files/ for more about ignoring files. 3 | 4 | .DS_Store 5 | 6 | # dependencies 7 | node_modules 8 | 9 | # builds 10 | build 11 | dist 12 | 13 | # misc 14 | .DS_Store 15 | .env 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | .DS_Store 25 | .DS_Store 26 | .DS_Store 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 9 4 | - 8 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # short-story 2 | 3 | Beautiful component previews for design, docs and demos. 4 | 5 | ⚠️ Work in progress! The knobs API may change in future updates. 6 | 7 | 👉 [CodeSandbox Demo](https://codesandbox.io/s/3rwj7kqm15). 8 | 9 | ## Install 10 | 11 | ```bash 12 | npm install --save short-story 13 | ``` 14 | 15 | ## Usage 16 | 17 | ShortStory is a render props component. It accepts a prop `knobs`, an object describing different knobs, creates an interface for setting the values of those knobs, and passes those values into its child function. 18 | 19 | See [example](https://codesandbox.io/s/3rwj7kqm15) for a collection of different knob types. 20 | 21 | ```jsx 22 | import React from "react" 23 | import ReactDOM from "react-dom"; 24 | import ShortStory from "short-story" 25 | 26 | import MyComponent from "./MyComponent" 27 | 28 | const knobs = { 29 | text: { 30 | label: "Text Content", 31 | type: "text", 32 | default: "Click here!" 33 | }, 34 | 35 | function App() { 36 | return ( 37 |