laif-ds 0.1.32 → 0.1.33

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 (52) hide show
  1. package/dist/components/ui/accordion.js +2 -7
  2. package/dist/components/ui/alert-dialog.js +10 -37
  3. package/dist/components/ui/alert.js +1 -5
  4. package/dist/components/ui/app-multiple-select-dropdown.js +120 -116
  5. package/dist/components/ui/app-select.js +9 -1
  6. package/dist/components/ui/app-sidebar.js +9 -23
  7. package/dist/components/ui/aspect-ratio.js +1 -3
  8. package/dist/components/ui/async-select.js +80 -64
  9. package/dist/components/ui/audio-visualizer.js +3 -2
  10. package/dist/components/ui/button.js +45 -5
  11. package/dist/components/ui/card.js +7 -2
  12. package/dist/components/ui/charts/circular.js +1 -1
  13. package/dist/components/ui/chat-message.js +34 -16
  14. package/dist/components/ui/chat.js +4 -4
  15. package/dist/components/ui/command.js +1 -1
  16. package/dist/components/ui/data-cross-table.js +32 -8
  17. package/dist/components/ui/data-table.js +4 -4
  18. package/dist/components/ui/date-picker.js +2 -2
  19. package/dist/components/ui/dropdown-menu.js +7 -7
  20. package/dist/components/ui/file-preview.js +9 -9
  21. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +25 -3
  22. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +32 -13
  23. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +7 -1
  24. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +6 -1
  25. package/dist/components/ui/gantt/components/Chart/Chart.js +19 -3
  26. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +80 -71
  27. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -54
  28. package/dist/components/ui/gantt/components/Controls/Controls.js +4 -2
  29. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +11 -1
  30. package/dist/components/ui/gantt/utils/getWholeWidth.js +4 -1
  31. package/dist/components/ui/gantt/utils/transformData.js +7 -4
  32. package/dist/components/ui/input-selector.js +5 -2
  33. package/dist/components/ui/input.js +41 -46
  34. package/dist/components/ui/interrupt-prompt.js +2 -2
  35. package/dist/components/ui/markdown-renderer.js +2 -2
  36. package/dist/components/ui/message-input.js +12 -10
  37. package/dist/components/ui/multiple-selector.js +44 -31
  38. package/dist/components/ui/prompt-suggestions.js +2 -2
  39. package/dist/components/ui/resizable.js +1 -1
  40. package/dist/components/ui/select.js +6 -10
  41. package/dist/components/ui/sidebar.js +27 -19
  42. package/dist/components/ui/slider.js +103 -89
  43. package/dist/components/ui/table-skeleton.js +29 -11
  44. package/dist/components/ui/table.js +4 -1
  45. package/dist/components/ui/tabs.js +1 -1
  46. package/dist/components/ui/theme-switcher.js +2 -7
  47. package/dist/components/ui/typing-indicator.js +4 -4
  48. package/dist/components/ui/typo.js +1 -8
  49. package/dist/hooks/use-mobile.js +3 -1
  50. package/dist/index.d.ts +7 -7
  51. package/dist/styles.css +1 -1
  52. package/package.json +3 -1
@@ -3,15 +3,10 @@ import { jsx as t, jsxs as a } from "react/jsx-runtime";
3
3
  import { Root as i, Item as s, Header as d, Trigger as c, Content as l } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
4
4
  import { cn as r } from "../../lib/utils.js";
5
5
  import m from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
