@rango-dev/ui 0.24.0 → 0.25.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.
Files changed (211) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +4 -4
  4. package/dist/translations/en.d.ts.map +1 -1
  5. package/dist/translations/es.d.ts.map +1 -1
  6. package/dist/translations/fr.d.ts.map +1 -1
  7. package/dist/translations/ja.d.ts.map +1 -1
  8. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +157 -0
  9. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
  10. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/Button/Button.d.ts +54 -54
  12. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  13. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
  14. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  15. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  16. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +158 -0
  17. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  18. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts +4 -0
  19. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +1 -0
  20. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +629 -0
  21. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -0
  22. package/dist/widget/ui/src/components/{RouteCost/RouteCost.types.d.ts → QuoteCost/QuoteCost.types.d.ts} +1 -1
  23. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -0
  24. package/dist/widget/ui/src/components/QuoteCost/index.d.ts +2 -0
  25. package/dist/widget/ui/src/components/QuoteCost/index.d.ts.map +1 -0
  26. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
  27. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
  28. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +16 -2
  30. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -1
  31. package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +1 -0
  32. package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts.map +1 -1
  33. package/dist/widget/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -1
  34. package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts +1 -1
  35. package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts.map +1 -1
  36. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +7 -1
  38. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
  39. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +16 -2
  40. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
  41. package/dist/widget/ui/src/components/StepDetails/index.d.ts +1 -1
  42. package/dist/widget/ui/src/components/StepDetails/index.d.ts.map +1 -1
  43. package/dist/widget/ui/src/components/StepDetails/mock.d.ts +1 -1
  44. package/dist/widget/ui/src/components/StepDetails/mock.d.ts.map +1 -1
  45. package/dist/widget/ui/src/components/SwapListItem/mock.d.ts +1 -1
  46. package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
  47. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  48. package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
  49. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
  50. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +471 -1
  51. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
  52. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +2 -2
  54. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +3 -17
  56. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/common/Image.d.ts +157 -0
  58. package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
  59. package/dist/widget/ui/src/components/common/index.d.ts +1 -1
  60. package/dist/widget/ui/src/components/common/index.d.ts.map +1 -1
  61. package/dist/widget/ui/src/components/index.d.ts +1 -2
  62. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  63. package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts +3 -3
  64. package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts.map +1 -1
  65. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +1 -1
  66. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
  67. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts +2 -2
  68. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts.map +1 -1
  69. package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts +1 -1
  70. package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts.map +1 -1
  71. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  72. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +1313 -54
  73. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  74. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +2 -0
  75. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  76. package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
  77. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +525 -54
  78. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  79. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +2 -2
  80. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
  81. package/dist/widget/ui/src/icons/CosmosCategory.d.ts +5 -0
  82. package/dist/widget/ui/src/icons/CosmosCategory.d.ts.map +1 -0
  83. package/dist/widget/ui/src/icons/EvmCategory.d.ts +5 -0
  84. package/dist/widget/ui/src/icons/EvmCategory.d.ts.map +1 -0
  85. package/dist/widget/ui/src/icons/Icons.stories.d.ts +1 -1
  86. package/dist/widget/ui/src/icons/Language.d.ts +5 -0
  87. package/dist/widget/ui/src/icons/Language.d.ts.map +1 -0
  88. package/dist/widget/ui/src/icons/OtherCategory.d.ts +5 -0
  89. package/dist/widget/ui/src/icons/OtherCategory.d.ts.map +1 -0
  90. package/dist/widget/ui/src/icons/UtxoCategory.d.ts +5 -0
  91. package/dist/widget/ui/src/icons/UtxoCategory.d.ts.map +1 -0
  92. package/dist/widget/ui/src/icons/index.d.ts +5 -0
  93. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  94. package/dist/widget/ui/src/index.d.ts +0 -1
  95. package/dist/widget/ui/src/index.d.ts.map +1 -1
  96. package/dist/widget/ui/src/types/index.d.ts +0 -1
  97. package/dist/widget/ui/src/types/index.d.ts.map +1 -1
  98. package/dist/widget/ui/src/types/swaps.d.ts +1 -27
  99. package/dist/widget/ui/src/types/swaps.d.ts.map +1 -1
  100. package/dist/widget/ui/src/{helper → utils}/index.d.ts +0 -3
  101. package/dist/widget/ui/src/utils/index.d.ts.map +1 -0
  102. package/package.json +7 -6
  103. package/src/components/Alert/Alert.styles.ts +9 -12
  104. package/src/components/Alert/Alert.tsx +2 -2
  105. package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +2 -1
  106. package/src/components/Button/Button.styles.tsx +1 -0
  107. package/src/components/Checkbox/Checkbox.styles.ts +5 -1
  108. package/src/components/ListItem/ListItem.styles.ts +9 -0
  109. package/src/components/ListItem/ListItem.tsx +1 -1
  110. package/src/components/ListItemButton/ListItemButton.styles.ts +1 -0
  111. package/src/components/PriceImpact/PriceImpact.styles.ts +9 -1
  112. package/src/components/PriceImpact/PriceImpact.tsx +5 -5
  113. package/src/components/QuoteCost/QuoteCost.styles.ts +29 -0
  114. package/src/components/{RouteCost/RouteCost.tsx → QuoteCost/QuoteCost.tsx} +14 -10
  115. package/src/components/QuoteCost/index.ts +1 -0
  116. package/src/components/Radio/Radio.styles.tsx +5 -2
  117. package/src/components/RoutesOverview/RoutesOverview.tsx +6 -2
  118. package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +40 -13
  119. package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +47 -46
  120. package/src/components/SelectableCategoryList/index.ts +1 -0
  121. package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
  122. package/src/components/Skeleton/Skeleton.tsx +3 -2
  123. package/src/components/Skeleton/Skeleton.types.ts +1 -1
  124. package/src/components/StepDetails/StepDetails.stories.tsx +1 -1
  125. package/src/components/StepDetails/StepDetails.styles.ts +36 -28
  126. package/src/components/StepDetails/StepDetails.tsx +11 -7
  127. package/src/components/StepDetails/StepDetails.types.ts +17 -2
  128. package/src/components/StepDetails/index.ts +1 -1
  129. package/src/components/StepDetails/mock.ts +1 -1
  130. package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
  131. package/src/components/SwapListItem/mock.ts +21 -6
  132. package/src/components/Switch/Switch.styles.tsx +8 -6
  133. package/src/components/TextField/TextField.tsx +3 -5
  134. package/src/components/TokenAmount/TokenAmount.styles.ts +12 -10
  135. package/src/components/TokenAmount/TokenAmount.tsx +23 -17
  136. package/src/components/Tooltip/Tooltip.styles.ts +8 -5
  137. package/src/components/Tooltip/Tooltip.tsx +2 -3
  138. package/src/components/Wallet/Wallet.styles.ts +1 -1
  139. package/src/components/Wallet/Wallet.types.ts +3 -23
  140. package/src/components/common/Image.tsx +1 -2
  141. package/src/components/common/index.ts +1 -1
  142. package/src/components/index.ts +1 -2
  143. package/src/containers/BlockchainSelector/BlockchainSelector.tsx +9 -8
  144. package/src/containers/SwapHistory/SwapHistory.stories.tsx +5 -2
  145. package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
  146. package/src/containers/SwapHistory/mock.ts +24 -8
  147. package/src/containers/SwapInput/SwapInput.styles.ts +78 -27
  148. package/src/containers/SwapInput/SwapInput.tsx +37 -29
  149. package/src/containers/SwapInput/SwapInput.types.ts +2 -0
  150. package/src/containers/SwapInput/TokenSection.styles.ts +27 -12
  151. package/src/containers/SwapInput/TokenSection.tsx +15 -6
  152. package/src/containers/TokenSelector/TokenSelector.tsx +8 -10
  153. package/src/icons/CosmosCategory.tsx +137 -0
  154. package/src/icons/EvmCategory.tsx +74 -0
  155. package/src/icons/Language.tsx +55 -0
  156. package/src/icons/OtherCategory.tsx +72 -0
  157. package/src/icons/UtxoCategory.tsx +44 -0
  158. package/src/icons/index.ts +5 -0
  159. package/src/index.ts +0 -1
  160. package/src/theme.ts +4 -4
  161. package/src/types/index.ts +0 -1
  162. package/src/types/swaps.ts +0 -38
  163. package/src/utils/index.ts +23 -0
  164. package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts +0 -4
  165. package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +0 -1
  166. package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts +0 -7
  167. package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts.map +0 -1
  168. package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts +0 -1429
  169. package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +0 -1
  170. package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts +0 -34
  171. package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts.map +0 -1
  172. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts +0 -4
  173. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts.map +0 -1
  174. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts +0 -319
  175. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts.map +0 -1
  176. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts +0 -6
  177. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts.map +0 -1
  178. package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts +0 -12
  179. package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts.map +0 -1
  180. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +0 -158
  181. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +0 -1
  182. package/dist/widget/ui/src/components/BestRoute/index.d.ts +0 -5
  183. package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +0 -1
  184. package/dist/widget/ui/src/components/BestRoute/mock.d.ts +0 -3
  185. package/dist/widget/ui/src/components/BestRoute/mock.d.ts.map +0 -1
  186. package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts +0 -4
  187. package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts.map +0 -1
  188. package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts +0 -158
  189. package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts.map +0 -1
  190. package/dist/widget/ui/src/components/RouteCost/RouteCost.types.d.ts.map +0 -1
  191. package/dist/widget/ui/src/components/RouteCost/index.d.ts +0 -2
  192. package/dist/widget/ui/src/components/RouteCost/index.d.ts.map +0 -1
  193. package/dist/widget/ui/src/containers/History/types.d.ts +0 -2
  194. package/dist/widget/ui/src/containers/History/types.d.ts.map +0 -1
  195. package/dist/widget/ui/src/helper/index.d.ts.map +0 -1
  196. package/src/components/BestRoute/BestRoute.stories.tsx +0 -17
  197. package/src/components/BestRoute/BestRoute.styles.ts +0 -213
  198. package/src/components/BestRoute/BestRoute.tsx +0 -176
  199. package/src/components/BestRoute/BestRoute.types.ts +0 -32
  200. package/src/components/BestRoute/BestRouteSkeleton.styles.ts +0 -110
  201. package/src/components/BestRoute/BestRouteSkeleton.tsx +0 -112
  202. package/src/components/BestRoute/BestRouteSkeleton.types.ts +0 -5
  203. package/src/components/BestRoute/RouteSummary.styles.ts +0 -15
  204. package/src/components/BestRoute/RouteSummary.tsx +0 -48
  205. package/src/components/BestRoute/index.ts +0 -4
  206. package/src/components/BestRoute/mock.ts +0 -142
  207. package/src/components/RouteCost/RouteCost.styles.ts +0 -20
  208. package/src/components/RouteCost/index.ts +0 -1
  209. package/src/containers/History/types.tsx +0 -1
  210. package/src/helper/index.ts +0 -99
  211. /package/src/components/{RouteCost/RouteCost.types.ts → QuoteCost/QuoteCost.types.ts} +0 -0
