"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = exports.NavbarContext = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

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

var _NavbarBody = _interopRequireDefault(require("./NavbarBody"));

var _NavbarHeader = _interopRequireDefault(require("./NavbarHeader"));

var _utils = require("../utils");

var NavbarContext = /*#__PURE__*/_react.default.createContext(null);

exports.NavbarContext = NavbarContext;
var defaultProps = {
  as: 'div',
  hasChildContext: true,
  classPrefix: 'navbar',
  appearance: 'default'
};

var Navbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
  var className = props.className,
      Component = props.as,
      hasChildContext = props.hasChildContext,
      classPrefix = props.classPrefix,
      appearance = props.appearance,
      rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["className", "as", "hasChildContext", "classPrefix", "appearance"]);

  var _useClassNames = (0, _utils.useClassNames)(classPrefix),
      withClassPrefix = _useClassNames.withClassPrefix,
      merge = _useClassNames.merge;

  var classes = merge(className, withClassPrefix(appearance));
  return /*#__PURE__*/_react.default.createElement(NavbarContext.Provider, {
    value: hasChildContext
  }, /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
    ref: ref,
    className: classes
  })));
});

Navbar.Header = _NavbarHeader.default;
Navbar.Body = _NavbarBody.default;
Navbar.displayName = 'Navbar';
Navbar.defaultProps = defaultProps;
var _default = Navbar;
exports.default = _default;