@frontify/fondue
Version:
Design system of Frontify
13 lines (12 loc) • 483 B
JavaScript
const m = (e, n, p, g) => {
var c;
let t = "bottom", o = 1 / 0;
if (!e || !n)
return { position: t, maxHeight: o };
const { top: s, bottom: w } = e.getBoundingClientRect(), i = (((c = window.visualViewport) == null ? void 0 : c.height) ?? 0) - w - p - g, r = s - p;
return i < n && (t = i < r ? "top" : "bottom"), o = t === "top" ? r : i, { position: t, maxHeight: o };
};
export {
m as getVerticalPositioning
};
//# sourceMappingURL=getVerticalPositioning.es.js.map