@rango-dev/ui 0.28.2-next.0 → 0.28.2-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 (195) 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/translations/pt.d.ts +2 -0
  8. package/dist/translations/pt.d.ts.map +1 -0
  9. package/dist/widget/ui/src/components/Alert/Alert.d.ts.map +1 -1
  10. package/dist/widget/ui/src/components/Alert/Alert.helpers.d.ts +3 -2
  11. package/dist/widget/ui/src/components/Alert/Alert.helpers.d.ts.map +1 -1
  12. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +12 -8
  13. package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
  14. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts +5 -2
  15. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts.map +1 -1
  16. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +1 -0
  17. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
  18. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +2 -0
  19. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
  20. package/dist/widget/ui/src/components/Button/Button.d.ts +6 -6
  21. package/dist/widget/ui/src/components/Button/Button.styles.d.ts +4 -1
  22. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  23. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +2 -0
  24. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
  25. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +4 -0
  26. package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
  27. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +1 -0
  28. package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +1 -0
  30. package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -1
  31. package/dist/widget/ui/src/components/Divider/Divider.d.ts +1 -1
  32. package/dist/widget/ui/src/components/Divider/Divider.d.ts.map +1 -1
  33. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +3 -2
  34. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -1
  35. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +5 -0
  36. package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/Flags/Portuguese.d.ts +4 -0
  38. package/dist/widget/ui/src/components/Flags/Portuguese.d.ts.map +1 -0
  39. package/dist/widget/ui/src/components/Flags/index.d.ts +2 -1
  40. package/dist/widget/ui/src/components/Flags/index.d.ts.map +1 -1
  41. package/dist/widget/ui/src/components/Header/Header.styles.d.ts +2 -0
  42. package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
  43. package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts +1 -0
  44. package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts.map +1 -1
  45. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +1 -0
  46. package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
  47. package/dist/widget/ui/src/components/Icon/common.d.ts +4 -2
  48. package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
  49. package/dist/widget/ui/src/components/List/List.styles.d.ts +1 -0
  50. package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
  51. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +1 -0
  52. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +1 -0
  54. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +1 -0
  56. package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +4 -1
  58. package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
  59. package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
  60. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +6 -0
  61. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
  62. package/dist/widget/ui/src/components/Modal/Modal.types.d.ts +6 -1
  63. package/dist/widget/ui/src/components/Modal/Modal.types.d.ts.map +1 -1
  64. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +1 -0
  65. package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
  66. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +2 -0
  67. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  68. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +2 -0
  69. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  70. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +4 -0
  71. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -1
  72. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts +2 -1
  73. package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -1
  74. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +2 -0
  75. package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
  76. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +5 -1
  77. package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
  78. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts +2 -0
  79. package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts.map +1 -1
  80. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +1 -0
  81. package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
  82. package/dist/widget/ui/src/components/Select/Select.d.ts +4 -0
  83. package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -0
  84. package/dist/widget/ui/src/components/Select/Select.types.d.ts +12 -0
  85. package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -0
  86. package/dist/widget/ui/src/components/Select/index.d.ts +2 -0
  87. package/dist/widget/ui/src/components/Select/index.d.ts.map +1 -0
  88. package/dist/widget/ui/src/components/Select/select.styles.d.ts +492 -0
  89. package/dist/widget/ui/src/components/Select/select.styles.d.ts.map +1 -0
  90. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +3 -0
  91. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
  92. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +1 -0
  93. package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
  94. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +10 -4
  95. package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
  96. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +2 -1
  97. package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
  98. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +1 -0
  99. package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
  100. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +6 -0
  101. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
  102. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +9 -0
  103. package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
  104. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +2 -0
  105. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  106. package/dist/widget/ui/src/components/TextField/TextField.d.ts +1 -1
  107. package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts +1 -1
  108. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +3 -0
  109. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
  110. package/dist/widget/ui/src/components/Toast/Toast.Provider.d.ts.map +1 -1
  111. package/dist/widget/ui/src/components/Toast/Toast.d.ts.map +1 -1
  112. package/dist/widget/ui/src/components/Toast/Toast.helpers.d.ts +4 -0
  113. package/dist/widget/ui/src/components/Toast/Toast.helpers.d.ts.map +1 -1
  114. package/dist/widget/ui/src/components/Toast/Toast.stories.d.ts +4 -3
  115. package/dist/widget/ui/src/components/Toast/Toast.stories.d.ts.map +1 -1
  116. package/dist/widget/ui/src/components/Toast/Toast.styles.d.ts +174 -4
  117. package/dist/widget/ui/src/components/Toast/Toast.styles.d.ts.map +1 -1
  118. package/dist/widget/ui/src/components/Toast/Toast.types.d.ts +14 -14
  119. package/dist/widget/ui/src/components/Toast/Toast.types.d.ts.map +1 -1
  120. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +4 -1
  121. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
  122. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +3 -0
  123. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  124. package/dist/widget/ui/src/components/Typography/NotSelectableTypography.d.ts +164 -0
  125. package/dist/widget/ui/src/components/Typography/NotSelectableTypography.d.ts.map +1 -0
  126. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +1 -0
  127. package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
  128. package/dist/widget/ui/src/components/Typography/Typography.types.d.ts +1 -1
  129. package/dist/widget/ui/src/components/Typography/Typography.types.d.ts.map +1 -1
  130. package/dist/widget/ui/src/components/Typography/index.d.ts +1 -0
  131. package/dist/widget/ui/src/components/Typography/index.d.ts.map +1 -1
  132. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +5 -0
  133. package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
  134. package/dist/widget/ui/src/components/common/FilledCircle.d.ts +1 -0
  135. package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
  136. package/dist/widget/ui/src/components/common/Image.d.ts +1 -0
  137. package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
  138. package/dist/widget/ui/src/components/common/styles.d.ts +1 -0
  139. package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
  140. package/dist/widget/ui/src/components/index.d.ts +1 -0
  141. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  142. package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.d.ts.map +1 -1
  143. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +10 -0
  144. package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
  145. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +18 -7
  146. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  147. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +11 -6
  148. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  149. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +1 -0
  150. package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
  151. package/dist/widget/ui/src/icons/Autorenew.d.ts +5 -0
  152. package/dist/widget/ui/src/icons/Autorenew.d.ts.map +1 -0
  153. package/dist/widget/ui/src/icons/Exit.d.ts +5 -0
  154. package/dist/widget/ui/src/icons/Exit.d.ts.map +1 -0
  155. package/dist/widget/ui/src/icons/Swap.d.ts +5 -0
  156. package/dist/widget/ui/src/icons/Swap.d.ts.map +1 -0
  157. package/dist/widget/ui/src/icons/index.d.ts +3 -0
  158. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  159. package/dist/widget/ui/src/theme.d.ts +25 -13
  160. package/dist/widget/ui/src/theme.d.ts.map +1 -1
  161. package/package.json +5 -4
  162. package/readme.md +3 -1
  163. package/src/components/Alert/Alert.helpers.ts +13 -2
  164. package/src/components/Alert/Alert.styles.ts +7 -8
  165. package/src/components/Alert/Alert.tsx +8 -6
  166. package/src/components/Alert/Alert.types.ts +5 -2
  167. package/src/components/Divider/Divider.tsx +2 -1
  168. package/src/components/Flags/Portuguese.tsx +34 -0
  169. package/src/components/Flags/index.ts +2 -1
  170. package/src/components/I18nManager/I18nManager.tsx +2 -0
  171. package/src/components/Modal/Modal.tsx +25 -12
  172. package/src/components/Modal/Modal.types.ts +6 -1
  173. package/src/components/QuoteCost/QuoteCost.styles.ts +0 -1
  174. package/src/components/QuoteCost/QuoteCost.types.ts +1 -1
  175. package/src/components/Select/Select.tsx +85 -0
  176. package/src/components/Select/Select.types.ts +10 -0
  177. package/src/components/Select/index.ts +1 -0
  178. package/src/components/Select/select.styles.ts +100 -0
  179. package/src/components/TextField/TextField.styles.ts +1 -0
  180. package/src/components/Toast/Toast.Provider.tsx +82 -44
  181. package/src/components/Toast/Toast.helpers.ts +5 -0
  182. package/src/components/Toast/Toast.stories.tsx +18 -21
  183. package/src/components/Toast/Toast.styles.ts +278 -38
  184. package/src/components/Toast/Toast.tsx +84 -32
  185. package/src/components/Toast/Toast.types.ts +19 -17
  186. package/src/components/Typography/NotSelectableTypography.ts +7 -0
  187. package/src/components/Typography/Typography.types.tsx +1 -1
  188. package/src/components/Typography/index.ts +1 -0
  189. package/src/components/index.ts +1 -0
  190. package/src/containers/ConnectWalletsModal/ConnectWalletsModal.tsx +3 -1
  191. package/src/icons/Autorenew.tsx +20 -0
  192. package/src/icons/Exit.tsx +20 -0
  193. package/src/icons/Swap.tsx +20 -0
  194. package/src/icons/index.ts +3 -0
  195. package/src/theme.ts +4 -1
