@lifi/widget 1.32.1 → 1.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +1 -1
  2. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
  3. package/cjs/components/Card/Card.d.ts +0 -2
  4. package/cjs/components/Card/Card.js +2 -8
  5. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +0 -1
  6. package/cjs/components/Header/WalletHeader.js +1 -1
  7. package/cjs/components/ListItemButton.js +1 -1
  8. package/cjs/components/SwapRouteCard/SwapRouteCard.js +1 -1
  9. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
  10. package/cjs/components/TokenList/TokenListItem.js +1 -1
  11. package/cjs/config/theme.js +25 -0
  12. package/cjs/config/version.d.ts +1 -1
  13. package/cjs/config/version.js +1 -1
  14. package/cjs/i18n/it.json +8 -8
  15. package/cjs/i18n/zh.json +8 -8
  16. package/cjs/pages/SelectChainPage/SelectChainPage.js +1 -1
  17. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
  18. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  19. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +1 -1
  20. package/cjs/pages/SettingsPage/EnabledToolsButton.js +1 -1
  21. package/cjs/utils/colors.d.ts +2 -2
  22. package/cjs/utils/colors.js +1 -3
  23. package/components/ActiveSwaps/ActiveSwapItem.js +1 -1
  24. package/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
  25. package/components/Card/Card.d.ts +0 -2
  26. package/components/Card/Card.js +2 -8
  27. package/components/ChainSelect/ChainSelect.style.d.ts +0 -1
  28. package/components/Header/WalletHeader.js +1 -1
  29. package/components/ListItemButton.js +1 -1
  30. package/components/SwapRouteCard/SwapRouteCard.js +1 -1
  31. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
  32. package/components/TokenList/TokenListItem.js +1 -1
  33. package/config/theme.js +25 -0
  34. package/config/version.d.ts +1 -1
  35. package/config/version.js +1 -1
  36. package/i18n/it.json +8 -8
  37. package/i18n/zh.json +8 -8
  38. package/package.json +4 -4
  39. package/pages/SelectChainPage/SelectChainPage.js +1 -1
  40. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
  41. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  42. package/pages/SelectWalletPage/SelectWalletPage.js +1 -1
  43. package/pages/SettingsPage/EnabledToolsButton.js +1 -1
  44. package/tsconfig.cjs.tsbuildinfo +1 -1
  45. package/utils/colors.d.ts +2 -2
  46. package/utils/colors.js +1 -3
@@ -41,7 +41,7 @@ const ActiveSwapItem = ({ routeId, dense }) => {
41
41
  }
42
42
  };
43
43
  const ListItemComponent = dense ? ActiveSwaps_style_1.ListItem : ActiveSwaps_style_1.ListItemButton;
