@rango-dev/ui 0.23.0 → 0.24.0
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/CHANGELOG.md +1 -86
- 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 +0 -157
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts +4 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts +7 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts +1429 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts +34 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts +4 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts +319 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts +6 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts +12 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +158 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/index.d.ts +5 -0
- package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts +3 -0
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.d.ts +54 -54
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +0 -158
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts +4 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts +158 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/{QuoteCost/QuoteCost.types.d.ts → RouteCost/RouteCost.types.d.ts} +1 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RouteCost/index.d.ts +2 -0
- package/dist/widget/ui/src/components/RouteCost/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +2 -16
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +0 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.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 +1 -7
- 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 +2 -16
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts +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.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.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 +1 -471
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.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 +2 -2
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +17 -3
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +0 -157
- package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +2 -1
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts +3 -3
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/History/types.d.ts +2 -0
- package/dist/widget/ui/src/containers/History/types.d.ts.map +1 -0
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts +2 -2
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.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 +54 -1313
- 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 +0 -2
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +54 -525
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +2 -2
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/{utils → helper}/index.d.ts +3 -0
- package/dist/widget/ui/src/helper/index.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Icons.stories.d.ts +1 -1
- package/dist/widget/ui/src/icons/index.d.ts +0 -5
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +1 -0
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/index.d.ts +1 -0
- package/dist/widget/ui/src/types/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/swaps.d.ts +27 -1
- package/dist/widget/ui/src/types/swaps.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/components/Alert/Alert.styles.ts +12 -9
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/BestRoute/BestRoute.stories.tsx +17 -0
- package/src/components/BestRoute/BestRoute.styles.ts +213 -0
- package/src/components/BestRoute/BestRoute.tsx +176 -0
- package/src/components/BestRoute/BestRoute.types.ts +32 -0
- package/src/components/BestRoute/BestRouteSkeleton.styles.ts +110 -0
- package/src/components/BestRoute/BestRouteSkeleton.tsx +112 -0
- package/src/components/BestRoute/BestRouteSkeleton.types.ts +5 -0
- package/src/components/BestRoute/RouteSummary.styles.ts +15 -0
- package/src/components/BestRoute/RouteSummary.tsx +48 -0
- package/src/components/BestRoute/index.ts +4 -0
- package/src/components/BestRoute/mock.ts +142 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +1 -2
- package/src/components/Button/Button.styles.tsx +0 -1
- package/src/components/Checkbox/Checkbox.styles.ts +1 -5
- package/src/components/ListItem/ListItem.styles.ts +0 -9
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton/ListItemButton.styles.ts +0 -1
- package/src/components/PriceImpact/PriceImpact.styles.ts +1 -9
- package/src/components/PriceImpact/PriceImpact.tsx +5 -5
- package/src/components/Radio/Radio.styles.tsx +2 -5
- package/src/components/RouteCost/RouteCost.styles.ts +20 -0
- package/src/components/{QuoteCost/QuoteCost.tsx → RouteCost/RouteCost.tsx} +10 -14
- package/src/components/RouteCost/index.ts +1 -0
- package/src/components/RoutesOverview/RoutesOverview.tsx +2 -6
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +13 -40
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +46 -47
- package/src/components/SelectableCategoryList/index.ts +0 -1
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +2 -3
- package/src/components/Skeleton/Skeleton.types.ts +1 -1
- package/src/components/StepDetails/StepDetails.stories.tsx +1 -1
- package/src/components/StepDetails/StepDetails.styles.ts +28 -36
- package/src/components/StepDetails/StepDetails.tsx +7 -11
- package/src/components/StepDetails/StepDetails.types.ts +2 -17
- package/src/components/StepDetails/index.ts +1 -1
- package/src/components/StepDetails/mock.ts +1 -1
- package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
- package/src/components/SwapListItem/mock.ts +6 -21
- package/src/components/Switch/Switch.styles.tsx +6 -8
- package/src/components/TextField/TextField.tsx +5 -3
- package/src/components/TokenAmount/TokenAmount.styles.ts +10 -12
- package/src/components/TokenAmount/TokenAmount.tsx +17 -23
- package/src/components/Tooltip/Tooltip.styles.ts +5 -8
- package/src/components/Tooltip/Tooltip.tsx +3 -2
- package/src/components/Wallet/Wallet.styles.ts +1 -1
- package/src/components/Wallet/Wallet.types.ts +23 -3
- package/src/components/common/Image.tsx +2 -1
- package/src/components/common/index.ts +1 -1
- package/src/components/index.ts +2 -1
- package/src/containers/BlockchainSelector/BlockchainSelector.tsx +8 -9
- package/src/containers/History/types.tsx +1 -0
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +2 -5
- package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
- package/src/containers/SwapHistory/mock.ts +8 -24
- package/src/containers/SwapInput/SwapInput.styles.ts +27 -78
- package/src/containers/SwapInput/SwapInput.tsx +29 -37
- package/src/containers/SwapInput/SwapInput.types.ts +0 -2
- package/src/containers/SwapInput/TokenSection.styles.ts +12 -27
- package/src/containers/SwapInput/TokenSection.tsx +6 -15
- package/src/containers/TokenSelector/TokenSelector.tsx +10 -8
- package/src/helper/index.ts +99 -0
- package/src/icons/index.ts +0 -5
- package/src/index.ts +1 -0
- package/src/theme.ts +4 -4
- package/src/types/index.ts +1 -0
- package/src/types/swaps.ts +38 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts +0 -4
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +0 -629
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts +0 -2
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/EvmCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/EvmCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/Language.d.ts +0 -5
- package/dist/widget/ui/src/icons/Language.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/OtherCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/OtherCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/utils/index.d.ts.map +0 -1
- package/src/components/QuoteCost/QuoteCost.styles.ts +0 -29
- package/src/components/QuoteCost/index.ts +0 -1
- package/src/icons/CosmosCategory.tsx +0 -137
- package/src/icons/EvmCategory.tsx +0 -74
- package/src/icons/Language.tsx +0 -55
- package/src/icons/OtherCategory.tsx +0 -72
- package/src/icons/UtxoCategory.tsx +0 -44
- package/src/utils/index.ts +0 -23
- /package/src/components/{QuoteCost/QuoteCost.types.ts → RouteCost/RouteCost.types.ts} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { darkTheme, styled } from '../../theme';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
$$color: '$colors$neutral100',
|
|
5
|
+
[`.${darkTheme} &`]: {
|
|
6
|
+
$$color: '$colors$neutral300',
|
|
7
|
+
},
|
|
8
|
+
backgroundColor: '$$color',
|
|
9
|
+
borderBottomLeftRadius: '$xm',
|
|
10
|
+
borderBottomRightRadius: '$xm',
|
|
11
|
+
padding: '$15 ',
|
|
12
|
+
'& .cost-and-tag': {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
height: '22px',
|
|
17
|
+
},
|
|
18
|
+
variants: {
|
|
19
|
+
rounded: {
|
|
20
|
+
true: {
|
|
21
|
+
borderRadius: '$xm',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
'& .cost': {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
},
|
|
28
|
+
'& .basic-summary': {
|
|
29
|
+
padding: '$15 $0 14px $0',
|
|
30
|
+
},
|
|
31
|
+
'& .output': {
|
|
32
|
+
padding: '$6 $0 $15 $0',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
},
|
|
36
|
+
'& .output__token-info': {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
justifyContent: 'start',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
paddingBottom: '$5',
|
|
41
|
+
},
|
|
42
|
+
'& .route-summary': {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
justifyContent: 'space-between',
|
|
45
|
+
alignItems: 'end',
|
|
46
|
+
},
|
|
47
|
+
'& .route-summary__separator': {
|
|
48
|
+
height: '$28',
|
|
49
|
+
marginLeft: '13px',
|
|
50
|
+
borderLeft: '1px solid $neutral700',
|
|
51
|
+
},
|
|
52
|
+
'& .token-amount': {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
justifyContent: 'space-between',
|
|
55
|
+
},
|
|
56
|
+
'& .token-amount__label': {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
alignItems: 'start',
|
|
60
|
+
},
|
|
61
|
+
'& .chains': {
|
|
62
|
+
paddingTop: '$2',
|
|
63
|
+
},
|
|
64
|
+
'& .swap-preview': {
|
|
65
|
+
padding: '$15 $0 $15 $0',
|
|
66
|
+
},
|
|
67
|
+
'& .steps': {
|
|
68
|
+
paddingLeft: '$8',
|
|
69
|
+
},
|
|
70
|
+
'& .step__title': {
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
},
|
|
74
|
+
'& .step__content': {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
alignItems: 'start',
|
|
77
|
+
},
|
|
78
|
+
'& .step__tokens': {
|
|
79
|
+
paddingTop: '$5',
|
|
80
|
+
paddingBottom: '$10',
|
|
81
|
+
display: 'flex',
|
|
82
|
+
alignItems: 'center',
|
|
83
|
+
},
|
|
84
|
+
'& .step__token-info': {
|
|
85
|
+
display: 'flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
},
|
|
88
|
+
'& .step__icon-container': {
|
|
89
|
+
margin: '$0 $2',
|
|
90
|
+
padding: '$4',
|
|
91
|
+
display: 'flex',
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const StepSeparator = styled('div', {
|
|
98
|
+
borderLeft: '1px dashed black',
|
|
99
|
+
minHeight: ' 64px',
|
|
100
|
+
margin: '0px 11.5px',
|
|
101
|
+
alignSelf: 'stretch',
|
|
102
|
+
variants: {
|
|
103
|
+
hideSeparator: {
|
|
104
|
+
true: {
|
|
105
|
+
minHeight: 'unset',
|
|
106
|
+
height: '0',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { PropTypes } from './BestRouteSkeleton.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { NextIcon } from '../../icons';
|
|
6
|
+
import { ChainToken } from '../ChainToken';
|
|
7
|
+
import { Divider } from '../Divider';
|
|
8
|
+
import { Skeleton } from '../Skeleton';
|
|
9
|
+
|
|
10
|
+
import { Container, StepSeparator } from './BestRouteSkeleton.styles';
|
|
11
|
+
|
|
12
|
+
function StepSkeleton(props: { separator?: boolean }) {
|
|
13
|
+
const { separator = true } = props;
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<div className="step__title">
|
|
17
|
+
<Skeleton height={22} width={22} variant="circular" />
|
|
18
|
+
<Divider direction="horizontal" size={8} />
|
|
19
|
+
<Skeleton height={15} width={148} variant="rounded" />
|
|
20
|
+
</div>
|
|
21
|
+
<div className="step__content">
|
|
22
|
+
<StepSeparator hideSeparator={!separator} />
|
|
23
|
+
<div className="step__tokens">
|
|
24
|
+
<div className="step__token-info">
|
|
25
|
+
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
26
|
+
<Divider direction="horizontal" size={8} />
|
|
27
|
+
<Skeleton height={12} width={76} variant="rounded" />
|
|
28
|
+
</div>
|
|
29
|
+
<div className="step__icon-container">
|
|
30
|
+
<NextIcon color="gray" size={16} />
|
|
31
|
+
</div>
|
|
32
|
+
<div className="step__token-info">
|
|
33
|
+
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
34
|
+
<Divider direction="horizontal" size={8} />
|
|
35
|
+
<Skeleton height={12} width={76} variant="rounded" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function BestRouteSkeleton(props: PropTypes) {
|
|
44
|
+
const { type, expanded, tag = false } = props;
|
|
45
|
+
const routeSummary = (
|
|
46
|
+
<div className="route-summary">
|
|
47
|
+
<div className="token-amount">
|
|
48
|
+
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
49
|
+
<Divider size={8} direction="horizontal" />
|
|
50
|
+
<div className="token-amount__label">
|
|
51
|
+
<Skeleton height={10} width={60} variant="rounded" />
|
|
52
|
+
<Divider size={4} />
|
|
53
|
+
<Skeleton height={15} width={148} variant="rounded" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<Skeleton height={12} width={64} variant="rounded" />
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Container>
|
|
62
|
+
<div className="cost-and-tag">
|
|
63
|
+
<div className="cost">
|
|
64
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
65
|
+
<Divider size={4} direction="horizontal" />
|
|
66
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
67
|
+
<Divider size={4} direction="horizontal" />
|
|
68
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
69
|
+
</div>
|
|
70
|
+
{tag && <Skeleton height={22} width={100} variant="rounded" />}
|
|
71
|
+
</div>
|
|
72
|
+
{type === 'basic' && (
|
|
73
|
+
<div className="basic-summary">
|
|
74
|
+
<Skeleton height={15} width={148} variant="rounded" />
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
{type === 'list-item' && (
|
|
78
|
+
<div className="output">
|
|
79
|
+
<div className="output__token-info">
|
|
80
|
+
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
81
|
+
<Divider direction="horizontal" size={4} />
|
|
82
|
+
<Skeleton height={15} width={150} variant="rounded" />
|
|
83
|
+
</div>
|
|
84
|
+
<Divider size={4} />
|
|
85
|
+
<Skeleton height={10} width={184} variant="rounded" />
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
{type === 'swap-preview' && (
|
|
89
|
+
<>
|
|
90
|
+
<Divider size={4} />
|
|
91
|
+
<div className="swap-preview">
|
|
92
|
+
{routeSummary}
|
|
93
|
+
<div className="route-summary__separator" />
|
|
94
|
+
{routeSummary}
|
|
95
|
+
</div>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
<div className="chains">
|
|
99
|
+
<Skeleton height={15} width={321} variant="rounded" />
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{expanded && (
|
|
103
|
+
<div className="steps">
|
|
104
|
+
<Divider size={20} />
|
|
105
|
+
<StepSkeleton />
|
|
106
|
+
<StepSkeleton />
|
|
107
|
+
<StepSkeleton separator={false} />
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
</Container>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { styled } from '../../theme';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
position: 'relative',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
width: '100%',
|
|
8
|
+
'& .separator': {
|
|
9
|
+
height: '14px',
|
|
10
|
+
marginLeft: '14px',
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
borderLeft: '1px solid $foreground',
|
|
13
|
+
top: '42%',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Step } from './BestRoute.types';
|
|
2
|
+
import type { PriceImpactWarningLevel } from '../PriceImpact';
|
|
3
|
+
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { TokenAmount } from '../TokenAmount';
|
|
7
|
+
|
|
8
|
+
import { Container } from './RouteSummary.styles';
|
|
9
|
+
|
|
10
|
+
type PropTypes = {
|
|
11
|
+
from: Step['from'];
|
|
12
|
+
to: Step['to'];
|
|
13
|
+
percentageChange?: string | null;
|
|
14
|
+
warningLevel: PriceImpactWarningLevel;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function RouteSummary(props: PropTypes) {
|
|
18
|
+
const { from, to, percentageChange, warningLevel } = props;
|
|
19
|
+
return (
|
|
20
|
+
<Container>
|
|
21
|
+
<TokenAmount
|
|
22
|
+
direction="horizontal"
|
|
23
|
+
label="Swap input"
|
|
24
|
+
type="input"
|
|
25
|
+
price={{ value: from.price.value, usdValue: from.price.usdValue }}
|
|
26
|
+
token={{
|
|
27
|
+
displayName: from.token.displayName,
|
|
28
|
+
image: from.token.image,
|
|
29
|
+
}}
|
|
30
|
+
chain={{ image: from.chain.image }}
|
|
31
|
+
/>
|
|
32
|
+
<div className="separator" />
|
|
33
|
+
<TokenAmount
|
|
34
|
+
direction="horizontal"
|
|
35
|
+
label="Estimated output"
|
|
36
|
+
type="output"
|
|
37
|
+
price={{ value: to.price.value, usdValue: to.price.usdValue }}
|
|
38
|
+
token={{
|
|
39
|
+
displayName: to.token.displayName,
|
|
40
|
+
image: to.token.image,
|
|
41
|
+
}}
|
|
42
|
+
chain={{ image: to.chain.image }}
|
|
43
|
+
percentageChange={percentageChange}
|
|
44
|
+
warningLevel={warningLevel}
|
|
45
|
+
/>
|
|
46
|
+
</Container>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { BestRouteProps } from './BestRoute.types';
|
|
2
|
+
|
|
3
|
+
export const route1: BestRouteProps = {
|
|
4
|
+
type: 'list-item',
|
|
5
|
+
recommended: true,
|
|
6
|
+
input: { value: '1', usdValue: '30000' },
|
|
7
|
+
output: { value: '3161.441024', usdValue: '26.890' },
|
|
8
|
+
steps: [
|
|
9
|
+
{
|
|
10
|
+
swapper: {
|
|
11
|
+
displayName: 'MayaProtocol',
|
|
12
|
+
image: 'https://api.rango.exchange/swappers/maya.jpg',
|
|
13
|
+
},
|
|
14
|
+
from: {
|
|
15
|
+
token: {
|
|
16
|
+
displayName: 'BTC',
|
|
17
|
+
image: 'https://api.rango.exchange/tokens/BTC/BTC.png',
|
|
18
|
+
},
|
|
19
|
+
chain: {
|
|
20
|
+
displayName: 'BTC',
|
|
21
|
+
image: 'https://api.rango.exchange/tokens/BTC/BTC.png',
|
|
22
|
+
},
|
|
23
|
+
price: {
|
|
24
|
+
value: '1.00000000',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
to: {
|
|
28
|
+
chain: {
|
|
29
|
+
displayName: 'ETH',
|
|
30
|
+
image: 'https://api.rango.exchange/blockchains/ethereum.svg',
|
|
31
|
+
},
|
|
32
|
+
token: {
|
|
33
|
+
displayName: 'ETH',
|
|
34
|
+
|
|
35
|
+
image: 'https://api.rango.exchange/tokens/ETH/ETH.png',
|
|
36
|
+
},
|
|
37
|
+
price: {
|
|
38
|
+
value: '14.863736725876758517',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
swapper: {
|
|
44
|
+
displayName: 'Satellite',
|
|
45
|
+
image: 'https://api.rango.exchange/swappers/satellite.png',
|
|
46
|
+
},
|
|
47
|
+
from: {
|
|
48
|
+
token: {
|
|
49
|
+
displayName: 'ETH',
|
|
50
|
+
image: 'https://api.rango.exchange/tokens/ETH/ETH.png',
|
|
51
|
+
},
|
|
52
|
+
chain: {
|
|
53
|
+
displayName: 'ETH',
|
|
54
|
+
image: 'https://api.rango.exchange/blockchains/ethereum.svg',
|
|
55
|
+
},
|
|
56
|
+
price: { value: '14.863736725876758517' },
|
|
57
|
+
},
|
|
58
|
+
to: {
|
|
59
|
+
token: {
|
|
60
|
+
displayName: 'ETH',
|
|
61
|
+
image: 'https://api.rango.exchange/tokens/COSMOS/ETH.png',
|
|
62
|
+
},
|
|
63
|
+
chain: {
|
|
64
|
+
displayName: 'OSMOSIS',
|
|
65
|
+
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
66
|
+
},
|
|
67
|
+
price: {
|
|
68
|
+
value: '14.825674725876758517',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
swapper: {
|
|
74
|
+
displayName: 'Osmosis',
|
|
75
|
+
image: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
76
|
+
},
|
|
77
|
+
from: {
|
|
78
|
+
token: {
|
|
79
|
+
displayName: 'ETH',
|
|
80
|
+
image: 'https://api.rango.exchange/tokens/COSMOS/ETH.png',
|
|
81
|
+
},
|
|
82
|
+
chain: {
|
|
83
|
+
displayName: 'OSMOSIS',
|
|
84
|
+
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
85
|
+
},
|
|
86
|
+
price: {
|
|
87
|
+
value: '14.825674725876758517',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
to: {
|
|
91
|
+
token: {
|
|
92
|
+
displayName: 'ATOM',
|
|
93
|
+
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
94
|
+
},
|
|
95
|
+
chain: {
|
|
96
|
+
displayName: 'OSMOSIS',
|
|
97
|
+
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
98
|
+
},
|
|
99
|
+
price: {
|
|
100
|
+
value: '3161.441024',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
swapper: {
|
|
106
|
+
displayName: 'IBC',
|
|
107
|
+
image: 'https://api.rango.exchange/swappers/IBC.png',
|
|
108
|
+
},
|
|
109
|
+
from: {
|
|
110
|
+
token: {
|
|
111
|
+
displayName: 'ATOM',
|
|
112
|
+
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
113
|
+
},
|
|
114
|
+
chain: {
|
|
115
|
+
displayName: 'OSMOSIS',
|
|
116
|
+
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
117
|
+
},
|
|
118
|
+
price: {
|
|
119
|
+
value: '3161.441024',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
to: {
|
|
123
|
+
token: {
|
|
124
|
+
displayName: 'ATOM',
|
|
125
|
+
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
126
|
+
},
|
|
127
|
+
chain: {
|
|
128
|
+
displayName: 'COSMOS',
|
|
129
|
+
image: 'https://api.rango.exchange/blockchains/cosmos.svg',
|
|
130
|
+
},
|
|
131
|
+
price: {
|
|
132
|
+
value: '3161.441024',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
|
|
138
|
+
percentageChange: '7.51',
|
|
139
|
+
warningLevel: 'high',
|
|
140
|
+
totalFee: '9.90',
|
|
141
|
+
totalTime: '23:00',
|
|
142
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { darkTheme, styled } from '../../theme';
|
|
2
|
-
import { ImageContainer } from '../common';
|
|
3
2
|
|
|
4
3
|
export const Chip = styled('button', {
|
|
5
4
|
padding: '$10',
|
|
@@ -16,7 +15,7 @@ export const Chip = styled('button', {
|
|
|
16
15
|
cursor: 'pointer',
|
|
17
16
|
border: 0,
|
|
18
17
|
fontFamily: 'inherit',
|
|
19
|
-
|
|
18
|
+
'.image-container': {
|
|
20
19
|
borderRadius: '$xm',
|
|
21
20
|
overflow: 'hidden',
|
|
22
21
|
},
|
|
@@ -13,11 +13,7 @@ export const CheckboxRoot = styled(RadixCheckbox.Root, {
|
|
|
13
13
|
width: '1rem',
|
|
14
14
|
height: '1rem',
|
|
15
15
|
padding: 0,
|
|
16
|
-
|
|
17
|
-
[`.${darkTheme} &`]: {
|
|
18
|
-
$$borderColor: '$colors$neutral700',
|
|
19
|
-
},
|
|
20
|
-
border: '1px solid $$borderColor',
|
|
16
|
+
border: '1px solid $neutral600',
|
|
21
17
|
backgroundColor: 'transparent',
|
|
22
18
|
cursor: 'pointer',
|
|
23
19
|
'&[data-state="checked"]': {
|
|
@@ -2,7 +2,6 @@ import { darkTheme, styled } from '../../theme';
|
|
|
2
2
|
|
|
3
3
|
export const BaseListItem = styled('li', {
|
|
4
4
|
width: '100%',
|
|
5
|
-
overflow: 'hidden',
|
|
6
5
|
borderRadius: '$xs',
|
|
7
6
|
display: 'flex',
|
|
8
7
|
alignItems: 'center',
|
|
@@ -23,13 +22,6 @@ export const BaseListItem = styled('li', {
|
|
|
23
22
|
flexShrink: 1,
|
|
24
23
|
flexBasis: 'auto',
|
|
25
24
|
textAlign: 'left',
|
|
26
|
-
'._description': {
|
|
27
|
-
$$color: '$colors$neutral600',
|
|
28
|
-
[`.${darkTheme} &`]: {
|
|
29
|
-
$$color: '$colors$neutral700',
|
|
30
|
-
},
|
|
31
|
-
color: '$$color',
|
|
32
|
-
},
|
|
33
25
|
|
|
34
26
|
'.item-text-title': {
|
|
35
27
|
fontWeight: 'bold',
|
|
@@ -42,7 +34,6 @@ export const BaseListItem = styled('li', {
|
|
|
42
34
|
justifyContent: 'center',
|
|
43
35
|
alignItems: 'center',
|
|
44
36
|
paddingLeft: '$10',
|
|
45
|
-
overflow: 'hidden',
|
|
46
37
|
},
|
|
47
38
|
variants: {
|
|
48
39
|
hasDivider: {
|
|
@@ -16,7 +16,7 @@ function ListItem(props: ListItemProps) {
|
|
|
16
16
|
<div className="item-text-container">
|
|
17
17
|
{title && <div className="item-text-title">{title}</div>}
|
|
18
18
|
{description && (
|
|
19
|
-
<Typography variant="body"
|
|
19
|
+
<Typography variant="body" size="small" color="neutral600">
|
|
20
20
|
{description}
|
|
21
21
|
</Typography>
|
|
22
22
|
)}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { styled } from '../../theme';
|
|
2
|
-
import { Typography } from '../Typography';
|
|
3
2
|
|
|
4
3
|
export const Container = styled('div', {
|
|
5
|
-
width: '100%',
|
|
6
4
|
display: 'flex',
|
|
7
|
-
justifyContent: '
|
|
5
|
+
justifyContent: 'center',
|
|
8
6
|
alignItems: 'center',
|
|
9
7
|
});
|
|
10
|
-
|
|
11
|
-
export const OutputUsdValue = styled(Typography, {
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
whiteSpace: 'nowrap',
|
|
14
|
-
textOverflow: 'ellipsis',
|
|
15
|
-
});
|
|
@@ -4,12 +4,12 @@ import React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { Typography } from '..';
|
|
6
6
|
|
|
7
|
-
import { Container
|
|
7
|
+
import { Container } from './PriceImpact.styles';
|
|
8
8
|
|
|
9
9
|
export function PriceImpact(props: PriceImpactProps) {
|
|
10
10
|
const { size, outputUsdValue, percentageChange, warningLevel, error } = props;
|
|
11
11
|
|
|
12
|
-
let percentageChangeColor = '$
|
|
12
|
+
let percentageChangeColor = '$neutral700';
|
|
13
13
|
if (!outputUsdValue || warningLevel === 'low') {
|
|
14
14
|
percentageChangeColor = '$warning500';
|
|
15
15
|
} else if (warningLevel === 'high') {
|
|
@@ -19,12 +19,12 @@ export function PriceImpact(props: PriceImpactProps) {
|
|
|
19
19
|
return (
|
|
20
20
|
<Container>
|
|
21
21
|
{outputUsdValue && (
|
|
22
|
-
<
|
|
22
|
+
<Typography
|
|
23
23
|
size={size === 'small' ? 'small' : 'medium'}
|
|
24
24
|
variant="body"
|
|
25
|
-
color=
|
|
25
|
+
color={size !== 'small' ? '$neutral600' : '$neutral700'}>
|
|
26
26
|
{`~$${outputUsdValue}`}
|
|
27
|
-
</
|
|
27
|
+
</Typography>
|
|
28
28
|
)}
|
|
29
29
|
{((outputUsdValue && percentageChange) || !outputUsdValue) && (
|
|
30
30
|
<Typography
|
|
@@ -9,11 +9,8 @@ export const StyledItem = styled(Radio.Item, {
|
|
|
9
9
|
borderRadius: '100%',
|
|
10
10
|
cursor: 'pointer',
|
|
11
11
|
backgroundColor: 'transparent',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
$$borderColor: '$colors$neutral700',
|
|
15
|
-
},
|
|
16
|
-
border: '1px solid $$borderColor',
|
|
12
|
+
border: '1px solid $neutral600',
|
|
13
|
+
|
|
17
14
|
'&[data-state="checked"]': {
|
|
18
15
|
$$color: '$colors$secondary500',
|
|
19
16
|
[`.${darkTheme} &`]: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { styled } from '../../theme';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
borderRadius: '$xs',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
justifyContent: 'start',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
paddingBottom: '$10',
|
|
9
|
+
'& .item': {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
},
|
|
13
|
+
'& .icon': {
|
|
14
|
+
width: '$16',
|
|
15
|
+
height: '$16',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import type { PropTypes } from './
|
|
1
|
+
import type { PropTypes } from './RouteCost.types';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import { GasIcon, NumberIcon, TimeIcon } from '../../icons';
|
|
6
|
+
import { Separator } from '../BestRoute/BestRoute.styles';
|
|
6
7
|
import { Typography } from '../Typography';
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
-
Container,
|
|
10
|
-
iconStyles,
|
|
11
|
-
itemStyles,
|
|
12
|
-
Separator,
|
|
13
|
-
} from './QuoteCost.styles';
|
|
9
|
+
import { Container } from './RouteCost.styles';
|
|
14
10
|
|
|
15
|
-
export function
|
|
11
|
+
export function RouteCost(props: PropTypes) {
|
|
16
12
|
const { fee, time, steps } = props;
|
|
17
13
|
return (
|
|
18
14
|
<Container>
|
|
19
|
-
<div className=
|
|
20
|
-
<div className=
|
|
15
|
+
<div className="item">
|
|
16
|
+
<div className="icon">
|
|
21
17
|
<GasIcon size={12} color={'gray'} />
|
|
22
18
|
</div>
|
|
23
19
|
<Typography ml={2} align="center" variant="body" size="small">
|
|
@@ -25,8 +21,8 @@ export function QuoteCost(props: PropTypes) {
|
|
|
25
21
|
</Typography>
|
|
26
22
|
</div>
|
|
27
23
|
<Separator />
|
|
28
|
-
<div className=
|
|
29
|
-
<div className=
|
|
24
|
+
<div className="item">
|
|
25
|
+
<div className="icon">
|
|
30
26
|
<TimeIcon size={12} color="gray" />
|
|
31
27
|
</div>
|
|
32
28
|
<Typography ml={2} align="center" variant="body" size="small">
|
|
@@ -34,8 +30,8 @@ export function QuoteCost(props: PropTypes) {
|
|
|
34
30
|
</Typography>
|
|
35
31
|
</div>
|
|
36
32
|
<Separator />
|
|
37
|
-
<div className=
|
|
38
|
-
<div className=
|
|
33
|
+
<div className="item">
|
|
34
|
+
<div className="icon">
|
|
39
35
|
<NumberIcon size={16} color="gray" />
|
|
40
36
|
</div>
|
|
41
37
|
<Typography ml={2} align="center" variant="body" size="small">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RouteCost } from './RouteCost';
|