├── .babelrc ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── __tests__ └── component-test.js ├── demo ├── demo.bundle.js ├── demo.bundle.js.map ├── index.html ├── src │ ├── css │ │ ├── demo.scss │ │ └── style.scss │ ├── index.js │ └── vendor │ │ ├── _base.scss │ │ ├── github.css │ │ ├── rainbow-custom.min.js │ │ ├── skeleton.css │ │ └── syntax.css ├── style.css └── style.css.map ├── dev_server └── index.html ├── lib ├── react-ux-password-field.js └── react-ux-password-field.min.js ├── package.json ├── src ├── img │ ├── lock.png │ └── lock2.png ├── index.js └── js │ ├── banner.js │ └── config.js ├── webpack.config.js ├── webpack.demo.config.js ├── webpack.min.config.js └── webpack.server.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "stage": 1 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [Unreleased](https://github.com/seethroughtrees/react-ux-password-field/tree/HEAD) 4 | 5 | [Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/0.9.10...HEAD) 6 | 7 | **Closed issues:** 8 | 9 | - dangerouslySetInnerHTML error when nesting HTML within InputPassword component [\#35](https://github.com/seethroughtrees/react-ux-password-field/issues/35) 10 | - Organize npm dependencies [\#33](https://github.com/seethroughtrees/react-ux-password-field/issues/33) 11 | - When 'handleChange' is called the wrong 'isValid' value is sent to parent component [\#28](https://github.com/seethroughtrees/react-ux-password-field/issues/28) 12 | 13 | **Merged pull requests:** 14 | 15 | - fixes additional prerendering bug from getDOMNode\(\) [\#39](https://github.com/seethroughtrees/react-ux-password-field/pull/39) ([AppSorcery](https://github.com/AppSorcery)) 16 | - Feature/update [\#38](https://github.com/seethroughtrees/react-ux-password-field/pull/38) ([seethroughtrees](https://github.com/seethroughtrees)) 17 | - adds check for existence of global navigator variable [\#37](https://github.com/seethroughtrees/react-ux-password-field/pull/37) ([AppSorcery](https://github.com/AppSorcery)) 18 | - Move build-time npm packages to devDependencies [\#34](https://github.com/seethroughtrees/react-ux-password-field/pull/34) ([ahoym](https://github.com/ahoym)) 19 | - Load zxcvbn when component is mounted. Fixes \#27. [\#31](https://github.com/seethroughtrees/react-ux-password-field/pull/31) ([dylanjbarth](https://github.com/dylanjbarth)) 20 | 21 | ## [0.9.10](https://github.com/seethroughtrees/react-ux-password-field/tree/0.9.10) (2015-10-19) 22 | [Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/0.9.9...0.9.10) 23 | 24 | **Closed issues:** 25 | 26 | - Do not call addPasswordType\(\) when umounted [\#25](https://github.com/seethroughtrees/react-ux-password-field/issues/25) 27 | - Input behaves weird on latest Firefox [\#15](https://github.com/seethroughtrees/react-ux-password-field/issues/15) 28 | - Need DOM access to password input [\#9](https://github.com/seethroughtrees/react-ux-password-field/issues/9) 29 | 30 | **Merged pull requests:** 31 | 32 | - Fixes \#25 which will cancel the debouncer when umounted. Also bumps J… [\#26](https://github.com/seethroughtrees/react-ux-password-field/pull/26) ([binarykitchen](https://github.com/binarykitchen)) 33 | 34 | ## [0.9.9](https://github.com/seethroughtrees/react-ux-password-field/tree/0.9.9) (2015-09-10) 35 | [Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/0.9.8...0.9.9) 36 | 37 | **Closed issues:** 38 | 39 | - Add license [\#22](https://github.com/seethroughtrees/react-ux-password-field/issues/22) 40 | - option needed: unMaskStyle [\#21](https://github.com/seethroughtrees/react-ux-password-field/issues/21) 41 | - Warning: setState\(...\): Can only update a mounted or mounting component. This usually means you called setState\(\) on an unmounted component. This is a no-op. [\#14](https://github.com/seethroughtrees/react-ux-password-field/issues/14) 42 | 43 | ## [0.9.8](https://github.com/seethroughtrees/react-ux-password-field/tree/0.9.8) (2015-08-31) 44 | [Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/list...0.9.8) 45 | 46 | **Closed issues:** 47 | 48 | - Why is v0.9.7 on npm when you are still on v0.9.6? [\#23](https://github.com/seethroughtrees/react-ux-password-field/issues/23) 49 | 50 | ## [list](https://github.com/seethroughtrees/react-ux-password-field/tree/list) (2015-08-20) 51 | **Implemented enhancements:** 52 | 53 | - Hide meter until user starts typing [\#11](https://github.com/seethroughtrees/react-ux-password-field/issues/11) 54 | 55 | **Fixed bugs:** 56 | 57 | - zxcvbn is not defined [\#13](https://github.com/seethroughtrees/react-ux-password-field/issues/13) 58 | 59 | **Closed issues:** 60 | 61 | - Pass on the value in changeCb\(\) too [\#17](https://github.com/seethroughtrees/react-ux-password-field/issues/17) 62 | - this.props.onChange\(\) should be called after handleZxcvbn [\#16](https://github.com/seethroughtrees/react-ux-password-field/issues/16) 63 | - using it directly on bower [\#10](https://github.com/seethroughtrees/react-ux-password-field/issues/10) 64 | - Bug: first character I type causes strength meter to disappear [\#8](https://github.com/seethroughtrees/react-ux-password-field/issues/8) 65 | - make this.props.onChange conditional [\#7](https://github.com/seethroughtrees/react-ux-password-field/issues/7) 66 | - Styling of strength meter [\#6](https://github.com/seethroughtrees/react-ux-password-field/issues/6) 67 | - How to add a custom strength / score for repeated password inputs? [\#5](https://github.com/seethroughtrees/react-ux-password-field/issues/5) 68 | - Adding onChange breaks functionality [\#4](https://github.com/seethroughtrees/react-ux-password-field/issues/4) 69 | - Uncaught ReferenceError: zxcvbn is not defined [\#3](https://github.com/seethroughtrees/react-ux-password-field/issues/3) 70 | 71 | **Merged pull requests:** 72 | 73 | - Add "browser" field to package.json [\#20](https://github.com/seethroughtrees/react-ux-password-field/pull/20) ([brigand](https://github.com/brigand)) 74 | - Add more parameters in callbacks and bump packages [\#18](https://github.com/seethroughtrees/react-ux-password-field/pull/18) ([binarykitchen](https://github.com/binarykitchen)) 75 | - onChange branch change [\#2](https://github.com/seethroughtrees/react-ux-password-field/pull/2) ([dignifiedquire](https://github.com/dignifiedquire)) 76 | 77 | 78 | 79 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Adam L (seethroughtrees) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **Please note:** - I'm happy to hear people are getting use out of this component, however, I'm no longer using it or able to maintain it. Please check out the [issue here](https://github.com/seethroughtrees/react-ux-password-field/issues/44) for updates. 2 | 3 | React UX Password Field 4 | ============= 5 | 6 | Demo and full options: [https://seethroughtrees.github.io/react-ux-password-field/](https://seethroughtrees.github.io/react-ux-password-field/) 7 | 8 | * * * 9 | 10 | This react component aims to improve common issues in password field UX. 11 | 12 | 1. **Password Strength Detection** - Using Dropbox's [zxcvbn](https://blogs.dropbox.com/tech/2012/04/zxcvbn-realistic-password-strength-estimation/) library in real-time, onChange. 13 | 2. **Timed Password Masking** - Best explained in the [nngroup](http://www.nngroup.com/articles/stop-password-masking/) article: [Stop Password Masking](http://www.nngroup.com/articles/stop-password-masking/) 14 | 3. **Stateful Class** - Know the HTML5 validity of your field by class. 15 | 16 | ## Install 17 | 18 | ```npm install react-ux-password-field``` 19 | 20 | ## Use 21 | 22 | ``` javascript 23 | // use it like any other react component. 24 | // just require and place it inside your render function. 25 | 26 | var InputPassword = require('react-ux-password-field'); 27 | 28 | ... 29 | 30 | render: function() { 31 | return ( 32 | 33 | ) 34 | } 35 | ``` 36 | 37 | _* React UX Password Field is UMD compatible, meaning it will load with 38 | [commonJS](http://wiki.commonjs.org/wiki/CommonJS), [AMD/RequireJS](http://requirejs.org/), or standalone._ 39 | 40 | ## Options (props) 41 | 42 | React UX Password Field will work fine with its defaults, but there is a lot 43 | of configuration options. 44 | 45 | Read them on the site: [https://seethroughtrees.github.io/react-ux-password-field/](https://seethroughtrees.github.io/react-ux-password-field/) 46 | 47 | ## Contributing 48 | 49 | Pull requests are happily welcomed, please [https://github.com/seethroughtrees/react-ux-password-field/issues](create an issue) explaining the problem you're solving first, and pull-request to an upstream branch instead of master. 50 | -------------------------------------------------------------------------------- /__tests__/component-test.js: -------------------------------------------------------------------------------- 1 | // waiting for jest to work with node 0.12 2 | // https://github.com/facebook/jest/issues/243 3 | 4 | jest.dontMock('../lib/react-ux-password-field'); 5 | 6 | var React = require('react/addons'); 7 | var Util = React.addons.TestUtils; 8 | var InputPassword = require('../lib/react-ux-password-field'); 9 | 10 | describe("component", function() { 11 | it('displays the input field', function() { 12 | 13 | var component = Util.renderIntoDocument( 14 | 15 | ); 16 | 17 | var input = Util.findRenderedDOMComponentWithTag(component, 'input'); 18 | 19 | Util.Simulate.change(input, {target: {value: 'On'}}); 20 | 21 | expect(input.getDOMNode().textContent).toEqual('On'); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /demo/demo.bundle.js: -------------------------------------------------------------------------------- 1 | !function(t){function e(a){if(n[a])return n[a].exports;var s=n[a]={exports:{},id:a,loaded:!1};return t[a].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([/*!***************************!*\ 2 | !*** ./demo/src/index.js ***! 3 | \***************************/ 4 | function(t,e,n){"use strict";n(7),n(5),n(4),n(6),n(2),n(9),n(8);var a=n(1),s=n(3);a.render(a.createElement("form",null,a.createElement("fieldset",null,a.createElement("label",{htmlFor:"password1"},"Password"),a.createElement(s,{id:"password1",name:"password1",placeholder:"Try me out! Enter a random password.",minScore:1,minLength:5,zxcvbn:"debug"}))),document.getElementById("content"))},/*!************************!*\ 5 | !*** external "React" ***! 6 | \************************/ 7 | function(t,e){t.exports=React},/*!***********************************************!*\ 8 | !*** ./demo/src/vendor/rainbow-custom.min.js ***! 9 | \***********************************************/ 10 | function(t,e){"use strict";window.Rainbow=function(){function t(t){var e,n=t.getAttribute&&t.getAttribute("data-language")||0;if(!n)for(t=t.attributes,e=0;e=t&&e>=h[v][n])&&(delete h[v][n],delete d[v][n]),t>=n&&tn&&e'+e+""}function s(t,e,i,p){if("undefined"==typeof t||null===t)p();else{var l=t.exec(i);if(l){++y,!e.name&&"string"==typeof e.matches[0]&&(e.name=e.matches[0],delete e.matches[0]);var u=l[0],g=l.index,m=l[0].length+g,f=function(){function n(){s(t,e,i,p)}y%100>0?n():setTimeout(n,0)};if(n(g,m))f();else{var b=r(e.matches),w=function x(t,n,s){if(t>=n.length)s(u);else{var r=l[n[t]];if(r){var i=e.matches[n[t]],p=i.language,g=i.name&&i.matches?i.matches:i,d=function(e,r,o){var i;i=0;var c;for(c=1;c0?r():setTimeout(r,0)}else s(t)}var a=r(d[v]);n(t,a,0,e)}function c(t,e,n){var a=m[e]||[],s=m[b]||[],e=f[e]?a:a.concat(s);o(t.replace(//g,">").replace(/&(?![\w\#]+;)/g,"&"),e,n)}function p(t,n,a){var s=!0;t:for(;s;){var r=t,o=n,i=a;if(s=!1,o=0||Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a]);return n}var s=Object.assign||function(t){for(var e=1;e0&&this.props.strengthLang.length>0?this.props.strengthLang[this.state.score]:null)));var e=this.props,o=(e.onChange,a(e,["onChange"])),i=this;return"undefined"!=typeof navigator&&setTimeout(function(){if(/Firefox/.test(navigator.userAgent)){var t=i.refs[i.props.id].getDOMNode();t.selectionStart=i.state.selectionStart,t.selectionEnd=i.state.selectionEnd}},1),r.createElement("div",{style:{position:"relative",display:"inline-block"},className:"passwordField","data-valid":this.state.isValid,"data-score":this.state.score,"data-entropy":this.state.entropy},r.createElement("input",s({ref:this.props.id,className:"passwordField__input",type:this.state.isPassword?"password":"text",value:this.state.value,style:this.state.isPassword?null:this.unMaskStyle,onChange:this.handleChange},o)),t)}});t.exports=p},function(e,n){e.exports=t},function(t,e){t.exports={statusColor:"#5CE592",statusInactiveColor:"#FC6F6F",unMaskColor:"#c7c7c7",unMaskTime:1400,zxcvbnSrc:"https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js",strengthLang:["Weak","Okay","Good","Strong","Great"]}},function(t,e){function n(t,e,n){function a(e){var n=m,a=f;return m=f=void 0,S=e,b=t.apply(a,n)}function r(t){return S=t,y=setTimeout(l,e),A?a(t):b}function o(t){var n=t-k,a=t-S,s=e-n;return E?x(s,v-a):s}function p(t){var n=t-k,a=t-S;return!k||n>=e||0>n||E&&a>=v}function l(){var t=M();return p(t)?u(t):void(y=setTimeout(l,o(t)))}function u(t){return clearTimeout(y),y=void 0,N&&m?a(t):(m=f=void 0,b)}function g(){void 0!==y&&clearTimeout(y),k=S=0,m=f=y=void 0}function d(){return void 0===y?b:u(M())}function h(){var t=M(),n=p(t);if(m=arguments,f=this,k=t,n){if(void 0===y)return r(k);if(E)return clearTimeout(y),y=setTimeout(l,e),a(k)}return void 0===y&&(y=setTimeout(l,e)),b}var m,f,v,b,y,k=0,S=0,A=!1,E=!1,N=!0;if("function"!=typeof t)throw new TypeError(c);return e=i(e)||0,s(n)&&(A=!!n.leading,E="maxWait"in n,v=E?w(i(n.maxWait)||0,e):v,N="trailing"in n?!!n.trailing:N),h.cancel=g,h.flush=d,h}function a(t){var e=s(t)?y.call(t):"";return e==l||e==u}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function r(t){return!!t&&"object"==typeof t}function o(t){return"symbol"==typeof t||r(t)&&y.call(t)==g}function i(t){if("number"==typeof t)return t;if(o(t))return p;if(s(t)){var e=a(t.valueOf)?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(d,"");var n=m.test(t);return n||f.test(t)?v(t.slice(2),n?2:8):h.test(t)?p:+t}var c="Expected a function",p=NaN,l="[object Function]",u="[object GeneratorFunction]",g="[object Symbol]",d=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,f=/^0o[0-7]+$/i,v=parseInt,b=Object.prototype,y=b.toString,w=Math.max,x=Math.min,M=Date.now;t.exports=n},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cD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qRys8IxZpenTglHUEOxAhQEZ5/OM01qAMnwah+3Ng2BTpTGr2a1gHnSDCVXGs7Z2QpVxjUNSKjGeo29T+RuHqaRqtOdGVGZ1in6/VH9OYZet01Uhnx5qBLyAIT+MvVQulslLflWuazq+BKFXnvEaWAzI+IA31ezUMEaJE6dDQYb+9yrdMrs7oP9HgAEAXmVa5ulD/g0AAAAASUVORK5CYII="}])})},/*!************************************!*\ 23 | !*** ./demo/src/vendor/github.css ***! 24 | \************************************/ 25 | function(t,e){},/*!**************************************!*\ 26 | !*** ./demo/src/vendor/skeleton.css ***! 27 | \**************************************/ 28 | function(t,e){},/*!************************************!*\ 29 | !*** ./demo/src/vendor/syntax.css ***! 30 | \************************************/ 31 | function(t,e){},/*!***************************************!*\ 32 | !*** ./~/normalize.css/normalize.css ***! 33 | \***************************************/ 34 | function(t,e){},/*!********************************!*\ 35 | !*** ./demo/src/css/demo.scss ***! 36 | \********************************/ 37 | function(t,e){},/*!*********************************!*\ 38 | !*** ./demo/src/css/style.scss ***! 39 | \*********************************/ 40 | function(t,e){}]); 41 | //# sourceMappingURL=demo.bundle.js.map -------------------------------------------------------------------------------- /demo/demo.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///demo.bundle.js","webpack:///webpack/bootstrap 99fc2cdeace5d68cc154","webpack:///./demo/src/index.js","webpack:///external \"React\"","webpack:///./demo/src/vendor/rainbow-custom.min.js","webpack:///./lib/react-ux-password-field.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","React","InputPassword","render","createElement","htmlFor","name","placeholder","minScore","minLength","zxcvbn","document","getElementById","window","Rainbow","q","a","b","getAttribute","attributes","length","nodeName","nodeValue","B","parentNode","className","match","C","f","d","parseInt","j","r","replace","l","s","i","e","exec","t","matches","k","g","index","u","h","setTimeout","v","language","substr","n","w","with","hasOwnProperty","push","sort","pattern","D","x","y","z","concat","o","_x","_x2","_x3","_again","_function","indexOf","undefined","toLowerCase","innerHTML","A","getElementsByTagName","extend","arguments","_a","color","addEventListener","attachEvent","onHighlight","addClass","1","2","3","4","5","root","factory","__WEBPACK_EXTERNAL_MODULE_1__","_objectWithoutProperties","obj","keys","target","Object","prototype","_extends","assign","source","key","RP","PropTypes","config","debounce","createClass","displayName","propTypes","infoBar","bool","statusColor","string","statusInactiveColor","number","changeCb","func","toggleMask","unMaskTime","strengthLang","array","getDefaultProps","zxcvbnSrc","getInitialState","value","score","entropy","isPassword","isValid","getMeterStyle","width","this","state","props","maxWidth","opacity","background","height","transition","display","marginRight","unMaskStyle","unMaskColor","fontWeight","infoStyle","position","bottom","overflow","iconStyle","top","strengthLangStyle","fontSize","addPasswordType","setState","handleInputType","handleChange","preventDefault","native_target","nativeEvent","val","validity","valid","selectionStart","selectionEnd","handleToggleMask","handleZxcvbn","onChange","handleMinLength","maskPassword","stats","currentScore","console","debug","len","componentWillMount","src","type","async","insertBefore","componentWillUnmount","cancel","style","_props","that","navigator","test","userAgent","elem","refs","getDOMNode","data-valid","data-score","data-entropy","ref","wait","options","invokeFunc","time","args","lastArgs","thisArg","lastThis","lastInvokeTime","result","apply","leadingEdge","timerId","timerExpired","leading","remainingWait","timeSinceLastCall","lastCallTime","timeSinceLastInvoke","maxing","nativeMin","maxWait","shouldInvoke","now","trailingEdge","clearTimeout","trailing","flush","debounced","isInvoking","TypeError","FUNC_ERROR_TEXT","toNumber","isObject","nativeMax","isFunction","tag","objectToString","funcTag","genTag","isObjectLike","isSymbol","symbolTag","NAN","other","valueOf","reTrim","isBinary","reIsBinary","reIsOctal","freeParseInt","slice","reIsBadHex","objectProto","toString","Math","max","min","Date"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,E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.bundle.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/*!***************************!*\\\n !*** ./demo/src/index.js ***!\n \\***************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t// demo pages css\n\t__webpack_require__(/*! normalize.css/normalize.css */ 7);\n\t__webpack_require__(/*! ./vendor/skeleton.css */ 5);\n\t__webpack_require__(/*! ./vendor/github.css */ 4);\n\t__webpack_require__(/*! ./vendor/syntax.css */ 6);\n\t__webpack_require__(/*! ./vendor/rainbow-custom.min.js */ 2);\n\t__webpack_require__(/*! ./css/style.scss */ 9);\n\t\n\t// css for form field\n\t__webpack_require__(/*! ./css/demo.scss */ 8);\n\t\n\t/*========== APP ==========*/\n\t\n\tvar React = __webpack_require__(/*! react */ 1),\n\t InputPassword = __webpack_require__(/*! ../../lib/react-ux-password-field.js */ 3);\n\t\n\tReact.render(React.createElement(\n\t 'form',\n\t null,\n\t React.createElement(\n\t 'fieldset',\n\t null,\n\t React.createElement(\n\t 'label',\n\t { htmlFor: 'password1' },\n\t 'Password'\n\t ),\n\t React.createElement(InputPassword, {\n\t id: 'password1',\n\t name: 'password1',\n\t placeholder: 'Try me out! Enter a random password.',\n\t minScore: 1,\n\t minLength: 5,\n\t zxcvbn: 'debug'\n\t })\n\t )\n\t), document.getElementById('content'));\n\n/***/ },\n/* 1 */\n/*!************************!*\\\n !*** external \"React\" ***!\n \\************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = React;\n\n/***/ },\n/* 2 */\n/*!***********************************************!*\\\n !*** ./demo/src/vendor/rainbow-custom.min.js ***!\n \\***********************************************/\n/***/ function(module, exports) {\n\n\t/* Rainbow v1.2 rainbowco.de | included languages: generic, shell, javascript, html */\n\t\"use strict\";\n\t\n\twindow.Rainbow = (function () {\n\t function q(a) {\n\t var b,\n\t c = a.getAttribute && a.getAttribute(\"data-language\") || 0;if (!c) {\n\t a = a.attributes;for (b = 0; b < a.length; ++b) if (\"data-language\" === a[b].nodeName) return a[b].nodeValue;\n\t }return c;\n\t }function B(a) {\n\t var b = q(a) || q(a.parentNode);if (!b) {\n\t var c = /\\blang(?:uage)?-(\\w+)/;(a = a.className.match(c) || a.parentNode.className.match(c)) && (b = a[1]);\n\t }return b;\n\t }function C(a, b) {\n\t for (var c in f[d]) {\n\t c = parseInt(c, 10);if (a == c && b == f[d][c] ? 0 : a <= c && b >= f[d][c]) delete f[d][c], delete j[d][c];if (a >= c && a < f[d][c] || b > c && b < f[d][c]) return !0;\n\t }return !1;\n\t }function r(a, b) {\n\t return '' + b + \"\";\n\t }function s(a, b, c, i) {\n\t if (\"undefined\" === typeof a || null === a) i();else {\n\t var e = a.exec(c);if (e) {\n\t ++t;!b.name && \"string\" == typeof b.matches[0] && (b.name = b.matches[0], delete b.matches[0]);var k = e[0],\n\t g = e.index,\n\t u = e[0].length + g,\n\t h = function h() {\n\t function e() {\n\t s(a, b, c, i);\n\t }t % 100 > 0 ? e() : setTimeout(e, 0);\n\t };if (C(g, u)) h();else {\n\t var m = v(b.matches),\n\t l = function l(a, c, i) {\n\t if (a >= c.length) i(k);else {\n\t var d = e[c[a]];if (d) {\n\t var g = b.matches[c[a]],\n\t f = g.language,\n\t h = g.name && g.matches ? g.matches : g,\n\t j = function j(b, d, g) {\n\t var f;f = 0;var h;for (h = 1; h < c[a]; ++h) e[h] && (f = f + e[h].length);d = g ? r(g, d) : d;k = k.substr(0, f) + k.substr(f).replace(b, d);l(++a, c, i);\n\t };f ? n(d, f, function (a) {\n\t j(d, a);\n\t }) : typeof g === \"string\" ? j(d, d, g) : w(d, h.length ? h : [h], function (a) {\n\t j(d, a, g.matches ? g.name : 0);\n\t });\n\t } else l(++a, c, i);\n\t }\n\t };l(0, m, function (a) {\n\t b.name && (a = r(b.name, a));if (!j[d]) {\n\t j[d] = {};f[d] = {};\n\t }j[d][g] = { replace: e[0], \"with\": a };f[d][g] = u;h();\n\t });\n\t }\n\t } else i();\n\t }\n\t }function v(a) {\n\t var b = [],\n\t c;for (c in a) a.hasOwnProperty(c) && b.push(c);return b.sort(function (a, b) {\n\t return b - a;\n\t });\n\t }function w(a, b, c) {\n\t function i(b, k) {\n\t k < b.length ? s(b[k].pattern, b[k], a, function () {\n\t i(b, ++k);\n\t }) : D(a, function (a) {\n\t delete j[d];delete f[d];--d;c(a);\n\t });\n\t }++d;i(b, 0);\n\t }function D(a, b) {\n\t function c(a, b, i, f) {\n\t if (i < b.length) {\n\t ++x;var h = b[i],\n\t l = j[d][h],\n\t a = a.substr(0, h) + a.substr(h).replace(l.replace, l[\"with\"]),\n\t h = function h() {\n\t c(a, b, ++i, f);\n\t };0 < x % 250 ? h() : setTimeout(h, 0);\n\t } else f(a);\n\t }var i = v(j[d]);c(a, i, 0, b);\n\t }function n(a, b, c) {\n\t var d = m[b] || [],\n\t e = m[y] || [],\n\t b = z[b] ? d : d.concat(e);w(a.replace(//g, \">\").replace(/&(?![\\w\\#]+;)/g, \"&\"), b, c);\n\t }function o(_x, _x2, _x3) {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t var a = _x,\n\t b = _x2,\n\t c = _x3;\n\t _again = false;\n\t if (b < a.length) {\n\t var d = a[b],\n\t e = B(d);if (!(-1 < (\" \" + d.className + \" \").indexOf(\" rainbow \")) && e) {\n\t return e = e.toLowerCase(), d.className += d.className ? \" rainbow\" : \"rainbow\", n(d.innerHTML, e, function (k) {\n\t d.innerHTML = k;j = {};f = {};p && p(d, e);setTimeout(function () {\n\t o(a, ++b, c);\n\t }, 0);\n\t });\n\t } else {\n\t _x = a;\n\t _x2 = ++b;\n\t _x3 = c;\n\t _again = true;\n\t d = e = undefined;\n\t continue _function;\n\t }\n\t }c && c();\n\t }\n\t }function A(a, b) {\n\t var a = a && \"function\" == typeof a.getElementsByTagName ? a : document,\n\t c = a.getElementsByTagName(\"pre\"),\n\t d = a.getElementsByTagName(\"code\"),\n\t e,\n\t f = [],\n\t g = [];for (e = 0; e < c.length; ++e) c[e].getElementsByTagName(\"code\").length ? c[e].innerHTML = c[e].innerHTML.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\") : f.push(c[e]);for (e = 0; e < d.length; ++e) g.push(d[e]);o(g.concat(f), 0, b);\n\t }var j = {},\n\t f = {},\n\t m = {},\n\t z = {},\n\t d = 0,\n\t y = 0,\n\t t = 0,\n\t x = 0,\n\t l,\n\t p;return { extend: function extend(a, b, c) {\n\t 1 == arguments.length && (b = a, a = y);z[a] = c;m[a] = b.concat(m[a] || []);\n\t }, b: function b(a) {\n\t p = a;\n\t }, a: function a(_a) {\n\t l = _a;\n\t }, color: function color(a, b, c) {\n\t if (\"string\" == typeof a) return n(a, b, c);if (\"function\" == typeof a) return A(0, a);A(a, b);\n\t } };\n\t})();\n\tdocument.addEventListener ? document.addEventListener(\"DOMContentLoaded\", Rainbow.color, !1) : window.attachEvent(\"onload\", Rainbow.color);Rainbow.onHighlight = Rainbow.b;Rainbow.addClass = Rainbow.a;Rainbow.extend([{ matches: { 1: [{ name: \"keyword.operator\", pattern: /\\=|\\+/g }, { name: \"keyword.dot\", pattern: /\\./g }], 2: { name: \"string\", matches: { name: \"constant.character.escape\", pattern: /\\\\('|\"){1}/g } } }, pattern: /(\\(|\\s|\\[|\\=|:|\\+|\\.)(('|\")([^\\\\\\1]|\\\\.)*?(\\3))/gm }, { name: \"comment\", pattern: /\\/\\*[\\s\\S]*?\\*\\/|(\\/\\/|\\#)[\\s\\S]*?$/gm }, { name: \"constant.numeric\", pattern: /\\b(\\d+(\\.\\d+)?(e(\\+|\\-)?\\d+)?(f|d)?|0x[\\da-f]+)\\b/gi }, { matches: { 1: \"keyword\" }, pattern: /\\b(and|array|as|b(ool(ean)?|reak)|c(ase|atch|har|lass|on(st|tinue))|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\\(|\\b)/gi }, { name: \"constant.language\", pattern: /true|false|null/g }, { name: \"keyword.operator\", pattern: /\\+|\\!|\\-|&(gt|lt|amp);|\\||\\*|\\=/g }, { matches: { 1: \"function.call\" }, pattern: /(\\w+?)(?=\\()/g }, { matches: { 1: \"storage.function\", 2: \"entity.name.function\" }, pattern: /(function)\\s(.*?)(?=\\()/g }]);Rainbow.extend(\"shell\", [{ name: \"shell\", matches: { 1: { language: \"shell\" } }, pattern: /\\$\\(([\\s\\S]*?)\\)/gm }, { matches: { 2: \"string\" }, pattern: /(\\(|\\s|\\[|\\=)(('|\")[\\s\\S]*?(\\3))/gm }, { name: \"keyword.operator\", pattern: /<|>|&/g }, { name: \"comment\", pattern: /\\#[\\s\\S]*?$/gm }, { name: \"storage.function\", pattern: /(.+?)(?=\\(\\)\\s{0,}\\{)/g }, { name: \"support.command\", pattern: /\\b(echo|rm|ls|(mk|rm)dir|cd|find|cp|exit|pwd|exec|trap|source|shift|unset)/g }, { matches: { 1: \"keyword\" }, pattern: /\\b(break|case|continue|do|done|elif|else|esac|eval|export|fi|for|function|if|in|local|return|set|then|unset|until|while)(?=\\(|\\b)/g }], !0);Rainbow.extend(\"javascript\", [{ name: \"selector\", pattern: /(\\s|^)\\$(?=\\.|\\()/g }, { name: \"support\", pattern: /\\b(window|document)\\b/g }, { matches: { 1: \"support.property\" }, pattern: /\\.(length|node(Name|Value))\\b/g }, { matches: { 1: \"support.function\" }, pattern: /(setTimeout|setInterval)(?=\\()/g }, { matches: { 1: \"support.method\" }, pattern: /\\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\\()/g }, { name: \"string.regexp\", matches: { 1: \"string.regexp.open\", 2: { name: \"constant.regexp.escape\", pattern: /\\\\(.){1}/g },\n\t 3: \"string.regexp.close\", 4: \"string.regexp.modifier\" }, pattern: /(\\/)(?!\\*)(.+)(\\/)([igm]{0,3})/g }, { matches: { 1: \"storage\", 3: \"entity.function\" }, pattern: /(var)?(\\s|^)(\\S*)(?=\\s?=\\s?function\\()/g }, { matches: { 1: \"keyword\", 2: \"entity.function\" }, pattern: /(new)\\s+(.*)(?=\\()/g }, { name: \"entity.function\", pattern: /(\\w+)(?=:\\s{0,}function)/g }]);Rainbow.extend(\"html\", [{ name: \"source.php.embedded\", matches: { 2: { language: \"php\" } }, pattern: /<\\?=?(?!xml)(php)?([\\s\\S]*?)(\\?>)/gm }, { name: \"source.css.embedded\", matches: { 1: { matches: { 1: \"support.tag.style\", 2: [{ name: \"entity.tag.style\", pattern: /^style/g }, { name: \"string\", pattern: /('|\")(.*?)(\\1)/g }, { name: \"entity.tag.style.attribute\", pattern: /(\\w+)/g }], 3: \"support.tag.style\" }, pattern: /(<\\/?)(style.*?)(>)/g }, 2: { language: \"css\" }, 3: \"support.tag.style\", 4: \"entity.tag.style\", 5: \"support.tag.style\" }, pattern: /(<style.*?>)([\\s\\S]*?)(<\\/)(style)(>)/gm }, { name: \"source.js.embedded\", matches: { 1: { matches: { 1: \"support.tag.script\", 2: [{ name: \"entity.tag.script\", pattern: /^script/g }, { name: \"string\", pattern: /('|\")(.*?)(\\1)/g }, { name: \"entity.tag.script.attribute\", pattern: /(\\w+)/g }], 3: \"support.tag.script\" }, pattern: /(<\\/?)(script.*?)(>)/g }, 2: { language: \"javascript\" }, 3: \"support.tag.script\", 4: \"entity.tag.script\", 5: \"support.tag.script\" }, pattern: /(<script(?! src).*?>)([\\s\\S]*?)(<\\/)(script)(>)/gm }, { name: \"comment.html\", pattern: /<\\!--[\\S\\s]*?-->/g }, { matches: { 1: \"support.tag.open\", 2: \"support.tag.close\" }, pattern: /(<)|(\\/?\\??>)/g }, { name: \"support.tag\", matches: { 1: \"support.tag\", 2: \"support.tag.special\", 3: \"support.tag-name\" }, pattern: /(<\\??)(\\/|\\!?)(\\w+)/g }, { matches: { 1: \"support.attribute\" }, pattern: /([a-z-]+)(?=\\=)/gi }, { matches: { 1: \"support.operator\", 2: \"string.quote\", 3: \"string.value\", 4: \"string.quote\" }, pattern: /(=)('|\")(.*?)(\\2)/g }, { matches: { 1: \"support.operator\", 2: \"support.value\" }, pattern: /(=)([a-zA-Z\\-0-9]*)\\b/g }, { matches: { 1: \"support.attribute\" },\n\t pattern: /\\s(\\w+)(?=\\s|>)(?![\\s\\S]*<)/g }], !0);\n\n/***/ },\n/* 3 */\n/*!****************************************!*\\\n !*** ./lib/react-ux-password-field.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*!\n\t * React UX Password Field\n\t * version: 0.9.12\n\t * \n\t * MIT Licensed\n\t * github: https://github.com/seethroughtrees/react-ux-password-field/\n\t * demo: https://seethroughtrees.github.io/react-ux-password-field/\n\t * \n\t */\n\t'use strict';\n\t\n\t(function webpackUniversalModuleDefinition(root, factory) {\n\t\tif (true) module.exports = factory(__webpack_require__(/*! react */ 1));else if (typeof define === 'function' && define.amd) define([\"react\"], factory);else if (typeof exports === 'object') exports[\"react-ux-password-field\"] = factory(require(\"react\"));else root[\"react-ux-password-field\"] = factory(root[\"React\"]);\n\t})(undefined, function (__WEBPACK_EXTERNAL_MODULE_1__) {\n\t\treturn (/******/(function (modules) {\n\t\t\t\t// webpackBootstrap\n\t\t\t\t/******/ // The module cache\n\t\t\t\t/******/var installedModules = {};\n\t\n\t\t\t\t/******/ // The require function\n\t\t\t\t/******/function __webpack_require__(moduleId) {\n\t\n\t\t\t\t\t/******/ // Check if module is in cache\n\t\t\t\t\t/******/if (installedModules[moduleId])\n\t\t\t\t\t\t/******/return installedModules[moduleId].exports;\n\t\n\t\t\t\t\t/******/ // Create a new module (and put it into the cache)\n\t\t\t\t\t/******/var module = installedModules[moduleId] = {\n\t\t\t\t\t\t/******/exports: {},\n\t\t\t\t\t\t/******/id: moduleId,\n\t\t\t\t\t\t/******/loaded: false\n\t\t\t\t\t\t/******/ };\n\t\n\t\t\t\t\t/******/ // Execute the module function\n\t\t\t\t\t/******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\n\t\t\t\t\t/******/ // Flag the module as loaded\n\t\t\t\t\t/******/module.loaded = true;\n\t\n\t\t\t\t\t/******/ // Return the exports of the module\n\t\t\t\t\t/******/return module.exports;\n\t\t\t\t\t/******/\n\t\t\t\t}\n\t\n\t\t\t\t/******/ // expose the modules object (__webpack_modules__)\n\t\t\t\t/******/__webpack_require__.m = modules;\n\t\n\t\t\t\t/******/ // expose the module cache\n\t\t\t\t/******/__webpack_require__.c = installedModules;\n\t\n\t\t\t\t/******/ // __webpack_public_path__\n\t\t\t\t/******/__webpack_require__.p = \"\";\n\t\n\t\t\t\t/******/ // Load entry module and return exports\n\t\t\t\t/******/return __webpack_require__(0);\n\t\t\t\t/******/\n\t\t\t})(\n\t\t\t/************************************************************************/\n\t\t\t/******/[\n\t\t\t/* 0 */\n\t\t\tfunction (module, exports, __webpack_require__) {\n\t\n\t\t\t\t'use strict';\n\t\n\t\t\t\tvar _extends = Object.assign || function (target) {\n\t\t\t\t\tfor (var i = 1; i < arguments.length; i++) {\n\t\t\t\t\t\tvar source = arguments[i];for (var key in source) {\n\t\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\t\t\t\t\t\ttarget[key] = source[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}return target;\n\t\t\t\t};\n\t\n\t\t\t\tfunction _objectWithoutProperties(obj, keys) {\n\t\t\t\t\tvar target = {};for (var i in obj) {\n\t\t\t\t\t\tif (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];\n\t\t\t\t\t}return target;\n\t\t\t\t}\n\t\n\t\t\t\tvar React = __webpack_require__(1),\n\t\t\t\t RP = React.PropTypes,\n\t\t\t\t config = __webpack_require__(2),\n\t\t\t\t debounce = __webpack_require__(3);\n\t\n\t\t\t\tvar InputPassword = React.createClass({\n\t\t\t\t\tdisplayName: 'InputPassword',\n\t\n\t\t\t\t\t/*========== VALIDATE ==========*/\n\t\n\t\t\t\t\tpropTypes: {\n\t\t\t\t\t\tinfoBar: RP.bool,\n\t\t\t\t\t\tstatusColor: RP.string,\n\t\t\t\t\t\tstatusInactiveColor: RP.string,\n\t\t\t\t\t\tminScore: RP.number,\n\t\t\t\t\t\tchangeCb: RP.func,\n\t\t\t\t\t\ttoggleMask: RP.bool,\n\t\t\t\t\t\tunMaskTime: RP.number,\n\t\t\t\t\t\tminLength: RP.number,\n\t\t\t\t\t\tstrengthLang: RP.array,\n\t\t\t\t\t\tid: RP.string\n\t\t\t\t\t},\n\t\n\t\t\t\t\t/*========== DEFAULTS ==========*/\n\t\n\t\t\t\t\tgetDefaultProps: function getDefaultProps() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tinfoBar: true,\n\t\t\t\t\t\t\tstatusColor: config.statusColor,\n\t\t\t\t\t\t\tstatusInactiveColor: config.statusInactiveColor,\n\t\t\t\t\t\t\tzxcvbn: config.zxcvbnSrc,\n\t\t\t\t\t\t\tminScore: 0,\n\t\t\t\t\t\t\ttoggleMask: true,\n\t\t\t\t\t\t\tunMaskTime: config.unMaskTime,\n\t\t\t\t\t\t\tstrengthLang: config.strengthLang,\n\t\t\t\t\t\t\tid: 'input'\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\n\t\t\t\t\tgetInitialState: function getInitialState() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvalue: '',\n\t\t\t\t\t\t\tscore: 0,\n\t\t\t\t\t\t\tentropy: 0,\n\t\t\t\t\t\t\tisPassword: true,\n\t\t\t\t\t\t\tisValid: false\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\n\t\t\t\t\t/*========== STYLES ==========*/\n\t\n\t\t\t\t\tgetMeterStyle: function getMeterStyle(score) {\n\t\t\t\t\t\tvar width = this.state.value === '' ? 0 : 24 * score + 4;\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\twidth: this.props.zxcvbn ? width + '%' : '100%',\n\t\t\t\t\t\t\tmaxWidth: '85%',\n\t\t\t\t\t\t\topacity: this.props.zxcvbn ? width * .01 + .5 : '1',\n\t\t\t\t\t\t\tbackground: this.state.isValid ? this.props.statusColor : this.props.statusInactiveColor,\n\t\t\t\t\t\t\theight: 5,\n\t\t\t\t\t\t\ttransition: 'all 400ms linear',\n\t\t\t\t\t\t\tdisplay: 'inline-block',\n\t\t\t\t\t\t\tmarginRight: '1%'\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\n\t\t\t\t\tunMaskStyle: {\n\t\t\t\t\t\tcolor: config.unMaskColor,\n\t\t\t\t\t\tfontWeight: 200\n\t\t\t\t\t},\n\t\n\t\t\t\t\tinfoStyle: {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tbottom: -10,\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\theight: 24\n\t\t\t\t\t},\n\t\n\t\t\t\t\ticonStyle: {\n\t\t\t\t\t\tdisplay: 'inline-block',\n\t\t\t\t\t\topacity: .25,\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\ttop: 2,\n\t\t\t\t\t\twidth: '3%'\n\t\t\t\t\t},\n\t\n\t\t\t\t\tstrengthLangStyle: {\n\t\t\t\t\t\tfontSize: 12,\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\ttop: 2\n\t\t\t\t\t},\n\t\n\t\t\t\t\t/*========== METHODS ==========*/\n\t\n\t\t\t\t\taddPasswordType: function addPasswordType() {\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tisPassword: true\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\n\t\t\t\t\t/*========== HANDLERS ==========*/\n\t\n\t\t\t\t\thandleInputType: function handleInputType() {\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tisPassword: !this.state.isPassword\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\n\t\t\t\t\thandleChange: function handleChange(e) {\n\t\t\t\t\t\te.preventDefault();\n\t\n\t\t\t\t\t\tvar native_target = e.nativeEvent.target;\n\t\t\t\t\t\tvar val = e.target.value;\n\t\t\t\t\t\tvar score;\n\t\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tvalue: val,\n\t\t\t\t\t\t\tisValid: e.target.validity.valid,\n\t\t\t\t\t\t\tselectionStart: native_target.selectionStart,\n\t\t\t\t\t\t\tselectionEnd: native_target.selectionEnd\n\t\t\t\t\t\t});\n\t\n\t\t\t\t\t\tif (this.props.toggleMask) {\n\t\t\t\t\t\t\tthis.handleToggleMask();\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (this.props.zxcvbn) {\n\t\t\t\t\t\t\tscore = this.handleZxcvbn(val);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tscore = this.state.score;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// call onChange prop passed from parent\n\t\t\t\t\t\tif (this.props.onChange) {\n\t\t\t\t\t\t\tthis.props.onChange(val, this.state.isValid, score);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (this.props.minLength) {\n\t\t\t\t\t\t\tthis.handleMinLength(e.target.value.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\n\t\t\t\t\thandleToggleMask: function handleToggleMask() {\n\t\n\t\t\t\t\t\t// display password, then\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tisPassword: false\n\t\t\t\t\t\t});\n\t\n\t\t\t\t\t\t// debounce remasking password\n\t\t\t\t\t\tthis.maskPassword();\n\t\t\t\t\t},\n\t\n\t\t\t\t\thandleZxcvbn: function handleZxcvbn(val) {\n\t\n\t\t\t\t\t\tif (typeof zxcvbn === 'undefined' && typeof window.zxcvbn === 'undefined') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tvar stats = zxcvbn(val),\n\t\t\t\t\t\t currentScore = stats.score;\n\t\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\tscore: currentScore,\n\t\t\t\t\t\t\tentropy: stats.entropy\n\t\t\t\t\t\t});\n\t\n\t\t\t\t\t\tif (currentScore < this.props.minScore) {\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\tisValid: false\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// if score changed and callback provided\n\t\t\t\t\t\tif (this.props.changeCb && this.state.score !== currentScore) {\n\t\t\t\t\t\t\tthis.props.changeCb(this.state.score, currentScore, val);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (this.props.zxcvbn === 'debug') {\n\t\t\t\t\t\t\tconsole.debug(stats);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn currentScore;\n\t\t\t\t\t},\n\t\n\t\t\t\t\thandleMinLength: function handleMinLength(len) {\n\t\t\t\t\t\tif (len <= this.props.minLength) {\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\tisValid: false\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\n\t\t\t\t\tcomponentWillMount: function componentWillMount() {\n\t\t\t\t\t\tvar zxcvbnSrc;\n\t\n\t\t\t\t\t\t// Load zxcvbn async if its enabled and doesn't already exist\n\t\t\t\t\t\tif (this.props.zxcvbn && typeof zxcvbn === 'undefined') {\n\t\n\t\t\t\t\t\t\tzxcvbnSrc = this.props.zxcvbn !== 'debug' ? this.props.zxcvbn : config.zxcvbnSrc;\n\t\n\t\t\t\t\t\t\t// snippet to async load zxcvbn if enabled\n\t\t\t\t\t\t\t(function () {\n\t\t\t\t\t\t\t\tvar a;a = function () {\n\t\t\t\t\t\t\t\t\tvar a, b;b = document.createElement(\"script\");b.src = zxcvbnSrc;b.type = \"text/javascript\";b.async = !0;a = document.getElementsByTagName(\"head\")[0];return a.parentNode.insertBefore(b, a);\n\t\t\t\t\t\t\t\t};null != window.attachEvent ? window.attachEvent(\"onload\", a) : window.addEventListener(\"load\", a, !1);\n\t\t\t\t\t\t\t}).call(this);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// set debouncer for password\n\t\t\t\t\t\tif (this.props.toggleMask) {\n\t\t\t\t\t\t\tthis.maskPassword = debounce(this.addPasswordType, this.props.unMaskTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\n\t\t\t\t\tcomponentWillUnmount: function componentWillUnmount() {\n\t\t\t\t\t\t// cancel the debouncer when component is not used anymore. This to avoid\n\t\t\t\t\t\t// setting the state unnecessarily, see issue #24\n\t\t\t\t\t\tif (this.maskPassword) {\n\t\t\t\t\t\t\tthis.maskPassword.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\n\t\t\t\t\trender: function render() {\n\t\t\t\t\t\tvar infoBar;\n\t\n\t\t\t\t\t\tif (this.props.infoBar) {\n\t\t\t\t\t\t\tinfoBar = React.createElement('div', { className: 'passwordField__info', style: this.infoStyle }, React.createElement('span', { style: this.iconStyle, className: 'passwordField__icon' }, React.createElement('img', { src: __webpack_require__(4), height: '10', width: '10' })), React.createElement('span', { style: this.getMeterStyle(this.state.score), className: 'passwordField__meter' }), React.createElement('span', { style: this.strengthLangStyle, className: 'passwordField__strength' }, this.props.zxcvbn && this.state.value.length > 0 && this.props.strengthLang.length > 0 ? this.props.strengthLang[this.state.score] : null));\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// allow onChange to be passed from parent and not override default prop\n\t\t\t\t\t\tvar _props = this.props;\n\t\t\t\t\t\tvar onChange = _props.onChange;\n\t\n\t\t\t\t\t\tvar props = _objectWithoutProperties(_props, ['onChange']);\n\t\n\t\t\t\t\t\t// overcome problem with firefox resetting the input selection point\n\t\t\t\t\t\tvar that = this;\n\t\t\t\t\t\tif (typeof navigator !== 'undefined') {\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\tif (!/Firefox/.test(navigator.userAgent)) return;\n\t\t\t\t\t\t\t\tvar elem = that.refs[that.props.id].getDOMNode();\n\t\t\t\t\t\t\t\telem.selectionStart = that.state.selectionStart;\n\t\t\t\t\t\t\t\telem.selectionEnd = that.state.selectionEnd;\n\t\t\t\t\t\t\t}, 1);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn React.createElement('div', {\n\t\t\t\t\t\t\tstyle: { position: 'relative', display: 'inline-block' },\n\t\t\t\t\t\t\tclassName: 'passwordField',\n\t\t\t\t\t\t\t'data-valid': this.state.isValid,\n\t\t\t\t\t\t\t'data-score': this.state.score,\n\t\t\t\t\t\t\t'data-entropy': this.state.entropy\n\t\t\t\t\t\t}, React.createElement('input', _extends({\n\t\t\t\t\t\t\tref: this.props.id,\n\t\t\t\t\t\t\tclassName: 'passwordField__input',\n\t\t\t\t\t\t\ttype: this.state.isPassword ? 'password' : 'text',\n\t\t\t\t\t\t\tvalue: this.state.value,\n\t\t\t\t\t\t\tstyle: this.state.isPassword ? null : this.unMaskStyle,\n\t\t\t\t\t\t\tonChange: this.handleChange\n\t\t\t\t\t\t}, props)), infoBar);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\n\t\t\t\tmodule.exports = InputPassword;\n\t\n\t\t\t\t/***/\n\t\t\t},\n\t\t\t/* 1 */\n\t\t\tfunction (module, exports) {\n\t\n\t\t\t\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\t\n\t\t\t\t/***/\n\t\t\t},\n\t\t\t/* 2 */\n\t\t\tfunction (module, exports) {\n\t\n\t\t\t\t'use strict';\n\t\n\t\t\t\tmodule.exports = {\n\t\t\t\t\tstatusColor: '#5CE592',\n\t\t\t\t\tstatusInactiveColor: '#FC6F6F',\n\t\t\t\t\tunMaskColor: '#c7c7c7',\n\t\t\t\t\tunMaskTime: 1400,\n\t\t\t\t\tzxcvbnSrc: 'https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js',\n\t\t\t\t\tstrengthLang: ['Weak', 'Okay', 'Good', 'Strong', 'Great']\n\t\t\t\t};\n\t\n\t\t\t\t/***/\n\t\t\t},\n\t\t\t/* 3 */\n\t\t\tfunction (module, exports) {\n\t\n\t\t\t\t/**\n\t * lodash 4.0.6 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors \n\t * Released under MIT license \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t\t\t\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\t\t\t\t'use strict';\n\t\n\t\t\t\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t\t\t\t/** Used as references for various `Number` constants. */\n\t\t\t\tvar NAN = 0 / 0;\n\t\n\t\t\t\t/** `Object#toString` result references. */\n\t\t\t\tvar funcTag = '[object Function]',\n\t\t\t\t genTag = '[object GeneratorFunction]',\n\t\t\t\t symbolTag = '[object Symbol]';\n\t\n\t\t\t\t/** Used to match leading and trailing whitespace. */\n\t\t\t\tvar reTrim = /^\\s+|\\s+$/g;\n\t\n\t\t\t\t/** Used to detect bad signed hexadecimal string values. */\n\t\t\t\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\t\n\t\t\t\t/** Used to detect binary string values. */\n\t\t\t\tvar reIsBinary = /^0b[01]+$/i;\n\t\n\t\t\t\t/** Used to detect octal string values. */\n\t\t\t\tvar reIsOctal = /^0o[0-7]+$/i;\n\t\n\t\t\t\t/** Built-in method references without a dependency on `root`. */\n\t\t\t\tvar freeParseInt = parseInt;\n\t\n\t\t\t\t/** Used for built-in method references. */\n\t\t\t\tvar objectProto = Object.prototype;\n\t\n\t\t\t\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\t\t\t\tvar objectToString = objectProto.toString;\n\t\n\t\t\t\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\t\t\t\tvar nativeMax = Math.max,\n\t\t\t\t nativeMin = Math.min;\n\t\n\t\t\t\t/**\n\t * Gets the timestamp of the number of milliseconds that have elapsed since\n\t * the Unix epoch (1 January 1970 00:00:00 UTC).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.4.0\n\t * @type {Function}\n\t * @category Date\n\t * @returns {number} Returns the timestamp.\n\t * @example\n\t *\n\t * _.defer(function(stamp) {\n\t * console.log(_.now() - stamp);\n\t * }, _.now());\n\t * // => Logs the number of milliseconds it took for the deferred function to be invoked.\n\t */\n\t\t\t\tvar now = Date.now;\n\t\n\t\t\t\t/**\n\t * Creates a debounced function that delays invoking `func` until after `wait`\n\t * milliseconds have elapsed since the last time the debounced function was\n\t * invoked. The debounced function comes with a `cancel` method to cancel\n\t * delayed `func` invocations and a `flush` method to immediately invoke them.\n\t * Provide an options object to indicate whether `func` should be invoked on\n\t * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n\t * with the last arguments provided to the debounced function. Subsequent calls\n\t * to the debounced function return the result of the last `func` invocation.\n\t *\n\t * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n\t * on the trailing edge of the timeout only if the debounced function is\n\t * invoked more than once during the `wait` timeout.\n\t *\n\t * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n\t * for details over the differences between `_.debounce` and `_.throttle`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to debounce.\n\t * @param {number} [wait=0] The number of milliseconds to delay.\n\t * @param {Object} [options={}] The options object.\n\t * @param {boolean} [options.leading=false]\n\t * Specify invoking on the leading edge of the timeout.\n\t * @param {number} [options.maxWait]\n\t * The maximum time `func` is allowed to be delayed before it's invoked.\n\t * @param {boolean} [options.trailing=true]\n\t * Specify invoking on the trailing edge of the timeout.\n\t * @returns {Function} Returns the new debounced function.\n\t * @example\n\t *\n\t * // Avoid costly calculations while the window size is in flux.\n\t * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\t *\n\t * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n\t * jQuery(element).on('click', _.debounce(sendMail, 300, {\n\t * 'leading': true,\n\t * 'trailing': false\n\t * }));\n\t *\n\t * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n\t * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n\t * var source = new EventSource('/stream');\n\t * jQuery(source).on('message', debounced);\n\t *\n\t * // Cancel the trailing debounced invocation.\n\t * jQuery(window).on('popstate', debounced.cancel);\n\t */\n\t\t\t\tfunction debounce(func, wait, options) {\n\t\t\t\t\tvar lastArgs,\n\t\t\t\t\t lastThis,\n\t\t\t\t\t maxWait,\n\t\t\t\t\t result,\n\t\t\t\t\t timerId,\n\t\t\t\t\t lastCallTime = 0,\n\t\t\t\t\t lastInvokeTime = 0,\n\t\t\t\t\t leading = false,\n\t\t\t\t\t maxing = false,\n\t\t\t\t\t trailing = true;\n\t\n\t\t\t\t\tif (typeof func != 'function') {\n\t\t\t\t\t\tthrow new TypeError(FUNC_ERROR_TEXT);\n\t\t\t\t\t}\n\t\t\t\t\twait = toNumber(wait) || 0;\n\t\t\t\t\tif (isObject(options)) {\n\t\t\t\t\t\tleading = !!options.leading;\n\t\t\t\t\t\tmaxing = 'maxWait' in options;\n\t\t\t\t\t\tmaxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n\t\t\t\t\t\ttrailing = 'trailing' in options ? !!options.trailing : trailing;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction invokeFunc(time) {\n\t\t\t\t\t\tvar args = lastArgs,\n\t\t\t\t\t\t thisArg = lastThis;\n\t\n\t\t\t\t\t\tlastArgs = lastThis = undefined;\n\t\t\t\t\t\tlastInvokeTime = time;\n\t\t\t\t\t\tresult = func.apply(thisArg, args);\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction leadingEdge(time) {\n\t\t\t\t\t\t// Reset any `maxWait` timer.\n\t\t\t\t\t\tlastInvokeTime = time;\n\t\t\t\t\t\t// Start the timer for the trailing edge.\n\t\t\t\t\t\ttimerId = setTimeout(timerExpired, wait);\n\t\t\t\t\t\t// Invoke the leading edge.\n\t\t\t\t\t\treturn leading ? invokeFunc(time) : result;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction remainingWait(time) {\n\t\t\t\t\t\tvar timeSinceLastCall = time - lastCallTime,\n\t\t\t\t\t\t timeSinceLastInvoke = time - lastInvokeTime,\n\t\t\t\t\t\t result = wait - timeSinceLastCall;\n\t\n\t\t\t\t\t\treturn maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction shouldInvoke(time) {\n\t\t\t\t\t\tvar timeSinceLastCall = time - lastCallTime,\n\t\t\t\t\t\t timeSinceLastInvoke = time - lastInvokeTime;\n\t\n\t\t\t\t\t\t// Either this is the first call, activity has stopped and we're at the\n\t\t\t\t\t\t// trailing edge, the system time has gone backwards and we're treating\n\t\t\t\t\t\t// it as the trailing edge, or we've hit the `maxWait` limit.\n\t\t\t\t\t\treturn !lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction timerExpired() {\n\t\t\t\t\t\tvar time = now();\n\t\t\t\t\t\tif (shouldInvoke(time)) {\n\t\t\t\t\t\t\treturn trailingEdge(time);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Restart the timer.\n\t\t\t\t\t\ttimerId = setTimeout(timerExpired, remainingWait(time));\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction trailingEdge(time) {\n\t\t\t\t\t\tclearTimeout(timerId);\n\t\t\t\t\t\ttimerId = undefined;\n\t\n\t\t\t\t\t\t// Only invoke if we have `lastArgs` which means `func` has been\n\t\t\t\t\t\t// debounced at least once.\n\t\t\t\t\t\tif (trailing && lastArgs) {\n\t\t\t\t\t\t\treturn invokeFunc(time);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastArgs = lastThis = undefined;\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction cancel() {\n\t\t\t\t\t\tif (timerId !== undefined) {\n\t\t\t\t\t\t\tclearTimeout(timerId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastCallTime = lastInvokeTime = 0;\n\t\t\t\t\t\tlastArgs = lastThis = timerId = undefined;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction flush() {\n\t\t\t\t\t\treturn timerId === undefined ? result : trailingEdge(now());\n\t\t\t\t\t}\n\t\n\t\t\t\t\tfunction debounced() {\n\t\t\t\t\t\tvar time = now(),\n\t\t\t\t\t\t isInvoking = shouldInvoke(time);\n\t\n\t\t\t\t\t\tlastArgs = arguments;\n\t\t\t\t\t\tlastThis = this;\n\t\t\t\t\t\tlastCallTime = time;\n\t\n\t\t\t\t\t\tif (isInvoking) {\n\t\t\t\t\t\t\tif (timerId === undefined) {\n\t\t\t\t\t\t\t\treturn leadingEdge(lastCallTime);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (maxing) {\n\t\t\t\t\t\t\t\t// Handle invocations in a tight loop.\n\t\t\t\t\t\t\t\tclearTimeout(timerId);\n\t\t\t\t\t\t\t\ttimerId = setTimeout(timerExpired, wait);\n\t\t\t\t\t\t\t\treturn invokeFunc(lastCallTime);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (timerId === undefined) {\n\t\t\t\t\t\t\ttimerId = setTimeout(timerExpired, wait);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t\tdebounced.cancel = cancel;\n\t\t\t\t\tdebounced.flush = flush;\n\t\t\t\t\treturn debounced;\n\t\t\t\t}\n\t\n\t\t\t\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\t\t\t\tfunction isFunction(value) {\n\t\t\t\t\t// The use of `Object#toString` avoids issues with the `typeof` operator\n\t\t\t\t\t// in Safari 8 which returns 'object' for typed array and weak map constructors,\n\t\t\t\t\t// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t\t\t\t\tvar tag = isObject(value) ? objectToString.call(value) : '';\n\t\t\t\t\treturn tag == funcTag || tag == genTag;\n\t\t\t\t}\n\t\n\t\t\t\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\t\t\t\tfunction isObject(value) {\n\t\t\t\t\tvar type = typeof value;\n\t\t\t\t\treturn !!value && (type == 'object' || type == 'function');\n\t\t\t\t}\n\t\n\t\t\t\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\t\t\t\tfunction isObjectLike(value) {\n\t\t\t\t\treturn !!value && typeof value == 'object';\n\t\t\t\t}\n\t\n\t\t\t\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\t\t\t\tfunction isSymbol(value) {\n\t\t\t\t\treturn typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n\t\t\t\t}\n\t\n\t\t\t\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3);\n\t * // => 3\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3');\n\t * // => 3\n\t */\n\t\t\t\tfunction toNumber(value) {\n\t\t\t\t\tif (typeof value == 'number') {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t\tif (isSymbol(value)) {\n\t\t\t\t\t\treturn NAN;\n\t\t\t\t\t}\n\t\t\t\t\tif (isObject(value)) {\n\t\t\t\t\t\tvar other = isFunction(value.valueOf) ? value.valueOf() : value;\n\t\t\t\t\t\tvalue = isObject(other) ? other + '' : other;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof value != 'string') {\n\t\t\t\t\t\treturn value === 0 ? value : +value;\n\t\t\t\t\t}\n\t\t\t\t\tvalue = value.replace(reTrim, '');\n\t\t\t\t\tvar isBinary = reIsBinary.test(value);\n\t\t\t\t\treturn isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n\t\t\t\t}\n\t\n\t\t\t\tmodule.exports = debounce;\n\t\n\t\t\t\t/***/\n\t\t\t},\n\t\t\t/* 4 */\n\t\t\tfunction (module, exports) {\n\t\n\t\t\t\tmodule.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5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3XJRSkgOtxEU4keLgQP6kuColoeQgEkXWand8X/3UNM28Z56Z961PO2/fb9535r3f/N7TTdPUnBSLxTSBcsEA6AW1IAw+wD3YAtPg0+1mXdK4DJyAKk7MM+gE506dhuZdleBSYMpUDM5Ah1NnyKOpDnZpWn91C/ZBksZrBhFL/zaopyWQNh4HDZZ2AsQd4kbBFF3ngRnQ8581vgHVdH0M2jgPeWjpz1BePMqscdRiyrQhiF+25VK7bHI12toXgvg9+yTKGpc6TDtPD+DJ0i6RNS6ytZOC+IwtpkA2q1epKLyDb/D2h3uGQQXIBqcyWd1FBeEOZNFM1YEckHYpTGzgKyqbpmWp1kEq9IeCcQRaNP80CZoMQclb8NmUqRys8IxZpenTglHUEOxAhQEZ5/OM01qAMnwah+3Ng2BTpTGr2a1gHnSDCVXGs7Z2QpVxjUNSKjGeo29T+RuHqaRqtOdGVGZ1in6/VH9OYZet01Uhnx5qBLyAIT+MvVQulslLflWuazq+BKFXnvEaWAzI+IA31ezUMEaJE6dDQYb+9yrdMrs7oP9HgAEAXmVa5ulD/g0AAAAASUVORK5CYII=\";\n\t\n\t\t\t\t/***/\n\t\t\t}\n\t\t\t/******/])\n\t\t);\n\t});\n\t;\n\t/***/ /***/ /***/ /***/ /***/\n\n/***/ },\n/* 4 */\n/*!************************************!*\\\n !*** ./demo/src/vendor/github.css ***!\n \\************************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 5 */\n/*!**************************************!*\\\n !*** ./demo/src/vendor/skeleton.css ***!\n \\**************************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 6 */\n/*!************************************!*\\\n !*** ./demo/src/vendor/syntax.css ***!\n \\************************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 7 */\n/*!***************************************!*\\\n !*** ./~/normalize.css/normalize.css ***!\n \\***************************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 8 */\n/*!********************************!*\\\n !*** ./demo/src/css/demo.scss ***!\n \\********************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 9 */\n/*!*********************************!*\\\n !*** ./demo/src/css/style.scss ***!\n \\*********************************/\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** demo.bundle.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 99fc2cdeace5d68cc154\n **/","'use strict';\n\n// demo pages css\nrequire('normalize.css/normalize.css')\nrequire('./vendor/skeleton.css');\nrequire('./vendor/github.css');\nrequire('./vendor/syntax.css');\nrequire('./vendor/rainbow-custom.min.js');\nrequire('./css/style.scss');\n\n// css for form field\nrequire('./css/demo.scss');\n\n\n/*========== APP ==========*/\n\nconst React = require('react'),\n InputPassword = require('../../lib/react-ux-password-field.js');\n\nReact.render(\n
\n
\n \n \n
\n
\n, document.getElementById('content'));\n\n\n\n/** WEBPACK FOOTER **\n ** ./demo/src/index.js\n **/","module.exports = React;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"React\"\n ** module id = 1\n ** module chunks = 0\n **/","/* Rainbow v1.2 rainbowco.de | included languages: generic, shell, javascript, html */\nwindow.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute(\"data-language\")||0;if(!c){a=a.attributes;for(b=0;b=f[d][c])delete f[d][c],delete j[d][c];if(a>=c&&ac&&b'+b+\"\"}function s(a,b,c,i){if(\"undefined\"===typeof a||null===a)i();else{var e=a.exec(c);if(e){++t;!b.name&&\"string\"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=e[0],g=e.index,u=e[0].length+g,h=function(){function e(){s(a,b,c,i)}t%100>0?e():setTimeout(e,0)};if(C(g,u))h();else{var m=v(b.matches),l=function(a,c,i){if(a>=c.length)i(k);else{var d=e[c[a]];if(d){var g=\nb.matches[c[a]],f=g.language,h=g.name&&g.matches?g.matches:g,j=function(b,d,g){var f;f=0;var h;for(h=1;h/g,\">\").replace(/&(?![\\w\\#]+;)/g,\"&\"),b,c)}function o(a,b,c){if(b= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n\tvar React = __webpack_require__(1),\n\t RP = React.PropTypes,\n\t config = __webpack_require__(2),\n\t debounce = __webpack_require__(3);\n\n\tvar InputPassword = React.createClass({\n\t displayName: 'InputPassword',\n\n\t /*========== VALIDATE ==========*/\n\n\t propTypes: {\n\t infoBar: RP.bool,\n\t statusColor: RP.string,\n\t statusInactiveColor: RP.string,\n\t minScore: RP.number,\n\t changeCb: RP.func,\n\t toggleMask: RP.bool,\n\t unMaskTime: RP.number,\n\t minLength: RP.number,\n\t strengthLang: RP.array,\n\t id: RP.string\n\t },\n\n\t /*========== DEFAULTS ==========*/\n\n\t getDefaultProps: function getDefaultProps() {\n\t return {\n\t infoBar: true,\n\t statusColor: config.statusColor,\n\t statusInactiveColor: config.statusInactiveColor,\n\t zxcvbn: config.zxcvbnSrc,\n\t minScore: 0,\n\t toggleMask: true,\n\t unMaskTime: config.unMaskTime,\n\t strengthLang: config.strengthLang,\n\t id: 'input'\n\t };\n\t },\n\n\t getInitialState: function getInitialState() {\n\t return {\n\t value: '',\n\t score: 0,\n\t entropy: 0,\n\t isPassword: true,\n\t isValid: false\n\t };\n\t },\n\n\t /*========== STYLES ==========*/\n\n\t getMeterStyle: function getMeterStyle(score) {\n\t var width = this.state.value === '' ? 0 : 24 * score + 4;\n\t return {\n\t width: this.props.zxcvbn ? width + '%' : '100%',\n\t maxWidth: '85%',\n\t opacity: this.props.zxcvbn ? width * .01 + .5 : '1',\n\t background: this.state.isValid ? this.props.statusColor : this.props.statusInactiveColor,\n\t height: 5,\n\t transition: 'all 400ms linear',\n\t display: 'inline-block',\n\t marginRight: '1%'\n\t };\n\t },\n\n\t unMaskStyle: {\n\t color: config.unMaskColor,\n\t fontWeight: 200\n\t },\n\n\t infoStyle: {\n\t position: 'absolute',\n\t bottom: -10,\n\t width: '100%',\n\t overflow: 'hidden',\n\t height: 24\n\t },\n\n\t iconStyle: {\n\t display: 'inline-block',\n\t opacity: .25,\n\t position: 'relative',\n\t top: 2,\n\t width: '3%'\n\t },\n\n\t strengthLangStyle: {\n\t fontSize: 12,\n\t position: 'relative',\n\t top: 2\n\t },\n\n\t /*========== METHODS ==========*/\n\n\t addPasswordType: function addPasswordType() {\n\t this.setState({\n\t isPassword: true\n\t });\n\t },\n\n\t /*========== HANDLERS ==========*/\n\n\t handleInputType: function handleInputType() {\n\t this.setState({\n\t isPassword: !this.state.isPassword\n\t });\n\t },\n\n\t handleChange: function handleChange(e) {\n\t e.preventDefault();\n\n\t var native_target = e.nativeEvent.target;\n\t var val = e.target.value;\n\t var score;\n\n\t this.setState({\n\t value: val,\n\t isValid: e.target.validity.valid,\n\t selectionStart: native_target.selectionStart,\n\t selectionEnd: native_target.selectionEnd\n\t });\n\n\t if (this.props.toggleMask) {\n\t this.handleToggleMask();\n\t }\n\n\t if (this.props.zxcvbn) {\n\t score = this.handleZxcvbn(val);\n\t } else {\n\t score = this.state.score;\n\t }\n\n\t // call onChange prop passed from parent\n\t if (this.props.onChange) {\n\t this.props.onChange(val, this.state.isValid, score);\n\t }\n\n\t if (this.props.minLength) {\n\t this.handleMinLength(e.target.value.length);\n\t }\n\t },\n\n\t handleToggleMask: function handleToggleMask() {\n\n\t // display password, then\n\t this.setState({\n\t isPassword: false\n\t });\n\n\t // debounce remasking password\n\t this.maskPassword();\n\t },\n\n\t handleZxcvbn: function handleZxcvbn(val) {\n\n\t if (typeof zxcvbn === 'undefined' && typeof window.zxcvbn === 'undefined') {\n\t return;\n\t }\n\n\t var stats = zxcvbn(val),\n\t currentScore = stats.score;\n\n\t this.setState({\n\t score: currentScore,\n\t entropy: stats.entropy\n\t });\n\n\t if (currentScore < this.props.minScore) {\n\t this.setState({\n\t isValid: false\n\t });\n\t }\n\n\t // if score changed and callback provided\n\t if (this.props.changeCb && this.state.score !== currentScore) {\n\t this.props.changeCb(this.state.score, currentScore, val);\n\t }\n\n\t if (this.props.zxcvbn === 'debug') {\n\t console.debug(stats);\n\t }\n\n\t return currentScore;\n\t },\n\n\t handleMinLength: function handleMinLength(len) {\n\t if (len <= this.props.minLength) {\n\t this.setState({\n\t isValid: false\n\t });\n\t }\n\t },\n\n\t componentWillMount: function componentWillMount() {\n\t var zxcvbnSrc;\n\n\t // Load zxcvbn async if its enabled and doesn't already exist\n\t if (this.props.zxcvbn && typeof zxcvbn === 'undefined') {\n\n\t zxcvbnSrc = this.props.zxcvbn !== 'debug' ? this.props.zxcvbn : config.zxcvbnSrc;\n\n\t // snippet to async load zxcvbn if enabled\n\t (function () {\n\t var a;a = function () {\n\t var a, b;b = document.createElement(\"script\");b.src = zxcvbnSrc;b.type = \"text/javascript\";b.async = !0;a = document.getElementsByTagName(\"head\")[0];return a.parentNode.insertBefore(b, a);\n\t };null != window.attachEvent ? window.attachEvent(\"onload\", a) : window.addEventListener(\"load\", a, !1);\n\t }).call(this);\n\t }\n\n\t // set debouncer for password\n\t if (this.props.toggleMask) {\n\t this.maskPassword = debounce(this.addPasswordType, this.props.unMaskTime);\n\t }\n\t },\n\n\t componentWillUnmount: function componentWillUnmount() {\n\t // cancel the debouncer when component is not used anymore. This to avoid\n\t // setting the state unnecessarily, see issue #24\n\t if (this.maskPassword) {\n\t this.maskPassword.cancel();\n\t }\n\t },\n\n\t render: function render() {\n\t var infoBar;\n\n\t if (this.props.infoBar) {\n\t infoBar = React.createElement(\n\t 'div',\n\t { className: 'passwordField__info', style: this.infoStyle },\n\t React.createElement(\n\t 'span',\n\t { style: this.iconStyle, className: 'passwordField__icon' },\n\t React.createElement('img', { src: __webpack_require__(4), height: '10', width: '10' })\n\t ),\n\t React.createElement('span', { style: this.getMeterStyle(this.state.score), className: 'passwordField__meter' }),\n\t React.createElement(\n\t 'span',\n\t { style: this.strengthLangStyle, className: 'passwordField__strength' },\n\t this.props.zxcvbn && this.state.value.length > 0 && this.props.strengthLang.length > 0 ? this.props.strengthLang[this.state.score] : null\n\t )\n\t );\n\t }\n\n\t // allow onChange to be passed from parent and not override default prop\n\t var _props = this.props;\n\t var onChange = _props.onChange;\n\n\t var props = _objectWithoutProperties(_props, ['onChange']);\n\n\t // overcome problem with firefox resetting the input selection point\n\t var that = this;\n\t if (typeof navigator !== 'undefined') {\n\t setTimeout(function () {\n\t if (!/Firefox/.test(navigator.userAgent)) return;\n\t var elem = that.refs[that.props.id].getDOMNode();\n\t elem.selectionStart = that.state.selectionStart;\n\t elem.selectionEnd = that.state.selectionEnd;\n\t }, 1);\n\t }\n\n\t return React.createElement(\n\t 'div',\n\t {\n\t style: { position: 'relative', display: 'inline-block' },\n\t className: 'passwordField',\n\t 'data-valid': this.state.isValid,\n\t 'data-score': this.state.score,\n\t 'data-entropy': this.state.entropy\n\t },\n\t React.createElement('input', _extends({\n\t ref: this.props.id,\n\t className: 'passwordField__input',\n\t type: this.state.isPassword ? 'password' : 'text',\n\t value: this.state.value,\n\t style: this.state.isPassword ? null : this.unMaskStyle,\n\t onChange: this.handleChange\n\t }, props)),\n\t infoBar\n\t );\n\t }\n\t});\n\n\tmodule.exports = InputPassword;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tmodule.exports = {\n\t statusColor: '#5CE592',\n\t statusInactiveColor: '#FC6F6F',\n\t unMaskColor: '#c7c7c7',\n\t unMaskTime: 1400,\n\t zxcvbnSrc: 'https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js',\n\t strengthLang: ['Weak', 'Okay', 'Good', 'Strong', 'Great']\n\t};\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.6 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors \n\t * Released under MIT license \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\t'use strict';\n\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\n\t/** Used as references for various `Number` constants. */\n\tvar NAN = 0 / 0;\n\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t symbolTag = '[object Symbol]';\n\n\t/** Used to match leading and trailing whitespace. */\n\tvar reTrim = /^\\s+|\\s+$/g;\n\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max,\n\t nativeMin = Math.min;\n\n\t/**\n\t * Gets the timestamp of the number of milliseconds that have elapsed since\n\t * the Unix epoch (1 January 1970 00:00:00 UTC).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.4.0\n\t * @type {Function}\n\t * @category Date\n\t * @returns {number} Returns the timestamp.\n\t * @example\n\t *\n\t * _.defer(function(stamp) {\n\t * console.log(_.now() - stamp);\n\t * }, _.now());\n\t * // => Logs the number of milliseconds it took for the deferred function to be invoked.\n\t */\n\tvar now = Date.now;\n\n\t/**\n\t * Creates a debounced function that delays invoking `func` until after `wait`\n\t * milliseconds have elapsed since the last time the debounced function was\n\t * invoked. The debounced function comes with a `cancel` method to cancel\n\t * delayed `func` invocations and a `flush` method to immediately invoke them.\n\t * Provide an options object to indicate whether `func` should be invoked on\n\t * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n\t * with the last arguments provided to the debounced function. Subsequent calls\n\t * to the debounced function return the result of the last `func` invocation.\n\t *\n\t * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n\t * on the trailing edge of the timeout only if the debounced function is\n\t * invoked more than once during the `wait` timeout.\n\t *\n\t * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n\t * for details over the differences between `_.debounce` and `_.throttle`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to debounce.\n\t * @param {number} [wait=0] The number of milliseconds to delay.\n\t * @param {Object} [options={}] The options object.\n\t * @param {boolean} [options.leading=false]\n\t * Specify invoking on the leading edge of the timeout.\n\t * @param {number} [options.maxWait]\n\t * The maximum time `func` is allowed to be delayed before it's invoked.\n\t * @param {boolean} [options.trailing=true]\n\t * Specify invoking on the trailing edge of the timeout.\n\t * @returns {Function} Returns the new debounced function.\n\t * @example\n\t *\n\t * // Avoid costly calculations while the window size is in flux.\n\t * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\t *\n\t * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n\t * jQuery(element).on('click', _.debounce(sendMail, 300, {\n\t * 'leading': true,\n\t * 'trailing': false\n\t * }));\n\t *\n\t * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n\t * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n\t * var source = new EventSource('/stream');\n\t * jQuery(source).on('message', debounced);\n\t *\n\t * // Cancel the trailing debounced invocation.\n\t * jQuery(window).on('popstate', debounced.cancel);\n\t */\n\tfunction debounce(func, wait, options) {\n\t var lastArgs,\n\t lastThis,\n\t maxWait,\n\t result,\n\t timerId,\n\t lastCallTime = 0,\n\t lastInvokeTime = 0,\n\t leading = false,\n\t maxing = false,\n\t trailing = true;\n\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t wait = toNumber(wait) || 0;\n\t if (isObject(options)) {\n\t leading = !!options.leading;\n\t maxing = 'maxWait' in options;\n\t maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n\t trailing = 'trailing' in options ? !!options.trailing : trailing;\n\t }\n\n\t function invokeFunc(time) {\n\t var args = lastArgs,\n\t thisArg = lastThis;\n\n\t lastArgs = lastThis = undefined;\n\t lastInvokeTime = time;\n\t result = func.apply(thisArg, args);\n\t return result;\n\t }\n\n\t function leadingEdge(time) {\n\t // Reset any `maxWait` timer.\n\t lastInvokeTime = time;\n\t // Start the timer for the trailing edge.\n\t timerId = setTimeout(timerExpired, wait);\n\t // Invoke the leading edge.\n\t return leading ? invokeFunc(time) : result;\n\t }\n\n\t function remainingWait(time) {\n\t var timeSinceLastCall = time - lastCallTime,\n\t timeSinceLastInvoke = time - lastInvokeTime,\n\t result = wait - timeSinceLastCall;\n\n\t return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n\t }\n\n\t function shouldInvoke(time) {\n\t var timeSinceLastCall = time - lastCallTime,\n\t timeSinceLastInvoke = time - lastInvokeTime;\n\n\t // Either this is the first call, activity has stopped and we're at the\n\t // trailing edge, the system time has gone backwards and we're treating\n\t // it as the trailing edge, or we've hit the `maxWait` limit.\n\t return !lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n\t }\n\n\t function timerExpired() {\n\t var time = now();\n\t if (shouldInvoke(time)) {\n\t return trailingEdge(time);\n\t }\n\t // Restart the timer.\n\t timerId = setTimeout(timerExpired, remainingWait(time));\n\t }\n\n\t function trailingEdge(time) {\n\t clearTimeout(timerId);\n\t timerId = undefined;\n\n\t // Only invoke if we have `lastArgs` which means `func` has been\n\t // debounced at least once.\n\t if (trailing && lastArgs) {\n\t return invokeFunc(time);\n\t }\n\t lastArgs = lastThis = undefined;\n\t return result;\n\t }\n\n\t function cancel() {\n\t if (timerId !== undefined) {\n\t clearTimeout(timerId);\n\t }\n\t lastCallTime = lastInvokeTime = 0;\n\t lastArgs = lastThis = timerId = undefined;\n\t }\n\n\t function flush() {\n\t return timerId === undefined ? result : trailingEdge(now());\n\t }\n\n\t function debounced() {\n\t var time = now(),\n\t isInvoking = shouldInvoke(time);\n\n\t lastArgs = arguments;\n\t lastThis = this;\n\t lastCallTime = time;\n\n\t if (isInvoking) {\n\t if (timerId === undefined) {\n\t return leadingEdge(lastCallTime);\n\t }\n\t if (maxing) {\n\t // Handle invocations in a tight loop.\n\t clearTimeout(timerId);\n\t timerId = setTimeout(timerExpired, wait);\n\t return invokeFunc(lastCallTime);\n\t }\n\t }\n\t if (timerId === undefined) {\n\t timerId = setTimeout(timerExpired, wait);\n\t }\n\t return result;\n\t }\n\t debounced.cancel = cancel;\n\t debounced.flush = flush;\n\t return debounced;\n\t}\n\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array and weak map constructors,\n\t // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\n\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\tfunction isSymbol(value) {\n\t return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;\n\t}\n\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3);\n\t * // => 3\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3');\n\t * // => 3\n\t */\n\tfunction toNumber(value) {\n\t if (typeof value == 'number') {\n\t return value;\n\t }\n\t if (isSymbol(value)) {\n\t return NAN;\n\t }\n\t if (isObject(value)) {\n\t var other = isFunction(value.valueOf) ? value.valueOf() : value;\n\t value = isObject(other) ? other + '' : other;\n\t }\n\t if (typeof value != 'string') {\n\t return value === 0 ? value : +value;\n\t }\n\t value = value.replace(reTrim, '');\n\t var isBinary = reIsBinary.test(value);\n\t return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n\t}\n\n\tmodule.exports = debounce;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2F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9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+NkztvAAAAc9JREFUeNq8lk8oBFEcx2fG5k+0HJRQ/iVy2U1tUsjBzYnI2cUWJyl3XJRSkgOtxEU4keLgQP6kuColoeQgEkXWand8X/3UNM28Z56Z961PO2/fb9535r3f/N7TTdPUnBSLxTSBcsEA6AW1IAw+wD3YAtPg0+1mXdK4DJyAKk7MM+gE506dhuZdleBSYMpUDM5Ah1NnyKOpDnZpWn91C/ZBksZrBhFL/zaopyWQNh4HDZZ2AsQd4kbBFF3ngRnQ8581vgHVdH0M2jgPeWjpz1BePMqscdRiyrQhiF+25VK7bHI12toXgvg9+yTKGpc6TDtPD+DJ0i6RNS6ytZOC+IwtpkA2q1epKLyDb/D2h3uGQQXIBqcyWd1FBeEOZNFM1YEckHYpTGzgKyqbpmWp1kEq9IeCcQRaNP80CZoMQclb8NmUqRys8IxZpenTglHUEOxAhQEZ5/OM01qAMnwah+3Ng2BTpTGr2a1gHnSDCVXGs7Z2QpVxjUNSKjGeo29T+RuHqaRqtOdGVGZ1in6/VH9OYZet01Uhnx5qBLyAIT+MvVQulslLflWuazq+BKFXnvEaWAzI+IA31ezUMEaJE6dDQYb+9yrdMrs7oP9HgAEAXmVa5ulD/g0AAAAASUVORK5CYII=\"\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** ./lib/react-ux-password-field.js\n **/"],"sourceRoot":""} -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React UX Password Field 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | Fork me on GitHub 16 |
17 | 18 |
19 |
20 |

