@rango-dev/ui 0.26.1-next.0 → 0.26.1-next.10

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 (196) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/index.js.map +4 -4
  3. package/dist/translations/en.d.ts.map +1 -1
  4. package/dist/translations/es.d.ts.map +1 -1
  5. package/dist/translations/fr.d.ts.map +1 -1
  6. package/dist/translations/ja.d.ts.map +1 -1
  7. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +16 -0
  8. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
  9. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +4 -0
  10. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +8 -0
  12. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
  13. package/dist/widget/ui/src/components/Button/Button.d.ts +1 -0
  14. package/dist/widget/ui/src/components/Button/Button.d.ts.map +1 -1
  15. package/dist/widget/ui/src/components/Button/Button.styles.d.ts +12 -0
  16. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  17. package/dist/widget/ui/src/components/Button/Button.types.d.ts +1 -0
  18. package/dist/widget/ui/src/components/Button/Button.types.d.ts.map +1 -1
  19. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +8 -0
  20. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
  21. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +16 -0
  22. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
  23. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +4 -0
  24. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
  25. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +4 -0
  26. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -1
  27. package/dist/widget/ui/src/components/Divider/Divider.d.ts +2 -5
  28. package/dist/widget/ui/src/components/Divider/Divider.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +165 -0
  30. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -0
  31. package/dist/widget/ui/src/components/Divider/Divider.types.d.ts +10 -0
  32. package/dist/widget/ui/src/components/Divider/Divider.types.d.ts.map +1 -0
  33. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +20 -0
  34. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
  35. package/dist/widget/ui/src/components/Header/Header.styles.d.ts +8 -0
  36. package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +4 -0
  38. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
  39. package/dist/widget/ui/src/components/Icon/common.d.ts +8 -0
  40. package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
  41. package/dist/widget/ui/src/components/List/List.styles.d.ts +4 -0
  42. package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
  43. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +4 -0
  44. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  45. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +4 -0
  46. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  47. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +4 -0
  48. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
  49. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +12 -0
  50. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
  51. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +24 -0
  52. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +4 -0
  54. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +8 -0
  56. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.d.ts.map +1 -1
  58. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +8 -0
  59. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  60. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts +6 -0
  61. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts.map +1 -1
  62. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +1 -1
  63. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +16 -0
  64. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -1
  65. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts +4 -0
  66. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -1
  67. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +8 -0
  68. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
  69. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +16 -0
  70. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
  71. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts +7 -0
  72. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.d.ts.map +1 -0
  73. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts +325 -0
  74. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts.map +1 -0
  75. package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts +2 -0
  76. package/dist/widget/ui/src/components/RefreshProgressButton/index.d.ts.map +1 -0
  77. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +4 -0
  78. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
  79. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +12 -0
  80. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
  81. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +4 -0
  82. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
  83. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  84. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +185 -1
  85. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
  86. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +16 -1
  87. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
  88. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +4 -0
  89. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
  90. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +4 -0
  91. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
  92. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.d.ts.map +1 -1
  93. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +24 -0
  94. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
  95. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +3 -1
  96. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
  97. package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
  98. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +36 -0
  99. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
  100. package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts +1 -0
  101. package/dist/widget/ui/src/components/SwapListItem/SwapToken.types.d.ts.map +1 -1
  102. package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
  103. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +8 -0
  104. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  105. package/dist/widget/ui/src/components/TextField/TextField.d.ts +2 -1
  106. package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
  107. package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts +2 -1
  108. package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts.map +1 -1
  109. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +12 -0
  110. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
  111. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts +3 -1
  112. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts.map +1 -1
  113. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
  114. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +12 -0
  115. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
  116. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts +1 -0
  117. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts.map +1 -1
  118. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  119. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +15 -1
  120. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  121. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +6 -0
  122. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
  123. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +4 -0
  124. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
  125. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +20 -0
  126. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
  127. package/dist/widget/ui/src/components/common/FilledCircle.d.ts +4 -0
  128. package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
  129. package/dist/widget/ui/src/components/common/Image.d.ts +4 -0
  130. package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
  131. package/dist/widget/ui/src/components/common/styles.d.ts +4 -0
  132. package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
  133. package/dist/widget/ui/src/components/index.d.ts +1 -0
  134. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  135. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +40 -0
  136. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
  137. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  138. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +47 -1
  139. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  140. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +3 -0
  141. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  142. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +21 -0
  143. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  144. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +4 -0
  145. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
  146. package/dist/widget/ui/src/icons/Height.d.ts +5 -0
  147. package/dist/widget/ui/src/icons/Height.d.ts.map +1 -0
  148. package/dist/widget/ui/src/icons/Key.d.ts +5 -0
  149. package/dist/widget/ui/src/icons/Key.d.ts.map +1 -0
  150. package/dist/widget/ui/src/icons/Refresh.d.ts.map +1 -1
  151. package/dist/widget/ui/src/icons/Width.d.ts +5 -0
  152. package/dist/widget/ui/src/icons/Width.d.ts.map +1 -0
  153. package/dist/widget/ui/src/icons/index.d.ts +3 -0
  154. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  155. package/dist/widget/ui/src/theme.d.ts +29 -0
  156. package/dist/widget/ui/src/theme.d.ts.map +1 -1
  157. package/package.json +3 -3
  158. package/src/components/Button/Button.tsx +4 -1
  159. package/src/components/Button/Button.types.tsx +1 -0
  160. package/src/components/Divider/Divider.styles.ts +165 -0
  161. package/src/components/Divider/Divider.tsx +8 -140
  162. package/src/components/Divider/Divider.types.ts +10 -0
  163. package/src/components/PriceImpact/PriceImpact.tsx +26 -8
  164. package/src/components/PriceImpact/PriceImpact.types.ts +7 -0
  165. package/src/components/QuoteCost/QuoteCost.styles.ts +28 -1
  166. package/src/components/QuoteCost/QuoteCost.tsx +28 -8
  167. package/src/components/QuoteCost/QuoteCost.types.ts +4 -0
  168. package/src/components/RefreshProgressButton/RefreshProgressButton.styles.ts +28 -0
  169. package/src/components/RefreshProgressButton/RefreshProgressButton.tsx +70 -0
  170. package/src/components/RefreshProgressButton/index.ts +1 -0
  171. package/src/components/StepDetails/StepDetails.styles.ts +28 -5
  172. package/src/components/StepDetails/StepDetails.tsx +103 -37
  173. package/src/components/StepDetails/StepDetails.types.ts +18 -1
  174. package/src/components/SwapListItem/SwapListItem.tsx +6 -1
  175. package/src/components/SwapListItem/SwapListItem.types.ts +3 -1
  176. package/src/components/SwapListItem/SwapToken.tsx +15 -8
  177. package/src/components/SwapListItem/SwapToken.types.ts +1 -0
  178. package/src/components/SwapListItem/mock.ts +2 -0
  179. package/src/components/Switch/Switch.styles.tsx +7 -0
  180. package/src/components/TextField/TextField.tsx +5 -2
  181. package/src/components/TextField/TextField.types.tsx +3 -1
  182. package/src/components/TokenAmount/TokenAmount.tsx +36 -20
  183. package/src/components/TokenAmount/TokenAmount.types.ts +1 -0
  184. package/src/components/Tooltip/Tooltip.styles.ts +7 -0
  185. package/src/components/Tooltip/Tooltip.tsx +4 -2
  186. package/src/components/Tooltip/Tooltip.types.ts +6 -0
  187. package/src/components/Wallet/Wallet.styles.ts +1 -1
  188. package/src/components/index.ts +1 -0
  189. package/src/containers/SwapInput/SwapInput.tsx +53 -22
  190. package/src/containers/SwapInput/SwapInput.types.ts +3 -0
  191. package/src/icons/Height.tsx +24 -0
  192. package/src/icons/Key.tsx +32 -0
  193. package/src/icons/Refresh.tsx +10 -2
  194. package/src/icons/Width.tsx +29 -0
  195. package/src/icons/index.ts +3 -0
  196. package/src/theme.ts +3 -0
