laif-ds 0.2.48 → 0.2.50
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/kanban.js +90 -85
- package/dist/components/ui/app-kanban.js +128 -114
- package/dist/components/ui/app-radio-group.js +62 -48
- package/dist/components/ui/app-select.js +93 -90
- package/dist/components/ui/async-select.js +134 -126
- package/dist/components/ui/badge.js +38 -31
- package/dist/components/ui/button.js +49 -40
- package/dist/components/ui/card.js +36 -28
- package/dist/components/ui/checkbox.js +23 -20
- package/dist/components/ui/date-picker.js +64 -59
- package/dist/components/ui/dialog.js +54 -42
- package/dist/components/ui/input.js +116 -111
- package/dist/components/ui/popover.js +15 -13
- package/dist/components/ui/radio-group.js +29 -27
- package/dist/components/ui/select.js +74 -67
- package/dist/components/ui/sheet.js +39 -28
- package/dist/components/ui/slider.js +34 -28
- package/dist/components/ui/switch.js +16 -13
- package/dist/components/ui/tabs.js +35 -26
- package/dist/components/ui/textarea.js +26 -17
- package/dist/index.d.ts +4 -1
- package/dist/lib/design-tokens.js +43 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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 =
|
|
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
|
-
|
|
18
|
+
O(() => (i(e), () => {
|
|
19
19
|
t(e);
|
|
20
20
|
}), [e, i, t]);
|
|
21
21
|
}
|
|
22
22
|
function B() {
|
|
23
|
-
const e =
|
|
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
|
-
),
|
|
31
|
+
), c = b(
|
|
32
32
|
(a, o) => {
|
|
33
33
|
t("onDragMove", a, o);
|
|
34
34
|
},
|
|
35
35
|
[t]
|
|
36
|
-
),
|
|
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
|
-
),
|
|
42
|
+
), p = b(
|
|
43
43
|
(a, o) => {
|
|
44
44
|
t("onDragEnd", a, o);
|
|
45
45
|
},
|
|
46
46
|
[t]
|
|
47
|
-
),
|
|
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:
|
|
57
|
-
onDragOver:
|
|
58
|
-
onDragEnd:
|
|
59
|
-
onDragCancel:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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] =
|
|
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:
|
|
127
|
-
if (
|
|
128
|
-
|
|
126
|
+
const { announce: s, announcement: c } = G(), l = E(), [p, u] = y(!1);
|
|
127
|
+
if (O(() => {
|
|
128
|
+
u(!0);
|
|
129
129
|
}, []), J(
|
|
130
|
-
|
|
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
|
-
), !
|
|
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:
|
|
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(),
|
|
169
|
+
const s = E(), c = R([]), l = R(""), p = b(
|
|
170
170
|
(g) => {
|
|
171
|
-
|
|
171
|
+
c.current.push(g);
|
|
172
172
|
},
|
|
173
173
|
[]
|
|
174
|
-
),
|
|
174
|
+
), u = b(
|
|
175
175
|
(g) => {
|
|
176
|
-
|
|
177
|
-
(
|
|
176
|
+
c.current = c.current.filter(
|
|
177
|
+
(v) => v !== g
|
|
178
178
|
);
|
|
179
179
|
},
|
|
180
180
|
[]
|
|
181
181
|
), a = b(
|
|
182
|
-
(g,
|
|
183
|
-
for (const N of
|
|
184
|
-
const
|
|
185
|
-
|
|
182
|
+
(g, v, C) => {
|
|
183
|
+
for (const N of c.current) {
|
|
184
|
+
const w = N[g];
|
|
185
|
+
w && w(v, C);
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
188
|
[]
|
|
189
|
-
), o =
|
|
189
|
+
), o = M(
|
|
190
190
|
() => ({
|
|
191
|
-
activeIdRef:
|
|
191
|
+
activeIdRef: l,
|
|
192
192
|
draggableDescribedById: s,
|
|
193
|
-
registerMonitor:
|
|
194
|
-
unregisterMonitor:
|
|
193
|
+
registerMonitor: p,
|
|
194
|
+
unregisterMonitor: u,
|
|
195
195
|
triggerEvent: a
|
|
196
196
|
}),
|
|
197
197
|
[
|
|
198
|
-
|
|
198
|
+
l,
|
|
199
199
|
s,
|
|
200
|
-
u,
|
|
201
200
|
p,
|
|
201
|
+
u,
|
|
202
202
|
a
|
|
203
203
|
]
|
|
204
204
|
);
|
|
@@ -238,22 +238,22 @@ function ge({
|
|
|
238
238
|
}
|
|
239
239
|
);
|
|
240
240
|
}
|
|
241
|
-
const U = "w-80 flex-shrink-0 rounded-lg border flex flex-col border-d-border bg-d-sidebar py-
|
|
242
|
-
function
|
|
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({
|
|
243
243
|
className: e,
|
|
244
244
|
columnId: r,
|
|
245
245
|
onDropOverColumn: i,
|
|
246
246
|
ref: t,
|
|
247
247
|
...s
|
|
248
248
|
}) {
|
|
249
|
-
const [
|
|
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
|
-
|
|
256
|
+
c && "border-d-primary border-2 bg-d-primary/5",
|
|
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
|
-
|
|
264
|
+
l(!1);
|
|
265
265
|
},
|
|
266
266
|
onDragOver: (a) => {
|
|
267
|
-
a.dataTransfer.types.includes(x.CARD) && (a.preventDefault(),
|
|
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(),
|
|
271
|
+
a.preventDefault(), l(!1);
|
|
272
272
|
const o = a.dataTransfer.getData(x.CARD);
|
|
273
|
-
i?.(o),
|
|
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
|
|
281
|
+
function ue({
|
|
282
282
|
className: e,
|
|
283
283
|
ref: r,
|
|
284
284
|
...i
|
|
@@ -314,50 +314,50 @@ function me({
|
|
|
314
314
|
ref: t,
|
|
315
315
|
...s
|
|
316
316
|
}) {
|
|
317
|
-
const [
|
|
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
|
-
|
|
324
|
-
|
|
323
|
+
c === "top" && "border-t-d-primary !border-t-[3px]",
|
|
324
|
+
c === "bottom" && "border-b-d-primary !border-b-[3px]",
|
|
325
325
|
r
|
|
326
326
|
),
|
|
327
327
|
onDragLeave: () => {
|
|
328
|
-
|
|
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
|
-
|
|
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,
|
|
340
|
+
i?.(o, c), u(JSON.parse(o).id, e), l("none");
|
|
341
341
|
},
|
|
342
342
|
ref: t,
|
|
343
343
|
...s
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
const Z = "p-
|
|
347
|
+
const Z = "p-2.5 text-start";
|
|
348
348
|
function be({
|
|
349
349
|
className: e,
|
|
350
350
|
data: r,
|
|
351
351
|
isActive: i = !1,
|
|
352
352
|
onEdit: t,
|
|
353
353
|
actions: s,
|
|
354
|
-
meta:
|
|
355
|
-
backgroundColor:
|
|
356
|
-
ref:
|
|
357
|
-
children:
|
|
354
|
+
meta: c,
|
|
355
|
+
backgroundColor: l,
|
|
356
|
+
ref: p,
|
|
357
|
+
children: u,
|
|
358
358
|
...a
|
|
359
359
|
}) {
|
|
360
|
-
const [o, g] =
|
|
360
|
+
const [o, g] = y(!1), [v, C] = y(!1), { draggableDescribedById: N, onDragStart: w } = 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),
|
|
375
|
-
f.style.position = "absolute", f.style.top = "-9999px", f.style.width = `${
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(),
|
|
377
|
+
h.width / 2,
|
|
378
|
+
h.height / 2
|
|
379
|
+
), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), w(r.id);
|
|
380
380
|
},
|
|
381
381
|
onDragEnd: () => {
|
|
382
382
|
g(!1);
|
|
@@ -389,31 +389,36 @@ function be({
|
|
|
389
389
|
},
|
|
390
390
|
className: m(
|
|
391
391
|
"border-d-border text-d-card-foreground rounded-lg border shadow-sm",
|
|
392
|
-
!
|
|
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
|
-
o ? "cursor-grabbing active:cursor-grabbing" : "group/card relative",
|
|
395
|
+
o ? "cursor-grabbing active:cursor-grabbing opacity-40" : "group/card relative",
|
|
396
396
|
i && "rotate-1 transform shadow-lg",
|
|
397
397
|
e
|
|
398
398
|
),
|
|
399
399
|
style: {
|
|
400
|
-
backgroundColor:
|
|
401
|
-
borderColor:
|
|
400
|
+
backgroundColor: l ? `${l}18` : void 0,
|
|
401
|
+
borderColor: l ? `${l}35` : void 0,
|
|
402
402
|
...a.style
|
|
403
403
|
},
|
|
404
|
-
ref:
|
|
404
|
+
ref: p,
|
|
405
405
|
...a,
|
|
406
406
|
children: [
|
|
407
|
-
|
|
408
|
-
|
|
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: "
|
|
411
|
+
className: "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]",
|
|
412
|
+
style: {
|
|
413
|
+
backgroundColor: void 0,
|
|
414
|
+
color: void 0,
|
|
415
|
+
borderColor: l ? `${l}40` : void 0
|
|
416
|
+
},
|
|
412
417
|
children: [
|
|
413
|
-
/* @__PURE__ */ d("span", { className: "
|
|
418
|
+
/* @__PURE__ */ d("span", { className: "truncate font-medium", children: n.name }),
|
|
414
419
|
n.value && /* @__PURE__ */ D(A, { children: [
|
|
415
|
-
/* @__PURE__ */ d("span", { className: "
|
|
416
|
-
/* @__PURE__ */ d("span", { className: "truncate", children: n.value })
|
|
420
|
+
/* @__PURE__ */ d("span", { className: "opacity-60", children: "•" }),
|
|
421
|
+
/* @__PURE__ */ d("span", { className: "truncate opacity-80", children: n.value })
|
|
417
422
|
] })
|
|
418
423
|
]
|
|
419
424
|
},
|
|
@@ -424,7 +429,7 @@ function be({
|
|
|
424
429
|
{
|
|
425
430
|
className: m(
|
|
426
431
|
"bg-d-card border-d-border absolute top-2 right-2 items-center gap-1 rounded-md border p-0.5 shadow-sm",
|
|
427
|
-
|
|
432
|
+
v ? "flex" : "hidden group-focus-within/card:flex group-hover/card:flex"
|
|
428
433
|
),
|
|
429
434
|
children: [
|
|
430
435
|
t && /* @__PURE__ */ d(
|
|
@@ -439,7 +444,7 @@ function be({
|
|
|
439
444
|
children: /* @__PURE__ */ d(F, { className: "size-3.5" })
|
|
440
445
|
}
|
|
441
446
|
),
|
|
442
|
-
s && s.length > 0 && /* @__PURE__ */ D(z, { open:
|
|
447
|
+
s && s.length > 0 && /* @__PURE__ */ D(z, { open: v, onOpenChange: C, children: [
|
|
443
448
|
/* @__PURE__ */ d(L, { asChild: !0, children: /* @__PURE__ */ d(
|
|
444
449
|
P,
|
|
445
450
|
{
|
|
@@ -466,8 +471,8 @@ function be({
|
|
|
466
471
|
variant: n.variant === "destructive" ? "ghost-destructive" : "ghost",
|
|
467
472
|
size: "sm",
|
|
468
473
|
className: "w-full justify-start gap-2",
|
|
469
|
-
onClick: (
|
|
470
|
-
|
|
474
|
+
onClick: (h) => {
|
|
475
|
+
h.stopPropagation(), h.preventDefault(), n.onClick(), C(!1);
|
|
471
476
|
},
|
|
472
477
|
children: [
|
|
473
478
|
n.icon && /* @__PURE__ */ d("span", { className: "size-4", children: n.icon }),
|
|
@@ -491,21 +496,21 @@ function De({
|
|
|
491
496
|
...r
|
|
492
497
|
}) {
|
|
493
498
|
return /* @__PURE__ */ d(
|
|
494
|
-
|
|
499
|
+
k,
|
|
495
500
|
{
|
|
496
501
|
variant: "small",
|
|
497
502
|
as: "h3",
|
|
498
|
-
className: m("text-
|
|
503
|
+
className: m("text-sm font-semibold", e),
|
|
499
504
|
...r
|
|
500
505
|
}
|
|
501
506
|
);
|
|
502
507
|
}
|
|
503
|
-
function
|
|
508
|
+
function ve({
|
|
504
509
|
className: e,
|
|
505
510
|
...r
|
|
506
511
|
}) {
|
|
507
512
|
return /* @__PURE__ */ d(
|
|
508
|
-
|
|
513
|
+
k,
|
|
509
514
|
{
|
|
510
515
|
variant: "caption",
|
|
511
516
|
as: "p",
|
|
@@ -521,10 +526,10 @@ export {
|
|
|
521
526
|
ge as KanbanBoard,
|
|
522
527
|
Q as KanbanBoardAccessibility,
|
|
523
528
|
be as KanbanBoardCard,
|
|
524
|
-
|
|
529
|
+
ve as KanbanBoardCardDescription,
|
|
525
530
|
De as KanbanBoardCardTitle,
|
|
526
|
-
|
|
527
|
-
|
|
531
|
+
pe as KanbanBoardColumn,
|
|
532
|
+
ue as KanbanBoardColumnHeader,
|
|
528
533
|
fe as KanbanBoardColumnList,
|
|
529
534
|
me as KanbanBoardColumnListItem,
|
|
530
535
|
T as KanbanBoardContext,
|