@rango-dev/ui 0.26.0 → 0.26.1-next.1
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 +20 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +3 -3
- 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/PriceImpact/PriceImpact.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts +6 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.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.types.d.ts +1 -0
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +2 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.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/SwapListItem/SwapToken.types.d.ts +1 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.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.types.d.ts +1 -0
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.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.types.d.ts +2 -0
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.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.types.d.ts +3 -0
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/PriceImpact/PriceImpact.tsx +26 -8
- package/src/components/PriceImpact/PriceImpact.types.ts +7 -0
- package/src/components/StepDetails/StepDetails.tsx +31 -15
- package/src/components/StepDetails/StepDetails.types.ts +1 -0
- package/src/components/SwapListItem/SwapListItem.tsx +6 -1
- package/src/components/SwapListItem/SwapListItem.types.ts +2 -1
- package/src/components/SwapListItem/SwapToken.tsx +14 -8
- package/src/components/SwapListItem/SwapToken.types.ts +1 -0
- package/src/components/SwapListItem/mock.ts +1 -0
- package/src/components/TokenAmount/TokenAmount.tsx +36 -20
- package/src/components/TokenAmount/TokenAmount.types.ts +1 -0
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/Tooltip/Tooltip.types.ts +2 -0
- package/src/containers/SwapInput/SwapInput.tsx +53 -22
- package/src/containers/SwapInput/SwapInput.types.ts +3 -0
|
@@ -3,7 +3,13 @@ import type { SwapInputProps } from './SwapInput.types';
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Divider,
|
|
8
|
+
PriceImpact,
|
|
9
|
+
Skeleton,
|
|
10
|
+
Tooltip,
|
|
11
|
+
Typography,
|
|
12
|
+
} from '../../components';
|
|
7
13
|
|
|
8
14
|
import {
|
|
9
15
|
amountStyles,
|
|
@@ -77,36 +83,61 @@ export function SwapInput(props: SwapInputProps) {
|
|
|
77
83
|
</>
|
|
78
84
|
) : (
|
|
79
85
|
<>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
<Tooltip
|
|
87
|
+
content={props.price.realValue}
|
|
88
|
+
container={props.tooltipContainer}
|
|
89
|
+
open={
|
|
90
|
+
!props.price.realValue || props.price.realValue === '0'
|
|
91
|
+
? false
|
|
92
|
+
: undefined
|
|
93
|
+
}>
|
|
94
|
+
<InputAmount
|
|
95
|
+
disabled={props.disabled || props.mode === 'To'}
|
|
96
|
+
style={{ padding: 0 }}
|
|
97
|
+
value={props.price.value}
|
|
98
|
+
type={'onInputChange' in props ? 'number' : 'text'}
|
|
99
|
+
size="large"
|
|
100
|
+
placeholder="0"
|
|
101
|
+
variant="ghost"
|
|
102
|
+
min={0}
|
|
103
|
+
{...('onInputChange' in props && {
|
|
104
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) =>
|
|
105
|
+
props.onInputChange(event.target.value),
|
|
106
|
+
})}
|
|
107
|
+
/>
|
|
108
|
+
</Tooltip>
|
|
94
109
|
{'percentageChange' in props ? (
|
|
95
110
|
<PriceImpact
|
|
96
111
|
size="large"
|
|
112
|
+
tooltipProps={{
|
|
113
|
+
container: props.tooltipContainer,
|
|
114
|
+
side: 'bottom',
|
|
115
|
+
}}
|
|
97
116
|
outputUsdValue={props.price.usdValue}
|
|
117
|
+
realOutputUsdValue={props.price.realUsdValue}
|
|
98
118
|
error={props.price.error}
|
|
99
119
|
percentageChange={props.percentageChange}
|
|
100
120
|
warningLevel={props.warningLevel}
|
|
101
121
|
/>
|
|
102
122
|
) : (
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
<Tooltip
|
|
124
|
+
content={props.price.realUsdValue}
|
|
125
|
+
container={props.tooltipContainer}
|
|
126
|
+
open={
|
|
127
|
+
!props.price.realUsdValue ||
|
|
128
|
+
props.price.realUsdValue === '0'
|
|
129
|
+
? false
|
|
130
|
+
: undefined
|
|
131
|
+
}
|
|
132
|
+
side="bottom">
|
|
133
|
+
<ValueTypography hasWarning={!!props.price.error}>
|
|
134
|
+
<UsdPrice variant="body" size="medium">
|
|
135
|
+
{props.price.usdValue
|
|
136
|
+
? `~$${props.price.usdValue}`
|
|
137
|
+
: props.price.error}
|
|
138
|
+
</UsdPrice>
|
|
139
|
+
</ValueTypography>
|
|
140
|
+
</Tooltip>
|
|
110
141
|
)}
|
|
111
142
|
</>
|
|
112
143
|
)}
|
|
@@ -12,6 +12,8 @@ export type BaseProps = {
|
|
|
12
12
|
price: {
|
|
13
13
|
value: string;
|
|
14
14
|
usdValue?: string;
|
|
15
|
+
realValue?: string;
|
|
16
|
+
realUsdValue?: string;
|
|
15
17
|
error?: string;
|
|
16
18
|
};
|
|
17
19
|
loading?: boolean;
|
|
@@ -20,6 +22,7 @@ export type BaseProps = {
|
|
|
20
22
|
label: string;
|
|
21
23
|
sharpBottomStyle?: boolean;
|
|
22
24
|
onClickToken: () => void;
|
|
25
|
+
tooltipContainer?: HTMLElement;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
type FromProps = {
|