[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"browsers\": \"last 2 versions\"\n      }\n    }],\n    \"stage-2\"\n  ],\n  \"plugins\": [\"transform-flow-strip-types\"]\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent\n# coding styles between different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n[*]\n\n# Change these settings to your own preference\nindent_style = space\nindent_size = 2\n\n# We recommend you to keep these unchanged\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"parser\": \"babel-eslint\",\n  \"extends\": [\n    \"airbnb-base\",\n    \"plugin:flowtype/recommended\"\n  ],\n  \"plugins\": [\n    \"flowtype\",\n    \"flowtype-errors\"\n  ],\n  \"env\": {\n    \"jest\": true\n  },\n  \"rules\": {\n    \"semi\": [2, never],\n    \"comma-dangle\": 0,\n    \"flowtype-errors/show-errors\": 2,\n    \"import/prefer-default-export\": 0\n  }\n}\n"
  },
  {
    "path": ".flowconfig",
    "content": "[ignore]\n.*/dist\n.*/coverage\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\n*.js text eol=lf\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\nnode_modules\ncoverage\ndist\n*.log\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - v6\nscript:\n  - npm run lint && npm test -- --coverage\nafter_success:\n  - bash <(curl -s https://codecov.io/bash)\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Diego Haz\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"
  },
  {
    "path": "README.md",
    "content": "# styled-theme 💅🏿\n\n[![Generated with nod](https://img.shields.io/badge/generator-nod-2196F3.svg?style=flat-square)](https://github.com/diegohaz/nod)\n[![NPM version](https://img.shields.io/npm/v/styled-theme.svg?style=flat-square)](https://npmjs.org/package/styled-theme)\n[![Build Status](https://img.shields.io/travis/diegohaz/styled-theme/master.svg?style=flat-square)](https://travis-ci.org/diegohaz/styled-theme) [![Coverage Status](https://img.shields.io/codecov/c/github/diegohaz/styled-theme/master.svg?style=flat-square)](https://codecov.io/gh/diegohaz/styled-theme/branch/master)\n\nTheming system for [styled-components 💅](https://github.com/styled-components/styled-components)\n\n## Install\n\n    $ npm install --save styled-theme\n\n## Usage\n\nPlay with it on [WebpackBin](https://www.webpackbin.com/bins/-KeZfaFl3_761CAGa0CC)\n```js\nimport styled from 'styled-components'\nimport { font, palette } from 'styled-theme' \n\nconst Text = styled.span`\n  font-family: ${font('primary')};\n  background-color: ${palette(1)};\n  color: ${palette('grayscale', 0, true)};\n`\n\nText.defaultProps = {\n  palette: 'primary'\n}\n```\n\n```jsx\n<Text>Hello</Text>\n```\n\n![image](https://cloud.githubusercontent.com/assets/3068563/21835155/f92c4a74-d7a1-11e6-85c1-93d6e447f98a.png)\n\n```jsx\n<Text reverse>Hello</Text>\n```\n\n![image](https://cloud.githubusercontent.com/assets/3068563/21835169/18b3ea28-d7a2-11e6-8f3f-2fc76c706f45.png)\n\n```jsx\n<Text palette=\"secondary\">Hello</Text>\n```\n\n![image](https://cloud.githubusercontent.com/assets/3068563/21835195/350f4514-d7a2-11e6-9095-4e30d04b3d61.png)\n\n### Provide your own theme\n\n```jsx\nimport { ThemeProvider } from 'styled-components'\n\nconst xmasTheme = {\n  fonts: {\n    primary: 'Georgia, serif'\n  },\n  palette: {\n    // red gradient\n    primary: ['#D32F2F', '#F44336', '#F8877F', '#FFCDD2']\n  }\n}\n\n<ThemeProvider theme={xmasTheme}>\n  <Text>Hello</Text>\n</ThemeProvider>\n```\n\n![image](https://cloud.githubusercontent.com/assets/3068563/21835499/a49b94bc-d7a4-11e6-9cf3-ab41519cd962.png)\n\n## Default theme structure\n\nThis is the content of [`src/theme.js`](src/theme.js):\n\n```js\nimport coolorsToHex from 'coolors-to-hex'\nimport { reversePalette } from './composer'\n\nconst theme = {}\n\ntheme.palette = {\n  primary: coolorsToHex('https://coolors.co/1976d2-2196f3-71bcf7-97cef9-c2e2fb'),\n  secondary: coolorsToHex('https://coolors.co/c2185b-e91e63-f06292-f48caf-f8bbd0'),\n  danger: coolorsToHex('https://coolors.co/d32f2f-f44336-f8877f-f9a7a1-ffcdd2'),\n  alert: coolorsToHex('https://coolors.co/ffa000-ffc107-ffd761-ffecb3-fff2ce'),\n  success: coolorsToHex('https://coolors.co/388e3c-4caf50-7cc47f-9fd4a1-c8e6c9'),\n  grayscale: ['#212121', '#616161', '#9e9e9e', '#bdbdbd', '#e0e0e0', '#ffffff']\n}\n\ntheme.reversePalette = reversePalette(theme.palette)\n\ntheme.fonts = {\n  primary: 'Helvetica Neue, Helvetica, Roboto, sans-serif',\n  pre: 'Consolas, Liberation Mono, Menlo, Courier, monospace',\n  quote: 'Georgia, serif'\n}\n\ntheme.sizes = {\n  maxWidth: '1100px'\n}\n\nexport default theme\n```\n\n[`reversePalette`](#reversePalette) is a helper method. Import it from `styled-theme/composer`.\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### reversePalette\n\nRevert the palette\n\n**Parameters**\n\n-   `palette` **[Palette](#palette)** \n\n**Examples**\n\n```javascript\nreversePalette({ primary: ['red', 'yellow', 'green'] })\n// { primary: ['green', 'yellow', 'red'] }\n```\n\nReturns **[Palette](#palette)** \n\n### key\n\nReturns the value of `props.theme[path]` or `styledTheme[path]`\n\n**Parameters**\n\n-   `path` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)** \n-   `defaultValue` **any** \n\n**Examples**\n\n```javascript\nconst Button = styled.button`\n font-family: ${key('fonts.primary')};\n color: ${key(['colors', 'primary', 0])};\n`\n```\n\nReturns **any** \n\n### font\n\nShorthand to `key(['fonts', path])`\n\n**Parameters**\n\n-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n-   `defaultValue` **any** \n\n**Examples**\n\n```javascript\nconst Button = styled.button`\n font-family: ${font('primary')};\n`\n```\n\nReturns **[Font](#font)** \n\n### size\n\nShorthand to `key(['sizes', path])`\n\n**Parameters**\n\n-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n-   `defaultValue` **any** \n\n**Examples**\n\n```javascript\nconst Button = styled.button`\n padding: ${size('padding')};\n`\n```\n\nReturns **[Size](#size)** \n\n### palette\n\nReturns the value of `props.theme[palette || reversePalette][path][index]` or\n`styledTheme[palette || reversePalette][path][index]` (default theme)\n\nThe arguments can be passed in any order, as long as types are kept.\n\n**Parameters**\n\n-   `index` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of tone in theme palette tones array\n-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The key of the tones in theme palette object (optional, default `props.palette`)\n-   `exceptions` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** An object with path as key and index as value\n-   `reverse` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Flag to return tone from `reversePalette` or `palette`\n-   `defaultValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Default value\n-   `args` **...any** \n\n**Examples**\n\n```javascript\n// index = 1\n// exception = { grayscale: 0 }\n// reverse = true\nconst Button = styled.button`\n background-color: ${palette({ grayscale: 0 }, 1, true)};\n`\n\n// renders props.theme.reversePalette.grayscale[0]\n<Button palette=\"grayscale\" />\n\n// renders props.theme.palette.danger[1] (nullify reverse)\n<Button palette=\"danger\" reverse />\n```\n\nReturns **[Tones](#tones)** \n\n### Tone\n\nType: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n### Tones\n\nType: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Tone](#tone)>\n\n### Font\n\nType: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n### Size\n\nType: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n### Palette\n\nType: {}\n\n### Fonts\n\nType: {}\n\n### Sizes\n\nType: {}\n\n### Theme\n\nType: {palette: [Palette](#palette)?, reversePalette: [Palette](#palette)?, fonts: [Fonts](#fonts)?, sizes: [Sizes](#sizes)?}\n\n## Related\n\n-   [styled-tools](https://github.com/diegohaz/styled-tools) - Utilities for styled-components (like lodash)\n\n## License\n\nMIT © [Diego Haz](https://github.com/diegohaz)\n"
  },
  {
    "path": "_config.yml",
    "content": "theme: jekyll-theme-cayman"
  },
  {
    "path": "composer.js",
    "content": "module.exports = require('./dist/composer')\n"
  },
  {
    "path": "index.js",
    "content": "module.exports = require('./dist')\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"styled-theme\",\n  \"version\": \"0.3.3\",\n  \"description\": \"Theming system for styled-components\",\n  \"license\": \"MIT\",\n  \"repository\": \"diegohaz/styled-theme\",\n  \"main\": \"index.js\",\n  \"author\": {\n    \"name\": \"Diego Haz\",\n    \"email\": \"hazdiego@gmail.com\",\n    \"url\": \"github.com/diegohaz\"\n  },\n  \"files\": [\n    \"dist\",\n    \"index.js\",\n    \"composer.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest\",\n    \"coverage\": \"npm test -- --coverage\",\n    \"postcoverage\": \"opn coverage/lcov-report/index.html\",\n    \"lint\": \"eslint src test\",\n    \"flow\": \"flow check\",\n    \"docs\": \"documentation readme src --section=API\",\n    \"clean\": \"del dist\",\n    \"prebuild\": \"npm run docs && npm run clean\",\n    \"build\": \"babel src -d dist\",\n    \"watch\": \"npm-watch\",\n    \"patch\": \"npm version patch && npm publish\",\n    \"minor\": \"npm version minor && npm publish\",\n    \"major\": \"npm version major && npm publish\",\n    \"prepublish\": \"npm run lint && npm test && npm run build\",\n    \"postpublish\": \"git push origin master --follow-tags\"\n  },\n  \"watch\": {\n    \"test\": \"{src,test}/*.js\",\n    \"lint\": \"{src,test}/*.js\",\n    \"build\": \"src\"\n  },\n  \"jest\": {\n    \"testRegex\": \"/test/.*\",\n    \"testEnvironment\": \"node\"\n  },\n  \"keywords\": [\n    \"styled-components\",\n    \"styled\",\n    \"style\",\n    \"theme\",\n    \"theming\"\n  ],\n  \"dependencies\": {\n    \"coolors-to-hex\": \"^1.0.0\",\n    \"styled-tools\": \"^0.1.4\"\n  },\n  \"devDependencies\": {\n    \"babel-cli\": \"^6.18.0\",\n    \"babel-eslint\": \"^7.1.1\",\n    \"babel-jest\": \"^20.0.2\",\n    \"babel-plugin-transform-flow-strip-types\": \"^6.21.0\",\n    \"babel-preset-env\": \"^1.1.8\",\n    \"babel-preset-stage-2\": \"^6.18.0\",\n    \"del-cli\": \"^1.0.0\",\n    \"documentation\": \"4.0.0-rc.0\",\n    \"eslint\": \"^3.14.0\",\n    \"eslint-config-airbnb-base\": \"^11.0.1\",\n    \"eslint-plugin-flowtype\": \"^2.29.2\",\n    \"eslint-plugin-flowtype-errors\": \"^3.0.0\",\n    \"eslint-plugin-import\": \"^2.2.0\",\n    \"flow-bin\": \"^0.50.0\",\n    \"jest-cli\": \"^20.0.2\",\n    \"npm-watch\": \"^0.2.0\",\n    \"opn-cli\": \"^3.1.0\"\n  }\n}\n"
  },
  {
    "path": "src/composer.js",
    "content": "// @flow\nimport type { Palette } from './types'\n\n/**\n * Revert the palette\n * @example\n * reversePalette({ primary: ['red', 'yellow', 'green'] })\n * // { primary: ['green', 'yellow', 'red'] }\n */\nexport const reversePalette = (palette: Palette): Palette =>\n  Object.keys(palette).reduce((newPalette, key) => ({\n    ...newPalette,\n    [key]: [...palette[key]].reverse()\n  }), {})\n"
  },
  {
    "path": "src/index.js",
    "content": "// @flow\nimport { prop } from 'styled-tools'\nimport theme from './theme'\nimport type { Theme, Tones, Font, Size } from './types'\n\ntype Props = {\n  theme?: Theme,\n  palette?: string,\n  reverse?: boolean\n}\n\n/**\n * Returns the value of `props.theme[path]` or `styledTheme[path]`\n * @example\n * const Button = styled.button`\n *  font-family: ${key('fonts.primary')};\n *  color: ${key(['colors', 'primary', 0])};\n * `\n */\nexport const key = (path: string | string[], defaultValue?: any): any =>\n  (props: Props = {}): any => prop(path, prop(path, defaultValue)(theme))(props.theme)\n\n/**\n * Shorthand to `key(['fonts', path])`\n * @example\n * const Button = styled.button`\n *  font-family: ${font('primary')};\n * `\n */\nexport const font = (path: string, defaultValue?: any): Font =>\n  key(['fonts', path], defaultValue)\n\n/**\n * Shorthand to `key(['sizes', path])`\n * @example\n * const Button = styled.button`\n *  padding: ${size('padding')};\n * `\n */\nexport const size = (path: string, defaultValue?: any): Size =>\n  key(['sizes', path], defaultValue)\n\n/**\n * Returns the value of `props.theme[palette || reversePalette][path][index]` or\n * `styledTheme[palette || reversePalette][path][index]` (default theme)\n *\n * The arguments can be passed in any order, as long as types are kept.\n * @param {number} index The index of tone in theme palette tones array\n * @param {string} [path=props.palette] The key of the tones in theme palette object\n * @param {Object} [exceptions] An object with path as key and index as value\n * @param {boolean} [reverse] Flag to return tone from `reversePalette` or `palette`\n * @param {string} [defaultValue] Default value\n * @example\n * // index = 1\n * // exception = { grayscale: 0 }\n * // reverse = true\n * const Button = styled.button`\n *  background-color: ${palette({ grayscale: 0 }, 1, true)};\n * `\n *\n * // renders props.theme.reversePalette.grayscale[0]\n * <Button palette=\"grayscale\" />\n *\n * // renders props.theme.palette.danger[1] (nullify reverse)\n * <Button palette=\"danger\" reverse />\n * @returns {Tones}\n */\n// eslint-disable-next-line flowtype-errors/show-errors\nexport const palette = (...args) => (props: Props = {}): Tones => {\n  const exceptions = args.find(arg => typeof arg === 'object') || {}\n  const path = args.find(arg => typeof arg === 'string') || props.palette\n  const defaultValue = [...args].reverse().find(arg => typeof arg === 'string')\n  let index = args.find(arg => typeof arg === 'number')\n  let reverse = args.find(arg => typeof arg === 'boolean')\n  reverse = reverse ? !props.reverse : props.reverse\n\n  if (typeof index === 'undefined') {\n    throw new Error('[palette] You must pass index')\n  }\n  if (typeof path === 'undefined') {\n    throw new Error('[palette] You must pass palette path')\n  }\n\n  if (Object.keys(exceptions).indexOf(path) >= 0) {\n    index = exceptions[path]\n  }\n\n  const palettePath = reverse ? 'reversePalette' : 'palette'\n  return key([palettePath, path, index], defaultValue !== path && defaultValue)(props)\n}\n"
  },
  {
    "path": "src/theme.js",
    "content": "// @flow\nimport coolorsToHex from 'coolors-to-hex'\nimport { reversePalette } from './composer'\nimport type { Theme } from './types'\n\nconst theme: Theme = {}\n\ntheme.palette = {\n  primary: coolorsToHex('https://coolors.co/1976d2-2196f3-71bcf7-97cef9-c2e2fb'),\n  secondary: coolorsToHex('https://coolors.co/c2185b-e91e63-f06292-f48caf-f8bbd0'),\n  danger: coolorsToHex('https://coolors.co/d32f2f-f44336-f8877f-f9a7a1-ffcdd2'),\n  alert: coolorsToHex('https://coolors.co/ffa000-ffc107-ffd761-ffecb3-fff2ce'),\n  success: coolorsToHex('https://coolors.co/388e3c-4caf50-7cc47f-9fd4a1-c8e6c9'),\n  grayscale: ['#212121', '#616161', '#9e9e9e', '#bdbdbd', '#e0e0e0', '#ffffff']\n}\n\ntheme.reversePalette = reversePalette(theme.palette)\n\ntheme.fonts = {\n  primary: 'Helvetica Neue, Helvetica, Roboto, sans-serif',\n  pre: 'Consolas, Liberation Mono, Menlo, Courier, monospace',\n  quote: 'Georgia, serif'\n}\n\ntheme.sizes = {\n  maxWidth: '1100px'\n}\n\nexport default theme\n"
  },
  {
    "path": "src/types.js",
    "content": "// @flow\n/** */\nexport type Tone = string\n\n/** */\nexport type Tones = Array<Tone>\n\n/** */\nexport type Font = string\n\n/** */\nexport type Size = string\n\n/** */\nexport type Palette = {[string]: Tones}\n\n/** */\nexport type Fonts = {[string]: Font}\n\n/** */\nexport type Sizes = {[string]: Size}\n\n/** */\nexport type Theme = {\n  palette?: Palette,\n  reversePalette?: Palette,\n  fonts?: Fonts,\n  sizes?: Sizes\n}\n"
  },
  {
    "path": "test/composer.js",
    "content": "import { reversePalette } from '../src/composer'\n\ntest('reversePalette', () => {\n  const palette = {\n    key1: [1, 2, 3],\n    key2: [3, 2, 1]\n  }\n  expect(reversePalette(palette)).toEqual({\n    key1: [3, 2, 1],\n    key2: [1, 2, 3]\n  })\n})\n"
  },
  {
    "path": "test/index.js",
    "content": "import theme from '../src/theme'\nimport { key, font, palette, size } from '../src'\n\ndescribe('key', () => {\n  const theme2 = {\n    foo: 'bar'\n  }\n\n  it('returns value from theme when no anotherTheme was passed in', () => {\n    expect(key('palette')()).toBe(theme.palette)\n  })\n\n  it('returns value from anotherTheme when passed in', () => {\n    expect(key('foo')({ theme: theme2 })).toBe(theme2.foo)\n  })\n\n  it('returns defaultValue', () => {\n    expect(key('foo', 'baz')()).toBe('baz')\n  })\n})\n\ndescribe('size', () => {\n  const theme2 = {\n    sizes: {\n      foo: 'bar'\n    }\n  }\n\n  it('returns value from theme when no anotherTheme was passed in', () => {\n    expect(size('maxWidth')()).toBe(theme.sizes.maxWidth)\n  })\n\n  it('returns value from anotherTheme when passed in', () => {\n    expect(size('foo')({ theme: theme2 })).toBe(theme2.sizes.foo)\n  })\n\n  it('returns defaultValue', () => {\n    expect(size('foo', 'baz')()).toBe('baz')\n  })\n})\n\ndescribe('font', () => {\n  const theme2 = {\n    fonts: {\n      foo: 'bar',\n      pre: 'test'\n    }\n  }\n\n  it('returns default font when no anotherTheme was passed in', () => {\n    expect(font('primary')()).toBe(theme.fonts.primary)\n  })\n\n  it('returns default font when it does not exist on anotherTheme', () => {\n    expect(font('primary')({ theme: theme2 })).toBe(theme.fonts.primary)\n    expect(font('quote')({ theme: theme2 })).toBe(theme.fonts.quote)\n  })\n\n  it('returns anotherTheme font when it exists', () => {\n    expect(font('foo')({ theme: theme2 })).toBe(theme2.fonts.foo)\n    expect(font('pre')({ theme: theme2 })).toBe(theme2.fonts.pre)\n  })\n\n  it('returns defaultValue', () => {\n    expect(font('foo', 'baz')()).toBe('baz')\n  })\n})\n\ndescribe('palette', () => {\n  const theme2 = {\n    palette: {\n      foo: ['bar', 'baz']\n    },\n    reversePalette: {\n      foo: ['baz', 'bar']\n    }\n  }\n\n  it('throws when no index was passed in', () => {\n    expect(() => palette()({ theme: theme2, palette: 'primary' })).toThrow()\n  })\n\n  it('throws when no palette was passed in', () => {\n    expect(() => palette(0)({ theme: theme2 })).toThrow()\n  })\n\n  it('returns palette at index when palette was passed in with props', () => {\n    expect(palette(0)({ theme: theme2, palette: 'primary' })).toBe(theme.palette.primary[0])\n    expect(palette(0)({ theme: theme2, palette: 'foo' })).toBe(theme2.palette.foo[0])\n    expect(palette(0)({ theme: theme2, palette: 'danger', reverse: true }))\n      .toBe(theme.reversePalette.danger[0])\n  })\n\n  it('returns palette at index when palette was passed in with args ignoring props', () => {\n    expect(palette('danger', 1)()).toBe(theme.palette.danger[1])\n    expect(palette('danger', 1)({ theme: theme2 })).toBe(theme.palette.danger[1])\n    expect(palette('danger', 1)({ theme: theme2, palette: 'foo' })).toBe(theme.palette.danger[1])\n    expect(palette('danger', 1)({ theme: theme2, reverse: true }))\n      .toBe(theme.reversePalette.danger[1])\n  })\n\n  it('returns palette at proper index when exception was passed in', () => {\n    expect(palette(1, { danger: 0 })({ theme: theme2, palette: 'foo' })).toBe(theme2.palette.foo[1])\n    expect(palette(1, { danger: 0 })({ theme: theme2, palette: 'danger' }))\n      .toBe(theme.palette.danger[0])\n  })\n\n  it('returns reverse palette when true argument is passed in', () => {\n    expect(palette(1, true)({ theme: theme2, palette: 'foo' })).toBe(theme2.reversePalette.foo[1])\n    expect(palette(1, true)({ theme: theme2, palette: 'foo', reverse: true }))\n      .toBe(theme2.palette.foo[1])\n    expect(palette(1, true)({ theme: theme2, palette: 'danger' }))\n      .toBe(theme.reversePalette.danger[1])\n  })\n\n  it('returns defaultValue', () => {\n    expect(palette('foo', 1, 'red')()).toBe('red')\n    expect(palette('foo', 1, 'red')({ theme: theme2 })).toBe(theme2.palette.foo[1])\n  })\n})\n"
  }
]