@@ -1,48 +1,252 @@
1
- import { darkTheme, keyframes, lightTheme, styled } from '../../theme';
1
+ import { css, darkTheme, lightTheme, styled } from '../../theme';
2
2
  import { Typography } from '../Typography';
3
3
 
4
- const toastOpacity = keyframes({
5
- from: { opacity: 0 },
6
- to: { opacity: 1 },
4
+ import {
5
+ HOVER_TRANSITION_DURATION,
6
+ TOAST_TRANSITION_DURATION,
7
+ } from './Toast.helpers';
8
+
9
+ export const toastContentStyles = css({
10
+ transition: `transform ${HOVER_TRANSITION_DURATION}ms ease-in-out`,
11
+ '&:hover': {
12
+ transform: 'scale(0.99)',
13
+ },
7
14
  });
8
15
 
9
16
  export const ToastContentContainer = styled('div', {
17
+ transition: `transform ${TOAST_TRANSITION_DURATION}ms cubic-bezier(0, 0, 0.75, 1.25)`,
18
+ cursor: 'pointer',
10
19
  variants: {
11
- horizontal: {
12
- right: {
13
- right: 12,
14
- animation: `${toastOpacity} .7s`,
20
+ isActive: {
21
+ true: {},
22
+ },
23
+ isVisible: {
24
+ true: {},
25
+ },
26
+ position: {
27
+ 'right-top': {},
28
+ 'right-bottom': {},
29
+ 'left-top': {},
30
+ 'left-bottom': {},
31
+ 'center-top': {},
32
+ 'center-bottom': {},
33
+ },
34
+ },
35
+ compoundVariants: [
36
+ {
37
+ position: 'right-top',
38
+ isActive: true,
39
+ isVisible: true,
40
+ css: {
41
+ transform: 'translateX(0)',
42
+ maxHeight: '200px',
15
43
  },
16
- left: {
17
- left: 12,
18
- animation: `${toastOpacity} .7s`,
44
+ },
45
+ {
46
+ position: 'right-top',
47
+ isActive: false,
48
+ isVisible: true,
49
+ css: {
50
+ maxHeight: '200px',
51
+ transform: 'translateX(100%)',
19
52
  },
20
53
  },
21
- },
54
+ {
55
+ position: 'right-top',
56
+ isActive: false,
57
+ isVisible: false,
58
+ css: {
59
+ maxHeight: '0px',
60
+ transform: 'translateX(100%)',
61
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
62
+ },
63
+ },
64
+ {
65
+ position: 'right-bottom',
66
+ isActive: true,
67
+ isVisible: true,
68
+ css: {
69
+ transform: 'translateX(0)',
70
+ maxHeight: '200px',
71
+ },
72
+ },
73
+ {
74
+ position: 'right-bottom',
75
+ isActive: false,
76
+ isVisible: true,
77
+ css: {
78
+ transform: 'translateX(100%)',
79
+ maxHeight: '200px',
80
+ },
81
+ },
82
+ {
83
+ position: 'right-bottom',
84
+ isActive: false,
85
+ isVisible: false,
86
+ css: {
87
+ transform: 'translateX(100%)',
88
+ maxHeight: '0px',
89
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
90
+ },
91
+ },
92
+ {
93
+ position: 'left-top',
94
+ isActive: true,
95
+ isVisible: true,
96
+ css: {
97
+ transform: 'translateX(0)',
98
+ maxHeight: '200px',
99
+ },
100
+ },
101
+ {
102
+ position: 'left-top',
103
+ isActive: false,
104
+ isVisible: true,
105
+ css: {
106
+ transform: 'translateX(-100%)',
107
+ maxHeight: '200px',
108
+ },
109
+ },
110
+ {
111
+ position: 'left-top',
112
+ isActive: false,
113
+ isVisible: false,
114
+ css: {
115
+ transform: 'translateX(-100%)',
116
+ maxHeight: '0px',
117
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
118
+ },
119
+ },
120
+ {
121
+ position: 'left-bottom',
122
+ isActive: true,
123
+ isVisible: true,
124
+ css: {
125
+ transform: 'translateX(0)',
126
+ maxHeight: '200px',
127
+ },
128
+ },
129
+ {
130
+ position: 'left-bottom',
131
+ isActive: false,
132
+ isVisible: true,
133
+ css: {
134
+ transform: 'translateX(-100%)',
135
+ maxHeight: '200px',
136
+ },
137
+ },
138
+ {
139
+ position: 'left-bottom',
140
+ isActive: false,
141
+ isVisible: false,
142
+ css: {
143
+ transform: 'translateX(-100%)',
144
+ maxHeight: '0px',
145
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
146
+ },
147
+ },
148
+ {
149
+ position: 'center-top',
150
+ isActive: true,
151
+ isVisible: true,
152
+ css: {
153
+ maxHeight: '200px',
154
+ transform: 'translateY(0)',
155
+ opacity: 1,
156
+ },
157
+ },
158
+ {
159
+ position: 'center-top',
160
+ isActive: false,
161
+ isVisible: true,
162
+ css: {
163
+ maxHeight: '200px',
164
+ transform: 'translateY(-1000%)',
165
+ opacity: 0,
166
+ },
167
+ },
168
+ {
169
+ position: 'center-top',
170
+ isActive: false,
171
+ isVisible: false,
172
+ css: {
173
+ maxHeight: '0px',
174
+ opacity: 0,
175
+ transform: 'translateY(-1000%)',
176
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
177
+ },
178
+ },
179
+ {
180
+ position: 'center-bottom',
181
+ isActive: true,
182
+ isVisible: true,
183
+ css: {
184
+ transform: 'translateY(0)',
185
+ maxHeight: '200px',
186
+ opacity: 1,
187
+ },
188
+ },
189
+ {
190
+ position: 'center-bottom',
191
+ isActive: false,
192
+ isVisible: true,
193
+ css: {
194
+ transform: 'translateY(1000%)',
195
+ maxHeight: '200px',
196
+ opacity: 0,
197
+ },
198
+ },
199
+ {
200
+ position: 'center-bottom',
201
+ isActive: false,
202
+ isVisible: false,
203
+ css: {
204
+ transform: 'translateY(1000%)',
205
+ maxHeight: '0px',
206
+ opacity: 0,
207
+ transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
208
+ },
209
+ },
210
+ ],
22
211
  });
23
212
 
24
213
  export const ToastContainer = styled('div', {
214
+ overflow: 'hidden',
25
215
  position: 'absolute',
26
216
  zIndex: 9999,
27
217
  display: 'flex',
28
218
  gap: '$4',
29
219
  flexDirection: 'column',
30
220
  variants: {
31
- horizontal: {
32
- right: {
221
+ position: {
222
+ 'right-top': {
223
+ right: 12,
224
+ top: 2,
225
+ },
226
+ 'right-bottom': {
33
227
  right: 12,
228
+ bottom: 2,
229
+ flexDirection: 'column-reverse',
34
230
  },
35
- left: {
231
+ 'left-top': {
36
232
  left: 12,
233
+ top: 2,
37
234
  },
38
- },
39
-
40
- vertical: {
41
- top: {
235
+ 'left-bottom': {
236
+ left: 12,
237
+ bottom: 2,
238
+ flexDirection: 'column-reverse',
239
+ },
240
+ 'center-top': {
241
+ left: '50%',
242
+ transform: 'translateX(-50%)',
42
243
  top: 2,
43
244
  },
44
- bottom: {
245
+ 'center-bottom': {
246
+ left: '50%',
247
+ transform: 'translateX(-50%)',
45
248
  bottom: 2,
249
+ flexDirection: 'column-reverse',
46
250
  },
47
251
  },
48
252
  },
@@ -53,36 +257,73 @@ export const AlertBox = styled('div', {
53
257
  borderRadius: '$sm',
54
258
  width: '292px',
55
259
  minHeight: '52px',
56
- backgroundColor: '$background',
57
- borderRight: '1px solid',
58
- [`.${darkTheme} &`]: {
59
- backgroundColor: '#070917',
60
- },
61
- '&:hover': {
62
- backgroundColor: '$info100',
63
- [`.${darkTheme} &`]: {
64
- backgroundColor: '#111733',
65
- },
66
- },
67
260
  variants: {
261
+ variant: {
262
+ custom: {
263
+ backgroundColor: '$background',
264
+ borderRight: '1px solid',
265
+ '&:hover': {
266
+ backgroundColor: '$info100',
267
+ [`.${darkTheme} &`]: {
268
+ backgroundColor: '$neutral300',
269
+ },
270
+ },
271
+ },
272
+ standard: {
273
+ '& ._alert': {
274
+ padding: '$10',
275
+ width: '100%',
276
+ justifyContent: 'center',
277
+ alignItems: 'center',
278
+ },
279
+ },
280
+ },
68
281
  type: {
69
- error: {
282
+ error: {},
283
+ success: {},
284
+ warning: {},
285
+ info: {},
286
+ loading: {},
287
+ },
288
+ },
289
+ compoundVariants: [
290
+ {
291
+ variant: 'custom',
292
+ type: 'error',
293
+
294
+ css: {
70
295
  borderRightColor: '$error500',
71
296
  },
72
- success: {
297
+ },
298
+ {
299
+ variant: 'custom',
300
+ type: 'success',
301
+ css: {
73
302
  borderRightColor: '$success500',
74
303
  },
75
- warning: {
304
+ },
305
+ {
306
+ variant: 'custom',
307
+ type: 'warning',
308
+ css: {
76
309
  borderRightColor: '$warning500',
77
310
  },
78
- info: {
311
+ },
312
+ {
313
+ variant: 'custom',
314
+ type: 'info',
315
+ css: {
79
316
  borderRightColor: '$info500',
80
317
  },
81
- loading: {
318
+ },
319
+ {
320
+ variant: 'custom',
321
+ type: 'loading',
322
+ css: {
82
323
  borderRightColor: '$info500',
83
324
  },
84
325
  },
85
- },
326
+ ],
86
327
  });
87
328
 
88
329
  export const AlertFlexContainer = styled('div', {
@@ -108,6 +349,5 @@ export const StyledTypography = styled(Typography, {
108
349
 
109
350
  export const ToastStoryContainer = styled('div', {
110
351
  display: 'flex',
111
- justifyContent: 'center',
112
352
  alignItems: 'center',
113
353
  });
@@ -1,59 +1,111 @@
1
1
  import type { ToastProps } from './Toast.types';
2
2
 
3
- import React, { useEffect } from 'react';
3
+ import React, { useEffect, useState } from 'react';
4
4
 
5
+ import { CloseIcon } from '../../icons';
6
+ import { Alert } from '../Alert';
5
7
  import { IconHighlight } from '../Alert/Alert.styles';
6
8
  import AlertIcon from '../Alert/AlertIcon';
7
9
  import { Divider } from '../Divider';
10
+ import { IconButton } from '../IconButton';
8
11
 
12
+ import { TOAST_HIDE_DELAY, TOAST_UNMOUNT_DELAY } from './Toast.helpers';
9
13
  import { useToast } from './Toast.Provider';
10
14
  import {
11
15
  AlertBox,
12
16
  AlertFlexContainer,
13
17
  StyledTypography,
14
18
  ToastContentContainer,
19
+ toastContentStyles,
15
20
  } from './Toast.styles';
16
21
 
17
- const DEFAULT_HIDE_DURATION = 3_000;
18
-
19
22
  export const Toast = (props: ToastProps) => {
20
- const { id, horizontal, autoHideDuration = DEFAULT_HIDE_DURATION } = props;
23
+ const {
24
+ id,
25
+ autoHideDuration,
26
+ onClose,
27
+ type,
28
+ title,
29
+ position,
30
+ hasCloseIcon = true,
31
+ hideOnTap = true,
32
+ variant = 'standard',
33
+ } = props;
34
+ const [isActive, setIsActive] = useState(false);
35
+ const [isVisible, setIsVisible] = useState(false);
21
36
  const { removeToast } = useToast();
22
37
  useEffect(() => {
23
- const timer = setTimeout(() => {
24
- removeToast(id);
25
- }, autoHideDuration);
38
+ let cleanup;
39
+
40
+ if (autoHideDuration) {
41
+ const timer = setTimeout(() => {
42
+ handleClose();
43
+ }, autoHideDuration);
44
+
45
+ cleanup = () => clearTimeout(timer);
46
+ }
26
47
 
27
- return () => {
28
- clearTimeout(timer);
29
- };
48
+ return cleanup;
30
49
  }, [id]);
31
50
 
51
+ const handleClose = () => {
52
+ setIsActive(false);
53
+ setTimeout(() => {
54
+ setIsVisible(false);
55
+ }, TOAST_HIDE_DELAY);
56
+ setTimeout(() => {
57
+ removeToast(id, position);
58
+ onClose?.();
59
+ }, TOAST_UNMOUNT_DELAY);
60
+ };
61
+
62
+ useEffect(() => {
63
+ setIsVisible(true);
64
+ setTimeout(() => {
65
+ setIsActive(true);
66
+ }, 0);
67
+ }, []);
68
+
32
69
  return (
33
- <ToastContentContainer horizontal={horizontal}>
34
- {'component' in props ? (
35
- props.component
36
- ) : (
70
+ <ToastContentContainer
71
+ isActive={isActive}
72
+ position={position}
73
+ isVisible={isVisible}>
74
+ <div className={toastContentStyles()}>
37
75
  <AlertBox
38
- onClick={() => removeToast(id)}
39
- type={props.type}
40
- style={props.style}>
41
- <AlertFlexContainer>
42
- <IconHighlight type={props.type} align="center">
43
- <AlertIcon type={props.type} />
44
- </IconHighlight>
45
- <Divider direction="horizontal" size={10} />
46
- <StyledTypography
47
- variant="body"
48
- size="small"
49
- color={props.titleColor}
50
- hasColor={!!props.titleColor}
51
- align="left">
52
- {props.title}
53
- </StyledTypography>
54
- </AlertFlexContainer>
76
+ onClick={hideOnTap ? handleClose : undefined}
77
+ variant={variant}
78
+ type={type}>
79
+ {variant === 'custom' ? (
80
+ <AlertFlexContainer>
81
+ <IconHighlight type={type} align="center">
82
+ <AlertIcon type={type} />
83
+ </IconHighlight>
84
+ <Divider direction="horizontal" size={10} />
85
+ <StyledTypography variant="body" size="small" align="left">
86
+ {props.title}
87
+ </StyledTypography>
88
+ </AlertFlexContainer>
89
+ ) : (
90
+ <Alert
91
+ title={title}
92
+ type={type}
93
+ variant="alarm"
94
+ titleAlign="left"
95
+ action={
96
+ hasCloseIcon ? (
97
+ <IconButton
98
+ variant="ghost"
99
+ size="xsmall"
100
+ onClick={handleClose}>
101
+ <CloseIcon size={12} />
102
+ </IconButton>
103
+ ) : undefined
104
+ }
105
+ />
106
+ )}
55
107
  </AlertBox>
56
- )}
108
+ </div>
57
109
  </ToastContentContainer>
58
110
  );
59
111
  };
@@ -1,31 +1,33 @@
1
+ import type { ToastContainer } from './Toast.styles';
1
2
  import type { Type } from '../Alert/Alert.types';
2
- import type { CSSProperties } from '@stitches/react';
3
+ import type * as Stitches from '@stitches/react';
4
+ import type { CSSProperties } from 'react';
3
5
 
6
+ type BaseProps = Stitches.VariantProps<typeof ToastContainer>;
7
+ export type ToastPosition = Exclude<BaseProps['position'], object>;
4
8
  export interface ProviderPropTypes {
5
9
  container: HTMLElement;
6
- anchorOrigin?: {
7
- horizontal: 'left' | 'right';
8
- vertical: 'bottom' | 'top';
9
- };
10
- containerStyle?: CSSProperties;
11
10
  }
12
11
 
13
- export type ToastType = { autoHideDuration?: number; id?: number | string } & (
14
- | {
15
- title: string;
16
- type: Type;
17
- titleColor?: string;
18
- style?: CSSProperties;
19
- }
20
- | { component: React.ReactNode }
21
- );
12
+ export type ToastType = {
13
+ autoHideDuration?: number;
14
+ id?: number | string;
15
+ containerStyle?: CSSProperties;
16
+ onClose?: () => void;
17
+ position: ToastPosition;
18
+ title: string;
19
+ type: Type;
20
+ style?: CSSProperties;
21
+ hasCloseIcon?: boolean;
22
+ hideOnTap?: boolean;
23
+ variant?: 'custom' | 'standard';
24
+ };
22
25
 
23
26
  export type ToastProps = ToastType & {
24
27
  id: number | string;
25
- horizontal: 'left' | 'right';
26
28
  };
27
29
 
28
30
  export type ProviderContext = {
29
31
  addToast: (content: ToastType) => void;
30
- removeToast: (id: number | string) => void;
32
+ removeToast: (id: number | string, position: ToastPosition) => void;
31
33
  };
@@ -0,0 +1,7 @@
1
+ import { styled } from '../../theme';
2
+
3
+ import { Typography } from './Typography';
4
+
5
+ export const NotSelectableTypography = styled(Typography, {
6
+ userSelect: 'none',
7
+ });
@@ -4,7 +4,7 @@ import type * as Stitches from '@stitches/react';
4
4
  type BaseProps = Stitches.VariantProps<typeof TypographyContainer>;
5
5
  type BaseSizes = Exclude<BaseProps['size'], object>;
6
6
  type BaseVariants = Exclude<BaseProps['variant'], object>;
7
- type BaseAlign = Exclude<BaseProps['align'], object>;
7
+ export type BaseAlign = Exclude<BaseProps['align'], object>;
8
8
 
9
9
  // eslint-disable-next-line @typescript-eslint/no-magic-numbers
10
10
  type margin = 2 | 4 | 8 | 12;
@@ -1,2 +1,3 @@
1
1
  export { Typography } from './Typography';
2
+ export { NotSelectableTypography } from './NotSelectableTypography';
2
3
  export type { PropTypes as TypographyPropTypes } from './Typography.types';
@@ -51,3 +51,4 @@ export * from './TokenAmount';
51
51
  export * from './StepDetails';
52
52
  export * from './Popover';
53
53
  export * from './Flags';
54
+ export * from './Select';
@@ -30,7 +30,9 @@ export function ConnectWalletsModal(props: PropTypes) {
30
30
  title={i18n.t('Connect Wallets')}
31
31
  open={open}
32
32
  onClose={onClose}
33
- containerStyle={{ width: '75%', maxWidth: '30rem', height: '60%' }}>
33
+ styles={{
34
+ container: { width: '75%', maxWidth: '30rem', height: '60%' },
35
+ }}>
34
36
  <ModalContent>
35
37
  {list.map((info) => (
36
38
  <Wallet {...info} key={info.title} onClick={onSelect} />
@@ -0,0 +1,20 @@
1
+ import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
2
+
3
+ import React, { createElement } from 'react';
4
+
5
+ import { SvgIcon } from '../components/SvgIcon';
6
+
7
+ function SvgAutorenew(props: SvgIconPropsWithChildren) {
8
+ return createElement(
9
+ SvgIcon,
10
+ props,
11
+ <svg viewBox="0 0 24 24">
12
+ <path
13
+ fillRule="evenodd"
14
+ d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ );
19
+ }
20
+ export default SvgAutorenew;
@@ -0,0 +1,20 @@
1
+ import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
2
+
3
+ import React, { createElement } from 'react';
4
+
5
+ import { SvgIcon } from '../components/SvgIcon';
6
+
7
+ function SvgExit(props: SvgIconPropsWithChildren) {
8
+ return createElement(
9
+ SvgIcon,
10
+ props,
11
+ <svg viewBox="0 0 24 24">
12
+ <path
13
+ fillRule="evenodd"
14
+ d="M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ );
19
+ }
20
+ export default SvgExit;
@@ -0,0 +1,20 @@
1
+ import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
2
+
3
+ import React, { createElement } from 'react';
4
+
5
+ import { SvgIcon } from '../components/SvgIcon';
6
+
7
+ function SvgSwap(props: SvgIconPropsWithChildren) {
8
+ return createElement(
9
+ SvgIcon,
10
+ props,
11
+ <svg viewBox="0 0 24 24">
12
+ <path
13
+ fillRule="evenodd"
14
+ d="M6.99 11 3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ );
19
+ }
20
+ export default SvgSwap;
@@ -1,5 +1,6 @@
1
1
  export { default as AddIcon } from './Add';
2
2
  export { default as AutoThemeIcon } from './AutoTheme';
3
+ export { default as AutorenewIcon } from './Autorenew';
3
4
  export { default as BorderRadiusIcon } from './BorderRadius';
4
5
  export { default as ChevronDownIcon } from './ChevronDown';
5
6
  export { default as ChevronLeftIcon } from './ChevronLeft';
@@ -16,6 +17,7 @@ export { default as DesktopIcon } from './Desktop';
16
17
  export { default as DoneIcon } from './Done';
17
18
  export { default as EvmCategoryIcon } from './EvmCategory';
18
19
  export { default as ErrorIcon } from './Error';
20
+ export { default as ExitIcon } from './Exit';
19
21
  export { default as ExternalLinkIcon } from './ExternalLink';
20
22
  export { default as FontIcon } from './Font';
21
23
  export { default as GasIcon } from './Gas';
@@ -41,6 +43,7 @@ export { default as RefreshIcon } from './Refresh';
41
43
  export { default as ReverseIcon } from './Reverse';
42
44
  export { default as RouteIcon } from './Route';
43
45
  export { default as SearchIcon } from './Search';
46
+ export { default as SwapIcon } from './Swap';
44
47
  export { default as TimeIcon } from './Time';
45
48
  export { default as TransactionIcon } from './Transaction';
46
49
  export { default as UtxoCategoryIcon } from './UtxoCategory';