"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.StatusBarPopover = void 0;
const React = require("react");
const itwinui_react_1 = require("@itwin/itwinui-react");
const ExpandIndicator_1 = require("./ExpandIndicator");
const core_react_1 = require("@itwin/core-react");
/** Popover component used in `StatusBar` component.
 * This component should wrap the element that triggers the popover.
 * @note Add the `StatusBarPopover.ExpandIndicator` to popover trigger buttons.
 * @public
 */
function StatusBarPopover({ content, ...props }) {
    const [portalTarget, setPortalTarget] = React.useState(undefined);
    return (React.createElement(itwinui_react_1.Popover, { ...props, content: React.createElement(core_react_1.PopupContext.Provider, { value: portalTarget }, content), placement: "top", applyBackground: true, middleware: {
            offset: 4,
        }, ref: (el) => {
            setPortalTarget(el ?? undefined);
        } }));
}
exports.StatusBarPopover = StatusBarPopover;
/** Components used in `StatusBarPopover`.
 * @public
 */
(function (StatusBarPopover) {
    /** Indicator to be used in popover trigger buttons to show expandable content.
     * @public
     */
    StatusBarPopover.ExpandIndicator = ExpandIndicator_1.ButtonExpandIndicator;
})(StatusBarPopover || (exports.StatusBarPopover = StatusBarPopover = {}));
//# sourceMappingURL=StatusBarPopover.js.map