@tamagui/tooltip 2.0.0-rc.3 → 2.0.0-rc.30
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/cjs/Tooltip.cjs +45 -47
- package/dist/cjs/TooltipSimple.cjs +3 -1
- package/dist/cjs/index.js +12 -9
- package/dist/esm/Tooltip.mjs +43 -46
- package/dist/esm/Tooltip.mjs.map +1 -1
- package/dist/esm/TooltipSimple.mjs +3 -1
- package/dist/esm/TooltipSimple.mjs.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/jsx/Tooltip.mjs +43 -46
- package/dist/jsx/Tooltip.mjs.map +1 -1
- package/dist/jsx/TooltipSimple.mjs +3 -1
- package/dist/jsx/TooltipSimple.mjs.map +1 -1
- package/dist/jsx/index.js +2 -2
- package/dist/jsx/index.js.map +1 -6
- package/package.json +18 -22
- package/src/Tooltip.tsx +57 -67
- package/src/TooltipSimple.tsx +4 -3
- package/types/Tooltip.d.ts +12 -5
- package/types/Tooltip.d.ts.map +1 -1
- package/types/TooltipSimple.d.ts.map +1 -1
- package/dist/cjs/Tooltip.js +0 -177
- package/dist/cjs/Tooltip.js.map +0 -6
- package/dist/cjs/TooltipSimple.js +0 -98
- package/dist/cjs/TooltipSimple.js.map +0 -6
- package/dist/esm/Tooltip.js +0 -179
- package/dist/esm/Tooltip.js.map +0 -6
- package/dist/esm/TooltipSimple.js +0 -78
- package/dist/esm/TooltipSimple.js.map +0 -6
- package/dist/jsx/Tooltip.js +0 -179
- package/dist/jsx/Tooltip.js.map +0 -6
- package/dist/jsx/TooltipSimple.js +0 -78
- package/dist/jsx/TooltipSimple.js.map +0 -6
package/dist/cjs/Tooltip.cjs
CHANGED
|
@@ -37,9 +37,9 @@ __export(Tooltip_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(Tooltip_exports);
|
|
39
39
|
var import_polyfill_dev = require("@tamagui/polyfill-dev"),
|
|
40
|
-
import_react = require("@floating-ui/react"),
|
|
41
|
-
import_core = require("@tamagui/core"),
|
|
42
40
|
import_floating = require("@tamagui/floating"),
|
|
41
|
+
import_core = require("@tamagui/core"),
|
|
42
|
+
import_floating2 = require("@tamagui/floating"),
|
|
43
43
|
import_get_token = require("@tamagui/get-token"),
|
|
44
44
|
import_helpers = require("@tamagui/helpers"),
|
|
45
45
|
import_popover = require("@tamagui/popover"),
|
|
@@ -48,15 +48,28 @@ var import_polyfill_dev = require("@tamagui/polyfill-dev"),
|
|
|
48
48
|
React = __toESM(require("react"), 1),
|
|
49
49
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
50
50
|
const TOOLTIP_SCOPE = "",
|
|
51
|
+
ALWAYS_DISABLE_TOOLTIP = {
|
|
52
|
+
focus: !0,
|
|
53
|
+
"remove-scroll": !0
|
|
54
|
+
// it's nice to hit escape to hide a tooltip
|
|
55
|
+
// dismiss: true
|
|
56
|
+
},
|
|
51
57
|
TooltipContent = import_popper.PopperContentFrame.styleable((props, ref) => {
|
|
52
|
-
const preventAnimation = React.useContext(PreventTooltipAnimationContext)
|
|
58
|
+
const preventAnimation = React.useContext(PreventTooltipAnimationContext),
|
|
59
|
+
zIndexFromContext = React.useContext(TooltipZIndexContext);
|
|
53
60
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverContent, {
|
|
54
61
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
55
|
-
|
|
62
|
+
alwaysDisable: ALWAYS_DISABLE_TOOLTIP,
|
|
56
63
|
...(!props.unstyled && {
|
|
57
|
-
|
|
64
|
+
backgroundColor: "$background",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
size: "$true"
|
|
58
68
|
}),
|
|
59
69
|
ref,
|
|
70
|
+
...(zIndexFromContext !== void 0 && {
|
|
71
|
+
zIndex: zIndexFromContext
|
|
72
|
+
}),
|
|
60
73
|
...props,
|
|
61
74
|
...(preventAnimation && {
|
|
62
75
|
transition: null
|
|
@@ -74,6 +87,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
74
87
|
...props
|
|
75
88
|
})),
|
|
76
89
|
PreventTooltipAnimationContext = React.createContext(!1),
|
|
90
|
+
TooltipZIndexContext = React.createContext(void 0),
|
|
77
91
|
TooltipGroup = ({
|
|
78
92
|
children,
|
|
79
93
|
delay,
|
|
@@ -81,7 +95,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
81
95
|
timeoutMs
|
|
82
96
|
}) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(PreventTooltipAnimationContext.Provider, {
|
|
83
97
|
value: preventAnimation,
|
|
84
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
98
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating.FloatingDelayGroup, {
|
|
85
99
|
timeoutMs,
|
|
86
100
|
delay: React.useMemo(() => delay, [JSON.stringify(delay)]),
|
|
87
101
|
children
|
|
@@ -92,6 +106,8 @@ const TOOLTIP_SCOPE = "",
|
|
|
92
106
|
setOpens.forEach(x => x(!1));
|
|
93
107
|
},
|
|
94
108
|
TooltipComponent = React.forwardRef(function (props, ref) {
|
|
109
|
+
"use no memo";
|
|
110
|
+
|
|
95
111
|
const {
|
|
96
112
|
children,
|
|
97
113
|
delay: delayProp,
|
|
@@ -100,6 +116,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
100
116
|
focus,
|
|
101
117
|
open: openProp,
|
|
102
118
|
disableAutoCloseOnScroll,
|
|
119
|
+
zIndex,
|
|
103
120
|
scope = TOOLTIP_SCOPE,
|
|
104
121
|
...restProps
|
|
105
122
|
} = props,
|
|
@@ -108,7 +125,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
108
125
|
{
|
|
109
126
|
delay: delayGroup,
|
|
110
127
|
setCurrentId
|
|
111
|
-
} = (0,
|
|
128
|
+
} = (0, import_floating.useDelayGroupContext)(),
|
|
112
129
|
delay = delayProp !== void 0 ? delayProp : delayGroup ?? 400,
|
|
113
130
|
restMs = restMsProp ?? (typeof delay == "number" ? delay : 0),
|
|
114
131
|
[open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
@@ -129,48 +146,27 @@ const TOOLTIP_SCOPE = "",
|
|
|
129
146
|
setOpens.delete(setOpen), document.documentElement.removeEventListener("scroll", closeIt);
|
|
130
147
|
};
|
|
131
148
|
}, [open, disableAutoCloseOnScroll]);
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
delayOut = currentId != null && typeof delayContext == "object" ? delayContext : delay,
|
|
145
|
-
{
|
|
146
|
-
getReferenceProps,
|
|
147
|
-
getFloatingProps
|
|
148
|
-
} = (0, import_react.useInteractions)([(0, import_react.useHover)(floating.context, {
|
|
149
|
-
delay: delayOut,
|
|
150
|
-
restMs
|
|
151
|
-
}), (0, import_react.useFocus)(floating.context, focus), (0, import_react.useRole)(floating.context, {
|
|
152
|
-
role: "tooltip"
|
|
153
|
-
}), (0, import_react.useDismiss)(floating.context)]);
|
|
154
|
-
return {
|
|
155
|
-
...floating,
|
|
156
|
-
open,
|
|
157
|
-
getReferenceProps,
|
|
158
|
-
getFloatingProps
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
useFloatingContext = React.useCallback(useFloatingFn, [id, delay, open, restMs, focus ? JSON.stringify(focus) : 0]),
|
|
149
|
+
const floatingContext = (0, import_popover.useFloatingContext)({
|
|
150
|
+
open,
|
|
151
|
+
setOpen: onOpenChange,
|
|
152
|
+
disable: !1,
|
|
153
|
+
disableFocus: !1,
|
|
154
|
+
hoverable: !0,
|
|
155
|
+
role: "tooltip",
|
|
156
|
+
focus,
|
|
157
|
+
groupId: id,
|
|
158
|
+
delay,
|
|
159
|
+
restMs
|
|
160
|
+
}),
|
|
162
161
|
onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(!0), []),
|
|
163
162
|
onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(!1), []),
|
|
164
163
|
contentId = React.useId(),
|
|
165
164
|
smallerSize = props.unstyled ? null : (0, import_get_token.getSize)("$true", {
|
|
166
165
|
shift: -2,
|
|
167
166
|
bounds: [0]
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
(0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {
|
|
173
|
-
value: useFloatingContext,
|
|
167
|
+
}),
|
|
168
|
+
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating2.FloatingOverrideContext.Provider, {
|
|
169
|
+
value: floatingContext,
|
|
174
170
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.Popper, {
|
|
175
171
|
scope,
|
|
176
172
|
size: smallerSize?.key,
|
|
@@ -178,8 +174,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
178
174
|
stayInFrame: !0,
|
|
179
175
|
open,
|
|
180
176
|
...restProps,
|
|
181
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.
|
|
182
|
-
popoverScope: scope,
|
|
177
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverContextProvider, {
|
|
183
178
|
scope,
|
|
184
179
|
contentId,
|
|
185
180
|
triggerRef,
|
|
@@ -192,8 +187,11 @@ const TOOLTIP_SCOPE = "",
|
|
|
192
187
|
children
|
|
193
188
|
})
|
|
194
189
|
})
|
|
195
|
-
})
|
|
196
|
-
)
|
|
190
|
+
});
|
|
191
|
+
return zIndex !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(TooltipZIndexContext.Provider, {
|
|
192
|
+
value: zIndex,
|
|
193
|
+
children: content
|
|
194
|
+
}) : content;
|
|
197
195
|
}),
|
|
198
196
|
TooltipTrigger = React.forwardRef(function (props, ref) {
|
|
199
197
|
const {
|
|
@@ -46,12 +46,15 @@ const TooltipSimple = React.forwardRef(({
|
|
|
46
46
|
disabled,
|
|
47
47
|
...tooltipProps
|
|
48
48
|
}, ref) => {
|
|
49
|
+
"use no memo";
|
|
50
|
+
|
|
49
51
|
const child = React.Children.only(children);
|
|
50
52
|
return label ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Tooltip.Tooltip, {
|
|
51
53
|
disableRTL: !0,
|
|
52
54
|
offset: 15,
|
|
53
55
|
restMs: 40,
|
|
54
56
|
delay: 40,
|
|
57
|
+
zIndex: 1e6,
|
|
55
58
|
...tooltipProps,
|
|
56
59
|
...(disabled ? {
|
|
57
60
|
open: !1
|
|
@@ -65,7 +68,6 @@ const TooltipSimple = React.forwardRef(({
|
|
|
65
68
|
ref
|
|
66
69
|
}) : child
|
|
67
70
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Tooltip.Tooltip.Content, {
|
|
68
|
-
zIndex: 1e9,
|
|
69
71
|
enterStyle: {
|
|
70
72
|
y: -4,
|
|
71
73
|
opacity: 0,
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,14 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
12
16
|
var index_exports = {};
|
|
13
17
|
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./Tooltip"), module.exports);
|
|
15
|
-
__reExport(index_exports, require("./TooltipSimple"), module.exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
__reExport(index_exports, require("./Tooltip.cjs"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./TooltipSimple.cjs"), module.exports);
|
package/dist/esm/Tooltip.mjs
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import "@tamagui/
|
|
2
|
-
import { FloatingDelayGroup, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole } from "@floating-ui/react";
|
|
1
|
+
import { FloatingDelayGroup, useDelayGroupContext } from "@tamagui/floating";
|
|
3
2
|
import { useEvent } from "@tamagui/core";
|
|
4
3
|
import { FloatingOverrideContext } from "@tamagui/floating";
|
|
5
4
|
import { getSize } from "@tamagui/get-token";
|
|
6
5
|
import { withStaticProperties } from "@tamagui/helpers";
|
|
7
|
-
import { PopoverAnchor, PopoverArrow, PopoverContent,
|
|
6
|
+
import { PopoverAnchor, PopoverArrow, PopoverContent, PopoverContextProvider, PopoverTrigger, useFloatingContext } from "@tamagui/popover";
|
|
8
7
|
import { Popper, PopperContentFrame } from "@tamagui/popper";
|
|
9
8
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
10
9
|
import * as React from "react";
|
|
11
10
|
import { jsx } from "react/jsx-runtime";
|
|
12
11
|
const TOOLTIP_SCOPE = "",
|
|
12
|
+
ALWAYS_DISABLE_TOOLTIP = {
|
|
13
|
+
focus: !0,
|
|
14
|
+
"remove-scroll": !0
|
|
15
|
+
// it's nice to hit escape to hide a tooltip
|
|
16
|
+
// dismiss: true
|
|
17
|
+
},
|
|
13
18
|
TooltipContent = PopperContentFrame.styleable((props, ref) => {
|
|
14
|
-
const preventAnimation = React.useContext(PreventTooltipAnimationContext)
|
|
19
|
+
const preventAnimation = React.useContext(PreventTooltipAnimationContext),
|
|
20
|
+
zIndexFromContext = React.useContext(TooltipZIndexContext);
|
|
15
21
|
return /* @__PURE__ */jsx(PopoverContent, {
|
|
16
22
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
17
|
-
|
|
23
|
+
alwaysDisable: ALWAYS_DISABLE_TOOLTIP,
|
|
18
24
|
...(!props.unstyled && {
|
|
19
|
-
|
|
25
|
+
backgroundColor: "$background",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
pointerEvents: "none",
|
|
28
|
+
size: "$true"
|
|
20
29
|
}),
|
|
21
30
|
ref,
|
|
31
|
+
...(zIndexFromContext !== void 0 && {
|
|
32
|
+
zIndex: zIndexFromContext
|
|
33
|
+
}),
|
|
22
34
|
...props,
|
|
23
35
|
...(preventAnimation && {
|
|
24
36
|
transition: null
|
|
@@ -36,6 +48,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
36
48
|
...props
|
|
37
49
|
})),
|
|
38
50
|
PreventTooltipAnimationContext = React.createContext(!1),
|
|
51
|
+
TooltipZIndexContext = React.createContext(void 0),
|
|
39
52
|
TooltipGroup = ({
|
|
40
53
|
children,
|
|
41
54
|
delay,
|
|
@@ -54,6 +67,8 @@ const TOOLTIP_SCOPE = "",
|
|
|
54
67
|
setOpens.forEach(x => x(!1));
|
|
55
68
|
},
|
|
56
69
|
TooltipComponent = React.forwardRef(function (props, ref) {
|
|
70
|
+
"use no memo";
|
|
71
|
+
|
|
57
72
|
const {
|
|
58
73
|
children,
|
|
59
74
|
delay: delayProp,
|
|
@@ -62,6 +77,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
62
77
|
focus,
|
|
63
78
|
open: openProp,
|
|
64
79
|
disableAutoCloseOnScroll,
|
|
80
|
+
zIndex,
|
|
65
81
|
scope = TOOLTIP_SCOPE,
|
|
66
82
|
...restProps
|
|
67
83
|
} = props,
|
|
@@ -91,48 +107,27 @@ const TOOLTIP_SCOPE = "",
|
|
|
91
107
|
setOpens.delete(setOpen), document.documentElement.removeEventListener("scroll", closeIt);
|
|
92
108
|
};
|
|
93
109
|
}, [open, disableAutoCloseOnScroll]);
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
delayOut = currentId != null && typeof delayContext == "object" ? delayContext : delay,
|
|
107
|
-
{
|
|
108
|
-
getReferenceProps,
|
|
109
|
-
getFloatingProps
|
|
110
|
-
} = useInteractions([useHover(floating.context, {
|
|
111
|
-
delay: delayOut,
|
|
112
|
-
restMs
|
|
113
|
-
}), useFocus(floating.context, focus), useRole(floating.context, {
|
|
114
|
-
role: "tooltip"
|
|
115
|
-
}), useDismiss(floating.context)]);
|
|
116
|
-
return {
|
|
117
|
-
...floating,
|
|
118
|
-
open,
|
|
119
|
-
getReferenceProps,
|
|
120
|
-
getFloatingProps
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
useFloatingContext = React.useCallback(useFloatingFn, [id, delay, open, restMs, focus ? JSON.stringify(focus) : 0]),
|
|
110
|
+
const floatingContext = useFloatingContext({
|
|
111
|
+
open,
|
|
112
|
+
setOpen: onOpenChange,
|
|
113
|
+
disable: !1,
|
|
114
|
+
disableFocus: !1,
|
|
115
|
+
hoverable: !0,
|
|
116
|
+
role: "tooltip",
|
|
117
|
+
focus,
|
|
118
|
+
groupId: id,
|
|
119
|
+
delay,
|
|
120
|
+
restMs
|
|
121
|
+
}),
|
|
124
122
|
onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(!0), []),
|
|
125
123
|
onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(!1), []),
|
|
126
124
|
contentId = React.useId(),
|
|
127
125
|
smallerSize = props.unstyled ? null : getSize("$true", {
|
|
128
126
|
shift: -2,
|
|
129
127
|
bounds: [0]
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
jsx(FloatingOverrideContext.Provider, {
|
|
135
|
-
value: useFloatingContext,
|
|
128
|
+
}),
|
|
129
|
+
content = /* @__PURE__ */jsx(FloatingOverrideContext.Provider, {
|
|
130
|
+
value: floatingContext,
|
|
136
131
|
children: /* @__PURE__ */jsx(Popper, {
|
|
137
132
|
scope,
|
|
138
133
|
size: smallerSize?.key,
|
|
@@ -140,8 +135,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
140
135
|
stayInFrame: !0,
|
|
141
136
|
open,
|
|
142
137
|
...restProps,
|
|
143
|
-
children: /* @__PURE__ */jsx(
|
|
144
|
-
popoverScope: scope,
|
|
138
|
+
children: /* @__PURE__ */jsx(PopoverContextProvider, {
|
|
145
139
|
scope,
|
|
146
140
|
contentId,
|
|
147
141
|
triggerRef,
|
|
@@ -154,8 +148,11 @@ const TOOLTIP_SCOPE = "",
|
|
|
154
148
|
children
|
|
155
149
|
})
|
|
156
150
|
})
|
|
157
|
-
})
|
|
158
|
-
|
|
151
|
+
});
|
|
152
|
+
return zIndex !== void 0 ? /* @__PURE__ */jsx(TooltipZIndexContext.Provider, {
|
|
153
|
+
value: zIndex,
|
|
154
|
+
children: content
|
|
155
|
+
}) : content;
|
|
159
156
|
}),
|
|
160
157
|
TooltipTrigger = React.forwardRef(function (props, ref) {
|
|
161
158
|
const {
|
package/dist/esm/Tooltip.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FloatingDelayGroup","
|
|
1
|
+
{"version":3,"names":["FloatingDelayGroup","useDelayGroupContext","useEvent","FloatingOverrideContext","getSize","withStaticProperties","PopoverAnchor","PopoverArrow","PopoverContent","PopoverContextProvider","PopoverTrigger","useFloatingContext","Popper","PopperContentFrame","useControllableState","React","jsx","TOOLTIP_SCOPE","ALWAYS_DISABLE_TOOLTIP","focus","TooltipContent","styleable","props","ref","preventAnimation","useContext","PreventTooltipAnimationContext","zIndexFromContext","TooltipZIndexContext","scope","alwaysDisable","unstyled","backgroundColor","alignItems","pointerEvents","size","zIndex","transition","staticConfig","componentName","TooltipArrow","forwardRef","createContext","TooltipGroup","children","delay","timeoutMs","Provider","value","useMemo","JSON","stringify","setOpens","Set","closeOpenTooltips","forEach","x","TooltipComponent","delayProp","restMs","restMsProp","onOpenChange","onOpenChangeProp","open","openProp","disableAutoCloseOnScroll","restProps","triggerRef","useRef","hasCustomAnchor","setHasCustomAnchor","useState","delayGroup","setCurrentId","setOpen","prop","defaultProp","onChange","id","groupId","open2","useEffect","document","closeIt","add","documentElement","addEventListener","delete","removeEventListener","floatingContext","disable","disableFocus","hoverable","role","onCustomAnchorAdd","useCallback","onCustomAnchorRemove","contentId","useId","smallerSize","shift","bounds","content","key","allowFlip","stayInFrame","onOpenToggle","voidFn","TooltipTrigger","rest","TooltipAnchor","Tooltip2","Anchor","Arrow","Content","Trigger"],"sources":["../../src/Tooltip.tsx"],"sourcesContent":[null],"mappings":"AAEA,SAASA,kBAAA,EAAoBC,oBAAA,QAAwC;AAErE,SAASC,QAAA,QAAgB;AACzB,SAASC,uBAAA,QAA+B;AACxC,SAASC,OAAA,QAAe;AACxB,SAASC,oBAAA,QAA4B;AAMrC,SACEC,aAAA,EACAC,YAAA,EACAC,cAAA,EACAC,sBAAA,EACAC,cAAA,EACAC,kBAAA,QACK;AAEP,SAASC,MAAA,EAAQC,kBAAA,QAA0B;AAC3C,SAASC,oBAAA,QAA4B;AACrC,YAAYC,KAAA,MAAW;AA0BjB,SAAAC,GAAA;AAxBN,MAAMC,aAAA,GAAgB;EAWhBC,sBAAA,GAAyB;IAC7BC,KAAA,EAAO;IACP,iBAAiB;IAAA;IAAA;EAGnB;EAEMC,cAAA,GAAiBP,kBAAA,CAAmBQ,SAAA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}
|
|
@@ -10,12 +10,15 @@ const TooltipSimple = React.forwardRef(({
|
|
|
10
10
|
disabled,
|
|
11
11
|
...tooltipProps
|
|
12
12
|
}, ref) => {
|
|
13
|
+
"use no memo";
|
|
14
|
+
|
|
13
15
|
const child = React.Children.only(children);
|
|
14
16
|
return label ? /* @__PURE__ */jsxs(Tooltip, {
|
|
15
17
|
disableRTL: !0,
|
|
16
18
|
offset: 15,
|
|
17
19
|
restMs: 40,
|
|
18
20
|
delay: 40,
|
|
21
|
+
zIndex: 1e6,
|
|
19
22
|
...tooltipProps,
|
|
20
23
|
...(disabled ? {
|
|
21
24
|
open: !1
|
|
@@ -29,7 +32,6 @@ const TooltipSimple = React.forwardRef(({
|
|
|
29
32
|
ref
|
|
30
33
|
}) : child
|
|
31
34
|
}), /* @__PURE__ */jsxs(Tooltip.Content, {
|
|
32
|
-
zIndex: 1e9,
|
|
33
35
|
enterStyle: {
|
|
34
36
|
y: -4,
|
|
35
37
|
opacity: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getSpace","Paragraph","React","Tooltip","jsx","jsxs","TooltipSimple","forwardRef","label","children","contentProps","disabled","tooltipProps","ref","child","Children","only","disableRTL","offset","restMs","delay","open","Trigger","asChild","isValidElement","cloneElement","Content","
|
|
1
|
+
{"version":3,"names":["getSpace","Paragraph","React","Tooltip","jsx","jsxs","TooltipSimple","forwardRef","label","children","contentProps","disabled","tooltipProps","ref","child","Children","only","disableRTL","offset","restMs","delay","zIndex","open","Trigger","asChild","isValidElement","cloneElement","Content","enterStyle","y","opacity","scale","exitStyle","elevation","pointerEvents","paddingVertical","size","shift","animateOnly","transition","overshootClamping","Arrow","maxWidth","overflow","textAlign","textWrap"],"sources":["../../src/TooltipSimple.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AAEzB,SAASC,SAAA,QAAiB;AAC1B,YAAYC,KAAA,MAAW;AAGvB,SAASC,OAAA,QAAe;AA8BhB,SAAAC,G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,EAAS;UACPU,iBAAA,EAAmB;QACrB;MACF,EACF;MACC,GAAG9B,YAAA;MAEJD,QAAA,kBAAAL,GAAA,CAACD,OAAA,CAAQsC,KAAA,EAAR,EAAc,GACf,eAAArC,GAAA,CAACH,SAAA;QACCyC,QAAA,EAAU;QACVC,QAAA,EAAS;QACTP,IAAA,EAAK;QACLQ,SAAA,EAAU;QACV,iBAAe;UACbC,QAAA,EAAU;QACZ;QAECpC,QAAA,EAAAD;MAAA,CACH;IAAA,CACF;EAAA,CACF,IA3DOC,QAAA;AA6DX,CACF","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Tooltip";
|
|
2
|
-
export * from "./TooltipSimple";
|
|
1
|
+
export * from "./Tooltip.mjs";
|
|
2
|
+
export * from "./TooltipSimple.mjs";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/jsx/Tooltip.mjs
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import "@tamagui/
|
|
2
|
-
import { FloatingDelayGroup, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole } from "@floating-ui/react";
|
|
1
|
+
import { FloatingDelayGroup, useDelayGroupContext } from "@tamagui/floating";
|
|
3
2
|
import { useEvent } from "@tamagui/core";
|
|
4
3
|
import { FloatingOverrideContext } from "@tamagui/floating";
|
|
5
4
|
import { getSize } from "@tamagui/get-token";
|
|
6
5
|
import { withStaticProperties } from "@tamagui/helpers";
|
|
7
|
-
import { PopoverAnchor, PopoverArrow, PopoverContent,
|
|
6
|
+
import { PopoverAnchor, PopoverArrow, PopoverContent, PopoverContextProvider, PopoverTrigger, useFloatingContext } from "@tamagui/popover";
|
|
8
7
|
import { Popper, PopperContentFrame } from "@tamagui/popper";
|
|
9
8
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
10
9
|
import * as React from "react";
|
|
11
10
|
import { jsx } from "react/jsx-runtime";
|
|
12
11
|
const TOOLTIP_SCOPE = "",
|
|
12
|
+
ALWAYS_DISABLE_TOOLTIP = {
|
|
13
|
+
focus: !0,
|
|
14
|
+
"remove-scroll": !0
|
|
15
|
+
// it's nice to hit escape to hide a tooltip
|
|
16
|
+
// dismiss: true
|
|
17
|
+
},
|
|
13
18
|
TooltipContent = PopperContentFrame.styleable((props, ref) => {
|
|
14
|
-
const preventAnimation = React.useContext(PreventTooltipAnimationContext)
|
|
19
|
+
const preventAnimation = React.useContext(PreventTooltipAnimationContext),
|
|
20
|
+
zIndexFromContext = React.useContext(TooltipZIndexContext);
|
|
15
21
|
return /* @__PURE__ */jsx(PopoverContent, {
|
|
16
22
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
17
|
-
|
|
23
|
+
alwaysDisable: ALWAYS_DISABLE_TOOLTIP,
|
|
18
24
|
...(!props.unstyled && {
|
|
19
|
-
|
|
25
|
+
backgroundColor: "$background",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
pointerEvents: "none",
|
|
28
|
+
size: "$true"
|
|
20
29
|
}),
|
|
21
30
|
ref,
|
|
31
|
+
...(zIndexFromContext !== void 0 && {
|
|
32
|
+
zIndex: zIndexFromContext
|
|
33
|
+
}),
|
|
22
34
|
...props,
|
|
23
35
|
...(preventAnimation && {
|
|
24
36
|
transition: null
|
|
@@ -36,6 +48,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
36
48
|
...props
|
|
37
49
|
})),
|
|
38
50
|
PreventTooltipAnimationContext = React.createContext(!1),
|
|
51
|
+
TooltipZIndexContext = React.createContext(void 0),
|
|
39
52
|
TooltipGroup = ({
|
|
40
53
|
children,
|
|
41
54
|
delay,
|
|
@@ -54,6 +67,8 @@ const TOOLTIP_SCOPE = "",
|
|
|
54
67
|
setOpens.forEach(x => x(!1));
|
|
55
68
|
},
|
|
56
69
|
TooltipComponent = React.forwardRef(function (props, ref) {
|
|
70
|
+
"use no memo";
|
|
71
|
+
|
|
57
72
|
const {
|
|
58
73
|
children,
|
|
59
74
|
delay: delayProp,
|
|
@@ -62,6 +77,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
62
77
|
focus,
|
|
63
78
|
open: openProp,
|
|
64
79
|
disableAutoCloseOnScroll,
|
|
80
|
+
zIndex,
|
|
65
81
|
scope = TOOLTIP_SCOPE,
|
|
66
82
|
...restProps
|
|
67
83
|
} = props,
|
|
@@ -91,48 +107,27 @@ const TOOLTIP_SCOPE = "",
|
|
|
91
107
|
setOpens.delete(setOpen), document.documentElement.removeEventListener("scroll", closeIt);
|
|
92
108
|
};
|
|
93
109
|
}, [open, disableAutoCloseOnScroll]);
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
delayOut = currentId != null && typeof delayContext == "object" ? delayContext : delay,
|
|
107
|
-
{
|
|
108
|
-
getReferenceProps,
|
|
109
|
-
getFloatingProps
|
|
110
|
-
} = useInteractions([useHover(floating.context, {
|
|
111
|
-
delay: delayOut,
|
|
112
|
-
restMs
|
|
113
|
-
}), useFocus(floating.context, focus), useRole(floating.context, {
|
|
114
|
-
role: "tooltip"
|
|
115
|
-
}), useDismiss(floating.context)]);
|
|
116
|
-
return {
|
|
117
|
-
...floating,
|
|
118
|
-
open,
|
|
119
|
-
getReferenceProps,
|
|
120
|
-
getFloatingProps
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
useFloatingContext = React.useCallback(useFloatingFn, [id, delay, open, restMs, focus ? JSON.stringify(focus) : 0]),
|
|
110
|
+
const floatingContext = useFloatingContext({
|
|
111
|
+
open,
|
|
112
|
+
setOpen: onOpenChange,
|
|
113
|
+
disable: !1,
|
|
114
|
+
disableFocus: !1,
|
|
115
|
+
hoverable: !0,
|
|
116
|
+
role: "tooltip",
|
|
117
|
+
focus,
|
|
118
|
+
groupId: id,
|
|
119
|
+
delay,
|
|
120
|
+
restMs
|
|
121
|
+
}),
|
|
124
122
|
onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(!0), []),
|
|
125
123
|
onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(!1), []),
|
|
126
124
|
contentId = React.useId(),
|
|
127
125
|
smallerSize = props.unstyled ? null : getSize("$true", {
|
|
128
126
|
shift: -2,
|
|
129
127
|
bounds: [0]
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
jsx(FloatingOverrideContext.Provider, {
|
|
135
|
-
value: useFloatingContext,
|
|
128
|
+
}),
|
|
129
|
+
content = /* @__PURE__ */jsx(FloatingOverrideContext.Provider, {
|
|
130
|
+
value: floatingContext,
|
|
136
131
|
children: /* @__PURE__ */jsx(Popper, {
|
|
137
132
|
scope,
|
|
138
133
|
size: smallerSize?.key,
|
|
@@ -140,8 +135,7 @@ const TOOLTIP_SCOPE = "",
|
|
|
140
135
|
stayInFrame: !0,
|
|
141
136
|
open,
|
|
142
137
|
...restProps,
|
|
143
|
-
children: /* @__PURE__ */jsx(
|
|
144
|
-
popoverScope: scope,
|
|
138
|
+
children: /* @__PURE__ */jsx(PopoverContextProvider, {
|
|
145
139
|
scope,
|
|
146
140
|
contentId,
|
|
147
141
|
triggerRef,
|
|
@@ -154,8 +148,11 @@ const TOOLTIP_SCOPE = "",
|
|
|
154
148
|
children
|
|
155
149
|
})
|
|
156
150
|
})
|
|
157
|
-
})
|
|
158
|
-
|
|
151
|
+
});
|
|
152
|
+
return zIndex !== void 0 ? /* @__PURE__ */jsx(TooltipZIndexContext.Provider, {
|
|
153
|
+
value: zIndex,
|
|
154
|
+
children: content
|
|
155
|
+
}) : content;
|
|
159
156
|
}),
|
|
160
157
|
TooltipTrigger = React.forwardRef(function (props, ref) {
|
|
161
158
|
const {
|