@lifi/widget 1.26.5 → 1.27.1
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/App.js +15 -2
- package/AppDrawer.d.ts +4 -2
- package/AppDrawer.style.d.ts +1 -1
- package/cjs/App.js +14 -1
- package/cjs/AppDrawer.d.ts +4 -2
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -0
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/cjs/components/Header/Header.style.d.ts +2 -2
- package/cjs/components/Menu.js +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +5 -2
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +1 -1
- package/cjs/components/SendToWallet/SendToWallet.js +20 -6
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.style.js +6 -0
- package/cjs/components/SendToWallet/SendToWalletButton.js +5 -6
- package/cjs/components/SmallAvatar.d.ts +20 -0
- package/cjs/components/SmallAvatar.js +15 -1
- package/cjs/components/Step/CircularProgress.d.ts +1 -0
- package/cjs/components/Step/StepList.d.ts +1 -0
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.js +4 -6
- package/cjs/components/SwapButton/index.d.ts +1 -0
- package/cjs/components/SwapButton/index.js +15 -0
- package/cjs/components/SwapButton/types.d.ts +1 -2
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.style.js +1 -0
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -0
- package/cjs/components/SwapInput/SwapInputStartAdornment.js +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
- package/cjs/components/Token/Token.d.ts +3 -0
- package/cjs/components/Token/Token.js +16 -2
- package/cjs/components/TokenAvatar/TokenAvatar.d.ts +2 -1
- package/cjs/components/TokenAvatar/TokenAvatar.js +8 -8
- package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/cjs/components/TokenAvatar/TokenAvatar.style.js +3 -3
- package/cjs/config/theme.js +2 -2
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/i18n/de.json +30 -6
- package/cjs/i18n/fr.json +30 -6
- package/cjs/i18n/it.json +30 -6
- package/cjs/i18n/uk.json +38 -20
- package/cjs/i18n/zh.json +30 -6
- package/cjs/index.d.ts +3 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
- package/cjs/pages/MainPage/MainSwapButton.js +4 -4
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
- package/cjs/pages/SettingsPage/LanguageSelect.js +3 -2
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -0
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +4 -2
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -0
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -0
- package/cjs/pages/SwapPage/StartSwapButton.js +11 -0
- package/cjs/pages/SwapPage/SwapPage.js +2 -4
- package/cjs/stores/routes/useRouteExecutionStore.js +13 -1
- package/cjs/stores/settings/index.d.ts +1 -0
- package/cjs/stores/settings/index.js +1 -0
- package/cjs/stores/settings/types.d.ts +8 -0
- package/cjs/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
- package/cjs/stores/settings/useSendToWalletStore.js +16 -0
- package/cjs/types/widget.d.ts +31 -8
- package/cjs/types/widget.js +10 -3
- package/components/ActiveSwaps/ActiveSwapItem.js +1 -1
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/components/Card/Card.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +1 -0
- package/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/components/Header/Header.style.d.ts +2 -2
- package/components/Header/WalletHeader.js +1 -1
- package/components/Menu.js +1 -1
- package/components/PoweredBy/PoweredBy.js +5 -2
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/SelectTokenButton/SelectTokenButton.js +2 -2
- package/components/SendToWallet/SendToWallet.js +21 -7
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.style.js +6 -0
- package/components/SendToWallet/SendToWalletButton.js +7 -8
- package/components/SmallAvatar.d.ts +20 -0
- package/components/SmallAvatar.js +14 -1
- package/components/Step/CircularProgress.d.ts +1 -0
- package/components/Step/StepList.d.ts +1 -0
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/SwapButton/SwapButton.d.ts +1 -1
- package/components/SwapButton/SwapButton.js +3 -6
- package/components/SwapButton/index.d.ts +1 -0
- package/components/SwapButton/index.js +1 -0
- package/components/SwapButton/types.d.ts +1 -2
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInput.style.js +1 -0
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -0
- package/components/SwapInput/SwapInputStartAdornment.js +2 -2
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
- package/components/Token/Token.d.ts +3 -0
- package/components/Token/Token.js +13 -1
- package/components/TokenAvatar/TokenAvatar.d.ts +2 -1
- package/components/TokenAvatar/TokenAvatar.js +9 -9
- package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/components/TokenAvatar/TokenAvatar.style.js +2 -2
- package/config/theme.js +2 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useRouteExecution.js +1 -1
- package/i18n/de.json +30 -6
- package/i18n/fr.json +30 -6
- package/i18n/it.json +30 -6
- package/i18n/uk.json +38 -20
- package/i18n/zh.json +30 -6
- package/index.d.ts +3 -1
- package/package.json +12 -12
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
- package/pages/MainPage/MainSwapButton.js +3 -4
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
- package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
- package/pages/SettingsPage/LanguageSelect.js +3 -2
- package/pages/SettingsPage/SettingsPage.d.ts +1 -0
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
- package/pages/SettingsPage/ShowDestinationWallet.js +6 -4
- package/pages/SettingsPage/SlippageInput.d.ts +1 -0
- package/pages/SwapPage/StartSwapButton.d.ts +3 -0
- package/pages/SwapPage/StartSwapButton.js +7 -0
- package/pages/SwapPage/SwapPage.js +2 -4
- package/stores/routes/useRouteExecutionStore.js +13 -1
- package/stores/settings/index.d.ts +1 -0
- package/stores/settings/index.js +1 -0
- package/stores/settings/types.d.ts +8 -0
- package/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
- package/stores/settings/useSendToWalletStore.js +13 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +31 -8
- package/types/widget.js +9 -2
- package/cjs/components/SendToWallet/store.js +0 -12
- package/cjs/components/SendToWallet/types.d.ts +0 -6
- package/cjs/components/SendToWallet/types.js +0 -2
- package/components/SendToWallet/store.js +0 -9
- package/components/SendToWallet/types.d.ts +0 -6
- package/components/SendToWallet/types.js +0 -1
package/App.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
13
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
14
|
import { AppDrawer } from './AppDrawer';
|
|
4
15
|
import { AppProvider } from './AppProvider';
|
|
5
16
|
import { AppRoutes } from './AppRoutes';
|
|
@@ -9,7 +20,9 @@ import { Initializer } from './components/Initializer';
|
|
|
9
20
|
import { PoweredBy } from './components/PoweredBy';
|
|
10
21
|
import { SwapRoutesExpanded } from './components/SwapRoutes';
|
|
11
22
|
import { useExpandableVariant } from './hooks';
|
|
12
|
-
export const App = forwardRef((
|
|
23
|
+
export const App = forwardRef((_a, ref) => {
|
|
24
|
+
var { elementRef, open } = _a, other = __rest(_a, ["elementRef", "open"]);
|
|
25
|
+
const config = useMemo(() => (Object.assign(Object.assign({}, other), other.config)), [other]);
|
|
13
26
|
return (config === null || config === void 0 ? void 0 : config.variant) !== 'drawer' ? (_jsx(AppProvider, Object.assign({ config: config }, { children: _jsx(AppDefault, {}) }))) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, config: config, open: open }));
|
|
14
27
|
});
|
|
15
28
|
export const AppDefault = () => {
|
package/AppDrawer.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetConfig } from './types';
|
|
3
3
|
export interface WidgetDrawer {
|
|
4
4
|
isOpen(): void;
|
|
5
5
|
toggleDrawer(): void;
|
|
6
6
|
openDrawer(): void;
|
|
7
7
|
closeDrawer(): void;
|
|
8
8
|
}
|
|
9
|
-
export declare const AppDrawer: import("react").ForwardRefExoticComponent<
|
|
9
|
+
export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & {
|
|
10
|
+
config?: WidgetConfig | undefined;
|
|
11
|
+
} & import("react").RefAttributes<WidgetDrawer>>;
|
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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
package/cjs/App.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.AppDefault = exports.App = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -12,7 +23,9 @@ const Initializer_1 = require("./components/Initializer");
|
|
|
12
23
|
const PoweredBy_1 = require("./components/PoweredBy");
|
|
13
24
|
const SwapRoutes_1 = require("./components/SwapRoutes");
|
|
14
25
|
const hooks_1 = require("./hooks");
|
|
15
|
-
exports.App = (0, react_1.forwardRef)((
|
|
26
|
+
exports.App = (0, react_1.forwardRef)((_a, ref) => {
|
|
27
|
+
var { elementRef, open } = _a, other = __rest(_a, ["elementRef", "open"]);
|
|
28
|
+
const config = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, other), other.config)), [other]);
|
|
16
29
|
return (config === null || config === void 0 ? void 0 : config.variant) !== 'drawer' ? ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) }))) : ((0, jsx_runtime_1.jsx)(AppDrawer_1.AppDrawer, { ref: ref, elementRef: elementRef, config: config, open: open }));
|
|
17
30
|
});
|
|
18
31
|
const AppDefault = () => {
|
package/cjs/AppDrawer.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetConfig } from './types';
|
|
3
3
|
export interface WidgetDrawer {
|
|
4
4
|
isOpen(): void;
|
|
5
5
|
toggleDrawer(): void;
|
|
6
6
|
openDrawer(): void;
|
|
7
7
|
closeDrawer(): void;
|
|
8
8
|
}
|
|
9
|
-
export declare const AppDrawer: import("react").ForwardRefExoticComponent<
|
|
9
|
+
export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & {
|
|
10
|
+
config?: WidgetConfig | undefined;
|
|
11
|
+
} & import("react").RefAttributes<WidgetDrawer>>;
|
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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -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" | "secondary" | "primary" | "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?: "secondary" | "primary" | 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?: "secondary" | "primary" | undefined;
|
|
12
12
|
dense?: boolean | undefined;
|
|
13
13
|
indented?: boolean | undefined;
|
|
14
14
|
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
@@ -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" | "secondary" | "primary" | 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" | "secondary" | "primary" | "info" | undefined;
|
|
25
25
|
disabled?: boolean | undefined;
|
|
26
26
|
disableElevation?: boolean | undefined;
|
|
27
27
|
disableFocusRipple?: boolean | undefined;
|
package/cjs/components/Menu.js
CHANGED
|
@@ -8,7 +8,7 @@ const styles_1 = require("@mui/material/styles");
|
|
|
8
8
|
const SvgIcon_1 = require("@mui/material/SvgIcon");
|
|
9
9
|
exports.Menu = (0, styles_1.styled)(material_1.Menu)(({ theme }) => ({
|
|
10
10
|
[`& .${Menu_1.menuClasses.paper}`]: {
|
|
11
|
-
borderRadius: theme.shape.
|
|
11
|
+
borderRadius: theme.shape.borderRadius,
|
|
12
12
|
color: theme.palette.text.primary,
|
|
13
13
|
[`& .${Menu_1.menuClasses.list}`]: {
|
|
14
14
|
padding: theme.spacing(0.5, 0),
|
|
@@ -5,19 +5,22 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_router_dom_1 = require("react-router-dom");
|
|
7
7
|
const version_1 = require("../../config/version");
|
|
8
|
+
const providers_1 = require("../../providers");
|
|
9
|
+
const types_1 = require("../../types");
|
|
8
10
|
const utils_1 = require("../../utils");
|
|
9
11
|
const LiFiLogo_1 = require("../LiFiLogo");
|
|
10
12
|
const PoweredBy_style_1 = require("./PoweredBy.style");
|
|
11
13
|
const PoweredBy = () => {
|
|
14
|
+
const { hiddenUI } = (0, providers_1.useWidgetConfig)();
|
|
12
15
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
13
16
|
if (pathname.includes(utils_1.navigationRoutes.fromToken) ||
|
|
14
17
|
pathname.includes(utils_1.navigationRoutes.toToken)) {
|
|
15
18
|
return null;
|
|
16
19
|
}
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ px: 3,
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ px: 3, py: (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.PoweredBy)) ? 1 : 2, sx: {
|
|
18
21
|
display: 'flex',
|
|
19
22
|
alignItems: 'flex-end',
|
|
20
23
|
justifyContent: 'flex-end',
|
|
21
|
-
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `v${version_1.version}`, placement: "top", enterDelay: 3000, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(PoweredBy_style_1.Link, Object.assign({ href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), (0, jsx_runtime_1.jsx)(LiFiLogo_1.LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) })) })));
|
|
24
|
+
} }, { children: !(hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.PoweredBy)) ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `v${version_1.version}`, placement: "top", enterDelay: 3000, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(PoweredBy_style_1.Link, Object.assign({ href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), (0, jsx_runtime_1.jsx)(LiFiLogo_1.LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) }))) : null })));
|
|
22
25
|
};
|
|
23
26
|
exports.PoweredBy = PoweredBy;
|
|
@@ -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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -34,6 +34,6 @@ const SelectTokenButton = ({ formType, compact }) => {
|
|
|
34
34
|
const defaultTitle = formType === 'to' && variant === 'refuel'
|
|
35
35
|
? t(`header.selectChain`)
|
|
36
36
|
: t(`swap.selectChainAndToken`);
|
|
37
|
-
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: t(`swap.${formType}`) }), 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.
|
|
37
|
+
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: t(`swap.${formType}`) }), 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 : defaultTitle, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
|
|
38
38
|
};
|
|
39
39
|
exports.SelectTokenButton = SelectTokenButton;
|
|
@@ -17,20 +17,34 @@ const react_1 = require("react");
|
|
|
17
17
|
const react_hook_form_1 = require("react-hook-form");
|
|
18
18
|
const react_i18next_1 = require("react-i18next");
|
|
19
19
|
const providers_1 = require("../../providers");
|
|
20
|
+
const stores_1 = require("../../stores");
|
|
20
21
|
const types_1 = require("../../types");
|
|
21
22
|
const Card_1 = require("../Card");
|
|
22
23
|
const SendToWallet_style_1 = require("./SendToWallet.style");
|
|
23
|
-
const store_1 = require("./store");
|
|
24
24
|
exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
|
|
25
25
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
26
|
-
const { disabledUI } = (0, providers_1.useWidgetConfig)();
|
|
27
|
-
const showSendToWallet = (0, store_1.useSendToWalletStore)((state) => state.showSendToWallet);
|
|
28
|
-
const { account, provider } = (0, providers_1.useWallet)();
|
|
29
26
|
const { register, trigger } = (0, react_hook_form_1.useFormContext)();
|
|
27
|
+
const { account, provider } = (0, providers_1.useWallet)();
|
|
28
|
+
const { disabledUI, hiddenUI, toAddress } = (0, providers_1.useWidgetConfig)();
|
|
29
|
+
const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = (0, stores_1.useSendToWalletStore)();
|
|
30
|
+
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
30
31
|
(0, react_1.useEffect)(() => {
|
|
31
32
|
trigger(providers_1.SwapFormKey.ToAddress);
|
|
32
33
|
}, [account.chainId, trigger]);
|
|
33
|
-
|
|
34
|
+
const hiddenToAddress = hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.ToAddress);
|
|
35
|
+
const disabledToAddress = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.ToAddress);
|
|
36
|
+
// We want to show toAddress field if it is set via widget configuration, disabled for changes, but not hidden
|
|
37
|
+
const showInstantly = Boolean(!showSendToWalletDirty &&
|
|
38
|
+
toAddress &&
|
|
39
|
+
disabledToAddress &&
|
|
40
|
+
showDestinationWallet &&
|
|
41
|
+
!hiddenToAddress);
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
if (showInstantly) {
|
|
44
|
+
setSendToWallet(true);
|
|
45
|
+
}
|
|
46
|
+
}, [showInstantly, setSendToWallet]);
|
|
47
|
+
if (hiddenToAddress) {
|
|
34
48
|
return null;
|
|
35
49
|
}
|
|
36
50
|
const { onChange, onBlur, name, ref: inputRef, } = register(providers_1.SwapFormKey.ToAddress, {
|
|
@@ -49,7 +63,7 @@ exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
|
|
|
49
63
|
}),
|
|
50
64
|
onBlur: () => trigger(providers_1.SwapFormKey.ToAddress),
|
|
51
65
|
});
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: 225, in: showSendToWallet, mountOnEnter: true, unmountOnExit: true }, { children: (0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { ref: ref }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, Object.assign({ fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' } }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: inputRef, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), (0, jsx_runtime_1.jsx)(exports.SendToWalletFormHelperText, {})] }))] })) })));
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: showInstantly ? 0 : 225, in: showSendToWallet || showInstantly, mountOnEnter: true, unmountOnExit: true }, { children: (0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { ref: ref }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, Object.assign({ fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' } }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: inputRef, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns'), disabled: Boolean(toAddress && disabledToAddress) }), (0, jsx_runtime_1.jsx)(exports.SendToWalletFormHelperText, {})] }))] })) })));
|
|
53
67
|
});
|
|
54
68
|
const SendToWalletFormHelperText = () => {
|
|
55
69
|
var _a;
|
|
@@ -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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
error?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -12,4 +12,10 @@ exports.Input = (0, styles_1.styled)(material_1.InputBase)(({ theme }) => ({
|
|
|
12
12
|
height: 32,
|
|
13
13
|
padding: theme.spacing(0, 0, 0, 2),
|
|
14
14
|
},
|
|
15
|
+
[`&.${InputBase_1.inputBaseClasses.disabled}`]: {
|
|
16
|
+
color: 'inherit',
|
|
17
|
+
},
|
|
18
|
+
[`.${InputBase_1.inputBaseClasses.input}.${InputBase_1.inputBaseClasses.disabled}`]: {
|
|
19
|
+
WebkitTextFillColor: 'unset',
|
|
20
|
+
},
|
|
15
21
|
}));
|
|
@@ -9,21 +9,20 @@ const react_i18next_1 = require("react-i18next");
|
|
|
9
9
|
const providers_1 = require("../../providers");
|
|
10
10
|
const stores_1 = require("../../stores");
|
|
11
11
|
const types_1 = require("../../types");
|
|
12
|
-
const store_1 = require("./store");
|
|
13
12
|
const SendToWalletButton = () => {
|
|
14
13
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
|
-
const { disabledUI } = (0, providers_1.useWidgetConfig)();
|
|
16
|
-
const { account } = (0, providers_1.useWallet)();
|
|
17
14
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
15
|
+
const { account } = (0, providers_1.useWallet)();
|
|
16
|
+
const { disabledUI, hiddenUI } = (0, providers_1.useWidgetConfig)();
|
|
17
|
+
const { showSendToWallet, toggleSendToWallet } = (0, stores_1.useSendToWalletStore)();
|
|
18
18
|
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
19
|
-
const { showSendToWallet, toggleSendToWallet } = (0, store_1.useSendToWalletStore)();
|
|
20
19
|
if (!showDestinationWallet ||
|
|
21
20
|
!account.isActive ||
|
|
22
|
-
(
|
|
21
|
+
(hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.ToAddress))) {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
25
24
|
const handleClick = () => {
|
|
26
|
-
if (showSendToWallet) {
|
|
25
|
+
if (showSendToWallet && !(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.ToAddress))) {
|
|
27
26
|
setValue(providers_1.SwapFormKey.ToAddress, '', { shouldTouch: true });
|
|
28
27
|
}
|
|
29
28
|
toggleSendToWallet();
|
|
@@ -14,3 +14,23 @@ export declare const SmallAvatar: import("@emotion/styled").StyledComponent<{
|
|
|
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
16
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "src" | "sizes" | "srcSet" | "imgProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export declare const SmallAvatarSkeletonBase: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
animation?: false | "pulse" | "wave" | undefined;
|
|
19
|
+
children?: import("react").ReactNode;
|
|
20
|
+
classes?: Partial<import("@mui/material").SkeletonClasses> | undefined;
|
|
21
|
+
height?: string | number | undefined;
|
|
22
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
23
|
+
variant?: "text" | "circular" | "rounded" | "rectangular" | undefined;
|
|
24
|
+
width?: string | number | undefined;
|
|
25
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
26
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
27
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "height" | "width" | "animation" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
28
|
+
export declare const SmallAvatarSkeletonContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
29
|
+
children?: import("react").ReactNode;
|
|
30
|
+
component?: import("react").ElementType<any> | undefined;
|
|
31
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
32
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
33
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
34
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
35
|
+
}, 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>, {}, {}>;
|
|
36
|
+
export declare const SmallAvatarSkeleton: () => JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SmallAvatar = void 0;
|
|
3
|
+
exports.SmallAvatarSkeleton = exports.SmallAvatarSkeletonContainer = exports.SmallAvatarSkeletonBase = exports.SmallAvatar = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const material_1 = require("@mui/material");
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
exports.SmallAvatar = (0, styles_1.styled)(material_1.Avatar)(({ theme }) => ({
|
|
@@ -9,3 +10,16 @@ exports.SmallAvatar = (0, styles_1.styled)(material_1.Avatar)(({ theme }) => ({
|
|
|
9
10
|
height: 16,
|
|
10
11
|
border: `2px solid ${theme.palette.background.paper}`,
|
|
11
12
|
}));
|
|
13
|
+
exports.SmallAvatarSkeletonBase = (0, styles_1.styled)(material_1.Skeleton)(({ theme }) => ({
|
|
14
|
+
border: `2px solid ${theme.palette.background.paper}`,
|
|
15
|
+
width: 16,
|
|
16
|
+
height: 16,
|
|
17
|
+
}));
|
|
18
|
+
exports.SmallAvatarSkeletonContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
19
|
+
background: theme.palette.background.paper,
|
|
20
|
+
borderRadius: '50%',
|
|
21
|
+
}));
|
|
22
|
+
const SmallAvatarSkeleton = () => {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(exports.SmallAvatarSkeletonContainer, { children: (0, jsx_runtime_1.jsx)(exports.SmallAvatarSkeletonBase, { variant: "circular" }) }));
|
|
24
|
+
};
|
|
25
|
+
exports.SmallAvatarSkeleton = SmallAvatarSkeleton;
|
|
@@ -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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { SwapButtonProps } from './types';
|
|
3
|
-
export declare const SwapButton:
|
|
3
|
+
export declare const SwapButton: React.FC<SwapButtonProps>;
|
|
@@ -12,18 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.SwapButton = void 0;
|
|
13
13
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
14
|
const lab_1 = require("@mui/lab");
|
|
15
|
-
const react_1 = require("react");
|
|
16
15
|
const react_i18next_1 = require("react-i18next");
|
|
17
16
|
const react_router_dom_1 = require("react-router-dom");
|
|
18
|
-
const hooks_1 = require("../../hooks");
|
|
19
17
|
const providers_1 = require("../../providers");
|
|
20
18
|
const utils_1 = require("../../utils");
|
|
21
|
-
|
|
19
|
+
const SwapButton = ({ onClick, currentRoute, text, disabled, loading, }) => {
|
|
22
20
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
23
21
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
24
22
|
const { variant, walletManagement } = (0, providers_1.useWidgetConfig)();
|
|
25
23
|
const { account, connect } = (0, providers_1.useWallet)();
|
|
26
|
-
const { insufficientFunds, insufficientGas, isLoading: isGasSufficiencyLoading, } = (0, hooks_1.useGasSufficiency)(currentRoute);
|
|
27
24
|
const handleSwapButtonClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
25
|
if (!account.isActive) {
|
|
29
26
|
if (walletManagement) {
|
|
@@ -51,5 +48,6 @@ exports.SwapButton = (0, react_1.forwardRef)(({ onClick, currentRoute, text, dis
|
|
|
51
48
|
}
|
|
52
49
|
return t(`button.connectWallet`);
|
|
53
50
|
};
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled:
|
|
55
|
-
}
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: disabled, loading: loading, loadingPosition: "center", fullWidth: true }, { children: getButtonText() })));
|
|
52
|
+
};
|
|
53
|
+
exports.SwapButton = SwapButton;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.SwapButton = void 0;
|
|
4
18
|
var SwapButton_1 = require("./SwapButton");
|
|
5
19
|
Object.defineProperty(exports, "SwapButton", { enumerable: true, get: function () { return SwapButton_1.SwapButton; } });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
@@ -4,7 +4,7 @@ export declare const minInputFontSize = 14;
|
|
|
4
4
|
export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
5
5
|
children?: import("react").ReactNode;
|
|
6
6
|
classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
|
|
7
|
-
color?: "success" | "warning" | "error" | "
|
|
7
|
+
color?: "success" | "warning" | "error" | "secondary" | "primary" | "info" | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
error?: boolean | undefined;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
@@ -12,6 +12,7 @@ exports.FormControl = (0, styles_1.styled)(material_1.FormControl)(({ theme }) =
|
|
|
12
12
|
exports.Input = (0, styles_1.styled)(material_1.InputBase)(({ theme }) => ({
|
|
13
13
|
fontSize: 24,
|
|
14
14
|
fontWeight: 700,
|
|
15
|
+
boxShadow: 'none',
|
|
15
16
|
// padding: theme.spacing(2, 2, 2, 0),
|
|
16
17
|
[`.${InputBase_1.inputBaseClasses.input}`]: {
|
|
17
18
|
height: 32,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const Button: 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" | "secondary" | "primary" | "info" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -16,6 +16,6 @@ const SwapInputStartAdornment = ({ formType, }) => {
|
|
|
16
16
|
const { chain } = (0, hooks_1.useChain)(chainId);
|
|
17
17
|
const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
|
|
18
18
|
const isSelected = !!(chain && token);
|
|
19
|
-
return isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.
|
|
19
|
+
return isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarDefault, { sx: { marginLeft: 2 } }));
|
|
20
20
|
};
|
|
21
21
|
exports.SwapInputStartAdornment = SwapInputStartAdornment;
|
|
@@ -17,7 +17,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
|
|
|
17
17
|
export declare const IconButton: import("@emotion/styled").StyledComponent<{
|
|
18
18
|
children?: import("react").ReactNode;
|
|
19
19
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
20
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "
|
|
20
|
+
color?: "inherit" | "default" | "success" | "warning" | "error" | "secondary" | "primary" | "info" | undefined;
|
|
21
21
|
disabled?: boolean | undefined;
|
|
22
22
|
disableFocusRipple?: boolean | undefined;
|
|
23
23
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -6,6 +6,9 @@ interface TokenProps {
|
|
|
6
6
|
connected?: boolean;
|
|
7
7
|
step?: Step;
|
|
8
8
|
disableDescription?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const Token: React.FC<TokenProps & BoxProps>;
|
|
12
|
+
export declare const TokenFallback: React.FC<TokenProps & BoxProps>;
|
|
13
|
+
export declare const TokenBase: React.FC<TokenProps & BoxProps>;
|
|
11
14
|
export {};
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Token = void 0;
|
|
14
|
+
exports.TokenBase = exports.TokenFallback = exports.Token = void 0;
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
const material_1 = require("@mui/material");
|
|
17
17
|
const react_i18next_1 = require("react-i18next");
|
|
@@ -22,7 +22,21 @@ const TextFitter_1 = require("../TextFitter");
|
|
|
22
22
|
const TokenAvatar_1 = require("../TokenAvatar");
|
|
23
23
|
const Token_style_1 = require("./Token.style");
|
|
24
24
|
const Token = (_a) => {
|
|
25
|
+
var { token } = _a, other = __rest(_a, ["token"]);
|
|
26
|
+
if (!token.priceUSD || !token.logoURI) {
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(exports.TokenFallback, Object.assign({ token: token }, other));
|
|
28
|
+
}
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(exports.TokenBase, Object.assign({ token: token }, other));
|
|
30
|
+
};
|
|
31
|
+
exports.Token = Token;
|
|
32
|
+
const TokenFallback = (_a) => {
|
|
25
33
|
var { token, connected, step, disableDescription } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription"]);
|
|
34
|
+
const { token: chainToken, isLoading } = (0, hooks_1.useToken)(token.chainId, token.address);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(exports.TokenBase, Object.assign({ token: Object.assign(Object.assign({}, token), chainToken), isLoading: isLoading }, other)));
|
|
36
|
+
};
|
|
37
|
+
exports.TokenFallback = TokenFallback;
|
|
38
|
+
const TokenBase = (_a) => {
|
|
39
|
+
var { token, connected, step, disableDescription, isLoading } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription", "isLoading"]);
|
|
26
40
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
27
41
|
const { chain } = (0, hooks_1.useChain)(token.chainId);
|
|
28
42
|
const formattedTokenAmount = (0, utils_1.formatTokenAmount)(token.amount, token.decimals);
|
|
@@ -41,4 +55,4 @@ const Token = (_a) => {
|
|
|
41
55
|
marginBottom: -0.25,
|
|
42
56
|
} }, { children: step.toolDetails.name[0] })) })), (0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, Object.assign({ connected: true }, { children: step.toolDetails.name }))] }))) : null] }))] })));
|
|
43
57
|
};
|
|
44
|
-
exports.
|
|
58
|
+
exports.TokenBase = TokenBase;
|