laif-ds 0.2.47 → 0.2.48

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 (35) hide show
  1. package/dist/_virtual/index2.js +2 -5
  2. package/dist/_virtual/index3.js +5 -2
  3. package/dist/agent-docs/components/AppForm.md +66 -1
  4. package/dist/agent-docs/components/AsyncSelect.md +94 -103
  5. package/dist/components/kanban.js +540 -0
  6. package/dist/components/ui/app-form.js +76 -44
  7. package/dist/components/ui/app-kanban.js +137 -0
  8. package/dist/components/ui/app-select.js +100 -87
  9. package/dist/components/ui/async-select.js +264 -278
  10. package/dist/index.d.ts +81 -29
  11. package/dist/index.js +77 -75
  12. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +1 -1
  13. package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
  14. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +1 -1
  15. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  16. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
  17. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  18. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +1 -1
  19. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  20. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
  21. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  22. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  23. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  24. package/dist/node_modules/@radix-ui/react-select/dist/index.js +1 -1
  25. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  26. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +47 -44
  27. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +1 -1
  28. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
  29. package/dist/node_modules/eventemitter3/index.js +1 -1
  30. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  31. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +536 -502
  32. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  33. package/dist/styles.css +1 -1
  34. package/dist/styles.v3.css +1 -1
  35. package/package.json +4 -4
