@rango-dev/ui 0.15.1-next.16 → 0.15.1-next.17
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 +2 -2
- 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/jp.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.helpers.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.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +4 -6
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/RouteCost/RouteCost.tsx +6 -1
- package/src/components/StepDetails/StepDetails.tsx +11 -1
- package/src/components/Wallet/Wallet.helpers.ts +11 -9
- package/src/containers/SwapInput/SwapInput.stories.tsx +1 -0
- package/src/containers/SwapInput/SwapInput.tsx +4 -3
- package/src/containers/SwapInput/SwapInput.types.ts +4 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAA4oU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAqzU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAqzU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jp.d.ts","sourceRoot":"","sources":["../../../../translations/jp.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"jp.d.ts","sourceRoot":"","sources":["../../../../translations/jp.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAqzU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteCost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RouteCost/RouteCost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RouteCost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RouteCost/RouteCost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,qBAoCzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAA8C,MAAM,OAAO,CAAC;AAsGnE,eAAO,MAAM,WAAW,oHAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wallet.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Wallet.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Wallet.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Wallet.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CA6BjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapInput.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SwapInput.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAgG9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapInput.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAehC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,QAAQ,SAAU,cAAc,sBAE5C,CAAC;AAEF,eAAO,MAAM,MAAM,SAAU,cAAc,
|
|
1
|
+
{"version":3,"file":"SwapInput.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAehC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,QAAQ,SAAU,cAAc,sBAE5C,CAAC;AAEF,eAAO,MAAM,MAAM,SAAU,cAAc,sBAS1C,CAAC"}
|
|
@@ -16,23 +16,21 @@ export type BaseProps = {
|
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
error?: boolean;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
label: string;
|
|
19
20
|
sharpBottomStyle?: boolean;
|
|
20
21
|
onClickToken: () => void;
|
|
21
22
|
};
|
|
22
23
|
type FromProps = {
|
|
23
|
-
|
|
24
|
+
mode: 'From';
|
|
24
25
|
balance?: string;
|
|
25
26
|
onSelectMaxBalance: () => void;
|
|
26
27
|
onInputChange: (inputAmount: string) => void;
|
|
27
28
|
};
|
|
28
29
|
type ToProps = {
|
|
29
|
-
|
|
30
|
+
mode: 'To';
|
|
30
31
|
percentageChange: string | null;
|
|
31
32
|
warningLevel: PriceImpactWarningLevel;
|
|
32
33
|
};
|
|
33
|
-
type
|
|
34
|
-
label: string;
|
|
35
|
-
};
|
|
36
|
-
export type SwapInputProps = BaseProps & (FromProps | ToProps | Common);
|
|
34
|
+
export type SwapInputProps = BaseProps & (FromProps | ToProps);
|
|
37
35
|
export {};
|
|
38
36
|
//# sourceMappingURL=SwapInput.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAE9F,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,
|
|
1
|
+
{"version":3,"file":"SwapInput.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAE9F,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,IAAI,CAAC;IACX,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,uBAAuB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PropTypes } from './RouteCost.types';
|
|
2
2
|
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
|
|
5
6
|
import { GasIcon, NumberIcon, TimeIcon } from '../../icons';
|
|
@@ -26,7 +27,11 @@ export function RouteCost(props: PropTypes) {
|
|
|
26
27
|
<TimeIcon size={12} color="gray" />
|
|
27
28
|
</div>
|
|
28
29
|
<Typography ml={2} align="center" variant="body" size="small">
|
|
29
|
-
{
|
|
30
|
+
{i18n.t({
|
|
31
|
+
id: 'timeMin',
|
|
32
|
+
message: '{time} min',
|
|
33
|
+
values: { time },
|
|
34
|
+
})}
|
|
30
35
|
</Typography>
|
|
31
36
|
</div>
|
|
32
37
|
<Separator />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StepDetailsProps } from './StepDetails.types';
|
|
2
2
|
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
3
4
|
import React, { forwardRef, memo, useEffect, useRef } from 'react';
|
|
4
5
|
|
|
5
6
|
import { ChainToken } from '../../components/ChainToken/ChainToken';
|
|
@@ -49,7 +50,16 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
49
50
|
className="swapper__description"
|
|
50
51
|
ml={8}
|
|
51
52
|
size="small"
|
|
52
|
-
variant="body">
|
|
53
|
+
variant="body">
|
|
54
|
+
{i18n.t({
|
|
55
|
+
id: 'swapperDescription',
|
|
56
|
+
message: 'Swap on {fromChain} via {swapper}',
|
|
57
|
+
values: {
|
|
58
|
+
fromChain: step.from.chain.displayName,
|
|
59
|
+
swapper: step.swapper.displayName,
|
|
60
|
+
},
|
|
61
|
+
})}
|
|
62
|
+
</Typography>
|
|
53
63
|
</div>
|
|
54
64
|
<div className="step-info">
|
|
55
65
|
<DashedLine invisible={!hasSeparator || type === 'route-progress'} />
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Info } from './Wallet.types';
|
|
2
2
|
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
|
|
3
5
|
import { WalletState } from './Wallet.types';
|
|
4
6
|
|
|
5
7
|
export function makeInfo(state: WalletState): Info {
|
|
@@ -7,28 +9,28 @@ export function makeInfo(state: WalletState): Info {
|
|
|
7
9
|
case WalletState.CONNECTED:
|
|
8
10
|
return {
|
|
9
11
|
color: 'success500',
|
|
10
|
-
description: 'Connected',
|
|
11
|
-
tooltipText: 'Disconnect',
|
|
12
|
+
description: i18n.t('Connected'),
|
|
13
|
+
tooltipText: i18n.t('Disconnect'),
|
|
12
14
|
};
|
|
13
15
|
case WalletState.NOT_INSTALLED:
|
|
14
16
|
return {
|
|
15
17
|
color: 'info500',
|
|
16
|
-
description: 'Install',
|
|
17
|
-
tooltipText: 'Install',
|
|
18
|
+
description: i18n.t('Install'),
|
|
19
|
+
tooltipText: i18n.t('Install'),
|
|
18
20
|
};
|
|
19
21
|
case WalletState.CONNECTING:
|
|
20
22
|
return {
|
|
21
23
|
color: 'neutral800',
|
|
22
|
-
description: 'Connecting...',
|
|
23
|
-
tooltipText: 'Connecting',
|
|
24
|
+
description: i18n.t('Connecting...'),
|
|
25
|
+
tooltipText: i18n.t('Connecting'),
|
|
24
26
|
};
|
|
25
27
|
case WalletState.DISCONNECTED:
|
|
26
28
|
return {
|
|
27
29
|
color: 'neutral800',
|
|
28
|
-
description: 'Disconnected',
|
|
29
|
-
tooltipText: 'Connect',
|
|
30
|
+
description: i18n.t('Disconnected'),
|
|
31
|
+
tooltipText: i18n.t('Connect'),
|
|
30
32
|
};
|
|
31
33
|
default:
|
|
32
|
-
throw new Error('you need to pass a correct state to Wallet.');
|
|
34
|
+
throw new Error(i18n.t('you need to pass a correct state to Wallet.'));
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SwapInputProps } from './SwapInput.types';
|
|
2
2
|
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
|
|
5
6
|
import { Divider, PriceImpact, Skeleton, Typography } from '../../components';
|
|
@@ -22,14 +23,14 @@ export function SwapInput(props: SwapInputProps) {
|
|
|
22
23
|
mr={4}
|
|
23
24
|
variant="body"
|
|
24
25
|
size="xsmall">
|
|
25
|
-
Balance: {props.balance}
|
|
26
|
+
{i18n.t('Balance')}: {props.balance}
|
|
26
27
|
</Typography>
|
|
27
28
|
<MaxButton
|
|
28
29
|
variant="default"
|
|
29
30
|
size="xsmall"
|
|
30
31
|
onClick={props.onSelectMaxBalance}>
|
|
31
32
|
<Typography variant="body" size="xsmall" color="secondary500">
|
|
32
|
-
Max
|
|
33
|
+
{i18n.t('Max')}
|
|
33
34
|
</Typography>
|
|
34
35
|
</MaxButton>
|
|
35
36
|
</div>
|
|
@@ -61,7 +62,7 @@ export function SwapInput(props: SwapInputProps) {
|
|
|
61
62
|
) : (
|
|
62
63
|
<>
|
|
63
64
|
<InputAmount
|
|
64
|
-
disabled={props.disabled || props.
|
|
65
|
+
disabled={props.disabled || props.mode === 'To'}
|
|
65
66
|
style={{ padding: 0 }}
|
|
66
67
|
value={props.price.value}
|
|
67
68
|
type={'onInputChange' in props ? 'number' : 'text'}
|
|
@@ -17,25 +17,22 @@ export type BaseProps = {
|
|
|
17
17
|
loading?: boolean;
|
|
18
18
|
error?: boolean;
|
|
19
19
|
disabled?: boolean;
|
|
20
|
+
label: string;
|
|
20
21
|
sharpBottomStyle?: boolean;
|
|
21
22
|
onClickToken: () => void;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
type FromProps = {
|
|
25
|
-
|
|
26
|
+
mode: 'From';
|
|
26
27
|
balance?: string;
|
|
27
28
|
onSelectMaxBalance: () => void;
|
|
28
29
|
onInputChange: (inputAmount: string) => void;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
type ToProps = {
|
|
32
|
-
|
|
33
|
+
mode: 'To';
|
|
33
34
|
percentageChange: string | null;
|
|
34
35
|
warningLevel: PriceImpactWarningLevel;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
type
|
|
38
|
-
label: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type SwapInputProps = BaseProps & (FromProps | ToProps | Common);
|
|
38
|
+
export type SwapInputProps = BaseProps & (FromProps | ToProps);
|