@box-kite/react 2.2.14 → 2.2.16

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 (136) hide show
  1. package/.claude/rules/box-kite-rules.md +1 -1
  2. package/.claude/skills/box-kite/SKILL.md +1 -1
  3. package/.claude/skills/box-kite/references/styling.md +1 -1
  4. package/.cursor/rules/box-kite.mdc +1 -1
  5. package/AGENTS.md +1 -1
  6. package/BOX_AI_CONTEXT.md +16 -0
  7. package/BOX_KITE_AI_CONTEXT.md +16 -0
  8. package/behavior.cjs +1 -1
  9. package/behavior.mjs +16 -16
  10. package/catalog.cjs +1 -1
  11. package/catalog.mjs +1 -1
  12. package/client.cjs +1 -1
  13. package/client.mjs +10 -10
  14. package/components/accordion.cjs +1 -1
  15. package/components/accordion.mjs +95 -91
  16. package/components/calendar.cjs +1 -1
  17. package/components/calendar.mjs +212 -210
  18. package/components/chart.cjs +1 -1
  19. package/components/chart.d.ts +8 -3
  20. package/components/chart.mjs +70 -65
  21. package/components/combobox.cjs +1 -1
  22. package/components/combobox.mjs +187 -186
  23. package/components/dashboard.cjs +1 -1
  24. package/components/dashboard.d.ts +1 -44
  25. package/components/dashboard.mjs +202 -201
  26. package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
  27. package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
  28. package/components/dataGrid/models/gridModel.d.ts +1 -1
  29. package/components/dataGrid.cjs +2 -2
  30. package/components/dataGrid.mjs +10 -10
  31. package/components/dateField.cjs +1 -1
  32. package/components/dateField.mjs +96 -96
  33. package/components/datePicker.cjs +1 -1
  34. package/components/datePicker.mjs +177 -179
  35. package/components/dialog.cjs +1 -1
  36. package/components/dialog.d.ts +2 -64
  37. package/components/dialog.mjs +130 -126
  38. package/components/form.cjs +1 -1
  39. package/components/form.d.ts +4 -3
  40. package/components/form.mjs +25 -22
  41. package/components/menu.cjs +1 -1
  42. package/components/menu.d.ts +2 -73
  43. package/components/menu.mjs +222 -218
  44. package/components/overlay.cjs +1 -1
  45. package/components/overlay.mjs +43 -43
  46. package/components/popover.cjs +1 -1
  47. package/components/popover.d.ts +1 -41
  48. package/components/popover.mjs +55 -51
  49. package/components/radioGroup.cjs +1 -1
  50. package/components/radioGroup.mjs +59 -55
  51. package/components/slider.cjs +1 -1
  52. package/components/slider.d.ts +1 -55
  53. package/components/slider.mjs +92 -90
  54. package/components/sortableList.cjs +1 -1
  55. package/components/sortableList.mjs +149 -148
  56. package/components/swipeItem.cjs +1 -1
  57. package/components/swipeItem.mjs +100 -100
  58. package/components/tabs.cjs +1 -1
  59. package/components/tabs.mjs +135 -132
  60. package/components/toaster.cjs +1 -1
  61. package/components/toaster.d.ts +1 -37
  62. package/components/toaster.mjs +130 -128
  63. package/components/tooltip.cjs +1 -1
  64. package/components/tooltip.d.ts +1 -34
  65. package/components/tooltip.mjs +73 -69
  66. package/components/virtualList.cjs +1 -1
  67. package/components/virtualList.mjs +88 -87
  68. package/interactionListening.cjs +1 -1
  69. package/interactionListening.mjs +3 -3
  70. package/layer.cjs +1 -1
  71. package/layer.mjs +1 -1
  72. package/package.json +31 -30
  73. package/placement.cjs +1 -1
  74. package/placement.mjs +1 -1
  75. package/platform.cjs +1 -1
  76. package/platform.mjs +17 -14
  77. package/react/componentsContext.d.ts +1 -1
  78. package/react-shared.cjs +1 -1
  79. package/react-shared.mjs +1 -1
  80. package/scrolling.cjs +1 -1
  81. package/scrolling.mjs +1 -1
  82. package/utils/chart/chartUtils.d.ts +3 -2
  83. package/utils/dashboard/dashboardUtils.d.ts +1 -1
  84. package/utils/dom/domUtils.d.ts +6 -0
  85. package/create/src/agents.d.ts +0 -22
  86. package/create/src/agents.test.d.ts +0 -1
  87. package/create/src/index.d.ts +0 -1
  88. package/create/src/options.d.ts +0 -31
  89. package/create/src/options.test.d.ts +0 -1
  90. package/create/src/packageManager.d.ts +0 -5
  91. package/create/src/project.d.ts +0 -27
  92. package/create/src/project.test.d.ts +0 -1
  93. package/create/templates/ts/designs/azure.d.ts +0 -5
  94. package/create/templates/ts/designs/ember.d.ts +0 -5
  95. package/create/templates/ts/designs/mono.d.ts +0 -5
  96. package/create/templates/ts/src/App.d.ts +0 -2
  97. package/create/templates/ts/src/design.d.ts +0 -5
  98. package/create/templates/ts/src/main.d.ts +0 -0
  99. package/mcp/src/data.d.ts +0 -90
  100. package/mcp/src/data.test.d.ts +0 -1
  101. package/mcp/src/engine.d.ts +0 -23
  102. package/mcp/src/index.d.ts +0 -1
  103. package/mcp/src/search.d.ts +0 -26
  104. package/mcp/src/search.test.d.ts +0 -1
  105. package/mcp/src/server.d.ts +0 -18
  106. package/mcp/src/server.test.d.ts +0 -1
  107. package/mcp/src/styles.d.ts +0 -27
  108. package/mcp/src/styles.test.d.ts +0 -1
  109. package/mcp/src/tools.d.ts +0 -18
  110. package/mcp/src/vocabulary.d.ts +0 -41
  111. package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
  112. package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
  113. package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
  114. package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
  115. package/registry/blocks/settings-form/settings-form.d.ts +0 -17
  116. package/registry/designs/store/address-form.d.ts +0 -11
  117. package/registry/designs/store/cart-items.d.ts +0 -10
  118. package/registry/designs/store/cart-page.d.ts +0 -4
  119. package/registry/designs/store/checkout-page.d.ts +0 -7
  120. package/registry/designs/store/credit-card-form.d.ts +0 -10
  121. package/registry/designs/store/form-field.d.ts +0 -19
  122. package/registry/designs/store/order-summary.d.ts +0 -18
  123. package/registry/designs/store/product-art.d.ts +0 -26
  124. package/registry/designs/store/product-card.d.ts +0 -11
  125. package/registry/designs/store/product-gallery.d.ts +0 -11
  126. package/registry/designs/store/product-grid.d.ts +0 -10
  127. package/registry/designs/store/product-page.d.ts +0 -5
  128. package/registry/designs/store/quantity-stepper.d.ts +0 -13
  129. package/registry/designs/store/shipping-method.d.ts +0 -14
  130. package/registry/designs/store/store-data.d.ts +0 -53
  131. package/registry/designs/store/store-design.d.ts +0 -63
  132. package/registry/designs/store/store-shell.d.ts +0 -12
  133. package/registry/designs/store/storefront-page.d.ts +0 -4
  134. package/registry/designs/store/variant-picker.d.ts +0 -15
  135. package/supabase/functions/collect/index.d.ts +0 -30
  136. package/supabase/functions/collect/index.test.d.ts +0 -1