React UX Password Field

21 |
22 |
23 | 24 |
25 | 26 |

This react component aims to improve common issues in password field UX.

27 |
    28 |
  1. 29 | Password Strength Detection - Show the password complexity using Dropbox's zxcvbn library, loaded async and updated onChange. 30 |
  2. 31 | 32 |
  3. Timed Password Masking - Users make errors when they can't see the password field. React UX Password temporarily shows the password, then hides after a configurable 1200ms. Best explained in the nngroup article: Stop Password Masking 33 |
  4. 34 |
  5. Stateful Class - Know the HTML5 validity of your field by class.
  6. 35 |
36 | 37 |

Inspect element to see all your password info with debug mode on!

38 | 39 |
40 | 41 |

Install

42 |
 43 |       npm install react-ux-password-field
 44 |     
45 |

View it on Github

46 |
47 | 48 |

Use

49 |
 50 |       // use it like any other react component.
 51 | // just require and place it inside your render function.
 52 | 
 53 | var InputPassword = require('react-ux-password-field');
 54 | 
 55 | ...
 56 | 
 57 | render: function() {
 58 |   return (
 59 |     <InputPassword />
 60 |   )
 61 | }
 62 |       
 63 |     
64 |

* React UX Password Field is UMD compatible, meaning it will load with 65 | commonJS, AMD/RequireJS, or standalone.

