@acusti/dropdown 1.0.0-alpha.4 → 1.0.0-alpha.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/Dropdown.js CHANGED
@@ -9,7 +9,7 @@ var DropdownContext = createContext(null);
9
9
  var MenubarContext = createContext(null);
10
10
  //#endregion
11
11
  //#region src/Dropdown.css?inline
12
- var Dropdown_default = ":root{--uktdd-font-family:system-ui, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Helvetica, Arial, sans-serif;--uktdd-body-bg-color:#fff;--uktdd-body-bg-color-hover:#69a2f9;--uktdd-body-color-hover:#fff;--uktdd-body-buffer:10px;--uktdd-body-max-height:calc(100dvh - var(--uktdd-body-buffer));--uktdd-body-max-width:calc(100dvw - var(--uktdd-body-buffer));--uktdd-body-min-height:30px;--uktdd-body-pad-bottom:.5em;--uktdd-body-pad-left:.6875em;--uktdd-body-pad-right:.6875em;--uktdd-body-pad-top:.5em;--uktdd-body-min-width:min(50px, 100%);--uktdd-body-position-area:block-end span-inline-end;--uktdd-body-position-try-fallbacks:--uktdd-top-start, --uktdd-bottom-end, --uktdd-top-end;--uktdd-body-gap:0px;--uktdd-body-color:canvastext;--uktdd-body-bg-color-path:#dcdcdc;--uktdd-body-color-path:currentColor;--uktdd-label-pad-right:.625em;--uktdd-submenu-position-area:inline-end span-block-end;--uktdd-submenu-position-try-fallbacks:--uktdd-submenu-inline-start;--uktdd-submenu-gap:0px;--uktdd-menubar-trigger-bg-color-active:#0000001f}.uktdropdown,.uktdropdown-trigger{font-family:var(--uktdd-font-family)}.uktdropdown{anchor-scope:--uktdd-anchor;width:max-content}.uktdropdown.disabled{pointer-events:none}.uktdropdown>*{cursor:default}.uktdropdown>:first-child{anchor-name:--uktdd-anchor}.uktdropdown-label{align-items:center;display:flex}.uktdropdown-label-text{padding-right:var(--uktdd-label-pad-right)}.uktdropdown-body{box-sizing:border-box;position-anchor:--uktdd-anchor;position-area:var(--uktdd-body-position-area);position-try-order:most-height;position-try-fallbacks:var(--uktdd-body-position-try-fallbacks);min-block-size:min(var(--uktdd-body-min-height), var(--uktdd-body-max-height));max-block-size:min(var(--uktdd-body-max-height), 100%);min-inline-size:min(var(--uktdd-body-min-width), var(--uktdd-body-max-width));max-inline-size:var(--uktdd-body-max-width);inline-size:max-content;color:inherit;background-color:var(--uktdd-body-bg-color);flex-direction:column;display:flex;position:fixed;overflow:hidden;box-shadow:0 8px 18px #00000040}.uktdropdown-body.has-items{-webkit-user-select:none;user-select:none}.uktdropdown-body [data-ukt-active]{background-color:var(--uktdd-body-bg-color-hover);color:var(--uktdd-body-color-hover)}:is(.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu] [data-ukt-active]),.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu]:hover)){background-color:var(--uktdd-body-bg-color-path);color:var(--uktdd-body-color-path)}.uktdropdown-body [data-ukt-item][aria-disabled=true]{opacity:.5;pointer-events:none}.uktdropdown-body [data-ukt-item]{anchor-scope:--uktdd-submenu-anchor}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]{padding-inline-end:2em;position:relative}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:after{content:\"\";border-block-start:.14em solid;border-inline-end:.14em solid;block-size:.3em;inline-size:.3em;position:absolute;inset-block-start:50%;inset-inline-end:.9em;translate:0 -50%;rotate:45deg}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{rotate:-45deg}.uktdropdown-body [data-ukt-item][aria-expanded=true]{anchor-name:--uktdd-submenu-anchor}.uktdropdown-body [data-ukt-item][aria-expanded=true]>[data-ukt-submenu]{display:block}.uktdropdown-body [data-ukt-submenu]{box-sizing:border-box;color:var(--uktdd-body-color);position-anchor:--uktdd-submenu-anchor;position-area:var(--uktdd-submenu-position-area);position-try-fallbacks:var(--uktdd-submenu-position-try-fallbacks);z-index:2;margin-block:0;margin-inline:var(--uktdd-submenu-gap);padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);inline-size:max-content;max-inline-size:var(--uktdd-body-max-width);max-block-size:var(--uktdd-body-max-height);overscroll-behavior:contain;background-color:var(--uktdd-body-bg-color);list-style:none;display:none;position:fixed;overflow:auto;box-shadow:0 8px 18px #00000040}div.uktdropdown-body{block-size:auto;margin-block:var(--uktdd-body-gap);border:0;margin-inline:0;padding:0;inset:auto}.uktmenubar{width:max-content;font-family:var(--uktdd-font-family);align-items:stretch;display:flex}.uktmenubar .uktdropdown.is-open .uktdropdown-trigger{box-shadow:inset 0 0 0 100vmax var(--uktdd-menubar-trigger-bg-color-active)}.uktdropdown-content{box-sizing:border-box;overscroll-behavior:contain;min-block-size:0;padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);overflow:auto}@position-try --uktdd-top-start{position-area: block-start span-inline-end;}@position-try --uktdd-bottom-start{position-area: block-end span-inline-end;}@position-try --uktdd-bottom-end{position-area: block-end span-inline-start;}@position-try --uktdd-top-end{position-area: block-start span-inline-start;}@position-try --uktdd-submenu-inline-start{position-area: inline-start span-block-end;}";
12
+ var Dropdown_default = ":root{--uktdd-font-family:system-ui, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Helvetica, Arial, sans-serif;--uktdd-body-bg-color:#fff;--uktdd-body-bg-color-hover:#69a2f9;--uktdd-body-color-hover:#fff;--uktdd-body-bg-color-selected:#0000000f;--uktdd-body-buffer:10px;--uktdd-body-max-height:calc(100dvh - var(--uktdd-body-buffer));--uktdd-body-max-width:calc(100dvw - var(--uktdd-body-buffer));--uktdd-body-min-height:30px;--uktdd-body-pad-bottom:.5em;--uktdd-body-pad-left:.6875em;--uktdd-body-pad-right:.6875em;--uktdd-body-pad-top:.5em;--uktdd-body-min-width:min(50px, 100%);--uktdd-body-position-area:block-end span-inline-end;--uktdd-body-position-try-fallbacks:--uktdd-top-start, --uktdd-bottom-end, --uktdd-top-end;--uktdd-body-gap:0px;--uktdd-body-color:canvastext;--uktdd-body-bg-color-path:#dcdcdc;--uktdd-body-color-path:currentColor;--uktdd-label-pad-right:.625em;--uktdd-submenu-position-area:inline-end span-block-end;--uktdd-submenu-position-try-fallbacks:--uktdd-submenu-inline-start;--uktdd-submenu-gap:0px;--uktdd-menubar-trigger-bg-color-active:#0000001f}.uktdropdown,.uktdropdown-trigger{font-family:var(--uktdd-font-family)}.uktdropdown{anchor-scope:--uktdd-anchor;width:max-content}.uktdropdown.disabled{pointer-events:none}.uktdropdown>*{cursor:default}.uktdropdown>:first-child{anchor-name:--uktdd-anchor}.uktdropdown-label{align-items:center;display:flex}.uktdropdown-label-text{padding-right:var(--uktdd-label-pad-right)}.uktdropdown-body{box-sizing:border-box;position-anchor:--uktdd-anchor;position-area:var(--uktdd-body-position-area);position-try-fallbacks:var(--uktdd-body-position-try-fallbacks), --uktdd-fill, --uktdd-fill flip-inline, --uktdd-fill flip-block, --uktdd-fill flip-block flip-inline;min-block-size:min(var(--uktdd-body-min-height), var(--uktdd-body-max-height));max-block-size:var(--uktdd-body-max-height);min-inline-size:min(var(--uktdd-body-min-width), var(--uktdd-body-max-width));max-inline-size:var(--uktdd-body-max-width);inline-size:max-content;color:inherit;background-color:var(--uktdd-body-bg-color);flex-direction:column;display:flex;position:fixed;overflow:hidden;box-shadow:0 8px 18px #00000040}.uktdropdown-body.has-items{-webkit-user-select:none;user-select:none}.uktdropdown-body [aria-selected=true]{background-color:var(--uktdd-body-bg-color-selected)}.uktdropdown-body [data-ukt-active]{background-color:var(--uktdd-body-bg-color-hover);color:var(--uktdd-body-color-hover)}:is(.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu] [data-ukt-active]),.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu]:hover)){background-color:var(--uktdd-body-bg-color-path);color:var(--uktdd-body-color-path)}.uktdropdown-body [data-ukt-item][aria-disabled=true]{opacity:.5;pointer-events:none}.uktdropdown-body [data-ukt-item]{anchor-scope:--uktdd-submenu-anchor}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]{padding-inline-end:2em;position:relative}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:after{content:\"\";border-block-start:.14em solid;border-inline-end:.14em solid;block-size:.3em;inline-size:.3em;position:absolute;inset-block-start:50%;inset-inline-end:.9em;translate:0 -50%;rotate:45deg}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{rotate:-45deg}.uktdropdown-body [data-ukt-item][aria-expanded=true]{anchor-name:--uktdd-submenu-anchor}.uktdropdown-body [data-ukt-submenu]:not([popover]){display:none}.uktdropdown-body [data-ukt-submenu]{box-sizing:border-box;block-size:auto;color:var(--uktdd-body-color);position-anchor:--uktdd-submenu-anchor;position-area:var(--uktdd-submenu-position-area);position-try-fallbacks:var(--uktdd-submenu-position-try-fallbacks), --uktdd-fill, --uktdd-fill flip-inline, --uktdd-fill flip-block, --uktdd-fill flip-block flip-inline;z-index:2;margin-block:0;margin-inline:var(--uktdd-submenu-gap);--uktdd-body-gap:0;padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);inline-size:max-content;max-inline-size:var(--uktdd-body-max-width);min-block-size:min(var(--uktdd-body-min-height), var(--uktdd-body-max-height));max-block-size:var(--uktdd-body-max-height);overscroll-behavior:contain;background-color:var(--uktdd-body-bg-color);border:0;list-style:none;position:fixed;inset:auto;overflow:auto;box-shadow:0 8px 18px #00000040}div.uktdropdown-body{block-size:auto;margin-block:var(--uktdd-body-gap);border:0;margin-inline:0;padding:0;inset:auto}.uktmenubar{width:max-content;font-family:var(--uktdd-font-family);align-items:stretch;display:flex}.uktmenubar .uktdropdown.is-open .uktdropdown-trigger{box-shadow:inset 0 0 0 100vmax var(--uktdd-menubar-trigger-bg-color-active)}.uktdropdown-content{box-sizing:border-box;overscroll-behavior:contain;min-block-size:0;padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);overflow:auto}@position-try --uktdd-top-start{position-area: block-start span-inline-end;}@position-try --uktdd-bottom-start{position-area: block-end span-inline-end;}@position-try --uktdd-bottom-end{position-area: block-end span-inline-start;}@position-try --uktdd-top-end{position-area: block-start span-inline-start;}@position-try --uktdd-submenu-inline-start{position-area: inline-start span-block-end;}@position-try --uktdd-fill{block-size: calc(100% - var(--uktdd-body-gap) * 2);}";
13
13
  //#endregion
