auth0-lock 11.34.2 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +4 -2
  3. package/.eslintrc.json +5 -5
  4. package/.github/workflows/codeql.yml +41 -0
  5. package/.shiprc +4 -5
  6. package/CHANGELOG.md +26 -0
  7. package/EXAMPLES.md +626 -0
  8. package/README.md +77 -649
  9. package/karma.conf.js +1 -1
  10. package/lib/CSSCore.js +1 -4
  11. package/lib/__tests__/auth_button.js +12 -22
  12. package/lib/__tests__/connection/database/actions.js +48 -49
  13. package/lib/__tests__/connection/database/index.js +22 -28
  14. package/lib/__tests__/connection/database/login_pane.js +20 -41
  15. package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
  16. package/lib/__tests__/connection/database/reset_password.js +17 -39
  17. package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
  18. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  19. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  20. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  21. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
  22. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  23. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
  24. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  25. package/lib/__tests__/core/actions.js +23 -46
  26. package/lib/__tests__/core/client/index.js +10 -13
  27. package/lib/__tests__/core/index.js +46 -94
  28. package/lib/__tests__/core/remote_data.js +14 -20
  29. package/lib/__tests__/core/signed_in_confirmation.js +19 -26
  30. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  31. package/lib/__tests__/core/tenant.js +10 -12
  32. package/lib/__tests__/core/web_api/helper.js +6 -14
  33. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  34. package/lib/__tests__/core/web_api.js +37 -33
  35. package/lib/__tests__/engine/classic/login.js +20 -41
  36. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  37. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  38. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  39. package/lib/__tests__/engine/classic.js +13 -6
  40. package/lib/__tests__/engine/passwordless.js +2 -5
  41. package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
  42. package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
  43. package/lib/__tests__/field/captcha.js +39 -51
  44. package/lib/__tests__/field/custom_input.js +23 -47
  45. package/lib/__tests__/field/email.js +2 -3
  46. package/lib/__tests__/field/email_pane.js +25 -48
  47. package/lib/__tests__/field/field.js +9 -13
  48. package/lib/__tests__/field/login_pane.js +30 -34
  49. package/lib/__tests__/field/mfa_code_pane.js +13 -28
  50. package/lib/__tests__/field/option_selection_pane.js +7 -25
  51. package/lib/__tests__/field/password.js +6 -12
  52. package/lib/__tests__/field/password_pane.js +29 -46
  53. package/lib/__tests__/field/phone_number_pane.js +18 -41
  54. package/lib/__tests__/field/social_buttons_pane.js +30 -47
  55. package/lib/__tests__/field/username.js +27 -48
  56. package/lib/__tests__/field/username_pane.js +30 -47
  57. package/lib/__tests__/field/vcode.js +5 -13
  58. package/lib/__tests__/field/vcode_pane.js +20 -44
  59. package/lib/__tests__/i18n.js +28 -53
  60. package/lib/__tests__/quick-auth/actions.js +4 -27
  61. package/lib/__tests__/setup-tests.js +7 -9
  62. package/lib/__tests__/testUtils.js +41 -58
  63. package/lib/__tests__/ui/box/chrome.js +24 -49
  64. package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
  65. package/lib/__tests__/ui/box/container.js +21 -46
  66. package/lib/__tests__/ui/box/global_message.js +60 -37
  67. package/lib/__tests__/ui/input/email_input.js +6 -17
  68. package/lib/__tests__/ui/input/input_wrap.js +6 -19
  69. package/lib/__tests__/ui/input/password/password_strength.js +13 -15
  70. package/lib/__tests__/ui/input/password_input.js +22 -27
  71. package/lib/__tests__/utils/format.js +10 -17
  72. package/lib/__tests__/utils/url_utils.js +2 -5
  73. package/lib/avatar/gravatar_provider.js +13 -28
  74. package/lib/avatar.js +22 -41
  75. package/lib/browser.js +372 -23
  76. package/lib/connection/captcha.js +14 -32
  77. package/lib/connection/database/actions.js +39 -108
  78. package/lib/connection/database/index.js +90 -191
  79. package/lib/connection/database/login_pane.js +107 -147
  80. package/lib/connection/database/login_sign_up_tabs.js +106 -125
  81. package/lib/connection/database/mfa_pane.js +50 -69
  82. package/lib/connection/database/password_reset_confirmation.js +51 -73
  83. package/lib/connection/database/reset_password.js +116 -132
  84. package/lib/connection/database/reset_password_pane.js +45 -56
  85. package/lib/connection/database/sign_up_terms.js +17 -23
  86. package/lib/connection/database/signed_up_confirmation.js +52 -75
  87. package/lib/connection/enterprise/actions.js +23 -52
  88. package/lib/connection/enterprise/hrd_pane.js +60 -76
  89. package/lib/connection/enterprise/hrd_screen.js +60 -75
  90. package/lib/connection/enterprise/kerberos_screen.js +46 -60
  91. package/lib/connection/enterprise/quick_auth_screen.js +46 -64
  92. package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
  93. package/lib/connection/enterprise.js +51 -84
  94. package/lib/connection/passwordless/actions.js +29 -62
  95. package/lib/connection/passwordless/ask_vcode.js +53 -60
  96. package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
  97. package/lib/connection/passwordless/index.js +36 -68
  98. package/lib/connection/social/index.js +12 -15
  99. package/lib/core/actions.js +33 -85
  100. package/lib/core/client/index.js +38 -58
  101. package/lib/core/client/settings.js +12 -20
  102. package/lib/core/error_screen.js +38 -52
  103. package/lib/core/index.js +152 -301
  104. package/lib/core/loading_screen.js +61 -71
  105. package/lib/core/pane_separator.js +10 -10
  106. package/lib/core/remote_data.js +28 -48
  107. package/lib/core/screen.js +85 -79
  108. package/lib/core/signed_in_confirmation.js +51 -73
  109. package/lib/core/sso/data.js +9 -17
  110. package/lib/core/sso/index.js +5 -6
  111. package/lib/core/sso/last_login_screen.js +46 -63
  112. package/lib/core/tenant/index.js +37 -59
  113. package/lib/core/tenant/settings.js +11 -15
  114. package/lib/core/web_api/helper.js +24 -30
  115. package/lib/core/web_api/p2_api.js +156 -165
  116. package/lib/core/web_api.js +101 -90
  117. package/lib/core.js +126 -160
  118. package/lib/engine/classic/login.js +92 -144
  119. package/lib/engine/classic/mfa_login_screen.js +61 -67
  120. package/lib/engine/classic/sign_up_pane.js +89 -123
  121. package/lib/engine/classic/sign_up_screen.js +112 -158
  122. package/lib/engine/classic.js +122 -183
  123. package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +82 -102
  128. package/lib/field/captcha/recaptcha.js +140 -145
  129. package/lib/field/captcha.js +7 -10
  130. package/lib/field/custom_input.js +37 -50
  131. package/lib/field/email/email_pane.js +90 -109
  132. package/lib/field/email.js +17 -35
  133. package/lib/field/index.js +51 -88
  134. package/lib/field/mfa-code/mfa_code_pane.js +57 -71
  135. package/lib/field/mfa_code.js +15 -21
  136. package/lib/field/option_selection_pane.js +16 -22
  137. package/lib/field/password/password_pane.js +79 -91
  138. package/lib/field/password.js +8 -14
  139. package/lib/field/phone-number/locations.js +7 -3
  140. package/lib/field/phone-number/phone_number_pane.js +87 -124
  141. package/lib/field/phone_number.js +16 -30
  142. package/lib/field/social/event.js +9 -12
  143. package/lib/field/social/social_buttons_pane.js +93 -121
  144. package/lib/field/username/username_pane.js +105 -123
  145. package/lib/field/username.js +16 -26
  146. package/lib/field/vcode/vcode_pane.js +67 -93
  147. package/lib/field/vcode.js +5 -5
  148. package/lib/i18n/af.js +7 -4
  149. package/lib/i18n/ar.js +7 -4
  150. package/lib/i18n/az.js +7 -4
  151. package/lib/i18n/bg.js +7 -4
  152. package/lib/i18n/ca.js +7 -4
  153. package/lib/i18n/cs.js +7 -4
  154. package/lib/i18n/da.js +7 -4
  155. package/lib/i18n/de.js +7 -3
  156. package/lib/i18n/el.js +7 -4
  157. package/lib/i18n/en.js +9 -4
  158. package/lib/i18n/es.js +7 -3
  159. package/lib/i18n/et.js +7 -4
  160. package/lib/i18n/fa.js +7 -4
  161. package/lib/i18n/fi.js +7 -4
  162. package/lib/i18n/fr.js +7 -4
  163. package/lib/i18n/he.js +7 -4
  164. package/lib/i18n/hr.js +7 -4
  165. package/lib/i18n/hu.js +7 -4
  166. package/lib/i18n/id.js +7 -4
  167. package/lib/i18n/it.js +7 -3
  168. package/lib/i18n/ja.js +7 -4
  169. package/lib/i18n/ko.js +7 -4
  170. package/lib/i18n/lt.js +7 -4
  171. package/lib/i18n/lv.js +7 -4
  172. package/lib/i18n/ms.js +7 -4
  173. package/lib/i18n/nb.js +7 -4
  174. package/lib/i18n/nl.js +7 -4
  175. package/lib/i18n/nn.js +7 -4
  176. package/lib/i18n/no.js +7 -4
  177. package/lib/i18n/pl.js +7 -4
  178. package/lib/i18n/pt-br.js +7 -3
  179. package/lib/i18n/pt.js +7 -4
  180. package/lib/i18n/ro.js +7 -4
  181. package/lib/i18n/ru.js +7 -4
  182. package/lib/i18n/sk.js +7 -4
  183. package/lib/i18n/sl.js +7 -4
  184. package/lib/i18n/sr.js +7 -4
  185. package/lib/i18n/sv.js +7 -4
  186. package/lib/i18n/tr.js +7 -4
  187. package/lib/i18n/ua.js +7 -4
  188. package/lib/i18n/uk.js +7 -4
  189. package/lib/i18n/vi.js +7 -4
  190. package/lib/i18n/zh-tw.js +7 -4
  191. package/lib/i18n/zh.js +7 -4
  192. package/lib/i18n.js +38 -75
  193. package/lib/index.js +14 -17
  194. package/lib/lock.js +29 -32
  195. package/lib/passwordless.js +29 -31
  196. package/lib/quick-auth/actions.js +19 -26
  197. package/lib/quick_auth.js +8 -10
  198. package/lib/sanitizer.js +5 -5
  199. package/lib/store/index.js +22 -42
  200. package/lib/sync.js +21 -42
  201. package/lib/ui/box/button.js +85 -105
  202. package/lib/ui/box/chrome.js +463 -548
  203. package/lib/ui/box/confirmation_pane.js +34 -48
  204. package/lib/ui/box/container.js +305 -339
  205. package/lib/ui/box/global_message.js +51 -60
  206. package/lib/ui/box/header.js +155 -177
  207. package/lib/ui/box/multisize_slide.js +233 -229
  208. package/lib/ui/box/success_pane.js +34 -37
  209. package/lib/ui/box.js +88 -93
  210. package/lib/ui/button/auth_button.js +44 -51
  211. package/lib/ui/input/captcha_input.js +162 -181
  212. package/lib/ui/input/checkbox_input.js +57 -59
  213. package/lib/ui/input/email_input.js +117 -124
  214. package/lib/ui/input/input_wrap.js +65 -80
  215. package/lib/ui/input/location_input.js +130 -150
  216. package/lib/ui/input/mfa_code_input.js +98 -98
  217. package/lib/ui/input/password/password_strength.js +103 -127
  218. package/lib/ui/input/password_input.js +141 -147
  219. package/lib/ui/input/phone_number_input.js +101 -109
  220. package/lib/ui/input/select_input.js +120 -132
  221. package/lib/ui/input/text_input.js +89 -84
  222. package/lib/ui/input/username_input.js +109 -115
  223. package/lib/ui/input/vcode_input.js +110 -118
  224. package/lib/ui/list.js +224 -247
  225. package/lib/ui/pane/quick_auth_pane.js +55 -80
  226. package/lib/utils/atom.js +55 -48
  227. package/lib/utils/cache.js +54 -43
  228. package/lib/utils/cdn_utils.js +17 -31
  229. package/lib/utils/createRef.js +3 -1
  230. package/lib/utils/data_utils.js +10 -16
  231. package/lib/utils/fn_utils.js +5 -4
  232. package/lib/utils/format.js +6 -8
  233. package/lib/utils/id_utils.js +4 -3
  234. package/lib/utils/jsonp_utils.js +20 -17
  235. package/lib/utils/media_utils.js +4 -2
  236. package/lib/utils/preload_utils.js +4 -3
  237. package/lib/utils/string_utils.js +4 -4
  238. package/lib/utils/url_utils.js +4 -3
  239. package/opslevel.yml +6 -0
  240. package/package.json +53 -38
  241. package/webpack.config.js +36 -3