6
- function b({
7
- ...e
8
- }) {
6
+ function b({ ...e }) {
9
7
  return /* @__PURE__ */ t(i, { "data-slot": "accordion", ...e });
10
8
  }
11
- function x({
12
- className: e,
13
- ...o
14
- }) {
9
+ function x({ className: e, ...o }) {
15
10
  return /* @__PURE__ */ t(
16
11
  s,
17
12
  {
@@ -3,25 +3,16 @@ import { jsx as e, jsxs as r } from "react/jsx-runtime";
3
3
  import { Root as n, Trigger as i, Content as s, Title as d, Description as c, Action as g, Cancel as u, Portal as f, Overlay as m } from "../../node_modules/@radix-ui/react-alert-dialog/dist/index.js";
4
4
  import { cn as o } from "../../lib/utils.js";
5
5
  import { buttonVariants as l } from "./button.js";
6
- function b({
7
- ...t
8
- }) {
6
+ function b({ ...t }) {
9
7
  return /* @__PURE__ */ e(n, { "data-slot": "alert-dialog", ...t });
10
8
  }
11
- function y({
12
- ...t
13
- }) {
9
+ function y({ ...t }) {
14
10
  return /* @__PURE__ */ e(i, { "data-slot": "alert-dialog-trigger", ...t });
15
11
  }
16
- function p({
17
- ...t
18
- }) {
12
+ function p({ ...t }) {
19
13
  return /* @__PURE__ */ e(f, { "data-slot": "alert-dialog-portal", ...t });
20
14
  }
21
- function x({
22
- className: t,
23
- ...a
24
- }) {
15
+ function x({ className: t, ...a }) {
25
16
  return /* @__PURE__ */ e(
26
17
  m,
27
18
  {
@@ -34,10 +25,7 @@ function x({
34
25
  }
35
26
  );
36
27
  }
37
- function T({
38
- className: t,
39
- ...a
40
- }) {
28
+ function T({ className: t, ...a }) {
41
29
  return /* @__PURE__ */ r(p, { children: [
42
30
  /* @__PURE__ */ e(x, {}),
43
31
  /* @__PURE__ */ e(
@@ -53,10 +41,7 @@ function T({
53
41
  )
54
42
  ] });
55
43
  }
56
- function w({
57
- className: t,
58
- ...a
59
- }) {
44
+ function w({ className: t, ...a }) {
60
45
  return /* @__PURE__ */ e(
61
46
  "div",
62
47
  {
@@ -66,10 +51,7 @@ function w({
66
51
  }
67
52
  );
68
53
  }
69
- function C({
70
- className: t,
71
- ...a
72
- }) {
54
+ function C({ className: t, ...a }) {
73
55
  return /* @__PURE__ */ e(
74
56
  "div",
75
57
  {
@@ -82,10 +64,7 @@ function C({
82
64
  }
83
65
  );
84
66
  }
85
- function z({
86
- className: t,
87
- ...a
88
- }) {
67
+ function z({ className: t, ...a }) {
89
68
  return /* @__PURE__ */ e(
90
69
  d,
91
70
  {
@@ -108,10 +87,7 @@ function h({
108
87
  }
109
88
  );
110
89
  }
111
- function j({
112
- className: t,
113
- ...a
114
- }) {
90
+ function j({ className: t, ...a }) {
115
91
  return /* @__PURE__ */ e(
116
92
  g,
117
93
  {
@@ -120,10 +96,7 @@ function j({
120
96
  }
121
97
  );
122
98
  }
123
- function O({
124
- className: t,
125
- ...a
126
- }) {
99
+ function O({ className: t, ...a }) {
127
100
  return /* @__PURE__ */ e(
128
101
  u,
129
102
  {
@@ -16,11 +16,7 @@ const d = i(
16
16
  }
17
17
  }
18
18
  );
19
- function o({
20
- className: t,
21
- variant: r,
22
- ...s
23
- }) {
19
+ function o({ className: t, variant: r, ...s }) {
24
20
  return /* @__PURE__ */ e(
25
21
  "div",
26
22
  {
@@ -38,138 +38,142 @@ function ne({
38
38
  document.removeEventListener("mousedown", e);
39
39
  };
40
40
  }, [c]);
41
- const S = a.useCallback((e) => {
42
- if (t.includes(e))
43
- i(t.filter((n) => n !== e));
44
- else {
45
- if (s && t.length >= s)
46
- return;
47
- i([...t, e]);
48
- }
49
- }, [t, i, s]), w = a.useCallback(() => {
41
+ const S = a.useCallback(
42
+ (e) => {
43
+ if (t.includes(e))
44
+ i(t.filter((n) => n !== e));
45
+ else {
46
+ if (s && t.length >= s)
47
+ return;
48
+ i([...t, e]);
49
+ }
50
+ },
51
+ [t, i, s]
52
+ ), w = a.useCallback(() => {
50
53
  i([]), v("");
51
54
  }, [i]), u = a.useMemo(() => o.filter((e) => t.includes(e.value)), [o, t]), j = a.useMemo(() => m ? o.filter(
52
55
  (e) => e.label.toLowerCase().includes(m.toLowerCase())
53
56
  ) : o, [o, m]), x = a.useMemo(() => s ? t.length >= s : !1, [t, s]);
54
57
  return /* @__PURE__ */ r(T.Provider, { value: { size: d, id: f }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
55
- g && /* @__PURE__ */ r(
56
- B,
58
+ g && /* @__PURE__ */ r(B, { htmlFor: f, className: y, children: g }),
59
+ /* @__PURE__ */ l(
60
+ "div",
57
61
  {
58
- htmlFor: f,
59
- className: y,
60
- children: g
61
- }
62
- ),
63
- /* @__PURE__ */ l("div", { ref: h, className: "relative w-full", "data-slot": "app-multiple-select-dropdown", children: [
64
- /* @__PURE__ */ l(
65
- p,
66
- {
67
- id: f,
68
- type: "button",
69
- variant: "outline",
70
- role: "combobox",
71
- "aria-expanded": c,
72
- disabled: k,
73
- className: N(
74
- "relative w-full justify-between font-normal border",
75
- "flex items-center whitespace-nowrap rounded-md border border-d-input bg-transparent shadow-sm ring-offset-background focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
76
- "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
77
- d === "default" && "h-9 px-3 py-2 text-sm",
78
- d === "sm" && "h-8 px-2 py-1 text-xs",
79
- d === "lg" && "h-10 px-4 py-2 text-lg",
80
- M
62
+ ref: h,
63
+ className: "relative w-full",
64
+ "data-slot": "app-multiple-select-dropdown",
65
+ children: [
66
+ /* @__PURE__ */ l(
67
+ p,
68
+ {
69
+ id: f,
70
+ type: "button",
71
+ variant: "outline",
72
+ role: "combobox",
73
+ "aria-expanded": c,
74
+ disabled: k,
75
+ className: N(
76
+ "relative w-full justify-between border font-normal",
77
+ "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
78
+ "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
79
+ d === "default" && "h-9 px-3 py-2 text-sm",
80
+ d === "sm" && "h-8 px-2 py-1 text-xs",
81
+ d === "lg" && "h-10 px-4 py-2 text-lg",
82
+ M
83
+ ),
84
+ onClick: () => b(!c),
85
+ children: [
86
+ /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(R, { children: [
87
+ /* @__PURE__ */ l(
88
+ D,
89
+ {
90
+ variant: "secondary",
91
+ className: "flex items-center gap-1",
92
+ children: [
93
+ /* @__PURE__ */ r("span", { children: u.length }),
94
+ u.length === 1 ? " elemento selezionato" : " elementi selezionati"
95
+ ]
96
+ }
97
+ ),
98
+ /* @__PURE__ */ l(
99
+ p,
100
+ {
101
+ variant: "ghost",
102
+ size: "sm",
103
+ className: "hover:bg-d-secondary/20 h-5 w-5 rounded-full p-0",
104
+ onClick: (e) => {
105
+ e.stopPropagation(), w();
106
+ },
107
+ children: [
108
+ /* @__PURE__ */ r(J, { className: "h-3 w-3" }),
109
+ /* @__PURE__ */ r("span", { className: "sr-only", children: E })
110
+ ]
111
+ }
112
+ )
113
+ ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: C }) }),
114
+ /* @__PURE__ */ r(K, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
115
+ ]
116
+ }
81
117
  ),
82
- onClick: () => b(!c),
83
- children: [
84
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 w-full overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(R, { children: [
85
- /* @__PURE__ */ l(
86
- D,
118
+ c && /* @__PURE__ */ r("div", { className: "absolute z-50 mt-1 w-full", children: /* @__PURE__ */ l(F, { className: "bg-d-popover w-full rounded-md shadow-md", children: [
119
+ /* @__PURE__ */ l("div", { className: "flex items-center border-b px-3", children: [
120
+ /* @__PURE__ */ r(
121
+ H,
87
122
  {
88
- variant: "secondary",
89
- className: "flex items-center gap-1",
90
- children: [
91
- /* @__PURE__ */ r("span", { children: u.length }),
92
- u.length === 1 ? " elemento selezionato" : " elementi selezionati"
93
- ]
123
+ iconLeft: "Search",
124
+ placeholder: z,
125
+ value: m,
126
+ onChange: (e) => v(e.target.value),
127
+ className: "w-full !border-0 !border-none shadow-none !outline-none focus-visible:ring-0"
94
128
  }
95
129
  ),
96
- /* @__PURE__ */ l(
130
+ u.length > 0 && /* @__PURE__ */ r(
97
131
  p,
98
132
  {
99
133
  variant: "ghost",
100
134
  size: "sm",
101
- className: "h-5 w-5 p-0 hover:bg-d-secondary/20 rounded-full",
102
- onClick: (e) => {
103
- e.stopPropagation(), w();
104
- },
105
- children: [
106
- /* @__PURE__ */ r(J, { className: "h-3 w-3" }),
107
- /* @__PURE__ */ r("span", { className: "sr-only", children: E })
108
- ]
135
+ className: "h-6 px-2 text-xs",
136
+ onClick: w,
137
+ children: O
109
138
  }
110
139
  )
111
- ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: C }) }),
112
- /* @__PURE__ */ r(K, { className: "h-4 w-4 opacity-50 shrink-0 ml-1" })
113
- ]
114
- }
115
- ),
116
- c && /* @__PURE__ */ r("div", { className: "absolute z-50 w-full mt-1", children: /* @__PURE__ */ l(F, { className: "w-full rounded-md shadow-md bg-d-popover", children: [
117
- /* @__PURE__ */ l("div", { className: "flex items-center px-3 border-b", children: [
118
- /* @__PURE__ */ r(
119
- H,
120
- {
121
- iconLeft: "Search",
122
- placeholder: z,
123
- value: m,
124
- onChange: (e) => v(e.target.value),
125
- className: "w-full !border-0 !border-none !outline-none focus-visible:ring-0 shadow-none"
126
- }
127
- ),
128
- u.length > 0 && /* @__PURE__ */ r(
129
- p,
130
- {
131
- variant: "ghost",
132
- size: "sm",
133
- className: "h-6 px-2 text-xs",
134
- onClick: w,
135
- children: O
136
- }
137
- )
138
- ] }),
139
- /* @__PURE__ */ l(P, { className: "w-full max-h-60 overflow-auto", children: [
140
- /* @__PURE__ */ r(G, { children: L }),
141
- /* @__PURE__ */ r(X, { children: j.map((e) => {
142
- const n = t.includes(e.value);
143
- return /* @__PURE__ */ l(
144
- q,
145
- {
146
- value: e.value,
147
- disabled: e.disabled || !n && x,
148
- onSelect: () => S(e.value),
149
- className: N(
150
- "flex items-center gap-2 px-2 py-1.5 aria-selected:bg-d-accent aria-selected:text-d-accent-foreground cursor-pointer",
151
- (e.disabled || !n && x) && "cursor-not-allowed opacity-50"
152
- ),
153
- children: [
154
- /* @__PURE__ */ r(
155
- I,
156
- {
157
- checked: n,
158
- className: "flex-shrink-0 mr-2",
159
- onCheckedChange: () => {
160
- }
161
- }
162
- ),
163
- /* @__PURE__ */ r("span", { className: "truncate flex-1", children: e.label }),
164
- n && /* @__PURE__ */ r(Q, { className: "h-4 w-4 flex-shrink-0 ml-auto text-d-primary" })
165
- ]
166
- },
167
- e.value
168
- );
169
- }) })
170
- ] })
171
- ] }) })
172
- ] })
140
+ ] }),
141
+ /* @__PURE__ */ l(P, { className: "max-h-60 w-full overflow-auto", children: [
142
+ /* @__PURE__ */ r(G, { children: L }),
143
+ /* @__PURE__ */ r(X, { children: j.map((e) => {
144
+ const n = t.includes(e.value);
145
+ return /* @__PURE__ */ l(
146
+ q,
147
+ {
148
+ value: e.value,
149
+ disabled: e.disabled || !n && x,
150
+ onSelect: () => S(e.value),
151
+ className: N(
152
+ "aria-selected:bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
153
+ (e.disabled || !n && x) && "cursor-not-allowed opacity-50"
154
+ ),
155
+ children: [
156
+ /* @__PURE__ */ r(
157
+ I,
158
+ {
159
+ checked: n,
160
+ className: "mr-2 flex-shrink-0",
161
+ onCheckedChange: () => {
162
+ }
163
+ }
164
+ ),
165
+ /* @__PURE__ */ r("span", { className: "flex-1 truncate", children: e.label }),
166
+ n && /* @__PURE__ */ r(Q, { className: "text-d-primary ml-auto h-4 w-4 flex-shrink-0" })
167
+ ]
168
+ },
169
+ e.value
170
+ );
171
+ }) })
172
+ ] })
173
+ ] }) })
174
+ ]
175
+ }
176
+ )
173
177
  ] }) });
174
178
  }
175
179
  export {
@@ -12,7 +12,15 @@ function b({
12
12
  }) {
13
13
  return /* @__PURE__ */ o(n, { ...a, label: r, children: [
14
14
  p || /* @__PURE__ */ l(s, { className: S, children: /* @__PURE__ */ l(u, { placeholder: c }) }),
15
- /* @__PURE__ */ l(i, { children: t.map((e) => /* @__PURE__ */ l(A, { value: String(e.value), disabled: e.disabled, children: e.label }, e.value)) })
15
+ /* @__PURE__ */ l(i, { children: t.map((e) => /* @__PURE__ */ l(
16
+ A,
17
+ {
18
+ value: String(e.value),
19
+ disabled: e.disabled,
20
+ children: e.label
21
+ },
22
+ e.value
23
+ )) })
16
24
  ] });
17
25
  }
18
26
  export {
@@ -36,7 +36,7 @@ function T({
36
36
  a,
37
37
  {
38
38
  href: l ? "#" : e.url,
39
- className: "flex items-center justify-between gap-2 w-full",
39
+ className: "flex w-full items-center justify-between gap-2",
40
40
  onClick: l ? n : void 0,
41
41
  ...S,
42
42
  children: c
@@ -45,7 +45,7 @@ function T({
45
45
  "a",
46
46
  {
47
47
  href: l ? "#" : e.url,
48
- className: "flex items-center justify-between gap-2 w-full",
48
+ className: "flex w-full items-center justify-between gap-2",
49
49
  onClick: l ? n : void 0,
50
50
  children: c
51
51
  }
@@ -55,29 +55,15 @@ function T({
55
55
  e.iconName && /* @__PURE__ */ t(h, { name: e.iconName, size: "xs" }),
56
56
  /* @__PURE__ */ t("span", { children: e.title })
57
57
  ] });
58
- return a ? /* @__PURE__ */ t(
59
- G,
60
- {
61
- isActive: e.isActive,
62
- asChild: !0,
63
- children: /* @__PURE__ */ t(
64
- a,
65
- {
66
- href: e.url,
67
- className: "flex items-center gap-2 w-full",
68
- ...S,
69
- children: s
70
- }
71
- )
72
- }
73
- ) : /* @__PURE__ */ t(
74
- G,
58
+ return a ? /* @__PURE__ */ t(G, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
59
+ a,
75
60
  {
76
- isActive: e.isActive,
77
- asChild: !0,
78
- children: /* @__PURE__ */ t("a", { href: e.url, className: "flex items-center gap-2 w-full", children: s })
61
+ href: e.url,
62
+ className: "flex w-full items-center gap-2",
63
+ ...S,
64
+ children: s
79
65
  }
80
- );
66
+ ) }) : /* @__PURE__ */ t(G, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t("a", { href: e.url, className: "flex w-full items-center gap-2", children: s }) });
81
67
  };
82
68
  return /* @__PURE__ */ r(z, { ...y, children: [
83
69
  b && /* @__PURE__ */ t(B, { children: b }),
@@ -1,9 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  import { Root as r } from "../../node_modules/@radix-ui/react-aspect-ratio/dist/index.js";
4
- function a({
5
- ...t
6
- }) {
4
+ function a({ ...t }) {
7
5
  return /* @__PURE__ */ o(r, { "data-slot": "aspect-ratio", ...t });
8
6
  }
9
7
  export {