@onepercentio/one-ui 0.6.2 → 0.6.5

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 (416) hide show
  1. package/cypress/support/e2e.js +20 -18
  2. package/dist/__test__/analytics.d.ts +3 -3
  3. package/dist/__test__/analytics.js +18 -18
  4. package/dist/__test__/firestore.d.ts +2 -2
  5. package/dist/__test__/firestore.js +25 -25
  6. package/dist/__test__/utils.d.ts +16 -16
  7. package/dist/__test__/utils.js +155 -155
  8. package/dist/components/AdaptiveButton/AdaptiveButton.d.ts +8 -8
  9. package/dist/components/AdaptiveButton/AdaptiveButton.js +92 -92
  10. package/dist/components/AdaptiveButton/AdaptiveButton.stories.d.ts +18 -18
  11. package/dist/components/AdaptiveButton/AdaptiveButton.stories.js +81 -81
  12. package/dist/components/AdaptiveButton/index.d.ts +1 -1
  13. package/dist/components/AdaptiveButton/index.js +8 -8
  14. package/dist/components/AdaptiveDialog/AdaptiveDialog.d.ts +9 -9
  15. package/dist/components/AdaptiveDialog/AdaptiveDialog.js +59 -59
  16. package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.d.ts +19 -19
  17. package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js +93 -93
  18. package/dist/components/AdaptiveDialog/AdaptiveDialog.test.d.ts +1 -1
  19. package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js +14 -14
  20. package/dist/components/AdaptiveDialog/index.d.ts +1 -1
  21. package/dist/components/AdaptiveDialog/index.js +8 -8
  22. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.d.ts +14 -14
  23. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +72 -72
  24. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +1 -0
  25. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.d.ts +19 -19
  26. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js +20 -20
  27. package/dist/components/AdaptiveSidebar/index.d.ts +1 -1
  28. package/dist/components/AdaptiveSidebar/index.js +8 -8
  29. package/dist/components/AnchoredTooltip/AnchoredTooltip.d.ts +13 -13
  30. package/dist/components/AnchoredTooltip/AnchoredTooltip.js +173 -173
  31. package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.d.ts +16 -16
  32. package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js +85 -85
  33. package/dist/components/AnchoredTooltip/AnchoredTooltip.test.d.ts +1 -1
  34. package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js +19 -19
  35. package/dist/components/AnchoredTooltip/index.d.ts +1 -1
  36. package/dist/components/AnchoredTooltip/index.js +8 -8
  37. package/dist/components/AnimatedEntrance/AnimatedEntrance.d.ts +18 -18
  38. package/dist/components/AnimatedEntrance/AnimatedEntrance.js +125 -125
  39. package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +1 -1
  40. package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.d.ts +14 -14
  41. package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.js +66 -66
  42. package/dist/components/AnimatedEntrance/index.d.ts +1 -1
  43. package/dist/components/AnimatedEntrance/index.js +8 -8
  44. package/dist/components/AsyncWrapper/AsyncWrapper.d.ts +10 -10
  45. package/dist/components/AsyncWrapper/AsyncWrapper.js +24 -24
  46. package/dist/components/AsyncWrapper/AsyncWrapper.stories.d.ts +18 -18
  47. package/dist/components/AsyncWrapper/AsyncWrapper.stories.js +33 -33
  48. package/dist/components/AsyncWrapper/AsyncWrapper.test.d.ts +1 -1
  49. package/dist/components/AsyncWrapper/AsyncWrapper.test.js +18 -18
  50. package/dist/components/AsyncWrapper/index.d.ts +1 -1
  51. package/dist/components/AsyncWrapper/index.js +8 -8
  52. package/dist/components/Avatar/Avatar.d.ts +8 -8
  53. package/dist/components/Avatar/Avatar.js +44 -44
  54. package/dist/components/Avatar/Avatar.js.map +1 -1
  55. package/dist/components/Avatar/Avatar.module.scss +17 -14
  56. package/dist/components/Avatar/Avatar.stories.d.ts +14 -14
  57. package/dist/components/Avatar/Avatar.stories.js +18 -18
  58. package/dist/components/Avatar/Avatar.test.d.ts +1 -1
  59. package/dist/components/Avatar/Avatar.test.js +35 -35
  60. package/dist/components/Avatar/index.d.ts +1 -1
  61. package/dist/components/Avatar/index.js +8 -8
  62. package/dist/components/BucketFill/BucketFill.d.ts +12 -12
  63. package/dist/components/BucketFill/BucketFill.js +65 -65
  64. package/dist/components/BucketFill/BucketFill.stories.d.ts +17 -17
  65. package/dist/components/BucketFill/BucketFill.stories.js +140 -140
  66. package/dist/components/BucketFill/index.d.ts +1 -1
  67. package/dist/components/BucketFill/index.js +8 -8
  68. package/dist/components/Button/Button.d.ts +14 -14
  69. package/dist/components/Button/Button.js +51 -51
  70. package/dist/components/Button/Button.stories.d.ts +9 -9
  71. package/dist/components/Button/Button.stories.js +57 -57
  72. package/dist/components/Button/Button.test.d.ts +1 -1
  73. package/dist/components/Button/Button.test.js +14 -14
  74. package/dist/components/Button/index.d.ts +1 -1
  75. package/dist/components/Button/index.js +8 -8
  76. package/dist/components/Card/Card.d.ts +7 -7
  77. package/dist/components/Card/Card.js +14 -14
  78. package/dist/components/Card/Card.stories.d.ts +15 -15
  79. package/dist/components/Card/Card.stories.js +15 -15
  80. package/dist/components/Card/index.d.ts +1 -1
  81. package/dist/components/Card/index.js +8 -8
  82. package/dist/components/CheckBox/CheckBox.d.ts +11 -11
  83. package/dist/components/CheckBox/CheckBox.js +31 -31
  84. package/dist/components/CheckBox/CheckBox.stories.d.ts +20 -20
  85. package/dist/components/CheckBox/CheckBox.stories.js +52 -52
  86. package/dist/components/CheckBox/index.d.ts +1 -1
  87. package/dist/components/CheckBox/index.js +8 -8
  88. package/dist/components/Collapsable/Collapsable.d.ts +31 -31
  89. package/dist/components/Collapsable/Collapsable.js +126 -126
  90. package/dist/components/Collapsable/Collapsable.stories.d.ts +39 -39
  91. package/dist/components/Collapsable/Collapsable.stories.js +27 -27
  92. package/dist/components/Collapsable/index.d.ts +1 -1
  93. package/dist/components/Collapsable/index.js +8 -8
  94. package/dist/components/Countdown/Countdown.d.ts +13 -13
  95. package/dist/components/Countdown/Countdown.js +79 -79
  96. package/dist/components/Countdown/Countdown.stories.d.ts +14 -14
  97. package/dist/components/Countdown/Countdown.stories.js +54 -54
  98. package/dist/components/Countdown/index.d.ts +1 -1
  99. package/dist/components/Countdown/index.js +8 -8
  100. package/dist/components/Divider/Divider.d.ts +6 -6
  101. package/dist/components/Divider/Divider.js +15 -15
  102. package/dist/components/Divider/Divider.stories.d.ts +7 -7
  103. package/dist/components/Divider/Divider.stories.js +14 -14
  104. package/dist/components/Divider/index.d.ts +1 -1
  105. package/dist/components/Divider/index.js +8 -8
  106. package/dist/components/EmailInput/EmailInput.d.ts +25 -25
  107. package/dist/components/EmailInput/EmailInput.js +51 -51
  108. package/dist/components/EmailInput/EmailInput.stories.d.ts +28 -28
  109. package/dist/components/EmailInput/EmailInput.stories.js +14 -14
  110. package/dist/components/EmailInput/EmailInput.test.d.ts +1 -1
  111. package/dist/components/EmailInput/EmailInput.test.js +76 -76
  112. package/dist/components/EmailInput/index.d.ts +1 -1
  113. package/dist/components/EmailInput/index.js +9 -9
  114. package/dist/components/FadeIn/FadeIn.d.ts +10 -10
  115. package/dist/components/FadeIn/FadeIn.js +63 -63
  116. package/dist/components/FadeIn/FadeIn.stories.d.ts +24 -24
  117. package/dist/components/FadeIn/FadeIn.stories.js +15 -15
  118. package/dist/components/FadeIn/FadeIn.test.d.ts +1 -1
  119. package/dist/components/FadeIn/FadeIn.test.js +21 -21
  120. package/dist/components/FadeIn/index.d.ts +1 -1
  121. package/dist/components/FadeIn/index.js +8 -8
  122. package/dist/components/FileInput/FileInput.d.ts +13 -13
  123. package/dist/components/FileInput/FileInput.js +74 -74
  124. package/dist/components/FileInput/FileInput.stories.d.ts +19 -19
  125. package/dist/components/FileInput/FileInput.stories.js +58 -58
  126. package/dist/components/FileInput/index.d.ts +1 -1
  127. package/dist/components/FileInput/index.js +8 -8
  128. package/dist/components/FlowController/FlowController.d.ts +23 -23
  129. package/dist/components/FlowController/FlowController.js +33 -33
  130. package/dist/components/FlowController/FlowController.stories.d.ts +43 -43
  131. package/dist/components/FlowController/FlowController.stories.js +100 -100
  132. package/dist/components/FlowController/FlowController.test.d.ts +1 -1
  133. package/dist/components/FlowController/FlowController.test.js +165 -165
  134. package/dist/components/FlowController/index.d.ts +1 -1
  135. package/dist/components/FlowController/index.js +8 -8
  136. package/dist/components/Form/Form.d.ts +48 -48
  137. package/dist/components/Form/Form.js +101 -101
  138. package/dist/components/Form/Form.stories.d.ts +13 -13
  139. package/dist/components/Form/Form.stories.js +35 -35
  140. package/dist/components/Form/index.d.ts +1 -1
  141. package/dist/components/Form/index.js +8 -8
  142. package/dist/components/Freeze/Freeze.d.ts +5 -5
  143. package/dist/components/Freeze/Freeze.js +12 -12
  144. package/dist/components/Freeze/Freeze.stories.d.ts +7 -7
  145. package/dist/components/Freeze/Freeze.stories.js +55 -55
  146. package/dist/components/Freeze/Freeze.test.d.ts +1 -1
  147. package/dist/components/Freeze/Freeze.test.js +14 -14
  148. package/dist/components/Freeze/index.d.ts +1 -1
  149. package/dist/components/Freeze/index.js +8 -8
  150. package/dist/components/HSForms/HSForms.d.ts +5 -5
  151. package/dist/components/HSForms/HSForms.js +46 -46
  152. package/dist/components/HSForms/index.d.ts +1 -1
  153. package/dist/components/HSForms/index.js +8 -8
  154. package/dist/components/Header/Header.d.ts +25 -25
  155. package/dist/components/Header/Header.js +74 -74
  156. package/dist/components/Header/Header.stories.d.ts +28 -28
  157. package/dist/components/Header/Header.stories.js +40 -40
  158. package/dist/components/Header/Header.test.d.ts +1 -1
  159. package/dist/components/Header/Header.test.js +99 -99
  160. package/dist/components/Header/index.d.ts +1 -1
  161. package/dist/components/Header/index.js +8 -8
  162. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.d.ts +8 -8
  163. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +16 -16
  164. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.d.ts +14 -14
  165. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js +15 -15
  166. package/dist/components/HeaderCloseBtn/index.d.ts +1 -1
  167. package/dist/components/HeaderCloseBtn/index.js +8 -8
  168. package/dist/components/InfinityScroll/InfinityScroll.d.ts +11 -11
  169. package/dist/components/InfinityScroll/InfinityScroll.js +111 -111
  170. package/dist/components/InfinityScroll/InfinityScroll.stories.d.ts +23 -23
  171. package/dist/components/InfinityScroll/InfinityScroll.stories.js +53 -53
  172. package/dist/components/InfinityScroll/InfinityScroll.test.d.ts +1 -1
  173. package/dist/components/InfinityScroll/InfinityScroll.test.js +188 -188
  174. package/dist/components/InfinityScroll/index.d.ts +1 -1
  175. package/dist/components/InfinityScroll/index.js +8 -8
  176. package/dist/components/Input/Input.d.ts +34 -34
  177. package/dist/components/Input/Input.js +95 -95
  178. package/dist/components/Input/Input.stories.d.ts +24 -24
  179. package/dist/components/Input/Input.stories.js +20 -20
  180. package/dist/components/Input/Input.test.d.ts +1 -1
  181. package/dist/components/Input/Input.test.js +57 -57
  182. package/dist/components/Input/index.d.ts +1 -1
  183. package/dist/components/Input/index.js +8 -8
  184. package/dist/components/InstantCounter/InstantCounter.d.ts +13 -13
  185. package/dist/components/InstantCounter/InstantCounter.js +58 -58
  186. package/dist/components/InstantCounter/InstantCounter.stories.d.ts +41 -41
  187. package/dist/components/InstantCounter/InstantCounter.stories.js +60 -60
  188. package/dist/components/InstantCounter/InstantCounter.test.d.ts +1 -1
  189. package/dist/components/InstantCounter/InstantCounter.test.js +49 -49
  190. package/dist/components/InstantCounter/index.d.ts +1 -1
  191. package/dist/components/InstantCounter/index.js +8 -8
  192. package/dist/components/LinkToId/LinkToId.d.ts +10 -10
  193. package/dist/components/LinkToId/LinkToId.js +32 -32
  194. package/dist/components/LinkToId/LinkToId.stories.d.ts +7 -7
  195. package/dist/components/LinkToId/LinkToId.stories.js +14 -14
  196. package/dist/components/LinkToId/LinkToId.test.d.ts +1 -1
  197. package/dist/components/LinkToId/LinkToId.test.js +11 -11
  198. package/dist/components/LinkToId/index.d.ts +1 -1
  199. package/dist/components/LinkToId/index.js +9 -9
  200. package/dist/components/Loader/Loader.d.ts +6 -6
  201. package/dist/components/Loader/Loader.js +17 -17
  202. package/dist/components/Loader/Loader.stories.d.ts +12 -12
  203. package/dist/components/Loader/Loader.stories.js +15 -15
  204. package/dist/components/Loader/index.d.ts +1 -1
  205. package/dist/components/Loader/index.js +8 -8
  206. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.d.ts +6 -6
  207. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +41 -41
  208. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.d.ts +7 -7
  209. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.js +14 -14
  210. package/dist/components/LoaderDotsIndicator/index.d.ts +1 -1
  211. package/dist/components/LoaderDotsIndicator/index.js +8 -8
  212. package/dist/components/MainGrid/MainGrid.d.ts +10 -10
  213. package/dist/components/MainGrid/MainGrid.js +55 -55
  214. package/dist/components/MainGrid/MainGrid.stories.d.ts +14 -14
  215. package/dist/components/MainGrid/MainGrid.stories.js +69 -69
  216. package/dist/components/MainGrid/MainGrid.test.d.ts +1 -1
  217. package/dist/components/MainGrid/MainGrid.test.js +17 -17
  218. package/dist/components/MainGrid/index.d.ts +1 -1
  219. package/dist/components/MainGrid/index.js +8 -8
  220. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.d.ts +8 -8
  221. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +29 -29
  222. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.d.ts +21 -21
  223. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js +73 -73
  224. package/dist/components/MutableHamburgerButton/index.d.ts +1 -1
  225. package/dist/components/MutableHamburgerButton/index.js +8 -8
  226. package/dist/components/Notification/Notification.d.ts +7 -7
  227. package/dist/components/Notification/Notification.js +15 -15
  228. package/dist/components/Notification/Notification.stories.d.ts +15 -15
  229. package/dist/components/Notification/Notification.stories.js +18 -18
  230. package/dist/components/Notification/index.d.ts +1 -1
  231. package/dist/components/Notification/index.js +8 -8
  232. package/dist/components/Parallax/Parallax.d.ts +15 -15
  233. package/dist/components/Parallax/Parallax.js +174 -174
  234. package/dist/components/Parallax/Parallax.stories.d.ts +32 -32
  235. package/dist/components/Parallax/Parallax.stories.js +22 -22
  236. package/dist/components/Parallax/Parallax.test.d.ts +1 -1
  237. package/dist/components/Parallax/Parallax.test.js +21 -21
  238. package/dist/components/Parallax/index.d.ts +1 -1
  239. package/dist/components/Parallax/index.js +8 -8
  240. package/dist/components/Parallax/math/helpers.d.ts +58 -58
  241. package/dist/components/Parallax/math/helpers.js +228 -228
  242. package/dist/components/PasswordInput/PasswordInput.d.ts +42 -42
  243. package/dist/components/PasswordInput/PasswordInput.js +105 -105
  244. package/dist/components/PasswordInput/PasswordInput.stories.d.ts +45 -45
  245. package/dist/components/PasswordInput/PasswordInput.stories.js +21 -21
  246. package/dist/components/PasswordInput/PasswordInput.test.d.ts +1 -1
  247. package/dist/components/PasswordInput/PasswordInput.test.js +156 -156
  248. package/dist/components/PasswordInput/index.d.ts +1 -1
  249. package/dist/components/PasswordInput/index.js +8 -8
  250. package/dist/components/PixelatedScan/PixelatedScan.d.ts +8 -8
  251. package/dist/components/PixelatedScan/PixelatedScan.js +104 -104
  252. package/dist/components/PixelatedScan/PixelatedScan.stories.d.ts +15 -15
  253. package/dist/components/PixelatedScan/PixelatedScan.stories.js +39 -39
  254. package/dist/components/PixelatedScan/index.d.ts +1 -1
  255. package/dist/components/PixelatedScan/index.js +8 -8
  256. package/dist/components/Portal/Portal.d.ts +11 -11
  257. package/dist/components/Portal/Portal.js +61 -61
  258. package/dist/components/Portal/Portal.stories.d.ts +7 -7
  259. package/dist/components/Portal/Portal.stories.js +14 -14
  260. package/dist/components/Portal/index.d.ts +1 -1
  261. package/dist/components/Portal/index.js +9 -9
  262. package/dist/components/ProgressTexts/ProgressTexts.d.ts +22 -22
  263. package/dist/components/ProgressTexts/ProgressTexts.js +37 -37
  264. package/dist/components/ProgressTexts/ProgressTexts.stories.d.ts +24 -24
  265. package/dist/components/ProgressTexts/ProgressTexts.stories.js +89 -89
  266. package/dist/components/ProgressTexts/ProgressTexts.test.d.ts +1 -1
  267. package/dist/components/ProgressTexts/ProgressTexts.test.js +51 -51
  268. package/dist/components/ProgressTexts/index.d.ts +1 -1
  269. package/dist/components/ProgressTexts/index.js +8 -8
  270. package/dist/components/SectionContainer/SectionContainer.d.ts +11 -11
  271. package/dist/components/SectionContainer/SectionContainer.js +45 -45
  272. package/dist/components/SectionContainer/SectionContainer.stories.d.ts +14 -14
  273. package/dist/components/SectionContainer/SectionContainer.stories.js +14 -14
  274. package/dist/components/SectionContainer/index.d.ts +1 -1
  275. package/dist/components/SectionContainer/index.js +8 -8
  276. package/dist/components/Select/Select.d.ts +22 -22
  277. package/dist/components/Select/Select.js +75 -75
  278. package/dist/components/Select/Select.stories.d.ts +56 -56
  279. package/dist/components/Select/Select.stories.js +33 -33
  280. package/dist/components/Select/Select.test.d.ts +1 -1
  281. package/dist/components/Select/Select.test.js +11 -11
  282. package/dist/components/Select/index.d.ts +1 -1
  283. package/dist/components/Select/index.js +8 -8
  284. package/dist/components/Spacing/Spacing.d.ts +6 -6
  285. package/dist/components/Spacing/Spacing.js +14 -14
  286. package/dist/components/Spacing/Spacing.stories.d.ts +7 -7
  287. package/dist/components/Spacing/Spacing.stories.js +34 -34
  288. package/dist/components/Spacing/index.d.ts +1 -1
  289. package/dist/components/Spacing/index.js +8 -8
  290. package/dist/components/Table/Table.d.ts +19 -19
  291. package/dist/components/Table/Table.js +87 -87
  292. package/dist/components/Table/Table.stories.d.ts +15 -15
  293. package/dist/components/Table/Table.stories.js +87 -87
  294. package/dist/components/Table/Table.test.d.ts +1 -1
  295. package/dist/components/Table/Table.test.js +34 -34
  296. package/dist/components/Table/index.d.ts +1 -1
  297. package/dist/components/Table/index.js +8 -8
  298. package/dist/components/Tabs/Tabs.d.ts +11 -11
  299. package/dist/components/Tabs/Tabs.js +48 -48
  300. package/dist/components/Tabs/Tabs.stories.d.ts +17 -17
  301. package/dist/components/Tabs/Tabs.stories.js +56 -56
  302. package/dist/components/Tabs/Tabs.test.d.ts +1 -1
  303. package/dist/components/Tabs/Tabs.test.js +38 -38
  304. package/dist/components/Tabs/index.d.ts +1 -1
  305. package/dist/components/Tabs/index.js +8 -8
  306. package/dist/components/Text/Text.d.ts +15 -15
  307. package/dist/components/Text/Text.js +53 -53
  308. package/dist/components/Text/Text.stories.d.ts +7 -7
  309. package/dist/components/Text/Text.stories.js +42 -42
  310. package/dist/components/Text/Text.test.d.ts +1 -1
  311. package/dist/components/Text/Text.test.js +11 -11
  312. package/dist/components/Text/index.d.ts +1 -1
  313. package/dist/components/Text/index.js +8 -8
  314. package/dist/components/Transition/Transition.d.ts +45 -45
  315. package/dist/components/Transition/Transition.js +267 -242
  316. package/dist/components/Transition/Transition.js.map +1 -1
  317. package/dist/components/Transition/Transition.stories.d.ts +10 -10
  318. package/dist/components/Transition/Transition.stories.js +28 -28
  319. package/dist/components/Transition/Transition.test.d.ts +1 -1
  320. package/dist/components/Transition/Transition.test.js +54 -54
  321. package/dist/components/Transition/index.d.ts +1 -1
  322. package/dist/components/Transition/index.js +9 -9
  323. package/dist/components/UncontrolledTransition/UncontrolledTransition.d.ts +13 -13
  324. package/dist/components/UncontrolledTransition/UncontrolledTransition.js +93 -88
  325. package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +1 -1
  326. package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +33 -33
  327. package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js +224 -224
  328. package/dist/components/UncontrolledTransition/UncontrolledTransition.test.d.ts +1 -1
  329. package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js +134 -134
  330. package/dist/components/UncontrolledTransition/index.d.ts +1 -1
  331. package/dist/components/UncontrolledTransition/index.js +8 -8
  332. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.d.ts +52 -52
  333. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +120 -120
  334. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.d.ts +70 -70
  335. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js +64 -64
  336. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.d.ts +1 -1
  337. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js +136 -136
  338. package/dist/components/WalletConnectionWrapper/index.d.ts +1 -1
  339. package/dist/components/WalletConnectionWrapper/index.js +9 -9
  340. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.d.ts +7 -7
  341. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +74 -74
  342. package/dist/components/utilitary/ScrollAndFocusLock/index.d.ts +1 -1
  343. package/dist/components/utilitary/ScrollAndFocusLock/index.js +8 -8
  344. package/dist/context/CustomBrowserRouter.d.ts +5 -5
  345. package/dist/context/CustomBrowserRouter.js +53 -53
  346. package/dist/context/OneUIProvider.d.ts +69 -69
  347. package/dist/context/OneUIProvider.js +62 -62
  348. package/dist/context/OneUIProvider.test.d.ts +1 -1
  349. package/dist/context/OneUIProvider.test.js +44 -44
  350. package/dist/context/__mocks__/OneUIProvider.d.ts +67 -67
  351. package/dist/context/__mocks__/OneUIProvider.js +12 -12
  352. package/dist/hooks/shims/ObjectWatchShim.js +51 -51
  353. package/dist/hooks/useAsyncControl.d.ts +9 -9
  354. package/dist/hooks/useAsyncControl.js +39 -39
  355. package/dist/hooks/useCustomHistory.d.ts +14 -14
  356. package/dist/hooks/useCustomHistory.js +14 -14
  357. package/dist/hooks/useCustomHistory.js.map +1 -1
  358. package/dist/hooks/useFirestoreWatch.d.ts +12 -12
  359. package/dist/hooks/useFirestoreWatch.js +37 -37
  360. package/dist/hooks/useForm.d.ts +16 -16
  361. package/dist/hooks/useForm.js +23 -23
  362. package/dist/hooks/useIntersection.d.ts +4 -4
  363. package/dist/hooks/useIntersection.js +29 -29
  364. package/dist/hooks/useObserve.d.ts +2 -2
  365. package/dist/hooks/useObserve.js +17 -17
  366. package/dist/hooks/usePagination.d.ts +19 -19
  367. package/dist/hooks/usePagination.js +64 -64
  368. package/dist/hooks/usePooledOperation.d.ts +15 -15
  369. package/dist/hooks/usePooledOperation.js +63 -63
  370. package/dist/hooks/usePooling.d.ts +17 -16
  371. package/dist/hooks/usePooling.js +49 -46
  372. package/dist/hooks/usePooling.js.map +1 -1
  373. package/dist/hooks/usePooling.test.d.ts +1 -1
  374. package/dist/hooks/usePooling.test.js +103 -103
  375. package/dist/hooks/useRebound.d.ts +9 -9
  376. package/dist/hooks/useRebound.js +23 -23
  377. package/dist/hooks/useShortIntl.d.ts +15 -15
  378. package/dist/hooks/useShortIntl.js +37 -37
  379. package/dist/models/GenericContract.d.ts +74 -66
  380. package/dist/models/GenericContract.js +13 -13
  381. package/dist/models/GenericContract.js.map +1 -1
  382. package/dist/storybookUtils/index.d.ts +5 -5
  383. package/dist/storybookUtils/index.js +26 -26
  384. package/package.json +3 -4
  385. package/scripts/start-emulator.js +0 -0
  386. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.d.ts +0 -4
  387. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.js +0 -14
  388. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.js.map +0 -1
  389. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.module.scss +0 -0
  390. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.stories.d.ts +0 -10
  391. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.stories.js +0 -16
  392. package/dist/components/AsyncProcessQueue/AsyncProcessQueue.stories.js.map +0 -1
  393. package/dist/components/AsyncProcessQueue/index.d.ts +0 -1
  394. package/dist/components/AsyncProcessQueue/index.js +0 -9
  395. package/dist/components/AsyncProcessQueue/index.js.map +0 -1
  396. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.d.ts +0 -40
  397. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.js +0 -130
  398. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.js.map +0 -1
  399. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.d.ts +0 -59
  400. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.js +0 -62
  401. package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.js.map +0 -1
  402. package/dist/components/WalletConnectionWrapper/v2/index.d.ts +0 -1
  403. package/dist/components/WalletConnectionWrapper/v2/index.js +0 -9
  404. package/dist/components/WalletConnectionWrapper/v2/index.js.map +0 -1
  405. package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.d.ts +0 -6
  406. package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.js +0 -52
  407. package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.js.map +0 -1
  408. package/dist/context/AsyncProcessQueue.d.ts +0 -10
  409. package/dist/context/AsyncProcessQueue.js +0 -16
  410. package/dist/context/AsyncProcessQueue.js.map +0 -1
  411. package/dist/hooks/useImprovedHistory.d.ts +0 -0
  412. package/dist/hooks/useImprovedHistory.js +0 -2
  413. package/dist/hooks/useImprovedHistory.js.map +0 -1
  414. package/dist/hooks/useScrollLock.d.ts +0 -0
  415. package/dist/hooks/useScrollLock.js +0 -2
  416. package/dist/hooks/useScrollLock.js.map +0 -1