@@ -1,18 +1,19 @@
1
1
  "use client";
2
- import { f as e, p as t } from "../platform.mjs";
3
- import { n } from "../effects.mjs";
4
- import r from "../box.mjs";
5
- import { a as i, i as a } from "../behavior.mjs";
6
- import { t as o } from "../identity.mjs";
7
- import { t as s } from "../keyboard.mjs";
8
- import { t as c } from "../placement.mjs";
9
- import { a as l, i as u } from "../reporting.mjs";
10
- import { t as d } from "../layer.mjs";
11
- import f from "./overlay.mjs";
12
- import { createContext as p, useCallback as m, useContext as h, useMemo as g, useRef as _, useState as v } from "react";
13
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
2
+ import { f as e } from "../react-shared.mjs";
3
+ import { l as t, m as n, p as r } from "../platform.mjs";
4
+ import { n as i } from "../effects.mjs";
5
+ import a from "../box.mjs";
6
+ import { a as o, i as s } from "../behavior.mjs";
7
+ import { t as c } from "../identity.mjs";
8
+ import { t as l } from "../keyboard.mjs";
9
+ import { t as u } from "../placement.mjs";
10
+ import { a as d, i as f } from "../reporting.mjs";
11
+ import { t as p } from "../layer.mjs";
12
+ import m from "./overlay.mjs";
13
+ import { createContext as h, useCallback as g, useContext as _, useMemo as v, useRef as y, useState as b } from "react";
14
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
14
15
  //#region src/utils/menu/menuUtils.ts
