laif-ds 0.2.69 → 0.2.70

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,69 +1,69 @@
1
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 M, createContext as $, useState as y, useEffect as O, useContext as S } from "react";
4
- import { createPortal as I } from "react-dom";
5
- import { Button as P } from "./button.js";
6
- import { Popover as z, PopoverTrigger as L, PopoverContent as _ } from "./popover.js";
7
- import { TooltipProvider as j } from "./tooltip.js";
8
- import { Typo as k } from "./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 = S(T);
2
+ import { jsx as p, jsxs as C, Fragment as K } from "react/jsx-runtime";
3
+ import { useId as $, useRef as P, useCallback as h, useMemo as S, createContext as V, useState as w, useLayoutEffect as q, useEffect as E, useContext as _ } from "react";
4
+ import { createPortal as U } from "react-dom";
5
+ import { Button as O } from "./button.js";
6
+ import { Popover as W, PopoverTrigger as Y, PopoverContent as J } from "./popover.js";
7
+ import { TooltipProvider as G } from "./tooltip.js";
8
+ import { Typo as z } from "./typo.js";
9
+ import { cn as D } from "../../lib/utils.js";
10
+ import X from "../../node_modules/lucide-react/dist/esm/icons/pencil.js";
11
+ import Q from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js";
12
+ const M = V(void 0);
13
+ function Z(e) {
14
+ const r = _(M);
15
15
  if (!r)
16
16
  throw new Error("useDndMonitor must be used within a DndMonitorProvider");
17
- const { registerMonitor: i, unregisterMonitor: t } = r;
18
- O(() => (i(e), () => {
17
+ const { registerMonitor: l, unregisterMonitor: t } = r;
18
+ E(() => (l(e), () => {
19
19
  t(e);
20
- }), [e, i, t]);
20
+ }), [e, l, t]);
21
21
  }
