@rango-dev/ui 0.1.10-next.69

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 (349) hide show
  1. package/README.md +181 -0
  2. package/dist/components/Alert/Alert.d.ts +6 -0
  3. package/dist/components/Alert/Alert.stories.d.ts +4 -0
  4. package/dist/components/Alert/index.d.ts +1 -0
  5. package/dist/components/BestRoute/BestRoute.d.ts +8 -0
  6. package/dist/components/BestRoute/BestRoute.stories.d.ts +8 -0
  7. package/dist/components/BestRoute/index.d.ts +1 -0
  8. package/dist/components/BestRoute/mock.d.ts +4 -0
  9. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +14 -0
  10. package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +4 -0
  11. package/dist/components/BlockchainSelector/index.d.ts +1 -0
  12. package/dist/components/BlockchainsList/BlockchainsList.d.ts +7 -0
  13. package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +4 -0
  14. package/dist/components/BlockchainsList/index.d.ts +1 -0
  15. package/dist/components/BlockchainsList/mockData.d.ts +2 -0
  16. package/dist/components/Button/Button.d.ts +17 -0
  17. package/dist/components/Button/Button.stories.d.ts +8 -0
  18. package/dist/components/Button/index.d.ts +1 -0
  19. package/dist/components/Checkbox/Checkbox.d.ts +11 -0
  20. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -0
  21. package/dist/components/Checkbox/index.d.ts +1 -0
  22. package/dist/components/Chip/Chip.d.ts +12 -0
  23. package/dist/components/Chip/Chip.stories.d.ts +6 -0
  24. package/dist/components/Chip/index.d.ts +1 -0
  25. package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +4 -0
  26. package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +10 -0
  27. package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
  28. package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
  29. package/dist/components/Drawer/Drawer.d.ts +12 -0
  30. package/dist/components/Drawer/Drawer.stories.d.ts +7 -0
  31. package/dist/components/Drawer/index.d.ts +1 -0
  32. package/dist/components/Icon/AddCircleIcon.d.ts +3 -0
  33. package/dist/components/Icon/AddIcon.d.ts +3 -0
  34. package/dist/components/Icon/AddWalletIcon.d.ts +3 -0
  35. package/dist/components/Icon/AngleDownIcon.d.ts +3 -0
  36. package/dist/components/Icon/AngleLeftIcon.d.ts +3 -0
  37. package/dist/components/Icon/AngleRightIcon.d.ts +3 -0
  38. package/dist/components/Icon/AngleUpIcon.d.ts +3 -0
  39. package/dist/components/Icon/BagIcon.d.ts +3 -0
  40. package/dist/components/Icon/BanIcon.d.ts +3 -0
  41. package/dist/components/Icon/CheckCircleIcon.d.ts +3 -0
  42. package/dist/components/Icon/CheckIcon.d.ts +3 -0
  43. package/dist/components/Icon/CheckSquareIcon.d.ts +3 -0
  44. package/dist/components/Icon/CheckWalletIcon.d.ts +3 -0
  45. package/dist/components/Icon/CloseIcon.d.ts +1 -0
  46. package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
  47. package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -0
  48. package/dist/components/Icon/DownloadIcon.d.ts +3 -0
  49. package/dist/components/Icon/GasIcon.d.ts +3 -0
  50. package/dist/components/Icon/HistoryIcon.d.ts +3 -0
  51. package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -0
  52. package/dist/components/Icon/Icons.stories.d.ts +5 -0
  53. package/dist/components/Icon/InfoCircleIcon.d.ts +3 -0
  54. package/dist/components/Icon/MinusCircleIcon.d.ts +3 -0
  55. package/dist/components/Icon/RetryIcon.d.ts +3 -0
  56. package/dist/components/Icon/RetryLeftIcon.d.ts +3 -0
  57. package/dist/components/Icon/RetryRightIcon.d.ts +3 -0
  58. package/dist/components/Icon/SearchIcon.d.ts +3 -0
  59. package/dist/components/Icon/SearchMinusIcon.d.ts +3 -0
  60. package/dist/components/Icon/SettingIcon.d.ts +3 -0
  61. package/dist/components/Icon/SignatureIcon.d.ts +3 -0
  62. package/dist/components/Icon/SwapWalletIcon.d.ts +3 -0
  63. package/dist/components/Icon/TimeIcon.d.ts +3 -0
  64. package/dist/components/Icon/TrashIcon.d.ts +3 -0
  65. package/dist/components/Icon/TryAgainIcon.d.ts +3 -0
  66. package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -0
  67. package/dist/components/Icon/WalletIconIcon.d.ts +3 -0
  68. package/dist/components/Icon/WarningIcon.d.ts +3 -0
  69. package/dist/components/Icon/common.d.ts +2 -0
  70. package/dist/components/Icon/index.d.ts +36 -0
  71. package/dist/components/Icon/types.d.ts +6 -0
  72. package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +4 -0
  73. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +8 -0
  74. package/dist/components/LiquiditySourceList/index.d.ts +1 -0
  75. package/dist/components/LiquiditySourceList/mockData.d.ts +2 -0
  76. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +11 -0
  77. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +4 -0
  78. package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
  79. package/dist/components/Modal/Modal.d.ts +11 -0
  80. package/dist/components/Modal/Modal.stories.d.ts +4 -0
  81. package/dist/components/Modal/index.d.ts +1 -0
  82. package/dist/components/Radio/Radio.d.ts +12 -0
  83. package/dist/components/Radio/Radio.stories.d.ts +4 -0
  84. package/dist/components/Radio/index.d.ts +1 -0
  85. package/dist/components/SecondaryPage/SecondaryPage.d.ts +18 -0
  86. package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +2 -0
  87. package/dist/components/SecondaryPage/index.d.ts +1 -0
  88. package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -0
  89. package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -0
  90. package/dist/components/SelectableWalletList/index.d.ts +1 -0
  91. package/dist/components/SelectableWalletList/mock.d.ts +2 -0
  92. package/dist/components/Settings/Settings.d.ts +19 -0
  93. package/dist/components/Settings/Settings.stories.d.ts +4 -0
  94. package/dist/components/Settings/index.d.ts +1 -0
  95. package/dist/components/Skeleton/Skeleton.d.ts +5 -0
  96. package/dist/components/Skeleton/Skeleton.stories.d.ts +4 -0
  97. package/dist/components/Skeleton/index.d.ts +1 -0
  98. package/dist/components/Spacer/Spacer.d.ts +5 -0
  99. package/dist/components/Spacer/Spacer.stories.d.ts +4 -0
  100. package/dist/components/Spacer/index.d.ts +1 -0
  101. package/dist/components/Spinner/Spinner.d.ts +5 -0
  102. package/dist/components/Spinner/Spinner.stories.d.ts +4 -0
  103. package/dist/components/Spinner/index.d.ts +1 -0
  104. package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -0
  105. package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +4 -0
  106. package/dist/components/StatusDrawer/index.d.ts +1 -0
  107. package/dist/components/StepDetail/StepDetail.d.ts +10 -0
  108. package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -0
  109. package/dist/components/StepDetail/index.d.ts +1 -0
  110. package/dist/components/SwapContainer/SwapContainer.d.ts +6 -0
  111. package/dist/components/SwapContainer/SwapContainer.stories.d.ts +5 -0
  112. package/dist/components/SwapContainer/index.d.ts +1 -0
  113. package/dist/components/SwapDetail/SwapDetail.d.ts +8 -0
  114. package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -0
  115. package/dist/components/SwapDetail/index.d.ts +1 -0
  116. package/dist/components/SwapDetail/mock.d.ts +2 -0
  117. package/dist/components/Switch/Switch.d.ts +5 -0
  118. package/dist/components/Switch/Switch.stories.d.ts +4 -0
  119. package/dist/components/Switch/index.d.ts +1 -0
  120. package/dist/components/TextField/TextField.d.ts +10 -0
  121. package/dist/components/TextField/TextField.stories.d.ts +7 -0
  122. package/dist/components/TextField/index.d.ts +1 -0
  123. package/dist/components/TokenList/TokenList.d.ts +14 -0
  124. package/dist/components/TokenList/TokenList.stories.d.ts +4 -0
  125. package/dist/components/TokenList/index.d.ts +1 -0
  126. package/dist/components/TokenList/mockData.d.ts +2 -0
  127. package/dist/components/TokenSelector/TokenSelector.d.ts +10 -0
  128. package/dist/components/TokenSelector/TokenSelector.stories.d.ts +4 -0
  129. package/dist/components/TokenSelector/index.d.ts +1 -0
  130. package/dist/components/Tooltip/Tooltip.d.ts +7 -0
  131. package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
  132. package/dist/components/Tooltip/index.d.ts +1 -0
  133. package/dist/components/Typography/Typography.d.ts +14 -0
  134. package/dist/components/Typography/Typography.stories.d.ts +5 -0
  135. package/dist/components/Typography/index.d.ts +1 -0
  136. package/dist/components/VirtualizedList/VirtualizedList.d.ts +18 -0
  137. package/dist/components/Wallet/State.d.ts +6 -0
  138. package/dist/components/Wallet/Wallet.d.ts +6 -0
  139. package/dist/components/Wallet/Wallet.stories.d.ts +4 -0
  140. package/dist/components/Wallet/index.d.ts +1 -0
  141. package/dist/components/common/FilledCircle.d.ts +1 -0
  142. package/dist/components/common/index.d.ts +1 -0
  143. package/dist/components/index.d.ts +24 -0
  144. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +23 -0
  145. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +5 -0
  146. package/dist/containers/ConfirmSwap/index.d.ts +1 -0
  147. package/dist/containers/ConfirmSwap/mock.d.ts +2 -0
  148. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +14 -0
  149. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +6 -0
  150. package/dist/containers/ConfirmWallets/index.d.ts +1 -0
  151. package/dist/containers/ConfirmWallets/mock.d.ts +5 -0
  152. package/dist/containers/ConfirmWallets/types.d.ts +8 -0
  153. package/dist/containers/History/History.d.ts +8 -0
  154. package/dist/containers/History/History.stories.d.ts +5 -0
  155. package/dist/containers/History/index.d.ts +1 -0
  156. package/dist/containers/History/mock.d.ts +2 -0
  157. package/dist/containers/History/types.d.ts +59 -0
  158. package/dist/containers/SwapHistory/SwapHistory.d.ts +7 -0
  159. package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +4 -0
  160. package/dist/containers/SwapHistory/index.d.ts +1 -0
  161. package/dist/containers/SwapHistory/mock.d.ts +2 -0
  162. package/dist/containers/index.d.ts +4 -0
  163. package/dist/helper/index.d.ts +6 -0
  164. package/dist/helper/swaps.d.ts +5 -0
  165. package/dist/helpers.d.ts +1 -0
  166. package/dist/index.d.ts +4 -0
  167. package/dist/index.js +8 -0
  168. package/dist/theme.d.ts +8 -0
  169. package/dist/types/index.d.ts +1 -0
  170. package/dist/types/meta.d.ts +22 -0
  171. package/dist/types/swaps.d.ts +22 -0
  172. package/dist/types/wallet.d.ts +14 -0
  173. package/dist/ui.cjs.development.js +4103 -0
  174. package/dist/ui.cjs.development.js.map +1 -0
  175. package/dist/ui.cjs.production.min.js +2 -0
  176. package/dist/ui.cjs.production.min.js.map +1 -0
  177. package/dist/ui.esm.js +4028 -0
  178. package/dist/ui.esm.js.map +1 -0
  179. package/package.json +89 -0
  180. package/src/components/Alert/Alert.stories.tsx +22 -0
  181. package/src/components/Alert/Alert.tsx +78 -0
  182. package/src/components/Alert/index.ts +1 -0
  183. package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
  184. package/src/components/BestRoute/BestRoute.tsx +189 -0
  185. package/src/components/BestRoute/index.ts +1 -0
  186. package/src/components/BestRoute/mock.ts +544 -0
  187. package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +25 -0
  188. package/src/components/BlockchainSelector/BlockchainSelector.tsx +93 -0
  189. package/src/components/BlockchainSelector/index.ts +1 -0
  190. package/src/components/BlockchainsList/BlockchainsList.stories.tsx +25 -0
  191. package/src/components/BlockchainsList/BlockchainsList.tsx +60 -0
  192. package/src/components/BlockchainsList/index.ts +1 -0
  193. package/src/components/BlockchainsList/mockData.ts +2972 -0
  194. package/src/components/Button/Button.stories.tsx +59 -0
  195. package/src/components/Button/Button.tsx +407 -0
  196. package/src/components/Button/index.ts +1 -0
  197. package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
  198. package/src/components/Checkbox/Checkbox.tsx +54 -0
  199. package/src/components/Checkbox/index.ts +1 -0
  200. package/src/components/Chip/Chip.stories.tsx +37 -0
  201. package/src/components/Chip/Chip.tsx +45 -0
  202. package/src/components/Chip/index.ts +1 -0
  203. package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +13 -0
  204. package/src/components/ConnectWalletsModal/ConnectWalletsModal.tsx +42 -0
  205. package/src/components/ConnectWalletsModal/index.ts +1 -0
  206. package/src/components/ConnectWalletsModal/mockData.ts +118 -0
  207. package/src/components/Drawer/Drawer.stories.tsx +86 -0
  208. package/src/components/Drawer/Drawer.tsx +128 -0
  209. package/src/components/Drawer/index.ts +1 -0
  210. package/src/components/Icon/AddCircleIcon.tsx +29 -0
  211. package/src/components/Icon/AddIcon.tsx +28 -0
  212. package/src/components/Icon/AddWalletIcon.tsx +48 -0
  213. package/src/components/Icon/AngleDownIcon.tsx +30 -0
  214. package/src/components/Icon/AngleLeftIcon.tsx +31 -0
  215. package/src/components/Icon/AngleRightIcon.tsx +30 -0
  216. package/src/components/Icon/AngleUpIcon.tsx +30 -0
  217. package/src/components/Icon/BagIcon.tsx +37 -0
  218. package/src/components/Icon/BanIcon.tsx +30 -0
  219. package/src/components/Icon/CheckCircleIcon.tsx +37 -0
  220. package/src/components/Icon/CheckIcon.tsx +28 -0
  221. package/src/components/Icon/CheckSquareIcon.tsx +35 -0
  222. package/src/components/Icon/CheckWalletIcon.tsx +43 -0
  223. package/src/components/Icon/CloseIcon.tsx +9 -0
  224. package/src/components/Icon/DeleteCircleIcon.tsx +29 -0
  225. package/src/components/Icon/DeleteWalletIcon.tsx +48 -0
  226. package/src/components/Icon/DownloadIcon.tsx +35 -0
  227. package/src/components/Icon/GasIcon.tsx +35 -0
  228. package/src/components/Icon/HistoryIcon.tsx +38 -0
  229. package/src/components/Icon/HorizontalSwapIcon.tsx +36 -0
  230. package/src/components/Icon/Icons.stories.tsx +44 -0
  231. package/src/components/Icon/InfoCircleIcon.tsx +37 -0
  232. package/src/components/Icon/MinusCircleIcon.tsx +29 -0
  233. package/src/components/Icon/RetryIcon.tsx +30 -0
  234. package/src/components/Icon/RetryLeftIcon.tsx +29 -0
  235. package/src/components/Icon/RetryRightIcon.tsx +29 -0
  236. package/src/components/Icon/SearchIcon.tsx +29 -0
  237. package/src/components/Icon/SearchMinusIcon.tsx +29 -0
  238. package/src/components/Icon/SettingIcon.tsx +37 -0
  239. package/src/components/Icon/SignatureIcon.tsx +30 -0
  240. package/src/components/Icon/SwapWalletIcon.tsx +48 -0
  241. package/src/components/Icon/TimeIcon.tsx +29 -0
  242. package/src/components/Icon/TrashIcon.tsx +29 -0
  243. package/src/components/Icon/TryAgainIcon.tsx +29 -0
  244. package/src/components/Icon/VerticalSwapIcon.tsx +36 -0
  245. package/src/components/Icon/WalletIconIcon.tsx +38 -0
  246. package/src/components/Icon/WarningIcon.tsx +35 -0
  247. package/src/components/Icon/common.ts +69 -0
  248. package/src/components/Icon/index.ts +44 -0
  249. package/src/components/Icon/types.tsx +44 -0
  250. package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
  251. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +114 -0
  252. package/src/components/LiquiditySourceList/index.ts +1 -0
  253. package/src/components/LiquiditySourceList/mockData.ts +316 -0
  254. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +16 -0
  255. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +55 -0
  256. package/src/components/LiquiditySourcesSelector/index.ts +1 -0
  257. package/src/components/Modal/Modal.stories.tsx +22 -0
  258. package/src/components/Modal/Modal.tsx +76 -0
  259. package/src/components/Modal/index.ts +1 -0
  260. package/src/components/Radio/Radio.stories.tsx +23 -0
  261. package/src/components/Radio/Radio.tsx +95 -0
  262. package/src/components/Radio/index.ts +1 -0
  263. package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
  264. package/src/components/SecondaryPage/SecondaryPage.tsx +95 -0
  265. package/src/components/SecondaryPage/index.ts +1 -0
  266. package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
  267. package/src/components/SelectableWalletList/SelectableWalletList.tsx +113 -0
  268. package/src/components/SelectableWalletList/index.ts +1 -0
  269. package/src/components/SelectableWalletList/mock.ts +12 -0
  270. package/src/components/Settings/Settings.stories.tsx +34 -0
  271. package/src/components/Settings/Settings.tsx +160 -0
  272. package/src/components/Settings/index.ts +1 -0
  273. package/src/components/Skeleton/Skeleton.stories.tsx +24 -0
  274. package/src/components/Skeleton/Skeleton.tsx +66 -0
  275. package/src/components/Skeleton/index.ts +1 -0
  276. package/src/components/Spacer/Spacer.stories.tsx +18 -0
  277. package/src/components/Spacer/Spacer.tsx +98 -0
  278. package/src/components/Spacer/index.ts +1 -0
  279. package/src/components/Spinner/Spinner.stories.tsx +25 -0
  280. package/src/components/Spinner/Spinner.tsx +61 -0
  281. package/src/components/Spinner/index.ts +1 -0
  282. package/src/components/StatusDrawer/StatusDrawer.stories.tsx +38 -0
  283. package/src/components/StatusDrawer/StatusDrawer.tsx +81 -0
  284. package/src/components/StatusDrawer/index.ts +1 -0
  285. package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
  286. package/src/components/StepDetail/StepDetail.tsx +97 -0
  287. package/src/components/StepDetail/index.ts +1 -0
  288. package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
  289. package/src/components/SwapContainer/SwapContainer.tsx +35 -0
  290. package/src/components/SwapContainer/index.ts +1 -0
  291. package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
  292. package/src/components/SwapDetail/SwapDetail.tsx +150 -0
  293. package/src/components/SwapDetail/index.ts +1 -0
  294. package/src/components/SwapDetail/mock.ts +275 -0
  295. package/src/components/Switch/Switch.stories.tsx +9 -0
  296. package/src/components/Switch/Switch.tsx +52 -0
  297. package/src/components/Switch/index.ts +1 -0
  298. package/src/components/TextField/TextField.stories.tsx +31 -0
  299. package/src/components/TextField/TextField.tsx +129 -0
  300. package/src/components/TextField/index.ts +1 -0
  301. package/src/components/TokenList/TokenList.stories.tsx +18 -0
  302. package/src/components/TokenList/TokenList.tsx +180 -0
  303. package/src/components/TokenList/index.ts +1 -0
  304. package/src/components/TokenList/mockData.ts +1721 -0
  305. package/src/components/TokenSelector/TokenSelector.stories.tsx +18 -0
  306. package/src/components/TokenSelector/TokenSelector.tsx +35 -0
  307. package/src/components/TokenSelector/index.ts +1 -0
  308. package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
  309. package/src/components/Tooltip/Tooltip.tsx +110 -0
  310. package/src/components/Tooltip/index.ts +1 -0
  311. package/src/components/Typography/Typography.stories.tsx +68 -0
  312. package/src/components/Typography/Typography.tsx +199 -0
  313. package/src/components/Typography/index.ts +1 -0
  314. package/src/components/VirtualizedList/VirtualizedList.tsx +78 -0
  315. package/src/components/Wallet/State.tsx +36 -0
  316. package/src/components/Wallet/Wallet.stories.tsx +36 -0
  317. package/src/components/Wallet/Wallet.tsx +42 -0
  318. package/src/components/Wallet/index.ts +1 -0
  319. package/src/components/common/FilledCircle.tsx +8 -0
  320. package/src/components/common/index.ts +1 -0
  321. package/src/components/index.ts +24 -0
  322. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +13 -0
  323. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +154 -0
  324. package/src/containers/ConfirmSwap/index.ts +1 -0
  325. package/src/containers/ConfirmSwap/mock.ts +146 -0
  326. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +26 -0
  327. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +98 -0
  328. package/src/containers/ConfirmWallets/index.ts +1 -0
  329. package/src/containers/ConfirmWallets/mock.ts +222 -0
  330. package/src/containers/ConfirmWallets/types.ts +9 -0
  331. package/src/containers/History/History.stories.tsx +14 -0
  332. package/src/containers/History/History.tsx +93 -0
  333. package/src/containers/History/index.ts +1 -0
  334. package/src/containers/History/mock.ts +825 -0
  335. package/src/containers/History/types.tsx +66 -0
  336. package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
  337. package/src/containers/SwapHistory/SwapHistory.tsx +165 -0
  338. package/src/containers/SwapHistory/index.ts +1 -0
  339. package/src/containers/SwapHistory/mock.ts +275 -0
  340. package/src/containers/index.ts +4 -0
  341. package/src/helper/index.ts +23 -0
  342. package/src/helper/swaps.ts +23 -0
  343. package/src/helpers.ts +2 -0
  344. package/src/index.ts +4 -0
  345. package/src/theme.ts +161 -0
  346. package/src/types/index.ts +1 -0
  347. package/src/types/meta.ts +20 -0
  348. package/src/types/swaps.tsx +36 -0
  349. package/src/types/wallet.ts +20 -0
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+ import { TokenSelector, PropTypes } from './TokenSelector';
4
+ import { tokensMeta } from '../TokenList/mockData';
5
+
6
+ export default {
7
+ title: 'Token Selector',
8
+ component: TokenSelector,
9
+ argTypes: {
10
+ type: {
11
+ defaultValue: 'Source',
12
+ },
13
+ },
14
+ } as ComponentMeta<typeof TokenSelector>;
15
+
16
+ export const Main = (args: PropTypes) => (
17
+ <TokenSelector {...args} list={tokensMeta} selected={tokensMeta[0]} />
18
+ );
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
3
+ import { TokenList } from '../TokenList';
4
+ import { TokenWithAmount } from '../TokenList/TokenList';
5
+
6
+ export interface PropTypes {
7
+ list: TokenWithAmount[];
8
+ type?: 'Source' | 'Destination';
9
+ selected: TokenWithAmount | null;
10
+ onChange: (token: TokenWithAmount) => void;
11
+ onBack?: () => void;
12
+ hasHeader?: boolean;
13
+ }
14
+
15
+ export function TokenSelector(props: PropTypes) {
16
+ const { list, type, selected, onChange, onBack, hasHeader } = props;
17
+
18
+ return (
19
+ <SecondaryPage
20
+ textField={true}
21
+ textFieldPlaceholder="Search Blockchain By Name"
22
+ title={`Select ${type} Token`}
23
+ hasHeader={hasHeader}
24
+ onBack={onBack}
25
+ Content={({ searchedFor }) => (
26
+ <TokenList
27
+ searchedText={searchedFor}
28
+ list={list}
29
+ selected={selected}
30
+ onChange={onChange}
31
+ />
32
+ )}
33
+ />
34
+ );
35
+ }
@@ -0,0 +1 @@
1
+ export { TokenSelector } from './TokenSelector';
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+
4
+ import { Tooltip, PropTypes } from './Tooltip';
5
+ import { AddWalletIcon } from '../Icon';
6
+
7
+ export default {
8
+ title: 'Components/Tooltip',
9
+ component: Tooltip,
10
+ argTypes: {
11
+ content: {
12
+ name: 'content',
13
+ control: { type: 'text' },
14
+ defaultValue: 'I am a tooltip',
15
+ },
16
+ side: {
17
+ name: 'side',
18
+ control: { type: 'select' },
19
+ options: ['top', 'right', 'bottom', 'left'],
20
+ defaultValue: 'top',
21
+ },
22
+ color: {
23
+ name: 'color',
24
+ control: { type: 'select' },
25
+ options: [
26
+ 'primary',
27
+ 'error',
28
+ 'warning',
29
+ 'success',
30
+ 'black',
31
+ 'white',
32
+ 'gray',
33
+ ],
34
+ defaultValue: 'gray',
35
+ },
36
+ },
37
+ } as ComponentMeta<typeof Tooltip>;
38
+
39
+ export const Main = (props: PropTypes) => (
40
+ <div
41
+ style={{
42
+ height: 300,
43
+ display: 'flex',
44
+ justifyContent: 'center',
45
+ alignItems: 'center',
46
+ }}
47
+ >
48
+ <Tooltip {...props}>
49
+ <AddWalletIcon size={24} />
50
+ </Tooltip>
51
+ </div>
52
+ );
@@ -0,0 +1,110 @@
1
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
2
+ import { styled } from '../../theme';
3
+ import React, { PropsWithChildren } from 'react';
4
+
5
+ export interface PropTypes {
6
+ content: string;
7
+ side?: 'top' | 'right' | 'bottom' | 'left';
8
+ color?:
9
+ | 'primary'
10
+ | 'error'
11
+ | 'warning'
12
+ | 'success'
13
+ | 'gray'
14
+ | 'white'
15
+ | 'black';
16
+ }
17
+ const TooltipTrigger = styled(RadixTooltip.Trigger, {
18
+ border: 0,
19
+ padding: 0,
20
+
21
+ backgroundColor: 'transparent',
22
+ });
23
+ const TooltipContent = styled(RadixTooltip.Content, {
24
+ borderRadius: '$5',
25
+ padding: '$4 $8',
26
+ fontSize: '$14',
27
+ animationDuration: '400ms',
28
+ animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',
29
+ willChange: 'transform, opacity',
30
+ variants: {
31
+ color: {
32
+ primary: {
33
+ backgroundColor: '$primary',
34
+ color: '$white',
35
+ },
36
+ error: {
37
+ backgroundColor: '$error',
38
+ color: '$white',
39
+ },
40
+ warning: {
41
+ backgroundColor: '$warning',
42
+ color: '$white',
43
+ },
44
+ success: {
45
+ backgroundColor: '$success',
46
+ color: '$white',
47
+ },
48
+ gray: {
49
+ backgroundColor: '$neutrals300',
50
+ color: '$black',
51
+ },
52
+ black: {
53
+ backgroundColor: '$black',
54
+ color: '$white',
55
+ },
56
+ white: {
57
+ backgroundColor: '$white',
58
+ color: '$black',
59
+ },
60
+ },
61
+ },
62
+ });
63
+ const TooltipArrow = styled(RadixTooltip.Arrow, {
64
+ variants: {
65
+ color: {
66
+ primary: {
67
+ fill: '$primary',
68
+ },
69
+ error: {
70
+ fill: '$error',
71
+ },
72
+ warning: {
73
+ fill: '$warning',
74
+ },
75
+ success: {
76
+ fill: '$success',
77
+ },
78
+ gray: {
79
+ fill: '$neutrals300',
80
+ },
81
+ black: {
82
+ fill: '$black',
83
+ },
84
+ white: {
85
+ fill: '$white',
86
+ },
87
+ },
88
+ },
89
+ });
90
+
91
+ export function Tooltip({
92
+ children,
93
+ content,
94
+ side = 'top',
95
+ color = 'gray',
96
+ }: PropsWithChildren<PropTypes>) {
97
+ return (
98
+ <RadixTooltip.Provider>
99
+ <RadixTooltip.Root>
100
+ <TooltipTrigger>{children}</TooltipTrigger>
101
+ <RadixTooltip.Portal>
102
+ <TooltipContent color={color} side={side} sideOffset={5}>
103
+ {content}
104
+ <TooltipArrow color={color} />
105
+ </TooltipContent>
106
+ </RadixTooltip.Portal>
107
+ </RadixTooltip.Root>
108
+ </RadixTooltip.Provider>
109
+ );
110
+ }
@@ -0,0 +1 @@
1
+ export { Tooltip } from './Tooltip';
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+
4
+ import { Typography, PropTypes } from './Typography';
5
+
6
+ export default {
7
+ title: 'Components/Typography',
8
+ component: Typography,
9
+ argTypes: {
10
+ variant: {
11
+ name: 'variant',
12
+ control: { type: 'select' },
13
+ options: [
14
+ 'body1',
15
+ 'body2',
16
+ 'h1',
17
+ 'h2',
18
+ 'h3',
19
+ 'h4',
20
+ 'h5',
21
+ 'h6',
22
+ 'caption',
23
+ ],
24
+ defaultValue: 'h1',
25
+ },
26
+ align: {
27
+ name: 'align',
28
+ control: { type: 'select' },
29
+ options: ['center', 'left', 'right'],
30
+ },
31
+ noWrap: {
32
+ name: 'noWrap',
33
+ control: { type: 'boolean' },
34
+ },
35
+ },
36
+ } as ComponentMeta<typeof Typography>;
37
+
38
+ export const Main = (props: PropTypes) => (
39
+ <div>
40
+ <Typography {...props} variant="h1">
41
+ Heading 1
42
+ </Typography>
43
+ <Typography {...props} variant="h2">
44
+ Heading 2
45
+ </Typography>
46
+ <Typography {...props} variant="h3">
47
+ Heading 3
48
+ </Typography>
49
+ <Typography {...props} variant="h4">
50
+ Heading 4
51
+ </Typography>
52
+ <Typography {...props} variant="h5">
53
+ Heading 5
54
+ </Typography>
55
+ <Typography {...props} variant="h6">
56
+ Heading 6
57
+ </Typography>
58
+ <Typography {...props} variant="body1">
59
+ Body 1
60
+ </Typography>
61
+ <Typography {...props} variant="body2">
62
+ Body 2
63
+ </Typography>
64
+ <Typography {...props} variant="caption">
65
+ Caption
66
+ </Typography>
67
+ </div>
68
+ );
@@ -0,0 +1,199 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { styled } from '../../theme';
3
+
4
+ const TypographyContainer = styled('span', {
5
+ margin: 0,
6
+ color: '$foreground',
7
+ variants: {
8
+ variant: {
9
+ h1: {
10
+ fontSize: '$36',
11
+ fontWeight: '$700',
12
+ '@md': {
13
+ fontSize: '$40',
14
+ },
15
+ '@lg': {
16
+ fontSize: '$48',
17
+ },
18
+ },
19
+ h2: {
20
+ fontSize: '$32',
21
+ fontWeight: '$700',
22
+ '@md': {
23
+ fontSize: '$36',
24
+ },
25
+ '@lg': {
26
+ fontSize: '$40',
27
+ },
28
+ },
29
+ h3: {
30
+ fontSize: '$20',
31
+ fontWeight: '$700',
32
+ '@md': {
33
+ fontSize: '$24',
34
+ },
35
+ '@lg': {
36
+ fontSize: '$32',
37
+ },
38
+ },
39
+ h4: {
40
+ fontSize: '$18',
41
+ fontWeight: '$600',
42
+ '@md': {
43
+ fontSize: '$20',
44
+ },
45
+ '@lg': {
46
+ fontSize: '$24',
47
+ },
48
+ },
49
+ h5: {
50
+ fontSize: '$16',
51
+ fontWeight: '$600',
52
+ '@md': {
53
+ fontSize: '$18',
54
+ },
55
+ '@lg': {
56
+ fontSize: '$20',
57
+ },
58
+ },
59
+ h6: {
60
+ fontSize: '$14',
61
+ fontWeight: '$500',
62
+ '@md': {
63
+ fontSize: '$16',
64
+ },
65
+ '@lg': {
66
+ fontSize: '$18',
67
+ },
68
+ },
69
+ body1: {
70
+ fontSize: '$14',
71
+ fontWeight: '$400',
72
+ '@md': {
73
+ fontSize: '$16',
74
+ },
75
+ '@lg': {
76
+ fontSize: '$18',
77
+ },
78
+ },
79
+ body2: {
80
+ fontSize: '$14',
81
+ fontWeight: '$400',
82
+ '@lg': {
83
+ fontSize: '$16',
84
+ },
85
+ },
86
+ caption: {
87
+ fontSize: '$10',
88
+ fontWeight: '$400',
89
+ '@lg': {
90
+ fontSize: '$12',
91
+ },
92
+ },
93
+ },
94
+ align: {
95
+ center: {
96
+ textAlign: 'center',
97
+ },
98
+ left: {
99
+ textAlign: 'left',
100
+ },
101
+ right: {
102
+ textAlign: 'right',
103
+ },
104
+ },
105
+ noWrap: {
106
+ true: {
107
+ whiteSpace: 'nowrap',
108
+ },
109
+ },
110
+ ml: {
111
+ 2: {
112
+ marginLeft: '$2',
113
+ },
114
+ 4: {
115
+ marginLeft: '$4',
116
+ },
117
+ 8: {
118
+ marginLeft: '$8',
119
+ },
120
+ 12: {
121
+ marginLeft: '$12',
122
+ },
123
+ },
124
+ mt: {
125
+ 2: {
126
+ marginTop: '$2',
127
+ },
128
+ 4: {
129
+ marginTop: '$4',
130
+ },
131
+ 8: {
132
+ marginTop: '$8',
133
+ },
134
+ 12: {
135
+ marginTop: '$12',
136
+ },
137
+ },
138
+ mr: {
139
+ 2: {
140
+ marginRight: '$2',
141
+ },
142
+ 4: {
143
+ marginRight: '$4',
144
+ },
145
+ 8: {
146
+ marginRight: '$8',
147
+ },
148
+ 12: {
149
+ marginRight: '$12',
150
+ },
151
+ },
152
+ mb: {
153
+ 2: {
154
+ marginBottom: '$2',
155
+ },
156
+ 4: {
157
+ marginBottom: '$4',
158
+ },
159
+ 8: {
160
+ marginBottom: '$8',
161
+ },
162
+ 12: {
163
+ marginBottom: '$12',
164
+ },
165
+ },
166
+ },
167
+ });
168
+
169
+ export interface PropTypes {
170
+ variant:
171
+ | 'h1'
172
+ | 'h2'
173
+ | 'h3'
174
+ | 'h4'
175
+ | 'h5'
176
+ | 'h6'
177
+ | 'body1'
178
+ | 'body2'
179
+ | 'caption';
180
+ align?: 'center' | 'left' | 'right';
181
+ noWrap?: boolean;
182
+ mt?: 2 | 4 | 8 | 12;
183
+ mb?: 2 | 4 | 8 | 12;
184
+ ml?: 2 | 4 | 8 | 12;
185
+ mr?: 2 | 4 | 8 | 12;
186
+ }
187
+
188
+ export function Typography({
189
+ children,
190
+ ...props
191
+ }: PropsWithChildren<PropTypes>) {
192
+ return (
193
+ <TypographyContainer className="_typography" {...props}>
194
+ {children}
195
+ </TypographyContainer>
196
+ );
197
+ }
198
+
199
+ Typography.toString = () => '._typography';
@@ -0,0 +1 @@
1
+ export { Typography } from './Typography';
@@ -0,0 +1,78 @@
1
+ import React, { PropsWithChildren, useRef } from 'react';
2
+ import { ReactElementType, VariableSizeList as List } from 'react-window';
3
+ import InfiniteLoader from 'react-window-infinite-loader';
4
+ import AutoSizer from 'react-virtualized-auto-sizer';
5
+ import { CSSProperties } from '@stitches/react';
6
+
7
+ export type VirtualizedListItem = ({
8
+ index,
9
+ style,
10
+ }: {
11
+ index: number;
12
+ style: CSSProperties | undefined;
13
+ }) => JSX.Element | null;
14
+
15
+ type PropTypes = {
16
+ itemCount: number;
17
+ hasNextPage: boolean;
18
+ isNextPageLoading: boolean;
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ loadNextPage: () => void;
21
+ Item: VirtualizedListItem;
22
+ innerElementType: ReactElementType | undefined;
23
+ size: number;
24
+ };
25
+
26
+ export function VirtualizedList(props: PropsWithChildren<PropTypes>) {
27
+ const {
28
+ itemCount,
29
+ hasNextPage,
30
+ isNextPageLoading,
31
+ loadNextPage,
32
+ Item,
33
+ innerElementType,
34
+ size,
35
+ } = props;
36
+ const listRef = useRef<any>(null);
37
+
38
+ const isItemLoaded = (index: number) => !hasNextPage || index < itemCount;
39
+
40
+ return (
41
+ <InfiniteLoader
42
+ isItemLoaded={isItemLoaded}
43
+ itemCount={hasNextPage ? itemCount + 1 : itemCount}
44
+ loadMoreItems={
45
+ isNextPageLoading
46
+ ? () => {
47
+ // do nothing
48
+ }
49
+ : loadNextPage
50
+ }
51
+ threshold={1}
52
+ >
53
+ {({ onItemsRendered }) => {
54
+ return (
55
+ <AutoSizer>
56
+ {({ width, height }) => (
57
+ <List
58
+ innerElementType={innerElementType}
59
+ ref={listRef}
60
+ itemSize={() => size}
61
+ itemCount={itemCount}
62
+ height={height}
63
+ width={width}
64
+ onItemsRendered={onItemsRendered}
65
+ >
66
+ {({ index, style }) =>
67
+ isItemLoaded(index) ? (
68
+ <Item index={index} style={style as CSSProperties} />
69
+ ) : null
70
+ }
71
+ </List>
72
+ )}
73
+ </AutoSizer>
74
+ );
75
+ }}
76
+ </InfiniteLoader>
77
+ );
78
+ }
@@ -0,0 +1,36 @@
1
+ import React, { Fragment } from 'react';
2
+ import { styled } from '../../theme';
3
+ import { FilledCircle } from '../common';
4
+ import { DownloadIcon } from '../Icon';
5
+ import { Spinner } from '../Spinner';
6
+ import { WalletState } from '../../types/wallet';
7
+ import { InstallObjects, detectInstallLink } from '@rango-dev/wallets-shared';
8
+
9
+ const StateIconContainer = styled('span', {
10
+ width: '$28',
11
+ display: 'flex',
12
+ justifyContent: 'center',
13
+ alignItems: 'center',
14
+ });
15
+
16
+ export const State = ({
17
+ walletState,
18
+ installLink,
19
+ }: {
20
+ walletState: WalletState;
21
+ installLink: InstallObjects | string;
22
+ }) => (
23
+ <Fragment>
24
+ {walletState !== WalletState.DISCONNECTED && (
25
+ <StateIconContainer>
26
+ {walletState === WalletState.NOT_INSTALLED && (
27
+ <a href={detectInstallLink(installLink)} target="_blank">
28
+ <DownloadIcon size={24} color="success" />
29
+ </a>
30
+ )}
31
+ {walletState === WalletState.CONNECTING && <Spinner />}
32
+ {walletState === WalletState.CONNECTED && <FilledCircle />}
33
+ </StateIconContainer>
34
+ )}
35
+ </Fragment>
36
+ );
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+
4
+ import { PropTypes, Wallet } from './Wallet';
5
+ import { WalletState } from '../../types/wallet';
6
+
7
+ export default {
8
+ title: 'Wallet chip',
9
+ component: Wallet,
10
+ argTypes: {
11
+ title: {
12
+ name: 'title',
13
+ type: 'string',
14
+ defaultValue: 'Coinbase',
15
+ },
16
+ image: {
17
+ name: 'image',
18
+ type: 'string',
19
+ defaultValue: 'https://app.rango.exchange/wallets/coinbase.svg',
20
+ },
21
+ disabled: {
22
+ name: 'disabled',
23
+ type: 'boolean',
24
+ defaultValue: false,
25
+ },
26
+ state: {
27
+ name: 'wallet state',
28
+ control: {
29
+ type: 'select',
30
+ },
31
+ options: Object.values(WalletState),
32
+ },
33
+ },
34
+ } as ComponentMeta<typeof Wallet>;
35
+
36
+ export const Main = (args: PropTypes) => <Wallet {...args}></Wallet>;
@@ -0,0 +1,42 @@
1
+ import { detectInstallLink, WalletType } from '@rango-dev/wallets-shared';
2
+ import React from 'react';
3
+
4
+ import { styled } from '../../theme';
5
+ import { WalletInfo, WalletState } from '../../types/wallet';
6
+ import { Button } from '../Button/Button';
7
+ import { Typography } from '../Typography';
8
+ import { State } from './State';
9
+
10
+ const WalletImage = styled('img', {
11
+ width: '$24',
12
+ height: '$24',
13
+ marginRight: '$12',
14
+ });
15
+
16
+ export type PropTypes = WalletInfo & {
17
+ onClick: (walletType: WalletType) => void;
18
+ };
19
+
20
+ export function Wallet(props: PropTypes) {
21
+ const { name, type, image, state, onClick, installLink } = props;
22
+ return (
23
+ <Button
24
+ type={state === WalletState.CONNECTED ? 'primary' : undefined}
25
+ disabled={!state}
26
+ onClick={() => {
27
+ if (state === WalletState.NOT_INSTALLED) {
28
+ window.open(detectInstallLink(installLink), '_blank');
29
+ } else onClick(type);
30
+ }}
31
+ align="start"
32
+ variant="outlined"
33
+ size="large"
34
+ prefix={<WalletImage src={image} />}
35
+ suffix={<State walletState={state} installLink={installLink} />}
36
+ >
37
+ <Typography variant="h5" noWrap={false}>
38
+ {name}
39
+ </Typography>
40
+ </Button>
41
+ );
42
+ }
@@ -0,0 +1 @@
1
+ export * from './Wallet';
@@ -0,0 +1,8 @@
1
+ import { styled } from '../../theme';
2
+
3
+ export const FilledCircle = styled('span', {
4
+ width: '10px',
5
+ height: '10px',
6
+ backgroundColor: '$primary500',
7
+ borderRadius: '99999px',
8
+ });
@@ -0,0 +1 @@
1
+ export { FilledCircle } from './FilledCircle';