@huin-core/react-menu 1.0.5 → 1.0.6

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/index.mjs CHANGED
@@ -22,7 +22,6 @@ import { Slot } from "@huin-core/react-slot";
22
22
  import { useCallbackRef } from "@huin-core/react-use-callback-ref";
23
23
  import { hideOthers } from "aria-hidden";
24
24
  import { RemoveScroll } from "react-remove-scroll";
25
- import { jsx } from "react/jsx-runtime";
26
25
  var SELECTION_KEYS = ["Enter", " "];
27
26
  var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
28
27
  var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
@@ -67,27 +66,27 @@ var Menu = (props) => {
67
66
  document.removeEventListener("pointermove", handlePointer, { capture: true });
68
67
  };
69
68
  }, []);
70
- return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(
69
+ return /* @__PURE__ */ React.createElement(PopperPrimitive.Root, { ...popperScope }, /* @__PURE__ */ React.createElement(
71
70
  MenuProvider,
72
71
  {
73
72
  scope: __scopeMenu,
74
73
  open,
75
74
  onOpenChange: handleOpenChange,
76
75
  content,
77
- onContentChange: setContent,
78
- children: /* @__PURE__ */ jsx(
79
- MenuRootProvider,
80
- {
81
- scope: __scopeMenu,
82
- onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),
83
- isUsingKeyboardRef,
84
- dir: direction,
85
- modal,
86
- children
87
- }
88
- )
89
- }
90
- ) });
76
+ onContentChange: setContent
77
+ },
78
+ /* @__PURE__ */ React.createElement(
79
+ MenuRootProvider,
80
+ {
81
+ scope: __scopeMenu,
82
+ onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),
83
+ isUsingKeyboardRef,
84
+ dir: direction,
85
+ modal
86
+ },
87
+ children
88
+ )
89
+ ));
91
90
  };
92
91
  Menu.displayName = MENU_NAME;
93
92
  var ANCHOR_NAME = "MenuAnchor";
@@ -95,7 +94,7 @@ var MenuAnchor = React.forwardRef(
95
94
  (props, forwardedRef) => {
96
95
  const { __scopeMenu, ...anchorProps } = props;
97
96
  const popperScope = usePopperScope(__scopeMenu);
98
- return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
97
+ return /* @__PURE__ */ React.createElement(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
99
98
  }
100
99
  );
101
100
  MenuAnchor.displayName = ANCHOR_NAME;
@@ -106,7 +105,7 @@ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
106
105
  var MenuPortal = (props) => {
107
106
  const { __scopeMenu, forceMount, children, container } = props;
108
107
  const context = useMenuContext(PORTAL_NAME, __scopeMenu);
109
- return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });
108
+ return /* @__PURE__ */ React.createElement(PortalProvider, { scope: __scopeMenu, forceMount }, /* @__PURE__ */ React.createElement(Presence, { present: forceMount || context.open }, /* @__PURE__ */ React.createElement(PortalPrimitive, { asChild: true, container }, children)));
110
109
  };
111
110
  MenuPortal.displayName = PORTAL_NAME;
112
111
  var CONTENT_NAME = "MenuContent";
@@ -117,7 +116,7 @@ var MenuContent = React.forwardRef(
117
116
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
118
117
  const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
119
118
  const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
120
- return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
119
+ return /* @__PURE__ */ React.createElement(Collection.Provider, { scope: props.__scopeMenu }, /* @__PURE__ */ React.createElement(Presence, { present: forceMount || context.open }, /* @__PURE__ */ React.createElement(Collection.Slot, { scope: props.__scopeMenu }, rootContext.modal ? /* @__PURE__ */ React.createElement(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ React.createElement(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }))));
121
120
  }
122
121
  );
123
122
  var MenuRootContentModal = React.forwardRef(
@@ -129,7 +128,7 @@ var MenuRootContentModal = React.forwardRef(
129
128
  const content = ref.current;
130
129
  if (content) return hideOthers(content);
131
130
  }, []);
