@onepercentio/one-ui 0.19.2 → 0.19.4

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 (392) hide show
  1. package/.babelrc +17 -0
  2. package/.prod.babelrc +22 -0
  3. package/dist/assets/styles/variables.scss +1 -0
  4. package/dist/components/AdaptiveButton/AdaptiveButton.js +24 -25
  5. package/dist/components/AdaptiveButton/index.js +12 -8
  6. package/dist/components/AdaptiveContainer/AdaptiveContainer.js +95 -114
  7. package/dist/components/AdaptiveContainer/index.js +12 -8
  8. package/dist/components/AdaptiveDialog/AdaptiveDialog.js +85 -65
  9. package/dist/components/AdaptiveDialog/index.js +12 -8
  10. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +84 -76
  11. package/dist/components/AdaptiveSidebar/index.js +12 -8
  12. package/dist/components/AnchoredTooltip/AnchoredTooltip.js +155 -160
  13. package/dist/components/AnchoredTooltip/index.js +12 -8
  14. package/dist/components/AnimatedEntrance/AnimatedEntrance.js +172 -139
  15. package/dist/components/AnimatedEntrance/index.js +26 -10
  16. package/dist/components/AsyncWrapper/AsyncWrapper.js +33 -21
  17. package/dist/components/AsyncWrapper/index.js +12 -8
  18. package/dist/components/Avatar/Avatar.js +34 -40
  19. package/dist/components/Avatar/index.js +12 -8
  20. package/dist/components/BucketFill/BucketFill.js +47 -58
  21. package/dist/components/BucketFill/index.js +12 -8
  22. package/dist/components/Button/Button.js +32 -49
  23. package/dist/components/Button/README.md +8 -0
  24. package/dist/components/Button/index.js +12 -8
  25. package/dist/components/Card/Card.js +16 -11
  26. package/dist/components/Card/index.js +12 -8
  27. package/dist/components/Chart/Chart.logic.js +10 -10
  28. package/dist/components/Chart/Chart.types.js +4 -2
  29. package/dist/components/Chart/Chart.view.js +212 -131
  30. package/dist/components/Chart/index.js +12 -8
  31. package/dist/components/CheckBox/CheckBox.d.ts +3 -1
  32. package/dist/components/CheckBox/CheckBox.js +43 -30
  33. package/dist/components/CheckBox/CheckBox.module.scss +6 -0
  34. package/dist/components/CheckBox/index.js +12 -8
  35. package/dist/components/Collapsable/Collapsable.d.ts +26 -27
  36. package/dist/components/Collapsable/Collapsable.js +173 -143
  37. package/dist/components/Collapsable/index.js +12 -8
  38. package/dist/components/Countdown/Countdown.js +87 -100
  39. package/dist/components/Countdown/index.js +12 -8
  40. package/dist/components/Divider/Divider.js +15 -12
  41. package/dist/components/Divider/index.js +12 -8
  42. package/dist/components/EmailInput/EmailInput.d.ts +4 -3
  43. package/dist/components/EmailInput/EmailInput.js +45 -43
  44. package/dist/components/EmailInput/README.md +10 -0
  45. package/dist/components/EmailInput/index.js +20 -9
  46. package/dist/components/FadeIn/FadeIn.js +62 -69
  47. package/dist/components/FadeIn/index.js +12 -8
  48. package/dist/components/FileInput/FileInput.d.ts +25 -9
  49. package/dist/components/FileInput/FileInput.js +41 -70
  50. package/dist/components/FileInput/FileInput.module.scss +0 -21
  51. package/dist/components/FileInput/View/BigFactory/BigFactory.d.ts +6 -0
  52. package/dist/components/FileInput/View/BigFactory/BigFactory.js +46 -0
  53. package/dist/components/FileInput/View/BigFactory/BigFactory.module.scss +20 -0
  54. package/dist/components/FileInput/View/BigFactory/index.d.ts +1 -0
  55. package/dist/components/FileInput/View/BigFactory/index.js +13 -0
  56. package/dist/components/FileInput/View/Compact/Compact.d.ts +5 -0
  57. package/dist/components/FileInput/View/Compact/Compact.js +88 -0
  58. package/dist/components/FileInput/View/Compact/Compact.module.scss +59 -0
  59. package/dist/components/FileInput/View/Compact/index.d.ts +1 -0
  60. package/dist/components/FileInput/View/Compact/index.js +13 -0
  61. package/dist/components/FileInput/View/View.types.d.ts +8 -0
  62. package/dist/components/FileInput/View/View.types.js +5 -0
  63. package/dist/components/FileInput/index.js +12 -8
  64. package/dist/components/FlowController/FlowController.js +60 -29
  65. package/dist/components/FlowController/README.md +13 -0
  66. package/dist/components/FlowController/index.js +12 -8
  67. package/dist/components/Form/Form.js +157 -96
  68. package/dist/components/Form/index.js +12 -8
  69. package/dist/components/Freeze/Freeze.js +11 -10
  70. package/dist/components/Freeze/index.js +12 -8
  71. package/dist/components/HSForms/HSForms.js +48 -68
  72. package/dist/components/HSForms/index.js +12 -8
  73. package/dist/components/Header/Header.js +100 -69
  74. package/dist/components/Header/index.js +12 -8
  75. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +17 -13
  76. package/dist/components/HeaderCloseBtn/index.js +12 -8
  77. package/dist/components/InfinityScroll/InfinityScroll.js +137 -117
  78. package/dist/components/InfinityScroll/index.js +12 -8
  79. package/dist/components/Input/Input.d.ts +8 -6
  80. package/dist/components/Input/Input.js +105 -90
  81. package/dist/components/Input/Input.module.scss +4 -2
  82. package/dist/components/Input/README.md +10 -0
  83. package/dist/components/Input/index.js +12 -8
  84. package/dist/components/InstantCounter/InstantCounter.js +61 -52
  85. package/dist/components/InstantCounter/index.js +12 -8
  86. package/dist/components/LavaLamp/LavaLamp.data.js +95 -87
  87. package/dist/components/LavaLamp/LavaLamp.js +107 -70
  88. package/dist/components/LavaLamp/index.js +12 -8
  89. package/dist/components/LavaLamp/v2/LavaLamp.js +200 -182
  90. package/dist/components/LinkToId/LinkToId.js +42 -28
  91. package/dist/components/LinkToId/index.js +20 -9
  92. package/dist/components/Loader/Loader.js +20 -26
  93. package/dist/components/Loader/index.js +12 -8
  94. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +34 -37
  95. package/dist/components/LoaderDotsIndicator/index.js +12 -8
  96. package/dist/components/LoopableVideo/LoopableVideo.js +29 -30
  97. package/dist/components/LoopableVideo/index.js +12 -8
  98. package/dist/components/MainGrid/MainGrid.js +44 -50
  99. package/dist/components/MainGrid/index.js +12 -8
  100. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +26 -26
  101. package/dist/components/MutableHamburgerButton/index.js +12 -8
  102. package/dist/components/Notification/Notification.js +16 -12
  103. package/dist/components/Notification/index.js +12 -8
  104. package/dist/components/OrderableList/OrderableList.js +406 -374
  105. package/dist/components/OrderableList/index.js +12 -8
  106. package/dist/components/PaginationIndicator/PaginationIndicator.js +230 -196
  107. package/dist/components/PaginationIndicator/index.js +12 -8
  108. package/dist/components/Parallax/Parallax.js +164 -161
  109. package/dist/components/Parallax/index.js +12 -8
  110. package/dist/components/Parallax/math/helpers.js +128 -217
  111. package/dist/components/PasswordInput/PasswordInput.d.ts +4 -3
  112. package/dist/components/PasswordInput/PasswordInput.js +120 -97
  113. package/dist/components/PasswordInput/index.js +12 -8
  114. package/dist/components/PingPongText/PingPongText.d.ts +6 -0
  115. package/dist/components/PingPongText/PingPongText.js +69 -0
  116. package/dist/components/PingPongText/PingPongText.module.scss +4 -0
  117. package/dist/components/PingPongText/index.d.ts +1 -0
  118. package/dist/components/PingPongText/index.js +13 -0
  119. package/dist/components/PixelatedScan/PixelatedScan.js +140 -97
  120. package/dist/components/PixelatedScan/index.js +12 -8
  121. package/dist/components/Portal/Portal.js +54 -64
  122. package/dist/components/Portal/index.js +20 -9
  123. package/dist/components/ProgressBar/ProgressBar.js +48 -45
  124. package/dist/components/ProgressBar/ProgressBar.module.scss +4 -0
  125. package/dist/components/ProgressBar/index.js +20 -9
  126. package/dist/components/ProgressTexts/ProgressTexts.js +42 -34
  127. package/dist/components/ProgressTexts/README.md +12 -0
  128. package/dist/components/ProgressTexts/index.js +12 -8
  129. package/dist/components/Radio/Radio.d.ts +13 -0
  130. package/dist/components/Radio/Radio.js +47 -0
  131. package/dist/components/Radio/Radio.module.scss +34 -0
  132. package/dist/components/Radio/index.d.ts +1 -0
  133. package/dist/components/Radio/index.js +13 -0
  134. package/dist/components/SectionContainer/SectionContainer.js +35 -39
  135. package/dist/components/SectionContainer/index.js +12 -8
  136. package/dist/components/Select/Select.d.ts +2 -1
  137. package/dist/components/Select/Select.js +133 -82
  138. package/dist/components/Select/Select.module.scss +14 -2
  139. package/dist/components/Select/index.js +12 -8
  140. package/dist/components/Skeleton/Skeleton.js +21 -15
  141. package/dist/components/Skeleton/index.js +12 -8
  142. package/dist/components/Spacing/Spacing.js +14 -11
  143. package/dist/components/Spacing/index.js +12 -8
  144. package/dist/components/StaticScroller/StaticScroller.js +61 -81
  145. package/dist/components/StaticScroller/index.js +12 -8
  146. package/dist/components/Switch/Switch.js +29 -25
  147. package/dist/components/Switch/index.js +12 -8
  148. package/dist/components/Table/Table.js +111 -80
  149. package/dist/components/Table/index.js +12 -8
  150. package/dist/components/Tabs/Tabs.js +42 -52
  151. package/dist/components/Tabs/index.js +12 -8
  152. package/dist/components/Text/Text.js +31 -50
  153. package/dist/components/Text/index.js +12 -8
  154. package/dist/components/Transition/MasksFactory/DiagonalReveal.js +46 -22
  155. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +71 -57
  156. package/dist/components/Transition/MasksFactory/PhysicsSquares.js +97 -80
  157. package/dist/components/Transition/MasksFactory/SquareToBalls.js +59 -50
  158. package/dist/components/Transition/MasksFactory/utils.js +25 -28
  159. package/dist/components/Transition/Transition.js +316 -309
  160. package/dist/components/Transition/index.js +20 -9
  161. package/dist/components/UncontrolledTransition/UncontrolledTransition.js +110 -86
  162. package/dist/components/UncontrolledTransition/index.js +12 -8
  163. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +116 -105
  164. package/dist/components/WalletConnectionWrapper/index.js +20 -9
  165. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +51 -69
  166. package/dist/components/utilitary/ScrollAndFocusLock/index.js +12 -8
  167. package/dist/context/AsyncProcess.js +77 -63
  168. package/dist/context/CustomBrowserRouter.js +40 -52
  169. package/dist/context/OneUIProvider.d.ts +8 -2
  170. package/dist/context/OneUIProvider.js +90 -104
  171. package/dist/hooks/logs/README.md +3 -0
  172. package/dist/hooks/logs/useDependencyChangeDetection.js +17 -17
  173. package/dist/hooks/logs/useIsMounting.js +10 -8
  174. package/dist/hooks/persistence/useLocalStorage.js +40 -30
  175. package/dist/hooks/shims/ObjectWatchShim.d.ts +1 -0
  176. package/dist/hooks/shims/ObjectWatchShim.js +49 -46
  177. package/dist/hooks/ui/useAdaptiveImage.js +43 -35
  178. package/dist/hooks/ui/useBreakpoint.js +34 -19
  179. package/dist/hooks/ui/useCustomScrollbar.js +26 -21
  180. package/dist/hooks/ui/useMouseHover.js +29 -16
  181. package/dist/hooks/ui/usePaginationControls.d.ts +0 -4
  182. package/dist/hooks/ui/usePaginationControls.e2e.d.ts +4 -0
  183. package/dist/hooks/ui/usePaginationControls.js +125 -153
  184. package/dist/hooks/ui/useTilt.js +156 -128
  185. package/dist/hooks/ui/useZoomable.js +114 -138
  186. package/dist/hooks/useAsyncControl.js +82 -47
  187. package/dist/hooks/useContainedRepositioning.js +75 -72
  188. package/dist/hooks/useCustomHistory.js +21 -13
  189. package/dist/hooks/useElementFit.js +42 -34
  190. package/dist/hooks/useFirestoreWatch.js +54 -35
  191. package/dist/hooks/useForm.js +47 -22
  192. package/dist/hooks/useFreeze.js +11 -9
  193. package/dist/hooks/useHero.d.ts +4 -0
  194. package/dist/hooks/useHero.js +171 -159
  195. package/dist/hooks/useIntersection.js +33 -27
  196. package/dist/hooks/useMergeRefs.js +26 -23
  197. package/dist/hooks/useObserve.js +28 -15
  198. package/dist/hooks/usePagination.js +151 -129
  199. package/dist/hooks/usePooledOperation.js +43 -58
  200. package/dist/hooks/usePooling.js +62 -48
  201. package/dist/hooks/useRebound.js +36 -22
  202. package/dist/hooks/useShortIntl.js +79 -51
  203. package/dist/hooks/utility/useEvents.js +28 -22
  204. package/dist/hooks/utility/useModule.js +21 -10
  205. package/dist/hooks/utility/useQuery.js +14 -8
  206. package/dist/models/DebugLogger.js +7 -6
  207. package/dist/models/GenericContract.js +39 -12
  208. package/dist/reac-app-env.d.js +1 -0
  209. package/dist/storybook/assets/video/txt-reversed.mp4 +0 -0
  210. package/dist/storybookUtils/index.js +42 -24
  211. package/dist/type-utils.js +4 -2
  212. package/dist/types.js +4 -2
  213. package/dist/utility.d.js +17 -0
  214. package/dist/utils/blockchain.js +60 -54
  215. package/dist/utils/flatten.js +23 -13
  216. package/dist/utils/html.utils.js +9 -6
  217. package/dist/utils/ownEvent.js +9 -8
  218. package/package.json +14 -9
  219. package/tsconfig.json +3 -2
  220. package/cypress/support/commands.ts +0 -49
  221. package/cypress/support/component-index.html +0 -30
  222. package/cypress/support/component.ts +0 -39
  223. package/cypress/support/e2e.js +0 -49
  224. package/dist/components/AdaptiveButton/AdaptiveButton.js.map +0 -1
  225. package/dist/components/AdaptiveButton/index.js.map +0 -1
  226. package/dist/components/AdaptiveContainer/AdaptiveContainer.js.map +0 -1
  227. package/dist/components/AdaptiveContainer/index.js.map +0 -1
  228. package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +0 -1
  229. package/dist/components/AdaptiveDialog/index.js.map +0 -1
  230. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +0 -1
  231. package/dist/components/AdaptiveSidebar/index.js.map +0 -1
  232. package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +0 -1
  233. package/dist/components/AnchoredTooltip/index.js.map +0 -1
  234. package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +0 -1
  235. package/dist/components/AnimatedEntrance/index.js.map +0 -1
  236. package/dist/components/AsyncWrapper/AsyncWrapper.js.map +0 -1
  237. package/dist/components/AsyncWrapper/index.js.map +0 -1
  238. package/dist/components/Avatar/Avatar.js.map +0 -1
  239. package/dist/components/Avatar/index.js.map +0 -1
  240. package/dist/components/BucketFill/BucketFill.js.map +0 -1
  241. package/dist/components/BucketFill/index.js.map +0 -1
  242. package/dist/components/Button/Button.js.map +0 -1
  243. package/dist/components/Button/index.js.map +0 -1
  244. package/dist/components/Card/Card.js.map +0 -1
  245. package/dist/components/Card/index.js.map +0 -1
  246. package/dist/components/Chart/Chart.e2e.js +0 -9
  247. package/dist/components/Chart/Chart.e2e.js.map +0 -1
  248. package/dist/components/Chart/Chart.logic.js.map +0 -1
  249. package/dist/components/Chart/Chart.types.js.map +0 -1
  250. package/dist/components/Chart/Chart.view.js.map +0 -1
  251. package/dist/components/Chart/index.js.map +0 -1
  252. package/dist/components/CheckBox/CheckBox.js.map +0 -1
  253. package/dist/components/CheckBox/index.js.map +0 -1
  254. package/dist/components/Collapsable/Collapsable.js.map +0 -1
  255. package/dist/components/Collapsable/index.js.map +0 -1
  256. package/dist/components/Countdown/Countdown.js.map +0 -1
  257. package/dist/components/Countdown/index.js.map +0 -1
  258. package/dist/components/Divider/Divider.js.map +0 -1
  259. package/dist/components/Divider/index.js.map +0 -1
  260. package/dist/components/EmailInput/EmailInput.js.map +0 -1
  261. package/dist/components/EmailInput/index.js.map +0 -1
  262. package/dist/components/FadeIn/FadeIn.js.map +0 -1
  263. package/dist/components/FadeIn/index.js.map +0 -1
  264. package/dist/components/FileInput/FileInput.js.map +0 -1
  265. package/dist/components/FileInput/index.js.map +0 -1
  266. package/dist/components/FlowController/FlowController.js.map +0 -1
  267. package/dist/components/FlowController/index.js.map +0 -1
  268. package/dist/components/Form/Form.js.map +0 -1
  269. package/dist/components/Form/index.js.map +0 -1
  270. package/dist/components/Freeze/Freeze.js.map +0 -1
  271. package/dist/components/Freeze/index.js.map +0 -1
  272. package/dist/components/HSForms/HSForms.js.map +0 -1
  273. package/dist/components/HSForms/index.js.map +0 -1
  274. package/dist/components/Header/Header.js.map +0 -1
  275. package/dist/components/Header/index.js.map +0 -1
  276. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js.map +0 -1
  277. package/dist/components/HeaderCloseBtn/index.js.map +0 -1
  278. package/dist/components/InfinityScroll/InfinityScroll.js.map +0 -1
  279. package/dist/components/InfinityScroll/index.js.map +0 -1
  280. package/dist/components/Input/Input.js.map +0 -1
  281. package/dist/components/Input/index.js.map +0 -1
  282. package/dist/components/InstantCounter/InstantCounter.js.map +0 -1
  283. package/dist/components/InstantCounter/index.js.map +0 -1
  284. package/dist/components/LavaLamp/LavaLamp.data.js.map +0 -1
  285. package/dist/components/LavaLamp/LavaLamp.js.map +0 -1
  286. package/dist/components/LavaLamp/index.js.map +0 -1
  287. package/dist/components/LavaLamp/v2/LavaLamp.js.map +0 -1
  288. package/dist/components/LinkToId/LinkToId.js.map +0 -1
  289. package/dist/components/LinkToId/index.js.map +0 -1
  290. package/dist/components/Loader/Loader.js.map +0 -1
  291. package/dist/components/Loader/index.js.map +0 -1
  292. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js.map +0 -1
  293. package/dist/components/LoaderDotsIndicator/index.js.map +0 -1
  294. package/dist/components/LoopableVideo/LoopableVideo.js.map +0 -1
  295. package/dist/components/LoopableVideo/index.js.map +0 -1
  296. package/dist/components/MainGrid/MainGrid.js.map +0 -1
  297. package/dist/components/MainGrid/index.js.map +0 -1
  298. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js.map +0 -1
  299. package/dist/components/MutableHamburgerButton/index.js.map +0 -1
  300. package/dist/components/Notification/Notification.js.map +0 -1
  301. package/dist/components/Notification/index.js.map +0 -1
  302. package/dist/components/OrderableList/OrderableList.js.map +0 -1
  303. package/dist/components/OrderableList/index.js.map +0 -1
  304. package/dist/components/PaginationIndicator/PaginationIndicator.js.map +0 -1
  305. package/dist/components/PaginationIndicator/index.js.map +0 -1
  306. package/dist/components/Parallax/Parallax.js.map +0 -1
  307. package/dist/components/Parallax/index.js.map +0 -1
  308. package/dist/components/Parallax/math/helpers.js.map +0 -1
  309. package/dist/components/PasswordInput/PasswordInput.js.map +0 -1
  310. package/dist/components/PasswordInput/index.js.map +0 -1
  311. package/dist/components/PixelatedScan/PixelatedScan.js.map +0 -1
  312. package/dist/components/PixelatedScan/index.js.map +0 -1
  313. package/dist/components/Portal/Portal.js.map +0 -1
  314. package/dist/components/Portal/index.js.map +0 -1
  315. package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
  316. package/dist/components/ProgressBar/index.js.map +0 -1
  317. package/dist/components/ProgressTexts/ProgressTexts.js.map +0 -1
  318. package/dist/components/ProgressTexts/index.js.map +0 -1
  319. package/dist/components/SectionContainer/SectionContainer.js.map +0 -1
  320. package/dist/components/SectionContainer/index.js.map +0 -1
  321. package/dist/components/Select/Select.js.map +0 -1
  322. package/dist/components/Select/index.js.map +0 -1
  323. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  324. package/dist/components/Skeleton/index.js.map +0 -1
  325. package/dist/components/Spacing/Spacing.js.map +0 -1
  326. package/dist/components/Spacing/index.js.map +0 -1
  327. package/dist/components/StaticScroller/StaticScroller.js.map +0 -1
  328. package/dist/components/StaticScroller/index.js.map +0 -1
  329. package/dist/components/Switch/Switch.js.map +0 -1
  330. package/dist/components/Switch/index.js.map +0 -1
  331. package/dist/components/Table/Table.js.map +0 -1
  332. package/dist/components/Table/index.js.map +0 -1
  333. package/dist/components/Tabs/Tabs.js.map +0 -1
  334. package/dist/components/Tabs/index.js.map +0 -1
  335. package/dist/components/Text/Text.js.map +0 -1
  336. package/dist/components/Text/index.js.map +0 -1
  337. package/dist/components/Transition/MasksFactory/DiagonalReveal.js.map +0 -1
  338. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js.map +0 -1
  339. package/dist/components/Transition/MasksFactory/PhysicsSquares.js.map +0 -1
  340. package/dist/components/Transition/MasksFactory/SquareToBalls.js.map +0 -1
  341. package/dist/components/Transition/MasksFactory/utils.js.map +0 -1
  342. package/dist/components/Transition/Transition.js.map +0 -1
  343. package/dist/components/Transition/index.js.map +0 -1
  344. package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +0 -1
  345. package/dist/components/UncontrolledTransition/index.js.map +0 -1
  346. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +0 -1
  347. package/dist/components/WalletConnectionWrapper/index.js.map +0 -1
  348. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +0 -1
  349. package/dist/components/utilitary/ScrollAndFocusLock/index.js.map +0 -1
  350. package/dist/context/AsyncProcess.js.map +0 -1
  351. package/dist/context/CustomBrowserRouter.js.map +0 -1
  352. package/dist/context/OneUIProvider.js.map +0 -1
  353. package/dist/hooks/logs/useDependencyChangeDetection.js.map +0 -1
  354. package/dist/hooks/logs/useIsMounting.js.map +0 -1
  355. package/dist/hooks/persistence/useLocalStorage.js.map +0 -1
  356. package/dist/hooks/shims/ObjectWatchShim.js.map +0 -1
  357. package/dist/hooks/ui/useAdaptiveImage.js.map +0 -1
  358. package/dist/hooks/ui/useBreakpoint.js.map +0 -1
  359. package/dist/hooks/ui/useCustomScrollbar.js.map +0 -1
  360. package/dist/hooks/ui/useMouseHover.js.map +0 -1
  361. package/dist/hooks/ui/usePaginationControls.js.map +0 -1
  362. package/dist/hooks/ui/useTilt.js.map +0 -1
  363. package/dist/hooks/ui/useZoomable.js.map +0 -1
  364. package/dist/hooks/useAsyncControl.js.map +0 -1
  365. package/dist/hooks/useContainedRepositioning.js.map +0 -1
  366. package/dist/hooks/useCustomHistory.js.map +0 -1
  367. package/dist/hooks/useElementFit.js.map +0 -1
  368. package/dist/hooks/useFirestoreWatch.js.map +0 -1
  369. package/dist/hooks/useForm.js.map +0 -1
  370. package/dist/hooks/useFreeze.js.map +0 -1
  371. package/dist/hooks/useHero.js.map +0 -1
  372. package/dist/hooks/useHero.module.scss +0 -5
  373. package/dist/hooks/useIntersection.js.map +0 -1
  374. package/dist/hooks/useMergeRefs.js.map +0 -1
  375. package/dist/hooks/useObserve.js.map +0 -1
  376. package/dist/hooks/usePagination.js.map +0 -1
  377. package/dist/hooks/usePooledOperation.js.map +0 -1
  378. package/dist/hooks/usePooling.js.map +0 -1
  379. package/dist/hooks/useRebound.js.map +0 -1
  380. package/dist/hooks/useShortIntl.js.map +0 -1
  381. package/dist/hooks/utility/useEvents.js.map +0 -1
  382. package/dist/hooks/utility/useModule.js.map +0 -1
  383. package/dist/hooks/utility/useQuery.js.map +0 -1
  384. package/dist/models/DebugLogger.js.map +0 -1
  385. package/dist/models/GenericContract.js.map +0 -1
  386. package/dist/storybookUtils/index.js.map +0 -1
  387. package/dist/type-utils.js.map +0 -1
  388. package/dist/types.js.map +0 -1
  389. package/dist/utils/blockchain.js.map +0 -1
  390. package/dist/utils/flatten.js.map +0 -1
  391. package/dist/utils/html.utils.js.map +0 -1
  392. package/dist/utils/ownEvent.js.map +0 -1
