@lifi/widget 1.0.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 (313) hide show
  1. package/App.d.ts +4 -0
  2. package/App.js +18 -0
  3. package/AppDrawer.d.ts +14 -0
  4. package/AppDrawer.js +34 -0
  5. package/AppDrawer.style.d.ts +49 -0
  6. package/AppDrawer.style.js +52 -0
  7. package/AppProvider.d.ts +6 -0
  8. package/AppProvider.js +12 -0
  9. package/LICENSE.md +21 -0
  10. package/components/AppContainer.d.ts +5 -0
  11. package/components/AppContainer.js +53 -0
  12. package/components/BottomSheet/BottomSheet.d.ts +3 -0
  13. package/components/BottomSheet/BottomSheet.js +42 -0
  14. package/components/BottomSheet/index.d.ts +2 -0
  15. package/components/BottomSheet/index.js +2 -0
  16. package/components/BottomSheet/types.d.ts +10 -0
  17. package/components/BottomSheet/types.js +1 -0
  18. package/components/Card/Card.d.ts +8 -0
  19. package/components/Card/Card.js +8 -0
  20. package/components/Card/CardContainer.d.ts +11 -0
  21. package/components/Card/CardContainer.js +16 -0
  22. package/components/Card/CardHeader.d.ts +18 -0
  23. package/components/Card/CardHeader.js +20 -0
  24. package/components/Card/CardTitle.d.ts +14 -0
  25. package/components/Card/CardTitle.js +9 -0
  26. package/components/Card/index.d.ts +4 -0
  27. package/components/Card/index.js +4 -0
  28. package/components/Header/Header.d.ts +2 -0
  29. package/components/Header/Header.js +17 -0
  30. package/components/Header/Header.style.d.ts +22 -0
  31. package/components/Header/Header.style.js +21 -0
  32. package/components/Header/NavigationHeader.d.ts +2 -0
  33. package/components/Header/NavigationHeader.js +46 -0
  34. package/components/Header/WalletHeader.d.ts +2 -0
  35. package/components/Header/WalletHeader.js +28 -0
  36. package/components/Header/index.d.ts +1 -0
  37. package/components/Header/index.js +1 -0
  38. package/components/Input.d.ts +1 -0
  39. package/components/Input.js +14 -0
  40. package/components/LiFiLogo.d.ts +5 -0
  41. package/components/LiFiLogo.js +7 -0
  42. package/components/PoweredBy.d.ts +2 -0
  43. package/components/PoweredBy.js +14 -0
  44. package/components/ProgressToNextUpdate/ProgressToNextUpdate.d.ts +7 -0
  45. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +49 -0
  46. package/components/ProgressToNextUpdate/index.d.ts +1 -0
  47. package/components/ProgressToNextUpdate/index.js +1 -0
  48. package/components/ReverseTokensButton/ReverseTokensButton.d.ts +4 -0
  49. package/components/ReverseTokensButton/ReverseTokensButton.js +24 -0
  50. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +29 -0
  51. package/components/ReverseTokensButton/ReverseTokensButton.style.js +14 -0
  52. package/components/ReverseTokensButton/index.d.ts +1 -0
  53. package/components/ReverseTokensButton/index.js +1 -0
  54. package/components/Select.d.ts +3 -0
  55. package/components/Select.js +27 -0
  56. package/components/SelectChainAndToken.d.ts +3 -0
  57. package/components/SelectChainAndToken.js +19 -0
  58. package/components/SelectTokenButton/SelectTokenButton.d.ts +5 -0
  59. package/components/SelectTokenButton/SelectTokenButton.js +29 -0
  60. package/components/SelectTokenButton/SelectTokenButton.style.d.ts +28 -0
  61. package/components/SelectTokenButton/SelectTokenButton.style.js +31 -0
  62. package/components/SelectTokenButton/index.d.ts +1 -0
  63. package/components/SelectTokenButton/index.js +1 -0
  64. package/components/StepActions/StepActions.d.ts +13 -0
  65. package/components/StepActions/StepActions.js +49 -0
  66. package/components/StepActions/StepActions.style.d.ts +20 -0
  67. package/components/StepActions/StepActions.style.js +56 -0
  68. package/components/StepActions/index.d.ts +1 -0
  69. package/components/StepActions/index.js +1 -0
  70. package/components/StepActions/types.d.ts +6 -0
  71. package/components/StepActions/types.js +1 -0
  72. package/components/StepToken.d.ts +6 -0
  73. package/components/StepToken.js +21 -0
  74. package/components/SwapButton/ButtonTooltip.d.ts +4 -0
  75. package/components/SwapButton/ButtonTooltip.js +3 -0
  76. package/components/SwapButton/SwapButton.d.ts +2 -0
  77. package/components/SwapButton/SwapButton.js +77 -0
  78. package/components/SwapButton/SwapButton.style.d.ts +65 -0
  79. package/components/SwapButton/SwapButton.style.js +20 -0
  80. package/components/SwapButton/index.d.ts +1 -0
  81. package/components/SwapButton/index.js +1 -0
  82. package/components/SwapInProgress/SwapInProgress.d.ts +3 -0
  83. package/components/SwapInProgress/SwapInProgress.js +22 -0
  84. package/components/SwapInProgress/SwapInProgress.style.d.ts +43 -0
  85. package/components/SwapInProgress/SwapInProgress.style.js +15 -0
  86. package/components/SwapInProgress/index.d.ts +1 -0
  87. package/components/SwapInProgress/index.js +1 -0
  88. package/components/SwapInput/FormPriceHelperText.d.ts +5 -0
  89. package/components/SwapInput/FormPriceHelperText.js +27 -0
  90. package/components/SwapInput/SwapInput.d.ts +3 -0
  91. package/components/SwapInput/SwapInput.js +43 -0
  92. package/components/SwapInput/SwapInput.style.d.ts +21 -0
  93. package/components/SwapInput/SwapInput.style.js +30 -0
  94. package/components/SwapInput/SwapInputAdornment.d.ts +2 -0
  95. package/components/SwapInput/SwapInputAdornment.js +23 -0
  96. package/components/SwapInput/SwapInputAdornment.style.d.ts +34 -0
  97. package/components/SwapInput/SwapInputAdornment.style.js +22 -0
  98. package/components/SwapInput/index.d.ts +1 -0
  99. package/components/SwapInput/index.js +1 -0
  100. package/components/SwapRouteCard/SwapRouteCard.d.ts +4 -0
  101. package/components/SwapRouteCard/SwapRouteCard.js +34 -0
  102. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +36 -0
  103. package/components/SwapRouteCard/SwapRouteCard.style.js +71 -0
  104. package/components/SwapRouteCard/index.d.ts +1 -0
  105. package/components/SwapRouteCard/index.js +1 -0
  106. package/components/SwapRouteCard/types.d.ts +7 -0
  107. package/components/SwapRouteCard/types.js +1 -0
  108. package/components/SwapRoutes/SwapRoutes.d.ts +3 -0
  109. package/components/SwapRoutes/SwapRoutes.js +33 -0
  110. package/components/SwapRoutes/SwapRoutes.style.d.ts +11 -0
  111. package/components/SwapRoutes/SwapRoutes.style.js +9 -0
  112. package/components/SwapRoutes/SwapRoutesUpdateProgress.d.ts +3 -0
  113. package/components/SwapRoutes/SwapRoutesUpdateProgress.js +24 -0
  114. package/components/SwapRoutes/index.d.ts +1 -0
  115. package/components/SwapRoutes/index.js +1 -0
  116. package/components/Switch.d.ts +1 -0
  117. package/components/Switch.js +53 -0
  118. package/components/TextFitter/TextFitter.d.ts +3 -0
  119. package/components/TextFitter/TextFitter.js +44 -0
  120. package/components/TextFitter/index.d.ts +1 -0
  121. package/components/TextFitter/index.js +1 -0
  122. package/components/TextFitter/types.d.ts +12 -0
  123. package/components/TextFitter/types.js +1 -0
  124. package/components/TokenList/TokenList.d.ts +3 -0
  125. package/components/TokenList/TokenList.js +58 -0
  126. package/components/TokenList/TokenList.style.d.ts +32 -0
  127. package/components/TokenList/TokenList.style.js +22 -0
  128. package/components/TokenList/TokenListItem.d.ts +4 -0
  129. package/components/TokenList/TokenListItem.js +24 -0
  130. package/components/TokenList/index.d.ts +1 -0
  131. package/components/TokenList/index.js +1 -0
  132. package/components/TokenList/types.d.ts +16 -0
  133. package/components/TokenList/types.js +1 -0
  134. package/components/TokenList/utils.d.ts +15 -0
  135. package/components/TokenList/utils.js +10 -0
  136. package/config/env.d.ts +12 -0
  137. package/config/env.js +19 -0
  138. package/config/queryClient.d.ts +2 -0
  139. package/config/queryClient.js +25 -0
  140. package/config/rpcs.d.ts +1 -0
  141. package/config/rpcs.js +20 -0
  142. package/config/theme.d.ts +27 -0
  143. package/config/theme.js +126 -0
  144. package/hooks/index.d.ts +15 -0
  145. package/hooks/index.js +15 -0
  146. package/hooks/useBridges.d.ts +1 -0
  147. package/hooks/useBridges.js +12 -0
  148. package/hooks/useChain.d.ts +4 -0
  149. package/hooks/useChain.js +13 -0
  150. package/hooks/useChains.d.ts +101 -0
  151. package/hooks/useChains.js +39 -0
  152. package/hooks/useContentHeight.d.ts +1 -0
  153. package/hooks/useContentHeight.js +15 -0
  154. package/hooks/useDebouncedWatch.d.ts +1 -0
  155. package/hooks/useDebouncedWatch.js +27 -0
  156. package/hooks/useExchanges.d.ts +1 -0
  157. package/hooks/useExchanges.js +12 -0
  158. package/hooks/useHasSufficientBalance.d.ts +5 -0
  159. package/hooks/useHasSufficientBalance.js +59 -0
  160. package/hooks/useRouteExecution/index.d.ts +3 -0
  161. package/hooks/useRouteExecution/index.js +3 -0
  162. package/hooks/useRouteExecution/types.d.ts +15 -0
  163. package/hooks/useRouteExecution/types.js +1 -0
  164. package/hooks/useRouteExecution/useRouteExecution.d.ts +8 -0
  165. package/hooks/useRouteExecution/useRouteExecution.js +132 -0
  166. package/hooks/useRouteExecution/useRouteStore.d.ts +17 -0
  167. package/hooks/useRouteExecution/useRouteStore.js +71 -0
  168. package/hooks/useScrollableContainer.d.ts +2 -0
  169. package/hooks/useScrollableContainer.js +24 -0
  170. package/hooks/useSettings/index.d.ts +2 -0
  171. package/hooks/useSettings/index.js +2 -0
  172. package/hooks/useSettings/types.d.ts +5 -0
  173. package/hooks/useSettings/types.js +1 -0
  174. package/hooks/useSettings/useSettingsStore.d.ts +13 -0
  175. package/hooks/useSettings/useSettingsStore.js +22 -0
  176. package/hooks/useSwapRoutes.d.ts +8 -0
  177. package/hooks/useSwapRoutes.js +101 -0
  178. package/hooks/useToken.d.ts +4 -0
  179. package/hooks/useToken.js +13 -0
  180. package/hooks/useTokenBalance.d.ts +7 -0
  181. package/hooks/useTokenBalance.js +46 -0
  182. package/hooks/useTokenBalances.d.ts +7 -0
  183. package/hooks/useTokenBalances.js +54 -0
  184. package/hooks/useTokens.d.ts +5 -0
  185. package/hooks/useTokens.js +24 -0
  186. package/i18n/en/translation.json +138 -0
  187. package/i18n/index.d.ts +144 -0
  188. package/i18n/index.js +20 -0
  189. package/i18n/react-i18next.d.ts +9 -0
  190. package/index.d.ts +5 -0
  191. package/index.js +9 -0
  192. package/lifi.d.ts +2 -0
  193. package/lifi.js +10 -0
  194. package/package.json +55 -0
  195. package/pages/MainPage/MainPage.d.ts +2 -0
  196. package/pages/MainPage/MainPage.js +11 -0
  197. package/pages/MainPage/MainPage.style.d.ts +11 -0
  198. package/pages/MainPage/MainPage.style.js +8 -0
  199. package/pages/MainPage/SendToRecipientForm.d.ts +2 -0
  200. package/pages/MainPage/SendToRecipientForm.js +20 -0
  201. package/pages/MainPage/index.d.ts +1 -0
  202. package/pages/MainPage/index.js +1 -0
  203. package/pages/SelectTokenPage/ChainSelect.d.ts +2 -0
  204. package/pages/SelectTokenPage/ChainSelect.js +25 -0
  205. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  206. package/pages/SelectTokenPage/SearchTokenInput.js +17 -0
  207. package/pages/SelectTokenPage/SearchTokenInput.style.d.ts +1 -0
  208. package/pages/SelectTokenPage/SearchTokenInput.style.js +5 -0
  209. package/pages/SelectTokenPage/SelectTokenPage.d.ts +5 -0
  210. package/pages/SelectTokenPage/SelectTokenPage.js +16 -0
  211. package/pages/SelectTokenPage/index.d.ts +2 -0
  212. package/pages/SelectTokenPage/index.js +2 -0
  213. package/pages/SelectTokenPage/types.d.ts +4 -0
  214. package/pages/SelectTokenPage/types.js +5 -0
  215. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  216. package/pages/SelectWalletPage/SelectWalletPage.js +68 -0
  217. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +46 -0
  218. package/pages/SelectWalletPage/SelectWalletPage.style.js +27 -0
  219. package/pages/SelectWalletPage/index.d.ts +1 -0
  220. package/pages/SelectWalletPage/index.js +1 -0
  221. package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  222. package/pages/SettingsPage/AdvancedPreferences.js +19 -0
  223. package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +2 -0
  224. package/pages/SettingsPage/ColorSchemeButtonGroup.js +20 -0
  225. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +33 -0
  226. package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +16 -0
  227. package/pages/SettingsPage/EnabledBridgesSelect.d.ts +2 -0
  228. package/pages/SettingsPage/EnabledBridgesSelect.js +15 -0
  229. package/pages/SettingsPage/EnabledExchangesSelect.d.ts +2 -0
  230. package/pages/SettingsPage/EnabledExchangesSelect.js +15 -0
  231. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  232. package/pages/SettingsPage/GasPriceSelect.js +13 -0
  233. package/pages/SettingsPage/RoutePrioritySelect.d.ts +2 -0
  234. package/pages/SettingsPage/RoutePrioritySelect.js +13 -0
  235. package/pages/SettingsPage/SettingsPage.d.ts +1 -0
  236. package/pages/SettingsPage/SettingsPage.js +10 -0
  237. package/pages/SettingsPage/SlippageInput.d.ts +1 -0
  238. package/pages/SettingsPage/SlippageInput.js +28 -0
  239. package/pages/SettingsPage/index.d.ts +1 -0
  240. package/pages/SettingsPage/index.js +1 -0
  241. package/pages/SwapPage/CircularProgress.d.ts +4 -0
  242. package/pages/SwapPage/CircularProgress.js +20 -0
  243. package/pages/SwapPage/CircularProgress.style.d.ts +6 -0
  244. package/pages/SwapPage/CircularProgress.style.js +51 -0
  245. package/pages/SwapPage/ExecutionItem.d.ts +6 -0
  246. package/pages/SwapPage/ExecutionItem.js +21 -0
  247. package/pages/SwapPage/ExecutionItem.style.d.ts +39 -0
  248. package/pages/SwapPage/ExecutionItem.style.js +5 -0
  249. package/pages/SwapPage/StatusBottomSheet.d.ts +3 -0
  250. package/pages/SwapPage/StatusBottomSheet.js +79 -0
  251. package/pages/SwapPage/StatusBottomSheet.style.d.ts +25 -0
  252. package/pages/SwapPage/StatusBottomSheet.style.js +32 -0
  253. package/pages/SwapPage/StepDivider.d.ts +2 -0
  254. package/pages/SwapPage/StepDivider.js +6 -0
  255. package/pages/SwapPage/StepDivider.style.d.ts +11 -0
  256. package/pages/SwapPage/StepDivider.style.js +8 -0
  257. package/pages/SwapPage/StepItem.d.ts +7 -0
  258. package/pages/SwapPage/StepItem.js +29 -0
  259. package/pages/SwapPage/StepTimer.d.ts +5 -0
  260. package/pages/SwapPage/StepTimer.js +59 -0
  261. package/pages/SwapPage/SwapPage.d.ts +2 -0
  262. package/pages/SwapPage/SwapPage.js +22 -0
  263. package/pages/SwapPage/SwapPage.style.d.ts +44 -0
  264. package/pages/SwapPage/SwapPage.style.js +12 -0
  265. package/pages/SwapPage/index.d.ts +1 -0
  266. package/pages/SwapPage/index.js +1 -0
  267. package/pages/SwapPage/utils.d.ts +6 -0
  268. package/pages/SwapPage/utils.js +85 -0
  269. package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +3 -0
  270. package/pages/SwapRoutesPage/SwapRoutesPage.js +24 -0
  271. package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +11 -0
  272. package/pages/SwapRoutesPage/SwapRoutesPage.style.js +6 -0
  273. package/pages/SwapRoutesPage/index.d.ts +1 -0
  274. package/pages/SwapRoutesPage/index.js +1 -0
  275. package/providers/SwapFormProvider/SwapFormProvider.d.ts +2 -0
  276. package/providers/SwapFormProvider/SwapFormProvider.js +20 -0
  277. package/providers/SwapFormProvider/index.d.ts +2 -0
  278. package/providers/SwapFormProvider/index.js +2 -0
  279. package/providers/SwapFormProvider/types.d.ts +44 -0
  280. package/providers/SwapFormProvider/types.js +24 -0
  281. package/providers/ThemeProvider/ThemeProvider.d.ts +2 -0
  282. package/providers/ThemeProvider/ThemeProvider.js +33 -0
  283. package/providers/ThemeProvider/index.d.ts +1 -0
  284. package/providers/ThemeProvider/index.js +1 -0
  285. package/providers/WalletProvider/WalletProvider.d.ts +4 -0
  286. package/providers/WalletProvider/WalletProvider.js +89 -0
  287. package/providers/WalletProvider/index.d.ts +2 -0
  288. package/providers/WalletProvider/index.js +2 -0
  289. package/providers/WalletProvider/types.d.ts +17 -0
  290. package/providers/WalletProvider/types.js +1 -0
  291. package/providers/WidgetProvider/WidgetProvider.d.ts +4 -0
  292. package/providers/WidgetProvider/WidgetProvider.js +44 -0
  293. package/providers/WidgetProvider/index.d.ts +2 -0
  294. package/providers/WidgetProvider/index.js +2 -0
  295. package/providers/WidgetProvider/types.d.ts +8 -0
  296. package/providers/WidgetProvider/types.js +1 -0
  297. package/react-app-env.d.ts +1 -0
  298. package/types/index.d.ts +1 -0
  299. package/types/index.js +1 -0
  300. package/types/widget.d.ts +41 -0
  301. package/types/widget.js +1 -0
  302. package/utils/colors.d.ts +2 -0
  303. package/utils/colors.js +3 -0
  304. package/utils/deepClone.d.ts +1 -0
  305. package/utils/deepClone.js +3 -0
  306. package/utils/elements.d.ts +4 -0
  307. package/utils/elements.js +5 -0
  308. package/utils/format.d.ts +9 -0
  309. package/utils/format.js +76 -0
  310. package/utils/input.d.ts +1 -0
  311. package/utils/input.js +24 -0
  312. package/utils/routes.d.ts +10 -0
  313. package/utils/routes.js +9 -0
