@lifi/widget 2.4.3 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AppDrawer.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CloseIcon from '@mui/icons-material/CloseRounded';
2
3
  import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft';
3
4
  import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
4
5
  import { Drawer } from '@mui/material';
5
6
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState, } from 'react';
6
7
  import { useTranslation } from 'react-i18next';
7
8
  import { AppDefault } from './App';
8
- import { DrawerButton, DrawerButtonTypography } from './AppDrawer.style';
9
+ import { CloseButtonLayout, DrawerButton, DrawerButtonTypography, } from './AppDrawer.style';
9
10
  import { AppProvider } from './AppProvider';
10
11
  import { HiddenUI } from './types';
11
12
  export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, ref) => {
@@ -34,7 +35,7 @@ export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, r
34
35
  height: '100%',
35
36
  },
36
37
  }), [config, integrator]);
37
- return (_jsxs(AppProvider, { config: widgetConfig, children: [!widgetConfig.hiddenUI?.includes(HiddenUI.DrawerButton) ? (_jsxs(DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? (_jsx(KeyboardArrowRightIcon, {})) : (_jsx(KeyboardArrowLeftIcon, {})), _jsx(DrawerButtonText, { open: drawerOpen, subvariant: config?.subvariant })] })) : null, _jsx(Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
38
+ return (_jsxs(AppProvider, { config: widgetConfig, children: [!widgetConfig.hiddenUI?.includes(HiddenUI.DrawerButton) ? (_jsxs(DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? (_jsx(KeyboardArrowRightIcon, {})) : (_jsx(KeyboardArrowLeftIcon, {})), _jsx(DrawerButtonText, { open: drawerOpen, subvariant: config?.subvariant })] })) : null, _jsxs(Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
38
39
  sx: {
39
40
  backgroundColor: 'rgb(0 0 0 / 48%)',
40
41
  backdropFilter: 'blur(3px)',
@@ -45,7 +46,7 @@ export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, r
45
46
  minWidth: config?.containerStyle?.minWidth ?? 375,
46
47
  maxWidth: config?.containerStyle?.maxWidth ?? 392,
47
48
  },
48
- }, keepMounted: true, children: _jsx(AppDefault, {}) })] }));
49
+ }, keepMounted: true, children: [_jsx(CloseButtonLayout, { onClick: closeDrawer, edge: "end", children: _jsx(CloseIcon, {}) }), _jsx(AppDefault, {})] })] }));
49
50
  });
