@onepercentio/one-ui 0.19.1 → 0.19.3

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 (386) 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 +4 -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 -372
  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/PixelatedScan/PixelatedScan.js +140 -97
  115. package/dist/components/PixelatedScan/index.js +12 -8
  116. package/dist/components/Portal/Portal.js +54 -64
  117. package/dist/components/Portal/index.js +20 -9
  118. package/dist/components/ProgressBar/ProgressBar.js +48 -45
  119. package/dist/components/ProgressBar/index.js +20 -9
  120. package/dist/components/ProgressTexts/ProgressTexts.js +42 -34
  121. package/dist/components/ProgressTexts/README.md +12 -0
  122. package/dist/components/ProgressTexts/index.js +12 -8
  123. package/dist/components/Radio/Radio.d.ts +13 -0
  124. package/dist/components/Radio/Radio.js +47 -0
  125. package/dist/components/Radio/Radio.module.scss +33 -0
  126. package/dist/components/Radio/index.d.ts +1 -0
  127. package/dist/components/Radio/index.js +13 -0
  128. package/dist/components/SectionContainer/SectionContainer.js +35 -39
  129. package/dist/components/SectionContainer/index.js +12 -8
  130. package/dist/components/Select/Select.d.ts +2 -1
  131. package/dist/components/Select/Select.js +133 -82
  132. package/dist/components/Select/Select.module.scss +14 -2
  133. package/dist/components/Select/index.js +12 -8
  134. package/dist/components/Skeleton/Skeleton.js +21 -15
  135. package/dist/components/Skeleton/index.js +12 -8
  136. package/dist/components/Spacing/Spacing.js +14 -11
  137. package/dist/components/Spacing/index.js +12 -8
  138. package/dist/components/StaticScroller/StaticScroller.js +61 -81
  139. package/dist/components/StaticScroller/index.js +12 -8
  140. package/dist/components/Switch/Switch.js +29 -25
  141. package/dist/components/Switch/index.js +12 -8
  142. package/dist/components/Table/Table.js +111 -80
  143. package/dist/components/Table/index.js +12 -8
  144. package/dist/components/Tabs/Tabs.js +42 -52
  145. package/dist/components/Tabs/index.js +12 -8
  146. package/dist/components/Text/Text.js +31 -50
  147. package/dist/components/Text/index.js +12 -8
  148. package/dist/components/Transition/MasksFactory/DiagonalReveal.js +46 -22
  149. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +71 -57
  150. package/dist/components/Transition/MasksFactory/PhysicsSquares.js +97 -80
  151. package/dist/components/Transition/MasksFactory/SquareToBalls.js +59 -50
  152. package/dist/components/Transition/MasksFactory/utils.js +25 -28
  153. package/dist/components/Transition/Transition.js +316 -309
  154. package/dist/components/Transition/index.js +20 -9
  155. package/dist/components/UncontrolledTransition/UncontrolledTransition.js +110 -86
  156. package/dist/components/UncontrolledTransition/index.js +12 -8
  157. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +116 -105
  158. package/dist/components/WalletConnectionWrapper/index.js +20 -9
  159. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +51 -69
  160. package/dist/components/utilitary/ScrollAndFocusLock/index.js +12 -8
  161. package/dist/context/AsyncProcess.js +77 -63
  162. package/dist/context/CustomBrowserRouter.js +40 -52
  163. package/dist/context/OneUIProvider.d.ts +8 -2
  164. package/dist/context/OneUIProvider.js +90 -104
  165. package/dist/hooks/logs/README.md +3 -0
  166. package/dist/hooks/logs/useDependencyChangeDetection.js +17 -17
  167. package/dist/hooks/logs/useIsMounting.js +10 -8
  168. package/dist/hooks/persistence/useLocalStorage.js +40 -30
  169. package/dist/hooks/shims/ObjectWatchShim.d.ts +1 -0
  170. package/dist/hooks/shims/ObjectWatchShim.js +49 -46
  171. package/dist/hooks/ui/useAdaptiveImage.js +43 -35
  172. package/dist/hooks/ui/useBreakpoint.js +34 -19
  173. package/dist/hooks/ui/useCustomScrollbar.js +26 -21
  174. package/dist/hooks/ui/useMouseHover.js +29 -16
  175. package/dist/hooks/ui/usePaginationControls.d.ts +0 -4
  176. package/dist/hooks/ui/usePaginationControls.e2e.d.ts +4 -0
  177. package/dist/hooks/ui/usePaginationControls.js +125 -153
  178. package/dist/hooks/ui/useTilt.js +156 -128
  179. package/dist/hooks/ui/useZoomable.js +114 -138
  180. package/dist/hooks/useAsyncControl.js +82 -47
  181. package/dist/hooks/useContainedRepositioning.js +75 -72
  182. package/dist/hooks/useCustomHistory.js +21 -13
  183. package/dist/hooks/useElementFit.js +42 -34
  184. package/dist/hooks/useFirestoreWatch.js +54 -35
  185. package/dist/hooks/useForm.js +47 -22
  186. package/dist/hooks/useFreeze.js +11 -9
  187. package/dist/hooks/useHero.d.ts +4 -0
  188. package/dist/hooks/useHero.js +171 -159
  189. package/dist/hooks/useIntersection.js +33 -27
  190. package/dist/hooks/useMergeRefs.js +26 -23
  191. package/dist/hooks/useObserve.js +28 -15
  192. package/dist/hooks/usePagination.js +151 -129
  193. package/dist/hooks/usePooledOperation.js +43 -58
  194. package/dist/hooks/usePooling.js +62 -48
  195. package/dist/hooks/useRebound.js +36 -22
  196. package/dist/hooks/useShortIntl.js +79 -51
  197. package/dist/hooks/utility/useEvents.js +28 -22
  198. package/dist/hooks/utility/useModule.js +21 -10
  199. package/dist/hooks/utility/useQuery.js +14 -8
  200. package/dist/models/DebugLogger.js +7 -6
  201. package/dist/models/GenericContract.js +39 -12
  202. package/dist/reac-app-env.d.js +1 -0
  203. package/dist/storybook/assets/video/txt-reversed.mp4 +0 -0
  204. package/dist/storybookUtils/index.js +42 -24
  205. package/dist/type-utils.js +4 -2
  206. package/dist/types.js +4 -2
  207. package/dist/utility.d.js +17 -0
  208. package/dist/utils/blockchain.js +60 -54
  209. package/dist/utils/flatten.js +23 -13
  210. package/dist/utils/html.utils.js +9 -6
  211. package/dist/utils/ownEvent.js +9 -8
  212. package/package.json +13 -8
  213. package/tsconfig.json +3 -2
  214. package/cypress/support/commands.ts +0 -49
  215. package/cypress/support/component-index.html +0 -30
  216. package/cypress/support/component.ts +0 -39
  217. package/cypress/support/e2e.js +0 -49
  218. package/dist/components/AdaptiveButton/AdaptiveButton.js.map +0 -1
  219. package/dist/components/AdaptiveButton/index.js.map +0 -1
  220. package/dist/components/AdaptiveContainer/AdaptiveContainer.js.map +0 -1
  221. package/dist/components/AdaptiveContainer/index.js.map +0 -1
  222. package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +0 -1
  223. package/dist/components/AdaptiveDialog/index.js.map +0 -1
  224. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +0 -1
  225. package/dist/components/AdaptiveSidebar/index.js.map +0 -1
  226. package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +0 -1
  227. package/dist/components/AnchoredTooltip/index.js.map +0 -1
  228. package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +0 -1
  229. package/dist/components/AnimatedEntrance/index.js.map +0 -1
  230. package/dist/components/AsyncWrapper/AsyncWrapper.js.map +0 -1
  231. package/dist/components/AsyncWrapper/index.js.map +0 -1
  232. package/dist/components/Avatar/Avatar.js.map +0 -1
  233. package/dist/components/Avatar/index.js.map +0 -1
  234. package/dist/components/BucketFill/BucketFill.js.map +0 -1
  235. package/dist/components/BucketFill/index.js.map +0 -1
  236. package/dist/components/Button/Button.js.map +0 -1
  237. package/dist/components/Button/index.js.map +0 -1
  238. package/dist/components/Card/Card.js.map +0 -1
  239. package/dist/components/Card/index.js.map +0 -1
  240. package/dist/components/Chart/Chart.e2e.js +0 -9
  241. package/dist/components/Chart/Chart.e2e.js.map +0 -1
  242. package/dist/components/Chart/Chart.logic.js.map +0 -1
  243. package/dist/components/Chart/Chart.types.js.map +0 -1
  244. package/dist/components/Chart/Chart.view.js.map +0 -1
  245. package/dist/components/Chart/index.js.map +0 -1
  246. package/dist/components/CheckBox/CheckBox.js.map +0 -1
  247. package/dist/components/CheckBox/index.js.map +0 -1
  248. package/dist/components/Collapsable/Collapsable.js.map +0 -1
  249. package/dist/components/Collapsable/index.js.map +0 -1
  250. package/dist/components/Countdown/Countdown.js.map +0 -1
  251. package/dist/components/Countdown/index.js.map +0 -1
  252. package/dist/components/Divider/Divider.js.map +0 -1
  253. package/dist/components/Divider/index.js.map +0 -1
  254. package/dist/components/EmailInput/EmailInput.js.map +0 -1
  255. package/dist/components/EmailInput/index.js.map +0 -1
  256. package/dist/components/FadeIn/FadeIn.js.map +0 -1
  257. package/dist/components/FadeIn/index.js.map +0 -1
  258. package/dist/components/FileInput/FileInput.js.map +0 -1
  259. package/dist/components/FileInput/index.js.map +0 -1
  260. package/dist/components/FlowController/FlowController.js.map +0 -1
  261. package/dist/components/FlowController/index.js.map +0 -1
  262. package/dist/components/Form/Form.js.map +0 -1
  263. package/dist/components/Form/index.js.map +0 -1
  264. package/dist/components/Freeze/Freeze.js.map +0 -1
  265. package/dist/components/Freeze/index.js.map +0 -1
  266. package/dist/components/HSForms/HSForms.js.map +0 -1
  267. package/dist/components/HSForms/index.js.map +0 -1
  268. package/dist/components/Header/Header.js.map +0 -1
  269. package/dist/components/Header/index.js.map +0 -1
  270. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js.map +0 -1
  271. package/dist/components/HeaderCloseBtn/index.js.map +0 -1
  272. package/dist/components/InfinityScroll/InfinityScroll.js.map +0 -1
  273. package/dist/components/InfinityScroll/index.js.map +0 -1
  274. package/dist/components/Input/Input.js.map +0 -1
  275. package/dist/components/Input/index.js.map +0 -1
  276. package/dist/components/InstantCounter/InstantCounter.js.map +0 -1
  277. package/dist/components/InstantCounter/index.js.map +0 -1
  278. package/dist/components/LavaLamp/LavaLamp.data.js.map +0 -1
  279. package/dist/components/LavaLamp/LavaLamp.js.map +0 -1
  280. package/dist/components/LavaLamp/index.js.map +0 -1
  281. package/dist/components/LavaLamp/v2/LavaLamp.js.map +0 -1
  282. package/dist/components/LinkToId/LinkToId.js.map +0 -1
  283. package/dist/components/LinkToId/index.js.map +0 -1
  284. package/dist/components/Loader/Loader.js.map +0 -1
  285. package/dist/components/Loader/index.js.map +0 -1
  286. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js.map +0 -1
  287. package/dist/components/LoaderDotsIndicator/index.js.map +0 -1
  288. package/dist/components/LoopableVideo/LoopableVideo.js.map +0 -1
  289. package/dist/components/LoopableVideo/index.js.map +0 -1
  290. package/dist/components/MainGrid/MainGrid.js.map +0 -1
  291. package/dist/components/MainGrid/index.js.map +0 -1
  292. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js.map +0 -1
  293. package/dist/components/MutableHamburgerButton/index.js.map +0 -1
  294. package/dist/components/Notification/Notification.js.map +0 -1
  295. package/dist/components/Notification/index.js.map +0 -1
  296. package/dist/components/OrderableList/OrderableList.js.map +0 -1
  297. package/dist/components/OrderableList/index.js.map +0 -1
  298. package/dist/components/PaginationIndicator/PaginationIndicator.js.map +0 -1
  299. package/dist/components/PaginationIndicator/index.js.map +0 -1
  300. package/dist/components/Parallax/Parallax.js.map +0 -1
  301. package/dist/components/Parallax/index.js.map +0 -1
  302. package/dist/components/Parallax/math/helpers.js.map +0 -1
  303. package/dist/components/PasswordInput/PasswordInput.js.map +0 -1
  304. package/dist/components/PasswordInput/index.js.map +0 -1
  305. package/dist/components/PixelatedScan/PixelatedScan.js.map +0 -1
  306. package/dist/components/PixelatedScan/index.js.map +0 -1
  307. package/dist/components/Portal/Portal.js.map +0 -1
  308. package/dist/components/Portal/index.js.map +0 -1
  309. package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
  310. package/dist/components/ProgressBar/index.js.map +0 -1
  311. package/dist/components/ProgressTexts/ProgressTexts.js.map +0 -1
  312. package/dist/components/ProgressTexts/index.js.map +0 -1
  313. package/dist/components/SectionContainer/SectionContainer.js.map +0 -1
  314. package/dist/components/SectionContainer/index.js.map +0 -1
  315. package/dist/components/Select/Select.js.map +0 -1
  316. package/dist/components/Select/index.js.map +0 -1
  317. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  318. package/dist/components/Skeleton/index.js.map +0 -1
  319. package/dist/components/Spacing/Spacing.js.map +0 -1
  320. package/dist/components/Spacing/index.js.map +0 -1
  321. package/dist/components/StaticScroller/StaticScroller.js.map +0 -1
  322. package/dist/components/StaticScroller/index.js.map +0 -1
  323. package/dist/components/Switch/Switch.js.map +0 -1
  324. package/dist/components/Switch/index.js.map +0 -1
  325. package/dist/components/Table/Table.js.map +0 -1
  326. package/dist/components/Table/index.js.map +0 -1
  327. package/dist/components/Tabs/Tabs.js.map +0 -1
  328. package/dist/components/Tabs/index.js.map +0 -1
  329. package/dist/components/Text/Text.js.map +0 -1
  330. package/dist/components/Text/index.js.map +0 -1
  331. package/dist/components/Transition/MasksFactory/DiagonalReveal.js.map +0 -1
  332. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js.map +0 -1
  333. package/dist/components/Transition/MasksFactory/PhysicsSquares.js.map +0 -1
  334. package/dist/components/Transition/MasksFactory/SquareToBalls.js.map +0 -1
  335. package/dist/components/Transition/MasksFactory/utils.js.map +0 -1
  336. package/dist/components/Transition/Transition.js.map +0 -1
  337. package/dist/components/Transition/index.js.map +0 -1
  338. package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +0 -1
  339. package/dist/components/UncontrolledTransition/index.js.map +0 -1
  340. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +0 -1
  341. package/dist/components/WalletConnectionWrapper/index.js.map +0 -1
  342. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +0 -1
  343. package/dist/components/utilitary/ScrollAndFocusLock/index.js.map +0 -1
  344. package/dist/context/AsyncProcess.js.map +0 -1
  345. package/dist/context/CustomBrowserRouter.js.map +0 -1
  346. package/dist/context/OneUIProvider.js.map +0 -1
  347. package/dist/hooks/logs/useDependencyChangeDetection.js.map +0 -1
  348. package/dist/hooks/logs/useIsMounting.js.map +0 -1
  349. package/dist/hooks/persistence/useLocalStorage.js.map +0 -1
  350. package/dist/hooks/shims/ObjectWatchShim.js.map +0 -1
  351. package/dist/hooks/ui/useAdaptiveImage.js.map +0 -1
  352. package/dist/hooks/ui/useBreakpoint.js.map +0 -1
  353. package/dist/hooks/ui/useCustomScrollbar.js.map +0 -1
  354. package/dist/hooks/ui/useMouseHover.js.map +0 -1
  355. package/dist/hooks/ui/usePaginationControls.js.map +0 -1
  356. package/dist/hooks/ui/useTilt.js.map +0 -1
  357. package/dist/hooks/ui/useZoomable.js.map +0 -1
  358. package/dist/hooks/useAsyncControl.js.map +0 -1
  359. package/dist/hooks/useContainedRepositioning.js.map +0 -1
  360. package/dist/hooks/useCustomHistory.js.map +0 -1
  361. package/dist/hooks/useElementFit.js.map +0 -1
  362. package/dist/hooks/useFirestoreWatch.js.map +0 -1
  363. package/dist/hooks/useForm.js.map +0 -1
  364. package/dist/hooks/useFreeze.js.map +0 -1
  365. package/dist/hooks/useHero.js.map +0 -1
  366. package/dist/hooks/useHero.module.scss +0 -5
  367. package/dist/hooks/useIntersection.js.map +0 -1
  368. package/dist/hooks/useMergeRefs.js.map +0 -1
  369. package/dist/hooks/useObserve.js.map +0 -1
  370. package/dist/hooks/usePagination.js.map +0 -1
  371. package/dist/hooks/usePooledOperation.js.map +0 -1
  372. package/dist/hooks/usePooling.js.map +0 -1
  373. package/dist/hooks/useRebound.js.map +0 -1
  374. package/dist/hooks/useShortIntl.js.map +0 -1
  375. package/dist/hooks/utility/useEvents.js.map +0 -1
  376. package/dist/hooks/utility/useModule.js.map +0 -1
  377. package/dist/hooks/utility/useQuery.js.map +0 -1
  378. package/dist/models/DebugLogger.js.map +0 -1
  379. package/dist/models/GenericContract.js.map +0 -1
  380. package/dist/storybookUtils/index.js.map +0 -1
  381. package/dist/type-utils.js.map +0 -1
  382. package/dist/types.js.map +0 -1
  383. package/dist/utils/blockchain.js.map +0 -1
  384. package/dist/utils/flatten.js.map +0 -1
  385. package/dist/utils/html.utils.js.map +0 -1
  386. package/dist/utils/ownEvent.js.map +0 -1
