@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,17 +1,18 @@
1
1
  "use client";
2
2
  import { f as e } from "../react-shared.mjs";
3
- import { n as t } from "../effects.mjs";
4
- import { useBoxElement as n } from "../box.mjs";
5
- import { a as r, o as i } from "../behavior.mjs";
6
- import { i as a, r as o } from "../reporting.mjs";
7
- import { Circle as s, Svg as c } from "./svg.mjs";
8
- import l from "./visuallyHidden.mjs";
9
- import { t as u } from "../scrolling.mjs";
10
- import d from "./list.mjs";
11
- import { createContext as f, useCallback as ee, useContext as p, useEffect as m, useId as te, useMemo as h, useRef as g, useState as _ } from "react";
12
- import { jsx as v, jsxs as ne } from "react/jsx-runtime";
3
+ import { l as t } from "../platform.mjs";
4
+ import { n } from "../effects.mjs";
5
+ import { useBoxElement as r } from "../box.mjs";
6
+ import { a as i, o as a } from "../behavior.mjs";
7
+ import { i as o, r as s } from "../reporting.mjs";
8
+ import { Circle as c, Svg as l } from "./svg.mjs";
9
+ import u from "./visuallyHidden.mjs";
10
+ import { t as d } from "../scrolling.mjs";
11
+ import f from "./list.mjs";
12
+ import { createContext as p, useCallback as ee, useContext as m, useEffect as h, useId as te, useMemo as g, useRef as _, useState as v } from "react";
13
+ import { jsx as y, jsxs as ne } from "react/jsx-runtime";
13
14
  //#region src/utils/sortable/sortableUtils.ts
14
- var y;
15
+ var b;
15
16
  (function(e) {
16
17
  e.SLOP = 4;
17
18
  function t(e) {
@@ -54,31 +55,31 @@ var y;
54
55
  }
55
56
  }
56
57
  e.keyTarget = o;
57
- })(y ||= {});
58
- var b = y, x = f(null), S = f(null), C = 48, re = 12, w = ":scope > [data-sortable-value]";
59
- function T(e) {
60
- return e ? Array.from(e.querySelectorAll(w)) : [];
61
- }
58
+ })(b ||= {});
59
+ var x = b, S = p(null), C = p(null), w = 48, re = 12, T = ":scope > [data-sortable-value]";
62
60
  function E(e) {
63
- return T(e).map((e) => e.dataset.sortableValue ?? "");
61
+ return e ? Array.from(e.querySelectorAll(T)) : [];
64
62
  }
65
63
  function D(e) {
66
- return new Map(T(e).map((e) => [e.dataset.sortableValue ?? "", e.getBoundingClientRect().top]));
64
+ return E(e).map((e) => e.dataset.sortableValue ?? "");
65
+ }
66
+ function O(e) {
67
+ return new Map(E(e).map((e) => [e.dataset.sortableValue ?? "", e.getBoundingClientRect().top]));
67
68
  }
68
69
  function ie(e, t) {
69
70
  return e.length === t.length && e.every((e, n) => e === t[n]);
70
71
  }