@@ -0,0 +1,540 @@
1
+ "use client";
2
+ import { jsx as d, jsxs as D, Fragment as A } from "react/jsx-runtime";
3
+ import { useId as E, useRef as R, useCallback as b, useMemo as k, createContext as $, useState as C, useEffect as M, useContext as O } from "react";
4
+ import { createPortal as I } from "react-dom";
5
+ import { Button as P } from "./ui/button.js";
6
+ import { Popover as z, PopoverTrigger as L, PopoverContent as _ } from "./ui/popover.js";
7
+ import { TooltipProvider as j } from "./ui/tooltip.js";
8
+ import { Typo as S } from "./ui/typo.js";
9
+ import { cn as m } from "../lib/utils.js";
10
+ import F from "../node_modules/lucide-react/dist/esm/icons/pencil.js";
11
+ import H from "../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js";
12
+ const T = $(void 0);
13
+ function J(e) {
14
+ const r = O(T);
15
+ if (!r)
16
+ throw new Error("useDndMonitor must be used within a DndMonitorProvider");
17
+ const { registerMonitor: i, unregisterMonitor: t } = r;
18
+ M(() => (i(e), () => {
19
+ t(e);
20
+ }), [e, i, t]);
21
+ }
22
+ function B() {
23
+ const e = O(T);
24
+ if (!e)
25
+ throw new Error("useDndEvents must be used within a DndMonitorProvider");
26
+ const { activeIdRef: r, draggableDescribedById: i, triggerEvent: t } = e, s = b(
27
+ (a) => {
28
+ r.current = a, t("onDragStart", a);
29
+ },
30
+ [t, r]
31
+ ), l = b(
32
+ (a, o) => {
33
+ t("onDragMove", a, o);
34
+ },
35
+ [t]
36
+ ), c = b(
37
+ (a, o) => {
38
+ const g = a || r.current;
39
+ t("onDragOver", g, o);
40
+ },
41
+ [t, r]
42
+ ), u = b(
43
+ (a, o) => {
44
+ t("onDragEnd", a, o);
45
+ },
46
+ [t]
47
+ ), p = b(
48
+ (a) => {
49
+ t("onDragCancel", a);
50
+ },
51
+ [t]
52
+ );
53
+ return {
54
+ draggableDescribedById: i,
55
+ onDragStart: s,
56
+ onDragMove: l,
57
+ onDragOver: c,
58
+ onDragEnd: u,
59
+ onDragCancel: p
60
+ };
61
+ }
62
+ const V = `
63
+ To pick up a draggable item, press the space bar.
64
+ While dragging, use the arrow keys to move the item.
65
+ Press space again to drop the item in its new position, or press escape to cancel.
66
+ `, Y = {
67
+ onDragStart(e) {
68
+ return `Picked up draggable item ${e}.`;
69
+ },
70
+ onDragOver(e, r) {
71
+ return r ? `Draggable item ${e} was moved over droppable area ${r}.` : `Draggable item ${e} is no longer over a droppable area.`;
72
+ },
73
+ onDragEnd(e, r) {
74
+ return r ? `Draggable item ${e} was dropped over droppable area ${r}` : `Draggable item ${e} was dropped.`;
75
+ },
76
+ onDragCancel(e) {
77
+ return `Dragging was cancelled. Draggable item ${e} was dropped.`;
78
+ }
79
+ };
80
+ function W({
81
+ announcement: e,
82
+ ariaLiveType: r = "assertive",
83
+ className: i,
84
+ id: t,
85
+ ref: s,
86
+ ...l
87
+ }) {
88
+ return /* @__PURE__ */ d(
89
+ "div",
90
+ {
91
+ "aria-live": r,
92
+ "aria-atomic": !0,
93
+ className: m(
94
+ "clip-[rect(0_0_0_0)] clip-path-[inset(100%)] fixed top-0 left-0 -m-px h-px w-px overflow-hidden border-0 p-0 whitespace-nowrap",
95
+ i
96
+ ),
97
+ id: t,
98
+ ref: s,
99
+ role: "status",
100
+ ...l,
101
+ children: e
102
+ }
103
+ );
104
+ }
105
+ function q({
106
+ id: e,
107
+ value: r,
108
+ className: i,
109
+ ref: t,
110
+ ...s
111
+ }) {
112
+ return /* @__PURE__ */ d("div", { id: e, className: m("hidden", i), ref: t, ...s, children: r });
113
+ }
114
+ function G() {
115
+ const [e, r] = C("");
116
+ return { announce: b((t) => {
117
+ t != null && r(t);
118
+ }, []), announcement: e };
119
+ }
120
+ const Q = ({
121
+ announcements: e = Y,
122
+ container: r,
123
+ hiddenTextDescribedById: i,
124
+ screenReaderInstructions: t = V
125
+ }) => {
126
+ const { announce: s, announcement: l } = G(), c = E(), [u, p] = C(!1);
127
+ if (M(() => {
128
+ p(!0);
129
+ }, []), J(
130
+ k(
131
+ () => ({
132
+ onDragStart(o) {
133
+ s(e.onDragStart(o));
134
+ },
135
+ onDragMove(o, g) {
136
+ e.onDragMove && s(e.onDragMove(o, g));
137
+ },
138
+ onDragOver(o, g) {
139
+ s(e.onDragOver(o, g));
140
+ },
141
+ onDragEnd(o, g) {
142
+ s(e.onDragEnd(o, g));
143
+ },
144
+ onDragCancel(o) {
145
+ s(e.onDragCancel(o));
146
+ }
147
+ }),
148
+ [s, e]
149
+ )
150
+ ), !u)
151
+ return null;
152
+ const a = /* @__PURE__ */ D(A, { children: [
153
+ /* @__PURE__ */ d(
154
+ q,
155
+ {
156
+ id: i,
157
+ value: t
158
+ }
159
+ ),
160
+ /* @__PURE__ */ d(W, { id: c, announcement: l })
161
+ ] });
162
+ return r ? I(a, r) : a;
163
+ }, ce = ({
164
+ announcements: e,
165
+ screenReaderInstructions: r,
166
+ container: i,
167
+ children: t
168
+ }) => {
169
+ const s = E(), l = R([]), c = R(""), u = b(
170
+ (g) => {
171
+ l.current.push(g);
172
+ },
173
+ []
174
+ ), p = b(
175
+ (g) => {
176
+ l.current = l.current.filter(
177
+ (h) => h !== g
178
+ );
179
+ },
180
+ []
181
+ ), a = b(
182
+ (g, h, w) => {
183
+ for (const N of l.current) {
184
+ const y = N[g];
185
+ y && y(h, w);
186
+ }
187
+ },
188
+ []
189
+ ), o = k(
190
+ () => ({
191
+ activeIdRef: c,
192
+ draggableDescribedById: s,
193
+ registerMonitor: u,
194
+ unregisterMonitor: p,
195
+ triggerEvent: a
196
+ }),
197
+ [
198
+ c,
199
+ s,
200
+ u,
201
+ p,
202
+ a
203
+ ]
204
+ );
205
+ return /* @__PURE__ */ d(j, { children: /* @__PURE__ */ D(T.Provider, { value: o, children: [
206
+ t,
207
+ /* @__PURE__ */ d(
208
+ Q,
209
+ {
210
+ announcements: e,
211
+ screenReaderInstructions: r,
212
+ container: i,
213
+ hiddenTextDescribedById: s
214
+ }
215
+ )
216
+ ] }) });
217
+ }, x = {
218
+ CARD: "kanban-board-card"
219
+ };
220
+ function ge({
221
+ className: e,
222
+ ref: r,
223
+ ...i
224
+ }) {
225
+ return /* @__PURE__ */ d(
226
+ "div",
227
+ {
228
+ className: m(
229
+ "flex h-full flex-grow items-start gap-x-2 overflow-x-auto py-1 select-none",
230
+ e
231
+ ),
232
+ draggable: !1,
233
+ onDragStart: (t) => {
234
+ t.preventDefault(), t.stopPropagation();
235
+ },
236
+ ref: r,
237
+ ...i
238
+ }
239
+ );
240
+ }
241
+ const U = "w-80 flex-shrink-0 rounded-lg border flex flex-col border-d-border bg-d-sidebar py-2 max-h-full";
242
+ function ue({
243
+ className: e,
244
+ columnId: r,
245
+ onDropOverColumn: i,
246
+ ref: t,
247
+ ...s
248
+ }) {
249
+ const [l, c] = C(!1), { onDragEnd: u, onDragOver: p } = B();
250
+ return /* @__PURE__ */ d(
251
+ "section",
252
+ {
253
+ "aria-labelledby": `column-${r}-title`,
254
+ className: m(
255
+ U,
256
+ l && "border-d-primary",
257
+ e
258
+ ),
259
+ draggable: !1,
260
+ onDragStart: (a) => {
261
+ a.preventDefault(), a.stopPropagation();
262
+ },
263
+ onDragLeave: () => {
264
+ c(!1);
265
+ },
266
+ onDragOver: (a) => {
267
+ a.dataTransfer.types.includes(x.CARD) && (a.preventDefault(), c(!0), p("", r));
268
+ },
269
+ onDrop: (a) => {
270
+ if (a.dataTransfer.types.includes(x.CARD)) {
271
+ a.preventDefault(), c(!1);
272
+ const o = a.dataTransfer.getData(x.CARD);
273
+ i?.(o), u("", r);
274
+ }
275
+ },
276
+ ref: t,
277
+ ...s
278
+ }
279
+ );
280
+ }
281
+ function pe({
282
+ className: e,
283
+ ref: r,
284
+ ...i
285
+ }) {
286
+ return /* @__PURE__ */ d(
287
+ "div",
288
+ {
289
+ className: m("flex items-center justify-between px-2 py-1", e),
290
+ ref: r,
291
+ ...i
292
+ }
293
+ );
294
+ }
295
+ function fe({
296
+ className: e,
297
+ ref: r,
298
+ ...i
299
+ }) {
300
+ return /* @__PURE__ */ d(
301
+ "ul",
302
+ {
303
+ className: m("min-h-0.5 flex-grow overflow-y-auto", e),
304
+ ref: r,
305
+ ...i
306
+ }
307
+ );
308
+ }
309
+ const X = "-mb-[2px] border-b-2 border-t-2 border-b-transparent border-t-transparent px-2 py-1 last:mb-0";
310
+ function me({
311
+ cardId: e,
312
+ className: r,
313
+ onDropOverListItem: i,
314
+ ref: t,
315
+ ...s
316
+ }) {
317
+ const [l, c] = C("none"), { onDragOver: u, onDragEnd: p } = B();
318
+ return /* @__PURE__ */ d(
319
+ "li",
320
+ {
321
+ className: m(
322
+ X,
323
+ l === "top" && "border-t-d-primary",
324
+ l === "bottom" && "border-b-d-primary",
325
+ r
326
+ ),
327
+ onDragLeave: () => {
328
+ c("none");
329
+ },
330
+ onDragOver: (a) => {
331
+ if (a.dataTransfer.types.includes(x.CARD)) {
332
+ a.preventDefault(), a.stopPropagation();
333
+ const o = a.currentTarget.getBoundingClientRect(), g = (o.top + o.bottom) / 2;
334
+ c(a.clientY <= g ? "top" : "bottom"), u("", e);
335
+ }
336
+ },
337
+ onDrop: (a) => {
338
+ a.stopPropagation();
339
+ const o = a.dataTransfer.getData(x.CARD);
340
+ i?.(o, l), p(JSON.parse(o).id, e), c("none");
341
+ },
342
+ ref: t,
343
+ ...s
344
+ }
345
+ );
346
+ }
347
+ const Z = "p-3 text-start";
348
+ function be({
349
+ className: e,
350
+ data: r,
351
+ isActive: i = !1,
352
+ onEdit: t,
353
+ actions: s,
354
+ meta: l,
355
+ backgroundColor: c,
356
+ ref: u,
357
+ children: p,
358
+ ...a
359
+ }) {
360
+ const [o, g] = C(!1), [h, w] = C(!1), { draggableDescribedById: N, onDragStart: y } = B(), K = t || s && s.length > 0;
361
+ return /* @__PURE__ */ D(
362
+ "div",
363
+ {
364
+ role: "button",
365
+ tabIndex: 0,
366
+ "aria-describedby": N,
367
+ "aria-roledescription": "draggable",
368
+ draggable: !0,
369
+ onDragStart: (n) => {
370
+ n.stopPropagation(), g(!0), n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData(
371
+ x.CARD,
372
+ JSON.stringify(r)
373
+ );
374
+ const f = n.currentTarget.cloneNode(!0), v = n.currentTarget.getBoundingClientRect();
375
+ f.style.position = "absolute", f.style.top = "-9999px", f.style.width = `${v.width}px`, f.style.opacity = "0.8", document.body.appendChild(f), n.dataTransfer.setDragImage(
376
+ f,
377
+ v.width / 2,
378
+ v.height / 2
379
+ ), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), y(r.id);
380
+ },
381
+ onDragEnd: () => {
382
+ g(!1);
383
+ },
384
+ onClick: (n) => {
385
+ o && (n.preventDefault(), n.stopPropagation());
386
+ },
387
+ onKeyDown: (n) => {
388
+ (n.key === "Enter" || n.key === " ") && n.preventDefault();
389
+ },
390
+ className: m(
391
+ "border-d-border text-d-card-foreground rounded-lg border shadow-sm",
392
+ !c && "bg-d-card",
393
+ Z,
394
+ "focus-visible:ring-d-ring inline-flex w-full cursor-grab touch-manipulation flex-col gap-2 focus-visible:ring-1 focus-visible:outline-none",
395
+ o ? "cursor-grabbing active:cursor-grabbing" : "group/card relative",
396
+ i && "rotate-1 transform shadow-lg",
397
+ e
398
+ ),
399
+ style: {
400
+ backgroundColor: c ? `${c}15` : void 0,
401
+ borderColor: c ? `${c}30` : void 0,
402
+ ...a.style
403
+ },
404
+ ref: u,
405
+ ...a,
406
+ children: [
407
+ p,
408
+ l && l.length > 0 && /* @__PURE__ */ d("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: l.map((n, f) => /* @__PURE__ */ D(
409
+ "div",
410
+ {
411
+ className: "bg-d-muted/60 text-d-muted-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px]",
412
+ children: [
413
+ /* @__PURE__ */ d("span", { className: "text-d-foreground/80 truncate font-medium", children: n.name }),
414
+ n.value && /* @__PURE__ */ D(A, { children: [
415
+ /* @__PURE__ */ d("span", { className: "text-d-border/60", children: "•" }),
416
+ /* @__PURE__ */ d("span", { className: "truncate", children: n.value })
417
+ ] })
418
+ ]
419
+ },
420
+ f
421
+ )) }),
422
+ K && !o && /* @__PURE__ */ D(
423
+ "div",
424
+ {
425
+ className: m(
426
+ "bg-d-card border-d-border absolute top-2 right-2 items-center gap-1 rounded-md border p-0.5 shadow-sm",
427
+ h ? "flex" : "hidden group-focus-within/card:flex group-hover/card:flex"
428
+ ),
429
+ children: [
430
+ t && /* @__PURE__ */ d(
431
+ P,
432
+ {
433
+ variant: "ghost",
434
+ size: "icon",
435
+ className: "hover:bg-d-accent size-6",
436
+ onClick: (n) => {
437
+ n.stopPropagation(), n.preventDefault(), o || t();
438
+ },
439
+ children: /* @__PURE__ */ d(F, { className: "size-3.5" })
440
+ }
441
+ ),
442
+ s && s.length > 0 && /* @__PURE__ */ D(z, { open: h, onOpenChange: w, children: [
443
+ /* @__PURE__ */ d(L, { asChild: !0, children: /* @__PURE__ */ d(
444
+ P,
445
+ {
446
+ variant: "ghost",
447
+ size: "icon",
448
+ className: "hover:bg-d-accent size-6",
449
+ onClick: (n) => {
450
+ n.stopPropagation();
451
+ },
452
+ children: /* @__PURE__ */ d(H, { className: "size-3.5" })
453
+ }
454
+ ) }),
455
+ /* @__PURE__ */ d(
456
+ _,
457
+ {
458
+ className: "w-48 p-1",
459
+ align: "end",
460
+ side: "bottom",
461
+ sideOffset: 8,
462
+ onClick: (n) => n.stopPropagation(),
463
+ children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5", children: s.map((n, f) => /* @__PURE__ */ D(
464
+ P,
465
+ {
466
+ variant: n.variant === "destructive" ? "ghost-destructive" : "ghost",
467
+ size: "sm",
468
+ className: "w-full justify-start gap-2",
469
+ onClick: (v) => {
470
+ v.stopPropagation(), v.preventDefault(), n.onClick(), w(!1);
471
+ },
472
+ children: [
473
+ n.icon && /* @__PURE__ */ d("span", { className: "size-4", children: n.icon }),
474
+ n.label
475
+ ]
476
+ },
477
+ f
478
+ )) })
479
+ }
480
+ )
481
+ ] })
482
+ ]
483
+ }
484
+ )
485
+ ]
486
+ }
487
+ );
488
+ }
489
+ function De({
490
+ className: e,
491
+ ...r
492
+ }) {
493
+ return /* @__PURE__ */ d(
494
+ S,
495
+ {
496
+ variant: "small",
497
+ as: "h3",
498
+ className: m("text-[13px] font-semibold", e),
499
+ ...r
500
+ }
501
+ );
502
+ }
503
+ function he({
504
+ className: e,
505
+ ...r
506
+ }) {
507
+ return /* @__PURE__ */ d(
508
+ S,
509
+ {
510
+ variant: "caption",
511
+ as: "p",
512
+ className: m(
513
+ "text-d-muted-foreground leading-relaxed whitespace-pre-wrap",
514
+ e
515
+ ),
516
+ ...r
517
+ }
518
+ );
519
+ }
520
+ export {
521
+ ge as KanbanBoard,
522
+ Q as KanbanBoardAccessibility,
523
+ be as KanbanBoardCard,
524
+ he as KanbanBoardCardDescription,
525
+ De as KanbanBoardCardTitle,
526
+ ue as KanbanBoardColumn,
527
+ pe as KanbanBoardColumnHeader,
528
+ fe as KanbanBoardColumnList,
529
+ me as KanbanBoardColumnListItem,
530
+ T as KanbanBoardContext,
531
+ q as KanbanBoardHiddenText,
532
+ W as KanbanBoardLiveRegion,
533
+ ce as KanbanBoardProvider,
534
+ Y as defaultAnnouncements,
535
+ V as defaultScreenReaderInstructions,
536
+ U as kanbanBoardColumnClassNames,
537
+ X as kanbanBoardColumnListItemClassNames,
538
+ G as useAnnouncement,
539
+ B as useDndEvents
540
+ };