@tamagui/tooltip 2.0.0-rc.4 → 2.0.0-rc.40
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 +214 -199
- package/dist/cjs/Tooltip.native.js +30 -28
- package/dist/cjs/Tooltip.native.js.map +1 -1
- package/dist/cjs/TooltipSimple.cjs +41 -34
- package/dist/cjs/TooltipSimple.native.js +15 -13
- package/dist/cjs/TooltipSimple.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Tooltip.mjs +180 -168
- package/dist/esm/Tooltip.mjs.map +1 -1
- package/dist/esm/Tooltip.native.js +16 -16
- package/dist/esm/Tooltip.native.js.map +1 -1
- package/dist/esm/TooltipSimple.mjs +12 -7
- package/dist/esm/TooltipSimple.mjs.map +1 -1
- package/dist/esm/TooltipSimple.native.js +3 -3
- package/dist/esm/TooltipSimple.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/jsx/Tooltip.mjs +180 -168
- package/dist/jsx/Tooltip.mjs.map +1 -1
- package/dist/jsx/Tooltip.native.js +30 -28
- package/dist/jsx/Tooltip.native.js.map +1 -1
- package/dist/jsx/TooltipSimple.mjs +12 -7
- package/dist/jsx/TooltipSimple.mjs.map +1 -1
- package/dist/jsx/TooltipSimple.native.js +15 -13
- package/dist/jsx/TooltipSimple.native.js.map +1 -1
- package/dist/jsx/index.js +2 -2
- package/dist/jsx/index.js.map +1 -6
- package/dist/jsx/index.native.js +7 -5
- 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/cjs/index.js +0 -16
- package/dist/cjs/index.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
|
@@ -2,33 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var Tooltip_exports = {};
|
|
33
35
|
__export(Tooltip_exports, {
|
|
34
36
|
Tooltip: () => Tooltip2,
|
|
@@ -36,191 +38,204 @@ __export(Tooltip_exports, {
|
|
|
36
38
|
closeOpenTooltips: () => closeOpenTooltips
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(Tooltip_exports);
|
|
39
|
-
var import_polyfill_dev = require("@tamagui/polyfill-dev")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const TOOLTIP_SCOPE = ""
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
var import_polyfill_dev = require("@tamagui/polyfill-dev");
|
|
42
|
+
var import_floating = require("@tamagui/floating");
|
|
43
|
+
var import_core = require("@tamagui/core");
|
|
44
|
+
var import_floating2 = require("@tamagui/floating");
|
|
45
|
+
var import_get_token = require("@tamagui/get-token");
|
|
46
|
+
var import_helpers = require("@tamagui/helpers");
|
|
47
|
+
var import_popover = require("@tamagui/popover");
|
|
48
|
+
var import_popper = require("@tamagui/popper");
|
|
49
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
50
|
+
var React = __toESM(require("react"), 1);
|
|
51
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
+
const TOOLTIP_SCOPE = "";
|
|
53
|
+
const ALWAYS_DISABLE_TOOLTIP = {
|
|
54
|
+
focus: true,
|
|
55
|
+
"remove-scroll": true
|
|
56
|
+
// it's nice to hit escape to hide a tooltip
|
|
57
|
+
// dismiss: true
|
|
58
|
+
};
|
|
59
|
+
const TooltipContent = import_popper.PopperContentFrame.styleable((props, ref) => {
|
|
60
|
+
const preventAnimation = React.useContext(PreventTooltipAnimationContext);
|
|
61
|
+
const zIndexFromContext = React.useContext(TooltipZIndexContext);
|
|
62
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverContent, {
|
|
63
|
+
scope: props.scope || TOOLTIP_SCOPE,
|
|
64
|
+
alwaysDisable: ALWAYS_DISABLE_TOOLTIP,
|
|
65
|
+
...(!props.unstyled && {
|
|
66
|
+
backgroundColor: "$background",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
pointerEvents: "none",
|
|
69
|
+
size: "$true"
|
|
70
|
+
}),
|
|
71
|
+
ref,
|
|
72
|
+
...(zIndexFromContext !== void 0 && {
|
|
73
|
+
zIndex: zIndexFromContext
|
|
74
|
+
}),
|
|
75
|
+
...props,
|
|
76
|
+
...(preventAnimation && {
|
|
77
|
+
transition: null
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}, {
|
|
81
|
+
staticConfig: {
|
|
82
|
+
componentName: "Tooltip"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
86
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverArrow, {
|
|
71
87
|
scope: props.scope || TOOLTIP_SCOPE,
|
|
72
88
|
componentName: "Tooltip",
|
|
73
89
|
ref,
|
|
74
90
|
...props
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
const PreventTooltipAnimationContext = React.createContext(false);
|
|
94
|
+
const TooltipZIndexContext = React.createContext(void 0);
|
|
95
|
+
const TooltipGroup = ({
|
|
96
|
+
children,
|
|
97
|
+
delay,
|
|
98
|
+
preventAnimation = false,
|
|
99
|
+
timeoutMs
|
|
100
|
+
}) => {
|
|
101
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PreventTooltipAnimationContext.Provider, {
|
|
83
102
|
value: preventAnimation,
|
|
84
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
103
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating.FloatingDelayGroup, {
|
|
85
104
|
timeoutMs,
|
|
86
105
|
delay: React.useMemo(() => delay, [JSON.stringify(delay)]),
|
|
87
106
|
children
|
|
88
107
|
})
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
shift: -2,
|
|
167
|
-
bounds: [0]
|
|
168
|
-
});
|
|
169
|
-
return (
|
|
170
|
-
// TODO: FloatingOverrideContext might also need to be scoped
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
(0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {
|
|
173
|
-
value: useFloatingContext,
|
|
174
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.Popper, {
|
|
175
|
-
scope,
|
|
176
|
-
size: smallerSize?.key,
|
|
177
|
-
allowFlip: !0,
|
|
178
|
-
stayInFrame: !0,
|
|
179
|
-
open,
|
|
180
|
-
...restProps,
|
|
181
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverContext.Provider, {
|
|
182
|
-
popoverScope: scope,
|
|
183
|
-
scope,
|
|
184
|
-
contentId,
|
|
185
|
-
triggerRef,
|
|
186
|
-
open,
|
|
187
|
-
onOpenChange: setOpen,
|
|
188
|
-
onOpenToggle: voidFn,
|
|
189
|
-
hasCustomAnchor,
|
|
190
|
-
onCustomAnchorAdd,
|
|
191
|
-
onCustomAnchorRemove,
|
|
192
|
-
children
|
|
193
|
-
})
|
|
194
|
-
})
|
|
195
|
-
})
|
|
196
|
-
);
|
|
197
|
-
}),
|
|
198
|
-
TooltipTrigger = React.forwardRef(function (props, ref) {
|
|
199
|
-
const {
|
|
200
|
-
scope,
|
|
201
|
-
...rest
|
|
202
|
-
} = props;
|
|
203
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverTrigger, {
|
|
204
|
-
...rest,
|
|
205
|
-
scope: scope || TOOLTIP_SCOPE,
|
|
206
|
-
ref
|
|
207
|
-
});
|
|
208
|
-
}),
|
|
209
|
-
TooltipAnchor = React.forwardRef(function (props, ref) {
|
|
210
|
-
const {
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
const setOpens = /* @__PURE__ */new Set();
|
|
111
|
+
const closeOpenTooltips = () => {
|
|
112
|
+
setOpens.forEach(x => x(false));
|
|
113
|
+
};
|
|
114
|
+
const TooltipComponent = React.forwardRef(function Tooltip(props, ref) {
|
|
115
|
+
"use no memo";
|
|
116
|
+
|
|
117
|
+
const {
|
|
118
|
+
children,
|
|
119
|
+
delay: delayProp,
|
|
120
|
+
restMs: restMsProp,
|
|
121
|
+
onOpenChange: onOpenChangeProp,
|
|
122
|
+
focus,
|
|
123
|
+
open: openProp,
|
|
124
|
+
disableAutoCloseOnScroll,
|
|
125
|
+
zIndex,
|
|
126
|
+
scope = TOOLTIP_SCOPE,
|
|
127
|
+
...restProps
|
|
128
|
+
} = props;
|
|
129
|
+
const triggerRef = React.useRef(null);
|
|
130
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
131
|
+
const {
|
|
132
|
+
delay: delayGroup,
|
|
133
|
+
setCurrentId
|
|
134
|
+
} = (0, import_floating.useDelayGroupContext)();
|
|
135
|
+
const delay = delayProp !== void 0 ? delayProp : delayGroup ?? 400;
|
|
136
|
+
const restMs = restMsProp ?? (typeof delay === "number" ? delay : 0);
|
|
137
|
+
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
138
|
+
prop: openProp,
|
|
139
|
+
defaultProp: false,
|
|
140
|
+
onChange: onOpenChangeProp
|
|
141
|
+
});
|
|
142
|
+
const id = props.groupId;
|
|
143
|
+
const onOpenChange = (0, import_core.useEvent)(open2 => {
|
|
144
|
+
if (open2) {
|
|
145
|
+
setCurrentId(id);
|
|
146
|
+
}
|
|
147
|
+
setOpen(open2);
|
|
148
|
+
});
|
|
149
|
+
React.useEffect(() => {
|
|
150
|
+
if (!open) return;
|
|
151
|
+
if (disableAutoCloseOnScroll) return;
|
|
152
|
+
if (typeof document === "undefined") return;
|
|
153
|
+
const closeIt = () => {
|
|
154
|
+
setOpen(false);
|
|
155
|
+
};
|
|
156
|
+
setOpens.add(setOpen);
|
|
157
|
+
document.documentElement.addEventListener("scroll", closeIt);
|
|
158
|
+
return () => {
|
|
159
|
+
setOpens.delete(setOpen);
|
|
160
|
+
document.documentElement.removeEventListener("scroll", closeIt);
|
|
161
|
+
};
|
|
162
|
+
}, [open, disableAutoCloseOnScroll]);
|
|
163
|
+
const floatingContext = (0, import_popover.useFloatingContext)({
|
|
164
|
+
open,
|
|
165
|
+
setOpen: onOpenChange,
|
|
166
|
+
disable: false,
|
|
167
|
+
disableFocus: false,
|
|
168
|
+
hoverable: true,
|
|
169
|
+
role: "tooltip",
|
|
170
|
+
focus,
|
|
171
|
+
groupId: id,
|
|
172
|
+
delay,
|
|
173
|
+
restMs
|
|
174
|
+
});
|
|
175
|
+
const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);
|
|
176
|
+
const onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), []);
|
|
177
|
+
const contentId = React.useId();
|
|
178
|
+
const smallerSize = props.unstyled ? null : (0, import_get_token.getSize)("$true", {
|
|
179
|
+
shift: -2,
|
|
180
|
+
bounds: [0]
|
|
181
|
+
});
|
|
182
|
+
const content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating2.FloatingOverrideContext.Provider, {
|
|
183
|
+
value: floatingContext,
|
|
184
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.Popper, {
|
|
211
185
|
scope,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
186
|
+
size: smallerSize?.key,
|
|
187
|
+
allowFlip: true,
|
|
188
|
+
stayInFrame: true,
|
|
189
|
+
open,
|
|
190
|
+
...restProps,
|
|
191
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverContextProvider, {
|
|
192
|
+
scope,
|
|
193
|
+
contentId,
|
|
194
|
+
triggerRef,
|
|
195
|
+
open,
|
|
196
|
+
onOpenChange: setOpen,
|
|
197
|
+
onOpenToggle: voidFn,
|
|
198
|
+
hasCustomAnchor,
|
|
199
|
+
onCustomAnchorAdd,
|
|
200
|
+
onCustomAnchorRemove,
|
|
201
|
+
children
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
if (zIndex !== void 0) {
|
|
206
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(TooltipZIndexContext.Provider, {
|
|
207
|
+
value: zIndex,
|
|
208
|
+
children: content
|
|
218
209
|
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
210
|
+
}
|
|
211
|
+
return content;
|
|
212
|
+
});
|
|
213
|
+
const TooltipTrigger = React.forwardRef(function TooltipTrigger2(props, ref) {
|
|
214
|
+
const {
|
|
215
|
+
scope,
|
|
216
|
+
...rest
|
|
217
|
+
} = props;
|
|
218
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverTrigger, {
|
|
219
|
+
...rest,
|
|
220
|
+
scope: scope || TOOLTIP_SCOPE,
|
|
221
|
+
ref
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
const TooltipAnchor = React.forwardRef(function TooltipAnchor2(props, ref) {
|
|
225
|
+
const {
|
|
226
|
+
scope,
|
|
227
|
+
...rest
|
|
228
|
+
} = props;
|
|
229
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popover.PopoverAnchor, {
|
|
230
|
+
...rest,
|
|
231
|
+
scope: scope || TOOLTIP_SCOPE,
|
|
232
|
+
ref
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
const Tooltip2 = (0, import_helpers.withStaticProperties)(TooltipComponent, {
|
|
236
|
+
Anchor: TooltipAnchor,
|
|
237
|
+
Arrow: TooltipArrow,
|
|
238
|
+
Content: TooltipContent,
|
|
239
|
+
Trigger: TooltipTrigger
|
|
240
|
+
});
|
|
241
|
+
const voidFn = () => {};
|
|
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var Tooltip_native_exports = {};
|
|
24
26
|
__export(Tooltip_native_exports, {
|
|
@@ -27,22 +29,22 @@ __export(Tooltip_native_exports, {
|
|
|
27
29
|
closeOpenTooltips: () => closeOpenTooltips
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(Tooltip_native_exports);
|
|
30
|
-
var import_helpers = require("@tamagui/helpers")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
var import_helpers = require("@tamagui/helpers");
|
|
33
|
+
var RenderChildren = function (props) {
|
|
34
|
+
return props.children;
|
|
35
|
+
};
|
|
36
|
+
var RenderNull = function (props) {
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
var TooltipGroup = function () {
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
var closeOpenTooltips = function () {};
|
|
43
|
+
var Tooltip = (0, import_helpers.withStaticProperties)(RenderChildren, {
|
|
44
|
+
Anchor: RenderChildren,
|
|
45
|
+
Arrow: RenderNull,
|
|
46
|
+
Close: RenderNull,
|
|
47
|
+
Content: RenderNull,
|
|
48
|
+
Trigger: RenderChildren
|
|
49
|
+
});
|
|
48
50
|
//# sourceMappingURL=Tooltip.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Tooltip_native_exports","__export","Tooltip","TooltipGroup","closeOpenTooltips","module","exports","__toCommonJS","import_helpers","require","RenderChildren","props","children","RenderNull","withStaticProperties","Anchor","Arrow","Close","Content","Trigger"],"sources":["../../src/Tooltip.native.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["Tooltip_native_exports","__export","Tooltip","TooltipGroup","closeOpenTooltips","module","exports","__toCommonJS","import_helpers","require","RenderChildren","props","children","RenderNull","withStaticProperties","Anchor","Arrow","Close","Content","Trigger"],"sources":["../../src/Tooltip.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAA,OAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,sBAAA;AAAA,IAAAQ,cAAA,GAAqCC,OAAA;AAGrC,IAAIC,cAAA,GAAiB,SAAAA,CAASC,KAAA,EAAO;EACjC,OAAOA,KAAA,CAAMC,QAAA;AACjB;AACA,IAAIC,UAAA,GAAa,SAAAA,CAASF,KAAA,EAAO;EAC7B,OAAO;AACX;AACO,IAAIR,YAAA,GAAe,SAAAA,CAAA,EAAW;EACjC,OAAO;AACX;AACO,IAAIC,iBAAA,GAAoB,SAAAA,CAAA,EAAW,CAAC;AACzB,IAAIF,OAAA,OAAUM,cAAA,CAAAM,oBAAA,EAAqBJ,cAAA,EAAgB;EACjEK,MAAA,EAAQL,cAAA;EACRM,KAAA,EAAOH,UAAA;EACPI,KAAA,EAAOJ,UAAA;EACPK,OAAA,EAASL,UAAA;EACTM,OAAA,EAAST;AACb,CAAC","ignoreList":[]}
|
|
@@ -2,43 +2,45 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var TooltipSimple_exports = {};
|
|
33
35
|
__export(TooltipSimple_exports, {
|
|
34
36
|
TooltipSimple: () => TooltipSimple
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(TooltipSimple_exports);
|
|
37
|
-
var import_get_token = require("@tamagui/get-token")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var import_get_token = require("@tamagui/get-token");
|
|
40
|
+
var import_text = require("@tamagui/text");
|
|
41
|
+
var React = __toESM(require("react"), 1);
|
|
42
|
+
var import_Tooltip = require("./Tooltip.cjs");
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
44
|
const TooltipSimple = React.forwardRef(({
|
|
43
45
|
label,
|
|
44
46
|
children,
|
|
@@ -46,18 +48,24 @@ const TooltipSimple = React.forwardRef(({
|
|
|
46
48
|
disabled,
|
|
47
49
|
...tooltipProps
|
|
48
50
|
}, ref) => {
|
|
51
|
+
"use no memo";
|
|
52
|
+
|
|
49
53
|
const child = React.Children.only(children);
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
if (!label) {
|
|
55
|
+
return children;
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Tooltip.Tooltip, {
|
|
58
|
+
disableRTL: true,
|
|
52
59
|
offset: 15,
|
|
53
60
|
restMs: 40,
|
|
54
61
|
delay: 40,
|
|
62
|
+
zIndex: 1e6,
|
|
55
63
|
...tooltipProps,
|
|
56
64
|
...(disabled ? {
|
|
57
|
-
open:
|
|
65
|
+
open: false
|
|
58
66
|
} : null),
|
|
59
67
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Tooltip.Tooltip.Trigger, {
|
|
60
|
-
...(typeof label
|
|
68
|
+
...(typeof label === "string" && {
|
|
61
69
|
"aria-label": label
|
|
62
70
|
}),
|
|
63
71
|
asChild: "except-style",
|
|
@@ -65,7 +73,6 @@ const TooltipSimple = React.forwardRef(({
|
|
|
65
73
|
ref
|
|
66
74
|
}) : child
|
|
67
75
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Tooltip.Tooltip.Content, {
|
|
68
|
-
zIndex: 1e9,
|
|
69
76
|
enterStyle: {
|
|
70
77
|
y: -4,
|
|
71
78
|
opacity: 0,
|
|
@@ -86,7 +93,7 @@ const TooltipSimple = React.forwardRef(({
|
|
|
86
93
|
animateOnly: ["transform", "opacity"],
|
|
87
94
|
transition: ["quicker", {
|
|
88
95
|
opacity: {
|
|
89
|
-
overshootClamping:
|
|
96
|
+
overshootClamping: true
|
|
90
97
|
}
|
|
91
98
|
}],
|
|
92
99
|
...contentProps,
|
|
@@ -101,5 +108,5 @@ const TooltipSimple = React.forwardRef(({
|
|
|
101
108
|
children: label
|
|
102
109
|
})]
|
|
103
110
|
})]
|
|
104
|
-
})
|
|
111
|
+
});
|
|
105
112
|
});
|