@rango-dev/ui 0.26.1-next.0 → 0.26.1-next.10

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.
Files changed (196) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/index.js.map +4 -4
  3. package/dist/translations/en.d.ts.map +1 -1
  4. package/dist/translations/es.d.ts.map +1 -1
  5. package/dist/translations/fr.d.ts.map +1 -1
  6. package/dist/translations/ja.d.ts.map +1 -1
  7. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +16 -0
  8. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
  9. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +4 -0
  10. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +8 -0
  12. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
  13. package/dist/widget/ui/src/components/Button/Button.d.ts +1 -0
  14. package/dist/widget/ui/src/components/Button/Button.d.ts.map +1 -1
  15. package/dist/widget/ui/src/components/Button/Button.styles.d.ts +12 -0
  16. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  17. package/dist/widget/ui/src/components/Button/Button.types.d.ts +1 -0
  18. package/dist/widget/ui/src/components/Button/Button.types.d.ts.map +1 -1
  19. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +8 -0
  20. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
  21. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +16 -0
  22. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
  23. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +4 -0
  24. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
  25. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +4 -0
  26. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -1
  27. package/dist/widget/ui/src/components/Divider/Divider.d.ts +2 -5
  28. package/dist/widget/ui/src/components/Divider/Divider.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +165 -0
  30. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -0
  31. package/dist/widget/ui/src/components/Divider/Divider.types.d.ts +10 -0
  32. package/dist/widget/ui/src/components/Divider/Divider.types.d.ts.map +1 -0
  33. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +20 -0
  34. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
  35. package/dist/widget/ui/src/components/Header/Header.styles.d.ts +8 -0
  36. package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +4 -0
  38. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
  39. package/dist/widget/ui/src/components/Icon/common.d.ts +8 -0
  40. package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
  41. package/dist/widget/ui/src/components/List/List.styles.d.ts +4 -0
  42. package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
  43. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +4 -0
  44. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  45. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +4 -0
  46. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  47. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +4 -0
  48. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
  49. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +12 -0
  50. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
  51. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +24 -0
  52. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +4 -0
  54. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +8 -0
  56. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.d.ts.map +1 -1
  58. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +8 -0
  59. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  60. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts +6 -0
  61. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts.map +1 -1
  62. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +1 -1
  63. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +16 -0
  64. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -1
  65. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts +4 -0
  66. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -1
  67. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +8 -0
  68. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
  69. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +16 -0
  70. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
  71. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts +7 -0
  72. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts.map +1 -0
  73. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts +325 -0
  74. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts.map +1 -0
  75. package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts +2 -0
  76. package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts.map +1 -0
  77. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +4 -0
  78. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
  79. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +12 -0
  80. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
  81. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +4 -0
  82. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
  83. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  84. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +185 -1
  85. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
  86. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +16 -1
  87. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
  88. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +4 -0
  89. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
  90. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +4 -0
  91. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
  92. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.d.ts.map +1 -1
  93. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +24 -0
  94. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
  95. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +3 -1
  96. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
  97. package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
  98. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +36 -0
  99. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
  100. package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts +1 -0
  101. package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts.map +1 -1
  102. package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
  103. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +8 -0
  104. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  105. package/dist/widget/ui/src/components/TextField/TextField.d.ts +2 -1
  106. package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
  107. package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts +2 -1
  108. package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts.map +1 -1
  109. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +12 -0
  110. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
  111. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts +3 -1
  112. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts.map +1 -1
  113. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
  114. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +12 -0
  115. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
  116. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts +1 -0
  117. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts.map +1 -1
  118. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  119. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +15 -1
  120. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  121. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +6 -0
  122. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
  123. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +4 -0
  124. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
  125. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +20 -0
  126. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
  127. package/dist/widget/ui/src/components/common/FilledCircle.d.ts +4 -0
  128. package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
  129. package/dist/widget/ui/src/components/common/Image.d.ts +4 -0
  130. package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
  131. package/dist/widget/ui/src/components/common/styles.d.ts +4 -0
  132. package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
  133. package/dist/widget/ui/src/components/index.d.ts +1 -0
  134. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  135. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +40 -0
  136. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
  137. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  138. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +47 -1
  139. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  140. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +3 -0
  141. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  142. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +21 -0
  143. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  144. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +4 -0
  145. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
  146. package/dist/widget/ui/src/icons/Height.d.ts +5 -0
  147. package/dist/widget/ui/src/icons/Height.d.ts.map +1 -0
  148. package/dist/widget/ui/src/icons/Key.d.ts +5 -0
  149. package/dist/widget/ui/src/icons/Key.d.ts.map +1 -0
  150. package/dist/widget/ui/src/icons/Refresh.d.ts.map +1 -1
  151. package/dist/widget/ui/src/icons/Width.d.ts +5 -0
  152. package/dist/widget/ui/src/icons/Width.d.ts.map +1 -0
  153. package/dist/widget/ui/src/icons/index.d.ts +3 -0
  154. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  155. package/dist/widget/ui/src/theme.d.ts +29 -0
  156. package/dist/widget/ui/src/theme.d.ts.map +1 -1
  157. package/package.json +3 -3
  158. package/src/components/Button/Button.tsx +4 -1
  159. package/src/components/Button/Button.types.tsx +1 -0
  160. package/src/components/Divider/Divider.styles.ts +165 -0
  161. package/src/components/Divider/Divider.tsx +8 -140
  162. package/src/components/Divider/Divider.types.ts +10 -0
  163. package/src/components/PriceImpact/PriceImpact.tsx +26 -8
  164. package/src/components/PriceImpact/PriceImpact.types.ts +7 -0
  165. package/src/components/QuoteCost/QuoteCost.styles.ts +28 -1
  166. package/src/components/QuoteCost/QuoteCost.tsx +28 -8
  167. package/src/components/QuoteCost/QuoteCost.types.ts +4 -0
  168. package/src/components/RefreshProgressButton/RefreshProgressButton.styles.ts +28 -0
  169. package/src/components/RefreshProgressButton/RefreshProgressButton.tsx +70 -0
  170. package/src/components/RefreshProgressButton/index.ts +1 -0
  171. package/src/components/StepDetails/StepDetails.styles.ts +28 -5
  172. package/src/components/StepDetails/StepDetails.tsx +103 -37
  173. package/src/components/StepDetails/StepDetails.types.ts +18 -1
  174. package/src/components/SwapListItem/SwapListItem.tsx +6 -1
  175. package/src/components/SwapListItem/SwapListItem.types.ts +3 -1
  176. package/src/components/SwapListItem/SwapToken.tsx +15 -8
  177. package/src/components/SwapListItem/SwapToken.types.ts +1 -0
  178. package/src/components/SwapListItem/mock.ts +2 -0
  179. package/src/components/Switch/Switch.styles.tsx +7 -0
  180. package/src/components/TextField/TextField.tsx +5 -2
  181. package/src/components/TextField/TextField.types.tsx +3 -1
  182. package/src/components/TokenAmount/TokenAmount.tsx +36 -20
  183. package/src/components/TokenAmount/TokenAmount.types.ts +1 -0
  184. package/src/components/Tooltip/Tooltip.styles.ts +7 -0
  185. package/src/components/Tooltip/Tooltip.tsx +4 -2
  186. package/src/components/Tooltip/Tooltip.types.ts +6 -0
  187. package/src/components/Wallet/Wallet.styles.ts +1 -1
  188. package/src/components/index.ts +1 -0
  189. package/src/containers/SwapInput/SwapInput.tsx +53 -22
  190. package/src/containers/SwapInput/SwapInput.types.ts +3 -0
  191. package/src/icons/Height.tsx +24 -0
  192. package/src/icons/Key.tsx +32 -0
  193. package/src/icons/Refresh.tsx +10 -2
  194. package/src/icons/Width.tsx +29 -0
  195. package/src/icons/index.ts +3 -0
  196. package/src/theme.ts +3 -0