50
51
  export const DrawerButtonText = ({ open, subvariant, }) => {
51
52
  const { t } = useTranslation();
@@ -51,3 +51,31 @@ export declare const DrawerButtonTypography: import("@emotion/styled").StyledCom
51
51
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
52
52
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
53
53
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
54
+ export declare const CloseButtonLayout: import("@emotion/styled").StyledComponent<{
55
+ children?: import("react").ReactNode;
56
+ classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
57
+ color?: import("@mui/types").OverridableStringUnion<"inherit" | "default" | "primary" | "secondary" | "error" | "warning" | "info" | "success", import("@mui/material").IconButtonPropsColorOverrides> | undefined;
58
+ disabled?: boolean | undefined;
59
+ disableFocusRipple?: boolean | undefined;
60
+ edge?: false | "end" | "start" | undefined;
61
+ size?: import("@mui/types").OverridableStringUnion<"small" | "large" | "medium", import("@mui/material").IconButtonPropsSizeOverrides> | undefined;
62
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
63
+ } & Omit<{
64
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
65
+ centerRipple?: boolean | undefined;
66
+ children?: import("react").ReactNode;
67
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
68
+ disabled?: boolean | undefined;
69
+ disableRipple?: boolean | undefined;
70
+ disableTouchRipple?: boolean | undefined;
71
+ focusRipple?: boolean | undefined;
72
+ focusVisibleClassName?: string | undefined;
73
+ LinkComponent?: import("react").ElementType<any> | undefined;
74
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
75
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
76
+ tabIndex?: number | undefined;
77
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
78
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
79
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
80
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
81
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,4 +1,4 @@
1
- import { Button, Typography } from '@mui/material';
1
+ import { Button, IconButton, Typography } from '@mui/material';
2
2
  import { styled } from '@mui/material/styles';
3
3
  const getButtonTransformWidth = (drawerWidth, drawerMaxWidth) => {
4
4
  if (typeof drawerWidth === 'number') {
@@ -75,3 +75,13 @@ export const DrawerButtonTypography = styled(Typography)(({ theme }) => ({
75
75
  transform: 'rotateZ(180deg)',
76
76
  writingMode: 'vertical-rl',
77
77
  }));
78
+ export const CloseButtonLayout = styled(IconButton)(() => ({
79
+ position: 'absolute',
80
+ top: '12px',
81
+ right: '26px',
82
+ zIndex: 1,
83
+ height: '40px',
84
+ width: '40px',
85
+ alignItems: 'center',
86
+ justifyContent: 'center',
87
+ }));
package/cjs/AppDrawer.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DrawerButtonText = exports.AppDrawer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const CloseRounded_1 = require("@mui/icons-material/CloseRounded");
5
6
  const KeyboardArrowLeft_1 = require("@mui/icons-material/KeyboardArrowLeft");
6
7
  const KeyboardArrowRight_1 = require("@mui/icons-material/KeyboardArrowRight");
7
8
  const material_1 = require("@mui/material");
@@ -37,7 +38,7 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, integrator, con
37
38
  height: '100%',
38
39
  },
39
40
  }), [config, integrator]);
40
- return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, { config: widgetConfig, children: [!widgetConfig.hiddenUI?.includes(types_1.HiddenUI.DrawerButton) ? ((0, jsx_runtime_1.jsxs)(AppDrawer_style_1.DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? ((0, jsx_runtime_1.jsx)(KeyboardArrowRight_1.default, {})) : ((0, jsx_runtime_1.jsx)(KeyboardArrowLeft_1.default, {})), (0, jsx_runtime_1.jsx)(exports.DrawerButtonText, { open: drawerOpen, subvariant: config?.subvariant })] })) : null, (0, jsx_runtime_1.jsx)(material_1.Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
41
+ return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, { config: widgetConfig, children: [!widgetConfig.hiddenUI?.includes(types_1.HiddenUI.DrawerButton) ? ((0, jsx_runtime_1.jsxs)(AppDrawer_style_1.DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? ((0, jsx_runtime_1.jsx)(KeyboardArrowRight_1.default, {})) : ((0, jsx_runtime_1.jsx)(KeyboardArrowLeft_1.default, {})), (0, jsx_runtime_1.jsx)(exports.DrawerButtonText, { open: drawerOpen, subvariant: config?.subvariant })] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
41
42
  sx: {
42
43
  backgroundColor: 'rgb(0 0 0 / 48%)',
43
44
  backdropFilter: 'blur(3px)',
@@ -48,7 +49,7 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, integrator, con
48
49
  minWidth: config?.containerStyle?.minWidth ?? 375,
49
50
  maxWidth: config?.containerStyle?.maxWidth ?? 392,
50
51
  },
51
- }, keepMounted: true, children: (0, jsx_runtime_1.jsx)(App_1.AppDefault, {}) })] }));
52
+ }, keepMounted: true, children: [(0, jsx_runtime_1.jsx)(AppDrawer_style_1.CloseButtonLayout, { onClick: closeDrawer, edge: "end", children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, {}) }), (0, jsx_runtime_1.jsx)(App_1.AppDefault, {})] })] }));
52
53
  });
