import { t as e } from "../../utils-B7XIe3qq.js";
import { t } from "../../check-CybgTpDT.js";
import { t as n } from "../../x-BleQvk5v.js";
import * as r from "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
//#region src/react/primitives/stepper.tsx
var o = r.createContext({ orientation: "horizontal" });
function s({ className: t, orientation: n = "horizontal", children: a, ...s }) {
	let c = r.useMemo(() => ({ orientation: n }), [n]);
	return /* @__PURE__ */ i(o.Provider, {
		value: c,
		children: /* @__PURE__ */ i("nav", {
			"data-slot": "stepper",
			"aria-label": "Progress",
			className: e(t),
			...s,
			children: /* @__PURE__ */ i("ol", {
				className: e("flex gap-2", n === "vertical" ? "flex-col" : "items-center"),
				children: a
			})
		})
	});
}
function c({ className: s, step: c, label: l, description: u, status: d = "pending", isLast: f = !1, icon: p, onClick: m, ...h }) {
	let { orientation: g } = r.useContext(o), _ = d !== "disabled" && m !== void 0;
	return /* @__PURE__ */ a("li", {
		"data-slot": "stepper-item",
		"data-status": d,
		className: e("flex gap-3", g === "horizontal" && "flex-1 items-center", g === "vertical" && "relative pb-8 last:pb-0", s),
		...h,
		children: [
			/* @__PURE__ */ a("div", {
				className: e("flex items-center gap-3", g === "horizontal" && "flex-col sm:flex-row", g === "vertical" && "items-start"),
				children: [/* @__PURE__ */ i("button", {
					type: "button",
					disabled: !_,
					onClick: _ ? m : void 0,
					"aria-current": d === "active" ? "step" : void 0,
					className: e("relative z-10 flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-medium transition-all", d === "pending" && "border-border-glass bg-surface-secondary text-foreground-secondary", d === "active" && "border-primary bg-primary text-primary-foreground shadow-glow", d === "complete" && "border-primary bg-primary text-primary-foreground", d === "error" && "border-destructive bg-destructive text-destructive-foreground", d === "disabled" && "border-border-glass bg-surface-secondary text-foreground-secondary/50 cursor-not-allowed opacity-50", _ && "cursor-pointer hover:shadow-glow"),
					children: p || (d === "complete" ? /* @__PURE__ */ i(t, { className: "size-4" }) : d === "error" ? /* @__PURE__ */ i(n, { className: "size-4" }) : c)
				}), /* @__PURE__ */ a("div", {
					className: "flex flex-col",
					children: [/* @__PURE__ */ i("span", {
						className: e("text-sm font-medium", d === "active" && "text-foreground", d === "complete" && "text-foreground", d === "pending" && "text-foreground-secondary", d === "error" && "text-destructive", d === "disabled" && "text-foreground-secondary/50"),
						children: l
					}), u && /* @__PURE__ */ i("span", {
						className: e("text-xs", d === "disabled" ? "text-foreground-secondary/40" : "text-foreground-secondary"),
						children: u
					})]
				})]
			}),
			!f && g === "horizontal" && /* @__PURE__ */ i("div", {
				"data-slot": "stepper-connector",
				"aria-hidden": "true",
				className: e("mx-2 h-0.5 flex-1 rounded-full transition-colors", d === "complete" ? "bg-primary" : "bg-border-glass")
			}),
			!f && g === "vertical" && /* @__PURE__ */ i("div", {
				"data-slot": "stepper-connector",
				"aria-hidden": "true",
				className: e("absolute left-[15px] top-10 h-[calc(100%-2.5rem)] w-0.5 rounded-full transition-colors", d === "complete" ? "bg-primary" : "bg-border-glass")
			})
		]
	});
}
//#endregion
export { s as Stepper, c as StepperItem };

//# sourceMappingURL=stepper.js.map