@alfadocs/ui-kit-debug 1.3.6 → 1.3.7
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/{anamnesis-i18n-DqRbWU2L.js → anamnesis-i18n-S0cCfFg9.js} +25 -14
- package/dist/_chunks/anamnesis-i18n-S0cCfFg9.js.map +1 -0
- package/dist/_chunks/signature-request-CrRj64Nz.js +417 -0
- package/dist/_chunks/signature-request-CrRj64Nz.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/index.js +2 -2
- package/dist/patterns/anamnesis/anamnesis-evolution.d.ts.map +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/signature-request.d.ts +14 -0
- package/dist/patterns/signature-request/signature-request.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/anamnesis-i18n-DqRbWU2L.js.map +0 -1
- package/dist/_chunks/signature-request-DZEFtbER.js +0 -403
- package/dist/_chunks/signature-request-DZEFtbER.js.map +0 -1
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { jsx as s, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ge, useRef as j, useState as y, useEffect as Q } from "react";
|
|
3
|
+
import { useTranslation as fe } from "react-i18next";
|
|
4
|
+
import { D as m } from "./dialog-UbKJCi1X.js";
|
|
5
|
+
import { B as z } from "./button-CPGiR_bH.js";
|
|
6
|
+
import { I as xe } from "./icon-button-C_kbcd7I.js";
|
|
7
|
+
import { C as Y } from "./checkbox-BuZ1u__2.js";
|
|
8
|
+
import { a as Re } from "./whatsapp-button-BIy6NaJK.js";
|
|
9
|
+
import { S as Z } from "./select-BW5ecXlX.js";
|
|
10
|
+
import { S as be } from "./switch-OILsBLWo.js";
|
|
11
|
+
import { A as _ } from "./alert-CiJT540z.js";
|
|
12
|
+
import { I as Ne } from "./info-tip-Bxk3w6UM.js";
|
|
13
|
+
import { S as we } from "./separator-CYU_bGFn.js";
|
|
14
|
+
import { A as ee } from "./avatar-BNQNhoyL.js";
|
|
15
|
+
import { c as ne } from "./createLucideIcon-DhHxpK9K.js";
|
|
16
|
+
import { P as Ce } from "./plus-DzMQ_c6b.js";
|
|
17
|
+
import { X as Ie } from "./x-B5YnXwCz.js";
|
|
18
|
+
import { P as Se } from "./pen-line-D0De5zdl.js";
|
|
19
|
+
import { M as ke } from "./mail-BqXVF2zH.js";
|
|
20
|
+
import { M as qe } from "./message-square-Bye4ATvx.js";
|
|
21
|
+
/**
|
|
22
|
+
* @license lucide-react v1.22.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
const ye = [
|
|
28
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
29
|
+
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
30
|
+
], ze = ne("tablet", ye);
|
|
31
|
+
/**
|
|
32
|
+
* @license lucide-react v1.22.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const _e = [
|
|
38
|
+
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
39
|
+
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
40
|
+
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
41
|
+
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
42
|
+
], De = ne("user-plus", _e), v = "__assign-later__", se = [
|
|
43
|
+
"sms",
|
|
44
|
+
"email",
|
|
45
|
+
"whatsapp",
|
|
46
|
+
"on-device"
|
|
47
|
+
];
|
|
48
|
+
function ae(h, D) {
|
|
49
|
+
var c;
|
|
50
|
+
return ((c = h.find((o) => o.value === D)) == null ? void 0 : c.label) ?? "";
|
|
51
|
+
}
|
|
52
|
+
const Me = ge(
|
|
53
|
+
({
|
|
54
|
+
open: h,
|
|
55
|
+
onOpenChange: D,
|
|
56
|
+
operators: c,
|
|
57
|
+
signerOptions: o,
|
|
58
|
+
currentOperatorId: M,
|
|
59
|
+
allowAssignLater: T = !0,
|
|
60
|
+
requireOperator: g = !0,
|
|
61
|
+
requirePatient: f = !0,
|
|
62
|
+
initialOperatorId: E,
|
|
63
|
+
initialOperatorChannel: F,
|
|
64
|
+
initialSigners: A,
|
|
65
|
+
maxSigners: le = 2,
|
|
66
|
+
busy: i = !1,
|
|
67
|
+
error: H,
|
|
68
|
+
title: te,
|
|
69
|
+
description: re,
|
|
70
|
+
onRequestSignature: ie,
|
|
71
|
+
contentProps: de
|
|
72
|
+
}, ce) => {
|
|
73
|
+
const { t: n } = fe(), P = j(0), U = j(null), V = (e) => {
|
|
74
|
+
var t;
|
|
75
|
+
const a = (t = o.find(
|
|
76
|
+
(d) => d.value === e
|
|
77
|
+
)) == null ? void 0 : t.availableChannels;
|
|
78
|
+
return a && a.length > 0 ? se.filter((d) => a.includes(d)) : se;
|
|
79
|
+
}, O = (e, a) => {
|
|
80
|
+
const t = V(e);
|
|
81
|
+
return t.includes(a) ? a : t[0];
|
|
82
|
+
}, W = () => {
|
|
83
|
+
var e, a;
|
|
84
|
+
return E === null ? T ? v : ((e = c[0]) == null ? void 0 : e.value) ?? v : E ?? ((a = c[0]) == null ? void 0 : a.value) ?? (T ? v : "");
|
|
85
|
+
}, G = () => (A && A.length > 0 ? A : o.length > 0 ? [
|
|
86
|
+
{
|
|
87
|
+
signerId: o[0].value,
|
|
88
|
+
channel: O(o[0].value, "on-device")
|
|
89
|
+
}
|
|
90
|
+
] : []).map((a) => ({ ...a, rowId: P.current++ })), x = (e) => {
|
|
91
|
+
var a;
|
|
92
|
+
return ((a = c.find((t) => t.value === e)) == null ? void 0 : a.defaultChannel) ?? "email";
|
|
93
|
+
}, X = (e, a) => F === "on-device" ? a.some((t) => t.channel === "on-device") ? "on-device" : x(e) : F ?? x(e), [p, B] = y(W), [u, w] = y(G), [C, R] = y(
|
|
94
|
+
() => X(p, u)
|
|
95
|
+
), [$, b] = y(null), J = j(h);
|
|
96
|
+
Q(() => {
|
|
97
|
+
if (h && !J.current) {
|
|
98
|
+
const e = W(), a = G();
|
|
99
|
+
B(e), w(a), R(X(e, a)), b(null);
|
|
100
|
+
}
|
|
101
|
+
J.current = h;
|
|
102
|
+
}, [h]);
|
|
103
|
+
const I = u.some(
|
|
104
|
+
(e) => e.channel === "on-device"
|
|
105
|
+
);
|
|
106
|
+
Q(() => {
|
|
107
|
+
if (C === "on-device" && !I) {
|
|
108
|
+
const e = x(p);
|
|
109
|
+
R(e), b(e);
|
|
110
|
+
}
|
|
111
|
+
}, [C, I, p]);
|
|
112
|
+
const oe = T ? [
|
|
113
|
+
...c,
|
|
114
|
+
{ value: v, label: n("signatureRequest.assignLater") }
|
|
115
|
+
] : c, S = p === v, N = {
|
|
116
|
+
sms: {
|
|
117
|
+
label: n("signatureRequest.viaSms"),
|
|
118
|
+
icon: /* @__PURE__ */ s(qe, { className: "ds:size-4", "aria-hidden": !0 })
|
|
119
|
+
},
|
|
120
|
+
email: {
|
|
121
|
+
label: n("signatureRequest.viaEmail"),
|
|
122
|
+
icon: /* @__PURE__ */ s(ke, { className: "ds:size-4", "aria-hidden": !0 })
|
|
123
|
+
},
|
|
124
|
+
whatsapp: {
|
|
125
|
+
label: n("signatureRequest.viaWhatsapp"),
|
|
126
|
+
icon: /* @__PURE__ */ s(Re, { className: "ds:size-4", "aria-hidden": !0 })
|
|
127
|
+
},
|
|
128
|
+
"on-device": {
|
|
129
|
+
label: n("signatureRequest.onThisDevice"),
|
|
130
|
+
icon: /* @__PURE__ */ s(ze, { className: "ds:size-4", "aria-hidden": !0 })
|
|
131
|
+
}
|
|
132
|
+
}, ue = [
|
|
133
|
+
{ value: "sms", ...N.sms },
|
|
134
|
+
{ value: "email", ...N.email },
|
|
135
|
+
{
|
|
136
|
+
value: "on-device",
|
|
137
|
+
...N["on-device"],
|
|
138
|
+
disabled: !I,
|
|
139
|
+
hint: I ? void 0 : n("signatureRequest.onDeviceUnavailableHint")
|
|
140
|
+
}
|
|
141
|
+
], K = u.map((e) => e.signerId), k = o.find(
|
|
142
|
+
(e) => !K.includes(e.value)
|
|
143
|
+
), me = !i && u.length < le && k !== void 0, L = (e, a) => {
|
|
144
|
+
w(
|
|
145
|
+
(t) => t.map(
|
|
146
|
+
(d) => d.rowId === e ? { ...d, ...a } : d
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
}, he = () => {
|
|
150
|
+
k && w((e) => [
|
|
151
|
+
...e,
|
|
152
|
+
{
|
|
153
|
+
signerId: k.value,
|
|
154
|
+
channel: O(k.value, "sms"),
|
|
155
|
+
rowId: P.current++
|
|
156
|
+
}
|
|
157
|
+
]);
|
|
158
|
+
}, pe = (e) => {
|
|
159
|
+
var a;
|
|
160
|
+
(a = U.current) == null || a.focus(), w(
|
|
161
|
+
(t) => t.filter((d) => d.rowId !== e)
|
|
162
|
+
);
|
|
163
|
+
}, ve = () => {
|
|
164
|
+
ie({
|
|
165
|
+
operatorId: !g || S ? null : p,
|
|
166
|
+
operatorChannel: !g || S ? null : C,
|
|
167
|
+
signers: f ? u.map(({ rowId: e, ...a }) => a) : []
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ s("div", { ref: ce, className: "ds:contents", "data-component": "signature-request", children: /* @__PURE__ */ s(m, { open: h, onOpenChange: D, children: /* @__PURE__ */ r(m.Content, { size: "lg", hideCloseButton: !0, ...de, children: [
|
|
171
|
+
/* @__PURE__ */ r(m.Header, { children: [
|
|
172
|
+
/* @__PURE__ */ s(m.Title, { children: te ?? n("signatureRequest.title") }),
|
|
173
|
+
/* @__PURE__ */ s(m.Description, { children: re ?? n("signatureRequest.noSignedVersions") })
|
|
174
|
+
] }),
|
|
175
|
+
/* @__PURE__ */ r(m.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
176
|
+
g ? /* @__PURE__ */ r("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
177
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
178
|
+
/* @__PURE__ */ s("p", { className: "type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]", children: n("signatureRequest.operatorSection") }),
|
|
179
|
+
M !== void 0 ? /* @__PURE__ */ s(
|
|
180
|
+
z,
|
|
181
|
+
{
|
|
182
|
+
intent: "primary",
|
|
183
|
+
size: "sm",
|
|
184
|
+
startIcon: /* @__PURE__ */ s(De, {}),
|
|
185
|
+
disabled: i,
|
|
186
|
+
onClick: () => {
|
|
187
|
+
B(M), R(
|
|
188
|
+
x(M)
|
|
189
|
+
), b(null);
|
|
190
|
+
},
|
|
191
|
+
children: n("signatureRequest.assignToMe")
|
|
192
|
+
}
|
|
193
|
+
) : null
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
196
|
+
/* @__PURE__ */ s(
|
|
197
|
+
ee,
|
|
198
|
+
{
|
|
199
|
+
"aria-hidden": "true",
|
|
200
|
+
name: S ? void 0 : ae(c, p),
|
|
201
|
+
size: "sm"
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:flex-1 ds:text-start", children: /* @__PURE__ */ s(
|
|
205
|
+
Z,
|
|
206
|
+
{
|
|
207
|
+
options: oe,
|
|
208
|
+
value: p,
|
|
209
|
+
onValueChange: (e) => {
|
|
210
|
+
e && (B(e), R(
|
|
211
|
+
e === v ? "email" : x(e)
|
|
212
|
+
), b(null));
|
|
213
|
+
},
|
|
214
|
+
required: !0,
|
|
215
|
+
disabled: i,
|
|
216
|
+
placeholder: n("signatureRequest.operatorPlaceholder"),
|
|
217
|
+
"aria-label": n("signatureRequest.operatorSection")
|
|
218
|
+
}
|
|
219
|
+
) })
|
|
220
|
+
] }),
|
|
221
|
+
S ? null : /* @__PURE__ */ s(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
role: "group",
|
|
225
|
+
"aria-label": n("signatureRequest.operatorChannelLabel"),
|
|
226
|
+
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]",
|
|
227
|
+
children: ue.map((e) => /* @__PURE__ */ r(
|
|
228
|
+
"span",
|
|
229
|
+
{
|
|
230
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ s(
|
|
233
|
+
Y,
|
|
234
|
+
{
|
|
235
|
+
checked: C === e.value,
|
|
236
|
+
disabled: i || e.disabled,
|
|
237
|
+
onCheckedChange: (a) => {
|
|
238
|
+
a === !0 && (R(e.value), b(null));
|
|
239
|
+
},
|
|
240
|
+
label: /* @__PURE__ */ r("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
241
|
+
/* @__PURE__ */ s(
|
|
242
|
+
"span",
|
|
243
|
+
{
|
|
244
|
+
"aria-hidden": "true",
|
|
245
|
+
className: "ds:text-[var(--accent)]",
|
|
246
|
+
children: e.icon
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
e.label
|
|
250
|
+
] })
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
e.hint ? /* @__PURE__ */ s(Ne, { size: "sm", content: e.hint }) : null
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
e.value
|
|
257
|
+
))
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ s("span", { role: "status", className: "ds:sr-only", children: $ ? n("signatureRequest.operatorChannelReverted", {
|
|
261
|
+
channel: N[$].label
|
|
262
|
+
}) : null })
|
|
263
|
+
] }) : null,
|
|
264
|
+
g && f ? /* @__PURE__ */ s(we, { decorative: !0 }) : null,
|
|
265
|
+
f ? /* @__PURE__ */ r("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start", children: [
|
|
266
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
267
|
+
/* @__PURE__ */ s("p", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: n("signatureRequest.signersSection") }),
|
|
268
|
+
/* @__PURE__ */ s(
|
|
269
|
+
z,
|
|
270
|
+
{
|
|
271
|
+
ref: U,
|
|
272
|
+
intent: "primary",
|
|
273
|
+
size: "sm",
|
|
274
|
+
startIcon: /* @__PURE__ */ s(Ce, {}),
|
|
275
|
+
disabled: !me,
|
|
276
|
+
onClick: he,
|
|
277
|
+
children: n("signatureRequest.addSigner")
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
] }),
|
|
281
|
+
u.map((e) => {
|
|
282
|
+
const a = o.filter(
|
|
283
|
+
(l) => l.value === e.signerId || !K.includes(l.value)
|
|
284
|
+
), t = ae(o, e.signerId), d = V(e.signerId).map(
|
|
285
|
+
(l) => ({
|
|
286
|
+
value: l,
|
|
287
|
+
...N[l]
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
return /* @__PURE__ */ r(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
role: "group",
|
|
294
|
+
"aria-label": t,
|
|
295
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
296
|
+
children: [
|
|
297
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
298
|
+
/* @__PURE__ */ s(
|
|
299
|
+
ee,
|
|
300
|
+
{
|
|
301
|
+
"aria-hidden": "true",
|
|
302
|
+
name: t,
|
|
303
|
+
size: "sm"
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ s(
|
|
307
|
+
Z,
|
|
308
|
+
{
|
|
309
|
+
options: a,
|
|
310
|
+
value: e.signerId,
|
|
311
|
+
onValueChange: (l) => {
|
|
312
|
+
if (!l) return;
|
|
313
|
+
const q = O(
|
|
314
|
+
l,
|
|
315
|
+
e.channel
|
|
316
|
+
);
|
|
317
|
+
L(e.rowId, {
|
|
318
|
+
signerId: l,
|
|
319
|
+
channel: q,
|
|
320
|
+
skipOtp: q === "on-device" ? e.skipOtp : void 0
|
|
321
|
+
});
|
|
322
|
+
},
|
|
323
|
+
required: !0,
|
|
324
|
+
disabled: i,
|
|
325
|
+
placeholder: n(
|
|
326
|
+
"signatureRequest.signerPlaceholder"
|
|
327
|
+
),
|
|
328
|
+
"aria-label": n(
|
|
329
|
+
"signatureRequest.signerPlaceholder"
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
) }),
|
|
333
|
+
u.length > 1 ? /* @__PURE__ */ s(
|
|
334
|
+
xe,
|
|
335
|
+
{
|
|
336
|
+
intent: "ghost",
|
|
337
|
+
size: "sm",
|
|
338
|
+
icon: /* @__PURE__ */ s(Ie, {}),
|
|
339
|
+
disabled: i,
|
|
340
|
+
"aria-label": n("signatureRequest.removeSigner"),
|
|
341
|
+
onClick: () => pe(e.rowId)
|
|
342
|
+
}
|
|
343
|
+
) : null
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ s(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
role: "group",
|
|
349
|
+
"aria-label": n("signatureRequest.channelLabel"),
|
|
350
|
+
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]",
|
|
351
|
+
children: d.map((l) => /* @__PURE__ */ s(
|
|
352
|
+
Y,
|
|
353
|
+
{
|
|
354
|
+
checked: e.channel === l.value,
|
|
355
|
+
disabled: i,
|
|
356
|
+
onCheckedChange: (q) => q === !0 && L(e.rowId, {
|
|
357
|
+
channel: l.value,
|
|
358
|
+
skipOtp: void 0
|
|
359
|
+
}),
|
|
360
|
+
label: /* @__PURE__ */ r("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
361
|
+
/* @__PURE__ */ s(
|
|
362
|
+
"span",
|
|
363
|
+
{
|
|
364
|
+
"aria-hidden": "true",
|
|
365
|
+
className: "ds:text-[var(--accent)]",
|
|
366
|
+
children: l.icon
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
l.label
|
|
370
|
+
] })
|
|
371
|
+
},
|
|
372
|
+
l.value
|
|
373
|
+
))
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
e.channel === "on-device" ? /* @__PURE__ */ s("div", { className: "ds:ps-[var(--spacing-xl)]", children: /* @__PURE__ */ s(
|
|
377
|
+
be,
|
|
378
|
+
{
|
|
379
|
+
label: n("signatureRequest.noOtp"),
|
|
380
|
+
checked: e.skipOtp === !0,
|
|
381
|
+
disabled: i,
|
|
382
|
+
onCheckedChange: (l) => L(e.rowId, { skipOtp: l })
|
|
383
|
+
}
|
|
384
|
+
) }) : null
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
e.rowId
|
|
388
|
+
);
|
|
389
|
+
})
|
|
390
|
+
] }) : null,
|
|
391
|
+
u.some(
|
|
392
|
+
(e) => e.channel === "on-device" && e.skipOtp === !0
|
|
393
|
+
) ? /* @__PURE__ */ s(_, { variant: "warning", children: /* @__PURE__ */ s(_.Description, { children: n("signatureRequest.noOtpWarning") }) }) : null,
|
|
394
|
+
H ? /* @__PURE__ */ s(_, { variant: "error", children: /* @__PURE__ */ s(_.Description, { children: H }) }) : null
|
|
395
|
+
] }),
|
|
396
|
+
/* @__PURE__ */ r(m.Footer, { children: [
|
|
397
|
+
/* @__PURE__ */ s(
|
|
398
|
+
z,
|
|
399
|
+
{
|
|
400
|
+
intent: "primary",
|
|
401
|
+
startIcon: /* @__PURE__ */ s(Se, {}),
|
|
402
|
+
onClick: ve,
|
|
403
|
+
disabled: i || f && u.length === 0 || !f && !g,
|
|
404
|
+
loading: i,
|
|
405
|
+
children: n("signatureRequest.requestSignature")
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ s(m.Close, { asChild: !0, children: /* @__PURE__ */ s(z, { intent: "outline", disabled: i, children: n("signatureRequest.close") }) })
|
|
409
|
+
] })
|
|
410
|
+
] }) }) });
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
Me.displayName = "SignatureRequestModal";
|
|
414
|
+
export {
|
|
415
|
+
Me as S
|
|
416
|
+
};
|
|
417
|
+
//# sourceMappingURL=signature-request-CrRj64Nz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-request-CrRj64Nz.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.mjs","../../node_modules/lucide-react/dist/esm/icons/user-plus.mjs","../../src/patterns/signature-request/signature-request.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.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.mjs';\n\nconst __iconNode = [\n [\"rect\", { width: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.mjs.map\n","/**\n * @license lucide-react v1.22.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.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n [\"line\", { x1: \"19\", x2: \"19\", y1: \"8\", y2: \"14\", key: \"1bvyxn\" }],\n [\"line\", { x1: \"22\", x2: \"16\", y1: \"11\", y2: \"11\", key: \"1shjgl\" }]\n];\nconst UserPlus = createLucideIcon(\"user-plus\", __iconNode);\n\nexport { __iconNode, UserPlus as default };\n//# sourceMappingURL=user-plus.mjs.map\n","/**\n * SignatureRequestModal — the practice-side \"Documenti firmati\" modal that\n * dispatches a document-signature request: assign the operator who must\n * counter-sign (or leave the request unassigned) and how their request is\n * delivered (their system-defined default channel arrives pre-checked),\n * build the patient-side signer roster (up to `maxSigners`, each with their\n * own delivery channel and, for on-device signing, an OTP waiver), and send.\n *\n * Runtime pattern: real consuming apps mount this in production (surfaced via\n * `src/patterns/index.ts` and the `./patterns/signature-request` subpath).\n * The component owns the form state — re-seeded from the `initial*` props\n * every time `open` flips back to `true` — while the host owns `open`, the\n * option lists, and what happens on submit. Multiple on-device signers sign\n * sequentially in roster order — the execution side is the Signing pattern's\n * multi-signer flow; this modal only encodes the intents.\n */\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Mail,\n MessageSquare,\n PenLine,\n Plus,\n Tablet,\n UserPlus,\n X,\n} from 'lucide-react';\nimport { Dialog } from '../../components/dialog';\nimport { Button } from '../../components/button';\nimport { IconButton } from '../../components/icon-button';\nimport { Checkbox } from '../../components/checkbox';\nimport { WhatsAppGlyph } from '../../components/whatsapp-button';\nimport { Select } from '../../components/select';\nimport { Switch } from '../../components/switch';\nimport { Alert } from '../../components/alert';\nimport { InfoTip } from '../../components/info-tip';\nimport { Separator } from '../../components/separator';\nimport { Avatar } from '../../components/avatar';\n\n/** Delivery channel for one signer's signature request. */\nexport type SignatureChannel = 'sms' | 'email' | 'whatsapp' | 'on-device';\n\n/**\n * Delivery channel for the operator's counter-sign request. The default is\n * system defined — the assigned operator's own `defaultChannel` (e-mail or\n * SMS) arrives pre-checked; `'on-device'` is offerable only while a roster\n * signer also signs on this device.\n */\nexport type OperatorChannel = 'sms' | 'email' | 'on-device';\n\n/** One selectable person/role for the operator or signer selects. */\nexport interface SignerOption {\n value: string;\n label: string;\n /**\n * Delivery channels this person can actually receive. Omit (or pass an\n * empty list) to offer every channel. Hosts gate this from per-patient\n * capability flags — e.g. a patient with no mobile number drops `'sms'`\n * and `'whatsapp'`. Only meaningful for signer options, not operators.\n */\n availableChannels?: SignatureChannel[];\n /**\n * The delivery channel this operator's own settings resolve to — the\n * system-defined default, pre-checked when the operator is assigned.\n * Falls back to `'email'` when omitted. Only meaningful for operator\n * options, not signers.\n */\n defaultChannel?: 'sms' | 'email';\n}\n\n/** One patient-side signer row in the submission. */\nexport interface SignerRequest {\n signerId: string;\n channel: SignatureChannel;\n /** Only meaningful when `channel` is `'on-device'`. */\n skipOtp?: boolean;\n}\n\n/** Payload handed to `onRequestSignature`. */\nexport interface SignatureRequestSubmission {\n /** `null` when the counter-signing operator is left unassigned. */\n operatorId: string | null;\n /**\n * How the operator's counter-sign request is delivered. `null` while the\n * operator is unassigned. Defaults to the operator's own system-defined\n * channel unless explicitly changed in the modal.\n */\n operatorChannel: OperatorChannel | null;\n /** 1..N signers; on-device signers sign sequentially in this order. */\n signers: SignerRequest[];\n}\n\nexport interface SignatureRequestModalProps {\n /** Controlled open state. Reopening re-seeds the form from `initial*`. */\n open: boolean;\n /**\n * Fires when the dialog requests a state change (<kbd>Esc</kbd> or the\n * footer Close button). `false` is the dismiss signal — hosts typically\n * persist a \"dismissed this session\" flag there.\n */\n onOpenChange: (open: boolean) => void;\n /** Operators offered as the counter-signing signer. */\n operators: SignerOption[];\n /** Patient-side people/roles offered in each signer row. */\n signerOptions: SignerOption[];\n /** Enables the \"Assign to me\" shortcut targeting this operator. */\n currentOperatorId?: string;\n /** Offer an \"Assign later\" option in the operator select. Default `true`. */\n allowAssignLater?: boolean;\n /**\n * Preselected operator; `null` preselects \"Assign later\" (honoured only\n * while `allowAssignLater` — otherwise the first operator is seeded).\n */\n initialOperatorId?: string | null;\n /**\n * Preselected operator delivery channel. Defaults to the seeded operator's\n * system-defined `defaultChannel`. `'on-device'` is honoured only while a\n * seeded roster signer also signs on this device.\n */\n initialOperatorChannel?: OperatorChannel;\n /** Seed the signer roster. Defaults to the first option, on-device. */\n initialSigners?: SignerRequest[];\n /** Cap on roster size. Default `2`. */\n maxSigners?: number;\n /**\n * Whether an operator must counter-sign. `false` drops the operator\n * section entirely and submits `operatorId: null` — a host whose document\n * does not require a counter-signature must not be asked for one. Default\n * `true`.\n */\n requireOperator?: boolean;\n /**\n * Whether the patient side signs at all. `false` drops the signer roster\n * and submits an empty `signers` array — for documents only an operator\n * signs. Default `true`. Setting BOTH this and `requireOperator` to false\n * leaves nothing to request, so the primary action stays disabled.\n */\n requirePatient?: boolean;\n /** Disables all inputs and shows the primary action as loading. */\n busy?: boolean;\n /** Consumer-translated error shown above the footer (e.g. server failure). */\n error?: string;\n /** Override the dialog title. Defaults to the `ui.*` string. */\n title?: string;\n /** Override the dialog description. Defaults to the `ui.*` string. */\n description?: string;\n /** Receives the completed submission. The host closes via `onOpenChange`. */\n onRequestSignature: (submission: SignatureRequestSubmission) => void;\n /**\n * Extra attributes for the portaled dialog surface (e.g. `dir`/`lang`\n * when the host pins a locale below `<html>`, or a test id).\n */\n contentProps?: ComponentPropsWithoutRef<'div'>;\n}\n\nconst ASSIGN_LATER = '__assign-later__';\n\n/** Canonical channel display order; per-signer availability filters this. */\nconst CHANNEL_ORDER: SignatureChannel[] = [\n 'sms',\n 'email',\n 'whatsapp',\n 'on-device',\n];\n\n/** Internal roster row — `rowId` keys the DOM so editing a row's person\n * never remounts the row (which would drop keyboard focus). */\ninterface RosterRow extends SignerRequest {\n rowId: number;\n}\n\nfunction labelFor(options: SignerOption[], value: string): string {\n return options.find((option) => option.value === value)?.label ?? '';\n}\n\nexport const SignatureRequestModal = forwardRef<\n HTMLDivElement,\n SignatureRequestModalProps\n>(\n (\n {\n open,\n onOpenChange,\n operators,\n signerOptions,\n currentOperatorId,\n allowAssignLater = true,\n requireOperator = true,\n requirePatient = true,\n initialOperatorId,\n initialOperatorChannel,\n initialSigners,\n maxSigners = 2,\n busy = false,\n error,\n title,\n description,\n onRequestSignature,\n contentProps,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const nextRowId = useRef(0);\n const addButtonRef = useRef<HTMLButtonElement>(null);\n\n // Channels a given signer can receive on — the person's `availableChannels`\n // filtered into canonical order; omitted/empty means every channel.\n const channelsFor = (signerId: string): SignatureChannel[] => {\n const allowed = signerOptions.find(\n (option) => option.value === signerId,\n )?.availableChannels;\n return allowed && allowed.length > 0\n ? CHANNEL_ORDER.filter((channel) => allowed.includes(channel))\n : CHANNEL_ORDER;\n };\n\n // First available channel for a signer, preferring `preferred` when offered.\n const resolveChannel = (\n signerId: string,\n preferred: SignatureChannel,\n ): SignatureChannel => {\n const available = channelsFor(signerId);\n return available.includes(preferred) ? preferred : available[0];\n };\n\n const seedOperator = () => {\n if (initialOperatorId === null) {\n return allowAssignLater\n ? ASSIGN_LATER\n : (operators[0]?.value ?? ASSIGN_LATER);\n }\n return (\n initialOperatorId ??\n operators[0]?.value ??\n (allowAssignLater ? ASSIGN_LATER : '')\n );\n };\n const seedRows = (): RosterRow[] => {\n const seed =\n initialSigners && initialSigners.length > 0\n ? initialSigners\n : signerOptions.length > 0\n ? [\n {\n signerId: signerOptions[0].value,\n channel: resolveChannel(signerOptions[0].value, 'on-device'),\n },\n ]\n : [];\n return seed.map((signer) => ({ ...signer, rowId: nextRowId.current++ }));\n };\n\n // System-defined default for one operator — the channel their own\n // settings resolve to.\n const operatorDefaultChannel = (operatorId: string): OperatorChannel =>\n operators.find((option) => option.value === operatorId)?.defaultChannel ??\n 'email';\n\n // Seed clamp: `'on-device'` is honoured only when the seeded roster\n // makes it available, so the option is never checked-and-disabled, not\n // even for a frame.\n const seedOperatorChannel = (\n operatorId: string,\n rows: RosterRow[],\n ): OperatorChannel => {\n if (initialOperatorChannel === 'on-device') {\n return rows.some((signer) => signer.channel === 'on-device')\n ? 'on-device'\n : operatorDefaultChannel(operatorId);\n }\n return initialOperatorChannel ?? operatorDefaultChannel(operatorId);\n };\n\n const [operator, setOperator] = useState<string>(seedOperator);\n const [signers, setSigners] = useState<RosterRow[]>(seedRows);\n const [operatorChannel, setOperatorChannel] = useState<OperatorChannel>(\n () => seedOperatorChannel(operator, signers),\n );\n // Feeds the sr-only live region announcing the automatic channel\n // fallback below; any explicit choice clears it.\n const [revertedTo, setRevertedTo] = useState<OperatorChannel | null>(null);\n\n // Re-seed the form whenever the host reopens the (still-mounted) modal,\n // so a previous request's choices never leak into the next one.\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open && !wasOpen.current) {\n const nextOperator = seedOperator();\n const nextRows = seedRows();\n setOperator(nextOperator);\n setSigners(nextRows);\n setOperatorChannel(seedOperatorChannel(nextOperator, nextRows));\n setRevertedTo(null);\n }\n wasOpen.current = open;\n // The seeds intentionally read the render-time props on the rising\n // edge only — prop changes while open (or closed) don't reset input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n // Operator on-device signing piggybacks on a patient handover: it is\n // offerable only while a roster signer signs on this device, and falls\n // back to the operator's system default the moment the last on-device\n // row leaves. The fallback is announced via the live region — the\n // trigger lives in the roster section, far from the checkbox it moves.\n const anySignerOnDevice = signers.some(\n (signer) => signer.channel === 'on-device',\n );\n useEffect(() => {\n if (operatorChannel === 'on-device' && !anySignerOnDevice) {\n const fallback = operatorDefaultChannel(operator);\n setOperatorChannel(fallback);\n setRevertedTo(fallback);\n }\n // `operatorDefaultChannel` reads the render-time `operators` prop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [operatorChannel, anySignerOnDevice, operator]);\n\n const operatorSelectOptions = allowAssignLater\n ? [\n ...operators,\n { value: ASSIGN_LATER, label: t('signatureRequest.assignLater') },\n ]\n : operators;\n const isUnassigned = operator === ASSIGN_LATER;\n\n const channelMeta: Record<\n SignatureChannel,\n { label: string; icon: React.ReactNode }\n > = {\n sms: {\n label: t('signatureRequest.viaSms'),\n icon: <MessageSquare className=\"ds:size-4\" aria-hidden />,\n },\n email: {\n label: t('signatureRequest.viaEmail'),\n icon: <Mail className=\"ds:size-4\" aria-hidden />,\n },\n whatsapp: {\n label: t('signatureRequest.viaWhatsapp'),\n icon: <WhatsAppGlyph className=\"ds:size-4\" aria-hidden />,\n },\n 'on-device': {\n label: t('signatureRequest.onThisDevice'),\n icon: <Tablet className=\"ds:size-4\" aria-hidden />,\n },\n };\n\n // Operator delivery — same checkbox visuals as the signer rows, minus\n // WhatsApp. No \"system defined\" option: the operator's own default\n // (e-mail or SMS per their settings) arrives pre-checked instead.\n // On-device greys out while no patient signer signs on this device;\n // an InfoTip explains why.\n const operatorChannelOptions: Array<{\n value: OperatorChannel;\n label: string;\n icon: React.ReactNode;\n disabled?: boolean;\n hint?: string;\n }> = [\n { value: 'sms', ...channelMeta.sms },\n { value: 'email', ...channelMeta.email },\n {\n value: 'on-device',\n ...channelMeta['on-device'],\n disabled: !anySignerOnDevice,\n hint: anySignerOnDevice\n ? undefined\n : t('signatureRequest.onDeviceUnavailableHint'),\n },\n ];\n\n const chosenIds = signers.map((signer) => signer.signerId);\n const nextFreeOption = signerOptions.find(\n (option) => !chosenIds.includes(option.value),\n );\n const canAddSigner =\n !busy && signers.length < maxSigners && nextFreeOption !== undefined;\n\n const patchSigner = (rowId: number, patch: Partial<SignerRequest>) => {\n setSigners((current) =>\n current.map((signer) =>\n signer.rowId === rowId ? { ...signer, ...patch } : signer,\n ),\n );\n };\n\n const addSigner = () => {\n if (!nextFreeOption) return;\n setSigners((current) => [\n ...current,\n {\n signerId: nextFreeOption.value,\n channel: resolveChannel(nextFreeOption.value, 'sms'),\n rowId: nextRowId.current++,\n },\n ]);\n };\n\n const removeSigner = (rowId: number) => {\n // Move focus BEFORE the row (and the focused remove button) unmounts —\n // otherwise Radix's focus scope dumps focus on the dialog container.\n addButtonRef.current?.focus();\n setSigners((current) =>\n current.filter((signer) => signer.rowId !== rowId),\n );\n };\n\n const handleRequest = () => {\n onRequestSignature({\n operatorId: !requireOperator || isUnassigned ? null : operator,\n operatorChannel:\n !requireOperator || isUnassigned ? null : operatorChannel,\n signers: requirePatient\n ? signers.map(({ rowId: _rowId, ...signer }) => signer)\n : [],\n });\n };\n\n return (\n <div ref={ref} className=\"ds:contents\" data-component=\"signature-request\">\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Dialog.Content size=\"lg\" hideCloseButton {...contentProps}>\n <Dialog.Header>\n <Dialog.Title>\n {title ?? t('signatureRequest.title')}\n </Dialog.Title>\n <Dialog.Description>\n {description ?? t('signatureRequest.noSignedVersions')}\n </Dialog.Description>\n </Dialog.Header>\n\n <Dialog.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {requireOperator ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.operatorSection')}\n </p>\n {currentOperatorId !== undefined ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<UserPlus />}\n disabled={busy}\n onClick={() => {\n setOperator(currentOperatorId);\n setOperatorChannel(\n operatorDefaultChannel(currentOperatorId),\n );\n setRevertedTo(null);\n }}\n >\n {t('signatureRequest.assignToMe')}\n </Button>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. No name →\n Avatar's built-in placeholder-icon fallback. */}\n <Avatar\n aria-hidden=\"true\"\n name={\n isUnassigned ? undefined : labelFor(operators, operator)\n }\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1 ds:text-start\">\n <Select\n options={operatorSelectOptions}\n value={operator}\n onValueChange={(value) => {\n if (!value) return;\n setOperator(value);\n // A different operator brings their own system\n // default along.\n setOperatorChannel(\n value === ASSIGN_LATER\n ? 'email'\n : operatorDefaultChannel(value),\n );\n setRevertedTo(null);\n }}\n required\n disabled={busy}\n placeholder={t('signatureRequest.operatorPlaceholder')}\n aria-label={t('signatureRequest.operatorSection')}\n />\n </div>\n </div>\n\n {/* One channel for the operator too — same mutually exclusive\n checkbox visuals as the signer rows. Hidden while the\n request is unassigned: there is nobody to deliver to. */}\n {isUnassigned ? null : (\n <div\n role=\"group\"\n aria-label={t('signatureRequest.operatorChannelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {operatorChannelOptions.map((option) => (\n <span\n key={option.value}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n <Checkbox\n checked={operatorChannel === option.value}\n disabled={busy || option.disabled}\n onCheckedChange={(checked) => {\n if (checked !== true) return;\n setOperatorChannel(option.value);\n setRevertedTo(null);\n }}\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n {/* Sibling of the checkbox, never inside its label —\n the tip is its own interactive control. The wider\n gap keeps the tip's touch hit-area off the label. */}\n {option.hint ? (\n <InfoTip size=\"sm\" content={option.hint} />\n ) : null}\n </span>\n ))}\n </div>\n )}\n\n {/* Announces the automatic on-device → default fallback: the\n trigger (the patient's channel change) sits in another\n section, so the moved checkmark alone is not enough. */}\n <span role=\"status\" className=\"ds:sr-only\">\n {revertedTo\n ? t('signatureRequest.operatorChannelReverted', {\n channel: channelMeta[revertedTo].label,\n })\n : null}\n </span>\n </section>\n ) : null}\n\n {/* The rule only separates two sections that are both there. */}\n {requireOperator && requirePatient ? (\n <Separator decorative />\n ) : null}\n\n {requirePatient ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.signersSection')}\n </p>\n <Button\n ref={addButtonRef}\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Plus />}\n disabled={!canAddSigner}\n onClick={addSigner}\n >\n {t('signatureRequest.addSigner')}\n </Button>\n </div>\n\n {signers.map((signer) => {\n const rowOptions = signerOptions.filter(\n (option) =>\n option.value === signer.signerId ||\n !chosenIds.includes(option.value),\n );\n const rowLabel = labelFor(signerOptions, signer.signerId);\n const rowChannelOptions = channelsFor(signer.signerId).map(\n (channel) => ({\n value: channel,\n ...channelMeta[channel],\n }),\n );\n return (\n <div\n key={signer.rowId}\n role=\"group\"\n aria-label={rowLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. */}\n <Avatar\n aria-hidden=\"true\"\n name={rowLabel}\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1\">\n <Select\n options={rowOptions}\n value={signer.signerId}\n onValueChange={(value) => {\n if (!value) return;\n const channel = resolveChannel(\n value,\n signer.channel,\n );\n patchSigner(signer.rowId, {\n signerId: value,\n channel,\n skipOtp:\n channel === 'on-device'\n ? signer.skipOtp\n : undefined,\n });\n }}\n required\n disabled={busy}\n placeholder={t(\n 'signatureRequest.signerPlaceholder',\n )}\n aria-label={t(\n 'signatureRequest.signerPlaceholder',\n )}\n />\n </div>\n {signers.length > 1 ? (\n <IconButton\n intent=\"ghost\"\n size=\"sm\"\n icon={<X />}\n disabled={busy}\n aria-label={t('signatureRequest.removeSigner')}\n onClick={() => removeSigner(signer.rowId)}\n />\n ) : null}\n </div>\n\n {/* One channel per signer — checkbox visuals, but the\n choice is mutually exclusive: checking a channel\n unchecks the others, and the active one can't be\n unchecked. */}\n <div\n role=\"group\"\n aria-label={t('signatureRequest.channelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {rowChannelOptions.map((option) => (\n <Checkbox\n key={option.value}\n checked={signer.channel === option.value}\n disabled={busy}\n onCheckedChange={(checked) =>\n checked === true &&\n patchSigner(signer.rowId, {\n channel: option.value,\n skipOtp: undefined,\n })\n }\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n ))}\n </div>\n\n {signer.channel === 'on-device' ? (\n <div className=\"ds:ps-[var(--spacing-xl)]\">\n <Switch\n label={t('signatureRequest.noOtp')}\n checked={signer.skipOtp === true}\n disabled={busy}\n onCheckedChange={(checked) =>\n patchSigner(signer.rowId, { skipOtp: checked })\n }\n />\n </div>\n ) : null}\n </div>\n );\n })}\n </section>\n ) : null}\n\n {/* Dedicated alert area — one warning regardless of how many\n signers waive OTP, stacked with any submission error, all at\n the same full width as the operator hint. */}\n {signers.some(\n (signer) =>\n signer.channel === 'on-device' && signer.skipOtp === true,\n ) ? (\n <Alert variant=\"warning\">\n <Alert.Description>\n {t('signatureRequest.noOtpWarning')}\n </Alert.Description>\n </Alert>\n ) : null}\n {error ? (\n <Alert variant=\"error\">\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n ) : null}\n </Dialog.Body>\n\n <Dialog.Footer>\n <Button\n intent=\"primary\"\n startIcon={<PenLine />}\n onClick={handleRequest}\n disabled={\n busy ||\n (requirePatient && signers.length === 0) ||\n (!requirePatient && !requireOperator)\n }\n loading={busy}\n >\n {t('signatureRequest.requestSignature')}\n </Button>\n <Dialog.Close asChild>\n <Button intent=\"outline\" disabled={busy}>\n {t('signatureRequest.close')}\n </Button>\n </Dialog.Close>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n </div>\n );\n },\n);\nSignatureRequestModal.displayName = 'SignatureRequestModal';\n"],"names":["__iconNode","Tablet","createLucideIcon","UserPlus","ASSIGN_LATER","CHANNEL_ORDER","labelFor","options","value","_a","option","SignatureRequestModal","forwardRef","open","onOpenChange","operators","signerOptions","currentOperatorId","allowAssignLater","requireOperator","requirePatient","initialOperatorId","initialOperatorChannel","initialSigners","maxSigners","busy","error","title","description","onRequestSignature","contentProps","ref","t","useTranslation","nextRowId","useRef","addButtonRef","channelsFor","signerId","allowed","channel","resolveChannel","preferred","available","seedOperator","_b","seedRows","signer","operatorDefaultChannel","operatorId","seedOperatorChannel","rows","operator","setOperator","useState","signers","setSigners","operatorChannel","setOperatorChannel","revertedTo","setRevertedTo","wasOpen","useEffect","nextOperator","nextRows","anySignerOnDevice","fallback","operatorSelectOptions","isUnassigned","channelMeta","jsx","MessageSquare","Mail","WhatsAppGlyph","operatorChannelOptions","chosenIds","nextFreeOption","canAddSigner","patchSigner","rowId","patch","current","addSigner","removeSigner","handleRequest","_rowId","Dialog","jsxs","Button","Avatar","Select","Checkbox","checked","InfoTip","Separator","Plus","rowOptions","rowLabel","rowChannelOptions","IconButton","X","Switch","Alert","PenLine"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,I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QAExC,gBAAA6C,EAACgB,EAAO,OAAP,EAAa,SAAO,IACnB,UAAA,gBAAAhB,EAACkB,GAAA,EAAO,QAAO,WAAU,UAAU/D,GAChC,UAAAO,EAAE,wBAAwB,GAC7B,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,GACF,GACF;AAAA,EAEJ;AACF;AACArB,GAAsB,cAAc;","x_google_ignoreList":[0,1]}
|
package/dist/agent-catalog.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -214,10 +214,10 @@ import { T as Og } from "./_chunks/transaction-chip-DJCstquX.js";
|
|
|
214
214
|
import { W as yg, a as kg } from "./_chunks/whatsapp-button-BIy6NaJK.js";
|
|
215
215
|
import { C as vg, W as Gg, a as Hg, b as wg, c as Vg, i as Ug, l as Wg, m as Kg, r as Yg, w as Xg, d as qg, e as zg, f as jg } from "./_chunks/workflow-map-BVMeVHkV.js";
|
|
216
216
|
import { A as Jg, a as Zg, b as $g, c as aC } from "./_chunks/alia-sidebar-DzNz1gDf.js";
|
|
217
|
-
import { A as rC, a as sC, L as oC, P as tC, S as nC, T as iC, b as pC, c as mC, d as lC, e as dC, f as AC, g as cC, h as fC, i as gC, j as CC, k as SC, l as xC, m as TC, r as uC, n as PC, s as IC, o as EC } from "./_chunks/anamnesis-i18n-
|
|
217
|
+
import { A as rC, a as sC, L as oC, P as tC, S as nC, T as iC, b as pC, c as mC, d as lC, e as dC, f as AC, g as cC, h as fC, i as gC, j as CC, k as SC, l as xC, m as TC, r as uC, n as PC, s as IC, o as EC } from "./_chunks/anamnesis-i18n-S0cCfFg9.js";
|
|
218
218
|
import { C as RC, M as _C, P as NC } from "./_chunks/marketplace-app-shell-DwcFMxzp.js";
|
|
219
219
|
import { P as DC } from "./_chunks/payment-automation-upsell-D_x880pr.js";
|
|
220
|
-
import { S as MC } from "./_chunks/signature-request-
|
|
220
|
+
import { S as MC } from "./_chunks/signature-request-CrRj64Nz.js";
|
|
221
221
|
import { D as LC, d as yC } from "./_chunks/dependent-selector-DyFpdzZV.js";
|
|
222
222
|
import { D as BC, d as vC } from "./_chunks/document-preview-D3gg4MXB.js";
|
|
223
223
|
import { D as HC, d as wC } from "./_chunks/document-scanner-D8ASqxif.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anamnesis-evolution.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;sBAEkB;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;mDAC+C;IAC/C,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;8DAC0D;IAC1D,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;uEACmE;IACnE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;+EAE2E;IAC3E,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/D;;;mEAG+D;IAC/D,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,MAAa,EACb,MAAM,EACN,kBAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,UAAU,GACX,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"anamnesis-evolution.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;sBAEkB;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;mDAC+C;IAC/C,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;8DAC0D;IAC1D,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;uEACmE;IACnE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;+EAE2E;IAC3E,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/D;;;mEAG+D;IAC/D,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,MAAa,EACb,MAAM,EACN,kBAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,UAAU,GACX,EAAE,uBAAuB,2CA8XzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as i, L as n, P as r, S as o, T as l, b as t, c as d, d as g, e as A, f as E, g as c, h as m, i as P, j as f, k as S, l as T, m as h, r as u, n as N, s as _, o as C } from "../../_chunks/anamnesis-i18n-
|
|
1
|
+
import { A as e, a as i, L as n, P as r, S as o, T as l, b as t, c as d, d as g, e as A, f as E, g as c, h as m, i as P, j as f, k as S, l as T, m as h, r as u, n as N, s as _, o as C } from "../../_chunks/anamnesis-i18n-S0cCfFg9.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Anamnesis,
|
|
4
4
|
i as AnamnesisConfigEditor,
|
|
@@ -95,6 +95,20 @@ export interface SignatureRequestModalProps {
|
|
|
95
95
|
initialSigners?: SignerRequest[];
|
|
96
96
|
/** Cap on roster size. Default `2`. */
|
|
97
97
|
maxSigners?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Whether an operator must counter-sign. `false` drops the operator
|
|
100
|
+
* section entirely and submits `operatorId: null` — a host whose document
|
|
101
|
+
* does not require a counter-signature must not be asked for one. Default
|
|
102
|
+
* `true`.
|
|
103
|
+
*/
|
|
104
|
+
requireOperator?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether the patient side signs at all. `false` drops the signer roster
|
|
107
|
+
* and submits an empty `signers` array — for documents only an operator
|
|
108
|
+
* signs. Default `true`. Setting BOTH this and `requireOperator` to false
|
|
109
|
+
* leaves nothing to request, so the primary action stays disabled.
|
|
110
|
+
*/
|
|
111
|
+
requirePatient?: boolean;
|
|
98
112
|
/** Disables all inputs and shows the primary action as loading. */
|
|
99
113
|
busy?: boolean;
|
|
100
114
|
/** Consumer-translated error shown above the footer (e.g. server failure). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-request.d.ts","sourceRoot":"","sources":["../../../src/patterns/signature-request/signature-request.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,OAAO,CAAC;AAuBf,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;AAE5D,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAClC;AAED,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,0BAA0B;IACzC,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,uEAAuE;IACvE,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,IAAI,EAAE,OAAO,CAAC;IACd;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,uDAAuD;IACvD,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,4DAA4D;IAC5D,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,uEAAuE;IACvE,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,kBAAkB,EAAE,CAAC,UAAU,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrE;;;OAGG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;CAChD;AAsBD,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"signature-request.d.ts","sourceRoot":"","sources":["../../../src/patterns/signature-request/signature-request.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,OAAO,CAAC;AAuBf,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;AAE5D,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,KAAK,EA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AC;IACzB,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,kBAAkB,EAAE,CAAC,UAAU,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrE;;;OAGG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;CAChD;AAsBD,eAAO,MAAM,qBAAqB,uHAujBjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfadocs/ui-kit-debug",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe. (debug build — identical runtime to @alfadocs/ui-kit, ships source maps for symbolication).",
|
|
6
6
|
"license": "BUSL-1.1",
|