@onepercentio/one-ui 0.20.4 → 0.21.0

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 (124) hide show
  1. package/.babelrc +6 -0
  2. package/.prod.babelrc +8 -2
  3. package/dist/assets/styles/variables.scss +1 -0
  4. package/dist/components/AdaptiveButton/AdaptiveButton.js +2 -2
  5. package/dist/components/AdaptiveContainer/AdaptiveContainer.js +28 -26
  6. package/dist/components/AdaptiveContainer/AdaptiveContainer.module.scss +3 -1
  7. package/dist/components/AdaptiveDialog/AdaptiveDialog.js +9 -9
  8. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +14 -14
  9. package/dist/components/AnchoredTooltip/AnchoredTooltip.js +30 -30
  10. package/dist/components/AnimatedEntrance/AnimatedEntrance.d.ts +1 -1
  11. package/dist/components/AnimatedEntrance/AnimatedEntrance.js +34 -45
  12. package/dist/components/AsyncWrapper/AsyncWrapper.js +2 -2
  13. package/dist/components/Avatar/Avatar.js +4 -4
  14. package/dist/components/BucketFill/BucketFill.js +9 -9
  15. package/dist/components/Button/Button.js +4 -4
  16. package/dist/components/Card/Card.js +1 -1
  17. package/dist/components/Chart/Chart.view.js +34 -34
  18. package/dist/components/CheckBox/CheckBox.js +3 -3
  19. package/dist/components/Collapsable/Collapsable.js +18 -18
  20. package/dist/components/Countdown/Countdown.js +16 -16
  21. package/dist/components/Divider/Divider.js +1 -1
  22. package/dist/components/EmailInput/EmailInput.d.ts +1 -1
  23. package/dist/components/EmailInput/EmailInput.js +4 -4
  24. package/dist/components/FadeIn/FadeIn.js +9 -9
  25. package/dist/components/FileInput/FileInput.js +6 -6
  26. package/dist/components/FileInput/View/BigFactory/BigFactory.js +1 -1
  27. package/dist/components/FileInput/View/Compact/Compact.js +6 -6
  28. package/dist/components/FlowController/FlowController.js +4 -4
  29. package/dist/components/Form/Form.js +17 -28
  30. package/dist/components/Freeze/Freeze.js +1 -1
  31. package/dist/components/HSForms/HSForms.js +9 -11
  32. package/dist/components/Header/Header.js +7 -7
  33. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +1 -1
  34. package/dist/components/InfinityScroll/InfinityScroll.js +25 -25
  35. package/dist/components/Input/Input.js +13 -13
  36. package/dist/components/InstantCounter/InstantCounter.js +9 -9
  37. package/dist/components/LavaLamp/LavaLamp.data.js +25 -25
  38. package/dist/components/LavaLamp/LavaLamp.js +7 -7
  39. package/dist/components/LavaLamp/v2/LavaLamp.js +29 -45
  40. package/dist/components/LinkToId/LinkToId.js +7 -7
  41. package/dist/components/Loader/Loader.js +2 -2
  42. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +6 -6
  43. package/dist/components/LoopableVideo/LoopableVideo.js +4 -4
  44. package/dist/components/MainGrid/MainGrid.js +2 -2
  45. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +2 -2
  46. package/dist/components/Notification/Notification.js +1 -1
  47. package/dist/components/OrderableList/OrderableList.js +113 -138
  48. package/dist/components/PaginationIndicator/PaginationIndicator.js +50 -50
  49. package/dist/components/Parallax/Parallax.js +39 -39
  50. package/dist/components/Parallax/math/helpers.js +18 -19
  51. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
  52. package/dist/components/PasswordInput/PasswordInput.js +10 -10
  53. package/dist/components/PingPongText/PingPongText.js +15 -15
  54. package/dist/components/PixelatedScan/PixelatedScan.js +19 -19
  55. package/dist/components/Portal/Portal.js +10 -10
  56. package/dist/components/ProgressBar/ProgressBar.js +6 -6
  57. package/dist/components/ProgressTexts/ProgressTexts.js +3 -3
  58. package/dist/components/Radio/Radio.js +3 -3
  59. package/dist/components/SectionContainer/SectionContainer.js +1 -1
  60. package/dist/components/Select/Select.js +13 -13
  61. package/dist/components/Select/Select.module.scss +8 -5
  62. package/dist/components/Skeleton/Skeleton.js +1 -1
  63. package/dist/components/Spacing/Spacing.js +1 -1
  64. package/dist/components/StaticScroller/StaticScroller.js +12 -12
  65. package/dist/components/Switch/Switch.js +2 -2
  66. package/dist/components/Table/Table.js +11 -11
  67. package/dist/components/Tabs/Tabs.d.ts +6 -1
  68. package/dist/components/Tabs/Tabs.js +28 -9
  69. package/dist/components/Tabs/Tabs.module.scss +20 -2
  70. package/dist/components/Text/Text.js +5 -5
  71. package/dist/components/Transition/MasksFactory/DiagonalReveal.js +5 -5
  72. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +17 -17
  73. package/dist/components/Transition/MasksFactory/PhysicsSquares.js +13 -13
  74. package/dist/components/Transition/MasksFactory/SquareToBalls.js +9 -9
  75. package/dist/components/Transition/MasksFactory/utils.js +8 -8
  76. package/dist/components/Transition/Transition.js +49 -49
  77. package/dist/components/UncontrolledTransition/UncontrolledTransition.js +7 -7
  78. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +44 -82
  79. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +6 -6
  80. package/dist/context/AsyncProcess.js +19 -42
  81. package/dist/context/CustomBrowserRouter.js +6 -6
  82. package/dist/context/OneUIProvider.js +15 -15
  83. package/dist/hooks/logs/useDependencyChangeDetection.js +2 -5
  84. package/dist/hooks/persistence/useLocalStorage.js +7 -7
  85. package/dist/hooks/shims/ObjectWatchShim.js +1 -15
  86. package/dist/hooks/ui/useAdaptiveImage.js +6 -6
  87. package/dist/hooks/ui/useBreakpoint.js +5 -5
  88. package/dist/hooks/ui/useCustomScrollbar.js +2 -2
  89. package/dist/hooks/ui/useMouseHover.js +4 -4
  90. package/dist/hooks/ui/usePaginationControls.js +34 -34
  91. package/dist/hooks/ui/useSnapToViewport.js +3 -3
  92. package/dist/hooks/ui/useTilt.js +38 -38
  93. package/dist/hooks/ui/useZoomable.js +20 -20
  94. package/dist/hooks/useAsyncControl.js +21 -38
  95. package/dist/hooks/useContainedRepositioning.js +22 -22
  96. package/dist/hooks/useCustomHistory.js +2 -2
  97. package/dist/hooks/useElementFit.js +6 -6
  98. package/dist/hooks/useFirestoreWatch.js +26 -39
  99. package/dist/hooks/useForm.js +8 -8
  100. package/dist/hooks/useFreeze.js +1 -1
  101. package/dist/hooks/useHero.d.ts +1 -0
  102. package/dist/hooks/useHero.js +132 -91
  103. package/dist/hooks/useHero.module.scss +7 -0
  104. package/dist/hooks/useIntersection.js +3 -3
  105. package/dist/hooks/useMergeRefs.js +3 -7
  106. package/dist/hooks/useObserve.js +5 -5
  107. package/dist/hooks/usePagination.js +39 -59
  108. package/dist/hooks/usePooledOperation.js +8 -22
  109. package/dist/hooks/usePooling.js +17 -33
  110. package/dist/hooks/useRebound.js +5 -5
  111. package/dist/hooks/useShortIntl.js +13 -13
  112. package/dist/hooks/utility/useEvents.js +5 -5
  113. package/dist/hooks/utility/useModule.js +3 -3
  114. package/dist/hooks/utility/useQuery.js +1 -1
  115. package/dist/models/DebugLogger.js +2 -2
  116. package/dist/models/GenericContract.js +1 -1
  117. package/dist/storybookUtils/index.js +1 -1
  118. package/dist/types.d.ts +11 -4
  119. package/dist/utility.d.js +3 -3
  120. package/dist/utils/blockchain.js +29 -102
  121. package/dist/utils/flatten.js +3 -3
  122. package/dist/utils/html.utils.js +1 -1
  123. package/package.json +2 -1
  124. package/src/types.ts +155 -41
