@hanzogui/popper 3.0.2 → 7.3.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.
@@ -4,33 +4,35 @@ var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
18
  get: () => from[key],
18
19
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
20
  });
20
- return to;
21
- };
21
+ }
22
+ return to;
23
+ };
22
24
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
+ value: true
35
+ }), mod);
34
36
  var Popper_exports = {};
35
37
  __export(Popper_exports, {
36
38
  Popper: () => Popper,
@@ -50,146 +52,144 @@ __export(Popper_exports, {
50
52
  usePopperContextSlow: () => usePopperContextSlow
51
53
  });
52
54
  module.exports = __toCommonJS(Popper_exports);
53
- var import_jsx_runtime = require("react/jsx-runtime"),
54
- import_react_dom = require("react-dom"),
55
- import_gui_compose_refs = require("@hanzogui/compose-refs"),
56
- import_gui_constants = require("@hanzogui/constants"),
57
- import_gui_core = require("@hanzogui/core"),
58
- import_gui_floating = require("@hanzogui/floating"),
59
- import_gui_floating2 = require("@hanzogui/floating"),
60
- import_gui_get_token = require("@hanzogui/get-token"),
61
- import_gui_stacks = require("@hanzogui/stacks"),
62
- import_gui_start_transition = require("@hanzogui/start-transition"),
63
- React = __toESM(require("react"), 1),
64
- import_react_native = require("react-native");
55
+ var import_jsx_runtime = require("react/jsx-runtime");
56
+ var import_react_dom = require("react-dom");
57
+ var import_compose_refs = require("@hanzogui/compose-refs");
58
+ var import_constants = require("@hanzogui/constants");
59
+ var import_core = require("@hanzogui/core");
60
+ var import_floating = require("@hanzogui/floating");
61
+ var import_floating2 = require("@hanzogui/floating");
62
+ var import_get_token = require("@hanzogui/get-token");
63
+ var import_stacks = require("@hanzogui/stacks");
64
+ var import_start_transition = require("@hanzogui/start-transition");
65
+ var React = __toESM(require("react"), 1);
66
+ var import_react_native = require("react-native");
65
67
  function _instanceof(left, right) {
66
- return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
68
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);else return left instanceof right;
67
69
  }
68
70
  function _type_of(obj) {
69
71
  "@swc/helpers - typeof";
70
72
 
71
- return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
73
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
72
74
  }
73
- var PopperContextFast = (0, import_gui_core.createStyledContext)(
74
- // since we always provide this we can avoid setting here
75
- {}, "Popper__"),
76
- PopperPositionContext = import_gui_core.createStyledContext,
77
- {
78
- useStyledContext: usePopperContext,
79
- Provider: PopperProviderFast
80
- } = PopperContextFast,
81
- PopperContextSlow = (0, import_gui_core.createStyledContext)(
82
- // since we always provide this we can avoid setting here
83
- {}, "PopperSlow__"),
84
- {
85
- useStyledContext: usePopperContextSlow,
86
- Provider: PopperProviderSlow
87
- } = PopperContextSlow,
88
- PopperProvider = function (param) {
89
- var {
90
- scope,
91
- children,
92
- ...context
93
- } = param,
94
- fns = React.useRef(context);
95
- fns.current = context;
96
- var [slowContext] = React.useState(function () {
97
- return {
98
- refs: context.refs,
99
- triggerElements: context.triggerElements,
100
- update() {
101
- for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) a[_key] = arguments[_key];
102
- fns.current.update(...a);
103
- },
104
- getReferenceProps(p) {
105
- var _fns_current_getReferenceProps, _fns_current;
106
- return (_fns_current_getReferenceProps = (_fns_current = fns.current).getReferenceProps) === null || _fns_current_getReferenceProps === void 0 ? void 0 : _fns_current_getReferenceProps.call(_fns_current, p);
107
- },
108
- onHoverReference(e) {
109
- var _fns_current_onHoverReference, _fns_current;
110
- (_fns_current_onHoverReference = (_fns_current = fns.current).onHoverReference) === null || _fns_current_onHoverReference === void 0 || _fns_current_onHoverReference.call(_fns_current, e);
111
- },
112
- onLeaveReference() {
113
- var _fns_current_onLeaveReference, _fns_current;
114
- (_fns_current_onLeaveReference = (_fns_current = fns.current).onLeaveReference) === null || _fns_current_onLeaveReference === void 0 || _fns_current_onLeaveReference.call(_fns_current);
115
- }
116
- };
117
- });
118
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderFast, {
75
+ var PopperContextFast = (0, import_core.createStyledContext)(
76
+ // since we always provide this we can avoid setting here
77
+ {}, "Popper__");
78
+ var PopperPositionContext = import_core.createStyledContext;
79
+ var {
80
+ useStyledContext: usePopperContext,
81
+ Provider: PopperProviderFast
82
+ } = PopperContextFast;
83
+ var PopperContextSlow = (0, import_core.createStyledContext)(
84
+ // since we always provide this we can avoid setting here
85
+ {}, "PopperSlow__");
86
+ var {
87
+ useStyledContext: usePopperContextSlow,
88
+ Provider: PopperProviderSlow
89
+ } = PopperContextSlow;
90
+ var PopperProvider = function (param) {
91
+ var {
92
+ scope,
93
+ children,
94
+ ...context
95
+ } = param;
96
+ var fns = React.useRef(context);
97
+ fns.current = context;
98
+ var [slowContext] = React.useState(function () {
99
+ return {
100
+ refs: context.refs,
101
+ triggerElements: context.triggerElements,
102
+ update() {
103
+ for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) a[_key] = arguments[_key];
104
+ fns.current.update(...a);
105
+ },
106
+ getReferenceProps(p) {
107
+ var _fns_current_getReferenceProps, _fns_current;
108
+ return (_fns_current_getReferenceProps = (_fns_current = fns.current).getReferenceProps) === null || _fns_current_getReferenceProps === void 0 ? void 0 : _fns_current_getReferenceProps.call(_fns_current, p);
109
+ },
110
+ onHoverReference(e) {
111
+ var _fns_current_onHoverReference, _fns_current;
112
+ (_fns_current_onHoverReference = (_fns_current = fns.current).onHoverReference) === null || _fns_current_onHoverReference === void 0 || _fns_current_onHoverReference.call(_fns_current, e);
113
+ },
114
+ onLeaveReference() {
115
+ var _fns_current_onLeaveReference, _fns_current;
116
+ (_fns_current_onLeaveReference = (_fns_current = fns.current).onLeaveReference) === null || _fns_current_onLeaveReference === void 0 || _fns_current_onLeaveReference.call(_fns_current);
117
+ }
118
+ };
119
+ });
120
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderFast, {
121
+ scope,
122
+ ...context,
123
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderSlow, {
119
124
  scope,
120
- ...context,
121
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderSlow, {
122
- scope,
123
- ...slowContext,
124
- children
125
- })
126
- });
127
- },
128
- checkFloating = {
129
- name: "checkFloating",
130
- fn(data) {
131
- return {
132
- data: {
133
- hasFloating: !!data.rects.floating.width
134
- }
135
- };
136
- }
137
- },
138
- setupOptions = {};
125
+ ...slowContext,
126
+ children
127
+ })
128
+ });
129
+ };
130
+ var checkFloating = {
131
+ name: "checkFloating",
132
+ fn(data) {
133
+ return {
134
+ data: {
135
+ hasFloating: !!data.rects.floating.width
136
+ }
137
+ };
138
+ }
139
+ };
140
+ var setupOptions = {};
139
141
  function setupPopper(options) {
140
142
  Object.assign(setupOptions, options);
141
143
  }
