@rango-dev/ui 0.1.10-next.102

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 (367) hide show
  1. package/README.md +181 -0
  2. package/dist/components/Alert/Alert.d.ts +7 -0
  3. package/dist/components/Alert/Alert.stories.d.ts +5 -0
  4. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  5. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  6. package/dist/components/Alert/index.d.ts +2 -0
  7. package/dist/components/BestRoute/BestRoute.d.ts +12 -0
  8. package/dist/components/BestRoute/BestRoute.stories.d.ts +8 -0
  9. package/dist/components/BestRoute/index.d.ts +1 -0
  10. package/dist/components/BestRoute/mock.d.ts +4 -0
  11. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +17 -0
  12. package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -0
  13. package/dist/components/BlockchainSelector/index.d.ts +1 -0
  14. package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -0
  15. package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +5 -0
  16. package/dist/components/BlockchainsList/index.d.ts +1 -0
  17. package/dist/components/BlockchainsList/mockData.d.ts +2 -0
  18. package/dist/components/Button/Button.d.ts +17 -0
  19. package/dist/components/Button/Button.stories.d.ts +8 -0
  20. package/dist/components/Button/index.d.ts +1 -0
  21. package/dist/components/Checkbox/Checkbox.d.ts +11 -0
  22. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -0
  23. package/dist/components/Checkbox/index.d.ts +1 -0
  24. package/dist/components/Chip/Chip.d.ts +12 -0
  25. package/dist/components/Chip/Chip.stories.d.ts +7 -0
  26. package/dist/components/Chip/index.d.ts +1 -0
  27. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -0
  28. package/dist/components/ColorPicker/ColorPicker.stories.d.ts +5 -0
  29. package/dist/components/ColorPicker/index.d.ts +1 -0
  30. package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -0
  31. package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +11 -0
  32. package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
  33. package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
  34. package/dist/components/Divider/Divider.d.ts +6 -0
  35. package/dist/components/Divider/index.d.ts +1 -0
  36. package/dist/components/Drawer/Drawer.d.ts +13 -0
  37. package/dist/components/Drawer/Drawer.stories.d.ts +8 -0
  38. package/dist/components/Drawer/index.d.ts +1 -0
  39. package/dist/components/Header/Header.d.ts +9 -0
  40. package/dist/components/Header/index.d.ts +1 -0
  41. package/dist/components/Icon/AddCircleIcon.d.ts +3 -0
  42. package/dist/components/Icon/AddIcon.d.ts +3 -0
  43. package/dist/components/Icon/AddWalletIcon.d.ts +3 -0
  44. package/dist/components/Icon/AngleDownIcon.d.ts +3 -0
  45. package/dist/components/Icon/AngleLeftIcon.d.ts +3 -0
  46. package/dist/components/Icon/AngleRightIcon.d.ts +3 -0
  47. package/dist/components/Icon/AngleUpIcon.d.ts +3 -0
  48. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  49. package/dist/components/Icon/BagIcon.d.ts +3 -0
  50. package/dist/components/Icon/BanIcon.d.ts +3 -0
  51. package/dist/components/Icon/CheckCircleIcon.d.ts +3 -0
  52. package/dist/components/Icon/CheckIcon.d.ts +3 -0
  53. package/dist/components/Icon/CheckSquareIcon.d.ts +3 -0
  54. package/dist/components/Icon/CheckWalletIcon.d.ts +3 -0
  55. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
  56. package/dist/components/Icon/CloseIcon.d.ts +1 -0
  57. package/dist/components/Icon/CopyIcon.d.ts +3 -0
  58. package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
  59. package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -0
  60. package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
  61. package/dist/components/Icon/DownloadIcon.d.ts +3 -0
  62. package/dist/components/Icon/GasIcon.d.ts +3 -0
  63. package/dist/components/Icon/HistoryIcon.d.ts +3 -0
  64. package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -0
  65. package/dist/components/Icon/Icons.stories.d.ts +5 -0
  66. package/dist/components/Icon/InfoCircleIcon.d.ts +3 -0
  67. package/dist/components/Icon/MinusCircleIcon.d.ts +3 -0
  68. package/dist/components/Icon/RetryIcon.d.ts +3 -0
  69. package/dist/components/Icon/RetryLeftIcon.d.ts +3 -0
  70. package/dist/components/Icon/RetryRightIcon.d.ts +3 -0
  71. package/dist/components/Icon/SearchIcon.d.ts +3 -0
  72. package/dist/components/Icon/SearchMinusIcon.d.ts +3 -0
  73. package/dist/components/Icon/SettingIcon.d.ts +3 -0
  74. package/dist/components/Icon/SignatureIcon.d.ts +3 -0
  75. package/dist/components/Icon/SwapWalletIcon.d.ts +3 -0
  76. package/dist/components/Icon/TimeIcon.d.ts +3 -0
  77. package/dist/components/Icon/TrashIcon.d.ts +3 -0
  78. package/dist/components/Icon/TryAgainIcon.d.ts +3 -0
  79. package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -0
  80. package/dist/components/Icon/WalletIconIcon.d.ts +3 -0
  81. package/dist/components/Icon/WarningIcon.d.ts +3 -0
  82. package/dist/components/Icon/common.d.ts +2 -0
  83. package/dist/components/Icon/index.d.ts +40 -0
  84. package/dist/components/Icon/types.d.ts +6 -0
  85. package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +5 -0
  86. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -0
  87. package/dist/components/LiquiditySourceList/index.d.ts +1 -0
  88. package/dist/components/LiquiditySourceList/mockData.d.ts +2 -0
  89. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -0
  90. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -0
  91. package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
  92. package/dist/components/Modal/Modal.d.ts +12 -0
  93. package/dist/components/Modal/Modal.stories.d.ts +5 -0
  94. package/dist/components/Modal/index.d.ts +1 -0
  95. package/dist/components/Radio/Radio.d.ts +13 -0
  96. package/dist/components/Radio/Radio.stories.d.ts +5 -0
  97. package/dist/components/Radio/index.d.ts +1 -0
  98. package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -0
  99. package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +2 -0
  100. package/dist/components/SecondaryPage/index.d.ts +1 -0
  101. package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -0
  102. package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -0
  103. package/dist/components/SelectableWalletList/index.d.ts +1 -0
  104. package/dist/components/SelectableWalletList/mock.d.ts +2 -0
  105. package/dist/components/Settings/Settings.d.ts +23 -0
  106. package/dist/components/Settings/Settings.stories.d.ts +5 -0
  107. package/dist/components/Settings/index.d.ts +1 -0
  108. package/dist/components/Skeleton/Skeleton.d.ts +6 -0
  109. package/dist/components/Skeleton/Skeleton.stories.d.ts +5 -0
  110. package/dist/components/Skeleton/index.d.ts +1 -0
  111. package/dist/components/Spacer/Spacer.d.ts +6 -0
  112. package/dist/components/Spacer/Spacer.stories.d.ts +5 -0
  113. package/dist/components/Spacer/index.d.ts +1 -0
  114. package/dist/components/Spinner/Spinner.d.ts +6 -0
  115. package/dist/components/Spinner/Spinner.stories.d.ts +5 -0
  116. package/dist/components/Spinner/index.d.ts +1 -0
  117. package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -0
  118. package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +5 -0
  119. package/dist/components/StatusDrawer/index.d.ts +1 -0
  120. package/dist/components/StepDetail/StepDetail.d.ts +10 -0
  121. package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -0
  122. package/dist/components/StepDetail/index.d.ts +1 -0
  123. package/dist/components/SwapContainer/SwapContainer.d.ts +7 -0
  124. package/dist/components/SwapContainer/SwapContainer.stories.d.ts +5 -0
  125. package/dist/components/SwapContainer/index.d.ts +1 -0
  126. package/dist/components/SwapDetail/SwapDetail.d.ts +8 -0
  127. package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -0
  128. package/dist/components/SwapDetail/Token.d.ts +16 -0
  129. package/dist/components/SwapDetail/index.d.ts +1 -0
  130. package/dist/components/SwapDetail/mock.d.ts +2 -0
  131. package/dist/components/Switch/Switch.d.ts +6 -0
  132. package/dist/components/Switch/Switch.stories.d.ts +5 -0
  133. package/dist/components/Switch/index.d.ts +1 -0
  134. package/dist/components/TextField/TextField.d.ts +10 -0
  135. package/dist/components/TextField/TextField.stories.d.ts +7 -0
  136. package/dist/components/TextField/index.d.ts +1 -0
  137. package/dist/components/TokenList/TokenItem.d.ts +11 -0
  138. package/dist/components/TokenList/TokenList.d.ts +17 -0
  139. package/dist/components/TokenList/TokenList.stories.d.ts +5 -0
  140. package/dist/components/TokenList/index.d.ts +1 -0
  141. package/dist/components/TokenList/mockData.d.ts +2 -0
  142. package/dist/components/TokenSelector/TokenSelector.d.ts +16 -0
  143. package/dist/components/TokenSelector/TokenSelector.stories.d.ts +5 -0
  144. package/dist/components/TokenSelector/index.d.ts +1 -0
  145. package/dist/components/Tooltip/Tooltip.d.ts +7 -0
  146. package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
  147. package/dist/components/Tooltip/index.d.ts +1 -0
  148. package/dist/components/Typography/Typography.d.ts +18 -0
  149. package/dist/components/Typography/Typography.stories.d.ts +5 -0
  150. package/dist/components/Typography/index.d.ts +1 -0
  151. package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -0
  152. package/dist/components/Wallet/State.d.ts +7 -0
  153. package/dist/components/Wallet/Wallet.d.ts +7 -0
  154. package/dist/components/Wallet/Wallet.stories.d.ts +5 -0
  155. package/dist/components/Wallet/index.d.ts +1 -0
  156. package/dist/components/common/FilledCircle.d.ts +1 -0
  157. package/dist/components/common/index.d.ts +1 -0
  158. package/dist/components/index.d.ts +31 -0
  159. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +20 -0
  160. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +6 -0
  161. package/dist/containers/ConfirmSwap/index.d.ts +1 -0
  162. package/dist/containers/ConfirmSwap/mock.d.ts +5 -0
  163. package/dist/containers/History/History.d.ts +13 -0
  164. package/dist/containers/History/History.stories.d.ts +5 -0
  165. package/dist/containers/History/index.d.ts +1 -0
  166. package/dist/containers/History/mock.d.ts +2 -0
  167. package/dist/containers/History/types.d.ts +39 -0
  168. package/dist/containers/SwapHistory/SwapHistory.d.ts +24 -0
  169. package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +5 -0
  170. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  171. package/dist/containers/SwapHistory/index.d.ts +1 -0
  172. package/dist/containers/SwapHistory/mock.d.ts +2 -0
  173. package/dist/containers/index.d.ts +3 -0
  174. package/dist/helper/index.d.ts +2 -0
  175. package/dist/index.d.ts +4 -0
  176. package/dist/index.js +8 -0
  177. package/dist/theme.d.ts +8 -0
  178. package/dist/types/index.d.ts +2 -0
  179. package/dist/types/meta.d.ts +23 -0
  180. package/dist/types/swaps.d.ts +29 -0
  181. package/dist/types/wallet.d.ts +23 -0
  182. package/dist/ui.cjs.development.js +4956 -0
  183. package/dist/ui.cjs.development.js.map +1 -0
  184. package/dist/ui.cjs.production.min.js +2 -0
  185. package/dist/ui.cjs.production.min.js.map +1 -0
  186. package/dist/ui.esm.js +4870 -0
  187. package/dist/ui.esm.js.map +1 -0
  188. package/package.json +88 -0
  189. package/src/components/Alert/Alert.stories.tsx +22 -0
  190. package/src/components/Alert/Alert.tsx +102 -0
  191. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  192. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  193. package/src/components/Alert/index.ts +2 -0
  194. package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
  195. package/src/components/BestRoute/BestRoute.tsx +232 -0
  196. package/src/components/BestRoute/index.ts +1 -0
  197. package/src/components/BestRoute/mock.ts +554 -0
  198. package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +25 -0
  199. package/src/components/BlockchainSelector/BlockchainSelector.tsx +93 -0
  200. package/src/components/BlockchainSelector/index.ts +1 -0
  201. package/src/components/BlockchainsList/BlockchainsList.stories.tsx +25 -0
  202. package/src/components/BlockchainsList/BlockchainsList.tsx +70 -0
  203. package/src/components/BlockchainsList/index.ts +1 -0
  204. package/src/components/BlockchainsList/mockData.ts +2972 -0
  205. package/src/components/Button/Button.stories.tsx +59 -0
  206. package/src/components/Button/Button.tsx +421 -0
  207. package/src/components/Button/index.ts +1 -0
  208. package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
  209. package/src/components/Checkbox/Checkbox.tsx +56 -0
  210. package/src/components/Checkbox/index.ts +1 -0
  211. package/src/components/Chip/Chip.stories.tsx +37 -0
  212. package/src/components/Chip/Chip.tsx +48 -0
  213. package/src/components/Chip/index.ts +1 -0
  214. package/src/components/ColorPicker/ColorPicker.stories.tsx +36 -0
  215. package/src/components/ColorPicker/ColorPicker.tsx +85 -0
  216. package/src/components/ColorPicker/index.ts +1 -0
  217. package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +13 -0
  218. package/src/components/ConnectWalletsModal/ConnectWalletsModal.tsx +42 -0
  219. package/src/components/ConnectWalletsModal/index.ts +1 -0
  220. package/src/components/ConnectWalletsModal/mockData.ts +134 -0
  221. package/src/components/Divider/Divider.tsx +41 -0
  222. package/src/components/Divider/index.ts +1 -0
  223. package/src/components/Drawer/Drawer.stories.tsx +86 -0
  224. package/src/components/Drawer/Drawer.tsx +124 -0
  225. package/src/components/Drawer/index.ts +1 -0
  226. package/src/components/Header/Header.tsx +39 -0
  227. package/src/components/Header/index.ts +1 -0
  228. package/src/components/Icon/AddCircleIcon.tsx +31 -0
  229. package/src/components/Icon/AddIcon.tsx +31 -0
  230. package/src/components/Icon/AddWalletIcon.tsx +50 -0
  231. package/src/components/Icon/AngleDownIcon.tsx +30 -0
  232. package/src/components/Icon/AngleLeftIcon.tsx +33 -0
  233. package/src/components/Icon/AngleRightIcon.tsx +32 -0
  234. package/src/components/Icon/AngleUpIcon.tsx +32 -0
  235. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  236. package/src/components/Icon/BagIcon.tsx +39 -0
  237. package/src/components/Icon/BanIcon.tsx +32 -0
  238. package/src/components/Icon/CheckCircleIcon.tsx +39 -0
  239. package/src/components/Icon/CheckIcon.tsx +30 -0
  240. package/src/components/Icon/CheckSquareIcon.tsx +37 -0
  241. package/src/components/Icon/CheckWalletIcon.tsx +45 -0
  242. package/src/components/Icon/ChevronRightIcon.tsx +29 -0
  243. package/src/components/Icon/CloseIcon.tsx +9 -0
  244. package/src/components/Icon/CopyIcon.tsx +59 -0
  245. package/src/components/Icon/DeleteCircleIcon.tsx +31 -0
  246. package/src/components/Icon/DeleteWalletIcon.tsx +50 -0
  247. package/src/components/Icon/DisconnectIcon.tsx +31 -0
  248. package/src/components/Icon/DownloadIcon.tsx +37 -0
  249. package/src/components/Icon/GasIcon.tsx +37 -0
  250. package/src/components/Icon/HistoryIcon.tsx +34 -0
  251. package/src/components/Icon/HorizontalSwapIcon.tsx +38 -0
  252. package/src/components/Icon/Icons.stories.tsx +44 -0
  253. package/src/components/Icon/InfoCircleIcon.tsx +39 -0
  254. package/src/components/Icon/MinusCircleIcon.tsx +31 -0
  255. package/src/components/Icon/RetryIcon.tsx +30 -0
  256. package/src/components/Icon/RetryLeftIcon.tsx +31 -0
  257. package/src/components/Icon/RetryRightIcon.tsx +31 -0
  258. package/src/components/Icon/SearchIcon.tsx +31 -0
  259. package/src/components/Icon/SearchMinusIcon.tsx +31 -0
  260. package/src/components/Icon/SettingIcon.tsx +31 -0
  261. package/src/components/Icon/SignatureIcon.tsx +32 -0
  262. package/src/components/Icon/SwapWalletIcon.tsx +50 -0
  263. package/src/components/Icon/TimeIcon.tsx +29 -0
  264. package/src/components/Icon/TrashIcon.tsx +31 -0
  265. package/src/components/Icon/TryAgainIcon.tsx +31 -0
  266. package/src/components/Icon/VerticalSwapIcon.tsx +38 -0
  267. package/src/components/Icon/WalletIconIcon.tsx +40 -0
  268. package/src/components/Icon/WarningIcon.tsx +37 -0
  269. package/src/components/Icon/common.ts +69 -0
  270. package/src/components/Icon/index.ts +48 -0
  271. package/src/components/Icon/types.tsx +45 -0
  272. package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
  273. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +195 -0
  274. package/src/components/LiquiditySourceList/index.ts +1 -0
  275. package/src/components/LiquiditySourceList/mockData.ts +316 -0
  276. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +16 -0
  277. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +61 -0
  278. package/src/components/LiquiditySourcesSelector/index.ts +1 -0
  279. package/src/components/Modal/Modal.stories.tsx +22 -0
  280. package/src/components/Modal/Modal.tsx +93 -0
  281. package/src/components/Modal/index.ts +1 -0
  282. package/src/components/Radio/Radio.stories.tsx +23 -0
  283. package/src/components/Radio/Radio.tsx +100 -0
  284. package/src/components/Radio/index.ts +1 -0
  285. package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
  286. package/src/components/SecondaryPage/SecondaryPage.tsx +68 -0
  287. package/src/components/SecondaryPage/index.ts +1 -0
  288. package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
  289. package/src/components/SelectableWalletList/SelectableWalletList.tsx +118 -0
  290. package/src/components/SelectableWalletList/index.ts +1 -0
  291. package/src/components/SelectableWalletList/mock.ts +13 -0
  292. package/src/components/Settings/Settings.stories.tsx +34 -0
  293. package/src/components/Settings/Settings.tsx +208 -0
  294. package/src/components/Settings/index.ts +1 -0
  295. package/src/components/Skeleton/Skeleton.stories.tsx +24 -0
  296. package/src/components/Skeleton/Skeleton.tsx +66 -0
  297. package/src/components/Skeleton/index.ts +1 -0
  298. package/src/components/Spacer/Spacer.stories.tsx +31 -0
  299. package/src/components/Spacer/Spacer.tsx +128 -0
  300. package/src/components/Spacer/index.ts +1 -0
  301. package/src/components/Spinner/Spinner.stories.tsx +25 -0
  302. package/src/components/Spinner/Spinner.tsx +61 -0
  303. package/src/components/Spinner/index.ts +1 -0
  304. package/src/components/StatusDrawer/StatusDrawer.stories.tsx +38 -0
  305. package/src/components/StatusDrawer/StatusDrawer.tsx +82 -0
  306. package/src/components/StatusDrawer/index.ts +1 -0
  307. package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
  308. package/src/components/StepDetail/StepDetail.tsx +109 -0
  309. package/src/components/StepDetail/index.ts +1 -0
  310. package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
  311. package/src/components/SwapContainer/SwapContainer.tsx +43 -0
  312. package/src/components/SwapContainer/index.ts +1 -0
  313. package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
  314. package/src/components/SwapDetail/SwapDetail.tsx +112 -0
  315. package/src/components/SwapDetail/Token.tsx +68 -0
  316. package/src/components/SwapDetail/index.ts +1 -0
  317. package/src/components/SwapDetail/mock.ts +276 -0
  318. package/src/components/Switch/Switch.stories.tsx +9 -0
  319. package/src/components/Switch/Switch.tsx +55 -0
  320. package/src/components/Switch/index.ts +1 -0
  321. package/src/components/TextField/TextField.stories.tsx +31 -0
  322. package/src/components/TextField/TextField.tsx +141 -0
  323. package/src/components/TextField/index.ts +1 -0
  324. package/src/components/TokenList/TokenItem.tsx +73 -0
  325. package/src/components/TokenList/TokenList.stories.tsx +18 -0
  326. package/src/components/TokenList/TokenList.tsx +95 -0
  327. package/src/components/TokenList/index.ts +1 -0
  328. package/src/components/TokenList/mockData.ts +1721 -0
  329. package/src/components/TokenSelector/TokenSelector.stories.tsx +18 -0
  330. package/src/components/TokenSelector/TokenSelector.tsx +95 -0
  331. package/src/components/TokenSelector/index.ts +1 -0
  332. package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
  333. package/src/components/Tooltip/Tooltip.tsx +116 -0
  334. package/src/components/Tooltip/index.ts +1 -0
  335. package/src/components/Typography/Typography.stories.tsx +72 -0
  336. package/src/components/Typography/Typography.tsx +216 -0
  337. package/src/components/Typography/index.ts +1 -0
  338. package/src/components/VirtualizedList/VirtualizedList.tsx +62 -0
  339. package/src/components/Wallet/State.tsx +34 -0
  340. package/src/components/Wallet/Wallet.stories.tsx +36 -0
  341. package/src/components/Wallet/Wallet.tsx +69 -0
  342. package/src/components/Wallet/index.ts +1 -0
  343. package/src/components/common/FilledCircle.tsx +8 -0
  344. package/src/components/common/index.ts +1 -0
  345. package/src/components/index.ts +31 -0
  346. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +22 -0
  347. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +180 -0
  348. package/src/containers/ConfirmSwap/index.ts +1 -0
  349. package/src/containers/ConfirmSwap/mock.ts +223 -0
  350. package/src/containers/History/History.stories.tsx +14 -0
  351. package/src/containers/History/History.tsx +115 -0
  352. package/src/containers/History/index.ts +1 -0
  353. package/src/containers/History/mock.ts +826 -0
  354. package/src/containers/History/types.tsx +47 -0
  355. package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
  356. package/src/containers/SwapHistory/SwapHistory.tsx +442 -0
  357. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  358. package/src/containers/SwapHistory/index.ts +1 -0
  359. package/src/containers/SwapHistory/mock.ts +276 -0
  360. package/src/containers/index.ts +3 -0
  361. package/src/helper/index.ts +16 -0
  362. package/src/index.ts +4 -0
  363. package/src/theme.ts +163 -0
  364. package/src/types/index.ts +3 -0
  365. package/src/types/meta.ts +22 -0
  366. package/src/types/swaps.ts +44 -0
  367. package/src/types/wallet.ts +30 -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,95 @@
