import { CheckIcon } from "lucide-react"; import type { ComponentProps, ReactNode } from "react"; import { cn } from "../../lib/utils"; import { AnimatedHeight } from "../AnimatedHeight"; import { DialogPopup, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "./dialog"; /** Compose a wizard from its header, panel, and footer; flow logic stays with the caller. */ export function WizardPopup({ children, ...props }: Omit, "className" | "style">) { return (
{children}
); } export function WizardHeader({ title, description, identity, children, }: { readonly title: ReactNode; readonly description?: ReactNode; /** Optional branding shown in place of the visible title. The title remains accessible. */ readonly identity?: ReactNode; readonly children?: ReactNode; }) { return ( {title} {identity} {description ? {description} : null} {children} ); } export function WizardFooter({ children, leading, }: { readonly children: ReactNode; readonly leading?: ReactNode; }) { return ( {leading} {leading ? (
{children}
) : ( children )}
); } export function WizardSteps({ steps, currentStep, summaries, showSummaries = false, onStepChange, isStepDisabled, }: { readonly steps: readonly string[]; readonly currentStep: number; readonly summaries?: readonly (string | null)[]; readonly showSummaries?: boolean; readonly isStepDisabled?: (step: number) => boolean; readonly onStepChange?: (step: number) => void; }) { const Step = onStepChange ? "button" : "div"; return (
    {steps.map((step, index) => (
  1. onStepChange(index) : undefined} > {index < currentStep ? : index + 1} {step} {showSummaries && index < currentStep && summaries?.[index] ? `: ${summaries[index]}` : null}
  2. ))}
); } export function WizardPanel({ children, holdHeight = false, }: { readonly children: ReactNode; readonly holdHeight?: boolean; }) { return (
{children}
); }