@alfadocs/ui-kit-debug 0.62.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/finished-terminal-VjZ_-eDD.js.map +1 -0
- package/dist/_chunks/use-countdown-Yd6ts0_a.js +26 -0
- package/dist/_chunks/use-countdown-Yd6ts0_a.js.map +1 -0
- package/dist/agent-catalog.json +15 -1
- package/dist/components/finished-terminal/finished-terminal.d.ts +55 -0
- package/dist/components/finished-terminal/finished-terminal.d.ts.map +1 -0
- package/dist/components/finished-terminal/index.d.ts +3 -0
- package/dist/components/finished-terminal/index.d.ts.map +1 -0
- package/dist/components/finished-terminal/index.js +5 -0
- package/dist/components/finished-terminal/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.js +79 -99
- package/dist/hooks/index.js.map +1 -1
- package/dist/i18n/locales/ar.d.ts +5 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +5 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +5 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +5 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +5 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +5 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +5 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +5 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +5 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +5 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +5 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +5 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +5 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +5 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +5 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +5 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +5 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +5 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +5 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +5 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +5 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +5 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +5 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +5 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +5 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +5 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +5 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +5 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +5 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +5 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +5 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +5 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +5 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +5 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +5 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +299 -297
- package/dist/index.js.map +1 -1
- 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/package.json +5 -1
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finished-terminal-VjZ_-eDD.js","sources":["../../node_modules/chromatic/isChromatic.mjs","../../src/components/finished-terminal/finished-terminal.tsx"],"sourcesContent":["export default function isChromatic(windowArgument) {\n const windowToCheck = windowArgument || (globalThis.window !== undefined && globalThis);\n return !!(\n windowToCheck &&\n (/Chromatic/.test(windowToCheck.navigator.userAgent) ||\n /chromatic=true/.test(windowToCheck.location.href))\n );\n}\n","/* ------------------------------------------------------------------ */\n/* FinishedTerminal — the post-completion success screen. */\n/* */\n/* The \"you're done\" terminal a public flow (e.g. sign.alfadocs.com) */\n/* lands on after the signer finishes. A success tick + a consumer- */\n/* supplied title/body, plus an i18n'd auto-close countdown next-step: */\n/* */\n/* - `redirectUrl` set → on elapse / \"Close now\", navigate there. */\n/* - no `redirectUrl` → best-effort `window.close()` (blocked for */\n/* tabs the signer opened themselves), falling back to a redirect to */\n/* `brandUrl` (the public site). */\n/* */\n/* The browser navigation is the component's DEFAULT; pass `onClose` to */\n/* take it over (analytics, SPA routing, a no-op in stories). The */\n/* countdown freezes under Chromatic for deterministic snapshots. */\n/* ------------------------------------------------------------------ */\n\nimport isChromatic from 'chromatic/isChromatic';\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CheckCircle2 } from 'lucide-react';\nimport { Card } from '../card';\nimport { Button } from '../button';\nimport { useCountdown } from '../../hooks/use-countdown';\n\n/** The public brand site the terminal falls back to when there's no\n * `redirectUrl` and `window.close()` is blocked. */\nconst DEFAULT_BRAND_URL = 'https://www.alfadocs.com';\n\n/**\n * Gate for the URLs the terminal will navigate to. Allows only same-origin\n * relative paths (`/…`) and explicit `http(s)` absolute URLs; rejects\n * `javascript:` / `data:` / `vbscript:` and any other scheme.\n *\n * This terminal lives on public signing pages where `redirectUrl` may flow\n * from a URL parameter, so a hostile `javascript:…` value must never reach\n * `window.location.assign` (it would execute in the page). Exported for unit\n * testing — it is NOT part of the public component API (`index.ts` does not\n * re-export it).\n */\nexport function isNavigableUrl(url: string): boolean {\n if (typeof url !== 'string' || url.length === 0) return false;\n // Protocol-relative `//host` is a classic open-redirect bypass (it resolves\n // to a cross-origin http(s) URL) — reject it; a caller wanting a cross-origin\n // target must pass an explicit `https://` URL.\n if (url.startsWith('//')) return false;\n // Same-origin relative path.\n if (url.startsWith('/')) return true;\n try {\n const { protocol } = new URL(url, window.location.origin);\n return protocol === 'https:' || protocol === 'http:';\n } catch {\n return false;\n }\n}\n\nexport interface FinishedTerminalProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Completion headline — consumer-provided, already translated. */\n title: string;\n /** Completion sub-message — consumer-provided, already translated. */\n body: string;\n /**\n * Auto-close countdown, in seconds. Default `10`. Set `0` to disable the\n * countdown entirely (a static success screen with no next-step).\n */\n autoCloseSeconds?: number;\n /**\n * Where to send the signer when the countdown elapses / \"Close now\" is\n * pressed. When omitted, the terminal does a best-effort `window.close()`\n * and falls back to `brandUrl`.\n *\n * @security Navigated to via `window.location.assign`. Only same-origin\n * relative paths and `http(s)` absolute URLs are honoured — `javascript:` /\n * `data:` values are dropped. Pass a value from trusted backend config.\n */\n redirectUrl?: string;\n /**\n * Brand-site fallback used when there is no `redirectUrl` and the\n * best-effort `window.close()` is blocked. Default `https://www.alfadocs.com`.\n *\n * @security Same navigation gate as `redirectUrl`.\n */\n brandUrl?: string;\n /**\n * Override the default close/redirect behaviour (e.g. SPA routing, analytics,\n * or a no-op in stories). When provided, the terminal does NO browser\n * navigation of its own — it just calls this.\n */\n onClose?: () => void;\n /** Override the countdown line (default `ui.finishedTerminal.autoClose`). */\n countdownLabel?: (seconds: number) => string;\n /** Override the \"Close now\" label (default `ui.finishedTerminal.closeNow`). */\n closeNowLabel?: string;\n /** Override the post-close line (default `ui.finishedTerminal.redirecting`). */\n redirectingLabel?: string;\n}\n\nexport const FinishedTerminal = forwardRef<\n HTMLDivElement,\n FinishedTerminalProps\n>(\n (\n {\n title,\n body,\n autoCloseSeconds = 10,\n redirectUrl,\n brandUrl = DEFAULT_BRAND_URL,\n onClose,\n countdownLabel,\n closeNowLabel,\n redirectingLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [closing, setClosing] = useState(false);\n const closedRef = useRef(false);\n const headingRef = useRef<HTMLHeadingElement>(null);\n\n // Move focus to the completion heading on mount so assistive tech announces\n // the terminal on arrival. This surface is reached by a flow/page\n // transition, which otherwise leaves focus on <body> with no spoken\n // context. The heading is a non-interactive focus receiver (tabIndex={-1},\n // no visible ring) — the SPA \"route changed\" announcement pattern.\n useEffect(() => {\n headingRef.current?.focus();\n }, []);\n\n const handleClose = useCallback(() => {\n if (closedRef.current) return;\n closedRef.current = true;\n setClosing(true);\n if (onClose) {\n onClose();\n return;\n }\n // Default: navigate to the configured return URL, or best-effort close\n // the tab and fall back to the brand site (window.close() is blocked for\n // tabs the user opened themselves, so the redirect is the real fallback).\n // Both URLs are gated against javascript:/data: schemes before navigating.\n if (redirectUrl) {\n if (isNavigableUrl(redirectUrl)) window.location.assign(redirectUrl);\n } else {\n window.close();\n if (isNavigableUrl(brandUrl)) window.location.assign(brandUrl);\n }\n }, [onClose, redirectUrl, brandUrl]);\n\n // Freeze the countdown under Chromatic so the snapshot is deterministic.\n const { remaining } = useCountdown(autoCloseSeconds, {\n autoStart: autoCloseSeconds > 0 && !isChromatic(),\n onElapsed: handleClose,\n });\n const showCountdown = autoCloseSeconds > 0;\n\n const countdownText = countdownLabel\n ? countdownLabel(remaining)\n : t('finishedTerminal.autoClose', { seconds: remaining });\n\n return (\n <div\n ref={ref}\n data-component=\"finished-terminal\"\n className={[\n 'ds:flex ds:flex-1 ds:flex-col ds:items-center ds:overflow-y-auto ds:p-[var(--spacing-lg)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <Card\n variant=\"elevated\"\n className=\"ds:my-auto ds:min-w-0 ds:[inline-size:100%] ds:max-w-[28rem] ds:text-center\"\n >\n <Card.Body>\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]\">\n <CheckCircle2\n aria-hidden=\"true\"\n className=\"ds:size-12 ds:text-[var(--success)]\"\n />\n <h1\n ref={headingRef}\n tabIndex={-1}\n className=\"type-title-card ds:m-0 ds:outline-none\"\n >\n {title}\n </h1>\n <p className=\"type-body ds:m-0 ds:text-[var(--muted-foreground)]\">\n {body}\n </p>\n {showCountdown && closing ? (\n // Mounts once when closing begins → role=\"status\" announces the\n // hand-off exactly once (no churn).\n <p\n role=\"status\"\n className=\"type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]\"\n >\n {redirectingLabel ?? t('finishedTerminal.redirecting')}\n </p>\n ) : showCountdown ? (\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* The ticking count is visible-only — NO live region. A\n polite region re-rewritten every second would announce\n \"…10 sec…9 sec…8 sec…\", which is hostile to SR users. The\n completion itself is announced via the focused heading; the\n auto-close is a sighted convenience. */}\n <p className=\"type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]\">\n {countdownText}\n </p>\n <Button\n intent=\"secondary\"\n size=\"lg\"\n type=\"button\"\n onClick={handleClose}\n >\n {closeNowLabel ?? t('finishedTerminal.closeNow')}\n </Button>\n </div>\n ) : null}\n </div>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\n\nFinishedTerminal.displayName = 'FinishedTerminal';\n"],"names":["isChromatic","windowArgument","windowToCheck","DEFAULT_BRAND_URL","isNavigableUrl","url","protocol","FinishedTerminal","forwardRef","title","body","autoCloseSeconds","redirectUrl","brandUrl","onClose","countdownLabel","closeNowLabel","redirectingLabel","className","rest","ref","t","useTranslation","closing","setClosing","useState","closedRef","useRef","headingRef","useEffect","_a","handleClose","useCallback","remaining","useCountdown","showCountdown","countdownText","jsx","Card","jsxs","CheckCircle2","Button"],"mappings":";;;;;;;AAAe,SAASA,EAAYC,GAAgB;AAClD,QAAMC,IAAmC,WAAW,WAAW,UAAa;AAC5E,SAAO,CAAC,EACNA,MACC,YAAY,KAAKA,EAAc,UAAU,SAAS,KACjD,iBAAiB,KAAKA,EAAc,SAAS,IAAI;AAEvD;AC2BA,MAAMC,IAAoB;AAanB,SAASC,EAAeC,GAAsB;AAKnD,MAJI,OAAOA,KAAQ,YAAYA,EAAI,WAAW,KAI1CA,EAAI,WAAW,IAAI,EAAG,QAAO;AAEjC,MAAIA,EAAI,WAAW,GAAG,EAAG,QAAO;AAChC,MAAI;AACF,UAAM,EAAE,UAAAC,MAAa,IAAI,IAAID,GAAK,OAAO,SAAS,MAAM;AACxD,WAAOC,MAAa,YAAYA,MAAa;AAAA,EAC/C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA8CO,MAAMC,IAAmBC;AAAA,EAI9B,CACE;AAAA,IACE,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,aAAAC;AAAA,IACA,UAAAC,IAAWV;AAAA,IACX,SAAAW;AAAA,IACA,gBA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,EACC,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,kEACb,UAAA;AAAA,cAAA,gBAAAF;AAAA,gBAACG;AAAAA,gBAAA;AAAA,kBACC,eAAY;AAAA,kBACZ,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEZ,gBAAAH;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,KAAKT;AAAA,kBACL,UAAU;AAAA,kBACV,WAAU;AAAA,kBAET,UAAAnB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEH,gBAAA4B,EAAC,KAAA,EAAE,WAAU,sDACV,UAAA3B,GACH;AAAA,cACCyB,KAAiBZ;AAAA;AAAA;AAAA,gBAGhB,gBAAAc;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,WAAU;AAAA,oBAET,UAAApB,KAAoBI,EAAE,8BAA8B;AAAA,kBAAA;AAAA,gBAAA;AAAA,kBAErDc,IACF,gBAAAI,EAAC,OAAA,EAAI,WAAU,kEAMb,UAAA;AAAA,gBAAA,gBAAAF,EAAC,KAAA,EAAE,WAAU,yDACV,UAAAD,GACH;AAAA,gBACA,gBAAAC;AAAA,kBAACI;AAAA,kBAAA;AAAA,oBACC,QAAO;AAAA,oBACP,MAAK;AAAA,oBACL,MAAK;AAAA,oBACL,SAASV;AAAA,oBAER,UAAAf,KAAiBK,EAAE,2BAA2B;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACjD,EAAA,CACF,IACE;AAAA,YAAA,EAAA,CACN,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEAd,EAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-countdown-Yd6ts0_a.js","sources":["../../src/hooks/use-countdown.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseCountdownOptions {\n /** Begin counting down on mount. Default `true`. */\n autoStart?: boolean;\n /** Called exactly once when the countdown reaches zero. */\n onElapsed?: () => void;\n}\n\nexport interface UseCountdownReturn {\n /** Whole seconds remaining; counts down to 0. */\n remaining: number;\n /** Whether the countdown is actively ticking. */\n isRunning: boolean;\n /** (Re)start from the full duration. */\n start: () => void;\n /** Stop and reset to the full duration without firing `onElapsed`. */\n reset: () => void;\n}\n\n/**\n * A pure, render-friendly seconds countdown. It owns no side effects — when\n * it reaches zero it calls `onElapsed` and the CONSUMER decides what to do\n * (close the tab, redirect, …). Same \"no I/O\" contract as `useSigningSession`.\n *\n * `onElapsed` is read through a ref, so changing the callback doesn't restart\n * the timer. SSR-safe: the timer only ticks inside an effect (client-only).\n *\n * @example\n * const { remaining } = useCountdown(10, {\n * onElapsed: () => {\n * window.close(); // best-effort — blocked for user-opened tabs\n * window.location.assign('https://www.alfadocs.com'); // fallback\n * },\n * });\n */\nexport function useCountdown(\n seconds: number,\n options: UseCountdownOptions = {},\n): UseCountdownReturn {\n const { autoStart = true, onElapsed } = options;\n const [remaining, setRemaining] = useState(seconds);\n const [isRunning, setIsRunning] = useState(autoStart);\n\n const onElapsedRef = useRef(onElapsed);\n useEffect(() => {\n onElapsedRef.current = onElapsed;\n }, [onElapsed]);\n\n const start = useCallback(() => {\n setRemaining(seconds);\n setIsRunning(true);\n }, [seconds]);\n\n const reset = useCallback(() => {\n setRemaining(seconds);\n setIsRunning(false);\n }, [seconds]);\n\n // A single interval keyed on `isRunning` (NOT `remaining`) so each second\n // ticks regardless of re-renders — a setTimeout re-scheduled per render\n // misbehaves under fake timers and drops ticks.\n useEffect(() => {\n if (!isRunning) return undefined;\n const id = setInterval(() => {\n setRemaining((r) => Math.max(0, r - 1));\n }, 1000);\n return () => clearInterval(id);\n }, [isRunning]);\n\n // Fire `onElapsed` once when the counter reaches zero, then stop (which\n // tears down the interval above). Gated on `isRunning` so it can't re-fire.\n useEffect(() => {\n if (isRunning && remaining <= 0) {\n setIsRunning(false);\n onElapsedRef.current?.();\n }\n }, [isRunning, remaining]);\n\n return { remaining, isRunning, start, reset };\n}\n"],"names":["useCountdown","seconds","options","autoStart","onElapsed","remaining","setRemaining","useState","isRunning","setIsRunning","onElapsedRef","useRef","useEffect","start","useCallback","reset","id","r","_a"],"mappings":";AAoCO,SAASA,EACdC,GACAC,IAA+B,IACX;AACpB,QAAM,EAAE,WAAAC,IAAY,IAAM,WAAAC,EAAA,IAAcF,GAClC,CAACG,GAAWC,CAAY,IAAIC,EAASN,CAAO,GAC5C,CAACO,GAAWC,CAAY,IAAIF,EAASJ,CAAS,GAE9CO,IAAeC,EAAOP,CAAS;AACrC,EAAAQ,EAAU,MAAM;AACd,IAAAF,EAAa,UAAUN;AAAA,EACzB,GAAG,CAACA,CAAS,CAAC;AAEd,QAAMS,IAAQC,EAAY,MAAM;AAC9B,IAAAR,EAAaL,CAAO,GACpBQ,EAAa,EAAI;AAAA,EACnB,GAAG,CAACR,CAAO,CAAC,GAENc,IAAQD,EAAY,MAAM;AAC9B,IAAAR,EAAaL,CAAO,GACpBQ,EAAa,EAAK;AAAA,EACpB,GAAG,CAACR,CAAO,CAAC;AAKZ,SAAAW,EAAU,MAAM;AACd,QAAI,CAACJ,EAAW;AAChB,UAAMQ,IAAK,YAAY,MAAM;AAC3B,MAAAV,EAAa,CAACW,MAAM,KAAK,IAAI,GAAGA,IAAI,CAAC,CAAC;AAAA,IACxC,GAAG,GAAI;AACP,WAAO,MAAM,cAAcD,CAAE;AAAA,EAC/B,GAAG,CAACR,CAAS,CAAC,GAIdI,EAAU,MAAM;;AACd,IAAIJ,KAAaH,KAAa,MAC5BI,EAAa,EAAK,IAClBS,IAAAR,EAAa,YAAb,QAAAQ,EAAA,KAAAR;AAAA,EAEJ,GAAG,CAACF,GAAWH,CAAS,CAAC,GAElB,EAAE,WAAAA,GAAW,WAAAG,GAAW,OAAAK,GAAO,OAAAE,EAAA;AACxC;"}
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finished-terminal.d.ts","sourceRoot":"","sources":["../../../src/components/finished-terminal/finished-terminal.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAWf;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAcnD;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,CACR;IACC,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,kHAoI5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/finished-terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,UAAU,C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C;AAGlD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
|
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
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/hooks/use-debounced-value.ts","../../src/hooks/use-focus-trap.ts","../../src/hooks/use-countdown.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\n/**\n * Returns a value that lags `input` by `delayMs`. Each new `input`\n * resets the timer; the returned value updates once `input` has been\n * stable for `delayMs` ms.\n *\n * Companion to `useDebouncedCallback` — use this when you want the\n * debounced *value* (to drive a derived effect, query, or render),\n * and use the callback hook when you want the debounced *action*.\n *\n * @example\n * const [query, setQuery] = useState('');\n * const debouncedQuery = useDebouncedValue(query, 250);\n * useEffect(() => { void search(debouncedQuery); }, [debouncedQuery]);\n */\nexport function useDebouncedValue<T>(input: T, delayMs: number): T {\n const [value, setValue] = useState<T>(input);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (delayMs <= 0) {\n // Flush any pending timer so a stale queued value can't land\n // after the synchronous update below.\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setValue(input);\n return;\n }\n const timer = setTimeout(() => {\n setValue(input);\n timerRef.current = null;\n }, delayMs);\n timerRef.current = timer;\n return () => clearTimeout(timer);\n }, [input, delayMs]);\n\n return value;\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Focus trap */\n/* */\n/* Lightweight focus-trap hook for components that compose a Radix */\n/* primitive without the overlay primitive (Dialog, AlertDialog, Sheet) */\n/* — those handle focus trapping for free via `@radix-ui/react-dialog`. */\n/* */\n/* This hook is intentionally NOT a Radix `<FocusScope>` re-export — it */\n/* is a hook so it composes inside `forwardRef` components without */\n/* nesting another wrapper element. If you need the full Radix */\n/* contract (return-focus management, loop, asChild), use */\n/* `@radix-ui/react-focus-scope` directly. */\n/* -------------------------------------------------------------------- */\n\nexport interface UseFocusTrapOptions {\n /** When `false` the trap is inert. Defaults to `true`. */\n enabled?: boolean;\n /**\n * When `true`, focus initial autofocus into the first focusable\n * descendant on mount / enable. @default true\n */\n autoFocus?: boolean;\n /**\n * When `true`, restores focus to the previously-focused element on\n * unmount / disable. @default true\n */\n restoreFocus?: boolean;\n}\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n 'audio[controls]',\n 'video[controls]',\n].join(',');\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => {\n if (el.hidden) return false;\n // `inert` and `aria-hidden=\"true\"` block focus on the element AND\n // all its descendants — walk the chain to catch either ancestor.\n let node: HTMLElement | null = el;\n while (node) {\n if (node.hasAttribute('inert')) return false;\n if (node.getAttribute('aria-hidden') === 'true') return false;\n node = node.parentElement;\n }\n return true;\n });\n}\n\n/**\n * Constrain Tab navigation to descendants of `containerRef`. Wraps Tab\n * forward from the last focusable to the first, and Shift+Tab back from\n * the first to the last. Optionally autofocuses on enable and restores\n * focus on disable.\n *\n * Use this for inline modal patterns or focus zones that don't ship\n * with their own Radix overlay. Don't stack it inside Dialog / Sheet —\n * Radix already traps focus in those.\n *\n * @example\n * const ref = useRef<HTMLDivElement>(null);\n * useFocusTrap(ref, { enabled: open });\n * return <div ref={ref}>…</div>;\n */\nexport function useFocusTrap<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n options: UseFocusTrapOptions = {},\n): void {\n const { enabled = true, autoFocus = true, restoreFocus = true } = options;\n const previouslyFocused = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!enabled) return;\n const container = containerRef.current;\n if (!container) return;\n\n previouslyFocused.current =\n typeof document !== 'undefined' &&\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n if (autoFocus) {\n const focusable = getFocusable(container);\n // Container itself is the fallback focus target — needs `tabIndex`\n // to receive focus, but `-1` is fine.\n const target =\n focusable[0] ?? (container.tabIndex >= -1 ? container : null);\n target?.focus();\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Tab') return;\n const root = containerRef.current;\n if (!root) return;\n const focusable = getFocusable(root);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n\n if (event.shiftKey) {\n if (active === first || !root.contains(active)) {\n event.preventDefault();\n last.focus();\n }\n } else {\n if (active === last || !root.contains(active)) {\n event.preventDefault();\n first.focus();\n }\n }\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n return () => {\n container.removeEventListener('keydown', onKeyDown);\n if (restoreFocus && previouslyFocused.current) {\n // rAF lets parent unmounts settle before refocus — a microtask\n // fires too early and can throw on a detached node.\n const target = previouslyFocused.current;\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus();\n });\n }\n };\n }, [enabled, autoFocus, restoreFocus, containerRef]);\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseCountdownOptions {\n /** Begin counting down on mount. Default `true`. */\n autoStart?: boolean;\n /** Called exactly once when the countdown reaches zero. */\n onElapsed?: () => void;\n}\n\nexport interface UseCountdownReturn {\n /** Whole seconds remaining; counts down to 0. */\n remaining: number;\n /** Whether the countdown is actively ticking. */\n isRunning: boolean;\n /** (Re)start from the full duration. */\n start: () => void;\n /** Stop and reset to the full duration without firing `onElapsed`. */\n reset: () => void;\n}\n\n/**\n * A pure, render-friendly seconds countdown. It owns no side effects — when\n * it reaches zero it calls `onElapsed` and the CONSUMER decides what to do\n * (close the tab, redirect, …). Same \"no I/O\" contract as `useSigningSession`.\n *\n * `onElapsed` is read through a ref, so changing the callback doesn't restart\n * the timer. SSR-safe: the timer only ticks inside an effect (client-only).\n *\n * @example\n * const { remaining } = useCountdown(10, {\n * onElapsed: () => {\n * window.close(); // best-effort — blocked for user-opened tabs\n * window.location.assign('https://www.alfadocs.com'); // fallback\n * },\n * });\n */\nexport function useCountdown(\n seconds: number,\n options: UseCountdownOptions = {},\n): UseCountdownReturn {\n const { autoStart = true, onElapsed } = options;\n const [remaining, setRemaining] = useState(seconds);\n const [isRunning, setIsRunning] = useState(autoStart);\n\n const onElapsedRef = useRef(onElapsed);\n useEffect(() => {\n onElapsedRef.current = onElapsed;\n }, [onElapsed]);\n\n const start = useCallback(() => {\n setRemaining(seconds);\n setIsRunning(true);\n }, [seconds]);\n\n const reset = useCallback(() => {\n setRemaining(seconds);\n setIsRunning(false);\n }, [seconds]);\n\n // A single interval keyed on `isRunning` (NOT `remaining`) so each second\n // ticks regardless of re-renders — a setTimeout re-scheduled per render\n // misbehaves under fake timers and drops ticks.\n useEffect(() => {\n if (!isRunning) return undefined;\n const id = setInterval(() => {\n setRemaining((r) => Math.max(0, r - 1));\n }, 1000);\n return () => clearInterval(id);\n }, [isRunning]);\n\n // Fire `onElapsed` once when the counter reaches zero, then stop (which\n // tears down the interval above). Gated on `isRunning` so it can't re-fire.\n useEffect(() => {\n if (isRunning && remaining <= 0) {\n setIsRunning(false);\n onElapsedRef.current?.();\n }\n }, [isRunning, remaining]);\n\n return { remaining, isRunning, start, reset };\n}\n"],"names":["useDebouncedValue","input","delayMs","value","setValue","useState","timerRef","useRef","useEffect","timer","FOCUSABLE_SELECTOR","getFocusable","container","el","node","useFocusTrap","containerRef","options","enabled","autoFocus","restoreFocus","previouslyFocused","target","onKeyDown","event","root","focusable","first","last","active","useCountdown","seconds","autoStart","onElapsed","remaining","setRemaining","isRunning","setIsRunning","onElapsedRef","start","useCallback","reset","id","r","_a"],"mappings":";;;;;;;;;;;;;;;AAgBO,SAASA,EAAqBC,GAAUC,GAAoB;AACjE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAYJ,CAAK,GACrCK,IAAWC,EAA6C,IAAI;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIN,KAAW,GAAG;AAGhB,MAAII,EAAS,YAAY,SACvB,aAAaA,EAAS,OAAO,GAC7BA,EAAS,UAAU,OAErBF,EAASH,CAAK;AACd;AAAA,IACF;AACA,UAAMQ,IAAQ,WAAW,MAAM;AAC7B,MAAAL,EAASH,CAAK,GACdK,EAAS,UAAU;AAAA,IACrB,GAAGJ,CAAO;AACV,WAAAI,EAAS,UAAUG,GACZ,MAAM,aAAaA,CAAK;AAAA,EACjC,GAAG,CAACR,GAAOC,CAAO,CAAC,GAEZC;AACT;ACTA,MAAMO,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAASC,EAAaC,GAAuC;AAC3D,SAAO,MAAM;AAAA,IACXA,EAAU,iBAA8BF,CAAkB;AAAA,EAAA,EAC1D,OAAO,CAACG,MAAO;AACf,QAAIA,EAAG,OAAQ,QAAO;AAGtB,QAAIC,IAA2BD;AAC/B,WAAOC,KAAM;AAEX,UADIA,EAAK,aAAa,OAAO,KACzBA,EAAK,aAAa,aAAa,MAAM,OAAQ,QAAO;AACxD,MAAAA,IAAOA,EAAK;AAAA,IACd;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAiBO,SAASC,EACdC,GACAC,IAA+B,IACzB;AACN,QAAM,EAAE,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AASc,EACdC,GACAd,IAA+B,IACX;AACpB,QAAM,EAAE,WAAAe,IAAY,IAAM,WAAAC,EAAA,IAAchB,GAClC,CAACiB,GAAWC,CAAY,IAAI9B,EAAS0B,CAAO,GAC5C,CAACK,GAAWC,CAAY,IAAIhC,EAAS2B,CAAS,GAE9CM,IAAe/B,EAAO0B,CAAS;AACrC,EAAAzB,EAAU,MAAM;AACd,IAAA8B,EAAa,UAAUL;AAAA,EACzB,GAAG,CAACA,CAAS,CAAC;AAEd,QAAMM,IAAQC,EAAY,MAAM;AAC9B,IAAAL,EAAaJ,CAAO,GACpBM,EAAa,EAAI;AAAA,EACnB,GAAG,CAACN,CAAO,CAAC,GAENU,IAAQD,EAAY,MAAM;AAC9B,IAAAL,EAAaJ,CAAO,GACpBM,EAAa,EAAK;AAAA,EACpB,GAAG,CAACN,CAAO,CAAC;AAKZ,SAAAvB,EAAU,MAAM;AACd,QAAI,CAAC4B,EAAW;AAChB,UAAMM,IAAK,YAAY,MAAM;AAC3B,MAAAP,EAAa,CAACQ,MAAM,KAAK,IAAI,GAAGA,IAAI,CAAC,CAAC;AAAA,IACxC,GAAG,GAAI;AACP,WAAO,MAAM,cAAcD,CAAE;AAAA,EAC/B,GAAG,CAACN,CAAS,CAAC,GAId5B,EAAU,MAAM;;AACd,IAAI4B,KAAaF,KAAa,MAC5BG,EAAa,EAAK,IAClBO,IAAAN,EAAa,YAAb,QAAAM,EAAA,KAAAN;AAAA,EAEJ,GAAG,CAACF,GAAWF,CAAS,CAAC,GAElB,EAAE,WAAAA,GAAW,WAAAE,GAAW,OAAAG,GAAO,OAAAE,EAAA;AACxC;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/hooks/use-debounced-value.ts","../../src/hooks/use-focus-trap.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\n/**\n * Returns a value that lags `input` by `delayMs`. Each new `input`\n * resets the timer; the returned value updates once `input` has been\n * stable for `delayMs` ms.\n *\n * Companion to `useDebouncedCallback` — use this when you want the\n * debounced *value* (to drive a derived effect, query, or render),\n * and use the callback hook when you want the debounced *action*.\n *\n * @example\n * const [query, setQuery] = useState('');\n * const debouncedQuery = useDebouncedValue(query, 250);\n * useEffect(() => { void search(debouncedQuery); }, [debouncedQuery]);\n */\nexport function useDebouncedValue<T>(input: T, delayMs: number): T {\n const [value, setValue] = useState<T>(input);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (delayMs <= 0) {\n // Flush any pending timer so a stale queued value can't land\n // after the synchronous update below.\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setValue(input);\n return;\n }\n const timer = setTimeout(() => {\n setValue(input);\n timerRef.current = null;\n }, delayMs);\n timerRef.current = timer;\n return () => clearTimeout(timer);\n }, [input, delayMs]);\n\n return value;\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Focus trap */\n/* */\n/* Lightweight focus-trap hook for components that compose a Radix */\n/* primitive without the overlay primitive (Dialog, AlertDialog, Sheet) */\n/* — those handle focus trapping for free via `@radix-ui/react-dialog`. */\n/* */\n/* This hook is intentionally NOT a Radix `<FocusScope>` re-export — it */\n/* is a hook so it composes inside `forwardRef` components without */\n/* nesting another wrapper element. If you need the full Radix */\n/* contract (return-focus management, loop, asChild), use */\n/* `@radix-ui/react-focus-scope` directly. */\n/* -------------------------------------------------------------------- */\n\nexport interface UseFocusTrapOptions {\n /** When `false` the trap is inert. Defaults to `true`. */\n enabled?: boolean;\n /**\n * When `true`, focus initial autofocus into the first focusable\n * descendant on mount / enable. @default true\n */\n autoFocus?: boolean;\n /**\n * When `true`, restores focus to the previously-focused element on\n * unmount / disable. @default true\n */\n restoreFocus?: boolean;\n}\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n 'audio[controls]',\n 'video[controls]',\n].join(',');\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => {\n if (el.hidden) return false;\n // `inert` and `aria-hidden=\"true\"` block focus on the element AND\n // all its descendants — walk the chain to catch either ancestor.\n let node: HTMLElement | null = el;\n while (node) {\n if (node.hasAttribute('inert')) return false;\n if (node.getAttribute('aria-hidden') === 'true') return false;\n node = node.parentElement;\n }\n return true;\n });\n}\n\n/**\n * Constrain Tab navigation to descendants of `containerRef`. Wraps Tab\n * forward from the last focusable to the first, and Shift+Tab back from\n * the first to the last. Optionally autofocuses on enable and restores\n * focus on disable.\n *\n * Use this for inline modal patterns or focus zones that don't ship\n * with their own Radix overlay. Don't stack it inside Dialog / Sheet —\n * Radix already traps focus in those.\n *\n * @example\n * const ref = useRef<HTMLDivElement>(null);\n * useFocusTrap(ref, { enabled: open });\n * return <div ref={ref}>…</div>;\n */\nexport function useFocusTrap<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n options: UseFocusTrapOptions = {},\n): void {\n const { enabled = true, autoFocus = true, restoreFocus = true } = options;\n const previouslyFocused = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!enabled) return;\n const container = containerRef.current;\n if (!container) return;\n\n previouslyFocused.current =\n typeof document !== 'undefined' &&\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n if (autoFocus) {\n const focusable = getFocusable(container);\n // Container itself is the fallback focus target — needs `tabIndex`\n // to receive focus, but `-1` is fine.\n const target =\n focusable[0] ?? (container.tabIndex >= -1 ? container : null);\n target?.focus();\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Tab') return;\n const root = containerRef.current;\n if (!root) return;\n const focusable = getFocusable(root);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n\n if (event.shiftKey) {\n if (active === first || !root.contains(active)) {\n event.preventDefault();\n last.focus();\n }\n } else {\n if (active === last || !root.contains(active)) {\n event.preventDefault();\n first.focus();\n }\n }\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n return () => {\n container.removeEventListener('keydown', onKeyDown);\n if (restoreFocus && previouslyFocused.current) {\n // rAF lets parent unmounts settle before refocus — a microtask\n // fires too early and can throw on a detached node.\n const target = previouslyFocused.current;\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus();\n });\n }\n };\n }, [enabled, autoFocus, restoreFocus, containerRef]);\n}\n"],"names":["useDebouncedValue","input","delayMs","value","setValue","useState","timerRef","useRef","useEffect","timer","FOCUSABLE_SELECTOR","getFocusable","container","el","node","useFocusTrap","containerRef","options","enabled","autoFocus","restoreFocus","previouslyFocused","target","onKeyDown","event","root","focusable","first","last","active"],"mappings":";;;;;;;;;;;;;;;;AAgBO,SAASA,EAAqBC,GAAUC,GAAoB;AACjE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAYJ,CAAK,GACrCK,IAAWC,EAA6C,IAAI;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIN,KAAW,GAAG;AAGhB,MAAII,EAAS,YAAY,SACvB,aAAaA,EAAS,OAAO,GAC7BA,EAAS,UAAU,OAErBF,EAASH,CAAK;AACd;AAAA,IACF;AACA,UAAMQ,IAAQ,WAAW,MAAM;AAC7B,MAAAL,EAASH,CAAK,GACdK,EAAS,UAAU;AAAA,IACrB,GAAGJ,CAAO;AACV,WAAAI,EAAS,UAAUG,GACZ,MAAM,aAAaA,CAAK;AAAA,EACjC,GAAG,CAACR,GAAOC,CAAO,CAAC,GAEZC;AACT;ACTA,MAAMO,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAASC,EAAaC,GAAuC;A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AAM,eAAA,GACNG,EAAM,MAAA;AAAA,IAGZ;AAEA,WAAAf,EAAU,iBAAiB,WAAWW,CAAS,GAExC,MAAM;AAEX,UADAX,EAAU,oBAAoB,WAAWW,CAAS,GAC9CH,KAAgBC,EAAkB,SAAS;AAG7C,cAAMC,IAASD,EAAkB;AACjC,8BAAsB,MAAM;AAC1B,UAAIC,EAAO,eAAaA,EAAO,MAAA;AAAA,QACjC,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,GAAG,CAACJ,GAASC,GAAWC,GAAcJ,CAAY,CAAC;AACrD;"}
|
|
@@ -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: "وقّع هنا";
|