@startlibs/components 1.0.0-alpha-7z → 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.
Files changed (2) hide show
  1. package/lib/index.js +332 -42
  2. 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 _without = _interopDefault(require('lodash/fp/without'));
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) {
@@ -290,6 +301,43 @@ Button.Link = function (props) {
290
301
  }));
291
302
  };
292
303
 
304
+ var TextButton = styled__default(function (_ref) {
305
+ var className = _ref.className,
306
+ isLoading = _ref.isLoading,
307
+ children = _ref.children,
308
+ _ref$innerAs = _ref.innerAs,
309
+ Wrapper = _ref$innerAs === void 0 ? 'div' : _ref$innerAs,
310
+ props = _objectWithoutProperties(_ref, ["className", "isLoading", "children", "innerAs"]);
311
+
312
+ return React__default.createElement(Wrapper, _extends({
313
+ className: className
314
+ }, props), children, " ", isLoading && React__default.createElement(Loading, {
315
+ size: 14,
316
+ borderWidth: 3
317
+ }));
318
+ }).withConfig({
319
+ displayName: "TextButton",
320
+ componentId: "sc-1eydmhc-0"
321
+ })(["display:inline-block;font-weight:500;font-size:13px;color:", ";cursor:pointer;text-decoration:none;:hover,:active{color:", ";}", "{display:inline-block;margin-left:0.25rem;vertical-align:-3px;}", ""], utils.getColor('main'), function (props) {
322
+ return polished.darken(0.1, utils.getColor("main")(props));
323
+ }, Loading, function (props) {
324
+ return props.nowrap && "\n white-space: nowrap;\n ";
325
+ });
326
+
327
+ TextButton.a = function (props) {
328
+ return React__default.createElement(TextButton, _extends({}, props, {
329
+ className: props.className,
330
+ innerAs: "a"
331
+ }));
332
+ };
333
+
334
+ TextButton.Link = function (props) {
335
+ return React__default.createElement(TextButton, _extends({}, props, {
336
+ className: props.className,
337
+ innerAs: Link
338
+ }));
339
+ };
340
+
293
341
  var ErrorBoundary =
294
342
  /*#__PURE__*/
295
343
  function (_React$Component) {
@@ -650,7 +698,8 @@ var hasClientRectChanged = function hasClientRectChanged(oldSnap, newSnap) {
650
698
 
651
699
  var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
652
700
  var _ref5 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
653
- skipTransform = _ref5.skipTransform;
701
+ skipTransform = _ref5.skipTransform,
702
+ smallJumpFix = _ref5.smallJumpFix;
654
703
 
655
704
  if (hasClientRectChanged(oldSnap, newSnap)) {
656
705
  var _oldSnap$parentStyle, _newSnap$parentStyle, _oldSnap$parentStyle2, _newSnap$parentStyle2;
@@ -675,17 +724,17 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
675
724
  paddingBottom = _window$getComputedSt4.paddingBottom;
676
725
 
677
726
  finalPadding = 'padding-bottom:' + paddingBottom + ';';
678
- heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom));
727
+ heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom) + (smallJumpFix || 0), ";");
679
728
  }
680
729
 
681
- var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden" : "";
730
+ var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden;" : "";
682
731
  var transform = (left !== 0 || top !== 0) && !skipTransform ? "transform: translate(".concat(left, "px,").concat(top, "px);") : '';
683
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);
684
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);
685
734
  var oldMarginTop = (parseInt(oldSnap.marginTop) || 0) + parentPaddingTopDelta;
686
735
  var oldMarginBottom = (parseInt(oldSnap.marginBottom) || 0) + parentPaddingBottomDelta;
687
736
  var oldTransform = node.style.transform;
688
- 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 "))];
689
738
  } else {
690
739
  return [];
691
740
  }