@@ -1,158 +0,0 @@
1
- export declare const Container: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
2
- sm: string;
3
- md: string;
4
- lg: string;
5
- }, import("@stitches/react/types/css-util").CSS<{
6
- sm: string;
7
- md: string;
8
- lg: string;
9
- }, {
10
- colors: {
11
- primary: string;
12
- primary500: string;
13
- primary600: string;
14
- secondary: string;
15
- secondary100: string;
16
- secondary200: string;
17
- secondary300: string;
18
- secondary400: string;
19
- secondary500: string;
20
- secondary600: string;
21
- secondary700: string;
22
- secondary800: string;
23
- secondary900: string;
24
- neutral: string;
25
- neutral100: string;
26
- neutral200: string;
27
- neutral300: string;
28
- neutral400: string;
29
- neutral500: string;
30
- neutral600: string;
31
- neutral700: string;
32
- neutral800: string;
33
- neutral900: string;
34
- error100: string;
35
- error300: string;
36
- error500: string;
37
- error600: string;
38
- error700: string;
39
- warning100: string;
40
- warning300: string;
41
- warning500: string;
42
- warning600: string;
43
- warning700: string;
44
- info: string;
45
- info100: string;
46
- info300: string;
47
- info500: string;
48
- info600: string;
49
- info700: string;
50
- success100: string;
51
- success300: string;
52
- success500: string;
53
- success600: string;
54
- success700: string;
55
- background: string;
56
- foreground: string;
57
- };
58
- space: {
59
- 0: string;
60
- 5: string;
61
- 10: string;
62
- 15: string;
63
- 20: string;
64
- 25: string;
65
- 30: string;
66
- 40: string;
67
- 46: string;
68
- 50: string;
69
- 60: string;
70
- 70: string;
71
- 80: string;
72
- 90: string;
73
- 100: string;
74
- 2: string;
75
- 4: string;
76
- 6: string;
77
- 8: string;
78
- 12: string;
79
- 16: string;
80
- 24: string;
81
- 28: string;
82
- 32: string;
83
- };
84
- radii: {
85
- xs: string;
86
- sm: string;
87
- xm: string;
88
- md: string;
89
- xl: string;
90
- lg: string;
91
- primary: string;
92
- secondary: string;
93
- };
94
- fontSizes: {
95
- 10: string;
96
- 12: string;
97
- 14: string;
98
- 16: string;
99
- 18: string;
100
- 20: string;
101
- 22: string;
102
- 24: string;
103
- 28: string;
104
- 32: string;
105
- 36: string;
106
- 40: string;
107
- 48: string;
108
- };
109
- fonts: {
110
- primary: string;
111
- widget: string;
112
- };
113
- fontWeights: {
114
- regular: number;
115
- medium: number;
116
- semiBold: number;
117
- bold: number;
118
- };
119
- lineHeights: {
120
- 12: string;
121
- 16: string;
122
- 20: string;
123
- 24: string;
124
- 26: string;
125
- 28: string;
126
- 30: string;
127
- 36: string;
128
- 40: string;
129
- 44: string;
130
- 52: string;
131
- 64: string;
132
- };
133
- letterSpacings: {};
134
- sizes: {
135
- 4: string;
136
- 6: string;
137
- 8: string;
138
- 12: string;
139
- 16: string;
140
- 18: string;
141
- 20: string;
142
- 24: string;
143
- 28: string;
144
- 32: string;
145
- 36: string;
146
- 40: string;
147
- 45: string;
148
- 48: string;
149
- };
150
- borderWidths: {};
151
- borderStyles: {};
152
- shadows: {
153
- s: string;
154
- };
155
- zIndices: {};
156
- transitions: {};
157
- }, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
158
- //# sourceMappingURL=RouteCost.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RouteCost.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RouteCost/RouteCost.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAiBpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RouteCost.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RouteCost/RouteCost.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,2 +0,0 @@
1
- export { RouteCost } from './RouteCost';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/RouteCost/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/History/types.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helper/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,SAAI,EACZ,cAAc,SAAI,GACjB,MAAM,GAAG,IAAI,CAYf;AA2CD,eAAO,MAAM,mBAAmB,SACxB,MAAM,QACN,OAAO,GAAG,MAAM,UACd,MAAM;;CA8Bf,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { BestRoute } from './BestRoute';
4
- import { route1 } from './mock';
5
-
6
- const meta: Meta<typeof BestRoute> = {
7
- component: BestRoute,
8
- };
9
-
10
- export default meta;
11
- type Story = StoryObj<typeof BestRoute>;
12
-
13
- export const Main: Story = {
14
- args: {
15
- ...route1,
16
- },
17
- };
@@ -1,213 +0,0 @@
1
- import * as Collapsible from '@radix-ui/react-collapsible';
2
-
3
- import { darkTheme, styled } from '../../theme';
4
- import { Image } from '../common';
5
- import { CollapsibleContent } from '../common/styles';
6
-
7
- export const EXPANDABLE_ROUTES_TRANSITION_DURATION = 300;
8
-
9
- export const RouteContainer = styled(Collapsible.Root, {
10
- display: 'flex',
11
- flexDirection: 'column',
12
- alignItems: 'start',
13
- overflowX: 'auto',
14
- overflowY: 'hidden',
15
- width: '100%',
16
- borderRadius: '$xm',
17
- variants: {
18
- recommended: {
19
- true: {
20
- $$color: '$colors$info300',
21
- [`.${darkTheme} &`]: {
22
- $$color: '$colors$secondary800',
23
- },
24
- backgroundColor: '$$color',
25
- },
26
- false: {
27
- $$color: '$colors$neutral400',
28
- [`.${darkTheme} &`]: {
29
- $$color: '$colors$neutral200',
30
- },
31
- backgroundColor: '$$color',
32
- },
33
- },
34
- },
35
- '& .steps-details': {
36
- padding: '$10 $15',
37
- },
38
- });
39
-
40
- export const SummaryContainer = styled('div', {
41
- borderRadius: '$xm',
42
- display: 'flex',
43
- flexDirection: 'column',
44
- alignItems: 'start',
45
- justifyContent: 'space-between',
46
- color: '$foreground',
47
- cursor: 'pointer',
48
- boxSizing: 'border-box',
49
- position: 'relative',
50
- variants: {
51
- recommended: {
52
- true: {
53
- $$color: '$colors$info100',
54
- [`.${darkTheme} &`]: {
55
- $$color: '$colors$secondary600',
56
- },
57
- backgroundColor: '$$color',
58
- '&:hover': {
59
- backgroundColor: '$$color',
60
- },
61
- },
62
- false: {
63
- $$color: '$colors$neutral200',
64
- [`.${darkTheme} &`]: {
65
- $$color: '$colors$neutral500',
66
- },
67
- backgroundColor: '$$color',
68
- '&:hover': {
69
- backgroundColor: '$$color',
70
- },
71
- },
72
- },
73
- basic: { true: { borderTopRightRadius: '0', borderTopLeftRadius: '0' } },
74
- listItem: {
75
- true: {},
76
- false: {},
77
- },
78
- },
79
-
80
- compoundVariants: [
81
- {
82
- listItem: true,
83
- recommended: true,
84
- css: {
85
- '&:hover': {
86
- $$color: '$colors$secondary200',
87
- [`.${darkTheme} &`]: {
88
- $$color: '$colors$secondary700',
89
- },
90
- backgroundColor: '$$color',
91
- },
92
- },
93
- },
94
- {
95
- listItem: true,
96
- recommended: false,
97
- css: {
98
- '&:hover': {
99
- $$color: '$colors$neutral300',
100
- [`.${darkTheme} &`]: {
101
- $$color: '$colors$neutral400',
102
- },
103
- backgroundColor: '$$color',
104
- },
105
- },
106
- },
107
- ],
108
- '& .summary': {
109
- width: '100%',
110
- padding: '$15 $15 $10 $15',
111
- },
112
- '& .basic-info': {
113
- paddingTop: '$10',
114
- display: 'flex',
115
- alignItems: 'center',
116
- },
117
- });
118
-
119
- export const Chains = styled(Collapsible.Trigger, {
120
- display: 'flex',
121
- width: '100%',
122
- justifyContent: 'space-between',
123
- alignItems: 'center',
124
- height: '$36',
125
- padding: '$10 $15',
126
- boxSizing: 'border-box',
127
- cursor: 'pointer',
128
- border: 'none',
129
- outline: 'none',
130
- backgroundColor: 'transparent',
131
- variants: {
132
- error: {
133
- true: {
134
- [`& ${Image}`]: {
135
- border: '1px $warning500 solid',
136
- borderRadius: '100%',
137
- },
138
- },
139
- false: {
140
- [`& ${Image}`]: {
141
- border: '1px transparent solid',
142
- borderRadius: '100%',
143
- },
144
- },
145
- },
146
- recommended: {
147
- true: {
148
- $$color: '$colors$info300',
149
- [`.${darkTheme} &`]: {
150
- $$color: '$colors$secondary800',
151
- },
152
- backgroundColor: '$$color',
153
- },
154
- false: {
155
- $$color: '$colors$neutral400',
156
- [`.${darkTheme} &`]: {
157
- $$color: '$colors$neutral200',
158
- },
159
- backgroundColor: '$$color',
160
- },
161
- },
162
- },
163
- '& div:nth-child(1)': { display: 'flex' },
164
- });
165
-
166
- export const Content = styled(CollapsibleContent, {
167
- width: '100%',
168
- });
169
-
170
- export const IconContainer = styled('div', {
171
- display: 'flex',
172
- justifyContent: 'center',
173
- alignItems: 'center',
174
- padding: '$2',
175
- transition: `all ${EXPANDABLE_ROUTES_TRANSITION_DURATION}ms ease`,
176
- variants: {
177
- orientation: {
178
- down: {
179
- transform: 'rotate(0)',
180
- },
181
- up: {
182
- transform: 'rotate(180deg)',
183
- },
184
- },
185
- },
186
- });
187
-
188
- export const Separator = styled('div', {
189
- height: '$12',
190
- marginLeft: '$10',
191
- marginRight: '$10',
192
- borderLeft: '1px solid $foreground',
193
- });
194
-
195
- export const HorizontalSeparator = styled('div', {
196
- display: 'flex',
197
- justifyContent: 'center',
198
- margin: '0 $15',
199
- borderTop: '1px solid',
200
- $$color: '$colors$neutral300',
201
- [`.${darkTheme} &`]: {
202
- $$color: '$colors$neutral400',
203
- },
204
- borderColor: '$$color',
205
- });
206
-
207
- export const FrameIcon = styled('div', {
208
- width: '$16',
209
- height: '$16',
210
- justifyContent: 'center',
211
- alignItems: 'center',
212
- display: 'flex',
213
- });
@@ -1,176 +0,0 @@
1
- import type { BestRouteProps } from './BestRoute.types';
2
-
3
- import React, { useLayoutEffect, useRef, useState } from 'react';
4
-
5
- import { Typography } from '../../components/Typography';
6
- import { ChevronDownIcon, ChevronRightIcon, InfoIcon } from '../../icons';
7
- import { Image } from '../common';
8
- import { Divider } from '../Divider';
9
- import { RouteCost } from '../RouteCost';
10
- import { StepDetails } from '../StepDetails';
11
- import { TokenAmount } from '../TokenAmount/TokenAmount';
12
- import { Tooltip } from '../Tooltip';
13
-
14
- import {
15
- Chains,
16
- Content,
17
- EXPANDABLE_ROUTES_TRANSITION_DURATION,
18
- FrameIcon,
19
- HorizontalSeparator,
20
- IconContainer,
21
- RouteContainer,
22
- SummaryContainer,
23
- } from './BestRoute.styles';
24
- import { RouteSummary } from './RouteSummary';
25
-
26
- export function BestRoute(props: BestRouteProps) {
27
- const {
28
- steps,
29
- totalFee,
30
- totalTime,
31
- input,
32
- output,
33
- percentageChange,
34
- warningLevel,
35
- type,
36
- recommended = true,
37
- } = props;
38
-
39
- const numberOfSteps = steps.length;
40
-
41
- const [expanded, setExpanded] = useState(props.expanded);
42
- const routeRef = useRef<HTMLButtonElement | null>(null);
43
-
44
- useLayoutEffect(() => {
45
- if (expanded && routeRef.current) {
46
- setTimeout(() => {
47
- routeRef?.current?.scrollIntoView({ behavior: 'smooth' });
48
- }, EXPANDABLE_ROUTES_TRANSITION_DURATION);
49
- }
50
- }, [expanded]);
51
-
52
- return (
53
- <>
54
- <SummaryContainer
55
- recommended={recommended}
56
- listItem={type === 'list-item'}
57
- basic={type === 'basic'}>
58
- <div className="summary">
59
- <RouteCost fee={totalFee} time={totalTime} steps={numberOfSteps} />
60
- {type === 'basic' && (
61
- <div className="basic-info">
62
- <FrameIcon>
63
- <InfoIcon size={12} color="gray" />
64
- </FrameIcon>
65
- <Typography
66
- size="small"
67
- variant="body"
68
- style={{ letterSpacing: 0.4 }}>
69
- {`${input.value} ${steps[0].from.token.displayName} = ${
70
- output.value
71
- } ${steps[steps.length - 1].to.token.displayName}`}
72
- </Typography>
73
- <Typography
74
- color="$neutral600"
75
- ml={2}
76
- size="xsmall"
77
- variant="body">
78
- {`($${output.usdValue})`}
79
- </Typography>
80
- </div>
81
- )}
82
- {type === 'list-item' && (
83
- <TokenAmount
84
- type="output"
85
- direction="vertical"
86
- price={{ value: output.value, usdValue: output.usdValue }}
87
- token={{
88
- displayName: steps[numberOfSteps - 1].to.token.displayName,
89
- image: steps[numberOfSteps - 1].to.token.image,
90
- }}
91
- chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
92
- percentageChange={percentageChange}
93
- warningLevel={warningLevel}
94
- />
95
- )}
96
- {type === 'swap-preview' && (
97
- <>
98
- <RouteSummary
99
- from={steps[0].from}
100
- to={steps[numberOfSteps - 1].to}
101
- percentageChange={percentageChange}
102
- warningLevel={warningLevel}
103
- />
104
- <Divider size={4} />
105
- </>
106
- )}
107
- </div>
108
- <RouteContainer
109
- recommended={recommended}
110
- open={expanded}
111
- onOpenChange={setExpanded}>
112
- <Chains
113
- ref={(ref) => (routeRef.current = ref)}
114
- recommended={recommended}
115
- onClick={setExpanded.bind(null, (prevState) => !prevState)}>
116
- <div>
117
- {steps.map((step, index) => {
118
- const key = `item-${index}`;
119
- return (
120
- <React.Fragment key={key}>
121
- <Tooltip
122
- container={props.tooltipContainer}
123
- side="bottom"
124
- sideOffset={4}
125
- content={step.from.chain.displayName}>
126
- <Image src={step.from.chain.image} size={16} />
127
- </Tooltip>
128
- {index === numberOfSteps - 1 && (
129
- <>
130
- <IconContainer>
131
- <ChevronRightIcon size={12} color="black" />
132
- </IconContainer>
133
- <Tooltip
134
- container={props.tooltipContainer}
135
- side="bottom"
136
- sideOffset={4}
137
- content={step.to.chain.displayName}>
138
- <Image src={step.to.chain.image} size={16} />
139
- </Tooltip>
140
- </>
141
- )}
142
- {index !== numberOfSteps - 1 && (
143
- <IconContainer>
144
- <ChevronRightIcon size={12} color="black" />
145
- </IconContainer>
146
- )}
147
- </React.Fragment>
148
- );
149
- })}
150
- </div>
151
- <IconContainer orientation={expanded ? 'up' : 'down'}>
152
- <ChevronDownIcon size={12} color="black" />
153
- </IconContainer>
154
- </Chains>
155
- <Content open={expanded}>
156
- <HorizontalSeparator />
157
- <div className="steps-details">
158
- {steps.map((step, index) => {
159
- const key = `item-${index}`;
160
- return (
161
- <StepDetails
162
- type="route-details"
163
- key={key}
164
- step={step}
165
- hasSeparator={index !== steps.length - 1}
166
- state={step.alerts ? 'error' : undefined}
167
- />
168
- );
169
- })}
170
- </div>
171
- </Content>
172
- </RouteContainer>
173
- </SummaryContainer>
174
- </>
175
- );
176
- }
@@ -1,32 +0,0 @@
1
- import type { SwapInputProps } from '../../containers/SwapInput/SwapInput.types';
2
- import type { PriceImpactProps } from '../PriceImpact/PriceImpact.types';
3
- import type { ReactNode } from 'react';
4
-
5
- type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
6
-
7
- export type Step = {
8
- swapper: SwapInputProps['chain'];
9
- from: BaseStep;
10
- to: BaseStep;
11
- error?: {
12
- title?: string;
13
- description?: string;
14
- };
15
- alerts?: ReactNode;
16
- };
17
-
18
- export type BestRouteProps = Pick<
19
- PriceImpactProps,
20
- 'percentageChange' | 'warningLevel'
21
- > & {
22
- type: 'basic' | 'list-item' | 'swap-preview';
23
- recommended: boolean;
24
- tag?: ReactNode;
25
- input: { value: string; usdValue: string };
26
- output: { value: string; usdValue?: string };
27
- steps: Step[];
28
- totalFee: string;
29
- totalTime: string;
30
- expanded?: boolean;
31
- tooltipContainer?: HTMLElement;
32
- };