@stokr/components-library 2.3.58-beta.6 → 2.3.58-beta.7
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/dist/api/StokrWeb3.js +3 -3
- package/dist/api/auth.js +16 -53
- package/dist/api/fetchData.js +26 -66
- package/dist/api/fetchDataPublic.js +20 -57
- package/dist/components/2FA/Connect2FA.js +10 -11
- package/dist/components/2FA/EnterCode.js +32 -30
- package/dist/components/2FA/EnterCode.stories.js +4 -8
- package/dist/components/2FA/InstallAuthApp.js +8 -9
- package/dist/components/2FA/ResetCode.js +11 -12
- package/dist/components/2FA/Sucess2FA.js +12 -16
- package/dist/components/2FA/disable-2fa-flow.js +53 -104
- package/dist/components/2FA/disable-2fa-flow.stories.js +4 -8
- package/dist/components/2FA/enable-2fa-flow.js +73 -144
- package/dist/components/2FA/enable-2fa-flow.stories.js +4 -8
- package/dist/components/2FA/index.js +9 -9
- package/dist/components/2FA/login-with-otp-flow.js +126 -206
- package/dist/components/2FA/login-with-otp-flow.stories.js +4 -8
- package/dist/components/2FA/main-flow.js +70 -144
- package/dist/components/2FA/main-flow.stories.js +4 -8
- package/dist/components/AccountBalance/AccountBalance.js +14 -13
- package/dist/components/AccountBalance/AccountBalance.stories.js +6 -12
- package/dist/components/AccountBalance/AccountBalance.styles.js +9 -17
- package/dist/components/AdminDashboard/Table/ReactTable.js +77 -84
- package/dist/components/AdminDashboard/Table/ReactTable.stories.js +87 -63
- package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +24 -30
- package/dist/components/AdminDashboard/Table/Table.js +88 -123
- package/dist/components/AdminDashboard/Table/Table.styles.js +28 -90
- package/dist/components/AgreementItem/AgreementItem.js +10 -11
- package/dist/components/AgreementItem/AgreementItem.stories.js +5 -10
- package/dist/components/AgreementItem/AgreementItem.styles.js +8 -12
- package/dist/components/AnalyticGraphs/Analytic.js +504 -743
- package/dist/components/AnalyticGraphs/Analytic.styles.js +14 -26
- package/dist/components/BackButton/BackButton.js +9 -10
- package/dist/components/BackButton/BackButton.stories.js +4 -8
- package/dist/components/BackButton/BackButton.styles.js +13 -51
- package/dist/components/Background/Background.js +12 -11
- package/dist/components/Background/Background.stories.js +8 -14
- package/dist/components/Background/Background.styles.js +17 -33
- package/dist/components/BarChart/BarChart.js +138 -181
- package/dist/components/BarChart/BarChart.stories.js +5 -10
- package/dist/components/BarChart/BarChart.styles.js +8 -15
- package/dist/components/BarChartLegend/BarChartLegend.js +40 -67
- package/dist/components/BarChartLegend/BarChartLegend.styles.js +5 -10
- package/dist/components/BasicTable/BasicTable.js +12 -13
- package/dist/components/BasicTable/BasicTable.stories.js +5 -10
- package/dist/components/BasicTable/BasicTable.styles.js +11 -27
- package/dist/components/BlogPost/BlogPost.js +34 -53
- package/dist/components/BlogPost/BlogPost.stories.js +33 -46
- package/dist/components/BlogPost/BlogPost.styles.js +67 -59
- package/dist/components/Button/Button-stoDetails.js +150 -129
- package/dist/components/Button/Button.stories.js +27 -44
- package/dist/components/Button/Button.styles.js +24 -62
- package/dist/components/Button/GlareButton.js +61 -89
- package/dist/components/Button/GlareButton.stories.js +19 -29
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +5 -10
- package/dist/components/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +4 -8
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +9 -10
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +8 -17
- package/dist/components/Card/Card.styles.js +14 -41
- package/dist/components/ChartBox/ChartBox.js +5 -8
- package/dist/components/ChartBox/ChartBox.stories.js +3 -6
- package/dist/components/ChartBox/ChartBox.styles.js +8 -14
- package/dist/components/ChartBox/ChartBoxDistribution.js +5 -8
- package/dist/components/ChartBox/ChartBoxDistribution.stories.js +3 -6
- package/dist/components/ChartLegend/ChartLegend.js +30 -46
- package/dist/components/ChartLegend/ChartLegend.stories.js +22 -28
- package/dist/components/ChartLegend/ChartLegend.styles.js +16 -41
- package/dist/components/Checkbox/Checkbox.js +32 -32
- package/dist/components/Checkbox/Checkbox.stories.js +5 -10
- package/dist/components/Checkbox/Checkbox.styles.js +10 -23
- package/dist/components/Checklist/ChecklistCard.js +33 -35
- package/dist/components/Checklist/ChecklistCard.stories.js +77 -100
- package/dist/components/Checklist/ChecklistCard.styles.js +12 -15
- package/dist/components/Chips/Chip.js +14 -13
- package/dist/components/Chips/Chip.stories.js +10 -19
- package/dist/components/Chips/Chip.styles.js +14 -14
- package/dist/components/Chips/ChipWrapper.js +23 -41
- package/dist/components/Chips/ChipsWrapper.stories.js +9 -17
- package/dist/components/ComponentScroll/ComponentScroll.js +25 -34
- package/dist/components/ComponentScroll/ComponentScroll.stories.js +16 -23
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +22 -47
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +7 -61
- package/dist/components/CryptoAddress/ComponentWrap.js +10 -11
- package/dist/components/CryptoAddress/CryptoAddress.js +51 -68
- package/dist/components/CryptoAddress/CryptoAddress.stories.js +7 -13
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +55 -124
- package/dist/components/CryptoAddress/RadioWrap.js +9 -10
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +24 -25
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.stories.js +5 -10
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +12 -42
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +10 -9
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +16 -27
- package/dist/components/DonutChart/DonutChart.js +101 -130
- package/dist/components/DonutChart/DonutChart.stories.js +4 -8
- package/dist/components/DonutChart/DonutChart.styles.js +15 -27
- package/dist/components/DoubleButton/DoubleButton.styles.js +8 -8
- package/dist/components/ErrorMessage/ErrorMessage.styles.js +3 -5
- package/dist/components/FAQ/FAQ.js +29 -45
- package/dist/components/FAQ/FAQ.stories.js +4 -9
- package/dist/components/FAQ/FAQ.styles.js +23 -39
- package/dist/components/Footer/Footer.js +9 -10
- package/dist/components/Footer/Footer.stories.js +6 -12
- package/dist/components/Footer/Footer.styles.js +22 -46
- package/dist/components/Footer/FooterLayout.js +16 -20
- package/dist/components/Footer/FooterLayout.stories.js +4 -8
- package/dist/components/Footer/FooterMenu.js +61 -83
- package/dist/components/Footer/FooterMenu.stories.js +4 -8
- package/dist/components/Footer/FooterMenu.styles.js +16 -39
- package/dist/components/Footer/index.js +4 -4
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +92 -114
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +4 -8
- package/dist/components/Form/Form.js +15 -14
- package/dist/components/Form/Form.stories.js +4 -8
- package/dist/components/Form/Form.styles.js +16 -36
- package/dist/components/FullscreenCard/FullscreenCard.styles.js +7 -12
- package/dist/components/Grid/Grid.styles.js +17 -68
- package/dist/components/Header/Header.js +98 -163
- package/dist/components/Header/Header.stories.js +17 -28
- package/dist/components/Header/Header.styles.js +61 -124
- package/dist/components/HeroBlock/HeroVideoBlock.js +20 -25
- package/dist/components/Icon/Icon.style.js +10 -22
- package/dist/components/Icon/Icon2.js +11 -13
- package/dist/components/InfoIcon/InfoIcon.js +18 -17
- package/dist/components/InfoIcon/InfoIcon.stories.js +5 -10
- package/dist/components/InfoIcon/InfoIcon.styles.js +5 -21
- package/dist/components/InfoPanel/InfoPanel.js +26 -48
- package/dist/components/Input/DatePickerInput.js +21 -33
- package/dist/components/Input/DatePickerInput.stories.js +5 -10
- package/dist/components/Input/DatePickerInput.styles.js +5 -19
- package/dist/components/Input/Input.js +43 -51
- package/dist/components/Input/Input.stories.js +9 -16
- package/dist/components/Input/Input.styles.js +8 -43
- package/dist/components/Input/InputPassword.js +30 -50
- package/dist/components/Input/InputPassword.stories.js +6 -12
- package/dist/components/Input/InputPassword.styles.js +30 -57
- package/dist/components/Input/InputUsername.js +83 -102
- package/dist/components/Input/InputWithButton.js +20 -19
- package/dist/components/Input/InputWithButton.stories.js +5 -9
- package/dist/components/Input/InputWithButton.styles.js +7 -19
- package/dist/components/Input/OtpInput.js +27 -42
- package/dist/components/Input/OtpInput.stories.js +5 -11
- package/dist/components/Input/RangeInput.js +29 -25
- package/dist/components/Input/RangeInput.stories.js +4 -8
- package/dist/components/Input/RangeInput.styles.js +15 -42
- package/dist/components/Input/Select.js +68 -89
- package/dist/components/Input/Select.stories.js +6 -12
- package/dist/components/Input/Select.styles.js +12 -32
- package/dist/components/InvestCalculator/InvestCalculator.js +245 -243
- package/dist/components/InvestCalculator/InvestCalculator.stories.js +18 -21
- package/dist/components/InvestCalculator/InvestCalculator.styles.js +14 -33
- package/dist/components/InvestmentStat/InvestmentStat.js +11 -10
- package/dist/components/InvestmentStat/InvestmentStat.stories.js +5 -10
- package/dist/components/InvestmentStat/InvestmentStat.styles.js +12 -24
- package/dist/components/KYCFlow/BasicInfo.js +419 -460
- package/dist/components/KYCFlow/Confirmation.js +12 -17
- package/dist/components/KYCFlow/DocumentFileUpload.js +214 -227
- package/dist/components/KYCFlow/DocumentScan.js +16 -15
- package/dist/components/KYCFlow/DocumentScanUpload.js +203 -210
- package/dist/components/KYCFlow/DocumentSelect.js +87 -117
- package/dist/components/KYCFlow/DocumentSuccess.js +14 -15
- package/dist/components/KYCFlow/DocumentUpload.js +10 -11
- package/dist/components/KYCFlow/DocumentVerificationType.js +98 -128
- package/dist/components/KYCFlow/FaceScan.js +10 -11
- package/dist/components/KYCFlow/FaceScanRecognition.js +14 -13
- package/dist/components/KYCFlow/FaceScanSuccess.js +10 -13
- package/dist/components/KYCFlow/Terms.js +90 -113
- package/dist/components/KYCFlow/_styles.js +37 -86
- package/dist/components/KYCFlow/index.js +14 -14
- package/dist/components/KYCSelectBox/KYCSelectBox.styles.js +7 -19
- package/dist/components/LatestUpdate/LatestUpdate.js +12 -11
- package/dist/components/LatestUpdate/LatestUpdate.stories.js +5 -10
- package/dist/components/LatestUpdate/LatestUpdate.styles.js +15 -28
- package/dist/components/Layout/Layout-func-no-work.js +24 -24
- package/dist/components/Layout/Layout.js +47 -68
- package/dist/components/Layout/Layout.stories.js +5 -12
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +13 -12
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.stories.js +5 -10
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +10 -22
- package/dist/components/LearnMorePage/LearnMore.js +134 -174
- package/dist/components/LearnMorePage/LearnMore.shared.styles.js +7 -22
- package/dist/components/LearnMorePage/LearnMore.stories.js +4 -8
- package/dist/components/LearnMorePage/LearnMore.styles.js +24 -74
- package/dist/components/LearnMorePage/LearnMoreExampleObject.js +3 -5
- package/dist/components/LearnMorePage/LearnMoreItem.js +11 -16
- package/dist/components/LearnMorePage/LearnMoreItem.stories.js +4 -8
- package/dist/components/LearnMorePage/LearnMoreItem.styles.js +18 -54
- package/dist/components/LearnMoreSection/LearnMore.js +119 -158
- package/dist/components/LearnMoreSection/LearnMore.stories.js +4 -8
- package/dist/components/LearnMoreSection/LearnMore.styles.js +15 -41
- package/dist/components/LearnMoreSection/LearnMoreItem.js +14 -15
- package/dist/components/LearnMoreSection/LearnMoreItem.stories.js +4 -8
- package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +9 -23
- package/dist/components/LoginModal/LoginModal.js +35 -41
- package/dist/components/LoginModal/LoginModal.stories.js +8 -12
- package/dist/components/MainMenu/DynamicMainMenu.js +11 -14
- package/dist/components/MainMenu/MainMenu.js +157 -190
- package/dist/components/MainMenu/MainMenu.styles.js +48 -89
- package/dist/components/MatomoConnect/Matomo.js +201 -463
- package/dist/components/MenuNav/MenuNav.styles.js +5 -9
- package/dist/components/Modal/Modal.js +46 -48
- package/dist/components/Modal/Modal.stories.js +8 -16
- package/dist/components/Modal/Modal.styles.js +34 -96
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +69 -95
- package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +22 -43
- package/dist/components/Modal/PaymentModal.js +43 -54
- package/dist/components/Modal/PaymentModal.stories.js +4 -8
- package/dist/components/MultiProgressBar/MultiProgressBar.js +19 -23
- package/dist/components/MultiProgressBar/MultiProgressBar.stories.js +6 -12
- package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +9 -22
- package/dist/components/Newsletter/Newsletter.js +65 -100
- package/dist/components/Newsletter/Newsletter.stories.js +4 -8
- package/dist/components/Newsletter/Newsletter.styles.js +47 -44
- package/dist/components/NotificationContext/NotificationContext.js +93 -125
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +4 -16
- package/dist/components/Number/Number.js +13 -10
- package/dist/components/Number/Number.stories.js +23 -41
- package/dist/components/Number/Number.styles.js +4 -10
- package/dist/components/PageTransition/PageTransition.js +16 -19
- package/dist/components/Pagination/Pagination.js +22 -25
- package/dist/components/Pagination/Pagination.stories.js +29 -36
- package/dist/components/Pagination/Pagination.styles.js +8 -15
- package/dist/components/Pagination/PaginationControls.js +32 -36
- package/dist/components/Pagination/PaginationControls.stories.js +33 -62
- package/dist/components/Pagination/usePagination.js +29 -37
- package/dist/components/Process/Process.stories.js +6 -12
- package/dist/components/Process/Process.styles.js +6 -16
- package/dist/components/ProfileBadge/ProfileBadge.js +12 -11
- package/dist/components/ProfileBadge/ProfileBadge.stories.js +5 -9
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +13 -19
- package/dist/components/ProfileBox/ProfileBox.js +15 -17
- package/dist/components/ProfileBox/ProfileBox.stories.js +5 -9
- package/dist/components/ProfileBox/ProfileBox.styles.js +9 -21
- package/dist/components/ProfileHeader/ProfileHeader.js +163 -199
- package/dist/components/ProfileHeader/ProfileHeader.styles.js +24 -46
- package/dist/components/ProfileStat/ProfileStat.js +12 -11
- package/dist/components/ProfileStat/ProfileStat.stories.js +6 -12
- package/dist/components/ProfileStat/ProfileStat.styles.js +9 -23
- package/dist/components/ProofOfAddress/ProofOfAddress.styles.js +20 -36
- package/dist/components/QRCode/QRCode.js +30 -30
- package/dist/components/QRCode/QRCode.stories.js +14 -26
- package/dist/components/ROI/ROI.js +225 -261
- package/dist/components/ROI/ROI.styles.js +13 -25
- package/dist/components/ROI/ROIChart.js +196 -303
- package/dist/components/ROI/ROIChart.styles.js +7 -11
- package/dist/components/ROI/ROIModal.js +13 -20
- package/dist/components/ROI/ROIParkingo.js +208 -244
- package/dist/components/ROI/ROIPixelmatic.js +209 -245
- package/dist/components/ROI/ROIScenarioBox.js +9 -8
- package/dist/components/ROI/ROIScenarioBox.styles.js +10 -33
- package/dist/components/Radio/Radio.js +19 -18
- package/dist/components/Radio/Radio.stories.js +4 -8
- package/dist/components/Radio/Radio.styles.js +5 -14
- package/dist/components/RefreshButton/RefreshButton.js +6 -5
- package/dist/components/RefreshButton/RefreshButton.stories.js +5 -10
- package/dist/components/RefreshButton/RefreshButton.styles.js +9 -24
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +17 -18
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +5 -9
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +3 -4
- package/dist/components/RegisterLiquidSteps/RegisterLiquidSteps.js +46 -70
- package/dist/components/RegisterLiquidSteps/RegisterLiquidSteps.styles.js +10 -22
- package/dist/components/RegisterLiquidSteps/complete.js +4 -5
- package/dist/components/RegisterLiquidSteps/flow.js +53 -99
- package/dist/components/RegisterLiquidSteps/index.js +7 -22
- package/dist/components/RegisterLiquidSteps/register-liquid.js +62 -102
- package/dist/components/RegisterModal/RegisterModal.js +82 -118
- package/dist/components/RegisterModal/RegisterModal.stories.js +5 -9
- package/dist/components/RequestDataBox/RequestDataBox.js +9 -8
- package/dist/components/RequestDataBox/RequestDataBox.stories.js +4 -8
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +7 -12
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +10 -11
- package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +3 -4
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +29 -28
- package/dist/components/SEO/SEO.js +11 -10
- package/dist/components/SEO/SEO.stories.js +4 -8
- package/dist/components/SectionTitle/SectionTitle.styles.js +3 -5
- package/dist/components/ShareButton/ShareButton.js +132 -145
- package/dist/components/SideLine/SideLine.js +3 -6
- package/dist/components/SideLine/SideLine.stories.js +3 -6
- package/dist/components/SideLine/SideLine.styles.js +6 -12
- package/dist/components/SigningSubflow/SignSubIntro.js +9 -8
- package/dist/components/SigningSubflow/_styles.js +9 -20
- package/dist/components/SigningSubflow/index.js +5 -5
- package/dist/components/Slider/Slider.js +16 -16
- package/dist/components/Slider/Slider.stories.js +5 -10
- package/dist/components/Slider/Slider.styles.js +5 -8
- package/dist/components/SpanButton/SpanButton.styles.js +3 -6
- package/dist/components/StatusBadge/StatusBadge.styles.js +4 -10
- package/dist/components/StepController/StepController.js +49 -74
- package/dist/components/StepController/StepController.stories.js +4 -8
- package/dist/components/StepController/StepController.styles.js +6 -12
- package/dist/components/StepController/StepControllerContext.js +46 -68
- package/dist/components/StepController/StepControllerProgress.js +16 -19
- package/dist/components/StepController/StepControllerProgress.stories.js +4 -8
- package/dist/components/StepsProgress/StepsProgress.js +44 -58
- package/dist/components/StepsProgress/StepsProgress.stories.js +33 -35
- package/dist/components/StepsProgress/StepsProgress.styles.js +7 -15
- package/dist/components/StokrLoader/StokrLoader.js +20 -23
- package/dist/components/StokrLoader/media.js +5 -7
- package/dist/components/SvgIcons/AdminBadgeSvg.js +16 -19
- package/dist/components/SvgIcons/CameraSvg.js +26 -29
- package/dist/components/SvgIcons/CapsLockSvg.js +21 -24
- package/dist/components/SvgIcons/DocumentBackSvg.js +25 -28
- package/dist/components/SvgIcons/DocumentSmallSvg.js +51 -54
- package/dist/components/SvgIcons/DocumentSvg.js +28 -31
- package/dist/components/SvgIcons/Early.js +14 -17
- package/dist/components/SvgIcons/EthSvg.js +30 -33
- package/dist/components/SvgIcons/EurSvg.js +16 -19
- package/dist/components/SvgIcons/FaceScanIconSvg.js +21 -24
- package/dist/components/SvgIcons/FourSvg.js +11 -14
- package/dist/components/SvgIcons/Glassess.js +19 -22
- package/dist/components/SvgIcons/LogoSvg.js +14 -17
- package/dist/components/SvgIcons/OneSvg.js +13 -16
- package/dist/components/SvgIcons/PassportSvg.js +46 -49
- package/dist/components/SvgIcons/RefreshSvg.js +17 -20
- package/dist/components/SvgIcons/SocialFacebook.js +20 -23
- package/dist/components/SvgIcons/SocialInstagram.js +11 -14
- package/dist/components/SvgIcons/SocialLinkedIn.js +25 -28
- package/dist/components/SvgIcons/SocialMedium.js +15 -18
- package/dist/components/SvgIcons/SocialReddit.js +15 -18
- package/dist/components/SvgIcons/SocialTelegram.js +49 -52
- package/dist/components/SvgIcons/SocialTwitter.js +44 -47
- package/dist/components/SvgIcons/SocialYoutube.js +15 -18
- package/dist/components/SvgIcons/ThreeSvg.js +10 -13
- package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +72 -75
- package/dist/components/SvgIcons/TwoSvg.js +13 -16
- package/dist/components/SvgIcons/UpdateDefaultSvg.js +19 -22
- package/dist/components/SvgIcons/UpdateHardSvg.js +15 -18
- package/dist/components/SvgIcons/UpdateSoftSvg.js +17 -20
- package/dist/components/SvgIcons/UploadSvg.js +24 -27
- package/dist/components/SvgIcons/VerifiedBadge.js +13 -16
- package/dist/components/SvgIcons/index.js +32 -32
- package/dist/components/Switch/Switch.js +23 -37
- package/dist/components/Switch/Switch.stories.js +8 -14
- package/dist/components/Switch/Switch.styles.js +8 -33
- package/dist/components/Tabs/Tabs.js +19 -21
- package/dist/components/Tabs/Tabs.stories.js +4 -8
- package/dist/components/Tabs/Tabs.styles.js +4 -6
- package/dist/components/TabsNav/TabNav.js +14 -13
- package/dist/components/TabsNav/TabNav.stories.js +5 -10
- package/dist/components/TabsNav/TabsNav.js +14 -14
- package/dist/components/TabsNav/TabsNav.stories.js +4 -8
- package/dist/components/TabsNav/TabsNav.styles.js +10 -25
- package/dist/components/TeamOverview/TeamOverview.js +38 -84
- package/dist/components/TeamOverview/TeamOverview.stories.js +5 -10
- package/dist/components/TeamOverview/TeamOverview.styles.js +18 -35
- package/dist/components/TermsModal/TermsModal.js +49 -79
- package/dist/components/TermsModal/TermsModal.stories.js +4 -8
- package/dist/components/TermsModal/_styles.js +35 -100
- package/dist/components/Text/Headline.js +15 -14
- package/dist/components/Text/Headline.stories.js +4 -8
- package/dist/components/Text/StyledText.js +5 -8
- package/dist/components/Text/Text.stories.js +5 -10
- package/dist/components/Text/Text.styles.js +15 -37
- package/dist/components/TextLink/TextLink.styles.js +6 -17
- package/dist/components/ToDoList/ToDoList.js +76 -85
- package/dist/components/ToDoList/ToDoList.stories.js +7 -14
- package/dist/components/ToDoList/ToDoList.styles.js +34 -43
- package/dist/components/ToDoList/ToDoListTask.js +22 -35
- package/dist/components/ToDoList/ToDoListTask.stories.js +5 -10
- package/dist/components/ToDoList/ToDoListTask.styles.js +13 -40
- package/dist/components/TransactionDetails/TransactionDetails.js +9 -19
- package/dist/components/TransactionDetails/TransactionDetails.stories.js +5 -10
- package/dist/components/TransactionDetails/TransactionDetails.styles.js +6 -15
- package/dist/components/TransactionInfo/TransactionInfo.js +18 -17
- package/dist/components/TransactionInfo/TransactionInfo.stories.js +4 -8
- package/dist/components/TransactionInfo/TransactionInfo.styles.js +10 -31
- package/dist/components/TwoFactorModal/TwoFactorModal.js +72 -94
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +49 -48
- package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +6 -11
- package/dist/components/breakdown/Breakdown.js +38 -36
- package/dist/components/breakdown/index.js +3 -5
- package/dist/components/headerHo/HeaderHo.js +585 -769
- package/dist/components/headerHo/HeaderHo.stories.js +9 -13
- package/dist/components/headerHo/index.js +3 -5
- package/dist/components/icons/Arrow.js +43 -46
- package/dist/components/icons/Arrow.stories.js +7 -14
- package/dist/components/icons/ArrowSimple.js +32 -35
- package/dist/components/icons/ArrowSimple.stories.js +7 -14
- package/dist/components/icons/Check.js +28 -31
- package/dist/components/icons/Check.stories.js +3 -6
- package/dist/components/icons/Facebook.js +11 -14
- package/dist/components/icons/Facebook.stories.js +3 -6
- package/dist/components/icons/Info.js +40 -43
- package/dist/components/icons/Info.stories.js +3 -6
- package/dist/components/icons/Instagram.js +11 -14
- package/dist/components/icons/Instagram.stories.js +3 -6
- package/dist/components/icons/LinkIcon.js +19 -22
- package/dist/components/icons/LinkIcon.stories.js +3 -6
- package/dist/components/icons/LinkedIn.js +28 -31
- package/dist/components/icons/LinkedIn.stories.js +3 -6
- package/dist/components/icons/Medium.js +27 -30
- package/dist/components/icons/Medium.stories.js +3 -6
- package/dist/components/icons/Reddit.js +17 -20
- package/dist/components/icons/Reddit.stories.js +3 -6
- package/dist/components/icons/Share.js +47 -50
- package/dist/components/icons/Share.stories.js +3 -6
- package/dist/components/icons/Telegram.js +27 -30
- package/dist/components/icons/Telegram.stories.js +3 -6
- package/dist/components/icons/Twitter.js +11 -14
- package/dist/components/icons/Twitter.stories.js +3 -6
- package/dist/components/icons/X.js +11 -14
- package/dist/components/icons/X.stories.js +3 -6
- package/dist/components/icons/Youtube.js +11 -14
- package/dist/components/icons/Youtube.stories.js +3 -6
- package/dist/components/icons/index.js +15 -15
- package/dist/components/landing-page/List.js +3 -5
- package/dist/components/landing-page/PageContent.js +5 -7
- package/dist/components/landing-page/PageText.js +12 -16
- package/dist/components/landing-page/PageTitle.js +16 -47
- package/dist/components/logo/Logo.js +49 -71
- package/dist/components/logo/index.js +3 -5
- package/dist/components/renderToBody/index.js +3 -5
- package/dist/components/renderToBody/renderToBody.js +39 -60
- package/dist/components/taxId/TaxId.stories.js +11 -16
- package/dist/components/taxId/complete.js +9 -11
- package/dist/components/taxId/flow.js +22 -34
- package/dist/components/taxId/index.js +4 -4
- package/dist/components/taxId/register-taxid.js +54 -92
- package/dist/components/video/Video.js +69 -84
- package/dist/components/video/Video.stories.js +5 -9
- package/dist/components/video/index.js +3 -5
- package/dist/constants/globalVariables.js +10 -20
- package/dist/constants/style.js +23 -46
- package/dist/context/Auth.js +247 -340
- package/dist/context/AuthContext.js +545 -1023
- package/dist/context/Checkbox/CheckboxContext.js +65 -117
- package/dist/firebase-config.js +4 -6
- package/dist/hooks/useNewVentureForm.js +128 -193
- package/dist/hooks/useTimer.js +29 -51
- package/dist/index.js +134 -134
- package/dist/model/axios.js +4 -5
- package/dist/model/axiosPublic.js +4 -5
- package/dist/services/TimerService.js +70 -89
- package/dist/static/images/copy_icon.svg +4 -0
- package/dist/styles/colors.js +2 -4
- package/dist/styles/fonts.js +3 -4
- package/dist/styles/global.js +3 -4
- package/dist/styles/grid.js +4 -5
- package/dist/styles/reactTippy.js +3 -4
- package/dist/styles/rwd.js +12 -26
- package/dist/styles/semanticUi.js +3 -4
- package/dist/styles/spacing.js +2 -3
- package/dist/styles/theme.js +6 -9
- package/dist/utils/allowed-countries-list.js +2 -3
- package/dist/utils/analytics.js +32 -48
- package/dist/utils/check-sale-time-left.js +37 -39
- package/dist/utils/check-todo-status.js +3 -4
- package/dist/utils/checklistGenerator.js +46 -46
- package/dist/utils/copyToClipboard.js +65 -131
- package/dist/utils/countries-list.js +2 -3
- package/dist/utils/customHooks.js +40 -67
- package/dist/utils/delete-redirect-cookie-and-navigate.js +3 -3
- package/dist/utils/fix-decimals.js +4 -5
- package/dist/utils/formatCurrencyValue.js +41 -52
- package/dist/utils/get-cookie-domain.js +3 -4
- package/dist/utils/get-short-address.js +1 -3
- package/dist/utils/isUSInvestor.js +2 -4
- package/dist/utils/km_ify.js +3 -3
- package/dist/utils/lock-body.js +3 -5
- package/dist/utils/moment.js +10 -12
- package/dist/utils/redirect-url.js +2 -3
- package/dist/utils/saveAs.js +5 -5
- package/dist/utils/scrollUtils.js +33 -36
- package/dist/utils/set-redirect-cookie.js +6 -7
- package/dist/utils/withRouter.js +6 -6
- package/package.json +134 -141
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -10,20 +9,21 @@ var _usePagination = require("./usePagination");
|
|
|
10
9
|
var _Pagination = require("./Pagination.styles");
|
|
11
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
11
|
var _Icon = _interopRequireWildcard(require("../Icon/Icon.style"));
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
totalCount
|
|
19
|
-
siblingCount
|
|
20
|
-
currentPage
|
|
21
|
-
pageSize
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const Pagination = props => {
|
|
15
|
+
const {
|
|
16
|
+
onPageChange,
|
|
17
|
+
totalCount,
|
|
18
|
+
siblingCount,
|
|
19
|
+
currentPage,
|
|
20
|
+
pageSize
|
|
21
|
+
} = props;
|
|
22
|
+
const paginationRange = (0, _usePagination.usePagination)({
|
|
23
|
+
currentPage,
|
|
24
|
+
totalCount,
|
|
25
|
+
siblingCount,
|
|
26
|
+
pageSize
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
// If current page is 0, set it to 1
|
|
@@ -31,16 +31,16 @@ var Pagination = function Pagination(props) {
|
|
|
31
31
|
onPageChange(1);
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
const onNext = () => {
|
|
35
35
|
onPageChange(currentPage + 1);
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
const onPrevious = () => {
|
|
38
38
|
onPageChange(currentPage - 1);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// Always show at least page 1, even if there's only one page
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const displayRange = paginationRange.length < 2 ? [1] : paginationRange;
|
|
43
|
+
let lastPage = displayRange[displayRange.length - 1];
|
|
44
44
|
return /*#__PURE__*/_react.default.createElement(_Pagination.StyledList, {
|
|
45
45
|
listStyle: props.listStyle
|
|
46
46
|
}, /*#__PURE__*/_react.default.createElement(_Pagination.StyledList.Item, {
|
|
@@ -49,7 +49,7 @@ var Pagination = function Pagination(props) {
|
|
|
49
49
|
arrow: true
|
|
50
50
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
51
51
|
icon: _Icon.iconsMap.arrowLeft
|
|
52
|
-
})), displayRange.map(
|
|
52
|
+
})), displayRange.map(pageNumber => {
|
|
53
53
|
// If the pageItem is a DOT, render the DOTS unicode character
|
|
54
54
|
if (pageNumber === _usePagination.DOTS) {
|
|
55
55
|
return /*#__PURE__*/_react.default.createElement(_Pagination.StyledList.Item, {
|
|
@@ -62,9 +62,7 @@ var Pagination = function Pagination(props) {
|
|
|
62
62
|
return /*#__PURE__*/_react.default.createElement(_Pagination.StyledList.Item, {
|
|
63
63
|
key: pageNumber,
|
|
64
64
|
selected: pageNumber === currentPage,
|
|
65
|
-
onClick:
|
|
66
|
-
return onPageChange(pageNumber);
|
|
67
|
-
},
|
|
65
|
+
onClick: () => onPageChange(pageNumber),
|
|
68
66
|
disabled: displayRange.length === 1
|
|
69
67
|
}, pageNumber);
|
|
70
68
|
}), /*#__PURE__*/_react.default.createElement(_Pagination.StyledList.Item, {
|
|
@@ -87,5 +85,4 @@ Pagination.defaultProps = {
|
|
|
87
85
|
siblingCount: 1,
|
|
88
86
|
pageSize: 10
|
|
89
87
|
};
|
|
90
|
-
var _default = Pagination;
|
|
91
|
-
exports.default = _default;
|
|
88
|
+
var _default = exports.default = Pagination;
|
|
@@ -11,8 +11,8 @@ var _global = _interopRequireDefault(require("../../styles/global"));
|
|
|
11
11
|
var _InputWithButton = require("../Input/InputWithButton");
|
|
12
12
|
var _Button = require("../Button/Button.styles");
|
|
13
13
|
var _Card = require("../Card/Card.styles");
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
var _default = {
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
var _default = exports.default = {
|
|
16
16
|
title: 'Components Library/Pagination',
|
|
17
17
|
component: _Pagination.Pagination,
|
|
18
18
|
argTypes: {
|
|
@@ -38,53 +38,46 @@ var _default = {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.Button
|
|
66
|
-
// onClick={() => setpageSize(Number(inputPageSize))}
|
|
67
|
-
, null, "apply")))));
|
|
68
|
-
};
|
|
69
|
-
var PaginationExample = Template.bind({});
|
|
70
|
-
exports.PaginationExample = PaginationExample;
|
|
41
|
+
const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, args)));
|
|
42
|
+
const TemplateWithInput = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, {
|
|
43
|
+
noPaddingHorizontal: true,
|
|
44
|
+
flex: true,
|
|
45
|
+
style: {
|
|
46
|
+
justifyContent: 'space-between',
|
|
47
|
+
flexWrap: 'wrap'
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, args), /*#__PURE__*/_react.default.createElement(_Card.Card, {
|
|
50
|
+
noPadding: true
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_Card.CardTitle, {
|
|
52
|
+
style: {
|
|
53
|
+
padding: '2px 20px'
|
|
54
|
+
}
|
|
55
|
+
}, "Page Size:"), /*#__PURE__*/_react.default.createElement(_InputWithButton.InputWithButton, {
|
|
56
|
+
id: "pageSize",
|
|
57
|
+
name: "pageSize",
|
|
58
|
+
type: "number",
|
|
59
|
+
placeholder: 'Page size'
|
|
60
|
+
// onChange={(e) => setinputPageSize(e.target.value)}
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.Button
|
|
62
|
+
// onClick={() => setpageSize(Number(inputPageSize))}
|
|
63
|
+
, null, "apply")))));
|
|
64
|
+
const PaginationExample = exports.PaginationExample = Template.bind({});
|
|
71
65
|
PaginationExample.args = {
|
|
72
66
|
currentPage: 1,
|
|
73
67
|
totalCount: 100,
|
|
74
68
|
pageSize: 10,
|
|
75
69
|
siblingCount: 1,
|
|
76
|
-
onPageChange:
|
|
70
|
+
onPageChange: page => {
|
|
77
71
|
console.log('page changed to', page);
|
|
78
72
|
}
|
|
79
73
|
};
|
|
80
|
-
|
|
81
|
-
exports.PaginationWithInput = PaginationWithInput;
|
|
74
|
+
const PaginationWithInput = exports.PaginationWithInput = TemplateWithInput.bind({});
|
|
82
75
|
PaginationWithInput.args = {
|
|
83
76
|
currentPage: 1,
|
|
84
77
|
totalCount: 100,
|
|
85
78
|
pageSize: 10,
|
|
86
79
|
siblingCount: 1,
|
|
87
|
-
onPageChange:
|
|
80
|
+
onPageChange: page => {
|
|
88
81
|
console.log('page changed to', page);
|
|
89
82
|
}
|
|
90
83
|
};
|
|
@@ -6,25 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.StyledList = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _theme = _interopRequireDefault(require("../../styles/theme"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const StyledList = exports.StyledList = _styledComponents.default.ul.withConfig({
|
|
11
11
|
displayName: "Paginationstyles__StyledList",
|
|
12
12
|
componentId: "sc-7ltpvr-0"
|
|
13
|
-
})(["display:flex;list-style-type:none;padding:0;", ""],
|
|
14
|
-
|
|
13
|
+
})(["display:flex;list-style-type:none;padding:0;", ""], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
listStyle
|
|
16
|
+
} = _ref;
|
|
15
17
|
return listStyle;
|
|
16
18
|
});
|
|
17
|
-
|
|
18
|
-
var ListItem = _styledComponents.default.li.withConfig({
|
|
19
|
+
const ListItem = _styledComponents.default.li.withConfig({
|
|
19
20
|
displayName: "Paginationstyles__ListItem",
|
|
20
21
|
componentId: "sc-7ltpvr-1"
|
|
21
|
-
})(["padding:0 12px;height:32px;text-align:center;margin:auto 4px;color:", ";display:flex;align-items:center;letter-spacing:0.01071em;border-radius:16px;line-height:1.43;font-size:15px;font-weight:500;min-width:32px;", " &:hover{background-color:", ";color:", ";cursor:pointer;}", " ", " ", ""], _theme.default.cBlack,
|
|
22
|
-
return props.arrow && "\n padding:0 9px;\n ";
|
|
23
|
-
}, _theme.default.cPrimary, _theme.default.cWhite, function (props) {
|
|
24
|
-
return props.selected && "\n color: ".concat(_theme.default.cWhite, ";\n background-color: ").concat(_theme.default.cPrimary, ";\n ");
|
|
25
|
-
}, function (props) {
|
|
26
|
-
return props.disabled && "\n pointer-events:none;\n opacity: 0.6;\n ";
|
|
27
|
-
}, function (props) {
|
|
28
|
-
return props.dots && "\n &:hover{\n background-color: transparent;\n cursor: default;\n color:".concat(_theme.default.cBlack, "\n }\n ");
|
|
29
|
-
});
|
|
22
|
+
})(["padding:0 12px;height:32px;text-align:center;margin:auto 4px;color:", ";display:flex;align-items:center;letter-spacing:0.01071em;border-radius:16px;line-height:1.43;font-size:15px;font-weight:500;min-width:32px;", " &:hover{background-color:", ";color:", ";cursor:pointer;}", " ", " ", ""], _theme.default.cBlack, props => props.arrow && "\n padding:0 9px;\n ", _theme.default.cPrimary, _theme.default.cWhite, props => props.selected && "\n color: ".concat(_theme.default.cWhite, ";\n background-color: ").concat(_theme.default.cPrimary, ";\n "), props => props.disabled && "\n pointer-events:none;\n opacity: 0.6;\n ", props => props.dots && "\n &:hover{\n background-color: transparent;\n cursor: default;\n color:".concat(_theme.default.cBlack, "\n }\n "));
|
|
30
23
|
StyledList.Item = ListItem;
|
|
@@ -11,47 +11,44 @@ var _Pagination = _interopRequireDefault(require("./Pagination"));
|
|
|
11
11
|
var _Card = require("../Card/Card.styles");
|
|
12
12
|
var _InputWithButton = _interopRequireDefault(require("../Input/InputWithButton"));
|
|
13
13
|
var _Button = _interopRequireDefault(require("../Button/Button.styles"));
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
function _defineProperty(
|
|
19
|
-
function _toPropertyKey(
|
|
20
|
-
function _toPrimitive(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
scrollOffset =
|
|
32
|
-
containerStyle
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
listStyle = _ref.listStyle;
|
|
40
|
-
var handlePageChange = function handlePageChange(page) {
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
const PaginationControls = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
currentPage,
|
|
23
|
+
totalCount,
|
|
24
|
+
pageSize,
|
|
25
|
+
onPageChange,
|
|
26
|
+
inputPageSize,
|
|
27
|
+
setInputPageSize,
|
|
28
|
+
setPageSize,
|
|
29
|
+
scrollRef,
|
|
30
|
+
scrollOffset = -100,
|
|
31
|
+
containerStyle,
|
|
32
|
+
showPageSizeControl = true,
|
|
33
|
+
pageSizeLabel = 'Page Size:',
|
|
34
|
+
applyButtonText = 'apply',
|
|
35
|
+
listStyle
|
|
36
|
+
} = _ref;
|
|
37
|
+
const handlePageChange = page => {
|
|
41
38
|
onPageChange(page);
|
|
42
39
|
|
|
43
40
|
// Scroll to the reference element if provided
|
|
44
41
|
if (scrollRef !== null && scrollRef !== void 0 && scrollRef.current) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const yOffset = scrollOffset;
|
|
43
|
+
const element = scrollRef.current;
|
|
44
|
+
const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
|
|
48
45
|
window.scrollTo({
|
|
49
46
|
top: y,
|
|
50
47
|
behavior: 'smooth'
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
|
-
|
|
51
|
+
const isValidPageSize = Number(inputPageSize) > 0;
|
|
55
52
|
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
56
53
|
noPaddingHorizontal: true,
|
|
57
54
|
flex: true,
|
|
@@ -77,18 +74,18 @@ var PaginationControls = function PaginationControls(_ref) {
|
|
|
77
74
|
value: inputPageSize,
|
|
78
75
|
type: "number",
|
|
79
76
|
placeholder: "Page size",
|
|
80
|
-
onChange:
|
|
77
|
+
onChange: e => {
|
|
81
78
|
// Allow empty value or any non-negative number up to total count
|
|
82
|
-
|
|
79
|
+
const value = e.target.value === '' ? '' : Math.min(totalCount, Math.max(0, Number(e.target.value)));
|
|
83
80
|
setInputPageSize(value);
|
|
84
81
|
}
|
|
85
82
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
86
|
-
onClick:
|
|
87
|
-
|
|
83
|
+
onClick: () => {
|
|
84
|
+
const newPageSize = Math.max(1, Number(inputPageSize) || 1);
|
|
88
85
|
setPageSize(newPageSize);
|
|
89
86
|
|
|
90
87
|
// If the current page would now be out of bounds, adjust it
|
|
91
|
-
|
|
88
|
+
const maxPage = Math.ceil(totalCount / newPageSize);
|
|
92
89
|
if (currentPage > maxPage && maxPage > 0) {
|
|
93
90
|
handlePageChange(maxPage);
|
|
94
91
|
}
|
|
@@ -118,5 +115,4 @@ PaginationControls.propTypes = {
|
|
|
118
115
|
applyButtonText: _propTypes.default.string,
|
|
119
116
|
listStyle: _propTypes.default.object
|
|
120
117
|
};
|
|
121
|
-
var _default = PaginationControls;
|
|
122
|
-
exports.default = _default;
|
|
118
|
+
var _default = exports.default = PaginationControls;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,31 +7,22 @@ exports.default = exports.WithoutPageSizeControl = exports.SmallDataSet = export
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _PaginationControls = _interopRequireDefault(require("./PaginationControls"));
|
|
10
9
|
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
-
function _defineProperty(
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
19
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
20
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
25
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
26
18
|
// Create mock data array
|
|
27
|
-
|
|
19
|
+
const mockItems = Array.from({
|
|
28
20
|
length: 15
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
var _default = {
|
|
21
|
+
}, (_, index) => ({
|
|
22
|
+
id: index + 1,
|
|
23
|
+
name: "Item ".concat(index + 1)
|
|
24
|
+
}));
|
|
25
|
+
var _default = exports.default = {
|
|
36
26
|
title: 'Components Library/Pagination',
|
|
37
27
|
component: _PaginationControls.default,
|
|
38
28
|
parameters: {
|
|
@@ -43,25 +33,15 @@ var _default = {
|
|
|
43
33
|
}
|
|
44
34
|
}
|
|
45
35
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
currentPage = _useState2[0],
|
|
51
|
-
setCurrentPage = _useState2[1];
|
|
52
|
-
var _useState3 = (0, _react.useState)(10),
|
|
53
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
-
pageSize = _useState4[0],
|
|
55
|
-
setPageSize = _useState4[1];
|
|
56
|
-
var _useState5 = (0, _react.useState)(10),
|
|
57
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
-
inputPageSize = _useState6[0],
|
|
59
|
-
setInputPageSize = _useState6[1];
|
|
36
|
+
const Template = args => {
|
|
37
|
+
const [currentPage, setCurrentPage] = (0, _react.useState)(1);
|
|
38
|
+
const [pageSize, setPageSize] = (0, _react.useState)(10);
|
|
39
|
+
const [inputPageSize, setInputPageSize] = (0, _react.useState)(10);
|
|
60
40
|
|
|
61
41
|
// Get current items
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
const indexOfLastItem = currentPage * pageSize;
|
|
43
|
+
const indexOfFirstItem = indexOfLastItem - pageSize;
|
|
44
|
+
const currentItems = mockItems.slice(indexOfFirstItem, indexOfLastItem);
|
|
65
45
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
66
46
|
style: {
|
|
67
47
|
marginBottom: '20px'
|
|
@@ -70,15 +50,13 @@ var Template = function Template(args) {
|
|
|
70
50
|
style: {
|
|
71
51
|
marginBottom: '20px'
|
|
72
52
|
}
|
|
73
|
-
}, currentItems.map(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, item.name);
|
|
81
|
-
})), /*#__PURE__*/_react.default.createElement(_PaginationControls.default, _extends({}, args, {
|
|
53
|
+
}, currentItems.map(item => /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
key: item.id,
|
|
55
|
+
style: {
|
|
56
|
+
padding: '8px',
|
|
57
|
+
borderBottom: '1px solid #eee'
|
|
58
|
+
}
|
|
59
|
+
}, item.name))), /*#__PURE__*/_react.default.createElement(_PaginationControls.default, _extends({}, args, {
|
|
82
60
|
currentPage: currentPage,
|
|
83
61
|
totalCount: mockItems.length,
|
|
84
62
|
pageSize: pageSize,
|
|
@@ -88,27 +66,23 @@ var Template = function Template(args) {
|
|
|
88
66
|
setInputPageSize: setInputPageSize
|
|
89
67
|
})));
|
|
90
68
|
};
|
|
91
|
-
|
|
92
|
-
exports.Default = Default;
|
|
69
|
+
const Default = exports.Default = Template.bind({});
|
|
93
70
|
Default.args = {
|
|
94
71
|
scrollOffset: -100,
|
|
95
72
|
showPageSizeControl: true,
|
|
96
73
|
pageSizeLabel: 'Page Size:',
|
|
97
74
|
applyButtonText: 'Apply'
|
|
98
75
|
};
|
|
99
|
-
|
|
100
|
-
exports.WithoutPageSizeControl = WithoutPageSizeControl;
|
|
76
|
+
const WithoutPageSizeControl = exports.WithoutPageSizeControl = Template.bind({});
|
|
101
77
|
WithoutPageSizeControl.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
102
78
|
showPageSizeControl: false
|
|
103
79
|
});
|
|
104
|
-
|
|
105
|
-
exports.CustomPageSizeLabel = CustomPageSizeLabel;
|
|
80
|
+
const CustomPageSizeLabel = exports.CustomPageSizeLabel = Template.bind({});
|
|
106
81
|
CustomPageSizeLabel.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
107
82
|
pageSizeLabel: 'Items per page:',
|
|
108
83
|
applyButtonText: 'Set'
|
|
109
84
|
});
|
|
110
|
-
|
|
111
|
-
exports.CustomStyle = CustomStyle;
|
|
85
|
+
const CustomStyle = exports.CustomStyle = Template.bind({});
|
|
112
86
|
CustomStyle.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
113
87
|
containerStyle: {
|
|
114
88
|
backgroundColor: '#f5f5f5',
|
|
@@ -116,22 +90,19 @@ CustomStyle.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
|
116
90
|
borderRadius: '8px'
|
|
117
91
|
}
|
|
118
92
|
});
|
|
119
|
-
|
|
120
|
-
exports.SmallDataSet = SmallDataSet;
|
|
93
|
+
const SmallDataSet = exports.SmallDataSet = Template.bind({});
|
|
121
94
|
SmallDataSet.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
122
95
|
totalCount: 20
|
|
123
96
|
});
|
|
124
97
|
|
|
125
98
|
// Example showing how the component handles a large dataset
|
|
126
|
-
|
|
127
|
-
exports.LargeDataSet = LargeDataSet;
|
|
99
|
+
const LargeDataSet = exports.LargeDataSet = Template.bind({});
|
|
128
100
|
LargeDataSet.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
129
101
|
totalCount: 1000
|
|
130
102
|
});
|
|
131
103
|
|
|
132
104
|
// Example with custom list style
|
|
133
|
-
|
|
134
|
-
exports.CustomListStyle = CustomListStyle;
|
|
105
|
+
const CustomListStyle = exports.CustomListStyle = Template.bind({});
|
|
135
106
|
CustomListStyle.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
136
107
|
listStyle: {
|
|
137
108
|
backgroundColor: '#e6f7ff',
|
|
@@ -5,38 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.usePagination = exports.DOTS = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
-
var DOTS = '...';
|
|
15
|
-
exports.DOTS = DOTS;
|
|
16
|
-
var range = function range(start, end) {
|
|
17
|
-
var length = end - start + 1;
|
|
8
|
+
const DOTS = exports.DOTS = '...';
|
|
9
|
+
const range = (start, end) => {
|
|
10
|
+
let length = end - start + 1;
|
|
18
11
|
/*
|
|
19
12
|
Create an array of certain length and set the elements within it from
|
|
20
13
|
start value to end value.
|
|
21
14
|
*/
|
|
22
15
|
return Array.from({
|
|
23
|
-
length
|
|
24
|
-
},
|
|
25
|
-
return idx + start;
|
|
26
|
-
});
|
|
16
|
+
length
|
|
17
|
+
}, (_, idx) => idx + start);
|
|
27
18
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
siblingCount =
|
|
33
|
-
currentPage
|
|
34
|
-
|
|
19
|
+
const usePagination = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
totalCount,
|
|
22
|
+
pageSize,
|
|
23
|
+
siblingCount = 1,
|
|
24
|
+
currentPage
|
|
25
|
+
} = _ref;
|
|
26
|
+
const paginationRange = (0, _react.useMemo)(() => {
|
|
35
27
|
//The Math.ceil() function always rounds a number up to the next largest integer.
|
|
36
|
-
|
|
28
|
+
const totalPageCount = Math.ceil(totalCount / pageSize);
|
|
37
29
|
|
|
38
30
|
// Pages count is determined as siblingCount + firstPage + lastPage + currentPage + 2*DOTS
|
|
39
|
-
|
|
31
|
+
const totalPageNumbers = siblingCount + 5;
|
|
40
32
|
|
|
41
33
|
/*
|
|
42
34
|
Case 1:
|
|
@@ -50,41 +42,41 @@ var usePagination = function usePagination(_ref) {
|
|
|
50
42
|
/*
|
|
51
43
|
Calculate left and right sibling index and make sure they are within range 1 and totalPageCount
|
|
52
44
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
46
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPageCount);
|
|
55
47
|
|
|
56
48
|
/*
|
|
57
49
|
We do not show dots just when there is just one page number to be inserted between the extremes of sibling and the page limits i.e 1 and totalPageCount. Hence we are using leftSiblingIndex > 2 and rightSiblingIndex < totalPageCount - 2
|
|
58
50
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
52
|
+
const shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
|
|
53
|
+
const firstPageIndex = 1;
|
|
54
|
+
const lastPageIndex = totalPageCount;
|
|
63
55
|
|
|
64
56
|
/*
|
|
65
57
|
Case 2: No left dots to show, but rights dots to be shown
|
|
66
58
|
*/
|
|
67
59
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return [
|
|
60
|
+
let leftItemCount = 3 + 2 * siblingCount;
|
|
61
|
+
let leftRange = range(1, leftItemCount);
|
|
62
|
+
return [...leftRange, DOTS, totalPageCount];
|
|
71
63
|
}
|
|
72
64
|
|
|
73
65
|
/*
|
|
74
66
|
Case 3: No right dots to show, but left dots to be shown
|
|
75
67
|
*/
|
|
76
68
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return [firstPageIndex, DOTS]
|
|
69
|
+
let rightItemCount = 3 + 2 * siblingCount;
|
|
70
|
+
let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
71
|
+
return [firstPageIndex, DOTS, ...rightRange];
|
|
80
72
|
}
|
|
81
73
|
|
|
82
74
|
/*
|
|
83
75
|
Case 4: Both left and right dots to be shown
|
|
84
76
|
*/
|
|
85
77
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
86
|
-
|
|
87
|
-
return [firstPageIndex, DOTS
|
|
78
|
+
let middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
79
|
+
return [firstPageIndex, DOTS, ...middleRange, DOTS, lastPageIndex];
|
|
88
80
|
}
|
|
89
81
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
90
82
|
return paginationRange;
|