[
  {
    "path": ".gitignore",
    "content": "node_modules\ncoverage\nnpm-debug.log\nlib\n.vscode"
  },
  {
    "path": ".hophoprc",
    "content": "toggl: n\nbranchPrefix: n\nbranchSuffix: y"
  },
  {
    "path": ".smooth-releaserc",
    "content": "{\n  \"github\": {\n    \"dataType\": \"pullRequests\"\n  },\n  \"tasks\": {\n    \"npm-publish\": true,\n    \"npm-version\": true,\n    \"gh-release\": true,\n    \"changelog\": true\n  }\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "#  Change Log\n\n\n\n## [v4.1.0](https://github.com/buildo/react-cookie-banner/tree/v4.1.0) (2019-12-11)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v4.0.0...v4.1.0)\n\n#### New features:\n\n- Leverage componentDidUpdate hook instead of componentWillReceiveProps [#67](https://github.com/buildo/react-cookie-banner/pull/67)\n- Fixing build after migration to Concourse [#64](https://github.com/buildo/react-cookie-banner/pull/64)\n- Migrating from drone to concourse [#63](https://github.com/buildo/react-cookie-banner/pull/63)\n- Updated link prop documentation [#57](https://github.com/buildo/react-cookie-banner/pull/57)\n\n## [v4.0.0](https://github.com/buildo/react-cookie-banner/tree/v4.0.0) (2018-05-04)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v3.0.0...v4.0.0)\n\n#### New features:\n\n- Clarify usage of onAccept-callback in documentation [#53](https://github.com/buildo/react-cookie-banner/pull/53)\n- #35: support `Link` from react-router-dom (button-close not rendered anymore when using custom children) (closes #35) [#52](https://github.com/buildo/react-cookie-banner/pull/52)\n- Add Click To Dismiss [#51](https://github.com/buildo/react-cookie-banner/pull/51)\n\n## [v3.0.0](https://github.com/buildo/react-cookie-banner/tree/v3.0.0) (2017-12-12)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v2.0.0...v3.0.0)\n\n#### Breaking:\n\n- Accessibility improvements: Button elements & a rel attributes [#43](https://github.com/buildo/react-cookie-banner/pull/43)\n\n## [v2.0.0](https://github.com/buildo/react-cookie-banner/tree/v2.0.0) (2017-12-12)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v1.0.1...v2.0.0)\n\n#### New features:\n\n- #41: Server side rendering issues (closes #41) [#42](https://github.com/buildo/react-cookie-banner/pull/42)\n\n## [v1.0.1](https://github.com/buildo/react-cookie-banner/tree/v1.0.1) (2017-12-04)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v1.0.0...v1.0.1)\n\n#### Fixes (bugs & defects):\n\n- #39: import in v1.0.0 is broken (closes #39) [#40](https://github.com/buildo/react-cookie-banner/pull/40)\n\n## [v1.0.0](https://github.com/buildo/react-cookie-banner/tree/v1.0.0) (2017-12-03)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.18...v1.0.0)\n\n#### Breaking:\n\n- #37: Refactor in TypeScript! (closes #37) [#38](https://github.com/buildo/react-cookie-banner/pull/38)\n\n#### New features:\n\n- Adding import to react-components showroom example [#36](https://github.com/buildo/react-cookie-banner/pull/36)\n\n## [v0.0.18](https://github.com/buildo/react-cookie-banner/tree/v0.0.18) (2017-05-03)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.17...v0.0.18)\n\n#### New features:\n\n- Add a 'cookiePath' property [#34](https://github.com/buildo/react-cookie-banner/pull/34)\n- #29: Template and cookie logic should live in different components (closes #29) [#30](https://github.com/buildo/react-cookie-banner/pull/30)\n\n#### Fixes (bugs & defects):\n\n- #31: React15 throws warning for unknown prop (closes #31) [#32](https://github.com/buildo/react-cookie-banner/pull/32)\n\n## [v0.0.17](https://github.com/buildo/react-cookie-banner/tree/v0.0.17) (2016-10-13)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.16...v0.0.17)\n\n#### New features:\n\n- #26: Use eslint-config-buildo (closes #26) [#27](https://github.com/buildo/react-cookie-banner/pull/27)\n- Custom component can receive onAccept prop using a children function [#25](https://github.com/buildo/react-cookie-banner/pull/25)\n\n## [v0.0.16](https://github.com/buildo/react-cookie-banner/tree/v0.0.16) (2016-10-05)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.15...v0.0.16)\n\n#### New features:\n\n- #23: Cookie expiration date (closes #23) [#24](https://github.com/buildo/react-cookie-banner/pull/24)\n- #21: Renew example (closes #21) [#22](https://github.com/buildo/react-cookie-banner/pull/22)\n\n## [v0.0.15](https://github.com/buildo/react-cookie-banner/tree/v0.0.15) (2016-09-14)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.14...v0.0.15)\n\n## [v0.0.14](https://github.com/buildo/react-cookie-banner/tree/v0.0.14) (2016-08-10)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.13...v0.0.14)\n\n## [v0.0.13](https://github.com/buildo/react-cookie-banner/tree/v0.0.13) (2016-08-10)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.12...v0.0.13)\n\n#### Fixes (bugs & defects):\n\n- Replace `mousewheel` event with `scroll` [#20](https://github.com/buildo/react-cookie-banner/pull/20)\n\n#### New features:\n\n- #16: if dismissOnScroll at false, the click on the close button do not close the banner (closes #16) [#17](https://github.com/buildo/react-cookie-banner/pull/17)\n\n## [v0.0.12](https://github.com/buildo/react-cookie-banner/tree/v0.0.12) (2016-05-31)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.11...v0.0.12)\n\n#### New features:\n\n- add target to the cookie-link [#14](https://github.com/buildo/react-cookie-banner/pull/14)\n\n## [v0.0.11](https://github.com/buildo/react-cookie-banner/tree/v0.0.11) (2015-12-11)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.10...v0.0.11)\n\n## [v0.0.10](https://github.com/buildo/react-cookie-banner/tree/v0.0.10) (2015-10-14)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.9...v0.0.10)\n\n#### New features:\n\n- #9: code clean (closes #9) [#10](https://github.com/buildo/react-cookie-banner/pull/10)\n- Allow custom styles [#8](https://github.com/buildo/react-cookie-banner/pull/8)\n- #3: Remove .gitkeep from src and tests (closes #3) [#7](https://github.com/buildo/react-cookie-banner/pull/7)\n\n## [v0.0.9](https://github.com/buildo/react-cookie-banner/tree/v0.0.9) (2015-07-14)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.8...v0.0.9)\n\n#### Fixes (bugs & defects):\n\n- #5: Is not safe for universal rendering [#6](https://github.com/buildo/react-cookie-banner/pull/6)\n\n## [v0.0.8](https://github.com/buildo/react-cookie-banner/tree/v0.0.8) (2015-07-03)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.7...v0.0.8)\n\n#### New features:\n\n- dismissOnScroll should take an optional Y threshold (default: 0) [#4](https://github.com/buildo/react-cookie-banner/pull/4)\n\n## [v0.0.7](https://github.com/buildo/react-cookie-banner/tree/v0.0.7) (2015-06-30)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.6...v0.0.7)\n\n## [v0.0.6](https://github.com/buildo/react-cookie-banner/tree/v0.0.6) (2015-06-29)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.5...v0.0.6)\n\n## [v0.0.5](https://github.com/buildo/react-cookie-banner/tree/v0.0.5) (2015-06-25)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.4...v0.0.5)\n\n## [v0.0.4](https://github.com/buildo/react-cookie-banner/tree/v0.0.4) (2015-06-19)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.3...v0.0.4)\n\n## [v0.0.3](https://github.com/buildo/react-cookie-banner/tree/v0.0.3) (2015-06-14)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.2...v0.0.3)\n\n## [v0.0.2](https://github.com/buildo/react-cookie-banner/tree/v0.0.2) (2015-06-12)\n[Full Changelog](https://github.com/buildo/react-cookie-banner/compare/v0.0.1...v0.0.2)\n\n## [v0.0.1](https://github.com/buildo/react-cookie-banner/tree/v0.0.1) (2015-06-12)\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 buildo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "[![Build Status](https://drone.our.buildo.io/api/badges/buildo/react-cookie-banner/status.svg)](https://drone.our.buildo.io/buildo/react-cookie-banner) ![](https://img.shields.io/npm/v/react-cookie-banner.svg)\n\n# React Cookie Banner\n\nA cookie banner for React that can be dismissed with a simple scroll. Because [fuck the Cookie Law](http://nocookielaw.com/) that's why.\n\n(If you *really* want to annoy your users you can disable this feature but this is strongly discouraged!).\n\n```jsx\nimport CookieBanner from 'react-cookie-banner';\n\nReact.renderComponent(\n  <div>\n    <CookieBanner\n      message=\"Yes, we use cookies. If you don't like it change website, we won't miss you!\"\n      onAccept={() => {}}\n      cookie=\"user-has-accepted-cookies\" />\n  </div>,\n  document.body\n);\n```\n\n[Live Examples](http://react-components.buildo.io/#cookiebanner)\n\n## Install\n```\nnpm install --save react-cookie-banner\n```\n\nor using `yarn`:\n\n```\nyarn add react-cookie-banner\n```\n\n## API\nYou can see `CookieBanner`'s props in its own [README.md](https://github.com/buildo/react-cookie-banner/blob/master/src/README.md)\n\n## Style\n`react-cookie-banner` comes with a nice default style made using inline-style.\n\nOf course, you can customize it as you like in several ways.\n\nBased on how many changes you want to apply, you can style `react-cookie-banner` as follows:\n\n### You like the original style and you wish to make only a few modifications\nWhy spending hours on the CSS when you have such a nice default style? :)\n\nIn this case you can:\n\n#### 1) Override the predefined inline-styles\nIn this example we change the message font-size and make the banner slightly transparent with the `styles` prop:\n\n```jsx\n<CookieBanner\n  styles={{\n    banner: { backgroundColor: 'rgba(60, 60, 60, 0.8)' },\n    message: { fontWeight: 400 }\n  }}\n  message='...'\n/>\n```\n\nSee [`src/styleUtils.ts`](https://github.com/buildo/react-cookie-banner/blob/master/src/styleUtils.ts) for a complete list of overridable style objects.\n\n#### 2) Beat it with good old CSS (or SASS)\n\nThe banner is structured as follows:\n\n```jsx\n<div className={this.props.className + ' react-cookie-banner'}\n  <span className='cookie-message'>\n    {this.props.message}\n    <a className='cookie-link'>\n      Learn more\n    </a>\n  </span>\n  <button className='button-close'>\n    Got it\n  </button>\n</div>\n```\n\nYou can style every part of it using the appropriate `className`:\n\n```sass\n.your-class-name.react-cookie-banner {\n  background-color: rgba(60, 60, 60, 0.8);\n\n  .cookie-message {\n    font-weight: 400;\n  }\n}\n```\n\n### You need to heavily adapt the style to your application\nYour creative designer wants to change the style of the cookie banner completely?\nDon't worry, we got your covered!\n\nIf you need to re-style it, you can:\n\n#### 1) Disable the default style and use your CSS\n\nYou may disable the default style by simply setting the prop `disableStyle` to `true`:\n\n```jsx\n<CookieBanner disableStyle={true} />\n```\n\nNow you can re-style the cookie banner completely using your own CSS.\n\n#### 2) Use your own cookie banner!\nDon't like the layout either?\nYou can use your own custom cookie banner component by passing it as `children` and still let `react-cookie-banner` handle the hassle of managing `cookies` for you :)\n\n```jsx\n<CookieBanner>\n  {(onAccept) => (\n    <MyCustomCookieBanner {...myCustomProps} onAccept={onAccept} /> {/* rendered directly without any <div> wrapper */}\n  )}\n</CookieBanner>\n```\n\n## Cookies manipulation\n`react-cookie-banner` uses **`universal-cookie`** to manipulate cookies.\n\nYou can import the `Cookies` class and use it as follows:\n\n```js\nimport { Cookies } from 'react-cookie-banner'\n\nconst cookies = new Cookies(/* Your cookie header, on browsers defaults to document.cookie */)\n\n// simple set\ncookie.set('test', 'a')\n// complex set - cookie(name, value, ttl, path, domain, secure)\ncookie.set('test', 'a', {\n  expires: new Date(2020-05-04)\n  path: '/api',\n  domain: '*.example.com',\n  secure: true\n})\n// get\ncookies.get('test')\n// destroy\ncookies.remove('test', '', -1)\n```\n\nPlease refer to [universal-cookie](https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie#api---cookies-class) repo for more documentation.\n\n## Server side rendering (aka Universal)\n`react-cookie-banner` supports SSR thanks to `react-cookie`.\nIf you want to support SSR, you should use the `CookieProvider` from `react-cookie` and the `CookieBannerUniversal` wrapper:\n\n```jsx\nimport { Cookies, CookiesProvider, CookieBannerUniversal } from 'react-cookie-banner'\n\nconst cookies = new Cookies(/* Your cookie header, on browsers defaults to document.cookie */)\n\n<CookiesProvider cookies={cookies}>\n  <CookieBannerUniversal />\n</CookiesProvider>\n```\n\n"
  },
  {
    "path": "ci/pipeline.yml",
    "content": "resource_types:\n  - name: pull-request\n    type: docker-image\n    source:\n      repository: teliaoss/github-pr-resource\n\nresources:\n  - name: master\n    type: git\n    icon: github-circle\n    source:\n      uri: git@github.com:buildo/react-cookie-banner\n      branch: master\n      private_key: ((private-key))\n\n  - name: pr\n    type: pull-request\n    source:\n      repository: buildo/react-cookie-banner\n      access_token: ((github-token))\n\njobs:\n  - name: pr-test\n    plan:\n      - get: react-cookie-banner\n        resource: pr\n        trigger: true\n        version: every\n      - put: pr\n        params:\n          path: react-cookie-banner\n          status: pending\n          context: concourse\n      - do:\n          - task: test\n            file: react-cookie-banner/ci/test.yml\n            attempts: 2\n        on_success:\n          put: pr\n          params:\n            path: react-cookie-banner\n            status: success\n            context: concourse\n        on_failure:\n          put: pr\n          params:\n            path: react-cookie-banner\n            status: failure\n            context: concourse\n\n  - name: test\n    plan:\n      - get: react-cookie-banner\n        resource: master\n        trigger: true\n      - do:\n          - task: test\n            file: react-cookie-banner/ci/test.yml\n            attempts: 2\n"
  },
  {
    "path": "ci/test.sh",
    "content": "#!/bin/sh\n\nset -e\n\nyarn install --no-progress\nyarn typecheck\nyarn test\n"
  },
  {
    "path": "ci/test.yml",
    "content": "platform: linux\n\nimage_resource:\n  type: docker-image\n  source:\n    repository: node\n    tag: 8-slim\n\ninputs:\n  - name: react-cookie-banner\n\ncaches:\n  - path: react-cookie-banner/node_modules\n\nrun:\n  path: ci/test.sh\n  dir: react-cookie-banner\n"
  },
  {
    "path": "examples/Examples.md",
    "content": "### Examples\n\n```js\ninitialState = { dismissOnScroll: true, dismissOnClick: false }\n\n// reset cookies on first render\n!state.accepted && cookies.get('accepts-cookies') && cookies.remove('accepts-cookies')\n\nconst styles = {\n  banner: {\n    fontFamily: 'Source Sans Pro',\n    height: 57,\n    background: 'rgba(52, 64, 81, 0.88) url(/cookie.png) 20px 50% no-repeat',\n    backgroundSize: '30px 30px',\n    backgroundColor: '',\n    fontSize: '15px',\n    fontWeight: 600\n  },\n  button: {\n    border: '1px solid white',\n    borderRadius: 4,\n    width: 66,\n    height: 32,\n    lineHeight: '32px',\n    background: 'transparent',\n    color: 'white',\n    fontSize: '14px',\n    fontWeight: 600,\n    opacity: 1,\n    right: 20,\n    marginTop: -18\n  },\n  message: {\n    display: 'block',\n    padding: '9px 67px',\n    lineHeight: 1.3,\n    textAlign: 'left',\n    marginRight: 244,\n    color: 'white'\n  },\n  link: {\n    textDecoration: 'none',\n    fontWeight: 'bold'\n  }\n}\n\nconst message = \"Buildo uses cookies to guarantee users the employment of its site features, offering a better purchasing experience. By continuing to browse the site you're agreeing to our use of cookies.\"\n\nfunction toggleDismissOnScroll() {\n  setState({ dismissOnScroll: !state.dismissOnScroll })\n}\n\nfunction toggleDismissOnClick() {\n  setState({ dismissOnClick: !state.dismissOnClick })\n}\n\nfunction resetCookies() {\n  cookies.remove('accepts-cookies')\n  setState({ accepted: false })\n}\n\n<div>\n  <p>\n    accepts-cookies: {cookies.get('accepts-cookies') || 'false'}\n  </p>\n\n  <button onClick={toggleDismissOnScroll}>\n    {`${state.dismissOnScroll ? 'Disable' : 'Activate'} dismissOnScroll`}\n  </button>\n\n  <button onClick={toggleDismissOnClick} style={{ marginLeft: 20 }}>\n    {`${state.dismissOnClick ? 'Disable' : 'Activate'} dismissOnClick`}\n  </button>\n\n  <button onClick={resetCookies} style={{ marginLeft: 20 }}>\n    Reset Cookies\n  </button>\n\n  <CookieBanner\n    styles={styles}\n    message={message}\n    link={<a href='http://nocookielaw.com/'>More information on our use of cookies</a>}\n    buttonMessage='Close'\n    dismissOnScroll={state.dismissOnScroll}\n    dismissOnClick={state.dismissOnClick}\n    onAccept={() => setState({ accepted: true })}\n  />\n</div>\n```\n\n#### Server side rendering\nYou can pass your own `cookies` instance to `CookiesProvider` to support SSR:\n\n```js static\n// import { Cookies, CookiesProvider, CookieBannerUniversal } from 'react-cookie-banner';\n\nconst cookies = new Cookies(/* Your cookie header, on browsers defaults to document.cookie */);\n\n<CookiesProvider cookies={cookies}>\n  <CookieBannerUniversal />\n</CookiesProvider>\n```\n"
  },
  {
    "path": "examples/examples.scss",
    "content": ".react-cookie-banner {\n  position: fixed !important;\n  bottom: 0 !important;\n  left: 0 !important;\n  width: 100% !important;\n  z-index: 999 !important;\n  font-family: 'Source Sans Pro'\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-cookie-banner\",\n  \"version\": \"4.1.0\",\n  \"description\": \"React Cookie banner which can be automatically dismissed with a scroll. Because fuck The Cookie Law, that's why.\",\n  \"main\": \"lib\",\n  \"typings\": \"lib\",\n  \"files\": [\n    \"lib\",\n    \"src\",\n    \"examples\",\n    \"styleguide\",\n    \"typings\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest\",\n    \"build\": \"rm -rf lib && mkdir lib && tsc\",\n    \"preversion\": \"npm run test\",\n    \"prepublish\": \"npm run build\",\n    \"start\": \"styleguidist server\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"release-version\": \"smooth-release\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/buildo/react-cookie-banner.git\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"react-component\",\n    \"cookie\",\n    \"cookies\",\n    \"banner\",\n    \"eu\",\n    \"law\"\n  ],\n  \"author\": \"Francesco Cioria <francesco@buildo.io>\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/buildo/react-cookie-banner/issues\"\n  },\n  \"homepage\": \"https://github.com/buildo/react-cookie-banner\",\n  \"dependencies\": {\n    \"classnames\": \"2.2.5\",\n    \"lodash.omit\": \"^4.5.0\",\n    \"react-addons-clone-with-props\": \"^0.14.8\",\n    \"react-cookie\": \"^2.1.2\"\n  },\n  \"devDependencies\": {\n    \"@types/classnames\": \"^2.2.3\",\n    \"@types/enzyme\": \"2.8.6\",\n    \"@types/jest\": \"^22\",\n    \"@types/lodash.omit\": \"^4.5.3\",\n    \"@types/node\": \"9.6.4\",\n    \"@types/prop-types\": \"^15.5.2\",\n    \"@types/react\": \"^16.3.10\",\n    \"babel-loader\": \"^7.1.2\",\n    \"babel-preset-buildo\": \"^0.1.1\",\n    \"css-loader\": \"^0.28.5\",\n    \"enzyme\": \"^3.2.0\",\n    \"enzyme-adapter-react-16\": \"^1.1.0\",\n    \"file-loader\": \"^1.1.5\",\n    \"jest\": \"^22\",\n    \"node-sass\": \"^4.8.3\",\n    \"progress-bar-webpack-plugin\": \"^1.10.0\",\n    \"raw-loader\": \"^0.5.1\",\n    \"react\": \"^16\",\n    \"react-docgen-typescript\": \"^1.1.0\",\n    \"react-dom\": \"^16\",\n    \"react-styleguidist\": \"^6.0.33\",\n    \"react-test-renderer\": \"^16.2.0\",\n    \"sass-loader\": \"^6.0.6\",\n    \"smooth-release\": \"^8.0.4\",\n    \"ts-jest\": \"^22\",\n    \"ts-loader\": \"^2.3.3\",\n    \"typescript\": \"^2.8.1\",\n    \"webpack\": \"3.5.5\"\n  },\n  \"peerDependencies\": {\n    \"react\": \">= 0.12.x\"\n  },\n  \"jest\": {\n    \"setupFiles\": [\n      \"<rootDir>/test/setup.js\"\n    ],\n    \"transform\": {\n      \"^.+\\\\.tsx?$\": \"<rootDir>/node_modules/ts-jest/preprocessor.js\"\n    },\n    \"testRegex\": \"(.*[.](test))[.](tsx?)$\",\n    \"moduleFileExtensions\": [\n      \"js\",\n      \"ts\",\n      \"tsx\"\n    ],\n    \"testURL\": \"http://localhost/\"\n  }\n}\n"
  },
  {
    "path": "src/BannerContent.tsx",
    "content": "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport omit = require('lodash.omit');\nimport * as cx from 'classnames';\nimport * as styleUtils from './styleUtils';\n\nexport type Props = {\n  /** message written inside default cookie banner */\n  message?: string,\n  /** called when user accepts cookies */\n  onAccept: () => void,\n  /** JSX element to link to your cookie-policy page */\n  link?: JSX.Element,\n  /** message written inside the button of the default cookie banner */\n  buttonMessage?: string,\n  /** className passed to close-icon */\n  closeIcon?: string,\n  /** pass `true` if you want to disable default style */\n  disableStyle?: boolean,\n  /** object with custom styles used to overwrite default ones */\n  styles?: object,\n  className?: string,\n  /** pass `true` if you want to dismiss by clicking anywhere on the banner */\n  dismissOnClick?: boolean\n}\n\nexport const propTypes = {\n  message: PropTypes.string,\n  onAccept: PropTypes.func.isRequired,\n  link: PropTypes.element,\n  buttonMessage: PropTypes.string,\n  closeIcon: PropTypes.string,\n  disableStyle: PropTypes.bool,\n  styles: PropTypes.object,\n  className: PropTypes.string,\n  dismissOnClick: PropTypes.bool\n};\n\n\n/**\n * React Cookie banner template\n */\nexport default class BannerContent extends React.Component<Props> {\n\n  static propTypes = propTypes\n\n  getStyle = (style: 'message' | 'banner' | 'link' | 'button' | 'icon') => {\n    const { disableStyle, styles = {} } = this.props;\n    if (!disableStyle) {\n      // apply custom styles if available\n      return { ...styleUtils.getStyle(style), ...styles[style] };\n    }\n  }\n\n  templateCloseIcon = (className: string, onClick: () => void, style: React.CSSProperties ) => (\n    <button {...{ onClick, style }}>\n      <i {...{ className }} />\n    </button>\n  )\n\n  templateCloseButton = (buttonMessage: string, onClick: () => void, style: React.CSSProperties) => (\n    <button className='button-close' {...{ onClick, style }}>\n      {buttonMessage}\n    </button>\n  )\n\n  templateLink = (link: JSX.Element, style: React.CSSProperties) => (\n    React.cloneElement(link, link.props.style ? undefined : { style })\n  )\n\n  render() {\n    const {\n      getStyle,\n      props: {\n        onAccept, className, message,\n        closeIcon, link, buttonMessage = 'Got it',\n        ..._wrapperProps\n      }\n    } = this;\n\n    const cookieMessageStyle = getStyle('message');\n    const wrapperProps = {\n      ...omit(_wrapperProps, Object.keys(propTypes)),\n      className: cx('react-cookie-banner', className),\n      style: getStyle('banner')\n    };\n\n    return (\n      <div {...wrapperProps} onClick={this.bannerClicked}>\n        <span className='cookie-message' style={cookieMessageStyle}>\n          {message}\n          {link && this.templateLink(link, getStyle('link'))}\n        </span>\n        {!closeIcon && this.templateCloseButton(buttonMessage, onAccept, getStyle('button'))}\n        {!!closeIcon && this.templateCloseIcon(closeIcon, onAccept, getStyle('icon'))}\n      </div>\n    );\n  }\n\n  bannerClicked = () => {\n    if (this.props.dismissOnClick) {\n      this.props.onAccept();\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/CookieBanner.tsx",
    "content": "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport omit = require('lodash.omit');\nimport { Cookies } from 'react-cookie';\nimport BannerContent, { propTypes as BannerContentPropTypes, Props as BannerContentProps } from './BannerContent';\n\nexport type CookieBannerRequiredProps = {\n  /** custom component rendered if user has not accepted cookies */\n  children?: any,\n  /** called when user accepts cookies */\n  onAccept?: (o: { cookie: string }) => void,\n  /** instance of Cookies class to be used in server-side-rendering */\n  cookies?: Cookies,\n  /** cookie-key used to save user's decision about you cookie-policy */\n  cookie?: string,\n  /** used to set the cookie expiration */\n  cookieExpiration?: number | {\n    years?: number,\n    days?: number,\n    hours?: number\n  },\n  /** used to set the cookie path */\n  cookiePath?: string,\n  /** whether the cookie banner should be dismissed on scroll or not */\n  dismissOnScroll?: boolean,\n  /** amount of pixel the user need to scroll to dismiss the cookie banner */\n  dismissOnScrollThreshold?: number\n}\n\nexport type CookieBannerDefaultProps = {\n  onAccept: () => void,\n  dismissOnScroll: boolean,\n  cookies: Cookies,\n  cookie: string,\n  cookieExpiration: { years: number },\n  buttonMessage: string,\n  dismissOnScrollThreshold: number,\n  styles: object\n}\n\nexport type CookieBannerProps = BannerContentProps & CookieBannerRequiredProps & Partial<CookieBannerDefaultProps>;\n\nexport namespace CookieBanner {\n  export type Props = CookieBannerProps;\n}\n\ntype CookieBannerDefaultedProps = CookieBannerRequiredProps & CookieBannerDefaultProps;\n\nexport type State = {\n  listeningScroll: boolean\n}\n\n/**\n * React Cookie banner dismissable with just a scroll!\n */\nexport default class CookieBanner extends React.Component<CookieBanner.Props, State> {\n\n  static propTypes = {\n    ...BannerContentPropTypes,\n    children: PropTypes.oneOfType([\n      PropTypes.node,\n      PropTypes.func\n    ]),\n    onAccept: PropTypes.func,\n    cookies: PropTypes.instanceOf(Cookies),\n    cookie: PropTypes.string,\n    cookieExpiration: PropTypes.oneOfType([\n      PropTypes.number,\n      PropTypes.shape({\n        years: PropTypes.number,\n        days: PropTypes.number,\n        hours: PropTypes.number\n      })\n    ]),\n    cookiePath: PropTypes.string,\n    dismissOnScroll: PropTypes.bool,\n    dismissOnScrollThreshold: PropTypes.number\n  }\n\n  static defaultProps = {\n    onAccept: () => {},\n    dismissOnScroll: true,\n    cookies: new Cookies(),\n    cookie: 'accepts-cookies',\n    cookieExpiration: { years: 1 },\n    buttonMessage: 'Got it',\n    dismissOnScrollThreshold: 0,\n    styles: {}\n  };\n\n  state = { listeningScroll: false }\n\n  componentDidMount() {\n    this.addOnScrollListener();\n  }\n\n  addOnScrollListener = (props?: CookieBanner.Props) => {\n    const _props = props || this.props;\n    if (!this.state.listeningScroll && !this.hasAcceptedCookies() && _props.dismissOnScroll) {\n      if ((window as any).attachEvent) {\n        // Internet Explorer\n        (window as any).attachEvent('onscroll', this.onScroll);\n      } else if (window.addEventListener) {\n        window.addEventListener('scroll', this.onScroll, false);\n      }\n      this.setState({ listeningScroll: true });\n    }\n  }\n\n  removeOnScrollListener = () => {\n    if (this.state.listeningScroll) {\n      if ((window as any).detachEvent) {\n        // Internet Explorer\n        (window as any).detachEvent('onscroll', this.onScroll);\n      } else if (window.removeEventListener) {\n        window.removeEventListener('scroll', this.onScroll, false);\n      }\n      this.setState({ listeningScroll: false });\n    }\n  }\n\n  onScroll = () => {\n    // tacit agreement buahaha! (evil laugh)\n    const { dismissOnScrollThreshold } = this.props as CookieBannerDefaultedProps;\n    if (window.pageYOffset > dismissOnScrollThreshold) {\n      this.onAccept();\n    }\n  }\n\n  getSecondsSinceExpiration = (cookieExpiration: CookieBannerRequiredProps['cookieExpiration']) => {\n    if (typeof cookieExpiration === 'number') {\n      return cookieExpiration;\n    }\n\n    const SECONDS_IN_YEAR = 31536000;\n    const SECONDS_IN_DAY = 86400;\n    const SECONDS_IN_HOUR = 3600;\n\n    const _cookieExpiration = {\n      years: 0, days: 0, hours: 0,\n      ...cookieExpiration\n    };\n\n    const { years, days, hours } = _cookieExpiration;\n\n    return (years * SECONDS_IN_YEAR) + (days * SECONDS_IN_DAY) + (hours * SECONDS_IN_HOUR);\n  }\n\n  onAccept = () => {\n    const { cookies, cookie, cookieExpiration, cookiePath: path, onAccept } = this.props as CookieBannerDefaultedProps;\n\n    cookies.set(cookie, true, {\n      path,\n      expires: new Date(Date.now() + (this.getSecondsSinceExpiration(cookieExpiration) * 1000))\n    });\n\n    onAccept({ cookie });\n\n    if (this.state.listeningScroll) {\n      this.removeOnScrollListener();\n    } else {\n      this.forceUpdate();\n    }\n  }\n\n  hasAcceptedCookies() {\n    const { cookies, cookie } = this.props as CookieBannerDefaultedProps;\n    return cookies.get(cookie);\n  }\n\n  templateChildren(children: CookieBanner.Props['children'], onAccept: CookieBannerDefaultProps['onAccept']) {\n    if (typeof children === 'function') {\n      return children(onAccept);\n    }\n    return children;\n  }\n\n  render() {\n    const {\n      onAccept,\n      props: {\n        message, link, buttonMessage, closeIcon,\n        disableStyle, styles, className, children, dismissOnClick, ...props\n      }\n    } = this;\n\n    const hasAcceptedCookies = this.hasAcceptedCookies();\n    const bannerContentProps = {\n      ...omit(props, Object.keys(CookieBanner.propTypes)),\n      message, onAccept, link, buttonMessage,\n      closeIcon, disableStyle, styles, className, dismissOnClick,\n    };\n\n    if (hasAcceptedCookies) {\n      return null;\n    }\n\n    return children ?\n      this.templateChildren(children, onAccept) :\n      <BannerContent {...bannerContentProps} />;\n  }\n\n  componentDidUpdate() {\n    const { props } = this;\n\n    if (props.dismissOnScroll) {\n      this.addOnScrollListener(props);\n    } else {\n      this.removeOnScrollListener();\n    }\n  }\n\n  componentWillUnmount() {\n    this.removeOnScrollListener();\n  }\n\n}\n"
  },
  {
    "path": "src/CookieBannerUniversal.tsx",
    "content": "import * as React from 'react';\nimport { withCookies } from 'react-cookie';\nimport CookieBanner, { CookieBannerProps } from './CookieBanner';\n\nexport default withCookies<CookieBannerProps>(CookieBanner) as React.ComponentClass<CookieBannerProps>;\n"
  },
  {
    "path": "src/README.md",
    "content": "# CookieBanner\n\nReact Cookie banner dismissable with just a scroll!\n\n## Props\n|Name|Type|Default|Description|\n|----|----|-------|-----------|\n| **children** | <code>union(ReactChildren &#124; Function)</code> |  | *optional*. Custom component rendered if user has not accepted cookies |\n| **message** | <code>String</code> |  | *optional*. Message written inside default cookie banner |\n| **onAccept** | <code>Function</code> | <code>\"onAccept\"</code> | *optional*. Called when user accepts cookies |\n| **link** | <code>JSX.Element</code> |  | *optional*. JSX element to link to your cookie-policy page |\n| **buttonMessage** | <code>String</code> | <code>\"Got it\"</code> | *optional*. Message written inside the button of the default cookie banner |\n| **cookie** | <code>String</code> | <code>\"accepts-cookies\"</code> | *optional*. Cookie-key used to save user's decision about you cookie-policy |\n| **cookieExpiration** | <code>union(Integer &#124; {years: ?Number, days: ?Number, hours: ?Number})</code> | <code>{   \"years\": 1 }</code> | *optional*. Used to set the cookie expiration |\n| **cookiePath** | <code>String</code> |  | *optional*. Used to set the cookie path |\n| **dismissOnScroll** | <code>Boolean</code> | <code>true</code> | *optional*. Whether the cookie banner should be dismissed on scroll or not |\n| **dismissOnScrollThreshold** | <code>Number</code> | <code>0</code> | *optional*.   amount of pixel the user need to scroll to dismiss the cookie banner |\n| **closeIcon** | <code>String</code> |  | *optional*. ClassName passed to close-icon |\n| **disableStyle** | <code>Boolean</code> |  | *optional*. Pass `true` if you want to disable default style |\n| **styles** | <code>Object</code> | <code>{}</code> | *optional*. Object with custom styles used to overwrite default ones |\n| **className** | <code>String</code> |  | *optional*. Additional `className` for wrapper element |"
  },
  {
    "path": "src/index.ts",
    "content": "import CookieBanner from './CookieBanner';\nimport CookieBannerUniversal from './CookieBannerUniversal';\nimport BannerContent from './BannerContent';\n\nexport default CookieBanner;\nexport { Cookies, CookiesProvider } from 'react-cookie';\nexport { BannerContent, CookieBannerUniversal }\n"
  },
  {
    "path": "src/styleUtils.ts",
    "content": "\nconst styles = {\n  icon: {\n    background: 'none',\n    border: 'none',\n    boxShadow: 'none',\n    padding: '0',\n    position: 'absolute',\n    fontSize: '1em',\n    top: '50%',\n    marginTop: '-0.5em',\n    right: '1em',\n    color: 'white',\n    cursor: 'pointer'\n  },\n\n  link: {\n    color: '#F0F0F0',\n    textDecoration: 'underline',\n    marginLeft: '10px'\n  },\n\n  button: {\n    position: 'absolute',\n    top: '50%',\n    right: '35px',\n    lineHeight: '24px',\n    marginTop: '-12px',\n    padding: '0 8px',\n    backgroundColor: 'rgba(255, 255, 255, 0.6)',\n    border: 'none',\n    borderRadius: '3px',\n    boxShadow: 'none',\n    fontSize: '12px',\n    fontWeight: '500',\n    color: '#242424',\n    cursor: 'pointer'\n  },\n\n  message: {\n    lineHeight: '45px',\n    fontWeight: 500,\n    color: '#F0F0F0'\n  },\n\n  banner: {\n    position: 'relative',\n    textAlign: 'center',\n    backgroundColor: '#484848',\n    width: '100%',\n    height: '45px',\n    zIndex: '10000'\n  }\n};\n\nconst getStyle = (style: 'message' | 'banner' | 'link' | 'button' | 'icon') => styles[style];\n\nexport { getStyle };\n"
  },
  {
    "path": "styleguide/index.html",
    "content": "<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700' rel='stylesheet' type='text/css'>\n    <link rel=\"stylesheet\" href=\"https://i.icomoon.io/public/5ba04e2a5e/Showroom/style.css\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t</head>\n\t<body>\n\t\t<div id=\"app\"></div>\n\t</body>\n</html>\n"
  },
  {
    "path": "styleguide/setup.ts",
    "content": "import { Cookies, CookiesProvider } from 'react-cookie';\nimport { CookieBannerUniversal } from '../src';\n\nimport '../examples/examples.scss';\nimport '../examples/cookie.png';\n\n(global as any).cookies = new Cookies();\n(global as any).CookiesProvider = CookiesProvider;\n(global as any).Cookies = Cookies;\n(global as any).CookieBannerUniversal = CookieBannerUniversal;\n"
  },
  {
    "path": "styleguide.config.js",
    "content": "const path = require('path');\n\nmodule.exports = {\n  // build\n  serverPort: 8080,\n\n  require: [\n    // \"global\" setup + sass imports\n    path.resolve(__dirname, 'styleguide/setup.ts')\n  ],\n\n  // content\n  title: 'react-cookie-banner',\n  // assetsDir: 'styleguide/assets',\n  template: 'styleguide/index.html',\n  propsParser: require('react-docgen-typescript').parse, // detect docs using TS information\n  sections: [{\n    name: 'CookieBanner',\n    components: () => [path.resolve(__dirname, 'src/CookieBanner.tsx')]\n  }],\n  showCode: true,\n  showUsage: false, // show props by default\n  getExampleFilename() {\n    return path.resolve(__dirname, 'examples/Examples.md');\n  }\n};\n"
  },
  {
    "path": "test/setup.js",
    "content": "global.requestAnimationFrame = (callback) => {\n  setTimeout(callback, 0);\n};\n\nconst Enzyme = require('enzyme');\nconst Adapter = require('enzyme-adapter-react-16');\n\nEnzyme.configure({ adapter: new Adapter() });\n"
  },
  {
    "path": "test/tests/CookieBanner.test.tsx",
    "content": "import { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as React from 'react';\nimport { shallow, mount } from 'enzyme';\n\nimport CookieBanner from '../../src';\nimport { getStyle } from '../../src/styleUtils';\n\nfunction resetCookies() {\n  const cookies = document.cookie.split(';');\n\n  cookies.forEach(cookie => {\n    const eqPos = cookie.indexOf('=');\n    const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;\n    document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n  });\n};\n\nbeforeEach(resetCookies);\n\ndescribe('secondsSinceExpiration', () => {\n  const { getSecondsSinceExpiration } = new CookieBanner({ onAccept: () => {} });\n\n  it('should return \"cookieExpiration\" if it is an integer', () => {\n    expect(getSecondsSinceExpiration(12345)).toBe(12345);\n  });\n\n  it('should transform \"years\", \"days\" and \"hours\" into seconds', () => {\n    expect(getSecondsSinceExpiration({ years: 1, days: 10, hours: 5 })).toBe(32418000);\n  });\n\n  it('should handle missing \"years\", \"days\" or \"hours\"', () => {\n    expect(getSecondsSinceExpiration({ days: 10 })).toBe(864000);\n    expect(getSecondsSinceExpiration({})).toBe(0);\n  });\n\n});\n\ndescribe('CookieBanner', () => {\n\n  it('should be displayed if no cookies are set', () => {\n    const component = shallow(\n      <CookieBanner message='cookie message' onAccept={() => {}} />\n    );\n    expect(component).toMatchSnapshot();\n  });\n\n  it('should be displayed with correct default styles', () => {\n    const component = mount(\n      <CookieBanner message='cookie message' link={<a />} onAccept={() => {}} />\n    );\n\n    expect(component.find('.cookie-message').prop('style')).toEqual(getStyle('message'));\n    expect(component.find('.button-close').prop('style')).toEqual(getStyle('button'));\n    expect(component.find('a').prop('style')).toEqual(getStyle('link'));\n\n    const componentWithIcon = mount(\n      <CookieBanner closeIcon='icon' onAccept={() => {}} />\n    );\n\n    expect(componentWithIcon.find('.icon').length).toBe(1);\n    expect(componentWithIcon.find('button').prop('style')).toEqual(getStyle('icon'));\n  });\n\n  it('should hide on click', () => {\n    const component = mount(\n      <CookieBanner message='cookie message' onAccept={() => {}} />\n    );\n\n    expect(component.find('.react-cookie-banner')).toHaveLength(1);\n    component.find('.button-close').simulate('click');\n    expect(component.find('.react-cookie-banner')).toHaveLength(0);\n  });\n\n  it('should hide on click when dismissOnScroll is false', () => {\n    const component = mount(\n      <CookieBanner message='cookie message' onAccept={() => {}} dismissOnScroll={false} />\n    );\n\n    expect(component.find('.react-cookie-banner')).toHaveLength(1);\n    component.find('.button-close').simulate('click');\n    expect(component.find('.react-cookie-banner')).toHaveLength(0);\n  });\n\n  it('should be displayed with correct message', () => {\n    const component = mount(\n      <CookieBanner message='cookie message' onAccept={() => {}} />\n    );\n\n    expect(component.find('.cookie-message').text()).toBe('cookie message');\n  });\n\n  it('should be displayed with correct link element', () => {\n    const children = 'children!'\n    const component = mount(\n      <CookieBanner link={<a className='cookie-link'>{children}</a>} onAccept={() => {}} />\n    );\n\n    const cookieBanner = component.find('.cookie-link');\n    expect(cookieBanner.text()).toBe(children);\n  });\n\n  it('should not overwrite link\\'s style props, if present', () => {\n    const style = { color: 'red' }\n    const component = mount(\n      <CookieBanner link={<a style={style} className='cookie-link' />} onAccept={() => {}} />\n    );\n\n    const cookieBanner = component.find('.cookie-link');\n    expect(cookieBanner.prop('style')).toEqual(style);\n  });\n\n  it('should be displayed with correct link element', () => {\n    const children = 'children!'\n    const component = mount(\n      <CookieBanner link={<a className='cookie-link'>{children}</a>} onAccept={() => {}} />\n    );\n\n    expect(component.find('.cookie-link').text()).toBe(children);\n  });\n\n  it('should be replaced with custom child component', () => {\n    const MyComponent = () => (\n      <div className='my-component' />\n    );\n\n    const component = mount(\n      <CookieBanner message='cookie message' onAccept={() => {}}>\n        <MyComponent />\n      </CookieBanner>\n    );\n\n    expect(component.find('.my-component')).toHaveLength(1);\n  });\n\n  it('should be replaced with custom child component using function', () => {\n    const MyOtherComponent = ({ onAccept }) => (\n      <div className='my-other-component' onClick={onAccept} />\n    );\n\n    const customTrigger = onAccept => <MyOtherComponent onAccept={onAccept} />;\n\n    const component = mount(\n      <CookieBanner onAccept={() => {}}>\n        {customTrigger}\n      </CookieBanner>\n    );\n\n    expect(component.find('.my-other-component')).toHaveLength(1);\n  });\n\n});\n\ndescribe('build', () => {\n\n  it('build script generates every needed file', () => {\n    execSync('npm run build')\n    expect(fs.readdirSync(path.resolve(__dirname, '../../lib'))).toMatchSnapshot()\n  })\n\n})\n"
  },
  {
    "path": "test/tests/__snapshots__/CookieBanner.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`CookieBanner should be displayed if no cookies are set 1`] = `\nShallowWrapper {\n  Symbol(enzyme.__root__): [Circular],\n  Symbol(enzyme.__unrendered__): <CookieBanner\n    buttonMessage=\"Got it\"\n    cookie=\"accepts-cookies\"\n    cookieExpiration={\n      Object {\n        \"years\": 1,\n      }\n    }\n    cookies={\n      Cookies {\n        \"HAS_DOCUMENT_COOKIE\": true,\n        \"changeListeners\": Array [],\n        \"cookies\": Object {},\n        \"hooks\": undefined,\n      }\n    }\n    dismissOnScroll={true}\n    dismissOnScrollThreshold={0}\n    message=\"cookie message\"\n    onAccept={[Function]}\n    styles={Object {}}\n  />,\n  Symbol(enzyme.__renderer__): Object {\n    \"batchedUpdates\": [Function],\n    \"checkPropTypes\": [Function],\n    \"getNode\": [Function],\n    \"render\": [Function],\n    \"simulateError\": [Function],\n    \"simulateEvent\": [Function],\n    \"unmount\": [Function],\n  },\n  Symbol(enzyme.__node__): Object {\n    \"instance\": null,\n    \"key\": undefined,\n    \"nodeType\": \"class\",\n    \"props\": Object {\n      \"buttonMessage\": \"Got it\",\n      \"className\": undefined,\n      \"closeIcon\": undefined,\n      \"disableStyle\": undefined,\n      \"dismissOnClick\": undefined,\n      \"link\": undefined,\n      \"message\": \"cookie message\",\n      \"onAccept\": [Function],\n      \"styles\": Object {},\n    },\n    \"ref\": null,\n    \"rendered\": null,\n    \"type\": [Function],\n  },\n  Symbol(enzyme.__nodes__): Array [\n    Object {\n      \"instance\": null,\n      \"key\": undefined,\n      \"nodeType\": \"class\",\n      \"props\": Object {\n        \"buttonMessage\": \"Got it\",\n        \"className\": undefined,\n        \"closeIcon\": undefined,\n        \"disableStyle\": undefined,\n        \"dismissOnClick\": undefined,\n        \"link\": undefined,\n        \"message\": \"cookie message\",\n        \"onAccept\": [Function],\n        \"styles\": Object {},\n      },\n      \"ref\": null,\n      \"rendered\": null,\n      \"type\": [Function],\n    },\n  ],\n  Symbol(enzyme.__options__): Object {\n    \"adapter\": ReactSixteenAdapter {\n      \"options\": Object {\n        \"enableComponentDidUpdateOnSetState\": true,\n        \"legacyContextMode\": \"parent\",\n        \"lifecycles\": Object {\n          \"componentDidUpdate\": Object {\n            \"onSetState\": true,\n          },\n          \"getChildContext\": Object {\n            \"calledByRenderer\": false,\n          },\n          \"getDerivedStateFromError\": true,\n          \"getDerivedStateFromProps\": Object {\n            \"hasShouldComponentUpdateBug\": false,\n          },\n          \"getSnapshotBeforeUpdate\": true,\n          \"setState\": Object {\n            \"skipsComponentDidUpdateOnNullish\": true,\n          },\n        },\n      },\n    },\n    Symbol(enzyme.__providerValues__): undefined,\n  },\n  Symbol(enzyme.__providerValues__): Map {},\n  Symbol(enzyme.__childContext__): null,\n}\n`;\n\nexports[`build build script generates every needed file 1`] = `\nArray [\n  \"BannerContent.d.ts\",\n  \"BannerContent.js\",\n  \"CookieBanner.d.ts\",\n  \"CookieBanner.js\",\n  \"CookieBannerUniversal.d.ts\",\n  \"CookieBannerUniversal.js\",\n  \"index.d.ts\",\n  \"index.js\",\n  \"styleUtils.d.ts\",\n  \"styleUtils.js\",\n]\n`;\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES3\",\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"allowSyntheticDefaultImports\": false,\n    \"allowJs\": false,\n    \"experimentalDecorators\": true,\n    \"outDir\": \"./lib\",\n    \"baseUrl\": \".\",\n    \"noImplicitAny\": true,\n    \"suppressImplicitAnyIndexErrors\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"strictNullChecks\": true,\n    \"sourceMap\": false,\n    \"alwaysStrict\": true,\n    \"jsx\": \"react\",\n    \"lib\": [\n      \"dom\", \"es6\"\n    ]\n  },\n  \"include\": [\n    \"src/*\",\n    \"typings\"\n  ]\n}\n"
  },
  {
    "path": "typings/react-cookie.d.ts",
    "content": "// react-cookies typings are in WIP... copied the following from https://github.com/reactivestack/cookies/issues/107\n\ndeclare module 'react-cookie' {\n  import { Component, ComponentClass } from 'react';\n\n  export type Cookie = string;\n\n  export class CookiesProvider extends Component<{},{}>{}\n\n  export function withCookies<T>(Component: ComponentClass): ComponentClass<T>;\n\n  export interface ReactCookieGetOptions{\n    doNotParse?: boolean;\n  }\n\n  export interface ReactCookieGetAllOptions{\n    doNotParse?: boolean;\n  }\n\n  export interface ReactCookieSetOptions{\n    path?: string;\n    expires?: Date;\n    maxAge?: number;\n    domain?: string;\n    secure?: boolean;\n    httpOnly?: boolean;\n  }\n\n  export interface ReactCookieRemoveOptions{\n    path?: string;\n    expires?: Date;\n    maxAge?: number;\n    domain?: string;\n    secure?: boolean;\n    httpOnly?: boolean;\n  }\n\n  export class Cookies {\n    get: (key: string, options?: ReactCookieGetOptions) => Cookie | undefined;\n    getAll: (options?: ReactCookieGetAllOptions) => Cookie[];\n    set(name: string, value: any, options?: ReactCookieSetOptions): void;\n    remove(name: string, options?: ReactCookieRemoveOptions): void;\n  }\n}\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const path = require('path');\nconst ProgressBarPlugin = require('progress-bar-webpack-plugin');\n\nmodule.exports = {\n  resolve: {\n    extensions: ['.js', '.jsx', '.ts', '.tsx', '.json']\n  },\n  plugins: [\n    new ProgressBarPlugin()\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.[jt]sx?$/,\n        include: [\n          path.resolve(__dirname, 'src'),\n          path.resolve(__dirname, 'styleguide')\n        ],\n        use: [\n          {\n            loader: 'babel-loader',\n            options: {\n              presets: [['buildo', { env: 'react' }]]\n            }\n          },\n          {\n            loader: 'ts-loader',\n            options: {\n              configFile: require('path').resolve(__dirname, 'tsconfig.json')\n            }\n          }\n        ]\n      },\n      {\n        test: /\\.css$/,\n        loader: [\n          'style-loader',\n          { loader: 'css-loader', options: { modules: true } }\n        ]\n      },\n      {\n        test: /\\.scss$/,\n        use: ['style-loader', 'css-loader', 'sass-loader']\n      },\n      {\n        test: /\\.(png|jpg|gif)$/,\n        loader: 'file-loader',\n        options: {\n          name: '[name].[ext]'\n        }\n      }\n    ]\n  }\n};\n"
  }
]