@rango-dev/ui 0.26.1-next.0 → 0.26.1-next.10
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/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +16 -0
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.d.ts +1 -0
- package/dist/widget/ui/src/components/Button/Button.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts +12 -0
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.types.d.ts +1 -0
- package/dist/widget/ui/src/components/Button/Button.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +16 -0
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.d.ts +2 -5
- package/dist/widget/ui/src/components/Divider/Divider.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +165 -0
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Divider/Divider.types.d.ts +10 -0
- package/dist/widget/ui/src/components/Divider/Divider.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +20 -0
- package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Header/Header.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +4 -0
- package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Icon/common.d.ts +8 -0
- package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
- package/dist/widget/ui/src/components/List/List.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +12 -0
- package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +24 -0
- package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts +6 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +16 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts +4 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +16 -0
- package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts +7 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts +325 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts +2 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +4 -0
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +12 -0
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +185 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +16 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +4 -0
- package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +4 -0
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +24 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +3 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +36 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts +1 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +8 -0
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts +2 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts +2 -1
- package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +12 -0
- package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.types.d.ts +3 -1
- package/dist/widget/ui/src/components/TextField/TextField.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +12 -0
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts +1 -0
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +15 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +6 -0
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +20 -0
- package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/FilledCircle.d.ts +4 -0
- package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +4 -0
- package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/styles.d.ts +4 -0
- package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +1 -0
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +40 -0
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +47 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +3 -0
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +21 -0
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +4 -0
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Height.d.ts +5 -0
- package/dist/widget/ui/src/icons/Height.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Key.d.ts +5 -0
- package/dist/widget/ui/src/icons/Key.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Refresh.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Width.d.ts +5 -0
- package/dist/widget/ui/src/icons/Width.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +3 -0
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/theme.d.ts +29 -0
- package/dist/widget/ui/src/theme.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button/Button.tsx +4 -1
- package/src/components/Button/Button.types.tsx +1 -0
- package/src/components/Divider/Divider.styles.ts +165 -0
- package/src/components/Divider/Divider.tsx +8 -140
- package/src/components/Divider/Divider.types.ts +10 -0
- package/src/components/PriceImpact/PriceImpact.tsx +26 -8
- package/src/components/PriceImpact/PriceImpact.types.ts +7 -0
- package/src/components/QuoteCost/QuoteCost.styles.ts +28 -1
- package/src/components/QuoteCost/QuoteCost.tsx +28 -8
- package/src/components/QuoteCost/QuoteCost.types.ts +4 -0
- package/src/components/RefreshProgressButton/RefreshProgressButton.styles.ts +28 -0
- package/src/components/RefreshProgressButton/RefreshProgressButton.tsx +70 -0
- package/src/components/RefreshProgressButton/index.ts +1 -0
- package/src/components/StepDetails/StepDetails.styles.ts +28 -5
- package/src/components/StepDetails/StepDetails.tsx +103 -37
- package/src/components/StepDetails/StepDetails.types.ts +18 -1
- package/src/components/SwapListItem/SwapListItem.tsx +6 -1
- package/src/components/SwapListItem/SwapListItem.types.ts +3 -1
- package/src/components/SwapListItem/SwapToken.tsx +15 -8
- package/src/components/SwapListItem/SwapToken.types.ts +1 -0
- package/src/components/SwapListItem/mock.ts +2 -0
- package/src/components/Switch/Switch.styles.tsx +7 -0
- package/src/components/TextField/TextField.tsx +5 -2
- package/src/components/TextField/TextField.types.tsx +3 -1
- package/src/components/TokenAmount/TokenAmount.tsx +36 -20
- package/src/components/TokenAmount/TokenAmount.types.ts +1 -0
- package/src/components/Tooltip/Tooltip.styles.ts +7 -0
- package/src/components/Tooltip/Tooltip.tsx +4 -2
- package/src/components/Tooltip/Tooltip.types.ts +6 -0
- package/src/components/Wallet/Wallet.styles.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/containers/SwapInput/SwapInput.tsx +53 -22
- package/src/containers/SwapInput/SwapInput.types.ts +3 -0
- package/src/icons/Height.tsx +24 -0
- package/src/icons/Key.tsx +32 -0
- package/src/icons/Refresh.tsx +10 -2
- package/src/icons/Width.tsx +29 -0
- package/src/icons/index.ts +3 -0
- package/src/theme.ts +3 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { StepDetailsProps } from './StepDetails.types';
|
|
1
|
+
import type { InternalSwap, StepDetailsProps } from './StepDetails.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import React, { forwardRef, memo, useEffect, useRef } from 'react';
|
|
4
|
+
import React, { forwardRef, Fragment, memo, useEffect, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import { ChainToken } from '../../components/ChainToken/ChainToken';
|
|
7
7
|
import { NextIcon } from '../../icons';
|
|
8
8
|
import { Image } from '../common';
|
|
9
9
|
import { Divider } from '../Divider';
|
|
10
|
+
import { Tooltip } from '../Tooltip';
|
|
10
11
|
import { Typography } from '../Typography';
|
|
11
12
|
|
|
12
13
|
import {
|
|
@@ -16,16 +17,37 @@ import {
|
|
|
16
17
|
stepInfoStyles,
|
|
17
18
|
StepSeparator,
|
|
18
19
|
SwapperImage,
|
|
19
|
-
|
|
20
|
+
swapperItemStyles,
|
|
21
|
+
SwapperSeparator,
|
|
22
|
+
swappersStyles,
|
|
20
23
|
tokensContainerStyles,
|
|
21
24
|
tokensStyles,
|
|
22
25
|
} from './StepDetails.styles';
|
|
23
26
|
|
|
24
27
|
const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
25
28
|
(props, parentRef) => {
|
|
26
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
step,
|
|
31
|
+
hasSeparator,
|
|
32
|
+
type,
|
|
33
|
+
state,
|
|
34
|
+
isFocused,
|
|
35
|
+
tabIndex,
|
|
36
|
+
tooltipContainer,
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
const { from, to, swapper } = step;
|
|
27
40
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
28
41
|
const isCompleted = state === 'completed' || state === 'error';
|
|
42
|
+
const swappers: InternalSwap[] = step.internalSwaps?.length
|
|
43
|
+
? step.internalSwaps
|
|
44
|
+
: [
|
|
45
|
+
{
|
|
46
|
+
from: { blockchain: from.chain.displayName },
|
|
47
|
+
to: { blockchain: to.chain.displayName },
|
|
48
|
+
swapper,
|
|
49
|
+
},
|
|
50
|
+
];
|
|
29
51
|
|
|
30
52
|
useEffect(() => {
|
|
31
53
|
const parentElement = (parentRef as React.RefObject<HTMLDivElement>)
|
|
@@ -43,27 +65,63 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
43
65
|
state={state}
|
|
44
66
|
ref={containerRef}
|
|
45
67
|
tabIndex={tabIndex}>
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
{type === 'quote-details' && (
|
|
69
|
+
<div className={swapperItemStyles()}>
|
|
70
|
+
<SwapperImage state={state}>
|
|
71
|
+
<Image size={22} src={step.swapper.image} />
|
|
72
|
+
</SwapperImage>
|
|
73
|
+
<Typography ml={8} size="medium" variant="label">
|
|
74
|
+
{i18n.t({
|
|
75
|
+
id: 'Swap on {fromChain} via {swapper}',
|
|
76
|
+
values: {
|
|
77
|
+
fromChain: step.from.chain.displayName,
|
|
78
|
+
swapper: step.swapper.displayName,
|
|
79
|
+
},
|
|
80
|
+
})}
|
|
81
|
+
</Typography>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
{type === 'swap-progress' && (
|
|
86
|
+
<div className={swappersStyles()}>
|
|
87
|
+
{hasSeparator && <StepSeparator state={state} />}
|
|
88
|
+
{swappers.map((swapperItem, index) => {
|
|
89
|
+
const key = `${swapperItem.swapper.displayName}-${index}`;
|
|
90
|
+
return (
|
|
91
|
+
<Fragment key={key}>
|
|
92
|
+
<div
|
|
93
|
+
id={swapperItem.swapper.displayName}
|
|
94
|
+
className={swapperItemStyles()}>
|
|
95
|
+
<SwapperImage state={state}>
|
|
96
|
+
<Image size={22} src={swapperItem.swapper.image} />
|
|
97
|
+
</SwapperImage>
|
|
98
|
+
<Typography ml={8} size="medium" variant="label">
|
|
99
|
+
{swapperItem?.swapper.type === 'DEX'
|
|
100
|
+
? i18n.t({
|
|
101
|
+
id: 'Swap on {fromChain} via {swapper}',
|
|
102
|
+
values: {
|
|
103
|
+
fromChain: swapperItem.from.blockchain,
|
|
104
|
+
swapper: swapperItem.swapper.displayName,
|
|
105
|
+
},
|
|
106
|
+
})
|
|
107
|
+
: i18n.t({
|
|
108
|
+
id: 'Bridge to {toChain} via {swapper}',
|
|
109
|
+
values: {
|
|
110
|
+
toChain: swapperItem.to.blockchain,
|
|
111
|
+
swapper: swapperItem.swapper.displayName,
|
|
112
|
+
},
|
|
113
|
+
})}
|
|
114
|
+
</Typography>
|
|
115
|
+
</div>
|
|
116
|
+
{index !== swappers.length - 1 && (
|
|
117
|
+
<SwapperSeparator state={state} />
|
|
118
|
+
)}
|
|
119
|
+
</Fragment>
|
|
120
|
+
);
|
|
64
121
|
})}
|
|
65
|
-
</
|
|
66
|
-
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
|
|
67
125
|
<div className={stepInfoStyles()}>
|
|
68
126
|
<DashedLine invisible={!hasSeparator || type === 'swap-progress'} />
|
|
69
127
|
<div className={tokensContainerStyles()}>
|
|
@@ -73,12 +131,16 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
73
131
|
tokenImage={step.from.token.image}
|
|
74
132
|
size="small"
|
|
75
133
|
/>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
134
|
+
<Tooltip
|
|
135
|
+
content={step.from.price.realValue}
|
|
136
|
+
container={tooltipContainer}>
|
|
137
|
+
<Typography
|
|
138
|
+
ml={4}
|
|
139
|
+
mr={4}
|
|
140
|
+
size="small"
|
|
141
|
+
color="$neutral700"
|
|
142
|
+
variant="body">{`${step.from.price.value} ${step.from.token.displayName}`}</Typography>
|
|
143
|
+
</Tooltip>
|
|
82
144
|
<NextIcon color="gray" />
|
|
83
145
|
<Divider size={4} direction="horizontal" />
|
|
84
146
|
<ChainToken
|
|
@@ -86,13 +148,17 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
86
148
|
tokenImage={step.to.token.image}
|
|
87
149
|
size="small"
|
|
88
150
|
/>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
151
|
+
<Tooltip
|
|
152
|
+
content={step.to.price.realValue}
|
|
153
|
+
container={tooltipContainer}>
|
|
154
|
+
<Typography
|
|
155
|
+
ml={4}
|
|
156
|
+
size="small"
|
|
157
|
+
color="$neutral700"
|
|
158
|
+
variant="body">{`${isCompleted ? '' : '~'}${
|
|
159
|
+
step.to.price.value
|
|
160
|
+
} ${step.to.token.displayName}`}</Typography>
|
|
161
|
+
</Tooltip>
|
|
96
162
|
</div>
|
|
97
163
|
<Alerts pb={hasSeparator && type === 'quote-details'}>
|
|
98
164
|
{step.alerts}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import type { SwapperType } from 'rango-sdk';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { SwapInputProps } from 'src/containers/SwapInput/SwapInput.types';
|
|
3
4
|
|
|
4
5
|
type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
|
|
5
6
|
|
|
7
|
+
type SwapperInfo = SwapInputProps['chain'] & {
|
|
8
|
+
type?: SwapperType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type InternalSwap = {
|
|
12
|
+
swapper: SwapperInfo;
|
|
13
|
+
from: {
|
|
14
|
+
blockchain: string;
|
|
15
|
+
};
|
|
16
|
+
to: {
|
|
17
|
+
blockchain: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
6
21
|
export type Step = {
|
|
7
|
-
swapper:
|
|
22
|
+
swapper: SwapperInfo;
|
|
8
23
|
from: BaseStep;
|
|
9
24
|
to: BaseStep;
|
|
10
25
|
error?: {
|
|
@@ -13,6 +28,7 @@ export type Step = {
|
|
|
13
28
|
};
|
|
14
29
|
alerts?: ReactNode;
|
|
15
30
|
state?: 'error' | 'warning';
|
|
31
|
+
internalSwaps?: InternalSwap[];
|
|
16
32
|
};
|
|
17
33
|
|
|
18
34
|
export type StepDetailsProps = {
|
|
@@ -22,4 +38,5 @@ export type StepDetailsProps = {
|
|
|
22
38
|
state?: 'default' | 'in-progress' | 'completed' | 'warning' | 'error';
|
|
23
39
|
isFocused?: boolean;
|
|
24
40
|
tabIndex?: number;
|
|
41
|
+
tooltipContainer?: HTMLElement;
|
|
25
42
|
};
|
|
@@ -40,6 +40,7 @@ export function SwapListItem(props: PropsWithChildren<PropTypes>) {
|
|
|
40
40
|
onlyShowTime,
|
|
41
41
|
status,
|
|
42
42
|
swapTokenData,
|
|
43
|
+
tooltipContainer,
|
|
43
44
|
} = props;
|
|
44
45
|
return (
|
|
45
46
|
<Main onClick={onClick.bind(null, requestId)}>
|
|
@@ -57,7 +58,11 @@ export function SwapListItem(props: PropsWithChildren<PropTypes>) {
|
|
|
57
58
|
{getStatus(status)}
|
|
58
59
|
</Typography>
|
|
59
60
|
</Header>
|
|
60
|
-
<SwapToken
|
|
61
|
+
<SwapToken
|
|
62
|
+
data={swapTokenData}
|
|
63
|
+
status={status}
|
|
64
|
+
tooltipContainer={tooltipContainer}
|
|
65
|
+
/>
|
|
61
66
|
</Container>
|
|
62
67
|
</Main>
|
|
63
68
|
);
|
|
@@ -7,6 +7,7 @@ export interface SwapListItemProps {
|
|
|
7
7
|
onClick: (requestId: string) => void;
|
|
8
8
|
swapTokenData: SwapTokenData;
|
|
9
9
|
onlyShowTime?: boolean;
|
|
10
|
+
tooltipContainer?: HTMLElement;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface LoadingProps {
|
|
@@ -31,6 +32,7 @@ export interface SwapTokenData {
|
|
|
31
32
|
image: string;
|
|
32
33
|
};
|
|
33
34
|
amount: string;
|
|
35
|
+
realAmount: string;
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
to: {
|
|
@@ -42,6 +44,6 @@ export interface SwapTokenData {
|
|
|
42
44
|
image: string;
|
|
43
45
|
};
|
|
44
46
|
amount: string;
|
|
45
|
-
|
|
47
|
+
realAmount: string;
|
|
46
48
|
};
|
|
47
49
|
}
|
|
@@ -7,6 +7,7 @@ import { NextIcon } from '../../icons';
|
|
|
7
7
|
import { ChainToken } from '../ChainToken';
|
|
8
8
|
import { Divider } from '../Divider';
|
|
9
9
|
import { Skeleton } from '../Skeleton';
|
|
10
|
+
import { Tooltip } from '../Tooltip';
|
|
10
11
|
import { Typography } from '../Typography';
|
|
11
12
|
|
|
12
13
|
import {
|
|
@@ -70,16 +71,19 @@ export function SwapToken(props: PropTypes) {
|
|
|
70
71
|
token: fromToken,
|
|
71
72
|
amount: fromAmount,
|
|
72
73
|
blockchain: fromBlockchain,
|
|
74
|
+
realAmount: fromRealAmount,
|
|
73
75
|
},
|
|
74
76
|
to: {
|
|
75
|
-
estimatedAmount,
|
|
76
77
|
token: toToken,
|
|
77
78
|
amount: toAmount,
|
|
78
79
|
blockchain: toBlockchain,
|
|
80
|
+
realAmount: toRealAmount,
|
|
79
81
|
},
|
|
80
82
|
},
|
|
81
83
|
status,
|
|
84
|
+
tooltipContainer,
|
|
82
85
|
} = props;
|
|
86
|
+
|
|
83
87
|
return (
|
|
84
88
|
<TokenContainer>
|
|
85
89
|
<Images>
|
|
@@ -125,9 +129,11 @@ export function SwapToken(props: PropTypes) {
|
|
|
125
129
|
{fromToken.displayName}
|
|
126
130
|
</Typography>
|
|
127
131
|
{!!fromAmount && (
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
<Tooltip content={fromRealAmount} container={tooltipContainer}>
|
|
133
|
+
<Typography size="small" variant="body" color="neutral700">
|
|
134
|
+
{fromAmount}
|
|
135
|
+
</Typography>
|
|
136
|
+
</Tooltip>
|
|
131
137
|
)}
|
|
132
138
|
</TokenInfo>
|
|
133
139
|
<Icon>
|
|
@@ -137,10 +143,11 @@ export function SwapToken(props: PropTypes) {
|
|
|
137
143
|
<Typography size="medium" variant="title">
|
|
138
144
|
{toToken.displayName}
|
|
139
145
|
</Typography>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
<Tooltip content={toRealAmount} container={tooltipContainer}>
|
|
147
|
+
<Typography size="small" variant="body" color="neutral700">
|
|
148
|
+
{toAmount}
|
|
149
|
+
</Typography>
|
|
150
|
+
</Tooltip>
|
|
144
151
|
</TokenInfo>
|
|
145
152
|
</Layout>
|
|
146
153
|
)}
|
|
@@ -305,6 +305,7 @@ export const swapTokenData: SwapTokenData = {
|
|
|
305
305
|
image: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
306
306
|
},
|
|
307
307
|
amount: '1.1',
|
|
308
|
+
realAmount: '1.1',
|
|
308
309
|
},
|
|
309
310
|
to: {
|
|
310
311
|
token: {
|
|
@@ -315,5 +316,6 @@ export const swapTokenData: SwapTokenData = {
|
|
|
315
316
|
image: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
316
317
|
},
|
|
317
318
|
amount: '0.7',
|
|
319
|
+
realAmount: '0.7',
|
|
318
320
|
},
|
|
319
321
|
};
|
|
@@ -17,6 +17,7 @@ export const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
|
17
17
|
padding: '0',
|
|
18
18
|
cursor: 'pointer',
|
|
19
19
|
transition: 'all 0.35s',
|
|
20
|
+
overflow: 'hidden',
|
|
20
21
|
|
|
21
22
|
'&[data-state="checked"]': {
|
|
22
23
|
$$color: '$colors$secondary500',
|
|
@@ -41,6 +42,12 @@ export const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
|
|
|
41
42
|
transition: ' transform 300ms',
|
|
42
43
|
borderRadius: '999999px',
|
|
43
44
|
willChange: 'transform',
|
|
45
|
+
'&:hover': {
|
|
46
|
+
boxShadow: 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
|
|
47
|
+
'-moz-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
|
|
48
|
+
'-webkit-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
|
|
49
|
+
'-o-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
|
|
50
|
+
},
|
|
44
51
|
|
|
45
52
|
'&[data-state="checked"]': {
|
|
46
53
|
transform: 'translateX(8px)',
|
|
@@ -17,14 +17,17 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
17
17
|
style,
|
|
18
18
|
variant,
|
|
19
19
|
fullWidth,
|
|
20
|
+
labelProps,
|
|
20
21
|
...inputAttributes
|
|
21
22
|
} = props;
|
|
22
23
|
return (
|
|
23
24
|
<>
|
|
24
25
|
{label && (
|
|
25
26
|
<>
|
|
26
|
-
<Label
|
|
27
|
-
|
|
27
|
+
<Label
|
|
28
|
+
className="_text"
|
|
29
|
+
{...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
|
|
30
|
+
<Typography variant="label" size="large" {...labelProps}>
|
|
28
31
|
{label}
|
|
29
32
|
</Typography>
|
|
30
33
|
</Label>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputContainer } from './TextField.styles';
|
|
2
|
+
import type { PropTypes as TypographyProps } from '../Typography/Typography.types';
|
|
2
3
|
import type * as Stitches from '@stitches/react';
|
|
3
4
|
|
|
4
5
|
type BaseProps = Stitches.VariantProps<typeof InputContainer>;
|
|
@@ -12,10 +13,11 @@ export type Ref =
|
|
|
12
13
|
| undefined;
|
|
13
14
|
|
|
14
15
|
export type PropTypes = {
|
|
15
|
-
label?: string;
|
|
16
|
+
label?: string | React.ReactNode;
|
|
16
17
|
prefix?: React.ReactNode;
|
|
17
18
|
suffix?: React.ReactNode;
|
|
18
19
|
size?: BaseSizes;
|
|
19
20
|
variant?: BaseVariants;
|
|
20
21
|
fullWidth?: boolean;
|
|
22
|
+
labelProps?: TypographyProps;
|
|
21
23
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'size'>;
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { ChainToken } from '../ChainToken';
|
|
6
6
|
import { PriceImpact } from '../PriceImpact/PriceImpact';
|
|
7
|
+
import { Tooltip } from '../Tooltip';
|
|
7
8
|
import { Typography } from '../Typography';
|
|
8
9
|
|
|
9
10
|
import {
|
|
@@ -27,37 +28,52 @@ export function TokenAmount(props: PropTypes) {
|
|
|
27
28
|
{props.label}
|
|
28
29
|
</Typography>
|
|
29
30
|
)}
|
|
30
|
-
<div
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
<div>
|
|
32
|
+
<Tooltip
|
|
33
|
+
content={props.price.realValue}
|
|
34
|
+
open={!props.price.realValue ? false : undefined}
|
|
35
|
+
container={props.tooltipContainer}>
|
|
36
|
+
<Typography
|
|
37
|
+
ml={4}
|
|
38
|
+
size="medium"
|
|
39
|
+
variant="title"
|
|
40
|
+
style={{ fontWeight: 600 }}>
|
|
41
|
+
{props.price.value}
|
|
42
|
+
</Typography>
|
|
43
|
+
<Typography
|
|
44
|
+
ml={8}
|
|
45
|
+
size="medium"
|
|
46
|
+
variant="title"
|
|
47
|
+
style={{ fontWeight: 400 }}>
|
|
48
|
+
{props.token.displayName}
|
|
49
|
+
</Typography>
|
|
50
|
+
</Tooltip>
|
|
45
51
|
</div>
|
|
46
52
|
</div>
|
|
47
53
|
</div>
|
|
48
54
|
{props.price.usdValue && props.price.usdValue !== '0' && (
|
|
49
55
|
<div className={usdValueStyles()}>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
<Tooltip
|
|
57
|
+
content={props.price.realUsdValue}
|
|
58
|
+
container={props.tooltipContainer}>
|
|
59
|
+
{props.type === 'input' && (
|
|
60
|
+
<Typography
|
|
61
|
+
mr={4}
|
|
62
|
+
size="small"
|
|
63
|
+
variant="body"
|
|
64
|
+
color="$neutral700">
|
|
65
|
+
{`~$${props.price.usdValue}`}
|
|
66
|
+
</Typography>
|
|
67
|
+
)}
|
|
68
|
+
</Tooltip>
|
|
55
69
|
{props.type === 'output' && (
|
|
56
70
|
<PriceImpact
|
|
57
71
|
size="small"
|
|
72
|
+
tooltipProps={{ container: props.tooltipContainer, side: 'top' }}
|
|
58
73
|
outputUsdValue={props.price.usdValue}
|
|
59
74
|
percentageChange={props.percentageChange}
|
|
60
75
|
warningLevel={props.warningLevel}
|
|
76
|
+
realOutputUsdValue={props.price.realUsdValue}
|
|
61
77
|
/>
|
|
62
78
|
)}
|
|
63
79
|
</div>
|
|
@@ -5,6 +5,13 @@ import { Typography } from '../Typography';
|
|
|
5
5
|
|
|
6
6
|
export const TooltipContent = styled(RadixTooltip.Content, {
|
|
7
7
|
zIndex: '999999',
|
|
8
|
+
variants: {
|
|
9
|
+
align: {
|
|
10
|
+
right: {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
8
15
|
});
|
|
9
16
|
|
|
10
17
|
export const TooltipTypography = styled(Typography, {
|
|
@@ -19,15 +19,17 @@ export function Tooltip(props: PropsWithChildren<PropTypes>) {
|
|
|
19
19
|
container,
|
|
20
20
|
open,
|
|
21
21
|
side = 'top',
|
|
22
|
+
style,
|
|
23
|
+
align,
|
|
22
24
|
} = props;
|
|
23
25
|
return (
|
|
24
26
|
<RadixTooltip.Provider delayDuration={0}>
|
|
25
27
|
<RadixTooltip.Root open={open}>
|
|
26
|
-
<RadixTooltip.Trigger asChild>
|
|
28
|
+
<RadixTooltip.Trigger asChild style={style}>
|
|
27
29
|
<TriggerContent>{children}</TriggerContent>
|
|
28
30
|
</RadixTooltip.Trigger>
|
|
29
31
|
<RadixTooltip.Portal container={container}>
|
|
30
|
-
<TooltipContent side={side} sideOffset={sideOffset}>
|
|
32
|
+
<TooltipContent align={align} side={side} sideOffset={sideOffset}>
|
|
31
33
|
<TooltipTypography variant="label" size="medium" color={color}>
|
|
32
34
|
{content}
|
|
33
35
|
</TooltipTypography>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { TooltipContent } from './Tooltip.styles';
|
|
1
2
|
import type * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
3
|
+
import type * as Stitches from '@stitches/react';
|
|
2
4
|
import type { ComponentProps, ReactNode } from 'react';
|
|
3
5
|
|
|
4
6
|
type RadixTooltipContentProps = ComponentProps<typeof RadixTooltip.Content>;
|
|
7
|
+
type BaseProps = Stitches.VariantProps<typeof TooltipContent>;
|
|
8
|
+
type BaseAlign = Exclude<BaseProps['align'], object>;
|
|
5
9
|
|
|
6
10
|
export interface PropTypes {
|
|
7
11
|
content: ReactNode;
|
|
@@ -10,4 +14,6 @@ export interface PropTypes {
|
|
|
10
14
|
sideOffset?: RadixTooltipContentProps['sideOffset'];
|
|
11
15
|
container?: HTMLElement;
|
|
12
16
|
open?: boolean;
|
|
17
|
+
style?: Stitches.CSSProperties;
|
|
18
|
+
align?: BaseAlign;
|
|
13
19
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './Modal';
|
|
|
16
16
|
export * from './MessageBox';
|
|
17
17
|
export * from './PercentageChange';
|
|
18
18
|
export * from './RadioGroup';
|
|
19
|
+
export * from './RefreshProgressButton';
|
|
19
20
|
export * from './RoutesOverview';
|
|
20
21
|
export * from './SecondaryPage';
|
|
21
22
|
export * from './SelectableWalletList';
|