53
54
  const DrawerButtonText = ({ open, subvariant, }) => {
54
55
  const { t } = (0, react_i18next_1.useTranslation)();
@@ -51,3 +51,31 @@ export declare const DrawerButtonTypography: import("@emotion/styled").StyledCom
51
51
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
52
52
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
53
53
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
54
+ export declare const CloseButtonLayout: import("@emotion/styled").StyledComponent<{
55
+ children?: import("react").ReactNode;
56
+ classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
57
+ color?: import("@mui/types").OverridableStringUnion<"inherit" | "default" | "primary" | "secondary" | "error" | "warning" | "info" | "success", import("@mui/material").IconButtonPropsColorOverrides> | undefined;
58
+ disabled?: boolean | undefined;
59
+ disableFocusRipple?: boolean | undefined;
60
+ edge?: false | "end" | "start" | undefined;
61
+ size?: import("@mui/types").OverridableStringUnion<"small" | "large" | "medium", import("@mui/material").IconButtonPropsSizeOverrides> | undefined;
62
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
63
+ } & Omit<{
64
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
65
+ centerRipple?: boolean | undefined;
66
+ children?: import("react").ReactNode;
67
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
68
+ disabled?: boolean | undefined;
69
+ disableRipple?: boolean | undefined;
70
+ disableTouchRipple?: boolean | undefined;
71
+ focusRipple?: boolean | undefined;
72
+ focusVisibleClassName?: string | undefined;
73
+ LinkComponent?: import("react").ElementType<any> | undefined;
74
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
75
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
76
+ tabIndex?: number | undefined;
77
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
78
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
79
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
80
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
81
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DrawerButtonTypography = exports.DrawerButton = void 0;
3
+ exports.CloseButtonLayout = exports.DrawerButtonTypography = exports.DrawerButton = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  const getButtonTransformWidth = (drawerWidth, drawerMaxWidth) => {
@@ -78,3 +78,13 @@ exports.DrawerButtonTypography = (0, styles_1.styled)(material_1.Typography)(({
78
78
  transform: 'rotateZ(180deg)',
79
79
  writingMode: 'vertical-rl',
80
80
  }));
81
+ exports.CloseButtonLayout = (0, styles_1.styled)(material_1.IconButton)(() => ({
82
+ position: 'absolute',
83
+ top: '12px',
84
+ right: '26px',
85
+ zIndex: 1,
86
+ height: '40px',
87
+ width: '40px',
88
+ alignItems: 'center',
89
+ justifyContent: 'center',
90
+ }));
@@ -58,3 +58,11 @@ export declare const WalletButton: import("@emotion/styled").StyledComponent<{
58
58
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
59
59
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
60
60
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
61
+ export declare const DrawerWalletContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
62
+ children?: import("react").ReactNode;
63
+ component?: import("react").ElementType<any> | undefined;
64
+ ref?: import("react").Ref<unknown> | undefined;
65
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
66
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
67
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
68
+ }, "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>, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletButton = exports.Container = exports.HeaderAppBar = void 0;
3
+ exports.DrawerWalletContainer = exports.WalletButton = exports.Container = exports.HeaderAppBar = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const Button_1 = require("@mui/material/Button");
6
6
  const styles_1 = require("@mui/material/styles");
@@ -46,3 +46,11 @@ exports.WalletButton = (0, styles_1.styled)(material_1.Button)(({ theme }) => ({
46
46
  fontSize: '24px',
47
47
  },
48
48
  }));
49
+ exports.DrawerWalletContainer = (0, styles_1.styled)(material_1.Box)(() => ({
50
+ width: '100%',
51
+ display: 'flex',
52
+ justifyItems: 'start',
53
+ '& > button': {
54
+ marginLeft: '-0.5rem',
55
+ },
56
+ }));
@@ -18,7 +18,7 @@ const NavigationTabs_1 = require("./NavigationTabs");
18
18
  const WalletHeader_1 = require("./WalletHeader");
19
19
  const NavigationHeader = () => {
20
20
  const { t } = (0, react_i18next_1.useTranslation)();
21
- const { subvariant, hiddenUI } = (0, providers_1.useWidgetConfig)();
21
+ const { subvariant, hiddenUI, variant } = (0, providers_1.useWidgetConfig)();
22
22
  const { navigate, navigateBack } = (0, hooks_1.useNavigateBack)();
23
23
  const { account } = (0, providers_1.useWallet)();
24
24
  const { element, title } = (0, stores_1.useHeaderStore)((state) => state);
@@ -81,7 +81,7 @@ const NavigationHeader = () => {
81
81
  }
82
82
  }
83
83
  };
84
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, { elevation: 0, children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: (0, jsx_runtime_1.jsx)(ArrowBack_1.default, {}) })) : null, splitSubvariant ? ((0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1, children: !hiddenUI?.includes(types_1.HiddenUI.WalletMenu) ? ((0, jsx_runtime_1.jsx)(WalletHeader_1.WalletMenuButton, {})) : null })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive && !hiddenUI?.includes(types_1.HiddenUI.History) ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.transactionHistory`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.transactionHistory), children: (0, jsx_runtime_1.jsx)(ReceiptLong_1.default, {}) }) })) : null, (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: () => navigate(utils_1.navigationRoutes.settings), sx: {
84
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, { elevation: 0, children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: (0, jsx_runtime_1.jsx)(ArrowBack_1.default, {}) })) : null, splitSubvariant ? ((0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1, children: !hiddenUI?.includes(types_1.HiddenUI.WalletMenu) ? ((0, jsx_runtime_1.jsx)(WalletHeader_1.WalletMenuButton, {})) : null })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(material_1.Box, { paddingRight: variant === 'drawer' && subvariant === 'split' ? 5 : 0, children: [account.isActive && !hiddenUI?.includes(types_1.HiddenUI.History) ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.transactionHistory`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.transactionHistory), children: (0, jsx_runtime_1.jsx)(ReceiptLong_1.default, {}) }) })) : null, (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: () => navigate(utils_1.navigationRoutes.settings), sx: {
85
85
  marginRight: -1.25,
86
86
  }, children: (0, jsx_runtime_1.jsx)(Settings_1.default, {}) }) })] }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: "*", element: element || (0, jsx_runtime_1.jsx)(material_1.Box, { width: 28, height: 40 }) })] })] }), splitSubvariant ? (0, jsx_runtime_1.jsx)(NavigationTabs_1.NavigationTabs, {}) : null] }));
