laif-ds 0.2.30 → 0.2.32

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 (46) hide show
  1. package/dist/_virtual/index2.js +2 -5
  2. package/dist/_virtual/index3.js +5 -2
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/_virtual/warning.js +8 -0
  6. package/dist/components/ui/app-radio-group.js +115 -0
  7. package/dist/components/ui/file-previewer.js +46 -36
  8. package/dist/components/ui/radio-group.js +39 -24
  9. package/dist/components/ui/secure-pdf-viewer.js +115 -0
  10. package/dist/components/ui/textarea.js +16 -15
  11. package/dist/index.d.ts +61 -2
  12. package/dist/index.js +159 -155
  13. package/dist/laif-ds.css +1 -1
  14. package/dist/node_modules/dequal/dist/index.js +56 -0
  15. package/dist/node_modules/eventemitter3/index.js +1 -1
  16. package/dist/node_modules/eventemitter3/index2.js +1 -1
  17. package/dist/node_modules/make-cancellable-promise/dist/index.js +15 -0
  18. package/dist/node_modules/make-event-props/dist/index.js +114 -0
  19. package/dist/node_modules/merge-refs/dist/index.js +19 -0
  20. package/dist/node_modules/react-pdf/dist/Document.js +180 -0
  21. package/dist/node_modules/react-pdf/dist/DocumentContext.js +6 -0
  22. package/dist/node_modules/react-pdf/dist/LinkService.js +94 -0
  23. package/dist/node_modules/react-pdf/dist/Message.js +8 -0
  24. package/dist/node_modules/react-pdf/dist/Page/AnnotationLayer.js +97 -0
  25. package/dist/node_modules/react-pdf/dist/Page/Canvas.js +55 -0
  26. package/dist/node_modules/react-pdf/dist/Page/TextLayer.js +111 -0
  27. package/dist/node_modules/react-pdf/dist/Page.js +180 -0
  28. package/dist/node_modules/react-pdf/dist/PageContext.js +6 -0
  29. package/dist/node_modules/react-pdf/dist/PasswordResponses.js +8 -0
  30. package/dist/node_modules/react-pdf/dist/StructTree.js +44 -0
  31. package/dist/node_modules/react-pdf/dist/StructTreeItem.js +14 -0
  32. package/dist/node_modules/react-pdf/dist/index.js +9 -0
  33. package/dist/node_modules/react-pdf/dist/shared/constants.js +62 -0
  34. package/dist/node_modules/react-pdf/dist/shared/hooks/useDocumentContext.js +9 -0
  35. package/dist/node_modules/react-pdf/dist/shared/hooks/usePageContext.js +9 -0
  36. package/dist/node_modules/react-pdf/dist/shared/hooks/useResolver.js +20 -0
  37. package/dist/node_modules/react-pdf/dist/shared/structTreeUtils.js +55 -0
  38. package/dist/node_modules/react-pdf/dist/shared/utils.js +110 -0
  39. package/dist/node_modules/react-pdf/node_modules/pdfjs-dist/build/pdf.js +15282 -0
  40. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  41. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  42. package/dist/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +13 -0
  43. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  44. package/dist/node_modules/warning/warning.js +39 -0
  45. package/dist/styles.v3.css +1 -1
  46. package/package.json +3 -1
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
- var r = t();
5
- const m = /* @__PURE__ */ e(r);
2
+ var e = { exports: {} };
6
3
  export {
7
- m as default
4
+ e as __module
8
5
  };
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
+ var r = t();
5
+ const m = /* @__PURE__ */ e(r);
3
6
  export {
4
- e as __module
7
+ m as default
5
8
  };
@@ -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,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
  };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/warning/warning.js";