132
- return /* @__PURE__ */ jsx(
131
+ return /* @__PURE__ */ React.createElement(
133
132
  MenuContentImpl,
134
133
  {
135
134
  ...props,
@@ -149,7 +148,7 @@ var MenuRootContentModal = React.forwardRef(
149
148
  );
150
149
  var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
151
150
  const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
152
- return /* @__PURE__ */ jsx(
151
+ return /* @__PURE__ */ React.createElement(
153
152
  MenuContentImpl,
154
153
  {
155
154
  ...props,
@@ -220,7 +219,7 @@ var MenuContentImpl = React.forwardRef(
220
219
  const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
221
220
  return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
222
221
  }, []);
223
- return /* @__PURE__ */ jsx(
222
+ return /* @__PURE__ */ React.createElement(
224
223
  MenuContentProvider,
225
224
  {
226
225
  scope: __scopeMenu,
@@ -248,98 +247,98 @@ var MenuContentImpl = React.forwardRef(
248
247
  pointerGraceTimerRef,
249
248
  onPointerGraceIntentChange: React.useCallback((intent) => {
250
249
  pointerGraceIntentRef.current = intent;
251
- }, []),
252
- children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
253
- FocusScope,
250
+ }, [])
251
+ },
252
+ /* @__PURE__ */ React.createElement(ScrollLockWrapper, { ...scrollLockWrapperProps }, /* @__PURE__ */ React.createElement(
253
+ FocusScope,
254
+ {
255
+ asChild: true,
256
+ trapped: trapFocus,
257
+ onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
258
+ event.preventDefault();
259
+ contentRef.current?.focus({ preventScroll: true });
260
+ }),
261
+ onUnmountAutoFocus: onCloseAutoFocus
262
+ },
263
+ /* @__PURE__ */ React.createElement(
264
+ DismissableLayer,
254
265
  {
255
266
  asChild: true,
256
- trapped: trapFocus,
257
- onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
258
- event.preventDefault();
259
- contentRef.current?.focus({ preventScroll: true });
260
- }),
261
- onUnmountAutoFocus: onCloseAutoFocus,
262
- children: /* @__PURE__ */ jsx(
263
- DismissableLayer,
267
+ disableOutsidePointerEvents,
268
+ onEscapeKeyDown,
269
+ onPointerDownOutside,
270
+ onFocusOutside,
271
+ onInteractOutside,
272
+ onDismiss
273
+ },
274
+ /* @__PURE__ */ React.createElement(
275
+ RovingFocusGroup.Root,
276
+ {
277
+ asChild: true,
278
+ ...rovingFocusGroupScope,
279
+ dir: rootContext.dir,
280
+ orientation: "vertical",
281
+ loop,
282
+ currentTabStopId: currentItemId,
283
+ onCurrentTabStopIdChange: setCurrentItemId,
284
+ onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {
285
+ if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
286
+ }),
287
+ preventScrollOnEntryFocus: true
288
+ },
289
+ /* @__PURE__ */ React.createElement(
290
+ PopperPrimitive.Content,
264
291
  {
265
- asChild: true,
266
- disableOutsidePointerEvents,
267
- onEscapeKeyDown,
268
- onPointerDownOutside,
269
- onFocusOutside,
270
- onInteractOutside,
271
- onDismiss,
272
- children: /* @__PURE__ */ jsx(
273
- RovingFocusGroup.Root,
274
- {
275
- asChild: true,
276
- ...rovingFocusGroupScope,
277
- dir: rootContext.dir,
278
- orientation: "vertical",
279
- loop,
280
- currentTabStopId: currentItemId,
281
- onCurrentTabStopIdChange: setCurrentItemId,
282
- onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {
283
- if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
284
- }),
285
- preventScrollOnEntryFocus: true,
286
- children: /* @__PURE__ */ jsx(
287
- PopperPrimitive.Content,
288
- {
289
- role: "menu",
290
- "aria-orientation": "vertical",
291
- "data-state": getOpenState(context.open),
292
- "data-huin-core-menu-content": "",
293
- dir: rootContext.dir,
294
- ...popperScope,
295
- ...contentProps,
296
- ref: composedRefs,
297
- style: { outline: "none", ...contentProps.style },
298
- onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
299
- const target = event.target;
300
- const isKeyDownInside = target.closest("[data-huin-core-menu-content]") === event.currentTarget;
301
- const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
302
- const isCharacterKey = event.key.length === 1;
303
- if (isKeyDownInside) {
304
- if (event.key === "Tab") event.preventDefault();
305
- if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
306
- }
307
- const content = contentRef.current;
308
- if (event.target !== content) return;
309
- if (!FIRST_LAST_KEYS.includes(event.key)) return;
310
- event.preventDefault();
311
- const items = getItems().filter((item) => !item.disabled);
312
- const candidateNodes = items.map((item) => item.ref.current);
313
- if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
314
- focusFirst(candidateNodes);
315
- }),
316
- onBlur: composeEventHandlers(props.onBlur, (event) => {
317
- if (!event.currentTarget.contains(event.target)) {
318
- window.clearTimeout(timerRef.current);
319
- searchRef.current = "";
320
- }
321
- }),
322
- onPointerMove: composeEventHandlers(
323
- props.onPointerMove,
324
- whenMouse((event) => {
325
- const target = event.target;
326
- const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
327
- if (event.currentTarget.contains(target) && pointerXHasChanged) {
328
- const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
329
- pointerDirRef.current = newDir;
330
- lastPointerXRef.current = event.clientX;
331
- }
332
- })
333
- )
334
- }
335
- )
292
+ role: "menu",
293
+ "aria-orientation": "vertical",
294
+ "data-state": getOpenState(context.open),
295
+ "data-huin-core-menu-content": "",
296
+ dir: rootContext.dir,
297
+ ...popperScope,
298
+ ...contentProps,
299
+ ref: composedRefs,
300
+ style: { outline: "none", ...contentProps.style },
301
+ onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
302
+ const target = event.target;
303
+ const isKeyDownInside = target.closest("[data-huin-core-menu-content]") === event.currentTarget;
304
+ const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
305
+ const isCharacterKey = event.key.length === 1;
306
+ if (isKeyDownInside) {
307
+ if (event.key === "Tab") event.preventDefault();
308
+ if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
309
+ }
310
+ const content = contentRef.current;
311
+ if (event.target !== content) return;
312
+ if (!FIRST_LAST_KEYS.includes(event.key)) return;
313
+ event.preventDefault();
314
+ const items = getItems().filter((item) => !item.disabled);
315
+ const candidateNodes = items.map((item) => item.ref.current);
316
+ if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
317
+ focusFirst(candidateNodes);
318
+ }),
319
+ onBlur: composeEventHandlers(props.onBlur, (event) => {
320
+ if (!event.currentTarget.contains(event.target)) {
321
+ window.clearTimeout(timerRef.current);
322
+ searchRef.current = "";
336
323
  }
324
+ }),
325
+ onPointerMove: composeEventHandlers(
326
+ props.onPointerMove,
327
+ whenMouse((event) => {
328
+ const target = event.target;
329
+ const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
330
+ if (event.currentTarget.contains(target) && pointerXHasChanged) {
331
+ const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
332
+ pointerDirRef.current = newDir;
333
+ lastPointerXRef.current = event.clientX;
334
+ }
335
+ })
337
336
  )
338
337
  }
339
338
  )
340
- }
341
- ) })
342
- }
339
+ )
340
+ )
341
+ ))
343
342
  );