@@ -1,326 +1,333 @@
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.TransitionAnimationTypes = void 0;
41
- const react_1 = __importStar(require("react"));
42
- const Transition_module_scss_1 = __importDefault(require("./Transition.module.scss"));
7
+ exports.default = exports.TransitionAnimationTypes = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _TransitionModule = _interopRequireDefault(require("./Transition.module.scss"));
10
+ const _excluded = ["step", "contentStyle", "contentClassName", "children", "className", "onDiscardStep", "lockTransitionWidth", "lockTransitionHeight"];
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
+ 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
+ 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); }
15
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
+ 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; }
19
+ 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; }
20
+ 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; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ 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); }
23
+ function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
24
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ 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."); }
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
+ 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; }
29
+ 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; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ 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; }
32
+ 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; }
43
33
  function TransitionClasses(type) {
44
- switch (type) {
45
- case TransitionAnimationTypes.COIN_FLIP:
46
- return {
47
- backward: {
48
- elementExiting: Transition_module_scss_1.default.flipBottomUpOut,
49
- elementEntering: Transition_module_scss_1.default.flipBottomUpIn,
50
- },
51
- forward: {
52
- elementExiting: Transition_module_scss_1.default.flipBottomUpOut,
53
- elementEntering: Transition_module_scss_1.default.flipBottomUpIn,
54
- },
55
- };
56
- case TransitionAnimationTypes.FADE:
57
- return {
58
- backward: {
59
- elementExiting: Transition_module_scss_1.default.fadeOutAbsolute,
60
- elementEntering: Transition_module_scss_1.default.fadeInDelayed,
61
- },
62
- forward: {
63
- elementExiting: Transition_module_scss_1.default.fadeOutAbsolute,
64
- elementEntering: Transition_module_scss_1.default.fadeInDelayed,
65
- },
66
- };
67
- case TransitionAnimationTypes.SLIDE:
68
- return {
69
- backward: {
70
- elementEntering: Transition_module_scss_1.default.entranceLeft,
71
- elementExiting: "",
72
- },
73
- forward: {
74
- elementEntering: "",
75
- elementExiting: Transition_module_scss_1.default.exitLeft,
76
- },
77
- };
78
- case TransitionAnimationTypes.POP_FROM_CLICK_ORIGIN:
79
- case TransitionAnimationTypes.POP_FROM_ELEMENT_ID:
80
- return {
81
- backward: {
82
- elementEntering: Transition_module_scss_1.default.fadeIn,
83
- elementExiting: Transition_module_scss_1.default.scaleOut,
84
- },
85
- forward: {
86
- elementEntering: Transition_module_scss_1.default.scaleIn,
87
- elementExiting: Transition_module_scss_1.default.fadeOut,
88
- },
89
- };
90
- case TransitionAnimationTypes.MASK:
91
- return {
92
- backward: {
93
- elementEntering: Transition_module_scss_1.default.stubEntering,
94
- elementExiting: Transition_module_scss_1.default.stub,
95
- },
96
- forward: {
97
- elementEntering: Transition_module_scss_1.default.stubEntering,
98
- elementExiting: Transition_module_scss_1.default.stub,
99
- },
100
- };
101
- }
34
+ switch (type) {
35
+ case TransitionAnimationTypes.COIN_FLIP:
36
+ return {
37
+ backward: {
38
+ elementExiting: _TransitionModule.default.flipBottomUpOut,
39
+ elementEntering: _TransitionModule.default.flipBottomUpIn
40
+ },
41
+ forward: {
42
+ elementExiting: _TransitionModule.default.flipBottomUpOut,
43
+ elementEntering: _TransitionModule.default.flipBottomUpIn
44
+ }
45
+ };
46
+ case TransitionAnimationTypes.FADE:
47
+ return {
48
+ backward: {
49
+ elementExiting: _TransitionModule.default.fadeOutAbsolute,
50
+ elementEntering: _TransitionModule.default.fadeInDelayed
51
+ },
52
+ forward: {
53
+ elementExiting: _TransitionModule.default.fadeOutAbsolute,
54
+ elementEntering: _TransitionModule.default.fadeInDelayed
55
+ }
56
+ };
57
+ case TransitionAnimationTypes.SLIDE:
58
+ return {
59
+ backward: {
60
+ elementEntering: _TransitionModule.default.entranceLeft,
61
+ elementExiting: ""
62
+ },
63
+ forward: {
64
+ elementEntering: "",
65
+ elementExiting: _TransitionModule.default.exitLeft
66
+ }
67
+ };
68
+ case TransitionAnimationTypes.POP_FROM_CLICK_ORIGIN:
69
+ case TransitionAnimationTypes.POP_FROM_ELEMENT_ID:
70
+ return {
71
+ backward: {
72
+ elementEntering: _TransitionModule.default.fadeIn,
73
+ elementExiting: _TransitionModule.default.scaleOut
74
+ },
75
+ forward: {
76
+ elementEntering: _TransitionModule.default.scaleIn,
77
+ elementExiting: _TransitionModule.default.fadeOut
78
+ }
79
+ };
80
+ case TransitionAnimationTypes.MASK:
81
+ return {
82
+ backward: {
83
+ elementEntering: _TransitionModule.default.stubEntering,
84
+ elementExiting: _TransitionModule.default.stub
85
+ },
86
+ forward: {
87
+ elementEntering: _TransitionModule.default.stubEntering,
88
+ elementExiting: _TransitionModule.default.stub
89
+ }
90
+ };
91
+ }
102
92
  }
