UNPKG

@atlaskit/editor-common

Version:

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

51 lines (50 loc) 1.46 kB
/** * @jsxRuntime classic * @jsx jsx */ import { useEffect, useRef } from 'react'; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 import { css, jsx } from '@emotion/react'; import { ButtonItem, Section } from '@atlaskit/menu'; var itemBefore = css({ width: '40px', height: '40px', boxSizing: 'border-box', display: 'flex', justifyContent: 'center', alignItems: 'center', marginRight: "var(--ds-space-050, 4px)" }); export var ViewMore = function ViewMore(_ref) { var item = _ref.item, focus = _ref.focus; var ref = useRef(null); useEffect(function () { if (ref.current && focus) { ref.current.focus(); } }, [focus]); return jsx(Section, { hasSeparator: true }, jsx(ButtonItem // Ignored via go/ees005 // eslint-disable-next-line @typescript-eslint/no-explicit-any , { onClick: item.action // Ignored via go/ees005 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion , iconBefore: jsx("div", { css: itemBefore }, item.icon()), "aria-describedby": item.title, "data-testid": "view-more-elements-item" // @ts-ignore Overriding Menu styles is not supported // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 , css: css({ padding: "0px ".concat("var(--ds-space-150, 12px)") }), ref: ref }, item.title)); };