"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" /> ) } export function WizardScaleGuidancePreview() { const guidance = [ { range: "3 to 5 steps", title: "Horizontal", body: "Keep every top-level chapter visible. Use numbered markers when order matters.", icon: "fa-arrow-right", }, { range: "6 to 8 steps", title: "Vertical or regroup", body: "Use a vertical rail for named chapters. First check whether related steps can become sections inside one chapter.", icon: "fa-arrow-down", }, { range: "More than 8 steps", title: "Restructure the flow", body: "Group work into at most six top-level chapters, support drafts, and split independent jobs into separate routes. Use a vertical rail only when the sequence cannot change.", icon: "fa-diagram-project", }, ] return (
{guidance.map((item) => (