@lifi/widget 1.26.5 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/App.js +15 -2
  2. package/AppDrawer.d.ts +4 -2
  3. package/AppDrawer.style.d.ts +1 -1
  4. package/cjs/App.js +14 -1
  5. package/cjs/AppDrawer.d.ts +4 -2
  6. package/cjs/AppDrawer.style.d.ts +1 -1
  7. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  8. package/cjs/components/Card/Card.d.ts +1 -1
  9. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -0
  10. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -1
  11. package/cjs/components/Header/Header.style.d.ts +2 -2
  12. package/cjs/components/Menu.js +1 -1
  13. package/cjs/components/PoweredBy/PoweredBy.js +5 -2
  14. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  15. package/cjs/components/SelectTokenButton/SelectTokenButton.js +1 -1
  16. package/cjs/components/SendToWallet/SendToWallet.js +20 -6
  17. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  18. package/cjs/components/SendToWallet/SendToWallet.style.js +6 -0
  19. package/cjs/components/SendToWallet/SendToWalletButton.js +5 -6
  20. package/cjs/components/SmallAvatar.d.ts +20 -0
  21. package/cjs/components/SmallAvatar.js +15 -1
  22. package/cjs/components/Step/CircularProgress.d.ts +1 -0
  23. package/cjs/components/Step/StepList.d.ts +1 -0
  24. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  25. package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
  26. package/cjs/components/SwapButton/SwapButton.js +4 -6
  27. package/cjs/components/SwapButton/index.d.ts +1 -0
  28. package/cjs/components/SwapButton/index.js +15 -0
  29. package/cjs/components/SwapButton/types.d.ts +1 -2
  30. package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
  31. package/cjs/components/SwapInput/SwapInput.style.js +1 -0
  32. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  33. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -0
  34. package/cjs/components/SwapInput/SwapInputStartAdornment.js +1 -1
  35. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  36. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
  37. package/cjs/components/Token/Token.d.ts +3 -0
  38. package/cjs/components/Token/Token.js +16 -2
  39. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +2 -1
  40. package/cjs/components/TokenAvatar/TokenAvatar.js +8 -8
  41. package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  42. package/cjs/components/TokenAvatar/TokenAvatar.style.js +3 -3
  43. package/cjs/config/theme.js +2 -2
  44. package/cjs/config/version.d.ts +1 -1
  45. package/cjs/config/version.js +1 -1
  46. package/cjs/i18n/de.json +30 -6
  47. package/cjs/i18n/fr.json +30 -6
  48. package/cjs/i18n/it.json +30 -6
  49. package/cjs/i18n/uk.json +38 -20
  50. package/cjs/i18n/zh.json +30 -6
  51. package/cjs/index.d.ts +3 -1
  52. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  53. package/cjs/pages/MainPage/MainSwapButton.js +4 -4
  54. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  55. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  56. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  57. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
  58. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  59. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  60. package/cjs/pages/SettingsPage/LanguageSelect.js +3 -2
  61. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -0
  62. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  63. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +4 -2
  64. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -0
  65. package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -0
  66. package/cjs/pages/SwapPage/StartSwapButton.js +11 -0
  67. package/cjs/pages/SwapPage/SwapPage.js +2 -4
  68. package/cjs/stores/routes/useRouteExecutionStore.js +13 -1
  69. package/cjs/stores/settings/index.d.ts +1 -0
  70. package/cjs/stores/settings/index.js +1 -0
  71. package/cjs/stores/settings/types.d.ts +8 -0
  72. package/cjs/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
  73. package/cjs/stores/settings/useSendToWalletStore.js +16 -0
  74. package/cjs/types/widget.d.ts +31 -8
  75. package/cjs/types/widget.js +10 -3
  76. package/components/ActiveSwaps/ActiveSwapItem.js +1 -1
  77. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  78. package/components/Card/Card.d.ts +1 -1
  79. package/components/ChainSelect/ChainSelect.d.ts +1 -0
  80. package/components/ChainSelect/ChainSelect.style.d.ts +1 -1
  81. package/components/Header/Header.style.d.ts +2 -2
  82. package/components/Header/WalletHeader.js +1 -1
  83. package/components/Menu.js +1 -1
  84. package/components/PoweredBy/PoweredBy.js +5 -2
  85. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  86. package/components/SelectTokenButton/SelectTokenButton.js +2 -2
  87. package/components/SendToWallet/SendToWallet.js +21 -7
  88. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  89. package/components/SendToWallet/SendToWallet.style.js +6 -0
  90. package/components/SendToWallet/SendToWalletButton.js +7 -8
  91. package/components/SmallAvatar.d.ts +20 -0
  92. package/components/SmallAvatar.js +14 -1
  93. package/components/Step/CircularProgress.d.ts +1 -0
  94. package/components/Step/StepList.d.ts +1 -0
  95. package/components/Step/StepProcess.style.d.ts +1 -1
  96. package/components/SwapButton/SwapButton.d.ts +1 -1
  97. package/components/SwapButton/SwapButton.js +3 -6
  98. package/components/SwapButton/index.d.ts +1 -0
  99. package/components/SwapButton/index.js +1 -0
  100. package/components/SwapButton/types.d.ts +1 -2
  101. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  102. package/components/SwapInput/SwapInput.style.js +1 -0
  103. package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  104. package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -0
  105. package/components/SwapInput/SwapInputStartAdornment.js +2 -2
  106. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  107. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
  108. package/components/Token/Token.d.ts +3 -0
  109. package/components/Token/Token.js +13 -1
  110. package/components/TokenAvatar/TokenAvatar.d.ts +2 -1
  111. package/components/TokenAvatar/TokenAvatar.js +9 -9
  112. package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  113. package/components/TokenAvatar/TokenAvatar.style.js +2 -2
  114. package/config/theme.js +2 -2
  115. package/config/version.d.ts +1 -1
  116. package/config/version.js +1 -1
  117. package/hooks/useRouteExecution.js +1 -1
  118. package/i18n/de.json +30 -6
  119. package/i18n/fr.json +30 -6
  120. package/i18n/it.json +30 -6
  121. package/i18n/uk.json +38 -20
  122. package/i18n/zh.json +30 -6
  123. package/index.d.ts +3 -1
  124. package/package.json +12 -12
  125. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  126. package/pages/MainPage/MainSwapButton.js +3 -4
  127. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  128. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  129. package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  130. package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
  131. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  132. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  133. package/pages/SettingsPage/LanguageSelect.js +3 -2
  134. package/pages/SettingsPage/SettingsPage.d.ts +1 -0
  135. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  136. package/pages/SettingsPage/ShowDestinationWallet.js +6 -4
  137. package/pages/SettingsPage/SlippageInput.d.ts +1 -0
  138. package/pages/SwapPage/StartSwapButton.d.ts +3 -0
  139. package/pages/SwapPage/StartSwapButton.js +7 -0
  140. package/pages/SwapPage/SwapPage.js +2 -4
  141. package/stores/routes/useRouteExecutionStore.js +13 -1
  142. package/stores/settings/index.d.ts +1 -0
  143. package/stores/settings/index.js +1 -0
  144. package/stores/settings/types.d.ts +8 -0
  145. package/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
  146. package/stores/settings/useSendToWalletStore.js +13 -0
  147. package/tsconfig.cjs.tsbuildinfo +1 -1
  148. package/types/widget.d.ts +31 -8
  149. package/types/widget.js +9 -2
  150. package/cjs/components/SendToWallet/store.js +0 -12
  151. package/cjs/components/SendToWallet/types.d.ts +0 -6
  152. package/cjs/components/SendToWallet/types.js +0 -2
  153. package/components/SendToWallet/store.js +0 -9
  154. package/components/SendToWallet/types.d.ts +0 -6
  155. package/components/SendToWallet/types.js +0 -1
