laif-ds 0.2.19 → 0.2.21

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 (51) hide show
  1. package/dist/_virtual/index4.js +5 -5
  2. package/dist/_virtual/index5.js +5 -5
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/components/ui/app-stepper.js +212 -0
  6. package/dist/components/ui/file-preview.js +215 -138
  7. package/dist/components/ui/file-previewer.js +1 -1
  8. package/dist/components/ui/file-uploader.js +109 -96
  9. package/dist/components/ui/stepper.js +387 -0
  10. package/dist/index.d.ts +52 -1
  11. package/dist/index.js +30 -28
  12. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +70 -69
  13. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +24 -25
  14. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +22 -23
  15. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +28 -29
  16. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +1 -2
  17. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +49 -50
  18. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +22 -23
  19. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +6 -7
  20. package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +31 -32
  21. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +56 -57
  22. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -7
  23. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +20 -21
  24. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +12 -13
  25. package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +5 -6
  26. package/dist/node_modules/@radix-ui/react-select/dist/index.js +17 -18
  27. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +39 -40
  28. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +12 -13
  29. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +13 -14
  30. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +20 -21
  31. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +8 -9
  32. package/dist/node_modules/cmdk/dist/index.js +2 -2
  33. package/dist/node_modules/eventemitter3/index2.js +1 -1
  34. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  35. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  36. package/dist/node_modules/unified/lib/index.js +1 -1
  37. package/dist/node_modules/vaul/dist/index.js +1 -1
  38. package/dist/styles.v3.css +1 -1
  39. package/package.json +3 -2
  40. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +0 -255
  41. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  42. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
  43. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  44. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  45. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
  46. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +0 -258
  47. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  48. package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
  49. package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  50. package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  51. package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
