'use strict';

var PropTypes = require('prop-types');
var deprecate = require('../../internal/deprecate.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);

/** common proptypes associated with child content for a header action */
var ChildContentPropTypes = {
  metaData: PropTypes__default.default.shape({
    /** The specific type of element to render */
    element: PropTypes__default.default.string
  }),
  content: PropTypes__default.default.node
};

/** common proptypes associated with a header action */
var HeaderActionItemPropTypes = {
  /** Optionally provide a custom class to apply to the button */
  className: PropTypes__default.default.string,
  /** label for the menu button */
  label: PropTypes__default.default.string.isRequired,
  /** should the action render a panel or a submenu */
  hasHeaderPanel: PropTypes__default.default.bool,
  /** Menu button that pops out the action panel */
  btnContent: PropTypes__default.default.node.isRequired,
  /** content to render in the action panel */
  childContent: PropTypes__default.default.arrayOf(PropTypes__default.default.shape(ChildContentPropTypes)),
  onClick: PropTypes__default.default.func,
  /** a string id that can be used by the isActionItemVisible function to determine if an item should be shown */
  id: PropTypes__default.default.string
};
var HeaderPanelPropTypes = {
  /** Optionally provide a custom class to apply to the underlying <li> node */
  className: PropTypes__default.default.string,
  /** the content of the header panel  */
  content: PropTypes__default.default.any
};
var HeaderActionPropTypes = {
  /** details of the item to render in the action */
  item: PropTypes__default.default.shape(HeaderActionItemPropTypes).isRequired,
  /** unique index for the menu item */
  index: PropTypes__default.default.number.isRequired,
  // eslint-disable-next-line react/require-default-props
  testID: deprecate(PropTypes__default.default.string, "The 'testID' prop has been deprecated. Please use 'testId' instead."),
  /** Id that can be used for testing */
  testId: PropTypes__default.default.string,
  /** render only the label instead of the button */
  renderLabel: PropTypes__default.default.bool,
  /** should this action item be expanded by default */
  defaultExpanded: PropTypes__default.default.bool,
  /** a callback to trigger when the item is closed. used to managing icons for the overflow menu */
  onClose: PropTypes__default.default.func,
  i18n: PropTypes__default.default.shape({
    closeMenu: PropTypes__default.default.string
  }),
  inOverflow: PropTypes__default.default.bool,
  showCloseIconWhenPanelExpanded: PropTypes__default.default.bool
};

exports.ChildContentPropTypes = ChildContentPropTypes;
exports.HeaderActionItemPropTypes = HeaderActionItemPropTypes;
exports.HeaderActionPropTypes = HeaderActionPropTypes;
exports.HeaderPanelPropTypes = HeaderPanelPropTypes;
