UNPKG

lightning-auth-and-payment

Version:

Lightning Network authentication and payment processing library for modern web applications

157 lines 5.81 kB
import React from 'react'; import { ButtonProps } from './ui/button'; /** * Button size variants */ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Button state variants */ export type ButtonState = 'idle' | 'loading' | 'success' | 'error' | 'disabled'; /** * Animation types for button interactions */ export type ButtonAnimation = 'none' | 'pulse' | 'bounce' | 'glow' | 'ripple' | 'scale'; /** * Icon position options */ export type IconPosition = 'left' | 'right' | 'top' | 'bottom' | 'none'; /** * Lightning-specific styling variants */ export type LightningStyle = 'default' | 'gradient' | 'outline' | 'ghost' | 'solid' | 'minimal'; /** * Enhanced props for the LightningButton component */ export interface LightningButtonProps extends Omit<ButtonProps, 'variant' | 'size'> { /** Button variant */ variant?: 'lightning' | 'payment' | 'wallet' | 'send' | 'download' | 'copy' | 'external' | 'connect' | 'disconnect'; /** Button size */ size?: ButtonSize; /** Button state */ state?: ButtonState; /** Show loading state (deprecated, use state prop) */ isLoading?: boolean; /** Show success state (deprecated, use state prop) */ isSuccess?: boolean; /** Show error state (deprecated, use state prop) */ isError?: boolean; /** Custom icon */ icon?: React.ReactNode; /** Hide icon */ hideIcon?: boolean; /** Icon position */ iconPosition?: IconPosition; /** Lightning-specific styling */ lightningStyle?: LightningStyle; /** Animation type */ animation?: ButtonAnimation; /** Animation on hover */ animateOnHover?: boolean; /** Pulse effect (deprecated, use animation prop) */ pulse?: boolean; /** Full width button */ fullWidth?: boolean; /** Loading text */ loadingText?: string; /** Success text */ successText?: string; /** Error text */ errorText?: string; /** Auto-reset state after success/error */ autoReset?: boolean; /** Auto-reset delay in milliseconds */ autoResetDelay?: number; /** Ripple effect on click */ ripple?: boolean; /** Glow effect */ glow?: boolean; /** Custom gradient colors */ gradientColors?: { from: string; to: string; hoverFrom: string; hoverTo: string; }; /** Custom success colors */ successColors?: { background: string; text: string; border: string; }; /** Custom error colors */ errorColors?: { background: string; text: string; border: string; }; /** Callback when state changes */ onStateChange?: (state: ButtonState) => void; /** Callback when animation completes */ onAnimationComplete?: (animation: ButtonAnimation) => void; } /** * Enhanced LightningButton component with comprehensive features * * @example * ```tsx * <LightningButton * variant="lightning" * size="lg" * state="loading" * animation="pulse" * onClick={handleClick} * loadingText="Connecting..." * successText="Connected!" * autoReset * > * Login with Lightning * </LightningButton> * ``` */ export declare function LightningButton({ variant, size, state, isLoading, isSuccess, isError, icon, hideIcon, iconPosition, lightningStyle, animation, animateOnHover, pulse, fullWidth, loadingText, successText, errorText, autoReset, autoResetDelay, ripple, glow, gradientColors, successColors, errorColors, onStateChange, onAnimationComplete, className, children, disabled, onClick, ...props }: LightningButtonProps): import("react/jsx-runtime").JSX.Element; /** * LightningPayButton - Enhanced convenience component for payment actions */ export declare function LightningPayButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningWalletButton - Enhanced convenience component for wallet actions */ export declare function LightningWalletButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningSendButton - Enhanced convenience component for send actions */ export declare function LightningSendButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningCopyButton - Enhanced convenience component for copy actions */ export declare function LightningCopyButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningDownloadButton - Enhanced convenience component for download actions */ export declare function LightningDownloadButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningExternalButton - Enhanced convenience component for external link actions */ export declare function LightningExternalButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningConnectButton - Enhanced convenience component for connection actions */ export declare function LightningConnectButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * LightningDisconnectButton - Enhanced convenience component for disconnection actions */ export declare function LightningDisconnectButton(props: Omit<LightningButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element; /** * Enhanced LightningButton with state management hook */ export declare function useLightningButtonState(initialState?: ButtonState): { state: ButtonState; setState: React.Dispatch<React.SetStateAction<ButtonState>>; setLoading: () => void; setSuccess: () => void; setError: () => void; setIdle: () => void; setDisabled: () => void; }; //# sourceMappingURL=LightningButton.d.ts.map