@rango-dev/ui 0.1.14-next.0 → 0.1.14-next.11

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 (284) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/Alert/Alert.d.ts +7 -7
  3. package/dist/components/Alert/Alert.stories.d.ts +7 -5
  4. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -2
  5. package/dist/components/Alert/NotFoundAlert.d.ts +7 -7
  6. package/dist/components/Alert/index.d.ts +2 -2
  7. package/dist/components/BestRoute/BestRoute.d.ts +15 -12
  8. package/dist/components/BestRoute/BestRoute.stories.d.ts +10 -8
  9. package/dist/components/BestRoute/index.d.ts +1 -1
  10. package/dist/components/BestRoute/mock.d.ts +4 -4
  11. package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -10
  12. package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +5 -5
  13. package/dist/components/BlockchainsList/index.d.ts +1 -1
  14. package/dist/components/BlockchainsList/mockData.d.ts +2 -2
  15. package/dist/components/Button/Button.d.ts +17 -17
  16. package/dist/components/Button/Button.stories.d.ts +10 -8
  17. package/dist/components/Button/index.d.ts +1 -1
  18. package/dist/components/Checkbox/Checkbox.d.ts +11 -11
  19. package/dist/components/Checkbox/Checkbox.stories.d.ts +7 -5
  20. package/dist/components/Checkbox/index.d.ts +1 -1
  21. package/dist/components/Chip/Chip.d.ts +12 -12
  22. package/dist/components/Chip/Chip.stories.d.ts +7 -7
  23. package/dist/components/Chip/index.d.ts +1 -1
  24. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -9
  25. package/dist/components/ColorPicker/ColorPicker.stories.d.ts +5 -5
  26. package/dist/components/ColorPicker/index.d.ts +1 -1
  27. package/dist/components/Divider/Divider.d.ts +6 -6
  28. package/dist/components/Divider/index.d.ts +1 -1
  29. package/dist/components/Drawer/Drawer.d.ts +13 -13
  30. package/dist/components/Drawer/Drawer.stories.d.ts +8 -8
  31. package/dist/components/Drawer/index.d.ts +1 -1
  32. package/dist/components/Header/Header.d.ts +9 -9
  33. package/dist/components/Header/index.d.ts +1 -1
  34. package/dist/components/Icon/AddCircleIcon.d.ts +3 -3
  35. package/dist/components/Icon/AddIcon.d.ts +3 -3
  36. package/dist/components/Icon/AddWalletIcon.d.ts +3 -3
  37. package/dist/components/Icon/AngleDownIcon.d.ts +3 -3
  38. package/dist/components/Icon/AngleLeftIcon.d.ts +3 -3
  39. package/dist/components/Icon/AngleRightIcon.d.ts +3 -3
  40. package/dist/components/Icon/AngleUpIcon.d.ts +3 -3
  41. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -3
  42. package/dist/components/Icon/BagIcon.d.ts +3 -3
  43. package/dist/components/Icon/BanIcon.d.ts +3 -3
  44. package/dist/components/Icon/CheckCircleIcon.d.ts +3 -3
  45. package/dist/components/Icon/CheckIcon.d.ts +3 -3
  46. package/dist/components/Icon/CheckSquareIcon.d.ts +3 -3
  47. package/dist/components/Icon/CheckWalletIcon.d.ts +3 -3
  48. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -3
  49. package/dist/components/Icon/CloseIcon.d.ts +112 -1
  50. package/dist/components/Icon/CopyIcon.d.ts +3 -3
  51. package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -3
  52. package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -3
  53. package/dist/components/Icon/DisconnectIcon.d.ts +3 -3
  54. package/dist/components/Icon/DownloadIcon.d.ts +3 -3
  55. package/dist/components/Icon/GasIcon.d.ts +3 -3
  56. package/dist/components/Icon/HistoryIcon.d.ts +3 -3
  57. package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -3
  58. package/dist/components/Icon/Icons.stories.d.ts +5 -5
  59. package/dist/components/Icon/InfoCircleIcon.d.ts +3 -3
  60. package/dist/components/Icon/MinusCircleIcon.d.ts +3 -3
  61. package/dist/components/Icon/RetryIcon.d.ts +3 -3
  62. package/dist/components/Icon/RetryLeftIcon.d.ts +3 -3
  63. package/dist/components/Icon/RetryRightIcon.d.ts +3 -3
  64. package/dist/components/Icon/SearchIcon.d.ts +3 -3
  65. package/dist/components/Icon/SearchMinusIcon.d.ts +3 -3
  66. package/dist/components/Icon/SettingIcon.d.ts +3 -3
  67. package/dist/components/Icon/SignatureIcon.d.ts +3 -3
  68. package/dist/components/Icon/SwapWalletIcon.d.ts +3 -3
  69. package/dist/components/Icon/TimeIcon.d.ts +3 -3
  70. package/dist/components/Icon/TrashIcon.d.ts +3 -3
  71. package/dist/components/Icon/TryAgainIcon.d.ts +3 -3
  72. package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -3
  73. package/dist/components/Icon/WalletIconIcon.d.ts +3 -3
  74. package/dist/components/Icon/WarningIcon.d.ts +3 -3
  75. package/dist/components/Icon/common.d.ts +228 -2
  76. package/dist/components/Icon/index.d.ts +40 -40
  77. package/dist/components/Icon/types.d.ts +7 -7
  78. package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +5 -5
  79. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -11
  80. package/dist/components/LiquiditySourceList/index.d.ts +1 -1
  81. package/dist/components/LiquiditySourceList/mockData.d.ts +2 -2
  82. package/dist/components/Modal/Modal.d.ts +11 -11
  83. package/dist/components/Modal/Modal.stories.d.ts +5 -5
  84. package/dist/components/Modal/index.d.ts +1 -1
  85. package/dist/components/Radio/Radio.d.ts +13 -13
  86. package/dist/components/Radio/Radio.stories.d.ts +5 -5
  87. package/dist/components/Radio/index.d.ts +1 -1
  88. package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -16
  89. package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +5 -2
  90. package/dist/components/SecondaryPage/index.d.ts +1 -1
  91. package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -7
  92. package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +7 -5
  93. package/dist/components/SelectableWalletList/index.d.ts +1 -1
  94. package/dist/components/SelectableWalletList/mock.d.ts +2 -2
  95. package/dist/components/Skeleton/Skeleton.d.ts +6 -6
  96. package/dist/components/Skeleton/Skeleton.stories.d.ts +5 -5
  97. package/dist/components/Skeleton/index.d.ts +1 -1
  98. package/dist/components/Spinner/Spinner.d.ts +6 -6
  99. package/dist/components/Spinner/Spinner.stories.d.ts +5 -5
  100. package/dist/components/Spinner/index.d.ts +1 -1
  101. package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -11
  102. package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +5 -5
  103. package/dist/components/StatusDrawer/index.d.ts +1 -1
  104. package/dist/components/StepDetail/StepDetail.d.ts +12 -12
  105. package/dist/components/StepDetail/StepDetail.stories.d.ts +7 -5
  106. package/dist/components/StepDetail/index.d.ts +1 -1
  107. package/dist/components/SwapContainer/SwapContainer.d.ts +7 -7
  108. package/dist/components/SwapContainer/index.d.ts +1 -1
  109. package/dist/components/SwapDetail/SwapDetail.d.ts +8 -8
  110. package/dist/components/SwapDetail/SwapDetail.stories.d.ts +7 -5
  111. package/dist/components/SwapDetail/Token.d.ts +17 -17
  112. package/dist/components/SwapDetail/index.d.ts +1 -1
  113. package/dist/components/SwapDetail/mock.d.ts +2 -2
  114. package/dist/components/Switch/Switch.d.ts +6 -6
  115. package/dist/components/Switch/Switch.stories.d.ts +5 -5
  116. package/dist/components/Switch/index.d.ts +1 -1
  117. package/dist/components/TextField/TextField.d.ts +10 -10
  118. package/dist/components/TextField/TextField.stories.d.ts +7 -7
  119. package/dist/components/TextField/index.d.ts +1 -1
  120. package/dist/components/TokenList/TokenItem.d.ts +11 -11
  121. package/dist/components/TokenList/TokenList.d.ts +17 -17
  122. package/dist/components/TokenList/TokenList.stories.d.ts +5 -5
  123. package/dist/components/TokenList/index.d.ts +1 -1
  124. package/dist/components/TokenList/mockData.d.ts +2 -2
  125. package/dist/components/Tooltip/Tooltip.d.ts +7 -7
  126. package/dist/components/Tooltip/Tooltip.stories.d.ts +7 -5
  127. package/dist/components/Tooltip/index.d.ts +1 -1
  128. package/dist/components/Typography/Typography.d.ts +18 -18
  129. package/dist/components/Typography/Typography.stories.d.ts +7 -5
  130. package/dist/components/Typography/index.d.ts +1 -1
  131. package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -17
  132. package/dist/components/Wallet/State.d.ts +7 -7
  133. package/dist/components/Wallet/Wallet.d.ts +7 -7
  134. package/dist/components/Wallet/Wallet.stories.d.ts +7 -5
  135. package/dist/components/Wallet/index.d.ts +1 -1
  136. package/dist/components/common/FilledCircle.d.ts +111 -1
  137. package/dist/components/common/Image.d.ts +6 -6
  138. package/dist/components/common/index.d.ts +2 -2
  139. package/dist/components/index.d.ts +25 -31
  140. package/dist/{components → containers}/BlockchainSelector/BlockchainSelector.d.ts +17 -17
  141. package/dist/{components → containers}/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -5
  142. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +22 -22
  143. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +8 -6
  144. package/dist/containers/ConfirmSwap/index.d.ts +1 -1
  145. package/dist/containers/ConfirmSwap/mock.d.ts +5 -5
  146. package/dist/{components → containers}/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -5
  147. package/dist/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.d.ts +10 -11
  148. package/dist/{components → containers}/ConnectWalletsModal/mockData.d.ts +2 -2
  149. package/dist/containers/History/History.d.ts +6 -6
  150. package/dist/containers/History/History.stories.d.ts +9 -5
  151. package/dist/containers/History/SwapsGroup.d.ts +13 -13
  152. package/dist/containers/History/index.d.ts +3 -2
  153. package/dist/containers/History/mock.d.ts +2 -2
  154. package/dist/containers/History/types.d.ts +39 -39
  155. package/dist/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -13
  156. package/dist/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -5
  157. package/dist/{components → containers}/Settings/Settings.d.ts +24 -23
  158. package/dist/{components → containers}/Settings/Settings.stories.d.ts +5 -5
  159. package/dist/containers/SwapHistory/SwapHistory.d.ts +1128 -24
  160. package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +14 -5
  161. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -17
  162. package/dist/containers/SwapHistory/index.d.ts +1 -1
  163. package/dist/containers/SwapHistory/mock.d.ts +2 -2
  164. package/dist/containers/TokenSelector/TokenSelector.d.ts +124 -0
  165. package/dist/{components → containers}/TokenSelector/TokenSelector.stories.d.ts +5 -5
  166. package/dist/containers/index.d.ts +8 -3
  167. package/dist/helper/index.d.ts +6 -3
  168. package/dist/hooks/index.d.ts +1 -1
  169. package/dist/hooks/useCopyToClipboard.d.ts +1 -1
  170. package/dist/index.d.ts +6 -5
  171. package/dist/index.js +20 -8
  172. package/dist/index.js.map +7 -0
  173. package/dist/theme.d.ts +928 -8
  174. package/dist/types/index.d.ts +2 -2
  175. package/dist/types/meta.d.ts +23 -23
  176. package/dist/types/swaps.d.ts +29 -29
  177. package/dist/types/wallet.d.ts +23 -23
  178. package/package.json +21 -40
  179. package/src/components/Alert/Alert.stories.tsx +19 -6
  180. package/src/components/Alert/Alert.tsx +5 -5
  181. package/src/components/BestRoute/BestRoute.stories.tsx +15 -5
  182. package/src/components/BestRoute/BestRoute.tsx +4 -3
  183. package/src/components/BestRoute/mock.ts +1 -1
  184. package/src/components/BlockchainsList/BlockchainsList.stories.tsx +9 -3
  185. package/src/components/BlockchainsList/mockData.ts +603 -108
  186. package/src/components/Button/Button.stories.tsx +8 -3
  187. package/src/components/Button/Button.tsx +42 -42
  188. package/src/components/Checkbox/Checkbox.stories.tsx +6 -2
  189. package/src/components/Checkbox/Checkbox.tsx +2 -0
  190. package/src/components/Chip/Chip.stories.tsx +23 -7
  191. package/src/components/Chip/Chip.tsx +1 -1
  192. package/src/components/ColorPicker/ColorPicker.stories.tsx +15 -5
  193. package/src/components/ColorPicker/ColorPicker.tsx +34 -10
  194. package/src/components/Divider/Divider.tsx +113 -11
  195. package/src/components/Drawer/Drawer.stories.tsx +8 -11
  196. package/src/components/Icon/Icons.stories.tsx +8 -4
  197. package/src/components/Icon/common.ts +2 -2
  198. package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +6 -3
  199. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +5 -5
  200. package/src/components/Modal/Modal.stories.tsx +9 -10
  201. package/src/components/Modal/Modal.tsx +3 -2
  202. package/src/components/Radio/Radio.stories.tsx +12 -7
  203. package/src/components/Radio/Radio.tsx +2 -2
  204. package/src/components/SecondaryPage/SecondaryPage.stories.tsx +12 -3
  205. package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +2 -2
  206. package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -5
  207. package/src/components/Skeleton/Skeleton.stories.tsx +6 -2
  208. package/src/components/Skeleton/Skeleton.tsx +1 -1
  209. package/src/components/Spinner/Spinner.stories.tsx +6 -2
  210. package/src/components/Spinner/Spinner.tsx +1 -1
  211. package/src/components/StatusDrawer/StatusDrawer.stories.tsx +7 -2
  212. package/src/components/StatusDrawer/StatusDrawer.tsx +2 -2
  213. package/src/components/StepDetail/StepDetail.stories.tsx +9 -2
  214. package/src/components/StepDetail/StepDetail.tsx +4 -4
  215. package/src/components/SwapContainer/SwapContainer.tsx +3 -3
  216. package/src/components/SwapDetail/SwapDetail.stories.tsx +5 -2
  217. package/src/components/SwapDetail/SwapDetail.tsx +4 -4
  218. package/src/components/SwapDetail/Token.tsx +6 -6
  219. package/src/components/Switch/Switch.stories.tsx +2 -2
  220. package/src/components/Switch/Switch.tsx +2 -2
  221. package/src/components/TextField/TextField.stories.tsx +3 -2
  222. package/src/components/TextField/TextField.tsx +3 -3
  223. package/src/components/TokenList/TokenItem.tsx +1 -1
  224. package/src/components/TokenList/TokenList.stories.tsx +3 -3
  225. package/src/components/Tooltip/Tooltip.stories.tsx +7 -2
  226. package/src/components/Tooltip/Tooltip.tsx +2 -2
  227. package/src/components/Typography/Typography.stories.tsx +2 -2
  228. package/src/components/Wallet/Wallet.stories.tsx +7 -13
  229. package/src/components/index.ts +0 -6
  230. package/src/containers/BlockchainSelector/BlockchainSelector.stories.tsx +41 -0
  231. package/src/{components → containers}/BlockchainSelector/BlockchainSelector.tsx +5 -5
  232. package/{dist/components/BlockchainSelector/index.d.ts → src/containers/BlockchainSelector/index.ts} +1 -1
  233. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +223 -10
  234. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +25 -16
  235. package/src/containers/ConnectWalletsModal/ConnectWallets.stories.tsx +24 -0
  236. package/src/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.tsx +3 -4
  237. package/{dist/components/ConnectWalletsModal/index.d.ts → src/containers/ConnectWalletsModal/index.ts} +1 -1
  238. package/src/containers/History/History.stories.tsx +2 -2
  239. package/src/containers/History/History.tsx +1 -1
  240. package/src/containers/History/SwapsGroup.tsx +1 -1
  241. package/src/containers/History/index.ts +2 -1
  242. package/src/containers/History/mock.ts +3 -3
  243. package/src/containers/History/types.tsx +1 -1
  244. package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +7 -4
  245. package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +2 -3
  246. package/{dist/components/LiquiditySourcesSelector/index.d.ts → src/containers/LiquiditySourcesSelector/index.ts} +1 -1
  247. package/src/containers/Settings/Settings.stories.tsx +27 -0
  248. package/src/{components → containers}/Settings/Settings.tsx +33 -26
  249. package/{dist/components/Settings/index.d.ts → src/containers/Settings/index.ts} +1 -1
  250. package/src/containers/SwapHistory/SwapHistory.stories.tsx +3 -3
  251. package/src/containers/SwapHistory/SwapHistory.tsx +8 -9
  252. package/src/containers/SwapHistory/mock.ts +2 -2
  253. package/src/{components → containers}/TokenSelector/TokenSelector.stories.tsx +7 -8
  254. package/src/{components → containers}/TokenSelector/TokenSelector.tsx +7 -6
  255. package/{dist/components/TokenSelector/index.d.ts → src/containers/TokenSelector/index.ts} +1 -1
  256. package/src/containers/index.ts +5 -0
  257. package/src/helper/index.ts +75 -0
  258. package/src/index.ts +1 -0
  259. package/src/theme.ts +34 -36
  260. package/src/types/index.ts +1 -1
  261. package/dist/components/Spacer/Spacer.d.ts +0 -6
  262. package/dist/components/Spacer/Spacer.stories.d.ts +0 -5
  263. package/dist/components/Spacer/index.d.ts +0 -1
  264. package/dist/components/SwapContainer/SwapContainer.stories.d.ts +0 -5
  265. package/dist/components/TokenSelector/TokenSelector.d.ts +0 -14
  266. package/dist/ui.cjs.development.js +0 -5094
  267. package/dist/ui.cjs.development.js.map +0 -1
  268. package/dist/ui.cjs.production.min.js +0 -2
  269. package/dist/ui.cjs.production.min.js.map +0 -1
  270. package/dist/ui.esm.js +0 -5005
  271. package/dist/ui.esm.js.map +0 -1
  272. package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +0 -25
  273. package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +0 -13
  274. package/src/components/Settings/Settings.stories.tsx +0 -34
  275. package/src/components/Spacer/Spacer.stories.tsx +0 -31
  276. package/src/components/Spacer/Spacer.tsx +0 -128
  277. package/src/components/Spacer/index.ts +0 -1
  278. package/src/components/SwapContainer/SwapContainer.stories.tsx +0 -13
  279. /package/{src/components/BlockchainSelector/index.ts → dist/containers/BlockchainSelector/index.d.ts} +0 -0
  280. /package/{src/components/ConnectWalletsModal/index.ts → dist/containers/ConnectWalletsModal/index.d.ts} +0 -0
  281. /package/{src/components/LiquiditySourcesSelector/index.ts → dist/containers/LiquiditySourcesSelector/index.d.ts} +0 -0
  282. /package/{src/components/Settings/index.ts → dist/containers/Settings/index.d.ts} +0 -0
  283. /package/{src/components/TokenSelector/index.ts → dist/containers/TokenSelector/index.d.ts} +0 -0
  284. /package/src/{components → containers}/ConnectWalletsModal/mockData.ts +0 -0
