laif-ds 0.2.48 → 0.2.49

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.
@@ -1,26 +1,26 @@
1
1
  "use client";
2
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";
3
+ import { useId as E, useRef as R, useCallback as b, useMemo as M, createContext as $, useState as y, useEffect as O, useContext as S } from "react";
4
4
  import { createPortal as I } from "react-dom";
5
5
  import { Button as P } from "./ui/button.js";
6
6
  import { Popover as z, PopoverTrigger as L, PopoverContent as _ } from "./ui/popover.js";
7
7
  import { TooltipProvider as j } from "./ui/tooltip.js";
8
- import { Typo as S } from "./ui/typo.js";
8
+ import { Typo as K } from "./ui/typo.js";
9
9
  import { cn as m } from "../lib/utils.js";
10
10
  import F from "../node_modules/lucide-react/dist/esm/icons/pencil.js";
11
11
  import H from "../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js";
12
12
  const T = $(void 0);
13
13
  function J(e) {
14
- const r = O(T);
14
+ const r = S(T);
15
15
  if (!r)
16
16
  throw new Error("useDndMonitor must be used within a DndMonitorProvider");
17
17
  const { registerMonitor: i, unregisterMonitor: t } = r;
18
- M(() => (i(e), () => {
18
+ O(() => (i(e), () => {
19
19
  t(e);
20
20
  }), [e, i, t]);
21
21
  }
22
22
  function B() {
23
- const e = O(T);
23
+ const e = S(T);
24
24
  if (!e)
25
25
  throw new Error("useDndEvents must be used within a DndMonitorProvider");
26
26
  const { activeIdRef: r, draggableDescribedById: i, triggerEvent: t } = e, s = b(
@@ -28,23 +28,23 @@ function B() {
28
28
  r.current = a, t("onDragStart", a);
29
29
  },
30
30
  [t, r]
31
- ), l = b(
31
+ ), c = b(
32
32
  (a, o) => {
33
33
  t("onDragMove", a, o);
34
34
  },
35
35
  [t]
36
- ), c = b(
36
+ ), l = b(
37
37
  (a, o) => {
38
38
  const g = a || r.current;
39
39
  t("onDragOver", g, o);
40
40
  },
41
41
  [t, r]
42
- ), u = b(
42
+ ), p = b(
43
43
  (a, o) => {
44
44
  t("onDragEnd", a, o);
45
45
  },
46
46
  [t]
47
- ), p = b(
47
+ ), u = b(
48
48
  (a) => {
49
49
  t("onDragCancel", a);
50
50
  },
@@ -53,10 +53,10 @@ function B() {
53
53
  return {
54
54
  draggableDescribedById: i,
55
55
  onDragStart: s,
56
- onDragMove: l,
57
- onDragOver: c,
58
- onDragEnd: u,
59
- onDragCancel: p
56
+ onDragMove: c,
57
+ onDragOver: l,
58
+ onDragEnd: p,
59
+ onDragCancel: u
60
60
  };
61
61
  }
62
62
  const V = `
@@ -83,7 +83,7 @@ function W({
83
83
  className: i,
84
84
  id: t,
85
85
  ref: s,
86
- ...l
86
+ ...c
87
87
  }) {
88
88
  return /* @__PURE__ */ d(
89
89
  "div",
@@ -97,7 +97,7 @@ function W({
97
97
  id: t,
98
98
  ref: s,
99
99
  role: "status",
100
- ...l,
100
+ ...c,
101
101
  children: e
102
102
  }
103
103
  );
@@ -112,7 +112,7 @@ function q({
112
112
  return /* @__PURE__ */ d("div", { id: e, className: m("hidden", i), ref: t, ...s, children: r });
113
113
  }
114
114
  function G() {
115
- const [e, r] = C("");
115
+ const [e, r] = y("");
116
116
  return { announce: b((t) => {
117
117
  t != null && r(t);
118
118
  }, []), announcement: e };
@@ -123,11 +123,11 @@ const Q = ({
123
123
  hiddenTextDescribedById: i,
124
124
  screenReaderInstructions: t = V
125
125
  }) => {
126
- const { announce: s, announcement: l } = G(), c = E(), [u, p] = C(!1);
127
- if (M(() => {
128
- p(!0);
126
+ const { announce: s, announcement: c } = G(), l = E(), [p, u] = y(!1);
127
+ if (O(() => {
128
+ u(!0);
129
129
  }, []), J(
130
- k(
130
+ M(
131
131
  () => ({
132
132
  onDragStart(o) {
133
133
  s(e.onDragStart(o));
@@ -147,7 +147,7 @@ const Q = ({
147
147
  }),
148
148
  [s, e]
149
149
  )
150
- ), !u)
150
+ ), !p)
151
151
  return null;
152
152
  const a = /* @__PURE__ */ D(A, { children: [
153
153
  /* @__PURE__ */ d(
@@ -157,7 +157,7 @@ const Q = ({
157
157
  value: t
158
158
  }
159
159
  ),
160
- /* @__PURE__ */ d(W, { id: c, announcement: l })
160
+ /* @__PURE__ */ d(W, { id: l, announcement: c })
161
161
  ] });
162
162
  return r ? I(a, r) : a;
163
163
  }, ce = ({
@@ -166,39 +166,39 @@ const Q = ({
166
166
  container: i,
167
167
  children: t
168
168
  }) => {
169
- const s = E(), l = R([]), c = R(""), u = b(
169
+ const s = E(), c = R([]), l = R(""), p = b(
170
170
  (g) => {
171
- l.current.push(g);
171
+ c.current.push(g);
172
172
  },
173
173
  []
174
- ), p = b(
174
+ ), u = b(
175
175
  (g) => {
176
- l.current = l.current.filter(
177
- (h) => h !== g
176
+ c.current = c.current.filter(
177
+ (v) => v !== g
178
178
  );
179
179
  },
180
180
  []
181
181
  ), a = b(
182
- (g, h, w) => {
183
- for (const N of l.current) {
184
- const y = N[g];
185
- y && y(h, w);
182
+ (g, v, w) => {
183
+ for (const N of c.current) {
184
+ const C = N[g];
185
+ C && C(v, w);
186
186
  }
187
187
  },
188
188
  []
189
- ), o = k(
189
+ ), o = M(
190
190
  () => ({
191
- activeIdRef: c,
191
+ activeIdRef: l,
192
192
  draggableDescribedById: s,
193
- registerMonitor: u,
194
- unregisterMonitor: p,
193
+ registerMonitor: p,
194
+ unregisterMonitor: u,
195
195
  triggerEvent: a
196
196
  }),
197
197
  [
198
- c,
198
+ l,
199
199
  s,
200
- u,
201
200
  p,
201
+ u,
202
202
  a
203
203
  ]
204
204
  );
@@ -239,21 +239,21 @@ function ge({
239
239
  );
240
240
  }
241
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({
242
+ function pe({
243
243
  className: e,
244
244
  columnId: r,
245
245
  onDropOverColumn: i,
246
246
  ref: t,
247
247
  ...s
248
248
  }) {
249
- const [l, c] = C(!1), { onDragEnd: u, onDragOver: p } = B();
249
+ const [c, l] = y(!1), { onDragEnd: p, onDragOver: u } = B();
250
250
  return /* @__PURE__ */ d(
251
251
  "section",
252
252
  {
253
253
  "aria-labelledby": `column-${r}-title`,
254
254
  className: m(
255
255
  U,
256
- l && "border-d-primary",
256
+ c && "border-d-primary",
257
257
  e
258
258
  ),
259
259
  draggable: !1,
@@ -261,16 +261,16 @@ function ue({
261
261
  a.preventDefault(), a.stopPropagation();
262
262
  },
263
263
  onDragLeave: () => {
264
- c(!1);
264
+ l(!1);
265
265
  },
266
266
  onDragOver: (a) => {
267
- a.dataTransfer.types.includes(x.CARD) && (a.preventDefault(), c(!0), p("", r));
267
+ a.dataTransfer.types.includes(x.CARD) && (a.preventDefault(), l(!0), u("", r));
268
268
  },
269
269
  onDrop: (a) => {
270
270
  if (a.dataTransfer.types.includes(x.CARD)) {
271
- a.preventDefault(), c(!1);
271
+ a.preventDefault(), l(!1);
272
272
  const o = a.dataTransfer.getData(x.CARD);
273
- i?.(o), u("", r);
273
+ i?.(o), p("", r);
274
274
  }
275
275
  },
276
276
  ref: t,
@@ -278,7 +278,7 @@ function ue({
278
278
  }
279
279
  );
280
280
  }
281
- function pe({
281
+ function ue({
282
282
  className: e,
283
283
  ref: r,
284
284
  ...i
@@ -314,30 +314,30 @@ function me({
314
314
  ref: t,
315
315
  ...s
316
316
  }) {
317
- const [l, c] = C("none"), { onDragOver: u, onDragEnd: p } = B();
317
+ const [c, l] = y("none"), { onDragOver: p, onDragEnd: u } = B();
318
318
  return /* @__PURE__ */ d(
319
319
  "li",
320
320
  {
321
321
  className: m(
322
322
  X,
323
- l === "top" && "border-t-d-primary",
324
- l === "bottom" && "border-b-d-primary",
323
+ c === "top" && "border-t-d-primary",
324
+ c === "bottom" && "border-b-d-primary",
325
325
  r
326
326
  ),
327
327
  onDragLeave: () => {
328
- c("none");
328
+ l("none");
329
329
  },
330
330
  onDragOver: (a) => {
331
331
  if (a.dataTransfer.types.includes(x.CARD)) {
332
332
  a.preventDefault(), a.stopPropagation();
333
333
  const o = a.currentTarget.getBoundingClientRect(), g = (o.top + o.bottom) / 2;
334
- c(a.clientY <= g ? "top" : "bottom"), u("", e);
334
+ l(a.clientY <= g ? "top" : "bottom"), p("", e);
335
335
  }
336
336
  },
337
337
  onDrop: (a) => {
338
338
  a.stopPropagation();
339
339
  const o = a.dataTransfer.getData(x.CARD);
340
- i?.(o, l), p(JSON.parse(o).id, e), c("none");
340
+ i?.(o, c), u(JSON.parse(o).id, e), l("none");
341
341
  },
342
342
  ref: t,
343
343
  ...s
@@ -351,13 +351,13 @@ function be({
351
351
  isActive: i = !1,
352
352
  onEdit: t,
353
353
  actions: s,
354
- meta: l,
355
- backgroundColor: c,
356
- ref: u,
357
- children: p,
354
+ meta: c,
355
+ backgroundColor: l,
356
+ ref: p,
357
+ children: u,
358
358
  ...a
359
359
  }) {
360
- const [o, g] = C(!1), [h, w] = C(!1), { draggableDescribedById: N, onDragStart: y } = B(), K = t || s && s.length > 0;
360
+ const [o, g] = y(!1), [v, w] = y(!1), { draggableDescribedById: N, onDragStart: C } = B(), k = t || s && s.length > 0;
361
361
  return /* @__PURE__ */ D(
362
362
  "div",
363
363
  {
@@ -371,12 +371,12 @@ function be({
371
371
  x.CARD,
372
372
  JSON.stringify(r)
373
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(
374
+ const f = n.currentTarget.cloneNode(!0), h = n.currentTarget.getBoundingClientRect();
375
+ f.style.position = "absolute", f.style.top = "-9999px", f.style.width = `${h.width}px`, f.style.opacity = "0.8", document.body.appendChild(f), n.dataTransfer.setDragImage(
376
376
  f,
377
- v.width / 2,
378
- v.height / 2
379
- ), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), y(r.id);
377
+ h.width / 2,
378
+ h.height / 2
379
+ ), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), C(r.id);
380
380
  },
381
381
  onDragEnd: () => {
382
382
  g(!1);
@@ -389,7 +389,7 @@ function be({
389
389
  },
390
390
  className: m(
391
391
  "border-d-border text-d-card-foreground rounded-lg border shadow-sm",
392
- !c && "bg-d-card",
392
+ !l && "bg-d-card",
393
393
  Z,
394
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
395
  o ? "cursor-grabbing active:cursor-grabbing" : "group/card relative",
@@ -397,34 +397,38 @@ function be({
397
397
  e
398
398
  ),
399
399
  style: {
400
- backgroundColor: c ? `${c}15` : void 0,
401
- borderColor: c ? `${c}30` : void 0,
400
+ backgroundColor: l ? `${l}18` : void 0,
401
+ borderColor: l ? `${l}35` : void 0,
402
402
  ...a.style
403
403
  },
404
- ref: u,
404
+ ref: p,
405
405
  ...a,
406
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(
407
+ u,
408
+ c && c.length > 0 && /* @__PURE__ */ d("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: c.map((n, f) => /* @__PURE__ */ D(
409
409
  "div",
410
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]",
411
+ className: "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px]",
412
+ style: {
413
+ backgroundColor: l ? `${l}25` : void 0,
414
+ color: l || void 0
415
+ },
412
416
  children: [
413
- /* @__PURE__ */ d("span", { className: "text-d-foreground/80 truncate font-medium", children: n.name }),
417
+ /* @__PURE__ */ d("span", { className: "truncate font-medium", children: n.name }),
414
418
  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 })
419
+ /* @__PURE__ */ d("span", { className: "opacity-60", children: "•" }),
420
+ /* @__PURE__ */ d("span", { className: "truncate opacity-80", children: n.value })
417
421
  ] })
418
422
  ]
419
423
  },
420
424
  f
421
425
  )) }),
422
- K && !o && /* @__PURE__ */ D(
426
+ k && !o && /* @__PURE__ */ D(
423
427
  "div",
424
428
  {
425
429
  className: m(
426
430
  "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"
431
+ v ? "flex" : "hidden group-focus-within/card:flex group-hover/card:flex"
428
432
  ),
429
433
  children: [
430
434
  t && /* @__PURE__ */ d(
@@ -439,7 +443,7 @@ function be({
439
443
  children: /* @__PURE__ */ d(F, { className: "size-3.5" })
440
444
  }
441
445
  ),
442
- s && s.length > 0 && /* @__PURE__ */ D(z, { open: h, onOpenChange: w, children: [
446
+ s && s.length > 0 && /* @__PURE__ */ D(z, { open: v, onOpenChange: w, children: [
443
447
  /* @__PURE__ */ d(L, { asChild: !0, children: /* @__PURE__ */ d(
444
448
  P,
445
449
  {
@@ -466,8 +470,8 @@ function be({
466
470
  variant: n.variant === "destructive" ? "ghost-destructive" : "ghost",
467
471
  size: "sm",
468
472
  className: "w-full justify-start gap-2",
469
- onClick: (v) => {
470
- v.stopPropagation(), v.preventDefault(), n.onClick(), w(!1);
473
+ onClick: (h) => {
474
+ h.stopPropagation(), h.preventDefault(), n.onClick(), w(!1);
471
475
  },
472
476
  children: [
473
477
  n.icon && /* @__PURE__ */ d("span", { className: "size-4", children: n.icon }),
@@ -491,21 +495,21 @@ function De({
491
495
  ...r
492
496
  }) {
493
497
  return /* @__PURE__ */ d(
494
- S,
498
+ K,
495
499
  {
496
500
  variant: "small",
497
501
  as: "h3",
498
- className: m("text-[13px] font-semibold", e),
502
+ className: m("text-sm font-semibold", e),
499
503
  ...r
500
504
  }
501
505
  );
502
506
  }
503
- function he({
507
+ function ve({
504
508
  className: e,
505
509
  ...r
506
510
  }) {
507
511
  return /* @__PURE__ */ d(
508
- S,
512
+ K,
509
513
  {
510
514
  variant: "caption",
511
515
  as: "p",
@@ -521,10 +525,10 @@ export {
521
525
  ge as KanbanBoard,
522
526
  Q as KanbanBoardAccessibility,
523
527
  be as KanbanBoardCard,
524
- he as KanbanBoardCardDescription,
528
+ ve as KanbanBoardCardDescription,
525
529
  De as KanbanBoardCardTitle,
526
- ue as KanbanBoardColumn,
527
- pe as KanbanBoardColumnHeader,
530
+ pe as KanbanBoardColumn,
531
+ ue as KanbanBoardColumnHeader,
528
532
  fe as KanbanBoardColumnList,
529
533
  me as KanbanBoardColumnListItem,
530
534
  T as KanbanBoardContext,