import { __assign, __rest } from "tslib";
import React from "react";
import P1 from "../typography/P1";
import Label from "../Label";
import { getProgress } from "./helpers";
import { Filler, ProgressBarBase, ProgressBarStyle } from "./style";
var ProgressBar = function (_a) {
    var progress = _a.progress, variant = _a.variant, _b = _a.type, type = _b === void 0 ? "Linear" : _b, _c = _a.size, size = _c === void 0 ? "s" : _c, label = _a.label, isText = _a.isText, props = __rest(_a, ["progress", "variant", "type", "size", "label", "isText"]);
    return (React.createElement(ProgressBarBase, __assign({ variant: variant }, props),
        React.createElement(ProgressBarStyle, { className: "progressbar", size: size },
            React.createElement("div", { className: "background" },
                React.createElement(Filler, { className: "filler", progress: getProgress({
                        type: type,
                        progress: progress,
                        step: 1,
                        current_progress: 0
                    }) })),
            size === "m" && isText && (React.createElement(P1, { className: "progress-text", type: "cygnus" },
                progress,
                "%"))),
        label && (React.createElement(Label, { status: variant === "info" ? "focused" : variant, isIcon: size === "s" }, label))));
};
export default ProgressBar;
