@lifi/widget 1.28.4 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AppDrawer.style.d.ts +1 -1
- package/AppProvider.js +2 -2
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/AppProvider.js +2 -2
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +2 -2
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
- package/cjs/components/AppContainer.d.ts +2 -2
- package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +5 -3
- package/cjs/components/Card/Card.js +1 -3
- package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +7 -5
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
- package/cjs/components/Header/Header.style.d.ts +3 -3
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SmallAvatar.d.ts +2 -2
- package/cjs/components/Step/CircularProgress.d.ts +0 -1
- package/cjs/components/Step/CircularProgress.style.d.ts +2 -2
- package/cjs/components/Step/StepList.d.ts +0 -1
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
- package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/cjs/components/Switch.js +1 -1
- package/cjs/components/Token/Token.style.d.ts +4 -4
- package/cjs/components/Token/Token.style.js +3 -1
- package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
- package/cjs/components/TokenList/TokenList.style.d.ts +1 -1
- package/cjs/components/TokenList/TokenList.style.js +1 -1
- package/cjs/config/theme.js +22 -27
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useChains.js +2 -3
- package/cjs/hooks/useRouteExecution.js +4 -3
- package/cjs/hooks/useTools.js +2 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/SelectChainPage/SelectChainPage.style.js +1 -1
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +1 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +1 -1
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
- package/cjs/providers/WalletProvider/WalletProvider.js +1 -1
- package/cjs/providers/WidgetProvider/WidgetProvider.js +3 -2
- package/cjs/stores/StoreProvider.d.ts +3 -0
- package/cjs/stores/StoreProvider.js +13 -0
- package/cjs/stores/chains/ChainOrderStore.d.ts +9 -0
- package/cjs/stores/chains/ChainOrderStore.js +44 -0
- package/cjs/stores/chains/createChainOrderStore.d.ts +4 -0
- package/cjs/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +4 -4
- package/cjs/stores/chains/index.d.ts +2 -1
- package/cjs/stores/chains/index.js +2 -1
- package/cjs/stores/chains/types.d.ts +2 -2
- package/cjs/stores/chains/useChainOrder.js +2 -2
- package/cjs/stores/index.d.ts +1 -0
- package/cjs/stores/index.js +1 -0
- package/cjs/stores/routes/RouteExecutionStore.d.ts +9 -0
- package/cjs/stores/routes/RouteExecutionStore.js +44 -0
- package/cjs/stores/routes/createRouteExecutionStore.d.ts +3 -0
- package/cjs/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +6 -4
- package/cjs/stores/routes/index.d.ts +1 -1
- package/cjs/stores/routes/index.js +1 -1
- package/cjs/stores/routes/types.d.ts +5 -5
- package/cjs/stores/routes/useExecutingRoutesIds.js +2 -2
- package/cjs/stores/routes/useSetExecutableRoute.js +2 -2
- package/cjs/stores/routes/useSwapHistory.js +2 -2
- package/cjs/stores/settings/SettingsStore.d.ts +11 -0
- package/cjs/stores/settings/SettingsStore.js +58 -0
- package/cjs/stores/settings/createSettingsStore.d.ts +5 -0
- package/cjs/stores/settings/{useSettingsStore.js → createSettingsStore.js} +4 -19
- package/cjs/stores/settings/index.d.ts +1 -1
- package/cjs/stores/settings/index.js +1 -1
- package/cjs/stores/settings/types.d.ts +4 -4
- package/cjs/stores/settings/useAppearance.js +2 -2
- package/cjs/stores/settings/useSettings.js +2 -2
- package/cjs/stores/types.d.ts +5 -0
- package/cjs/stores/types.js +2 -0
- package/cjs/types/widget.d.ts +1 -0
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +2 -2
- package/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
- package/components/AppContainer.d.ts +2 -2
- package/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/components/Card/Card.d.ts +5 -3
- package/components/Card/Card.js +1 -3
- package/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/components/ChainSelect/ChainSelect.style.d.ts +7 -5
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
- package/components/Header/Header.style.d.ts +3 -3
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SmallAvatar.d.ts +2 -2
- package/components/Step/CircularProgress.d.ts +0 -1
- package/components/Step/CircularProgress.style.d.ts +2 -2
- package/components/Step/StepList.d.ts +0 -1
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
- package/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/components/Switch.js +1 -1
- package/components/Token/Token.style.d.ts +4 -4
- package/components/Token/Token.style.js +4 -2
- package/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
- package/components/TokenList/TokenList.style.d.ts +1 -1
- package/components/TokenList/TokenList.style.js +1 -1
- package/config/theme.js +22 -27
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useChains.js +3 -4
- package/hooks/useRouteExecution.js +5 -4
- package/hooks/useTools.js +3 -2
- package/package.json +11 -11
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/SelectChainPage/SelectChainPage.style.js +1 -1
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.style.js +1 -1
- package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
- package/providers/WalletProvider/WalletProvider.js +1 -1
- package/providers/WidgetProvider/WidgetProvider.js +4 -3
- package/stores/StoreProvider.d.ts +3 -0
- package/stores/StoreProvider.js +9 -0
- package/stores/chains/ChainOrderStore.d.ts +9 -0
- package/stores/chains/ChainOrderStore.js +38 -0
- package/stores/chains/createChainOrderStore.d.ts +4 -0
- package/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +2 -3
- package/stores/chains/index.d.ts +2 -1
- package/stores/chains/index.js +2 -1
- package/stores/chains/types.d.ts +2 -2
- package/stores/chains/useChainOrder.js +1 -1
- package/stores/index.d.ts +1 -0
- package/stores/index.js +1 -0
- package/stores/routes/RouteExecutionStore.d.ts +9 -0
- package/stores/routes/RouteExecutionStore.js +38 -0
- package/stores/routes/createRouteExecutionStore.d.ts +3 -0
- package/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +4 -3
- package/stores/routes/index.d.ts +1 -1
- package/stores/routes/index.js +1 -1
- package/stores/routes/types.d.ts +5 -5
- package/stores/routes/useExecutingRoutesIds.js +1 -1
- package/stores/routes/useSetExecutableRoute.js +1 -1
- package/stores/routes/useSwapHistory.js +1 -1
- package/stores/settings/SettingsStore.d.ts +11 -0
- package/stores/settings/SettingsStore.js +51 -0
- package/stores/settings/createSettingsStore.d.ts +5 -0
- package/stores/settings/{useSettingsStore.js → createSettingsStore.js} +2 -17
- package/stores/settings/index.d.ts +1 -1
- package/stores/settings/index.js +1 -1
- package/stores/settings/types.d.ts +4 -4
- package/stores/settings/useAppearance.js +1 -1
- package/stores/settings/useSettings.js +1 -1
- package/stores/types.d.ts +5 -0
- package/stores/types.js +1 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/cjs/stores/chains/useChainOrderStore.d.ts +0 -17
- package/cjs/stores/routes/useRouteExecutionStore.d.ts +0 -16
- package/cjs/stores/settings/useSettingsStore.d.ts +0 -44
- package/stores/chains/useChainOrderStore.d.ts +0 -17
- package/stores/routes/useRouteExecutionStore.d.ts +0 -16
- package/stores/settings/useSettingsStore.d.ts +0 -44
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useRouteExecutionStoreContext = exports.useRouteExecutionStore = exports.RouteExecutionStoreProvider = exports.RouteExecutionStoreContext = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
/* eslint-disable no-underscore-dangle */
|
|
17
|
+
const react_1 = require("react");
|
|
18
|
+
const createRouteExecutionStore_1 = require("./createRouteExecutionStore");
|
|
19
|
+
exports.RouteExecutionStoreContext = (0, react_1.createContext)(null);
|
|
20
|
+
function RouteExecutionStoreProvider(_a) {
|
|
21
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
22
|
+
const storeRef = (0, react_1.useRef)();
|
|
23
|
+
if (!storeRef.current) {
|
|
24
|
+
storeRef.current = (0, createRouteExecutionStore_1.createRouteExecutionStore)(props);
|
|
25
|
+
}
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(exports.RouteExecutionStoreContext.Provider, Object.assign({ value: storeRef.current }, { children: children })));
|
|
27
|
+
}
|
|
28
|
+
exports.RouteExecutionStoreProvider = RouteExecutionStoreProvider;
|
|
29
|
+
function useRouteExecutionStore(selector, equalityFn) {
|
|
30
|
+
const useStore = (0, react_1.useContext)(exports.RouteExecutionStoreContext);
|
|
31
|
+
if (!useStore) {
|
|
32
|
+
throw new Error(`You forgot to wrap your component in <${RouteExecutionStoreProvider.name}>.`);
|
|
33
|
+
}
|
|
34
|
+
return useStore(selector, equalityFn);
|
|
35
|
+
}
|
|
36
|
+
exports.useRouteExecutionStore = useRouteExecutionStore;
|
|
37
|
+
function useRouteExecutionStoreContext() {
|
|
38
|
+
const useStore = (0, react_1.useContext)(exports.RouteExecutionStoreContext);
|
|
39
|
+
if (!useStore) {
|
|
40
|
+
throw new Error(`You forgot to wrap your component in <${RouteExecutionStoreProvider.name}>.`);
|
|
41
|
+
}
|
|
42
|
+
return useStore;
|
|
43
|
+
}
|
|
44
|
+
exports.useRouteExecutionStoreContext = useRouteExecutionStoreContext;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createRouteExecutionStore = void 0;
|
|
4
4
|
const zustand_1 = require("zustand");
|
|
5
5
|
const middleware_1 = require("zustand/middleware");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const types_1 = require("./types");
|
|
8
8
|
const utils_2 = require("./utils");
|
|
9
|
-
|
|
9
|
+
const createRouteExecutionStore = ({ namePrefix }) => (0, zustand_1.create)((0, middleware_1.persist)((set, get) => ({
|
|
10
10
|
routes: {},
|
|
11
11
|
setExecutableRoute: (route) => {
|
|
12
12
|
if (!get().routes[route.id]) {
|
|
@@ -40,7 +40,8 @@ exports.useRouteExecutionStore = (0, zustand_1.create)()((0, middleware_1.persis
|
|
|
40
40
|
}
|
|
41
41
|
const isDone = (0, utils_2.isRouteDone)(route);
|
|
42
42
|
if (isDone) {
|
|
43
|
-
updatedState.routes[route.id].status =
|
|
43
|
+
updatedState.routes[route.id].status =
|
|
44
|
+
types_1.RouteExecutionStatus.Done;
|
|
44
45
|
if ((0, utils_2.isRoutePartiallyDone)(route)) {
|
|
45
46
|
updatedState.routes[route.id].status |=
|
|
46
47
|
types_1.RouteExecutionStatus.Partial;
|
|
@@ -93,7 +94,7 @@ exports.useRouteExecutionStore = (0, zustand_1.create)()((0, middleware_1.persis
|
|
|
93
94
|
};
|
|
94
95
|
}),
|
|
95
96
|
}), {
|
|
96
|
-
name: 'li.fi-widget-routes
|
|
97
|
+
name: `${namePrefix || 'li.fi'}-widget-routes`,
|
|
97
98
|
version: 1,
|
|
98
99
|
partialize: (state) => ({ routes: state.routes }),
|
|
99
100
|
merge: (persistedState, currentState) => {
|
|
@@ -172,3 +173,4 @@ exports.useRouteExecutionStore = (0, zustand_1.create)()((0, middleware_1.persis
|
|
|
172
173
|
return persistedState;
|
|
173
174
|
},
|
|
174
175
|
}));
|
|
176
|
+
exports.createRouteExecutionStore = createRouteExecutionStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export * from './RouteExecutionStore';
|
|
1
2
|
export * from './types';
|
|
2
3
|
export * from './useExecutingRoutesIds';
|
|
3
4
|
export * from './useRecommendedRouteStore';
|
|
4
|
-
export * from './useRouteExecutionStore';
|
|
5
5
|
export * from './useSetExecutableRoute';
|
|
6
6
|
export * from './useSwapHistory';
|
|
7
7
|
export * from './utils';
|
|
@@ -14,10 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RouteExecutionStore"), exports);
|
|
17
18
|
__exportStar(require("./types"), exports);
|
|
18
19
|
__exportStar(require("./useExecutingRoutesIds"), exports);
|
|
19
20
|
__exportStar(require("./useRecommendedRouteStore"), exports);
|
|
20
|
-
__exportStar(require("./useRouteExecutionStore"), exports);
|
|
21
21
|
__exportStar(require("./useSetExecutableRoute"), exports);
|
|
22
22
|
__exportStar(require("./useSwapHistory"), exports);
|
|
23
23
|
__exportStar(require("./utils"), exports);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk';
|
|
2
|
-
export interface
|
|
2
|
+
export interface RouteExecution {
|
|
3
|
+
route: Route;
|
|
4
|
+
status: RouteExecutionStatus;
|
|
5
|
+
}
|
|
6
|
+
export interface RouteExecutionState {
|
|
3
7
|
routes: Partial<Record<string, RouteExecution>>;
|
|
4
8
|
setExecutableRoute: (route: Route) => void;
|
|
5
9
|
updateRoute: (route: Route) => void;
|
|
@@ -15,10 +19,6 @@ export declare enum RouteExecutionStatus {
|
|
|
15
19
|
Partial = 8,
|
|
16
20
|
Refunded = 16
|
|
17
21
|
}
|
|
18
|
-
export interface RouteExecution {
|
|
19
|
-
route: Route;
|
|
20
|
-
status: RouteExecutionStatus;
|
|
21
|
-
}
|
|
22
22
|
export interface RecommendedRouteStore {
|
|
23
23
|
recommendedRoute?: Route;
|
|
24
24
|
setRecommendedRoute: (route?: Route) => void;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useExecutingRoutesIds = void 0;
|
|
4
4
|
const shallow_1 = require("zustand/shallow");
|
|
5
|
+
const RouteExecutionStore_1 = require("./RouteExecutionStore");
|
|
5
6
|
const types_1 = require("./types");
|
|
6
|
-
const useRouteExecutionStore_1 = require("./useRouteExecutionStore");
|
|
7
7
|
const useExecutingRoutesIds = (address) => {
|
|
8
|
-
return (0,
|
|
8
|
+
return (0, RouteExecutionStore_1.useRouteExecutionStore)((state) => Object.values(state.routes)
|
|
9
9
|
.filter((item) => item.route.fromAddress === address &&
|
|
10
10
|
(item.status === types_1.RouteExecutionStatus.Pending ||
|
|
11
11
|
item.status === types_1.RouteExecutionStatus.Failed))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSetExecutableRoute = void 0;
|
|
4
|
-
const
|
|
4
|
+
const RouteExecutionStore_1 = require("./RouteExecutionStore");
|
|
5
5
|
const useSetExecutableRoute = () => {
|
|
6
|
-
return (0,
|
|
6
|
+
return (0, RouteExecutionStore_1.useRouteExecutionStore)((state) => state.setExecutableRoute);
|
|
7
7
|
};
|
|
8
8
|
exports.useSetExecutableRoute = useSetExecutableRoute;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useSwapHistory = void 0;
|
|
4
4
|
const shallow_1 = require("zustand/shallow");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
+
const RouteExecutionStore_1 = require("./RouteExecutionStore");
|
|
6
7
|
const types_1 = require("./types");
|
|
7
|
-
const useRouteExecutionStore_1 = require("./useRouteExecutionStore");
|
|
8
8
|
const useSwapHistory = (address) => {
|
|
9
|
-
return (0,
|
|
9
|
+
return (0, RouteExecutionStore_1.useRouteExecutionStore)((state) => Object.values(state.routes)
|
|
10
10
|
.filter((item) => (item === null || item === void 0 ? void 0 : item.route.fromAddress) === address &&
|
|
11
11
|
(0, utils_1.hasEnumFlag)(item.status, types_1.RouteExecutionStatus.Done))
|
|
12
12
|
.sort((a, b) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WidgetConfig } from '@lifi/widget';
|
|
3
|
+
import type { StoreApi, UseBoundStore } from 'zustand';
|
|
4
|
+
import type { PersistStoreProviderProps } from '../types';
|
|
5
|
+
import type { SettingsState } from './types';
|
|
6
|
+
export type SettingsStore = UseBoundStore<StoreApi<SettingsState>>;
|
|
7
|
+
export declare const SettingsStoreContext: import("react").Context<SettingsStore | null>;
|
|
8
|
+
export declare function SettingsStoreProvider({ children, ...props }: PersistStoreProviderProps): JSX.Element;
|
|
9
|
+
export declare function useSettingsStore<T>(selector: (state: SettingsState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
10
|
+
export declare function useSettingsStoreContext(): SettingsStore;
|
|
11
|
+
export declare const setDefaultSettings: (useSettingsStore: SettingsStore, config?: WidgetConfig) => void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.setDefaultSettings = exports.useSettingsStoreContext = exports.useSettingsStore = exports.SettingsStoreProvider = exports.SettingsStoreContext = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const createSettingsStore_1 = require("./createSettingsStore");
|
|
18
|
+
exports.SettingsStoreContext = (0, react_1.createContext)(null);
|
|
19
|
+
function SettingsStoreProvider(_a) {
|
|
20
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
21
|
+
const storeRef = (0, react_1.useRef)();
|
|
22
|
+
if (!storeRef.current) {
|
|
23
|
+
storeRef.current = (0, createSettingsStore_1.createSettingsStore)(props);
|
|
24
|
+
}
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(exports.SettingsStoreContext.Provider, Object.assign({ value: storeRef.current }, { children: children })));
|
|
26
|
+
}
|
|
27
|
+
exports.SettingsStoreProvider = SettingsStoreProvider;
|
|
28
|
+
function useSettingsStore(selector, equalityFn) {
|
|
29
|
+
const useStore = (0, react_1.useContext)(exports.SettingsStoreContext);
|
|
30
|
+
if (!useStore) {
|
|
31
|
+
throw new Error(`You forgot to wrap your component in <${SettingsStoreProvider.name}>.`);
|
|
32
|
+
}
|
|
33
|
+
return useStore(selector, equalityFn);
|
|
34
|
+
}
|
|
35
|
+
exports.useSettingsStore = useSettingsStore;
|
|
36
|
+
function useSettingsStoreContext() {
|
|
37
|
+
const useStore = (0, react_1.useContext)(exports.SettingsStoreContext);
|
|
38
|
+
if (!useStore) {
|
|
39
|
+
throw new Error(`You forgot to wrap your component in <${SettingsStoreProvider.name}>.`);
|
|
40
|
+
}
|
|
41
|
+
return useStore;
|
|
42
|
+
}
|
|
43
|
+
exports.useSettingsStoreContext = useSettingsStoreContext;
|
|
44
|
+
const setDefaultSettings = (useSettingsStore, config) => {
|
|
45
|
+
var _a, _b, _c, _d, _e;
|
|
46
|
+
const { slippage, routePriority, setValue } = useSettingsStore.getState();
|
|
47
|
+
const defaultSlippage = ((config === null || config === void 0 ? void 0 : config.slippage) ||
|
|
48
|
+
((_b = (_a = config === null || config === void 0 ? void 0 : config.sdkConfig) === null || _a === void 0 ? void 0 : _a.defaultRouteOptions) === null || _b === void 0 ? void 0 : _b.slippage) ||
|
|
49
|
+
0) * 100;
|
|
50
|
+
const defaultRoutePriority = (config === null || config === void 0 ? void 0 : config.routePriority) || ((_d = (_c = config === null || config === void 0 ? void 0 : config.sdkConfig) === null || _c === void 0 ? void 0 : _c.defaultRouteOptions) === null || _d === void 0 ? void 0 : _d.order);
|
|
51
|
+
if (!slippage) {
|
|
52
|
+
setValue('slippage', (_e = (defaultSlippage || createSettingsStore_1.defaultConfigurableSettings.slippage)) === null || _e === void 0 ? void 0 : _e.toString());
|
|
53
|
+
}
|
|
54
|
+
if (!routePriority) {
|
|
55
|
+
setValue('routePriority', defaultRoutePriority || createSettingsStore_1.defaultConfigurableSettings.routePriority);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.setDefaultSettings = setDefaultSettings;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PersistStoreProps } from '../types';
|
|
2
|
+
import type { SettingsProps, SettingsState } from './types';
|
|
3
|
+
export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage'>;
|
|
4
|
+
export declare const defaultSettings: SettingsProps;
|
|
5
|
+
export declare const createSettingsStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<SettingsState>>;
|
|
@@ -11,8 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
15
|
-
/* eslint-disable no-underscore-dangle */
|
|
14
|
+
exports.createSettingsStore = exports.defaultSettings = exports.defaultConfigurableSettings = void 0;
|
|
16
15
|
const zustand_1 = require("zustand");
|
|
17
16
|
const middleware_1 = require("zustand/middleware");
|
|
18
17
|
const types_1 = require("./types");
|
|
@@ -26,7 +25,7 @@ exports.defaultSettings = {
|
|
|
26
25
|
advancedPreferences: false,
|
|
27
26
|
showDestinationWallet: true,
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
const createSettingsStore = ({ namePrefix }) => (0, zustand_1.create)((0, middleware_1.persist)((set) => (Object.assign(Object.assign({}, exports.defaultSettings), { setValue: (key, value) => set(() => ({
|
|
30
29
|
[key]: value,
|
|
31
30
|
})), setValues: (values) => set((state) => {
|
|
32
31
|
const updatedState = Object.assign({}, state);
|
|
@@ -71,7 +70,7 @@ exports.useSettingsStore = (0, zustand_1.create)()((0, middleware_1.persist)((se
|
|
|
71
70
|
return values;
|
|
72
71
|
}, {}),
|
|
73
72
|
})) })), {
|
|
74
|
-
name: 'li.fi-widget-settings
|
|
73
|
+
name: `${namePrefix || 'li.fi'}-widget-settings`,
|
|
75
74
|
version: 2,
|
|
76
75
|
partialize: (state) => {
|
|
77
76
|
const { enabledBridges, enabledExchanges } = state, partializedState = __rest(state, ["enabledBridges", "enabledExchanges"]);
|
|
@@ -96,18 +95,4 @@ exports.useSettingsStore = (0, zustand_1.create)()((0, middleware_1.persist)((se
|
|
|
96
95
|
return persistedState;
|
|
97
96
|
},
|
|
98
97
|
}));
|
|
99
|
-
|
|
100
|
-
var _a, _b, _c, _d, _e;
|
|
101
|
-
const { slippage, routePriority, setValue } = exports.useSettingsStore.getState();
|
|
102
|
-
const defaultSlippage = ((config === null || config === void 0 ? void 0 : config.slippage) ||
|
|
103
|
-
((_b = (_a = config === null || config === void 0 ? void 0 : config.sdkConfig) === null || _a === void 0 ? void 0 : _a.defaultRouteOptions) === null || _b === void 0 ? void 0 : _b.slippage) ||
|
|
104
|
-
0) * 100;
|
|
105
|
-
const defaultRoutePriority = (config === null || config === void 0 ? void 0 : config.routePriority) || ((_d = (_c = config === null || config === void 0 ? void 0 : config.sdkConfig) === null || _c === void 0 ? void 0 : _c.defaultRouteOptions) === null || _d === void 0 ? void 0 : _d.order);
|
|
106
|
-
if (!slippage) {
|
|
107
|
-
setValue('slippage', (_e = (defaultSlippage || exports.defaultConfigurableSettings.slippage)) === null || _e === void 0 ? void 0 : _e.toString());
|
|
108
|
-
}
|
|
109
|
-
if (!routePriority) {
|
|
110
|
-
setValue('routePriority', defaultRoutePriority || exports.defaultConfigurableSettings.routePriority);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
exports.setDefaultSettings = setDefaultSettings;
|
|
98
|
+
exports.createSettingsStore = createSettingsStore;
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SettingsStore"), exports);
|
|
17
18
|
__exportStar(require("./types"), exports);
|
|
18
19
|
__exportStar(require("./useAppearance"), exports);
|
|
19
20
|
__exportStar(require("./useSendToWalletStore"), exports);
|
|
20
21
|
__exportStar(require("./useSettings"), exports);
|
|
21
|
-
__exportStar(require("./useSettingsStore"), exports);
|
|
@@ -4,7 +4,7 @@ export type ValueSetter<S> = <K extends keyof S>(key: K, value: S[Extract<K, str
|
|
|
4
4
|
export type ValuesSetter<S> = <K extends keyof S>(values: Record<K, S[Extract<K, string>]>) => void;
|
|
5
5
|
export type SettingsToolType = 'Bridges' | 'Exchanges';
|
|
6
6
|
export declare const SettingsToolTypes: SettingsToolType[];
|
|
7
|
-
export interface
|
|
7
|
+
export interface SettingsProps {
|
|
8
8
|
advancedPreferences: boolean;
|
|
9
9
|
appearance: Appearance;
|
|
10
10
|
gasPrice?: string;
|
|
@@ -17,9 +17,9 @@ export interface SettingsState {
|
|
|
17
17
|
enabledExchanges?: string[];
|
|
18
18
|
_enabledExchanges?: Record<string, boolean>;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
21
|
-
setValue: ValueSetter<
|
|
22
|
-
setValues: ValuesSetter<
|
|
20
|
+
export interface SettingsState extends SettingsProps {
|
|
21
|
+
setValue: ValueSetter<SettingsProps>;
|
|
22
|
+
setValues: ValuesSetter<SettingsProps>;
|
|
23
23
|
initializeTools(toolType: SettingsToolType, tools: string[]): void;
|
|
24
24
|
setTools(toolType: SettingsToolType, tools: string[], availableTools: (Pick<Bridge, 'key'> | Pick<Exchange, 'key'>)[]): void;
|
|
25
25
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useAppearance = void 0;
|
|
4
4
|
const shallow_1 = require("zustand/shallow");
|
|
5
|
-
const
|
|
5
|
+
const SettingsStore_1 = require("./SettingsStore");
|
|
6
6
|
const useAppearance = () => {
|
|
7
|
-
const [appearance, setValue] = (0,
|
|
7
|
+
const [appearance, setValue] = (0, SettingsStore_1.useSettingsStore)((state) => [state.appearance, state.setValue], shallow_1.shallow);
|
|
8
8
|
const setAppearance = (appearance) => {
|
|
9
9
|
setValue('appearance', appearance);
|
|
10
10
|
};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSettings = void 0;
|
|
4
4
|
const shallow_1 = require("zustand/shallow");
|
|
5
|
-
const
|
|
5
|
+
const SettingsStore_1 = require("./SettingsStore");
|
|
6
6
|
const useSettings = (keys) => {
|
|
7
|
-
return (0,
|
|
7
|
+
return (0, SettingsStore_1.useSettingsStore)((state) => keys.reduce((values, key) => {
|
|
8
8
|
values[key] = state[key];
|
|
9
9
|
return values;
|
|
10
10
|
}, {}), shallow_1.shallow);
|
package/cjs/types/widget.d.ts
CHANGED
|
@@ -35,11 +35,11 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
|
35
35
|
} | undefined;
|
|
36
36
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
|
|
37
37
|
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
38
|
-
}, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "
|
|
38
|
+
}, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "slotProps" | "slots" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
39
39
|
export declare const ShowAllButton: import("@emotion/styled").StyledComponent<{
|
|
40
40
|
children?: import("react").ReactNode;
|
|
41
41
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
42
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
42
|
+
color?: "inherit" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
|
|
43
43
|
disabled?: boolean | undefined;
|
|
44
44
|
disableElevation?: boolean | undefined;
|
|
45
45
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -3,7 +3,7 @@ import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryA
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { getContrastAlphaColor } from '../../utils';
|
|
5
5
|
export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
|
|
6
|
-
borderRadius: theme.shape.
|
|
6
|
+
borderRadius: theme.shape.borderRadius,
|
|
7
7
|
paddingLeft: theme.spacing(1.5),
|
|
8
8
|
paddingRight: theme.spacing(1.5),
|
|
9
9
|
height: 64,
|
|
@@ -6,9 +6,9 @@ export declare const AppExpandedContainer: import("@emotion/styled").StyledCompo
|
|
|
6
6
|
component?: import("react").ElementType<any> | undefined;
|
|
7
7
|
ref?: import("react").Ref<unknown> | undefined;
|
|
8
8
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
9
|
-
} &
|
|
9
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
10
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
11
|
-
},
|
|
11
|
+
}, "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> & {
|
|
12
12
|
variant?: WidgetVariant | undefined;
|
|
13
13
|
}, {}, {}>;
|
|
14
14
|
export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { BottomSheetBase, BottomSheetProps } from './types';
|
|
3
|
-
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "components" | "
|
|
3
|
+
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "components" | "componentsProps" | "slotProps" | "slots" | "elevation" | "onClose" | "elementRef" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "BackdropComponent" | "BackdropProps" | "PaperProps" | "ModalProps" | "SlideProps"> & import("react").RefAttributes<BottomSheetBase>>;
|
|
@@ -14,14 +14,16 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
|
|
|
14
14
|
component?: import("react").ElementType<any> | undefined;
|
|
15
15
|
ref?: import("react").Ref<unknown> | undefined;
|
|
16
16
|
sx?: import("@mui/material").SxProps<Theme> | undefined;
|
|
17
|
-
} &
|
|
17
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
18
18
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
19
|
-
},
|
|
19
|
+
}, "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
21
|
selectionColor?: "primary" | "secondary" | undefined;
|
|
22
22
|
dense?: boolean | undefined;
|
|
23
23
|
indented?: boolean | undefined;
|
|
24
24
|
onClick?: MouseEventHandler<HTMLDivElement> | undefined;
|
|
25
25
|
pointerEvents?: "none" | "auto" | undefined;
|
|
26
|
-
}
|
|
26
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
27
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
28
|
+
}, 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">, {}, {}>;
|
|
27
29
|
export {};
|
package/components/Card/Card.js
CHANGED
|
@@ -29,9 +29,7 @@ export const Card = styled(Box, {
|
|
|
29
29
|
: theme.palette.mode === 'light'
|
|
30
30
|
? theme.palette.grey[300]
|
|
31
31
|
: theme.palette.grey[800],
|
|
32
|
-
borderRadius:
|
|
33
|
-
? theme.shape.borderRadiusSecondary
|
|
34
|
-
: theme.shape.borderRadius,
|
|
32
|
+
borderRadius: theme.shape.borderRadius,
|
|
35
33
|
overflow: 'hidden',
|
|
36
34
|
position: 'relative',
|
|
37
35
|
padding: indented ? theme.spacing(2) : 0,
|
|
@@ -4,21 +4,23 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
|
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
|
-
},
|
|
9
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
variant?: ("default" | "error" | "selected") | undefined;
|
|
11
11
|
selectionColor?: "primary" | "secondary" | undefined;
|
|
12
12
|
dense?: boolean | undefined;
|
|
13
13
|
indented?: boolean | undefined;
|
|
14
14
|
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
15
15
|
pointerEvents?: "none" | "auto" | undefined;
|
|
16
|
-
}
|
|
16
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
17
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
18
|
+
}, 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">, {}, {}>;
|
|
17
19
|
export declare const ChainContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
18
20
|
children?: import("react").ReactNode;
|
|
19
21
|
component?: import("react").ElementType<any> | undefined;
|
|
20
22
|
ref?: import("react").Ref<unknown> | undefined;
|
|
21
23
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
22
|
-
} &
|
|
24
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
23
25
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
24
|
-
},
|
|
26
|
+
}, "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>, {}, {}>;
|