@tamagui/popper 1.61.2 → 1.62.0
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/Popper.js +67 -141
- package/dist/cjs/Popper.js.map +2 -2
- package/dist/cjs/Popper.native.js +251 -0
- package/dist/cjs/Popper.native.js.map +6 -0
- package/dist/cjs/index.js +4 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +20 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/esm/Popper.js +60 -121
- package/dist/esm/Popper.js.map +2 -2
- package/dist/jsx/Popper.js +55 -114
- package/dist/jsx/Popper.js.map +2 -2
- package/dist/jsx/Popper.native.js +228 -0
- package/dist/jsx/Popper.native.js.map +6 -0
- package/dist/jsx/index.native.js +2 -0
- package/dist/jsx/index.native.js.map +6 -0
- package/package.json +8 -8
package/dist/cjs/Popper.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
14
11
|
for (let key of __getOwnPropNames(from))
|
|
15
|
-
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
13
|
return to;
|
|
19
14
|
};
|
|
20
15
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
@@ -22,10 +17,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
19
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
26
21
|
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
29
23
|
var Popper_exports = {};
|
|
30
24
|
__export(Popper_exports, {
|
|
31
25
|
Popper: () => Popper,
|
|
@@ -37,16 +31,8 @@ __export(Popper_exports, {
|
|
|
37
31
|
usePopperContext: () => usePopperContext
|
|
38
32
|
});
|
|
39
33
|
module.exports = __toCommonJS(Popper_exports);
|
|
40
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
-
|
|
42
|
-
var import_core = require("@tamagui/core");
|
|
43
|
-
var import_floating = require("@tamagui/floating");
|
|
44
|
-
var import_get_token = require("@tamagui/get-token");
|
|
45
|
-
var import_stacks = require("@tamagui/stacks");
|
|
46
|
-
var React = __toESM(require("react"));
|
|
47
|
-
var import_react_native = require("react-native");
|
|
48
|
-
const PopperContext = (0, import_core.createStyledContext)({});
|
|
49
|
-
const usePopperContext = () => React.useContext(PopperContext);
|
|
34
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_core = require("@tamagui/core"), import_floating = require("@tamagui/floating"), import_get_token = require("@tamagui/get-token"), import_stacks = require("@tamagui/stacks"), React = __toESM(require("react")), import_react_native = require("react-native"), import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
const PopperContext = (0, import_core.createStyledContext)({}), usePopperContext = () => React.useContext(PopperContext);
|
|
50
36
|
function Popper(props) {
|
|
51
37
|
const {
|
|
52
38
|
children,
|
|
@@ -56,61 +42,46 @@ function Popper(props) {
|
|
|
56
42
|
stayInFrame,
|
|
57
43
|
allowFlip,
|
|
58
44
|
offset
|
|
59
|
-
} = props;
|
|
60
|
-
const [isMounted, setIsMounted] = React.useState(false);
|
|
45
|
+
} = props, [isMounted, setIsMounted] = React.useState(!1);
|
|
61
46
|
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
62
|
-
setIsMounted(
|
|
47
|
+
setIsMounted(!0);
|
|
63
48
|
}, []);
|
|
64
|
-
const [anchorRef, setAnchorRef] = React.useState()
|
|
65
|
-
const [arrowEl, setArrow] = React.useState(null);
|
|
66
|
-
const [arrowSize, setArrowSize] = React.useState(0);
|
|
67
|
-
const offsetOptions = offset ?? arrowSize;
|
|
68
|
-
const floating = (0, import_floating.useFloating)({
|
|
49
|
+
const [anchorRef, setAnchorRef] = React.useState(), [arrowEl, setArrow] = React.useState(null), [arrowSize, setArrowSize] = React.useState(0), offsetOptions = offset ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
69
50
|
strategy,
|
|
70
51
|
placement,
|
|
71
|
-
sameScrollView:
|
|
52
|
+
sameScrollView: !1,
|
|
72
53
|
// this only takes effect on native
|
|
73
54
|
middleware: [
|
|
74
|
-
stayInFrame ? (0, import_floating.shift)(typeof stayInFrame
|
|
75
|
-
allowFlip ? (0, import_floating.flip)(typeof allowFlip
|
|
55
|
+
stayInFrame ? (0, import_floating.shift)(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null,
|
|
56
|
+
allowFlip ? (0, import_floating.flip)(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
|
|
76
57
|
arrowEl ? (0, import_floating.arrow)({ element: arrowEl }) : null,
|
|
77
|
-
typeof offsetOptions
|
|
58
|
+
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null
|
|
78
59
|
].filter(Boolean)
|
|
79
|
-
})
|
|
80
|
-
const {
|
|
60
|
+
}), {
|
|
81
61
|
refs,
|
|
82
62
|
middlewareData,
|
|
83
63
|
// @ts-expect-error this comes from Tooltip for example
|
|
84
64
|
open
|
|
85
65
|
} = floating;
|
|
86
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
66
|
+
if ((0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
87
67
|
floating.refs.setReference(anchorRef);
|
|
88
|
-
}, [anchorRef])
|
|
89
|
-
if (import_core.isWeb) {
|
|
68
|
+
}, [anchorRef]), import_core.isWeb)
|
|
90
69
|
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
91
|
-
if (
|
|
92
|
-
return;
|
|
93
|
-
if (!(refs.reference.current && refs.floating.current)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
70
|
+
if (open && refs.reference.current && refs.floating.current)
|
|
71
|
+
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
97
72
|
}, [open, floating.update, refs.floating, refs.reference]);
|
|
98
|
-
|
|
99
|
-
const dimensions = (0, import_react_native.useWindowDimensions)();
|
|
100
|
-
const [keyboardOpen, setKeyboardOpen] = React.useState(false);
|
|
73
|
+
else {
|
|
74
|
+
const dimensions = (0, import_react_native.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React.useState(!1);
|
|
101
75
|
React.useEffect(() => {
|
|
102
76
|
const showSubscription = import_react_native.Keyboard.addListener("keyboardDidShow", () => {
|
|
103
|
-
setKeyboardOpen(
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
setKeyboardOpen(false);
|
|
77
|
+
setKeyboardOpen(!0);
|
|
78
|
+
}), hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
79
|
+
setKeyboardOpen(!1);
|
|
107
80
|
});
|
|
108
81
|
return () => {
|
|
109
|
-
showSubscription.remove();
|
|
110
|
-
hideSubscription.remove();
|
|
82
|
+
showSubscription.remove(), hideSubscription.remove();
|
|
111
83
|
};
|
|
112
|
-
}, [])
|
|
113
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
84
|
+
}, []), (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
114
85
|
floating.update();
|
|
115
86
|
}, [dimensions, keyboardOpen]);
|
|
116
87
|
}
|
|
@@ -126,14 +97,10 @@ function Popper(props) {
|
|
|
126
97
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperContext.Provider, { ...popperContext, children });
|
|
127
98
|
}
|
|
128
99
|
const PopperAnchor = import_stacks.YStack.extractable(
|
|
129
|
-
React.forwardRef(function
|
|
130
|
-
const { virtualRef, ...anchorProps } = props;
|
|
131
|
-
|
|
132
|
-
const ref = React.useRef(null);
|
|
133
|
-
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, anchorRef);
|
|
134
|
-
if (virtualRef) {
|
|
100
|
+
React.forwardRef(function(props, forwardedRef) {
|
|
101
|
+
const { virtualRef, ...anchorProps } = props, { anchorRef, getReferenceProps } = usePopperContext(), ref = React.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, anchorRef);
|
|
102
|
+
if (virtualRef)
|
|
135
103
|
return null;
|
|
136
|
-
}
|
|
137
104
|
const stackProps = {
|
|
138
105
|
ref: composedRefs,
|
|
139
106
|
...anchorProps
|
|
@@ -145,8 +112,7 @@ const PopperAnchor = import_stacks.YStack.extractable(
|
|
|
145
112
|
}
|
|
146
113
|
);
|
|
147
114
|
})
|
|
148
|
-
)
|
|
149
|
-
const PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
115
|
+
), PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
150
116
|
name: "PopperContent",
|
|
151
117
|
variants: {
|
|
152
118
|
unstyled: {
|
|
@@ -154,47 +120,36 @@ const PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack,
|
|
|
154
120
|
size: "$true",
|
|
155
121
|
backgroundColor: "$background",
|
|
156
122
|
alignItems: "center",
|
|
157
|
-
radiused:
|
|
123
|
+
radiused: !0
|
|
158
124
|
}
|
|
159
125
|
},
|
|
160
126
|
size: {
|
|
161
|
-
"...size": (val, { tokens }) => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
};
|
|
166
|
-
}
|
|
127
|
+
"...size": (val, { tokens }) => ({
|
|
128
|
+
padding: tokens.space[val],
|
|
129
|
+
borderRadius: tokens.radius[val]
|
|
130
|
+
})
|
|
167
131
|
}
|
|
168
132
|
},
|
|
169
133
|
defaultVariants: {
|
|
170
|
-
unstyled:
|
|
134
|
+
unstyled: !1
|
|
171
135
|
}
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
}, [placement, strategy, props]);
|
|
190
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
191
|
-
if (isMounted) {
|
|
192
|
-
update();
|
|
193
|
-
}
|
|
194
|
-
}, [isMounted]);
|
|
195
|
-
if (!isMounted) {
|
|
136
|
+
}), PopperContent = React.forwardRef(
|
|
137
|
+
function(props, forwardedRef) {
|
|
138
|
+
const { strategy, placement, refs, x, y, getFloatingProps, size, isMounted, update } = usePopperContext(), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), contents = React.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
PopperContentFrame,
|
|
140
|
+
{
|
|
141
|
+
"data-placement": placement,
|
|
142
|
+
"data-strategy": strategy,
|
|
143
|
+
contain: "layout",
|
|
144
|
+
size,
|
|
145
|
+
...props
|
|
146
|
+
},
|
|
147
|
+
"popper-content-frame"
|
|
148
|
+
), [placement, strategy, props]);
|
|
149
|
+
if ((0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
150
|
+
isMounted && update();
|
|
151
|
+
}, [isMounted]), !isMounted)
|
|
196
152
|
return null;
|
|
197
|
-
}
|
|
198
153
|
const frameProps = {
|
|
199
154
|
ref: contentRefs,
|
|
200
155
|
x: x || 0,
|
|
@@ -203,8 +158,7 @@ const PopperContent = React.forwardRef(
|
|
|
203
158
|
};
|
|
204
159
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
205
160
|
}
|
|
206
|
-
)
|
|
207
|
-
const PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
161
|
+
), PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
208
162
|
name: "PopperArrow",
|
|
209
163
|
variants: {
|
|
210
164
|
unstyled: {
|
|
@@ -216,10 +170,9 @@ const PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
|
216
170
|
}
|
|
217
171
|
},
|
|
218
172
|
defaultVariants: {
|
|
219
|
-
unstyled:
|
|
173
|
+
unstyled: !1
|
|
220
174
|
}
|
|
221
|
-
})
|
|
222
|
-
const PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
175
|
+
}), PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
223
176
|
name: "PopperArrowOuter",
|
|
224
177
|
variants: {
|
|
225
178
|
unstyled: {
|
|
@@ -234,56 +187,29 @@ const PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
|
234
187
|
}
|
|
235
188
|
},
|
|
236
189
|
defaultVariants: {
|
|
237
|
-
unstyled:
|
|
190
|
+
unstyled: !1
|
|
238
191
|
}
|
|
239
|
-
})
|
|
240
|
-
const opposites = {
|
|
192
|
+
}), opposites = {
|
|
241
193
|
top: "bottom",
|
|
242
194
|
right: "left",
|
|
243
195
|
bottom: "top",
|
|
244
196
|
left: "right"
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
var _a, _b;
|
|
249
|
-
const props = (0, import_core.useProps)(propsIn);
|
|
250
|
-
const { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = props;
|
|
251
|
-
const context = usePopperContext();
|
|
252
|
-
const sizeVal = sizeProp ?? context.size;
|
|
253
|
-
const sizeValResolved = (0, import_core.getVariableValue)(
|
|
197
|
+
}, PopperArrow = PopperArrowFrame.styleable(
|
|
198
|
+
function(propsIn, forwardedRef) {
|
|
199
|
+
const props = (0, import_core.useProps)(propsIn), { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = props, context = usePopperContext(), sizeVal = sizeProp ?? context.size, size = +(0, import_core.getVariableValue)(
|
|
254
200
|
(0, import_get_token.getSpace)(sizeVal, {
|
|
255
201
|
shift: -2,
|
|
256
202
|
bounds: [2]
|
|
257
203
|
})
|
|
258
|
-
);
|
|
259
|
-
const size = +sizeValResolved;
|
|
260
|
-
const { placement } = context;
|
|
261
|
-
const refs = (0, import_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef);
|
|
262
|
-
const x = ((_a = context.arrowStyle) == null ? void 0 : _a.x) || 0;
|
|
263
|
-
const y = ((_b = context.arrowStyle) == null ? void 0 : _b.y) || 0;
|
|
264
|
-
const primaryPlacement = placement ? placement.split("-")[0] : "top";
|
|
265
|
-
const arrowStyle = { x, y, width: size, height: size };
|
|
266
|
-
const innerArrowStyle = {};
|
|
267
|
-
const isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
204
|
+
), { placement } = context, refs = (0, import_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef), x = context.arrowStyle?.x || 0, y = context.arrowStyle?.y || 0, primaryPlacement = placement ? placement.split("-")[0] : "top", arrowStyle = { x, y, width: size, height: size }, innerArrowStyle = {}, isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
268
205
|
if (primaryPlacement) {
|
|
269
206
|
arrowStyle[isVertical ? "width" : "height"] = size * 2;
|
|
270
207
|
const oppSide = opposites[primaryPlacement];
|
|
271
|
-
|
|
272
|
-
arrowStyle[oppSide] = -size;
|
|
273
|
-
innerArrowStyle[oppSide] = size / 2;
|
|
274
|
-
}
|
|
275
|
-
if (oppSide === "top" || oppSide === "bottom") {
|
|
276
|
-
arrowStyle.left = 0;
|
|
277
|
-
}
|
|
278
|
-
if (oppSide === "left" || oppSide === "right") {
|
|
279
|
-
arrowStyle.top = 0;
|
|
280
|
-
}
|
|
208
|
+
oppSide && (arrowStyle[oppSide] = -size, innerArrowStyle[oppSide] = size / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0);
|
|
281
209
|
}
|
|
282
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}, [size, context.onArrowSize]);
|
|
286
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, { ref: refs, ...arrowStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
return (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
211
|
+
context.onArrowSize?.(size);
|
|
212
|
+
}, [size, context.onArrowSize]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, { ref: refs, ...arrowStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
287
213
|
PopperArrowFrame,
|
|
288
214
|
{
|
|
289
215
|
width: size,
|
package/dist/cjs/Popper.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Popper.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["offsetFn", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC,kCAChC,cAUO,0BACP,kBAYO,8BACP,mBAAyB,+BACzB,gBAAuE,4BACvE,QAAuB,2BACvB,sBAAoD,yBA+H3C;AA1GF,MAAM,oBAAgB,iCAAwC,CAAC,CAAQ,GAEjE,mBAAmB,MAAM,MAAM,WAAW,aAAa;AAY7D,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,OAEE,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,EAAK;AACtD,6CAA0B,MAAM;AAC9B,iBAAa,EAAI;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAc,GAChD,CAAC,SAAS,QAAQ,IAAI,MAAM,SAAc,IAAI,GAC9C,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,CAAC,GAC5C,gBAAgB,UAAU,WAE1B,eAAW,6BAAY;AAAA,IAC3B;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA;AAAA,IAChB,YAAY;AAAA,MACV,kBACI,uBAAM,OAAO,eAAgB,YAAY,CAAC,IAAI,WAAW,IACxD;AAAA,MACL,gBAAY,sBAAK,OAAO,aAAc,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;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;",
|
|
5
|
+
"names": ["offsetFn", "TamaguiView"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var Popper_exports = {};
|
|
25
|
+
__export(Popper_exports, {
|
|
26
|
+
Popper: () => Popper,
|
|
27
|
+
PopperAnchor: () => PopperAnchor,
|
|
28
|
+
PopperArrow: () => PopperArrow,
|
|
29
|
+
PopperContent: () => PopperContent,
|
|
30
|
+
PopperContentFrame: () => PopperContentFrame,
|
|
31
|
+
PopperContext: () => PopperContext,
|
|
32
|
+
usePopperContext: () => usePopperContext
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Popper_exports);
|
|
35
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_core = require("@tamagui/core"), import_floating = require("@tamagui/floating"), import_get_token = require("@tamagui/get-token"), import_stacks = require("@tamagui/stacks"), React = __toESM(require("react")), import_react_native = require("react-native"), import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
const PopperContext = (0, import_core.createStyledContext)({}), usePopperContext = () => React.useContext(PopperContext);
|
|
37
|
+
function Popper(props) {
|
|
38
|
+
const {
|
|
39
|
+
children,
|
|
40
|
+
size,
|
|
41
|
+
strategy = "absolute",
|
|
42
|
+
placement = "bottom",
|
|
43
|
+
stayInFrame,
|
|
44
|
+
allowFlip,
|
|
45
|
+
offset
|
|
46
|
+
} = props, [isMounted, setIsMounted] = React.useState(!1);
|
|
47
|
+
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
48
|
+
setIsMounted(!0);
|
|
49
|
+
}, []);
|
|
50
|
+
const [anchorRef, setAnchorRef] = React.useState(), [arrowEl, setArrow] = React.useState(null), [arrowSize, setArrowSize] = React.useState(0), offsetOptions = offset ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
51
|
+
strategy,
|
|
52
|
+
placement,
|
|
53
|
+
sameScrollView: !1,
|
|
54
|
+
// this only takes effect on native
|
|
55
|
+
middleware: [
|
|
56
|
+
stayInFrame ? (0, import_floating.shift)(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null,
|
|
57
|
+
allowFlip ? (0, import_floating.flip)(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
|
|
58
|
+
arrowEl ? (0, import_floating.arrow)({ element: arrowEl }) : null,
|
|
59
|
+
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null
|
|
60
|
+
].filter(Boolean)
|
|
61
|
+
}), {
|
|
62
|
+
refs,
|
|
63
|
+
middlewareData,
|
|
64
|
+
// @ts-expect-error this comes from Tooltip for example
|
|
65
|
+
open
|
|
66
|
+
} = floating;
|
|
67
|
+
if ((0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
68
|
+
floating.refs.setReference(anchorRef);
|
|
69
|
+
}, [anchorRef]), import_core.isWeb)
|
|
70
|
+
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
71
|
+
if (open && refs.reference.current && refs.floating.current)
|
|
72
|
+
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
73
|
+
}, [open, floating.update, refs.floating, refs.reference]);
|
|
74
|
+
else {
|
|
75
|
+
const dimensions = (0, import_react_native.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React.useState(!1);
|
|
76
|
+
React.useEffect(() => {
|
|
77
|
+
const showSubscription = import_react_native.Keyboard.addListener("keyboardDidShow", () => {
|
|
78
|
+
setKeyboardOpen(!0);
|
|
79
|
+
}), hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
80
|
+
setKeyboardOpen(!1);
|
|
81
|
+
});
|
|
82
|
+
return () => {
|
|
83
|
+
showSubscription.remove(), hideSubscription.remove();
|
|
84
|
+
};
|
|
85
|
+
}, []), (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
86
|
+
floating.update();
|
|
87
|
+
}, [dimensions, keyboardOpen]);
|
|
88
|
+
}
|
|
89
|
+
const popperContext = {
|
|
90
|
+
anchorRef: setAnchorRef,
|
|
91
|
+
size,
|
|
92
|
+
arrowRef: setArrow,
|
|
93
|
+
arrowStyle: middlewareData.arrow,
|
|
94
|
+
onArrowSize: setArrowSize,
|
|
95
|
+
isMounted,
|
|
96
|
+
...floating
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperContext.Provider, { ...popperContext, children });
|
|
99
|
+
}
|
|
100
|
+
const PopperAnchor = import_stacks.YStack.extractable(
|
|
101
|
+
React.forwardRef(function(props, forwardedRef) {
|
|
102
|
+
const { virtualRef, ...anchorProps } = props, { anchorRef, getReferenceProps } = usePopperContext(), ref = React.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, anchorRef);
|
|
103
|
+
if (virtualRef)
|
|
104
|
+
return null;
|
|
105
|
+
const stackProps = {
|
|
106
|
+
ref: composedRefs,
|
|
107
|
+
...anchorProps
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_core.View,
|
|
111
|
+
{
|
|
112
|
+
...getReferenceProps ? getReferenceProps(stackProps) : stackProps
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
})
|
|
116
|
+
), PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
117
|
+
name: "PopperContent",
|
|
118
|
+
variants: {
|
|
119
|
+
unstyled: {
|
|
120
|
+
false: {
|
|
121
|
+
size: "$true",
|
|
122
|
+
backgroundColor: "$background",
|
|
123
|
+
alignItems: "center",
|
|
124
|
+
radiused: !0
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
size: {
|
|
128
|
+
"...size": (val, { tokens }) => ({
|
|
129
|
+
padding: tokens.space[val],
|
|
130
|
+
borderRadius: tokens.radius[val]
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
defaultVariants: {
|
|
135
|
+
unstyled: !1
|
|
136
|
+
}
|
|
137
|
+
}), PopperContent = React.forwardRef(
|
|
138
|
+
function(props, forwardedRef) {
|
|
139
|
+
const { strategy, placement, refs, x, y, getFloatingProps, size, isMounted, update } = usePopperContext(), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), contents = React.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
PopperContentFrame,
|
|
141
|
+
{
|
|
142
|
+
"data-placement": placement,
|
|
143
|
+
"data-strategy": strategy,
|
|
144
|
+
contain: "layout",
|
|
145
|
+
size,
|
|
146
|
+
...props
|
|
147
|
+
},
|
|
148
|
+
"popper-content-frame"
|
|
149
|
+
), [placement, strategy, props]);
|
|
150
|
+
if ((0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
151
|
+
isMounted && update();
|
|
152
|
+
}, [isMounted]), !isMounted)
|
|
153
|
+
return null;
|
|
154
|
+
const frameProps = {
|
|
155
|
+
ref: contentRefs,
|
|
156
|
+
x: x || 0,
|
|
157
|
+
y: y || 0,
|
|
158
|
+
position: strategy
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
161
|
+
}
|
|
162
|
+
), PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
163
|
+
name: "PopperArrow",
|
|
164
|
+
variants: {
|
|
165
|
+
unstyled: {
|
|
166
|
+
false: {
|
|
167
|
+
borderColor: "$borderColor",
|
|
168
|
+
backgroundColor: "$background",
|
|
169
|
+
position: "relative"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
defaultVariants: {
|
|
174
|
+
unstyled: !1
|
|
175
|
+
}
|
|
176
|
+
}), PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
177
|
+
name: "PopperArrowOuter",
|
|
178
|
+
variants: {
|
|
179
|
+
unstyled: {
|
|
180
|
+
false: {
|
|
181
|
+
position: "absolute",
|
|
182
|
+
zIndex: -1,
|
|
183
|
+
pointerEvents: "none",
|
|
184
|
+
overflow: "hidden",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
justifyContent: "center"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
defaultVariants: {
|
|
191
|
+
unstyled: !1
|
|
192
|
+
}
|
|
193
|
+
}), opposites = {
|
|
194
|
+
top: "bottom",
|
|
195
|
+
right: "left",
|
|
196
|
+
bottom: "top",
|
|
197
|
+
left: "right"
|
|
198
|
+
}, PopperArrow = PopperArrowFrame.styleable(
|
|
199
|
+
function(propsIn, forwardedRef) {
|
|
200
|
+
const props = (0, import_core.useProps)(propsIn), { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = props, context = usePopperContext(), sizeVal = sizeProp ?? context.size, size = +(0, import_core.getVariableValue)(
|
|
201
|
+
(0, import_get_token.getSpace)(sizeVal, {
|
|
202
|
+
shift: -2,
|
|
203
|
+
bounds: [2]
|
|
204
|
+
})
|
|
205
|
+
), { placement } = context, refs = (0, import_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef), x = context.arrowStyle?.x || 0, y = context.arrowStyle?.y || 0, primaryPlacement = placement ? placement.split("-")[0] : "top", arrowStyle = { x, y, width: size, height: size }, innerArrowStyle = {}, isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
206
|
+
if (primaryPlacement) {
|
|
207
|
+
arrowStyle[isVertical ? "width" : "height"] = size * 2;
|
|
208
|
+
const oppSide = opposites[primaryPlacement];
|
|
209
|
+
oppSide && (arrowStyle[oppSide] = -size, innerArrowStyle[oppSide] = size / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0);
|
|
210
|
+
}
|
|
211
|
+
return (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
212
|
+
context.onArrowSize?.(size);
|
|
213
|
+
}, [size, context.onArrowSize]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, { ref: refs, ...arrowStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
214
|
+
PopperArrowFrame,
|
|
215
|
+
{
|
|
216
|
+
width: size,
|
|
217
|
+
height: size,
|
|
218
|
+
...arrowProps,
|
|
219
|
+
...innerArrowStyle,
|
|
220
|
+
rotate: "45deg",
|
|
221
|
+
...primaryPlacement === "bottom" && {
|
|
222
|
+
borderLeftWidth: borderWidth,
|
|
223
|
+
borderTopWidth: borderWidth
|
|
224
|
+
},
|
|
225
|
+
...primaryPlacement === "top" && {
|
|
226
|
+
borderBottomWidth: borderWidth,
|
|
227
|
+
borderRightWidth: borderWidth
|
|
228
|
+
},
|
|
229
|
+
...primaryPlacement === "right" && {
|
|
230
|
+
borderLeftWidth: borderWidth,
|
|
231
|
+
borderBottomWidth: borderWidth
|
|
232
|
+
},
|
|
233
|
+
...primaryPlacement === "left" && {
|
|
234
|
+
borderTopWidth: borderWidth,
|
|
235
|
+
borderRightWidth: borderWidth
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
) });
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
242
|
+
0 && (module.exports = {
|
|
243
|
+
Popper,
|
|
244
|
+
PopperAnchor,
|
|
245
|
+
PopperArrow,
|
|
246
|
+
PopperContent,
|
|
247
|
+
PopperContentFrame,
|
|
248
|
+
PopperContext,
|
|
249
|
+
usePopperContext
|
|
250
|
+
});
|
|
251
|
+
//# sourceMappingURL=Popper.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Popper.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC,kCAChC,cAUO,0BACP,kBAYO,8BACP,mBAAyB,+BACzB,gBAAuE,4BACvE,QAAuB,2BACvB,sBAAoD,yBA+H3C;AA1GF,MAAM,oBAAgB,iCAAwC,CAAC,CAAQ,GAEjE,mBAAmB,MAAM,MAAM,WAAW,aAAa;AAY7D,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,Y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AA,IAC5B,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC,GAI5B,4CAAC,yBAAsB,KAAK,MAAO,GAAG,YACpC;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,QAAQ;AAAA,QACP,GAAG;AAAA,QACH,GAAG;AAAA,QACJ,QAAO;AAAA,QACN,GAAI,qBAAqB,YAAY;AAAA,UACpC,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB;AAAA,QACC,GAAI,qBAAqB,SAAS;AAAA,UACjC,mBAAmB;AAAA,UACnB,kBAAkB;AAAA,QACpB;AAAA,QACC,GAAI,qBAAqB,WAAW;AAAA,UACnC,iBAAiB;AAAA,UACjB,mBAAmB;AAAA,QACrB;AAAA,QACC,GAAI,qBAAqB,UAAU;AAAA,UAClC,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,QACpB;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;",
|
|
5
|
+
"names": ["offsetFn", "TamaguiView"]
|
|
6
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
7
|
for (let key of __getOwnPropNames(from))
|
|
9
|
-
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
8
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
9
|
return to;
|
|
13
|
-
};
|
|
14
|
-
var
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
10
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
12
|
var src_exports = {};
|
|
17
13
|
module.exports = __toCommonJS(src_exports);
|
|
18
14
|
__reExport(src_exports, require("./Popper"), module.exports);
|