/*---------------------------------------------------------------------------------------------
 * 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
 */
import { Div } from "@itwin/core-react";
import * as React from "react";
import classnames from "classnames";
import { UiFramework } from "../UiFramework";
import { SafeAreaContext } from "../safearea/SafeAreaContext";
import { StatusBarField } from "./Field";
import { StatusBarPopup } from "./popup/Popup";
import "./StatusBar.scss";
import { SafeAreaInsetsHelpers } from "../layout/base/SafeAreaInsets";
import { DockedBar } from "../widget-panels/DockedBar";
/** Status Bar React component.
 * @public
 * @deprecated in 4.14.0. Use {@link StatusBarComposer} instead.
 */
export function StatusBar(props) {
    const safeAreaInsets = React.useContext(SafeAreaContext);
    const className = classnames("uifw-statusBar", safeAreaInsets && SafeAreaInsetsHelpers.getCssClassNames(safeAreaInsets), props.className);
    return (React.createElement(DockedBar, { placement: "bottom", className: className, style: props.style, onMouseEnter: UiFramework.visibility.handleWidgetMouseEnter },
        props.widgetControl?.getReactNode?.() ?? null,
        props.children));
}
/** StatusBar With Space Between Items React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
export function StatusBarSpaceBetween(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-space-between" }));
}
/** StatusBar Left Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
export function StatusBarLeftSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-left" }));
}
/** StatusBar Center Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
export function StatusBarCenterSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-center" }));
}
/** StatusBar Right Section React functional component
 * @public
 */
// eslint-disable-next-line deprecation/deprecation
export function StatusBarRightSection(props) {
    const { className, ...divProps } = props;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-right" }));
}
/** 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 = StatusBarField;
    /** Popup of a [[StatusBar]].
     * @beta
     * @deprecated in 4.14.0. Use `StatusBarPopover` instead.
     */
    // eslint-disable-next-line deprecation/deprecation
    StatusBar.Popup = StatusBarPopup;
})(StatusBar || (StatusBar = {}));
//# sourceMappingURL=StatusBar.js.map