@norges-domstoler/dds-components 0.0.0-dev-20261120084514 → 0.0.0-dev-20261120110241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +19 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -3
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +16 -18
- package/dist/index.mjs.map +1 -1
- package/dist/rolldown-runtime-DYKLkwDO.mjs +13 -0
- package/package.json +2 -2
- package/dist/rolldown-runtime-D1lRXUGZ.mjs +0 -13
package/dist/index.cjs
CHANGED
|
@@ -7,14 +7,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __exportAll = (all,
|
|
11
|
-
let target = {};
|
|
10
|
+
var __exportAll = (all, flags) => {
|
|
11
|
+
let target = Object.setPrototypeOf({}, null);
|
|
12
12
|
for (var name in all) __defProp(target, name, {
|
|
13
13
|
get: all[name],
|
|
14
14
|
enumerable: true
|
|
15
15
|
});
|
|
16
|
-
if (!
|
|
17
|
-
return target;
|
|
16
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -7429,33 +7429,31 @@ const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100,
|
|
|
7429
7429
|
};
|
|
7430
7430
|
}
|
|
7431
7431
|
}, [tooltipRef]);
|
|
7432
|
+
const timerRef = (0, react.useRef)(void 0);
|
|
7433
|
+
const closeTooltip = (0, react.useCallback)(() => {
|
|
7434
|
+
clearTimeout(timerRef.current);
|
|
7435
|
+
setOpen(false);
|
|
7436
|
+
}, []);
|
|
7437
|
+
const openTooltip = () => {
|
|
7438
|
+
if (!open) {
|
|
7439
|
+
clearTimeout(timerRef.current);
|
|
7440
|
+
timerRef.current = setTimeout(() => setOpen(true), delay);
|
|
7441
|
+
}
|
|
7442
|
+
};
|
|
7432
7443
|
(0, react.useEffect)(() => {
|
|
7433
|
-
|
|
7434
|
-
closeTooltip();
|
|
7435
|
-
});
|
|
7444
|
+
window.addEventListener("scroll", closeTooltip, { passive: true });
|
|
7436
7445
|
return () => {
|
|
7437
|
-
|
|
7446
|
+
window.removeEventListener("scroll", closeTooltip);
|
|
7438
7447
|
};
|
|
7439
|
-
}, []);
|
|
7440
|
-
let timer;
|
|
7448
|
+
}, [closeTooltip]);
|
|
7441
7449
|
(0, react.useEffect)(() => {
|
|
7442
7450
|
return () => {
|
|
7443
|
-
clearTimeout(
|
|
7451
|
+
clearTimeout(timerRef.current);
|
|
7444
7452
|
};
|
|
7445
7453
|
}, []);
|
|
7446
7454
|
useOnKeyDown(["Escape", "Esc"], () => {
|
|
7447
7455
|
if (open) setOpen(false);
|
|
7448
7456
|
});
|
|
7449
|
-
const closeTooltip = () => {
|
|
7450
|
-
clearTimeout(timer);
|
|
7451
|
-
setOpen(false);
|
|
7452
|
-
};
|
|
7453
|
-
const openTooltip = () => {
|
|
7454
|
-
if (!open) {
|
|
7455
|
-
clearTimeout(timer);
|
|
7456
|
-
timer = setTimeout(() => setOpen(true), delay);
|
|
7457
|
-
}
|
|
7458
|
-
};
|
|
7459
7457
|
const hasTransitionedIn = useMountTransition(open, 500);
|
|
7460
7458
|
const isTransientlyMounted = !keepMounted && hasTransitionedIn && open;
|
|
7461
7459
|
const anchorElement = react.Children.only((0, react.cloneElement)(children, {
|