@serendie/ui 2.1.3 → 2.2.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.
Files changed (122) hide show
  1. package/dist/client.js +79 -74
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +2 -2
  7. package/dist/components/Button/Button.js +22 -21
  8. package/dist/components/DatePicker/DatePicker.d.ts +13 -0
  9. package/dist/components/DatePicker/DatePicker.js +203 -0
  10. package/dist/components/DatePicker/index.d.ts +2 -0
  11. package/dist/components/DatePicker/index.js +6 -0
  12. package/dist/components/DatePicker/parseDate.d.ts +1 -0
  13. package/dist/components/DatePicker/styles.d.ts +1 -0
  14. package/dist/components/DatePicker/styles.js +224 -0
  15. package/dist/components/IconButton/IconButton.d.ts +3 -3
  16. package/dist/components/List/ListItem.d.ts +1 -1
  17. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  18. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  19. package/dist/components/Pagination/Pagination.d.ts +1 -1
  20. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
  21. package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
  22. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
  23. package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
  24. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
  25. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
  26. package/dist/components/ProgressIndicator/index.d.ts +4 -1
  27. package/dist/components/ProgressIndicator/index.js +3 -2
  28. package/dist/components/ProgressIndicator/util.d.ts +1 -0
  29. package/dist/components/ProgressIndicator/util.js +13 -0
  30. package/dist/components/Search/Search.d.ts +1 -1
  31. package/dist/components/Select/Select.d.ts +1 -1
  32. package/dist/components/Switch/Switch.d.ts +1 -1
  33. package/dist/components/Tabs/Tabs.d.ts +1 -1
  34. package/dist/components/TextField/TextField.js +59 -156
  35. package/dist/components/Toast/Toast.d.ts +1 -1
  36. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +80 -75
  39. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
  40. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
  41. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
  42. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
  43. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
  44. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
  45. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
  47. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
  48. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
  49. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
  50. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
  51. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
  52. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
  53. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
  54. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
  55. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
  56. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
  57. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
  58. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
  59. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
  60. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
  61. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
  62. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
  63. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
  64. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
  65. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
  66. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
  68. package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
  70. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
  71. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
  72. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
  73. package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
  74. package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
  75. package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
  76. package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
  77. package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
  78. package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
  79. package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
  80. package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
  81. package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
  82. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  83. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  84. package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
  85. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
  86. package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
  87. package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
  88. package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
  89. package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
  90. package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
  91. package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
  92. package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
  93. package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
  94. package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
  98. package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
  99. package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
  100. package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
  101. package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
  102. package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
  103. package/dist/preset.d.ts +11 -1
  104. package/dist/recipes/index.d.ts +3 -2
  105. package/dist/recipes/index.js +5 -2
  106. package/dist/recipes/textFieldRecipe.d.ts +6 -0
  107. package/dist/recipes/textFieldRecipe.js +107 -0
  108. package/dist/styled-system/css/cva.js +43 -38
  109. package/dist/styled-system/recipes/create-recipe.js +37 -0
  110. package/dist/styled-system/recipes/text-field-recipe.js +61 -0
  111. package/dist/styles.css +1 -1
  112. package/dist/tokens/keyframes/index.d.ts +8 -0
  113. package/dist/tokens/keyframes/index.js +6 -2
  114. package/package.json +3 -3
  115. package/styled-system/recipes/create-recipe.js +82 -0
  116. package/styled-system/recipes/index.d.ts +2 -0
  117. package/styled-system/recipes/index.js +1 -0
  118. package/styled-system/recipes/text-field-recipe.d.ts +28 -0
  119. package/styled-system/recipes/text-field-recipe.js +72 -0
  120. package/styled-system/types/prop-type.d.ts +1 -1
  121. package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
  122. package/dist/node_modules/proxy-compare/dist/index.js +0 -7
@@ -1,12 +1,12 @@
1
1
  import { createAnatomy as de } from "../../anatomy/dist/index.js";
2
2
  import { mergeProps as ue, createMachine as ce, createGuards as he } from "../../core/dist/index.js";
3
- import { dataAttr as C, isDownloadingEvent as Y, isOpeningInNewTab as q, isSelfTarget as pe, getEventTarget as ie, isValidTabEvent as Oe, getEventKey as j, isPrintableKey as Ee, isModifierKey as me, isEditableElement as re, isContextMenuEvent as Te, getEventPoint as b, ariaAttr as Ie, isAnchorElement as fe, isHTMLElement as Pe, raf as _, observeAttributes as ye, addDomEvent as Ce, getByTypeahead as oe, clickIfLink as ve, getWindow as Re, queryAll as Se, getInitialFocus as Ne, contains as J, scrollIntoView as ke } from "../../dom-query/dist/index.js";
4
- import { getPlacementStyles as Le, getPlacementSide as Ae, getPlacement as Q } from "../../popper/dist/index.js";
5
- import { hasProp as U, cast as Z, last as Me, first as be, prev as _e, next as De } from "../../utils/dist/index.js";
6
- import { trackDismissableElement as He } from "../../dismissable/dist/index.js";
7
- import { getElementPolygon as we, isPointInPolygon as Ge } from "../../rect-utils/dist/index.js";
3
+ import { dataAttr as C, isDownloadingEvent as J, isOpeningInNewTab as Q, isSelfTarget as pe, getEventTarget as B, isValidTabEvent as Oe, getEventKey as Z, isPrintableKey as Ee, isModifierKey as me, isEditableElement as re, isContextMenuEvent as Te, getEventPoint as b, ariaAttr as Ie, isAnchorElement as fe, isHTMLElement as Pe, raf as D, observeAttributes as ye, addDomEvent as Ce, getByTypeahead as oe, clickIfLink as Re, getWindow as ve, queryAll as Se, getInitialFocus as Ne, contains as U, scrollIntoView as ke } from "../../dom-query/dist/index.js";
4
+ import { getPlacementStyles as Le, getPlacementSide as Ae, getPlacement as z } from "../../popper/dist/index.js";
5
+ import { hasProp as W, cast as ee, last as Me, first as be, isEqual as De, prev as _e, next as He } from "../../utils/dist/index.js";
6
+ import { trackDismissableElement as we } from "../../dismissable/dist/index.js";
7
+ import { getElementPolygon as Ge, isPointInPolygon as Ve } from "../../rect-utils/dist/index.js";
8
8
  import { createProps as k } from "../../types/dist/index.js";
