@startlibs/components 1.0.0-alpha-8d3 → 1.0.0-alpha-8e

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 +489 -275
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -19,26 +19,26 @@ var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers
19
19
  var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));
20
20
  var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));
21
21
  var reactRouterDom = require('react-router-dom');
22
- var _assign = _interopDefault(require('lodash/fp/assign'));
23
22
  var core = require('@startlibs/core');
24
23
  var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));
24
+ var _assign = _interopDefault(require('lodash/fp/assign'));
25
25
  var _get = _interopDefault(require('lodash/fp/get'));
26
26
  var _objectSpread = _interopDefault(require('@babel/runtime/helpers/objectSpread'));
27
27
  var _uniqueId = _interopDefault(require('lodash/fp/uniqueId'));
28
28
  var _max = _interopDefault(require('lodash/fp/max'));
29
29
  var _identity = _interopDefault(require('lodash/fp/identity'));
30
30
  var _isString = _interopDefault(require('lodash/fp/isString'));
31
+ var _without = _interopDefault(require('lodash/fp/without'));
31
32
  var _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));
32
33
  var _isObject = _interopDefault(require('lodash/fp/isObject'));
33
- var _without = _interopDefault(require('lodash/fp/without'));
34
34
  require('@startlibs/components');
35
35
  var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
36
+ var _isFunction = _interopDefault(require('lodash/fp/isFunction'));
36
37
  var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));
37
38
  var _set = _interopDefault(require('lodash/fp/set'));
38
39
  var _pullAt = _interopDefault(require('lodash/fp/pullAt'));
39
40
  var _map = _interopDefault(require('lodash/fp/map'));
40
41
  var ReactDOM = _interopDefault(require('react-dom'));
41
- var _isFunction = _interopDefault(require('lodash/fp/isFunction'));
42
42
  var reactIs = require('react-is');
43
43
  var mitt = _interopDefault(require('mitt'));
44
44
  require('lodash/fp');
@@ -113,7 +113,9 @@ var Icon = styled__default(styled.withTheme(IconComponent)).withConfig({
113
113
  displayName: "Icon",
114
114
  componentId: "wsq54u-0"
115
115
  })(["font-family:'", "' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;", ""], function (props) {
116
- return props.theme.iconFont;
116
+ var _props$theme;
117
+
118
+ return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.iconFont;
117
119
  }, function (props) {
118
120
  return props.clickable && "\n cursor: pointer;\n &:hover {\n opacity: 0.85;\n }\n ";
119
121
  });
@@ -123,8 +125,8 @@ var Link = reactRouterDom.Link;
123
125
  var Loading = styled__default.div.withConfig({
124
126
  displayName: "Loading",
125
127
  componentId: "sc-5t5spc-0"
126
- })(["z-index:1;", " border-style:solid;border-radius:50%;flex-shrink:0;width:", "px;height:", "px;border-width:", "px;animation:spin 1s linear infinite;", " @keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"], function (props) {
127
- return props.white ? "\n border-color: rgba(255,255,255,0.4);\n border-top-color: ".concat(props.color || 'rgba(255,255,255,0.9)', ";\n ") : "\n border-color: rgba(0,0,0,0.1);\n border-top-color: ".concat(props.color || props.theme.colors.main, ";\n ");
128
+ })(["z-index:1;", " border-style:solid;border-radius:50%;flex-shrink:0;width:", "px;height:", "px;border-width:", "px;animation:spin 0.6s linear infinite;", " @keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"], function (props) {
129
+ return props.white ? styled.css(["border-color:rgba(255,255,255,0.4);border-top-color:", ";"], props.color || 'rgba(255,255,255,0.9)') : styled.css(["border-color:rgba(0,0,0,0.1);border-color:", ";border-top-color:", ";"], props.color ? polished.transparentize(0.85, props.color) : polished.transparentize(0.85, utils.getColor("main")(props)), props.color || utils.getColor("main"));
128
130
  }, function (props) {
129
131
  return props.size || 26;
130
132
  }, function (props) {
@@ -180,6 +182,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
180
182
  alpha = _ref.alpha,
181
183
  success = _ref.success,
182
184
  alert = _ref.alert,
185
+ warning = _ref.warning,
183
186
  highlight = _ref.highlight,
184
187
  light = _ref.light,
185
188
  hover = _ref.hover,
@@ -193,6 +196,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
193
196
  dashed = _ref.dashed,
194
197
  textOnly = _ref.textOnly,
195
198
  isLoading = _ref.isLoading,
199
+ isLoadingIcon = _ref.isLoadingIcon,
196
200
  dark = _ref.dark,
197
201
  _ref$innerAs = _ref.innerAs,
198
202
  Wrapper = _ref$innerAs === void 0 ? 'button' : _ref$innerAs,
@@ -207,7 +211,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
207
211
  concealed = _ref.concealed,
208
212
  concealedModule = _ref.concealedModule,
209
213
  buttonRef = _ref.buttonRef,
210
- props = _objectWithoutProperties(_ref, ["type", "locked", "color", "alpha", "success", "alert", "highlight", "light", "hover", "white", "icon", "onlyIcon", "small", "withDropdown", "onlyDropdown", "outline", "dashed", "textOnly", "isLoading", "dark", "innerAs", "className", "children", "rounded", "tabIndex", "focused", "noFocus", "colorSet", "concealed", "concealedModule", "buttonRef"]);
214
+ props = _objectWithoutProperties(_ref, ["type", "locked", "color", "alpha", "success", "alert", "warning", "highlight", "light", "hover", "white", "icon", "onlyIcon", "small", "withDropdown", "onlyDropdown", "outline", "dashed", "textOnly", "isLoading", "isLoadingIcon", "dark", "innerAs", "className", "children", "rounded", "tabIndex", "focused", "noFocus", "colorSet", "concealed", "concealedModule", "buttonRef"]);
211
215
 
212
216
  return React__default.createElement(Wrapper, _extends({
213
217
  ref: ref || buttonRef,
@@ -216,12 +220,16 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
216
220
  type: Wrapper === 'button' ? type : ''
217
221
  }, props), icon && React__default.createElement(Icon, {
218
222
  icon: icon
223
+ }), isLoadingIcon && React__default.createElement(Loading, {
224
+ white: !light && !outline && !dashed && !white,
225
+ size: small ? '10' : '18',
226
+ borderWidth: small ? '2' : '3'
219
227
  }), (withDropdown || onlyDropdown) && !locked && React__default.createElement(DropdownIcon, {
220
228
  icon: "arrow-down"
221
229
  }), locked && React__default.createElement(LockIcon, {
222
230
  icon: "lock"
223
231
  }), children, isLoading && React__default.createElement(Loading, {
224
- white: !outline || !dashed || !white,
232
+ white: !light && !outline && !dashed && !white,
225
233
  absolute: true,
226
234
  size: small && '16',
227
235
  borderWidth: small && '3'
@@ -229,7 +237,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
229
237
  })).withConfig({
230
238
  displayName: "Button",
231
239
  componentId: "qe54pl-1"
232
- })(["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) {
240
+ })(["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) {
233
241
  return props.rounded ? '100px' : '6px';
234
242
  }, utils.getColor, function (props) {
235
243
  return polished.darken(0.05, utils.getColor(props, true));
@@ -241,12 +249,20 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
241
249
  return !props.noFocus && !props.isLoading && styled.css([":focus{", "}", ""], focus, function (props) {
242
250
  return props.focused && focus;
243
251
  });
252
+ }, function (props) {
253
+ return props.hasErrors && styled.css([":after{content:'';pointer-events:none;position:absolute;top:-4px;right:-4px;left:-4px;bottom:-4px;border-radius:", ";border:3px solid ", ";}"], function (props) {
254
+ return props.rounded ? '100px' : '9px';
255
+ }, function (props) {
256
+ return polished.transparentize(0.7, utils.getColor("alert")(props));
257
+ });
244
258
  }, function (props) {
245
259
  return props.icon && styled.css(["display:inline-flex;align-items:center;justify-content:center;min-width:3rem;min-height:3rem;", "{font-size:23px;margin-right:8px;margin-left:-4px;pointer-events:none;line-height:0;}"], Icon);
246
260
  }, function (props) {
247
261
  return props.onlyIcon && styled.css(["padding:0;", "{margin:0;}"], Icon);
248
262
  }, function (props) {
249
263
  return props.small && styled.css(["font-size:12px;padding:4px 1rem;min-width:2rem;min-height:2rem;", " ", ""], props.icon && styled.css(["", "{font-size:18px;margin-right:5px;margin-left:-5px;line-height:0.9;}"], Icon), props.onlyIcon && styled.css(["padding:0;", "{margin:0;}"], Icon));
264
+ }, function (props) {
265
+ return props.big && styled.css(["font-size:14px;padding:13px 1.75rem;min-height:42px;"]);
250
266
  }, function (props) {
251
267
  return props.withDropdown && styled.css(["padding-right:2.25rem;text-align:left;"]);
252
268
  }, function (props) {
@@ -265,6 +281,16 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
265
281
  }, function (props) {
266
282
  return polished.transparentize(0.82, utils.getColor("alert")(props));
267
283
  });
284
+ }, function (props) {
285
+ return props.lightWarning && styled.css(["background:", ";color:", ";:hover{background:", ";}:active{background:", ";}"], function (props) {
286
+ return polished.transparentize(0.84, polished.darken(0.05, utils.getColor('warning')(props)));
287
+ }, function (props) {
288
+ return polished.darken(0.05, utils.getColor('warning')(props));
289
+ }, function (props) {
290
+ return polished.transparentize(0.78, polished.darken(0.05, utils.getColor('warning')(props)));
291
+ }, function (props) {
292
+ return polished.transparentize(0.76, polished.darken(0.05, utils.getColor('warning')(props)));
293
+ });
268
294
  }, function (props) {
269
295
  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;');
270
296
  }, function (props) {
@@ -273,6 +299,8 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
273
299
  return props.white && !props.outline && !props.dashed && styled.css(["color:", ";background:#FFFFFF;:hover{background:", ";}:active{background:", ";}"], utils.getColor('main'), polished.darken(0.05, '#FFFFFF'), polished.darken(0.08, '#FFFFFF'));
274
300
  }, function (props) {
275
301
  return props.isLoading && styled.css(["color:transparent !important;pointer-events:none;", "{visibility:hidden;}"], Icon);
302
+ }, function (props) {
303
+ return props.isLoadingIcon && styled.css(["pointer-events:none;", "{visibility:hidden;}", "{left:10px;position:absolute;}"], Icon, Loading);
276
304
  }, utils.media.mobile(_templateObject2(), function (props) {
277
305
  return !props.small && !props.onlyIcon && styled.css(["padding:13px 1.5rem;font-size:13px;"]);
278
306
  }, function (props) {
@@ -299,13 +327,29 @@ Button.Link = function (props) {
299
327
  }));
300
328
  };
