@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,92 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { colors } from "../../styles/colors.js";
|
|
3
|
+
const SearchInputContainer = styled.div`
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
`;
|
|
7
|
+
const SearchInputWrapper = styled.div.withConfig({
|
|
8
|
+
shouldForwardProp: (props) => !["variant", "disabled"].includes(props)
|
|
9
|
+
})`
|
|
10
|
+
position: relative;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
padding: 0 16px;
|
|
16
|
+
min-height: 40px;
|
|
17
|
+
transition: all 0.2s ease;
|
|
18
|
+
|
|
19
|
+
/* Default filled variant */
|
|
20
|
+
background-color: ${(props) => props.variant === "outlined" ? "transparent" : colors.grey3};
|
|
21
|
+
border: ${(props) => props.variant === "outlined" ? `1px solid ${colors.lightGrey}` : "1px solid transparent"};
|
|
22
|
+
|
|
23
|
+
${(props) => props.disabled && `
|
|
24
|
+
opacity: 0.6;
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
`}
|
|
27
|
+
|
|
28
|
+
&:focus-within {
|
|
29
|
+
background-color: ${(props) => props.variant === "outlined" ? "transparent" : colors.white};
|
|
30
|
+
border-color: ${(props) => props.variant === "outlined" ? colors.grey2 : "transparent"};
|
|
31
|
+
box-shadow: ${(props) => props.variant === "outlined" ? "none" : `0 0 0 2px ${colors.lightGrey}`};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
border-color: ${(props) => props.variant === "outlined" ? colors.grey2 : "transparent"};
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const SearchIconWrapper = styled.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
margin-right: 12px;
|
|
43
|
+
color: ${colors.grey2};
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
width: 16px;
|
|
46
|
+
height: 16px;
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${SearchInputWrapper}:focus-within & {
|
|
54
|
+
color: ${colors.black};
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const SearchInputField = styled.input`
|
|
58
|
+
flex: 1;
|
|
59
|
+
border: none;
|
|
60
|
+
outline: none;
|
|
61
|
+
background: transparent;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
line-height: 18px;
|
|
65
|
+
color: ${colors.black};
|
|
66
|
+
width: 100%;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
letter-spacing: 0.6px;
|
|
69
|
+
|
|
70
|
+
&::placeholder {
|
|
71
|
+
color: ${colors.grey2};
|
|
72
|
+
opacity: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:disabled {
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
opacity: 0.6;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&::-webkit-search-decoration,
|
|
81
|
+
&::-webkit-search-cancel-button,
|
|
82
|
+
&::-webkit-search-results-button,
|
|
83
|
+
&::-webkit-search-results-decoration {
|
|
84
|
+
-webkit-appearance: none;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
export {
|
|
88
|
+
SearchIconWrapper,
|
|
89
|
+
SearchInputContainer,
|
|
90
|
+
SearchInputField,
|
|
91
|
+
SearchInputWrapper
|
|
92
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import ReactSelect, { components } from "react-select";
|
|
5
|
+
import CreatableSelect from "react-select/creatable";
|
|
6
|
+
import { Wrapper, Label } from "./Input.styles.js";
|
|
7
|
+
import { IoniconsStyles } from "../../styles/ioniconsStyles.js";
|
|
8
|
+
import { SelectContainer, SelectOption, SelectMenu, SelectControl, SelectMenuList, SelectIcon } from "./Select.styles.js";
|
|
9
|
+
import { SelectValueContainer, SelectWrapper } from "./Select.styles.js";
|
|
10
|
+
const DropdownIndicator = (props) => {
|
|
11
|
+
const { selectProps } = props;
|
|
12
|
+
return /* @__PURE__ */ jsx(components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsx(SelectIcon, { isMenuOpen: selectProps.menuIsOpen }) });
|
|
13
|
+
};
|
|
14
|
+
DropdownIndicator.propTypes = {
|
|
15
|
+
selectProps: PropTypes.instanceOf(Object).isRequired
|
|
16
|
+
};
|
|
17
|
+
const SelectMenuListWithScroll = (props) => {
|
|
18
|
+
const { children, selectProps } = props;
|
|
19
|
+
const { maxMenuHeight = 300 } = selectProps;
|
|
20
|
+
return /* @__PURE__ */ jsx(SelectMenuList, { autoHeight: true, autoHeightMax: maxMenuHeight, fullHeight: true, children });
|
|
21
|
+
};
|
|
22
|
+
SelectMenuListWithScroll.propTypes = {
|
|
23
|
+
children: PropTypes.node.isRequired
|
|
24
|
+
};
|
|
25
|
+
const Select = (props) => {
|
|
26
|
+
const {
|
|
27
|
+
id,
|
|
28
|
+
name,
|
|
29
|
+
label = "",
|
|
30
|
+
options,
|
|
31
|
+
search = false,
|
|
32
|
+
error = false,
|
|
33
|
+
touched = false,
|
|
34
|
+
value = "",
|
|
35
|
+
disabled,
|
|
36
|
+
menuHeight,
|
|
37
|
+
creatable = false,
|
|
38
|
+
formatCreateLabel = null,
|
|
39
|
+
...otherProps
|
|
40
|
+
} = props;
|
|
41
|
+
const [labelUp, setLabelUp] = useState(!!value);
|
|
42
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setLabelUp(hasFocus || !!value);
|
|
45
|
+
}, [hasFocus, value]);
|
|
46
|
+
const onFocus = (_e) => {
|
|
47
|
+
props.onFocus?.({ name, value });
|
|
48
|
+
if (search || creatable) {
|
|
49
|
+
setHasFocus(true);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const onBlur = (_e) => {
|
|
53
|
+
props.onBlur?.({ name, value });
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
setHasFocus(false);
|
|
56
|
+
}, 1);
|
|
57
|
+
};
|
|
58
|
+
const onChange = (selectedOption) => {
|
|
59
|
+
props.onChange?.({
|
|
60
|
+
name,
|
|
61
|
+
value: selectedOption.value
|
|
62
|
+
});
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
setHasFocus(true);
|
|
65
|
+
}, 1);
|
|
66
|
+
};
|
|
67
|
+
const SelectComponent = creatable ? CreatableSelect : ReactSelect;
|
|
68
|
+
const selectStyles = {
|
|
69
|
+
control: () => SelectControl,
|
|
70
|
+
menu: (baseStyle) => ({
|
|
71
|
+
...baseStyle,
|
|
72
|
+
marginTop: 0,
|
|
73
|
+
zIndex: 1e3,
|
|
74
|
+
SelectMenu
|
|
75
|
+
}),
|
|
76
|
+
option: (baseStyle, state) => ({
|
|
77
|
+
fontWeight: state.isSelected || state.isFocused ? "bold" : "normal",
|
|
78
|
+
cursor: "pointer",
|
|
79
|
+
...SelectOption
|
|
80
|
+
}),
|
|
81
|
+
selectContainer: () => SelectContainer,
|
|
82
|
+
valueContainer: (baseStyle) => ({
|
|
83
|
+
...baseStyle,
|
|
84
|
+
padding: 0
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
const selectComponents = {
|
|
88
|
+
DropdownIndicator,
|
|
89
|
+
IndicatorSeparator: null,
|
|
90
|
+
MenuList: SelectMenuListWithScroll
|
|
91
|
+
};
|
|
92
|
+
const currentValue = creatable ? options?.find((option) => option.value === value) || (value ? { value, label: value } : null) : options?.find((option) => option.value === value);
|
|
93
|
+
return /* @__PURE__ */ jsxs(Wrapper, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx(IoniconsStyles, {}),
|
|
95
|
+
label && /* @__PURE__ */ jsx(Label, { isUp: labelUp, active: hasFocus, error: error && touched, htmlFor: id, children: label }),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
SelectComponent,
|
|
98
|
+
{
|
|
99
|
+
...otherProps,
|
|
100
|
+
id,
|
|
101
|
+
name,
|
|
102
|
+
options,
|
|
103
|
+
isDisabled: disabled,
|
|
104
|
+
onChange,
|
|
105
|
+
onBlur,
|
|
106
|
+
onFocus,
|
|
107
|
+
value: currentValue,
|
|
108
|
+
placeholder: "",
|
|
109
|
+
isSearchable: creatable || search,
|
|
110
|
+
maxMenuHeight: menuHeight,
|
|
111
|
+
styles: selectStyles,
|
|
112
|
+
components: selectComponents,
|
|
113
|
+
...creatable && {
|
|
114
|
+
formatCreateLabel: formatCreateLabel || ((inputValue) => `Create "${inputValue}"`)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
};
|
|
120
|
+
Select.propTypes = {
|
|
121
|
+
id: PropTypes.string.isRequired,
|
|
122
|
+
name: PropTypes.string.isRequired,
|
|
123
|
+
label: PropTypes.string,
|
|
124
|
+
error: PropTypes.bool,
|
|
125
|
+
touched: PropTypes.bool,
|
|
126
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
127
|
+
options: PropTypes.arrayOf(
|
|
128
|
+
PropTypes.shape({
|
|
129
|
+
key: PropTypes.string.isRequired,
|
|
130
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
131
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
|
|
132
|
+
})
|
|
133
|
+
).isRequired,
|
|
134
|
+
search: PropTypes.bool,
|
|
135
|
+
creatable: PropTypes.bool,
|
|
136
|
+
formatCreateLabel: PropTypes.func,
|
|
137
|
+
onChange: PropTypes.func,
|
|
138
|
+
onBlur: PropTypes.func,
|
|
139
|
+
onFocus: PropTypes.func
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
Select,
|
|
143
|
+
SelectContainer,
|
|
144
|
+
SelectControl,
|
|
145
|
+
SelectIcon,
|
|
146
|
+
SelectMenu,
|
|
147
|
+
SelectMenuList,
|
|
148
|
+
SelectOption,
|
|
149
|
+
SelectValueContainer,
|
|
150
|
+
SelectWrapper
|
|
151
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { TrackV } from "../ComponentScroll/ComponentScroll.styles.js";
|
|
3
|
+
import stdin_default from "../ComponentScroll/ComponentScroll.js";
|
|
4
|
+
const SelectControl = css`
|
|
5
|
+
&&& {
|
|
6
|
+
z-index: 10 !important;
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 40px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 18px;
|
|
15
|
+
padding: 15px 0;
|
|
16
|
+
padding-bottom: 5px;
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
box-shadow: none;
|
|
19
|
+
border: 0;
|
|
20
|
+
border-top: 1px solid transparent;
|
|
21
|
+
border-bottom: 1px solid #e1e1e1;
|
|
22
|
+
color: #202020;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
transition: border-color 0.2s;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
border-top-color: transparent;
|
|
30
|
+
border-bottom-color: #0050ca;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.active {
|
|
34
|
+
z-index: 12 !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const SelectMenu = css`
|
|
39
|
+
margin-top: -1px;
|
|
40
|
+
border-radius: 0;
|
|
41
|
+
box-shadow: none;
|
|
42
|
+
border: 0;
|
|
43
|
+
border-top: 1px solid #e1e1e1 !important;
|
|
44
|
+
border-bottom: 1px solid #e1e1e1 !important;
|
|
45
|
+
background-color: #ffffff;
|
|
46
|
+
opacity: 999 !important;
|
|
47
|
+
`;
|
|
48
|
+
const SelectMenuList = styled(stdin_default)`
|
|
49
|
+
&&& {
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
|
|
52
|
+
${TrackV} {
|
|
53
|
+
right: 6px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const SelectOption = css`
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
padding: 8px 0 !important;
|
|
60
|
+
padding-left: 4px !important;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
line-height: 18px;
|
|
63
|
+
border: 0;
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
color: #202020;
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
const SelectContainer = css`
|
|
73
|
+
z-index: 100;
|
|
74
|
+
${(props) => props.selectProps.menuIsOpen && `
|
|
75
|
+
z-index: 150 !important;
|
|
76
|
+
`}
|
|
77
|
+
`;
|
|
78
|
+
const SelectValueContainer = css`
|
|
79
|
+
&&& {
|
|
80
|
+
padding-left: 0;
|
|
81
|
+
margin-left: -2px;
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
const SelectIcon = styled.i.withConfig({
|
|
85
|
+
shouldForwardProp: (props) => !["isMenuOpen"].includes(props)
|
|
86
|
+
}).attrs({
|
|
87
|
+
className: "ion ion-ios-arrow-down"
|
|
88
|
+
})`
|
|
89
|
+
&&& {
|
|
90
|
+
transition: 0.3s transform;
|
|
91
|
+
transform: rotate(0);
|
|
92
|
+
color: #202020;
|
|
93
|
+
|
|
94
|
+
${(props) => props.isMenuOpen && `
|
|
95
|
+
transform: rotate(180deg);
|
|
96
|
+
`}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
const SelectWrapper = styled.div.withConfig({
|
|
100
|
+
shouldForwardProp: (props) => !["minWidth", "noMargin"].includes(props)
|
|
101
|
+
})`
|
|
102
|
+
display: inline-block;
|
|
103
|
+
vertical-align: middle;
|
|
104
|
+
margin-left: 24px;
|
|
105
|
+
|
|
106
|
+
${(props) => props.minWidth && `
|
|
107
|
+
min-width: ${props.minWidth};
|
|
108
|
+
`}
|
|
109
|
+
|
|
110
|
+
${(props) => props.noMargin && `
|
|
111
|
+
margin-left: 0;
|
|
112
|
+
`}
|
|
113
|
+
|
|
114
|
+
&&& ${SelectControl} {
|
|
115
|
+
height: 24px;
|
|
116
|
+
font-weight: normal;
|
|
117
|
+
font-size: 11px;
|
|
118
|
+
line-height: 18px;
|
|
119
|
+
padding: 3px 0;
|
|
120
|
+
border-top: 1px solid transparent;
|
|
121
|
+
border-bottom: 1px solid transparent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&&& ${SelectMenu} {
|
|
125
|
+
left: 0;
|
|
126
|
+
right: 0;
|
|
127
|
+
width: auto;
|
|
128
|
+
margin: -6px -12px;
|
|
129
|
+
margin-top: 0;
|
|
130
|
+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
|
|
131
|
+
border: 0;
|
|
132
|
+
padding: 6px 12px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&&& ${SelectValueContainer} {
|
|
136
|
+
top: 0;
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
export {
|
|
140
|
+
SelectContainer,
|
|
141
|
+
SelectControl,
|
|
142
|
+
SelectIcon,
|
|
143
|
+
SelectMenu,
|
|
144
|
+
SelectMenuList,
|
|
145
|
+
SelectOption,
|
|
146
|
+
SelectValueContainer,
|
|
147
|
+
SelectWrapper
|
|
148
|
+
};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import styled from "styled-components";
|
|
6
|
+
import { colors } from "../../styles/colors.js";
|
|
7
|
+
import SvgCheckIcon from "../../static/images/check-icon.svg.js";
|
|
8
|
+
import SvgFilterIcon from "../../static/images/filter-icon.svg.js";
|
|
9
|
+
import { CheckboxWrapperDiv, CheckboxDiv, OptionLabel } from "./MultiSelect.js";
|
|
10
|
+
const TriggerContainer = styled.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
user-select: none;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
`;
|
|
19
|
+
const IconWrapper = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
width: 16px;
|
|
24
|
+
height: 16px;
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
svg {
|
|
28
|
+
width: 14px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
svg path,
|
|
33
|
+
svg line,
|
|
34
|
+
svg circle,
|
|
35
|
+
svg rect {
|
|
36
|
+
stroke: currentColor;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const ActiveDot = styled.div`
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: -2px;
|
|
42
|
+
right: -2px;
|
|
43
|
+
width: 6px;
|
|
44
|
+
height: 6px;
|
|
45
|
+
background-color: ${colors.blue};
|
|
46
|
+
border-radius: 50%;
|
|
47
|
+
`;
|
|
48
|
+
const DropdownContainer = styled.div`
|
|
49
|
+
position: relative;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
`;
|
|
52
|
+
const DropdownMenu = styled.div`
|
|
53
|
+
position: fixed;
|
|
54
|
+
z-index: 10000;
|
|
55
|
+
min-width: 150px;
|
|
56
|
+
max-width: 300px;
|
|
57
|
+
background-color: ${colors.white};
|
|
58
|
+
border-radius: 8px;
|
|
59
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
60
|
+
border: 1px solid ${colors.lightGrey};
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
`;
|
|
63
|
+
const OptionsList = styled.div`
|
|
64
|
+
max-height: 300px;
|
|
65
|
+
overflow-y: auto;
|
|
66
|
+
`;
|
|
67
|
+
const ClearAllOption = styled.div`
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
padding: 16px 12px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
letter-spacing: 0.6px;
|
|
75
|
+
color: ${colors.blue};
|
|
76
|
+
border-top: 1px solid ${colors.lightGrey};
|
|
77
|
+
transition: background-color 0.15s ease;
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: ${colors.grey};
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
const TableFilterDropdown = ({
|
|
84
|
+
label,
|
|
85
|
+
options,
|
|
86
|
+
value = [],
|
|
87
|
+
onChange = () => {
|
|
88
|
+
},
|
|
89
|
+
icon: CustomIcon,
|
|
90
|
+
minWidth = 150,
|
|
91
|
+
maxWidth = 300,
|
|
92
|
+
menuAlign = "left",
|
|
93
|
+
menuTop = 8,
|
|
94
|
+
showClearAll = false,
|
|
95
|
+
clearAllText = "Clear all",
|
|
96
|
+
...props
|
|
97
|
+
}) => {
|
|
98
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
99
|
+
const [menuPosition, setMenuPosition] = useState({ top: 0, left: 0 });
|
|
100
|
+
const containerRef = useRef(null);
|
|
101
|
+
const triggerRef = useRef(null);
|
|
102
|
+
const menuRef = useRef(null);
|
|
103
|
+
const hasActiveFilters = value.length > 0;
|
|
104
|
+
const updateMenuPosition = useCallback(() => {
|
|
105
|
+
if (!triggerRef.current) return;
|
|
106
|
+
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
107
|
+
const menuWidth = minWidth || 150;
|
|
108
|
+
let left = triggerRect.left;
|
|
109
|
+
if (menuAlign === "right") {
|
|
110
|
+
left = triggerRect.right - menuWidth;
|
|
111
|
+
}
|
|
112
|
+
const viewportWidth = window.innerWidth;
|
|
113
|
+
if (left + menuWidth > viewportWidth - 10) {
|
|
114
|
+
left = viewportWidth - menuWidth - 10;
|
|
115
|
+
}
|
|
116
|
+
if (left < 10) {
|
|
117
|
+
left = 10;
|
|
118
|
+
}
|
|
119
|
+
setMenuPosition({
|
|
120
|
+
top: triggerRect.bottom + menuTop,
|
|
121
|
+
left
|
|
122
|
+
});
|
|
123
|
+
}, [menuAlign, menuTop, minWidth]);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (isOpen) {
|
|
126
|
+
updateMenuPosition();
|
|
127
|
+
const handleScrollOrResize = () => {
|
|
128
|
+
updateMenuPosition();
|
|
129
|
+
};
|
|
130
|
+
window.addEventListener("scroll", handleScrollOrResize, true);
|
|
131
|
+
window.addEventListener("resize", handleScrollOrResize);
|
|
132
|
+
return () => {
|
|
133
|
+
window.removeEventListener("scroll", handleScrollOrResize, true);
|
|
134
|
+
window.removeEventListener("resize", handleScrollOrResize);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}, [isOpen, updateMenuPosition]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (!isOpen) return;
|
|
140
|
+
const handleClickOutside = (event) => {
|
|
141
|
+
const clickedOutsideContainer = containerRef.current && !containerRef.current.contains(event.target);
|
|
142
|
+
const clickedOutsideMenu = menuRef.current && !menuRef.current.contains(event.target);
|
|
143
|
+
if (clickedOutsideContainer && clickedOutsideMenu) {
|
|
144
|
+
setIsOpen(false);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const handleEscape = (event) => {
|
|
148
|
+
if (event.key === "Escape") {
|
|
149
|
+
setIsOpen(false);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
153
|
+
document.addEventListener("keydown", handleEscape);
|
|
154
|
+
return () => {
|
|
155
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
156
|
+
document.removeEventListener("keydown", handleEscape);
|
|
157
|
+
};
|
|
158
|
+
}, [isOpen]);
|
|
159
|
+
const handleTriggerClick = useCallback((e) => {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
setIsOpen((prev) => !prev);
|
|
162
|
+
}, []);
|
|
163
|
+
const handleOptionClick = useCallback(
|
|
164
|
+
(optionValue, e) => {
|
|
165
|
+
e.stopPropagation();
|
|
166
|
+
const newValue = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
167
|
+
onChange?.(newValue);
|
|
168
|
+
},
|
|
169
|
+
[value, onChange]
|
|
170
|
+
);
|
|
171
|
+
const handleClearAll = useCallback(
|
|
172
|
+
(e) => {
|
|
173
|
+
e.stopPropagation();
|
|
174
|
+
onChange?.([]);
|
|
175
|
+
},
|
|
176
|
+
[onChange]
|
|
177
|
+
);
|
|
178
|
+
const IconComponent = CustomIcon || SvgFilterIcon;
|
|
179
|
+
const renderMenu = () => {
|
|
180
|
+
if (!isOpen) return null;
|
|
181
|
+
const menu = /* @__PURE__ */ jsxs(
|
|
182
|
+
DropdownMenu,
|
|
183
|
+
{
|
|
184
|
+
ref: menuRef,
|
|
185
|
+
style: {
|
|
186
|
+
top: menuPosition.top,
|
|
187
|
+
left: menuPosition.left,
|
|
188
|
+
minWidth: minWidth || 150,
|
|
189
|
+
maxWidth: maxWidth || 300
|
|
190
|
+
},
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsx(OptionsList, { children: options.map((option) => {
|
|
193
|
+
const isSelected = value.includes(option.value);
|
|
194
|
+
return /* @__PURE__ */ jsxs(CheckboxWrapperDiv, { onClick: (e) => handleOptionClick(option.value, e), children: [
|
|
195
|
+
/* @__PURE__ */ jsx(CheckboxDiv, { isSelected, children: /* @__PURE__ */ jsx(SvgCheckIcon, {}) }),
|
|
196
|
+
/* @__PURE__ */ jsx(OptionLabel, { children: option.label })
|
|
197
|
+
] }, option.value);
|
|
198
|
+
}) }),
|
|
199
|
+
showClearAll && hasActiveFilters && /* @__PURE__ */ jsx(ClearAllOption, { onClick: handleClearAll, children: clearAllText })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
return createPortal(menu, document.body);
|
|
204
|
+
};
|
|
205
|
+
return /* @__PURE__ */ jsxs(DropdownContainer, { ref: containerRef, ...props, children: [
|
|
206
|
+
/* @__PURE__ */ jsxs(TriggerContainer, { ref: triggerRef, onClick: handleTriggerClick, "data-clickable": "true", children: [
|
|
207
|
+
label && /* @__PURE__ */ jsx("span", { children: label }),
|
|
208
|
+
/* @__PURE__ */ jsxs(IconWrapper, { children: [
|
|
209
|
+
/* @__PURE__ */ jsx(IconComponent, {}),
|
|
210
|
+
hasActiveFilters && /* @__PURE__ */ jsx(ActiveDot, {})
|
|
211
|
+
] })
|
|
212
|
+
] }),
|
|
213
|
+
renderMenu()
|
|
214
|
+
] });
|
|
215
|
+
};
|
|
216
|
+
TableFilterDropdown.propTypes = {
|
|
217
|
+
/** Label text displayed next to the filter icon */
|
|
218
|
+
label: PropTypes.string,
|
|
219
|
+
/** Array of options to display */
|
|
220
|
+
options: PropTypes.arrayOf(
|
|
221
|
+
PropTypes.shape({
|
|
222
|
+
value: PropTypes.string.isRequired,
|
|
223
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
|
|
224
|
+
})
|
|
225
|
+
).isRequired,
|
|
226
|
+
/** Array of selected values */
|
|
227
|
+
value: PropTypes.arrayOf(PropTypes.string),
|
|
228
|
+
/** Callback when selection changes: (newValues) => void */
|
|
229
|
+
onChange: PropTypes.func,
|
|
230
|
+
/** Custom icon component (defaults to FilterIcon) */
|
|
231
|
+
icon: PropTypes.elementType,
|
|
232
|
+
/** Minimum width of the dropdown menu */
|
|
233
|
+
minWidth: PropTypes.number,
|
|
234
|
+
/** Maximum width of the dropdown menu */
|
|
235
|
+
maxWidth: PropTypes.number,
|
|
236
|
+
/** Alignment of the dropdown menu */
|
|
237
|
+
menuAlign: PropTypes.oneOf(["left", "right"]),
|
|
238
|
+
/** Top offset for the dropdown menu in pixels (default: 8) */
|
|
239
|
+
menuTop: PropTypes.number,
|
|
240
|
+
/** Show "Clear all" option at the bottom of the list */
|
|
241
|
+
showClearAll: PropTypes.bool,
|
|
242
|
+
/** Custom text for the "Clear all" option */
|
|
243
|
+
clearAllText: PropTypes.string
|
|
244
|
+
};
|
|
245
|
+
export {
|
|
246
|
+
TableFilterDropdown
|
|
247
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { TextareaWrapper, StyledTextarea } from "./Textarea.styles.js";
|
|
4
|
+
const Textarea = ({
|
|
5
|
+
id,
|
|
6
|
+
name,
|
|
7
|
+
placeholder,
|
|
8
|
+
value,
|
|
9
|
+
error,
|
|
10
|
+
touched,
|
|
11
|
+
readOnly,
|
|
12
|
+
disabled,
|
|
13
|
+
rows,
|
|
14
|
+
minHeight,
|
|
15
|
+
wrapperStyle,
|
|
16
|
+
onChange,
|
|
17
|
+
onBlur,
|
|
18
|
+
onFocus,
|
|
19
|
+
...restProps
|
|
20
|
+
}) => {
|
|
21
|
+
const handleChange = (e) => {
|
|
22
|
+
onChange?.(e);
|
|
23
|
+
};
|
|
24
|
+
const handleBlur = (e) => {
|
|
25
|
+
onBlur?.(e);
|
|
26
|
+
};
|
|
27
|
+
const handleFocus = (e) => {
|
|
28
|
+
onFocus?.(e);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(TextareaWrapper, { style: wrapperStyle, children: /* @__PURE__ */ jsx(
|
|
31
|
+
StyledTextarea,
|
|
32
|
+
{
|
|
33
|
+
id,
|
|
34
|
+
name,
|
|
35
|
+
value,
|
|
36
|
+
onChange: handleChange,
|
|
37
|
+
onBlur: handleBlur,
|
|
38
|
+
onFocus: handleFocus,
|
|
39
|
+
readOnly,
|
|
40
|
+
placeholder,
|
|
41
|
+
disabled,
|
|
42
|
+
rows,
|
|
43
|
+
minHeight,
|
|
44
|
+
error: error && touched,
|
|
45
|
+
...restProps
|
|
46
|
+
}
|
|
47
|
+
) });
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
Textarea
|
|
51
|
+
};
|