@stokr/components-library 3.0.16 → 3.0.18
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.
- package/README.md +261 -262
- package/dist/analytics/index.js +180 -0
- package/dist/api/auth.js +15 -0
- package/dist/api/fetchData.js +27 -0
- package/dist/api/fetchDataPublic.js +19 -0
- package/dist/auth/index.js +32 -0
- package/dist/components/2FA/Connect2FA.js +55 -0
- package/dist/components/2FA/EnterCode.js +63 -0
- package/dist/components/2FA/InstallAuthApp.js +64 -0
- package/dist/components/2FA/ResetCode.js +33 -0
- package/dist/components/2FA/Sucess2FA.js +51 -0
- package/dist/components/2FA/disable-2fa-flow.js +91 -0
- package/dist/components/2FA/enable-2fa-flow.js +137 -0
- package/dist/components/2FA/login-with-otp-flow.js +206 -0
- package/dist/components/2FA/main-flow.js +217 -0
- package/dist/components/AccountBalance/AccountBalance.js +35 -0
- package/dist/components/AccountBalance/AccountBalance.styles.js +48 -0
- package/dist/components/AdminDashboard/Table/ReactTable.js +266 -0
- package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +65 -0
- package/dist/components/AdminDashboard/Table/Table.js +123 -0
- package/dist/components/AdminDashboard/Table/Table.styles.js +263 -0
- package/dist/components/AgreementItem/AgreementItem.js +39 -0
- package/dist/components/AgreementItem/AgreementItem.styles.js +32 -0
- package/dist/components/BackButton/BackButton.js +34 -0
- package/dist/components/BackButton/BackButton.styles.js +123 -0
- package/dist/components/Background/Background.js +45 -0
- package/dist/components/Background/Background.styles.js +119 -0
- package/dist/components/BasicTable/BasicTable.js +25 -0
- package/dist/components/BasicTable/BasicTable.styles.js +76 -0
- package/dist/components/BlogPost/BlogPost.js +98 -0
- package/dist/components/BlogPost/BlogPost.styles.js +230 -0
- package/dist/components/Button/Button.styles.js +207 -0
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +51 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +18 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +41 -0
- package/dist/components/Card/Card.styles.js +97 -0
- package/dist/components/ChartLegend/ChartLegend.js +62 -0
- package/dist/components/ChartLegend/ChartLegend.styles.js +133 -0
- package/dist/components/Checkbox/Checkbox.js +80 -0
- package/dist/components/Checkbox/Checkbox.styles.js +133 -0
- package/dist/components/Checklist/ChecklistCard.js +71 -0
- package/dist/components/Checklist/ChecklistCard.styles.js +82 -0
- package/dist/components/Chips/Chip.js +23 -0
- package/dist/components/Chips/Chip.styles.js +72 -0
- package/dist/components/Chips/ChipWrapper.js +50 -0
- package/dist/components/ComponentScroll/ComponentScroll.js +70 -0
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +127 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +165 -0
- package/dist/components/ConfirmModal/ConfirmModal.js +199 -0
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +44 -0
- package/dist/components/CryptoAddress/ComponentWrap.js +16 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +151 -0
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +443 -0
- package/dist/components/CryptoAddress/RadioWrap.js +47 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +34 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +125 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +25 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +111 -0
- package/dist/components/DoubleButton/DoubleButton.styles.js +27 -0
- package/dist/components/ErrorMessage/ErrorMessage.styles.js +9 -0
- package/dist/components/FAQ/FAQ.js +73 -0
- package/dist/components/FAQ/FAQ.styles.js +128 -0
- package/dist/components/Footer/Footer.js +55 -0
- package/dist/components/Footer/Footer.styles.js +256 -0
- package/dist/components/Footer/FooterLayout.js +145 -0
- package/dist/components/Footer/FooterMenu.js +100 -0
- package/dist/components/Footer/FooterMenu.styles.js +321 -0
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +100 -0
- package/dist/components/Form/Form.js +21 -0
- package/dist/components/Form/Form.styles.js +72 -0
- package/dist/components/Grid/Grid.styles.js +212 -0
- package/dist/components/Header/Header.js +425 -0
- package/dist/components/Header/Header.styles.js +567 -0
- package/dist/components/HeroBlock/HeroVideoBlock.js +105 -0
- package/dist/components/Icon/Icon.style.js +92 -0
- package/dist/components/Icon/Icon2.js +12 -0
- package/dist/components/InfoBox/InfoBox.js +93 -0
- package/dist/components/InfoIcon/InfoIcon.js +62 -0
- package/dist/components/InfoIcon/InfoIcon.styles.js +64 -0
- package/dist/components/Input/DatePickerInput.js +139 -0
- package/dist/components/Input/DatePickerInput.styles.js +165 -0
- package/dist/components/Input/Input.js +108 -0
- package/dist/components/Input/Input.styles.js +154 -0
- package/dist/components/Input/InputPassword.js +122 -0
- package/dist/components/Input/InputPassword.styles.js +166 -0
- package/dist/components/Input/InputUsername.js +92 -0
- package/dist/components/Input/InputWithButton.js +53 -0
- package/dist/components/Input/InputWithButton.styles.js +57 -0
- package/dist/components/Input/MultiSelect.js +306 -0
- package/dist/components/Input/OtpInput.js +70 -0
- package/dist/components/Input/RangeInput.js +80 -0
- package/dist/components/Input/RangeInput.styles.js +129 -0
- package/dist/components/Input/SearchInput.js +68 -0
- package/dist/components/Input/SearchInput.styles.js +92 -0
- package/dist/components/Input/Select.js +151 -0
- package/dist/components/Input/Select.styles.js +148 -0
- package/dist/components/Input/TableFilterDropdown.js +247 -0
- package/dist/components/Input/Textarea.js +51 -0
- package/dist/components/Input/Textarea.styles.js +62 -0
- package/dist/components/InvestCalculator/InvestCalculator.js +283 -0
- package/dist/components/InvestCalculator/InvestCalculator.styles.js +94 -0
- package/dist/components/InvestmentStat/InvestmentStat.js +24 -0
- package/dist/components/InvestmentStat/InvestmentStat.styles.js +62 -0
- package/dist/components/LatestUpdate/LatestUpdate.js +24 -0
- package/dist/components/LatestUpdate/LatestUpdate.styles.js +90 -0
- package/dist/components/Layout/Layout.js +69 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +32 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +208 -0
- package/dist/components/LearnMorePage/LearnMore.js +190 -0
- package/dist/components/LearnMorePage/LearnMore.propTypes.js +20 -0
- package/dist/components/LearnMorePage/LearnMore.shared.styles.js +56 -0
- package/dist/components/LearnMorePage/LearnMore.styles.js +276 -0
- package/dist/components/LearnMorePage/LearnMoreExampleObject.js +120 -0
- package/dist/components/LearnMorePage/LearnMoreItem.js +57 -0
- package/dist/components/LearnMorePage/LearnMoreItem.styles.js +234 -0
- package/dist/components/LearnMoreSection/LearnMore.js +138 -0
- package/dist/components/LearnMoreSection/LearnMore.styles.js +147 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.js +33 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +60 -0
- package/dist/components/LoginModal/LoginModal.js +142 -0
- package/dist/components/MainMenu/DynamicMainMenu.js +38 -0
- package/dist/components/MainMenu/MainMenu.js +210 -0
- package/dist/components/MainMenu/MainMenu.styles.js +362 -0
- package/dist/components/MenuNav/MenuNav.styles.js +66 -0
- package/dist/components/Modal/Modal.js +119 -0
- package/dist/components/Modal/Modal.styles.js +450 -0
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +262 -0
- package/dist/components/Modal/PaymentModal.js +149 -0
- package/dist/components/Modal/SideModal.js +134 -0
- package/dist/components/Modal/SideModal.styles.js +55 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.js +170 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +53 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.js +30 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +105 -0
- package/dist/components/Newsletter/Newsletter.js +122 -0
- package/dist/components/Newsletter/Newsletter.styles.js +186 -0
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +38 -0
- package/dist/components/Number/Number.js +50 -0
- package/dist/components/Number/Number.styles.js +23 -0
- package/dist/components/PageTransition/PageTransition.js +51 -0
- package/dist/components/Pagination/Pagination.js +58 -0
- package/dist/components/Pagination/Pagination.styles.js +59 -0
- package/dist/components/Pagination/PaginationControls.js +113 -0
- package/dist/components/Pagination/usePagination.js +40 -0
- package/dist/components/Payment/PaymentDetailsCard.js +359 -0
- package/dist/components/Payment/PaymentDisplay.js +199 -0
- package/dist/components/Payment/TimerComponent.js +92 -0
- package/dist/components/Process/Process.styles.js +84 -0
- package/dist/components/ProfileBadge/ProfileBadge.js +35 -0
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +53 -0
- package/dist/components/ProfileBox/ProfileBox.js +27 -0
- package/dist/components/ProfileBox/ProfileBox.styles.js +67 -0
- package/dist/components/ProfileStat/ProfileStat.js +29 -0
- package/dist/components/ProfileStat/ProfileStat.styles.js +90 -0
- package/dist/components/QRCode/QRCode.js +51 -0
- package/dist/components/Radio/Radio.js +51 -0
- package/dist/components/Radio/Radio.styles.js +100 -0
- package/dist/components/RefreshButton/RefreshButton.js +21 -0
- package/dist/components/RefreshButton/RefreshButton.styles.js +64 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +65 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +20 -0
- package/dist/components/RegisterModal/RegisterModal.js +248 -0
- package/dist/components/RequestDataBox/RequestDataBox.js +21 -0
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +43 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +44 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +41 -0
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +134 -0
- package/dist/components/SEO/SEO.js +66 -0
- package/dist/components/SectionTitle/SectionTitle.styles.js +26 -0
- package/dist/components/SideLine/SideLine.js +7 -0
- package/dist/components/SideLine/SideLine.styles.js +33 -0
- package/dist/components/Slider/Slider.js +31 -0
- package/dist/components/Slider/Slider.styles.js +120 -0
- package/dist/components/Snackbar/Snackbar.js +111 -0
- package/dist/components/Snackbar/Snackbar.styles.js +230 -0
- package/dist/components/Snackbar/SnackbarProvider.js +66 -0
- package/dist/components/Snackbar/useSnackbar.js +12 -0
- package/dist/components/SpanButton/SpanButton.styles.js +19 -0
- package/dist/components/StatusBadge/StatusBadge.styles.js +18 -0
- package/dist/components/StatusTag/StatusTag.js +105 -0
- package/dist/components/StatusTag/StatusTag.styles.js +88 -0
- package/dist/components/StepController/StepController.js +86 -0
- package/dist/components/StepController/StepController.styles.js +33 -0
- package/dist/components/StepController/StepControllerContext.js +65 -0
- package/dist/components/StepController/StepControllerProgress.js +37 -0
- package/dist/components/StepsProgress/StepIndicator.js +40 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +69 -0
- package/dist/components/StepsProgress/StepsProgress.js +67 -0
- package/dist/components/StepsProgress/StepsProgress.styles.js +105 -0
- package/dist/components/StokrLoader/StokrLoader.js +111 -0
- package/dist/components/StokrLoader/media.js +23 -0
- package/dist/components/SvgIcons/AdminBadgeSvg.js +27 -0
- package/dist/components/SvgIcons/CameraSvg.js +31 -0
- package/dist/components/SvgIcons/CapsLockSvg.js +36 -0
- package/dist/components/SvgIcons/DocumentBackSvg.js +20 -0
- package/dist/components/SvgIcons/DocumentSmallSvg.js +41 -0
- package/dist/components/SvgIcons/DocumentSvg.js +39 -0
- package/dist/components/SvgIcons/EthSvg.js +28 -0
- package/dist/components/SvgIcons/EurSvg.js +27 -0
- package/dist/components/SvgIcons/FaceScanIconSvg.js +17 -0
- package/dist/components/SvgIcons/FourSvg.js +7 -0
- package/dist/components/SvgIcons/Glassess.js +26 -0
- package/dist/components/SvgIcons/LogoSvg.js +17 -0
- package/dist/components/SvgIcons/OneSvg.js +10 -0
- package/dist/components/SvgIcons/PassportSvg.js +37 -0
- package/dist/components/SvgIcons/RefreshSvg.js +28 -0
- package/dist/components/SvgIcons/SocialFacebook.js +22 -0
- package/dist/components/SvgIcons/SocialInstagram.js +13 -0
- package/dist/components/SvgIcons/SocialLinkedIn.js +31 -0
- package/dist/components/SvgIcons/SocialMedium.js +21 -0
- package/dist/components/SvgIcons/SocialReddit.js +21 -0
- package/dist/components/SvgIcons/SocialTelegram.js +60 -0
- package/dist/components/SvgIcons/SocialTwitter.js +62 -0
- package/dist/components/SvgIcons/SocialYoutube.js +22 -0
- package/dist/components/SvgIcons/ThreeSvg.js +7 -0
- package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +48 -0
- package/dist/components/SvgIcons/TwoSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateDefaultSvg.js +12 -0
- package/dist/components/SvgIcons/UpdateHardSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateSoftSvg.js +11 -0
- package/dist/components/SvgIcons/UploadSvg.js +12 -0
- package/dist/components/SvgIcons/VerifiedBadge.js +16 -0
- package/dist/components/Switch/Switch.js +63 -0
- package/dist/components/Switch/Switch.styles.js +126 -0
- package/dist/components/Tabs/Tabs.js +54 -0
- package/dist/components/Tabs/Tabs.styles.js +15 -0
- package/dist/components/TabsNav/TabNav.js +16 -0
- package/dist/components/TabsNav/TabsNav.js +30 -0
- package/dist/components/TabsNav/TabsNav.styles.js +103 -0
- package/dist/components/TeamOverview/TeamOverview.js +80 -0
- package/dist/components/TeamOverview/TeamOverview.styles.js +167 -0
- package/dist/components/TermsModal/TermsModal.js +145 -0
- package/dist/components/TermsModal/_styles.js +313 -0
- package/dist/components/Text/Text.styles.js +220 -0
- package/dist/components/TextLink/TextLink.styles.js +67 -0
- package/dist/components/Timeline/Timeline.js +44 -0
- package/dist/components/Timeline/Timeline.styles.js +147 -0
- package/dist/components/Timeline/TimelineStep.js +58 -0
- package/dist/components/ToDoList/ToDoList.js +172 -0
- package/dist/components/ToDoList/ToDoList.styles.js +122 -0
- package/dist/components/ToDoList/ToDoListTask.js +95 -0
- package/dist/components/ToDoList/ToDoListTask.styles.js +119 -0
- package/dist/components/TransactionDetails/TransactionDetails.js +27 -0
- package/dist/components/TransactionDetails/TransactionDetails.styles.js +38 -0
- package/dist/components/TransactionInfo/TransactionInfo.js +41 -0
- package/dist/components/TransactionInfo/TransactionInfo.styles.js +75 -0
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +122 -0
- package/dist/components/breakdown/Breakdown.js +126 -0
- package/dist/components/headerHo/HeaderHo.js +709 -0
- package/dist/components/icons/Arrow.js +38 -0
- package/dist/components/icons/ArrowSimple.js +34 -0
- package/dist/components/icons/Check.js +16 -0
- package/dist/components/icons/Facebook.js +10 -0
- package/dist/components/icons/Info.js +27 -0
- package/dist/components/icons/Instagram.js +10 -0
- package/dist/components/icons/LinkIcon.js +49 -0
- package/dist/components/icons/LinkedIn.js +13 -0
- package/dist/components/icons/Medium.js +13 -0
- package/dist/components/icons/Reddit.js +16 -0
- package/dist/components/icons/Share.js +31 -0
- package/dist/components/icons/Telegram.js +13 -0
- package/dist/components/icons/Twitter.js +10 -0
- package/dist/components/icons/X.js +10 -0
- package/dist/components/icons/Youtube.js +10 -0
- package/dist/components/icons/index.js +32 -0
- package/dist/components/landing-page/List.js +51 -0
- package/dist/components/landing-page/PageContent.js +65 -0
- package/dist/components/landing-page/PageText.js +171 -0
- package/dist/components/landing-page/PageTitle.js +259 -0
- package/dist/components/logo/Logo.js +57 -0
- package/dist/components/taxId/complete.js +24 -0
- package/dist/components/taxId/flow.js +53 -0
- package/dist/components/taxId/register-taxid.js +166 -0
- package/dist/config.js +44 -0
- package/dist/constants/globalVariables.js +87 -0
- package/dist/constants/style.js +48 -0
- package/dist/context/Auth.js +396 -0
- package/dist/context/AuthContext.js +781 -0
- package/dist/context/Checkbox/CheckboxContext.js +151 -0
- package/dist/firebase-config.js +73 -0
- package/dist/hooks/useNewVentureForm.js +262 -0
- package/dist/hooks/useTimer.js +89 -0
- package/dist/hooks/useTransactionPolling.js +100 -0
- package/dist/index.js +632 -25463
- package/dist/model/axios.js +10 -0
- package/dist/model/axiosPublic.js +9 -0
- package/dist/services/TimerService.js +80 -0
- package/dist/static/animations/checked.lottie.js +4 -0
- package/dist/static/animations/progress.lottie.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.ttf.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff2.js +4 -0
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.eot.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.svg.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.ttf.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.woff.js +4 -0
- package/dist/static/images/add-folder-icon.svg.js +5 -0
- package/dist/static/images/address-refreshing.gif.js +4 -0
- package/dist/static/images/arrow-down-black.svg.js +4 -0
- package/dist/static/images/avatar-placeholder.png.js +4 -0
- package/dist/static/images/background3.png.js +4 -0
- package/dist/static/images/bitcoin-logo.svg.js +4 -0
- package/dist/static/images/bmn2-logo.svg.js +4 -0
- package/dist/static/images/check-icon.svg.js +5 -0
- package/dist/static/images/checkmark-circle-icon.svg.js +5 -0
- package/dist/static/images/close-circle-icon.svg.js +5 -0
- package/dist/static/images/copy_icon.svg.js +5 -0
- package/dist/static/images/cross-icon.svg.js +5 -0
- package/dist/static/images/early-adopter.png.js +4 -0
- package/dist/static/images/eth_logo.svg.js +4 -0
- package/dist/static/images/external-link-icon.svg +3 -0
- package/dist/static/images/external-link-icon.svg.js +4 -0
- package/dist/static/images/filter-icon.svg.js +5 -0
- package/dist/static/images/google_auth.png.js +4 -0
- package/dist/static/images/graduation.png.js +4 -0
- package/dist/static/images/mangopay.svg.js +4 -0
- package/dist/static/images/numbers/number_eight.svg.js +5 -0
- package/dist/static/images/numbers/number_five.svg.js +5 -0
- package/dist/static/images/numbers/number_four.svg.js +5 -0
- package/dist/static/images/numbers/number_nine.svg.js +5 -0
- package/dist/static/images/numbers/number_one.svg.js +5 -0
- package/dist/static/images/numbers/number_seven.svg.js +5 -0
- package/dist/static/images/numbers/number_six.svg.js +5 -0
- package/dist/static/images/numbers/number_three.svg.js +5 -0
- package/dist/static/images/numbers/number_two.svg.js +5 -0
- package/dist/static/images/numbers/number_zero.svg.js +5 -0
- package/dist/static/images/process-waiting.gif.js +4 -0
- package/dist/static/images/search-icon.svg.js +5 -0
- package/dist/static/images/social/Facebook_Logo.png.js +4 -0
- package/dist/static/images/social/LI-In-Bug.png.js +4 -0
- package/dist/static/images/social/Telegram-Logo.png.js +4 -0
- package/dist/static/images/social/X-logo-black.png.js +4 -0
- package/dist/static/images/social/youtube_social_circle_red.png.js +4 -0
- package/dist/static/images/transfer-icon.svg.js +5 -0
- package/dist/static/images/usdc-logo.svg.js +4 -0
- package/dist/static/images/usdq-logo.png.js +4 -0
- package/dist/static/images/warning-filled.svg.js +5 -0
- package/dist/styles/colors.js +57 -0
- package/dist/styles/fonts.js +100 -0
- package/dist/styles/global.js +74 -0
- package/dist/styles/grid.js +11 -0
- package/dist/styles/ioniconsStyles.js +31 -0
- package/dist/styles/reactTippy.js +40 -0
- package/dist/styles/rwd.js +56 -0
- package/dist/styles/semanticUi.js +84 -0
- package/dist/styles/spacing.js +8 -0
- package/dist/styles/theme.js +34 -0
- package/dist/utils/check-sale-time-left.js +85 -0
- package/dist/utils/check-todo-status.js +11 -0
- package/dist/utils/checklistGenerator.js +195 -0
- package/dist/utils/copyToClipboard.js +92 -0
- package/dist/utils/customHooks.js +126 -0
- package/dist/utils/delete-redirect-cookie-and-navigate.js +12 -0
- package/dist/utils/fix-decimals.js +5 -0
- package/dist/utils/formatCurrencyValue.js +95 -0
- package/dist/utils/get-cookie-domain.js +10 -0
- package/dist/utils/get-short-address.js +4 -0
- package/dist/utils/isUSInvestor.js +6 -0
- package/dist/utils/km_ify.js +33 -0
- package/dist/utils/moment.js +26 -0
- package/dist/utils/redirect-url.js +5 -0
- package/dist/utils/saveAs.js +17 -0
- package/dist/utils/scrollUtils.js +63 -0
- package/dist/utils/set-redirect-cookie.js +16 -0
- package/dist/utils/transition.js +101 -0
- package/dist/utils/withRouter.js +24 -0
- package/package.json +11 -11
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { StyledChip, ChipText } from "./Chip.styles.js";
|
|
5
|
+
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
6
|
+
const Chip = ({ children, isActive = false, onClick = () => {
|
|
7
|
+
}, tooltip = null, tooltipProps, ...props }) => {
|
|
8
|
+
return /* @__PURE__ */ jsxs(StyledChip, { onClick, isActive, ...props, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(ChipText, { children }),
|
|
10
|
+
tooltip && /* @__PURE__ */ jsx(InfoIcon, { title: tooltip, position: "top", noMarginLeft: true, noMarginRight: true, ...tooltipProps })
|
|
11
|
+
] });
|
|
12
|
+
};
|
|
13
|
+
Chip.propTypes = {
|
|
14
|
+
children: PropTypes.node.isRequired,
|
|
15
|
+
isActive: PropTypes.bool,
|
|
16
|
+
onClick: PropTypes.func,
|
|
17
|
+
tooltip: PropTypes.string
|
|
18
|
+
};
|
|
19
|
+
var stdin_default = Chip;
|
|
20
|
+
export {
|
|
21
|
+
Chip,
|
|
22
|
+
stdin_default as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import theme from "../../styles/theme.js";
|
|
3
|
+
import { Icon } from "../InfoIcon/InfoIcon.styles.js";
|
|
4
|
+
const StyledChip = styled.div.withConfig({
|
|
5
|
+
shouldForwardProp: (props) => !["isActive"].includes(props)
|
|
6
|
+
})`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
gap: 4px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 8px 16px;
|
|
11
|
+
border-radius: 20px;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
color: black;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition: background-color 0.3s;
|
|
16
|
+
font-size: 11px;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
line-height: 20px;
|
|
19
|
+
letter-spacing: 3px;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
min-height: 40px;
|
|
22
|
+
|
|
23
|
+
&:hover,
|
|
24
|
+
&:active {
|
|
25
|
+
background-color: red;
|
|
26
|
+
color: white;
|
|
27
|
+
|
|
28
|
+
${Icon} {
|
|
29
|
+
color: ${theme.cWhite};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
${({ isActive }) => isActive && `
|
|
34
|
+
background-color: red;
|
|
35
|
+
color: white;
|
|
36
|
+
font-weight: 800;
|
|
37
|
+
|
|
38
|
+
${Icon} {
|
|
39
|
+
color: ${theme.cWhite} ;
|
|
40
|
+
}
|
|
41
|
+
`}
|
|
42
|
+
`;
|
|
43
|
+
const Wrapper = styled.div.withConfig({
|
|
44
|
+
shouldForwardProp: (props) => !["customWrapperStyle"].includes(props)
|
|
45
|
+
})`
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: 32px;
|
|
48
|
+
${({ customWrapperStyle }) => customWrapperStyle}
|
|
49
|
+
`;
|
|
50
|
+
const ChipText = styled.span`
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
`;
|
|
53
|
+
styled.i.attrs({
|
|
54
|
+
className: "ion ion-md-information-circle-outline"
|
|
55
|
+
})`
|
|
56
|
+
position: relative;
|
|
57
|
+
display: inline-block;
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
line-height: 16px;
|
|
60
|
+
vertical-align: middle;
|
|
61
|
+
color: ${theme.cGrey2};
|
|
62
|
+
transition: color 0.2s;
|
|
63
|
+
|
|
64
|
+
${StyledChip}:hover & {
|
|
65
|
+
color: ${theme.cWhite};
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
export {
|
|
69
|
+
ChipText,
|
|
70
|
+
StyledChip,
|
|
71
|
+
Wrapper
|
|
72
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import stdin_default from "./Chip.js";
|
|
5
|
+
import { Wrapper } from "./Chip.styles.js";
|
|
6
|
+
import { Scroll } from "../TabsNav/TabsNav.styles.js";
|
|
7
|
+
const ChipsWrapper = ({
|
|
8
|
+
chips,
|
|
9
|
+
onActiveChipChange = () => {
|
|
10
|
+
},
|
|
11
|
+
customWrapperStyle,
|
|
12
|
+
tooltipProps,
|
|
13
|
+
scrollStyles,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const [activeChip, setActiveChip] = useState(() => {
|
|
17
|
+
const initialActiveIndex = chips.findIndex((chip) => chip.isActive);
|
|
18
|
+
return initialActiveIndex !== -1 ? initialActiveIndex : null;
|
|
19
|
+
});
|
|
20
|
+
const handleChipClick = (index) => {
|
|
21
|
+
setActiveChip(index);
|
|
22
|
+
onActiveChipChange?.(index);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(Scroll, { style: scrollStyles, children: /* @__PURE__ */ jsx(Wrapper, { customWrapperStyle, children: chips.map((chip, index) => /* @__PURE__ */ jsx(
|
|
25
|
+
stdin_default,
|
|
26
|
+
{
|
|
27
|
+
isActive: activeChip === index,
|
|
28
|
+
onClick: () => handleChipClick(index),
|
|
29
|
+
tooltip: chip.tooltip,
|
|
30
|
+
tooltipProps,
|
|
31
|
+
...props,
|
|
32
|
+
children: chip.label
|
|
33
|
+
},
|
|
34
|
+
`chip-${index.toString()}`
|
|
35
|
+
)) }) });
|
|
36
|
+
};
|
|
37
|
+
ChipsWrapper.propTypes = {
|
|
38
|
+
chips: PropTypes.arrayOf(
|
|
39
|
+
PropTypes.shape({
|
|
40
|
+
label: PropTypes.string.isRequired,
|
|
41
|
+
tooltip: PropTypes.string,
|
|
42
|
+
isActive: PropTypes.bool
|
|
43
|
+
})
|
|
44
|
+
).isRequired,
|
|
45
|
+
onActiveChipChange: PropTypes.func,
|
|
46
|
+
customWrapperStyle: PropTypes.object
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
ChipsWrapper
|
|
50
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
5
|
+
import { Container, Outer, Inner, ThumbV, TrackV, ThumbH, TrackH } from "./ComponentScroll.styles.js";
|
|
6
|
+
const ComponentScroll = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
children,
|
|
9
|
+
noMobileScroll = false,
|
|
10
|
+
autoHeight = false,
|
|
11
|
+
autoHeightMax = 0,
|
|
12
|
+
autoHeightMin = 0,
|
|
13
|
+
offset = 0,
|
|
14
|
+
barPadding = 32,
|
|
15
|
+
topPadding = 0,
|
|
16
|
+
className = "",
|
|
17
|
+
handleScroll = null,
|
|
18
|
+
fullHeight
|
|
19
|
+
} = props;
|
|
20
|
+
const scrollRef = useRef();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (scrollRef.current) {
|
|
23
|
+
handleScroll?.({}, scrollRef.current);
|
|
24
|
+
}
|
|
25
|
+
}, []);
|
|
26
|
+
const onMouseMove = () => {
|
|
27
|
+
};
|
|
28
|
+
const handleScrollFrame = (values) => {
|
|
29
|
+
if (values) {
|
|
30
|
+
handleScroll?.(values, scrollRef.current);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ jsx(Container, { className, noMobileScroll, isMobile: true, fullHeight, children: /* @__PURE__ */ jsx(Outer, { offset, barPadding, topPadding, children: /* @__PURE__ */ jsx(
|
|
34
|
+
Scrollbars,
|
|
35
|
+
{
|
|
36
|
+
ref: scrollRef,
|
|
37
|
+
style: { height: "100%" },
|
|
38
|
+
renderTrackHorizontal: (_props) => /* @__PURE__ */ jsx(TrackH, { ..._props }),
|
|
39
|
+
renderThumbHorizontal: (_props) => /* @__PURE__ */ jsx(ThumbH, { ..._props }),
|
|
40
|
+
renderTrackVertical: (_props) => /* @__PURE__ */ jsx(TrackV, { ..._props }),
|
|
41
|
+
renderThumbVertical: (_props) => /* @__PURE__ */ jsx(ThumbV, { ..._props }),
|
|
42
|
+
hideTracksWhenNotNeeded: true,
|
|
43
|
+
onMouseMove,
|
|
44
|
+
onScrollFrame: handleScrollFrame,
|
|
45
|
+
autoHeight,
|
|
46
|
+
autoHeightMax,
|
|
47
|
+
autoHeightMin,
|
|
48
|
+
universal: true,
|
|
49
|
+
autoHide: true,
|
|
50
|
+
children: /* @__PURE__ */ jsx(Inner, { offset, children })
|
|
51
|
+
}
|
|
52
|
+
) }) });
|
|
53
|
+
};
|
|
54
|
+
ComponentScroll.propTypes = {
|
|
55
|
+
children: PropTypes.node.isRequired,
|
|
56
|
+
className: PropTypes.string,
|
|
57
|
+
noMobileScroll: PropTypes.bool,
|
|
58
|
+
autoHeight: PropTypes.bool,
|
|
59
|
+
autoHeightMax: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
60
|
+
autoHeightMin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
61
|
+
barPadding: PropTypes.number,
|
|
62
|
+
topPadding: PropTypes.number,
|
|
63
|
+
offset: PropTypes.number,
|
|
64
|
+
handleScroll: PropTypes.func
|
|
65
|
+
};
|
|
66
|
+
var stdin_default = ComponentScroll;
|
|
67
|
+
export {
|
|
68
|
+
ComponentScroll,
|
|
69
|
+
stdin_default as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import rwd from "../../styles/rwd.js";
|
|
3
|
+
import theme from "../../styles/theme.js";
|
|
4
|
+
const Container = styled.div.withConfig({
|
|
5
|
+
shouldForwardProp: (props) => !["fullHeight", "noMobileScroll", "isMobile"].includes(props)
|
|
6
|
+
})`
|
|
7
|
+
position: relative;
|
|
8
|
+
height: 364px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
|
|
12
|
+
@media screen and (max-width: 767px) {
|
|
13
|
+
height: ${({ isMobile }) => isMobile ? "100%" : "364px"};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
${(props) => props.fullHeight && css`
|
|
17
|
+
height: 100%;
|
|
18
|
+
`}
|
|
19
|
+
|
|
20
|
+
${(props) => props.noMobileScroll && css`
|
|
21
|
+
& > div > div {
|
|
22
|
+
overflow: visible !important;
|
|
23
|
+
|
|
24
|
+
> div:first-child {
|
|
25
|
+
overflow: visible !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
${rwd.Medium`
|
|
30
|
+
& > div > div {
|
|
31
|
+
overflow: hidden !important;
|
|
32
|
+
|
|
33
|
+
> div:first-child {
|
|
34
|
+
overflow: scroll !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`}
|
|
38
|
+
`}
|
|
39
|
+
`;
|
|
40
|
+
const TrackH = styled.div`
|
|
41
|
+
background-color: ${() => theme.cGrey};
|
|
42
|
+
left: 16px;
|
|
43
|
+
right: 16px;
|
|
44
|
+
bottom: 14px;
|
|
45
|
+
height: 4px;
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
|
|
48
|
+
${rwd.Large`
|
|
49
|
+
left: 32px;
|
|
50
|
+
right: 32px;
|
|
51
|
+
bottom: 30px;
|
|
52
|
+
`}
|
|
53
|
+
`;
|
|
54
|
+
const ThumbH = styled.div`
|
|
55
|
+
background-color: ${() => theme.cWarning};
|
|
56
|
+
height: 4px;
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
`;
|
|
59
|
+
const TrackV = styled.div`
|
|
60
|
+
background-color: ${() => theme.cGrey};
|
|
61
|
+
top: 16px;
|
|
62
|
+
bottom: 16px;
|
|
63
|
+
right: 14px;
|
|
64
|
+
width: 4px;
|
|
65
|
+
border-radius: 4px;
|
|
66
|
+
|
|
67
|
+
${rwd.Large`
|
|
68
|
+
top: 32px;
|
|
69
|
+
bottom: 32px;
|
|
70
|
+
right: 30px;
|
|
71
|
+
`}
|
|
72
|
+
`;
|
|
73
|
+
const ThumbV = styled.div`
|
|
74
|
+
background-color: ${() => theme.cWarning};
|
|
75
|
+
width: 4px;
|
|
76
|
+
border-radius: 4px;
|
|
77
|
+
`;
|
|
78
|
+
const Outer = styled.div.withConfig({
|
|
79
|
+
shouldForwardProp: (props) => !["offset", "barPadding", "topPadding"].includes(props)
|
|
80
|
+
})`
|
|
81
|
+
position: relative;
|
|
82
|
+
flex-grow: 1;
|
|
83
|
+
max-height: 100%;
|
|
84
|
+
max-width: 100%;
|
|
85
|
+
|
|
86
|
+
${(props) => props.barPadding > -1 && props.offset && `
|
|
87
|
+
margin-right: ${props.offset}px;
|
|
88
|
+
margin-bottom: ${props.offset}px;
|
|
89
|
+
|
|
90
|
+
${TrackH} {
|
|
91
|
+
left: ${props.barPadding}px;
|
|
92
|
+
right: ${props.barPadding - props.offset}px;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
${TrackV} {
|
|
97
|
+
top: ${props.barPadding}px;
|
|
98
|
+
bottom: ${props.barPadding - props.offset}px;
|
|
99
|
+
right: 0;
|
|
100
|
+
}
|
|
101
|
+
`}
|
|
102
|
+
|
|
103
|
+
${(props) => props.topPadding !== 0 && `
|
|
104
|
+
${TrackV} {
|
|
105
|
+
top: ${props.topPadding}px;
|
|
106
|
+
}
|
|
107
|
+
`}
|
|
108
|
+
`;
|
|
109
|
+
const Inner = styled.div.withConfig({
|
|
110
|
+
shouldForwardProp: (props) => !["offset"].includes(props)
|
|
111
|
+
})`
|
|
112
|
+
position: relative;
|
|
113
|
+
|
|
114
|
+
${(props) => props.offset && `
|
|
115
|
+
padding-right: ${-props.offset}px;
|
|
116
|
+
padding-bottom: ${-props.offset}px;
|
|
117
|
+
`}
|
|
118
|
+
`;
|
|
119
|
+
export {
|
|
120
|
+
Container,
|
|
121
|
+
Inner,
|
|
122
|
+
Outer,
|
|
123
|
+
ThumbH,
|
|
124
|
+
ThumbV,
|
|
125
|
+
TrackH,
|
|
126
|
+
TrackV
|
|
127
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import rwd from "../../styles/rwd.js";
|
|
3
|
+
import theme from "../../styles/theme.js";
|
|
4
|
+
const ComponentWrapper = styled.div.withConfig({
|
|
5
|
+
shouldForwardProp: (props) => ![
|
|
6
|
+
"borderLeft",
|
|
7
|
+
"borderRight",
|
|
8
|
+
"borderTop",
|
|
9
|
+
"borderBottom",
|
|
10
|
+
"noPaddingLeft",
|
|
11
|
+
"noPaddingRight",
|
|
12
|
+
"noPaddingBottom",
|
|
13
|
+
"noPaddingTop",
|
|
14
|
+
"noPaddingVertical",
|
|
15
|
+
"horizontalPaddingHalf",
|
|
16
|
+
"noPaddingHorizontal",
|
|
17
|
+
"paddingVeticalHalf",
|
|
18
|
+
"noPadding",
|
|
19
|
+
"center",
|
|
20
|
+
"grow",
|
|
21
|
+
"wrap",
|
|
22
|
+
"background",
|
|
23
|
+
"fluid",
|
|
24
|
+
"fluidcenter",
|
|
25
|
+
"titleHalf",
|
|
26
|
+
"investmentNotifications",
|
|
27
|
+
"alignVertically",
|
|
28
|
+
"marginTop",
|
|
29
|
+
"isAddMember",
|
|
30
|
+
"flex"
|
|
31
|
+
].includes(props)
|
|
32
|
+
})`
|
|
33
|
+
position: relative;
|
|
34
|
+
padding: 32px;
|
|
35
|
+
// text-align left only from ID
|
|
36
|
+
text-align: left !important;
|
|
37
|
+
|
|
38
|
+
${rwd.Large`
|
|
39
|
+
padding: 32px 64px;
|
|
40
|
+
`}
|
|
41
|
+
|
|
42
|
+
${(props) => props.borderLeft && css`
|
|
43
|
+
border-left: 1px solid ${theme.cLightGrey};
|
|
44
|
+
`}
|
|
45
|
+
|
|
46
|
+
${(props) => props.borderRight && css`
|
|
47
|
+
border-right: 1px solid ${theme.cLightGrey};
|
|
48
|
+
`}
|
|
49
|
+
|
|
50
|
+
${(props) => props.borderTop && css`
|
|
51
|
+
border-top: 1px solid ${theme.cLightGrey};
|
|
52
|
+
`}
|
|
53
|
+
|
|
54
|
+
${(props) => props.borderBottom && css`
|
|
55
|
+
border-bottom: 1px solid ${theme.cLightGrey};
|
|
56
|
+
`}
|
|
57
|
+
|
|
58
|
+
${(props) => props.noPaddingLeft && css`
|
|
59
|
+
padding-left: 0 !important;
|
|
60
|
+
`}
|
|
61
|
+
|
|
62
|
+
${(props) => props.noPaddingRight && css`
|
|
63
|
+
padding-right: 0 !important;
|
|
64
|
+
`}
|
|
65
|
+
|
|
66
|
+
${(props) => props.noPaddingTop && css`
|
|
67
|
+
padding-top: 0 !important;
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${(props) => props.noPaddingBottom && css`
|
|
71
|
+
padding-bottom: 0 !important;
|
|
72
|
+
`}
|
|
73
|
+
|
|
74
|
+
${(props) => props.noPaddingVertical && css`
|
|
75
|
+
padding-top: 0 !important;
|
|
76
|
+
padding-bottom: 0 !important;
|
|
77
|
+
`}
|
|
78
|
+
|
|
79
|
+
${(props) => props.horizontalPaddingHalf && css`
|
|
80
|
+
padding-left: 18px !important;
|
|
81
|
+
padding-right: 18px !important;
|
|
82
|
+
`}
|
|
83
|
+
|
|
84
|
+
${(props) => props.noPaddingHorizontal && css`
|
|
85
|
+
padding-left: 0 !important;
|
|
86
|
+
padding-right: 0 !important;
|
|
87
|
+
`}
|
|
88
|
+
|
|
89
|
+
${(props) => props.paddingVeticalHalf && css`
|
|
90
|
+
padding-top: 16px !important;
|
|
91
|
+
padding-bottom: 16px !important;
|
|
92
|
+
`}
|
|
93
|
+
|
|
94
|
+
${(props) => props.noPadding && css`
|
|
95
|
+
padding: 0 !important;
|
|
96
|
+
`}
|
|
97
|
+
|
|
98
|
+
${(props) => props.center && css`
|
|
99
|
+
text-align: center !important;
|
|
100
|
+
`}
|
|
101
|
+
|
|
102
|
+
${(props) => props.grow && css`
|
|
103
|
+
flex-grow: 1;
|
|
104
|
+
`}
|
|
105
|
+
|
|
106
|
+
${(props) => props.wrap && css`
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
`}
|
|
109
|
+
|
|
110
|
+
${(props) => props.background && css`
|
|
111
|
+
background-color: ${theme.cGrey};
|
|
112
|
+
`}
|
|
113
|
+
|
|
114
|
+
${(props) => props.fluid && css`
|
|
115
|
+
width: 100%;
|
|
116
|
+
`}
|
|
117
|
+
|
|
118
|
+
${(props) => props.fluidcenter && css`
|
|
119
|
+
width: 100% !important;
|
|
120
|
+
text-align: center !important;
|
|
121
|
+
`}
|
|
122
|
+
|
|
123
|
+
${(props) => props.titleHalf && css`
|
|
124
|
+
h4 {
|
|
125
|
+
width: 50%;
|
|
126
|
+
|
|
127
|
+
@media screen and (max-width: 767px) {
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`}
|
|
132
|
+
|
|
133
|
+
@media screen and (max-width: 767px) {
|
|
134
|
+
padding: 32px;
|
|
135
|
+
|
|
136
|
+
${(props) => props.investmentNotifications && css`
|
|
137
|
+
padding: 0;
|
|
138
|
+
`}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
${(props) => props.alignVertically && css`
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
`}
|
|
145
|
+
|
|
146
|
+
${(props) => props.marginTop && css`
|
|
147
|
+
margin-top: ${props.marginTop};
|
|
148
|
+
`}
|
|
149
|
+
|
|
150
|
+
${(props) => props.isAddMember && css`
|
|
151
|
+
@media screen and (min-width: 768px) {
|
|
152
|
+
padding-left: 10px !important;
|
|
153
|
+
padding-right: 10px !important;
|
|
154
|
+
}
|
|
155
|
+
`}
|
|
156
|
+
|
|
157
|
+
${(props) => props.flex && `
|
|
158
|
+
display:flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
`}
|
|
161
|
+
`;
|
|
162
|
+
export {
|
|
163
|
+
ComponentWrapper,
|
|
164
|
+
ComponentWrapper as default
|
|
165
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "../Text/Text.styles.js";
|
|
3
|
+
import { createRoot } from "react-dom/client";
|
|
4
|
+
import { Button } from "../Button/Button.styles.js";
|
|
5
|
+
import { Modal } from "../Modal/Modal.js";
|
|
6
|
+
import { ContainerWithLine, RedBar } from "./ConfirmModal.styles.js";
|
|
7
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
8
|
+
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
9
|
+
import { ModalInner } from "../Modal/Modal.styles.js";
|
|
10
|
+
let confirmContainer = null;
|
|
11
|
+
let confirmRoot = null;
|
|
12
|
+
const ConfirmModalComponent = ({
|
|
13
|
+
isOpen,
|
|
14
|
+
onClose,
|
|
15
|
+
onConfirm,
|
|
16
|
+
onCancel,
|
|
17
|
+
title,
|
|
18
|
+
message,
|
|
19
|
+
content,
|
|
20
|
+
confirmText,
|
|
21
|
+
cancelText,
|
|
22
|
+
showCancel,
|
|
23
|
+
showRedBar,
|
|
24
|
+
lineColor,
|
|
25
|
+
barColor,
|
|
26
|
+
renderFooter,
|
|
27
|
+
modalProps,
|
|
28
|
+
buttonProps,
|
|
29
|
+
cancelButtonProps,
|
|
30
|
+
barStyle,
|
|
31
|
+
maxWidth,
|
|
32
|
+
modalStyles,
|
|
33
|
+
innerModalStyles
|
|
34
|
+
}) => {
|
|
35
|
+
const [titleHeight, setTitleHeight] = useState(0);
|
|
36
|
+
const observerRef = useRef(null);
|
|
37
|
+
const titleRef = useCallback((node) => {
|
|
38
|
+
if (observerRef.current) {
|
|
39
|
+
observerRef.current.disconnect();
|
|
40
|
+
observerRef.current = null;
|
|
41
|
+
}
|
|
42
|
+
if (node) {
|
|
43
|
+
setTitleHeight(node.offsetHeight);
|
|
44
|
+
observerRef.current = new ResizeObserver(() => {
|
|
45
|
+
setTitleHeight(node.offsetHeight);
|
|
46
|
+
});
|
|
47
|
+
observerRef.current.observe(node);
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
const handleConfirm = useCallback(
|
|
51
|
+
(value = true) => {
|
|
52
|
+
onConfirm?.(value);
|
|
53
|
+
},
|
|
54
|
+
[onConfirm]
|
|
55
|
+
);
|
|
56
|
+
const handleCancel = useCallback(() => {
|
|
57
|
+
onCancel?.();
|
|
58
|
+
onClose?.();
|
|
59
|
+
}, [onCancel, onClose]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!isOpen) return;
|
|
62
|
+
const handleKeyDown = (e) => {
|
|
63
|
+
if (e.key === "Escape") {
|
|
64
|
+
handleCancel();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
68
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
69
|
+
}, [isOpen, handleCancel]);
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
Modal,
|
|
72
|
+
{
|
|
73
|
+
isOpen,
|
|
74
|
+
onClose: handleCancel,
|
|
75
|
+
maxHeight: "90vh",
|
|
76
|
+
boxStyles: { minHeight: "unset", ...modalStyles || {} },
|
|
77
|
+
maxWidth,
|
|
78
|
+
...modalProps,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(ModalInner, { style: innerModalStyles, children: /* @__PURE__ */ jsxs(ContainerWithLine, { height: titleHeight, lineColor, children: [
|
|
81
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
83
|
+
title && /* @__PURE__ */ jsx("h3", { ref: titleRef, style: { margin: 0 }, children: title }),
|
|
84
|
+
message && /* @__PURE__ */ jsx("p", { children: message })
|
|
85
|
+
] }),
|
|
86
|
+
content && /* @__PURE__ */ jsx("div", { style: { marginTop: "16px" }, children: content })
|
|
87
|
+
] }),
|
|
88
|
+
renderFooter ? /* @__PURE__ */ jsx(Fragment, { children: renderFooter({
|
|
89
|
+
onConfirm: handleConfirm,
|
|
90
|
+
onCancel: handleCancel
|
|
91
|
+
}) }) : /* @__PURE__ */ jsxs(ComponentWrapper, { noPaddingHorizontal: true, flex: true, style: { gap: 16 }, children: [
|
|
92
|
+
showCancel && /* @__PURE__ */ jsx(Button, { outlineBlack: true, minWidth: "120px", onClick: handleCancel, ...cancelButtonProps, children: cancelText }),
|
|
93
|
+
/* @__PURE__ */ jsx(Button, { minWidth: "120px", onClick: () => handleConfirm(true), ...buttonProps, children: confirmText })
|
|
94
|
+
] }),
|
|
95
|
+
message && /* @__PURE__ */ jsx("p", { children: message }),
|
|
96
|
+
content && /* @__PURE__ */ jsx("div", { style: { marginTop: "16px" }, children: content }),
|
|
97
|
+
renderFooter ? /* @__PURE__ */ jsx(ComponentWrapper, { children: renderFooter({
|
|
98
|
+
onConfirm: handleConfirm,
|
|
99
|
+
onCancel: handleCancel
|
|
100
|
+
}) }) : /* @__PURE__ */ jsxs(ComponentWrapper, { noPaddingHorizontal: true, flex: true, style: { gap: 16 }, children: [
|
|
101
|
+
showCancel && /* @__PURE__ */ jsx(Button, { outlineBlack: true, minWidth: "120px", onClick: handleCancel, ...cancelButtonProps, children: cancelText }),
|
|
102
|
+
/* @__PURE__ */ jsx(Button, { minWidth: "120px", onClick: () => handleConfirm(true), ...buttonProps, children: confirmText })
|
|
103
|
+
] })
|
|
104
|
+
] }) }),
|
|
105
|
+
showRedBar && /* @__PURE__ */ jsx(RedBar, { barColor, style: barStyle })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
const confirm = (options = {}) => {
|
|
111
|
+
const {
|
|
112
|
+
title = "Confirm",
|
|
113
|
+
message = "",
|
|
114
|
+
content = null,
|
|
115
|
+
confirmText = "Confirm",
|
|
116
|
+
cancelText = "Cancel",
|
|
117
|
+
showCancel = true,
|
|
118
|
+
showRedBar = true,
|
|
119
|
+
lineColor,
|
|
120
|
+
barColor,
|
|
121
|
+
renderFooter = null,
|
|
122
|
+
modalProps = {},
|
|
123
|
+
buttonProps = {},
|
|
124
|
+
cancelButtonProps = {},
|
|
125
|
+
modalStyles,
|
|
126
|
+
innerModalStyles
|
|
127
|
+
} = options;
|
|
128
|
+
return new Promise((resolve) => {
|
|
129
|
+
if (!confirmContainer) {
|
|
130
|
+
confirmContainer = document.createElement("div");
|
|
131
|
+
confirmContainer.id = "confirm-modal-root";
|
|
132
|
+
document.body.appendChild(confirmContainer);
|
|
133
|
+
confirmRoot = createRoot(confirmContainer);
|
|
134
|
+
}
|
|
135
|
+
let isResolved = false;
|
|
136
|
+
const handleConfirm = (value) => {
|
|
137
|
+
if (!isResolved) {
|
|
138
|
+
isResolved = true;
|
|
139
|
+
resolve(value);
|
|
140
|
+
renderModal(false);
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
renderModal(null);
|
|
143
|
+
}, 350);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const handleCancel = () => {
|
|
147
|
+
if (!isResolved) {
|
|
148
|
+
isResolved = true;
|
|
149
|
+
resolve(false);
|
|
150
|
+
renderModal(false);
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
renderModal(null);
|
|
153
|
+
}, 350);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const handleClose = () => {
|
|
157
|
+
if (!isResolved) {
|
|
158
|
+
handleCancel();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const renderModal = (isOpen) => {
|
|
162
|
+
if (isOpen === null) {
|
|
163
|
+
confirmRoot.render(null);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
confirmRoot.render(
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
ConfirmModalComponent,
|
|
169
|
+
{
|
|
170
|
+
isOpen,
|
|
171
|
+
onClose: handleClose,
|
|
172
|
+
onConfirm: handleConfirm,
|
|
173
|
+
onCancel: handleCancel,
|
|
174
|
+
title,
|
|
175
|
+
message,
|
|
176
|
+
content,
|
|
177
|
+
confirmText,
|
|
178
|
+
cancelText,
|
|
179
|
+
showCancel,
|
|
180
|
+
showRedBar,
|
|
181
|
+
lineColor,
|
|
182
|
+
barColor,
|
|
183
|
+
renderFooter,
|
|
184
|
+
modalProps,
|
|
185
|
+
buttonProps,
|
|
186
|
+
cancelButtonProps,
|
|
187
|
+
modalStyles,
|
|
188
|
+
innerModalStyles
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
renderModal(true);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
export {
|
|
197
|
+
ConfirmModalComponent as ConfirmModal,
|
|
198
|
+
confirm
|
|
199
|
+
};
|