4
+ var t = e();
5
+ const i = /* @__PURE__ */ r(t);
6
+ export {
7
+ i as default
8
+ };
@@ -0,0 +1,115 @@
1
+ "use client";
2
+ import { jsxs as r, jsx as t, Fragment as G } from "react/jsx-runtime";
3
+ import { cn as s } from "../../lib/utils.js";
4
+ import { Icon as O } from "./icon.js";
5
+ import { Label as j } from "./label.js";
6
+ import { RadioGroup as C, RadioGroupItem as F } from "./radio-group.js";
7
+ const a = ({ content: e }) => typeof e == "string" ? /* @__PURE__ */ t("span", { children: e }) : e, I = ({ option: e }) => /* @__PURE__ */ r(G, { children: [
8
+ /* @__PURE__ */ r("div", { className: "text-d-foreground flex flex-row items-center gap-1.5 text-sm font-medium", children: [
9
+ e.icon && /* @__PURE__ */ t(O, { size: "xs", className: "min-h-4 min-w-4", name: e.icon }),
10
+ /* @__PURE__ */ t(a, { content: e.label })
11
+ ] }),
12
+ e.description && /* @__PURE__ */ t("div", { className: "text-d-foreground text-xs font-light", children: /* @__PURE__ */ t(a, { content: e.description }) })
13
+ ] }), P = ({
14
+ option: e,
15
+ optionId: c,
16
+ isDisabled: o,
17
+ isCard: n,
18
+ optionClassName: l
19
+ }) => /* @__PURE__ */ r(
20
+ j,
21
+ {
22
+ htmlFor: c,
23
+ className: s(
24
+ "flex items-center gap-2",
25
+ o ? "cursor-not-allowed opacity-50" : "cursor-pointer",
26
+ n && "bg-d-card border-d-border rounded-lg border p-2 shadow",
27
+ l
28
+ ),
29
+ children: [
30
+ /* @__PURE__ */ t(F, { value: e.value, id: c, disabled: o }),
31
+ /* @__PURE__ */ t(
32
+ "div",
33
+ {
34
+ className: s(
35
+ "flex flex-1 flex-col items-start gap-1",
36
+ o ? "cursor-not-allowed" : "cursor-pointer"
37
+ ),
38
+ children: /* @__PURE__ */ t(I, { option: e })
39
+ }
40
+ )
41
+ ]
42
+ }
43
+ );
44
+ function k({
45
+ options: e,
46
+ value: c,
47
+ defaultValue: o,
48
+ onValueChange: n,
49
+ label: l,
50
+ description: i,
51
+ disabled: x = !1,
52
+ required: f = !1,
53
+ name: u,
54
+ orientation: p = "vertical",
55
+ loop: h = !0,
56
+ className: g = "",
57
+ wrpClassName: v = "",
58
+ optionClassName: N = "",
59
+ layout: w = "default",
60
+ error: m
61
+ }) {
62
+ const b = p === "horizontal", y = w === "card";
63
+ return /* @__PURE__ */ r("div", { className: s("flex w-full flex-col gap-2", v), children: [
64
+ (l || i) && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
65
+ l && /* @__PURE__ */ r(
66
+ "div",
67
+ {
68
+ className: s(
69
+ "flex items-center gap-1 text-sm font-medium",
70
+ m ? "text-d-destructive" : "text-d-foreground"
71
+ ),
72
+ children: [
73
+ /* @__PURE__ */ t(a, { content: l }),
74
+ f && /* @__PURE__ */ t("span", { children: "*" })
75
+ ]
76
+ }
77
+ ),
78
+ i && /* @__PURE__ */ t("div", { className: "text-bodySecondary text-xs", children: /* @__PURE__ */ t(a, { content: i }) })
79
+ ] }),
80
+ /* @__PURE__ */ t(
81
+ C,
82
+ {
83
+ value: c,
84
+ defaultValue: o,
85
+ onValueChange: n,
86
+ disabled: x,
87
+ required: f,
88
+ name: u,
89
+ orientation: p,
90
+ loop: h,
91
+ className: s(
92
+ "flex gap-2",
93
+ b ? "flex-row" : "flex-col",
94
+ g
95
+ ),
96
+ children: e.map((d) => {
97
+ const R = `${u || "radio"}-${d.value}`, z = x || !!d.disabled;
98
+ return /* @__PURE__ */ t(P, { isCard: y, ...{
99
+ option: d,
100
+ optionId: R,
101
+ isDisabled: z,
102
+ optionClassName: N
103
+ } }, d.value);
104
+ })
105
+ }
106
+ ),
107
+ m && /* @__PURE__ */ r("div", { className: "text-d-destructive text-xs font-medium", children: [
108
+ "*",
109
+ m
110
+ ] })
111
+ ] });
112
+ }
113
+ export {
114
+ k as AppRadioGroup
115
+ };
@@ -2,98 +2,108 @@
2
2
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
3
3
  import { createAsk as w } from "../../node_modules/use-ask/dist/index.js";
