"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

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

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

var _ToolbarButton = _interopRequireDefault(require("./ToolbarButton"));

var _ToolbarLink = _interopRequireDefault(require("./ToolbarLink"));

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

var Left = function Left(props) {
  return _react["default"].createElement("div", {
    className: "toolbar__left"
  }, props.children);
};

Left.propTypes = {
  children: _propTypes["default"].node.isRequired
};

var Right = function Right(props) {
  return _react["default"].createElement("div", {
    className: "toolbar__right"
  }, props.children);
};

Right.propTypes = {
  children: _propTypes["default"].node.isRequired
};

var Toolbar = function Toolbar(props) {
  var toolbarContentClasses = (0, _classnames["default"])({
    'toolbar__content': true,
    'toolbar__content--bare': props.toolbarStyle === 'bare',
    'background--white': props.isBottomToolbar,
    'border--top': props.isBottomToolbar,
    'no-border--bottom': props.isBottomToolbar || props.toolbarStyle === 'bare',
    'hard--left': props.isBottomToolbar
  });
  return _react["default"].createElement("div", {
    "data-oui-component": true,
    className: "toolbar",
    "data-test-section": props.testSection
  }, _react["default"].createElement("div", {
    className: toolbarContentClasses
  }, props.children));
};

Toolbar.defaultProps = {
  isBottomToolbar: false
};
Toolbar.propTypes = {
  /** Items to render for the toolbar */
  children: _propTypes["default"].node.isRequired,

  /** Whether this toolbar sits at the bottom of a page */
  isBottomToolbar: _propTypes["default"].bool,

  /** Hook to uze for automated testing */
  testSection: _propTypes["default"].string,

  /** The style to use for this toolbar */
  toolbarStyle: _propTypes["default"].oneOf(['bare'])
};
Toolbar.Button = _ToolbarButton["default"];
Toolbar.Link = _ToolbarLink["default"];
Toolbar.Right = Right;
Toolbar.Left = Left;
var _default = Toolbar;
exports["default"] = _default;