@alfadocs/ui-kit 0.60.0 → 0.63.0

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 (75) hide show
  1. package/dist/_chunks/finished-terminal-VjZ_-eDD.js +122 -0
  2. package/dist/_chunks/pdf-viewer-chMpwpA4.js +979 -0
  3. package/dist/_chunks/{sign-document-BmAT0kKD.js → sign-document--nr5cxsB.js} +2 -2
  4. package/dist/_chunks/signature-field-DbhbpLha.js +190 -0
  5. package/dist/_chunks/use-countdown-Yd6ts0_a.js +26 -0
  6. package/dist/agent-catalog.json +15 -1
  7. package/dist/components/finished-terminal/finished-terminal.d.ts +55 -0
  8. package/dist/components/finished-terminal/index.d.ts +3 -0
  9. package/dist/components/finished-terminal/index.js +5 -0
  10. package/dist/components/index.d.ts +1 -0
  11. package/dist/components/pdf-viewer/index.js +1 -1
  12. package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
  13. package/dist/components/sign-document/index.js +1 -1
  14. package/dist/components/signature-field/index.js +1 -1
  15. package/dist/components/signature-field/signature-field.d.ts +8 -0
  16. package/dist/hooks/index.js +79 -99
  17. package/dist/i18n/locales/ar.d.ts +5 -0
  18. package/dist/i18n/locales/ar.js +5 -0
  19. package/dist/i18n/locales/de.d.ts +5 -0
  20. package/dist/i18n/locales/de.js +5 -0
  21. package/dist/i18n/locales/el.d.ts +5 -0
  22. package/dist/i18n/locales/el.js +5 -0
  23. package/dist/i18n/locales/en.d.ts +5 -0
  24. package/dist/i18n/locales/en.js +5 -0
  25. package/dist/i18n/locales/es.d.ts +5 -0
  26. package/dist/i18n/locales/es.js +5 -0
  27. package/dist/i18n/locales/fr.d.ts +5 -0
  28. package/dist/i18n/locales/fr.js +5 -0
  29. package/dist/i18n/locales/hi.d.ts +5 -0
  30. package/dist/i18n/locales/hi.js +5 -0
  31. package/dist/i18n/locales/it.d.ts +5 -0
  32. package/dist/i18n/locales/it.js +5 -0
  33. package/dist/i18n/locales/ja.d.ts +5 -0
  34. package/dist/i18n/locales/ja.js +5 -0
  35. package/dist/i18n/locales/nl.d.ts +5 -0
  36. package/dist/i18n/locales/nl.js +5 -0
  37. package/dist/i18n/locales/pl.d.ts +5 -0
  38. package/dist/i18n/locales/pl.js +5 -0
  39. package/dist/i18n/locales/pt.d.ts +5 -0
  40. package/dist/i18n/locales/pt.js +5 -0
  41. package/dist/i18n/locales/ro.d.ts +5 -0
  42. package/dist/i18n/locales/ro.js +5 -0
  43. package/dist/i18n/locales/ru.d.ts +5 -0
  44. package/dist/i18n/locales/ru.js +5 -0
  45. package/dist/i18n/locales/sq.d.ts +5 -0
  46. package/dist/i18n/locales/sq.js +5 -0
  47. package/dist/i18n/locales/sv.d.ts +5 -0
  48. package/dist/i18n/locales/sv.js +5 -0
  49. package/dist/i18n/locales/tr.d.ts +5 -0
  50. package/dist/i18n/locales/tr.js +5 -0
  51. package/dist/i18n/locales/zh.d.ts +5 -0
  52. package/dist/i18n/locales/zh.js +5 -0
  53. package/dist/index.js +299 -297
  54. package/dist/locales/ar.json +5 -0
  55. package/dist/locales/de.json +5 -0
  56. package/dist/locales/el.json +5 -0
  57. package/dist/locales/en.json +5 -0
  58. package/dist/locales/es.json +5 -0
  59. package/dist/locales/fr.json +5 -0
  60. package/dist/locales/hi.json +5 -0
  61. package/dist/locales/it.json +5 -0
  62. package/dist/locales/ja.json +5 -0
  63. package/dist/locales/nl.json +5 -0
  64. package/dist/locales/pl.json +5 -0
  65. package/dist/locales/pt.json +5 -0
  66. package/dist/locales/ro.json +5 -0
  67. package/dist/locales/ru.json +5 -0
  68. package/dist/locales/sq.json +5 -0
  69. package/dist/locales/sv.json +5 -0
  70. package/dist/locales/tr.json +5 -0
  71. package/dist/locales/zh.json +5 -0
  72. package/dist/tokens.css +1 -1
  73. package/package.json +7 -1
  74. package/dist/_chunks/pdf-viewer-XxWdtKfD.js +0 -965
  75. package/dist/_chunks/signature-field-DhscKdgk.js +0 -152
