@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,16 +1,16 @@
1
1
  "use client";
2
2
  import { f as e } from "../react-shared.mjs";
3
- import { f as t, l as n, p as r, t as i } from "../platform.mjs";
4
- import { n as a } from "../effects.mjs";
5
- import { useBoxElement as o } from "../box.mjs";
6
- import { a as s, o as c } from "../behavior.mjs";
7
- import { a as l, i as u } from "../reporting.mjs";
8
- import { n as d } from "../motion.mjs";
9
- import f, { i as ee, n as p, r as m, t as h } from "./list.mjs";
10
- import { createContext as g, useCallback as te, useContext as _, useEffect as v, useRef as y, useState as b } from "react";
11
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
3
+ import { l as t, m as n, p as r, t as i, u as a } from "../platform.mjs";
4
+ import { n as o } from "../effects.mjs";
5
+ import { useBoxElement as s } from "../box.mjs";
6
+ import { a as c, o as l } from "../behavior.mjs";
7
+ import { a as u, i as d } from "../reporting.mjs";
8
+ import { n as f } from "../motion.mjs";
9
+ import ee, { i as p, n as m, r as h, t as g } from "./list.mjs";
10
+ import { createContext as _, useCallback as te, useContext as v, useEffect as y, useRef as b, useState as x } from "react";
11
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
12
12
  //#region src/utils/swipe/swipeUtils.ts
13
- var w;
13
+ var T;
14
14
  (function(e) {
15
15
  let t = e.SLOP = 8, n = e.FLICK = .4, r = e.FULL_RATIO = .6;
16
16
  function i(e, n) {
@@ -68,94 +68,94 @@ var w;
68
68
  return e === "start" ? t.start : e === "end" ? -t.end : 0;
69
69
  }
70
70
  e.restOffset = f;
71
- })(w ||= {});
72
- var T = w, E = g(null), ne = {
71
+ })(T ||= {});
72
+ var E = T, D = _(null), ne = {
73
73
  start: 0,
74
74
  end: 0
75
75
  };
