[
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"airbnb\",\n  \"rules\": {\n    \"import/no-extraneous-dependencies\": \"off\",\n    \"react/forbid-prop-types\": \"warn\",\n    \"react/jsx-filename-extension\": \"off\",\n    \"react/no-multi-comp\": \"warn\"\n  }\n}"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nlib\ndist\nstorybook-static\nyarn-error.log\nnpm-debug.log"
  },
  {
    "path": ".npmignore",
    "content": ""
  },
  {
    "path": ".storybook/addons.js",
    "content": "import '@storybook/addon-knobs/register';\nimport '@storybook/addon-options/register';\n"
  },
  {
    "path": ".storybook/config.js",
    "content": "import { configure } from '@storybook/react';\n\n// automatically import all files ending in *.stories.js\nconst req = require.context('../stories', true, /.stories.js$/);\nfunction loadStories() {\n  req.keys().forEach((filename) => req(filename));\n}\n\nconfigure(loadStories, module);\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"6\""
  },
  {
    "path": "README.md",
    "content": "React Reveal Text\n---------------\n[![npm](https://img.shields.io/npm/v/react-reveal-text.svg)](https://www.npmjs.com/package/react-reveal-text)\n[![dependencies](https://img.shields.io/david/adrianmcli/react-reveal-text.svg)](https://github.com/adrianmcli/react-reveal-text/blob/master/package.json)\n[![travis](https://img.shields.io/travis/adrianmcli/react-reveal-text.svg)](https://travis-ci.org/adrianmcli/react-reveal-text)\n[![bithound](https://img.shields.io/bithound/code/github/adrianmcli/react-reveal-text.svg)](https://www.bithound.io/github/adrianmcli/react-reveal-text)\n![license](https://img.shields.io/npm/l/react-reveal-text.svg)\n\nA small react library for animating the revealing of text.\n\n![gif animation](https://cloud.githubusercontent.com/assets/943555/21519497/988cbd5c-ccbb-11e6-9fa0-1911f133de61.gif)\n\n### Demo/Tutorial available here: <a href=\"#\">https://adrianmcli.github.io/react-reveal-text/</a>\n\nThe demo page was built with [React Storybook](https://github.com/storybooks/react-storybook).\n\nFeatures 🎉\n---------------\n\n* **Simple** – Just plain ol' CSS transition animations.\n* **Zero dependencies** – Keeping it light and lit up!\n* **Flexible** – Choose your own easing function and timing.\n* **Customizable** – Customize and theme like a regular div.\n* **Dynamic** – Intelligent generation of random transition delay numbers.\n\nGetting Started\n---------------\n\n1. Install:\n\n  ```\n  npm install --save react-reveal-text\n  ```\n\n2. Use:\n\n  ```jsx\n  <ReactRevealText>WELCOME!</ReactRevealText>\n  ```\n\nAPI\n---------------\n\n### Interactive docs with live-editable props [here](https://adrianmcli.github.io/react-reveal-text/?knob-text=AMAZING%20TEXT&knob-show=true&knob-className=my-class-name&knob-style=%7B%22color%22%3A%22tomato%22%2C%22fontSize%22%3A%2224px%22%2C%22lineHeight%22%3A%2236px%22%2C%22textAlign%22%3A%22center%22%2C%22fontFamily%22%3A%22sans-serif%22%2C%22letterSpacing%22%3A%221.2em%22%2C%22paddingLeft%22%3A%221.2em%22%7D&selectedKind=Documentation&selectedStory=Basic%20Properties&full=0&down=1&left=1&panelRight=1&downPanel=kadirahq%2Fstorybook-addon-knobs).\n\nThis component has many props that you can manipulate; below is a list of all of them.\n\nNote that the component only re-renders when the `show` property has been changed.\n\n## Basic Properties\n\n- **text** *(string)*  \n  You can set the text either by passing in text as children or by using the text property.\n\n- **show** *(boolean)*  \n  This prop allows you to control what state the component is in. It allows you to hide or reveal the text.\n\n- **className** *(string)*  \n  This prop allows you to set the className for the div surrounding the text.\n\n- **style** *(object)*  \n  This prop allows you to pass in styles for the div surrounding the text.\n\n## Transition Properties\n\nEach letter has its own randomly generated delay before its transition begins.\n\n- **transitionTime** *(integer)* [default: 1300]  \n  The time it takes for each letter's transition.\n\n- **timingFunction** *(string)* [default: 'linear']  \n  The CSS transition-timing-function property. On this page, you are given a dropdown selection, but in practice (and in the sandbox), you can enter in any valid string.\n\n- **delayMin** *(integer)* [default: 200]  \n  The minimum allowable delay before the transition for a letter is to begin.\n\n- **delayMax** *(integer)* [default: 1200]  \n  The maximum allowable delay before the transition for a letter is to begin.\n\n- **threshold** *(float)* [default: 0.2]  \n  The difference between the random numbers generated for each letter compared to the previous letter. Setting this higher will force the delays to be very different between each letter, spreading out the effect. Setting this lower will allow delays to be similar between letters, sometimes creating a chunking effect.\n\nContributing\n---------------\n\nThis project was built using my two other tools: [React Build Lib](https://github.com/adrianmcli/react-build-lib) and [React Build Dist](https://github.com/adrianmcli/react-build-dist). These tools are still very early in development, so if you are building these libraries, you may encounter some bugs. PRs and issues are welcomed and encouraged! Should probably add some testing too.\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-reveal-text\",\n  \"version\": \"0.1.1\",\n  \"description\": \"A small react library for animating the revealing of text.\",\n  \"main\": \"lib/index.js\",\n  \"homepage\": \"https://github.com/adrianmcli/react-reveal-text\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/adrianmcli/react-reveal-text.git\"\n  },\n  \"scripts\": {\n    \"test\": \"npm run lint\",\n    \"start\": \"npm run storybook\",\n    \"build\": \"npm run build:lib && npm run build:dist && npm run build-storybook\",\n    \"build:lib\": \"react-build-lib\",\n    \"build:dist\": \"react-build-dist --bundle-name ReactRevealText.js\",\n    \"prepublish\": \"npm run build\",\n    \"storybook\": \"start-storybook -p 6006\",\n    \"build-storybook\": \"build-storybook\",\n    \"deploy-storybook\": \"storybook-to-ghpages\",\n    \"lint\": \"eslint src stories\",\n    \"lint:fix\": \"eslint src stories --fix\"\n  },\n  \"author\": \"Adrian Li\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"babel-core\": \"^6.26.0\",\n    \"eslint\": \"^4.16.0\",\n    \"eslint-config-airbnb\": \"^16.1.0\",\n    \"eslint-plugin-import\": \"^2.8.0\",\n    \"eslint-plugin-jsx-a11y\": \"^6.0.3\",\n    \"eslint-plugin-react\": \"^7.6.1\",\n    \"react-build-dist\": \"^0.0.8\",\n    \"react-build-lib\": \"adrianmcli/react-build-lib\",\n    \"@storybook/addon-actions\": \"^3.3.11\",\n    \"@storybook/addon-info\": \"^3.3.11\",\n    \"@storybook/addon-knobs\": \"^3.3.11\",\n    \"@storybook/addon-links\": \"^3.3.11\",\n    \"@storybook/addon-options\": \"^3.3.11\",\n    \"@storybook/addons\": \"^3.3.11\",\n    \"@storybook/react\": \"^3.3.11\",\n    \"@storybook/storybook-deployer\": \"^2.2.0\"\n  },\n  \"peerDependencies\": {},\n  \"keywords\": [\n    \"react\",\n    \"react-component\"\n  ],\n  \"dependencies\": {\n    \"prop-types\": \"^15.6.0\",\n    \"react\": \"^16.0.0\",\n    \"react-dom\": \"^16.0.0\"\n  }\n}\n"
  },
  {
    "path": "src/ReactRevealText.js",
    "content": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { getRandoms, randomToDelay } from './utils';\n\nclass ReactRevealText extends React.Component {\n  constructor(props) {\n    super(props);\n    this.getDelays = this.getDelays.bind(this);\n    this.renderToSpan = this.renderToSpan.bind(this);\n  }\n\n  shouldComponentUpdate(nextProps) {\n    const showChanged = this.props.show !== nextProps.show;\n    const textChanged = this.props.text !== nextProps.text;\n    const childrenChanged = this.props.children !== nextProps.children;\n    return showChanged || textChanged || childrenChanged;\n  }\n\n  getDelays(length) {\n    const { threshold, delayMin, delayMax } = this.props;\n\n    // generate random numbers and then convert to delays\n    const randoms = () => getRandoms(length, threshold);\n    const toDelay = num => randomToDelay(num, delayMin, delayMax);\n\n    return randoms().map(toDelay);\n  }\n\n  renderToSpan({ character, delay }, index) {\n    const { show, transitionTime, timingFunction } = this.props;\n    const style = {\n      opacity: show ? '1' : '0',\n      transition: `opacity ${transitionTime}ms`,\n      transitionDelay: `${delay}ms`,\n      transitionTimingFunction: timingFunction,\n    };\n    return <span key={index} style={style}>{character}</span>;\n  }\n\n  renderSpans(text) {\n    const textArray = text.split('');\n\n    const delays = this.getDelays(textArray.length);\n    const combineWithDelays =\n      (character, index) => ({ character, delay: delays[index] });\n\n    return textArray\n      .map(combineWithDelays)\n      .map(this.renderToSpan);\n  }\n\n  render() {\n    const { style, className } = this.props;\n    const text = this.props.text || this.props.children;\n\n    return (\n      <div style={style} className={className}>\n        {this.renderSpans(text)}\n      </div>\n    );\n  }\n}\n\nReactRevealText.propTypes = {\n  text: PropTypes.string,\n  show: PropTypes.bool,\n  transitionTime: PropTypes.number,\n  timingFunction: PropTypes.string,\n  delayMin: PropTypes.number,\n  delayMax: PropTypes.number,\n  threshold: PropTypes.number,\n  style: PropTypes.object,\n  className: PropTypes.string,\n  children: PropTypes.string,\n};\n\nReactRevealText.defaultProps = {\n  transitionTime: 1300,\n  timingFunction: 'linear',\n  delayMin: 200,\n  delayMax: 1200,\n  threshold: 0.2,\n  text: '',\n  className: '',\n  style: {},\n  show: false,\n  children: undefined,\n};\n\nexport default ReactRevealText;\n"
  },
  {
    "path": "src/TestWrapper.js",
    "content": "/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nclass TestWrapper extends React.Component {\n  constructor(props) {\n    super(props);\n    this.onClick = this.onClick.bind(this);\n    this.state = {\n      show: false,\n    };\n  }\n\n  onClick() {\n    this.setState({ show: !this.state.show });\n  }\n\n  render() {\n    const { show } = this.state;\n    const { children, ...other } = this.props;\n\n    const child = React.Children.only(children);\n    const ChildComponent = React.cloneElement(child, { show, ...other });\n\n    return (\n      <div>\n        { ChildComponent }\n        <button onClick={this.onClick}>Toggle Show</button>\n      </div>\n    );\n  }\n}\n\nTestWrapper.propTypes = {\n  children: PropTypes.element,\n};\n\nexport default TestWrapper;\n"
  },
  {
    "path": "src/index.js",
    "content": "module.exports = require('./ReactRevealText').default;\n"
  },
  {
    "path": "src/utils.js",
    "content": "export const getRandoms = (length, threshold) => {\n  const tooClose = (a, b) => Math.abs(a - b) < threshold;\n\n  const result = [];\n  let random;\n\n  for (let i = 0; i < length; i += 1) {\n    random = Math.random();\n    if (i !== 0) {\n      const prev = result[i - 1];\n      while (tooClose(random, prev)) {\n        random = Math.random();\n      }\n    }\n    result.push(random);\n  }\n  return result;\n};\n\nexport const randomToDelay = (random, min, max) => {\n  const float = random * (max - min);\n  return parseInt(float, 10) + min;\n};\n"
  },
  {
    "path": "stories/demo.js",
    "content": "/* eslint-disable react/no-unused-state */\nimport React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { withInfo } from '@storybook/addon-info';\n\nimport TestWrapper from '../src/TestWrapper';\nimport ReactRevealText from '../src/index';\n\nexport default () =>\n  storiesOf('Demo', module)\n    .add('Revealing Text', withInfo({\n      propTables: false,\n      inline: true,\n      source: false,\n      text: `\n          A simple component for revealing text in a gradual way.\n    \n          Each letter gets a transition applied to it with a random distribution of delays so that they come into (and out of) view sporadically.\n    \n          This controlled component is great for landing pages and anywhere you need to show some kind of transition.\n    \n          Inspired by Adam Schwartz's [Magic of CSS](http://adamschwartz.co/magic-of-css/chapters/6-transitions/).\n        `,\n    })(() => {\n      class Wrapper extends React.Component {\n        constructor() {\n          super();\n          this.state = { show: false };\n        }\n\n        componentDidMount() {\n          setTimeout(() => {\n            this.setState({ show: true });\n          }, 2000);\n        }\n\n        render() {\n          const bgStyles = {\n            background: 'linear-gradient(135deg, #723362, #9d223c)',\n            padding: '36px',\n            paddingTop: '48px',\n          };\n          const textStyles = {\n            color: 'white',\n            fontSize: '24px',\n            lineHeight: '36px',\n            fontFamily: 'sans-serif',\n            textAlign: 'center',\n            letterSpacing: '1em',\n            paddingLeft: '1em', // to compensate for letter spacing\n          };\n          return (\n            <div style={bgStyles}>\n              <div style={textStyles}>\n                <TestWrapper>\n                  <ReactRevealText text=\"WELCOME TO THE FUTURE\" />\n                </TestWrapper>\n              </div>\n            </div>\n          );\n        }\n      }\n\n      return (\n        <Wrapper />\n      );\n    }));\n"
  },
  {
    "path": "stories/documentation.js",
    "content": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { withInfo } from '@storybook/addon-info';\nimport { withKnobs, text, boolean, object, number, select } from '@storybook/addon-knobs';\n\nimport { setOptions } from '@storybook/addon-options';\n\nimport TestWrapper from '../src/TestWrapper';\nimport ReactRevealText from '../src/index';\n\nexport default () =>\n  storiesOf('Documentation', module)\n    .addDecorator(withKnobs)\n    .add('Basic Properties', withInfo({\n      propTables: false,\n      inline: true,\n      text: `\n        This component has many props that you can manipulate. Please see below and use the knobs panel on the right to experiment.\n\n        Note that the component only re-renders when the \\`show\\` property has been changed.\n\n        # Basic Properties\n\n        **text** *(string)*  \n        You can set the text either by passing in text as children or by using the text property.\n\n        **show** *(boolean)*  \n        This prop allows you to control what state the component is in. It allows you to hide or reveal the text.\n\n        **className** *(string)*  \n        This prop allows you to set the className for the div surrounding the text.\n\n        **style** *(object)*  \n        This prop allows you to pass in styles for the div surrounding the text.\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      return (\n        <ReactRevealText\n          text={text('text', 'AMAZING TEXT')}\n          show={boolean('show', true)}\n          className={text('className', 'my-class-name')}\n          style={object('style', {\n            color: 'tomato',\n            fontSize: '24px',\n            lineHeight: '36px',\n            textAlign: 'center',\n            fontFamily: 'sans-serif',\n            letterSpacing: '1.2em',\n            paddingLeft: '1.2em', // to compensate for letter spacing\n          })}\n        />\n      );\n    }))\n    .add('Transition Properties', withInfo({\n      propTables: false,\n      inline: true,\n      text: `\n        Each letter has its own randomly generated delay before its transition begins.\n\n        # Transition Properties\n\n        **transitionTime** *(integer)* [default: 1300]  \n        The time it takes for each letter's transition.\n\n        **timingFunction** *(string)* [default: 'linear']  \n        The CSS transition-timing-function property. On this page, you are given a dropdown selection, but in practice (and in the sandbox), you can enter in any valid string.\n\n        **delayMin** *(integer)* [default: 200]  \n        The minimum allowable delay before the transition for a letter is to begin.\n\n        **delayMax** *(integer)* [default: 1200]  \n        The maximum allowable delay before the transition for a letter is to begin.\n\n        **threshold** *(float)* [default: 0.2]  \n        The difference between the random numbers generated for each letter compared to the previous letter.\n        Setting this higher will force the delays to be very different between each letter, spreading out the effect.\n        Setting this lower will allow delays to be similar between letters, sometimes creating a chunking effect.\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      const timingFnOptions = {\n        linear: 'linear',\n        ease: 'ease',\n        'ease-in': 'ease-in',\n        'ease-out': 'ease-out',\n        'ease-in-out': 'ease-in-out',\n        'step-start': 'step-end',\n      };\n      const thresholdOptions = {\n        range: true,\n        min: 0,\n        max: 0.5,\n        step: 0.1,\n      };\n      return (\n        <TestWrapper>\n          <ReactRevealText\n            transitionTime={number('transitionTime', 1300)}\n            timingFunction={select('timingFunction', timingFnOptions, 'linear')}\n            delayMin={number('delayMin', 200)}\n            delayMax={number('delayMax', 1200)}\n            threshold={number('threshold', 0.2, thresholdOptions)}\n          >\n            AMAZING TEXT!\n          </ReactRevealText>\n        </TestWrapper>\n      );\n    }))\n    .add('Sandbox', withInfo({\n      propTables: false,\n      inline: true,\n      text: `\n        This page has all the properties for you to play with.\n\n        Note that you can input \\`timingFunction\\` as a string on the knobs tab.\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      const thresholdOptions = {\n        range: true,\n        min: 0,\n        max: 0.5,\n        step: 0.1,\n      };\n      return (\n        <TestWrapper>\n          <ReactRevealText\n            text={text('text', 'AMAZING TEXT')}\n            show={boolean('show', true)}\n            className={text('className', 'my-class-name')}\n            transitionTime={number('transitionTime', 1300)}\n            timingFunction={text('timingFunction', 'linear')}\n            delayMin={number('delayMin', 200)}\n            delayMax={number('delayMax', 1200)}\n            threshold={number('threshold', 0.2, thresholdOptions)}\n            style={object('style', {\n              color: 'tomato',\n              fontSize: '24px',\n              lineHeight: '36px',\n              textAlign: 'center',\n              fontFamily: 'sans-serif',\n              letterSpacing: '1.2em',\n              paddingLeft: '1.2em', // to compensate for letter spacing\n            })}\n          />\n        </TestWrapper>\n      );\n    }));\n"
  },
  {
    "path": "stories/examples.js",
    "content": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { withInfo } from '@storybook/addon-info';\n\nimport ReactRevealText from '../src/index';\n\nexport default () =>\n  storiesOf('Examples', module)\n    .add('1. Show on load', withInfo({\n      propTables: false,\n      inline: true,\n      source: false,\n      text: `\n        Here is an example that will reveal the text once the component has been mounted.\n\n        # Source\n\n        ~~~jsx\n        class Wrapper extends React.Component {\n\n          constructor() {\n            super();\n            this.state = { show: false };\n          }\n\n          componentDidMount() {\n            setTimeout(() => {\n              this.setState({ show: true });\n            }, 2000);\n          }\n\n          render() {\n            return (\n              <div style={{ border: '1px solid grey', textAlign: 'center' }}>\n                <h1>\n                  <ReactRevealText show={this.state.show}>\n                    WELCOME TO MY SITE\n                  </ReactRevealText>\n                </h1>\n              </div>\n            );\n          }\n        }\n        ~~~\n      `,\n    })(() => {\n      class Wrapper extends React.Component {\n        constructor() {\n          super();\n          this.state = { show: false };\n        }\n\n        componentDidMount() {\n          setTimeout(() => {\n            this.setState({ show: true });\n          }, 2000);\n        }\n\n        render() {\n          return (\n            <div style={{ border: '1px solid grey', textAlign: 'center' }}>\n              <h1>\n                <ReactRevealText show={this.state.show}>\n                  WELCOME TO MY SITE\n                </ReactRevealText>\n              </h1>\n            </div>\n          );\n        }\n      }\n\n      return (\n        <Wrapper />\n      );\n    }))\n    .add('2. Show only on hover', withInfo({\n      propTables: false,\n      inline: true,\n      source: false,\n      text: `\n        Here is an example that will reveal the text only when it is being hovered on top of.\n\n        # Source\n\n        ~~~jsx\n        class Wrapper extends React.Component {\n\n          constructor() {\n            super();\n            this.state = { show: false };\n            this.onMouseEnter = this.onMouseEnter.bind(this);\n            this.onMouseLeave = this.onMouseLeave.bind(this);\n          }\n\n          onMouseEnter() {\n            console.log('true');\n            this.setState({ show: true });\n          }\n\n          onMouseLeave() {\n            console.log('false');\n            this.setState({ show: false });\n          }\n\n          render() {\n            return (\n              <div\n                onMouseEnter={this.onMouseEnter}\n                onMouseLeave={this.onMouseLeave}\n                style={{ border: '1px solid grey', textAlign: 'center' }}\n              >\n                <h1>\n                  <ReactRevealText show={this.state.show}>\n                    WELCOME TO MY SITE\n                  </ReactRevealText>\n                </h1>\n              </div>\n            );\n          }\n        }\n        ~~~\n      `,\n    })(() => {\n      class Wrapper extends React.Component {\n        constructor() {\n          super();\n          this.state = { show: false };\n          this.onMouseEnter = this.onMouseEnter.bind(this);\n          this.onMouseLeave = this.onMouseLeave.bind(this);\n        }\n\n        onMouseEnter() {\n          this.setState({ show: true });\n        }\n\n        onMouseLeave() {\n          this.setState({ show: false });\n        }\n\n        render() {\n          return (\n            <div\n              onMouseEnter={this.onMouseEnter}\n              onMouseLeave={this.onMouseLeave}\n              style={{ border: '1px solid grey', textAlign: 'center' }}\n            >\n              <h1>\n                <ReactRevealText show={this.state.show}>\n                  WELCOME TO MY SITE\n                </ReactRevealText>\n              </h1>\n            </div>\n          );\n        }\n      }\n\n      return (\n        <Wrapper />\n      );\n    }))\n    .add('3. Pretty', withInfo({\n      propTables: false,\n      inline: true,\n      source: false,\n      text: `\n        A simple example to show off how pretty the effect can look.\n\n        Imagine this with a moving background!\n\n        # Source\n\n        ~~~jsx\n        class Wrapper extends React.Component {\n\n          constructor() {\n            super();\n            this.state = { show: false };\n          }\n\n          componentDidMount() {\n            setTimeout(() => {\n              this.setState({ show: true });\n            }, 2000);\n          }\n\n          render() {\n            const bgStyles = {\n              background: 'linear-gradient(135deg, #723362, #9d223c)',\n              padding: '36px',\n            };\n            const textStyles = {\n              color: 'white',\n              fontSize: '24px',\n              lineHeight: '36px',\n              fontFamily: 'sans-serif',\n              textAlign: 'center',\n              letterSpacing: '1em',\n              paddingLeft: '1em', // to compensate for letter spacing\n            };\n            return (\n              <div style={bgStyles}>\n                <div style={textStyles}>\n                  <ReactRevealText show={this.state.show} text=\"WELCOME TO THE FUTURE\" />\n                </div>\n              </div>\n            );\n          }\n        }\n        ~~~\n      `,\n    })(() => {\n      class Wrapper extends React.Component {\n        constructor() {\n          super();\n          this.state = { show: false };\n        }\n\n        componentDidMount() {\n          setTimeout(() => {\n            this.setState({ show: true });\n          }, 2000);\n        }\n\n        render() {\n          const bgStyles = {\n            background: 'linear-gradient(135deg, #723362, #9d223c)',\n            padding: '36px',\n          };\n          const textStyles = {\n            color: 'white',\n            fontSize: '24px',\n            lineHeight: '36px',\n            fontFamily: 'sans-serif',\n            textAlign: 'center',\n            letterSpacing: '1em',\n            paddingLeft: '1em', // to compensate for letter spacing\n          };\n          return (\n            <div style={bgStyles}>\n              <div style={textStyles}>\n                <ReactRevealText show={this.state.show} text=\"WELCOME TO THE FUTURE\" />\n              </div>\n            </div>\n          );\n        }\n      }\n\n      return (\n        <Wrapper />\n      );\n    }));\n"
  },
  {
    "path": "stories/index.stories.js",
    "content": "import './styles.css';\n\nimport demo from './demo';\nimport tutorial from './tutorial';\nimport examples from './examples';\nimport documentation from './documentation';\n\ndemo();\ntutorial();\nexamples();\ndocumentation();\n"
  },
  {
    "path": "stories/styles.css",
    "content": "code {\n  font-size: 15px;\n  font-weight: 600;\n  padding: 2px 5px;\n  border: 1px solid #eae9e9;\n  border-radius: 4px;\n  background-color: #f3f2f2;\n  color: #3a3a3a;\n}\n\npre > code {\n  border: none;\n  border-radius: 0;\n  padding: 0;\n  margin: 0;\n  font-weight: 400;\n}"
  },
  {
    "path": "stories/tutorial.js",
    "content": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport { withInfo } from '@storybook/addon-info';\nimport { withKnobs, text, boolean, object } from '@storybook/addon-knobs';\n\nimport { setOptions } from '@storybook/addon-options';\n\nimport TestWrapper from '../src/TestWrapper';\nimport ReactRevealText from '../src/index';\n\n// const stories = storiesOf('Tutorial', module);\n// stories.addDecorator(withKnobs);\n\nexport default () =>\n  storiesOf('Tutorial', module)\n    .addDecorator(withKnobs)\n    .add('1. A controlled component', withInfo({\n      propTables: false,\n      inline: true,\n      source: true,\n      text: `\n        React Reveal Text is a controlled component.\n\n        That means you control its appearance by passing in a prop.\n        In this case, it's the \\`show\\` prop.\n\n        Click the \"Knobs\" tab on the bottom and try changing the state.\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      return (\n        <ReactRevealText show={boolean('show', false)}>\n          WELCOME!\n        </ReactRevealText>\n      );\n    }))\n    .add('2. Styling your text', withInfo({\n      propTables: false,\n      inline: true,\n      source: true,\n      text: `\n        ~~~jsx\n        <ReactRevealText\n          show={true}\n          style={myStyleObject}\n          className=\"my-class-name\"\n        />\n        ~~~\n\n        You can style an object by passing in a style object into the \\`styles\\` prop.\n\n        Or, you can also pass in a string to the \\`className\\` prop.\n\n        Note that the component only re-renders when the \\`show\\` prop is changed.\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      return (\n        <ReactRevealText\n          show={boolean('show', true)}\n          style={object('style', {\n            fontSize: '24px',\n            lineHeight: '36px',\n            textAlign: 'center',\n            fontFamily: 'sans-serif',\n            letterSpacing: '1.2em',\n            paddingLeft: '1.2em', // to compensate for letter spacing\n          })}\n        >\n          WELCOME!\n        </ReactRevealText>\n      );\n    }))\n    .add('3. Testing with TestWrapper', withInfo({\n      propTables: false,\n      inline: true,\n      text: `\n        This library ships with a component to help you develop with React Reveal Text.\n\n        The TestWrapper component renders a button for you to toggle its\n        show/hide state, and controls the ReactRevealText \\`show\\` prop for you.\n        Any props you pass in will be passed through to its child.\n\n        Simply import it like this and use it in the way shown below:\n\n        ~~~jsx\n        import TestWrapper from 'react-reveal-text/lib/TextWrapper';\n        ~~~\n      `,\n    })(() => {\n      setOptions({ showDownPanel: true });\n      return (\n        <TestWrapper\n          text={text('text', 'AMAZING TEXT')}\n          style={object('style', {\n              color: 'tomato',\n              fontSize: '24px',\n              lineHeight: '36px',\n              textAlign: 'center',\n              fontFamily: 'sans-serif',\n              letterSpacing: '1.2em',\n              paddingLeft: '1.2em', // to compensate for letter spacing\n            })}\n        >\n          <ReactRevealText />\n        </TestWrapper>\n      );\n    }));\n"
  }
]