"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BannerNavigation = exports.BannerNavigationItem = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _Wrapper = _interopRequireDefault(require("../Wrapper"));

var _js = require("../../globals/js");

var _excluded = ["children", "className", "pageWidth"];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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; }

var prefix = _js.settings.prefix;

var BannerNavigationItem = function BannerNavigationItem(_ref) {
  var className = _ref.className,
      children = _ref.children;
  var wrapperClasses = (0, _classnames.default)("".concat(prefix, "--banner-navigation__item"), className);
  return /*#__PURE__*/_react.default.createElement("li", {
    className: wrapperClasses
  }, children);
};

exports.BannerNavigationItem = BannerNavigationItem;
BannerNavigationItem.propTypes = {
  /**
   * The CSS class name to be placed on the wrapping element.
   */
  className: _propTypes.default.string,
  children: _propTypes.default.node.isRequired
};
/**
 * A thin bar on top of the main navigation used to crosslink among apps or pages.
 */

var BannerNavigation = function BannerNavigation(_ref2) {
  var children = _ref2.children,
      className = _ref2.className,
      pageWidth = _ref2.pageWidth,
      props = _objectWithoutProperties(_ref2, _excluded);

  var wrapperClasses = (0, _classnames.default)("".concat(prefix, "--banner-navigation"), className);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: wrapperClasses
  }, /*#__PURE__*/_react.default.createElement(_Wrapper.default, props, /*#__PURE__*/_react.default.createElement("ul", {
    className: "".concat(prefix, "--banner-navigation__list")
  }, children)));
};

exports.BannerNavigation = BannerNavigation;
BannerNavigation.propTypes = {
  /**
   * The content usually consisting out of `BannerNavigationItem`
   */
  children: _propTypes.default.node.isRequired,

  /**
   * The CSS class name to be placed on the wrapping element.
   */
  className: _propTypes.default.string,

  /**
   * Specify the max-width on desktop devices (same as \`Wrapper\` component)
   */
  pageWidth: _propTypes.default.oneOf(['sm', 'md', 'lg', 'full'])
};
BannerNavigation.defaultProps = {
  pageWidth: 'lg'
};