@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,122 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { CapsLockSvg } from 'components/SvgIcons';
|
|
4
|
+
import InfoIcon from 'components/InfoIcon/InfoIcon';
|
|
5
|
+
import { Wrapper, Label, InputWrap } from './Input.styles';
|
|
6
|
+
import { ShowPassword, BottomWrap, CapslockIndicator, PasswordStrengthIndicators, PasswordStrengthIndicator, PasswordStrengthWrap, PasswordStrengthText, InfoIconWrapper } from './InputPassword.styles';
|
|
7
|
+
export const PasswordStrength = {
|
|
8
|
+
NONE: 'none',
|
|
9
|
+
WEAK: 'Weak',
|
|
10
|
+
MEDIUM: 'Average',
|
|
11
|
+
STRONG: 'Excellent'
|
|
12
|
+
};
|
|
13
|
+
export const InputPassword = props => {
|
|
14
|
+
const {
|
|
15
|
+
label,
|
|
16
|
+
id,
|
|
17
|
+
name,
|
|
18
|
+
value,
|
|
19
|
+
error,
|
|
20
|
+
touched,
|
|
21
|
+
info,
|
|
22
|
+
showStrength
|
|
23
|
+
} = props;
|
|
24
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
25
|
+
const [isCapslockOn, setIsCapslockOn] = useState(false);
|
|
26
|
+
const [labelUp, setLabelUp] = useState(!!value);
|
|
27
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setLabelUp(hasFocus || !!value);
|
|
30
|
+
}, [hasFocus, value]);
|
|
31
|
+
const togglePasswordVisibility = () => {
|
|
32
|
+
setIsPasswordVisible(!isPasswordVisible);
|
|
33
|
+
};
|
|
34
|
+
const handleCapslock = e => {
|
|
35
|
+
setIsCapslockOn(e.getModifierState('CapsLock'));
|
|
36
|
+
};
|
|
37
|
+
const onFocus = (e, field) => {
|
|
38
|
+
props.onFocus && props.onFocus(e, field);
|
|
39
|
+
setHasFocus(true);
|
|
40
|
+
};
|
|
41
|
+
const onBlur = (e, field) => {
|
|
42
|
+
if (props.onBlur) props.onBlur(e, field);
|
|
43
|
+
setHasFocus(false);
|
|
44
|
+
};
|
|
45
|
+
const onChange = (e, field) => {
|
|
46
|
+
props.onChange && props.onChange(e, field);
|
|
47
|
+
};
|
|
48
|
+
const passwordStrengthFunction = () => {
|
|
49
|
+
if (value.length === 0) {
|
|
50
|
+
return PasswordStrength.NONE;
|
|
51
|
+
}
|
|
52
|
+
if (value.length < 6) {
|
|
53
|
+
return PasswordStrength.WEAK;
|
|
54
|
+
}
|
|
55
|
+
if (value.length < 11) {
|
|
56
|
+
return PasswordStrength.MEDIUM;
|
|
57
|
+
}
|
|
58
|
+
return PasswordStrength.STRONG;
|
|
59
|
+
};
|
|
60
|
+
const passwordStrength = passwordStrengthFunction();
|
|
61
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, label && /*#__PURE__*/React.createElement(Label, {
|
|
62
|
+
isUp: labelUp,
|
|
63
|
+
active: hasFocus,
|
|
64
|
+
error: error && touched,
|
|
65
|
+
htmlFor: id
|
|
66
|
+
}, label), /*#__PURE__*/React.createElement(InputWrap, {
|
|
67
|
+
error: error && touched
|
|
68
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
69
|
+
type: isPasswordVisible ? 'text' : 'password',
|
|
70
|
+
id: id,
|
|
71
|
+
name: name,
|
|
72
|
+
value: value,
|
|
73
|
+
onChange: onChange,
|
|
74
|
+
onBlur: onBlur,
|
|
75
|
+
onFocus: onFocus,
|
|
76
|
+
onKeyUp: handleCapslock,
|
|
77
|
+
onKeyDown: handleCapslock
|
|
78
|
+
})), /*#__PURE__*/React.createElement(ShowPassword, {
|
|
79
|
+
onClick: togglePasswordVisibility
|
|
80
|
+
}, isPasswordVisible ? /*#__PURE__*/React.createElement("i", {
|
|
81
|
+
className: "ion ion-md-eye-off"
|
|
82
|
+
}) : /*#__PURE__*/React.createElement("i", {
|
|
83
|
+
className: "ion ion-md-eye"
|
|
84
|
+
})), /*#__PURE__*/React.createElement(BottomWrap, null, showStrength ? /*#__PURE__*/React.createElement(PasswordStrengthWrap, null, /*#__PURE__*/React.createElement(PasswordStrengthIndicators, {
|
|
85
|
+
passwordStrength: passwordStrength
|
|
86
|
+
}, /*#__PURE__*/React.createElement(PasswordStrengthIndicator, null), /*#__PURE__*/React.createElement(PasswordStrengthIndicator, null), /*#__PURE__*/React.createElement(PasswordStrengthIndicator, null)), info && /*#__PURE__*/React.createElement(InfoIconWrapper, null, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
87
|
+
position: "bottom",
|
|
88
|
+
title: info,
|
|
89
|
+
noMarginLeft: true
|
|
90
|
+
})), /*#__PURE__*/React.createElement(PasswordStrengthText, {
|
|
91
|
+
passwordStrength: passwordStrength
|
|
92
|
+
}, passwordStrength !== PasswordStrength.NONE && passwordStrength)) : info && /*#__PURE__*/React.createElement(InfoIconWrapper, null, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
93
|
+
position: "bottom",
|
|
94
|
+
title: info,
|
|
95
|
+
noMarginLeft: true
|
|
96
|
+
})), /*#__PURE__*/React.createElement(CapslockIndicator, null, isCapslockOn && /*#__PURE__*/React.createElement(CapsLockSvg, null))));
|
|
97
|
+
};
|
|
98
|
+
InputPassword.propTypes = {
|
|
99
|
+
id: PropTypes.string.isRequired,
|
|
100
|
+
name: PropTypes.string.isRequired,
|
|
101
|
+
label: PropTypes.string,
|
|
102
|
+
value: PropTypes.string,
|
|
103
|
+
error: PropTypes.bool,
|
|
104
|
+
touched: PropTypes.bool,
|
|
105
|
+
onChange: PropTypes.func,
|
|
106
|
+
onBlur: PropTypes.func,
|
|
107
|
+
onFocus: PropTypes.func,
|
|
108
|
+
info: PropTypes.string,
|
|
109
|
+
showStrength: PropTypes.bool
|
|
110
|
+
};
|
|
111
|
+
InputPassword.defaultProps = {
|
|
112
|
+
label: '',
|
|
113
|
+
value: '',
|
|
114
|
+
error: false,
|
|
115
|
+
touched: false,
|
|
116
|
+
onChange: () => {},
|
|
117
|
+
onBlur: () => {},
|
|
118
|
+
onFocus: () => {},
|
|
119
|
+
info: '',
|
|
120
|
+
showStrength: false
|
|
121
|
+
};
|
|
122
|
+
export default InputPassword;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputPassword } from './InputPassword';
|
|
3
|
+
import { ComponentWrapper } from '../ComponentWrapper/ComponentWrapper.styles';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components Library/Inputs/Input Password',
|
|
6
|
+
component: InputPassword,
|
|
7
|
+
argTypes: {
|
|
8
|
+
type: {
|
|
9
|
+
type: 'string'
|
|
10
|
+
},
|
|
11
|
+
id: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
defaultValue: ''
|
|
22
|
+
},
|
|
23
|
+
value: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
defaultValue: ''
|
|
26
|
+
},
|
|
27
|
+
error: {
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
defaultValue: false
|
|
30
|
+
},
|
|
31
|
+
touched: {
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
defaultValue: false
|
|
34
|
+
},
|
|
35
|
+
onChange: {
|
|
36
|
+
action: 'change',
|
|
37
|
+
type: 'function'
|
|
38
|
+
},
|
|
39
|
+
onBlur: {
|
|
40
|
+
action: 'blur',
|
|
41
|
+
type: 'function'
|
|
42
|
+
},
|
|
43
|
+
onFocus: {
|
|
44
|
+
action: 'hasFocus',
|
|
45
|
+
type: 'function'
|
|
46
|
+
},
|
|
47
|
+
info: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
defaultValue: ''
|
|
50
|
+
},
|
|
51
|
+
showStrength: {
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
defaultValue: false
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const Template = args => /*#__PURE__*/React.createElement(ComponentWrapper, null, /*#__PURE__*/React.createElement(InputPassword, args));
|
|
58
|
+
export const PasswordFilled = Template.bind({});
|
|
59
|
+
PasswordFilled.args = {
|
|
60
|
+
label: 'input description (label) - PASSWORD',
|
|
61
|
+
value: 'your password (value)'
|
|
62
|
+
};
|
|
63
|
+
export const PasswordStrength = Template.bind({});
|
|
64
|
+
PasswordStrength.args = {
|
|
65
|
+
label: 'input description (label) - PASSWORD',
|
|
66
|
+
value: 'your password (value)',
|
|
67
|
+
showStrength: true
|
|
68
|
+
};
|
|
69
|
+
export const InputPasswordEmpty = Template.bind({});
|
|
70
|
+
InputPasswordEmpty.args = {
|
|
71
|
+
label: 'input description (label) - PASSWORD'
|
|
72
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components/macro';
|
|
2
|
+
import { PasswordStrength } from './InputPassword';
|
|
3
|
+
import theme from 'styles/theme';
|
|
4
|
+
export const BottomWrap = styled.div`
|
|
5
|
+
position: relative;
|
|
6
|
+
margin-top: 6px;
|
|
7
|
+
`;
|
|
8
|
+
export const ShowPassword = styled.div`
|
|
9
|
+
display: block;
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
transition: color 0.2s;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
line-height: 16px;
|
|
17
|
+
padding: 12px 0;
|
|
18
|
+
height: 40px;
|
|
19
|
+
width: 20px;
|
|
20
|
+
text-align: right;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
color: ${props => theme.cPrimary};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export const CapslockIndicator = styled.div`
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 4px;
|
|
29
|
+
right: 2px;
|
|
30
|
+
|
|
31
|
+
& > svg {
|
|
32
|
+
fill: ${props => theme.cBlack};
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
export const PasswordStrengthWrap = styled.div`
|
|
36
|
+
padding: 3px 0;
|
|
37
|
+
display: block;
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding-right: 20px;
|
|
40
|
+
font-size: 0;
|
|
41
|
+
`;
|
|
42
|
+
export const PasswordStrengthIndicators = styled.div`
|
|
43
|
+
display: inline-block;
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
margin: 0 -4px;
|
|
46
|
+
padding-right: 12px;
|
|
47
|
+
|
|
48
|
+
${props => props.passwordStrength === PasswordStrength.WEAK && css`
|
|
49
|
+
${PasswordStrengthIndicator} {
|
|
50
|
+
&:nth-child(1) {
|
|
51
|
+
background-color: ${theme.cWarning};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`}
|
|
55
|
+
|
|
56
|
+
${props => props.passwordStrength === PasswordStrength.MEDIUM && css`
|
|
57
|
+
${PasswordStrengthIndicator} {
|
|
58
|
+
&:nth-child(1),
|
|
59
|
+
&:nth-child(2) {
|
|
60
|
+
background-color: ${theme.cYellow};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`}
|
|
64
|
+
|
|
65
|
+
${props => props.passwordStrength === PasswordStrength.STRONG && css`
|
|
66
|
+
${PasswordStrengthIndicator} {
|
|
67
|
+
&:nth-child(1),
|
|
68
|
+
&:nth-child(2),
|
|
69
|
+
&:nth-child(3) {
|
|
70
|
+
background-color: ${theme.cLighterGreen};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`}
|
|
74
|
+
`;
|
|
75
|
+
export const PasswordStrengthIndicator = styled.div`
|
|
76
|
+
display: inline-block;
|
|
77
|
+
vertical-align: middle;
|
|
78
|
+
width: 32px;
|
|
79
|
+
height: 6px;
|
|
80
|
+
border-radius: 3px;
|
|
81
|
+
margin: 3px 4px;
|
|
82
|
+
background-color: ${props => theme.cGrey};
|
|
83
|
+
`;
|
|
84
|
+
export const PasswordStrengthText = styled.div`
|
|
85
|
+
display: inline-block;
|
|
86
|
+
vertical-align: middle;
|
|
87
|
+
font-weight: 300;
|
|
88
|
+
font-size: 9px;
|
|
89
|
+
line-height: 12px;
|
|
90
|
+
letter-spacing: 0.4px;
|
|
91
|
+
font-style: italic;
|
|
92
|
+
color: ${props => theme.cText};
|
|
93
|
+
`;
|
|
94
|
+
export const DatePickerOverlay = styled.div`
|
|
95
|
+
&&& > .DayPickerInput {
|
|
96
|
+
z-index: 100;
|
|
97
|
+
display: block;
|
|
98
|
+
position: relative;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&&& > .DayPickerInput > input {
|
|
103
|
+
font-family: 'Open sans';
|
|
104
|
+
display: block;
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 40px;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
line-height: 18px;
|
|
110
|
+
padding: 13px 0;
|
|
111
|
+
padding-bottom: 7px;
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
box-shadow: none;
|
|
114
|
+
outline: 0;
|
|
115
|
+
border: 0;
|
|
116
|
+
border-top: 1px solid transparent;
|
|
117
|
+
border-bottom: 1px solid ${props => theme.cGrey};
|
|
118
|
+
color: ${props => theme.cBlack};
|
|
119
|
+
background-color: transparent;
|
|
120
|
+
transition: border-color 0.2s;
|
|
121
|
+
|
|
122
|
+
&:focus,
|
|
123
|
+
&:hover {
|
|
124
|
+
box-shadow: none;
|
|
125
|
+
border-top-color: transparent;
|
|
126
|
+
border-bottom-color: ${props => theme.cPrimary};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&::placeholder {
|
|
130
|
+
color: transparent;
|
|
131
|
+
opacity: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
export const InfoIconWrapper = styled.div`
|
|
136
|
+
display: inline-block;
|
|
137
|
+
vertical-align: middle;
|
|
138
|
+
margin: -2px 0;
|
|
139
|
+
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import FieldRange from '@atlaskit/field-range';
|
|
4
|
+
import RangeWrapper from './RangeInput.styles';
|
|
5
|
+
export const RangeInput = ({
|
|
6
|
+
disabled,
|
|
7
|
+
max,
|
|
8
|
+
min,
|
|
9
|
+
step,
|
|
10
|
+
onChange,
|
|
11
|
+
value,
|
|
12
|
+
id,
|
|
13
|
+
name
|
|
14
|
+
}) => {
|
|
15
|
+
const valuePercent = ((value - min) / (max - min) * 100).toFixed(2);
|
|
16
|
+
return /*#__PURE__*/React.createElement(RangeWrapper, {
|
|
17
|
+
valuePercent: valuePercent
|
|
18
|
+
}, /*#__PURE__*/React.createElement(FieldRange, {
|
|
19
|
+
id: id,
|
|
20
|
+
name: name,
|
|
21
|
+
disabled: disabled,
|
|
22
|
+
max: max,
|
|
23
|
+
min: min,
|
|
24
|
+
step: step,
|
|
25
|
+
value: value,
|
|
26
|
+
onChange: onChange
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
RangeInput.propTypes = {
|
|
30
|
+
id: PropTypes.string.isRequired,
|
|
31
|
+
name: PropTypes.string.isRequired,
|
|
32
|
+
disabled: PropTypes.bool,
|
|
33
|
+
max: PropTypes.number,
|
|
34
|
+
min: PropTypes.number,
|
|
35
|
+
step: PropTypes.number,
|
|
36
|
+
onChange: PropTypes.func,
|
|
37
|
+
value: PropTypes.number.isRequired
|
|
38
|
+
};
|
|
39
|
+
RangeInput.defaultProps = {
|
|
40
|
+
disabled: false,
|
|
41
|
+
max: 100,
|
|
42
|
+
min: 0,
|
|
43
|
+
step: 1,
|
|
44
|
+
onChange: () => {}
|
|
45
|
+
};
|
|
46
|
+
export default RangeInput;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RangeInput } from './RangeInput';
|
|
3
|
+
import { ComponentWrapper } from '../ComponentWrapper/ComponentWrapper.styles';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components Library/Inputs/Range Input',
|
|
6
|
+
component: RangeInput,
|
|
7
|
+
argTypes: {
|
|
8
|
+
id: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
defaultValue: false
|
|
19
|
+
},
|
|
20
|
+
max: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
defaultValue: 100
|
|
23
|
+
},
|
|
24
|
+
min: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
defaultValue: 0
|
|
27
|
+
},
|
|
28
|
+
step: {
|
|
29
|
+
type: 'number',
|
|
30
|
+
defaultValue: 1
|
|
31
|
+
},
|
|
32
|
+
onChange: {
|
|
33
|
+
action: 'change',
|
|
34
|
+
type: 'function'
|
|
35
|
+
},
|
|
36
|
+
value: {
|
|
37
|
+
type: 'number',
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const Template = args => /*#__PURE__*/React.createElement(ComponentWrapper, null, /*#__PURE__*/React.createElement(RangeInput, args));
|
|
43
|
+
export const RangeInputDefault = Template.bind({});
|
|
44
|
+
RangeInputDefault.args = {};
|
|
45
|
+
|
|
46
|
+
//doublecheck:
|
|
47
|
+
|
|
48
|
+
// any other functions to take into args?
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components/macro';
|
|
2
|
+
import theme from 'styles/theme';
|
|
3
|
+
const sliderThumbSize = 26;
|
|
4
|
+
const sliderLineThickness = 8;
|
|
5
|
+
const sliderThumbStyle = css`
|
|
6
|
+
background: ${props => theme.cPrimary};
|
|
7
|
+
border: 4px solid ${props => theme.cWhite};
|
|
8
|
+
height: ${sliderThumbSize}px;
|
|
9
|
+
width: ${sliderThumbSize}px;
|
|
10
|
+
`;
|
|
11
|
+
const sliderDefaultBackground = css`
|
|
12
|
+
background: ${props => `linear-gradient(${theme.cPrimary}, ${theme.cPrimary}) 0/ ${props.valuePercent}% 100% no-repeat ${theme.cLightGrey}`};
|
|
13
|
+
`;
|
|
14
|
+
const sliderTrackFocusedStyle = css`
|
|
15
|
+
background: ${props => `linear-gradient(${theme.cPrimaryDark}, ${theme.cPrimaryDark}) 0/ ${props.valuePercent}% 100% no-repeat ${theme.cLightGrey}`};
|
|
16
|
+
`;
|
|
17
|
+
const sliderTrackStyle = css`
|
|
18
|
+
/* background: ${props => theme.cLightGrey}; */
|
|
19
|
+
border-radius: ${sliderLineThickness / 2}px;
|
|
20
|
+
height: ${sliderLineThickness}px;
|
|
21
|
+
${sliderDefaultBackground};
|
|
22
|
+
`;
|
|
23
|
+
const sliderThumbFocusedStyle = css`
|
|
24
|
+
border-color: ${props => theme.cLightGrey};
|
|
25
|
+
`;
|
|
26
|
+
const sliderThumbHoverStyle = css`
|
|
27
|
+
background: ${props => theme.cPrimaryDark};
|
|
28
|
+
`;
|
|
29
|
+
const chromeRangeInputStyle = css`
|
|
30
|
+
&::-webkit-slider-thumb {
|
|
31
|
+
margin-top: -${sliderThumbSize / 2 - sliderLineThickness / 2}px;
|
|
32
|
+
${sliderThumbStyle};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:focus::-webkit-slider-thumb {
|
|
36
|
+
${sliderThumbFocusedStyle};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:hover::-webkit-slider-thumb {
|
|
40
|
+
${sliderThumbHoverStyle};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&::-webkit-slider-runnable-track {
|
|
44
|
+
${sliderTrackStyle};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:focus::-webkit-slider-runnable-track {
|
|
48
|
+
${sliderDefaultBackground};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active::-webkit-slider-runnable-track,
|
|
52
|
+
&:hover::-webkit-slider-runnable-track {
|
|
53
|
+
${sliderTrackFocusedStyle};
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
const firefoxRangeInputStyle = css`
|
|
57
|
+
&::-moz-range-thumb {
|
|
58
|
+
${sliderThumbStyle};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:focus::-moz-range-thumb {
|
|
62
|
+
${sliderThumbFocusedStyle};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:hover::-moz-range-thumb {
|
|
66
|
+
${sliderThumbHoverStyle};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::-moz-range-track {
|
|
70
|
+
${sliderTrackStyle};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:focus::-moz-range-track {
|
|
74
|
+
${sliderDefaultBackground};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:active::-moz-range-track,
|
|
78
|
+
&:hover::-moz-range-track {
|
|
79
|
+
${sliderTrackFocusedStyle};
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const IERangeInputStyle = css`
|
|
83
|
+
&::-ms-thumb {
|
|
84
|
+
${sliderThumbStyle};
|
|
85
|
+
margin-top: -${sliderThumbSize / 2 - sliderLineThickness / 2}px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:focus::-ms-thumb {
|
|
89
|
+
${sliderThumbFocusedStyle};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:hover::-ms-thumb {
|
|
93
|
+
${sliderThumbHoverStyle};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&::-ms-track {
|
|
97
|
+
height: ${sliderLineThickness}px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&::-ms-fill-lower {
|
|
101
|
+
background: ${props => theme.cPrimary};
|
|
102
|
+
border-radius: ${sliderLineThickness / 2}px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&::-ms-fill-upper {
|
|
106
|
+
background: ${props => theme.cLightGrey};
|
|
107
|
+
border-radius: ${sliderLineThickness / 2}px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:active::-ms-fill-lower,
|
|
111
|
+
&:hover::-ms-fill-lower {
|
|
112
|
+
background: ${props => theme.cPrimaryDark};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:active::-ms-fill-upper,
|
|
116
|
+
&:hover::-ms-fill-upper {
|
|
117
|
+
background: ${props => theme.cLightGrey};
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
const RangeWrapper = styled.div`
|
|
121
|
+
input {
|
|
122
|
+
${chromeRangeInputStyle} ${firefoxRangeInputStyle} ${IERangeInputStyle};
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
export default RangeWrapper;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import ReactSelect, { components } from 'react-select';
|
|
4
|
+
import { Wrapper, Label } from './Input.styles';
|
|
5
|
+
import { SelectControl, SelectMenu, SelectMenuList, SelectOption, SelectContainer, SelectValueContainer, SelectIcon } from './Select.styles';
|
|
6
|
+
const DropdownIndicator = props => {
|
|
7
|
+
const {
|
|
8
|
+
selectProps
|
|
9
|
+
} = props;
|
|
10
|
+
return /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement(SelectIcon, {
|
|
11
|
+
isMenuOpen: selectProps.menuIsOpen
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
DropdownIndicator.propTypes = {
|
|
15
|
+
selectProps: PropTypes.instanceOf(Object).isRequired
|
|
16
|
+
};
|
|
17
|
+
const SelectMenuListWithScroll = props => {
|
|
18
|
+
const {
|
|
19
|
+
children
|
|
20
|
+
} = props;
|
|
21
|
+
return /*#__PURE__*/React.createElement(SelectMenuList, {
|
|
22
|
+
autoHeight: true,
|
|
23
|
+
autoHeightMax: 300
|
|
24
|
+
}, children);
|
|
25
|
+
};
|
|
26
|
+
SelectMenuListWithScroll.propTypes = {
|
|
27
|
+
children: PropTypes.node.isRequired
|
|
28
|
+
};
|
|
29
|
+
export const Select = props => {
|
|
30
|
+
const {
|
|
31
|
+
id,
|
|
32
|
+
name,
|
|
33
|
+
label,
|
|
34
|
+
options,
|
|
35
|
+
search,
|
|
36
|
+
error,
|
|
37
|
+
touched,
|
|
38
|
+
value,
|
|
39
|
+
disabled
|
|
40
|
+
} = props;
|
|
41
|
+
const [labelUp, setLabelUp] = useState(!!value);
|
|
42
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setLabelUp(hasFocus || !!value);
|
|
45
|
+
}, [hasFocus, value]);
|
|
46
|
+
const onFocus = e => {
|
|
47
|
+
props.onFocus && props.onFocus({
|
|
48
|
+
name,
|
|
49
|
+
value
|
|
50
|
+
});
|
|
51
|
+
if (search) {
|
|
52
|
+
setHasFocus(true);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const onBlur = e => {
|
|
56
|
+
props.onBlur && props.onBlur({
|
|
57
|
+
name,
|
|
58
|
+
value
|
|
59
|
+
});
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
setHasFocus(false);
|
|
62
|
+
}, 1);
|
|
63
|
+
};
|
|
64
|
+
const onChange = selectedOption => {
|
|
65
|
+
props.onChange && props.onChange({
|
|
66
|
+
name,
|
|
67
|
+
value: selectedOption.value
|
|
68
|
+
});
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
setHasFocus(true);
|
|
71
|
+
}, 1);
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, label && /*#__PURE__*/React.createElement(Label, {
|
|
74
|
+
isUp: labelUp,
|
|
75
|
+
active: hasFocus,
|
|
76
|
+
error: error && touched,
|
|
77
|
+
htmlFor: id
|
|
78
|
+
}, label), /*#__PURE__*/React.createElement(ReactSelect, {
|
|
79
|
+
id: id,
|
|
80
|
+
name: name,
|
|
81
|
+
options: options,
|
|
82
|
+
isDisabled: disabled,
|
|
83
|
+
onChange: onChange,
|
|
84
|
+
onBlur: onBlur,
|
|
85
|
+
onFocus: onFocus,
|
|
86
|
+
value: options.find(option => option.value === value),
|
|
87
|
+
placeholder: "",
|
|
88
|
+
isSearchable: search,
|
|
89
|
+
components: {
|
|
90
|
+
Control: SelectControl,
|
|
91
|
+
DropdownIndicator,
|
|
92
|
+
IndicatorSeparator: null,
|
|
93
|
+
Menu: SelectMenu,
|
|
94
|
+
MenuList: SelectMenuListWithScroll,
|
|
95
|
+
Option: SelectOption,
|
|
96
|
+
SelectContainer,
|
|
97
|
+
ValueContainer: SelectValueContainer
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
Select.propTypes = {
|
|
102
|
+
id: PropTypes.string.isRequired,
|
|
103
|
+
name: PropTypes.string.isRequired,
|
|
104
|
+
label: PropTypes.string,
|
|
105
|
+
error: PropTypes.bool,
|
|
106
|
+
touched: PropTypes.bool,
|
|
107
|
+
value: PropTypes.string,
|
|
108
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
109
|
+
key: PropTypes.string.isRequired,
|
|
110
|
+
value: PropTypes.string.isRequired,
|
|
111
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
|
|
112
|
+
})).isRequired,
|
|
113
|
+
search: PropTypes.bool,
|
|
114
|
+
onChange: PropTypes.func,
|
|
115
|
+
onBlur: PropTypes.func,
|
|
116
|
+
onFocus: PropTypes.func
|
|
117
|
+
};
|
|
118
|
+
Select.defaultProps = {
|
|
119
|
+
label: '',
|
|
120
|
+
value: '',
|
|
121
|
+
search: false,
|
|
122
|
+
error: false,
|
|
123
|
+
touched: false,
|
|
124
|
+
onChange: () => {},
|
|
125
|
+
onBlur: () => {},
|
|
126
|
+
onFocus: () => {}
|
|
127
|
+
};
|
|
128
|
+
export default Select;
|
|
129
|
+
|
|
130
|
+
//doublecheck: label down on blur, even if field is filled..
|