var _excluded = ["totalSize", "data-item-index", "context"],
  _excluded2 = ["children"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
import React from 'react';
import { StyledGroup, StyledItem } from './NextMenu.styles';
/**
 *  Default representation of item in menu
 * */
export var NextMenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var _context$items, _context$getItemLabel, _context$getItemLabel2, _context$items2;
  var totalSize = _ref.totalSize,
    itemPositionInList = _ref['data-item-index'],
    context = _ref.context,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(StyledItem, _extends({
    "aria-setsize": context === null || context === void 0 ? void 0 : (_context$items = context.items) === null || _context$items === void 0 ? void 0 : _context$items.length,
    "aria-posinset": itemPositionInList + 1,
    ref: ref
  }, props), (_context$getItemLabel = context === null || context === void 0 ? void 0 : (_context$getItemLabel2 = context.getItemLabel) === null || _context$getItemLabel2 === void 0 ? void 0 : _context$getItemLabel2.call(context, context === null || context === void 0 ? void 0 : (_context$items2 = context.items) === null || _context$items2 === void 0 ? void 0 : _context$items2[itemPositionInList])) !== null && _context$getItemLabel !== void 0 ? _context$getItemLabel : null);
});

/**
 *  Default representation of group with items in menu
 * */
export var NextMenuGroup = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
  var children = _ref2.children,
    props = _objectWithoutProperties(_ref2, _excluded2);
  return /*#__PURE__*/React.createElement(StyledGroup, _extends({
    ref: ref
  }, props), children);
});
//# sourceMappingURL=NextMenuItem.js.map