laif-ds 0.2.47 → 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.
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 +544 -0
  6. package/dist/components/ui/app-form.js +76 -44
  7. package/dist/components/ui/app-kanban.js +157 -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 +84 -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
@@ -1,35 +1,34 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as r, Fragment as le } from "react/jsx-runtime";
2
+ import { jsxs as s, jsx as l, Fragment as le } from "react/jsx-runtime";
3
3
  import { Badge as re } from "./badge.js";
4
- import { Command as ne, CommandInput as te, CommandList as ae, CommandEmpty as se, CommandGroup as j, CommandItem as B } from "./command.js";
4
+ import { Command as ne, CommandInput as ae, CommandList as te, CommandEmpty as se, CommandGroup as j, CommandItem as M } from "./command.js";
5
5
  import { Label as ie } from "./label.js";
6
- import { cn as y } from "../../lib/utils.js";
6
+ import { cn as w } from "../../lib/utils.js";
7
7
  import { useState as h, useRef as oe, useMemo as N, useCallback as de, useEffect as ce } from "react";
8
- import { Button as D } from "./button.js";
9
8
  import { Checkbox as ue } from "./checkbox.js";
10
- import { Icon as me } from "./icon.js";
11
- import { Popover as fe, PopoverTrigger as he, PopoverContent as pe } from "./popover.js";
12
- import ge from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
13
- const ve = {
9
+ import { Icon as S } from "./icon.js";
10
+ import { Popover as me, PopoverTrigger as fe, PopoverContent as he } from "./popover.js";
11
+ import pe from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
12
+ const ge = {
14
13
  sm: "min-h-8 h-8 text-xs py-1.5",
15
14
  default: "min-h-9 h-9 text-sm py-2",
16
15
  lg: "min-h-10 h-10 text-base py-2"
17
16
  };
18
- function ke(S) {
17
+ function Oe(P) {
19
18
  const {
20
19
  multiple: n = !1,
21
20
  options: m,
22
21
  value: A,
23
- defaultValue: L,
24
- onValueChange: M,
22
+ defaultValue: B,
23
+ onValueChange: R,
25
24
  onClear: p,
26
- placeholder: R = "Seleziona...",
27
- emptyPlaceholder: X = "Nessun risultato",
28
- searchPlaceholder: E = "Cerca...",
29
- addItemPlaceholder: F = "Aggiungi",
25
+ placeholder: X = "Seleziona...",
26
+ emptyPlaceholder: E = "Nessun risultato",
27
+ searchPlaceholder: F = "Cerca...",
28
+ addItemPlaceholder: L = "Aggiungi",
30
29
  itemCountMessage: T = (e) => `${e} elementi selezionati`,
31
30
  maxSelectedMessage: W = (e) => `Puoi selezionare fino a ${e} elementi`,
32
- label: P,
31
+ label: D,
33
32
  className: $ = "",
34
33
  wrpClassName: G = "",
35
34
  searchable: O = !1,
@@ -37,164 +36,178 @@ function ke(S) {
37
36
  groupBy: g = "group",
38
37
  maxSelected: o,
39
38
  showChipsInsteadOfCount: H = !1,
40
- disabled: v,
39
+ disabled: b,
41
40
  size: J = "default",
42
41
  isSingleSelectClearable: K = !1
43
- } = S, [b, x] = h(!1), [d, C] = h(""), w = oe(null), [Q, U] = h(0), V = S.hasOwnProperty("value"), [Y, Z] = h(L), i = V ? A : Y, c = (e) => {
44
- V || Z(e), M?.(e);
45
- }, t = N(() => n ? Array.isArray(i) ? i : [] : i != null ? [i] : [], [i, n]), u = N(() => {
46
- const e = m.filter((a) => t.includes(a.value));
42
+ } = P, [v, x] = h(!1), [d, C] = h(""), y = oe(null), [Q, U] = h(0), V = P.hasOwnProperty("value"), [Y, Z] = h(B), i = V ? A : Y, c = (e) => {
43
+ V || Z(e), R?.(e);
44
+ }, a = N(() => n ? Array.isArray(i) ? i : [] : i != null ? [i] : [], [i, n]), u = N(() => {
45
+ const e = m.filter((t) => a.includes(t.value));
47
46
  if (n) {
48
- const a = t.filter((l) => !e.find((f) => f.value === l)).map((l) => ({ value: l, label: l }));
49
- return [...e, ...a];
50
- } else if (t.length && !e.length)
51
- return [{ value: t[0], label: t[0] }];
47
+ const t = a.filter((r) => !e.find((f) => f.value === r)).map((r) => ({ value: r, label: r }));
48
+ return [...e, ...t];
49
+ } else if (a.length && !e.length)
50
+ return [{ value: a[0], label: a[0] }];
52
51
  return e;
53
- }, [m, t, n]), z = (e) => {
52
+ }, [m, a, n]), z = (e) => {
54
53
  if (!e.disabled)
55
54
  if (n) {
56
- const a = t.includes(e.value);
57
- if (!a && o !== void 0 && t.length >= o)
55
+ const t = a.includes(e.value);
56
+ if (!t && o !== void 0 && a.length >= o)
58
57
  return;
59
58
  c(
60
- a ? t.filter((l) => l !== e.value) : [...t, e.value]
59
+ t ? a.filter((r) => r !== e.value) : [...a, e.value]
61
60
  );
62
61
  } else
63
62
  c(e.value), x(!1);
64
63
  }, k = de(() => {
65
64
  c(n ? [] : void 0), C(""), p && p();
66
65
  }, [c, p, n]), _ = N(() => g ? m.reduce(
67
- (e, a) => {
68
- const l = a[g] || "";
69
- return e[l] = e[l] || [], e[l].push(a), e;
66
+ (e, t) => {
67
+ const r = t[g] || "";
68
+ return e[r] = e[r] || [], e[r].push(t), e;
70
69
  },
71
70
  {}
72
71
  ) : { "": m }, [m, g]);
73
72
  return ce(() => {
74
- b && w.current && U(w.current.getBoundingClientRect().width);
75
- }, [b]), /* @__PURE__ */ s("div", { className: y("flex flex-col gap-2", G), children: [
76
- P && /* @__PURE__ */ r(ie, { children: P }),
73
+ v && y.current && U(y.current.getBoundingClientRect().width);
74
+ }, [v]), /* @__PURE__ */ s("div", { className: w("flex flex-col gap-2", G), children: [
75
+ D && /* @__PURE__ */ l(ie, { children: D }),
77
76
  /* @__PURE__ */ s(
78
- fe,
77
+ me,
79
78
  {
80
- open: v ? !1 : b,
81
- onOpenChange: (e) => !v && x(e),
79
+ open: b ? !1 : v,
80
+ onOpenChange: (e) => !b && x(e),
82
81
  modal: !0,
83
82
  children: [
84
- /* @__PURE__ */ r(he, { asChild: !0, children: /* @__PURE__ */ s(
83
+ /* @__PURE__ */ l(fe, { asChild: !0, children: /* @__PURE__ */ s(
85
84
  "div",
86
85
  {
87
- ref: w,
88
- className: y(
86
+ ref: y,
87
+ className: w(
89
88
  "bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] cursor-pointer items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
90
- ve[J],
91
- v && "cursor-not-allowed opacity-50",
89
+ ge[J],
90
+ b && "cursor-not-allowed opacity-50",
92
91
  $
93
92
  ),
94
93
  children: [
95
- u.length === 0 ? /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: R }) : n ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
96
- /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ r(le, { children: u.map((e) => /* @__PURE__ */ s(
94
+ u.length === 0 ? /* @__PURE__ */ l("span", { className: "text-d-muted-foreground", children: X }) : n ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
95
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ l(le, { children: u.map((e) => /* @__PURE__ */ s(
97
96
  re,
98
97
  {
99
98
  variant: "secondary",
100
99
  className: "hover:bg-d-secondary/100 bg-d-secondary/50 border-d-border flex cursor-pointer items-center gap-1 border",
101
- onClick: (a) => {
102
- a.stopPropagation(), z(e);
100
+ onClick: (t) => {
101
+ t.stopPropagation(), z(e);
103
102
  },
104
103
  children: [
105
104
  e.label,
106
- !e.fixed && /* @__PURE__ */ r(me, { name: "X", size: "xs" })
105
+ !e.fixed && /* @__PURE__ */ l(S, { name: "X", size: "xs" })
107
106
  ]
108
107
  },
109
108
  e.value
110
- )) }) : /* @__PURE__ */ r("div", { children: T(u.length) }) }),
111
- n && /* @__PURE__ */ r(
112
- D,
109
+ )) }) : /* @__PURE__ */ l("div", { children: T(u.length) }) }),
110
+ n && /* @__PURE__ */ l(
111
+ "div",
113
112
  {
114
- className: "h-6 w-6 rounded-full",
115
- iconLeft: "X",
116
- variant: "ghost-destructive",
117
- size: "icon",
113
+ className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
118
114
  onClick: (e) => {
119
115
  e.stopPropagation(), e.preventDefault(), k();
120
- }
116
+ },
117
+ onMouseDown: (e) => e.preventDefault(),
118
+ "aria-label": "Clear selection",
119
+ children: /* @__PURE__ */ l(
120
+ S,
121
+ {
122
+ name: "X",
123
+ size: "xs",
124
+ className: "!text-d-foreground opacity-50"
125
+ }
126
+ )
121
127
  }
122
128
  )
123
129
  ] }) : /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
124
- /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate", children: typeof u[0]?.label == "string" ? /* @__PURE__ */ r("span", { children: u[0]?.label }) : u[0]?.label }),
125
- K && i !== void 0 && i !== null && /* @__PURE__ */ r(
126
- D,
130
+ /* @__PURE__ */ l("div", { className: "min-w-0 flex-1 truncate", children: typeof u[0]?.label == "string" ? /* @__PURE__ */ l("span", { children: u[0]?.label }) : u[0]?.label }),
131
+ K && i !== void 0 && i !== null && /* @__PURE__ */ l(
132
+ "div",
127
133
  {
128
- className: "h-6 w-6 rounded-full",
129
- iconLeft: "X",
130
- variant: "ghost-destructive",
131
- size: "icon",
134
+ className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
132
135
  onClick: (e) => {
133
136
  e.stopPropagation(), e.preventDefault(), k();
134
- }
137
+ },
138
+ onMouseDown: (e) => e.preventDefault(),
139
+ "aria-label": "Clear selection",
140
+ children: /* @__PURE__ */ l(
141
+ S,
142
+ {
143
+ name: "X",
144
+ size: "xs",
145
+ className: "!text-d-foreground opacity-50"
146
+ }
147
+ )
135
148
  }
136
149
  )
137
150
  ] }),
138
- /* @__PURE__ */ r(ge, { className: "h-4 w-4 opacity-50" })
151
+ /* @__PURE__ */ l(pe, { className: "h-4 w-4 opacity-50" })
139
152
  ]
140
153
  }
141
154
  ) }),
142
- /* @__PURE__ */ r(
143
- pe,
155
+ /* @__PURE__ */ l(
156
+ he,
144
157
  {
145
158
  className: "p-0",
146
159
  style: { width: Q },
147
160
  align: "start",
148
161
  sideOffset: 4,
149
162
  children: /* @__PURE__ */ s(ne, { shouldFilter: !!O, className: "w-full", children: [
150
- O && /* @__PURE__ */ r(
151
- te,
163
+ O && /* @__PURE__ */ l(
164
+ ae,
152
165
  {
153
- placeholder: E,
166
+ placeholder: F,
154
167
  className: "placeholder:text-d-muted-foreground",
155
168
  value: d,
156
169
  onValueChange: C
157
170
  }
158
171
  ),
159
- /* @__PURE__ */ s(ae, { className: "max-h-60 overflow-auto overscroll-contain", children: [
160
- /* @__PURE__ */ r(se, { children: X }),
161
- q && d && /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(
162
- B,
172
+ /* @__PURE__ */ s(te, { className: "max-h-60 overflow-auto overscroll-contain", children: [
173
+ /* @__PURE__ */ l(se, { children: E }),
174
+ q && d && /* @__PURE__ */ l(j, { children: /* @__PURE__ */ l(
175
+ M,
163
176
  {
164
177
  className: "cursor-pointer",
165
178
  onSelect: () => {
166
- d && (c(n ? [...t, d] : d), C(""), !n && x(!1));
179
+ d && (c(n ? [...a, d] : d), C(""), !n && x(!1));
167
180
  },
168
181
  children: /* @__PURE__ */ s("div", { className: "text-d-foreground text-xs", children: [
169
- F,
182
+ L,
170
183
  " “",
171
184
  d,
172
185
  "”"
173
186
  ] })
174
187
  }
175
188
  ) }),
176
- Object.entries(_).map(([e, a]) => /* @__PURE__ */ r(j, { heading: e || void 0, children: a.map((l) => {
177
- const f = t.includes(l.value), ee = n && o !== void 0 && !f && t.length >= o, I = l.disabled || ee;
189
+ Object.entries(_).map(([e, t]) => /* @__PURE__ */ l(j, { heading: e || void 0, children: t.map((r) => {
190
+ const f = a.includes(r.value), ee = n && o !== void 0 && !f && a.length >= o, I = r.disabled || ee;
178
191
  return /* @__PURE__ */ s(
179
- B,
192
+ M,
180
193
  {
181
- value: typeof l.label == "string" ? l.label : String(l.value),
182
- onSelect: () => !I && z(l),
183
- className: y(
194
+ value: typeof r.label == "string" ? r.label : String(r.value),
195
+ onSelect: () => !I && z(r),
196
+ className: w(
184
197
  "cursor-pointer",
185
198
  I && "cursor-not-allowed opacity-50",
186
199
  !n && f && "bg-d-accent/75 text-d-accent-foreground"
187
200
  ),
188
201
  children: [
189
- n && /* @__PURE__ */ r(ue, { checked: f, className: "mr-1" }),
190
- typeof l.label == "string" ? /* @__PURE__ */ r("span", { children: l.label }) : l.label
202
+ n && /* @__PURE__ */ l(ue, { checked: f, className: "mr-1" }),
203
+ typeof r.label == "string" ? /* @__PURE__ */ l("span", { children: r.label }) : r.label
191
204
  ]
192
205
  },
193
- l.value
206
+ r.value
194
207
  );
195
208
  }) }, e))
196
209
  ] }),
197
- n && o !== void 0 && t.length >= o && /* @__PURE__ */ r("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: W(o) })
210
+ n && o !== void 0 && a.length >= o && /* @__PURE__ */ l("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: W(o) })
198
211
  ] })
199
212
  }
200
213
  )
@@ -204,5 +217,5 @@ function ke(S) {
204
217
  ] });
205
218
  }
206
219
  export {
207
- ke as AppSelect
220
+ Oe as AppSelect
208
221
  };