@lideralia/alife-uikit 1.3.1 → 1.3.3
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.
|
@@ -60,18 +60,33 @@ const Box = (0, _styledComponents.default)('div').withConfig({
|
|
|
60
60
|
})(_styledSystem.space, _styledSystem.color, _styledSystem.layout, _styledSystem.flexbox, _styledSystem.position, _styledSystem.border, _styledSystem.background, _styledSystem.opacity, _styledSystem.shadow, _styledSystem.typography, _styledSystem.variant);
|
|
61
61
|
exports.Box = Box;
|
|
62
62
|
Box.propTypes = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _propTypes.default.space), _propTypes.default.color), _propTypes.default.layout), _propTypes.default.flexbox), _propTypes.default.position), _propTypes.default.border), _propTypes.default.opacity), _propTypes.default.shadow), _propTypes.default.variant);
|
|
63
|
+
|
|
64
|
+
const getGapValue = gap => {
|
|
65
|
+
if (gap === undefined) return undefined;
|
|
66
|
+
if (typeof gap === 'number') return "".concat(gap * 8, "px");
|
|
67
|
+
return gap;
|
|
68
|
+
};
|
|
69
|
+
|
|
63
70
|
const Flex = (0, _styledComponents.default)(Box).withConfig({
|
|
71
|
+
shouldForwardProp: (prop, defaultValidatorFn) => defaultValidatorFn(prop) || prop === 'gap'
|
|
72
|
+
}).attrs(props => ({
|
|
73
|
+
gap: props.gap
|
|
74
|
+
})).withConfig({
|
|
64
75
|
displayName: "Layout__Flex",
|
|
65
76
|
componentId: "sc-1ozuvye-2"
|
|
66
|
-
})({
|
|
67
|
-
|
|
77
|
+
})(["display:flex;gap:", ";"], _ref => {
|
|
78
|
+
let {
|
|
79
|
+
gap
|
|
80
|
+
} = _ref;
|
|
81
|
+
return getGapValue(gap);
|
|
68
82
|
});
|
|
69
83
|
exports.Flex = Flex;
|
|
70
84
|
Flex.propTypes = {
|
|
71
85
|
flexWrap: _propTypes2.default.string,
|
|
72
86
|
flexDirection: _propTypes2.default.string,
|
|
73
87
|
alignCols: _propTypes2.default.string,
|
|
74
|
-
justifyContent: _propTypes2.default.string
|
|
88
|
+
justifyContent: _propTypes2.default.string,
|
|
89
|
+
gap: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
|
75
90
|
};
|
|
76
91
|
|
|
77
92
|
const Row = props => {
|
|
@@ -33,7 +33,7 @@ var _Typography = require("../../atoms/Typography");
|
|
|
33
33
|
|
|
34
34
|
var _CarouselScroll = require("../../molecules/CarouselScroll");
|
|
35
35
|
|
|
36
|
-
const _excluded = ["isAdmin", "numAttendees", "confirmed", "isAnswered", "pictures", "pictureMap", "urlMap", "userCanAttend", "hasStreaming"];
|
|
36
|
+
const _excluded = ["isAdmin", "numAttendees", "confirmed", "isAnswered", "pictures", "pictureMap", "urlMap", "userCanAttend", "hasStreaming", "warningMessage"];
|
|
37
37
|
|
|
38
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
39
|
|
|
@@ -50,7 +50,8 @@ const CardCeremony = props => {
|
|
|
50
50
|
pictureMap,
|
|
51
51
|
urlMap,
|
|
52
52
|
userCanAttend,
|
|
53
|
-
hasStreaming
|
|
53
|
+
hasStreaming,
|
|
54
|
+
warningMessage
|
|
54
55
|
} = props,
|
|
55
56
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
56
57
|
return _react.default.createElement(_Card.Card, (0, _extends2.default)({
|
|
@@ -72,7 +73,9 @@ const CardCeremony = props => {
|
|
|
72
73
|
borderTopStyle: "solid",
|
|
73
74
|
borderTopWidth: "1px",
|
|
74
75
|
borderTopColor: "black12"
|
|
75
|
-
})), !isAnswered && userCanAttend && _react.default.createElement(CardCeremony.Assistants, props), isAdmin && numAttendees && _react.default.createElement(CardCeremony.Attendees, props),
|
|
76
|
+
})), !isAnswered && userCanAttend && _react.default.createElement(CardCeremony.Assistants, props), isAdmin && numAttendees && _react.default.createElement(CardCeremony.Attendees, props), warningMessage && _react.default.createElement(CardCeremony.Warning, {
|
|
77
|
+
warningMessage: warningMessage
|
|
78
|
+
}), hasStreaming && _react.default.createElement(CardCeremony.HasStreaming, props));
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
exports.CardCeremony = CardCeremony;
|
|
@@ -410,7 +413,6 @@ CardCeremony.HasStreaming = _ref7 => {
|
|
|
410
413
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Layout.Flex, {
|
|
411
414
|
flexDirection: "column",
|
|
412
415
|
style: {
|
|
413
|
-
borderRadius: '0px 0px 18px 18px',
|
|
414
416
|
backgroundColor: 'rgba(242, 180, 64, 0.12)'
|
|
415
417
|
}
|
|
416
418
|
}, _react.default.createElement(_Layout.Flex, {
|
|
@@ -462,4 +464,32 @@ CardCeremony.HasStreaming = _ref7 => {
|
|
|
462
464
|
sizeButton: "small",
|
|
463
465
|
action: () => onLogin()
|
|
464
466
|
}, textButtonStreaming)), _react.default.createElement(_Icons.IconInfoCircle, null))));
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
CardCeremony.Warning = _ref8 => {
|
|
470
|
+
let {
|
|
471
|
+
warningMessage
|
|
472
|
+
} = _ref8;
|
|
473
|
+
return _react.default.createElement(_Layout.Flex, {
|
|
474
|
+
flexDirection: "row",
|
|
475
|
+
style: {
|
|
476
|
+
backgroundColor: 'rgba(242, 180, 64, 0.12)'
|
|
477
|
+
},
|
|
478
|
+
padding: 3,
|
|
479
|
+
borderTopColor: "black12",
|
|
480
|
+
borderTopStyle: "solid",
|
|
481
|
+
borderTopWidth: "1px",
|
|
482
|
+
alignItems: "center",
|
|
483
|
+
justifyContent: "center",
|
|
484
|
+
width: "100%",
|
|
485
|
+
gap: 1
|
|
486
|
+
}, _react.default.createElement(_Icon.Icon, {
|
|
487
|
+
color: "black60",
|
|
488
|
+
sizeIcon: "display16"
|
|
489
|
+
}, _react.default.createElement(_Icons.IconAlertCircle, null)), _react.default.createElement(_Typography.Text, {
|
|
490
|
+
color: "black84",
|
|
491
|
+
fontWeight: "bold",
|
|
492
|
+
sizeText: "display13",
|
|
493
|
+
textAlign: "center"
|
|
494
|
+
}, warningMessage));
|
|
465
495
|
};
|
|
@@ -11,9 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _css = _interopRequireDefault(require("@styled-system/css"));
|
|
13
13
|
|
|
14
|
-
var _react =
|
|
15
|
-
|
|
16
|
-
var _reactLivechat = _interopRequireDefault(require("react-livechat"));
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
15
|
|
|
18
16
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
17
|
|
|
@@ -31,10 +29,6 @@ var _Typography = require("../../atoms/Typography");
|
|
|
31
29
|
|
|
32
30
|
var _useWindowSize = _interopRequireDefault(require("../../utils/useWindowSize"));
|
|
33
31
|
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
32
|
const BadgeStyled = _styledComponents.default.span.withConfig({
|
|
39
33
|
displayName: "Header__BadgeStyled",
|
|
40
34
|
componentId: "sc-c0gxqz-0"
|
|
@@ -54,6 +48,7 @@ const Header = (_ref, props) => {
|
|
|
54
48
|
shareAction,
|
|
55
49
|
goToHome,
|
|
56
50
|
goToUserProfile,
|
|
51
|
+
openSupportChat,
|
|
57
52
|
logo,
|
|
58
53
|
customColor,
|
|
59
54
|
customTextColor,
|
|
@@ -61,39 +56,13 @@ const Header = (_ref, props) => {
|
|
|
61
56
|
shareLabel,
|
|
62
57
|
helpLabel,
|
|
63
58
|
eventAction,
|
|
64
|
-
paramsLiveChat,
|
|
65
|
-
allowShowLiveChat,
|
|
66
|
-
notLoggedIn,
|
|
67
59
|
actionShare,
|
|
68
|
-
showUserNotificationBadge
|
|
60
|
+
showUserNotificationBadge,
|
|
61
|
+
showSupportChatNotification
|
|
69
62
|
} = _ref;
|
|
70
63
|
const {
|
|
71
64
|
width
|
|
72
65
|
} = (0, _useWindowSize.default)();
|
|
73
|
-
const [liveChat, setLiveChat] = (0, _react.useState)(null);
|
|
74
|
-
const [showNotification, setShowNotification] = (0, _react.useState)(false);
|
|
75
|
-
|
|
76
|
-
const showLiveChat = () => {
|
|
77
|
-
if (liveChat !== null) {
|
|
78
|
-
try {
|
|
79
|
-
liveChat === null || liveChat === void 0 ? void 0 : liveChat.open_chat_window();
|
|
80
|
-
setShowNotification(false);
|
|
81
|
-
} catch (e) {}
|
|
82
|
-
} else {
|
|
83
|
-
notLoggedIn();
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const captureNotification = notification => {
|
|
88
|
-
if (notification.user_type == 'agent') {
|
|
89
|
-
try {
|
|
90
|
-
if (!showNotification && !(liveChat !== null && liveChat !== void 0 && liveChat.chat_window_maximized())) {
|
|
91
|
-
setShowNotification(true);
|
|
92
|
-
}
|
|
93
|
-
} catch (e) {}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
66
|
return _react.default.createElement(_Layout.Box, (0, _extends2.default)({
|
|
98
67
|
boxShadow: "bottom",
|
|
99
68
|
width: "100%",
|
|
@@ -108,12 +77,7 @@ const Header = (_ref, props) => {
|
|
|
108
77
|
alignItems: "center",
|
|
109
78
|
justifyContent: "space-between",
|
|
110
79
|
"data-testid": "test-Header"
|
|
111
|
-
}, props),
|
|
112
|
-
onChatLoaded: ref => setLiveChat(ref),
|
|
113
|
-
license: 13369755,
|
|
114
|
-
onMessage: notification => captureNotification(notification),
|
|
115
|
-
params: paramsLiveChat
|
|
116
|
-
}), _react.default.createElement(_Layout.Box, {
|
|
80
|
+
}, props), _react.default.createElement(_Layout.Box, {
|
|
117
81
|
onClick: () => goToHome(),
|
|
118
82
|
style: {
|
|
119
83
|
cursor: 'pointer',
|
|
@@ -125,7 +89,8 @@ const Header = (_ref, props) => {
|
|
|
125
89
|
}, logo), _react.default.createElement(_Layout.Flex, null, _react.default.createElement(_Pill.Pill, {
|
|
126
90
|
style: {
|
|
127
91
|
cursor: 'pointer',
|
|
128
|
-
backgroundColor: customButtonColor || ''
|
|
92
|
+
backgroundColor: customButtonColor || '',
|
|
93
|
+
position: 'relative'
|
|
129
94
|
}
|
|
130
95
|
}, _react.default.createElement(_Layout.Flex, {
|
|
131
96
|
onClick: e => shareAction(e),
|
|
@@ -159,19 +124,19 @@ const Header = (_ref, props) => {
|
|
|
159
124
|
sizeText: "display14",
|
|
160
125
|
fontWeight: "bold",
|
|
161
126
|
color: customTextColor || 'black84',
|
|
162
|
-
onClick:
|
|
163
|
-
}, helpLabel)
|
|
127
|
+
onClick: openSupportChat
|
|
128
|
+
}, helpLabel), showSupportChatNotification && _react.default.createElement("div", {
|
|
164
129
|
style: {
|
|
165
130
|
width: '12px',
|
|
166
131
|
height: '12px',
|
|
167
132
|
backgroundColor: '#EC3C4E',
|
|
168
133
|
borderRadius: '10px',
|
|
169
|
-
|
|
170
|
-
|
|
134
|
+
top: '-3px',
|
|
135
|
+
right: '-3px',
|
|
171
136
|
display: 'inline-block',
|
|
172
137
|
position: 'absolute'
|
|
173
138
|
}
|
|
174
|
-
}), _react.default.createElement(_Pill.Pill, {
|
|
139
|
+
})), _react.default.createElement(_Pill.Pill, {
|
|
175
140
|
padding: 1,
|
|
176
141
|
borderRadius: 7,
|
|
177
142
|
marginLeft: 1,
|
|
@@ -201,6 +166,6 @@ Header.defaultProps = {
|
|
|
201
166
|
shareCopy: null,
|
|
202
167
|
eventAction: null,
|
|
203
168
|
paramsLiveChat: null,
|
|
204
|
-
|
|
205
|
-
|
|
169
|
+
showUserNotificationBadge: false,
|
|
170
|
+
showSupportChatNotification: false
|
|
206
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lideralia/alife-uikit",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Librería y documentación de componentes, basada en el Design System de Alife.",
|
|
5
5
|
"homepage": "https://github.com/lideralia/alife-frontend-components#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -96,7 +96,6 @@
|
|
|
96
96
|
"react-color": "^2.19.3",
|
|
97
97
|
"react-dom": "^17.0.1",
|
|
98
98
|
"react-google-recaptcha": "^2.1.0",
|
|
99
|
-
"react-livechat": "^1.1.1",
|
|
100
99
|
"react-scripts": "4.0.3",
|
|
101
100
|
"react-select": "^4.1.0",
|
|
102
101
|
"recordrtc": "^5.6.2",
|