@@ -0,0 +1,122 @@
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
+ import { forwardRef as k, useState as A, useRef as g, useEffect as F, useCallback as j } from "react";
3
+ import { useTranslation as z } from "react-i18next";
4
+ import { C as w } from "./card-DPmk26CL.js";
5
+ import { B as E } from "./button-DD_0Xdmr.js";
6
+ import { u as D } from "./use-countdown-Yd6ts0_a.js";
7
+ import { C as L } from "./circle-check-9AeSgJD_.js";
8
+ function W(s) {
9
+ const t = globalThis.window !== void 0 && globalThis;
10
+ return !!(t && (/Chromatic/.test(t.navigator.userAgent) || /chromatic=true/.test(t.location.href)));
11
+ }
12
+ const _ = "https://www.alfadocs.com";
13
+ function x(s) {
14
+ if (typeof s != "string" || s.length === 0 || s.startsWith("//")) return !1;
15
+ if (s.startsWith("/")) return !0;
16
+ try {
17
+ const { protocol: t } = new URL(s, window.location.origin);
18
+ return t === "https:" || t === "http:";
19
+ } catch {
20
+ return !1;
21
+ }
22
+ }
23
+ const I = k(
24
+ ({
25
+ title: s,
26
+ body: t,
27
+ autoCloseSeconds: i = 10,
28
+ redirectUrl: n,
29
+ brandUrl: o = _,
30
+ onClose: a,
31
+ countdownLabel: d,
32
+ closeNowLabel: v,
33
+ redirectingLabel: y,
34
+ className: N,
35
+ ...C
36
+ }, T) => {
37
+ const { t: r } = z(), [R, b] = A(!1), c = g(!1), l = g(null);
38
+ F(() => {
39
+ var h;
40
+ (h = l.current) == null || h.focus();
41
+ }, []);
42
+ const m = j(() => {
43
+ if (!c.current) {
44
+ if (c.current = !0, b(!0), a) {
45
+ a();
46
+ return;
47
+ }
48
+ n ? x(n) && window.location.assign(n) : (window.close(), x(o) && window.location.assign(o));
49
+ }
50
+ }, [a, n, o]), { remaining: f } = D(i, {
51
+ autoStart: i > 0 && !W(),
52
+ onElapsed: m
53
+ }), u = i > 0, B = d ? d(f) : r("finishedTerminal.autoClose", { seconds: f });
54
+ return /* @__PURE__ */ e(
55
+ "div",
56
+ {
57
+ ref: T,
58
+ "data-component": "finished-terminal",
59
+ className: [
60
+ "ds:flex ds:flex-1 ds:flex-col ds:items-center ds:overflow-y-auto ds:p-[var(--spacing-lg)]",
61
+ N
62
+ ].filter(Boolean).join(" "),
63
+ ...C,
64
+ children: /* @__PURE__ */ e(
65
+ w,
66
+ {
67
+ variant: "elevated",
68
+ className: "ds:my-auto ds:min-w-0 ds:[inline-size:100%] ds:max-w-[28rem] ds:text-center",
69
+ children: /* @__PURE__ */ e(w.Body, { children: /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]", children: [
70
+ /* @__PURE__ */ e(
71
+ L,
72
+ {
73
+ "aria-hidden": "true",
74
+ className: "ds:size-12 ds:text-[var(--success)]"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ e(
78
+ "h1",
79
+ {
80
+ ref: l,
81
+ tabIndex: -1,
82
+ className: "type-title-card ds:m-0 ds:outline-none",
83
+ children: s
84
+ }
85
+ ),
86
+ /* @__PURE__ */ e("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: t }),
87
+ u && R ? (
88
+ // Mounts once when closing begins → role="status" announces the
89
+ // hand-off exactly once (no churn).
90
+ /* @__PURE__ */ e(
91
+ "p",
92
+ {
93
+ role: "status",
94
+ className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
95
+ children: y ?? r("finishedTerminal.redirecting")
96
+ }
97
+ )
98
+ ) : u ? /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
99
+ /* @__PURE__ */ e("p", { className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]", children: B }),
100
+ /* @__PURE__ */ e(
101
+ E,
102
+ {
103
+ intent: "secondary",
104
+ size: "lg",
105
+ type: "button",
106
+ onClick: m,
107
+ children: v ?? r("finishedTerminal.closeNow")
108
+ }
109
+ )
110
+ ] }) : null
111
+ ] }) })
112
+ }
113
+ )
114
+ }
115
+ );
116
+ }
117
+ );
118
+ I.displayName = "FinishedTerminal";
119
+ export {
120
+ I as F
121
+ };
122
+ //# sourceMappingURL=finished-terminal-VjZ_-eDD.js.map