UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

82 lines (74 loc) 3.1 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.MainToolbarForSecondChildWrapper = exports.MainToolbarForFirstChildWrapper = void 0; var _react = _interopRequireDefault(require("react")); var _react2 = require("@emotion/react"); /** * @jsxRuntime classic * @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic // Pre-computed static styles for first- and second-child wrappers. // These contain no runtime logic and are safe for static-emotion mode. var firstChildStaticBase = (0, _react2.css)({ display: 'flex', flexGrow: 1 }); // we can't avoid some kind of function call here, so we need to disable the rule // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 var firstChildStaticTwoLine = (0, _react2.css)({ '@media (max-width: 868px)': { flex: '1 1 100%', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 height: 'var(--ak-editor-fullpage-toolbar-height)', justifyContent: 'flex-end', minWidth: 'fit-content' } }); var secondChildStaticBase = (0, _react2.css)({ minWidth: 'fit-content' }); // we can't avoid some kind of function call here, so we need to disable the rule // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 var secondChildStaticTwoLine = (0, _react2.css)({ '@media (max-width: 868px)': { display: 'flex', flexGrow: 1, flex: '1 1 100%', margin: 'auto', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 height: 'var(--ak-editor-fullpage-toolbar-height)', minWidth: 0 } }); // ---------------- First child wrapper ---------------- var MainToolbarForFirstChildWrapper = exports.MainToolbarForFirstChildWrapper = function MainToolbarForFirstChildWrapper(_ref) { var twoLineEditorToolbar = _ref.twoLineEditorToolbar, children = _ref.children, role = _ref.role, ariaLabel = _ref['aria-label'], testId = _ref['data-testid']; return (0, _react2.jsx)("div", { css: [firstChildStaticBase, twoLineEditorToolbar && firstChildStaticTwoLine], role: role, "aria-label": ariaLabel, "data-testid": testId }, children); }; // ---------------- Second child wrapper ---------------- var MainToolbarForSecondChildWrapper = exports.MainToolbarForSecondChildWrapper = function MainToolbarForSecondChildWrapper(_ref2) { var twoLineEditorToolbar = _ref2.twoLineEditorToolbar, children = _ref2.children, role = _ref2.role, ariaLabel = _ref2['aria-label'], testId = _ref2['data-testid']; return (0, _react2.jsx)("div", { css: [secondChildStaticBase, twoLineEditorToolbar && secondChildStaticTwoLine], role: role, "aria-label": ariaLabel, "data-testid": testId }, children); };