'use client'; 'use strict'; var jsxRuntime = require('react/jsx-runtime'); var styledSystem = require('@chakra-ui/styled-system'); var utils = require('@chakra-ui/utils'); var react = require('react'); var stepContext = require('./step-context.cjs'); var forwardRef = require('../system/forward-ref.cjs'); var useStyleConfig = require('../system/use-style-config.cjs'); var factory = require('../system/factory.cjs'); const Stepper = forwardRef.forwardRef(function Stepper2(props, ref) { const styles = useStyleConfig.useMultiStyleConfig("Stepper", props); const { children, index, orientation = "horizontal", showLastSeparator = false, ...restProps } = styledSystem.omitThemingProps(props); const stepElements = react.Children.toArray(children); const stepCount = stepElements.length; function getStatus(step) { if (step < index) return "complete"; if (step > index) return "incomplete"; return "active"; } return /* @__PURE__ */ jsxRuntime.jsx( factory.chakra.div, { ref, "aria-label": "Progress", "data-orientation": orientation, ...restProps, __css: styles.stepper, className: utils.cx("chakra-stepper", props.className), children: /* @__PURE__ */ jsxRuntime.jsx(stepContext.StepperStylesProvider, { value: styles, children: stepElements.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx( stepContext.StepContextProvider, { value: { index: index2, status: getStatus(index2), orientation, showLastSeparator, count: stepCount, isFirst: index2 === 0, isLast: index2 === stepCount - 1 }, children: child }, index2 )) }) } ); }); exports.Stepper = Stepper;