@@ -1,143 +1,136 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- 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; };
6
-
7
- var _react = require('react');
8
-
9
- var _react2 = _interopRequireDefault(_react);
10
-
11
- var _input_wrap = require('./input_wrap');
12
-
13
- var _input_wrap2 = _interopRequireDefault(_input_wrap);
14
-
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _input_wrap = _interopRequireDefault(require("./input_wrap"));
10
+ var _excluded = ["lockId", "invalidHint", "isValid", "autoComplete"];
15
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
- 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; }
18
-
12
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
19
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
-
21
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
22
-
23
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
24
-
25
- var SVG = _react2.default.createElement(
26
- 'svg',
27
- {
28
- 'aria-hidden': 'true',
29
- focusable: 'false',
30
- width: '14px',
31
- height: '13px',
32
- viewBox: '0 0 32 26',
33
- version: '1.1',
34
- xmlns: 'http://www.w3.org/2000/svg',
35
- xmlnsXlink: 'http://www.w3.org/1999/xlink',
36
- className: 'auth0-lock-icon auth0-lock-icon-box'
37
- },
38
- _react2.default.createElement(
39
- 'g',
40
- { id: 'Page-1', stroke: 'none', strokeWidth: '1', fill: 'none', fillRule: 'evenodd' },
41
- _react2.default.createElement(
42
- 'g',
43
- { id: '32px', transform: 'translate(-2155.000000, -2317.000000)', fill: '#373A39' },
44
- _react2.default.createElement(
45
- 'g',
46
- { id: 'Group-856', transform: 'translate(1.000000, 1.000000)' },
47
- _react2.default.createElement('path', {
48
- id: 'Fill-419',
49
- d: 'M2184,2339 C2184,2339.55 2183.55,2340 2183,2340 L2157,2340 C2156.45,2340 2156,2339.55 2156,2339 L2156,2319 C2156,2318.45 2156.45,2318 2157,2318 L2183,2318 C2183.55,2318 2184,2318.45 2184,2319 L2184,2339 L2184,2339 Z M2184,2316 L2156,2316 C2154.89,2316 2154,2316.89 2154,2318 L2154,2340 C2154,2341.1 2154.89,2342 2156,2342 L2184,2342 C2185.1,2342 2186,2341.1 2186,2340 L2186,2318 C2186,2316.89 2185.1,2316 2184,2316 L2184,2316 Z M2176,2322 L2180,2322 L2180,2326 L2176,2326 L2176,2322 Z M2174,2328 L2182,2328 L2182,2320 L2174,2320 L2174,2328 Z M2158,2332 L2172,2332 L2172,2330 L2158,2330 L2158,2332 Z M2158,2336 L2172,2336 L2172,2334 L2158,2334 L2158,2336 Z'
50
- })
51
- )
52
- )
53
- )
54
- );
55
-
56
- var EmailInput = function (_React$Component) {
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
+ var SVG = /*#__PURE__*/_react.default.createElement("svg", {
28
+ "aria-hidden": "true",
29
+ focusable: "false",
30
+ width: "14px",
31
+ height: "13px",
32
+ viewBox: "0 0 32 26",
33
+ version: "1.1",
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
36
+ className: "auth0-lock-icon auth0-lock-icon-box"
37
+ }, /*#__PURE__*/_react.default.createElement("g", {
38
+ id: "Page-1",
39
+ stroke: "none",
40
+ strokeWidth: "1",
41
+ fill: "none",
42
+ fillRule: "evenodd"
43
+ }, /*#__PURE__*/_react.default.createElement("g", {
44
+ id: "32px",
45
+ transform: "translate(-2155.000000, -2317.000000)",
46
+ fill: "#373A39"
47
+ }, /*#__PURE__*/_react.default.createElement("g", {
48
+ id: "Group-856",
49
+ transform: "translate(1.000000, 1.000000)"
50
+ }, /*#__PURE__*/_react.default.createElement("path", {
51
+ id: "Fill-419",
52
+ d: "M2184,2339 C2184,2339.55 2183.55,2340 2183,2340 L2157,2340 C2156.45,2340 2156,2339.55 2156,2339 L2156,2319 C2156,2318.45 2156.45,2318 2157,2318 L2183,2318 C2183.55,2318 2184,2318.45 2184,2319 L2184,2339 L2184,2339 Z M2184,2316 L2156,2316 C2154.89,2316 2154,2316.89 2154,2318 L2154,2340 C2154,2341.1 2154.89,2342 2156,2342 L2184,2342 C2185.1,2342 2186,2341.1 2186,2340 L2186,2318 C2186,2316.89 2185.1,2316 2184,2316 L2184,2316 Z M2176,2322 L2180,2322 L2180,2326 L2176,2326 L2176,2322 Z M2174,2328 L2182,2328 L2182,2320 L2174,2320 L2174,2328 Z M2158,2332 L2172,2332 L2172,2330 L2158,2330 L2158,2332 Z M2158,2336 L2172,2336 L2172,2334 L2158,2334 L2158,2336 Z"
53
+ })))));
54
+ var EmailInput = /*#__PURE__*/function (_React$Component) {
57
55
  _inherits(EmailInput, _React$Component);
58
-
56
+ var _super = _createSuper(EmailInput);
59
57
  function EmailInput(props) {
58
+ var _this;
60
59
  _classCallCheck(this, EmailInput);
61
-
62
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
63
-
60
+ _this = _super.call(this, props);
64
61
  _this.state = {};
65
62
  return _this;
66
63
  }
67
-
68
- EmailInput.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
69
- var _props = this.props,
70
- invalidHint = _props.invalidHint,
71
- isValid = _props.isValid,
72
- value = _props.value,
73
- disabled = _props.disabled,
74
- onChange = _props.onChange;
75
- var focused = this.state.focused;
76
-
77
-
78
- return invalidHint != nextProps.invalidHint || isValid != nextProps.isValid || value != nextProps.value || focused != nextState.focused || disabled != nextProps.disabled;
79
- };
80
-
81
- EmailInput.prototype.render = function render() {
82
- var _props2 = this.props,
83
- lockId = _props2.lockId,
84
- invalidHint = _props2.invalidHint,
85
- isValid = _props2.isValid,
86
- autoComplete = _props2.autoComplete,
87
- props = _objectWithoutProperties(_props2, ['lockId', 'invalidHint', 'isValid', 'autoComplete']);
88
-
89
- var focused = this.state.focused;
90
-
91
-
92
- return _react2.default.createElement(
93
- _input_wrap2.default,
94
- {
64
+ _createClass(EmailInput, [{
65
+ key: "shouldComponentUpdate",
66
+ value: function shouldComponentUpdate(nextProps, nextState) {
67
+ var _this$props = this.props,
68
+ invalidHint = _this$props.invalidHint,
69
+ isValid = _this$props.isValid,
70
+ value = _this$props.value,
71
+ disabled = _this$props.disabled,
72
+ onChange = _this$props.onChange;
73
+ var focused = this.state.focused;
74
+ return invalidHint != nextProps.invalidHint || isValid != nextProps.isValid || value != nextProps.value || focused != nextState.focused || disabled != nextProps.disabled;
75
+ }
76
+ }, {
77
+ key: "render",
78
+ value: function render() {
79
+ var _this$props2 = this.props,
80
+ lockId = _this$props2.lockId,
81
+ invalidHint = _this$props2.invalidHint,
82
+ isValid = _this$props2.isValid,
83
+ autoComplete = _this$props2.autoComplete,
84
+ props = _objectWithoutProperties(_this$props2, _excluded);
85
+ var focused = this.state.focused;
86
+ return /*#__PURE__*/_react.default.createElement(_input_wrap.default, {
95
87
  focused: focused,
96
88
  invalidHint: invalidHint,
97
89
  isValid: isValid,
98
- name: 'email',
90
+ name: "email",
99
91
  icon: SVG
100
- },
101
- _react2.default.createElement('input', _extends({
102
- id: lockId + '-email',
103
- ref: 'input',
104
- type: 'email',
105
- inputMode: 'email',
106
- name: 'email',
107
- className: 'auth0-lock-input',
108
- placeholder: 'yours@example.com',
92
+ }, /*#__PURE__*/_react.default.createElement("input", _extends({
93
+ id: "".concat(lockId, "-email"),
94
+ ref: "input",
95
+ type: "email",
96
+ inputMode: "email",
97
+ name: "email",
98
+ className: "auth0-lock-input",
99
+ placeholder: "yours@example.com",
109
100
  autoComplete: autoComplete ? 'on' : 'off',
110
- autoCapitalize: 'off',
111
- autoCorrect: 'off',
112
- spellCheck: 'false',
101
+ autoCapitalize: "off",
102
+ autoCorrect: "off",
103
+ spellCheck: "false",
113
104
  onChange: this.handleOnChange.bind(this),
114
105
  onFocus: this.handleFocus.bind(this),
115
106
  onBlur: this.handleBlur.bind(this),
116
- 'aria-label': 'Email',
117
- 'aria-invalid': !isValid,
118
- 'aria-describedby': !isValid && invalidHint ? 'auth0-lock-error-msg-email' : undefined
119
- }, props))
120
- );
121
- };
122
-
123
- EmailInput.prototype.handleOnChange = function handleOnChange(e) {
124
- if (this.props.onChange) {
125
- this.props.onChange(e);
107
+ "aria-label": "Email",
108
+ "aria-invalid": !isValid,
109
+ "aria-describedby": !isValid && invalidHint ? "auth0-lock-error-msg-email" : undefined
110
+ }, props)));
126
111
  }
127
- };
128
-
129
- EmailInput.prototype.handleFocus = function handleFocus() {
130
- this.setState({ focused: true });
131
- };
132
-
133
- EmailInput.prototype.handleBlur = function handleBlur() {
134
- this.setState({ focused: false });
135
- };
136
-
112
+ }, {
113
+ key: "handleOnChange",
114
+ value: function handleOnChange(e) {
115
+ if (this.props.onChange) {
116
+ this.props.onChange(e);
117
+ }
118
+ }
119
+ }, {
120
+ key: "handleFocus",
121
+ value: function handleFocus() {
122
+ this.setState({
123
+ focused: true
124
+ });
125
+ }
126
+ }, {
127
+ key: "handleBlur",
128
+ value: function handleBlur() {
129
+ this.setState({
130
+ focused: false
131
+ });
132
+ }
133
+ }]);
137
134
  return EmailInput;
138
- }(_react2.default.Component);
139
-
140
- // TODO: specify propTypes
141
-
142
-
135
+ }(_react.default.Component); // TODO: specify propTypes
143
136
  exports.default = EmailInput;