15
- var S;
16
+ var w;
16
17
  (function(e) {
17
18
  let t = e.ITEM_SELECTOR = "[role=\"menuitem\"],[role=\"menuitemcheckbox\"],[role=\"menuitemradio\"]";
18
19
  function n(e, t) {
@@ -35,23 +36,23 @@ var S;
35
36
  if (e.length !== 0) return e[t < 0 ? n > 0 ? 0 : e.length - 1 : ((t + n) % e.length + e.length) % e.length];
36
37
  }
37
38
  e.step = o;
38
- function c(e, t, n) {
39
- let r = s.target(t, n, e.length, (t) => e[t].textContent ?? "");
39
+ function s(e, t, n) {
40
+ let r = l.target(t, n, e.length, (t) => e[t].textContent ?? "");
40
41
  return r < 0 ? void 0 : e[r];
41
42
  }
42
- e.typeaheadTarget = c;
43
- })(S ||= {});
44
- var C = S, w = p(null);
45
- function T(e) {
46
- let t = h(w);
43
+ e.typeaheadTarget = s;
44
+ })(w ||= {});
45
+ var T = w, E = h(null);
46
+ function D(e) {
47
+ let t = _(E);
47
48
  if (!t) throw Error(`<${e}> must be rendered inside a <Menu>.`);
48
49
  return t;
49
50
  }
