@fluent.xyz/connect 0.2.1 → 0.2.3

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/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import { SmartAccount, GetPaymasterDataParameters } from 'viem/account-abstracti
13
13
  import * as class_variance_authority_types from 'class-variance-authority/types';
14
14
  import { Button as Button$1 } from '@base-ui/react/button';
15
15
  import { VariantProps } from 'class-variance-authority';
16
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
16
17
  import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
17
18
  import { Separator as Separator$1 } from '@base-ui/react/separator';
18
19
  import { z } from 'zod';
@@ -1241,6 +1242,12 @@ type FluentWidgetConfig = {
1241
1242
  gasPayment?: {
1242
1243
  ethValueByToken?: FluentGasPaymentEthRates;
1243
1244
  };
1245
+ /**
1246
+ * `false` drops the Reputation tab from the account drawer — and with it the
1247
+ * whole tab strip, since Home is then the only tab. The families request is
1248
+ * never made. Default `true`.
1249
+ */
1250
+ reputationEnabled?: boolean;
1244
1251
  scopes?: string[];
1245
1252
  source?: string;
1246
1253
  campaign?: string;
@@ -1259,6 +1266,19 @@ type FluentWidgetConfig = {
1259
1266
  */
1260
1267
  authTokenRenewalOffsetSeconds?: number;
1261
1268
  assets?: Partial<typeof FLUENT_CONNECT_DEFAULT_ASSETS>;
1269
+ /** The account avatar shown on the connect button and in the account drawer. */
1270
+ avatar?: {
1271
+ /**
1272
+ * Image used when there is no X avatar to show — a URL or a data URI.
1273
+ * Defaults to the Fluent mark.
1274
+ */
1275
+ defaultLogoUrl?: string;
1276
+ /**
1277
+ * Always show `defaultLogoUrl`, even for users who signed in with X.
1278
+ * Default `false` (the X avatar wins when Privy has one).
1279
+ */
1280
+ forceDefault?: boolean;
1281
+ };
1262
1282
  };
1263
1283
  type ResolvedFluentWidgetConfig = {
1264
1284
  partnerId: string;
@@ -1285,10 +1305,15 @@ type ResolvedFluentWidgetConfig = {
1285
1305
  gasPayment: {
1286
1306
  ethValueByToken: FluentGasPaymentEthRates | undefined;
1287
1307
  };
1308
+ reputationEnabled: boolean;
1288
1309
  scopes: string[];
1289
1310
  source: string;
1290
1311
  campaign: string | undefined;
1291
1312
  assets: typeof FLUENT_CONNECT_DEFAULT_ASSETS & Partial<typeof FLUENT_CONNECT_DEFAULT_ASSETS>;
1313
+ avatar: {
1314
+ defaultLogoUrl: string | undefined;
1315
+ forceDefault: boolean;
1316
+ };
1292
1317
  };
1293
1318
 
1294
1319
  declare function normalizeFluentWidgetNetwork(value: string | undefined): FluentWidgetNetwork | undefined;
@@ -1784,9 +1809,11 @@ type FluentWidgetConnectButtonProps = {
1784
1809
  onClick: () => void;
1785
1810
  className?: string;
1786
1811
  userLogoUrl?: string | null;
1812
+ /** Shown instead of the Fluent mark when there is no `userLogoUrl` — a URL or a data URI. */
1813
+ defaultLogoUrl?: string | null;
1787
1814
  };
1788
1815
  /** Default Fluent Connect / account button — place it anywhere in your layout. */
1789
- declare function FluentWidgetConnectButton({ connected, pending, addressLabel, onClick, className, userLogoUrl, }: FluentWidgetConnectButtonProps): React.JSX.Element;
1816
+ declare function FluentWidgetConnectButton({ connected, pending, addressLabel, onClick, className, userLogoUrl, defaultLogoUrl, }: FluentWidgetConnectButtonProps): React.JSX.Element;
1790
1817
 
1791
1818
  declare const FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY = "selfFunded=true";
1792
1819
  declare const FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT: "0x000000000000000000000000000000000000dEaD";
@@ -1954,6 +1981,8 @@ interface FluentAccountDrawerProps {
1954
1981
  disablePointerDismissal?: boolean;
1955
1982
  children: ReactNode;
1956
1983
  userLogoUrl?: string | null;
1984
+ /** Shown instead of the Fluent mark when there is no `userLogoUrl` — a URL or a data URI. */
1985
+ defaultLogoUrl?: string | null;
1957
1986
  }
1958
1987
  /**
1959
1988
  * The connected-account drawer shell: the connect-button trigger, the account
@@ -1961,7 +1990,7 @@ interface FluentAccountDrawerProps {
1961
1990
  * (`children`) for the wallet menu card. Rendered whenever the widget has a
1962
1991
  * connected account.
1963
1992
  */
1964
- declare function FluentAccountDrawer({ accountOpen, setAccountOpen, hasConnectedAccount, isMobile, connectButton, accountMenuAddress, onAccountMenuAction, settingsOpen, onCloseSettings, modal, disablePointerDismissal, children, userLogoUrl, }: FluentAccountDrawerProps): React.JSX.Element;
1993
+ declare function FluentAccountDrawer({ accountOpen, setAccountOpen, hasConnectedAccount, isMobile, connectButton, accountMenuAddress, onAccountMenuAction, settingsOpen, onCloseSettings, modal, disablePointerDismissal, children, userLogoUrl, defaultLogoUrl, }: FluentAccountDrawerProps): React.JSX.Element;
1965
1994
 
1966
1995
  /** Colour scheme and design tokens for the widget's own UI — never around host content. */
1967
1996
  declare const WIDGET_STYLE_SCOPE = "fluent-root dark contents text-foreground";
@@ -2021,6 +2050,10 @@ declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> &
2021
2050
 
2022
2051
  declare function Label({ className, ...props }: React.ComponentProps<"label">): React.JSX.Element;
2023
2052
 
2053
+ declare function Switch({ className, size, ...props }: Switch$1.Root.Props & {
2054
+ size?: "sm" | "default";
2055
+ }): React.JSX.Element;
2056
+
2024
2057
  declare function Dialog({ ...props }: Dialog$1.Root.Props): React.JSX.Element;
2025
2058
  declare function DialogTrigger({ ...props }: Dialog$1.Trigger.Props): React.JSX.Element;
2026
2059
  declare function DialogPortal({ container, ...props }: Dialog$1.Portal.Props): React.JSX.Element;
@@ -2043,4 +2076,18 @@ declare function Icon({ name, className, ...props }: {
2043
2076
  name: IconName;
2044
2077
  } & SVGProps<SVGSVGElement>): React.JSX.Element;
2045
2078
 
2046
- export { type AppDefinition, type BridgeAddresses, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentAccountCapabilities, FluentAccountDrawer, type FluentAccountType, FluentAuthError, type FluentAuthErrorCode, type FluentBatchApi, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentCallPermission, type FluentChainDefinition, type FluentClient, type FluentClientConfig, type FluentEncodedBatchCall, type FluentExecuteResult, type FluentExternalWalletState, type FluentFamilies, type FluentFamiliesClient, type FluentFamiliesClientConfig, type FluentFamily, type FluentFamilyTier, type FluentFamilyType, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentValueTier, type FluentGasTokenSymbol, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionClient, type FluentPermissionClientConfig, type FluentPermissionGrant, type FluentPermissionGrantRequest, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionPreview, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, type FluentPermissionStatus, FluentPortalContainerProvider, type FluentSession, type FluentSpendPeriod, type FluentSpendPermission, type FluentSponsorshipReason, type FluentTokenBalance, type FluentTokenDefinition, type FluentUserTokenAddResult, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMode, type FluentWidgetConfig, FluentWidgetConnectButton, type FluentWidgetConnectButtonProps, type FluentWidgetConnectButtonRenderContext, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetNetwork, FluentWidgetNetworkProvider, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentWidgetStatus, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenInfo, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, Icon, type IconName, type L1ChainDefinition, Label, type ResolvedFluentWidgetConfig, Separator, type UserTokenStore, WIDGET_STYLE_SCOPE, WalletMenuActionCard, type ZerodevIntegration, buttonVariants, clearPrivyRecentLoginMethod, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, findFluentSymbolCollisions, fluent, apps as fluentApps, fluentBridgeAbi, fluent$1 as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useWidget };
2079
+ type AccountAvatarProps = {
2080
+ /** The signed-in user's X avatar, when Privy has one. Wins over `defaultLogoUrl`. */
2081
+ userLogoUrl?: string | null;
2082
+ /** Host-supplied stand-in for the Fluent mark — a URL or a data URI. */
2083
+ defaultLogoUrl?: string | null;
2084
+ className?: string;
2085
+ };
2086
+ /**
2087
+ * The 32px account tile's contents: X avatar, else the host's default logo, else
2088
+ * the Fluent mark. A logo that fails to load falls through to the next option
2089
+ * rather than leaving a broken image in the button.
2090
+ */
2091
+ declare function AccountAvatar({ userLogoUrl, defaultLogoUrl, className }: AccountAvatarProps): React.JSX.Element;
2092
+
2093
+ export { AccountAvatar, type AccountAvatarProps, type AppDefinition, type BridgeAddresses, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FLUENT_CONNECT_DEFAULT_ASSETS, FLUENT_GAS_PAYMENT_DEFAULT_ETH_RATES, FLUENT_USER_TOKEN_LIMIT, FLUENT_WIDGET_SESSION_STORAGE_KEY, FLUENT_WIDGET_USER_TOKENS_STORAGE_KEY, FLUENT_ZERODEV_ERC20_PAYMASTER_QUERY, FLUENT_ZERODEV_PAYMASTER_DEMO_RECIPIENT, type FluentAccountCapabilities, FluentAccountDrawer, type FluentAccountType, FluentAuthError, type FluentAuthErrorCode, type FluentBatchApi, type FluentBatchCallInput, type FluentBatchConfirmationMode, type FluentBatchOperation, type FluentBatchOperationExecuteOptions, type FluentBatchOperationExecutor, type FluentBatchOperationInput, type FluentBatchOperationReview, type FluentCallPermission, type FluentChainDefinition, type FluentClient, type FluentClientConfig, type FluentEncodedBatchCall, type FluentExecuteResult, type FluentExternalWalletState, type FluentFamilies, type FluentFamiliesClient, type FluentFamiliesClientConfig, type FluentFamily, type FluentFamilyTier, type FluentFamilyType, type FluentGasPayment, type FluentGasPaymentEthRates, type FluentGasPaymentSelection, type FluentGasPaymentValueTier, type FluentGasTokenSymbol, type FluentPermissionApi, type FluentPermissionArgConstraint, type FluentPermissionArgs, type FluentPermissionBatchPolicy, type FluentPermissionBatchPolicyInput, type FluentPermissionCallInput, type FluentPermissionCallPolicy, type FluentPermissionClient, type FluentPermissionClientConfig, type FluentPermissionGrant, type FluentPermissionGrantRequest, type FluentPermissionPolicy, type FluentPermissionPolicyBuilders, type FluentPermissionPreview, type FluentPermissionSession, type FluentPermissionSessionExecutor, type FluentPermissionSessionInput, type FluentPermissionStatus, FluentPortalContainerProvider, type FluentSession, type FluentSpendPeriod, type FluentSpendPermission, type FluentSponsorshipReason, type FluentTokenBalance, type FluentTokenDefinition, type FluentUserTokenAddResult, FluentWidget, type FluentWidgetAccount, type FluentWidgetAuthMode, type FluentWidgetConfig, FluentWidgetConnectButton, type FluentWidgetConnectButtonProps, type FluentWidgetConnectButtonRenderContext, type FluentWidgetExecutionStatus, type FluentWidgetGasPayment, type FluentWidgetNetwork, FluentWidgetNetworkProvider, type FluentWidgetProps, type FluentWidgetRenderContext, type FluentWidgetSession, type FluentWidgetStatus, type FluentZeroDevErc20PaymasterToken, type FluentZeroDevErc20PaymasterTokenInfo, type FluentZeroDevKernel, type FluentZeroDevPaymasterDemoResult, type FluentZeroDevPaymasterKernel, type FluentZeroDevPermissionCall, type FluentZeroDevPermissionSession, type FluentZeroDevSignerMode, Icon, type IconName, type L1ChainDefinition, Label, type ResolvedFluentWidgetConfig, Separator, Switch, type UserTokenStore, WIDGET_STYLE_SCOPE, WalletMenuActionCard, type ZerodevIntegration, buttonVariants, clearPrivyRecentLoginMethod, createFluentBatchOp, createFluentClient, createFluentFamiliesClient, createFluentPermissionApi, createFluentPermissionClient, createFluentPermissionPolicyBuilders, createFluentPermissionSession, createFluentSponsorshipRpcUrl, createFluentUserTokenStore, createFluentZeroDevErc20Paymaster, createFluentZeroDevErc20PaymasterApprovalCall, createFluentZeroDevErc20PaymasterClient, createFluentZeroDevErc20PaymasterRpcUrl, createFluentZeroDevPermissionSession, createFluentZeroDevRpcUrl, createFluentZeroDevSponsoredPaymaster, findFluentSymbolCollisions, fluent, apps as fluentApps, fluentBridgeAbi, fluent$1 as fluentChain, fluentChains, fluentDefinitionToViemChain, integrations as fluentIntegrations, l1Chains as fluentL1Chains, fluentMainnet, fluentMainnetTokenDefaults, fluentTestnet, fluentTestnetTokenDefaults, fluentTokenIdentity, fluentZeroDevChainIds, getApp, getContractAddressFromChain, getFluentChain, getFluentChainByChainId, getFluentChainForNetwork, getFluentDefaultWidgetDisplayTokens, getFluentDefaultWidgetGasTokens, getFluentExplorerBaseUrl, getFluentGasPaymentEthValue, getFluentGasPaymentTokens, getFluentGasPaymentValueTier, getFluentGasTokenAddress, getFluentTokenDefaults, getFluentTokenDefaultsForNetwork, getFluentZeroDevErc20PaymasterTokens, getL1Chain, getL1ForFluentChain, getZeroDevRpcUrl, getZerodevIntegration, isFaucetNetwork, isFluentDefaultToken, isFluentNativeToken, isFluentZeroDevChain, l1DefinitionToViemChain, mergeFluentDisplayTokens, normalizeFluentWidgetNetwork, readFluentTokenBalances, readFluentTokenMetadata, registryVersion, resolveBridgeAddresses, resolveFluentWidgetNetworkFromEnv, resolveFluentZeroDevErc20PaymasterToken, resolveL1Definition, selectFluentGasPaymentToken, sendFluentZeroDevErc20PaymasterDemo, sortFluentGasTokens, useFluentUserTokens, useFluentWidget, useFluentWidgetNetwork, useFluentZeroDevAccount, useWidget };