@@ -1,92 +1,155 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as o } from "react/jsx-runtime";
3
- import { motion as h } from "framer-motion";
4
- import p, { useEffect as T } from "react";
5
- import { Button as P } from "./button.js";
6
- import { Command as k, CommandGroup as C, CommandItem as b } from "./command.js";
7
- import { Icon as x } from "./icon.js";
8
- import { Popover as U, PopoverTrigger as R, PopoverContent as L } from "./popover.js";
9
- import { Tooltip as z, TooltipTrigger as E, TooltipContent as I } from "./tooltip.js";
10
- import { cn as v } from "../../lib/utils.js";
11
- import g from "../../node_modules/lucide-react/dist/esm/icons/x.js";
12
- import S from "../../node_modules/lucide-react/dist/esm/icons/file.js";
13
- const y = ({ url: e, onPreview: r, onDownload: a, onRemove: l }) => /* @__PURE__ */ o(U, { children: [
14
- /* @__PURE__ */ t(R, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", size: "icon", children: /* @__PURE__ */ t(x, { name: "Menu", size: "sm" }) }) }),
15
- /* @__PURE__ */ t(L, { className: "w-42 p-0", align: "end", children: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ o(C, { children: [
16
- r && /* @__PURE__ */ o(b, { onSelect: () => r(e), children: [
17
- /* @__PURE__ */ t(x, { name: "Presentation", size: "sm" }),
3
+ import { getExt as C, imageExts as W } from "../../lib/file-preview.js";
4
+ import { motion as F } from "framer-motion";
5
+ import f, { useEffect as E } from "react";
6
+ import { Button as R } from "./button.js";
7
+ import { Command as B, CommandGroup as $, CommandItem as v } from "./command.js";
8
+ import { Icon as y } from "./icon.js";
9
+ import { Popover as A, PopoverTrigger as S, PopoverContent as D } from "./popover.js";
10
+ import { Tooltip as G, TooltipTrigger as M, TooltipContent as V } from "./tooltip.js";
11
+ import { cn as N } from "../../lib/utils.js";
12
+ import z from "../../node_modules/lucide-react/dist/esm/icons/x.js";
13
+ import O from "../../node_modules/lucide-react/dist/esm/icons/file-audio.js";
14
+ import P from "../../node_modules/lucide-react/dist/esm/icons/file-video.js";
15
+ import h from "../../node_modules/lucide-react/dist/esm/icons/file-text.js";
16
+ import X from "../../node_modules/lucide-react/dist/esm/icons/file.js";
17
+ import _ from "../../node_modules/lucide-react/dist/esm/icons/file-code.js";
18
+ import K from "../../node_modules/lucide-react/dist/esm/icons/file-archive.js";
19
+ import q from "../../node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js";
20
+ const d = (e) => "type" in e && typeof e.type == "string" && e instanceof File, T = (e) => e.name || "url" in e && e.url || "", U = (e) => {
21
+ if (d(e)) return e.type || "";
22
+ const r = e.type;
23
+ return typeof r == "string" ? r : "";
24
+ }, H = (e, r) => {
25
+ if (!e && r) {
26
+ if (r.startsWith("audio/"))
27
+ return { icon: O, colorClass: "text-violet-600" };
28
+ if (r.startsWith("video/"))
29
+ return { icon: P, colorClass: "text-rose-600" };
30
+ if (r.startsWith("text/"))
31
+ return { icon: h, colorClass: "text-gray-600" };
32
+ }
33
+ switch (e) {
34
+ case "pdf":
35
+ return { icon: h, colorClass: "text-red-600" };
36
+ case "doc":
37
+ case "docx":
38
+ return { icon: h, colorClass: "text-blue-600" };
39
+ case "xls":
40
+ case "xlsx":
41
+ case "csv":
42
+ return { icon: q, colorClass: "text-green-600" };
43
+ case "ppt":
44
+ case "pptx":
45
+ return { icon: h, colorClass: "text-orange-600" };
46
+ case "txt":
47
+ case "md":
48
+ return { icon: h, colorClass: "text-gray-600" };
49
+ case "zip":
50
+ case "rar":
51
+ case "7z":
52
+ case "tar":
53
+ case "gz":
54
+ case "tgz":
55
+ return { icon: K, colorClass: "text-amber-600" };
56
+ case "mp3":
57
+ case "wav":
58
+ case "ogg":
59
+ case "flac":
60
+ case "m4a":
61
+ return { icon: O, colorClass: "text-violet-600" };
62
+ case "mp4":
63
+ case "mov":
64
+ case "avi":
65
+ case "mkv":
66
+ case "webm":
67
+ return { icon: P, colorClass: "text-rose-600" };
68
+ case "js":
69
+ case "ts":
70
+ case "jsx":
71
+ case "tsx":
72
+ case "json":
73
+ case "xml":
74
+ case "yml":
75
+ case "yaml":
76
+ case "html":
77
+ case "css":
78
+ case "scss":
79
+ return { icon: _, colorClass: "text-indigo-600" };
80
+ default:
81
+ return { icon: X, colorClass: "text-d-secondary-foreground" };
82
+ }
83
+ }, L = (e) => {
84
+ if (!Number.isFinite(e) || e < 0) return "";
85
+ const r = ["B", "KB", "MB", "GB", "TB"];
86
+ let s = 0, a = e;
87
+ for (; a >= 1024 && s < r.length - 1; )
88
+ a /= 1024, s++;
89
+ const n = s > 0 && a < 100 ? 2 : 0;
90
+ return `${a.toFixed(n)}${r[s]}`;
91
+ }, j = (e) => {
92
+ const r = C(T(e));
93
+ if (r) return r.toUpperCase();
94
+ const s = U(e);
95
+ return s ? s === "application/pdf" ? "PDF" : s.startsWith("image/") ? s.split("/")[1]?.toUpperCase() || "IMAGE" : s.startsWith("audio/") ? "AUDIO" : s.startsWith("video/") ? "VIDEO" : s.startsWith("text/") ? "TEXT" : s.includes("officedocument") || s.includes("msword") || s.includes("ms-excel") || s.includes("ms-powerpoint") ? "OFFICE" : "" : "";
96
+ }, k = ({
97
+ url: e,
98
+ onPreview: r,
99
+ onDownload: s,
100
+ onRemove: a
101
+ }) => /* @__PURE__ */ o(A, { children: [
102
+ /* @__PURE__ */ t(S, { asChild: !0, children: /* @__PURE__ */ t(R, { variant: "ghost", size: "icon", children: /* @__PURE__ */ t(y, { name: "Menu", size: "sm" }) }) }),
103
+ /* @__PURE__ */ t(D, { className: "w-42 p-0", align: "end", children: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ o($, { children: [
104
+ r && /* @__PURE__ */ o(v, { onSelect: () => r(e), children: [
105
+ /* @__PURE__ */ t(y, { name: "Presentation", size: "sm" }),
18
106
  /* @__PURE__ */ t("span", { children: "Anteprima" })
19
107
  ] }),
20
- a && /* @__PURE__ */ o(b, { onSelect: () => a(e), children: [
21
- /* @__PURE__ */ t(x, { name: "Download", size: "sm" }),
108
+ s && /* @__PURE__ */ o(v, { onSelect: () => s(e), children: [
109
+ /* @__PURE__ */ t(y, { name: "Download", size: "sm" }),
22
110
  /* @__PURE__ */ t("span", { children: "Download" })
23
111
  ] }),
24
- l && /* @__PURE__ */ o(
25
- b,
112
+ a && /* @__PURE__ */ o(
113
+ v,
26
114
  {
27
- onSelect: () => l(e),
115
+ onSelect: () => a(e),
28
116
  className: "text-red-500",
29
117
  children: [
30
- /* @__PURE__ */ t(x, { name: "Trash", className: "text-red-500", size: "sm" }),
118
+ /* @__PURE__ */ t(y, { name: "Trash", className: "text-red-500", size: "sm" }),
31
119
  /* @__PURE__ */ t("span", { children: "Elimina" })
32
120
  ]
33
121
  }
34
122
  )
35
123
  ] }) }) })
36
124
  ] });
37
- function w({ text: e }) {
38
- return /* @__PURE__ */ o(z, { children: [
39
- /* @__PURE__ */ t(E, { "data-slot": "tooltip-trigger", className: "w-full min-w-0", children: /* @__PURE__ */ t("span", { className: "block w-full truncate text-d-secondary-foreground", children: e }) }),
40
- /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t("span", { children: e }) })
125
+ function I({ text: e }) {
126
+ return /* @__PURE__ */ o(G, { children: [
127
+ /* @__PURE__ */ t(M, { "data-slot": "tooltip-trigger", className: "w-full min-w-0", children: /* @__PURE__ */ t("span", { className: "text-d-secondary-foreground block w-full truncate", children: e }) }),
128
+ /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("span", { children: e }) })
41
129
  ] });
42
130
  }
43
- const u = (e) => "type" in e && typeof e.type == "string" && e instanceof File, O = (e) => {
44
- if (u(e) || e.type)
45
- return e.type;
46
- const r = (i) => {
47
- if (!i) return "";
48
- const m = i.split(/[?#]/)[0].split("/").pop() || "", d = m.lastIndexOf(".");
49
- return d >= 0 ? m.substring(d + 1).toLowerCase() : "";
50
- }, a = r(e.name || ""), l = "url" in e ? r(e.url || "") : "", n = a || l;
51
- if (n && (/* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg", "tiff"])).has(n))
52
- return `image/${n === "jpg" ? "jpeg" : n}`;
53
- if (n === "txt" || n === "md")
54
- return "text/plain";
55
- const s = {
56
- pdf: "application/pdf",
57
- csv: "text/csv",
58
- doc: "application/msword",
59
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
60
- xls: "application/vnd.ms-excel",
61
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
62
- ppt: "application/vnd.ms-powerpoint",
63
- pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
64
- };
65
- return n && s[n] ? s[n] : "application/octet-stream";
66
- }, W = p.forwardRef(
131
+ const be = f.forwardRef(
67
132
  (e, r) => {
68
- const a = O(e.file);
69
- return a.startsWith("image/") ? /* @__PURE__ */ t(N, { ...e, ref: r }) : a.startsWith("text/") || e.file.name.endsWith(".txt") || e.file.name.endsWith(".md") ? /* @__PURE__ */ t(F, { ...e, ref: r }) : /* @__PURE__ */ t(j, { ...e, ref: r });
133
+ const s = T(e.file), a = C(s), n = U(e.file), m = a === "csv" || n === "text/csv";
134
+ return n && n.startsWith("image/") || a && W.has(a) ? /* @__PURE__ */ t(J, { ...e, ref: r }) : !m && (a === "txt" || a === "md" || n && n.startsWith("text/")) ? /* @__PURE__ */ t(Q, { ...e, ref: r }) : /* @__PURE__ */ t(Y, { ...e, ref: r });
70
135
  }
71
- );
72
- W.displayName = "FilePreview";
73
- const N = p.forwardRef(
136
+ ), J = f.forwardRef(
74
137
  ({
75
138
  file: e,
76
139
  onRemove: r,
77
- onPreview: a,
78
- onDownload: l,
140
+ onPreview: s,
141
+ onDownload: a,
79
142
  showActionMenu: n = !1,
80
- className: c
81
- }, s) => {
82
- const i = u(e) ? URL.createObjectURL(e) : e.url;
143
+ className: m
144
+ }, p) => {
145
+ const i = d(e) ? URL.createObjectURL(e) : e.url, l = d(e) ? L(e.size) : "", c = j(e);
83
146
  return /* @__PURE__ */ o(
84
- h.div,
147
+ F.div,
85
148
  {
86
- ref: s,
87
- className: v(
149
+ ref: p,
150
+ className: N(
88
151
  "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
89
- c
152
+ m
90
153
  ),
91
154
  layout: !0,
92
155
  initial: { opacity: 0, y: "100%" },
@@ -102,13 +165,19 @@ const N = p.forwardRef(
102
165
  src: i
103
166
  }
104
167
  ),
105
- /* @__PURE__ */ t(w, { text: e.name }),
168
+ /* @__PURE__ */ o("div", { className: "min-w-0", children: [
169
+ /* @__PURE__ */ t(I, { text: e.name }),
170
+ (l || c) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
171
+ l,
172
+ c ? l ? ` · ${c}` : c : ""
173
+ ] })
174
+ ] }),
106
175
  n && /* @__PURE__ */ t(
107
- y,
176
+ k,
108
177
  {
109
178
  url: i,
110
- onPreview: a,
111
- onDownload: l,
179
+ onPreview: s,
180
+ onDownload: a,
112
181
  onRemove: r
113
182
  }
114
183
  )
@@ -120,84 +189,84 @@ const N = p.forwardRef(
120
189
  type: "button",
121
190
  onClick: () => r(i),
122
191
  "aria-label": "Remove attachment",
123
- children: /* @__PURE__ */ t(g, { className: "h-2.5 w-2.5" })
192
+ children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
124
193
  }
125
194
  ) : null
126
195
  ]
127
196
  }
128
197
  );
129
198
  }
130
- );
131
- N.displayName = "ImageFilePreview";
132
- const F = p.forwardRef(
133
- ({ file: e, onRemove: r, onPreview: a, onDownload: l, showActionMenu: n = !1 }, c) => {
134
- const [s, i] = p.useState(""), f = u(e) ? URL.createObjectURL(e) : e.url;
135
- return T(() => {
136
- if (u(e)) {
137
- const m = new FileReader();
138
- m.onload = (d) => {
139
- d.target?.result && i(
140
- typeof d.target.result == "string" ? d.target.result.slice(0, 100) : ""
141
- );
142
- }, m.readAsText(e);
143
- } else
144
- i("Anteprima non disponibile");
145
- }, [e]), /* @__PURE__ */ o(
146
- h.div,
147
- {
148
- ref: c,
149
- className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
150
- layout: !0,
151
- initial: { opacity: 0, y: "100%" },
152
- animate: { opacity: 1, y: 0 },
153
- exit: { opacity: 0, y: "100%" },
154
- children: [
155
- /* @__PURE__ */ o("div", { className: "flex w-full min-w-0 items-center space-x-2", children: [
156
- /* @__PURE__ */ t("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded rounded-sm border p-1 text-[8px]", children: s }),
157
- /* @__PURE__ */ t(w, { text: e.name }),
158
- n && /* @__PURE__ */ t(
159
- y,
160
- {
161
- url: f,
162
- onPreview: a,
163
- onDownload: l,
164
- onRemove: r
165
- }
166
- )
199
+ ), Q = f.forwardRef(({ file: e, onRemove: r, onPreview: s, onDownload: a, showActionMenu: n = !1 }, m) => {
200
+ const [p, i] = f.useState(""), l = d(e) ? URL.createObjectURL(e) : e.url, c = d(e) ? L(e.size) : "", u = j(e);
201
+ return E(() => {
202
+ if (d(e)) {
203
+ const b = new FileReader();
204
+ b.onload = (x) => {
205
+ x.target?.result && i(
206
+ typeof x.target.result == "string" ? x.target.result.slice(0, 100) : ""
207
+ );
208
+ }, b.readAsText(e);
209
+ } else
210
+ i("Anteprima non disponibile");
211
+ }, [e]), /* @__PURE__ */ o(
212
+ F.div,
213
+ {
214
+ ref: m,
215
+ className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
216
+ layout: !0,
217
+ initial: { opacity: 0, y: "100%" },
218
+ animate: { opacity: 1, y: 0 },
219
+ exit: { opacity: 0, y: "100%" },
220
+ children: [
221
+ /* @__PURE__ */ o("div", { className: "flex w-full min-w-0 items-center space-x-2", children: [
222
+ /* @__PURE__ */ t("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded rounded-sm border p-1 text-[8px]", children: p }),
223
+ /* @__PURE__ */ o("div", { className: "min-w-0", children: [
224
+ /* @__PURE__ */ t(I, { text: e.name }),
225
+ (c || u) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
226
+ c,
227
+ u ? c ? ` · ${u}` : u : ""
228
+ ] })
167
229
  ] }),
168
- !n && r ? /* @__PURE__ */ t(
169
- "button",
230
+ n && /* @__PURE__ */ t(
231
+ k,
170
232
  {
171
- className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
172
- type: "button",
173
- onClick: () => r(f),
174
- "aria-label": "Remove attachment",
175
- children: /* @__PURE__ */ t(g, { className: "h-2.5 w-2.5" })
233
+ url: l,
234
+ onPreview: s,
235
+ onDownload: a,
236
+ onRemove: r
176
237
  }
177
- ) : null
178
- ]
179
- }
180
- );
181
- }
182
- );
183
- F.displayName = "TextFilePreview";
184
- const j = p.forwardRef(
238
+ )
239
+ ] }),
240
+ !n && r ? /* @__PURE__ */ t(
241
+ "button",
242
+ {
243
+ className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
244
+ type: "button",
245
+ onClick: () => r(l),
246
+ "aria-label": "Remove attachment",
247
+ children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
248
+ }
249
+ ) : null
250
+ ]
251
+ }
252
+ );
253
+ }), Y = f.forwardRef(
185
254
  ({
186
255
  file: e,
187
256
  onRemove: r,
188
- onPreview: a,
189
- onDownload: l,
257
+ onPreview: s,
258
+ onDownload: a,
190
259
  showActionMenu: n = !1,
191
- className: c
192
- }, s) => {
193
- const i = u(e) ? URL.createObjectURL(e) : e.url;
260
+ className: m
261
+ }, p) => {
262
+ const i = d(e) ? URL.createObjectURL(e) : e.url, l = T(e), c = C(l), u = U(e), { icon: b, colorClass: x } = H(c, u), w = d(e) ? L(e.size) : "", g = j(e);
194
263
  return /* @__PURE__ */ o(
195
- h.div,
264
+ F.div,
196
265
  {
197
- ref: s,
198
- className: v(
266
+ ref: p,
267
+ className: N(
199
268
  "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
200
- c
269
+ m
201
270
  ),
202
271
  layout: !0,
203
272
  initial: { opacity: 0, y: "100%" },
@@ -205,14 +274,20 @@ const j = p.forwardRef(
205
274
  exit: { opacity: 0, y: "100%" },
206
275
  children: [
207
276
  /* @__PURE__ */ o("div", { className: "flex w-full min-w-0 cursor-pointer items-center space-x-2", children: [
208
- /* @__PURE__ */ t("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded-sm border", children: /* @__PURE__ */ t(S, { className: "h-5 w-5" }) }),
209
- /* @__PURE__ */ t(w, { text: e.name }),
277
+ /* @__PURE__ */ t("div", { className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm", children: /* @__PURE__ */ t(b, { className: N("h-5 w-5", x) }) }),
278
+ /* @__PURE__ */ o("div", { className: "min-w-0", children: [
279
+ /* @__PURE__ */ t(I, { text: e.name }),
280
+ (w || g) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
281
+ w,
282
+ g ? w ? ` · ${g}` : g : ""
283
+ ] })
284
+ ] }),
210
285
  n && /* @__PURE__ */ t(
211
- y,
286
+ k,
212
287
  {
213
288
  url: i,
214
- onPreview: a,
215
- onDownload: l,
289
+ onPreview: s,
290
+ onDownload: a,
216
291
  onRemove: r
217
292
  }
218
293
  )
@@ -224,7 +299,7 @@ const j = p.forwardRef(
224
299
  type: "button",
225
300
  onClick: () => r(i),
226
301
  "aria-label": "Remove attachment",
227
- children: /* @__PURE__ */ t(g, { className: "h-2.5 w-2.5" })
302
+ children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
228
303
  }
229
304
  ) : null
230
305
  ]
@@ -232,8 +307,10 @@ const j = p.forwardRef(
232
307
  );
233
308
  }
234
309
  );
235
- j.displayName = "GenericFilePreview";
236
310
  export {
237
- W as FilePreview,
238
- w as default
311
+ be as FilePreview,
312
+ Y as GenericFilePreview,
313
+ J as ImageFilePreview,
314
+ Q as TextFilePreview,
315
+ I as default
239
316
  };
@@ -17,7 +17,7 @@ function C(e) {
17
17
  return d.safeAsk(f(e));
18
18
  }
19
19
  const H = () => {
20
- const [{ payload: e }, { asking: t, cancel: i }] = D(), n = e?.url, a = s(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), o = s(() => {
20
+ const [{ payload: e }, { asking: t, ok: i }] = D(), n = e?.url, a = s(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), o = s(() => {
21
21
  if (!e?.url) return null;
22
22
  const l = new URL(e?.url), c = l.searchParams.get("response-content-type") || l.searchParams.get("content-type"), m = e?.mimeType || c || "";
23
23
  return y({