@tamagui/popper 1.89.26 → 1.89.27-1708113113238
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.native.js +231 -143
- package/dist/cjs/Popper.native.js.map +3 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/Popper.native.js +232 -160
- package/dist/esm/Popper.native.js.map +3 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Popper.native.js +232 -160
- package/dist/jsx/Popper.native.js.map +3 -3
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +10 -10
|
@@ -33,90 +33,172 @@ __export(Popper_exports, {
|
|
|
33
33
|
usePopperContext: () => usePopperContext
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(Popper_exports);
|
|
36
|
-
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"), React = __toESM(require("react")), import_react_native = require("react-native")
|
|
37
|
-
|
|
36
|
+
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"), React = __toESM(require("react")), import_react_native = require("react-native");
|
|
37
|
+
function _array_like_to_array(arr, len) {
|
|
38
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
39
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
40
|
+
arr2[i] = arr[i];
|
|
41
|
+
return arr2;
|
|
42
|
+
}
|
|
43
|
+
function _array_with_holes(arr) {
|
|
44
|
+
if (Array.isArray(arr))
|
|
45
|
+
return arr;
|
|
46
|
+
}
|
|
47
|
+
function _define_property(obj, key, value) {
|
|
48
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
49
|
+
value,
|
|
50
|
+
enumerable: !0,
|
|
51
|
+
configurable: !0,
|
|
52
|
+
writable: !0
|
|
53
|
+
}) : obj[key] = value, obj;
|
|
54
|
+
}
|
|
55
|
+
function _iterable_to_array_limit(arr, i) {
|
|
56
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
57
|
+
if (_i != null) {
|
|
58
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
59
|
+
try {
|
|
60
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
61
|
+
;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
_d = !0, _e = err;
|
|
64
|
+
} finally {
|
|
65
|
+
try {
|
|
66
|
+
!_n && _i.return != null && _i.return();
|
|
67
|
+
} finally {
|
|
68
|
+
if (_d)
|
|
69
|
+
throw _e;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return _arr;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function _non_iterable_rest() {
|
|
76
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
+
}
|
|
78
|
+
function _object_spread(target) {
|
|
79
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
80
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
81
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
82
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
83
|
+
}))), ownKeys2.forEach(function(key) {
|
|
84
|
+
_define_property(target, key, source[key]);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
function ownKeys(object, enumerableOnly) {
|
|
90
|
+
var keys = Object.keys(object);
|
|
91
|
+
if (Object.getOwnPropertySymbols) {
|
|
92
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
93
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
94
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
95
|
+
})), keys.push.apply(keys, symbols);
|
|
96
|
+
}
|
|
97
|
+
return keys;
|
|
98
|
+
}
|
|
99
|
+
function _object_spread_props(target, source) {
|
|
100
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
101
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
102
|
+
}), target;
|
|
103
|
+
}
|
|
104
|
+
function _object_without_properties(source, excluded) {
|
|
105
|
+
if (source == null)
|
|
106
|
+
return {};
|
|
107
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
108
|
+
if (Object.getOwnPropertySymbols) {
|
|
109
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
110
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
111
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
112
|
+
}
|
|
113
|
+
return target;
|
|
114
|
+
}
|
|
115
|
+
function _object_without_properties_loose(source, excluded) {
|
|
116
|
+
if (source == null)
|
|
117
|
+
return {};
|
|
118
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
119
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
120
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
121
|
+
return target;
|
|
122
|
+
}
|
|
123
|
+
function _sliced_to_array(arr, i) {
|
|
124
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
125
|
+
}
|
|
126
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
127
|
+
if (o) {
|
|
128
|
+
if (typeof o == "string")
|
|
129
|
+
return _array_like_to_array(o, minLen);
|
|
130
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
131
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
132
|
+
return Array.from(n);
|
|
133
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
134
|
+
return _array_like_to_array(o, minLen);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
var PopperContext = (0, import_core.createStyledContext)({}), usePopperContext = PopperContext.useStyledContext, PopperProvider = PopperContext.Provider;
|
|
38
138
|
function Popper(props) {
|
|
39
|
-
|
|
40
|
-
children,
|
|
41
|
-
size,
|
|
42
|
-
strategy = "absolute",
|
|
43
|
-
placement = "bottom",
|
|
44
|
-
stayInFrame,
|
|
45
|
-
allowFlip,
|
|
46
|
-
offset,
|
|
47
|
-
__scopePopper
|
|
48
|
-
} = props, isMounted = (0, import_core.useDidFinishSSR)(), [arrowEl, setArrow] = React.useState(null), [arrowSize, setArrowSize] = React.useState(0), offsetOptions = offset ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
139
|
+
var children = props.children, size = props.size, _props_strategy = props.strategy, strategy = _props_strategy === void 0 ? "absolute" : _props_strategy, _props_placement = props.placement, placement = _props_placement === void 0 ? "bottom" : _props_placement, stayInFrame = props.stayInFrame, allowFlip = props.allowFlip, offset = props.offset, __scopePopper = props.__scopePopper, isMounted = (0, import_core.useDidFinishSSR)(), _React_useState = _sliced_to_array(React.useState(null), 2), arrowEl = _React_useState[0], setArrow = _React_useState[1], _React_useState1 = _sliced_to_array(React.useState(0), 2), arrowSize = _React_useState1[0], setArrowSize = _React_useState1[1], offsetOptions = offset ?? arrowSize, floating = (0, import_floating.useFloating)({
|
|
49
140
|
strategy,
|
|
50
141
|
placement,
|
|
51
142
|
sameScrollView: !1,
|
|
52
|
-
// this only takes effect on native
|
|
53
143
|
middleware: [
|
|
54
144
|
stayInFrame ? (0, import_floating.shift)(typeof stayInFrame == "boolean" ? {} : stayInFrame) : null,
|
|
55
145
|
allowFlip ? (0, import_floating.flip)(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
|
|
56
|
-
arrowEl ? (0, import_floating.arrow)({
|
|
146
|
+
arrowEl ? (0, import_floating.arrow)({
|
|
147
|
+
element: arrowEl
|
|
148
|
+
}) : null,
|
|
57
149
|
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null
|
|
58
150
|
].filter(Boolean)
|
|
59
|
-
}),
|
|
60
|
-
refs,
|
|
61
|
-
middlewareData,
|
|
62
|
-
// @ts-expect-error this comes from Tooltip for example
|
|
63
|
-
open,
|
|
64
|
-
floatingStyles
|
|
65
|
-
} = floating;
|
|
151
|
+
}), refs = floating.refs, middlewareData = floating.middlewareData, open = floating.open, floatingStyles = floating.floatingStyles;
|
|
66
152
|
if (import_constants.isWeb)
|
|
67
|
-
(0, import_constants.useIsomorphicLayoutEffect)(()
|
|
153
|
+
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
68
154
|
if (open && refs.reference.current && refs.floating.current)
|
|
69
155
|
return (0, import_floating.autoUpdate)(refs.reference.current, refs.floating.current, floating.update);
|
|
70
|
-
}, [
|
|
156
|
+
}, [
|
|
157
|
+
open,
|
|
158
|
+
floating.update,
|
|
159
|
+
refs.floating,
|
|
160
|
+
refs.reference
|
|
161
|
+
]);
|
|
71
162
|
else {
|
|
72
|
-
|
|
73
|
-
React.useEffect(()
|
|
74
|
-
|
|
163
|
+
var dimensions = (0, import_react_native.useWindowDimensions)(), _React_useState2 = _sliced_to_array(React.useState(!1), 2), keyboardOpen = _React_useState2[0], setKeyboardOpen = _React_useState2[1];
|
|
164
|
+
React.useEffect(function() {
|
|
165
|
+
var showSubscription = import_react_native.Keyboard.addListener("keyboardDidShow", function() {
|
|
75
166
|
setKeyboardOpen(!0);
|
|
76
|
-
}), hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", ()
|
|
167
|
+
}), hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", function() {
|
|
77
168
|
setKeyboardOpen(!1);
|
|
78
169
|
});
|
|
79
|
-
return ()
|
|
170
|
+
return function() {
|
|
80
171
|
showSubscription.remove(), hideSubscription.remove();
|
|
81
172
|
};
|
|
82
|
-
}, []), (0, import_constants.useIsomorphicLayoutEffect)(()
|
|
173
|
+
}, []), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
83
174
|
floating.update();
|
|
84
|
-
}, [
|
|
175
|
+
}, [
|
|
176
|
+
dimensions,
|
|
177
|
+
keyboardOpen
|
|
178
|
+
]);
|
|
85
179
|
}
|
|
86
|
-
|
|
180
|
+
var popperContext = _object_spread({
|
|
87
181
|
size,
|
|
88
182
|
arrowRef: setArrow,
|
|
89
183
|
arrowStyle: middlewareData.arrow,
|
|
90
184
|
onArrowSize: setArrowSize,
|
|
91
185
|
isMounted,
|
|
92
|
-
scope: __scopePopper
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProvider, { ...popperContext, children });
|
|
186
|
+
scope: __scopePopper
|
|
187
|
+
}, floating);
|
|
188
|
+
return /* @__PURE__ */ React.createElement(PopperProvider, popperContext, children);
|
|
96
189
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
...anchorProps
|
|
110
|
-
};
|
|
111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
-
import_core.View,
|
|
113
|
-
{
|
|
114
|
-
...getReferenceProps ? getReferenceProps(stackProps) : stackProps
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
), PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
190
|
+
var PopperAnchor = import_stacks.YStack.extractable(/* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
191
|
+
var virtualRef = props.virtualRef, __scopePopper = props.__scopePopper, anchorProps = _object_without_properties(props, [
|
|
192
|
+
"virtualRef",
|
|
193
|
+
"__scopePopper"
|
|
194
|
+
]), _usePopperContext = usePopperContext(__scopePopper), getReferenceProps = _usePopperContext.getReferenceProps, refs = _usePopperContext.refs, ref = React.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, virtualRef ?? refs.setReference);
|
|
195
|
+
if (virtualRef)
|
|
196
|
+
return null;
|
|
197
|
+
var stackProps = _object_spread({
|
|
198
|
+
ref: composedRefs
|
|
199
|
+
}, anchorProps);
|
|
200
|
+
return /* @__PURE__ */ React.createElement(import_core.View, getReferenceProps ? getReferenceProps(stackProps) : stackProps);
|
|
201
|
+
})), PopperContentFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
120
202
|
name: "PopperContent",
|
|
121
203
|
variants: {
|
|
122
204
|
unstyled: {
|
|
@@ -128,63 +210,64 @@ const PopperAnchor = import_stacks.YStack.extractable(
|
|
|
128
210
|
}
|
|
129
211
|
},
|
|
130
212
|
size: {
|
|
131
|
-
"...size": (val,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
213
|
+
"...size": function(val, param) {
|
|
214
|
+
var tokens = param.tokens;
|
|
215
|
+
return {
|
|
216
|
+
padding: tokens.space[val],
|
|
217
|
+
borderRadius: tokens.radius[val]
|
|
218
|
+
};
|
|
219
|
+
}
|
|
135
220
|
}
|
|
136
221
|
},
|
|
137
222
|
defaultVariants: {
|
|
138
223
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
139
224
|
}
|
|
140
|
-
}), PopperContent = React.forwardRef(function(props, forwardedRef) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
getFloatingProps,
|
|
148
|
-
size,
|
|
149
|
-
isMounted,
|
|
150
|
-
update,
|
|
151
|
-
floatingStyles
|
|
152
|
-
} = usePopperContext(__scopePopper), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), contents = React.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
-
PopperContentFrame,
|
|
154
|
-
{
|
|
225
|
+
}), PopperContent = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
226
|
+
var __scopePopper = props.__scopePopper, enableAnimationForPositionChange = props.enableAnimationForPositionChange, rest = _object_without_properties(props, [
|
|
227
|
+
"__scopePopper",
|
|
228
|
+
"enableAnimationForPositionChange"
|
|
229
|
+
]), _usePopperContext = usePopperContext(__scopePopper), strategy = _usePopperContext.strategy, placement = _usePopperContext.placement, refs = _usePopperContext.refs, x = _usePopperContext.x, y = _usePopperContext.y, getFloatingProps = _usePopperContext.getFloatingProps, size = _usePopperContext.size, isMounted = _usePopperContext.isMounted, update = _usePopperContext.update, floatingStyles = _usePopperContext.floatingStyles, contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), contents = React.useMemo(function() {
|
|
230
|
+
return /* @__PURE__ */ React.createElement(PopperContentFrame, _object_spread({
|
|
231
|
+
key: "popper-content-frame",
|
|
155
232
|
"data-placement": placement,
|
|
156
233
|
"data-strategy": strategy,
|
|
157
234
|
contain: "layout",
|
|
158
|
-
size
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
235
|
+
size
|
|
236
|
+
}, rest));
|
|
237
|
+
}, [
|
|
238
|
+
placement,
|
|
239
|
+
strategy,
|
|
240
|
+
props
|
|
241
|
+
]), _React_useState = _sliced_to_array(React.useState(!0), 2), hasInitialPosition = _React_useState[0], setHasInitialPosition = _React_useState[1];
|
|
242
|
+
if (React.useEffect(function() {
|
|
164
243
|
(x || y) && setHasInitialPosition(!1);
|
|
165
|
-
}, [
|
|
244
|
+
}, [
|
|
245
|
+
x,
|
|
246
|
+
y
|
|
247
|
+
]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
166
248
|
isMounted && update();
|
|
167
|
-
}, [
|
|
249
|
+
}, [
|
|
250
|
+
isMounted
|
|
251
|
+
]), !isMounted)
|
|
168
252
|
return null;
|
|
169
|
-
|
|
253
|
+
var frameProps = _object_spread({
|
|
170
254
|
ref: contentRefs,
|
|
171
255
|
x: x || 0,
|
|
172
256
|
y: y || 0,
|
|
173
257
|
top: 0,
|
|
174
258
|
left: 0,
|
|
175
|
-
position: strategy
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { ...getFloatingProps ? getFloatingProps(frameProps) : frameProps, children: contents });
|
|
259
|
+
position: strategy
|
|
260
|
+
}, enableAnimationForPositionChange && {
|
|
261
|
+
// apply animation but disable it on initial render to avoid animating from 0 to the first position
|
|
262
|
+
animation: rest.animation,
|
|
263
|
+
animateOnly: [
|
|
264
|
+
"none"
|
|
265
|
+
]
|
|
266
|
+
}, enableAnimationForPositionChange && !hasInitialPosition && {
|
|
267
|
+
animation: rest.animation,
|
|
268
|
+
animateOnly: rest.animateOnly
|
|
269
|
+
}, !import_constants.isWeb && floatingStyles);
|
|
270
|
+
return /* @__PURE__ */ React.createElement(import_core.Stack, getFloatingProps ? getFloatingProps(frameProps) : frameProps, contents);
|
|
188
271
|
}), PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
189
272
|
name: "PopperArrow",
|
|
190
273
|
variants: {
|
|
@@ -221,51 +304,56 @@ const PopperAnchor = import_stacks.YStack.extractable(
|
|
|
221
304
|
right: "left",
|
|
222
305
|
bottom: "top",
|
|
223
306
|
left: "right"
|
|
224
|
-
}, PopperArrow = PopperArrowFrame.styleable(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
...primaryPlacement === "top" && {
|
|
254
|
-
borderBottomWidth: borderWidth,
|
|
255
|
-
borderRightWidth: borderWidth
|
|
256
|
-
},
|
|
257
|
-
...primaryPlacement === "right" && {
|
|
258
|
-
borderLeftWidth: borderWidth,
|
|
259
|
-
borderBottomWidth: borderWidth
|
|
260
|
-
},
|
|
261
|
-
...primaryPlacement === "left" && {
|
|
262
|
-
borderTopWidth: borderWidth,
|
|
263
|
-
borderRightWidth: borderWidth
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
) });
|
|
307
|
+
}, PopperArrow = PopperArrowFrame.styleable(function(propsIn, forwardedRef) {
|
|
308
|
+
var _context_arrowStyle, _context_arrowStyle1, __scopePopper = propsIn.__scopePopper, rest = _object_without_properties(propsIn, [
|
|
309
|
+
"__scopePopper"
|
|
310
|
+
]), props = (0, import_core.useProps)(rest), offset = props.offset, sizeProp = props.size, _props_borderWidth = props.borderWidth, borderWidth = _props_borderWidth === void 0 ? 0 : _props_borderWidth, arrowProps = _object_without_properties(props, [
|
|
311
|
+
"offset",
|
|
312
|
+
"size",
|
|
313
|
+
"borderWidth"
|
|
314
|
+
]), context = usePopperContext(__scopePopper), sizeVal = sizeProp ?? context.size, sizeValResolved = (0, import_core.getVariableValue)((0, import_get_token.getSpace)(sizeVal, {
|
|
315
|
+
shift: -2,
|
|
316
|
+
bounds: [
|
|
317
|
+
2
|
|
318
|
+
]
|
|
319
|
+
})), size = Math.max(0, +sizeValResolved), placement = context.placement, refs = (0, import_compose_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 = {
|
|
320
|
+
x,
|
|
321
|
+
y,
|
|
322
|
+
width: size,
|
|
323
|
+
height: size
|
|
324
|
+
}, innerArrowStyle = {}, isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
325
|
+
if (primaryPlacement) {
|
|
326
|
+
arrowStyle[isVertical ? "width" : "height"] = size * 2;
|
|
327
|
+
var oppSide = opposites[primaryPlacement];
|
|
328
|
+
oppSide && (arrowStyle[oppSide] = -size, innerArrowStyle[oppSide] = size / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
329
|
+
var _context_onArrowSize;
|
|
330
|
+
(_context_onArrowSize = context.onArrowSize) === null || _context_onArrowSize === void 0 || _context_onArrowSize.call(context, size);
|
|
331
|
+
}, [
|
|
332
|
+
size,
|
|
333
|
+
context.onArrowSize
|
|
334
|
+
]);
|
|
267
335
|
}
|
|
268
|
-
|
|
336
|
+
return /* @__PURE__ */ React.createElement(PopperArrowOuterFrame, _object_spread({
|
|
337
|
+
ref: refs
|
|
338
|
+
}, arrowStyle), /* @__PURE__ */ React.createElement(PopperArrowFrame, _object_spread(_object_spread_props(_object_spread({
|
|
339
|
+
width: size,
|
|
340
|
+
height: size
|
|
341
|
+
}, arrowProps, innerArrowStyle), {
|
|
342
|
+
rotate: "45deg"
|
|
343
|
+
}), primaryPlacement === "bottom" && {
|
|
344
|
+
borderLeftWidth: borderWidth,
|
|
345
|
+
borderTopWidth: borderWidth
|
|
346
|
+
}, primaryPlacement === "top" && {
|
|
347
|
+
borderBottomWidth: borderWidth,
|
|
348
|
+
borderRightWidth: borderWidth
|
|
349
|
+
}, primaryPlacement === "right" && {
|
|
350
|
+
borderLeftWidth: borderWidth,
|
|
351
|
+
borderBottomWidth: borderWidth
|
|
352
|
+
}, primaryPlacement === "left" && {
|
|
353
|
+
borderTopWidth: borderWidth,
|
|
354
|
+
borderRightWidth: borderWidth
|
|
355
|
+
})));
|
|
356
|
+
});
|
|
269
357
|
// Annotate the CommonJS export names for ESM import in node:
|
|
270
358
|
0 && (module.exports = {
|
|
271
359
|
Popper,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/Popper.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
5
|
-
"names": ["offsetFn", "TamaguiView", "
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/popper/src/Popper.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;AAEA,0BAAgC,kCAChC,mBAAiD,+BAEjD,cAQO,0BAQP,kBAOO,8BACP,mBAAyB,+BAEzB,gBAAuC,4BACvC,QAAuB,2BAEvB,sBAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBvC,IAAMA,oBAAgBC,iCAAwC,CAAC,CAAA,GAErCC,mBAC/BF,cADaG,kBAA8CC,iBAC3DJ,cADiDK;AAe5C,SAASC,OAAOC,OAAqC;AAC1D,MACEC,WAQED,MARFC,UACAC,OAOEF,MAPFE,MAAAA,kBAOEF,MANFG,UAAAA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AAW,QAAnByE,yBAAAA,UAAAA,qBAAAA,KAAAA,SAAsB3H,IAAAA;IACxB,GAAG;MAACA;MAAM2H,QAAQzE;KAAY;EAChC;AAGA,SACE,sBAAA,cAAC8D,uBAAAA,eAAAA;IAAsBpD,KAAKjC;KAAUsB,UAAAA,GACpC,sBAAA,cAAC6D,kBAAAA,eAAAA,qBAAAA,eAAAA;IACC2B,OAAOzI;IACP0I,QAAQ1I;KACJ+H,YACAY,eAAAA,GAAAA;IACJG,QAAO;MACFP,qBAAqB,YAAY;IACpCQ,iBAAiBjB;IACjBkB,gBAAgBlB;EAClB,GACKS,qBAAqB,SAAS;IACjCU,mBAAmBnB;IACnBoB,kBAAkBpB;EACpB,GACKS,qBAAqB,WAAW;IACnCQ,iBAAiBjB;IACjBmB,mBAAmBnB;EACrB,GACKS,qBAAqB,UAAU;IAClCS,gBAAgBlB;IAChBoB,kBAAkBpB;EACpB,CAAA,CAAA,CAAA;AAIR,CAAA;",
|
|
5
|
+
"names": ["PopperContext", "createStyledContext", "usePopperContext", "useStyledContext", "PopperProvider", "Provider", "Popper", "props", "children", "size", "strategy", "placement", "stayInFrame", "allowFlip", "offset", "__scopePopper", "isMounted", "useDidFinishSSR", "React", "useState", "arrowEl", "setArrow", "arrowSize", "setArrowSize", "offsetOptions", "floating", "useFloating", "sameScrollView", "middleware", "shift", "flip", "arrow", "element", "offsetFn", "filter", "Boolean", "refs", "middlewareData", "open", "floatingStyles", "isWeb", "useIsomorphicLayoutEffect", "reference", "current", "autoUpdate", "update", "dimensions", "useWindowDimensions", "keyboardOpen", "setKeyboardOpen", "useEffect", "showSubscription", "Keyboard", "addListener", "hideSubscription", "remove", "popperContext", "arrowRef", "arrowStyle", "onArrowSize", "scope", "PopperAnchor", "YStack", "extractable", "forwardRef", "forwardedRef", "virtualRef", "anchorProps", "getReferenceProps", "ref", "useRef", "composedRefs", "useComposedRefs", "setReference", "stackProps", "TamaguiView", "PopperContentFrame", "styled", "ThemeableStack", "name", "variants", "unstyled", "false", "backgroundColor", "alignItems", "radiused", "val", "tokens", "padding", "space", "borderRadius", "radius", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "PopperContent", "enableAnimationForPositionChange", "rest", "x", "y", "getFloatingProps", "contentRefs", "setFloating", "contents", "useMemo", "key", "data-placement", "data-strategy", "contain", "hasInitialPosition", "setHasInitialPosition", "frameProps", "top", "left", "position", "animation", "animateOnly", "Stack", "PopperArrowFrame", "borderColor", "PopperArrowOuterFrame", "zIndex", "pointerEvents", "overflow", "justifyContent", "opposites", "right", "bottom", "PopperArrow", "styleable", "propsIn", "context", "useProps", "sizeProp", "borderWidth", "arrowProps", "sizeVal", "sizeValResolved", "getVariableValue", "getSpace", "bounds", "Math", "max", "primaryPlacement", "split", "width", "height", "innerArrowStyle", "isVertical", "oppSide", "rotate", "borderLeftWidth", "borderTopWidth", "borderBottomWidth", "borderRightWidth"]
|
|
6
6
|
}
|