@rango-dev/ui 0.35.1-next.9 → 0.36.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/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/translations/de.d.ts.map +1 -1
- package/dist/translations/el.d.ts.map +1 -1
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fi.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/it.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/translations/nl.d.ts.map +1 -1
- package/dist/translations/pl.d.ts.map +1 -1
- package/dist/translations/pt.d.ts.map +1 -1
- package/dist/translations/ru.d.ts.map +1 -1
- package/dist/translations/sv.d.ts.map +1 -1
- package/dist/translations/uk.d.ts.map +1 -1
- package/dist/translations/zh.d.ts.map +1 -1
- package/dist/ui.build.json +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.d.ts.map +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.helpers.d.ts +3 -0
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts +2 -2
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/Select.types.d.ts +4 -0
- package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts +6 -0
- package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.types.d.ts +1 -0
- package/dist/widget/ui/src/components/TextField/TextField.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/NumericTooltip.d.ts +5 -0
- package/dist/widget/ui/src/components/Tooltip/NumericTooltip.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Tooltip/NumericTooltip.types.d.ts +6 -0
- package/dist/widget/ui/src/components/Tooltip/NumericTooltip.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Tooltip/index.d.ts +2 -0
- package/dist/widget/ui/src/components/Tooltip/index.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 +6 -0
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/FullExpandedQuote/FullExpandedQuote.TokenSection.tsx +3 -3
- package/src/components/FullExpandedQuote/FullExpandedQuote.helpers.ts +15 -0
- package/src/components/FullExpandedQuote/FullExpandedQuote.tsx +11 -4
- package/src/components/FullExpandedQuote/FullExpandedQuote.types.ts +2 -2
- package/src/components/PriceImpact/PriceImpact.tsx +3 -3
- package/src/components/Select/Select.tsx +13 -4
- package/src/components/Select/Select.types.ts +5 -0
- package/src/components/StepDetails/StepDetails.tsx +5 -5
- package/src/components/StepDetails/StepDetails.types.ts +1 -1
- package/src/components/SwapListItem/SwapToken.tsx +7 -5
- package/src/components/TextField/TextField.tsx +12 -1
- package/src/components/TextField/TextField.types.tsx +1 -0
- package/src/components/TokenAmount/TokenAmount.tsx +5 -5
- package/src/components/Tooltip/NumericTooltip.tsx +16 -0
- package/src/components/Tooltip/NumericTooltip.types.tsx +6 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Wallet/Wallet.helpers.ts +1 -1
- package/src/containers/SwapInput/SwapInput.tsx +7 -5
- package/src/containers/SwapInput/TokenSection.styles.ts +1 -2
|
@@ -6,7 +6,7 @@ import { ChainToken } from '../ChainToken';
|
|
|
6
6
|
import { Divider } from '../Divider';
|
|
7
7
|
import { PriceImpact } from '../PriceImpact';
|
|
8
8
|
import { ValueTypography } from '../PriceImpact/PriceImpact.styles';
|
|
9
|
-
import {
|
|
9
|
+
import { NumericTooltip } from '../Tooltip';
|
|
10
10
|
import { Typography } from '../Typography';
|
|
11
11
|
|
|
12
12
|
import {
|
|
@@ -33,7 +33,7 @@ export function TokenAmount(props: PropTypes) {
|
|
|
33
33
|
</Typography>
|
|
34
34
|
)}
|
|
35
35
|
<div>
|
|
36
|
-
<
|
|
36
|
+
<NumericTooltip
|
|
37
37
|
content={props.price.realValue}
|
|
38
38
|
open={!props.price.realValue ? false : undefined}
|
|
39
39
|
container={props.tooltipContainer}>
|
|
@@ -50,13 +50,13 @@ export function TokenAmount(props: PropTypes) {
|
|
|
50
50
|
style={{ fontWeight: 400 }}>
|
|
51
51
|
{props.token.displayName}
|
|
52
52
|
</Typography>
|
|
53
|
-
</
|
|
53
|
+
</NumericTooltip>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
57
|
{props.price.usdValue && props.price.usdValue !== '0' && (
|
|
58
58
|
<div className={usdValueStyles()}>
|
|
59
|
-
<
|
|
59
|
+
<NumericTooltip
|
|
60
60
|
content={props.price.realUsdValue}
|
|
61
61
|
container={props.tooltipContainer}>
|
|
62
62
|
{props.type === 'input' && (
|
|
@@ -67,7 +67,7 @@ export function TokenAmount(props: PropTypes) {
|
|
|
67
67
|
<Divider direction="horizontal" size={4} />
|
|
68
68
|
</ValueTypography>
|
|
69
69
|
)}
|
|
70
|
-
</
|
|
70
|
+
</NumericTooltip>
|
|
71
71
|
{props.type === 'output' && (
|
|
72
72
|
<PriceImpact
|
|
73
73
|
size="small"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NumericTooltipPropTypes } from './NumericTooltip.types';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { Tooltip } from './Tooltip';
|
|
7
|
+
|
|
8
|
+
export function NumericTooltip(
|
|
9
|
+
props: PropsWithChildren<NumericTooltipPropTypes>
|
|
10
|
+
) {
|
|
11
|
+
const MAX_DECIMALS = 12;
|
|
12
|
+
const formattedNumber = Number(props.content)
|
|
13
|
+
.toFixed(props.maxDecimals || MAX_DECIMALS)
|
|
14
|
+
.replace(/(?:\.0*|(\.\d+?)0*)$/, '$1');
|
|
15
|
+
return <Tooltip {...props} content={formattedNumber} />;
|
|
16
|
+
}
|
|
@@ -21,7 +21,7 @@ export function makeInfo(state: WalletState): Info {
|
|
|
21
21
|
case WalletState.CONNECTING:
|
|
22
22
|
return {
|
|
23
23
|
color: 'neutral600',
|
|
24
|
-
description: i18n.t('Connecting...'),
|
|
24
|
+
description: i18n.t('Connecting ...'),
|
|
25
25
|
tooltipText: i18n.t('Connecting'),
|
|
26
26
|
};
|
|
27
27
|
case WalletState.DISCONNECTED:
|
|
@@ -5,9 +5,9 @@ import React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Divider,
|
|
8
|
+
NumericTooltip,
|
|
8
9
|
PriceImpact,
|
|
9
10
|
Skeleton,
|
|
10
|
-
Tooltip,
|
|
11
11
|
Typography,
|
|
12
12
|
} from '../../components';
|
|
13
13
|
import { UI_ID } from '../../constants';
|
|
@@ -96,7 +96,8 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
96
96
|
</>
|
|
97
97
|
) : (
|
|
98
98
|
<>
|
|
99
|
-
<
|
|
99
|
+
<NumericTooltip
|
|
100
|
+
align="end"
|
|
100
101
|
content={props.price.realValue}
|
|
101
102
|
container={props.tooltipContainer}
|
|
102
103
|
open={
|
|
@@ -109,6 +110,7 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
109
110
|
style={{ padding: 0 }}
|
|
110
111
|
value={props.price.value}
|
|
111
112
|
type={'onInputChange' in props ? 'number' : 'text'}
|
|
113
|
+
step="any"
|
|
112
114
|
size="large"
|
|
113
115
|
placeholder="0"
|
|
114
116
|
variant="ghost"
|
|
@@ -119,7 +121,7 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
119
121
|
props.onInputChange(event.target.value),
|
|
120
122
|
})}
|
|
121
123
|
/>
|
|
122
|
-
</
|
|
124
|
+
</NumericTooltip>
|
|
123
125
|
{'percentageChange' in props ? (
|
|
124
126
|
<PriceImpact
|
|
125
127
|
size="medium"
|
|
@@ -134,7 +136,7 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
134
136
|
warningLevel={props.warningLevel}
|
|
135
137
|
/>
|
|
136
138
|
) : (
|
|
137
|
-
<
|
|
139
|
+
<NumericTooltip
|
|
138
140
|
content={props.price.realUsdValue}
|
|
139
141
|
container={props.tooltipContainer}
|
|
140
142
|
open={
|
|
@@ -153,7 +155,7 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
153
155
|
: props.price.error}
|
|
154
156
|
</UsdPrice>
|
|
155
157
|
</ValueTypography>
|
|
156
|
-
</
|
|
158
|
+
</NumericTooltip>
|
|
157
159
|
)}
|
|
158
160
|
</>
|
|
159
161
|
)}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ChainImageContainer } from 'src/components/ChainToken/ChainToken.styles';
|
|
2
|
-
|
|
3
1
|
import { Button } from '../../components';
|
|
2
|
+
import { ChainImageContainer } from '../../components/ChainToken/ChainToken.styles';
|
|
4
3
|
import { css, darkTheme, styled } from '../../theme';
|
|
5
4
|
|
|
6
5
|
export const Container = styled(Button, {
|