@stokr/components-library 3.0.16 → 3.0.17

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 (379) hide show
  1. package/README.md +261 -262
  2. package/dist/analytics/index.js +180 -0
  3. package/dist/api/auth.js +15 -0
  4. package/dist/api/fetchData.js +27 -0
  5. package/dist/api/fetchDataPublic.js +19 -0
  6. package/dist/auth/index.js +32 -0
  7. package/dist/components/2FA/Connect2FA.js +55 -0
  8. package/dist/components/2FA/EnterCode.js +63 -0
  9. package/dist/components/2FA/InstallAuthApp.js +64 -0
  10. package/dist/components/2FA/ResetCode.js +33 -0
  11. package/dist/components/2FA/Sucess2FA.js +51 -0
  12. package/dist/components/2FA/disable-2fa-flow.js +91 -0
  13. package/dist/components/2FA/enable-2fa-flow.js +137 -0
  14. package/dist/components/2FA/login-with-otp-flow.js +206 -0
  15. package/dist/components/2FA/main-flow.js +217 -0
  16. package/dist/components/AccountBalance/AccountBalance.js +35 -0
  17. package/dist/components/AccountBalance/AccountBalance.styles.js +48 -0
  18. package/dist/components/AdminDashboard/Table/ReactTable.js +266 -0
  19. package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +65 -0
  20. package/dist/components/AdminDashboard/Table/Table.js +123 -0
  21. package/dist/components/AdminDashboard/Table/Table.styles.js +263 -0
  22. package/dist/components/AgreementItem/AgreementItem.js +39 -0
  23. package/dist/components/AgreementItem/AgreementItem.styles.js +32 -0
  24. package/dist/components/BackButton/BackButton.js +34 -0
  25. package/dist/components/BackButton/BackButton.styles.js +123 -0
  26. package/dist/components/Background/Background.js +45 -0
  27. package/dist/components/Background/Background.styles.js +119 -0
  28. package/dist/components/BasicTable/BasicTable.js +25 -0
  29. package/dist/components/BasicTable/BasicTable.styles.js +76 -0
  30. package/dist/components/BlogPost/BlogPost.js +98 -0
  31. package/dist/components/BlogPost/BlogPost.styles.js +230 -0
  32. package/dist/components/Button/Button.styles.js +207 -0
  33. package/dist/components/ButtonContainer/ButtonContainer.styles.js +51 -0
  34. package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +18 -0
  35. package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +41 -0
  36. package/dist/components/Card/Card.styles.js +97 -0
  37. package/dist/components/ChartLegend/ChartLegend.js +62 -0
  38. package/dist/components/ChartLegend/ChartLegend.styles.js +133 -0
  39. package/dist/components/Checkbox/Checkbox.js +80 -0
  40. package/dist/components/Checkbox/Checkbox.styles.js +133 -0
  41. package/dist/components/Checklist/ChecklistCard.js +71 -0
  42. package/dist/components/Checklist/ChecklistCard.styles.js +82 -0
  43. package/dist/components/Chips/Chip.js +23 -0
  44. package/dist/components/Chips/Chip.styles.js +72 -0
  45. package/dist/components/Chips/ChipWrapper.js +50 -0
  46. package/dist/components/ComponentScroll/ComponentScroll.js +70 -0
  47. package/dist/components/ComponentScroll/ComponentScroll.styles.js +127 -0
  48. package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +165 -0
  49. package/dist/components/ConfirmModal/ConfirmModal.js +187 -0
  50. package/dist/components/ConfirmModal/ConfirmModal.styles.js +44 -0
  51. package/dist/components/CryptoAddress/ComponentWrap.js +16 -0
  52. package/dist/components/CryptoAddress/CryptoAddress.js +151 -0
  53. package/dist/components/CryptoAddress/CryptoAddress.styles.js +443 -0
  54. package/dist/components/CryptoAddress/RadioWrap.js +47 -0
  55. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +34 -0
  56. package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +125 -0
  57. package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +25 -0
  58. package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +111 -0
  59. package/dist/components/DoubleButton/DoubleButton.styles.js +27 -0
  60. package/dist/components/ErrorMessage/ErrorMessage.styles.js +9 -0
  61. package/dist/components/FAQ/FAQ.js +73 -0
  62. package/dist/components/FAQ/FAQ.styles.js +128 -0
  63. package/dist/components/Footer/Footer.js +55 -0
  64. package/dist/components/Footer/Footer.styles.js +256 -0
  65. package/dist/components/Footer/FooterLayout.js +145 -0
  66. package/dist/components/Footer/FooterMenu.js +100 -0
  67. package/dist/components/Footer/FooterMenu.styles.js +321 -0
  68. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +100 -0
  69. package/dist/components/Form/Form.js +21 -0
  70. package/dist/components/Form/Form.styles.js +72 -0
  71. package/dist/components/Grid/Grid.styles.js +212 -0
  72. package/dist/components/Header/Header.js +425 -0
  73. package/dist/components/Header/Header.styles.js +567 -0
  74. package/dist/components/HeroBlock/HeroVideoBlock.js +105 -0
  75. package/dist/components/Icon/Icon.style.js +92 -0
  76. package/dist/components/Icon/Icon2.js +12 -0
  77. package/dist/components/InfoIcon/InfoIcon.js +62 -0
  78. package/dist/components/InfoIcon/InfoIcon.styles.js +64 -0
  79. package/dist/components/Input/DatePickerInput.js +139 -0
  80. package/dist/components/Input/DatePickerInput.styles.js +165 -0
  81. package/dist/components/Input/Input.js +108 -0
  82. package/dist/components/Input/Input.styles.js +154 -0
  83. package/dist/components/Input/InputPassword.js +122 -0
  84. package/dist/components/Input/InputPassword.styles.js +166 -0
  85. package/dist/components/Input/InputUsername.js +92 -0
  86. package/dist/components/Input/InputWithButton.js +53 -0
  87. package/dist/components/Input/InputWithButton.styles.js +57 -0
  88. package/dist/components/Input/MultiSelect.js +306 -0
  89. package/dist/components/Input/OtpInput.js +70 -0
  90. package/dist/components/Input/RangeInput.js +80 -0
  91. package/dist/components/Input/RangeInput.styles.js +129 -0
  92. package/dist/components/Input/SearchInput.js +68 -0
  93. package/dist/components/Input/SearchInput.styles.js +92 -0
  94. package/dist/components/Input/Select.js +151 -0
  95. package/dist/components/Input/Select.styles.js +148 -0
  96. package/dist/components/Input/TableFilterDropdown.js +247 -0
  97. package/dist/components/Input/Textarea.js +51 -0
  98. package/dist/components/Input/Textarea.styles.js +62 -0
  99. package/dist/components/InvestCalculator/InvestCalculator.js +283 -0
  100. package/dist/components/InvestCalculator/InvestCalculator.styles.js +94 -0
  101. package/dist/components/InvestmentStat/InvestmentStat.js +24 -0
  102. package/dist/components/InvestmentStat/InvestmentStat.styles.js +62 -0
  103. package/dist/components/LatestUpdate/LatestUpdate.js +24 -0
  104. package/dist/components/LatestUpdate/LatestUpdate.styles.js +90 -0
  105. package/dist/components/Layout/Layout.js +69 -0
  106. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +32 -0
  107. package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +208 -0
  108. package/dist/components/LearnMorePage/LearnMore.js +190 -0
  109. package/dist/components/LearnMorePage/LearnMore.propTypes.js +20 -0
  110. package/dist/components/LearnMorePage/LearnMore.shared.styles.js +56 -0
  111. package/dist/components/LearnMorePage/LearnMore.styles.js +276 -0
  112. package/dist/components/LearnMorePage/LearnMoreExampleObject.js +120 -0
  113. package/dist/components/LearnMorePage/LearnMoreItem.js +57 -0
  114. package/dist/components/LearnMorePage/LearnMoreItem.styles.js +234 -0
  115. package/dist/components/LearnMoreSection/LearnMore.js +138 -0
  116. package/dist/components/LearnMoreSection/LearnMore.styles.js +147 -0
  117. package/dist/components/LearnMoreSection/LearnMoreItem.js +33 -0
  118. package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +60 -0
  119. package/dist/components/LoginModal/LoginModal.js +142 -0
  120. package/dist/components/MainMenu/DynamicMainMenu.js +38 -0
  121. package/dist/components/MainMenu/MainMenu.js +210 -0
  122. package/dist/components/MainMenu/MainMenu.styles.js +362 -0
  123. package/dist/components/MenuNav/MenuNav.styles.js +66 -0
  124. package/dist/components/Modal/Modal.js +119 -0
  125. package/dist/components/Modal/Modal.styles.js +450 -0
  126. package/dist/components/Modal/NewVentureModal/NewVentureModal.js +262 -0
  127. package/dist/components/Modal/PaymentModal.js +149 -0
  128. package/dist/components/Modal/SideModal.js +89 -0
  129. package/dist/components/Modal/SideModal.styles.js +55 -0
  130. package/dist/components/Modal/SuccessModal/SuccessModal.js +170 -0
  131. package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +53 -0
  132. package/dist/components/MultiProgressBar/MultiProgressBar.js +30 -0
  133. package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +105 -0
  134. package/dist/components/Newsletter/Newsletter.js +122 -0
  135. package/dist/components/Newsletter/Newsletter.styles.js +186 -0
  136. package/dist/components/NotificationCounter/NotificationCounter.styles.js +38 -0
  137. package/dist/components/Number/Number.js +50 -0
  138. package/dist/components/Number/Number.styles.js +23 -0
  139. package/dist/components/PageTransition/PageTransition.js +51 -0
  140. package/dist/components/Pagination/Pagination.js +58 -0
  141. package/dist/components/Pagination/Pagination.styles.js +59 -0
  142. package/dist/components/Pagination/PaginationControls.js +113 -0
  143. package/dist/components/Pagination/usePagination.js +40 -0
  144. package/dist/components/Payment/PaymentDetailsCard.js +224 -0
  145. package/dist/components/Payment/PaymentDisplay.js +199 -0
  146. package/dist/components/Payment/TimerComponent.js +92 -0
  147. package/dist/components/Process/Process.styles.js +84 -0
  148. package/dist/components/ProfileBadge/ProfileBadge.js +35 -0
  149. package/dist/components/ProfileBadge/ProfileBadge.styles.js +53 -0
  150. package/dist/components/ProfileBox/ProfileBox.js +27 -0
  151. package/dist/components/ProfileBox/ProfileBox.styles.js +67 -0
  152. package/dist/components/ProfileStat/ProfileStat.js +29 -0
  153. package/dist/components/ProfileStat/ProfileStat.styles.js +90 -0
  154. package/dist/components/QRCode/QRCode.js +51 -0
  155. package/dist/components/Radio/Radio.js +51 -0
  156. package/dist/components/Radio/Radio.styles.js +100 -0
  157. package/dist/components/RefreshButton/RefreshButton.js +21 -0
  158. package/dist/components/RefreshButton/RefreshButton.styles.js +64 -0
  159. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +65 -0
  160. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +20 -0
  161. package/dist/components/RegisterModal/RegisterModal.js +248 -0
  162. package/dist/components/RequestDataBox/RequestDataBox.js +21 -0
  163. package/dist/components/RequestDataBox/RequestDataBox.styles.js +43 -0
  164. package/dist/components/ResetConfirmModal/ResetConfirmModal.js +44 -0
  165. package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +41 -0
  166. package/dist/components/ResetPasswordModal/ResetPasswordModal.js +134 -0
  167. package/dist/components/SEO/SEO.js +66 -0
  168. package/dist/components/SectionTitle/SectionTitle.styles.js +26 -0
  169. package/dist/components/SideLine/SideLine.js +7 -0
  170. package/dist/components/SideLine/SideLine.styles.js +33 -0
  171. package/dist/components/Slider/Slider.js +31 -0
  172. package/dist/components/Slider/Slider.styles.js +120 -0
  173. package/dist/components/Snackbar/Snackbar.js +111 -0
  174. package/dist/components/Snackbar/Snackbar.styles.js +230 -0
  175. package/dist/components/Snackbar/SnackbarProvider.js +66 -0
  176. package/dist/components/Snackbar/useSnackbar.js +12 -0
  177. package/dist/components/SpanButton/SpanButton.styles.js +19 -0
  178. package/dist/components/StatusBadge/StatusBadge.styles.js +18 -0
  179. package/dist/components/StatusTag/StatusTag.js +105 -0
  180. package/dist/components/StatusTag/StatusTag.styles.js +88 -0
  181. package/dist/components/StepController/StepController.js +86 -0
  182. package/dist/components/StepController/StepController.styles.js +33 -0
  183. package/dist/components/StepController/StepControllerContext.js +65 -0
  184. package/dist/components/StepController/StepControllerProgress.js +37 -0
  185. package/dist/components/StepsProgress/StepIndicator.js +40 -0
  186. package/dist/components/StepsProgress/StepIndicator.styles.js +69 -0
  187. package/dist/components/StepsProgress/StepsProgress.js +67 -0
  188. package/dist/components/StepsProgress/StepsProgress.styles.js +105 -0
  189. package/dist/components/StokrLoader/StokrLoader.js +111 -0
  190. package/dist/components/StokrLoader/media.js +23 -0
  191. package/dist/components/SvgIcons/AdminBadgeSvg.js +27 -0
  192. package/dist/components/SvgIcons/CameraSvg.js +31 -0
  193. package/dist/components/SvgIcons/CapsLockSvg.js +36 -0
  194. package/dist/components/SvgIcons/DocumentBackSvg.js +20 -0
  195. package/dist/components/SvgIcons/DocumentSmallSvg.js +41 -0
  196. package/dist/components/SvgIcons/DocumentSvg.js +39 -0
  197. package/dist/components/SvgIcons/EthSvg.js +28 -0
  198. package/dist/components/SvgIcons/EurSvg.js +27 -0
  199. package/dist/components/SvgIcons/FaceScanIconSvg.js +17 -0
  200. package/dist/components/SvgIcons/FourSvg.js +7 -0
  201. package/dist/components/SvgIcons/Glassess.js +26 -0
  202. package/dist/components/SvgIcons/LogoSvg.js +17 -0
  203. package/dist/components/SvgIcons/OneSvg.js +10 -0
  204. package/dist/components/SvgIcons/PassportSvg.js +37 -0
  205. package/dist/components/SvgIcons/RefreshSvg.js +28 -0
  206. package/dist/components/SvgIcons/SocialFacebook.js +22 -0
  207. package/dist/components/SvgIcons/SocialInstagram.js +13 -0
  208. package/dist/components/SvgIcons/SocialLinkedIn.js +31 -0
  209. package/dist/components/SvgIcons/SocialMedium.js +21 -0
  210. package/dist/components/SvgIcons/SocialReddit.js +21 -0
  211. package/dist/components/SvgIcons/SocialTelegram.js +60 -0
  212. package/dist/components/SvgIcons/SocialTwitter.js +62 -0
  213. package/dist/components/SvgIcons/SocialYoutube.js +22 -0
  214. package/dist/components/SvgIcons/ThreeSvg.js +7 -0
  215. package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +48 -0
  216. package/dist/components/SvgIcons/TwoSvg.js +10 -0
  217. package/dist/components/SvgIcons/UpdateDefaultSvg.js +12 -0
  218. package/dist/components/SvgIcons/UpdateHardSvg.js +10 -0
  219. package/dist/components/SvgIcons/UpdateSoftSvg.js +11 -0
  220. package/dist/components/SvgIcons/UploadSvg.js +12 -0
  221. package/dist/components/SvgIcons/VerifiedBadge.js +16 -0
  222. package/dist/components/Switch/Switch.js +63 -0
  223. package/dist/components/Switch/Switch.styles.js +126 -0
  224. package/dist/components/Tabs/Tabs.js +54 -0
  225. package/dist/components/Tabs/Tabs.styles.js +15 -0
  226. package/dist/components/TabsNav/TabNav.js +16 -0
  227. package/dist/components/TabsNav/TabsNav.js +30 -0
  228. package/dist/components/TabsNav/TabsNav.styles.js +103 -0
  229. package/dist/components/TeamOverview/TeamOverview.js +80 -0
  230. package/dist/components/TeamOverview/TeamOverview.styles.js +167 -0
  231. package/dist/components/TermsModal/TermsModal.js +145 -0
  232. package/dist/components/TermsModal/_styles.js +313 -0
  233. package/dist/components/Text/Text.styles.js +220 -0
  234. package/dist/components/TextLink/TextLink.styles.js +67 -0
  235. package/dist/components/Timeline/Timeline.js +44 -0
  236. package/dist/components/Timeline/Timeline.styles.js +147 -0
  237. package/dist/components/Timeline/TimelineStep.js +58 -0
  238. package/dist/components/ToDoList/ToDoList.js +172 -0
  239. package/dist/components/ToDoList/ToDoList.styles.js +122 -0
  240. package/dist/components/ToDoList/ToDoListTask.js +95 -0
  241. package/dist/components/ToDoList/ToDoListTask.styles.js +119 -0
  242. package/dist/components/TransactionDetails/TransactionDetails.js +27 -0
  243. package/dist/components/TransactionDetails/TransactionDetails.styles.js +38 -0
  244. package/dist/components/TransactionInfo/TransactionInfo.js +41 -0
  245. package/dist/components/TransactionInfo/TransactionInfo.styles.js +75 -0
  246. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +122 -0
  247. package/dist/components/breakdown/Breakdown.js +126 -0
  248. package/dist/components/headerHo/HeaderHo.js +709 -0
  249. package/dist/components/icons/Arrow.js +38 -0
  250. package/dist/components/icons/ArrowSimple.js +34 -0
  251. package/dist/components/icons/Check.js +16 -0
  252. package/dist/components/icons/Facebook.js +10 -0
  253. package/dist/components/icons/Info.js +27 -0
  254. package/dist/components/icons/Instagram.js +10 -0
  255. package/dist/components/icons/LinkIcon.js +49 -0
  256. package/dist/components/icons/LinkedIn.js +13 -0
  257. package/dist/components/icons/Medium.js +13 -0
  258. package/dist/components/icons/Reddit.js +16 -0
  259. package/dist/components/icons/Share.js +31 -0
  260. package/dist/components/icons/Telegram.js +13 -0
  261. package/dist/components/icons/Twitter.js +10 -0
  262. package/dist/components/icons/X.js +10 -0
  263. package/dist/components/icons/Youtube.js +10 -0
  264. package/dist/components/icons/index.js +32 -0
  265. package/dist/components/landing-page/List.js +51 -0
  266. package/dist/components/landing-page/PageContent.js +65 -0
  267. package/dist/components/landing-page/PageText.js +171 -0
  268. package/dist/components/landing-page/PageTitle.js +259 -0
  269. package/dist/components/logo/Logo.js +57 -0
  270. package/dist/components/taxId/complete.js +24 -0
  271. package/dist/components/taxId/flow.js +53 -0
  272. package/dist/components/taxId/register-taxid.js +166 -0
  273. package/dist/config.js +44 -0
  274. package/dist/constants/globalVariables.js +87 -0
  275. package/dist/constants/style.js +48 -0
  276. package/dist/context/Auth.js +396 -0
  277. package/dist/context/AuthContext.js +781 -0
  278. package/dist/context/Checkbox/CheckboxContext.js +151 -0
  279. package/dist/firebase-config.js +73 -0
  280. package/dist/hooks/useNewVentureForm.js +262 -0
  281. package/dist/hooks/useTimer.js +89 -0
  282. package/dist/index.js +628 -25463
  283. package/dist/model/axios.js +10 -0
  284. package/dist/model/axiosPublic.js +9 -0
  285. package/dist/services/TimerService.js +80 -0
  286. package/dist/static/animations/checked.lottie.js +4 -0
  287. package/dist/static/animations/progress.lottie.js +4 -0
  288. package/dist/static/fonts/Ionicons/Ionicons.ttf.js +4 -0
  289. package/dist/static/fonts/Ionicons/Ionicons.woff.js +4 -0
  290. package/dist/static/fonts/Ionicons/Ionicons.woff2.js +4 -0
  291. package/dist/static/fonts/Ionicons/ionicons.min.css.js +4 -0
  292. package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf.js +4 -0
  293. package/dist/static/fonts/OpenSans/OpenSans-Bold.woff.js +4 -0
  294. package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2.js +4 -0
  295. package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf.js +4 -0
  296. package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff.js +4 -0
  297. package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2.js +4 -0
  298. package/dist/static/fonts/OpenSans/OpenSans-Light.ttf.js +4 -0
  299. package/dist/static/fonts/OpenSans/OpenSans-Light.woff.js +4 -0
  300. package/dist/static/fonts/OpenSans/OpenSans-Light.woff2.js +4 -0
  301. package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf.js +4 -0
  302. package/dist/static/fonts/OpenSans/OpenSans-Regular.woff.js +4 -0
  303. package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2.js +4 -0
  304. package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf.js +4 -0
  305. package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff.js +4 -0
  306. package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2.js +4 -0
  307. package/dist/static/fonts/icomoon/icomoon.eot.js +4 -0
  308. package/dist/static/fonts/icomoon/icomoon.svg.js +4 -0
  309. package/dist/static/fonts/icomoon/icomoon.ttf.js +4 -0
  310. package/dist/static/fonts/icomoon/icomoon.woff.js +4 -0
  311. package/dist/static/images/add-folder-icon.svg.js +5 -0
  312. package/dist/static/images/address-refreshing.gif.js +4 -0
  313. package/dist/static/images/arrow-down-black.svg.js +4 -0
  314. package/dist/static/images/avatar-placeholder.png.js +4 -0
  315. package/dist/static/images/background3.png.js +4 -0
  316. package/dist/static/images/bitcoin-logo.svg.js +4 -0
  317. package/dist/static/images/bmn2-logo.svg.js +4 -0
  318. package/dist/static/images/check-icon.svg.js +5 -0
  319. package/dist/static/images/checkmark-circle-icon.svg.js +5 -0
  320. package/dist/static/images/close-circle-icon.svg.js +5 -0
  321. package/dist/static/images/copy_icon.svg.js +5 -0
  322. package/dist/static/images/cross-icon.svg.js +5 -0
  323. package/dist/static/images/early-adopter.png.js +4 -0
  324. package/dist/static/images/eth_logo.svg.js +4 -0
  325. package/dist/static/images/filter-icon.svg.js +5 -0
  326. package/dist/static/images/google_auth.png.js +4 -0
  327. package/dist/static/images/graduation.png.js +4 -0
  328. package/dist/static/images/mangopay.svg.js +4 -0
  329. package/dist/static/images/numbers/number_eight.svg.js +5 -0
  330. package/dist/static/images/numbers/number_five.svg.js +5 -0
  331. package/dist/static/images/numbers/number_four.svg.js +5 -0
  332. package/dist/static/images/numbers/number_nine.svg.js +5 -0
  333. package/dist/static/images/numbers/number_one.svg.js +5 -0
  334. package/dist/static/images/numbers/number_seven.svg.js +5 -0
  335. package/dist/static/images/numbers/number_six.svg.js +5 -0
  336. package/dist/static/images/numbers/number_three.svg.js +5 -0
  337. package/dist/static/images/numbers/number_two.svg.js +5 -0
  338. package/dist/static/images/numbers/number_zero.svg.js +5 -0
  339. package/dist/static/images/process-waiting.gif.js +4 -0
  340. package/dist/static/images/search-icon.svg.js +5 -0
  341. package/dist/static/images/social/Facebook_Logo.png.js +4 -0
  342. package/dist/static/images/social/LI-In-Bug.png.js +4 -0
  343. package/dist/static/images/social/Telegram-Logo.png.js +4 -0
  344. package/dist/static/images/social/X-logo-black.png.js +4 -0
  345. package/dist/static/images/social/youtube_social_circle_red.png.js +4 -0
  346. package/dist/static/images/transfer-icon.svg.js +5 -0
  347. package/dist/static/images/usdc-logo.svg.js +4 -0
  348. package/dist/static/images/usdq-logo.png.js +4 -0
  349. package/dist/static/images/warning-filled.svg.js +5 -0
  350. package/dist/styles/colors.js +56 -0
  351. package/dist/styles/fonts.js +100 -0
  352. package/dist/styles/global.js +74 -0
  353. package/dist/styles/grid.js +11 -0
  354. package/dist/styles/ioniconsStyles.js +31 -0
  355. package/dist/styles/reactTippy.js +40 -0
  356. package/dist/styles/rwd.js +56 -0
  357. package/dist/styles/semanticUi.js +84 -0
  358. package/dist/styles/spacing.js +8 -0
  359. package/dist/styles/theme.js +34 -0
  360. package/dist/utils/check-sale-time-left.js +85 -0
  361. package/dist/utils/check-todo-status.js +11 -0
  362. package/dist/utils/checklistGenerator.js +195 -0
  363. package/dist/utils/copyToClipboard.js +92 -0
  364. package/dist/utils/customHooks.js +126 -0
  365. package/dist/utils/delete-redirect-cookie-and-navigate.js +12 -0
  366. package/dist/utils/fix-decimals.js +5 -0
  367. package/dist/utils/formatCurrencyValue.js +95 -0
  368. package/dist/utils/get-cookie-domain.js +10 -0
  369. package/dist/utils/get-short-address.js +4 -0
  370. package/dist/utils/isUSInvestor.js +6 -0
  371. package/dist/utils/km_ify.js +33 -0
  372. package/dist/utils/moment.js +26 -0
  373. package/dist/utils/redirect-url.js +5 -0
  374. package/dist/utils/saveAs.js +17 -0
  375. package/dist/utils/scrollUtils.js +63 -0
  376. package/dist/utils/set-redirect-cookie.js +16 -0
  377. package/dist/utils/transition.js +101 -0
  378. package/dist/utils/withRouter.js +24 -0
  379. package/package.json +146 -146
