@box-kite/react 2.2.15 → 2.2.17

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