@atlaskit/pragmatic-drag-and-drop-react-accessibility
Version:
An optional package for Pragmatic drag and drop containing react components to assist with setting up accessible experiences
23 lines • 979 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["label"];
import React, { forwardRef } from 'react';
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
import { DragHandleButtonBase } from './drag-handle-button-base';
/**
* A button with pre-configured styling to look like a drag handle.
*
* This component uses a native button because the `@atlaskit/button`
* cancels `mouseDown` events, which prevents dragging.
*/
export var DragHandleButton = /*#__PURE__*/forwardRef(function DragHandleButton(_ref, ref) {
var label = _ref.label,
buttonProps = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement(DragHandleButtonBase, _extends({
ref: ref
}, buttonProps), /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
spacing: "spacious",
label: label,
size: "small"
}));
});