aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
113 lines • 2.53 kB
TypeScript
import React from "react";
export interface FormStep {
id: string;
title: string;
description?: string;
sections: any[];
optional?: boolean;
validation?: (values: any) => Promise<Record<string, string>>;
}
export interface GlassFormTemplateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "autoSave"> {
/**
* Form title
*/
title: string;
/**
* Form description
*/
description?: string;
/**
* Form steps (for multi-step forms)
*/
steps?: FormStep[];
/**
* Single form schema (for single-step forms)
*/
schema?: any[];
/**
* Form values
*/
values?: Record<string, any>;
/**
* Form errors
*/
errors?: Record<string, string>;
/**
* Whether form is in multi-step mode
*/
multiStep?: boolean;
/**
* Current step index
*/
currentStep?: number;
/**
* Step change handler
*/
onStepChange?: (step: number) => void;
/**
* Form submit handler
*/
onSubmit?: (values: Record<string, any>) => Promise<void> | void;
/**
* Form cancel handler
*/
onCancel?: () => void;
/**
* Value change handler
*/
onChange?: (values: Record<string, any>) => void;
/**
* Form validation handler
*/
onValidate?: (values: Record<string, any>) => Record<string, string>;
/**
* Loading state
*/
loading?: boolean;
/**
* Whether form can be saved as draft
*/
allowDraft?: boolean;
/**
* Draft save handler
*/
onSaveDraft?: (values: Record<string, any>) => void;
/**
* Form layout
*/
layout?: "default" | "centered" | "sidebar";
/**
* Sidebar content (for sidebar layout)
*/
sidebar?: React.ReactNode;
/**
* Show progress indicator
*/
showProgress?: boolean;
/**
* Auto-save functionality
*/
autoSave?: boolean;
/**
* Submit button text
*/
submitText?: string;
/**
* Cancel button text
*/
cancelText?: string;
/**
* Next button text
*/
nextText?: string;
/**
* Previous button text
*/
previousText?: string;
}
/**
* GlassFormTemplate component
* Comprehensive form template with single-step and multi-step support
*/
export declare const GlassFormTemplate: React.ForwardRefExoticComponent<GlassFormTemplateProps & React.RefAttributes<HTMLDivElement>>;
//# sourceMappingURL=GlassFormTemplate.d.ts.map