var _excluded = ["totalSize", "data-item-index", "context"],
  _excluded2 = ["children"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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