import type { ReactNode } from "react"; /** One step of a wizard: its stepper label, body, validation and review summary. */ export type WizardStep = { /** Stable key for the step; the value of `stepId` and what `onStepChange` receives. */ id: string; /** Stepper label and the heading shown above the step content. */ label: string; /** Body rendered below the step heading; stays in the tree only while this step is current. */ content: ReactNode; /** Messages that block leaving this step; [] = valid. Must be pure (runs in the reducer). */ validate?: () => string[]; /** One line shown in the review on the last step; steps without it are not reviewed. */ summary?: ReactNode; }; /** Visible strings; every key falls back to its English default. */ export type WizardLabels = Partial<{ /** Back button. Default "Back". */ back: string; /** Continue button on every step but the last. Default "Continue". */ next: string; /** Finish button on the last step. Default "Finish". */ finish: string; /** Cancel button text. Default "Cancel". */ cancel: string; /** Progress line above the step heading, from the 1-based step number and the step count. Default "Step N of M". */ stepOf: (current: number, total: number) => string; /** Title of the error summary shown when a step fails validation. Default "Fix the following to continue". */ fixErrors: string; /** Heading of the review block on the last step. Default "Review". */ review: string; }>; /** Props for the wizard dialog: Modal (or inline with `chrome`) + stepper + per-step validation + review on the last step. */ export interface WizardDialogProps { /** Shows the wizard; closing resets uncontrolled progress to the first step. */ isOpen: boolean; /** Ignored while `isFinishing`. */ onClose: () => void; /** Dialog title, or the heading above the inline wizard. */ title: string; /** Muted line under the title. */ subtitle?: string; /** Ordered steps; the stepper locks every step beyond the furthest one validly reached. */ steps: WizardStep[]; /** Called after every step re-validates; a failing step is jumped to with its errors. */ onFinish: () => void; /** Shows the Finish spinner and disables close, Esc, Back and Cancel. */ isFinishing?: boolean; /** Disables Finish on the last step (a pending upload, say); Back and the stepper still work. */ finishDisabled?: boolean; /** Why Finish is disabled; shown beside it and wired as its `aria-describedby`. Needs `finishDisabled`. */ finishBlockedReason?: string; /** Controlled step; omit for uncontrolled (resets to the first step on close). */ stepId?: string; /** Fires whenever the visible step changes, controlled or not. */ onStepChange?: (stepId: string) => void; /** Modal width; default "3xl". Ignored when `chrome` is "inline". */ size?: "lg" | "xl" | "2xl" | "3xl" | "4xl"; /** "inline" draws the wizard in place with no Modal (no overlay, focus trap, close X, Esc or dialog role) for a host that is already the dialog, such as a WorkspaceWindow; it renders nothing while closed and Cancel still calls `onClose`. Default "modal". */ chrome?: "modal" | "inline"; /** Overrides button and message text; omitted keys keep their English defaults. */ labels?: WizardLabels; /** Test id of the step body; the inline frame uses it with an `-inline` suffix. Defaults to "wizard-dialog". */ "data-testid"?: string; } /** Same flow inline (a page section, not a modal) — for full-page wizards. */ export interface WizardProps extends Omit { /** Renders a Cancel button in the footer when provided. */ onCancel?: () => void; }