@@ -5,8 +5,8 @@ import { containsText } from '../../helper';
5
5
  import { styled } from '../../theme';
6
6
  import { PendingSwap } from './types';
7
7
  import { NotFoundAlert } from '../../components/Alert/NotFoundAlert';
8
- import { LoaderContainer } from '../../components/TokenSelector/TokenSelector';
9
8
  import { SwapsGroup, PropTypes as SwapsGroupPropTypes } from './SwapsGroup';
9
+ import { LoaderContainer } from '../TokenSelector/TokenSelector';
10
10
 
11
11
  const Container = styled('div', {
12
12
  overflowY: 'auto',
@@ -34,7 +34,7 @@ export function SwapsGroup(props: Omit<PropTypes, 'onBack'>) {
34
34
  <Group>
35
35
  <Typography
36
36
  variant="body2"
37
- color="neutrals600"
37
+ color="neutral600"
38
38
  className="group-title"
39
39
  >
40
40
  {group.title}
@@ -1,2 +1,3 @@
1
1
  export { History } from './History';
2
- export { SwapsGroup, GroupBy } from './SwapsGroup';
2
+ export { SwapsGroup } from './SwapsGroup';
3
+ export type { GroupBy } from './SwapsGroup';
@@ -172,7 +172,7 @@ export const pendingSwap: PendingSwap[] = [
172
172
  toLogo: 'https://api.rango.exchange/i/mJQPS2',
173
173
  startTransactionTime: 1673164519916,
174
174
  swapperId: 'Osmosis',
175
- swapperLogo: '',
175
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
176
176
  expectedOutputAmountHumanReadable: '1.540670',
177
177
  outputAmount: '1.540658',
178
178
  status: 'running',
@@ -307,7 +307,7 @@ export const pendingSwap: PendingSwap[] = [
307
307
  swaps: [
308
308
  {
309
309
  swapperId: 'Osmosis',
310
- swapperLogo: '',
310
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
311
311
  swapperType: 'DEX',
312
312
  from: {
313
313
  symbol: 'JUNO',
@@ -581,7 +581,7 @@ export const pendingSwap: PendingSwap[] = [
581
581
  {
582
582
  swapperId: 'Osmosis',
583
583
  swapperType: 'DEX',
584
- swapperLogo: '',
584
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
585
585
 
586
586
  from: {
587
587
  symbol: 'JUNO',
@@ -7,7 +7,7 @@ import {
7
7
  Transfer,
8
8
  } from 'rango-sdk';
9
9
  import { PendingSwapNetworkStatus, StepStatus } from '../../types/swaps';
10
- export { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
10
+ export type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
11
11
 
12
12
  export type PendingSwapStep = {
13
13
  id: number;
@@ -1,15 +1,18 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import {
4
4
  LiquiditySourcesSelector,
5
5
  PropTypes,
6
6
  } from './LiquiditySourcesSelector';
7
- import { liquiditySources } from '../LiquiditySourceList/mockData';
7
+ import { liquiditySources } from '../../components/LiquiditySourceList/mockData';
8
8
 
9
9
  export default {
10
- title: 'Liquidity Sources Selector',
10
+ title: 'Containers/Liquidity Sources Selector',
11
11
  component: LiquiditySourcesSelector,
12
- } as ComponentMeta<typeof LiquiditySourcesSelector>;
12
+ args: {
13
+ loadingStatus: 'success',
14
+ },
15
+ } as Meta<typeof LiquiditySourcesSelector>;
13
16
 
14
17
  export const Main = (args: PropTypes) => (
15
18
  <LiquiditySourcesSelector {...args} list={liquiditySources} />
@@ -2,9 +2,8 @@ import { CSSProperties } from '@stitches/react';
2
2
  import React from 'react';
3
3
  import { containsText } from '../../helper';
4
4
  import { LiquiditySource, LoadingStatus } from '../../types/meta';
5
- import { Button } from '../Button';
6
- import { LiquiditySourceList } from '../LiquiditySourceList';
7
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
+ import { Button, SecondaryPage } from '../../components';
6
+ import { LiquiditySourceList } from '../../components/LiquiditySourceList';
8
7
 
9
8
  const filterLiquiditySources = (
10
9
  liquiditySources: LiquiditySource[],
@@ -1 +1 @@
1
- export { LiquiditySourcesSelector } from './LiquiditySourcesSelector';
1
+ export { LiquiditySourcesSelector } from './LiquiditySourcesSelector';
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { Meta } from '@storybook/react';
3
+ import { Settings, PropTypes } from './Settings';
4
+ import { liquiditySources } from '../../components/LiquiditySourceList/mockData';
5
+ import { SwapContainer } from '../../components';
6
+
7
+ export default {
8
+ title: 'Containers/Settings',
9
+ component: Settings,
10
+ args: {
11
+ slippages: [0.5, 1, 3, 5, 8, 13, 20],
12
+ selectedSlippage: 3,
13
+ minSlippage: 1,
14
+ maxSlippage: 10,
15
+ },
16
+ } as Meta<typeof Settings>;
17
+
18
+
19
+ export const Main = (args: PropTypes) => (
20
+ <SwapContainer>
21
+ <Settings
22
+ {...args}
23
+ liquiditySources={liquiditySources}
24
+ selectedLiquiditySources={liquiditySources.slice(0, 5)}
25
+ />
26
+ </SwapContainer>
27
+ );
@@ -1,18 +1,21 @@
1
1
  import { styled } from '../../theme';
2
2
  import React, { useState } from 'react';
3
- import { AngleRightIcon } from '../Icon';
4
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
- import { Typography } from '../Typography';
6
- import { Chip } from '../Chip';
3
+
7
4
  import { LiquiditySource, LoadingStatus } from '../../types/meta';
8
- import { TextField } from '../TextField';
9
- import { Radio } from '../Radio';
10
- import { Switch } from '../Switch';
11
- import { Button } from '../Button';
5
+ import {
6
+ AngleRightIcon,
7
+ Button,
8
+ Chip,
9
+ Radio,
10
+ SecondaryPage,
11
+ Switch,
12
+ TextField,
13
+ Typography,
14
+ } from '../../components';
12
15
 
13
16
  const BaseContainer = styled('div', {
14
17
  borderRadius: '$5',
15
- backgroundColor: '$neutrals300',
18
+ backgroundColor: '$neutral100',
16
19
  padding: '$16',
17
20
  });
18
21
 
@@ -60,7 +63,7 @@ type Theme = 'dark' | 'light' | 'auto';
60
63
  export interface PropTypes {
61
64
  slippages: number[];
62
65
  selectedSlippage: number;
63
- customSlippage: number;
66
+ customSlippage: number | null;
64
67
  maxSlippage: number;
65
68
  minSlippage: number;
66
69
  liquiditySources: LiquiditySource[];
@@ -74,6 +77,7 @@ export interface PropTypes {
74
77
  infiniteApprove: boolean;
75
78
  toggleInfiniteApprove: (infinite: boolean) => void;
76
79
  loadingStatus: LoadingStatus;
80
+ singleTheme?: boolean;
77
81
  }
78
82
 
79
83
  export function Settings(props: PropTypes) {
@@ -93,6 +97,7 @@ export function Settings(props: PropTypes) {
93
97
  toggleInfiniteApprove,
94
98
  infiniteApprove,
95
99
  loadingStatus,
100
+ singleTheme,
96
101
  } = props;
97
102
 
98
103
  const [selectedSlippage, setSelectedSlippage] = useState(
@@ -132,7 +137,7 @@ export function Settings(props: PropTypes) {
132
137
  ))}
133
138
  <TextField
134
139
  type="number"
135
- value={customSlippage}
140
+ value={customSlippage || ''}
136
141
  onChange={(event) => {
137
142
  const parsedValue = parseFloat(event.target.value);
138
143
  if (
@@ -153,20 +158,22 @@ export function Settings(props: PropTypes) {
153
158
  />
154
159
  </SlippageChipsContainer>
155
160
  </BaseContainer>
156
- <ThemesContainer>
157
- <Title variant="body2">Theme</Title>
158
- <Radio
159
- value={selectedTheme}
160
- options={[
161
- { value: 'dark', label: 'Dark' },
162
- { value: 'light', label: 'Light' },
163
- { value: 'auto', label: 'Auto' },
164
- ]}
165
- onChange={(value) => onThemeChange(value as Theme)}
166
- direction="horizontal"
167
- style={{ marginTop: '$24' }}
168
- />
169
- </ThemesContainer>
161
+ {!singleTheme && (
162
+ <ThemesContainer>
163
+ <Title variant="body2">Theme</Title>
164
+ <Radio
165
+ value={selectedTheme}
166
+ options={[
167
+ { value: 'dark', label: 'Dark' },
168
+ { value: 'light', label: 'Light' },
169
+ { value: 'auto', label: 'Auto' },
170
+ ]}
171
+ onChange={(value) => onThemeChange(value as Theme)}
172
+ direction="horizontal"
173
+ style={{ marginTop: '$24' }}
174
+ />
175
+ </ThemesContainer>
176
+ )}
170
177
  <InfiniteContainer>
171
178
  <Typography variant="body2">Infinite Approval</Typography>
172
179
  <Switch checked={infiniteApprove} onChange={toggleInfiniteApprove} />
@@ -180,7 +187,7 @@ export function Settings(props: PropTypes) {
180
187
  suffix={
181
188
  <LiquiditySourceNumber>
182
189
  {loadingStatus === 'success' && (
183
- <Typography variant="body2" color="neutrals800">
190
+ <Typography variant="body2" color="neutral800">
184
191
  {liquiditySources.length !== selectedLiquiditySources.length
185
192
  ? `${selectedLiquiditySources.length} / ${liquiditySources.length}`
186
193
  : liquiditySources.length}
@@ -1 +1 @@
1
- export { Settings } from './Settings';
1
+ export { Settings } from './Settings';
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import { PropTypes, SwapHistory } from './SwapHistory';
4
4
  import { pendingSwap } from './mock';
5
5
 
6
6
  export default {
7
- title: 'Swap History',
7
+ title: 'Containers/Swap History',
8
8
  component: SwapHistory,
9
- } as ComponentMeta<typeof SwapHistory>;
9
+ } as Meta<typeof SwapHistory>;
10
10
 
11
11
  export const Main = (args: PropTypes) => (
12
12
  <SwapHistory {...args} pendingSwap={pendingSwap} />
@@ -6,12 +6,11 @@ import {
6
6
  Typography,
7
7
  CheckCircleIcon,
8
8
  InfoCircleIcon,
9
- Spacer,
9
+ Divider,
10
10
  Button,
11
11
  Alert,
12
12
  Drawer,
13
13
  Spinner,
14
- Divider,
15
14
  Image,
16
15
  } from '../../components';
17
16
  import { styled } from '../../theme';
@@ -53,7 +52,7 @@ export const ErrorMsg = styled(Typography, {
53
52
 
54
53
  export const FeeContainer = styled('div', {
55
54
  paddingLeft: '$16',
56
- color: '$neutrals800'
55
+ color: '$neutral800',
57
56
  });
58
57
 
59
58
  export const Fee = styled('div', {
@@ -96,7 +95,7 @@ const SwapInfoContainer = styled('div', {
96
95
  display: 'flex',
97
96
  flexDirection: 'column',
98
97
  paddingBottom: '$16',
99
- borderBottom: '1px solid $neutrals300',
98
+ borderBottom: '1px solid $neutral100',
100
99
  });
101
100
 
102
101
  const InternalDetailsContainer = styled('div', {
@@ -137,12 +136,12 @@ const Row = styled('div', {
137
136
  padding: '$8 0',
138
137
 
139
138
  '.name': {
140
- color: '$neutrals600',
139
+ color: '$neutral600',
141
140
  },
142
141
  '.value': {
143
142
  display: 'flex',
144
143
  alignItems: 'center',
145
- color: '$neutrals800',
144
+ color: '$neutral800',
146
145
  justifyContent: 'flex-end',
147
146
  },
148
147
  '.status': {
@@ -169,7 +168,7 @@ const RequestId = styled('div', {
169
168
 
170
169
  const ExtraDetails = styled('div', {
171
170
  padding: '0',
172
- color: '$neutrals600',
171
+ color: '$neutral600',
173
172
  fontSize: '$10',
174
173
  });
175
174
 
@@ -243,7 +242,7 @@ export function SwapHistory(props: PropTypes) {
243
242
  onClick={onCopy.bind(null, pendingSwap?.requestId)}
244
243
  >
245
244
  <RequestId>{pendingSwap?.requestId}</RequestId>
246
- <Spacer size={4} />
245
+ <Divider size={4} direction="horizontal" />
247
246
  <Button type="primary" variant="ghost" size="compact">
248
247
  {isCopied ? 'Copied!' : 'Copy'}
249
248
  </Button>
@@ -408,7 +407,7 @@ export function SwapHistory(props: PropTypes) {
408
407
  >
409
408
  Skip
410
409
  </Button>
411
- <Spacer size={16} />
410
+ <Divider size={16} direction="horizontal" />
412
411
  <Button
413
412
  variant="contained"
414
413
  type="error"
@@ -34,7 +34,7 @@ export const pendingSwap: PendingSwap = {
34
34
  {
35
35
  swapperId: 'Osmosis',
36
36
  swapperType: 'DEX',
37
- swapperLogo: '',
37
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
38
38
  from: {
39
39
  symbol: 'JUNO',
40
40
  logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
@@ -171,7 +171,7 @@ export const pendingSwap: PendingSwap = {
171
171
  toLogo: 'https://api.rango.exchange/i/mJQPS2',
172
172
  startTransactionTime: 1673164519916,
173
173
  swapperId: 'Osmosis',
174
- swapperLogo: '',
174
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
175
175
  expectedOutputAmountHumanReadable: '1.540670',
176
176
  outputAmount: '1.540658',
177
177
  status: 'running',
@@ -1,17 +1,16 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import { TokenSelector, PropTypes } from './TokenSelector';
4
- import { tokensMeta } from '../TokenList/mockData';
4
+ import { tokensMeta } from '../../components/TokenList/mockData';
5
5
 
6
6
  export default {
7
- title: 'Token Selector',
7
+ title: 'Containers/Token Selector',
8
8
  component: TokenSelector,
9
- argTypes: {
10
- type: {
11
- defaultValue: 'Source',
12
- },
9
+ args: {
10
+ type: 'Source',
11
+ loadingStatus: 'success',
13
12
  },
14
- } as ComponentMeta<typeof TokenSelector>;
13
+ } as Meta<typeof TokenSelector>;
15
14
 
16
15
  export const Main = (args: PropTypes) => (
17
16
  <TokenSelector {...args} list={tokensMeta} selected={tokensMeta[0]} />
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import { containsText } from '../../helper';
3
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
4
- import { TokenList } from '../TokenList';
5
- import { TokenWithAmount } from '../TokenList/TokenList';
3
+
6
4
  import { LoadingStatus } from '../../types/meta';
7
- import { Spinner } from '../Spinner';
8
- import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
9
- import { NotFoundAlert } from '../Alert/NotFoundAlert';
10
5
  import { styled } from '../../theme';
6
+ import { NotFoundAlert } from '../../components/Alert/NotFoundAlert';
7
+ import { LoadingFailedAlert, SecondaryPage, Spinner } from '../../components';
8
+ import {
9
+ TokenList,
10
+ TokenWithAmount,
11
+ } from '../../components/TokenList/TokenList';
11
12
 
12
13
  export const LoaderContainer = styled('div', {
13
14
  display: 'flex',
@@ -1 +1 @@
1
- export { TokenSelector } from './TokenSelector';
1
+ export { TokenSelector } from './TokenSelector';
@@ -1,3 +1,8 @@
1
1
  export * from './ConfirmSwap';
2
2
  export * from './History';
3
3
  export * from './SwapHistory';
4
+ export * from './BlockchainSelector';
5
+ export * from './ConnectWalletsModal';
6
+ export * from './LiquiditySourcesSelector';
7
+ export * from './TokenSelector';
8
+ export * from './Settings';
@@ -29,3 +29,78 @@ export function limitDecimalPlaces(
29
29
  return roundedNumber.toString();
30
30
  }
31
31
  }
32
+
33
+ const hexToRgb = (hex: string) =>
34
+ ((value) =>
35
+ value.length === 3
36
+ ? value.split('').map((c) => parseInt(c.repeat(2), 16))
37
+ : (value.match(/.{1,2}/g) || []).map((v) => parseInt(v, 16)))(
38
+ hex.replace('#', '')
39
+ );
40
+
41
+ const isHexTooDark = (hexColor: string) =>
42
+ (([r, g, b]) => 0.2126 * r + 0.7152 * g + 0.0722 * b < 40)(
43
+ hexToRgb(hexColor)
44
+ );
45
+
46
+ const isHexTooLight = (hexColor: string) =>
47
+ (([r, g, b]) => (r * 299 + g * 587 + b * 114) / 1000 > 155)(
48
+ hexToRgb(hexColor)
49
+ );
50
+
51
+ const colorShade = (col: string, amt: number) => {
52
+ col = col.replace(/^#/, '');
53
+ if (col.length === 3)
54
+ col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
55
+ let [r, g, b]: any = col.match(/.{2}/g);
56
+ [r, g, b] = [
57
+ parseInt(r, 16) + amt,
58
+ parseInt(g, 16) + amt,
59
+ parseInt(b, 16) + amt,
60
+ ];
61
+
62
+ r = Math.max(Math.min(255, r), 0).toString(16);
63
+ g = Math.max(Math.min(255, g), 0).toString(16);
64
+ b = Math.max(Math.min(255, b), 0).toString(16);
65
+
66
+ const rr = (r.length < 2 ? '0' : '') + r;
67
+ const gg = (g.length < 2 ? '0' : '') + g;
68
+ const bb = (b.length < 2 ? '0' : '') + b;
69
+
70
+ return `#${rr}${gg}${bb}`;
71
+ };
72
+
73
+ export const generateRangeColors = (
74
+ name: string,
75
+ mode: 'light' | 'dark',
76
+ color?: string,
77
+ ) => {
78
+ let colors = { [name]: color };
79
+ if (color) {
80
+ let c = color;
81
+ if (isHexTooDark(color) || mode === 'dark') {
82
+ for (let i = 1; i < 10; i++) {
83
+ colors = {
84
+ ...colors,
85
+ [name + i * 100]:
86
+ name === 'neutral'
87
+ ? colorShade(c, i * 15)
88
+ : colorShade(color, i * 5),
89
+ };
90
+ }
91
+ }
92
+ if (isHexTooLight(color) || mode === 'light') {
93
+ for (let i = 1; i < 10; i++) {
94
+ c = colorShade(c, -(i * 5));
95
+ colors = {
96
+ ...colors,
97
+ [name + i * 100]:
98
+ name === 'neutral'
99
+ ? colorShade(c, -(i * 5))
100
+ : colorShade(color, -(i * 5)),
101
+ };
102
+ }
103
+ }
104
+ }
105
+ return colors;
106
+ };
package/src/index.ts CHANGED
@@ -3,3 +3,4 @@ export * from './containers';
3
3
  export * from './theme';
4
4
  export * from './types';
5
5
  export * from './hooks';
6
+ export { generateRangeColors } from './helper';
package/src/theme.ts CHANGED
@@ -2,11 +2,10 @@
2
2
 
3
3
  import { PropertyValue, CreateStitches } from '@stitches/react';
4
4
  import { DefaultThemeMap } from '@stitches/react/types/config';
5
-
6
- // Solution: (https://github.com/stitchesjs/stitches/issues/833#issuecomment-950707025)
7
- const { createStitches } = require('@stitches/react');
5
+ import { createStitches } from '@stitches/react';
8
6
 
9
7
  /* ----------------------- Values ----------------------- */
8
+
10
9
  const theme = {
11
10
  colors: {
12
11
  primary: '#5FA425',
@@ -19,14 +18,16 @@ const theme = {
19
18
  primary700: '#396216',
20
19
  primary800: '#26420F',
21
20
  primary900: '#132107',
22
- neutrals200: '#FAFAFA',
23
- neutrals300: '#EAEAEA',
24
- neutrals400: '#999999',
25
- neutrals500: '#888888',
26
- neutrals600: '#666666',
27
- neutrals700: '#444444',
28
- neutrals800: '#333333',
29
- neutrals900: '#111111',
21
+ surface: '#fff',
22
+ neutral100: '#f3f3f3',
23
+ neutral200: '#FAFAFA',
24
+ neutral300: '#EAEAEA',
25
+ neutral400: '#999999',
26
+ neutral500: '#888888',
27
+ neutral600: '#666666',
28
+ neutral700: '#444444',
29
+ neutral800: '#333333',
30
+ neutral900: '#111111',
30
31
  background: '#fff',
31
32
  foreground: '#000',
32
33
  success: '#0070F3',
@@ -124,36 +125,33 @@ const utils = {
124
125
 
125
126
  const typedCreateStiches = createStitches as CreateStitches;
126
127
 
127
- // Note: it seems there is a bug on tsdx and when it compiles the code, it goes through an error
128
- // We can directly check it with `tsc` to see if the error is correct or not.
129
- // We `ignore` it for now, to get safety check on VSCode.
130
- // @ts-ignore
131
- export const { styled, css, createTheme, keyframes, globalCss } =
132
- typedCreateStiches<
133
- '',
134
- typeof media,
135
- typeof theme,
136
- DefaultThemeMap,
137
- // TODO: Make `utils` typesafe as well.
138
- {}
139
- >({
140
- media,
141
- theme,
142
- utils,
143
- });
128
+ export const { styled, css, createTheme, keyframes, globalCss } = typedCreateStiches<
129
+ '',
130
+ typeof media,
131
+ typeof theme,
132
+ DefaultThemeMap,
133
+ // TODO: Make `utils` typesafe as well.
134
+ {}
135
+ >({
136
+ media,
137
+ theme,
138
+ utils,
139
+ });
144
140
 
145
141
  export const lightTheme = createTheme({});
146
142
 
147
143
  export const darkTheme = createTheme({
148
144
  colors: {
149
- neutrals200: '#111111',
150
- neutrals300: '#333333',
151
- neutrals400: '#444444',
152
- neutrals500: '#666666',
153
- neutrals600: '#888888',
154
- neutrals700: '#999999',
155
- neutrals800: '#EAEAEA',
156
- neutrals900: '#FAFAFA',
145
+ surface: '#000',
146
+ neutral900: '#f3f3f3',
147
+ neutral800: '#FAFAFA',
148
+ neutral700: '#EAEAEA',
149
+ neutral600: '#999999',
150
+ neutral500: '#888888',
151
+ neutral400: '#666666',
152
+ neutral300: '#444444',
153
+ neutral200: '#333333',
154
+ neutral100: '#111111',
157
155
  foreground: '#fff',
158
156
  background: '#000',
159
157
  },
@@ -1,3 +1,3 @@
1
1
  export * from './wallet';
2
2
 
3
- export { BestRouteWithFee } from './swaps';
3
+ export type { BestRouteWithFee } from './swaps';
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export interface PropTypes {
3
- size?: 4 | 8 | 12 | 16 | 18 | 20 | 24;
4
- direction?: 'vertical' | 'horizontal';
5
- }
6
- export declare function Spacer({ size, direction }: PropTypes): JSX.Element;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { PropTypes } from './Spacer';
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, PropTypes>;
4
- export default _default;
5
- export declare const Main: (props: PropTypes) => JSX.Element;
@@ -1 +0,0 @@
1
- export { Spacer } from './Spacer';
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { PropTypes } from './SwapContainer';
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, React.PropsWithChildren<PropTypes>>;
4
- export default _default;
5
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { TokenWithAmount } from '../TokenList/TokenList';
3
- import { LoadingStatus } from '../../types/meta';
4
- export declare const LoaderContainer: any;
5
- export interface PropTypes {
6
- list: TokenWithAmount[];
7
- type?: 'Source' | 'Destination';
8
- selected: TokenWithAmount | null;
9
- onChange: (token: TokenWithAmount) => void;
10
- onBack?: () => void;
11
- loadingStatus: LoadingStatus;
12
- hasHeader?: boolean;
13
- }
14
- export declare function TokenSelector(props: PropTypes): JSX.Element;