@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
|
@@ -0,0 +1,95 @@
|
|
|
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/image/icons/dark-rectangle.svg";
|
|
7
|
+
|
|
8
|
+
import { useCallHandlingErrors } from "../../hooks/useCallHandlingErrors.js";
|
|
9
|
+
|
|
10
|
+
const DarkRectangle = () => (
|
|
11
|
+
<svg
|
|
12
|
+
width="25"
|
|
13
|
+
height="13"
|
|
14
|
+
viewBox="0 0 25 13"
|
|
15
|
+
fill="none"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
fill-rule="evenodd"
|
|
20
|
+
clip-rule="evenodd"
|
|
21
|
+
d="M12.5 13L25 0H0L12.5 13Z"
|
|
22
|
+
fill="#232D42"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const TOOLTIP_POSITIONS = {
|
|
28
|
+
TOP: "top",
|
|
29
|
+
LEFT: "left",
|
|
30
|
+
RIGHT: "right",
|
|
31
|
+
BOTTOM: "bottom",
|
|
32
|
+
TOP_LEFT: "top-left",
|
|
33
|
+
TOP_RIGHT: "top-right",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Tooltip component for displaying contextual information.
|
|
38
|
+
*
|
|
39
|
+
* @component
|
|
40
|
+
* @param {React.ReactNode} children - The content to display inside the tooltip.
|
|
41
|
+
* @param {boolean} showTooltip - Controls whether the tooltip is visible.
|
|
42
|
+
* @param {Function} handleClick - Handler for click events.
|
|
43
|
+
* @param {boolean} wide - If true, applies a wider style to the tooltip.
|
|
44
|
+
* @param {string} position - One of the predefined positions for the tooltip.
|
|
45
|
+
* @param {boolean} ignorePointerEvents - If true, the tooltip will not react to pointer events.
|
|
46
|
+
*/
|
|
47
|
+
export const Tooltip = ({
|
|
48
|
+
children,
|
|
49
|
+
showTooltip,
|
|
50
|
+
handleClick = () => {},
|
|
51
|
+
wide = false,
|
|
52
|
+
position = TOOLTIP_POSITIONS.TOP,
|
|
53
|
+
ignorePointerEvents = false,
|
|
54
|
+
}) => {
|
|
55
|
+
const handleError = useCallHandlingErrors();
|
|
56
|
+
|
|
57
|
+
const onClick = (e) => {
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
handleClick();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<CSSTransition in={showTooltip} timeout={400} unmountOnExit>
|
|
64
|
+
<span
|
|
65
|
+
className={`${s["tooltip"]} ${wide ? s["wide"] : ""} ${
|
|
66
|
+
s[position]
|
|
67
|
+
} ${ignorePointerEvents ? s["ignore-pointer"] : ""}`}
|
|
68
|
+
onClick={(e) => handleError(onClick, e)}
|
|
69
|
+
onDoubleClick={(e) =>
|
|
70
|
+
handleError((e) => e.stopPropagation(), e)
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
<DarkRectangle />
|
|
74
|
+
{/*<img src={darkRectangle} alt="dark rectangle" />*/}
|
|
75
|
+
{children}
|
|
76
|
+
</span>
|
|
77
|
+
</CSSTransition>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Tooltip.propTypes = {
|
|
82
|
+
children: PropTypes.node.isRequired,
|
|
83
|
+
showTooltip: PropTypes.bool.isRequired,
|
|
84
|
+
handleClick: PropTypes.func,
|
|
85
|
+
wide: PropTypes.bool,
|
|
86
|
+
position: PropTypes.oneOf(Object.values(TOOLTIP_POSITIONS)),
|
|
87
|
+
ignorePointerEvents: PropTypes.bool,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
Tooltip.defaultProps = {
|
|
91
|
+
handleClick: () => {},
|
|
92
|
+
wide: false,
|
|
93
|
+
position: TOOLTIP_POSITIONS.TOP,
|
|
94
|
+
ignorePointerEvents: false,
|
|
95
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
@import "../../../../styles/index";
|
|
2
|
+
|
|
3
|
+
.tooltip {
|
|
4
|
+
@include typograpy("p");
|
|
5
|
+
font-weight: $medium;
|
|
6
|
+
line-height: 20px;
|
|
7
|
+
padding: Padding("5") Padding("4");
|
|
8
|
+
background: SolidColor("dark");
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: calc(100% + 15px);
|
|
11
|
+
left: 50%;
|
|
12
|
+
transform: translateX(-50%);
|
|
13
|
+
color: $white;
|
|
14
|
+
border-radius: $borderRadius;
|
|
15
|
+
z-index: 3;
|
|
16
|
+
display: block;
|
|
17
|
+
min-width: 200px;
|
|
18
|
+
max-width: 300px;
|
|
19
|
+
text-align: center;
|
|
20
|
+
word-wrap: break-word;
|
|
21
|
+
word-break: normal;
|
|
22
|
+
|
|
23
|
+
&.enter {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
transform: translateX(-50%) translateY(10px) scale(0.95);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.enter-active,
|
|
29
|
+
&.exit {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
32
|
+
transition: 0.2s all $transitionEaseOut;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.exit-active {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.top-left {
|
|
41
|
+
transform: none;
|
|
42
|
+
bottom: calc(100% + 15px);
|
|
43
|
+
right: -14px;
|
|
44
|
+
left: auto;
|
|
45
|
+
img {
|
|
46
|
+
left: auto;
|
|
47
|
+
right: 0px;
|
|
48
|
+
top: calc(100% - 4px);
|
|
49
|
+
transform: translateX(-40%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.enter {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transform: translateX(5px) translateY(10px) scale(0.95);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.enter-active,
|
|
58
|
+
&.enter-done,
|
|
59
|
+
&.exit {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.exit-active {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.top-right {
|
|
71
|
+
transform: none;
|
|
72
|
+
bottom: calc(100% + 15px);
|
|
73
|
+
left: -14px;
|
|
74
|
+
img {
|
|
75
|
+
left: 0px;
|
|
76
|
+
top: calc(100% - 4px);
|
|
77
|
+
transform: translateX(40%);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.enter {
|
|
81
|
+
opacity: 0;
|
|
82
|
+
transform: translateX(-5px) translateY(10px) scale(0.95);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.enter-active,
|
|
86
|
+
&.enter-done,
|
|
87
|
+
&.exit {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.exit-active {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.left {
|
|
99
|
+
left: auto;
|
|
100
|
+
right: calc(100% + 16px);
|
|
101
|
+
bottom: calc(100% - 4px);
|
|
102
|
+
img {
|
|
103
|
+
top: calc(41%);
|
|
104
|
+
left: calc(100% - 7px);
|
|
105
|
+
transform: rotateZ(-90deg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.enter {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
transform: translateX(16px) translateY(50%) scale(0.95);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.enter-active,
|
|
114
|
+
&.enter-done,
|
|
115
|
+
&.exit {
|
|
116
|
+
opacity: 1;
|
|
117
|
+
transform: translateX(0) translateY(50%) scale(1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.exit-active {
|
|
121
|
+
opacity: 0;
|
|
122
|
+
transform: translateX(0) translateY(50%) scale(1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.bottom {
|
|
127
|
+
// TODO: [dev] Currently works for RBF form. Not tested in other cases
|
|
128
|
+
bottom: auto;
|
|
129
|
+
top: calc(100% + 16px);
|
|
130
|
+
left: 50%;
|
|
131
|
+
img {
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: -12px;
|
|
134
|
+
left: calc(50% - 12px);
|
|
135
|
+
transform: rotateZ(-180deg);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.enter {
|
|
139
|
+
opacity: 0;
|
|
140
|
+
transform: translateX(-50%) translateY(-10px) scale(0.95);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.enter-active,
|
|
144
|
+
&.enter-done,
|
|
145
|
+
&.exit {
|
|
146
|
+
opacity: 1;
|
|
147
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.exit-active {
|
|
151
|
+
opacity: 0;
|
|
152
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.right {
|
|
157
|
+
// TODO: [dev] Currently works for RBF form. Not tested in other cases
|
|
158
|
+
left: calc(100% + 16px);
|
|
159
|
+
right: auto;
|
|
160
|
+
top: 7px;
|
|
161
|
+
bottom: auto;
|
|
162
|
+
img {
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: calc(50% - 6px);
|
|
165
|
+
left: -18px;
|
|
166
|
+
transform: rotateZ(-270deg);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.enter {
|
|
170
|
+
opacity: 0;
|
|
171
|
+
transform: translateX(-16px) translateY(-50%) scale(0.95);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.enter-active,
|
|
175
|
+
&.enter-done,
|
|
176
|
+
&.exit {
|
|
177
|
+
opacity: 1;
|
|
178
|
+
transform: translateX(0) translateY(-50%) scale(1);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.exit-active {
|
|
182
|
+
opacity: 0;
|
|
183
|
+
transform: translateX(0) translateY(-50%) scale(1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.wide {
|
|
188
|
+
min-width: 300px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&.ignore-pointer {
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&-enter {
|
|
196
|
+
opacity: 0;
|
|
197
|
+
bottom: calc(100% - 10px);
|
|
198
|
+
position: absolute;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&-enter-active {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
bottom: calc(100% + 15px);
|
|
204
|
+
position: absolute;
|
|
205
|
+
transition: 0.3s;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&-enter-done {
|
|
209
|
+
bottom: calc(100% + 15px);
|
|
210
|
+
position: absolute;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&-exit {
|
|
214
|
+
opacity: 1;
|
|
215
|
+
bottom: calc(100% + 15px);
|
|
216
|
+
position: absolute;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&-exit-active {
|
|
220
|
+
opacity: 0;
|
|
221
|
+
bottom: calc(100% - 10px);
|
|
222
|
+
position: absolute;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
img {
|
|
226
|
+
position: absolute;
|
|
227
|
+
top: calc(100% - 1px);
|
|
228
|
+
left: 50%;
|
|
229
|
+
transform: translateX(-50%);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import s from "./validation.module.scss";
|
|
5
|
+
// import successfulValidationIcon from "../../../assets/image/icons/successful-validation-icon.svg";
|
|
6
|
+
// import failedValidationIcon from "../../../assets/image/icons/failed-validation-icon.svg";
|
|
7
|
+
|
|
8
|
+
const SuccessfulValidationIcon = () => (
|
|
9
|
+
<svg
|
|
10
|
+
width="27"
|
|
11
|
+
height="27"
|
|
12
|
+
viewBox="0 0 27 27"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<rect
|
|
17
|
+
opacity="0.8"
|
|
18
|
+
x="1.5"
|
|
19
|
+
y="1.5"
|
|
20
|
+
width="24"
|
|
21
|
+
height="24"
|
|
22
|
+
rx="12"
|
|
23
|
+
fill="#DAF1FE"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
fill-rule="evenodd"
|
|
27
|
+
clip-rule="evenodd"
|
|
28
|
+
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"
|
|
29
|
+
fill="url(#paint0_linear)"
|
|
30
|
+
/>
|
|
31
|
+
<defs>
|
|
32
|
+
<linearGradient
|
|
33
|
+
id="paint0_linear"
|
|
34
|
+
x1="19.8333"
|
|
35
|
+
y1="18.9098"
|
|
36
|
+
x2="15.586"
|
|
37
|
+
y2="7.2736"
|
|
38
|
+
gradientUnits="userSpaceOnUse"
|
|
39
|
+
>
|
|
40
|
+
<stop stop-color="#55E7D9" />
|
|
41
|
+
<stop offset="1" stop-color="#54B4FF" />
|
|
42
|
+
</linearGradient>
|
|
43
|
+
</defs>
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export const FailedValidationIcon = () => (
|
|
48
|
+
<svg
|
|
49
|
+
width="27"
|
|
50
|
+
height="27"
|
|
51
|
+
viewBox="0 0 27 27"
|
|
52
|
+
fill="none"
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
>
|
|
55
|
+
<rect
|
|
56
|
+
opacity="0.8"
|
|
57
|
+
x="1.5"
|
|
58
|
+
y="1.5"
|
|
59
|
+
width="24"
|
|
60
|
+
height="24"
|
|
61
|
+
rx="12"
|
|
62
|
+
fill="#DAF1FE"
|
|
63
|
+
/>
|
|
64
|
+
<path
|
|
65
|
+
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"
|
|
66
|
+
fill="url(#paint0_linear)"
|
|
67
|
+
/>
|
|
68
|
+
<path
|
|
69
|
+
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"
|
|
70
|
+
fill="url(#paint1_linear)"
|
|
71
|
+
/>
|
|
72
|
+
<defs>
|
|
73
|
+
<linearGradient
|
|
74
|
+
id="paint0_linear"
|
|
75
|
+
x1="17.3456"
|
|
76
|
+
y1="14.0483"
|
|
77
|
+
x2="11.6522"
|
|
78
|
+
y2="12.8896"
|
|
79
|
+
gradientUnits="userSpaceOnUse"
|
|
80
|
+
>
|
|
81
|
+
<stop stop-color="#55E7D9" />
|
|
82
|
+
<stop offset="1" stop-color="#54B4FF" />
|
|
83
|
+
</linearGradient>
|
|
84
|
+
<linearGradient
|
|
85
|
+
id="paint1_linear"
|
|
86
|
+
x1="17.3456"
|
|
87
|
+
y1="14.2383"
|
|
88
|
+
x2="11.6522"
|
|
89
|
+
y2="13.0796"
|
|
90
|
+
gradientUnits="userSpaceOnUse"
|
|
91
|
+
>
|
|
92
|
+
<stop stop-color="#55E7D9" />
|
|
93
|
+
<stop offset="1" stop-color="#54B4FF" />
|
|
94
|
+
</linearGradient>
|
|
95
|
+
</defs>
|
|
96
|
+
</svg>
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Simple validation message with an icon.
|
|
101
|
+
* It shows either a success or failure icon based on the isSuccessAlert prop.
|
|
102
|
+
*
|
|
103
|
+
* @param {Object} props - The component props.
|
|
104
|
+
* @param {string} props.text - The validation message text to display.
|
|
105
|
+
* @param {boolean} props.isSuccessAlert - Determines if the displayed alert is for a success (true) or failure (false).
|
|
106
|
+
*/
|
|
107
|
+
export const Validation = ({ text = "", isSuccessAlert }) => {
|
|
108
|
+
return (
|
|
109
|
+
<div className={s["validation"]}>
|
|
110
|
+
{isSuccessAlert ? (
|
|
111
|
+
// <img src={successfulValidationIcon} alt="validation icon" />
|
|
112
|
+
<SuccessfulValidationIcon />
|
|
113
|
+
) : (
|
|
114
|
+
// <img src={failedValidationIcon} alt="validation icon" />
|
|
115
|
+
<FailedValidationIcon />
|
|
116
|
+
)}
|
|
117
|
+
<span className={s["validation-text"]}>{text}</span>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
Validation.propTypes = {
|
|
123
|
+
text: PropTypes.string,
|
|
124
|
+
isSuccessAlert: PropTypes.bool.isRequired,
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
Validation.defaultProps = {
|
|
128
|
+
text: "",
|
|
129
|
+
isSuccessAlert: false,
|
|
130
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import "../../../../styles/index";
|
|
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
|
+
@extend .ml-2;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
@extend %text-semibold;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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";
|
|
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 = ({
|
|
26
|
+
color = CLOSE_COLORS.WHITE,
|
|
27
|
+
onClick = () => {},
|
|
28
|
+
large = false,
|
|
29
|
+
}) => {
|
|
30
|
+
const callHandlingErrors = useCallHandlingErrors();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<svg
|
|
34
|
+
className={
|
|
35
|
+
s["close"] + " " + s[color] + (large ? " " + s["large"] : "")
|
|
36
|
+
}
|
|
37
|
+
onClick={(e) => callHandlingErrors(onClick, e)}
|
|
38
|
+
style={{ cursor: "pointer" }}
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
viewBox={`0 0 50 50`}
|
|
41
|
+
x="0px"
|
|
42
|
+
y="0px"
|
|
43
|
+
>
|
|
44
|
+
<path
|
|
45
|
+
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
|
|
46
|
+
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
|
|
47
|
+
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
|
|
48
|
+
s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z"
|
|
49
|
+
/>
|
|
50
|
+
</svg>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
Close.propTypes = {
|
|
55
|
+
color: PropTypes.oneOf(Object.values(CLOSE_COLORS)),
|
|
56
|
+
onClick: PropTypes.func,
|
|
57
|
+
large: PropTypes.bool,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
Close.defaultProps = {
|
|
61
|
+
color: CLOSE_COLORS.WHITE,
|
|
62
|
+
onClick: () => {},
|
|
63
|
+
large: false,
|
|
64
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import "../../../../../styles/index";
|
|
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
|
+
}
|