44
- return ((0, jsx_runtime_1.jsxs)(ListItemComponent, { onClick: handleClick, dense: true, disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsxs)(TokenAvatar_1.TokenAvatarGroup, { total: 2, children: [(0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: route.fromToken }), (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: route.toToken })] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { sx: { margin: 0 }, disableTypography: true, primary: (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 500, lineHeight: 1, sx: {
44
+ return ((0, jsx_runtime_1.jsxs)(ListItemComponent, { onClick: handleClick, dense: true, disableRipple: dense, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsxs)(TokenAvatar_1.TokenAvatarGroup, { total: 2, children: [(0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: route.fromToken }), (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: route.toToken })] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { sx: { margin: 0 }, disableTypography: true, primary: (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 500, lineHeight: 1, sx: {
45
45
  display: 'flex',
46
46
  alignItems: 'center',
47
47
  marginLeft: 2,
@@ -11,7 +11,7 @@ exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ them
11
11
  paddingRight: theme.spacing(1.5),
12
12
  height: 64,
13
13
  '&:hover': {
14
- backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
14
+ backgroundColor: (0, utils_1.getContrastAlphaColor)(theme.palette.mode, '4%'),
15
15
  },
16
16
  }));
17
17
  exports.ListItem = (0, styles_1.styled)(material_1.ListItem, {
@@ -4,7 +4,6 @@ type CardVariant = 'default' | 'selected' | 'error';
4
4
  export type CardProps = {
5
5
  variant?: CardVariant;
6
6
  selectionColor?: 'primary' | 'secondary';
7
- dense?: boolean;
8
7
  indented?: boolean;
9
8
  onClick?: MouseEventHandler<HTMLDivElement>;
10
9
  pointerEvents?: 'auto' | 'none';
@@ -19,7 +18,6 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
19
18
  }, "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
19
  variant?: CardVariant | undefined;
21
20
  selectionColor?: "primary" | "secondary" | undefined;
22
- dense?: boolean | undefined;
23
21
  indented?: boolean | undefined;
24
22
  onClick?: MouseEventHandler<HTMLDivElement> | undefined;
25
23
  pointerEvents?: "none" | "auto" | undefined;
@@ -12,14 +12,8 @@ const getBackgroundColor = (theme, variant, selectionColor) => variant === 'sele
12
12
  : (0, styles_1.alpha)(theme.palette.secondary.main, theme.palette.mode === 'light' ? 0.08 : 0.12)
13
13
  : theme.palette.background.paper;
14
14
  exports.Card = (0, styles_1.styled)(material_1.Box, {
15
- shouldForwardProp: (prop) => ![
16
- 'dense',
17
- 'variant',
18
- 'indented',
19
- 'selectionColor',
20
- 'pointerEvents',
21
- ].includes(prop),
22
- })(({ theme, variant, selectionColor = 'primary', dense, indented, pointerEvents, onClick, }) => {
15
+ shouldForwardProp: (prop) => !['variant', 'indented', 'selectionColor', 'pointerEvents'].includes(prop),
16
+ })(({ theme, variant, selectionColor = 'primary', indented, pointerEvents, onClick, }) => {
23
17
  const backgroundColor = getBackgroundColor(theme, variant, selectionColor);
24
18
  const backgroundHoverColor = onClick
25
19
  ? theme.palette.mode === 'light'
@@ -9,7 +9,6 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
9
9
  }, "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
11
  selectionColor?: "primary" | "secondary" | undefined;
12
- dense?: boolean | undefined;
13
12
  indented?: boolean | undefined;
14
13
  onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
15
14
  pointerEvents?: "none" | "auto" | undefined;
@@ -56,7 +56,7 @@ const ConnectedButton = () => {
56
56
  };
57
57
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), startIcon: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: chain?.logoURI, alt: chain?.key, sx: { width: 24, height: 24 }, children: chain?.name[0] }), sx: {
58
58
  marginRight: -1.25,
59
- }, onClick: handleClick, children: walletAddress }), (0, jsx_runtime_1.jsxs)(WalletMenu_1.WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { 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, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", disableRipple: true, children: [(0, jsx_runtime_1.jsx)(icons_material_1.OpenInNewOutlined, {}), t(`button.viewOnExplorer`)] }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleDisconnect, fullWidth: true, startIcon: (0, jsx_runtime_1.jsx)(icons_material_1.PowerSettingsNewRounded, {}), sx: {
59
+ }, onClick: handleClick, children: walletAddress }), (0, jsx_runtime_1.jsxs)(WalletMenu_1.WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: handleCopyAddress, children: [(0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, {}), t(`button.copyAddress`)] }), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: [(0, jsx_runtime_1.jsx)(icons_material_1.OpenInNewOutlined, {}), t(`button.viewOnExplorer`)] }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleDisconnect, fullWidth: true, startIcon: (0, jsx_runtime_1.jsx)(icons_material_1.PowerSettingsNewRounded, {}), sx: {
60
60
  marginTop: 1,
61
61
  }, children: t(`button.disconnect`) })] })] }));
62
62
  };
@@ -9,6 +9,6 @@ exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ them
9
9
  paddingLeft: theme.spacing(1.5),
10
10
  height: 56,
11
11
  '&:hover': {
12
- backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
12
+ backgroundColor: (0, utils_1.getContrastAlphaColor)(theme.palette.mode, '4%'),
13
13
  },
14
14
  }));
@@ -28,7 +28,7 @@ const SwapRouteCard = ({ route, active, variant = 'default', expanded, ...other
28
28
  ? { ...route.fromToken, amount: route.fromAmount }
29
29
  : { ...route.toToken, amount: route.toAmount };
30
30
  const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.Label, { active: active ?? label !== alternativeTag, children: label }), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}) })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) }), variant !== 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] }));
31
- return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
31
+ return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
32
32
  };
33
33
  exports.SwapRouteCard = SwapRouteCard;
34
34
  const SwapRouteCardEssentials = ({ route, dense }) => {
@@ -10,6 +10,6 @@ const SwapRouteCardSkeleton = ({ variant, ...other }) => {
10
10
  const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 118, height: 24, sx: (theme) => ({
11
11
  borderRadius: `${theme.shape.borderRadiusSecondary}px`,
12
12
  }) }), variant === 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 52, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 44, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 32, height: 24 })] })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { mr: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 6, display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })) : null] })] }), variant !== 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 })] })) : null] }));
