@tamagui/tooltip 2.7.7 → 3.0.0-beta.637.1
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 +161 -202
- package/dist/cjs/Tooltip.native.cjs +48 -0
- package/dist/cjs/Tooltip.native.js +29 -29
- package/dist/cjs/Tooltip.native.js.map +1 -1
- package/dist/cjs/TooltipSimple.cjs +64 -94
- package/dist/cjs/TooltipSimple.native.cjs +30 -0
- package/dist/cjs/TooltipSimple.native.js +17 -19
- package/dist/cjs/TooltipSimple.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Tooltip.mjs +144 -179
- package/dist/esm/Tooltip.mjs.map +1 -1
- package/dist/esm/Tooltip.native.js +14 -12
- package/dist/esm/Tooltip.native.js.map +1 -1
- package/dist/esm/TooltipSimple.mjs +48 -68
- package/dist/esm/TooltipSimple.mjs.map +1 -1
- package/dist/esm/TooltipSimple.native.js +3 -2
- package/dist/esm/TooltipSimple.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/index.native.js +3 -3
- package/dist/jsx/Tooltip.mjs +144 -179
- package/dist/jsx/Tooltip.mjs.map +1 -1
- package/dist/jsx/Tooltip.native.cjs +48 -0
- package/dist/jsx/Tooltip.native.js +29 -29
- package/dist/jsx/Tooltip.native.js.map +1 -1
- package/dist/jsx/TooltipSimple.mjs +48 -68
- package/dist/jsx/TooltipSimple.mjs.map +1 -1
- package/dist/jsx/TooltipSimple.native.cjs +30 -0
- package/dist/jsx/TooltipSimple.native.js +17 -19
- package/dist/jsx/TooltipSimple.native.js.map +1 -1
- package/dist/jsx/index.js +3 -3
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +15 -15
- package/src/Tooltip.tsx +45 -39
- package/src/TooltipSimple.tsx +27 -26
- package/types/Tooltip.d.ts +15 -27
- package/types/Tooltip.d.ts.map +1 -1
- package/types/Tooltip.native.d.ts +9 -6
- package/types/Tooltip.native.d.ts.map +1 -1
- package/types/TooltipSimple.d.ts +2 -2
- package/types/TooltipSimple.d.ts.map +1 -1
- package/types/TooltipSimple.native.d.ts +3 -1
- package/types/TooltipSimple.native.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Tooltip.mjs"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Tooltip.mjs"
|
|
2
|
+
|
|
3
|
+
export * from "./TooltipSimple.mjs"
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Tooltip.mjs"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Tooltip.mjs"
|
|
2
|
+
|
|
3
|
+
export * from "./TooltipSimple.mjs"
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Tooltip.native.js"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Tooltip.native.js"
|
|
2
|
+
|
|
3
|
+
export * from "./TooltipSimple.native.js"
|
package/dist/jsx/Tooltip.mjs
CHANGED
|
@@ -1,202 +1,167 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getSize } from "@tamagui/get-token";
|
|
1
|
+
import { createRefComponent, createStyledHOC, defaultTokenSizePolicy, styled, useEvent } from "@tamagui/core";
|
|
2
|
+
import { FloatingDelayGroup, FloatingOverrideContext, useDelayGroupContext } from "@tamagui/floating";
|
|
3
|
+
import { oneSizeTokenSmaller } from "@tamagui/get-token";
|
|
5
4
|
import { withStaticProperties } from "@tamagui/helpers";
|
|
6
5
|
import { PopoverAnchor, PopoverArrow, PopoverContent, PopoverContextProvider, PopoverTrigger, useFloatingContext } from "@tamagui/popover";
|
|
7
6
|
import { Popper, PopperContentFrame } from "@tamagui/popper";
|
|
7
|
+
import { getElevation } from "@tamagui/stacks";
|
|
8
8
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
|
|
11
12
|
const TOOLTIP_SCOPE = "";
|
|
13
|
+
const TooltipContentFrame = styled(PopperContentFrame, { variants: { elevation: {
|
|
14
|
+
number: getElevation,
|
|
15
|
+
Size: getElevation
|
|
16
|
+
} } });
|
|
12
17
|
const ALWAYS_DISABLE_TOOLTIP = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// it's nice to hit escape to hide a tooltip
|
|
16
|
-
// dismiss: true
|
|
18
|
+
focus: true,
|
|
19
|
+
"remove-scroll": true
|
|
17
20
|
};
|
|
18
|
-
const TooltipContent =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
componentName: "Tooltip"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
45
|
-
return /* @__PURE__ */jsx(PopoverArrow, {
|
|
46
|
-
scope: props.scope || TOOLTIP_SCOPE,
|
|
47
|
-
componentName: "Tooltip",
|
|
48
|
-
ref,
|
|
49
|
-
...props
|
|
50
|
-
});
|
|
21
|
+
const TooltipContent = createStyledHOC(TooltipContentFrame, (props, ref) => {
|
|
22
|
+
const preventAnimation = React.useContext(PreventTooltipAnimationContext);
|
|
23
|
+
const zIndexFromContext = React.useContext(TooltipZIndexContext);
|
|
24
|
+
return /* @__PURE__ */ jsx(PopoverContent, {
|
|
25
|
+
scope: props.scope || TOOLTIP_SCOPE,
|
|
26
|
+
alwaysDisable: ALWAYS_DISABLE_TOOLTIP,
|
|
27
|
+
backgroundColor: "background",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
pointerEvents: "none",
|
|
30
|
+
...zIndexFromContext !== void 0 && { zIndex: zIndexFromContext },
|
|
31
|
+
...props,
|
|
32
|
+
...preventAnimation && { transition: null },
|
|
33
|
+
ref
|
|
34
|
+
});
|
|
35
|
+
}, { displayName: "Tooltip" });
|
|
36
|
+
const TooltipArrow = createRefComponent((props, ref) => {
|
|
37
|
+
const { className, ...rest } = props;
|
|
38
|
+
return /* @__PURE__ */ jsx(PopoverArrow, {
|
|
39
|
+
scope: props.scope || TOOLTIP_SCOPE,
|
|
40
|
+
className: `is_Tooltip ${className || ""}`.trim(),
|
|
41
|
+
ref,
|
|
42
|
+
...rest
|
|
43
|
+
});
|
|
51
44
|
});
|
|
52
45
|
const PreventTooltipAnimationContext = React.createContext(false);
|
|
53
46
|
const TooltipZIndexContext = React.createContext(void 0);
|
|
54
|
-
const TooltipGroup = ({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
timeoutMs,
|
|
64
|
-
delay: React.useMemo(() => delay, [JSON.stringify(delay)]),
|
|
65
|
-
children
|
|
66
|
-
})
|
|
67
|
-
});
|
|
47
|
+
const TooltipGroup = ({ children, delay, preventAnimation = false, timeoutMs }) => {
|
|
48
|
+
return /* @__PURE__ */ jsx(PreventTooltipAnimationContext.Provider, {
|
|
49
|
+
value: preventAnimation,
|
|
50
|
+
children: /* @__PURE__ */ jsx(FloatingDelayGroup, {
|
|
51
|
+
timeoutMs,
|
|
52
|
+
delay: React.useMemo(() => delay, [JSON.stringify(delay)]),
|
|
53
|
+
children
|
|
54
|
+
})
|
|
55
|
+
});
|
|
68
56
|
};
|
|
69
|
-
const setOpens = /* @__PURE__ */new Set();
|
|
57
|
+
const setOpens = /* @__PURE__ */ new Set();
|
|
70
58
|
const closeOpenTooltips = () => {
|
|
71
|
-
|
|
59
|
+
setOpens.forEach((x) => x(false));
|
|
72
60
|
};
|
|
73
|
-
const TooltipComponent =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
triggerRef,
|
|
154
|
-
open,
|
|
155
|
-
onOpenChange: setOpen,
|
|
156
|
-
onOpenToggle: voidFn,
|
|
157
|
-
hasCustomAnchor,
|
|
158
|
-
onCustomAnchorAdd,
|
|
159
|
-
onCustomAnchorRemove,
|
|
160
|
-
children
|
|
161
|
-
})
|
|
162
|
-
})
|
|
163
|
-
});
|
|
164
|
-
if (zIndex !== void 0) {
|
|
165
|
-
return /* @__PURE__ */jsx(TooltipZIndexContext.Provider, {
|
|
166
|
-
value: zIndex,
|
|
167
|
-
children: content
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return content;
|
|
61
|
+
const TooltipComponent = createRefComponent(function Tooltip(props, ref) {
|
|
62
|
+
"use no memo";
|
|
63
|
+
const { children, delay: delayProp, restMs: restMsProp, onOpenChange: onOpenChangeProp, focus, open: openProp, disableAutoCloseOnScroll, zIndex, scope = TOOLTIP_SCOPE, ...restProps } = props;
|
|
64
|
+
const triggerRef = React.useRef(null);
|
|
65
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
66
|
+
const { delay: delayGroup, setCurrentId } = useDelayGroupContext();
|
|
67
|
+
const delay = delayProp !== void 0 ? delayProp : delayGroup ?? 400;
|
|
68
|
+
const restMs = restMsProp ?? (typeof delay === "number" ? delay : 0);
|
|
69
|
+
const [open, setOpen] = useControllableState({
|
|
70
|
+
prop: openProp,
|
|
71
|
+
defaultProp: false,
|
|
72
|
+
onChange: onOpenChangeProp
|
|
73
|
+
});
|
|
74
|
+
const id = props.groupId;
|
|
75
|
+
const onOpenChange = useEvent((open2) => {
|
|
76
|
+
if (open2) {
|
|
77
|
+
setCurrentId(id);
|
|
78
|
+
}
|
|
79
|
+
setOpen(open2);
|
|
80
|
+
});
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
if (!open) return;
|
|
83
|
+
if (disableAutoCloseOnScroll) return;
|
|
84
|
+
if (typeof document === "undefined") return;
|
|
85
|
+
const closeIt = () => {
|
|
86
|
+
setOpen(false);
|
|
87
|
+
};
|
|
88
|
+
setOpens.add(setOpen);
|
|
89
|
+
document.documentElement.addEventListener("scroll", closeIt);
|
|
90
|
+
return () => {
|
|
91
|
+
setOpens.delete(setOpen);
|
|
92
|
+
document.documentElement.removeEventListener("scroll", closeIt);
|
|
93
|
+
};
|
|
94
|
+
}, [open, disableAutoCloseOnScroll]);
|
|
95
|
+
const floatingContext = useFloatingContext({
|
|
96
|
+
open,
|
|
97
|
+
setOpen: onOpenChange,
|
|
98
|
+
disable: false,
|
|
99
|
+
disableFocus: false,
|
|
100
|
+
hoverable: true,
|
|
101
|
+
role: "tooltip",
|
|
102
|
+
focus,
|
|
103
|
+
groupId: id,
|
|
104
|
+
delay,
|
|
105
|
+
restMs
|
|
106
|
+
});
|
|
107
|
+
const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);
|
|
108
|
+
const onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), []);
|
|
109
|
+
const contentId = React.useId();
|
|
110
|
+
const smallerSize = oneSizeTokenSmaller(defaultTokenSizePolicy.fontSize);
|
|
111
|
+
const content = /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {
|
|
112
|
+
value: floatingContext,
|
|
113
|
+
children: /* @__PURE__ */ jsx(Popper, {
|
|
114
|
+
scope,
|
|
115
|
+
size: smallerSize,
|
|
116
|
+
allowFlip: true,
|
|
117
|
+
stayInFrame: true,
|
|
118
|
+
open,
|
|
119
|
+
...restProps,
|
|
120
|
+
children: /* @__PURE__ */ jsx(PopoverContextProvider, {
|
|
121
|
+
scope,
|
|
122
|
+
contentId,
|
|
123
|
+
triggerRef,
|
|
124
|
+
open,
|
|
125
|
+
onOpenChange: setOpen,
|
|
126
|
+
onOpenToggle: voidFn,
|
|
127
|
+
hasCustomAnchor,
|
|
128
|
+
onCustomAnchorAdd,
|
|
129
|
+
onCustomAnchorRemove,
|
|
130
|
+
children
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
if (zIndex !== void 0) {
|
|
135
|
+
return /* @__PURE__ */ jsx(TooltipZIndexContext.Provider, {
|
|
136
|
+
value: zIndex,
|
|
137
|
+
children: content
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return content;
|
|
171
141
|
});
|
|
172
|
-
const TooltipTrigger =
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
scope: scope || TOOLTIP_SCOPE,
|
|
180
|
-
ref
|
|
181
|
-
});
|
|
142
|
+
const TooltipTrigger = createRefComponent(function TooltipTrigger2(props, ref) {
|
|
143
|
+
const { scope, ...rest } = props;
|
|
144
|
+
return /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
145
|
+
...rest,
|
|
146
|
+
scope: scope || TOOLTIP_SCOPE,
|
|
147
|
+
ref
|
|
148
|
+
});
|
|
182
149
|
});
|
|
183
|
-
const TooltipAnchor =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
scope: scope || TOOLTIP_SCOPE,
|
|
191
|
-
ref
|
|
192
|
-
});
|
|
150
|
+
const TooltipAnchor = createRefComponent(function TooltipAnchor2(props, ref) {
|
|
151
|
+
const { scope, ...rest } = props;
|
|
152
|
+
return /* @__PURE__ */ jsx(PopoverAnchor, {
|
|
153
|
+
...rest,
|
|
154
|
+
scope: scope || TOOLTIP_SCOPE,
|
|
155
|
+
ref
|
|
156
|
+
});
|
|
193
157
|
});
|
|
194
158
|
const Tooltip2 = withStaticProperties(TooltipComponent, {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
159
|
+
Anchor: TooltipAnchor,
|
|
160
|
+
Arrow: TooltipArrow,
|
|
161
|
+
Content: TooltipContent,
|
|
162
|
+
Trigger: TooltipTrigger
|
|
199
163
|
});
|
|
200
164
|
const voidFn = () => {};
|
|
165
|
+
|
|
201
166
|
export { Tooltip2 as Tooltip, TooltipGroup, closeOpenTooltips };
|
|
202
167
|
//# sourceMappingURL=Tooltip.mjs.map
|
package/dist/jsx/Tooltip.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":[],"sources":["jsx/Tooltip.js"],"sourcesContent":["import {\n createStyledHOC,\n createRefComponent,\n defaultTokenSizePolicy,\n styled\n} from \"@tamagui/core\";\n\nimport { FloatingDelayGroup, useDelayGroupContext } from \"@tamagui/floating\";\nimport { useEvent } from \"@tamagui/core\";\nimport { FloatingOverrideContext } from \"@tamagui/floating\";\nimport { oneSizeTokenSmaller } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport {\n PopoverAnchor,\n PopoverArrow,\n PopoverContent,\n PopoverContextProvider,\n PopoverTrigger,\n useFloatingContext\n} from \"@tamagui/popover\";\nimport { Popper, PopperContentFrame } from \"@tamagui/popper\";\nimport { getElevation } from \"@tamagui/stacks\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst TOOLTIP_SCOPE = \"\";\nconst TooltipContentFrame = styled(PopperContentFrame, {\n variants: {\n elevation: {\n number: getElevation,\n Size: getElevation\n }\n }\n});\nconst ALWAYS_DISABLE_TOOLTIP = {\n focus: true,\n \"remove-scroll\": true\n // it's nice to hit escape to hide a tooltip\n // dismiss: true\n};\nconst TooltipContent = createStyledHOC(\n TooltipContentFrame,\n (props, ref) => {\n const preventAnimation = React.useContext(PreventTooltipAnimationContext);\n const zIndexFromContext = React.useContext(TooltipZIndexContext);\n return /* @__PURE__ */ jsx(\n PopoverContent,\n {\n scope: props.scope || TOOLTIP_SCOPE,\n alwaysDisable: ALWAYS_DISABLE_TOOLTIP,\n backgroundColor: \"background\",\n alignItems: \"center\",\n pointerEvents: \"none\",\n ...zIndexFromContext !== void 0 && { zIndex: zIndexFromContext },\n ...props,\n ...preventAnimation && { transition: null },\n ref\n }\n );\n },\n {\n displayName: \"Tooltip\"\n }\n);\nconst TooltipArrow = createRefComponent(\n (props, ref) => {\n const { className, ...rest } = props;\n return /* @__PURE__ */ jsx(\n PopoverArrow,\n {\n scope: props.scope || TOOLTIP_SCOPE,\n className: `is_Tooltip ${className || \"\"}`.trim(),\n ref,\n ...rest\n }\n );\n }\n);\nconst PreventTooltipAnimationContext = React.createContext(false);\nconst TooltipZIndexContext = React.createContext(void 0);\nconst TooltipGroup = ({\n children,\n delay,\n preventAnimation = false,\n timeoutMs\n}) => {\n return /* @__PURE__ */ jsx(PreventTooltipAnimationContext.Provider, { value: preventAnimation, children: /* @__PURE__ */ jsx(\n FloatingDelayGroup,\n {\n timeoutMs,\n delay: React.useMemo(() => delay, [JSON.stringify(delay)]),\n children\n }\n ) });\n};\nconst setOpens = /* @__PURE__ */ new Set();\nconst closeOpenTooltips = () => {\n setOpens.forEach((x) => x(false));\n};\nconst TooltipComponent = createRefComponent(function Tooltip(props, ref) {\n \"use no memo\";\n const {\n children,\n delay: delayProp,\n restMs: restMsProp,\n onOpenChange: onOpenChangeProp,\n focus,\n open: openProp,\n disableAutoCloseOnScroll,\n zIndex,\n scope = TOOLTIP_SCOPE,\n ...restProps\n } = props;\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const { delay: delayGroup, setCurrentId } = useDelayGroupContext();\n const delay = delayProp !== void 0 ? delayProp : delayGroup ?? 400;\n const restMs = restMsProp ?? (typeof delay === \"number\" ? delay : 0);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: false,\n onChange: onOpenChangeProp\n });\n const id = props.groupId;\n const onOpenChange = useEvent((open2) => {\n if (open2) {\n setCurrentId(id);\n }\n setOpen(open2);\n });\n React.useEffect(() => {\n if (!open) return;\n if (disableAutoCloseOnScroll) return;\n if (typeof document === \"undefined\") return;\n const closeIt = () => {\n setOpen(false);\n };\n setOpens.add(setOpen);\n document.documentElement.addEventListener(\"scroll\", closeIt);\n return () => {\n setOpens.delete(setOpen);\n document.documentElement.removeEventListener(\"scroll\", closeIt);\n };\n }, [open, disableAutoCloseOnScroll]);\n const floatingContext = useFloatingContext({\n open,\n setOpen: onOpenChange,\n disable: false,\n disableFocus: false,\n hoverable: true,\n role: \"tooltip\",\n focus,\n groupId: id,\n delay,\n restMs\n });\n const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);\n const onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), []);\n const contentId = React.useId();\n const smallerSize = oneSizeTokenSmaller(defaultTokenSizePolicy.fontSize);\n const content = /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, { value: floatingContext, children: /* @__PURE__ */ jsx(\n Popper,\n {\n scope,\n size: smallerSize,\n allowFlip: true,\n stayInFrame: true,\n open,\n ...restProps,\n children: /* @__PURE__ */ jsx(\n PopoverContextProvider,\n {\n scope,\n contentId,\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: voidFn,\n hasCustomAnchor,\n onCustomAnchorAdd,\n onCustomAnchorRemove,\n children\n }\n )\n }\n ) });\n if (zIndex !== void 0) {\n return /* @__PURE__ */ jsx(TooltipZIndexContext.Provider, { value: zIndex, children: content });\n }\n return content;\n});\nconst TooltipTrigger = createRefComponent(function TooltipTrigger2(props, ref) {\n const { scope, ...rest } = props;\n return /* @__PURE__ */ jsx(PopoverTrigger, { ...rest, scope: scope || TOOLTIP_SCOPE, ref });\n});\nconst TooltipAnchor = createRefComponent(function TooltipAnchor2(props, ref) {\n const { scope, ...rest } = props;\n return /* @__PURE__ */ jsx(PopoverAnchor, { ...rest, scope: scope || TOOLTIP_SCOPE, ref });\n});\nconst Tooltip2 = withStaticProperties(TooltipComponent, {\n Anchor: TooltipAnchor,\n Arrow: TooltipArrow,\n Content: TooltipContent,\n Trigger: TooltipTrigger\n});\nconst voidFn = () => {\n};\nexport {\n Tooltip2 as Tooltip,\n TooltipGroup,\n closeOpenTooltips\n};\n//# sourceMappingURL=Tooltip.js.map\n"],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var Tooltip_native_exports = {};
|
|
25
|
+
__export(Tooltip_native_exports, {
|
|
26
|
+
Tooltip: () => Tooltip,
|
|
27
|
+
TooltipGroup: () => TooltipGroup,
|
|
28
|
+
closeOpenTooltips: () => closeOpenTooltips
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(Tooltip_native_exports);
|
|
31
|
+
var import_helpers = require("@tamagui/helpers");
|
|
32
|
+
var RenderChildren = function(props) {
|
|
33
|
+
return props.children;
|
|
34
|
+
};
|
|
35
|
+
var RenderNull = function(props) {
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
var TooltipGroup = function() {
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
var closeOpenTooltips = function() {};
|
|
42
|
+
var Tooltip = (0, import_helpers.withStaticProperties)(RenderChildren, {
|
|
43
|
+
Anchor: RenderChildren,
|
|
44
|
+
Arrow: RenderNull,
|
|
45
|
+
Close: RenderNull,
|
|
46
|
+
Content: RenderNull,
|
|
47
|
+
Trigger: RenderChildren
|
|
48
|
+
});
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var Tooltip_native_exports = {};
|
|
26
25
|
__export(Tooltip_native_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
Tooltip: () => Tooltip,
|
|
27
|
+
TooltipGroup: () => TooltipGroup,
|
|
28
|
+
closeOpenTooltips: () => closeOpenTooltips
|
|
30
29
|
});
|
|
31
30
|
module.exports = __toCommonJS(Tooltip_native_exports);
|
|
32
31
|
var import_helpers = require("@tamagui/helpers");
|
|
33
|
-
var RenderChildren = function
|
|
34
|
-
|
|
32
|
+
var RenderChildren = function(props) {
|
|
33
|
+
return props.children;
|
|
35
34
|
};
|
|
36
|
-
var RenderNull = function
|
|
37
|
-
|
|
35
|
+
var RenderNull = function(props) {
|
|
36
|
+
return null;
|
|
38
37
|
};
|
|
39
|
-
var TooltipGroup = function
|
|
40
|
-
|
|
38
|
+
var TooltipGroup = function() {
|
|
39
|
+
return null;
|
|
41
40
|
};
|
|
42
|
-
var closeOpenTooltips = function
|
|
41
|
+
var closeOpenTooltips = function() {};
|
|
43
42
|
var Tooltip = (0, import_helpers.withStaticProperties)(RenderChildren, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
Anchor: RenderChildren,
|
|
44
|
+
Arrow: RenderNull,
|
|
45
|
+
Close: RenderNull,
|
|
46
|
+
Content: RenderNull,
|
|
47
|
+
Trigger: RenderChildren
|
|
49
48
|
});
|
|
49
|
+
|
|
50
50
|
//# sourceMappingURL=Tooltip.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Tooltip.native.js","names":[],"sources":["jsx/Tooltip.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Tooltip_native_exports = {};\n__export(Tooltip_native_exports, {\n Tooltip: () => Tooltip,\n TooltipGroup: () => TooltipGroup,\n closeOpenTooltips: () => closeOpenTooltips\n});\nmodule.exports = __toCommonJS(Tooltip_native_exports);\nvar import_helpers = require(\"@tamagui/helpers\");\nvar RenderChildren = function(props) {\n return props.children;\n};\nvar RenderNull = function(props) {\n return null;\n};\nvar TooltipGroup = function() {\n return null;\n};\nvar closeOpenTooltips = function() {\n};\nvar Tooltip = (0, import_helpers.withStaticProperties)(RenderChildren, {\n Anchor: RenderChildren,\n Arrow: RenderNull,\n Close: RenderNull,\n Content: RenderNull,\n Trigger: RenderChildren\n});\n//# sourceMappingURL=Tooltip.native.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,yBAAyB,CAAC;AAC9B,SAAS,wBAAwB;CAC/B,eAAe;CACf,oBAAoB;CACpB,yBAAyB;AAC3B,CAAC;AACD,OAAO,UAAU,aAAa,sBAAsB;AACpD,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,IAAI,iBAAiB,SAAS,OAAO;CACnC,OAAO,MAAM;AACf;AACA,IAAI,aAAa,SAAS,OAAO;CAC/B,OAAO;AACT;AACA,IAAI,eAAe,WAAW;CAC5B,OAAO;AACT;AACA,IAAI,oBAAoB,WAAW,CACnC;AACA,IAAI,WAAW,GAAG,eAAe,sBAAsB,gBAAgB;CACrE,QAAQ;CACR,OAAO;CACP,OAAO;CACP,SAAS;CACT,SAAS;AACX,CAAC"}
|