import { cs } from "../utils/styles.js";
import { avatarStyles, iconDictionary, spacingDictionary } from "./consts.js";
import { useStyleConfig } from "../core/theme.js";
import styled from "../core/styled.js";
import vui from "../core/vui.js";
import Box from "../box/box.js";
import Icon from "../icon/icon.js";
import Avatar from "../avatar/avatar.js";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";

//#region src/message/message.tsx
const MessageBase = styled.divBox`
  transition-duration: fast;
`;
/** Displays a simple message text. */
const Message = vui((props, ref) => {
	const { avatar, children, className, text, size = "md", variant = "info", ...rest } = props;
	const styles = useStyleConfig("Message", props);
	return /* @__PURE__ */ jsx(MessageBase, {
		className: cs("vui-message", className),
		ref,
		...styles,
		...rest,
		children: /* @__PURE__ */ jsxs(Fragment, { children: [avatar ? /* @__PURE__ */ jsx(Avatar, {
			mr: "16px",
			...avatar
		}) : /* @__PURE__ */ jsx(Icon, {
			mr: `${spacingDictionary[size]}px`,
			name: iconDictionary[variant],
			size: styles.iconSize
		}), /* @__PURE__ */ jsx(Box, {
			size: styles.fontSize,
			w: "100%",
			...avatar ? avatarStyles : void 0,
			children: children ?? text
		})] })
	});
});
Message.displayName = "Message";

//#endregion
export { MessageBase, Message as default };
globalThis.__vuiVersion__ = "4.0.0"
//# sourceMappingURL=message.js.map