@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
42 lines (41 loc) • 1.83 kB
JavaScript
import React from 'react';
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
import { Box, xcss } from '@atlaskit/primitives';
import { DragInMotionIcon } from '../icons/DragInMotionIcon';
var boxStyles = xcss({
borderColor: 'color.border.focused',
borderStyle: 'solid',
borderRadius: 'radius.small',
borderWidth: 'border.width.focused',
backgroundColor: 'color.blanket.selected'
});
export var DragPreview = function DragPreview(_ref) {
var direction = _ref.direction,
width = _ref.width,
height = _ref.height;
var marginLeft = direction === 'row' ? -14 : width / 2 - 14;
var marginTop = direction === 'row' ? height / 2 - 14 : -10;
var transform = direction === 'row' ? 'rotate(90deg)' : 'none';
return /*#__PURE__*/React.createElement(Box, {
xcss: boxStyles
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
,
style: {
width: "".concat(width, "px"),
height: "".concat(height, "px")
}
}, /*#__PURE__*/React.createElement(DragInMotionIcon
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
, {
style: {
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
position: 'absolute',
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
marginLeft: "".concat(marginLeft, "px"),
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
marginTop: "".concat(marginTop, "px"),
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
transform: transform
}
}));
};