import { jsx } from "react/jsx-runtime";
/* empty css                    */
import Stepper$1 from "../../node_modules/@mui/material/Stepper/Stepper.js";
import Step from "../../node_modules/@mui/material/Step/Step.js";
import StepLabel from "../../node_modules/@mui/material/StepLabel/StepLabel.js";
import Typography from "../../node_modules/@mui/material/Typography/Typography.js";
const MUI_VARIANTS = ["elevation", "outlined"];
function DefaultStepper({
  steps,
  activeStep,
  orientation,
  handleStep,
  width = "100%",
  variant,
  ...args
}) {
  const muiVariant = variant && MUI_VARIANTS.includes(variant) ? variant : void 0;
  return /* @__PURE__ */ jsx(
    Stepper$1,
    {
      activeStep,
      className: "ia-styles ia-stepper ia-stepper-horizontal",
      orientation: orientation ?? "horizontal",
      sx: { width },
      variant: muiVariant,
      ...args,
      children: steps.length > 0 && steps.map((step, index) => /* @__PURE__ */ jsx(Step, { onClick: () => handleStep == null ? void 0 : handleStep(index), children: /* @__PURE__ */ jsx(
        StepLabel,
        {
          optional: step.description ? /* @__PURE__ */ jsx(Typography, { variant: "caption", children: step.description }) : null,
          children: step.label
        }
      ) }, step.label))
    }
  );
}
function ProgressStepper({
  steps,
  activeStep,
  handleStep
}) {
  return /* @__PURE__ */ jsx("div", { className: "ia-styles ia-stepper progress", children: /* @__PURE__ */ jsx("div", { className: "progress-steps", children: steps.map((step, index) => /* @__PURE__ */ jsx(
    "div",
    {
      className: `step ${index === activeStep ? "active" : ""} ${index < activeStep ? "completed" : ""}`,
      role: "button",
      tabIndex: 0,
      onClick: () => handleStep == null ? void 0 : handleStep(index),
      onKeyDown: (e) => {
        if (e.key === "Enter" || e.key === " ") {
          e.preventDefault();
          handleStep == null ? void 0 : handleStep(index);
        }
      }
    },
    step.label
  )) }) });
}
function Stepper({
  steps,
  activeStep,
  orientation = "horizontal",
  handleStep,
  variant = "default",
  ...args
}) {
  if (variant === "progress") {
    return /* @__PURE__ */ jsx(ProgressStepper, { activeStep, handleStep, steps });
  }
  return /* @__PURE__ */ jsx(
    DefaultStepper,
    {
      activeStep,
      handleStep,
      orientation,
      steps,
      variant,
      ...args
    }
  );
}
Stepper.displayName = "Stepper";
export {
  Stepper
};