@@ -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" | "primary" | "secondary" | "info" | undefined;
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?: "primary" | "secondary" | undefined;
21
+ selectionColor?: "secondary" | "primary" | undefined;
22
22
  dense?: boolean | undefined;
23
23
  indented?: boolean | undefined;
24
24
  onClick?: MouseEventHandler<HTMLDivElement> | undefined;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { SwapFormTypeProps } from '../../providers';
2
3
  export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -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?: "primary" | "secondary" | undefined;
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" | "primary" | "secondary" | undefined;
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" | "primary" | "secondary" | "info" | undefined;
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;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
- import { ContentCopy as ContentCopyIcon, ExpandMore as ExpandMoreIcon, PowerSettingsNewRounded as PowerSettingsIcon, WalletOutlined as WalletOutlinedIcon } from '@mui/icons-material';
11
+ import { ContentCopy as ContentCopyIcon, ExpandMore as ExpandMoreIcon, PowerSettingsNewRounded as PowerSettingsIcon, WalletOutlined as WalletOutlinedIcon, } from '@mui/icons-material';
12
12
  import { Avatar, MenuItem } from '@mui/material';
13
13
  import { useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
@@ -5,7 +5,7 @@ import { styled } from '@mui/material/styles';
5
5
  import { svgIconClasses } from '@mui/material/SvgIcon';
6
6
  export const Menu = styled(MuiMenu)(({ theme }) => ({
7
7
  [`& .${menuClasses.paper}`]: {
8
- borderRadius: theme.shape.borderRadiusSecondary,
8
+ borderRadius: theme.shape.borderRadius,
9
9
  color: theme.palette.text.primary,
10
10
  [`& .${menuClasses.list}`]: {
11
11
  padding: theme.spacing(0.5, 0),
@@ -2,18 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Tooltip, Typography } from '@mui/material';
3
3
  import { useLocation } from 'react-router-dom';
4
4
  import { version } from '../../config/version';
5
+ import { useWidgetConfig } from '../../providers';
6
+ import { HiddenUI } from '../../types';
5
7
  import { navigationRoutes } from '../../utils';
6
8
  import { LiFiLogo } from '../LiFiLogo';
7
9
  import { Link } from './PoweredBy.style';
8
10
  export const PoweredBy = () => {
11
+ const { hiddenUI } = useWidgetConfig();
9
12
  const { pathname } = useLocation();
10
13
  if (pathname.includes(navigationRoutes.fromToken) ||
11
14
  pathname.includes(navigationRoutes.toToken)) {
12
15
  return null;
13
16
  }
14
- return (_jsx(Box, Object.assign({ px: 3, pt: 2, pb: 2, sx: {
17
+ return (_jsx(Box, Object.assign({ px: 3, py: (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.PoweredBy)) ? 1 : 2, sx: {
15
18
  display: 'flex',
16
19
  alignItems: 'flex-end',
17
20
  justifyContent: 'flex-end',
18
- } }, { children: _jsx(Tooltip, Object.assign({ title: `v${version}`, placement: "top", enterDelay: 3000, arrow: true }, { children: _jsxs(Link, Object.assign({ href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [_jsx(Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), _jsx(LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) })) })));
21
+ } }, { children: !(hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.PoweredBy)) ? (_jsx(Tooltip, Object.assign({ title: `v${version}`, placement: "top", enterDelay: 3000, arrow: true }, { children: _jsxs(Link, Object.assign({ href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary" }, { children: [_jsx(Typography, Object.assign({ color: "text.secondary", fontSize: 12, px: 0.5 }, { children: "Powered by" })), _jsx(LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] })) }))) : null })));
19
22
  };
@@ -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" | "primary" | "secondary" | "info" | undefined;
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;
@@ -7,7 +7,7 @@ import { useChain, useToken } from '../../hooks';
7
7
  import { SwapFormKeyHelper, useWidgetConfig } from '../../providers';
8
8
  import { navigationRoutes } from '../../utils';
9
9
  import { Card, CardTitle } from '../Card';
10
- import { TokenAvatar, TokenAvatarSkeleton } from '../TokenAvatar';
10
+ import { TokenAvatar, TokenAvatarDefault } from '../TokenAvatar';
11
11
  import { SelectTokenCardHeader } from './SelectTokenButton.style';
12
12
  export const SelectTokenButton = ({ formType, compact }) => {
13
13
  const { t } = useTranslation();
@@ -31,5 +31,5 @@ export const SelectTokenButton = ({ formType, compact }) => {
31
31
  const defaultTitle = formType === 'to' && variant === 'refuel'
32
32
  ? t(`header.selectChain`)
33
33
  : t(`swap.selectChainAndToken`);
34
- return (_jsxs(Card, Object.assign({ flex: 1, onClick: onClick }, { children: [_jsx(CardTitle, { children: t(`swap.${formType}`) }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? (_jsx(SelectTokenCardHeader, { avatar: _jsx(Skeleton, { variant: "circular", width: 32, height: 32 }), title: _jsx(Skeleton, { variant: "text", width: 64, height: 24 }), subheader: _jsx(Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : (_jsx(SelectTokenCardHeader, { avatar: isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain })) : (_jsx(TokenAvatarSkeleton, {})), title: isSelected ? token.symbol : defaultTitle, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
34
+ return (_jsxs(Card, Object.assign({ flex: 1, onClick: onClick }, { children: [_jsx(CardTitle, { children: t(`swap.${formType}`) }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? (_jsx(SelectTokenCardHeader, { avatar: _jsx(Skeleton, { variant: "circular", width: 32, height: 32 }), title: _jsx(Skeleton, { variant: "text", width: 64, height: 24 }), subheader: _jsx(Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : (_jsx(SelectTokenCardHeader, { avatar: isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain })) : (_jsx(TokenAvatarDefault, {})), title: isSelected ? token.symbol : defaultTitle, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] })));
35
35
  };
@@ -14,20 +14,34 @@ import { forwardRef, useEffect } from 'react';
14
14
  import { useFormContext, useFormState } from 'react-hook-form';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { SwapFormKey, useWallet, useWidgetConfig } from '../../providers';
17
- import { DisabledUI } from '../../types';
17
+ import { useSendToWalletStore, useSettings } from '../../stores';
18
+ import { DisabledUI, HiddenUI } from '../../types';
18
19
  import { Card, CardTitle } from '../Card';
19
20
  import { FormControl, Input } from './SendToWallet.style';
20
- import { useSendToWalletStore } from './store';
21
21
  export const SendToWallet = forwardRef((props, ref) => {
22
22
  const { t } = useTranslation();
23
- const { disabledUI } = useWidgetConfig();
24
- const showSendToWallet = useSendToWalletStore((state) => state.showSendToWallet);
25
- const { account, provider } = useWallet();
26
23
  const { register, trigger } = useFormContext();
24
+ const { account, provider } = useWallet();
25
+ const { disabledUI, hiddenUI, toAddress } = useWidgetConfig();
26
+ const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = useSendToWalletStore();
27
+ const { showDestinationWallet } = useSettings(['showDestinationWallet']);
27
28
  useEffect(() => {
28
29
  trigger(SwapFormKey.ToAddress);
29
30
  }, [account.chainId, trigger]);
30
- if (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress)) {
31
+ const hiddenToAddress = hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.ToAddress);
32
+ const disabledToAddress = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress);
33
+ // We want to show toAddress field if it is set via widget configuration, disabled for changes, but not hidden
34
+ const showInstantly = Boolean(!showSendToWalletDirty &&
35
+ toAddress &&
36
+ disabledToAddress &&
37
+ showDestinationWallet &&
38
+ !hiddenToAddress);
39
+ useEffect(() => {
40
+ if (showInstantly) {
41
+ setSendToWallet(true);
42
+ }
43
+ }, [showInstantly, setSendToWallet]);
44
+ if (hiddenToAddress) {
31
45
  return null;
32
46
  }
33
47
  const { onChange, onBlur, name, ref: inputRef, } = register(SwapFormKey.ToAddress, {
@@ -46,7 +60,7 @@ export const SendToWallet = forwardRef((props, ref) => {
46
60
  }),
47
61
  onBlur: () => trigger(SwapFormKey.ToAddress),
48
62
  });
49
- return (_jsx(Collapse, Object.assign({ timeout: 225, in: showSendToWallet, mountOnEnter: true, unmountOnExit: true }, { children: _jsxs(Card, Object.assign({}, props, { ref: ref }, { children: [_jsx(CardTitle, { children: t('swap.sendToWallet') }), _jsxs(FormControl, Object.assign({ fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' } }, { children: [_jsx(Input, { ref: inputRef, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), _jsx(SendToWalletFormHelperText, {})] }))] })) })));
63
+ return (_jsx(Collapse, Object.assign({ timeout: showInstantly ? 0 : 225, in: showSendToWallet || showInstantly, mountOnEnter: true, unmountOnExit: true }, { children: _jsxs(Card, Object.assign({}, props, { ref: ref }, { children: [_jsx(CardTitle, { children: t('swap.sendToWallet') }), _jsxs(FormControl, Object.assign({ fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' } }, { children: [_jsx(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) }), _jsx(SendToWalletFormHelperText, {})] }))] })) })));
50
64
  });
51
65
  export const SendToWalletFormHelperText = () => {
52
66
  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" | "primary" | "secondary" | "info" | undefined;
5
+ color?: "success" | "warning" | "error" | "secondary" | "primary" | "info" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  error?: boolean | undefined;
8
8
  fullWidth?: boolean | undefined;
@@ -9,4 +9,10 @@ export const Input = styled(InputBase)(({ theme }) => ({
9
9
  height: 32,
10
10
  padding: theme.spacing(0, 0, 0, 2),
11
11
  },
12
+ [`&.${inputBaseClasses.disabled}`]: {
13
+ color: 'inherit',
14
+ },
15
+ [`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: {
16
+ WebkitTextFillColor: 'unset',
17
+ },
12
18
  }));
@@ -4,23 +4,22 @@ import { Button, Tooltip } from '@mui/material';
4
4
  import { useFormContext } from 'react-hook-form';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { SwapFormKey, useWallet, useWidgetConfig } from '../../providers';
7
- import { useSettings } from '../../stores';
8
- import { DisabledUI } from '../../types';
9
- import { useSendToWalletStore } from './store';
7
+ import { useSendToWalletStore, useSettings } from '../../stores';
8
+ import { DisabledUI, HiddenUI } from '../../types';
10
9
  export const SendToWalletButton = () => {
11
10
  const { t } = useTranslation();
12
- const { disabledUI } = useWidgetConfig();
13
- const { account } = useWallet();
14
11
  const { setValue } = useFormContext();
15
- const { showDestinationWallet } = useSettings(['showDestinationWallet']);
12
+ const { account } = useWallet();
13
+ const { disabledUI, hiddenUI } = useWidgetConfig();
16
14
  const { showSendToWallet, toggleSendToWallet } = useSendToWalletStore();
15
+ const { showDestinationWallet } = useSettings(['showDestinationWallet']);
17
16
  if (!showDestinationWallet ||
18
17
  !account.isActive ||
19
- (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress))) {
18
+ (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.ToAddress))) {
20
19
  return null;
21
20
  }
22
21
  const handleClick = () => {
23
- if (showSendToWallet) {
22
+ if (showSendToWallet && !(disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress))) {
24
23
  setValue(SwapFormKey.ToAddress, '', { shouldTouch: true });
25
24
  }
26
25
  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,4 +1,5 @@
1
- import { Avatar } from '@mui/material';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Avatar, Box, Skeleton } from '@mui/material';
2
3
  import { styled } from '@mui/material/styles';
3
4
  export const SmallAvatar = styled(Avatar)(({ theme }) => ({
4
5
  background: theme.palette.background.paper,
@@ -6,3 +7,15 @@ export const SmallAvatar = styled(Avatar)(({ theme }) => ({
6
7
  height: 16,
7
8
  border: `2px solid ${theme.palette.background.paper}`,
8
9
  }));
10
+ export const SmallAvatarSkeletonBase = styled(Skeleton)(({ theme }) => ({
11
+ border: `2px solid ${theme.palette.background.paper}`,
12
+ width: 16,
13
+ height: 16,
14
+ }));
15
+ export const SmallAvatarSkeletonContainer = styled(Box)(({ theme }) => ({
16
+ background: theme.palette.background.paper,
17
+ borderRadius: '50%',
18
+ }));
19
+ export const SmallAvatarSkeleton = () => {
20
+ return (_jsx(SmallAvatarSkeletonContainer, { children: _jsx(SmallAvatarSkeletonBase, { variant: "circular" }) }));
21
+ };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { Process } from '@lifi/sdk';
2
3
  export declare function CircularProgress({ process }: {
3
4
  process: Process;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { Route } from '@lifi/sdk';
2
3
  export declare const getStepList: (route?: Route) => JSX.Element[] | undefined;
@@ -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" | "primary" | "secondary" | "info" | undefined;
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: import("react").ForwardRefExoticComponent<SwapButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
+ export declare const SwapButton: React.FC<SwapButtonProps>;
@@ -9,18 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { LoadingButton } from '@mui/lab';
12
- import { forwardRef } from 'react';
13
12
  import { useTranslation } from 'react-i18next';
14
13
  import { useNavigate } from 'react-router-dom';
15
- import { useGasSufficiency } from '../../hooks';
16
14
  import { useWallet, useWidgetConfig } from '../../providers';
17
15
  import { navigationRoutes } from '../../utils';
18
- export const SwapButton = forwardRef(({ onClick, currentRoute, text, disable, enableLoading, loading }, ref) => {
16
+ export const SwapButton = ({ onClick, currentRoute, text, disabled, loading, }) => {
19
17
  const { t } = useTranslation();
20
18
  const navigate = useNavigate();
21
19
  const { variant, walletManagement } = useWidgetConfig();
22
20
  const { account, connect } = useWallet();
23
- const { insufficientFunds, insufficientGas, isLoading: isGasSufficiencyLoading, } = useGasSufficiency(currentRoute);
24
21
  const handleSwapButtonClick = () => __awaiter(void 0, void 0, void 0, function* () {
25
22
  if (!account.isActive) {
26
23
  if (walletManagement) {
@@ -48,5 +45,5 @@ export const SwapButton = forwardRef(({ onClick, currentRoute, text, disable, en
48
45
  }
49
46
  return t(`button.connectWallet`);
50
47
  };
51
- return (_jsx(LoadingButton, Object.assign({ variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: insufficientFunds || !!(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) || disable, loading: enableLoading && (loading || isGasSufficiencyLoading), loadingPosition: "center", fullWidth: true, ref: ref }, { children: getButtonText() })));
52
- });
48
+ return (_jsx(LoadingButton, Object.assign({ variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: disabled, loading: loading, loadingPosition: "center", fullWidth: true }, { children: getButtonText() })));
49
+ };
@@ -1 +1,2 @@
1
1
  export { SwapButton } from './SwapButton';
2
+ export * from './types';
@@ -1 +1,2 @@
1
1
  export { SwapButton } from './SwapButton';
2
+ export * from './types';
@@ -3,7 +3,6 @@ export interface SwapButtonProps {
3
3
  onClick?(): void;
4
4
  currentRoute?: Route;
5
5
  text?: string;
6
- disable?: boolean;
6
+ disabled?: boolean;
7
7
  loading?: boolean;
8
- enableLoading?: boolean;
9
8
  }
@@ -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" | "primary" | "secondary" | "info" | undefined;
7
+ color?: "success" | "warning" | "error" | "secondary" | "primary" | "info" | undefined;
8
8
  disabled?: boolean | undefined;
9
9
  error?: boolean | undefined;
10
10
  fullWidth?: boolean | undefined;
@@ -9,6 +9,7 @@ export const FormControl = styled(MuiFormControl)(({ theme }) => ({
9
9
  export const Input = styled(InputBase)(({ theme }) => ({
10
10
  fontSize: 24,
11
11
  fontWeight: 700,
12
+ boxShadow: 'none',
12
13
  // padding: theme.spacing(2, 2, 2, 0),
13
14
  [`.${inputBaseClasses.input}`]: {
14
15
  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" | "primary" | "secondary" | "info" | undefined;
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;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { SwapFormTypeProps } from '../../providers';
2
3
  export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useWatch } from 'react-hook-form';
3
3
  import { useChain, useToken } from '../../hooks';
4
4
  import { SwapFormKeyHelper } from '../../providers';
5
- import { TokenAvatar, TokenAvatarSkeleton } from '../TokenAvatar';
5
+ import { TokenAvatar, TokenAvatarDefault } from '../TokenAvatar';
6
6
  export const SwapInputStartAdornment = ({ formType, }) => {
7
7
  const [chainId, tokenAddress] = useWatch({
8
8
  name: [
@@ -13,5 +13,5 @@ export const SwapInputStartAdornment = ({ formType, }) => {
13
13
  const { chain } = useChain(chainId);
14
14
  const { token } = useToken(chainId, tokenAddress);
15
15
  const isSelected = !!(chain && token);
16
- return isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : (_jsx(TokenAvatarSkeleton, { sx: { marginLeft: 2 } }));
16
+ return isSelected ? (_jsx(TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : (_jsx(TokenAvatarDefault, { sx: { marginLeft: 2 } }));
17
17
  };
@@ -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" | "primary" | "secondary" | "info" | undefined;
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;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  export declare const SwapRoutesExpanded: () => JSX.Element;
2
3
  export declare const SwapRoutesExpandedElement: () => JSX.Element;
@@ -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 {};
@@ -12,14 +12,26 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Box } from '@mui/material';
14
14
  import { useTranslation } from 'react-i18next';
15
- import { useChain } from '../../hooks';
15
+ import { useChain, useToken } from '../../hooks';
16
16
  import { formatTokenAmount, formatTokenPrice } from '../../utils';
17
17
  import { SmallAvatar } from '../SmallAvatar';
18
18
  import { TextFitter } from '../TextFitter';
19
19
  import { TokenAvatar } from '../TokenAvatar';
20
20
  import { TextSecondary, TextSecondaryContainer } from './Token.style';
21
21
  export const Token = (_a) => {
22
+ var { token } = _a, other = __rest(_a, ["token"]);
23
+ if (!token.priceUSD || !token.logoURI) {
24
+ return _jsx(TokenFallback, Object.assign({ token: token }, other));
25
+ }
26
+ return _jsx(TokenBase, Object.assign({ token: token }, other));
27
+ };
28
+ export const TokenFallback = (_a) => {
22
29
  var { token, connected, step, disableDescription } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription"]);
30
+ const { token: chainToken, isLoading } = useToken(token.chainId, token.address);
31
+ return (_jsx(TokenBase, Object.assign({ token: Object.assign(Object.assign({}, token), chainToken), isLoading: isLoading }, other)));
32
+ };
33
+ export const TokenBase = (_a) => {
34
+ var { token, connected, step, disableDescription, isLoading } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription", "isLoading"]);
23
35
  const { t } = useTranslation();
24
36
  const { chain } = useChain(token.chainId);
25
37
  const formattedTokenAmount = formatTokenAmount(token.amount, token.decimals);
@@ -8,6 +8,7 @@ export declare const TokenAvatarFallback: React.FC<{
8
8
  export declare const TokenAvatarBase: React.FC<{
9
9
  token: Token;
10
10
  chain?: Chain;
11
+ isLoading?: boolean;
11
12
  sx?: SxProps<Theme>;
12
13
  }>;
13
14
  export declare const TokenAvatar: React.FC<{
@@ -15,6 +16,6 @@ export declare const TokenAvatar: React.FC<{
15
16
  chain?: Chain;
16
17
  sx?: SxProps<Theme>;
17
18
  }>;
18
- export declare const TokenAvatarSkeleton: React.FC<{
19
+ export declare const TokenAvatarDefault: React.FC<{
19
20
  sx?: SxProps<Theme>;
20
21
  }>;
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Avatar, Badge } from '@mui/material';
2
+ import { Avatar, Badge, Skeleton } from '@mui/material';
3
3
  import { useChain, useToken } from '../../hooks';
4
- import { SmallAvatar } from '../SmallAvatar';
5
- import { AvatarSkeleton, AvatarSkeletonContainer } from './TokenAvatar.style';
4
+ import { SmallAvatar, SmallAvatarSkeleton } from '../SmallAvatar';
5
+ import { AvatarDefault, AvatarDefaultContainer } from './TokenAvatar.style';
6
6
  export const TokenAvatarFallback = ({ token, sx }) => {
7
7
  const { chain } = useChain(token.chainId);
8
- const { token: chainToken } = useToken(token.chainId, token.address);
9
- return _jsx(TokenAvatarBase, { token: chainToken !== null && chainToken !== void 0 ? chainToken : token, chain: chain, sx: sx });
8
+ const { token: chainToken, isLoading } = useToken(token.chainId, token.address);
9
+ return (_jsx(TokenAvatarBase, { token: chainToken !== null && chainToken !== void 0 ? chainToken : token, isLoading: isLoading, chain: chain, sx: sx }));
10
10
  };
11
- export const TokenAvatarBase = ({ token, chain, sx }) => {
12
- return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain ? (_jsx(SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : null, sx: sx }, { children: _jsx(Avatar, Object.assign({ src: token.logoURI, alt: token.symbol }, { children: token.symbol[0] })) })));
11
+ export const TokenAvatarBase = ({ token, chain, isLoading, sx }) => {
12
+ return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain ? (_jsx(SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : (_jsx(SmallAvatarSkeleton, {})), sx: sx }, { children: isLoading ? (_jsx(Skeleton, { width: 32, height: 32, variant: "circular" })) : (_jsx(Avatar, Object.assign({ src: token.logoURI, alt: token.symbol }, { children: token.symbol[0] }))) })));
13
13
  };
14
14
  export const TokenAvatar = ({ token, chain, sx }) => {
15
15
  if (!chain || !token.logoURI) {
@@ -17,6 +17,6 @@ export const TokenAvatar = ({ token, chain, sx }) => {
17
17
  }
18
18
  return _jsx(TokenAvatarBase, { token: token, chain: chain, sx: sx });
19
19
  };
20
- export const TokenAvatarSkeleton = ({ sx }) => {
21
- return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(AvatarSkeleton, { width: 16, height: 16 }), sx: sx }, { children: _jsx(AvatarSkeletonContainer, { children: _jsx(AvatarSkeleton, { width: 28, height: 28 }) }) })));
20
+ export const TokenAvatarDefault = ({ sx }) => {
21
+ return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(AvatarDefault, { width: 16, height: 16 }), sx: sx }, { children: _jsx(AvatarDefaultContainer, { children: _jsx(AvatarDefault, { width: 28, height: 28 }) }) })));
22
22
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const TokenAvatarGroup: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
3
- export declare const AvatarSkeleton: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
+ export declare const AvatarDefault: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
4
4
  children?: import("react").ReactNode;
5
5
  component?: import("react").ElementType<any> | undefined;
6
6
  ref?: import("react").Ref<unknown> | undefined;
@@ -8,7 +8,7 @@ export declare const AvatarSkeleton: import("@emotion/styled").StyledComponent<i
8
8
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
9
9
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
10
10
  }, 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>, {}, {}>;
11
- export declare const AvatarSkeletonContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
11
+ export declare const AvatarDefaultContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
12
12
  children?: import("react").ReactNode;
13
13
  component?: import("react").ElementType<any> | undefined;
14
14
  ref?: import("react").Ref<unknown> | undefined;
@@ -11,14 +11,14 @@ export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
11
11
  marginLeft: theme.spacing(1),
12
12
  },
13
13
  }));
14
- export const AvatarSkeleton = styled(Box)(({ theme }) => ({
14
+ export const AvatarDefault = styled(Box)(({ theme }) => ({
15
15
  background: theme.palette.mode === 'light'
16
16
  ? theme.palette.grey[300]
17
17
  : theme.palette.grey[800],
18
18
  border: `2px solid ${theme.palette.background.paper}`,
19
19
  borderRadius: '50%',
20
20
  }));
21
- export const AvatarSkeletonContainer = styled(Box)(({ theme }) => ({
21
+ export const AvatarDefaultContainer = styled(Box)(({ theme }) => ({
22
22
  border: `2px solid ${theme.palette.mode === 'light'
23
23
  ? theme.palette.grey[300]
24
24
  : theme.palette.grey[800]}`,
package/config/theme.js CHANGED
@@ -51,7 +51,7 @@ export const createTheme = (mode, theme = {}) => {
51
51
  : common.black;
52
52
  return createMuiTheme({
53
53
  typography: Object.assign({ fontFamily: 'Inter var, Inter, sans-serif' }, theme.typography),
54
- palette: Object.assign(Object.assign(Object.assign({ mode }, palette), { primary: {
54
+ palette: Object.assign(Object.assign(Object.assign(Object.assign({ mode }, palette), (mode === 'light' ? paletteLight : paletteDark)), theme.palette), { primary: {
55
55
  main: primaryMainColor,
56
56
  light: primaryLightColor,
57
57
  dark: primaryDarkColor,
@@ -59,7 +59,7 @@ export const createTheme = (mode, theme = {}) => {
59
59
  main: (_m = (_l = (_k = theme.palette) === null || _k === void 0 ? void 0 : _k.secondary) === null || _l === void 0 ? void 0 : _l.main) !== null && _m !== void 0 ? _m : palette.secondary.main,
60
60
  light: lighten((_q = (_p = (_o = theme.palette) === null || _o === void 0 ? void 0 : _o.secondary) === null || _p === void 0 ? void 0 : _p.main) !== null && _q !== void 0 ? _q : palette.secondary.main, 0.5),
61
61
  dark: darken((_t = (_s = (_r = theme.palette) === null || _r === void 0 ? void 0 : _r.secondary) === null || _s === void 0 ? void 0 : _s.main) !== null && _t !== void 0 ? _t : palette.secondary.main, 0.2),
62
- } }), (mode === 'light' ? paletteLight : paletteDark)),
62
+ } }),
63
63
  shape: Object.assign(Object.assign({}, shape), theme.shape),
64
64
  breakpoints: {
65
65
  values: {
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.26.5";
2
+ export declare const version = "1.27.0";