76
- function D(e, p) {
77
- let { size: m = "md", wrap: g = !1, selected: _ = !1, chevron: w = !1, startActions: D, endActions: O, fullSwipe: k = !1, open: A, defaultOpen: ae = null, onOpenChange: oe, variant: se, children: j, props: ce, ...le } = e, M = y(null), N = y(null), P = y(null), F = y(null), I = y(!1), [L, R] = l({
78
- value: A,
76
+ function O(e, m) {
77
+ let { size: h = "md", wrap: _ = !1, selected: v = !1, chevron: T = !1, startActions: O, endActions: k, fullSwipe: A = !1, open: j, defaultOpen: ae = null, onOpenChange: oe, variant: se, children: ce, props: le, ...ue } = e, M = b(null), N = b(null), P = b(null), F = b(null), I = b(!1), [L, R] = u({
78
+ value: j,
79
79
  defaultValue: ae,
80
80
  onChange: oe,
81
81
  interaction: {
82
82
  component: "swipeItem",
83
83
  type: "openChange"
84
84
  }
85
- }), [z, B] = b(null), [V, H] = b(null), [U, W] = b({
85
+ }), [z, B] = x(null), [V, H] = x(null), [U, de] = x({
86
86
  trays: ne,
87
87
  width: 0,
88
88
  rtl: !1
89
- }), G = c(U), ue = te((e) => {
90
- M.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
91
- }, [p]), K = s(() => {
89
+ }), W = l(U), fe = te((e) => {
90
+ M.current = e, t(m, e);
91
+ }, [m]), G = c(() => {
92
92
  let e = (e) => e?.firstElementChild?.offsetWidth ?? 0, t = {
93
93
  trays: {
94
- start: D ? e(N.current) : 0,
95
- end: O ? e(P.current) : 0
94
+ start: O ? e(N.current) : 0,
95
+ end: k ? e(P.current) : 0
96
96
  },
97
97
  width: M.current?.offsetWidth ?? 0,
98
- rtl: r(M.current)
99
- }, n = G.current;
100
- return (n.trays.start !== t.trays.start || n.trays.end !== t.trays.end || n.width !== t.width || n.rtl !== t.rtl) && W(t), t;
98
+ rtl: n(M.current)
99
+ }, r = W.current;
100
+ return (r.trays.start !== t.trays.start || r.trays.end !== t.trays.end || r.width !== t.width || r.rtl !== t.rtl) && de(t), t;
101
101
  });
102
- a(() => {
103
- L && K();
104
- }, [L, K]);
105
- let q = s((e) => R(null, e)), de = u("swipeItem");
106
- v(() => {
102
+ o(() => {
103
+ L && G();
104
+ }, [L, G]);
105
+ let K = c((e) => R(null, e)), pe = d("swipeItem");
106
+ y(() => {
107
107
  let e = i();
108
108
  if (!L || !e) return;
109
- let n = (e) => {
110
- t(e, [M]) || q({
109
+ let t = (e) => {
110
+ r(e, [M]) || K({
111
111
  reason: "outside-pointer",
112
112
  event: e
113
113
  });
114
114
  };
115
- return e.addEventListener("pointerdown", n, !0), () => e.removeEventListener("pointerdown", n, !0);
116
- }, [L, q]), v(() => {
115
+ return e.addEventListener("pointerdown", t, !0), () => e.removeEventListener("pointerdown", t, !0);
116
+ }, [L, K]), y(() => {
117
117
  if (!V) return;
118
- let e = (V === "start" ? N : P).current, t = M.current?.firstElementChild, n = t && typeof getComputedStyle == "function" ? d.activeDuration(getComputedStyle(t)) : 0, r = setTimeout(() => {
118
+ let e = (V === "start" ? N : P).current, t = M.current?.firstElementChild, n = t && typeof getComputedStyle == "function" ? f.activeDuration(getComputedStyle(t)) : 0, r = setTimeout(() => {
119
119
  H(null), e?.querySelector("[data-swipe-action]")?.click();
120
- }, n + d.SETTLE_FRAME);
120
+ }, n + f.SETTLE_FRAME);
121
121
  return () => clearTimeout(r);
122
122
  }, [V]);
123
- let fe = s((e) => {
124
- if (I.current = !1, e.button !== 0 || V || !D && !O) return;
125
- let { trays: t } = K();
123
+ let me = c((e) => {
124
+ if (I.current = !1, e.button !== 0 || V || !O && !k) return;
125
+ let { trays: t } = G();
126
126
  F.current = {
127
127
  pointerId: e.pointerId,
128
128
  x: e.clientX,
129
129
  y: e.clientY,
130
- rest: T.restOffset(L, t),
130
+ rest: E.restOffset(L, t),
131
131
  intent: null,
132
132
  samples: [{
133
133
  t: e.timeStamp,
134
134
  x: e.clientX
135
135
  }]
136
136
  };
137
- }), pe = s((e) => {
137
+ }), he = c((e) => {
138
138
  let t = F.current;
139
139
  if (!t || t.pointerId !== e.pointerId || t.intent === "scroll") return;
140
- let r = e.clientX - t.x;
140
+ let n = e.clientX - t.x;
141
141
  if (!t.intent) {
142
- if (t.intent = T.intent(r, e.clientY - t.y), t.intent !== "swipe") return;
143
- e.currentTarget.setPointerCapture?.(e.pointerId), n(e.currentTarget);
142
+ if (t.intent = E.intent(n, e.clientY - t.y), t.intent !== "swipe") return;
143
+ e.currentTarget.setPointerCapture?.(e.pointerId), a(e.currentTarget);
144
144
  }
145
- let { trays: i, width: a, rtl: o } = G.current;
146
- t.samples = T.track(t.samples, {
145
+ let { trays: r, width: i, rtl: o } = W.current;
146
+ t.samples = E.track(t.samples, {
147
147
  t: e.timeStamp,
148
148
  x: e.clientX
149
- }), B(T.offsetFor(t.rest, o ? -r : r, i, a, k));
150
- }), J = s((e) => {
149
+ }), B(E.offsetFor(t.rest, o ? -n : n, r, i, A));
150
+ }), q = c((e) => {
151
151
  let t = F.current;
152
152
  if (!t || t.pointerId !== e.pointerId || (F.current = null, t.intent !== "swipe" || z === null)) return;
153
153
  e.currentTarget.releasePointerCapture?.(e.pointerId), I.current = !0;
154
- let { trays: n, width: r, rtl: i } = G.current, a = T.velocity(t.samples) * (i ? -1 : 1), o = e.type === "pointercancel" ? {
154
+ let { trays: n, width: r, rtl: i } = W.current, a = E.velocity(t.samples) * (i ? -1 : 1), o = e.type === "pointercancel" ? {
155
155
  open: L,
156
156
  full: null
157
- } : T.settle(z, a, n, r, k);
158
- B(null), o.full ? (H(o.full), de("fullSwipe", o.full, {
157
+ } : E.settle(z, a, n, r, A);
158
+ B(null), o.full ? (H(o.full), pe("fullSwipe", o.full, {
159
159
  reason: "swipe",
160
160
  event: e
161
161
  }), R(null, {
@@ -165,89 +165,89 @@ function D(e, p) {
165
165
  reason: "swipe",
166
166
  event: e
167
167
  });
168
- }), me = s((e) => {
168
+ }), ge = c((e) => {
169
169
  if (I.current) {
170
170
  I.current = !1, e.preventDefault(), e.stopPropagation();
171
171
  return;
172
172
  }
173
- L && (e.preventDefault(), e.stopPropagation(), q({
173
+ L && (e.preventDefault(), e.stopPropagation(), K({
174
174
  reason: "outside-pointer",
175
175
  event: e
176
176
  }));
177
- }), he = s((e) => {
177
+ }), J = c((e) => {
178
178
  let t = N.current?.contains(e.target) ? "start" : P.current?.contains(e.target) ? "end" : null;
179
- t && t !== L && (K(), R(t, {
179
+ t && t !== L && (G(), R(t, {
180
180
  reason: "focus",
181
181
  event: e
182
182
  }));
183
- }), ge = s((e) => {
183
+ }), _e = c((e) => {
184
184
  let t = e.relatedTarget;
185
- L && (!t || !M.current?.contains(t)) && q({
185
+ L && (!t || !M.current?.contains(t)) && K({
186
186
  reason: "focus",
187
187
  event: e
188
188
  });
189
- }), _e = s((e) => {
190
- e.key !== "Escape" || !L || e.defaultPrevented || (e.preventDefault(), q({
189
+ }), ve = c((e) => {
190
+ e.key !== "Escape" || !L || e.defaultPrevented || (e.preventDefault(), K({
191
191
  reason: "escape",
192
192
  event: e
193
193
  }), M.current?.querySelector("[data-list-action]")?.focus());
194
- }), { trays: Y, width: X, rtl: ve } = U, Z = z ?? (V ? V === "start" ? X : -X : T.restOffset(L, Y)), ye = z === null ? V : T.armed(z, Y, X, k), Q = z !== null, $ = (e, t) => /* @__PURE__ */ S(ie, {
194
+ }), { trays: Y, width: X, rtl: ye } = U, Z = z ?? (V ? V === "start" ? X : -X : E.restOffset(L, Y)), be = z === null ? V : E.armed(z, Y, X, A), Q = z !== null, $ = (e, t) => /* @__PURE__ */ C(ie, {
195
195
  side: e,
196
196
  trayRef: e === "start" ? N : P,
197
197
  width: e === "start" ? Math.max(0, Z) : Math.max(0, -Z),
198
198
  dragging: Q,
199
- children: /* @__PURE__ */ S(E.Provider, {
199
+ children: /* @__PURE__ */ C(D.Provider, {
200
200
  value: {
201
201
  side: e,
202
- armed: ye === e,
203
- close: q
202
+ armed: be === e,
203
+ close: K
204
204
  },
205
205
  children: t
206
206
  })
207
207
  });
208
- return o({
208
+ return s({
209
209
  tag: "li",
210
210
  component: "list.item",
211
- ...ee({
212
- ...h,
211
+ ...p({
212
+ ...g,
213
213
  css: {
214
- ...h.css,
214
+ ...g.css,
215
215
  overflow: "clip"
216
216
  }
217
- }, le),
218
- variant: [se, { selected: _ }],
217
+ }, ue),
218
+ variant: [se, { selected: v }],
219
219
  props: {
220
- ...ce,
221
- onFocus: he,
222
- onBlur: ge,
223
- onKeyDown: _e
220
+ ...le,
221
+ onFocus: J,
222
+ onBlur: _e,
223
+ onKeyDown: ve
224
224
  },
225
- children: /* @__PURE__ */ C(x, { children: [
226
- /* @__PURE__ */ C(re, {
227
- size: m,
228
- wrap: g,
225
+ children: /* @__PURE__ */ w(S, { children: [
226
+ /* @__PURE__ */ w(re, {
227
+ size: h,
228
+ wrap: _,
229
229
  dragging: Q,
230
- translate: Z === 0 ? void 0 : `${Math.round(ve ? -Z : Z)}px`,
230
+ translate: Z === 0 ? void 0 : `${Math.round(ye ? -Z : Z)}px`,
231
231
  handlers: {
232
- onPointerDown: fe,
233
- onPointerMove: pe,
234
- onPointerUp: J,
235
- onPointerCancel: J,
236
- onClickCapture: me,
232
+ onPointerDown: me,
233
+ onPointerMove: he,
234
+ onPointerUp: q,
235
+ onPointerCancel: q,
236
+ onClickCapture: ge,
237
237
  onDragStart: (e) => e.preventDefault()
238
238
  },
239
- children: [j, w && /* @__PURE__ */ S(f.Chevron, {})]
239
+ children: [ce, T && /* @__PURE__ */ C(ee.Chevron, {})]
240
240
  }),
241
- D ? $("start", D) : null,
242
- O ? $("end", O) : null
241
+ O ? $("start", O) : null,
242
+ k ? $("end", k) : null
243
243
  ] })
244
- }, ue);
244
+ }, fe);
245
245
  }
246
246
  function re({ size: e, wrap: t, dragging: n, translate: r, handlers: i, children: a }) {
247
- return o({
247
+ return s({
248
248
  component: "swipeItem.row",
249
- ...p,
250
- ...m[e],
249
+ ...m,
250
+ ...h[e],
251
251
  ...t ? { flexWrap: "wrap" } : {},
252
252
  position: "relative",
253
253
  css: { touchAction: "pan-y" },
@@ -258,7 +258,7 @@ function re({ size: e, wrap: t, dragging: n, translate: r, handlers: i, children
258
258
  });
259
259
  }
260
260
  function ie({ side: e, trayRef: t, width: n, dragging: r, children: i }) {
261
- let a = o({
261
+ let a = s({
262
262
  display: "flex",
263
263
  d: e === "end" ? "row-reverse" : "row",
264
264
  position: "absolute",
@@ -269,7 +269,7 @@ function ie({ side: e, trayRef: t, width: n, dragging: r, children: i }) {
269
269
  css: { width: "max-content" },
270
270
  children: i
271
271
  });
272
- return o({
272
+ return s({
273
273
  component: "swipeItem.tray",
274
274
  position: "absolute",
275
275
  top: 0,
@@ -281,14 +281,14 @@ function ie({ side: e, trayRef: t, width: n, dragging: r, children: i }) {
281
281
  children: a
282
282
  }, t);
283
283
  }
284
- function O(e, t) {
285
- let { icon: n, onClick: r, closeOnSelect: i = !0, variant: a, children: s, props: c, ...l } = e, u = _(E), d = (e) => {
284
+ function k(e, t) {
285
+ let { icon: n, onClick: r, closeOnSelect: i = !0, variant: a, children: o, props: c, ...l } = e, u = v(D), d = (e) => {
286
286
  r?.(e), i && !e.defaultPrevented && u?.close({
287
287
  reason: "action",
288
288
  event: e
289
289
  });
290
290
  };
291
- return o({
291
+ return s({
292
292
  tag: "button",
293
293
  component: "swipeItem.action",
294
294
  display: "flex",
@@ -312,18 +312,18 @@ function O(e, t) {
312
312
  ...c,
313
313
  onClick: d
314
314
  },
315
- children: n ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(k, { children: n }), s] }) : s
315
+ children: n ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(A, { children: n }), o] }) : o
316
316
  }, t);
317
317
  }
318
- function k({ children: e }) {
319
- return o({
318
+ function A({ children: e }) {
319
+ return s({
320
320
  tag: "span",
321
321
  display: "flex",
322
322
  props: { "aria-hidden": !0 },
323
323
  children: e
324
324
  });
325
325
  }
326
- var A = e(D, "SwipeItem");
327
- A.Action = e(O, "SwipeItem.Action");
326
+ var j = e(O, "SwipeItem");
327
+ j.Action = e(k, "SwipeItem.Action");
328
328
  //#endregion
329
- export { T as SwipeUtils, A as default };
329
+ export { E as SwipeUtils, j as default };
@@ -1 +1 @@
1
- "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../effects.cjs"),n=require("../box.cjs"),r=require("../behavior.cjs"),i=require("../identity.cjs"),a=require("../reporting.cjs"),o=require("../motion.cjs");let s=require("react"),c=require("react/jsx-runtime");var l;(function(e){let t=e.TAB_SELECTOR=`[role="tab"]`,n=e.LIST_SELECTOR=`[role="tablist"]`,r=e.PANEL_SELECTOR=`[role="tabpanel"]`;function i(e,t){return t instanceof Element&&t.closest(n)===e}e.owns=i;function a(e){return e?[...e.querySelectorAll(t)].filter(t=>i(e,t)):[]}e.tabs=a;function o(e){return e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}e.isDisabled=o;function s(e){return e.dataset.value}e.valueOf=s;function c(e){return e.replace(/[^A-Za-z0-9-]/g,e=>`_${e.codePointAt(0).toString(36)}_`)}e.token=c;function l(e,t,n,r){let i=e.length;if(i===0)return;let a=t<0||t>=i?n>0?-1:i:t;for(let t=0;t<i;t++){if(a+=n,a<0||a>=i){if(!r)return;a=(a%i+i)%i}if(!o(e[a]))return e[a]}}e.step=l;function u(e,t){return l(e,t===1?-1:e.length,t,!1)}e.edge=u;function d(e,t){return t instanceof HTMLElement?e.indexOf(t):-1}e.indexOf=d;function f(e,t,n=!1){if(e===`Home`)return{kind:`edge`,delta:1};if(e===`End`)return{kind:`edge`,delta:-1};let r=t===`vertical`,i=r?`ArrowDown`:n?`ArrowLeft`:`ArrowRight`,a=r?`ArrowUp`:n?`ArrowRight`:`ArrowLeft`;if(e===i)return{kind:`step`,delta:1};if(e===a)return{kind:`step`,delta:-1}}e.moveFor=f;function p(e,t,n,r){return n.kind===`edge`?u(e,n.delta):l(e,t,n.delta,r)}e.target=p;function m(e){if(e)return a(e).find(e=>e.getAttribute(`aria-selected`)===`true`)}e.selectedTab=m;function h(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n===`vertical`?{start:i.top-r.top+e.scrollTop,size:i.height}:{start:i.left-r.left+e.scrollLeft,size:i.width}}e.bounds=h;function g(e,t){return!e||!t?e===t:e.start===t.start&&e.size===t.size}e.sameBounds=g;function _(e){if(e)return[...e.querySelectorAll(r)].find(e=>!e.hasAttribute(`hidden`))}e.visiblePanel=_})(l||={});var u=l,d=(0,s.createContext)(null);function f(e){let t=(0,s.useContext)(d);if(!t)throw Error(`<${e}> has to be rendered inside a <Tabs>.`);return t}function p(e){let{children:r,value:o,defaultValue:l,onValueChange:f,orientation:p=`horizontal`,activation:m=`automatic`,loop:h=!0,keepMounted:g=!1,indicator:_=`static`,props:v,...y}=e,b=i.t(`tabs`),[x,S]=a.a({value:o,defaultValue:l,onChange:f,interaction:{component:`tabs`,type:`valueChange`}}),[C,w]=(0,s.useState)(),[T,E]=(0,s.useState)(!1);t.n(()=>{x!==void 0&&w(x)},[x]);let D=(0,s.useMemo)(()=>({identifier:b,value:x,orientation:p,activation:m,loop:h,keepMounted:g,indicator:_,indicatorLive:T,setIndicatorLive:E,tabStop:C??x,setTabStop:w,select:S,tabId:e=>`${b}-tab-${u.token(e)}`,panelId:e=>`${b}-panel-${u.token(e)}`}),[b,x,p,m,h,g,_,T,C,S]);return(0,c.jsx)(d.Provider,{value:D,children:(0,c.jsx)(n.default,{component:`tabs`,...y,variant:[y.variant,{vertical:p===`vertical`}],props:v,children:r})})}function m(i){let{children:a,label:o,labelledBy:l,props:d,...p}=i,{value:m,orientation:h,activation:g,loop:_,indicator:v,tabStop:y,setTabStop:b,setIndicatorLive:x,select:S}=f(`Tabs.List`),C=(0,s.useRef)(null),[w,T]=(0,s.useState)(),E=v===`sliding`;t.n(()=>{let e=C.current;if(!E||!e)return;let t=()=>{let t=u.selectedTab(e),n=t&&u.bounds(e,t,h);T(e=>u.sameBounds(e,n)?e:n)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);n.observe(e);for(let t of u.tabs(e))n.observe(t);return()=>n.disconnect()},[E,h,m]);let D=E&&w&&w.size>0?w:void 0;t.n(()=>{x(D!==void 0)},[D,x]),t.n(()=>{if(y!==void 0)return;let e=u.edge(u.tabs(C.current),1),t=e&&u.valueOf(e);t!==void 0&&b(t)},[y,b]);let O=r.a(t=>{let n=C.current;if(!n||t.defaultPrevented||!u.owns(n,t.target))return;let r=u.tabs(n),i=u.indexOf(r,t.target);if(i===-1)return;if(g===`manual`&&(t.key===`Enter`||t.key===` `)){let e=u.valueOf(r[i]);if(e===void 0)return;t.preventDefault(),S(e,{reason:`keyboard`,event:t});return}let a=u.moveFor(t.key,h,e.p(n));if(!a)return;let o=u.target(r,i,a,_);if(!o)return;t.preventDefault(),o.focus();let s=u.valueOf(o);g===`automatic`&&s!==void 0&&S(s,{reason:`keyboard`,event:t})});return(0,c.jsxs)(n.default,{ref:C,component:`tabs.list`,...p,variant:[p.variant,{vertical:h===`vertical`,sliding:E}],props:{role:`tablist`,"aria-label":o,"aria-labelledby":l,"aria-orientation":h,...d,onKeyDown:O},children:[a,D&&(0,c.jsx)(n.default,{tag:`span`,component:`tabs.indicator`,variant:{vertical:h===`vertical`},style:h===`vertical`?{top:`${D.start}px`,height:`${D.size}px`}:{left:`${D.start}px`,width:`${D.size}px`},props:{"aria-hidden":!0}})]})}m.displayName=`Tabs.List`;function h(e){let{value:t,children:i,disabled:a,props:o,...s}=e,{value:l,orientation:u,keepMounted:d,indicatorLive:p,tabStop:m,setTabStop:h,select:g,tabId:_,panelId:v}=f(`Tabs.Tab`),y=l===t,b=r.a(e=>g(t,{reason:`click`,event:e})),x=r.a(()=>h(t));return(0,c.jsx)(n.default,{tag:`button`,component:`tabs.tab`,...s,variant:[s.variant,{vertical:u===`vertical`,underline:!p}],disabled:a,id:_(t),props:{type:`button`,role:`tab`,"aria-selected":y,"aria-controls":y||d?v(t):void 0,tabIndex:m===t?0:-1,"data-value":t,...o,onClick:b,onFocus:x},children:i})}h.displayName=`Tabs.Tab`;function g(e){let{children:i,props:a,...l}=e,{value:d}=f(`Tabs.Panels`),p=(0,s.useRef)(null),[m,h]=(0,s.useState)(),[g,_]=(0,s.useState)(!1),v=r.a(()=>{let e=p.current;if(!e)return;let t=u.visiblePanel(e)?.offsetHeight;t!==m&&(m!==void 0&&t!==void 0&&_(!0),h(t))});return t.n(()=>{let e=p.current;if(!e||(v(),typeof ResizeObserver>`u`))return;let t=u.visiblePanel(e);if(!t)return;let n=new ResizeObserver(v);return n.observe(t),()=>n.disconnect()},[d,v]),t.n(()=>{let e=p.current;if(!e||!g)return;let t=setTimeout(()=>_(!1),o.n.activeDuration(getComputedStyle(e))+o.n.SETTLE_FRAME);return()=>clearTimeout(t)},[g,m]),(0,c.jsx)(n.default,{ref:p,component:`tabs.panels`,...l,variant:[l.variant,{resizing:g}],style:{height:m===void 0?void 0:`${m}px`,...l.style},props:a,children:i})}g.displayName=`Tabs.Panels`;function _(e){let{value:t,children:r,props:i,...a}=e,{value:o,keepMounted:s,tabId:l,panelId:u}=f(`Tabs.Panel`),d=o===t;return!d&&!s?null:(0,c.jsx)(n.default,{component:`tabs.panel`,...a,variant:[a.variant,{hidden:!d}],id:u(t),props:{role:`tabpanel`,"aria-labelledby":l(t),hidden:!d||void 0,tabIndex:0,...i},children:r})}_.displayName=`Tabs.Panel`;var v=p;v.List=m,v.Tab=h,v.Panels=g,v.Panel=_,v.displayName=`Tabs`,exports.default=v;
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../platform.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../behavior.cjs"),a=require("../identity.cjs"),o=require("../reporting.cjs"),s=require("../motion.cjs");let c=require("react"),l=require("react/jsx-runtime");var u;(function(e){let t=e.TAB_SELECTOR=`[role="tab"]`,n=e.LIST_SELECTOR=`[role="tablist"]`,r=e.PANEL_SELECTOR=`[role="tabpanel"]`;function i(e,t){return t instanceof Element&&t.closest(n)===e}e.owns=i;function a(e){return e?[...e.querySelectorAll(t)].filter(t=>i(e,t)):[]}e.tabs=a;function o(e){return e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}e.isDisabled=o;function s(e){return e.dataset.value}e.valueOf=s;function c(e){return e.replace(/[^A-Za-z0-9-]/g,e=>`_${e.codePointAt(0).toString(36)}_`)}e.token=c;function l(e,t,n,r){let i=e.length;if(i===0)return;let a=t<0||t>=i?n>0?-1:i:t;for(let t=0;t<i;t++){if(a+=n,a<0||a>=i){if(!r)return;a=(a%i+i)%i}if(!o(e[a]))return e[a]}}e.step=l;function u(e,t){return l(e,t===1?-1:e.length,t,!1)}e.edge=u;function d(e,t){return t instanceof HTMLElement?e.indexOf(t):-1}e.indexOf=d;function f(e,t,n=!1){if(e===`Home`)return{kind:`edge`,delta:1};if(e===`End`)return{kind:`edge`,delta:-1};let r=t===`vertical`,i=r?`ArrowDown`:n?`ArrowLeft`:`ArrowRight`,a=r?`ArrowUp`:n?`ArrowRight`:`ArrowLeft`;if(e===i)return{kind:`step`,delta:1};if(e===a)return{kind:`step`,delta:-1}}e.moveFor=f;function p(e,t,n,r){return n.kind===`edge`?u(e,n.delta):l(e,t,n.delta,r)}e.target=p;function m(e){if(e)return a(e).find(e=>e.getAttribute(`aria-selected`)===`true`)}e.selectedTab=m;function h(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n===`vertical`?{start:i.top-r.top+e.scrollTop,size:i.height}:{start:i.left-r.left+e.scrollLeft,size:i.width}}e.bounds=h;function g(e,t){return!e||!t?e===t:e.start===t.start&&e.size===t.size}e.sameBounds=g;function _(e){if(e)return[...e.querySelectorAll(r)].find(e=>!e.hasAttribute(`hidden`))}e.visiblePanel=_})(u||={});var d=u,f=(0,c.createContext)(null);function p(e){let t=(0,c.useContext)(f);if(!t)throw Error(`<${e}> has to be rendered inside a <Tabs>.`);return t}function m(e){let{children:t,value:i,defaultValue:s,onValueChange:u,orientation:p=`horizontal`,activation:m=`automatic`,loop:h=!0,keepMounted:g=!1,indicator:_=`static`,props:v,...y}=e,b=a.t(`tabs`),[x,S]=o.a({value:i,defaultValue:s,onChange:u,interaction:{component:`tabs`,type:`valueChange`}}),[C,w]=(0,c.useState)(),[T,E]=(0,c.useState)(!1);n.n(()=>{x!==void 0&&w(x)},[x]);let D=(0,c.useMemo)(()=>({identifier:b,value:x,orientation:p,activation:m,loop:h,keepMounted:g,indicator:_,indicatorLive:T,setIndicatorLive:E,tabStop:C??x,setTabStop:w,select:S,tabId:e=>`${b}-tab-${d.token(e)}`,panelId:e=>`${b}-panel-${d.token(e)}`}),[b,x,p,m,h,g,_,T,C,S]);return(0,l.jsx)(f.Provider,{value:D,children:(0,l.jsx)(r.default,{component:`tabs`,...y,variant:[y.variant,{vertical:p===`vertical`}],props:v,children:t})})}function h(e,a){let{children:o,label:s,labelledBy:u,props:f,...m}=e,{value:h,orientation:g,activation:_,loop:v,indicator:y,tabStop:b,setTabStop:x,setIndicatorLive:S,select:C}=p(`Tabs.List`),w=(0,c.useRef)(null),T=(0,c.useCallback)(e=>{w.current=e,t.l(a,e)},[a]),[E,D]=(0,c.useState)(),O=y===`sliding`;n.n(()=>{let e=w.current;if(!O||!e)return;let t=()=>{let t=d.selectedTab(e),n=t&&d.bounds(e,t,g);D(e=>d.sameBounds(e,n)?e:n)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);n.observe(e);for(let t of d.tabs(e))n.observe(t);return()=>n.disconnect()},[O,g,h]);let k=O&&E&&E.size>0?E:void 0;n.n(()=>{S(k!==void 0)},[k,S]),n.n(()=>{if(b!==void 0)return;let e=d.edge(d.tabs(w.current),1),t=e&&d.valueOf(e);t!==void 0&&x(t)},[b,x]);let A=i.a(e=>{let n=w.current;if(!n||e.defaultPrevented||!d.owns(n,e.target))return;let r=d.tabs(n),i=d.indexOf(r,e.target);if(i===-1)return;if(_===`manual`&&(e.key===`Enter`||e.key===` `)){let t=d.valueOf(r[i]);if(t===void 0)return;e.preventDefault(),C(t,{reason:`keyboard`,event:e});return}let a=d.moveFor(e.key,g,t.m(n));if(!a)return;let o=d.target(r,i,a,v);if(!o)return;e.preventDefault(),o.focus();let s=d.valueOf(o);_===`automatic`&&s!==void 0&&C(s,{reason:`keyboard`,event:e})});return(0,l.jsxs)(r.default,{ref:T,component:`tabs.list`,...m,variant:[m.variant,{vertical:g===`vertical`,sliding:O}],props:{role:`tablist`,"aria-label":s,"aria-labelledby":u,"aria-orientation":g,...f,onKeyDown:A},children:[o,k&&(0,l.jsx)(r.default,{tag:`span`,component:`tabs.indicator`,variant:{vertical:g===`vertical`},style:g===`vertical`?{top:`${k.start}px`,height:`${k.size}px`}:{left:`${k.start}px`,width:`${k.size}px`},props:{"aria-hidden":!0}})]})}function g(e){let{value:t,children:n,disabled:a,props:o,...s}=e,{value:c,orientation:u,keepMounted:d,indicatorLive:f,tabStop:m,setTabStop:h,select:g,tabId:_,panelId:v}=p(`Tabs.Tab`),y=c===t,b=i.a(e=>g(t,{reason:`click`,event:e})),x=i.a(()=>h(t));return(0,l.jsx)(r.default,{tag:`button`,component:`tabs.tab`,...s,variant:[s.variant,{vertical:u===`vertical`,underline:!f}],disabled:a,id:_(t),props:{type:`button`,role:`tab`,"aria-selected":y,"aria-controls":y||d?v(t):void 0,tabIndex:m===t?0:-1,"data-value":t,...o,onClick:b,onFocus:x},children:n})}g.displayName=`Tabs.Tab`;function _(e,a){let{children:o,props:u,...f}=e,{value:m}=p(`Tabs.Panels`),h=(0,c.useRef)(null),g=(0,c.useCallback)(e=>{h.current=e,t.l(a,e)},[a]),[_,v]=(0,c.useState)(),[y,b]=(0,c.useState)(!1),x=i.a(()=>{let e=h.current;if(!e)return;let t=d.visiblePanel(e)?.offsetHeight;t!==_&&(_!==void 0&&t!==void 0&&b(!0),v(t))});return n.n(()=>{let e=h.current;if(!e||(x(),typeof ResizeObserver>`u`))return;let t=d.visiblePanel(e);if(!t)return;let n=new ResizeObserver(x);return n.observe(t),()=>n.disconnect()},[m,x]),n.n(()=>{let e=h.current;if(!e||!y)return;let t=setTimeout(()=>b(!1),s.n.activeDuration(getComputedStyle(e))+s.n.SETTLE_FRAME);return()=>clearTimeout(t)},[y,_]),(0,l.jsx)(r.default,{ref:g,component:`tabs.panels`,...f,variant:[f.variant,{resizing:y}],style:{height:_===void 0?void 0:`${_}px`,...f.style},props:u,children:o})}function v(e){let{value:t,children:n,props:i,...a}=e,{value:o,keepMounted:s,tabId:c,panelId:u}=p(`Tabs.Panel`),d=o===t;return!d&&!s?null:(0,l.jsx)(r.default,{component:`tabs.panel`,...a,variant:[a.variant,{hidden:!d}],id:u(t),props:{role:`tabpanel`,"aria-labelledby":c(t),hidden:!d||void 0,tabIndex:0,...i},children:n})}v.displayName=`Tabs.Panel`;var y=m;y.List=e.f(h,`Tabs.List`),y.Tab=g,y.Panels=e.f(_,`Tabs.Panels`),y.Panel=v,y.displayName=`Tabs`,exports.default=y;