@@ -0,0 +1,165 @@
1
+ import { styled } from '../../theme';
2
+
3
+ export const DividerContainer = styled('div', {
4
+ flexShrink: 0,
5
+ variants: {
6
+ size: {
7
+ 4: {},
8
+ 8: {},
9
+ 10: {},
10
+ 12: {},
11
+ 16: {},
12
+ 18: {},
13
+ 20: {},
14
+ 24: {},
15
+ 30: {},
16
+ 32: {},
17
+ },
18
+ direction: {
19
+ vertical: {},
20
+ horizontal: {},
21
+ },
22
+ },
23
+ compoundVariants: [
24
+ {
25
+ size: 4,
26
+ direction: 'horizontal',
27
+ css: {
28
+ width: '$4',
29
+ },
30
+ },
31
+ {
32
+ size: 4,
33
+ direction: 'vertical',
34
+ css: {
35
+ height: '$4',
36
+ },
37
+ },
38
+ {
39
+ size: 8,
40
+ direction: 'horizontal',
41
+ css: {
42
+ width: '$8',
43
+ },
44
+ },
45
+ {
46
+ size: 8,
47
+ direction: 'vertical',
48
+ css: {
49
+ height: '$8',
50
+ },
51
+ },
52
+ {
53
+ size: 10,
54
+ direction: 'horizontal',
55
+ css: {
56
+ width: '$10',
57
+ },
58
+ },
59
+ {
60
+ size: 10,
61
+ direction: 'vertical',
62
+ css: {
63
+ height: '$10',
64
+ },
65
+ },
66
+ {
67
+ size: 12,
68
+ direction: 'horizontal',
69
+ css: {
70
+ width: '$12',
71
+ },
72
+ },
73
+ {
74
+ size: 12,
75
+ direction: 'vertical',
76
+ css: {
77
+ height: '$12',
78
+ },
79
+ },
80
+ {
81
+ size: 16,
82
+ direction: 'horizontal',
83
+ css: {
84
+ width: '$16',
85
+ },
86
+ },
87
+ {
88
+ size: 16,
89
+ direction: 'vertical',
90
+ css: {
91
+ height: '$16',
92
+ },
93
+ },
94
+ {
95
+ size: 18,
96
+ direction: 'horizontal',
97
+ css: {
98
+ width: '$18',
99
+ },
100
+ },
101
+ {
102
+ size: 18,
103
+ direction: 'vertical',
104
+ css: {
105
+ height: '$18',
106
+ },
107
+ },
108
+ {
109
+ size: 20,
110
+ direction: 'horizontal',
111
+ css: {
112
+ width: '$20',
113
+ },
114
+ },
115
+ {
116
+ size: 20,
117
+ direction: 'vertical',
118
+ css: {
119
+ height: '$20',
120
+ },
121
+ },
122
+ {
123
+ size: 24,
124
+ direction: 'horizontal',
125
+ css: {
126
+ width: '$24',
127
+ },
128
+ },
129
+ {
130
+ size: 24,
131
+ direction: 'vertical',
132
+ css: {
133
+ height: '$24',
134
+ },
135
+ },
136
+ {
137
+ size: 30,
138
+ direction: 'horizontal',
139
+ css: {
140
+ width: '$30',
141
+ },
142
+ },
143
+ {
144
+ size: 30,
145
+ direction: 'vertical',
146
+ css: {
147
+ height: '$30',
148
+ },
149
+ },
150
+ {
151
+ size: 32,
152
+ direction: 'horizontal',
153
+ css: {
154
+ width: '$32',
155
+ },
156
+ },
157
+ {
158
+ size: 32,
159
+ direction: 'vertical',
160
+ css: {
161
+ height: '$32',
162
+ },
163
+ },
164
+ ],
165
+ });
@@ -1,146 +1,14 @@
1
- /* eslint-disable @typescript-eslint/no-magic-numbers */
1
+ import type { PropTypes } from './Divider.types';
2
+
2
3
  import React from 'react';