87
87
  };
@@ -22,13 +22,17 @@ const WalletHeader = () => {
22
22
  exports.WalletHeader = WalletHeader;
23
23
  const WalletMenuButton = () => {
24
24
  const { account } = (0, providers_1.useWallet)();
25
+ const { variant } = (0, providers_1.useWidgetConfig)();
26
+ if (variant === 'drawer') {
27
+ return ((0, jsx_runtime_1.jsx)(Header_style_1.DrawerWalletContainer, { children: account.isActive ? (0, jsx_runtime_1.jsx)(ConnectedButton, {}) : (0, jsx_runtime_1.jsx)(ConnectButton, {}) }));
28
+ }
25
29
  return account.isActive ? (0, jsx_runtime_1.jsx)(ConnectedButton, {}) : (0, jsx_runtime_1.jsx)(ConnectButton, {});
26
30
  };
27
31
  exports.WalletMenuButton = WalletMenuButton;
28
32
  const ConnectButton = () => {
29
33
  const { t } = (0, react_i18next_1.useTranslation)();
30
34
  const { pathname } = (0, react_router_dom_1.useLocation)();
31
- const { walletManagement, subvariant } = (0, providers_1.useWidgetConfig)();
35
+ const { walletManagement, subvariant, variant } = (0, providers_1.useWidgetConfig)();
32
36
  const { connect: connectWallet } = (0, providers_1.useWallet)();
33
37
  const navigate = (0, react_router_dom_1.useNavigate)();
34
38
  const connect = async () => {
@@ -38,7 +42,7 @@ const ConnectButton = () => {
38
42
  }
39
43
  navigate(utils_1.navigationRoutes.selectWallet);
40
44
  };
41
- return ((0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: subvariant !== 'split' ? (0, jsx_runtime_1.jsx)(Wallet_1.default, {}) : undefined, startIcon: subvariant === 'split' ? (0, jsx_runtime_1.jsx)(Wallet_1.default, {}) : undefined, onClick: !pathname.includes(utils_1.navigationRoutes.selectWallet) ? connect : undefined, sx: {
45
+ return ((0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: variant !== 'drawer' && subvariant !== 'split' ? ((0, jsx_runtime_1.jsx)(Wallet_1.default, {})) : undefined, startIcon: variant === 'drawer' || subvariant === 'split' ? ((0, jsx_runtime_1.jsx)(Wallet_1.default, { sx: { marginLeft: -0.25 } })) : undefined, onClick: !pathname.includes(utils_1.navigationRoutes.selectWallet) ? connect : undefined, sx: {
42
46
  marginRight: subvariant === 'split' ? 0 : -1.25,
43
47
  marginLeft: subvariant === 'split' ? -1.25 : 0,
44
48
  }, children: t(`button.connectWallet`) }));
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.4.3";
2
+ export declare const version = "2.4.4";
@@ -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 = '2.4.3';
5
+ exports.version = '2.4.4';
@@ -58,3 +58,11 @@ export declare const WalletButton: import("@emotion/styled").StyledComponent<{
58
58
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
59
59
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
60
60
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
61
+ export declare const DrawerWalletContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
62
+ children?: import("react").ReactNode;
63
+ component?: import("react").ElementType<any> | undefined;
64
+ ref?: import("react").Ref<unknown> | undefined;
65
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
66
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
67
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
68
+ }, "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>, {}, {}>;
@@ -43,3 +43,11 @@ export const WalletButton = styled(Button)(({ theme }) => ({
43
43
  fontSize: '24px',
44
44
  },
45
45
  }));
46
+ export const DrawerWalletContainer = styled(Box)(() => ({
47
+ width: '100%',
48
+ display: 'flex',
49
+ justifyItems: 'start',
50
+ '& > button': {
51
+ marginLeft: '-0.5rem',
52
+ },
53
+ }));
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import ArrowBackIcon from '@mui/icons-material/ArrowBack';
3
3
  import ReceiptLongIcon from '@mui/icons-material/ReceiptLong';
4
4
  import SettingsIcon from '@mui/icons-material/Settings';
@@ -15,7 +15,7 @@ import { NavigationTabs } from './NavigationTabs';
15
15
  import { WalletMenuButton } from './WalletHeader';
16
16
  export const NavigationHeader = () => {
17
17
  const { t } = useTranslation();
18
- const { subvariant, hiddenUI } = useWidgetConfig();
18
+ const { subvariant, hiddenUI, variant } = useWidgetConfig();
19
19
  const { navigate, navigateBack } = useNavigateBack();
20
20
  const { account } = useWallet();
21
21
  const { element, title } = useHeaderStore((state) => state);
@@ -78,7 +78,7 @@ export const NavigationHeader = () => {
78
78
  }
79
79
  }
80
80
  };
81
- return (_jsxs(_Fragment, { children: [_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, splitSubvariant ? (_jsx(Box, { flex: 1, children: !hiddenUI?.includes(HiddenUI.WalletMenu) ? (_jsx(WalletMenuButton, {})) : null })) : (_jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(_Fragment, { children: [account.isActive && !hiddenUI?.includes(HiddenUI.History) ? (_jsx(Tooltip, { title: t(`header.transactionHistory`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "start", onClick: () => navigate(navigationRoutes.transactionHistory), children: _jsx(ReceiptLongIcon, {}) }) })) : null, _jsx(Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", onClick: () => navigate(navigationRoutes.settings), sx: {
81
+ return (_jsxs(_Fragment, { children: [_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, splitSubvariant ? (_jsx(Box, { flex: 1, children: !hiddenUI?.includes(HiddenUI.WalletMenu) ? (_jsx(WalletMenuButton, {})) : null })) : (_jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(Box, { paddingRight: variant === 'drawer' && subvariant === 'split' ? 5 : 0, children: [account.isActive && !hiddenUI?.includes(HiddenUI.History) ? (_jsx(Tooltip, { title: t(`header.transactionHistory`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "start", onClick: () => navigate(navigationRoutes.transactionHistory), children: _jsx(ReceiptLongIcon, {}) }) })) : null, _jsx(Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", onClick: () => navigate(navigationRoutes.settings), sx: {
82
82
  marginRight: -1.25,
83
83
  }, children: _jsx(SettingsIcon, {}) }) })] }) }), _jsx(Route, { path: "*", element: element || _jsx(Box, { width: 28, height: 40 }) })] })] }), splitSubvariant ? _jsx(NavigationTabs, {}) : null] }));