103
93
  function ChildrenWrapperFactory(func, key, externalPropsContainer, toRemoveKeys) {
104
- func.associatedKey = key;
105
- func.toRemoveKeys = toRemoveKeys;
106
- func.externalProps = externalPropsContainer;
107
- return func;
94
+ func.associatedKey = key;
95
+ func.toRemoveKeys = toRemoveKeys;
96
+ func.externalProps = externalPropsContainer;
97
+ return func;
108
98
  }
99
+
109
100
  /**
110
101
  * Handles the transition between multiple children and recycling of elements
111
102
  **/
112
- function Transition(_a, _containerRef) {
113
- var { step, contentStyle, contentClassName = "", children, className, onDiscardStep, lockTransitionWidth = false, lockTransitionHeight = false } = _a, props = __rest(_a, ["step", "contentStyle", "contentClassName", "children", "className", "onDiscardStep", "lockTransitionWidth", "lockTransitionHeight"]);
114
- const containerRef = (0, react_1.useMemo)(() => _containerRef || (0, react_1.createRef)(), [_containerRef]);
115
- const preTransitionDetails = (0, react_1.useRef)({
116
- transformOrigin: "initial",
117
- });
118
- const [childrenWrappers, setChildrenWrappers] = (0, react_1.useState)(() => {
119
- var _a;
120
- const externalProps = {
121
- "data-testid": "transition-container",
122
- key: String(((_a = children[step]) === null || _a === void 0 ? void 0 : _a.key) || step),
123
- style: contentStyle,
124
- className: contentClassName,
125
- };
126
- const func = ChildrenWrapperFactory(({ children }) => react_1.default.createElement("div", Object.assign({}, externalProps), children), children[step].key || step, externalProps, []);
127
- return [func];
128
- });
129
- const prevStep = (0, react_1.useRef)(step);
130
- const prevChild = (0, react_1.useRef)(children[step]);
131
- (0, react_1.useEffect)(() => () => {
132
- prevChild.current = children[step];
133
- });
134
- (0, react_1.useEffect)(() => {
135
- var _a, _b, _c, _d, _e;
136
- containerRef.current.style.overflow = "hidden";
137
- const transitionClasses = props.transitionType === TransitionAnimationTypes.CUSTOM
138
- ? props.config
139
- : TransitionClasses(props.transitionType || TransitionAnimationTypes.SLIDE);
140
- if (prevChild.current !== null &&
141
- ((_a = children[step]) === null || _a === void 0 ? void 0 : _a.key) === ((_b = prevChild.current) === null || _b === void 0 ? void 0 : _b.key) // I'm rendering the same screen
142
- ) {
143
- return () => {
144
- prevStep.current = step;
145
- };
146
- }
147
- const key = ((_c = children[step]) === null || _c === void 0 ? void 0 : _c.key) || step;
148
- if (prevStep.current !== step && lockTransitionWidth)
149
- containerRef.current.style.width = `${containerRef.current.clientWidth}px`;
150
- if (prevStep.current !== step && lockTransitionHeight)
151
- containerRef.current.style.height = `${containerRef.current.clientHeight}px`;
152
- const transitionMask = props.transitionType === TransitionAnimationTypes.MASK
153
- ? props.maskFactory(containerRef.current)
154
- : "";
155
- /** This runs on backwards */
156
- if (prevStep.current > step) {
157
- const stepToRemove = prevStep.current;
158
- const prevKeyToRemove = ((_d = prevChild.current) === null || _d === void 0 ? void 0 : _d.key) || stepToRemove;
159
- setChildrenWrappers((screensBeforeChangingStep) => {
160
- const enteringScreenRef = (0, react_1.createRef)();
161
- const [FirstNextScreen, ...restOfScreens] = screensBeforeChangingStep.filter((a) => (a === null || a === void 0 ? void 0 : a.associatedKey) !== String(key));
162
- if (FirstNextScreen) {
163
- Object.assign(FirstNextScreen.externalProps, {
164
- "data-testid": "transition-container",
165
- style: Object.assign(Object.assign({}, contentStyle), { WebkitMaskImage: transitionMask }),
166
- className: `${transitionClasses.backward.elementExiting}`,
167
- });
168
- }
169
- function animationEndListener(event) {
170
- var _a, _b;
171
- if (event.target !== event.currentTarget)
172
- return;
173
- const isAnimationFromExpectedState = (_a = enteringScreenRef.current) === null || _a === void 0 ? void 0 : _a.classList.contains(transitionClasses.backward.elementEntering);
174
- (_b = enteringScreenRef.current) === null || _b === void 0 ? void 0 : _b.classList.remove(transitionClasses.backward.elementEntering);
175
- setChildrenWrappers((screensAfterTheCurrentStepEntered) => {
176
- if (onDiscardStep) {
177
- if (isAnimationFromExpectedState)
178
- onDiscardStep(prevKeyToRemove);
179
- if (FirstNextScreen && FirstNextScreen.toRemoveKeys)
180
- FirstNextScreen.toRemoveKeys.forEach(onDiscardStep);
181
- }
182
- return screensAfterTheCurrentStepEntered.filter((s) => {
183
- var _a;
184
- const shouldKeep = (s === null || s === void 0 ? void 0 : s.associatedKey) !== String(prevKeyToRemove) &&
185
- !((_a = FirstNextScreen === null || FirstNextScreen === void 0 ? void 0 : FirstNextScreen.toRemoveKeys) === null || _a === void 0 ? void 0 : _a.some((k) => String(k) === String(s === null || s === void 0 ? void 0 : s.associatedKey)));
186
- return shouldKeep;
187
- });
188
- });
189
- event.currentTarget.removeEventListener("animationend", animationEndListener);
190
- }
191
- const propsContainer = {
192
- ref: enteringScreenRef,
193
- "data-testid": "transition-container",
194
- key,
195
- className: `${transitionClasses.backward.elementEntering} ${contentClassName}`,
196
- style: Object.assign({}, contentStyle),
197
- onAnimationEnd: animationEndListener,
198
- };
199
- const newWrapper = ChildrenWrapperFactory(({ children }) => {
200
- return react_1.default.createElement("div", Object.assign({}, propsContainer), children);
201
- }, key, propsContainer, [prevKeyToRemove, ...((FirstNextScreen === null || FirstNextScreen === void 0 ? void 0 : FirstNextScreen.toRemoveKeys) || [])]);
202
- if (FirstNextScreen)
203
- return [
204
- newWrapper,
205
- FirstNextScreen ||
206
- ChildrenWrapperFactory(() => react_1.default.createElement(react_1.default.Fragment, null), "", {}),
207
- ...restOfScreens,
208
- ];
209
- else
210
- return [newWrapper];
211
- });
103
+ function Transition(_ref, _containerRef) {
104
+ let step = _ref.step,
105
+ contentStyle = _ref.contentStyle,
106
+ _ref$contentClassName = _ref.contentClassName,
107
+ contentClassName = _ref$contentClassName === void 0 ? "" : _ref$contentClassName,
108
+ children = _ref.children,
109
+ className = _ref.className,
110
+ onDiscardStep = _ref.onDiscardStep,
111
+ _ref$lockTransitionWi = _ref.lockTransitionWidth,
112
+ lockTransitionWidth = _ref$lockTransitionWi === void 0 ? false : _ref$lockTransitionWi,
113
+ _ref$lockTransitionHe = _ref.lockTransitionHeight,
114
+ lockTransitionHeight = _ref$lockTransitionHe === void 0 ? false : _ref$lockTransitionHe,
115
+ props = _objectWithoutProperties(_ref, _excluded);
116
+ const containerRef = (0, _react.useMemo)(function () {
117
+ return _containerRef || /*#__PURE__*/(0, _react.createRef)();
118
+ }, [_containerRef]);
119
+ const preTransitionDetails = (0, _react.useRef)({
120
+ transformOrigin: "initial"
121
+ });
122
+ const _useState = (0, _react.useState)(function () {
123
+ var _children$step;
124
+ const externalProps = {
125
+ key: String(((_children$step = children[step]) === null || _children$step === void 0 ? void 0 : _children$step.key) || step),
126
+ style: contentStyle,
127
+ className: contentClassName
128
+ };
129
+ const func = ChildrenWrapperFactory(function (_ref2) {
130
+ let children = _ref2.children;
131
+ return /*#__PURE__*/_react.default.createElement("div", externalProps, children);
132
+ }, children[step].key || step, externalProps, []);
133
+ return [func];
134
+ }),
135
+ _useState2 = _slicedToArray(_useState, 2),
136
+ childrenWrappers = _useState2[0],
137
+ setChildrenWrappers = _useState2[1];
138
+ const prevStep = (0, _react.useRef)(step);
139
+ const prevChild = (0, _react.useRef)(children[step]);
140
+ (0, _react.useEffect)(function () {
141
+ return function () {
142
+ prevChild.current = children[step];
143
+ };
144
+ });
145
+ (0, _react.useEffect)(function () {
146
+ var _children$step2, _prevChild$current, _children$step3;
147
+ containerRef.current.style.overflow = "hidden";
148
+ const transitionClasses = props.transitionType === TransitionAnimationTypes.CUSTOM ? props.config : TransitionClasses(props.transitionType || TransitionAnimationTypes.SLIDE);
149
+ if (prevChild.current !== null && ((_children$step2 = children[step]) === null || _children$step2 === void 0 ? void 0 : _children$step2.key) === ((_prevChild$current = prevChild.current) === null || _prevChild$current === void 0 ? void 0 : _prevChild$current.key) // I'm rendering the same screen
150
+ ) {
151
+ return function () {
152
+ prevStep.current = step;
153
+ };
154
+ }
155
+ const key = ((_children$step3 = children[step]) === null || _children$step3 === void 0 ? void 0 : _children$step3.key) || step;
156
+ if (prevStep.current !== step && lockTransitionWidth) containerRef.current.style.width = "".concat(containerRef.current.clientWidth, "px");
157
+ if (prevStep.current !== step && lockTransitionHeight) containerRef.current.style.height = "".concat(containerRef.current.clientHeight, "px");
158
+ const transitionMask = props.transitionType === TransitionAnimationTypes.MASK ? props.maskFactory(containerRef.current) : "";
159
+
160
+ /** This runs on backwards */
161
+ if (prevStep.current > step) {
162
+ var _prevChild$current2;
163
+ const stepToRemove = prevStep.current;
164
+ const prevKeyToRemove = ((_prevChild$current2 = prevChild.current) === null || _prevChild$current2 === void 0 ? void 0 : _prevChild$current2.key) || stepToRemove;
165
+ setChildrenWrappers(function (screensBeforeChangingStep) {
166
+ const enteringScreenRef = /*#__PURE__*/(0, _react.createRef)();
167
+ const _screensBeforeChangin = screensBeforeChangingStep.filter(function (a) {
168
+ return (a === null || a === void 0 ? void 0 : a.associatedKey) !== String(key);
169
+ }),
170
+ _screensBeforeChangin2 = _toArray(_screensBeforeChangin),
171
+ FirstNextScreen = _screensBeforeChangin2[0],
172
+ restOfScreens = _screensBeforeChangin2.slice(1);
173
+ if (FirstNextScreen) {
174
+ Object.assign(FirstNextScreen.externalProps, {
175
+ style: _objectSpread(_objectSpread({}, contentStyle), {}, {
176
+ WebkitMaskImage: transitionMask
177
+ }),
178
+ className: "".concat(transitionClasses.backward.elementExiting)
179
+ });
212
180
  }
213
- else if (prevStep.current < step) {
214
- const stepToDelete = prevStep.current;
215
- const prevKeyToRemove = String(((_e = prevChild.current) === null || _e === void 0 ? void 0 : _e.key) || stepToDelete);
216
- setChildrenWrappers((screensBeforeChangingStep) => {
217
- const lastIndex = screensBeforeChangingStep.length - 1;
218
- const lastWrapper = screensBeforeChangingStep[lastIndex];
219
- const nextScreenRef = (0, react_1.createRef)();
220
- if (lastWrapper) {
221
- Object.assign(lastWrapper.externalProps, {
222
- "data-testid": "transition-container",
223
- style: Object.assign(Object.assign({}, contentStyle), { WebkitMaskImage: transitionMask }),
224
- className: `${contentClassName} ${transitionClasses.forward.elementExiting}`,
225
- onAnimationEnd: (e) => {
226
- var _a;
227
- if (e.target !== e.currentTarget)
228
- return;
229
- if (transitionClasses.forward.elementEntering)
230
- (_a = nextScreenRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove(transitionClasses.forward.elementEntering);
231
- if (onDiscardStep)
232
- onDiscardStep(prevKeyToRemove);
233
- setChildrenWrappers((screensAfterTheCurrentStepEntered) => {
234
- const nextState = screensAfterTheCurrentStepEntered.filter((s) => {
235
- const shouldMantain = (s === null || s === void 0 ? void 0 : s.associatedKey) !== String(prevKeyToRemove);
236
- return shouldMantain;
237
- });
238
- return nextState;
239
- });
240
- },
241
- });
242
- }
243
- const propsContainer = {
244
- ref: nextScreenRef,
245
- "data-testid": "transition-container",
246
- key,
247
- style: Object.assign({}, contentStyle),
248
- className: `${contentClassName} ${transitionClasses.forward.elementEntering}`,
249
- };
250
- const newWrapper = ChildrenWrapperFactory(({ children }) => {
251
- return react_1.default.createElement("div", Object.assign({}, propsContainer), children);
252
- }, key, propsContainer);
253
- return [
254
- ...screensBeforeChangingStep.slice(0, lastIndex),
255
- lastWrapper ||
256
- ChildrenWrapperFactory(() => react_1.default.createElement(react_1.default.Fragment, null), "fallback", {}),
257
- newWrapper,
258
- ];
181
+ function animationEndListener(event) {
182
+ var _enteringScreenRef$cu, _enteringScreenRef$cu2;
183
+ if (event.target !== event.currentTarget) return;
184
+ const isAnimationFromExpectedState = (_enteringScreenRef$cu = enteringScreenRef.current) === null || _enteringScreenRef$cu === void 0 ? void 0 : _enteringScreenRef$cu.classList.contains(transitionClasses.backward.elementEntering);
185
+ (_enteringScreenRef$cu2 = enteringScreenRef.current) === null || _enteringScreenRef$cu2 === void 0 ? void 0 : _enteringScreenRef$cu2.classList.remove(transitionClasses.backward.elementEntering);
186
+ setChildrenWrappers(function (screensAfterTheCurrentStepEntered) {
187
+ if (onDiscardStep) {
188
+ if (isAnimationFromExpectedState) onDiscardStep(prevKeyToRemove);
189
+ if (FirstNextScreen && FirstNextScreen.toRemoveKeys) FirstNextScreen.toRemoveKeys.forEach(onDiscardStep);
190
+ }
191
+ return screensAfterTheCurrentStepEntered.filter(function (s) {
192
+ var _FirstNextScreen$toRe;
193
+ const shouldKeep = (s === null || s === void 0 ? void 0 : s.associatedKey) !== String(prevKeyToRemove) && !(FirstNextScreen !== null && FirstNextScreen !== void 0 && (_FirstNextScreen$toRe = FirstNextScreen.toRemoveKeys) !== null && _FirstNextScreen$toRe !== void 0 && _FirstNextScreen$toRe.some(function (k) {
194
+ return String(k) === String(s === null || s === void 0 ? void 0 : s.associatedKey);
195
+ }));
196
+ return shouldKeep;
259
197
  });
198
+ });
199
+ event.currentTarget.removeEventListener("animationend", animationEndListener);
260
200
  }
261
- return () => {
262
- prevStep.current = step;
201
+ const propsContainer = {
202
+ ref: enteringScreenRef,
203
+ key: key,
204
+ className: "".concat(transitionClasses.backward.elementEntering, " ").concat(contentClassName),
205
+ style: _objectSpread({}, contentStyle),
206
+ onAnimationEnd: animationEndListener
263
207
  };
264
- }, [step]);
265
- (0, react_1.useEffect)(() => {
266
- if (childrenWrappers.length === 1 && lockTransitionWidth)
267
- containerRef.current.style.width = "";
268
- if (childrenWrappers.length === 1 && lockTransitionHeight)
269
- containerRef.current.style.height = "";
270
- }, [childrenWrappers.length !== 1]);
271
- (0, react_1.useEffect)(() => {
272
- if (props.transitionType === TransitionAnimationTypes.POP_FROM_ELEMENT_ID &&
273
- "elementId" in props) {
274
- const element = document.querySelector(`#${props.elementId}`);
275
- if (element) {
276
- const { clientWidth, clientHeight } = containerRef.current;
277
- const offsetX = element.clientLeft + element.offsetLeft + element.clientWidth / 2;
278
- const offsetY = element.clientTop + element.offsetTop + element.clientHeight / 2;
279
- const percentX = (offsetX * 100) / clientWidth;
280
- const percentY = (offsetY * 100) / clientHeight;
281
- preTransitionDetails.current.transformOrigin = `${percentX}% ${percentY}%`;
282
- Object.assign(containerRef.current.style, {
283
- transformOrigin: `${percentX}% ${percentY}%`,
208
+ const newWrapper = ChildrenWrapperFactory(function (_ref3) {
209
+ let children = _ref3.children;
210
+ return /*#__PURE__*/_react.default.createElement("div", propsContainer, children);
211
+ }, key, propsContainer, [prevKeyToRemove].concat(_toConsumableArray((FirstNextScreen === null || FirstNextScreen === void 0 ? void 0 : FirstNextScreen.toRemoveKeys) || [])));
212
+ if (FirstNextScreen) return [newWrapper, FirstNextScreen || ChildrenWrapperFactory(function () {
213
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
214
+ }, "", {})].concat(_toConsumableArray(restOfScreens));else return [newWrapper];
215
+ });
216
+ } else if (prevStep.current < step) {
217
+ var _prevChild$current3;
218
+ const stepToDelete = prevStep.current;
219
+ const prevKeyToRemove = String(((_prevChild$current3 = prevChild.current) === null || _prevChild$current3 === void 0 ? void 0 : _prevChild$current3.key) || stepToDelete);
220
+ setChildrenWrappers(function (screensBeforeChangingStep) {
221
+ const lastIndex = screensBeforeChangingStep.length - 1;
222
+ const lastWrapper = screensBeforeChangingStep[lastIndex];
223
+ const nextScreenRef = /*#__PURE__*/(0, _react.createRef)();
224
+ if (lastWrapper) {
225
+ Object.assign(lastWrapper.externalProps, {
226
+ style: _objectSpread(_objectSpread({}, contentStyle), {}, {
227
+ WebkitMaskImage: transitionMask
228
+ }),
229
+ className: "".concat(contentClassName, " ").concat(transitionClasses.forward.elementExiting),
230
+ onAnimationEnd: function onAnimationEnd(e) {
231
+ var _nextScreenRef$curren;
232
+ if (e.target !== e.currentTarget) return;
233
+ if (transitionClasses.forward.elementEntering) (_nextScreenRef$curren = nextScreenRef.current) === null || _nextScreenRef$curren === void 0 ? void 0 : _nextScreenRef$curren.classList.remove(transitionClasses.forward.elementEntering);
234
+ if (onDiscardStep) onDiscardStep(prevKeyToRemove);
235
+ setChildrenWrappers(function (screensAfterTheCurrentStepEntered) {
236
+ const nextState = screensAfterTheCurrentStepEntered.filter(function (s) {
237
+ const shouldMantain = (s === null || s === void 0 ? void 0 : s.associatedKey) !== String(prevKeyToRemove);
238
+ return shouldMantain;
284
239
  });
240
+ return nextState;
241
+ });
285
242
  }
243
+ });
286
244
  }
287
- else {
288
- Object.assign(containerRef.current.style, preTransitionDetails.current);
289
- }
290
- if (childrenWrappers.length === 1) {
291
- containerRef.current.style.overflow = "";
292
- }
293
- }, [childrenWrappers.length]);
294
- const _b = props, { transitionType: _transitionType, config } = _b, propsToSpread = __rest(_b, ["transitionType", "config"]);
295
- return (react_1.default.createElement(react_1.default.Fragment, null,
296
- react_1.default.createElement("section", Object.assign({}, propsToSpread, { onClick: (e) => {
297
- const { currentTarget: { offsetTop, offsetLeft, clientWidth, clientHeight }, clientX, clientY, } = e;
298
- const offsetX = clientX - offsetLeft;
299
- const offsetY = clientY - offsetTop;
300
- const percentX = (offsetX * 100) / clientWidth;
301
- const percentY = (offsetY * 100) / clientHeight;
302
- if (props.transitionType ===
303
- TransitionAnimationTypes.POP_FROM_ELEMENT_ID ||
304
- props.transitionType ===
305
- TransitionAnimationTypes.POP_FROM_CLICK_ORIGIN)
306
- preTransitionDetails.current.transformOrigin = `${percentX}% ${percentY}%`;
307
- if (props.onClick)
308
- props.onClick(e);
309
- }, "data-testid": "transition-controller", ref: containerRef, className: `${Transition_module_scss_1.default.section} ${className}` }), childrenWrappers.map((Wrapper) => {
310
- const childToRender = children.find((a, i) => ((a === null || a === void 0 ? void 0 : a.key) || i) === (Wrapper === null || Wrapper === void 0 ? void 0 : Wrapper.associatedKey));
311
- return (react_1.default.createElement(Wrapper, { key: Wrapper === null || Wrapper === void 0 ? void 0 : Wrapper.associatedKey },
312
- react_1.default.createElement(react_1.default.Fragment, null, childToRender)));
313
- }))));
245
+ const propsContainer = {
246
+ ref: nextScreenRef,
247
+ key: key,
248
+ style: _objectSpread({}, contentStyle),
249
+ className: "".concat(contentClassName, " ").concat(transitionClasses.forward.elementEntering)
250
+ };
251
+ const newWrapper = ChildrenWrapperFactory(function (_ref4) {
252
+ let children = _ref4.children;
253
+ return /*#__PURE__*/_react.default.createElement("div", propsContainer, children);
254
+ }, key, propsContainer);
255
+ return [].concat(_toConsumableArray(screensBeforeChangingStep.slice(0, lastIndex)), [lastWrapper || ChildrenWrapperFactory(function () {
256
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
257
+ }, "fallback", {}), newWrapper]);
258
+ });
259
+ }
260
+ return function () {
261
+ prevStep.current = step;
262
+ };
263
+ }, [step]);
264
+ (0, _react.useEffect)(function () {
265
+ if (childrenWrappers.length === 1 && lockTransitionWidth) containerRef.current.style.width = "";
266
+ if (childrenWrappers.length === 1 && lockTransitionHeight) containerRef.current.style.height = "";
267
+ }, [childrenWrappers.length !== 1]);
268
+ (0, _react.useEffect)(function () {
269
+ if (props.transitionType === TransitionAnimationTypes.POP_FROM_ELEMENT_ID && "elementId" in props) {
270
+ const element = document.querySelector("#".concat(props.elementId));
271
+ if (element) {
272
+ const _ref5 = containerRef.current,
273
+ clientWidth = _ref5.clientWidth,
274
+ clientHeight = _ref5.clientHeight;
275
+ const offsetX = element.clientLeft + element.offsetLeft + element.clientWidth / 2;
276
+ const offsetY = element.clientTop + element.offsetTop + element.clientHeight / 2;
277
+ const percentX = offsetX * 100 / clientWidth;
278
+ const percentY = offsetY * 100 / clientHeight;
279
+ preTransitionDetails.current.transformOrigin = "".concat(percentX, "% ").concat(percentY, "%");
280
+ Object.assign(containerRef.current.style, {
281
+ transformOrigin: "".concat(percentX, "% ").concat(percentY, "%")
282
+ });
283
+ }
284
+ } else {
285
+ Object.assign(containerRef.current.style, preTransitionDetails.current);
286
+ }
287
+ if (childrenWrappers.length === 1) {
288
+ containerRef.current.style.overflow = "";
289
+ }
290
+ }, [childrenWrappers.length]);
291
+ const propsToSpread = _objectSpread({}, props);
292
+ delete propsToSpread.transitionType;
293
+ delete propsToSpread.config;
294
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("section", _extends({}, propsToSpread, {
295
+ onClick: function onClick(e) {
296
+ const _e$currentTarget = e.currentTarget,
297
+ offsetTop = _e$currentTarget.offsetTop,
298
+ offsetLeft = _e$currentTarget.offsetLeft,
299
+ clientWidth = _e$currentTarget.clientWidth,
300
+ clientHeight = _e$currentTarget.clientHeight,
301
+ clientX = e.clientX,
302
+ clientY = e.clientY;
303
+ const offsetX = clientX - offsetLeft;
304
+ const offsetY = clientY - offsetTop;
305
+ const percentX = offsetX * 100 / clientWidth;
306
+ const percentY = offsetY * 100 / clientHeight;
307
+ if (props.transitionType === TransitionAnimationTypes.POP_FROM_ELEMENT_ID || props.transitionType === TransitionAnimationTypes.POP_FROM_CLICK_ORIGIN) preTransitionDetails.current.transformOrigin = "".concat(percentX, "% ").concat(percentY, "%");
308
+ if (props.onClick) props.onClick(e);
309
+ },
310
+ ref: containerRef,
311
+ className: "".concat(_TransitionModule.default.section, " ").concat(className)
312
+ }), childrenWrappers.map(function (Wrapper) {
313
+ const childToRender = children.find(function (a, i) {
314
+ return ((a === null || a === void 0 ? void 0 : a.key) || i) === (Wrapper === null || Wrapper === void 0 ? void 0 : Wrapper.associatedKey);
315
+ });
316
+ return /*#__PURE__*/_react.default.createElement(Wrapper, {
317
+ key: Wrapper === null || Wrapper === void 0 ? void 0 : Wrapper.associatedKey
318
+ }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childToRender));
319
+ })));
314
320
  }
315
- var TransitionAnimationTypes;
316
- (function (TransitionAnimationTypes) {
317
- TransitionAnimationTypes[TransitionAnimationTypes["SLIDE"] = 0] = "SLIDE";
318
- TransitionAnimationTypes[TransitionAnimationTypes["POP_FROM_CLICK_ORIGIN"] = 1] = "POP_FROM_CLICK_ORIGIN";
319
- TransitionAnimationTypes[TransitionAnimationTypes["POP_FROM_ELEMENT_ID"] = 2] = "POP_FROM_ELEMENT_ID";
320
- TransitionAnimationTypes[TransitionAnimationTypes["FADE"] = 3] = "FADE";
321
- TransitionAnimationTypes[TransitionAnimationTypes["COIN_FLIP"] = 4] = "COIN_FLIP";
322
- TransitionAnimationTypes[TransitionAnimationTypes["MASK"] = 5] = "MASK";
323
- TransitionAnimationTypes[TransitionAnimationTypes["CUSTOM"] = 6] = "CUSTOM";
324
- })(TransitionAnimationTypes = exports.TransitionAnimationTypes || (exports.TransitionAnimationTypes = {}));
325
- exports.default = (0, react_1.forwardRef)(Transition);
326
- //# sourceMappingURL=Transition.js.map
321
+ let TransitionAnimationTypes = /*#__PURE__*/function (TransitionAnimationTypes) {
322
+ TransitionAnimationTypes[TransitionAnimationTypes["SLIDE"] = 0] = "SLIDE";
323
+ TransitionAnimationTypes[TransitionAnimationTypes["POP_FROM_CLICK_ORIGIN"] = 1] = "POP_FROM_CLICK_ORIGIN";
324
+ TransitionAnimationTypes[TransitionAnimationTypes["POP_FROM_ELEMENT_ID"] = 2] = "POP_FROM_ELEMENT_ID";
325
+ TransitionAnimationTypes[TransitionAnimationTypes["FADE"] = 3] = "FADE";
326
+ TransitionAnimationTypes[TransitionAnimationTypes["COIN_FLIP"] = 4] = "COIN_FLIP";
327
+ TransitionAnimationTypes[TransitionAnimationTypes["MASK"] = 5] = "MASK";
328
+ TransitionAnimationTypes[TransitionAnimationTypes["CUSTOM"] = 6] = "CUSTOM";
329
+ return TransitionAnimationTypes;
330
+ }({});
331
+ exports.TransitionAnimationTypes = TransitionAnimationTypes;
332
+ var _default = /*#__PURE__*/(0, _react.forwardRef)(Transition);
333
+ exports.default = _default;