@@ -1,160 +1,190 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
17
6
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.CollapsableInterface = void 0;
41
- const FadeIn_1 = __importDefault(require("../FadeIn"));
42
- const react_1 = __importStar(require("react"));
43
- const Collapsable_module_scss_1 = __importDefault(require("./Collapsable.module.scss"));
44
- const AnchoredTooltip_1 = require("../AnchoredTooltip/AnchoredTooltip");
7
+ exports.CollapsableInterface = CollapsableInterface;
8
+ exports.default = void 0;
9
+ var _FadeIn = _interopRequireDefault(require("../FadeIn"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _CollapsableModule = _interopRequireDefault(require("./Collapsable.module.scss"));
12
+ var _AnchoredTooltip = require("../AnchoredTooltip/AnchoredTooltip");
13
+ const _excluded = ["children", "title", "className", "onToggleOpen", "open", "id", "mode", "contentClassName", "onContentClick", "keepUnderlayingElement", "onClickOut"];
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
+ 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; }
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
19
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
+ 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); }
21
+ 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; }
22
+ 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; }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
+ 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); }
26
+ 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; }
27
+ 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; }
45
28
  /**
46
29
  * Wrapps some content on a collapsable header
47
30
  **/
48
- function Collapsable(_a) {
49
- var { children, title, className, onToggleOpen, open, id, mode = "block", contentClassName, onContentClick, keepUnderlayingElement, onClickOut } = _a, props = __rest(_a, ["children", "title", "className", "onToggleOpen", "open", "id", "mode", "contentClassName", "onContentClick", "keepUnderlayingElement", "onClickOut"]);
50
- const contentRef = (0, react_1.useRef)(null);
51
- const toggleRef = (0, react_1.useRef)(null);
52
- (0, react_1.useEffect)(() => {
53
- if (open && onClickOut) {
54
- window.addEventListener("click", onClickOut);
55
- return () => window.removeEventListener("click", onClickOut);
56
- }
57
- }, [!!onClickOut, open]);
58
- (0, react_1.useLayoutEffect)(() => {
59
- const el = contentRef.current;
60
- if (open) {
61
- el.style.marginTop = ``;
62
- el.style.height = el.scrollHeight + "px";
63
- el.parentElement.style.position = "relative";
64
- if (mode === "float") {
65
- el.style.minHeight = el.style.height;
66
- const { shouldAnchorToBottom } = (0, AnchoredTooltip_1.updateTooltipPosition)(el, toggleRef.current, true, "alignTo" in props ? props.alignTo : AnchoredTooltip_1.AnchoredTooltipAlignment.CENTER);
67
- el.style.minHeight = "";
68
- if (!shouldAnchorToBottom) {
69
- el.style.marginTop = el.style.height;
70
- }
71
- const transitionStart = ({ currentTarget, target, propertyName, }) => {
72
- if (currentTarget === target &&
73
- propertyName == "height" &&
74
- !shouldAnchorToBottom) {
75
- el.classList.add(Collapsable_module_scss_1.default.transitionMarginTop);
76
- el.style.marginTop = "0px";
77
- }
78
- };
79
- el.addEventListener("transitionstart", transitionStart);
80
- return () => el.removeEventListener("transitionstart", transitionStart);
81
- }
82
- const onTransitionEnd = () => {
83
- el.style.height = "auto";
84
- };
85
- el.addEventListener("transitionend", onTransitionEnd);
86
- el.addEventListener("transitionend", () => el.removeEventListener("transitionend", onTransitionEnd));
87
- return () => {
88
- el.removeEventListener("transitionend", onTransitionEnd);
89
- };
90
- }
91
- else {
92
- el.style.height = el.clientHeight + "px";
93
- setTimeout(() => {
94
- if (el.style.marginTop === "0px")
95
- el.style.marginTop = `${el.clientHeight}px`;
96
- el.style.height = 0 + "px";
97
- }, 100);
98
- const onTransitionEnd = () => {
99
- el.parentElement.style.position = "initial";
100
- el.classList.remove(Collapsable_module_scss_1.default.transitionMarginTop);
101
- el.removeEventListener("transitionend", onTransitionEnd);
102
- };
103
- el.addEventListener("transitionend", onTransitionEnd);
104
- return () => {
105
- el.removeEventListener("transitionend", onTransitionEnd);
106
- };
31
+ function Collapsable(_ref, ref) {
32
+ let children = _ref.children,
33
+ title = _ref.title,
34
+ className = _ref.className,
35
+ onToggleOpen = _ref.onToggleOpen,
36
+ open = _ref.open,
37
+ id = _ref.id,
38
+ _ref$mode = _ref.mode,
39
+ mode = _ref$mode === void 0 ? "block" : _ref$mode,
40
+ contentClassName = _ref.contentClassName,
41
+ onContentClick = _ref.onContentClick,
42
+ keepUnderlayingElement = _ref.keepUnderlayingElement,
43
+ onClickOut = _ref.onClickOut,
44
+ props = _objectWithoutProperties(_ref, _excluded);
45
+ const contentRef = (0, _react.useRef)(null);
46
+ const toggleRef = (0, _react.useRef)(null);
47
+ (0, _react.useEffect)(function () {
48
+ if (open && onClickOut) {
49
+ window.addEventListener("click", onClickOut);
50
+ return function () {
51
+ return window.removeEventListener("click", onClickOut);
52
+ };
53
+ }
54
+ }, [!!onClickOut, open]);
55
+ function _redimension() {
56
+ let canShrink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
57
+ const el = contentRef.current;
58
+ const contentEl = el.firstElementChild;
59
+ if (open) {
60
+ el.style.marginTop = "";
61
+ el.style.height = Math.min(canShrink ? contentEl.clientHeight : Number.POSITIVE_INFINITY, el.scrollHeight, visualViewport.height - 16) + "px";
62
+ el.parentElement.style.position = "relative";
63
+ if (mode === "float") {
64
+ el.style.minHeight = el.style.height;
65
+ const _updateTooltipPositio = (0, _AnchoredTooltip.updateTooltipPosition)(el, toggleRef.current, true, "alignTo" in props ? props.alignTo : _AnchoredTooltip.AnchoredTooltipAlignment.CENTER),
66
+ shouldAnchorToBottom = _updateTooltipPositio.shouldAnchorToBottom;
67
+ el.style.minHeight = "";
68
+ if (!shouldAnchorToBottom) {
69
+ el.style.marginTop = el.style.height;
107
70
  }
108
- }, [open]);
109
- const _b = props, { alignTo } = _b, propsToSpread = __rest(_b, ["alignTo"]);
110
- return (react_1.default.createElement("div", Object.assign({ className: `${Collapsable_module_scss_1.default.container} ${open ? Collapsable_module_scss_1.default.open : Collapsable_module_scss_1.default.closed} ${className}` }, propsToSpread),
111
- react_1.default.createElement("div", { ref: toggleRef, onClick: (e) => {
112
- e.stopPropagation();
113
- onToggleOpen(!open);
114
- }, id: _collapsableId("header", id) }, title),
115
- react_1.default.createElement("div", { onClick: (e) => {
116
- e.stopPropagation();
117
- if (onContentClick)
118
- onContentClick(e);
119
- }, ref: contentRef, className: `${Collapsable_module_scss_1.default.content} ${Collapsable_module_scss_1.default[mode] || ""} ${contentClassName}`, id: _collapsableId("content", id) },
120
- react_1.default.createElement(FadeIn_1.default, null, open || keepUnderlayingElement ? children : null))));
71
+ const transitionStart = function transitionStart(_ref2) {
72
+ let currentTarget = _ref2.currentTarget,
73
+ target = _ref2.target,
74
+ propertyName = _ref2.propertyName;
75
+ if (currentTarget === target && propertyName == "height" && !shouldAnchorToBottom) {
76
+ el.classList.add(_CollapsableModule.default.transitionMarginTop);
77
+ el.style.marginTop = "0px";
78
+ }
79
+ };
80
+ el.addEventListener("transitionstart", transitionStart);
81
+ return function () {
82
+ return el.removeEventListener("transitionstart", transitionStart);
83
+ };
84
+ }
85
+ const onTransitionEnd = function onTransitionEnd() {
86
+ el.style.height = "auto";
87
+ };
88
+ el.addEventListener("transitionend", onTransitionEnd);
89
+ el.addEventListener("transitionend", function () {
90
+ return el.removeEventListener("transitionend", onTransitionEnd);
91
+ });
92
+ return function () {
93
+ el.removeEventListener("transitionend", onTransitionEnd);
94
+ };
95
+ } else {
96
+ el.style.height = el.clientHeight + "px";
97
+ setTimeout(function () {
98
+ if (el.style.marginTop === "0px") el.style.marginTop = "".concat(el.clientHeight, "px");
99
+ el.style.height = 0 + "px";
100
+ }, 100);
101
+ const onTransitionEnd = function onTransitionEnd() {
102
+ el.parentElement.style.position = "initial";
103
+ el.classList.remove(_CollapsableModule.default.transitionMarginTop);
104
+ el.removeEventListener("transitionend", onTransitionEnd);
105
+ };
106
+ el.addEventListener("transitionend", onTransitionEnd);
107
+ return function () {
108
+ el.removeEventListener("transitionend", onTransitionEnd);
109
+ };
110
+ }
111
+ }
112
+ (0, _react.useImperativeHandle)(ref, function () {
113
+ return {
114
+ redimension: function redimension() {
115
+ return _redimension(true);
116
+ }
117
+ };
118
+ });
119
+ (0, _react.useLayoutEffect)(function () {
120
+ _redimension();
121
+ }, [open]);
122
+ const propsToSpread = _objectSpread({}, props);
123
+ delete propsToSpread.alignTo;
124
+ return /*#__PURE__*/_react.default.createElement("div", _extends({
125
+ className: "".concat(_CollapsableModule.default.container, " ").concat(open ? _CollapsableModule.default.open : _CollapsableModule.default.closed, " ").concat(className)
126
+ }, propsToSpread), /*#__PURE__*/_react.default.createElement("div", {
127
+ ref: toggleRef,
128
+ onClick: function onClick(e) {
129
+ e.stopPropagation();
130
+ onToggleOpen(!open);
131
+ },
132
+ id: _collapsableId("header", id)
133
+ }, title), /*#__PURE__*/_react.default.createElement("div", {
134
+ onClick: function onClick(e) {
135
+ e.stopPropagation();
136
+ if (onContentClick) onContentClick(e);
137
+ },
138
+ ref: contentRef,
139
+ className: "".concat(_CollapsableModule.default.content, " ").concat(_CollapsableModule.default[mode] || "", " ").concat(contentClassName),
140
+ id: _collapsableId("content", id)
141
+ }, /*#__PURE__*/_react.default.createElement(_FadeIn.default, null, open || keepUnderlayingElement ? children : null)));
121
142
  }
122
- exports.default = Collapsable;
123
143
  function _collapsableId(type, id) {
124
- return id ? `collapsable_${type}_${id}` : undefined;
144
+ return id ? "collapsable_".concat(type, "_").concat(id) : undefined;
125
145
  }
126
- class _CollapsableInterface {
127
- constructor(id) {
128
- this._id = id;
146
+ let _CollapsableInterface = /*#__PURE__*/function () {
147
+ function _CollapsableInterface(id) {
148
+ _classCallCheck(this, _CollapsableInterface);
149
+ this._id = id;
150
+ }
151
+ _createClass(_CollapsableInterface, [{
152
+ key: "_getElements",
153
+ value: function _getElements() {
154
+ return {
155
+ header: document.getElementById(_collapsableId("header", this._id)),
156
+ content: document.getElementById(_collapsableId("content", this._id))
157
+ };
129
158
  }
130
- _getElements() {
131
- return {
132
- header: document.getElementById(_collapsableId("header", this._id)),
133
- content: document.getElementById(_collapsableId("content", this._id)),
134
- };
159
+ }, {
160
+ key: "open",
161
+ value: function open(onOpened) {
162
+ const _this$_getElements = this._getElements(),
163
+ header = _this$_getElements.header,
164
+ content = _this$_getElements.content;
165
+ if (((content === null || content === void 0 ? void 0 : content.clientHeight) || 0) === 0) {
166
+ header.click();
167
+ content.addEventListener("transitionend", function _handler() {
168
+ content.removeEventListener("transitionend", _handler);
169
+ onOpened();
170
+ });
171
+ } else {
172
+ onOpened();
173
+ }
135
174
  }
136
- open(onOpened) {
137
- const { header, content } = this._getElements();
138
- if (((content === null || content === void 0 ? void 0 : content.clientHeight) || 0) === 0) {
139
- header.click();
140
- content.addEventListener("transitionend", function _handler() {
141
- content.removeEventListener("transitionend", _handler);
142
- onOpened();
143
- });
144
- }
145
- else {
146
- onOpened();
147
- }
175
+ }, {
176
+ key: "getElement",
177
+ value: function getElement(type) {
178
+ return document.getElementById(_collapsableId(type, this._id));
148
179
  }
149
- getElement(type) {
150
- return document.getElementById(_collapsableId(type, this._id));
151
- }
152
- }
180
+ }]);
181
+ return _CollapsableInterface;
182
+ }();
153
183
  /**
154
184
  * A helper function for interacting with collapsables without a reference
155
185
  */
156
186
  function CollapsableInterface(id) {
157
- return new _CollapsableInterface(id);
187
+ return new _CollapsableInterface(id);
158
188
  }
159
- exports.CollapsableInterface = CollapsableInterface;
160
- //# sourceMappingURL=Collapsable.js.map
189
+ var _default = /*#__PURE__*/(0, _react.forwardRef)(Collapsable);
190
+ exports.default = _default;
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = void 0;
7
- var Collapsable_1 = require("./Collapsable");
8
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Collapsable_1).default; } });
9
- //# sourceMappingURL=index.js.map
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Collapsable.default;
10
+ }
11
+ });
12
+ var _Collapsable = _interopRequireDefault(require("./Collapsable"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,110 +1,97 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
17
6
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.CountdownTextModel = exports.calculateTimeFromTimespan = void 0;
27
- const react_1 = __importStar(require("react"));
7
+ exports.CountdownTextModel = void 0;
8
+ exports.calculateTimeFromTimespan = calculateTimeFromTimespan;
9
+ exports.default = Countdown;
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ 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); }
12
+ 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; }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
19
  function calculateTimeFromTimespan(timespan) {
29
- const seconds = Math.floor(timespan / 1000);
30
- const minutes = Math.floor(seconds / 60);
31
- const hours = Math.floor(minutes / 60);
32
- return {
33
- hours,
34
- minutes: minutes % 60,
35
- seconds: seconds % 60,
36
- };
20
+ const seconds = Math.floor(timespan / 1000);
21
+ const minutes = Math.floor(seconds / 60);
22
+ const hours = Math.floor(minutes / 60);
23
+ return {
24
+ hours: hours,
25
+ minutes: minutes % 60,
26
+ seconds: seconds % 60
27
+ };
37
28
  }
