import zIndices_default from "../theme/foundations/zIndices.js";
import { v } from "../core/styled.js";
import { useVuiContext } from "../core/vuiProvider/context.js";
import Box from "../box/box.js";
import { memo } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/toast/toast.tsx
const toasterWidth = 420;
const Toaster = () => {
	const { toasts } = useVuiContext();
	const padding = {
		md: "16px",
		sm: "4px",
		xs: "2px"
	};
	const right = {
		md: "1rem",
		sm: 0,
		xs: 0
	};
	const width = {
		md: toasterWidth,
		sm: toasterWidth,
		xs: "100%"
	};
	return /* @__PURE__ */ jsx(Box, {
		bottom: toasts?.list?.length ? "1rem" : "-2rem",
		className: "vui-toaster",
		display: "block",
		maxW: width,
		minW: width,
		p: padding,
		position: "fixed",
		right,
		zIndex: zIndices_default.toast,
		children: toasts?.list?.map?.((toast) => /* @__PURE__ */ jsx(v.div, {
			id: `toast_${toast.id}`,
			children: toast.component
		}, toast.id))
	});
};
var toast_default = memo(Toaster);

//#endregion
export { toast_default as default };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=toast.js.map