@@ -1,47 +1,50 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const react_1 = require("react");
13
- function usePooling(intervalMs = 1000, maxPoolingTime = 60000) {
14
- const [intervalId, setIntervalId] = (0, react_1.useState)();
15
- const [failed, setFailed] = (0, react_1.useState)(false);
16
- (0, react_1.useEffect)(() => () => {
17
- if (intervalId)
18
- clearInterval(intervalId);
19
- }, [intervalId]);
20
- return {
21
- failed,
22
- setFailed,
23
- isPooling: !!intervalId,
24
- /**
25
- *
26
- * @param cb {@link PoolingAction} - Executes and returns if has finished (true) or not (false)
27
- */
28
- startPolling: (cb) => {
29
- const maxPoolings = Math.ceil(maxPoolingTime / intervalMs);
30
- let poolingCount = 0;
31
- const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
32
- poolingCount++;
33
- const finished = yield cb();
34
- if (finished)
35
- setIntervalId(undefined);
36
- else if (poolingCount === maxPoolings) {
37
- setIntervalId(undefined);
38
- setFailed(true);
39
- }
40
- }), intervalMs);
41
- setIntervalId(intervalId);
42
- setFailed(false);
43
- },
44
- };
45
- }
46
- exports.default = usePooling;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const react_1 = require("react");
13
+ function usePooling(intervalMs = 1000, maxPoolingTime = 60000) {
14
+ const [intervalId, setIntervalId] = (0, react_1.useState)();
15
+ const [failed, setFailed] = (0, react_1.useState)(false);
16
+ const cancelPooling = () => {
17
+ if (intervalId)
18
+ clearInterval(intervalId);
19
+ };
20
+ (0, react_1.useEffect)(() => cancelPooling, [intervalId]);
21
+ return {
22
+ failed,
23
+ setFailed,
24
+ isPooling: !!intervalId,
25
+ /**
26
+ *
27
+ * @param cb {@link PoolingAction} - Executes and returns if has finished (true) or not (false)
28
+ */
29
+ startPolling: (cb) => {
30
+ let poolingCount = 0;
31
+ const maxPoolings = (maxPoolingTime !== null) ? Math.ceil(maxPoolingTime / intervalMs) : undefined;
32
+ const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
33
+ poolingCount++;
34
+ const finished = yield cb();
35
+ if (finished)
36
+ setIntervalId(undefined);
37
+ else if (poolingCount === maxPoolings) {
38
+ setIntervalId(undefined);
39
+ setFailed(true);
40
+ }
41
+ }), intervalMs);
42
+ setIntervalId(intervalId);
43
+ setFailed(false);
44
+ return () => clearInterval(intervalId);
45
+ },
46
+ stop: cancelPooling,
47
+ };
48
+ }
49
+ exports.default = usePooling;
47
50
  //# sourceMappingURL=usePooling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePooling.js","sourceRoot":"","sources":["../../src/hooks/usePooling.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA4C;AAO5C,SAAwB,UAAU,CAAC,UAAU,GAAG,IAAI,EAAE,cAAc,GAAG,KAAK;IAC1E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,GAAgB,CAAC;IAC7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAErD,IAAA,iBAAS,EACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,UAAU;YAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO;QACL,MAAM;QACN,SAAS;QACT,SAAS,EAAE,CAAC,CAAC,UAAU;QACvB;;;WAGG;QACH,YAAY,EAAE,CAAC,EAAiB,EAAE,EAAE;YAClC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,CAAC;YAC3D,IAAI,YAAY,GAAG,CAAC,CAAC;YACrB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAS,EAAE;gBACxC,YAAY,EAAE,CAAC;gBACf,MAAM,QAAQ,GAAG,MAAM,EAAE,EAAE,CAAC;gBAC5B,IAAI,QAAQ;oBAAE,aAAa,CAAC,SAAS,CAAC,CAAC;qBAClC,IAAI,YAAY,KAAK,WAAW,EAAE;oBACrC,aAAa,CAAC,SAAS,CAAC,CAAC;oBACzB,SAAS,CAAC,IAAI,CAAC,CAAC;iBACjB;YACH,CAAC,CAAA,EAAE,UAAU,CAAC,CAAC;YACf,aAAa,CAAC,UAAU,CAAC,CAAC;YAC1B,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC;AAnCD,6BAmCC"}
