@rango-dev/ui 0.22.1-next.2 → 0.22.1-next.21
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 +157 -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.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 +158 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.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 +314 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.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/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 +16 -2
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +1 -0
- 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 +6 -0
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.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 +471 -1
- 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 +3 -17
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +157 -0
- 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/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/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 +1313 -54
- 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 +2 -0
- 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 +525 -54
- 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/icons/CosmosCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/EvmCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/EvmCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Icons.stories.d.ts +1 -1
- package/dist/widget/ui/src/icons/Language.d.ts +5 -0
- package/dist/widget/ui/src/icons/Language.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/OtherCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/OtherCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +5 -0
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +0 -1
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/index.d.ts +0 -1
- package/dist/widget/ui/src/types/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/swaps.d.ts +1 -27
- package/dist/widget/ui/src/types/swaps.d.ts.map +1 -1
- package/dist/widget/ui/src/{helper → utils}/index.d.ts +0 -3
- package/dist/widget/ui/src/utils/index.d.ts.map +1 -0
- package/package.json +6 -5
- package/src/components/Alert/Alert.styles.ts +9 -12
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +2 -1
- package/src/components/Button/Button.styles.tsx +1 -0
- package/src/components/Checkbox/Checkbox.styles.ts +5 -1
- package/src/components/ListItem/ListItem.styles.ts +9 -0
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton/ListItemButton.styles.ts +1 -0
- package/src/components/PriceImpact/PriceImpact.styles.ts +9 -1
- package/src/components/PriceImpact/PriceImpact.tsx +3 -3
- package/src/components/QuoteCost/QuoteCost.styles.ts +14 -12
- package/src/components/QuoteCost/QuoteCost.tsx +12 -7
- package/src/components/Radio/Radio.styles.tsx +5 -2
- package/src/components/RoutesOverview/RoutesOverview.tsx +6 -2
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +40 -13
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +47 -46
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +3 -2
- package/src/components/Skeleton/Skeleton.types.ts +1 -1
- package/src/components/StepDetails/StepDetails.styles.ts +34 -26
- package/src/components/StepDetails/StepDetails.tsx +8 -4
- package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
- package/src/components/SwapListItem/mock.ts +21 -6
- package/src/components/Switch/Switch.styles.tsx +8 -6
- package/src/components/TextField/TextField.tsx +3 -5
- package/src/components/TokenAmount/TokenAmount.styles.ts +12 -10
- package/src/components/TokenAmount/TokenAmount.tsx +23 -17
- package/src/components/Tooltip/Tooltip.styles.ts +8 -5
- package/src/components/Tooltip/Tooltip.tsx +2 -3
- package/src/components/Wallet/Wallet.styles.ts +1 -1
- package/src/components/Wallet/Wallet.types.ts +3 -23
- package/src/components/common/Image.tsx +1 -2
- package/src/components/common/index.ts +1 -1
- package/src/containers/BlockchainSelector/BlockchainSelector.tsx +9 -8
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +5 -2
- package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
- package/src/containers/SwapHistory/mock.ts +24 -8
- package/src/containers/SwapInput/SwapInput.styles.ts +78 -27
- package/src/containers/SwapInput/SwapInput.tsx +37 -29
- package/src/containers/SwapInput/SwapInput.types.ts +2 -0
- package/src/containers/SwapInput/TokenSection.styles.ts +27 -12
- package/src/containers/SwapInput/TokenSection.tsx +15 -6
- package/src/containers/TokenSelector/TokenSelector.tsx +8 -10
- package/src/icons/CosmosCategory.tsx +137 -0
- package/src/icons/EvmCategory.tsx +74 -0
- package/src/icons/Language.tsx +55 -0
- package/src/icons/OtherCategory.tsx +72 -0
- package/src/icons/UtxoCategory.tsx +44 -0
- package/src/icons/index.ts +5 -0
- package/src/index.ts +0 -1
- package/src/theme.ts +4 -4
- package/src/types/index.ts +0 -1
- package/src/types/swaps.ts +0 -38
- package/src/utils/index.ts +23 -0
- package/dist/widget/ui/src/containers/History/types.d.ts +0 -2
- package/dist/widget/ui/src/containers/History/types.d.ts.map +0 -1
- package/dist/widget/ui/src/helper/index.d.ts.map +0 -1
- package/src/containers/History/types.tsx +0 -1
- package/src/helper/index.ts +0 -99
|
@@ -4,19 +4,19 @@ import type { PropTypes } from './SelectableCategoryList.types';
|
|
|
4
4
|
import { i18n } from '@lingui/core';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Divider,
|
|
7
|
+
import { Divider, Skeleton, Typography } from '..';
|
|
8
8
|
import { BlockchainsChip } from '../BlockchainsChip';
|
|
9
9
|
|
|
10
|
-
import { generateBlockchainsLogo } from './SelectableCategoryList.helpers';
|
|
11
10
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from './SelectableCategoryList.
|
|
11
|
+
blockchainCategoryIcons,
|
|
12
|
+
blockchainCategoryLabel,
|
|
13
|
+
hasAnyCategory,
|
|
14
|
+
} from './SelectableCategoryList.helpers';
|
|
15
|
+
import { Container } from './SelectableCategoryList.styles';
|
|
16
16
|
import { BlockchainCategories } from './SelectableCategoryList.types';
|
|
17
17
|
|
|
18
18
|
export function SelectableCategoryList(props: PropTypes) {
|
|
19
|
-
const { setCategory, category,
|
|
19
|
+
const { setCategory, category, isLoading, blockchains } = props;
|
|
20
20
|
const categories = Object.keys(
|
|
21
21
|
BlockchainCategories
|
|
22
22
|
) as BlockchainCategories[];
|
|
@@ -32,45 +32,46 @@ export function SelectableCategoryList(props: PropTypes) {
|
|
|
32
32
|
/>
|
|
33
33
|
))}
|
|
34
34
|
{!isLoading &&
|
|
35
|
-
categories.map((blockchainCategory) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
35
|
+
categories.map((blockchainCategory) => {
|
|
36
|
+
const Logo =
|
|
37
|
+
blockchainCategory !== BlockchainCategories.ALL
|
|
38
|
+
? blockchainCategoryIcons[blockchainCategory]
|
|
39
|
+
: null;
|
|
40
|
+
|
|
41
|
+
const hasBlockchain = hasAnyCategory(blockchains, blockchainCategory);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
hasBlockchain && (
|
|
45
|
+
<BlockchainsChip
|
|
46
|
+
selected={category === blockchainCategory}
|
|
47
|
+
key={blockchainCategory}
|
|
48
|
+
onClick={() => setCategory(blockchainCategory)}>
|
|
49
|
+
{Logo && (
|
|
50
|
+
<>
|
|
51
|
+
<Logo size={28} />
|
|
52
|
+
<Divider size={12} />
|
|
53
|
+
</>
|
|
54
|
+
)}
|
|
55
|
+
<Typography
|
|
56
|
+
size="xsmall"
|
|
57
|
+
variant="body"
|
|
58
|
+
color={
|
|
59
|
+
blockchainCategory === BlockchainCategories.ALL
|
|
60
|
+
? 'secondary500'
|
|
61
|
+
: undefined
|
|
62
|
+
}>
|
|
63
|
+
{i18n.t({
|
|
64
|
+
id: '{blockchainCategory}',
|
|
65
|
+
values: {
|
|
66
|
+
blockchainCategory:
|
|
67
|
+
blockchainCategoryLabel[blockchainCategory],
|
|
68
|
+
},
|
|
69
|
+
})}
|
|
70
|
+
</Typography>
|
|
71
|
+
</BlockchainsChip>
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
74
75
|
</Container>
|
|
75
76
|
);
|
|
76
77
|
}
|
|
@@ -2,8 +2,8 @@ import type { PropsWithChildren } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
|
-
import { getConciseAddress } from '../../helper';
|
|
6
5
|
import { styled } from '../../theme';
|
|
6
|
+
import { getConciseAddress } from '../../utils';
|
|
7
7
|
import { Image } from '../common';
|
|
8
8
|
import { Typography } from '../Typography';
|
|
9
9
|
|
|
@@ -5,12 +5,13 @@ import React from 'react';
|
|
|
5
5
|
import { SkeletonContainer } from './Skeleton.styles';
|
|
6
6
|
|
|
7
7
|
export function Skeleton(props: PropTypes) {
|
|
8
|
+
const { width = '100%' } = props;
|
|
8
9
|
const customCss =
|
|
9
10
|
props.variant !== 'text'
|
|
10
11
|
? {
|
|
11
|
-
width
|
|
12
|
+
width,
|
|
12
13
|
height: props.height,
|
|
13
14
|
}
|
|
14
|
-
: { width
|
|
15
|
+
: { width };
|
|
15
16
|
return <SkeletonContainer css={customCss} {...props} />;
|
|
16
17
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { css } from '@stitches/react';
|
|
2
|
+
|
|
1
3
|
import { darkTheme, styled } from '../../theme';
|
|
2
4
|
|
|
3
5
|
export const Container = styled('div', {
|
|
@@ -31,40 +33,16 @@ export const Container = styled('div', {
|
|
|
31
33
|
error: { borderColor: '$error500' },
|
|
32
34
|
},
|
|
33
35
|
},
|
|
34
|
-
'& .swapper': {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
},
|
|
38
36
|
'& .swapper__description': {
|
|
39
37
|
fontWeight: '$medium',
|
|
40
38
|
},
|
|
41
|
-
'& .step-info': {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flex: '1',
|
|
44
|
-
width: '100%',
|
|
45
|
-
alignItems: 'start',
|
|
46
|
-
variants: {
|
|
47
|
-
tx: {
|
|
48
|
-
true: {
|
|
49
|
-
paddingLeft: '36px',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
39
|
'& div:nth-child(3)': { display: 'flex', flexDirection: 'column', flex: 1 },
|
|
55
|
-
'& .tokens-container': { width: '100%' },
|
|
56
|
-
'& .tokens': {
|
|
57
|
-
display: 'flex',
|
|
58
|
-
paddingTop: '$5',
|
|
59
|
-
paddingBottom: '$10',
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
},
|
|
62
40
|
});
|
|
63
41
|
|
|
64
42
|
export const SwapperImage = styled('div', {
|
|
65
43
|
borderRadius: '100%',
|
|
66
|
-
width: '
|
|
67
|
-
height: '
|
|
44
|
+
width: '24px',
|
|
45
|
+
height: '24px',
|
|
68
46
|
overflow: 'hidden',
|
|
69
47
|
border: '1.5px solid transparent',
|
|
70
48
|
variants: {
|
|
@@ -131,3 +109,33 @@ export const StepSeparator = styled('div', {
|
|
|
131
109
|
},
|
|
132
110
|
},
|
|
133
111
|
});
|
|
112
|
+
|
|
113
|
+
export const tokensContainerStyles = css({
|
|
114
|
+
width: '100%',
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const swapperStyles = css({
|
|
118
|
+
display: 'flex',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const stepInfoStyles = css({
|
|
123
|
+
display: 'flex',
|
|
124
|
+
flex: '1',
|
|
125
|
+
width: '100%',
|
|
126
|
+
alignItems: 'start',
|
|
127
|
+
variants: {
|
|
128
|
+
tx: {
|
|
129
|
+
true: {
|
|
130
|
+
paddingLeft: '36px',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const tokensStyles = css({
|
|
137
|
+
display: 'flex',
|
|
138
|
+
paddingTop: '$5',
|
|
139
|
+
paddingBottom: '$10',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
});
|
|
@@ -13,8 +13,12 @@ import {
|
|
|
13
13
|
Alerts,
|
|
14
14
|
Container,
|
|
15
15
|
DashedLine,
|
|
16
|
+
stepInfoStyles,
|
|
16
17
|
StepSeparator,
|
|
17
18
|
SwapperImage,
|
|
19
|
+
swapperStyles,
|
|
20
|
+
tokensContainerStyles,
|
|
21
|
+
tokensStyles,
|
|
18
22
|
} from './StepDetails.styles';
|
|
19
23
|
|
|
20
24
|
const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
@@ -39,7 +43,7 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
39
43
|
state={state}
|
|
40
44
|
ref={containerRef}
|
|
41
45
|
tabIndex={tabIndex}>
|
|
42
|
-
<div className=
|
|
46
|
+
<div className={swapperStyles()}>
|
|
43
47
|
{type === 'swap-progress' && hasSeparator && (
|
|
44
48
|
<StepSeparator state={state} />
|
|
45
49
|
)}
|
|
@@ -60,10 +64,10 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
60
64
|
})}
|
|
61
65
|
</Typography>
|
|
62
66
|
</div>
|
|
63
|
-
<div className=
|
|
67
|
+
<div className={stepInfoStyles()}>
|
|
64
68
|
<DashedLine invisible={!hasSeparator || type === 'swap-progress'} />
|
|
65
|
-
<div className=
|
|
66
|
-
<div className=
|
|
69
|
+
<div className={tokensContainerStyles()}>
|
|
70
|
+
<div className={tokensStyles()}>
|
|
67
71
|
<ChainToken
|
|
68
72
|
chainImage={step.from.chain.image}
|
|
69
73
|
tokenImage={step.from.token.image}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
-
// TODO: fix ts errors
|
|
3
|
-
// eslint-disable-next-line
|
|
4
|
-
// @ts-nocheck
|
|
5
2
|
import type { SwapTokenData } from './SwapListItem.types';
|
|
6
|
-
import type { PendingSwap } from '
|
|
3
|
+
import type { PendingSwap } from 'rango-types';
|
|
7
4
|
|
|
8
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
MessageSeverity,
|
|
7
|
+
RoutingResultType,
|
|
8
|
+
TransactionType,
|
|
9
|
+
} from 'rango-types';
|
|
9
10
|
|
|
10
11
|
export const swap: PendingSwap = {
|
|
11
12
|
creationTime: '1673164511955',
|
|
@@ -21,7 +22,7 @@ export const swap: PendingSwap = {
|
|
|
21
22
|
status: 'running',
|
|
22
23
|
isPaused: false,
|
|
23
24
|
extraMessage: null,
|
|
24
|
-
extraMessageSeverity:
|
|
25
|
+
extraMessageSeverity: MessageSeverity.info,
|
|
25
26
|
extraMessageDetail: '',
|
|
26
27
|
extraMessageErrorCode: null,
|
|
27
28
|
networkStatusExtraMessage: null,
|
|
@@ -75,6 +76,7 @@ export const swap: PendingSwap = {
|
|
|
75
76
|
expenseType: 'FROM_SOURCE_WALLET',
|
|
76
77
|
name: 'Network Fee',
|
|
77
78
|
amount: '0',
|
|
79
|
+
price: null,
|
|
78
80
|
},
|
|
79
81
|
],
|
|
80
82
|
estimatedTimeInSeconds: 45,
|
|
@@ -150,6 +152,7 @@ export const swap: PendingSwap = {
|
|
|
150
152
|
includesDestinationTx: false,
|
|
151
153
|
maxRequiredSign: 1,
|
|
152
154
|
warnings: [],
|
|
155
|
+
internalSwaps: null,
|
|
153
156
|
},
|
|
154
157
|
],
|
|
155
158
|
},
|
|
@@ -164,16 +167,20 @@ export const swap: PendingSwap = {
|
|
|
164
167
|
'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
|
|
165
168
|
fromDecimals: 6,
|
|
166
169
|
fromAmountPrecision: null,
|
|
170
|
+
fromAmountRestrictionType: 'EXCLUSIVE',
|
|
171
|
+
estimatedTimeInSeconds: 5,
|
|
167
172
|
fromAmountMinValue: null,
|
|
168
173
|
fromAmountMaxValue: null,
|
|
169
174
|
toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
170
175
|
fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
176
|
+
fromUsdPrice: null,
|
|
171
177
|
toBlockchain: 'OSMOSIS',
|
|
172
178
|
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
|
|
173
179
|
toSymbol: 'OSMO',
|
|
174
180
|
toSymbolAddress: null,
|
|
175
181
|
toDecimals: 6,
|
|
176
182
|
toLogo: 'https://api.rango.exchange/i/mJQPS2',
|
|
183
|
+
toUsdPrice: null,
|
|
177
184
|
startTransactionTime: 1673164519916,
|
|
178
185
|
swapperId: 'Osmosis',
|
|
179
186
|
swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
@@ -189,6 +196,13 @@ export const swap: PendingSwap = {
|
|
|
189
196
|
description: null,
|
|
190
197
|
},
|
|
191
198
|
],
|
|
199
|
+
starknetApprovalTransaction: null,
|
|
200
|
+
starknetTransaction: null,
|
|
201
|
+
tronApprovalTransaction: null,
|
|
202
|
+
tonTransaction: null,
|
|
203
|
+
tronTransaction: null,
|
|
204
|
+
feeInUsd: null,
|
|
205
|
+
executedTransactionTime: null,
|
|
192
206
|
cosmosTransaction: {
|
|
193
207
|
type: TransactionType.COSMOS,
|
|
194
208
|
fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
|
|
@@ -276,6 +290,7 @@ export const swap: PendingSwap = {
|
|
|
276
290
|
transferTransaction: null,
|
|
277
291
|
diagnosisUrl: null,
|
|
278
292
|
internalSteps: null,
|
|
293
|
+
internalSwaps: null,
|
|
279
294
|
},
|
|
280
295
|
],
|
|
281
296
|
};
|
|
@@ -5,13 +5,15 @@ import { darkTheme, styled } from '../../theme';
|
|
|
5
5
|
export const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
6
6
|
boxSizing: 'border-box',
|
|
7
7
|
boxShadow: 'none',
|
|
8
|
-
borderStyle: 'solid',
|
|
9
8
|
width: '24px',
|
|
10
9
|
height: '16px',
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
$$color: '$colors$neutral600',
|
|
11
|
+
[`.${darkTheme} &`]: {
|
|
12
|
+
$$color: '$colors$neutral700',
|
|
13
|
+
},
|
|
14
|
+
backgroundColor: '$$color',
|
|
15
|
+
border: 'none',
|
|
13
16
|
borderRadius: '99999px',
|
|
14
|
-
position: 'relative',
|
|
15
17
|
padding: '0',
|
|
16
18
|
cursor: 'pointer',
|
|
17
19
|
transition: 'all 0.35s',
|
|
@@ -28,9 +30,9 @@ export const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
|
28
30
|
});
|
|
29
31
|
|
|
30
32
|
export const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
top: '0',
|
|
33
33
|
boxSizing: 'border-box',
|
|
34
|
+
position: 'relative',
|
|
35
|
+
left: '$2',
|
|
34
36
|
display: 'block',
|
|
35
37
|
width: '12px',
|
|
36
38
|
height: '12px',
|
|
@@ -23,9 +23,7 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
23
23
|
<>
|
|
24
24
|
{label && (
|
|
25
25
|
<>
|
|
26
|
-
<Label
|
|
27
|
-
className="_text"
|
|
28
|
-
{...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
|
|
26
|
+
<Label {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
|
|
29
27
|
<Typography variant="label" size="large">
|
|
30
28
|
{label}
|
|
31
29
|
</Typography>
|
|
@@ -39,10 +37,9 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
39
37
|
variant={variant}
|
|
40
38
|
size={size}
|
|
41
39
|
style={style}
|
|
42
|
-
className="_text">
|
|
40
|
+
className="_text-field">
|
|
43
41
|
{prefix || null}
|
|
44
42
|
<Input
|
|
45
|
-
className="_text"
|
|
46
43
|
{...inputAttributes}
|
|
47
44
|
spellCheck={false}
|
|
48
45
|
suffix={!!suffix}
|
|
@@ -56,5 +53,6 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
56
53
|
|
|
57
54
|
const TextField = React.forwardRef(TextFieldComponent);
|
|
58
55
|
TextField.displayName = 'TextField';
|
|
56
|
+
TextField.toString = () => '._text-field';
|
|
59
57
|
|
|
60
58
|
export { TextField };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '
|
|
1
|
+
import { css, styled } from '../../theme';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -15,13 +15,15 @@ export const Container = styled('div', {
|
|
|
15
15
|
true: { alignItems: 'center', justifyContent: 'center' },
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const tokenAmountStyles = css({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const usdValueStyles = css({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
paddingTop: '$5',
|
|
27
29
|
});
|
|
@@ -6,12 +6,16 @@ import { ChainToken } from '../ChainToken';
|
|
|
6
6
|
import { PriceImpact } from '../PriceImpact/PriceImpact';
|
|
7
7
|
import { Typography } from '../Typography';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Container,
|
|
11
|
+
tokenAmountStyles,
|
|
12
|
+
usdValueStyles,
|
|
13
|
+
} from './TokenAmount.styles';
|
|
10
14
|
|
|
11
15
|
export function TokenAmount(props: PropTypes) {
|
|
12
16
|
return (
|
|
13
17
|
<Container direction={props.direction} centerAlign={props.centerAlign}>
|
|
14
|
-
<div className=
|
|
18
|
+
<div className={tokenAmountStyles()}>
|
|
15
19
|
<ChainToken
|
|
16
20
|
chainImage={props.chain.image}
|
|
17
21
|
tokenImage={props.token.image}
|
|
@@ -41,21 +45,23 @@ export function TokenAmount(props: PropTypes) {
|
|
|
41
45
|
</div>
|
|
42
46
|
</div>
|
|
43
47
|
</div>
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
{props.price.usdValue && props.price.usdValue !== '0' && (
|
|
49
|
+
<div className={usdValueStyles()}>
|
|
50
|
+
{props.type === 'input' && (
|
|
51
|
+
<Typography mr={4} size="small" variant="body" color="$neutral700">
|
|
52
|
+
{`~$${props.price.usdValue}`}
|
|
53
|
+
</Typography>
|
|
54
|
+
)}
|
|
55
|
+
{props.type === 'output' && (
|
|
56
|
+
<PriceImpact
|
|
57
|
+
size="small"
|
|
58
|
+
outputUsdValue={props.price.usdValue}
|
|
59
|
+
percentageChange={props.percentageChange}
|
|
60
|
+
warningLevel={props.warningLevel}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
59
65
|
</Container>
|
|
60
66
|
);
|
|
61
67
|
}
|
|
@@ -7,13 +7,16 @@ export const TooltipContent = styled(RadixTooltip.Content, {
|
|
|
7
7
|
zIndex: '999999',
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
export const TooltipArrow = styled(RadixTooltip.Arrow, {
|
|
11
|
-
fill: '$neutral100',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
10
|
export const TooltipTypography = styled(Typography, {
|
|
15
11
|
borderRadius: '$md',
|
|
16
12
|
padding: '$5 $10',
|
|
17
|
-
boxShadow:
|
|
13
|
+
boxShadow:
|
|
14
|
+
'inset 0 0 0.5px 1px rgba(255, 255, 255, 0.075), 0 0 0 1px rgba(0, 0, 0, 0.05), 0 0.3px 0.4px rgba(0, 0, 0, 0.02), 0.9px 1.5px rgba(0, 0, 0, 0.045), 0 3.5px 6px rgba(0, 0, 0, 0.09)',
|
|
18
15
|
backgroundColor: '$neutral100',
|
|
19
16
|
});
|
|
17
|
+
|
|
18
|
+
export const TriggerContent = styled('div', {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
});
|
|
@@ -5,9 +5,9 @@ import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
TooltipArrow,
|
|
9
8
|
TooltipContent,
|
|
10
9
|
TooltipTypography,
|
|
10
|
+
TriggerContent,
|
|
11
11
|
} from './Tooltip.styles';
|
|
12
12
|
|
|
13
13
|
export function Tooltip(props: PropsWithChildren<PropTypes>) {
|
|
@@ -24,14 +24,13 @@ export function Tooltip(props: PropsWithChildren<PropTypes>) {
|
|
|
24
24
|
<RadixTooltip.Provider delayDuration={0}>
|
|
25
25
|
<RadixTooltip.Root open={open}>
|
|
26
26
|
<RadixTooltip.Trigger asChild>
|
|
27
|
-
<
|
|
27
|
+
<TriggerContent>{children}</TriggerContent>
|
|
28
28
|
</RadixTooltip.Trigger>
|
|
29
29
|
<RadixTooltip.Portal container={container}>
|
|
30
30
|
<TooltipContent side={side} sideOffset={sideOffset}>
|
|
31
31
|
<TooltipTypography variant="label" size="medium" color={color}>
|
|
32
32
|
{content}
|
|
33
33
|
</TooltipTypography>
|
|
34
|
-
<TooltipArrow />
|
|
35
34
|
</TooltipContent>
|
|
36
35
|
</RadixTooltip.Portal>
|
|
37
36
|
</RadixTooltip.Root>
|
|
@@ -21,26 +21,6 @@ export interface Info {
|
|
|
21
21
|
tooltipText: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
interface StateConnected {
|
|
25
|
-
state: WalletState.CONNECTED;
|
|
26
|
-
}
|
|
27
|
-
interface StateDisconnected {
|
|
28
|
-
state: WalletState.DISCONNECTED;
|
|
29
|
-
}
|
|
30
|
-
interface StateConnecting {
|
|
31
|
-
state: WalletState.CONNECTING;
|
|
32
|
-
}
|
|
33
|
-
interface StateNotInstalled {
|
|
34
|
-
state: WalletState.NOT_INSTALLED;
|
|
35
|
-
link: InstallObjects | string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type State =
|
|
39
|
-
| StateConnected
|
|
40
|
-
| StateDisconnected
|
|
41
|
-
| StateConnecting
|
|
42
|
-
| StateNotInstalled;
|
|
43
|
-
|
|
44
24
|
export interface ContentProps {
|
|
45
25
|
image: string;
|
|
46
26
|
title: string;
|
|
@@ -48,9 +28,11 @@ export interface ContentProps {
|
|
|
48
28
|
descriptionColor?: string;
|
|
49
29
|
}
|
|
50
30
|
|
|
51
|
-
interface
|
|
31
|
+
export interface WalletPropTypes {
|
|
32
|
+
state: WalletState;
|
|
52
33
|
title: string;
|
|
53
34
|
image: string;
|
|
35
|
+
link: InstallObjects | string;
|
|
54
36
|
type: WalletType;
|
|
55
37
|
onClick: (type: WalletType) => void;
|
|
56
38
|
selected?: boolean;
|
|
@@ -59,8 +41,6 @@ interface WalletProps {
|
|
|
59
41
|
container?: HTMLElement;
|
|
60
42
|
}
|
|
61
43
|
|
|
62
|
-
export type WalletPropTypes = State & WalletProps;
|
|
63
|
-
|
|
64
44
|
export type SelectablePropTypes = WalletPropTypes & {
|
|
65
45
|
selected: boolean;
|
|
66
46
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { styled } from '../../theme';
|
|
4
4
|
|
|
5
|
-
const ImageContainer = styled('div', {
|
|
5
|
+
export const ImageContainer = styled('div', {
|
|
6
6
|
display: 'flex',
|
|
7
7
|
justifyContent: 'center',
|
|
8
8
|
alignItems: 'center',
|
|
@@ -37,7 +37,6 @@ export function Image(props: PropTypes) {
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<ImageContainer
|
|
40
|
-
className="image-container"
|
|
41
40
|
css={{
|
|
42
41
|
width: size + 'px',
|
|
43
42
|
height: size + 'px',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { FilledCircle } from './FilledCircle';
|
|
2
|
-
export { Image } from './Image';
|
|
2
|
+
export { Image, ImageContainer } from './Image';
|