"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Widget
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentToolWidgetComposer = void 0;
const classnames_1 = require("classnames");
const React = require("react");
const appui_abstract_1 = require("@itwin/appui-abstract");
const ToolbarComposer_1 = require("../toolbar/ToolbarComposer");
const ToolWidgetComposer_1 = require("./ToolWidgetComposer");
const useUiVisibility_1 = require("../hooks/useUiVisibility");
/**
 * ContentToolWidgetComposer composes a Tool Widget with no tools defined by default. UiItemsProviders
 * are used to populate the toolbars. See [[StandardContentToolsProvider]].
 * @example
 * ToolWidget with no corner button
 * ```
 * <ContentToolWidgetComposer />
 * ```
 * ToolWidget with corner button
 * ```
 * const cornerButton = <BackstageAppButton icon={"icon-bentley-systems"} />;
 * <ContentToolWidgetComposer cornerButton={cornerButton} />
 * ```
 * ToolWidget with custom corner button
 * ```
 * const cornerButton = <BackstageAppButton icon={"icon-bentley-systems"}
 *   label="Toggle Backstage display",
 *   execute={() => BackstageManager.getBackstageToggleCommand().execute()} />;
 * <ContentToolWidgetComposer cornerButton={cornerButton} />
 * ```
 *
 * BackstageCornerButton,
 * @public
 */
function ContentToolWidgetComposer(props) {
    const { cornerButton } = props;
    const uiIsVisible = (0, useUiVisibility_1.useUiVisibility)();
    // istanbul ignore next
    const className = (0, classnames_1.default)(!uiIsVisible && "nz-hidden");
    return (React.createElement(ToolWidgetComposer_1.ToolWidgetComposer, { className: className, cornerItem: cornerButton, horizontalToolbar: React.createElement(ToolbarComposer_1.ToolbarComposer, { items: [], usage: appui_abstract_1.ToolbarUsage.ContentManipulation, orientation: appui_abstract_1.ToolbarOrientation.Horizontal }), verticalToolbar: React.createElement(ToolbarComposer_1.ToolbarComposer, { items: [], usage: appui_abstract_1.ToolbarUsage.ContentManipulation, orientation: appui_abstract_1.ToolbarOrientation.Vertical }) }));
}
exports.ContentToolWidgetComposer = ContentToolWidgetComposer;
//# sourceMappingURL=ContentToolWidgetComposer.js.map