66 |
67 |

Options (props)

68 |

Add your attributes normally like you would any password field. (id, placeholder, required, pattern etc...) But now you get the following extras:

69 |
70 | 71 |

Info Bar

72 | 73 |
74 | infoBar (bool) default: true 75 |
76 |

77 |

infoBar={false}
will disable the visible meter below the field.

78 |

79 | You can still rely on the attributes in the container class to do any other logic including. 80 |

81 |
    82 |
  • data-valid - current valid state of the field.
  • 83 |
  • data-score - current password strength score.
  • 84 |
  • data-entropy - current password entropy.
  • 85 |
86 | 87 |
88 | 89 |

Password Strength

90 | 91 |
zxcvbn (bool|string) default: true
92 |

93 |

zxcvbn={false}
If false is passed. zxcvbn will be disabled. You can also pass an alternate source in a string to modify the async loaded source. default is: https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js 94 |

95 |

96 | You can also pass "debug" as your string and it will console.log the zxcvbn object returned on each password change. 97 |

98 |

99 | Note: zxcvbn is loaded async as it is a pretty big file. The async load time usually isn't an issue for a password usecase, if it is. Consider disabling and moving to a server-side load. 100 |

101 | 102 |
103 | 104 |
minScore (number) default: 0
105 |

106 |

