UNPKG

@atlaskit/editor-plugin-selection-extension

Version:

editor-plugin-selection-extension plugin for @atlaskit/editor-core

33 lines (32 loc) 1.57 kB
import React from 'react'; import { injectIntl } from 'react-intl'; import { selectionExtensionMessages } from '@atlaskit/editor-common/messages'; import { ToolbarButton } from '@atlaskit/editor-common/ui-menu'; import AppsIcon from '@atlaskit/icon/core/apps'; import ChevronDownIcon from '@atlaskit/icon/core/chevron-down'; var SelectionExtensionDropdownMenuButtonComponent = function SelectionExtensionDropdownMenuButtonComponent(_ref) { var onClick = _ref.onClick, selected = _ref.selected, ariaExpanded = _ref['aria-expanded'], intl = _ref.intl; return /*#__PURE__*/React.createElement(ToolbarButton, { testId: "selection-extension-dropdown-button", "aria-label": intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel), "aria-haspopup": "true", spacing: "compact", title: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel), onClick: onClick, "aria-expanded": ariaExpanded, selected: selected, iconAfter: /*#__PURE__*/React.createElement(ChevronDownIcon, { spacing: "none", label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel), size: "small" }) }, /*#__PURE__*/React.createElement(AppsIcon, { label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel), spacing: "none" })); }; // eslint-disable-next-line @typescript-eslint/ban-types export var SelectionExtensionDropdownMenuButton = injectIntl(SelectionExtensionDropdownMenuButtonComponent);