4
4
  import { Dialog as x, DialogContent as g, DialogHeader as N, DialogTitle as y } from "./dialog.js";
5
- import { Icon as b } from "./icon.js";
6
- import { guessKind as P, isHttpUrl as A, getOfficeEmbedUrl as D } from "../../lib/file-preview.js";
7
- import { cn as O } from "../../lib/utils.js";
5
+ import { Icon as P } from "./icon.js";
6
+ import { SecurePdfViewer as b } from "./secure-pdf-viewer.js";
7
+ import { guessKind as A, isHttpUrl as D, getOfficeEmbedUrl as O } from "../../lib/file-preview.js";
8
+ import { cn as F } from "../../lib/utils.js";
8
9
  import { useMemo as c } from "react";
9
- const [p, F] = w({});
10
+ const [p, T] = w({});
10
11
  function h(e) {
11
12
  return typeof e == "string" ? { url: e } : e || {};
12
13
  }
13
- async function H(e) {
14
+ async function q(e) {
14
15
  return p.ask(h(e));
15
16
  }
16
- function S(e) {
17
+ function B(e) {
17
18
  return p.safeAsk(h(e));
18
19
  }
19
- const q = () => {
20
- const [{ payload: e }, { asking: t, ok: n }] = F(), l = e?.url, o = e?.readOnly, a = e?.page, i = c(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), m = c(() => {
20
+ const E = () => {
21
+ const [{ payload: e }, { asking: i, ok: n }] = T(), l = e?.url, a = e?.readOnly, o = e?.page, t = c(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), m = c(() => {
21
22
  if (!e?.url) return null;
22
23
  const s = new URL(e?.url), u = s.searchParams.get("response-content-type") || s.searchParams.get("content-type"), d = e?.mimeType || u || "";
23
- return P({
24
+ return A({
24
25
  mimeType: d,
25
- filename: i,
26
+ filename: t,
26
27
  url: e?.url
27
28
  });
28
- }, [e?.mimeType, i, e?.url]), v = c(
29
+ }, [e?.mimeType, t, e?.url]), v = c(
29
30
  () => /* @__PURE__ */ f("span", { className: "flex items-center gap-2", children: [
30
- /* @__PURE__ */ r(b, { name: "File", className: "h-4 w-4" }),
31
- e?.title || i
31
+ /* @__PURE__ */ r(P, { name: "File", className: "h-4 w-4" }),
32
+ e?.title || t
32
33
  ] }),
33
- [e?.title, i]
34
+ [e?.title, t]
34
35
  );
35
- return /* @__PURE__ */ r(x, { open: t, onOpenChange: (s) => !s && n(), children: /* @__PURE__ */ f(g, { size: "xl", className: "sm:max-w-4xl", children: [
36
+ return /* @__PURE__ */ r(x, { open: i, onOpenChange: (s) => !s && n(), children: /* @__PURE__ */ f(g, { size: "xl", className: "sm:max-w-4xl", children: [
36
37
  /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(y, { children: v }) }),
37
- /* @__PURE__ */ r("div", { className: O("relative", "max-h-[80vh] overflow-auto p-1"), children: m && l ? /* @__PURE__ */ r(
38
- T,
38
+ /* @__PURE__ */ r("div", { className: F("relative", "max-h-[80vh] overflow-auto p-1"), children: m && l ? /* @__PURE__ */ r(
39
+ j,
39
40
  {
40
41
  kind: m,
41
42
  src: l,
42
43
  officeUrl: l,
43
- readOnly: o,
44
- page: a
44
+ readOnly: a,
45
+ page: o
45
46
  }
46
47
  ) : null })
47
48
  ] }) });
48
- }, T = ({
49
+ }, j = ({
49
50
  kind: e,
50
- src: t,
51
+ src: i,
51
52
  officeUrl: n,
52
53
  readOnly: l = !1,
53
- page: o = 0
54
+ page: a = 0
54
55
  }) => {
55
- if (!t && e !== "text" && e !== "office")
56
+ if (!i && e !== "text" && e !== "office")
56
57
  return /* @__PURE__ */ r("div", { className: "text-d-secondary-foreground", children: "Nessuna sorgente disponibile" });
57
58
  switch (e) {
58
59
  case "image":
59
60
  return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r(
60
61
  "img",
61
62
  {
62
- src: t,
63
+ src: i,
63
64
  alt: "preview",
64
65
  className: "max-h-[78vh] w-auto max-w-full object-contain"
65
66
  }
66
67
  ) });
67
68
  case "pdf":
68
- let a = t;
69
- return o > 0 && (a += "#page=" + o), l && (a += "#toolbar=0"), /* @__PURE__ */ r(
69
+ if (l && i)
70
+ return /* @__PURE__ */ r(
71
+ b,
72
+ {
73
+ url: i,
74
+ initialPage: a || 1,
75
+ className: "w-full"
76
+ }
77
+ );
78
+ let o = i;
79
+ return a > 0 && (o += "#page=" + a), /* @__PURE__ */ r(
70
80
  "iframe",
71
81
  {
72
- src: a,
82
+ src: o,
73
83
  title: "PDF Preview",
74
84
  className: "h-[78vh] w-full rounded"
75
85
  }
76
86
  );
77
87
  case "audio":
78
- return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src: t }) }) });
88
+ return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src: i }) }) });
79
89
  case "video":
80
- return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-[78vh] w-full max-w-3xl rounded", children: /* @__PURE__ */ r("source", { src: t }) }) });
90
+ return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-[78vh] w-full max-w-3xl rounded", children: /* @__PURE__ */ r("source", { src: i }) }) });
81
91
  case "text":
82
92
  return /* @__PURE__ */ r(
83
93
  "iframe",
84
94
  {
85
- src: t,
95
+ src: i,
86
96
  title: "Text Preview",
87
97
  className: "h-[78vh] w-full rounded"
88
98
  }
89
99
  );
90
100
  case "office": {
91
- if (n && A(n)) {
92
- const i = D(n);
101
+ if (n && D(n)) {
102
+ const t = O(n);
93
103
  return /* @__PURE__ */ r(
94
104
  "iframe",
95
105
  {
96
- src: i,
106
+ src: t,
97
107
  title: "Office Preview",
98
108
  className: "h-[78vh] w-full rounded"
99
109
  }
@@ -106,7 +116,7 @@ const q = () => {
106
116
  }
107
117
  };
108
118
  export {
109
- q as FilePreviewer,
110
- H as previewFileModal,
111
- S as safePreviewFileModal
119
+ E as FilePreviewer,
120
+ q as previewFileModal,
121
+ B as safePreviewFileModal
112
122
  };
@@ -1,46 +1,61 @@
1
1
  "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { Root as t, Item as a, Indicator as s } from "../../node_modules/@radix-ui/react-radio-group/dist/index.js";
4
- import { cn as e } from "../../lib/utils.js";
5
- import d from "../../node_modules/lucide-react/dist/esm/icons/circle.js";
6
- function m({
7
- className: i,
8
- ...o
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { Root as a, Item as d, Indicator as s } from "../../node_modules/@radix-ui/react-radio-group/dist/index.js";
4
+ import { cn as t } from "../../lib/utils.js";
5
+ import n from "../../node_modules/lucide-react/dist/esm/icons/circle.js";
6
+ function p({
7
+ className: o,
8
+ ...r
9
9
  }) {
10
- return /* @__PURE__ */ r(
11
- t,
10
+ return /* @__PURE__ */ e(
11
+ a,
12
12
  {
13
13
  "data-slot": "radio-group",
14
- className: e("grid gap-3", i),
15
- ...o
14
+ className: t("grid gap-3", o),
15
+ ...r
16
16
  }
17
17
  );
18
18
  }
19
- function p({
20
- className: i,
21
- ...o
19
+ function f({
20
+ className: o,
21
+ disabled: r,
22
+ ...i
22
23
  }) {
23
- return /* @__PURE__ */ r(
24
- a,
24
+ return /* @__PURE__ */ e(
25
+ d,
25
26
  {
26
27
  "data-slot": "radio-group-item",
27
- className: e(
28
- "border-d-border text-d-primary focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
29
- i
28
+ disabled: r,
29
+ className: t(
30
+ "text-d-primary aspect-square size-4 shrink-0 cursor-pointer rounded-full shadow-xs transition-[color,box-shadow] outline-none",
31
+ "aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
32
+ "focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px]",
33
+ // Red border when not selected, default border when selected
34
+ "data-[state=unchecked]:border-d-foreground data-[state=checked]:border-d-primary border",
35
+ r && "text-d-muted border-d-muted-foreground cursor-not-allowed opacity-50",
36
+ o
30
37
  ),
31
- ...o,
32
- children: /* @__PURE__ */ r(
38
+ ...i,
39
+ children: /* @__PURE__ */ e(
33
40
  s,
34
41
  {
35
42
  "data-slot": "radio-group-indicator",
36
43
  className: "relative flex items-center justify-center",
37
- children: /* @__PURE__ */ r(d, { className: "fill-d-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
44
+ children: /* @__PURE__ */ e(
45
+ n,
46
+ {
47
+ className: t(
48
+ "fill-d-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2",
49
+ r && "fill-d-muted-foreground"
50
+ )
51
+ }
52
+ )
38
53
  }
39
54
  )
40
55
  }
41
56
  );
42
57
  }
43
58
  export {
44
- m as RadioGroup,
45
- p as RadioGroupItem
59
+ p as RadioGroup,
60
+ f as RadioGroupItem
46
61
  };
@@ -0,0 +1,115 @@
1
+ "use client";
2
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
+ import { Button as p } from "./button.js";
4
+ import { Icon as i } from "./icon.js";
5
+ import { useState as s, useRef as C, useMemo as h, useEffect as x } from "react";
6
+ import "../../node_modules/react-pdf/dist/index.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ import L from "../../node_modules/react-pdf/dist/Document.js";
10
+ import k from "../../node_modules/react-pdf/dist/Page.js";
11
+ import { GlobalWorkerOptions as W } from "../../node_modules/react-pdf/node_modules/pdfjs-dist/build/pdf.js";
12
+ W.workerSrc = "https://unpkg.com/pdfjs-dist@5.3.93/build/pdf.worker.min.mjs";
13
+ function G({
14
+ url: a,
15
+ initialPage: w = 1,
16
+ className: N = ""
17
+ }) {
18
+ const [c, g] = s(), [t, m] = s(w), [d, u] = s(null), n = C(null), [v, f] = s(950), b = h(() => ({ url: a }), [a]), P = h(
19
+ () => ({
20
+ cMapUrl: "https://unpkg.com/pdfjs-dist@5.3.93/cmaps/",
21
+ cMapPacked: !0
22
+ }),
23
+ []
24
+ ), E = ({ numPages: r }) => {
25
+ g(r), u(null), setTimeout(() => {
26
+ if (n.current) {
27
+ const l = n.current.clientWidth;
28
+ f(l - 32);
29
+ }
30
+ }, 50);
31
+ }, j = (r) => {
32
+ console.error("PDF Load Error:", r), u(r.message || "Errore nel caricamento del PDF");
33
+ };
34
+ return x(() => {
35
+ n.current && (n.current.scrollTop = 0);
36
+ }, [t]), x(() => {
37
+ const r = () => {
38
+ if (n.current) {
39
+ const l = n.current.clientWidth;
40
+ f(l - 32);
41
+ }
42
+ };
43
+ return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
44
+ }, []), d ? /* @__PURE__ */ o("div", { className: "text-d-destructive flex min-h-[600px] flex-col items-center justify-center gap-3", children: [
45
+ /* @__PURE__ */ e(i, { name: "AlertCircle", className: "h-12 w-12" }),
46
+ /* @__PURE__ */ e("p", { className: "font-semibold", children: "Errore nel caricamento del PDF" }),
47
+ /* @__PURE__ */ e("p", { className: "text-d-muted-foreground text-sm", children: d })
48
+ ] }) : /* @__PURE__ */ o(
49
+ "div",
50
+ {
51
+ className: `flex min-h-[600px] w-full flex-col items-center ${N}`,
52
+ children: [
53
+ /* @__PURE__ */ e(
54
+ "div",
55
+ {
56
+ ref: n,
57
+ className: "border-d-border max-h-[500px] w-full overflow-auto rounded border",
58
+ children: /* @__PURE__ */ e(
59
+ L,
60
+ {
61
+ file: b,
62
+ onLoadSuccess: E,
63
+ onLoadError: j,
64
+ options: P,
65
+ loading: /* @__PURE__ */ e("div", { className: "flex min-h-[600px] items-center justify-center", children: /* @__PURE__ */ e(
66
+ i,
67
+ {
68
+ name: "Loader2",
69
+ className: "text-d-primary h-8 w-8 animate-spin"
70
+ }
71
+ ) }),
72
+ error: /* @__PURE__ */ o("div", { className: "text-d-destructive flex min-h-[600px] flex-col items-center justify-center gap-2", children: [
73
+ /* @__PURE__ */ e(i, { name: "AlertCircle", className: "h-12 w-12" }),
74
+ /* @__PURE__ */ e("p", { children: "Errore nel caricamento del PDF" })
75
+ ] }),
76
+ className: "h-full min-h-[600px] w-full border-0",
77
+ children: /* @__PURE__ */ e(k, { pageNumber: t, width: v })
78
+ }
79
+ )
80
+ }
81
+ ),
82
+ /* @__PURE__ */ o("div", { className: "my-8 flex h-full w-full items-center justify-center gap-4", children: [
83
+ /* @__PURE__ */ e(
84
+ p,
85
+ {
86
+ onClick: () => m(Math.max(1, t - 1)),
87
+ disabled: t <= 1,
88
+ variant: "outline",
89
+ size: "sm",
90
+ children: /* @__PURE__ */ e(i, { name: "ChevronLeft", className: "h-4 w-4" })
91
+ }
92
+ ),
93
+ /* @__PURE__ */ o("p", { className: "text-d-foreground text-sm", children: [
94
+ t,
95
+ " / ",
96
+ c
97
+ ] }),
98
+ /* @__PURE__ */ e(
99
+ p,
100
+ {
101
+ onClick: () => m(Math.min(c || 1, t + 1)),
102
+ disabled: t >= (c || 1),
103
+ variant: "outline",
104
+ size: "sm",
105
+ children: /* @__PURE__ */ e(i, { name: "ChevronRight", className: "h-4 w-4" })
106
+ }
107
+ )
108
+ ] })
109
+ ]
110
+ }
111
+ );
112
+ }
113
+ export {
114
+ G as SecurePdfViewer
115
+ };
@@ -1,31 +1,32 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
3
- import { Label as s } from "./label.js";
4
- import { cn as l } from "../../lib/utils.js";
5
- function x({
6
- className: i,
2
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
3
+ import { Label as c } from "./label.js";
4
+ import { cn as i } from "../../lib/utils.js";
5
+ function b({
6
+ wrpClassName: d,
7
+ className: o,
7
8
  label: e,
8
- labelClassName: d,
9
- id: o,
10
- ...a
9
+ labelClassName: a,
10
+ id: n,
11
+ ...s
11
12
  }) {
12
- const r = o || (e ? `textarea-${Math.random().toString(36).substring(2, 9)}` : void 0);
13
- return /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
14
- e && /* @__PURE__ */ t(s, { htmlFor: r, className: d, children: e }),
13
+ const r = n || (e ? `textarea-${Math.random().toString(36).substring(2, 9)}` : void 0);
14
+ return /* @__PURE__ */ l("div", { className: i("space-y-1.5", d), children: [
15
+ e && /* @__PURE__ */ t(c, { htmlFor: r, className: a, children: e }),
15
16
  /* @__PURE__ */ t(
16
17
  "textarea",
17
18
  {
18
19
  id: r,
19
20
  "data-slot": "textarea",
20
- className: l(
21
+ className: i(
21
22
  "border-d-input placeholder:text-d-muted-foreground focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive !bg-d-input flex field-sizing-content min-h-16 w-full rounded-md border px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
22
- i
23
+ o
23
24
  ),
24
- ...a
25
+ ...s
25
26
  }
26
27
  )
27
28
  ] });
28
29
  }
29
30
  export {
30
- x as Textarea
31
+ b as Textarea
31
32
  };