@react-aria/tooltip 3.7.3 → 3.7.4
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/useTooltip.main.js
CHANGED
package/dist/useTooltip.mjs
CHANGED
|
@@ -23,11 +23,11 @@ function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) {
|
|
|
23
23
|
});
|
|
24
24
|
return {
|
|
25
25
|
tooltipProps: (0, $kwmr2$mergeProps)(domProps, hoverProps, {
|
|
26
|
-
role:
|
|
26
|
+
role: 'tooltip'
|
|
27
27
|
})
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
export {$326e436e94273fe1$export$1c4b08e0eca38426 as useTooltip};
|
|
33
|
-
//# sourceMappingURL=useTooltip.
|
|
33
|
+
//# sourceMappingURL=useTooltip.module.js.map
|
|
@@ -39,16 +39,16 @@ function $f017bbc46d58d42a$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
39
39
|
if (ref && ref.current) // Escape after clicking something can give it keyboard focus
|
|
40
40
|
// dismiss tooltip on esc key press
|
|
41
41
|
{
|
|
42
|
-
if (e.key ===
|
|
42
|
+
if (e.key === 'Escape') {
|
|
43
43
|
e.stopPropagation();
|
|
44
44
|
state.close(true);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
if (state.isOpen) {
|
|
49
|
-
document.addEventListener(
|
|
49
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
50
50
|
return ()=>{
|
|
51
|
-
document.removeEventListener(
|
|
51
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
}, [
|
|
@@ -56,17 +56,17 @@ function $f017bbc46d58d42a$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
56
56
|
state
|
|
57
57
|
]);
|
|
58
58
|
let onHoverStart = ()=>{
|
|
59
|
-
if (trigger ===
|
|
59
|
+
if (trigger === 'focus') return;
|
|
60
60
|
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard
|
|
61
61
|
// interactions for example, hover will end. When hover is restored after that element disappears,
|
|
62
62
|
// focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover
|
|
63
63
|
// is the result of moving the mouse.
|
|
64
|
-
if ((0, $jCY2B$reactariainteractions.getInteractionModality)() ===
|
|
64
|
+
if ((0, $jCY2B$reactariainteractions.getInteractionModality)() === 'pointer') isHovered.current = true;
|
|
65
65
|
else isHovered.current = false;
|
|
66
66
|
handleShow();
|
|
67
67
|
};
|
|
68
68
|
let onHoverEnd = ()=>{
|
|
69
|
-
if (trigger ===
|
|
69
|
+
if (trigger === 'focus') return;
|
|
70
70
|
// no matter how the trigger is left, we should close the tooltip
|
|
71
71
|
isFocused.current = false;
|
|
72
72
|
isHovered.current = false;
|
|
@@ -102,7 +102,7 @@ function $f017bbc46d58d42a$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
102
102
|
}, ref);
|
|
103
103
|
return {
|
|
104
104
|
triggerProps: {
|
|
105
|
-
|
|
105
|
+
'aria-describedby': state.isOpen ? tooltipId : undefined,
|
|
106
106
|
...(0, $jCY2B$reactariautils.mergeProps)(focusableProps, hoverProps, {
|
|
107
107
|
onPointerDown: onPressStart,
|
|
108
108
|
onKeyDown: onPressStart
|
|
@@ -33,16 +33,16 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
33
33
|
if (ref && ref.current) // Escape after clicking something can give it keyboard focus
|
|
34
34
|
// dismiss tooltip on esc key press
|
|
35
35
|
{
|
|
36
|
-
if (e.key ===
|
|
36
|
+
if (e.key === 'Escape') {
|
|
37
37
|
e.stopPropagation();
|
|
38
38
|
state.close(true);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
if (state.isOpen) {
|
|
43
|
-
document.addEventListener(
|
|
43
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
44
44
|
return ()=>{
|
|
45
|
-
document.removeEventListener(
|
|
45
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
}, [
|
|
@@ -50,17 +50,17 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
50
50
|
state
|
|
51
51
|
]);
|
|
52
52
|
let onHoverStart = ()=>{
|
|
53
|
-
if (trigger ===
|
|
53
|
+
if (trigger === 'focus') return;
|
|
54
54
|
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard
|
|
55
55
|
// interactions for example, hover will end. When hover is restored after that element disappears,
|
|
56
56
|
// focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover
|
|
57
57
|
// is the result of moving the mouse.
|
|
58
|
-
if ((0, $6VwSn$getInteractionModality)() ===
|
|
58
|
+
if ((0, $6VwSn$getInteractionModality)() === 'pointer') isHovered.current = true;
|
|
59
59
|
else isHovered.current = false;
|
|
60
60
|
handleShow();
|
|
61
61
|
};
|
|
62
62
|
let onHoverEnd = ()=>{
|
|
63
|
-
if (trigger ===
|
|
63
|
+
if (trigger === 'focus') return;
|
|
64
64
|
// no matter how the trigger is left, we should close the tooltip
|
|
65
65
|
isFocused.current = false;
|
|
66
66
|
isHovered.current = false;
|
|
@@ -96,7 +96,7 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
96
96
|
}, ref);
|
|
97
97
|
return {
|
|
98
98
|
triggerProps: {
|
|
99
|
-
|
|
99
|
+
'aria-describedby': state.isOpen ? tooltipId : undefined,
|
|
100
100
|
...(0, $6VwSn$mergeProps)(focusableProps, hoverProps, {
|
|
101
101
|
onPointerDown: onPressStart,
|
|
102
102
|
onKeyDown: onPressStart
|
|
@@ -110,4 +110,4 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
export {$4e1b34546679e357$export$a6da6c504e4bba8b as useTooltipTrigger};
|
|
113
|
-
//# sourceMappingURL=useTooltipTrigger.
|
|
113
|
+
//# sourceMappingURL=useTooltipTrigger.module.js.map
|
|
@@ -33,16 +33,16 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
33
33
|
if (ref && ref.current) // Escape after clicking something can give it keyboard focus
|
|
34
34
|
// dismiss tooltip on esc key press
|
|
35
35
|
{
|
|
36
|
-
if (e.key ===
|
|
36
|
+
if (e.key === 'Escape') {
|
|
37
37
|
e.stopPropagation();
|
|
38
38
|
state.close(true);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
if (state.isOpen) {
|
|
43
|
-
document.addEventListener(
|
|
43
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
44
44
|
return ()=>{
|
|
45
|
-
document.removeEventListener(
|
|
45
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
}, [
|
|
@@ -50,17 +50,17 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
50
50
|
state
|
|
51
51
|
]);
|
|
52
52
|
let onHoverStart = ()=>{
|
|
53
|
-
if (trigger ===
|
|
53
|
+
if (trigger === 'focus') return;
|
|
54
54
|
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard
|
|
55
55
|
// interactions for example, hover will end. When hover is restored after that element disappears,
|
|
56
56
|
// focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover
|
|
57
57
|
// is the result of moving the mouse.
|
|
58
|
-
if ((0, $6VwSn$getInteractionModality)() ===
|
|
58
|
+
if ((0, $6VwSn$getInteractionModality)() === 'pointer') isHovered.current = true;
|
|
59
59
|
else isHovered.current = false;
|
|
60
60
|
handleShow();
|
|
61
61
|
};
|
|
62
62
|
let onHoverEnd = ()=>{
|
|
63
|
-
if (trigger ===
|
|
63
|
+
if (trigger === 'focus') return;
|
|
64
64
|
// no matter how the trigger is left, we should close the tooltip
|
|
65
65
|
isFocused.current = false;
|
|
66
66
|
isHovered.current = false;
|
|
@@ -96,7 +96,7 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
96
96
|
}, ref);
|
|
97
97
|
return {
|
|
98
98
|
triggerProps: {
|
|
99
|
-
|
|
99
|
+
'aria-describedby': state.isOpen ? tooltipId : undefined,
|
|
100
100
|
...(0, $6VwSn$mergeProps)(focusableProps, hoverProps, {
|
|
101
101
|
onPointerDown: onPressStart,
|
|
102
102
|
onKeyDown: onPressStart
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/tooltip",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/focus": "^3.17.
|
|
26
|
-
"@react-aria/interactions": "^3.21.
|
|
27
|
-
"@react-aria/utils": "^3.24.
|
|
28
|
-
"@react-stately/tooltip": "^3.4.
|
|
29
|
-
"@react-types/shared": "^3.23.
|
|
30
|
-
"@react-types/tooltip": "^3.4.
|
|
25
|
+
"@react-aria/focus": "^3.17.1",
|
|
26
|
+
"@react-aria/interactions": "^3.21.3",
|
|
27
|
+
"@react-aria/utils": "^3.24.1",
|
|
28
|
+
"@react-stately/tooltip": "^3.4.9",
|
|
29
|
+
"@react-types/shared": "^3.23.1",
|
|
30
|
+
"@react-types/tooltip": "^3.4.9",
|
|
31
31
|
"@swc/helpers": "^0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
40
40
|
}
|