@rango-dev/ui 0.35.1-next.9 → 0.36.1-next.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 +22 -0
- 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/Tooltip.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +1 -0
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- 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 +3 -3
- 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/Tooltip.tsx +2 -0
- package/src/components/Tooltip/Tooltip.types.ts +1 -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
- package/src/icons/RangoExplorer.tsx +2 -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,6 +21,7 @@ export function Tooltip(props: PropsWithChildren<TooltipPropTypes>) {
|
|
|
21
21
|
side = 'top',
|
|
22
22
|
styles,
|
|
23
23
|
align,
|
|
24
|
+
alignOffset,
|
|
24
25
|
} = props;
|
|
25
26
|
|
|
26
27
|
return (
|
|
@@ -31,6 +32,7 @@ export function Tooltip(props: PropsWithChildren<TooltipPropTypes>) {
|
|
|
31
32
|
</RadixTooltip.Trigger>
|
|
32
33
|
<RadixTooltip.Portal container={container}>
|
|
33
34
|
<TooltipContent
|
|
35
|
+
alignOffset={alignOffset}
|
|
34
36
|
align={align}
|
|
35
37
|
side={side}
|
|
36
38
|
sideOffset={sideOffset}
|
|
@@ -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, {
|
|
@@ -17,9 +17,9 @@ function SvgRangoExplorer(props: SvgIconPropsWithChildren) {
|
|
|
17
17
|
/>
|
|
18
18
|
<path
|
|
19
19
|
d="M20.2351 15.5998C20.2351 18.1601 18.1596 20.2355 15.5994 20.2355C13.0392 20.2355 10.9637 18.1601 10.9637 15.5998C10.9637 13.0396 13.0392 10.9641 15.5994 10.9641C18.1596 10.9641 20.2351 13.0396 20.2351 15.5998ZM20.6394 20.7498C20.6096 20.7498 20.5817 20.7377 20.5642 20.7202L19.6076 19.7636C19.5686 19.7246 19.5637 19.6554 19.6091 19.6065C19.6486 19.5688 19.7169 19.5647 19.7652 19.61L20.7198 20.5646C20.7579 20.6028 20.7634 20.6698 20.7212 20.7184C20.6955 20.74 20.6657 20.7498 20.6394 20.7498Z"
|
|
20
|
-
stroke="
|
|
20
|
+
stroke="currentColor"
|
|
21
21
|
strokeWidth={0.5}
|
|
22
|
-
fill="
|
|
22
|
+
fill="transparent"
|
|
23
23
|
/>
|
|
24
24
|
<defs>
|
|
25
25
|
<linearGradient
|