9
- var Ve = de("menu").parts(
9
+ var Fe = de("menu").parts(
10
10
  "arrow",
11
11
  "arrowTip",
12
12
  "content",
@@ -21,7 +21,7 @@ var Ve = de("menu").parts(
21
21
  "separator",
22
22
  "trigger",
23
23
  "triggerItem"
24
- ), E = Ve.build(), w = (e) => {
24
+ ), O = Fe.build(), w = (e) => {
25
25
  var t;
26
26
  return ((t = e.ids) == null ? void 0 : t.trigger) ?? `menu:${e.id}:trigger`;
27
27
  }, ae = (e) => {
@@ -30,148 +30,149 @@ var Ve = de("menu").parts(
30
30
  }, S = (e) => {
31
31
  var t;
32
32
  return ((t = e.ids) == null ? void 0 : t.content) ?? `menu:${e.id}:content`;
33
- }, Fe = (e) => {
33
+ }, Ue = (e) => {
34
34
  var t;
35
35
  return ((t = e.ids) == null ? void 0 : t.arrow) ?? `menu:${e.id}:arrow`;
36
36
  }, se = (e) => {
37
37
  var t;
38
38
  return ((t = e.ids) == null ? void 0 : t.positioner) ?? `menu:${e.id}:popper`;
39
- }, Ue = (e, t) => {
40
- var n, r;
41
- return ((r = (n = e.ids) == null ? void 0 : n.group) == null ? void 0 : r.call(n, t)) ?? `menu:${e.id}:group:${t}`;
42
- }, N = (e, t) => `${e.id}/${t}`, f = (e) => (e == null ? void 0 : e.dataset.value) ?? null, z = (e, t) => {
43
- var n, r;
44
- return ((r = (n = e.ids) == null ? void 0 : n.groupLabel) == null ? void 0 : r.call(n, t)) ?? `menu:${e.id}:group-label:${t}`;
45
- }, I = (e) => e.getById(S(e)), ee = (e) => e.getById(se(e)), D = (e) => e.getById(w(e)), le = (e, t) => t ? e.getById(N(e, t)) : null, te = (e) => e.getById(ae(e)), L = (e) => {
39
+ }, We = (e, t) => {
40
+ var n, i;
41
+ return ((i = (n = e.ids) == null ? void 0 : n.group) == null ? void 0 : i.call(n, t)) ?? `menu:${e.id}:group:${t}`;
42
+ }, N = (e, t) => `${e.id}/${t}`, y = (e) => (e == null ? void 0 : e.dataset.value) ?? null, te = (e, t) => {
43
+ var n, i;
44
+ return ((i = (n = e.ids) == null ? void 0 : n.groupLabel) == null ? void 0 : i.call(n, t)) ?? `menu:${e.id}:group-label:${t}`;
45
+ }, I = (e) => e.getById(S(e)), ne = (e) => e.getById(se(e)), _ = (e) => e.getById(w(e)), le = (e, t) => t ? e.getById(N(e, t)) : null, x = (e) => e.getById(ae(e)), L = (e) => {
46
46
  const n = `[role^="menuitem"][data-ownedby=${CSS.escape(S(e))}]:not([data-disabled])`;
47
47
  return Se(I(e), n);
48
- }, We = (e) => be(L(e)), xe = (e) => Me(L(e)), x = (e, t) => t ? e.id === t || e.dataset.value === t : !1, Be = (e, t) => {
49
- const n = L(e), r = n.findIndex((o) => x(o, t.value));
50
- return De(n, r, { loop: t.loop ?? t.loopFocus });
51
- }, Ke = (e, t) => {
52
- const n = L(e), r = n.findIndex((o) => x(o, t.value));
53
- return _e(n, r, { loop: t.loop ?? t.loopFocus });
48
+ }, xe = (e) => be(L(e)), Be = (e) => Me(L(e)), $ = (e, t) => t ? e.id === t || e.dataset.value === t : !1, Ke = (e, t) => {
49
+ const n = L(e), i = n.findIndex((s) => $(s, t.value));
50
+ return He(n, i, { loop: t.loop ?? t.loopFocus });
54
51
  }, $e = (e, t) => {
55
- const n = L(e), r = n.find((o) => x(o, t.value));
56
- return oe(n, { state: t.typeaheadState, key: t.key, activeId: (r == null ? void 0 : r.id) ?? null });
57
- }, H = (e) => Pe(e) && (e.dataset.disabled === "" || e.hasAttribute("disabled")), Xe = (e) => {
52
+ const n = L(e), i = n.findIndex((s) => $(s, t.value));
53
+ return _e(n, i, { loop: t.loop ?? t.loopFocus });
54
+ }, Xe = (e, t) => {
55
+ const n = L(e), i = n.find((s) => $(s, t.value));
56
+ return oe(n, { state: t.typeaheadState, key: t.key, activeId: (i == null ? void 0 : i.id) ?? null });
57
+ }, H = (e) => Pe(e) && (e.dataset.disabled === "" || e.hasAttribute("disabled")), Ye = (e) => {
58
58
  var t;
59
59
  return !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem")) && !!(e != null && e.hasAttribute("aria-controls"));
60
- }, W = "menu:select";
61
- function Ye(e, t) {
60
+ }, K = "menu:select";
61
+ function qe(e, t) {
62
62
  if (!e) return;
63
- const n = Re(e), r = new n.CustomEvent(W, { detail: { value: t } });
64
- e.dispatchEvent(r);
63
+ const n = ve(e), i = new n.CustomEvent(K, { detail: { value: t } });
64
+ e.dispatchEvent(i);
65
65
  }
66
- function ot(e, t) {
67
- const { context: n, send: r, state: o, computed: g, prop: a, scope: l } = e, c = o.hasTag("open"), P = g("isSubmenu"), A = g("isTypingAhead"), B = a("composite"), K = n.get("currentPlacement"), ge = n.get("anchorPoint"), R = n.get("highlightedValue"), G = Le({
68
- ...a("positioning"),
69
- placement: ge ? "bottom" : K
66
+ function at(e, t) {
67
+ const { context: n, send: i, state: s, computed: g, prop: o, scope: l } = e, u = s.hasTag("open"), f = n.get("isSubmenu"), P = g("isTypingAhead"), X = o("composite"), Y = n.get("currentPlacement"), ge = n.get("anchorPoint"), v = n.get("highlightedValue"), G = Le({
68
+ ...o("positioning"),
69
+ placement: ge ? "bottom" : Y
70
70
  });
71
- function V(i) {
71
+ function V(r) {
72
72
  return {
73
- id: N(l, i.value),
74
- disabled: !!i.disabled,
75
- highlighted: R === i.value
73
+ id: N(l, r.value),
74
+ disabled: !!r.disabled,
75
+ highlighted: v === r.value
76
76
  };
77
77
  }
78
- function $(i) {
79
- const s = i.valueText ?? i.value;
80
- return { ...i, id: i.value, valueText: s };
78
+ function q(r) {
79
+ const a = r.valueText ?? r.value;
80
+ return { ...r, id: r.value, valueText: a };
81
81
  }
82
- function M(i) {
82
+ function A(r) {
83
83
  return {
84
- ...V($(i)),
85
- checked: !!i.checked
84
+ ...V(q(r)),
85
+ checked: !!r.checked
86
86
  };
87
87
  }
88
- function F(i) {
89
- const { closeOnSelect: s, valueText: p, value: h } = i, O = V(i), T = N(l, h);
88
+ function F(r) {
89
+ const { closeOnSelect: a, valueText: p, value: E } = r, c = V(r), T = N(l, E);
90
90
  return t.element({
91
- ...E.item.attrs,
91
+ ...O.item.attrs,
92
92
  id: T,
93
93
  role: "menuitem",
94
- "aria-disabled": Ie(O.disabled),
95
- "data-disabled": C(O.disabled),
94
+ "aria-disabled": Ie(c.disabled),
95
+ "data-disabled": C(c.disabled),
96
96
  "data-ownedby": S(l),
97
- "data-highlighted": C(O.highlighted),
98
- "data-value": h,
97
+ "data-highlighted": C(c.highlighted),
98
+ "data-value": E,
99
99
  "data-valuetext": p,
100
100
  onDragStart(d) {
101
101
  d.currentTarget.matches("a[href]") && d.preventDefault();
102
102
  },
103
103
  onPointerMove(d) {
104
- if (O.disabled || d.pointerType !== "mouse") return;
105
- const u = d.currentTarget;
106
- O.highlighted || r({ type: "ITEM_POINTERMOVE", id: T, target: u, closeOnSelect: s });
104
+ if (c.disabled || d.pointerType !== "mouse") return;
105
+ const h = d.currentTarget;
106
+ c.highlighted || i({ type: "ITEM_POINTERMOVE", id: T, target: h, closeOnSelect: a });
107
107
  },
108
108
  onPointerLeave(d) {
109
- var X;
110
- if (O.disabled || d.pointerType !== "mouse" || !((X = e.event.previous()) == null ? void 0 : X.type.includes("POINTER"))) return;
111
- const y = d.currentTarget;
112
- r({ type: "ITEM_POINTERLEAVE", id: T, target: y, closeOnSelect: s });
109
+ var j;
110
+ if (c.disabled || d.pointerType !== "mouse" || !((j = e.event.previous()) == null ? void 0 : j.type.includes("POINTER"))) return;
111
+ const M = d.currentTarget;
112
+ i({ type: "ITEM_POINTERLEAVE", id: T, target: M, closeOnSelect: a });
113
113
  },
114
114
  onPointerDown(d) {
115
- if (O.disabled) return;
116
- const u = d.currentTarget;
117
- r({ type: "ITEM_POINTERDOWN", target: u, id: T, closeOnSelect: s });
115
+ if (c.disabled) return;
116
+ const h = d.currentTarget;
117
+ i({ type: "ITEM_POINTERDOWN", target: h, id: T, closeOnSelect: a });
118
118
  },
119
119
  onClick(d) {
120
- if (Y(d) || q(d) || O.disabled) return;
121
- const u = d.currentTarget;
122
- r({ type: "ITEM_CLICK", target: u, id: T, closeOnSelect: s });
120
+ if (J(d) || Q(d) || c.disabled) return;
121
+ const h = d.currentTarget;
122
+ i({ type: "ITEM_CLICK", target: h, id: T, closeOnSelect: a });
123
123
  }
124
124
  });
125
125
  }
126
126
  return {
127
- highlightedValue: R,
128
- open: c,
129
- setOpen(i) {
130
- o.hasTag("open") !== i && r({ type: i ? "OPEN" : "CLOSE" });
127
+ highlightedValue: v,
128
+ open: u,
129
+ setOpen(r) {
130
+ s.hasTag("open") !== r && i({ type: r ? "OPEN" : "CLOSE" });
131
131
  },
132
- setHighlightedValue(i) {
133
- r({ type: "HIGHLIGHTED.SET", value: i });
132
+ setHighlightedValue(r) {
133
+ i({ type: "HIGHLIGHTED.SET", value: r });
134
134
  },
135
- setParent(i) {
136
- r({ type: "PARENT.SET", value: i, id: i.prop("id") });
135
+ setParent(r) {
136
+ i({ type: "PARENT.SET", value: r, id: r.prop("id") });
137
137
  },
138
- setChild(i) {
139
- r({ type: "CHILD.SET", value: i, id: i.prop("id") });
138
+ setChild(r) {
139
+ i({ type: "CHILD.SET", value: r, id: r.prop("id") });
140
140
  },
141
- reposition(i = {}) {
142
- r({ type: "POSITIONING.SET", options: i });
141
+ reposition(r = {}) {
142
+ i({ type: "POSITIONING.SET", options: r });
143
143
  },
144
- addItemListener(i) {
145
- const s = l.getById(i.id);
146
- if (!s) return;
144
+ addItemListener(r) {
145
+ const a = l.getById(r.id);
146
+ if (!a) return;
147
147
  const p = () => {
148
- var h;
149
- return (h = i.onSelect) == null ? void 0 : h.call(i);
148
+ var E;
149
+ return (E = r.onSelect) == null ? void 0 : E.call(r);
150
150
  };
151
- return s.addEventListener(W, p), () => s.removeEventListener(W, p);
151
+ return a.addEventListener(K, p), () => a.removeEventListener(K, p);
152
152
  },
153
153
  getContextTriggerProps() {
154
154
  return t.element({
155
- ...E.contextTrigger.attrs,
156
- dir: a("dir"),
155
+ ...O.contextTrigger.attrs,
156
+ dir: o("dir"),
157
157
  id: ae(l),
158
- onPointerDown(i) {
159
- if (i.pointerType === "mouse") return;
160
- const s = b(i);
161
- r({ type: "CONTEXT_MENU_START", point: s });
158
+ "data-state": u ? "open" : "closed",
159
+ onPointerDown(r) {
160
+ if (r.pointerType === "mouse") return;
161
+ const a = b(r);
162
+ i({ type: "CONTEXT_MENU_START", point: a });
162
163
  },
163
- onPointerCancel(i) {
164
- i.pointerType !== "mouse" && r({ type: "CONTEXT_MENU_CANCEL" });
164
+ onPointerCancel(r) {
165
+ r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
165
166
  },
166
- onPointerMove(i) {
167
- i.pointerType !== "mouse" && r({ type: "CONTEXT_MENU_CANCEL" });
167
+ onPointerMove(r) {
168
+ r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
168
169
  },
169
- onPointerUp(i) {
170
- i.pointerType !== "mouse" && r({ type: "CONTEXT_MENU_CANCEL" });
170
+ onPointerUp(r) {
171
+ r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
171
172
  },
172
- onContextMenu(i) {
173
- const s = b(i);
174
- r({ type: "CONTEXT_MENU", point: s }), i.preventDefault();
173
+ onContextMenu(r) {
174
+ const a = b(r);
175
+ i({ type: "CONTEXT_MENU", point: a }), r.preventDefault();
175
176
  },
176
177
  style: {
177
178
  WebkitTouchCallout: "none",
@@ -180,232 +181,232 @@ function ot(e, t) {
180
181
  }
181
182
  });
182
183
  },
183
- getTriggerItemProps(i) {
184
- const s = i.getTriggerProps();
185
- return ue(F({ value: s.id }), s);
184
+ getTriggerItemProps(r) {
185
+ const a = r.getTriggerProps();
186
+ return ue(F({ value: a.id }), a);
186
187
  },
187
188
  getTriggerProps() {
188
189
  return t.button({
189
- ...P ? E.triggerItem.attrs : E.trigger.attrs,
190
+ ...f ? O.triggerItem.attrs : O.trigger.attrs,
190
191
  "data-placement": n.get("currentPlacement"),
191
192
  type: "button",
192
- dir: a("dir"),
193
+ dir: o("dir"),
193
194
  id: w(l),
194
- "data-uid": a("id"),
195
- "aria-haspopup": B ? "menu" : "dialog",
195
+ "data-uid": o("id"),
196
+ "aria-haspopup": X ? "menu" : "dialog",
196
197
  "aria-controls": S(l),
197
- "aria-expanded": c || void 0,
198
- "data-state": c ? "open" : "closed",
199
- onPointerMove(i) {
200
- if (i.pointerType !== "mouse" || H(i.currentTarget) || !P) return;
201
- const p = b(i);
202
- r({ type: "TRIGGER_POINTERMOVE", target: i.currentTarget, point: p });
198
+ "aria-expanded": u || void 0,
199
+ "data-state": u ? "open" : "closed",
200
+ onPointerMove(r) {
201
+ if (r.pointerType !== "mouse" || H(r.currentTarget) || !f) return;
202
+ const p = b(r);
203
+ i({ type: "TRIGGER_POINTERMOVE", target: r.currentTarget, point: p });
203
204
  },
204
- onPointerLeave(i) {
205
- if (H(i.currentTarget) || i.pointerType !== "mouse" || !P) return;
206
- const s = b(i);
207
- r({
205
+ onPointerLeave(r) {
206
+ if (H(r.currentTarget) || r.pointerType !== "mouse" || !f) return;
207
+ const a = b(r);
208
+ i({
208
209
  type: "TRIGGER_POINTERLEAVE",
209
- target: i.currentTarget,
210
- point: s
210
+ target: r.currentTarget,
211
+ point: a
211
212
  });
212
213
  },
213
- onPointerDown(i) {
214
- H(i.currentTarget) || Te(i) || i.preventDefault();
214
+ onPointerDown(r) {
215
+ H(r.currentTarget) || Te(r) || r.preventDefault();
215
216
  },
216
- onClick(i) {
217
- i.defaultPrevented || H(i.currentTarget) || r({ type: "TRIGGER_CLICK", target: i.currentTarget });
217
+ onClick(r) {
218
+ r.defaultPrevented || H(r.currentTarget) || i({ type: "TRIGGER_CLICK", target: r.currentTarget });
218
219
  },
219
220
  onBlur() {
220
- r({ type: "TRIGGER_BLUR" });
221
+ i({ type: "TRIGGER_BLUR" });
221
222
  },
222
223
  onFocus() {
223
- r({ type: "TRIGGER_FOCUS" });
224
+ i({ type: "TRIGGER_FOCUS" });
224
225
  },
225
- onKeyDown(i) {
226
- if (i.defaultPrevented) return;
227
- const s = {
226
+ onKeyDown(r) {
227
+ if (r.defaultPrevented) return;
228
+ const a = {
228
229
  ArrowDown() {
229
- r({ type: "ARROW_DOWN" });
230
+ i({ type: "ARROW_DOWN" });
230
231
  },
231
232
  ArrowUp() {
232
- r({ type: "ARROW_UP" });
233
+ i({ type: "ARROW_UP" });
233
234
  },
234
235
  Enter() {
235
- r({ type: "ARROW_DOWN", src: "enter" });
236
+ i({ type: "ARROW_DOWN", src: "enter" });
236
237
  },
237
238
  Space() {
238
- r({ type: "ARROW_DOWN", src: "space" });
239
+ i({ type: "ARROW_DOWN", src: "space" });
239
240
  }
240
- }, p = j(i, {
241
+ }, p = Z(r, {
241
242
  orientation: "vertical",
242
- dir: a("dir")
243
- }), h = s[p];
244
- h && (i.preventDefault(), h(i));
243
+ dir: o("dir")
244
+ }), E = a[p];
245
+ E && (r.preventDefault(), E(r));
245
246
  }
246
247
  });
247
248
  },
248
249
  getIndicatorProps() {
249
250
  return t.element({
250
- ...E.indicator.attrs,
251
- dir: a("dir"),
252
- "data-state": c ? "open" : "closed"
251
+ ...O.indicator.attrs,
252
+ dir: o("dir"),
253
+ "data-state": u ? "open" : "closed"
253
254
  });
254
255
  },
255
256
  getPositionerProps() {
256
257
  return t.element({
257
- ...E.positioner.attrs,
258
- dir: a("dir"),
258
+ ...O.positioner.attrs,
259
+ dir: o("dir"),
259
260
  id: se(l),
260
261
  style: G.floating
261
262
  });
262
263
  },
263
264
  getArrowProps() {
264
265
  return t.element({
265
- id: Fe(l),
266
- ...E.arrow.attrs,
267
- dir: a("dir"),
266
+ id: Ue(l),
267
+ ...O.arrow.attrs,
268
+ dir: o("dir"),
268
269
  style: G.arrow
269
270
  });
270
271
  },
271
272
  getArrowTipProps() {
272
273
  return t.element({
273
- ...E.arrowTip.attrs,
274
- dir: a("dir"),
274
+ ...O.arrowTip.attrs,
275
+ dir: o("dir"),
275
276
  style: G.arrowTip
276
277
  });
277
278
  },
278
279
  getContentProps() {
279
280
  return t.element({
280
- ...E.content.attrs,
281
+ ...O.content.attrs,
281
282
  id: S(l),
282
- "aria-label": a("aria-label"),
283
- hidden: !c,
284
- "data-state": c ? "open" : "closed",
285
- role: B ? "menu" : "dialog",
283
+ "aria-label": o("aria-label"),
284
+ hidden: !u,
285
+ "data-state": u ? "open" : "closed",
286
+ role: X ? "menu" : "dialog",
286
287
  tabIndex: 0,
287
- dir: a("dir"),
288
+ dir: o("dir"),
288
289
  "aria-activedescendant": g("highlightedId") || void 0,
289
290
  "aria-labelledby": w(l),
290
- "data-placement": K,
291
- onPointerEnter(i) {
292
- i.pointerType === "mouse" && r({ type: "MENU_POINTERENTER" });
291
+ "data-placement": Y,
292
+ onPointerEnter(r) {
293
+ r.pointerType === "mouse" && i({ type: "MENU_POINTERENTER" });
293
294
  },
294
- onKeyDown(i) {
295
- if (i.defaultPrevented || !pe(i)) return;
296
- const s = ie(i);
297
- if (!((s == null ? void 0 : s.closest("[role=menu]")) === i.currentTarget || s === i.currentTarget)) return;
298
- if (i.key === "Tab" && !Oe(i)) {
299
- i.preventDefault();
295
+ onKeyDown(r) {
296
+ if (r.defaultPrevented || !pe(r)) return;
297
+ const a = B(r);
298
+ if (!((a == null ? void 0 : a.closest("[role=menu]")) === r.currentTarget || a === r.currentTarget)) return;
299
+ if (r.key === "Tab" && !Oe(r)) {
300
+ r.preventDefault();
300
301
  return;
301
302
  }
302
- const h = le(l, R), O = {
303
+ const E = le(l, v), c = {
303
304
  ArrowDown() {
304
- r({ type: "ARROW_DOWN" });
305
+ i({ type: "ARROW_DOWN" });
305
306
  },
306
307
  ArrowUp() {
307
- r({ type: "ARROW_UP" });
308
+ i({ type: "ARROW_UP" });
308
309
  },
309
310
  ArrowLeft() {
310
- r({ type: "ARROW_LEFT" });
311
+ i({ type: "ARROW_LEFT" });
311
312
  },
312
313
  ArrowRight() {
313
- r({ type: "ARROW_RIGHT" });
314
+ i({ type: "ARROW_RIGHT" });
314
315
  },
315
316
  Enter() {
316
- var u;
317
- r({ type: "ENTER" }), R != null && fe(h) && ((u = a("navigate")) == null || u({ value: R, node: h, href: h.href }));
317
+ var h;
318
+ i({ type: "ENTER" }), v != null && fe(E) && ((h = o("navigate")) == null || h({ value: v, node: E, href: E.href }));
318
319
  },
319
- Space(u) {
320
- var y;
321
- A ? r({ type: "TYPEAHEAD", key: u.key }) : (y = O.Enter) == null || y.call(O, u);
320
+ Space(h) {
321
+ var M;
322
+ P ? i({ type: "TYPEAHEAD", key: h.key }) : (M = c.Enter) == null || M.call(c, h);
322
323
  },
323
324
  Home() {
324
- r({ type: "HOME" });
325
+ i({ type: "HOME" });
325
326
  },
326
327
  End() {
327
- r({ type: "END" });
328
+ i({ type: "END" });
328
329
  }
329
- }, T = j(i, { dir: a("dir") }), d = O[T];
330
+ }, T = Z(r, { dir: o("dir") }), d = c[T];
330
331
  if (d) {
331
- d(i), i.stopPropagation(), i.preventDefault();
332
+ d(r), r.stopPropagation(), r.preventDefault();
332
333
  return;
333
334
  }
334
- a("typeahead") && Ee(i) && (me(i) || re(s) || (r({ type: "TYPEAHEAD", key: i.key }), i.preventDefault()));
335
+ o("typeahead") && Ee(r) && (me(r) || re(a) || (i({ type: "TYPEAHEAD", key: r.key }), r.preventDefault()));
335
336
  }
336
337
  });
337
338
  },
338
339
  getSeparatorProps() {
339
340
  return t.element({
340
- ...E.separator.attrs,
341
+ ...O.separator.attrs,
341
342
  role: "separator",
342
- dir: a("dir"),
343
+ dir: o("dir"),
343
344
  "aria-orientation": "horizontal"
344
345
  });
345
346
  },
346
347
  getItemState: V,
347
348
  getItemProps: F,
348
- getOptionItemState: M,
349
- getOptionItemProps(i) {
350
- const { type: s, disabled: p, onCheckedChange: h, closeOnSelect: O } = i, T = $(i), d = M(i);
349
+ getOptionItemState: A,
350
+ getOptionItemProps(r) {
351
+ const { type: a, disabled: p, closeOnSelect: E } = r, c = q(r), T = A(r);
351
352
  return {
352
- ...F(T),
353
+ ...F(c),
353
354
  ...t.element({
354
- "data-type": s,
355
- ...E.item.attrs,
356
- dir: a("dir"),
357
- "data-value": T.value,
358
- role: `menuitem${s}`,
359
- "aria-checked": !!d.checked,
360
- "data-state": d.checked ? "checked" : "unchecked",
361
- onClick(u) {
362
- if (p || Y(u) || q(u)) return;
363
- const y = u.currentTarget;
364
- r({ type: "ITEM_CLICK", target: y, option: T, closeOnSelect: O }), h == null || h(!d.checked);
355
+ "data-type": a,
356
+ ...O.item.attrs,
357
+ dir: o("dir"),
358
+ "data-value": c.value,
359
+ role: `menuitem${a}`,
360
+ "aria-checked": !!T.checked,
361
+ "data-state": T.checked ? "checked" : "unchecked",
362
+ onClick(d) {
363
+ if (p || J(d) || Q(d)) return;
364
+ const h = d.currentTarget;
365
+ i({ type: "ITEM_CLICK", target: h, option: c, closeOnSelect: E });
365
366
  }
366
367
  })
367
368
  };
368
369
  },
369
- getItemIndicatorProps(i) {
370
- const s = M(Z(i)), p = s.checked ? "checked" : "unchecked";
370
+ getItemIndicatorProps(r) {
371
+ const a = A(ee(r)), p = a.checked ? "checked" : "unchecked";
371
372
  return t.element({
372
- ...E.itemIndicator.attrs,
373
- dir: a("dir"),
374
- "data-disabled": C(s.disabled),
375
- "data-highlighted": C(s.highlighted),
376
- "data-state": U(i, "checked") ? p : void 0,
377
- hidden: U(i, "checked") ? !s.checked : void 0
373
+ ...O.itemIndicator.attrs,
374
+ dir: o("dir"),
375
+ "data-disabled": C(a.disabled),
376
+ "data-highlighted": C(a.highlighted),
377
+ "data-state": W(r, "checked") ? p : void 0,
378
+ hidden: W(r, "checked") ? !a.checked : void 0
378
379
  });
379
380
  },
380
- getItemTextProps(i) {
381
- const s = M(Z(i)), p = s.checked ? "checked" : "unchecked";
381
+ getItemTextProps(r) {
382
+ const a = A(ee(r)), p = a.checked ? "checked" : "unchecked";
382
383
  return t.element({
383
- ...E.itemText.attrs,
384
- dir: a("dir"),
385
- "data-disabled": C(s.disabled),
386
- "data-highlighted": C(s.highlighted),
387
- "data-state": U(i, "checked") ? p : void 0
384
+ ...O.itemText.attrs,
385
+ dir: o("dir"),
386
+ "data-disabled": C(a.disabled),
387
+ "data-highlighted": C(a.highlighted),
388
+ "data-state": W(r, "checked") ? p : void 0
388
389
  });
389
390
  },
390
- getItemGroupLabelProps(i) {
391
+ getItemGroupLabelProps(r) {
391
392
  return t.element({
392
- ...E.itemGroupLabel.attrs,
393
- id: z(l, i.htmlFor),
394
- dir: a("dir")
393
+ ...O.itemGroupLabel.attrs,
394
+ id: te(l, r.htmlFor),
395
+ dir: o("dir")
395
396
  });
396
397
  },
397
- getItemGroupProps(i) {
398
+ getItemGroupProps(r) {
398
399
  return t.element({
399
- id: Ue(l, i.id),
400
- ...E.itemGroup.attrs,
401
- dir: a("dir"),
402
- "aria-labelledby": z(l, i.id),
400
+ id: We(l, r.id),
401
+ ...O.itemGroup.attrs,
402
+ dir: o("dir"),
403
+ "aria-labelledby": te(l, r.id),
403
404
  role: "group"
404
405
  });
405
406
  }
406
407
  };
407
408
  }
408
- var { not: m, and: v, or: qe } = he(), at = ce({
409
+ var { not: m, and: R, or: je } = he(), st = ce({
409
410
  props({ props: e }) {
410
411
  return {
411
412
  closeOnSelect: !0,
@@ -413,7 +414,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
413
414
  composite: !0,
414
415
  loopFocus: !1,
415
416
  navigate(t) {
416
- ve(t.node);
417
+ Re(t.node);
417
418
  },
418
419
  ...e,
419
420
  positioning: {
@@ -435,8 +436,8 @@ var { not: m, and: v, or: qe } = he(), at = ce({
435
436
  defaultValue: t("defaultHighlightedValue") || null,
436
437
  value: t("highlightedValue"),
437
438
  onChange(n) {
438
- var r;
439
- (r = t("onHighlightChange")) == null || r({ highlightedValue: n });
439
+ var i;
440
+ (i = t("onHighlightChange")) == null || i({ highlightedValue: n });
440
441
  }
441
442
  })),
442
443
  lastHighlightedValue: e(() => ({
@@ -453,6 +454,9 @@ var { not: m, and: v, or: qe } = he(), at = ce({
453
454
  hash(n) {
454
455
  return `x: ${n == null ? void 0 : n.x}, y: ${n == null ? void 0 : n.y}`;
455
456
  }
457
+ })),
458
+ isSubmenu: e(() => ({
459
+ defaultValue: !1
456
460
  }))
457
461
  };
458
462
  },
@@ -465,17 +469,16 @@ var { not: m, and: v, or: qe } = he(), at = ce({
465
469
  };
466
470
  },
467
471
  computed: {
468
- isSubmenu: ({ refs: e }) => e.get("parent") != null,
469
472
  isRtl: ({ prop: e }) => e("dir") === "rtl",
470
473
  isTypingAhead: ({ refs: e }) => e.get("typeaheadState").keysSoFar !== "",
471
- highlightedId: ({ context: e, scope: t, refs: n }) => Je(n.get("children"), e.get("highlightedValue"), t)
474
+ highlightedId: ({ context: e, scope: t, refs: n }) => Qe(n.get("children"), e.get("highlightedValue"), t)
472
475
  },
473
- watch({ track: e, action: t, context: n, computed: r, prop: o }) {
474
- e([() => r("isSubmenu")], () => {
476
+ watch({ track: e, action: t, context: n, prop: i }) {
477
+ e([() => n.get("isSubmenu")], () => {
475
478
  t(["setSubmenuPlacement"]);
476
479
  }), e([() => n.hash("anchorPoint")], () => {
477
- t(["reposition"]);
478
- }), e([() => o("open")], () => {
480
+ n.get("anchorPoint") && t(["reposition"]);
481
+ }), e([() => i("open")], () => {
479
482
  t(["toggleVisibility"]);
480
483
  });
481
484
  },
@@ -678,11 +681,11 @@ var { not: m, and: v, or: qe } = he(), at = ce({
678
681
  },
679
682
  closed: {
680
683
  tags: ["closed"],
681
- entry: ["clearHighlightedItem", "focusTrigger", "resumePointer"],
684
+ entry: ["clearHighlightedItem", "focusTrigger", "resumePointer", "clearAnchorPoint"],
682
685
  on: {
683
686
  "CONTROLLED.OPEN": [
684
687
  {
685
- guard: qe("isOpenAutoFocusEvent", "isArrowDownEvent"),
688
+ guard: je("isOpenAutoFocusEvent", "isArrowDownEvent"),
686
689
  target: "open",
687
690
  actions: ["highlightFirstItem"]
688
691
  },
@@ -763,7 +766,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
763
766
  ],
764
767
  TRIGGER_CLICK: [
765
768
  {
766
- guard: v(m("isTriggerItem"), "isOpenControlled"),
769
+ guard: R(m("isTriggerItem"), "isOpenControlled"),
767
770
  actions: ["invokeOnClose"]
768
771
  },
769
772
  {
@@ -783,7 +786,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
783
786
  },
784
787
  ARROW_LEFT: [
785
788
  {
786
- guard: v("isSubmenu", "isOpenControlled"),
789
+ guard: R("isSubmenu", "isOpenControlled"),
787
790
  actions: ["invokeOnClose"]
788
791
  },
789
792
  {
@@ -821,13 +824,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
821
824
  }
822
825
  ],
823
826
  ITEM_POINTERLEAVE: {
824
- guard: v(m("isPointerSuspended"), m("isTriggerItem")),
827
+ guard: R(m("isPointerSuspended"), m("isTriggerItem")),
825
828
  actions: ["clearHighlightedItem"]
826
829
  },
827
830
  ITEM_CLICK: [
828
831
  // == grouped ==
829
832
  {
830
- guard: v(
833
+ guard: R(
831
834
  m("isTriggerItemHighlighted"),
832
835
  m("isHighlightedItemEditable"),
833
836
  "closeOnSelect",
@@ -836,13 +839,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
836
839
  actions: ["invokeOnSelect", "setOptionState", "closeRootMenu", "invokeOnClose"]
837
840
  },
838
841
  {
839
- guard: v(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable"), "closeOnSelect"),
842
+ guard: R(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable"), "closeOnSelect"),
840
843
  target: "closed",
841
844
  actions: ["invokeOnSelect", "setOptionState", "closeRootMenu", "invokeOnClose"]
842
845
  },
843
846
  //
844
847
  {
845
- guard: v(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable")),
848
+ guard: R(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable")),
846
849
  actions: ["invokeOnSelect", "setOptionState"]
847
850
  },
848
851
  { actions: ["setHighlightedItem"] }
@@ -873,13 +876,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
873
876
  guards: {
874
877
  closeOnSelect: ({ prop: e, event: t }) => !!((t == null ? void 0 : t.closeOnSelect) ?? e("closeOnSelect")),
875
878
  // whether the trigger is also a menu item
876
- isTriggerItem: ({ event: e }) => Xe(e.target),
879
+ isTriggerItem: ({ event: e }) => Ye(e.target),
877
880
  // whether the trigger item is the active item
878
881
  isTriggerItemHighlighted: ({ event: e, scope: t, computed: n }) => {
879
- const r = e.target ?? t.getById(n("highlightedId"));
880
- return !!(r != null && r.hasAttribute("aria-controls"));
882
+ const i = e.target ?? t.getById(n("highlightedId"));
883
+ return !!(i != null && i.hasAttribute("aria-controls"));
881
884
  },
882
- isSubmenu: ({ computed: e }) => e("isSubmenu"),
885
+ isSubmenu: ({ context: e }) => e.get("isSubmenu"),
883
886
  isPointerSuspended: ({ context: e }) => e.get("suspendPointer"),
884
887
  isHighlightedItemEditable: ({ scope: e, computed: t }) => re(e.getById(t("highlightedId"))),
885
888
  // guard assertions (for controlled mode)
@@ -920,119 +923,132 @@ var { not: m, and: v, or: qe } = he(), at = ce({
920
923
  }, 700);
921
924
  return () => clearTimeout(t);
922
925
  },
923
- trackPositioning({ context: e, prop: t, scope: n, refs: r }) {
924
- if (te(n)) return;
925
- const o = {
926
+ trackPositioning({ context: e, prop: t, scope: n, refs: i }) {
927
+ if (x(n)) return;
928
+ const s = {
926
929
  ...t("positioning"),
927
- ...r.get("positioningOverride")
930
+ ...i.get("positioningOverride")
928
931
  };
929
- e.set("currentPlacement", o.placement);
930
- const g = () => ee(n);
931
- return Q(D(n), g, {
932
- ...o,
932
+ e.set("currentPlacement", s.placement);
933
+ const g = () => ne(n);
934
+ return z(_(n), g, {
935
+ ...s,
933
936
  defer: !0,
934
- onComplete(a) {
935
- e.set("currentPlacement", a.placement);
937
+ onComplete(o) {
938
+ e.set("currentPlacement", o.placement);
936
939
  }
937
940
  });
938
941
  },
939
- trackInteractOutside({ refs: e, scope: t, prop: n, computed: r, send: o }) {
942
+ trackInteractOutside({ refs: e, scope: t, prop: n, context: i, send: s }) {
940
943
  const g = () => I(t);
941
- let a = !0;
942
- return He(g, {
944
+ let o = !0;
945
+ return we(g, {
943
946
  defer: !0,
944
- exclude: [D(t)],
947
+ exclude: [_(t)],
945
948
  onInteractOutside: n("onInteractOutside"),
946
- onFocusOutside: n("onFocusOutside"),
949
+ onRequestDismiss: n("onRequestDismiss"),
950
+ onFocusOutside(l) {
951
+ var P;
952
+ (P = n("onFocusOutside")) == null || P(l);
953
+ const u = B(l.detail.originalEvent);
954
+ if (U(x(t), u)) {
955
+ l.preventDefault();
956
+ return;
957
+ }
958
+ },
947
959
  onEscapeKeyDown(l) {
948
- var c;
949
- (c = n("onEscapeKeyDown")) == null || c(l), r("isSubmenu") && l.preventDefault(), ne({ parent: e.get("parent") });
960
+ var u;
961
+ (u = n("onEscapeKeyDown")) == null || u(l), i.get("isSubmenu") && l.preventDefault(), ie({ parent: e.get("parent") });
950
962
  },
951
963
  onPointerDownOutside(l) {
952
- var A;
953
- const c = ie(l.detail.originalEvent);
954
- if (J(te(t), c) && l.detail.contextmenu) {
964
+ var P;
965
+ (P = n("onPointerDownOutside")) == null || P(l);
966
+ const u = B(l.detail.originalEvent);
967
+ if (U(x(t), u) && l.detail.contextmenu) {
955
968
  l.preventDefault();
956
969
  return;
957
970
  }
958
- a = !l.detail.focusable, (A = n("onPointerDownOutside")) == null || A(l);
971
+ o = !l.detail.focusable;
959
972
  },
960
973
  onDismiss() {
961
- o({ type: "CLOSE", src: "interact-outside", restoreFocus: a });
974
+ s({ type: "CLOSE", src: "interact-outside", restoreFocus: o });
962
975
  }
963
976
  });
964
977
  },
965
- trackPointerMove({ context: e, scope: t, send: n, refs: r, flush: o }) {
966
- const g = r.get("parent");
967
- o(() => {
978
+ trackPointerMove({ context: e, scope: t, send: n, refs: i, flush: s }) {
979
+ const g = i.get("parent");
980
+ s(() => {
968
981
  g.context.set("suspendPointer", !0);
969
982
  });
970
- const a = t.getDoc();
971
- return Ce(a, "pointermove", (l) => {
972
- je(e.get("intentPolygon"), {
983
+ const o = t.getDoc();
984
+ return Ce(o, "pointermove", (l) => {
985
+ Je(e.get("intentPolygon"), {
973
986
  x: l.clientX,
974
987
  y: l.clientY
975
988
  }) || (n({ type: "POINTER_MOVED_AWAY_FROM_SUBMENU" }), g.context.set("suspendPointer", !1));
976
989
  });
977
990
  },
978
991
  scrollToHighlightedItem({ event: e, scope: t, computed: n }) {
979
- const r = () => {
992
+ const i = () => {
980
993
  if (e.type.startsWith("ITEM_POINTER")) return;
981
- const g = t.getById(n("highlightedId")), a = I(t);
982
- ke(g, { rootEl: a, block: "nearest" });
994
+ const g = t.getById(n("highlightedId")), o = I(t);
995
+ ke(g, { rootEl: o, block: "nearest" });
983
996
  };
984
- return _(() => r()), ye(() => I(t), {
997
+ return D(() => i()), ye(() => I(t), {
985
998
  defer: !0,
986
999
  attributes: ["aria-activedescendant"],
987
- callback: r
1000
+ callback: i
988
1001
  });
989
1002
  }
990
1003
  },
991
1004
  actions: {
992
1005
  setAnchorPoint({ context: e, event: t }) {
993
- e.set("anchorPoint", t.point);
1006
+ e.set("anchorPoint", (n) => De(n, t.point) ? n : t.point);
994
1007
  },
995
- setSubmenuPlacement({ computed: e, refs: t }) {
996
- if (!e("isSubmenu")) return;
997
- const n = e("isRtl") ? "left-start" : "right-start";
998
- t.set("positioningOverride", { placement: n, gutter: 0 });
1008
+ setSubmenuPlacement({ context: e, computed: t, refs: n }) {
1009
+ if (!e.get("isSubmenu")) return;
1010
+ const i = t("isRtl") ? "left-start" : "right-start";
1011
+ n.set("positioningOverride", { placement: i, gutter: 0 });
999
1012
  },
1000
- reposition({ context: e, scope: t, prop: n, event: r, refs: o }) {
1001
- const g = () => ee(t), a = e.get("anchorPoint"), l = a ? () => ({ width: 0, height: 0, ...a }) : void 0, c = {
1013
+ reposition({ context: e, scope: t, prop: n, event: i, refs: s }) {
1014
+ const g = () => ne(t), o = e.get("anchorPoint"), l = o ? () => ({ width: 0, height: 0, ...o }) : void 0, u = {
1002
1015
  ...n("positioning"),
1003
- ...o.get("positioningOverride")
1016
+ ...s.get("positioningOverride")
1004
1017
  };
1005
- Q(D(t), g, {
1006
- ...c,
1018
+ z(_(t), g, {
1019
+ ...u,
1007
1020
  defer: !0,
1008
1021
  getAnchorRect: l,
1009
- ...r.options ?? {},
1022
+ ...i.options ?? {},
1010
1023
  listeners: !1,
1011
- onComplete(P) {
1012
- e.set("currentPlacement", P.placement);
1024
+ onComplete(f) {
1025
+ e.set("currentPlacement", f.placement);
1013
1026
  }
1014
1027
  });
1015
1028
  },
1016
1029
  setOptionState({ event: e }) {
1017
1030
  if (!e.option) return;
1018
- const { checked: t, onCheckedChange: n, type: r } = e.option;
1019
- r === "radio" ? n == null || n(!0) : r === "checkbox" && (n == null || n(!t));
1031
+ const { checked: t, onCheckedChange: n, type: i } = e.option;
1032
+ i === "radio" ? n == null || n(!0) : i === "checkbox" && (n == null || n(!t));
1020
1033
  },
1021
1034
  clickHighlightedItem({ scope: e, computed: t }) {
1022
1035
  const n = e.getById(t("highlightedId"));
1023
1036
  !n || n.dataset.disabled || queueMicrotask(() => n.click());
1024
1037
  },
1025
1038
  setIntentPolygon({ context: e, scope: t, event: n }) {
1026
- const r = I(t), o = e.get("currentPlacement");
1027
- if (!r || !o) return;
1028
- const g = r.getBoundingClientRect(), a = we(g, o);
1029
- if (!a) return;
1030
- const c = Ae(o) === "right" ? -5 : 5;
1031
- e.set("intentPolygon", [{ ...n.point, x: n.point.x + c }, ...a]);
1039
+ const i = I(t), s = e.get("currentPlacement");
1040
+ if (!i || !s) return;
1041
+ const g = i.getBoundingClientRect(), o = Ge(g, s);
1042
+ if (!o) return;
1043
+ const u = Ae(s) === "right" ? -5 : 5;
1044
+ e.set("intentPolygon", [{ ...n.point, x: n.point.x + u }, ...o]);
1032
1045
  },
1033
1046
  clearIntentPolygon({ context: e }) {
1034
1047
  e.set("intentPolygon", null);
1035
1048
  },
1049
+ clearAnchorPoint({ context: e }) {
1050
+ e.set("anchorPoint", null);
1051
+ },
1036
1052
  resumePointer({ refs: e, flush: t }) {
1037
1053
  const n = e.get("parent");
1038
1054
  n && t(() => {
@@ -1040,94 +1056,94 @@ var { not: m, and: v, or: qe } = he(), at = ce({
1040
1056
  });
1041
1057
  },
1042
1058
  setHighlightedItem({ context: e, event: t }) {
1043
- const n = t.value || f(t.target);
1059
+ const n = t.value || y(t.target);
1044
1060
  e.set("highlightedValue", n);
1045
1061
  },
1046
1062
  clearHighlightedItem({ context: e }) {
1047
1063
  e.set("highlightedValue", null);
1048
1064
  },
1049
1065
  focusMenu({ scope: e }) {
1050
- _(() => {
1066
+ D(() => {
1051
1067
  const t = I(e), n = Ne({
1052
1068
  root: t,
1053
- enabled: !J(t, e.getActiveElement()),
1054
- filter(r) {
1055
- var o;
1056
- return !((o = r.role) != null && o.startsWith("menuitem"));
1069
+ enabled: !U(t, e.getActiveElement()),
1070
+ filter(i) {
1071
+ var s;
1072
+ return !((s = i.role) != null && s.startsWith("menuitem"));
1057
1073
  }
1058
1074
  });
1059
1075
  n == null || n.focus({ preventScroll: !0 });
1060
1076
  });
1061
1077
  },
1062
1078
  highlightFirstItem({ context: e, scope: t }) {
1063
- (I(t) ? queueMicrotask : _)(() => {
1064
- const r = We(t);
1065
- r && e.set("highlightedValue", f(r));
1079
+ (I(t) ? queueMicrotask : D)(() => {
1080
+ const i = xe(t);
1081
+ i && e.set("highlightedValue", y(i));
1066
1082
  });
1067
1083
  },
1068
1084
  highlightLastItem({ context: e, scope: t }) {
1069
- (I(t) ? queueMicrotask : _)(() => {
1070
- const r = xe(t);
1071
- r && e.set("highlightedValue", f(r));
1085
+ (I(t) ? queueMicrotask : D)(() => {
1086
+ const i = Be(t);
1087
+ i && e.set("highlightedValue", y(i));
1072
1088
  });
1073
1089
  },
1074
- highlightNextItem({ context: e, scope: t, event: n, prop: r }) {
1075
- const o = Be(t, {
1090
+ highlightNextItem({ context: e, scope: t, event: n, prop: i }) {
1091
+ const s = Ke(t, {
1076
1092
  loop: n.loop,
1077
1093
  value: e.get("highlightedValue"),
1078
- loopFocus: r("loopFocus")
1094
+ loopFocus: i("loopFocus")
1079
1095
  });
1080
- e.set("highlightedValue", f(o));
1096
+ e.set("highlightedValue", y(s));
1081
1097
  },
1082
- highlightPrevItem({ context: e, scope: t, event: n, prop: r }) {
1083
- const o = Ke(t, {
1098
+ highlightPrevItem({ context: e, scope: t, event: n, prop: i }) {
1099
+ const s = $e(t, {
1084
1100
  loop: n.loop,
1085
1101
  value: e.get("highlightedValue"),
1086
- loopFocus: r("loopFocus")
1102
+ loopFocus: i("loopFocus")
1087
1103
  });
1088
- e.set("highlightedValue", f(o));
1104
+ e.set("highlightedValue", y(s));
1089
1105
  },
1090
1106
  invokeOnSelect({ context: e, prop: t, scope: n }) {
1091
1107
  var g;
1092
- const r = e.get("highlightedValue");
1093
- if (r == null) return;
1094
- const o = le(n, r);
1095
- Ye(o, r), (g = t("onSelect")) == null || g({ value: r });
1108
+ const i = e.get("highlightedValue");
1109
+ if (i == null) return;
1110
+ const s = le(n, i);
1111
+ qe(s, i), (g = t("onSelect")) == null || g({ value: i });
1096
1112
  },
1097
- focusTrigger({ scope: e, context: t, event: n, computed: r }) {
1098
- r("isSubmenu") || t.get("anchorPoint") || n.restoreFocus === !1 || queueMicrotask(() => {
1099
- var o;
1100
- return (o = D(e)) == null ? void 0 : o.focus({ preventScroll: !0 });
1113
+ focusTrigger({ scope: e, context: t, event: n }) {
1114
+ t.get("isSubmenu") || t.get("anchorPoint") || n.restoreFocus === !1 || queueMicrotask(() => {
1115
+ var i;
1116
+ return (i = _(e)) == null ? void 0 : i.focus({ preventScroll: !0 });
1101
1117
  });
1102
1118
  },
1103
- highlightMatchedItem({ scope: e, context: t, event: n, refs: r }) {
1104
- const o = $e(e, {
1119
+ highlightMatchedItem({ scope: e, context: t, event: n, refs: i }) {
1120
+ const s = Xe(e, {
1105
1121
  key: n.key,
1106
1122
  value: t.get("highlightedValue"),
1107
- typeaheadState: r.get("typeaheadState")
1123
+ typeaheadState: i.get("typeaheadState")
1108
1124
  });
1109
- o && t.set("highlightedValue", f(o));
1125
+ s && t.set("highlightedValue", y(s));
1110
1126
  },
1111
- setParentMenu({ refs: e, event: t }) {
1112
- e.set("parent", t.value);
1127
+ setParentMenu({ refs: e, event: t, context: n }) {
1128
+ e.set("parent", t.value), n.set("isSubmenu", !0);
1113
1129
  },
1114
1130
  setChildMenu({ refs: e, event: t }) {
1115
1131
  const n = e.get("children");
1116
1132
  n[t.id] = t.value, e.set("children", n);
1117
1133
  },
1118
1134
  closeRootMenu({ refs: e }) {
1119
- ne({ parent: e.get("parent") });
1135
+ ie({ parent: e.get("parent") });
1120
1136
  },
1121
1137
  openSubmenu({ refs: e, scope: t, computed: n }) {
1122
- const r = t.getById(n("highlightedId")), o = r == null ? void 0 : r.getAttribute("data-uid"), g = e.get("children"), a = o ? g[o] : null;
1123
- a == null || a.send({ type: "OPEN_AUTOFOCUS" });
1138
+ const i = t.getById(n("highlightedId")), s = i == null ? void 0 : i.getAttribute("data-uid"), g = e.get("children"), o = s ? g[s] : null;
1139
+ o == null || o.send({ type: "OPEN_AUTOFOCUS" });
1124
1140
  },
1125
1141
  focusParentMenu({ refs: e }) {
1126
1142
  var t;
1127
1143
  (t = e.get("parent")) == null || t.send({ type: "FOCUS_MENU" });
1128
1144
  },
1129
1145
  setLastHighlightedItem({ context: e, event: t }) {
1130
- e.set("lastHighlightedValue", f(t.target));
1146
+ e.set("lastHighlightedValue", y(t.target));
1131
1147
  },
1132
1148
  restoreHighlightedItem({ context: e }) {
1133
1149
  e.get("lastHighlightedValue") && (e.set("highlightedValue", e.get("lastHighlightedValue")), e.set("lastHighlightedValue", null));
@@ -1153,24 +1169,24 @@ var { not: m, and: v, or: qe } = he(), at = ce({
1153
1169
  }
1154
1170
  }
1155
1171
  });
1156
- function ne(e) {
1172
+ function ie(e) {
1157
1173
  let t = e.parent;
1158
- for (; t && t.computed("isSubmenu"); )
1174
+ for (; t && t.context.get("isSubmenu"); )
1159
1175
  t = t.refs.get("parent");
1160
1176
  t == null || t.send({ type: "CLOSE" });
1161
1177
  }
1162
- function je(e, t) {
1163
- return e ? Ge(e, t) : !1;
1178
+ function Je(e, t) {
1179
+ return e ? Ve(e, t) : !1;
1164
1180
  }
1165
- function Je(e, t, n) {
1166
- const r = Object.keys(e).length > 0;
1181
+ function Qe(e, t, n) {
1182
+ const i = Object.keys(e).length > 0;
1167
1183
  if (!t) return null;
1168
- if (!r)
1184
+ if (!i)
1169
1185
  return N(n, t);
1170
- for (const o in e) {
1171
- const g = e[o], a = w(g.scope);
1172
- if (a === t)
1173
- return a;
1186
+ for (const s in e) {
1187
+ const g = e[s], o = w(g.scope);
1188
+ if (o === t)
1189
+ return o;
1174
1190
  }
1175
1191
  return N(n, t);
1176
1192
  }
@@ -1194,6 +1210,7 @@ k()([
1194
1210
  "onInteractOutside",
1195
1211
  "onOpenChange",
1196
1212
  "onPointerDownOutside",
1213
+ "onRequestDismiss",
1197
1214
  "onSelect",
1198
1215
  "open",
1199
1216
  "positioning",
@@ -1212,7 +1229,7 @@ k()([
1212
1229
  "valueText"
1213
1230
  ]);
1214
1231
  export {
1215
- Ve as anatomy,
1216
- ot as connect,
1217
- at as machine
1232
+ Fe as anatomy,
1233
+ at as connect,
1234
+ st as machine
1218
1235
  };