"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "@stigmer/theme";
/**
 * Navigation footer for the wizard shell.
 *
 * Renders Back / Next|Submit buttons in a standardized layout.
 * The primary (right-side) button adapts its label and loading
 * state based on whether it's the final step.
 *
 * Keyboard: Enter triggers the primary action when focused within
 * the wizard content (not within text areas or other multi-line inputs).
 */
export function WizardNav({ showBack, nextLabel, nextDisabled, isSubmitting, onBack, onNext, onCancel, className, }) {
    return (_jsxs("div", { className: cn("flex items-center justify-between border-t border-border px-6 py-4", className), children: [_jsx("div", { className: "flex items-center gap-2", children: onCancel && (_jsx("button", { type: "button", onClick: onCancel, disabled: isSubmitting, className: cn("rounded-md px-3 py-1.5 text-sm", "text-muted-foreground transition-colors", "hover:text-foreground hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: "Cancel" })) }), _jsxs("div", { className: "flex items-center gap-2", children: [showBack && (_jsxs("button", { type: "button", onClick: onBack, disabled: isSubmitting, className: cn("inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors", "hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: [_jsx(ArrowLeftIcon, { className: "size-3.5" }), "Back"] })), _jsxs("button", { type: "button", onClick: onNext, disabled: nextDisabled || isSubmitting, className: cn("inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground transition-colors", "hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-40"), children: [isSubmitting && _jsx(SpinnerIcon, {}), nextLabel, !isSubmitting && _jsx(ArrowRightIcon, { className: "size-3.5" })] })] })] }));
}
// ---------------------------------------------------------------------------
// Icons
// ---------------------------------------------------------------------------
function ArrowLeftIcon({ className }) {
    return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M10 3 5 8l5 5" }) }));
}
function ArrowRightIcon({ className }) {
    return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m6 3 5 5-5 5" }) }));
}
function SpinnerIcon() {
    return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
}
//# sourceMappingURL=WizardNav.js.map