@widergy/react-social-auth 2.1.0 → 2.1.2
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/CHANGELOG.md +16 -0
- package/dist/components/Apple/index.js +12 -8
- package/dist/components/Apple/styles.module.scss +0 -4
- package/dist/components/Button/index.js +11 -4
- package/dist/components/Button/styles.module.scss +5 -0
- package/dist/components/ButtonContainer/index.js +1 -6
- package/dist/components/Facebook/index.js +12 -8
- package/dist/components/Facebook/styles.module.scss +0 -4
- package/dist/components/Google/components/GoogleButton/index.js +14 -9
- package/dist/components/Google/components/GoogleButton/styles.module.scss +0 -4
- package/dist/components/Google/index.js +3 -0
- package/dist/components/Microsoft/index.js +6 -1
- package/dist/components/Twitter/index.js +12 -8
- package/dist/components/Twitter/styles.module.scss +0 -4
- package/dist/scss/variables/_colors.scss +0 -1
- package/package.json +1 -1
- package/dist/components/ButtonContainer/styles.module.scss +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [2.1.2](https://github.com/widergy/react-social-auth/compare/v2.1.1...v2.1.2) (2023-06-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* corrections ([f62a556](https://github.com/widergy/react-social-auth/commit/f62a5565e16b81c844f33d37ef78c39abcd0e09c))
|
|
7
|
+
|
|
8
|
+
## [2.1.1](https://github.com/widergy/react-social-auth/compare/v2.1.0...v2.1.1) (2023-06-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* corrections ([7cdfd9f](https://github.com/widergy/react-social-auth/commit/7cdfd9f65d13f84bc7b2f79bfcb1fc8ae1071216))
|
|
14
|
+
* label variant ([f0c7dd1](https://github.com/widergy/react-social-auth/commit/f0c7dd1e299fbd7f56a165ca4323ac69132ed97f))
|
|
15
|
+
* large button with email ([cb5b30f](https://github.com/widergy/react-social-auth/commit/cb5b30fc80b834cb94293300f14ca3bdc6d6b3bb))
|
|
16
|
+
|
|
1
17
|
# [2.1.0](https://github.com/widergy/react-social-auth/compare/v2.0.3...v2.1.0) (2023-03-14)
|
|
2
18
|
|
|
3
19
|
|
|
@@ -28,6 +28,7 @@ var Apple = function Apple(_ref) {
|
|
|
28
28
|
var _ref$classNames = _ref.classNames,
|
|
29
29
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
30
30
|
config = _ref.config,
|
|
31
|
+
email = _ref.email,
|
|
31
32
|
label = _ref.label,
|
|
32
33
|
_ref$size = _ref.size,
|
|
33
34
|
size = _ref$size === void 0 ? _buttonSizes.SMALL : _ref$size,
|
|
@@ -77,9 +78,10 @@ var Apple = function Apple(_ref) {
|
|
|
77
78
|
tooltipContent: tooltipContent,
|
|
78
79
|
triggerOnMount: triggerOnMount
|
|
79
80
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
classNames: {
|
|
82
|
+
container: "".concat(_stylesModule.default.buttonContainer, " ").concat(classNames.buttonContainer)
|
|
83
|
+
},
|
|
84
|
+
email: email,
|
|
83
85
|
Icon: function Icon(_ref4) {
|
|
84
86
|
var className = _ref4.className;
|
|
85
87
|
return /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -88,11 +90,12 @@ var Apple = function Apple(_ref) {
|
|
|
88
90
|
src: _appleIcon.default
|
|
89
91
|
});
|
|
90
92
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
label: label,
|
|
94
|
+
mainLabelProps: _objectSpread({}, size === _buttonSizes.LARGE ? {
|
|
95
|
+
colorTheme: 'light'
|
|
96
|
+
} : {}),
|
|
97
|
+
onClick: handleLogin,
|
|
98
|
+
size: size
|
|
96
99
|
}));
|
|
97
100
|
};
|
|
98
101
|
Apple.propTypes = {
|
|
@@ -104,6 +107,7 @@ Apple.propTypes = {
|
|
|
104
107
|
scope: _propTypes.string,
|
|
105
108
|
successCallback: _propTypes.func
|
|
106
109
|
}),
|
|
110
|
+
email: _propTypes.string,
|
|
107
111
|
label: _propTypes.string,
|
|
108
112
|
size: _propTypes.string,
|
|
109
113
|
tooltipContent: _propTypes.string,
|
|
@@ -10,11 +10,14 @@ var _propTypes = require("prop-types");
|
|
|
10
10
|
var _buttonSizes = require("../../constants/buttonSizes");
|
|
11
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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
14
|
var Button = function Button(_ref) {
|
|
14
15
|
var _ref$classNames = _ref.classNames,
|
|
15
16
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17
|
+
email = _ref.email,
|
|
16
18
|
_Icon = _ref.Icon,
|
|
17
19
|
label = _ref.label,
|
|
20
|
+
mainLabelProps = _ref.mainLabelProps,
|
|
18
21
|
onClick = _ref.onClick,
|
|
19
22
|
size = _ref.size;
|
|
20
23
|
return size === _buttonSizes.LARGE ? /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
|
|
@@ -22,10 +25,12 @@ var Button = function Button(_ref) {
|
|
|
22
25
|
classNames: {
|
|
23
26
|
root: "".concat(_stylesModule.default.largeContainer, " ").concat(classNames.container),
|
|
24
27
|
childrenContainer: _stylesModule.default.fullWidth,
|
|
25
|
-
text: "".concat(_stylesModule.default.largeText, "
|
|
28
|
+
text: "".concat(_stylesModule.default.largeText, " ").concat(email && _stylesModule.default.labelsContainer)
|
|
26
29
|
},
|
|
27
30
|
Icon: _Icon
|
|
28
|
-
}, label)
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, mainLabelProps, label), email && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
32
|
+
variant: "small"
|
|
33
|
+
}, email)) : /*#__PURE__*/_react.default.createElement("div", {
|
|
29
34
|
className: "".concat(label ? _stylesModule.default.buttonWithLabel : '')
|
|
30
35
|
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
|
|
31
36
|
classNames: {
|
|
@@ -38,14 +43,16 @@ var Button = function Button(_ref) {
|
|
|
38
43
|
className: className
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
|
-
}), label && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
46
|
+
}), label && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, _extends({
|
|
42
47
|
className: classNames.text
|
|
43
|
-
}, label));
|
|
48
|
+
}, mainLabelProps), label));
|
|
44
49
|
};
|
|
45
50
|
Button.propTypes = {
|
|
46
51
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
52
|
+
email: _propTypes.string,
|
|
47
53
|
Icon: _propTypes.element,
|
|
48
54
|
label: _propTypes.string,
|
|
55
|
+
mainLabelProps: _propTypes.object,
|
|
49
56
|
onClick: _propTypes.func,
|
|
50
57
|
size: _propTypes.string
|
|
51
58
|
};
|
|
@@ -8,9 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
10
|
var _energyUi = require("@widergy/energy-ui");
|
|
11
|
-
var _buttonSizes = require("../../constants/buttonSizes");
|
|
12
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -22,7 +19,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
22
19
|
var ButtonContainer = function ButtonContainer(_ref) {
|
|
23
20
|
var children = _ref.children,
|
|
24
21
|
className = _ref.className,
|
|
25
|
-
size = _ref.size,
|
|
26
22
|
tooltipContent = _ref.tooltipContent,
|
|
27
23
|
triggerOnMount = _ref.triggerOnMount;
|
|
28
24
|
var ref = (0, _react.useRef)();
|
|
@@ -49,13 +45,12 @@ var ButtonContainer = function ButtonContainer(_ref) {
|
|
|
49
45
|
}
|
|
50
46
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
51
47
|
ref: ref,
|
|
52
|
-
className: "".concat(className !== null && className !== void 0 ? className : ''
|
|
48
|
+
className: "".concat(className !== null && className !== void 0 ? className : '')
|
|
53
49
|
}, children));
|
|
54
50
|
};
|
|
55
51
|
ButtonContainer.propTypes = {
|
|
56
52
|
children: _propTypes.object,
|
|
57
53
|
className: _propTypes.string,
|
|
58
|
-
size: _propTypes.string,
|
|
59
54
|
tooltipContent: _propTypes.string,
|
|
60
55
|
triggerOnMount: _propTypes.bool
|
|
61
56
|
};
|
|
@@ -23,6 +23,7 @@ var Facebook = function Facebook(_ref) {
|
|
|
23
23
|
var _ref$classNames = _ref.classNames,
|
|
24
24
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
25
25
|
config = _ref.config,
|
|
26
|
+
email = _ref.email,
|
|
26
27
|
label = _ref.label,
|
|
27
28
|
_ref$size = _ref.size,
|
|
28
29
|
size = _ref$size === void 0 ? _buttonSizes.SMALL : _ref$size,
|
|
@@ -45,9 +46,10 @@ var Facebook = function Facebook(_ref) {
|
|
|
45
46
|
fields: fields,
|
|
46
47
|
render: function render(renderProps) {
|
|
47
48
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
classNames: {
|
|
50
|
+
container: "".concat(_stylesModule.default.buttonContainer, " ").concat(classNames.buttonContainer)
|
|
51
|
+
},
|
|
52
|
+
email: email,
|
|
51
53
|
Icon: function Icon(_ref3) {
|
|
52
54
|
var className = _ref3.className;
|
|
53
55
|
return /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -56,11 +58,12 @@ var Facebook = function Facebook(_ref) {
|
|
|
56
58
|
src: _facebookIcon.default
|
|
57
59
|
});
|
|
58
60
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
label: label,
|
|
62
|
+
mainLabelProps: _objectSpread({}, size === _buttonSizes.LARGE ? {
|
|
63
|
+
colorTheme: 'light'
|
|
64
|
+
} : {}),
|
|
65
|
+
onClick: renderProps.onClick,
|
|
66
|
+
size: size
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
69
|
}));
|
|
@@ -72,6 +75,7 @@ Facebook.propTypes = {
|
|
|
72
75
|
callback: _propTypes.func,
|
|
73
76
|
fields: _propTypes.string
|
|
74
77
|
}),
|
|
78
|
+
email: _propTypes.string,
|
|
75
79
|
label: _propTypes.string,
|
|
76
80
|
size: _propTypes.string,
|
|
77
81
|
tooltipContent: _propTypes.string,
|
|
@@ -24,15 +24,17 @@ var GoogleButton = function GoogleButton(_ref) {
|
|
|
24
24
|
failureCallback = _ref.failureCallback,
|
|
25
25
|
label = _ref.label,
|
|
26
26
|
size = _ref.size,
|
|
27
|
-
successCallback = _ref.successCallback
|
|
27
|
+
successCallback = _ref.successCallback,
|
|
28
|
+
email = _ref.email;
|
|
28
29
|
var login = (0, _google.useGoogleLogin)({
|
|
29
30
|
onError: failureCallback,
|
|
30
31
|
onSuccess: successCallback
|
|
31
32
|
});
|
|
32
33
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
classNames: {
|
|
35
|
+
container: "".concat(_stylesModule.default.buttonContainer, " ").concat(classNames.buttonContainer)
|
|
36
|
+
},
|
|
37
|
+
email: email,
|
|
36
38
|
Icon: function Icon(_ref2) {
|
|
37
39
|
var className = _ref2.className;
|
|
38
40
|
return /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -41,15 +43,18 @@ var GoogleButton = function GoogleButton(_ref) {
|
|
|
41
43
|
src: _googleIcon.default
|
|
42
44
|
});
|
|
43
45
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} : {})
|
|
46
|
+
label: label,
|
|
47
|
+
mainLabelProps: _objectSpread({}, size === _buttonSizes.LARGE ? {
|
|
48
|
+
colorTheme: 'dark',
|
|
49
|
+
shade: '01'
|
|
50
|
+
} : {}),
|
|
51
|
+
onClick: login,
|
|
52
|
+
size: size
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
55
|
GoogleButton.propTypes = {
|
|
52
56
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
57
|
+
email: _propTypes.string,
|
|
53
58
|
failureCallback: _propTypes.func,
|
|
54
59
|
label: _propTypes.string,
|
|
55
60
|
size: _propTypes.string,
|
|
@@ -15,6 +15,7 @@ var Google = function Google(_ref) {
|
|
|
15
15
|
var _ref$classNames = _ref.classNames,
|
|
16
16
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17
17
|
config = _ref.config,
|
|
18
|
+
email = _ref.email,
|
|
18
19
|
label = _ref.label,
|
|
19
20
|
_ref$size = _ref.size,
|
|
20
21
|
size = _ref$size === void 0 ? _buttonSizes.SMALL : _ref$size,
|
|
@@ -33,6 +34,7 @@ var Google = function Google(_ref) {
|
|
|
33
34
|
triggerOnMount: triggerOnMount
|
|
34
35
|
}, /*#__PURE__*/_react.default.createElement(_GoogleButton.default, {
|
|
35
36
|
classNames: classNames,
|
|
37
|
+
email: email,
|
|
36
38
|
failureCallback: failureCallback,
|
|
37
39
|
label: label,
|
|
38
40
|
size: size,
|
|
@@ -46,6 +48,7 @@ Google.propTypes = {
|
|
|
46
48
|
failureCallback: _propTypes.func,
|
|
47
49
|
successCallback: _propTypes.func
|
|
48
50
|
}),
|
|
51
|
+
email: _propTypes.string,
|
|
49
52
|
label: _propTypes.string,
|
|
50
53
|
size: _propTypes.string,
|
|
51
54
|
tooltipContent: _propTypes.string,
|
|
@@ -20,6 +20,7 @@ var Microsoft = function Microsoft(_ref) {
|
|
|
20
20
|
var _ref$classNames = _ref.classNames,
|
|
21
21
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
22
22
|
config = _ref.config,
|
|
23
|
+
email = _ref.email,
|
|
23
24
|
label = _ref.label,
|
|
24
25
|
_ref$size = _ref.size,
|
|
25
26
|
size = _ref$size === void 0 ? _buttonSizes.SMALL : _ref$size,
|
|
@@ -43,7 +44,10 @@ var Microsoft = function Microsoft(_ref) {
|
|
|
43
44
|
btnContent: size === _buttonSizes.LARGE ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, Image, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
44
45
|
className: "".concat(_stylesModule.default.label, " ").concat(classNames.label),
|
|
45
46
|
colorTheme: "light"
|
|
46
|
-
}, label)
|
|
47
|
+
}, label), email && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
48
|
+
className: "".concat(_stylesModule.default.label, " ").concat(classNames.label),
|
|
49
|
+
colorTheme: "light"
|
|
50
|
+
}, email)) : /*#__PURE__*/_react.default.createElement("div", {
|
|
47
51
|
className: _stylesModule.default.smallButtonWrapper
|
|
48
52
|
}, Image),
|
|
49
53
|
clientId: clientId,
|
|
@@ -59,6 +63,7 @@ Microsoft.propTypes = {
|
|
|
59
63
|
loginHandler: _propTypes.func,
|
|
60
64
|
redirectUrl: _propTypes.string
|
|
61
65
|
}),
|
|
66
|
+
email: _propTypes.string,
|
|
62
67
|
label: _propTypes.string,
|
|
63
68
|
size: _propTypes.string,
|
|
64
69
|
tooltipContent: _propTypes.string,
|
|
@@ -29,6 +29,7 @@ var Twitter = function Twitter(_ref) {
|
|
|
29
29
|
var _ref$classNames = _ref.classNames,
|
|
30
30
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
31
31
|
config = _ref.config,
|
|
32
|
+
email = _ref.email,
|
|
32
33
|
label = _ref.label,
|
|
33
34
|
_ref$size = _ref.size,
|
|
34
35
|
size = _ref$size === void 0 ? _buttonSizes.SMALL : _ref$size,
|
|
@@ -97,9 +98,10 @@ var Twitter = function Twitter(_ref) {
|
|
|
97
98
|
tooltipContent: tooltipContent,
|
|
98
99
|
triggerOnMount: triggerOnMount
|
|
99
100
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
classNames: {
|
|
102
|
+
container: "".concat(_stylesModule.default.buttonContainer, " ").concat(classNames.buttonContainer)
|
|
103
|
+
},
|
|
104
|
+
email: email,
|
|
103
105
|
Icon: function Icon(_ref4) {
|
|
104
106
|
var className = _ref4.className;
|
|
105
107
|
return /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -108,11 +110,12 @@ var Twitter = function Twitter(_ref) {
|
|
|
108
110
|
src: _twitterIcon.default
|
|
109
111
|
});
|
|
110
112
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
label: label,
|
|
114
|
+
mainLabelProps: _objectSpread({}, size === _buttonSizes.LARGE ? {
|
|
115
|
+
colorTheme: 'light'
|
|
116
|
+
} : {}),
|
|
117
|
+
onClick: handleClick,
|
|
118
|
+
size: size
|
|
116
119
|
}));
|
|
117
120
|
};
|
|
118
121
|
Twitter.propTypes = {
|
|
@@ -126,6 +129,7 @@ Twitter.propTypes = {
|
|
|
126
129
|
requestTokenUrl: _propTypes.string,
|
|
127
130
|
screenName: _propTypes.string
|
|
128
131
|
}),
|
|
132
|
+
email: _propTypes.string,
|
|
129
133
|
label: _propTypes.string,
|
|
130
134
|
size: _propTypes.string,
|
|
131
135
|
tooltipContent: _propTypes.string,
|
package/package.json
CHANGED