@@ -0,0 +1,92 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default, { useState } from "react";
3
+ import { CopyToClipboard } from "react-copy-to-clipboard";
4
+ import { CopyToClipboard as CopyToClipboard2 } from "react-copy-to-clipboard";
5
+ import { Tooltip } from "react-tippy";
6
+ import { CopyToClipboardButton } from "../components/CryptoAddress/CryptoAddress.styles.js";
7
+ const copyTextToClipboard = async (text, onCopy, onError) => {
8
+ try {
9
+ if (navigator.clipboard && window.isSecureContext) {
10
+ await navigator.clipboard.writeText(text);
11
+ if (onCopy) onCopy(text, true);
12
+ return true;
13
+ } else {
14
+ const textArea = document.createElement("textarea");
15
+ textArea.value = text;
16
+ textArea.style.position = "fixed";
17
+ textArea.style.left = "-999999px";
18
+ textArea.style.top = "-999999px";
19
+ document.body.appendChild(textArea);
20
+ textArea.focus();
21
+ textArea.select();
22
+ const successful = document.execCommand("copy");
23
+ document.body.removeChild(textArea);
24
+ if (successful) {
25
+ if (onCopy) onCopy(text, true);
26
+ return true;
27
+ } else {
28
+ if (onError) onError(new Error("Failed to copy text"));
29
+ return false;
30
+ }
31
+ }
32
+ } catch (error) {
33
+ if (onError) onError(error);
34
+ return false;
35
+ }
36
+ };
37
+ const withCopyToClipboard = (WrappedComponent, options = {}) => {
38
+ const { textProp = "text", onCopyProp = "onCopy", onErrorProp = "onError" } = options;
39
+ return function CopyToClipboardWrapper(props) {
40
+ const text = props[textProp];
41
+ const onCopy = props[onCopyProp];
42
+ const onError = props[onErrorProp];
43
+ const handleCopy = () => {
44
+ if (text) {
45
+ copyTextToClipboard(text, onCopy, onError);
46
+ }
47
+ };
48
+ return /* @__PURE__ */ jsx(CopyToClipboard, { text, onCopy: handleCopy, children: /* @__PURE__ */ jsx(WrappedComponent, { ...props }) });
49
+ };
50
+ };
51
+ const useCopyToClipboard = (text) => {
52
+ const [copied, setCopied] = React__default.useState(false);
53
+ const copy = React__default.useCallback(
54
+ async (customText) => {
55
+ const textToCopy = customText || text;
56
+ const success = await copyTextToClipboard(
57
+ textToCopy,
58
+ () => setCopied(true),
59
+ () => setCopied(false)
60
+ );
61
+ if (success) {
62
+ setTimeout(() => setCopied(false), 2e3);
63
+ }
64
+ return success;
65
+ },
66
+ [text]
67
+ );
68
+ return { copy, copied };
69
+ };
70
+ const CopyToClipBoardTooltip = ({ value, buttonStyle }) => {
71
+ const [copied, setCopied] = useState(false);
72
+ return /* @__PURE__ */ jsx(
73
+ Tooltip,
74
+ {
75
+ position: "top",
76
+ title: copied ? "Copied to clipboard!" : "Click to copy to clipboard.",
77
+ theme: "light",
78
+ arrow: true,
79
+ hideOnClick: false,
80
+ onHidden: () => setCopied(false),
81
+ duration: 200,
82
+ children: /* @__PURE__ */ jsx(CopyToClipboard, { text: value, onCopy: () => setCopied(true), children: /* @__PURE__ */ jsx(CopyToClipboardButton, { style: buttonStyle }) })
83
+ }
84
+ );
85
+ };
86
+ export {
87
+ CopyToClipBoardTooltip,
88
+ CopyToClipboard2 as CopyToClipboard,
89
+ copyTextToClipboard,
90
+ useCopyToClipboard,
91
+ withCopyToClipboard
92
+ };
@@ -0,0 +1,126 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default, { useRef, useState, useEffect, useCallback } from "react";
3
+ import { sizes } from "../styles/rwd.js";
4
+ const useMobileView = (breakpoint = sizes.Medium) => {
5
+ var breakpointNumber = breakpoint.match(/\d/g);
6
+ breakpointNumber = breakpointNumber.join("");
7
+ const [isMobile, setisMobile] = React__default.useState(window.innerWidth <= breakpointNumber);
8
+ const timeout = React__default.useRef();
9
+ const checkIsMobile = () => window.innerWidth <= breakpointNumber;
10
+ const onResizeTimeout = () => {
11
+ setisMobile(checkIsMobile());
12
+ };
13
+ const onResize = () => {
14
+ clearTimeout(timeout.current);
15
+ timeout.current = setTimeout(onResizeTimeout, 100);
16
+ };
17
+ React__default.useEffect(() => {
18
+ window.addEventListener("resize", onResize);
19
+ const initialId = setTimeout(onResizeTimeout, 0);
20
+ return () => {
21
+ clearTimeout(initialId);
22
+ window.removeEventListener("resize", onResize);
23
+ };
24
+ }, []);
25
+ return isMobile;
26
+ };
27
+ const useContainerSize = (ref, breakpoint = 500) => {
28
+ const [isMobile, setIsMobile] = useState(false);
29
+ const checkSize = () => {
30
+ const width = ref.current.offsetWidth;
31
+ setIsMobile(width < breakpoint);
32
+ };
33
+ useEffect(() => {
34
+ if (!ref.current) return;
35
+ const initialId = setTimeout(checkSize, 0);
36
+ const resizeObserver = new ResizeObserver(() => {
37
+ checkSize();
38
+ });
39
+ resizeObserver.observe(ref.current);
40
+ return () => {
41
+ clearTimeout(initialId);
42
+ resizeObserver.disconnect();
43
+ };
44
+ }, [breakpoint]);
45
+ return isMobile;
46
+ };
47
+ function usePrevious(value) {
48
+ const ref = useRef();
49
+ const [previous, setPrevious] = useState();
50
+ useEffect(() => {
51
+ const previousValue = ref.current;
52
+ ref.current = value;
53
+ const id = setTimeout(() => setPrevious(previousValue), 0);
54
+ return () => clearTimeout(id);
55
+ }, [value]);
56
+ return previous;
57
+ }
58
+ const useCooldown = (cooldownInSeconds) => {
59
+ const [isDisabled, setIsDisabled] = useState(false);
60
+ const [hasTimerFinished, sethasTimerFinished] = useState(false);
61
+ const [secondsRemaining, setSecondsRemaining] = useState(0);
62
+ const lastCalled = useRef(null);
63
+ const startCooldown = (actionCallback) => {
64
+ if (!isDisabled) {
65
+ setIsDisabled(true);
66
+ sethasTimerFinished(false);
67
+ setSecondsRemaining(cooldownInSeconds);
68
+ lastCalled.current = Date.now();
69
+ if (actionCallback) {
70
+ actionCallback();
71
+ }
72
+ }
73
+ };
74
+ const updateCooldown = useCallback(() => {
75
+ const secondsPassed = Math.ceil((Date.now() - lastCalled.current) / 1e3);
76
+ setSecondsRemaining(cooldownInSeconds - secondsPassed);
77
+ if (secondsPassed >= cooldownInSeconds) {
78
+ setIsDisabled(false);
79
+ sethasTimerFinished(true);
80
+ }
81
+ }, [cooldownInSeconds]);
82
+ useEffect(() => {
83
+ let timerId;
84
+ let initialId;
85
+ if (isDisabled) {
86
+ initialId = setTimeout(updateCooldown, 0);
87
+ timerId = setInterval(updateCooldown, 1e3);
88
+ }
89
+ return () => {
90
+ clearTimeout(initialId);
91
+ clearInterval(timerId);
92
+ };
93
+ }, [cooldownInSeconds, isDisabled, updateCooldown]);
94
+ return { isDisabled, secondsRemaining, startCooldown, hasTimerFinished };
95
+ };
96
+ const cooldownHOC = (Component, seconds = 60) => {
97
+ const Wrapper = (props) => {
98
+ const cooldownProps = useCooldown(seconds);
99
+ return /* @__PURE__ */ jsx(Component, { cooldown: cooldownProps, ...props });
100
+ };
101
+ return Wrapper;
102
+ };
103
+ function useComponentVisible(initialIsVisible) {
104
+ const [isComponentVisible, setIsComponentVisible] = useState(initialIsVisible);
105
+ const ref = useRef(null);
106
+ const handleClickOutside = (event) => {
107
+ if (ref.current && !ref.current.contains(event.target)) {
108
+ setIsComponentVisible(false);
109
+ }
110
+ };
111
+ useEffect(() => {
112
+ document.addEventListener("click", handleClickOutside, true);
113
+ return () => {
114
+ document.removeEventListener("click", handleClickOutside, true);
115
+ };
116
+ }, []);
117
+ return { ref, isComponentVisible, setIsComponentVisible };
118
+ }
119
+ export {
120
+ cooldownHOC,
121
+ useComponentVisible,
122
+ useContainerSize,
123
+ useCooldown,
124
+ useMobileView,
125
+ usePrevious
126
+ };
@@ -0,0 +1,12 @@
1
+ import Cookies from "js-cookie";
2
+ import getCookieDomain from "./get-cookie-domain.js";
3
+ import redirectUrl from "./redirect-url.js";
4
+ const deleteRedirectCookieAndNavigate = () => {
5
+ const cookieDomain = getCookieDomain();
6
+ Cookies.remove("STOKR_INVESTOR_DASHBOARD_REDIRECT", cookieDomain);
7
+ Cookies.remove("STOKR_INVEST_IN_STO_REDIRECT", cookieDomain);
8
+ window.location.href = redirectUrl;
9
+ };
10
+ export {
11
+ deleteRedirectCookieAndNavigate as default
12
+ };
@@ -0,0 +1,5 @@
1
+ const fixDecimals = (value, decimals, roundingFn = Math.round) => (roundingFn(Number(value) * 10 ** decimals) / 10 ** decimals).toFixed(decimals);
2
+ export {
3
+ fixDecimals as default,
4
+ fixDecimals
5
+ };
@@ -0,0 +1,95 @@
1
+ import USDCICon from "../static/images/usdc-logo.svg.js";
2
+ import USDQIcon from "../static/images/usdq-logo.png.js";
3
+ import BitcoinLogo from "../static/images/bitcoin-logo.svg.js";
4
+ import BMN2Logo from "../static/images/bmn2-logo.svg.js";
5
+ import ETHLogo from "../static/images/eth_logo.svg.js";
6
+ const formatCurrencyValue = (currency, value, tokenDecimals = 2, options = {}) => {
7
+ const { valueFirst = false } = options;
8
+ const [symbol, decimals] = {
9
+ tether: ["USDT", 2],
10
+ gemini: ["GUSD", 2],
11
+ ether: ["ETH", 4],
12
+ artid: ["ARTID", 2],
13
+ bitcoin: ["BTC", 8],
14
+ lbtc: ["LBTC", 8],
15
+ "lusdt-bfx": ["USDT", 2],
16
+ "lbtc-bfx": ["LBTC", 8],
17
+ "btc-bfx": ["BTC", 8],
18
+ euro: ["EUR", 2],
19
+ usd: ["USD", 2],
20
+ chf: ["CHF", 2],
21
+ lusdt: ["USDT", 2],
22
+ "bitcoin-private": ["EUR", 2],
23
+ "lbtc-private": ["BTC", 8],
24
+ bmn1: ["BMN1", 2],
25
+ bmn2: ["BMN2", 4],
26
+ "btc-fb": ["BTC", 8],
27
+ "usdc-fb": ["USDC", 2],
28
+ "usdq-fb": ["USDQ", 2],
29
+ xaut: ["XAUt", 6]
30
+ }[currency] || [currency, tokenDecimals];
31
+ const formattedValue = parseFloat(Math.abs(value)).toFixed(decimals);
32
+ return valueFirst ? `${formattedValue} ${symbol}` : `${symbol} ${formattedValue}`;
33
+ };
34
+ const getCurrencySymbol = (currencySelected) => ({
35
+ euro: "€",
36
+ usd: "$",
37
+ ether: "ETH",
38
+ chf: "CHF",
39
+ tether: "USDT",
40
+ bitcoin: "BTC",
41
+ lbtc: "LBTC",
42
+ lusdt: "USDT",
43
+ "lusdt-bfx": "USDT",
44
+ "lbtc-bfx": "LBTC",
45
+ "btc-bfx": "BTC",
46
+ bmn1: "BMN1",
47
+ bmn2: "BMN2",
48
+ "btc-fb": "BTC",
49
+ "usdc-fb": "USDC",
50
+ "usdq-fb": "USDQ",
51
+ xaut: "XAUt",
52
+ "eth-fb": "ETH"
53
+ })[currencySelected] || currencySelected;
54
+ const getProjectCurrencySign = (tokenCurrency) => {
55
+ return tokenCurrency === "EUR" ? "€" : tokenCurrency === "USD" ? "$" : tokenCurrency === "BTC" ? "₿" : "";
56
+ };
57
+ const getCurrencyIcon = (currency, customIcon) => {
58
+ if (customIcon) return customIcon;
59
+ if (!currency) return null;
60
+ switch (currency.toLowerCase()) {
61
+ case "btc":
62
+ case "bitcoin":
63
+ case "btc-fb":
64
+ return BitcoinLogo;
65
+ case "usdc":
66
+ case "usdc-fb":
67
+ return USDCICon;
68
+ case "usdq":
69
+ case "usdq-fb":
70
+ return USDQIcon;
71
+ case "bmn2":
72
+ return BMN2Logo;
73
+ case "eth":
74
+ case "eth-fb":
75
+ return ETHLogo;
76
+ default:
77
+ return null;
78
+ }
79
+ };
80
+ const getLiquidAssetIcon = async (assetId) => {
81
+ const url = `https://liquid.network/api/v1/asset/${assetId}/icon`;
82
+ return new Promise((resolve) => {
83
+ const img = new Image();
84
+ img.onload = () => resolve(url);
85
+ img.onerror = () => resolve(null);
86
+ img.src = url;
87
+ });
88
+ };
89
+ export {
90
+ formatCurrencyValue,
91
+ getCurrencyIcon,
92
+ getCurrencySymbol,
93
+ getLiquidAssetIcon,
94
+ getProjectCurrencySign
95
+ };
@@ -0,0 +1,10 @@
1
+ import { getConfig } from "../config.js";
2
+ const getCookieDomain = () => {
3
+ const domain = getConfig("cookieDomain");
4
+ const useDomain = domain && domain !== "localhost";
5
+ return useDomain ? { domain } : {};
6
+ };
7
+ export {
8
+ getCookieDomain as default,
9
+ getCookieDomain
10
+ };
@@ -0,0 +1,4 @@
1
+ const getShortAddress = (address) => `${address.slice(0, 6)}[...]${address.slice(-4)}`;
2
+ export {
3
+ getShortAddress as default
4
+ };
@@ -0,0 +1,6 @@
1
+ const usCountries = ["United States", "Puerto Rico"];
2
+ const isUSInvestor = (user) => usCountries.includes(user.country);
3
+ export {
4
+ isUSInvestor,
5
+ usCountries
6
+ };
@@ -0,0 +1,33 @@
1
+ const truncateDecimals = (number, digits) => {
2
+ var re = new RegExp("(\\d+\\.\\d{" + digits + "})(\\d)"), m = number.toString().match(re);
3
+ return m ? parseFloat(m[1]) : number.valueOf();
4
+ };
5
+ const km_ify = (input, decimals, convertBillion = true) => {
6
+ if (input >= 1e9 && convertBillion) {
7
+ input /= 1e9;
8
+ if (input % 10 !== 0) {
9
+ input = truncateDecimals(input, 1);
10
+ }
11
+ return input += "B";
12
+ }
13
+ if (input >= 1e6) {
14
+ input /= 1e6;
15
+ if (input % 10 !== 0) {
16
+ input = truncateDecimals(input, 1);
17
+ }
18
+ return input += "M";
19
+ }
20
+ if (input >= 1e3) {
21
+ input /= 1e3;
22
+ if (input % 10 !== 0) {
23
+ input = truncateDecimals(input, 1);
24
+ }
25
+ return input += "K";
26
+ }
27
+ if (decimals) {
28
+ return input.toFixed(decimals);
29
+ } else return input;
30
+ };
31
+ export {
32
+ km_ify
33
+ };
@@ -0,0 +1,26 @@
1
+ import { format } from "date-fns";
2
+ import { format as format2 } from "date-fns";
3
+ const momentUtils = {
4
+ /**
5
+ * Format a date to a readable string
6
+ * @param {Date|string|number} date - The date to format
7
+ * @param {string} formatStr - The format string (default: 'dd MMM yyyy')
8
+ * @returns {string} - Formatted date string
9
+ */
10
+ formatDate: (date, formatStr = "dd MMM yyyy") => {
11
+ return format(new Date(date), formatStr);
12
+ },
13
+ /**
14
+ * Format a date to a readable string with time
15
+ * @param {Date|string|number} date - The date to format
16
+ * @param {string} formatStr - The format string (default: 'dd MMM yyyy - hh:mm')
17
+ * @returns {string} - Formatted date string
18
+ */
19
+ formatDateTime: (date, formatStr = "dd MMM yyyy - hh:mm") => {
20
+ return format(new Date(date), formatStr);
21
+ }
22
+ };
23
+ export {
24
+ format2 as format,
25
+ momentUtils
26
+ };
@@ -0,0 +1,5 @@
1
+ import Cookies from "js-cookie";
2
+ const redirectUrl = Cookies.get("STOKR_INVESTOR_DASHBOARD_REDIRECT") || Cookies.get("STOKR_INVEST_IN_STO_REDIRECT");
3
+ export {
4
+ redirectUrl as default
5
+ };
@@ -0,0 +1,17 @@
1
+ const saveAs = (file, fileName = "fileName") => {
2
+ const url = window.URL.createObjectURL(file);
3
+ const link = document.createElement("a");
4
+ link.href = url;
5
+ link.setAttribute("download", fileName);
6
+ document.body.appendChild(link);
7
+ link.click();
8
+ link.parentNode.removeChild(link);
9
+ };
10
+ const openFile = (file) => {
11
+ var url = window.URL.createObjectURL(file);
12
+ window.open(url);
13
+ };
14
+ export {
15
+ openFile,
16
+ saveAs
17
+ };
@@ -0,0 +1,63 @@
1
+ import { useEffect, useCallback } from "react";
2
+ import { useLocation } from "react-router-dom";
3
+ const scrollToElement = (elementRef, options = {}) => {
4
+ const { behavior = "smooth", block = "start", delay = 0 } = options;
5
+ const performScroll = () => {
6
+ if (!elementRef?.current) return;
7
+ const isAppleDevice = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
8
+ requestAnimationFrame(() => {
9
+ if (isAppleDevice) {
10
+ const rect = elementRef.current.getBoundingClientRect();
11
+ const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
12
+ const targetY = rect.top + scrollTop;
13
+ window.scrollTo({
14
+ top: targetY,
15
+ behavior: behavior === "smooth" ? "auto" : behavior
16
+ // Use 'auto' for Apple devices
17
+ });
18
+ } else {
19
+ elementRef.current.scrollIntoView({
20
+ behavior,
21
+ block
22
+ });
23
+ }
24
+ });
25
+ };
26
+ if (delay > 0) {
27
+ setTimeout(performScroll, delay);
28
+ } else {
29
+ performScroll();
30
+ }
31
+ };
32
+ const useScrollActions = () => {
33
+ const scrollToTop = useCallback(() => {
34
+ window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
35
+ }, []);
36
+ const scrollToElementWithOffset = useCallback((elementRef, desiredOffsetFromBottom = 0) => {
37
+ if (elementRef && elementRef.current) {
38
+ const targetElement = elementRef.current;
39
+ const scrollNeeded = targetElement.getBoundingClientRect().bottom - (window.innerHeight - desiredOffsetFromBottom);
40
+ window.scrollBy({
41
+ top: scrollNeeded,
42
+ behavior: "smooth"
43
+ });
44
+ }
45
+ }, []);
46
+ return {
47
+ scrollToTop,
48
+ scrollToElement,
49
+ scrollToElementWithOffset
50
+ };
51
+ };
52
+ const ScrollToTop = () => {
53
+ const { pathname } = useLocation();
54
+ useEffect(() => {
55
+ window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
56
+ }, [pathname]);
57
+ return null;
58
+ };
59
+ export {
60
+ ScrollToTop,
61
+ scrollToElement,
62
+ useScrollActions
63
+ };
@@ -0,0 +1,16 @@
1
+ import Cookies from "js-cookie";
2
+ import { getConfig } from "../config.js";
3
+ const setRedirectCookie = (path = "") => {
4
+ const inOneHour = 1 / 24;
5
+ const cookieOptions = {
6
+ expires: inOneHour
7
+ };
8
+ const domain = getConfig("cookieDomain");
9
+ if (domain) {
10
+ cookieOptions.domain = domain;
11
+ }
12
+ Cookies.set("STOKR_INVESTOR_DASHBOARD_REDIRECT", `${window.location.href}${path}`, cookieOptions);
13
+ };
14
+ export {
15
+ setRedirectCookie as default
16
+ };
@@ -0,0 +1,101 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default, { useState, useRef, useEffect } from "react";
3
+ import PropTypes from "prop-types";
4
+ const getTimeout = (timeout, phase) => {
5
+ if (typeof timeout === "number") return timeout;
6
+ return timeout?.[phase] ?? 0;
7
+ };
8
+ function Transition({
9
+ in: inProp = true,
10
+ timeout = 300,
11
+ children,
12
+ nodeRef: nodeRefProp,
13
+ unmountOnExit = false,
14
+ onEntered,
15
+ onExited,
16
+ ...rest
17
+ }) {
18
+ const [status, setStatus] = useState(() => {
19
+ if (inProp) return "entering";
20
+ return unmountOnExit ? "unmounted" : "exited";
21
+ });
22
+ const internalRef = useRef(null);
23
+ const nodeRef = nodeRefProp ?? internalRef;
24
+ const timeoutRef = useRef(null);
25
+ const clearTimer = () => {
26
+ if (timeoutRef.current) {
27
+ clearTimeout(timeoutRef.current);
28
+ timeoutRef.current = null;
29
+ }
30
+ };
31
+ useEffect(() => {
32
+ if (inProp) {
33
+ setStatus("entering");
34
+ const enterMs = getTimeout(timeout, "enter");
35
+ const id = setTimeout(() => {
36
+ timeoutRef.current = null;
37
+ setStatus("entered");
38
+ onEntered?.(nodeRef.current);
39
+ }, enterMs);
40
+ timeoutRef.current = id;
41
+ return () => {
42
+ clearTimeout(id);
43
+ timeoutRef.current = null;
44
+ };
45
+ } else {
46
+ setStatus("exiting");
47
+ const exitMs = getTimeout(timeout, "exit");
48
+ const id = setTimeout(() => {
49
+ timeoutRef.current = null;
50
+ setStatus("exited");
51
+ onExited?.(nodeRef.current);
52
+ if (unmountOnExit) setStatus("unmounted");
53
+ }, exitMs);
54
+ timeoutRef.current = id;
55
+ return () => {
56
+ clearTimeout(id);
57
+ timeoutRef.current = null;
58
+ };
59
+ }
60
+ }, [inProp, timeout, unmountOnExit, onEntered, onExited, nodeRef]);
61
+ useEffect(() => () => clearTimer(), []);
62
+ if (status === "unmounted") return null;
63
+ const child = typeof children === "function" ? children(status) : children;
64
+ if (nodeRefProp) return child;
65
+ const content = React__default.isValidElement(child) && child.type !== React__default.Fragment ? React__default.createElement(child.type, child.props) : child;
66
+ return /* @__PURE__ */ jsx("div", { ref: nodeRef, ...rest, children: content });
67
+ }
68
+ Transition.propTypes = {
69
+ in: PropTypes.bool,
70
+ timeout: PropTypes.oneOfType([
71
+ PropTypes.number,
72
+ PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number })
73
+ ]),
74
+ children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
75
+ nodeRef: PropTypes.object,
76
+ unmountOnExit: PropTypes.bool,
77
+ onEntered: PropTypes.func,
78
+ onExited: PropTypes.func
79
+ };
80
+ function TransitionGroup({ component: Component = "div", children, ...rest }) {
81
+ return /* @__PURE__ */ jsx(Component, { ...rest, children });
82
+ }
83
+ TransitionGroup.propTypes = {
84
+ component: PropTypes.elementType,
85
+ children: PropTypes.node
86
+ };
87
+ ({
88
+ in: PropTypes.bool.isRequired,
89
+ timeout: PropTypes.oneOfType([
90
+ PropTypes.number,
91
+ PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number })
92
+ ]),
93
+ classNames: PropTypes.string,
94
+ children: PropTypes.element.isRequired,
95
+ unmountOnExit: PropTypes.bool,
96
+ nodeRef: PropTypes.object
97
+ });
98
+ export {
99
+ Transition,
100
+ TransitionGroup
101
+ };
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useInRouterContext, useNavigate, useLocation } from "react-router-dom";
4
+ const noopNavigate = () => {
5
+ };
6
+ const fallbackLocation = { pathname: "/", search: "", hash: "", state: null, key: "default" };
7
+ const withRouter = (Component) => {
8
+ const InnerWithRouter = (props) => {
9
+ const navigate = useNavigate();
10
+ const location = useLocation();
11
+ return /* @__PURE__ */ jsx(Component, { navigate, location, ...props });
12
+ };
13
+ const Wrapper = (props) => {
14
+ const inRouter = useInRouterContext();
15
+ if (inRouter) {
16
+ return /* @__PURE__ */ jsx(InnerWithRouter, { ...props });
17
+ }
18
+ return /* @__PURE__ */ jsx(Component, { navigate: noopNavigate, location: fallbackLocation, ...props });
19
+ };
20
+ return Wrapper;
21
+ };
22
+ export {
23
+ withRouter
24
+ };