@rabbitio/ui-kit 1.0.0-beta.43 → 1.0.0-beta.46
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/coverage/clover.xml +5262 -821
- package/coverage/coverage-final.json +25 -1
- package/coverage/index.html +311 -26
- package/coverage/rabbit-ui-kit/index.html +1 -1
- package/coverage/rabbit-ui-kit/index.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/adapters/axiosAdapter.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/adapters/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/amountUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/errorUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/apiGroups.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/ipAddressProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/fiatCurrenciesService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/blockchain.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/coin.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/protocol.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/cache.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/emailAPI.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logger.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logsStorage.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/postponeExecution.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/safeStringify.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/AssetIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/AssetSelection.jsx.html +364 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/LoadingDots.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/NoticeIcon.jsx.html +298 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/SupportChat.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/TitleBox.jsx.html +574 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/Tooltip.jsx.html +370 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/Validation.jsx.html +475 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/Button.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/Close.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/LinkButton.jsx.html +448 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/hooks/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/hooks/useCallHandlingErrors.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/hooks/useReferredState.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/AmountInput.jsx.html +1510 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/Dialog.jsx.html +1630 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +451 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +2077 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/SwapForm.jsx.html +3538 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/utils/index.html +24 -9
- package/coverage/rabbit-ui-kit/src/components/utils/inputValueProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/textUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/components/utils/uiUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/urlQueryUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html +88 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/index.js.html +65 -5
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cancelProcessing.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalApiProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalServicesStatsCollector.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/robustExternalAPICallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +1 -1
- 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 +1 -1
- 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 +298 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +35 -5
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +35 -5
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +574 -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 +352 -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/stubs/exampleContent.jsx.html +145 -0
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +116 -0
- package/dist/index.cjs +3022 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +40976 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +2568 -183
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +3010 -239
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +3019 -234
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -1
- package/src/assets/image/icons/arrow-darker.svg +14 -0
- package/src/assets/image/icons/arrow-tosca.svg +3 -0
- package/src/assets/image/icons/arrow-white.svg +14 -0
- package/src/assets/image/icons/dark-rectangle.svg +3 -0
- package/src/assets/image/icons/failed-validation-icon.svg +15 -0
- package/src/assets/image/icons/successful-validation-icon.svg +10 -0
- package/src/assets/image/icons/wallet-gray-small.svg +6 -0
- package/src/components/atoms/AssetSelection/AssetSelection.jsx +93 -0
- package/src/components/atoms/AssetSelection/asset-selection.module.scss +55 -0
- package/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx +44 -0
- package/src/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
- package/src/components/atoms/NoticeIcon/NoticeIcon.jsx +71 -0
- package/src/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
- package/src/components/atoms/TitleBox/TitleBox.jsx +163 -0
- package/src/components/atoms/TitleBox/title-box.module.scss +30 -0
- package/src/components/atoms/Tooltip/Tooltip.jsx +95 -0
- package/src/components/atoms/Tooltip/tooltip.module.scss +231 -0
- package/src/components/atoms/Validation/Validation.jsx +130 -0
- package/src/components/atoms/Validation/validation.module.scss +15 -0
- package/src/components/atoms/buttons/Close/Close.jsx +64 -0
- package/src/components/atoms/buttons/Close/close.module.scss +75 -0
- package/src/components/atoms/buttons/LinkButton/LinkButton.jsx +121 -0
- package/src/components/atoms/buttons/LinkButton/link-button.module.scss +45 -0
- package/src/components/molecules/AmountInput/AmountInput.jsx +475 -0
- package/src/components/molecules/AmountInput/amount-input.module.scss +189 -0
- package/src/components/organisms/Dialog/Dialog.jsx +515 -0
- package/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +122 -0
- package/src/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
- package/src/components/organisms/Dialog/DialogStep/DialogStep.jsx +664 -0
- package/src/components/organisms/Dialog/DialogStep/dialog-step.module.scss +362 -0
- package/src/components/organisms/Dialog/dialog.module.scss +223 -0
- package/src/components/organisms/SwapForm/SwapForm.jsx +1151 -0
- package/src/components/organisms/SwapForm/swap-form.module.scss +120 -0
- package/src/components/utils/textUtils.js +18 -0
- package/src/constants/organisms/dialog/DialogStep/dialogStep.js +1 -0
- package/src/constants/organisms/dialog/dialog.js +29 -0
- package/src/index.js +21 -1
- package/stories/stubs/exampleContent.jsx +20 -0
- 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/index.scss +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rabbitio/ui-kit",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.46",
|
|
4
4
|
"description": "Rabbit.io react.js components kit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -41,12 +41,18 @@
|
|
|
41
41
|
"react-dom": ">=18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
+
"animated-scroll-to": "2.3.0",
|
|
44
45
|
"axios": "1.6.7",
|
|
45
46
|
"bignumber.js": "9.1.2",
|
|
47
|
+
"body-scroll-lock": "3.1.5",
|
|
48
|
+
"clipboard-copy": "4.0.1",
|
|
46
49
|
"eventbusjs": "0.2.0",
|
|
47
50
|
"jshashes": "1.0.8",
|
|
48
51
|
"react": ">=18.2.0",
|
|
52
|
+
"react-animate-height": "3.2.3",
|
|
49
53
|
"react-dom": ">=18.2.0",
|
|
54
|
+
"react-transition-group": "4.4.5",
|
|
55
|
+
"resize-observer-polyfill": "1.5.1",
|
|
50
56
|
"uuid": "9.0.0"
|
|
51
57
|
},
|
|
52
58
|
"devDependencies": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="16"
|
|
3
|
+
height="16"
|
|
4
|
+
viewBox="0 0 16 16"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
d="M12.2431 6L8.00045 10.2426L3.75781 6"
|
|
10
|
+
stroke="#232d42" stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="16"
|
|
3
|
+
height="16"
|
|
4
|
+
viewBox="0 0 16 16"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path
|
|
9
|
+
d="M12.2431 6L8.00045 10.2426L3.75781 6"
|
|
10
|
+
stroke="#fff" stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect opacity="0.8" x="1.5" y="1.5" width="24" height="24" rx="12" fill="#DAF1FE"/>
|
|
3
|
+
<path d="M12.3259 10.5855C12.2575 9.8896 12.8063 9.28745 13.5055 9.29121C14.2008 9.29495 14.7418 9.8964 14.6722 10.5881L14.1937 15.3431C14.1575 15.7026 13.855 15.9762 13.4937 15.9762C13.1319 15.9762 12.829 15.7017 12.7936 15.3415L12.3259 10.5855Z" fill="url(#paint0_linear)"/>
|
|
4
|
+
<path d="M13.514 17.1182C14.1325 17.1182 14.634 17.6196 14.634 18.2382C14.634 18.8567 14.1325 19.3582 13.514 19.3582H13.486C12.8674 19.3582 12.366 18.8567 12.366 18.2382C12.366 17.6196 12.8674 17.1182 13.486 17.1182H13.514Z" fill="url(#paint1_linear)"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear" x1="17.3456" y1="14.0483" x2="11.6522" y2="12.8896" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#55E7D9"/>
|
|
8
|
+
<stop offset="1" stop-color="#54B4FF"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<linearGradient id="paint1_linear" x1="17.3456" y1="14.2383" x2="11.6522" y2="13.0796" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<stop stop-color="#55E7D9"/>
|
|
12
|
+
<stop offset="1" stop-color="#54B4FF"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect opacity="0.8" x="1.5" y="1.5" width="24" height="24" rx="12" fill="#DAF1FE"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.8703 15.7837L9.64348 13.5569C9.30357 13.217 8.75246 13.217 8.41255 13.5569C8.07264 13.8968 8.07264 14.4479 8.41255 14.7878L11.2351 17.6104C11.5672 17.9425 12.103 17.9512 12.4457 17.6301L18.4492 12.0049C18.8 11.6762 18.8179 11.1254 18.4892 10.7746C18.1605 10.4238 17.6097 10.4059 17.2589 10.7346L11.8703 15.7837Z" fill="url(#paint0_linear)"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear" x1="19.8333" y1="18.9098" x2="15.586" y2="7.2736" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#55E7D9"/>
|
|
7
|
+
<stop offset="1" stop-color="#54B4FF"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12.6265 10.4119V12.2379C12.6265 12.7338 12.193 13.1356 11.6583 13.1356H3.26825C2.73352 13.1356 2.29999 12.7338 2.29999 12.2379V3.79771C2.29999 3.30178 2.73352 2.89999 3.26825 2.89999H11.6583C12.193 2.89999 12.6265 3.30178 12.6265 3.79771V5.84996" stroke="#8F95A2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.0952 10.1922H10.2664C9.0847 10.1922 8.12704 9.23439 8.12704 8.05246C8.12704 6.87052 9.0847 5.91269 10.2664 5.91269H13.0952C13.4072 5.91269 13.66 6.16552 13.66 6.47758V9.62689C13.66 9.93939 13.4072 10.1922 13.0952 10.1922Z" stroke="#8F95A2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M2.29999 4.73721H4.99884" stroke="#8F95A2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M2.29999 11.3122H4.99884" stroke="#8F95A2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./asset-selection.module.scss";
|
|
5
|
+
|
|
6
|
+
// import arrowIcon from "../../../assets/image/icons/arrow-darker.svg";
|
|
7
|
+
import { AssetIcon } from "../AssetIcon/AssetIcon.jsx";
|
|
8
|
+
|
|
9
|
+
import { useCallHandlingErrors } from "../../hooks/useCallHandlingErrors.js";
|
|
10
|
+
|
|
11
|
+
const ArrowIcon = () => (
|
|
12
|
+
<svg
|
|
13
|
+
width="16"
|
|
14
|
+
height="16"
|
|
15
|
+
viewBox="0 0 16 16"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
d="M12.2431 6L8.00045 10.2426L3.75781 6"
|
|
21
|
+
stroke="#232d42"
|
|
22
|
+
stroke-width="2"
|
|
23
|
+
stroke-linecap="round"
|
|
24
|
+
stroke-linejoin="round"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Component-button for triggering selecting an asset.
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
* @param {Function} handleClick - The function to call when the component is clicked
|
|
34
|
+
* @param {boolean} disabled - If true, disables click functionality
|
|
35
|
+
* @param {string} assetIconSrc - The source URL for the asset icon
|
|
36
|
+
* @param {string} [protocolName] - The name of the protocol, if any
|
|
37
|
+
* @param {string} [assetIconProtocolSrc] - The source URL for the asset protocol icon
|
|
38
|
+
* @param {string} [fallbackSrc] - The fallback source URL if the main asset icon fails to load
|
|
39
|
+
*/
|
|
40
|
+
export const AssetSelection = ({
|
|
41
|
+
handleClick = () => {},
|
|
42
|
+
disabled = false,
|
|
43
|
+
assetIconSrc,
|
|
44
|
+
protocolName,
|
|
45
|
+
assetIconProtocolSrc = null,
|
|
46
|
+
fallbackSrc,
|
|
47
|
+
}) => {
|
|
48
|
+
const handleError = useCallHandlingErrors();
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
className={
|
|
53
|
+
s["asset-selection"] + " " + (disabled ? s["disabled"] : "")
|
|
54
|
+
}
|
|
55
|
+
onClick={disabled ? () => {} : (e) => handleError(handleClick, e)}
|
|
56
|
+
>
|
|
57
|
+
<div className={s["asset-selection-icon-wrapper"]}>
|
|
58
|
+
<AssetIcon
|
|
59
|
+
small
|
|
60
|
+
assetIconSrc={assetIconSrc}
|
|
61
|
+
assetIconProtocolSrc={assetIconProtocolSrc}
|
|
62
|
+
fallbackSrc={fallbackSrc}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
{protocolName ? (
|
|
66
|
+
<div className={s["asset-selection-protocol-wrapper"]}>
|
|
67
|
+
{protocolName}
|
|
68
|
+
</div>
|
|
69
|
+
) : (
|
|
70
|
+
""
|
|
71
|
+
)}
|
|
72
|
+
<div className={s["arrow"]}>
|
|
73
|
+
<ArrowIcon />
|
|
74
|
+
</div>
|
|
75
|
+
{/*<img src={arrowIcon} className="arrow" alt=""></img>*/}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
AssetSelection.propTypes = {
|
|
81
|
+
handleClick: PropTypes.func,
|
|
82
|
+
disabled: PropTypes.bool,
|
|
83
|
+
assetIconSrc: PropTypes.string.isRequired,
|
|
84
|
+
protocolName: PropTypes.string,
|
|
85
|
+
assetIconProtocolSrc: PropTypes.string,
|
|
86
|
+
fallbackSrc: PropTypes.string,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
AssetSelection.defaultProps = {
|
|
90
|
+
handleClick: () => {},
|
|
91
|
+
disabled: false,
|
|
92
|
+
assetIconProtocolSrc: null,
|
|
93
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@import "../../../../styles/index";
|
|
2
|
+
|
|
3
|
+
.asset-selection {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
background-color: $white;
|
|
7
|
+
border-radius: 100px;
|
|
8
|
+
user-select: none;
|
|
9
|
+
box-shadow: $shadowOutlineStatic;
|
|
10
|
+
transition: all 0.2s ease;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
@media (hover: hover) {
|
|
14
|
+
&:hover:not(.disabled) {
|
|
15
|
+
box-shadow: $shadowOutlineHover;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.disabled {
|
|
20
|
+
opacity: 0.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:active:not(.disabled),
|
|
24
|
+
&.active:not(.disabled) {
|
|
25
|
+
box-shadow: $shadowOutlineActive;
|
|
26
|
+
transition: all 0.03s ease;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-protocol-wrapper {
|
|
30
|
+
background-color: LightColor("tosca-20");
|
|
31
|
+
color: SolidColor("tosca");
|
|
32
|
+
padding: 2px 5px;
|
|
33
|
+
font-size: 8px;
|
|
34
|
+
border-radius: 50px;
|
|
35
|
+
font-weight: $bold;
|
|
36
|
+
margin-right: 3px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-icon-wrapper {
|
|
40
|
+
padding: 10px 5px 10px 10px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
h6 {
|
|
44
|
+
color: SolidColor("dark");
|
|
45
|
+
font-weight: $semi-bold;
|
|
46
|
+
|
|
47
|
+
margin: 1px 7px 0 2px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrow {
|
|
51
|
+
margin: 10px 10px 10px 0;
|
|
52
|
+
transform: rotate(-90deg);
|
|
53
|
+
height: 14px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./background-title.module.scss";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Component for displaying a title with a fancy background text, which
|
|
8
|
+
* is semi-visible. This component is designed to work with forms that
|
|
9
|
+
* have a white background, and it allows for a configuration of margins.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props - Component props
|
|
12
|
+
* @param {string} props.text - Text to be displayed as the title
|
|
13
|
+
* @param {boolean} [props.smallMargins=false] - Whether to use smaller margins around the title
|
|
14
|
+
*/
|
|
15
|
+
export const BackgroundTitle = ({ text, smallMargins = false }) => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={s["background-title"]}>
|
|
18
|
+
<div
|
|
19
|
+
className={
|
|
20
|
+
s["background-title-wrapper"] +
|
|
21
|
+
(smallMargins ? " " + s["small-margins"] : "")
|
|
22
|
+
}
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
className={
|
|
26
|
+
s["background-title-wrapper-text"] +
|
|
27
|
+
(smallMargins ? " " + s["small-margins"] : "")
|
|
28
|
+
}
|
|
29
|
+
>
|
|
30
|
+
{text}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
BackgroundTitle.propTypes = {
|
|
38
|
+
text: PropTypes.string.isRequired,
|
|
39
|
+
smallMargins: PropTypes.bool,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
BackgroundTitle.defaultProps = {
|
|
43
|
+
smallMargins: false,
|
|
44
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import "../../../../styles/index";
|
|
2
|
+
|
|
3
|
+
.background-title {
|
|
4
|
+
pointer-events: none;
|
|
5
|
+
user-select: none;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 200%;
|
|
8
|
+
font-family: NunitoSans;
|
|
9
|
+
|
|
10
|
+
&-wrapper {
|
|
11
|
+
position: absolute;
|
|
12
|
+
overflow-x: hidden;
|
|
13
|
+
width: 200%;
|
|
14
|
+
height: 90px;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
|
|
18
|
+
@media (max-width: $phone-width) {
|
|
19
|
+
font-size: 30px;
|
|
20
|
+
line-height: 50px;
|
|
21
|
+
letter-spacing: 0.76875px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.small-margins {
|
|
25
|
+
top: 15px;
|
|
26
|
+
left: 19px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-text {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
font-size: 50px;
|
|
34
|
+
line-height: 50px;
|
|
35
|
+
font-weight: $extra-bold;
|
|
36
|
+
letter-spacing: 1.23px;
|
|
37
|
+
color: rgba(#12316b, 0.05);
|
|
38
|
+
|
|
39
|
+
&.small-margins {
|
|
40
|
+
font-size: 30px;
|
|
41
|
+
line-height: 50px;
|
|
42
|
+
letter-spacing: 0.76875px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: $phone-width) {
|
|
46
|
+
font-size: 30px;
|
|
47
|
+
line-height: 40px;
|
|
48
|
+
letter-spacing: 0.76875px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./notice-icon.module.scss";
|
|
5
|
+
// import exclamationIcon from "../../../assets/image/icons/failed-validation-icon.svg";
|
|
6
|
+
|
|
7
|
+
import { handleClickOutside } from "../../utils/uiUtils.js";
|
|
8
|
+
import { Tooltip, TOOLTIP_POSITIONS } from "../Tooltip/Tooltip.jsx";
|
|
9
|
+
import { FailedValidationIcon } from "../Validation/Validation.jsx";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A component that displays a notice icon with optional tooltip.
|
|
13
|
+
*
|
|
14
|
+
* @component
|
|
15
|
+
* @param {string} noticeText - The text to display inside the tooltip.
|
|
16
|
+
* @param {string} [titleNoticeIcon] - The source URL for the icon displayed on the notice.
|
|
17
|
+
* @param {string} tooltipPosition - Position for the tooltip relative to the icon.
|
|
18
|
+
*/
|
|
19
|
+
export const NoticeIcon = ({
|
|
20
|
+
noticeText,
|
|
21
|
+
titleNoticeIcon = "",
|
|
22
|
+
tooltipPosition = TOOLTIP_POSITIONS.TOP,
|
|
23
|
+
}) => {
|
|
24
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
25
|
+
|
|
26
|
+
const noticeRef = useRef();
|
|
27
|
+
|
|
28
|
+
useEffect(
|
|
29
|
+
() => handleClickOutside([noticeRef], () => setShowTooltip(false)),
|
|
30
|
+
[]
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div ref={noticeRef} className={s["notice-icon"]}>
|
|
35
|
+
{titleNoticeIcon ? (
|
|
36
|
+
<img
|
|
37
|
+
// src={titleNoticeIcon ? titleNoticeIcon : exclamationIcon}
|
|
38
|
+
src={titleNoticeIcon}
|
|
39
|
+
alt="title icon"
|
|
40
|
+
onClick={() => setShowTooltip((prev) => !prev)}
|
|
41
|
+
className={s["notice-icon-image"]}
|
|
42
|
+
/>
|
|
43
|
+
) : (
|
|
44
|
+
<div className={s["notice-icon-image"]}>
|
|
45
|
+
<FailedValidationIcon />
|
|
46
|
+
</div>
|
|
47
|
+
)}
|
|
48
|
+
<div className={s["notice-icon-tooltip"]}>
|
|
49
|
+
<Tooltip
|
|
50
|
+
showTooltip={showTooltip}
|
|
51
|
+
handleClick={() => setShowTooltip(false)}
|
|
52
|
+
wide={true}
|
|
53
|
+
position={tooltipPosition}
|
|
54
|
+
>
|
|
55
|
+
{noticeText}
|
|
56
|
+
</Tooltip>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
NoticeIcon.propTypes = {
|
|
63
|
+
noticeText: PropTypes.string.isRequired,
|
|
64
|
+
titleNoticeIcon: PropTypes.string,
|
|
65
|
+
tooltipPosition: PropTypes.oneOf(Object.values(TOOLTIP_POSITIONS)),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
NoticeIcon.defaultProps = {
|
|
69
|
+
titleNoticeIcon: "",
|
|
70
|
+
tooltipPosition: TOOLTIP_POSITIONS.TOP,
|
|
71
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
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 {string} title - The main title text.
|
|
18
|
+
* @param {string} linkText - The text for the link button, if any.
|
|
19
|
+
* @param {Function} linkButtonClick - The function to execute when the link button is clicked.
|
|
20
|
+
* @param {boolean} isLinkButtonDisabled - Determines if the link button is disabled.
|
|
21
|
+
* @param {React.ReactNode} children - Child components to be rendered.
|
|
22
|
+
* @param {boolean} linkButtonLoader - Displays a loader animation on the link button if true.
|
|
23
|
+
* @param {boolean} fullWidth - If true, the title box will take full width of its container.
|
|
24
|
+
* @param {string} titleNoticeText - The text for a notice icon tooltip.
|
|
25
|
+
* @param {string} titleNoticeIcon - The icon for the notice tooltip.
|
|
26
|
+
* @param {string} titleNoticePosition - Tooltip position for the notice icon.
|
|
27
|
+
* @param {boolean} bigTitle - If true, uses a larger font size for the title.
|
|
28
|
+
* @param {boolean} transparentTitle - If true, the title has a transparent background.
|
|
29
|
+
* @param {string} copyButtonText - The text for the copy button.
|
|
30
|
+
* @param {string} copyButtonContent - The content to be copied to the clipboard.
|
|
31
|
+
* @param {string} copyButtonTooltipContent - Tooltip content displayed after copying.
|
|
32
|
+
*/
|
|
33
|
+
export const TitleBox = ({
|
|
34
|
+
title = "",
|
|
35
|
+
linkText = "",
|
|
36
|
+
linkButtonClick = (resetButtonLoader) => {},
|
|
37
|
+
isLinkButtonDisabled = false,
|
|
38
|
+
children,
|
|
39
|
+
linkButtonLoader = false,
|
|
40
|
+
fullWidth = true,
|
|
41
|
+
titleNoticeText = "",
|
|
42
|
+
titleNoticeIcon,
|
|
43
|
+
titleNoticePosition,
|
|
44
|
+
bigTitle = false,
|
|
45
|
+
transparentTitle = false,
|
|
46
|
+
copyButtonText,
|
|
47
|
+
copyButtonContent,
|
|
48
|
+
copyButtonTooltipContent,
|
|
49
|
+
}) => {
|
|
50
|
+
const handleError = useCallHandlingErrors();
|
|
51
|
+
|
|
52
|
+
const transparentTitleClass = transparentTitle
|
|
53
|
+
? s["transparent-title"]
|
|
54
|
+
: "";
|
|
55
|
+
|
|
56
|
+
const [showCopyNotice, setShowCopyNotice] = useState(false);
|
|
57
|
+
|
|
58
|
+
const handleCopyButton = (e) => {
|
|
59
|
+
handleError(() => {
|
|
60
|
+
setShowCopyNotice(true);
|
|
61
|
+
copyBrowserTextToClipboard(copyButtonContent);
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
setShowCopyNotice(false);
|
|
64
|
+
}, 1500);
|
|
65
|
+
}, e);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
className={`${s["title-box"]} ${fullWidth ? s["full-width"] : ""}`}
|
|
71
|
+
>
|
|
72
|
+
{title || titleNoticeText || linkText ? (
|
|
73
|
+
<div className={s["title-box-wrapper"]}>
|
|
74
|
+
{bigTitle ? (
|
|
75
|
+
<h5
|
|
76
|
+
className={
|
|
77
|
+
s["title-box-wrapper-title"] +
|
|
78
|
+
" " +
|
|
79
|
+
transparentTitleClass
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
{title}
|
|
83
|
+
</h5>
|
|
84
|
+
) : (
|
|
85
|
+
<h6
|
|
86
|
+
className={
|
|
87
|
+
s["title-box-wrapper-title"] +
|
|
88
|
+
" " +
|
|
89
|
+
transparentTitleClass
|
|
90
|
+
}
|
|
91
|
+
>
|
|
92
|
+
{title}
|
|
93
|
+
</h6>
|
|
94
|
+
)}
|
|
95
|
+
{titleNoticeText ? (
|
|
96
|
+
<NoticeIcon
|
|
97
|
+
noticeText={titleNoticeText}
|
|
98
|
+
titleNoticeIcon={titleNoticeIcon}
|
|
99
|
+
tooltipPosition={titleNoticePosition}
|
|
100
|
+
/>
|
|
101
|
+
) : null}
|
|
102
|
+
{copyButtonContent && copyButtonText ? (
|
|
103
|
+
<div className={s["title-box-wrapper-link-button"]}>
|
|
104
|
+
<LinkButton
|
|
105
|
+
content={copyButtonText}
|
|
106
|
+
onClick={handleCopyButton}
|
|
107
|
+
isLoadable={false}
|
|
108
|
+
isDisabled={false}
|
|
109
|
+
/>
|
|
110
|
+
<Tooltip
|
|
111
|
+
position={TOOLTIP_POSITIONS.TOP_LEFT}
|
|
112
|
+
showTooltip={showCopyNotice}
|
|
113
|
+
>
|
|
114
|
+
{copyButtonTooltipContent}
|
|
115
|
+
</Tooltip>
|
|
116
|
+
</div>
|
|
117
|
+
) : linkText ? (
|
|
118
|
+
<div className={s["title-box-wrapper-link-button"]}>
|
|
119
|
+
<LinkButton
|
|
120
|
+
content={linkText}
|
|
121
|
+
onClick={linkButtonClick}
|
|
122
|
+
isLoadable={linkButtonLoader}
|
|
123
|
+
isDisabled={isLinkButtonDisabled}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
) : null}
|
|
127
|
+
</div>
|
|
128
|
+
) : null}
|
|
129
|
+
{children}
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
TitleBox.propTypes = {
|
|
135
|
+
title: PropTypes.string,
|
|
136
|
+
linkText: PropTypes.string,
|
|
137
|
+
linkButtonClick: PropTypes.func,
|
|
138
|
+
isLinkButtonDisabled: PropTypes.bool,
|
|
139
|
+
children: PropTypes.node,
|
|
140
|
+
linkButtonLoader: PropTypes.bool,
|
|
141
|
+
fullWidth: PropTypes.bool,
|
|
142
|
+
titleNoticeText: PropTypes.string,
|
|
143
|
+
titleNoticeIcon: PropTypes.string,
|
|
144
|
+
titleNoticePosition: PropTypes.string,
|
|
145
|
+
bigTitle: PropTypes.bool,
|
|
146
|
+
transparentTitle: PropTypes.bool,
|
|
147
|
+
copyButtonText: PropTypes.string,
|
|
148
|
+
copyButtonContent: PropTypes.string,
|
|
149
|
+
copyButtonTooltipContent: PropTypes.string,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
TitleBox.defaultProps = {
|
|
153
|
+
title: "",
|
|
154
|
+
linkText: "",
|
|
155
|
+
linkButtonClick: () => {},
|
|
156
|
+
isLinkButtonDisabled: false,
|
|
157
|
+
linkButtonLoader: false,
|
|
158
|
+
fullWidth: true,
|
|
159
|
+
titleNoticeText: "",
|
|
160
|
+
titleNoticePosition: TOOLTIP_POSITIONS.TOP,
|
|
161
|
+
bigTitle: false,
|
|
162
|
+
transparentTitle: false,
|
|
163
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import "../../../../styles/index";
|
|
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
|
+
&.transparent-title {
|
|
22
|
+
color: rgba($white, 0.2);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-link-button {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|