@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.
- package/dist/_chunks/finished-terminal-VjZ_-eDD.js +122 -0
- package/dist/_chunks/pdf-viewer-chMpwpA4.js +979 -0
- package/dist/_chunks/{sign-document-BmAT0kKD.js → sign-document--nr5cxsB.js} +2 -2
- package/dist/_chunks/signature-field-DbhbpLha.js +190 -0
- package/dist/_chunks/use-countdown-Yd6ts0_a.js +26 -0
- package/dist/agent-catalog.json +15 -1
- package/dist/components/finished-terminal/finished-terminal.d.ts +55 -0
- package/dist/components/finished-terminal/index.d.ts +3 -0
- package/dist/components/finished-terminal/index.js +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/signature-field/signature-field.d.ts +8 -0
- package/dist/hooks/index.js +79 -99
- package/dist/i18n/locales/ar.d.ts +5 -0
- package/dist/i18n/locales/ar.js +5 -0
- package/dist/i18n/locales/de.d.ts +5 -0
- package/dist/i18n/locales/de.js +5 -0
- package/dist/i18n/locales/el.d.ts +5 -0
- package/dist/i18n/locales/el.js +5 -0
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.js +5 -0
- package/dist/i18n/locales/es.d.ts +5 -0
- package/dist/i18n/locales/es.js +5 -0
- package/dist/i18n/locales/fr.d.ts +5 -0
- package/dist/i18n/locales/fr.js +5 -0
- package/dist/i18n/locales/hi.d.ts +5 -0
- package/dist/i18n/locales/hi.js +5 -0
- package/dist/i18n/locales/it.d.ts +5 -0
- package/dist/i18n/locales/it.js +5 -0
- package/dist/i18n/locales/ja.d.ts +5 -0
- package/dist/i18n/locales/ja.js +5 -0
- package/dist/i18n/locales/nl.d.ts +5 -0
- package/dist/i18n/locales/nl.js +5 -0
- package/dist/i18n/locales/pl.d.ts +5 -0
- package/dist/i18n/locales/pl.js +5 -0
- package/dist/i18n/locales/pt.d.ts +5 -0
- package/dist/i18n/locales/pt.js +5 -0
- package/dist/i18n/locales/ro.d.ts +5 -0
- package/dist/i18n/locales/ro.js +5 -0
- package/dist/i18n/locales/ru.d.ts +5 -0
- package/dist/i18n/locales/ru.js +5 -0
- package/dist/i18n/locales/sq.d.ts +5 -0
- package/dist/i18n/locales/sq.js +5 -0
- package/dist/i18n/locales/sv.d.ts +5 -0
- package/dist/i18n/locales/sv.js +5 -0
- package/dist/i18n/locales/tr.d.ts +5 -0
- package/dist/i18n/locales/tr.js +5 -0
- package/dist/i18n/locales/zh.d.ts +5 -0
- package/dist/i18n/locales/zh.js +5 -0
- package/dist/index.js +299 -297
- package/dist/locales/ar.json +5 -0
- package/dist/locales/de.json +5 -0
- package/dist/locales/el.json +5 -0
- package/dist/locales/en.json +5 -0
- package/dist/locales/es.json +5 -0
- package/dist/locales/fr.json +5 -0
- package/dist/locales/hi.json +5 -0
- package/dist/locales/it.json +5 -0
- package/dist/locales/ja.json +5 -0
- package/dist/locales/nl.json +5 -0
- package/dist/locales/pl.json +5 -0
- package/dist/locales/pt.json +5 -0
- package/dist/locales/ro.json +5 -0
- package/dist/locales/ru.json +5 -0
- package/dist/locales/sq.json +5 -0
- package/dist/locales/sv.json +5 -0
- package/dist/locales/tr.json +5 -0
- package/dist/locales/zh.json +5 -0
- package/dist/tokens.css +1 -1
- package/package.json +7 -1
- package/dist/_chunks/pdf-viewer-XxWdtKfD.js +0 -965
- package/dist/_chunks/signature-field-DhscKdgk.js +0 -152
|
@@ -2,7 +2,7 @@ import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as ce, useId as le, useMemo as G, useRef as L, useState as x, useEffect as _, useCallback as l, useImperativeHandle as ue } from "react";
|
|
3
3
|
import { c as i } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as me } from "react-i18next";
|
|
5
|
-
import { P as ge } from "./pdf-viewer-
|
|
5
|
+
import { P as ge } from "./pdf-viewer-chMpwpA4.js";
|
|
6
6
|
import { S as pe } from "./signature-capture-COi0Uiqu.js";
|
|
7
7
|
import { u as fe } from "./registry-nPAVE19X.js";
|
|
8
8
|
import { C as J } from "./circle-check-9AeSgJD_.js";
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
je as S,
|
|
342
342
|
ve as s
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=sign-document
|
|
344
|
+
//# sourceMappingURL=sign-document--nr5cxsB.js.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { jsx as s, jsxs as f, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k } from "react";
|
|
3
|
+
import { c as y } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as C } from "react-i18next";
|
|
5
|
+
import { S as _ } from "./spinner-OjQNn8oN.js";
|
|
6
|
+
import { C as T } from "./check-DPdL_Sm7.js";
|
|
7
|
+
import { c as w } from "./createLucideIcon-CrFbzy84.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v1.8.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const S = [
|
|
15
|
+
["path", { d: "M13 21h8", key: "1jsn5i" }],
|
|
16
|
+
[
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
20
|
+
key: "1a8usu"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
], $ = w("pen-line", S), L = y(
|
|
24
|
+
[
|
|
25
|
+
// Overlay fields are always absolutely positioned within the
|
|
26
|
+
// renderPageOverlay box; the percent geometry rides the inline style.
|
|
27
|
+
"ds:absolute",
|
|
28
|
+
"ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
|
|
29
|
+
// The visible box renders at its true percentage geometry. A min-size
|
|
30
|
+
// floor here overstretched short fields past their authored box, so
|
|
31
|
+
// neighbours collided (signed box overlapping the next field). The 44/48px
|
|
32
|
+
// touch target is instead restored via a transparent ::before hit-area
|
|
33
|
+
// expansion — the same pattern Button's `sm` size uses — applied on touch
|
|
34
|
+
// viewports only; on desktop the precise box is the target.
|
|
35
|
+
'ds:before:absolute ds:before:content-[""]',
|
|
36
|
+
"ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)]",
|
|
37
|
+
"ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)]",
|
|
38
|
+
"ds:sm:before:hidden",
|
|
39
|
+
// Inline padding lives on the per-state variants below (not the base) so
|
|
40
|
+
// the signed state's tighter padding can't collide with a base ps/pe on
|
|
41
|
+
// the same logical side under Tailwind's JIT ordering.
|
|
42
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
43
|
+
"ds:text-[length:var(--font-size-sm)] ds:font-medium",
|
|
44
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
45
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
46
|
+
"ds:focus-visible:outline-solid",
|
|
47
|
+
"ds:focus-visible:outline-[var(--ring)]",
|
|
48
|
+
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
49
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
50
|
+
"ds:aria-disabled:cursor-not-allowed"
|
|
51
|
+
].join(" "),
|
|
52
|
+
{
|
|
53
|
+
variants: {
|
|
54
|
+
state: {
|
|
55
|
+
unsigned: [
|
|
56
|
+
"ds:cursor-pointer",
|
|
57
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
58
|
+
"ds:border ds:border-dashed ds:border-[color:var(--ring)]",
|
|
59
|
+
"ds:bg-[color-mix(in_srgb,var(--info)_8%,transparent)]",
|
|
60
|
+
"ds:text-[var(--foreground)]",
|
|
61
|
+
"ds:hover:bg-[color-mix(in_srgb,var(--info)_16%,transparent)]",
|
|
62
|
+
"ds:forced-colors:border-[CanvasText]"
|
|
63
|
+
].join(" "),
|
|
64
|
+
signing: [
|
|
65
|
+
"ds:cursor-progress",
|
|
66
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
67
|
+
"ds:border ds:border-dashed ds:border-[color:var(--border)]",
|
|
68
|
+
"ds:bg-[var(--muted)]",
|
|
69
|
+
"ds:text-[var(--muted-foreground)]",
|
|
70
|
+
"ds:forced-colors:border-[CanvasText]"
|
|
71
|
+
].join(" "),
|
|
72
|
+
signed: [
|
|
73
|
+
// overflow-hidden is NOT on the button root — it would clip the
|
|
74
|
+
// ::before touch-target expansion. It lives on the inner image
|
|
75
|
+
// wrapper instead (see render).
|
|
76
|
+
"ds:cursor-pointer",
|
|
77
|
+
"ds:p-[var(--spacing-xs)]",
|
|
78
|
+
"ds:border ds:border-solid ds:border-[color:var(--success)]",
|
|
79
|
+
"ds:bg-[color-mix(in_srgb,var(--success)_8%,transparent)]",
|
|
80
|
+
"ds:text-[var(--foreground)]",
|
|
81
|
+
"ds:forced-colors:border-[CanvasText]"
|
|
82
|
+
].join(" ")
|
|
83
|
+
},
|
|
84
|
+
// Persistent selection ring for the nav-targeted field. Uses the same
|
|
85
|
+
// tokens as the focus ring but is NOT gated on :focus-visible, so it
|
|
86
|
+
// stays visible as the signer steps between fields. When the field is
|
|
87
|
+
// also focused, the base focus-visible ring composes over it (same
|
|
88
|
+
// outline property, same value) — no visual clash.
|
|
89
|
+
active: {
|
|
90
|
+
true: [
|
|
91
|
+
"ds:outline-solid",
|
|
92
|
+
"ds:outline-[length:var(--focus-ring-width)]",
|
|
93
|
+
"ds:outline-[var(--ring)]",
|
|
94
|
+
"ds:outline-offset-[length:var(--focus-ring-offset)]",
|
|
95
|
+
"ds:forced-colors:outline-[Highlight]"
|
|
96
|
+
].join(" "),
|
|
97
|
+
false: ""
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
defaultVariants: { state: "unsigned", active: !1 }
|
|
101
|
+
}
|
|
102
|
+
), M = k(
|
|
103
|
+
({
|
|
104
|
+
state: e = "unsigned",
|
|
105
|
+
insetInlineStart: o,
|
|
106
|
+
insetBlockStart: a,
|
|
107
|
+
inlineSize: t,
|
|
108
|
+
blockSize: l,
|
|
109
|
+
onActivate: d,
|
|
110
|
+
signedImageSrc: c,
|
|
111
|
+
label: r,
|
|
112
|
+
disabled: v = !1,
|
|
113
|
+
active: u = !1,
|
|
114
|
+
id: p,
|
|
115
|
+
className: b,
|
|
116
|
+
...h
|
|
117
|
+
}, x) => {
|
|
118
|
+
const { t: i } = C(), g = v || e === "signing", n = {};
|
|
119
|
+
o !== void 0 && (n.insetInlineStart = `${o}%`), a !== void 0 && (n.insetBlockStart = `${a}%`), t !== void 0 && (n.inlineSize = `${t}%`), l !== void 0 && (n.blockSize = `${l}%`);
|
|
120
|
+
const z = r ?? i("signatureField.prompt"), F = e === "signing" ? r ? i("signatureField.signingNamed", { label: r }) : i("signatureField.signing") : e === "signed" ? r ? i("signatureField.signedNamed", { label: r }) : i("signatureField.signed") : r ?? i("signatureField.unsigned");
|
|
121
|
+
function j(N) {
|
|
122
|
+
if (g) {
|
|
123
|
+
N.preventDefault();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
d == null || d();
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ s(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
ref: x,
|
|
132
|
+
type: "button",
|
|
133
|
+
...h,
|
|
134
|
+
"data-component": "signature-field",
|
|
135
|
+
"data-component-id": p,
|
|
136
|
+
"data-state": e,
|
|
137
|
+
"data-active": u || void 0,
|
|
138
|
+
"aria-label": F,
|
|
139
|
+
"aria-disabled": g || void 0,
|
|
140
|
+
"aria-busy": e === "signing" || void 0,
|
|
141
|
+
onClick: j,
|
|
142
|
+
className: [L({ state: e, active: u }), b].filter(Boolean).join(" "),
|
|
143
|
+
style: n,
|
|
144
|
+
children: e === "signing" ? (
|
|
145
|
+
// Decorative: the button's aria-label + aria-busy are the single
|
|
146
|
+
// source of the status announcement, so the Spinner's own
|
|
147
|
+
// role="status" live region is hidden from assistive tech.
|
|
148
|
+
/* @__PURE__ */ s("span", { "aria-hidden": "true", children: /* @__PURE__ */ s(_, { size: "sm", label: i("signatureField.signing") }) })
|
|
149
|
+
) : e === "signed" ? c ? (
|
|
150
|
+
// overflow-hidden + rounding live on this inner wrapper (not the
|
|
151
|
+
// button root) so the signature is clipped to the box WITHOUT
|
|
152
|
+
// clipping the button's ::before touch-target expansion.
|
|
153
|
+
/* @__PURE__ */ s("span", { className: "ds:inline-size-full ds:block-size-full ds:overflow-hidden ds:rounded-[var(--radius-sm)]", children: /* @__PURE__ */ s(
|
|
154
|
+
"img",
|
|
155
|
+
{
|
|
156
|
+
src: c,
|
|
157
|
+
alt: "",
|
|
158
|
+
"aria-hidden": "true",
|
|
159
|
+
className: "ds:block-size-full ds:inline-size-full ds:object-contain"
|
|
160
|
+
}
|
|
161
|
+
) })
|
|
162
|
+
) : /* @__PURE__ */ f(m, { children: [
|
|
163
|
+
/* @__PURE__ */ s(
|
|
164
|
+
T,
|
|
165
|
+
{
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
className: "ds:block-size-4 ds:inline-size-4 ds:text-[var(--success)]"
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ s("span", { children: i("signatureField.signed") })
|
|
171
|
+
] }) : /* @__PURE__ */ f(m, { children: [
|
|
172
|
+
/* @__PURE__ */ s(
|
|
173
|
+
$,
|
|
174
|
+
{
|
|
175
|
+
"aria-hidden": "true",
|
|
176
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ s("span", { children: z })
|
|
180
|
+
] })
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
M.displayName = "SignatureField";
|
|
186
|
+
export {
|
|
187
|
+
M as S,
|
|
188
|
+
L as s
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=signature-field-DbhbpLha.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState as c, useRef as R, useEffect as o, useCallback as f } from "react";
|
|
2
|
+
function x(t, l = {}) {
|
|
3
|
+
const { autoStart: m = !0, onElapsed: u } = l, [a, s] = c(t), [e, i] = c(m), n = R(u);
|
|
4
|
+
o(() => {
|
|
5
|
+
n.current = u;
|
|
6
|
+
}, [u]);
|
|
7
|
+
const g = f(() => {
|
|
8
|
+
s(t), i(!0);
|
|
9
|
+
}, [t]), v = f(() => {
|
|
10
|
+
s(t), i(!1);
|
|
11
|
+
}, [t]);
|
|
12
|
+
return o(() => {
|
|
13
|
+
if (!e) return;
|
|
14
|
+
const r = setInterval(() => {
|
|
15
|
+
s((I) => Math.max(0, I - 1));
|
|
16
|
+
}, 1e3);
|
|
17
|
+
return () => clearInterval(r);
|
|
18
|
+
}, [e]), o(() => {
|
|
19
|
+
var r;
|
|
20
|
+
e && a <= 0 && (i(!1), (r = n.current) == null || r.call(n));
|
|
21
|
+
}, [e, a]), { remaining: a, isRunning: e, start: g, reset: v };
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
x as u
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=use-countdown-Yd6ts0_a.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.63.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -1901,6 +1901,20 @@
|
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
1903
|
},
|
|
1904
|
+
{
|
|
1905
|
+
"kind": "component",
|
|
1906
|
+
"id": "finished-terminal",
|
|
1907
|
+
"capabilities": [],
|
|
1908
|
+
"state": [],
|
|
1909
|
+
"actions": [],
|
|
1910
|
+
"domHooks": {
|
|
1911
|
+
"root": {
|
|
1912
|
+
"attr": "data-component",
|
|
1913
|
+
"value": "finished-terminal",
|
|
1914
|
+
"description": "Marks the element as a kit FinishedTerminal."
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
},
|
|
1904
1918
|
{
|
|
1905
1919
|
"kind": "component",
|
|
1906
1920
|
"id": "fiscal-code-input",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Gate for the URLs the terminal will navigate to. Allows only same-origin
|
|
4
|
+
* relative paths (`/…`) and explicit `http(s)` absolute URLs; rejects
|
|
5
|
+
* `javascript:` / `data:` / `vbscript:` and any other scheme.
|
|
6
|
+
*
|
|
7
|
+
* This terminal lives on public signing pages where `redirectUrl` may flow
|
|
8
|
+
* from a URL parameter, so a hostile `javascript:…` value must never reach
|
|
9
|
+
* `window.location.assign` (it would execute in the page). Exported for unit
|
|
10
|
+
* testing — it is NOT part of the public component API (`index.ts` does not
|
|
11
|
+
* re-export it).
|
|
12
|
+
*/
|
|
13
|
+
export declare function isNavigableUrl(url: string): boolean;
|
|
14
|
+
export interface FinishedTerminalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
15
|
+
/** Completion headline — consumer-provided, already translated. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Completion sub-message — consumer-provided, already translated. */
|
|
18
|
+
body: string;
|
|
19
|
+
/**
|
|
20
|
+
* Auto-close countdown, in seconds. Default `10`. Set `0` to disable the
|
|
21
|
+
* countdown entirely (a static success screen with no next-step).
|
|
22
|
+
*/
|
|
23
|
+
autoCloseSeconds?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Where to send the signer when the countdown elapses / "Close now" is
|
|
26
|
+
* pressed. When omitted, the terminal does a best-effort `window.close()`
|
|
27
|
+
* and falls back to `brandUrl`.
|
|
28
|
+
*
|
|
29
|
+
* @security Navigated to via `window.location.assign`. Only same-origin
|
|
30
|
+
* relative paths and `http(s)` absolute URLs are honoured — `javascript:` /
|
|
31
|
+
* `data:` values are dropped. Pass a value from trusted backend config.
|
|
32
|
+
*/
|
|
33
|
+
redirectUrl?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Brand-site fallback used when there is no `redirectUrl` and the
|
|
36
|
+
* best-effort `window.close()` is blocked. Default `https://www.alfadocs.com`.
|
|
37
|
+
*
|
|
38
|
+
* @security Same navigation gate as `redirectUrl`.
|
|
39
|
+
*/
|
|
40
|
+
brandUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Override the default close/redirect behaviour (e.g. SPA routing, analytics,
|
|
43
|
+
* or a no-op in stories). When provided, the terminal does NO browser
|
|
44
|
+
* navigation of its own — it just calls this.
|
|
45
|
+
*/
|
|
46
|
+
onClose?: () => void;
|
|
47
|
+
/** Override the countdown line (default `ui.finishedTerminal.autoClose`). */
|
|
48
|
+
countdownLabel?: (seconds: number) => string;
|
|
49
|
+
/** Override the "Close now" label (default `ui.finishedTerminal.closeNow`). */
|
|
50
|
+
closeNowLabel?: string;
|
|
51
|
+
/** Override the post-close line (default `ui.finishedTerminal.redirecting`). */
|
|
52
|
+
redirectingLabel?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare const FinishedTerminal: import("react").ForwardRefExoticComponent<FinishedTerminalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
//# sourceMappingURL=finished-terminal.d.ts.map
|
|
@@ -96,6 +96,7 @@ export * from './alert';
|
|
|
96
96
|
export * from './appointment-card';
|
|
97
97
|
export * from './dialog';
|
|
98
98
|
export * from './dropdown-menu';
|
|
99
|
+
export * from './finished-terminal';
|
|
99
100
|
export * from './live-region';
|
|
100
101
|
export * from './matrix-rain';
|
|
101
102
|
export * from './message-card';
|
|
@@ -81,6 +81,13 @@ export interface PDFViewerProps {
|
|
|
81
81
|
onError?: (error: Error) => void;
|
|
82
82
|
/** Show the toolbar. Default `true`. */
|
|
83
83
|
toolbar?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Toolbar control set. `'full'` (default) is the editor toolbar (page nav,
|
|
86
|
+
* page input, zoom, fit-width, search, print). `'minimal'` is a lean,
|
|
87
|
+
* read-only control set — zoom out / in / preset only — for surfaces like
|
|
88
|
+
* signing where a signer just reads, scrolls, and occasionally zooms.
|
|
89
|
+
*/
|
|
90
|
+
toolbarVariant?: 'full' | 'minimal';
|
|
84
91
|
/** Accessible label for the viewer region. */
|
|
85
92
|
ariaLabel?: string;
|
|
86
93
|
/** Extra class names on the wrapper. */
|
|
@@ -26,9 +26,17 @@ export interface SignatureFieldProps extends Omit<ComponentPropsWithoutRef<'butt
|
|
|
26
26
|
label?: string;
|
|
27
27
|
/** Hard-disable the field (non-activatable, dimmed). Distinct from `state="signing"`. */
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Marks the field as the one currently targeted by field-to-field navigation
|
|
31
|
+
* (Next / Previous signature). Renders a **persistent** selection ring — not
|
|
32
|
+
* the transient `:focus-visible` ring — so the signer can see which field
|
|
33
|
+
* they're on as they step through, even after focus moves or is programmatic.
|
|
34
|
+
*/
|
|
35
|
+
active?: boolean;
|
|
29
36
|
}
|
|
30
37
|
declare const signatureFieldVariants: (props?: ({
|
|
31
38
|
state?: "signed" | "unsigned" | "signing" | null | undefined;
|
|
39
|
+
active?: boolean | null | undefined;
|
|
32
40
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
33
41
|
export declare const SignatureField: import("react").ForwardRefExoticComponent<SignatureFieldProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
34
42
|
export { signatureFieldVariants };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { A as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { useState as
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as
|
|
15
|
-
import { u as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { u as v } from "../_chunks/use-prefers-reduced-motion-BMwIQRjB.js";
|
|
2
|
+
import { u as D } from "../_chunks/use-media-query-CcAx5SMM.js";
|
|
3
|
+
import { u as g, a as _ } from "../_chunks/use-signing-session-CyOZWinp.js";
|
|
4
|
+
import { u as I } from "../_chunks/use-count-up-BLLetaZ8.js";
|
|
5
|
+
import { u as R } from "../_chunks/use-locale-BkCIHujH.js";
|
|
6
|
+
import { A as K, T as H, a as M, r as Y, t as q, u as B } from "../_chunks/use-theme-CAuo6EYT.js";
|
|
7
|
+
import { u as P } from "../_chunks/use-controllable-state-BiY4xTzM.js";
|
|
8
|
+
import { u as V } from "../_chunks/use-copy-to-clipboard-Cyfc_dlv.js";
|
|
9
|
+
import { u as z } from "../_chunks/use-debounced-callback-BisrB-Fq.js";
|
|
10
|
+
import { useState as x, useRef as b, useEffect as E } from "react";
|
|
11
|
+
import { u as W, a as J } from "../_chunks/use-direction-Dp8h70PP.js";
|
|
12
|
+
import { u as X } from "../_chunks/use-persistent-state-i23OWy6G.js";
|
|
13
|
+
import { u as $ } from "../_chunks/use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
14
|
+
import { u as te } from "../_chunks/use-web-otp-D_utzp6S.js";
|
|
15
|
+
import { u as oe } from "../_chunks/use-edge-resize-ZnGG7gyO.js";
|
|
16
|
+
import { u as ne } from "../_chunks/use-countdown-Yd6ts0_a.js";
|
|
17
|
+
function h(e, o) {
|
|
18
|
+
const [t, i] = x(e), u = b(null);
|
|
19
|
+
return E(() => {
|
|
20
|
+
if (o <= 0) {
|
|
21
|
+
u.current !== null && (clearTimeout(u.current), u.current = null), i(e);
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
const s = setTimeout(() => {
|
|
24
|
-
i(e),
|
|
25
|
-
},
|
|
26
|
-
return
|
|
27
|
-
}, [e,
|
|
25
|
+
i(e), u.current = null;
|
|
26
|
+
}, o);
|
|
27
|
+
return u.current = s, () => clearTimeout(s);
|
|
28
|
+
}, [e, o]), t;
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const T = [
|
|
30
31
|
"a[href]",
|
|
31
32
|
"button:not([disabled])",
|
|
32
33
|
'input:not([disabled]):not([type="hidden"])',
|
|
@@ -37,96 +38,75 @@ const S = [
|
|
|
37
38
|
"audio[controls]",
|
|
38
39
|
"video[controls]"
|
|
39
40
|
].join(",");
|
|
40
|
-
function
|
|
41
|
+
function p(e) {
|
|
41
42
|
return Array.from(
|
|
42
|
-
e.querySelectorAll(
|
|
43
|
-
).filter((
|
|
44
|
-
if (
|
|
45
|
-
let
|
|
46
|
-
for (;
|
|
47
|
-
if (
|
|
48
|
-
|
|
43
|
+
e.querySelectorAll(T)
|
|
44
|
+
).filter((o) => {
|
|
45
|
+
if (o.hidden) return !1;
|
|
46
|
+
let t = o;
|
|
47
|
+
for (; t; ) {
|
|
48
|
+
if (t.hasAttribute("inert") || t.getAttribute("aria-hidden") === "true") return !1;
|
|
49
|
+
t = t.parentElement;
|
|
49
50
|
}
|
|
50
51
|
return !0;
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
const { enabled:
|
|
55
|
-
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
54
|
+
function C(e, o = {}) {
|
|
55
|
+
const { enabled: t = !0, autoFocus: i = !0, restoreFocus: u = !0 } = o, s = b(null);
|
|
56
|
+
E(() => {
|
|
57
|
+
if (!t) return;
|
|
58
|
+
const a = e.current;
|
|
59
|
+
if (!a) return;
|
|
59
60
|
if (s.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null, i) {
|
|
60
|
-
const
|
|
61
|
-
|
|
61
|
+
const n = p(a)[0] ?? (a.tabIndex >= -1 ? a : null);
|
|
62
|
+
n == null || n.focus();
|
|
62
63
|
}
|
|
63
|
-
function l(
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
|
|
64
|
+
function l(r) {
|
|
65
|
+
if (r.key !== "Tab") return;
|
|
66
|
+
const n = e.current;
|
|
67
|
+
if (!n) return;
|
|
68
|
+
const c = p(n);
|
|
69
|
+
if (c.length === 0) {
|
|
70
|
+
r.preventDefault();
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
73
|
+
const d = c[0], m = c[c.length - 1], f = document.activeElement;
|
|
74
|
+
r.shiftKey ? (f === d || !n.contains(f)) && (r.preventDefault(), m.focus()) : (f === m || !n.contains(f)) && (r.preventDefault(), d.focus());
|
|
74
75
|
}
|
|
75
|
-
return
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
76
|
+
return a.addEventListener("keydown", l), () => {
|
|
77
|
+
if (a.removeEventListener("keydown", l), u && s.current) {
|
|
78
|
+
const r = s.current;
|
|
78
79
|
requestAnimationFrame(() => {
|
|
79
|
-
|
|
80
|
+
r.isConnected && r.focus();
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
|
-
}, [
|
|
84
|
-
}
|
|
85
|
-
function g(e, u = {}) {
|
|
86
|
-
const { autoStart: r = !0, onElapsed: i } = u, [n, s] = b(e), [o, l] = b(r), t = E(i);
|
|
87
|
-
m(() => {
|
|
88
|
-
t.current = i;
|
|
89
|
-
}, [i]);
|
|
90
|
-
const a = x(() => {
|
|
91
|
-
s(e), l(!0);
|
|
92
|
-
}, [e]), f = x(() => {
|
|
93
|
-
s(e), l(!1);
|
|
94
|
-
}, [e]);
|
|
95
|
-
return m(() => {
|
|
96
|
-
if (!o) return;
|
|
97
|
-
const c = setInterval(() => {
|
|
98
|
-
s((d) => Math.max(0, d - 1));
|
|
99
|
-
}, 1e3);
|
|
100
|
-
return () => clearInterval(c);
|
|
101
|
-
}, [o]), m(() => {
|
|
102
|
-
var c;
|
|
103
|
-
o && n <= 0 && (l(!1), (c = t.current) == null || c.call(t));
|
|
104
|
-
}, [o, n]), { remaining: n, isRunning: o, start: a, reset: f };
|
|
84
|
+
}, [t, i, u, e]);
|
|
105
85
|
}
|
|
106
86
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
87
|
+
K as ACCESSIBILITY_STORAGE_KEY,
|
|
88
|
+
H as THEME_CLASS,
|
|
89
|
+
M as THEME_STORAGE_KEY,
|
|
90
|
+
Y as resolveTheme,
|
|
91
|
+
q as themeClassList,
|
|
92
|
+
P as useControllableState,
|
|
93
|
+
V as useCopyToClipboard,
|
|
94
|
+
I as useCountUp,
|
|
95
|
+
ne as useCountdown,
|
|
96
|
+
z as useDebouncedCallback,
|
|
97
|
+
h as useDebouncedValue,
|
|
98
|
+
W as useDirection,
|
|
99
|
+
J as useDocumentDirection,
|
|
100
|
+
oe as useEdgeResize,
|
|
101
|
+
C as useFocusTrap,
|
|
102
|
+
$ as useIsomorphicLayoutEffect,
|
|
103
|
+
R as useLocale,
|
|
104
|
+
D as useMediaQuery,
|
|
105
|
+
X as usePersistentState,
|
|
106
|
+
v as usePrefersReducedMotion,
|
|
107
|
+
g as useScrollToFirstError,
|
|
128
108
|
_ as useSigningSession,
|
|
129
|
-
|
|
130
|
-
|
|
109
|
+
B as useTheme,
|
|
110
|
+
te as useWebOtp
|
|
131
111
|
};
|
|
132
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1714,6 +1714,11 @@ export declare const arUi: {
|
|
|
1714
1714
|
readonly invalidReturnUrl: "يجب أن يتطابق رابط العودة مع أصل هذا الموقع. لم يتم إرسال الدفع.";
|
|
1715
1715
|
};
|
|
1716
1716
|
};
|
|
1717
|
+
readonly finishedTerminal: {
|
|
1718
|
+
readonly autoClose: "ستُغلق هذه النافذة خلال {{seconds}} ثانية.";
|
|
1719
|
+
readonly closeNow: "إغلاق الآن";
|
|
1720
|
+
readonly redirecting: "جارٍ التحويل…";
|
|
1721
|
+
};
|
|
1717
1722
|
readonly signatureField: {
|
|
1718
1723
|
readonly prompt: "انقر للتوقيع";
|
|
1719
1724
|
readonly unsigned: "وقّع هنا";
|
package/dist/i18n/locales/ar.js
CHANGED
|
@@ -1697,6 +1697,11 @@ const e = {
|
|
|
1697
1697
|
invalidReturnUrl: "يجب أن يتطابق رابط العودة مع أصل هذا الموقع. لم يتم إرسال الدفع."
|
|
1698
1698
|
}
|
|
1699
1699
|
},
|
|
1700
|
+
finishedTerminal: {
|
|
1701
|
+
autoClose: "ستُغلق هذه النافذة خلال {{seconds}} ثانية.",
|
|
1702
|
+
closeNow: "إغلاق الآن",
|
|
1703
|
+
redirecting: "جارٍ التحويل…"
|
|
1704
|
+
},
|
|
1700
1705
|
signatureField: {
|
|
1701
1706
|
prompt: "انقر للتوقيع",
|
|
1702
1707
|
unsigned: "وقّع هنا",
|
|
@@ -1714,6 +1714,11 @@ export declare const deUi: {
|
|
|
1714
1714
|
readonly invalidReturnUrl: "Die Rückleitungs-URL muss mit dem Ursprung dieser Website übereinstimmen. Die Zahlung wurde nicht gesendet.";
|
|
1715
1715
|
};
|
|
1716
1716
|
};
|
|
1717
|
+
readonly finishedTerminal: {
|
|
1718
|
+
readonly autoClose: "Dieser Tab wird in {{seconds}} Sek. geschlossen.";
|
|
1719
|
+
readonly closeNow: "Jetzt schließen";
|
|
1720
|
+
readonly redirecting: "Weiterleitung…";
|
|
1721
|
+
};
|
|
1717
1722
|
readonly signatureField: {
|
|
1718
1723
|
readonly prompt: "Zum Signieren klicken";
|
|
1719
1724
|
readonly unsigned: "Hier unterschreiben";
|
package/dist/i18n/locales/de.js
CHANGED
|
@@ -1696,6 +1696,11 @@ const e = {
|
|
|
1696
1696
|
invalidReturnUrl: "Die Rückleitungs-URL muss mit dem Ursprung dieser Website übereinstimmen. Die Zahlung wurde nicht gesendet."
|
|
1697
1697
|
}
|
|
1698
1698
|
},
|
|
1699
|
+
finishedTerminal: {
|
|
1700
|
+
autoClose: "Dieser Tab wird in {{seconds}} Sek. geschlossen.",
|
|
1701
|
+
closeNow: "Jetzt schließen",
|
|
1702
|
+
redirecting: "Weiterleitung…"
|
|
1703
|
+
},
|
|
1699
1704
|
signatureField: {
|
|
1700
1705
|
prompt: "Zum Signieren klicken",
|
|
1701
1706
|
unsigned: "Hier unterschreiben",
|