@@ -1,12 +1,13 @@
1
- import type { StepDetailsProps } from './StepDetails.types';
1
+ import type { InternalSwap, StepDetailsProps } from './StepDetails.types';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
- import React, { forwardRef, memo, useEffect, useRef } from 'react';
4
+ import React, { forwardRef, Fragment, memo, useEffect, useRef } from 'react';
5
5
 
6
6
  import { ChainToken } from '../../components/ChainToken/ChainToken';
7
7
  import { NextIcon } from '../../icons';
8
8
  import { Image } from '../common';
9
9
  import { Divider } from '../Divider';
10
+ import { Tooltip } from '../Tooltip';
10
11
  import { Typography } from '../Typography';
11
12
 
12
13
  import {
@@ -16,16 +17,37 @@ import {
16
17
  stepInfoStyles,
17
18
  StepSeparator,
18
19
  SwapperImage,
19
- swapperStyles,
20
+ swapperItemStyles,
21
+ SwapperSeparator,
22
+ swappersStyles,
20
23
  tokensContainerStyles,
21
24
  tokensStyles,
22
25
  } from './StepDetails.styles';
23
26
 
24
27
  const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
25
28
  (props, parentRef) => {
26
- const { step, hasSeparator, type, state, isFocused, tabIndex } = props;
29
+ const {
30
+ step,
31
+ hasSeparator,
32
+ type,
33
+ state,
34
+ isFocused,
35
+ tabIndex,
36
+ tooltipContainer,
37
+ } = props;
38
+
39
+ const { from, to, swapper } = step;
27
40
  const containerRef = useRef<HTMLDivElement>(null);
28
41
  const isCompleted = state === 'completed' || state === 'error';
42
+ const swappers: InternalSwap[] = step.internalSwaps?.length
43
+ ? step.internalSwaps
44
+ : [
45
+ {
46
+ from: { blockchain: from.chain.displayName },
47
+ to: { blockchain: to.chain.displayName },
48
+ swapper,
49
+ },
50
+ ];
29
51
 
30
52
  useEffect(() => {
31
53
  const parentElement = (parentRef as React.RefObject<HTMLDivElement>)
@@ -43,27 +65,63 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
43
65
  state={state}
44
66
  ref={containerRef}
45
67
  tabIndex={tabIndex}>
46
- <div className={swapperStyles()}>
47
- {type === 'swap-progress' && hasSeparator && (
48
- <StepSeparator state={state} />
49
- )}
50
- <SwapperImage state={state}>
51
- <Image size={22} src={step.swapper.image} />
52
- </SwapperImage>
53
- <Typography
54
- className="swapper__description"
55
- ml={8}
56
- size="small"
57
- variant="body">
58
- {i18n.t({
59
- id: 'Swap on {fromChain} via {swapper}',
60
- values: {
61
- fromChain: step.from.chain.displayName,
62
- swapper: step.swapper.displayName,
63
- },
68
+ {type === 'quote-details' && (
69
+ <div className={swapperItemStyles()}>
70
+ <SwapperImage state={state}>
71
+ <Image size={22} src={step.swapper.image} />
72
+ </SwapperImage>
73
+ <Typography ml={8} size="medium" variant="label">
74
+ {i18n.t({
75
+ id: 'Swap on {fromChain} via {swapper}',
76
+ values: {
77
+ fromChain: step.from.chain.displayName,
78
+ swapper: step.swapper.displayName,
79
+ },
80
+ })}
81
+ </Typography>
82
+ </div>
83
+ )}
84
+
85
+ {type === 'swap-progress' && (
86
+ <div className={swappersStyles()}>
87
+ {hasSeparator && <StepSeparator state={state} />}
88
+ {swappers.map((swapperItem, index) => {
89
+ const key = `${swapperItem.swapper.displayName}-${index}`;
90
+ return (
91
+ <Fragment key={key}>
92
+ <div
93
+ id={swapperItem.swapper.displayName}
94
+ className={swapperItemStyles()}>
95
+ <SwapperImage state={state}>
96
+ <Image size={22} src={swapperItem.swapper.image} />
97
+ </SwapperImage>
98
+ <Typography ml={8} size="medium" variant="label">
99
+ {swapperItem?.swapper.type === 'DEX'
100
+ ? i18n.t({
101
+ id: 'Swap on {fromChain} via {swapper}',
102
+ values: {
103
+ fromChain: swapperItem.from.blockchain,
104
+ swapper: swapperItem.swapper.displayName,
105
+ },
106
+ })
107
+ : i18n.t({
108
+ id: 'Bridge to {toChain} via {swapper}',
109
+ values: {
110
+ toChain: swapperItem.to.blockchain,
111
+ swapper: swapperItem.swapper.displayName,
112
+ },
113
+ })}
114
+ </Typography>
115
+ </div>
116
+ {index !== swappers.length - 1 && (
117
+ <SwapperSeparator state={state} />
118
+ )}
119
+ </Fragment>
120
+ );
64
121
  })}
65
- </Typography>
66
- </div>
122
+ </div>
123
+ )}
124
+
67
125
  <div className={stepInfoStyles()}>
68
126
  <DashedLine invisible={!hasSeparator || type === 'swap-progress'} />
69
127
  <div className={tokensContainerStyles()}>
@@ -73,12 +131,16 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
73
131
  tokenImage={step.from.token.image}
74
132
  size="small"
75
133
  />
76
- <Typography
77
- ml={4}
78
- mr={4}
79
- size="small"
80
- color="$neutral700"
81
- variant="body">{`${step.from.price.value} ${step.from.token.displayName}`}</Typography>
134
+ <Tooltip
135
+ content={step.from.price.realValue}
136
+ container={tooltipContainer}>
137
+ <Typography
138
+ ml={4}
139
+ mr={4}
140
+ size="small"
141
+ color="$neutral700"
142
+ variant="body">{`${step.from.price.value} ${step.from.token.displayName}`}</Typography>
143
+ </Tooltip>
82
144
  <NextIcon color="gray" />
83
145
  <Divider size={4} direction="horizontal" />
84
146
  <ChainToken
@@ -86,13 +148,17 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
86
148
  tokenImage={step.to.token.image}
87
149
  size="small"
88
150
  />
89
- <Typography
90
- ml={4}
91
- size="small"
92
- color="$neutral700"
93
- variant="body">{`${isCompleted ? '' : '~'}${
94
- step.to.price.value
95
- } ${step.to.token.displayName}`}</Typography>
151
+ <Tooltip
152
+ content={step.to.price.realValue}
153
+ container={tooltipContainer}>
154
+ <Typography
155
+ ml={4}
156
+ size="small"
157
+ color="$neutral700"
158
+ variant="body">{`${isCompleted ? '' : '~'}${
159
+ step.to.price.value
160
+ } ${step.to.token.displayName}`}</Typography>
161
+ </Tooltip>
96
162
  </div>
97
163
  <Alerts pb={hasSeparator && type === 'quote-details'}>
98
164
  {step.alerts}
@@ -1,10 +1,25 @@
1
+ import type { SwapperType } from 'rango-sdk';
1
2
  import type { ReactNode } from 'react';
2
3
  import type { SwapInputProps } from 'src/containers/SwapInput/SwapInput.types';
3
4
 
4
5
  type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
5
6
 
7
+ type SwapperInfo = SwapInputProps['chain'] & {
8
+ type?: SwapperType;
9
+ };
10
+
11
+ export type InternalSwap = {
12
+ swapper: SwapperInfo;
13
+ from: {
14
+ blockchain: string;
15
+ };
16
+ to: {
17
+ blockchain: string;
18
+ };
19
+ };
20
+
6
21
  export type Step = {
7
- swapper: SwapInputProps['chain'];
22
+ swapper: SwapperInfo;
8
23
  from: BaseStep;
9
24
  to: BaseStep;
10
25
  error?: {
@@ -13,6 +28,7 @@ export type Step = {
13
28
  };
14
29
  alerts?: ReactNode;
15
30
  state?: 'error' | 'warning';
31
+ internalSwaps?: InternalSwap[];
16
32
  };
17
33
 
18
34
  export type StepDetailsProps = {
@@ -22,4 +38,5 @@ export type StepDetailsProps = {
22
38
  state?: 'default' | 'in-progress' | 'completed' | 'warning' | 'error';
23
39
  isFocused?: boolean;
24
40
  tabIndex?: number;
41
+ tooltipContainer?: HTMLElement;
25
42
  };
@@ -40,6 +40,7 @@ export function SwapListItem(props: PropsWithChildren<PropTypes>) {
40
40
  onlyShowTime,
41
41
  status,
42
42
  swapTokenData,
43
+ tooltipContainer,
43
44
  } = props;
44
45
  return (
45
46
  <Main onClick={onClick.bind(null, requestId)}>
@@ -57,7 +58,11 @@ export function SwapListItem(props: PropsWithChildren<PropTypes>) {
57
58
  {getStatus(status)}
58
59
  </Typography>
59
60
  </Header>
60
- <SwapToken data={swapTokenData} status={status} />
61
+ <SwapToken
62
+ data={swapTokenData}
63
+ status={status}
64
+ tooltipContainer={tooltipContainer}
65
+ />
61
66
  </Container>
62
67
  </Main>
63
68
  );
@@ -7,6 +7,7 @@ export interface SwapListItemProps {
7
7
  onClick: (requestId: string) => void;
8
8
  swapTokenData: SwapTokenData;
9
9
  onlyShowTime?: boolean;
10
+ tooltipContainer?: HTMLElement;
10
11
  }
11
12
 
12
13
  export interface LoadingProps {
@@ -31,6 +32,7 @@ export interface SwapTokenData {
31
32
  image: string;
32
33
  };
33
34
  amount: string;
35
+ realAmount: string;
34
36
  };
35
37
 
36
38
  to: {
@@ -42,6 +44,6 @@ export interface SwapTokenData {
42
44
  image: string;
43
45
  };
44
46
  amount: string;
45
- estimatedAmount?: string;
47
+ realAmount: string;
46
48
  };
47
49
  }
@@ -7,6 +7,7 @@ import { NextIcon } from '../../icons';
7
7
  import { ChainToken } from '../ChainToken';
8
8
  import { Divider } from '../Divider';
9
9
  import { Skeleton } from '../Skeleton';
10
+ import { Tooltip } from '../Tooltip';
10
11
  import { Typography } from '../Typography';
11
12
 
12
13
  import {
@@ -70,16 +71,19 @@ export function SwapToken(props: PropTypes) {
70
71
  token: fromToken,
71
72
  amount: fromAmount,
72
73
  blockchain: fromBlockchain,
74
+ realAmount: fromRealAmount,
73
75
  },
74
76
  to: {
75
- estimatedAmount,
76
77
  token: toToken,
77
78
  amount: toAmount,
78
79
  blockchain: toBlockchain,
80
+ realAmount: toRealAmount,
79
81
  },
80
82
  },
81
83
  status,
84
+ tooltipContainer,
82
85
  } = props;
86
+
83
87
  return (
84
88
  <TokenContainer>
85
89
  <Images>
@@ -125,9 +129,11 @@ export function SwapToken(props: PropTypes) {
125
129
  {fromToken.displayName}
126
130
  </Typography>
127
131
  {!!fromAmount && (
128
- <Typography size="small" variant="body" color="neutral700">
129
- {fromAmount}
130
- </Typography>
132
+ <Tooltip content={fromRealAmount} container={tooltipContainer}>
133
+ <Typography size="small" variant="body" color="neutral700">
134
+ {fromAmount}
135
+ </Typography>
136
+ </Tooltip>
131
137
  )}
132
138
  </TokenInfo>
133
139
  <Icon>
@@ -137,10 +143,11 @@ export function SwapToken(props: PropTypes) {
137
143
  <Typography size="medium" variant="title">
138
144
  {toToken.displayName}
139
145
  </Typography>
140
-
141
- <Typography size="small" variant="body" color="neutral700">
142
- {toAmount || estimatedAmount}
143
- </Typography>
146
+ <Tooltip content={toRealAmount} container={tooltipContainer}>
147
+ <Typography size="small" variant="body" color="neutral700">
148
+ {toAmount}
149
+ </Typography>
150
+ </Tooltip>
144
151
  </TokenInfo>
145
152
  </Layout>
146
153
  )}
@@ -3,6 +3,7 @@ import type { LoadingProps, Status, SwapTokenData } from './SwapListItem.types';
3
3
  export interface SwapTokenProps {
4
4
  data: SwapTokenData;
5
5
  status: Status;
6
+ tooltipContainer?: HTMLElement;
6
7
  }
7
8
 
8
9
  export type PropTypes = SwapTokenProps | LoadingProps;
@@ -305,6 +305,7 @@ export const swapTokenData: SwapTokenData = {
305
305
  image: 'https://api.rango.exchange/swappers/osmosis.png',
306
306
  },
307
307
  amount: '1.1',
308
+ realAmount: '1.1',
308
309
  },
309
310
  to: {
310
311
  token: {
@@ -315,5 +316,6 @@ export const swapTokenData: SwapTokenData = {
315
316
  image: 'https://api.rango.exchange/swappers/osmosis.png',
316
317
  },
317
318
  amount: '0.7',
319
+ realAmount: '0.7',
318
320
  },
319
321
  };
@@ -17,6 +17,7 @@ export const StyledSwitchRoot = styled(RadixSwitch.Root, {
17
17
  padding: '0',
18
18
  cursor: 'pointer',
19
19
  transition: 'all 0.35s',
20
+ overflow: 'hidden',
20
21
 
21
22
  '&[data-state="checked"]': {
22
23
  $$color: '$colors$secondary500',
@@ -41,6 +42,12 @@ export const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
41
42
  transition: ' transform 300ms',
42
43
  borderRadius: '999999px',
43
44
  willChange: 'transform',
45
+ '&:hover': {
46
+ boxShadow: 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
47
+ '-moz-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
48
+ '-webkit-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
49
+ '-o-box-shadow': 'rgba(0, 0, 0, 0.6) 0px 3px 8px',
50
+ },
44
51
 
45
52
  '&[data-state="checked"]': {
46
53
  transform: 'translateX(8px)',
@@ -17,14 +17,17 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
17
17
  style,
18
18
  variant,
19
19
  fullWidth,
20
+ labelProps,
20
21
  ...inputAttributes
21
22
  } = props;
22
23
  return (
23
24
  <>
24
25
  {label && (
25
26
  <>
26
- <Label {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
27
- <Typography variant="label" size="large">
27
+ <Label
28
+ className="_text"
29
+ {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
30
+ <Typography variant="label" size="large" {...labelProps}>
28
31
  {label}
29
32
  </Typography>
30
33
  </Label>
@@ -1,4 +1,5 @@
1
1
  import type { InputContainer } from './TextField.styles';
2
+ import type { PropTypes as TypographyProps } from '../Typography/Typography.types';
2
3
  import type * as Stitches from '@stitches/react';
3
4
 
4
5
  type BaseProps = Stitches.VariantProps<typeof InputContainer>;
@@ -12,10 +13,11 @@ export type Ref =
12
13
  | undefined;
13
14
 
14
15
  export type PropTypes = {
15
- label?: string;
16
+ label?: string | React.ReactNode;
16
17
  prefix?: React.ReactNode;
17
18
  suffix?: React.ReactNode;
18
19
  size?: BaseSizes;
19
20
  variant?: BaseVariants;
20
21
  fullWidth?: boolean;
22
+ labelProps?: TypographyProps;
21
23
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'size'>;
@@ -4,6 +4,7 @@ import React from 'react';
4
4
 
5
5
  import { ChainToken } from '../ChainToken';
6
6
  import { PriceImpact } from '../PriceImpact/PriceImpact';
7
+ import { Tooltip } from '../Tooltip';
7
8
  import { Typography } from '../Typography';
8
9
 
9
10
  import {
@@ -27,37 +28,52 @@ export function TokenAmount(props: PropTypes) {
27
28
  {props.label}
28
29
  </Typography>
29
30
  )}
30
- <div title={`${props.price.value} ${props.token.displayName}`}>
31
- <Typography
32
- ml={4}
33
- size="medium"
34
- variant="title"
35
- style={{ fontWeight: 600 }}>
36
- {props.price.value}
37
- </Typography>
38
- <Typography
39
- ml={8}
40
- size="medium"
41
- variant="title"
42
- style={{ fontWeight: 400 }}>
43
- {props.token.displayName}
44
- </Typography>
31
+ <div>
32
+ <Tooltip
33
+ content={props.price.realValue}
34
+ open={!props.price.realValue ? false : undefined}
35
+ container={props.tooltipContainer}>
36
+ <Typography
37
+ ml={4}
38
+ size="medium"
39
+ variant="title"
40
+ style={{ fontWeight: 600 }}>
41
+ {props.price.value}
42
+ </Typography>
43
+ <Typography
44
+ ml={8}
45
+ size="medium"
46
+ variant="title"
47
+ style={{ fontWeight: 400 }}>
48
+ {props.token.displayName}
49
+ </Typography>
50
+ </Tooltip>
45
51
  </div>
46
52
  </div>
47
53
  </div>
48
54
  {props.price.usdValue && props.price.usdValue !== '0' && (
49
55
  <div className={usdValueStyles()}>
50
- {props.type === 'input' && (
51
- <Typography mr={4} size="small" variant="body" color="$neutral700">
52
- {`~$${props.price.usdValue}`}
53
- </Typography>
54
- )}
56
+ <Tooltip
57
+ content={props.price.realUsdValue}
58
+ container={props.tooltipContainer}>
59
+ {props.type === 'input' && (
60
+ <Typography
61
+ mr={4}
62
+ size="small"
63
+ variant="body"
64
+ color="$neutral700">
65
+ {`~$${props.price.usdValue}`}
66
+ </Typography>
67
+ )}
68
+ </Tooltip>
55
69
  {props.type === 'output' && (
56
70
  <PriceImpact
57
71
  size="small"
72
+ tooltipProps={{ container: props.tooltipContainer, side: 'top' }}
58
73
  outputUsdValue={props.price.usdValue}
59
74
  percentageChange={props.percentageChange}
60
75
  warningLevel={props.warningLevel}
76
+ realOutputUsdValue={props.price.realUsdValue}
61
77
  />
62
78
  )}
63
79
  </div>
@@ -6,6 +6,7 @@ type BaseProps = Pick<SwapInputProps, 'token' | 'price'> & {
6
6
  direction?: 'vertical' | 'horizontal';
7
7
  centerAlign?: boolean;
8
8
  label?: string;
9
+ tooltipContainer?: HTMLElement;
9
10
  };
10
11
 
11
12
  type InputAmountProps = { type: 'input' };
@@ -5,6 +5,13 @@ import { Typography } from '../Typography';
5
5
 
6
6
  export const TooltipContent = styled(RadixTooltip.Content, {
7
7
  zIndex: '999999',
8
+ variants: {
9
+ align: {
10
+ right: {
11
+ position: 'absolute',
12
+ },
13
+ },
14
+ },
8
15
  });
9
16
 
10
17
  export const TooltipTypography = styled(Typography, {
@@ -19,15 +19,17 @@ export function Tooltip(props: PropsWithChildren<PropTypes>) {
19
19
  container,
20
20
  open,
21
21
  side = 'top',
22
+ style,
23
+ align,
22
24
  } = props;
23
25
  return (
24
26
  <RadixTooltip.Provider delayDuration={0}>
25
27
  <RadixTooltip.Root open={open}>
26
- <RadixTooltip.Trigger asChild>
28
+ <RadixTooltip.Trigger asChild style={style}>
27
29
  <TriggerContent>{children}</TriggerContent>
28
30
  </RadixTooltip.Trigger>
29
31
  <RadixTooltip.Portal container={container}>
30
- <TooltipContent side={side} sideOffset={sideOffset}>
32
+ <TooltipContent align={align} side={side} sideOffset={sideOffset}>
31
33
  <TooltipTypography variant="label" size="medium" color={color}>
32
34
  {content}
33
35
  </TooltipTypography>
@@ -1,7 +1,11 @@
1
+ import type { TooltipContent } from './Tooltip.styles';
1
2
  import type * as RadixTooltip from '@radix-ui/react-tooltip';
3
+ import type * as Stitches from '@stitches/react';
2
4
  import type { ComponentProps, ReactNode } from 'react';
3
5
 
4
6
  type RadixTooltipContentProps = ComponentProps<typeof RadixTooltip.Content>;
7
+ type BaseProps = Stitches.VariantProps<typeof TooltipContent>;
8
+ type BaseAlign = Exclude<BaseProps['align'], object>;
5
9
 
6
10
  export interface PropTypes {
7
11
  content: ReactNode;
@@ -10,4 +14,6 @@ export interface PropTypes {
10
14
  sideOffset?: RadixTooltipContentProps['sideOffset'];
11
15
  container?: HTMLElement;
12
16
  open?: boolean;
17
+ style?: Stitches.CSSProperties;
18
+ align?: BaseAlign;
13
19
  }
@@ -72,5 +72,5 @@ export const LoadingButton = styled('div', {
72
72
  backgroundColor: '$neutral100',
73
73
  alignItems: 'center',
74
74
  justifyContent: 'center',
75
- width: 110,
75
+ width: 100,
76
76
  });
@@ -16,6 +16,7 @@ export * from './Modal';
16
16
  export * from './MessageBox';
17
17
  export * from './PercentageChange';
18
18
  export * from './RadioGroup';
19
+ export * from './RefreshProgressButton';
19
20
  export * from './RoutesOverview';
20
21
  export * from './SecondaryPage';
21
22
  export * from './SelectableWalletList';