22
- function B() {
23
- const e = S(T);
22
+ function L() {
23
+ const e = _(M);
24
24
  if (!e)
25
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);
26
+ const { activeIdRef: r, draggableDescribedById: l, triggerEvent: t } = e, u = h(
27
+ (i) => {
28
+ r.current = i, t("onDragStart", i);
29
29
  },
30
30
  [t, r]
31
- ), c = b(
32
- (a, o) => {
33
- t("onDragMove", a, o);
31
+ ), d = h(
32
+ (i, n) => {
33
+ t("onDragMove", i, n);
34
34
  },
35
35
  [t]
36
- ), l = b(
37
- (a, o) => {
38
- const g = a || r.current;
39
- t("onDragOver", g, o);
36
+ ), g = h(
37
+ (i, n) => {
38
+ const c = i || r.current;
39
+ t("onDragOver", c, n);
40
40
  },
41
41
  [t, r]
42
- ), p = b(
43
- (a, o) => {
44
- t("onDragEnd", a, o);
42
+ ), a = h(
43
+ (i, n) => {
44
+ t("onDragEnd", i, n);
45
45
  },
46
46
  [t]
47
- ), u = b(
48
- (a) => {
49
- t("onDragCancel", a);
47
+ ), m = h(
48
+ (i) => {
49
+ t("onDragCancel", i);
50
50
  },
51
51
  [t]
52
52
  );
53
53
  return {
54
- draggableDescribedById: i,
55
- onDragStart: s,
56
- onDragMove: c,
57
- onDragOver: l,
58
- onDragEnd: p,
59
- onDragCancel: u
54
+ draggableDescribedById: l,
55
+ onDragStart: u,
56
+ onDragMove: d,
57
+ onDragOver: g,
58
+ onDragEnd: a,
59
+ onDragCancel: m
60
60
  };
61
61
  }
62
- const V = `
62
+ const ee = `
63
63
  To pick up a draggable item, press the space bar.
64
64
  While dragging, use the arrow keys to move the item.
65
65
  Press space again to drop the item in its new position, or press escape to cancel.
66
- `, Y = {
66
+ `, re = {
67
67
  onDragStart(e) {
68
68
  return `Picked up draggable item ${e}.`;
69
69
  },
@@ -77,409 +77,538 @@ Press space again to drop the item in its new position, or press escape to cance
77
77
  return `Dragging was cancelled. Draggable item ${e} was dropped.`;
78
78
  }
79
79
  };
80
- function W({
80
+ function te({
81
81
  announcement: e,
82
82
  ariaLiveType: r = "assertive",
83
- className: i,
83
+ className: l,
84
84
  id: t,
85
- ref: s,
86
- ...c
85
+ ref: u,
86
+ ...d
87
87
  }) {
88
- return /* @__PURE__ */ d(
88
+ return /* @__PURE__ */ p(
89
89
  "div",
90
90
  {
91
91
  "aria-live": r,
92
92
  "aria-atomic": !0,
93
- className: m(
93
+ className: D(
94
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
95
+ l
96
96
  ),
97
97
  id: t,
98
- ref: s,
98
+ ref: u,
99
99
  role: "status",
100
- ...c,
100
+ ...d,
101
101
  children: e
102
102
  }
103
103
  );
104
104
  }
105
- function q({
105
+ function ne({
106
106
  id: e,
107
107
  value: r,
108
- className: i,
108
+ className: l,
109
109
  ref: t,
110
- ...s
110
+ ...u
111
111
  }) {
112
- return /* @__PURE__ */ d("div", { id: e, className: m("hidden", i), ref: t, ...s, children: r });
112
+ return /* @__PURE__ */ p("div", { id: e, className: D("hidden", l), ref: t, ...u, children: r });
113
113
  }
114
- function G() {
115
- const [e, r] = y("");
116
- return { announce: b((t) => {
114
+ function oe() {
115
+ const [e, r] = w("");
116
+ return { announce: h((t) => {
117
117
  t != null && r(t);
118
118
  }, []), announcement: e };
119
119
  }
120
- const Q = ({
121
- announcements: e = Y,
120
+ const ae = ({
121
+ announcements: e = re,
122
122
  container: r,
123
- hiddenTextDescribedById: i,
124
- screenReaderInstructions: t = V
123
+ hiddenTextDescribedById: l,
124
+ screenReaderInstructions: t = ee
125
125
  }) => {
126
- const { announce: s, announcement: c } = G(), l = E(), [p, u] = y(!1);
127
- if (O(() => {
128
- u(!0);
129
- }, []), J(
130
- M(
126
+ const { announce: u, announcement: d } = oe(), g = $(), [a, m] = w(!1);
127
+ if (E(() => {
128
+ m(!0);
129
+ }, []), Z(
130
+ S(
131
131
  () => ({
132
- onDragStart(o) {
133
- s(e.onDragStart(o));
132
+ onDragStart(n) {
133
+ u(e.onDragStart(n));
134
134
  },
135
- onDragMove(o, g) {
136
- e.onDragMove && s(e.onDragMove(o, g));
135
+ onDragMove(n, c) {
136
+ e.onDragMove && u(e.onDragMove(n, c));
137
137
  },
138
- onDragOver(o, g) {
139
- s(e.onDragOver(o, g));
138
+ onDragOver(n, c) {
139
+ u(e.onDragOver(n, c));
140
140
  },
141
- onDragEnd(o, g) {
142
- s(e.onDragEnd(o, g));
141
+ onDragEnd(n, c) {
142
+ u(e.onDragEnd(n, c));
143
143
  },
144
- onDragCancel(o) {
145
- s(e.onDragCancel(o));
144
+ onDragCancel(n) {
145
+ u(e.onDragCancel(n));
146
146
  }
147
147
  }),
148
- [s, e]
148
+ [u, e]
149
149
  )
150
- ), !p)
150
+ ), !a)
151
151
  return null;
152
- const a = /* @__PURE__ */ D(A, { children: [
153
- /* @__PURE__ */ d(
154
- q,
152
+ const i = /* @__PURE__ */ C(K, { children: [
153
+ /* @__PURE__ */ p(
154
+ ne,
155
155
  {
156
- id: i,
156
+ id: l,
157
157
  value: t
158
158
  }
159
159
  ),
160
- /* @__PURE__ */ d(W, { id: l, announcement: c })
160
+ /* @__PURE__ */ p(te, { id: g, announcement: d })
161
161
  ] });
162
- return r ? I(a, r) : a;
163
- }, ce = ({
162
+ return r ? U(i, r) : i;
163
+ }, ve = ({
164
164
  announcements: e,
165
165
  screenReaderInstructions: r,
166
- container: i,
166
+ container: l,
167
167
  children: t
168
168
  }) => {
169
- const s = E(), c = R([]), l = R(""), p = b(
170
- (g) => {
171
- c.current.push(g);
169
+ const u = $(), d = P([]), g = P(""), a = h(
170
+ (c) => {
171
+ d.current.push(c);
172
172
  },
173
173
  []
174
- ), u = b(
175
- (g) => {
176
- c.current = c.current.filter(
177
- (v) => v !== g
174
+ ), m = h(
175
+ (c) => {
176
+ d.current = d.current.filter(
177
+ (f) => f !== c
178
178
  );
179
179
  },
180
180
  []
181
- ), a = b(
182
- (g, v, C) => {
183
- for (const N of c.current) {
184
- const w = N[g];
185
- w && w(v, C);
181
+ ), i = h(
182
+ (c, f, y) => {
183
+ for (const T of d.current) {
184
+ const s = T[c];
185
+ s && s(f, y);
186
186
  }
187
187
  },
188
188
  []
189
- ), o = M(
189
+ ), n = S(
190
190
  () => ({
191
- activeIdRef: l,
192
- draggableDescribedById: s,
193
- registerMonitor: p,
194
- unregisterMonitor: u,
195
- triggerEvent: a
191
+ activeIdRef: g,
192
+ draggableDescribedById: u,
193
+ registerMonitor: a,
194
+ unregisterMonitor: m,
195
+ triggerEvent: i
196
196
  }),
197
197
  [
198
- l,
199
- s,
200
- p,
198
+ g,
201
199
  u,
202
- a
200
+ a,
201
+ m,
202
+ i
203
203
  ]
204
204
  );
205
- return /* @__PURE__ */ d(j, { children: /* @__PURE__ */ D(T.Provider, { value: o, children: [
205
+ return /* @__PURE__ */ p(G, { children: /* @__PURE__ */ C(M.Provider, { value: n, children: [
206
206
  t,
207
- /* @__PURE__ */ d(
208
- Q,
207
+ /* @__PURE__ */ p(
208
+ ae,
209
209
  {
210
210
  announcements: e,
211
211
  screenReaderInstructions: r,
212
- container: i,
213
- hiddenTextDescribedById: s
212
+ container: l,
213
+ hiddenTextDescribedById: u
214
214
  }
215
215
  )
216
216
  ] }) });
217
- }, x = {
217
+ }, N = {
218
218
  CARD: "kanban-board-card"
219
- };
220
- function ge({
219
+ }, A = 48, H = 28;
220
+ function I(e, r) {
221
+ e && (typeof e == "function" ? e(r) : e.current = r);
222
+ }
223
+ function j(e) {
224
+ const r = e.dataTransfer?.types;
225
+ return r ? Array.from(r).includes(N.CARD) : !1;
226
+ }
227
+ function F(e, r, l) {
228
+ const t = e.getBoundingClientRect(), u = r === "x" ? t.left : t.top, d = r === "x" ? t.right : t.bottom, g = l - u, a = d - l, m = r === "x" ? "scrollLeft" : "scrollTop", i = r === "x" ? e.scrollWidth - e.clientWidth : e.scrollHeight - e.clientHeight, n = e[m];
229
+ if (g < A && n > 0) {
230
+ const c = H * ((A - g) / A);
231
+ e[m] = n - Math.ceil(c);
232
+ return;
233
+ }
234
+ if (a < A && n < i) {
235
+ const c = H * ((A - a) / A);
236
+ e[m] = n + Math.ceil(c);
237
+ }
238
+ }
239
+ function xe({
221
240
  className: e,
222
241
  ref: r,
223
- ...i
242
+ onDragOverCapture: l,
243
+ style: t,
244
+ ...u
224
245
  }) {
225
- return /* @__PURE__ */ d(
246
+ const d = P(null), [g, a] = w(null), m = P(null), i = P(null), n = h((s) => {
247
+ m.current !== s && (m.current = s, a(s));
248
+ }, []), c = h(() => {
249
+ const s = d.current;
250
+ if (!s) return;
251
+ if (t && Object.prototype.hasOwnProperty.call(
252
+ t,
253
+ "--kanban-column-min-height"
254
+ )) {
255
+ n(null);
256
+ return;
257
+ }
258
+ if (Array.from(
259
+ s.querySelectorAll('[data-kanban-column-list="true"]')
260
+ ).some(
261
+ (k) => k.scrollHeight > k.clientHeight + 1
262
+ )) {
263
+ n(null);
264
+ return;
265
+ }
266
+ const o = Array.from(
267
+ s.querySelectorAll('[data-kanban-column="true"]')
268
+ );
269
+ if (!o.length) {
270
+ n(null);
271
+ return;
272
+ }
273
+ const b = s.style.getPropertyValue(
274
+ "--kanban-column-min-height"
275
+ );
276
+ b && s.style.setProperty("--kanban-column-min-height", "0px");
277
+ let x = 0;
278
+ for (const k of o)
279
+ x = Math.max(x, k.scrollHeight);
280
+ b && s.style.setProperty("--kanban-column-min-height", b);
281
+ const B = Math.ceil(x);
282
+ n(Number.isFinite(B) && B > 0 ? B : 0);
283
+ }, [n, t]), f = h(() => {
284
+ i.current === null && (i.current = requestAnimationFrame(() => {
285
+ i.current = null, c();
286
+ }));
287
+ }, [c]);
288
+ q(() => {
289
+ f();
290
+ }, [f]), E(() => {
291
+ const s = d.current;
292
+ if (!s) return;
293
+ const v = () => f(), R = new ResizeObserver(v);
294
+ R.observe(s);
295
+ const o = new MutationObserver(v);
296
+ return o.observe(s, { childList: !0, subtree: !0 }), window.addEventListener("resize", v), () => {
297
+ R.disconnect(), o.disconnect(), window.removeEventListener("resize", v), i.current !== null && cancelAnimationFrame(i.current);
298
+ };
299
+ }, [f]);
300
+ const y = h(
301
+ (s) => {
302
+ j(s) && d.current && F(d.current, "x", s.clientX), l?.(s);
303
+ },
304
+ [l]
305
+ ), T = S(() => {
306
+ const s = t ? { ...t } : void 0, v = s && Object.prototype.hasOwnProperty.call(
307
+ s,
308
+ "--kanban-column-min-height"
309
+ );
310
+ return !v && g && s && (s["--kanban-column-min-height"] = `${g}px`), !v && g && !s ? {
311
+ "--kanban-column-min-height": `${g}px`
312
+ } : s;
313
+ }, [g, t]);
314
+ return /* @__PURE__ */ p(
226
315
  "div",
227
316
  {
228
- className: m(
229
- "flex h-full flex-grow items-start gap-x-2 overflow-x-auto py-1 select-none",
317
+ className: D(
318
+ "relative flex h-full w-full flex-1 items-stretch gap-x-4 overflow-x-auto py-2 pr-2 select-none",
230
319
  e
231
320
  ),
321
+ "data-kanban-board": "true",
232
322
  draggable: !1,
233
- onDragStart: (t) => {
234
- t.preventDefault(), t.stopPropagation();
323
+ onDragStart: (s) => {
324
+ s.preventDefault(), s.stopPropagation();
235
325
  },
236
- ref: r,
237
- ...i
326
+ onDragOverCapture: y,
327
+ ref: (s) => {
328
+ d.current = s, I(r, s);
329
+ },
330
+ style: T,
331
+ ...u
238
332
  }
239
333
  );
240
334
  }
241
- const U = "w-80 flex-shrink-0 rounded-lg border flex flex-col border-d-border bg-d-sidebar py-1.5";
242
- function pe({
335
+ const se = "relative flex h-full min-w-[16rem] flex-[1_0_18rem] flex-col rounded-2xl border border-d-border/60 bg-d-sidebar/80 p-1.5 shadow-sm backdrop-blur transition-colors min-h-[var(--kanban-column-min-height,0px)]";
336
+ function ye({
243
337
  className: e,
244
338
  columnId: r,
245
- onDropOverColumn: i,
246
- ref: t,
247
- ...s
339
+ disabled: l = !1,
340
+ onDropOverColumn: t,
341
+ ref: u,
342
+ ...d
248
343
  }) {
249
- const [c, l] = y(!1), { onDragEnd: p, onDragOver: u } = B();
250
- return /* @__PURE__ */ d(
344
+ const [g, a] = w(!1), [m, i] = w(!1), { onDragEnd: n, onDragOver: c } = L();
345
+ return /* @__PURE__ */ p(
251
346
  "section",
252
347
  {
253
348
  "aria-labelledby": `column-${r}-title`,
254
- className: m(
255
- U,
256
- c && "border-d-primary border-2 bg-d-primary/5",
349
+ className: D(
350
+ se,
351
+ g && "border-d-primary/80 bg-d-primary/10 ring-2 ring-d-primary/30",
352
+ m && "border-d-destructive/70 bg-d-destructive/10 ring-2 ring-d-destructive/20",
257
353
  e
258
354
  ),
355
+ "aria-disabled": l,
356
+ "data-kanban-column": "true",
259
357
  draggable: !1,
260
- onDragStart: (a) => {
261
- a.preventDefault(), a.stopPropagation();
358
+ onDragStart: (f) => {
359
+ f.preventDefault(), f.stopPropagation();
262
360
  },
263
361
  onDragLeave: () => {
264
- l(!1);
362
+ a(!1), i(!1);
265
363
  },
266
- onDragOver: (a) => {
267
- a.dataTransfer.types.includes(x.CARD) && (a.preventDefault(), l(!0), u("", r));
364
+ onDragOver: (f) => {
365
+ if (f.dataTransfer.types.includes(N.CARD)) {
366
+ if (l) {
367
+ a(!1), i(!0);
368
+ return;
369
+ }
370
+ f.preventDefault(), i(!1), a(!0), c("", r);
371
+ }
268
372
  },
269
- onDrop: (a) => {
270
- if (a.dataTransfer.types.includes(x.CARD)) {
271
- a.preventDefault(), l(!1);
272
- const o = a.dataTransfer.getData(x.CARD);
273
- i?.(o), p("", r);
373
+ onDrop: (f) => {
374
+ if (f.dataTransfer.types.includes(N.CARD)) {
375
+ if (l) {
376
+ a(!1), i(!1);
377
+ return;
378
+ }
379
+ f.preventDefault(), a(!1), i(!1);
380
+ const y = f.dataTransfer.getData(N.CARD);
381
+ t?.(y), n("", r);
274
382
  }
275
383
  },
276
- ref: t,
277
- ...s
384
+ ref: u,
385
+ ...d
278
386
  }
279
387
  );
280
388
  }
281
- function ue({
389
+ function Ce({
282
390
  className: e,
283
391
  ref: r,
284
- ...i
392
+ ...l
285
393
  }) {
286
- return /* @__PURE__ */ d(
394
+ return /* @__PURE__ */ p(
287
395
  "div",
288
396
  {
289
- className: m("flex items-center justify-between px-2 py-1", e),
397
+ className: D("flex items-center justify-between px-2 py-1", e),
290
398
  ref: r,
291
- ...i
399
+ ...l
292
400
  }
293
401
  );
294
402
  }
295
- function fe({
403
+ function we({
296
404
  className: e,
297
405
  ref: r,
298
- ...i
406
+ dropDisabled: l = !1,
407
+ onDragOverCapture: t,
408
+ ...u
299
409
  }) {
300
- return /* @__PURE__ */ d(
410
+ const d = P(null), g = h(
411
+ (a) => {
412
+ if (l) {
413
+ t?.(a);
414
+ return;
415
+ }
416
+ j(a) && d.current && F(d.current, "y", a.clientY), t?.(a);
417
+ },
418
+ [l, t]
419
+ );
420
+ return /* @__PURE__ */ p(
301
421
  "ul",
302
422
  {
303
- className: m("min-h-0.5 flex-grow overflow-y-auto", e),
304
- ref: r,
305
- ...i
423
+ className: D("min-h-0 flex-1 overflow-y-auto", e),
424
+ "data-kanban-column-list": "true",
425
+ onDragOverCapture: g,
426
+ ref: (a) => {
427
+ d.current = a, I(r, a);
428
+ },
429
+ ...u
306
430
  }
307
431
  );
308
432
  }
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({
433
+ const ie = "-mb-[2px] rounded-xl border-b-2 border-t-2 border-b-transparent border-t-transparent px-2 py-1 last:mb-0 transition-colors";
434
+ function Ne({
311
435
  cardId: e,
312
436
  className: r,
313
- onDropOverListItem: i,
314
- ref: t,
315
- ...s
437
+ dropDisabled: l = !1,
438
+ onDropOverListItem: t,
439
+ ref: u,
440
+ ...d
316
441
  }) {
317
- const [c, l] = y("none"), { onDragOver: p, onDragEnd: u } = B();
318
- return /* @__PURE__ */ d(
442
+ const [g, a] = w("none"), { onDragOver: m, onDragEnd: i } = L();
443
+ return /* @__PURE__ */ p(
319
444
  "li",
320
445
  {
321
- className: m(
322
- X,
323
- c === "top" && "border-t-d-primary !border-t-[3px]",
324
- c === "bottom" && "border-b-d-primary !border-b-[3px]",
446
+ className: D(
447
+ ie,
448
+ g === "top" && "border-t-d-primary !border-t-[3px]",
449
+ g === "bottom" && "border-b-d-primary !border-b-[3px]",
325
450
  r
326
451
  ),
327
452
  onDragLeave: () => {
328
- l("none");
453
+ a("none");
329
454
  },
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
- l(a.clientY <= g ? "top" : "bottom"), p("", e);
455
+ onDragOver: (n) => {
456
+ if (!l && n.dataTransfer.types.includes(N.CARD)) {
457
+ n.preventDefault(), n.stopPropagation();
458
+ const c = n.currentTarget.getBoundingClientRect(), f = (c.top + c.bottom) / 2;
459
+ a(n.clientY <= f ? "top" : "bottom"), m("", e);
335
460
  }
336
461
  },
337
- onDrop: (a) => {
338
- a.stopPropagation();
339
- const o = a.dataTransfer.getData(x.CARD);
340
- i?.(o, c), u(JSON.parse(o).id, e), l("none");
462
+ onDrop: (n) => {
463
+ if (l) return;
464
+ n.stopPropagation();
465
+ const c = n.dataTransfer.getData(N.CARD);
466
+ t?.(c, g), i(JSON.parse(c).id, e), a("none");
341
467
  },
342
- ref: t,
343
- ...s
468
+ ref: u,
469
+ ...d
344
470
  }
345
471
  );
346
472
  }
347
- const Z = "p-2.5 text-start";
348
- function be({
473
+ const le = "p-2.5 text-start";
474
+ function Te({
349
475
  className: e,
350
476
  data: r,
351
- isActive: i = !1,
352
- onEdit: t,
353
- actions: s,
354
- meta: c,
355
- backgroundColor: l,
356
- ref: p,
357
- children: u,
358
- ...a
477
+ isActive: l = !1,
478
+ dragDisabled: t = !1,
479
+ onEdit: u,
480
+ actions: d,
481
+ meta: g,
482
+ backgroundColor: a,
483
+ ref: m,
484
+ children: i,
485
+ ...n
359
486
  }) {
360
- const [o, g] = y(!1), [v, C] = y(!1), { draggableDescribedById: N, onDragStart: w } = B(), K = t || s && s.length > 0;
361
- return /* @__PURE__ */ D(
487
+ const [c, f] = w(!1), [y, T] = w(!1), { draggableDescribedById: s, onDragStart: v } = L(), R = u || d && d.length > 0;
488
+ return /* @__PURE__ */ C(
362
489
  "div",
363
490
  {
364
491
  role: "button",
365
492
  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,
493
+ "aria-describedby": t ? void 0 : s,
494
+ "aria-roledescription": t ? void 0 : "draggable",
495
+ draggable: !t,
496
+ onDragStart: (o) => {
497
+ if (t) {
498
+ o.preventDefault(), o.stopPropagation();
499
+ return;
500
+ }
501
+ o.stopPropagation(), f(!0), o.dataTransfer.effectAllowed = "move", o.dataTransfer.setData(
502
+ N.CARD,
372
503
  JSON.stringify(r)
373
504
  );
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
- f,
377
- h.width / 2,
378
- h.height / 2
379
- ), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), w(r.id);
505
+ const b = o.currentTarget.cloneNode(!0), x = o.currentTarget.getBoundingClientRect();
506
+ b.style.position = "absolute", b.style.top = "-9999px", b.style.width = `${x.width}px`, b.style.opacity = "0.8", document.body.appendChild(b), o.dataTransfer.setDragImage(
507
+ b,
508
+ x.width / 2,
509
+ x.height / 2
510
+ ), setTimeout(() => document.body.removeChild(b), 0), o.currentTarget.blur(), v(r.id);
380
511
  },
381
512
  onDragEnd: () => {
382
- g(!1);
513
+ f(!1);
383
514
  },
384
- onClick: (n) => {
385
- o && (n.preventDefault(), n.stopPropagation());
515
+ onClick: (o) => {
516
+ c && (o.preventDefault(), o.stopPropagation());
386
517
  },
387
- onKeyDown: (n) => {
388
- (n.key === "Enter" || n.key === " ") && n.preventDefault();
518
+ onKeyDown: (o) => {
519
+ (o.key === "Enter" || o.key === " ") && o.preventDefault();
389
520
  },
390
- className: m(
391
- "border-d-border text-d-card-foreground rounded-lg border shadow-sm",
392
- !l && "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 opacity-40" : "group/card relative",
396
- i && "rotate-1 transform shadow-lg",
521
+ className: D(
522
+ "border-d-border text-d-card-foreground rounded-xl border shadow-sm",
523
+ !a && "bg-d-card/95",
524
+ le,
525
+ "focus-visible:ring-d-ring inline-flex w-full touch-manipulation flex-col gap-2 transition-all duration-200 focus-visible:ring-1 focus-visible:outline-none",
526
+ t ? "group/card relative cursor-default" : c ? "cursor-grabbing active:cursor-grabbing opacity-40" : "group/card relative cursor-grab hover:-translate-y-0.5 hover:shadow-lg",
527
+ l && "rotate-1 transform shadow-lg",
397
528
  e
398
529
  ),
399
530
  style: {
400
- backgroundColor: l ? `${l}18` : void 0,
401
- borderColor: l ? `${l}35` : void 0,
402
- ...a.style
531
+ backgroundColor: a ? `${a}18` : void 0,
532
+ borderColor: a ? `${a}35` : void 0,
533
+ ...n.style
403
534
  },
404
- ref: p,
405
- ...a,
535
+ ref: m,
536
+ ...n,
406
537
  children: [
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(
538
+ i,
539
+ g && g.length > 0 && /* @__PURE__ */ p("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: g.map((o, b) => /* @__PURE__ */ C(
409
540
  "div",
410
541
  {
411
- className: "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]",
542
+ className: "text-d-muted-foreground inline-flex items-center gap-1 rounded-full border bg-d-muted/40 px-2 py-0.5 text-[11px]",
412
543
  style: {
413
- backgroundColor: void 0,
414
- color: void 0,
415
- borderColor: l ? `${l}40` : void 0
544
+ borderColor: a ? `${a}40` : void 0
416
545
  },
417
546
  children: [
418
- /* @__PURE__ */ d("span", { className: "truncate font-medium", children: n.name }),
419
- n.value && /* @__PURE__ */ D(A, { children: [
420
- /* @__PURE__ */ d("span", { className: "opacity-60", children: "•" }),
421
- /* @__PURE__ */ d("span", { className: "truncate opacity-80", children: n.value })
547
+ /* @__PURE__ */ p("span", { className: "truncate font-medium", children: o.name }),
548
+ o.value && /* @__PURE__ */ C(K, { children: [
549
+ /* @__PURE__ */ p("span", { className: "opacity-60", children: "•" }),
550
+ /* @__PURE__ */ p("span", { className: "truncate opacity-80", children: o.value })
422
551
  ] })
423
552
  ]
424
553
  },
425
- f
554
+ b
426
555
  )) }),
427
- K && !o && /* @__PURE__ */ D(
556
+ R && !c && /* @__PURE__ */ C(
428
557
  "div",
429
558
  {
430
- className: m(
559
+ className: D(
431
560
  "bg-d-card border-d-border absolute top-2 right-2 items-center gap-1 rounded-md border p-0.5 shadow-sm",
432
- v ? "flex" : "hidden group-focus-within/card:flex group-hover/card:flex"
561
+ y ? "flex" : "hidden group-focus-within/card:flex group-hover/card:flex"
433
562
  ),
434
563
  children: [
435
- t && /* @__PURE__ */ d(
436
- P,
564
+ u && /* @__PURE__ */ p(
565
+ O,
437
566
  {
438
567
  variant: "ghost",
439
568
  size: "icon",
440
569
  className: "hover:bg-d-accent size-6",
441
- onClick: (n) => {
442
- n.stopPropagation(), n.preventDefault(), o || t();
570
+ onClick: (o) => {
571
+ o.stopPropagation(), o.preventDefault(), c || u();
443
572
  },
444
- children: /* @__PURE__ */ d(F, { className: "size-3.5" })
573
+ children: /* @__PURE__ */ p(X, { className: "size-3.5" })
445
574
  }
446
575
  ),
447
- s && s.length > 0 && /* @__PURE__ */ D(z, { open: v, onOpenChange: C, children: [
448
- /* @__PURE__ */ d(L, { asChild: !0, children: /* @__PURE__ */ d(
449
- P,
576
+ d && d.length > 0 && /* @__PURE__ */ C(W, { open: y, onOpenChange: T, children: [
577
+ /* @__PURE__ */ p(Y, { asChild: !0, children: /* @__PURE__ */ p(
578
+ O,
450
579
  {
451
580
  variant: "ghost",
452
581
  size: "icon",
453
582
  className: "hover:bg-d-accent size-6",
454
- onClick: (n) => {
455
- n.stopPropagation();
583
+ onClick: (o) => {
584
+ o.stopPropagation();
456
585
  },
457
- children: /* @__PURE__ */ d(H, { className: "size-3.5" })
586
+ children: /* @__PURE__ */ p(Q, { className: "size-3.5" })
458
587
  }
459
588
  ) }),
460
- /* @__PURE__ */ d(
461
- _,
589
+ /* @__PURE__ */ p(
590
+ J,
462
591
  {
463
592
  className: "w-48 p-1",
464
593
  align: "end",
465
594
  side: "bottom",
466
595
  sideOffset: 8,
467
- onClick: (n) => n.stopPropagation(),
468
- children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5", children: s.map((n, f) => /* @__PURE__ */ D(
469
- P,
596
+ onClick: (o) => o.stopPropagation(),
597
+ children: /* @__PURE__ */ p("div", { className: "flex flex-col gap-0.5", children: d.map((o, b) => /* @__PURE__ */ C(
598
+ O,
470
599
  {
471
- variant: n.variant === "destructive" ? "ghost-destructive" : "ghost",
600
+ variant: o.variant === "destructive" ? "ghost-destructive" : "ghost",
472
601
  size: "sm",
473
602
  className: "w-full justify-start gap-2",
474
- onClick: (h) => {
475
- h.stopPropagation(), h.preventDefault(), n.onClick(), C(!1);
603
+ onClick: (x) => {
604
+ x.stopPropagation(), x.preventDefault(), o.onClick(), T(!1);
476
605
  },
477
606
  children: [
478
- n.icon && /* @__PURE__ */ d("span", { className: "size-4", children: n.icon }),
479
- n.label
607
+ o.icon && /* @__PURE__ */ p("span", { className: "size-4", children: o.icon }),
608
+ o.label
480
609
  ]
481
610
  },
482
- f
611
+ b
483
612
  )) })
484
613
  }
485
614
  )
@@ -491,30 +620,30 @@ function be({
491
620
  }
492
621
  );
493
622
  }
494
- function De({
623
+ function Ae({
495
624
  className: e,
496
625
  ...r
497
626
  }) {
498
- return /* @__PURE__ */ d(
499
- k,
627
+ return /* @__PURE__ */ p(
628
+ z,
500
629
  {
501
630
  variant: "small",
502
631
  as: "h3",
503
- className: m("text-sm font-semibold", e),
632
+ className: D("text-sm font-semibold", e),
504
633
  ...r
505
634
  }
506
635
  );
507
636
  }
508
- function ve({
637
+ function Pe({
509
638
  className: e,
510
639
  ...r
511
640
  }) {
512
- return /* @__PURE__ */ d(
513
- k,
641
+ return /* @__PURE__ */ p(
642
+ z,
514
643
  {
515
644
  variant: "caption",
516
645
  as: "p",
517
- className: m(
646
+ className: D(
518
647
  "text-d-muted-foreground leading-relaxed whitespace-pre-wrap",
519
648
  e
520
649
  ),
@@ -523,23 +652,23 @@ function ve({
523
652
  );
524
653
  }
525
654
  export {
526
- ge as KanbanBoard,
527
- Q as KanbanBoardAccessibility,
528
- be as KanbanBoardCard,
529
- ve as KanbanBoardCardDescription,
530
- De as KanbanBoardCardTitle,
531
- pe as KanbanBoardColumn,
532
- ue as KanbanBoardColumnHeader,
533
- fe as KanbanBoardColumnList,
534
- me as KanbanBoardColumnListItem,
535
- T as KanbanBoardContext,
536
- q as KanbanBoardHiddenText,
537
- W as KanbanBoardLiveRegion,
538
- ce as KanbanBoardProvider,
539
- Y as defaultAnnouncements,
540
- V as defaultScreenReaderInstructions,
541
- U as kanbanBoardColumnClassNames,
542
- X as kanbanBoardColumnListItemClassNames,
543
- G as useAnnouncement,
544
- B as useDndEvents
655
+ xe as KanbanBoard,
656
+ ae as KanbanBoardAccessibility,
657
+ Te as KanbanBoardCard,
658
+ Pe as KanbanBoardCardDescription,
659
+ Ae as KanbanBoardCardTitle,
660
+ ye as KanbanBoardColumn,
661
+ Ce as KanbanBoardColumnHeader,
662
+ we as KanbanBoardColumnList,
663
+ Ne as KanbanBoardColumnListItem,
664
+ M as KanbanBoardContext,
665
+ ne as KanbanBoardHiddenText,
666
+ te as KanbanBoardLiveRegion,
667
+ ve as KanbanBoardProvider,
668
+ re as defaultAnnouncements,
669
+ ee as defaultScreenReaderInstructions,
670
+ se as kanbanBoardColumnClassNames,
671
+ ie as kanbanBoardColumnListItemClassNames,
672
+ oe as useAnnouncement,
673
+ L as useDndEvents
545
674
  };