@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
58 lines (55 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewMore = void 0;
var _react = require("react");
var _react2 = require("@emotion/react");
var _menu = require("@atlaskit/menu");
/**
* @jsxRuntime classic
* @jsx jsx
*/
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
var itemBefore = (0, _react2.css)({
width: '40px',
height: '40px',
boxSizing: 'border-box',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginRight: "var(--ds-space-050, 4px)"
});
var ViewMore = exports.ViewMore = function ViewMore(_ref) {
var item = _ref.item,
focus = _ref.focus;
var ref = (0, _react.useRef)(null);
(0, _react.useEffect)(function () {
if (ref.current && focus) {
ref.current.focus();
}
}, [focus]);
return (0, _react2.jsx)(_menu.Section, {
hasSeparator: true
}, (0, _react2.jsx)(_menu.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: (0, _react2.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: (0, _react2.css)({
padding: "0px ".concat("var(--ds-space-150, 12px)")
}),
ref: ref
}, item.title));
};