"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NewStepper = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const classNames_1 = require("../utils/classNames");
const cva_1 = require("../utils/cva");
const constants_1 = require("./constants");
const StepperContext_1 = require("./StepperContext");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const stepper = (0, cva_1.cva)(constants_1.stepperClassnames.root, {
    variants: {
        orientation: {
            horizontal: constants_1.stepperClassnames.orientationHorizontal,
            vertical: constants_1.stepperClassnames.orientationVertical,
        },
        alternativeLabel: {
            true: constants_1.stepperClassnames.alternativeLabel,
        },
        connector: {
            arrow: constants_1.stepperClassnames.arrowConnector,
            line: constants_1.stepperClassnames.lineConnector,
        },
    },
});
const NewStepper = (props) => {
    const { containerRef, stepperConnector, stepperAlternativeLabel, activeStep, onClickPrevStep, onClickStep, orientation, className, children, } = (0, useLogic_1.useLogic)(props);
    return ((0, jsx_runtime_1.jsx)(StepperContext_1.StepperContextProvider, { orientation: orientation, activeStep: activeStep, connector: stepperConnector, alternativeLabel: stepperAlternativeLabel, onClickPrevStep: onClickPrevStep, onClickStep: onClickStep, children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { ref: containerRef, role: "group", className: (0, classNames_1.classNames)(stepper({
                alternativeLabel: stepperAlternativeLabel,
                connector: stepperConnector,
                orientation,
            }), className), children: children }) }));
};
exports.NewStepper = NewStepper;
