import { t as e } from "../../utils-B7XIe3qq.js";
import { t } from "../../dist-BCCeHAQm.js";
import { t as n } from "../../dist-D0fg6pif.js";
import "react";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
//#region src/react/primitives/badge.tsx
var a = t("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-[10px] font-semibold tracking-wide tabular-nums w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-all duration-200 overflow-hidden", {
	variants: { variant: {
		default: "border-transparent bg-primary text-primary-foreground",
		secondary: "border-transparent bg-foreground/[0.08] text-foreground-secondary",
		destructive: "border-transparent bg-rose-10 text-[var(--color-error-text)]",
		outline: "border-border-default/50 bg-transparent text-foreground [a&]:hover:bg-foreground/[0.07]",
		glass: "border-transparent bg-foreground/[0.08] text-foreground-secondary",
		orange: "border-transparent bg-primary/15 text-[var(--color-primary-text)]",
		blue: "border-transparent bg-blue-10 text-[var(--color-blue-text)]",
		cyan: "border-transparent bg-cyan-10 text-[var(--color-cyan-text)]",
		emerald: "border-transparent bg-emerald-10 text-[var(--color-emerald-text)]",
		rose: "border-transparent bg-rose-10 text-[var(--color-rose-text)]",
		amber: "border-transparent bg-amber-10 text-[var(--color-amber-text)]",
		violet: "border-transparent bg-violet-10 text-[var(--color-violet-text)]",
		live: "border-transparent bg-cyan-10 text-[var(--color-cyan-text)]"
	} },
	defaultVariants: { variant: "default" }
}), o = {
	critical: "rose",
	high: "orange",
	medium: "amber",
	low: "cyan",
	info: "glass"
}, s = {
	active: "emerald",
	inactive: "glass",
	pending: "amber",
	error: "rose"
}, c = new Set([
	"active",
	"pending",
	"error"
]), l = !1;
function u({ className: t, variant: u, asChild: d = !1, dot: f, onRemove: p, severity: m, status: h, children: g, ..._ }) {
	m !== void 0 && h !== void 0 && process.env.NODE_ENV !== "production" && !l && (l = !0, console.warn("[Badge] Both `severity` and `status` props were provided. `severity` takes precedence."));
	let v = u, y = f;
	m === void 0 ? h !== void 0 && (v = s[h], f === void 0 && c.has(h) && (y = !0)) : v = o[m];
	let b = d ? n : "span";
	d && p !== void 0 && process.env.NODE_ENV !== "production" && console.warn("[Badge] `onRemove` is ignored when `asChild` is true — Slot must wrap a single child element.");
	let x = (e) => {
		e.stopPropagation(), p?.();
	}, S = {
		"data-slot": "badge",
		"data-severity": m,
		"data-status": h,
		className: e(a({ variant: v }), t),
		..._
	};
	return d ? /* @__PURE__ */ r(b, {
		...S,
		children: g
	}) : /* @__PURE__ */ i(b, {
		...S,
		children: [
			y ? /* @__PURE__ */ r("span", {
				"aria-hidden": !0,
				className: "size-1.5 rounded-full bg-current"
			}) : null,
			g,
			p === void 0 ? null : /* @__PURE__ */ r("button", {
				type: "button",
				"aria-label": "Remove",
				onClick: x,
				className: "size-3 text-current opacity-60 hover:opacity-100 flex items-center justify-center",
				children: "×"
			})
		]
	});
}
function d(e, t) {
	return {
		...t,
		severity: e
	};
}
function f(e, t) {
	return {
		...t,
		status: e
	};
}
//#endregion
export { u as Badge, a as badgeVariants, d as severityBadge, f as statusBadge };

//# sourceMappingURL=badge.js.map