3
4
 
4
- import { styled } from '../../theme';
5
+ import { DividerContainer } from './Divider.styles';
5
6
 
6
- const DividerContainer = styled('div', {
7
- flexShrink: 0,
8
- variants: {
9
- size: {
10
- 4: {},
11
- 8: {},
12
- 12: {},
13
- 16: {},
14
- 18: {},
15
- 20: {},
16
- 24: {},
17
- 32: {},
18
- },
19
- direction: {
20
- vertical: {},
21
- horizontal: {},
22
- },
23
- },
24
- compoundVariants: [
25
- {
26
- size: 4,
27
- direction: 'horizontal',
28
- css: {
29
- width: '$4',
30
- },
31
- },
32
- {
33
- size: 4,
34
- direction: 'vertical',
35
- css: {
36
- height: '$4',
37
- },
38
- },
39
- {
40
- size: 8,
41
- direction: 'horizontal',
42
- css: {
43
- width: '$8',
44
- },
45
- },
46
- {
47
- size: 8,
48
- direction: 'vertical',
49
- css: {
50
- height: '$8',
51
- },
52
- },
53
- {
54
- size: 12,
55
- direction: 'horizontal',
56
- css: {
57
- width: '$12',
58
- },
59
- },
60
- {
61
- size: 12,
62
- direction: 'vertical',
63
- css: {
64
- height: '$12',
65
- },
66
- },
67
- {
68
- size: 16,
69
- direction: 'horizontal',
70
- css: {
71
- width: '$16',
72
- },
73
- },
74
- {
75
- size: 16,
76
- direction: 'vertical',
77
- css: {
78
- height: '$16',
79
- },
80
- },
81
- {
82
- size: 18,
83
- direction: 'horizontal',
84
- css: {
85
- width: '$18',
86
- },
87
- },
88
- {
89
- size: 18,
90
- direction: 'vertical',
91
- css: {
92
- height: '$18',
93
- },
94
- },
95
- {
96
- size: 20,
97
- direction: 'horizontal',
98
- css: {
99
- width: '$20',
100
- },
101
- },
102
- {
103
- size: 20,
104
- direction: 'vertical',
105
- css: {
106
- height: '$20',
107
- },
108
- },
109
- {
110
- size: 24,
111
- direction: 'horizontal',
112
- css: {
113
- width: '$24',
114
- },
115
- },
116
- {
117
- size: 24,
118
- direction: 'vertical',
119
- css: {
120
- height: '$24',
121
- },
122
- },
123
- {
124
- size: 32,
125
- direction: 'horizontal',
126
- css: {
127
- width: '$32',
128
- },
129
- },
130
- {
131
- size: 32,
132
- direction: 'vertical',
133
- css: {
134
- height: '$32',
135
- },
136
- },
137
- ],
138
- });
139
- export interface PropTypes {
140
- size?: 4 | 8 | 12 | 16 | 18 | 20 | 24 | 32;
141
- direction?: 'vertical' | 'horizontal';
142
- }
7
+ const Default_Size = 12;
143
8
 
