@rango-dev/ui 0.15.1-next.9 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +4 -4
  4. package/dist/translations/en.d.ts.map +1 -1
  5. package/dist/translations/es.d.ts.map +1 -1
  6. package/dist/translations/fr.d.ts.map +1 -1
  7. package/dist/translations/jp.d.ts.map +1 -1
  8. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +18 -3
  9. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
  10. package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts +55 -9
  12. package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +1 -1
  13. package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts +1 -0
  14. package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts.map +1 -1
  15. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts +12 -2
  16. package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts.map +1 -1
  17. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +6 -1
  18. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +1 -1
  19. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
  20. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
  21. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +156 -0
  22. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
  23. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
  24. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
  25. package/dist/widget/ui/src/components/BlockchainsChip/index.d.ts +2 -0
  26. package/dist/widget/ui/src/components/BlockchainsChip/index.d.ts.map +1 -0
  27. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +12 -2
  28. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/Button/Button.styles.d.ts +18 -3
  30. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  31. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +12 -2
  32. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
  33. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +24 -4
  34. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
  35. package/dist/widget/ui/src/components/Checkbox/Checkbox.types.d.ts +2 -1
  36. package/dist/widget/ui/src/components/Checkbox/Checkbox.types.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +6 -1
  38. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
  39. package/dist/widget/ui/src/components/Collapsible/Collapsible.d.ts +5 -0
  40. package/dist/widget/ui/src/components/Collapsible/Collapsible.d.ts.map +1 -0
  41. package/dist/widget/ui/src/components/Collapsible/Collapsible.stories.d.ts +23 -0
  42. package/dist/widget/ui/src/components/Collapsible/Collapsible.stories.d.ts.map +1 -0
  43. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +156 -0
  44. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -0
  45. package/dist/widget/ui/src/components/Collapsible/Collapsible.types.d.ts +7 -0
  46. package/dist/widget/ui/src/components/Collapsible/Collapsible.types.d.ts.map +1 -0
  47. package/dist/widget/ui/src/components/Collapsible/index.d.ts +2 -0
  48. package/dist/widget/ui/src/components/Collapsible/index.d.ts.map +1 -0
  49. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +30 -5
  50. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
  51. package/dist/widget/ui/src/components/Header/Header.styles.d.ts +12 -2
  52. package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +6 -1
  54. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/Icon/common.d.ts +14 -4
  56. package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/IconButton/IconButton.d.ts +3 -5
  58. package/dist/widget/ui/src/components/IconButton/IconButton.d.ts.map +1 -1
  59. package/dist/widget/ui/src/components/List/List.styles.d.ts +6 -1
  60. package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
  61. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +6 -1
  62. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  63. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +6 -1
  64. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  65. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +6 -1
  66. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
  67. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +18 -3
  68. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
  69. package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
  70. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +36 -6
  71. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
  72. package/dist/widget/ui/src/components/Modal/index.d.ts +1 -0
  73. package/dist/widget/ui/src/components/Modal/index.d.ts.map +1 -1
  74. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +6 -1
  75. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
  76. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +12 -2
  77. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  78. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +6 -1
  79. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  80. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +12 -2
  81. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
  82. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +24 -4
  83. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
  84. package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts +6 -1
  85. package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts.map +1 -1
  86. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +6 -1
  87. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
  88. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
  89. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
  90. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
  91. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
  92. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +460 -0
  93. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
  94. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +15 -0
  95. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
  96. package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +3 -0
  97. package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts.map +1 -0
  98. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +6 -1
  99. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
  100. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  101. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +30 -5
  102. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
  103. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +7 -2
  104. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
  105. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +6 -1
  106. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
  107. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +36 -6
  108. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
  109. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +54 -9
  110. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
  111. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +12 -2
  112. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  113. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +18 -3
  114. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
  115. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  116. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +314 -1
  117. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  118. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +6 -1
  119. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
  120. package/dist/widget/ui/src/components/Wallet/Wallet.helpers.d.ts.map +1 -1
  121. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +30 -5
  122. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
  123. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +1 -0
  124. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
  125. package/dist/widget/ui/src/components/common/FilledCircle.d.ts +6 -1
  126. package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
  127. package/dist/widget/ui/src/components/common/styles.d.ts +6 -1
  128. package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
  129. package/dist/widget/ui/src/components/index.d.ts +3 -0
  130. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  131. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +60 -10
  132. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
  133. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  134. package/dist/widget/ui/src/containers/SwapInput/SwapInput.stories.d.ts.map +1 -1
  135. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +18 -3
  136. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  137. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +4 -6
  138. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  139. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +13 -5
  140. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  141. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +6 -1
  142. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
  143. package/dist/widget/ui/src/hooks/index.d.ts +0 -1
  144. package/dist/widget/ui/src/hooks/index.d.ts.map +1 -1
  145. package/dist/widget/ui/src/icons/BorderRadius.d.ts +5 -0
  146. package/dist/widget/ui/src/icons/BorderRadius.d.ts.map +1 -0
  147. package/dist/widget/ui/src/icons/Desktop.d.ts +5 -0
  148. package/dist/widget/ui/src/icons/Desktop.d.ts.map +1 -0
  149. package/dist/widget/ui/src/icons/Font.d.ts +5 -0
  150. package/dist/widget/ui/src/icons/Font.d.ts.map +1 -0
  151. package/dist/widget/ui/src/icons/LogoWithText.d.ts +5 -0
  152. package/dist/widget/ui/src/icons/LogoWithText.d.ts.map +1 -0
  153. package/dist/widget/ui/src/icons/index.d.ts +5 -1
  154. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  155. package/dist/widget/ui/src/theme.d.ts +60 -10
  156. package/dist/widget/ui/src/theme.d.ts.map +1 -1
  157. package/package.json +2 -2
  158. package/src/components/BestRoute/BestRoute.styles.ts +55 -9
  159. package/src/components/BestRoute/BestRoute.tsx +10 -3
  160. package/src/components/BestRoute/BestRoute.types.ts +1 -0
  161. package/src/components/BestRoute/BestRouteSkeleton.styles.ts +6 -2
  162. package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +43 -0
  163. package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
  164. package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
  165. package/src/components/BlockchainsChip/index.ts +1 -0
  166. package/src/components/Button/Button.styles.tsx +122 -32
  167. package/src/components/ChainToken/ChainToken.tsx +3 -3
  168. package/src/components/Checkbox/Checkbox.styles.ts +7 -6
  169. package/src/components/Checkbox/Checkbox.types.ts +1 -1
  170. package/src/components/Chip/Chip.styles.ts +14 -4
  171. package/src/components/Collapsible/Collapsible.stories.tsx +46 -0
  172. package/src/components/Collapsible/Collapsible.styles.ts +9 -0
  173. package/src/components/Collapsible/Collapsible.tsx +21 -0
  174. package/src/components/Collapsible/Collapsible.types.ts +7 -0
  175. package/src/components/Collapsible/index.ts +1 -0
  176. package/src/components/Header/Header.styles.ts +8 -4
  177. package/src/components/IconButton/IconButton.tsx +8 -2
  178. package/src/components/ListItem/ListItem.styles.ts +7 -2
  179. package/src/components/ListItemButton/ListItemButton.styles.ts +9 -3
  180. package/src/components/MessageBox/CollapsibleMessageBox.styles.tsx +14 -2
  181. package/src/components/MessageBox/MessageBox.styles.tsx +26 -6
  182. package/src/components/Modal/Modal.styles.ts +4 -4
  183. package/src/components/Modal/Modal.tsx +2 -10
  184. package/src/components/Modal/index.ts +1 -0
  185. package/src/components/Radio/Radio.styles.tsx +7 -6
  186. package/src/components/RouteCost/RouteCost.tsx +1 -1
  187. package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +35 -0
  188. package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
  189. package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +76 -0
  190. package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +16 -0
  191. package/src/components/SelectableCategoryList/index.ts +2 -0
  192. package/src/components/StepDetails/StepDetails.styles.ts +5 -2
  193. package/src/components/StepDetails/StepDetails.tsx +11 -1
  194. package/src/components/SwapListItem/SwapListItem.styles.ts +17 -4
  195. package/src/components/SwapListItem/SwapToken.tsx +4 -4
  196. package/src/components/Switch/Switch.styles.tsx +7 -7
  197. package/src/components/TextField/TextField.styles.ts +10 -3
  198. package/src/components/Tooltip/Tooltip.styles.ts +10 -0
  199. package/src/components/Tooltip/Tooltip.tsx +9 -4
  200. package/src/components/Wallet/ClickableWallet.tsx +1 -1
  201. package/src/components/Wallet/Wallet.helpers.ts +11 -9
  202. package/src/components/Wallet/Wallet.styles.ts +20 -3
  203. package/src/components/Wallet/Wallet.types.ts +1 -0
  204. package/src/components/index.ts +3 -0
  205. package/src/containers/SwapInput/SwapInput.stories.tsx +1 -0
  206. package/src/containers/SwapInput/SwapInput.styles.ts +5 -1
  207. package/src/containers/SwapInput/SwapInput.tsx +7 -4
  208. package/src/containers/SwapInput/SwapInput.types.ts +4 -7
  209. package/src/containers/SwapInput/TokenSection.styles.ts +21 -17
  210. package/src/containers/SwapInput/TokenSection.tsx +2 -2
  211. package/src/hooks/index.ts +0 -1
  212. package/src/icons/BorderRadius.tsx +21 -0
  213. package/src/icons/Desktop.tsx +271 -0
  214. package/src/icons/Font.tsx +27 -0
  215. package/src/icons/LogoWithText.tsx +159 -0
  216. package/src/icons/index.ts +5 -1
  217. package/src/theme.ts +6 -1
  218. package/dist/widget/ui/src/hooks/usePaddingRight.d.ts +0 -8
  219. package/dist/widget/ui/src/hooks/usePaddingRight.d.ts.map +0 -1
  220. package/src/hooks/usePaddingRight.ts +0 -41