1
+ import React from 'react';
2
+ import { containsText } from '../../helper';
3
+ import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
4
+ import { TokenList } from '../TokenList';
5
+ import { TokenWithAmount } from '../TokenList/TokenList';
6
+ import { LoadingStatus } from '../../types/meta';
7
+ import { Spinner } from '../Spinner';
8
+ import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
9
+ import { NotFoundAlert } from '../Alert/NotFoundAlert';
10
+ import { styled } from '../../theme';
11
+
12
+ const Container = styled('div', {
13
+ flex: '1',
14
+ });
15
+
16
+ export const LoaderContainer = styled('div', {
17
+ display: 'flex',
18
+ justifyContent: 'center',
19
+ width: '100%',
20
+ position: 'absolute',
21
+ top: '50%',
22
+ });
23
+ export interface PropTypes {
24
+ list: TokenWithAmount[];
25
+ type?: 'Source' | 'Destination';
26
+ selected: TokenWithAmount | null;
27
+ onChange: (token: TokenWithAmount) => void;
28
+ hasHeader?: boolean;
29
+ multiSelect?: boolean;
30
+ onBack?: () => void;
31
+ selectedList?: TokenWithAmount[] | 'all';
32
+ loadingStatus: LoadingStatus;
33
+ }
34
+
35
+ const filterTokens = (list: TokenWithAmount[], searchedFor: string) =>
36
+ list.filter(
37
+ (token) =>
38
+ containsText(token.symbol, searchedFor) ||
39
+ containsText(token.address || '', searchedFor) ||
40
+ containsText(token.name || '', searchedFor)
41
+ );
42
+
43
+ export function TokenSelector(props: PropTypes) {
44
+ const {
45
+ list,
46
+ type,
47
+ selected,
48
+ onChange,
49
+ hasHeader,
50
+ multiSelect,
51
+ selectedList,
52
+ onBack,
53
+ loadingStatus,
54
+ } = props;
55
+
56
+ return (
57
+ <SecondaryPage
58
+ textField={true}
59
+ textFieldPlaceholder="Search Blockchain By Name"
60
+ title={`Select ${type} Token`}
61
+ hasHeader={hasHeader}
62
+ onBack={onBack}
63
+ >
64
+ {(searchedFor) => {
65
+ const filteredTokens = filterTokens(list, searchedFor);
66
+ return (
67
+ <Container>
68
+ {loadingStatus === 'loading' && (
69
+ <LoaderContainer>
70
+ <Spinner size={24} />
71
+ </LoaderContainer>
72
+ )}
73
+ {loadingStatus === 'failed' && <LoadingFailedAlert />}
74
+ {loadingStatus === 'success' && (
75
+ <>
76
+ {filteredTokens.length ? (
77
+ <TokenList
78
+ searchedText={searchedFor}
79
+ list={filteredTokens}
80
+ selected={selected}
81
+ selectedList={selectedList}
82
+ multiSelect={multiSelect}
83
+ onChange={onChange}
84
+ />
85
+ ) : (
86
+ <NotFoundAlert catergory="Token" searchedFor={searchedFor} />
87
+ )}
88
+ </>
89
+ )}
90
+ </Container>
91
+ );
92
+ }}
93
+ </SecondaryPage>
94
+ );
95
+ }
@@ -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,116 @@
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
+ const ChildrenWrapper = styled('div', {
92
+ display: 'inline-block',
93
+ });
94
+
95
+ export function Tooltip({
96
+ children,
97
+ content,
98
+ side = 'top',
99
+ color = 'gray',
100
+ }: PropsWithChildren<PropTypes>) {
101
+ return (
102
+ <RadixTooltip.Provider>
103
+ <RadixTooltip.Root>
104
+ <TooltipTrigger asChild>
105
+ <ChildrenWrapper>{children}</ChildrenWrapper>
106
+ </TooltipTrigger>
107
+ <RadixTooltip.Portal>
108
+ <TooltipContent color={color} side={side} sideOffset={5}>
109
+ {content}
110
+ <TooltipArrow color={color} />
111
+ </TooltipContent>
112
+ </RadixTooltip.Portal>
113
+ </RadixTooltip.Root>
114
+ </RadixTooltip.Provider>
115
+ );
116
+ }
@@ -0,0 +1 @@
1
+ export { Tooltip } from './Tooltip';
@@ -0,0 +1,72 @@
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
+ 'body3',
17
+ 'h1',
18
+ 'h2',
19
+ 'h3',
20
+ 'h4',
21
+ 'h5',
22
+ 'h6',
23
+ 'caption',
24
+ ],
25
+ defaultValue: 'h1',
26
+ },
27
+ align: {
28
+ name: 'align',
29
+ control: { type: 'select' },
30
+ options: ['center', 'left', 'right'],
31
+ },
32
+ noWrap: {
33
+ name: 'noWrap',
34
+ control: { type: 'boolean' },
35
+ },
36
+ },
37
+ } as ComponentMeta<typeof Typography>;
38
+
39
+ export const Main = (props: PropTypes) => (
40
+ <div>
41
+ <Typography {...props} variant="h1">
42
+ Heading 1
43
+ </Typography>
44
+ <Typography {...props} variant="h2">
45
+ Heading 2
46
+ </Typography>
47
+ <Typography {...props} variant="h3">
48
+ Heading 3
49
+ </Typography>
50
+ <Typography {...props} variant="h4">
51
+ Heading 4
52
+ </Typography>
53
+ <Typography {...props} variant="h5">
54
+ Heading 5
55
+ </Typography>
56
+ <Typography {...props} variant="h6">
57
+ Heading 6
58
+ </Typography>
59
+ <Typography {...props} variant="body1">
60
+ Body 1
61
+ </Typography>
62
+ <Typography {...props} variant="body2">
63
+ Body 2
64
+ </Typography>
65
+ <Typography {...props} variant="body3">
66
+ Body 3
67
+ </Typography>
68
+ <Typography {...props} variant="caption">
69
+ Caption
70
+ </Typography>
71
+ </div>
72
+ );
@@ -0,0 +1,216 @@
1
+ import { CSSProperties } from '@stitches/react';
2
+ import React, { PropsWithChildren } from 'react';
3
+ import { styled } from '../../theme';
4
+
5
+ const TypographyContainer = styled('span', {
6
+ margin: 0,
7
+ display: 'inline-block',
8
+ variants: {
9
+ variant: {
10
+ h1: {
11
+ fontSize: '$36',
12
+ fontWeight: '$700',
13
+ '@md': {
14
+ fontSize: '$40',
15
+ },
16
+ '@lg': {
17
+ fontSize: '$48',
18
+ },
19
+ },
20
+ h2: {
21
+ fontSize: '$32',
22
+ fontWeight: '$700',
23
+ '@md': {
24
+ fontSize: '$36',
25
+ },
26
+ '@lg': {
27
+ fontSize: '$40',
28
+ },
29
+ },
30
+ h3: {
31
+ fontSize: '$20',
32
+ fontWeight: '$700',
33
+ '@md': {
34
+ fontSize: '$24',
35
+ },
36
+ '@lg': {
37
+ fontSize: '$32',
38
+ },
39
+ },
40
+ h4: {
41
+ fontSize: '$18',
42
+ fontWeight: '$600',
43
+ '@md': {
44
+ fontSize: '$20',
45
+ },
46
+ '@lg': {
47
+ fontSize: '$24',
48
+ },
49
+ },
50
+ h5: {
51
+ fontSize: '$16',
52
+ fontWeight: '$600',
53
+ },
54
+ h6: {
55
+ fontSize: '$14',
56
+ fontWeight: '$500',
57
+ '@md': {
58
+ fontSize: '$16',
59
+ },
60
+ '@lg': {
61
+ fontSize: '$18',
62
+ },
63
+ },
64
+ body1: {
65
+ fontSize: '$14',
66
+ fontWeight: '$400',
67
+ '@md': {
68
+ fontSize: '$16',
69
+ },
70
+ '@lg': {
71
+ fontSize: '$18',
72
+ },
73
+ },
74
+ body2: {
75
+ fontSize: '$14',
76
+ fontWeight: '$400',
77
+ '@lg': {
78
+ fontSize: '$16',
79
+ },
80
+ },
81
+ body3: {
82
+ fontSize: '$12',
83
+ fontWeight: '$400',
84
+ },
85
+ caption: {
86
+ fontSize: '$10',
87
+ fontWeight: '$400',
88
+ '@lg': {
89
+ fontSize: '$12',
90
+ },
91
+ },
92
+ },
93
+ align: {
94
+ center: {
95
+ textAlign: 'center',
96
+ },
97
+ left: {
98
+ textAlign: 'left',
99
+ },
100
+ right: {
101
+ textAlign: 'right',
102
+ },
103
+ },
104
+ noWrap: {
105
+ true: {
106
+ whiteSpace: 'nowrap',
107
+ },
108
+ },
109
+ ml: {
110
+ 2: {
111
+ marginLeft: '$2',
112
+ },
113
+ 4: {
114
+ marginLeft: '$4',
115
+ },
116
+ 8: {
117
+ marginLeft: '$8',
118
+ },
119
+ 12: {
120
+ marginLeft: '$12',
121
+ },
122
+ },
123
+ mt: {
124
+ 2: {
125
+ marginTop: '$2',
126
+ },
127
+ 4: {
128
+ marginTop: '$4',
129
+ },
130
+ 8: {
131
+ marginTop: '$8',
132
+ },
133
+ 12: {
134
+ marginTop: '$12',
135
+ },
136
+ },
137
+ mr: {
138
+ 2: {
139
+ marginRight: '$2',
140
+ },
141
+ 4: {
142
+ marginRight: '$4',
143
+ },
144
+ 8: {
145
+ marginRight: '$8',
146
+ },
147
+ 12: {
148
+ marginRight: '$12',
149
+ },
150
+ },
151
+ mb: {
152
+ 2: {
153
+ marginBottom: '$2',
154
+ },
155
+ 4: {
156
+ marginBottom: '$4',
157
+ },
158
+ 8: {
159
+ marginBottom: '$8',
160
+ },
161
+ 12: {
162
+ marginBottom: '$12',
163
+ },
164
+ },
165
+ },
166
+ });
167
+
168
+ export interface PropTypes {
169
+ variant:
170
+ | 'h1'
171
+ | 'h2'
172
+ | 'h3'
173
+ | 'h4'
174
+ | 'h5'
175
+ | 'h6'
176
+ | 'body1'
177
+ | 'body2'
178
+ | 'body3'
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
+ className?: string;
187
+ style?: CSSProperties;
188
+ color?: string;
189
+ }
190
+
191
+ export function Typography({
192
+ children,
193
+ className,
194
+ color,
195
+ ...props
196
+ }: PropsWithChildren<PropTypes>) {
197
+ const customCss = color
198
+ ? {
199
+ color: color.startsWith('$') ? color : `$${color}`,
200
+ }
201
+ : {
202
+ color: '$foreground',
203
+ };
204
+
205
+ return (
206
+ <TypographyContainer
207
+ className={`_typography _text ${className || ''}`}
208
+ css={customCss}
209
+ {...props}
210
+ >
211
+ {children}
212
+ </TypographyContainer>
213
+ );
214
+ }
215
+
216
+ Typography.toString = () => '._typography';
@@ -0,0 +1 @@
1
+ export { Typography } from './Typography';
@@ -0,0 +1,62 @@
1
+ import React, { PropsWithChildren } 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
+ loadNextPage: () => void;
19
+ Item: VirtualizedListItem;
20
+ innerElementType: ReactElementType | undefined;
21
+ size: number;
22
+ };
23
+
24
+ export function VirtualizedList(props: PropsWithChildren<PropTypes>) {
25
+ const { itemCount, hasNextPage, loadNextPage, Item, innerElementType, size } =
26
+ props;
27
+
28
+ const isItemLoaded = (index: number) => !hasNextPage || index < itemCount;
29
+
30
+ return (
31
+ <AutoSizer>
32
+ {({ width, height }) => (
33
+ <InfiniteLoader
34
+ isItemLoaded={isItemLoaded}
35
+ itemCount={hasNextPage ? itemCount + 1 : itemCount}
36
+ loadMoreItems={loadNextPage}
37
+ threshold={1}
38
+ >
39
+ {({ onItemsRendered, ref }) => {
40
+ return (
41
+ <List
42
+ innerElementType={innerElementType}
43
+ ref={ref}
44
+ itemSize={() => size}
45
+ itemCount={itemCount}
46
+ height={height || 0}
47
+ width={width || 0}
48
+ onItemsRendered={onItemsRendered}
49
+ >
50
+ {({ index, style }) =>
51
+ isItemLoaded(index) ? (
52
+ <Item index={index} style={style as CSSProperties} />
53
+ ) : null
54
+ }
55
+ </List>
56
+ );
57
+ }}
58
+ </InfiniteLoader>
59
+ )}
60
+ </AutoSizer>
61
+ );
62
+ }
@@ -0,0 +1,34 @@
1
+ import React, { Fragment } from 'react';
2
+ import { styled } from '../../theme';
3
+ import { DisconnectIcon, DownloadIcon } from '../Icon';
4
+ import { Spinner } from '../Spinner';
5
+ import { WalletState } from '../../types/wallet';
6
+ import { InstallObjects, detectInstallLink } from '@rango-dev/wallets-shared';
7
+
8
+ const StateIconContainer = styled('span', {
9
+ display: 'flex',
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ });
13
+
14
+ export const State = ({
15
+ walletState,
16
+ installLink,
17
+ }: {
18
+ walletState: WalletState;
19
+ installLink: InstallObjects | string;
20
+ }) => (
21
+ <Fragment>
22
+ {walletState !== WalletState.DISCONNECTED && (
23
+ <StateIconContainer>
24
+ {walletState === WalletState.NOT_INSTALLED && (
25
+ <a href={detectInstallLink(installLink)} target="_blank">
26
+ <DownloadIcon size={24} color="success" />
27
+ </a>
28
+ )}
29
+ {walletState === WalletState.CONNECTING && <Spinner />}
30
+ {walletState === WalletState.CONNECTED && <DisconnectIcon />}
31
+ </StateIconContainer>
32
+ )}
33
+ </Fragment>
34
+ );