@tamagui/popper 1.113.1 → 1.114.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/esm/Popper.native.js +235 -283
- package/dist/esm/Popper.native.js.map +6 -1
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/index.native.js.map +6 -1
- package/package.json +10 -10
|
@@ -8,81 +8,65 @@ import { ThemeableStack, YStack } from "@tamagui/stacks";
|
|
|
8
8
|
import { startTransition } from "@tamagui/start-transition";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { Keyboard, useWindowDimensions } from "react-native";
|
|
11
|
-
var PopperContext = createStyledContext({}),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
hasFloating: !!data.rects.floating.width
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setupOptions = {};
|
|
11
|
+
var PopperContext = createStyledContext({}), { useStyledContext: usePopperContext, Provider: PopperProvider } = PopperContext, checkFloating = {
|
|
12
|
+
name: "checkFloating",
|
|
13
|
+
fn(data) {
|
|
14
|
+
return {
|
|
15
|
+
data: {
|
|
16
|
+
hasFloating: !!data.rects.floating.width
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}, setupOptions = {};
|
|
27
21
|
function setupPopper(options) {
|
|
28
22
|
Object.assign(setupOptions, options);
|
|
29
23
|
}
|
|
30
24
|
function Popper(props) {
|
|
31
|
-
var _middlewareData_checkFloating,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
floating = useFloating({
|
|
47
|
-
strategy,
|
|
48
|
-
placement,
|
|
49
|
-
sameScrollView: !1,
|
|
50
|
-
// this only takes effect on native
|
|
51
|
-
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
52
|
-
...platform,
|
|
53
|
-
isRTL(element) {
|
|
54
|
-
return !1;
|
|
55
|
-
}
|
|
56
|
-
} : platform,
|
|
57
|
-
middleware: [stayInFrame ? shift(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null, allowFlip ? flip(typeof allowFlip == "boolean" ? {} : allowFlip) : null, arrowEl ? arrow({
|
|
25
|
+
var _middlewareData_checkFloating, { children, size, strategy = "absolute", placement = "bottom", stayInFrame, allowFlip, offset, disableRTL, __scopePopper } = props, [arrowEl, setArrow] = React.useState(null), [arrowSize, setArrowSize] = React.useState(0), offsetOptions = offset ?? arrowSize, floating = useFloating({
|
|
26
|
+
strategy,
|
|
27
|
+
placement,
|
|
28
|
+
sameScrollView: !1,
|
|
29
|
+
// this only takes effect on native
|
|
30
|
+
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
31
|
+
...platform,
|
|
32
|
+
isRTL(element) {
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
} : platform,
|
|
36
|
+
middleware: [
|
|
37
|
+
stayInFrame ? shift(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null,
|
|
38
|
+
allowFlip ? flip(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
|
|
39
|
+
arrowEl ? arrow({
|
|
58
40
|
element: arrowEl
|
|
59
|
-
}) : null,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
React.useEffect(function
|
|
70
|
-
var showSubscription = Keyboard.addListener("keyboardDidShow", function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
}),
|
|
75
|
-
hideSubscription = Keyboard.addListener("keyboardDidHide", function () {
|
|
76
|
-
startTransition(function () {
|
|
77
|
-
setKeyboardOpen(!1);
|
|
78
|
-
});
|
|
41
|
+
}) : null,
|
|
42
|
+
typeof offsetOptions < "u" ? offsetFn(offsetOptions) : null,
|
|
43
|
+
checkFloating
|
|
44
|
+
].filter(Boolean)
|
|
45
|
+
}), {
|
|
46
|
+
refs,
|
|
47
|
+
middlewareData,
|
|
48
|
+
// @ts-expect-error this comes from Tooltip for example
|
|
49
|
+
open
|
|
50
|
+
} = floating, dimensions = useWindowDimensions(), [keyboardOpen, setKeyboardOpen] = React.useState(!1);
|
|
51
|
+
React.useEffect(function() {
|
|
52
|
+
var showSubscription = Keyboard.addListener("keyboardDidShow", function() {
|
|
53
|
+
startTransition(function() {
|
|
54
|
+
setKeyboardOpen(!0);
|
|
79
55
|
});
|
|
80
|
-
|
|
56
|
+
}), hideSubscription = Keyboard.addListener("keyboardDidHide", function() {
|
|
57
|
+
startTransition(function() {
|
|
58
|
+
setKeyboardOpen(!1);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return function() {
|
|
81
62
|
showSubscription.remove(), hideSubscription.remove();
|
|
82
63
|
};
|
|
83
|
-
}, []), useIsomorphicLayoutEffect(function
|
|
64
|
+
}, []), useIsomorphicLayoutEffect(function() {
|
|
84
65
|
floating.update();
|
|
85
|
-
}, [
|
|
66
|
+
}, [
|
|
67
|
+
dimensions,
|
|
68
|
+
keyboardOpen
|
|
69
|
+
]);
|
|
86
70
|
var popperContext = {
|
|
87
71
|
size,
|
|
88
72
|
arrowRef: setArrow,
|
|
@@ -92,235 +76,203 @@ function Popper(props) {
|
|
|
92
76
|
hasFloating: (_middlewareData_checkFloating = middlewareData.checkFloating) === null || _middlewareData_checkFloating === void 0 ? void 0 : _middlewareData_checkFloating.hasFloating,
|
|
93
77
|
...floating
|
|
94
78
|
};
|
|
95
|
-
return /* @__PURE__ */_jsx(PopperProvider, {
|
|
79
|
+
return /* @__PURE__ */ _jsx(PopperProvider, {
|
|
96
80
|
...popperContext,
|
|
97
81
|
children
|
|
98
82
|
});
|
|
99
83
|
}
|
|
100
|
-
var PopperAnchor = YStack.extractable(/* @__PURE__ */React.forwardRef(function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
PopperContentFrame = styled(ThemeableStack, {
|
|
124
|
-
name: "PopperContent",
|
|
125
|
-
variants: {
|
|
126
|
-
unstyled: {
|
|
127
|
-
false: {
|
|
128
|
-
size: "$true",
|
|
129
|
-
backgroundColor: "$background",
|
|
130
|
-
alignItems: "center",
|
|
131
|
-
radiused: !0
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
size: {
|
|
135
|
-
"...size": function (val, param) {
|
|
136
|
-
var {
|
|
137
|
-
tokens
|
|
138
|
-
} = param;
|
|
139
|
-
return {
|
|
140
|
-
padding: tokens.space[val],
|
|
141
|
-
borderRadius: tokens.radius[val]
|
|
142
|
-
};
|
|
143
|
-
}
|
|
84
|
+
var PopperAnchor = YStack.extractable(/* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
85
|
+
var { virtualRef, __scopePopper, ...anchorProps } = props, { getReferenceProps, refs } = usePopperContext(__scopePopper), ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref, refs.setReference);
|
|
86
|
+
React.useEffect(function() {
|
|
87
|
+
virtualRef && refs.setReference(virtualRef.current);
|
|
88
|
+
}, [
|
|
89
|
+
virtualRef
|
|
90
|
+
]);
|
|
91
|
+
var stackProps = {
|
|
92
|
+
ref: composedRefs,
|
|
93
|
+
...anchorProps
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ _jsx(TamaguiView, {
|
|
96
|
+
...getReferenceProps ? getReferenceProps(stackProps) : stackProps
|
|
97
|
+
});
|
|
98
|
+
})), PopperContentFrame = styled(ThemeableStack, {
|
|
99
|
+
name: "PopperContent",
|
|
100
|
+
variants: {
|
|
101
|
+
unstyled: {
|
|
102
|
+
false: {
|
|
103
|
+
size: "$true",
|
|
104
|
+
backgroundColor: "$background",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
radiused: !0
|
|
144
107
|
}
|
|
145
108
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
...rest
|
|
155
|
-
} = props,
|
|
156
|
-
{
|
|
157
|
-
strategy,
|
|
158
|
-
placement,
|
|
159
|
-
refs,
|
|
160
|
-
x,
|
|
161
|
-
y,
|
|
162
|
-
getFloatingProps,
|
|
163
|
-
size,
|
|
164
|
-
update,
|
|
165
|
-
floatingStyles,
|
|
166
|
-
hasFloating
|
|
167
|
-
} = usePopperContext(__scopePopper),
|
|
168
|
-
contentRefs = useComposedRefs(refs.setFloating, forwardedRef),
|
|
169
|
-
finalHasFloatingValue = !1;
|
|
170
|
-
if (isAndroid) {
|
|
171
|
-
var initialRender = React.useRef(!0),
|
|
172
|
-
finalHasFloating = React.useRef(!1);
|
|
173
|
-
hasFloating === !1 && (initialRender.current = !1), initialRender.current || (finalHasFloating.current = hasFloating), finalHasFloatingValue = finalHasFloating.current;
|
|
109
|
+
size: {
|
|
110
|
+
"...size": function(val, param) {
|
|
111
|
+
var { tokens } = param;
|
|
112
|
+
return {
|
|
113
|
+
padding: tokens.space[val],
|
|
114
|
+
borderRadius: tokens.radius[val]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
174
117
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
118
|
+
},
|
|
119
|
+
defaultVariants: {
|
|
120
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
121
|
+
}
|
|
122
|
+
}), PopperContent = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
123
|
+
var { __scopePopper, enableAnimationForPositionChange, ...rest } = props, { strategy, placement, refs, x, y, getFloatingProps, size, update, floatingStyles, hasFloating } = usePopperContext(__scopePopper), contentRefs = useComposedRefs(refs.setFloating, forwardedRef), finalHasFloatingValue = !1;
|
|
124
|
+
if (isAndroid) {
|
|
125
|
+
var initialRender = React.useRef(!0), finalHasFloating = React.useRef(!1);
|
|
126
|
+
hasFloating === !1 && (initialRender.current = !1), initialRender.current || (finalHasFloating.current = hasFloating), finalHasFloatingValue = finalHasFloating.current;
|
|
127
|
+
}
|
|
128
|
+
var contents = React.useMemo(function() {
|
|
129
|
+
return /* @__PURE__ */ _jsx(PopperContentFrame, {
|
|
130
|
+
"data-placement": placement,
|
|
131
|
+
"data-strategy": strategy,
|
|
132
|
+
contain: "layout",
|
|
133
|
+
size,
|
|
134
|
+
...rest
|
|
135
|
+
}, "popper-content-frame");
|
|
136
|
+
}, [
|
|
137
|
+
placement,
|
|
138
|
+
strategy,
|
|
139
|
+
props
|
|
140
|
+
]), [needsMeasure, setNeedsMeasure] = React.useState(!0);
|
|
141
|
+
React.useEffect(function() {
|
|
142
|
+
enableAnimationForPositionChange && (x || y) && setNeedsMeasure(!1);
|
|
143
|
+
}, [
|
|
144
|
+
enableAnimationForPositionChange,
|
|
145
|
+
x,
|
|
146
|
+
y
|
|
147
|
+
]);
|
|
148
|
+
var show = !0;
|
|
149
|
+
if (isAndroid) {
|
|
150
|
+
var [show_, setShow] = React.useState(!1);
|
|
151
|
+
show = show_, React.useEffect(function() {
|
|
152
|
+
finalHasFloatingValue && setShow(!0);
|
|
153
|
+
}, [
|
|
154
|
+
finalHasFloatingValue,
|
|
155
|
+
x,
|
|
156
|
+
y
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
var frameProps = {
|
|
160
|
+
ref: contentRefs,
|
|
161
|
+
x: x || 0,
|
|
162
|
+
y: y || 0,
|
|
163
|
+
top: 0,
|
|
164
|
+
left: 0,
|
|
165
|
+
position: strategy,
|
|
166
|
+
opacity: show ? 1 : 0,
|
|
167
|
+
...enableAnimationForPositionChange && {
|
|
168
|
+
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
169
|
+
animation: rest.animation,
|
|
170
|
+
animateOnly: needsMeasure ? [
|
|
171
|
+
"none"
|
|
172
|
+
] : rest.animateOnly,
|
|
173
|
+
animatePresence: !1
|
|
194
174
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
})
|
|
209
|
-
};
|
|
210
|
-
return /* @__PURE__ */_jsx(Stack, {
|
|
211
|
-
...(getFloatingProps ? getFloatingProps(frameProps) : frameProps),
|
|
212
|
-
children: contents
|
|
213
|
-
});
|
|
214
|
-
}),
|
|
215
|
-
PopperArrowFrame = styled(YStack, {
|
|
216
|
-
name: "PopperArrow",
|
|
217
|
-
variants: {
|
|
218
|
-
unstyled: {
|
|
219
|
-
false: {
|
|
220
|
-
borderColor: "$borderColor",
|
|
221
|
-
backgroundColor: "$background",
|
|
222
|
-
position: "relative"
|
|
223
|
-
}
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ _jsx(Stack, {
|
|
177
|
+
...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
|
|
178
|
+
children: contents
|
|
179
|
+
});
|
|
180
|
+
}), PopperArrowFrame = styled(YStack, {
|
|
181
|
+
name: "PopperArrow",
|
|
182
|
+
variants: {
|
|
183
|
+
unstyled: {
|
|
184
|
+
false: {
|
|
185
|
+
borderColor: "$borderColor",
|
|
186
|
+
backgroundColor: "$background",
|
|
187
|
+
position: "relative"
|
|
224
188
|
}
|
|
225
|
-
},
|
|
226
|
-
defaultVariants: {
|
|
227
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
228
189
|
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
190
|
+
},
|
|
191
|
+
defaultVariants: {
|
|
192
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
193
|
+
}
|
|
194
|
+
}), PopperArrowOuterFrame = styled(YStack, {
|
|
195
|
+
name: "PopperArrowOuter",
|
|
196
|
+
variants: {
|
|
197
|
+
unstyled: {
|
|
198
|
+
false: {
|
|
199
|
+
position: "absolute",
|
|
200
|
+
zIndex: 1e6,
|
|
201
|
+
pointerEvents: "none",
|
|
202
|
+
overflow: "hidden",
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
justifyContent: "center"
|
|
242
205
|
}
|
|
243
|
-
},
|
|
244
|
-
defaultVariants: {
|
|
245
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
246
206
|
}
|
|
247
|
-
}),
|
|
248
|
-
opposites = {
|
|
249
|
-
top: "bottom",
|
|
250
|
-
right: "left",
|
|
251
|
-
bottom: "top",
|
|
252
|
-
left: "right"
|
|
253
207
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
208
|
+
defaultVariants: {
|
|
209
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
210
|
+
}
|
|
211
|
+
}), opposites = {
|
|
212
|
+
top: "bottom",
|
|
213
|
+
right: "left",
|
|
214
|
+
bottom: "top",
|
|
215
|
+
left: "right"
|
|
216
|
+
}, PopperArrow = PopperArrowFrame.styleable(function(propsIn, forwardedRef) {
|
|
217
|
+
var _context_arrowStyle, _context_arrowStyle1, { __scopePopper, ...rest } = propsIn, props = useProps(rest), { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = props, context = usePopperContext(__scopePopper), sizeVal = typeof sizeProp == "number" ? sizeProp : getVariableValue(getSpace(sizeProp ?? context.size, {
|
|
218
|
+
shift: -2,
|
|
219
|
+
bounds: [
|
|
220
|
+
2
|
|
221
|
+
]
|
|
222
|
+
})), size = Math.max(0, +sizeVal), { placement } = context, refs = useComposedRefs(context.arrowRef, forwardedRef), x = ((_context_arrowStyle = context.arrowStyle) === null || _context_arrowStyle === void 0 ? void 0 : _context_arrowStyle.x) || 0, y = ((_context_arrowStyle1 = context.arrowStyle) === null || _context_arrowStyle1 === void 0 ? void 0 : _context_arrowStyle1.y) || 0, primaryPlacement = placement ? placement.split("-")[0] : "top", arrowStyle = {
|
|
223
|
+
x,
|
|
224
|
+
y,
|
|
225
|
+
width: size,
|
|
226
|
+
height: size
|
|
227
|
+
}, innerArrowStyle = {}, isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
228
|
+
if (primaryPlacement) {
|
|
229
|
+
arrowStyle[isVertical ? "width" : "height"] = size * 2;
|
|
230
|
+
var oppSide = opposites[primaryPlacement];
|
|
231
|
+
oppSide && (arrowStyle[oppSide] = -size, innerArrowStyle[oppSide] = size / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), useIsomorphicLayoutEffect(function() {
|
|
232
|
+
var _context_onArrowSize;
|
|
233
|
+
(_context_onArrowSize = context.onArrowSize) === null || _context_onArrowSize === void 0 || _context_onArrowSize.call(context, size);
|
|
234
|
+
}, [
|
|
235
|
+
size,
|
|
236
|
+
context.onArrowSize
|
|
237
|
+
]);
|
|
238
|
+
}
|
|
239
|
+
return /* @__PURE__ */ _jsx(PopperArrowOuterFrame, {
|
|
240
|
+
ref: refs,
|
|
241
|
+
...arrowStyle,
|
|
242
|
+
children: /* @__PURE__ */ _jsx(PopperArrowFrame, {
|
|
243
|
+
width: size,
|
|
244
|
+
height: size,
|
|
245
|
+
...arrowProps,
|
|
246
|
+
...innerArrowStyle,
|
|
247
|
+
rotate: "45deg",
|
|
248
|
+
...primaryPlacement === "bottom" && {
|
|
249
|
+
borderLeftWidth: borderWidth,
|
|
250
|
+
borderTopWidth: borderWidth
|
|
286
251
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
children: /* @__PURE__ */_jsx(PopperArrowFrame, {
|
|
301
|
-
width: size,
|
|
302
|
-
height: size,
|
|
303
|
-
...arrowProps,
|
|
304
|
-
...innerArrowStyle,
|
|
305
|
-
rotate: "45deg",
|
|
306
|
-
...(primaryPlacement === "bottom" && {
|
|
307
|
-
borderLeftWidth: borderWidth,
|
|
308
|
-
borderTopWidth: borderWidth
|
|
309
|
-
}),
|
|
310
|
-
...(primaryPlacement === "top" && {
|
|
311
|
-
borderBottomWidth: borderWidth,
|
|
312
|
-
borderRightWidth: borderWidth
|
|
313
|
-
}),
|
|
314
|
-
...(primaryPlacement === "right" && {
|
|
315
|
-
borderLeftWidth: borderWidth,
|
|
316
|
-
borderBottomWidth: borderWidth
|
|
317
|
-
}),
|
|
318
|
-
...(primaryPlacement === "left" && {
|
|
319
|
-
borderTopWidth: borderWidth,
|
|
320
|
-
borderRightWidth: borderWidth
|
|
321
|
-
})
|
|
322
|
-
})
|
|
323
|
-
});
|
|
252
|
+
...primaryPlacement === "top" && {
|
|
253
|
+
borderBottomWidth: borderWidth,
|
|
254
|
+
borderRightWidth: borderWidth
|
|
255
|
+
},
|
|
256
|
+
...primaryPlacement === "right" && {
|
|
257
|
+
borderLeftWidth: borderWidth,
|
|
258
|
+
borderBottomWidth: borderWidth
|
|
259
|
+
},
|
|
260
|
+
...primaryPlacement === "left" && {
|
|
261
|
+
borderTopWidth: borderWidth,
|
|
262
|
+
borderRightWidth: borderWidth
|
|
263
|
+
}
|
|
264
|
+
})
|
|
324
265
|
});
|
|
325
|
-
|
|
326
|
-
|
|
266
|
+
});
|
|
267
|
+
export {
|
|
268
|
+
Popper,
|
|
269
|
+
PopperAnchor,
|
|
270
|
+
PopperArrow,
|
|
271
|
+
PopperContent,
|
|
272
|
+
PopperContentFrame,
|
|
273
|
+
PopperContext,
|
|
274
|
+
PopperProvider,
|
|
275
|
+
setupPopper,
|
|
276
|
+
usePopperContext
|
|
277
|
+
};
|
|
278
|
+
//# sourceMappingURL=Popper.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/code/ui/popper/src/Popper.tsx"],
|
|
4
|
+
"mappings": ";AACA,SAASA,uBAAuB;AAChC,SAASC,WAAWC,iCAAiC;AAErD,SACEC,OACAC,QAAQC,aACRC,qBACAC,kBACAC,QAEAC,gBACK;AAQP,SACEC,OAEAC,MACAC,UAAUC,UACVC,UACAC,OACAC,mBACK;AACP,SAASC,gBAAgB;AAEzB,SAASC,gBAAgBC,cAAc;AACvC,SAASC,uBAAuB;AAChC,YAAYC,WAAW;A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AAA,SAAsB5G,IAAAA;IACxB,GAAG;MAACA;MAAM4G,QAAQ3E;KAAY;EAChC;AAGA,SACE,qBAACgE,uBAAAA;IAAsBvD,KAAKvB;IAAO,GAAGa;cACpC,qBAAC+D,kBAAAA;MACCzG,OAAOU;MACPsH,QAAQtH;MACP,GAAG+G;MACH,GAAGQ;MACJG,QAAO;MACN,GAAIN,qBAAqB,YAAY;QACpCO,iBAAiBb;QACjBc,gBAAgBd;MAClB;MACC,GAAIM,qBAAqB,SAAS;QACjCS,mBAAmBf;QACnBgB,kBAAkBhB;MACpB;MACC,GAAIM,qBAAqB,WAAW;QACnCO,iBAAiBb;QACjBe,mBAAmBf;MACrB;MACC,GAAIM,qBAAqB,UAAU;QAClCQ,gBAAgBd;QAChBgB,kBAAkBhB;MACpB;;;AAIR,CAAA;",
|
|
5
|
+
"names": ["useComposedRefs", "isAndroid", "useIsomorphicLayoutEffect", "Stack", "View", "TamaguiView", "createStyledContext", "getVariableValue", "styled", "useProps", "arrow", "flip", "offset", "offsetFn", "platform", "shift", "useFloating", "getSpace", "ThemeableStack", "YStack", "startTransition", "React", "Keyboard", "useWindowDimensions", "PopperContext", "useStyledContext", "usePopperContext", "Provider", "PopperProvider", "checkFloating", "name", "fn", "data", "hasFloating", "rects", "floating", "width", "setupOptions", "setupPopper", "options", "Object", "assign", "Popper", "props", "middlewareData", "children", "size", "strategy", "placement", "stayInFrame", "allowFlip", "disableRTL", "__scopePopper", "arrowEl", "setArrow", "useState", "arrowSize", "setArrowSize", "offsetOptions", "sameScrollView", "isRTL", "element", "middleware", "filter", "Boolean", "refs", "open", "dimensions", "keyboardOpen", "setKeyboardOpen", "useEffect", "showSubscription", "addListener", "hideSubscription", "remove", "update", "popperContext", "arrowRef", "arrowStyle", "onArrowSize", "scope", "PopperAnchor", "extractable", "forwardRef", "forwardedRef", "virtualRef", "anchorProps", "getReferenceProps", "ref", "useRef", "composedRefs", "setReference", "current", "stackProps", "PopperContentFrame", "variants", "unstyled", "false", "backgroundColor", "alignItems", "radiused", "val", "tokens", "padding", "space", "borderRadius", "radius", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "PopperContent", "enableAnimationForPositionChange", "rest", "x", "y", "getFloatingProps", "floatingStyles", "contentRefs", "setFloating", "finalHasFloatingValue", "initialRender", "finalHasFloating", "contents", "useMemo", "data-placement", "data-strategy", "contain", "needsMeasure", "setNeedsMeasure", "show", "show_", "setShow", "frameProps", "top", "left", "position", "opacity", "animation", "animateOnly", "animatePresence", "PopperArrowFrame", "borderColor", "PopperArrowOuterFrame", "zIndex", "pointerEvents", "overflow", "justifyContent", "opposites", "right", "bottom", "PopperArrow", "styleable", "propsIn", "context", "sizeProp", "borderWidth", "arrowProps", "sizeVal", "bounds", "Math", "max", "primaryPlacement", "split", "height", "innerArrowStyle", "isVertical", "oppSide", "rotate", "borderLeftWidth", "borderTopWidth", "borderBottomWidth", "borderRightWidth"]
|
|
6
|
+
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Popper
|
|
2
|
-
//# sourceMappingURL=index.
|
|
1
|
+
export * from "./Popper";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/popper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.114.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/compose-refs": "1.
|
|
37
|
-
"@tamagui/constants": "1.
|
|
38
|
-
"@tamagui/core": "1.
|
|
39
|
-
"@tamagui/floating": "1.
|
|
40
|
-
"@tamagui/get-token": "1.
|
|
41
|
-
"@tamagui/stacks": "1.
|
|
42
|
-
"@tamagui/start-transition": "1.
|
|
43
|
-
"@tamagui/use-controllable-state": "1.
|
|
36
|
+
"@tamagui/compose-refs": "1.114.0",
|
|
37
|
+
"@tamagui/constants": "1.114.0",
|
|
38
|
+
"@tamagui/core": "1.114.0",
|
|
39
|
+
"@tamagui/floating": "1.114.0",
|
|
40
|
+
"@tamagui/get-token": "1.114.0",
|
|
41
|
+
"@tamagui/stacks": "1.114.0",
|
|
42
|
+
"@tamagui/start-transition": "1.114.0",
|
|
43
|
+
"@tamagui/use-controllable-state": "1.114.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "*"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "1.
|
|
49
|
+
"@tamagui/build": "1.114.0",
|
|
50
50
|
"react": "^18.2.0 || ^19.0.0",
|
|
51
51
|
"react-native": "0.74.1"
|
|
52
52
|
},
|