@@ -0,0 +1,68 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { supportedWallets } from '@lifi/wallet-management';
12
+ import { Avatar, Button, Container, Dialog, DialogActions, DialogContent, DialogContentText, List, ListItemAvatar, } from '@mui/material';
13
+ import { useCallback, useState } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useNavigate } from 'react-router-dom';
16
+ import { useScrollableContainer } from '../../hooks';
17
+ import { useWallet } from '../../providers/WalletProvider';
18
+ import { WalletListItemButton, WalletListItemText, } from './SelectWalletPage.style';
19
+ export const SelectWalletPage = () => {
20
+ var _a;
21
+ const { t } = useTranslation();
22
+ const navigate = useNavigate();
23
+ const { connect } = useWallet();
24
+ const containerElement = useScrollableContainer();
25
+ const [walletIdentity, setWalletIdentity] = useState({ show: false });
26
+ const closeDialog = () => {
27
+ setWalletIdentity({
28
+ show: false,
29
+ });
30
+ };
31
+ const handleConnect = useCallback((event, wallet) => __awaiter(void 0, void 0, void 0, function* () {
32
+ const { ethereum } = window;
33
+ const identityCheckPassed = wallet.checkProviderIdentity({
34
+ provider: ethereum,
35
+ });
36
+ if (!identityCheckPassed) {
37
+ setWalletIdentity({
38
+ show: true,
39
+ wallet,
40
+ });
41
+ return;
42
+ }
43
+ navigate(-1);
44
+ yield connect(wallet);
45
+ }), [connect, navigate]);
46
+ return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsx(List, Object.assign({ sx: {
47
+ paddingLeft: 2,
48
+ paddingRight: 2,
49
+ } }, { children: supportedWallets.map((wallet) => (_jsxs(WalletListItemButton, Object.assign({ onClick: (event) => handleConnect(event, wallet), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), _jsx(WalletListItemText, { primary: wallet.name })] }), wallet.name))) })), _jsxs(Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog, container: containerElement, sx: {
50
+ position: 'absolute',
51
+ overflow: 'hidden',
52
+ }, PaperProps: {
53
+ sx: (theme) => ({
54
+ position: 'absolute',
55
+ backgroundImage: 'none',
56
+ borderTopLeftRadius: theme.shape.borderRadius,
57
+ borderTopRightRadius: theme.shape.borderRadius,
58
+ }),
59
+ }, BackdropProps: {
60
+ sx: {
61
+ position: 'absolute',
62
+ backgroundColor: 'rgb(0 0 0 / 48%)',
63
+ backdropFilter: 'blur(3px)',
64
+ },
65
+ } }, { children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('wallet.extensionNotFound', {
66
+ name: (_a = walletIdentity.wallet) === null || _a === void 0 ? void 0 : _a.name,
67
+ }) }) }), _jsx(DialogActions, { children: _jsx(Button, Object.assign({ onClick: closeDialog, autoFocus: true }, { children: t('button.ok') })) })] }))] })));
68
+ };
@@ -0,0 +1,46 @@
1
+ /// <reference types="react" />
2
+ export declare const WalletListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
+ centerRipple?: boolean | undefined;
5
+ children?: import("react").ReactNode;
6
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
7
+ disabled?: boolean | undefined;
8
+ disableRipple?: boolean | undefined;
9
+ disableTouchRipple?: boolean | undefined;
10
+ focusRipple?: boolean | undefined;
11
+ focusVisibleClassName?: string | undefined;
12
+ LinkComponent?: import("react").ElementType<any> | undefined;
13
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
14
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
+ tabIndex?: number | undefined;
16
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
17
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
+ }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "selected" | "disableGutters" | "divider"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ export declare const WalletListItem: import("@emotion/styled").StyledComponent<{
22
+ button?: false | undefined;
23
+ } & import("@mui/material").ListItemBaseProps & {
24
+ components?: {
25
+ Root?: import("react").ElementType<any> | undefined;
26
+ } | undefined;
27
+ componentsProps?: {
28
+ root?: (import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides) | undefined;
29
+ } | undefined;
30
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
31
+ ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
32
+ }, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "components" | "componentsProps" | "selected" | "disableGutters" | "divider" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
33
+ export declare const WalletListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
34
+ export declare const WalletIdentityPopoverContent: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
+ align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
36
+ children?: import("react").ReactNode;
37
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
38
+ gutterBottom?: boolean | undefined;
39
+ noWrap?: boolean | undefined;
40
+ paragraph?: boolean | undefined;
41
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
42
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
43
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
44
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
45
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
46
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,27 @@
1
+ import { ListItem, ListItemButton, ListItemText, Typography, } from '@mui/material';
2
+ import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
3
+ import { listItemTextClasses } from '@mui/material/ListItemText';
4
+ import { styled } from '@mui/material/styles';
5
+ import { getContrastAlphaColor } from '../../utils/colors';
6
+ export const WalletListItemButton = styled(ListItemButton)(({ theme }) => ({
7
+ borderRadius: theme.shape.borderRadiusSecondary,
8
+ paddingLeft: theme.spacing(1.5),
9
+ height: 64,
10
+ '&:hover': {
11
+ backgroundColor: getContrastAlphaColor(theme, '4%'),
12
+ },
13
+ }));
14
+ export const WalletListItem = styled(ListItem)(({ theme }) => ({
15
+ padding: theme.spacing(1.5),
16
+ [`.${listItemSecondaryActionClasses.root}`]: {
17
+ right: theme.spacing(3),
18
+ },
19
+ }));
20
+ export const WalletListItemText = styled(ListItemText)(({ theme }) => ({
21
+ [`.${listItemTextClasses.primary}`]: {
22
+ fontWeight: 400,
23
+ },
24
+ }));
25
+ export const WalletIdentityPopoverContent = styled(Typography)({
26
+ maxWidth: 400,
27
+ });
@@ -0,0 +1 @@
1
+ export * from './SelectWalletPage';
@@ -0,0 +1 @@
1
+ export * from './SelectWalletPage';
@@ -0,0 +1 @@
1
+ export declare const AdvancedPreferences: () => JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Typography } from '@mui/material';
3
+ import { useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { Switch } from '../../components/Switch';
6
+ import { EnabledBridgesSelect } from './EnabledBridgesSelect';
7
+ import { EnabledExchangesSelect } from './EnabledExchangesSelect';
8
+ export const AdvancedPreferences = () => {
9
+ const { t } = useTranslation();
10
+ const [advancedPreferences, setAdvancedPreferences] = useState(false);
11
+ const handleAdvancedPreferences = (_, checked) => {
12
+ setAdvancedPreferences(checked);
13
+ };
14
+ return (_jsxs(Box, Object.assign({ p: 3 }, { children: [_jsxs(Box, Object.assign({ sx: {
15
+ display: 'flex',
16
+ justifyContent: 'space-between',
17
+ alignItems: 'center',
18
+ } }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.advancedPreferences`) })) })), _jsx(Switch, { value: advancedPreferences, onChange: handleAdvancedPreferences })] })), advancedPreferences && (_jsxs(Box, Object.assign({ mt: 3, mb: 1 }, { children: [_jsx(EnabledBridgesSelect, {}), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(EnabledExchangesSelect, {}) }))] })))] })));
19
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ColorSchemeButtonGroup: React.FC;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Brightness4 as Brightness4Icon, DarkMode as DarkModeIcon, LightMode as LightModeIcon, } from '@mui/icons-material';
3
+ import { Box, ToggleButtonGroup } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useAppearance } from '../../hooks';
6
+ import { useWidgetConfig } from '../../providers/WidgetProvider';
7
+ import { ToggleButton } from './ColorSchemeButtonGroup.style';
8
+ export const ColorSchemeButtonGroup = () => {
9
+ const { t } = useTranslation();
10
+ const { disableAppearance } = useWidgetConfig();
11
+ const [appearance, setAppearance] = useAppearance();
12
+ if (disableAppearance) {
13
+ return null;
14
+ }
15
+ return (_jsx(Box, Object.assign({ pb: 2 }, { children: _jsxs(ToggleButtonGroup, Object.assign({ color: "primary", value: appearance, onChange: (_, value) => {
16
+ if (value) {
17
+ setAppearance(value);
18
+ }
19
+ }, exclusive: true, fullWidth: true }, { children: [_jsxs(ToggleButton, Object.assign({ value: "light" }, { children: [_jsx(LightModeIcon, { sx: { marginRight: 1 } }), t('button.light')] })), _jsxs(ToggleButton, Object.assign({ value: "dark" }, { children: [_jsx(DarkModeIcon, { sx: { marginRight: 1 } }), t('button.dark')] })), _jsxs(ToggleButton, Object.assign({ value: "auto" }, { children: [_jsx(Brightness4Icon, { sx: { marginRight: 1 } }), t('button.auto')] }))] })) })));
20
+ };
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
5
+ color?: "success" | "error" | "primary" | "secondary" | "info" | "warning" | "standard" | undefined;
6
+ disabled?: boolean | undefined;
7
+ disableFocusRipple?: boolean | undefined;
8
+ fullWidth?: boolean | undefined;
9
+ onChange?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>, value: any) => void) | undefined;
10
+ onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>, value: any) => void) | undefined;
11
+ selected?: boolean | undefined;
12
+ size?: "small" | "large" | "medium" | undefined;
13
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
14
+ value: unknown;
15
+ } & Omit<{
16
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
17
+ centerRipple?: boolean | undefined;
18
+ children?: import("react").ReactNode;
19
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
20
+ disabled?: boolean | undefined;
21
+ disableRipple?: boolean | undefined;
22
+ disableTouchRipple?: boolean | undefined;
23
+ focusRipple?: boolean | undefined;
24
+ focusVisibleClassName?: string | undefined;
25
+ LinkComponent?: import("react").ElementType<any> | undefined;
26
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
27
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
28
+ tabIndex?: number | undefined;
29
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
30
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
31
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
32
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
33
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "onChange" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth" | "size" | "value" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,16 @@
1
+ import { ToggleButton as MuiToggleButton } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ import { toggleButtonClasses } from '@mui/material/ToggleButton';
4
+ export const ToggleButton = styled(MuiToggleButton)(({ theme }) => ({
5
+ textTransform: 'none',
6
+ borderRadius: theme.shape.borderRadius,
7
+ borderColor: theme.palette.mode === 'light'
8
+ ? theme.palette.grey[300]
9
+ : theme.palette.grey[800],
10
+ [`&.${toggleButtonClasses.selected}`]: {
11
+ color: theme.palette.mode === 'light'
12
+ ? theme.palette.primary.main
13
+ : theme.palette.primary.light,
14
+ borderColor: 'currentColor !important',
15
+ },
16
+ }));
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EnabledBridgesSelect: React.FC;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
+ import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
4
+ import { useFormContext } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { CardContainer, CardTitle } from '../../components/Card';
7
+ import { Select } from '../../components/Select';
8
+ import { useBridges } from '../../hooks';
9
+ import { SwapFormKey } from '../../providers/SwapFormProvider';
10
+ export const EnabledBridgesSelect = () => {
11
+ const { t } = useTranslation();
12
+ const { register } = useFormContext();
13
+ const bridges = useBridges();
14
+ return bridges.length ? (_jsxs(CardContainer, { children: [_jsx(CardTitle, { children: t(`settings.enabledBridges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledBridges`), defaultValue: bridges, MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, inputProps: Object.assign({}, register(SwapFormKey.EnabledBridges)), renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => (_jsx(Chip, { label: value }, value))) }))) }, { children: bridges.map((bridge) => (_jsx(MenuItem, Object.assign({ value: bridge }, { children: bridge }), bridge))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 134, sx: { borderRadius: 1 } }));
15
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EnabledExchangesSelect: React.FC;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
+ import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
4
+ import { useFormContext } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { CardContainer, CardTitle } from '../../components/Card';
7
+ import { Select } from '../../components/Select';
8
+ import { useExchanges } from '../../hooks';
9
+ import { SwapFormKey } from '../../providers/SwapFormProvider';
10
+ export const EnabledExchangesSelect = () => {
11
+ const { t } = useTranslation();
12
+ const { register } = useFormContext();
13
+ const exchanges = useExchanges();
14
+ return exchanges.length ? (_jsxs(CardContainer, { children: [_jsx(CardTitle, { children: t(`settings.enabledExchanges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledExchanges`), defaultValue: exchanges, MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, inputProps: Object.assign({}, register(SwapFormKey.EnabledExchanges)), renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => (_jsx(Chip, { label: value }, value))) }))) }, { children: exchanges.map((exchange) => (_jsx(MenuItem, Object.assign({ value: exchange }, { children: exchange }), exchange))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 206, sx: { borderRadius: 1 } }));
15
+ };
@@ -0,0 +1 @@
1
+ export declare const GasPriceSelect: () => JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
+ import { FormControl, MenuItem } from '@mui/material';
4
+ import { useFormContext } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { CardContainer, CardTitle } from '../../components/Card';
7
+ import { Select } from '../../components/Select';
8
+ import { SwapFormKey } from '../../providers/SwapFormProvider';
9
+ export const GasPriceSelect = () => {
10
+ const { t } = useTranslation();
11
+ const { register } = useFormContext();
12
+ return (_jsxs(CardContainer, Object.assign({ flex: 1 }, { children: [_jsx(CardTitle, { children: t(`settings.gasPrice.title`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsxs(Select, Object.assign({ defaultValue: "normal", MenuProps: { elevation: 2 }, inputProps: Object.assign({}, register(SwapFormKey.GasPrice)), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: [_jsx(MenuItem, Object.assign({ value: "slow" }, { children: t(`settings.gasPrice.slow`) })), _jsx(MenuItem, Object.assign({ value: "normal" }, { children: t(`settings.gasPrice.normal`) })), _jsx(MenuItem, Object.assign({ value: "fast" }, { children: t(`settings.gasPrice.fast`) }))] })) }))] })));
13
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const RoutePrioritySelect: React.FC;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
+ import { FormControl, MenuItem } from '@mui/material';
4
+ import { useFormContext } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { CardContainer, CardTitle } from '../../components/Card';
7
+ import { Select } from '../../components/Select';
8
+ import { SwapFormKey } from '../../providers/SwapFormProvider';
9
+ export const RoutePrioritySelect = () => {
10
+ const { t } = useTranslation();
11
+ const { register } = useFormContext();
12
+ return (_jsxs(CardContainer, { children: [_jsx(CardTitle, { children: t(`settings.routePriority.title`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ defaultValue: 1, MenuProps: { elevation: 2 }, inputProps: Object.assign({}, register(SwapFormKey.RoutePriority)), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: _jsx(MenuItem, Object.assign({ value: 1 }, { children: t(`settings.routePriority.recommended`) })) })) }))] }));
13
+ };
@@ -0,0 +1 @@
1
+ export declare const SettingsPage: () => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Container } from '@mui/material';
3
+ import { AdvancedPreferences } from './AdvancedPreferences';
4
+ import { ColorSchemeButtonGroup } from './ColorSchemeButtonGroup';
5
+ import { GasPriceSelect } from './GasPriceSelect';
6
+ import { RoutePrioritySelect } from './RoutePrioritySelect';
7
+ import { SlippageInput } from './SlippageInput';
8
+ export const SettingsPage = () => {
9
+ return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [_jsx(Box, Object.assign({ pr: 2, flex: 1 }, { children: _jsx(SlippageInput, {}) })), _jsx(GasPriceSelect, {})] }))] })), _jsx(AdvancedPreferences, {})] })));
10
+ };
@@ -0,0 +1 @@
1
+ export declare const SlippageInput: () => JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FormControl, InputAdornment } from '@mui/material';
3
+ import { useRef } from 'react';
4
+ import { useFormContext, useWatch } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { CardContainer, CardTitle } from '../../components/Card';
7
+ import { Input } from '../../components/Input';
8
+ import { SwapFormKey } from '../../providers/SwapFormProvider';
9
+ import { formatSlippage } from '../../utils/format';
10
+ export const SlippageInput = () => {
11
+ const { t } = useTranslation();
12
+ const { setValue } = useFormContext();
13
+ const value = useWatch({
14
+ name: SwapFormKey.Slippage,
15
+ });
16
+ const defaultValue = useRef(value);
17
+ const handleChange = (event) => {
18
+ const { value } = event.target;
19
+ setValue(SwapFormKey.Slippage, formatSlippage(value, defaultValue.current, true));
20
+ };
21
+ const handleBlur = (event) => {
22
+ const { value } = event.target;
23
+ setValue(SwapFormKey.Slippage, formatSlippage(value, defaultValue.current));
24
+ };
25
+ return (_jsxs(CardContainer, { children: [_jsx(CardTitle, { children: t(`settings.slippage`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Input, { size: "small", placeholder: t(`settings.slippage`), endAdornment: _jsx(InputAdornment, Object.assign({ position: "end" }, { children: "%" })), autoComplete: "off", inputProps: {
26
+ inputMode: 'decimal',
27
+ }, onChange: handleChange, onBlur: handleBlur, value: value, name: SwapFormKey.Slippage }) }))] }));
28
+ };
@@ -0,0 +1 @@
1
+ export * from './SettingsPage';
@@ -0,0 +1 @@
1
+ export * from './SettingsPage';
@@ -0,0 +1,4 @@
1
+ import { Status } from '@lifinance/sdk';
2
+ export declare function CircularProgress({ status }: {
3
+ status: Status;
4
+ }): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Done as DoneIcon, Info as InfoIcon, Warning as WarningIcon, } from '@mui/icons-material';
3
+ import { Box } from '@mui/material';
4
+ import { CircularProgress as CircularProgressStyled, CircularProgressPending, } from './CircularProgress.style';
5
+ export function CircularProgress({ status }) {
6
+ return (_jsxs(Box, Object.assign({ sx: {
7
+ display: 'grid',
8
+ position: 'relative',
9
+ placeItems: 'center',
10
+ } }, { children: [_jsx(CircularProgressStyled, { variant: "determinate", status: status, size: 32, thickness: 3, value: 100 }), status === 'STARTED' || status === 'PENDING' ? (_jsx(CircularProgressPending, { size: 32, thickness: 3 })) : null, status === 'ACTION_REQUIRED' ? (_jsx(InfoIcon, { color: "primary", sx: {
11
+ position: 'absolute',
12
+ fontSize: '1rem',
13
+ } })) : null, status === 'DONE' ? (_jsx(DoneIcon, { color: "success", sx: {
14
+ position: 'absolute',
15
+ fontSize: '1rem',
16
+ } })) : null, status === 'FAILED' ? (_jsx(WarningIcon, { color: "error", sx: {
17
+ position: 'absolute',
18
+ fontSize: '1rem',
19
+ } })) : null] })));
20
+ }
@@ -0,0 +1,6 @@
1
+ import { Status } from '@lifinance/sdk';
2
+ import { Theme } from '@mui/material';
3
+ export declare const CircularProgress: import("@emotion/styled").StyledComponent<import("@mui/material").CircularProgressProps & import("@mui/system").MUIStyledCommonProps<Theme> & {
4
+ status: Status;
5
+ }, {}, {}>;
6
+ export declare const CircularProgressPending: import("@emotion/styled").StyledComponent<import("@mui/material").CircularProgressProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
@@ -0,0 +1,51 @@
1
+ import { CircularProgress as MuiCircularProgress } from '@mui/material';
2
+ import { circularProgressClasses } from '@mui/material/CircularProgress';
3
+ import { keyframes, styled } from '@mui/material/styles';
4
+ const circleAnimation = keyframes({
5
+ '0%': {
6
+ strokeDashoffset: 129,
7
+ transform: 'rotate(0)',
8
+ },
9
+ '50%': {
10
+ strokeDashoffset: 56,
11
+ transform: 'rotate(45deg)',
12
+ },
13
+ '100%': {
14
+ strokeDashoffset: 129,
15
+ transform: 'rotate(360deg)',
16
+ },
17
+ });
18
+ const getStatusColor = (status, theme) => {
19
+ switch (status) {
20
+ case 'ACTION_REQUIRED':
21
+ return theme.palette.primary.main;
22
+ case 'DONE':
23
+ return theme.palette.success.main;
24
+ case 'FAILED':
25
+ return theme.palette.error.main;
26
+ default:
27
+ return theme.palette.grey[theme.palette.mode === 'light' ? 300 : 800];
28
+ }
29
+ };
30
+ export const CircularProgress = styled(MuiCircularProgress, {
31
+ shouldForwardProp: (prop) => prop !== 'status',
32
+ })(({ theme, status }) => ({
33
+ color: getStatusColor(status, theme),
34
+ }));
35
+ export const CircularProgressPending = styled(MuiCircularProgress)(({ theme }) => ({
36
+ color: theme.palette.mode === 'light'
37
+ ? theme.palette.primary.main
38
+ : theme.palette.primary.light,
39
+ animationDuration: '3s',
40
+ position: 'absolute',
41
+ left: 0,
42
+ [`.${circularProgressClasses.circle}`]: {
43
+ animationDuration: '2s',
44
+ animationTimingFunction: 'linear',
45
+ animationName: circleAnimation,
46
+ strokeDasharray: 129,
47
+ strokeDashoffset: 129,
48
+ strokeLinecap: 'round',
49
+ transformOrigin: '100% 100%',
50
+ },
51
+ }));
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Process, Step } from '@lifinance/sdk';
3
+ export declare const ExecutionItem: React.FC<{
4
+ step: Step;
5
+ process: Process;
6
+ }>;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link as LinkIcon } from '@mui/icons-material';
3
+ import { Box, Link, Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useChains } from '../../hooks';
6
+ import { CircularProgress } from './CircularProgress';
7
+ import { LinkButton } from './ExecutionItem.style';
8
+ import { getProcessMessage } from './utils';
9
+ export const ExecutionItem = ({ step, process }) => {
10
+ const { t } = useTranslation();
11
+ const { getChainById } = useChains();
12
+ const { title, message } = getProcessMessage(t, getChainById, step, process);
13
+ return (_jsxs(Box, Object.assign({ px: 2, py: 1 }, { children: [_jsxs(Box, Object.assign({ sx: {
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ } }, { children: [_jsx(CircularProgress, { status: process.status }), _jsx(Typography, Object.assign({ ml: 2, fontWeight: process.error ? 700 : 500 }, { children: title })), process.txLink ? (_jsx(Box, Object.assign({ ml: 2, sx: {
17
+ display: 'flex',
18
+ flex: 1,
19
+ justifyContent: 'flex-end',
20
+ } }, { children: _jsx(LinkButton, Object.assign({ size: "small", "aria-label": "settings", edge: "end", LinkComponent: Link, href: process.txLink, target: "_blank", rel: "nofollow noreferrer" }, { children: _jsx(LinkIcon, {}) })) }))) : null] })), message ? (_jsx(Typography, Object.assign({ ml: 6, fontSize: 14, fontWeight: 500, color: "text.secondary" }, { children: message }))) : null] })));
21
+ };
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ export declare const LinkButton: import("@emotion/styled").StyledComponent<{
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
5
+ color?: "inherit" | "default" | "success" | "error" | "primary" | "secondary" | "info" | "warning" | undefined;
6
+ disabled?: boolean | undefined;
7
+ disableFocusRipple?: boolean | undefined;
8
+ edge?: false | "end" | "start" | undefined;
9
+ size?: "small" | "large" | "medium" | undefined;
10
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
11
+ } & Omit<{
12
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
13
+ centerRipple?: boolean | undefined;
14
+ children?: import("react").ReactNode;
15
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
16
+ disabled?: boolean | undefined;
17
+ disableRipple?: boolean | undefined;
18
+ disableTouchRipple?: boolean | undefined;
19
+ focusRipple?: boolean | undefined;
20
+ focusVisibleClassName?: string | undefined;
21
+ LinkComponent?: import("react").ElementType<any> | undefined;
22
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
23
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
24
+ tabIndex?: number | undefined;
25
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
26
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
27
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
28
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
29
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Omit<import("@mui/material").LinkBaseProps, "classes"> & {
30
+ children?: import("react").ReactNode;
31
+ classes?: Partial<import("@mui/material").LinkClasses> | undefined;
32
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined>);
33
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
34
+ TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
35
+ underline?: "none" | "always" | "hover" | undefined;
36
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
37
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
38
+ ref?: ((instance: HTMLAnchorElement | null) => void) | import("react").RefObject<HTMLAnchorElement> | null | undefined;
39
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "p" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "underline" | "TypographyClasses">, {}, {}>;
@@ -0,0 +1,5 @@
1
+ import { IconButton } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ export const LinkButton = styled(IconButton)(({ theme }) => ({
4
+ padding: theme.spacing(0.5),
5
+ }));
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { RouteExecution } from '../../hooks';
3
+ export declare const StatusBottomSheet: React.FC<RouteExecution>;