144
- export function Divider({ size = 12, direction = 'vertical' }: PropTypes) {
9
+ export function Divider({
10
+ size = Default_Size,
11
+ direction = 'vertical',
12
+ }: PropTypes) {
145
13
  return <DividerContainer size={size} direction={direction} />;
146
14
  }
@@ -0,0 +1,10 @@
1
+ import type { DividerContainer } from './Divider.styles';
2
+ import type * as Stitches from '@stitches/react';
3
+
4
+ type BaseProps = Stitches.VariantProps<typeof DividerContainer>;
5
+ type BaseSizes = Exclude<BaseProps['size'], object>;
6
+
7
+ export interface PropTypes {
8
+ size?: BaseSizes;
9
+ direction?: 'vertical' | 'horizontal';
10
+ }
@@ -2,12 +2,20 @@ import type { PriceImpactProps } from './PriceImpact.types';
2
2
 
3
3
  import React from 'react';
4
4
 
5
- import { Typography } from '..';
5
+ import { Tooltip, Typography } from '..';
6
6
 
7
7
  import { Container, OutputUsdValue } from './PriceImpact.styles';
8
8
 
9
9
  export function PriceImpact(props: PriceImpactProps) {
10
- const { size, outputUsdValue, percentageChange, warningLevel, error } = props;
10
+ const {
11
+ size,
12
+ outputUsdValue,
13
+ realOutputUsdValue,
14
+ percentageChange,
15
+ warningLevel,
16
+ error,
17
+ tooltipProps,
18
+ } = props;
11
19
 
12
20
  let percentageChangeColor = '$neutral600';
13
21
  if (!outputUsdValue || warningLevel === 'low') {
@@ -19,12 +27,22 @@ export function PriceImpact(props: PriceImpactProps) {
19
27
  return (
20
28
  <Container>
21
29
  {outputUsdValue && (
22
- <OutputUsdValue
23
- size={size === 'small' ? 'small' : 'medium'}
24
- variant="body"
25
- color="$neutral600">
26
- {`~$${outputUsdValue}`}
27
- </OutputUsdValue>
30
+ <Tooltip
31
+ content={realOutputUsdValue}
32
+ container={tooltipProps?.container}
33
+ open={
34
+ !realOutputUsdValue || realOutputUsdValue === '0'
35
+ ? false
36
+ : undefined
37
+ }
38
+ side={tooltipProps?.side}>
39
+ <OutputUsdValue
40
+ size={size === 'small' ? 'small' : 'medium'}
41
+ variant="body"
42
+ color="$neutral600">
43
+ {`~$${outputUsdValue}`}
44
+ </OutputUsdValue>
45
+ </Tooltip>
28
46
  )}
29
47
  {((outputUsdValue && percentageChange) || !outputUsdValue) && (
30
48
  <Typography
@@ -1,9 +1,16 @@
1
+ import type { PropTypes as TooltipPropTypes } from '../Tooltip/Tooltip.types';
2
+
1
3
  export type PriceImpactWarningLevel = 'low' | 'high' | undefined;
2
4
 
3
5
  export type PriceImpactProps = {
4
6
  size: 'small' | 'large';
5
7
  outputUsdValue?: string;
8
+ realOutputUsdValue?: string;
6
9
  error?: string;
7
10
  percentageChange?: string | null;
8
11
  warningLevel?: PriceImpactWarningLevel;
12
+ tooltipProps?: {
13
+ container?: TooltipPropTypes['container'];
14
+ side?: TooltipPropTypes['side'];
15
+ };
9
16
  };
@@ -1,4 +1,4 @@
1
- import { css, styled } from '../../theme';
1
+ import { css, keyframes, styled } from '../../theme';
2
2
 
3
3
  export const Container = styled('div', {
4
4
  borderRadius: '$xs',
@@ -23,7 +23,34 @@ export const iconStyles = css({
23
23
  alignItems: 'center',
24
24
  });
25
25
 
26
+ const blinker = keyframes({
27
+ '50%': {
28
+ opacity: 0.2,
29
+ },
30
+ });
31
+
26
32
  export const itemStyles = css({
27
33
  display: 'flex',
28
34
  alignItems: 'center',
35
+ '&.feeSection': {
36
+ cursor: 'pointer',
37
+ '&:hover': {
38
+ svg: {
39
+ color: '$secondary',
40
+ },
41
+ '._typography': {
42
+ color: '$secondary',
43
+ },
44
+ },
45
+ },
46
+ '&.warning': {
47
+ animation: `${blinker} 2s linear infinite`,
48
+
49
+ svg: {
50
+ color: '$warning500',
51
+ },
52
+ '._typography': {
53
+ color: '$warning500',
54
+ },
55
+ },
29
56
  });
@@ -3,6 +3,7 @@ import type { PropTypes } from './QuoteCost.types';
3
3
  import React from 'react';
4
4
 
5
5
  import { GasIcon, NumberIcon, TimeIcon } from '../../icons';
6
+ import { Tooltip } from '../Tooltip';
6
7
  import { Typography } from '../Typography';
7
8
 
8
9
  import {
@@ -13,17 +14,36 @@ import {
13
14
  } from './QuoteCost.styles';
14
15
 
15
16
  export function QuoteCost(props: PropTypes) {
16
- const { fee, time, steps } = props;
17
+ const {
18
+ fee,
19
+ time,
20
+ steps,
21
+ onClickFee,
22
+ tooltipGas,
23
+ feeWarning,
24
+ tooltipContainer,
25
+ } = props;
17
26
  return (
18
27
  <Container>
19
- <div className={itemStyles()}>
20
- <div className={iconStyles()}>
21
- <GasIcon size={12} color={'gray'} />
28
+ <Tooltip
29
+ container={tooltipContainer}
30
+ content={tooltipGas}
31
+ open={!onClickFee && !tooltipGas ? false : undefined}
32
+ side="bottom">
33
+ <div
34
+ className={`${itemStyles()} ${onClickFee ? 'feeSection' : ''} ${
35
+ feeWarning ? 'warning' : ''
36
+ }`}
37
+ onClick={onClickFee}>
38
+ <div className={iconStyles()}>
39
+ <GasIcon size={12} color={'gray'} />
40
+ </div>
41
+ <Typography ml={2} align="center" variant="body" size="small">
42
+ ${fee}
43
+ </Typography>
22
44
  </div>
23
- <Typography ml={2} align="center" variant="body" size="small">
24
- ${fee}
25
- </Typography>
26
- </div>
45
+ </Tooltip>
46
+
27
47
  <Separator />
28
48
  <div className={itemStyles()}>
29
49
  <div className={iconStyles()}>
@@ -2,4 +2,8 @@ export type PropTypes = {
2
2
  fee: string;
3
3
  time: string | number;
4
4
  steps: number;
5
+ onClickFee?: () => void;
6
+ tooltipGas?: string;
7
+ feeWarning?: boolean;
8
+ tooltipContainer?: HTMLElement;
5
9
  };
@@ -0,0 +1,28 @@
1
+ import { styled } from '../../theme';
2
+
3
+ export const StyledEllipse = styled('ellipse', {
4
+ cx: '12.5px',
5
+ cy: '12.5px',
6
+ rx: '7.7px',
7
+ ry: '7.7px',
8
+ strokeLinecap: 'round',
9
+ fill: 'none',
10
+ strokeDasharray: 100,
11
+ transform: `rotate(20deg)`,
12
+ transformOrigin: 'center',
13
+ variants: {
14
+ type: {
15
+ 'in-progress': {
16
+ stroke: '$info500',
17
+ strokeWidth: 2,
18
+ },
19
+ basic: {
20
+ strokeWidth: 1.8,
21
+ },
22
+ },
23
+ },
24
+ });
25
+
26
+ export const StyledPath = styled('path', {
27
+ fill: '$info500',
28
+ });
@@ -0,0 +1,70 @@
1
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
2
+ import type { SvgIconPropsWithChildren } from '../SvgIcon';
3
+
4
+ import React, { createElement } from 'react';
5
+
6
+ import { SvgIcon } from '../SvgIcon';
7
+
8
+ import { StyledEllipse, StyledPath } from './RefreshProgressButton.styles';
9
+
10
+ const DEFAULT_STROKE_DASHOFFSET = 59;
11
+ const MAX_PERCENTAGE = 100;
12
+ const MAX_PROGRESS = 41;
13
+ const MIN_PROGRESS = 0;
14
+ const NORMALIZE_FACTOR = 10;
15
+ const OPACITY_THRESHOLD = 82;
16
+ const DIVISION_FACTOR = 2;
17
+
18
+ const Ellipse = (props: { fill?: string; progress?: number }) => {
19
+ const type = props.progress ? 'in-progress' : 'basic';
20
+ return (
21
+ <StyledEllipse
22
+ type={type}
23
+ stroke="currentColor"
24
+ strokeDashoffset={props.progress || DEFAULT_STROKE_DASHOFFSET}
25
+ />
26
+ );
27
+ };
28
+
29
+ function RefreshProgressButton(
30
+ props: SvgIconPropsWithChildren & { progress: number }
31
+ ) {
32
+ const normalizeValue = (value: number) => {
33
+ return (value - OPACITY_THRESHOLD) / NORMALIZE_FACTOR;
34
+ };
35
+ const normalizedProgress = Math.min(
36
+ props.progress / DIVISION_FACTOR,
37
+ MAX_PROGRESS
38
+ );
39
+ const opacity =
40
+ normalizedProgress !== MAX_PROGRESS
41
+ ? MIN_PROGRESS
42
+ : normalizeValue(props.progress);
43
+
44
+ return createElement(
45
+ SvgIcon,
46
+ props,
47
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
48
+ <Ellipse />
49
+ <Ellipse progress={MAX_PERCENTAGE - normalizedProgress} />
50
+
51
+ <path
52
+ d="M19.2696 9.6089C19.1207 9.49207 19.0218 9.31141 19.01 9.10738L18.807 5.14476C18.788 4.77467 19.0763 4.45089 19.4464 4.43183C19.8165 4.41278 20.1402 4.70108 20.1593 5.07117L20.3622 9.0338C20.3813 9.40389 20.093 9.72767 19.7229 9.74672C19.5584 9.76661 19.3973 9.70903 19.2696 9.6089Z"
53
+ fill="currentColor"
54
+ />
55
+ <StyledPath
56
+ d="M19.2696 9.6089C19.1207 9.49207 19.0218 9.31141 19.01 9.10738L18.807 5.14476C18.788 4.77467 19.0763 4.45089 19.4464 4.43183C19.8165 4.41278 20.1402 4.70108 20.1593 5.07117L20.3622 9.0338C20.3813 9.40389 20.093 9.72767 19.7229 9.74672C19.5584 9.76661 19.3973 9.70903 19.2696 9.6089Z"
57
+ fillOpacity={opacity}
58
+ />
59
+ <path
60
+ d="M15.5108 9.47903C15.3476 9.35108 15.2457 9.14511 15.2505 8.9198C15.2639 8.55221 15.575 8.25778 15.9482 8.26404L19.707 8.3939C20.0802 8.40016 20.3691 8.71837 20.3628 9.09152C20.3565 9.46466 20.0383 9.75353 19.6652 9.74728L15.9007 9.62451C15.7529 9.62312 15.6243 9.56804 15.5108 9.47903Z"
61
+ fill="currentColor"
62
+ />
63
+ <StyledPath
64
+ d="M15.5108 9.47903C15.3476 9.35108 15.2457 9.14511 15.2505 8.9198C15.2639 8.55221 15.575 8.25778 15.9482 8.26404L19.707 8.3939C20.0802 8.40016 20.3691 8.71837 20.3628 9.09152C20.3565 9.46466 20.0383 9.75353 19.6652 9.74728L15.9007 9.62451C15.7529 9.62312 15.6243 9.56804 15.5108 9.47903Z"
65
+ fillOpacity={opacity}
66
+ />
67
+ </svg>
68
+ );
69
+ }
70
+ export { RefreshProgressButton };
@@ -0,0 +1 @@
1
+ export { RefreshProgressButton } from './RefreshProgressButton';
@@ -12,6 +12,7 @@ export const Container = styled('div', {
12
12
  type: {
13
13
  'quote-details': { border: 'none' },
14
14
  'swap-progress': {
15
+ backgroundColor: '$neutral100',
15
16
  $$color: '$colors$neutral100',
16
17
  [`.${darkTheme} &`]: {
17
18
  $$color: '$colors$neutral300',
@@ -33,10 +34,6 @@ export const Container = styled('div', {
33
34
  error: { borderColor: '$error500' },
34
35
  },
35
36
  },
36
- '& .swapper__description': {
37
- fontWeight: '$medium',
38
- },
39
- '& div:nth-child(3)': { display: 'flex', flexDirection: 'column', flex: 1 },
40
37
  });
41
38
 
42
39
  export const SwapperImage = styled('div', {
@@ -86,6 +83,26 @@ export const DashedLine = styled('div', {
86
83
  },
87
84
  });
88
85
 
86
+ export const SwapperSeparator = styled('div', {
87
+ borderLeft: '1px solid transparent',
88
+ margin: '0 $12',
89
+ display: 'block',
90
+ height: '8px',
91
+ variants: {
92
+ state: {
93
+ default: {
94
+ borderColor: 'transparent',
95
+ },
96
+ 'in-progress': { borderColor: '$info500' },
97
+ completed: {
98
+ borderColor: '$success500',
99
+ },
100
+ warning: { borderColor: '$warning500' },
101
+ error: { borderColor: '$error500' },
102
+ },
103
+ },
104
+ });
105
+
89
106
  export const StepSeparator = styled('div', {
90
107
  borderLeft: '1px dashed transparent',
91
108
  margin: '0 $10',
@@ -114,7 +131,13 @@ export const tokensContainerStyles = css({
114
131
  width: '100%',
115
132
  });
116
133
 
117
- export const swapperStyles = css({
134
+ export const swappersStyles = css({
135
+ display: 'flex',
136
+ flexDirection: 'column',
137
+ justifyContent: 'center',
138
+ });
139
+
140
+ export const swapperItemStyles = css({
118
141
  display: 'flex',
119
142
  alignItems: 'center',
120
143
  });