"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _SidebarNextContext = require("../SidebarNext/SidebarNextContext");
var _SidebarItemNextSt = require("./SidebarItemNext.st.css.js");
var _SidebarItemButtonNext = _interopRequireDefault(require("./SidebarItemButtonNext"));
var _constants = require("./constants");
var _excluded = ["as", "role"],
  _excluded2 = ["dataHook", "onMouseEnter", "onMouseLeave"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SidebarItemNext/SidebarItemNext.jsx",
  _this = void 0;
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/** An item for the section within the sidebar */
var SidebarItemNext = function SidebarItemNext(_ref) {
  var _ref$as = _ref.as,
    as = _ref$as === void 0 ? 'button' : _ref$as,
    _ref$role = _ref.role,
    role = _ref$role === void 0 ? 'link' : _ref$role,
    propsWithNoDefaults = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
  var _as$role$propsWithNoD = _objectSpread({
      as: as,
      role: role
    }, propsWithNoDefaults),
    dataHook = _as$role$propsWithNoD.dataHook,
    onMouseEnter = _as$role$propsWithNoD.onMouseEnter,
    onMouseLeave = _as$role$propsWithNoD.onMouseLeave,
    rest = (0, _objectWithoutProperties2["default"])(_as$role$propsWithNoD, _excluded2);
  var context = (0, _react.useContext)(_SidebarNextContext.SidebarNextContext);
  return /*#__PURE__*/_react["default"].createElement("li", {
    className: _SidebarItemNextSt.classes.listItem,
    "aria-level": context.level,
    "data-hook": dataHook,
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave,
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 21,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react["default"].createElement(_SidebarItemButtonNext["default"], (0, _extends2["default"])({}, rest, {
    dataHook: _constants.dataHooks.button,
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 7
    }
  })));
};
SidebarItemNext.displayName = 'SidebarItemNext';
var _default = exports["default"] = SidebarItemNext;