@rabbitio/ui-kit 1.0.0-beta.8 → 1.0.0-beta.80
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 +16372 -0
- package/coverage/coverage-final.json +154 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +1151 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/ui-kit/index.html +116 -0
- package/coverage/ui-kit/index.js.html +88 -0
- package/coverage/ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
- package/coverage/ui-kit/src/common-apis/adapters/index.html +131 -0
- package/coverage/ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
- package/coverage/ui-kit/src/common-apis/amountUtils.js.html +1162 -0
- package/coverage/ui-kit/src/common-apis/errorUtils.js.html +211 -0
- package/coverage/ui-kit/src/common-apis/external-apis/apiGroups.js.html +250 -0
- package/coverage/ui-kit/src/common-apis/external-apis/index.html +131 -0
- package/coverage/ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +352 -0
- package/coverage/ui-kit/src/common-apis/fiatCurrenciesService.js.html +544 -0
- package/coverage/ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
- package/coverage/ui-kit/src/common-apis/index.html +161 -0
- package/coverage/ui-kit/src/common-apis/models/blockchain.js.html +115 -0
- package/coverage/ui-kit/src/common-apis/models/coin.js.html +544 -0
- package/coverage/ui-kit/src/common-apis/models/index.html +146 -0
- package/coverage/ui-kit/src/common-apis/models/protocol.js.html +100 -0
- package/coverage/ui-kit/src/common-apis/utils/cache.js.html +811 -0
- package/coverage/ui-kit/src/common-apis/utils/emailAPI.js.html +133 -0
- package/coverage/ui-kit/src/common-apis/utils/index.html +161 -0
- package/coverage/ui-kit/src/common-apis/utils/logging/index.html +131 -0
- package/coverage/ui-kit/src/common-apis/utils/logging/logger.js.html +208 -0
- package/coverage/ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
- package/coverage/ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
- package/coverage/ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
- package/coverage/ui-kit/src/index.html +116 -0
- package/coverage/ui-kit/src/index.js.html +337 -0
- package/coverage/ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1570 -0
- package/coverage/ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
- package/coverage/ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
- package/coverage/ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
- package/coverage/ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
- package/coverage/ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
- package/coverage/ui-kit/src/robust-api-caller/index.html +206 -0
- package/coverage/ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/index.html +146 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1513 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1558 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1735 -0
- package/coverage/ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +223 -0
- package/coverage/ui-kit/src/swaps-lib/models/existingSwap.js.html +304 -0
- package/coverage/ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +469 -0
- package/coverage/ui-kit/src/swaps-lib/models/index.html +146 -0
- package/coverage/ui-kit/src/swaps-lib/services/index.html +116 -0
- package/coverage/ui-kit/src/swaps-lib/services/publicSwapService.js.html +2098 -0
- package/coverage/ui-kit/src/swaps-lib/utils/index.html +116 -0
- package/coverage/ui-kit/src/swaps-lib/utils/swapUtils.js.html +670 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/index.html +251 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +235 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +208 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +712 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +421 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1060 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1618 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
- package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +451 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1699 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4075 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/hooks/index.html +146 -0
- package/coverage/ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +151 -0
- package/coverage/ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
- package/coverage/ui-kit/src/ui-kit/utils/index.html +161 -0
- package/coverage/ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
- package/coverage/ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
- package/coverage/ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
- package/coverage/ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
- package/coverage/ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
- package/coverage/ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
- package/coverage/ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
- package/coverage/ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
- package/coverage/ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
- package/coverage/ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
- package/coverage/ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
- package/coverage/ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
- package/coverage/ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
- package/coverage/ui-kit/stories/atoms/buttons/index.html +146 -0
- package/coverage/ui-kit/stories/atoms/index.html +191 -0
- package/coverage/ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
- package/coverage/ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
- package/coverage/ui-kit/stories/molecules/index.html +131 -0
- package/coverage/ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
- package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
- package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
- package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/ui-kit/stories/organisms/Dialog/index.html +116 -0
- package/coverage/ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
- package/coverage/ui-kit/stories/stubs/index.html +116 -0
- package/coverage/ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
- package/coverage/ui-kit/stories/templates/index.html +116 -0
- package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/609.949af3f6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/693.1acf0184.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/862.c15e3c9c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/893.e21210d8.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/996.10688684.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.662d6a83.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.da7b9f1f.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.d336c1a5.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/index.html +536 -0
- package/coverage/ui-kit/storybook-static/main.75ff1c31.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.2d2d5753.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.b79c32a3.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +118 -0
- package/coverage/ui-kit/storybook-static/runtime~main.b108a22d.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +121 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +1588 -0
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +106 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +1129 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +112 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +1303 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +553 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/index.html +281 -0
- package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/index.html +131 -0
- package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +421 -0
- package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +85 -0
- package/dist/global.css +197 -0
- package/dist/global.css.map +1 -0
- package/dist/index.cjs +10864 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2212 -8491
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +8354 -22
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +10784 -23
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +10855 -25
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +36 -9
- package/src/common-apis/adapters/axiosAdapter.js +35 -0
- package/src/common-apis/adapters/qrUtils.js +18 -0
- package/src/common-apis/amountUtils.js +359 -0
- package/src/common-apis/errorUtils.js +42 -0
- package/src/common-apis/external-apis/apiGroups.js +55 -0
- package/src/common-apis/external-apis/ipAddressProviders.js +89 -0
- package/src/common-apis/fiatCurrenciesService.js +153 -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 +153 -0
- package/src/common-apis/models/protocol.js +5 -0
- package/src/common-apis/tests/amountUtils/composeRateText.test.js +152 -0
- package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +12 -0
- package/src/common-apis/utils/cache.js +242 -0
- package/src/common-apis/utils/emailAPI.js +16 -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/safeStringify.js +50 -0
- package/src/index.js +84 -0
- 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/letsExchangeSwapProvider.js +476 -0
- package/src/swaps-lib/external-apis/swapProvider.js +491 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +550 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +46 -0
- package/src/swaps-lib/models/existingSwap.js +73 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +128 -0
- package/src/swaps-lib/services/publicSwapService.js +671 -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 +538 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1249 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1700 -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 +165 -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/noticeQuestionIcon.jsx +54 -0
- package/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
- package/src/ui-kit/assets/wrappedImages/walletIcon.jsx +22 -0
- package/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx +57 -0
- package/{stories → src/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/{stories → src/ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
- package/{stories → src/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 +50 -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/{stories → src/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 +41 -0
- package/src/ui-kit/components/atoms/Validation/validation.module.scss +15 -0
- package/{stories → src/ui-kit/components}/atoms/buttons/Button/Button.jsx +24 -50
- package/{stories → src/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 +325 -0
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +199 -0
- package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +511 -0
- package/src/ui-kit/components/molecules/CoinPicker/coin-picker.module.scss +207 -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/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 +122 -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 +538 -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 +1330 -0
- package/src/ui-kit/components/organisms/SwapForm/swap-form.module.scss +134 -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 +132 -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/stubs/exampleContent.jsx +20 -0
- package/stories/atoms/AssetIcon/AssetIcon.jsx +0 -55
- package/stories/index.js +0 -4
- 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,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./lines-of-text.module.scss";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Renders up to three lines of text with configurable options for horizontal layout, text wrapping, and breaking.
|
|
8
|
+
* Optionally, displays a default text content centered vertically if provided.
|
|
9
|
+
*
|
|
10
|
+
* @component
|
|
11
|
+
* @param {Object} props - The props object.
|
|
12
|
+
* @param {string} props.firstLineText - Text for the first line.
|
|
13
|
+
* @param {string} props.secondLineText - Text for the second line.
|
|
14
|
+
* @param {string} props.thirdLineText - Text for the third line.
|
|
15
|
+
* @param {boolean} props.isHorizontal - If true, displays the text horizontally.
|
|
16
|
+
* @param {string} [props.defaultTextContent] - Default text content to display, centered vertically.
|
|
17
|
+
* @param {boolean} [props.isFirstLineTextReducible] - If true, the first line text can be reduced.
|
|
18
|
+
* @param {string} [props.firstLineNotReducibleSuffix] - Suffix to append to the first line text if not reducible.
|
|
19
|
+
* @param {boolean} [props.wrapFirstLine] - If true, allows the first line text to wrap.
|
|
20
|
+
* @param {boolean} [props.breakFirstLine] - If true, allows the first line text to break onto the next line.
|
|
21
|
+
*/
|
|
22
|
+
export const LinesOfText = ({
|
|
23
|
+
firstLineText = "",
|
|
24
|
+
secondLineText = "",
|
|
25
|
+
thirdLineText = "",
|
|
26
|
+
isHorizontal = false,
|
|
27
|
+
defaultTextContent = "",
|
|
28
|
+
isFirstLineTextReducible = false,
|
|
29
|
+
firstLineNotReducibleSuffix = "",
|
|
30
|
+
wrapFirstLine = false,
|
|
31
|
+
breakFirstLine = false,
|
|
32
|
+
}) => {
|
|
33
|
+
return defaultTextContent ? (
|
|
34
|
+
<div className={s["centered-vertically"]}>{defaultTextContent}</div>
|
|
35
|
+
) : (
|
|
36
|
+
<div className={isHorizontal ? s["horizontal"] : ""}>
|
|
37
|
+
<h5 className={s["first-line-text"]}>
|
|
38
|
+
<span
|
|
39
|
+
className={`${isFirstLineTextReducible ? s["shorted"] : s["full-text"]} ${
|
|
40
|
+
wrapFirstLine ? " " + s["wrap"] : ""
|
|
41
|
+
} ${breakFirstLine ? " " + s["break"] : ""}`}
|
|
42
|
+
>
|
|
43
|
+
{firstLineText}
|
|
44
|
+
</span>
|
|
45
|
+
{`\u00A0${firstLineNotReducibleSuffix}`}
|
|
46
|
+
</h5>
|
|
47
|
+
{isHorizontal ? <div className={"line"} /> : null}
|
|
48
|
+
{secondLineText ? <p className={s["second-line-text"]}>{secondLineText}</p> : null}
|
|
49
|
+
{thirdLineText ? <p className={s["second-line-text"]}>{thirdLineText}</p> : null}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
LinesOfText.propTypes = {
|
|
55
|
+
firstLineText: PropTypes.string,
|
|
56
|
+
secondLineText: PropTypes.string,
|
|
57
|
+
thirdLineText: PropTypes.string,
|
|
58
|
+
isHorizontal: PropTypes.bool,
|
|
59
|
+
defaultTextContent: PropTypes.string,
|
|
60
|
+
isFirstLineTextReducible: PropTypes.bool,
|
|
61
|
+
firstLineNotReducibleSuffix: PropTypes.string,
|
|
62
|
+
wrapFirstLine: PropTypes.bool,
|
|
63
|
+
breakFirstLine: PropTypes.bool,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
LinesOfText.defaultProps = {
|
|
67
|
+
firstLineText: "",
|
|
68
|
+
secondLineText: "",
|
|
69
|
+
thirdLineText: "",
|
|
70
|
+
isHorizontal: false,
|
|
71
|
+
defaultTextContent: "",
|
|
72
|
+
isFirstLineTextReducible: false,
|
|
73
|
+
firstLineNotReducibleSuffix: "",
|
|
74
|
+
wrapFirstLine: false,
|
|
75
|
+
breakFirstLine: false,
|
|
76
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.first-line-text {
|
|
4
|
+
display: flex;
|
|
5
|
+
font-weight: $bold;
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
// font-family: NunitoSans;
|
|
8
|
+
text-align: left;
|
|
9
|
+
|
|
10
|
+
.wrap {
|
|
11
|
+
white-space: normal;
|
|
12
|
+
word-wrap: break-word;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.break {
|
|
16
|
+
word-break: break-all;
|
|
17
|
+
white-space: break-spaces;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.full-text {
|
|
21
|
+
width: 100%;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: Margin("2");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.shorted {
|
|
28
|
+
word-wrap: unset;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
|
|
33
|
+
@media (max-width: $tablet-width) {
|
|
34
|
+
width: auto;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.horizontal {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
|
|
43
|
+
@media (max-width: $phone-width) {
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: flex-start;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.line {
|
|
49
|
+
width: 20px;
|
|
50
|
+
margin: 0 Margin("3");
|
|
51
|
+
text-align: left;
|
|
52
|
+
// font-family: NunitoSans;
|
|
53
|
+
|
|
54
|
+
@media (max-width: $phone-width) {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.second-line-text {
|
|
61
|
+
color: SolidColor("grey");
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
text-align: left;
|
|
64
|
+
// font-family: NunitoSans;
|
|
65
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./validation.module.scss";
|
|
5
|
+
import SuccessfulValidationIcon from "../../../assets/wrappedImages/successfulValidationIcon.jsx";
|
|
6
|
+
import FailedValidationIcon from "../../../assets/wrappedImages/failedValidationIcon.jsx";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Simple validation message with an icon.
|
|
10
|
+
* It shows either a success or failure icon based on the isSuccessAlert prop.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} props - The component props.
|
|
13
|
+
* @param {string} props.text - The validation message text to display.
|
|
14
|
+
* @param {boolean} props.isSuccessAlert - Determines if the displayed alert is for a success (true) or failure (false).
|
|
15
|
+
*/
|
|
16
|
+
export const Validation = ({ text = "", isSuccessAlert }) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className={s["validation"]}>
|
|
19
|
+
<div>
|
|
20
|
+
{isSuccessAlert ? (
|
|
21
|
+
// <img src={successfulValidationIcon} alt="validation icon" />
|
|
22
|
+
<SuccessfulValidationIcon />
|
|
23
|
+
) : (
|
|
24
|
+
// <img src={failedValidationIcon} alt="validation icon" />
|
|
25
|
+
<FailedValidationIcon />
|
|
26
|
+
)}
|
|
27
|
+
</div>
|
|
28
|
+
<span className={s["validation-text"]}>{text}</span>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
Validation.propTypes = {
|
|
34
|
+
text: PropTypes.string,
|
|
35
|
+
isSuccessAlert: PropTypes.bool.isRequired,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Validation.defaultProps = {
|
|
39
|
+
text: "",
|
|
40
|
+
isSuccessAlert: false,
|
|
41
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use "../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.validation {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin-top: Margin("3");
|
|
7
|
+
|
|
8
|
+
&-text {
|
|
9
|
+
text-align: left;
|
|
10
|
+
color: SolidColor("sky");
|
|
11
|
+
margin-left: Margin("2");
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
@extend %text-semibold;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -46,7 +46,7 @@ export const Button = ({
|
|
|
46
46
|
icon = "",
|
|
47
47
|
content = "",
|
|
48
48
|
isDisabled = false,
|
|
49
|
-
setClickTrigger =
|
|
49
|
+
setClickTrigger = p => {},
|
|
50
50
|
isFormSubmittingButton = false,
|
|
51
51
|
bigIcon = false,
|
|
52
52
|
checkmarkOnClick = false,
|
|
@@ -72,7 +72,7 @@ export const Button = ({
|
|
|
72
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
73
|
}, [isLoading]);
|
|
74
74
|
|
|
75
|
-
const buttonClick =
|
|
75
|
+
const buttonClick = e => {
|
|
76
76
|
if (isLoading || isDisabled) {
|
|
77
77
|
return false;
|
|
78
78
|
}
|
|
@@ -84,7 +84,11 @@ export const Button = ({
|
|
|
84
84
|
}, 2000);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
e
|
|
87
|
+
if (e?.persist) {
|
|
88
|
+
// Persisting React's SyntheticEvent to be able to use it in any async context
|
|
89
|
+
e.persist();
|
|
90
|
+
}
|
|
91
|
+
|
|
88
92
|
!propagatePrimaryButtonClick && e.stopPropagation();
|
|
89
93
|
if (loader) {
|
|
90
94
|
setIsLoading(true);
|
|
@@ -99,77 +103,47 @@ export const Button = ({
|
|
|
99
103
|
(fullWidthOnMobiles ? ` ${styles["full-width-on-mobiles"]}` : "") +
|
|
100
104
|
(fullWidthOnTablets ? ` ${styles["full-width-on-tablets"]}` : "") +
|
|
101
105
|
(isDisabled ? ` ${styles.disable}` : "") +
|
|
102
|
-
(smallPaddingOnSmallMobiles
|
|
103
|
-
? ` ${styles["small-padding-on-small-mobiles"]}`
|
|
104
|
-
: "");
|
|
106
|
+
(smallPaddingOnSmallMobiles ? ` ${styles["small-padding-on-small-mobiles"]}` : "");
|
|
105
107
|
|
|
106
108
|
return (
|
|
107
109
|
<>
|
|
108
110
|
{isFormSubmittingButton ? <input type="submit" hidden /> : null}
|
|
109
111
|
{to ? (
|
|
110
|
-
<a
|
|
111
|
-
className={classNames}
|
|
112
|
-
onClick={(e) => handleError(buttonClick, e)}
|
|
113
|
-
href={to}
|
|
114
|
-
ref={buttonRef}
|
|
115
|
-
>
|
|
112
|
+
<a className={classNames} onClick={e => handleError(buttonClick, e)} href={to} ref={buttonRef}>
|
|
116
113
|
{icon ? (
|
|
117
|
-
<div
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
(bigIcon ? ` ${styles["big-icon"]}` : "")
|
|
121
|
-
}
|
|
122
|
-
>
|
|
123
|
-
<img src={icon} alt="button icon" />
|
|
124
|
-
<span className={styles["button-with-icon-text"]}>
|
|
125
|
-
{content}
|
|
126
|
-
</span>
|
|
114
|
+
<div className={styles["button-with-icon"] + (bigIcon ? ` ${styles["big-icon"]}` : "")}>
|
|
115
|
+
<img src={icon} alt="button icon" loading="lazy" />
|
|
116
|
+
<span className={styles["button-with-icon-text"]}>{content}</span>
|
|
127
117
|
</div>
|
|
128
118
|
) : (
|
|
129
119
|
content
|
|
130
120
|
)}
|
|
131
121
|
</a>
|
|
132
122
|
) : (
|
|
133
|
-
<div
|
|
134
|
-
className={classNames}
|
|
135
|
-
onClick={(e) => handleError(buttonClick, e)}
|
|
136
|
-
ref={buttonRef}
|
|
137
|
-
>
|
|
123
|
+
<div className={classNames} onClick={e => handleError(buttonClick, e)} ref={buttonRef}>
|
|
138
124
|
<div
|
|
139
|
-
className={`${styles["button-primary-dots-wrapper"]} ${
|
|
140
|
-
isLoading && loader ? styles.show : ""
|
|
141
|
-
}`}
|
|
125
|
+
className={`${styles["button-primary-dots-wrapper"]} ${isLoading && loader ? styles.show : ""}`}
|
|
142
126
|
>
|
|
143
|
-
{loader && isLoading ?
|
|
144
|
-
<LoadingDots isColored={mode === "white"} />
|
|
145
|
-
) : null}
|
|
127
|
+
{loader && isLoading ? <LoadingDots isColored={mode === "white"} /> : null}
|
|
146
128
|
</div>
|
|
147
129
|
<div
|
|
148
|
-
className={`${styles["button-success-icon"]} ${
|
|
149
|
-
styles[
|
|
150
|
-
}
|
|
130
|
+
className={`${styles["button-success-icon"]} ${styles[mode]} ${
|
|
131
|
+
isCheckShown ? styles["show"] : ""
|
|
132
|
+
}`}
|
|
151
133
|
></div>
|
|
152
134
|
{icon ? (
|
|
153
135
|
<div
|
|
154
136
|
className={`${styles["button-with-icon"]} ${
|
|
155
|
-
(isLoading && loader) ||
|
|
156
|
-
(checkmarkOnClick && isCheckShown)
|
|
157
|
-
? styles["hide"]
|
|
158
|
-
: ""
|
|
137
|
+
(isLoading && loader) || (checkmarkOnClick && isCheckShown) ? styles["hide"] : ""
|
|
159
138
|
} ${bigIcon ? styles["big-icon"] : ""}`}
|
|
160
139
|
>
|
|
161
|
-
<img src={icon} alt="button icon" />
|
|
162
|
-
<span className={styles["button-with-icon-text"]}>
|
|
163
|
-
{content}
|
|
164
|
-
</span>
|
|
140
|
+
<img src={icon} alt="button icon" loading="lazy" />
|
|
141
|
+
<span className={styles["button-with-icon-text"]}>{content}</span>
|
|
165
142
|
</div>
|
|
166
143
|
) : (
|
|
167
144
|
<span
|
|
168
145
|
className={`${styles["button-text"]} ${
|
|
169
|
-
(isLoading && loader) ||
|
|
170
|
-
(checkmarkOnClick && isCheckShown)
|
|
171
|
-
? styles["hide"]
|
|
172
|
-
: ""
|
|
146
|
+
(isLoading && loader) || (checkmarkOnClick && isCheckShown) ? styles["hide"] : ""
|
|
173
147
|
}`}
|
|
174
148
|
>
|
|
175
149
|
{content}
|
|
@@ -225,11 +199,11 @@ Button.defaultProps = {
|
|
|
225
199
|
icon: "",
|
|
226
200
|
content: "",
|
|
227
201
|
isDisabled: false,
|
|
228
|
-
setClickTrigger:
|
|
202
|
+
setClickTrigger: p => {},
|
|
229
203
|
isFormSubmittingButton: false,
|
|
230
204
|
bigIcon: false,
|
|
231
205
|
checkmarkOnClick: false,
|
|
232
206
|
propagatePrimaryButtonClick: true,
|
|
233
207
|
smallPaddingOnSmallMobiles: false,
|
|
234
|
-
handleError:
|
|
208
|
+
handleError: func => func(),
|
|
235
209
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./close.module.scss";
|
|
5
|
+
|
|
6
|
+
import { useCallHandlingErrors } from "../../../../hooks/useCallHandlingErrors.js";
|
|
7
|
+
|
|
8
|
+
export const CLOSE_COLORS = {
|
|
9
|
+
WHITE: "white",
|
|
10
|
+
DARK: "dark",
|
|
11
|
+
DARK_INVERT: "dark-invert",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A component for rendering a close icon that handles errors on click.
|
|
16
|
+
* This component uses an SVG to render the icon and allows customization
|
|
17
|
+
* through props for color, size, and the click event handling.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} props - The properties passed to the component.
|
|
20
|
+
* @param {string} props.color - The color theme of the close icon.
|
|
21
|
+
* Should be one of the properties of CLOSE_COLORS.
|
|
22
|
+
* @param {Function} props.onClick - The function to call when the icon is clicked.
|
|
23
|
+
* @param {boolean} props.large - Whether the icon should be displayed in a larger size.
|
|
24
|
+
*/
|
|
25
|
+
export const Close = ({ color = CLOSE_COLORS.WHITE, onClick = () => {}, large = false }) => {
|
|
26
|
+
const callHandlingErrors = useCallHandlingErrors();
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<svg
|
|
30
|
+
className={s["close"] + " " + s[color] + (large ? " " + s["large"] : "")}
|
|
31
|
+
onClick={e => callHandlingErrors(onClick, e)}
|
|
32
|
+
style={{ cursor: "pointer" }}
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
viewBox={`0 0 50 50`}
|
|
35
|
+
x="0px"
|
|
36
|
+
y="0px"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
d="M28.228,23.986L47.092,5.122c1.172-1.171,1.172-3.071,0-4.242c-1.172-1.172-3.07-1.172-4.242,0L23.986,19.744L5.121,0.88
|
|
40
|
+
c-1.172-1.172-3.07-1.172-4.242,0c-1.172,1.171-1.172,3.071,0,4.242l18.865,18.864L0.879,42.85c-1.172,1.171-1.172,3.071,0,4.242
|
|
41
|
+
C1.465,47.677,2.233,47.97,3,47.97s1.535-0.293,2.121-0.879l18.865-18.864L42.85,47.091c0.586,0.586,1.354,0.879,2.121,0.879
|
|
42
|
+
s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Close.propTypes = {
|
|
49
|
+
color: PropTypes.oneOf(Object.values(CLOSE_COLORS)),
|
|
50
|
+
onClick: PropTypes.func,
|
|
51
|
+
large: PropTypes.bool,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
Close.defaultProps = {
|
|
55
|
+
color: CLOSE_COLORS.WHITE,
|
|
56
|
+
onClick: () => {},
|
|
57
|
+
large: false,
|
|
58
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@use "../../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.close {
|
|
4
|
+
width: 24px;
|
|
5
|
+
height: 24px;
|
|
6
|
+
padding: 6px;
|
|
7
|
+
border-radius: 100%;
|
|
8
|
+
background-color: LightColor("grey-20");
|
|
9
|
+
opacity: 0.5;
|
|
10
|
+
transition: 0.2s all ease;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
|
|
14
|
+
&.large {
|
|
15
|
+
width: 48px;
|
|
16
|
+
height: 48px;
|
|
17
|
+
padding: 16px;
|
|
18
|
+
|
|
19
|
+
@media (max-width: $tablet-width) {
|
|
20
|
+
width: 36px;
|
|
21
|
+
height: 36px;
|
|
22
|
+
padding: 12px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.white {
|
|
27
|
+
path {
|
|
28
|
+
fill: white;
|
|
29
|
+
background-color: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.dark-invert {
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
background-color: SolidColor("grey");
|
|
36
|
+
|
|
37
|
+
@media (hover: hover) {
|
|
38
|
+
&:hover {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
transition: opacity 0.03s ease;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:active {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transition: opacity 0.03s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
path {
|
|
50
|
+
fill: SolidColor("lightsmoke");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.dark {
|
|
55
|
+
box-shadow: $shadowOutlineStatic;
|
|
56
|
+
|
|
57
|
+
@media (hover: hover) {
|
|
58
|
+
&:hover {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
transition: opacity 0.03s ease;
|
|
61
|
+
box-shadow: $shadowOutlineHover;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:active {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
transition: opacity 0.03s ease;
|
|
68
|
+
box-shadow: $shadowOutlineHover;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
path {
|
|
72
|
+
fill: SolidColor("darkBlue");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import { useCallHandlingErrors } from "../../../../hooks/useCallHandlingErrors.js";
|
|
5
|
+
|
|
6
|
+
import s from "./link-button.module.scss";
|
|
7
|
+
import { LoadingDots } from "../../LoadingDots/LoadingDots.jsx";
|
|
8
|
+
|
|
9
|
+
export const ICON_ROTATE_OPTIONS = {
|
|
10
|
+
rotate0: "0deg",
|
|
11
|
+
rotate90: "90deg",
|
|
12
|
+
rotate180: "180deg",
|
|
13
|
+
rotate270: "270deg",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* LinkButton renders a clickable button which can optionally display an icon and loading animation.
|
|
18
|
+
* It can also be styled to be colored or disabled. This button supports rotating the icon according to specified degrees.
|
|
19
|
+
*
|
|
20
|
+
* @component
|
|
21
|
+
* @param {Object} props - Properties passed down to the component.
|
|
22
|
+
* @param {Function} props.onClick - Callback function triggered on button click. It should handle any post-click logic like resetting loading state.
|
|
23
|
+
* @param {boolean} props.isDisabled - If true, the button will be disabled and non-interactable.
|
|
24
|
+
* @param {boolean} props.isLoadable - If true, the button will display a loading indicator upon being clicked.
|
|
25
|
+
* @param {string} props.content - Text content displayed on the button.
|
|
26
|
+
* @param {boolean} props.isColored - If true, applies additional styling to the button.
|
|
27
|
+
* @param {string} props.icon - URL of an icon image to be displayed on the button.
|
|
28
|
+
* @param {string} props.iconRotate - Rotation angle for the icon. Valid values are defined in `ICON_ROTATE_OPTIONS`.
|
|
29
|
+
* @param {Object} props.IconComponent - Icon component, if SVG is imported directly.
|
|
30
|
+
*
|
|
31
|
+
* @returns {JSX.Element} A React component that renders a clickable and optionally loadable and icon-displaying button.
|
|
32
|
+
*/
|
|
33
|
+
export const LinkButton = ({
|
|
34
|
+
onClick = resetButtonLoader => {},
|
|
35
|
+
isDisabled = false,
|
|
36
|
+
isLoadable = false,
|
|
37
|
+
content = "",
|
|
38
|
+
isColored = true,
|
|
39
|
+
icon,
|
|
40
|
+
iconRotate,
|
|
41
|
+
IconComponent,
|
|
42
|
+
}) => {
|
|
43
|
+
const callHandlingErrors = useCallHandlingErrors();
|
|
44
|
+
|
|
45
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
46
|
+
const [processedIconRotation, setProcessedIconRotation] = useState(null);
|
|
47
|
+
|
|
48
|
+
const handleClick = () => {
|
|
49
|
+
callHandlingErrors(() => {
|
|
50
|
+
if (!isDisabled) {
|
|
51
|
+
if (isLoadable) {
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
}
|
|
54
|
+
// TODO: [bug, moderate] Click can be called when there isLoading=true task_id=a15979a4ca2042b29dfd1d128a16c281
|
|
55
|
+
onClick(() => setIsLoading(false));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (iconRotate && Object.keys(ICON_ROTATE_OPTIONS).find(key => ICON_ROTATE_OPTIONS[key] === iconRotate))
|
|
62
|
+
setProcessedIconRotation(iconRotate);
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
}, [iconRotate]);
|
|
65
|
+
|
|
66
|
+
return isLoading ? (
|
|
67
|
+
<LoadingDots isColored={true} />
|
|
68
|
+
) : (
|
|
69
|
+
<div
|
|
70
|
+
className={
|
|
71
|
+
s["link-button"] +
|
|
72
|
+
` ${
|
|
73
|
+
processedIconRotation && processedIconRotation !== ICON_ROTATE_OPTIONS.rotate0
|
|
74
|
+
? " " + s["icon-rotate-" + processedIconRotation]
|
|
75
|
+
: ""
|
|
76
|
+
} ${isDisabled ? " " + s["disabled"] : ""}`
|
|
77
|
+
}
|
|
78
|
+
onClick={handleClick}
|
|
79
|
+
>
|
|
80
|
+
{icon ? <img src={icon} alt="link button alt" loading="lazy" /> : null}
|
|
81
|
+
{IconComponent ? <IconComponent /> : null}
|
|
82
|
+
<p
|
|
83
|
+
className={
|
|
84
|
+
s["link-button-text"] + ` ${isColored ? s["colored"] : ""} ${isDisabled ? s["disabled"] : ""}`
|
|
85
|
+
}
|
|
86
|
+
>
|
|
87
|
+
{content}
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
LinkButton.propTypes = {
|
|
94
|
+
onClick: PropTypes.func,
|
|
95
|
+
isDisabled: PropTypes.bool,
|
|
96
|
+
isLoadable: PropTypes.bool,
|
|
97
|
+
content: PropTypes.string,
|
|
98
|
+
icon: PropTypes.string,
|
|
99
|
+
isColored: PropTypes.bool,
|
|
100
|
+
iconRotate: PropTypes.oneOf(Object.values(ICON_ROTATE_OPTIONS)),
|
|
101
|
+
IconComponent: PropTypes.elementType,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
LinkButton.defaultProps = {
|
|
105
|
+
onClick: resetButtonLoader => {},
|
|
106
|
+
isDisabled: false,
|
|
107
|
+
isLoadable: false,
|
|
108
|
+
content: "",
|
|
109
|
+
icon: undefined,
|
|
110
|
+
isColored: true,
|
|
111
|
+
iconRotate: ICON_ROTATE_OPTIONS.rotate0,
|
|
112
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use "../../../../assets/styles/index" as *;
|
|
2
|
+
|
|
3
|
+
.link-button {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
&:not(.disabled) {
|
|
8
|
+
@extend %hover-state;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.icon-rotate-90deg img,
|
|
12
|
+
&.icon-rotate-90deg svg {
|
|
13
|
+
transform: rotate(90deg);
|
|
14
|
+
}
|
|
15
|
+
&.icon-rotate-180deg img,
|
|
16
|
+
&.icon-rotate-180deg svg {
|
|
17
|
+
transform: rotate(180deg);
|
|
18
|
+
}
|
|
19
|
+
&.icon-rotate-270deg img,
|
|
20
|
+
&.icon-rotate-270deg svg {
|
|
21
|
+
transform: rotate(270deg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
img,
|
|
25
|
+
svg {
|
|
26
|
+
margin-left: -3px;
|
|
27
|
+
margin-right: Margin("1");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-text {
|
|
31
|
+
@extend %text-bold;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
color: $white;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
text-align: center;
|
|
36
|
+
line-height: 14px;
|
|
37
|
+
// padding-bottom: 1px;
|
|
38
|
+
margin: 0;
|
|
39
|
+
|
|
40
|
+
&.colored {
|
|
41
|
+
color: SolidColor("tosca");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.disabled {
|
|
45
|
+
color: SolidColor("grey");
|
|
46
|
+
cursor: default;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|