344
343
  }
345
344
  );
@@ -348,7 +347,7 @@ var GROUP_NAME = "MenuGroup";
348
347
  var MenuGroup = React.forwardRef(
349
348
  (props, forwardedRef) => {
350
349
  const { __scopeMenu, ...groupProps } = props;
351
- return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
350
+ return /* @__PURE__ */ React.createElement(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
352
351
  }
353
352
  );
354
353
  MenuGroup.displayName = GROUP_NAME;
@@ -356,7 +355,7 @@ var LABEL_NAME = "MenuLabel";
356
355
  var MenuLabel = React.forwardRef(
357
356
  (props, forwardedRef) => {
358
357
  const { __scopeMenu, ...labelProps } = props;
359
- return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
358
+ return /* @__PURE__ */ React.createElement(Primitive.div, { ...labelProps, ref: forwardedRef });
360
359
  }
361
360
  );
362
361
  MenuLabel.displayName = LABEL_NAME;
@@ -383,7 +382,7 @@ var MenuItem = React.forwardRef(
383
382
  }
384
383
  }
385
384
  };
386
- return /* @__PURE__ */ jsx(
385
+ return /* @__PURE__ */ React.createElement(
387
386
  MenuItemImpl,
388
387
  {
389
388
  ...itemProps,
@@ -425,44 +424,44 @@ var MenuItemImpl = React.forwardRef(
425
424
  setTextContent((menuItem.textContent ?? "").trim());
426
425
  }
427
426
  }, [itemProps.children]);
428
- return /* @__PURE__ */ jsx(
427
+ return /* @__PURE__ */ React.createElement(
429
428
  Collection.ItemSlot,
430
429
  {
431
430
  scope: __scopeMenu,
432
431
  disabled,
433
- textValue: textValue ?? textContent,
434
- children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
435
- Primitive.div,
436
- {
437
- role: "menuitem",
438
- "data-highlighted": isFocused ? "" : void 0,
439
- "aria-disabled": disabled || void 0,
440
- "data-disabled": disabled ? "" : void 0,
441
- ...itemProps,
442
- ref: composedRefs,
443
- onPointerMove: composeEventHandlers(
444
- props.onPointerMove,
445
- whenMouse((event) => {
446
- if (disabled) {
447
- contentContext.onItemLeave(event);
448
- } else {
449
- contentContext.onItemEnter(event);
450
- if (!event.defaultPrevented) {
451
- const item = event.currentTarget;
452
- item.focus({ preventScroll: true });
453
- }
432
+ textValue: textValue ?? textContent
433
+ },
434
+ /* @__PURE__ */ React.createElement(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled }, /* @__PURE__ */ React.createElement(
435
+ Primitive.div,
436
+ {
437
+ role: "menuitem",
438
+ "data-highlighted": isFocused ? "" : void 0,
439
+ "aria-disabled": disabled || void 0,
440
+ "data-disabled": disabled ? "" : void 0,
441
+ ...itemProps,
442
+ ref: composedRefs,
443
+ onPointerMove: composeEventHandlers(
444
+ props.onPointerMove,
445
+ whenMouse((event) => {
446
+ if (disabled) {
447
+ contentContext.onItemLeave(event);
448
+ } else {
449
+ contentContext.onItemEnter(event);
450
+ if (!event.defaultPrevented) {
451
+ const item = event.currentTarget;
452
+ item.focus({ preventScroll: true });
454
453
  }
455
- })
456
- ),
457
- onPointerLeave: composeEventHandlers(
458
- props.onPointerLeave,
459
- whenMouse((event) => contentContext.onItemLeave(event))
460
- ),
461
- onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
462
- onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))
463
- }
464
- ) })
465
- }
454
+ }
455
+ })
456
+ ),
457
+ onPointerLeave: composeEventHandlers(
458
+ props.onPointerLeave,
459
+ whenMouse((event) => contentContext.onItemLeave(event))
460
+ ),
461
+ onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
462
+ onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))
463
+ }
464
+ ))
466
465
  );