301
329
 
330
+ var OnClickLoadingButton = function OnClickLoadingButton(_ref) {
331
+ var _onClick = _ref.onClick,
332
+ children = _ref.children,
333
+ props = _objectWithoutProperties(_ref, ["onClick", "children"]);
334
+
335
+ var loading = core.useToggle();
336
+ return React__default.createElement(Button, _extends({
337
+ isLoading: loading.isOpen
338
+ }, props, {
339
+ onClick: function onClick(e) {
340
+ return loading.wait(_onClick(e));
341
+ }
342
+ }), children);
343
+ };
344
+
302
345
  var TextButton = styled__default(function (_ref) {
303
346
  var className = _ref.className,
304
347
  isLoading = _ref.isLoading,
348
+ alert = _ref.alert,
305
349
  children = _ref.children,
306
350
  _ref$innerAs = _ref.innerAs,
307
351
  Wrapper = _ref$innerAs === void 0 ? 'div' : _ref$innerAs,
308
- props = _objectWithoutProperties(_ref, ["className", "isLoading", "children", "innerAs"]);
352
+ props = _objectWithoutProperties(_ref, ["className", "isLoading", "alert", "children", "innerAs"]);
309
353
 
310
354
  return React__default.createElement(Wrapper, _extends({
311
355
  className: className
@@ -316,8 +360,10 @@ var TextButton = styled__default(function (_ref) {
316
360
  }).withConfig({
317
361
  displayName: "TextButton",
318
362
  componentId: "sc-1eydmhc-0"
319
- })(["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) {
320
- return polished.darken(0.1, utils.getColor("main")(props));
363
+ })(["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;}", " & ~ &{margin-left:1rem;}"], function (props) {
364
+ return props.alert ? utils.getColor('alert') : utils.getColor('main');
365
+ }, function (props) {
366
+ return props.alert ? polished.darken(0.1, utils.getColor("alert")(props)) : polished.darken(0.1, utils.getColor("main")(props));
321
367
  }, Loading, function (props) {
322
368
  return props.nowrap && "\n white-space: nowrap;\n ";
323
369
  });
@@ -385,10 +431,12 @@ function (_React$Component) {
385
431
  error = e.toString();
386
432
  }
387
433
 
388
- utils.postFetcher("/log/errorBoundary", {
389
- error: error,
390
- info: info
391
- });
434
+ if (!/bot|spider|crawl/i.test(window.navigator.userAgent)) {
435
+ utils.postFetcher("/log/errorBoundary", {
436
+ error: error,
437
+ info: info
438
+ });
439
+ }
392
440
  }
393
441
  }, {
394
442
  key: "render",
@@ -699,7 +747,7 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
699
747
  skipTransform = _ref5.skipTransform,
700
748
  smallJumpFix = _ref5.smallJumpFix;
701
749
 
702
- if (hasClientRectChanged(oldSnap, newSnap)) {
750
+ if (oldSnap && newSnap && hasClientRectChanged(oldSnap, newSnap)) {
703
751
  var _oldSnap$parentStyle, _newSnap$parentStyle, _oldSnap$parentStyle2, _newSnap$parentStyle2;
704
752
 
705
753
  var node = newSnap.domNode;
@@ -1293,7 +1341,11 @@ var fixPosition = function fixPosition(query, fn) {
1293
1341
  };
1294
1342
 
1295
1343
  var openLayers = 0;
1296
- var removeWindowScroll = function removeWindowScroll(opening) {
1344
+ var fakedScrollTop = 0;
1345
+ var isFakeScrolled = function isFakeScrolled() {
1346
+ return openLayers > 0 && fakedScrollTop > 0;
1347
+ };
1348
+ var removeWindowScroll = function removeWindowScroll(opening, keepDisabledScroll) {
1297
1349
  if (opening) {
1298
1350
  openLayers = Math.max(openLayers + 1, 1);
1299
1351
 
@@ -1311,6 +1363,11 @@ var removeWindowScroll = function removeWindowScroll(opening) {
1311
1363
  var finishReset = function finishReset(marginRight, scrollTop) {
1312
1364
  // body.style.paddingRight = marginRight + 'px'
1313
1365
  window.scroll(window.scrollLeft || window.scrollX || 0, scrollTop);
1366
+
1367
+ if (keepDisabledScroll) {
1368
+ return;
1369
+ }
1370
+
1314
1371
  fixPosition('.navbar,.JS-fix-dialog-scroll', function (n) {
1315
1372
  if (opening) {
1316
1373
  var _window$getComputedSt = window.getComputedStyle(n),
@@ -1342,15 +1399,29 @@ var removeWindowScroll = function removeWindowScroll(opening) {
1342
1399
 
1343
1400
  if (opening) {
1344
1401
  var scrollTop = window.pageYOffset;
1345
- body.style.overflow = 'hidden';
1402
+ fakedScrollTop = scrollTop;
1403
+
1404
+ if (keepDisabledScroll) {
1405
+ body.style.overflowY = 'scroll';
1406
+ } else {
1407
+ body.style.overflow = 'hidden';
1408
+ }
1409
+
1346
1410
  var marginRight = body.offsetWidth - bodyWidth;
1347
1411
  body.style.position = 'fixed';
1348
1412
  body.style.top = -scrollTop + "px";
1349
1413
  body.style.left = '0';
1350
- body.style.right = marginRight + 'px';
1414
+
1415
+ if (!keepDisabledScroll) {
1416
+ body.style.right = marginRight + 'px';
1417
+ } else {
1418
+ body.style.right = '0';
1419
+ }
1420
+
1351
1421
  finishReset(marginRight, scrollTop);
1352
1422
  } else {
1353
- // setTimeout(() => {
1423
+ fakedScrollTop = 0; // setTimeout(() => {
1424
+
1354
1425
  var _scrollTop = parseInt(body.style.top);
1355
1426
 
1356
1427
  body.style.overflow = '';
@@ -1530,9 +1601,9 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1530
1601
  };
1531
1602
 
1532
1603
  var checkKey = function checkKey(e) {
1533
- var _e$target, _e$target$className;
1604
+ var _e$target, _e$target$className, _e$target2;
1534
1605
 
1535
- if (!isTop() || skipKeys || ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$className = _e$target.className) === null || _e$target$className === void 0 ? void 0 : _e$target$className.indexOf("JS-dialog-skip-evts")) >= 0) return;
1606
+ if (!isTop() || skipKeys || ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$className = _e$target.className) === null || _e$target$className === void 0 ? void 0 : _e$target$className.indexOf("JS-dialog-skip-evts")) >= 0 || ((_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.closest(".JS-dialog-skip-evts"))) return;
1536
1607
 
1537
1608
  if (modal.current && e.shiftKey && e.keyCode === 9 && modal.current.querySelector('[tabindex]') === document.activeElement) {
1538
1609
  e.preventDefault();
@@ -1727,7 +1798,7 @@ var fixDoubledLastMarginBottom = function fixDoubledLastMarginBottom(children) {
1727
1798
  return processChild(children, 0);
1728
1799
  }
1729
1800
 
1730
- while (!children[last] || children[last] && children[last].type && children[last].type.displayName === "Errors") {
1801
+ while ((!children[last] || children[last] && children[last].type && children[last].type.displayName === "Errors") && last > 0) {
1731
1802
  last--;
1732
1803
  }
1733
1804
 
@@ -1819,9 +1890,193 @@ var LoadingDiv = function LoadingDiv(_ref2) {
1819
1890
  }, children) : children);
1820
1891
  };
1821
1892
 
1822
- function _templateObject8() {
1893
+ var TOP_TRIGGER = function TOP_TRIGGER(posInfo, refInfo) {
1894
+ // Started sticking.
1895
+ if (posInfo.bottom < refInfo.top) {
1896
+ return true;
1897
+ } // Stopped sticking.
1898
+
1899
+
1900
+ if (posInfo.bottom >= refInfo.top && posInfo.bottom < refInfo.bottom) {
1901
+ return false;
1902
+ }
1903
+ };
1904
+
1905
+ var BOTTOM_TRIGGER = function BOTTOM_TRIGGER(posInfo, refInfo) {
1906
+ // Started sticking.
1907
+ if (posInfo.top > refInfo.bottom) {
1908
+ return true;
1909
+ }
1910
+
1911
+ if (posInfo.top <= refInfo.bottom && posInfo.top > refInfo.top) {
1912
+ return false;
1913
+ }
1914
+ };
1915
+
1916
+ var SentinelStyle = styled__default.div.withConfig({
1917
+ displayName: "willUseIsSticky__SentinelStyle",
1918
+ componentId: "sc-1nsyca-0"
1919
+ })(["position:absolute;visibility:hidden;height:1px;width:1px;", ""], function (props) {
1920
+ return props.addCss;
1921
+ });
1922
+ var willUseIsSticky = function willUseIsSticky() {
1923
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1924
+
1925
+ var _willUseSharedCallbac = core.willUseSharedCallback(),
1926
+ _willUseSharedCallbac2 = _slicedToArray(_willUseSharedCallbac, 2),
1927
+ useRegister = _willUseSharedCallbac2[0],
1928
+ onChange = _willUseSharedCallbac2[1];
1929
+
1930
+ var _willUseSharedState = core.willUseSharedState(),
1931
+ _willUseSharedState2 = _slicedToArray(_willUseSharedState, 3),
1932
+ useSharedIsSticky = _willUseSharedState2[0],
1933
+ setSharedIsSticky = _willUseSharedState2[2];
1934
+
1935
+ var createObserver = function createObserver(root) {
1936
+ return window.IntersectionObserver ? new window.IntersectionObserver(function (records, observer) {
1937
+ var _iteratorNormalCompletion = true;
1938
+ var _didIteratorError = false;
1939
+ var _iteratorError = undefined;
1940
+
1941
+ try {
1942
+ for (var _iterator = records[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1943
+ var record = _step.value;
1944
+ var targetInfo = record.boundingClientRect;
1945
+ var rootBoundsInfo = record.rootBounds;
1946
+
1947
+ if (!rootBoundsInfo) {
1948
+ return;
1949
+ }
1950
+
1951
+ onChange(targetInfo, rootBoundsInfo, record.target, record.isIntersecting);
1952
+ }
1953
+ } catch (err) {
1954
+ _didIteratorError = true;
1955
+ _iteratorError = err;
1956
+ } finally {
1957
+ try {
1958
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1959
+ _iterator.return();
1960
+ }
1961
+ } finally {
1962
+ if (_didIteratorError) {
1963
+ throw _iteratorError;
1964
+ }
1965
+ }
1966
+ }
1967
+ }, _objectSpread({
1968
+ root: root
1969
+ }, options)) : {
1970
+ observe: _identity,
1971
+ unobserve: _identity
1972
+ };
1973
+ };
1974
+
1975
+ var observerMap = new Map();
1976
+
1977
+ var getObserver = function getObserver() {
1978
+ var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1979
+ var result = observerMap.get(root);
1980
+
1981
+ if (result) {
1982
+ return result;
1983
+ }
1984
+
1985
+ var observer = createObserver(root);
1986
+ observerMap.set(root, observer);
1987
+ return observer;
1988
+ };
1989
+
1990
+ var activeObserved = [];
1991
+
1992
+ var resetObservers = function resetObservers() {
1993
+ var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1994
+ var observer = getObserver(root);
1995
+ activeObserved.forEach(function (observed) {
1996
+ observer.unobserve(observed);
1997
+ observer.observe(observed);
1998
+ });
1999
+ };
2000
+
2001
+ var WithIsSticky = React__default.forwardRef(function (_ref, ref) {
2002
+ var className = _ref.className,
2003
+ id = _ref.id,
2004
+ css = _ref.css,
2005
+ children = _ref.children,
2006
+ bottom = _ref.bottom,
2007
+ root = _ref.root,
2008
+ intersection = _ref.intersection,
2009
+ onChange = _ref.onChange;
2010
+ var ensuredRef = core.useEnsureRef(ref);
2011
+
2012
+ var _useState = React.useState(false),
2013
+ _useState2 = _slicedToArray(_useState, 2),
2014
+ isSticky = _useState2[0],
2015
+ setIsSticky = _useState2[1];
2016
+
2017
+ useRegister(function (posInfo, refInfo, target, isIntersecting) {
2018
+ if (ensuredRef.current === target) {
2019
+ var value = intersection ? isIntersecting : bottom ? BOTTOM_TRIGGER(posInfo, refInfo) : TOP_TRIGGER(posInfo, refInfo);
2020
+
2021
+ if (value !== undefined) {
2022
+ setIsSticky(value);
2023
+ utils.callIfFunction(onChange, value);
2024
+
2025
+ if (!id) {
2026
+ setSharedIsSticky(value);
2027
+ } else if (value) {
2028
+ setSharedIsSticky(id);
2029
+ }
2030
+ }
2031
+ }
2032
+ });
2033
+ React.useEffect(function () {
2034
+ setIsSticky(false);
2035
+ getObserver(utils.callIfFunction(root)).observe(ensuredRef.current);
2036
+ activeObserved = activeObserved.concat(ensuredRef.current);
2037
+ return function () {
2038
+ // observer.unobserve(ref.current)
2039
+ activeObserved = _without([ensuredRef.current], activeObserved);
2040
+ };
2041
+ }, []);
2042
+
2043
+ var renderSentinel = function renderSentinel() {
2044
+ var css = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2045
+ return React__default.createElement(SentinelStyle, {
2046
+ addCss: css,
2047
+ className: className,
2048
+ ref: ensuredRef
2049
+ });
2050
+ };
2051
+
2052
+ return children ? children(renderSentinel, isSticky) : renderSentinel(css);
2053
+ });
2054
+ return [WithIsSticky, useSharedIsSticky, resetObservers];
2055
+ };
2056
+
2057
+ function _templateObject10() {
1823
2058
  var data = _taggedTemplateLiteral(["\n padding: 1.5rem 1.5rem 1.5rem;\n max-width: 100%;\n ", ";\n "]);
1824
2059
 
2060
+ _templateObject10 = function _templateObject10() {
2061
+ return data;
2062
+ };
2063
+
2064
+ return data;
2065
+ }
2066
+
2067
+ function _templateObject9() {
2068
+ var data = _taggedTemplateLiteral(["\n padding: 1.5rem 1.5rem 0;\n margin: -1.5rem;\n "]);
2069
+
2070
+ _templateObject9 = function _templateObject9() {
2071
+ return data;
2072
+ };
2073
+
2074
+ return data;
2075
+ }
2076
+
2077
+ function _templateObject8() {
2078
+ var data = _taggedTemplateLiteral(["\n padding: 1.5rem;\n margin: -1.5rem;\n "]);
2079
+
1825
2080
  _templateObject8 = function _templateObject8() {
1826
2081
  return data;
1827
2082
  };
@@ -1830,7 +2085,7 @@ function _templateObject8() {
1830
2085
  }
1831
2086
 
1832
2087
  function _templateObject7() {
1833
- var data = _taggedTemplateLiteral(["\n padding: 1.5rem 1.5rem 0;\n margin: -1.5rem;\n "]);
2088
+ var data = _taggedTemplateLiteral(["\n ", " {\n min-width: unset;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n "]);
1834
2089
 
1835
2090
  _templateObject7 = function _templateObject7() {
1836
2091
  return data;
@@ -1840,7 +2095,7 @@ function _templateObject7() {
1840
2095
  }
1841
2096
 
1842
2097
  function _templateObject6() {
1843
- var data = _taggedTemplateLiteral(["\n padding: 1.5rem;\n margin: -1.5rem;\n "]);
2098
+ var data = _taggedTemplateLiteral(["\n bottom: -0.5rem;\n padding: 0.75rem 1.5rem;\n margin-bottom: -0.75rem;\n margin-left: -1.5rem;\n margin-right: -1.5rem;\n "]);
1844
2099
 
1845
2100
  _templateObject6 = function _templateObject6() {
1846
2101
  return data;
@@ -1850,7 +2105,7 @@ function _templateObject6() {
1850
2105
  }
1851
2106
 
1852
2107
  function _templateObject5() {
1853
- var data = _taggedTemplateLiteral(["\n ", " {\n min-width: unset;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n "]);
2108
+ var data = _taggedTemplateLiteral(["\n bottom: -3rem;\n margin-left: -2rem;\n margin-right: -2rem;\n margin-bottom: -1rem;\n padding: 1rem 2rem;\n "]);
1854
2109
 
1855
2110
  _templateObject5 = function _templateObject5() {
1856
2111
  return data;
@@ -1935,7 +2190,11 @@ var DialogTitle = styled__default.h2.withConfig({
1935
2190
  var DialogFooter = styled__default.div.withConfig({
1936
2191
  displayName: "Dialog__DialogFooter",
1937
2192
  componentId: "gai4ey-5"
1938
- })(["width:100%;display:block;padding-top:1rem;margin-top:1rem;align-items:stretch;text-align:right;", ""], utils.media.max(370)(_templateObject5(), Button));
2193
+ })(["display:block;padding-top:1rem;margin-top:1rem;align-items:stretch;text-align:right;", " ", ""], function (props) {
2194
+ return props.sticky && styled.css(["position:sticky;background:white;width:inherit;z-index:50;", " ", " ", ""], utils.media.desktop(_templateObject5()), utils.media.mobile(_templateObject6()), function (props) {
2195
+ return props.isSticky && "\n box-shadow: 0 0px 2px 0 rgba(0,0,0,0.1), 0 0px 5px 1px rgba(0,0,0,0.15);\n ";
2196
+ });
2197
+ }, utils.media.max(370)(_templateObject7(), Button));
1939
2198
  var FooterAuxiliaryContainer = styled__default.div.withConfig({
1940
2199
  displayName: "Dialog__FooterAuxiliaryContainer",
1941
2200
  componentId: "gai4ey-6"
@@ -1944,15 +2203,16 @@ var FooterAuxiliaryContainer = styled__default.div.withConfig({
1944
2203
  var DialogContentWrapper = styled__default(LoadingDiv).withConfig({
1945
2204
  displayName: "Dialog__DialogContentWrapper",
1946
2205
  componentId: "gai4ey-7"
1947
- })(["padding:2rem;margin:-2rem;", ""], utils.media.mobile(_templateObject6()));
2206
+ })(["padding:2rem;margin:-2rem;", ""], utils.media.mobile(_templateObject8()));
1948
2207
  var DialogAlwaysVisibleDiv = styled__default.div.withConfig({
1949
2208
  displayName: "Dialog__DialogAlwaysVisibleDiv",
1950
2209
  componentId: "gai4ey-8"
1951
- })(["padding:2rem 2rem 0;margin:-2rem;", ""], utils.media.mobile(_templateObject7())); // END
2210
+ })(["padding:2rem 2rem 0;margin:-2rem;", ""], utils.media.mobile(_templateObject9())); // END
1952
2211
 
1953
2212
  var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef) {
1954
2213
  var className = _ref.className,
1955
2214
  skipWrap = _ref.skipWrap,
2215
+ stickyFooter = _ref.stickyFooter,
1956
2216
  fixTitleMargin = _ref.fixTitleMargin,
1957
2217
  skipCloseIcon = _ref.skipCloseIcon,
1958
2218
  isLoading = _ref.isLoading,
@@ -1965,10 +2225,14 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
1965
2225
  auxiliarActions = _ref.auxiliarActions,
1966
2226
  _ref$container = _ref.container,
1967
2227
  container = _ref$container === void 0 ? true : _ref$container,
1968
- props = _objectWithoutProperties(_ref, ["className", "skipWrap", "fixTitleMargin", "skipCloseIcon", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
2228
+ props = _objectWithoutProperties(_ref, ["className", "skipWrap", "stickyFooter", "fixTitleMargin", "skipCloseIcon", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
1969
2229
 
1970
2230
  var ref = core.useEnsureRef(outerRef);
1971
2231
 
2232
+ var _willUseIsSticky = willUseIsSticky(),
2233
+ _willUseIsSticky2 = _slicedToArray(_willUseIsSticky, 1),
2234
+ WithIsSticky = _willUseIsSticky2[0];
2235
+
1972
2236
  var alwaysVisible = function alwaysVisible(confirmCloseDialog) {
1973
2237
  return React__default.createElement(React__default.Fragment, null, props.closeDialog && !skipCloseIcon && React__default.createElement(CloseIcon, {
1974
2238
  className: "JS-dialog-close",
@@ -1984,7 +2248,14 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
1984
2248
  }, utils.callIfFunction(Content)), !Content && children && React__default.createElement(DialogContent, {
1985
2249
  icon: icon,
1986
2250
  illustration: illustration
1987
- }, utils.callIfFunction(children)), Content && children && utils.callIfFunction(children), footer && React__default.createElement(DialogFooter, null, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer)));
2251
+ }, utils.callIfFunction(children)), Content && children && utils.callIfFunction(children), footer && React__default.createElement(WithIsSticky, {
2252
+ bottom: true
2253
+ }, function (sentinel, isSticky) {
2254
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(DialogFooter, {
2255
+ isSticky: isSticky,
2256
+ sticky: stickyFooter
2257
+ }, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer)), sentinel());
2258
+ }));
1988
2259
 
1989
2260
  var dialog = function dialog(confirmCloseDialog) {
1990
2261
  return React__default.createElement("div", {
@@ -2006,7 +2277,7 @@ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef)
2006
2277
  })).withConfig({
2007
2278
  displayName: "Dialog",
2008
2279
  componentId: "gai4ey-9"
2009
- })(["@supports (position:sticky){will-change:transform,opacity;&.JS-wc-off{will-change:auto;}}border-radius:12px;padding:2rem;background-color:white;width:100%;max-width:45rem;margin:auto;position:relative;align-self:baseline;display:block;> h3:first-child{margin-top:0.5rem;}p{line-height:140%;}", " ", " ", ""], utils.media.mobile(_templateObject8(), function (props) {
2280
+ })(["@supports (position:sticky){will-change:transform,opacity;&.JS-wc-off{will-change:auto;}}border-radius:12px;padding:2rem;background-color:white;width:100%;max-width:45rem;margin:auto;position:relative;align-self:baseline;display:block;> h3:first-child{margin-top:0.5rem;}p{line-height:140%;}", " ", " ", ""], utils.media.mobile(_templateObject10(), function (props) {
2010
2281
  return props.fullscreenOnMobile && "\n border-radius: 0;\n min-height: 100%;\n ";
2011
2282
  }), function (props) {
2012
2283
  return props.closeDialog && styled.css(["", "{padding-right:2rem;}"], DialogTitle);
@@ -2088,49 +2359,58 @@ var useDialogWithToggle = function useDialogWithToggle(dialog) {
2088
2359
 
2089
2360
  var WarningDialog = styled__default(function (_ref) {
2090
2361
  var content = _ref.content,
2362
+ footer = _ref.footer,
2363
+ withX = _ref.withX,
2091
2364
  closeDialog = _ref.closeDialog,
2092
2365
  leftButton = _ref.leftButton,
2093
2366
  additionalContent = _ref.additionalContent,
2094
2367
  title = _ref.title,
2095
2368
  rightButton = _ref.rightButton,
2096
2369
  className = _ref.className,
2370
+ color = _ref.color,
2097
2371
  _ref$icon = _ref.icon,
2098
2372
  icon = _ref$icon === void 0 ? "warning" : _ref$icon,
2099
2373
  _ref$confirmLabel = _ref.confirmLabel,
2100
- confirmLabel = _ref$confirmLabel === void 0 ? "Entendi" : _ref$confirmLabel;
2374
+ confirmLabel = _ref$confirmLabel === void 0 ? "Entendi" : _ref$confirmLabel,
2375
+ noActions = _ref.noActions,
2376
+ children = _ref.children;
2101
2377
  return React__default.createElement(Dialog, {
2102
- className: className
2103
- }, React__default.createElement(MainIcon, {
2378
+ className: className,
2379
+ closeDialog: withX && closeDialog
2380
+ }, _isString(icon) ? React__default.createElement(WarningDialogIcon, {
2104
2381
  icon: icon
2105
- }), title && React__default.createElement(Title, {
2106
- color: icon
2382
+ }) : icon, title && React__default.createElement(WarningDialogTitle, {
2383
+ color: color || icon
2107
2384
  }, title), content && React__default.createElement(Content, {
2108
- noTitle: !title
2385
+ noTitle: !title,
2386
+ noActions: noActions
2109
2387
  }, content), additionalContent, utils.callIfFunction(leftButton, closeDialog), confirmLabel !== false && React__default.createElement(Button, {
2110
2388
  highlight: true,
2111
2389
  onClick: closeDialog
2112
- }, confirmLabel), utils.callIfFunction(rightButton, closeDialog));
2390
+ }, confirmLabel), utils.callIfFunction(rightButton, closeDialog), utils.callIfFunction(footer, closeDialog), children);
2113
2391
  }).withConfig({
2114
2392
  displayName: "WarningDialog",
2115
2393
  componentId: "sc-1jw779e-0"
2116
2394
  })(["text-align:center;max-width:36rem;padding:2.5rem;", "{margin:0.5rem !important;}"], Button);
2117
- var Title = styled__default.h3.withConfig({
2118
- displayName: "WarningDialog__Title",
2395
+ var WarningDialogTitle = styled__default.h3.withConfig({
2396
+ displayName: "WarningDialog__WarningDialogTitle",
2119
2397
  componentId: "sc-1jw779e-1"
2120
2398
  })(["color:", ";font-weight:500;font-size:20px;"], function (props) {
2121
- return props.color === 'warning' ? utils.getColor('alert') : props.color === 'success' ? utils.getColor('success') : utils.getColor('main');
2399
+ return props.color === 'warning' ? utils.getColor('alert') : props.color === 'success' ? utils.getColor('success') : props.color === 'due-date' ? utils.getColor('warning') : utils.getColor('main');
2122
2400
  });
2123
2401
  var Content = styled__default.div.withConfig({
2124
2402
  displayName: "WarningDialog__Content",
2125
2403
  componentId: "sc-1jw779e-2"
2126
- })(["font-size:15px;max-width:27rem;margin:0 auto 1.5rem;line-height:130%;", ""], function (props) {
2404
+ })(["font-size:15px;max-width:27rem;margin:0 auto;line-height:130%;", " ", ""], function (props) {
2405
+ return !props.noActions && "\n margin: 0 auto 1.5rem;\n ";
2406
+ }, function (props) {
2127
2407
  return props.noTitle && "\n font-weight: 500;\n font-size: 16px;\n ";
2128
2408
  });
2129
- var MainIcon = styled__default(Icon).withConfig({
2130
- displayName: "WarningDialog__MainIcon",
2409
+ var WarningDialogIcon = styled__default(Icon).withConfig({
2410
+ displayName: "WarningDialog__WarningDialogIcon",
2131
2411
  componentId: "sc-1jw779e-3"
2132
2412
  })(["color:", ";font-size:46px;display:block;margin-bottom:1.25rem;"], function (props) {
2133
- return props.icon === 'warning' ? utils.getColor('alert') : props.icon === 'success' ? utils.getColor('success') : utils.getColor('main');
2413
+ return props.icon === 'warning' ? utils.getColor('alert') : props.icon === 'success' ? utils.getColor('success') : props.icon === 'due-date' ? utils.getColor('warning') : utils.getColor('main');
2134
2414
  });
2135
2415
  var useWarningDialog = function useWarningDialog() {
2136
2416
  return useDialogWithToggle(function (toggle) {
@@ -2175,7 +2455,7 @@ var NotificationContainer = styled__default.div.withConfig({
2175
2455
  var Notification = styled__default.div.withConfig({
2176
2456
  displayName: "Notifications__Notification",
2177
2457
  componentId: "naxsn6-1"
2178
- })(["padding:1rem 3.5rem 1rem 1rem;border-radius:5px;color:white;text-align:left;line-height:20px;background:", ";box-shadow:0 2px 0px 0px rgba(0,0,0,0.25);min-width:12rem;min-height:44px;display:inline-block;position:relative;top:1rem;", "{color:white;display:inline-block;background-color:rgba(0,0,0,0.2);font-size:14px;width:20px;height:20px;text-align:center;line-height:20px;border-radius:50%;cursor:pointer;position:absolute;top:1rem;right:1rem;&:hover{background-color:rgba(0,0,0,0.3);}}"], function (props) {
2458
+ })(["padding:1rem 4.5rem 1rem 1.5rem;font-size:14px;font-weight:500;border-radius:10px;color:white;text-align:left;background:", ";box-shadow:0 2px 0px 0px rgba(0,0,0,0.1);min-width:12rem;min-height:48px;display:inline-flex;align-items:center;position:relative;top:1rem;", "{color:white;display:inline-block;background-color:rgba(0,0,0,0.1);font-size:18px;width:24px;height:24px;text-align:center;line-height:24px;border-radius:50%;cursor:pointer;position:absolute;top:50%;transform:translateY(-50%);right:1rem;&:hover{background-color:rgba(0,0,0,0.2);}}"], function (props) {
2179
2459
  return utils.getColor(props.type)(props);
2180
2460
  }, Icon);
2181
2461
 
@@ -2238,6 +2518,16 @@ var FlipNotification = function FlipNotification(props) {
2238
2518
  }, props)));
2239
2519
  };
2240
2520
 
2521
+ function _templateObject$5() {
2522
+ var data = _taggedTemplateLiteral(["\n display: none;\n "]);
2523
+
2524
+ _templateObject$5 = function _templateObject() {
2525
+ return data;
2526
+ };
2527
+
2528
+ return data;
2529
+ }
2530
+
2241
2531
  var _willUseSharedState$2 = core.willUseSharedState([]),
2242
2532
  _willUseSharedState2$2 = _slicedToArray(_willUseSharedState$2, 3),
2243
2533
  useNotifications = _willUseSharedState2$2[0],
@@ -2275,14 +2565,25 @@ var Notification$1 = styled__default.div.withConfig({
2275
2565
  var NotificationWrapper = styled__default.div.withConfig({
2276
2566
  displayName: "PersistentNotifications__NotificationWrapper",
2277
2567
  componentId: "sc-1t7i0dh-2"
2278
- })(["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;"]);
2568
+ })(["background:white;margin-top:", ";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:364px;", ""], function (props) {
2569
+ return props.marginTop || "4.75rem";
2570
+ }, utils.printerMedia(_templateObject$5()));
2571
+
2572
+ var _willUseSharedState3 = core.willUseSharedState(false),
2573
+ _willUseSharedState4 = _slicedToArray(_willUseSharedState3, 3),
2574
+ useIsHiddenPersistentNotifications = _willUseSharedState4[0],
2575
+ hidePersistentNotifications = _willUseSharedState4[2];
2279
2576
  var PersistentNotifications = function PersistentNotifications() {
2280
2577
  var _useNotifications = useNotifications(),
2281
2578
  _useNotifications2 = _slicedToArray(_useNotifications, 2),
2282
2579
  notifications = _useNotifications2[0],
2283
2580
  setNotifications = _useNotifications2[1];
2284
2581
 
2285
- if (!notifications.length) {
2582
+ var _useIsHiddenPersisten = useIsHiddenPersistentNotifications(),
2583
+ _useIsHiddenPersisten2 = _slicedToArray(_useIsHiddenPersisten, 1),
2584
+ isHidden = _useIsHiddenPersisten2[0];
2585
+
2586
+ if (!notifications.length || isHidden) {
2286
2587
  return null;
2287
2588
  }
2288
2589
 
@@ -2294,11 +2595,13 @@ var PersistentNotifications = function PersistentNotifications() {
2294
2595
 
2295
2596
  var _notifications$ = notifications[0],
2296
2597
  content = _notifications$.content,
2297
- type = _notifications$.type;
2598
+ type = _notifications$.type,
2599
+ marginTop = _notifications$.marginTop;
2298
2600
  return React__default.createElement(core.Fill, {
2299
2601
  name: "PersistentNotifications"
2300
2602
  }, React__default.createElement(FlipNotification$1, {
2301
- type: type
2603
+ type: type,
2604
+ marginTop: marginTop
2302
2605
  }, utils.callIfFunction(content, closeMessage)));
2303
2606
  };
2304
2607
 
@@ -2308,7 +2611,9 @@ var FlipNotification$1 = function FlipNotification(props) {
2308
2611
  return React__default.createElement(NotificationContainer$1, {
2309
2612
  className: "JS-fix-dialog-scroll",
2310
2613
  ref: ref
2311
- }, React__default.createElement(NotificationWrapper, null, React__default.createElement(Notification$1, _extends({
2614
+ }, React__default.createElement(NotificationWrapper, {
2615
+ marginTop: props.marginTop
2616
+ }, React__default.createElement(Notification$1, _extends({
2312
2617
  id: "js-share-notification"
2313
2618
  }, props))));
2314
2619
  };
@@ -2418,7 +2723,9 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2418
2723
  keepWidth = _ref$keepWidth === void 0 ? true : _ref$keepWidth,
2419
2724
  _ref$boundMargin = _ref.boundMargin,
2420
2725
  boundMargin = _ref$boundMargin === void 0 ? 6 : _ref$boundMargin,
2421
- respectBounds = _ref.respectBounds;
2726
+ respectBounds = _ref.respectBounds,
2727
+ respectOffsetScroll = _ref.respectOffsetScroll,
2728
+ on = _ref.on;
2422
2729
  var placeholder = React.useRef();
2423
2730
  var arrowRef = core.useEnsureRef(arrowRefOpt);
2424
2731
 
@@ -2443,8 +2750,8 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2443
2750
  return;
2444
2751
  }
2445
2752
 
2446
- var usingLayer = useLayers && getDialogLayersSize() > 0;
2447
- var scrollOwner = usingLayer ? utils.getClosestOffsetScroll(element.current.offsetParent) : {
2753
+ var usingLayer = respectOffsetScroll || useLayers && getDialogLayersSize() > 0;
2754
+ var scrollOwner = usingLayer ? _isFunction(respectOffsetScroll) ? respectOffsetScroll(element.current.offsetParent) : utils.getClosestOffsetScroll(element.current.offsetParent) : {
2448
2755
  scrollTop: window.pageYOffset,
2449
2756
  scrollLeft: window.pageXOffset // console.log({scrollOwner,scrollTop:scrollOwner.scrollTop,pageYOffset:window.pageYOffset})
2450
2757
 
@@ -2452,9 +2759,24 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2452
2759
  var scrollY = !isNaN(scrollOwner.scrollTop) ? scrollOwner.scrollTop : window.pageYOffset;
2453
2760
  var scrollX = !isNaN(scrollOwner.scrollLeft) ? scrollOwner.scrollLeft : window.pageXOffset;
2454
2761
 
2455
- var _placeholder$current$ = placeholder.current.getBoundingClientRect(),
2456
- leftPlusBorder = _placeholder$current$.left,
2457
- topPlusBorder = _placeholder$current$.top;
2762
+ var getRespectOffsetScrollTopLeft = function getRespectOffsetScrollTopLeft() {
2763
+ var _placeholder$current$ = placeholder.current.getBoundingClientRect(),
2764
+ top = _placeholder$current$.top,
2765
+ left = _placeholder$current$.left;
2766
+
2767
+ var _scrollOwner$getBound = scrollOwner.getBoundingClientRect(),
2768
+ scrollOwnerTop = _scrollOwner$getBound.top,
2769
+ scrollOwnerLeft = _scrollOwner$getBound.left;
2770
+
2771
+ return {
2772
+ top: top - scrollOwnerTop,
2773
+ left: left - scrollOwnerLeft
2774
+ };
2775
+ };
2776
+
2777
+ var _ref2 = respectOffsetScroll ? getRespectOffsetScrollTopLeft() : placeholder.current.getBoundingClientRect(),
2778
+ leftPlusBorder = _ref2.left,
2779
+ topPlusBorder = _ref2.top;
2458
2780
 
2459
2781
  var _window$getComputedSt = window.getComputedStyle(placeholder.current.offsetParent),
2460
2782
  borderLeftWidth = _window$getComputedSt.borderLeftWidth,
@@ -2521,10 +2843,10 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2521
2843
  var arrowOnVerticalSide = arrowSide === 'left' || arrowSide === 'right';
2522
2844
  var arrowSize = arrowElement ? arrowElement.getBoundingClientRect()[arrowOnVerticalSide ? 'height' : 'width'] : ARROW_DEFAULT_SIZE * Math.sqrt(2);
2523
2845
 
2524
- var _ref2 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2525
- _ref3 = _slicedToArray(_ref2, 2),
2526
- arrowOffset = _ref3[0],
2527
- popupArrowOffset = _ref3[1];
2846
+ var _ref3 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2847
+ _ref4 = _slicedToArray(_ref3, 2),
2848
+ arrowOffset = _ref4[0],
2849
+ popupArrowOffset = _ref4[1];
2528
2850
 
2529
2851
  var maxHeight = window.innerHeight - (POSITIONING_BOUNDS.top + POSITIONING_BOUNDS.bottom) - (respectBounds ? boundMargin * 2 : 0);
2530
2852
  var maxWidth = window.innerWidth - (POSITIONING_BOUNDS.left + POSITIONING_BOUNDS.right) - (respectBounds ? boundMargin * 2 : 0);
@@ -2574,11 +2896,13 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2574
2896
  }
2575
2897
  };
2576
2898
 
2577
- React.useLayoutEffect(setPosition, []);
2899
+ React.useLayoutEffect(setPosition, [on]);
2578
2900
  React.useEffect(function () {
2579
2901
  window.addEventListener('portalReposition', setPosition);
2580
2902
  window.addEventListener('stepResize', setPosition);
2581
- window.addEventListener('scroll', setPosition);
2903
+ window.addEventListener('scroll', setPosition, {
2904
+ passive: true
2905
+ });
2582
2906
  return function () {
2583
2907
  window.removeEventListener('portalReposition', setPosition);
2584
2908
  window.removeEventListener('stepResize', setPosition);
@@ -2689,6 +3013,8 @@ function (_React$Component) {
2689
3013
  _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(FlipList)).call.apply(_getPrototypeOf2, [this].concat(args)));
2690
3014
 
2691
3015
  _this.play = function (oldSnap, newSnap) {
3016
+ var _newSnap$parent;
3017
+
2692
3018
  var _this$props = _this.props,
2693
3019
  animation = _this$props.animation,
2694
3020
  insertAnimation = _this$props.insertAnimation,
@@ -2736,12 +3062,15 @@ function (_React$Component) {
2736
3062
  skipTransform: true,
2737
3063
  smallJumpFix: _this.props.smallJumpFix
2738
3064
  });
2739
- var endEffect = utils.callIfFunction(effect, newSnap.parent.domNode, {
2740
- newSnap: newSnap,
2741
- oldSnap: oldSnap
2742
- });
2743
- utils.callIfFunction(onStartAnimation);
2744
- morph(newSnap.parent.domNode, formatAnimation(rectAnimation, timing), endEffect || onEndAnimation);
3065
+
3066
+ if ((_newSnap$parent = newSnap.parent) === null || _newSnap$parent === void 0 ? void 0 : _newSnap$parent.domNode) {
3067
+ var endEffect = utils.callIfFunction(effect, newSnap.parent.domNode, {
3068
+ newSnap: newSnap,
3069
+ oldSnap: oldSnap
3070
+ });
3071
+ utils.callIfFunction(onStartAnimation);
3072
+ morph(newSnap.parent.domNode, formatAnimation(rectAnimation, timing), endEffect || onEndAnimation);
3073
+ }
2745
3074
  };
2746
3075
 
2747
3076
  _this.reinsertSnap = function (item, scrollDelta, allChildren) {
@@ -4061,10 +4390,10 @@ function _templateObject2$4() {
4061
4390
  return data;
4062
4391
  }
4063
4392
 
4064
- function _templateObject$5() {
4393
+ function _templateObject$6() {
4065
4394
  var data = _taggedTemplateLiteral(["\n font-size: 14px;\n & > * {\n padding-top: 15px;\n padding-bottom: 15px;\n }\n ", ", .icon {\n font-size: 25px;\n }\n "]);
4066
4395
 
4067
- _templateObject$5 = function _templateObject() {
4396
+ _templateObject$6 = function _templateObject() {
4068
4397
  return data;
4069
4398
  };
4070
4399
 
@@ -4084,7 +4413,9 @@ var areComponentsEqual = function areComponentsEqual(a, b) {
4084
4413
  var ListItem = styled__default.li.withConfig({
4085
4414
  displayName: "ContextMenu__ListItem",
4086
4415
  componentId: "sc-13y1vvt-0"
4087
- })(["position:relative;font-size:13px;& > *{padding:11px 1.5rem 11px 3.5rem;display:block;}", ",.icon{font-size:23px;position:absolute;padding-left:0.25rem;left:0;top:50%;transform:translateY(-50%);width:3.5rem;text-align:center;}", " & > a{color:inherit;font-weight:inherit;text-decoration:inherit;}& > a,& > label{cursor:pointer;}", " ", " input[type=\"radio\"]{display:none;}", " ", " ", " ", ""], Icon, utils.media.mobile(_templateObject$5(), Icon), utils.ifProp('hover', styled.css(["& > a,& > label{background:", ";color:", ";color:", ";}"], function (props) {
4416
+ })(["position:relative;font-size:13px;& > *{padding:11px 1.5rem 11px 3.5rem;display:block;}", " ", ",.icon{font-size:23px;position:absolute;padding-left:0.25rem;left:0;top:50%;transform:translateY(-50%);width:3.5rem;text-align:center;}", " & > a{color:inherit;font-weight:inherit;text-decoration:inherit;}& > a,& > label{cursor:pointer;}", " ", " input[type=\"radio\"]{display:none;}", " ", " ", " ", ""], function (props) {
4417
+ return props.hasSubmenu && "\n & > * {\n padding-right: 3rem;\n }\n ";
4418
+ }, Icon, utils.media.mobile(_templateObject$6(), Icon), utils.ifProp('hover', styled.css(["& > a,& > label{background:", ";color:", ";color:", ";}"], function (props) {
4088
4419
  return polished.lighten(0.53, utils.getColor("main")(props));
4089
4420
  }, utils.getColor('main'), function (props) {
4090
4421
  return polished.darken(0.03, utils.getColor("main")(props));
@@ -4247,6 +4578,7 @@ var Li = function Li(_ref) {
4247
4578
  var _ref$emitter = _ref.emitter,
4248
4579
  emitter = _ref$emitter === void 0 ? mitt() : _ref$emitter,
4249
4580
  index = _ref.index,
4581
+ menuSlot = _ref.menuSlot,
4250
4582
  keepOpen = _ref.keepOpen,
4251
4583
  hover = _ref.hover,
4252
4584
  layerIndex = _ref.layerIndex,
@@ -4263,7 +4595,7 @@ var Li = function Li(_ref) {
4263
4595
  helpText = _ref.helpText,
4264
4596
  target = _ref.target,
4265
4597
  href = _ref.href,
4266
- rest = _objectWithoutProperties(_ref, ["emitter", "index", "keepOpen", "hover", "layerIndex", "hoverCursor", "passTouchThrough", "children", "setCursorOnHover", "onClick", "prefixWith", "linkTo", "icon", "label", "descText", "helpText", "target", "href"]);
4598
+ rest = _objectWithoutProperties(_ref, ["emitter", "index", "menuSlot", "keepOpen", "hover", "layerIndex", "hoverCursor", "passTouchThrough", "children", "setCursorOnHover", "onClick", "prefixWith", "linkTo", "icon", "label", "descText", "helpText", "target", "href"]);
4267
4599
 
4268
4600
  var nodeRef = React.useRef();
4269
4601
  var tagRef = React.useRef();
@@ -4373,7 +4705,8 @@ var Li = function Li(_ref) {
4373
4705
  closing: subMenu.closing,
4374
4706
  onMouseMove: subMenu.open,
4375
4707
  onClose: onCloseSub,
4376
- sub: true
4708
+ sub: true,
4709
+ slot: c.props.slot || menuSlot
4377
4710
  });
4378
4711
  });
4379
4712
  };
@@ -4390,7 +4723,8 @@ var Li = function Li(_ref) {
4390
4723
  hover: hover,
4391
4724
  onClick: onClickHandler,
4392
4725
  onMouseLeave: onMouseOut,
4393
- onMouseMove: onMouseMove
4726
+ onMouseMove: onMouseMove,
4727
+ hasSubmenu: children
4394
4728
  }), rest.withButton || rest.noActions ? content : React__default.createElement(Tag, {
4395
4729
  href: href,
4396
4730
  target: target,
@@ -4417,6 +4751,7 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4417
4751
  sub = _ref2.sub,
4418
4752
  hoverIndex = _ref2.hoverIndex,
4419
4753
  autoHover = _ref2.autoHover,
4754
+ menuSlot = _ref2.menuSlot,
4420
4755
  withoutIcons = _ref2.withoutIcons,
4421
4756
  onClose = _ref2.onClose,
4422
4757
  _ref2$onHover = _ref2.onHover,
@@ -4425,7 +4760,7 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4425
4760
  } : _ref2$onHover,
4426
4761
  fill = _ref2.fill,
4427
4762
  onClick = _ref2.onClick,
4428
- props = _objectWithoutProperties(_ref2, ["children", "sub", "hoverIndex", "autoHover", "withoutIcons", "onClose", "onHover", "fill", "onClick"]);
4763
+ props = _objectWithoutProperties(_ref2, ["children", "sub", "hoverIndex", "autoHover", "menuSlot", "withoutIcons", "onClose", "onHover", "fill", "onClick"]);
4429
4764
 
4430
4765
  var ref = core.useEnsureRef(unesuredRef);
4431
4766
 
@@ -4497,11 +4832,19 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4497
4832
  };
4498
4833
 
4499
4834
  var getTotalKeyboardItems = function getTotalKeyboardItems(children) {
4500
- var max = 0;
4501
- React__default.Children.forEach(children, function (e) {
4502
- return max += e && (!styled.isStyledComponent(e.type) && e.type === Li || e.type.isKeyboardNavigable || (areComponentsEqual(e.type, StickyContainer) ? getTotalKeyboardItems(e.props.children) : 0));
4835
+ var sum = 0;
4836
+ React__default.Children.forEach(children, function (child) {
4837
+ if (child && !child.props.disabled && !child.props.readOnly) {
4838
+ if (!styled.isStyledComponent(child.type) && child.type === Li || child.type.isKeyboardNavigable) {
4839
+ sum += 1;
4840
+ }
4841
+
4842
+ if (areComponentsEqual(child.type, StickyContainer) || child.props.nested) {
4843
+ sum += getTotalKeyboardItems(child.props.children);
4844
+ }
4845
+ }
4503
4846
  });
4504
- return max;
4847
+ return sum;
4505
4848
  };
4506
4849
 
4507
4850
  var setCursorOnHover = function setCursorOnHover(index) {
@@ -4511,18 +4854,20 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
4511
4854
  };
4512
4855
 
4513
4856
  var formatChildren = function formatChildren(children) {
4514
- var indexOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
4515
- var i = 0;
4857
+ var indexRef = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
4858
+ current: 0
4859
+ };
4516
4860
  return React__default.Children.map(children, function (child, j) {
4517
- return child ? !styled.isStyledComponent(child.type) && !reactIs.isMemo(child.type) && areComponentsEqual(child.type, Li) || child.type.isKeyboardNavigable ? React__default.cloneElement(child, {
4518
- hover: hoverCursor === i + indexOffset && layerIndex === layerCursor,
4861
+ return child && !child.props.disabled && !child.props.readOnly ? child.props.nested ? React__default.cloneElement(child, child.props, formatChildren(child.props.children, indexRef)) : !styled.isStyledComponent(child.type) && !reactIs.isMemo(child.type) && areComponentsEqual(child.type, Li) || child.type.isKeyboardNavigable ? React__default.cloneElement(child, {
4862
+ hover: hoverCursor === indexRef.current && layerIndex === layerCursor,
4519
4863
  hoverCursor: hoverCursor,
4520
- index: indexOffset + i++,
4864
+ index: indexRef.current++,
4521
4865
  setCursorOnHover: setCursorOnHover,
4522
4866
  emitter: itemsEmitter,
4523
- layerIndex: layerIndex
4867
+ layerIndex: layerIndex,
4868
+ menuSlot: menuSlot
4524
4869
  }) : areComponentsEqual(child.type, StickyContainer) ? React__default.cloneElement(child, _objectSpread({}, child.props, {
4525
- children: formatChildren(child.props.children, i + indexOffset)
4870
+ children: formatChildren(child.props.children, indexRef)
4526
4871
  })) : child : child;
4527
4872
  });
4528
4873
  };
@@ -4588,6 +4933,7 @@ var ContextMenu = React.forwardRef(function (_ref3, ref) {
4588
4933
  return React__default.createElement(React__default.Fragment, null, placeholder, React__default.createElement(core.Fill, {
4589
4934
  name: slotName
4590
4935
  }, React__default.createElement(ContextMenuComponent, _extends({}, rest, {
4936
+ menuSlot: slot,
4591
4937
  sub: sub
4592
4938
  }, positionInfo, {
4593
4939
  ref: contextMenuRef,
@@ -4614,10 +4960,10 @@ var callIfFunction = function callIfFunction(prop) {
4614
4960
  return typeof prop === "function" ? prop.apply(void 0, args) : prop;
4615
4961
  };
4616
4962
 
4617
- function _templateObject$6() {
4963
+ function _templateObject$7() {
4618
4964
  var data = _taggedTemplateLiteral(["\n ", ""]);
4619
4965
 
4620
- _templateObject$6 = function _templateObject() {
4966
+ _templateObject$7 = function _templateObject() {
4621
4967
  return data;
4622
4968
  };
4623
4969
 
@@ -4626,10 +4972,10 @@ function _templateObject$6() {
4626
4972
 
4627
4973
  var checkCustomScreenWidth = function checkCustomScreenWidth(sizeParis, customWidth) {
4628
4974
  var currentWidth = callIfFunction(customWidth);
4629
- return !sizeParis.find(function (_ref4) {
4630
- var _ref5 = _slicedToArray(_ref4, 2),
4631
- size = _ref5[0],
4632
- type = _ref5[1];
4975
+ return !sizeParis.find(function (_ref5) {
4976
+ var _ref6 = _slicedToArray(_ref5, 2),
4977
+ size = _ref6[0],
4978
+ type = _ref6[1];
4633
4979
 
4634
4980
  if (type === "min-width") {
4635
4981
  return currentWidth < size;
@@ -4654,10 +5000,10 @@ var media = function media() {
4654
5000
  return styled.css(["", ""], function (props) {
4655
5001
  var _props$theme, _props$theme2;
4656
5002
 
4657
- 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) {
4658
- var _ref7 = _slicedToArray(_ref6, 2),
4659
- size = _ref7[0],
4660
- type = _ref7[1];
5003
+ 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 (_ref7) {
5004
+ var _ref8 = _slicedToArray(_ref7, 2),
5005
+ size = _ref8[0],
5006
+ type = _ref8[1];
4661
5007
 
4662
5008
  return "(".concat(type, ": ").concat(size + scrollWidth, "px)");
4663
5009
  }).join(' and '), styled.css.apply(void 0, args));
@@ -4692,7 +5038,7 @@ var oneWayAnimation = function oneWayAnimation() {
4692
5038
  frames[_key5] = arguments[_key5];
4693
5039
  }
4694
5040
 
4695
- return emotion.keyframes(_templateObject$6(), frames.map(function (frame, i) {
5041
+ return emotion.keyframes(_templateObject$7(), frames.map(function (frame, i) {
4696
5042
  return !frame ? '' : "".concat(getFrameOffset(i, frames.length), "% {\n ").concat(frame, "\n }");
4697
5043
  }));
4698
5044
  };
@@ -4715,10 +5061,16 @@ var identityOpacityFrames = oneWayAnimation('opacity: 1;', 'opacity:1;');
4715
5061
  var LoadingBar = styled__default.div.withConfig({
4716
5062
  displayName: "PageLoader__LoadingBar",
4717
5063
  componentId: "sc-96jeob-0"
4718
- })(["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) {
4719
- return props.loading && "\n width: 70%;\n transition: 1.5s width linear;\n ";
5064
+ })(["width:100%;border-radius:0 1px 1px 0;height:4px;position:fixed;background:", ";transform:translateX(-100%);", " left:0;z-index:99999;box-shadow:", ";", " ", ""], function (props) {
5065
+ return props.bottom ? styled.css(["", ""], utils.getColor('main')) : "#84D359";
5066
+ }, function (props) {
5067
+ return props.bottom ? "bottom:55px;" : "top: 0;";
5068
+ }, function (props) {
5069
+ return props.bottom ? "0 0 1px 1px rgba(0,132,214,0.2);" : "0 0 2px 0 rgba(0,0,0,0.5);";
5070
+ }, function (props) {
5071
+ return props.loading && "\n transform: translateX(-30%);\n transition: transform 1.5s ease;\n ";
4720
5072
  }, function (props) {
4721
- return props.closing && "\n width: 100%;\n transition: 0.3s ease-in;\n ";
5073
+ return props.closing && "\n transform: translateX(0);\n transition: transform 0.3s ease-in;\n ";
4722
5074
  });
4723
5075
  var PageLoader = function PageLoader(_ref) {
4724
5076
  var isLoading = _ref.isLoading;
@@ -4735,7 +5087,7 @@ var PageLoader = function PageLoader(_ref) {
4735
5087
  closing: loader.closing
4736
5088
  });
4737
5089
  };
4738
- var animation$2 = utils.oneWayAnimation('width: 70%;', 'width: 100%');
5090
+ var animation$2 = utils.oneWayAnimation('transform:translateX(-30%);', 'transform:translateX(0);');
4739
5091
  var SuspenseLoadingBar = function SuspenseLoadingBar() {
4740
5092
  var ref = React__default.useRef();
4741
5093
  useFlipLeave(ref, animation$2, {
@@ -5046,8 +5398,8 @@ FillLastLineResizer.h2 = function (props) {
5046
5398
  };
5047
5399
 
5048
5400
  var DEFAULT_ANIMATION = utils.oneWayAnimation("opacity: 1;", "opacity: 0;");
5049
- var BlockContainer$1 = styled__default.div.withConfig({
5050
- displayName: "TransitionDiv__BlockContainer",
5401
+ var AnimationBlockContainer = styled__default.div.withConfig({
5402
+ displayName: "TransitionDiv__AnimationBlockContainer",
5051
5403
  componentId: "sc-1sh2xah-0"
5052
5404
  })(["", " position:relative;"], function (props) {
5053
5405
  return props.inline ? 'display: inline-block; ' : '';
@@ -5087,14 +5439,14 @@ var TransitionDiv = function TransitionDiv(_ref) {
5087
5439
  skipChromeFix: skipChromeFix,
5088
5440
  animation: animation || DEFAULT_ANIMATION
5089
5441
  }, rest), []);
5090
- return block || inline ? React__default.createElement(BlockContainer$1, {
5442
+ return block || inline ? React__default.createElement(AnimationBlockContainer, {
5091
5443
  inline: inline,
5092
5444
  ref: blockRef,
5093
5445
  className: className
5094
5446
  }, content) : content;
5095
5447
  };
5096
5448
 
5097
- var BlockContainer$2 = styled__default.div.withConfig({
5449
+ var BlockContainer$1 = styled__default.div.withConfig({
5098
5450
  displayName: "SwitchDiv__BlockContainer",
5099
5451
  componentId: "htfwpl-0"
5100
5452
  })(["position:relative;"]);
@@ -5141,167 +5493,12 @@ var SwitchContainer = function SwitchContainer(_ref2) {
5141
5493
  switchAnimation(contentRef, enterAnimation, leaveAnimation, {
5142
5494
  effect: effect
5143
5495
  });
5144
- return React__default.createElement(BlockContainer$2, {
5496
+ return React__default.createElement(BlockContainer$1, {
5145
5497
  ref: contentRef,
5146
5498
  className: className
5147
5499
  }, utils.callIfFunction(children));
5148
5500
  };
5149
5501
 
5150
- var TOP_TRIGGER = function TOP_TRIGGER(posInfo, refInfo) {
5151
- // Started sticking.
5152
- if (posInfo.bottom < refInfo.top) {
5153
- return true;
5154
- } // Stopped sticking.
5155
-
5156
-
5157
- if (posInfo.bottom >= refInfo.top && posInfo.bottom < refInfo.bottom) {
5158
- return false;
5159
- }
5160
- };
5161
-
5162
- var BOTTOM_TRIGGER = function BOTTOM_TRIGGER(posInfo, refInfo) {
5163
- // Started sticking.
5164
- if (posInfo.top > refInfo.bottom) {
5165
- return true;
5166
- }
5167
-
5168
- if (posInfo.top <= refInfo.bottom && posInfo.top > refInfo.top) {
5169
- return false;
5170
- }
5171
- };
5172
-
5173
- var SentinelStyle = styled__default.div.withConfig({
5174
- displayName: "willUseIsSticky__SentinelStyle",
5175
- componentId: "sc-1nsyca-0"
5176
- })(["position:absolute;visibility:hidden;height:1px;width:1px;", ""], function (props) {
5177
- return props.addCss;
5178
- });
5179
- var willUseIsSticky = function willUseIsSticky() {
5180
- var _willUseSharedCallbac = core.willUseSharedCallback(),
5181
- _willUseSharedCallbac2 = _slicedToArray(_willUseSharedCallbac, 2),
5182
- useRegister = _willUseSharedCallbac2[0],
5183
- onChange = _willUseSharedCallbac2[1];
5184
-
5185
- var _willUseSharedState = core.willUseSharedState(),
5186
- _willUseSharedState2 = _slicedToArray(_willUseSharedState, 3),
5187
- useSharedIsSticky = _willUseSharedState2[0],
5188
- setSharedIsSticky = _willUseSharedState2[2];
5189
-
5190
- var createObserver = function createObserver(root) {
5191
- return window.IntersectionObserver ? new window.IntersectionObserver(function (records, observer) {
5192
- var _iteratorNormalCompletion = true;
5193
- var _didIteratorError = false;
5194
- var _iteratorError = undefined;
5195
-
5196
- try {
5197
- for (var _iterator = records[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
5198
- var record = _step.value;
5199
- var targetInfo = record.boundingClientRect;
5200
- var rootBoundsInfo = record.rootBounds;
5201
-
5202
- if (!rootBoundsInfo) {
5203
- return;
5204
- }
5205
-
5206
- onChange(targetInfo, rootBoundsInfo, record.target, record.isIntersecting);
5207
- }
5208
- } catch (err) {
5209
- _didIteratorError = true;
5210
- _iteratorError = err;
5211
- } finally {
5212
- try {
5213
- if (!_iteratorNormalCompletion && _iterator.return != null) {
5214
- _iterator.return();
5215
- }
5216
- } finally {
5217
- if (_didIteratorError) {
5218
- throw _iteratorError;
5219
- }
5220
- }
5221
- }
5222
- }, {
5223
- root: root
5224
- }) : {
5225
- observe: _identity,
5226
- unobserve: _identity
5227
- };
5228
- };
5229
-
5230
- var observerMap = new Map();
5231
-
5232
- var getObserver = function getObserver() {
5233
- var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5234
- var result = observerMap.get(root);
5235
-
5236
- if (result) {
5237
- return result;
5238
- }
5239
-
5240
- var observer = createObserver(root);
5241
- observerMap.set(root, observer);
5242
- return observer;
5243
- };
5244
-
5245
- var activeObserved = [];
5246
-
5247
- var resetObservers = function resetObservers() {
5248
- var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5249
- var observer = getObserver(root);
5250
- activeObserved.forEach(function (observed) {
5251
- observer.unobserve(observed);
5252
- observer.observe(observed);
5253
- });
5254
- };
5255
-
5256
- var WithIsSticky = React__default.forwardRef(function (_ref, ref) {
5257
- var className = _ref.className,
5258
- children = _ref.children,
5259
- bottom = _ref.bottom,
5260
- root = _ref.root,
5261
- intersection = _ref.intersection,
5262
- onChange = _ref.onChange;
5263
- var ensuredRef = core.useEnsureRef(ref);
5264
-
5265
- var _useState = React.useState(false),
5266
- _useState2 = _slicedToArray(_useState, 2),
5267
- isSticky = _useState2[0],
5268
- setIsSticky = _useState2[1];
5269
-
5270
- useRegister(function (posInfo, refInfo, target, isIntersecting) {
5271
- if (ensuredRef.current === target) {
5272
- var value = intersection ? isIntersecting : bottom ? BOTTOM_TRIGGER(posInfo, refInfo) : TOP_TRIGGER(posInfo, refInfo);
5273
-
5274
- if (value !== undefined) {
5275
- setIsSticky(value);
5276
- utils.callIfFunction(onChange, value);
5277
- setSharedIsSticky(value);
5278
- }
5279
- }
5280
- });
5281
- React.useEffect(function () {
5282
- setIsSticky(false);
5283
- getObserver(utils.callIfFunction(root)).observe(ensuredRef.current);
5284
- activeObserved = activeObserved.concat(ensuredRef.current);
5285
- return function () {
5286
- // observer.unobserve(ref.current)
5287
- activeObserved = _without([ensuredRef.current], activeObserved);
5288
- };
5289
- }, []);
5290
-
5291
- var renderSentinel = function renderSentinel() {
5292
- var css = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
5293
- return React__default.createElement(SentinelStyle, {
5294
- addCss: css,
5295
- className: className,
5296
- ref: ensuredRef
5297
- });
5298
- };
5299
-
5300
- return children ? children(renderSentinel, isSticky) : renderSentinel();
5301
- });
5302
- return [WithIsSticky, useSharedIsSticky, resetObservers];
5303
- };
5304
-
5305
5502
  var FormatDate = function FormatDate(_ref) {
5306
5503
  var date = _ref.date,
5307
5504
  format = _ref.format,
@@ -5355,10 +5552,10 @@ var Image = React.forwardRef(function (_ref, ref) {
5355
5552
  }));
5356
5553
  });
5357
5554
 
5358
- function _templateObject$7() {
5555
+ function _templateObject$8() {
5359
5556
  var data = _taggedTemplateLiteral(["\n @supports (position: sticky) {\n top: 0;\n margin-right: -0.75rem;\n }\n "]);
5360
5557
 
5361
- _templateObject$7 = function _templateObject() {
5558
+ _templateObject$8 = function _templateObject() {
5362
5559
  return data;
5363
5560
  };
5364
5561
 
@@ -5367,11 +5564,21 @@ function _templateObject$7() {
5367
5564
  var DialogWithImageHeader = styled__default(Dialog).withConfig({
5368
5565
  displayName: "DialogWithImageHeader",
5369
5566
  componentId: "sc-1f1ry4g-0"
5370
- })(["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()));
5567
+ })(["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$8()));
5371
5568
 
5372
- function _templateObject2$5() {
5569
+ function _templateObject3$3() {
5373
5570
  var data = _taggedTemplateLiteral(["\n min-height: 100%;\n overflow: hidden;\n "]);
5374
5571
 
5572
+ _templateObject3$3 = function _templateObject3() {
5573
+ return data;
5574
+ };
5575
+
5576
+ return data;
5577
+ }
5578
+
5579
+ function _templateObject2$5() {
5580
+ var data = _taggedTemplateLiteral(["\n font-size: 16px;\n "]);
5581
+
5375
5582
  _templateObject2$5 = function _templateObject2() {
5376
5583
  return data;
5377
5584
  };
@@ -5379,10 +5586,10 @@ function _templateObject2$5() {
5379
5586
  return data;
5380
5587
  }
5381
5588
 
5382
- function _templateObject$8() {
5589
+ function _templateObject$9() {
5383
5590
  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 "]);
5384
5591
 
5385
- _templateObject$8 = function _templateObject() {
5592
+ _templateObject$9 = function _templateObject() {
5386
5593
  return data;
5387
5594
  };
5388
5595
 
@@ -5393,13 +5600,13 @@ var SideMenu = styled__default.div.withConfig({
5393
5600
  componentId: "suvg9r-0"
5394
5601
  })(["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) {
5395
5602
  return !props.visibleOnDesktop && 'display:none;';
5396
- }, utils.media.mobile(_templateObject$8(), utils.getColor('gray240'), function (props) {
5603
+ }, utils.media.mobile(_templateObject$9(), utils.getColor('gray240'), function (props) {
5397
5604
  return !props.isOpen && "\n transform: translateX(-100%);\n box-shadow: none;\n ";
5398
5605
  }));
5399
5606
  var DialogTabMenu = styled__default.ul.withConfig({
5400
5607
  displayName: "DialogWithSidebar__DialogTabMenu",
5401
5608
  componentId: "suvg9r-1"
5402
- })(["cursor:default;overflow:auto;text-align:left;color:inherit;user-select:none;li{position:relative;padding:1rem 2rem 1rem 4.1rem;font-size:14px;:hover{background-color:rgba(0,0,0,0.1);cursor:pointer;}&.selected{color:", ";background:rgba(0,132,214,0.125);pointer-events:none;}}.icon{position:absolute;left:1rem;top:50%;transform:translateY(-50%);width:3rem;text-align:center;line-height:0;font-size:26px;}", ""], utils.getColor('main'), function (props) {
5609
+ })(["cursor:default;overflow:auto;text-align:left;color:inherit;user-select:none;li{position:relative;padding:1rem 2rem 1rem 4.1rem;font-size:14px;", ":hover{background-color:rgba(0,0,0,0.1);cursor:pointer;}&.selected{color:", ";background:rgba(0,132,214,0.125);pointer-events:none;}}.icon{position:absolute;left:1rem;top:50%;transform:translateY(-50%);width:3rem;text-align:center;line-height:0;font-size:26px;}", ""], utils.media.mobile(_templateObject2$5()), utils.getColor('main'), function (props) {
5403
5610
  return props.menuTabIsOpen && "\n li {\n padding: 1.25rem 2rem 1.25rem 3.25rem;\n border-radius: 6px\n }\n .icon{\n left: 0;\n }\n ";
5404
5611
  });
5405
5612
 
@@ -5443,7 +5650,7 @@ var DialogWithSidebarPresentation = function DialogWithSidebarPresentation(_ref)
5443
5650
  visibleOnDesktop: true
5444
5651
  }, sidebar(tab)), React__default.createElement("div", {
5445
5652
  className: (menuTabIsOpen ? "menuTabIsOpen " : "") + "main-container"
5446
- }, React__default.createElement("h2", null, menuTabIsOpen ? "Configurações da página" : React__default.createElement(React__default.Fragment, null, React__default.createElement("span", {
5653
+ }, React__default.createElement("h2", null, menuTabIsOpen ? "Configurações gerais" : React__default.createElement(React__default.Fragment, null, React__default.createElement("span", {
5447
5654
  className: "icon icon-menu mobile-only",
5448
5655
  onClick: sideMenu.open
5449
5656
  }), title(tab))), React__default.createElement(React__default.Suspense, {
@@ -5486,7 +5693,7 @@ var DialogWithSidebar = styled__default(function (props) {
5486
5693
  }).withConfig({
5487
5694
  displayName: "DialogWithSidebar",
5488
5695
  componentId: "suvg9r-2"
5489
- })(["max-width:59rem;display:flex;padding:0;flex-direction:row;", ""], utils.media.mobile(_templateObject2$5()));
5696
+ })(["max-width:59rem;display:flex;padding:0;flex-direction:row;", ""], utils.media.mobile(_templateObject3$3()));
5490
5697
 
5491
5698
  var MobileBubbleDialogFooter = styled__default.div.withConfig({
5492
5699
  displayName: "MobileBubbleDialog__MobileBubbleDialogFooter",
@@ -5524,6 +5731,7 @@ var MobileBubbleDialog = styled__default(function (_ref) {
5524
5731
  })(["border-radius:10px;background-color:white;width:100%;margin:auto;position:relative;align-self:baseline;overflow:hidden;@supports (flex-wrap:wrap){display:flex;flex-direction:column;}"]);
5525
5732
 
5526
5733
  exports.AnimatedModal = AnimatedModal;
5734
+ exports.AnimationBlockContainer = AnimationBlockContainer;
5527
5735
  exports.Button = Button;
5528
5736
  exports.CloseIcon = CloseIcon;
5529
5737
  exports.ConfirmDialog = ConfirmDialog;
@@ -5571,6 +5779,7 @@ exports.MobileBubbleDialog = MobileBubbleDialog;
5571
5779
  exports.Modal = Modal;
5572
5780
  exports.ModalContainer = ModalContainer;
5573
5781
  exports.Notifications = Notifications;
5782
+ exports.OnClickLoadingButton = OnClickLoadingButton;
5574
5783
  exports.PageLoader = PageLoader;
5575
5784
  exports.PersistentNotifications = PersistentNotifications;
5576
5785
  exports.Popup = Popup;
@@ -5585,6 +5794,8 @@ exports.TextButton = TextButton;
5585
5794
  exports.Tooltip = Tooltip;
5586
5795
  exports.TransitionDiv = TransitionDiv;
5587
5796
  exports.WarningDialog = WarningDialog;
5797
+ exports.WarningDialogIcon = WarningDialogIcon;
5798
+ exports.WarningDialogTitle = WarningDialogTitle;
5588
5799
  exports.addPositioningBound = addPositioningBound;
5589
5800
  exports.contextMenuLayersQuantity = contextMenuLayersQuantity;
5590
5801
  exports.defaultAnimationMaker = defaultAnimationMaker;
@@ -5595,6 +5806,8 @@ exports.fixDoubledLastMarginBottom = fixDoubledLastMarginBottom;
5595
5806
  exports.formatAnimation = formatAnimation;
5596
5807
  exports.getClientRectAnimation = getClientRectAnimation;
5597
5808
  exports.getDialogLayersSize = getDialogLayersSize;
5809
+ exports.hidePersistentNotifications = hidePersistentNotifications;
5810
+ exports.isFakeScrolled = isFakeScrolled;
5598
5811
  exports.morph = morph;
5599
5812
  exports.openPersistentNotification = openPersistentNotification;
5600
5813
  exports.preventDialogPop = preventDialogPop;
@@ -5609,6 +5822,7 @@ exports.useFlip = useFlip;
5609
5822
  exports.useFlipAnimation = useFlipAnimation;
5610
5823
  exports.useFlipEnter = useFlipEnter;
5611
5824
  exports.useFlipLeave = useFlipLeave;
5825
+ exports.useIsHiddenPersistentNotifications = useIsHiddenPersistentNotifications;
5612
5826
  exports.useNotification = useNotification;
5613
5827
  exports.useNotificationRef = useNotificationRef;
5614
5828
  exports.usePositioning = usePositioning;