@alfadocs/ui-kit-debug 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/finished-terminal-VjZ_-eDD.js.map +1 -0
- package/dist/_chunks/pdf-viewer-chMpwpA4.js +979 -0
- package/dist/_chunks/pdf-viewer-chMpwpA4.js.map +1 -0
- package/dist/_chunks/{sign-document-BmAT0kKD.js → sign-document--nr5cxsB.js} +2 -2
- package/dist/_chunks/{sign-document-BmAT0kKD.js.map → sign-document--nr5cxsB.js.map} +1 -1
- package/dist/_chunks/signature-field-DbhbpLha.js +190 -0
- package/dist/_chunks/signature-field-DbhbpLha.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/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- 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/components/signature-field/signature-field.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/dist/tokens.css +1 -1
- package/package.json +7 -1
- package/dist/_chunks/pdf-viewer-XxWdtKfD.js +0 -965
- package/dist/_chunks/pdf-viewer-XxWdtKfD.js.map +0 -1
- package/dist/_chunks/signature-field-DhscKdgk.js +0 -152
- package/dist/_chunks/signature-field-DhscKdgk.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-field-DbhbpLha.js","sources":["../../node_modules/lucide-react/dist/esm/icons/pen-line.js","../../src/components/signature-field/signature-field.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M13 21h8\", key: \"1jsn5i\" }],\n [\n \"path\",\n {\n 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\",\n key: \"1a8usu\"\n }\n ]\n];\nconst PenLine = createLucideIcon(\"pen-line\", __iconNode);\n\nexport { __iconNode, PenLine as default };\n//# sourceMappingURL=pen-line.js.map\n","/* ------------------------------------------------------------------ */\n/* SignatureField — a single percent-positioned signature placeholder */\n/* rendered inside a PDFViewer page overlay (renderPageOverlay). */\n/* */\n/* Promoted from the story-only field demonstrated in */\n/* pdf-viewer.stories.tsx `WithSignatureFieldOverlays` (HTP-4889): the */\n/* sign.alfadocs.com rebuild needs N of these positioned over each PDF */\n/* page, each a real, keyboard-activatable control whose visual + a11y */\n/* state tracks unsigned → signing → signed. */\n/* */\n/* - Geometry: the consumer supplies percent coordinates */\n/* (insetInlineStart / insetBlockStart / inlineSize / blockSize) */\n/* relative to the overlay box. These are runtime-computed layout */\n/* values driven by consumer data, so they ride an inline `style` */\n/* per 23-constraints §Runtime-computed dimensions — the same */\n/* sanctioned exception PDFViewer/SignatureCapture use. All static */\n/* styling stays in CVA + tokens. Logical properties only, so the */\n/* field mirrors correctly over an RTL document. */\n/* - It IS an interactive control: a real <button>. The accessible name */\n/* reflects state (Sign here / Signing… / Signed); the 44/48px target */\n/* floor is enforced via --min-target-size. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, PenLine } from 'lucide-react';\nimport { Spinner } from '../spinner';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type SignatureFieldState = 'unsigned' | 'signing' | 'signed';\n\nexport interface SignatureFieldProps extends Omit<\n ComponentPropsWithoutRef<'button'>,\n 'onClick' | 'children' | 'aria-label' | 'disabled'\n> {\n /** Lifecycle state. Drives both the visual treatment and the accessible name. */\n state?: SignatureFieldState;\n /**\n * Percent offset of the field's logical start edge within the overlay box.\n * Applied as a runtime-computed `inset-inline-start: {n}%`.\n */\n insetInlineStart?: number;\n /** Percent offset of the field's logical top edge. `inset-block-start: {n}%`. */\n insetBlockStart?: number;\n /** Percent of the overlay's logical inline size — the field width. */\n inlineSize?: number;\n /** Percent of the overlay's logical block size — the field height. */\n blockSize?: number;\n /** Called when an unsigned (or signed) field is activated by click / keyboard. */\n onActivate?: () => void;\n /** Captured signature image (PNG data URL or URL) shown when `state=\"signed\"`. */\n signedImageSrc?: string;\n /**\n * Caption shown in the unsigned prompt and used as the accessible name\n * (e.g. \"Sign here\", \"Date\", \"Initial here\"). Falls back to the\n * translated default prompt.\n */\n label?: string;\n /** Hard-disable the field (non-activatable, dimmed). Distinct from `state=\"signing\"`. */\n disabled?: boolean;\n /**\n * Marks the field as the one currently targeted by field-to-field navigation\n * (Next / Previous signature). Renders a **persistent** selection ring — not\n * the transient `:focus-visible` ring — so the signer can see which field\n * they're on as they step through, even after focus moves or is programmatic.\n */\n active?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst signatureFieldVariants = cva(\n [\n // Overlay fields are always absolutely positioned within the\n // renderPageOverlay box; the percent geometry rides the inline style.\n 'ds:absolute',\n 'ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]',\n // The visible box renders at its true percentage geometry. A min-size\n // floor here overstretched short fields past their authored box, so\n // neighbours collided (signed box overlapping the next field). The 44/48px\n // touch target is instead restored via a transparent ::before hit-area\n // expansion — the same pattern Button's `sm` size uses — applied on touch\n // viewports only; on desktop the precise box is the target.\n 'ds:before:absolute ds:before:content-[\"\"]',\n 'ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)]',\n 'ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)]',\n 'ds:sm:before:hidden',\n // Inline padding lives on the per-state variants below (not the base) so\n // the signed state's tighter padding can't collide with a base ps/pe on\n // the same logical side under Tailwind's JIT ordering.\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[length:var(--font-size-sm)] ds:font-medium',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:aria-disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n state: {\n unsigned: [\n 'ds:cursor-pointer',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:border ds:border-dashed ds:border-[color:var(--ring)]',\n 'ds:bg-[color-mix(in_srgb,var(--info)_8%,transparent)]',\n 'ds:text-[var(--foreground)]',\n 'ds:hover:bg-[color-mix(in_srgb,var(--info)_16%,transparent)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n signing: [\n 'ds:cursor-progress',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:border ds:border-dashed ds:border-[color:var(--border)]',\n 'ds:bg-[var(--muted)]',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n signed: [\n // overflow-hidden is NOT on the button root — it would clip the\n // ::before touch-target expansion. It lives on the inner image\n // wrapper instead (see render).\n 'ds:cursor-pointer',\n 'ds:p-[var(--spacing-xs)]',\n 'ds:border ds:border-solid ds:border-[color:var(--success)]',\n 'ds:bg-[color-mix(in_srgb,var(--success)_8%,transparent)]',\n 'ds:text-[var(--foreground)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n },\n // Persistent selection ring for the nav-targeted field. Uses the same\n // tokens as the focus ring but is NOT gated on :focus-visible, so it\n // stays visible as the signer steps between fields. When the field is\n // also focused, the base focus-visible ring composes over it (same\n // outline property, same value) — no visual clash.\n active: {\n true: [\n 'ds:outline-solid',\n 'ds:outline-[length:var(--focus-ring-width)]',\n 'ds:outline-[var(--ring)]',\n 'ds:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:outline-[Highlight]',\n ].join(' '),\n false: '',\n },\n },\n defaultVariants: { state: 'unsigned', active: false },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* SignatureField */\n/* ------------------------------------------------------------------ */\n\nexport const SignatureField = forwardRef<\n HTMLButtonElement,\n SignatureFieldProps\n>(\n (\n {\n state = 'unsigned',\n insetInlineStart,\n insetBlockStart,\n inlineSize,\n blockSize,\n onActivate,\n signedImageSrc,\n label,\n disabled = false,\n active = false,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const inactive = disabled || state === 'signing';\n\n // Runtime-computed overlay geometry — consumer percent coordinates over\n // the PDF page. Inline style is the sanctioned exception here\n // (23-constraints §Runtime-computed dimensions); logical properties keep\n // the field mirrored over RTL documents.\n const geometry: CSSProperties = {};\n if (insetInlineStart !== undefined) {\n geometry.insetInlineStart = `${insetInlineStart}%`;\n }\n if (insetBlockStart !== undefined) {\n geometry.insetBlockStart = `${insetBlockStart}%`;\n }\n if (inlineSize !== undefined) {\n geometry.inlineSize = `${inlineSize}%`;\n }\n if (blockSize !== undefined) {\n geometry.blockSize = `${blockSize}%`;\n }\n\n // `prompt` is the visible caption fallback; `unsigned` is the\n // accessible-name fallback — intentionally distinct strings.\n const promptText = label ?? t('signatureField.prompt');\n // The signed/signing names compose the field's `label` with the status so\n // several signed fields on one page stay individually identifiable (signed\n // fields remain activatable for re-signing); falls back to the bare status\n // when no label is supplied.\n const accessibleName =\n state === 'signing'\n ? label\n ? t('signatureField.signingNamed', { label })\n : t('signatureField.signing')\n : state === 'signed'\n ? label\n ? t('signatureField.signedNamed', { label })\n : t('signatureField.signed')\n : (label ?? t('signatureField.unsigned'));\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>): void {\n if (inactive) {\n event.preventDefault();\n return;\n }\n onActivate?.();\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n {...rest}\n data-component=\"signature-field\"\n data-component-id={id}\n data-state={state}\n data-active={active || undefined}\n aria-label={accessibleName}\n aria-disabled={inactive || undefined}\n aria-busy={state === 'signing' || undefined}\n onClick={handleClick}\n className={[signatureFieldVariants({ state, active }), className]\n .filter(Boolean)\n .join(' ')}\n // eslint-disable-next-line react/forbid-dom-props -- runtime-computed overlay geometry: consumer percent coordinates over the PDF page (23-constraints §Runtime-computed dimensions)\n style={geometry}\n >\n {state === 'signing' ? (\n // Decorative: the button's aria-label + aria-busy are the single\n // source of the status announcement, so the Spinner's own\n // role=\"status\" live region is hidden from assistive tech.\n <span aria-hidden=\"true\">\n <Spinner size=\"sm\" label={t('signatureField.signing')} />\n </span>\n ) : state === 'signed' ? (\n signedImageSrc ? (\n // overflow-hidden + rounding live on this inner wrapper (not the\n // button root) so the signature is clipped to the box WITHOUT\n // clipping the button's ::before touch-target expansion.\n <span className=\"ds:inline-size-full ds:block-size-full ds:overflow-hidden ds:rounded-[var(--radius-sm)]\">\n <img\n src={signedImageSrc}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"ds:block-size-full ds:inline-size-full ds:object-contain\"\n />\n </span>\n ) : (\n <>\n <Check\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4 ds:text-[var(--success)]\"\n />\n <span>{t('signatureField.signed')}</span>\n </>\n )\n ) : (\n <>\n <PenLine\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n <span>{promptText}</span>\n </>\n )}\n </button>\n );\n },\n);\n\nSignatureField.displayName = 'SignatureField';\n\nexport { signatureFieldVariants };\n"],"names":["__iconNode","PenLine","createLucideIcon","signatureFieldVariants","cva","SignatureField","forwardRef","state","insetInlineStart","insetBlockStart","inlineSize","blockSize","onActivate","signedImageSrc","label","disabled","active","id","className","rest","ref","t","useTranslation","inactive","geometry","promptText","accessibleName","handleClick","event","jsx","Spinner","jsxs","Fragment","Check"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAUC,EAAiB,YAAYF,CAAU,GC+DjDG,IAAyBC;AAAA,EAC7B;AAAA;AAAA;AAAA,IAGE;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,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ACL,KAAI;AAAA,cACJ,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA,EACZ,CACF;AAAA,YAEA,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAJ,EAAC,QAAA,EAAM,UAAAR,EAAE,uBAAuB,EAAA,CAAE;AAAA,QAAA,EAAA,CACpC,IAGF,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAH;AAAA,YAAC5B;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAA4B,EAAC,UAAM,UAAAJ,EAAA,CAAW;AAAA,QAAA,EAAA,CACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEApB,EAAe,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,CAAC;AAClB,YAAY,EACV,SAAS,EACT,eAAe,EACf,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAGlB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AAEzC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAO/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,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ACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAO3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;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"}
|
|
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,CAAC;AAClB,YAAY,EACV,SAAS,EACT,eAAe,EACf,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAGlB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC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AAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAO3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;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"}
|
|
@@ -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. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/pdf-viewer/pdf-viewer.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA0Cf,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAC;AAE9E,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IACvC,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,SAAS,CAAC;IAC5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E,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAMD,QAAA,MAAM,eAAe,oFAiBpB,CAAC;AAEF,QAAA,MAAM,eAAe,oFAQpB,CAAC;AAEF,QAAA,MAAM,qBAAqB,oFAiB1B,CAAC;AAmHF,eAAO,MAAM,SAAS,4GAyfrB,CAAC;AAyoBF,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-field.d.ts","sourceRoot":"","sources":["../../../src/components/signature-field/signature-field.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,wBAAwB,EAG9B,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,wBAAwB,CAAC,QAAQ,CAAC,EAClC,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CACnD;IACC,iFAAiF;IACjF,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"signature-field.d.ts","sourceRoot":"","sources":["../../../src/components/signature-field/signature-field.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,wBAAwB,EAG9B,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,wBAAwB,CAAC,QAAQ,CAAC,EAClC,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CACnD;IACC,iFAAiF;IACjF,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD,QAAA,MAAM,sBAAsB;;;8EA+E3B,CAAC;AAMF,eAAO,MAAM,cAAc,mHAkI1B,CAAC;AAIF,OAAO,EAAE,sBAAsB,EAAE,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,QAAI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;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,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QD,EAAU,CAAC,GACnBE,IAAOF,EAAUA,EAAU,SAAS,CAAC,GACrCG,IAAS,SAAS;AAExB,MAAIL,EAAM,YACJK,MAAWF,KAAS,CAACF,EAAK,SAASI,CAAM,OAC3CL,EAAM,eAAA,GACNI,EAAK,MAAA,MAGHC,MAAWD,KAAQ,CAACH,EAAK,SAASI,CAAM,OAC1CL,EAAM,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: "وقّع هنا";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/ar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmmFP,CAAC"}
|
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: "وقّع هنا",
|