@rango-dev/ui 0.14.1-next.0 → 0.15.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 +4 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/widget/ui/src/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +0 -5
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/ConfirmSwap/ConfirmSwap.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/index.d.ts +0 -2
- package/dist/widget/ui/src/containers/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/meta.d.ts +0 -7
- package/dist/widget/ui/src/types/meta.d.ts.map +1 -1
- package/dist/widget/ui/src/types/wallet.d.ts +0 -23
- package/dist/widget/ui/src/types/wallet.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/ColorPicker/ColorPicker.tsx +3 -4
- package/src/components/index.ts +0 -5
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +174 -5
- package/src/containers/index.ts +0 -2
- package/src/helper/index.ts +1 -1
- package/src/types/meta.ts +0 -9
- package/src/types/wallet.ts +0 -25
- package/dist/widget/ui/src/components/HeaderLayout/HeaderLayout.d.ts +0 -14
- package/dist/widget/ui/src/components/HeaderLayout/HeaderLayout.d.ts.map +0 -1
- package/dist/widget/ui/src/components/HeaderLayout/index.d.ts +0 -2
- package/dist/widget/ui/src/components/HeaderLayout/index.d.ts.map +0 -1
- package/dist/widget/ui/src/components/PercentageChange/PercentageChange.d.ts +0 -8
- package/dist/widget/ui/src/components/PercentageChange/PercentageChange.d.ts.map +0 -1
- package/dist/widget/ui/src/components/PercentageChange/index.d.ts +0 -2
- package/dist/widget/ui/src/components/PercentageChange/index.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +0 -120
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RoutesOverview/index.d.ts +0 -2
- package/dist/widget/ui/src/components/RoutesOverview/index.d.ts.map +0 -1
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +0 -120
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +0 -1
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/index.d.ts +0 -2
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/index.d.ts.map +0 -1
- package/dist/widget/ui/src/components/TokenPreview/TokenPreview.d.ts +0 -20
- package/dist/widget/ui/src/components/TokenPreview/TokenPreview.d.ts.map +0 -1
- package/dist/widget/ui/src/components/TokenPreview/index.d.ts +0 -2
- package/dist/widget/ui/src/components/TokenPreview/index.d.ts.map +0 -1
- package/dist/widget/ui/src/containers/HomePanel/HomePanel.d.ts +0 -47
- package/dist/widget/ui/src/containers/HomePanel/HomePanel.d.ts.map +0 -1
- package/dist/widget/ui/src/containers/HomePanel/index.d.ts +0 -2
- package/dist/widget/ui/src/containers/HomePanel/index.d.ts.map +0 -1
- package/dist/widget/ui/src/containers/TokenInfo/TokenInfo.d.ts +0 -34
- package/dist/widget/ui/src/containers/TokenInfo/TokenInfo.d.ts.map +0 -1
- package/dist/widget/ui/src/containers/TokenInfo/index.d.ts +0 -2
- package/dist/widget/ui/src/containers/TokenInfo/index.d.ts.map +0 -1
- package/src/components/HeaderLayout/HeaderLayout.tsx +0 -88
- package/src/components/HeaderLayout/index.ts +0 -1
- package/src/components/PercentageChange/PercentageChange.tsx +0 -21
- package/src/components/PercentageChange/index.ts +0 -1
- package/src/components/RoutesOverview/RoutesOverview.tsx +0 -56
- package/src/components/RoutesOverview/index.ts +0 -1
- package/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.tsx +0 -47
- package/src/components/SwapDetailsPlaceholder/index.ts +0 -1
- package/src/components/TokenPreview/TokenPreview.tsx +0 -183
- package/src/components/TokenPreview/index.ts +0 -1
- package/src/containers/HomePanel/HomePanel.tsx +0 -228
- package/src/containers/HomePanel/index.ts +0 -1
- package/src/containers/TokenInfo/TokenInfo.tsx +0 -308
- package/src/containers/TokenInfo/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA6CxC,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AASD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,EACb,KAAK,EACL,KAAK,EACL,WAAW,GACZ,EAAE,SAAS,qBAyCX"}
|
|
@@ -12,23 +12,18 @@ export * from './Divider';
|
|
|
12
12
|
export * from './Drawer';
|
|
13
13
|
export * from './Header';
|
|
14
14
|
export * from './HeaderButtons';
|
|
15
|
-
export * from './HeaderLayout';
|
|
16
15
|
export * from './Icon';
|
|
17
16
|
export * from './Modal';
|
|
18
|
-
export * from './PercentageChange';
|
|
19
17
|
export * from './Radio';
|
|
20
|
-
export * from './RoutesOverview';
|
|
21
18
|
export * from './SecondaryPage';
|
|
22
19
|
export * from './SelectableWalletList';
|
|
23
20
|
export * from './Spinner';
|
|
24
21
|
export * from './StepDetail';
|
|
25
22
|
export * from './SwapContainer';
|
|
26
23
|
export * from './SwapDetail';
|
|
27
|
-
export * from './SwapDetailsPlaceholder';
|
|
28
24
|
export * from './Switch';
|
|
29
25
|
export * from './TextField';
|
|
30
26
|
export * from './TokenList';
|
|
31
|
-
export * from './TokenPreview';
|
|
32
27
|
export * from './Tooltip';
|
|
33
28
|
export * from './Typography';
|
|
34
29
|
export * from './Wallet';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmSwap.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/ConfirmSwap/ConfirmSwap.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"ConfirmSwap.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/ConfirmSwap/ConfirmSwap.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;;;;AA8M1B,wBAO8B;AAE9B,eAAO,MAAM,IAAI,UAAW,SAAS,sBAOpC,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,sBAO5C,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './ConfirmSwap';
|
|
2
2
|
export * from './History';
|
|
3
|
-
export * from './HomePanel';
|
|
4
3
|
export * from './SwapHistory';
|
|
5
4
|
export * from './BlockchainSelector';
|
|
6
5
|
export * from './ConnectWalletsModal';
|
|
7
6
|
export * from './LiquiditySourcesSelector';
|
|
8
|
-
export * from './TokenInfo';
|
|
9
7
|
export * from './TokenSelector';
|
|
10
8
|
export * from './Settings';
|
|
11
9
|
export * from './Warnings';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Token } from 'rango-sdk';
|
|
2
1
|
export type TokenMeta = {
|
|
3
2
|
blockchain: string;
|
|
4
3
|
symbol: string;
|
|
@@ -22,10 +21,4 @@ export interface LiquiditySource {
|
|
|
22
21
|
selected: boolean;
|
|
23
22
|
}
|
|
24
23
|
export type LoadingStatus = 'loading' | 'success' | 'failed';
|
|
25
|
-
export interface TokenWithBalance extends Token {
|
|
26
|
-
balance?: {
|
|
27
|
-
amount: string;
|
|
28
|
-
usdValue: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
24
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/types/meta.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/types/meta.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;IACtC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC"}
|
|
@@ -21,27 +21,4 @@ export interface SelectableWallet {
|
|
|
21
21
|
selected: boolean;
|
|
22
22
|
name: string;
|
|
23
23
|
}
|
|
24
|
-
interface Wallet {
|
|
25
|
-
chain: string;
|
|
26
|
-
address: string;
|
|
27
|
-
walletType: WalletType;
|
|
28
|
-
}
|
|
29
|
-
export type TokenBalance = {
|
|
30
|
-
chain: string;
|
|
31
|
-
symbol: string;
|
|
32
|
-
ticker: string;
|
|
33
|
-
address: string | null;
|
|
34
|
-
rawAmount: string;
|
|
35
|
-
decimal: number | null;
|
|
36
|
-
amount: string;
|
|
37
|
-
logo: string | null;
|
|
38
|
-
usdPrice: number | null;
|
|
39
|
-
};
|
|
40
|
-
export interface ConnectedWallet extends Wallet {
|
|
41
|
-
balances: TokenBalance[] | null;
|
|
42
|
-
loading: boolean;
|
|
43
|
-
error: boolean;
|
|
44
|
-
explorerUrl: string | null;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
47
24
|
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,oBAAY,WAAW;IACrB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EACD,WAAW,CAAC,SAAS,GACrB,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,UAAU,GACtB,WAAW,CAAC,aAAa,CAAC;IAC9B,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,oBAAY,WAAW;IACrB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EACD,WAAW,CAAC,SAAS,GACrB,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,UAAU,GACtB,WAAW,CAAC,aAAa,CAAC;IAC9B,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@radix-ui/react-radio-group": "^1.1.1",
|
|
59
59
|
"@radix-ui/react-switch": "^1.0.1",
|
|
60
60
|
"@radix-ui/react-tooltip": "^1.0.2",
|
|
61
|
-
"@rango-dev/wallets-shared": "^0.
|
|
61
|
+
"@rango-dev/wallets-shared": "^0.15.0",
|
|
62
62
|
"@stitches/react": "^1.2.8",
|
|
63
63
|
"@types/react-color": "^3.0.6",
|
|
64
64
|
"rango-sdk": "^0.1.35",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { ChromePicker } from 'react-color';
|
|
3
|
+
import rgbHex from 'rgb-hex';
|
|
4
|
+
|
|
2
5
|
import { styled } from '../../theme';
|
|
3
6
|
import { Button } from '../Button';
|
|
4
7
|
import { CloseIcon } from '../Icon';
|
|
5
|
-
import rgbHex from 'rgb-hex';
|
|
6
|
-
import ReactColor from 'react-color';
|
|
7
|
-
|
|
8
|
-
const { ChromePicker } = ReactColor;
|
|
9
8
|
|
|
10
9
|
const Container = styled('div', {
|
|
11
10
|
position: 'relative',
|
package/src/components/index.ts
CHANGED
|
@@ -12,23 +12,18 @@ export * from './Divider';
|
|
|
12
12
|
export * from './Drawer';
|
|
13
13
|
export * from './Header';
|
|
14
14
|
export * from './HeaderButtons';
|
|
15
|
-
export * from './HeaderLayout';
|
|
16
15
|
export * from './Icon';
|
|
17
16
|
export * from './Modal';
|
|
18
|
-
export * from './PercentageChange';
|
|
19
17
|
export * from './Radio';
|
|
20
|
-
export * from './RoutesOverview';
|
|
21
18
|
export * from './SecondaryPage';
|
|
22
19
|
export * from './SelectableWalletList';
|
|
23
20
|
export * from './Spinner';
|
|
24
21
|
export * from './StepDetail';
|
|
25
22
|
export * from './SwapContainer';
|
|
26
23
|
export * from './SwapDetail';
|
|
27
|
-
export * from './SwapDetailsPlaceholder';
|
|
28
24
|
export * from './Switch';
|
|
29
25
|
export * from './TextField';
|
|
30
26
|
export * from './TokenList';
|
|
31
|
-
export * from './TokenPreview';
|
|
32
27
|
export * from './Tooltip';
|
|
33
28
|
export * from './Typography';
|
|
34
29
|
export * from './Wallet';
|
|
@@ -2,7 +2,178 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
import { ConfirmSwap, PropTypes } from './ConfirmSwap';
|
|
3
3
|
import { exampleFor5Wallets, wallets, bestRoute } from './mock';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { Divider,
|
|
5
|
+
import { Button, Typography, Divider, Image, GasIcon, styled } from '../../';
|
|
6
|
+
import { BestRouteResponse } from 'rango-sdk';
|
|
7
|
+
import { ChevronRightIcon } from '../../components';
|
|
8
|
+
const Box = styled('div', {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
width: '100%',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const Container = styled('div', {
|
|
16
|
+
boxSizing: 'border-box',
|
|
17
|
+
borderRadius: '$5',
|
|
18
|
+
padding: '$8 $16 $16 $16',
|
|
19
|
+
|
|
20
|
+
variants: {
|
|
21
|
+
type: {
|
|
22
|
+
filled: {
|
|
23
|
+
backgroundColor: '$neutral100',
|
|
24
|
+
},
|
|
25
|
+
outlined: {
|
|
26
|
+
border: '1px solid $neutral100',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
type: 'filled',
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
'.head': {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
justifyContent: 'space-between',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
minHeight: '32px',
|
|
40
|
+
'.usd-value': {
|
|
41
|
+
paddingLeft: '$8',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
'.form': {
|
|
45
|
+
display: 'flex',
|
|
46
|
+
width: '100%',
|
|
47
|
+
padding: '$2 0',
|
|
48
|
+
'.selectors': {
|
|
49
|
+
width: '35%',
|
|
50
|
+
|
|
51
|
+
'._text': {
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
textOverflow: 'ellipsis',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
'.amount': {
|
|
58
|
+
width: '30%',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const OutputContainer = styled('div', {
|
|
64
|
+
windth: '100%',
|
|
65
|
+
height: '$48',
|
|
66
|
+
borderRadius: '$5',
|
|
67
|
+
backgroundColor: '$surface',
|
|
68
|
+
border: '1px solid transparent',
|
|
69
|
+
position: 'relative',
|
|
70
|
+
display: 'flex',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
paddingLeft: '$8',
|
|
73
|
+
paddingRight: '$8',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const TokenPreview = ({
|
|
77
|
+
chain,
|
|
78
|
+
token,
|
|
79
|
+
...props
|
|
80
|
+
}: {
|
|
81
|
+
label: string;
|
|
82
|
+
amount: string;
|
|
83
|
+
usdValue?: number;
|
|
84
|
+
chain: {
|
|
85
|
+
displayName: string;
|
|
86
|
+
logo: string;
|
|
87
|
+
};
|
|
88
|
+
token: {
|
|
89
|
+
symbol: string;
|
|
90
|
+
image: string;
|
|
91
|
+
};
|
|
92
|
+
}) => (
|
|
93
|
+
<Box>
|
|
94
|
+
<Container type={'outlined'}>
|
|
95
|
+
<div className="head">
|
|
96
|
+
<Typography variant="body2" color="neutral800">
|
|
97
|
+
{props.label}
|
|
98
|
+
</Typography>
|
|
99
|
+
<div>
|
|
100
|
+
<Typography
|
|
101
|
+
variant="caption"
|
|
102
|
+
color="neutral600"
|
|
103
|
+
className="usd-value">{`$${props.usdValue}`}</Typography>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div className="form">
|
|
107
|
+
<Button
|
|
108
|
+
className="selectors"
|
|
109
|
+
variant="outlined"
|
|
110
|
+
prefix={<Image src={chain.logo} size={24} />}
|
|
111
|
+
align="start"
|
|
112
|
+
size="large">
|
|
113
|
+
{chain.displayName}
|
|
114
|
+
</Button>
|
|
115
|
+
<Divider size={12} direction="horizontal" />
|
|
116
|
+
<Button
|
|
117
|
+
className="selectors"
|
|
118
|
+
variant="outlined"
|
|
119
|
+
prefix={<Image src={token.image} size={24} />}
|
|
120
|
+
size="large"
|
|
121
|
+
align="start">
|
|
122
|
+
{token.symbol}
|
|
123
|
+
</Button>
|
|
124
|
+
<Divider size={12} direction="horizontal" />
|
|
125
|
+
<div className="amount">
|
|
126
|
+
<OutputContainer>
|
|
127
|
+
<Typography variant="h4">{props.amount}</Typography>
|
|
128
|
+
</OutputContainer>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</Container>
|
|
132
|
+
</Box>
|
|
133
|
+
);
|
|
134
|
+
const OverviewContainer = styled('div', {
|
|
135
|
+
display: 'flex',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
justifyContent: 'space-between',
|
|
138
|
+
padding: '$8',
|
|
139
|
+
borderRadius: '$5',
|
|
140
|
+
backgroundColor: '$neutral100',
|
|
141
|
+
color: '$neutral800',
|
|
142
|
+
fontSize: '$12',
|
|
143
|
+
|
|
144
|
+
'.routes': {
|
|
145
|
+
display: 'flex',
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
},
|
|
148
|
+
'.fee': {
|
|
149
|
+
display: 'flex',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const RoutesOverview = (props: { routes: BestRouteResponse; totalFee?: string }) => {
|
|
155
|
+
const swaps = props.routes.result?.swaps;
|
|
156
|
+
return (
|
|
157
|
+
<OverviewContainer>
|
|
158
|
+
<div className="routes">
|
|
159
|
+
{swaps?.map((swap, idx) => {
|
|
160
|
+
const isLast = idx + 1 == swaps.length;
|
|
161
|
+
return (
|
|
162
|
+
<React.Fragment key={idx}>
|
|
163
|
+
<div className="route">{swap.from.symbol}</div>
|
|
164
|
+
<ChevronRightIcon size={12} />
|
|
165
|
+
{isLast ? <div className="route">{swap.to.symbol}</div> : null}
|
|
166
|
+
</React.Fragment>
|
|
167
|
+
);
|
|
168
|
+
})}
|
|
169
|
+
</div>
|
|
170
|
+
<div className="fee">
|
|
171
|
+
<GasIcon size={12} />
|
|
172
|
+
<Divider size={4} direction="horizontal" />${props.totalFee}
|
|
173
|
+
</div>
|
|
174
|
+
</OverviewContainer>
|
|
175
|
+
);
|
|
176
|
+
};
|
|
6
177
|
|
|
7
178
|
const previewInputs = () => (
|
|
8
179
|
<>
|
|
@@ -15,8 +186,7 @@ const previewInputs = () => (
|
|
|
15
186
|
symbol: bestRoute?.result?.swaps[0].from.symbol || '',
|
|
16
187
|
image: bestRoute?.result?.swaps[0].from.logo || '',
|
|
17
188
|
}}
|
|
18
|
-
usdValue={
|
|
19
|
-
loadingStatus="success"
|
|
189
|
+
usdValue={2}
|
|
20
190
|
amount={'2.99'}
|
|
21
191
|
label="From"
|
|
22
192
|
/>
|
|
@@ -30,8 +200,7 @@ const previewInputs = () => (
|
|
|
30
200
|
symbol: bestRoute?.result?.swaps[0].to.symbol || '',
|
|
31
201
|
image: bestRoute?.result?.swaps[0].to.logo || '',
|
|
32
202
|
}}
|
|
33
|
-
usdValue={
|
|
34
|
-
loadingStatus="success"
|
|
203
|
+
usdValue={2}
|
|
35
204
|
amount={'2.99'}
|
|
36
205
|
label="To"
|
|
37
206
|
/>
|
package/src/containers/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './ConfirmSwap';
|
|
2
2
|
export * from './History';
|
|
3
|
-
export * from './HomePanel';
|
|
4
3
|
export * from './SwapHistory';
|
|
5
4
|
export * from './BlockchainSelector';
|
|
6
5
|
export * from './ConnectWalletsModal';
|
|
7
6
|
export * from './LiquiditySourcesSelector';
|
|
8
|
-
export * from './TokenInfo';
|
|
9
7
|
export * from './TokenSelector';
|
|
10
8
|
export * from './Settings';
|
|
11
9
|
export * from './Warnings';
|
package/src/helper/index.ts
CHANGED
package/src/types/meta.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Token } from 'rango-sdk';
|
|
2
|
-
|
|
3
1
|
export type TokenMeta = {
|
|
4
2
|
blockchain: string;
|
|
5
3
|
symbol: string;
|
|
@@ -22,10 +20,3 @@ export interface LiquiditySource {
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
export type LoadingStatus = 'loading' | 'success' | 'failed';
|
|
25
|
-
|
|
26
|
-
export interface TokenWithBalance extends Token {
|
|
27
|
-
balance?: {
|
|
28
|
-
amount: string;
|
|
29
|
-
usdValue: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
package/src/types/wallet.ts
CHANGED
|
@@ -28,28 +28,3 @@ export interface SelectableWallet {
|
|
|
28
28
|
selected: boolean;
|
|
29
29
|
name: string;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
interface Wallet {
|
|
33
|
-
chain: string;
|
|
34
|
-
address: string;
|
|
35
|
-
walletType: WalletType;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type TokenBalance = {
|
|
39
|
-
chain: string;
|
|
40
|
-
symbol: string;
|
|
41
|
-
ticker: string;
|
|
42
|
-
address: string | null;
|
|
43
|
-
rawAmount: string;
|
|
44
|
-
decimal: number | null;
|
|
45
|
-
amount: string;
|
|
46
|
-
logo: string | null;
|
|
47
|
-
usdPrice: number | null;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export interface ConnectedWallet extends Wallet {
|
|
51
|
-
balances: TokenBalance[] | null;
|
|
52
|
-
loading: boolean;
|
|
53
|
-
error: boolean;
|
|
54
|
-
explorerUrl: string | null;
|
|
55
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { LoadingStatus } from '../../types/meta';
|
|
3
|
-
import { ConnectedWallet } from '../../types/wallet';
|
|
4
|
-
interface HeaderLayoutProps {
|
|
5
|
-
loadingStatus: LoadingStatus;
|
|
6
|
-
connectedWalletsImages: string[];
|
|
7
|
-
connectedWallets: ConnectedWallet[];
|
|
8
|
-
totalBalance: string;
|
|
9
|
-
fetchingBalance: boolean;
|
|
10
|
-
onClick: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function HeaderLayout({ connectedWalletsImages, loadingStatus, connectedWallets, totalBalance, fetchingBalance, onClick, children, }: PropsWithChildren<HeaderLayoutProps>): React.JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=HeaderLayout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/components/HeaderLayout/HeaderLayout.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,UAAU,iBAAiB;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AACD,wBAAgB,YAAY,CAAC,EAC3B,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,qBAoCtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/HeaderLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PercentageChange.d.ts","sourceRoot":"","sources":["../../../../../../src/components/PercentageChange/PercentageChange.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,SAAS;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,qBAYhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/PercentageChange/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BestRouteResponse } from 'rango-sdk';
|
|
3
|
-
export declare const Container: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
|
|
4
|
-
sm: string;
|
|
5
|
-
md: string;
|
|
6
|
-
lg: string;
|
|
7
|
-
}, import("@stitches/react/types/css-util").CSS<{
|
|
8
|
-
sm: string;
|
|
9
|
-
md: string;
|
|
10
|
-
lg: string;
|
|
11
|
-
}, {
|
|
12
|
-
colors: {
|
|
13
|
-
primary: string;
|
|
14
|
-
primary100: string;
|
|
15
|
-
primary200: string;
|
|
16
|
-
primary300: string;
|
|
17
|
-
primary400: string;
|
|
18
|
-
primary500: string;
|
|
19
|
-
primary600: string;
|
|
20
|
-
primary700: string;
|
|
21
|
-
primary800: string;
|
|
22
|
-
primary900: string;
|
|
23
|
-
surface: string;
|
|
24
|
-
neutral100: string;
|
|
25
|
-
neutral200: string;
|
|
26
|
-
neutral300: string;
|
|
27
|
-
neutral400: string;
|
|
28
|
-
neutral500: string;
|
|
29
|
-
neutral600: string;
|
|
30
|
-
neutral700: string;
|
|
31
|
-
neutral800: string;
|
|
32
|
-
neutral900: string;
|
|
33
|
-
background: string;
|
|
34
|
-
foreground: string;
|
|
35
|
-
success: string;
|
|
36
|
-
success100: string;
|
|
37
|
-
success300: string;
|
|
38
|
-
success500: string;
|
|
39
|
-
success700: string;
|
|
40
|
-
warning: string;
|
|
41
|
-
warning100: string;
|
|
42
|
-
warning300: string;
|
|
43
|
-
warning500: string;
|
|
44
|
-
warning700: string;
|
|
45
|
-
error: string;
|
|
46
|
-
error100: string;
|
|
47
|
-
error300: string;
|
|
48
|
-
error500: string;
|
|
49
|
-
error700: string;
|
|
50
|
-
white: string;
|
|
51
|
-
};
|
|
52
|
-
space: {
|
|
53
|
-
2: string;
|
|
54
|
-
4: string;
|
|
55
|
-
6: string;
|
|
56
|
-
8: string;
|
|
57
|
-
10: string;
|
|
58
|
-
12: string;
|
|
59
|
-
16: string;
|
|
60
|
-
20: string;
|
|
61
|
-
24: string;
|
|
62
|
-
28: string;
|
|
63
|
-
30: string;
|
|
64
|
-
32: string;
|
|
65
|
-
};
|
|
66
|
-
fontSizes: {
|
|
67
|
-
10: string;
|
|
68
|
-
12: string;
|
|
69
|
-
14: string;
|
|
70
|
-
16: string;
|
|
71
|
-
18: string;
|
|
72
|
-
20: string;
|
|
73
|
-
24: string;
|
|
74
|
-
32: string;
|
|
75
|
-
36: string;
|
|
76
|
-
40: string;
|
|
77
|
-
48: string;
|
|
78
|
-
};
|
|
79
|
-
fonts: {};
|
|
80
|
-
fontWeights: {
|
|
81
|
-
400: string;
|
|
82
|
-
500: string;
|
|
83
|
-
600: string;
|
|
84
|
-
700: string;
|
|
85
|
-
};
|
|
86
|
-
lineHeights: {};
|
|
87
|
-
letterSpacings: {};
|
|
88
|
-
sizes: {
|
|
89
|
-
4: string;
|
|
90
|
-
6: string;
|
|
91
|
-
8: string;
|
|
92
|
-
12: string;
|
|
93
|
-
16: string;
|
|
94
|
-
20: string;
|
|
95
|
-
24: string;
|
|
96
|
-
28: string;
|
|
97
|
-
32: string;
|
|
98
|
-
36: string;
|
|
99
|
-
40: string;
|
|
100
|
-
48: string;
|
|
101
|
-
};
|
|
102
|
-
borderWidths: {};
|
|
103
|
-
borderStyles: {};
|
|
104
|
-
radii: {
|
|
105
|
-
5: string;
|
|
106
|
-
10: string;
|
|
107
|
-
};
|
|
108
|
-
shadows: {
|
|
109
|
-
s: string;
|
|
110
|
-
};
|
|
111
|
-
zIndices: {};
|
|
112
|
-
transitions: {};
|
|
113
|
-
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
114
|
-
interface PropTypes {
|
|
115
|
-
routes: BestRouteResponse | null;
|
|
116
|
-
totalFee?: string;
|
|
117
|
-
}
|
|
118
|
-
export declare function RoutesOverview(props: PropTypes): React.JSX.Element | null;
|
|
119
|
-
export {};
|
|
120
|
-
//# sourceMappingURL=RoutesOverview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RoutesOverview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RoutesOverview/RoutesOverview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAkBpB,CAAC;AAEH,UAAU,SAAS;IACjB,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,4BA0B9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RoutesOverview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|