@unifold/ui-react 0.1.24 → 0.1.26

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.
Binary file
Binary file
Binary file
package/dist/index.d.mts CHANGED
@@ -24,6 +24,8 @@ interface DepositModalProps {
24
24
  showBalanceHeader?: boolean;
25
25
  /** Input variant for Transfer Crypto view: "single_input" or "double_input" (default) */
26
26
  transferInputVariant?: "single_input" | "double_input";
27
+ /** Enable browser wallet connection option. Defaults to false */
28
+ enableConnectWallet?: boolean;
27
29
  onDepositSuccess?: (data: {
28
30
  message: string;
29
31
  transaction?: unknown;
@@ -36,7 +38,7 @@ interface DepositModalProps {
36
38
  }) => void;
37
39
  theme?: "light" | "dark" | "auto";
38
40
  }
39
- declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, hideDepositTracker, showBalanceHeader, transferInputVariant, onDepositSuccess, onDepositError, theme, }: DepositModalProps): react_jsx_runtime.JSX.Element;
41
+ declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, hideDepositTracker, showBalanceHeader, transferInputVariant, enableConnectWallet, onDepositSuccess, onDepositError, theme, }: DepositModalProps): react_jsx_runtime.JSX.Element;
40
42
 
41
43
  interface DepositHeaderProps {
42
44
  title: string;
@@ -173,6 +175,19 @@ interface StyledQRCodeProps {
173
175
  imageSize?: number;
174
176
  darkMode?: boolean;
175
177
  }
178
+ /**
179
+ * Pre-generate a QR code and cache it for instant display later.
180
+ * Call this when wallet address is fetched, before modal opens.
181
+ */
182
+ declare function preloadQRCode(value: string, size?: number, imageUrl?: string, imageSize?: number, darkMode?: boolean): Promise<void>;
183
+ /**
184
+ * Check if a QR code is already cached
185
+ */
186
+ declare function isQRCodeCached(value: string, size?: number, imageUrl?: string, darkMode?: boolean): boolean;
187
+ /**
188
+ * Clear the QR code cache (useful for memory management)
189
+ */
190
+ declare function clearQRCodeCache(): void;
176
191
  declare function StyledQRCode({ value, size, imageUrl, imageSize, darkMode, }: StyledQRCodeProps): react_jsx_runtime.JSX.Element;
177
192
 
178
193
  interface TransferCryptoButtonProps {
@@ -199,6 +214,45 @@ interface DepositTrackerButtonProps {
199
214
  }
200
215
  declare function DepositTrackerButton({ onClick, title, subtitle, badge, }: DepositTrackerButtonProps): react_jsx_runtime.JSX.Element;
201
216
 
217
+ declare global {
218
+ interface Window {
219
+ phantom?: {
220
+ solana?: PhantomSolanaProvider;
221
+ ethereum?: EthereumProvider;
222
+ };
223
+ solana?: PhantomSolanaProvider;
224
+ ethereum?: EthereumProvider;
225
+ }
226
+ }
227
+ interface PhantomSolanaProvider {
228
+ isPhantom?: boolean;
229
+ isConnected?: boolean;
230
+ publicKey?: {
231
+ toString(): string;
232
+ };
233
+ connect(opts?: {
234
+ onlyIfTrusted?: boolean;
235
+ }): Promise<{
236
+ publicKey: {
237
+ toString(): string;
238
+ };
239
+ }>;
240
+ disconnect(): Promise<void>;
241
+ on(event: string, callback: (...args: unknown[]) => void): void;
242
+ off(event: string, callback: (...args: unknown[]) => void): void;
243
+ }
244
+ interface EthereumProvider {
245
+ isMetaMask?: boolean;
246
+ isPhantom?: boolean;
247
+ selectedAddress?: string;
248
+ request(args: {
249
+ method: string;
250
+ params?: unknown[];
251
+ }): Promise<unknown>;
252
+ on(event: string, callback: (...args: unknown[]) => void): void;
253
+ removeListener(event: string, callback: (...args: unknown[]) => void): void;
254
+ }
255
+
202
256
  interface DepositExecutionItemProps {
203
257
  execution: AutoSwapResponse;
204
258
  onClick?: () => void;
@@ -227,7 +281,7 @@ declare function CurrencyListSection({ title, currencies, selectedCurrency, onSe
227
281
 
228
282
  declare const buttonVariants: (props?: ({
229
283
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
230
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
284
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
231
285
  } & class_variance_authority_types.ClassProp) | undefined) => string;
232
286
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
233
287
  asChild?: boolean;
@@ -263,8 +317,19 @@ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.S
263
317
  declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
264
318
 
265
319
  declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
266
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
267
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
320
+ /**
321
+ * Tooltip wrapper that supports both hover (desktop) and tap-to-toggle (mobile).
322
+ *
323
+ * Radix Tooltip only opens on hover, which is unusable on touch devices.
324
+ * This wrapper adds controlled open state so the trigger's onClick can toggle it,
325
+ * while preserving the default hover behavior on desktop.
326
+ */
327
+ declare function Tooltip({ children, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
328
+ /**
329
+ * Tooltip trigger that adds click-to-toggle for mobile/touch support.
330
+ * On desktop, hover still works as usual via Radix's built-in behavior.
331
+ */
332
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
268
333
  declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
269
334
 
270
335
  /**
@@ -572,4 +637,4 @@ declare function cn(...inputs: ClassValue[]): string;
572
637
  */
573
638
  declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
574
639
 
575
- export { type AllowedCountryResult, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, buttonVariants, cn, colors, defaultColors, getColors, mergeColors, resolveComponentTokens, truncateAddress, useAllowedCountry, useTheme };
640
+ export { type AllowedCountryResult, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, buttonVariants, clearQRCodeCache, cn, colors, defaultColors, getColors, isQRCodeCached, mergeColors, preloadQRCode, resolveComponentTokens, truncateAddress, useAllowedCountry, useTheme };
package/dist/index.d.ts CHANGED
@@ -24,6 +24,8 @@ interface DepositModalProps {
24
24
  showBalanceHeader?: boolean;
25
25
  /** Input variant for Transfer Crypto view: "single_input" or "double_input" (default) */
26
26
  transferInputVariant?: "single_input" | "double_input";
27
+ /** Enable browser wallet connection option. Defaults to false */
28
+ enableConnectWallet?: boolean;
27
29
  onDepositSuccess?: (data: {
28
30
  message: string;
29
31
  transaction?: unknown;
@@ -36,7 +38,7 @@ interface DepositModalProps {
36
38
  }) => void;
37
39
  theme?: "light" | "dark" | "auto";
38
40
  }
39
- declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, hideDepositTracker, showBalanceHeader, transferInputVariant, onDepositSuccess, onDepositError, theme, }: DepositModalProps): react_jsx_runtime.JSX.Element;
41
+ declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, hideDepositTracker, showBalanceHeader, transferInputVariant, enableConnectWallet, onDepositSuccess, onDepositError, theme, }: DepositModalProps): react_jsx_runtime.JSX.Element;
40
42
 
41
43
  interface DepositHeaderProps {
42
44
  title: string;
@@ -173,6 +175,19 @@ interface StyledQRCodeProps {
173
175
  imageSize?: number;
174
176
  darkMode?: boolean;
175
177
  }
178
+ /**
179
+ * Pre-generate a QR code and cache it for instant display later.
180
+ * Call this when wallet address is fetched, before modal opens.
181
+ */
182
+ declare function preloadQRCode(value: string, size?: number, imageUrl?: string, imageSize?: number, darkMode?: boolean): Promise<void>;
183
+ /**
184
+ * Check if a QR code is already cached
185
+ */
186
+ declare function isQRCodeCached(value: string, size?: number, imageUrl?: string, darkMode?: boolean): boolean;
187
+ /**
188
+ * Clear the QR code cache (useful for memory management)
189
+ */
190
+ declare function clearQRCodeCache(): void;
176
191
  declare function StyledQRCode({ value, size, imageUrl, imageSize, darkMode, }: StyledQRCodeProps): react_jsx_runtime.JSX.Element;
177
192
 
178
193
  interface TransferCryptoButtonProps {
@@ -199,6 +214,45 @@ interface DepositTrackerButtonProps {
199
214
  }
200
215
  declare function DepositTrackerButton({ onClick, title, subtitle, badge, }: DepositTrackerButtonProps): react_jsx_runtime.JSX.Element;
201
216
 
217
+ declare global {
218
+ interface Window {
219
+ phantom?: {
220
+ solana?: PhantomSolanaProvider;
221
+ ethereum?: EthereumProvider;
222
+ };
223
+ solana?: PhantomSolanaProvider;
224
+ ethereum?: EthereumProvider;
225
+ }
226
+ }
227
+ interface PhantomSolanaProvider {
228
+ isPhantom?: boolean;
229
+ isConnected?: boolean;
230
+ publicKey?: {
231
+ toString(): string;
232
+ };
233
+ connect(opts?: {
234
+ onlyIfTrusted?: boolean;
235
+ }): Promise<{
236
+ publicKey: {
237
+ toString(): string;
238
+ };
239
+ }>;
240
+ disconnect(): Promise<void>;
241
+ on(event: string, callback: (...args: unknown[]) => void): void;
242
+ off(event: string, callback: (...args: unknown[]) => void): void;
243
+ }
244
+ interface EthereumProvider {
245
+ isMetaMask?: boolean;
246
+ isPhantom?: boolean;
247
+ selectedAddress?: string;
248
+ request(args: {
249
+ method: string;
250
+ params?: unknown[];
251
+ }): Promise<unknown>;
252
+ on(event: string, callback: (...args: unknown[]) => void): void;
253
+ removeListener(event: string, callback: (...args: unknown[]) => void): void;
254
+ }
255
+
202
256
  interface DepositExecutionItemProps {
203
257
  execution: AutoSwapResponse;
204
258
  onClick?: () => void;
@@ -227,7 +281,7 @@ declare function CurrencyListSection({ title, currencies, selectedCurrency, onSe
227
281
 
228
282
  declare const buttonVariants: (props?: ({
229
283
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
230
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
284
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
231
285
  } & class_variance_authority_types.ClassProp) | undefined) => string;
232
286
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
233
287
  asChild?: boolean;
@@ -263,8 +317,19 @@ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.S
263
317
  declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
264
318
 
265
319
  declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
266
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
267
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
320
+ /**
321
+ * Tooltip wrapper that supports both hover (desktop) and tap-to-toggle (mobile).
322
+ *
323
+ * Radix Tooltip only opens on hover, which is unusable on touch devices.
324
+ * This wrapper adds controlled open state so the trigger's onClick can toggle it,
325
+ * while preserving the default hover behavior on desktop.
326
+ */
327
+ declare function Tooltip({ children, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
328
+ /**
329
+ * Tooltip trigger that adds click-to-toggle for mobile/touch support.
330
+ * On desktop, hover still works as usual via Radix's built-in behavior.
331
+ */
332
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
268
333
  declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
269
334
 
270
335
  /**
@@ -572,4 +637,4 @@ declare function cn(...inputs: ClassValue[]): string;
572
637
  */
573
638
  declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
574
639
 
575
- export { type AllowedCountryResult, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, buttonVariants, cn, colors, defaultColors, getColors, mergeColors, resolveComponentTokens, truncateAddress, useAllowedCountry, useTheme };
640
+ export { type AllowedCountryResult, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, buttonVariants, clearQRCodeCache, cn, colors, defaultColors, getColors, isQRCodeCached, mergeColors, preloadQRCode, resolveComponentTokens, truncateAddress, useAllowedCountry, useTheme };