13
- return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { dense: variant === 'dense', indented: true, ...other, children: cardContent }));
13
+ return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { indented: true, ...other, children: cardContent }));
14
14
  };
15
15
  exports.SwapRouteCardSkeleton = SwapRouteCardSkeleton;
@@ -17,7 +17,7 @@ exports.TokenListItem = (0, react_1.memo)(({ onClick, size, start, token, showBa
17
17
  const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
18
18
  const { t } = (0, react_i18next_1.useTranslation)();
19
19
  const tokenPrice = (0, utils_1.formatTokenPrice)(token.amount, token.priceUSD);
20
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, dense: true, disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
20
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
21
21
  value: token.amount,
22
22
  }) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
23
23
  value: tokenPrice,
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTheme = void 0;
4
4
  const LoadingButton_1 = require("@mui/lab/LoadingButton");
5
+ const ButtonBase_1 = require("@mui/material/ButtonBase");
5
6
  const colors_1 = require("@mui/material/colors");
6
7
  const DialogActions_1 = require("@mui/material/DialogActions");
7
8
  const styles_1 = require("@mui/material/styles");
9
+ const system_1 = require("@mui/system");
8
10
  const palette = {
9
11
  primary: {
10
12
  main: '#3F49E1',
@@ -44,6 +46,16 @@ const shape = {
44
46
  borderRadius: 12,
45
47
  borderRadiusSecondary: 8,
46
48
  };
49
+ const enterKeyframe = (0, system_1.keyframes) `
50
+ 0% {
51
+ transform: scale(0);
52
+ opacity: 0.05;
53
+ }
54
+ 100% {
55
+ transform: scale(1);
56
+ opacity: 0.1;
57
+ }
58
+ `;
47
59
  const createTheme = (mode, theme = {}) => {
48
60
  const primaryMainColor = theme.palette?.primary?.main ??
49
61
  palette.primary.main;
@@ -107,6 +119,19 @@ const createTheme = (mode, theme = {}) => {
107
119
  },
108
120
  },
109
121
  },
122
+ MuiButtonBase: {
123
+ styleOverrides: {
124
+ root: {
125
+ [`& .${ButtonBase_1.touchRippleClasses.ripple}.${ButtonBase_1.touchRippleClasses.rippleVisible}`]: {
126
+ animationName: `${enterKeyframe}`,
127
+ },
128
+ [`& .${ButtonBase_1.touchRippleClasses.ripple}.${ButtonBase_1.touchRippleClasses.rippleVisible}`]: {
129
+ opacity: 0.1,
130
+ animationName: `${enterKeyframe}`,
131
+ },
132
+ },
133
+ },
134
+ },
110
135
  MuiButton: {
111
136
  defaultProps: {
112
137
  disableElevation: true,
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.32.1";
2
+ export declare const version = "1.32.2";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '1.32.1';
5
+ exports.version = '1.32.2';
package/cjs/i18n/it.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "contactSupport": "Contatta l'assistenza",
7
7
  "continue": "Continua",
8
8
  "copyAddress": "Copia indirizzo",
9
- "viewOnExplorer": "Visualizza sull'Explorer",
10
9
  "dark": "Scuro",
11
10
  "delete": "Elimina",
12
11
  "disconnect": "Disconnetti",
@@ -19,6 +18,8 @@
19
18
  "ok": "Ok",
20
19
  "okay": "Okay",
21
20
  "removeSwap": "Rimuovi lo scambio",
21
+ "reset": "Ripristina",
22
+ "resetSettings": "Ripristina impostazioni",
22
23
  "restartSwap": "Riavvia lo scambio",
23
24
  "reviewGasSwap": "Rivedi lo scambio di gas",
24
25
  "reviewSwap": "Rivedi lo scambio",
@@ -27,7 +28,8 @@
27
28
  "startGasSwap": "Inizia lo scambio di gas",
28
29
  "startSwap": "Avvia lo scambio",
29
30
  "swap": "Scambio",
30
- "tryAgain": "Riprova"
31
+ "tryAgain": "Riprova",
32
+ "viewOnExplorer": "Visualizza sull'Explorer"
31
33
  },
32
34
  "format": {
33
35
  "currency": "{{value, currency(currency: USD)}}",
@@ -54,7 +56,6 @@
54
56
  "title": "Lingua"
55
57
  },
56
58
  "settings": {
57
- "advancedPreferences": "Preferenze avanzate",
58
59
  "enabledBridges": "Bridge abilitati",
59
60
  "enabledExchanges": "Exchange abilitati",
60
61
  "gasPrice": {
@@ -63,10 +64,7 @@
63
64
  "slow": "Lento",
64
65
  "title": "Prezzo gas"
65
66
  },
66
- "resetToDefault": "Ripristina le impostazioni predefinite",
67
67
  "routePriority": "Priorità di route",
68
- "selectEnabledBridges": "Selezionare i bridge abilitati",
69
- "selectEnabledExchanges": "Seleziona gli exchange abilitati",
70
68
  "showDestinationWallet": "Mostra il portafoglio di destinazione",
71
69
  "slippage": "Slittamento"
72
70
  },
@@ -201,7 +199,8 @@
201
199
  "highValueLoss": "Il valore dei token ricevuti è significativamente inferiore ai token scambiati più il costo della transazione.",
202
200
  "insufficientFunds": "Non hai abbastanza fondi per eseguire lo scambio.",
203
201
  "insufficientGas": "È necessario aggiungere almeno:",
204
- "rateChanged": "Il tasso di scambio è cambiato. Se procedi, confermi di accettare il nuovo tasso."
202
+ "rateChanged": "Il tasso di scambio è cambiato. Se procedi, confermi di accettare il nuovo tasso.",
203
+ "resetSettings": "Questo porterà al ripristino della priorità di route, slittamento di prezzo, prezzo del gas, bridge abilitati ed exchanges."
205
204
  },
206
205
  "title": {
207
206
  "deleteActiveSwaps": "Cancellare tutti gli scambi attivi?",
@@ -209,7 +208,8 @@
209
208
  "deleteSwapHistory": "Cancellare la cronologia degli scambi?",
210
209
  "highValueLoss": "Perdita di valore elevato",
211
210
  "insufficientGas": "Gas insufficiente",
212
- "rateChanged": "Tasso cambiato"
211
+ "rateChanged": "Tasso cambiato",
212
+ "resetSettings": "Ripristinare le impostazioni?"
213
213
  }
214
214
  }
215
215
  },
package/cjs/i18n/zh.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "contactSupport": "联系我们",
7
7
  "continue": "继续",
8
8
  "copyAddress": "复制地址",
9
- "viewOnExplorer": "在区块链浏览器上查看",
10
9
  "dark": "深色模式",
11
10
  "delete": "删除",
12
11
  "disconnect": "断开连接",
@@ -19,6 +18,8 @@
19
18
  "ok": "确认",
20
19
  "okay": "确认",
21
20
  "removeSwap": "删除该兑换",
21
+ "reset": "重置",
22
+ "resetSettings": "恢复默认设置",
22
23
  "restartSwap": "重新兑换",
23
24
  "reviewGasSwap": "查看燃气费兑换",
24
25
  "reviewSwap": "查看该兑换",
@@ -27,7 +28,8 @@
27
28
  "startGasSwap": "开始兑换燃气费",
28
29
  "startSwap": "开始兑换",
29
30
  "swap": "兑换",
30
- "tryAgain": "重试"
31
+ "tryAgain": "重试",
32
+ "viewOnExplorer": "在区块链浏览器上查看"
31
33
  },
32
34
  "format": {
33
35
  "currency": "{{value, currency(currency: USD)}}",
@@ -54,7 +56,6 @@
54
56
  "title": "语言"
55
57
  },
56
58
  "settings": {
57
- "advancedPreferences": "偏好设置",
58
59
  "enabledBridges": "已选中的跨链桥",
59
60
  "enabledExchanges": "已选中的交易所",
60
61
  "gasPrice": {
@@ -63,10 +64,7 @@
63
64
  "slow": "缓慢",
64
65
  "title": "燃气费"
65
66
  },
66
- "resetToDefault": "重置为默认值",
67
67
  "routePriority": "路由优先级",
68
- "selectEnabledBridges": "选择要使用的跨链桥",
69
- "selectEnabledExchanges": "选择要使用的交易所",
70
68
  "showDestinationWallet": "显示收款钱包",
71
69
  "slippage": "滑点"
72
70
  },
@@ -201,7 +199,8 @@
201
199
  "highValueLoss": "收到的代币的价值明显低于要被兑换的代币和交易成本。",
202
200
  "insufficientFunds": "你没有足够的资金来执行这笔兑换。",
203
201
  "insufficientGas": "你至少需要:",