minScore={2}
provides a password strength score based on 0-4. You can set the minimum accepted score for the field to be considered valid. Note: Dropbox who created and uses the library, does not set a minimum score, but does provide the info for the user. 107 |

108 | 109 |
110 |
statusColor (string)#5CE592
111 |

112 |

statusColor="#5CE592"
will change the default valid color in the bar. 113 |

114 | 115 |
116 |
statusInactiveColor (string)#FC6F6F
117 |

118 |

statusInactiveColor="#FC6F6F"
will change the default invalid color in the bar. 119 |

120 | 121 |
122 |
strengthLang (array)['Weak', 'Okay', 'Good', 'Strong', 'Great']
123 |

124 |

strengthLang={['Bad', 'Not good', 'Decent', 'Strong', 'Great']}
will modify the text shown next to the bar. You can pass an empty array to remove the text. 125 |

126 | 127 |
128 |
changeCb (function(oldValue, newValue))
129 |

130 |

changeCb={funcName}
will call your callback on zxcvbn level change. It will pass in the old and new value. You can use this to hook other state related to the quality of the password if needed. 131 |

132 | 133 |
134 |

Masking

135 | 136 |
toggleMask (bool) default: true
137 |

138 |

toggleMask={false}
will disable the temporarily unmasking password, and it will revert to acting like a normal password field which masks the entire time. 139 |

