@rabbitio/ui-kit 1.0.0-beta.9 → 1.0.0-beta.91
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/.gitlab-ci.yml +29 -0
- package/.husky/commit-msg +19 -0
- package/.husky/pre-push +1 -0
- package/CHANGELOG.md +0 -0
- package/README.md +27 -18
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +16765 -0
- package/coverage/coverage-final.json +116 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +1001 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/rabbit-ui-kit/index.html +116 -0
- package/coverage/rabbit-ui-kit/index.js.html +88 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +148 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +169 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +199 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/apiGroups.js.html +250 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/emailAPI.js.html +133 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +352 -0
- package/coverage/rabbit-ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
- package/coverage/rabbit-ui-kit/src/common-apis/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/blockchain.js.html +115 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/coin.js.html +829 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/protocol.js.html +100 -0
- package/coverage/rabbit-ui-kit/src/common-apis/services/fiatCurrenciesService.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common-apis/services/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/amountUtils.js.html +1162 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/cache.js.html +811 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/errorUtils.js.html +211 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/index.html +191 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logger.js.html +208 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/rabbitTicker.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.js.html +376 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1570 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/index.html +206 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/exolixSwapProvider.js.html +1825 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1618 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1819 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1861 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +514 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +529 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +176 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/partner.js.html +166 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +331 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +1555 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +670 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/index.html +281 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +346 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +268 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +712 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +421 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1429 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1474 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +211 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +307 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +496 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +481 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1747 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4207 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +559 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +151 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
- package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
- package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +146 -0
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +191 -0
- package/coverage/rabbit-ui-kit/stories/molecules/AmountInput.stories.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/stories/molecules/CoinPicker.stories.jsx.html +322 -0
- package/coverage/rabbit-ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +235 -0
- package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/index.html +191 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/WaitlistSubscription.stories.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/stories/organisms/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/stubs/coins.jsx.html +6880 -0
- package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +131 -0
- package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/stories/templates/index.html +116 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/global.css +197 -0
- package/dist/global.css.map +1 -0
- package/dist/index.cjs +12451 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2339 -8491
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +9597 -26
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +12357 -27
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +12442 -29
- package/dist/index.umd.js.map +1 -1
- package/package.json +35 -9
- package/raw +1000 -0
- package/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js +21 -0
- package/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js +28 -0
- package/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js +38 -0
- package/src/common-apis/adapters/axiosAdapter.js +35 -0
- package/src/common-apis/adapters/qrUtils.js +18 -0
- package/src/common-apis/external-apis/apiGroups.js +55 -0
- package/src/common-apis/external-apis/emailAPI.js +16 -0
- package/src/common-apis/external-apis/ipAddressProviders.js +89 -0
- package/src/common-apis/globalConstants.jsx +3 -0
- package/src/common-apis/models/blockchain.js +10 -0
- package/src/common-apis/models/coin.js +248 -0
- package/src/common-apis/models/protocol.js +5 -0
- package/src/{common → common-apis/services}/fiatCurrenciesService.js +4 -12
- package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +12 -0
- package/src/common-apis/tests/units/utils/amountUtils/composeRateText.test.js +152 -0
- package/src/{common → common-apis/utils}/amountUtils.js +72 -136
- package/src/common-apis/utils/cache.js +242 -0
- package/src/{common → common-apis/utils}/errorUtils.js +15 -0
- package/src/common-apis/utils/logging/logger.js +41 -0
- package/src/common-apis/utils/logging/logsStorage.js +61 -0
- package/src/common-apis/utils/postponeExecution.js +11 -0
- package/src/common-apis/utils/rabbitTicker.js +24 -0
- package/src/common-apis/utils/safeStringify.js +50 -0
- package/src/index.js +96 -9
- package/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js +495 -0
- package/src/robust-api-caller/cachedRobustExternalApiCallerService.js +147 -0
- package/src/robust-api-caller/cancelProcessing.js +29 -0
- package/src/robust-api-caller/concurrentCalculationsMetadataHolder.js +75 -0
- package/src/robust-api-caller/externalApiProvider.js +156 -0
- package/src/robust-api-caller/externalServicesStatsCollector.js +78 -0
- package/src/robust-api-caller/robustExternalAPICallerService.js +304 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +533 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +532 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +19 -0
- package/src/swaps-lib/external-apis/exolixSwapProvider.js +580 -0
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +511 -0
- package/src/swaps-lib/external-apis/swapProvider.js +578 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +592 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +78 -0
- package/src/swaps-lib/models/existingSwap.js +143 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +148 -0
- package/src/swaps-lib/models/partner.js +27 -0
- package/src/swaps-lib/models/swapProviderCoinInfo.js +82 -0
- package/src/swaps-lib/services/publicSwapService.js +490 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +34 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/createSwap.test.js +1043 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/getSwapInfo.test.js +611 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getAllSupportedCurrencies.test.js +63 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getDepositCurrencies.test.js +73 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getWithdrawalCurrencies.test.js +102 -0
- package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +152 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +536 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1214 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1707 -0
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +80 -0
- package/src/swaps-lib/utils/swapUtils.js +195 -0
- package/{styles → src/ui-kit/assets/styles}/_functions.scss +5 -0
- package/{styles → src/ui-kit/assets/styles}/_mixins.scss +2 -2
- package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +3 -3
- package/{styles → src/ui-kit/assets/styles}/_variables.scss +17 -15
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Bold.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Light.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Regular.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
- package/src/ui-kit/assets/styles/global.scss +171 -0
- package/src/ui-kit/assets/styles/index.scss +10 -0
- package/src/ui-kit/assets/wrappedImages/arrowIcon.jsx +13 -0
- package/src/ui-kit/assets/wrappedImages/arrowTosca.jsx +14 -0
- package/src/ui-kit/assets/wrappedImages/arrowWhite.jsx +14 -0
- package/src/ui-kit/assets/wrappedImages/darkRectangle.jsx +7 -0
- package/src/ui-kit/assets/wrappedImages/determinedError.jsx +118 -0
- package/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx +39 -0
- package/src/ui-kit/assets/wrappedImages/infoIcon.jsx +16 -0
- package/src/ui-kit/assets/wrappedImages/messageIcon.jsx +87 -0
- package/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx +54 -0
- package/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
- package/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx +61 -0
- package/src/ui-kit/assets/wrappedImages/walletIcon.jsx +22 -0
- package/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx +57 -0
- package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
- package/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx +68 -0
- package/src/ui-kit/components/atoms/AssetSelection/asset-selection.module.scss +56 -0
- package/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx +34 -0
- package/src/ui-kit/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
- package/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx +51 -0
- package/src/ui-kit/components/atoms/InformationMessage/information-message.module.scss +38 -0
- package/src/ui-kit/components/atoms/Input/Input.jsx +183 -0
- package/src/ui-kit/components/atoms/Input/input.module.scss +107 -0
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +3 -2
- package/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx +64 -0
- package/src/ui-kit/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
- package/src/ui-kit/components/atoms/QrCode/QrCode.jsx +44 -0
- package/src/ui-kit/components/atoms/QrCode/qr-code.module.scss +15 -0
- package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +30 -0
- package/src/ui-kit/components/atoms/RateSelector/rate-selector.module.scss +47 -0
- package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +5 -1
- package/src/ui-kit/components/atoms/Textarea/Textarea.jsx +148 -0
- package/src/ui-kit/components/atoms/Textarea/textarea.module.scss +71 -0
- package/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx +141 -0
- package/src/ui-kit/components/atoms/TitleBox/title-box.module.scss +32 -0
- package/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx +77 -0
- package/src/ui-kit/components/atoms/Tooltip/tooltip.module.scss +237 -0
- package/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx +76 -0
- package/src/ui-kit/components/atoms/TwoLinesOfText/lines-of-text.module.scss +65 -0
- package/src/ui-kit/components/atoms/Validation/Validation.jsx +39 -0
- package/src/ui-kit/components/atoms/Validation/validation.module.scss +19 -0
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +24 -50
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
- package/src/ui-kit/components/atoms/buttons/Close/Close.jsx +58 -0
- package/src/ui-kit/components/atoms/buttons/Close/close.module.scss +75 -0
- package/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx +112 -0
- package/src/ui-kit/components/atoms/buttons/LinkButton/link-button.module.scss +49 -0
- package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +110 -0
- package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +86 -0
- package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +448 -0
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +233 -0
- package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +463 -0
- package/src/ui-kit/components/molecules/CoinPicker/coin-picker.module.scss +207 -0
- package/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx +42 -0
- package/src/ui-kit/components/molecules/ColoredNotice/colored-notice.module.scss +20 -0
- package/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx +35 -0
- package/src/ui-kit/components/molecules/LineWithIconLink/line-with-icon-link.module.scss +25 -0
- package/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx +74 -0
- package/src/ui-kit/components/molecules/LogoCarousel/logo-carousel.module.scss +106 -0
- package/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx +137 -0
- package/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +32 -0
- package/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +66 -0
- package/src/ui-kit/components/organisms/Dialog/Dialog.jsx +494 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +132 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +554 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/dialog-step.module.scss +381 -0
- package/src/ui-kit/components/organisms/Dialog/dialog.module.scss +226 -0
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +1374 -0
- package/src/ui-kit/components/organisms/SwapForm/swap-form.module.scss +134 -0
- package/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx +158 -0
- package/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +77 -0
- package/src/ui-kit/hooks/useCallHandlingErrors.js +22 -0
- package/src/ui-kit/hooks/useIsHydrated.js +12 -0
- package/src/ui-kit/hooks/useReferredState.js +24 -0
- package/src/ui-kit/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +146 -0
- package/src/ui-kit/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +65 -0
- package/src/ui-kit/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +104 -0
- package/src/ui-kit/utils/inputValueProviders.js +50 -0
- package/src/ui-kit/utils/textUtils.js +18 -0
- package/src/ui-kit/utils/uiUtils.js +12 -0
- package/src/ui-kit/utils/urlQueryUtils.js +62 -0
- package/stories/font.scss +40 -0
- package/stories/stubs/coins.jsx +2266 -0
- package/stories/stubs/exampleContent.jsx +20 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +0 -55
- package/styles/_global-classes.scss +0 -433
- package/styles/fonts/NunitoSans-Bold.ttf +0 -0
- package/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
- package/styles/fonts/NunitoSans-Light.ttf +0 -0
- package/styles/fonts/NunitoSans-Regular.ttf +0 -0
- package/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
- package/styles/global-styles-index.scss +0 -74
- package/styles/index.scss +0 -33
- /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.swap-form {
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
&-inputs {
|
|
7
|
+
position: relative;
|
|
8
|
+
z-index: 2;
|
|
9
|
+
|
|
10
|
+
&-separator {
|
|
11
|
+
height: 4px;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
user-select: none;
|
|
16
|
+
|
|
17
|
+
img {
|
|
18
|
+
margin: -13px 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:not(.disabled) {
|
|
22
|
+
@extend %hover-state;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.disabled {
|
|
26
|
+
opacity: 0.7;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&-information-field {
|
|
32
|
+
z-index: 1;
|
|
33
|
+
background-color: SolidColor("lightsmoke");
|
|
34
|
+
margin-top: 4px;
|
|
35
|
+
border-radius: 0 0 8px 8px;
|
|
36
|
+
padding: 10px 20px;
|
|
37
|
+
position: relative;
|
|
38
|
+
text-align: left;
|
|
39
|
+
|
|
40
|
+
.semi-transparent {
|
|
41
|
+
opacity: 0.5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
p {
|
|
45
|
+
color: SolidColor("grey");
|
|
46
|
+
|
|
47
|
+
.interactable {
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
transition: 0.3s;
|
|
51
|
+
|
|
52
|
+
@media (hover: hover) {
|
|
53
|
+
&:hover {
|
|
54
|
+
opacity: 0.7;
|
|
55
|
+
transition: 0s;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:active {
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.red {
|
|
65
|
+
color: SolidColor("red");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::before {
|
|
70
|
+
z-index: 0;
|
|
71
|
+
content: "";
|
|
72
|
+
position: absolute;
|
|
73
|
+
left: 0;
|
|
74
|
+
bottom: calc(100% + 4px);
|
|
75
|
+
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 20px;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
background-color: transparent;
|
|
80
|
+
box-shadow:
|
|
81
|
+
0px 0px 0px 4px $white,
|
|
82
|
+
0px 10px 0px 0px SolidColor("lightsmoke");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&-address-field {
|
|
87
|
+
margin-top: Margin("5");
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: Margin("3");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&-rate-selector {
|
|
94
|
+
margin-bottom: Margin("5");
|
|
95
|
+
display: block;
|
|
96
|
+
width: 100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&-validation-text {
|
|
100
|
+
margin-top: Margin("5");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-button-container {
|
|
104
|
+
&-consent-text {
|
|
105
|
+
text-align: end;
|
|
106
|
+
color: SolidColor("grey");
|
|
107
|
+
font-size: 13px;
|
|
108
|
+
font-style: italic;
|
|
109
|
+
|
|
110
|
+
@media (max-width: $phone-width) {
|
|
111
|
+
text-align: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-link {
|
|
115
|
+
color: SolidColor("grey");
|
|
116
|
+
text-decoration: underline;
|
|
117
|
+
|
|
118
|
+
&:active {
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
display: flex;
|
|
125
|
+
justify-content: flex-end;
|
|
126
|
+
align-items: center;
|
|
127
|
+
margin-top: Margin("10");
|
|
128
|
+
gap: Margin("3");
|
|
129
|
+
|
|
130
|
+
@media (max-width: $phone-width) {
|
|
131
|
+
flex-direction: column-reverse;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import { logErrorOrOutputToConsole } from "../../../../common-apis/utils/errorUtils.js";
|
|
5
|
+
import { Coin } from "../../../../common-apis/models/coin";
|
|
6
|
+
|
|
7
|
+
import { ColoredNotice } from "../../molecules/ColoredNotice/ColoredNotice";
|
|
8
|
+
import { Dialog } from "../Dialog/Dialog";
|
|
9
|
+
import { DialogStep } from "../Dialog/DialogStep/DialogStep";
|
|
10
|
+
import { Input } from "../../atoms/Input/Input";
|
|
11
|
+
import { TitleBox } from "../../atoms/TitleBox/TitleBox";
|
|
12
|
+
import { Validation } from "../../atoms/Validation/Validation";
|
|
13
|
+
|
|
14
|
+
import messageIcon from "../../../assets/wrappedImages/messageIcon";
|
|
15
|
+
import supportDialogImage from "../../../assets/wrappedImages/supportDialogImage";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Saves a user's subscription to receive notifications about a specific coin.
|
|
19
|
+
* This function sends an email to subscribe the user to notifications for the specified coin.
|
|
20
|
+
*
|
|
21
|
+
* @function
|
|
22
|
+
* @name saveSubscription
|
|
23
|
+
* @param {Coin} coin - The coin object containing information about the coin, including its ticker symbol.
|
|
24
|
+
* @param {string} address - The email address of the user who wishes to subscribe.
|
|
25
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the subscription email was sent successfully, or `false` if an error occurred during the process.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* WaitlistSubscription component handles user subscription to a waitlist for coin notifications.
|
|
30
|
+
* It displays a notice with a button to open a dialog where the user can enter their email to subscribe.
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
* @param {Object} props - The component props.
|
|
34
|
+
* @param {Coin} props.coin - The coin object containing information about the coin.
|
|
35
|
+
* @param {Object} props.translations - The text translations for the component.
|
|
36
|
+
* @param {saveSubscription} props.saveSubscription - Function to handle/save the subscription.
|
|
37
|
+
* @returns {JSX.Element} The WaitlistSubscription component.
|
|
38
|
+
*/
|
|
39
|
+
export const WaitlistSubscription = ({ coin, translations, saveSubscription }) => {
|
|
40
|
+
const [controls, initControls] = useState();
|
|
41
|
+
const [showDialog, setShowDialog] = useState(false);
|
|
42
|
+
const [inputValue, setInputValue] = useState("");
|
|
43
|
+
const [isEmailValid, setIsEmailValid] = useState(false);
|
|
44
|
+
const [errorEncountered, setErrorEncountered] = useState(false);
|
|
45
|
+
|
|
46
|
+
const defaultTranslations = {
|
|
47
|
+
coloredNotice: {
|
|
48
|
+
text: "This is a pre-listed coin, meaning that the swap is not yet available. As soon as this coin allows exchanges, it will be automatically enabled. If you want to get a notification as soon as this coin becomes available for swap - sign up for the waitlist below!",
|
|
49
|
+
buttonTitle: "Subscribe for updates",
|
|
50
|
+
},
|
|
51
|
+
signUpStep: {
|
|
52
|
+
title: coin.latinName + " (" + coin.ticker + ") listing notification",
|
|
53
|
+
subtitle:
|
|
54
|
+
"To be notified as soon as " +
|
|
55
|
+
coin.latinName +
|
|
56
|
+
" becomes available for swaps, please provide your email address. We’ll send you a single notification when it’s listed.",
|
|
57
|
+
actionButtonTitle: "Subscribe",
|
|
58
|
+
inputTitle: "Your email address:",
|
|
59
|
+
error: "Something went wrong. Please try again later.",
|
|
60
|
+
},
|
|
61
|
+
successStep: {
|
|
62
|
+
title: "Subscribed successfully!",
|
|
63
|
+
subtitle:
|
|
64
|
+
"We’ll notify you as soon as " +
|
|
65
|
+
coin.latinName +
|
|
66
|
+
" becomes available for swaps. Keep an eye on your inbox for the update.",
|
|
67
|
+
actionButtonTitle: "Close",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const t = translations ?? defaultTranslations;
|
|
72
|
+
|
|
73
|
+
const STEPS = {
|
|
74
|
+
signUp: "signUp",
|
|
75
|
+
success: "success",
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const subscribe = async resetButtonLoader => {
|
|
79
|
+
try {
|
|
80
|
+
setErrorEncountered(false);
|
|
81
|
+
const result = await saveSubscription(coin, inputValue);
|
|
82
|
+
if (result) {
|
|
83
|
+
controls?.goToStep(STEPS.success);
|
|
84
|
+
} else {
|
|
85
|
+
setErrorEncountered(true);
|
|
86
|
+
}
|
|
87
|
+
resetButtonLoader();
|
|
88
|
+
} catch (e) {
|
|
89
|
+
resetButtonLoader();
|
|
90
|
+
logErrorOrOutputToConsole(e);
|
|
91
|
+
setShowDialog(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const openDialog = () => {
|
|
96
|
+
setErrorEncountered(false);
|
|
97
|
+
setInputValue("");
|
|
98
|
+
setIsEmailValid(false);
|
|
99
|
+
controls?.toFirstStep(false);
|
|
100
|
+
setShowDialog(true);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setIsEmailValid(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(inputValue));
|
|
105
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
|
+
}, [inputValue]);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<>
|
|
110
|
+
<Dialog
|
|
111
|
+
initControls={controls => initControls(controls)}
|
|
112
|
+
showDialog={showDialog}
|
|
113
|
+
onClose={() => setShowDialog(false)}
|
|
114
|
+
>
|
|
115
|
+
<DialogStep
|
|
116
|
+
stepName={STEPS.signUp}
|
|
117
|
+
controls={controls}
|
|
118
|
+
title={t.signUpStep.title}
|
|
119
|
+
subtitle={t.signUpStep.subtitle}
|
|
120
|
+
confirmButtonClick={subscribe}
|
|
121
|
+
confirmButtonEnabled={isEmailValid}
|
|
122
|
+
confirmButtonText={t.signUpStep.actionButtonTitle}
|
|
123
|
+
primaryButtonLoader={true}
|
|
124
|
+
subtitleSmallMargin
|
|
125
|
+
showBackgroundTitle={false}
|
|
126
|
+
ImageRaw={messageIcon}
|
|
127
|
+
>
|
|
128
|
+
<TitleBox title={t.signUpStep.inputTitle}>
|
|
129
|
+
<Input type="text" onChange={e => setInputValue(e.target.value)} value={inputValue} />
|
|
130
|
+
{errorEncountered ? <Validation text={t.signUpStep.error} /> : null}
|
|
131
|
+
</TitleBox>
|
|
132
|
+
</DialogStep>
|
|
133
|
+
<DialogStep
|
|
134
|
+
stepName={STEPS.success}
|
|
135
|
+
controls={controls}
|
|
136
|
+
title={t.successStep.title}
|
|
137
|
+
subtitle={t.successStep.subtitle}
|
|
138
|
+
confirmButtonClick={() => setShowDialog(false)}
|
|
139
|
+
confirmButtonText={t.successStep.actionButtonTitle}
|
|
140
|
+
showBackgroundTitle={false}
|
|
141
|
+
ImageRaw={supportDialogImage}
|
|
142
|
+
showCornerBackButton={false}
|
|
143
|
+
subtitleSmallMargin
|
|
144
|
+
/>
|
|
145
|
+
</Dialog>
|
|
146
|
+
<ColoredNotice
|
|
147
|
+
text={t.coloredNotice.text}
|
|
148
|
+
buttonTitle={t.coloredNotice.buttonTitle}
|
|
149
|
+
onButtonClick={openDialog}
|
|
150
|
+
/>
|
|
151
|
+
</>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
WaitlistSubscription.propTypes = {
|
|
156
|
+
coin: PropTypes.object.isRequired,
|
|
157
|
+
translations: PropTypes.object,
|
|
158
|
+
};
|
package/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import { DialogStep } from "../../organisms/Dialog/DialogStep/DialogStep.jsx";
|
|
5
|
+
|
|
6
|
+
import determinedErrorImage from "../../../assets/wrappedImages/determinedError.jsx";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Template dialog step to display an error through the title and subtitle.
|
|
10
|
+
* You can insert it into any dialog windows and implement them into flows.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} props - Component props.
|
|
13
|
+
* @param {object} props.controls - Control elements for the dialog.
|
|
14
|
+
* @param {string} props.stepName - Name of the current step.
|
|
15
|
+
* @param {string} props.title - Title of the dialog.
|
|
16
|
+
* @param {string} props.subtitle - Subtitle of the dialog.
|
|
17
|
+
* @param {string} props.backButtonText - Text for the back button.
|
|
18
|
+
* @param {Function} props.backButtonClick - Handler for back button click.
|
|
19
|
+
* @param {string} props.backButtonLink - Link for the back button.
|
|
20
|
+
* @param {string} props.confirmButtonText - Text for the confirm button.
|
|
21
|
+
* @param {Function} props.confirmButtonClick - Handler for confirm button click.
|
|
22
|
+
* @param {string} props.confirmButtonLink - Link for the confirm button.
|
|
23
|
+
* @param {boolean} props.showCornerBackButton - Whether to show the corner back button.
|
|
24
|
+
* @returns {JSX.Element} React component
|
|
25
|
+
*/
|
|
26
|
+
export const DeterminedErrorDialogStep = ({
|
|
27
|
+
controls,
|
|
28
|
+
stepName,
|
|
29
|
+
title,
|
|
30
|
+
subtitle,
|
|
31
|
+
backButtonText,
|
|
32
|
+
backButtonClick,
|
|
33
|
+
backButtonLink,
|
|
34
|
+
confirmButtonText,
|
|
35
|
+
confirmButtonClick,
|
|
36
|
+
confirmButtonLink,
|
|
37
|
+
showCornerBackButton,
|
|
38
|
+
}) => {
|
|
39
|
+
return (
|
|
40
|
+
<DialogStep
|
|
41
|
+
controls={controls}
|
|
42
|
+
stepName={stepName}
|
|
43
|
+
ImageRaw={determinedErrorImage}
|
|
44
|
+
title={title}
|
|
45
|
+
subtitle={subtitle}
|
|
46
|
+
backButtonText={backButtonText}
|
|
47
|
+
backButtonClick={backButtonClick}
|
|
48
|
+
backButtonTo={backButtonLink}
|
|
49
|
+
confirmButtonText={confirmButtonText}
|
|
50
|
+
confirmButtonClick={confirmButtonClick}
|
|
51
|
+
confirmButtonLink={confirmButtonLink}
|
|
52
|
+
showCornerBackButton={showCornerBackButton}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
DeterminedErrorDialogStep.propTypes = {
|
|
58
|
+
controls: PropTypes.object,
|
|
59
|
+
stepName: PropTypes.string,
|
|
60
|
+
title: PropTypes.string.isRequired,
|
|
61
|
+
subtitle: PropTypes.string.isRequired,
|
|
62
|
+
backButtonText: PropTypes.string,
|
|
63
|
+
backButtonClick: PropTypes.func,
|
|
64
|
+
backButtonLink: PropTypes.string,
|
|
65
|
+
confirmButtonText: PropTypes.string,
|
|
66
|
+
confirmButtonClick: PropTypes.func,
|
|
67
|
+
confirmButtonLink: PropTypes.string,
|
|
68
|
+
showCornerBackButton: PropTypes.bool,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
DeterminedErrorDialogStep.defaultProps = {
|
|
72
|
+
backButtonText: "",
|
|
73
|
+
backButtonClick: null,
|
|
74
|
+
confirmButtonText: "",
|
|
75
|
+
confirmButtonClick: null,
|
|
76
|
+
showCornerBackButton: false,
|
|
77
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { Logger } from "../../common-apis/utils/logging/logger.js";
|
|
4
|
+
|
|
5
|
+
export function useCallHandlingErrors() {
|
|
6
|
+
const [, setState] = useState();
|
|
7
|
+
return useCallback(
|
|
8
|
+
async (functionToBeCalled, event) => {
|
|
9
|
+
try {
|
|
10
|
+
await functionToBeCalled(event);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
Logger.logError(error, functionToBeCalled?.name || "errorBoundaryTrigger", "Caught by ErrorBoundary");
|
|
13
|
+
// Triggering ErrorBoundary
|
|
14
|
+
setState(() => {
|
|
15
|
+
throw error;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
[]
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
// Custom hook to check if the component is hydrated
|
|
4
|
+
export function useIsHydrated() {
|
|
5
|
+
const [isHydrated, setIsHydrated] = useState(false);
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setIsHydrated(true);
|
|
9
|
+
}, []);
|
|
10
|
+
|
|
11
|
+
return isHydrated;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds reference to standard state variable. It is helpful to be able to use state variable value inside
|
|
5
|
+
* event handlers and other callbacks without the need to call setState(prev => { value = prev; return prev; }).
|
|
6
|
+
*
|
|
7
|
+
* @param initialValue {any} to be passed to useState
|
|
8
|
+
* @return {[React.Ref, function]} reference to state variable and its setter
|
|
9
|
+
*/
|
|
10
|
+
export function useReferredState(initialValue) {
|
|
11
|
+
const [state, setState] = React.useState(initialValue);
|
|
12
|
+
const reference = React.useRef(state);
|
|
13
|
+
|
|
14
|
+
const setReferredState = value => {
|
|
15
|
+
if (value && {}.toString.call(value) === "[object Function]") {
|
|
16
|
+
value = value(reference.current);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
reference.current = value;
|
|
20
|
+
setState(value);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return [reference, setReferredState];
|
|
24
|
+
}
|
package/src/ui-kit/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import should from "should";
|
|
2
|
+
|
|
3
|
+
import { describe, it } from "vitest";
|
|
4
|
+
import { InputValuesProviders } from "../../../utils/inputValueProviders.js";
|
|
5
|
+
|
|
6
|
+
describe("InputValueProviders", function () {
|
|
7
|
+
describe("#provideFormatOfFloatValueByInputString", function () {
|
|
8
|
+
[
|
|
9
|
+
{
|
|
10
|
+
max: null,
|
|
11
|
+
maxSuffix: 2,
|
|
12
|
+
test: "1989401950928592501985.3233",
|
|
13
|
+
expected: "1989401950928592501985.32",
|
|
14
|
+
message: "Should not touch prefix if max is null",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
max: null,
|
|
18
|
+
maxSuffix: 2,
|
|
19
|
+
test: "1989.",
|
|
20
|
+
expected: "1989.",
|
|
21
|
+
message: "Should correctly handle ending dot",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
max: null,
|
|
25
|
+
maxSuffix: 2,
|
|
26
|
+
test: "1989,",
|
|
27
|
+
expected: "1989.",
|
|
28
|
+
message: "Should correctly handle ending comma",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
max: 21000000,
|
|
32
|
+
maxSuffix: 2,
|
|
33
|
+
test: "1989401950928592501985.3243",
|
|
34
|
+
expected: "92501985.32",
|
|
35
|
+
message: "Should left no more than max digits count for prefix - some prefix case",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
max: 3,
|
|
39
|
+
maxSuffix: 2,
|
|
40
|
+
test: "1989401950928592501985.3243",
|
|
41
|
+
expected: "5.32",
|
|
42
|
+
message: "Should left no more than max digits count for prefix - min prefix case",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
max: 21000000,
|
|
46
|
+
maxSuffix: 1,
|
|
47
|
+
test: "232.1243",
|
|
48
|
+
expected: "232.1",
|
|
49
|
+
message:
|
|
50
|
+
"Should left no more than maxSuffix digits count in suffix - case maxSuffix is minimal = 1 and actual is londer",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
max: 21000000,
|
|
54
|
+
maxSuffix: 1,
|
|
55
|
+
test: "232.1",
|
|
56
|
+
expected: "232.1",
|
|
57
|
+
message:
|
|
58
|
+
"Should left no more than maxSuffix digits count in suffix - case maxSuffix is minimal = 1 and actual is the same length",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
max: 21000000,
|
|
62
|
+
maxSuffix: 8,
|
|
63
|
+
test: "232.1243909909",
|
|
64
|
+
expected: "232.12439099",
|
|
65
|
+
message:
|
|
66
|
+
"Should left no more than maxSuffix digits count in suffix - some maxSuffix case and actual suffix longer",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
max: 21000000,
|
|
70
|
+
maxSuffix: 8,
|
|
71
|
+
test: "232.1243",
|
|
72
|
+
expected: "232.1243",
|
|
73
|
+
message:
|
|
74
|
+
"Should left no more than maxSuffix digits count in suffix - some maxSuffix case and actual suffix shorter",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
max: null,
|
|
78
|
+
maxSuffix: 2,
|
|
79
|
+
test: "1323,23",
|
|
80
|
+
expected: "1323.23",
|
|
81
|
+
message: "Should replace comma with dot",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
max: null,
|
|
85
|
+
maxSuffix: 8,
|
|
86
|
+
test: "434,343,3423",
|
|
87
|
+
expected: "434.343",
|
|
88
|
+
message: "Should remove all after the second comma and itself",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
max: null,
|
|
92
|
+
maxSuffix: 8,
|
|
93
|
+
test: "434.343.3423",
|
|
94
|
+
expected: "434.343",
|
|
95
|
+
message: "Should remove all after the second dot and itself",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
max: null,
|
|
99
|
+
maxSuffix: 8,
|
|
100
|
+
test: "`3|49(3.3@43f",
|
|
101
|
+
expected: "3493.343",
|
|
102
|
+
message: "Should remove all non-digits and non-dot symbols",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
max: null,
|
|
106
|
+
maxSuffix: 8,
|
|
107
|
+
test: ".219",
|
|
108
|
+
expected: "0.219",
|
|
109
|
+
message: "Should add leading zero",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
max: null,
|
|
113
|
+
maxSuffix: 8,
|
|
114
|
+
test: "32..219",
|
|
115
|
+
expected: "32.219",
|
|
116
|
+
message: "Should replace the series of dots with the only",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
max: null,
|
|
120
|
+
maxSuffix: 8,
|
|
121
|
+
test: "32,,219",
|
|
122
|
+
expected: "32.219",
|
|
123
|
+
message: "Should replace the series of commas with the only",
|
|
124
|
+
},
|
|
125
|
+
].forEach(testData => {
|
|
126
|
+
it(testData.message, function () {
|
|
127
|
+
InputValuesProviders.provideFormatOfFloatValueByInputString(
|
|
128
|
+
testData.test,
|
|
129
|
+
testData.maxSuffix,
|
|
130
|
+
testData.max
|
|
131
|
+
).should.be.equal(testData.expected);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("Should throw an error if passed suffix length less than 0", function () {
|
|
136
|
+
let error = null;
|
|
137
|
+
try {
|
|
138
|
+
InputValuesProviders.provideFormatOfFloatValueByInputString("23232", -1);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
error = e;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
(error?.message ?? "").should.startWith("Min suffix length is 0, got");
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import should from "should";
|
|
2
|
+
|
|
3
|
+
import { beforeEach, afterEach, describe, it } from "vitest";
|
|
4
|
+
import { getQueryParameterValues } from "../../../utils/urlQueryUtils.js";
|
|
5
|
+
|
|
6
|
+
describe("urlQueryUtils", function () {
|
|
7
|
+
describe("#getQueryParameterValues", function () {
|
|
8
|
+
beforeEach(function () {});
|
|
9
|
+
|
|
10
|
+
afterEach(function () {
|
|
11
|
+
global.window = {};
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function setCustomQueryString(query) {
|
|
15
|
+
global.window = {
|
|
16
|
+
location: {
|
|
17
|
+
search: query,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
it("Should unescape parameter values", function () {
|
|
23
|
+
const parameterValuesWithSpecialSymbols = "#a@se /wer|*|##eee$";
|
|
24
|
+
setCustomQueryString(`?a=${encodeURIComponent(parameterValuesWithSpecialSymbols)}`);
|
|
25
|
+
const result = getQueryParameterValues("a");
|
|
26
|
+
|
|
27
|
+
result.should.be.deepEqual([...parameterValuesWithSpecialSymbols.split("|*|")]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("Should return empty array if there is no such parameter in the query", function () {
|
|
31
|
+
setCustomQueryString(`?a=val&b=val2`);
|
|
32
|
+
const result = getQueryParameterValues("c");
|
|
33
|
+
|
|
34
|
+
result.should.be.deepEqual([]);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("Should return array with the only empty string element if the value of the parameter is empty", function () {
|
|
38
|
+
setCustomQueryString(`?a=`);
|
|
39
|
+
const result = getQueryParameterValues("a");
|
|
40
|
+
|
|
41
|
+
result.should.be.deepEqual([""]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("Should return array with one value", function () {
|
|
45
|
+
setCustomQueryString(`?a=val1`);
|
|
46
|
+
const result = getQueryParameterValues("a");
|
|
47
|
+
|
|
48
|
+
result.should.be.deepEqual(["val1"]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("Should return array with several values", function () {
|
|
52
|
+
setCustomQueryString(`?a=${encodeURIComponent("val1|*|val2")}`);
|
|
53
|
+
const result = getQueryParameterValues("a");
|
|
54
|
+
|
|
55
|
+
result.should.be.deepEqual(["val1", "val2"]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("Should return array of all values if parameter is defined several times in the query", function () {
|
|
59
|
+
setCustomQueryString(`?a=${encodeURIComponent("val1|*|val2")}&a=val3`);
|
|
60
|
+
const result = getQueryParameterValues("a");
|
|
61
|
+
|
|
62
|
+
result.should.be.deepEqual(["val1", "val2", "val3"]);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|