84
84
  };
@@ -11,19 +11,23 @@ import { useLocation, useNavigate } from 'react-router-dom';
11
11
  import { useChain } from '../../hooks';
12
12
  import { useWallet, useWidgetConfig } from '../../providers';
13
13
  import { navigationRoutes, shortenAddress } from '../../utils';
14
- import { HeaderAppBar, WalletButton } from './Header.style';
14
+ import { DrawerWalletContainer, HeaderAppBar, WalletButton, } from './Header.style';
15
15
  import { WalletMenu } from './WalletMenu';
16
16
  export const WalletHeader = () => {
17
17
  return (_jsx(HeaderAppBar, { elevation: 0, sx: { justifyContent: 'flex-end' }, children: _jsx(WalletMenuButton, {}) }));
18
18
  };
19
19
  export const WalletMenuButton = () => {
20
20
  const { account } = useWallet();
21
+ const { variant } = useWidgetConfig();
22
+ if (variant === 'drawer') {
23
+ return (_jsx(DrawerWalletContainer, { children: account.isActive ? _jsx(ConnectedButton, {}) : _jsx(ConnectButton, {}) }));
24
+ }
21
25
  return account.isActive ? _jsx(ConnectedButton, {}) : _jsx(ConnectButton, {});
22
26
  };
