@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,47 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.rate-selector {
|
|
4
|
+
background-color: SolidColor("lightsmoke");
|
|
5
|
+
border-radius: 8px;
|
|
6
|
+
padding: 4px;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
gap: Margin("1");
|
|
10
|
+
user-select: none;
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
&-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: Padding("3") Padding("3");
|
|
19
|
+
flex: 1 1;
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
gap: Margin("1");
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
transition: 0.2s all $transitionEaseOut;
|
|
24
|
+
box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0);
|
|
25
|
+
|
|
26
|
+
@media (hover: hover) {
|
|
27
|
+
&:not(.selected):hover {
|
|
28
|
+
box-shadow: 0px 0px 0px 1px SolidColor("smoke");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:not(.selected):active {
|
|
33
|
+
box-shadow: 0px 0px 0px 1px SolidColor("smoke");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.selected {
|
|
37
|
+
background: $white;
|
|
38
|
+
color: SolidColor("tosca");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-text {
|
|
42
|
+
font-weight: $semi-bold;
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// TODO: [dev] add JSDoc
|
|
5
|
+
export const SupportChat = ({ url, websiteToken, welcomeMessage = "", locale = "en" }) => {
|
|
5
6
|
useEffect(() => {
|
|
6
7
|
window.chatwootSettings = {
|
|
7
8
|
position: "right",
|
|
8
9
|
type: "standard",
|
|
9
10
|
launcherTitle: welcomeMessage,
|
|
11
|
+
locale: locale,
|
|
10
12
|
};
|
|
11
13
|
(function (d, t) {
|
|
12
14
|
var BASE_URL = url;
|
|
@@ -33,8 +35,10 @@ SupportChat.propTypes = {
|
|
|
33
35
|
url: PropTypes.string.isRequired,
|
|
34
36
|
websiteToken: PropTypes.string.isRequired,
|
|
35
37
|
welcomeMessage: PropTypes.string,
|
|
38
|
+
locale: PropTypes.string,
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
SupportChat.defaultProps = {
|
|
39
42
|
welcomeMessage: "",
|
|
43
|
+
locale: "en",
|
|
40
44
|
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import TextareaAutosize from "react-textarea-autosize";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
|
|
5
|
+
import s from "./textarea.module.scss";
|
|
6
|
+
|
|
7
|
+
import { useCallHandlingErrors } from "../../../hooks/useCallHandlingErrors.js";
|
|
8
|
+
import { Validation } from "../Validation/Validation.jsx";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A textarea component with optional adaptive height and validation messaging.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
* @param {Object} props - The props object.
|
|
15
|
+
* @param {string} props.name - The name of the textarea.
|
|
16
|
+
* @param {function} props.onChange - Handler for change events.
|
|
17
|
+
* @param {string} props.placeholder - Placeholder text for the textarea.
|
|
18
|
+
* @param {string} props.alertText - Text for the alert message.
|
|
19
|
+
* @param {string} props.successAlertText - Text for the success alert message.
|
|
20
|
+
* @param {string} props.value - Value of the textarea.
|
|
21
|
+
* @param {string} props.label - Label text for the textarea.
|
|
22
|
+
* @param {string|null} props.id - ID for the textarea element.
|
|
23
|
+
* @param {boolean} props.autoFocus - If the textarea should be auto-focused.
|
|
24
|
+
* @param {boolean} props.fullHeight - If the textarea should be full height.
|
|
25
|
+
* @param {boolean} props.smallText - If the textarea should use small text styling.
|
|
26
|
+
* @param {boolean} props.adaptiveHeight - If the textarea should adjust its height based on content.
|
|
27
|
+
* @param {boolean} props.disabled - If the textarea is disabled.
|
|
28
|
+
* @param {boolean} props.errorEncountered - If there is an error related to the textarea.
|
|
29
|
+
* @param {boolean} props.ignoreEnter - If Enter key presses should be ignored.
|
|
30
|
+
*/
|
|
31
|
+
export const Textarea = forwardRef(
|
|
32
|
+
(
|
|
33
|
+
{
|
|
34
|
+
name = "",
|
|
35
|
+
onChange = () => {},
|
|
36
|
+
placeholder = "",
|
|
37
|
+
alertText = "",
|
|
38
|
+
successAlertText = "",
|
|
39
|
+
value = "",
|
|
40
|
+
label = "",
|
|
41
|
+
id = null,
|
|
42
|
+
autoFocus = false,
|
|
43
|
+
fullHeight = false,
|
|
44
|
+
smallText = false,
|
|
45
|
+
adaptiveHeight = false,
|
|
46
|
+
disabled = false,
|
|
47
|
+
errorEncountered = false,
|
|
48
|
+
ignoreEnter = false,
|
|
49
|
+
},
|
|
50
|
+
ref
|
|
51
|
+
) => {
|
|
52
|
+
const callHandlingErrors = useCallHandlingErrors();
|
|
53
|
+
|
|
54
|
+
const onChangeProxy = e => {
|
|
55
|
+
if (ignoreEnter) e.target.value = e.target.value.replace(/(\r\n|\n|\r)/gm, "");
|
|
56
|
+
|
|
57
|
+
if (e.target?.value.indexOf("\n") === -1 || !ignoreEnter) onChange(e);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className={s["textarea"] + ` ${fullHeight ? " " + s["full-height"] : ""}`}>
|
|
62
|
+
{label ? (
|
|
63
|
+
<label htmlFor={id} className={s["textarea-input-label"]}>
|
|
64
|
+
{label}
|
|
65
|
+
</label>
|
|
66
|
+
) : null}
|
|
67
|
+
|
|
68
|
+
{adaptiveHeight ? (
|
|
69
|
+
<TextareaAutosize
|
|
70
|
+
className={
|
|
71
|
+
s["textarea-input"] +
|
|
72
|
+
" " +
|
|
73
|
+
s["adaptive-height"] +
|
|
74
|
+
(disabled ? " " + s["disabled"] : "") +
|
|
75
|
+
(errorEncountered ? " " + s["error-encountered"] : "")
|
|
76
|
+
}
|
|
77
|
+
minRows={1}
|
|
78
|
+
maxRows={3}
|
|
79
|
+
onChange={e => callHandlingErrors(onChangeProxy, e)}
|
|
80
|
+
placeholder={placeholder}
|
|
81
|
+
value={value}
|
|
82
|
+
id={id}
|
|
83
|
+
autoFocus={autoFocus}
|
|
84
|
+
ref={ref}
|
|
85
|
+
disabled={disabled}
|
|
86
|
+
/>
|
|
87
|
+
) : (
|
|
88
|
+
<textarea
|
|
89
|
+
name={name}
|
|
90
|
+
className={
|
|
91
|
+
s["textarea-input"] +
|
|
92
|
+
` ${fullHeight ? s["full-height"] : ""} ${smallText ? s["small-text"] : ""} ${
|
|
93
|
+
disabled ? s["disabled"] : ""
|
|
94
|
+
}`
|
|
95
|
+
}
|
|
96
|
+
onChange={e => callHandlingErrors(onChange, e)}
|
|
97
|
+
placeholder={placeholder}
|
|
98
|
+
value={value}
|
|
99
|
+
id={id}
|
|
100
|
+
autoFocus={autoFocus}
|
|
101
|
+
ref={ref}
|
|
102
|
+
disabled={disabled}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
|
|
106
|
+
{alertText || successAlertText ? (
|
|
107
|
+
<Validation text={alertText || successAlertText} isSuccessAlert={!alertText} />
|
|
108
|
+
) : null}
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
Textarea.propTypes = {
|
|
115
|
+
name: PropTypes.string,
|
|
116
|
+
onChange: PropTypes.func,
|
|
117
|
+
placeholder: PropTypes.string,
|
|
118
|
+
alertText: PropTypes.string,
|
|
119
|
+
successAlertText: PropTypes.string,
|
|
120
|
+
value: PropTypes.string,
|
|
121
|
+
label: PropTypes.string,
|
|
122
|
+
id: PropTypes.string,
|
|
123
|
+
autoFocus: PropTypes.bool,
|
|
124
|
+
fullHeight: PropTypes.bool,
|
|
125
|
+
smallText: PropTypes.bool,
|
|
126
|
+
adaptiveHeight: PropTypes.bool,
|
|
127
|
+
disabled: PropTypes.bool,
|
|
128
|
+
errorEncountered: PropTypes.bool,
|
|
129
|
+
ignoreEnter: PropTypes.bool,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
Textarea.defaultProps = {
|
|
133
|
+
name: "",
|
|
134
|
+
onChange: () => {},
|
|
135
|
+
placeholder: "",
|
|
136
|
+
alertText: "",
|
|
137
|
+
successAlertText: "",
|
|
138
|
+
value: "",
|
|
139
|
+
label: "",
|
|
140
|
+
id: null,
|
|
141
|
+
autoFocus: false,
|
|
142
|
+
fullHeight: false,
|
|
143
|
+
smallText: false,
|
|
144
|
+
adaptiveHeight: false,
|
|
145
|
+
disabled: false,
|
|
146
|
+
errorEncountered: false,
|
|
147
|
+
ignoreEnter: false,
|
|
148
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.textarea {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
|
|
7
|
+
&.full-height {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&-input {
|
|
12
|
+
@extend %text-medium;
|
|
13
|
+
padding: Padding("5");
|
|
14
|
+
border-radius: 7px;
|
|
15
|
+
background: SolidColor("lightsmoke");
|
|
16
|
+
border: none;
|
|
17
|
+
width: 100%;
|
|
18
|
+
resize: none;
|
|
19
|
+
min-height: 117px;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
color: SolidColor("grey");
|
|
22
|
+
appearance: none;
|
|
23
|
+
transition: 0.2s box-shadow $transitionEaseOut;
|
|
24
|
+
box-shadow: $shadowOutlineStatic;
|
|
25
|
+
|
|
26
|
+
&-label {
|
|
27
|
+
@include typograpy(h6);
|
|
28
|
+
font-weight: $semi-bold;
|
|
29
|
+
color: SolidColor("grey");
|
|
30
|
+
margin-bottom: Margin("2");
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (hover: hover) {
|
|
35
|
+
&:hover:not(:focus) {
|
|
36
|
+
box-shadow: $shadowOutlineHover;
|
|
37
|
+
transition: 0.02s box-shadow $transitionEaseOut;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus {
|
|
42
|
+
box-shadow: $shadowOutlineActive;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::placeholder {
|
|
46
|
+
@extend %text-medium;
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
color: SolidColor("grey");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.full-height {
|
|
52
|
+
height: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.adaptive-height {
|
|
56
|
+
min-height: auto;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.small-text {
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.disabled {
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.error-encountered {
|
|
68
|
+
box-shadow: $shadowOutlineError !important;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./title-box.module.scss";
|
|
5
|
+
|
|
6
|
+
import { useCallHandlingErrors } from "../../../hooks/useCallHandlingErrors.js";
|
|
7
|
+
import { copyBrowserTextToClipboard } from "../../../utils/textUtils.js";
|
|
8
|
+
|
|
9
|
+
import { NoticeIcon } from "../NoticeIcon/NoticeIcon.jsx";
|
|
10
|
+
import { LinkButton } from "../buttons/LinkButton/LinkButton.jsx";
|
|
11
|
+
import { Tooltip, TOOLTIP_POSITIONS } from "../Tooltip/Tooltip.jsx";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A box component for displaying a title with optional controls like buttons or icons and any children inside.
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @param {Object} props - The props object.
|
|
18
|
+
* @param {string} props.title - The main title text.
|
|
19
|
+
* @param {string} [props.linkText] - The text for the link button, if any.
|
|
20
|
+
* @param {Function} [props.linkButtonClick] - The function to execute when the link button is clicked.
|
|
21
|
+
* @param {boolean} [props.isLinkButtonDisabled] - Determines if the link button is disabled.
|
|
22
|
+
* @param {React.ReactNode} props.children - Child components to be rendered.
|
|
23
|
+
* @param {boolean} [props.linkButtonLoader] - Displays a loader animation on the link button if true.
|
|
24
|
+
* @param {boolean} [props.fullWidth] - If true, the title box will take full width of its container.
|
|
25
|
+
* @param {string} [props.titleNoticeText] - The text for a notice icon tooltip.
|
|
26
|
+
* @param {string} [props.titleNoticeIcon] - The icon for the notice tooltip.
|
|
27
|
+
* @param {string} [props.titleNoticePosition] - Tooltip position for the notice icon.
|
|
28
|
+
* @param {boolean} [props.bigTitle] - If true, uses a larger font size for the title.
|
|
29
|
+
* @param {boolean} [props.transparentTitle] - If true, the title has a transparent background.
|
|
30
|
+
* @param {string} [props.copyButtonText] - The text for the copy button.
|
|
31
|
+
* @param {string} [props.copyButtonContent] - The content to be copied to the clipboard.
|
|
32
|
+
* @param {string} [props.copyButtonTooltipContent] - Tooltip content displayed after copying.
|
|
33
|
+
*/
|
|
34
|
+
export const TitleBox = ({
|
|
35
|
+
title = "",
|
|
36
|
+
linkText = "",
|
|
37
|
+
linkButtonClick = resetButtonLoader => {},
|
|
38
|
+
isLinkButtonDisabled = false,
|
|
39
|
+
children,
|
|
40
|
+
linkButtonLoader = false,
|
|
41
|
+
fullWidth = true,
|
|
42
|
+
titleNoticeText = "",
|
|
43
|
+
titleNoticeIcon,
|
|
44
|
+
titleNoticePosition,
|
|
45
|
+
bigTitle = false,
|
|
46
|
+
transparentTitle = false,
|
|
47
|
+
copyButtonText,
|
|
48
|
+
copyButtonContent,
|
|
49
|
+
copyButtonTooltipContent,
|
|
50
|
+
}) => {
|
|
51
|
+
const handleError = useCallHandlingErrors();
|
|
52
|
+
|
|
53
|
+
const transparentTitleClass = transparentTitle ? s["transparent-title"] : "";
|
|
54
|
+
|
|
55
|
+
const [showCopyNotice, setShowCopyNotice] = useState(false);
|
|
56
|
+
|
|
57
|
+
const handleCopyButton = e => {
|
|
58
|
+
handleError(() => {
|
|
59
|
+
setShowCopyNotice(true);
|
|
60
|
+
copyBrowserTextToClipboard(copyButtonContent);
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
setShowCopyNotice(false);
|
|
63
|
+
}, 1500);
|
|
64
|
+
}, e);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className={`${s["title-box"]} ${fullWidth ? s["full-width"] : ""}`}>
|
|
69
|
+
{title || titleNoticeText || linkText ? (
|
|
70
|
+
<div className={s["title-box-wrapper"]}>
|
|
71
|
+
{bigTitle ? (
|
|
72
|
+
<h5 className={s["title-box-wrapper-title"] + " " + transparentTitleClass}>{title}</h5>
|
|
73
|
+
) : (
|
|
74
|
+
<h6 className={s["title-box-wrapper-title"] + " " + transparentTitleClass}>{title}</h6>
|
|
75
|
+
)}
|
|
76
|
+
{titleNoticeText ? (
|
|
77
|
+
<NoticeIcon
|
|
78
|
+
noticeText={titleNoticeText}
|
|
79
|
+
titleNoticeIcon={titleNoticeIcon}
|
|
80
|
+
tooltipPosition={titleNoticePosition}
|
|
81
|
+
/>
|
|
82
|
+
) : null}
|
|
83
|
+
{copyButtonContent && copyButtonText ? (
|
|
84
|
+
<div className={s["title-box-wrapper-link-button"]}>
|
|
85
|
+
<LinkButton
|
|
86
|
+
content={copyButtonText}
|
|
87
|
+
onClick={handleCopyButton}
|
|
88
|
+
isLoadable={false}
|
|
89
|
+
isDisabled={false}
|
|
90
|
+
/>
|
|
91
|
+
<Tooltip position={TOOLTIP_POSITIONS.TOP_LEFT} showTooltip={showCopyNotice}>
|
|
92
|
+
{copyButtonTooltipContent}
|
|
93
|
+
</Tooltip>
|
|
94
|
+
</div>
|
|
95
|
+
) : linkText ? (
|
|
96
|
+
<div className={s["title-box-wrapper-link-button"]}>
|
|
97
|
+
<LinkButton
|
|
98
|
+
content={linkText}
|
|
99
|
+
onClick={linkButtonClick}
|
|
100
|
+
isLoadable={linkButtonLoader}
|
|
101
|
+
isDisabled={isLinkButtonDisabled}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
) : null}
|
|
105
|
+
</div>
|
|
106
|
+
) : null}
|
|
107
|
+
{children}
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
TitleBox.propTypes = {
|
|
113
|
+
title: PropTypes.string,
|
|
114
|
+
linkText: PropTypes.string,
|
|
115
|
+
linkButtonClick: PropTypes.func,
|
|
116
|
+
isLinkButtonDisabled: PropTypes.bool,
|
|
117
|
+
children: PropTypes.node,
|
|
118
|
+
linkButtonLoader: PropTypes.bool,
|
|
119
|
+
fullWidth: PropTypes.bool,
|
|
120
|
+
titleNoticeText: PropTypes.string,
|
|
121
|
+
titleNoticeIcon: PropTypes.string,
|
|
122
|
+
titleNoticePosition: PropTypes.string,
|
|
123
|
+
bigTitle: PropTypes.bool,
|
|
124
|
+
transparentTitle: PropTypes.bool,
|
|
125
|
+
copyButtonText: PropTypes.string,
|
|
126
|
+
copyButtonContent: PropTypes.string,
|
|
127
|
+
copyButtonTooltipContent: PropTypes.string,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
TitleBox.defaultProps = {
|
|
131
|
+
title: "",
|
|
132
|
+
linkText: "",
|
|
133
|
+
linkButtonClick: () => {},
|
|
134
|
+
isLinkButtonDisabled: false,
|
|
135
|
+
linkButtonLoader: false,
|
|
136
|
+
fullWidth: true,
|
|
137
|
+
titleNoticeText: "",
|
|
138
|
+
titleNoticePosition: TOOLTIP_POSITIONS.TOP,
|
|
139
|
+
bigTitle: false,
|
|
140
|
+
transparentTitle: false,
|
|
141
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.title-box {
|
|
4
|
+
&.full-width {
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-wrapper {
|
|
9
|
+
width: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
flex-grow: 1;
|
|
14
|
+
margin-bottom: Margin("1");
|
|
15
|
+
gap: Margin("2");
|
|
16
|
+
min-height: 26px;
|
|
17
|
+
|
|
18
|
+
&-title {
|
|
19
|
+
color: SolidColor("grey");
|
|
20
|
+
font-weight: $semi-bold;
|
|
21
|
+
text-align: left;
|
|
22
|
+
|
|
23
|
+
&.transparent-title {
|
|
24
|
+
color: rgba($white, 0.2);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-link-button {
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CSSTransition } from "react-transition-group";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
|
|
5
|
+
import s from "./tooltip.module.scss";
|
|
6
|
+
import DarkRectangle from "../../../assets/wrappedImages/darkRectangle.jsx";
|
|
7
|
+
|
|
8
|
+
import { useCallHandlingErrors } from "../../../hooks/useCallHandlingErrors.js";
|
|
9
|
+
|
|
10
|
+
export const TOOLTIP_POSITIONS = {
|
|
11
|
+
TOP: "top",
|
|
12
|
+
LEFT: "left",
|
|
13
|
+
RIGHT: "right",
|
|
14
|
+
BOTTOM: "bottom",
|
|
15
|
+
TOP_LEFT: "top-left",
|
|
16
|
+
TOP_RIGHT: "top-right",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Tooltip component for displaying contextual information.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @param {Object} props - The props object.
|
|
24
|
+
* @param {React.ReactNode} props.children - The content to display inside the tooltip.
|
|
25
|
+
* @param {boolean} props.showTooltip - Controls whether the tooltip is visible.
|
|
26
|
+
* @param {Function} props.handleClick - Handler for click events.
|
|
27
|
+
* @param {boolean} [props.wide] - If true, applies a wider style to the tooltip.
|
|
28
|
+
* @param {string} props.position - One of the predefined positions for the tooltip.
|
|
29
|
+
* @param {boolean} [props.ignorePointerEvents] - If true, the tooltip will not react to pointer events.
|
|
30
|
+
*/
|
|
31
|
+
export const Tooltip = ({
|
|
32
|
+
children,
|
|
33
|
+
showTooltip,
|
|
34
|
+
handleClick = () => {},
|
|
35
|
+
wide = false,
|
|
36
|
+
position = TOOLTIP_POSITIONS.TOP,
|
|
37
|
+
ignorePointerEvents = false,
|
|
38
|
+
}) => {
|
|
39
|
+
const handleError = useCallHandlingErrors();
|
|
40
|
+
|
|
41
|
+
const onClick = e => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
handleClick();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<CSSTransition in={showTooltip} timeout={400} unmountOnExit>
|
|
48
|
+
<span
|
|
49
|
+
className={`${s["tooltip"]} ${wide ? s["wide"] : ""} ${s[position]} ${
|
|
50
|
+
ignorePointerEvents ? s["ignore-pointer"] : ""
|
|
51
|
+
}`}
|
|
52
|
+
onClick={e => handleError(onClick, e)}
|
|
53
|
+
onDoubleClick={e => handleError(e => e.stopPropagation(), e)}
|
|
54
|
+
>
|
|
55
|
+
<DarkRectangle />
|
|
56
|
+
{/*<img src={darkRectangle} alt="dark rectangle" />*/}
|
|
57
|
+
{children}
|
|
58
|
+
</span>
|
|
59
|
+
</CSSTransition>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
Tooltip.propTypes = {
|
|
64
|
+
children: PropTypes.node.isRequired,
|
|
65
|
+
showTooltip: PropTypes.bool.isRequired,
|
|
66
|
+
handleClick: PropTypes.func,
|
|
67
|
+
wide: PropTypes.bool,
|
|
68
|
+
position: PropTypes.oneOf(Object.values(TOOLTIP_POSITIONS)),
|
|
69
|
+
ignorePointerEvents: PropTypes.bool,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
Tooltip.defaultProps = {
|
|
73
|
+
handleClick: () => {},
|
|
74
|
+
wide: false,
|
|
75
|
+
position: TOOLTIP_POSITIONS.TOP,
|
|
76
|
+
ignorePointerEvents: false,
|
|
77
|
+
};
|