@swype-org/react-sdk 0.1.35 → 0.1.38

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,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
2
3
 
3
4
  /** Wallet provider (e.g. MetaMask) */
4
5
  interface Provider {
@@ -490,4 +491,95 @@ interface UseTransferSigningOptions {
490
491
  */
491
492
  declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
492
493
 
493
- export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, type PaymentStep, type Provider, type SourceOption, type SourceSelection, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
494
+ interface ScreenLayoutProps {
495
+ children: ReactNode;
496
+ /** Content pinned to the bottom of the screen (buttons, footer) */
497
+ footer?: ReactNode;
498
+ }
499
+ declare function ScreenLayout({ children, footer }: ScreenLayoutProps): react_jsx_runtime.JSX.Element;
500
+
501
+ interface ScreenHeaderProps {
502
+ /** Center title text */
503
+ title?: string;
504
+ /** Right-aligned element (avatar, close button, etc.) */
505
+ right?: ReactNode;
506
+ /** Called when back arrow is pressed. Omit to hide the back arrow. */
507
+ onBack?: () => void;
508
+ /** Optional secondary label next to the title (e.g. "Simple") */
509
+ badge?: string;
510
+ }
511
+ declare function ScreenHeader({ title, right, onBack, badge }: ScreenHeaderProps): react_jsx_runtime.JSX.Element;
512
+
513
+ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
514
+
515
+ interface PrimaryButtonProps {
516
+ children: ReactNode;
517
+ onClick?: () => void;
518
+ disabled?: boolean;
519
+ loading?: boolean;
520
+ /** Optional icon element rendered left of the label */
521
+ icon?: ReactNode;
522
+ }
523
+ declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
524
+
525
+ interface OutlineButtonProps {
526
+ children: ReactNode;
527
+ onClick?: () => void;
528
+ disabled?: boolean;
529
+ }
530
+ declare function OutlineButton({ children, onClick, disabled }: OutlineButtonProps): react_jsx_runtime.JSX.Element;
531
+
532
+ type IconCircleVariant = 'accent' | 'success' | 'error';
533
+ interface IconCircleProps {
534
+ children: ReactNode;
535
+ variant?: IconCircleVariant;
536
+ size?: number;
537
+ }
538
+ declare function IconCircle({ children, variant, size }: IconCircleProps): react_jsx_runtime.JSX.Element;
539
+
540
+ interface StepItem {
541
+ label: string;
542
+ /** Optional sublabel (e.g. "$100 limit · 2 tokens approved") */
543
+ detail?: string;
544
+ status: 'pending' | 'active' | 'complete';
545
+ }
546
+ interface StepListProps {
547
+ steps: StepItem[];
548
+ }
549
+ declare function StepList({ steps }: StepListProps): react_jsx_runtime.JSX.Element;
550
+
551
+ interface SettingsMenuProps {
552
+ onLogout: () => void;
553
+ }
554
+ declare function SettingsMenu({ onLogout }: SettingsMenuProps): react_jsx_runtime.JSX.Element;
555
+
556
+ interface SpinnerProps {
557
+ size?: number;
558
+ label?: string;
559
+ }
560
+ declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
561
+
562
+ interface ChainChoice {
563
+ chainName: string;
564
+ balance: number;
565
+ tokens: {
566
+ tokenSymbol: string;
567
+ balance: number;
568
+ }[];
569
+ }
570
+ interface SelectSourceScreenProps {
571
+ choices: ChainChoice[];
572
+ selectedChainName: string;
573
+ selectedTokenSymbol: string;
574
+ recommended: {
575
+ chainName: string;
576
+ tokenSymbol: string;
577
+ } | null;
578
+ onChainChange: (chainName: string) => void;
579
+ onTokenChange: (tokenSymbol: string) => void;
580
+ onConfirm: () => void;
581
+ onLogout: () => void;
582
+ }
583
+ declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
584
+
585
+ export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
2
3
 
3
4
  /** Wallet provider (e.g. MetaMask) */
4
5
  interface Provider {
@@ -490,4 +491,95 @@ interface UseTransferSigningOptions {
490
491
  */
491
492
  declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
492
493
 
493
- export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, type PaymentStep, type Provider, type SourceOption, type SourceSelection, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
494
+ interface ScreenLayoutProps {
495
+ children: ReactNode;
496
+ /** Content pinned to the bottom of the screen (buttons, footer) */
497
+ footer?: ReactNode;
498
+ }
499
+ declare function ScreenLayout({ children, footer }: ScreenLayoutProps): react_jsx_runtime.JSX.Element;
500
+
501
+ interface ScreenHeaderProps {
502
+ /** Center title text */
503
+ title?: string;
504
+ /** Right-aligned element (avatar, close button, etc.) */
505
+ right?: ReactNode;
506
+ /** Called when back arrow is pressed. Omit to hide the back arrow. */
507
+ onBack?: () => void;
508
+ /** Optional secondary label next to the title (e.g. "Simple") */
509
+ badge?: string;
510
+ }
511
+ declare function ScreenHeader({ title, right, onBack, badge }: ScreenHeaderProps): react_jsx_runtime.JSX.Element;
512
+
513
+ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
514
+
515
+ interface PrimaryButtonProps {
516
+ children: ReactNode;
517
+ onClick?: () => void;
518
+ disabled?: boolean;
519
+ loading?: boolean;
520
+ /** Optional icon element rendered left of the label */
521
+ icon?: ReactNode;
522
+ }
523
+ declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
524
+
525
+ interface OutlineButtonProps {
526
+ children: ReactNode;
527
+ onClick?: () => void;
528
+ disabled?: boolean;
529
+ }
530
+ declare function OutlineButton({ children, onClick, disabled }: OutlineButtonProps): react_jsx_runtime.JSX.Element;
531
+
532
+ type IconCircleVariant = 'accent' | 'success' | 'error';
533
+ interface IconCircleProps {
534
+ children: ReactNode;
535
+ variant?: IconCircleVariant;
536
+ size?: number;
537
+ }
538
+ declare function IconCircle({ children, variant, size }: IconCircleProps): react_jsx_runtime.JSX.Element;
539
+
540
+ interface StepItem {
541
+ label: string;
542
+ /** Optional sublabel (e.g. "$100 limit · 2 tokens approved") */
543
+ detail?: string;
544
+ status: 'pending' | 'active' | 'complete';
545
+ }
546
+ interface StepListProps {
547
+ steps: StepItem[];
548
+ }
549
+ declare function StepList({ steps }: StepListProps): react_jsx_runtime.JSX.Element;
550
+
551
+ interface SettingsMenuProps {
552
+ onLogout: () => void;
553
+ }
554
+ declare function SettingsMenu({ onLogout }: SettingsMenuProps): react_jsx_runtime.JSX.Element;
555
+
556
+ interface SpinnerProps {
557
+ size?: number;
558
+ label?: string;
559
+ }
560
+ declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
561
+
562
+ interface ChainChoice {
563
+ chainName: string;
564
+ balance: number;
565
+ tokens: {
566
+ tokenSymbol: string;
567
+ balance: number;
568
+ }[];
569
+ }
570
+ interface SelectSourceScreenProps {
571
+ choices: ChainChoice[];
572
+ selectedChainName: string;
573
+ selectedTokenSymbol: string;
574
+ recommended: {
575
+ chainName: string;
576
+ tokenSymbol: string;
577
+ } | null;
578
+ onChainChange: (chainName: string) => void;
579
+ onTokenChange: (tokenSymbol: string) => void;
580
+ onConfirm: () => void;
581
+ onLogout: () => void;
582
+ }
583
+ declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
584
+
585
+ export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };