@stokr/components-library 0.5.4 → 0.5.6
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/build/asset-manifest.json +9 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/js/main.31d6cfe0.js +0 -0
- package/dist/AccountBalance/AccountBalance.js +43 -0
- package/dist/AccountBalance/AccountBalance.stories.js +75 -0
- package/dist/AccountBalance/AccountBalance.styles.js +38 -0
- package/dist/AdminDashboard/Table/Table.js +120 -0
- package/dist/AdminDashboard/Table/Table.styles.js +111 -0
- package/dist/AgreementItem/AgreementItem.js +38 -0
- package/dist/AgreementItem/AgreementItem.stories.js +98 -0
- package/dist/AgreementItem/AgreementItem.styles.js +31 -0
- package/dist/AnalyticGraphs/Analytic.js +528 -0
- package/dist/AnalyticGraphs/Analytic.styles.js +49 -0
- package/dist/BackButton/BackButton.js +22 -0
- package/dist/BackButton/BackButton.stories.js +24 -0
- package/dist/BackButton/BackButton.styles.js +110 -0
- package/dist/Background/Background.js +34 -0
- package/dist/Background/Background.stories.js +50 -0
- package/dist/Background/Background.styles.js +113 -0
- package/dist/BarChart/BarChart.js +258 -0
- package/dist/BarChart/BarChart.stories.js +46 -0
- package/dist/BarChart/BarChart.styles.js +93 -0
- package/dist/BarChartLegend/BarChartLegend.js +74 -0
- package/dist/BarChartLegend/BarChartLegend.styles.js +26 -0
- package/dist/BasicTable/BasicTable.js +20 -0
- package/dist/BasicTable/BasicTable.stories.js +51 -0
- package/dist/BasicTable/BasicTable.styles.js +64 -0
- package/dist/Button/Button.stories.js +63 -0
- package/dist/Button/Button.styles.js +180 -0
- package/dist/ButtonContainer/ButtonContainer.styles.js +25 -0
- package/dist/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +35 -0
- package/dist/CapitalRaisedSummary/CaptialRaisedSummary.js +23 -0
- package/dist/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +36 -0
- package/dist/ChartBox/ChartBox.js +34 -0
- package/dist/ChartBox/ChartBox.stories.js +9 -0
- package/dist/ChartBox/ChartBox.styles.js +50 -0
- package/dist/ChartBox/ChartBoxDistribution.js +20 -0
- package/dist/ChartBox/ChartBoxDistribution.stories.js +10 -0
- package/dist/ChartLegend/ChartLegend.js +37 -0
- package/dist/ChartLegend/ChartLegend.stories.js +74 -0
- package/dist/ChartLegend/ChartLegend.styles.js +67 -0
- package/dist/Checkbox/Checkbox.js +108 -0
- package/dist/Checkbox/Checkbox.stories.js +82 -0
- package/dist/Checkbox/Checkbox.styles.js +123 -0
- package/dist/Checklist/UserChecklist.js +247 -0
- package/dist/Checklist/UserChecklist.stories.js +115 -0
- package/dist/ComponentScroll/ComponentScroll.js +99 -0
- package/dist/ComponentScroll/ComponentScroll.stories.js +92 -0
- package/dist/ComponentScroll/ComponentScroll.styles.js +104 -0
- package/dist/ComponentWrapper/ComponentWrapper.styles.js +128 -0
- package/dist/CryptoAddress/ComponentWrap.js +24 -0
- package/dist/CryptoAddress/CryptoAddress.js +124 -0
- package/dist/CryptoAddress/CryptoAddress.stories.js +163 -0
- package/dist/CryptoAddress/CryptoAddress.styles.js +399 -0
- package/dist/CryptoAddress/RadioWrap.js +36 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.js +42 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.stories.js +65 -0
- package/dist/CryptoAddressDetails/CryptoAddressDetails.styles.js +114 -0
- package/dist/CryptoAddressWrapper/CryptoAddressWrapper.js +30 -0
- package/dist/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +98 -0
- package/dist/DonutChart/DonutChart.js +137 -0
- package/dist/DonutChart/DonutChart.stories.js +39 -0
- package/dist/DonutChart/DonutChart.styles.js +101 -0
- package/dist/DoubleButton/DoubleButton.styles.js +25 -0
- package/dist/ErrorMessage/ErrorMessage.styles.js +9 -0
- package/dist/FAQ/FAQ.js +40 -0
- package/dist/FAQ/FAQ.stories.js +63 -0
- package/dist/FAQ/FAQ.styles.js +69 -0
- package/dist/Footer/Footer.js +54 -0
- package/dist/Footer/Footer.stories.js +41 -0
- package/dist/Footer/Footer.styles.js +230 -0
- package/dist/Footer/FooterLayout.js +114 -0
- package/dist/Footer/FooterLayout.stories.js +20 -0
- package/dist/Footer/FooterMenu.js +83 -0
- package/dist/Footer/FooterMenu.stories.js +110 -0
- package/dist/Footer/FooterMenu.styles.js +274 -0
- package/dist/Footer/index.js +4 -0
- package/dist/{03f9f978feb2b015b6812ba10f689967.png → Footer/lemonway.png} +0 -0
- package/dist/Footer/sicos-logo.svg +1 -0
- package/dist/ForgotPasswordModal/ForgotPasswordModal.js +89 -0
- package/dist/ForgotPasswordModal/ForgotPasswordModal.stories.js +31 -0
- package/dist/Form/Form.js +38 -0
- package/dist/Form/Form.stories.js +23 -0
- package/dist/Form/Form.styles.js +66 -0
- package/dist/FullscreenCard/FullscreenCard.styles.js +36 -0
- package/dist/Grid/Grid.styles.js +109 -0
- package/dist/Header/Header.js +369 -0
- package/dist/Header/Header.stories.js +172 -0
- package/dist/Header/Header.styles.js +493 -0
- package/dist/Icon/Icon.style.js +75 -0
- package/dist/InfoIcon/InfoIcon.js +40 -0
- package/dist/InfoIcon/InfoIcon.stories.js +40 -0
- package/dist/InfoIcon/InfoIcon.styles.js +42 -0
- package/dist/InfoPanel/InfoPanel.js +115 -0
- package/dist/Input/DatePickerInput.js +64 -0
- package/dist/Input/DatePickerInput.stories.js +80 -0
- package/dist/Input/DatePickerInput.styles.js +67 -0
- package/dist/Input/Input.js +86 -0
- package/dist/Input/Input.stories.js +134 -0
- package/dist/Input/Input.styles.js +126 -0
- package/dist/Input/InputPassword.js +122 -0
- package/dist/Input/InputPassword.stories.js +72 -0
- package/dist/Input/InputPassword.styles.js +139 -0
- package/dist/Input/RangeInput.js +46 -0
- package/dist/Input/RangeInput.stories.js +48 -0
- package/dist/Input/RangeInput.styles.js +125 -0
- package/dist/Input/Select.js +130 -0
- package/dist/Input/Select.stories.js +129 -0
- package/dist/Input/Select.styles.js +143 -0
- package/dist/InvestCalculator/InvestCalculator.js +353 -0
- package/dist/InvestCalculator/InvestCalculator.stories.js +129 -0
- package/dist/InvestCalculator/InvestCalculator.styles.js +78 -0
- package/dist/InvestmentStat/InvestmentStat.js +33 -0
- package/dist/InvestmentStat/InvestmentStat.stories.js +44 -0
- package/dist/InvestmentStat/InvestmentStat.styles.js +53 -0
- package/dist/KYCFlow/BasicInfo.js +396 -0
- package/dist/KYCFlow/Confirmation.js +37 -0
- package/dist/KYCFlow/DocumentFileUpload.js +240 -0
- package/dist/KYCFlow/DocumentScan.js +66 -0
- package/dist/KYCFlow/DocumentScanUpload.js +228 -0
- package/dist/KYCFlow/DocumentSelect.js +101 -0
- package/dist/KYCFlow/DocumentSuccess.js +54 -0
- package/dist/KYCFlow/DocumentUpload.js +44 -0
- package/dist/KYCFlow/DocumentVerificationType.js +114 -0
- package/dist/KYCFlow/FaceScan.js +45 -0
- package/dist/KYCFlow/FaceScanRecognition.js +52 -0
- package/dist/KYCFlow/FaceScanSuccess.js +47 -0
- package/dist/KYCFlow/Terms.js +99 -0
- package/dist/KYCFlow/_styles.js +284 -0
- package/dist/KYCFlow/index.js +14 -0
- package/dist/KYCSelectBox/KYCSelectBox.styles.js +62 -0
- package/dist/LatestUpdate/LatestUpdate.js +35 -0
- package/dist/LatestUpdate/LatestUpdate.stories.js +51 -0
- package/dist/LatestUpdate/LatestUpdate.styles.js +77 -0
- package/dist/Layout/Layout-func-no-work.js +67 -0
- package/dist/Layout/Layout.js +68 -0
- package/dist/Layout/Layout.stories.js +55 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.js +39 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.stories.js +58 -0
- package/dist/LearnMoreCarousel/LearnMoreCarousel.styles.js +205 -0
- package/dist/LearnMorePage/LearnMore.js +199 -0
- package/dist/LearnMorePage/LearnMore.shared.styles.js +49 -0
- package/dist/LearnMorePage/LearnMore.stories.js +41 -0
- package/dist/LearnMorePage/LearnMore.styles.js +250 -0
- package/dist/LearnMorePage/LearnMoreExampleObject.js +102 -0
- package/dist/LearnMorePage/LearnMoreItem.js +73 -0
- package/dist/LearnMorePage/LearnMoreItem.stories.js +54 -0
- package/dist/LearnMorePage/LearnMoreItem.styles.js +218 -0
- package/dist/LearnMoreSection/LearnMore.js +158 -0
- package/dist/LearnMoreSection/LearnMore.stories.js +23 -0
- package/dist/LearnMoreSection/LearnMore.styles.js +134 -0
- package/dist/LearnMoreSection/LearnMoreItem.js +39 -0
- package/dist/LearnMoreSection/LearnMoreItem.stories.js +52 -0
- package/dist/LearnMoreSection/LearnMoreItem.styles.js +54 -0
- package/dist/LoginModal/LoginModal.js +125 -0
- package/dist/MainMenu/DynamicMainMenu.js +41 -0
- package/dist/MainMenu/MainMenu.js +207 -0
- package/dist/MainMenu/MainMenu.styles.js +361 -0
- package/dist/MatomoConnect/Matomo.js +221 -0
- package/dist/MatomoConnect/Matomo_fuckup.js +185 -0
- package/dist/MenuNav/MenuNav.styles.js +88 -0
- package/dist/Modal/Modal.js +71 -0
- package/dist/Modal/Modal.stories.js +67 -0
- package/dist/Modal/Modal.styles.js +407 -0
- package/dist/MultiProgressBar/MultiProgressBar.js +33 -0
- package/dist/MultiProgressBar/MultiProgressBar.stories.js +61 -0
- package/dist/MultiProgressBar/MultiProgressBar.styles.js +92 -0
- package/dist/Newsletter/Newsletter.js +106 -0
- package/dist/Newsletter/Newsletter.stories.js +8 -0
- package/dist/Newsletter/Newsletter.styles.js +173 -0
- package/dist/NotificationContext/NotificationContext.js +126 -0
- package/dist/NotificationContext/NotificationContext.stories.js +32 -0
- package/dist/NotificationCounter/NotificationCounter.styles.js +23 -0
- package/dist/Number/Number.js +25 -0
- package/dist/Number/Number.stories.js +18 -0
- package/dist/Number/Number.styles.js +21 -0
- package/dist/PageTransition/PageTransition.js +42 -0
- package/dist/Process/Process.stories.js +34 -0
- package/dist/Process/Process.styles.js +87 -0
- package/dist/ProfileBadge/ProfileBadge.js +46 -0
- package/dist/ProfileBadge/ProfileBadge.stories.js +37 -0
- package/dist/ProfileBadge/ProfileBadge.styles.js +47 -0
- package/dist/ProfileBox/ProfileBox.js +29 -0
- package/dist/ProfileBox/ProfileBox.stories.js +27 -0
- package/dist/ProfileBox/ProfileBox.styles.js +60 -0
- package/dist/ProfileHeader/ProfileHeader-CLb4.js +401 -0
- package/dist/ProfileHeader/ProfileHeader.js +268 -0
- package/dist/ProfileHeader/ProfileHeader.styles.js +114 -0
- package/dist/ProfileStat/ProfileStat.js +32 -0
- package/dist/ProfileStat/ProfileStat.stories.js +58 -0
- package/dist/ProfileStat/ProfileStat.styles.js +80 -0
- package/dist/ProofOfAddress/ProofOfAddress.styles.js +76 -0
- package/dist/ROI/ROI.js +261 -0
- package/dist/ROI/ROI.styles.js +71 -0
- package/dist/ROI/ROIChart.js +348 -0
- package/dist/ROI/ROIChart.styles.js +98 -0
- package/dist/ROI/ROIModal.js +74 -0
- package/dist/ROI/ROIScenarioBox.js +46 -0
- package/dist/ROI/ROIScenarioBox.styles.js +131 -0
- package/dist/Radio/Radio.js +58 -0
- package/dist/Radio/Radio.stories.js +65 -0
- package/dist/Radio/Radio.styles.js +93 -0
- package/dist/RefreshButton/RefreshButton.js +14 -0
- package/dist/RefreshButton/RefreshButton.stories.js +29 -0
- package/dist/RefreshButton/RefreshButton.styles.js +57 -0
- package/dist/RegisterAlgorand/AlgoAddressName.js +103 -0
- package/dist/RegisterAlgorand/AlgoAdressSelect.js +274 -0
- package/dist/RegisterAlgorand/AlgoConnectWallet.js +37 -0
- package/dist/RegisterAlgorand/AlgoSuccess.js +28 -0
- package/dist/RegisterAlgorand/Algorand.stories.js +61 -0
- package/dist/RegisterAlgorand/ChooseWallet.js +77 -0
- package/dist/RegisterAlgorand/SelectProject.js +77 -0
- package/dist/RegisterAlgorand/_styles.js +30 -0
- package/dist/RegisterAlgorand/flow.js +243 -0
- package/dist/RegisterAlgorand/flowWithMemo.js +244 -0
- package/dist/RegisterAlgorand/index.js +7 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.js +30 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.stories.js +22 -0
- package/dist/RegisterConfirmModal/RegisterConfirmModal.styles.js +19 -0
- package/dist/RegisterEthereum/EthAddressLedger.js +151 -0
- package/dist/RegisterEthereum/EthAddressMetamask.js +165 -0
- package/dist/RegisterEthereum/EthAddressName.js +101 -0
- package/dist/RegisterEthereum/EthConnectLedger.js +117 -0
- package/dist/RegisterEthereum/EthConnectMetamask.js +25 -0
- package/dist/RegisterEthereum/EthFinish.js +32 -0
- package/dist/RegisterEthereum/EthIntro.js +77 -0
- package/dist/RegisterEthereum/_styles.js +30 -0
- package/dist/RegisterEthereum/index.js +9 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.js +75 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.stories.js +65 -0
- package/dist/RegisterLiquidSteps/RegisterLiquidSteps.styles.js +69 -0
- package/dist/RegisterLiquidSteps/assets/nav_green.svg +31 -0
- package/dist/RegisterLiquidSteps/assets/video.mp4 +0 -0
- package/dist/RegisterLiquidSteps/assets/videothumbnail.jpg +0 -0
- package/dist/RegisterLiquidSteps/complete.js +29 -0
- package/dist/RegisterLiquidSteps/flow.js +141 -0
- package/dist/RegisterLiquidSteps/index.js +29 -0
- package/dist/RegisterLiquidSteps/register-liquid.js +197 -0
- package/dist/RegisterModal/RegisterModal.js +143 -0
- package/dist/RegisterModal/RegisterModal.stories.js +35 -0
- package/dist/RequestDataBox/RequestDataBox.js +21 -0
- package/dist/RequestDataBox/RequestDataBox.stories.js +29 -0
- package/dist/RequestDataBox/RequestDataBox.styles.js +40 -0
- package/dist/RiskQuestionnaire/RiskQuestionnaireContext.js +111 -0
- package/dist/RiskQuestionnaire/_styles.js +6 -0
- package/dist/SEO/SEO.js +63 -0
- package/dist/SEO/SEO.stories.js +53 -0
- package/dist/SectionTitle/SectionTitle.styles.js +23 -0
- package/dist/SideLine/SideLine.js +4 -0
- package/dist/SideLine/SideLine.stories.js +20 -0
- package/dist/SideLine/SideLine.styles.js +29 -0
- package/dist/SigningSubflow/SignSubAddressMetamask.js +105 -0
- package/dist/SigningSubflow/SignSubConnectLedger.js +114 -0
- package/dist/SigningSubflow/SignSubConnectMetamask.js +101 -0
- package/dist/SigningSubflow/SignSubIntro.js +45 -0
- package/dist/SigningSubflow/SignSubSendLedger.js +114 -0
- package/dist/SigningSubflow/SignSubSendMetamask.js +53 -0
- package/dist/SigningSubflow/SignSubTransactionLedger.js +125 -0
- package/dist/SigningSubflow/SignSubTransactionMetamask.js +130 -0
- package/dist/SigningSubflow/_styles.js +59 -0
- package/dist/SigningSubflow/index.js +9 -0
- package/dist/Slider/Slider.js +43 -0
- package/dist/Slider/Slider.stories.js +63 -0
- package/dist/Slider/Slider.styles.js +115 -0
- package/dist/SpanButton/SpanButton.styles.js +14 -0
- package/dist/StatusBadge/StatusBadge.styles.js +16 -0
- package/dist/StepController/StepController.js +73 -0
- package/dist/StepController/StepController.stories.js +52 -0
- package/dist/StepController/StepController.styles.js +27 -0
- package/dist/StepController/StepControllerContext.js +61 -0
- package/dist/StepController/StepControllerProgress.js +28 -0
- package/dist/StepController/StepControllerProgress.stories.js +41 -0
- package/dist/StepsProgress/StepsProgress.js +95 -0
- package/dist/StepsProgress/StepsProgress.stories.js +23 -0
- package/dist/StepsProgress/StepsProgress.styles.js +97 -0
- package/dist/StokrLoader/StokrLoader.js +60 -0
- package/dist/StokrLoader/media.js +22 -0
- package/dist/StokrLoader/stokr_loader_white_400x400.gif +0 -0
- package/dist/SvgIcons/AdminBadgeSvg.js +16 -0
- package/dist/SvgIcons/CameraSvg.js +26 -0
- package/dist/SvgIcons/CapsLockSvg.js +21 -0
- package/dist/SvgIcons/DocumentBackSvg.js +25 -0
- package/dist/SvgIcons/DocumentSmallSvg.js +51 -0
- package/dist/SvgIcons/DocumentSvg.js +28 -0
- package/dist/SvgIcons/Early.js +14 -0
- package/dist/SvgIcons/EthSvg.js +30 -0
- package/dist/SvgIcons/EurSvg.js +16 -0
- package/dist/SvgIcons/FaceScanIconSvg.js +21 -0
- package/dist/SvgIcons/FourSvg.js +11 -0
- package/dist/SvgIcons/Glassess.js +19 -0
- package/dist/SvgIcons/Icons_Badge.png +0 -0
- package/dist/SvgIcons/LogoSvg.js +14 -0
- package/dist/SvgIcons/OneSvg.js +13 -0
- package/dist/SvgIcons/PassportSvg.js +46 -0
- package/dist/SvgIcons/RefreshSvg.js +17 -0
- package/dist/SvgIcons/SocialFacebook.js +15 -0
- package/dist/SvgIcons/SocialInstagram.js +15 -0
- package/dist/SvgIcons/SocialLinkedIn.js +15 -0
- package/dist/SvgIcons/SocialMedium.js +15 -0
- package/dist/SvgIcons/SocialReddit.js +15 -0
- package/dist/SvgIcons/SocialTelegram.js +15 -0
- package/dist/SvgIcons/SocialTwitter.js +15 -0
- package/dist/SvgIcons/SocialYoutube.js +15 -0
- package/dist/SvgIcons/ThreeSvg.js +10 -0
- package/dist/SvgIcons/TwoSidedDocumentSvg.js +72 -0
- package/dist/SvgIcons/TwoSvg.js +13 -0
- package/dist/SvgIcons/UpdateDefaultSvg.js +19 -0
- package/dist/SvgIcons/UpdateHardSvg.js +15 -0
- package/dist/SvgIcons/UpdateSoftSvg.js +17 -0
- package/dist/SvgIcons/UploadSvg.js +24 -0
- package/dist/SvgIcons/VerifiedBadge.js +13 -0
- package/dist/SvgIcons/index.js +32 -0
- package/dist/Switch/Switch.js +45 -0
- package/dist/Switch/Switch.stories.js +73 -0
- package/dist/Switch/Switch.styles.js +105 -0
- package/dist/Tabs/Tabs.js +48 -0
- package/dist/Tabs/Tabs.stories.js +28 -0
- package/dist/Tabs/Tabs.styles.js +11 -0
- package/dist/TabsNav/TabNav.js +21 -0
- package/dist/TabsNav/TabNav.stories.js +32 -0
- package/dist/TabsNav/TabsNav.js +23 -0
- package/dist/TabsNav/TabsNav.stories.js +25 -0
- package/dist/TabsNav/TabsNav.styles.js +80 -0
- package/dist/TeamOverview/TeamOverview.js +69 -0
- package/dist/TeamOverview/TeamOverview.stories.js +68 -0
- package/dist/TeamOverview/TeamOverview.styles.js +152 -0
- package/dist/Text/Headline.js +34 -0
- package/dist/Text/Headline.stories.js +40 -0
- package/dist/Text/StyledText.js +30 -0
- package/dist/Text/Text.stories.js +59 -0
- package/dist/Text/Text.styles.js +166 -0
- package/dist/TextLink/TextLink.styles.js +50 -0
- package/dist/ToDoList/ToDoList.js +172 -0
- package/dist/ToDoList/ToDoList.stories.js +123 -0
- package/dist/ToDoList/ToDoList.styles.js +115 -0
- package/dist/ToDoList/ToDoListTask.js +96 -0
- package/dist/ToDoList/ToDoListTask.stories.js +60 -0
- package/dist/ToDoList/ToDoListTask.styles.js +104 -0
- package/dist/TransactionDetails/TransactionDetails.js +27 -0
- package/dist/TransactionDetails/TransactionDetails.stories.js +47 -0
- package/dist/TransactionDetails/TransactionDetails.styles.js +31 -0
- package/dist/TransactionInfo/TransactionInfo.js +48 -0
- package/dist/TransactionInfo/TransactionInfo.stories.js +53 -0
- package/dist/TransactionInfo/TransactionInfo.styles.js +64 -0
- package/dist/TwoFactorModal/TwoFactorModal.js +84 -0
- package/dist/breakdown/Breakdown.js +124 -0
- package/dist/breakdown/index.js +2 -0
- package/dist/context/Auth.js +133 -0
- package/dist/context/AuthContext.js +154 -0
- package/dist/icons/Arrow.js +62 -0
- package/dist/icons/Arrow.stories.js +37 -0
- package/dist/icons/ArrowSimple.js +51 -0
- package/dist/icons/ArrowSimple.stories.js +41 -0
- package/dist/icons/Check.js +29 -0
- package/dist/icons/Check.stories.js +14 -0
- package/dist/icons/Facebook.js +15 -0
- package/dist/icons/Facebook.stories.js +15 -0
- package/dist/icons/Info.js +41 -0
- package/dist/icons/Info.stories.js +8 -0
- package/dist/icons/Instagram.js +15 -0
- package/dist/icons/Instagram.stories.js +15 -0
- package/dist/icons/LinkIcon.js +23 -0
- package/dist/icons/LinkIcon.stories.js +15 -0
- package/dist/icons/LinkedIn.js +29 -0
- package/dist/icons/LinkedIn.stories.js +8 -0
- package/dist/icons/Medium.js +28 -0
- package/dist/icons/Medium.stories.js +8 -0
- package/dist/icons/Reddit.js +18 -0
- package/dist/icons/Reddit.stories.js +15 -0
- package/dist/icons/Share.js +48 -0
- package/dist/icons/Share.stories.js +8 -0
- package/dist/icons/Telegram.js +28 -0
- package/dist/icons/Telegram.stories.js +8 -0
- package/dist/icons/Twitter.js +15 -0
- package/dist/icons/Twitter.stories.js +15 -0
- package/dist/icons/X.js +15 -0
- package/dist/icons/X.stories.js +8 -0
- package/dist/icons/Youtube.js +15 -0
- package/dist/icons/Youtube.stories.js +15 -0
- package/dist/icons/index.js +15 -0
- package/dist/index.js +177 -1
- package/dist/renderToBody/index.js +2 -0
- package/dist/renderToBody/renderToBody.js +26 -0
- package/dist/taxId/TaxId.stories.js +29 -0
- package/dist/taxId/complete.js +21 -0
- package/dist/taxId/flow.js +31 -0
- package/dist/taxId/index.js +4 -0
- package/dist/taxId/register-taxid.js +156 -0
- package/dist/video/Video.js +274 -0
- package/dist/video/Video.stories.js +45 -0
- package/dist/video/img/play-btn.svg +1 -0
- package/dist/video/index.js +2 -0
- package/package.json +128 -133
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/react-scripts +0 -0
- package/dist/07233f511246c9825a0d58e5ab2641f3.svg +0 -47
- package/dist/08418fc6c324f51f7e56.svg +0 -1
- package/dist/14aa35d4e84aebef77cf00b421fc393a.gif +0 -0
- package/dist/179ef2df02cb0b68c9fd.woff2 +0 -0
- package/dist/21e493d43617de76dbc7.woff2 +0 -0
- package/dist/2640959b1f9381cde047.eot +0 -0
- package/dist/2ba2db4ff86a2663686a100e75b50ba9.png +0 -0
- package/dist/311956ded96d3fd2813d.woff2 +0 -0
- package/dist/39f5961b2d3eb4aa5bf5.woff +0 -0
- package/dist/3caa0d4f9b7d58668066.woff2 +0 -0
- package/dist/4a510354f2f82b59fced805a8e3fe2bf.svg +0 -1
- package/dist/4c3c428d0ce82f840710.woff +0 -0
- package/dist/4e528d6445ca1974c313.woff +0 -0
- package/dist/55053cc0a8e6482eca64.ttf +0 -0
- package/dist/643c37f102b41f7f90c3.woff2 +0 -0
- package/dist/76dd0ed9c3f137513fd4.svg +0 -1
- package/dist/81f3ef07b7952e249da1.woff +0 -0
- package/dist/98b7d3182f652f021bc3.ttf +0 -0
- package/dist/9bea22b57dc165ed4382.ttf +0 -0
- package/dist/9ec738fbb66068dc1ca7.woff +0 -0
- package/dist/a1d7666a48f976227722.ttf +0 -0
- package/dist/a750292d6a0b5a760679.woff +0 -0
- package/dist/b85a961d44cc55c58050cbf7c53dd505.png +0 -0
- package/dist/bcb6531cf820152b7538.ttf +0 -0
- package/dist/c6a4bc1bd034d6303053.woff +0 -0
- package/dist/cbfc24090ef8bacab132.woff2 +0 -0
- package/dist/d2b1865643b98c0e8b54.ttf +0 -0
- package/dist/d97d7385fe8771611848.ttf +0 -0
- package/dist/index.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import Matomo from 'components/MatomoConnect/Matomo';
|
|
2
|
+
import * as Moment from 'moment';
|
|
3
|
+
const matomoConnect = new Matomo();
|
|
4
|
+
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
5
|
+
const monthsShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6
|
+
export class Analytic {
|
|
7
|
+
CURRENT_DATE;
|
|
8
|
+
START_DATE;
|
|
9
|
+
VISITS_SUMMARY = {};
|
|
10
|
+
TOTAL_SUMMARY = {};
|
|
11
|
+
constructor() {
|
|
12
|
+
this.CURRENT_DATE = new Moment();
|
|
13
|
+
this.START_DATE = this.CURRENT_DATE.clone().subtract(2, 'months');
|
|
14
|
+
this.getSummary();
|
|
15
|
+
}
|
|
16
|
+
async getSummary() {
|
|
17
|
+
this.TOTAL_SUMMARY = {
|
|
18
|
+
visits: 0,
|
|
19
|
+
bounce_count: 0,
|
|
20
|
+
visit_length: 0,
|
|
21
|
+
unique_visitors: 0,
|
|
22
|
+
avg_time_on_site: 0
|
|
23
|
+
};
|
|
24
|
+
this.VISITS_SUMMARY = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'month', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
25
|
+
console.log('visits summary: ', this.VISITS_SUMMARY);
|
|
26
|
+
Object.keys(this.VISITS_SUMMARY).forEach(key => {
|
|
27
|
+
this.TOTAL_SUMMARY.visits += this.VISITS_SUMMARY[key].nb_visits || 0;
|
|
28
|
+
this.TOTAL_SUMMARY.bounce_count += this.VISITS_SUMMARY[key].bounce_count || 0;
|
|
29
|
+
this.TOTAL_SUMMARY.visit_length += this.VISITS_SUMMARY[key].sum_visit_length || 0;
|
|
30
|
+
this.TOTAL_SUMMARY.unique_visitors += this.VISITS_SUMMARY[key].nb_uniq_visitors || 0;
|
|
31
|
+
this.TOTAL_SUMMARY.avg_time_on_site += this.VISITS_SUMMARY[key].avg_time_on_site || 0;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
static async getRealTimeUsersBasicGraph() {
|
|
35
|
+
const lastMinute = await matomoConnect.init(matomoConnect.LiveGetCounters, 10, 'visitors');
|
|
36
|
+
const lastHour = await matomoConnect.init(matomoConnect.LiveGetCounters, 60, 'visitors');
|
|
37
|
+
const last2Hours = await matomoConnect.init(matomoConnect.LiveGetCounters, 120, 'visitors');
|
|
38
|
+
const increase = Analytic.getIncrease(last2Hours, lastMinute);
|
|
39
|
+
const object = {
|
|
40
|
+
id: 'realTimeUsersStat',
|
|
41
|
+
title: 'realtime users',
|
|
42
|
+
value: lastMinute.toString(),
|
|
43
|
+
percent: isNaN(increase) ? 0 : parseFloat(parseFloat(increase).toFixed(1)),
|
|
44
|
+
chart: {
|
|
45
|
+
id: 'realTimeUsersChart',
|
|
46
|
+
fill: '#e4ecf9',
|
|
47
|
+
stroke: '#0050ca',
|
|
48
|
+
data: [{
|
|
49
|
+
date: 1,
|
|
50
|
+
value: last2Hours
|
|
51
|
+
}, {
|
|
52
|
+
date: 2,
|
|
53
|
+
value: lastHour
|
|
54
|
+
}, {
|
|
55
|
+
date: 3,
|
|
56
|
+
value: lastMinute
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return object;
|
|
61
|
+
}
|
|
62
|
+
async getBasicGraphs() {
|
|
63
|
+
return [this.getTotalVisitsBasicGraph(), this.getBounceRateBasicGraph(), this.getVisitDurationBasicGraph()];
|
|
64
|
+
}
|
|
65
|
+
getTotalVisitsBasicGraph() {
|
|
66
|
+
const totalVisitsChartData = [];
|
|
67
|
+
Object.keys(this.VISITS_SUMMARY).forEach(key => {
|
|
68
|
+
totalVisitsChartData.push({
|
|
69
|
+
date: totalVisitsChartData.length + 1,
|
|
70
|
+
value: this.VISITS_SUMMARY[key].nb_visits ? this.VISITS_SUMMARY[key].nb_visits : 0
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
|
|
74
|
+
const previousMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 2]];
|
|
75
|
+
const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
|
|
76
|
+
const totalVisitsIncrease = Analytic.getIncrease(previousMonth && previousMonth.nb_visits ? previousMonth.nb_visits : 0, lastMonth && lastMonth.nb_visits ? lastMonth.nb_visits : 0);
|
|
77
|
+
return {
|
|
78
|
+
id: 'totalVisitsStat',
|
|
79
|
+
title: 'total visits',
|
|
80
|
+
value: this.TOTAL_SUMMARY.visits.toString(),
|
|
81
|
+
percent: isNaN(totalVisitsIncrease) ? 0 : parseFloat(parseFloat(totalVisitsIncrease).toFixed(1)),
|
|
82
|
+
chart: {
|
|
83
|
+
id: 'totalVisitsGraph',
|
|
84
|
+
fill: '#fee8e8',
|
|
85
|
+
stroke: '#ee220d',
|
|
86
|
+
data: totalVisitsChartData
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
getBounceRateBasicGraph() {
|
|
91
|
+
const bounceRateData = [];
|
|
92
|
+
Object.keys(this.VISITS_SUMMARY).forEach(key => {
|
|
93
|
+
bounceRateData.push({
|
|
94
|
+
date: bounceRateData.length + 1,
|
|
95
|
+
value: this.VISITS_SUMMARY[key].bounce_count ? this.VISITS_SUMMARY[key].bounce_count : 0
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
|
|
99
|
+
const firstMonth = this.VISITS_SUMMARY[visitsSummaryKeys.shift()];
|
|
100
|
+
const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
|
|
101
|
+
const bounceRateIncrease = Analytic.getIncrease(firstMonth && firstMonth.bounce_count ? firstMonth.bounce_count : 0, lastMonth && lastMonth.bounce_count ? lastMonth.bounce_count : 0);
|
|
102
|
+
const bounceRate = Analytic.getPercent(this.TOTAL_SUMMARY.bounce_count, this.TOTAL_SUMMARY.visits);
|
|
103
|
+
return {
|
|
104
|
+
id: 'bounceRateStat',
|
|
105
|
+
title: 'bounce rate',
|
|
106
|
+
value: `${bounceRate}%`,
|
|
107
|
+
percent: isNaN(bounceRateIncrease) ? 0 : parseFloat(parseFloat(bounceRateIncrease).toFixed(1)),
|
|
108
|
+
chart: {
|
|
109
|
+
id: 'bounceRateGraph',
|
|
110
|
+
fill: '#eff8ec',
|
|
111
|
+
stroke: '#69bd53',
|
|
112
|
+
data: bounceRateData
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
getVisitDurationBasicGraph() {
|
|
117
|
+
const visitDurationData = [];
|
|
118
|
+
Object.keys(this.VISITS_SUMMARY).forEach(key => {
|
|
119
|
+
visitDurationData.push({
|
|
120
|
+
date: visitDurationData.length + 1,
|
|
121
|
+
value: this.VISITS_SUMMARY[key].avg_time_on_site ? this.VISITS_SUMMARY[key].avg_time_on_site : 0
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
const visitsSummaryKeys = Object.keys(this.VISITS_SUMMARY);
|
|
125
|
+
const firstMonth = this.VISITS_SUMMARY[visitsSummaryKeys.shift()];
|
|
126
|
+
const lastMonth = this.VISITS_SUMMARY[visitsSummaryKeys[visitsSummaryKeys.length - 1]];
|
|
127
|
+
const visitDurationIncrease = Analytic.getIncrease(firstMonth && firstMonth.avg_time_on_site ? firstMonth.avg_time_on_site : 0, lastMonth && lastMonth.avg_time_on_site ? lastMonth.avg_time_on_site : 0);
|
|
128
|
+
const value = new Moment().startOf('day').seconds(this.TOTAL_SUMMARY.avg_time_on_site);
|
|
129
|
+
return {
|
|
130
|
+
id: 'visitDurationStat',
|
|
131
|
+
title: 'avg. visit duration',
|
|
132
|
+
value: Analytic.getTimeSpent(value),
|
|
133
|
+
percent: isNaN(visitDurationIncrease) ? 0 : parseFloat(parseFloat(visitDurationIncrease).toFixed(1)),
|
|
134
|
+
chart: {
|
|
135
|
+
id: 'visitDurationGraph',
|
|
136
|
+
fill: '#f0f0f0',
|
|
137
|
+
stroke: '#2f2f2f',
|
|
138
|
+
data: visitDurationData
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
async getCountryGraph() {
|
|
143
|
+
const graphData = [];
|
|
144
|
+
const countries = await matomoConnect.init(matomoConnect.GetCountrySummary, 'range', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
145
|
+
const countriesByMonth = await matomoConnect.init(matomoConnect.GetCountrySummary, 'month', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
146
|
+
countries.forEach((value, key) => {
|
|
147
|
+
const bounceRateData = [];
|
|
148
|
+
let bounceRate = value.bounce_count * 100 / value.nb_visits;
|
|
149
|
+
bounceRate = parseFloat(bounceRate).toFixed(2);
|
|
150
|
+
Object.keys(countriesByMonth).forEach(byMonthKey => {
|
|
151
|
+
const object = {
|
|
152
|
+
date: bounceRateData.length + 1
|
|
153
|
+
};
|
|
154
|
+
countriesByMonth[byMonthKey].forEach(cv => {
|
|
155
|
+
if (cv.code === value.code) {
|
|
156
|
+
object.value = cv && cv.bounce_count ? cv.bounce_count : 0;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
if (!object.value) {
|
|
160
|
+
object.value = 0;
|
|
161
|
+
}
|
|
162
|
+
bounceRateData.push(object);
|
|
163
|
+
});
|
|
164
|
+
graphData.push({
|
|
165
|
+
id: key,
|
|
166
|
+
country: value.code,
|
|
167
|
+
country_name: value.label,
|
|
168
|
+
visits: value.nb_visits,
|
|
169
|
+
unique_visitors: value.sum_daily_nb_uniq_visitors,
|
|
170
|
+
flag_url: `${matomoConnect.MATOMO_API_URL}/${value.logo}`,
|
|
171
|
+
bounce_rate: `${bounceRate}%`,
|
|
172
|
+
chart: {
|
|
173
|
+
id: `countryChart${key}`,
|
|
174
|
+
fill: '#E4ECF9',
|
|
175
|
+
stroke: '#0050CA',
|
|
176
|
+
data: bounceRateData
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
return graphData;
|
|
181
|
+
}
|
|
182
|
+
async getSocialGraph() {
|
|
183
|
+
const graphData = [];
|
|
184
|
+
const socials = await matomoConnect.init(matomoConnect.GetSocialSummary, 'range', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
185
|
+
socials.forEach((value, key) => {
|
|
186
|
+
let progress = value.sum_daily_nb_uniq_visitors * 100 / this.TOTAL_SUMMARY.unique_visitors;
|
|
187
|
+
progress = parseFloat(progress).toFixed(2);
|
|
188
|
+
graphData.push({
|
|
189
|
+
id: key,
|
|
190
|
+
network: `${value.label.charAt(0).toUpperCase()}${value.label.slice(1)}`,
|
|
191
|
+
visitors: value.sum_daily_nb_uniq_visitors,
|
|
192
|
+
progress: parseFloat(progress)
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
return graphData;
|
|
196
|
+
}
|
|
197
|
+
async getDeviceGraph() {
|
|
198
|
+
const devices = await matomoConnect.init(matomoConnect.GetDeviceOsFamilies, 'range', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
199
|
+
const browsers = await matomoConnect.init(matomoConnect.GetDeviceBrowsers, 'range', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
200
|
+
const models = await matomoConnect.init(matomoConnect.GetDeviceModels, 'range', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
201
|
+
let desktop = 0;
|
|
202
|
+
let android = 0;
|
|
203
|
+
let ios = 0;
|
|
204
|
+
let other = 0;
|
|
205
|
+
let total = 0;
|
|
206
|
+
devices.forEach((value, key) => {
|
|
207
|
+
if (value.label === 'Android') {
|
|
208
|
+
android += value.nb_visits;
|
|
209
|
+
}
|
|
210
|
+
if (value.label === 'iOS') {
|
|
211
|
+
ios += value.nb_visits;
|
|
212
|
+
}
|
|
213
|
+
if (value.label === 'Windows' || value.label === 'Mac' || value.label === 'GNU/Linux') {
|
|
214
|
+
desktop += value.nb_visits;
|
|
215
|
+
}
|
|
216
|
+
if (!['Windows', 'Mac', 'GNU/Linux', 'Android', 'iOS'].includes(value.label)) {
|
|
217
|
+
other += value.nb_visits;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
total = android + ios + desktop + other;
|
|
221
|
+
const donutChart = [{
|
|
222
|
+
name: 'Android',
|
|
223
|
+
value: android,
|
|
224
|
+
color: '#0050CA'
|
|
225
|
+
}, {
|
|
226
|
+
name: 'Other',
|
|
227
|
+
value: other,
|
|
228
|
+
color: '#69BD53'
|
|
229
|
+
}, {
|
|
230
|
+
name: 'IOS',
|
|
231
|
+
value: ios,
|
|
232
|
+
color: '#CEDDF5'
|
|
233
|
+
}, {
|
|
234
|
+
name: 'Desktop',
|
|
235
|
+
value: desktop,
|
|
236
|
+
color: '#EE220D'
|
|
237
|
+
}];
|
|
238
|
+
const deviceData = {
|
|
239
|
+
Android: {
|
|
240
|
+
percent: Analytic.getPercent(android, total),
|
|
241
|
+
value: android
|
|
242
|
+
},
|
|
243
|
+
iOS: {
|
|
244
|
+
percent: Analytic.getPercent(ios, total),
|
|
245
|
+
value: ios
|
|
246
|
+
},
|
|
247
|
+
Desktop: {
|
|
248
|
+
percent: Analytic.getPercent(desktop, total),
|
|
249
|
+
value: desktop
|
|
250
|
+
},
|
|
251
|
+
Other: {
|
|
252
|
+
percent: Analytic.getPercent(other, total),
|
|
253
|
+
value: other
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const desktopBrowsers = [];
|
|
257
|
+
let desktopBrowsersTotal = 0;
|
|
258
|
+
browsers.forEach((value, key) => {
|
|
259
|
+
if (['Chrome', 'Firefox', 'Safari', 'Opera', 'Internet Explorer', 'Microsoft Edge', 'Vivaldi'].includes(value.label)) {
|
|
260
|
+
desktopBrowsersTotal += value.nb_visits;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
browsers.forEach((value, key) => {
|
|
264
|
+
if (['Chrome', 'Firefox', 'Safari', 'Opera', 'Internet Explorer', 'Microsoft Edge', 'Vivaldi'].includes(value.label)) {
|
|
265
|
+
desktopBrowsers.push({
|
|
266
|
+
label: value.label,
|
|
267
|
+
value: `${value.nb_visits} (${Analytic.getPercent(value.nb_visits, desktopBrowsersTotal)}%)`
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
const iosModels = [];
|
|
272
|
+
let iosTotal = 0;
|
|
273
|
+
const androidModels = [];
|
|
274
|
+
let androidTotal = 0;
|
|
275
|
+
models.forEach((value, key) => {
|
|
276
|
+
if (!value.label.includes('Generic') && value.label.includes('Apple')) {
|
|
277
|
+
iosTotal += value.nb_visits;
|
|
278
|
+
}
|
|
279
|
+
if (!value.label.includes('Generic') && !value.label.includes('Apple')) {
|
|
280
|
+
androidTotal += value.nb_visits;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
models.forEach((value, key) => {
|
|
284
|
+
if (!value.label.includes('Generic') && value.label.includes('Apple')) {
|
|
285
|
+
iosModels.push({
|
|
286
|
+
label: value.label,
|
|
287
|
+
value: `${value.nb_visits} (${Analytic.getPercent(value.nb_visits, iosTotal)}%)`
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (!value.label.includes('Generic') && !value.label.includes('Apple')) {
|
|
291
|
+
androidModels.push({
|
|
292
|
+
label: value.label,
|
|
293
|
+
value: `${value.nb_visits} (${Analytic.getPercent(value.nb_visits, androidTotal)}%)`
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
return {
|
|
298
|
+
donutChart,
|
|
299
|
+
deviceData,
|
|
300
|
+
desktopBrowsers,
|
|
301
|
+
iosModels,
|
|
302
|
+
androidModels
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
async getMonthSlider() {
|
|
306
|
+
const response = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'day', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
307
|
+
const data = [];
|
|
308
|
+
Object.keys(response).forEach(key => {
|
|
309
|
+
const month = key.split('-');
|
|
310
|
+
let check = false;
|
|
311
|
+
data.forEach((value, k) => {
|
|
312
|
+
if (value.title === `${months[parseInt(month[1], 10) - 1]} ${month[0]}`) {
|
|
313
|
+
check = true;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
if (!check) {
|
|
317
|
+
data.push({
|
|
318
|
+
title: `${months[parseInt(month[1], 10) - 1]} ${month[0]}`,
|
|
319
|
+
values: [],
|
|
320
|
+
total: 0
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
data.forEach((value, k) => {
|
|
324
|
+
if (value.title === `${months[parseInt(month[1], 10) - 1]} ${month[0]}`) {
|
|
325
|
+
value.values.push({
|
|
326
|
+
name: key.split('-')[2],
|
|
327
|
+
value: response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0
|
|
328
|
+
});
|
|
329
|
+
value.total += response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
return data.reverse();
|
|
334
|
+
}
|
|
335
|
+
async getYearSlider() {
|
|
336
|
+
const data = [];
|
|
337
|
+
const response = await this.getMonthSlider();
|
|
338
|
+
response && response.reverse().forEach(month => {
|
|
339
|
+
const year = month.title.split(' ');
|
|
340
|
+
let check = false;
|
|
341
|
+
data.forEach((value, k) => {
|
|
342
|
+
if (value.title === `${year[1]}`) {
|
|
343
|
+
check = true;
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
if (!check) {
|
|
347
|
+
data.push({
|
|
348
|
+
title: `${year[1]}`,
|
|
349
|
+
values: []
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
data.forEach((value, k) => {
|
|
353
|
+
if (value.title === `${year[1]}`) {
|
|
354
|
+
value.values.push({
|
|
355
|
+
name: `${year[0]}`,
|
|
356
|
+
value: month.total || 0
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
return data.reverse();
|
|
362
|
+
}
|
|
363
|
+
async getWeekSlider() {
|
|
364
|
+
const response = await matomoConnect.init(matomoConnect.GetVisitsSummary, 'day', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
365
|
+
const data = [];
|
|
366
|
+
Object.keys(response).forEach(key => {
|
|
367
|
+
const startOfWeek = Moment(key).startOf('isoWeek');
|
|
368
|
+
const endOfWeek = Moment(key).endOf('isoWeek');
|
|
369
|
+
const slicedStartOfWeek = startOfWeek.toString().slice(4, 10); //15)
|
|
370
|
+
const slicedEndOfWeek = endOfWeek.toString().slice(4, 10); //15)
|
|
371
|
+
|
|
372
|
+
const day = Moment(key).format('ddd');
|
|
373
|
+
let check = false;
|
|
374
|
+
data.forEach((value, k) => {
|
|
375
|
+
if (value.title === `${slicedStartOfWeek} - ${slicedEndOfWeek}`) {
|
|
376
|
+
check = true;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
if (!check) {
|
|
380
|
+
data.push({
|
|
381
|
+
title: `${slicedStartOfWeek} - ${slicedEndOfWeek}`,
|
|
382
|
+
values: []
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
data.forEach((value, k) => {
|
|
386
|
+
if (value.title === `${slicedStartOfWeek} - ${slicedEndOfWeek}`) {
|
|
387
|
+
value.values.push({
|
|
388
|
+
name: day,
|
|
389
|
+
value: response[key].nb_uniq_visitors ? response[key].nb_uniq_visitors : 0
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
return data.reverse();
|
|
395
|
+
}
|
|
396
|
+
async getHeatmap() {
|
|
397
|
+
const periods = {
|
|
398
|
+
'00': {
|
|
399
|
+
value: '12AM'
|
|
400
|
+
},
|
|
401
|
+
'01': {
|
|
402
|
+
value: '1AM'
|
|
403
|
+
},
|
|
404
|
+
'02': {
|
|
405
|
+
value: '2AM'
|
|
406
|
+
},
|
|
407
|
+
'03': {
|
|
408
|
+
value: '3AM'
|
|
409
|
+
},
|
|
410
|
+
'04': {
|
|
411
|
+
value: '4AM'
|
|
412
|
+
},
|
|
413
|
+
'05': {
|
|
414
|
+
value: '5AM'
|
|
415
|
+
},
|
|
416
|
+
'06': {
|
|
417
|
+
value: '6AM'
|
|
418
|
+
},
|
|
419
|
+
'07': {
|
|
420
|
+
value: '7AM'
|
|
421
|
+
},
|
|
422
|
+
'08': {
|
|
423
|
+
value: '8AM'
|
|
424
|
+
},
|
|
425
|
+
'09': {
|
|
426
|
+
value: '9AM'
|
|
427
|
+
},
|
|
428
|
+
10: {
|
|
429
|
+
value: '10AM'
|
|
430
|
+
},
|
|
431
|
+
11: {
|
|
432
|
+
value: '11AM'
|
|
433
|
+
},
|
|
434
|
+
12: {
|
|
435
|
+
value: '12PM'
|
|
436
|
+
},
|
|
437
|
+
13: {
|
|
438
|
+
value: '1PM'
|
|
439
|
+
},
|
|
440
|
+
14: {
|
|
441
|
+
value: '2PM'
|
|
442
|
+
},
|
|
443
|
+
15: {
|
|
444
|
+
value: '3PM'
|
|
445
|
+
},
|
|
446
|
+
16: {
|
|
447
|
+
value: '4PM'
|
|
448
|
+
},
|
|
449
|
+
17: {
|
|
450
|
+
value: '5PM'
|
|
451
|
+
},
|
|
452
|
+
18: {
|
|
453
|
+
value: '6PM'
|
|
454
|
+
},
|
|
455
|
+
19: {
|
|
456
|
+
value: '7PM'
|
|
457
|
+
},
|
|
458
|
+
20: {
|
|
459
|
+
value: '8PM'
|
|
460
|
+
},
|
|
461
|
+
21: {
|
|
462
|
+
value: '9PM'
|
|
463
|
+
},
|
|
464
|
+
22: {
|
|
465
|
+
value: '10PM'
|
|
466
|
+
},
|
|
467
|
+
23: {
|
|
468
|
+
value: '11PM'
|
|
469
|
+
},
|
|
470
|
+
24: {
|
|
471
|
+
value: '12PM'
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
const uniqueData = {};
|
|
475
|
+
const response = await matomoConnect.init(matomoConnect.GetVisitTimePerLocalTime, 'day', `${this.START_DATE.format('YYYY-MM-DD')},${this.CURRENT_DATE.format('YYYY-MM-DD')}`);
|
|
476
|
+
Object.keys(response).forEach(key => {
|
|
477
|
+
const time = new Moment(key);
|
|
478
|
+
response[key].forEach((hour, k) => {
|
|
479
|
+
const day = time.format('ddd').toUpperCase();
|
|
480
|
+
const uniqueId = `${day}-${hour.label}`;
|
|
481
|
+
if (uniqueData[uniqueId] !== undefined) {
|
|
482
|
+
const datum = uniqueData[uniqueId];
|
|
483
|
+
// calculate an average value for all redundant data
|
|
484
|
+
datum.value = (datum.dataCount * datum.value + hour.nb_uniq_visitors) / (datum.dataCount + 1);
|
|
485
|
+
datum.dataCount += 1;
|
|
486
|
+
} else {
|
|
487
|
+
uniqueData[uniqueId] = {
|
|
488
|
+
group: day,
|
|
489
|
+
variable: periods[hour.label].value,
|
|
490
|
+
value: hour.nb_uniq_visitors,
|
|
491
|
+
dataCount: 1
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
const data = Object.keys(uniqueData).map(uniqueId => {
|
|
497
|
+
const datum = uniqueData[uniqueId];
|
|
498
|
+
return {
|
|
499
|
+
group: datum.group,
|
|
500
|
+
variable: datum.variable,
|
|
501
|
+
value: datum.value
|
|
502
|
+
};
|
|
503
|
+
});
|
|
504
|
+
return data;
|
|
505
|
+
}
|
|
506
|
+
static getPercent(number, total) {
|
|
507
|
+
let percent = number * 100 / total;
|
|
508
|
+
percent = parseFloat(percent).toFixed(2);
|
|
509
|
+
return isNaN(parseFloat(percent)) ? 0 : parseFloat(percent);
|
|
510
|
+
}
|
|
511
|
+
static getIncrease(min = 0, max = 0) {
|
|
512
|
+
let increase = max - min;
|
|
513
|
+
increase = increase / min * 100;
|
|
514
|
+
return increase === Infinity && increase > 100 ? 100 : increase;
|
|
515
|
+
}
|
|
516
|
+
static getTimeSpent(value) {
|
|
517
|
+
let hours = '';
|
|
518
|
+
let minutes = '';
|
|
519
|
+
if (value.format('H') !== 0) {
|
|
520
|
+
hours = `${value.format('H')}h `;
|
|
521
|
+
}
|
|
522
|
+
if (value.format('m') !== 0) {
|
|
523
|
+
minutes = `${value.format('m')}m `;
|
|
524
|
+
}
|
|
525
|
+
return `${hours}${minutes}${value.format('s')}s`;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
export default Analytic;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import styled from 'styled-components/macro';
|
|
2
|
+
import ComponentWrapper from 'components/ComponentWrapper/ComponentWrapper.styles';
|
|
3
|
+
import theme from 'styles/theme';
|
|
4
|
+
const colorTheme = props => ({
|
|
5
|
+
blue: {
|
|
6
|
+
primary: theme.cPrimary,
|
|
7
|
+
dark: theme.cPrimaryDark
|
|
8
|
+
},
|
|
9
|
+
red: {
|
|
10
|
+
primary: theme.cWarning,
|
|
11
|
+
dark: theme.cWarningDark
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export const ChartContainer = styled(ComponentWrapper)`
|
|
15
|
+
.slick-arrow {
|
|
16
|
+
width: 64px;
|
|
17
|
+
height: 48px;
|
|
18
|
+
background: ${props => colorTheme(props)[props.colorTheme].primary};
|
|
19
|
+
z-index: 10;
|
|
20
|
+
transition: 0.3s ease background;
|
|
21
|
+
margin-top: 10px;
|
|
22
|
+
&:hover,
|
|
23
|
+
&:focus {
|
|
24
|
+
background: ${props => colorTheme(props)[props.colorTheme].dark};
|
|
25
|
+
|
|
26
|
+
&::before {
|
|
27
|
+
color: ${props => theme.cWhite} !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.slick-arrow.slick-prev {
|
|
33
|
+
top: auto;
|
|
34
|
+
left: auto;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
right: 64px;
|
|
37
|
+
transform: translateY(100%);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.slick-arrow.slick-next {
|
|
41
|
+
top: auto;
|
|
42
|
+
left: auto;
|
|
43
|
+
bottom: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
transform: translateY(100%);
|
|
46
|
+
border-left: 1px solid ${props => colorTheme(props)[props.colorTheme].dark};
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
export default ChartContainer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { StyledBackButton, StyledBackButtonExternal, StyledWindowBackButton, BackButtonIcon } from './BackButton.styles';
|
|
4
|
+
export const BackButton = ({
|
|
5
|
+
children,
|
|
6
|
+
to,
|
|
7
|
+
href
|
|
8
|
+
}) => {
|
|
9
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, href ? /*#__PURE__*/React.createElement(StyledBackButtonExternal, {
|
|
10
|
+
href: href
|
|
11
|
+
}, /*#__PURE__*/React.createElement(BackButtonIcon, null), children) : to ? /*#__PURE__*/React.createElement(StyledBackButton, {
|
|
12
|
+
to: to
|
|
13
|
+
}, /*#__PURE__*/React.createElement(BackButtonIcon, null), children) : /*#__PURE__*/React.createElement(StyledWindowBackButton, {
|
|
14
|
+
onClick: () => window.history.back()
|
|
15
|
+
}, /*#__PURE__*/React.createElement(BackButtonIcon, null), children));
|
|
16
|
+
};
|
|
17
|
+
BackButton.propTypes = {
|
|
18
|
+
children: PropTypes.node.isRequired,
|
|
19
|
+
to: PropTypes.string,
|
|
20
|
+
href: PropTypes.string
|
|
21
|
+
};
|
|
22
|
+
export default BackButton;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BackButton } from './BackButton';
|
|
3
|
+
import { ComponentWrapper } from '../ComponentWrapper/ComponentWrapper.styles';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components Library/Buttons/BackButton',
|
|
6
|
+
component: BackButton,
|
|
7
|
+
argTypes: {
|
|
8
|
+
children: {
|
|
9
|
+
type: 'node',
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
to: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
},
|
|
15
|
+
href: {
|
|
16
|
+
type: 'string'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const Template = args => /*#__PURE__*/React.createElement(ComponentWrapper, null, /*#__PURE__*/React.createElement(BackButton, args));
|
|
21
|
+
export const BackButtonDefault = Template.bind({});
|
|
22
|
+
BackButtonDefault.args = {};
|
|
23
|
+
|
|
24
|
+
//back button by default links to any page visited before
|