@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
27 lines (26 loc) • 1.04 kB
TypeScript
import { type AnyKitForm } from '../../../runtime/formRuntime.js';
export type FormStatusKind = 'dirty' | 'saving' | 'saved' | 'error';
export interface FormStatusProps {
/** Defaults to the form in context. */
form?: AnyKitForm;
/** Which states to report. Default all. */
show?: readonly FormStatusKind[];
}
/**
* A polite status line. Unsaved changes, saving, saved or couldn't save.
*
* @remarks
* `FormStatus` says what's happening to the form's data in a polite live region, so screen readers
* hear it without losing their place: "Unsaved changes", "Saving…", "Saved", "Couldn't save". It
* pairs with {@link useAutosave | `useAutosave`}.
*
* @example In a schema
* ```json
* { "content": "status" }
* ```
*
* @privateRemarks
* A polite status line: "Unsaved changes", "Saving…", "Saved", "Couldn't save". Pairs with
* `useAutosave`. The live region is always rendered so changes are announced.
*/
export declare function FormStatus({ form, show }: FormStatusProps): import("react").JSX.Element;