@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
22 lines • 805 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
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 const DragHandleButton = /*#__PURE__*/forwardRef(function DragHandleButton({
label,
...buttonProps
}, ref) {
return /*#__PURE__*/React.createElement(DragHandleButtonBase, _extends({
ref: ref
}, buttonProps), /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
spacing: "spacious",
label: label,
size: "small"
}));
});