@alfadocs/ui-kit 0.38.0 → 0.39.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/{accordion-bSU21uTV.js → accordion-9lJSMMsZ.js} +6 -6
- package/dist/_chunks/{agenda-tray-By_asPN9.js → agenda-tray-Dyj9ChHC.js} +22 -21
- package/dist/_chunks/{bmi-calculator-BRUru9QX.js → bmi-calculator-DnEr513I.js} +2 -2
- package/dist/_chunks/{booking-DK_BPHnQ.js → booking-4mCw3Mpl.js} +2 -2
- package/dist/_chunks/{chart-DnHvmiDX.js → chart-Cbt0_sKv.js} +46 -37
- package/dist/_chunks/{collapsible-CERONory.js → collapsible-X3oaLPU3.js} +5 -5
- package/dist/_chunks/{document-scanner-CdHQ6lTN.js → document-scanner-CqS_klIr.js} +56 -55
- package/dist/_chunks/{editable-currency-cell-renderer-DGKuRNVG.js → editable-currency-cell-renderer-DgkCIIcO.js} +2 -2
- package/dist/_chunks/{file-upload-CnzRcErt.js → file-upload-BosbPDb1.js} +2 -2
- package/dist/_chunks/{freemium-paywall-D1N02Oam.js → freemium-paywall-BAk3a6er.js} +7 -7
- package/dist/_chunks/header-settings-CBLwUK6t.js +244 -0
- package/dist/_chunks/{map-view-vD5pvWs9.js → map-view-qJLybrmN.js} +2 -2
- package/dist/_chunks/marketplace-app-shell-BlxVizU4.js +296 -0
- package/dist/_chunks/{message-card-BbRhZkDI.js → message-card-DSPw5ghw.js} +20 -19
- package/dist/_chunks/{message-tray-B762TKuv.js → message-tray-hSQff9u4.js} +3 -3
- package/dist/_chunks/{notification-card-DMdO4g54.js → notification-card-CObnGdJu.js} +22 -21
- package/dist/_chunks/{notification-tray-Dl3FTleW.js → notification-tray-BWHDIjgd.js} +2 -2
- package/dist/_chunks/{otp-input-CDTWT5EK.js → otp-input-CMphfBxZ.js} +70 -71
- package/dist/_chunks/{patient-shell-Bz3CdO84.js → patient-shell-DF81lALv.js} +36 -35
- package/dist/_chunks/{payment-form-D5rgnZu7.js → payment-form-Dy3WIIsC.js} +18 -18
- package/dist/_chunks/{pdf-viewer-DvtEHcEP.js → pdf-viewer-Cy6Ul3hZ.js} +2 -2
- package/dist/_chunks/{practice-results-C8ciLQap.js → practice-results-C0d4IL5E.js} +2 -2
- package/dist/_chunks/{public-footer.agent-zw1vFin_.js → public-footer.agent-okt8ZRc5.js} +2 -2
- package/dist/_chunks/{reviews-panel-Dow8Dzoa.js → reviews-panel-CPrXu5TX.js} +2 -2
- package/dist/_chunks/{sidebar-BbR8f6oe.js → sidebar-_vJXI9rB.js} +2 -2
- package/dist/_chunks/sign-document-DId1p-nn.js +315 -0
- package/dist/_chunks/{signature-capture-C-fF71xI.js → signature-capture-BRzCklg4.js} +27 -24
- package/dist/_chunks/{sparkline-DEROcSl0.js → sparkline-DGhCSw8M.js} +55 -46
- package/dist/_chunks/{stepper-accordion-BfS6lUB9.js → stepper-accordion-Dki6r9ZE.js} +2 -2
- package/dist/_chunks/{tag-CyoaEmf_.js → tag-CdA0s_VV.js} +16 -16
- package/dist/_chunks/{task-card-BUVMh6HN.js → task-card-CPyQ5AXC.js} +6 -5
- package/dist/_chunks/{task-tray-DRK0b0Qb.js → task-tray-B8jFv5FV.js} +36 -35
- package/dist/_chunks/{transcript-panel-DyhTpAP7.js → transcript-panel-CR7VY1uw.js} +8 -7
- package/dist/_chunks/{warning-stack-bDicCvxs.js → warning-stack-DNR3-IbP.js} +17 -16
- package/dist/_chunks/{workflow-map-uSiHbOWQ.js → workflow-map-C3gB0FvB.js} +3 -2
- package/dist/agent-catalog.json +39 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/chart/chart.d.ts +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header-settings/header-settings.agent.d.ts +4 -0
- package/dist/components/header-settings/header-settings.d.ts +36 -0
- package/dist/components/header-settings/index.d.ts +2 -0
- package/dist/components/header-settings/index.js +2 -241
- package/dist/components/index.d.ts +1 -0
- package/dist/components/locale-picker/locale-picker.agent.d.ts +4 -0
- package/dist/components/locale-picker/locale-picker.d.ts +80 -0
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/otp-input/index.d.ts +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sign-document/index.d.ts +4 -0
- package/dist/components/sign-document/index.js +6 -0
- package/dist/components/sign-document/sign-document.agent.d.ts +4 -0
- package/dist/components/sign-document/sign-document.d.ts +47 -0
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.d.ts +1 -1
- package/dist/components/stepper-accordion/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locale-meta.d.ts +56 -0
- package/dist/i18n/locales/ar.d.ts +22 -0
- package/dist/i18n/locales/ar.js +22 -0
- package/dist/i18n/locales/de.d.ts +22 -0
- package/dist/i18n/locales/de.js +22 -0
- package/dist/i18n/locales/el.d.ts +22 -0
- package/dist/i18n/locales/el.js +22 -0
- package/dist/i18n/locales/en.d.ts +22 -0
- package/dist/i18n/locales/en.js +22 -0
- package/dist/i18n/locales/es.d.ts +22 -0
- package/dist/i18n/locales/es.js +22 -0
- package/dist/i18n/locales/fr.d.ts +22 -0
- package/dist/i18n/locales/fr.js +22 -0
- package/dist/i18n/locales/hi.d.ts +22 -0
- package/dist/i18n/locales/hi.js +22 -0
- package/dist/i18n/locales/it.d.ts +22 -0
- package/dist/i18n/locales/it.js +22 -0
- package/dist/i18n/locales/ja.d.ts +22 -0
- package/dist/i18n/locales/ja.js +22 -0
- package/dist/i18n/locales/nl.d.ts +22 -0
- package/dist/i18n/locales/nl.js +22 -0
- package/dist/i18n/locales/pl.d.ts +22 -0
- package/dist/i18n/locales/pl.js +22 -0
- package/dist/i18n/locales/pt.d.ts +22 -0
- package/dist/i18n/locales/pt.js +22 -0
- package/dist/i18n/locales/ro.d.ts +22 -0
- package/dist/i18n/locales/ro.js +22 -0
- package/dist/i18n/locales/ru.d.ts +22 -0
- package/dist/i18n/locales/ru.js +22 -0
- package/dist/i18n/locales/sq.d.ts +22 -0
- package/dist/i18n/locales/sq.js +22 -0
- package/dist/i18n/locales/sv.d.ts +22 -0
- package/dist/i18n/locales/sv.js +22 -0
- package/dist/i18n/locales/tr.d.ts +22 -0
- package/dist/i18n/locales/tr.js +22 -0
- package/dist/i18n/locales/zh.d.ts +22 -0
- package/dist/i18n/locales/zh.js +22 -0
- package/dist/index.js +110 -107
- package/dist/locales/ar.json +22 -0
- package/dist/locales/de.json +22 -0
- package/dist/locales/el.json +22 -0
- package/dist/locales/en.json +22 -0
- package/dist/locales/es.json +22 -0
- package/dist/locales/fr.json +22 -0
- package/dist/locales/hi.json +22 -0
- package/dist/locales/it.json +22 -0
- package/dist/locales/ja.json +22 -0
- package/dist/locales/nl.json +22 -0
- package/dist/locales/pl.json +22 -0
- package/dist/locales/pt.json +22 -0
- package/dist/locales/ro.json +22 -0
- package/dist/locales/ru.json +22 -0
- package/dist/locales/sq.json +22 -0
- package/dist/locales/sv.json +22 -0
- package/dist/locales/tr.json +22 -0
- package/dist/locales/zh.json +22 -0
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +12 -8
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/marketplace-app-shell-BnClrL2B.js +0 -295
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ie, useId as oe, useMemo as M, useRef as k, useState as b, useEffect as L, useCallback as c, useImperativeHandle as de } from "react";
|
|
3
|
+
import { c as i } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ce } from "react-i18next";
|
|
5
|
+
import { P as le } from "./pdf-viewer-Cy6Ul3hZ.js";
|
|
6
|
+
import { S as ge } from "./signature-capture-BRzCklg4.js";
|
|
7
|
+
import { u as me } from "./registry-nPAVE19X.js";
|
|
8
|
+
import { C as O } from "./circle-check-9AeSgJD_.js";
|
|
9
|
+
const ue = {
|
|
10
|
+
id: "sign-document",
|
|
11
|
+
capabilities: ["submit"],
|
|
12
|
+
state: {
|
|
13
|
+
isReadComplete: {
|
|
14
|
+
type: "boolean",
|
|
15
|
+
descriptionKey: "signDocument.agent.state.isReadComplete",
|
|
16
|
+
description: "True when the reader has reached the last page (or read-gating is off).",
|
|
17
|
+
read: (n) => n.isReadComplete()
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
submit: {
|
|
22
|
+
safety: "write",
|
|
23
|
+
descriptionKey: "signDocument.agent.actions.confirm",
|
|
24
|
+
description: "Confirm the current signature, emitting it via onSign. No-op if unsigned.",
|
|
25
|
+
invoke: (n) => n.confirm()
|
|
26
|
+
},
|
|
27
|
+
reset: {
|
|
28
|
+
safety: "destructive",
|
|
29
|
+
descriptionKey: "signDocument.agent.actions.reset",
|
|
30
|
+
description: "Clear the captured signature and return to unsigned.",
|
|
31
|
+
invoke: (n) => {
|
|
32
|
+
n.reset();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
domHooks: {
|
|
37
|
+
root: {
|
|
38
|
+
attr: "data-component",
|
|
39
|
+
value: "sign-document",
|
|
40
|
+
description: "Marks the SignDocument wrapper."
|
|
41
|
+
},
|
|
42
|
+
instanceId: {
|
|
43
|
+
attr: "data-component-id",
|
|
44
|
+
sourceProp: "id",
|
|
45
|
+
description: "Sourced from the id prop."
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, pe = i(
|
|
49
|
+
[
|
|
50
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
51
|
+
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--card-border)]",
|
|
52
|
+
"ds:shadow-[var(--shadow-card)] ds:[.theme-accessible_&]:border-2",
|
|
53
|
+
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
54
|
+
"ds:p-[var(--spacing-md)]",
|
|
55
|
+
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
|
|
56
|
+
].join(" ")
|
|
57
|
+
), fe = i(
|
|
58
|
+
["type-heading-sm ds:text-[var(--foreground)]"].join(" ")
|
|
59
|
+
), ve = i(
|
|
60
|
+
["ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"].join(" ")
|
|
61
|
+
), be = i(
|
|
62
|
+
["type-body-sm ds:font-medium ds:text-[var(--foreground)]"].join(" ")
|
|
63
|
+
), he = i(
|
|
64
|
+
[
|
|
65
|
+
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
66
|
+
"type-body-sm ds:text-[var(--muted-foreground)]"
|
|
67
|
+
].join(" ")
|
|
68
|
+
), ye = i(
|
|
69
|
+
[
|
|
70
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
71
|
+
"type-body-sm",
|
|
72
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
73
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
74
|
+
"ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
|
|
75
|
+
"ds:bg-[color-mix(in_srgb,var(--info)_10%,transparent)]",
|
|
76
|
+
"ds:text-[var(--foreground)]",
|
|
77
|
+
"ds:border ds:border-[color:color-mix(in_srgb,var(--info)_40%,transparent)]"
|
|
78
|
+
].join(" ")
|
|
79
|
+
), xe = i(
|
|
80
|
+
[
|
|
81
|
+
"ds:inline-flex ds:items-center ds:justify-center ds:self-start",
|
|
82
|
+
"ds:min-block-size-[var(--min-target-size)]",
|
|
83
|
+
"ds:min-inline-size-[var(--min-target-size)]",
|
|
84
|
+
"ds:gap-[var(--spacing-xs)]",
|
|
85
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
86
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
87
|
+
"ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]",
|
|
88
|
+
"ds:text-[length:var(--font-size-sm)] ds:font-medium",
|
|
89
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
90
|
+
"ds:hover:bg-[var(--primary-hover)]",
|
|
91
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
92
|
+
"ds:focus-visible:outline-solid",
|
|
93
|
+
"ds:focus-visible:outline-[var(--ring)]",
|
|
94
|
+
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
95
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
96
|
+
"ds:disabled:opacity-[var(--opacity-50)] ds:disabled:cursor-not-allowed",
|
|
97
|
+
"ds:disabled:hover:bg-[var(--primary)]"
|
|
98
|
+
].join(" ")
|
|
99
|
+
), De = i(
|
|
100
|
+
[
|
|
101
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
102
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
103
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
104
|
+
"ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
|
|
105
|
+
"ds:bg-[color-mix(in_srgb,var(--success)_12%,transparent)]",
|
|
106
|
+
"ds:text-[var(--foreground)]",
|
|
107
|
+
"ds:border ds:border-[color:color-mix(in_srgb,var(--success)_45%,transparent)]"
|
|
108
|
+
].join(" ")
|
|
109
|
+
);
|
|
110
|
+
function Z(n, m) {
|
|
111
|
+
const a = new Date(n);
|
|
112
|
+
if (Number.isNaN(a.getTime())) return n;
|
|
113
|
+
try {
|
|
114
|
+
return new Intl.DateTimeFormat(m, {
|
|
115
|
+
dateStyle: "long",
|
|
116
|
+
timeStyle: "short"
|
|
117
|
+
}).format(a);
|
|
118
|
+
} catch {
|
|
119
|
+
return a.toISOString();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const Se = ie(
|
|
123
|
+
({
|
|
124
|
+
id: n,
|
|
125
|
+
src: m,
|
|
126
|
+
documentTitle: a,
|
|
127
|
+
requireReadToEnd: _ = !0,
|
|
128
|
+
onSign: h,
|
|
129
|
+
onError: y,
|
|
130
|
+
signedAt: x = null,
|
|
131
|
+
disabled: D = !1,
|
|
132
|
+
readOnly: S = !1,
|
|
133
|
+
ariaLabel: N,
|
|
134
|
+
className: G
|
|
135
|
+
}, J) => {
|
|
136
|
+
const { t: s, i18n: V } = ce(), z = oe(), u = M(
|
|
137
|
+
() => `sign-doc-${z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
138
|
+
[z]
|
|
139
|
+
), R = `${u}-doc-heading`, H = `${u}-sign-label`, Q = `${u}-live`, C = `${u}-gate-hint`, p = k(null), [E, w] = b(0), [U, $] = b(1), [W, j] = b(!1), [T, l] = b(!1), g = x != null, X = D || S || g, f = k(h), v = k(y);
|
|
140
|
+
L(() => {
|
|
141
|
+
f.current = h, v.current = y;
|
|
142
|
+
}, [h, y]), L(() => {
|
|
143
|
+
j(!1), w(0), $(1), l(!1);
|
|
144
|
+
}, [m]);
|
|
145
|
+
const Y = c(
|
|
146
|
+
(e) => {
|
|
147
|
+
w(e.numPages), e.numPages <= 1 && j(!0);
|
|
148
|
+
},
|
|
149
|
+
[]
|
|
150
|
+
), q = c((e) => {
|
|
151
|
+
$(e), w((t) => (t > 0 && e >= t && j(!0), t));
|
|
152
|
+
}, []), ee = c((e) => {
|
|
153
|
+
var t;
|
|
154
|
+
(t = v.current) == null || t.call(v, e);
|
|
155
|
+
}, []), B = !g && !S;
|
|
156
|
+
L(() => {
|
|
157
|
+
if (!B) return;
|
|
158
|
+
const e = () => {
|
|
159
|
+
const F = p.current;
|
|
160
|
+
F && l(!F.isEmpty());
|
|
161
|
+
};
|
|
162
|
+
e();
|
|
163
|
+
const t = window.setInterval(e, 200);
|
|
164
|
+
return () => window.clearInterval(t);
|
|
165
|
+
}, [B]);
|
|
166
|
+
const o = !_ || W, K = !(!X && o) || !T, se = c((e) => {
|
|
167
|
+
var t;
|
|
168
|
+
(t = f.current) == null || t.call(f, e);
|
|
169
|
+
}, []), I = c(async () => {
|
|
170
|
+
const e = p.current;
|
|
171
|
+
return e ? e.confirm() : null;
|
|
172
|
+
}, []), A = c(() => {
|
|
173
|
+
var e;
|
|
174
|
+
(e = p.current) == null || e.clear(), l(!1);
|
|
175
|
+
}, []), P = M(
|
|
176
|
+
() => ({
|
|
177
|
+
reset: A,
|
|
178
|
+
confirm: I,
|
|
179
|
+
isReadComplete: () => o
|
|
180
|
+
}),
|
|
181
|
+
[A, I, o]
|
|
182
|
+
);
|
|
183
|
+
de(J, () => P, [P]), me(ue, P, n);
|
|
184
|
+
const ne = N ?? (a ? s("signDocument.regionLabelNamed", { title: a }) : s("signDocument.regionLabel")), ae = a ?? s("signDocument.documentLabel"), te = g ? s("signDocument.signedOn", {
|
|
185
|
+
date: Z(x, V.language)
|
|
186
|
+
}) : o ? s("signDocument.readyToSign") : "", re = o ? T ? "" : s("signDocument.signToEnable") : s("signDocument.scrollToEnd");
|
|
187
|
+
return /* @__PURE__ */ d(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
role: "group",
|
|
191
|
+
"aria-labelledby": !N && a ? R : void 0,
|
|
192
|
+
"aria-label": N || !a ? ne : void 0,
|
|
193
|
+
"aria-disabled": D || void 0,
|
|
194
|
+
className: [pe(), G].filter(Boolean).join(" "),
|
|
195
|
+
"data-component": "sign-document",
|
|
196
|
+
"data-component-id": n,
|
|
197
|
+
"data-signed": g || void 0,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ r(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
role: "status",
|
|
203
|
+
"aria-live": "polite",
|
|
204
|
+
"aria-atomic": "true",
|
|
205
|
+
className: "ds:sr-only",
|
|
206
|
+
"data-testid": "sign-document-live",
|
|
207
|
+
id: Q,
|
|
208
|
+
children: te
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ r("span", { className: "ds:sr-only", id: C, children: re }),
|
|
212
|
+
a ? /* @__PURE__ */ r("h2", { id: R, className: fe(), children: a }) : null,
|
|
213
|
+
/* @__PURE__ */ r(
|
|
214
|
+
le,
|
|
215
|
+
{
|
|
216
|
+
src: m,
|
|
217
|
+
ariaLabel: ae,
|
|
218
|
+
onLoadComplete: Y,
|
|
219
|
+
onPageChange: q,
|
|
220
|
+
onError: ee
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
g ? (
|
|
224
|
+
/* ---- Already-signed, read-only ---- */
|
|
225
|
+
/* @__PURE__ */ d(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
className: De(),
|
|
229
|
+
"data-testid": "sign-document-signed",
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ r(
|
|
232
|
+
O,
|
|
233
|
+
{
|
|
234
|
+
"aria-hidden": "true",
|
|
235
|
+
className: "ds:size-5 ds:text-[var(--success)] ds:shrink-0"
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ d("span", { className: "type-body-sm", children: [
|
|
239
|
+
/* @__PURE__ */ r("strong", { className: "ds:font-semibold", children: s("signDocument.signed") }),
|
|
240
|
+
" — ",
|
|
241
|
+
s("signDocument.signedOn", {
|
|
242
|
+
date: Z(x, V.language)
|
|
243
|
+
})
|
|
244
|
+
] })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
) : S ? null : (
|
|
249
|
+
/* ---- Sign surface ---- */
|
|
250
|
+
/* @__PURE__ */ d(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
className: ve(),
|
|
254
|
+
role: "group",
|
|
255
|
+
"aria-labelledby": H,
|
|
256
|
+
"aria-describedby": C,
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
259
|
+
/* @__PURE__ */ r("span", { id: H, className: be(), children: s("signDocument.signatureSection") }),
|
|
260
|
+
E > 0 ? /* @__PURE__ */ r(
|
|
261
|
+
"span",
|
|
262
|
+
{
|
|
263
|
+
className: he(),
|
|
264
|
+
"data-testid": "sign-document-progress",
|
|
265
|
+
children: s("signDocument.pageProgress", {
|
|
266
|
+
current: U,
|
|
267
|
+
total: E
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
) : null
|
|
271
|
+
] }),
|
|
272
|
+
_ && !o ? /* @__PURE__ */ r("p", { className: ye(), "data-testid": "sign-document-hint", children: s("signDocument.scrollToEnd") }) : null,
|
|
273
|
+
/* @__PURE__ */ r(
|
|
274
|
+
ge,
|
|
275
|
+
{
|
|
276
|
+
ref: p,
|
|
277
|
+
ariaLabel: s("signDocument.signatureSection"),
|
|
278
|
+
disabled: D || !o,
|
|
279
|
+
onStart: () => l(!0),
|
|
280
|
+
onClear: () => l(!1),
|
|
281
|
+
onConfirm: se
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ d(
|
|
285
|
+
"button",
|
|
286
|
+
{
|
|
287
|
+
type: "button",
|
|
288
|
+
onClick: () => {
|
|
289
|
+
K || I();
|
|
290
|
+
},
|
|
291
|
+
disabled: K,
|
|
292
|
+
"aria-describedby": C,
|
|
293
|
+
className: xe(),
|
|
294
|
+
"data-testid": "sign-document-confirm",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ r(O, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
297
|
+
s("signDocument.confirm")
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
)
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
Se.displayName = "SignDocument";
|
|
311
|
+
export {
|
|
312
|
+
Se as S,
|
|
313
|
+
ue as s
|
|
314
|
+
};
|
|
315
|
+
//# sourceMappingURL=sign-document-DId1p-nn.js.map
|
|
@@ -48,7 +48,9 @@ const Pe = {
|
|
|
48
48
|
"ds:signature-capture-alfadocs ds:flex ds:flex-col",
|
|
49
49
|
"ds:gap-[var(--spacing-sm)]",
|
|
50
50
|
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
51
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
51
|
+
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--card-border)]",
|
|
52
|
+
"ds:shadow-[var(--shadow-card)]",
|
|
53
|
+
"ds:[.theme-accessible_&]:border-2",
|
|
52
54
|
"ds:p-[var(--spacing-sm)]",
|
|
53
55
|
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
|
|
54
56
|
].join(" ")
|
|
@@ -138,7 +140,8 @@ const Pe = {
|
|
|
138
140
|
"ds:inline-size-[var(--signature-width)]",
|
|
139
141
|
"ds:block-size-[var(--signature-height)]",
|
|
140
142
|
"ds:rounded-[var(--radius-sm)]",
|
|
141
|
-
"ds:border ds:border-[color:var(--border)]",
|
|
143
|
+
"ds:border ds:border-[color:var(--card-border)]",
|
|
144
|
+
"ds:[.theme-accessible_&]:border-2",
|
|
142
145
|
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
143
146
|
"ds:font-[family-name:var(--font-sans)]",
|
|
144
147
|
"ds:italic",
|
|
@@ -187,13 +190,13 @@ async function Ie(t) {
|
|
|
187
190
|
return "";
|
|
188
191
|
}
|
|
189
192
|
function He(t, n, s, i, a) {
|
|
190
|
-
const
|
|
193
|
+
const v = Math.max(
|
|
191
194
|
1,
|
|
192
195
|
typeof window < "u" ? window.devicePixelRatio : 1
|
|
193
196
|
), z = document.createElement("canvas");
|
|
194
|
-
z.width = Math.floor(n *
|
|
197
|
+
z.width = Math.floor(n * v), z.height = Math.floor(s * v);
|
|
195
198
|
const l = z.getContext("2d");
|
|
196
|
-
return l && (l.setTransform(
|
|
199
|
+
return l && (l.setTransform(v, 0, 0, v, 0, 0), l.fillStyle = a, l.fillRect(0, 0, n, s), l.fillStyle = i, l.font = "32px italic sans-serif", l.textAlign = "center", l.textBaseline = "middle", l.fillText(t, n / 2, s / 2, n - 16)), z;
|
|
197
200
|
}
|
|
198
201
|
const Ue = ze(
|
|
199
202
|
({
|
|
@@ -202,7 +205,7 @@ const Ue = ze(
|
|
|
202
205
|
onClear: s,
|
|
203
206
|
onStart: i,
|
|
204
207
|
width: a = 400,
|
|
205
|
-
height:
|
|
208
|
+
height: v = 200,
|
|
206
209
|
penColor: z,
|
|
207
210
|
backgroundColor: l,
|
|
208
211
|
allowTypedFallback: ce = !0,
|
|
@@ -213,13 +216,13 @@ const Ue = ze(
|
|
|
213
216
|
const { t: o } = Me(), G = Se(), Z = `${ae(
|
|
214
217
|
() => `sig-${G.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
215
218
|
[G]
|
|
216
|
-
)}-live`, F = C(null), J = C(null), V = C(null), K = C(null), y = C(null), [d, ge] = N("draw"), [S, L] = N(""), [pe, I] = N(!1),
|
|
219
|
+
)}-live`, F = C(null), J = C(null), V = C(null), K = C(null), y = C(null), [d, ge] = N("draw"), [S, L] = N(""), [pe, I] = N(!1), me = C("empty"), [ve, be] = N(""), [b, he] = N(""), [w, ye] = N(""), j = C(i), E = C(s), B = C(n);
|
|
217
220
|
P(() => {
|
|
218
221
|
j.current = i, E.current = s, B.current = n;
|
|
219
222
|
}, [i, s, n]);
|
|
220
223
|
const g = T(
|
|
221
224
|
(e) => {
|
|
222
|
-
|
|
225
|
+
me.current = e, be(o(`signature.state.${e}`));
|
|
223
226
|
},
|
|
224
227
|
[o]
|
|
225
228
|
);
|
|
@@ -272,10 +275,10 @@ const Ue = ze(
|
|
|
272
275
|
), p = Math.max(1, Math.floor(r.width * c)), x = Math.max(1, Math.floor(r.height * c)), A = Math.min(p, Q), k = Math.min(x, Q);
|
|
273
276
|
if (e.width === A && e.height === k)
|
|
274
277
|
return;
|
|
275
|
-
const
|
|
278
|
+
const m = y.current, M = m ? m.toData() : null;
|
|
276
279
|
e.width = A, e.height = k;
|
|
277
280
|
const D = e.getContext("2d");
|
|
278
|
-
D && D.scale(c, c),
|
|
281
|
+
D && D.scale(c, c), m && (w && (m.backgroundColor = w), b && (m.penColor = b), m.clear(), M && M.length > 0 && m.fromData(M));
|
|
279
282
|
},
|
|
280
283
|
[w, b]
|
|
281
284
|
);
|
|
@@ -304,18 +307,18 @@ const Ue = ze(
|
|
|
304
307
|
if (d === "typed") return S.trim().length === 0;
|
|
305
308
|
const e = y.current;
|
|
306
309
|
return e ? e.isEmpty() : !0;
|
|
307
|
-
}, [d, S]),
|
|
310
|
+
}, [d, S]), _ = T(async () => {
|
|
308
311
|
var ne;
|
|
309
312
|
const e = de(
|
|
310
313
|
typeof a == "number" ? `${a}` : String(a)
|
|
311
314
|
), r = de(
|
|
312
|
-
typeof
|
|
315
|
+
typeof v == "number" ? `${v}` : String(v)
|
|
313
316
|
), c = d === "draw" ? V.current ?? J.current ?? F.current : K.current ?? F.current, p = c == null ? void 0 : c.getBoundingClientRect(), x = e ?? (p ? p.width : 400), A = r ?? (p ? p.height : 200);
|
|
314
|
-
let k = "",
|
|
317
|
+
let k = "", m = "", M;
|
|
315
318
|
if (d === "draw") {
|
|
316
319
|
const u = y.current;
|
|
317
320
|
if (!u || u.isEmpty()) return null;
|
|
318
|
-
k = u.toDataURL("image/png"),
|
|
321
|
+
k = u.toDataURL("image/png"), m = u.toSVG(), M = u.toData();
|
|
319
322
|
} else {
|
|
320
323
|
const u = S.trim();
|
|
321
324
|
if (u.length === 0) return null;
|
|
@@ -327,7 +330,7 @@ const Ue = ze(
|
|
|
327
330
|
w || "transparent"
|
|
328
331
|
).toDataURL("image/png");
|
|
329
332
|
const W = u.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
330
|
-
|
|
333
|
+
m = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${x} ${A}" width="${x}" height="${A}"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="sans-serif" font-style="italic" font-size="32" fill="${b || "currentColor"}" letter-spacing="3">${W}</text></svg>`;
|
|
331
334
|
}
|
|
332
335
|
const D = x * 25.4 / 96, ke = A * 25.4 / 96, Ce = (/* @__PURE__ */ new Date()).toISOString();
|
|
333
336
|
let te = "";
|
|
@@ -337,7 +340,7 @@ const Ue = ze(
|
|
|
337
340
|
}
|
|
338
341
|
const re = {
|
|
339
342
|
png: k,
|
|
340
|
-
svg:
|
|
343
|
+
svg: m,
|
|
341
344
|
widthMm: D,
|
|
342
345
|
heightMm: ke,
|
|
343
346
|
capturedAt: Ce,
|
|
@@ -345,23 +348,23 @@ const Ue = ze(
|
|
|
345
348
|
strokes: M
|
|
346
349
|
};
|
|
347
350
|
return g("captured"), (ne = B.current) == null || ne.call(B, re), re;
|
|
348
|
-
}, [d, S, a,
|
|
351
|
+
}, [d, S, a, v, b, w, g]), O = ae(
|
|
349
352
|
() => ({
|
|
350
353
|
clear: H,
|
|
351
354
|
undo: U,
|
|
352
355
|
isEmpty: Y,
|
|
353
|
-
confirm:
|
|
356
|
+
confirm: _
|
|
354
357
|
}),
|
|
355
|
-
[H, U, Y,
|
|
358
|
+
[H, U, Y, _]
|
|
356
359
|
);
|
|
357
|
-
Re(fe, () =>
|
|
360
|
+
Re(fe, () => O, [O]), Ne(Pe, O, t);
|
|
358
361
|
const we = d === "typed" ? S.trim().length > 0 : pe, ee = f || !we, xe = {
|
|
359
362
|
"--signature-width": oe(
|
|
360
363
|
a,
|
|
361
364
|
"var(--signature-default-width)"
|
|
362
365
|
),
|
|
363
366
|
"--signature-height": oe(
|
|
364
|
-
|
|
367
|
+
v,
|
|
365
368
|
"var(--signature-default-height)"
|
|
366
369
|
)
|
|
367
370
|
};
|
|
@@ -421,7 +424,7 @@ const Ue = ze(
|
|
|
421
424
|
"aria-atomic": "true",
|
|
422
425
|
className: "ds:sr-only",
|
|
423
426
|
"data-testid": "signature-live",
|
|
424
|
-
children:
|
|
427
|
+
children: ve
|
|
425
428
|
}
|
|
426
429
|
),
|
|
427
430
|
/* @__PURE__ */ X(
|
|
@@ -473,7 +476,7 @@ const Ue = ze(
|
|
|
473
476
|
{
|
|
474
477
|
type: "button",
|
|
475
478
|
onClick: () => {
|
|
476
|
-
ee ||
|
|
479
|
+
ee || _();
|
|
477
480
|
},
|
|
478
481
|
"aria-disabled": ee || void 0,
|
|
479
482
|
"aria-describedby": Z,
|
|
@@ -495,4 +498,4 @@ export {
|
|
|
495
498
|
Ue as S,
|
|
496
499
|
Pe as s
|
|
497
500
|
};
|
|
498
|
-
//# sourceMappingURL=signature-capture-
|
|
501
|
+
//# sourceMappingURL=signature-capture-BRzCklg4.js.map
|