@underverse-ui/underverse 1.0.119 → 1.0.121
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/CHANGELOG.md +6 -0
- package/api-reference.json +1 -1
- package/dist/index.cjs +37 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2915,6 +2915,10 @@ var Tooltip = React10.forwardRef(({
|
|
|
2915
2915
|
setIsOpen(false);
|
|
2916
2916
|
}, delayClose);
|
|
2917
2917
|
};
|
|
2918
|
+
const closeNow = React10.useCallback(() => {
|
|
2919
|
+
clearTimeout(timeoutRef.current);
|
|
2920
|
+
setIsOpen(false);
|
|
2921
|
+
}, []);
|
|
2918
2922
|
const handleFocus = () => {
|
|
2919
2923
|
if (disabled) return;
|
|
2920
2924
|
setIsOpen(true);
|
|
@@ -2925,6 +2929,10 @@ var Tooltip = React10.forwardRef(({
|
|
|
2925
2929
|
React10.useEffect(() => {
|
|
2926
2930
|
return () => clearTimeout(timeoutRef.current);
|
|
2927
2931
|
}, []);
|
|
2932
|
+
React10.useEffect(() => {
|
|
2933
|
+
if (isOpen) return;
|
|
2934
|
+
clearTimeout(timeoutRef.current);
|
|
2935
|
+
}, [isOpen]);
|
|
2928
2936
|
React10.useLayoutEffect(() => {
|
|
2929
2937
|
if (!isOpen) {
|
|
2930
2938
|
lastAppliedRef.current = null;
|
|
@@ -2968,6 +2976,18 @@ var Tooltip = React10.forwardRef(({
|
|
|
2968
2976
|
if (panelRef.current) ro.observe(panelRef.current);
|
|
2969
2977
|
return () => ro.disconnect();
|
|
2970
2978
|
}, [isOpen, updatePosition]);
|
|
2979
|
+
React10.useEffect(() => {
|
|
2980
|
+
if (!isOpen) return;
|
|
2981
|
+
const handleDocumentKeyDown = (event) => {
|
|
2982
|
+
if (event.key === "Escape") closeNow();
|
|
2983
|
+
};
|
|
2984
|
+
document.addEventListener("pointerdown", closeNow, true);
|
|
2985
|
+
document.addEventListener("keydown", handleDocumentKeyDown);
|
|
2986
|
+
return () => {
|
|
2987
|
+
document.removeEventListener("pointerdown", closeNow, true);
|
|
2988
|
+
document.removeEventListener("keydown", handleDocumentKeyDown);
|
|
2989
|
+
};
|
|
2990
|
+
}, [closeNow, isOpen]);
|
|
2971
2991
|
const childProps = children.props;
|
|
2972
2992
|
const childRef = childProps.ref;
|
|
2973
2993
|
const passthroughRef = mergeRefs(forwardedRef, childRef, (node) => {
|
|
@@ -3000,6 +3020,22 @@ var Tooltip = React10.forwardRef(({
|
|
|
3000
3020
|
handleMouseLeave();
|
|
3001
3021
|
}
|
|
3002
3022
|
),
|
|
3023
|
+
onPointerDown: chainEventHandlers(
|
|
3024
|
+
triggerPassthroughProps.onPointerDown,
|
|
3025
|
+
childProps.onPointerDown,
|
|
3026
|
+
(e) => {
|
|
3027
|
+
triggerRef.current = e.currentTarget;
|
|
3028
|
+
closeNow();
|
|
3029
|
+
}
|
|
3030
|
+
),
|
|
3031
|
+
onClick: chainEventHandlers(
|
|
3032
|
+
triggerPassthroughProps.onClick,
|
|
3033
|
+
childProps.onClick,
|
|
3034
|
+
(e) => {
|
|
3035
|
+
triggerRef.current = e.currentTarget;
|
|
3036
|
+
closeNow();
|
|
3037
|
+
}
|
|
3038
|
+
),
|
|
3003
3039
|
onFocus: chainEventHandlers(
|
|
3004
3040
|
triggerPassthroughProps.onFocus,
|
|
3005
3041
|
childProps.onFocus,
|
|
@@ -5276,7 +5312,7 @@ var Modal = ({
|
|
|
5276
5312
|
{
|
|
5277
5313
|
ref: modalContentRef,
|
|
5278
5314
|
className: cn(
|
|
5279
|
-
"relative w-full rounded-2xl md:rounded-3xl bg-card text-card-foreground shadow-xl",
|
|
5315
|
+
"relative w-full rounded-2xl md:rounded-3xl border border-border/40 bg-card text-card-foreground shadow-xl",
|
|
5280
5316
|
"transition-all duration-200 ease-out",
|
|
5281
5317
|
maxWidthClass,
|
|
5282
5318
|
fullWidth && "mx-0",
|