@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.
- package/dist/components/avatar.d.ts +4 -1
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +55 -47
- package/dist/components/canvas.d.ts +18 -0
- package/dist/components/canvas.d.ts.map +1 -1
- package/dist/components/canvas.js +79 -11
- package/dist/components/command-menu.js +1 -1
- package/dist/components/floating-chat.d.ts +1 -1
- package/dist/components/floating-sheet.d.ts +1 -1
- package/dist/components/hover-card.d.ts +69 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +164 -0
- package/dist/components/list.d.ts +3 -0
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +265 -250
- package/dist/components/markdown-view.d.ts +3 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +12 -11
- package/dist/components/open-code.d.ts +31 -0
- package/dist/components/open-code.d.ts.map +1 -0
- package/dist/components/open-code.js +253 -0
- package/dist/components/replay-preview.d.ts +2 -2
- package/dist/components/replay-preview.d.ts.map +1 -1
- package/dist/components/replay-preview.js +3 -3
- package/dist/components/sql-console.js +1 -1
- package/dist/components/tree.d.ts +4 -1
- package/dist/components/tree.d.ts.map +1 -1
- package/dist/components/tree.js +229 -202
- package/dist/components/tui-preview.d.ts +3 -0
- package/dist/components/tui-preview.d.ts.map +1 -0
- package/dist/components/tui-preview.js +3 -0
- package/dist/components/workspace.d.ts +11 -0
- package/dist/components/workspace.d.ts.map +1 -0
- package/dist/components/workspace.js +74 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -156
- package/dist/lib/canvas-math.d.ts +1 -1
- package/dist/lib/canvas-math.d.ts.map +1 -1
- package/dist/lib/canvas-math.js +1 -1
- package/dist/lib/open-code-browser-agent.d.ts +7 -0
- package/dist/lib/open-code-browser-agent.d.ts.map +1 -0
- package/dist/lib/open-code-browser-agent.js +161 -0
- package/dist/lib/open-code-browser.d.ts +17 -0
- package/dist/lib/open-code-browser.d.ts.map +1 -0
- package/dist/lib/open-code-browser.js +252 -0
- package/dist/lib/open-code-host.d.ts +182 -0
- package/dist/lib/open-code-host.d.ts.map +1 -0
- package/dist/lib/open-code-host.js +118 -0
- package/dist/lib/open-code-keychain.d.ts +11 -0
- package/dist/lib/open-code-keychain.d.ts.map +1 -0
- package/dist/lib/open-code-keychain.js +19 -0
- package/dist/lib/open-code-preview.d.ts +16 -0
- package/dist/lib/open-code-preview.d.ts.map +1 -0
- package/dist/lib/open-code-preview.js +112 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -1
- package/dist/lib/tailscale-connect.js +97 -62
- package/dist/lib/tailscale-policy.d.ts +11 -2
- package/dist/lib/tailscale-policy.d.ts.map +1 -1
- package/dist/lib/tailscale-policy.js +27 -18
- package/dist/lib/tailscale-router/bridge.d.ts +7 -2
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -1
- package/dist/lib/tailscale-router/bridge.js +64 -57
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +8 -5
- package/dist/opencode.d.ts +7 -0
- package/dist/opencode.d.ts.map +1 -0
- package/dist/opencode.js +6 -0
- package/dist/tailscale-sw.js +237 -12
- package/package.json +21 -3
package/dist/components/list.js
CHANGED
|
@@ -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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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 =
|
|
14
|
-
|
|
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
|
|
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 =
|
|
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(
|
|
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(
|
|
80
|
+
return /* @__PURE__ */ C(d, {
|
|
80
81
|
reducedMotion: "user",
|
|
81
|
-
children: /* @__PURE__ */ C(
|
|
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(
|
|
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: !!
|
|
95
|
+
reduced: !!c,
|
|
95
96
|
reorder: t ? {
|
|
96
|
-
drop:
|
|
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 =
|
|
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
|
-
|
|
115
|
+
u(!0), c.start(e);
|
|
115
116
|
} : void 0,
|
|
116
117
|
move: o?.move
|
|
117
118
|
};
|
|
118
|
-
return /* @__PURE__ */ C(
|
|
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
|
-
|
|
147
|
+
u(!1), o?.drop(n);
|
|
147
148
|
},
|
|
148
|
-
children: /* @__PURE__ */ C(
|
|
149
|
-
value:
|
|
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(),
|
|
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
|
-
}),
|
|
184
|
-
function
|
|
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(
|
|
190
|
+
}) : null : /* @__PURE__ */ C(ae, { children: e });
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
let i =
|
|
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 +
|
|
197
|
-
|
|
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
|
-
|
|
200
|
-
}), [
|
|
201
|
-
let G = (e, n = 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
|
-
}),
|
|
205
|
-
|
|
205
|
+
}), P.current), K = () => {
|
|
206
|
+
b(!1), G(0);
|
|
206
207
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
y(() => {
|
|
209
|
+
F.current = () => {
|
|
210
|
+
h.get() !== 0 && K();
|
|
210
211
|
};
|
|
211
|
-
let e = () =>
|
|
212
|
+
let e = () => F.current();
|
|
212
213
|
return k.add(e), () => {
|
|
213
214
|
k.delete(e);
|
|
214
215
|
};
|
|
215
|
-
}),
|
|
216
|
+
}), y(() => {
|
|
216
217
|
n.onPress || (O.current = D.current);
|
|
217
218
|
});
|
|
218
|
-
let
|
|
219
|
-
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 ? (
|
|
223
|
-
},
|
|
224
|
-
!W || e.button || n.isEdge && n.isEdge(e.clientX) || e.target.closest("[data-row-control],[data-row-action],[data-row-grip]") || (
|
|
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:
|
|
228
|
+
base: h.get(),
|
|
228
229
|
on: !1,
|
|
229
230
|
fired: !1
|
|
230
231
|
});
|
|
231
|
-
},
|
|
232
|
-
let t =
|
|
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,
|
|
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
|
-
|
|
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 *
|
|
251
|
-
t.fired = c,
|
|
251
|
+
let c = U(o) && s > i * le;
|
|
252
|
+
t.fired = c, b(c);
|
|
252
253
|
}
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
let e =
|
|
256
|
-
if (
|
|
257
|
-
delete D.current.dataset.swiping,
|
|
258
|
-
|
|
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 =
|
|
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 *
|
|
267
|
+
if (U(i) && e.fired && Math.abs(n) > t * le) {
|
|
267
268
|
q(i, V(i)[0]);
|
|
268
269
|
return;
|
|
269
270
|
}
|
|
270
|
-
|
|
271
|
-
},
|
|
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" &&
|
|
274
|
-
else if (e.key === "ArrowLeft" &&
|
|
275
|
-
else if (e.key === "Escape" &&
|
|
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
|
-
},
|
|
282
|
+
}, ve = (e) => {
|
|
282
283
|
e.key === "Escape" && (e.stopPropagation(), K(), O.current?.focus({ preventScroll: !0 }));
|
|
283
|
-
},
|
|
284
|
-
if (
|
|
284
|
+
}, ye = (e) => {
|
|
285
|
+
if (I.current) {
|
|
285
286
|
e.stopPropagation(), e.preventDefault();
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
n.onPress || n.labelToggles === !1 || e.target.closest(
|
|
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
|
-
|
|
293
|
-
!g || !
|
|
293
|
+
y(() => {
|
|
294
|
+
!g || !L.current || (L.current = !1, j.current?.querySelector("button")?.focus({ preventScroll: !0 }));
|
|
294
295
|
}, [g]);
|
|
295
|
-
let
|
|
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:
|
|
302
|
-
className: e("relative overflow-hidden transition-[height,opacity] duration-spring-tray ease-spring-tray motion-reduce:transition-none",
|
|
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
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
"aria-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
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
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
|
501
|
+
var M = Object.assign(T, {
|
|
487
502
|
Section: E,
|
|
488
|
-
Row:
|
|
503
|
+
Row: j
|
|
489
504
|
});
|
|
490
505
|
//#endregion
|
|
491
|
-
export {
|
|
506
|
+
export { M as List, j as ListRow, E as ListSection, ce as listRowVariants };
|