"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StepIndicator = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const box_1 = __importDefault(require("../box"));
const button_1 = __importDefault(require("../button"));
const core_1 = require("../core");
const icon_1 = __importDefault(require("../icon"));
const t_1 = __importDefault(require("../t"));
const utils_1 = require("../utils");
const Content = ({ number, variant, size }) => {
    if (typeof number === 'undefined')
        return null;
    if (variant === 'completed')
        return (0, jsx_runtime_1.jsx)(icon_1.default, { name: "falCheck", size: size });
    if (variant === 'error')
        return (0, jsx_runtime_1.jsx)(icon_1.default, { name: "falTimes", size: size });
    return ((0, jsx_runtime_1.jsx)(t_1.default, { fontSize: size === 'md' ? 16 : 14, fontWeight: 600, children: number }));
};
/**
 * Implements stepper indicator **
 */
exports.StepIndicator = (0, core_1.vui)((props, ref) => {
    const { icon, number, className, size = 'md', variant = 'active' } = props, rest = __rest(props, ["icon", "number", "className", "size", "variant"]);
    const styles = (0, core_1.useStyleConfig)('StepIndicator', props);
    return icon ? ((0, jsx_runtime_1.jsx)(button_1.default, Object.assign({ className: (0, utils_1.cs)('vui-stepIndicator', 'vui-stepIndicatorIcon', className), icon: icon, ref: ref }, styles.icon, rest, { isRound: true, minW: "auto", pointerEvents: "none", size: size }))) : ((0, jsx_runtime_1.jsxs)(button_1.default, Object.assign({ className: (0, utils_1.cs)('vui-stepIndicator', 'vui-stepIndicatorNumber', className), ref: ref }, styles.button, rest, { isRound: true, minW: "auto", outline: "6px solid white", pointerEvents: "none", position: "relative", size: size, children: [(0, jsx_runtime_1.jsx)(box_1.default, { mx: 0.5, position: "relative" }), (0, jsx_runtime_1.jsx)(box_1.default, { mx: 0.5, position: "absolute", children: (0, jsx_runtime_1.jsx)(Content, { number: number, size: String(size), variant: String(variant) }) })] })));
});
exports.StepIndicator.displayName = 'StepIndicator';
exports.default = exports.StepIndicator;
//# sourceMappingURL=stepIndicator.js.map