"use client" import * as React from "react" import { Button } from "@/components/ui/button" import { Wizard, WizardContent, WizardFooter, WizardNav, WizardPanel, WizardProgress, WizardStepGuidance, WizardStepHeading, type WizardStep, } from "@/components/ui/wizard" import { Field, FieldLabel } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { DS_DOC_BODY } from "@/lib/design-system/doc-typography" import { cn } from "@/lib/utils" const DEMO_STEPS: WizardStep[] = [ { id: "student", label: "Student", description: "Who is rotating", icon: "fa-user-graduate" }, { id: "site", label: "Site", description: "Placement location", icon: "fa-hospital" }, { id: "review", label: "Review", description: "Confirm details", icon: "fa-clipboard-check" }, ] const MANY_STEPS: WizardStep[] = [ { id: "s1", label: "Program", description: "Scope" }, { id: "s2", label: "Student", description: "Learner" }, { id: "s3", label: "Site", description: "Location" }, { id: "s4", label: "Preceptor", description: "Supervisor" }, { id: "s5", label: "Schedule", description: "Dates" }, { id: "s6", label: "Compliance", description: "Clearance" }, { id: "s7", label: "Documents", description: "Attachments" }, { id: "s8", label: "Review", description: "Confirm" }, ] function WizardDemoBody({ title, stepId }: { title: string; stepId: string }) { return ( <> {title} {title} ) } function useStepState(max: number, initial = 0) { const [step, setStep] = React.useState(initial) return { step, setStep, back: () => setStep((s) => Math.max(0, s - 1)), next: () => setStep((s) => Math.min(max - 1, s + 1)), reset: () => setStep(0), } } export function WizardHorizontalNumberedPreview() { const { step, setStep, back, next, reset } = useStepState(DEMO_STEPS.length, 1) return ( {DEMO_STEPS.map((s, i) => ( ))} ) } export function WizardHorizontalIconsPreview() { const { step, back, next } = useStepState(DEMO_STEPS.length, 1) return (
) } export function WizardHorizontalCompactPreview() { const { step, setStep } = useStepState(DEMO_STEPS.length, 1) return ( `Step ${c} of ${t}`} /> ) } export function WizardVerticalNumberedPreview() { const { step, setStep, back, next, reset } = useStepState(DEMO_STEPS.length, 1) return ( ) } export function WizardVerticalIconsPreview() { const { step, back, next } = useStepState(DEMO_STEPS.length, 0) return (
) } export function WizardErrorStatePreview() { const stepsWithError = DEMO_STEPS.map((s, i) => ({ ...s, error: i === 1, })) return ( Site

Resolve validation errors before continuing.

) } /** Edge-case stress test — overflow + guidance; not a product IA target. */ export function WizardManyStepsPreview() { const { step, setStep, back, next } = useStepState(MANY_STEPS.length, 3) return ( undefined} submitLabel="Finish" /> ) } /** All variants on one page for catalog / QA. */ export function WizardAllVariantsPreview() { return (

Horizontal numbered

Horizontal icons

Horizontal compact

Vertical numbered

Vertical icons

Error state

Edge case: overflow (8 steps)

Stress test for scroll arrows and guidance — do not ship eight top-level chapters in product.

) }