import { jsx as _jsx } from "react/jsx-runtime";
import cx from "classnames";
import { Bubble, } from "@gooddata/sdk-ui-kit";
import { IGNORED_CONFIGURATION_MENU_CLICK_CLASS } from "../../../constants/classes.js";
export const defaultAlignPoints = [
    { align: "tr tl" },
    { align: "br bl" },
    { align: "tl tr" },
    { align: "bl br" },
    { align: "tr tr" },
    { align: "br br" },
];
export const defaultFlexibleArrowOffsets = {
    "tr tl": [15, 16],
    "br bl": [15, -16],
    "tl tr": [-15, 16],
    "bl br": [-15, -16],
};
export const defaultArrowDirections = {
    "tr tr": "right",
    "br br": "right",
};
export function ConfigurationBubble({ id, children, classNames, onClose, closeOnEscape, alignTo, alignPoints = defaultAlignPoints, arrowOffsets, overlayPositionType, arrowDirections = defaultArrowDirections, accessibilityConfig, }) {
    // do not close on click to the widget
    const ignoredClassSelector = `.${IGNORED_CONFIGURATION_MENU_CLICK_CLASS}`;
    const ignoreClicksOnByClass = typeof alignTo === "string" ? [alignTo, ignoredClassSelector] : [ignoredClassSelector];
    const bubbleArrowOffsets = arrowOffsets === undefined ? defaultFlexibleArrowOffsets : arrowOffsets;
    return (_jsx(Bubble, { id: id, className: cx("bubble-light gd-configuration-bubble s-gd-configuration-bubble", classNames), overlayClassName: "gd-configuration-bubble-wrapper sdk-edit-mode-on", alignTo: alignTo, alignPoints: alignPoints, arrowOffsets: bubbleArrowOffsets, arrowDirections: arrowDirections, closeOnOutsideClick: true, closeOnParentScroll: false, ignoreClicksOnByClass: ignoreClicksOnByClass, onClose: onClose, closeOnEscape: closeOnEscape, overlayPositionType: overlayPositionType, ensureVisibility: true, accessibilityConfig: accessibilityConfig, children: children }));
}
//# sourceMappingURL=ConfigurationBubble.js.map