import { descriptors } from "../customizables/elementDescriptors.js";
import { Alert, AlertIcon, Col, Text } from "../customizables/index.js";
import { jsx, jsxs } from "@emotion/react/jsx-runtime";

//#region src/elements/Alert.tsx
const Alert$1 = (props) => {
	const { children, title, subtitle, variant = "warning",...rest } = props;
	if (!children && !title && !subtitle) return null;
	const textColorScheme = variant === "danger" ? "danger" : variant === "warning" ? "warning" : "secondary";
	return /* @__PURE__ */ jsxs(Alert, {
		elementDescriptor: descriptors.alert,
		elementId: descriptors.alert.setId(variant),
		colorScheme: variant,
		align: "start",
		...rest,
		sx: [rest.sx],
		children: [/* @__PURE__ */ jsx(AlertIcon, {
			elementId: descriptors.alert.setId(variant),
			elementDescriptor: descriptors.alertIcon,
			variant,
			colorScheme: variant,
			sx: { flexShrink: "0" }
		}), /* @__PURE__ */ jsxs(Col, {
			elementDescriptor: descriptors.alertTextContainer,
			elementId: descriptors.alertTextContainer.setId(variant),
			gap: 1,
			sx: { textAlign: "left" },
			children: [/* @__PURE__ */ jsx(Text, {
				elementDescriptor: descriptors.alertText,
				elementId: descriptors.alert.setId(variant),
				colorScheme: textColorScheme,
				variant: subtitle ? "h3" : "body",
				localizationKey: title,
				children
			}), subtitle && /* @__PURE__ */ jsx(Text, {
				elementDescriptor: descriptors.alertText,
				elementId: descriptors.alert.setId(variant),
				colorScheme: textColorScheme,
				variant: "body",
				localizationKey: subtitle
			})]
		})]
	});
};

//#endregion
export { Alert$1 as Alert };
//# sourceMappingURL=Alert.js.map