@lifi/widget 1.32.7 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +3 -3
- package/AppDrawer.js +4 -3
- package/AppDrawer.style.d.ts +5 -5
- package/cjs/App.js +3 -3
- package/cjs/AppDrawer.js +4 -3
- package/cjs/AppDrawer.style.d.ts +5 -5
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
- package/cjs/components/Card/CardIconButton.d.ts +29 -0
- package/cjs/components/Card/CardIconButton.js +17 -0
- package/cjs/components/Card/CardLabel.d.ts +26 -0
- package/cjs/components/Card/CardLabel.js +45 -0
- package/cjs/components/Card/CardTitle.d.ts +2 -2
- package/cjs/components/Card/index.d.ts +2 -0
- package/cjs/components/Card/index.js +2 -0
- package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
- package/cjs/components/GasMessage/FundsSufficiencyMessage.js +16 -0
- package/cjs/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
- package/cjs/components/GasMessage/GasMessage.js +19 -0
- package/cjs/components/GasMessage/GasMessage.style.d.ts +34 -0
- package/cjs/components/GasMessage/GasMessage.style.js +48 -0
- package/cjs/components/GasMessage/GasRefuelMessage.d.ts +3 -0
- package/cjs/components/GasMessage/GasRefuelMessage.js +26 -0
- package/cjs/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +21 -0
- package/cjs/components/GasMessage/index.d.ts +2 -0
- package/cjs/components/GasMessage/index.js +18 -0
- package/cjs/components/Header/Header.style.d.ts +5 -5
- package/cjs/components/Header/NavigationHeader.js +4 -4
- package/cjs/components/Header/WalletHeader.js +5 -5
- package/cjs/components/Insurance/Insurance.d.ts +3 -0
- package/cjs/components/Insurance/Insurance.js +11 -0
- package/cjs/components/Insurance/InsuranceCard.d.ts +3 -0
- package/cjs/components/Insurance/InsuranceCard.js +20 -0
- package/cjs/components/Insurance/InsuranceCollapsed.d.ts +3 -0
- package/cjs/components/Insurance/InsuranceCollapsed.js +32 -0
- package/cjs/components/Insurance/index.d.ts +1 -0
- package/cjs/components/{GasSufficiencyMessage → Insurance}/index.js +1 -1
- package/cjs/components/Insurance/types.d.ts +14 -0
- package/cjs/components/Insurance/types.js +2 -0
- package/cjs/components/NFT/NFT.style.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/cjs/components/SendToWallet/SendToWallet.js +31 -25
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +2 -2
- package/cjs/components/SendToWallet/SendToWalletButton.js +3 -3
- package/cjs/components/SmallAvatar.d.ts +2 -2
- package/cjs/components/Step/CircularProgress.style.d.ts +1 -1
- package/cjs/components/Step/DestinationWalletAddress.js +2 -2
- package/cjs/components/Step/GasStepProcess.js +2 -2
- package/cjs/components/Step/Step.js +7 -5
- package/cjs/components/Step/StepList.d.ts +1 -1
- package/cjs/components/Step/StepProcess.style.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.d.ts +5 -0
- package/cjs/components/StepActions/StepActions.js +55 -17
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.js +2 -2
- package/cjs/components/SwapButton/types.d.ts +1 -2
- package/cjs/components/SwapInput/SwapInput.style.d.ts +2 -2
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
- package/cjs/components/SwapInput/SwapInputEndAdornment.js +18 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +10 -26
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.js +27 -0
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
- package/cjs/components/SwapRouteCard/types.d.ts +2 -2
- package/cjs/components/SwapRouteCard/utils.d.ts +5 -0
- package/cjs/components/SwapRouteCard/utils.js +32 -2
- package/cjs/components/SwapRoutes/SwapRoutes.js +3 -12
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +3 -5
- package/cjs/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
- package/cjs/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
- package/cjs/components/Switch.js +4 -4
- package/cjs/components/TextFitter/TextFitter.js +9 -3
- package/cjs/components/Token/Token.style.d.ts +2 -2
- package/cjs/config/theme.js +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +4 -0
- package/cjs/hooks/index.js +4 -0
- package/cjs/hooks/useChains.js +2 -2
- package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
- package/cjs/hooks/useFeaturedTokens.js +2 -2
- package/cjs/hooks/useFundsSufficiency.d.ts +5 -0
- package/cjs/hooks/useFundsSufficiency.js +73 -0
- package/cjs/hooks/useGasRecommendation.d.ts +2 -0
- package/cjs/hooks/useGasRecommendation.js +23 -0
- package/cjs/hooks/useGasRefuel.d.ts +7 -0
- package/cjs/hooks/useGasRefuel.js +61 -0
- package/cjs/hooks/useGasSufficiency.d.ts +2 -3
- package/cjs/hooks/useGasSufficiency.js +6 -37
- package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
- package/cjs/hooks/useGetTokenBalancesWithRetry.js +33 -0
- package/cjs/hooks/useSwapRoutes.d.ts +7 -2
- package/cjs/hooks/useSwapRoutes.js +31 -11
- package/cjs/hooks/useTokenAddressBalance.js +4 -2
- package/cjs/hooks/useTokenBalance.js +4 -22
- package/cjs/hooks/useTokenBalances.d.ts +1 -1
- package/cjs/hooks/useTokenSearch.js +2 -2
- package/cjs/hooks/useTokens.js +2 -3
- package/cjs/i18n/en.json +14 -7
- package/cjs/i18n/it.json +6 -2
- package/cjs/i18n/pt.json +234 -0
- package/cjs/i18n/uk.json +5 -1
- package/cjs/icons/InsuraceLogo.d.ts +2 -0
- package/cjs/icons/InsuraceLogo.js +11 -0
- package/cjs/icons/index.d.ts +1 -0
- package/cjs/icons/index.js +1 -0
- package/cjs/index.d.ts +0 -6
- package/cjs/index.js +1 -6
- package/cjs/pages/MainPage/MainGasMessage.d.ts +3 -0
- package/cjs/pages/MainPage/MainGasMessage.js +12 -0
- package/cjs/pages/MainPage/MainPage.js +3 -2
- package/cjs/pages/MainPage/MainSwapButton.js +1 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +1 -14
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -2
- package/cjs/pages/SwapPage/StartSwapButton.js +14 -4
- package/cjs/pages/SwapPage/SwapPage.js +18 -7
- package/cjs/pages/SwapPage/types.d.ts +9 -0
- package/cjs/pages/SwapPage/types.js +2 -0
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +2 -2
- package/cjs/providers/SDKProvider/SDKProvider.js +2 -1
- package/cjs/providers/SwapFormProvider/FormUpdater.js +2 -3
- package/cjs/providers/WidgetProvider/WidgetProvider.js +17 -4
- package/cjs/providers/WidgetProvider/utils.d.ts +1 -1
- package/cjs/providers/WidgetProvider/utils.js +2 -4
- package/cjs/stores/StoreProvider.js +1 -1
- package/cjs/stores/routes/createRouteExecutionStore.js +3 -2
- package/cjs/stores/routes/index.d.ts +0 -1
- package/cjs/stores/routes/index.js +0 -1
- package/cjs/stores/routes/types.d.ts +1 -5
- package/cjs/stores/routes/useSetExecutableRoute.d.ts +1 -1
- package/cjs/stores/settings/types.d.ts +3 -2
- package/cjs/stores/settings/useSettingsStore.js +3 -1
- package/cjs/types/widget.d.ts +5 -10
- package/cjs/utils/format.js +4 -1
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
- package/components/Card/CardIconButton.d.ts +29 -0
- package/components/Card/CardIconButton.js +14 -0
- package/components/Card/CardLabel.d.ts +26 -0
- package/components/Card/CardLabel.js +42 -0
- package/components/Card/CardTitle.d.ts +2 -2
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.js +2 -0
- package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
- package/components/GasMessage/FundsSufficiencyMessage.js +12 -0
- package/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
- package/components/GasMessage/GasMessage.js +15 -0
- package/components/GasMessage/GasMessage.style.d.ts +34 -0
- package/components/GasMessage/GasMessage.style.js +45 -0
- package/components/GasMessage/GasRefuelMessage.d.ts +3 -0
- package/components/GasMessage/GasRefuelMessage.js +22 -0
- package/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
- package/components/GasMessage/GasSufficiencyMessage.js +17 -0
- package/components/GasMessage/index.d.ts +2 -0
- package/components/GasMessage/index.js +2 -0
- package/components/Header/Header.style.d.ts +5 -5
- package/components/Header/NavigationHeader.js +4 -4
- package/components/Header/WalletHeader.js +6 -6
- package/components/Insurance/Insurance.d.ts +3 -0
- package/components/Insurance/Insurance.js +7 -0
- package/components/Insurance/InsuranceCard.d.ts +3 -0
- package/components/Insurance/InsuranceCard.js +16 -0
- package/components/Insurance/InsuranceCollapsed.d.ts +3 -0
- package/components/Insurance/InsuranceCollapsed.js +28 -0
- package/components/Insurance/index.d.ts +1 -0
- package/components/Insurance/index.js +1 -0
- package/components/Insurance/types.d.ts +14 -0
- package/components/Insurance/types.js +1 -0
- package/components/NFT/NFT.style.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/components/SendToWallet/SendToWallet.js +34 -28
- package/components/SendToWallet/SendToWallet.style.d.ts +2 -2
- package/components/SendToWallet/SendToWalletButton.js +4 -4
- package/components/SmallAvatar.d.ts +2 -2
- package/components/Step/CircularProgress.style.d.ts +1 -1
- package/components/Step/DestinationWalletAddress.js +2 -2
- package/components/Step/GasStepProcess.js +2 -2
- package/components/Step/Step.js +7 -5
- package/components/Step/StepList.d.ts +1 -1
- package/components/Step/StepProcess.style.d.ts +3 -3
- package/components/StepActions/StepActions.d.ts +5 -0
- package/components/StepActions/StepActions.js +52 -16
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/SwapButton/SwapButton.js +2 -2
- package/components/SwapButton/types.d.ts +1 -2
- package/components/SwapInput/SwapInput.style.d.ts +2 -2
- package/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
- package/components/SwapInput/SwapInputEndAdornment.js +19 -2
- package/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
- package/components/SwapRouteCard/SwapRouteCard.js +11 -26
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
- package/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
- package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
- package/components/SwapRouteCard/SwapRouteCardEssentials.js +23 -0
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
- package/components/SwapRouteCard/types.d.ts +2 -2
- package/components/SwapRouteCard/utils.d.ts +5 -0
- package/components/SwapRouteCard/utils.js +30 -1
- package/components/SwapRoutes/SwapRoutes.js +5 -14
- package/components/SwapRoutes/SwapRoutesExpanded.js +2 -4
- package/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
- package/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
- package/components/Switch.js +5 -5
- package/components/TextFitter/TextFitter.js +9 -3
- package/components/Token/Token.style.d.ts +2 -2
- package/config/theme.js +1 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +4 -0
- package/hooks/index.js +4 -0
- package/hooks/useChains.js +2 -2
- package/hooks/useFeaturedTokens.d.ts +1 -1
- package/hooks/useFeaturedTokens.js +2 -2
- package/hooks/useFundsSufficiency.d.ts +5 -0
- package/hooks/useFundsSufficiency.js +69 -0
- package/hooks/useGasRecommendation.d.ts +2 -0
- package/hooks/useGasRecommendation.js +19 -0
- package/hooks/useGasRefuel.d.ts +7 -0
- package/hooks/useGasRefuel.js +57 -0
- package/hooks/useGasSufficiency.d.ts +2 -3
- package/hooks/useGasSufficiency.js +7 -38
- package/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
- package/hooks/useGetTokenBalancesWithRetry.js +29 -0
- package/hooks/useSwapRoutes.d.ts +7 -2
- package/hooks/useSwapRoutes.js +32 -12
- package/hooks/useTokenAddressBalance.js +4 -2
- package/hooks/useTokenBalance.js +5 -23
- package/hooks/useTokenBalances.d.ts +1 -1
- package/hooks/useTokenSearch.js +2 -2
- package/hooks/useTokens.js +2 -3
- package/i18n/en.json +14 -7
- package/i18n/it.json +6 -2
- package/i18n/pt.json +234 -0
- package/i18n/uk.json +5 -1
- package/icons/InsuraceLogo.d.ts +2 -0
- package/icons/InsuraceLogo.js +7 -0
- package/icons/index.d.ts +1 -0
- package/icons/index.js +1 -0
- package/index.d.ts +0 -6
- package/index.js +0 -5
- package/package.json +12 -11
- package/pages/ActiveSwapsPage/ActiveSwapsPage.js +2 -2
- package/pages/MainPage/MainGasMessage.d.ts +3 -0
- package/pages/MainPage/MainGasMessage.js +8 -0
- package/pages/MainPage/MainPage.js +3 -2
- package/pages/MainPage/MainSwapButton.js +1 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/pages/SettingsPage/ResetSettingsButton.js +3 -1
- package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +5 -4
- package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.js +0 -12
- package/pages/SwapPage/StartSwapButton.d.ts +3 -2
- package/pages/SwapPage/StartSwapButton.js +13 -4
- package/pages/SwapPage/SwapPage.js +21 -10
- package/pages/SwapPage/types.d.ts +9 -0
- package/pages/SwapPage/types.js +1 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/providers/SDKProvider/SDKProvider.d.ts +2 -2
- package/providers/SDKProvider/SDKProvider.js +3 -2
- package/providers/SwapFormProvider/FormUpdater.js +2 -3
- package/providers/WidgetProvider/WidgetProvider.js +17 -4
- package/providers/WidgetProvider/utils.d.ts +1 -1
- package/providers/WidgetProvider/utils.js +2 -4
- package/stores/StoreProvider.js +2 -2
- package/stores/routes/createRouteExecutionStore.js +3 -2
- package/stores/routes/index.d.ts +0 -1
- package/stores/routes/index.js +0 -1
- package/stores/routes/types.d.ts +1 -5
- package/stores/routes/useSetExecutableRoute.d.ts +1 -1
- package/stores/settings/types.d.ts +3 -2
- package/stores/settings/useSettingsStore.js +3 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +5 -10
- package/utils/format.js +4 -1
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -31
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -14
- package/cjs/components/GasSufficiencyMessage/index.d.ts +0 -1
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.js +0 -13
- package/cjs/config/env.d.ts +0 -3
- package/cjs/config/env.js +0 -6
- package/cjs/stores/routes/useRecommendedRouteStore.d.ts +0 -10
- package/cjs/stores/routes/useRecommendedRouteStore.js +0 -39
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -27
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -11
- package/components/GasSufficiencyMessage/index.d.ts +0 -1
- package/components/GasSufficiencyMessage/index.js +0 -1
- package/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
- package/components/SwapRoutes/useSetRecommendedRoute.js +0 -9
- package/config/env.d.ts +0 -3
- package/config/env.js +0 -3
- package/stores/routes/useRecommendedRouteStore.d.ts +0 -10
- package/stores/routes/useRecommendedRouteStore.js +0 -32
package/App.js
CHANGED
|
@@ -9,9 +9,9 @@ import { Initializer } from './components/Initializer';
|
|
|
9
9
|
import { PoweredBy } from './components/PoweredBy';
|
|
10
10
|
import { SwapRoutesExpanded } from './components/SwapRoutes';
|
|
11
11
|
import { useExpandableVariant } from './hooks';
|
|
12
|
-
export const App = forwardRef(({ elementRef, open, ...other }, ref) => {
|
|
13
|
-
const config = useMemo(() => ({ ...other, ...other.config }), [other]);
|
|
14
|
-
return config?.variant !== 'drawer' ? (_jsx(AppProvider, { config: config, children: _jsx(AppDefault, {}) })) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, config: config, open: open }));
|
|
12
|
+
export const App = forwardRef(({ elementRef, open, integrator, ...other }, ref) => {
|
|
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 }));
|
|
15
15
|
});
|
|
16
16
|
export const AppDefault = () => {
|
|
17
17
|
const expandable = useExpandableVariant();
|
package/AppDrawer.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
7
7
|
import { AppDefault } from './App';
|
|
8
8
|
import { DrawerButton, DrawerButtonTypography } from './AppDrawer.style';
|
|
9
9
|
import { AppProvider } from './AppProvider';
|
|
10
|
-
export const AppDrawer = forwardRef(({ elementRef, open, config }, ref) => {
|
|
10
|
+
export const AppDrawer = forwardRef(({ elementRef, open, integrator, config }, ref) => {
|
|
11
11
|
const openRef = useRef(open);
|
|
12
12
|
const [drawerOpen, setDrawerOpen] = useState(Boolean(open));
|
|
13
13
|
const toggleDrawer = useCallback(() => {
|
|
@@ -27,12 +27,13 @@ export const AppDrawer = forwardRef(({ elementRef, open, config }, ref) => {
|
|
|
27
27
|
}), [closeDrawer, openDrawer, toggleDrawer]);
|
|
28
28
|
const drawerConfig = useMemo(() => ({
|
|
29
29
|
...config,
|
|
30
|
+
integrator,
|
|
30
31
|
containerStyle: {
|
|
31
32
|
...config?.containerStyle,
|
|
32
33
|
height: '100%',
|
|
33
34
|
},
|
|
34
|
-
}), [config]);
|
|
35
|
-
return (_jsxs(AppProvider, { 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: {
|
|
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
37
|
sx: {
|
|
37
38
|
backgroundColor: 'rgb(0 0 0 / 48%)',
|
|
38
39
|
backdropFilter: 'blur(3px)',
|
package/AppDrawer.style.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
9
9
|
endIcon?: import("react").ReactNode;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
11
11
|
href?: string | undefined;
|
|
12
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
12
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
|
|
13
13
|
startIcon?: import("react").ReactNode;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
-
variant?: "text" | "outlined" | "contained" | undefined;
|
|
15
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
|
|
16
16
|
} & Omit<{
|
|
17
17
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
18
18
|
centerRipple?: boolean | undefined;
|
|
@@ -46,8 +46,8 @@ export declare const DrawerButtonTypography: import("@emotion/styled").StyledCom
|
|
|
46
46
|
noWrap?: boolean | undefined;
|
|
47
47
|
paragraph?: boolean | undefined;
|
|
48
48
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
49
|
-
variant?: "
|
|
50
|
-
variantMapping?: Partial<Record<"
|
|
49
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
50
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
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>, {}, {}>;
|
package/cjs/App.js
CHANGED
|
@@ -12,9 +12,9 @@ const Initializer_1 = require("./components/Initializer");
|
|
|
12
12
|
const PoweredBy_1 = require("./components/PoweredBy");
|
|
13
13
|
const SwapRoutes_1 = require("./components/SwapRoutes");
|
|
14
14
|
const hooks_1 = require("./hooks");
|
|
15
|
-
exports.App = (0, react_1.forwardRef)(({ elementRef, open, ...other }, ref) => {
|
|
16
|
-
const config = (0, react_1.useMemo)(() => ({ ...other, ...other.config }), [other]);
|
|
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, config: config, open: open }));
|
|
15
|
+
exports.App = (0, react_1.forwardRef)(({ elementRef, open, integrator, ...other }, ref) => {
|
|
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 }));
|
|
18
18
|
});
|
|
19
19
|
const AppDefault = () => {
|
|
20
20
|
const expandable = (0, hooks_1.useExpandableVariant)();
|
package/cjs/AppDrawer.js
CHANGED
|
@@ -10,7 +10,7 @@ const react_i18next_1 = require("react-i18next");
|
|
|
10
10
|
const App_1 = require("./App");
|
|
11
11
|
const AppDrawer_style_1 = require("./AppDrawer.style");
|
|
12
12
|
const AppProvider_1 = require("./AppProvider");
|
|
13
|
-
exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, config }, ref) => {
|
|
13
|
+
exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, integrator, config }, ref) => {
|
|
14
14
|
const openRef = (0, react_1.useRef)(open);
|
|
15
15
|
const [drawerOpen, setDrawerOpen] = (0, react_1.useState)(Boolean(open));
|
|
16
16
|
const toggleDrawer = (0, react_1.useCallback)(() => {
|
|
@@ -30,12 +30,13 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, config }, ref)
|
|
|
30
30
|
}), [closeDrawer, openDrawer, toggleDrawer]);
|
|
31
31
|
const drawerConfig = (0, react_1.useMemo)(() => ({
|
|
32
32
|
...config,
|
|
33
|
+
integrator,
|
|
33
34
|
containerStyle: {
|
|
34
35
|
...config?.containerStyle,
|
|
35
36
|
height: '100%',
|
|
36
37
|
},
|
|
37
|
-
}), [config]);
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, { 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: {
|
|
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
40
|
sx: {
|
|
40
41
|
backgroundColor: 'rgb(0 0 0 / 48%)',
|
|
41
42
|
backdropFilter: 'blur(3px)',
|
package/cjs/AppDrawer.style.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
9
9
|
endIcon?: import("react").ReactNode;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
11
11
|
href?: string | undefined;
|
|
12
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
12
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
|
|
13
13
|
startIcon?: import("react").ReactNode;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
-
variant?: "text" | "outlined" | "contained" | undefined;
|
|
15
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
|
|
16
16
|
} & Omit<{
|
|
17
17
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
18
18
|
centerRipple?: boolean | undefined;
|
|
@@ -46,8 +46,8 @@ export declare const DrawerButtonTypography: import("@emotion/styled").StyledCom
|
|
|
46
46
|
noWrap?: boolean | undefined;
|
|
47
47
|
paragraph?: boolean | undefined;
|
|
48
48
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
49
|
-
variant?: "
|
|
50
|
-
variantMapping?: Partial<Record<"
|
|
49
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
50
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
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>, {}, {}>;
|
|
@@ -39,17 +39,17 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
export declare const ShowAllButton: import("@emotion/styled").StyledComponent<{
|
|
40
40
|
children?: import("react").ReactNode;
|
|
41
41
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
42
|
-
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
42
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
|
|
43
43
|
disabled?: boolean | undefined;
|
|
44
44
|
disableElevation?: boolean | undefined;
|
|
45
45
|
disableFocusRipple?: boolean | undefined;
|
|
46
46
|
endIcon?: import("react").ReactNode;
|
|
47
47
|
fullWidth?: boolean | undefined;
|
|
48
48
|
href?: string | undefined;
|
|
49
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
49
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
|
|
50
50
|
startIcon?: import("react").ReactNode;
|
|
51
51
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
52
|
-
variant?: "text" | "outlined" | "contained" | undefined;
|
|
52
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
|
|
53
53
|
} & Omit<{
|
|
54
54
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
55
55
|
centerRipple?: boolean | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CardIconButton: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").IconButtonPropsColorOverrides> | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
disableFocusRipple?: boolean | undefined;
|
|
8
|
+
edge?: false | "end" | "start" | undefined;
|
|
9
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").IconButtonPropsSizeOverrides> | undefined;
|
|
10
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
|
+
} & Omit<{
|
|
12
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
13
|
+
centerRipple?: boolean | undefined;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
disableRipple?: boolean | undefined;
|
|
18
|
+
disableTouchRipple?: boolean | undefined;
|
|
19
|
+
focusRipple?: boolean | undefined;
|
|
20
|
+
focusVisibleClassName?: string | undefined;
|
|
21
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
22
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
23
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
26
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
27
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
28
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
+
}, 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>, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardIconButton = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
exports.CardIconButton = (0, styles_1.styled)(material_1.IconButton)(({ theme }) => {
|
|
7
|
+
const backgroundColor = theme.palette.mode === 'light'
|
|
8
|
+
? theme.palette.common.black
|
|
9
|
+
: theme.palette.common.white;
|
|
10
|
+
return {
|
|
11
|
+
padding: theme.spacing(0.5),
|
|
12
|
+
backgroundColor: (0, styles_1.alpha)(backgroundColor, 0.04),
|
|
13
|
+
'&:hover': {
|
|
14
|
+
backgroundColor: (0, styles_1.alpha)(backgroundColor, 0.08),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CardLabel: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
component?: import("react").ElementType<any> | undefined;
|
|
5
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
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
|
+
type?: "active" | "insurance" | "insurance-icon" | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export declare const CardLabelTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
13
|
+
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
16
|
+
gutterBottom?: boolean | undefined;
|
|
17
|
+
noWrap?: boolean | undefined;
|
|
18
|
+
paragraph?: boolean | undefined;
|
|
19
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
20
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
21
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
22
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
23
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
24
|
+
}, 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> & {
|
|
25
|
+
type?: "icon" | undefined;
|
|
26
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardLabelTypography = exports.CardLabel = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
exports.CardLabel = (0, styles_1.styled)(material_1.Box, {
|
|
7
|
+
shouldForwardProp: (prop) => prop !== 'type',
|
|
8
|
+
})(({ theme, type }) => ({
|
|
9
|
+
backgroundColor: type === 'active'
|
|
10
|
+
? theme.palette.mode === 'light'
|
|
11
|
+
? theme.palette.secondary.main
|
|
12
|
+
: (0, styles_1.alpha)(theme.palette.secondary.main, 0.32)
|
|
13
|
+
: type?.includes('insurance')
|
|
14
|
+
? (0, styles_1.alpha)(theme.palette.success.main, theme.palette.mode === 'light' ? 0.12 : 0.24)
|
|
15
|
+
: theme.palette.mode === 'light'
|
|
16
|
+
? (0, styles_1.alpha)(theme.palette.common.black, 0.12)
|
|
17
|
+
: (0, styles_1.alpha)(theme.palette.common.white, 0.16),
|
|
18
|
+
borderRadius: theme.shape.borderRadius,
|
|
19
|
+
color: type?.includes('insurance')
|
|
20
|
+
? (0, styles_1.lighten)(theme.palette.success.main, theme.palette.mode === 'light' ? 0 : 0.24)
|
|
21
|
+
: theme.palette.text.primary,
|
|
22
|
+
padding: type === 'insurance' ? theme.spacing(0, 1.5) : 0,
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
height: 24,
|
|
27
|
+
minWidth: 24,
|
|
28
|
+
userSelect: 'none',
|
|
29
|
+
fontSize: '1rem',
|
|
30
|
+
marginRight: theme.spacing(1),
|
|
31
|
+
}));
|
|
32
|
+
exports.CardLabelTypography = (0, styles_1.styled)(material_1.Typography, {
|
|
33
|
+
shouldForwardProp: (prop) => prop !== 'type',
|
|
34
|
+
})(({ theme, type }) => ({
|
|
35
|
+
padding: type === 'icon'
|
|
36
|
+
? theme.spacing(0.75, 0, 0.75, 0.75)
|
|
37
|
+
: theme.spacing(0.75, 1.5),
|
|
38
|
+
fontSize: 12,
|
|
39
|
+
lineHeight: 1,
|
|
40
|
+
fontWeight: '600',
|
|
41
|
+
textTransform: 'lowercase',
|
|
42
|
+
'&::first-letter': {
|
|
43
|
+
textTransform: 'uppercase',
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
@@ -7,8 +7,8 @@ export declare const CardTitle: import("@emotion/styled").StyledComponent<import
|
|
|
7
7
|
noWrap?: boolean | undefined;
|
|
8
8
|
paragraph?: boolean | undefined;
|
|
9
9
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
10
|
-
variant?: "
|
|
11
|
-
variantMapping?: Partial<Record<"
|
|
10
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
12
12
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
13
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
14
14
|
}, 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> & {
|
|
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Card"), exports);
|
|
18
18
|
__exportStar(require("./CardHeader"), exports);
|
|
19
|
+
__exportStar(require("./CardIconButton"), exports);
|
|
20
|
+
__exportStar(require("./CardLabel"), exports);
|
|
19
21
|
__exportStar(require("./CardTitle"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FundsSufficiencyMessage: () => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FundsSufficiencyMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const WarningRounded_1 = require("@mui/icons-material/WarningRounded");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const GasMessage_style_1 = require("./GasMessage.style");
|
|
9
|
+
const FundsSufficiencyMessage = () => {
|
|
10
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(GasMessage_style_1.WarningMessageCard, { display: "flex", children: [(0, jsx_runtime_1.jsx)(GasMessage_style_1.WarningMessageCardTitle, { children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { sx: {
|
|
12
|
+
marginTop: 2,
|
|
13
|
+
marginLeft: 2,
|
|
14
|
+
} }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", px: 2, pb: 2, pt: 2, children: t(`swap.warning.message.insufficientFunds`) })] }));
|
|
15
|
+
};
|
|
16
|
+
exports.FundsSufficiencyMessage = FundsSufficiencyMessage;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Route } from '@lifi/sdk';
|
|
3
3
|
import type { BoxProps } from '@mui/material';
|
|
4
|
-
|
|
4
|
+
interface GasMessageProps extends BoxProps {
|
|
5
5
|
route?: Route;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export declare const GasMessage: React.FC<GasMessageProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const hooks_1 = require("../../hooks");
|
|
7
|
+
const stores_1 = require("../../stores");
|
|
8
|
+
const FundsSufficiencyMessage_1 = require("./FundsSufficiencyMessage");
|
|
9
|
+
const GasSufficiencyMessage_1 = require("./GasSufficiencyMessage");
|
|
10
|
+
const GasMessage = ({ route, ...props }) => {
|
|
11
|
+
const { insufficientGas } = (0, hooks_1.useGasSufficiency)(route);
|
|
12
|
+
const { insufficientFunds } = (0, hooks_1.useFundsSufficiency)(route);
|
|
13
|
+
const { enabledAutoRefuel } = (0, stores_1.useSettings)(['enabledAutoRefuel']);
|
|
14
|
+
const { enabled, isLoading: isRefuelLoading } = (0, hooks_1.useGasRefuel)();
|
|
15
|
+
const enabledRefuel = enabled && enabledAutoRefuel;
|
|
16
|
+
const showGasSufficiencyMessage = insufficientGas?.length && !isRefuelLoading && !enabledRefuel;
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: Boolean(insufficientFunds || showGasSufficiencyMessage), unmountOnExit: true, mountOnEnter: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { ...props, children: insufficientFunds ? ((0, jsx_runtime_1.jsx)(FundsSufficiencyMessage_1.FundsSufficiencyMessage, {})) : showGasSufficiencyMessage ? ((0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, { insufficientGas: insufficientGas })) : null }) }));
|
|
18
|
+
};
|
|
19
|
+
exports.GasMessage = GasMessage;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const WarningMessageCard: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
component?: import("react").ElementType<any> | undefined;
|
|
5
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
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
|
+
export declare const WarningMessageCardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
11
|
+
children?: import("react").ReactNode;
|
|
12
|
+
component?: import("react").ElementType<any> | undefined;
|
|
13
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
14
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
17
|
+
}, "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>, {}, {}>;
|
|
18
|
+
export declare const InfoMessageCard: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
19
|
+
children?: import("react").ReactNode;
|
|
20
|
+
component?: import("react").ElementType<any> | undefined;
|
|
21
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
22
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
23
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
25
|
+
}, "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>, {}, {}>;
|
|
26
|
+
export declare const InfoMessageCardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
component?: import("react").ElementType<any> | undefined;
|
|
29
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
30
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
31
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
32
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
33
|
+
}, "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>, {}, {}>;
|
|
34
|
+
export declare const InfoMessageSwitch: import("@emotion/styled").StyledComponent<import("@mui/material").SwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InfoMessageSwitch = exports.InfoMessageCardTitle = exports.InfoMessageCard = exports.WarningMessageCardTitle = exports.WarningMessageCard = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const Switch_1 = require("@mui/material/Switch");
|
|
7
|
+
const Switch_2 = require("../Switch");
|
|
8
|
+
const MessageCard = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
9
|
+
borderRadius: theme.shape.borderRadius,
|
|
10
|
+
position: 'relative',
|
|
11
|
+
whiteSpace: 'pre-line',
|
|
12
|
+
}));
|
|
13
|
+
exports.WarningMessageCard = (0, styles_1.styled)(MessageCard)(({ theme }) => ({
|
|
14
|
+
backgroundColor: theme.palette.mode === 'light'
|
|
15
|
+
? (0, styles_1.alpha)(theme.palette.warning.main, 0.32)
|
|
16
|
+
: (0, styles_1.alpha)(theme.palette.warning.main, 0.16),
|
|
17
|
+
}));
|
|
18
|
+
exports.WarningMessageCardTitle = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
19
|
+
color: theme.palette.mode === 'light'
|
|
20
|
+
? (0, styles_1.darken)(theme.palette.warning.main, 0.36)
|
|
21
|
+
: (0, styles_1.alpha)(theme.palette.warning.main, 1),
|
|
22
|
+
}));
|
|
23
|
+
exports.InfoMessageCard = (0, styles_1.styled)(MessageCard)(({ theme }) => ({
|
|
24
|
+
backgroundColor: theme.palette.mode === 'light'
|
|
25
|
+
? (0, styles_1.alpha)(theme.palette.info.main, 0.12)
|
|
26
|
+
: (0, styles_1.alpha)(theme.palette.info.main, 0.16),
|
|
27
|
+
}));
|
|
28
|
+
exports.InfoMessageCardTitle = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
29
|
+
color: theme.palette.mode === 'light'
|
|
30
|
+
? theme.palette.info.main
|
|
31
|
+
: (0, styles_1.lighten)(theme.palette.info.main, 0.24),
|
|
32
|
+
}));
|
|
33
|
+
exports.InfoMessageSwitch = (0, styles_1.styled)(Switch_2.Switch)(({ theme }) => ({
|
|
34
|
+
[`.${Switch_1.switchClasses.switchBase}`]: {
|
|
35
|
+
[`&.${Switch_1.switchClasses.checked}`]: {
|
|
36
|
+
[`& + .${Switch_1.switchClasses.track}`]: {
|
|
37
|
+
backgroundColor: theme.palette.mode === 'light'
|
|
38
|
+
? theme.palette.info.main
|
|
39
|
+
: (0, styles_1.alpha)(theme.palette.info.main, 0.84),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
[`&.Mui-focusVisible .${Switch_1.switchClasses.thumb}`]: {
|
|
43
|
+
color: theme.palette.mode === 'light'
|
|
44
|
+
? theme.palette.info.main
|
|
45
|
+
: (0, styles_1.alpha)(theme.palette.info.main, 0.84),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasRefuelMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
const stores_1 = require("../../stores");
|
|
10
|
+
const GasMessage_style_1 = require("./GasMessage.style");
|
|
11
|
+
const GasRefuelMessage = (props) => {
|
|
12
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
|
+
const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
|
|
14
|
+
const { enabledAutoRefuel } = (0, stores_1.useSettings)(['enabledAutoRefuel']);
|
|
15
|
+
const { enabled, chain, isLoading: isRefuelLoading } = (0, hooks_1.useGasRefuel)();
|
|
16
|
+
const onChange = (_, checked) => {
|
|
17
|
+
setValue('enabledAutoRefuel', checked);
|
|
18
|
+
};
|
|
19
|
+
const showGasRefuelMessage = chain && enabled && !isRefuelLoading;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: showGasRefuelMessage, unmountOnExit: true, mountOnEnter: true, children: (0, jsx_runtime_1.jsxs)(GasMessage_style_1.InfoMessageCard, { ...props, children: [(0, jsx_runtime_1.jsxs)(GasMessage_style_1.InfoMessageCardTitle, { display: "flex", alignItems: "center", justifyContent: "space-between", p: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(EvStation_1.default, { sx: {
|
|
21
|
+
marginRight: 1,
|
|
22
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 700, children: t(`swap.info.title.autoRefuel`) })] }), (0, jsx_runtime_1.jsx)(GasMessage_style_1.InfoMessageSwitch, { checked: enabledAutoRefuel, onChange: onChange })] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: enabledAutoRefuel, unmountOnExit: true, mountOnEnter: true, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", px: 2, pb: 2, children: t(`swap.info.message.autoRefuel`, {
|
|
23
|
+
chainName: chain?.name,
|
|
24
|
+
}) }) })] }) }));
|
|
25
|
+
};
|
|
26
|
+
exports.GasRefuelMessage = GasRefuelMessage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasSufficiencyMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const GasMessage_style_1 = require("./GasMessage.style");
|
|
9
|
+
const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
10
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(GasMessage_style_1.WarningMessageCard, { children: [(0, jsx_runtime_1.jsxs)(GasMessage_style_1.WarningMessageCardTitle, { display: "flex", alignItems: "center", px: 2, pt: 2, children: [(0, jsx_runtime_1.jsx)(EvStation_1.default, { sx: {
|
|
12
|
+
marginRight: 1,
|
|
13
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 700, children: t(`swap.warning.title.insufficientGas`) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", px: 2, pt: 1, children: t(`swap.warning.message.insufficientGas`) }), insufficientGas?.map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography
|
|
14
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
15
|
+
, { variant: "body2", px: 2, pb: insufficientGas?.length - 1 === index ? 2 : 0, pt: 0.5, children: t(`swap.tokenOnChainAmount`, {
|
|
16
|
+
amount: item.insufficientAmount?.toString(),
|
|
17
|
+
tokenSymbol: item.token.symbol,
|
|
18
|
+
chainName: item.chain?.name,
|
|
19
|
+
}) }, index)))] }));
|
|
20
|
+
};
|
|
21
|
+
exports.GasSufficiencyMessage = GasSufficiencyMessage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./GasMessage"), exports);
|
|
18
|
+
__exportStar(require("./GasRefuelMessage"), exports);
|