@@ -14,7 +14,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
17
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -27,7 +27,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
27
27
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
28
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
29
29
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
30
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
30
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
31
31
  function shouldIncrementPage(howMuchTheParentScrolled, prevSectionPosition, nextSectionPosition) {
32
32
  if (howMuchTheParentScrolled === nextSectionPosition) return 1;else if (howMuchTheParentScrolled === prevSectionPosition) return -1;else return 0;
33
33
  }
@@ -38,12 +38,12 @@ function keys(currPage) {
38
38
  }
39
39
  function getItemsFactory(pageSize, items, isCountTheSameOrLowerThanPage) {
40
40
  return function getItems(page, offset) {
41
- var _pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : pageSize;
42
- var from = page * _pageSize + offset;
41
+ let _pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : pageSize;
42
+ let from = page * _pageSize + offset;
43
43
  if (from < 0) from = items.length + from;
44
44
  if (from > items.length) from = from - items.length;
45
- var to = from + _pageSize;
46
- var slicedItems = items.slice(from, to);
45
+ const to = from + _pageSize;
46
+ const slicedItems = items.slice(from, to);
47
47
  if (slicedItems.length < _pageSize && !isCountTheSameOrLowerThanPage) {
48
48
  slicedItems.push.apply(slicedItems, _toConsumableArray(getItems(0, 0, _pageSize - slicedItems.length)));
49
49
  }
@@ -59,39 +59,39 @@ function getItemsFactory(pageSize, items, isCountTheSameOrLowerThanPage) {
59
59
  * Manages a set of divs that allows the effect of inifinite scrolling between pages
60
60
  **/
61
61
  function InfinityScroll(_ref, ref) {
62
- var items = _ref.items,
62
+ let items = _ref.items,
63
63
  pageSize = _ref.pageSize,
64
64
  _ref$initialPage = _ref.initialPage,
65
65
  initialPage = _ref$initialPage === void 0 ? 0 : _ref$initialPage,
66
66
  pageClass = _ref.pageClass,
67
67
  _ref$className = _ref.className,
68
68
  className = _ref$className === void 0 ? "" : _ref$className;
69
- var _useState = (0, _react.useState)({
69
+ const _useState = (0, _react.useState)({
70
70
  page: initialPage,
71
71
  offset: 0
72
72
  }),
73
73
  _useState2 = _slicedToArray(_useState, 2),
74
74
  currPage = _useState2[0],
75
75
  setCurrPage = _useState2[1];
76
- var parentDiv = (0, _react.useMemo)(function () {
76
+ const parentDiv = (0, _react.useMemo)(function () {
77
77
  return ref || /*#__PURE__*/(0, _react.createRef)();
78
78
  }, [ref]);
79
- var prevDiv = (0, _react.useRef)(null);
80
- var currDiv = (0, _react.useRef)(null);
81
- var nextDiv = (0, _react.useRef)(null);
82
- var isCountTheSameOrLowerThanPage = items.length <= pageSize;
83
- var getItems = (0, _react.useMemo)(function () {
79
+ const prevDiv = (0, _react.useRef)(null);
80
+ const currDiv = (0, _react.useRef)(null);
81
+ const nextDiv = (0, _react.useRef)(null);
82
+ const isCountTheSameOrLowerThanPage = items.length <= pageSize;
83
+ const getItems = (0, _react.useMemo)(function () {
84
84
  return getItemsFactory(pageSize, items, isCountTheSameOrLowerThanPage);
85
85
  }, [pageSize, items, isCountTheSameOrLowerThanPage]);
86
86
  (0, _react.useLayoutEffect)(function () {
87
87
  if (isCountTheSameOrLowerThanPage || window.PRERENDER) return;
88
- var viewportWidth = parentDiv.current.clientWidth;
89
- var centerScroll = parentDiv.current.scrollWidth / 2;
88
+ const viewportWidth = parentDiv.current.clientWidth;
89
+ const centerScroll = parentDiv.current.scrollWidth / 2;
90
90
  parentDiv.current.scrollTo({
91
91
  left: centerScroll - viewportWidth / 2
92
92
  });
93
93
  }, [isCountTheSameOrLowerThanPage, currPage.page, currPage.offset, items]);
94
- var _keys = keys(currPage.page),
94
+ const _keys = keys(currPage.page),
95
95
  _keys2 = _slicedToArray(_keys, 3),
96
96
  beforeKey = _keys2[0],
97
97
  currKey = _keys2[1],
@@ -100,20 +100,20 @@ function InfinityScroll(_ref, ref) {
100
100
  ref: parentDiv,
101
101
  className: "".concat(_InfinityScrollModule.default.container, " ").concat(className),
102
102
  onScroll: !isCountTheSameOrLowerThanPage ? function () {
103
- var pageToIncrement = shouldIncrementPage(Math.round(parentDiv.current.scrollLeft), prevDiv.current.offsetLeft, nextDiv.current.offsetLeft);
103
+ const pageToIncrement = shouldIncrementPage(Math.round(parentDiv.current.scrollLeft), prevDiv.current.offsetLeft, nextDiv.current.offsetLeft);
104
104
  if (pageToIncrement) {
105
105
  setCurrPage(function (prev) {
106
- var nextPage = prev.page + pageToIncrement;
107
- var offset = prev.offset;
106
+ let nextPage = prev.page + pageToIncrement;
107
+ let offset = prev.offset;
108
108
  if (nextPage < 0) {
109
109
  nextPage = Math.round(items.length / pageSize) - 1;
110
- var finalIndex = (nextPage + 1) * pageSize + offset;
111
- var maxIndex = items.length;
112
- var remainingItems = maxIndex + offset - finalIndex;
110
+ const finalIndex = (nextPage + 1) * pageSize + offset;
111
+ const maxIndex = items.length;
112
+ const remainingItems = maxIndex + offset - finalIndex;
113
113
  offset += remainingItems;
114
114
  if (offset === -(items.length - 1)) offset = 1;
115
115
  }
116
- var nextIndex = nextPage * pageSize + offset;
116
+ let nextIndex = nextPage * pageSize + offset;
117
117
  if (nextIndex > items.length) {
118
118
  offset = nextIndex - items.length;
119
119
  nextPage = 0;
@@ -141,7 +141,7 @@ function InfinityScroll(_ref, ref) {
141
141
  }
142
142
  var _default = /*#__PURE__*/(0, _react.forwardRef)(InfinityScroll);
143
143
  exports.default = _default;
144
- var InfinityDataTestId = /*#__PURE__*/function (InfinityDataTestId) {
144
+ let InfinityDataTestId = /*#__PURE__*/function (InfinityDataTestId) {
145
145
  InfinityDataTestId["PREV_PAGE"] = "infinity-prev";
146
146
  InfinityDataTestId["CURR_PAGE"] = "infinity-curr";
147
147
  InfinityDataTestId["NEXT_PAGE"] = "infinity-next";
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _OneUIProvider = require("../../context/OneUIProvider");
10
10
  var _Text = _interopRequireDefault(require("../Text"));
11
11
  var _InputModule = _interopRequireDefault(require("./Input.module.scss"));
12
- var _excluded = ["error", "placeholder", "hideError", "icon", "Icon", "autoFocus", "disclaimer", "multiline", "decoration", "border", "containerProps", "className"];
12
+ const _excluded = ["error", "placeholder", "hideError", "icon", "Icon", "autoFocus", "disclaimer", "multiline", "decoration", "border", "containerProps", "className"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -17,8 +17,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
17
17
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
18
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19
19
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
20
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
21
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
22
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
23
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24
24
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -26,7 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
26
26
  * A transparent input with some prebuilt states common to the application
27
27
  **/
28
28
  function Input(_ref, ref) {
29
- var error = _ref.error,
29
+ let error = _ref.error,
30
30
  _ref$placeholder = _ref.placeholder,
31
31
  placeholder = _ref$placeholder === void 0 ? " " : _ref$placeholder,
32
32
  hideError = _ref.hideError,
@@ -41,23 +41,23 @@ function Input(_ref, ref) {
41
41
  containerProps = _ref.containerProps,
42
42
  localClassName = _ref.className,
43
43
  otherProps = _objectWithoutProperties(_ref, _excluded);
44
- var className = (0, _OneUIProvider.useOneUIConfig)("component.input.className");
45
- var globalBorder = (0, _OneUIProvider.useOneUIConfig)("component.input.border");
46
- var _useState = (0, _react.useState)(false),
44
+ const className = (0, _OneUIProvider.useOneUIConfig)("component.input.className");
45
+ const globalBorder = (0, _OneUIProvider.useOneUIConfig)("component.input.border");
46
+ const _useState = (0, _react.useState)(false),
47
47
  _useState2 = _slicedToArray(_useState, 2),
48
48
  focused = _useState2[0],
49
49
  setFocused = _useState2[1];
50
- var inputRef = (0, _react.useRef)(null);
50
+ const inputRef = (0, _react.useRef)(null);
51
51
  (0, _react.useImperativeHandle)(ref, function () {
52
52
  return inputRef.current;
53
53
  }, []);
54
- var shouldShowError = (0, _react.useMemo)(function () {
54
+ const shouldShowError = (0, _react.useMemo)(function () {
55
55
  if (hideError === "onfocus") return !focused;
56
56
  return !!error;
57
57
  }, [focused, error, hideError]);
58
58
  (0, _react.useEffect)(function () {
59
59
  if (autoFocus) {
60
- var t = setTimeout(function () {
60
+ const t = setTimeout(function () {
61
61
  inputRef.current.focus();
62
62
  }, 500);
63
63
  return function () {
@@ -65,8 +65,8 @@ function Input(_ref, ref) {
65
65
  };
66
66
  }
67
67
  }, [autoFocus]);
68
- var Component = multiline ? "textarea" : "input";
69
- var withBorder = (0, _react.useMemo)(function () {
68
+ const Component = multiline ? "textarea" : "input";
69
+ const withBorder = (0, _react.useMemo)(function () {
70
70
  if (propBorder !== undefined) return propBorder;
71
71
  return globalBorder;
72
72
  }, [propBorder, globalBorder]);
@@ -101,7 +101,7 @@ function Input(_ref, ref) {
101
101
  className: _InputModule.default.icon
102
102
  }, icon)));
103
103
  }
104
- var InputTestIds = /*#__PURE__*/function (InputTestIds) {
104
+ let InputTestIds = /*#__PURE__*/function (InputTestIds) {
105
105
  InputTestIds["DISCLAIMER"] = "disclaimer";
106
106
  InputTestIds["ERROR"] = "error";
107
107
  return InputTestIds;
@@ -12,14 +12,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
12
12
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
13
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
14
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  /**
19
19
  * Increments the numbers from 0 to X
20
20
  **/
21
21
  function InstantCounter(_ref, ref) {
22
- var _ref$from = _ref.from,
22
+ let _ref$from = _ref.from,
23
23
  from = _ref$from === void 0 ? 0 : _ref$from,
24
24
  to = _ref.to,
25
25
  _ref$framesPerSecond = _ref.framesPerSecond,
@@ -29,13 +29,13 @@ function InstantCounter(_ref, ref) {
29
29
  formatOptions = _ref$formatOptions === void 0 ? {} : _ref$formatOptions,
30
30
  _ref$autoStart = _ref.autoStart,
31
31
  autoStart = _ref$autoStart === void 0 ? true : _ref$autoStart;
32
- var _useState = (0, _react.useState)(autoStart),
32
+ const _useState = (0, _react.useState)(autoStart),
33
33
  _useState2 = _slicedToArray(_useState, 2),
34
34
  started = _useState2[0],
35
35
  setStarted = _useState2[1];
36
- var initialValue = (0, _react.useRef)(from);
37
- var spanRef = (0, _react.useRef)(null);
38
- var _useIntl = (0, _reactIntl.useIntl)(),
36
+ const initialValue = (0, _react.useRef)(from);
37
+ const spanRef = (0, _react.useRef)(null);
38
+ const _useIntl = (0, _reactIntl.useIntl)(),
39
39
  formatNumber = _useIntl.formatNumber;
40
40
  (0, _react.useImperativeHandle)(ref, function () {
41
41
  return {
@@ -46,9 +46,9 @@ function InstantCounter(_ref, ref) {
46
46
  }, []);
47
47
  (0, _react.useEffect)(function () {
48
48
  if (started) {
49
- var incrementBy = (to - initialValue.current) / (framesPerSecond * durationInSeconds);
49
+ const incrementBy = (to - initialValue.current) / (framesPerSecond * durationInSeconds);
50
50
  spanRef.current.innerHTML = formatNumber(initialValue.current, formatOptions);
51
- var intervalId = setInterval(function () {
51
+ const intervalId = setInterval(function () {
52
52
  initialValue.current += incrementBy;
53
53
  spanRef.current.innerHTML = formatNumber(initialValue.current, formatOptions);
54
54
  if (Math.round(initialValue.current) === Math.round(to)) {
@@ -13,51 +13,51 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
14
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
15
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- var transitionMs = Number(_LavaLampModule.default.transitionMs);
20
- var transitionPositionMs = Number(_LavaLampModule.default.transitionPositionMs);
19
+ const transitionMs = Number(_LavaLampModule.default.transitionMs);
20
+ const transitionPositionMs = Number(_LavaLampModule.default.transitionPositionMs);
21
21
  exports.transitionPositionMs = transitionPositionMs;
22
22
  function useLavaLampSetup(onUpdatePosition, onUpdateSize) {
23
- var _useState = (0, _react.useState)(),
23
+ const _useState = (0, _react.useState)(),
24
24
  _useState2 = _slicedToArray(_useState, 2),
25
25
  d = _useState2[0],
26
26
  setDim = _useState2[1];
27
- var relativeTo = (0, _react.useRef)(null);
28
- var prevTilt = (0, _react.useRef)();
27
+ const relativeTo = (0, _react.useRef)(null);
28
+ const prevTilt = (0, _react.useRef)();
29
29
  (0, _react.useEffect)(function () {
30
- var baseWidth = Math.min(relativeTo.current.clientWidth, 1440);
30
+ const baseWidth = Math.min(relativeTo.current.clientWidth, 1440);
31
31
  setDim({
32
32
  width: baseWidth,
33
33
  height: baseWidth * (relativeTo.current.clientHeight / relativeTo.current.clientWidth)
34
34
  });
35
35
  }, []);
36
- var updateTiltCb = (0, _react.useMemo)(function () {
37
- var throttlePosition = _lodash.throttle;
36
+ const updateTiltCb = (0, _react.useMemo)(function () {
37
+ const throttlePosition = _lodash.throttle;
38
38
  if (!d) return function () {};
39
- var baseSize = Math.min(d.width, d.height) * 0.1;
40
- var acceleration = (0, _lodash.throttle)(function (currTilt) {
39
+ const baseSize = Math.min(d.width, d.height) * 0.1;
40
+ let acceleration = (0, _lodash.throttle)(function (currTilt) {
41
41
  if (!prevTilt.current) {
42
42
  prevTilt.current = currTilt;
43
43
  return;
44
44
  }
45
- var diff = {
45
+ const diff = {
46
46
  x: Math.abs(prevTilt.current.x - currTilt.x),
47
47
  y: Math.abs(prevTilt.current.y - currTilt.y)
48
48
  };
49
- var baseDiff = Math.max(diff.x, diff.y);
50
- var percent = baseDiff * 100 / 90;
49
+ const baseDiff = Math.max(diff.x, diff.y);
50
+ const percent = baseDiff * 100 / 90;
51
51
  onUpdateSize(baseSize + baseSize * (percent / 100));
52
52
  prevTilt.current = currTilt;
53
53
  }, transitionMs, {
54
54
  leading: false,
55
55
  trailing: true
56
56
  });
57
- var movement = throttlePosition(function (currTilt) {
58
- var x = currTilt.x + 100,
57
+ let movement = throttlePosition(function (currTilt) {
58
+ const x = currTilt.x + 100,
59
59
  y = currTilt.y + 100;
60
- var cx = d.width * x / 200,
60
+ const cx = d.width * x / 200,
61
61
  cy = d.height * y / 200;
62
62
  onUpdatePosition(cx, cy);
63
63
  }, transitionPositionMs, {
@@ -74,15 +74,15 @@ function useLavaLampSetup(onUpdatePosition, onUpdateSize) {
74
74
  round: false,
75
75
  gyroEnabled: false
76
76
  });
77
- var circlesConfig = (0, _react.useMemo)(function () {
77
+ const circlesConfig = (0, _react.useMemo)(function () {
78
78
  if (!d) return [];
79
- var baseSize = Math.min(d.width, d.height) * 0.15;
79
+ const baseSize = Math.min(d.width, d.height) * 0.15;
80
80
  return new Array(10).fill(undefined).map(function (_, i) {
81
- var mod = i % 2;
82
- var startX = Math.random() * d.width * 0.5 + (mod === 0 ? 0 : d.width * 0.5);
83
- var translateX = startX - (startX + 50 + Math.random() * 200);
84
- var startY = Math.random() * d.height * 0.75 + (mod === 0 ? 0 : d.height * 0.25);
85
- var translateY = startY - (startY + 50 + Math.random() * 200);
81
+ const mod = i % 2;
82
+ const startX = Math.random() * d.width * 0.5 + (mod === 0 ? 0 : d.width * 0.5);
83
+ const translateX = startX - (startX + 50 + Math.random() * 200);
84
+ const startY = Math.random() * d.height * 0.75 + (mod === 0 ? 0 : d.height * 0.25);
85
+ const translateY = startY - (startY + 50 + Math.random() * 200);
86
86
  return {
87
87
  baseSize: baseSize,
88
88
  startX: startX,
@@ -15,23 +15,23 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15
15
  * A peaceful component simulating an interactive lavalamp
16
16
  **/
17
17
  function LavaLamp(_ref) {
18
- var className = _ref.className,
18
+ let className = _ref.className,
19
19
  children = _ref.children;
20
- var circleRef = (0, _react.useRef)(null);
21
- var _useLavaLampSetup = (0, _LavaLamp.default)(function (cx, cy) {
22
- var style = circleRef.current.style;
20
+ const circleRef = (0, _react.useRef)(null);
21
+ const _useLavaLampSetup = (0, _LavaLamp.default)(function (cx, cy) {
22
+ const style = circleRef.current.style;
23
23
  style.cx = cx;
24
24
  style.cy = cy;
25
25
  }, function (size) {
26
- var style = circleRef.current.style;
26
+ const style = circleRef.current.style;
27
27
  style.r = size;
28
28
  }),
29
29
  relativeTo = _useLavaLampSetup.relativeTo,
30
30
  d = _useLavaLampSetup.d,
31
31
  circlesConfig = _useLavaLampSetup.circlesConfig;
32
- var randomCircles = (0, _react.useMemo)(function () {
32
+ const randomCircles = (0, _react.useMemo)(function () {
33
33
  return circlesConfig.map(function (_ref2) {
34
- var baseSize = _ref2.baseSize,
34
+ let baseSize = _ref2.baseSize,
35
35
  startX = _ref2.startX,
36
36
  startY = _ref2.startY,
37
37
  translateX = _ref2.translateX,
@@ -12,9 +12,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
14
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
15
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
16
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18
15
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
19
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -28,9 +25,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
28
25
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
26
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
30
27
  function LavaLamp(_ref) {
31
- var className = _ref.className,
28
+ let className = _ref.className,
32
29
  children = _ref.children;
33
- var guideConfig = (0, _react.useRef)({
30
+ const guideConfig = (0, _react.useRef)({
34
31
  size: 0,
35
32
  sizeTimestamp: Date.now(),
36
33
  sizeIncrement: 0,
@@ -39,13 +36,13 @@ function LavaLamp(_ref) {
39
36
  posTimestamp: Date.now(),
40
37
  posIncrement: [0, 0]
41
38
  });
42
- var _useLavaLampSetup = (0, _LavaLamp.default)(function (x, y) {
39
+ const _useLavaLampSetup = (0, _LavaLamp.default)(function (x, y) {
43
40
  guideConfig.current.posIncrement = [x - guideConfig.current.x, y - guideConfig.current.y];
44
41
  guideConfig.current.x = x;
45
42
  guideConfig.current.y = y;
46
43
  guideConfig.current.posTimestamp = Date.now();
47
44
  }, function (_size) {
48
- var size = _size * 1.2;
45
+ const size = _size * 1.2;
49
46
  guideConfig.current.sizeIncrement = guideConfig.current.size === 0 ? 0 : size - guideConfig.current.size;
50
47
  guideConfig.current.size = size;
51
48
  guideConfig.current.sizeTimestamp = Date.now();
@@ -53,12 +50,12 @@ function LavaLamp(_ref) {
53
50
  relativeTo = _useLavaLampSetup.relativeTo,
54
51
  circlesConfig = _useLavaLampSetup.circlesConfig,
55
52
  d = _useLavaLampSetup.d;
56
- var _canvasRef = (0, _react.useRef)(null);
57
- var canvasRef = (0, _useMergeRefs.default)(_canvasRef, relativeTo);
53
+ const _canvasRef = (0, _react.useRef)(null);
54
+ const canvasRef = (0, _useMergeRefs.default)(_canvasRef, relativeTo);
58
55
  (0, _react.useEffect)(function () {
59
56
  if (!d) return;
60
- var fc = canvasRef.current;
61
- var baseColor = getComputedStyle(relativeTo.current).getPropertyValue("--digital-blue") || "#000000";
57
+ const fc = canvasRef.current;
58
+ const baseColor = getComputedStyle(relativeTo.current).getPropertyValue("--digital-blue") || "#000000";
62
59
  var c = document.createElement("canvas"),
63
60
  w = c.width = fc.width = d.width,
64
61
  h = c.height = fc.height = d.height,
@@ -72,23 +69,19 @@ function LavaLamp(_ref) {
72
69
  alphaThreshold: 200
73
70
  },
74
71
  orbs = [];
75
- var animFrame;
72
+ let animFrame;
76
73
  function anim() {
77
74
  animFrame = window.requestAnimationFrame(anim);
78
75
  ctx.clearRect(0, 0, w, h);
79
76
  fctx.fillStyle = "#0000";
80
77
  fctx.fillRect(0, 0, w, h);
81
- for (var i = 0; i < orbs.length; i++) {
82
- orbs[i].step();
83
- }
78
+ for (var i = 0; i < orbs.length; i++) orbs[i].step();
84
79
  var image = ctx.getImageData(0, 0, w, h),
85
80
  data = new Uint8Array(image.data.buffer);
86
- for (var i = 3; i < data.length; i += 4) {
87
- data[i] /= data[i] < opts.alphaThreshold ? 6 : 1;
88
- }
81
+ for (var i = 3; i < data.length; i += 4) data[i] /= data[i] < opts.alphaThreshold ? 6 : 1;
89
82
  fctx.putImageData(image, 0, 0);
90
83
  }
91
- var BaseOrb = /*#__PURE__*/function () {
84
+ let BaseOrb = /*#__PURE__*/function () {
92
85
  function BaseOrb() {
93
86
  _classCallCheck(this, BaseOrb);
94
87
  }
@@ -110,7 +103,7 @@ function LavaLamp(_ref) {
110
103
  }]);
111
104
  return BaseOrb;
112
105
  }();
113
- var Orb = /*#__PURE__*/function (_BaseOrb) {
106
+ let Orb = /*#__PURE__*/function (_BaseOrb) {
114
107
  _inherits(Orb, _BaseOrb);
115
108
  var _super = _createSuper(Orb);
116
109
  function Orb(radius) {
@@ -145,7 +138,7 @@ function LavaLamp(_ref) {
145
138
  }]);
146
139
  return Orb;
147
140
  }(BaseOrb);
148
- var GuideOrb = /*#__PURE__*/function (_BaseOrb2) {
141
+ let GuideOrb = /*#__PURE__*/function (_BaseOrb2) {
149
142
  _inherits(GuideOrb, _BaseOrb2);
150
143
  var _super2 = _createSuper(GuideOrb);
151
144
  function GuideOrb() {
@@ -155,46 +148,37 @@ function LavaLamp(_ref) {
155
148
  _createClass(GuideOrb, [{
156
149
  key: "step",
157
150
  value: function step() {
158
- var deltaTime = Date.now() - guideConfig.current.sizeTimestamp;
159
- var deltaTimePercent = deltaTime > 250 ? 1 : deltaTime * 100 / 250 / 100;
160
- var radius = guideConfig.current.size - (guideConfig.current.sizeIncrement - guideConfig.current.sizeIncrement * deltaTimePercent);
151
+ const deltaTime = Date.now() - guideConfig.current.sizeTimestamp;
152
+ const deltaTimePercent = deltaTime > 250 ? 1 : deltaTime * 100 / 250 / 100;
153
+ const radius = guideConfig.current.size - (guideConfig.current.sizeIncrement - guideConfig.current.sizeIncrement * deltaTimePercent);
161
154
  this.lastRadius = radius;
162
155
  var color = baseColor;
163
- var gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, radius);
156
+ const gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, radius);
164
157
  gradient.addColorStop(0, "".concat(color, "ff"));
165
158
  gradient.addColorStop(0.8, "".concat(color, "cc"));
166
159
  gradient.addColorStop(1, "".concat(color, "00"));
167
160
  this.gradient = gradient;
168
- var deltaTimePos = Date.now() - guideConfig.current.posTimestamp;
169
- var deltaTimePosPercent = deltaTimePos > _LavaLamp.transitionPositionMs ? 1 : deltaTimePos * 100 / _LavaLamp.transitionPositionMs / 100;
170
- var translateX = guideConfig.current.x - (guideConfig.current.posIncrement[0] - guideConfig.current.posIncrement[0] * deltaTimePosPercent);
161
+ const deltaTimePos = Date.now() - guideConfig.current.posTimestamp;
162
+ const deltaTimePosPercent = deltaTimePos > _LavaLamp.transitionPositionMs ? 1 : deltaTimePos * 100 / _LavaLamp.transitionPositionMs / 100;
163
+ const translateX = guideConfig.current.x - (guideConfig.current.posIncrement[0] - guideConfig.current.posIncrement[0] * deltaTimePosPercent);
171
164
  this.lastX = translateX;
172
- var translateY = guideConfig.current.y - (guideConfig.current.posIncrement[1] - guideConfig.current.posIncrement[1] * deltaTimePosPercent);
165
+ const translateY = guideConfig.current.y - (guideConfig.current.posIncrement[1] - guideConfig.current.posIncrement[1] * deltaTimePosPercent);
173
166
  this.lastY = translateY;
174
167
  this.drawCircle(translateX | 0, translateY | 0, radius);
175
168
  }
176
169
  }]);
177
170
  return GuideOrb;
178
171
  }(BaseOrb);
179
- var _iterator = _createForOfIteratorHelper(circlesConfig),
180
- _step;
181
- try {
182
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
183
- var circleConfig = _step.value;
184
- var radius = circleConfig.baseSize * 1.5;
185
- var randomRadius = radius + radius / 2 * Math.random() | 0;
186
- orbs.push(new Orb(randomRadius));
187
- }
188
- } catch (err) {
189
- _iterator.e(err);
190
- } finally {
191
- _iterator.f();
172
+ for (let circleConfig of circlesConfig) {
173
+ const radius = circleConfig.baseSize * 1.5;
174
+ const randomRadius = radius + radius / 2 * Math.random() | 0;
175
+ orbs.push(new Orb(randomRadius));
192
176
  }
193
- var guideOrbInstance = new GuideOrb();
194
- var guideOrbAutoInstance;
177
+ const guideOrbInstance = new GuideOrb();
178
+ let guideOrbAutoInstance;
195
179
  orbs.push(guideOrbInstance);
196
180
  canvasRef.current.parentElement.onmouseleave = function () {
197
- var indexOfGuide = orbs.indexOf(guideOrbInstance);
181
+ const indexOfGuide = orbs.indexOf(guideOrbInstance);
198
182
  if (indexOfGuide !== -1) {
199
183
  guideOrbAutoInstance = new Orb(guideOrbInstance.lastRadius);
200
184
  guideOrbAutoInstance.radius = guideOrbInstance.lastRadius;
@@ -9,13 +9,13 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _LinkToIdModule = _interopRequireDefault(require("./LinkToId.module.scss"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  function scrollToId(id) {
12
- var shouldScrollToCenter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
13
- var el = document.getElementById(id);
12
+ let shouldScrollToCenter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
13
+ const el = document.getElementById(id);
14
14
  if (el) {
15
- var elStyles = window.getComputedStyle(el);
16
- var padding = Number(elStyles.paddingTop.replace(/[^0-9]+/g, ""));
17
- var elementPosition = el.offsetTop;
18
- var elementHeight = el.clientHeight;
15
+ const elStyles = window.getComputedStyle(el);
16
+ const padding = Number(elStyles.paddingTop.replace(/[^0-9]+/g, ""));
17
+ const elementPosition = el.offsetTop;
18
+ const elementHeight = el.clientHeight;
19
19
  window.scrollTo({
20
20
  behavior: "smooth",
21
21
  //Go to element, scroll half the screen height scrollback half the element height
@@ -28,7 +28,7 @@ function scrollToId(id) {
28
28
  * This component creates an iteractive element and on click, routes to the specified id
29
29
  **/
30
30
  function LinkToId(_ref) {
31
- var children = _ref.children,
31
+ let children = _ref.children,
32
32
  id = _ref.id,
33
33
  link = _ref.link,
34
34
  _ref$scrollToCenter = _ref.scrollToCenter,
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = Loader;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _LoaderModule = _interopRequireDefault(require("./Loader.module.scss"));
9
- var _excluded = ["className"];
9
+ const _excluded = ["className"];
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -15,7 +15,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
15
15
  * A simple loader
16
16
  **/
17
17
  function Loader(_ref) {
18
- var _ref$className = _ref.className,
18
+ let _ref$className = _ref.className,
19
19
  className = _ref$className === void 0 ? "" : _ref$className,
20
20
  props = _objectWithoutProperties(_ref, _excluded);
21
21
  return /*#__PURE__*/_react.default.createElement("span", _extends({