71
- function O(e, n) {
72
- let { onOrderChange: s, onOrderCommit: c, children: f, variant: p, props: y, ...S } = e, w = g(null), O = g(null), k = g(null), [A, j] = _(null), [M, N] = _(0), [P, F] = _(!1), [ae, I] = _(""), L = `${te()}-sortable`, R = i(A), z = o(s, "sortableList", "orderChange"), B = o(c, "sortableList", "orderCommit"), V = a("sortableList"), oe = ee((e) => {
73
- w.current = e, typeof n == "function" ? n(e) : n && (n.current = e);
74
- }, [n]), H = (e, t) => `position ${e.indexOf(t) + 1} of ${e.length}`, U = (e, t) => {
75
- k.current = D(w.current), z(e, t);
72
+ function k(e, r) {
73
+ let { onOrderChange: c, onOrderCommit: l, children: p, variant: m, props: b, ...C } = e, T = _(null), k = _(null), A = _(null), [j, M] = v(null), [N, P] = v(0), [F, I] = v(!1), [ae, L] = v(""), R = `${te()}-sortable`, z = a(j), B = s(c, "sortableList", "orderChange"), V = s(l, "sortableList", "orderCommit"), H = o("sortableList"), oe = ee((e) => {
74
+ T.current = e, t(r, e);
75
+ }, [r]), U = (e, t) => `position ${e.indexOf(t) + 1} of ${e.length}`, W = (e, t) => {
76
+ A.current = O(T.current), B(e, t);
76
77
  };
77
- t(() => {
78
- let e = k.current;
78
+ n(() => {
79
+ let e = A.current;
79
80
  if (e) {
80
- k.current = null;
81
- for (let t of T(w.current)) {
81
+ A.current = null;
82
+ for (let t of E(T.current)) {
82
83
  let n = e.get(t.dataset.sortableValue ?? ""), r = n === void 0 ? 0 : n - t.getBoundingClientRect().top, i = parseFloat(getComputedStyle(t).transitionDuration) * 1e3 || 0;
83
84
  Math.abs(r) < 1 || i === 0 || typeof t.animate != "function" || t.animate([{ translate: `0 ${r}px` }, { translate: "0 0" }], {
84
85
  duration: i,
@@ -86,25 +87,25 @@ function O(e, n) {
86
87
  });
87
88
  }
88
89
  }
89
- }), m(() => {
90
- if (!P) return;
91
- let e = requestAnimationFrame(() => F(!1));
90
+ }), h(() => {
91
+ if (!F) return;
92
+ let e = requestAnimationFrame(() => I(!1));
92
93
  return () => cancelAnimationFrame(e);
93
- }, [P]), t(() => {
94
- if (!A || A.pointer) return;
95
- let e = T(w.current).find((e) => e.dataset.sortableValue === A.value)?.querySelector("[data-sortable-handle]");
94
+ }, [F]), n(() => {
95
+ if (!j || j.pointer) return;
96
+ let e = E(T.current).find((e) => e.dataset.sortableValue === j.value)?.querySelector("[data-sortable-handle]");
96
97
  e && e.ownerDocument.activeElement !== e && e.focus();
97
98
  });
98
- let W = r((e, t) => {
99
- let n = e.pointer, r = w.current;
99
+ let G = i((e, t) => {
100
+ let n = e.pointer, r = T.current;
100
101
  if (!n || !r) return;
101
102
  n.lastY = t;
102
103
  let i = t - r.getBoundingClientRect().top - (n.startY - n.startTop), a = n.order.indexOf(e.value);
103
- n.to = b.targetIndex(n.slots, a, i), N(i);
104
+ n.to = x.targetIndex(n.slots, a, i), P(i);
104
105
  }), se = (e, t) => {
105
- let n = w.current;
106
+ let n = T.current;
106
107
  if (!n) return;
107
- let r = n.getBoundingClientRect().top, i = T(n), a = i.map((e) => e.dataset.sortableValue ?? ""), o = i.map((e) => {
108
+ let r = n.getBoundingClientRect().top, i = E(n), a = i.map((e) => e.dataset.sortableValue ?? ""), o = i.map((e) => {
108
109
  let t = e.getBoundingClientRect();
109
110
  return {
110
111
  top: t.top - r,
@@ -124,202 +125,202 @@ function O(e, n) {
124
125
  to: a.indexOf(t.value)
125
126
  }
126
127
  };
127
- j(s), W(s, e.clientY);
128
- }, G = A?.pointer !== void 0;
129
- m(() => {
130
- if (!G) return;
131
- let e = u(w.current), t = 0, n = () => {
132
- let r = R.current;
128
+ M(s), G(s, e.clientY);
129
+ }, K = j?.pointer !== void 0;
130
+ h(() => {
131
+ if (!K) return;
132
+ let e = d(T.current), t = 0, n = () => {
133
+ let r = z.current;
133
134
  if (r?.pointer) {
134
- let t = r.pointer.lastY, n = e ? e.getBoundingClientRect().top : 0, i = e ? e.getBoundingClientRect().bottom : window.innerHeight, a = t < n + C ? -12 : t > i - C ? re : 0;
135
- a && ((e ?? window).scrollBy(0, a), W(r, t));
135
+ let t = r.pointer.lastY, n = e ? e.getBoundingClientRect().top : 0, i = e ? e.getBoundingClientRect().bottom : window.innerHeight, a = t < n + w ? -12 : t > i - w ? re : 0;
136
+ a && ((e ?? window).scrollBy(0, a), G(r, t));
136
137
  }
137
138
  t = requestAnimationFrame(n);
138
139
  };
139
140
  return t = requestAnimationFrame(n), () => cancelAnimationFrame(t);
140
141
  }, [
142
+ K,
141
143
  G,
142
- W,
143
- R
144
+ z
144
145
  ]);
145
- let K = (e, t, n) => {
146
- let r = E(w.current);
147
- j({
146
+ let q = (e, t, n) => {
147
+ let r = D(T.current);
148
+ M({
148
149
  value: e,
149
150
  name: t,
150
151
  origin: r
151
- }), V("grab", e, {
152
+ }), H("grab", e, {
152
153
  reason: n.type === "keydown" ? "keyboard" : "pointer",
153
154
  event: n,
154
155
  from: r.indexOf(e)
155
- }), I(`${t} picked up at ${H(r, e)}. Use the arrow keys to move it, Enter to drop it.`), n.preventDefault();
156
- }, q = (e, t, n = E(w.current)) => {
156
+ }), L(`${t} picked up at ${U(r, e)}. Use the arrow keys to move it, Enter to drop it.`), n.preventDefault();
157
+ }, J = (e, t, n = D(T.current)) => {
157
158
  let r = n.indexOf(e.value);
158
- j(null), B(n, {
159
+ M(null), V(n, {
159
160
  reason: "keyboard",
160
161
  event: t,
161
162
  value: e.value,
162
163
  from: e.origin.indexOf(e.value),
163
164
  to: r
164
- }), I(`${e.name} dropped at ${H(n, e.value)}.`);
165
- }, J = r((e, t) => {
166
- let n = E(w.current);
167
- V("grabCancel", e.value, {
165
+ }), L(`${e.name} dropped at ${U(n, e.value)}.`);
166
+ }, Y = i((e, t) => {
167
+ let n = D(T.current);
168
+ H("grabCancel", e.value, {
168
169
  reason: t.type === "keydown" ? "escape" : t.type === "blur" ? "blur" : "pointercancel",
169
170
  event: t
170
- }), j(null), N(0), ie(n, e.origin) || U(e.origin, {
171
+ }), M(null), P(0), ie(n, e.origin) || W(e.origin, {
171
172
  reason: e.pointer ? "pointer" : "keyboard",
172
173
  event: t,
173
174
  value: e.value,
174
175
  from: n.indexOf(e.value),
175
176
  to: e.origin.indexOf(e.value)
176
- }), I(`${e.name} put back at ${H(e.origin, e.value)}.`);
177
- }), Y = (e, t, n) => {
178
- let r = E(w.current), i = r.indexOf(e.value);
177
+ }), L(`${e.name} put back at ${U(e.origin, e.value)}.`);
178
+ }), X = (e, t, n) => {
179
+ let r = D(T.current), i = r.indexOf(e.value);
179
180
  if (i < 0 || t === i) return r;
180
- let a = b.move(r, i, t);
181
- return U(a, {
181
+ let a = x.move(r, i, t);
182
+ return W(a, {
182
183
  reason: "keyboard",
183
184
  event: n,
184
185
  value: e.value,
185
186
  from: i,
186
187
  to: t
187
- }), I(`${e.name}, ${H(a, e.value)}.`), a;
188
- }, X = r((e, t, n) => {
189
- e.button !== 0 || e.defaultPrevented || (e.preventDefault(), e.currentTarget.focus(), e.currentTarget.setPointerCapture?.(e.pointerId), O.current = {
188
+ }), L(`${e.name}, ${U(a, e.value)}.`), a;
189
+ }, Z = i((e, t, n) => {
190
+ e.button !== 0 || e.defaultPrevented || (e.preventDefault(), e.currentTarget.focus(), e.currentTarget.setPointerCapture?.(e.pointerId), k.current = {
190
191
  id: e.pointerId,
191
192
  x: e.clientX,
192
193
  y: e.clientY,
193
194
  value: t,
194
195
  name: n
195
196
  });
196
- }), Z = r((e) => {
197
- let t = R.current;
197
+ }), Q = i((e) => {
198
+ let t = z.current;
198
199
  if (t?.pointer && t.pointer.id === e.pointerId) {
199
- W(t, e.clientY);
200
+ G(t, e.clientY);
200
201
  return;
201
202
  }
202
- let n = O.current;
203
- !n || n.id !== e.pointerId || Math.hypot(e.clientX - n.x, e.clientY - n.y) < b.SLOP || (O.current = null, se(e, n));
204
- }), Q = r((e) => {
205
- let t = O.current;
206
- O.current = null;
207
- let n = R.current;
203
+ let n = k.current;
204
+ !n || n.id !== e.pointerId || Math.hypot(e.clientX - n.x, e.clientY - n.y) < x.SLOP || (k.current = null, se(e, n));
205
+ }), $ = i((e) => {
206
+ let t = k.current;
207
+ k.current = null;
208
+ let n = z.current;
208
209
  if (t && t.id === e.pointerId && e.type === "pointerup") {
209
- n && !n.pointer ? n.value === t.value && q(n, e) : K(t.value, t.name, e);
210
+ n && !n.pointer ? n.value === t.value && J(n, e) : q(t.value, t.name, e);
210
211
  return;
211
212
  }
212
213
  let r = n?.pointer;
213
214
  if (!n || !r || r.id !== e.pointerId) return;
214
- if (e.currentTarget.releasePointerCapture?.(e.pointerId), F(!0), e.type === "pointercancel") {
215
- k.current = D(w.current), J(n, e);
215
+ if (e.currentTarget.releasePointerCapture?.(e.pointerId), I(!0), e.type === "pointercancel") {
216
+ A.current = O(T.current), Y(n, e);
216
217
  return;
217
218
  }
218
- let i = r.order.indexOf(n.value), a = b.move(r.order, i, r.to), o = {
219
+ let i = r.order.indexOf(n.value), a = x.move(r.order, i, r.to), o = {
219
220
  reason: "pointer",
220
221
  event: e,
221
222
  value: n.value,
222
223
  from: i,
223
224
  to: r.to
224
225
  };
225
- k.current = D(w.current), j(null), N(0), r.to !== i && z(a, o), B(a, o), I(`${n.name} dropped at ${H(a, n.value)}.`);
226
- }), $ = r((e, t, n) => {
226
+ A.current = O(T.current), M(null), P(0), r.to !== i && B(a, o), V(a, o), L(`${n.name} dropped at ${U(a, n.value)}.`);
227
+ }), ce = i((e, t, n) => {
227
228
  if (e.defaultPrevented) return;
228
- let r = R.current, i = r && r.value === t && !r.pointer ? r : void 0;
229
+ let r = z.current, i = r && r.value === t && !r.pointer ? r : void 0;
229
230
  if (!i) {
230
- (e.key === "Enter" || e.key === " ") && K(t, n, e);
231
+ (e.key === "Enter" || e.key === " ") && q(t, n, e);
231
232
  return;
232
233
  }
233
234
  if (e.key === "Escape") {
234
- e.preventDefault(), J(i, e);
235
+ e.preventDefault(), Y(i, e);
235
236
  return;
236
237
  }
237
238
  if (e.key === "Enter" || e.key === " ") {
238
- e.preventDefault(), q(i, e);
239
+ e.preventDefault(), J(i, e);
239
240
  return;
240
241
  }
241
- let a = E(w.current), o = b.keyTarget(e.key, a.indexOf(t), a.length);
242
- o !== null && (e.preventDefault(), Y(i, o, e));
243
- }), ce = r((e) => {
242
+ let a = D(T.current), o = x.keyTarget(e.key, a.indexOf(t), a.length);
243
+ o !== null && (e.preventDefault(), X(i, o, e));
244
+ }), le = i((e) => {
244
245
  setTimeout(() => {
245
- let t = R.current, n = w.current;
246
- !t || t.pointer || t.value !== e || !n || n.ownerDocument.activeElement?.closest("[data-sortable-value]")?.getAttribute("data-sortable-value") !== e && J(t, new Event("blur"));
246
+ let t = z.current, n = T.current;
247
+ !t || t.pointer || t.value !== e || !n || n.ownerDocument.activeElement?.closest("[data-sortable-value]")?.getAttribute("data-sortable-value") !== e && Y(t, new Event("blur"));
247
248
  });
248
- }), le = (e) => {
249
- let t = R.current;
249
+ }), ue = (e) => {
250
+ let t = z.current;
250
251
  if (!t || t.pointer || !(e.target instanceof Element)) return null;
251
252
  let n = e.target.closest("[data-sortable-value]");
252
- return n && n.parentElement === w.current && n.dataset.sortableValue !== t.value ? n : null;
253
- }, ue = (e) => {
254
- le(e) && e.preventDefault();
253
+ return n && n.parentElement === T.current && n.dataset.sortableValue !== t.value ? n : null;
255
254
  }, de = (e) => {
256
- let t = le(e), n = R.current;
257
- !t || !n || (e.preventDefault(), e.stopPropagation(), q(n, e, Y(n, E(w.current).indexOf(t.dataset.sortableValue ?? ""), e)));
258
- }, fe = h(() => {
259
- let e = A?.pointer, t = e ? e.order.indexOf(A.value) : -1;
255
+ ue(e) && e.preventDefault();
256
+ }, fe = (e) => {
257
+ let t = ue(e), n = z.current;
258
+ !t || !n || (e.preventDefault(), e.stopPropagation(), J(n, e, X(n, D(T.current).indexOf(t.dataset.sortableValue ?? ""), e)));
259
+ }, pe = g(() => {
260
+ let e = j?.pointer, t = e ? e.order.indexOf(j.value) : -1;
260
261
  return {
261
- heldOf: (e) => A && A.value === e ? A.pointer ? "pointer" : "keyboard" : void 0,
262
+ heldOf: (e) => j && j.value === e ? j.pointer ? "pointer" : "keyboard" : void 0,
262
263
  translateOf: (n) => {
263
264
  if (!e) return;
264
- if (n === A.value) return `0 ${Math.round(M)}px`;
265
- let r = b.shiftOf(e.slots, t, e.to, e.order.indexOf(n));
265
+ if (n === j.value) return `0 ${Math.round(N)}px`;
266
+ let r = x.shiftOf(e.slots, t, e.to, e.order.indexOf(n));
266
267
  return r ? `0 ${r}px` : void 0;
267
268
  },
268
- settling: P,
269
- instructionsId: L,
269
+ settling: F,
270
+ instructionsId: R,
270
271
  handleProps: (e, t) => ({
271
272
  type: "button",
272
273
  "data-sortable-handle": "",
273
274
  "aria-label": `Move ${t}`,
274
- "aria-pressed": A?.value === e,
275
- "aria-describedby": L,
276
- onPointerDown: (n) => X(n, e, t),
277
- onPointerMove: Z,
278
- onPointerUp: Q,
279
- onPointerCancel: Q,
280
- onKeyDown: (n) => $(n, e, t),
281
- onBlur: () => ce(e)
275
+ "aria-pressed": j?.value === e,
276
+ "aria-describedby": R,
277
+ onPointerDown: (n) => Z(n, e, t),
278
+ onPointerMove: Q,
279
+ onPointerUp: $,
280
+ onPointerCancel: $,
281
+ onKeyDown: (n) => ce(n, e, t),
282
+ onBlur: () => le(e)
282
283
  })
283
284
  };
284
285
  }, [
285
- A,
286
- M,
287
- P,
288
- L,
289
- X,
286
+ j,
287
+ N,
288
+ F,
289
+ R,
290
290
  Z,
291
291
  Q,
292
292
  $,
293
- ce
293
+ ce,
294
+ le
294
295
  ]);
295
- return /* @__PURE__ */ ne(x.Provider, {
296
- value: fe,
296
+ return /* @__PURE__ */ ne(S.Provider, {
297
+ value: pe,
297
298
  children: [
298
- /* @__PURE__ */ v(d, {
299
+ /* @__PURE__ */ y(f, {
299
300
  ref: oe,
300
- ...S,
301
- variant: p,
302
- userSelect: G ? "none" : void 0,
301
+ ...C,
302
+ variant: m,
303
+ userSelect: K ? "none" : void 0,
303
304
  props: {
304
- ...y,
305
- onMouseDownCapture: ue,
306
- onClickCapture: de
305
+ ...b,
306
+ onMouseDownCapture: de,
307
+ onClickCapture: fe
307
308
  },
308
- children: f
309
+ children: p
309
310
  }),
310
- /* @__PURE__ */ v(l, {
311
+ /* @__PURE__ */ y(u, {
311
312
  props: { role: "status" },
312
313
  children: ae
313
314
  }),
314
- /* @__PURE__ */ v(l, {
315
- id: L,
315
+ /* @__PURE__ */ y(u, {
316
+ id: R,
316
317
  children: "Press Enter or Space to pick the item up, the arrow keys to move it, Enter to drop it and Escape to put it back."
317
318
  })
318
319
  ]
319
320
  });
320
321
  }
321
- function k(e, t) {
322
- let { value: n, label: r, disabled: i = !1, variant: a, props: o, ...s } = e, c = p(x), l = c?.heldOf(n), u = c?.translateOf(n), f = h(() => ({
322
+ function A(e, t) {
323
+ let { value: n, label: r, disabled: i = !1, variant: a, props: o, ...s } = e, c = m(S), l = c?.heldOf(n), u = c?.translateOf(n), d = g(() => ({
323
324
  value: n,
324
325
  name: r ?? n,
325
326
  disabled: i
@@ -328,9 +329,9 @@ function k(e, t) {
328
329
  r,
329
330
  i
330
331
  ]);
331
- return /* @__PURE__ */ v(S.Provider, {
332
- value: f,
333
- children: /* @__PURE__ */ v(d.Item, {
332
+ return /* @__PURE__ */ y(C.Provider, {
333
+ value: d,
334
+ children: /* @__PURE__ */ y(f.Item, {
334
335
  ref: t,
335
336
  ...s,
336
337
  variant: [a, {
@@ -346,8 +347,8 @@ function k(e, t) {
346
347
  })
347
348
  });
348
349
  }
349
- function A() {
350
- return /* @__PURE__ */ v(c, {
350
+ function j() {
351
+ return /* @__PURE__ */ y(l, {
351
352
  viewBox: "0 0 16 16",
352
353
  width: "1rem",
353
354
  fill: "currentColor",
@@ -355,16 +356,16 @@ function A() {
355
356
  3,
356
357
  8,
357
358
  13
358
- ].map((t) => /* @__PURE__ */ v(s, {
359
+ ].map((t) => /* @__PURE__ */ y(c, {
359
360
  cx: e,
360
361
  cy: t,
361
362
  r: 1.4
362
363
  }, `${e}-${t}`)))
363
364
  });
364
365
  }
365
- function j(e, t) {
366
- let { children: r, variant: i, props: a, ...o } = e, s = p(x), c = p(S), l = c && s ? s.handleProps(c.value, c.name) : {};
367
- return n({
366
+ function M(e, t) {
367
+ let { children: n, variant: i, props: a, ...o } = e, s = m(S), c = m(C), l = c && s ? s.handleProps(c.value, c.name) : {};
368
+ return r({
368
369
  tag: "button",
369
370
  component: "sortableList.handle",
370
371
  display: "flex",
@@ -383,10 +384,10 @@ function j(e, t) {
383
384
  ...c?.disabled ? { disabled: !0 } : {},
384
385
  ...a
385
386
  },
386
- children: r ?? /* @__PURE__ */ v(A, {})
387
+ children: n ?? /* @__PURE__ */ y(j, {})
387
388
  }, t);
388
389
  }
389
- var M = e(O, "SortableList");
390
- M.Item = e(k, "SortableList.Item"), M.Handle = e(j, "SortableList.Handle");
390
+ var N = e(k, "SortableList");
391
+ N.Item = e(A, "SortableList.Item"), N.Handle = e(M, "SortableList.Handle");
391
392
  //#endregion
392
- export { b as SortableUtils, M as default };
393
+ export { x as SortableUtils, N as default };
@@ -1 +1 @@
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("../reporting.cjs"),o=require("../motion.cjs"),s=require("./list.cjs");let c=require("react"),l=require("react/jsx-runtime");var u;(function(e){let t=e.SLOP=8,n=e.FLICK=.4,r=e.FULL_RATIO=.6;function i(e,n){return Math.max(Math.abs(e),Math.abs(n))<t?null:Math.abs(e)>Math.abs(n)?`swipe`:`scroll`}e.intent=i;function a(e,t){return(1-1/(e*.55/t+1))*t}function o(e,t,n,r,i){let o=e+t,s=o<0?-1:1,c=o<0?n.end:n.start,l=Math.abs(o);return c===0?0:l<=c?o:i?s*Math.min(l,r):s*(c+a(l-c,Math.max(r,1)))}e.offsetFor=o;function s(e,n,i,a){if(!a||e===0)return null;let o=e>0?`start`:`end`,s=n[o];return s===0?null:Math.abs(e)>=Math.max(s+t*4,i*r)?o:null}e.armed=s;function c(e,t,r,i,a){let o=s(e,r,i,a);if(o)return{open:null,full:o};if(e===0)return{open:null,full:null};let c=e>0?`start`:`end`,l=r[c];return l===0?{open:null,full:null}:Math.abs(t)>=n?{open:Math.sign(t)===Math.sign(e)?c:null,full:null}:{open:Math.abs(e)>=l/2?c:null,full:null}}e.settle=c;let l=e.VELOCITY_WINDOW=100;function u(e,t){return[...e.filter(e=>t.t-e.t<=l),t]}e.track=u;function d(e){let t=e[0],n=e[e.length-1];return!t||!n||n.t-t.t<16?0:(n.x-t.x)/(n.t-t.t)}e.velocity=d;function f(e,t){return e===`start`?t.start:e===`end`?-t.end:0}e.restOffset=f})(u||={});var d=u,f=(0,c.createContext)(null),p={start:0,end:0};function m(e,u){let{size:m=`md`,wrap:h=!1,selected:g=!1,chevron:_=!1,startActions:v,endActions:y,fullSwipe:b=!1,open:ne,defaultOpen:x=null,onOpenChange:S,variant:C,children:w,props:T,...re}=e,E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(!1),[j,M]=a.a({value:ne,defaultValue:x,onChange:S,interaction:{component:`swipeItem`,type:`openChange`}}),[N,P]=(0,c.useState)(null),[F,I]=(0,c.useState)(null),[L,ie]=(0,c.useState)({trays:p,width:0,rtl:!1}),R=i.o(L),z=(0,c.useCallback)(e=>{E.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[u]),B=i.a(()=>{let e=e=>e?.firstElementChild?.offsetWidth??0,n={trays:{start:v?e(D.current):0,end:y?e(O.current):0},width:E.current?.offsetWidth??0,rtl:t.p(E.current)},r=R.current;return(r.trays.start!==n.trays.start||r.trays.end!==n.trays.end||r.width!==n.width||r.rtl!==n.rtl)&&ie(n),n});n.n(()=>{j&&B()},[j,B]);let V=i.a(e=>M(null,e)),H=a.i(`swipeItem`);(0,c.useEffect)(()=>{let e=t.t();if(!j||!e)return;let n=e=>{t.f(e,[E])||V({reason:`outside-pointer`,event:e})};return e.addEventListener(`pointerdown`,n,!0),()=>e.removeEventListener(`pointerdown`,n,!0)},[j,V]),(0,c.useEffect)(()=>{if(!F)return;let e=(F===`start`?D:O).current,t=E.current?.firstElementChild,n=t&&typeof getComputedStyle==`function`?o.n.activeDuration(getComputedStyle(t)):0,r=setTimeout(()=>{I(null),e?.querySelector(`[data-swipe-action]`)?.click()},n+o.n.SETTLE_FRAME);return()=>clearTimeout(r)},[F]);let U=i.a(e=>{if(A.current=!1,e.button!==0||F||!v&&!y)return;let{trays:t}=B();k.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY,rest:d.restOffset(j,t),intent:null,samples:[{t:e.timeStamp,x:e.clientX}]}}),W=i.a(e=>{let n=k.current;if(!n||n.pointerId!==e.pointerId||n.intent===`scroll`)return;let r=e.clientX-n.x;if(!n.intent){if(n.intent=d.intent(r,e.clientY-n.y),n.intent!==`swipe`)return;e.currentTarget.setPointerCapture?.(e.pointerId),t.l(e.currentTarget)}let{trays:i,width:a,rtl:o}=R.current;n.samples=d.track(n.samples,{t:e.timeStamp,x:e.clientX}),P(d.offsetFor(n.rest,o?-r:r,i,a,b))}),G=i.a(e=>{let t=k.current;if(!t||t.pointerId!==e.pointerId||(k.current=null,t.intent!==`swipe`||N===null))return;e.currentTarget.releasePointerCapture?.(e.pointerId),A.current=!0;let{trays:n,width:r,rtl:i}=R.current,a=d.velocity(t.samples)*(i?-1:1),o=e.type===`pointercancel`?{open:j,full:null}:d.settle(N,a,n,r,b);P(null),o.full?(I(o.full),H(`fullSwipe`,o.full,{reason:`swipe`,event:e}),M(null,{reason:`swipe`,event:e})):M(o.open,{reason:`swipe`,event:e})}),K=i.a(e=>{if(A.current){A.current=!1,e.preventDefault(),e.stopPropagation();return}j&&(e.preventDefault(),e.stopPropagation(),V({reason:`outside-pointer`,event:e}))}),q=i.a(e=>{let t=D.current?.contains(e.target)?`start`:O.current?.contains(e.target)?`end`:null;t&&t!==j&&(B(),M(t,{reason:`focus`,event:e}))}),J=i.a(e=>{let t=e.relatedTarget;j&&(!t||!E.current?.contains(t))&&V({reason:`focus`,event:e})}),ae=i.a(e=>{e.key!==`Escape`||!j||e.defaultPrevented||(e.preventDefault(),V({reason:`escape`,event:e}),E.current?.querySelector(`[data-list-action]`)?.focus())}),{trays:Y,width:X,rtl:oe}=L,Z=N??(F?F===`start`?X:-X:d.restOffset(j,Y)),se=N===null?F:d.armed(N,Y,X,b),Q=N!==null,$=(e,t)=>(0,l.jsx)(te,{side:e,trayRef:e===`start`?D:O,width:e===`start`?Math.max(0,Z):Math.max(0,-Z),dragging:Q,children:(0,l.jsx)(f.Provider,{value:{side:e,armed:se===e,close:V},children:t})});return r.useBoxElement({tag:`li`,component:`list.item`,...s.i({...s.t,css:{...s.t.css,overflow:`clip`}},re),variant:[C,{selected:g}],props:{...T,onFocus:q,onBlur:J,onKeyDown:ae},children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ee,{size:m,wrap:h,dragging:Q,translate:Z===0?void 0:`${Math.round(oe?-Z:Z)}px`,handlers:{onPointerDown:U,onPointerMove:W,onPointerUp:G,onPointerCancel:G,onClickCapture:K,onDragStart:e=>e.preventDefault()},children:[w,_&&(0,l.jsx)(s.default.Chevron,{})]}),v?$(`start`,v):null,y?$(`end`,y):null]})},z)}function ee({size:e,wrap:t,dragging:n,translate:i,handlers:a,children:o}){return r.useBoxElement({component:`swipeItem.row`,...s.n,...s.r[e],...t?{flexWrap:`wrap`}:{},position:`relative`,css:{touchAction:`pan-y`},variant:{dragging:n},style:i?{translate:i}:void 0,props:a,children:o})}function te({side:e,trayRef:t,width:n,dragging:i,children:a}){let o=r.useBoxElement({display:`flex`,d:e===`end`?`row-reverse`:`row`,position:`absolute`,top:0,bottom:0,...e===`start`?{insetStart:0}:{insetEnd:0},minWidth:`fit`,css:{width:`max-content`},children:a});return r.useBoxElement({component:`swipeItem.tray`,position:`absolute`,top:0,bottom:0,...e===`start`?{insetStart:0}:{insetEnd:0},overflow:`hidden`,variant:{dragging:i},style:{width:`${Math.round(n)}px`},children:o},t)}function h(e,t){let{icon:n,onClick:i,closeOnSelect:a=!0,variant:o,children:s,props:u,...d}=e,p=(0,c.useContext)(f),m=e=>{i?.(e),a&&!e.defaultPrevented&&p?.close({reason:`action`,event:e})};return r.useBoxElement({tag:`button`,component:`swipeItem.action`,display:`flex`,d:`column`,ai:`center`,jc:`center`,gap:1,px:4,minWidth:18,flexGrow:1,flexShrink:0,fontSize:14,lineHeight:18,fontWeight:500,cursor:`pointer`,...d,variant:[o,{armed:p?.armed??!1}],props:{type:`button`,"data-swipe-action":``,...u,onClick:m},children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g,{children:n}),s]}):s},t)}function g({children:e}){return r.useBoxElement({tag:`span`,display:`flex`,props:{"aria-hidden":!0},children:e})}var _=e.f(m,`SwipeItem`);_.Action=e.f(h,`SwipeItem.Action`),exports.SwipeUtils=d,exports.default=_;
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("../reporting.cjs"),o=require("../motion.cjs"),s=require("./list.cjs");let c=require("react"),l=require("react/jsx-runtime");var u;(function(e){let t=e.SLOP=8,n=e.FLICK=.4,r=e.FULL_RATIO=.6;function i(e,n){return Math.max(Math.abs(e),Math.abs(n))<t?null:Math.abs(e)>Math.abs(n)?`swipe`:`scroll`}e.intent=i;function a(e,t){return(1-1/(e*.55/t+1))*t}function o(e,t,n,r,i){let o=e+t,s=o<0?-1:1,c=o<0?n.end:n.start,l=Math.abs(o);return c===0?0:l<=c?o:i?s*Math.min(l,r):s*(c+a(l-c,Math.max(r,1)))}e.offsetFor=o;function s(e,n,i,a){if(!a||e===0)return null;let o=e>0?`start`:`end`,s=n[o];return s===0?null:Math.abs(e)>=Math.max(s+t*4,i*r)?o:null}e.armed=s;function c(e,t,r,i,a){let o=s(e,r,i,a);if(o)return{open:null,full:o};if(e===0)return{open:null,full:null};let c=e>0?`start`:`end`,l=r[c];return l===0?{open:null,full:null}:Math.abs(t)>=n?{open:Math.sign(t)===Math.sign(e)?c:null,full:null}:{open:Math.abs(e)>=l/2?c:null,full:null}}e.settle=c;let l=e.VELOCITY_WINDOW=100;function u(e,t){return[...e.filter(e=>t.t-e.t<=l),t]}e.track=u;function d(e){let t=e[0],n=e[e.length-1];return!t||!n||n.t-t.t<16?0:(n.x-t.x)/(n.t-t.t)}e.velocity=d;function f(e,t){return e===`start`?t.start:e===`end`?-t.end:0}e.restOffset=f})(u||={});var d=u,f=(0,c.createContext)(null),p={start:0,end:0};function m(e,u){let{size:m=`md`,wrap:h=!1,selected:g=!1,chevron:_=!1,startActions:v,endActions:y,fullSwipe:b=!1,open:ne,defaultOpen:x=null,onOpenChange:S,variant:C,children:w,props:T,...re}=e,E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(!1),[j,M]=a.a({value:ne,defaultValue:x,onChange:S,interaction:{component:`swipeItem`,type:`openChange`}}),[N,P]=(0,c.useState)(null),[F,I]=(0,c.useState)(null),[L,ie]=(0,c.useState)({trays:p,width:0,rtl:!1}),R=i.o(L),z=(0,c.useCallback)(e=>{E.current=e,t.l(u,e)},[u]),B=i.a(()=>{let e=e=>e?.firstElementChild?.offsetWidth??0,n={trays:{start:v?e(D.current):0,end:y?e(O.current):0},width:E.current?.offsetWidth??0,rtl:t.m(E.current)},r=R.current;return(r.trays.start!==n.trays.start||r.trays.end!==n.trays.end||r.width!==n.width||r.rtl!==n.rtl)&&ie(n),n});n.n(()=>{j&&B()},[j,B]);let V=i.a(e=>M(null,e)),H=a.i(`swipeItem`);(0,c.useEffect)(()=>{let e=t.t();if(!j||!e)return;let n=e=>{t.p(e,[E])||V({reason:`outside-pointer`,event:e})};return e.addEventListener(`pointerdown`,n,!0),()=>e.removeEventListener(`pointerdown`,n,!0)},[j,V]),(0,c.useEffect)(()=>{if(!F)return;let e=(F===`start`?D:O).current,t=E.current?.firstElementChild,n=t&&typeof getComputedStyle==`function`?o.i.activeDuration(getComputedStyle(t)):0,r=setTimeout(()=>{I(null),e?.querySelector(`[data-swipe-action]`)?.click()},n+o.i.SETTLE_FRAME);return()=>clearTimeout(r)},[F]);let U=i.a(e=>{if(A.current=!1,e.button!==0||F||!v&&!y)return;let{trays:t}=B();k.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY,rest:d.restOffset(j,t),intent:null,samples:[{t:e.timeStamp,x:e.clientX}]}}),W=i.a(e=>{let n=k.current;if(!n||n.pointerId!==e.pointerId||n.intent===`scroll`)return;let r=e.clientX-n.x;if(!n.intent){if(n.intent=d.intent(r,e.clientY-n.y),n.intent!==`swipe`)return;e.currentTarget.setPointerCapture?.(e.pointerId),t.u(e.currentTarget)}let{trays:i,width:a,rtl:o}=R.current;n.samples=d.track(n.samples,{t:e.timeStamp,x:e.clientX}),P(d.offsetFor(n.rest,o?-r:r,i,a,b))}),G=i.a(e=>{let t=k.current;if(!t||t.pointerId!==e.pointerId||(k.current=null,t.intent!==`swipe`||N===null))return;e.currentTarget.releasePointerCapture?.(e.pointerId),A.current=!0;let{trays:n,width:r,rtl:i}=R.current,a=d.velocity(t.samples)*(i?-1:1),o=e.type===`pointercancel`?{open:j,full:null}:d.settle(N,a,n,r,b);P(null),o.full?(I(o.full),H(`fullSwipe`,o.full,{reason:`swipe`,event:e}),M(null,{reason:`swipe`,event:e})):M(o.open,{reason:`swipe`,event:e})}),K=i.a(e=>{if(A.current){A.current=!1,e.preventDefault(),e.stopPropagation();return}j&&(e.preventDefault(),e.stopPropagation(),V({reason:`outside-pointer`,event:e}))}),q=i.a(e=>{let t=D.current?.contains(e.target)?`start`:O.current?.contains(e.target)?`end`:null;t&&t!==j&&(B(),M(t,{reason:`focus`,event:e}))}),J=i.a(e=>{let t=e.relatedTarget;j&&(!t||!E.current?.contains(t))&&V({reason:`focus`,event:e})}),ae=i.a(e=>{e.key!==`Escape`||!j||e.defaultPrevented||(e.preventDefault(),V({reason:`escape`,event:e}),E.current?.querySelector(`[data-list-action]`)?.focus())}),{trays:Y,width:X,rtl:oe}=L,Z=N??(F?F===`start`?X:-X:d.restOffset(j,Y)),se=N===null?F:d.armed(N,Y,X,b),Q=N!==null,$=(e,t)=>(0,l.jsx)(te,{side:e,trayRef:e===`start`?D:O,width:e===`start`?Math.max(0,Z):Math.max(0,-Z),dragging:Q,children:(0,l.jsx)(f.Provider,{value:{side:e,armed:se===e,close:V},children:t})});return r.useBoxElement({tag:`li`,component:`list.item`,...s.i({...s.t,css:{...s.t.css,overflow:`clip`}},re),variant:[C,{selected:g}],props:{...T,onFocus:q,onBlur:J,onKeyDown:ae},children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ee,{size:m,wrap:h,dragging:Q,translate:Z===0?void 0:`${Math.round(oe?-Z:Z)}px`,handlers:{onPointerDown:U,onPointerMove:W,onPointerUp:G,onPointerCancel:G,onClickCapture:K,onDragStart:e=>e.preventDefault()},children:[w,_&&(0,l.jsx)(s.default.Chevron,{})]}),v?$(`start`,v):null,y?$(`end`,y):null]})},z)}function ee({size:e,wrap:t,dragging:n,translate:i,handlers:a,children:o}){return r.useBoxElement({component:`swipeItem.row`,...s.n,...s.r[e],...t?{flexWrap:`wrap`}:{},position:`relative`,css:{touchAction:`pan-y`},variant:{dragging:n},style:i?{translate:i}:void 0,props:a,children:o})}function te({side:e,trayRef:t,width:n,dragging:i,children:a}){let o=r.useBoxElement({display:`flex`,d:e===`end`?`row-reverse`:`row`,position:`absolute`,top:0,bottom:0,...e===`start`?{insetStart:0}:{insetEnd:0},minWidth:`fit`,css:{width:`max-content`},children:a});return r.useBoxElement({component:`swipeItem.tray`,position:`absolute`,top:0,bottom:0,...e===`start`?{insetStart:0}:{insetEnd:0},overflow:`hidden`,variant:{dragging:i},style:{width:`${Math.round(n)}px`},children:o},t)}function h(e,t){let{icon:n,onClick:i,closeOnSelect:a=!0,variant:o,children:s,props:u,...d}=e,p=(0,c.useContext)(f),m=e=>{i?.(e),a&&!e.defaultPrevented&&p?.close({reason:`action`,event:e})};return r.useBoxElement({tag:`button`,component:`swipeItem.action`,display:`flex`,d:`column`,ai:`center`,jc:`center`,gap:1,px:4,minWidth:18,flexGrow:1,flexShrink:0,fontSize:14,lineHeight:18,fontWeight:500,cursor:`pointer`,...d,variant:[o,{armed:p?.armed??!1}],props:{type:`button`,"data-swipe-action":``,...u,onClick:m},children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g,{children:n}),s]}):s},t)}function g({children:e}){return r.useBoxElement({tag:`span`,display:`flex`,props:{"aria-hidden":!0},children:e})}var _=e.f(m,`SwipeItem`);_.Action=e.f(h,`SwipeItem.Action`),exports.SwipeUtils=d,exports.default=_;