"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Progress", {
    enumerable: true,
    get: function() {
        return Progress;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _reactprogress = /*#__PURE__*/ _interop_require_wildcard(require("@radix-ui/react-progress"));
const _react = require("react");
const _css = require("../utils/css");
const _classvarianceauthority = require("class-variance-authority");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const progressVariantsBg = (0, _classvarianceauthority.cva)("", {
    variants: {
        variant: {
            solid: "orderly-bg-base-contrast/[.072]",
            gradient: "orderly-bg-gradient-to-l \
      orderly-from-[rgba(28,246,180,0.2)] \
      orderly-via-[rgba(229,191,115,0.2)] \
      orderly-via-[rgba(229,210,115,0.2)] \
      orderly-via-[rgba(229,229,115,0.2)] \
      orderly-to-[rgba(255,77,130,0.2)]"
        }
    },
    defaultVariants: {
        variant: "solid"
    }
});
const progressVariantsFg = (0, _classvarianceauthority.cva)("", {
    variants: {
        variant: {
            solid: "orderly-bg-primary",
            gradient: "orderly-bg-gradient-to-r \
      orderly-from-[rgba(255,77,130,1)] \
      orderly-to-[rgba(28,246,180,1)]"
        }
    },
    defaultVariants: {
        variant: "solid"
    }
});
const Progress = /*#__PURE__*/ (0, _react.forwardRef)(({ className, variant = "solid", backgoundClassName, foregroundClassName, value, ...props }, ref)=>{
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactprogress.Root, {
        ref: ref,
        className: (0, _css.cn)("orderly-progress-container", "orderly-relative orderly-h-[8px] orderly-w-full orderly-overflow-hidden orderly-rounded-full", backgoundClassName ?? progressVariantsBg({
            variant
        })),
        style: {
            // Fix overflow clipping in Safari
            // https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0
            transform: "translateZ(0)"
        },
        ...props,
        children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactprogress.Indicator, {
            className: (0, _css.cn)("orderly-progress-indicator", "orderly-h-full orderly-w-full orderly-flex-1 orderly-transition-all orderly-rounded-full", foregroundClassName ?? progressVariantsFg({
                variant
            })),
            style: {
                width: `${value || 0}%`
            }
        })
    });
});
Progress.displayName = _reactprogress.Root.displayName;

//# sourceMappingURL=index.js.map