UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

74 lines (68 loc) 2.67 kB
/** * @jsxRuntime classic * @jsx jsx */ import React from 'react'; // 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 import { css, jsx } from '@emotion/react'; // Pre-computed static styles for first- and second-child wrappers. // These contain no runtime logic and are safe for static-emotion mode. var firstChildStaticBase = 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 = 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 = 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 = 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 ---------------- export var MainToolbarForFirstChildWrapper = function MainToolbarForFirstChildWrapper(_ref) { var twoLineEditorToolbar = _ref.twoLineEditorToolbar, children = _ref.children, role = _ref.role, ariaLabel = _ref['aria-label'], testId = _ref['data-testid']; return jsx("div", { css: [firstChildStaticBase, twoLineEditorToolbar && firstChildStaticTwoLine], role: role, "aria-label": ariaLabel, "data-testid": testId }, children); }; // ---------------- Second child wrapper ---------------- export var MainToolbarForSecondChildWrapper = function MainToolbarForSecondChildWrapper(_ref2) { var twoLineEditorToolbar = _ref2.twoLineEditorToolbar, children = _ref2.children, role = _ref2.role, ariaLabel = _ref2['aria-label'], testId = _ref2['data-testid']; return jsx("div", { css: [secondChildStaticBase, twoLineEditorToolbar && secondChildStaticTwoLine], role: role, "aria-label": ariaLabel, "data-testid": testId }, children); };