@lumiapassport/ui-kit 1.12.5 → 1.13.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/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import React__default, { FC, HTMLAttributes, PropsWithChildren } from 'react';
2
+ import * as React$1 from 'react';
3
+ import React__default, { ReactNode, MutableRefObject, FC, HTMLAttributes, PropsWithChildren } from 'react';
4
4
  import * as zustand from 'zustand';
5
5
  import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
6
6
  import * as viem from 'viem';
@@ -40,7 +40,7 @@ interface SocialProvider {
40
40
  meta?: Record<string, any>;
41
41
  }
42
42
  interface LumiaPassportConfig {
43
- projectId?: string;
43
+ projectId: string;
44
44
  passkey: {
45
45
  enabled: boolean;
46
46
  showCreateButton: boolean;
@@ -72,9 +72,7 @@ interface LumiaPassportConfig {
72
72
  title: string;
73
73
  subtitle?: string;
74
74
  dialogClassName?: string;
75
- authOrder?: Array<'passkey' | 'email' | 'social'>;
76
- /** DEPRECATED use useLumiaPassportOpen().open('auth') in your app for auto-open auth dialog */
77
- /** DEPRECATED, useLayoutStore colorMode */
75
+ authOrder?: Array<'passkey' | 'email' | 'social' | 'wallet'>;
78
76
  fonts?: {
79
77
  base?: string;
80
78
  heading?: string;
@@ -192,18 +190,17 @@ interface LumiaPassportCallbacks {
192
190
  onWalletReady?: (status: WalletReadyStatus$1) => void;
193
191
  }
194
192
  interface LumiaPassportContextType {
195
- config: LumiaPassportConfig;
193
+ config: MutableRefObject<LumiaPassportConfig>;
196
194
  updateConfig: (updates: Partial<LumiaPassportConfig>) => void;
197
195
  callbacks?: LumiaPassportCallbacks;
198
- providersVersion: number;
199
- notifyProvidersUpdate: () => void;
200
196
  }
201
197
  interface LumiaPassportProviderProps {
202
- children: React__default.ReactNode;
198
+ children: ReactNode;
203
199
  projectId?: string;
204
200
  initialConfig?: Partial<LumiaPassportConfig>;
205
201
  callbacks?: LumiaPassportCallbacks;
206
202
  }
203
+ /** NEVER EVER declare here any state (useState or whatever). This Provider should NEVER trigger self of child-app re-renders */
207
204
  declare function LumiaPassportProvider(props: LumiaPassportProviderProps): react_jsx_runtime.JSX.Element;
208
205
  declare const useLumiaPassportConfig: () => LumiaPassportContextType;
209
206
 
@@ -643,7 +640,11 @@ interface SessionState {
643
640
  setIsLoading: (isLoading: boolean) => void;
644
641
  setWalletReadyStatus: (status: WalletReadyStatus) => void;
645
642
  }
646
- /** Lumia Passport session store */
643
+ /**
644
+ * @function useLumiaPassportSession is UNLIKELY to use outside Lumia Passport, as it is INTERNAL zustand session store!
645
+ * Use it with caution, using zustand callback extraction. EX: const address = useLumiaPassportSession((st) => st.address)
646
+ * @description refactor your app to NOT use this directly in your application, use set of new dedicated session hooks: useLumiaPassportAccountSession, useLumiaPassportAddress, etc.
647
+ */
647
648
  declare const useLumiaPassportSession: zustand.UseBoundStore<zustand.StoreApi<SessionState>>;
648
649
  declare function LumiaPassportSessionProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
649
650
 
@@ -679,7 +680,6 @@ declare enum PageKey {
679
680
  TRANSACTIONS = "transactions",
680
681
  ASSETS = "assets",
681
682
  MANAGE_WALLET = "manage-wallet",
682
- ADD_PROVIDER = "add-provider",
683
683
  UNLINK_PROVIDER = "unlink-provider",
684
684
  SECURITY = "security",
685
685
  KEYSARE_BACKUP = "keysare-backup",
@@ -720,10 +720,10 @@ declare function useLumiaPassportColorMode(): {
720
720
  };
721
721
 
722
722
  declare const buttonVariants: (props?: {
723
- variant?: "link" | "telegram" | "success" | "default" | "outline" | "ghost" | "destructive" | "secondary";
724
- size?: "small" | "large" | "default" | "medium" | "icon" | "sm" | "lg";
723
+ variant?: "default" | "outline" | "ghost";
724
+ size?: "small" | "large" | "medium" | "icon";
725
725
  } & class_variance_authority_types.ClassProp) => string;
726
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
726
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
727
727
  asChild?: boolean;
728
728
  }
729
729
 
@@ -744,7 +744,7 @@ interface LumiaLogoProps {
744
744
  size?: number;
745
745
  className?: string;
746
746
  }
747
- declare const LumiaLogo: React.ForwardRefExoticComponent<LumiaLogoProps & React.RefAttributes<SVGSVGElement>>;
747
+ declare const LumiaLogo: React$1.ForwardRefExoticComponent<LumiaLogoProps & React$1.RefAttributes<SVGSVGElement>>;
748
748
 
749
749
  type ChainLike$2 = {
750
750
  id: number;
@@ -767,7 +767,7 @@ type UserOpStatusProps = {
767
767
  isPolling?: boolean;
768
768
  };
769
769
  };
770
- declare const UserOpStatus: React.FC<UserOpStatusProps>;
770
+ declare const UserOpStatus: React$1.FC<UserOpStatusProps>;
771
771
 
772
772
  type ChainLike$1 = {
773
773
  id: number;
@@ -787,7 +787,7 @@ type HashProps = {
787
787
  kind?: 'tx' | 'address' | 'block';
788
788
  label?: string;
789
789
  };
790
- declare const Hash: React.FC<HashProps>;
790
+ declare const Hash: React$1.FC<HashProps>;
791
791
 
792
792
  type ChainLike = {
793
793
  id: number;
@@ -806,7 +806,7 @@ type AddressProps = {
806
806
  showExplorer?: boolean;
807
807
  label?: string;
808
808
  };
809
- declare const Address: React.FC<AddressProps>;
809
+ declare const Address: React$1.FC<AddressProps>;
810
810
 
811
811
  interface TransactionsListProps {
812
812
  address: string;
@@ -1329,11 +1329,11 @@ interface LinkedProfileDisplay extends AuthProvider {
1329
1329
  color?: string;
1330
1330
  }
1331
1331
  declare function useLumiaPassportLinkedProfiles(): {
1332
- readonly profiles: LinkedProfileDisplay[];
1333
- readonly avatar: string;
1334
- readonly isLoading: boolean;
1335
- readonly error: string;
1336
- readonly refresh: () => Promise<void>;
1332
+ profiles: LinkedProfileDisplay[];
1333
+ avatar: string;
1334
+ isLoading: boolean;
1335
+ error: Error;
1336
+ refresh: () => Promise<void>;
1337
1337
  };
1338
1338
 
1339
1339
  export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaWagmiProvider, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import React__default, { FC, HTMLAttributes, PropsWithChildren } from 'react';
2
+ import * as React$1 from 'react';
3
+ import React__default, { ReactNode, MutableRefObject, FC, HTMLAttributes, PropsWithChildren } from 'react';
4
4
  import * as zustand from 'zustand';
5
5
  import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
6
6
  import * as viem from 'viem';
@@ -40,7 +40,7 @@ interface SocialProvider {
40
40
  meta?: Record<string, any>;
41
41
  }
42
42
  interface LumiaPassportConfig {
43
- projectId?: string;
43
+ projectId: string;
44
44
  passkey: {
45
45
  enabled: boolean;
46
46
  showCreateButton: boolean;
@@ -72,9 +72,7 @@ interface LumiaPassportConfig {
72
72
  title: string;
73
73
  subtitle?: string;
74
74
  dialogClassName?: string;
75
- authOrder?: Array<'passkey' | 'email' | 'social'>;
76
- /** DEPRECATED use useLumiaPassportOpen().open('auth') in your app for auto-open auth dialog */
77
- /** DEPRECATED, useLayoutStore colorMode */
75
+ authOrder?: Array<'passkey' | 'email' | 'social' | 'wallet'>;
78
76
  fonts?: {
79
77
  base?: string;
80
78
  heading?: string;
@@ -192,18 +190,17 @@ interface LumiaPassportCallbacks {
192
190
  onWalletReady?: (status: WalletReadyStatus$1) => void;
193
191
  }
194
192
  interface LumiaPassportContextType {
195
- config: LumiaPassportConfig;
193
+ config: MutableRefObject<LumiaPassportConfig>;
196
194
  updateConfig: (updates: Partial<LumiaPassportConfig>) => void;
197
195
  callbacks?: LumiaPassportCallbacks;
198
- providersVersion: number;
199
- notifyProvidersUpdate: () => void;
200
196
  }
201
197
  interface LumiaPassportProviderProps {
202
- children: React__default.ReactNode;
198
+ children: ReactNode;
203
199
  projectId?: string;
204
200
  initialConfig?: Partial<LumiaPassportConfig>;
205
201
  callbacks?: LumiaPassportCallbacks;
206
202
  }
203
+ /** NEVER EVER declare here any state (useState or whatever). This Provider should NEVER trigger self of child-app re-renders */
207
204
  declare function LumiaPassportProvider(props: LumiaPassportProviderProps): react_jsx_runtime.JSX.Element;
208
205
  declare const useLumiaPassportConfig: () => LumiaPassportContextType;
209
206
 
@@ -643,7 +640,11 @@ interface SessionState {
643
640
  setIsLoading: (isLoading: boolean) => void;
644
641
  setWalletReadyStatus: (status: WalletReadyStatus) => void;
645
642
  }
646
- /** Lumia Passport session store */
643
+ /**
644
+ * @function useLumiaPassportSession is UNLIKELY to use outside Lumia Passport, as it is INTERNAL zustand session store!
645
+ * Use it with caution, using zustand callback extraction. EX: const address = useLumiaPassportSession((st) => st.address)
646
+ * @description refactor your app to NOT use this directly in your application, use set of new dedicated session hooks: useLumiaPassportAccountSession, useLumiaPassportAddress, etc.
647
+ */
647
648
  declare const useLumiaPassportSession: zustand.UseBoundStore<zustand.StoreApi<SessionState>>;
648
649
  declare function LumiaPassportSessionProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
649
650
 
@@ -679,7 +680,6 @@ declare enum PageKey {
679
680
  TRANSACTIONS = "transactions",
680
681
  ASSETS = "assets",
681
682
  MANAGE_WALLET = "manage-wallet",
682
- ADD_PROVIDER = "add-provider",
683
683
  UNLINK_PROVIDER = "unlink-provider",
684
684
  SECURITY = "security",
685
685
  KEYSARE_BACKUP = "keysare-backup",
@@ -720,10 +720,10 @@ declare function useLumiaPassportColorMode(): {
720
720
  };
721
721
 
722
722
  declare const buttonVariants: (props?: {
723
- variant?: "link" | "telegram" | "success" | "default" | "outline" | "ghost" | "destructive" | "secondary";
724
- size?: "small" | "large" | "default" | "medium" | "icon" | "sm" | "lg";
723
+ variant?: "default" | "outline" | "ghost";
724
+ size?: "small" | "large" | "medium" | "icon";
725
725
  } & class_variance_authority_types.ClassProp) => string;
726
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
726
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
727
727
  asChild?: boolean;
728
728
  }
729
729
 
@@ -744,7 +744,7 @@ interface LumiaLogoProps {
744
744
  size?: number;
745
745
  className?: string;
746
746
  }
747
- declare const LumiaLogo: React.ForwardRefExoticComponent<LumiaLogoProps & React.RefAttributes<SVGSVGElement>>;
747
+ declare const LumiaLogo: React$1.ForwardRefExoticComponent<LumiaLogoProps & React$1.RefAttributes<SVGSVGElement>>;
748
748
 
749
749
  type ChainLike$2 = {
750
750
  id: number;
@@ -767,7 +767,7 @@ type UserOpStatusProps = {
767
767
  isPolling?: boolean;
768
768
  };
769
769
  };
770
- declare const UserOpStatus: React.FC<UserOpStatusProps>;
770
+ declare const UserOpStatus: React$1.FC<UserOpStatusProps>;
771
771
 
772
772
  type ChainLike$1 = {
773
773
  id: number;
@@ -787,7 +787,7 @@ type HashProps = {
787
787
  kind?: 'tx' | 'address' | 'block';
788
788
  label?: string;
789
789
  };
790
- declare const Hash: React.FC<HashProps>;
790
+ declare const Hash: React$1.FC<HashProps>;
791
791
 
792
792
  type ChainLike = {
793
793
  id: number;
@@ -806,7 +806,7 @@ type AddressProps = {
806
806
  showExplorer?: boolean;
807
807
  label?: string;
808
808
  };
809
- declare const Address: React.FC<AddressProps>;
809
+ declare const Address: React$1.FC<AddressProps>;
810
810
 
811
811
  interface TransactionsListProps {
812
812
  address: string;
@@ -1329,11 +1329,11 @@ interface LinkedProfileDisplay extends AuthProvider {
1329
1329
  color?: string;
1330
1330
  }
1331
1331
  declare function useLumiaPassportLinkedProfiles(): {
1332
- readonly profiles: LinkedProfileDisplay[];
1333
- readonly avatar: string;
1334
- readonly isLoading: boolean;
1335
- readonly error: string;
1336
- readonly refresh: () => Promise<void>;
1332
+ profiles: LinkedProfileDisplay[];
1333
+ avatar: string;
1334
+ isLoading: boolean;
1335
+ error: Error;
1336
+ refresh: () => Promise<void>;
1337
1337
  };
1338
1338
 
1339
1339
  export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaWagmiProvider, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };