@alfadocs/ui-kit 0.95.0 → 0.97.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/signature-request-BzXTV_RH.js +403 -0
- package/dist/agent-catalog.json +10 -6
- package/dist/agent-i18n/en.json +1 -1
- package/dist/i18n/locales/ar.d.ts +3 -1
- package/dist/i18n/locales/ar.js +3 -1
- package/dist/i18n/locales/de.d.ts +3 -1
- package/dist/i18n/locales/de.js +3 -1
- package/dist/i18n/locales/el.d.ts +3 -1
- package/dist/i18n/locales/el.js +3 -1
- package/dist/i18n/locales/en.d.ts +3 -1
- package/dist/i18n/locales/en.js +3 -1
- package/dist/i18n/locales/es.d.ts +3 -1
- package/dist/i18n/locales/es.js +3 -1
- package/dist/i18n/locales/fr.d.ts +3 -1
- package/dist/i18n/locales/fr.js +3 -1
- package/dist/i18n/locales/hi.d.ts +3 -1
- package/dist/i18n/locales/hi.js +3 -1
- package/dist/i18n/locales/it.d.ts +3 -1
- package/dist/i18n/locales/it.js +3 -1
- package/dist/i18n/locales/ja.d.ts +3 -1
- package/dist/i18n/locales/ja.js +3 -1
- package/dist/i18n/locales/nl.d.ts +3 -1
- package/dist/i18n/locales/nl.js +3 -1
- package/dist/i18n/locales/pl.d.ts +3 -1
- package/dist/i18n/locales/pl.js +3 -1
- package/dist/i18n/locales/pt.d.ts +3 -1
- package/dist/i18n/locales/pt.js +3 -1
- package/dist/i18n/locales/ro.d.ts +3 -1
- package/dist/i18n/locales/ro.js +3 -1
- package/dist/i18n/locales/ru.d.ts +3 -1
- package/dist/i18n/locales/ru.js +3 -1
- package/dist/i18n/locales/sq.d.ts +3 -1
- package/dist/i18n/locales/sq.js +3 -1
- package/dist/i18n/locales/sv.d.ts +3 -1
- package/dist/i18n/locales/sv.js +3 -1
- package/dist/i18n/locales/tr.d.ts +3 -1
- package/dist/i18n/locales/tr.js +3 -1
- package/dist/i18n/locales/zh.d.ts +3 -1
- package/dist/i18n/locales/zh.js +3 -1
- package/dist/index.js +1 -1
- package/dist/locales/ar.json +3 -1
- package/dist/locales/de.json +3 -1
- package/dist/locales/el.json +3 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/es.json +3 -1
- package/dist/locales/fr.json +3 -1
- package/dist/locales/hi.json +3 -1
- package/dist/locales/it.json +3 -1
- package/dist/locales/ja.json +3 -1
- package/dist/locales/nl.json +3 -1
- package/dist/locales/pl.json +3 -1
- package/dist/locales/pt.json +3 -1
- package/dist/locales/ro.json +3 -1
- package/dist/locales/ru.json +3 -1
- package/dist/locales/sq.json +3 -1
- package/dist/locales/sv.json +3 -1
- package/dist/locales/tr.json +3 -1
- package/dist/locales/zh.json +3 -1
- package/dist/patterns/signature-request/index.d.ts +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/signature-request.d.ts +30 -3
- package/dist/tokens.css +1 -0
- package/package.json +1 -1
- package/dist/_chunks/signature-request-D_6jgDZd.js +0 -324
package/package.json
CHANGED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as ne, useRef as C, useState as E, useEffect as te } from "react";
|
|
3
|
-
import { useTranslation as re } from "react-i18next";
|
|
4
|
-
import { D as u } from "./dialog-UbKJCi1X.js";
|
|
5
|
-
import { B as q } from "./button-CPGiR_bH.js";
|
|
6
|
-
import { I as ie } from "./icon-button-C_kbcd7I.js";
|
|
7
|
-
import { C as le } from "./checkbox-BuZ1u__2.js";
|
|
8
|
-
import { a as de } from "./whatsapp-button-BIy6NaJK.js";
|
|
9
|
-
import { S as L } from "./select-BW5ecXlX.js";
|
|
10
|
-
import { S as ce } from "./switch-OILsBLWo.js";
|
|
11
|
-
import { A as h } from "./alert-Cxaqd-QO.js";
|
|
12
|
-
import { S as oe } from "./separator-CYU_bGFn.js";
|
|
13
|
-
import { A as F } from "./avatar-BNQNhoyL.js";
|
|
14
|
-
import { c as W } from "./createLucideIcon-DhHxpK9K.js";
|
|
15
|
-
import { P as ue } from "./plus-DzMQ_c6b.js";
|
|
16
|
-
import { X as me } from "./x-B5YnXwCz.js";
|
|
17
|
-
import { P as pe } from "./pen-line-D0De5zdl.js";
|
|
18
|
-
import { M as he } from "./mail-BqXVF2zH.js";
|
|
19
|
-
import { M as ge } from "./message-square-Bye4ATvx.js";
|
|
20
|
-
/**
|
|
21
|
-
* @license lucide-react v1.22.0 - ISC
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the ISC license.
|
|
24
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/
|
|
26
|
-
const ve = [
|
|
27
|
-
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
28
|
-
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
29
|
-
], fe = W("tablet", ve);
|
|
30
|
-
/**
|
|
31
|
-
* @license lucide-react v1.22.0 - ISC
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the ISC license.
|
|
34
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/
|
|
36
|
-
const xe = [
|
|
37
|
-
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
38
|
-
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
39
|
-
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
40
|
-
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
41
|
-
], Re = W("user-plus", xe), g = "__assign-later__", H = [
|
|
42
|
-
"sms",
|
|
43
|
-
"email",
|
|
44
|
-
"whatsapp",
|
|
45
|
-
"on-device"
|
|
46
|
-
];
|
|
47
|
-
function V(m, w) {
|
|
48
|
-
var o;
|
|
49
|
-
return ((o = m.find((c) => c.value === w)) == null ? void 0 : o.label) ?? "";
|
|
50
|
-
}
|
|
51
|
-
const qe = ne(
|
|
52
|
-
({
|
|
53
|
-
open: m,
|
|
54
|
-
onOpenChange: w,
|
|
55
|
-
operators: o,
|
|
56
|
-
signerOptions: c,
|
|
57
|
-
currentOperatorId: _,
|
|
58
|
-
allowAssignLater: b = !0,
|
|
59
|
-
initialOperatorId: z,
|
|
60
|
-
initialSigners: I,
|
|
61
|
-
maxSigners: G = 2,
|
|
62
|
-
busy: d = !1,
|
|
63
|
-
error: M,
|
|
64
|
-
title: U,
|
|
65
|
-
description: X,
|
|
66
|
-
onRequestSignature: $,
|
|
67
|
-
contentProps: J
|
|
68
|
-
}, K) => {
|
|
69
|
-
const { t: a } = re(), D = C(0), O = C(null), P = (e) => {
|
|
70
|
-
var r;
|
|
71
|
-
const n = (r = c.find(
|
|
72
|
-
(l) => l.value === e
|
|
73
|
-
)) == null ? void 0 : r.availableChannels;
|
|
74
|
-
return n && n.length > 0 ? H.filter((l) => n.includes(l)) : H;
|
|
75
|
-
}, N = (e, n) => {
|
|
76
|
-
const r = P(e);
|
|
77
|
-
return r.includes(n) ? n : r[0];
|
|
78
|
-
}, A = () => {
|
|
79
|
-
var e, n;
|
|
80
|
-
return z === null ? b ? g : ((e = o[0]) == null ? void 0 : e.value) ?? g : z ?? ((n = o[0]) == null ? void 0 : n.value) ?? (b ? g : "");
|
|
81
|
-
}, B = () => (I && I.length > 0 ? I : c.length > 0 ? [
|
|
82
|
-
{
|
|
83
|
-
signerId: c[0].value,
|
|
84
|
-
channel: N(c[0].value, "on-device")
|
|
85
|
-
}
|
|
86
|
-
] : []).map((n) => ({ ...n, rowId: D.current++ })), [v, S] = E(A), [p, f] = E(B), T = C(m);
|
|
87
|
-
te(() => {
|
|
88
|
-
m && !T.current && (S(A()), f(B())), T.current = m;
|
|
89
|
-
}, [m]);
|
|
90
|
-
const Q = b ? [
|
|
91
|
-
...o,
|
|
92
|
-
{ value: g, label: a("signatureRequest.assignLater") }
|
|
93
|
-
] : o, k = v === g, Y = {
|
|
94
|
-
sms: {
|
|
95
|
-
label: a("signatureRequest.viaSms"),
|
|
96
|
-
icon: /* @__PURE__ */ s(ge, { className: "ds:size-4", "aria-hidden": !0 })
|
|
97
|
-
},
|
|
98
|
-
email: {
|
|
99
|
-
label: a("signatureRequest.viaEmail"),
|
|
100
|
-
icon: /* @__PURE__ */ s(he, { className: "ds:size-4", "aria-hidden": !0 })
|
|
101
|
-
},
|
|
102
|
-
whatsapp: {
|
|
103
|
-
label: a("signatureRequest.viaWhatsapp"),
|
|
104
|
-
icon: /* @__PURE__ */ s(de, { className: "ds:size-4", "aria-hidden": !0 })
|
|
105
|
-
},
|
|
106
|
-
"on-device": {
|
|
107
|
-
label: a("signatureRequest.onThisDevice"),
|
|
108
|
-
icon: /* @__PURE__ */ s(fe, { className: "ds:size-4", "aria-hidden": !0 })
|
|
109
|
-
}
|
|
110
|
-
}, j = p.map((e) => e.signerId), x = c.find(
|
|
111
|
-
(e) => !j.includes(e.value)
|
|
112
|
-
), Z = !d && p.length < G && x !== void 0, y = (e, n) => {
|
|
113
|
-
f(
|
|
114
|
-
(r) => r.map(
|
|
115
|
-
(l) => l.rowId === e ? { ...l, ...n } : l
|
|
116
|
-
)
|
|
117
|
-
);
|
|
118
|
-
}, ee = () => {
|
|
119
|
-
x && f((e) => [
|
|
120
|
-
...e,
|
|
121
|
-
{
|
|
122
|
-
signerId: x.value,
|
|
123
|
-
channel: N(x.value, "sms"),
|
|
124
|
-
rowId: D.current++
|
|
125
|
-
}
|
|
126
|
-
]);
|
|
127
|
-
}, se = (e) => {
|
|
128
|
-
var n;
|
|
129
|
-
(n = O.current) == null || n.focus(), f(
|
|
130
|
-
(r) => r.filter((l) => l.rowId !== e)
|
|
131
|
-
);
|
|
132
|
-
}, ae = () => {
|
|
133
|
-
$({
|
|
134
|
-
operatorId: k ? null : v,
|
|
135
|
-
signers: p.map(({ rowId: e, ...n }) => n)
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
return /* @__PURE__ */ s("div", { ref: K, className: "ds:contents", "data-component": "signature-request", children: /* @__PURE__ */ s(u, { open: m, onOpenChange: w, children: /* @__PURE__ */ i(u.Content, { size: "lg", hideCloseButton: !0, ...J, children: [
|
|
139
|
-
/* @__PURE__ */ i(u.Header, { children: [
|
|
140
|
-
/* @__PURE__ */ s(u.Title, { children: U ?? a("signatureRequest.title") }),
|
|
141
|
-
/* @__PURE__ */ s(u.Description, { children: X ?? a("signatureRequest.noSignedVersions") })
|
|
142
|
-
] }),
|
|
143
|
-
/* @__PURE__ */ i(u.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
144
|
-
/* @__PURE__ */ i("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
145
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
146
|
-
/* @__PURE__ */ s("p", { className: "type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]", children: a("signatureRequest.operatorSection") }),
|
|
147
|
-
_ !== void 0 ? /* @__PURE__ */ s(
|
|
148
|
-
q,
|
|
149
|
-
{
|
|
150
|
-
intent: "primary",
|
|
151
|
-
size: "sm",
|
|
152
|
-
startIcon: /* @__PURE__ */ s(Re, {}),
|
|
153
|
-
disabled: d,
|
|
154
|
-
onClick: () => S(_),
|
|
155
|
-
children: a("signatureRequest.assignToMe")
|
|
156
|
-
}
|
|
157
|
-
) : null
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
160
|
-
/* @__PURE__ */ s(
|
|
161
|
-
F,
|
|
162
|
-
{
|
|
163
|
-
"aria-hidden": "true",
|
|
164
|
-
name: k ? void 0 : V(o, v),
|
|
165
|
-
size: "sm"
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:flex-1 ds:text-start", children: /* @__PURE__ */ s(
|
|
169
|
-
L,
|
|
170
|
-
{
|
|
171
|
-
options: Q,
|
|
172
|
-
value: v,
|
|
173
|
-
onValueChange: (e) => e && S(e),
|
|
174
|
-
required: !0,
|
|
175
|
-
disabled: d,
|
|
176
|
-
placeholder: a("signatureRequest.operatorPlaceholder"),
|
|
177
|
-
"aria-label": a("signatureRequest.operatorSection")
|
|
178
|
-
}
|
|
179
|
-
) })
|
|
180
|
-
] }),
|
|
181
|
-
k ? null : /* @__PURE__ */ s(h, { variant: "info", children: /* @__PURE__ */ s(h.Description, { children: a("signatureRequest.operatorHint") }) })
|
|
182
|
-
] }),
|
|
183
|
-
/* @__PURE__ */ s(oe, { decorative: !0 }),
|
|
184
|
-
/* @__PURE__ */ i("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start", children: [
|
|
185
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
186
|
-
/* @__PURE__ */ s("p", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: a("signatureRequest.signersSection") }),
|
|
187
|
-
/* @__PURE__ */ s(
|
|
188
|
-
q,
|
|
189
|
-
{
|
|
190
|
-
ref: O,
|
|
191
|
-
intent: "primary",
|
|
192
|
-
size: "sm",
|
|
193
|
-
startIcon: /* @__PURE__ */ s(ue, {}),
|
|
194
|
-
disabled: !Z,
|
|
195
|
-
onClick: ee,
|
|
196
|
-
children: a("signatureRequest.addSigner")
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
] }),
|
|
200
|
-
p.map((e) => {
|
|
201
|
-
const n = c.filter(
|
|
202
|
-
(t) => t.value === e.signerId || !j.includes(t.value)
|
|
203
|
-
), r = V(c, e.signerId), l = P(e.signerId).map(
|
|
204
|
-
(t) => ({ value: t, ...Y[t] })
|
|
205
|
-
);
|
|
206
|
-
return /* @__PURE__ */ i(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
role: "group",
|
|
210
|
-
"aria-label": r,
|
|
211
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
214
|
-
/* @__PURE__ */ s(F, { "aria-hidden": "true", name: r, size: "sm" }),
|
|
215
|
-
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ s(
|
|
216
|
-
L,
|
|
217
|
-
{
|
|
218
|
-
options: n,
|
|
219
|
-
value: e.signerId,
|
|
220
|
-
onValueChange: (t) => {
|
|
221
|
-
if (!t) return;
|
|
222
|
-
const R = N(
|
|
223
|
-
t,
|
|
224
|
-
e.channel
|
|
225
|
-
);
|
|
226
|
-
y(e.rowId, {
|
|
227
|
-
signerId: t,
|
|
228
|
-
channel: R,
|
|
229
|
-
skipOtp: R === "on-device" ? e.skipOtp : void 0
|
|
230
|
-
});
|
|
231
|
-
},
|
|
232
|
-
required: !0,
|
|
233
|
-
disabled: d,
|
|
234
|
-
placeholder: a(
|
|
235
|
-
"signatureRequest.signerPlaceholder"
|
|
236
|
-
),
|
|
237
|
-
"aria-label": a("signatureRequest.signerPlaceholder")
|
|
238
|
-
}
|
|
239
|
-
) }),
|
|
240
|
-
p.length > 1 ? /* @__PURE__ */ s(
|
|
241
|
-
ie,
|
|
242
|
-
{
|
|
243
|
-
intent: "ghost",
|
|
244
|
-
size: "sm",
|
|
245
|
-
icon: /* @__PURE__ */ s(me, {}),
|
|
246
|
-
disabled: d,
|
|
247
|
-
"aria-label": a("signatureRequest.removeSigner"),
|
|
248
|
-
onClick: () => se(e.rowId)
|
|
249
|
-
}
|
|
250
|
-
) : null
|
|
251
|
-
] }),
|
|
252
|
-
/* @__PURE__ */ s(
|
|
253
|
-
"div",
|
|
254
|
-
{
|
|
255
|
-
role: "group",
|
|
256
|
-
"aria-label": a("signatureRequest.channelLabel"),
|
|
257
|
-
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)]",
|
|
258
|
-
children: l.map((t) => /* @__PURE__ */ s(
|
|
259
|
-
le,
|
|
260
|
-
{
|
|
261
|
-
checked: e.channel === t.value,
|
|
262
|
-
disabled: d,
|
|
263
|
-
onCheckedChange: (R) => R === !0 && y(e.rowId, {
|
|
264
|
-
channel: t.value,
|
|
265
|
-
skipOtp: void 0
|
|
266
|
-
}),
|
|
267
|
-
label: /* @__PURE__ */ i("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
268
|
-
/* @__PURE__ */ s(
|
|
269
|
-
"span",
|
|
270
|
-
{
|
|
271
|
-
"aria-hidden": "true",
|
|
272
|
-
className: "ds:text-[var(--accent)]",
|
|
273
|
-
children: t.icon
|
|
274
|
-
}
|
|
275
|
-
),
|
|
276
|
-
t.label
|
|
277
|
-
] })
|
|
278
|
-
},
|
|
279
|
-
t.value
|
|
280
|
-
))
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
e.channel === "on-device" ? /* @__PURE__ */ s("div", { className: "ds:ps-[var(--spacing-xl)]", children: /* @__PURE__ */ s(
|
|
284
|
-
ce,
|
|
285
|
-
{
|
|
286
|
-
label: a("signatureRequest.noOtp"),
|
|
287
|
-
checked: e.skipOtp === !0,
|
|
288
|
-
disabled: d,
|
|
289
|
-
onCheckedChange: (t) => y(e.rowId, { skipOtp: t })
|
|
290
|
-
}
|
|
291
|
-
) }) : null
|
|
292
|
-
]
|
|
293
|
-
},
|
|
294
|
-
e.rowId
|
|
295
|
-
);
|
|
296
|
-
})
|
|
297
|
-
] }),
|
|
298
|
-
p.some(
|
|
299
|
-
(e) => e.channel === "on-device" && e.skipOtp === !0
|
|
300
|
-
) ? /* @__PURE__ */ s(h, { variant: "warning", children: /* @__PURE__ */ s(h.Description, { children: a("signatureRequest.noOtpWarning") }) }) : null,
|
|
301
|
-
M ? /* @__PURE__ */ s(h, { variant: "error", children: /* @__PURE__ */ s(h.Description, { children: M }) }) : null
|
|
302
|
-
] }),
|
|
303
|
-
/* @__PURE__ */ i(u.Footer, { children: [
|
|
304
|
-
/* @__PURE__ */ s(
|
|
305
|
-
q,
|
|
306
|
-
{
|
|
307
|
-
intent: "primary",
|
|
308
|
-
startIcon: /* @__PURE__ */ s(pe, {}),
|
|
309
|
-
onClick: ae,
|
|
310
|
-
disabled: d || p.length === 0,
|
|
311
|
-
loading: d,
|
|
312
|
-
children: a("signatureRequest.requestSignature")
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
/* @__PURE__ */ s(u.Close, { asChild: !0, children: /* @__PURE__ */ s(q, { intent: "outline", disabled: d, children: a("signatureRequest.close") }) })
|
|
316
|
-
] })
|
|
317
|
-
] }) }) });
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
qe.displayName = "SignatureRequestModal";
|
|
321
|
-
export {
|
|
322
|
-
qe as S
|
|
323
|
-
};
|
|
324
|
-
//# sourceMappingURL=signature-request-D_6jgDZd.js.map
|