"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 StatusBar
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusBarRightSection = exports.StatusBarCenterSection = exports.StatusBarLeftSection = exports.StatusBarSpaceBetween = exports.StatusBar = void 0;
const core_react_1 = require("@itwin/core-react");
const React = require("react");
const classnames_1 = require("classnames");
const UiFramework_1 = require("../UiFramework");
const SafeAreaContext_1 = require("../safearea/SafeAreaContext");
const Field_1 = require("./Field");
const Popup_1 = require("./popup/Popup");
require("./StatusBar.scss");
const SafeAreaInsets_1 = require("../layout/base/SafeAreaInsets");
const DockedBar_1 = require("../widget-panels/DockedBar");
/** Status Bar React component.
 * @public
 * @deprecated in 4.14.0. Use {@link StatusBarComposer} instead.
 */
function StatusBar(props) {
    const safeAreaInsets = React.useContext(SafeAreaContext_1.SafeAreaContext);
    const className = (0, classnames_1.default)("uifw-statusBar", safeAreaInsets && SafeAreaInsets_1.SafeAreaInsetsHelpers.getCssClassNames(safeAreaInsets), props.className);
    return (React.createElement(DockedBar_1.DockedBar, { placement: "bottom", className: className, style: props.style, onMouseEnter: UiFramework_1.UiFramework.visibility.handleWidgetMouseEnter },
        props.widgetControl?.getReactNode?.() ?? null,
        props.children));
}
exports.StatusBar = StatusBar;
/** StatusBar With Space Between Items React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
function StatusBarSpaceBetween(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(core_react_1.Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-space-between" }));
}
exports.StatusBarSpaceBetween = StatusBarSpaceBetween;
/** StatusBar Left Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
function StatusBarLeftSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(core_react_1.Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-left" }));
}
exports.StatusBarLeftSection = StatusBarLeftSection;
/** StatusBar Center Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
function StatusBarCenterSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(core_react_1.Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-center" }));
}
exports.StatusBarCenterSection = StatusBarCenterSection;
/** StatusBar Right Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
function StatusBarRightSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(core_react_1.Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-right" }));
}
exports.StatusBarRightSection = StatusBarRightSection;
/** Components used in a [[StatusBar]].
 * @public
 * @deprecated in 4.14.0. Please use components directly.
 */
(function (StatusBar) {
    /** Field of a [[StatusBar]].
     * @beta
     * @deprecated in 4.14.0. Use [iTwinUI Button](https://itwinui.bentley.com/docs/button) instead.
     */
    // eslint-disable-next-line deprecation/deprecation
    StatusBar.Field = Field_1.StatusBarField;
    /** Popup of a [[StatusBar]].
     * @beta
     * @deprecated in 4.14.0. Use `StatusBarPopover` instead.
     */
    // eslint-disable-next-line deprecation/deprecation
    StatusBar.Popup = Popup_1.StatusBarPopup;
})(StatusBar || (exports.StatusBar = StatusBar = {}));
//# sourceMappingURL=StatusBar.js.map