var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { addSubcomponents } from '../../utils/addSubcomponents';
import { isReactElement } from '../../utils/isReactElement';
import { OverlayTrigger } from '../OverlayTrigger';
import { StyledPopover, StyledPopoverContent } from './Popover.styles';
var Content = React.forwardRef(function Content(_a, ref) {
    var children = _a.children, _b = _a.fluid, fluid = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, props = __rest(_a, ["children", "fluid", "placement"]);
    return (React.createElement(StyledPopover, { ref: ref },
        React.createElement(StyledPopoverContent, __assign({}, props, { "$fluid": fluid, "$placement": placement }), children)));
});
/**

 We use popovers to display more of an item’s information or details on hover.
 This may be used to show additional fields in an item’s form that aren’t shown
 by default in the UI. Oftentimes, there will be a visual queue to indicate that
 more information is available.

 Do not use popovers to display large amounts of information, perform data
 entry, or use as a replacement for an overflow, menu, or modal.

 If you want to show descriptive / educational information about an item,
 use a tooltip.

 @since 10.19.0

 @see [Storybook](https://procore.github.io/core/latest/?path=/story/popover--basic)

 @see [Design Guidelines](https://design.procore.com/popover)

 */
var Popover_ = React.forwardRef(function Popover(_a, ref) {
    var children = _a.children, _b = _a.initialIsVisible, initialIsVisible = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, overlay = _a.overlay, props = __rest(_a, ["children", "initialIsVisible", "placement", "overlay"]);
    var overlayNode = isReactElement(overlay) ? (React.cloneElement(overlay, { placement: placement })) : (React.createElement(React.Fragment, null));
    return (React.createElement(OverlayTrigger, __assign({}, __assign(__assign({}, props), { initialIsVisible: initialIsVisible, overlay: overlayNode, placement: placement, ref: ref, restoreFocusOnHide: false, shrinkOverlay: true })), children));
});
Popover_.displayName = 'Popover';
Content.displayName = 'Popover.Content';
export var Popover = addSubcomponents({ Content: Content }, Popover_);
//# sourceMappingURL=Popover.js.map