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.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +26 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
package/lib/ui/box.js
CHANGED
|
@@ -1,117 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
13
|
-
|
|
14
|
-
var _CSSCore = require('../CSSCore');
|
|
15
|
-
|
|
16
|
-
var _CSSCore2 = _interopRequireDefault(_CSSCore);
|
|
17
|
-
|
|
18
|
-
var _container = require('./box/container');
|
|
19
|
-
|
|
20
|
-
var _container2 = _interopRequireDefault(_container);
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.render = exports.remove = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _client = require("react-dom/client");
|
|
9
|
+
var _CSSCore = _interopRequireDefault(require("../CSSCore"));
|
|
10
|
+
var _container = _interopRequireDefault(require("./box/container"));
|
|
22
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
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 _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); }
|
|
24
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
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); } }
|
|
16
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
var ContainerManager = /*#__PURE__*/function () {
|
|
27
20
|
function ContainerManager() {
|
|
28
21
|
_classCallCheck(this, ContainerManager);
|
|
29
22
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
_createClass(ContainerManager, [{
|
|
24
|
+
key: "ensure",
|
|
25
|
+
value: function ensure(id, shouldAppend) {
|
|
26
|
+
var container = window.document.getElementById(id);
|
|
27
|
+
if (!container && shouldAppend) {
|
|
28
|
+
container = window.document.createElement('main');
|
|
29
|
+
container.id = id;
|
|
30
|
+
container.className = 'auth0-lock-container';
|
|
31
|
+
window.document.body.appendChild(container);
|
|
32
|
+
}
|
|
33
|
+
if (!container) {
|
|
34
|
+
throw new Error("Can't find element with id ".concat(id));
|
|
35
|
+
}
|
|
36
|
+
return container;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
return container;
|
|
46
|
-
};
|
|
47
|
-
|
|
38
|
+
}]);
|
|
48
39
|
return ContainerManager;
|
|
49
40
|
}();
|
|
50
|
-
|
|
51
|
-
var Renderer = function () {
|
|
41
|
+
var Renderer = /*#__PURE__*/function () {
|
|
52
42
|
function Renderer() {
|
|
53
43
|
_classCallCheck(this, Renderer);
|
|
54
|
-
|
|
55
44
|
this.containerManager = new ContainerManager();
|
|
56
45
|
this.modals = {};
|
|
57
46
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.modals[containerId].hide();
|
|
82
|
-
setTimeout(function () {
|
|
83
|
-
return _this.unmount(containerId);
|
|
84
|
-
}, 1000);
|
|
85
|
-
} else {
|
|
86
|
-
this.unmount(containerId);
|
|
47
|
+
_createClass(Renderer, [{
|
|
48
|
+
key: "render",
|
|
49
|
+
value: function render(containerId, props) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var isModal = props.isModal;
|
|
52
|
+
var container = this.containerManager.ensure(containerId, isModal);
|
|
53
|
+
if (isModal && !this.modals[containerId]) {
|
|
54
|
+
_CSSCore.default.addClass(window.document.getElementsByTagName('html')[0], 'auth0-lock-html');
|
|
55
|
+
}
|
|
56
|
+
// eslint-disable-next-line
|
|
57
|
+
var root = this.modals[containerId] ? this.modals[containerId].root : (0, _client.createRoot)(container);
|
|
58
|
+
if (!this.modals[containerId]) {
|
|
59
|
+
this.modals[containerId] = {
|
|
60
|
+
root: root
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
root.render( /*#__PURE__*/_react.default.createElement(_container.default, _extends({}, props, {
|
|
64
|
+
ref: function ref(component) {
|
|
65
|
+
if (component && isModal) {
|
|
66
|
+
_this.modals[containerId].component = component;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
})));
|
|
87
70
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
}, {
|
|
72
|
+
key: "remove",
|
|
73
|
+
value: function remove(containerId) {
|
|
74
|
+
var _this2 = this;
|
|
75
|
+
if (this.modals[containerId]) {
|
|
76
|
+
this.modals[containerId].component.hide();
|
|
77
|
+
setTimeout(function () {
|
|
78
|
+
return _this2.unmount(containerId);
|
|
79
|
+
}, 1000);
|
|
80
|
+
} else {
|
|
81
|
+
this.unmount(containerId);
|
|
95
82
|
}
|
|
96
|
-
} catch (e) {
|
|
97
|
-
// do nothing if container doesn't exist
|
|
98
83
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
}, {
|
|
85
|
+
key: "unmount",
|
|
86
|
+
value: function unmount(containerId) {
|
|
87
|
+
try {
|
|
88
|
+
var container = this.containerManager.ensure(containerId);
|
|
89
|
+
if (container) {
|
|
90
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
91
|
+
}
|
|
92
|
+
} catch (e) {
|
|
93
|
+
// do nothing if container doesn't exist
|
|
94
|
+
}
|
|
95
|
+
if (this.modals[containerId]) {
|
|
96
|
+
this.modals[containerId].root.unmount();
|
|
97
|
+
delete this.modals[containerId];
|
|
98
|
+
_CSSCore.default.removeClass(window.document.getElementsByTagName('html')[0], 'auth0-lock-html');
|
|
99
|
+
}
|
|
104
100
|
}
|
|
105
|
-
};
|
|
106
|
-
|
|
101
|
+
}]);
|
|
107
102
|
return Renderer;
|
|
108
103
|
}();
|
|
109
|
-
|
|
110
104
|
var renderer = new Renderer();
|
|
111
|
-
|
|
112
|
-
var render = exports.render = function render() {
|
|
105
|
+
var render = function render() {
|
|
113
106
|
return renderer.render.apply(renderer, arguments);
|
|
114
107
|
};
|
|
115
|
-
|
|
108
|
+
exports.render = render;
|
|
109
|
+
var remove = function remove() {
|
|
116
110
|
return renderer.remove.apply(renderer, arguments);
|
|
117
111
|
};
|
|
112
|
+
exports.remove = remove;
|
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var _react = require('react');
|
|
10
|
-
|
|
11
|
-
var _react2 = _interopRequireDefault(_react);
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
10
|
var AuthButton = function AuthButton(props) {
|
|
16
11
|
var label = props.label,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var foregroundStyle = foregroundColor ? {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
12
|
+
onClick = props.onClick,
|
|
13
|
+
strategy = props.strategy,
|
|
14
|
+
icon = props.icon,
|
|
15
|
+
primaryColor = props.primaryColor,
|
|
16
|
+
foregroundColor = props.foregroundColor;
|
|
17
|
+
var backgroundStyle = primaryColor ? {
|
|
18
|
+
backgroundColor: primaryColor
|
|
19
|
+
} : {};
|
|
20
|
+
var foregroundStyle = foregroundColor ? {
|
|
21
|
+
color: foregroundColor
|
|
22
|
+
} : {};
|
|
23
|
+
var iconStyle = icon ? {
|
|
24
|
+
backgroundImage: "url('".concat(icon, "')")
|
|
25
|
+
} : {};
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
27
|
+
className: "auth0-lock-social-button auth0-lock-social-big-button",
|
|
28
|
+
"data-provider": strategy,
|
|
29
|
+
onClick: onClick,
|
|
30
|
+
style: backgroundStyle,
|
|
31
|
+
type: "button"
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: "auth0-lock-social-button-icon",
|
|
34
|
+
style: iconStyle
|
|
35
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
className: "auth0-lock-social-button-text",
|
|
37
|
+
style: foregroundStyle
|
|
38
|
+
}, label));
|
|
44
39
|
};
|
|
45
|
-
|
|
46
40
|
AuthButton.propTypes = {
|
|
47
|
-
disabled:
|
|
48
|
-
label:
|
|
49
|
-
onClick:
|
|
50
|
-
strategy:
|
|
51
|
-
icon:
|
|
52
|
-
primaryColor:
|
|
53
|
-
foregroundColor:
|
|
41
|
+
disabled: _propTypes.default.bool.isRequired,
|
|
42
|
+
label: _propTypes.default.string.isRequired,
|
|
43
|
+
onClick: _propTypes.default.func.isRequired,
|
|
44
|
+
strategy: _propTypes.default.string.isRequired,
|
|
45
|
+
icon: _propTypes.default.string,
|
|
46
|
+
primaryColor: _propTypes.default.string,
|
|
47
|
+
foregroundColor: _propTypes.default.string
|
|
54
48
|
};
|
|
55
|
-
|
|
56
49
|
AuthButton.defaultProps = {
|
|
57
50
|
disabled: false
|
|
58
51
|
};
|
|
59
|
-
|
|
60
|
-
exports.default =
|
|
52
|
+
var _default = AuthButton;
|
|
53
|
+
exports.default = _default;
|