"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.DragHandle = DragHandle;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _DragHandleSt = require("./DragHandle.st.css.js");
var _react = _interopRequireDefault(require("react"));
var _system = require("@wix/wix-ui-icons-common/system");
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
var _WixDesignSystemIconThemeProvider = require("../WixDesignSystemIconThemeProvider");
var _excluded = ["dataHook", "domRef", "dragging", "disabled", "aria-label", "aria-describedby", "tooltipContent", "tooltipProps", "dragHandleSize"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/DragHandle/DragHandle.tsx";
function DragHandle(props) {
  var {
      dataHook,
      domRef,
      dragging,
      disabled,
      'aria-label': ariaLabel,
      'aria-describedby': ariaDescribedBy,
      tooltipContent,
      tooltipProps,
      dragHandleSize
    } = props,
    rest = (0, _objectWithoutProperties2.default)(props, _excluded);
  var icons = (0, _WixDesignSystemIconThemeProvider.useIcons)('DragHandle', {
    DragAndDropLarge: _system.DragAndDropLarge,
    DragAndDropSmall: _system.DragAndDropSmall
  });
  var dragHandleIcon = dragHandleSize === 'small' ? /*#__PURE__*/_react.default.createElement(icons.DragAndDropSmall, {
    "data-hook": "dnd",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 7
    }
  }) : /*#__PURE__*/_react.default.createElement(icons.DragAndDropLarge, {
    "data-hook": "dnd",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 7
    }
  });
  return /*#__PURE__*/_react.default.createElement(_Tooltip.default, (0, _extends2.default)({
    dataHook: dataHook,
    disabled: !tooltipContent,
    content: tooltipContent,
    appendTo: "window"
  }, tooltipProps, {
    "aria-describedby": tooltipContent ? undefined : ariaDescribedBy,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 5
    }
  }), /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    "data-hook": "drag-handle-button",
    "data-disabled": !!disabled,
    "aria-label": tooltipContent || ariaLabel,
    "aria-describedby": ariaDescribedBy,
    ref: domRef
  }, rest, {
    role: "button",
    className: (0, _DragHandleSt.st)(_DragHandleSt.classes.root, {
      disabled,
      dragging
    }),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 46,
      columnNumber: 7
    }
  }), dragHandleIcon));
}
//# sourceMappingURL=DragHandle.js.map