import { n as cn } from "./utils-DXzSsU1e.js";
import { computed, createBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, unref, withCtx } from "vue";
import { ProgressIndicator, ProgressRoot } from "reka-ui";
import { cva } from "class-variance-authority";
//#endregion
//#region src/components/ui/progress/Progress.vue
var Progress_default = /* @__PURE__ */ defineComponent({
	__name: "Progress",
	props: {
		value: { default: 0 },
		max: { default: 100 },
		size: {},
		variant: {},
		class: { type: [
			Boolean,
			null,
			String,
			Object,
			Array
		] }
	},
	setup(__props) {
		const props = __props;
		const percent = computed(() => {
			if (props.value === null || props.value === void 0) return null;
			const max = props.max ?? 100;
			if (max <= 0) return 0;
			return Math.min(100, Math.max(0, props.value / max * 100));
		});
		const indeterminate = computed(() => props.value === null);
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ProgressRoot), {
				"model-value": indeterminate.value ? null : percent.value ?? 0,
				max: 100,
				class: normalizeClass(unref(cn)(unref(progressVariants)({ size: __props.size }), props.class))
			}, {
				default: withCtx(() => [createVNode(unref(ProgressIndicator), {
					class: normalizeClass(unref(cn)(unref(progressIndicatorVariants)({ variant: __props.variant }), indeterminate.value && "animate-pulse")),
					style: normalizeStyle(indeterminate.value ? "transform: translateX(0)" : `transform: translateX(-${100 - (percent.value ?? 0)}%)`)
				}, null, 8, ["class", "style"])]),
				_: 1
			}, 8, ["model-value", "class"]);
		};
	}
});
//#endregion
//#region src/components/ui/progress/index.ts
var progressVariants = cva("relative w-full overflow-hidden rounded-full bg-secondary", {
	variants: { size: {
		sm: "h-2",
		default: "h-4",
		lg: "h-6"
	} },
	defaultVariants: { size: "default" }
});
var progressIndicatorVariants = cva("h-full w-full flex-1 transition-all", {
	variants: { variant: {
		default: "bg-primary",
		success: "bg-success",
		destructive: "bg-destructive"
	} },
	defaultVariants: { variant: "default" }
});
//#endregion
export { progressVariants as n, Progress_default as r, progressIndicatorVariants as t };

//# sourceMappingURL=progress-C3R98kmG.js.map