38
- exports.calculateTimeFromTimespan = calculateTimeFromTimespan;
39
29
  const IntegerFormatter = new Intl.NumberFormat(undefined, {
40
- minimumIntegerDigits: 2,
30
+ minimumIntegerDigits: 2
41
31
  });
42
- var CountdownTextModel;
43
- (function (CountdownTextModel) {
44
- /** This shows the countdown on the format 00:00:00 */
45
- CountdownTextModel[CountdownTextModel["CLOCK"] = 0] = "CLOCK";
46
- /** This shows the countdown on the format 00h 00m 00s */
47
- CountdownTextModel[CountdownTextModel["SHORT"] = 1] = "SHORT";
48
- })(CountdownTextModel = exports.CountdownTextModel || (exports.CountdownTextModel = {}));
32
+ let CountdownTextModel = /*#__PURE__*/function (CountdownTextModel) {
33
+ CountdownTextModel[CountdownTextModel["CLOCK"] = 0] = "CLOCK";
34
+ CountdownTextModel[CountdownTextModel["SHORT"] = 1] = "SHORT";
35
+ return CountdownTextModel;
36
+ }({});
49
37
  /**
50
38
  * You five it some time, and a countdown is shown
51
39
  **/
52
- function Countdown({ timeRemaining, onFinish, model = CountdownTextModel.CLOCK, options, }) {
53
- const [t, setT] = (0, react_1.useState)(() => calculateTimeFromTimespan(timeRemaining));
54
- (0, react_1.useLayoutEffect)(() => {
55
- setT(calculateTimeFromTimespan(timeRemaining));
56
- }, [timeRemaining]);
57
- (0, react_1.useEffect)(() => {
58
- const cl = setInterval(() => {
59
- setT((prev) => {
60
- let nextSecond = prev.seconds - 1;
61
- let nextMinute = prev.minutes;
62
- let nextHour = prev.hours;
63
- if (nextSecond < 0) {
64
- nextSecond = 59;
65
- nextMinute -= 1;
66
- if (nextMinute < 0) {
67
- nextMinute = 59;
68
- nextHour -= 1;
69
- }
70
- }
71
- if (nextHour === 0 && nextMinute === 0 && nextSecond === 0) {
72
- if (onFinish)
73
- onFinish();
74
- clearInterval(cl);
75
- }
76
- return {
77
- seconds: nextSecond,
78
- minutes: nextMinute,
79
- hours: nextHour,
80
- };
81
- });
82
- }, 1000);
83
- return () => {
84
- clearInterval(cl);
85
- };
86
- }, [timeRemaining]);
87
- const txt = (0, react_1.useMemo)(() => {
88
- var _a, _b;
89
- switch (model) {
90
- case CountdownTextModel.CLOCK:
91
- const hourFragment = ((_a = options === null || options === void 0 ? void 0 : options.hours) !== null && _a !== void 0 ? _a : true) ? `${IntegerFormatter.format(t.hours)}:` : "";
92
- return (react_1.default.createElement(react_1.Fragment, null, `${hourFragment}${IntegerFormatter.format(t.minutes)}:${IntegerFormatter.format(t.seconds)}`));
93
- case CountdownTextModel.SHORT:
94
- const hourFragmentS = ((_b = options === null || options === void 0 ? void 0 : options.hours) !== null && _b !== void 0 ? _b : true) ? (react_1.default.createElement(react_1.default.Fragment, null,
95
- IntegerFormatter.format(t.hours),
96
- react_1.default.createElement("span", null, "h"),
97
- "\u00A0")) : ("");
98
- return (react_1.default.createElement(react_1.Fragment, null,
99
- hourFragmentS,
100
- IntegerFormatter.format(t.minutes),
101
- react_1.default.createElement("span", null, "m"),
102
- "\u00A0",
103
- IntegerFormatter.format(t.seconds),
104
- react_1.default.createElement("span", null, "s")));
40
+ exports.CountdownTextModel = CountdownTextModel;
41
+ function Countdown(_ref) {
42
+ let timeRemaining = _ref.timeRemaining,
43
+ onFinish = _ref.onFinish,
44
+ _ref$model = _ref.model,
45
+ model = _ref$model === void 0 ? CountdownTextModel.CLOCK : _ref$model,
46
+ options = _ref.options;
47
+ const _useState = (0, _react.useState)(function () {
48
+ return calculateTimeFromTimespan(timeRemaining);
49
+ }),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ t = _useState2[0],
52
+ setT = _useState2[1];
53
+ (0, _react.useLayoutEffect)(function () {
54
+ setT(calculateTimeFromTimespan(timeRemaining));
55
+ }, [timeRemaining]);
56
+ (0, _react.useEffect)(function () {
57
+ const cl = setInterval(function () {
58
+ setT(function (prev) {
59
+ let nextSecond = prev.seconds - 1;
60
+ let nextMinute = prev.minutes;
61
+ let nextHour = prev.hours;
62
+ if (nextSecond < 0) {
63
+ nextSecond = 59;
64
+ nextMinute -= 1;
65
+ if (nextMinute < 0) {
66
+ nextMinute = 59;
67
+ nextHour -= 1;
68
+ }
105
69
  }
106
- }, [t, model]);
107
- return react_1.default.createElement("span", null, txt);
108
- }
109
- exports.default = Countdown;
110
- //# sourceMappingURL=Countdown.js.map
70
+ if (nextHour === 0 && nextMinute === 0 && nextSecond === 0) {
71
+ if (onFinish) onFinish();
72
+ clearInterval(cl);
73
+ }
74
+ return {
75
+ seconds: nextSecond,
76
+ minutes: nextMinute,
77
+ hours: nextHour
78
+ };
79
+ });
80
+ }, 1000);
81
+ return function () {
82
+ clearInterval(cl);
83
+ };
84
+ }, [timeRemaining]);
85
+ const txt = (0, _react.useMemo)(function () {
86
+ var _options$hours, _options$hours2;
87
+ switch (model) {
88
+ case CountdownTextModel.CLOCK:
89
+ const hourFragment = ((_options$hours = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours !== void 0 ? _options$hours : true) ? "".concat(IntegerFormatter.format(t.hours), ":") : "";
90
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, "".concat(hourFragment).concat(IntegerFormatter.format(t.minutes), ":").concat(IntegerFormatter.format(t.seconds)));
91
+ case CountdownTextModel.SHORT:
92
+ const hourFragmentS = ((_options$hours2 = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours2 !== void 0 ? _options$hours2 : true) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, IntegerFormatter.format(t.hours), /*#__PURE__*/_react.default.createElement("span", null, "h"), "\xA0") : "";
93
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, hourFragmentS, IntegerFormatter.format(t.minutes), /*#__PURE__*/_react.default.createElement("span", null, "m"), "\xA0", IntegerFormatter.format(t.seconds), /*#__PURE__*/_react.default.createElement("span", null, "s"));
94
+ }
95
+ }, [t, model]);
96
+ return /*#__PURE__*/_react.default.createElement("span", null, txt);
97
+ }
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = void 0;
7
- var Countdown_1 = require("./Countdown");
8
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Countdown_1).default; } });
9
- //# sourceMappingURL=index.js.map
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Countdown.default;
10
+ }
11
+ });
12
+ var _Countdown = _interopRequireDefault(require("./Countdown"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,16 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const Divider_module_scss_1 = __importDefault(require("./Divider.module.scss"));
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = Divider;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _DividerModule = _interopRequireDefault(require("./Divider.module.scss"));
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
10
  /**
9
11
  * Guess what this does
10
12
  **/
11
- function Divider({ className = "" }) {
12
- return (react_1.default.createElement(react_1.default.Fragment, null,
13
- react_1.default.createElement("div", { className: `${Divider_module_scss_1.default.container} ${className}` })));
14
- }
15
- exports.default = Divider;
16
- //# sourceMappingURL=Divider.js.map
13
+ function Divider(_ref) {
14
+ let _ref$className = _ref.className,
15
+ className = _ref$className === void 0 ? "" : _ref$className;
16
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
17
+ className: "".concat(_DividerModule.default.container, " ").concat(className)
18
+ }));
19
+ }