/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { cx, getStyles } from "../../../styles/styler.js";
import { HStack } from "../../HStack.js";
import { useToastConfig } from "./UDSToastConfigProvider.js";
import { isElevationAlias } from "../../../utils/isElevationAlias.js";
import { jsx } from "react/jsx-runtime";
import { isString } from "lodash-es";
//#region src/components/client/Toast/ToastContainer.tsx
const typeMap = {
	default: "info",
	success: "success",
	error: "error",
	info: "info",
	warning: "warning"
};
const getToastClassName = (toastClassName) => (context) => {
	return cx(getStyles({
		position: "relative",
		alignItems: "center",
		display: "flex",
		className: "box-border touch-none z-0 w-full break-words mb-2 last:mb-0"
	}), isString(toastClassName) ? toastClassName : toastClassName?.(context));
};
const ToastContainer = ({ size: sizeProp, variant: variantProp, children, className, ...props }) => {
	const { size, variant, backgroundColor } = useToastConfig(sizeProp, variantProp);
	const bg = backgroundColor[variant];
	const isElevationBg = isElevationAlias(bg);
	return /* @__PURE__ */ jsx(HStack, {
		className: getStyles({
			toastVariantRoot: variant,
			toastSizeRoot: size,
			className: cx("w-full", className)
		}),
		alignItems: "center",
		justifyContent: "space-between",
		overflow: "hidden",
		position: "relative",
		backgroundColor: isElevationBg ? bg : void 0,
		...props,
		children
	});
};
ToastContainer.displayName = "ToastContainer";
//#endregion
export { ToastContainer, getToastClassName, typeMap };