142
- function tamaguiAutoUpdate(reference, floating, update) {
144
+ function guiAutoUpdate(reference, floating, update) {
143
145
  update();
144
146
  var rafId = requestAnimationFrame(function () {
145
- update(), rafId = 0;
146
- }),
147
- cleanups = [function () {
148
- rafId && cancelAnimationFrame(rafId);
149
- }];
150
- _instanceof(reference, HTMLElement) && cleanups.push((0, import_gui_core.registerLayoutNode)(reference, update));
151
- var refAncestors = _instanceof(reference, Element) ? (0, import_gui_floating2.getOverflowAncestors)(reference) : [],
152
- ancestors = [...refAncestors, ...(0, import_gui_floating2.getOverflowAncestors)(floating)],
153
- uniqueAncestors = [...new Set(ancestors)],
154
- _iteratorNormalCompletion = !0,
155
- _didIteratorError = !1,
147
+ update();
148
+ rafId = 0;
149
+ });
150
+ var cleanups = [function () {
151
+ if (rafId) cancelAnimationFrame(rafId);
152
+ }];
153
+ if (_instanceof(reference, HTMLElement)) cleanups.push((0, import_core.registerLayoutNode)(reference, update));
154
+ var ancestors = [...(_instanceof(reference, Element) ? (0, import_floating2.getOverflowAncestors)(reference) : []), ...(0, import_floating2.getOverflowAncestors)(floating)];
155
+ var uniqueAncestors = [...new Set(ancestors)];
156
+ var _iteratorNormalCompletion = true,
157
+ _didIteratorError = false,
156
158
  _iteratorError = void 0;
