@startlibs/components 1.0.0-alpha-8b → 1.0.0-alpha-8c
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/lib/index.js +281 -30
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -30,6 +30,8 @@ var _identity = _interopDefault(require('lodash/fp/identity'));
|
|
|
30
30
|
var _isString = _interopDefault(require('lodash/fp/isString'));
|
|
31
31
|
var _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));
|
|
32
32
|
var _isObject = _interopDefault(require('lodash/fp/isObject'));
|
|
33
|
+
var _without = _interopDefault(require('lodash/fp/without'));
|
|
34
|
+
require('@startlibs/components');
|
|
33
35
|
var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
|
|
34
36
|
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));
|
|
35
37
|
var _set = _interopDefault(require('lodash/fp/set'));
|
|
@@ -40,8 +42,9 @@ var reactHotLoader = require('react-hot-loader');
|
|
|
40
42
|
var _isFunction = _interopDefault(require('lodash/fp/isFunction'));
|
|
41
43
|
var reactIs = require('react-is');
|
|
42
44
|
var mitt = _interopDefault(require('mitt'));
|
|
45
|
+
require('lodash/fp');
|
|
43
46
|
var _typeof = _interopDefault(require('@babel/runtime/helpers/typeof'));
|
|
44
|
-
var
|
|
47
|
+
var createEmotion = _interopDefault(require('create-emotion'));
|
|
45
48
|
|
|
46
49
|
var IconComponent =
|
|
47
50
|
/*#__PURE__*/
|
|
@@ -228,7 +231,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
|
|
|
228
231
|
})).withConfig({
|
|
229
232
|
displayName: "Button",
|
|
230
233
|
componentId: "qe54pl-1"
|
|
231
|
-
})(["vertical-align:top;border:0;font-size:12px;border-radius:", ";background:", ";color:white;min-width:8rem;font-weight:500;display:inline-block;line-height:16px;text-align:center;padding:10px 1.25rem;outline:none;cursor:pointer;position:relative;text-decoration:none;user-select:none;flex-shrink:0;:hover{background:", ";}:active{background:", ";}", " ", " + .styled-button{margin-left:1rem;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
|
|
234
|
+
})(["vertical-align:top;border:0;font-size:12px;border-radius:", ";background:", ";color:white;min-width:8rem;font-weight:500;display:inline-block;line-height:16px;text-align:center;padding:10px 1.25rem;outline:none;cursor:pointer;position:relative;text-decoration:none;user-select:none;flex-shrink:0;:hover{background:", ";}:active{background:", ";}", " ", " + .styled-button{margin-left:1rem;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
|
|
232
235
|
return props.rounded ? '100px' : '6px';
|
|
233
236
|
}, utils.getColor, function (props) {
|
|
234
237
|
return polished.darken(0.05, utils.getColor(props, true));
|
|
@@ -256,6 +259,14 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
|
|
|
256
259
|
}, function (props) {
|
|
257
260
|
return polished.darken(0.08, utils.getColor('bluishGray')(props));
|
|
258
261
|
});
|
|
262
|
+
}, function (props) {
|
|
263
|
+
return props.lightAlert && styled.css(["background:", ";color:", ";:hover{background:", ";}:active{background:", ";}"], function (props) {
|
|
264
|
+
return polished.transparentize(0.88, utils.getColor("alert")(props));
|
|
265
|
+
}, utils.getColor('alert'), function (props) {
|
|
266
|
+
return polished.transparentize(0.85, utils.getColor("alert")(props));
|
|
267
|
+
}, function (props) {
|
|
268
|
+
return polished.transparentize(0.82, utils.getColor("alert")(props));
|
|
269
|
+
});
|
|
259
270
|
}, function (props) {
|
|
260
271
|
return (props.outline || props.dashed || props.textOnly) && styled.css(["color:", ";background:none;", ",", "{color:", ";}:before{content:'';border:1px ", " ", ";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:", ";pointer-events:none;}:hover{background-color:rgba(0,0,0,0.05);}:active{background-color:rgba(0,0,0,0.08);}:focus{:before{box-shadow:0 0 0 2px rgba(0,0,0,0.1);", "}:after{content:none;}}"], props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.6)', Icon, DropdownIcon, props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.5)', props.outline ? 'solid' : props.dashed ? 'dashed' : '', props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.35)', props.rounded ? '100px' : '6px', props.textOnly && 'content: none;');
|
|
261
272
|
}, function (props) {
|
|
@@ -687,7 +698,8 @@ var hasClientRectChanged = function hasClientRectChanged(oldSnap, newSnap) {
|
|
|
687
698
|
|
|
688
699
|
var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
|
|
689
700
|
var _ref5 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
690
|
-
skipTransform = _ref5.skipTransform
|
|
701
|
+
skipTransform = _ref5.skipTransform,
|
|
702
|
+
smallJumpFix = _ref5.smallJumpFix;
|
|
691
703
|
|
|
692
704
|
if (hasClientRectChanged(oldSnap, newSnap)) {
|
|
693
705
|
var _oldSnap$parentStyle, _newSnap$parentStyle, _oldSnap$parentStyle2, _newSnap$parentStyle2;
|
|
@@ -712,17 +724,17 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
|
|
|
712
724
|
paddingBottom = _window$getComputedSt4.paddingBottom;
|
|
713
725
|
|
|
714
726
|
finalPadding = 'padding-bottom:' + paddingBottom + ';';
|
|
715
|
-
heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom));
|
|
727
|
+
heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom) + (smallJumpFix || 0), ";");
|
|
716
728
|
}
|
|
717
729
|
|
|
718
|
-
var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden" : "";
|
|
730
|
+
var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden;" : "";
|
|
719
731
|
var transform = (left !== 0 || top !== 0) && !skipTransform ? "transform: translate(".concat(left, "px,").concat(top, "px);") : '';
|
|
720
732
|
var parentPaddingTopDelta = (parseInt((_oldSnap$parentStyle = oldSnap.parentStyle) === null || _oldSnap$parentStyle === void 0 ? void 0 : _oldSnap$parentStyle.paddingTop) || 0) - (parseInt((_newSnap$parentStyle = newSnap.parentStyle) === null || _newSnap$parentStyle === void 0 ? void 0 : _newSnap$parentStyle.paddingTop) || 0);
|
|
721
733
|
var parentPaddingBottomDelta = (parseInt((_oldSnap$parentStyle2 = oldSnap.parentStyle) === null || _oldSnap$parentStyle2 === void 0 ? void 0 : _oldSnap$parentStyle2.paddingBottom) || 0) - (parseInt((_newSnap$parentStyle2 = newSnap.parentStyle) === null || _newSnap$parentStyle2 === void 0 ? void 0 : _newSnap$parentStyle2.paddingBottom) || 0);
|
|
722
734
|
var oldMarginTop = (parseInt(oldSnap.marginTop) || 0) + parentPaddingTopDelta;
|
|
723
735
|
var oldMarginBottom = (parseInt(oldSnap.marginBottom) || 0) + parentPaddingBottomDelta;
|
|
724
736
|
var oldTransform = node.style.transform;
|
|
725
|
-
return [utils.oneWayAnimation("\n ".concat(transform, "\n ").concat(heightFix, "\n ").concat(overflowFix, "\n margin-top: ").concat(oldMarginTop, "px;\n margin-bottom: ").concat(oldMarginBottom, "px;\n width: ").concat(oldSnap.width, "px;\n height: ").concat(oldSnap.height, "px;\n "), "\n ".concat(finalPadding, "\n ").concat(oldTransform ? "transform:".concat(oldTransform) : '', "\n ").concat(overflowFix, "\n margin-top:").concat(newSnap.marginTop || 0, "px;\n margin-bottom:").concat(newSnap.marginBottom || 0, "px;\n width: ").concat(newSnap.width, "px;\n height: ").concat(newSnap.height, "px;\n "))];
|
|
737
|
+
return [utils.oneWayAnimation("\n ".concat(transform, "\n ").concat(heightFix, "\n ").concat(overflowFix, "\n margin-top: ").concat(oldMarginTop, "px;\n margin-bottom: ").concat(oldMarginBottom, "px;\n width: ").concat(oldSnap.width, "px;\n height: ").concat(Math.max(0, oldSnap.height + (smallJumpFix || 0)), "px;\n "), "\n ".concat(finalPadding, "\n ").concat(oldTransform ? "transform:".concat(oldTransform, ";") : '', "\n ").concat(overflowFix, "\n margin-top:").concat(parseInt(newSnap.marginTop) || 0, "px;\n margin-bottom:").concat(parseInt(newSnap.marginBottom) || 0, "px;\n width: ").concat(newSnap.width, "px;\n height: ").concat(Math.max(0, newSnap.height + (smallJumpFix || 0)), "px;\n "))];
|
|
726
738
|
} else {
|
|
727
739
|
return [];
|
|
728
740
|
}
|
|
@@ -1911,15 +1923,17 @@ var DialogContent = styled__default(function (props) {
|
|
|
1911
1923
|
}).withConfig({
|
|
1912
1924
|
displayName: "Dialog__DialogContent",
|
|
1913
1925
|
componentId: "gai4ey-3"
|
|
1914
|
-
})(["outline:none;width:100%;position:relative;min-height:5rem;", " ", " p{font-size:
|
|
1926
|
+
})(["outline:none;width:100%;position:relative;min-height:5rem;", " ", " p{font-size:14px;}"], function (props) {
|
|
1915
1927
|
return props.icon && styled.css(["padding-right:8rem;min-height:6rem;"]);
|
|
1916
1928
|
}, function (props) {
|
|
1917
1929
|
return props.illustration && styled.css(["padding-right:15rem;", ""], utils.media.mobile(_templateObject3$1()));
|
|
1918
|
-
}
|
|
1930
|
+
});
|
|
1919
1931
|
var DialogTitle = styled__default.h2.withConfig({
|
|
1920
1932
|
displayName: "Dialog__DialogTitle",
|
|
1921
1933
|
componentId: "gai4ey-4"
|
|
1922
|
-
})(["margin-bottom:1rem;padding-bottom:1rem;", ""],
|
|
1934
|
+
})(["margin-bottom:1rem;padding-bottom:1rem;", " ", ""], function (props) {
|
|
1935
|
+
return props.fixTitleMargin && "\n padding-bottom: 0;\n ";
|
|
1936
|
+
}, utils.media.mobile(_templateObject4()));
|
|
1923
1937
|
var DialogFooter = styled__default.div.withConfig({
|
|
1924
1938
|
displayName: "Dialog__DialogFooter",
|
|
1925
1939
|
componentId: "gai4ey-5"
|
|
@@ -1941,6 +1955,7 @@ var DialogAlwaysVisibleDiv = styled__default.div.withConfig({
|
|
|
1941
1955
|
var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef) {
|
|
1942
1956
|
var className = _ref.className,
|
|
1943
1957
|
skipWrap = _ref.skipWrap,
|
|
1958
|
+
fixTitleMargin = _ref.fixTitleMargin,
|
|
1944
1959
|
skipCloseIcon = _ref.skipCloseIcon,
|
|
1945
1960
|
isLoading = _ref.isLoading,
|
|
1946
1961
|
footer = _ref.footer,
|
|
@@ -1952,7 +1967,7 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
|
|
|
1952
1967
|
auxiliarActions = _ref.auxiliarActions,
|
|
1953
1968
|
_ref$container = _ref.container,
|
|
1954
1969
|
container = _ref$container === void 0 ? true : _ref$container,
|
|
1955
|
-
props = _objectWithoutProperties(_ref, ["className", "skipWrap", "skipCloseIcon", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
|
|
1970
|
+
props = _objectWithoutProperties(_ref, ["className", "skipWrap", "fixTitleMargin", "skipCloseIcon", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
|
|
1956
1971
|
|
|
1957
1972
|
var ref = core.useEnsureRef(outerRef);
|
|
1958
1973
|
|
|
@@ -1960,7 +1975,9 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
|
|
|
1960
1975
|
return React__default.createElement(React__default.Fragment, null, props.closeDialog && !skipCloseIcon && React__default.createElement(CloseIcon, {
|
|
1961
1976
|
className: "JS-dialog-close",
|
|
1962
1977
|
onClick: confirmCloseDialog
|
|
1963
|
-
}), title && React__default.createElement(DialogTitle,
|
|
1978
|
+
}), title && React__default.createElement(DialogTitle, {
|
|
1979
|
+
fixTitleMargin: true
|
|
1980
|
+
}, utils.callIfFunction(title)));
|
|
1964
1981
|
};
|
|
1965
1982
|
|
|
1966
1983
|
var content = React__default.createElement(React__default.Fragment, null, Content && React__default.createElement(DialogContent, {
|
|
@@ -2074,6 +2091,10 @@ var useDialogWithToggle = function useDialogWithToggle(dialog) {
|
|
|
2074
2091
|
var WarningDialog = styled__default(function (_ref) {
|
|
2075
2092
|
var content = _ref.content,
|
|
2076
2093
|
closeDialog = _ref.closeDialog,
|
|
2094
|
+
leftButton = _ref.leftButton,
|
|
2095
|
+
additionalContent = _ref.additionalContent,
|
|
2096
|
+
title = _ref.title,
|
|
2097
|
+
rightButton = _ref.rightButton,
|
|
2077
2098
|
className = _ref.className,
|
|
2078
2099
|
_ref$icon = _ref.icon,
|
|
2079
2100
|
icon = _ref$icon === void 0 ? "warning" : _ref$icon,
|
|
@@ -2083,17 +2104,33 @@ var WarningDialog = styled__default(function (_ref) {
|
|
|
2083
2104
|
className: className
|
|
2084
2105
|
}, React__default.createElement(MainIcon, {
|
|
2085
2106
|
icon: icon
|
|
2086
|
-
}),
|
|
2107
|
+
}), title && React__default.createElement(Title, {
|
|
2108
|
+
color: icon
|
|
2109
|
+
}, title), content && React__default.createElement(Content, {
|
|
2110
|
+
noTitle: !title
|
|
2111
|
+
}, content), additionalContent, utils.callIfFunction(leftButton, closeDialog), confirmLabel !== false && React__default.createElement(Button, {
|
|
2087
2112
|
highlight: true,
|
|
2088
2113
|
onClick: closeDialog
|
|
2089
|
-
}, confirmLabel));
|
|
2114
|
+
}, confirmLabel), utils.callIfFunction(rightButton, closeDialog));
|
|
2090
2115
|
}).withConfig({
|
|
2091
2116
|
displayName: "WarningDialog",
|
|
2092
2117
|
componentId: "sc-1jw779e-0"
|
|
2093
|
-
})(["text-align:center;max-width:36rem;padding:2.5rem;
|
|
2118
|
+
})(["text-align:center;max-width:36rem;padding:2.5rem;", "{margin:0.5rem !important;}"], Button);
|
|
2119
|
+
var Title = styled__default.h3.withConfig({
|
|
2120
|
+
displayName: "WarningDialog__Title",
|
|
2121
|
+
componentId: "sc-1jw779e-1"
|
|
2122
|
+
})(["color:", ";font-weight:500;font-size:20px;"], function (props) {
|
|
2123
|
+
return props.color === 'warning' ? utils.getColor('alert') : props.color === 'success' ? utils.getColor('success') : utils.getColor('main');
|
|
2124
|
+
});
|
|
2125
|
+
var Content = styled__default.div.withConfig({
|
|
2126
|
+
displayName: "WarningDialog__Content",
|
|
2127
|
+
componentId: "sc-1jw779e-2"
|
|
2128
|
+
})(["font-size:15px;max-width:27rem;margin:0 auto 1.5rem;line-height:130%;", ""], function (props) {
|
|
2129
|
+
return props.noTitle && "\n font-weight: 500;\n font-size: 16px;\n ";
|
|
2130
|
+
});
|
|
2094
2131
|
var MainIcon = styled__default(Icon).withConfig({
|
|
2095
2132
|
displayName: "WarningDialog__MainIcon",
|
|
2096
|
-
componentId: "sc-1jw779e-
|
|
2133
|
+
componentId: "sc-1jw779e-3"
|
|
2097
2134
|
})(["color:", ";font-size:46px;display:block;margin-bottom:1.25rem;"], function (props) {
|
|
2098
2135
|
return props.icon === 'warning' ? utils.getColor('alert') : props.icon === 'success' ? utils.getColor('success') : utils.getColor('main');
|
|
2099
2136
|
});
|
|
@@ -2203,6 +2240,81 @@ var FlipNotification = function FlipNotification(props) {
|
|
|
2203
2240
|
}, props)));
|
|
2204
2241
|
};
|
|
2205
2242
|
|
|
2243
|
+
var _willUseSharedState$2 = core.willUseSharedState([]),
|
|
2244
|
+
_willUseSharedState2$2 = _slicedToArray(_willUseSharedState$2, 3),
|
|
2245
|
+
useNotifications = _willUseSharedState2$2[0],
|
|
2246
|
+
setNotifications = _willUseSharedState2$2[2];
|
|
2247
|
+
|
|
2248
|
+
var openPersistentNotification = function openPersistentNotification(notification) {
|
|
2249
|
+
var newNotification = _objectSpread({
|
|
2250
|
+
priority: 0,
|
|
2251
|
+
type: "success"
|
|
2252
|
+
}, _isObject(notification) ? notification : {
|
|
2253
|
+
content: notification
|
|
2254
|
+
});
|
|
2255
|
+
|
|
2256
|
+
setNotifications(function (list) {
|
|
2257
|
+
var nextIndex = list.findIndex(function (n) {
|
|
2258
|
+
return n.priority < newNotification.priority;
|
|
2259
|
+
});
|
|
2260
|
+
return nextIndex < 0 ? _toConsumableArray(list).concat([newNotification]) : _toConsumableArray(list.slice(0, nextIndex)).concat([newNotification], _toConsumableArray(list.slice(nextIndex)));
|
|
2261
|
+
});
|
|
2262
|
+
return function () {
|
|
2263
|
+
return setNotifications(_without([newNotification]));
|
|
2264
|
+
};
|
|
2265
|
+
};
|
|
2266
|
+
var animation$1 = utils.oneWayAnimation('opacity:0; transform:translateY(-20px)', 'opacity:1;transform:translate(0)');
|
|
2267
|
+
var NotificationContainer$1 = styled__default.div.withConfig({
|
|
2268
|
+
displayName: "PersistentNotifications__NotificationContainer",
|
|
2269
|
+
componentId: "sc-1t7i0dh-0"
|
|
2270
|
+
})(["position:fixed;top:0;height:0;right:0;z-index:20;"]);
|
|
2271
|
+
var Notification$1 = styled__default.div.withConfig({
|
|
2272
|
+
displayName: "PersistentNotifications__Notification",
|
|
2273
|
+
componentId: "sc-1t7i0dh-1"
|
|
2274
|
+
})(["background:", ";position:relative;border-radius:7px;"], function (props) {
|
|
2275
|
+
return polished.transparentize(0.9, utils.getColor(props.type)(props));
|
|
2276
|
+
});
|
|
2277
|
+
var NotificationWrapper = styled__default.div.withConfig({
|
|
2278
|
+
displayName: "PersistentNotifications__NotificationWrapper",
|
|
2279
|
+
componentId: "sc-1t7i0dh-2"
|
|
2280
|
+
})(["background:white;margin-top:4rem;margin-right:0.75rem;margin-left:0.75rem;padding:5px;border-radius:10px;box-shadow:0 0 10px 0 rgba(0,0,0,0.1),0 1px 2px 1px rgba(0,0,0,0.15);max-width:360px;"]);
|
|
2281
|
+
var PersistentNotifications = function PersistentNotifications() {
|
|
2282
|
+
var _useNotifications = useNotifications(),
|
|
2283
|
+
_useNotifications2 = _slicedToArray(_useNotifications, 2),
|
|
2284
|
+
notifications = _useNotifications2[0],
|
|
2285
|
+
setNotifications = _useNotifications2[1];
|
|
2286
|
+
|
|
2287
|
+
if (!notifications.length) {
|
|
2288
|
+
return null;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
var closeMessage = function closeMessage() {
|
|
2292
|
+
return setNotifications(function (list) {
|
|
2293
|
+
return list.slice(1);
|
|
2294
|
+
});
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
var _notifications$ = notifications[0],
|
|
2298
|
+
content = _notifications$.content,
|
|
2299
|
+
type = _notifications$.type;
|
|
2300
|
+
return React__default.createElement(core.Fill, {
|
|
2301
|
+
name: "PersistentNotifications"
|
|
2302
|
+
}, React__default.createElement(FlipNotification$1, {
|
|
2303
|
+
type: type
|
|
2304
|
+
}, utils.callIfFunction(content, closeMessage)));
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2307
|
+
var FlipNotification$1 = function FlipNotification(props) {
|
|
2308
|
+
var ref = React.useRef();
|
|
2309
|
+
useFlipAnimation(ref, animation$1);
|
|
2310
|
+
return React__default.createElement(NotificationContainer$1, {
|
|
2311
|
+
className: "JS-fix-dialog-scroll",
|
|
2312
|
+
ref: ref
|
|
2313
|
+
}, React__default.createElement(NotificationWrapper, null, React__default.createElement(Notification$1, _extends({
|
|
2314
|
+
id: "js-share-notification"
|
|
2315
|
+
}, props))));
|
|
2316
|
+
};
|
|
2317
|
+
|
|
2206
2318
|
var Placeholder = styled__default.span.withConfig({
|
|
2207
2319
|
displayName: "usePositioning__Placeholder",
|
|
2208
2320
|
componentId: "sc-1m4912o-0"
|
|
@@ -2623,7 +2735,8 @@ function (_React$Component) {
|
|
|
2623
2735
|
}
|
|
2624
2736
|
|
|
2625
2737
|
var rectAnimation = getClientRectAnimation(oldSnap.parent, newSnap.parent, {
|
|
2626
|
-
skipTransform: true
|
|
2738
|
+
skipTransform: true,
|
|
2739
|
+
smallJumpFix: _this.props.smallJumpFix
|
|
2627
2740
|
});
|
|
2628
2741
|
var endEffect = utils.callIfFunction(effect, newSnap.parent.domNode, {
|
|
2629
2742
|
newSnap: newSnap,
|
|
@@ -4292,9 +4405,9 @@ var _willUseLayers$1 = core.willUseLayers(),
|
|
|
4292
4405
|
|
|
4293
4406
|
var contextMenuLayersQuantity = contextMenuLayersSize;
|
|
4294
4407
|
|
|
4295
|
-
var _willUseSharedState$
|
|
4296
|
-
_willUseSharedState2$
|
|
4297
|
-
useContextMenuSharedState = _willUseSharedState2$
|
|
4408
|
+
var _willUseSharedState$3 = core.willUseSharedState(),
|
|
4409
|
+
_willUseSharedState2$3 = _slicedToArray(_willUseSharedState$3, 1),
|
|
4410
|
+
useContextMenuSharedState = _willUseSharedState2$3[0];
|
|
4298
4411
|
|
|
4299
4412
|
var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
|
|
4300
4413
|
var children = _ref2.children,
|
|
@@ -4480,10 +4593,126 @@ var ContextMenu = React.forwardRef(function (_ref3, ref) {
|
|
|
4480
4593
|
});
|
|
4481
4594
|
ContextMenu.ListItem = ListItem;
|
|
4482
4595
|
|
|
4596
|
+
var scrollWidth = function () {
|
|
4597
|
+
if (!window.document) return 0;
|
|
4598
|
+
var html = document.documentElement;
|
|
4599
|
+
var oldOverflow = html.style.overflowY;
|
|
4600
|
+
html.style.overflowY = 'scroll';
|
|
4601
|
+
var width = window.innerWidth - html.clientWidth;
|
|
4602
|
+
html.style.overflowY = oldOverflow;
|
|
4603
|
+
return width;
|
|
4604
|
+
}();
|
|
4605
|
+
|
|
4606
|
+
var callIfFunction = function callIfFunction(prop) {
|
|
4607
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
4608
|
+
args[_key6 - 1] = arguments[_key6];
|
|
4609
|
+
}
|
|
4610
|
+
|
|
4611
|
+
return typeof prop === "function" ? prop.apply(void 0, args) : prop;
|
|
4612
|
+
};
|
|
4613
|
+
|
|
4614
|
+
function _templateObject$6() {
|
|
4615
|
+
var data = _taggedTemplateLiteral(["\n ", ""]);
|
|
4616
|
+
|
|
4617
|
+
_templateObject$6 = function _templateObject() {
|
|
4618
|
+
return data;
|
|
4619
|
+
};
|
|
4620
|
+
|
|
4621
|
+
return data;
|
|
4622
|
+
}
|
|
4623
|
+
|
|
4624
|
+
var checkCustomScreenWidth = function checkCustomScreenWidth(sizeParis, customWidth) {
|
|
4625
|
+
var currentWidth = callIfFunction(customWidth);
|
|
4626
|
+
return !sizeParis.find(function (_ref4) {
|
|
4627
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
4628
|
+
size = _ref5[0],
|
|
4629
|
+
type = _ref5[1];
|
|
4630
|
+
|
|
4631
|
+
if (type === "min-width") {
|
|
4632
|
+
return currentWidth < size;
|
|
4633
|
+
}
|
|
4634
|
+
|
|
4635
|
+
if (type === "max-width") {
|
|
4636
|
+
return currentWidth > size;
|
|
4637
|
+
}
|
|
4638
|
+
});
|
|
4639
|
+
};
|
|
4640
|
+
|
|
4641
|
+
var media = function media() {
|
|
4642
|
+
for (var _len3 = arguments.length, sizePairs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
4643
|
+
sizePairs[_key3] = arguments[_key3];
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4646
|
+
return function () {
|
|
4647
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
4648
|
+
args[_key4] = arguments[_key4];
|
|
4649
|
+
}
|
|
4650
|
+
|
|
4651
|
+
return styled.css(["", ""], function (props) {
|
|
4652
|
+
var _props$theme, _props$theme2;
|
|
4653
|
+
|
|
4654
|
+
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.overrideMediaWidth) ? checkCustomScreenWidth(sizePairs, (_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.overrideMediaWidth) ? styled.css.apply(void 0, args) : "" : styled.css(["@media ", "{", "}"], sizePairs.map(function (_ref6) {
|
|
4655
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
4656
|
+
size = _ref7[0],
|
|
4657
|
+
type = _ref7[1];
|
|
4658
|
+
|
|
4659
|
+
return "(".concat(type, ": ").concat(size + scrollWidth, "px)");
|
|
4660
|
+
}).join(' and '), styled.css.apply(void 0, args));
|
|
4661
|
+
});
|
|
4662
|
+
};
|
|
4663
|
+
};
|
|
4664
|
+
media.mobile = media([600, 'max-width']);
|
|
4665
|
+
|
|
4666
|
+
media.between = function (min, max) {
|
|
4667
|
+
return media([min, 'min-width'], [max, 'max-width']);
|
|
4668
|
+
};
|
|
4669
|
+
|
|
4670
|
+
media.max = function (n) {
|
|
4671
|
+
return media([n, 'max-width']);
|
|
4672
|
+
};
|
|
4673
|
+
|
|
4674
|
+
media.min = function (n) {
|
|
4675
|
+
return media([n, 'min-width']);
|
|
4676
|
+
};
|
|
4677
|
+
|
|
4678
|
+
media.desktop = media([601, 'min-width']);
|
|
4679
|
+
|
|
4680
|
+
var getFrameOffset = function getFrameOffset(i, total) {
|
|
4681
|
+
return Math.round(i * 100 / (total - 1));
|
|
4682
|
+
};
|
|
4683
|
+
|
|
4684
|
+
var emotion = createEmotion({
|
|
4685
|
+
nonce: __webpack_nonce__
|
|
4686
|
+
});
|
|
4687
|
+
var oneWayAnimation = function oneWayAnimation() {
|
|
4688
|
+
for (var _len5 = arguments.length, frames = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
4689
|
+
frames[_key5] = arguments[_key5];
|
|
4690
|
+
}
|
|
4691
|
+
|
|
4692
|
+
return emotion.keyframes(_templateObject$6(), frames.map(function (frame, i) {
|
|
4693
|
+
return !frame ? '' : "".concat(getFrameOffset(i, frames.length), "% {\n ").concat(frame, "\n }");
|
|
4694
|
+
}));
|
|
4695
|
+
};
|
|
4696
|
+
var animationTiming = function animationTiming(props) {
|
|
4697
|
+
return function () {
|
|
4698
|
+
for (var _len7 = arguments.length, animations = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
4699
|
+
animations[_key7] = arguments[_key7];
|
|
4700
|
+
}
|
|
4701
|
+
|
|
4702
|
+
return animations.filter(function (_) {
|
|
4703
|
+
return _;
|
|
4704
|
+
}).map(function (_) {
|
|
4705
|
+
return _ + ' ' + props;
|
|
4706
|
+
}).join(',');
|
|
4707
|
+
};
|
|
4708
|
+
};
|
|
4709
|
+
var identityTranslateFrames = oneWayAnimation('transform: translateY(0);', 'transform: translateY(0);');
|
|
4710
|
+
var identityOpacityFrames = oneWayAnimation('opacity: 1;', 'opacity:1;');
|
|
4711
|
+
|
|
4483
4712
|
var LoadingBar = styled__default.div.withConfig({
|
|
4484
4713
|
displayName: "PageLoader__LoadingBar",
|
|
4485
4714
|
componentId: "sc-96jeob-0"
|
|
4486
|
-
})(["width:0%;height:3px;position:fixed;background:#84D359;top:0;left:0;z-index:99999;box-shadow:0 0 6px 0 rgba(0,0,0,0.5);", "
|
|
4715
|
+
})(["width:0%;height:3px;position:fixed;background:#84D359;top:0;left:0;z-index:99999;box-shadow:0 0 6px 0 rgba(0,0,0,0.5);", " ", ""], function (props) {
|
|
4487
4716
|
return props.loading && "\n width: 70%;\n transition: 1.5s width linear;\n ";
|
|
4488
4717
|
}, function (props) {
|
|
4489
4718
|
return props.closing && "\n width: 100%;\n transition: 0.3s ease-in;\n ";
|
|
@@ -4503,6 +4732,18 @@ var PageLoader = function PageLoader(_ref) {
|
|
|
4503
4732
|
closing: loader.closing
|
|
4504
4733
|
});
|
|
4505
4734
|
};
|
|
4735
|
+
var animation$2 = utils.oneWayAnimation('width: 70%;', 'width: 100%');
|
|
4736
|
+
var SuspenseLoadingBar = function SuspenseLoadingBar() {
|
|
4737
|
+
var ref = React__default.useRef();
|
|
4738
|
+
useFlipLeave(ref, animation$2, {
|
|
4739
|
+
reverse: false,
|
|
4740
|
+
timing: animationTiming('0.3s ease-in')
|
|
4741
|
+
});
|
|
4742
|
+
return React__default.createElement(LoadingBar, {
|
|
4743
|
+
ref: ref,
|
|
4744
|
+
loading: true
|
|
4745
|
+
});
|
|
4746
|
+
};
|
|
4506
4747
|
|
|
4507
4748
|
var isNodeJunction = function isNodeJunction(nextNode) {
|
|
4508
4749
|
return nextNode && !nextNode.hasChangedLine && nextNode.words[0] !== '';
|
|
@@ -4805,14 +5046,17 @@ var DEFAULT_ANIMATION = utils.oneWayAnimation("opacity: 1;", "opacity: 0;");
|
|
|
4805
5046
|
var BlockContainer$1 = styled__default.div.withConfig({
|
|
4806
5047
|
displayName: "TransitionDiv__BlockContainer",
|
|
4807
5048
|
componentId: "sc-1sh2xah-0"
|
|
4808
|
-
})(["position:relative;"])
|
|
5049
|
+
})(["", " position:relative;"], function (props) {
|
|
5050
|
+
return props.inline ? 'display: inline-block; ' : '';
|
|
5051
|
+
});
|
|
4809
5052
|
var TransitionDiv = function TransitionDiv(_ref) {
|
|
4810
5053
|
var children = _ref.children,
|
|
4811
5054
|
animation = _ref.animation,
|
|
4812
5055
|
skipChromeFix = _ref.skipChromeFix,
|
|
4813
5056
|
className = _ref.className,
|
|
4814
5057
|
block = _ref.block,
|
|
4815
|
-
|
|
5058
|
+
inline = _ref.inline,
|
|
5059
|
+
rest = _objectWithoutProperties(_ref, ["children", "animation", "skipChromeFix", "className", "block", "inline"]);
|
|
4816
5060
|
|
|
4817
5061
|
var blockRef = React.useRef();
|
|
4818
5062
|
|
|
@@ -4827,18 +5071,21 @@ var TransitionDiv = function TransitionDiv(_ref) {
|
|
|
4827
5071
|
};
|
|
4828
5072
|
|
|
4829
5073
|
var content = children ? React__default.createElement(FlipList, _extends({
|
|
5074
|
+
smallJumpFix: inline && -3,
|
|
4830
5075
|
effect: overflowEffect,
|
|
4831
5076
|
skipChromeFix: skipChromeFix,
|
|
4832
5077
|
animation: animation || DEFAULT_ANIMATION
|
|
4833
5078
|
}, rest), [React__default.createElement("div", {
|
|
4834
|
-
className: block ? "" : className,
|
|
5079
|
+
className: block || inline ? "" : className,
|
|
4835
5080
|
key: "first"
|
|
4836
5081
|
}, children)]) : React__default.createElement(FlipList, _extends({
|
|
5082
|
+
smallJumpFix: inline && -3,
|
|
4837
5083
|
effect: overflowEffect,
|
|
4838
5084
|
skipChromeFix: skipChromeFix,
|
|
4839
5085
|
animation: animation || DEFAULT_ANIMATION
|
|
4840
5086
|
}, rest), []);
|
|
4841
|
-
return block ? React__default.createElement(BlockContainer$1, {
|
|
5087
|
+
return block || inline ? React__default.createElement(BlockContainer$1, {
|
|
5088
|
+
inline: inline,
|
|
4842
5089
|
ref: blockRef,
|
|
4843
5090
|
className: className
|
|
4844
5091
|
}, content) : content;
|
|
@@ -5105,10 +5352,10 @@ var Image = React.forwardRef(function (_ref, ref) {
|
|
|
5105
5352
|
}));
|
|
5106
5353
|
});
|
|
5107
5354
|
|
|
5108
|
-
function _templateObject$
|
|
5355
|
+
function _templateObject$7() {
|
|
5109
5356
|
var data = _taggedTemplateLiteral(["\n @supports (position: sticky) {\n top: 0;\n margin-right: -0.75rem;\n }\n "]);
|
|
5110
5357
|
|
|
5111
|
-
_templateObject$
|
|
5358
|
+
_templateObject$7 = function _templateObject() {
|
|
5112
5359
|
return data;
|
|
5113
5360
|
};
|
|
5114
5361
|
|
|
@@ -5117,7 +5364,7 @@ function _templateObject$6() {
|
|
|
5117
5364
|
var DialogWithImageHeader = styled__default(Dialog).withConfig({
|
|
5118
5365
|
displayName: "DialogWithImageHeader",
|
|
5119
5366
|
componentId: "sc-1f1ry4g-0"
|
|
5120
|
-
})(["max-width:51rem;", "{background:", ";text-shadow:none;color:rgba(120,120,120,1);font-size:20px;box-shadow:rgba(0,0,0,0.2) 0px 1px 3px 0px,rgba(0,0,0,0.05) 0px 0px 0px 1px;width:36px;height:36px;line-height:36px;transition:0.1s ease-out;:hover{background-color:rgb(230,230,230);}:active{background-color:rgb(220,220,220);transition:0s ease-out;}@supports (position:sticky){position:sticky;top:-2.5rem;right:0rem;float:right;margin-right:-1.25rem;margin-top:0.75rem;}", "}"], CloseIcon, utils.getColor('gray240'), utils.media.mobile(_templateObject$
|
|
5367
|
+
})(["max-width:51rem;", "{background:", ";text-shadow:none;color:rgba(120,120,120,1);font-size:20px;box-shadow:rgba(0,0,0,0.2) 0px 1px 3px 0px,rgba(0,0,0,0.05) 0px 0px 0px 1px;width:36px;height:36px;line-height:36px;transition:0.1s ease-out;:hover{background-color:rgb(230,230,230);}:active{background-color:rgb(220,220,220);transition:0s ease-out;}@supports (position:sticky){position:sticky;top:-2.5rem;right:0rem;float:right;margin-right:-1.25rem;margin-top:0.75rem;}", "}"], CloseIcon, utils.getColor('gray240'), utils.media.mobile(_templateObject$7()));
|
|
5121
5368
|
|
|
5122
5369
|
function _templateObject2$5() {
|
|
5123
5370
|
var data = _taggedTemplateLiteral(["\n min-height: 100%;\n overflow: hidden;\n "]);
|
|
@@ -5129,10 +5376,10 @@ function _templateObject2$5() {
|
|
|
5129
5376
|
return data;
|
|
5130
5377
|
}
|
|
5131
5378
|
|
|
5132
|
-
function _templateObject$
|
|
5379
|
+
function _templateObject$8() {
|
|
5133
5380
|
var data = _taggedTemplateLiteral(["\n display:block;\n position:fixed;\n top:0;\n left:0;\n bottom:0;\n z-index:1000;\n transition: 0.25s transform ease-out;\n background-color: ", ";\n box-shadow: -5px 0 20px 5px rgba(0,0,0,0.4);\n border-radius: 0;\n ", "\n "]);
|
|
5134
5381
|
|
|
5135
|
-
_templateObject$
|
|
5382
|
+
_templateObject$8 = function _templateObject() {
|
|
5136
5383
|
return data;
|
|
5137
5384
|
};
|
|
5138
5385
|
|
|
@@ -5143,7 +5390,7 @@ var SideMenu = styled__default.div.withConfig({
|
|
|
5143
5390
|
componentId: "suvg9r-0"
|
|
5144
5391
|
})(["background-color:", ";border-top-left-radius:10px;border-bottom-left-radius:10px;width:19rem;flex-shrink:0;padding:1.25rem 0;", " ", ""], utils.getColor('gray240'), function (props) {
|
|
5145
5392
|
return !props.visibleOnDesktop && 'display:none;';
|
|
5146
|
-
}, utils.media.mobile(_templateObject$
|
|
5393
|
+
}, utils.media.mobile(_templateObject$8(), utils.getColor('gray240'), function (props) {
|
|
5147
5394
|
return !props.isOpen && "\n transform: translateX(-100%);\n box-shadow: none;\n ";
|
|
5148
5395
|
}));
|
|
5149
5396
|
var DialogTabMenu = styled__default.ul.withConfig({
|
|
@@ -5314,6 +5561,7 @@ exports.ListItem = ListItem;
|
|
|
5314
5561
|
exports.ListMenu = ListMenu;
|
|
5315
5562
|
exports.ListSeparator = ListSeparator;
|
|
5316
5563
|
exports.Loading = Loading;
|
|
5564
|
+
exports.LoadingBar = LoadingBar;
|
|
5317
5565
|
exports.LoadingDiv = LoadingDiv;
|
|
5318
5566
|
exports.MENU_TAB = MENU_TAB;
|
|
5319
5567
|
exports.MobileBubbleDialog = MobileBubbleDialog;
|
|
@@ -5321,12 +5569,14 @@ exports.Modal = Modal;
|
|
|
5321
5569
|
exports.ModalContainer = ModalContainer;
|
|
5322
5570
|
exports.Notifications = Notifications;
|
|
5323
5571
|
exports.PageLoader = PageLoader;
|
|
5572
|
+
exports.PersistentNotifications = PersistentNotifications;
|
|
5324
5573
|
exports.Popup = Popup;
|
|
5325
5574
|
exports.Reposition = Reposition;
|
|
5326
5575
|
exports.SideMenu = SideMenu;
|
|
5327
5576
|
exports.SimpleLi = SimpleLi;
|
|
5328
5577
|
exports.SplitColumnsContainer = SplitColumnsContainer;
|
|
5329
5578
|
exports.StickyContainer = StickyContainer;
|
|
5579
|
+
exports.SuspenseLoadingBar = SuspenseLoadingBar;
|
|
5330
5580
|
exports.SwitchDiv = SwitchDiv;
|
|
5331
5581
|
exports.TextButton = TextButton;
|
|
5332
5582
|
exports.Tooltip = Tooltip;
|
|
@@ -5343,6 +5593,7 @@ exports.formatAnimation = formatAnimation;
|
|
|
5343
5593
|
exports.getClientRectAnimation = getClientRectAnimation;
|
|
5344
5594
|
exports.getDialogLayersSize = getDialogLayersSize;
|
|
5345
5595
|
exports.morph = morph;
|
|
5596
|
+
exports.openPersistentNotification = openPersistentNotification;
|
|
5346
5597
|
exports.preventDialogPop = preventDialogPop;
|
|
5347
5598
|
exports.removeWindowScroll = removeWindowScroll;
|
|
5348
5599
|
exports.setNotification = setNotification;
|