@brett_lamy/ui 5.10.0 → 5.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/components/avatar.d.ts +4 -1
  2. package/dist/components/avatar.d.ts.map +1 -1
  3. package/dist/components/avatar.js +55 -47
  4. package/dist/components/canvas.d.ts +18 -0
  5. package/dist/components/canvas.d.ts.map +1 -1
  6. package/dist/components/canvas.js +79 -11
  7. package/dist/components/command-menu.js +1 -1
  8. package/dist/components/floating-chat.d.ts +1 -1
  9. package/dist/components/floating-sheet.d.ts +1 -1
  10. package/dist/components/hover-card.d.ts +69 -0
  11. package/dist/components/hover-card.d.ts.map +1 -0
  12. package/dist/components/hover-card.js +164 -0
  13. package/dist/components/list.d.ts +3 -0
  14. package/dist/components/list.d.ts.map +1 -1
  15. package/dist/components/list.js +265 -250
  16. package/dist/components/markdown-view.d.ts +3 -1
  17. package/dist/components/markdown-view.d.ts.map +1 -1
  18. package/dist/components/markdown-view.js +12 -11
  19. package/dist/components/open-code.d.ts +31 -0
  20. package/dist/components/open-code.d.ts.map +1 -0
  21. package/dist/components/open-code.js +253 -0
  22. package/dist/components/replay-preview.d.ts +2 -2
  23. package/dist/components/replay-preview.d.ts.map +1 -1
  24. package/dist/components/replay-preview.js +3 -3
  25. package/dist/components/sql-console.js +1 -1
  26. package/dist/components/tree.d.ts +4 -1
  27. package/dist/components/tree.d.ts.map +1 -1
  28. package/dist/components/tree.js +229 -202
  29. package/dist/components/tui-preview.d.ts +3 -0
  30. package/dist/components/tui-preview.d.ts.map +1 -0
  31. package/dist/components/tui-preview.js +3 -0
  32. package/dist/components/workspace.d.ts +11 -0
  33. package/dist/components/workspace.d.ts.map +1 -0
  34. package/dist/components/workspace.js +74 -0
  35. package/dist/index.css +1 -1
  36. package/dist/index.d.ts +17 -4
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +163 -156
  39. package/dist/lib/canvas-math.d.ts +1 -1
  40. package/dist/lib/canvas-math.d.ts.map +1 -1
  41. package/dist/lib/canvas-math.js +1 -1
  42. package/dist/lib/open-code-browser-agent.d.ts +7 -0
  43. package/dist/lib/open-code-browser-agent.d.ts.map +1 -0
  44. package/dist/lib/open-code-browser-agent.js +161 -0
  45. package/dist/lib/open-code-browser.d.ts +17 -0
  46. package/dist/lib/open-code-browser.d.ts.map +1 -0
  47. package/dist/lib/open-code-browser.js +252 -0
  48. package/dist/lib/open-code-host.d.ts +182 -0
  49. package/dist/lib/open-code-host.d.ts.map +1 -0
  50. package/dist/lib/open-code-host.js +118 -0
  51. package/dist/lib/open-code-keychain.d.ts +11 -0
  52. package/dist/lib/open-code-keychain.d.ts.map +1 -0
  53. package/dist/lib/open-code-keychain.js +19 -0
  54. package/dist/lib/open-code-preview.d.ts +16 -0
  55. package/dist/lib/open-code-preview.d.ts.map +1 -0
  56. package/dist/lib/open-code-preview.js +112 -0
  57. package/dist/lib/tailscale-connect.d.ts.map +1 -1
  58. package/dist/lib/tailscale-connect.js +97 -62
  59. package/dist/lib/tailscale-policy.d.ts +11 -2
  60. package/dist/lib/tailscale-policy.d.ts.map +1 -1
  61. package/dist/lib/tailscale-policy.js +27 -18
  62. package/dist/lib/tailscale-router/bridge.d.ts +7 -2
  63. package/dist/lib/tailscale-router/bridge.d.ts.map +1 -1
  64. package/dist/lib/tailscale-router/bridge.js +64 -57
  65. package/dist/lib/theme.d.ts.map +1 -1
  66. package/dist/lib/theme.js +8 -5
  67. package/dist/opencode.d.ts +7 -0
  68. package/dist/opencode.d.ts.map +1 -0
  69. package/dist/opencode.js +6 -0
  70. package/dist/tailscale-sw.js +237 -12
  71. package/package.json +21 -3
@@ -3,15 +3,16 @@ import { cn as e } from "../lib/utils.js";
3
3
  import { springs as t } from "../lib/motion.js";
4
4
  import { IC as n, Icon as r } from "../lib/icon.js";
5
5
  import { BLStickyCtx as i, chromeOffset as a, useChromeHidden as o } from "../lib/theme.js";
6
- import { RowLabelContext as s } from "../lib/row-label.js";
7
- import { AnimatePresence as c, MotionConfig as l, Reorder as u, animate as d, motion as f, useDragControls as p, useMotionValue as m, useReducedMotion as h, useTransform as ee } from "framer-motion";
8
- import { Children as g, createContext as te, isValidElement as ne, use as _, useEffect as v, useId as re, useLayoutEffect as y, useRef as b, useState as x } from "react";
9
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
10
- import { cva as ie } from "class-variance-authority";
6
+ import { HoverCard as s, useHoverCard as c } from "./hover-card.js";
7
+ import { RowLabelContext as l } from "../lib/row-label.js";
8
+ import { AnimatePresence as u, MotionConfig as d, Reorder as f, animate as p, motion as m, useDragControls as h, useMotionValue as ee, useReducedMotion as te, useTransform as ne } from "framer-motion";
9
+ import { Children as g, createContext as re, isValidElement as _, use as v, useEffect as y, useId as ie, useLayoutEffect as b, useRef as x, useState as S } from "react";
10
+ import { Fragment as ae, jsx as C, jsxs as w } from "react/jsx-runtime";
11
+ import { cva as oe } from "class-variance-authority";
11
12
  //#region src/components/list.tsx