204
- "rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。"
202
+ "rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。",
203
+ "resetSettings": "这将重置您的路由优先级,滑点,燃气费,选中的跨链桥和链上交易所。"
205
204
  },
206
205
  "title": {
207
206
  "deleteActiveSwaps": "确定要清空正在进行的兑换记录?",
@@ -209,7 +208,8 @@
209
208
  "deleteSwapHistory": "确定要清空兑换记录?",
210
209
  "highValueLoss": "大额资金损失",
211
210
  "insufficientGas": "燃料费不足",
212
- "rateChanged": "兑换比例变动"
211
+ "rateChanged": "兑换比例变动",
212
+ "resetSettings": "确定要恢复默认设置吗?"
213
213
  }
214
214
  }
215
215
  },
@@ -24,6 +24,6 @@ const SelectChainPage = ({ formType, selectNativeToken, }) => {
24
24
  return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
25
25
  paddingLeft: 1.5,
26
26
  paddingRight: 1.5,
27
- }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleClick(chain), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.name })] }, chain.id))) }) }));
27
+ }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleClick(chain), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.name })] }, chain.id))) }) }));
28
28
  };
29
29
  exports.SelectChainPage = SelectChainPage;
@@ -46,6 +46,6 @@ const SelectEnabledToolsPage = ({ type }) => {
46
46
  return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
47
47
  paddingLeft: 1.5,
48
48
  paddingRight: 1.5,
49
- }, children: tools?.[typeKey].map((tool) => ((0, jsx_runtime_1.jsxs)(SelectEnabledToolsPage_style_1.ListItemButton, { onClick: () => handleClick(tool.key), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) ? ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBox, { color: "primary" })) : ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBoxOutlineBlankOutlined, {}))] }, tool.name))) }) }));
49
+ }, children: tools?.[typeKey].map((tool) => ((0, jsx_runtime_1.jsxs)(SelectEnabledToolsPage_style_1.ListItemButton, { onClick: () => handleClick(tool.key), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) ? ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBox, { color: "primary" })) : ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBoxOutlineBlankOutlined, {}))] }, tool.name))) }) }));
50
50
  };
51
51
  exports.SelectEnabledToolsPage = SelectEnabledToolsPage;
@@ -17,6 +17,6 @@ const SelectNativeTokenPage = ({ formType, }) => {
17
17
  return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
18
18
  paddingLeft: 1.5,
19
19
  paddingRight: 1.5,
20
- }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: chain.nativeToken, chain: chain }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.nativeToken.symbol, secondary: t('swap.onChain', { chainName: chain.name }) })] }, chain.id))) }) }));
20
+ }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: chain.nativeToken, chain: chain }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.nativeToken.symbol, secondary: t('swap.onChain', { chainName: chain.name }) })] }, chain.id))) }) }));
21
21
  };
22
22
  exports.SelectNativeTokenPage = SelectNativeTokenPage;
@@ -40,7 +40,7 @@ const SelectWalletPage = () => {
40
40
  return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsx)(material_1.List, { sx: {
41
41
  paddingLeft: 1.5,
42
42
  paddingRight: 1.5,
43
- }, children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleConnect(wallet), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: wallet.icon.src || wallet.icon, alt: wallet.name, children: wallet.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: wallet.name })] }, wallet.name))) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: walletIdentity.show, onClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
43
+ }, children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleConnect(wallet), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: wallet.icon.src || wallet.icon, alt: wallet.name, children: wallet.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: wallet.name })] }, wallet.name))) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: walletIdentity.show, onClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
44
44
  name: walletIdentity.wallet?.name,
45
45
  }) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: closeDialog, autoFocus: true, children: t('button.ok') }) })] })] }));
46
46
  };
@@ -20,6 +20,6 @@ const EnabledToolsButton = ({ type }) => {
20
20
  const handleClick = () => {
21
21
  navigate(utils_1.navigationRoutes[type.toLowerCase()]);
22
22
  };
23
- return ((0, jsx_runtime_1.jsxs)(EnabledToolsButton_style_1.ListItemButton, { onClick: handleClick, disableRipple: true, children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: t(`settings.enabled${type}`) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: `${enabledTools}/${tools}` }), (0, jsx_runtime_1.jsx)(icons_material_1.ChevronRight, {})] })] }));
23
+ return ((0, jsx_runtime_1.jsxs)(EnabledToolsButton_style_1.ListItemButton, { onClick: handleClick, children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: t(`settings.enabled${type}`) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: `${enabledTools}/${tools}` }), (0, jsx_runtime_1.jsx)(icons_material_1.ChevronRight, {})] })] }));
24
24
  };
