/** * `` — name-input dialog for the "Save New" flow. * * Architecture §9.4 / UX §5.2 State 6 / Story FFCS-FFCS-E003-S013. * * Composition: * - `lib/ui/dialog` shim (kept aligned with the shadcn Dialog API). * - Siesa UI Kit `Input` (label, placeholder, error state built-in). * - Siesa UI Kit `Button` for Cancel (outline) and Save (filled). * - lucide-react `Loader2` spinner while a mutation is in-flight. * - lucide-react `X` for the close button. * - `useFormCacheSelectorSchema` — Zod schema with i18n-bound messages. * * Behavior: * - Auto-focused, single-line text input. Max length is 51 to allow Zod to * report the over-50 error rather than silently truncating. * - Character counter rendered as `{n} / 50` right-aligned below the input. * - On submit: * 1. Run Zod validation locally — show inline error and short-circuit * if invalid. * 2. Call `onSubmit(name)`. The parent hook handles the API call, * 409 surfacing, success banner, and dialog dismissal. * - When the user types, both the local validation error and any server * error (e.g. 409) are cleared so the user can retry without confusion. * - `serverError` is a translation key supplied by the parent (e.g. * `errors.nameAlreadyExists`). The dialog renders it through `t(...)`. */ export interface SaveDialogProps { /** Whether the dialog is currently visible. Controlled by the parent. */ open: boolean; /** Toggle handler — invoked when the dialog wants to close (e.g. cancel). */ onOpenChange: (open: boolean) => void; /** * Submit handler. Receives the trimmed user-supplied name. The parent is * responsible for the actual upsert call, the 409 → serverError mapping, * and dismissing the dialog on success. */ onSubmit: (name: string) => Promise; /** True while any mutation is in-flight — disables submit, shows spinner. */ isMutating: boolean; /** * Translation key for a server-side error (typically a 409 conflict) to * render inline. `null` when there is no server error to show. */ serverError: string | null; /** Clears the server error — called as the user starts editing the input. */ onServerErrorClear: () => void; } export declare function SaveDialog({ open, onOpenChange, onSubmit, isMutating, serverError, onServerErrorClear, }: SaveDialogProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=SaveDialog.d.ts.map