@lifi/widget 1.27.1 → 1.28.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.
- package/AppDrawer.style.d.ts +1 -1
- package/AppRoutes.js +15 -33
- package/README.md +1 -1
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/AppRoutes.js +15 -33
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/cjs/components/ContractComponent/ContractComponent.d.ts +3 -0
- package/cjs/components/ContractComponent/ContractComponent.js +14 -0
- package/cjs/components/ContractComponent/index.d.ts +1 -0
- package/cjs/components/ContractComponent/index.js +17 -0
- package/cjs/components/Header/Header.style.d.ts +2 -2
- package/cjs/components/Header/NavigationHeader.js +10 -2
- package/cjs/components/Header/WalletHeader.js +1 -1
- package/cjs/components/NFT/NFT.d.ts +4 -0
- package/cjs/components/NFT/NFT.js +41 -0
- package/cjs/components/NFT/NFT.style.d.ts +16 -0
- package/cjs/components/NFT/NFT.style.js +11 -0
- package/cjs/components/NFT/index.d.ts +2 -0
- package/cjs/components/NFT/index.js +18 -0
- package/cjs/components/NFT/types.d.ts +15 -0
- package/cjs/components/NFT/types.js +2 -0
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/Select.d.ts +1 -1
- package/cjs/components/SelectChainAndToken.js +12 -2
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +5 -2
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/StepActions/StepActions.d.ts +6 -7
- package/cjs/components/StepActions/StepActions.js +41 -12
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/StepActions/types.d.ts +5 -0
- package/cjs/components/SwapInput/SwapInput.d.ts +2 -1
- package/cjs/components/SwapInput/SwapInput.js +15 -3
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +3 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/Token/Token.d.ts +1 -1
- package/cjs/components/Token/Token.js +12 -12
- package/cjs/components/TokenAvatar/TokenAvatar.d.ts +5 -3
- package/cjs/components/TokenAvatar/TokenAvatar.js +10 -9
- package/cjs/components/TokenList/TokenList.style.js +6 -0
- package/cjs/components/TokenList/VirtualizedTokenList.js +4 -2
- package/cjs/config/theme.js +3 -5
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useSwapRoutes.d.ts +5 -2
- package/cjs/hooks/useSwapRoutes.js +64 -14
- package/cjs/hooks/useToken.d.ts +1 -1
- package/cjs/hooks/useTokenSearch.d.ts +1 -1
- package/cjs/i18n/de.json +214 -214
- package/cjs/i18n/en.json +218 -214
- package/cjs/i18n/es.json +191 -191
- package/cjs/i18n/fr.json +214 -214
- package/cjs/i18n/it.json +214 -214
- package/cjs/i18n/uk.json +214 -214
- package/cjs/i18n/zh.json +214 -214
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +4 -1
- package/cjs/pages/MainPage/MainPage.js +5 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/LanguageSelect.js +1 -2
- package/cjs/providers/SwapFormProvider/types.d.ts +10 -0
- package/cjs/providers/SwapFormProvider/types.js +5 -0
- package/cjs/stores/chains/useChainOrderStore.d.ts +1 -1
- package/cjs/stores/routes/useRouteExecutionStore.d.ts +1 -1
- package/cjs/stores/settings/useSettingsStore.d.ts +1 -1
- package/cjs/types/widget.d.ts +12 -6
- package/cjs/types/widget.js +2 -0
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/components/Card/Card.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/components/ContractComponent/ContractComponent.d.ts +3 -0
- package/components/ContractComponent/ContractComponent.js +10 -0
- package/components/ContractComponent/index.d.ts +1 -0
- package/components/ContractComponent/index.js +1 -0
- package/components/Header/Header.style.d.ts +2 -2
- package/components/Header/NavigationHeader.js +12 -4
- package/components/Header/WalletHeader.js +1 -1
- package/components/NFT/NFT.d.ts +4 -0
- package/components/NFT/NFT.js +37 -0
- package/components/NFT/NFT.style.d.ts +16 -0
- package/components/NFT/NFT.style.js +8 -0
- package/components/NFT/index.d.ts +2 -0
- package/components/NFT/index.js +2 -0
- package/components/NFT/types.d.ts +15 -0
- package/components/NFT/types.js +1 -0
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/Select.d.ts +1 -1
- package/components/SelectChainAndToken.js +12 -2
- package/components/SelectTokenButton/SelectTokenButton.js +5 -2
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/StepActions/StepActions.d.ts +6 -7
- package/components/StepActions/StepActions.js +40 -12
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/StepActions/types.d.ts +5 -0
- package/components/SwapInput/SwapInput.d.ts +2 -1
- package/components/SwapInput/SwapInput.js +15 -3
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapRouteCard/SwapRouteCard.js +3 -1
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/Token/Token.d.ts +1 -1
- package/components/Token/Token.js +13 -13
- package/components/TokenAvatar/TokenAvatar.d.ts +5 -3
- package/components/TokenAvatar/TokenAvatar.js +10 -9
- package/components/TokenList/TokenList.style.js +6 -0
- package/components/TokenList/VirtualizedTokenList.js +4 -2
- package/config/theme.js +3 -5
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useSwapRoutes.d.ts +5 -2
- package/hooks/useSwapRoutes.js +64 -14
- package/hooks/useToken.d.ts +1 -1
- package/hooks/useTokenSearch.d.ts +1 -1
- package/i18n/de.json +214 -214
- package/i18n/en.json +218 -214
- package/i18n/es.json +191 -191
- package/i18n/fr.json +214 -214
- package/i18n/it.json +214 -214
- package/i18n/uk.json +214 -214
- package/i18n/zh.json +214 -214
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +15 -13
- package/pages/MainPage/MainPage.js +5 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/LanguageSelect.js +1 -2
- package/providers/SwapFormProvider/types.d.ts +10 -0
- package/providers/SwapFormProvider/types.js +5 -0
- package/stores/chains/useChainOrderStore.d.ts +1 -1
- package/stores/routes/useRouteExecutionStore.d.ts +1 -1
- package/stores/settings/useSettingsStore.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +12 -6
- package/types/widget.js +2 -0
- package/cjs/fonts/Inter-Black.woff +0 -0
- package/cjs/fonts/Inter-Black.woff2 +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Bold.woff +0 -0
- package/cjs/fonts/Inter-Bold.woff2 +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Italic.woff +0 -0
- package/cjs/fonts/Inter-Italic.woff2 +0 -0
- package/cjs/fonts/Inter-Light.woff +0 -0
- package/cjs/fonts/Inter-Light.woff2 +0 -0
- package/cjs/fonts/Inter-LightItalic.woff +0 -0
- package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Medium.woff +0 -0
- package/cjs/fonts/Inter-Medium.woff2 +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Regular.woff +0 -0
- package/cjs/fonts/Inter-Regular.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBold.woff +0 -0
- package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Thin.woff +0 -0
- package/cjs/fonts/Inter-Thin.woff2 +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
- package/cjs/fonts/Inter-italic.var.woff2 +0 -0
- package/cjs/fonts/Inter-roman.var.woff2 +0 -0
- package/cjs/fonts/Inter.var.woff2 +0 -0
- package/cjs/fonts/inter.css +0 -200
- package/fonts/Inter-Black.woff +0 -0
- package/fonts/Inter-Black.woff2 +0 -0
- package/fonts/Inter-BlackItalic.woff +0 -0
- package/fonts/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraLight.woff +0 -0
- package/fonts/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Light.woff +0 -0
- package/fonts/Inter-Light.woff2 +0 -0
- package/fonts/Inter-LightItalic.woff +0 -0
- package/fonts/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-MediumItalic.woff +0 -0
- package/fonts/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter-Thin.woff +0 -0
- package/fonts/Inter-Thin.woff2 +0 -0
- package/fonts/Inter-ThinItalic.woff +0 -0
- package/fonts/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter-italic.var.woff2 +0 -0
- package/fonts/Inter-roman.var.woff2 +0 -0
- package/fonts/Inter.var.woff2 +0 -0
- package/fonts/inter.css +0 -200
package/AppDrawer.style.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
package/AppRoutes.js
CHANGED
|
@@ -34,20 +34,14 @@ export const AppRoutes = () => {
|
|
|
34
34
|
path: navigationRoutes.toTokenNative,
|
|
35
35
|
element: _jsx(SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
36
36
|
},
|
|
37
|
-
|
|
38
|
-
navigationRoutes.fromChain
|
|
39
|
-
`${navigationRoutes.fromToken}/${navigationRoutes.fromChain}`,
|
|
40
|
-
].map((path) => ({
|
|
41
|
-
path,
|
|
37
|
+
{
|
|
38
|
+
path: `${navigationRoutes.fromToken}?/${navigationRoutes.fromChain}`,
|
|
42
39
|
element: _jsx(SelectChainPage, { formType: "from" }),
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
navigationRoutes.toChain
|
|
46
|
-
`${navigationRoutes.toToken}/${navigationRoutes.toChain}`,
|
|
47
|
-
].map((path) => ({
|
|
48
|
-
path,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
path: `${navigationRoutes.toToken}?/${navigationRoutes.toChain}`,
|
|
49
43
|
element: _jsx(SelectChainPage, { formType: "to" }),
|
|
50
|
-
}
|
|
44
|
+
},
|
|
51
45
|
{
|
|
52
46
|
path: navigationRoutes.swapRoutes,
|
|
53
47
|
element: _jsx(SwapRoutesPage, {}),
|
|
@@ -60,30 +54,18 @@ export const AppRoutes = () => {
|
|
|
60
54
|
path: navigationRoutes.swapHistory,
|
|
61
55
|
element: _jsx(SwapHistoryPage, {}),
|
|
62
56
|
},
|
|
63
|
-
|
|
64
|
-
`${navigationRoutes.swapHistory}
|
|
65
|
-
`${navigationRoutes.swapExecution}/${navigationRoutes.swapDetails}`,
|
|
66
|
-
`${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}/${navigationRoutes.swapDetails}`,
|
|
67
|
-
].map((path) => ({
|
|
68
|
-
path,
|
|
57
|
+
{
|
|
58
|
+
path: `${navigationRoutes.swapHistory}?/${navigationRoutes.swapRoutes}?/${navigationRoutes.swapExecution}?/${navigationRoutes.swapDetails}`,
|
|
69
59
|
element: _jsx(SwapDetailsPage, {}),
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
navigationRoutes.selectWallet
|
|
73
|
-
`${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
|
|
74
|
-
`${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
|
|
75
|
-
].map((path) => ({
|
|
76
|
-
path,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
path: `${navigationRoutes.swapRoutes}?/${navigationRoutes.swapExecution}?/${navigationRoutes.selectWallet}`,
|
|
77
63
|
element: _jsx(SelectWalletPage, {}),
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
navigationRoutes.swapExecution
|
|
81
|
-
`${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}`,
|
|
82
|
-
`${navigationRoutes.activeSwaps}/${navigationRoutes.swapExecution}`,
|
|
83
|
-
].map((path) => ({
|
|
84
|
-
path,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: `${navigationRoutes.swapRoutes}?/${navigationRoutes.activeSwaps}?/${navigationRoutes.swapExecution}`,
|
|
85
67
|
element: _jsx(SwapPage, {}),
|
|
86
|
-
}
|
|
68
|
+
},
|
|
87
69
|
{
|
|
88
70
|
path: '*',
|
|
89
71
|
element: _jsx(NotFound, {}),
|
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ export const WidgetPage = () => {
|
|
|
74
74
|
|
|
75
75
|
## Examples
|
|
76
76
|
|
|
77
|
-
Visit our [playground](https://
|
|
77
|
+
Visit our [playground](https://playground.li.fi) to see how you can customize your [LI.FI Widget](https://www.npmjs.com/package/@lifi/widget) experience.
|
|
78
78
|
|
|
79
79
|
## Documentation
|
|
80
80
|
|
package/cjs/AppDrawer.style.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
package/cjs/AppRoutes.js
CHANGED
|
@@ -37,20 +37,14 @@ const AppRoutes = () => {
|
|
|
37
37
|
path: utils_1.navigationRoutes.toTokenNative,
|
|
38
38
|
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
39
39
|
},
|
|
40
|
-
|
|
41
|
-
utils_1.navigationRoutes.fromChain
|
|
42
|
-
`${utils_1.navigationRoutes.fromToken}/${utils_1.navigationRoutes.fromChain}`,
|
|
43
|
-
].map((path) => ({
|
|
44
|
-
path,
|
|
40
|
+
{
|
|
41
|
+
path: `${utils_1.navigationRoutes.fromToken}?/${utils_1.navigationRoutes.fromChain}`,
|
|
45
42
|
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "from" }),
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
utils_1.navigationRoutes.toChain
|
|
49
|
-
`${utils_1.navigationRoutes.toToken}/${utils_1.navigationRoutes.toChain}`,
|
|
50
|
-
].map((path) => ({
|
|
51
|
-
path,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: `${utils_1.navigationRoutes.toToken}?/${utils_1.navigationRoutes.toChain}`,
|
|
52
46
|
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to" }),
|
|
53
|
-
}
|
|
47
|
+
},
|
|
54
48
|
{
|
|
55
49
|
path: utils_1.navigationRoutes.swapRoutes,
|
|
56
50
|
element: (0, jsx_runtime_1.jsx)(SwapRoutesPage_1.SwapRoutesPage, {}),
|
|
@@ -63,30 +57,18 @@ const AppRoutes = () => {
|
|
|
63
57
|
path: utils_1.navigationRoutes.swapHistory,
|
|
64
58
|
element: (0, jsx_runtime_1.jsx)(SwapHistoryPage_1.SwapHistoryPage, {}),
|
|
65
59
|
},
|
|
66
|
-
|
|
67
|
-
`${utils_1.navigationRoutes.swapHistory}
|
|
68
|
-
`${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.swapDetails}`,
|
|
69
|
-
`${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.swapDetails}`,
|
|
70
|
-
].map((path) => ({
|
|
71
|
-
path,
|
|
60
|
+
{
|
|
61
|
+
path: `${utils_1.navigationRoutes.swapHistory}?/${utils_1.navigationRoutes.swapRoutes}?/${utils_1.navigationRoutes.swapExecution}?/${utils_1.navigationRoutes.swapDetails}`,
|
|
72
62
|
element: (0, jsx_runtime_1.jsx)(SwapDetailsPage_1.SwapDetailsPage, {}),
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
utils_1.navigationRoutes.selectWallet
|
|
76
|
-
`${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
|
|
77
|
-
`${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
|
|
78
|
-
].map((path) => ({
|
|
79
|
-
path,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: `${utils_1.navigationRoutes.swapRoutes}?/${utils_1.navigationRoutes.swapExecution}?/${utils_1.navigationRoutes.selectWallet}`,
|
|
80
66
|
element: (0, jsx_runtime_1.jsx)(SelectWalletPage_1.SelectWalletPage, {}),
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
utils_1.navigationRoutes.swapExecution
|
|
84
|
-
`${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}`,
|
|
85
|
-
`${utils_1.navigationRoutes.activeSwaps}/${utils_1.navigationRoutes.swapExecution}`,
|
|
86
|
-
].map((path) => ({
|
|
87
|
-
path,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: `${utils_1.navigationRoutes.swapRoutes}?/${utils_1.navigationRoutes.activeSwaps}?/${utils_1.navigationRoutes.swapExecution}`,
|
|
88
70
|
element: (0, jsx_runtime_1.jsx)(SwapPage_1.SwapPage, {}),
|
|
89
|
-
}
|
|
71
|
+
},
|
|
90
72
|
{
|
|
91
73
|
path: '*',
|
|
92
74
|
element: (0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}),
|
|
@@ -39,7 +39,7 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
export declare const ShowAllButton: import("@emotion/styled").StyledComponent<{
|
|
40
40
|
children?: import("react").ReactNode;
|
|
41
41
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
42
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
42
|
+
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
43
43
|
disabled?: boolean | undefined;
|
|
44
44
|
disableElevation?: boolean | undefined;
|
|
45
45
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -18,7 +18,7 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
|
|
|
18
18
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
19
19
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("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") | "component"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
20
20
|
variant?: CardVariant | undefined;
|
|
21
|
-
selectionColor?: "
|
|
21
|
+
selectionColor?: "primary" | "secondary" | undefined;
|
|
22
22
|
dense?: boolean | undefined;
|
|
23
23
|
indented?: boolean | undefined;
|
|
24
24
|
onClick?: MouseEventHandler<HTMLDivElement> | undefined;
|
|
@@ -8,7 +8,7 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
|
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
9
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("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") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
variant?: ("default" | "error" | "selected") | undefined;
|
|
11
|
-
selectionColor?: "
|
|
11
|
+
selectionColor?: "primary" | "secondary" | undefined;
|
|
12
12
|
dense?: boolean | undefined;
|
|
13
13
|
indented?: boolean | undefined;
|
|
14
14
|
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContractComponent = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const providers_1 = require("../../providers");
|
|
6
|
+
const Card_1 = require("../Card");
|
|
7
|
+
const ContractComponent = (props) => {
|
|
8
|
+
const { contractComponent } = (0, providers_1.useWidgetConfig)();
|
|
9
|
+
if (!contractComponent) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(Card_1.Card, Object.assign({ flex: 1 }, props, { children: contractComponent })));
|
|
13
|
+
};
|
|
14
|
+
exports.ContractComponent = ContractComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ContractComponent';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ContractComponent"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps<"div", {}>, "classes" | "color" | "position"> & {
|
|
3
3
|
classes?: Partial<import("@mui/material").AppBarClasses> | undefined;
|
|
4
|
-
color?: "inherit" | "transparent" | "default" | "
|
|
4
|
+
color?: "inherit" | "transparent" | "default" | "primary" | "secondary" | undefined;
|
|
5
5
|
enableColorOnDark?: boolean | undefined;
|
|
6
6
|
position?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
7
7
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
@@ -21,7 +21,7 @@ export declare const Container: import("@emotion/styled").StyledComponent<import
|
|
|
21
21
|
export declare const WalletButton: import("@emotion/styled").StyledComponent<{
|
|
22
22
|
children?: import("react").ReactNode;
|
|
23
23
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
24
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
24
|
+
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
25
25
|
disabled?: boolean | undefined;
|
|
26
26
|
disableElevation?: boolean | undefined;
|
|
27
27
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -47,8 +47,16 @@ const NavigationHeader = () => {
|
|
|
47
47
|
return t(`header.swap`);
|
|
48
48
|
case utils_1.navigationRoutes.swapDetails:
|
|
49
49
|
return t(`header.swapDetails`);
|
|
50
|
-
default:
|
|
51
|
-
|
|
50
|
+
default: {
|
|
51
|
+
switch (variant) {
|
|
52
|
+
case 'nft':
|
|
53
|
+
return t(`header.checkout`);
|
|
54
|
+
case 'refuel':
|
|
55
|
+
return t(`header.gas`);
|
|
56
|
+
default:
|
|
57
|
+
return t(`header.swap`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
61
|
};
|
|
54
62
|
return ((0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, Object.assign({ elevation: 0 }, { children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", edge: "start", onClick: navigateBack }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ArrowBack, {}) }))) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true }, { children: handleHeaderTitle() })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`header.swapHistory`), enterDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.swapHistory) }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ReceiptLongRounded, {}) })) }))) : null, (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`header.settings`), enterDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", onClick: () => navigate(utils_1.navigationRoutes.settings), sx: {
|
|
@@ -66,5 +66,5 @@ const ConnectedButton = () => {
|
|
|
66
66
|
});
|
|
67
67
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, Object.assign({ endIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), startIcon: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: chain === null || chain === void 0 ? void 0 : chain.logoURI, alt: chain === null || chain === void 0 ? void 0 : chain.key, sx: { width: 24, height: 24 } }, { children: chain === null || chain === void 0 ? void 0 : chain.name[0] })), sx: {
|
|
68
68
|
marginRight: -1.25,
|
|
69
|
-
}, onClick: handleClick }, { children: walletAddress })), (0, jsx_runtime_1.jsxs)(Menu_1.Menu, Object.assign({ elevation: 2, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose }, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: handleCopyAddress, disableRipple: true
|
|
69
|
+
}, onClick: handleClick }, { children: walletAddress })), (0, jsx_runtime_1.jsxs)(Menu_1.Menu, Object.assign({ elevation: 2, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose }, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: handleCopyAddress, disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, {}), t(`button.copyAddress`)] })), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: handleDisconnect, disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.PowerSettingsNewRounded, {}), t(`button.disconnectWallet`)] }))] }))] }));
|
|
70
70
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.NFT = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const material_1 = require("@mui/material");
|
|
17
|
+
const react_1 = require("react");
|
|
18
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
19
|
+
const react_i18next_1 = require("react-i18next");
|
|
20
|
+
const providers_1 = require("../../providers");
|
|
21
|
+
const Token_1 = require("../Token");
|
|
22
|
+
const NFT_style_1 = require("./NFT.style");
|
|
23
|
+
const NFT = (_a) => {
|
|
24
|
+
var { imageUrl, isLoading, collectonName, assetName, owner, token, contract } = _a, props = __rest(_a, ["imageUrl", "isLoading", "collectonName", "assetName", "owner", "token", "contract"]);
|
|
25
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
26
|
+
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
if (token) {
|
|
29
|
+
setValue(providers_1.SwapFormKey.ToChain, token.chainId);
|
|
30
|
+
setValue(providers_1.SwapFormKey.ToToken, token.address);
|
|
31
|
+
setValue(providers_1.SwapFormKey.ToAmount, token.amount);
|
|
32
|
+
}
|
|
33
|
+
if (contract) {
|
|
34
|
+
setValue(providers_1.SwapFormKey.ToContractAddress, contract.address);
|
|
35
|
+
setValue(providers_1.SwapFormKey.ToContractCallData, contract.callData);
|
|
36
|
+
setValue(providers_1.SwapFormKey.ToContractGasLimit, contract.gasLimit);
|
|
37
|
+
}
|
|
38
|
+
}, [contract, setValue, token]);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ p: 2 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex" }, { children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 96, variant: "rectangular", sx: { borderRadius: 1 } })) : ((0, jsx_runtime_1.jsx)(NFT_style_1.PreviewAvatar, { src: imageUrl })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ml: 2 }, { children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 144, height: 21, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary" }, { children: collectonName }))), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 112, height: 27, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: 600 }, { children: assetName }))), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 128, height: 21, variant: "text" })) : owner ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary" }, { children: [t('swap.ownedBy'), ' ', (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ href: owner.url, target: "_blank", underline: "none", color: "primary" }, { children: owner.name }))] }))) : null] }))] })), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, isLoading: isLoading, mt: 2 })] })));
|
|
40
|
+
};
|
|
41
|
+
exports.NFT = NFT;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PreviewAvatar: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
alt?: string | undefined;
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
classes?: Partial<import("@mui/material").AvatarClasses> | undefined;
|
|
6
|
+
imgProps?: (import("react").ImgHTMLAttributes<HTMLImageElement> & {
|
|
7
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
+
}) | undefined;
|
|
9
|
+
sizes?: string | undefined;
|
|
10
|
+
src?: string | undefined;
|
|
11
|
+
srcSet?: string | undefined;
|
|
12
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
13
|
+
variant?: "square" | "circular" | "rounded" | undefined;
|
|
14
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
15
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
16
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewAvatar = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
exports.PreviewAvatar = (0, styles_1.styled)(material_1.Avatar)(({ theme }) => ({
|
|
7
|
+
background: theme.palette.background.paper,
|
|
8
|
+
width: 96,
|
|
9
|
+
height: 96,
|
|
10
|
+
borderRadius: theme.shape.borderRadius,
|
|
11
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./NFT"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TokenAmount } from '@lifi/sdk';
|
|
2
|
+
import type { WidgetContract } from '../../types';
|
|
3
|
+
export interface NFTProps {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
collectonName?: string;
|
|
6
|
+
assetName?: string;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
owner?: NFTOwner;
|
|
9
|
+
token?: TokenAmount;
|
|
10
|
+
contract?: WidgetContract;
|
|
11
|
+
}
|
|
12
|
+
export interface NFTOwner {
|
|
13
|
+
name?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const IconButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Select: import("@emotion/styled").StyledComponent<import("@mui/material").SelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
1
|
+
export declare const Select: import("@emotion/styled").StyledComponent<(import("@mui/material").SelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) & {
|
|
2
2
|
dense?: boolean | undefined;
|
|
3
3
|
}, {}, {}>;
|
|
@@ -22,7 +22,17 @@ const SelectChainAndToken = (props) => {
|
|
|
22
22
|
const disabledReverse = variant === 'refuel' ||
|
|
23
23
|
(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.FromToken)) ||
|
|
24
24
|
(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.ToToken));
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const nftVariant = variant === 'nft';
|
|
26
|
+
const isCompact = fromChain &&
|
|
27
|
+
toChain &&
|
|
28
|
+
fromToken &&
|
|
29
|
+
toToken &&
|
|
30
|
+
!prefersNarrowView &&
|
|
31
|
+
!nftVariant;
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), !nftVariant ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
}, m: !disabledReverse ? -1.125 : 1 }, { children: !disabledReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null }))) : null, !nftVariant ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })) : null] })));
|
|
27
37
|
};
|
|
28
38
|
exports.SelectChainAndToken = SelectChainAndToken;
|
|
@@ -31,9 +31,12 @@ const SelectTokenButton = ({ formType, compact }) => {
|
|
|
31
31
|
};
|
|
32
32
|
const isSelected = !!(chain && token);
|
|
33
33
|
const onClick = !(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(tokenKey)) ? handleClick : undefined;
|
|
34
|
-
const
|
|
34
|
+
const defaultPlaceholder = formType === 'to' && variant === 'refuel'
|
|
35
35
|
? t(`header.selectChain`)
|
|
36
36
|
: t(`swap.selectChainAndToken`);
|
|
37
|
-
|
|
37
|
+
const cardTitle = formType === 'from' && variant === 'nft'
|
|
38
|
+
? t(`swap.payWith`)
|
|
39
|
+
: t(`swap.${formType}`);
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ flex: 1, onClick: onClick }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: cardTitle }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_style_1.SelectTokenCardHeader, { avatar: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }), title: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 24 }), subheader: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : ((0, jsx_runtime_1.jsx)(SelectTokenButton_style_1.SelectTokenCardHeader, { avatar: isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarDefault, {})), title: isSelected ? token.symbol : defaultPlaceholder, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
|
|
38
41
|
};
|
|
39
42
|
exports.SelectTokenButton = SelectTokenButton;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
|
|
5
|
-
color?: "success" | "warning" | "error" | "
|
|
5
|
+
color?: "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
error?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -13,7 +13,7 @@ export declare const SmallAvatar: import("@emotion/styled").StyledComponent<{
|
|
|
13
13
|
variant?: "square" | "circular" | "rounded" | undefined;
|
|
14
14
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
15
15
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
16
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "
|
|
16
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
17
|
export declare const SmallAvatarSkeletonBase: import("@emotion/styled").StyledComponent<{
|
|
18
18
|
animation?: false | "pulse" | "wave" | undefined;
|
|
19
19
|
children?: import("react").ReactNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const LinkButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Step } from '@lifi/sdk';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetVariant } from '../../types';
|
|
4
|
+
import type { StepActionsProps, StepDetailsLabelProps } from './types';
|
|
4
5
|
export declare const StepActions: React.FC<StepActionsProps>;
|
|
5
6
|
export declare const StepDetailsContent: React.FC<{
|
|
6
7
|
step: Step;
|
|
8
|
+
variant?: WidgetVariant;
|
|
7
9
|
}>;
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const SwapStepDetailsLabel: React.FC<{
|
|
12
|
-
step: Step;
|
|
13
|
-
}>;
|
|
10
|
+
export declare const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps>;
|
|
11
|
+
export declare const CrossStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
|
|
12
|
+
export declare const SwapStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
|