├── .travis.yml ├── .gitignore ├── .eslintrc ├── postcss.config.js ├── .storybook ├── addons.js ├── config.js ├── .babelrc └── webpack.config.js ├── floating-label-input.gif ├── coverage ├── lcov-report │ ├── sort-arrow-sprite.png │ ├── prettify.css │ ├── millisecondsUntil.js.html │ ├── lunchtime.js.html │ ├── main.js.html │ ├── index.html │ ├── sorter.js │ ├── base.css │ └── prettify.js ├── lcov.info ├── clover.xml └── coverage-final.json ├── .flowconfig ├── test ├── .enzyme.js └── test.js ├── flow-typed └── npm │ ├── flow-bin_v0.x.x.js │ ├── babel-jest_vx.x.x.js │ ├── babel-preset-flow_vx.x.x.js │ ├── babel-preset-react_vx.x.x.js │ ├── jest-css-modules_vx.x.x.js │ ├── babelrc-rollup_vx.x.x.js │ ├── babel-preset-es2015_vx.x.x.js │ ├── rollup-plugin-postcss_vx.x.x.js │ ├── eslint-config-simenb-flow_vx.x.x.js │ ├── babel-plugin-external-helpers_vx.x.x.js │ ├── babel-plugin-transform-react-jsx_vx.x.x.js │ ├── rollup_vx.x.x.js │ ├── postcss-modules_vx.x.x.js │ ├── rollup-plugin-node-resolve_vx.x.x.js │ ├── eslint-config-prettier_vx.x.x.js │ ├── enzyme-to-json_vx.x.x.js │ ├── enzyme-adapter-react-16_vx.x.x.js │ ├── rollup-plugin-babel_vx.x.x.js │ ├── prettier_vx.x.x.js │ ├── rollup-plugin-commonjs_vx.x.x.js │ ├── eslint-config-airbnb-base_vx.x.x.js │ ├── enzyme_v3.x.x.js │ ├── babel-core_vx.x.x.js │ ├── eslint-plugin-import_vx.x.x.js │ └── jest_v21.x.x.js ├── .babelrc ├── LICENSE.md ├── rollup.config.js ├── stories └── index.js ├── README.md ├── src └── main.js └── package.json /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '9' 4 | - '8' 5 | - '6' 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | dist/ 4 | storybook-static/ 5 | .vscode/ 6 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "simenb-flow", 3 | "env": { 4 | "jest": true 5 | } 6 | } -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'autoprefixer': {}, 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addon-actions/register'; 2 | import '@storybook/addon-links/register'; 3 | -------------------------------------------------------------------------------- /floating-label-input.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cymen/react-floating-label-input/HEAD/floating-label-input.gif -------------------------------------------------------------------------------- /coverage/lcov-report/sort-arrow-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cymen/react-floating-label-input/HEAD/coverage/lcov-report/sort-arrow-sprite.png -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | [include] 4 | 5 | [libs] 6 | flow-typed 7 | 8 | [lints] 9 | 10 | [options] 11 | module.file_ext=.scss 12 | 13 | [strict] 14 | -------------------------------------------------------------------------------- /.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure } from '@storybook/react'; 2 | 3 | function loadStories() { 4 | require('../stories'); 5 | } 6 | 7 | configure(loadStories, module); 8 | -------------------------------------------------------------------------------- /test/.enzyme.js: -------------------------------------------------------------------------------- 1 | import 'raf/polyfill'; 2 | 3 | import { configure } from 'enzyme'; 4 | import Adapter from 'enzyme-adapter-react-16'; 5 | 6 | configure({ adapter: new Adapter() }); -------------------------------------------------------------------------------- /flow-typed/npm/flow-bin_v0.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 67b0c3a16b2d6f8ef0a31a5745a0b3e1 2 | // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x 3 | 4 | declare module "flow-bin" { 5 | declare module.exports: string; 6 | } 7 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-react", 4 | "@babel/preset-flow" 5 | ], 6 | "plugins": [ 7 | "@babel/plugin-transform-react-jsx" 8 | ], 9 | "env": { 10 | "test": { 11 | "presets": [ 12 | "@babel/preset-env", 13 | "@babel/preset-react" 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React from 'react'; 4 | import { shallow } from 'enzyme' 5 | import FloatingLabelInput from '../src/main'; 6 | 7 | describe('HowLongTilLunch', () => { 8 | it('simple test', () => { 9 | const wrapper = shallow(); 10 | 11 | expect(wrapper).toHaveLength(1); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /.storybook/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env", 4 | "@babel/preset-react", 5 | "@babel/preset-flow" 6 | ], 7 | "plugins": [ 8 | "@babel/plugin-transform-react-jsx" 9 | ], 10 | "env": { 11 | "test": { 12 | "presets": [ 13 | "@babel/preset-env", 14 | "@babel/preset-react" 15 | ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.storybook/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | module: { 5 | rules: [ 6 | { 7 | test: /\.scss$/, 8 | loaders: [ 9 | "style-loader", 10 | "css-loader", 11 | "sass-loader", 12 | "postcss-loader" 13 | ], 14 | include: path.resolve(__dirname, '../') 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /coverage/lcov-report/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-jest_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 89e23f93a387c081bbc97fbcba622d31 2 | // flow-typed version: <>/babel-jest_v^21.2.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-jest' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-jest' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-jest/build/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-jest/build/index.js' { 31 | declare module.exports: $Exports<'babel-jest/build/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-flow_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 11c88f3a5ac9e73fb5bb30fca93aa23a 2 | // flow-typed version: <>/babel-preset-flow_v^6.23.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-flow' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-flow' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-flow/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-flow/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-flow/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-react_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 13eab33b15abeaf8701570e19b59e693 2 | // flow-typed version: <>/babel-preset-react_v^6.24.1/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-react' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-react' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-react/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-react/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-react/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/jest-css-modules_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: e953d4048d746cacf7980119935901af 2 | // flow-typed version: <>/jest-css-modules_v^1.1.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jest-css-modules' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jest-css-modules' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'jest-css-modules/index' { 29 | declare module.exports: $Exports<'jest-css-modules'>; 30 | } 31 | declare module 'jest-css-modules/index.js' { 32 | declare module.exports: $Exports<'jest-css-modules'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/babelrc-rollup_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ad04fe1f7055aa979542559fe96250e9 2 | // flow-typed version: <>/babelrc-rollup_v^3.0.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babelrc-rollup' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babelrc-rollup' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babelrc-rollup/dist/babelrc-rollup' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babelrc-rollup/dist/babelrc-rollup.js' { 31 | declare module.exports: $Exports<'babelrc-rollup/dist/babelrc-rollup'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-es2015_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b3cebee3a781c35f4f3c8d67e4e64459 2 | // flow-typed version: <>/babel-preset-es2015_v^6.24.1/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-es2015' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-es2015' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-es2015/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-es2015/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-es2015/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /coverage/lcov.info: -------------------------------------------------------------------------------- 1 | TN: 2 | SF:C:\Users\Karl\git\rollup-starter-lib-react\src\lunchtime.js 3 | FN:3,getNextLunchtime 4 | FNF:1 5 | FNH:1 6 | FNDA:1,getNextLunchtime 7 | DA:1,1 8 | DA:4,1 9 | DA:6,1 10 | DA:7,1 11 | DA:8,1 12 | DA:9,1 13 | DA:13,1 14 | DA:15,1 15 | LF:8 16 | LH:8 17 | BRDA:13,0,0,1 18 | BRDA:13,0,1,0 19 | BRF:2 20 | BRH:1 21 | end_of_record 22 | TN: 23 | SF:C:\Users\Karl\git\rollup-starter-lib-react\src\main.js 24 | FN:7,_interopRequireDefault 25 | FN:9,HowLongTillLunch 26 | FNF:2 27 | FNH:2 28 | FNDA:4,_interopRequireDefault 29 | FNDA:1,HowLongTillLunch 30 | DA:1,1 31 | DA:7,4 32 | DA:9,1 33 | DA:10,1 34 | DA:11,1 35 | DA:13,1 36 | DA:15,1 37 | LF:7 38 | LH:7 39 | BRDA:7,0,0,2 40 | BRDA:7,0,1,2 41 | BRDA:7,1,0,4 42 | BRDA:7,1,1,4 43 | BRDA:10,2,0,0 44 | BRDA:10,2,1,1 45 | BRDA:11,3,0,0 46 | BRDA:11,3,1,1 47 | BRF:8 48 | BRH:6 49 | end_of_record 50 | TN: 51 | SF:C:\Users\Karl\git\rollup-starter-lib-react\src\millisecondsUntil.js 52 | FN:3,millisecondsUntil 53 | FNF:1 54 | FNH:1 55 | FNDA:1,millisecondsUntil 56 | DA:1,1 57 | DA:4,1 58 | LF:2 59 | LH:2 60 | BRF:0 61 | BRH:0 62 | end_of_record 63 | -------------------------------------------------------------------------------- /flow-typed/npm/rollup-plugin-postcss_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 0e5897e2e27d10cf5ffd43a3ba49e1c0 2 | // flow-typed version: <>/rollup-plugin-postcss_v^0.5.5/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'rollup-plugin-postcss' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'rollup-plugin-postcss' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'rollup-plugin-postcss/dist/index.common' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'rollup-plugin-postcss/dist/index.common.js' { 31 | declare module.exports: $Exports<'rollup-plugin-postcss/dist/index.common'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-config-simenb-flow_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 3922785f7227f4efed7c2f6a102399d5 2 | // flow-typed version: <>/eslint-config-simenb-flow_v^10.0.9/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-config-simenb-flow' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-config-simenb-flow' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'eslint-config-simenb-flow/index' { 29 | declare module.exports: $Exports<'eslint-config-simenb-flow'>; 30 | } 31 | declare module 'eslint-config-simenb-flow/index.js' { 32 | declare module.exports: $Exports<'eslint-config-simenb-flow'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-external-helpers_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 7e02e1059130094ed4569485eaf6ac68 2 | // flow-typed version: <>/babel-plugin-external-helpers_v^6.22.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-external-helpers' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-external-helpers' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-external-helpers/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-plugin-external-helpers/lib/index.js' { 31 | declare module.exports: $Exports<'babel-plugin-external-helpers/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-transform-react-jsx_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 89e2c3d2aaffd4d73ffe70e9a17d993b 2 | // flow-typed version: <>/babel-plugin-transform-react-jsx_v^6.24.1/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-transform-react-jsx' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-transform-react-jsx' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-transform-react-jsx/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-plugin-transform-react-jsx/lib/index.js' { 31 | declare module.exports: $Exports<'babel-plugin-transform-react-jsx/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Cymen Vig 2 | 3 | Copyright (c) 2017 [these people](https://github.com/rollup/rollup-starter-lib/graphs/contributors) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /flow-typed/npm/rollup_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 058640e6dfb0b80c6a2ce3d5e5fd7ea6 2 | // flow-typed version: <>/rollup_v^0.51.5/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'rollup' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'rollup' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'rollup/dist/rollup.browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'rollup/dist/rollup.es' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'rollup/dist/rollup' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'rollup/dist/rollup.browser.js' { 39 | declare module.exports: $Exports<'rollup/dist/rollup.browser'>; 40 | } 41 | declare module 'rollup/dist/rollup.es.js' { 42 | declare module.exports: $Exports<'rollup/dist/rollup.es'>; 43 | } 44 | declare module 'rollup/dist/rollup.js' { 45 | declare module.exports: $Exports<'rollup/dist/rollup'>; 46 | } 47 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | import babel from 'rollup-plugin-babel'; 4 | import resolve from 'rollup-plugin-node-resolve'; 5 | import commonjs from 'rollup-plugin-commonjs'; 6 | import pkg from './package.json'; 7 | 8 | const commonPlugins = [ 9 | babel({ 10 | exclude: 'node_modules/**' 11 | }), 12 | ]; 13 | 14 | const external = ['react', 'styled-components']; 15 | 16 | export default [ 17 | { 18 | // browser-friendly UMD build 19 | input: 'src/main.js', 20 | external: external, 21 | output: { 22 | file: pkg.browser, 23 | format: 'umd', 24 | name: 'FloatingLabelInput', 25 | globals: { 26 | react: 'React', 27 | 'styled-components': 'styled', 28 | }, 29 | }, 30 | plugins: [ 31 | ...commonPlugins, 32 | resolve(), // so Rollup can find `ms` 33 | commonjs(), // so Rollup can convert `ms` to an ES module 34 | ], 35 | }, 36 | 37 | // CommonJS (for Node) and ES module (for bundlers) build. 38 | // (We could have three entries in the configuration array 39 | // instead of two, but it's quicker to generate multiple 40 | // builds from a single configuration where possible, using 41 | // the `targets` option which can specify `file` and `format`) 42 | { 43 | input: 'src/main.js', 44 | external: external, 45 | plugins: commonPlugins, 46 | output: [ 47 | { 48 | file: pkg.main, 49 | format: 'cjs', 50 | }, 51 | { 52 | file: pkg.module, 53 | format: 'es', 54 | }, 55 | ], 56 | }, 57 | ]; 58 | -------------------------------------------------------------------------------- /flow-typed/npm/postcss-modules_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 221c0e9f452563cb5cddd9e9b87985e7 2 | // flow-typed version: <>/postcss-modules_v^1.1.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'postcss-modules' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'postcss-modules' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'postcss-modules/build/behaviours' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'postcss-modules/build/generateScopedName' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'postcss-modules/build/index' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'postcss-modules/build/saveJSON' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'postcss-modules/build/behaviours.js' { 43 | declare module.exports: $Exports<'postcss-modules/build/behaviours'>; 44 | } 45 | declare module 'postcss-modules/build/generateScopedName.js' { 46 | declare module.exports: $Exports<'postcss-modules/build/generateScopedName'>; 47 | } 48 | declare module 'postcss-modules/build/index.js' { 49 | declare module.exports: $Exports<'postcss-modules/build/index'>; 50 | } 51 | declare module 'postcss-modules/build/saveJSON.js' { 52 | declare module.exports: $Exports<'postcss-modules/build/saveJSON'>; 53 | } 54 | -------------------------------------------------------------------------------- /flow-typed/npm/rollup-plugin-node-resolve_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 6b4b8db2b0d5d3f3aae22415632da770 2 | // flow-typed version: <>/rollup-plugin-node-resolve_v^3.0.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'rollup-plugin-node-resolve' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'rollup-plugin-node-resolve' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'rollup-plugin-node-resolve/src/empty' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'rollup-plugin-node-resolve/src/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js' { 43 | declare module.exports: $Exports<'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs'>; 44 | } 45 | declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js' { 46 | declare module.exports: $Exports<'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es'>; 47 | } 48 | declare module 'rollup-plugin-node-resolve/src/empty.js' { 49 | declare module.exports: $Exports<'rollup-plugin-node-resolve/src/empty'>; 50 | } 51 | declare module 'rollup-plugin-node-resolve/src/index.js' { 52 | declare module.exports: $Exports<'rollup-plugin-node-resolve/src/index'>; 53 | } 54 | -------------------------------------------------------------------------------- /coverage/clover.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-config-prettier_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 96806f6d469d8970a0681bfc05532805 2 | // flow-typed version: <>/eslint-config-prettier_v^2.7.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-config-prettier' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-config-prettier' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-config-prettier/bin/cli' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-config-prettier/bin/validators' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-config-prettier/flowtype' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-config-prettier/react' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-config-prettier/standard' { 42 | declare module.exports: any; 43 | } 44 | 45 | // Filename aliases 46 | declare module 'eslint-config-prettier/bin/cli.js' { 47 | declare module.exports: $Exports<'eslint-config-prettier/bin/cli'>; 48 | } 49 | declare module 'eslint-config-prettier/bin/validators.js' { 50 | declare module.exports: $Exports<'eslint-config-prettier/bin/validators'>; 51 | } 52 | declare module 'eslint-config-prettier/flowtype.js' { 53 | declare module.exports: $Exports<'eslint-config-prettier/flowtype'>; 54 | } 55 | declare module 'eslint-config-prettier/index' { 56 | declare module.exports: $Exports<'eslint-config-prettier'>; 57 | } 58 | declare module 'eslint-config-prettier/index.js' { 59 | declare module.exports: $Exports<'eslint-config-prettier'>; 60 | } 61 | declare module 'eslint-config-prettier/react.js' { 62 | declare module.exports: $Exports<'eslint-config-prettier/react'>; 63 | } 64 | declare module 'eslint-config-prettier/standard.js' { 65 | declare module.exports: $Exports<'eslint-config-prettier/standard'>; 66 | } 67 | -------------------------------------------------------------------------------- /flow-typed/npm/enzyme-to-json_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: bd8b6171bd8568a81bb8384c3916da6d 2 | // flow-typed version: <>/enzyme-to-json_v^3.2.2/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'enzyme-to-json' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'enzyme-to-json' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'enzyme-to-json/createSerializer' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'enzyme-to-json/mount' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'enzyme-to-json/render' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'enzyme-to-json/serializer' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'enzyme-to-json/shallow' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'enzyme-to-json/utils' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'enzyme-to-json/createSerializer.js' { 51 | declare module.exports: $Exports<'enzyme-to-json/createSerializer'>; 52 | } 53 | declare module 'enzyme-to-json/index' { 54 | declare module.exports: $Exports<'enzyme-to-json'>; 55 | } 56 | declare module 'enzyme-to-json/index.js' { 57 | declare module.exports: $Exports<'enzyme-to-json'>; 58 | } 59 | declare module 'enzyme-to-json/mount.js' { 60 | declare module.exports: $Exports<'enzyme-to-json/mount'>; 61 | } 62 | declare module 'enzyme-to-json/render.js' { 63 | declare module.exports: $Exports<'enzyme-to-json/render'>; 64 | } 65 | declare module 'enzyme-to-json/serializer.js' { 66 | declare module.exports: $Exports<'enzyme-to-json/serializer'>; 67 | } 68 | declare module 'enzyme-to-json/shallow.js' { 69 | declare module.exports: $Exports<'enzyme-to-json/shallow'>; 70 | } 71 | declare module 'enzyme-to-json/utils.js' { 72 | declare module.exports: $Exports<'enzyme-to-json/utils'>; 73 | } 74 | -------------------------------------------------------------------------------- /stories/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import FloatingLabelInput from '../src/main'; 8 | 9 | storiesOf('FloatingLabelInput', module) 10 | .add( 11 | 'examples', 12 | () => ( 13 |
14 |
15 |
Default:
16 | 23 |
24 |
25 |
Font size of 20px and placeholder:
26 |
27 | 35 |
36 |
37 |
38 |
Font size of 64px and no placeholder:
39 |
40 | 47 |
48 |
49 |
50 |
Font size of 64px and placeholder:
51 |
52 | 60 |
61 |
62 |
63 | ) 64 | ); 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-floating-label-input 2 | 3 | 4 | [![License][license-image]][license-url] 5 | [![Downloads][downloads-image]][downloads-url] 6 | ![minified size](https://badgen.net/bundlephobia/min/react-floating-label-input) 7 | ![minzipped size](https://badgen.net/bundlephobia/minzip/react-floating-label-input) 8 | 9 | [![npm badge][npm-badge-png]][package-url] 10 | 11 | A floating label component for React. It inherits the font-size from the parent. 12 | 13 | ![react-floating-label-input](floating-label-input.gif) 14 | 15 | Try it yourself at the [Storybook](http://blog.cymen.org/react-floating-label-input). 16 | 17 | ## Example 18 | 19 | ```jsx 20 | import React from 'react'; 21 | import FloatingLabelInput from 'react-floating-label-input'; 22 | 23 | export default ({ onChange, value }) => 24 |
25 | 33 |
; 34 | ``` 35 | 36 | ## Props 37 | 38 | | name | optional | default | 39 | |--------------|----------|------------| 40 | | className | yes | | 41 | | fontSize | yes | inherit | 42 | | id | no | | 43 | | label | no | | 44 | | onBlur | yes | | 45 | | onChange | no | | 46 | | onFocus | yes | | 47 | | placeholder | yes | '' | 48 | | refs | yes | | 49 | | type | yes | text | 50 | | value | yes | '' | 51 | 52 | * `refs` is set as `ref` prop on `input` 53 | 54 | ## Dependencies 55 | 56 | Peer dependencies: 57 | 58 | * react 59 | * styled-components 60 | 61 | ## License 62 | 63 | [MIT](LICENSE) 64 | 65 | [package-url]: https://npmjs.org/package/react-floating-label-input 66 | [npm-version-svg]: http://versionbadg.es/cymen/react-floating-label-input.svg 67 | [npm-badge-png]: https://nodei.co/npm/react-floating-label-input.png?downloads=true&stars=true 68 | [license-image]: http://img.shields.io/npm/l/react-floating-label-input.svg 69 | [license-url]: LICENSE 70 | [downloads-image]: http://img.shields.io/npm/dm/react-floating-label-input.svg 71 | [downloads-url]: http://npm-stat.com/charts.html?package=react-floating-label-input 72 | -------------------------------------------------------------------------------- /flow-typed/npm/enzyme-adapter-react-16_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ca494c133ec86fd04bda579727764082 2 | // flow-typed version: <>/enzyme-adapter-react-16_v^1.1.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'enzyme-adapter-react-16' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'enzyme-adapter-react-16' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'enzyme-adapter-react-16/build/findCurrentFiberUsingSlowPath' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'enzyme-adapter-react-16/build/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'enzyme-adapter-react-16/build/ReactSixteenAdapter' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'enzyme-adapter-react-16/src/findCurrentFiberUsingSlowPath' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'enzyme-adapter-react-16/src/index' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'enzyme-adapter-react-16/src/ReactSixteenAdapter' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'enzyme-adapter-react-16/build/findCurrentFiberUsingSlowPath.js' { 51 | declare module.exports: $Exports<'enzyme-adapter-react-16/build/findCurrentFiberUsingSlowPath'>; 52 | } 53 | declare module 'enzyme-adapter-react-16/build/index.js' { 54 | declare module.exports: $Exports<'enzyme-adapter-react-16/build/index'>; 55 | } 56 | declare module 'enzyme-adapter-react-16/build/ReactSixteenAdapter.js' { 57 | declare module.exports: $Exports<'enzyme-adapter-react-16/build/ReactSixteenAdapter'>; 58 | } 59 | declare module 'enzyme-adapter-react-16/src/findCurrentFiberUsingSlowPath.js' { 60 | declare module.exports: $Exports<'enzyme-adapter-react-16/src/findCurrentFiberUsingSlowPath'>; 61 | } 62 | declare module 'enzyme-adapter-react-16/src/index.js' { 63 | declare module.exports: $Exports<'enzyme-adapter-react-16/src/index'>; 64 | } 65 | declare module 'enzyme-adapter-react-16/src/ReactSixteenAdapter.js' { 66 | declare module.exports: $Exports<'enzyme-adapter-react-16/src/ReactSixteenAdapter'>; 67 | } 68 | -------------------------------------------------------------------------------- /flow-typed/npm/rollup-plugin-babel_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 82b853f724e717138cb062fe66e459d7 2 | // flow-typed version: <>/rollup-plugin-babel_v^3.0.2/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'rollup-plugin-babel' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'rollup-plugin-babel' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.cjs' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.es' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'rollup-plugin-babel/src/constants' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'rollup-plugin-babel/src/helperPlugin' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'rollup-plugin-babel/src/index' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'rollup-plugin-babel/src/preflightCheck' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'rollup-plugin-babel/src/utils' { 50 | declare module.exports: any; 51 | } 52 | 53 | // Filename aliases 54 | declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.cjs.js' { 55 | declare module.exports: $Exports<'rollup-plugin-babel/dist/rollup-plugin-babel.cjs'>; 56 | } 57 | declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.es.js' { 58 | declare module.exports: $Exports<'rollup-plugin-babel/dist/rollup-plugin-babel.es'>; 59 | } 60 | declare module 'rollup-plugin-babel/src/constants.js' { 61 | declare module.exports: $Exports<'rollup-plugin-babel/src/constants'>; 62 | } 63 | declare module 'rollup-plugin-babel/src/helperPlugin.js' { 64 | declare module.exports: $Exports<'rollup-plugin-babel/src/helperPlugin'>; 65 | } 66 | declare module 'rollup-plugin-babel/src/index.js' { 67 | declare module.exports: $Exports<'rollup-plugin-babel/src/index'>; 68 | } 69 | declare module 'rollup-plugin-babel/src/preflightCheck.js' { 70 | declare module.exports: $Exports<'rollup-plugin-babel/src/preflightCheck'>; 71 | } 72 | declare module 'rollup-plugin-babel/src/utils.js' { 73 | declare module.exports: $Exports<'rollup-plugin-babel/src/utils'>; 74 | } 75 | -------------------------------------------------------------------------------- /flow-typed/npm/prettier_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ebc9f59179c6f42067ac9ef4fd3ded0a 2 | // flow-typed version: <>/prettier_v^1.8.2/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'prettier' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'prettier' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'prettier/bin/prettier' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'prettier/parser-babylon' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'prettier/parser-flow' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'prettier/parser-graphql' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'prettier/parser-markdown' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'prettier/parser-parse5' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'prettier/parser-postcss' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'prettier/parser-typescript' { 54 | declare module.exports: any; 55 | } 56 | 57 | // Filename aliases 58 | declare module 'prettier/bin/prettier.js' { 59 | declare module.exports: $Exports<'prettier/bin/prettier'>; 60 | } 61 | declare module 'prettier/index' { 62 | declare module.exports: $Exports<'prettier'>; 63 | } 64 | declare module 'prettier/index.js' { 65 | declare module.exports: $Exports<'prettier'>; 66 | } 67 | declare module 'prettier/parser-babylon.js' { 68 | declare module.exports: $Exports<'prettier/parser-babylon'>; 69 | } 70 | declare module 'prettier/parser-flow.js' { 71 | declare module.exports: $Exports<'prettier/parser-flow'>; 72 | } 73 | declare module 'prettier/parser-graphql.js' { 74 | declare module.exports: $Exports<'prettier/parser-graphql'>; 75 | } 76 | declare module 'prettier/parser-markdown.js' { 77 | declare module.exports: $Exports<'prettier/parser-markdown'>; 78 | } 79 | declare module 'prettier/parser-parse5.js' { 80 | declare module.exports: $Exports<'prettier/parser-parse5'>; 81 | } 82 | declare module 'prettier/parser-postcss.js' { 83 | declare module.exports: $Exports<'prettier/parser-postcss'>; 84 | } 85 | declare module 'prettier/parser-typescript.js' { 86 | declare module.exports: $Exports<'prettier/parser-typescript'>; 87 | } 88 | -------------------------------------------------------------------------------- /coverage/lcov-report/millisecondsUntil.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for millisecondsUntil.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files millisecondsUntil.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 3/3 26 |
27 |
28 | 100% 29 | Branches 30 | 0/0 31 |
32 |
33 | 100% 34 | Functions 35 | 1/1 36 |
37 |
38 | 100% 39 | Lines 40 | 2/2 41 |
42 |
43 |
44 |
45 |

46 | 
59 | 
1 47 | 2 48 | 3 49 | 4 50 | 51x 51 |   52 |   53 | 1x 54 |  
// @flow
55 |  
56 | export default function millisecondsUntil(date: Date): number {
57 | 	return date - Date.now();
58 | }
60 |
61 |
62 | 66 | 67 | 68 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /flow-typed/npm/rollup-plugin-commonjs_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b84d35f6e700545a673ce63343b13b03 2 | // flow-typed version: <>/rollup-plugin-commonjs_v^8.2.6/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'rollup-plugin-commonjs' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'rollup-plugin-commonjs' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'rollup-plugin-commonjs/src/ast-utils' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'rollup-plugin-commonjs/src/defaultResolver' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'rollup-plugin-commonjs/src/helpers' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'rollup-plugin-commonjs/src/index' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'rollup-plugin-commonjs/src/transform' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'rollup-plugin-commonjs/src/utils' { 54 | declare module.exports: any; 55 | } 56 | 57 | // Filename aliases 58 | declare module 'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js' { 59 | declare module.exports: $Exports<'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs'>; 60 | } 61 | declare module 'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js' { 62 | declare module.exports: $Exports<'rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es'>; 63 | } 64 | declare module 'rollup-plugin-commonjs/src/ast-utils.js' { 65 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/ast-utils'>; 66 | } 67 | declare module 'rollup-plugin-commonjs/src/defaultResolver.js' { 68 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/defaultResolver'>; 69 | } 70 | declare module 'rollup-plugin-commonjs/src/helpers.js' { 71 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/helpers'>; 72 | } 73 | declare module 'rollup-plugin-commonjs/src/index.js' { 74 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/index'>; 75 | } 76 | declare module 'rollup-plugin-commonjs/src/transform.js' { 77 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/transform'>; 78 | } 79 | declare module 'rollup-plugin-commonjs/src/utils.js' { 80 | declare module.exports: $Exports<'rollup-plugin-commonjs/src/utils'>; 81 | } 82 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components'; 3 | 4 | const FloatingLabelInput = styled.div` 5 | width: 100%; 6 | `; 7 | 8 | const FloatingLabelInputContainer = styled.div` 9 | display: flex; 10 | flex-direction: column; 11 | justify-content: flex-end; 12 | position: relative; 13 | height: 2em; 14 | border-bottom: 1px solid #ddd; 15 | font-size: inherit; 16 | `; 17 | 18 | const FloatingLabel = styled.label` 19 | padding: 0; 20 | margin: 0; 21 | border: 0; 22 | position: absolute; 23 | color: #9b9b9b; 24 | bottom: 0; 25 | transition: all 0.2s ease-in-out; 26 | transform-origin: left top; 27 | font-size: 1em; 28 | cursor: text; 29 | pointer-events: none; 30 | width: 66.6%; 31 | transform: ${props => 32 | props.active ? 'translate3d(0, -70%, 0) scale(0.70)' : 'none'}; 33 | `; 34 | 35 | const FloatingInput = styled.input` 36 | padding: 0; 37 | margin: 0; 38 | border: none; 39 | outline: none; 40 | font-size: 1em; 41 | &::placeholder { 42 | color: #9b9b9b; 43 | opacity: ${props => (props.active ? 1 : 0)}; 44 | transition: opacity 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335); 45 | } 46 | `; 47 | 48 | export default class TextInput extends React.PureComponent { 49 | constructor(props) { 50 | super(props); 51 | if (!props.id && !props.name) { 52 | throw new Error('expected id but none present'); 53 | } 54 | 55 | this.state = { 56 | active: props.value && props.value.length > 0 57 | }; 58 | 59 | this.onFocus = this.onFocus.bind(this); 60 | this.onBlur = this.onBlur.bind(this); 61 | } 62 | 63 | componentDidUpdate(prevProps) { 64 | if (!prevProps.active && this.props.value && prevProps.value !== this.props.value) { 65 | this.setState({ active: true }); 66 | } 67 | } 68 | 69 | onFocus(event) { 70 | this.setState({ active: true }); 71 | if (this.props.onFocus) { 72 | this.props.onFocus(event); 73 | } 74 | } 75 | 76 | onBlur(event) { 77 | this.setState({ active: event.target.value.length !== 0 }); 78 | if (this.props.onBlur) { 79 | this.props.onBlur(event); 80 | } 81 | } 82 | 83 | render() { 84 | const { id, label, onBlur, onFocus, type, refs, className, ...otherProps } = this.props; 85 | const { active } = this.state; 86 | 87 | return ( 88 | 89 | 90 | 91 | {label} 92 | 93 | 103 | 104 | 105 | ); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-floating-label-input", 3 | "description": "A floating label input component for React", 4 | "keywords": "floating label input field material ui", 5 | "version": "4.3.3", 6 | "main": "dist/react-floating-label-input.cjs.js", 7 | "module": "dist/react-floating-label-input.esm.js", 8 | "browser": "dist/react-floating-label-input.umd.js", 9 | "style": "dist/react-floating-label-input.css", 10 | "author": "Cymen Vig ", 11 | "license": "MIT", 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/cymen/react-floating-label-input.git" 15 | }, 16 | "prettier": { 17 | "printWidth": 120, 18 | "tabWidth": 2, 19 | "singleQuote": true, 20 | "trailingComma": "es5" 21 | }, 22 | "jest": { 23 | "setupTestFrameworkScriptFile": "/test/.enzyme.js", 24 | "transform": { 25 | ".*": "/node_modules/jest-css-modules" 26 | }, 27 | "snapshotSerializers": [ 28 | "enzyme-to-json/serializer" 29 | ], 30 | "collectCoverageFrom": [ 31 | "src/**/*.{js}", 32 | "!src/**/*.stories.{js}" 33 | ], 34 | "coverageThreshold": { 35 | "global": { 36 | "statements": 55, 37 | "branches": 45, 38 | "functions": 50, 39 | "lines": 60 40 | } 41 | } 42 | }, 43 | "peerDependencies": { 44 | "react": "^15.0.0 || ^16.0.0 || ^17.0.0", 45 | "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0", 46 | "styled-components": "^4.0.0 || ^5.0.0" 47 | }, 48 | "dependencies": {}, 49 | "devDependencies": { 50 | "@babel/core": "^7.4.5", 51 | "@babel/plugin-transform-react-jsx": "^7.3.0", 52 | "@babel/preset-env": "^7.4.5", 53 | "@babel/preset-react": "^7.0.0", 54 | "@storybook/addon-actions": "^5.0.11", 55 | "@storybook/addon-links": "^5.0.11", 56 | "@storybook/react": "^5.0.11", 57 | "@storybook/storybook-deployer": "^2.8.1", 58 | "autoprefixer": "^9.5.1", 59 | "babel-core": "^7.0.0-bridge.0", 60 | "babel-jest": "^24.8.0", 61 | "enzyme": "^3.9.0", 62 | "enzyme-adapter-react-16": "^1.13.2", 63 | "enzyme-to-json": "^3.3.5", 64 | "eslint": "^5.16.0", 65 | "eslint-config-airbnb-base": "^13.1.0", 66 | "eslint-config-prettier": "^4.3.0", 67 | "eslint-plugin-import": "^2.17.3", 68 | "jest": "^24.8.0", 69 | "jest-css-modules": "^2.0.0", 70 | "node-sass": "^4.12.0", 71 | "prettier": "^1.17.1", 72 | "raf": "^3.4.1", 73 | "rollup": "^1.12.5", 74 | "rollup-plugin-babel": "^4.3.2", 75 | "rollup-plugin-commonjs": "^10.0.0", 76 | "rollup-plugin-node-resolve": "^5.0.0", 77 | "sass-loader": "^7.1.0", 78 | "styled-components": "^4.1.2" 79 | }, 80 | "scripts": { 81 | "build": "rollup -c", 82 | "build-storybook": "build-storybook", 83 | "coverage": "jest test --coverage", 84 | "deploy-storybook": "storybook-to-ghpages", 85 | "dev": "rollup -c -w", 86 | "lint": "eslint src", 87 | "pretest": "npm run build", 88 | "storybook": "start-storybook -p 6006", 89 | "test": "jest test" 90 | }, 91 | "files": [ 92 | "dist" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b56189f58e1728de5b8683f436e84523 2 | // flow-typed version: <>/eslint-config-airbnb-base_v^12.1.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-config-airbnb-base' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-config-airbnb-base' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-config-airbnb-base/legacy' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-config-airbnb-base/rules/best-practices' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-config-airbnb-base/rules/errors' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-config-airbnb-base/rules/es6' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-config-airbnb-base/rules/imports' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'eslint-config-airbnb-base/rules/node' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'eslint-config-airbnb-base/rules/strict' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'eslint-config-airbnb-base/rules/style' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'eslint-config-airbnb-base/rules/variables' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'eslint-config-airbnb-base/test/test-base' { 62 | declare module.exports: any; 63 | } 64 | 65 | // Filename aliases 66 | declare module 'eslint-config-airbnb-base/index' { 67 | declare module.exports: $Exports<'eslint-config-airbnb-base'>; 68 | } 69 | declare module 'eslint-config-airbnb-base/index.js' { 70 | declare module.exports: $Exports<'eslint-config-airbnb-base'>; 71 | } 72 | declare module 'eslint-config-airbnb-base/legacy.js' { 73 | declare module.exports: $Exports<'eslint-config-airbnb-base/legacy'>; 74 | } 75 | declare module 'eslint-config-airbnb-base/rules/best-practices.js' { 76 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/best-practices'>; 77 | } 78 | declare module 'eslint-config-airbnb-base/rules/errors.js' { 79 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/errors'>; 80 | } 81 | declare module 'eslint-config-airbnb-base/rules/es6.js' { 82 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/es6'>; 83 | } 84 | declare module 'eslint-config-airbnb-base/rules/imports.js' { 85 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/imports'>; 86 | } 87 | declare module 'eslint-config-airbnb-base/rules/node.js' { 88 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/node'>; 89 | } 90 | declare module 'eslint-config-airbnb-base/rules/strict.js' { 91 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/strict'>; 92 | } 93 | declare module 'eslint-config-airbnb-base/rules/style.js' { 94 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/style'>; 95 | } 96 | declare module 'eslint-config-airbnb-base/rules/variables.js' { 97 | declare module.exports: $Exports<'eslint-config-airbnb-base/rules/variables'>; 98 | } 99 | declare module 'eslint-config-airbnb-base/test/test-base.js' { 100 | declare module.exports: $Exports<'eslint-config-airbnb-base/test/test-base'>; 101 | } 102 | -------------------------------------------------------------------------------- /coverage/lcov-report/lunchtime.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for lunchtime.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files lunchtime.js 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 10/10 26 |
27 |
28 | 50% 29 | Branches 30 | 1/2 31 |
32 |
33 | 100% 34 | Functions 35 | 1/1 36 |
37 |
38 | 100% 39 | Lines 40 | 8/8 41 |
42 |
43 |
44 |
45 |

 46 | 
 95 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 171x 63 |   64 |   65 | 1x 66 |   67 | 1x 68 | 1x 69 | 1x 70 | 1x 71 |   72 |   73 |   74 | 1x 75 |   76 | 1x 77 |   78 |  
// @flow
 79 |  
 80 | export default function getNextLunchtime(hours: number, minutes: number): Date {
 81 |   const lunchtime = new Date();
 82 |  
 83 |   lunchtime.setHours(hours);
 84 |   lunchtime.setMinutes(minutes);
 85 |   lunchtime.setSeconds(0);
 86 |   lunchtime.setMilliseconds(0);
 87 |  
 88 |   // if we've already had lunch today, start planning
 89 |   // tomorrow's lunch
 90 |   Eif (lunchtime < Date.now()) lunchtime.setDate(lunchtime.getDate() + 1);
 91 |  
 92 |   return lunchtime;
 93 | }
 94 |  
96 |
97 |
98 | 102 | 103 | 104 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /coverage/coverage-final.json: -------------------------------------------------------------------------------- 1 | {"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\lunchtime.js": {"path":"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\lunchtime.js","statementMap":{"0":{"start":{"line":1,"column":39},"end":{"line":1,"column":101}},"1":{"start":{"line":1,"column":101},"end":{"line":3,"column":17}},"2":{"start":{"line":4,"column":18},"end":{"line":4,"column":28}},"3":{"start":{"line":6,"column":2},"end":{"line":6,"column":28}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":32}},"5":{"start":{"line":8,"column":2},"end":{"line":8,"column":26}},"6":{"start":{"line":9,"column":2},"end":{"line":9,"column":31}},"7":{"start":{"line":13,"column":2},"end":{"line":13,"column":73}},"8":{"start":{"line":13,"column":30},"end":{"line":13,"column":73}},"9":{"start":{"line":15,"column":2},"end":{"line":15,"column":19}}},"fnMap":{"0":{"name":"getNextLunchtime","decl":{"start":{"line":3,"column":26},"end":{"line":3,"column":42}},"loc":{"start":{"line":3,"column":59},"end":{"line":16,"column":1}},"line":3}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":73}},"type":"if","locations":[{"start":{"line":13,"column":2},"end":{"line":13,"column":73}},{"start":{"line":13,"column":2},"end":{"line":13,"column":73}}],"line":13}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{"0":1},"b":{"0":[1,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"df57b3c67f84d8607df6b37932c425f39ed1b452"} 2 | ,"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\main.js": {"path":"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\main.js","statementMap":{"0":{"start":{"line":1,"column":39},"end":{"line":1,"column":101}},"1":{"start":{"line":7,"column":169},"end":{"line":7,"column":223}},"2":{"start":{"line":9,"column":23},"end":{"line":16,"column":1}},"3":{"start":{"line":10,"column":2},"end":{"line":10,"column":38}},"4":{"start":{"line":10,"column":27},"end":{"line":10,"column":38}},"5":{"start":{"line":11,"column":2},"end":{"line":11,"column":42}},"6":{"start":{"line":11,"column":29},"end":{"line":11,"column":42}},"7":{"start":{"line":13,"column":61},"end":{"line":13,"column":162}},"8":{"start":{"line":15,"column":2},"end":{"line":15,"column":267}}},"fnMap":{"0":{"name":"_interopRequireDefault","decl":{"start":{"line":7,"column":140},"end":{"line":7,"column":162}},"loc":{"start":{"line":7,"column":168},"end":{"line":7,"column":224}},"line":7},"1":{"name":"HowLongTillLunch","decl":{"start":{"line":9,"column":32},"end":{"line":9,"column":48}},"loc":{"start":{"line":9,"column":82},"end":{"line":16,"column":1}},"line":9}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":176},"end":{"line":7,"column":222}},"type":"cond-expr","locations":[{"start":{"line":7,"column":200},"end":{"line":7,"column":203}},{"start":{"line":7,"column":206},"end":{"line":7,"column":222}}],"line":7},"1":{"loc":{"start":{"line":7,"column":176},"end":{"line":7,"column":197}},"type":"binary-expr","locations":[{"start":{"line":7,"column":176},"end":{"line":7,"column":179}},{"start":{"line":7,"column":183},"end":{"line":7,"column":197}}],"line":7},"2":{"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":38}},"type":"if","locations":[{"start":{"line":10,"column":2},"end":{"line":10,"column":38}},{"start":{"line":10,"column":2},"end":{"line":10,"column":38}}],"line":10},"3":{"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":42}},"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":11,"column":42}},{"start":{"line":11,"column":2},"end":{"line":11,"column":42}}],"line":11}},"s":{"0":1,"1":4,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1,"8":1},"f":{"0":4,"1":1},"b":{"0":[2,2],"1":[4,4],"2":[0,1],"3":[0,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"6d82f3f1f2ec2e8bc63eb9eb84b8de2da2ab920a"} 3 | ,"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\millisecondsUntil.js": {"path":"C:\\Users\\Karl\\git\\rollup-starter-lib-react\\src\\millisecondsUntil.js","statementMap":{"0":{"start":{"line":1,"column":39},"end":{"line":1,"column":101}},"1":{"start":{"line":1,"column":101},"end":{"line":3,"column":18}},"2":{"start":{"line":4,"column":1},"end":{"line":4,"column":26}}},"fnMap":{"0":{"name":"millisecondsUntil","decl":{"start":{"line":3,"column":27},"end":{"line":3,"column":44}},"loc":{"start":{"line":3,"column":51},"end":{"line":5,"column":1}},"line":3}},"branchMap":{},"s":{"0":1,"1":1,"2":1},"f":{"0":1},"b":{},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"510b1db8a8cc946a7018e5dd42b6ea5fb7a2eb5d"} 4 | } 5 | -------------------------------------------------------------------------------- /coverage/lcov-report/main.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for main.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files main.js 20 |

21 |
22 |
23 | 77.78% 24 | Statements 25 | 7/9 26 |
27 |
28 | 75% 29 | Branches 30 | 6/8 31 |
32 |
33 | 100% 34 | Functions 35 | 2/2 36 |
37 |
38 | 100% 39 | Lines 40 | 7/7 41 |
42 |
43 |
44 |
45 |

 46 | 
101 | 
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 57 | 12 58 | 13 59 | 14 60 | 15 61 | 16 62 | 17 63 | 18 64 | 191x 65 |   66 |   67 |   68 |   69 |   70 | 4x 71 |   72 | 1x 73 | 1x 74 | 1x 75 |   76 | 1x 77 |   78 | 1x 79 |   80 |   81 |   82 |  
// @flow
 83 |  
 84 | import React from 'react';
 85 | import lunchtime from './lunchtime.js';
 86 | import millisecondsUntil from './millisecondsUntil.js';
 87 |  
 88 | import style from './main.scss';
 89 |  
 90 | const HowLongTillLunch = ({ hours, minutes }: { hours: number, minutes: number }) => {
 91 |   Iif (hours === undefined) hours = 12;
 92 |   Iif (minutes === undefined) minutes = 30;
 93 |  
 94 |   const millisecondsUntilLunchTime = millisecondsUntil(lunchtime(hours, minutes));
 95 |  
 96 |   return <div className={style.goodLunch}>{millisecondsUntilLunchTime / 1000} seconds</div>;
 97 | };
 98 |  
 99 | export default HowLongTillLunch;
100 |  
102 |
103 |
104 | 108 | 109 | 110 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /flow-typed/npm/enzyme_v3.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 6b92a41d54465c059482c77ea3047b51 2 | // flow-typed version: e351e417db/enzyme_v3.x.x/flow_>=v0.53.x 3 | 4 | import * as React from "react"; 5 | 6 | declare module "enzyme" { 7 | declare type PredicateFunction = ( 8 | wrapper: T, 9 | index: number 10 | ) => boolean; 11 | declare type NodeOrNodes = React.Node | Array; 12 | declare type EnzymeSelector = string | Class> | Object; 13 | 14 | // CheerioWrapper is a type alias for an actual cheerio instance 15 | // TODO: Reference correct type from cheerio's type declarations 16 | declare type CheerioWrapper = any; 17 | 18 | declare class Wrapper { 19 | find(selector: EnzymeSelector): this, 20 | findWhere(predicate: PredicateFunction): this, 21 | filter(selector: EnzymeSelector): this, 22 | filterWhere(predicate: PredicateFunction): this, 23 | contains(nodeOrNodes: NodeOrNodes): boolean, 24 | containsMatchingElement(node: React.Node): boolean, 25 | containsAllMatchingElements(nodes: NodeOrNodes): boolean, 26 | containsAnyMatchingElements(nodes: NodeOrNodes): boolean, 27 | dive(option?: { context?: Object }): this, 28 | exists(): boolean, 29 | matchesElement(node: React.Node): boolean, 30 | hasClass(className: string): boolean, 31 | is(selector: EnzymeSelector): boolean, 32 | isEmpty(): boolean, 33 | not(selector: EnzymeSelector): this, 34 | children(selector?: EnzymeSelector): this, 35 | childAt(index: number): this, 36 | parents(selector?: EnzymeSelector): this, 37 | parent(): this, 38 | closest(selector: EnzymeSelector): this, 39 | render(): CheerioWrapper, 40 | unmount(): this, 41 | text(): string, 42 | html(): string, 43 | get(index: number): React.Node, 44 | getNodes(): Array, 45 | getDOMNode(): HTMLElement | HTMLInputElement, 46 | at(index: number): this, 47 | first(): this, 48 | last(): this, 49 | state(key?: string): any, 50 | context(key?: string): any, 51 | props(): Object, 52 | prop(key: string): any, 53 | key(): string, 54 | simulate(event: string, ...args: Array): this, 55 | setState(state: {}, callback?: Function): this, 56 | setProps(props: {}): this, 57 | setContext(context: Object): this, 58 | instance(): React.Component<*, *>, 59 | update(): this, 60 | debug(): string, 61 | type(): string | Function | null, 62 | name(): string, 63 | forEach(fn: (node: this, index: number) => mixed): this, 64 | map(fn: (node: this, index: number) => T): Array, 65 | reduce( 66 | fn: (value: T, node: this, index: number) => T, 67 | initialValue?: T 68 | ): Array, 69 | reduceRight( 70 | fn: (value: T, node: this, index: number) => T, 71 | initialValue?: T 72 | ): Array, 73 | some(selector: EnzymeSelector): boolean, 74 | someWhere(predicate: PredicateFunction): boolean, 75 | every(selector: EnzymeSelector): boolean, 76 | everyWhere(predicate: PredicateFunction): boolean, 77 | length: number 78 | } 79 | 80 | declare class ReactWrapper extends Wrapper { 81 | constructor(nodes: NodeOrNodes, root: any, options?: ?Object): ReactWrapper, 82 | mount(): this, 83 | ref(refName: string): this, 84 | detach(): void 85 | } 86 | 87 | declare class ShallowWrapper extends Wrapper { 88 | constructor( 89 | nodes: NodeOrNodes, 90 | root: any, 91 | options?: ?Object 92 | ): ShallowWrapper, 93 | equals(node: React.Node): boolean, 94 | shallow(options?: { context?: Object }): ShallowWrapper 95 | } 96 | 97 | declare function shallow( 98 | node: React.Node, 99 | options?: { context?: Object, disableLifecycleMethods?: boolean } 100 | ): ShallowWrapper; 101 | declare function mount( 102 | node: React.Node, 103 | options?: { 104 | context?: Object, 105 | attachTo?: HTMLElement, 106 | childContextTypes?: Object 107 | } 108 | ): ReactWrapper; 109 | declare function render( 110 | node: React.Node, 111 | options?: { context?: Object } 112 | ): CheerioWrapper; 113 | 114 | declare module.exports: { 115 | configure(options: { 116 | Adapter?: any, 117 | disableLifecycleMethods?: boolean 118 | }): void, 119 | render: typeof render, 120 | mount: typeof mount, 121 | shallow: typeof shallow, 122 | ShallowWrapper: typeof ShallowWrapper, 123 | ReactWrapper: typeof ReactWrapper 124 | }; 125 | } 126 | -------------------------------------------------------------------------------- /coverage/lcov-report/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for All files 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | All files 20 |

21 |
22 |
23 | 90.91% 24 | Statements 25 | 20/22 26 |
27 |
28 | 70% 29 | Branches 30 | 7/10 31 |
32 |
33 | 100% 34 | Functions 35 | 4/4 36 |
37 |
38 | 100% 39 | Lines 40 | 17/17 41 |
42 |
43 |
44 |
45 |
46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
FileStatementsBranchesFunctionsLines
lunchtime.js
100%10/1050%1/2100%1/1100%8/8
main.js
77.78%7/975%6/8100%2/2100%7/7
millisecondsUntil.js
100%3/3100%0/0100%1/1100%2/2
102 |
103 |
104 | 108 | 109 | 110 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /coverage/lcov-report/sorter.js: -------------------------------------------------------------------------------- 1 | var addSorting = (function () { 2 | "use strict"; 3 | var cols, 4 | currentSort = { 5 | index: 0, 6 | desc: false 7 | }; 8 | 9 | // returns the summary table element 10 | function getTable() { return document.querySelector('.coverage-summary'); } 11 | // returns the thead element of the summary table 12 | function getTableHeader() { return getTable().querySelector('thead tr'); } 13 | // returns the tbody element of the summary table 14 | function getTableBody() { return getTable().querySelector('tbody'); } 15 | // returns the th element for nth column 16 | function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } 17 | 18 | // loads all columns 19 | function loadColumns() { 20 | var colNodes = getTableHeader().querySelectorAll('th'), 21 | colNode, 22 | cols = [], 23 | col, 24 | i; 25 | 26 | for (i = 0; i < colNodes.length; i += 1) { 27 | colNode = colNodes[i]; 28 | col = { 29 | key: colNode.getAttribute('data-col'), 30 | sortable: !colNode.getAttribute('data-nosort'), 31 | type: colNode.getAttribute('data-type') || 'string' 32 | }; 33 | cols.push(col); 34 | if (col.sortable) { 35 | col.defaultDescSort = col.type === 'number'; 36 | colNode.innerHTML = colNode.innerHTML + ''; 37 | } 38 | } 39 | return cols; 40 | } 41 | // attaches a data attribute to every tr element with an object 42 | // of data values keyed by column name 43 | function loadRowData(tableRow) { 44 | var tableCols = tableRow.querySelectorAll('td'), 45 | colNode, 46 | col, 47 | data = {}, 48 | i, 49 | val; 50 | for (i = 0; i < tableCols.length; i += 1) { 51 | colNode = tableCols[i]; 52 | col = cols[i]; 53 | val = colNode.getAttribute('data-value'); 54 | if (col.type === 'number') { 55 | val = Number(val); 56 | } 57 | data[col.key] = val; 58 | } 59 | return data; 60 | } 61 | // loads all row data 62 | function loadData() { 63 | var rows = getTableBody().querySelectorAll('tr'), 64 | i; 65 | 66 | for (i = 0; i < rows.length; i += 1) { 67 | rows[i].data = loadRowData(rows[i]); 68 | } 69 | } 70 | // sorts the table using the data for the ith column 71 | function sortByIndex(index, desc) { 72 | var key = cols[index].key, 73 | sorter = function (a, b) { 74 | a = a.data[key]; 75 | b = b.data[key]; 76 | return a < b ? -1 : a > b ? 1 : 0; 77 | }, 78 | finalSorter = sorter, 79 | tableBody = document.querySelector('.coverage-summary tbody'), 80 | rowNodes = tableBody.querySelectorAll('tr'), 81 | rows = [], 82 | i; 83 | 84 | if (desc) { 85 | finalSorter = function (a, b) { 86 | return -1 * sorter(a, b); 87 | }; 88 | } 89 | 90 | for (i = 0; i < rowNodes.length; i += 1) { 91 | rows.push(rowNodes[i]); 92 | tableBody.removeChild(rowNodes[i]); 93 | } 94 | 95 | rows.sort(finalSorter); 96 | 97 | for (i = 0; i < rows.length; i += 1) { 98 | tableBody.appendChild(rows[i]); 99 | } 100 | } 101 | // removes sort indicators for current column being sorted 102 | function removeSortIndicators() { 103 | var col = getNthColumn(currentSort.index), 104 | cls = col.className; 105 | 106 | cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); 107 | col.className = cls; 108 | } 109 | // adds sort indicators for current column being sorted 110 | function addSortIndicators() { 111 | getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; 112 | } 113 | // adds event listeners for all sorter widgets 114 | function enableUI() { 115 | var i, 116 | el, 117 | ithSorter = function ithSorter(i) { 118 | var col = cols[i]; 119 | 120 | return function () { 121 | var desc = col.defaultDescSort; 122 | 123 | if (currentSort.index === i) { 124 | desc = !currentSort.desc; 125 | } 126 | sortByIndex(i, desc); 127 | removeSortIndicators(); 128 | currentSort.index = i; 129 | currentSort.desc = desc; 130 | addSortIndicators(); 131 | }; 132 | }; 133 | for (i =0 ; i < cols.length; i += 1) { 134 | if (cols[i].sortable) { 135 | // add the click event handler on the th so users 136 | // dont have to click on those tiny arrows 137 | el = getNthColumn(i).querySelector('.sorter').parentElement; 138 | if (el.addEventListener) { 139 | el.addEventListener('click', ithSorter(i)); 140 | } else { 141 | el.attachEvent('onclick', ithSorter(i)); 142 | } 143 | } 144 | } 145 | } 146 | // adds sorting functionality to the UI 147 | return function () { 148 | if (!getTable()) { 149 | return; 150 | } 151 | cols = loadColumns(); 152 | loadData(cols); 153 | addSortIndicators(); 154 | enableUI(); 155 | }; 156 | })(); 157 | 158 | window.addEventListener('load', addSorting); 159 | -------------------------------------------------------------------------------- /coverage/lcov-report/base.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin:0; padding: 0; 3 | height: 100%; 4 | } 5 | body { 6 | font-family: Helvetica Neue, Helvetica, Arial; 7 | font-size: 14px; 8 | color:#333; 9 | } 10 | .small { font-size: 12px; } 11 | *, *:after, *:before { 12 | -webkit-box-sizing:border-box; 13 | -moz-box-sizing:border-box; 14 | box-sizing:border-box; 15 | } 16 | h1 { font-size: 20px; margin: 0;} 17 | h2 { font-size: 14px; } 18 | pre { 19 | font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; 20 | margin: 0; 21 | padding: 0; 22 | -moz-tab-size: 2; 23 | -o-tab-size: 2; 24 | tab-size: 2; 25 | } 26 | a { color:#0074D9; text-decoration:none; } 27 | a:hover { text-decoration:underline; } 28 | .strong { font-weight: bold; } 29 | .space-top1 { padding: 10px 0 0 0; } 30 | .pad2y { padding: 20px 0; } 31 | .pad1y { padding: 10px 0; } 32 | .pad2x { padding: 0 20px; } 33 | .pad2 { padding: 20px; } 34 | .pad1 { padding: 10px; } 35 | .space-left2 { padding-left:55px; } 36 | .space-right2 { padding-right:20px; } 37 | .center { text-align:center; } 38 | .clearfix { display:block; } 39 | .clearfix:after { 40 | content:''; 41 | display:block; 42 | height:0; 43 | clear:both; 44 | visibility:hidden; 45 | } 46 | .fl { float: left; } 47 | @media only screen and (max-width:640px) { 48 | .col3 { width:100%; max-width:100%; } 49 | .hide-mobile { display:none!important; } 50 | } 51 | 52 | .quiet { 53 | color: #7f7f7f; 54 | color: rgba(0,0,0,0.5); 55 | } 56 | .quiet a { opacity: 0.7; } 57 | 58 | .fraction { 59 | font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; 60 | font-size: 10px; 61 | color: #555; 62 | background: #E8E8E8; 63 | padding: 4px 5px; 64 | border-radius: 3px; 65 | vertical-align: middle; 66 | } 67 | 68 | div.path a:link, div.path a:visited { color: #333; } 69 | table.coverage { 70 | border-collapse: collapse; 71 | margin: 10px 0 0 0; 72 | padding: 0; 73 | } 74 | 75 | table.coverage td { 76 | margin: 0; 77 | padding: 0; 78 | vertical-align: top; 79 | } 80 | table.coverage td.line-count { 81 | text-align: right; 82 | padding: 0 5px 0 20px; 83 | } 84 | table.coverage td.line-coverage { 85 | text-align: right; 86 | padding-right: 10px; 87 | min-width:20px; 88 | } 89 | 90 | table.coverage td span.cline-any { 91 | display: inline-block; 92 | padding: 0 5px; 93 | width: 100%; 94 | } 95 | .missing-if-branch { 96 | display: inline-block; 97 | margin-right: 5px; 98 | border-radius: 3px; 99 | position: relative; 100 | padding: 0 4px; 101 | background: #333; 102 | color: yellow; 103 | } 104 | 105 | .skip-if-branch { 106 | display: none; 107 | margin-right: 10px; 108 | position: relative; 109 | padding: 0 4px; 110 | background: #ccc; 111 | color: white; 112 | } 113 | .missing-if-branch .typ, .skip-if-branch .typ { 114 | color: inherit !important; 115 | } 116 | .coverage-summary { 117 | border-collapse: collapse; 118 | width: 100%; 119 | } 120 | .coverage-summary tr { border-bottom: 1px solid #bbb; } 121 | .keyline-all { border: 1px solid #ddd; } 122 | .coverage-summary td, .coverage-summary th { padding: 10px; } 123 | .coverage-summary tbody { border: 1px solid #bbb; } 124 | .coverage-summary td { border-right: 1px solid #bbb; } 125 | .coverage-summary td:last-child { border-right: none; } 126 | .coverage-summary th { 127 | text-align: left; 128 | font-weight: normal; 129 | white-space: nowrap; 130 | } 131 | .coverage-summary th.file { border-right: none !important; } 132 | .coverage-summary th.pct { } 133 | .coverage-summary th.pic, 134 | .coverage-summary th.abs, 135 | .coverage-summary td.pct, 136 | .coverage-summary td.abs { text-align: right; } 137 | .coverage-summary td.file { white-space: nowrap; } 138 | .coverage-summary td.pic { min-width: 120px !important; } 139 | .coverage-summary tfoot td { } 140 | 141 | .coverage-summary .sorter { 142 | height: 10px; 143 | width: 7px; 144 | display: inline-block; 145 | margin-left: 0.5em; 146 | background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; 147 | } 148 | .coverage-summary .sorted .sorter { 149 | background-position: 0 -20px; 150 | } 151 | .coverage-summary .sorted-desc .sorter { 152 | background-position: 0 -10px; 153 | } 154 | .status-line { height: 10px; } 155 | /* dark red */ 156 | .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } 157 | .low .chart { border:1px solid #C21F39 } 158 | /* medium red */ 159 | .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } 160 | /* light red */ 161 | .low, .cline-no { background:#FCE1E5 } 162 | /* light green */ 163 | .high, .cline-yes { background:rgb(230,245,208) } 164 | /* medium green */ 165 | .cstat-yes { background:rgb(161,215,106) } 166 | /* dark green */ 167 | .status-line.high, .high .cover-fill { background:rgb(77,146,33) } 168 | .high .chart { border:1px solid rgb(77,146,33) } 169 | 170 | 171 | .medium .chart { border:1px solid #666; } 172 | .medium .cover-fill { background: #666; } 173 | 174 | .cbranch-no { background: yellow !important; color: #111; } 175 | 176 | .cstat-skip { background: #ddd; color: #111; } 177 | .fstat-skip { background: #ddd; color: #111 !important; } 178 | .cbranch-skip { background: #ddd !important; color: #111; } 179 | 180 | span.cline-neutral { background: #eaeaea; } 181 | .medium { background: #eaeaea; } 182 | 183 | .cover-fill, .cover-empty { 184 | display:inline-block; 185 | height: 12px; 186 | } 187 | .chart { 188 | line-height: 0; 189 | } 190 | .cover-empty { 191 | background: white; 192 | } 193 | .cover-full { 194 | border-right: none !important; 195 | } 196 | pre.prettyprint { 197 | border: none !important; 198 | padding: 0 !important; 199 | margin: 0 !important; 200 | } 201 | .com { color: #999 !important; } 202 | .ignore-none { color: #999; font-weight: normal; } 203 | 204 | .wrapper { 205 | min-height: 100%; 206 | height: auto !important; 207 | height: 100%; 208 | margin: 0 auto -48px; 209 | } 210 | .footer, .push { 211 | height: 48px; 212 | } 213 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-core_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: f08827b3bd2048ee6181f68756c9bc16 2 | // flow-typed version: <>/babel-core_v^6.26.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-core' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-core' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-core/lib/api/browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-core/lib/api/node' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-core/lib/helpers/get-possible-plugin-names' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-core/lib/helpers/get-possible-preset-names' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-core/lib/helpers/merge' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-core/lib/helpers/normalize-ast' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-core/lib/helpers/resolve-from-possible-names' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-core/lib/helpers/resolve-plugin' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-core/lib/helpers/resolve-preset' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-core/lib/helpers/resolve' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-core/lib/store' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'babel-core/lib/tools/build-external-helpers' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'babel-core/lib/transformation/file/index' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'babel-core/lib/transformation/file/logger' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'babel-core/lib/transformation/file/metadata' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'babel-core/lib/transformation/file/options/build-config-chain' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'babel-core/lib/transformation/file/options/config' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'babel-core/lib/transformation/file/options/index' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'babel-core/lib/transformation/file/options/option-manager' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'babel-core/lib/transformation/file/options/parsers' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'babel-core/lib/transformation/file/options/removed' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'babel-core/lib/transformation/pipeline' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'babel-core/lib/transformation/plugin-pass' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'babel-core/lib/transformation/plugin' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'babel-core/lib/util' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'babel-core/register' { 134 | declare module.exports: any; 135 | } 136 | 137 | // Filename aliases 138 | declare module 'babel-core/index' { 139 | declare module.exports: $Exports<'babel-core'>; 140 | } 141 | declare module 'babel-core/index.js' { 142 | declare module.exports: $Exports<'babel-core'>; 143 | } 144 | declare module 'babel-core/lib/api/browser.js' { 145 | declare module.exports: $Exports<'babel-core/lib/api/browser'>; 146 | } 147 | declare module 'babel-core/lib/api/node.js' { 148 | declare module.exports: $Exports<'babel-core/lib/api/node'>; 149 | } 150 | declare module 'babel-core/lib/helpers/get-possible-plugin-names.js' { 151 | declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-plugin-names'>; 152 | } 153 | declare module 'babel-core/lib/helpers/get-possible-preset-names.js' { 154 | declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-preset-names'>; 155 | } 156 | declare module 'babel-core/lib/helpers/merge.js' { 157 | declare module.exports: $Exports<'babel-core/lib/helpers/merge'>; 158 | } 159 | declare module 'babel-core/lib/helpers/normalize-ast.js' { 160 | declare module.exports: $Exports<'babel-core/lib/helpers/normalize-ast'>; 161 | } 162 | declare module 'babel-core/lib/helpers/resolve-from-possible-names.js' { 163 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-from-possible-names'>; 164 | } 165 | declare module 'babel-core/lib/helpers/resolve-plugin.js' { 166 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-plugin'>; 167 | } 168 | declare module 'babel-core/lib/helpers/resolve-preset.js' { 169 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-preset'>; 170 | } 171 | declare module 'babel-core/lib/helpers/resolve.js' { 172 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve'>; 173 | } 174 | declare module 'babel-core/lib/store.js' { 175 | declare module.exports: $Exports<'babel-core/lib/store'>; 176 | } 177 | declare module 'babel-core/lib/tools/build-external-helpers.js' { 178 | declare module.exports: $Exports<'babel-core/lib/tools/build-external-helpers'>; 179 | } 180 | declare module 'babel-core/lib/transformation/file/index.js' { 181 | declare module.exports: $Exports<'babel-core/lib/transformation/file/index'>; 182 | } 183 | declare module 'babel-core/lib/transformation/file/logger.js' { 184 | declare module.exports: $Exports<'babel-core/lib/transformation/file/logger'>; 185 | } 186 | declare module 'babel-core/lib/transformation/file/metadata.js' { 187 | declare module.exports: $Exports<'babel-core/lib/transformation/file/metadata'>; 188 | } 189 | declare module 'babel-core/lib/transformation/file/options/build-config-chain.js' { 190 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/build-config-chain'>; 191 | } 192 | declare module 'babel-core/lib/transformation/file/options/config.js' { 193 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/config'>; 194 | } 195 | declare module 'babel-core/lib/transformation/file/options/index.js' { 196 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/index'>; 197 | } 198 | declare module 'babel-core/lib/transformation/file/options/option-manager.js' { 199 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/option-manager'>; 200 | } 201 | declare module 'babel-core/lib/transformation/file/options/parsers.js' { 202 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/parsers'>; 203 | } 204 | declare module 'babel-core/lib/transformation/file/options/removed.js' { 205 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/removed'>; 206 | } 207 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist.js' { 208 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/block-hoist'>; 209 | } 210 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions.js' { 211 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/shadow-functions'>; 212 | } 213 | declare module 'babel-core/lib/transformation/pipeline.js' { 214 | declare module.exports: $Exports<'babel-core/lib/transformation/pipeline'>; 215 | } 216 | declare module 'babel-core/lib/transformation/plugin-pass.js' { 217 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin-pass'>; 218 | } 219 | declare module 'babel-core/lib/transformation/plugin.js' { 220 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin'>; 221 | } 222 | declare module 'babel-core/lib/util.js' { 223 | declare module.exports: $Exports<'babel-core/lib/util'>; 224 | } 225 | declare module 'babel-core/register.js' { 226 | declare module.exports: $Exports<'babel-core/register'>; 227 | } 228 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-plugin-import_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 7ed61075675fe4e4c19d09276e9801ae 2 | // flow-typed version: <>/eslint-plugin-import_v^2.8.0/flow_v0.59.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-plugin-import' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-plugin-import' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-plugin-import/config/electron' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-plugin-import/config/errors' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-plugin-import/config/react-native' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-plugin-import/config/react' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-plugin-import/config/recommended' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'eslint-plugin-import/config/stage-0' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'eslint-plugin-import/config/warnings' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'eslint-plugin-import/lib/core/importType' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'eslint-plugin-import/lib/core/staticRequire' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'eslint-plugin-import/lib/ExportMap' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'eslint-plugin-import/lib/importDeclaration' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'eslint-plugin-import/lib/index' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'eslint-plugin-import/lib/rules/default' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'eslint-plugin-import/lib/rules/export' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'eslint-plugin-import/lib/rules/exports-last' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'eslint-plugin-import/lib/rules/extensions' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'eslint-plugin-import/lib/rules/first' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'eslint-plugin-import/lib/rules/imports-first' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'eslint-plugin-import/lib/rules/max-dependencies' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'eslint-plugin-import/lib/rules/named' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'eslint-plugin-import/lib/rules/namespace' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'eslint-plugin-import/lib/rules/newline-after-import' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'eslint-plugin-import/lib/rules/no-absolute-path' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'eslint-plugin-import/lib/rules/no-amd' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'eslint-plugin-import/lib/rules/no-commonjs' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'eslint-plugin-import/lib/rules/no-deprecated' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'eslint-plugin-import/lib/rules/no-duplicates' { 134 | declare module.exports: any; 135 | } 136 | 137 | declare module 'eslint-plugin-import/lib/rules/no-dynamic-require' { 138 | declare module.exports: any; 139 | } 140 | 141 | declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies' { 142 | declare module.exports: any; 143 | } 144 | 145 | declare module 'eslint-plugin-import/lib/rules/no-internal-modules' { 146 | declare module.exports: any; 147 | } 148 | 149 | declare module 'eslint-plugin-import/lib/rules/no-mutable-exports' { 150 | declare module.exports: any; 151 | } 152 | 153 | declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member' { 154 | declare module.exports: any; 155 | } 156 | 157 | declare module 'eslint-plugin-import/lib/rules/no-named-as-default' { 158 | declare module.exports: any; 159 | } 160 | 161 | declare module 'eslint-plugin-import/lib/rules/no-named-default' { 162 | declare module.exports: any; 163 | } 164 | 165 | declare module 'eslint-plugin-import/lib/rules/no-namespace' { 166 | declare module.exports: any; 167 | } 168 | 169 | declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules' { 170 | declare module.exports: any; 171 | } 172 | 173 | declare module 'eslint-plugin-import/lib/rules/no-restricted-paths' { 174 | declare module.exports: any; 175 | } 176 | 177 | declare module 'eslint-plugin-import/lib/rules/no-unassigned-import' { 178 | declare module.exports: any; 179 | } 180 | 181 | declare module 'eslint-plugin-import/lib/rules/no-unresolved' { 182 | declare module.exports: any; 183 | } 184 | 185 | declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax' { 186 | declare module.exports: any; 187 | } 188 | 189 | declare module 'eslint-plugin-import/lib/rules/order' { 190 | declare module.exports: any; 191 | } 192 | 193 | declare module 'eslint-plugin-import/lib/rules/prefer-default-export' { 194 | declare module.exports: any; 195 | } 196 | 197 | declare module 'eslint-plugin-import/lib/rules/unambiguous' { 198 | declare module.exports: any; 199 | } 200 | 201 | declare module 'eslint-plugin-import/memo-parser/index' { 202 | declare module.exports: any; 203 | } 204 | 205 | // Filename aliases 206 | declare module 'eslint-plugin-import/config/electron.js' { 207 | declare module.exports: $Exports<'eslint-plugin-import/config/electron'>; 208 | } 209 | declare module 'eslint-plugin-import/config/errors.js' { 210 | declare module.exports: $Exports<'eslint-plugin-import/config/errors'>; 211 | } 212 | declare module 'eslint-plugin-import/config/react-native.js' { 213 | declare module.exports: $Exports<'eslint-plugin-import/config/react-native'>; 214 | } 215 | declare module 'eslint-plugin-import/config/react.js' { 216 | declare module.exports: $Exports<'eslint-plugin-import/config/react'>; 217 | } 218 | declare module 'eslint-plugin-import/config/recommended.js' { 219 | declare module.exports: $Exports<'eslint-plugin-import/config/recommended'>; 220 | } 221 | declare module 'eslint-plugin-import/config/stage-0.js' { 222 | declare module.exports: $Exports<'eslint-plugin-import/config/stage-0'>; 223 | } 224 | declare module 'eslint-plugin-import/config/warnings.js' { 225 | declare module.exports: $Exports<'eslint-plugin-import/config/warnings'>; 226 | } 227 | declare module 'eslint-plugin-import/lib/core/importType.js' { 228 | declare module.exports: $Exports<'eslint-plugin-import/lib/core/importType'>; 229 | } 230 | declare module 'eslint-plugin-import/lib/core/staticRequire.js' { 231 | declare module.exports: $Exports<'eslint-plugin-import/lib/core/staticRequire'>; 232 | } 233 | declare module 'eslint-plugin-import/lib/ExportMap.js' { 234 | declare module.exports: $Exports<'eslint-plugin-import/lib/ExportMap'>; 235 | } 236 | declare module 'eslint-plugin-import/lib/importDeclaration.js' { 237 | declare module.exports: $Exports<'eslint-plugin-import/lib/importDeclaration'>; 238 | } 239 | declare module 'eslint-plugin-import/lib/index.js' { 240 | declare module.exports: $Exports<'eslint-plugin-import/lib/index'>; 241 | } 242 | declare module 'eslint-plugin-import/lib/rules/default.js' { 243 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/default'>; 244 | } 245 | declare module 'eslint-plugin-import/lib/rules/export.js' { 246 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/export'>; 247 | } 248 | declare module 'eslint-plugin-import/lib/rules/exports-last.js' { 249 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/exports-last'>; 250 | } 251 | declare module 'eslint-plugin-import/lib/rules/extensions.js' { 252 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/extensions'>; 253 | } 254 | declare module 'eslint-plugin-import/lib/rules/first.js' { 255 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/first'>; 256 | } 257 | declare module 'eslint-plugin-import/lib/rules/imports-first.js' { 258 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/imports-first'>; 259 | } 260 | declare module 'eslint-plugin-import/lib/rules/max-dependencies.js' { 261 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/max-dependencies'>; 262 | } 263 | declare module 'eslint-plugin-import/lib/rules/named.js' { 264 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/named'>; 265 | } 266 | declare module 'eslint-plugin-import/lib/rules/namespace.js' { 267 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/namespace'>; 268 | } 269 | declare module 'eslint-plugin-import/lib/rules/newline-after-import.js' { 270 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/newline-after-import'>; 271 | } 272 | declare module 'eslint-plugin-import/lib/rules/no-absolute-path.js' { 273 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-absolute-path'>; 274 | } 275 | declare module 'eslint-plugin-import/lib/rules/no-amd.js' { 276 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-amd'>; 277 | } 278 | declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export.js' { 279 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-anonymous-default-export'>; 280 | } 281 | declare module 'eslint-plugin-import/lib/rules/no-commonjs.js' { 282 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-commonjs'>; 283 | } 284 | declare module 'eslint-plugin-import/lib/rules/no-deprecated.js' { 285 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-deprecated'>; 286 | } 287 | declare module 'eslint-plugin-import/lib/rules/no-duplicates.js' { 288 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-duplicates'>; 289 | } 290 | declare module 'eslint-plugin-import/lib/rules/no-dynamic-require.js' { 291 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-dynamic-require'>; 292 | } 293 | declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies.js' { 294 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-extraneous-dependencies'>; 295 | } 296 | declare module 'eslint-plugin-import/lib/rules/no-internal-modules.js' { 297 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-internal-modules'>; 298 | } 299 | declare module 'eslint-plugin-import/lib/rules/no-mutable-exports.js' { 300 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-mutable-exports'>; 301 | } 302 | declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member.js' { 303 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default-member'>; 304 | } 305 | declare module 'eslint-plugin-import/lib/rules/no-named-as-default.js' { 306 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default'>; 307 | } 308 | declare module 'eslint-plugin-import/lib/rules/no-named-default.js' { 309 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-default'>; 310 | } 311 | declare module 'eslint-plugin-import/lib/rules/no-namespace.js' { 312 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-namespace'>; 313 | } 314 | declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules.js' { 315 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-nodejs-modules'>; 316 | } 317 | declare module 'eslint-plugin-import/lib/rules/no-restricted-paths.js' { 318 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-restricted-paths'>; 319 | } 320 | declare module 'eslint-plugin-import/lib/rules/no-unassigned-import.js' { 321 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unassigned-import'>; 322 | } 323 | declare module 'eslint-plugin-import/lib/rules/no-unresolved.js' { 324 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unresolved'>; 325 | } 326 | declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js' { 327 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-webpack-loader-syntax'>; 328 | } 329 | declare module 'eslint-plugin-import/lib/rules/order.js' { 330 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/order'>; 331 | } 332 | declare module 'eslint-plugin-import/lib/rules/prefer-default-export.js' { 333 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/prefer-default-export'>; 334 | } 335 | declare module 'eslint-plugin-import/lib/rules/unambiguous.js' { 336 | declare module.exports: $Exports<'eslint-plugin-import/lib/rules/unambiguous'>; 337 | } 338 | declare module 'eslint-plugin-import/memo-parser/index.js' { 339 | declare module.exports: $Exports<'eslint-plugin-import/memo-parser/index'>; 340 | } 341 | -------------------------------------------------------------------------------- /coverage/lcov-report/prettify.js: -------------------------------------------------------------------------------- 1 | window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); 2 | -------------------------------------------------------------------------------- /flow-typed/npm/jest_v21.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 26518f5f5a942cabfcdbf6ad91b16ab1 2 | // flow-typed version: cfa05a2b8e/jest_v21.x.x/flow_>=v0.39.x 3 | 4 | type JestMockFn, TReturn> = { 5 | (...args: TArguments): TReturn, 6 | /** 7 | * An object for introspecting mock calls 8 | */ 9 | mock: { 10 | /** 11 | * An array that represents all calls that have been made into this mock 12 | * function. Each call is represented by an array of arguments that were 13 | * passed during the call. 14 | */ 15 | calls: Array, 16 | /** 17 | * An array that contains all the object instances that have been 18 | * instantiated from this mock function. 19 | */ 20 | instances: Array 21 | }, 22 | /** 23 | * Resets all information stored in the mockFn.mock.calls and 24 | * mockFn.mock.instances arrays. Often this is useful when you want to clean 25 | * up a mock's usage data between two assertions. 26 | */ 27 | mockClear(): void, 28 | /** 29 | * Resets all information stored in the mock. This is useful when you want to 30 | * completely restore a mock back to its initial state. 31 | */ 32 | mockReset(): void, 33 | /** 34 | * Removes the mock and restores the initial implementation. This is useful 35 | * when you want to mock functions in certain test cases and restore the 36 | * original implementation in others. Beware that mockFn.mockRestore only 37 | * works when mock was created with jest.spyOn. Thus you have to take care of 38 | * restoration yourself when manually assigning jest.fn(). 39 | */ 40 | mockRestore(): void, 41 | /** 42 | * Accepts a function that should be used as the implementation of the mock. 43 | * The mock itself will still record all calls that go into and instances 44 | * that come from itself -- the only difference is that the implementation 45 | * will also be executed when the mock is called. 46 | */ 47 | mockImplementation( 48 | fn: (...args: TArguments) => TReturn 49 | ): JestMockFn, 50 | /** 51 | * Accepts a function that will be used as an implementation of the mock for 52 | * one call to the mocked function. Can be chained so that multiple function 53 | * calls produce different results. 54 | */ 55 | mockImplementationOnce( 56 | fn: (...args: TArguments) => TReturn 57 | ): JestMockFn, 58 | /** 59 | * Just a simple sugar function for returning `this` 60 | */ 61 | mockReturnThis(): void, 62 | /** 63 | * Deprecated: use jest.fn(() => value) instead 64 | */ 65 | mockReturnValue(value: TReturn): JestMockFn, 66 | /** 67 | * Sugar for only returning a value once inside your mock 68 | */ 69 | mockReturnValueOnce(value: TReturn): JestMockFn 70 | }; 71 | 72 | type JestAsymmetricEqualityType = { 73 | /** 74 | * A custom Jasmine equality tester 75 | */ 76 | asymmetricMatch(value: mixed): boolean 77 | }; 78 | 79 | type JestCallsType = { 80 | allArgs(): mixed, 81 | all(): mixed, 82 | any(): boolean, 83 | count(): number, 84 | first(): mixed, 85 | mostRecent(): mixed, 86 | reset(): void 87 | }; 88 | 89 | type JestClockType = { 90 | install(): void, 91 | mockDate(date: Date): void, 92 | tick(milliseconds?: number): void, 93 | uninstall(): void 94 | }; 95 | 96 | type JestMatcherResult = { 97 | message?: string | (() => string), 98 | pass: boolean 99 | }; 100 | 101 | type JestMatcher = (actual: any, expected: any) => JestMatcherResult; 102 | 103 | type JestPromiseType = { 104 | /** 105 | * Use rejects to unwrap the reason of a rejected promise so any other 106 | * matcher can be chained. If the promise is fulfilled the assertion fails. 107 | */ 108 | rejects: JestExpectType, 109 | /** 110 | * Use resolves to unwrap the value of a fulfilled promise so any other 111 | * matcher can be chained. If the promise is rejected the assertion fails. 112 | */ 113 | resolves: JestExpectType 114 | }; 115 | 116 | /** 117 | * Plugin: jest-enzyme 118 | */ 119 | type EnzymeMatchersType = { 120 | toBeChecked(): void, 121 | toBeDisabled(): void, 122 | toBeEmpty(): void, 123 | toBePresent(): void, 124 | toContainReact(element: React$Element): void, 125 | toHaveClassName(className: string): void, 126 | toHaveHTML(html: string): void, 127 | toHaveProp(propKey: string, propValue?: any): void, 128 | toHaveRef(refName: string): void, 129 | toHaveState(stateKey: string, stateValue?: any): void, 130 | toHaveStyle(styleKey: string, styleValue?: any): void, 131 | toHaveTagName(tagName: string): void, 132 | toHaveText(text: string): void, 133 | toIncludeText(text: string): void, 134 | toHaveValue(value: any): void, 135 | toMatchElement(element: React$Element): void, 136 | toMatchSelector(selector: string): void 137 | }; 138 | 139 | type JestExpectType = { 140 | not: JestExpectType & EnzymeMatchersType, 141 | /** 142 | * If you have a mock function, you can use .lastCalledWith to test what 143 | * arguments it was last called with. 144 | */ 145 | lastCalledWith(...args: Array): void, 146 | /** 147 | * toBe just checks that a value is what you expect. It uses === to check 148 | * strict equality. 149 | */ 150 | toBe(value: any): void, 151 | /** 152 | * Use .toHaveBeenCalled to ensure that a mock function got called. 153 | */ 154 | toBeCalled(): void, 155 | /** 156 | * Use .toBeCalledWith to ensure that a mock function was called with 157 | * specific arguments. 158 | */ 159 | toBeCalledWith(...args: Array): void, 160 | /** 161 | * Using exact equality with floating point numbers is a bad idea. Rounding 162 | * means that intuitive things fail. 163 | */ 164 | toBeCloseTo(num: number, delta: any): void, 165 | /** 166 | * Use .toBeDefined to check that a variable is not undefined. 167 | */ 168 | toBeDefined(): void, 169 | /** 170 | * Use .toBeFalsy when you don't care what a value is, you just want to 171 | * ensure a value is false in a boolean context. 172 | */ 173 | toBeFalsy(): void, 174 | /** 175 | * To compare floating point numbers, you can use toBeGreaterThan. 176 | */ 177 | toBeGreaterThan(number: number): void, 178 | /** 179 | * To compare floating point numbers, you can use toBeGreaterThanOrEqual. 180 | */ 181 | toBeGreaterThanOrEqual(number: number): void, 182 | /** 183 | * To compare floating point numbers, you can use toBeLessThan. 184 | */ 185 | toBeLessThan(number: number): void, 186 | /** 187 | * To compare floating point numbers, you can use toBeLessThanOrEqual. 188 | */ 189 | toBeLessThanOrEqual(number: number): void, 190 | /** 191 | * Use .toBeInstanceOf(Class) to check that an object is an instance of a 192 | * class. 193 | */ 194 | toBeInstanceOf(cls: Class<*>): void, 195 | /** 196 | * .toBeNull() is the same as .toBe(null) but the error messages are a bit 197 | * nicer. 198 | */ 199 | toBeNull(): void, 200 | /** 201 | * Use .toBeTruthy when you don't care what a value is, you just want to 202 | * ensure a value is true in a boolean context. 203 | */ 204 | toBeTruthy(): void, 205 | /** 206 | * Use .toBeUndefined to check that a variable is undefined. 207 | */ 208 | toBeUndefined(): void, 209 | /** 210 | * Use .toContain when you want to check that an item is in a list. For 211 | * testing the items in the list, this uses ===, a strict equality check. 212 | */ 213 | toContain(item: any): void, 214 | /** 215 | * Use .toContainEqual when you want to check that an item is in a list. For 216 | * testing the items in the list, this matcher recursively checks the 217 | * equality of all fields, rather than checking for object identity. 218 | */ 219 | toContainEqual(item: any): void, 220 | /** 221 | * Use .toEqual when you want to check that two objects have the same value. 222 | * This matcher recursively checks the equality of all fields, rather than 223 | * checking for object identity. 224 | */ 225 | toEqual(value: any): void, 226 | /** 227 | * Use .toHaveBeenCalled to ensure that a mock function got called. 228 | */ 229 | toHaveBeenCalled(): void, 230 | /** 231 | * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact 232 | * number of times. 233 | */ 234 | toHaveBeenCalledTimes(number: number): void, 235 | /** 236 | * Use .toHaveBeenCalledWith to ensure that a mock function was called with 237 | * specific arguments. 238 | */ 239 | toHaveBeenCalledWith(...args: Array): void, 240 | /** 241 | * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called 242 | * with specific arguments. 243 | */ 244 | toHaveBeenLastCalledWith(...args: Array): void, 245 | /** 246 | * Check that an object has a .length property and it is set to a certain 247 | * numeric value. 248 | */ 249 | toHaveLength(number: number): void, 250 | /** 251 | * 252 | */ 253 | toHaveProperty(propPath: string, value?: any): void, 254 | /** 255 | * Use .toMatch to check that a string matches a regular expression or string. 256 | */ 257 | toMatch(regexpOrString: RegExp | string): void, 258 | /** 259 | * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. 260 | */ 261 | toMatchObject(object: Object | Array): void, 262 | /** 263 | * This ensures that a React component matches the most recent snapshot. 264 | */ 265 | toMatchSnapshot(name?: string): void, 266 | /** 267 | * Use .toThrow to test that a function throws when it is called. 268 | * If you want to test that a specific error gets thrown, you can provide an 269 | * argument to toThrow. The argument can be a string for the error message, 270 | * a class for the error, or a regex that should match the error. 271 | * 272 | * Alias: .toThrowError 273 | */ 274 | toThrow(message?: string | Error | RegExp): void, 275 | toThrowError(message?: string | Error | RegExp): void, 276 | /** 277 | * Use .toThrowErrorMatchingSnapshot to test that a function throws a error 278 | * matching the most recent snapshot when it is called. 279 | */ 280 | toThrowErrorMatchingSnapshot(): void 281 | }; 282 | 283 | type JestObjectType = { 284 | /** 285 | * Disables automatic mocking in the module loader. 286 | * 287 | * After this method is called, all `require()`s will return the real 288 | * versions of each module (rather than a mocked version). 289 | */ 290 | disableAutomock(): JestObjectType, 291 | /** 292 | * An un-hoisted version of disableAutomock 293 | */ 294 | autoMockOff(): JestObjectType, 295 | /** 296 | * Enables automatic mocking in the module loader. 297 | */ 298 | enableAutomock(): JestObjectType, 299 | /** 300 | * An un-hoisted version of enableAutomock 301 | */ 302 | autoMockOn(): JestObjectType, 303 | /** 304 | * Clears the mock.calls and mock.instances properties of all mocks. 305 | * Equivalent to calling .mockClear() on every mocked function. 306 | */ 307 | clearAllMocks(): JestObjectType, 308 | /** 309 | * Resets the state of all mocks. Equivalent to calling .mockReset() on every 310 | * mocked function. 311 | */ 312 | resetAllMocks(): JestObjectType, 313 | /** 314 | * Removes any pending timers from the timer system. 315 | */ 316 | clearAllTimers(): void, 317 | /** 318 | * The same as `mock` but not moved to the top of the expectation by 319 | * babel-jest. 320 | */ 321 | doMock(moduleName: string, moduleFactory?: any): JestObjectType, 322 | /** 323 | * The same as `unmock` but not moved to the top of the expectation by 324 | * babel-jest. 325 | */ 326 | dontMock(moduleName: string): JestObjectType, 327 | /** 328 | * Returns a new, unused mock function. Optionally takes a mock 329 | * implementation. 330 | */ 331 | fn, TReturn>( 332 | implementation?: (...args: TArguments) => TReturn 333 | ): JestMockFn, 334 | /** 335 | * Determines if the given function is a mocked function. 336 | */ 337 | isMockFunction(fn: Function): boolean, 338 | /** 339 | * Given the name of a module, use the automatic mocking system to generate a 340 | * mocked version of the module for you. 341 | */ 342 | genMockFromModule(moduleName: string): any, 343 | /** 344 | * Mocks a module with an auto-mocked version when it is being required. 345 | * 346 | * The second argument can be used to specify an explicit module factory that 347 | * is being run instead of using Jest's automocking feature. 348 | * 349 | * The third argument can be used to create virtual mocks -- mocks of modules 350 | * that don't exist anywhere in the system. 351 | */ 352 | mock( 353 | moduleName: string, 354 | moduleFactory?: any, 355 | options?: Object 356 | ): JestObjectType, 357 | /** 358 | * Returns the actual module instead of a mock, bypassing all checks on 359 | * whether the module should receive a mock implementation or not. 360 | */ 361 | requireActual(moduleName: string): any, 362 | /** 363 | * Returns a mock module instead of the actual module, bypassing all checks 364 | * on whether the module should be required normally or not. 365 | */ 366 | requireMock(moduleName: string): any, 367 | /** 368 | * Resets the module registry - the cache of all required modules. This is 369 | * useful to isolate modules where local state might conflict between tests. 370 | */ 371 | resetModules(): JestObjectType, 372 | /** 373 | * Exhausts the micro-task queue (usually interfaced in node via 374 | * process.nextTick). 375 | */ 376 | runAllTicks(): void, 377 | /** 378 | * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), 379 | * setInterval(), and setImmediate()). 380 | */ 381 | runAllTimers(): void, 382 | /** 383 | * Exhausts all tasks queued by setImmediate(). 384 | */ 385 | runAllImmediates(): void, 386 | /** 387 | * Executes only the macro task queue (i.e. all tasks queued by setTimeout() 388 | * or setInterval() and setImmediate()). 389 | */ 390 | runTimersToTime(msToRun: number): void, 391 | /** 392 | * Executes only the macro-tasks that are currently pending (i.e., only the 393 | * tasks that have been queued by setTimeout() or setInterval() up to this 394 | * point) 395 | */ 396 | runOnlyPendingTimers(): void, 397 | /** 398 | * Explicitly supplies the mock object that the module system should return 399 | * for the specified module. Note: It is recommended to use jest.mock() 400 | * instead. 401 | */ 402 | setMock(moduleName: string, moduleExports: any): JestObjectType, 403 | /** 404 | * Indicates that the module system should never return a mocked version of 405 | * the specified module from require() (e.g. that it should always return the 406 | * real module). 407 | */ 408 | unmock(moduleName: string): JestObjectType, 409 | /** 410 | * Instructs Jest to use fake versions of the standard timer functions 411 | * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, 412 | * setImmediate and clearImmediate). 413 | */ 414 | useFakeTimers(): JestObjectType, 415 | /** 416 | * Instructs Jest to use the real versions of the standard timer functions. 417 | */ 418 | useRealTimers(): JestObjectType, 419 | /** 420 | * Creates a mock function similar to jest.fn but also tracks calls to 421 | * object[methodName]. 422 | */ 423 | spyOn(object: Object, methodName: string): JestMockFn, 424 | /** 425 | * Set the default timeout interval for tests and before/after hooks in milliseconds. 426 | * Note: The default timeout interval is 5 seconds if this method is not called. 427 | */ 428 | setTimeout(timeout: number): JestObjectType 429 | }; 430 | 431 | type JestSpyType = { 432 | calls: JestCallsType 433 | }; 434 | 435 | /** Runs this function after every test inside this context */ 436 | declare function afterEach( 437 | fn: (done: () => void) => ?Promise, 438 | timeout?: number 439 | ): void; 440 | /** Runs this function before every test inside this context */ 441 | declare function beforeEach( 442 | fn: (done: () => void) => ?Promise, 443 | timeout?: number 444 | ): void; 445 | /** Runs this function after all tests have finished inside this context */ 446 | declare function afterAll( 447 | fn: (done: () => void) => ?Promise, 448 | timeout?: number 449 | ): void; 450 | /** Runs this function before any tests have started inside this context */ 451 | declare function beforeAll( 452 | fn: (done: () => void) => ?Promise, 453 | timeout?: number 454 | ): void; 455 | 456 | /** A context for grouping tests together */ 457 | declare var describe: { 458 | /** 459 | * Creates a block that groups together several related tests in one "test suite" 460 | */ 461 | (name: string, fn: () => void): void, 462 | 463 | /** 464 | * Only run this describe block 465 | */ 466 | only(name: string, fn: () => void): void, 467 | 468 | /** 469 | * Skip running this describe block 470 | */ 471 | skip(name: string, fn: () => void): void 472 | }; 473 | 474 | /** An individual test unit */ 475 | declare var it: { 476 | /** 477 | * An individual test unit 478 | * 479 | * @param {string} Name of Test 480 | * @param {Function} Test 481 | * @param {number} Timeout for the test, in milliseconds. 482 | */ 483 | ( 484 | name: string, 485 | fn?: (done: () => void) => ?Promise, 486 | timeout?: number 487 | ): void, 488 | /** 489 | * Only run this test 490 | * 491 | * @param {string} Name of Test 492 | * @param {Function} Test 493 | * @param {number} Timeout for the test, in milliseconds. 494 | */ 495 | only( 496 | name: string, 497 | fn?: (done: () => void) => ?Promise, 498 | timeout?: number 499 | ): void, 500 | /** 501 | * Skip running this test 502 | * 503 | * @param {string} Name of Test 504 | * @param {Function} Test 505 | * @param {number} Timeout for the test, in milliseconds. 506 | */ 507 | skip( 508 | name: string, 509 | fn?: (done: () => void) => ?Promise, 510 | timeout?: number 511 | ): void, 512 | /** 513 | * Run the test concurrently 514 | * 515 | * @param {string} Name of Test 516 | * @param {Function} Test 517 | * @param {number} Timeout for the test, in milliseconds. 518 | */ 519 | concurrent( 520 | name: string, 521 | fn?: (done: () => void) => ?Promise, 522 | timeout?: number 523 | ): void 524 | }; 525 | declare function fit( 526 | name: string, 527 | fn: (done: () => void) => ?Promise, 528 | timeout?: number 529 | ): void; 530 | /** An individual test unit */ 531 | declare var test: typeof it; 532 | /** A disabled group of tests */ 533 | declare var xdescribe: typeof describe; 534 | /** A focused group of tests */ 535 | declare var fdescribe: typeof describe; 536 | /** A disabled individual test */ 537 | declare var xit: typeof it; 538 | /** A disabled individual test */ 539 | declare var xtest: typeof it; 540 | 541 | /** The expect function is used every time you want to test a value */ 542 | declare var expect: { 543 | /** The object that you want to make assertions against */ 544 | (value: any): JestExpectType & JestPromiseType & EnzymeMatchersType, 545 | /** Add additional Jasmine matchers to Jest's roster */ 546 | extend(matchers: { [name: string]: JestMatcher }): void, 547 | /** Add a module that formats application-specific data structures. */ 548 | addSnapshotSerializer(serializer: (input: Object) => string): void, 549 | assertions(expectedAssertions: number): void, 550 | hasAssertions(): void, 551 | any(value: mixed): JestAsymmetricEqualityType, 552 | anything(): void, 553 | arrayContaining(value: Array): void, 554 | objectContaining(value: Object): void, 555 | /** Matches any received string that contains the exact expected string. */ 556 | stringContaining(value: string): void, 557 | stringMatching(value: string | RegExp): void 558 | }; 559 | 560 | // TODO handle return type 561 | // http://jasmine.github.io/2.4/introduction.html#section-Spies 562 | declare function spyOn(value: mixed, method: string): Object; 563 | 564 | /** Holds all functions related to manipulating test runner */ 565 | declare var jest: JestObjectType; 566 | 567 | /** 568 | * The global Jasmine object, this is generally not exposed as the public API, 569 | * using features inside here could break in later versions of Jest. 570 | */ 571 | declare var jasmine: { 572 | DEFAULT_TIMEOUT_INTERVAL: number, 573 | any(value: mixed): JestAsymmetricEqualityType, 574 | anything(): void, 575 | arrayContaining(value: Array): void, 576 | clock(): JestClockType, 577 | createSpy(name: string): JestSpyType, 578 | createSpyObj( 579 | baseName: string, 580 | methodNames: Array 581 | ): { [methodName: string]: JestSpyType }, 582 | objectContaining(value: Object): void, 583 | stringMatching(value: string): void 584 | }; 585 | --------------------------------------------------------------------------------