157
159
  try {
158
- for (var _iterator = uniqueAncestors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
159
- var ancestor = _step.value;
160
- ancestor.addEventListener("scroll", update, {
161
- passive: !0
162
- });
163
- }
160
+ for (var _iterator = uniqueAncestors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.addEventListener("scroll", update, {
161
+ passive: true
162
+ });
164
163
  } catch (err) {
165
- _didIteratorError = !0, _iteratorError = err;
164
+ _didIteratorError = true;
165
+ _iteratorError = err;
166
166
  } finally {
167
167
  try {
168
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
168
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
169
169
  } finally {
170
170
  if (_didIteratorError) throw _iteratorError;
171
171
  }
172
172
  }
173
- return window.addEventListener("resize", update), cleanups.push(function () {
174
- var _iteratorNormalCompletion2 = !0,
175
- _didIteratorError2 = !1,
173
+ window.addEventListener("resize", update);
174
+ cleanups.push(function () {
175
+ var _iteratorNormalCompletion2 = true,
176
+ _didIteratorError2 = false,
176
177
  _iteratorError2 = void 0;
177
178
  try {
178
- for (var _iterator2 = uniqueAncestors[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
179
- var ancestor2 = _step2.value;
180
- ancestor2.removeEventListener("scroll", update);
181
- }
179
+ for (var _iterator2 = uniqueAncestors[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) _step2.value.removeEventListener("scroll", update);
182
180
  } catch (err) {
183
- _didIteratorError2 = !0, _iteratorError2 = err;
181
+ _didIteratorError2 = true;
182
+ _iteratorError2 = err;
184
183
  } finally {
185
184
  try {
186
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
185
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
187
186
  } finally {
188
187
  if (_didIteratorError2) throw _iteratorError2;
189
188
  }
190
189
  }
191
190
  window.removeEventListener("resize", update);
192
- }), function () {
191
+ });
192
+ return function () {
193
193
  return cleanups.forEach(function (fn) {
194
194
  return fn();
195
195
  });
@@ -197,76 +197,71 @@ function tamaguiAutoUpdate(reference, floating, update) {
197
197
  }
198
198
  function Popper(props) {
199
199
  var {
200
- children,
201
- size,
202
- strategy = "absolute",
203
- placement = "bottom",
204
- stayInFrame,
205
- allowFlip,
206
- offset,
207
- disableRTL,
208
- resize,
209
- passThrough,
210
- open,
211
- scope
212
- } = props,
213
- [arrowEl, setArrow] = React.useState(null),
214
- [arrowSize, setArrowSize] = React.useState(0),
215
- offsetOptions = offset ?? arrowSize,
216
- floatingStyle = React.useRef({}),
217
- isOpen = passThrough ? !1 : open ?? !0,
218
- middlewareRef = React.useRef([]);
219
- isOpen && (middlewareRef.current = [
220
- // order matters: offset first, then flip, then shift, then arrow
221
- typeof offsetOptions < "u" ? (0, import_gui_floating2.offset)(offsetOptions) : null, allowFlip ? (0, import_gui_floating2.flip)(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
222
- // NOTE: shift's axis terminology is reversed vs flip/offset:
223
- // for top/bottom placements: mainAxis = horizontal, crossAxis = vertical
224
- // for left/right placements: mainAxis = vertical, crossAxis = horizontal
225
- // default to horizontal shift only (mainAxis: true, crossAxis: false)
226
- stayInFrame ? (0, import_gui_floating2.shift)({
200
+ children,
201
+ size,
202
+ strategy = "absolute",
203
+ placement = "bottom",
204
+ stayInFrame,
205
+ allowFlip,
206
+ offset,
207
+ disableRTL,
208
+ resize,
209
+ passThrough,
210
+ open,
211
+ scope
212
+ } = props;
213
+ var [arrowEl, setArrow] = React.useState(null);
214
+ var [arrowSize, setArrowSize] = React.useState(0);
215
+ var offsetOptions = offset !== null && offset !== void 0 ? offset : arrowSize;
216
+ React.useRef({});
217
+ var isOpen = passThrough ? false : open !== null && open !== void 0 ? open : true;
218
+ var middlewareRef = React.useRef([]);
219
+ if (isOpen) middlewareRef.current = [typeof offsetOptions !== "undefined" ? (0, import_floating2.offset)(offsetOptions) : null, allowFlip ? (0, import_floating2.flip)(typeof allowFlip === "boolean" ? {} : allowFlip) : null, stayInFrame ? (0, import_floating2.shift)({
227
220
  padding: 10,
228
- mainAxis: !0,
229
- crossAxis: !1,
230
- ...((typeof stayInFrame > "u" ? "undefined" : _type_of(stayInFrame)) === "object" ? stayInFrame : null)
231
- }) : null, arrowEl ? (0, import_gui_floating2.arrow)({
221
+ mainAxis: true,
222
+ crossAxis: false,
223
+ ...((typeof stayInFrame === "undefined" ? "undefined" : _type_of(stayInFrame)) === "object" ? stayInFrame : null)
224
+ }) : null, arrowEl ? (0, import_floating2.arrow)({
232
225
  element: arrowEl
233
- }) : null, checkFloating, null, null, null].filter(Boolean));
234
- var floating = (0, import_gui_floating2.useFloating)({
235
- open: isOpen,
236
- strategy,
237
- placement,
238
- sameScrollView: !1,
239
- // this only takes effect on native
240
- whileElementsMounted: isOpen ? tamaguiAutoUpdate : void 0,
241
- platform: disableRTL ?? setupOptions.disableRTL ? {
242
- ...import_gui_floating2.platform,
243
- isRTL(element) {
244
- return !1;
245
- }
246
- } : import_gui_floating2.platform,
247
- middleware: middlewareRef.current
248
- }),
249
- {
250
- middlewareData
251
- } = floating,
252
- dimensions = (0, import_react_native.useWindowDimensions)(),
253
- [keyboardOpen, setKeyboardOpen] = React.useState(!1);
226
+ }) : null, checkFloating, null, null, null].filter(Boolean);
227
+ var floating = (0, import_floating2.useFloating)({
228
+ open: isOpen,
229
+ strategy,
230
+ placement,
231
+ sameScrollView: false,
232
+ whileElementsMounted: !isOpen ? void 0 : guiAutoUpdate,
233
+ platform: (disableRTL !== null && disableRTL !== void 0 ? disableRTL : setupOptions.disableRTL) ? {
234
+ ...import_floating2.platform,
235
+ isRTL(element) {
236
+ return false;
237
+ }
238
+ } : import_floating2.platform,
239
+ middleware: middlewareRef.current
240
+ });
241
+ var {
242
+ middlewareData
243
+ } = floating;
244
+ var dimensions = (0, import_react_native.useWindowDimensions)();
245
+ var [keyboardOpen, setKeyboardOpen] = React.useState(false);
254
246
  React.useEffect(function () {
255
247
  var showSubscription = import_react_native.Keyboard.addListener("keyboardDidShow", function () {
256
- (0, import_gui_start_transition.startTransition)(function () {
257
- setKeyboardOpen(!0);
258
- });
259
- }),
260
- hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", function () {
261
- (0, import_gui_start_transition.startTransition)(function () {
262
- setKeyboardOpen(!1);
263
- });
248
+ (0, import_start_transition.startTransition)(function () {
249
+ setKeyboardOpen(true);
250
+ });
251
+ });
252
+ var hideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", function () {
253
+ (0, import_start_transition.startTransition)(function () {
254
+ setKeyboardOpen(false);
264
255
  });
256
+ });
265
257
  return function () {
266
- showSubscription.remove(), hideSubscription.remove();
258
+ showSubscription.remove();
259
+ hideSubscription.remove();
267
260
  };
268
- }, []), (0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
269
- passThrough || floating.update();
261
+ }, []);
262
+ (0, import_constants.useIsomorphicLayoutEffect)(function () {
263
+ if (passThrough) return;
264
+ floating.update();
270
265
  }, [passThrough, dimensions, keyboardOpen]);
271
266
  var popperContext = React.useMemo(function () {
272
267
  var _middlewareData_checkFloating;
@@ -284,349 +279,351 @@ function Popper(props) {
284
279
  return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProvider, {
285
280
  scope,
286
281
  ...popperContext,
287
- children: (
288
- /* reset FloatingOverrideContext so it doesn't leak into nested Poppers —
289
- each Popper consumes the override for its own useFloating, children
290
- should not inherit it (e.g. a Menu inside a Tooltip's tree) */
291
- /* @__PURE__ */
292
- (0, import_jsx_runtime.jsx)(import_gui_floating.FloatingOverrideContext.Provider, {
282
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {
293
283
  value: null,
294
284
  children
295
- }))
285
+ })
296
286
  });
297
287
  }
298
- var PopperAnchor = import_gui_stacks.YStack.styleable(function (props, forwardedRef) {
299
- var {
300
- virtualRef,
301
- scope,
302
- ...rest
303
- } = props,
304
- context = usePopperContextSlow(scope),
305
- {
306
- getReferenceProps,
307
- refs,
308
- update
309
- } = context,
310
- ref = React.useRef(null),
311
- triggerId = React.useId();
312
- React.useEffect(function () {
313
- if (!(!scope || !context.triggerElements || !ref.current) && _instanceof(ref.current, Element)) {
314
- var el = ref.current;
315
- return context.triggerElements.add(triggerId, el), function () {
316
- var _context_triggerElements;
317
- (_context_triggerElements = context.triggerElements) === null || _context_triggerElements === void 0 || _context_triggerElements.delete(triggerId);
318
- };
319
- }
320
- }, [scope, triggerId, context.triggerElements]), React.useEffect(function () {
321
- virtualRef && (refs.setReference(virtualRef.current), update());
322
- }, [virtualRef]);
323
- var refProps = getReferenceProps?.({
324
- ...rest,
325
- ref
326
- }) || null,
327
- safeSetReference = React.useCallback(function (node) {
328
- (0, import_gui_start_transition.startTransition)(function () {
329
- refs.setReference(node);
330
- });
331
- },
332
- // it was refs.setRefernce but its stable and refs is undefined on server
333
- [refs]),
334
- shouldHandleInHover = import_gui_constants.isWeb && scope,
335
- composedRefs = (0, import_gui_compose_refs.useComposedRefs)(forwardedRef, ref,
336
- // web handles this onMouseEnter below so it can support multiple targets + hovering
337
- shouldHandleInHover ? void 0 : safeSetReference);
338
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_core.View, {
339
- ...rest,
340
- ...refProps,
341
- ref: composedRefs,
342
- ...(shouldHandleInHover && {
343
- // scoped poppers with multiple triggers: set the reference on
344
- // mouseEnter so floating-ui positions relative to the hovered
345
- // trigger, not the last one rendered.
346
- //
347
- // flushSync is critical here: without it, setReference batches
348
- // with React's async state updates and the arrow/content position
349
- // computes against the OLD reference element. this causes the
350
- // arrow to flash at x=0 (top-left) during trigger switches.
351
- // flushSync forces synchronous commit so update() below reads
352
- // the correct reference element immediately.
353
- onMouseEnter: function (e) {
354
- var _e_currentTarget,
355
- el = (_e_currentTarget = e.currentTarget) !== null && _e_currentTarget !== void 0 ? _e_currentTarget : ref.current;
356
- if (_instanceof(el, HTMLElement)) {
357
- var _refProps_onPointerEnter, _context_onHoverReference;
358
- if ((0, import_react_dom.flushSync)(function () {
359
- return refs.setReference(el);
360
- }), update(), !refProps) return;
361
- (_refProps_onPointerEnter = refProps.onPointerEnter) === null || _refProps_onPointerEnter === void 0 || _refProps_onPointerEnter.call(refProps, e), (_context_onHoverReference = context.onHoverReference) === null || _context_onHoverReference === void 0 || _context_onHoverReference.call(context, e.nativeEvent);
362
- }
363
- },
364
- onMouseLeave: function (e) {
365
- var _context_onLeaveReference, _refProps_onMouseLeave;
366
- (_context_onLeaveReference = context.onLeaveReference) === null || _context_onLeaveReference === void 0 || _context_onLeaveReference.call(context), refProps == null || (_refProps_onMouseLeave = refProps.onMouseLeave) === null || _refProps_onMouseLeave === void 0 || _refProps_onMouseLeave.call(refProps, e);
367
- }
368
- })
288
+ var PopperAnchor = import_stacks.YStack.styleable(function PopperAnchor2(props, forwardedRef) {
289
+ var {
290
+ virtualRef,
291
+ scope,
292
+ ...rest
293
+ } = props;
294
+ var context = usePopperContextSlow(scope);
295
+ var {
296
+ getReferenceProps,
297
+ refs,
298
+ update
299
+ } = context;
300
+ var ref = React.useRef(null);
301
+ var triggerId = React.useId();
302
+ React.useEffect(function () {
303
+ if (!scope || !context.triggerElements || !ref.current) return;
304
+ if (!_instanceof(ref.current, Element)) return;
305
+ var el = ref.current;
306
+ context.triggerElements.add(triggerId, el);
307
+ return function () {
308
+ var _context_triggerElements;
309
+ (_context_triggerElements = context.triggerElements) === null || _context_triggerElements === void 0 || _context_triggerElements.delete(triggerId);
310
+ };
311
+ }, [scope, triggerId, context.triggerElements]);
312
+ React.useEffect(function () {
313
+ if (virtualRef) {
314
+ refs.setReference(virtualRef.current);
315
+ update();
316
+ }
317
+ }, [virtualRef]);
318
+ var refProps = (getReferenceProps === null || getReferenceProps === void 0 ? void 0 : getReferenceProps({
319
+ ...rest,
320
+ ref
321
+ })) || null;
322
+ var safeSetReference = React.useCallback(function (node) {
323
+ (0, import_start_transition.startTransition)(function () {
324
+ refs.setReference(node);
369
325
  });
370
- }),
371
- PopperContentFrame = (0, import_gui_core.styled)(import_gui_stacks.YStack, {
372
- name: "PopperContent",
373
- variants: {
374
- unstyled: {
375
- true: {}
376
- },
377
- size: {
378
- "...size": function (val, param) {
379
- var {
380
- tokens
381
- } = param;
382
- return {
383
- padding: tokens.space[val],
384
- borderRadius: tokens.radius[val]
385
- };
326
+ },
327
+ // it was refs.setRefernce but its stable and refs is undefined on server
328
+ [refs]);
329
+ var shouldHandleInHover = import_constants.isWeb && scope;
330
+ var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref,
331
+ // web handles this onMouseEnter below so it can support multiple targets + hovering
332
+ shouldHandleInHover ? void 0 : safeSetReference);
333
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
334
+ ...rest,
335
+ ...refProps,
336
+ ref: composedRefs,
337
+ ...(shouldHandleInHover && {
338
+ onMouseEnter: function (e) {
339
+ var _e_currentTarget;
340
+ var el = (_e_currentTarget = e.currentTarget) !== null && _e_currentTarget !== void 0 ? _e_currentTarget : ref.current;
341
+ if (_instanceof(el, HTMLElement)) {
342
+ var _refProps_onPointerEnter, _context_onHoverReference;
343
+ (0, import_react_dom.flushSync)(function () {
344
+ return refs.setReference(el);
345
+ });
346
+ update();
347
+ if (!refProps) return;
348
+ (_refProps_onPointerEnter = refProps.onPointerEnter) === null || _refProps_onPointerEnter === void 0 || _refProps_onPointerEnter.call(refProps, e);
349
+ (_context_onHoverReference = context.onHoverReference) === null || _context_onHoverReference === void 0 || _context_onHoverReference.call(context, e.nativeEvent);
386
350
  }
351
+ },
352
+ onMouseLeave: function (e) {
353
+ var _context_onLeaveReference, _refProps_onMouseLeave;
354
+ (_context_onLeaveReference = context.onLeaveReference) === null || _context_onLeaveReference === void 0 || _context_onLeaveReference.call(context);
355
+ refProps === null || refProps === void 0 || (_refProps_onMouseLeave = refProps.onMouseLeave) == null || _refProps_onMouseLeave.call(refProps, e);
356
+ }
357
+ })
358
+ });
359
+ });
360
+ var PopperContentFrame = (0, import_core.styled)(import_stacks.YStack, {
361
+ name: "PopperContent",
362
+ variants: {
363
+ unstyled: {
364
+ true: {}
365
+ },
366
+ size: {
367
+ "...size": function (val, param) {
368
+ var {
369
+ tokens
370
+ } = param;
371
+ return {
372
+ padding: tokens.space[val],
373
+ borderRadius: tokens.radius[val]
374
+ };
387
375
  }
388
376
  }
389
- }),
390
- PopperContent = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
391
- var {
392
- scope,
393
- animatePosition,
394
- enableAnimationForPositionChange,
395
- children,
396
- passThrough,
397
- unstyled,
398
- ...rest
399
- } = props,
400
- animatePos = animatePosition ?? enableAnimationForPositionChange,
401
- context = usePopperContext(scope),
402
- {
403
- strategy,
404
- placement,
405
- refs,
406
- x,
407
- y,
408
- getFloatingProps,
409
- size,
410
- isPositioned,
411
- transformOrigin,
412
- update
413
- } = context,
414
- updateRef = React.useRef(update);
415
- updateRef.current = update;
416
- var lastNodeRef = React.useRef(null),
417
- safeSetFloating = React.useCallback(function (node) {
418
- var isNewNode = node !== lastNodeRef.current;
419
- if (node && (lastNodeRef.current = node, refs.setFloating(node), !isNewNode)) {
420
- var _updateRef_current;
421
- (_updateRef_current = updateRef.current) === null || _updateRef_current === void 0 || _updateRef_current.call(updateRef);
422
- }
423
- },
424
- // null calls are blocked: cycling nulls are transient, genuine unmount
425
- // is handled by the useEffect cleanup below
426
- [refs.setFloating]);
427
- React.useEffect(function () {
428
- return function () {
429
- var ourNode = lastNodeRef.current;
430
- ourNode && refs.floating.current === ourNode && refs.setFloating(null), lastNodeRef.current = null;
431
- };
432
- }, []);
433
- var contentRefs = (0, import_gui_compose_refs.useComposedRefs)(safeSetFloating, forwardedRef),
434
- [needsMeasure, setNeedsMeasure] = React.useState(animatePos);
435
- (0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
436
- needsMeasure && x && y && setNeedsMeasure(!1);
437
- }, [needsMeasure, animatePos, x, y]);
438
- var hasBeenPositioned = React.useRef(!1),
439
- lastGoodPosition = React.useRef({
440
- x: 0,
441
- y: 0
442
- });
443
- (x !== 0 || y !== 0) && (lastGoodPosition.current = {
377
+ }
378
+ });
379
+ var PopperContent = /* @__PURE__ */React.forwardRef(function PopperContent2(props, forwardedRef) {
380
+ var {
381
+ scope,
382
+ animatePosition,
383
+ enableAnimationForPositionChange,
384
+ children,
385
+ passThrough,
386
+ unstyled,
387
+ ...rest
388
+ } = props;
389
+ var animatePos = animatePosition !== null && animatePosition !== void 0 ? animatePosition : enableAnimationForPositionChange;
390
+ var context = usePopperContext(scope);
391
+ var {
392
+ strategy,
393
+ placement,
394
+ refs,
395
+ x,
396
+ y,
397
+ getFloatingProps,
398
+ size,
399
+ isPositioned,
400
+ transformOrigin,
401
+ update
402
+ } = context;
403
+ var updateRef = React.useRef(update);
404
+ updateRef.current = update;
405
+ var lastNodeRef = React.useRef(null);
406
+ var safeSetFloating = React.useCallback(function (node) {
407
+ var isNewNode = node !== lastNodeRef.current;
408
+ if (node) {
409
+ lastNodeRef.current = node;
410
+ refs.setFloating(node);
411
+ if (!isNewNode) {
412
+ var _updateRef_current;
413
+ (_updateRef_current = updateRef.current) === null || _updateRef_current === void 0 || _updateRef_current.call(updateRef);
414
+ }
415
+ }
416
+ },
417
+ // null calls are blocked: cycling nulls are transient, genuine unmount
418
+ // is handled by the useEffect cleanup below
419
+ [refs.setFloating]);
420
+ React.useEffect(function () {
421
+ return function () {
422
+ var ourNode = lastNodeRef.current;
423
+ if (ourNode && refs.floating.current === ourNode) refs.setFloating(null);
424
+ lastNodeRef.current = null;
425
+ };
426
+ }, []);
427
+ var contentRefs = (0, import_compose_refs.useComposedRefs)(safeSetFloating, forwardedRef);
428
+ var [needsMeasure, setNeedsMeasure] = React.useState(animatePos);
429
+ (0, import_constants.useIsomorphicLayoutEffect)(function () {
430
+ if (needsMeasure && x && y) setNeedsMeasure(false);
431
+ }, [needsMeasure, animatePos, x, y]);
432
+ var hasBeenPositioned = React.useRef(false);
433
+ var lastGoodPosition = React.useRef({
434
+ x: 0,
435
+ y: 0
436
+ });
437
+ if (x !== 0 || y !== 0) {
438
+ lastGoodPosition.current = {
444
439
  x,
445
440
  y
446
- }, isPositioned && (hasBeenPositioned.current = !0));
447
- var brieflyZero = hasBeenPositioned.current && x === 0 && y === 0,
448
- effectiveX = brieflyZero ? lastGoodPosition.current.x : x,
449
- effectiveY = brieflyZero ? lastGoodPosition.current.y : y,
450
- hide = !hasBeenPositioned.current && effectiveX === 0 && effectiveY === 0,
451
- disableAnimationProp =
452
- // if they want to animate also when re-positioning allow it
453
- animatePos === "even-when-repositioning" ? needsMeasure : !hasBeenPositioned.current && !isPositioned || needsMeasure,
454
- [disableAnimation, setDisableAnimation] = React.useState(disableAnimationProp);
455
- React.useEffect(function () {
456
- setDisableAnimation(disableAnimationProp);
457
- }, [disableAnimationProp]);
458
- var positionProps = hide ? {} :
459
- // omit x/y when hiding - prevents motion driver from animating from origin
460
- {
461
- x: effectiveX || 0,
462
- y: effectiveY || 0
463
- },
464
- frameProps = {
465
- ref: contentRefs,
466
- ...positionProps,
467
- top: 0,
468
- left: 0,
469
- position: strategy,
470
- opacity: hide ? 0 : 1,
471
- ...(animatePos && {
472
- transition: rest.transition,
473
- // animateOnly: [] turns off transitions while keeping styles applied,
474
- // letting the element move to its position silently before animations start
475
- animateOnly: disableAnimation ? [] : rest.animateOnly,
476
- animatePresence: !1
477
- })
478
- },
479
- {
480
- style,
481
- ...floatingProps
482
- } = getFloatingProps ? getFloatingProps(frameProps) : frameProps,
483
- transformOriginStyle = import_gui_constants.isWeb && transformOrigin ? {
484
- transformOrigin: `${transformOrigin.x} ${transformOrigin.y}`
485
- } : void 0;
486
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_core.LayoutMeasurementController, {
487
- disable: !context.open,
488
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_core.View, {
441
+ };
442
+ if (isPositioned) hasBeenPositioned.current = true;
443
+ }
444
+ var brieflyZero = hasBeenPositioned.current && x === 0 && y === 0;
445
+ var effectiveX = brieflyZero ? lastGoodPosition.current.x : x;
446
+ var effectiveY = brieflyZero ? lastGoodPosition.current.y : y;
447
+ var hide = !hasBeenPositioned.current && effectiveX === 0 && effectiveY === 0;
448
+ var disableAnimationProp = animatePos === "even-when-repositioning" ? needsMeasure : !hasBeenPositioned.current && !isPositioned || needsMeasure;
449
+ var [disableAnimation, setDisableAnimation] = React.useState(disableAnimationProp);
450
+ React.useEffect(function () {
451
+ setDisableAnimation(disableAnimationProp);
452
+ }, [disableAnimationProp]);
453
+ var frameProps = {
454
+ ref: contentRefs,
455
+ ...(hide ? {} :
456
+ // omit x/y when hiding - prevents motion driver from animating from origin
457
+ {
458
+ x: effectiveX || 0,
459
+ y: effectiveY || 0
460
+ }),
461
+ top: 0,
462
+ left: 0,
463
+ position: strategy,
464
+ opacity: hide ? 0 : 1,
465
+ ...(animatePos && {
466
+ transition: rest.transition,
467
+ animateOnly: disableAnimation ? [] : rest.animateOnly,
468
+ animatePresence: false
469
+ })
470
+ };
471
+ var {
472
+ style,
473
+ ...floatingProps
474
+ } = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
475
+ var transformOriginStyle = import_constants.isWeb && transformOrigin ? {
476
+ transformOrigin: `${transformOrigin.x} ${transformOrigin.y}`
477
+ } : void 0;
478
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.LayoutMeasurementController, {
479
+ disable: !context.open,
480
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
481
+ passThrough,
482
+ ref: contentRefs,
483
+ direction: rest.direction,
484
+ ...(passThrough ? null : floatingProps),
485
+ ...(!passThrough && animatePos && {
486
+ "data-popper-animate-position": "true"
487
+ }),
488
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperContentFrame, {
489
489
  passThrough,
490
- ref: contentRefs,
491
- direction: rest.direction,
492
- ...(passThrough ? null : floatingProps),
493
- ...(!passThrough && animatePos && {
494
- "data-popper-animate-position": "true"
490
+ unstyled,
491
+ ...(!passThrough && {
492
+ "data-placement": placement,
493
+ "data-strategy": strategy,
494
+ size,
495
+ ...style,
496
+ ...transformOriginStyle,
497
+ ...rest
495
498
  }),
496
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperContentFrame, {
497
- passThrough,
498
- unstyled,
499
- ...(!passThrough && {
500
- "data-placement": placement,
501
- "data-strategy": strategy,
502
- size,
503
- ...style,
504
- ...transformOriginStyle,
505
- ...rest
506
- }),
507
- children
508
- }, "popper-content-frame")
509
- })
510
- });
511
- }),
512
- PopperArrowFrame = (0, import_gui_core.styled)(import_gui_stacks.YStack, {
513
- name: "PopperArrow",
514
- variants: {
515
- unstyled: {
516
- false: {
517
- borderColor: "$borderColor",
518
- backgroundColor: "$background",
519
- position: "relative"
520
- }
499
+ children
500
+ }, "popper-content-frame")
501
+ })
502
+ });
503
+ });
504
+ var PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
505
+ name: "PopperArrow",
506
+ variants: {
507
+ unstyled: {
508
+ false: {
509
+ borderColor: "$borderColor",
510
+ backgroundColor: "$background",
511
+ position: "relative"
521
512
  }
522
- },
523
- defaultVariants: {
524
- unstyled: process.env.HANZO_GUI_HEADLESS === "1"
525
513
  }
526
- }),
527
- PopperArrowOuterFrame = (0, import_gui_core.styled)(import_gui_stacks.YStack, {
528
- name: "PopperArrowOuter",
529
- variants: {
530
- unstyled: {
531
- false: {
532
- position: "absolute",
533
- zIndex: 1e6,
534
- pointerEvents: "none",
535
- overflow: "hidden",
536
- alignItems: "center",
537
- justifyContent: "center"
538
- }
514
+ },
515
+ defaultVariants: {
516
+ unstyled: process.env.GUI_HEADLESS === "1"
517
+ }
518
+ });
519
+ var PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
520
+ name: "PopperArrowOuter",
521
+ variants: {
522
+ unstyled: {
523
+ false: {
524
+ position: "absolute",
525
+ zIndex: 1e6,
526
+ pointerEvents: "none",
527
+ overflow: "hidden",
528
+ alignItems: "center",
529
+ justifyContent: "center"
539
530
  }
540
- },
541
- defaultVariants: {
542
- unstyled: process.env.HANZO_GUI_HEADLESS === "1"
543
531
  }
544
- }),
545
- opposites = {
546
- top: "bottom",
547
- right: "left",
548
- bottom: "top",
549
- left: "right"
550
532
  },
