UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

41 lines 1.73 kB
import React from 'react'; import { injectIntl } from 'react-intl-next'; import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals'; import { TableCssClassName as ClassName } from '../../types'; const DeleteButton = ({ style, onClick, onMouseEnter, onMouseLeave, removeLabel, intl: { formatMessage } }) => /*#__PURE__*/React.createElement("div", { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 className: ClassName.CONTROLS_DELETE_BUTTON_WRAP // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 , style: style, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseEnter : undefined, onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseLeave : undefined }, /*#__PURE__*/React.createElement("button", { type: "button", "aria-label": formatMessage(removeLabel, { 0: 1 }) // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 , className: ClassName.CONTROLS_DELETE_BUTTON, onMouseDown: onClick, onMouseMove: e => e.preventDefault() }, /*#__PURE__*/React.createElement("svg", { className: ClassName.CONTROLS_BUTTON_ICON }, /*#__PURE__*/React.createElement("path", { d: "M12.242 10.828L9.414 8l2.828-2.829a.999.999 0 1 0-1.414-1.414L8 6.587l-2.829-2.83a1 1 0 0 0-1.414 1.414l2.83 2.83-2.83 2.827a1 1 0 0 0 1.414 1.414l2.83-2.828 2.827 2.828a.999.999 0 1 0 1.414-1.414", fill: "currentColor", fillRule: "evenodd" })))); export default injectIntl(DeleteButton);