@@ -1874,15 +1923,17 @@ var DialogContent = styled__default(function (props) {
1874
1923
  }).withConfig({
1875
1924
  displayName: "Dialog__DialogContent",
1876
1925
  componentId: "gai4ey-3"
1877
- })(["outline:none;width:100%;position:relative;min-height:5rem;", " ", " p{font-size:13px;}.expired-date{font-size:12px;color:", ";}"], function (props) {
1926
+ })(["outline:none;width:100%;position:relative;min-height:5rem;", " ", " p{font-size:14px;}"], function (props) {
1878
1927
  return props.icon && styled.css(["padding-right:8rem;min-height:6rem;"]);
1879
1928
  }, function (props) {
1880
1929
  return props.illustration && styled.css(["padding-right:15rem;", ""], utils.media.mobile(_templateObject3$1()));
1881
- }, utils.getColor('alert'));
1930
+ });
1882
1931
  var DialogTitle = styled__default.h2.withConfig({
1883
1932
  displayName: "Dialog__DialogTitle",
1884
1933
  componentId: "gai4ey-4"
1885
- })(["margin-bottom:1rem;padding-bottom:1rem;", ""], utils.media.mobile(_templateObject4()));
1934
+ })(["margin-bottom:1rem;padding-bottom:1rem;", " ", ""], function (props) {
1935
+ return props.fixTitleMargin && "\n padding-bottom: 0;\n ";
1936
+ }, utils.media.mobile(_templateObject4()));
1886
1937
  var DialogFooter = styled__default.div.withConfig({
1887
1938
  displayName: "Dialog__DialogFooter",
1888
1939
  componentId: "gai4ey-5"
@@ -1904,6 +1955,7 @@ var DialogAlwaysVisibleDiv = styled__default.div.withConfig({
1904
1955
  var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef) {
1905
1956
  var className = _ref.className,
1906
1957
  skipWrap = _ref.skipWrap,
1958
+ fixTitleMargin = _ref.fixTitleMargin,
1907
1959
  skipCloseIcon = _ref.skipCloseIcon,
1908
1960
  isLoading = _ref.isLoading,
1909
1961
  footer = _ref.footer,
@@ -1915,7 +1967,7 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
1915
1967
  auxiliarActions = _ref.auxiliarActions,
1916
1968
  _ref$container = _ref.container,
1917
1969
  container = _ref$container === void 0 ? true : _ref$container,
1918
- 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"]);
1919
1971
 
1920
1972
  var ref = core.useEnsureRef(outerRef);
1921
1973
 
@@ -1923,7 +1975,9 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
1923
1975
  return React__default.createElement(React__default.Fragment, null, props.closeDialog && !skipCloseIcon && React__default.createElement(CloseIcon, {
1924
1976
  className: "JS-dialog-close",
1925
1977
  onClick: confirmCloseDialog
1926
- }), title && React__default.createElement(DialogTitle, null, utils.callIfFunction(title)));
1978
+ }), title && React__default.createElement(DialogTitle, {
1979
+ fixTitleMargin: true
1980
+ }, utils.callIfFunction(title)));
1927
1981
  };
1928
1982
 
1929
1983
  var content = React__default.createElement(React__default.Fragment, null, Content && React__default.createElement(DialogContent, {
@@ -2037,6 +2091,10 @@ var useDialogWithToggle = function useDialogWithToggle(dialog) {
2037
2091
  var WarningDialog = styled__default(function (_ref) {
2038
2092
  var content = _ref.content,
2039
2093
  closeDialog = _ref.closeDialog,
2094
+ leftButton = _ref.leftButton,
2095
+ additionalContent = _ref.additionalContent,
2096
+ title = _ref.title,
2097
+ rightButton = _ref.rightButton,
2040
2098
  className = _ref.className,
2041
2099
  _ref$icon = _ref.icon,
2042
2100
  icon = _ref$icon === void 0 ? "warning" : _ref$icon,
@@ -2046,19 +2104,35 @@ var WarningDialog = styled__default(function (_ref) {
2046
2104
  className: className
2047
2105
  }, React__default.createElement(MainIcon, {
2048
2106
  icon: icon
2049
- }), React__default.createElement("p", null, content), React__default.createElement(Button, {
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, {
2050
2112
  highlight: true,
2051
2113
  onClick: closeDialog
2052
- }, confirmLabel));
2114
+ }, confirmLabel), utils.callIfFunction(rightButton, closeDialog));
2053
2115
  }).withConfig({
2054
2116
  displayName: "WarningDialog",
2055
2117
  componentId: "sc-1jw779e-0"
2056
- })(["text-align:center;max-width:36rem;padding:2.5rem;p{font-size:16px;font-weight:500;max-width:27rem;margin:0 auto 2rem;}"]);
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
+ });
2057
2131
  var MainIcon = styled__default(Icon).withConfig({
2058
2132
  displayName: "WarningDialog__MainIcon",
2059
- componentId: "sc-1jw779e-1"
2133
+ componentId: "sc-1jw779e-3"
2060
2134
  })(["color:", ";font-size:46px;display:block;margin-bottom:1.25rem;"], function (props) {
2061
- return props.icon === 'warning' ? utils.getColor('alert') : utils.getColor('main');
2135
+ return props.icon === 'warning' ? utils.getColor('alert') : props.icon === 'success' ? utils.getColor('success') : utils.getColor('main');
2062
2136
  });