50
- function E(e) {
51
- let [t, n] = v([]);
51
+ function O(e) {
52
+ let [t, n] = b([]);
52
53
  return {
53
54
  panels: t,
54
- registerLayer: m((t) => {
55
+ registerLayer: g((t) => {
55
56
  n((e) => [...e, t]);
56
57
  let r = e?.(t);
57
58
  return () => {
@@ -60,241 +61,245 @@ function E(e) {
60
61
  }, [e])
61
62
  };
62
63
  }
63
- var D = p(null);
64
- function O(e) {
65
- let { trigger: t, children: n, open: r, defaultOpen: a = !1, onOpenChange: o, label: s, labelledBy: c, side: l = "bottom", align: u = "start", offset: f = 1, flip: p = !0, matchWidth: m = !1, props: h, ...v } = e, S = _("first"), T = i((e) => {
66
- let t = C.items(e), n = S.current === "last" ? t[t.length - 1] : t[0];
67
- S.current = "first", (n ?? e).focus();
68
- }), { panels: D, registerLayer: O } = E(), A = d({
64
+ var k = h(null);
65
+ function A(e, t) {
66
+ let { trigger: n, children: r, open: i, defaultOpen: a = !1, onOpenChange: s, label: c, labelledBy: l, side: u = "bottom", align: d = "start", offset: f = 1, flip: m = !0, matchWidth: h = !1, props: g, ..._ } = e, b = y("first"), w = o((e) => {
67
+ let t = T.items(e), n = b.current === "last" ? t[t.length - 1] : t[0];
68
+ b.current = "first", (n ?? e).focus();
69
+ }), { panels: D, registerLayer: k } = O(), A = p({
69
70
  haspopup: "menu",
70
71
  idPrefix: "menu",
71
- id: v.id,
72
- open: r,
72
+ id: _.id,
73
+ open: i,
73
74
  defaultOpen: a,
74
- onOpenChange: o,
75
+ onOpenChange: s,
75
76
  interaction: {
76
77
  component: "menu",
77
78
  type: "openChange"
78
79
  },
79
- onOpened: T,
80
+ onOpened: w,
80
81
  inside: D
81
- }), j = i((e) => {
82
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), S.current = e.key === "ArrowUp" ? "last" : "first", A.isOpen && A.panelElement ? T(A.panelElement) : A.setOpen(!0, {
82
+ }), M = o((e) => {
83
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), b.current = e.key === "ArrowUp" ? "last" : "first", A.isOpen && A.panelElement ? w(A.panelElement) : A.setOpen(!0, {
83
84
  reason: "trigger",
84
85
  event: e
85
86
  }));
86
- }), M = g(() => ({
87
+ }), N = v(() => ({
87
88
  ref: A.trigger.ref,
88
89
  props: {
89
90
  ...A.trigger.props,
90
- onKeyDown: j
91
+ onKeyDown: M
91
92
  }
92
- }), [j, A.trigger]), N = i((e) => A.setOpen(!1, e)), P = g(() => ({
93
+ }), [M, A.trigger]), P = o((e) => A.setOpen(!1, e)), F = v(() => ({
93
94
  open: A.isOpen,
94
- closeAll: N,
95
- registerLayer: O
95
+ closeAll: P,
96
+ registerLayer: k
96
97
  }), [
97
- N,
98
+ P,
98
99
  A.isOpen,
99
- O
100
+ k
100
101
  ]);
101
- return /* @__PURE__ */ x(y, { children: [t(M), /* @__PURE__ */ b(w.Provider, {
102
- value: P,
103
- children: /* @__PURE__ */ b(k, {
102
+ return /* @__PURE__ */ C(x, { children: [n(N), /* @__PURE__ */ S(E.Provider, {
103
+ value: F,
104
+ children: /* @__PURE__ */ S(j, {
104
105
  layer: A,
105
- side: l,
106
- align: u,
106
+ side: u,
107
+ align: d,
107
108
  offset: f,
108
- flip: p,
109
- matchWidth: m,
110
- label: s,
111
- labelledBy: c ?? (s ? void 0 : A.triggerId),
112
- contentProps: h,
113
- ...v,
114
- children: n
109
+ flip: m,
110
+ matchWidth: h,
111
+ label: c,
112
+ labelledBy: l ?? (c ? void 0 : A.triggerId),
113
+ contentProps: g,
114
+ ..._,
115
+ elementRef: t,
116
+ children: r
115
117
  })
116
118
  })] });
117
119
  }
118
- function k(e) {
119
- let { layer: n, side: a, align: o, offset: l, flip: u, matchWidth: d, label: p, labelledBy: m, contentProps: h, closeSelf: g, children: v, ...y } = e, { platform: x, isOpen: S, id: w, triggerElement: E, setPanel: D } = n, O = T("Menu"), k = _({
120
+ function j(e) {
121
+ let { layer: r, side: i, align: s, offset: c, flip: d, matchWidth: f, label: p, labelledBy: h, contentProps: _, closeSelf: v, elementRef: b, children: x, ...C } = e, { platform: w, isOpen: E, id: O, triggerElement: k, setPanel: A } = r, j = g((e) => {
122
+ A(e), t(b, e);
123
+ }, [A, b]), M = D("Menu"), N = y({
120
124
  query: "",
121
125
  at: 0
122
- }), A = c({
123
- side: a,
124
- align: o,
125
- offset: l,
126
- flip: u,
127
- matchWidth: d,
128
- anchor: E
129
- }), j = {
126
+ }), P = u({
127
+ side: i,
128
+ align: s,
129
+ offset: c,
130
+ flip: d,
131
+ matchWidth: f,
132
+ anchor: k
133
+ }), F = {
130
134
  role: "menu",
131
135
  "aria-label": p,
132
- "aria-labelledby": m,
136
+ "aria-labelledby": h,
133
137
  tabIndex: -1,
134
- onKeyDown: i((e) => {
135
- let n = e.currentTarget;
136
- if (!C.owns(n, e.target)) return;
137
- let r = C.items(n), i = r.indexOf(document.activeElement), a = (t) => {
138
+ onKeyDown: o((e) => {
139
+ let t = e.currentTarget;
140
+ if (!T.owns(t, e.target)) return;
141
+ let r = T.items(t), i = r.indexOf(document.activeElement), a = (t) => {
138
142
  t && (e.preventDefault(), t.focus());
139
- }, o = t(n) ? "ArrowRight" : "ArrowLeft";
143
+ }, o = n(t) ? "ArrowRight" : "ArrowLeft";
140
144
  switch (e.key) {
141
- case "ArrowDown": return a(C.step(r, i, 1));
142
- case "ArrowUp": return a(C.step(r, i, -1));
145
+ case "ArrowDown": return a(T.step(r, i, 1));
146
+ case "ArrowUp": return a(T.step(r, i, -1));
143
147
  case "Home": return a(r[0]);
144
148
  case "End": return a(r[r.length - 1]);
145
- case "Tab": return O.closeAll({
149
+ case "Tab": return M.closeAll({
146
150
  reason: "tab",
147
151
  event: e
148
152
  });
149
- case o: return g ? (e.preventDefault(), g({
153
+ case o: return v ? (e.preventDefault(), v({
150
154
  reason: "trigger",
151
155
  event: e
152
156
  })) : void 0;
153
157
  }
154
- if (s.isPrintable(e)) {
155
- let t = s.push(k.current, e.key, e.timeStamp);
156
- a(C.typeaheadTarget(r, t, i));
158
+ if (l.isPrintable(e)) {
159
+ let t = l.push(N.current, e.key, e.timeStamp);
160
+ a(T.typeaheadTarget(r, t, i));
157
161
  }
158
162
  }),
159
- onPointerOver: i((e) => {
160
- let t = e.currentTarget, n = e.target?.closest(C.ITEM_SELECTOR);
161
- !n || !C.owns(t, n) || n === document.activeElement || n.focus();
163
+ onPointerOver: o((e) => {
164
+ let t = e.currentTarget, n = e.target?.closest(T.ITEM_SELECTOR);
165
+ !n || !T.owns(t, n) || n === document.activeElement || n.focus();
162
166
  }),
163
- ...h
167
+ ..._
164
168
  };
165
- return x ? /* @__PURE__ */ b(r, {
166
- ref: D,
169
+ return w ? /* @__PURE__ */ S(a, {
170
+ ref: j,
167
171
  component: "menu",
168
- ...y,
169
- variant: [y.variant, { topLayer: !0 }],
170
- ...A.layerProps,
171
- id: w,
172
+ ...C,
173
+ variant: [C.variant, { topLayer: !0 }],
174
+ ...P.layerProps,
175
+ id: O,
172
176
  props: {
173
177
  popover: "auto",
174
- ...j
178
+ ...F
175
179
  },
176
- children: v
177
- }) : S ? /* @__PURE__ */ b(f, {
178
- contentRef: D,
179
- anchor: E,
180
- side: a,
181
- align: o,
182
- offset: l,
183
- flip: u,
184
- matchWidth: d,
180
+ children: x
181
+ }) : E ? /* @__PURE__ */ S(m, {
182
+ contentRef: j,
183
+ anchor: k,
184
+ side: i,
185
+ align: s,
186
+ offset: c,
187
+ flip: d,
188
+ matchWidth: f,
185
189
  component: "menu",
186
- ...y,
187
- id: w,
188
- props: j,
189
- children: v
190
+ ...C,
191
+ id: O,
192
+ props: F,
193
+ children: x
190
194
  }) : null;
191
195
  }
192
- function A(a) {
193
- let { label: s, children: c, disabled: l, side: f = "end", align: p = "start", offset: m = 0, flip: h = !0, itemProps: _, props: v, ...S } = a, D = T("Menu.Sub"), O = o("menu-sub"), A = i((e) => {
194
- (C.items(e)[0] ?? e).focus();
195
- }), M = i((e, t) => {
196
+ function M(e, t) {
197
+ let { label: s, children: l, disabled: u, side: d = "end", align: m = "start", offset: h = 0, flip: g = !0, itemProps: _, props: y, ...b } = e, w = D("Menu.Sub"), k = c("menu-sub"), A = o((e) => {
198
+ (T.items(e)[0] ?? e).focus();
199
+ }), M = o((e, t) => {
196
200
  e && t?.focus();
197
- }), { panels: N, registerLayer: P } = E(D.registerLayer), F = u("menu.sub"), I = d({
201
+ }), { panels: P, registerLayer: F } = O(w.registerLayer), I = f("menu.sub"), L = p({
198
202
  haspopup: "menu",
199
203
  idPrefix: "menu-sub",
200
- id: S.id,
204
+ id: b.id,
201
205
  onOpened: A,
202
206
  onClosing: M,
203
- inside: N
207
+ inside: P
204
208
  });
205
- n(() => {
206
- if (!(!I.isOpen || !I.panelElement)) return D.registerLayer(I.panelElement);
209
+ i(() => {
210
+ if (!(!L.isOpen || !L.panelElement)) return w.registerLayer(L.panelElement);
207
211
  }, [
208
- I.isOpen,
209
- I.panelElement,
210
- D.registerLayer
211
- ]), n(() => {
212
- D.open || I.setOpen(!1, { reason: "imperative" });
213
- }, [D.open, I.setOpen]), n(() => {
214
- if (!I.isOpen) return;
215
- let t = new AbortController();
216
- return document.addEventListener("focusin", (t) => {
217
- e(t, [I.panelElement, I.triggerElement]) || I.setOpen(!1, {
212
+ L.isOpen,
213
+ L.panelElement,
214
+ w.registerLayer
215
+ ]), i(() => {
216
+ w.open || L.setOpen(!1, { reason: "imperative" });
217
+ }, [w.open, L.setOpen]), i(() => {
218
+ if (!L.isOpen) return;
219
+ let e = new AbortController();
220
+ return document.addEventListener("focusin", (e) => {
221
+ r(e, [L.panelElement, L.triggerElement]) || L.setOpen(!1, {
218
222
  reason: "imperative",
219
- event: t
223
+ event: e
220
224
  });
221
- }, { signal: t.signal }), () => t.abort();
225
+ }, { signal: e.signal }), () => e.abort();
222
226
  }, [
223
- I.isOpen,
224
- I.panelElement,
225
- I.triggerElement,
226
- I.setOpen
227
+ L.isOpen,
228
+ L.panelElement,
229
+ L.triggerElement,
230
+ L.setOpen
227
231
  ]);
228
- let L = i((e) => {
229
- let n = t(e.currentTarget) ? "ArrowLeft" : "ArrowRight";
230
- l || e.key !== n || (e.preventDefault(), I.setOpen(!0, {
232
+ let R = o((e) => {
233
+ let t = n(e.currentTarget) ? "ArrowLeft" : "ArrowRight";
234
+ u || e.key !== t || (e.preventDefault(), L.setOpen(!0, {
231
235
  reason: "trigger",
232
236
  event: e
233
- }), F("openChange", !0, {
237
+ }), I("openChange", !0, {
234
238
  reason: "keyboard",
235
239
  event: e,
236
- item: j(s)
240
+ item: N(s)
237
241
  }));
238
- }), R = i((e) => {
239
- l || I.setOpen(!0, {
242
+ }), z = o((e) => {
243
+ u || L.setOpen(!0, {
240
244
  reason: "trigger",
241
245
  event: e
242
246
  });
243
- }), z = g(() => ({
244
- open: I.isOpen,
245
- closeAll: D.closeAll,
246
- registerLayer: P
247
+ }), B = v(() => ({
248
+ open: L.isOpen,
249
+ closeAll: w.closeAll,
250
+ registerLayer: F
247
251
  }), [
248
- I.isOpen,
249
- D.closeAll,
250
- P
252
+ L.isOpen,
253
+ w.closeAll,
254
+ F
251
255
  ]);
252
- return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x(r, {
256
+ return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(a, {
253
257
  tag: "button",
254
- ref: l ? void 0 : I.trigger.ref,
258
+ ref: u ? void 0 : L.trigger.ref,
255
259
  component: "menu.item",
256
260
  variant: { sub: !0 },
257
- id: O,
261
+ id: k,
258
262
  props: {
259
263
  type: "button",
260
264
  role: "menuitem",
261
265
  tabIndex: -1,
262
- "aria-disabled": l || void 0,
263
- ...I.trigger.props,
266
+ "aria-disabled": u || void 0,
267
+ ...L.trigger.props,
264
268
  ..._,
265
- onKeyDown: L,
266
- onPointerEnter: R
269
+ onKeyDown: R,
270
+ onPointerEnter: z
267
271
  },
268
- children: [s, /* @__PURE__ */ b(r, { component: "menu.arrow" })]
269
- }), !l && /* @__PURE__ */ b(w.Provider, {
270
- value: z,
271
- children: /* @__PURE__ */ b(k, {
272
- layer: I,
273
- side: f,
274
- align: p,
275
- offset: m,
276
- flip: h,
272
+ children: [s, /* @__PURE__ */ S(a, { component: "menu.arrow" })]
273
+ }), !u && /* @__PURE__ */ S(E.Provider, {
274
+ value: B,
275
+ children: /* @__PURE__ */ S(j, {
276
+ layer: L,
277
+ side: d,
278
+ align: m,
279
+ offset: h,
280
+ flip: g,
277
281
  matchWidth: !1,
278
- labelledBy: O,
279
- contentProps: v,
280
- closeSelf: (e) => I.setOpen(!1, e),
281
- ...S,
282
- children: c
282
+ labelledBy: k,
283
+ contentProps: y,
284
+ closeSelf: (e) => L.setOpen(!1, e),
285
+ ...b,
286
+ elementRef: t,
287
+ children: l
283
288
  })
284
289
  })] });
285
290
  }
286
- var j = (e, t) => t ?? (typeof e == "string" ? e : void 0);
287
- function M(e) {
288
- let { onSelect: t, disabled: n, closeOnSelect: a = !0, value: o, props: s, children: c, ...l } = e, d = T("Menu.Item"), f = u("menu.item"), p = i((e) => {
289
- n || (t?.(e), f("select", j(c, o), {
291
+ var N = (e, t) => t ?? (typeof e == "string" ? e : void 0);
292
+ function P(e) {
293
+ let { onSelect: t, disabled: n, closeOnSelect: r = !0, value: i, props: s, children: c, ...l } = e, u = D("Menu.Item"), d = f("menu.item"), p = o((e) => {
294
+ n || (t?.(e), d("select", N(c, i), {
290
295
  reason: "select",
291
296
  event: e
292
- }), a && d.closeAll({
297
+ }), r && u.closeAll({
293
298
  reason: "select",
294
299
  event: e
295
300
  }));
296
301
  });
297
- return /* @__PURE__ */ b(r, {
302
+ return /* @__PURE__ */ S(a, {
298
303
  tag: "button",
299
304
  component: "menu.item",
300
305
  ...l,
@@ -309,25 +314,25 @@ function M(e) {
309
314
  children: c
310
315
  });
311
316
  }
312
- function N(e) {
313
- let { checked: t, defaultChecked: n = !1, onCheckedChange: o, disabled: s, closeOnSelect: c = !1, value: l, props: d, children: f, ...p } = e, m = T("Menu.CheckboxItem"), [h, g] = a({
317
+ function F(e) {
318
+ let { checked: t, defaultChecked: n = !1, onCheckedChange: r, disabled: i, closeOnSelect: c = !1, value: l, props: u, children: d, ...p } = e, m = D("Menu.CheckboxItem"), [h, g] = s({
314
319
  value: t,
315
320
  defaultValue: n,
316
- onChange: o
317
- }), _ = u("menu.checkboxItem"), v = i((e) => {
318
- s || (g(!h, {
321
+ onChange: r
322
+ }), _ = f("menu.checkboxItem"), v = o((e) => {
323
+ i || (g(!h, {
319
324
  reason: "select",
320
325
  event: e
321
326
  }), _("checkedChange", !h, {
322
327
  reason: "select",
323
328
  event: e,
324
- item: j(f, l)
329
+ item: N(d, l)
325
330
  }), c && m.closeAll({
326
331
  reason: "select",
327
332
  event: e
328
333
  }));
329
334
  });
330
- return /* @__PURE__ */ x(r, {
335
+ return /* @__PURE__ */ C(a, {
331
336
  tag: "button",
332
337
  component: "menu.item",
333
338
  ...p,
@@ -336,51 +341,51 @@ function N(e) {
336
341
  role: "menuitemcheckbox",
337
342
  tabIndex: -1,
338
343
  "aria-checked": h,
339
- "aria-disabled": s || void 0,
340
- ...d,
344
+ "aria-disabled": i || void 0,
345
+ ...u,
341
346
  onClick: v
342
347
  },
343
- children: [/* @__PURE__ */ b(r, {
348
+ children: [/* @__PURE__ */ S(a, {
344
349
  component: "menu.indicator",
345
- children: h && /* @__PURE__ */ b(r, { component: "menu.check" })
346
- }), f]
350
+ children: h && /* @__PURE__ */ S(a, { component: "menu.check" })
351
+ }), d]
347
352
  });
348
353
  }
349
- function P(e) {
350
- let { label: t, value: n, defaultValue: r = "", onValueChange: a, children: o, ...s } = e, [c, u] = l({
354
+ function I(e) {
355
+ let { label: t, value: n, defaultValue: r = "", onValueChange: i, children: a, ...s } = e, [c, l] = d({
351
356
  value: n,
352
357
  defaultValue: r,
353
- onChange: a,
358
+ onChange: i,
354
359
  interaction: {
355
360
  component: "menu.radioGroup",
356
361
  type: "valueChange"
357
362
  }
358
- }), d = i((e, t) => u(e, {
363
+ }), u = o((e, t) => l(e, {
359
364
  reason: "select",
360
365
  event: t
361
- })), f = g(() => ({
366
+ })), f = v(() => ({
362
367
  value: c,
363
- select: d
364
- }), [c, d]);
365
- return /* @__PURE__ */ b(D.Provider, {
368
+ select: u
369
+ }), [c, u]);
370
+ return /* @__PURE__ */ S(k.Provider, {
366
371
  value: f,
367
- children: /* @__PURE__ */ b(I, {
372
+ children: /* @__PURE__ */ S(R, {
368
373
  label: t,
369
374
  ...s,
370
- children: o
375
+ children: a
371
376
  })
372
377
  });
373
378
  }
374
- function F(e) {
375
- let { value: t, disabled: n, closeOnSelect: a = !1, props: o, children: s, ...c } = e, l = T("Menu.RadioItem"), u = h(D);
379
+ function L(e) {
380
+ let { value: t, disabled: n, closeOnSelect: r = !1, props: i, children: s, ...c } = e, l = D("Menu.RadioItem"), u = _(k);
376
381
  if (!u) throw Error("<Menu.RadioItem> must be rendered inside a <Menu.RadioGroup>.");
377
- let d = u.value === t, f = i((e) => {
378
- n || (u.select(t, e), a && l.closeAll({
382
+ let d = u.value === t, f = o((e) => {
383
+ n || (u.select(t, e), r && l.closeAll({
379
384
  reason: "select",
380
385
  event: e
381
386
  }));
382
387
  });
383
- return /* @__PURE__ */ x(r, {
388
+ return /* @__PURE__ */ C(a, {
384
389
  tag: "button",
385
390
  component: "menu.item",
386
391
  ...c,
@@ -390,36 +395,36 @@ function F(e) {
390
395
  tabIndex: -1,
391
396
  "aria-checked": d,
392
397
  "aria-disabled": n || void 0,
393
- ...o,
398
+ ...i,
394
399
  onClick: f
395
400
  },
396
- children: [/* @__PURE__ */ b(r, {
401
+ children: [/* @__PURE__ */ S(a, {
397
402
  component: "menu.indicator",
398
- children: d && /* @__PURE__ */ b(r, { component: "menu.dot" })
403
+ children: d && /* @__PURE__ */ S(a, { component: "menu.dot" })
399
404
  }), s]
400
405
  });
401
406
  }
402
- function I(e) {
403
- let { label: t, props: n, children: i, ...a } = e, s = o("menu-group");
404
- return /* @__PURE__ */ x(r, {
407
+ function R(e) {
408
+ let { label: t, props: n, children: r, ...i } = e, o = c("menu-group");
409
+ return /* @__PURE__ */ C(a, {
405
410
  component: "menu.group",
406
- ...a,
411
+ ...i,
407
412
  props: {
408
413
  role: "group",
409
- "aria-labelledby": t ? s : void 0,
414
+ "aria-labelledby": t ? o : void 0,
410
415
  ...n
411
416
  },
412
- children: [t && /* @__PURE__ */ b(r, {
417
+ children: [t && /* @__PURE__ */ S(a, {
413
418
  component: "menu.label",
414
- id: s,
419
+ id: o,
415
420
  props: { role: "presentation" },
416
421
  children: t
417
- }), i]
422
+ }), r]
418
423
  });
419
424
  }
420
- function L(e) {
425
+ function z(e) {
421
426
  let { props: t, ...n } = e;
422
- return /* @__PURE__ */ b(r, {
427
+ return /* @__PURE__ */ S(a, {
423
428
  component: "menu.separator",
424
429
  ...n,
425
430
  props: {
@@ -428,16 +433,15 @@ function L(e) {
428
433
  }
429
434
  });
430
435
  }
431
- M.displayName = "Menu.Item", N.displayName = "Menu.CheckboxItem", P.displayName = "Menu.RadioGroup", F.displayName = "Menu.RadioItem", I.displayName = "Menu.Group", L.displayName = "Menu.Separator", A.displayName = "Menu.Sub";
432
- var R = Object.assign(O, {
433
- Item: M,
434
- CheckboxItem: N,
435
- RadioGroup: P,
436
- RadioItem: F,
437
- Group: I,
438
- Separator: L,
439
- Sub: A
436
+ P.displayName = "Menu.Item", F.displayName = "Menu.CheckboxItem", I.displayName = "Menu.RadioGroup", L.displayName = "Menu.RadioItem", R.displayName = "Menu.Group", z.displayName = "Menu.Separator";
437
+ var B = Object.assign(e(A, "Menu"), {
438
+ Item: P,
439
+ CheckboxItem: F,
440
+ RadioGroup: I,
441
+ RadioItem: L,
442
+ Group: R,
443
+ Separator: z,
444
+ Sub: e(M, "Menu.Sub")
440
445
  });
441
- O.displayName = "Menu";
442
446
  //#endregion
443
- export { R as default };
447
+ export { B as default };
@@ -1 +1 @@
1
- "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../client.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../placement.cjs"),a=require("../layer.cjs");let o=require("react"),s=require("react/jsx-runtime"),c=require("react-dom");function l(l,u){let{side:d=`bottom`,align:f=`center`,offset:p=0,flip:m=!0,onSideChange:h,anchor:g,contentRef:_,matchWidth:v=!0,...y}=l,[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(!1),w=(0,o.useRef)(null),T=a.n(),E=(0,o.useRef)(null),D=t.t(!T),O=i.t({side:d,align:f,offset:p,flip:m,matchWidth:v,anchor:g??b,trackSide:!!h});n.n(()=>{let t=E.current;!T||!e.c()||!t||!t.isConnected||t.matches(`:popover-open`)||t.showPopover()}),n.n(()=>{if(T)return;let t=e.d(g)??b;C(!!t&&e.p(t))},[g,b,T]),n.n(()=>{w.current!==O.side&&(w.current=O.side,h?.(O.side))});let k=O.layerProps.ref,A=(0,o.useCallback)(e=>{k?.(e),E.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[k,u]),j=(0,s.jsx)(r.default,{...O.layerProps,ref:A,transition:`none`,props:T?{popover:`manual`}:{dir:S?`rtl`:`ltr`},children:(0,s.jsx)(r.default,{ref:_,...y})});return(0,s.jsxs)(s.Fragment,{children:[!g&&(0,s.jsx)(r.default,{ref:x}),T?j:D&&(0,c.createPortal)(j,D)]})}var u=(0,o.forwardRef)(l);u.displayName=`Overlay`,exports.default=u;
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../client.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../placement.cjs"),a=require("../layer.cjs");let o=require("react"),s=require("react/jsx-runtime"),c=require("react-dom");function l(l,u){let{side:d=`bottom`,align:f=`center`,offset:p=0,flip:m=!0,onSideChange:h,anchor:g,contentRef:_,matchWidth:v=!0,...y}=l,[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(!1),w=(0,o.useRef)(null),T=a.n(),E=(0,o.useRef)(null),D=t.t(!T),O=i.t({side:d,align:f,offset:p,flip:m,matchWidth:v,anchor:g??b,trackSide:!!h});n.n(()=>{let t=E.current;!T||!e.c()||!t||!t.isConnected||t.matches(`:popover-open`)||t.showPopover()}),n.n(()=>{if(T)return;let t=e.f(g)??b;C(!!t&&e.m(t))},[g,b,T]),n.n(()=>{w.current!==O.side&&(w.current=O.side,h?.(O.side))});let k=O.layerProps.ref,A=(0,o.useCallback)(t=>{k?.(t),E.current=t,e.l(u,t)},[k,u]),j=(0,s.jsx)(r.default,{...O.layerProps,ref:A,transition:`none`,props:T?{popover:`manual`}:{dir:S?`rtl`:`ltr`},children:(0,s.jsx)(r.default,{ref:_,...y})});return(0,s.jsxs)(s.Fragment,{children:[!g&&(0,s.jsx)(r.default,{ref:x}),T?j:D&&(0,c.createPortal)(j,D)]})}var u=(0,o.forwardRef)(l);u.displayName=`Overlay`,exports.default=u;