467
466
  }
468
467
  );
@@ -470,7 +469,7 @@ var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
470
469
  var MenuCheckboxItem = React.forwardRef(
471
470
  (props, forwardedRef) => {
472
471
  const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
473
- return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
472
+ return /* @__PURE__ */ React.createElement(ItemIndicatorProvider, { scope: props.__scopeMenu, checked }, /* @__PURE__ */ React.createElement(
474
473
  MenuItem,
475
474
  {
476
475
  role: "menuitemcheckbox",
@@ -484,7 +483,7 @@ var MenuCheckboxItem = React.forwardRef(
484
483
  { checkForDefaultPrevented: false }
485
484
  )
486
485
  }
487
- ) });
486
+ ));
488
487
  }
489
488
  );
490
489
  MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
@@ -498,7 +497,7 @@ var MenuRadioGroup = React.forwardRef(
498
497
  (props, forwardedRef) => {
499
498
  const { value, onValueChange, ...groupProps } = props;
500
499
  const handleValueChange = useCallbackRef(onValueChange);
501
- return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
500
+ return /* @__PURE__ */ React.createElement(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange }, /* @__PURE__ */ React.createElement(MenuGroup, { ...groupProps, ref: forwardedRef }));
502
501
  }
503
502
  );
504
503
  MenuRadioGroup.displayName = RADIO_GROUP_NAME;
@@ -508,7 +507,7 @@ var MenuRadioItem = React.forwardRef(
508
507
  const { value, ...radioItemProps } = props;
509
508
  const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
510
509
  const checked = value === context.value;
511
- return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
510
+ return /* @__PURE__ */ React.createElement(ItemIndicatorProvider, { scope: props.__scopeMenu, checked }, /* @__PURE__ */ React.createElement(
512
511
  MenuItem,
513
512
  {
514
513
  role: "menuitemradio",
@@ -522,7 +521,7 @@ var MenuRadioItem = React.forwardRef(
522
521
  { checkForDefaultPrevented: false }
523
522
  )
524
523
  }
525
- ) });
524
+ ));
526
525
  }
527
526
  );
528
527
  MenuRadioItem.displayName = RADIO_ITEM_NAME;
@@ -535,19 +534,19 @@ var MenuItemIndicator = React.forwardRef(
535
534
  (props, forwardedRef) => {
536
535
  const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
537
536
  const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
538
- return /* @__PURE__ */ jsx(
537
+ return /* @__PURE__ */ React.createElement(
539
538
  Presence,
540
539
  {
541
- present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
542
- children: /* @__PURE__ */ jsx(
543
- Primitive.span,
544
- {
545
- ...itemIndicatorProps,
546
- ref: forwardedRef,
547
- "data-state": getCheckedState(indicatorContext.checked)
548
- }
549
- )
550
- }
540
+ present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true
541
+ },
542
+ /* @__PURE__ */ React.createElement(
543
+ Primitive.span,
544
+ {
545
+ ...itemIndicatorProps,
546
+ ref: forwardedRef,
547
+ "data-state": getCheckedState(indicatorContext.checked)
548
+ }
549
+ )
551
550
  );
552
551
  }
553
552
  );
