@lifi/widget 2.0.0-alpha.1 → 2.0.0-alpha.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.
package/App.js CHANGED
@@ -11,7 +11,7 @@ import { SwapRoutesExpanded } from './components/SwapRoutes';
11
11
  import { useExpandableVariant } from './hooks';
12
12
  export const App = forwardRef(({ elementRef, open, integrator, ...other }, ref) => {
13
13
  const config = useMemo(() => ({ integrator, ...other, ...other.config }), [integrator, other]);
14
- return config?.variant !== 'drawer' ? (_jsx(AppProvider, { integrator: integrator, config: config, children: _jsx(AppDefault, {}) })) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
14
+ return config?.variant !== 'drawer' ? (_jsx(AppProvider, { config: config, children: _jsx(AppDefault, {}) })) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
15
15
  });
16
16
  export const AppDefault = () => {
17
17
  const expandable = useExpandableVariant();
package/AppDrawer.d.ts CHANGED
@@ -6,9 +6,7 @@ export interface WidgetDrawer {
6
6
  openDrawer(): void;
7
7
  closeDrawer(): void;
8
8
  }
9
- export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & {
10
- config?: WidgetConfig | undefined;
11
- } & import("react").RefAttributes<WidgetDrawer>>;
9
+ export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
12
10
  export declare const DrawerButtonText: ({ open }: {
13
11
  open: boolean;
14
12
  }) => JSX.Element;
package/AppDrawer.js CHANGED
@@ -25,7 +25,7 @@ export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, r
25
25
  openDrawer,
26
26
  closeDrawer,
27
27
  }), [closeDrawer, openDrawer, toggleDrawer]);
28
- const drawerConfig = useMemo(() => ({
28
+ const widgetConfig = useMemo(() => ({
29
29
  ...config,
30
30
  integrator,
31
31
  containerStyle: {
@@ -33,7 +33,7 @@ export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, r
33
33
  height: '100%',
34
34
  },
35
35
  }), [config, integrator]);
36
- return (_jsxs(AppProvider, { integrator: integrator, config: drawerConfig, children: [_jsxs(DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? _jsx(KeyboardArrowRightIcon, {}) : _jsx(KeyboardArrowLeftIcon, {}), _jsx(DrawerButtonText, { open: drawerOpen })] }), _jsx(Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
36
+ return (_jsxs(AppProvider, { config: widgetConfig, children: [_jsxs(DrawerButton, { variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config?.containerStyle, children: [drawerOpen ? _jsx(KeyboardArrowRightIcon, {}) : _jsx(KeyboardArrowLeftIcon, {}), _jsx(DrawerButtonText, { open: drawerOpen })] }), _jsx(Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
37
37
  sx: {
38
38
  backgroundColor: 'rgb(0 0 0 / 48%)',
39
39
  backdropFilter: 'blur(3px)',
package/AppProvider.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import type { WidgetProps } from './types';
3
- export declare const AppProvider: React.FC<PropsWithChildren<WidgetProps>>;
2
+ import type { WidgetConfigProps } from './types';
3
+ export declare const AppProvider: React.FC<PropsWithChildren<WidgetConfigProps>>;
4
4
  export declare const AppRouter: React.FC<PropsWithChildren<{}>>;
package/cjs/App.js CHANGED
@@ -14,7 +14,7 @@ const SwapRoutes_1 = require("./components/SwapRoutes");
14
14
  const hooks_1 = require("./hooks");
15
15
  exports.App = (0, react_1.forwardRef)(({ elementRef, open, integrator, ...other }, ref) => {
16
16
  const config = (0, react_1.useMemo)(() => ({ integrator, ...other, ...other.config }), [integrator, other]);
17
- return config?.variant !== 'drawer' ? ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, { integrator: integrator, config: config, children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) })) : ((0, jsx_runtime_1.jsx)(AppDrawer_1.AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
17
+ return config?.variant !== 'drawer' ? ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, { config: config, children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) })) : ((0, jsx_runtime_1.jsx)(AppDrawer_1.AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
18
18
  });
19
19
  const AppDefault = () => {
20
20
  const expandable = (0, hooks_1.useExpandableVariant)();
@@ -6,9 +6,7 @@ export interface WidgetDrawer {
6
6
  openDrawer(): void;
7
7
  closeDrawer(): void;
8
8
  }
9
- export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & {
10
- config?: WidgetConfig | undefined;
11
- } & import("react").RefAttributes<WidgetDrawer>>;
9
+ export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
12
10
  export declare const DrawerButtonText: ({ open }: {
13
11
  open: boolean;
14
12
  }) => JSX.Element;
package/cjs/AppDrawer.js CHANGED
@@ -28,7 +28,7 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, integrator, con
28
28
  openDrawer,
29
29
  closeDrawer,
30
30
  }), [closeDrawer, openDrawer, toggleDrawer]);
31
- const drawerConfig = (0, react_1.useMemo)(() => ({
31
+ const widgetConfig = (0, react_1.useMemo)(() => ({
32
32
  ...config,
33
33
  integrator,
34
34
  containerStyle: {
@@ -36,7 +36,7 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, integrator, con
36
36
  height: '100%',
37
37
  },
38
38
  }), [config, integrator]);
39
- return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, { integrator: integrator, config: drawerConfig, children: [(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 })] }), (0, jsx_runtime_1.jsx)(material_1.Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
39
+ return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, { config: widgetConfig, children: [(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 })] }), (0, jsx_runtime_1.jsx)(material_1.Drawer, { ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
40
40
  sx: {
41
41
  backgroundColor: 'rgb(0 0 0 / 48%)',
42
42
  backdropFilter: 'blur(3px)',
@@ -1,4 +1,4 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import type { WidgetProps } from './types';
3
- export declare const AppProvider: React.FC<PropsWithChildren<WidgetProps>>;
2
+ import type { WidgetConfigProps } from './types';
3
+ export declare const AppProvider: React.FC<PropsWithChildren<WidgetConfigProps>>;
4
4
  export declare const AppRouter: React.FC<PropsWithChildren<{}>>;
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-alpha.1";
2
+ export declare const version = "2.0.0-alpha.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 = '2.0.0-alpha.1';
5
+ exports.version = '2.0.0-alpha.2';
@@ -113,6 +113,10 @@ export type WidgetDrawerProps = {
113
113
  elementRef?: RefObject<HTMLDivElement>;
114
114
  open?: boolean;
115
115
  };
116
- export type WidgetProps = WidgetDrawerProps & WidgetConfig & {
117
- config?: WidgetConfig;
118
- };
116
+ export interface WidgetConfigProps {
117
+ config: WidgetConfig;
118
+ }
119
+ export interface WidgetConfigPartialProps {
120
+ config?: Partial<WidgetConfig>;
121
+ }
122
+ export type WidgetProps = WidgetDrawerProps & WidgetConfig & WidgetConfigPartialProps;
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-alpha.1";
2
+ export declare const version = "2.0.0-alpha.2";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '2.0.0-alpha.1';
2
+ export const version = '2.0.0-alpha.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
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",