2063
2137
  var useWarningDialog = function useWarningDialog() {
2064
2138
  return useDialogWithToggle(function (toggle) {
@@ -2073,8 +2147,12 @@ var _willUseSharedState = core.willUseSharedState(),
2073
2147
  useRenderDefaultWarningDialog = _willUseSharedState2[0],
2074
2148
  _setWarningDialog = _willUseSharedState2[2];
2075
2149
 
2076
- var setWarningDialog = function setWarningDialog(props) {
2077
- return _setWarningDialog(React__default.createElement(WarningDialog, _extends({}, props, {
2150
+ var setWarningDialog = function setWarningDialog(_ref2) {
2151
+ var _ref2$as = _ref2.as,
2152
+ Dialog = _ref2$as === void 0 ? WarningDialog : _ref2$as,
2153
+ props = _objectWithoutProperties(_ref2, ["as"]);
2154
+
2155
+ return _setWarningDialog(React__default.createElement(Dialog, _extends({}, props, {
2078
2156
  closeDialog: function closeDialog() {
2079
2157
  return _setWarningDialog(null);
2080
2158
  }
@@ -2162,6 +2240,81 @@ var FlipNotification = function FlipNotification(props) {
2162
2240
  }, props)));
2163
2241
  };
2164
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
+
2165
2318
  var Placeholder = styled__default.span.withConfig({
2166
2319
  displayName: "usePositioning__Placeholder",
2167
2320
  componentId: "sc-1m4912o-0"
@@ -2572,14 +2725,18 @@ function (_React$Component) {
2572
2725
  return;
2573
2726
  }
2574
2727
 
2575
- morph(oldItem.domNode, formatAnimation(removeAnimation || animation, timing), function () {
2728
+ new Promise(function (res) {
2729
+ morph(oldItem.domNode, formatAnimation(removeAnimation || animation, timing), res);
2730
+ setTimeout(res, 1500);
2731
+ }).then(function () {
2576
2732
  oldItem.domNode.remove();
2577
2733
  });
2578
2734
  });
2579
2735
  }
2580
2736
 
2581
2737
  var rectAnimation = getClientRectAnimation(oldSnap.parent, newSnap.parent, {
2582
- skipTransform: true
2738
+ skipTransform: true,
2739
+ smallJumpFix: _this.props.smallJumpFix
2583
2740
  });
2584
2741
  var endEffect = utils.callIfFunction(effect, newSnap.parent.domNode, {
2585
2742
  newSnap: newSnap,
@@ -4248,9 +4405,9 @@ var _willUseLayers$1 = core.willUseLayers(),
4248
4405
 
4249
4406
  var contextMenuLayersQuantity = contextMenuLayersSize;
4250
4407
 
4251
- var _willUseSharedState$2 = core.willUseSharedState(),
4252
- _willUseSharedState2$2 = _slicedToArray(_willUseSharedState$2, 1),
4253
- useContextMenuSharedState = _willUseSharedState2$2[0];
4408
+ var _willUseSharedState$3 = core.willUseSharedState(),
4409
+ _willUseSharedState2$3 = _slicedToArray(_willUseSharedState$3, 1),
4410
+ useContextMenuSharedState = _willUseSharedState2$3[0];
4254
4411
 
4255
4412
  var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4256
4413
  var children = _ref2.children,
@@ -4373,19 +4530,13 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4373
4530
  e.target.dispatchEvent(new MouseEvent('mousemove', {
4374
4531
  bubbles: true
4375
4532
  }));
4376
- var passedResistance = false;
4377
- return [function (e, nextPos) {
4533
+ return function (e, nextPos) {
4378
4534
  var delta = prevPos.clientY - nextPos.clientY;
4379
4535
 
4380
4536
  if (Math.abs(delta) > 10) {
4381
- passedResistance = true;
4382
4537
  setCursorOnHover(-1);
4383
4538
  }
4384
- }, function (e, finalPos) {
4385
- if (!passedResistance) {
4386
- e.target.click();
4387
- }
4388
- }];
4539
+ };
4389
4540
  });
4390
4541
  return React__default.createElement(ContextListMenu, _extends({
4391
4542
  "data-drag": false,
@@ -4442,10 +4593,126 @@ var ContextMenu = React.forwardRef(function (_ref3, ref) {
4442
4593
  });
4443
4594
  ContextMenu.ListItem = ListItem;
4444
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
+
4445
4712
  var LoadingBar = styled__default.div.withConfig({
4446
4713
  displayName: "PageLoader__LoadingBar",
4447
4714
  componentId: "sc-96jeob-0"
4448
- })(["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) {
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) {
4449
4716
  return props.loading && "\n width: 70%;\n transition: 1.5s width linear;\n ";
4450
4717
  }, function (props) {
4451
4718
  return props.closing && "\n width: 100%;\n transition: 0.3s ease-in;\n ";
@@ -4465,6 +4732,18 @@ var PageLoader = function PageLoader(_ref) {
4465
4732
  closing: loader.closing
4466
4733
  });
4467
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
+ };
4468
4747
 
4469
4748
  var isNodeJunction = function isNodeJunction(nextNode) {
4470
4749
  return nextNode && !nextNode.hasChangedLine && nextNode.words[0] !== '';
@@ -4767,14 +5046,17 @@ var DEFAULT_ANIMATION = utils.oneWayAnimation("opacity: 1;", "opacity: 0;");
4767
5046
  var BlockContainer$1 = styled__default.div.withConfig({
4768
5047
  displayName: "TransitionDiv__BlockContainer",
4769
5048
  componentId: "sc-1sh2xah-0"
4770
- })(["position:relative;"]);
5049
+ })(["", " position:relative;"], function (props) {
5050
+ return props.inline ? 'display: inline-block; ' : '';
5051
+ });
4771
5052
  var TransitionDiv = function TransitionDiv(_ref) {
4772
5053
  var children = _ref.children,
4773
5054
  animation = _ref.animation,
4774
5055
  skipChromeFix = _ref.skipChromeFix,
4775
5056
  className = _ref.className,
4776
5057
  block = _ref.block,
4777
- rest = _objectWithoutProperties(_ref, ["children", "animation", "skipChromeFix", "className", "block"]);
5058
+ inline = _ref.inline,
5059
+ rest = _objectWithoutProperties(_ref, ["children", "animation", "skipChromeFix", "className", "block", "inline"]);
4778
5060
 
4779
5061
  var blockRef = React.useRef();
4780
5062
 
@@ -4789,18 +5071,21 @@ var TransitionDiv = function TransitionDiv(_ref) {
4789
5071
  };
4790
5072
 
4791
5073
  var content = children ? React__default.createElement(FlipList, _extends({
5074
+ smallJumpFix: inline && -3,
4792
5075
  effect: overflowEffect,
4793
5076
  skipChromeFix: skipChromeFix,
4794
5077
  animation: animation || DEFAULT_ANIMATION
4795
5078
  }, rest), [React__default.createElement("div", {
4796
- className: block ? "" : className,
5079
+ className: block || inline ? "" : className,
4797
5080
  key: "first"
4798
5081
  }, children)]) : React__default.createElement(FlipList, _extends({
5082
+ smallJumpFix: inline && -3,
4799
5083
  effect: overflowEffect,
4800
5084
  skipChromeFix: skipChromeFix,
4801
5085
  animation: animation || DEFAULT_ANIMATION
4802
5086
  }, rest), []);
4803
- return block ? React__default.createElement(BlockContainer$1, {
5087
+ return block || inline ? React__default.createElement(BlockContainer$1, {
5088
+ inline: inline,
4804
5089
  ref: blockRef,
4805
5090
  className: className
4806
5091
  }, content) : content;
@@ -5067,10 +5352,10 @@ var Image = React.forwardRef(function (_ref, ref) {
5067
5352
  }));
5068
5353
  });
5069
5354
 
5070
- function _templateObject$6() {
5355
+ function _templateObject$7() {
5071
5356
  var data = _taggedTemplateLiteral(["\n @supports (position: sticky) {\n top: 0;\n margin-right: -0.75rem;\n }\n "]);
5072
5357
 
5073
- _templateObject$6 = function _templateObject() {
5358
+ _templateObject$7 = function _templateObject() {
5074
5359
  return data;
5075
5360
  };
5076
5361
 
@@ -5079,7 +5364,7 @@ function _templateObject$6() {
5079
5364
  var DialogWithImageHeader = styled__default(Dialog).withConfig({
5080
5365
  displayName: "DialogWithImageHeader",
5081
5366
  componentId: "sc-1f1ry4g-0"
5082
- })(["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$6()));
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()));
5083
5368
 
5084
5369
  function _templateObject2$5() {
5085
5370
  var data = _taggedTemplateLiteral(["\n min-height: 100%;\n overflow: hidden;\n "]);
@@ -5091,10 +5376,10 @@ function _templateObject2$5() {
5091
5376
  return data;
5092
5377
  }
5093
5378
 
5094
- function _templateObject$7() {
5379
+ function _templateObject$8() {
5095
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 "]);
5096
5381
 
5097
- _templateObject$7 = function _templateObject() {
5382
+ _templateObject$8 = function _templateObject() {
5098
5383
  return data;
5099
5384
  };
5100
5385
 
@@ -5105,7 +5390,7 @@ var SideMenu = styled__default.div.withConfig({
5105
5390
  componentId: "suvg9r-0"
5106
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) {
5107
5392
  return !props.visibleOnDesktop && 'display:none;';
5108
- }, utils.media.mobile(_templateObject$7(), utils.getColor('gray240'), function (props) {
5393
+ }, utils.media.mobile(_templateObject$8(), utils.getColor('gray240'), function (props) {
5109
5394
  return !props.isOpen && "\n transform: translateX(-100%);\n box-shadow: none;\n ";
5110
5395
  }));
5111
5396
  var DialogTabMenu = styled__default.ul.withConfig({
@@ -5276,6 +5561,7 @@ exports.ListItem = ListItem;
5276
5561
  exports.ListMenu = ListMenu;
5277
5562
  exports.ListSeparator = ListSeparator;
5278
5563
  exports.Loading = Loading;
5564
+ exports.LoadingBar = LoadingBar;
5279
5565
  exports.LoadingDiv = LoadingDiv;
5280
5566
  exports.MENU_TAB = MENU_TAB;
5281
5567
  exports.MobileBubbleDialog = MobileBubbleDialog;
@@ -5283,13 +5569,16 @@ exports.Modal = Modal;
5283
5569
  exports.ModalContainer = ModalContainer;
5284
5570
  exports.Notifications = Notifications;
5285
5571
  exports.PageLoader = PageLoader;
5572
+ exports.PersistentNotifications = PersistentNotifications;
5286
5573
  exports.Popup = Popup;
5287
5574
  exports.Reposition = Reposition;
5288
5575
  exports.SideMenu = SideMenu;
5289
5576
  exports.SimpleLi = SimpleLi;
5290
5577
  exports.SplitColumnsContainer = SplitColumnsContainer;
5291
5578
  exports.StickyContainer = StickyContainer;
5579
+ exports.SuspenseLoadingBar = SuspenseLoadingBar;
5292
5580
  exports.SwitchDiv = SwitchDiv;
5581
+ exports.TextButton = TextButton;
5293
5582
  exports.Tooltip = Tooltip;
5294
5583
  exports.TransitionDiv = TransitionDiv;
5295
5584
  exports.WarningDialog = WarningDialog;
@@ -5304,6 +5593,7 @@ exports.formatAnimation = formatAnimation;
5304
5593
  exports.getClientRectAnimation = getClientRectAnimation;
5305
5594
  exports.getDialogLayersSize = getDialogLayersSize;
5306
5595
  exports.morph = morph;
5596
+ exports.openPersistentNotification = openPersistentNotification;
5307
5597
  exports.preventDialogPop = preventDialogPop;
5308
5598
  exports.removeWindowScroll = removeWindowScroll;
5309
5599
  exports.setNotification = setNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startlibs/components",
3
- "version": "1.0.0-alpha-7z",
3
+ "version": "1.0.0-alpha-8c",
4
4
  "description": "Startlibs Components",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,