23
27
  const ConnectButton = () => {
24
28
  const { t } = useTranslation();
25
29
  const { pathname } = useLocation();
26
- const { walletManagement, subvariant } = useWidgetConfig();
30
+ const { walletManagement, subvariant, variant } = useWidgetConfig();
27
31
  const { connect: connectWallet } = useWallet();
28
32
  const navigate = useNavigate();
29
33
  const connect = async () => {
@@ -33,7 +37,7 @@ const ConnectButton = () => {
33
37
  }
34
38
  navigate(navigationRoutes.selectWallet);
35
39
  };
36
- return (_jsx(WalletButton, { endIcon: subvariant !== 'split' ? _jsx(WalletIcon, {}) : undefined, startIcon: subvariant === 'split' ? _jsx(WalletIcon, {}) : undefined, onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined, sx: {
40
+ return (_jsx(WalletButton, { endIcon: variant !== 'drawer' && subvariant !== 'split' ? (_jsx(WalletIcon, {})) : undefined, startIcon: variant === 'drawer' || subvariant === 'split' ? (_jsx(WalletIcon, { sx: { marginLeft: -0.25 } })) : undefined, onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined, sx: {
37
41
  marginRight: subvariant === 'split' ? 0 : -1.25,
38
42
  marginLeft: subvariant === 'split' ? -1.25 : 0,
39
43
  }, children: t(`button.connectWallet`) }));
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.4.3";
2
+ export declare const version = "2.4.4";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '2.4.3';
2
+ export const version = '2.4.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",