25
25
  exports.EnabledToolsButton = EnabledToolsButton;
@@ -1,3 +1,3 @@
1
- import type { Theme } from '@mui/material';
2
- export declare const getContrastAlphaColor: (theme: Theme, alpha: string | number) => string;
1
+ import type { PaletteMode, Theme } from '@mui/material';
2
+ export declare const getContrastAlphaColor: (mode: PaletteMode, alpha: string | number) => string;
3
3
  export declare const getContrastTextColor: (theme: Theme, background?: string) => "#fff" | "#000";
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getContrastTextColor = exports.getContrastAlphaColor = void 0;
4
4
  const colors_1 = require("@mui/material/colors");
5
5
  const styles_1 = require("@mui/material/styles");
6
- const getContrastAlphaColor = (theme, alpha) => theme.palette.mode === 'light'
7
- ? `rgb(0 0 0 / ${alpha})`
8
- : `rgb(255 255 255 / ${alpha})`;
6
+ const getContrastAlphaColor = (mode, alpha) => mode === 'light' ? `rgb(0 0 0 / ${alpha})` : `rgb(255 255 255 / ${alpha})`;
9
7
  exports.getContrastAlphaColor = getContrastAlphaColor;
10
8
  const getContrastTextColor = (theme, background) => (0, styles_1.getContrastRatio)(colors_1.common.white, background ?? theme.palette.primary.main) >= 3
11
9
  ? colors_1.common.white
@@ -38,7 +38,7 @@ export const ActiveSwapItem = ({ routeId, dense }) => {
38
38
  }
39
39
  };
40
40
  const ListItemComponent = dense ? ListItem : ListItemButton;