@@ -1,4 +1,4 @@
1
- import { styled } from '../../theme';
1
+ import { darkTheme, styled } from '../../theme';
2
2
 
3
3
  export const Container = styled('div', {
4
4
  display: 'flex',
@@ -21,19 +21,39 @@ export const IconHighlight = styled('div', {
21
21
  variants: {
22
22
  type: {
23
23
  success: {
24
- backgroundColor: '$success300',
24
+ $$color: '$colors$success300',
25
+ [`.${darkTheme} &`]: {
26
+ $$color: '$colors$success600',
27
+ },
28
+ backgroundColor: '$$color',
25
29
  },
26
30
  warning: {
27
- backgroundColor: '$warning300',
31
+ $$color: '$colors$warning300',
32
+ [`.${darkTheme} &`]: {
33
+ $$color: '$colors$warning600',
34
+ },
35
+ backgroundColor: '$$color',
28
36
  },
29
37
  error: {
30
- backgroundColor: '$error300',
38
+ $$color: '$colors$error300',
39
+ [`.${darkTheme} &`]: {
40
+ $$color: '$colors$error600',
41
+ },
42
+ backgroundColor: '$$color',
31
43
  },
32
44
  info: {
33
- backgroundColor: '$info300',
45
+ $$color: '$colors$info300',
46
+ [`.${darkTheme} &`]: {
47
+ $$color: '$colors$info600',
48
+ },
49
+ backgroundColor: '$$color',
34
50
  },
35
51
  loading: {
36
- backgroundColor: '$info300',
52
+ $$color: '$colors$info300',
53
+ [`.${darkTheme} &`]: {
54
+ $$color: '$colors$info600',
55
+ },
56
+ backgroundColor: '$$color',
37
57
  },
38
58
  },
39
59
  },
@@ -7,9 +7,9 @@ export const BackDrop = styled('div', {
7
7
  left: '0',
8
8
  width: '100%',
9
9
  height: '100%',
10
- backgroundColor: 'rgba(0,0,0,0)',
10
+ backgroundColor: 'transparent',
11
11
  zIndex: 10,
12
- borderRadius: '20px',
12
+ borderRadius: '$primary',
13
13
  display: 'flex',
14
14
  overflow: 'hidden',
15
15
  transition: 'background .35s',
@@ -28,7 +28,7 @@ export const BackDrop = styled('div', {
28
28
  },
29
29
  active: {
30
30
  true: {
31
- backgroundColor: 'rgba(0,0,0,.1)',
31
+ backgroundColor: 'color-mix(in srgb, $neutral500 70%, transparent)',
32
32
  },
33
33
  },
34
34
  },
@@ -37,7 +37,7 @@ export const BackDrop = styled('div', {
37
37
  export const ModalContainer = styled('div', {
38
38
  backgroundColor: '$background',
39
39
  width: '100%',
40
- borderRadius: '20px',
40
+ borderRadius: '$primary',
41
41
  display: 'flex',
42
42
  flexDirection: 'column',
43
43
  zIndex: 9999999,
@@ -4,9 +4,7 @@ import type { PropsWithChildren } from 'react';
4
4
  import React, { useEffect, useRef, useState } from 'react';
5
5
  import { createPortal } from 'react-dom';
6
6
 
7
- import { usePaddingRight } from '../../hooks';
8
7
  import { CloseIcon } from '../../icons';
9
- import { theme } from '../../theme';
10
8
  import { BottomLogo } from '../BottomLogo';
11
9
  import { Divider } from '../Divider';
12
10
  import { IconButton } from '../IconButton/IconButton';
@@ -23,7 +21,6 @@ import {
23
21
 
24
22
  const CLOSED_DELAY = 600;
25
23
  const OPEN_DELAY = 10;
26
- const DEFAULT_CONTENT_PADDING = 20;
27
24
 
28
25
  export function Modal(props: PropsWithChildren<PropTypes>) {
29
26
  const {
@@ -44,11 +41,6 @@ export function Modal(props: PropsWithChildren<PropTypes>) {
44
41
  const [active, setActive] = useState(false);
45
42
  const [isMount, setIsMount] = useState(false);
46
43
  const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
47
- const contentRef = useRef<HTMLDivElement | null>(null);
48
- usePaddingRight({
49
- elementRef: contentRef,
50
- paddingRight: theme.sizes[DEFAULT_CONTENT_PADDING],
51
- });
52
44
 
53
45
  const handleBackDropClick = (event: React.MouseEvent<HTMLDivElement>) => {
54
46
  if (event.target === event.currentTarget && dismissible) {
@@ -95,7 +87,7 @@ export function Modal(props: PropsWithChildren<PropTypes>) {
95
87
  css={containerStyle}
96
88
  anchor={anchor}>
97
89
  {header ?? (
98
- <ModalHeader noTitle={!title}>
90
+ <ModalHeader noTitle={!title && dismissible && !prefix}>
99
91
  {prefix}
100
92
  {title && (
101
93
  <Typography variant="title" size="small">
@@ -112,7 +104,7 @@ export function Modal(props: PropsWithChildren<PropTypes>) {
112
104
  </Flex>
113
105
  </ModalHeader>
114
106
  )}
115
- <Content ref={contentRef}>{children}</Content>
107
+ <Content>{children}</Content>
116
108
  {(hasLogo || footer) && (
117
109
  <Footer>
118
110
  <div className="footer__content">{footer}</div>
@@ -1 +1,2 @@
1
1
  export { Modal } from './Modal';
2
+ export { ModalHeader } from './Modal.styles';
@@ -1,6 +1,6 @@
1
1
  import * as Radio from '@radix-ui/react-radio-group';
2
2
 
3
- import { styled } from '../../theme';
3
+ import { darkTheme, styled } from '../../theme';
4
4
 
5
5
  export const StyledItem = styled(Radio.Item, {
6
6
  padding: '0',
@@ -11,12 +11,13 @@ export const StyledItem = styled(Radio.Item, {
11
11
  backgroundColor: 'transparent',
12
12
  border: '1px solid $neutral800',
13
13
 
14
- '&:hover': {
15
- borderColor: '$secondary600',
16
- },
17
14
  '&[data-state="checked"]': {
18
- backgroundColor: '$secondary600',
19
- borderColor: '$secondary600',
15
+ $$color: '$colors$secondary500',
16
+ [`.${darkTheme} &`]: {
17
+ $$color: '$colors$secondary400',
18
+ },
19
+ backgroundColor: '$$color',
20
+ borderColor: '$$color',
20
21
  },
21
22
  });
22
23
 
@@ -26,7 +26,7 @@ export function RouteCost(props: PropTypes) {
26
26
  <TimeIcon size={12} color="gray" />
27
27
  </div>
28
28
  <Typography ml={2} align="center" variant="body" size="small">
29
- {`${time} min`}
29
+ {time}
30
30
  </Typography>
31
31
  </div>
32
32
  <Separator />
@@ -0,0 +1,35 @@
1
+ import { type BlockchainMeta, TransactionType } from 'rango-sdk';
2
+
3
+ import { BlockchainCategories } from './SelectableCategoryList.types';
4
+
5
+ const filterByType = (blockchain: BlockchainMeta, type: string): boolean => {
6
+ switch (type) {
7
+ case BlockchainCategories.ALL:
8
+ return true;
9
+ case BlockchainCategories.UTXO:
10
+ return blockchain.type === TransactionType.TRANSFER;
11
+ case BlockchainCategories.OTHER:
12
+ return (
13
+ blockchain.type !== TransactionType.TRANSFER &&
14
+ blockchain.type !== TransactionType.COSMOS &&
15
+ blockchain.type !== TransactionType.EVM
16
+ );
17
+ default:
18
+ return blockchain.type === type;
19
+ }
20
+ };
21
+
22
+ const blockchainslogo = {
23
+ [BlockchainCategories.EVM]: ['ETH', 'BSC', 'POLYGON'],
24
+ [BlockchainCategories.COSMOS]: ['COSMOS', 'OSMOSIS', 'JUNO'],
25
+ [BlockchainCategories.UTXO]: ['BTC', 'LTC', 'BCH'],
26
+ [BlockchainCategories.OTHER]: ['STARKNET', 'TRON', 'SOLANA'],
27
+ };
28
+
29
+ export const generateBlockchainsLogo = (
30
+ list: BlockchainMeta[],
31
+ type: Exclude<BlockchainCategories, 'ALL'>
32
+ ) =>
33
+ list
34
+ .filter((item) => filterByType(item, type))
35
+ .filter((item) => blockchainslogo[type].includes(item.name));
@@ -0,0 +1,21 @@
1
+ import { styled } from '../../theme';
2
+
3
+ export const Container = styled('div', {
4
+ display: 'grid',
5
+ gap: '$10',
6
+ gridTemplateColumns: 'auto 1fr 1fr 1fr 1fr',
7
+ });
8
+
9
+ export const ImageContent = styled('div', {
10
+ display: 'flex',
11
+ position: 'relative',
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ paddingTop: '$10',
15
+ });
16
+ export const FirstImage = styled('img', {
17
+ position: 'absolute',
18
+ top: -2,
19
+ width: 15,
20
+ height: 15,
21
+ });
@@ -0,0 +1,76 @@
1
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
2
+ import type { PropTypes } from './SelectableCategoryList.types';
3
+
4
+ import { i18n } from '@lingui/core';
5
+ import React from 'react';
6
+
7
+ import { Divider, Image, Skeleton, Typography } from '..';
8
+ import { BlockchainsChip } from '../BlockchainsChip';
9
+
10
+ import { generateBlockchainsLogo } from './SelectableCategoryList.helpers';
11
+ import {
12
+ Container,
13
+ FirstImage,
14
+ ImageContent,
15
+ } from './SelectableCategoryList.styles';
16
+ import { BlockchainCategories } from './SelectableCategoryList.types';
17
+
18
+ export function SelectableCategoryList(props: PropTypes) {
19
+ const { setCategory, category, blockchains, isLoading } = props;
20
+ const categories = Object.keys(
21
+ BlockchainCategories
22
+ ) as BlockchainCategories[];
23
+ return (
24
+ <Container>
25
+ {isLoading &&
26
+ Array.from(Array(5), (_, index) => (
27
+ <Skeleton
28
+ key={index}
29
+ variant="rounded"
30
+ height={70}
31
+ width={index === 0 ? 45 : 65}
32
+ />
33
+ ))}
34
+ {!isLoading &&
35
+ categories.map((blockchainCategory) => (
36
+ <BlockchainsChip
37
+ selected={category === blockchainCategory}
38
+ key={blockchainCategory}
39
+ onClick={() => setCategory(blockchainCategory)}>
40
+ {blockchainCategory !== BlockchainCategories.ALL && (
41
+ <>
42
+ <ImageContent>
43
+ {generateBlockchainsLogo(blockchains, blockchainCategory).map(
44
+ (blockchain, index) =>
45
+ index === 0 ? (
46
+ <FirstImage
47
+ key={`image-${blockchain.name}-${blockchain.chainId}`}
48
+ src={blockchain.logo}
49
+ />
50
+ ) : (
51
+ <Image
52
+ key={`image-${blockchain.name}-${blockchain.chainId}`}
53
+ src={blockchain.logo}
54
+ size={15}
55
+ />
56
+ )
57
+ )}
58
+ </ImageContent>
59
+ <Divider size={12} />
60
+ </>
61
+ )}
62
+ <Typography
63
+ size="xsmall"
64
+ variant="body"
65
+ color={
66
+ blockchainCategory === BlockchainCategories.ALL
67
+ ? 'secondary500'
68
+ : undefined
69
+ }>
70
+ {i18n.t(BlockchainCategories[blockchainCategory])}
71
+ </Typography>
72
+ </BlockchainsChip>
73
+ ))}
74
+ </Container>
75
+ );
76
+ }
@@ -0,0 +1,16 @@
1
+ import type { BlockchainMeta } from 'rango-sdk';
2
+
3
+ export interface PropTypes {
4
+ setCategory: (type: string) => void;
5
+ category: string;
6
+ blockchains: BlockchainMeta[];
7
+ isLoading?: boolean;
8
+ }
9
+
10
+ export enum BlockchainCategories {
11
+ ALL = 'ALL',
12
+ EVM = 'EVM',
13
+ COSMOS = 'COSMOS',
14
+ UTXO = 'UTXO',
15
+ OTHER = 'OTHER',
16
+ }
@@ -0,0 +1,2 @@
1
+ export { SelectableCategoryList } from './SelectableCategoryList';
2
+ export { BlockchainCategories } from './SelectableCategoryList.types';
@@ -1,4 +1,4 @@
1
- import { styled } from '../../theme';
1
+ import { darkTheme, styled } from '../../theme';
2
2
 
3
3
  export const Container = styled('div', {
4
4
  width: '100%',
@@ -10,7 +10,10 @@ export const Container = styled('div', {
10
10
  type: {
11
11
  'route-details': { border: 'none' },
12
12
  'route-progress': {
13
- backgroundColor: '$neutral100',
13
+ $$color: '$colors$neutral100',
14
+ [`.${darkTheme} &`]: {
15
+ $$color: '$colors$neutral300',
16
+ },
14
17
  borderRadius: '$xm',
15
18
  padding: '$10 $15',
16
19
  marginBottom: '15px',
@@ -1,5 +1,6 @@
1
1
  import type { StepDetailsProps } from './StepDetails.types';
2
2
 
3
+ import { i18n } from '@lingui/core';
3
4
  import React, { forwardRef, memo, useEffect, useRef } from 'react';
4
5
 
5
6
  import { ChainToken } from '../../components/ChainToken/ChainToken';
@@ -49,7 +50,16 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
49
50
  className="swapper__description"
50
51
  ml={8}
51
52
  size="small"
52
- variant="body">{`Swap on ${step.from.chain.displayName} via ${step.swapper.displayName}`}</Typography>
53
+ variant="body">
54
+ {i18n.t({
55
+ id: 'swapperDescription',
56
+ message: 'Swap on {fromChain} via {swapper}',
57
+ values: {
58
+ fromChain: step.from.chain.displayName,
59
+ swapper: step.swapper.displayName,
60
+ },
61
+ })}
62
+ </Typography>
53
63
  </div>
54
64
  <div className="step-info">
55
65
  <DashedLine invisible={!hasSeparator || type === 'route-progress'} />
@@ -17,22 +17,31 @@ export const Header = styled('div', {
17
17
  });
18
18
 
19
19
  export const Main = styled('button', {
20
- backgroundColor: '$neutral100',
20
+ $$color: '$colors$neutral100',
21
+ [`.${darkTheme} &`]: {
22
+ $$color: '$colors$neutral300',
23
+ },
24
+ backgroundColor: '$$color',
21
25
  border: 'none',
22
26
  width: '100%',
23
27
  borderRadius: '$xm',
24
28
  gap: 10,
25
29
  padding: 15,
26
30
  cursor: 'pointer',
31
+ fontFamily: 'inherit',
27
32
  '&:hover': {
28
33
  $$color: '$colors$info100',
29
34
  [`.${darkTheme} &`]: {
30
- $$color: '$colors$neutral400',
35
+ $$color: '$colors$neutral100',
31
36
  },
32
37
  backgroundColor: '$$color',
33
38
  },
34
39
  '&:focus-visible': {
35
- backgroundColor: '$surface600',
40
+ $$color: '$colors$info100',
41
+ [`.${darkTheme} &`]: {
42
+ $$color: '$colors$info700',
43
+ },
44
+ backgroundColor: '$$color',
36
45
  outline: 'none',
37
46
  },
38
47
  });
@@ -44,7 +53,11 @@ export const Date = styled('div', {
44
53
  });
45
54
 
46
55
  export const LoadingMain = styled('div', {
47
- backgroundColor: '$neutral100',
56
+ $$color: '$colors$neutral100',
57
+ [`.${darkTheme} &`]: {
58
+ $$color: '$colors$neutral300',
59
+ },
60
+ backgroundColor: '$$color',
48
61
  border: 'none',
49
62
  width: '100%',
50
63
  borderRadius: '$xm',
@@ -104,13 +104,13 @@ export function SwapToken(props: PropTypes) {
104
104
  {status === 'running' ? (
105
105
  <Layout direction="column">
106
106
  <TopSection>
107
- <Typography size="xsmall" variant="headline">
107
+ <Typography size="medium" variant="title">
108
108
  {fromToken.displayName}
109
109
  </Typography>
110
110
  <Icon>
111
111
  <NextIcon size={24} color="black" />
112
112
  </Icon>
113
- <Typography size="xsmall" variant="headline">
113
+ <Typography size="medium" variant="title">
114
114
  {toToken.displayName}
115
115
  </Typography>
116
116
  </TopSection>
@@ -121,7 +121,7 @@ export function SwapToken(props: PropTypes) {
121
121
  ) : (
122
122
  <Layout direction="row">
123
123
  <TokenInfo>
124
- <Typography size="xsmall" variant="headline">
124
+ <Typography size="medium" variant="title">
125
125
  {fromToken.displayName}
126
126
  </Typography>
127
127
  {!!fromAmount && (
@@ -134,7 +134,7 @@ export function SwapToken(props: PropTypes) {
134
134
  <NextIcon size={24} color="black" />
135
135
  </Icon>
136
136
  <TokenInfo>
137
- <Typography size="xsmall" variant="headline">
137
+ <Typography size="medium" variant="title">
138
138
  {toToken.displayName}
139
139
  </Typography>
140
140
 
@@ -1,6 +1,6 @@
1
1
  import * as RadixSwitch from '@radix-ui/react-switch';
2
2
 
3
- import { styled } from '../../theme';
3
+ import { darkTheme, styled } from '../../theme';
4
4
 
5
5
  export const StyledSwitchRoot = styled(RadixSwitch.Root, {
6
6
  boxSizing: 'border-box',
@@ -16,13 +16,13 @@ export const StyledSwitchRoot = styled(RadixSwitch.Root, {
16
16
  cursor: 'pointer',
17
17
  transition: 'all 0.35s',
18
18
 
19
- '&:hover': {
20
- backgroundColor: '$secondary500',
21
- borderColor: '$secondary500',
22
- },
23
19
  '&[data-state="checked"]': {
24
- backgroundColor: '$secondary600',
25
- borderColor: '$secondary600',
20
+ $$color: '$colors$secondary500',
21
+ [`.${darkTheme} &`]: {
22
+ $$color: '$colors$secondary400',
23
+ },
24
+ backgroundColor: '$$color',
25
+ borderColor: '$$color',
26
26
  },
27
27
  '-webkit-tap-highlight-color': 'rgba(0, 0, 0, 0)',
28
28
  });
@@ -25,11 +25,15 @@ export const InputContainer = styled('div', {
25
25
  },
26
26
  variant: {
27
27
  contained: {
28
- backgroundColor: '$neutral100',
28
+ $$color: '$colors$neutral100',
29
+ [`.${darkTheme} &`]: {
30
+ $$color: '$colors$neutral300',
31
+ },
32
+ backgroundColor: '$$color',
29
33
  '&:hover': {
30
34
  $$color: '$colors$info100',
31
35
  [`.${darkTheme} &`]: {
32
- $$color: '$colors$neutral400',
36
+ $$color: '$colors$neutral100',
33
37
  },
34
38
  backgroundColor: '$$color',
35
39
  },
@@ -86,7 +90,7 @@ export const Input = styled('input', {
86
90
  fontWeight: 400,
87
91
  border: 'none',
88
92
  outline: 'none',
89
- width: '100%',
93
+ fontFamily: 'inherit',
90
94
  variants: {
91
95
  suffix: {
92
96
  true: { marginRight: '$10' },
@@ -109,6 +113,9 @@ export const Input = styled('input', {
109
113
  '&::placeholder, &::-webkit-input-placeholder': {
110
114
  color: '$neutral900',
111
115
  },
116
+ '&:focus-within': {
117
+ outline: 'none',
118
+ },
112
119
  });
113
120
 
114
121
  export const Label = styled('label', {
@@ -1,6 +1,16 @@
1
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
2
+
1
3
  import { styled } from '../../theme';
2
4
  import { Typography } from '../Typography';
3
5
 
6
+ export const TooltipContent = styled(RadixTooltip.Content, {
7
+ zIndex: '999999',
8
+ });
9
+
10
+ export const TooltipArrow = styled(RadixTooltip.Arrow, {
11
+ fill: '$neutral100',
12
+ });
13
+
4
14
  export const TooltipTypography = styled(Typography, {
5
15
  borderRadius: '$md',
6
16
  padding: '$5 $10',
@@ -4,7 +4,11 @@ import type { PropsWithChildren } from 'react';
4
4
  import * as RadixTooltip from '@radix-ui/react-tooltip';
5
5
  import React from 'react';
6
6
 
7
- import { TooltipTypography } from './Tooltip.styles';
7
+ import {
8
+ TooltipArrow,
9
+ TooltipContent,
10
+ TooltipTypography,
11
+ } from './Tooltip.styles';
8
12
 
9
13
  export function Tooltip(props: PropsWithChildren<PropTypes>) {
10
14
  const {
@@ -16,17 +20,18 @@ export function Tooltip(props: PropsWithChildren<PropTypes>) {
16
20
  side = 'top',
17
21
  } = props;
18
22
  return (
19
- <RadixTooltip.Provider>
23
+ <RadixTooltip.Provider delayDuration={0}>
20
24
  <RadixTooltip.Root>
21
25
  <RadixTooltip.Trigger asChild>
22
26
  <div>{children}</div>
23
27
  </RadixTooltip.Trigger>
24
28
  <RadixTooltip.Portal container={container}>
25
- <RadixTooltip.Content side={side} sideOffset={sideOffset}>
29
+ <TooltipContent side={side} sideOffset={sideOffset}>
26
30
  <TooltipTypography variant="label" size="medium" color={color}>
27
31
  {content}
28
32
  </TooltipTypography>
29
- </RadixTooltip.Content>
33
+ <TooltipArrow />
34
+ </TooltipContent>
30
35
  </RadixTooltip.Portal>
31
36
  </RadixTooltip.Root>
32
37
  </RadixTooltip.Provider>
@@ -36,7 +36,7 @@ function Wallet(props: WalletPropTypes) {
36
36
  }
37
37
 
38
38
  return (
39
- <Tooltip content={info.tooltipText} side="top">
39
+ <Tooltip container={props.container} content={info.tooltipText} side="top">
40
40
  <WalletButton
41
41
  disabled={props.state == WalletState.CONNECTING}
42
42
  onClick={() => {
@@ -1,5 +1,7 @@
1
1
  import type { Info } from './Wallet.types';
2
2
 
3
+ import { i18n } from '@lingui/core';
4
+
3
5
  import { WalletState } from './Wallet.types';
4
6
 
5
7
  export function makeInfo(state: WalletState): Info {
@@ -7,28 +9,28 @@ export function makeInfo(state: WalletState): Info {
7
9
  case WalletState.CONNECTED:
8
10
  return {
9
11
  color: 'success500',
10
- description: 'Connected',
11
- tooltipText: 'Disconnect',
12
+ description: i18n.t('Connected'),
13
+ tooltipText: i18n.t('Disconnect'),
12
14
  };
13
15
  case WalletState.NOT_INSTALLED:
14
16
  return {
15
17
  color: 'info500',
16
- description: 'Install',
17
- tooltipText: 'Install',
18
+ description: i18n.t('Install'),
19
+ tooltipText: i18n.t('Install'),
18
20
  };
19
21
  case WalletState.CONNECTING:
20
22
  return {
21
23
  color: 'neutral800',
22
- description: 'Connecting...',
23
- tooltipText: 'Connecting',
24
+ description: i18n.t('Connecting...'),
25
+ tooltipText: i18n.t('Connecting'),
24
26
  };
25
27
  case WalletState.DISCONNECTED:
26
28
  return {
27
29
  color: 'neutral800',
28
- description: 'Disconnected',
29
- tooltipText: 'Connect',
30
+ description: i18n.t('Disconnected'),
31
+ tooltipText: i18n.t('Connect'),
30
32
  };
31
33
  default:
32
- throw new Error('you need to pass a correct state to Wallet.');
34
+ throw new Error(i18n.t('you need to pass a correct state to Wallet.'));
33
35
  }
34
36
  }
@@ -23,23 +23,40 @@ export const WalletButton = styled('button', {
23
23
  border: '0',
24
24
  display: 'flex',
25
25
  flexDirection: 'column',
26
- backgroundColor: '$neutral100',
26
+ $$color: '$colors$neutral100',
27
+ [`.${darkTheme} &`]: {
28
+ $$color: '$colors$neutral300',
29
+ },
30
+ backgroundColor: '$$color',
27
31
  alignItems: 'center',
28
32
  cursor: 'pointer',
29
33
  width: 110,
30
34
  position: 'relative',
35
+ fontFamily: 'inherit',
31
36
  '&:hover': {
32
37
  $$color: '$colors$info100',
33
38
  [`.${darkTheme} &`]: {
34
- $$color: '$colors$neutral400',
39
+ $$color: '$colors$neutral100',
40
+ },
41
+ backgroundColor: '$$color',
42
+ },
43
+ '&:focus-visible': {
44
+ $$color: '$colors$info100',
45
+ [`.${darkTheme} &`]: {
46
+ $$color: '$colors$info700',
35
47
  },
36
48
  backgroundColor: '$$color',
49
+ outline: 0,
37
50
  },
38
51
  variants: {
39
52
  selected: {
40
53
  true: {
41
54
  outlineWidth: 1,
42
- outlineColor: '$secondary500',
55
+ $$outline: '$colors$secondary500',
56
+ [`.${darkTheme} &`]: {
57
+ $$outline: '$colors$secondary400',
58
+ },
59
+ outlineColor: '$$outline',
43
60
  outlineStyle: 'solid',
44
61
  },
45
62
  },