551
- PopperArrow = /* @__PURE__ */React.forwardRef(function (propsIn, forwardedRef) {
552
- var _context_arrowStyle,
553
- _context_arrowStyle1,
554
- {
555
- scope,
556
- animatePosition,
557
- transition,
558
- ...rest
559
- } = propsIn,
560
- {
561
- offset,
562
- size: sizeProp,
563
- borderWidth = 0,
564
- ...arrowProps
565
- } = rest,
566
- context = usePopperContext(scope),
567
- sizeVal = typeof sizeProp == "number" ? sizeProp : (0, import_gui_core.getVariableValue)((0, import_gui_get_token.getSpace)(sizeProp ?? context.size, {
568
- shift: -2,
569
- bounds: [2]
570
- })),
571
- size = Math.max(0, +sizeVal),
572
- {
573
- placement
574
- } = context,
575
- refs = (0, import_gui_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef),
576
- x = ((_context_arrowStyle = context.arrowStyle) === null || _context_arrowStyle === void 0 ? void 0 : _context_arrowStyle.x) || 0,
577
- y = ((_context_arrowStyle1 = context.arrowStyle) === null || _context_arrowStyle1 === void 0 ? void 0 : _context_arrowStyle1.y) || 0,
578
- arrowPositioned = context.arrowStyle != null,
579
- primaryPlacement = placement ? placement.split("-")[0] : "top",
580
- arrowStyle = {
581
- x,
582
- y,
583
- width: size,
584
- height: size
585
- },
586
- innerArrowStyle = {},
587
- isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
588
- if (primaryPlacement) {
589
- arrowStyle[isVertical ? "width" : "height"] = size * 2;
590
- var oppSide = opposites[primaryPlacement];
591
- oppSide && (arrowStyle[oppSide] = -size, innerArrowStyle[oppSide] = size / 2), (oppSide === "top" || oppSide === "bottom") && (arrowStyle.left = 0), (oppSide === "left" || oppSide === "right") && (arrowStyle.top = 0), (0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
592
- var _context_onArrowSize;
593
- (_context_onArrowSize = context.onArrowSize) === null || _context_onArrowSize === void 0 || _context_onArrowSize.call(context, size);
594
- }, [size, context.onArrowSize]);
533
+ defaultVariants: {
534
+ unstyled: process.env.GUI_HEADLESS === "1"
535
+ }
536
+ });
537
+ var opposites = {
538
+ top: "bottom",
539
+ right: "left",
540
+ bottom: "top",
541
+ left: "right"
542
+ };
543
+ var PopperArrow = /* @__PURE__ */React.forwardRef(function PopperArrow2(propsIn, forwardedRef) {
544
+ var _context_arrowStyle, _context_arrowStyle1;
545
+ var {
546
+ scope,
547
+ animatePosition,
548
+ transition,
549
+ ...rest
550
+ } = propsIn;
551
+ var {
552
+ offset,
553
+ size: sizeProp,
554
+ borderWidth = 0,
555
+ ...arrowProps
556
+ } = rest;
557
+ var context = usePopperContext(scope);
558
+ var sizeVal = typeof sizeProp === "number" ? sizeProp : (0, import_core.getVariableValue)((0, import_get_token.getSpace)(sizeProp !== null && sizeProp !== void 0 ? sizeProp : context.size, {
559
+ shift: -2,
560
+ bounds: [2]
561
+ }));
562
+ var size = Math.max(0, +sizeVal);
563
+ var {
564
+ placement
565
+ } = context;
566
+ var refs = (0, import_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef);
567
+ var x = ((_context_arrowStyle = context.arrowStyle) === null || _context_arrowStyle === void 0 ? void 0 : _context_arrowStyle.x) || 0;
568
+ var y = ((_context_arrowStyle1 = context.arrowStyle) === null || _context_arrowStyle1 === void 0 ? void 0 : _context_arrowStyle1.y) || 0;
569
+ var arrowPositioned = context.arrowStyle != null;
570
+ var primaryPlacement = placement ? placement.split("-")[0] : "top";
571
+ var arrowStyle = {
572
+ x,
573
+ y,
574
+ width: size,
575
+ height: size
576
+ };
577
+ var innerArrowStyle = {};
578
+ var isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
579
+ if (primaryPlacement) {
580
+ arrowStyle[isVertical ? "width" : "height"] = size * 2;
581
+ var oppSide = opposites[primaryPlacement];
582
+ if (oppSide) {
583
+ arrowStyle[oppSide] = -size;
584
+ innerArrowStyle[oppSide] = size / 2;
595
585
  }
596
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, {
597
- ref: refs,
598
- ...arrowStyle,
599
- ...(!arrowPositioned && {
600
- opacity: 0
586
+ if (oppSide === "top" || oppSide === "bottom") arrowStyle.left = 0;
587
+ if (oppSide === "left" || oppSide === "right") arrowStyle.top = 0;
588
+ (0, import_constants.useIsomorphicLayoutEffect)(function () {
589
+ var _context_onArrowSize;
590
+ (_context_onArrowSize = context.onArrowSize) === null || _context_onArrowSize === void 0 || _context_onArrowSize.call(context, size);
591
+ }, [size, context.onArrowSize]);
592
+ }
593
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, {
594
+ ref: refs,
595
+ ...arrowStyle,
596
+ ...(!arrowPositioned && {
597
+ opacity: 0
598
+ }),
599
+ ...(animatePosition && {
600
+ transition,
601
+ animateOnly: ["transform"],
602
+ animatePresence: false
603
+ }),
604
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowFrame, {
605
+ width: size,
606
+ height: size,
607
+ ...arrowProps,
608
+ ...innerArrowStyle,
609
+ rotate: "45deg",
610
+ ...(primaryPlacement === "bottom" && {
611
+ borderLeftWidth: borderWidth,
612
+ borderTopWidth: borderWidth
601
613
  }),
602
- ...(animatePosition && {
603
- transition,
604
- animateOnly: ["transform"],
605
- animatePresence: !1
614
+ ...(primaryPlacement === "top" && {
615
+ borderBottomWidth: borderWidth,
616
+ borderRightWidth: borderWidth
606
617
  }),
607
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowFrame, {
608
- width: size,
609
- height: size,
610
- ...arrowProps,
611
- ...innerArrowStyle,
612
- rotate: "45deg",
613
- ...(primaryPlacement === "bottom" && {
614
- borderLeftWidth: borderWidth,
615
- borderTopWidth: borderWidth
616
- }),
617
- ...(primaryPlacement === "top" && {
618
- borderBottomWidth: borderWidth,
619
- borderRightWidth: borderWidth
620
- }),
621
- ...(primaryPlacement === "right" && {
622
- borderLeftWidth: borderWidth,
623
- borderBottomWidth: borderWidth
624
- }),
625
- ...(primaryPlacement === "left" && {
626
- borderTopWidth: borderWidth,
627
- borderRightWidth: borderWidth
628
- })
618
+ ...(primaryPlacement === "right" && {
619
+ borderLeftWidth: borderWidth,
620
+ borderBottomWidth: borderWidth
621
+ }),
622
+ ...(primaryPlacement === "left" && {
623
+ borderTopWidth: borderWidth,
624
+ borderRightWidth: borderWidth
629
625
  })
630
- });
626
+ })
631
627
  });
628
+ });
632
629
  //# sourceMappingURL=Popper.native.js.map