@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
75 lines (74 loc) • 1.7 kB
JavaScript
import s, { sticky as r } from "tippy.js";
const l = [
"bottom",
"bottom-start",
"bottom-end",
"right",
"right-start",
"right-end",
"left",
"left-start",
"left-end",
"top",
"top-start",
"top-end"
], d = [!0, !1, "reference", "popper"], m = (e, t) => {
const { contentElement: n } = { ...t };
return delete t.contentElement, s(e, {
...t,
plugins: [r],
render: () => p(n)
});
}, u = (e, t) => s(e, {
...t,
plugins: [r]
}), a = ({
boundary: e = "clippingParents",
fallbackPlacements: t = [],
hasHideModifierEnabled: n = !1,
// If set to false the dialog will display over top of the anchor when there is insufficient space.
// if set to true it will never move from its position relative to the anchor and will clip instead.
tether: o = !0
} = {}) => ({
modifiers: [
{
name: "flip",
options: {
fallbackPlacements: t,
boundary: e
}
},
{
name: "hide",
enabled: n
},
{
name: "preventOverflow",
options: {
altAxis: !o,
tether: o
}
}
]
}), i = (e) => {
const t = document.createElement("span");
return t.innerText = e.innerText || "", e.innerText = "", e.appendChild(t), t;
}, f = (e) => {
const t = e == null ? void 0 : e.children[0];
return t || i(e);
}, p = (e) => {
const t = document.createElement("div");
return t.className = "tippy-box d-ps-absolute", t.appendChild(e), {
popper: t
};
};
export {
l as BASE_TIPPY_DIRECTIONS,
d as TIPPY_STICKY_VALUES,
u as createTippy,
m as createTippyPopover,
f as getAnchor,
p as getContentWrapper,
a as getPopperOptions
};
//# sourceMappingURL=tippy-utils.js.map