aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
117 lines • 2.91 kB
TypeScript
import React from "react";
export interface FormStep {
id: string;
title: string;
description?: string;
icon?: React.ReactNode;
component: React.ComponentType<any>;
validation?: (data: any) => boolean | Promise<boolean>;
validationMessage?: string;
optional?: boolean;
data?: any;
}
export interface GlassMultiStepFormProps {
/**
* Form steps configuration
*/
steps?: FormStep[];
/**
* Initial form data
*/
initialData?: Record<string, any>;
/**
* Form submission handler
*/
onSubmit?: (data: Record<string, any>) => void | Promise<void>;
/**
* Form cancellation handler
*/
onCancel?: () => void;
/**
* Step change handler
*/
onStepChange?: (stepIndex: number, data: Record<string, any>) => void;
/**
* Form title
*/
title?: string;
/**
* Form description
*/
description?: string;
/**
* Show step progress indicator
*/
showProgress?: boolean;
/**
* Show step navigation buttons
*/
showNavigation?: boolean;
/**
* Allow skipping optional steps
*/
allowSkip?: boolean;
/**
* Custom submit button text
*/
submitButtonText?: string;
/**
* Custom cancel button text
*/
cancelButtonText?: string;
/**
* Loading state
*/
loading?: boolean;
/**
* Form validation mode
*/
validationMode?: "onChange" | "onSubmit" | "onBlur";
/**
* Show step summary
*/
showSummary?: boolean;
/**
* Custom className
*/
className?: string;
}
interface FormContextType {
currentStep: number;
totalSteps: number;
formData: Record<string, any>;
updateFormData: (stepId: string, data: any) => void;
goToStep: (step: number) => void;
nextStep: () => void;
prevStep: () => void;
isStepValid: (stepIndex: number) => Promise<boolean>;
isStepCompleted: (stepIndex: number) => boolean;
validationMode: "onChange" | "onSubmit" | "onBlur";
}
export declare const useFormContext: () => FormContextType | {
currentStep: number;
totalSteps: number;
formData: {};
errors: {};
isValid: boolean;
nextStep: () => void;
prevStep: () => void;
goToStep: () => void;
updateData: () => void;
validateStep: () => boolean;
validationMode: "onSubmit";
};
/**
* GlassMultiStepForm component
* A comprehensive multi-step form with validation, progress tracking, and smooth transitions
*/
export declare const GlassMultiStepForm: React.FC<GlassMultiStepFormProps>;
export interface GlassFormStepProps {
children: React.ReactNode;
title?: string;
description?: string;
className?: string;
}
export declare const GlassFormStep: React.FC<GlassFormStepProps>;
export default GlassMultiStepForm;
//# sourceMappingURL=GlassMultiStepForm.d.ts.map