wix-style-react
Version:
wix-style-react
14 lines • 1.2 kB
JavaScript
import { classes, st } from './DragHandle.st.css';
import React from 'react';
import { DragAndDropLarge, DragAndDropSmall, } from '@wix/wix-ui-icons-common/system';
import Tooltip from '../Tooltip';
export function DragHandle(props) {
const { dataHook, domRef, dragging, disabled, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, tooltipContent, tooltipProps, dragHandleSize, ...rest } = props;
const dragHandleIcon = dragHandleSize === 'small' ? (React.createElement(DragAndDropSmall, { "data-hook": "dnd" })) : (React.createElement(DragAndDropLarge, { "data-hook": "dnd" }));
return (React.createElement(Tooltip, { dataHook: dataHook, disabled: !tooltipContent, content: tooltipContent, appendTo: "window", ...tooltipProps, "aria-describedby": tooltipContent ? undefined : ariaDescribedBy },
React.createElement("div", { "data-hook": "drag-handle-button", "data-disabled": !!disabled, "aria-label": tooltipContent || ariaLabel, "aria-describedby": ariaDescribedBy, ref: domRef, ...rest, role: "button", className: st(classes.root, {
disabled,
dragging,
}) }, dragHandleIcon)));
}
//# sourceMappingURL=DragHandle.js.map