import { type VariantProps } from "class-variance-authority"; import * as React from "react"; declare const formVariants: (props?: ({ variant?: "default" | "solid" | "bordered" | null | undefined; layout?: "default" | "compact" | "relaxed" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; /** * Represents a field in a form component * @property {string} id - Unique identifier for the field * @property {'text' | 'number' | 'select' | 'textarea' | 'radio' | 'checkbox' | 'slider' | 'yes-no'} type - Type of form field * @property {string} label - Display label for the field * @property {string} [placeholder] - Optional placeholder text * @property {string[]} [options] - Options for select fields * @property {boolean} [required] - Whether the field is required * @property {string} [description] - Additional description text for the field * @property {number} [sliderMin] - The minimum value for slider fields * @property {number} [sliderMax] - The maximum value for slider fields * @property {number} [sliderStep] - The step value for slider fields * @property {number} [sliderDefault] - Default value for slider fields * @property {string[]} [sliderLabels] - Labels to display under slider (typically at min, middle, max positions) */ export interface FormField { /** * The unique identifier for the field */ id: string; /** * The type of form field */ type: "text" | "number" | "select" | "textarea" | "radio" | "checkbox" | "slider" | "yes-no"; /** * The display label for the field */ label: string; /** * The placeholder text for the field */ placeholder?: string; /** * The options for select fields */ options?: string[]; /** * Whether the field is required */ required?: boolean; /** * The description text for the field */ description?: string; /** * The minimum value for slider fields */ sliderMin?: number; /** * The maximum value for slider fields */ sliderMax?: number; /** * The step value for slider fields */ sliderStep?: number; /** * Default value for slider fields */ sliderDefault?: number; /** * Labels to display under slider (typically at min, middle, max positions) */ sliderLabels?: string[]; } export interface FormState { values: Record; openDropdowns: Record; selectedValues: Record; yesNoSelections: Record; checkboxSelections: Record; } /** * Props for the Form component * @interface */ export interface FormProps extends Omit, "onSubmit" | "onError">, VariantProps { /** Array of form fields to display */ fields: FormField[]; /** Callback function called when the form is submitted */ onSubmit: (data: Record) => void; /** Optional error message to display */ onError?: string; /** Text to display on the submit button (default: "Submit") */ submitText?: string; } /** * A flexible form component that supports various field types and layouts * @component * @example * ```tsx *
console.log(data)} * variant="solid" * layout="compact" * className="custom-styles" * /> * ``` */ export declare const FormComponent: React.ForwardRefExoticComponent>; export { formVariants }; //# sourceMappingURL=form.d.ts.map