import { t as e } from "../../utils-B7XIe3qq.js";
import { t } from "../../dist-BCCeHAQm.js";
import { t as n } from "../../x-BleQvk5v.js";
import * as r from "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
//#region src/react/primitives/alert.tsx
var o = t("relative flex gap-3 rounded-xl border p-4 text-sm transition-all duration-200 [&>svg]:size-5 [&>svg]:shrink-0", {
	variants: { variant: {
		info: "border-accent-cyan/30 bg-accent-cyan/5 text-accent-cyan [&>svg]:text-accent-cyan",
		success: "border-accent-emerald/30 bg-accent-emerald/5 text-accent-emerald [&>svg]:text-accent-emerald",
		warning: "border-accent-amber/30 bg-accent-amber/5 text-accent-amber [&>svg]:text-accent-amber",
		error: "border-accent-rose/30 bg-accent-rose/5 text-accent-rose [&>svg]:text-accent-rose"
	} },
	defaultVariants: { variant: "info" }
}), s = {
	destructive: "error",
	default: "info"
}, c = /* @__PURE__ */ new Set();
function l(e) {
	if (e === "destructive" || e === "default") {
		if (process.env.NODE_ENV !== "production" && !c.has(e)) {
			c.add(e);
			let t = s[e];
			console.warn(`[@countermeasure-platform/web-components] <Alert variant="${e}"> is deprecated and will be removed in a future release. Auto-mapping to variant="${t}". Run: find src -type f \\( -name '*.tsx' -o -name '*.ts' \\) -exec sed -i 's/variant="${e}"/variant="${t}"/g' {} +`);
		}
		return s[e];
	}
	return e ?? "info";
}
function u() {
	c.clear();
}
function d({ className: t, variant: s, icon: c, dismissible: u = !1, onDismiss: d, children: f, ...p }) {
	let [m, h] = r.useState(!1), g = l(s);
	return m ? null : /* @__PURE__ */ a("div", {
		"data-slot": "alert",
		"data-variant": g,
		role: "alert",
		className: e(o({ variant: g }), t),
		...p,
		children: [
			c && /* @__PURE__ */ i("span", {
				className: "mt-0.5 shrink-0",
				children: c
			}),
			/* @__PURE__ */ i("div", {
				className: "flex-1",
				children: f
			}),
			u && /* @__PURE__ */ i("button", {
				type: "button",
				"aria-label": "Dismiss",
				onClick: () => {
					h(!0), d?.();
				},
				className: "shrink-0 rounded-lg p-0.5 opacity-70 transition-opacity hover:opacity-100",
				children: /* @__PURE__ */ i(n, { className: "size-4" })
			})
		]
	});
}
function f({ className: t, ...n }) {
	return /* @__PURE__ */ i("h5", {
		"data-slot": "alert-title",
		className: e("mb-1 font-semibold leading-none tracking-tight", t),
		...n
	});
}
function p({ className: t, ...n }) {
	return /* @__PURE__ */ i("div", {
		"data-slot": "alert-description",
		className: e("text-sm opacity-90 [&_p]:leading-relaxed", t),
		...n
	});
}
//#endregion
export { d as Alert, p as AlertDescription, f as AlertTitle, u as _resetAlertLegacyWarnings, o as alertVariants };

//# sourceMappingURL=alert.js.map