@@ -556,7 +555,7 @@ var SEPARATOR_NAME = "MenuSeparator";
556
555
  var MenuSeparator = React.forwardRef(
557
556
  (props, forwardedRef) => {
558
557
  const { __scopeMenu, ...separatorProps } = props;
559
- return /* @__PURE__ */ jsx(
558
+ return /* @__PURE__ */ React.createElement(
560
559
  Primitive.div,
561
560
  {
562
561
  role: "separator",
@@ -573,7 +572,7 @@ var MenuArrow = React.forwardRef(
573
572
  (props, forwardedRef) => {
574
573
  const { __scopeMenu, ...arrowProps } = props;
575
574
  const popperScope = usePopperScope(__scopeMenu);
576
- return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
575
+ return /* @__PURE__ */ React.createElement(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
577
576
  }
578
577
  );
579
578
  MenuArrow.displayName = ARROW_NAME;
@@ -590,27 +589,27 @@ var MenuSub = (props) => {
590
589
  if (parentMenuContext.open === false) handleOpenChange(false);
591
590
  return () => handleOpenChange(false);
592
591
  }, [parentMenuContext.open, handleOpenChange]);
593
- return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(
592
+ return /* @__PURE__ */ React.createElement(PopperPrimitive.Root, { ...popperScope }, /* @__PURE__ */ React.createElement(
594
593
  MenuProvider,
595
594
  {
596
595
  scope: __scopeMenu,
597
596
  open,
598
597
  onOpenChange: handleOpenChange,
599
598
  content,
600
- onContentChange: setContent,
601
- children: /* @__PURE__ */ jsx(
602
- MenuSubProvider,
603
- {
604
- scope: __scopeMenu,
605
- contentId: useId(),
606
- triggerId: useId(),
607
- trigger,
608
- onTriggerChange: setTrigger,
609
- children
610
- }
611
- )
612
- }
613
- ) });
599
+ onContentChange: setContent
600
+ },
601
+ /* @__PURE__ */ React.createElement(
602
+ MenuSubProvider,
603
+ {
604
+ scope: __scopeMenu,
605
+ contentId: useId(),
606
+ triggerId: useId(),
607
+ trigger,
608
+ onTriggerChange: setTrigger
609
+ },
610
+ children
611
+ )
612
+ ));
614
613
  };
615
614
  MenuSub.displayName = SUB_NAME;
616
615
  var SUB_TRIGGER_NAME = "MenuSubTrigger";
@@ -635,7 +634,7 @@ var MenuSubTrigger = React.forwardRef(
635
634
  onPointerGraceIntentChange(null);
636
635
  };
637
636
  }, [pointerGraceTimerRef, onPointerGraceIntentChange]);
638
- return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(
637
+ return /* @__PURE__ */ React.createElement(MenuAnchor, { asChild: true, ...scope }, /* @__PURE__ */ React.createElement(
639
638
  MenuItemImpl,
640
639
  {
641
640
  id: subContext.triggerId,
@@ -710,7 +709,7 @@ var MenuSubTrigger = React.forwardRef(
710
709
  }
711
710
  })
712
711
  }
713
- ) });
712
+ ));
714
713
  }
715
714
  );
716
715
  MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
@@ -724,7 +723,7 @@ var MenuSubContent = React.forwardRef(
724
723
  const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
725
724
  const ref = React.useRef(null);
726
725
  const composedRefs = useComposedRefs(forwardedRef, ref);
727
- return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(
726
+ return /* @__PURE__ */ React.createElement(Collection.Provider, { scope: props.__scopeMenu }, /* @__PURE__ */ React.createElement(Presence, { present: forceMount || context.open }, /* @__PURE__ */ React.createElement(Collection.Slot, { scope: props.__scopeMenu }, /* @__PURE__ */ React.createElement(
728
727
  MenuContentImpl,
729
728
  {
730
729
  id: subContext.contentId,
@@ -758,7 +757,7 @@ var MenuSubContent = React.forwardRef(
758
757
  }
759
758
  })
760
759
  }
761
- ) }) }) });
760
+ ))));
762
761
  }
763
762
  );
764
763
  MenuSubContent.displayName = SUB_CONTENT_NAME;