@@ -1,91 +1,76 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _propTypes = require('prop-types');
6
-
7
- var _propTypes2 = _interopRequireDefault(_propTypes);
8
-
9
- var _react = require('react');
10
-
11
- var _react2 = _interopRequireDefault(_react);
12
-
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _react = _interopRequireDefault(require("react"));
13
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
-
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
-
21
- var InputWrap = function (_React$Component) {
12
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
18
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23
+ var InputWrap = /*#__PURE__*/function (_React$Component) {
22
24
  _inherits(InputWrap, _React$Component);
23
-
25
+ var _super = _createSuper(InputWrap);
24
26
  function InputWrap() {
25
27
  _classCallCheck(this, InputWrap);
26
-
27
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
28
+ return _super.apply(this, arguments);
28
29
  }
29
-
30
- InputWrap.prototype.render = function render() {
31
- var _props = this.props,
32
- after = _props.after,
33
- focused = _props.focused,
34
- invalidHint = _props.invalidHint,
35
- isValid = _props.isValid,
36
- name = _props.name,
37
- icon = _props.icon;
38
-
39
- var blockClassName = 'auth0-lock-input-block auth0-lock-input-' + name;
40
- if (!isValid) {
41
- blockClassName += ' auth0-lock-error';
42
- }
43
-
44
- var wrapClassName = 'auth0-lock-input-wrap';
45
- if (focused && isValid) {
46
- wrapClassName += ' auth0-lock-focused';
47
- }
48
-
49
- if (icon) {
50
- wrapClassName += ' auth0-lock-input-wrap-with-icon';
30
+ _createClass(InputWrap, [{
31
+ key: "render",
32
+ value: function render() {
33
+ var _this$props = this.props,
34
+ after = _this$props.after,
35
+ focused = _this$props.focused,
36
+ invalidHint = _this$props.invalidHint,
37
+ isValid = _this$props.isValid,
38
+ name = _this$props.name,
39
+ icon = _this$props.icon;
40
+ var blockClassName = "auth0-lock-input-block auth0-lock-input-".concat(name);
41
+ if (!isValid) {
42
+ blockClassName += ' auth0-lock-error';
43
+ }
44
+ var wrapClassName = 'auth0-lock-input-wrap';
45
+ if (focused && isValid) {
46
+ wrapClassName += ' auth0-lock-focused';
47
+ }
48
+ if (icon) {
49
+ wrapClassName += ' auth0-lock-input-wrap-with-icon';
50
+ }
51
+ var errorTooltip = !isValid && invalidHint ? /*#__PURE__*/_react.default.createElement("div", {
52
+ role: "alert",
53
+ id: "auth0-lock-error-msg-".concat(name),
54
+ className: "auth0-lock-error-msg"
55
+ }, /*#__PURE__*/_react.default.createElement("div", {
56
+ className: "auth0-lock-error-invalid-hint"
57
+ }, invalidHint)) : null;
58
+ return /*#__PURE__*/_react.default.createElement("div", {
59
+ className: blockClassName
60
+ }, /*#__PURE__*/_react.default.createElement("div", {
61
+ className: wrapClassName
62
+ }, icon, this.props.children, after), errorTooltip);
51
63
  }
52
-
53
- var errorTooltip = !isValid && invalidHint ? _react2.default.createElement(
54
- 'div',
55
- { role: 'alert', id: 'auth0-lock-error-msg-' + name, className: 'auth0-lock-error-msg' },
56
- _react2.default.createElement(
57
- 'div',
58
- { className: 'auth0-lock-error-invalid-hint' },
59
- invalidHint
60
- )
61
- ) : null;
62
-
63
- return _react2.default.createElement(
64
- 'div',
65
- { className: blockClassName },
66
- _react2.default.createElement(
67
- 'div',
68
- { className: wrapClassName },
69
- icon,
70
- this.props.children,
71
- after
72
- ),
73
- errorTooltip
74
- );
75
- };
76
-
64
+ }]);
77
65
  return InputWrap;
78
- }(_react2.default.Component);
79
-
66
+ }(_react.default.Component);
80
67
  exports.default = InputWrap;
81
-
82
-
83
68
  InputWrap.propTypes = {
84
- after: _propTypes2.default.element,
85
- children: _propTypes2.default.oneOfType([_propTypes2.default.element.isRequired, _propTypes2.default.arrayOf(_propTypes2.default.element).isRequired]),
86
- focused: _propTypes2.default.bool,
87
- invalidHint: _propTypes2.default.node,
88
- isValid: _propTypes2.default.bool.isRequired,
89
- name: _propTypes2.default.string.isRequired,
90
- icon: _propTypes2.default.object
69
+ after: _propTypes.default.element,
70
+ children: _propTypes.default.oneOfType([_propTypes.default.element.isRequired, _propTypes.default.arrayOf(_propTypes.default.element).isRequired]),
71
+ focused: _propTypes.default.bool,
72
+ invalidHint: _propTypes.default.node,
73
+ isValid: _propTypes.default.bool.isRequired,
74
+ name: _propTypes.default.string.isRequired,
75
+ icon: _propTypes.default.object
91
76
  };