@lifi/widget 4.0.0 → 4.2.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/dist/esm/App.d.ts +4 -2
- package/dist/esm/App.d.ts.map +1 -1
- package/dist/esm/App.js +4 -4
- package/dist/esm/App.js.map +1 -1
- package/dist/esm/AppDefault.js +14 -0
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.d.ts +1 -1
- package/dist/esm/AppDrawer.d.ts.map +1 -1
- package/dist/esm/AppDrawer.js +5 -6
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/AppDrawerContext.js +2 -2
- package/dist/esm/AppDrawerContext.js.map +1 -1
- package/dist/esm/components/ActionRow/ActionRow.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +2 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +4 -2
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js +98 -0
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js +25 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js +35 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js +11 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js +41 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js +80 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js +43 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js +137 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js.map +1 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js +102 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js.map +1 -0
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +12 -3
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +1 -0
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +3 -3
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.js.map +1 -1
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.js.map +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/Card/InputCard.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -1
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +2 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/ContextMenu.style.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.style.js.map +1 -1
- package/dist/esm/components/EmptyListIndicator/EmptyListIndicator.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/iconKey.js.map +1 -1
- package/dist/esm/components/Expansion/Expansion.style.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js +1 -0
- package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
- package/dist/esm/components/Header/Header.js +7 -10
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/HeaderNavigationTabs.js +39 -0
- package/dist/esm/components/Header/HeaderNavigationTabs.js.map +1 -0
- package/dist/esm/components/Header/HeaderTabs.js +33 -0
- package/dist/esm/components/Header/HeaderTabs.js.map +1 -0
- package/dist/esm/components/Header/NavigationHeader.js +7 -5
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
- package/dist/esm/components/IconTypography.js.map +1 -1
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js +99 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js.map +1 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js +52 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js +115 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js +89 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js +91 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js.map +1 -0
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItem/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/Menu.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/PageContainer.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +1 -0
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.style.js +2 -2
- package/dist/esm/components/RouteCard/RouteDetails.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteProviderCard.js +118 -0
- package/dist/esm/components/RouteCard/RouteProviderCard.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteToken.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/LimitOrderRoutes.js +34 -0
- package/dist/esm/components/Routes/LimitOrderRoutes.js.map +1 -0
- package/dist/esm/components/Routes/Routes.js +2 -2
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.style.js.map +1 -1
- package/dist/esm/components/SettingsListItemButton.js.map +1 -1
- package/dist/esm/components/SettingsPanel/SettingsPanel.js +51 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.js.map +1 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js +33 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js.map +1 -0
- package/dist/esm/components/SettingsPanel/utils.js +14 -0
- package/dist/esm/components/SettingsPanel/utils.js.map +1 -0
- package/dist/esm/components/Skeleton/WidgetSkeleton.js +50 -47
- package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js.map +1 -1
- package/dist/esm/components/Step/StepActions.style.js.map +1 -1
- package/dist/esm/components/StepActions/SentToWalletRow.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActionRow.style.js.map +1 -1
- package/dist/esm/components/SwapButton/SwapButton.js +50 -0
- package/dist/esm/components/SwapButton/SwapButton.js.map +1 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js +24 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js.map +1 -0
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.js +3 -0
- package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/StepStatusTimer.style.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +2 -2
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.js +3 -3
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenPillButton/TokenPillButton.js +52 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.js.map +1 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js +39 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js.map +1 -0
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/TransactionCard.style.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/validate.js.map +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +1 -1
- package/dist/esm/hooks/useChainSearch.js +2 -1
- package/dist/esm/hooks/useChainSearch.js.map +1 -1
- package/dist/esm/hooks/useChains.js +1 -1
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useLanguages.js +2 -2
- package/dist/esm/hooks/useLanguages.js.map +1 -1
- package/dist/esm/hooks/useLimitMarketRate.js +24 -0
- package/dist/esm/hooks/useLimitMarketRate.js.map +1 -0
- package/dist/esm/hooks/useLinkedLimitFields.js +49 -0
- package/dist/esm/hooks/useLinkedLimitFields.js.map +1 -0
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
- package/dist/esm/hooks/useRouteRequiredAccountConnection.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +23 -6
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useSwapOnly.js +2 -4
- package/dist/esm/hooks/useSwapOnly.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +2 -2
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +1 -1
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +17 -15
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js.map +1 -1
- package/dist/esm/hooks/useWideVariant.js +5 -2
- package/dist/esm/hooks/useWideVariant.js.map +1 -1
- package/dist/esm/i18n/en.json +25 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/LimitPageContent.js +23 -0
- package/dist/esm/pages/MainPage/LimitPageContent.js.map +1 -0
- package/dist/esm/pages/MainPage/MainPage.js +19 -22
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPageActions.js +28 -0
- package/dist/esm/pages/MainPage/MainPageActions.js.map +1 -0
- package/dist/esm/pages/MainPage/ReviewButton.js +11 -4
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutePriorityPage.js +48 -0
- package/dist/esm/pages/RoutePriorityPage.js.map +1 -0
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -2
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +12 -27
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js +133 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js.map +1 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +14 -72
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +26 -14
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +4 -0
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +16 -15
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +27 -31
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js +4 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/enResource.d.ts +1 -1
- package/dist/esm/providers/I18nProvider/enResource.js +1 -1
- package/dist/esm/providers/I18nProvider/i18n.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +2 -2
- package/dist/esm/providers/QueryClientProvider.js +2 -2
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/SDKClientProvider.js +3 -3
- package/dist/esm/providers/SDKClientProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js +4 -5
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/dist/esm/stores/StoreProvider.js +3 -4
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js +3 -3
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +4 -4
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +1 -1
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +14 -3
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/createFormStore.js +6 -2
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +3 -0
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -1
- package/dist/esm/stores/form/types.d.ts +9 -1
- package/dist/esm/stores/form/types.d.ts.map +1 -1
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/form/useClearAmountFields.js +1 -0
- package/dist/esm/stores/form/useClearAmountFields.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.js.map +1 -1
- package/dist/esm/stores/form/useFieldValues.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/form/useFormStore.js +2 -2
- package/dist/esm/stores/form/useFormStore.js.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.js.map +1 -1
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js +22 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js.map +1 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js +64 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js.map +1 -0
- package/dist/esm/stores/navigationTabs/utils.js +122 -0
- package/dist/esm/stores/navigationTabs/utils.js.map +1 -0
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +3 -3
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js +3 -3
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/useIntermediateRoutesStore.js.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/routes/utils.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.js +3 -3
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.js +122 -96
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +0 -2
- package/dist/esm/stores/settings/types.d.ts.map +1 -1
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/themes/createTheme.js.map +1 -1
- package/dist/esm/themes/utils.js.map +1 -1
- package/dist/esm/types/events.d.ts +10 -1
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/events.js +2 -0
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/widget.d.ts +28 -2
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.d.ts +1 -1
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/format.js +2 -2
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/getActionMessage.js.map +1 -1
- package/dist/esm/utils/getErrorMessage.js.map +1 -1
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/limitOrder.js +61 -0
- package/dist/esm/utils/limitOrder.js.map +1 -0
- package/dist/esm/utils/{variant.js → mode.js} +2 -2
- package/dist/esm/utils/mode.js.map +1 -0
- package/dist/esm/utils/navigationRoutes.d.ts +2 -0
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
- package/dist/esm/utils/navigationRoutes.js +6 -0
- package/dist/esm/utils/navigationRoutes.js.map +1 -1
- package/dist/esm/utils/prepareActions.js +1 -1
- package/dist/esm/utils/prepareActions.js.map +1 -1
- package/dist/esm/utils/timer.js.map +1 -1
- package/dist/esm/utils/token.js +1 -1
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +13 -13
- package/src/App.tsx +7 -7
- package/src/AppDefault.tsx +16 -0
- package/src/AppDrawer.tsx +77 -78
- package/src/AppDrawerContext.ts +2 -2
- package/src/components/AmountInput/AmountInputEndAdornment.style.ts +1 -1
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +5 -2
- package/src/components/AmountInputCard/AmountInputCard.style.tsx +157 -0
- package/src/components/AmountInputCard/AmountInputCardPair.tsx +25 -0
- package/src/components/AmountInputCard/BalanceDisplay.style.tsx +9 -0
- package/src/components/AmountInputCard/BalanceDisplay.tsx +46 -0
- package/src/components/AmountInputCard/FiatValueToggle.tsx +55 -0
- package/src/components/AmountInputCard/PercentageChips.style.tsx +60 -0
- package/src/components/AmountInputCard/PercentageChips.tsx +100 -0
- package/src/components/AmountInputCard/ReceiveAmountCard.tsx +219 -0
- package/src/components/AmountInputCard/SendAmountCard.tsx +179 -0
- package/src/components/Avatar/Avatar.tsx +8 -3
- package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +1 -0
- package/src/components/BottomSheet/BottomSheet.tsx +56 -52
- package/src/components/Header/CloseDrawerButton.tsx +5 -1
- package/src/components/Header/Header.tsx +20 -18
- package/src/components/Header/HeaderNavigationTabs.tsx +42 -0
- package/src/components/Header/HeaderTabs.tsx +48 -0
- package/src/components/Header/NavigationHeader.tsx +11 -8
- package/src/components/LimitOrderSettings/LimitOrderSettings.style.tsx +69 -0
- package/src/components/LimitOrderSettings/LimitOrderSettings.tsx +124 -0
- package/src/components/LimitPriceCard/LimitPriceCard.style.tsx +103 -0
- package/src/components/LimitPriceCard/LimitPriceCard.tsx +153 -0
- package/src/components/LimitPriceCard/LimitPricePresets.tsx +139 -0
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +4 -1
- package/src/components/RouteCard/RouteProviderCard.tsx +113 -0
- package/src/components/Routes/LimitOrderRoutes.tsx +64 -0
- package/src/components/Routes/Routes.tsx +3 -2
- package/src/components/SettingsPanel/SettingsPanel.style.tsx +41 -0
- package/src/components/SettingsPanel/SettingsPanel.tsx +73 -0
- package/src/components/SettingsPanel/utils.ts +27 -0
- package/src/components/Skeleton/WidgetSkeleton.tsx +1 -1
- package/src/components/SwapButton/SwapButton.style.tsx +28 -0
- package/src/components/SwapButton/SwapButton.tsx +71 -0
- package/src/components/Tabs/NavigationTabs.tsx +3 -0
- package/src/components/TokenList/TokenDetailsSheet.tsx +9 -7
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +176 -177
- package/src/components/TokenList/useTokenSelect.ts +2 -2
- package/src/components/TokenPillButton/TokenPillButton.style.tsx +50 -0
- package/src/components/TokenPillButton/TokenPillButton.tsx +81 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useLimitMarketRate.ts +39 -0
- package/src/hooks/useLinkedLimitFields.ts +74 -0
- package/src/hooks/useRoutes.ts +45 -4
- package/src/hooks/useSwapOnly.ts +2 -5
- package/src/hooks/useToAddressRequirements.ts +2 -2
- package/src/hooks/useWideVariant.ts +8 -2
- package/src/pages/MainPage/LimitPageContent.tsx +18 -0
- package/src/pages/MainPage/MainPage.tsx +43 -30
- package/src/pages/MainPage/MainPageActions.tsx +35 -0
- package/src/pages/MainPage/ReviewButton.tsx +15 -3
- package/src/pages/RoutePriorityPage.tsx +55 -0
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +176 -185
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +9 -6
- package/src/pages/SettingsPage/RoutePrioritySettings.tsx +14 -38
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +58 -65
- package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +4 -4
- package/src/pages/SettingsPage/SlippageSettings/SlippagePage.tsx +176 -0
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +32 -25
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +14 -128
- package/src/pages/SettingsPage/ThemeSettings.tsx +4 -0
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +9 -6
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +53 -58
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +24 -21
- package/src/pages/TransactionPage/TransactionExecutionContent.tsx +8 -6
- package/src/providers/QueryClientProvider.tsx +2 -2
- package/src/providers/SDKClientProvider.tsx +3 -7
- package/src/providers/WidgetProvider/WidgetProvider.tsx +6 -7
- package/src/stores/StoreProvider.tsx +3 -10
- package/src/stores/bookmarks/BookmarkStore.tsx +4 -4
- package/src/stores/chains/ChainOrderStore.tsx +4 -4
- package/src/stores/form/FormStore.tsx +2 -2
- package/src/stores/form/URLSearchParamsBuilder.tsx +25 -3
- package/src/stores/form/createFormStore.ts +7 -3
- package/src/stores/form/getDefaultValuesFromQueryString.ts +11 -0
- package/src/stores/form/types.ts +14 -1
- package/src/stores/form/useClearAmountFields.ts +1 -0
- package/src/stores/form/useFormStore.ts +2 -2
- package/src/stores/header/useHeaderStore.tsx +3 -5
- package/src/stores/navigationTabs/types.ts +33 -0
- package/src/stores/navigationTabs/useNavigationTabLabel.ts +28 -0
- package/src/stores/navigationTabs/useNavigationTabsStore.tsx +113 -0
- package/src/stores/navigationTabs/utils.ts +196 -0
- package/src/stores/pinnedTokens/PinnedTokensStore.tsx +4 -4
- package/src/stores/routes/RouteExecutionStore.tsx +4 -4
- package/src/stores/settings/SettingsStore.tsx +4 -4
- package/src/stores/settings/createSettingsStore.ts +48 -12
- package/src/stores/settings/types.ts +1 -16
- package/src/types/events.ts +12 -0
- package/src/types/widget.ts +40 -1
- package/src/utils/format.ts +6 -2
- package/src/utils/limitOrder.ts +88 -0
- package/src/utils/navigationRoutes.ts +6 -0
- package/dist/esm/components/Header/SplitNavigationTabs.js +0 -33
- package/dist/esm/components/Header/SplitNavigationTabs.js.map +0 -1
- package/dist/esm/stores/settings/useSplitModeStore.js +0 -36
- package/dist/esm/stores/settings/useSplitModeStore.js.map +0 -1
- package/dist/esm/utils/variant.js.map +0 -1
- package/src/components/Header/SplitNavigationTabs.tsx +0 -32
- package/src/stores/settings/useSplitModeStore.tsx +0 -58
- /package/src/utils/{variant.ts → mode.ts} +0 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DefaultUI,
|
|
3
|
+
InternalNavigationTabKey,
|
|
4
|
+
ModeOptions,
|
|
5
|
+
NavigationTabKey,
|
|
6
|
+
RequiredUIConfig,
|
|
7
|
+
SplitMode,
|
|
8
|
+
SplitNavigationTabKey,
|
|
9
|
+
WidgetConfig,
|
|
10
|
+
WidgetMode,
|
|
11
|
+
WidgetVariant,
|
|
12
|
+
} from '../../types/widget.js'
|
|
13
|
+
import { getSplitMode } from '../../utils/mode.js'
|
|
14
|
+
import type { NavigationTab } from './types.js'
|
|
15
|
+
|
|
16
|
+
/** Configured navigation tabs by key. Labels are resolved from the key by a hook. */
|
|
17
|
+
const navigationTabsByKey: Record<InternalNavigationTabKey, NavigationTab> = {
|
|
18
|
+
default: {
|
|
19
|
+
key: 'default',
|
|
20
|
+
variant: 'wide',
|
|
21
|
+
mode: 'default',
|
|
22
|
+
defaultUI: {
|
|
23
|
+
layout: 'cards',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
private: {
|
|
27
|
+
key: 'private',
|
|
28
|
+
variant: 'compact',
|
|
29
|
+
mode: 'default',
|
|
30
|
+
defaultUI: {
|
|
31
|
+
layout: 'cards',
|
|
32
|
+
},
|
|
33
|
+
requiredUI: { toAddress: true },
|
|
34
|
+
},
|
|
35
|
+
refuel: {
|
|
36
|
+
key: 'refuel',
|
|
37
|
+
variant: 'wide',
|
|
38
|
+
mode: 'refuel',
|
|
39
|
+
defaultUI: {
|
|
40
|
+
layout: 'cards',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
limit: {
|
|
44
|
+
key: 'limit',
|
|
45
|
+
variant: 'compact',
|
|
46
|
+
mode: 'limit',
|
|
47
|
+
defaultUI: {
|
|
48
|
+
layout: 'cards',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
'swap-advanced': {
|
|
52
|
+
key: 'swap-advanced',
|
|
53
|
+
variant: 'wide',
|
|
54
|
+
mode: 'split',
|
|
55
|
+
modeOptions: { split: 'swap' },
|
|
56
|
+
defaultUI: {
|
|
57
|
+
layout: 'cards',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
'bridge-advanced': {
|
|
61
|
+
key: 'bridge-advanced',
|
|
62
|
+
variant: 'wide',
|
|
63
|
+
mode: 'split',
|
|
64
|
+
modeOptions: { split: 'bridge' },
|
|
65
|
+
defaultUI: {
|
|
66
|
+
layout: 'cards',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Split-mode tabs (Swap / Bridge), shown when no navigation tabs are configured. */
|
|
72
|
+
const splitTabs: NavigationTab[] = [
|
|
73
|
+
{
|
|
74
|
+
key: 'swap',
|
|
75
|
+
mode: 'split',
|
|
76
|
+
modeOptions: { split: 'swap' },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'bridge',
|
|
80
|
+
mode: 'split',
|
|
81
|
+
modeOptions: { split: 'bridge' },
|
|
82
|
+
},
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
const splitTabsByKey = Object.fromEntries(
|
|
86
|
+
splitTabs.map((tab) => [tab.key, tab])
|
|
87
|
+
) as Record<SplitNavigationTabKey, NavigationTab>
|
|
88
|
+
|
|
89
|
+
/** Combined lookup across configured and split tabs. */
|
|
90
|
+
const tabByKey: Record<NavigationTabKey, NavigationTab> = {
|
|
91
|
+
...navigationTabsByKey,
|
|
92
|
+
...splitTabsByKey,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Tab keys shown in split mode when no navigation tabs are configured. */
|
|
96
|
+
export const splitTabKeys: NavigationTabKey[] = splitTabs.map((tab) => tab.key)
|
|
97
|
+
|
|
98
|
+
/** Resolves which navigation tabs the header should render from the config. */
|
|
99
|
+
export const getNavigationTabKeys = (
|
|
100
|
+
config: WidgetConfig
|
|
101
|
+
): NavigationTabKey[] => {
|
|
102
|
+
if (config._navigationTabs?.length) {
|
|
103
|
+
return config._navigationTabs
|
|
104
|
+
}
|
|
105
|
+
// Split mode shows Swap / Bridge tabs unless pinned to a single side.
|
|
106
|
+
if (
|
|
107
|
+
config.mode === 'split' &&
|
|
108
|
+
typeof config.modeOptions?.split !== 'string'
|
|
109
|
+
) {
|
|
110
|
+
return splitTabKeys
|
|
111
|
+
}
|
|
112
|
+
return []
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The tab the store seeds as active from the config. With navigation tabs it's
|
|
117
|
+
* the first configured tab; otherwise split mode's selection is itself a tab
|
|
118
|
+
* (`swap`/`bridge`), so it seeds the active tab too.
|
|
119
|
+
*/
|
|
120
|
+
export const getInitialActiveTab = (
|
|
121
|
+
config: WidgetConfig
|
|
122
|
+
): NavigationTabKey | undefined => {
|
|
123
|
+
if (config._navigationTabs?.length) {
|
|
124
|
+
return config._navigationTabs[0]
|
|
125
|
+
}
|
|
126
|
+
return config.mode === 'split'
|
|
127
|
+
? getSplitMode(config.modeOptions?.split)
|
|
128
|
+
: undefined
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Split mode (`swap`/`bridge`) implied by a tab, or `undefined` if not split. */
|
|
132
|
+
export const getTabSplitMode = (
|
|
133
|
+
key?: NavigationTabKey
|
|
134
|
+
): SplitMode | undefined => {
|
|
135
|
+
const tab = key ? tabByKey[key] : undefined
|
|
136
|
+
return tab?.mode === 'split'
|
|
137
|
+
? getSplitMode(tab.modeOptions?.split)
|
|
138
|
+
: undefined
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Variant for a tab, falling back to the widget config's variant when unset. */
|
|
142
|
+
export const getTabVariant = (
|
|
143
|
+
config: WidgetConfig,
|
|
144
|
+
key?: NavigationTabKey
|
|
145
|
+
): WidgetVariant | undefined => {
|
|
146
|
+
const tab = key ? tabByKey[key] : undefined
|
|
147
|
+
return tab?.variant ?? config.variant
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Mode for a tab, falling back to the widget config's mode when unset. */
|
|
151
|
+
export const getTabMode = (
|
|
152
|
+
config: WidgetConfig,
|
|
153
|
+
key?: NavigationTabKey
|
|
154
|
+
): WidgetMode | undefined => {
|
|
155
|
+
const tab = key ? tabByKey[key] : undefined
|
|
156
|
+
return tab?.mode ?? config.mode
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Mode options for a tab, falling back to the widget config's when unset. */
|
|
160
|
+
export const getTabModeOptions = (
|
|
161
|
+
config: WidgetConfig,
|
|
162
|
+
key?: NavigationTabKey
|
|
163
|
+
): ModeOptions | undefined => {
|
|
164
|
+
const tab = key ? tabByKey[key] : undefined
|
|
165
|
+
return tab?.modeOptions ?? config.modeOptions
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Default UI for a tab, layered over the widget config's `defaultUI` so the
|
|
170
|
+
* tab overrides only the fields it sets and inherits the rest.
|
|
171
|
+
*/
|
|
172
|
+
export const getTabDefaultUI = (
|
|
173
|
+
config: WidgetConfig,
|
|
174
|
+
key?: NavigationTabKey
|
|
175
|
+
): DefaultUI | undefined => {
|
|
176
|
+
const tab = key ? tabByKey[key] : undefined
|
|
177
|
+
if (!tab?.defaultUI) {
|
|
178
|
+
return config.defaultUI
|
|
179
|
+
}
|
|
180
|
+
return { ...config.defaultUI, ...tab.defaultUI }
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Required UI for a tab, layered over the widget config's `requiredUI` so the
|
|
185
|
+
* tab overrides only the fields it sets and inherits the rest.
|
|
186
|
+
*/
|
|
187
|
+
export const getTabRequiredUI = (
|
|
188
|
+
config: WidgetConfig,
|
|
189
|
+
key?: NavigationTabKey
|
|
190
|
+
): RequiredUIConfig | undefined => {
|
|
191
|
+
const tab = key ? tabByKey[key] : undefined
|
|
192
|
+
if (!tab?.requiredUI) {
|
|
193
|
+
return config.requiredUI
|
|
194
|
+
}
|
|
195
|
+
return { ...config.requiredUI, ...tab.requiredUI }
|
|
196
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext,
|
|
1
|
+
import { createContext, use, useRef } from 'react'
|
|
2
2
|
import { useShallow } from 'zustand/shallow'
|
|
3
3
|
import type { PersistStoreProviderProps } from '../types.js'
|
|
4
4
|
import { createPinnedTokensStore } from './createPinnedTokensStore.js'
|
|
@@ -17,16 +17,16 @@ export const PinnedTokensStoreProvider: React.FC<PersistStoreProviderProps> = ({
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<PinnedTokensStoreContext
|
|
20
|
+
<PinnedTokensStoreContext value={storeRef.current}>
|
|
21
21
|
{children}
|
|
22
|
-
</PinnedTokensStoreContext
|
|
22
|
+
</PinnedTokensStoreContext>
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export function usePinnedTokensStore<T>(
|
|
27
27
|
selector: (store: PinnedTokensState) => T
|
|
28
28
|
): T {
|
|
29
|
-
const useStore =
|
|
29
|
+
const useStore = use(PinnedTokensStoreContext)
|
|
30
30
|
|
|
31
31
|
if (!useStore) {
|
|
32
32
|
throw new Error(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, type JSX,
|
|
1
|
+
import { createContext, type JSX, use, useRef } from 'react'
|
|
2
2
|
import type { StoreApi, UseBoundStore } from 'zustand'
|
|
3
3
|
import { useShallow } from 'zustand/shallow'
|
|
4
4
|
import type { PersistStoreProviderProps } from '../types.js'
|
|
@@ -20,14 +20,14 @@ export function RouteExecutionStoreProvider({
|
|
|
20
20
|
storeRef.current = createRouteExecutionStore(props)
|
|
21
21
|
}
|
|
22
22
|
return (
|
|
23
|
-
<RouteExecutionStoreContext
|
|
23
|
+
<RouteExecutionStoreContext value={storeRef.current}>
|
|
24
24
|
{children}
|
|
25
|
-
</RouteExecutionStoreContext
|
|
25
|
+
</RouteExecutionStoreContext>
|
|
26
26
|
)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export function useRouteExecutionStoreContext(): any {
|
|
30
|
-
const useStore =
|
|
30
|
+
const useStore = use(RouteExecutionStoreContext)
|
|
31
31
|
if (!useStore) {
|
|
32
32
|
throw new Error(
|
|
33
33
|
`You forgot to wrap your component in <${RouteExecutionStoreProvider.name}>.`
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createContext,
|
|
3
3
|
type JSX,
|
|
4
4
|
type PropsWithChildren,
|
|
5
|
-
|
|
5
|
+
use,
|
|
6
6
|
useRef,
|
|
7
7
|
} from 'react'
|
|
8
8
|
import type { StoreApi, UseBoundStore } from 'zustand'
|
|
@@ -23,14 +23,14 @@ export const SettingsStoreProvider = ({
|
|
|
23
23
|
storeRef.current = createSettingsStore(config)
|
|
24
24
|
}
|
|
25
25
|
return (
|
|
26
|
-
<SettingsStoreContext
|
|
26
|
+
<SettingsStoreContext value={storeRef.current}>
|
|
27
27
|
{children}
|
|
28
|
-
</SettingsStoreContext
|
|
28
|
+
</SettingsStoreContext>
|
|
29
29
|
)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function useSettingsStoreContext(): any {
|
|
33
|
-
const useStore =
|
|
33
|
+
const useStore = use(SettingsStoreContext)
|
|
34
34
|
if (!useStore) {
|
|
35
35
|
throw new Error(
|
|
36
36
|
'You forgot to wrap your component in SettingsStoreContext.'
|
|
@@ -6,7 +6,8 @@ import { allLanguages } from '../../providers/I18nProvider/constants.js'
|
|
|
6
6
|
import { loadLocale } from '../../providers/I18nProvider/i18n.js'
|
|
7
7
|
import type { LanguageKey } from '../../providers/I18nProvider/types.js'
|
|
8
8
|
import type { WidgetConfig } from '../../types/widget.js'
|
|
9
|
-
import
|
|
9
|
+
import { getConfigItemSets, isItemAllowedForSets } from '../../utils/item.js'
|
|
10
|
+
import type { SettingsProps, SettingsState, SettingsToolType } from './types.js'
|
|
10
11
|
import { SettingsToolTypes } from './types.js'
|
|
11
12
|
import { getStateValues } from './utils/getStateValues.js'
|
|
12
13
|
|
|
@@ -35,11 +36,44 @@ const defaultSettings: SettingsProps = {
|
|
|
35
36
|
|
|
36
37
|
export const createSettingsStore = (
|
|
37
38
|
config: WidgetConfig
|
|
38
|
-
): UseBoundStore<StoreApi<SettingsState>> =>
|
|
39
|
-
|
|
39
|
+
): UseBoundStore<StoreApi<SettingsState>> => {
|
|
40
|
+
const configItemsByToolType = {
|
|
41
|
+
Bridges: config.bridges,
|
|
42
|
+
Exchanges: config.exchanges,
|
|
43
|
+
}
|
|
44
|
+
// Tool state from a candidate map, keeping only config-allowed tools.
|
|
45
|
+
const buildToolState = (
|
|
46
|
+
toolType: SettingsToolType,
|
|
47
|
+
enabledMap: Record<string, boolean>
|
|
48
|
+
) => {
|
|
49
|
+
const configItemSets = getConfigItemSets(
|
|
50
|
+
configItemsByToolType[toolType],
|
|
51
|
+
(items) => new Set(items)
|
|
52
|
+
)
|
|
53
|
+
const allowed: Record<string, boolean> = Object.fromEntries(
|
|
54
|
+
Object.entries(enabledMap).filter(([key]) =>
|
|
55
|
+
isItemAllowedForSets(key, configItemSets)
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
const keys = Object.keys(allowed)
|
|
59
|
+
return {
|
|
60
|
+
[`_enabled${toolType}`]: allowed,
|
|
61
|
+
[`enabled${toolType}`]: keys.filter((key) => allowed[key]),
|
|
62
|
+
[`disabled${toolType}`]: keys.filter((key) => !allowed[key]),
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const toEnabledMap = (keys: string[] = []): Record<string, boolean> =>
|
|
66
|
+
Object.fromEntries(keys.map((key) => [key, true] as const))
|
|
67
|
+
// Deny-only configs can't be seeded; the tool universe is unknown until /tools.
|
|
68
|
+
const initialSettings: SettingsProps = {
|
|
69
|
+
...defaultSettings,
|
|
70
|
+
...buildToolState('Bridges', toEnabledMap(config.bridges?.allow)),
|
|
71
|
+
...buildToolState('Exchanges', toEnabledMap(config.exchanges?.allow)),
|
|
72
|
+
}
|
|
73
|
+
return create<SettingsState>()(
|
|
40
74
|
persist(
|
|
41
75
|
(set, get) => ({
|
|
42
|
-
...
|
|
76
|
+
...initialSettings,
|
|
43
77
|
setValue: (key, value) =>
|
|
44
78
|
set(() => ({
|
|
45
79
|
[key]: value,
|
|
@@ -163,15 +197,16 @@ export const createSettingsStore = (
|
|
|
163
197
|
merge: (persistedState: any, currentState: SettingsState) => {
|
|
164
198
|
const state = { ...currentState, ...persistedState }
|
|
165
199
|
SettingsToolTypes.forEach((toolType) => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
200
|
+
const persistedEnabled = persistedState?.[`_enabled${toolType}`]
|
|
201
|
+
if (persistedEnabled) {
|
|
202
|
+
// Overlay persisted toggles on the config allow seed so an empty
|
|
203
|
+
// intersection keeps the allow-list instead of going unrestricted.
|
|
204
|
+
const allowMap = toEnabledMap(
|
|
205
|
+
configItemsByToolType[toolType]?.allow
|
|
172
206
|
)
|
|
173
|
-
|
|
174
|
-
|
|
207
|
+
Object.assign(
|
|
208
|
+
state,
|
|
209
|
+
buildToolState(toolType, { ...allowMap, ...persistedEnabled })
|
|
175
210
|
)
|
|
176
211
|
}
|
|
177
212
|
})
|
|
@@ -217,3 +252,4 @@ export const createSettingsStore = (
|
|
|
217
252
|
}
|
|
218
253
|
)
|
|
219
254
|
)
|
|
255
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Order } from '@lifi/sdk'
|
|
2
|
-
import type { PropsWithChildren } from 'react'
|
|
3
|
-
import type { StoreApi, UseBoundStore } from 'zustand'
|
|
4
2
|
import type { LanguageResource } from '../../providers/I18nProvider/types.js'
|
|
5
|
-
import type {
|
|
3
|
+
import type { WidgetConfig } from '../../types/widget.js'
|
|
6
4
|
|
|
7
5
|
export type ValueSetter<S> = <K extends keyof S>(
|
|
8
6
|
key: K,
|
|
@@ -48,19 +46,6 @@ export interface SettingsActions {
|
|
|
48
46
|
|
|
49
47
|
export type SettingsState = SettingsProps & SettingsActions
|
|
50
48
|
|
|
51
|
-
export interface SplitModeState {
|
|
52
|
-
state?: SplitMode
|
|
53
|
-
setState(state: SplitMode): void
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type SplitModeStore = UseBoundStore<StoreApi<SplitModeState>>
|
|
57
|
-
|
|
58
|
-
export interface SplitModeProps {
|
|
59
|
-
state?: SplitMode
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type SplitModeProviderProps = PropsWithChildren<SplitModeProps>
|
|
63
|
-
|
|
64
49
|
export interface SettingsStoreProviderProps {
|
|
65
50
|
config: WidgetConfig
|
|
66
51
|
}
|
package/src/types/events.ts
CHANGED
|
@@ -3,14 +3,17 @@ import type { DefaultValues } from '../stores/form/types.js'
|
|
|
3
3
|
import type { SettingsProps } from '../stores/settings/types.js'
|
|
4
4
|
import type { NavigationRouteType } from '../utils/navigationRoutes.js'
|
|
5
5
|
import type { TokenAmount } from './token.js'
|
|
6
|
+
import type { Appearance, NavigationTabKey } from './widget.js'
|
|
6
7
|
|
|
7
8
|
export enum WidgetEvent {
|
|
9
|
+
AppearanceChanged = 'appearanceChanged',
|
|
8
10
|
AvailableRoutes = 'availableRoutes',
|
|
9
11
|
ChainPinned = 'chainPinned',
|
|
10
12
|
ContactSupport = 'contactSupport',
|
|
11
13
|
DestinationChainTokenSelected = 'destinationChainTokenSelected',
|
|
12
14
|
FormFieldChanged = 'formFieldChanged',
|
|
13
15
|
LowAddressActivityConfirmed = 'lowAddressActivityConfirmed',
|
|
16
|
+
NavigationTabChanged = 'navigationTabChanged',
|
|
14
17
|
PageEntered = 'pageEntered',
|
|
15
18
|
RouteExecutionCompleted = 'routeExecutionCompleted',
|
|
16
19
|
RouteExecutionFailed = 'routeExecutionFailed',
|
|
@@ -26,12 +29,14 @@ export enum WidgetEvent {
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export type WidgetEvents = {
|
|
32
|
+
appearanceChanged: (data: Appearance) => void
|
|
29
33
|
availableRoutes: (data: Route[]) => void
|
|
30
34
|
chainPinned: (data: ChainPinned) => void
|
|
31
35
|
contactSupport: (data: ContactSupport) => void
|
|
32
36
|
destinationChainTokenSelected: (data: ChainTokenSelected) => void
|
|
33
37
|
formFieldChanged: (data: FormFieldChanged) => void
|
|
34
38
|
lowAddressActivityConfirmed: (data: LowAddressActivityConfirmed) => void
|
|
39
|
+
navigationTabChanged: (data: NavigationTabChanged) => void
|
|
35
40
|
pageEntered: (data: NavigationRouteType) => void
|
|
36
41
|
routeExecutionCompleted: (data: Route) => void
|
|
37
42
|
routeExecutionFailed: (data: RouteExecutionUpdate) => void
|
|
@@ -112,3 +117,10 @@ export type LowAddressActivityConfirmed = {
|
|
|
112
117
|
address: string
|
|
113
118
|
chainId: number
|
|
114
119
|
}
|
|
120
|
+
|
|
121
|
+
export type NavigationTabChanged = {
|
|
122
|
+
/** Key of the now-active tab. */
|
|
123
|
+
tab: NavigationTabKey
|
|
124
|
+
/** Key of the previously active tab, or `undefined` on first render. */
|
|
125
|
+
previousTab?: NavigationTabKey
|
|
126
|
+
}
|
package/src/types/widget.ts
CHANGED
|
@@ -35,7 +35,15 @@ import type {
|
|
|
35
35
|
import type { DefaultFieldValues } from '../stores/form/types.js'
|
|
36
36
|
|
|
37
37
|
export type WidgetVariant = 'compact' | 'wide' | 'drawer'
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
/** @internal Not part of the public API. */
|
|
40
|
+
export type InternalWidgetMode = 'limit'
|
|
41
|
+
export type WidgetMode =
|
|
42
|
+
| 'default'
|
|
43
|
+
| 'split'
|
|
44
|
+
| 'custom'
|
|
45
|
+
| 'refuel'
|
|
46
|
+
| InternalWidgetMode
|
|
39
47
|
export type SplitMode = 'bridge' | 'swap'
|
|
40
48
|
export type SplitModeOptions = {
|
|
41
49
|
defaultTab: SplitMode
|
|
@@ -51,6 +59,21 @@ export interface ModeOptions {
|
|
|
51
59
|
custom?: { type: CustomMode }
|
|
52
60
|
}
|
|
53
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Identity of a header navigation tab. Each key maps to a widget variant, mode and
|
|
64
|
+
* (optionally) mode options; labels are resolved from the key.
|
|
65
|
+
*/
|
|
66
|
+
export type SplitNavigationTabKey = SplitMode
|
|
67
|
+
/** @internal Not part of the public API. */
|
|
68
|
+
export type InternalNavigationTabKey =
|
|
69
|
+
| 'default'
|
|
70
|
+
| 'private'
|
|
71
|
+
| 'refuel'
|
|
72
|
+
| 'swap-advanced'
|
|
73
|
+
| 'bridge-advanced'
|
|
74
|
+
| 'limit'
|
|
75
|
+
export type NavigationTabKey = InternalNavigationTabKey | SplitNavigationTabKey
|
|
76
|
+
|
|
54
77
|
export type Appearance = PaletteMode | 'system'
|
|
55
78
|
export interface NavigationProps {
|
|
56
79
|
/**
|
|
@@ -150,6 +173,15 @@ export interface RequiredUIConfig {
|
|
|
150
173
|
export type DefaultUI = {
|
|
151
174
|
transactionDetailsExpanded?: boolean
|
|
152
175
|
navigationHeaderTitleNoWrap?: boolean
|
|
176
|
+
/**
|
|
177
|
+
* Layout for the main form.
|
|
178
|
+
* - `'default'`: the chain/token selectors plus single amount input.
|
|
179
|
+
* - `'cards'`: the redesigned card-based layout — stacked Send/Receive amount
|
|
180
|
+
* cards (`AmountInputCardPair`) with inline token pill selectors and a swap
|
|
181
|
+
* button.
|
|
182
|
+
* @default 'default'
|
|
183
|
+
*/
|
|
184
|
+
layout?: 'default' | 'cards'
|
|
153
185
|
}
|
|
154
186
|
|
|
155
187
|
export interface WidgetWalletConfig {
|
|
@@ -344,6 +376,13 @@ export interface WidgetConfig {
|
|
|
344
376
|
variant?: WidgetVariant
|
|
345
377
|
mode?: WidgetMode
|
|
346
378
|
modeOptions?: ModeOptions
|
|
379
|
+
/**
|
|
380
|
+
* Header navigation tabs, in order. When set, the widget renders a tab bar
|
|
381
|
+
* and the active tab drives the displayed flow. Each entry is a tab key.
|
|
382
|
+
*
|
|
383
|
+
* @internal Not part of the public API.
|
|
384
|
+
*/
|
|
385
|
+
_navigationTabs?: NavigationTabKey[]
|
|
347
386
|
|
|
348
387
|
appearance?: Appearance
|
|
349
388
|
theme?: WidgetTheme
|
package/src/utils/format.ts
CHANGED
|
@@ -175,7 +175,11 @@ const units = [
|
|
|
175
175
|
['second', 1],
|
|
176
176
|
] as const
|
|
177
177
|
|
|
178
|
-
export function formatDuration(
|
|
178
|
+
export function formatDuration(
|
|
179
|
+
seconds: number,
|
|
180
|
+
locale: string,
|
|
181
|
+
unitDisplay: Intl.NumberFormatOptions['unitDisplay'] = 'narrow'
|
|
182
|
+
): string {
|
|
179
183
|
const match = units.find(([, v]) => seconds >= v)
|
|
180
184
|
const amount = match ? Math.floor(seconds / match[1]) : 0
|
|
181
185
|
const unit = match?.[0] ?? 'second'
|
|
@@ -183,7 +187,7 @@ export function formatDuration(seconds: number, locale: string): string {
|
|
|
183
187
|
return amount.toLocaleString(locale, {
|
|
184
188
|
style: 'unit',
|
|
185
189
|
unit,
|
|
186
|
-
unitDisplay
|
|
190
|
+
unitDisplay,
|
|
187
191
|
})
|
|
188
192
|
}
|
|
189
193
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { formatInputAmount } from './format.js'
|
|
2
|
+
|
|
3
|
+
/** Default order validity: 1 day, expressed as a duration in seconds. */
|
|
4
|
+
export const DEFAULT_VALID_UNTIL_SECONDS: number = 24 * 60 * 60
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* High-precision formatter for derived limit-order values. Mirrors the
|
|
8
|
+
* approach used by `priceToTokenAmount` — these are display-level derivations;
|
|
9
|
+
* the route request re-parses amounts via `parseUnits`.
|
|
10
|
+
*/
|
|
11
|
+
const preciseFormatter = new Intl.NumberFormat('en', {
|
|
12
|
+
notation: 'standard',
|
|
13
|
+
roundingPriority: 'morePrecision',
|
|
14
|
+
maximumSignificantDigits: 20,
|
|
15
|
+
maximumFractionDigits: 20,
|
|
16
|
+
useGrouping: false,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
function parsePositive(value?: string): number | undefined {
|
|
20
|
+
if (!value) {
|
|
21
|
+
return undefined
|
|
22
|
+
}
|
|
23
|
+
const parsed = Number.parseFloat(value)
|
|
24
|
+
if (Number.isNaN(parsed) || parsed <= 0) {
|
|
25
|
+
return undefined
|
|
26
|
+
}
|
|
27
|
+
return parsed
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Derive the receive amount: `receiveAmount = sendAmount × limitPrice`.
|
|
32
|
+
* Returns an empty string when either input is missing or invalid.
|
|
33
|
+
*/
|
|
34
|
+
export function deriveReceiveAmount(
|
|
35
|
+
sendAmount?: string,
|
|
36
|
+
limitPrice?: string,
|
|
37
|
+
toDecimals?: number
|
|
38
|
+
): string {
|
|
39
|
+
const send = parsePositive(sendAmount)
|
|
40
|
+
const price = parsePositive(limitPrice)
|
|
41
|
+
if (send === undefined || price === undefined) {
|
|
42
|
+
return ''
|
|
43
|
+
}
|
|
44
|
+
return formatInputAmount(
|
|
45
|
+
preciseFormatter.format(send * price),
|
|
46
|
+
toDecimals ?? null
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Derive the limit price: `limitPrice = receiveAmount ÷ sendAmount`.
|
|
52
|
+
* Returns an empty string when either input is missing or invalid.
|
|
53
|
+
*/
|
|
54
|
+
export function deriveLimitPrice(
|
|
55
|
+
sendAmount?: string,
|
|
56
|
+
receiveAmount?: string
|
|
57
|
+
): string {
|
|
58
|
+
const send = parsePositive(sendAmount)
|
|
59
|
+
const receive = parsePositive(receiveAmount)
|
|
60
|
+
if (send === undefined || receive === undefined) {
|
|
61
|
+
return ''
|
|
62
|
+
}
|
|
63
|
+
return preciseFormatter.format(receive / send)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Invert a price for display flipping: `1 ÷ price`. */
|
|
67
|
+
export function invertPrice(price?: string): string {
|
|
68
|
+
const parsed = parsePositive(price)
|
|
69
|
+
if (parsed === undefined) {
|
|
70
|
+
return ''
|
|
71
|
+
}
|
|
72
|
+
return preciseFormatter.format(1 / parsed)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Apply a percentage offset to a price, e.g. `percent = 2` → `price × 1.02`.
|
|
77
|
+
* Used by the quick-set buttons (+2%, +5%).
|
|
78
|
+
*/
|
|
79
|
+
export function applyPriceOffset(
|
|
80
|
+
price: string | undefined,
|
|
81
|
+
percent: number
|
|
82
|
+
): string {
|
|
83
|
+
const parsed = parsePositive(price)
|
|
84
|
+
if (parsed === undefined) {
|
|
85
|
+
return ''
|
|
86
|
+
}
|
|
87
|
+
return preciseFormatter.format(parsed * (1 + percent / 100))
|
|
88
|
+
}
|
|
@@ -8,6 +8,8 @@ export const navigationRoutes = {
|
|
|
8
8
|
languages: 'languages',
|
|
9
9
|
routes: 'routes',
|
|
10
10
|
settings: 'settings',
|
|
11
|
+
routePriority: 'route-priority',
|
|
12
|
+
slippage: 'slippage',
|
|
11
13
|
toChain: 'to-chain',
|
|
12
14
|
toToken: 'to-token',
|
|
13
15
|
toTokenNative: 'to-token-native',
|
|
@@ -30,6 +32,8 @@ export const stickyHeaderRoutes: string[] = [
|
|
|
30
32
|
navigationRoutes.home,
|
|
31
33
|
navigationRoutes.routes,
|
|
32
34
|
navigationRoutes.settings,
|
|
35
|
+
navigationRoutes.routePriority,
|
|
36
|
+
navigationRoutes.slippage,
|
|
33
37
|
navigationRoutes.toChain,
|
|
34
38
|
navigationRoutes.toTokenNative,
|
|
35
39
|
navigationRoutes.transactionDetails,
|
|
@@ -50,6 +54,8 @@ export const backButtonRoutes: string[] = [
|
|
|
50
54
|
navigationRoutes.fromToken,
|
|
51
55
|
navigationRoutes.routes,
|
|
52
56
|
navigationRoutes.settings,
|
|
57
|
+
navigationRoutes.routePriority,
|
|
58
|
+
navigationRoutes.slippage,
|
|
53
59
|
navigationRoutes.toChain,
|
|
54
60
|
navigationRoutes.toToken,
|
|
55
61
|
navigationRoutes.toTokenNative,
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useSplitModeStore } from "../../stores/settings/useSplitModeStore.js";
|
|
2
|
-
import { useFieldActions } from "../../stores/form/useFieldActions.js";
|
|
3
|
-
import { NavigationTab, NavigationTabs } from "../Tabs/NavigationTabs.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
//#region src/components/Header/SplitNavigationTabs.tsx
|
|
7
|
-
const SplitNavigationTabs = () => {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const [state, setState] = useSplitModeStore((state) => [state.state, state.setState]);
|
|
10
|
-
const { setFieldValue } = useFieldActions();
|
|
11
|
-
const handleChange = (_, value) => {
|
|
12
|
-
setFieldValue("fromAmount", "");
|
|
13
|
-
setFieldValue("fromToken", "");
|
|
14
|
-
setFieldValue("toToken", "");
|
|
15
|
-
setState(value === 0 ? "swap" : "bridge");
|
|
16
|
-
};
|
|
17
|
-
return /* @__PURE__ */ jsxs(NavigationTabs, {
|
|
18
|
-
value: state === "swap" ? 0 : 1,
|
|
19
|
-
onChange: handleChange,
|
|
20
|
-
"aria-label": "tabs",
|
|
21
|
-
children: [/* @__PURE__ */ jsx(NavigationTab, {
|
|
22
|
-
label: t("header.swap"),
|
|
23
|
-
disableRipple: true
|
|
24
|
-
}), /* @__PURE__ */ jsx(NavigationTab, {
|
|
25
|
-
label: t("header.bridge"),
|
|
26
|
-
disableRipple: true
|
|
27
|
-
})]
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
export { SplitNavigationTabs };
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=SplitNavigationTabs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SplitNavigationTabs.js","names":[],"sources":["../../../../src/components/Header/SplitNavigationTabs.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useFieldActions } from '../../stores/form/useFieldActions.js'\nimport { useSplitModeStore } from '../../stores/settings/useSplitModeStore.js'\nimport { NavigationTab, NavigationTabs } from '../Tabs/NavigationTabs.js'\n\nexport const SplitNavigationTabs = (): JSX.Element => {\n const { t } = useTranslation()\n const [state, setState] = useSplitModeStore((state) => [\n state.state,\n state.setState,\n ])\n\n const { setFieldValue } = useFieldActions()\n const handleChange = (_: React.SyntheticEvent, value: number) => {\n setFieldValue('fromAmount', '')\n setFieldValue('fromToken', '')\n setFieldValue('toToken', '')\n setState(value === 0 ? 'swap' : 'bridge')\n }\n\n return (\n <NavigationTabs\n value={state === 'swap' ? 0 : 1}\n onChange={handleChange}\n aria-label=\"tabs\"\n >\n <NavigationTab label={t('header.swap')} disableRipple />\n <NavigationTab label={t('header.bridge')} disableRipple />\n </NavigationTabs>\n )\n}\n"],"mappings":";;;;;;AAMA,MAAa,4BAAyC;CACpD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,CAAC,OAAO,YAAY,mBAAmB,UAAU,CACrD,MAAM,OACN,MAAM,QACR,CAAC;CAED,MAAM,EAAE,kBAAkB,gBAAgB;CAC1C,MAAM,gBAAgB,GAAyB,UAAkB;EAC/D,cAAc,cAAc,EAAE;EAC9B,cAAc,aAAa,EAAE;EAC7B,cAAc,WAAW,EAAE;EAC3B,SAAS,UAAU,IAAI,SAAS,QAAQ;CAC1C;CAEA,OACE,qBAAC,gBAAD;EACE,OAAO,UAAU,SAAS,IAAI;EAC9B,UAAU;EACV,cAAW;YAHb,CAKE,oBAAC,eAAD;GAAe,OAAO,EAAE,aAAa;GAAG,eAAA;EAAe,CAAA,GACvD,oBAAC,eAAD;GAAe,OAAO,EAAE,eAAe;GAAG,eAAA;EAAe,CAAA,CAC3C;;AAEpB"}
|