140 | 141 |
unMaskTime (number in ms.) default: 1400
142 |

143 |

unMaskTime={1400}
will change the default length a password field is unmasked for. *This is debounced, so the count will only start when typing is paused. 144 |

145 | 146 |
147 |

HTML5 Attributes

148 | 149 | 150 |
minLength (number)
151 |

152 |

minLength={7}
currently, the html5 spec only provides maxLength property. But react makes it easy to add a minLength as well. This can also easily be implemented with the pattern field. 153 |

154 | 155 |

156 | You can also use all the default HTML5 input validation attributes, like maxLength, pattern, required etc... 157 |

158 | 159 |
160 |

Contributing

161 |

162 | Pull requests are welcomed, please file an issue explaining the problem you're solving first, and pull-request to an upstream branch instead of master. 163 |

164 | 165 |
166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /demo/src/css/demo.scss: -------------------------------------------------------------------------------- 1 | form { 2 | width: 100%; 3 | margin: 40px auto; 4 | background: #f1f1f1; 5 | border-radius: 5px; 6 | padding: 3em 2em; 7 | color: #555; 8 | } 9 | 10 | fieldset { 11 | border: 0; 12 | max-width: 580px; 13 | margin: 0 auto; 14 | } 15 | 16 | label { 17 | font-size: 12px; 18 | text-transform: uppercase; 19 | display: block; 20 | padding-top: 0; 21 | margin-top: 0; 22 | } 23 | 24 | input[type="email"], input[type="number"], input[type="search"], input[type="text"], input[type="tel"], input[type="url"], input[type="password"], textarea, select { 25 | line-height: 2.5; 26 | height: auto; 27 | border-radius: 0; 28 | font-size: 1.25em; 29 | padding: 8px 20px; 30 | outline: none; 31 | width: 100%; 32 | &:focus { 33 | border: 1px solid #c3c3c3; 34 | } 35 | } 36 | 37 | .passwordField { 38 | width: 100%; 39 | } 40 | 41 | .passwordField__strength { 42 | color: #999; 43 | } 44 | -------------------------------------------------------------------------------- /demo/src/css/style.scss: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | transition: all 2ms linear; 4 | } 5 | 6 | html, body { 7 | background: #fefefe; 8 | font-family: 'Roboto Slab', serif; 9 | font-weight: normal; 10 | font-weight: 300; 11 | color: #555; 12 | min-height: 100%; 13 | } 14 | 15 | .container { 16 | max-width: 680px; 17 | padding: 3em 1em; 18 | } 19 | 20 | header { 21 | text-align: center; 22 | } 23 | 24 | hr { 25 | border-color: #e7e7e7; 26 | } 27 | 28 | a { 29 | color: #41BFCF; 30 | text-decoration: none; 31 | &:hover { 32 | color: #16DAF4; 33 | text-decoration: underline; 34 | } 35 | } 36 | 37 | h3 { 38 | font-size: 2em; 39 | } 40 | 41 | h4 { 42 | text-align: center; 43 | font-size: 2em; 44 | } 45 | 46 | h5 { 47 | font-size: 1.4em; 48 | span { 49 | font-size: 0.75em; 50 | } 51 | span.default { 52 | font-style: italic; 53 | color: #777; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /demo/src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // demo pages css 4 | require('normalize.css/normalize.css') 5 | require('./vendor/skeleton.css'); 6 | require('./vendor/github.css'); 7 | require('./vendor/syntax.css'); 8 | require('./vendor/rainbow-custom.min.js'); 9 | require('./css/style.scss'); 10 | 11 | // css for form field 12 | require('./css/demo.scss'); 13 | 14 | 15 | /*========== APP ==========*/ 16 | 17 | const React = require('react'), 18 | InputPassword = require('../../lib/react-ux-password-field.js'); 19 | 20 | React.render( 21 |
22 |
23 | 24 | 32 |
33 |
34 | , document.getElementById('content')); 35 | -------------------------------------------------------------------------------- /demo/src/vendor/_base.scss: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 18px; 3 | line-height: 31px; 4 | max-width: 760px; 5 | margin: 0 auto; 6 | } 7 | h1 { 8 | font-size: 48px; 9 | line-height: 62px; 10 | margin-top: 62px; 11 | margin-bottom: 31px; 12 | font-weight: 400; 13 | } 14 | h2 { 15 | font-size: 41px; 16 | line-height: 62px; 17 | margin-top: 62px; 18 | margin-bottom: 31px; 19 | } 20 | h3 { 21 | font-size: 27px; 22 | line-height: 31px; 23 | margin-top: 31px; 24 | margin-bottom: 31px; 25 | } 26 | h4 { 27 | font-size: 18px; 28 | line-height: 31px; 29 | margin-top: 31px; 30 | margin-bottom: 31px; 31 | } 32 | p, ul, ol, pre, table, blockquote { 33 | margin-top: 31px; 34 | margin-bottom: 31px; 35 | } 36 | 37 | /* Sanitation */ 38 | hr { 39 | border: 1px solid; 40 | margin: -1px 0; 41 | } 42 | ul ul, ol ol, ul ol, ol ul { 43 | margin-top: 0; 44 | margin-bottom: 0; 45 | } 46 | b, strong, em, small, code { 47 | line-height: 1; 48 | } 49 | sup, sub { 50 | vertical-align: baseline; 51 | position: relative; 52 | top: -0.4em; 53 | } 54 | sub { 55 | top: 0.4em; 56 | } 57 | 58 | li { 59 | margin-bottom: 20px; 60 | } 61 | -------------------------------------------------------------------------------- /demo/src/vendor/github.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Cabin+Condensed:500&text=Fork%20me%20on%20GitHub); 2 | 3 | body{ 4 | overflow-x: hidden; 5 | } 6 | 7 | .ribbon{ 8 | position: absolute; 9 | top: 42px; 10 | width: 200px; 11 | padding: 1px 0; 12 | background: #000; 13 | color: #eee; 14 | 15 | -moz-box-shadow: 0 0 10px rgba(0,0,0,0.5); 16 | -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.5); 17 | box-shadow: 0 0 10px rgba(0,0,0,0.5); 18 | } 19 | 20 | .ribbon.left{ 21 | left: -42px; 22 | -moz-transform: rotate(-45deg); 23 | -webkit-transform: rotate(-45deg); 24 | -o-transform: rotate(-45deg); 25 | -ms-transform: rotate(-45deg); 26 | transform: rotate(-45deg); 27 | } 28 | 29 | .ribbon.right{ 30 | right: -42px; 31 | -moz-transform: rotate(45deg); 32 | -webkit-transform: rotate(45deg); 33 | -o-transform: rotate(45deg); 34 | -ms-transform: rotate(45deg); 35 | transform: rotate(45deg); 36 | } 37 | 38 | .ribbon a, 39 | .ribbon a:visited, 40 | .ribbon a:active, 41 | .ribbon a:hover{ 42 | display: block; 43 | padding: 1px 0; 44 | height: 24px; 45 | line-height: 24px; 46 | 47 | color: inherit; 48 | text-align: center; 49 | text-decoration: none; 50 | font-family: 'Cabin Condensed', sans-serif; 51 | font-size: 16px; 52 | font-weight: 500; 53 | 54 | border: 1px solid rgba(255,255,255,0.3); 55 | 56 | -moz-text-shadow: 0 0 10px rgba(0,0,0,0.31); 57 | -webkit-text-shadow: 0 0 10px rgba(0,0,0,0.31); 58 | text-shadow: 0 0 10px rgba(0,0,0,0.31); 59 | } 60 | 61 | .ribbon.black{ 62 | background: #000; 63 | } 64 | 65 | .ribbon.red{ 66 | background: #c00; 67 | } 68 | 69 | .ribbon.blue{ 70 | background: #09e; 71 | } 72 | 73 | .ribbon.green{ 74 | background: #0a0; 75 | } 76 | 77 | .ribbon.orange{ 78 | background: #d80; 79 | } 80 | 81 | .ribbon.purple{ 82 | background: #c0c; 83 | } 84 | 85 | .ribbon.grey{ 86 | background: #888; 87 | } 88 | 89 | .ribbon.white{ 90 | background: #eee; 91 | color: black; 92 | } 93 | .ribbon.white a{ 94 | border: 2px dotted rgba(100,100,100,0.2); 95 | } 96 | -------------------------------------------------------------------------------- /demo/src/vendor/rainbow-custom.min.js: -------------------------------------------------------------------------------- 1 | /* Rainbow v1.2 rainbowco.de | included languages: generic, shell, javascript, html */ 2 | window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b=f[d][c])delete f[d][c],delete j[d][c];if(a>=c&&ac&&b'+b+""}function s(a,b,c,i){if("undefined"===typeof a||null===a)i();else{var e=a.exec(c);if(e){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=e[0],g=e.index,u=e[0].length+g,h=function(){function e(){s(a,b,c,i)}t%100>0?e():setTimeout(e,0)};if(C(g,u))h();else{var m=v(b.matches),l=function(a,c,i){if(a>=c.length)i(k);else{var d=e[c[a]];if(d){var g= 4 | b.matches[c[a]],f=g.language,h=g.name&&g.matches?g.matches:g,j=function(b,d,g){var f;f=0;var h;for(h=1;h/g,">").replace(/&(?![\w\#]+;)/g,"&"),b,c)}function o(a,b,c){if(b .label-body { 283 | display: inline-block; 284 | margin-left: .5rem; 285 | font-weight: normal; } 286 | 287 | 288 | /* Lists 289 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 290 | ul { 291 | list-style: circle inside; } 292 | ol { 293 | list-style: decimal inside; } 294 | ol, ul { 295 | padding-left: 0; 296 | margin-top: 0; } 297 | ul ul, 298 | ul ol, 299 | ol ol, 300 | ol ul { 301 | margin: 1.5rem 0 1.5rem 3rem; 302 | font-size: 90%; } 303 | li { 304 | margin-bottom: 1rem; } 305 | 306 | 307 | /* Code 308 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 309 | code { 310 | padding: .2rem .5rem; 311 | margin: 0 .2rem; 312 | font-size: 90%; 313 | white-space: nowrap; 314 | /* background: #F1F1F1; 315 | border: 1px solid #E1E1E1;*/ 316 | border-radius: 4px; } 317 | pre > code { 318 | display: block; 319 | padding: 1rem 1.5rem; 320 | white-space: pre; } 321 | 322 | 323 | /* Tables 324 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 325 | th, 326 | td { 327 | padding: 12px 15px; 328 | text-align: left; 329 | border-bottom: 1px solid #E1E1E1; } 330 | th:first-child, 331 | td:first-child { 332 | padding-left: 0; } 333 | th:last-child, 334 | td:last-child { 335 | padding-right: 0; } 336 | 337 | 338 | /* Spacing 339 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 340 | button, 341 | .button { 342 | margin-bottom: 1rem; } 343 | input, 344 | textarea, 345 | select, 346 | fieldset { 347 | margin-bottom: 1.5rem; } 348 | pre, 349 | blockquote, 350 | dl, 351 | figure, 352 | table, 353 | p, 354 | ul, 355 | ol, 356 | form { 357 | margin-bottom: 2.5rem; } 358 | 359 | 360 | /* Utilities 361 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 362 | .u-full-width { 363 | width: 100%; 364 | box-sizing: border-box; } 365 | .u-max-full-width { 366 | max-width: 100%; 367 | box-sizing: border-box; } 368 | .u-pull-right { 369 | float: right; } 370 | .u-pull-left { 371 | float: left; } 372 | 373 | 374 | /* Misc 375 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 376 | hr { 377 | margin-top: 3rem; 378 | margin-bottom: 3.5rem; 379 | border-width: 0; 380 | border-top: 1px solid #E1E1E1; } 381 | 382 | 383 | /* Clearing 384 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 385 | 386 | /* Self Clearing Goodness */ 387 | .container:after, 388 | .row:after, 389 | .u-cf { 390 | content: ""; 391 | display: table; 392 | clear: both; } 393 | 394 | 395 | /* Media Queries 396 | –––––––––––––––––––––––––––––––––––––––––––––––––– */ 397 | /* 398 | Note: The best way to structure the use of media queries is to create the queries 399 | near the relevant code. For example, if you wanted to change the styles for buttons 400 | on small devices, paste the mobile query code up in the buttons section and style it 401 | there. 402 | */ 403 | 404 | 405 | /* Larger than mobile */ 406 | @media (min-width: 400px) {} 407 | 408 | /* Larger than phablet (also point when grid becomes active) */ 409 | @media (min-width: 550px) {} 410 | 411 | /* Larger than tablet */ 412 | @media (min-width: 750px) {} 413 | 414 | /* Larger than desktop */ 415 | @media (min-width: 1000px) {} 416 | 417 | /* Larger than Desktop HD */ 418 | @media (min-width: 1200px) {} 419 | -------------------------------------------------------------------------------- /demo/src/vendor/syntax.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme 3 | * 4 | * Adaptation of Solarized Dark from ethanschoonover.com/solarized 5 | * 6 | * @author Ethan Schoonover 7 | * @author David Litmark 8 | * @version 1.0.0 9 | */ 10 | pre { 11 | background: #002b36; /* base03 */ 12 | word-wrap: break-word; 13 | margin: 0px; 14 | padding: 10px; 15 | color: #839496; /* base0 */ 16 | font-size: 14px; 17 | margin-bottom: 20px; 18 | } 19 | 20 | pre, code { 21 | font-family: 'Monaco', courier, monospace; 22 | } 23 | 24 | pre .comment { 25 | color: #586e75; /* base01 */ 26 | } 27 | 28 | pre .constant { 29 | color: #839496; /* base0 */ 30 | } 31 | 32 | pre .constant.language { 33 | color: #268bd2; /* blue */ 34 | } 35 | 36 | pre .constant.regexp { 37 | color: #2aa198; /* cyan */ 38 | } 39 | 40 | pre .storage { 41 | color: #268bd2; /* blue */ 42 | } 43 | 44 | pre .string, pre .comment.docstring { 45 | color: #2aa198; /* cyan */ 46 | } 47 | 48 | pre .support.tag.script, pre .support.tag.style { 49 | color: #2aa198; /* cyan */ 50 | } 51 | 52 | pre .string.regexp { 53 | color: #2aa198; /* cyan */ 54 | } 55 | 56 | pre .string.regexp.open, pre .string.regexp.close { 57 | color: #2aa198; /* cyan */ 58 | } 59 | 60 | pre .keyword, pre .selector { 61 | color: #859900; /* green */ 62 | } 63 | 64 | pre .inherited-class { 65 | font-style: italic; 66 | } 67 | 68 | pre .entity { 69 | color: #b58900; /* yellow */ 70 | } 71 | 72 | pre .support, *[data-language="c"] .function.call { 73 | color: #859900; /* green */ 74 | } 75 | 76 | pre .support.method { 77 | color: #839496; /* base0 */ 78 | } 79 | 80 | pre .support.property { 81 | color: #839496; /* base0 */ 82 | } 83 | 84 | pre .variable.global, pre .variable.class, pre .variable.instance { 85 | color: #839496; /* base0 */ 86 | } 87 | -------------------------------------------------------------------------------- /demo/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Cabin+Condensed:500&text=Fork%20me%20on%20GitHub);/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.container{position:relative;max-width:960px;margin:0 auto;padding:0 20px}.column,.columns,.container{width:100%;box-sizing:border-box}.column,.columns{float:left}@media(min-width:400px){.container{width:85%;padding:0}}@media(min-width:550px){.container{width:80%}.column,.columns{margin-left:4%}.column:first-child,.columns:first-child{margin-left:0}.one.column,.one.columns{width:4.66666666667%}.two.columns{width:13.3333333333%}.three.columns{width:22%}.four.columns{width:30.6666666667%}.five.columns{width:39.3333333333%}.six.columns{width:48%}.seven.columns{width:56.6666666667%}.eight.columns{width:65.3333333333%}.nine.columns{width:74%}.ten.columns{width:82.6666666667%}.eleven.columns{width:91.3333333333%}.twelve.columns{width:100%;margin-left:0}.one-third.column{width:30.6666666667%}.two-thirds.column{width:65.3333333333%}.one-half.column{width:48%}.offset-by-one.column,.offset-by-one.columns{margin-left:8.66666666667%}.offset-by-two.column,.offset-by-two.columns{margin-left:17.3333333333%}.offset-by-three.column,.offset-by-three.columns{margin-left:26%}.offset-by-four.column,.offset-by-four.columns{margin-left:34.6666666667%}.offset-by-five.column,.offset-by-five.columns{margin-left:43.3333333333%}.offset-by-six.column,.offset-by-six.columns{margin-left:52%}.offset-by-seven.column,.offset-by-seven.columns{margin-left:60.6666666667%}.offset-by-eight.column,.offset-by-eight.columns{margin-left:69.3333333333%}.offset-by-nine.column,.offset-by-nine.columns{margin-left:78%}.offset-by-ten.column,.offset-by-ten.columns{margin-left:86.6666666667%}.offset-by-eleven.column,.offset-by-eleven.columns{margin-left:95.3333333333%}.offset-by-one-third.column,.offset-by-one-third.columns{margin-left:34.6666666667%}.offset-by-two-thirds.column,.offset-by-two-thirds.columns{margin-left:69.3333333333%}.offset-by-one-half.column,.offset-by-one-half.columns{margin-left:52%}}html{font-size:62.5%}body{font-size:1.5em;line-height:1.6;font-weight:400;font-family:Raleway,HelveticaNeue,Helvetica Neue,Helvetica,Arial,sans-serif;color:#222}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:2rem;font-weight:300}h1{font-size:4rem;line-height:1.2}h1,h2{letter-spacing:-.1rem}h2{font-size:3.6rem;line-height:1.25}h3{font-size:3rem;line-height:1.3;letter-spacing:-.1rem}h4{font-size:2.4rem;line-height:1.35;letter-spacing:-.08rem}h5{font-size:1.8rem;line-height:1.5;letter-spacing:-.05rem}h6{font-size:1.5rem;line-height:1.6;letter-spacing:0}@media(min-width:550px){h1{font-size:5rem}h2{font-size:4.2rem}h3{font-size:3.6rem}h4{font-size:3rem}h5{font-size:2.4rem}h6{font-size:1.5rem}}p{margin-top:0}a{color:#1eaedb}a:hover{color:#0fa0ce}.button,button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;height:38px;padding:0 30px;color:#555;text-align:center;font-size:11px;font-weight:600;line-height:38px;letter-spacing:.1rem;text-transform:uppercase;text-decoration:none;white-space:nowrap;background-color:transparent;border-radius:4px;border:1px solid #bbb;cursor:pointer;box-sizing:border-box}.button:focus,.button:hover,button:focus,button:hover,input[type=button]:focus,input[type=button]:hover,input[type=reset]:focus,input[type=reset]:hover,input[type=submit]:focus,input[type=submit]:hover{color:#333;border-color:#888;outline:0}.button.button-primary,button.button-primary,input[type=button].button-primary,input[type=reset].button-primary,input[type=submit].button-primary{color:#fff;background-color:#33c3f0;border-color:#33c3f0}.button.button-primary:focus,.button.button-primary:hover,button.button-primary:focus,button.button-primary:hover,input[type=button].button-primary:focus,input[type=button].button-primary:hover,input[type=reset].button-primary:focus,input[type=reset].button-primary:hover,input[type=submit].button-primary:focus,input[type=submit].button-primary:hover{color:#fff;background-color:#1eaedb;border-color:#1eaedb}input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{height:38px;padding:6px 10px;background-color:#fff;border:1px solid #d1d1d1;border-radius:4px;box-shadow:none;box-sizing:border-box}input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none}textarea{min-height:65px;padding-top:6px;padding-bottom:6px}input[type=email]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{border:1px solid #33c3f0;outline:0}label,legend{display:block;margin-bottom:.5rem;font-weight:600}fieldset{padding:0;border-width:0}input[type=checkbox],input[type=radio]{display:inline}label>.label-body{display:inline-block;margin-left:.5rem;font-weight:400}ul{list-style:circle inside}ol{list-style:decimal inside}ol,ul{padding-left:0;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin:1.5rem 0 1.5rem 3rem;font-size:90%}li{margin-bottom:1rem}code{padding:.2rem .5rem;margin:0 .2rem;font-size:90%;white-space:nowrap;border-radius:4px}pre>code{display:block;padding:1rem 1.5rem;white-space:pre}td,th{padding:12px 15px;text-align:left;border-bottom:1px solid #e1e1e1}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}.button,button{margin-bottom:1rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}.u-full-width{width:100%;box-sizing:border-box}.u-max-full-width{max-width:100%;box-sizing:border-box}.u-pull-right{float:right}.u-pull-left{float:left}hr{margin-top:3rem;margin-bottom:3.5rem;border-width:0;border-top:1px solid #e1e1e1}.container:after,.row:after,.u-cf{content:"";display:table;clear:both}body{overflow-x:hidden}.ribbon{position:absolute;top:42px;width:200px;padding:1px 0;background:#000;color:#eee;box-shadow:0 0 10px rgba(0,0,0,.5)}.ribbon.left{left:-42px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.ribbon.right{right:-42px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ribbon a,.ribbon a:active,.ribbon a:hover,.ribbon a:visited{display:block;padding:1px 0;height:24px;line-height:24px;color:inherit;text-align:center;text-decoration:none;font-family:Cabin Condensed,sans-serif;font-size:16px;font-weight:500;border:1px solid hsla(0,0%,100%,.3);-moz-text-shadow:0 0 10px rgba(0,0,0,.31);-webkit-text-shadow:0 0 10px rgba(0,0,0,.31);text-shadow:0 0 10px rgba(0,0,0,.31)}.ribbon.black{background:#000}.ribbon.red{background:#c00}.ribbon.blue{background:#09e}.ribbon.green{background:#0a0}.ribbon.orange{background:#d80}.ribbon.purple{background:#c0c}.ribbon.grey{background:#888}.ribbon.white{background:#eee;color:#000}.ribbon.white a{border:2px dotted hsla(0,0%,39%,.2)}pre{background:#002b36;word-wrap:break-word;margin:0;padding:10px;color:#839496;font-size:14px;margin-bottom:20px}code,pre{font-family:Monaco,courier,monospace}pre .comment{color:#586e75}pre .constant{color:#839496}pre .constant.language{color:#268bd2}pre .constant.regexp{color:#2aa198}pre .storage{color:#268bd2}pre .comment.docstring,pre .string,pre .string.regexp,pre .string.regexp.close,pre .string.regexp.open,pre .support.tag.script,pre .support.tag.style{color:#2aa198}pre .keyword,pre .selector{color:#859900}pre .inherited-class{font-style:italic}pre .entity{color:#b58900}[data-language=c] .function.call,pre .support{color:#859900}pre .support.method,pre .support.property,pre .variable.class,pre .variable.global,pre .variable.instance{color:#839496}*{box-sizing:border-box;-webkit-transition:all 2ms linear;transition:all 2ms linear}body,html{background:#fefefe;font-family:Roboto Slab,serif;font-weight:400;font-weight:300;color:#555;min-height:100%}.container{max-width:680px;padding:3em 1em}header{text-align:center}hr{border-color:#e7e7e7}a{color:#41bfcf;text-decoration:none}a:hover{color:#16daf4;text-decoration:underline}h3,h4{font-size:2em}h4{text-align:center}h5{font-size:1.4em}h5 span{font-size:.75em}h5 span.default{font-style:italic;color:#777}form{width:100%;margin:40px auto;background:#f1f1f1;border-radius:5px;padding:3em 2em;color:#555}fieldset{border:0;max-width:580px;margin:0 auto}label{font-size:12px;text-transform:uppercase;display:block;padding-top:0;margin-top:0}input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{line-height:2.5;height:auto;border-radius:0;font-size:1.25em;padding:8px 20px;outline:none;width:100%}input[type=email]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{border:1px solid #c3c3c3}.passwordField{width:100%}.passwordField__strength{color:#999} 2 | /*# sourceMappingURL=style.css.map*/ -------------------------------------------------------------------------------- /demo/style.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"style.css","sourceRoot":""} -------------------------------------------------------------------------------- /dev_server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React UX Password Field 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | Fork me on GitHub 15 |
16 | 17 |
18 |
19 |

React UX Password Field

20 |
21 |
22 | 23 |
24 | 25 |

This react component aims to improve common issues in password field UX.

26 |
    27 |
  1. 28 | Password Strength Detection - Show the password complexity using Dropbox's zxcvbn library, loaded async and updated onChange. 29 |
  2. 30 | 31 |
  3. Timed Password Masking - Users make errors when they can't see the password field. React UX Password temporarily shows the password, then hides after a configurable 1200ms. Best explained in the nngroup article: Stop Password Masking 32 |
  4. 33 |
  5. Stateful Class - Know the HTML5 validity of your field by class.
  6. 34 |
35 | 36 |

Inspect element to see all your password info with debug mode on!

37 | 38 |
39 | 40 |

Install

41 |
 42 |       npm install react-ux-password-field
 43 |     
44 |

View it on Github

45 |
46 | 47 |

Use

48 |
 49 |       // use it like any other react component.
 50 | // just require and place it inside your render function.
 51 | 
 52 | var InputPassword = require('react-ux-password-field');
 53 | 
 54 | ...
 55 | 
 56 | render: function() {
 57 |   return (
 58 |     <InputPassword />
 59 |   )
 60 | }
 61 |       
 62 |     
63 |

* React UX Password Field is UMD compatible, meaning it will load with 64 | commonJS, AMD/RequireJS, or standalone.

65 |
66 |

Options (props)

67 |

Add your attributes normally like you would any password field. (id, placeholder, required, pattern etc...) But now you get the following extras:

68 |
69 | 70 |

Info Bar

71 | 72 |
73 | infoBar (bool) default: true 74 |
75 |

76 |

infoBar={false}
will disable the visible meter below the field.

77 |

78 | You can still rely on the attributes in the container class to do any other logic including. 79 |

80 |
    81 |
  • data-valid - current valid state of the field.
  • 82 |
  • data-score - current password strength score.
  • 83 |
  • data-entropy - current password entropy.
  • 84 |
85 | 86 |
87 | 88 |

Password Strength

89 | 90 |
zxcvbn (bool|string) default: true
91 |

92 |

zxcvbn={false}
If false is passed. zxcvbn will be disabled. You can also pass an alternate source in a string to modify the async loaded source. default is: https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js 93 |

94 |

95 | You can also pass "debug" as your string and it will console.log the zxcvbn object returned on each password change. 96 |

97 |

98 | Note: zxcvbn is loaded async as it is a pretty big file. The async load time usually isn't an issue for a password usecase, if it is. Consider disabling and moving to a server-side load. 99 |

100 | 101 |
102 | 103 |
minScore (number) default: 0
104 |

105 |

minScore={2}
provides a password strength score based on 0-4. You can set the minimum accepted score for the field to be considered valid. Note: Dropbox who created and uses the library, does not set a minimum score, but does provide the info for the user. 106 |

107 | 108 |
109 |
statusColor (string)#5CE592
110 |

111 |

statusColor="#5CE592"
will change the default valid color in the bar. 112 |

113 | 114 |
115 |
statusInactiveColor (string)#FC6F6F
116 |

117 |

statusInactiveColor="#FC6F6F"
will change the default invalid color in the bar. 118 |

119 | 120 |
121 |
changeCb (function(oldValue, newValue))
122 |

123 |

changeCb={funcName}
will call your callback on zxcvbn level change. It will pass in the old and new value. You can use this to hook other state related to the quality of the password if needed. 124 |

125 | 126 |
127 |

Masking

128 | 129 |
toggleMask (bool) default: true
130 |

131 |

toggleMask={false}
will disable the temporarily unmasking password, and it will revert to acting like a normal password field which masks the entire time. 132 |

133 | 134 |
unMaskTime (number in ms.) default: 1400
135 |

136 |

unMaskTime={1400}
will change the default length a password field is unmasked for. *This is debounced, so the count will only start when typing is paused. 137 |

138 | 139 |
140 |

HTML5 Attributes

141 | 142 | 143 |
minLength (number)
144 |

145 |

minLength={7}
currently, the html5 spec only provides maxLength property. But react makes it easy to add a minLength as well. This can also easily be implemented with the pattern field. 146 |

147 | 148 |

149 | You can also use all the default HTML5 input validation attributes, like maxLength, pattern, required etc... 150 |

151 | 152 |
153 |

Callback

154 |
onChange (function(event, isValid, score))
155 |

156 |

onChange={funcName}
will NOT override the native onChange method. Instead it will be called during the native onChange method, and pass the event, isValid and zxcvbn score through. 157 |

158 | 159 |
160 |

Contributing

161 |

162 | Pull requests are welcomed, please file an issue explaining the problem you're solving first, and pull-request to an upstream branch instead of master. 163 |

164 | 165 |
166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /lib/react-ux-password-field.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * React UX Password Field 3 | * version: 0.9.12 4 | * 5 | * MIT Licensed 6 | * github: https://github.com/seethroughtrees/react-ux-password-field/ 7 | * demo: https://seethroughtrees.github.io/react-ux-password-field/ 8 | * 9 | */ 10 | (function webpackUniversalModuleDefinition(root, factory) { 11 | if(typeof exports === 'object' && typeof module === 'object') 12 | module.exports = factory(require("react")); 13 | else if(typeof define === 'function' && define.amd) 14 | define(["react"], factory); 15 | else if(typeof exports === 'object') 16 | exports["react-ux-password-field"] = factory(require("react")); 17 | else 18 | root["react-ux-password-field"] = factory(root["React"]); 19 | })(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { 20 | return /******/ (function(modules) { // webpackBootstrap 21 | /******/ // The module cache 22 | /******/ var installedModules = {}; 23 | 24 | /******/ // The require function 25 | /******/ function __webpack_require__(moduleId) { 26 | 27 | /******/ // Check if module is in cache 28 | /******/ if(installedModules[moduleId]) 29 | /******/ return installedModules[moduleId].exports; 30 | 31 | /******/ // Create a new module (and put it into the cache) 32 | /******/ var module = installedModules[moduleId] = { 33 | /******/ exports: {}, 34 | /******/ id: moduleId, 35 | /******/ loaded: false 36 | /******/ }; 37 | 38 | /******/ // Execute the module function 39 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 40 | 41 | /******/ // Flag the module as loaded 42 | /******/ module.loaded = true; 43 | 44 | /******/ // Return the exports of the module 45 | /******/ return module.exports; 46 | /******/ } 47 | 48 | 49 | /******/ // expose the modules object (__webpack_modules__) 50 | /******/ __webpack_require__.m = modules; 51 | 52 | /******/ // expose the module cache 53 | /******/ __webpack_require__.c = installedModules; 54 | 55 | /******/ // __webpack_public_path__ 56 | /******/ __webpack_require__.p = ""; 57 | 58 | /******/ // Load entry module and return exports 59 | /******/ return __webpack_require__(0); 60 | /******/ }) 61 | /************************************************************************/ 62 | /******/ ([ 63 | /* 0 */ 64 | /***/ function(module, exports, __webpack_require__) { 65 | 66 | 'use strict'; 67 | 68 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 69 | 70 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } 71 | 72 | var React = __webpack_require__(1), 73 | RP = React.PropTypes, 74 | config = __webpack_require__(2), 75 | debounce = __webpack_require__(3); 76 | 77 | var InputPassword = React.createClass({ 78 | displayName: 'InputPassword', 79 | 80 | /*========== VALIDATE ==========*/ 81 | 82 | propTypes: { 83 | infoBar: RP.bool, 84 | statusColor: RP.string, 85 | statusInactiveColor: RP.string, 86 | minScore: RP.number, 87 | changeCb: RP.func, 88 | toggleMask: RP.bool, 89 | unMaskTime: RP.number, 90 | minLength: RP.number, 91 | strengthLang: RP.array, 92 | id: RP.string 93 | }, 94 | 95 | /*========== DEFAULTS ==========*/ 96 | 97 | getDefaultProps: function getDefaultProps() { 98 | return { 99 | infoBar: true, 100 | statusColor: config.statusColor, 101 | statusInactiveColor: config.statusInactiveColor, 102 | zxcvbn: config.zxcvbnSrc, 103 | minScore: 0, 104 | toggleMask: true, 105 | unMaskTime: config.unMaskTime, 106 | strengthLang: config.strengthLang, 107 | id: 'input' 108 | }; 109 | }, 110 | 111 | getInitialState: function getInitialState() { 112 | return { 113 | value: '', 114 | score: 0, 115 | entropy: 0, 116 | isPassword: true, 117 | isValid: false 118 | }; 119 | }, 120 | 121 | /*========== STYLES ==========*/ 122 | 123 | getMeterStyle: function getMeterStyle(score) { 124 | var width = this.state.value === '' ? 0 : 24 * score + 4; 125 | return { 126 | width: this.props.zxcvbn ? width + '%' : '100%', 127 | maxWidth: '85%', 128 | opacity: this.props.zxcvbn ? width * .01 + .5 : '1', 129 | background: this.state.isValid ? this.props.statusColor : this.props.statusInactiveColor, 130 | height: 5, 131 | transition: 'all 400ms linear', 132 | display: 'inline-block', 133 | marginRight: '1%' 134 | }; 135 | }, 136 | 137 | unMaskStyle: { 138 | color: config.unMaskColor, 139 | fontWeight: 200 140 | }, 141 | 142 | infoStyle: { 143 | position: 'absolute', 144 | bottom: -10, 145 | width: '100%', 146 | overflow: 'hidden', 147 | height: 24 148 | }, 149 | 150 | iconStyle: { 151 | display: 'inline-block', 152 | opacity: .25, 153 | position: 'relative', 154 | top: 2, 155 | width: '3%' 156 | }, 157 | 158 | strengthLangStyle: { 159 | fontSize: 12, 160 | position: 'relative', 161 | top: 2 162 | }, 163 | 164 | /*========== METHODS ==========*/ 165 | 166 | addPasswordType: function addPasswordType() { 167 | this.setState({ 168 | isPassword: true 169 | }); 170 | }, 171 | 172 | /*========== HANDLERS ==========*/ 173 | 174 | handleInputType: function handleInputType() { 175 | this.setState({ 176 | isPassword: !this.state.isPassword 177 | }); 178 | }, 179 | 180 | handleChange: function handleChange(e) { 181 | e.preventDefault(); 182 | 183 | var native_target = e.nativeEvent.target; 184 | var val = e.target.value; 185 | var score; 186 | 187 | this.setState({ 188 | value: val, 189 | isValid: e.target.validity.valid, 190 | selectionStart: native_target.selectionStart, 191 | selectionEnd: native_target.selectionEnd 192 | }); 193 | 194 | if (this.props.toggleMask) { 195 | this.handleToggleMask(); 196 | } 197 | 198 | if (this.props.zxcvbn) { 199 | score = this.handleZxcvbn(val); 200 | } else { 201 | score = this.state.score; 202 | } 203 | 204 | // call onChange prop passed from parent 205 | if (this.props.onChange) { 206 | this.props.onChange(val, this.state.isValid, score); 207 | } 208 | 209 | if (this.props.minLength) { 210 | this.handleMinLength(e.target.value.length); 211 | } 212 | }, 213 | 214 | handleToggleMask: function handleToggleMask() { 215 | 216 | // display password, then 217 | this.setState({ 218 | isPassword: false 219 | }); 220 | 221 | // debounce remasking password 222 | this.maskPassword(); 223 | }, 224 | 225 | handleZxcvbn: function handleZxcvbn(val) { 226 | 227 | if (typeof zxcvbn === 'undefined' && typeof window.zxcvbn === 'undefined') { 228 | return; 229 | } 230 | 231 | var stats = zxcvbn(val), 232 | currentScore = stats.score; 233 | 234 | this.setState({ 235 | score: currentScore, 236 | entropy: stats.entropy 237 | }); 238 | 239 | if (currentScore < this.props.minScore) { 240 | this.setState({ 241 | isValid: false 242 | }); 243 | } 244 | 245 | // if score changed and callback provided 246 | if (this.props.changeCb && this.state.score !== currentScore) { 247 | this.props.changeCb(this.state.score, currentScore, val); 248 | } 249 | 250 | if (this.props.zxcvbn === 'debug') { 251 | console.debug(stats); 252 | } 253 | 254 | return currentScore; 255 | }, 256 | 257 | handleMinLength: function handleMinLength(len) { 258 | if (len <= this.props.minLength) { 259 | this.setState({ 260 | isValid: false 261 | }); 262 | } 263 | }, 264 | 265 | componentWillMount: function componentWillMount() { 266 | var zxcvbnSrc; 267 | 268 | // Load zxcvbn async if its enabled and doesn't already exist 269 | if (this.props.zxcvbn && typeof zxcvbn === 'undefined') { 270 | 271 | zxcvbnSrc = this.props.zxcvbn !== 'debug' ? this.props.zxcvbn : config.zxcvbnSrc; 272 | 273 | // snippet to async load zxcvbn if enabled 274 | (function () { 275 | var a;a = function () { 276 | var a, b;b = document.createElement("script");b.src = zxcvbnSrc;b.type = "text/javascript";b.async = !0;a = document.getElementsByTagName("head")[0];return a.parentNode.insertBefore(b, a); 277 | };null != window.attachEvent ? window.attachEvent("onload", a) : window.addEventListener("load", a, !1); 278 | }).call(this); 279 | } 280 | 281 | // set debouncer for password 282 | if (this.props.toggleMask) { 283 | this.maskPassword = debounce(this.addPasswordType, this.props.unMaskTime); 284 | } 285 | }, 286 | 287 | componentWillUnmount: function componentWillUnmount() { 288 | // cancel the debouncer when component is not used anymore. This to avoid 289 | // setting the state unnecessarily, see issue #24 290 | if (this.maskPassword) { 291 | this.maskPassword.cancel(); 292 | } 293 | }, 294 | 295 | render: function render() { 296 | var infoBar; 297 | 298 | if (this.props.infoBar) { 299 | infoBar = React.createElement( 300 | 'div', 301 | { className: 'passwordField__info', style: this.infoStyle }, 302 | React.createElement( 303 | 'span', 304 | { style: this.iconStyle, className: 'passwordField__icon' }, 305 | React.createElement('img', { src: __webpack_require__(4), height: '10', width: '10' }) 306 | ), 307 | React.createElement('span', { style: this.getMeterStyle(this.state.score), className: 'passwordField__meter' }), 308 | React.createElement( 309 | 'span', 310 | { style: this.strengthLangStyle, className: 'passwordField__strength' }, 311 | this.props.zxcvbn && this.state.value.length > 0 && this.props.strengthLang.length > 0 ? this.props.strengthLang[this.state.score] : null 312 | ) 313 | ); 314 | } 315 | 316 | // allow onChange to be passed from parent and not override default prop 317 | var _props = this.props; 318 | var onChange = _props.onChange; 319 | 320 | var props = _objectWithoutProperties(_props, ['onChange']); 321 | 322 | // overcome problem with firefox resetting the input selection point 323 | var that = this; 324 | if (typeof navigator !== 'undefined') { 325 | setTimeout(function () { 326 | if (!/Firefox/.test(navigator.userAgent)) return; 327 | var elem = that.refs[that.props.id].getDOMNode(); 328 | elem.selectionStart = that.state.selectionStart; 329 | elem.selectionEnd = that.state.selectionEnd; 330 | }, 1); 331 | } 332 | 333 | return React.createElement( 334 | 'div', 335 | { 336 | style: { position: 'relative', display: 'inline-block' }, 337 | className: 'passwordField', 338 | 'data-valid': this.state.isValid, 339 | 'data-score': this.state.score, 340 | 'data-entropy': this.state.entropy 341 | }, 342 | React.createElement('input', _extends({ 343 | ref: this.props.id, 344 | className: 'passwordField__input', 345 | type: this.state.isPassword ? 'password' : 'text', 346 | value: this.state.value, 347 | style: this.state.isPassword ? null : this.unMaskStyle, 348 | onChange: this.handleChange 349 | }, props)), 350 | infoBar 351 | ); 352 | } 353 | }); 354 | 355 | module.exports = InputPassword; 356 | 357 | /***/ }, 358 | /* 1 */ 359 | /***/ function(module, exports) { 360 | 361 | module.exports = __WEBPACK_EXTERNAL_MODULE_1__; 362 | 363 | /***/ }, 364 | /* 2 */ 365 | /***/ function(module, exports) { 366 | 367 | 'use strict'; 368 | 369 | module.exports = { 370 | statusColor: '#5CE592', 371 | statusInactiveColor: '#FC6F6F', 372 | unMaskColor: '#c7c7c7', 373 | unMaskTime: 1400, 374 | zxcvbnSrc: 'https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js', 375 | strengthLang: ['Weak', 'Okay', 'Good', 'Strong', 'Great'] 376 | }; 377 | 378 | /***/ }, 379 | /* 3 */ 380 | /***/ function(module, exports) { 381 | 382 | /** 383 | * lodash 4.0.6 (Custom Build) 384 | * Build: `lodash modularize exports="npm" -o ./` 385 | * Copyright jQuery Foundation and other contributors 386 | * Released under MIT license 387 | * Based on Underscore.js 1.8.3 388 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 389 | */ 390 | 391 | /** Used as the `TypeError` message for "Functions" methods. */ 392 | 'use strict'; 393 | 394 | var FUNC_ERROR_TEXT = 'Expected a function'; 395 | 396 | /** Used as references for various `Number` constants. */ 397 | var NAN = 0 / 0; 398 | 399 | /** `Object#toString` result references. */ 400 | var funcTag = '[object Function]', 401 | genTag = '[object GeneratorFunction]', 402 | symbolTag = '[object Symbol]'; 403 | 404 | /** Used to match leading and trailing whitespace. */ 405 | var reTrim = /^\s+|\s+$/g; 406 | 407 | /** Used to detect bad signed hexadecimal string values. */ 408 | var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 409 | 410 | /** Used to detect binary string values. */ 411 | var reIsBinary = /^0b[01]+$/i; 412 | 413 | /** Used to detect octal string values. */ 414 | var reIsOctal = /^0o[0-7]+$/i; 415 | 416 | /** Built-in method references without a dependency on `root`. */ 417 | var freeParseInt = parseInt; 418 | 419 | /** Used for built-in method references. */ 420 | var objectProto = Object.prototype; 421 | 422 | /** 423 | * Used to resolve the 424 | * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 425 | * of values. 426 | */ 427 | var objectToString = objectProto.toString; 428 | 429 | /* Built-in method references for those with the same name as other `lodash` methods. */ 430 | var nativeMax = Math.max, 431 | nativeMin = Math.min; 432 | 433 | /** 434 | * Gets the timestamp of the number of milliseconds that have elapsed since 435 | * the Unix epoch (1 January 1970 00:00:00 UTC). 436 | * 437 | * @static 438 | * @memberOf _ 439 | * @since 2.4.0 440 | * @type {Function} 441 | * @category Date 442 | * @returns {number} Returns the timestamp. 443 | * @example 444 | * 445 | * _.defer(function(stamp) { 446 | * console.log(_.now() - stamp); 447 | * }, _.now()); 448 | * // => Logs the number of milliseconds it took for the deferred function to be invoked. 449 | */ 450 | var now = Date.now; 451 | 452 | /** 453 | * Creates a debounced function that delays invoking `func` until after `wait` 454 | * milliseconds have elapsed since the last time the debounced function was 455 | * invoked. The debounced function comes with a `cancel` method to cancel 456 | * delayed `func` invocations and a `flush` method to immediately invoke them. 457 | * Provide an options object to indicate whether `func` should be invoked on 458 | * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked 459 | * with the last arguments provided to the debounced function. Subsequent calls 460 | * to the debounced function return the result of the last `func` invocation. 461 | * 462 | * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked 463 | * on the trailing edge of the timeout only if the debounced function is 464 | * invoked more than once during the `wait` timeout. 465 | * 466 | * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 467 | * for details over the differences between `_.debounce` and `_.throttle`. 468 | * 469 | * @static 470 | * @memberOf _ 471 | * @since 0.1.0 472 | * @category Function 473 | * @param {Function} func The function to debounce. 474 | * @param {number} [wait=0] The number of milliseconds to delay. 475 | * @param {Object} [options={}] The options object. 476 | * @param {boolean} [options.leading=false] 477 | * Specify invoking on the leading edge of the timeout. 478 | * @param {number} [options.maxWait] 479 | * The maximum time `func` is allowed to be delayed before it's invoked. 480 | * @param {boolean} [options.trailing=true] 481 | * Specify invoking on the trailing edge of the timeout. 482 | * @returns {Function} Returns the new debounced function. 483 | * @example 484 | * 485 | * // Avoid costly calculations while the window size is in flux. 486 | * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 487 | * 488 | * // Invoke `sendMail` when clicked, debouncing subsequent calls. 489 | * jQuery(element).on('click', _.debounce(sendMail, 300, { 490 | * 'leading': true, 491 | * 'trailing': false 492 | * })); 493 | * 494 | * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 495 | * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 496 | * var source = new EventSource('/stream'); 497 | * jQuery(source).on('message', debounced); 498 | * 499 | * // Cancel the trailing debounced invocation. 500 | * jQuery(window).on('popstate', debounced.cancel); 501 | */ 502 | function debounce(func, wait, options) { 503 | var lastArgs, 504 | lastThis, 505 | maxWait, 506 | result, 507 | timerId, 508 | lastCallTime = 0, 509 | lastInvokeTime = 0, 510 | leading = false, 511 | maxing = false, 512 | trailing = true; 513 | 514 | if (typeof func != 'function') { 515 | throw new TypeError(FUNC_ERROR_TEXT); 516 | } 517 | wait = toNumber(wait) || 0; 518 | if (isObject(options)) { 519 | leading = !!options.leading; 520 | maxing = 'maxWait' in options; 521 | maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 522 | trailing = 'trailing' in options ? !!options.trailing : trailing; 523 | } 524 | 525 | function invokeFunc(time) { 526 | var args = lastArgs, 527 | thisArg = lastThis; 528 | 529 | lastArgs = lastThis = undefined; 530 | lastInvokeTime = time; 531 | result = func.apply(thisArg, args); 532 | return result; 533 | } 534 | 535 | function leadingEdge(time) { 536 | // Reset any `maxWait` timer. 537 | lastInvokeTime = time; 538 | // Start the timer for the trailing edge. 539 | timerId = setTimeout(timerExpired, wait); 540 | // Invoke the leading edge. 541 | return leading ? invokeFunc(time) : result; 542 | } 543 | 544 | function remainingWait(time) { 545 | var timeSinceLastCall = time - lastCallTime, 546 | timeSinceLastInvoke = time - lastInvokeTime, 547 | result = wait - timeSinceLastCall; 548 | 549 | return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; 550 | } 551 | 552 | function shouldInvoke(time) { 553 | var timeSinceLastCall = time - lastCallTime, 554 | timeSinceLastInvoke = time - lastInvokeTime; 555 | 556 | // Either this is the first call, activity has stopped and we're at the 557 | // trailing edge, the system time has gone backwards and we're treating 558 | // it as the trailing edge, or we've hit the `maxWait` limit. 559 | return !lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; 560 | } 561 | 562 | function timerExpired() { 563 | var time = now(); 564 | if (shouldInvoke(time)) { 565 | return trailingEdge(time); 566 | } 567 | // Restart the timer. 568 | timerId = setTimeout(timerExpired, remainingWait(time)); 569 | } 570 | 571 | function trailingEdge(time) { 572 | clearTimeout(timerId); 573 | timerId = undefined; 574 | 575 | // Only invoke if we have `lastArgs` which means `func` has been 576 | // debounced at least once. 577 | if (trailing && lastArgs) { 578 | return invokeFunc(time); 579 | } 580 | lastArgs = lastThis = undefined; 581 | return result; 582 | } 583 | 584 | function cancel() { 585 | if (timerId !== undefined) { 586 | clearTimeout(timerId); 587 | } 588 | lastCallTime = lastInvokeTime = 0; 589 | lastArgs = lastThis = timerId = undefined; 590 | } 591 | 592 | function flush() { 593 | return timerId === undefined ? result : trailingEdge(now()); 594 | } 595 | 596 | function debounced() { 597 | var time = now(), 598 | isInvoking = shouldInvoke(time); 599 | 600 | lastArgs = arguments; 601 | lastThis = this; 602 | lastCallTime = time; 603 | 604 | if (isInvoking) { 605 | if (timerId === undefined) { 606 | return leadingEdge(lastCallTime); 607 | } 608 | if (maxing) { 609 | // Handle invocations in a tight loop. 610 | clearTimeout(timerId); 611 | timerId = setTimeout(timerExpired, wait); 612 | return invokeFunc(lastCallTime); 613 | } 614 | } 615 | if (timerId === undefined) { 616 | timerId = setTimeout(timerExpired, wait); 617 | } 618 | return result; 619 | } 620 | debounced.cancel = cancel; 621 | debounced.flush = flush; 622 | return debounced; 623 | } 624 | 625 | /** 626 | * Checks if `value` is classified as a `Function` object. 627 | * 628 | * @static 629 | * @memberOf _ 630 | * @since 0.1.0 631 | * @category Lang 632 | * @param {*} value The value to check. 633 | * @returns {boolean} Returns `true` if `value` is correctly classified, 634 | * else `false`. 635 | * @example 636 | * 637 | * _.isFunction(_); 638 | * // => true 639 | * 640 | * _.isFunction(/abc/); 641 | * // => false 642 | */ 643 | function isFunction(value) { 644 | // The use of `Object#toString` avoids issues with the `typeof` operator 645 | // in Safari 8 which returns 'object' for typed array and weak map constructors, 646 | // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. 647 | var tag = isObject(value) ? objectToString.call(value) : ''; 648 | return tag == funcTag || tag == genTag; 649 | } 650 | 651 | /** 652 | * Checks if `value` is the 653 | * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) 654 | * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 655 | * 656 | * @static 657 | * @memberOf _ 658 | * @since 0.1.0 659 | * @category Lang 660 | * @param {*} value The value to check. 661 | * @returns {boolean} Returns `true` if `value` is an object, else `false`. 662 | * @example 663 | * 664 | * _.isObject({}); 665 | * // => true 666 | * 667 | * _.isObject([1, 2, 3]); 668 | * // => true 669 | * 670 | * _.isObject(_.noop); 671 | * // => true 672 | * 673 | * _.isObject(null); 674 | * // => false 675 | */ 676 | function isObject(value) { 677 | var type = typeof value; 678 | return !!value && (type == 'object' || type == 'function'); 679 | } 680 | 681 | /** 682 | * Checks if `value` is object-like. A value is object-like if it's not `null` 683 | * and has a `typeof` result of "object". 684 | * 685 | * @static 686 | * @memberOf _ 687 | * @since 4.0.0 688 | * @category Lang 689 | * @param {*} value The value to check. 690 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 691 | * @example 692 | * 693 | * _.isObjectLike({}); 694 | * // => true 695 | * 696 | * _.isObjectLike([1, 2, 3]); 697 | * // => true 698 | * 699 | * _.isObjectLike(_.noop); 700 | * // => false 701 | * 702 | * _.isObjectLike(null); 703 | * // => false 704 | */ 705 | function isObjectLike(value) { 706 | return !!value && typeof value == 'object'; 707 | } 708 | 709 | /** 710 | * Checks if `value` is classified as a `Symbol` primitive or object. 711 | * 712 | * @static 713 | * @memberOf _ 714 | * @since 4.0.0 715 | * @category Lang 716 | * @param {*} value The value to check. 717 | * @returns {boolean} Returns `true` if `value` is correctly classified, 718 | * else `false`. 719 | * @example 720 | * 721 | * _.isSymbol(Symbol.iterator); 722 | * // => true 723 | * 724 | * _.isSymbol('abc'); 725 | * // => false 726 | */ 727 | function isSymbol(value) { 728 | return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; 729 | } 730 | 731 | /** 732 | * Converts `value` to a number. 733 | * 734 | * @static 735 | * @memberOf _ 736 | * @since 4.0.0 737 | * @category Lang 738 | * @param {*} value The value to process. 739 | * @returns {number} Returns the number. 740 | * @example 741 | * 742 | * _.toNumber(3); 743 | * // => 3 744 | * 745 | * _.toNumber(Number.MIN_VALUE); 746 | * // => 5e-324 747 | * 748 | * _.toNumber(Infinity); 749 | * // => Infinity 750 | * 751 | * _.toNumber('3'); 752 | * // => 3 753 | */ 754 | function toNumber(value) { 755 | if (typeof value == 'number') { 756 | return value; 757 | } 758 | if (isSymbol(value)) { 759 | return NAN; 760 | } 761 | if (isObject(value)) { 762 | var other = isFunction(value.valueOf) ? value.valueOf() : value; 763 | value = isObject(other) ? other + '' : other; 764 | } 765 | if (typeof value != 'string') { 766 | return value === 0 ? value : +value; 767 | } 768 | value = value.replace(reTrim, ''); 769 | var isBinary = reIsBinary.test(value); 770 | return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; 771 | } 772 | 773 | module.exports = debounce; 774 | 775 | /***/ }, 776 | /* 4 */ 777 | /***/ function(module, exports) { 778 | 779 | module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCRkNDMzg4M0FFN0IxMUU0OTE2RkY5MzYyMkI3QTVDMiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCRkNDMzg4NEFFN0IxMUU0OTE2RkY5MzYyMkI3QTVDMiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkJGQ0MzODgxQUU3QjExRTQ5MTZGRjkzNjIyQjdBNUMyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkJGQ0MzODgyQUU3QjExRTQ5MTZGRjkzNjIyQjdBNUMyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+NkztvAAAAc9JREFUeNq8lk8oBFEcx2fG5k+0HJRQ/iVy2U1tUsjBzYnI2cUWJyl3XJRSkgOtxEU4keLgQP6kuColoeQgEkXWand8X/3UNM28Z56Z961PO2/fb9535r3f/N7TTdPUnBSLxTSBcsEA6AW1IAw+wD3YAtPg0+1mXdK4DJyAKk7MM+gE506dhuZdleBSYMpUDM5Ah1NnyKOpDnZpWn91C/ZBksZrBhFL/zaopyWQNh4HDZZ2AsQd4kbBFF3ngRnQ8581vgHVdH0M2jgPeWjpz1BePMqscdRiyrQhiF+25VK7bHI12toXgvg9+yTKGpc6TDtPD+DJ0i6RNS6ytZOC+IwtpkA2q1epKLyDb/D2h3uGQQXIBqcyWd1FBeEOZNFM1YEckHYpTGzgKyqbpmWp1kEq9IeCcQRaNP80CZoMQclb8NmUqRys8IxZpenTglHUEOxAhQEZ5/OM01qAMnwah+3Ng2BTpTGr2a1gHnSDCVXGs7Z2QpVxjUNSKjGeo29T+RuHqaRqtOdGVGZ1in6/VH9OYZet01Uhnx5qBLyAIT+MvVQulslLflWuazq+BKFXnvEaWAzI+IA31ezUMEaJE6dDQYb+9yrdMrs7oP9HgAEAXmVa5ulD/g0AAAAASUVORK5CYII=" 780 | 781 | /***/ } 782 | /******/ ]) 783 | }); 784 | ; -------------------------------------------------------------------------------- /lib/react-ux-password-field.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * React UX Password Field 3 | * version: 0.9.12 4 | * 5 | * MIT Licensed 6 | * github: https://github.com/seethroughtrees/react-ux-password-field/ 7 | * demo: https://seethroughtrees.github.io/react-ux-password-field/ 8 | * 9 | */ 10 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["react-ux-password-field"]=e(require("react")):t["react-ux-password-field"]=e(t.React)}(this,function(t){return function(t){function e(s){if(n[s])return n[s].exports;var i=n[s]={exports:{},id:s,loaded:!1};return t[s].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function s(t,e){var n={};for(var s in t)e.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s]);return n}var i=Object.assign||function(t){for(var e=1;e0&&this.props.strengthLang.length>0?this.props.strengthLang[this.state.score]:null)));var e=this.props,a=(e.onChange,s(e,["onChange"])),r=this;return"undefined"!=typeof navigator&&setTimeout(function(){if(/Firefox/.test(navigator.userAgent)){var t=r.refs[r.props.id].getDOMNode();t.selectionStart=r.state.selectionStart,t.selectionEnd=r.state.selectionEnd}},1),o.createElement("div",{style:{position:"relative",display:"inline-block"},className:"passwordField","data-valid":this.state.isValid,"data-score":this.state.score,"data-entropy":this.state.entropy},o.createElement("input",i({ref:this.props.id,className:"passwordField__input",type:this.state.isPassword?"password":"text",value:this.state.value,style:this.state.isPassword?null:this.unMaskStyle,onChange:this.handleChange},a)),t)}});t.exports=l},function(t,e){"use strict";function n(t,e,n){function s(e){var n=v,s=f;return v=f=void 0,k=e,b=t.apply(s,n)}function o(t){return k=t,m=setTimeout(p,e),S?s(t):b}function a(t){var n=t-x,s=t-k,i=e-n;return I?A(i,y-s):i}function l(t){var n=t-x,s=t-k;return!x||n>=e||0>n||I&&s>=y}function p(){var t=w();return l(t)?u(t):void(m=setTimeout(p,a(t)))}function u(t){return clearTimeout(m),m=void 0,E&&v?s(t):(v=f=void 0,b)}function d(){void 0!==m&&clearTimeout(m),x=k=0,v=f=m=void 0}function h(){return void 0===m?b:u(w())}function g(){var t=w(),n=l(t);if(v=arguments,f=this,x=t,n){if(void 0===m)return o(x);if(I)return clearTimeout(m),m=setTimeout(p,e),s(x)}return void 0===m&&(m=setTimeout(p,e)),b}var v,f,y,b,m,x=0,k=0,S=!1,I=!1,E=!0;if("function"!=typeof t)throw new TypeError(c);return e=r(e)||0,i(n)&&(S=!!n.leading,I="maxWait"in n,y=I?M(r(n.maxWait)||0,e):y,E="trailing"in n?!!n.trailing:E),g.cancel=d,g.flush=h,g}function s(t){var e=i(t)?m.call(t):"";return e==p||e==u}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==typeof t}function a(t){return"symbol"==typeof t||o(t)&&m.call(t)==d}function r(t){if("number"==typeof t)return t;if(a(t))return l;if(i(t)){var e=s(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(h,"");var n=v.test(t);return n||f.test(t)?y(t.slice(2),n?2:8):g.test(t)?l:+t}var c="Expected a function",l=NaN,p="[object Function]",u="[object GeneratorFunction]",d="[object Symbol]",h=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,f=/^0o[0-7]+$/i,y=parseInt,b=Object.prototype,m=b.toString,M=Math.max,A=Math.min,w=Date.now;t.exports=n},function(t,e){"use strict";t.exports={statusColor:"#5CE592",statusInactiveColor:"#FC6F6F",unMaskColor:"#c7c7c7",unMaskTime:1400,zxcvbnSrc:"https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js",strengthLang:["Weak","Okay","Good","Strong","Great"]}},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBh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eNq8lk8oBFEcx2fG5k+0HJRQ/iVy2U1tUsjBzYnI2cUWJyl3XJRSkgOtxEU4keLgQP6kuColoeQgEkXWand8X/3UNM28Z56Z961PO2/fb9535r3f/N7TTdPUnBSLxTSBcsEA6AW1IAw+wD3YAtPg0+1mXdK4DJyAKk7MM+gE506dhuZdleBSYMpUDM5Ah1NnyKOpDnZpWn91C/ZBksZrBhFL/zaopyWQNh4HDZZ2AsQd4kbBFF3ngRnQ8581vgHVdH0M2jgPeWjpz1BePMqscdRiyrQhiF+25VK7bHI12toXgvg9+yTKGpc6TDtPD+DJ0i6RNS6ytZOC+IwtpkA2q1epKLyDb/D2h3uGQQXIBqcyWd1FBeEOZNFM1YEckHYpTGzgKyqbpmWp1kEq9IeCcQRaNP80CZoMQclb8NmUqRys8IxZpenTglHUEOxAhQEZ5/OM01qAMnwah+3Ng2BTpTGr2a1gHnSDCVXGs7Z2QpVxjUNSKjGeo29T+RuHqaRqtOdGVGZ1in6/VH9OYZet01Uhnx5qBLyAIT+MvVQulslLflWuazq+BKFXnvEaWAzI+IA31ezUMEaJE6dDQYb+9yrdMrs7oP9HgAEAXmVa5ulD/g0AAAAASUVORK5CYII="},function(e,n){e.exports=t}])}); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-ux-password-field", 3 | "version": "0.9.12", 4 | "license": "MIT", 5 | "main": "src/index.js", 6 | "browser": "./lib/react-ux-password-field.js", 7 | "description": "A UX forward password field for react-js", 8 | "scripts": { 9 | "dev": "webpack --watch --port 9501 --colors", 10 | "demo": "webpack-dev-server --config webpack.server.config.js --content-base ./dev_server --port 9500 --colors --hot", 11 | "test": "jest", 12 | "build": "webpack && webpack -p --config webpack.min.config.js && webpack -p -d --config webpack.demo.config.js", 13 | "deploy": "gh-pages-deploy" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/seethroughtrees/react-ux-password-field.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/seethroughtrees/react-ux-password-field/issues" 21 | }, 22 | "keywords": [ 23 | "react", 24 | "react-component", 25 | "form", 26 | "validation", 27 | "html5", 28 | "password", 29 | "password-strength", 30 | "zxcvbn", 31 | "validate", 32 | "password-security" 33 | ], 34 | "author": "seethroughtrees", 35 | "homepage": "https://seethroughtrees.github.io/react-ux-password-field/", 36 | "engines": { 37 | "iojs": ">=2.x.x", 38 | "nodejs": ">=0.11.x" 39 | }, 40 | "dependencies": { 41 | "lodash.debounce": "^3.1.1", 42 | "react": ">=0.13.0" 43 | }, 44 | "devDependencies": { 45 | "autoprefixer-core": "^6.0.1", 46 | "babel": "^5.8.23", 47 | "babel-core": "^5.8.25", 48 | "babel-loader": "^5.3.2", 49 | "css-loader": "^0.23.1", 50 | "csswring": "^4.2.2", 51 | "extract-text-webpack-plugin": "^1.0.1", 52 | "file-loader": "^0.8.5", 53 | "gh-pages-deploy": "^0.4.2", 54 | "jsx-loader": "^0.13.2", 55 | "node-sass": "^3.6.0", 56 | "normalize.css": "^4.1.1", 57 | "postcss-loader": "^0.8.2", 58 | "root-require": "^0.3.1", 59 | "sass-loader": "^3.2.0", 60 | "script-loader": "^0.7.0", 61 | "style-loader": "^0.13.1", 62 | "url-loader": "^0.5.7", 63 | "webpack": "^1.13.0", 64 | "webpack-dev-server": "^1.14.1" 65 | }, 66 | "gh-pages-deploy": { 67 | "staticpath": "demo", 68 | "prep": [ 69 | "build" 70 | ], 71 | "noprompt": false 72 | }, 73 | "jest": { 74 | "scriptPreprocessor": "/node_modules/babel-jest", 75 | "testFileExtensions": [ 76 | "es6", 77 | "js" 78 | ], 79 | "moduleFileExtensions": [ 80 | "js", 81 | "json", 82 | "es6" 83 | ] 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/img/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seethroughdev/react-ux-password-field/4193e6b34a09f11907f31340e4deb86f1f62f42f/src/img/lock.png -------------------------------------------------------------------------------- /src/img/lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seethroughdev/react-ux-password-field/4193e6b34a09f11907f31340e4deb86f1f62f42f/src/img/lock2.png -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var React = require('react'), 4 | RP = React.PropTypes, 5 | config = require('./js/config'), 6 | debounce = require('lodash.debounce'); 7 | 8 | var InputPassword = React.createClass({ 9 | 10 | 11 | /*========== VALIDATE ==========*/ 12 | 13 | propTypes: { 14 | infoBar: RP.bool, 15 | statusColor: RP.string, 16 | statusInactiveColor: RP.string, 17 | minScore: RP.number, 18 | changeCb: RP.func, 19 | toggleMask: RP.bool, 20 | unMaskTime: RP.number, 21 | minLength: RP.number, 22 | strengthLang:RP.array, 23 | id: RP.string, 24 | }, 25 | 26 | 27 | /*========== DEFAULTS ==========*/ 28 | 29 | getDefaultProps() { 30 | return { 31 | infoBar: true, 32 | statusColor: config.statusColor, 33 | statusInactiveColor: config.statusInactiveColor, 34 | zxcvbn: config.zxcvbnSrc, 35 | minScore: 0, 36 | toggleMask: true, 37 | unMaskTime: config.unMaskTime, 38 | strengthLang: config.strengthLang, 39 | id: 'input' 40 | } 41 | }, 42 | 43 | getInitialState() { 44 | return { 45 | value: '', 46 | score: 0, 47 | entropy: 0, 48 | isPassword: true, 49 | isValid: false 50 | } 51 | }, 52 | 53 | 54 | /*========== STYLES ==========*/ 55 | 56 | getMeterStyle(score) { 57 | var width = this.state.value === '' ? 0 : 24 * score + 4; 58 | return { 59 | width: this.props.zxcvbn ? width + '%' : '100%', 60 | maxWidth: '85%', 61 | opacity: this.props.zxcvbn ? width * .01 + .5 : '1', 62 | background: this.state.isValid ? this.props.statusColor : this.props.statusInactiveColor, 63 | height: 5, 64 | transition: 'all 400ms linear', 65 | display: 'inline-block', 66 | marginRight: '1%' 67 | } 68 | }, 69 | 70 | unMaskStyle: { 71 | color: config.unMaskColor, 72 | fontWeight: 200 73 | }, 74 | 75 | infoStyle: { 76 | position: 'absolute', 77 | bottom: -10, 78 | width: '100%', 79 | overflow: 'hidden', 80 | height: 24 81 | }, 82 | 83 | iconStyle: { 84 | display: 'inline-block', 85 | opacity: .25, 86 | position: 'relative', 87 | top: 2, 88 | width: '3%' 89 | }, 90 | 91 | strengthLangStyle: { 92 | fontSize: 12, 93 | position: 'relative', 94 | top: 2, 95 | }, 96 | 97 | 98 | /*========== METHODS ==========*/ 99 | 100 | addPasswordType() { 101 | this.setState({ 102 | isPassword: true 103 | }); 104 | }, 105 | 106 | /*========== HANDLERS ==========*/ 107 | 108 | handleInputType() { 109 | this.setState({ 110 | isPassword: !this.state.isPassword 111 | }); 112 | }, 113 | 114 | handleChange(e) { 115 | e.preventDefault(); 116 | 117 | var native_target = e.nativeEvent.target; 118 | var val = e.target.value; 119 | var score; 120 | 121 | this.setState({ 122 | value: val, 123 | isValid: e.target.validity.valid, 124 | selectionStart : native_target.selectionStart, 125 | selectionEnd : native_target.selectionEnd, 126 | }); 127 | 128 | if (this.props.toggleMask) { 129 | this.handleToggleMask(); 130 | } 131 | 132 | if (this.props.zxcvbn) { 133 | score = this.handleZxcvbn(val); 134 | } else { 135 | score = this.state.score; 136 | } 137 | 138 | // call onChange prop passed from parent 139 | if (this.props.onChange) { 140 | this.props.onChange(val, this.state.isValid, score); 141 | } 142 | 143 | if (this.props.minLength) { 144 | this.handleMinLength(e.target.value.length) 145 | } 146 | }, 147 | 148 | handleToggleMask() { 149 | 150 | // display password, then 151 | this.setState({ 152 | isPassword: false 153 | }); 154 | 155 | // debounce remasking password 156 | this.maskPassword(); 157 | }, 158 | 159 | handleZxcvbn(val) { 160 | 161 | if (typeof zxcvbn === 'undefined' && typeof window.zxcvbn === 'undefined') { 162 | return; 163 | } 164 | 165 | var stats = zxcvbn(val), 166 | currentScore = stats.score; 167 | 168 | this.setState({ 169 | score: currentScore, 170 | entropy: stats.entropy 171 | }); 172 | 173 | if (currentScore < this.props.minScore) { 174 | this.setState({ 175 | isValid: false 176 | }); 177 | } 178 | 179 | // if score changed and callback provided 180 | if (this.props.changeCb && this.state.score !== currentScore) { 181 | this.props.changeCb(this.state.score, currentScore, val) 182 | } 183 | 184 | if (this.props.zxcvbn === 'debug') { 185 | console.debug(stats); 186 | } 187 | 188 | return currentScore; 189 | }, 190 | 191 | handleMinLength(len) { 192 | if (len <= this.props.minLength) { 193 | this.setState({ 194 | isValid: false 195 | }) 196 | } 197 | }, 198 | 199 | componentWillMount() { 200 | var zxcvbnSrc; 201 | 202 | // Load zxcvbn async if its enabled and doesn't already exist 203 | if (this.props.zxcvbn && typeof zxcvbn === 'undefined') { 204 | 205 | zxcvbnSrc = this.props.zxcvbn !== 'debug' ? this.props.zxcvbn : config.zxcvbnSrc; 206 | 207 | // snippet to async load zxcvbn if enabled 208 | (function(){var a;a=function(){var a,b;b=document.createElement("script");b.src=zxcvbnSrc;b.type="text/javascript";b.async=!0;a=document.getElementsByTagName("head")[0];return a.parentNode.insertBefore(b,a)};null!=window.attachEvent?window.attachEvent("onload",a):window.addEventListener("load",a,!1)}).call(this); 209 | } 210 | 211 | // set debouncer for password 212 | if (this.props.toggleMask) { 213 | this.maskPassword = debounce(this.addPasswordType, this.props.unMaskTime); 214 | } 215 | }, 216 | 217 | componentWillUnmount() { 218 | // cancel the debouncer when component is not used anymore. This to avoid 219 | // setting the state unnecessarily, see issue #24 220 | if (this.maskPassword) { 221 | this.maskPassword.cancel() 222 | } 223 | }, 224 | 225 | render() { 226 | var infoBar; 227 | 228 | if (this.props.infoBar) { 229 | infoBar =
230 | 231 | 232 | 233 | 234 | 235 | {this.props.zxcvbn && 236 | this.state.value.length > 0 && 237 | this.props.strengthLang.length > 0 ? 238 | this.props.strengthLang[this.state.score] : null} 239 | 240 |
241 | } 242 | 243 | // allow onChange to be passed from parent and not override default prop 244 | var {onChange, ...props} = this.props; 245 | 246 | // overcome problem with firefox resetting the input selection point 247 | var that = this; 248 | if (typeof navigator !== 'undefined') { 249 | setTimeout(function() { 250 | if (!/Firefox/.test(navigator.userAgent)) return; 251 | var elem = that.refs[that.props.id].getDOMNode(); 252 | elem.selectionStart = that.state.selectionStart; 253 | elem.selectionEnd = that.state.selectionEnd; 254 | }, 1); 255 | } 256 | 257 | return ( 258 |
265 | 274 | {infoBar} 275 |
276 | ); 277 | } 278 | }); 279 | 280 | module.exports = InputPassword; 281 | -------------------------------------------------------------------------------- /src/js/banner.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var version = require('root-require')('package.json').version 4 | 5 | var banner; 6 | banner = 'React UX Password Field\n'; 7 | banner += 'version: ' + version + '\n\n'; 8 | banner += 'MIT Licensed\n' 9 | banner += 'github: https://github.com/seethroughtrees/react-ux-password-field/\n' 10 | banner += 'demo: https://seethroughtrees.github.io/react-ux-password-field/\n' 11 | 12 | module.exports = banner; 13 | -------------------------------------------------------------------------------- /src/js/config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | statusColor: '#5CE592', 5 | statusInactiveColor: '#FC6F6F', 6 | unMaskColor: '#c7c7c7', 7 | unMaskTime: 1400, 8 | zxcvbnSrc: 'https://cdnjs.cloudflare.com/ajax/libs/zxcvbn/1.0/zxcvbn.min.js', 9 | strengthLang: ['Weak', 'Okay', 'Good', 'Strong', 'Great'] 10 | } 11 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | var banner = require('./src/js/banner'); 4 | 5 | module.exports = { 6 | // the entry point of your library 7 | entry: './src/index.js', 8 | // where 3rd-party modules can reside 9 | resolve: { 10 | modulesDirectories: ['node_modules', 'bower_components'] 11 | }, 12 | output: { 13 | // where to put standalone build file 14 | path: path.join(__dirname, 'lib'), 15 | // the name of the standalone build file 16 | filename: 'react-ux-password-field.js', 17 | // the standalone build should be wrapped in UMD for interop 18 | libraryTarget: 'umd', 19 | // the name of your library in global scope 20 | library: 'react-ux-password-field' 21 | }, 22 | externals: [ 23 | { 24 | 'react': { 25 | root: 'React', 26 | commonjs2: 'react', 27 | commonjs: 'react', 28 | amd: 'react' 29 | } 30 | } 31 | ], 32 | module: { 33 | loaders: [ 34 | { test: /\.js$/, loader: 'babel-loader'}, 35 | { test: /\.png/, loader: "url?limit=100000&mimetype=image/png" } 36 | ] 37 | }, 38 | plugins: [ 39 | new webpack.BannerPlugin(banner) 40 | ] 41 | }; 42 | 43 | -------------------------------------------------------------------------------- /webpack.demo.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var autoprefixer = require('autoprefixer-core'); 3 | var csswring = require('csswring'); 4 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 | 6 | module.exports = { 7 | // the entry point of your library 8 | entry: './demo/src/index.js', 9 | // where 3rd-party modules can reside 10 | resolve: { 11 | modulesDirectories: ['node_modules', 'bower_components'] 12 | }, 13 | output: { 14 | // where to put standalone build file 15 | path: path.join(__dirname, 'demo'), 16 | // the name of the standalone build file 17 | filename: 'demo.bundle.js' 18 | }, 19 | externals: { 20 | 'react': 'React' 21 | }, 22 | module: { 23 | loaders: [ 24 | { test: /\.css/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!postcss-loader") }, 25 | { test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader?outputStyle=expanded') }, 26 | { test: /\.js$/, loader: 'babel-loader'}, 27 | { test: /\.png/, loader: "url?limit=100000&mimetype=image/png" } 28 | ] 29 | }, 30 | postcss: [autoprefixer({ browsers: ['> 1%'] }), csswring], 31 | plugins: [ 32 | new ExtractTextPlugin("style.css", { 33 | allChunks: true 34 | }) 35 | ] 36 | }; 37 | -------------------------------------------------------------------------------- /webpack.min.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | var banner = require('./src/js/banner'); 4 | 5 | module.exports = { 6 | entry: './src/index.js', 7 | resolve: { 8 | modulesDirectories: ['node_modules', 'bower_components'] 9 | }, 10 | output: { 11 | path: path.join(__dirname, 'lib'), 12 | filename: 'react-ux-password-field.min.js', 13 | libraryTarget: 'umd', 14 | library: 'react-ux-password-field' 15 | }, 16 | externals: [ 17 | { 18 | 'react': { 19 | root: 'React', 20 | commonjs2: 'react', 21 | commonjs: 'react', 22 | amd: 'react' 23 | } 24 | } 25 | ], 26 | module: { 27 | loaders: [ 28 | { test: /\.js$/, loader: 'babel-loader'}, 29 | { test: /\.png/, loader: "url?limit=100000&mimetype=image/png" } 30 | ] 31 | }, 32 | plugins: [ 33 | new webpack.BannerPlugin(banner) 34 | ] 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /webpack.server.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var autoprefixer = require('autoprefixer-core'); 3 | var csswring = require('csswring'); 4 | 5 | module.exports = { 6 | // the entry point of your library 7 | entry: ['webpack/hot/dev-server', './demo/src/index.js'], 8 | // where 3rd-party modules can reside 9 | resolve: { 10 | modulesDirectories: ['node_modules', 'bower_components'] 11 | }, 12 | output: { 13 | // where to put standalone build file 14 | path: path.join(__dirname, 'demo'), 15 | // the name of the standalone build file 16 | filename: 'demo.bundle.js' 17 | }, 18 | externals: { 19 | 'react': 'React' 20 | }, 21 | module: { 22 | loaders: [ 23 | { test: /\.css/, loader: "style-loader!css-loader!postcss-loader" }, 24 | { test: /\.scss$/, loader: 'style-loader!css-loader!postcss-loader!sass?outputStyle=expanded' }, 25 | { test: /\.js$/, loader: 'babel-loader'}, 26 | { test: /\.png/, loader: 'url?limit=100000&mimetype=image/png' } 27 | ] 28 | }, 29 | postcss: [autoprefixer({ browsers: ['> 1%'] }), csswring] 30 | }; 31 | 32 | --------------------------------------------------------------------------------