14
14
  //#region src/helpers.ts
15
15
  var ITEM_SELECTOR = "[data-ukt-item], [data-ukt-value]";
@@ -29,6 +29,36 @@ var getItemLabel = (item) => {
29
29
  for (const submenu of Array.from(clone.querySelectorAll(SUBMENU_SELECTOR))) submenu.remove();
30
30
  return (clone.textContent ?? "").trim();
31
31
  };
32
+ var getNodeText = (node) => {
33
+ let text = "";
34
+ Children.forEach(node, (child) => {
35
+ if (typeof child === "string" || typeof child === "number") text += child;
36
+ else if (isValidElement(child)) {
37
+ const childProps = child.props;
38
+ if (childProps["data-ukt-submenu"] !== void 0) return;
39
+ text += getNodeText(childProps.children);
40
+ }
41
+ });
42
+ return text;
43
+ };
44
+ var getLabelFromChildren = (children, value) => {
45
+ let label;
46
+ const visit = (node) => {
47
+ if (label != null) return;
48
+ Children.forEach(node, (child) => {
49
+ if (label != null || !isValidElement(child)) return;
50
+ const childProps = child.props;
51
+ const uktValue = childProps["data-ukt-value"];
52
+ if (uktValue != null && String(uktValue) === value) {
53
+ label = getNodeText(childProps.children).replace(/\s+/g, " ").trim();
54
+ return;
55
+ }
56
+ visit(childProps.children);
57
+ });
58
+ };
59
+ visit(children);
60
+ return label;
61
+ };
32
62
  var getItemPath = (element) => {
33
63
  const path = [];
34
64
  if (!element) return path;
@@ -86,9 +116,10 @@ var getDeepestExpandedItem = (dropdownElement) => {
86
116
  };
87
117
  var isItemExpanded = (item) => item.getAttribute("aria-expanded") === "true";
88
118
  var submenuIdCounter = 0;
89
- var ensureSubmenuAria = (item, submenu) => {
119
+ var ensureSubmenuARIA = (item, submenu) => {
90
120
  if (!submenu.hasAttribute("role")) submenu.setAttribute("role", "menu");
91
121
  if (!submenu.id) submenu.id = `uktdd-submenu-${++submenuIdCounter}`;
122
+ if (submenu.getAttribute("popover") !== "manual") submenu.setAttribute("popover", "manual");
92
123
  if (!item.hasAttribute("aria-haspopup")) item.setAttribute("aria-haspopup", "menu");
93
124
  if (!item.hasAttribute("aria-expanded")) item.setAttribute("aria-expanded", "false");
94
125
  if (!item.hasAttribute("aria-controls")) item.setAttribute("aria-controls", submenu.id);
@@ -97,13 +128,23 @@ var annotateParentItems = (bodyElement) => {
97
128
  if (!bodyElement) return;
98
129
  for (const submenu of Array.from(bodyElement.querySelectorAll(SUBMENU_SELECTOR))) {
99
130
  const item = getParentItem(submenu);
100
- if (item) ensureSubmenuAria(item, submenu);
131
+ if (item) ensureSubmenuARIA(item, submenu);
132
+ }
133
+ };
134
+ var annotateItemRoles = (bodyElement, popupRole) => {
135
+ if (!bodyElement) return;
136
+ for (const list of Array.from(bodyElement.querySelectorAll("ul, ol"))) if (!list.hasAttribute("role") && list.querySelector("[data-ukt-item], [data-ukt-value]")) list.setAttribute("role", "presentation");
137
+ for (const item of Array.from(bodyElement.querySelectorAll(ITEM_SELECTOR))) {
138
+ if (item.hasAttribute("role") || item.matches("a[href], button, input, select, textarea")) continue;
139
+ const isMenuItem = popupRole === "menu" || getLevelRoot(item) != null;
140
+ if (!isMenuItem && getSubmenuOfItem(item)) continue;
141
+ item.setAttribute("role", isMenuItem ? "menuitem" : "option");
101
142
  }
102
143
  };
103
144
  var expandItem = (item, onToggleSubmenu) => {
104
145
  const submenu = getSubmenuOfItem(item);
105
146
  if (!submenu) return;
106
- ensureSubmenuAria(item, submenu);
147
+ ensureSubmenuARIA(item, submenu);
107
148
  if (isItemExpanded(item)) return;
108
149
  item.setAttribute("aria-expanded", "true");
109
150
  onToggleSubmenu?.(item, true);
@@ -182,15 +223,16 @@ var setActiveItem = ({ dropdownElement, element, event, index, indexAddend, isEx
182
223
  const nextActiveItem = itemElements[nextActiveIndex];
183
224
  if (nextActiveItem == null || nextActiveItem === currentDeepest) return currentDeepest;
184
225
  setActiveChain(dropdownElement, nextActiveItem);
185
- const label = getItemLabel(nextActiveItem);
186
- const value = nextActiveItem.dataset.uktValue ?? label;
187
- onActiveItem?.({
188
- element: nextActiveItem,
189
- event,
190
- label,
191
- path: getItemPath(nextActiveItem),
192
- value
193
- });
226
+ if (event) {
227
+ const label = getItemLabel(nextActiveItem);
228
+ onActiveItem?.({
229
+ element: nextActiveItem,
230
+ event,
231
+ label,
232
+ path: getItemPath(nextActiveItem),
233
+ value: nextActiveItem.dataset.uktValue ?? label
234
+ });
235
+ }
194
236
  let { parentElement } = nextActiveItem;
195
237
  let scrollableParent = null;
196
238
  while (!scrollableParent && parentElement && parentElement !== dropdownElement) if (parentElement.scrollHeight > parentElement.clientHeight + 15) scrollableParent = parentElement;
@@ -280,7 +322,7 @@ function Menubar(t0) {
280
322
  if (key !== "ArrowLeft" && key !== "ArrowRight") return;
281
323
  const members_0 = getOrderedMembers();
282
324
  if (members_0.length < 2) return;
283
- if (members_0.some(_temp$1)) return;
325
+ if (members_0.some(_temp)) return;
284
326
  const eventTarget = event.target;
285
327
  const index_0 = members_0.findIndex((member_3) => member_3.element.contains(eventTarget));
286
328
  if (index_0 === -1) return;
@@ -360,7 +402,7 @@ function Menubar(t0) {
360
402
  } else t10 = $[14];
361
403
  return t10;
362
404
  }
363
- function _temp$1(member_2) {
405
+ function _temp(member_2) {
364
406
  return member_2.isOpen();
365
407
  }
366
408
  //#endregion
@@ -397,7 +439,7 @@ function Dropdown(props) {
397
439
  return t0;
398
440
  }
399
441
  function RootDropdown(t0) {
400
- const $ = c(147);
442
+ const $ = c(158);
401
443
  const { allowCreate, allowEmpty: t1, children, className, disabled, hasItems: t2, isOpenOnMount, isSearchable, keepOpenOnSubmit: t3, label, name, onActiveItem, onClick, onClose, onMouseDown, onMouseUp, onOpen, onSubmitItem, openOnHover, placeholder, style: styleFromProps, tabIndex, value } = t0;
402
444
  const allowEmpty = t1 === void 0 ? true : t1;
403
445
  const hasItems = t2 === void 0 ? true : t2;
@@ -409,6 +451,18 @@ function RootDropdown(t0) {
409
451
  }
410
452
  let trigger;
411
453
  if (childrenCount > 1) trigger = children[0];
454
+ const body = childrenCount > 1 ? children[1] : children;
455
+ const valueIdentity = typeof value === "string" ? value : value?.value;
456
+ let t4;
457
+ if ($[0] !== allowCreate || $[1] !== body || $[2] !== isSearchable || $[3] !== value) {
458
+ t4 = !isSearchable ? void 0 : typeof value !== "string" ? value?.label : getLabelFromChildren(body, value) ?? (allowCreate ? value : void 0);
459
+ $[0] = allowCreate;
460
+ $[1] = body;
461
+ $[2] = isSearchable;
462
+ $[3] = value;
463
+ $[4] = t4;
464
+ } else t4 = $[4];
465
+ const valueLabel = t4;
412
466
  const [isOpen, setIsOpen] = useState(isOpenOnMount ?? false);
413
467
  const [isOpening, setIsOpening] = useState(!isOpenOnMount);
414
468
  const [dropdownElement, setDropdownElement] = useState(null);
@@ -416,6 +470,13 @@ function RootDropdown(t0) {
416
470
  const popupRole = isSearchable ? "listbox" : hasItems ? "menu" : "dialog";
417
471
  const menubar = useContext(MenubarContext);
418
472
  const inputElementRef = useRef(null);
473
+ const consumerOwnsARIASelectedRef = useRef(false);
474
+ let t5;
475
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
476
+ t5 = /* @__PURE__ */ new WeakSet();
477
+ $[5] = t5;
478
+ } else t5 = $[5];
479
+ const annotatedBodiesRef = useRef(t5);
419
480
  const closingTimerRef = useRef(null);
420
481
  const isOpeningTimerRef = useRef(null);
421
482
  const currentInputMethodRef = useRef("mouse");
@@ -424,12 +485,12 @@ function RootDropdown(t0) {
424
485
  const mouseDownPositionRef = useRef(null);
425
486
  const disclosureTimerRef = useRef(null);
426
487
  const pendingDisclosureItemRef = useRef(null);
427
- let t4;
428
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
429
- t4 = /* @__PURE__ */ new Set();
430
- $[0] = t4;
431
- } else t4 = $[0];
432
- const submenuRegistrationsRef = useRef(t4);
488
+ let t6;
489
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
490
+ t6 = /* @__PURE__ */ new Set();
491
+ $[6] = t6;
492
+ } else t6 = $[6];
493
+ const submenuRegistrationsRef = useRef(t6);
433
494
  const pointerRef = useRef(null);
434
495
  const lastMouseEventRef = useRef(null);
435
496
  const safeAreaRef = useRef(null);
@@ -445,11 +506,11 @@ function RootDropdown(t0) {
445
506
  const onCloseRef = useRef(onClose);
446
507
  const onOpenRef = useRef(onOpen);
447
508
  const onSubmitItemRef = useRef(onSubmitItem);
448
- const valueRef = useRef(value);
449
- let t5;
450
- let t6;
451
- if ($[1] !== allowCreate || $[2] !== allowEmpty || $[3] !== hasItems || $[4] !== isOpen || $[5] !== isOpening || $[6] !== keepOpenOnSubmit || $[7] !== onClose || $[8] !== onOpen || $[9] !== onSubmitItem || $[10] !== value) {
452
- t5 = () => {
509
+ const valueRef = useRef(valueIdentity);
510
+ let t7;
511
+ let t8;
512
+ if ($[7] !== allowCreate || $[8] !== allowEmpty || $[9] !== hasItems || $[10] !== isOpen || $[11] !== isOpening || $[12] !== keepOpenOnSubmit || $[13] !== onClose || $[14] !== onOpen || $[15] !== onSubmitItem || $[16] !== valueIdentity) {
513
+ t7 = () => {
453
514
  allowCreateRef.current = allowCreate;
454
515
  allowEmptyRef.current = allowEmpty;
455
516
  hasItemsRef.current = hasItems;
@@ -459,9 +520,9 @@ function RootDropdown(t0) {
459
520
  onCloseRef.current = onClose;
460
521
  onOpenRef.current = onOpen;
461
522
  onSubmitItemRef.current = onSubmitItem;
462
- valueRef.current = value;
523
+ valueRef.current = valueIdentity;
463
524
  };
464
- t6 = [
525
+ t8 = [
465
526
  allowCreate,
466
527
  allowEmpty,
467
528
  hasItems,
@@ -471,30 +532,30 @@ function RootDropdown(t0) {
471
532
  onClose,
472
533
  onOpen,
473
534
  onSubmitItem,
474
- value
535
+ valueIdentity
475
536
  ];
476
- $[1] = allowCreate;
477
- $[2] = allowEmpty;
478
- $[3] = hasItems;
479
- $[4] = isOpen;
480
- $[5] = isOpening;
481
- $[6] = keepOpenOnSubmit;
482
- $[7] = onClose;
483
- $[8] = onOpen;
484
- $[9] = onSubmitItem;
485
- $[10] = value;
486
- $[11] = t5;
487
- $[12] = t6;
537
+ $[7] = allowCreate;
538
+ $[8] = allowEmpty;
539
+ $[9] = hasItems;
540
+ $[10] = isOpen;
541
+ $[11] = isOpening;
542
+ $[12] = keepOpenOnSubmit;
543
+ $[13] = onClose;
544
+ $[14] = onOpen;
545
+ $[15] = onSubmitItem;
546
+ $[16] = valueIdentity;
547
+ $[17] = t7;
548
+ $[18] = t8;
488
549
  } else {
489
- t5 = $[11];
490
- t6 = $[12];
550
+ t7 = $[17];
551
+ t8 = $[18];
491
552
  }
492
- useEffect(t5, t6);
553
+ useEffect(t7, t8);
493
554
  const isMountedRef = useRef(false);
494
- let t7;
495
- let t8;
496
- if ($[13] !== isOpen) {
497
- t7 = () => {
555
+ let t10;
556
+ let t9;
557
+ if ($[19] !== isOpen) {
558
+ t9 = () => {
498
559
  if (!isMountedRef.current) {
499
560
  isMountedRef.current = true;
500
561
  if (isOpenRef.current && onOpenRef.current) onOpenRef.current();
@@ -503,85 +564,91 @@ function RootDropdown(t0) {
503
564
  if (isOpen && onOpenRef.current) onOpenRef.current();
504
565
  else if (!isOpen && onCloseRef.current) onCloseRef.current();
505
566
  };
506
- t8 = [isOpen];
507
- $[13] = isOpen;
508
- $[14] = t7;
509
- $[15] = t8;
567
+ t10 = [isOpen];
568
+ $[19] = isOpen;
569
+ $[20] = t10;
570
+ $[21] = t9;
510
571
  } else {
511
- t7 = $[14];
512
- t8 = $[15];
572
+ t10 = $[20];
573
+ t9 = $[21];
513
574
  }
514
- useEffect(t7, t8);
515
- let t9;
516
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
517
- t9 = { registerSubmenu(registration) {
575
+ useEffect(t9, t10);
576
+ let t11;
577
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
578
+ t11 = { registerSubmenu(registration) {
518
579
  submenuRegistrationsRef.current.add(registration);
519
580
  return () => {
520
581
  submenuRegistrationsRef.current.delete(registration);
521
582
  };
522
583
  } };
523
- $[16] = t9;
524
- } else t9 = $[16];
525
- const dropdownContextValue = t9;
526
- let t10;
527
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
528
- t10 = (key, payload) => {
584
+ $[22] = t11;
585
+ } else t11 = $[22];
586
+ const dropdownContextValue = t11;
587
+ let t12;
588
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
589
+ t12 = (key, payload) => {
529
590
  if (!payload.element) return;
530
591
  for (const registration_0 of submenuRegistrationsRef.current) if (registration_0.element.contains(payload.element)) registration_0[key]?.(payload);
531
592
  };
532
- $[17] = t10;
533
- } else t10 = $[17];
534
- const dispatchToSubmenus = t10;
535
- let t11;
536
- if ($[18] !== onActiveItem) {
537
- t11 = (payload_0) => {
593
+ $[23] = t12;
594
+ } else t12 = $[23];
595
+ const dispatchToSubmenus = t12;
596
+ let t13;
597
+ if ($[24] !== onActiveItem) {
598
+ t13 = (payload_0) => {
538
599
  onActiveItem?.(payload_0);
539
600
  dispatchToSubmenus("onActiveItem", payload_0);
540
601
  };
541
- $[18] = onActiveItem;
542
- $[19] = t11;
543
- } else t11 = $[19];
544
- const handleActiveItem = t11;
545
- let t12;
546
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
547
- t12 = (item, isExpanded) => {
602
+ $[24] = onActiveItem;
603
+ $[25] = t13;
604
+ } else t13 = $[25];
605
+ const handleActiveItem = t13;
606
+ let t14;
607
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
608
+ t14 = (item, isExpanded) => {
609
+ const submenu = getSubmenuOfItem(item);
610
+ if (submenu) {
611
+ const isShown = submenu.matches(":popover-open");
612
+ if (isExpanded && !isShown) submenu.showPopover();
613
+ else if (!isExpanded && isShown) submenu.hidePopover();
614
+ }
548
615
  for (const registration_1 of submenuRegistrationsRef.current) if (registration_1.element === item) (isExpanded ? registration_1.onOpen : registration_1.onClose)?.();
549
616
  };
550
- $[20] = t12;
551
- } else t12 = $[20];
552
- const handleToggleSubmenu = t12;
553
- let t13;
554
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
555
- t13 = () => {
617
+ $[26] = t14;
618
+ } else t14 = $[26];
619
+ const handleToggleSubmenu = t14;
620
+ let t15;
621
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
622
+ t15 = () => {
556
623
  if (disclosureTimerRef.current != null) {
557
624
  clearTimeout(disclosureTimerRef.current);
558
625
  disclosureTimerRef.current = null;
559
626
  }
560
627
  pendingDisclosureItemRef.current = null;
561
628
  };
562
- $[21] = t13;
563
- } else t13 = $[21];
564
- const clearDisclosureTimer = t13;
565
- let t14;
566
- let t15;
567
- if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
568
- t14 = () => clearDisclosureTimer;
569
- t15 = [];
570
- $[22] = t14;
571
- $[23] = t15;
629
+ $[27] = t15;
630
+ } else t15 = $[27];
631
+ const clearDisclosureTimer = t15;
632
+ let t16;
633
+ let t17;
634
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
635
+ t16 = () => clearDisclosureTimer;
636
+ t17 = [];
637
+ $[28] = t16;
638
+ $[29] = t17;
572
639
  } else {
573
- t14 = $[22];
574
- t15 = $[23];
640
+ t16 = $[28];
641
+ t17 = $[29];
575
642
  }
576
- useEffect(t14, t15);
577
- let t16;
578
- if ($[24] !== dropdownElement) {
579
- t16 = () => {
643
+ useEffect(t16, t17);
644
+ let t18;
645
+ if ($[30] !== dropdownElement) {
646
+ t18 = () => {
580
647
  if (!dropdownElement) return;
581
648
  const activeElement = getActiveItemElement(dropdownElement);
582
649
  collapseItemsOutsidePath(dropdownElement, activeElement, handleToggleSubmenu);
583
- const submenu = activeElement ? getSubmenuOfItem(activeElement) : null;
584
- if (activeElement && submenu && !isItemExpanded(activeElement)) {
650
+ const submenu_0 = activeElement ? getSubmenuOfItem(activeElement) : null;
651
+ if (activeElement && submenu_0 && !isItemExpanded(activeElement)) {
585
652
  if (pendingDisclosureItemRef.current === activeElement) return;
586
653
  clearDisclosureTimer();
587
654
  pendingDisclosureItemRef.current = activeElement;
@@ -595,41 +662,41 @@ function RootDropdown(t0) {
595
662
  }
596
663
  clearDisclosureTimer();
597
664
  };
598
- $[24] = dropdownElement;
599
- $[25] = t16;
600
- } else t16 = $[25];
601
- const syncSubmenuDisclosure = t16;
602
- let t17;
603
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
604
- t17 = () => {
665
+ $[30] = dropdownElement;
666
+ $[31] = t18;
667
+ } else t18 = $[31];
668
+ const syncSubmenuDisclosure = t18;
669
+ let t19;
670
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
671
+ t19 = () => {
605
672
  if (safeAreaTimerRef.current != null) {
606
673
  clearTimeout(safeAreaTimerRef.current);
607
674
  safeAreaTimerRef.current = null;
608
675
  }
609
676
  };
610
- $[26] = t17;
611
- } else t17 = $[26];
612
- const clearSafeAreaTimer = t17;
613
- let t18;
614
- let t19;
615
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
616
- t18 = () => clearSafeAreaTimer;
617
- t19 = [];
618
- $[27] = t18;
619
- $[28] = t19;
677
+ $[32] = t19;
678
+ } else t19 = $[32];
679
+ const clearSafeAreaTimer = t19;
680
+ let t20;
681
+ let t21;
682
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
683
+ t20 = () => clearSafeAreaTimer;
684
+ t21 = [];
685
+ $[33] = t20;
686
+ $[34] = t21;
620
687
  } else {
621
- t18 = $[27];
622
- t19 = $[28];
688
+ t20 = $[33];
689
+ t21 = $[34];
623
690
  }
624
- useEffect(t18, t19);
625
- let t20;
626
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
627
- t20 = (x, y) => {
691
+ useEffect(t20, t21);
692
+ let t22;
693
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
694
+ t22 = (x, y) => {
628
695
  const safeArea = safeAreaRef.current;
629
696
  if (!safeArea || !isItemExpanded(safeArea.parent)) return false;
630
- const submenu_0 = getSubmenuOfItem(safeArea.parent);
631
- if (!submenu_0) return false;
632
- const submenuRect = submenu_0.getBoundingClientRect();
697
+ const submenu_1 = getSubmenuOfItem(safeArea.parent);
698
+ if (!submenu_1) return false;
699
+ const submenuRect = submenu_1.getBoundingClientRect();
633
700
  const parentRect = safeArea.parent.getBoundingClientRect();
634
701
  const nearX = submenuRect.left >= parentRect.right - 1 ? submenuRect.left : submenuRect.right;
635
702
  return isPointInTriangle({
@@ -643,12 +710,12 @@ function RootDropdown(t0) {
643
710
  y: submenuRect.bottom
644
711
  });
645
712
  };
646
- $[29] = t20;
647
- } else t20 = $[29];
648
- const isPointerInSafeArea = t20;
649
- let t21;
650
- if ($[30] !== dropdownElement || $[31] !== handleActiveItem || $[32] !== syncSubmenuDisclosure) {
651
- t21 = (targetElement) => {
713
+ $[35] = t22;
714
+ } else t22 = $[35];
715
+ const isPointerInSafeArea = t22;
716
+ let t23;
717
+ if ($[36] !== dropdownElement || $[37] !== handleActiveItem || $[38] !== syncSubmenuDisclosure) {
718
+ t23 = (targetElement) => {
652
719
  clearSafeAreaTimer();
653
720
  safeAreaRef.current = null;
654
721
  wasInSafeAreaRef.current = false;
@@ -665,15 +732,15 @@ function RootDropdown(t0) {
665
732
  });
666
733
  syncSubmenuDisclosure();
667
734
  };
668
- $[30] = dropdownElement;
669
- $[31] = handleActiveItem;
670
- $[32] = syncSubmenuDisclosure;
671
- $[33] = t21;
672
- } else t21 = $[33];
673
- const commitPointerTarget = t21;
674
- let t22;
675
- if ($[34] !== commitPointerTarget || $[35] !== dropdownElement) {
676
- t22 = (event_0) => {
735
+ $[36] = dropdownElement;
736
+ $[37] = handleActiveItem;
737
+ $[38] = syncSubmenuDisclosure;
738
+ $[39] = t23;
739
+ } else t23 = $[39];
740
+ const commitPointerTarget = t23;
741
+ let t24;
742
+ if ($[40] !== commitPointerTarget || $[41] !== dropdownElement) {
743
+ t24 = (event_0) => {
677
744
  if (!dropdownElement || !isOpenRef.current || !hasItemsRef.current) return;
678
745
  const pointer_0 = {
679
746
  x: event_0.clientX,
@@ -689,8 +756,8 @@ function RootDropdown(t0) {
689
756
  return;
690
757
  }
691
758
  const target_0 = event_0.target;
692
- const submenu_1 = getSubmenuOfItem(parent);
693
- if (parent.contains(target_0) && !(submenu_1?.contains(target_0) ?? false)) {
759
+ const submenu_2 = getSubmenuOfItem(parent);
760
+ if (parent.contains(target_0) && !(submenu_2?.contains(target_0) ?? false)) {
694
761
  safeAreaRef.current = {
695
762
  apex: pointer_0,
696
763
  parent
@@ -706,37 +773,37 @@ function RootDropdown(t0) {
706
773
  safeAreaTimerRef.current = setTimeout(commitPointerTarget, SAFE_AREA_TIMEOUT);
707
774
  } else if (wasInSafeAreaRef.current) commitPointerTarget(target_0);
708
775
  };
709
- $[34] = commitPointerTarget;
710
- $[35] = dropdownElement;
711
- $[36] = t22;
712
- } else t22 = $[36];
713
- const trackSafeArea = t22;
714
- let t23;
715
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
716
- t23 = () => {
776
+ $[40] = commitPointerTarget;
777
+ $[41] = dropdownElement;
778
+ $[42] = t24;
779
+ } else t24 = $[42];
780
+ const trackSafeArea = t24;
781
+ let t25;
782
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
783
+ t25 = () => {
717
784
  if (hoverCloseTimerRef.current != null) {
718
785
  clearTimeout(hoverCloseTimerRef.current);
719
786
  hoverCloseTimerRef.current = null;
720
787
  }
721
788
  };
722
- $[37] = t23;
723
- } else t23 = $[37];
724
- const clearHoverCloseTimer = t23;
725
- let t24;
726
- let t25;
727
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
728
- t24 = () => clearHoverCloseTimer;
729
- t25 = [];
730
- $[38] = t24;
731
- $[39] = t25;
789
+ $[43] = t25;
790
+ } else t25 = $[43];
791
+ const clearHoverCloseTimer = t25;
792
+ let t26;
793
+ let t27;
794
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
795
+ t26 = () => clearHoverCloseTimer;
796
+ t27 = [];
797
+ $[44] = t26;
798
+ $[45] = t27;
732
799
  } else {
733
- t24 = $[38];
734
- t25 = $[39];
800
+ t26 = $[44];
801
+ t27 = $[45];
735
802
  }
736
- useEffect(t24, t25);
737
- let t26;
738
- if ($[40] !== dropdownElement || $[41] !== menubar) {
739
- t26 = (options) => {
803
+ useEffect(t26, t27);
804
+ let t28;
805
+ if ($[46] !== dropdownElement || $[47] !== menubar) {
806
+ t28 = (options) => {
740
807
  setIsOpen(false);
741
808
  setIsOpening(false);
742
809
  mouseDownPositionRef.current = null;
@@ -751,51 +818,51 @@ function RootDropdown(t0) {
751
818
  }
752
819
  if (menubar && dropdownElement && !options?.keepMenubarEngaged) menubar.notifyClosed(dropdownElement);
753
820
  };
754
- $[40] = dropdownElement;
755
- $[41] = menubar;
756
- $[42] = t26;
757
- } else t26 = $[42];
758
- const closeDropdown = t26;
759
- let t27;
760
- if ($[43] !== openOnHover) {
761
- t27 = () => {
821
+ $[46] = dropdownElement;
822
+ $[47] = menubar;
823
+ $[48] = t28;
824
+ } else t28 = $[48];
825
+ const closeDropdown = t28;
826
+ let t29;
827
+ if ($[49] !== openOnHover) {
828
+ t29 = () => {
762
829
  clearHoverCloseTimer();
763
830
  if (!openOnHover || isOpenRef.current) return;
764
831
  setIsOpen(true);
765
832
  setIsOpening(false);
766
833
  };
767
- $[43] = openOnHover;
768
- $[44] = t27;
769
- } else t27 = $[44];
770
- const handleDropdownMouseEnter = t27;
771
- let t28;
772
- if ($[45] !== closeDropdown || $[46] !== openOnHover) {
773
- t28 = () => {
834
+ $[49] = openOnHover;
835
+ $[50] = t29;
836
+ } else t29 = $[50];
837
+ const handleDropdownMouseEnter = t29;
838
+ let t30;
839
+ if ($[51] !== closeDropdown || $[52] !== openOnHover) {
840
+ t30 = () => {
774
841
  if (!openOnHover || !isOpenRef.current || hoverCloseTimerRef.current != null) return;
775
842
  hoverCloseTimerRef.current = setTimeout(() => {
776
843
  hoverCloseTimerRef.current = null;
777
844
  closeDropdown();
778
845
  }, HOVER_CLOSE_DELAY);
779
846
  };
780
- $[45] = closeDropdown;
781
- $[46] = openOnHover;
782
- $[47] = t28;
783
- } else t28 = $[47];
784
- const handleDropdownMouseLeave = t28;
785
- let t29;
786
- if ($[48] !== dropdownElement?.firstElementChild) {
787
- t29 = () => {
847
+ $[51] = closeDropdown;
848
+ $[52] = openOnHover;
849
+ $[53] = t30;
850
+ } else t30 = $[53];
851
+ const handleDropdownMouseLeave = t30;
852
+ let t31;
853
+ if ($[54] !== dropdownElement?.firstElementChild) {
854
+ t31 = () => {
788
855
  const firstChild = dropdownElement?.firstElementChild;
789
856
  if (!firstChild) return;
790
857
  (firstChild.matches(FOCUSABLE_SELECTOR) ? firstChild : firstChild.querySelector(FOCUSABLE_SELECTOR))?.focus();
791
858
  };
792
- $[48] = dropdownElement?.firstElementChild;
793
- $[49] = t29;
794
- } else t29 = $[49];
795
- const focusTrigger = t29;
796
- let t30;
797
- if ($[50] !== closeDropdown || $[51] !== dropdownElement || $[52] !== focusTrigger || $[53] !== menubar) {
798
- t30 = () => {
859
+ $[54] = dropdownElement?.firstElementChild;
860
+ $[55] = t31;
861
+ } else t31 = $[55];
862
+ const focusTrigger = t31;
863
+ let t32;
864
+ if ($[56] !== closeDropdown || $[57] !== dropdownElement || $[58] !== focusTrigger || $[59] !== menubar) {
865
+ t32 = () => {
799
866
  if (!menubar || !dropdownElement) return;
800
867
  return menubar.registerMember({
801
868
  close: () => closeDropdown({ keepMenubarEngaged: true }),
@@ -805,37 +872,37 @@ function RootDropdown(t0) {
805
872
  open: () => setIsOpen(true)
806
873
  });
807
874
  };
808
- $[50] = closeDropdown;
809
- $[51] = dropdownElement;
810
- $[52] = focusTrigger;
811
- $[53] = menubar;
812
- $[54] = t30;
813
- } else t30 = $[54];
814
- useEffect(t30);
815
- let t31;
816
- let t32;
817
- if ($[55] !== dropdownElement || $[56] !== isOpen || $[57] !== menubar) {
818
- t31 = () => {
875
+ $[56] = closeDropdown;
876
+ $[57] = dropdownElement;
877
+ $[58] = focusTrigger;
878
+ $[59] = menubar;
879
+ $[60] = t32;
880
+ } else t32 = $[60];
881
+ useEffect(t32);
882
+ let t33;
883
+ let t34;
884
+ if ($[61] !== dropdownElement || $[62] !== isOpen || $[63] !== menubar) {
885
+ t33 = () => {
819
886
  if (isOpen && menubar && dropdownElement) menubar.notifyOpened(dropdownElement);
820
887
  };
821
- t32 = [
888
+ t34 = [
822
889
  dropdownElement,
823
890
  isOpen,
824
891
  menubar
825
892
  ];
826
- $[55] = dropdownElement;
827
- $[56] = isOpen;
828
- $[57] = menubar;
829
- $[58] = t31;
830
- $[59] = t32;
893
+ $[61] = dropdownElement;
894
+ $[62] = isOpen;
895
+ $[63] = menubar;
896
+ $[64] = t33;
897
+ $[65] = t34;
831
898
  } else {
832
- t31 = $[58];
833
- t32 = $[59];
899
+ t33 = $[64];
900
+ t34 = $[65];
834
901
  }
835
- useEffect(t31, t32);
836
- let t33;
837
- if ($[60] !== closeDropdown || $[61] !== dropdownElement || $[62] !== handleActiveItem) {
838
- t33 = (event_1) => {
902
+ useEffect(t33, t34);
903
+ let t35;
904
+ if ($[66] !== closeDropdown || $[67] !== dropdownElement || $[68] !== handleActiveItem || $[69] !== popupRole) {
905
+ t35 = (event_1) => {
839
906
  const element = hasItemsRef.current ? getActiveItemElement(dropdownElement) : null;
840
907
  const submenuOfActive = element ? getSubmenuOfItem(element) : null;
841
908
  if (element && submenuOfActive) {
@@ -868,6 +935,11 @@ function RootDropdown(t0) {
868
935
  }
869
936
  const nextValue = element?.dataset.uktValue ?? itemLabel;
870
937
  if (valueRef.current && valueRef.current === nextValue) return;
938
+ if (element && keepOpenOnSubmitRef.current && popupRole === "listbox" && !consumerOwnsARIASelectedRef.current) {
939
+ const bodyElement = element.closest(".uktdropdown-body");
940
+ for (const selected of Array.from(bodyElement?.querySelectorAll("[aria-selected=\"true\"]") ?? [])) selected.removeAttribute("aria-selected");
941
+ element.setAttribute("aria-selected", "true");
942
+ }
871
943
  if (element) {
872
944
  const eventTarget = event_1.target;
873
945
  if (element.matches(CLICKABLE_SELECTOR)) {
@@ -890,15 +962,16 @@ function RootDropdown(t0) {
890
962
  onSubmitItemRef.current?.(payload_1);
891
963
  dispatchToSubmenus("onSubmitItem", payload_1);
892
964
  };
893
- $[60] = closeDropdown;
894
- $[61] = dropdownElement;
895
- $[62] = handleActiveItem;
896
- $[63] = t33;
897
- } else t33 = $[63];
898
- const handleSubmitItem = t33;
899
- let t34;
900
- if ($[64] !== trackSafeArea) {
901
- t34 = (event_2) => {
965
+ $[66] = closeDropdown;
966
+ $[67] = dropdownElement;
967
+ $[68] = handleActiveItem;
968
+ $[69] = popupRole;
969
+ $[70] = t35;
970
+ } else t35 = $[70];
971
+ const handleSubmitItem = t35;
972
+ let t36;
973
+ if ($[71] !== trackSafeArea) {
974
+ t36 = (event_2) => {
902
975
  const { clientX, clientY } = event_2;
903
976
  currentInputMethodRef.current = "mouse";
904
977
  trackSafeArea(event_2);
@@ -907,13 +980,13 @@ function RootDropdown(t0) {
907
980
  if (Math.abs(initialPosition.clientX - clientX) < 12 && Math.abs(initialPosition.clientY - clientY) < 12) return;
908
981
  setIsOpening(false);
909
982
  };
910
- $[64] = trackSafeArea;
911
- $[65] = t34;
912
- } else t34 = $[65];
913
- const handleMouseMove = t34;
914
- let t35;
915
- if ($[66] !== dropdownElement || $[67] !== handleActiveItem || $[68] !== syncSubmenuDisclosure) {
916
- t35 = (event_3) => {
983
+ $[71] = trackSafeArea;
984
+ $[72] = t36;
985
+ } else t36 = $[72];
986
+ const handleMouseMove = t36;
987
+ let t37;
988
+ if ($[73] !== dropdownElement || $[74] !== handleActiveItem || $[75] !== syncSubmenuDisclosure) {
989
+ t37 = (event_3) => {
917
990
  if (!hasItemsRef.current) return;
918
991
  if (currentInputMethodRef.current !== "mouse") return;
919
992
  if (!dropdownElement) return;
@@ -932,15 +1005,15 @@ function RootDropdown(t0) {
932
1005
  });
933
1006
  syncSubmenuDisclosure();
934
1007
  };
935
- $[66] = dropdownElement;
936
- $[67] = handleActiveItem;
937
- $[68] = syncSubmenuDisclosure;
938
- $[69] = t35;
939
- } else t35 = $[69];
940
- const handleMouseOver = t35;
941
- let t36;
942
- if ($[70] !== dropdownElement || $[71] !== syncSubmenuDisclosure) {
943
- t36 = (event_4) => {
1008
+ $[73] = dropdownElement;
1009
+ $[74] = handleActiveItem;
1010
+ $[75] = syncSubmenuDisclosure;
1011
+ $[76] = t37;
1012
+ } else t37 = $[76];
1013
+ const handleMouseOver = t37;
1014
+ let t38;
1015
+ if ($[77] !== dropdownElement || $[78] !== syncSubmenuDisclosure) {
1016
+ t38 = (event_4) => {
944
1017
  if (!hasItemsRef.current) return;
945
1018
  const relatedTarget = event_4.relatedTarget;
946
1019
  if (!dropdownElement?.contains(relatedTarget)) {
@@ -956,14 +1029,14 @@ function RootDropdown(t0) {
956
1029
  delete activeItem.dataset.uktActive;
957
1030
  syncSubmenuDisclosure();
958
1031
  };
959
- $[70] = dropdownElement;
960
- $[71] = syncSubmenuDisclosure;
961
- $[72] = t36;
962
- } else t36 = $[72];
963
- const handleMouseOut = t36;
964
- let t37;
965
- if ($[73] !== onMouseDown) {
966
- t37 = (event_5) => {
1032
+ $[77] = dropdownElement;
1033
+ $[78] = syncSubmenuDisclosure;
1034
+ $[79] = t38;
1035
+ } else t38 = $[79];
1036
+ const handleMouseOut = t38;
1037
+ let t39;
1038
+ if ($[80] !== onMouseDown) {
1039
+ t39 = (event_5) => {
967
1040
  if (onMouseDown) onMouseDown(event_5);
968
1041
  if (isOpenRef.current) return;
969
1042
  setIsOpen(true);
@@ -977,13 +1050,13 @@ function RootDropdown(t0) {
977
1050
  isOpeningTimerRef.current = null;
978
1051
  }, 1e3);
979
1052
  };
980
- $[73] = onMouseDown;
981
- $[74] = t37;
982
- } else t37 = $[74];
983
- const handleMouseDown = t37;
984
- let t38;
985
- if ($[75] !== closeDropdown || $[76] !== dropdownElement || $[77] !== handleActiveItem || $[78] !== handleSubmitItem || $[79] !== onMouseUp) {
986
- t38 = (event_6) => {
1053
+ $[80] = onMouseDown;
1054
+ $[81] = t39;
1055
+ } else t39 = $[81];
1056
+ const handleMouseDown = t39;
1057
+ let t40;
1058
+ if ($[82] !== closeDropdown || $[83] !== dropdownElement || $[84] !== handleActiveItem || $[85] !== handleSubmitItem || $[86] !== onMouseUp) {
1059
+ t40 = (event_6) => {
987
1060
  if (onMouseUp) onMouseUp(event_6);
988
1061
  if (isOpeningRef.current || !isOpenRef.current || closingTimerRef.current != null) return;
989
1062
  const eventTarget_1 = event_6.target;
@@ -1007,17 +1080,17 @@ function RootDropdown(t0) {
1007
1080
  }
1008
1081
  handleSubmitItem(event_6);
1009
1082
  };
1010
- $[75] = closeDropdown;
1011
- $[76] = dropdownElement;
1012
- $[77] = handleActiveItem;
1013
- $[78] = handleSubmitItem;
1014
- $[79] = onMouseUp;
1015
- $[80] = t38;
1016
- } else t38 = $[80];
1017
- const handleMouseUp = t38;
1018
- let t39;
1019
- if ($[81] !== closeDropdown || $[82] !== dropdownElement || $[83] !== focusTrigger || $[84] !== handleActiveItem || $[85] !== handleSubmitItem || $[86] !== menubar || $[87] !== syncSubmenuDisclosure) {
1020
- t39 = (event_7) => {
1083
+ $[82] = closeDropdown;
1084
+ $[83] = dropdownElement;
1085
+ $[84] = handleActiveItem;
1086
+ $[85] = handleSubmitItem;
1087
+ $[86] = onMouseUp;
1088
+ $[87] = t40;
1089
+ } else t40 = $[87];
1090
+ const handleMouseUp = t40;
1091
+ let t41;
1092
+ if ($[88] !== closeDropdown || $[89] !== dropdownElement || $[90] !== focusTrigger || $[91] !== handleActiveItem || $[92] !== handleSubmitItem || $[93] !== menubar || $[94] !== syncSubmenuDisclosure) {
1093
+ t41 = (event_7) => {
1021
1094
  const { altKey, ctrlKey, key: key_0, metaKey } = event_7;
1022
1095
  const eventTarget_2 = event_7.target;
1023
1096
  if (!dropdownElement) return;
@@ -1111,12 +1184,12 @@ function RootDropdown(t0) {
1111
1184
  if (!isTargetUsingKeyEvents) {
1112
1185
  if (key_0 === "ArrowRight") {
1113
1186
  const activeElement_0 = getActiveItemElement(dropdownElement);
1114
- const submenu_2 = activeElement_0 ? getSubmenuOfItem(activeElement_0) : null;
1115
- if (activeElement_0 && submenu_2) {
1187
+ const submenu_3 = activeElement_0 ? getSubmenuOfItem(activeElement_0) : null;
1188
+ if (activeElement_0 && submenu_3) {
1116
1189
  onEventHandled();
1117
1190
  clearDisclosureTimer();
1118
1191
  expandItem(activeElement_0, handleToggleSubmenu);
1119
- const firstItem_0 = getItemElements(dropdownElement, submenu_2)?.[0];
1192
+ const firstItem_0 = getItemElements(dropdownElement, submenu_3)?.[0];
1120
1193
  if (firstItem_0) setActiveItem({
1121
1194
  dropdownElement,
1122
1195
  element: firstItem_0,
@@ -1150,29 +1223,29 @@ function RootDropdown(t0) {
1150
1223
  }
1151
1224
  }
1152
1225
  };
1153
- $[81] = closeDropdown;
1154
- $[82] = dropdownElement;
1155
- $[83] = focusTrigger;
1156
- $[84] = handleActiveItem;
1157
- $[85] = handleSubmitItem;
1158
- $[86] = menubar;
1159
- $[87] = syncSubmenuDisclosure;
1160
- $[88] = t39;
1161
- } else t39 = $[88];
1162
- const handleKeyDown = t39;
1163
- let t40;
1164
- if ($[89] !== handleKeyDown) {
1165
- t40 = {
1226
+ $[88] = closeDropdown;
1227
+ $[89] = dropdownElement;
1228
+ $[90] = focusTrigger;
1229
+ $[91] = handleActiveItem;
1230
+ $[92] = handleSubmitItem;
1231
+ $[93] = menubar;
1232
+ $[94] = syncSubmenuDisclosure;
1233
+ $[95] = t41;
1234
+ } else t41 = $[95];
1235
+ const handleKeyDown = t41;
1236
+ let t42;
1237
+ if ($[96] !== handleKeyDown) {
1238
+ t42 = {
1166
1239
  ignoreUsedKeyboardEvents: false,
1167
1240
  onKeyDown: handleKeyDown
1168
1241
  };
1169
- $[89] = handleKeyDown;
1170
- $[90] = t40;
1171
- } else t40 = $[90];
1172
- useKeyboardEvents(t40);
1173
- let t41;
1174
- if ($[91] !== closeDropdown || $[92] !== handleActiveItem || $[93] !== isOpenOnMount) {
1175
- t41 = (ref) => {
1242
+ $[96] = handleKeyDown;
1243
+ $[97] = t42;
1244
+ } else t42 = $[97];
1245
+ useKeyboardEvents(t42);
1246
+ let t43;
1247
+ if ($[98] !== closeDropdown || $[99] !== handleActiveItem || $[100] !== isOpenOnMount) {
1248
+ t43 = (ref) => {
1176
1249
  setDropdownElement(ref);
1177
1250
  if (!ref) return;
1178
1251
  const { ownerDocument } = ref;
@@ -1182,13 +1255,13 @@ function RootDropdown(t0) {
1182
1255
  else inputElement = ref.firstElementChild.querySelector(TEXT_INPUT_SELECTOR);
1183
1256
  inputElementRef.current = inputElement;
1184
1257
  }
1185
- const handleGlobalMouseDown = (t42) => {
1186
- const { target: target_1 } = t42;
1258
+ const handleGlobalMouseDown = (t44) => {
1259
+ const { target: target_1 } = t44;
1187
1260
  const eventTarget_3 = target_1;
1188
1261
  if (!ref.contains(eventTarget_3)) closeDropdown();
1189
1262
  };
1190
- const handleGlobalMouseUp = (t43) => {
1191
- const { target: target_2 } = t43;
1263
+ const handleGlobalMouseUp = (t45) => {
1264
+ const { target: target_2 } = t45;
1192
1265
  if (!isOpenRef.current || closingTimerRef.current != null) return;
1193
1266
  if (isOpeningRef.current) {
1194
1267
  setIsOpening(false);
@@ -1201,8 +1274,8 @@ function RootDropdown(t0) {
1201
1274
  const eventTarget_4 = target_2;
1202
1275
  if (!ref.contains(eventTarget_4)) closeDropdown();
1203
1276
  };
1204
- const handleGlobalFocusIn = (t44) => {
1205
- const { target: target_3 } = t44;
1277
+ const handleGlobalFocusIn = (t46) => {
1278
+ const { target: target_3 } = t46;
1206
1279
  if (!isOpenRef.current) return;
1207
1280
  const eventTarget_5 = target_3;
1208
1281
  if (ref.contains(eventTarget_5) || eventTarget_5.contains(ref)) return;
@@ -1244,52 +1317,78 @@ function RootDropdown(t0) {
1244
1317
  if (inputElement) inputElement.removeEventListener("input", handleInput);
1245
1318
  };
1246
1319
  };
1247
- $[91] = closeDropdown;
1248
- $[92] = handleActiveItem;
1249
- $[93] = isOpenOnMount;
1250
- $[94] = t41;
1251
- } else t41 = $[94];
1252
- const handleRef = t41;
1253
- const handleBodyRef = _temp;
1320
+ $[98] = closeDropdown;
1321
+ $[99] = handleActiveItem;
1322
+ $[100] = isOpenOnMount;
1323
+ $[101] = t43;
1324
+ } else t43 = $[101];
1325
+ const handleRef = t43;
1326
+ let t44;
1327
+ if ($[102] !== dropdownElement || $[103] !== popupRole || $[104] !== valueIdentity) {
1328
+ t44 = (ref_0) => {
1329
+ if (!ref_0) return;
1330
+ if (annotatedBodiesRef.current.has(ref_0)) return;
1331
+ annotatedBodiesRef.current.add(ref_0);
1332
+ consumerOwnsARIASelectedRef.current = ref_0.querySelector("[aria-selected]") != null;
1333
+ annotateParentItems(ref_0);
1334
+ if (popupRole !== "dialog") annotateItemRoles(ref_0, popupRole);
1335
+ ref_0.showPopover();
1336
+ if (valueIdentity != null && dropdownElement) {
1337
+ const selectedItem = getItemElements(dropdownElement)?.find((item_2) => item_2.dataset.uktValue === valueIdentity);
1338
+ if (selectedItem) {
1339
+ if (popupRole === "listbox" && !consumerOwnsARIASelectedRef.current) selectedItem.setAttribute("aria-selected", "true");
1340
+ setActiveItem({
1341
+ dropdownElement,
1342
+ element: selectedItem
1343
+ });
1344
+ }
1345
+ }
1346
+ };
1347
+ $[102] = dropdownElement;
1348
+ $[103] = popupRole;
1349
+ $[104] = valueIdentity;
1350
+ $[105] = t44;
1351
+ } else t44 = $[105];
1352
+ const handleBodyRef = t44;
1254
1353
  if (!isValidElement(trigger)) if (isSearchable) {
1255
- const t42 = value ?? "";
1256
- let t43;
1257
- if ($[95] === Symbol.for("react.memo_cache_sentinel")) {
1258
- t43 = () => setIsOpen(true);
1259
- $[95] = t43;
1260
- } else t43 = $[95];
1261
- let t44;
1262
- if ($[96] !== bodyId || $[97] !== disabled || $[98] !== isOpen || $[99] !== name || $[100] !== placeholder || $[101] !== popupRole || $[102] !== t42 || $[103] !== tabIndex) {
1263
- t44 = /* @__PURE__ */ jsx("input", {
1354
+ const t45 = valueLabel ?? "";
1355
+ let t46;
1356
+ if ($[106] === Symbol.for("react.memo_cache_sentinel")) {
1357
+ t46 = () => setIsOpen(true);
1358
+ $[106] = t46;
1359
+ } else t46 = $[106];
1360
+ let t47;
1361
+ if ($[107] !== bodyId || $[108] !== disabled || $[109] !== isOpen || $[110] !== name || $[111] !== placeholder || $[112] !== popupRole || $[113] !== t45 || $[114] !== tabIndex) {
1362
+ t47 = /* @__PURE__ */ jsx("input", {
1264
1363
  "aria-controls": bodyId,
1265
1364
  "aria-expanded": isOpen,
1266
1365
  "aria-haspopup": popupRole,
1267
1366
  autoComplete: "off",
1268
1367
  className: "uktdropdown-trigger",
1269
- defaultValue: t42,
1368
+ defaultValue: t45,
1270
1369
  disabled,
1271
1370
  name,
1272
- onFocus: t43,
1371
+ onFocus: t46,
1273
1372
  placeholder,
1274
1373
  ref: inputElementRef,
1275
1374
  tabIndex,
1276
1375
  type: "text"
1277
1376
  });
1278
- $[96] = bodyId;
1279
- $[97] = disabled;
1280
- $[98] = isOpen;
1281
- $[99] = name;
1282
- $[100] = placeholder;
1283
- $[101] = popupRole;
1284
- $[102] = t42;
1285
- $[103] = tabIndex;
1286
- $[104] = t44;
1287
- } else t44 = $[104];
1288
- trigger = t44;
1377
+ $[107] = bodyId;
1378
+ $[108] = disabled;
1379
+ $[109] = isOpen;
1380
+ $[110] = name;
1381
+ $[111] = placeholder;
1382
+ $[112] = popupRole;
1383
+ $[113] = t45;
1384
+ $[114] = tabIndex;
1385
+ $[115] = t47;
1386
+ } else t47 = $[115];
1387
+ trigger = t47;
1289
1388
  } else {
1290
- let t42;
1291
- if ($[105] !== bodyId || $[106] !== isOpen || $[107] !== popupRole || $[108] !== trigger) {
1292
- t42 = /* @__PURE__ */ jsx("button", {
1389
+ let t45;
1390
+ if ($[116] !== bodyId || $[117] !== isOpen || $[118] !== popupRole || $[119] !== trigger) {
1391
+ t45 = /* @__PURE__ */ jsx("button", {
1293
1392
  "aria-controls": bodyId,
1294
1393
  "aria-expanded": isOpen,
1295
1394
  "aria-haspopup": popupRole,
@@ -1298,82 +1397,82 @@ function RootDropdown(t0) {
1298
1397
  type: "button",
1299
1398
  children: trigger
1300
1399
  });
1301
- $[105] = bodyId;
1302
- $[106] = isOpen;
1303
- $[107] = popupRole;
1304
- $[108] = trigger;
1305
- $[109] = t42;
1306
- } else t42 = $[109];
1307
- trigger = t42;
1400
+ $[116] = bodyId;
1401
+ $[117] = isOpen;
1402
+ $[118] = popupRole;
1403
+ $[119] = trigger;
1404
+ $[120] = t45;
1405
+ } else t45 = $[120];
1406
+ trigger = t45;
1308
1407
  }
1309
1408
  else {
1310
1409
  const triggerProps = trigger.props;
1311
- const t42 = trigger;
1312
- const t43 = triggerProps["aria-controls"] ?? bodyId;
1313
- const t44 = triggerProps["aria-expanded"] ?? isOpen;
1314
- const t45 = triggerProps["aria-haspopup"] ?? popupRole;
1315
- let t46;
1316
- if ($[110] !== t42 || $[111] !== t43 || $[112] !== t44 || $[113] !== t45) {
1317
- t46 = cloneElement(t42, {
1318
- "aria-controls": t43,
1319
- "aria-expanded": t44,
1320
- "aria-haspopup": t45
1410
+ const t45 = trigger;
1411
+ const t46 = triggerProps["aria-controls"] ?? bodyId;
1412
+ const t47 = triggerProps["aria-expanded"] ?? isOpen;
1413
+ const t48 = triggerProps["aria-haspopup"] ?? popupRole;
1414
+ let t49;
1415
+ if ($[121] !== t45 || $[122] !== t46 || $[123] !== t47 || $[124] !== t48) {
1416
+ t49 = cloneElement(t45, {
1417
+ "aria-controls": t46,
1418
+ "aria-expanded": t47,
1419
+ "aria-haspopup": t48
1321
1420
  });
1322
- $[110] = t42;
1323
- $[111] = t43;
1324
- $[112] = t44;
1325
- $[113] = t45;
1326
- $[114] = t46;
1327
- } else t46 = $[114];
1328
- trigger = t46;
1421
+ $[121] = t45;
1422
+ $[122] = t46;
1423
+ $[123] = t47;
1424
+ $[124] = t48;
1425
+ $[125] = t49;
1426
+ } else t49 = $[125];
1427
+ trigger = t49;
1329
1428
  }
1330
1429
  if (label != null) {
1331
- let t42;
1332
- if ($[115] !== label) {
1333
- t42 = /* @__PURE__ */ jsx("div", {
1430
+ let t45;
1431
+ if ($[126] !== label) {
1432
+ t45 = /* @__PURE__ */ jsx("div", {
1334
1433
  className: "uktdropdown-label-text",
1335
1434
  children: label
1336
1435
  });
1337
- $[115] = label;
1338
- $[116] = t42;
1339
- } else t42 = $[116];
1340
- let t43;
1341
- if ($[117] !== t42 || $[118] !== trigger) {
1342
- t43 = /* @__PURE__ */ jsxs("label", {
1436
+ $[126] = label;
1437
+ $[127] = t45;
1438
+ } else t45 = $[127];
1439
+ let t46;
1440
+ if ($[128] !== t45 || $[129] !== trigger) {
1441
+ t46 = /* @__PURE__ */ jsxs("label", {
1343
1442
  className: "uktdropdown-label",
1344
- children: [t42, trigger]
1443
+ children: [t45, trigger]
1345
1444
  });
1346
- $[117] = t42;
1347
- $[118] = trigger;
1348
- $[119] = t43;
1349
- } else t43 = $[119];
1350
- trigger = t43;
1445
+ $[128] = t45;
1446
+ $[129] = trigger;
1447
+ $[130] = t46;
1448
+ } else t46 = $[130];
1449
+ trigger = t46;
1351
1450
  }
1352
- let t42;
1353
- if ($[120] === Symbol.for("react.memo_cache_sentinel")) {
1354
- t42 = /* @__PURE__ */ jsx("style", {
1451
+ let t45;
1452
+ if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
1453
+ t45 = /* @__PURE__ */ jsx("style", {
1355
1454
  href: "@acusti/dropdown/Dropdown",
1356
1455
  precedence: "medium",
1357
1456
  children: Dropdown_default
1358
1457
  });
1359
- $[120] = t42;
1360
- } else t42 = $[120];
1361
- let t43;
1362
- if ($[121] !== className || $[122] !== disabled || $[123] !== isOpen || $[124] !== isSearchable) {
1363
- t43 = clsx("uktdropdown", className, {
1458
+ $[131] = t45;
1459
+ } else t45 = $[131];
1460
+ let t46;
1461
+ if ($[132] !== className || $[133] !== disabled || $[134] !== isOpen || $[135] !== isSearchable) {
1462
+ t46 = clsx("uktdropdown", className, {
1364
1463
  disabled,
1365
1464
  "is-open": isOpen,
1366
1465
  "is-searchable": isSearchable
1367
1466
  });
1368
- $[121] = className;
1369
- $[122] = disabled;
1370
- $[123] = isOpen;
1371
- $[124] = isSearchable;
1372
- $[125] = t43;
1373
- } else t43 = $[125];
1374
- let t44;
1375
- if ($[126] !== bodyId || $[127] !== children || $[128] !== childrenCount || $[129] !== hasItems || $[130] !== isOpen || $[131] !== popupRole) {
1376
- t44 = isOpen ? /* @__PURE__ */ jsx("div", {
1467
+ $[132] = className;
1468
+ $[133] = disabled;
1469
+ $[134] = isOpen;
1470
+ $[135] = isSearchable;
1471
+ $[136] = t46;
1472
+ } else t46 = $[136];
1473
+ let t47;
1474
+ if ($[137] !== body || $[138] !== bodyId || $[139] !== handleBodyRef || $[140] !== hasItems || $[141] !== isOpen || $[142] !== popupRole) {
1475
+ t47 = isOpen ? /* @__PURE__ */ jsx("div", {
1377
1476
  className: clsx("uktdropdown-body", { "has-items": hasItems }),
1378
1477
  id: bodyId,
1379
1478
  popover: "manual",
@@ -1383,22 +1482,22 @@ function RootDropdown(t0) {
1383
1482
  className: "uktdropdown-content",
1384
1483
  children: /* @__PURE__ */ jsx(DropdownContext.Provider, {
1385
1484
  value: hasItems ? dropdownContextValue : null,
1386
- children: childrenCount > 1 ? children[1] : children
1485
+ children: body
1387
1486
  })
1388
1487
  })
1389
1488
  }) : null;
1390
- $[126] = bodyId;
1391
- $[127] = children;
1392
- $[128] = childrenCount;
1393
- $[129] = hasItems;
1394
- $[130] = isOpen;
1395
- $[131] = popupRole;
1396
- $[132] = t44;
1397
- } else t44 = $[132];
1398
- let t45;
1399
- if ($[133] !== handleDropdownMouseEnter || $[134] !== handleDropdownMouseLeave || $[135] !== handleMouseDown || $[136] !== handleMouseMove || $[137] !== handleMouseOut || $[138] !== handleMouseOver || $[139] !== handleMouseUp || $[140] !== handleRef || $[141] !== onClick || $[142] !== styleFromProps || $[143] !== t43 || $[144] !== t44 || $[145] !== trigger) {
1400
- t45 = /* @__PURE__ */ jsxs(Fragment, { children: [t42, /* @__PURE__ */ jsxs("div", {
1401
- className: t43,
1489
+ $[137] = body;
1490
+ $[138] = bodyId;
1491
+ $[139] = handleBodyRef;
1492
+ $[140] = hasItems;
1493
+ $[141] = isOpen;
1494
+ $[142] = popupRole;
1495
+ $[143] = t47;
1496
+ } else t47 = $[143];
1497
+ let t48;
1498
+ if ($[144] !== handleDropdownMouseEnter || $[145] !== handleDropdownMouseLeave || $[146] !== handleMouseDown || $[147] !== handleMouseMove || $[148] !== handleMouseOut || $[149] !== handleMouseOver || $[150] !== handleMouseUp || $[151] !== handleRef || $[152] !== onClick || $[153] !== styleFromProps || $[154] !== t46 || $[155] !== t47 || $[156] !== trigger) {
1499
+ t48 = /* @__PURE__ */ jsxs(Fragment, { children: [t45, /* @__PURE__ */ jsxs("div", {
1500
+ className: t46,
1402
1501
  onClick,
1403
1502
  onMouseDown: handleMouseDown,
1404
1503
  onMouseEnter: handleDropdownMouseEnter,
@@ -1409,29 +1508,24 @@ function RootDropdown(t0) {
1409
1508
  onMouseUp: handleMouseUp,
1410
1509
  ref: handleRef,
1411
1510
  style: styleFromProps,
1412
- children: [trigger, t44]
1511
+ children: [trigger, t47]
1413
1512
  })] });
1414
- $[133] = handleDropdownMouseEnter;
1415
- $[134] = handleDropdownMouseLeave;
1416
- $[135] = handleMouseDown;
1417
- $[136] = handleMouseMove;
1418
- $[137] = handleMouseOut;
1419
- $[138] = handleMouseOver;
1420
- $[139] = handleMouseUp;
1421
- $[140] = handleRef;
1422
- $[141] = onClick;
1423
- $[142] = styleFromProps;
1424
- $[143] = t43;
1425
- $[144] = t44;
1426
- $[145] = trigger;
1427
- $[146] = t45;
1428
- } else t45 = $[146];
1429
- return t45;
1430
- }
1431
- function _temp(ref_0) {
1432
- if (!ref_0) return;
1433
- annotateParentItems(ref_0);
1434
- ref_0.showPopover();
1513
+ $[144] = handleDropdownMouseEnter;
1514
+ $[145] = handleDropdownMouseLeave;
1515
+ $[146] = handleMouseDown;
1516
+ $[147] = handleMouseMove;
1517
+ $[148] = handleMouseOut;
1518
+ $[149] = handleMouseOver;
1519
+ $[150] = handleMouseUp;
1520
+ $[151] = handleRef;
1521
+ $[152] = onClick;
1522
+ $[153] = styleFromProps;
1523
+ $[154] = t46;
1524
+ $[155] = t47;
1525
+ $[156] = trigger;
1526
+ $[157] = t48;
1527
+ } else t48 = $[157];
1528
+ return t48;
1435
1529
  }
1436
1530
  var INERT_SUBMENU_PROPS = [
1437
1531
  "allowCreate",
@@ -1505,8 +1599,12 @@ function SubmenuDropdown(props) {
1505
1599
  }
1506
1600
  let t3;
1507
1601
  if ($[9] !== body) {
1508
- t3 = isValidElement(body) ? cloneElement(body, { "data-ukt-submenu": "" }) : /* @__PURE__ */ jsx("div", {
1602
+ t3 = isValidElement(body) ? cloneElement(body, {
1509
1603
  "data-ukt-submenu": "",
1604
+ popover: "manual"
1605
+ }) : /* @__PURE__ */ jsx("div", {
1606
+ "data-ukt-submenu": "",
1607
+ popover: "manual",
1510
1608
  children: body
1511
1609
  });
1512
1610
  $[9] = body;