"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Toolbar = Toolbar;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _Toolbar = require("./Toolbar.styles");
var _helpers = require("../../helpers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Toolbar(_ref) {
  var _ref$open = _ref.open,
    open = _ref$open === void 0 ? false : _ref$open,
    _ref$renderInPortal = _ref.renderInPortal,
    renderInPortal = _ref$renderInPortal === void 0 ? true : _ref$renderInPortal,
    children = _ref.children,
    className = _ref.className,
    style = _ref.style;
  // Abstract content with default values.
  var TOOLBAR_CONTENT = /*#__PURE__*/_react.default.createElement(_Toolbar.StyledToolbar, {
    className: (0, _classnames.default)("c-toolbar", className),
    role: "toolbar",
    tabIndex: -1,
    "aria-orientation": "horizontal",
    "aria-modal": "true",
    style: style
  }, children);

  // If `renderInPortal` prop is present, render toolbar content in Portal.
  // default: true
  if (renderInPortal) open ? /*#__PURE__*/_react.default.createElement(_helpers.Portal, null, TOOLBAR_CONTENT) : null;
  return open ? TOOLBAR_CONTENT : null;
}
Toolbar.displayName = "Toolbar";
//# sourceMappingURL=Toolbar.js.map