@tamagui/popper 1.130.8 → 1.131.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.cjs +79 -36
- package/dist/cjs/Popper.js +105 -70
- package/dist/cjs/Popper.js.map +1 -1
- package/dist/cjs/Popper.native.js +75 -28
- package/dist/cjs/Popper.native.js.map +2 -2
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/Popper.js +107 -73
- package/dist/esm/Popper.js.map +1 -1
- package/dist/esm/Popper.mjs +76 -36
- package/dist/esm/Popper.mjs.map +1 -1
- package/dist/esm/Popper.native.js +82 -35
- package/dist/esm/Popper.native.js.map +1 -1
- package/dist/jsx/Popper.js +107 -73
- package/dist/jsx/Popper.js.map +1 -1
- package/dist/jsx/Popper.mjs +76 -36
- package/dist/jsx/Popper.mjs.map +1 -1
- package/dist/jsx/Popper.native.js +70 -26
- package/dist/jsx/Popper.native.js.map +2 -2
- package/package.json +10 -10
- package/src/Popper.tsx +178 -118
- package/types/Popper.d.ts +58 -28
- package/types/Popper.d.ts.map +1 -1
package/dist/cjs/Popper.cjs
CHANGED
|
@@ -34,15 +34,18 @@ __export(Popper_exports, {
|
|
|
34
34
|
Popper: () => Popper,
|
|
35
35
|
PopperAnchor: () => PopperAnchor,
|
|
36
36
|
PopperArrow: () => PopperArrow,
|
|
37
|
+
PopperArrowFrame: () => PopperArrowFrame,
|
|
37
38
|
PopperContent: () => PopperContent,
|
|
38
39
|
PopperContentFrame: () => PopperContentFrame,
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
PopperContextFast: () => PopperContextFast,
|
|
41
|
+
PopperContextSlow: () => PopperContextSlow,
|
|
41
42
|
PopperPositionContext: () => PopperPositionContext,
|
|
42
43
|
PopperProvider: () => PopperProvider,
|
|
44
|
+
PopperProviderFast: () => PopperProviderFast,
|
|
45
|
+
PopperProviderSlow: () => PopperProviderSlow,
|
|
43
46
|
setupPopper: () => setupPopper,
|
|
44
47
|
usePopperContext: () => usePopperContext,
|
|
45
|
-
|
|
48
|
+
usePopperContextSlow: () => usePopperContextSlow
|
|
46
49
|
});
|
|
47
50
|
module.exports = __toCommonJS(Popper_exports);
|
|
48
51
|
var import_compose_refs = require("@tamagui/compose-refs"),
|
|
@@ -55,17 +58,53 @@ var import_compose_refs = require("@tamagui/compose-refs"),
|
|
|
55
58
|
React = __toESM(require("react")),
|
|
56
59
|
import_react_native = require("react-native-web"),
|
|
57
60
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
-
const
|
|
61
|
+
const PopperContextFast = (0, import_core.createStyledContext)(
|
|
62
|
+
// since we always provide this we can avoid setting here
|
|
63
|
+
{}, "Popper__"),
|
|
59
64
|
PopperPositionContext = import_core.createStyledContext,
|
|
60
65
|
{
|
|
61
66
|
useStyledContext: usePopperContext,
|
|
62
|
-
Provider:
|
|
63
|
-
} =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
Provider: PopperProviderFast
|
|
68
|
+
} = PopperContextFast,
|
|
69
|
+
PopperContextSlow = (0, import_core.createStyledContext)(
|
|
70
|
+
// since we always provide this we can avoid setting here
|
|
71
|
+
{}, "PopperSlow__"),
|
|
72
|
+
{
|
|
73
|
+
useStyledContext: usePopperContextSlow,
|
|
74
|
+
Provider: PopperProviderSlow
|
|
75
|
+
} = PopperContextSlow,
|
|
76
|
+
PopperProvider = ({
|
|
77
|
+
scope,
|
|
78
|
+
children,
|
|
79
|
+
...context
|
|
80
|
+
}) => {
|
|
81
|
+
const slowContext = getContextSlow(context);
|
|
82
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderFast, {
|
|
83
|
+
scope,
|
|
84
|
+
...context,
|
|
85
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderSlow, {
|
|
86
|
+
scope,
|
|
87
|
+
...slowContext,
|
|
88
|
+
children
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
function getContextSlow(context) {
|
|
93
|
+
return {
|
|
94
|
+
refs: context.refs,
|
|
95
|
+
size: context.size,
|
|
96
|
+
arrowRef: context.arrowRef,
|
|
97
|
+
arrowStyle: context.arrowStyle,
|
|
98
|
+
onArrowSize: context.onArrowSize,
|
|
99
|
+
hasFloating: context.hasFloating,
|
|
100
|
+
strategy: context.strategy,
|
|
101
|
+
update: context.update,
|
|
102
|
+
context: context.context,
|
|
103
|
+
getFloatingProps: context.getFloatingProps,
|
|
104
|
+
getReferenceProps: context.getFloatingProps
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const checkFloating = void 0,
|
|
69
108
|
setupOptions = {};
|
|
70
109
|
function setupPopper(options) {
|
|
71
110
|
Object.assign(setupOptions, options);
|
|
@@ -83,7 +122,7 @@ function Popper(props) {
|
|
|
83
122
|
resize,
|
|
84
123
|
passThrough,
|
|
85
124
|
open,
|
|
86
|
-
|
|
125
|
+
scope
|
|
87
126
|
} = props,
|
|
88
127
|
[arrowEl, setArrow] = React.useState(null),
|
|
89
128
|
[arrowSize, setArrowSize] = React.useState(0),
|
|
@@ -138,39 +177,43 @@ function Popper(props) {
|
|
|
138
177
|
arrowRef: setArrow,
|
|
139
178
|
arrowStyle: middlewareData.arrow,
|
|
140
179
|
onArrowSize: setArrowSize,
|
|
141
|
-
scope: __scopePopper,
|
|
142
180
|
hasFloating: middlewareData.checkFloating?.hasFloating,
|
|
143
181
|
...floating
|
|
144
182
|
};
|
|
145
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
children
|
|
150
|
-
})
|
|
183
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProvider, {
|
|
184
|
+
scope,
|
|
185
|
+
...popperContext,
|
|
186
|
+
children
|
|
151
187
|
});
|
|
152
188
|
}
|
|
153
189
|
const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function (props, forwardedRef) {
|
|
154
190
|
const {
|
|
155
191
|
virtualRef,
|
|
156
|
-
|
|
192
|
+
scope,
|
|
157
193
|
...anchorProps
|
|
158
194
|
} = props,
|
|
159
195
|
{
|
|
160
196
|
getReferenceProps,
|
|
161
|
-
refs
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
197
|
+
refs,
|
|
198
|
+
update
|
|
199
|
+
} = usePopperContextSlow(scope),
|
|
200
|
+
ref = React.useRef(null);
|
|
165
201
|
React.useEffect(() => {
|
|
166
202
|
virtualRef && refs.setReference(virtualRef.current);
|
|
167
203
|
}, [virtualRef]);
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
...anchorProps
|
|
171
|
-
};
|
|
204
|
+
const refProps = getReferenceProps ? getReferenceProps(anchorProps) : null,
|
|
205
|
+
composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
172
206
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
173
|
-
...
|
|
207
|
+
...refProps,
|
|
208
|
+
ref: composedRefs,
|
|
209
|
+
onMouseEnter: e => {
|
|
210
|
+
ref.current instanceof HTMLElement && (refs.setReference(ref.current), setTimeout(() => {
|
|
211
|
+
refProps.onPointerEnter?.(e), update();
|
|
212
|
+
}));
|
|
213
|
+
},
|
|
214
|
+
onMouseLeave: e => {
|
|
215
|
+
refProps?.onMouseLeave?.(e), refs.setReference(null);
|
|
216
|
+
}
|
|
174
217
|
});
|
|
175
218
|
})),
|
|
176
219
|
PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
@@ -199,7 +242,7 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
199
242
|
}),
|
|
200
243
|
PopperContent = React.forwardRef(function (props, forwardedRef) {
|
|
201
244
|
const {
|
|
202
|
-
|
|
245
|
+
scope,
|
|
203
246
|
enableAnimationForPositionChange,
|
|
204
247
|
children,
|
|
205
248
|
passThrough,
|
|
@@ -213,7 +256,7 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
213
256
|
y,
|
|
214
257
|
getFloatingProps,
|
|
215
258
|
size
|
|
216
|
-
} = usePopperContext(
|
|
259
|
+
} = usePopperContext(scope),
|
|
217
260
|
contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef),
|
|
218
261
|
[needsMeasure, setNeedsMeasure] = React.useState(enableAnimationForPositionChange);
|
|
219
262
|
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
@@ -229,9 +272,9 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
229
272
|
position: strategy,
|
|
230
273
|
opacity: 1,
|
|
231
274
|
...(enableAnimationForPositionChange && {
|
|
232
|
-
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
233
275
|
animation: rest.animation,
|
|
234
276
|
animateOnly: needsMeasure ? [] : rest.animateOnly,
|
|
277
|
+
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
235
278
|
animatePresence: !1
|
|
236
279
|
}),
|
|
237
280
|
...(hide && {
|
|
@@ -243,7 +286,7 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
243
286
|
style,
|
|
244
287
|
...floatingProps
|
|
245
288
|
} = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
|
|
246
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.
|
|
289
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
247
290
|
passThrough,
|
|
248
291
|
ref: contentRefs,
|
|
249
292
|
...(passThrough ? null : floatingProps),
|
|
@@ -300,9 +343,9 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
300
343
|
bottom: "top",
|
|
301
344
|
left: "right"
|
|
302
345
|
},
|
|
303
|
-
PopperArrow =
|
|
346
|
+
PopperArrow = React.forwardRef(function (propsIn, forwardedRef) {
|
|
304
347
|
const {
|
|
305
|
-
|
|
348
|
+
scope,
|
|
306
349
|
...rest
|
|
307
350
|
} = propsIn,
|
|
308
351
|
props = (0, import_core.useProps)(rest),
|
|
@@ -312,7 +355,7 @@ const PopperAnchor = import_stacks.YStack.extractable(React.forwardRef(function
|
|
|
312
355
|
borderWidth = 0,
|
|
313
356
|
...arrowProps
|
|
314
357
|
} = props,
|
|
315
|
-
context = usePopperContext(
|
|
358
|
+
context = usePopperContext(scope),
|
|
316
359
|
sizeVal = typeof sizeProp == "number" ? sizeProp : (0, import_core.getVariableValue)((0, import_get_token.getSpace)(sizeProp ?? context.size, {
|
|
317
360
|
shift: -2,
|
|
318
361
|
bounds: [2]
|
package/dist/cjs/Popper.js
CHANGED
|
@@ -25,21 +25,53 @@ __export(Popper_exports, {
|
|
|
25
25
|
Popper: () => Popper,
|
|
26
26
|
PopperAnchor: () => PopperAnchor,
|
|
27
27
|
PopperArrow: () => PopperArrow,
|
|
28
|
+
PopperArrowFrame: () => PopperArrowFrame,
|
|
28
29
|
PopperContent: () => PopperContent,
|
|
29
30
|
PopperContentFrame: () => PopperContentFrame,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
PopperContextFast: () => PopperContextFast,
|
|
32
|
+
PopperContextSlow: () => PopperContextSlow,
|
|
32
33
|
PopperPositionContext: () => PopperPositionContext,
|
|
33
34
|
PopperProvider: () => PopperProvider,
|
|
35
|
+
PopperProviderFast: () => PopperProviderFast,
|
|
36
|
+
PopperProviderSlow: () => PopperProviderSlow,
|
|
34
37
|
setupPopper: () => setupPopper,
|
|
35
38
|
usePopperContext: () => usePopperContext,
|
|
36
|
-
|
|
39
|
+
usePopperContextSlow: () => usePopperContextSlow
|
|
37
40
|
});
|
|
38
41
|
module.exports = __toCommonJS(Popper_exports);
|
|
39
42
|
var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_floating = require("@tamagui/floating"), import_get_token = require("@tamagui/get-token"), import_stacks = require("@tamagui/stacks"), import_start_transition = require("@tamagui/start-transition"), React = __toESM(require("react")), import_react_native = require("react-native-web"), import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
+
const PopperContextFast = (0, import_core.createStyledContext)(
|
|
44
|
+
// since we always provide this we can avoid setting here
|
|
45
|
+
{},
|
|
46
|
+
"Popper__"
|
|
47
|
+
), PopperPositionContext = import_core.createStyledContext, { useStyledContext: usePopperContext, Provider: PopperProviderFast } = PopperContextFast, PopperContextSlow = (0, import_core.createStyledContext)(
|
|
48
|
+
// since we always provide this we can avoid setting here
|
|
49
|
+
{},
|
|
50
|
+
"PopperSlow__"
|
|
51
|
+
), { useStyledContext: usePopperContextSlow, Provider: PopperProviderSlow } = PopperContextSlow, PopperProvider = ({
|
|
52
|
+
scope,
|
|
53
|
+
children,
|
|
54
|
+
...context
|
|
55
|
+
}) => {
|
|
56
|
+
const slowContext = getContextSlow(context);
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProviderFast, { scope, ...context, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProviderSlow, { scope, ...slowContext, children }) });
|
|
58
|
+
};
|
|
59
|
+
function getContextSlow(context) {
|
|
60
|
+
return {
|
|
61
|
+
refs: context.refs,
|
|
62
|
+
size: context.size,
|
|
63
|
+
arrowRef: context.arrowRef,
|
|
64
|
+
arrowStyle: context.arrowStyle,
|
|
65
|
+
onArrowSize: context.onArrowSize,
|
|
66
|
+
hasFloating: context.hasFloating,
|
|
67
|
+
strategy: context.strategy,
|
|
68
|
+
update: context.update,
|
|
69
|
+
context: context.context,
|
|
70
|
+
getFloatingProps: context.getFloatingProps,
|
|
71
|
+
getReferenceProps: context.getFloatingProps
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const checkFloating = void 0, setupOptions = {};
|
|
43
75
|
function setupPopper(options) {
|
|
44
76
|
Object.assign(setupOptions, options);
|
|
45
77
|
}
|
|
@@ -56,7 +88,7 @@ function Popper(props) {
|
|
|
56
88
|
resize,
|
|
57
89
|
passThrough,
|
|
58
90
|
open,
|
|
59
|
-
|
|
91
|
+
scope
|
|
60
92
|
} = props, [arrowEl, setArrow] = React.useState(null), [arrowSize, setArrowSize] = React.useState(0), offsetOptions = offset ?? arrowSize, floatingStyle = React.useRef({});
|
|
61
93
|
let floating = (0, import_floating.useFloating)({
|
|
62
94
|
open: passThrough ? !1 : open || !0,
|
|
@@ -107,27 +139,32 @@ function Popper(props) {
|
|
|
107
139
|
arrowRef: setArrow,
|
|
108
140
|
arrowStyle: middlewareData.arrow,
|
|
109
141
|
onArrowSize: setArrowSize,
|
|
110
|
-
scope: __scopePopper,
|
|
111
142
|
hasFloating: middlewareData.checkFloating?.hasFloating,
|
|
112
143
|
...floating
|
|
113
144
|
};
|
|
114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProvider, { scope, ...popperContext, children });
|
|
115
146
|
}
|
|
116
147
|
const PopperAnchor = import_stacks.YStack.extractable(
|
|
117
148
|
React.forwardRef(
|
|
118
149
|
function(props, forwardedRef) {
|
|
119
|
-
const { virtualRef,
|
|
150
|
+
const { virtualRef, scope, ...anchorProps } = props, { getReferenceProps, refs, update } = usePopperContextSlow(scope), ref = React.useRef(null);
|
|
120
151
|
React.useEffect(() => {
|
|
121
152
|
virtualRef && refs.setReference(virtualRef.current);
|
|
122
153
|
}, [virtualRef]);
|
|
123
|
-
const
|
|
124
|
-
ref: composedRefs,
|
|
125
|
-
...anchorProps
|
|
126
|
-
};
|
|
154
|
+
const refProps = getReferenceProps ? getReferenceProps(anchorProps) : null, composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
127
155
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
156
|
import_core.View,
|
|
129
157
|
{
|
|
130
|
-
...
|
|
158
|
+
...refProps,
|
|
159
|
+
ref: composedRefs,
|
|
160
|
+
onMouseEnter: (e) => {
|
|
161
|
+
ref.current instanceof HTMLElement && (refs.setReference(ref.current), setTimeout(() => {
|
|
162
|
+
refProps.onPointerEnter?.(e), update();
|
|
163
|
+
}));
|
|
164
|
+
},
|
|
165
|
+
onMouseLeave: (e) => {
|
|
166
|
+
refProps?.onMouseLeave?.(e), refs.setReference(null);
|
|
167
|
+
}
|
|
131
168
|
}
|
|
132
169
|
);
|
|
133
170
|
}
|
|
@@ -153,61 +190,59 @@ const PopperAnchor = import_stacks.YStack.extractable(
|
|
|
153
190
|
defaultVariants: {
|
|
154
191
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
155
192
|
}
|
|
156
|
-
}), PopperContent = React.forwardRef(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
needsMeasure && x && y && setNeedsMeasure(!1);
|
|
166
|
-
}, [needsMeasure, enableAnimationForPositionChange, x, y]);
|
|
167
|
-
const hide = x === 0 && y === 0, frameProps = {
|
|
168
|
-
ref: contentRefs,
|
|
169
|
-
x: x || 0,
|
|
170
|
-
y: y || 0,
|
|
171
|
-
top: 0,
|
|
172
|
-
left: 0,
|
|
173
|
-
position: strategy,
|
|
174
|
-
opacity: 1,
|
|
175
|
-
...enableAnimationForPositionChange && {
|
|
176
|
-
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
177
|
-
animation: rest.animation,
|
|
178
|
-
animateOnly: needsMeasure ? [] : rest.animateOnly,
|
|
179
|
-
animatePresence: !1
|
|
180
|
-
},
|
|
181
|
-
...hide && {
|
|
182
|
-
opacity: 0,
|
|
183
|
-
animateOnly: []
|
|
184
|
-
}
|
|
185
|
-
}, { style, ...floatingProps } = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
|
|
186
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
-
import_core.Stack,
|
|
188
|
-
{
|
|
189
|
-
passThrough,
|
|
193
|
+
}), PopperContent = React.forwardRef(
|
|
194
|
+
function(props, forwardedRef) {
|
|
195
|
+
const { scope, enableAnimationForPositionChange, children, passThrough, ...rest } = props, { strategy, placement, refs, x, y, getFloatingProps, size } = usePopperContext(scope), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), [needsMeasure, setNeedsMeasure] = React.useState(
|
|
196
|
+
enableAnimationForPositionChange
|
|
197
|
+
);
|
|
198
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
199
|
+
needsMeasure && x && y && setNeedsMeasure(!1);
|
|
200
|
+
}, [needsMeasure, enableAnimationForPositionChange, x, y]);
|
|
201
|
+
const hide = x === 0 && y === 0, frameProps = {
|
|
190
202
|
ref: contentRefs,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
x: x || 0,
|
|
204
|
+
y: y || 0,
|
|
205
|
+
top: 0,
|
|
206
|
+
left: 0,
|
|
207
|
+
position: strategy,
|
|
208
|
+
opacity: 1,
|
|
209
|
+
...enableAnimationForPositionChange && {
|
|
210
|
+
animation: rest.animation,
|
|
211
|
+
animateOnly: needsMeasure ? [] : rest.animateOnly,
|
|
212
|
+
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
213
|
+
animatePresence: !1
|
|
214
|
+
},
|
|
215
|
+
...hide && {
|
|
216
|
+
opacity: 0,
|
|
217
|
+
animateOnly: []
|
|
218
|
+
}
|
|
219
|
+
}, { style, ...floatingProps } = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
221
|
+
import_core.View,
|
|
222
|
+
{
|
|
223
|
+
passThrough,
|
|
224
|
+
ref: contentRefs,
|
|
225
|
+
...passThrough ? null : floatingProps,
|
|
226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
227
|
+
PopperContentFrame,
|
|
228
|
+
{
|
|
229
|
+
passThrough,
|
|
230
|
+
...!passThrough && {
|
|
231
|
+
"data-placement": placement,
|
|
232
|
+
"data-strategy": strategy,
|
|
233
|
+
contain: "layout",
|
|
234
|
+
size,
|
|
235
|
+
...style,
|
|
236
|
+
...rest
|
|
237
|
+
},
|
|
238
|
+
children
|
|
203
239
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}), PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
240
|
+
"popper-content-frame"
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
), PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
211
246
|
name: "PopperArrow",
|
|
212
247
|
variants: {
|
|
213
248
|
unstyled: {
|
|
@@ -243,9 +278,9 @@ const PopperAnchor = import_stacks.YStack.extractable(
|
|
|
243
278
|
right: "left",
|
|
244
279
|
bottom: "top",
|
|
245
280
|
left: "right"
|
|
246
|
-
}, PopperArrow =
|
|
281
|
+
}, PopperArrow = React.forwardRef(
|
|
247
282
|
function(propsIn, forwardedRef) {
|
|
248
|
-
const {
|
|
283
|
+
const { scope, ...rest } = propsIn, props = (0, import_core.useProps)(rest), { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = props, context = usePopperContext(scope), sizeVal = typeof sizeProp == "number" ? sizeProp : (0, import_core.getVariableValue)(
|
|
249
284
|
(0, import_get_token.getSpace)(sizeProp ?? context.size, {
|
|
250
285
|
shift: -2,
|
|
251
286
|
bounds: [2]
|
package/dist/cjs/Popper.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"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