UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

71 lines (69 loc) 2.16 kB
/** * @jsxRuntime classic * @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 import { css, jsx } from '@emotion/react'; import SuccessIcon from '@atlaskit/icon/glyph/editor/success'; import ErrorIcon from '@atlaskit/icon/glyph/error'; var errorColor = css({ color: "var(--ds-text-danger, #AE2E24)" }); var validColor = css({ color: "var(--ds-text-success, #216E4E)" }); // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 var messageStyle = function messageStyle() { return ( // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 css({ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography fontSize: "".concat(12 / 14, "em"), fontStyle: 'inherit', // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography lineHeight: 16 / 12, fontWeight: "var(--ds-font-weight-regular, 400)", color: "var(--ds-text-subtlest, #626F86)", marginTop: "var(--ds-space-050, 4px)", display: 'flex', justifyContent: 'baseline' }) ); }; var iconWrapperStyle = css({ display: 'flex', marginRight: "var(--ds-space-050, 4px)" }); export var HelperMessage = function HelperMessage(_ref) { var children = _ref.children; return jsx("div", { css: messageStyle }, children); }; export var ErrorMessage = function ErrorMessage(_ref2) { var children = _ref2.children; return jsx("div", { css: function css() { return [messageStyle(), errorColor]; } }, jsx("span", { css: iconWrapperStyle }, jsx(ErrorIcon, { size: "small", label: "error", "aria-label": "error" })), children); }; export var ValidMessage = function ValidMessage(_ref3) { var children = _ref3.children; return jsx("div", { css: function css() { return [messageStyle(), validColor]; } }, jsx("span", { css: iconWrapperStyle }, jsx(SuccessIcon, { size: "small", label: "success" })), children); };