41
- return (_jsxs(ListItemComponent, { onClick: handleClick, dense: true, disableRipple: true, children: [_jsx(ListItemAvatar, { children: _jsxs(TokenAvatarGroup, { total: 2, children: [_jsx(TokenAvatar, { token: route.fromToken }), _jsx(TokenAvatar, { token: route.toToken })] }) }), _jsx(ListItemText, { sx: { margin: 0 }, disableTypography: true, primary: _jsxs(Typography, { fontWeight: 500, lineHeight: 1, sx: {
41
+ return (_jsxs(ListItemComponent, { onClick: handleClick, dense: true, disableRipple: dense, children: [_jsx(ListItemAvatar, { children: _jsxs(TokenAvatarGroup, { total: 2, children: [_jsx(TokenAvatar, { token: route.fromToken }), _jsx(TokenAvatar, { token: route.toToken })] }) }), _jsx(ListItemText, { sx: { margin: 0 }, disableTypography: true, primary: _jsxs(Typography, { fontWeight: 500, lineHeight: 1, sx: {
42
42
  display: 'flex',
43
43
  alignItems: 'center',
44
44
  marginLeft: 2,
@@ -8,7 +8,7 @@ export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
8
8
  paddingRight: theme.spacing(1.5),
9
9
  height: 64,
10
10
  '&:hover': {
11
- backgroundColor: getContrastAlphaColor(theme, '4%'),
11
+ backgroundColor: getContrastAlphaColor(theme.palette.mode, '4%'),
12
12
  },
13
13
  }));
14
14
  export const ListItem = styled(MuiListItem, {
@@ -4,7 +4,6 @@ type CardVariant = 'default' | 'selected' | 'error';
4
4
  export type CardProps = {
5
5
  variant?: CardVariant;
6
6
  selectionColor?: 'primary' | 'secondary';
7
- dense?: boolean;
8
7
  indented?: boolean;
9
8
  onClick?: MouseEventHandler<HTMLDivElement>;
10
9
  pointerEvents?: 'auto' | 'none';
@@ -19,7 +18,6 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
19
18
  }, "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
19
  variant?: CardVariant | undefined;
21
20
  selectionColor?: "primary" | "secondary" | undefined;
22
- dense?: boolean | undefined;
23
21
  indented?: boolean | undefined;
24
22
  onClick?: MouseEventHandler<HTMLDivElement> | undefined;
25
23
  pointerEvents?: "none" | "auto" | undefined;
@@ -9,14 +9,8 @@ const getBackgroundColor = (theme, variant, selectionColor) => variant === 'sele
9
9
  : alpha(theme.palette.secondary.main, theme.palette.mode === 'light' ? 0.08 : 0.12)
10
10
  : theme.palette.background.paper;
11
11
  export const Card = styled(Box, {
12
- shouldForwardProp: (prop) => ![
13
- 'dense',
14
- 'variant',
15
- 'indented',
16
- 'selectionColor',
17
- 'pointerEvents',
18
- ].includes(prop),
19
- })(({ theme, variant, selectionColor = 'primary', dense, indented, pointerEvents, onClick, }) => {
12
+ shouldForwardProp: (prop) => !['variant', 'indented', 'selectionColor', 'pointerEvents'].includes(prop),
13
+ })(({ theme, variant, selectionColor = 'primary', indented, pointerEvents, onClick, }) => {
20
14
  const backgroundColor = getBackgroundColor(theme, variant, selectionColor);
21
15
  const backgroundHoverColor = onClick
22
16
  ? theme.palette.mode === 'light'
@@ -9,7 +9,6 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
9
9
  }, "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
11
  selectionColor?: "primary" | "secondary" | undefined;
12
- dense?: boolean | undefined;
13
12
  indented?: boolean | undefined;
14
13
  onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
15
14
  pointerEvents?: "none" | "auto" | undefined;
@@ -52,7 +52,7 @@ const ConnectedButton = () => {
52
52
  };
53
53
  return (_jsxs(_Fragment, { children: [_jsx(WalletButton, { endIcon: _jsx(ExpandMoreIcon, {}), startIcon: _jsx(Avatar, { src: chain?.logoURI, alt: chain?.key, sx: { width: 24, height: 24 }, children: chain?.name[0] }), sx: {
54
54
  marginRight: -1.25,
55
- }, onClick: handleClick, children: walletAddress }), _jsxs(WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [_jsxs(MenuItem, { onClick: handleCopyAddress, disableRipple: true, children: [_jsx(ContentCopyIcon, {}), t(`button.copyAddress`)] }), _jsxs(MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", disableRipple: true, children: [_jsx(OpenInNewOutlinedIcon, {}), t(`button.viewOnExplorer`)] }), _jsx(Button, { onClick: handleDisconnect, fullWidth: true, startIcon: _jsx(PowerSettingsIcon, {}), sx: {
55
+ }, onClick: handleClick, children: walletAddress }), _jsxs(WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [_jsxs(MenuItem, { onClick: handleCopyAddress, children: [_jsx(ContentCopyIcon, {}), t(`button.copyAddress`)] }), _jsxs(MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: [_jsx(OpenInNewOutlinedIcon, {}), t(`button.viewOnExplorer`)] }), _jsx(Button, { onClick: handleDisconnect, fullWidth: true, startIcon: _jsx(PowerSettingsIcon, {}), sx: {
56
56
  marginTop: 1,
57
57
  }, children: t(`button.disconnect`) })] })] }));
58
58
  };
@@ -6,6 +6,6 @@ export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
6
6
  paddingLeft: theme.spacing(1.5),
7
7
  height: 56,
8
8
  '&:hover': {
9
- backgroundColor: getContrastAlphaColor(theme, '4%'),
9
+ backgroundColor: getContrastAlphaColor(theme.palette.mode, '4%'),
10
10
  },
11
11
  }));
@@ -25,7 +25,7 @@ export const SwapRouteCard = ({ route, active, variant = 'default', expanded, ..
25
25
  ? { ...route.fromToken, amount: route.fromAmount }
26
26
  : { ...route.toToken, amount: route.toAmount };
27
27
  const cardContent = (_jsxs(Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? (_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [_jsx(Label, { active: active ?? label !== alternativeTag, children: label }), variant === 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route })) : null] })) : null, _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsx(Token, { token: token, step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? (_jsx(IconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? _jsx(ExpandLessIcon, {}) : _jsx(ExpandMoreIcon, {}) })) : null] }), _jsx(Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => (_jsx(StepActions, { step: step, mt: 2 }, step.id))) }), variant !== 'stretched' ? (_jsx(SwapRouteCardEssentials, { route: route, dense: true })) : null] }));
28
- return widgetVariant === 'refuel' ? (cardContent) : (_jsx(Card, { dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
28
+ return widgetVariant === 'refuel' ? (cardContent) : (_jsx(Card, { variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
29
29
  };
30
30
  export const SwapRouteCardEssentials = ({ route, dense }) => {
31
31
  const { t } = useTranslation();
@@ -7,5 +7,5 @@ export const SwapRouteCardSkeleton = ({ variant, ...other }) => {
7
7
  const cardContent = (_jsxs(Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? (_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [_jsx(Skeleton, { variant: "rectangular", width: 118, height: 24, sx: (theme) => ({
8
8
  borderRadius: `${theme.shape.borderRadiusSecondary}px`,
9
9
  }) }), variant === 'stretched' ? (_jsxs(Box, { display: "flex", children: [_jsx(Skeleton, { variant: "text", width: 52, height: 24, sx: { marginRight: 2 } }), _jsx(Skeleton, { variant: "text", width: 44, height: 24, sx: { marginRight: 2 } }), _jsx(Skeleton, { variant: "text", width: 32, height: 24 })] })) : null] })) : null, _jsxs(Box, { children: [_jsxs(Box, { display: "flex", alignItems: "center", children: [_jsx(Box, { mr: 2, children: _jsx(Skeleton, { variant: "circular", width: 32, height: 32 }) }), _jsx(Skeleton, { variant: "text", width: 96, height: 32 })] }), _jsxs(Box, { ml: 6, display: "flex", alignItems: "center", children: [_jsx(Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }), variant === 'stretched' ? (_jsx(Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })) : null] })] }), variant !== 'stretched' ? (_jsxs(Box, { mt: 2, display: "flex", justifyContent: "space-between", children: [_jsx(Skeleton, { variant: "text", width: 48, height: 24 }), _jsx(Skeleton, { variant: "text", width: 48, height: 24 })] })) : null] }));
10
- return widgetVariant === 'refuel' ? (cardContent) : (_jsx(Card, { dense: variant === 'dense', indented: true, ...other, children: cardContent }));
10
+ return widgetVariant === 'refuel' ? (cardContent) : (_jsx(Card, { indented: true, ...other, children: cardContent }));
11
11
  };
@@ -14,7 +14,7 @@ export const TokenListItem = memo(({ onClick, size, start, token, showBalance, i
14
14
  export const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
15
15
  const { t } = useTranslation();
16
16
  const tokenPrice = formatTokenPrice(token.amount, token.priceUSD);
17
- return (_jsxs(ListItemButton, { onClick: onClick, dense: true, disableRipple: true, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), _jsx(ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? (_jsx(TokenAmountSkeleton, {})) : (_jsxs(Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? (_jsx(Typography, { variant: "body1", noWrap: true, children: t('format.number', {
17
+ return (_jsxs(ListItemButton, { onClick: onClick, dense: true, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), _jsx(ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? (_jsx(TokenAmountSkeleton, {})) : (_jsxs(Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? (_jsx(Typography, { variant: "body1", noWrap: true, children: t('format.number', {
18
18
  value: token.amount,
19
19
  }) })) : null, tokenPrice ? (_jsx(Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
20
20
  value: tokenPrice,
package/config/theme.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { loadingButtonClasses } from '@mui/lab/LoadingButton';
2
+ import { touchRippleClasses } from '@mui/material/ButtonBase';
2
3
  import { common } from '@mui/material/colors';
3
4
  import { dialogActionsClasses } from '@mui/material/DialogActions';
4
5
  import { alpha, createTheme as createMuiTheme, darken, getContrastRatio, lighten, } from '@mui/material/styles';
6
+ import { keyframes } from '@mui/system';
5
7
  const palette = {
6
8
  primary: {
7
9
  main: '#3F49E1',
@@ -41,6 +43,16 @@ const shape = {
41
43
  borderRadius: 12,
42
44
  borderRadiusSecondary: 8,
43
45
  };
46
+ const enterKeyframe = keyframes `
47
+ 0% {
48
+ transform: scale(0);
49
+ opacity: 0.05;
50
+ }
51
+ 100% {
52
+ transform: scale(1);
53
+ opacity: 0.1;
54
+ }
55
+ `;
44
56
  export const createTheme = (mode, theme = {}) => {
45
57
  const primaryMainColor = theme.palette?.primary?.main ??
46
58
  palette.primary.main;
@@ -104,6 +116,19 @@ export const createTheme = (mode, theme = {}) => {
104
116
  },
105
117
  },
106
118
  },
119
+ MuiButtonBase: {
120
+ styleOverrides: {
121
+ root: {
122
+ [`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
123
+ animationName: `${enterKeyframe}`,
124
+ },
125
+ [`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
126
+ opacity: 0.1,
127
+ animationName: `${enterKeyframe}`,
128
+ },
129
+ },
130
+ },
131
+ },
107
132
  MuiButton: {
108
133
  defaultProps: {
109
134
  disableElevation: true,
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.32.1";
2
+ export declare const version = "1.32.2";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '1.32.1';
2
+ export const version = '1.32.2';