UNPKG

@veracity/vui

Version:

Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.

44 lines (42 loc) 1.44 kB
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__ = "5.3.0-alpha.2" //# sourceMappingURL=message.js.map