12
13
  function T({ children: t, inset: n, header: r, stickyTop: s, className: c, style: l }) {
13
- let u = b(null), [d, f] = x(0), p = _(i), m = o();
14
- y(() => {
14
+ let u = x(null), [d, f] = S(0), p = v(i), m = o();
15
+ b(() => {
15
16
  let e = u.current;
16
17
  if (!e) {
17
18
  f(0);
@@ -39,9 +40,9 @@ function T({ children: t, inset: n, header: r, stickyTop: s, className: c, style
39
40
  })
40
41
  });
41
42
  }
42
- var ae = te(null);
43
+ var se = re(null);
43
44
  function E({ title: t, footer: n, children: r, sticky: s, innerRef: c, stickyTop: l, animate: u, onReorder: d, className: f, style: p }) {
44
- let m = _(i), h = a(l ?? m, o()), ee = !!(u || d);
45
+ let m = v(i), h = a(l ?? m, o()), ee = !!(u || d);
45
46
  return /* @__PURE__ */ w("div", {
46
47
  ref: c,
47
48
  "data-slot": "list-section",
@@ -72,28 +73,28 @@ function E({ title: t, footer: n, children: r, sticky: s, innerRef: c, stickyTop
72
73
  });
73
74
  }
74
75
  function D({ children: e, onReorder: t }) {
75
- let n = g.toArray(e).filter(ne), r = n.map((e) => String(e.key)), [i, a] = x(null), o = i && i.length === r.length && i.every((e) => r.includes(e)) ? i : r, s = new Map(n.map((e) => [String(e.key), e])), d = h(), f = (e) => {
76
+ let n = g.toArray(e).filter(_), r = n.map((e) => String(e.key)), [i, a] = S(null), o = i && i.length === r.length && i.every((e) => r.includes(e)) ? i : r, s = new Map(n.map((e) => [String(e.key), e])), c = te(), l = (e) => {
76
77
  let n = r.indexOf(e), i = o.indexOf(e);
77
78
  a(null), n >= 0 && i >= 0 && n !== i && t?.(n, i);
78
79
  };
79
- return /* @__PURE__ */ C(l, {
80
+ return /* @__PURE__ */ C(d, {
80
81
  reducedMotion: "user",
81
- children: /* @__PURE__ */ C(u.Group, {
82
+ children: /* @__PURE__ */ C(f.Group, {
82
83
  as: "div",
83
84
  axis: "y",
84
85
  values: o,
85
86
  onReorder: (e) => {
86
87
  e.join() !== o.join() && a(e);
87
88
  },
88
- children: /* @__PURE__ */ C(c, {
89
+ children: /* @__PURE__ */ C(u, {
89
90
  initial: !1,
90
91
  children: o.map((e, n) => /* @__PURE__ */ C(O, {
91
92
  value: e,
92
93
  index: n,
93
94
  count: o.length,
94
- reduced: !!d,
95
+ reduced: !!c,
95
96
  reorder: t ? {
96
- drop: f,
97
+ drop: l,
97
98
  move: (e) => {
98
99
  let i = Math.max(0, Math.min(r.length - 1, e));
99
100
  i !== n && t(n, i);
@@ -106,16 +107,16 @@ function D({ children: e, onReorder: t }) {
106
107
  });
107
108
  }
108
109
  function O({ value: n, index: r, count: i, reduced: a, reorder: o, children: s }) {
109
- let c = p(), [l, d] = x(!1), f = {
110
+ let c = h(), [l, u] = S(!1), d = {
110
111
  index: r,
111
112
  count: i,
112
113
  dragging: l,
113
114
  startDrag: o ? (e) => {
114
- d(!0), c.start(e);
115
+ u(!0), c.start(e);
115
116
  } : void 0,
116
117
  move: o?.move
117
118
  };
118
- return /* @__PURE__ */ C(u.Item, {
119
+ return /* @__PURE__ */ C(f.Item, {
119
120
  as: "div",
120
121
  value: n,
121
122
  dragListener: !1,
@@ -143,15 +144,15 @@ function O({ value: n, index: r, count: i, reduced: a, reorder: o, children: s }
143
144
  opacity: { duration: .18 }
144
145
  },
145
146
  onDragEnd: () => {
146
- d(!1), o?.drop(n);
147
+ u(!1), o?.drop(n);
147
148
  },
148
- children: /* @__PURE__ */ C(ae.Provider, {
149
- value: f,
149
+ children: /* @__PURE__ */ C(se.Provider, {
150
+ value: d,
150
151
  children: s
151
152
  })
152
153
  });
153
154
  }
154
- var k = /* @__PURE__ */ new Set(), A = ie([
155
+ var k = /* @__PURE__ */ new Set(), ce = oe([
155
156
  "relative box-border flex min-h-row w-full touch-pan-y items-center gap-3 py-0 pl-4 text-left text-body leading-[normal] tracking-[normal] outline-none",
156
157
  "focus-visible:[box-shadow:inset_0_0_0_2px_var(--primary)]",
157
158
  "pr-[max(16px,calc(var(--bl-index-bar-inset,0px)+6px))]"
@@ -180,66 +181,66 @@ var k = /* @__PURE__ */ new Set(), A = ie([
180
181
  destructive: !1,
181
182
  interactive: !1
182
183
  }
183
- }), oe = .55, j = (e) => e.icon ? 74 : 88, se = "button,input,select,textarea,a[href],label,[role=switch],[role=slider],[role=checkbox],[data-slot=slider]";
184
- function ce({ icon: e }) {
184
+ }), le = .55, A = (e) => e.icon ? 74 : 88, ue = "button,input,select,textarea,a[href],label,[role=switch],[role=slider],[role=checkbox],[data-slot=slider]";
185
+ function de({ icon: e }) {
185
186
  return typeof e == "string" ? n[e] ? /* @__PURE__ */ C(r, {
186
187
  name: e,
187
188
  size: 20,
188
189
  sw: 2.2
189
- }) : null : /* @__PURE__ */ C(S, { children: e });
190
+ }) : null : /* @__PURE__ */ C(ae, { children: e });
190
191
  }
191
- function M(n) {
192
- let i = _(ae), a = !!h(), o = re(), c = o + "-t", l = o + "-s", u = o + "-h", p = m(0), [g, te] = x(null), [ne, y] = x(!1), [S, ie] = x(!1), [T, E] = x(null), D = b(null), O = b(null), M = b(null), N = b(null), P = b(null), F = b(null), I = b(() => void 0), L = b(!1), R = b(!1), z = [...n.onDelete ? [{
192
+ function j(n) {
193
+ let i = v(se), a = !!te(), o = ie(), u = o + "-t", d = o + "-s", f = o + "-h", h = ee(0), [g, re] = S(null), [_, b] = S(!1), [ae, oe] = S(!1), [T, E] = S(null), D = x(null), O = x(null), j = x(null), M = x(null), N = x(null), P = x(null), F = x(() => void 0), I = x(!1), L = x(!1), R = c({ isDisabled: !n.preview }), z = [...n.onDelete ? [{
193
194
  label: "Delete",
194
195
  destructive: !0,
195
196
  onAction: n.onDelete
196
- }] : [], ...n.trailingActions || []], B = n.leadingActions || [], V = (e) => e === "leading" ? B : z, H = (e) => V(e).reduce((e, t) => e + j(t), 0), U = (e) => n.fullSwipe === void 0 || n.fullSwipe === !0 || n.fullSwipe === e, W = !n.edit && (B.length > 0 || z.length > 0);
197
- v(() => p.on("change", (e) => {
197
+ }] : [], ...n.trailingActions || []], B = n.leadingActions || [], V = (e) => e === "leading" ? B : z, H = (e) => V(e).reduce((e, t) => e + A(t), 0), U = (e) => n.fullSwipe === void 0 || n.fullSwipe === !0 || n.fullSwipe === e, W = !n.edit && (B.length > 0 || z.length > 0);
198
+ y(() => h.on("change", (e) => {
198
199
  let t = e > .5 ? "leading" : e < -.5 ? "trailing" : null;
199
- te((e) => e === t ? e : t);
200
- }), [p]);
201
- let G = (e, n = 0) => (F.current?.stop(), F.current = d(p, e, a ? { duration: 0 } : {
200
+ re((e) => e === t ? e : t);
201
+ }), [h]);
202
+ let G = (e, n = 0) => (P.current?.stop(), P.current = p(h, e, a ? { duration: 0 } : {
202
203
  ...t.snappy,
203
204
  velocity: n
204
- }), F.current), K = () => {
205
- y(!1), G(0);
205
+ }), P.current), K = () => {
206
+ b(!1), G(0);
206
207
  };
207
- v(() => {
208
- I.current = () => {
209
- p.get() !== 0 && K();
208
+ y(() => {
209
+ F.current = () => {
210
+ h.get() !== 0 && K();
210
211
  };
211
- let e = () => I.current();
212
+ let e = () => F.current();
212
213
  return k.add(e), () => {
213
214
  k.delete(e);
214
215
  };
215
- }), v(() => {
216
+ }), y(() => {
216
217
  n.onPress || (O.current = D.current);
217
218
  });
218
- let le = () => k.forEach((e) => {
219
- e !== I.current && e();
219
+ let fe = () => k.forEach((e) => {
220
+ e !== F.current && e();
220
221
  }), q = (e, t) => {
221
222
  let n = D.current ? D.current.offsetWidth : 320;
222
- t.destructive ? (y(!0), G(e === "trailing" ? -n : n), E(N.current ? N.current.offsetHeight : null), requestAnimationFrame(() => requestAnimationFrame(() => ie(!0))), setTimeout(() => t.onAction(), a ? 0 : 460)) : (t.onAction(), y(!1), G(0), O.current?.focus({ preventScroll: !0 }));
223
- }, ue = (e) => {
224
- !W || e.button || n.isEdge && n.isEdge(e.clientX) || e.target.closest("[data-row-control],[data-row-action],[data-row-grip]") || (F.current?.stop(), P.current = {
223
+ t.destructive ? (b(!0), G(e === "trailing" ? -n : n), E(M.current ? M.current.offsetHeight : null), requestAnimationFrame(() => requestAnimationFrame(() => oe(!0))), setTimeout(() => t.onAction(), a ? 0 : 460)) : (t.onAction(), b(!1), G(0), O.current?.focus({ preventScroll: !0 }));
224
+ }, pe = (e) => {
225
+ !W || e.button || n.isEdge && n.isEdge(e.clientX) || e.target.closest("[data-row-control],[data-row-action],[data-row-grip]") || (P.current?.stop(), N.current = {
225
226
  x0: e.clientX,
226
227
  y0: e.clientY,
227
- base: p.get(),
228
+ base: h.get(),
228
229
  on: !1,
229
230
  fired: !1
230
231
  });
231
- }, de = (e) => {
232
- let t = P.current;
232
+ }, me = (e) => {
233
+ let t = N.current;
233
234
  if (!t || !D.current) return;
234
235
  let n = e.clientX - t.x0, r = e.clientY - t.y0;
235
236
  if (!t.on) {
236
237
  if (Math.abs(n) > 10 && Math.abs(n) > Math.abs(r) * 1.4) {
237
- t.on = !0, le(), D.current.dataset.swiping = "";
238
+ t.on = !0, fe(), D.current.dataset.swiping = "";
238
239
  try {
239
240
  D.current.setPointerCapture(e.pointerId);
240
241
  } catch {}
241
242
  } else if (Math.abs(r) > 12) {
242
- P.current = null;
243
+ N.current = null;
243
244
  return;
244
245
  } else return;
245
246
  }
@@ -247,245 +248,259 @@ function M(n) {
247
248
  if (o && !V(o).length && (a = 0), o && V(o).length) {
248
249
  let e = H(o), n = Math.abs(a), r = Math.sign(a), s = U(o) ? Math.min(n, i * .92) : n <= e ? n : e + (n - e) * .25;
249
250
  a = r * s;
250
- let c = U(o) && s > i * oe;
251
- t.fired = c, y(c);
251
+ let c = U(o) && s > i * le;
252
+ t.fired = c, b(c);
252
253
  }
253
- p.set(a);
254
- }, fe = () => {
255
- let e = P.current;
256
- if (P.current = null, !e || !e.on || !D.current) return;
257
- delete D.current.dataset.swiping, L.current = !0, setTimeout(() => {
258
- L.current = !1;
254
+ h.set(a);
255
+ }, he = () => {
256
+ let e = N.current;
257
+ if (N.current = null, !e || !e.on || !D.current) return;
258
+ delete D.current.dataset.swiping, I.current = !0, setTimeout(() => {
259
+ I.current = !1;
259
260
  }, 0);
260
- let t = D.current.offsetWidth, n = p.get(), r = p.getVelocity(), i = n > 0 ? "leading" : n < 0 ? "trailing" : null;
261
+ let t = D.current.offsetWidth, n = h.get(), r = h.getVelocity(), i = n > 0 ? "leading" : n < 0 ? "trailing" : null;
261
262
  if (!i || !V(i).length) {
262
263
  K();
263
264
  return;
264
265
  }
265
266
  let a = n + r * .12, o = i === "leading" ? 1 : -1, s = a * o;
266
- if (U(i) && e.fired && Math.abs(n) > t * oe) {
267
+ if (U(i) && e.fired && Math.abs(n) > t * le) {
267
268
  q(i, V(i)[0]);
268
269
  return;
269
270
  }
270
- y(!1), s > H(i) / 2 ? G(o * H(i), r) : G(0, r);
271
- }, pe = (e) => V(e).length ? (le(), y(!1), G((e === "leading" ? 1 : -1) * H(e)), R.current = !0, !0) : !1, me = (e) => {
271
+ b(!1), s > H(i) / 2 ? G(o * H(i), r) : G(0, r);
272
+ }, ge = (e) => V(e).length ? (fe(), b(!1), G((e === "leading" ? 1 : -1) * H(e)), L.current = !0, !0) : !1, _e = (e) => {
272
273
  if (W) {
273
- if (e.key === "ArrowRight" && pe("trailing")) e.preventDefault();
274
- else if (e.key === "ArrowLeft" && pe("leading")) e.preventDefault();
275
- else if (e.key === "Escape" && p.get() !== 0) K(), e.stopPropagation();
274
+ if (e.key === "ArrowRight" && ge("trailing")) e.preventDefault();
275
+ else if (e.key === "ArrowLeft" && ge("leading")) e.preventDefault();
276
+ else if (e.key === "Escape" && h.get() !== 0) K(), e.stopPropagation();
276
277
  else if ((e.key === "Delete" || e.key === "Backspace") && e.target === e.currentTarget) {
277
278
  let t = z.find((e) => e.destructive);
278
279
  t && (e.preventDefault(), q("trailing", t));
279
280
  }
280
281
  }
281
- }, he = (e) => {
282
+ }, ve = (e) => {
282
283
  e.key === "Escape" && (e.stopPropagation(), K(), O.current?.focus({ preventScroll: !0 }));
283
- }, ge = (e) => {
284
- if (L.current) {
284
+ }, ye = (e) => {
285
+ if (I.current) {
285
286
  e.stopPropagation(), e.preventDefault();
286
287
  return;
287
288
  }
288
- p.get() !== 0 && !e.target.closest("[data-row-action]") && (e.stopPropagation(), e.preventDefault(), K());
289
- }, _e = (e) => {
290
- n.onPress || n.labelToggles === !1 || e.target.closest(se) || D.current?.querySelector("[data-row-control] input[type=checkbox], [data-row-control] [role=switch]")?.click();
289
+ h.get() !== 0 && !e.target.closest("[data-row-action]") && (e.stopPropagation(), e.preventDefault(), K());
290
+ }, be = (e) => {
291
+ n.onPress || n.labelToggles === !1 || e.target.closest(ue) || D.current?.querySelector("[data-row-control] input[type=checkbox], [data-row-control] [role=switch]")?.click();
291
292
  };
292
- v(() => {
293
- !g || !R.current || (R.current = !1, M.current?.querySelector("button")?.focus({ preventScroll: !0 }));
293
+ y(() => {
294
+ !g || !L.current || (L.current = !1, j.current?.querySelector("button")?.focus({ preventScroll: !0 }));
294
295
  }, [g]);
295
- let ve = ee(p, (e) => Math.abs(e)), ye = n.edit !== void 0 && n.edit !== null, J = n.accessory != null && n.accessory !== "chevron" && n.accessory !== "check" ? n.accessory : null, Y = !!n.onPress, X = n.children != null && n.children !== !1, be = !X && n.title != null, xe = [...B, ...z], Z = Y || W && xe.length > 0, Q = W ? `Actions: ${xe.map((e) => e.label).join(", ")}. ${[z.length && "Right arrow", B.length && "left arrow"].filter(Boolean).join(" or ")} to reveal.` : null, $ = g ? V(g).map((e, t) => ({
296
+ let xe = ne(h, (e) => Math.abs(e)), Se = n.edit !== void 0 && n.edit !== null, J = n.accessory != null && n.accessory !== "chevron" && n.accessory !== "check" ? n.accessory : null, Y = !!n.onPress, X = n.children != null && n.children !== !1, Ce = !X && n.title != null, we = [...B, ...z], Z = Y || W && we.length > 0, Q = W ? `Actions: ${we.map((e) => e.label).join(", ")}. ${[z.length && "Right arrow", B.length && "left arrow"].filter(Boolean).join(" or ")} to reveal.` : null, $ = g ? V(g).map((e, t) => ({
296
297
  a: e,
297
298
  i: t
298
299
  })) : [];
299
300
  return g === "trailing" && $.reverse(), /* @__PURE__ */ w("div", {
300
301
  "data-slot": "list-row",
301
- ref: N,
302
- className: e("relative overflow-hidden transition-[height,opacity] duration-spring-tray ease-spring-tray motion-reduce:transition-none", S ? "h-0 opacity-0" : e("opacity-100", T != null && "h-(--list-row-h)"), n.className),
302
+ ref: M,
303
+ className: e("relative overflow-hidden transition-[height,opacity] duration-spring-tray ease-spring-tray motion-reduce:transition-none", ae ? "h-0 opacity-0" : e("opacity-100", T != null && "h-(--list-row-h)"), n.className),
303
304
  style: T == null ? n.style : {
304
305
  "--list-row-h": T + "px",
305
306
  ...n.style
306
307
  },
307
- children: [g && $.length ? /* @__PURE__ */ C(f.div, {
308
- ref: M,
309
- "data-slot": "list-row-actions",
310
- onKeyDown: he,
311
- className: e("absolute inset-y-0 flex overflow-hidden", g === "leading" ? "left-0" : "right-0"),
312
- style: { width: ve },
313
- children: $.map(({ a: t, i: n }) => /* @__PURE__ */ C("button", {
314
- type: "button",
315
- "data-row-action": !0,
316
- tabIndex: 0,
317
- onClick: (e) => {
318
- e.stopPropagation(), q(g, t);
319
- },
320
- "aria-label": t.label,
321
- className: e("bl-btn relative flex min-w-0 shrink basis-0 cursor-pointer overflow-hidden border-0 p-0 [font-family:inherit] text-white outline-none focus-visible:[box-shadow:inset_0_0_0_2px_white]", "grow-(--action-grow) bg-(--action-bg) transition-[flex-grow] duration-spring-snappy ease-spring-snappy motion-reduce:transition-none", g === "leading" ? "justify-end" : "justify-start"),
322
- style: {
323
- "--action-bg": t.tint || (t.destructive ? "var(--destructive)" : "var(--primary)"),
324
- "--action-grow": ne ? +(n === 0) : j(t),
325
- "--action-w": j(t) + "px"
326
- },
327
- children: /* @__PURE__ */ w("span", {
328
- className: "flex h-full w-(--action-w) shrink-0 flex-col items-center justify-center gap-[3px] px-2",
329
- children: [t.icon ? /* @__PURE__ */ C(ce, { icon: t.icon }) : null, /* @__PURE__ */ C("span", {
330
- className: e("truncate font-semibold", t.icon ? "text-caption" : "text-subhead"),
331
- children: t.label
332
- })]
333
- })
334
- }, t.label + n))
335
- }) : null, /* @__PURE__ */ w(f.div, {
336
- ref: D,
337
- "data-slot": "list-row-content",
338
- "data-tkrow": !Y && Z ? "" : void 0,
339
- tabIndex: !Y && Z ? 0 : void 0,
340
- role: !Y && Z ? "group" : void 0,
341
- "aria-labelledby": !Y && Z ? c : void 0,
342
- "aria-describedby": !Y && Q ? u : void 0,
343
- "aria-keyshortcuts": !Y && Q ? "ArrowRight ArrowLeft Delete" : void 0,
344
- onKeyDown: Y ? void 0 : me,
345
- onPointerDown: ue,
346
- onPointerMove: de,
347
- onPointerUp: fe,
348
- onPointerCancel: fe,
349
- onClickCapture: ge,
350
- onClick: _e,
351
- "aria-current": !Y && Z && n.selected ? "true" : void 0,
352
- className: e(A({
353
- align: n.align,
354
- selected: !!n.selected,
355
- destructive: !!n.destructive,
356
- interactive: Y || W || !!J && n.labelToggles !== !1
357
- }), n.contentClassName),
358
- style: { x: p },
359
- children: [
360
- Y ? /* @__PURE__ */ C("button", {
361
- ref: (e) => {
362
- O.current = e;
363
- },
364
- "data-tkrow": !0,
308
+ onPointerEnter: R.triggerProps.onPointerEnter,
309
+ onPointerLeave: R.triggerProps.onPointerLeave,
310
+ onPointerDownCapture: R.triggerProps.onPointerDown,
311
+ onFocus: R.triggerProps.onFocus,
312
+ onBlur: R.triggerProps.onBlur,
313
+ children: [
314
+ n.preview ? /* @__PURE__ */ C(s, {
315
+ ...R.cardProps,
316
+ triggerRef: M,
317
+ placement: "end top",
318
+ children: n.preview
319
+ }) : null,
320
+ g && $.length ? /* @__PURE__ */ C(m.div, {
321
+ ref: j,
322
+ "data-slot": "list-row-actions",
323
+ onKeyDown: ve,
324
+ className: e("absolute inset-y-0 flex overflow-hidden", g === "leading" ? "left-0" : "right-0"),
325
+ style: { width: xe },
326
+ children: $.map(({ a: t, i: n }) => /* @__PURE__ */ C("button", {
365
327
  type: "button",
366
- role: n.rowRole,
367
- "aria-selected": n.rowRole ? n.selected || n.checked || !1 : void 0,
368
- "aria-current": !n.rowRole && n.selected ? "true" : void 0,
369
- "aria-labelledby": n.subtitle ? `${c} ${l}` : c,
370
- "aria-describedby": Q ? u : void 0,
371
- "aria-keyshortcuts": Q ? "ArrowRight ArrowLeft Delete" : void 0,
372
- onKeyDown: me,
373
- onClick: () => n.onPress && n.onPress(),
374
- className: "bl-btn bl-hl absolute inset-0 cursor-pointer border-0 bg-transparent p-0 outline-none focus-visible:[box-shadow:inset_0_0_0_2px_var(--primary)]"
375
- }) : null,
376
- ye ? /* @__PURE__ */ C("span", {
377
- "aria-hidden": "true",
378
- className: e("pointer-events-none relative flex shrink-0 items-center overflow-hidden transition-[width,opacity,margin-right] duration-spring-snappy ease-spring-snappy motion-reduce:transition-none", n.edit ? "mr-0 w-[30px] opacity-100" : "-mr-3 w-0 opacity-0"),
379
- children: /* @__PURE__ */ C("span", {
380
- className: e("box-border grid size-[22px] shrink-0 place-items-center rounded-[50%] transition-[background-color,scale] duration-spring-snappy ease-spring-bouncy", n.checked ? "border-none bg-primary" : "[border:1.6px_solid_var(--tertiary-foreground,color-mix(in_oklab,var(--muted-foreground)_60%,transparent))] bg-transparent"),
381
- children: n.checked ? /* @__PURE__ */ C(r, {
382
- name: "check",
383
- size: 13,
384
- sw: 3,
385
- className: "text-primary-foreground transition-[scale,opacity] duration-spring-snappy ease-spring-bouncy starting:scale-50 starting:opacity-0"
386
- }) : null
328
+ "data-row-action": !0,
329
+ tabIndex: 0,
330
+ onClick: (e) => {
331
+ e.stopPropagation(), q(g, t);
332
+ },
333
+ "aria-label": t.label,
334
+ className: e("bl-btn relative flex min-w-0 shrink basis-0 cursor-pointer overflow-hidden border-0 p-0 [font-family:inherit] text-white outline-none focus-visible:[box-shadow:inset_0_0_0_2px_white]", "grow-(--action-grow) bg-(--action-bg) transition-[flex-grow] duration-spring-snappy ease-spring-snappy motion-reduce:transition-none", g === "leading" ? "justify-end" : "justify-start"),
335
+ style: {
336
+ "--action-bg": t.tint || (t.destructive ? "var(--destructive)" : "var(--primary)"),
337
+ "--action-grow": _ ? +(n === 0) : A(t),
338
+ "--action-w": A(t) + "px"
339
+ },
340
+ children: /* @__PURE__ */ w("span", {
341
+ className: "flex h-full w-(--action-w) shrink-0 flex-col items-center justify-center gap-[3px] px-2",
342
+ children: [t.icon ? /* @__PURE__ */ C(de, { icon: t.icon }) : null, /* @__PURE__ */ C("span", {
343
+ className: e("truncate font-semibold", t.icon ? "text-caption" : "text-subhead"),
344
+ children: t.label
345
+ })]
387
346
  })
388
- }) : null,
389
- n.leading ? /* @__PURE__ */ C("span", {
390
- "data-slot": "list-row-leading",
391
- className: "pointer-events-none relative flex shrink-0 items-center",
392
- children: n.leading
393
- }) : null,
394
- /* @__PURE__ */ w("div", {
395
- "data-slot": "list-row-body",
396
- className: e("pointer-events-none relative flex min-h-row min-w-0 flex-1 items-center gap-2.5 px-0", X ? "py-3" : "py-[7px]", n.divider !== !1 && "[box-shadow:inset_0_-1px_0_var(--border)]", n.center ? "justify-center" : "justify-start"),
397
- children: [/* @__PURE__ */ w(s, {
398
- value: be ? c : void 0,
399
- children: [
400
- X ? /* @__PURE__ */ C("div", {
401
- "data-row-control": "",
402
- "data-slot": "list-row-control",
403
- className: "pointer-events-auto min-w-0 flex-1",
404
- children: n.children
405
- }) : /* @__PURE__ */ w("div", {
406
- className: e("min-w-0", n.center ? "flex-none" : "flex-1"),
407
- children: [/* @__PURE__ */ C("div", {
408
- id: c,
409
- className: "truncate leading-[1.3]",
410
- children: n.title
411
- }), n.subtitle ? /* @__PURE__ */ C("div", {
412
- id: l,
413
- className: "mt-px truncate text-footnote text-muted-foreground",
414
- children: n.subtitle
415
- }) : null]
416
- }),
417
- n.trailing ? /* @__PURE__ */ C("span", {
418
- "data-row-control": "",
419
- className: "flex shrink-0 items-center",
420
- children: n.trailing
421
- }) : null,
422
- n.accessory === "chevron" ? /* @__PURE__ */ C(r, {
423
- name: "chev",
424
- size: 15,
425
- sw: 2.6,
426
- className: "text-tertiary-foreground"
427
- }) : n.accessory === "check" ? /* @__PURE__ */ C("span", {
428
- className: "w-[22px] shrink-0",
429
- children: n.checked ? /* @__PURE__ */ C(r, {
430
- name: "check",
431
- size: 20,
432
- sw: 2.4,
433
- className: "text-primary"
434
- }) : null
435
- }) : J ? /* @__PURE__ */ C("span", {
436
- "data-row-control": "",
437
- className: "pointer-events-auto flex min-w-0 shrink-0 items-center",
438
- children: J
439
- }) : null
440
- ]
441
- }), i?.startDrag ? /* @__PURE__ */ w("button", {
442
- type: "button",
443
- "data-row-grip": !0,
444
- "aria-label": `Reorder ${typeof n.title == "string" ? n.title : "row"}`,
445
- "aria-describedby": o + "-g",
446
- onPointerDown: (e) => {
447
- e.preventDefault(), e.stopPropagation(), i.startDrag(e);
448
- },
449
- onKeyDown: (e) => {
450
- (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), e.stopPropagation(), i.move?.(i.index + (e.key === "ArrowUp" ? -1 : 1)));
347
+ }, t.label + n))
348
+ }) : null,
349
+ /* @__PURE__ */ w(m.div, {
350
+ ref: D,
351
+ "data-slot": "list-row-content",
352
+ "data-tkrow": !Y && Z ? "" : void 0,
353
+ tabIndex: !Y && Z ? 0 : void 0,
354
+ role: !Y && Z ? "group" : void 0,
355
+ "aria-labelledby": !Y && Z ? u : void 0,
356
+ "aria-describedby": !Y && Q ? f : void 0,
357
+ "aria-keyshortcuts": !Y && Q ? "ArrowRight ArrowLeft Delete" : void 0,
358
+ onKeyDown: Y ? void 0 : _e,
359
+ onPointerDown: pe,
360
+ onPointerMove: me,
361
+ onPointerUp: he,
362
+ onPointerCancel: he,
363
+ onClickCapture: ye,
364
+ onClick: be,
365
+ "aria-current": !Y && Z && n.selected ? "true" : void 0,
366
+ className: e(ce({
367
+ align: n.align,
368
+ selected: !!n.selected,
369
+ destructive: !!n.destructive,
370
+ interactive: Y || W || !!J && n.labelToggles !== !1
371
+ }), n.contentClassName),
372
+ style: { x: h },
373
+ children: [
374
+ Y ? /* @__PURE__ */ C("button", {
375
+ ref: (e) => {
376
+ O.current = e;
451
377
  },
452
- className: e("bl-btn pointer-events-auto -mr-2 grid h-[44px] w-[40px] shrink-0 cursor-grab touch-none place-items-center rounded-lg border-0 bg-transparent p-0 text-tertiary-foreground outline-none focus-visible:[box-shadow:inset_0_0_0_2px_var(--primary)]", i.dragging && "cursor-grabbing"),
453
- children: [/* @__PURE__ */ C("svg", {
454
- width: "20",
455
- height: "14",
456
- viewBox: "0 0 20 14",
457
- "aria-hidden": "true",
458
- children: /* @__PURE__ */ C("path", {
459
- d: "M2 2h16M2 7h16M2 12h16",
460
- stroke: "currentColor",
461
- strokeWidth: "1.8",
462
- strokeLinecap: "round"
463
- })
464
- }), /* @__PURE__ */ w("span", {
465
- id: o + "-g",
466
- className: "sr-only",
378
+ "data-tkrow": !0,
379
+ type: "button",
380
+ role: n.rowRole,
381
+ "aria-selected": n.rowRole ? n.selected || n.checked || !1 : void 0,
382
+ "aria-current": !n.rowRole && n.selected ? "true" : void 0,
383
+ "aria-labelledby": n.subtitle ? `${u} ${d}` : u,
384
+ "aria-describedby": Q ? f : void 0,
385
+ "aria-keyshortcuts": Q ? "ArrowRight ArrowLeft Delete" : void 0,
386
+ onKeyDown: _e,
387
+ onClick: () => n.onPress && n.onPress(),
388
+ className: "bl-btn bl-hl absolute inset-0 cursor-pointer border-0 bg-transparent p-0 outline-none focus-visible:[box-shadow:inset_0_0_0_2px_var(--primary)]"
389
+ }) : null,
390
+ Se ? /* @__PURE__ */ C("span", {
391
+ "aria-hidden": "true",
392
+ className: e("pointer-events-none relative flex shrink-0 items-center overflow-hidden transition-[width,opacity,margin-right] duration-spring-snappy ease-spring-snappy motion-reduce:transition-none", n.edit ? "mr-0 w-[30px] opacity-100" : "-mr-3 w-0 opacity-0"),
393
+ children: /* @__PURE__ */ C("span", {
394
+ className: e("box-border grid size-[22px] shrink-0 place-items-center rounded-[50%] transition-[background-color,scale] duration-spring-snappy ease-spring-bouncy", n.checked ? "border-none bg-primary" : "[border:1.6px_solid_var(--tertiary-foreground,color-mix(in_oklab,var(--muted-foreground)_60%,transparent))] bg-transparent"),
395
+ children: n.checked ? /* @__PURE__ */ C(r, {
396
+ name: "check",
397
+ size: 13,
398
+ sw: 3,
399
+ className: "text-primary-foreground transition-[scale,opacity] duration-spring-snappy ease-spring-bouncy starting:scale-50 starting:opacity-0"
400
+ }) : null
401
+ })
402
+ }) : null,
403
+ n.leading ? /* @__PURE__ */ C("span", {
404
+ "data-slot": "list-row-leading",
405
+ className: "pointer-events-none relative flex shrink-0 items-center",
406
+ children: n.leading
407
+ }) : null,
408
+ /* @__PURE__ */ w("div", {
409
+ "data-slot": "list-row-body",
410
+ className: e("pointer-events-none relative flex min-h-row min-w-0 flex-1 items-center gap-2.5 px-0", X ? "py-3" : "py-[7px]", n.divider !== !1 && "[box-shadow:inset_0_-1px_0_var(--border)]", n.center ? "justify-center" : "justify-start"),
411
+ children: [/* @__PURE__ */ w(l, {
412
+ value: Ce ? u : void 0,
467
413
  children: [
468
- "Drag, or press up and down arrows, to move. Position ",
469
- i.index + 1,
470
- " of ",
471
- i.count,
472
- "."
414
+ X ? /* @__PURE__ */ C("div", {
415
+ "data-row-control": "",
416
+ "data-slot": "list-row-control",
417
+ className: "pointer-events-auto min-w-0 flex-1",
418
+ children: n.children
419
+ }) : /* @__PURE__ */ w("div", {
420
+ className: e("min-w-0", n.center ? "flex-none" : "flex-1"),
421
+ children: [/* @__PURE__ */ C("div", {
422
+ id: u,
423
+ className: "truncate leading-[1.3]",
424
+ children: n.title
425
+ }), n.subtitle ? /* @__PURE__ */ C("div", {
426
+ id: d,
427
+ className: "mt-px truncate text-footnote text-muted-foreground",
428
+ children: n.subtitle
429
+ }) : null]
430
+ }),
431
+ n.trailing ? /* @__PURE__ */ C("span", {
432
+ "data-row-control": "",
433
+ className: "flex shrink-0 items-center",
434
+ children: n.trailing
435
+ }) : null,
436
+ n.accessory === "chevron" ? /* @__PURE__ */ C(r, {
437
+ name: "chev",
438
+ size: 15,
439
+ sw: 2.6,
440
+ className: "text-tertiary-foreground"
441
+ }) : n.accessory === "check" ? /* @__PURE__ */ C("span", {
442
+ className: "w-[22px] shrink-0",
443
+ children: n.checked ? /* @__PURE__ */ C(r, {
444
+ name: "check",
445
+ size: 20,
446
+ sw: 2.4,
447
+ className: "text-primary"
448
+ }) : null
449
+ }) : J ? /* @__PURE__ */ C("span", {
450
+ "data-row-control": "",
451
+ className: "pointer-events-auto flex min-w-0 shrink-0 items-center",
452
+ children: J
453
+ }) : null
473
454
  ]
474
- })]
475
- }) : null]
476
- }),
477
- Q ? /* @__PURE__ */ C("span", {
478
- id: u,
479
- className: "sr-only",
480
- children: Q
481
- }) : null
482
- ]
483
- })]
455
+ }), i?.startDrag ? /* @__PURE__ */ w("button", {
456
+ type: "button",
457
+ "data-row-grip": !0,
458
+ "aria-label": `Reorder ${typeof n.title == "string" ? n.title : "row"}`,
459
+ "aria-describedby": o + "-g",
460
+ onPointerDown: (e) => {
461
+ e.preventDefault(), e.stopPropagation(), i.startDrag(e);
462
+ },
463
+ onKeyDown: (e) => {
464
+ (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), e.stopPropagation(), i.move?.(i.index + (e.key === "ArrowUp" ? -1 : 1)));
465
+ },
466
+ className: e("bl-btn pointer-events-auto -mr-2 grid h-[44px] w-[40px] shrink-0 cursor-grab touch-none place-items-center rounded-lg border-0 bg-transparent p-0 text-tertiary-foreground outline-none focus-visible:[box-shadow:inset_0_0_0_2px_var(--primary)]", i.dragging && "cursor-grabbing"),
467
+ children: [/* @__PURE__ */ C("svg", {
468
+ width: "20",
469
+ height: "14",
470
+ viewBox: "0 0 20 14",
471
+ "aria-hidden": "true",
472
+ children: /* @__PURE__ */ C("path", {
473
+ d: "M2 2h16M2 7h16M2 12h16",
474
+ stroke: "currentColor",
475
+ strokeWidth: "1.8",
476
+ strokeLinecap: "round"
477
+ })
478
+ }), /* @__PURE__ */ w("span", {
479
+ id: o + "-g",
480
+ className: "sr-only",
481
+ children: [
482
+ "Drag, or press up and down arrows, to move. Position ",
483
+ i.index + 1,
484
+ " of ",
485
+ i.count,
486
+ "."
487
+ ]
488
+ })]
489
+ }) : null]
490
+ }),
491
+ Q ? /* @__PURE__ */ C("span", {
492
+ id: f,
493
+ className: "sr-only",
494
+ children: Q
495
+ }) : null
496
+ ]
497
+ })
498
+ ]
484
499
  });
485
500
  }
486
- var N = Object.assign(T, {
501
+ var M = Object.assign(T, {
487
502
  Section: E,
488
- Row: M
503
+ Row: j
489
504
  });
490
505
  //#endregion
491
- export { N as List, M as ListRow, E as ListSection, A as listRowVariants };
506
+ export { M as List, j as ListRow, E as ListSection, ce as listRowVariants };