UNPKG

@activecollab/components

Version:

ActiveCollab Components

29 lines (28 loc) 903 B
import React from "react"; import classNames from "classnames"; import { StyledToolbar } from "./Toolbar.styles"; import { Portal } from "../../helpers"; export function Toolbar(_ref) { let { open = false, renderInPortal = true, children, className, style } = _ref; // Abstract content with default values. const TOOLBAR_CONTENT = /*#__PURE__*/React.createElement(StyledToolbar, { className: classNames("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.createElement(Portal, null, TOOLBAR_CONTENT) : null; return open ? TOOLBAR_CONTENT : null; } Toolbar.displayName = "Toolbar"; //# sourceMappingURL=Toolbar.js.map