/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { toastQueue } from "./toastQueue.js";
/* empty css      */
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Button, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastRegion } from "react-aria-components";
//#region src/toast/ToastRenderer.tsx
var statusClasses = {
	neutral: "bg-neutral-700 text-white",
	info: "bg-info text-white",
	success: "bg-success text-white",
	warning: "bg-warning text-white",
	error: "bg-error text-white"
};
var ToastRenderer = () => {
	return /* @__PURE__ */ jsx(UNSTABLE_ToastRegion, {
		queue: toastQueue,
		className: "fixed bottom-0 right-0 z-50 flex flex-col-reverse gap-2 p-4 outline-none",
		children: ({ toast }) => {
			const { status, message, description } = toast.content;
			return /* @__PURE__ */ jsxs(UNSTABLE_Toast, {
				toast,
				"data-testid": `toast-${status}`,
				className: `flex items-center gap-4 m-2 p-4 rounded-xs shadow-lg min-w-[230px] max-w-[400px] outline-none ${statusClasses[status]}`,
				children: [/* @__PURE__ */ jsxs(UNSTABLE_ToastContent, {
					className: "flex flex-col flex-1 min-w-0",
					children: [/* @__PURE__ */ jsx(Text, {
						slot: "title",
						className: "font-semibold text-sm",
						children: message
					}), description && /* @__PURE__ */ jsx(Text, {
						slot: "description",
						className: "text-xs opacity-90",
						children: description
					})]
				}), /* @__PURE__ */ jsx(Button, {
					slot: "close",
					"aria-label": "Close",
					className: "flex flex-none items-center justify-center w-6 h-6 rounded-sm bg-transparent border-none text-white p-0 outline-none hover:bg-white/10 pressed:bg-white/15 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2 cursor-pointer",
					children: "×"
				})]
			});
		}
	});
};
//#endregion
export { ToastRenderer };

//# sourceMappingURL=ToastRenderer.js.map