laif-ds 0.2.68 → 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,5 +1,5 @@
1
1
  "use client";
2
- var e = {};
2
+ var e = { exports: {} };
3
3
  export {
4
- e as __exports
4
+ e as __module
5
5
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ var e = {};
3
3
  export {
4
- e as __module
4
+ e as __exports
5
5
  };
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as l, jsxs as a } from "react/jsx-runtime";
3
- import { cva as D } from "../../node_modules/class-variance-authority/dist/index.js";
4
- import { Button as C } from "./button.js";
5
- import { Dialog as b, DialogTrigger as y, DialogContent as z, DialogHeader as j, DialogClose as A, DialogFooter as B } from "./dialog.js";
6
- import { Typo as u } from "./typo.js";
3
+ import { DialogTitle as N, DialogDescription as C } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
4
+ import { cva as b } from "../../node_modules/class-variance-authority/dist/index.js";
5
+ import { Button as y } from "./button.js";
6
+ import { Dialog as z, DialogTrigger as j, DialogContent as T, DialogHeader as A, DialogClose as B, DialogFooter as V } from "./dialog.js";
7
+ import { Typo as d } from "./typo.js";
7
8
  import { cn as s } from "../../lib/utils.js";
8
- const T = D(
9
+ const k = b(
9
10
  [
10
11
  "flex flex-col justify-between gap-2 w-full h-dvh max-w-[initial] p-6",
11
12
  "max-sm:rounded-none max-sm:px-2 max-sm:py-3 max-sm:min-w-full max-sm:min-h-full max-sm:w-full max-sm:h-full max-sm:max-w-full max-sm:max-h-full"
@@ -25,90 +26,90 @@ const T = D(
25
26
  }
26
27
  }
27
28
  );
28
- function E({
29
+ function J({
29
30
  children: o,
30
- trigger: m,
31
+ trigger: e,
31
32
  title: n,
32
- description: e,
33
+ description: m,
33
34
  footer: i,
34
- size: d = "default",
35
- open: f,
35
+ size: u = "default",
36
+ open: r,
36
37
  defaultOpen: c,
37
- onOpenChange: r,
38
- triggerClassName: x,
38
+ onOpenChange: f,
39
+ triggerClassName: t,
39
40
  headerClassName: w,
40
41
  bodyClassName: p,
41
- footerClassName: v,
42
- disabled: t = !1,
43
- asChild: g = !1,
44
- preventClose: V,
42
+ footerClassName: g,
43
+ disabled: x = !1,
44
+ asChild: v = !1,
45
+ preventClose: F,
45
46
  ...h
46
47
  }) {
47
- const N = f !== void 0;
48
- return t ? /* @__PURE__ */ l("div", { className: x, children: m }) : /* @__PURE__ */ a(
49
- b,
48
+ const D = r !== void 0;
49
+ return x ? /* @__PURE__ */ l("div", { className: t, children: e }) : /* @__PURE__ */ a(
50
+ z,
50
51
  {
51
- open: N ? f : void 0,
52
+ open: D ? r : void 0,
52
53
  defaultOpen: c,
53
- onOpenChange: r,
54
+ onOpenChange: f,
54
55
  children: [
55
- m && /* @__PURE__ */ l(
56
- y,
56
+ e && /* @__PURE__ */ l(
57
+ j,
57
58
  {
58
- asChild: g,
59
- className: x,
60
- disabled: t,
61
- children: m
59
+ asChild: v,
60
+ className: t,
61
+ disabled: x,
62
+ children: e
62
63
  }
63
64
  ),
64
65
  /* @__PURE__ */ a(
65
- z,
66
+ T,
66
67
  {
67
68
  ...h,
68
69
  className: s(
69
- T({
70
- size: d
70
+ k({
71
+ size: u
71
72
  }),
72
73
  h.className
73
74
  ),
74
75
  showCloseButton: !1,
75
76
  children: [
76
- /* @__PURE__ */ a(j, { className: s("gap-1", w), children: [
77
+ /* @__PURE__ */ a(A, { className: s("gap-1", w), children: [
77
78
  /* @__PURE__ */ a("div", { className: "flex w-full flex-row items-start gap-2", children: [
78
- /* @__PURE__ */ l(u, { variant: "h5", className: "flex flex-1", children: n }),
79
- /* @__PURE__ */ l(A, { asChild: !0, children: /* @__PURE__ */ l(
80
- C,
79
+ /* @__PURE__ */ l(N, { asChild: !0, children: /* @__PURE__ */ l(d, { variant: "h5", className: "flex flex-1", children: n }) }),
80
+ /* @__PURE__ */ l(B, { asChild: !0, children: /* @__PURE__ */ l(
81
+ y,
81
82
  {
82
83
  iconLeft: "X",
83
84
  variant: "ghost",
84
85
  size: "icon",
85
86
  className: "size-7",
86
- onClick: () => r?.(!1)
87
+ onClick: () => f?.(!1)
87
88
  }
88
89
  ) })
89
90
  ] }),
90
- e && /* @__PURE__ */ l(
91
- u,
91
+ m && /* @__PURE__ */ l(C, { asChild: !0, children: /* @__PURE__ */ l(
92
+ d,
92
93
  {
93
94
  variant: "caption",
94
95
  className: "text-d-secondary-foreground flex flex-1",
95
- children: e
96
+ children: m
96
97
  }
97
- )
98
+ ) })
98
99
  ] }),
99
100
  o && /* @__PURE__ */ l(
100
101
  "div",
101
102
  {
102
103
  className: s(
103
104
  "border-d-border flex min-h-0 w-full flex-1 flex-col gap-2 overflow-auto py-2",
104
- (!!n || !!e) && "border-t",
105
+ (!!n || !!m) && "border-t",
105
106
  !!i && "border-b",
106
107
  p
107
108
  ),
108
109
  children: o
109
110
  }
110
111
  ),
111
- i && /* @__PURE__ */ l(B, { className: v, children: i })
112
+ i && /* @__PURE__ */ l(V, { className: g, children: i })
112
113
  ]
113
114
  }
114
115
  )
@@ -117,7 +118,7 @@ function E({
117
118
  );
118
119
  }
119
120
  export {
120
- E as AppDialog,
121
- A as AppDialogClose,
122
- E as default
121
+ J as AppDialog,
122
+ B as AppDialogClose,
123
+ J as default
123
124
  };
@@ -1,151 +1,194 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as l, Fragment as z } from "react/jsx-runtime";
3
- import { useState as L } from "react";
4
- import { KanbanBoardProvider as H, KanbanBoard as I, KanbanBoardColumn as P, KanbanBoardColumnHeader as S, KanbanBoardColumnList as A, KanbanBoardColumnListItem as F, KanbanBoardCard as J, KanbanBoardCardTitle as R, KanbanBoardCardDescription as W } from "./kanban.js";
5
- import { stringToHexColor as q, hexToRgba as E } from "../../lib/utils.js";
6
- import { Button as G } from "./button.js";
7
- import { Icon as Q } from "./icon.js";
8
- import U from "../../node_modules/lucide-react/dist/esm/icons/plus.js";
9
- function M({
10
- columns: v,
11
- initialTasks: K,
2
+ import { jsx as o, jsxs as l, Fragment as H } from "react/jsx-runtime";
3
+ import { useState as I, useMemo as P } from "react";
4
+ import { KanbanBoardProvider as A, KanbanBoard as F, KanbanBoardColumn as J, KanbanBoardColumnHeader as R, KanbanBoardColumnList as W, KanbanBoardColumnListItem as q, KanbanBoardCard as E, KanbanBoardCardTitle as G, KanbanBoardCardDescription as Q } from "./kanban.js";
5
+ import { stringToHexColor as U, cn as B, hexToRgba as K } from "../../lib/utils.js";
6
+ import { Button as V } from "./button.js";
7
+ import { Icon as X } from "./icon.js";
8
+ import Y from "../../node_modules/lucide-react/dist/esm/icons/lock.js";
9
+ import Z from "../../node_modules/lucide-react/dist/esm/icons/plus.js";
10
+ function ne({
11
+ columns: p,
12
+ initialTasks: w,
12
13
  onTaskMove: m,
13
14
  onTaskEdit: x,
14
- onTaskCreate: u,
15
- taskActions: B,
16
- renderTaskContent: b,
17
- className: y,
18
- allowTaskCreate: j = !0
15
+ onTaskCreate: h,
16
+ taskActions: D,
17
+ renderTaskContent: g,
18
+ className: j,
19
+ allowTaskCreate: z = !0
19
20
  }) {
20
- const [h, N] = L(K), g = (r) => {
21
- const d = {};
22
- for (const e of Object.keys(r))
23
- d[e] = [...r[e]];
24
- return d;
25
- }, w = (r, d) => {
26
- N((e) => {
27
- const o = g(e);
28
- let t, n;
29
- for (const s of Object.keys(o)) {
30
- const c = o[s].findIndex((p) => p.id === r);
21
+ const [N, C] = I(w), b = P(
22
+ () => new Set(p.filter((e) => e.disabled).map((e) => e.id)),
23
+ [p]
24
+ ), y = (e) => {
25
+ const i = {};
26
+ for (const r of Object.keys(e))
27
+ i[r] = [...e[r]];
28
+ return i;
29
+ }, O = (e, i) => {
30
+ C((r) => {
31
+ const d = y(r);
32
+ let a, n;
33
+ for (const s of Object.keys(d)) {
34
+ const c = d[s].findIndex((f) => f.id === e);
31
35
  if (c !== -1) {
32
- n = s, [t] = o[s].splice(c, 1);
36
+ n = s, [a] = d[s].splice(c, 1);
33
37
  break;
34
38
  }
35
39
  }
36
- return !t || n === d ? e : (o[d] || (o[d] = []), o[d].push(t), n && m && m(r, n, d), o);
40
+ return !a || n === i || n && b.has(n) || b.has(i) ? r : (d[i] || (d[i] = []), d[i].push(a), n && m && m(e, n, i), d);
37
41
  });
38
- }, O = (r, d, e, o) => {
39
- N((t) => {
40
- const n = g(t), s = Object.keys(n).find(
41
- (a) => n[a].some((D) => D.id === r)
42
+ }, L = (e, i, r, d) => {
43
+ C((a) => {
44
+ const n = y(a), s = Object.keys(n).find(
45
+ (t) => n[t].some((S) => S.id === e)
42
46
  );
43
- if (!s) return t;
47
+ if (!s) return a;
44
48
  const c = n[s].findIndex(
45
- (a) => a.id === r
49
+ (t) => t.id === e
46
50
  );
47
- if (c === -1) return t;
48
- const [p] = n[s].splice(c, 1);
49
- n[e] || (n[e] = []);
50
- const f = n[e].findIndex(
51
- (a) => a.id === d
51
+ if (c === -1 || b.has(s) || b.has(r))
52
+ return a;
53
+ const [f] = n[s].splice(c, 1);
54
+ n[r] || (n[r] = []);
55
+ const u = n[r].findIndex(
56
+ (t) => t.id === i
52
57
  );
53
- if (f === -1)
54
- n[e].push(p);
58
+ if (u === -1)
59
+ n[r].push(f);
55
60
  else {
56
- const a = o === "top" ? f : f + 1;
57
- n[e].splice(a, 0, p);
61
+ const t = d === "top" ? u : u + 1;
62
+ n[r].splice(t, 0, f);
58
63
  }
59
- return s !== e && m && m(r, s, e), n;
64
+ return s !== r && m && m(e, s, r), n;
60
65
  });
61
- }, C = (r) => JSON.parse(r);
62
- return /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(I, { className: y, children: v.map((r) => {
63
- const d = q(r.label);
66
+ }, v = (e) => JSON.parse(e);
67
+ return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(F, { className: j, children: p.map((e) => {
68
+ const i = U(e.label), r = !!e.disabled;
64
69
  return /* @__PURE__ */ l(
65
- P,
70
+ J,
66
71
  {
67
- columnId: r.id,
68
- onDropOverColumn: (e) => {
69
- const o = C(e);
70
- w(o.id, r.id);
72
+ columnId: e.id,
73
+ disabled: r,
74
+ onDropOverColumn: (d) => {
75
+ if (r) return;
76
+ const a = v(d);
77
+ O(a.id, e.id);
71
78
  },
72
- className: "group/column rounded-xl backdrop-blur-sm transition-colors",
79
+ className: B(
80
+ "group/column relative transition-all duration-200",
81
+ !r && "hover:-translate-y-0.5 hover:shadow-lg"
82
+ ),
73
83
  children: [
74
- /* @__PURE__ */ i(S, { className: "relative mb-1.5 px-1.5 pt-1.5", children: /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between", children: [
84
+ /* @__PURE__ */ o(R, { className: "sticky top-0 z-10 mb-2 rounded-xl border border-d-border/60 bg-d-sidebar/90 px-2.5 py-2 backdrop-blur", children: /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between", children: [
75
85
  /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
76
- /* @__PURE__ */ i(
86
+ /* @__PURE__ */ l(
77
87
  "div",
78
88
  {
79
- className: "flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-semibold",
89
+ className: "flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-semibold shadow-sm",
80
90
  style: {
81
- backgroundColor: E(d, 0.15),
82
- color: d
91
+ backgroundColor: K(i, 0.15),
92
+ color: i,
93
+ borderColor: K(i, 0.35)
83
94
  },
84
- children: /* @__PURE__ */ i("span", { className: "max-w-[150px] truncate", children: r.label })
95
+ children: [
96
+ /* @__PURE__ */ o(
97
+ "span",
98
+ {
99
+ className: "size-1.5 rounded-full",
100
+ style: { backgroundColor: i }
101
+ }
102
+ ),
103
+ /* @__PURE__ */ o("span", { className: "max-w-[150px] truncate", children: e.label })
104
+ ]
85
105
  }
86
106
  ),
87
- /* @__PURE__ */ i("span", { className: "text-d-muted-foreground text-xs", children: h[r.id]?.length ?? 0 })
107
+ /* @__PURE__ */ o("span", { className: "text-d-muted-foreground inline-flex items-center rounded-full border border-d-border/60 bg-d-muted/40 px-2 py-0.5 text-[11px] font-medium", children: N[e.id]?.length ?? 0 })
88
108
  ] }),
89
- /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: j && u && /* @__PURE__ */ i(
90
- G,
91
- {
92
- variant: "ghost",
93
- size: "icon",
94
- className: "text-d-muted-foreground hover:text-d-foreground h-6 w-6",
95
- onClick: () => u(r.id),
96
- children: /* @__PURE__ */ i(U, { className: "size-3.5" })
97
- }
98
- ) })
109
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
110
+ r && /* @__PURE__ */ o(
111
+ "span",
112
+ {
113
+ className: "text-d-muted-foreground inline-flex size-6 items-center justify-center",
114
+ title: "Colonna bloccata",
115
+ "aria-label": "Colonna bloccata",
116
+ children: /* @__PURE__ */ o(Y, { className: "size-3.5" })
117
+ }
118
+ ),
119
+ z && h && /* @__PURE__ */ o(
120
+ V,
121
+ {
122
+ variant: "ghost",
123
+ size: "icon",
124
+ className: "text-d-muted-foreground hover:text-d-foreground h-6 w-6",
125
+ onClick: () => h(e.id),
126
+ children: /* @__PURE__ */ o(Z, { className: "size-3.5" })
127
+ }
128
+ )
129
+ ] })
99
130
  ] }) }),
100
- /* @__PURE__ */ i(A, { className: "px-1 pb-2", children: h[r.id]?.map((e) => /* @__PURE__ */ i(
101
- F,
131
+ /* @__PURE__ */ o(
132
+ W,
102
133
  {
103
- cardId: e.id,
104
- className: "mb-1.5 border-0 last:mb-0",
105
- onDropOverListItem: (o, t) => {
106
- if (t === "none") return;
107
- const n = C(o);
108
- O(
109
- n.id,
110
- e.id,
111
- r.id,
112
- t
113
- );
114
- },
115
- children: /* @__PURE__ */ i(
116
- J,
134
+ className: "px-1.5 pb-3",
135
+ dropDisabled: r,
136
+ children: N[e.id]?.map((d) => /* @__PURE__ */ o(
137
+ q,
117
138
  {
118
- data: e,
119
- className: "group/card hover:border-d-border/40 relative rounded-md border border-transparent shadow-sm transition-all duration-200 hover:shadow-md",
120
- backgroundColor: d,
121
- onEdit: x ? () => x(e, r.id) : void 0,
122
- actions: B?.(e, r.id),
123
- meta: e.meta,
124
- children: b ? b(e, r.id) : /* @__PURE__ */ l(z, { children: [
125
- /* @__PURE__ */ l("div", { className: "mb-1 flex items-start gap-2", children: [
126
- e.icon && /* @__PURE__ */ i(
127
- Q,
128
- {
129
- name: e.icon,
130
- size: "sm",
131
- className: "text-d-muted-foreground mt-0.5 shrink-0"
132
- }
139
+ cardId: d.id,
140
+ dropDisabled: r,
141
+ className: "mb-2 border-0 last:mb-0",
142
+ onDropOverListItem: (a, n) => {
143
+ if (r || n === "none") return;
144
+ const s = v(a);
145
+ L(
146
+ s.id,
147
+ d.id,
148
+ e.id,
149
+ n
150
+ );
151
+ },
152
+ children: /* @__PURE__ */ o(
153
+ E,
154
+ {
155
+ data: d,
156
+ dragDisabled: r,
157
+ className: B(
158
+ "group/card relative rounded-xl border border-transparent shadow-sm transition-all duration-200",
159
+ !r && "hover:-translate-y-0.5 hover:border-d-border/60 hover:shadow-lg"
133
160
  ),
134
- /* @__PURE__ */ i(R, { className: "flex-1 text-sm leading-snug font-medium", children: e.title })
135
- ] }),
136
- e.description && /* @__PURE__ */ i(W, { className: "text-d-muted-foreground mt-1.5 line-clamp-2 text-xs", children: e.description })
137
- ] })
138
- }
139
- )
140
- },
141
- e.id
142
- )) })
161
+ backgroundColor: i,
162
+ onEdit: x ? () => x(d, e.id) : void 0,
163
+ actions: D?.(d, e.id),
164
+ meta: d.meta,
165
+ children: g ? g(d, e.id) : /* @__PURE__ */ l(H, { children: [
166
+ /* @__PURE__ */ l("div", { className: "mb-1 flex items-start gap-2", children: [
167
+ d.icon && /* @__PURE__ */ o(
168
+ X,
169
+ {
170
+ name: d.icon,
171
+ size: "sm",
172
+ className: "text-d-muted-foreground mt-0.5 shrink-0"
173
+ }
174
+ ),
175
+ /* @__PURE__ */ o(G, { className: "flex-1 text-sm leading-snug font-semibold", children: d.title })
176
+ ] }),
177
+ d.description && /* @__PURE__ */ o(Q, { className: "text-d-muted-foreground mt-1.5 line-clamp-2 text-xs leading-relaxed", children: d.description })
178
+ ] })
179
+ }
180
+ )
181
+ },
182
+ d.id
183
+ ))
184
+ }
185
+ )
143
186
  ]
144
187
  },
145
- r.id
188
+ e.id
146
189
  );
147
190
  }) }) });
148
191
  }
149
192
  export {
150
- M as AppKanban
193
+ ne as AppKanban
151
194
  };