1
+ {"version":3,"file":"usePooling.js","sourceRoot":"","sources":["../../src/hooks/usePooling.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA4C;AAO5C,SAAwB,UAAU,CAAC,UAAU,GAAG,IAAI,EAAE,iBAAgC,KAAK;IACzF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,GAAgB,CAAC;IAC7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAErD,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,UAAU;YAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC,CAAA;IACD,IAAA,iBAAS,EACP,GAAG,EAAE,CAAC,aAAa,EACnB,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO;QACL,MAAM;QACN,SAAS;QACT,SAAS,EAAE,CAAC,CAAC,UAAU;QACvB;;;WAGG;QACH,YAAY,EAAE,CAAC,EAAiB,EAAE,EAAE;YAClC,IAAI,YAAY,GAAG,CAAC,CAAC;YACrB,MAAM,WAAW,GAAG,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACnG,MAAM,UAAU,GAAG,WAAW,CAAC,GAAS,EAAE;gBACxC,YAAY,EAAE,CAAC;gBACf,MAAM,QAAQ,GAAG,MAAM,EAAE,EAAE,CAAC;gBAC5B,IAAI,QAAQ;oBAAE,aAAa,CAAC,SAAS,CAAC,CAAC;qBAClC,IAAI,YAAY,KAAK,WAAW,EAAE;oBACrC,aAAa,CAAC,SAAS,CAAC,CAAC;oBACzB,SAAS,CAAC,IAAI,CAAC,CAAC;iBACjB;YACH,CAAC,CAAA,EAAE,UAAU,CAAC,CAAC;YACf,aAAa,CAAC,UAAU,CAAC,CAAC;YAC1B,SAAS,CAAC,KAAK,CAAC,CAAC;YACjB,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,EAAE,aAAa;KACpB,CAAC;AACJ,CAAC;AAtCD,6BAsCC"}
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,104 +1,104 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const react_hooks_1 = require("@testing-library/react-hooks");
16
- const test_utils_1 = require("react-dom/test-utils");
17
- const usePooling_1 = __importDefault(require("./usePooling"));
18
- const mockCb = () => Promise.resolve(true);
19
- beforeEach(() => {
20
- jest.useFakeTimers();
21
- });
22
- afterEach(() => {
23
- jest.useRealTimers();
24
- jest.clearAllTimers();
25
- });
26
- function actAndSync(cb) {
27
- (0, test_utils_1.act)(() => {
28
- cb();
29
- // This is to advance the timer for the setState
30
- jest.advanceTimersByTime(100);
31
- });
32
- }
33
- const renderHookAndSync = (cb) => {
34
- const result = (0, react_hooks_1.renderHook)(cb);
35
- jest.advanceTimersByTime(100);
36
- return result;
37
- };
38
- it("Should mount", () => {
39
- renderHookAndSync(() => (0, usePooling_1.default)());
40
- });
41
- it("Should be able to create an interval", () => {
42
- expect(jest.getTimerCount()).toBe(0);
43
- const { result: { current: { startPolling }, }, } = renderHookAndSync(() => (0, usePooling_1.default)());
44
- actAndSync(() => startPolling(mockCb));
45
- expect(jest.getTimerCount()).toBe(1);
46
- /** Should clear the old interval */
47
- actAndSync(() => startPolling(mockCb));
48
- expect(jest.getTimerCount()).toBe(1);
49
- });
50
- it("Should indicate when the interval shall end", () => __awaiter(void 0, void 0, void 0, function* () {
51
- let num = 0;
52
- const cb = () => __awaiter(void 0, void 0, void 0, function* () {
53
- num++;
54
- return num === 3;
55
- });
56
- const { result, rerender } = renderHookAndSync(() => (0, usePooling_1.default)());
57
- const { startPolling } = result.current;
58
- expect(jest.getTimerCount()).toBe(0);
59
- expect(result.current.isPooling).toBeFalsy();
60
- actAndSync(() => startPolling(cb));
61
- expect(jest.getTimerCount()).toBe(1);
62
- expect(result.current.isPooling).toBeTruthy();
63
- // First execution
64
- (0, test_utils_1.act)(() => {
65
- jest.advanceTimersByTime(1000);
66
- });
67
- expect(jest.getTimerCount()).toBe(1);
68
- expect(result.current.isPooling).toBeTruthy();
69
- //Second execution
70
- (0, test_utils_1.act)(() => {
71
- jest.advanceTimersByTime(1000);
72
- });
73
- expect(jest.getTimerCount()).toBe(1);
74
- expect(result.current.isPooling).toBeTruthy();
75
- //Last execution
76
- (0, test_utils_1.act)(() => {
77
- jest.advanceTimersByTime(1000);
78
- });
79
- // expect(jest.getTimerCount()).toBe(0);
80
- // expect(result.current.isPooling).toBeFalsy();
81
- }));
82
- it.each([
83
- [1000, 5000, 5],
84
- [500, 10000, 20],
85
- [1000, 2578, 3],
86
- ])("Should end the pooling with error when the pooling of interval %s with max of %s exceeds max executions of %s", (poolingInterval, maxTime, expectedExecutionsCount) => {
87
- const { result } = renderHookAndSync(() => (0, usePooling_1.default)(poolingInterval, maxTime));
88
- const { startPolling } = result.current;
89
- actAndSync(() => startPolling(() => __awaiter(void 0, void 0, void 0, function* () { return false; })));
90
- for (let i = 1; i < expectedExecutionsCount; i++) {
91
- (0, test_utils_1.act)(() => {
92
- jest.advanceTimersByTime(poolingInterval);
93
- });
94
- if (i === expectedExecutionsCount) {
95
- expect(result.current.isPooling).toBeFalsy();
96
- expect(result.current.failed).toBeTruthy();
97
- }
98
- else {
99
- expect(result.current.isPooling).toBeTruthy();
100
- expect(result.current.failed).toBeFalsy();
101
- }
102
- }
103
- });
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const react_hooks_1 = require("@testing-library/react-hooks");
16
+ const test_utils_1 = require("react-dom/test-utils");
17
+ const usePooling_1 = __importDefault(require("./usePooling"));
18
+ const mockCb = () => Promise.resolve(true);
19
+ beforeEach(() => {
20
+ jest.useFakeTimers();
21
+ });
22
+ afterEach(() => {
23
+ jest.useRealTimers();
24
+ jest.clearAllTimers();
25
+ });
26
+ function actAndSync(cb) {
27
+ (0, test_utils_1.act)(() => {
28
+ cb();
29
+ // This is to advance the timer for the setState
30
+ jest.advanceTimersByTime(100);
31
+ });
32
+ }
33
+ const renderHookAndSync = (cb) => {
34
+ const result = (0, react_hooks_1.renderHook)(cb);
35
+ jest.advanceTimersByTime(100);
36
+ return result;
37
+ };
38
+ it("Should mount", () => {
39
+ renderHookAndSync(() => (0, usePooling_1.default)());
40
+ });
41
+ it("Should be able to create an interval", () => {
42
+ expect(jest.getTimerCount()).toBe(0);
43
+ const { result: { current: { startPolling }, }, } = renderHookAndSync(() => (0, usePooling_1.default)());
44
+ actAndSync(() => startPolling(mockCb));
45
+ expect(jest.getTimerCount()).toBe(1);
46
+ /** Should clear the old interval */
47
+ actAndSync(() => startPolling(mockCb));
48
+ expect(jest.getTimerCount()).toBe(1);
49
+ });
50
+ it("Should indicate when the interval shall end", () => __awaiter(void 0, void 0, void 0, function* () {
51
+ let num = 0;
52
+ const cb = () => __awaiter(void 0, void 0, void 0, function* () {
53
+ num++;
54
+ return num === 3;
55
+ });
56
+ const { result, rerender } = renderHookAndSync(() => (0, usePooling_1.default)());
57
+ const { startPolling } = result.current;
58
+ expect(jest.getTimerCount()).toBe(0);
59
+ expect(result.current.isPooling).toBeFalsy();
60
+ actAndSync(() => startPolling(cb));
61
+ expect(jest.getTimerCount()).toBe(1);
62
+ expect(result.current.isPooling).toBeTruthy();
63
+ // First execution
64
+ (0, test_utils_1.act)(() => {
65
+ jest.advanceTimersByTime(1000);
66
+ });
67
+ expect(jest.getTimerCount()).toBe(1);
68
+ expect(result.current.isPooling).toBeTruthy();
69
+ //Second execution
70
+ (0, test_utils_1.act)(() => {
71
+ jest.advanceTimersByTime(1000);
72
+ });
73
+ expect(jest.getTimerCount()).toBe(1);
74
+ expect(result.current.isPooling).toBeTruthy();
75
+ //Last execution
76
+ (0, test_utils_1.act)(() => {
77
+ jest.advanceTimersByTime(1000);
78
+ });
79
+ // expect(jest.getTimerCount()).toBe(0);
80
+ // expect(result.current.isPooling).toBeFalsy();
81
+ }));
82
+ it.each([
83
+ [1000, 5000, 5],
84
+ [500, 10000, 20],
85
+ [1000, 2578, 3],
86
+ ])("Should end the pooling with error when the pooling of interval %s with max of %s exceeds max executions of %s", (poolingInterval, maxTime, expectedExecutionsCount) => {
87
+ const { result } = renderHookAndSync(() => (0, usePooling_1.default)(poolingInterval, maxTime));
88
+ const { startPolling } = result.current;
89
+ actAndSync(() => startPolling(() => __awaiter(void 0, void 0, void 0, function* () { return false; })));
90
+ for (let i = 1; i < expectedExecutionsCount; i++) {
91
+ (0, test_utils_1.act)(() => {
92
+ jest.advanceTimersByTime(poolingInterval);
93
+ });
94
+ if (i === expectedExecutionsCount) {
95
+ expect(result.current.isPooling).toBeFalsy();
96
+ expect(result.current.failed).toBeTruthy();
97
+ }
98
+ else {
99
+ expect(result.current.isPooling).toBeTruthy();
100
+ expect(result.current.failed).toBeFalsy();
101
+ }
102
+ }
103
+ });
104
104
  //# sourceMappingURL=usePooling.test.js.map
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
- /**
3
- * This hook adds a prop that you can toggle and returns to initial
4
- * state after a defined time (usefull for notification)
5
- */
6
- export default function useRebound<T extends any>(initialValue: T, timeoutSec?: number): {
7
- current: T;
8
- setState: import("react").Dispatch<import("react").SetStateAction<T>>;
9
- };
1
+ /// <reference types="react" />
2
+ /**
3
+ * This hook adds a prop that you can toggle and returns to initial
4
+ * state after a defined time (usefull for notification)
5
+ */
6
+ export default function useRebound<T extends any>(initialValue: T, timeoutSec?: number): {
7
+ current: T;
8
+ setState: import("react").Dispatch<import("react").SetStateAction<T>>;
9
+ };
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const react_1 = require("react");
4
- /**
5
- * This hook adds a prop that you can toggle and returns to initial
6
- * state after a defined time (usefull for notification)
7
- */
8
- function useRebound(initialValue, timeoutSec = 1) {
9
- const [state, setState] = (0, react_1.useState)(initialValue);
10
- (0, react_1.useEffect)(() => {
11
- if (state !== initialValue) {
12
- const timeout = setTimeout(() => {
13
- setState(initialValue);
14
- }, timeoutSec * 1000);
15
- return () => clearTimeout(timeout);
16
- }
17
- }, [state]);
18
- return {
19
- current: state,
20
- setState
21
- };
22
- }
23
- exports.default = useRebound;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_1 = require("react");
4
+ /**
5
+ * This hook adds a prop that you can toggle and returns to initial
6
+ * state after a defined time (usefull for notification)
7
+ */
8
+ function useRebound(initialValue, timeoutSec = 1) {
9
+ const [state, setState] = (0, react_1.useState)(initialValue);
10
+ (0, react_1.useEffect)(() => {
11
+ if (state !== initialValue) {
12
+ const timeout = setTimeout(() => {
13
+ setState(initialValue);
14
+ }, timeoutSec * 1000);
15
+ return () => clearTimeout(timeout);
16
+ }
17
+ }, [state]);
18
+ return {
19
+ current: state,
20
+ setState
21
+ };
22
+ }
23
+ exports.default = useRebound;
24
24
  //# sourceMappingURL=useRebound.js.map
@@ -1,15 +1,15 @@
1
- import { IntlFormatters, IntlShape } from "react-intl";
2
- import { BigNumber } from "bignumber.js";
3
- export default function useShortIntl(): IntlShape & {
4
- txt: (id: OnepercentUtility.IntlIds, params?: Parameters<IntlFormatters["formatMessage"]>[1]) => ReturnType<IntlFormatters["formatMessage"]>;
5
- formatToDoubleDecimal(number: number, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
6
- formatBigNumber(number: BigNumber, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
7
- };
8
- declare type StrMap = {
9
- [s: string]: string;
10
- };
11
- declare type IsolatedMessages<A extends string, M extends StrMap, P extends string> = {
12
- [s1 in `${P}.${keyof M extends string ? keyof M : ""}`]: M[keyof M];
13
- };
14
- export declare function isolateMessages<A extends string, M extends StrMap>(preffix: A, strings: M): IsolatedMessages<A, M, A>;
15
- export {};
1
+ import { IntlFormatters, IntlShape } from "react-intl";
2
+ import { BigNumber } from "bignumber.js";
3
+ export default function useShortIntl(): IntlShape & {
4
+ txt: (id: OnepercentUtility.IntlIds, params?: Parameters<IntlFormatters["formatMessage"]>[1]) => ReturnType<IntlFormatters["formatMessage"]>;
5
+ formatToDoubleDecimal(number: number, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
6
+ formatBigNumber(number: BigNumber, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
7
+ };
8
+ declare type StrMap = {
9
+ [s: string]: string;
10
+ };
11
+ declare type IsolatedMessages<A extends string, M extends StrMap, P extends string> = {
12
+ [s1 in `${P}.${keyof M extends string ? keyof M : ""}`]: M[keyof M];
13
+ };
14
+ export declare function isolateMessages<A extends string, M extends StrMap>(preffix: A, strings: M): IsolatedMessages<A, M, A>;
15
+ export {};
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isolateMessages = void 0;
4
- const react_intl_1 = require("react-intl");
5
- function useShortIntl() {
6
- const intl = (0, react_intl_1.useIntl)();
7
- const { formatMessage, formatNumber } = intl;
8
- return Object.assign(Object.assign({}, intl), { txt: (id, params) => {
9
- return formatMessage({ id }, params);
10
- }, formatToDoubleDecimal(val, options = {}) {
11
- return formatNumber(val, Object.assign({ minimumFractionDigits: 2, maximumFractionDigits: 2 }, options));
12
- },
13
- formatBigNumber(bigNumber, options) {
14
- const { decimalSeparator } = intl
15
- .formatNumberToParts(1000.1)
16
- .reduce((r, a) => {
17
- if (a.type === "decimal")
18
- return Object.assign(Object.assign({}, r), { decimalSeparator: a.value });
19
- if (a.type === "group")
20
- return Object.assign(Object.assign({}, r), { thousandSeparator: a.value });
21
- return r;
22
- }, {});
23
- const integerPart = bigNumber.integerValue(1);
24
- const integer = intl.formatNumber(integerPart.toNumber(), options);
25
- const decimals = bigNumber
26
- .minus(integerPart)
27
- .decimalPlaces((options === null || options === void 0 ? void 0 : options.maximumFractionDigits) || bigNumber.decimalPlaces(), 5)
28
- .toString()
29
- .replace("0.", "");
30
- return `${integer}${decimals !== "0" ? `${decimalSeparator}${decimals}` : ""}`;
31
- } });
32
- }
33
- exports.default = useShortIntl;
34
- function isolateMessages(preffix, strings) {
35
- return Object.entries(strings).reduce((r, [k, v]) => (Object.assign(Object.assign({}, r), { [`${preffix}.${k}`]: v })), {});
36
- }
37
- exports.isolateMessages = isolateMessages;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isolateMessages = void 0;
4
+ const react_intl_1 = require("react-intl");
5
+ function useShortIntl() {
6
+ const intl = (0, react_intl_1.useIntl)();
7
+ const { formatMessage, formatNumber } = intl;
8
+ return Object.assign(Object.assign({}, intl), { txt: (id, params) => {
9
+ return formatMessage({ id }, params);
10
+ }, formatToDoubleDecimal(val, options = {}) {
11
+ return formatNumber(val, Object.assign({ minimumFractionDigits: 2, maximumFractionDigits: 2 }, options));
12
+ },
13
+ formatBigNumber(bigNumber, options) {
14
+ const { decimalSeparator } = intl
15
+ .formatNumberToParts(1000.1)
16
+ .reduce((r, a) => {
17
+ if (a.type === "decimal")
18
+ return Object.assign(Object.assign({}, r), { decimalSeparator: a.value });
19
+ if (a.type === "group")
20
+ return Object.assign(Object.assign({}, r), { thousandSeparator: a.value });
21
+ return r;
22
+ }, {});
23
+ const integerPart = bigNumber.integerValue(1);
24
+ const integer = intl.formatNumber(integerPart.toNumber(), options);
25
+ const decimals = bigNumber
26
+ .minus(integerPart)
27
+ .decimalPlaces((options === null || options === void 0 ? void 0 : options.maximumFractionDigits) || bigNumber.decimalPlaces(), 5)
28
+ .toString()
29
+ .replace("0.", "");
30
+ return `${integer}${decimals !== "0" ? `${decimalSeparator}${decimals}` : ""}`;
31
+ } });
32
+ }
33
+ exports.default = useShortIntl;
34
+ function isolateMessages(preffix, strings) {
35
+ return Object.entries(strings).reduce((r, [k, v]) => (Object.assign(Object.assign({}, r), { [`${preffix}.${k}`]: v })), {});
36
+ }
37
+ exports.isolateMessages = isolateMessages;
38
38
  //# sourceMappingURL=useShortIntl.js.map
@@ -1,66 +1,74 @@
1
- import { Contract, ContractOptions, EventData, PastEventOptions } from "web3-eth-contract";
2
- export declare type AllABIs = OnepercentUtility.ApplicationABIs;
3
- declare type ExtractMethods<A extends AllABIs[number]> = A extends {
4
- type: "function";
5
- } ? A["name"] : never;
6
- declare type ExtractEvents<A extends AllABIs[number]> = A extends {
7
- type: "event";
8
- } ? A["name"] : never;
9
- declare type MapTypeToJS<L> = L extends "string" ? string : L extends "address" ? string : L extends "uint256" ? string : L extends "bool" ? boolean : unknown;
10
- declare type ExtractFromObj<R extends (AllABIs[number] & {
11
- type: "function";
12
- })> = {
13
- [K in R["outputs"][number]["name"]]: MapTypeToJS<(R["outputs"][number] & {
14
- name: K;
15
- })["type"]>;
16
- };
17
- declare type ExtractMethodDefinition<A extends AllABIs, N extends (AllABIs[number] & {
18
- type: "function";
19
- })["name"], R = A[number] & {
20
- type: "function";
21
- name: N;
22
- }> = (...args: TuplifyUnion<(A[number] & {
23
- type: "function";
24
- name: N;
25
- })["inputs"][number]["name"]>) => {
26
- call: () => Promise<R extends {
27
- outputs: {
28
- length: 1;
29
- };
30
- } ? MapTypeToJS<R["outputs"][0]["type"]> : R extends {
31
- outputs: any;
32
- } ? ExtractFromObj<R> : void>;
33
- send: (prop: {
34
- from: string;
35
- }) => Promise<void>;
36
- };
37
- declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
38
- declare type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never;
39
- declare type Push<T extends any[], V> = [...T, V];
40
- declare type TuplifyUnion<T, L = LastOf<T>, N = [T] extends [never] ? true : false> = true extends N ? [] : Push<TuplifyUnion<Exclude<T, L>>, MapTypeToJS<L>>;
41
- export default class GenericContract<A extends AllABIs = AllABIs, E extends string = ExtractEvents<A[number]> | "allEvents"> extends Contract {
42
- events: Exclude<E, "allEvents">;
43
- constructor(jsonInterface: A, address?: string, options?: ContractOptions);
44
- methods: {
45
- [k in ExtractMethods<A[number]>]: ExtractMethodDefinition<A, k>;
46
- };
47
- getPastEvents(event: E): Promise<GenericEventData<A>[]>;
48
- getPastEvents(event: E, options: PastEventOptions, callback: (error: Error, event: EventData) => void): Promise<GenericEventData<A>[]>;
49
- getPastEvents(event: E, options: PastEventOptions): Promise<GenericEventData<A>[]>;
50
- getPastEvents(event: E, callback: (error: Error, event: EventData) => void): Promise<GenericEventData<A>[]>;
51
- }
52
- export declare type GenericEventData<E extends AllABIs> = EventData & GenericEvent<E>;
53
- declare type ABIEvent = AllABIs[number] & {
54
- type: "event";
55
- };
56
- declare type GenericEvent<ABI extends AllABIs, E extends string = ExtractEvents<ABI[number]>> = {
57
- event: E;
58
- returnValues: ExtractReturnValues<ABIEvent & {
59
- name: E;
60
- }>;
61
- };
62
- declare type ExtractReturnValues<E extends ABIEvent> = ExtractInputType<E["inputs"][number]>;
63
- declare type ExtractInputType<I extends ABIEvent["inputs"][number]> = {
64
- [k in I["name"]]: MapTypeToJS<I["internalType"]>;
65
- };
66
- export {};
1
+ import { Contract, ContractOptions, EventData, PastEventOptions } from "web3-eth-contract";
2
+ export declare type AllABIs = OnepercentUtility.ApplicationABIs;
3
+ declare type ExtractMethods<A extends AllABIs[number]> = A extends {
4
+ type: "function";
5
+ } ? A["name"] : never;
6
+ declare type ExtractEvents<A extends AllABIs[number]> = A extends {
7
+ type: "event";
8
+ } ? A["name"] : never;
9
+ declare type MapTypeToJS<L> = L extends "string" ? string : L extends "address" ? string : L extends "uint256" ? string : L extends "uint8" ? string : L extends "bool" ? boolean : unknown;
10
+ declare type ExtractFromObj<R extends (AllABIs[number] & {
11
+ type: "function";
12
+ })> = {
13
+ [K in R["outputs"][number]["name"]]: MapTypeToJS<(R["outputs"][number] & {
14
+ name: K;
15
+ })["type"]>;
16
+ };
17
+ declare type ExtractMethodDefinition<A extends AllABIs, N extends (AllABIs[number] & {
18
+ type: "function";
19
+ })["name"], R = A[number] & {
20
+ type: "function";
21
+ name: N;
22
+ }> = (...args: TuplifyUnion<(A[number] & {
23
+ type: "function";
24
+ name: N;
25
+ })["inputs"][number], (A[number] & {
26
+ type: "function";
27
+ name: N;
28
+ })["inputs"][number]["name"]>) => {
29
+ call: () => Promise<R extends {
30
+ outputs: {
31
+ length: 1;
32
+ };
33
+ } ? MapTypeToJS<R["outputs"][0]["type"]> : R extends {
34
+ outputs: any;
35
+ } ? ExtractFromObj<R> : void>;
36
+ send: (prop: {
37
+ from: string;
38
+ maxPriorityFeePerGas?: number;
39
+ gas?: number;
40
+ gasPrice?: string;
41
+ }) => Promise<void>;
42
+ };
43
+ declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
44
+ declare type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never;
45
+ declare type Push<T extends any[], V> = [...T, V];
46
+ declare type TuplifyUnion<FUNCS, T, L = LastOf<T>, N = [T] extends [never] ? true : false> = true extends N ? [] : Push<TuplifyUnion<FUNCS, Exclude<T, L>>, MapTypeToJS<(FUNCS & {
47
+ name: L;
48
+ })['internalType']>>;
49
+ export default class GenericContract<A extends AllABIs = AllABIs, E extends string = ExtractEvents<A[number]> | "allEvents"> extends Contract {
50
+ events: Exclude<E, "allEvents">;
51
+ constructor(jsonInterface: A, address?: string, options?: ContractOptions);
52
+ methods: {
53
+ [k in ExtractMethods<A[number]>]: ExtractMethodDefinition<A, k>;
54
+ };
55
+ getPastEvents(event: E): Promise<GenericEventData<A>[]>;
56
+ getPastEvents(event: E, options: PastEventOptions, callback: (error: Error, event: EventData) => void): Promise<GenericEventData<A>[]>;
57
+ getPastEvents(event: E, options: PastEventOptions): Promise<GenericEventData<A>[]>;
58
+ getPastEvents(event: E, callback: (error: Error, event: EventData) => void): Promise<GenericEventData<A>[]>;
59
+ }
60
+ export declare type GenericEventData<E extends AllABIs> = EventData & GenericEvent<E>;
61
+ declare type ABIEvent = AllABIs[number] & {
62
+ type: "event";
63
+ };
64
+ declare type GenericEvent<ABI extends AllABIs, E extends string = ExtractEvents<ABI[number]>> = {
65
+ event: E;
66
+ returnValues: ExtractReturnValues<ABIEvent & {
67
+ name: E;
68
+ }>;
69
+ };
70
+ declare type ExtractReturnValues<E extends ABIEvent> = ExtractInputType<E["inputs"][number]>;
71
+ declare type ExtractInputType<I extends ABIEvent["inputs"][number]> = {
72
+ [k in I["name"]]: MapTypeToJS<I["internalType"]>;
73
+ };
74
+ export {};