/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
import clsx$1 from "clsx";
//#region src/blocks/Error/Error.tsx
/** Map status → colors */
var statusStyles = {
	neutral: "text-(--text-muted)",
	info: "text-info-text",
	success: "text-success-text",
	warning: "text-warning-text",
	error: "text-error-text"
};
/** Icon for each error type */
function ErrorIcon({ type = "generic", status = "error" }) {
	const colorClass = statusStyles[status];
	const baseClass = "w-12 h-12 mb-4";
	if (type === "not-found") return /* @__PURE__ */ jsx("svg", {
		className: clsx$1(baseClass, colorClass),
		fill: "none",
		viewBox: "0 0 24 24",
		stroke: "currentColor",
		"aria-hidden": "true",
		children: /* @__PURE__ */ jsx("path", {
			strokeLinecap: "round",
			strokeLinejoin: "round",
			strokeWidth: 2,
			d: "M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
		})
	});
	if (type === "forbidden") return /* @__PURE__ */ jsx("svg", {
		className: clsx$1(baseClass, colorClass),
		fill: "none",
		viewBox: "0 0 24 24",
		stroke: "currentColor",
		"aria-hidden": "true",
		children: /* @__PURE__ */ jsx("path", {
			strokeLinecap: "round",
			strokeLinejoin: "round",
			strokeWidth: 2,
			d: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"
		})
	});
	if (type === "server-error") return /* @__PURE__ */ jsx("svg", {
		className: clsx$1(baseClass, colorClass),
		fill: "none",
		viewBox: "0 0 24 24",
		stroke: "currentColor",
		"aria-hidden": "true",
		children: /* @__PURE__ */ jsx("path", {
			strokeLinecap: "round",
			strokeLinejoin: "round",
			strokeWidth: 2,
			d: "M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"
		})
	});
	if (type === "network-error") return /* @__PURE__ */ jsx("svg", {
		className: clsx$1(baseClass, colorClass),
		fill: "none",
		viewBox: "0 0 24 24",
		stroke: "currentColor",
		"aria-hidden": "true",
		children: /* @__PURE__ */ jsx("path", {
			strokeLinecap: "round",
			strokeLinejoin: "round",
			strokeWidth: 2,
			d: "M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"
		})
	});
	return /* @__PURE__ */ jsx("svg", {
		className: clsx$1(baseClass, colorClass),
		fill: "none",
		viewBox: "0 0 24 24",
		stroke: "currentColor",
		"aria-hidden": "true",
		children: /* @__PURE__ */ jsx("path", {
			strokeLinecap: "round",
			strokeLinejoin: "round",
			strokeWidth: 2,
			d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
		})
	});
}
/** Root component for error display */
function Root({ status = "error", type = "generic", className, children }) {
	return /* @__PURE__ */ jsx("div", {
		className: clsx$1("py-12 text-center", className),
		role: "alert",
		"aria-live": "polite",
		children: /* @__PURE__ */ jsxs("div", {
			className: "flex flex-col items-center",
			children: [/* @__PURE__ */ jsx(ErrorIcon, {
				type,
				status
			}), children]
		})
	});
}
/** Title slot */
function Title({ children, className }) {
	return /* @__PURE__ */ jsx("h1", {
		className: clsx$1("text-2xl font-bold mb-4", className),
		children
	});
}
/** Description/message slot */
function Description({ children, className }) {
	return /* @__PURE__ */ jsx("p", {
		className: clsx$1("text-base mb-2 max-w-2xl", className),
		children
	});
}
/** Technical details slot (smaller, muted text) */
function Details({ children, className }) {
	return /* @__PURE__ */ jsx("div", {
		className: clsx$1("text-sm text-(--text-muted) mb-6 max-w-2xl", className),
		children
	});
}
/** Actions/buttons slot */
function Actions({ children, className }) {
	return /* @__PURE__ */ jsx("div", {
		className: clsx$1("flex flex-wrap gap-4 justify-center mt-6", className),
		children
	});
}
/** Export compound component */
var ErrorBlock = Object.assign(Root, {
	Title,
	Description,
	Details,
	Actions
});
//#endregion
export { ErrorBlock };

//# sourceMappingURL=Error.js.map