@alfadocs/ui-kit 0.77.0 → 0.79.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/{alia-sidebar-w6B0TEx7.js → alia-sidebar-DzNz1gDf.js} +2 -2
- package/dist/_chunks/calendar-4dXTvsCz.js +1136 -0
- package/dist/_chunks/calendar-event-card-C6qGtywL.js +257 -0
- package/dist/_chunks/{chat-input-BTCDqUDX.js → chat-input-QpHxBEnN.js} +32 -31
- package/dist/_chunks/document-preview-nwfulDEs.js +290 -0
- package/dist/_chunks/{fiscal-code-input-DWA6C8x8.js → fiscal-code-input-QP9gkyDE.js} +2 -2
- package/dist/_chunks/{patient-details-zy76MRh7.js → patient-details-COvYWp2e.js} +2 -2
- package/dist/_chunks/signature-request-CEOrCDyk.js +341 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/contrast-warning.d.ts +46 -0
- package/dist/components/calendar/calendar.d.ts +284 -7
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/calendar-event-card.d.ts +103 -0
- package/dist/components/calendar-event-card/index.d.ts +3 -0
- package/dist/components/calendar-event-card/index.js +5 -0
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/document-preview/document-preview.d.ts +10 -0
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +6 -0
- package/dist/i18n/locales/ar.js +6 -0
- package/dist/i18n/locales/de.d.ts +6 -0
- package/dist/i18n/locales/de.js +6 -0
- package/dist/i18n/locales/el.d.ts +6 -0
- package/dist/i18n/locales/el.js +6 -0
- package/dist/i18n/locales/en.d.ts +6 -0
- package/dist/i18n/locales/en.js +6 -0
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +6 -0
- package/dist/i18n/locales/fr.d.ts +6 -0
- package/dist/i18n/locales/fr.js +6 -0
- package/dist/i18n/locales/hi.d.ts +6 -0
- package/dist/i18n/locales/hi.js +6 -0
- package/dist/i18n/locales/it.d.ts +6 -0
- package/dist/i18n/locales/it.js +6 -0
- package/dist/i18n/locales/ja.d.ts +6 -0
- package/dist/i18n/locales/ja.js +6 -0
- package/dist/i18n/locales/nl.d.ts +6 -0
- package/dist/i18n/locales/nl.js +6 -0
- package/dist/i18n/locales/pl.d.ts +6 -0
- package/dist/i18n/locales/pl.js +6 -0
- package/dist/i18n/locales/pt.d.ts +6 -0
- package/dist/i18n/locales/pt.js +6 -0
- package/dist/i18n/locales/ro.d.ts +6 -0
- package/dist/i18n/locales/ro.js +6 -0
- package/dist/i18n/locales/ru.d.ts +6 -0
- package/dist/i18n/locales/ru.js +6 -0
- package/dist/i18n/locales/sq.d.ts +6 -0
- package/dist/i18n/locales/sq.js +6 -0
- package/dist/i18n/locales/sv.d.ts +6 -0
- package/dist/i18n/locales/sv.js +6 -0
- package/dist/i18n/locales/tr.d.ts +6 -0
- package/dist/i18n/locales/tr.js +6 -0
- package/dist/i18n/locales/zh.d.ts +6 -0
- package/dist/i18n/locales/zh.js +6 -0
- package/dist/index.js +252 -250
- package/dist/locales/ar.json +6 -0
- package/dist/locales/de.json +6 -0
- package/dist/locales/el.json +6 -0
- package/dist/locales/en.json +6 -0
- package/dist/locales/es.json +6 -0
- package/dist/locales/fr.json +6 -0
- package/dist/locales/hi.json +6 -0
- package/dist/locales/it.json +6 -0
- package/dist/locales/ja.json +6 -0
- package/dist/locales/nl.json +6 -0
- package/dist/locales/pl.json +6 -0
- package/dist/locales/pt.json +6 -0
- package/dist/locales/ro.json +6 -0
- package/dist/locales/ru.json +6 -0
- package/dist/locales/sq.json +6 -0
- package/dist/locales/sv.json +6 -0
- package/dist/locales/tr.json +6 -0
- package/dist/locales/zh.json +6 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/signature-request.d.ts +7 -0
- package/dist/tokens.css +9 -5
- package/package.json +5 -1
- package/dist/_chunks/calendar-DeAlFPsF.js +0 -1050
- package/dist/_chunks/document-preview-CvHnHf6T.js +0 -243
- package/dist/_chunks/signature-request-C-mskXwi.js +0 -318
- package/dist/components/calendar/contrast-warning.d.ts +0 -20
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as j, useMemo as S, useState as C, useImperativeHandle as W } from "react";
|
|
3
|
-
import { c as U } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as $ } from "react-i18next";
|
|
5
|
-
import { B as h } from "./badge-DCOqV9mI.js";
|
|
6
|
-
import { E as G } from "./empty-state-CrLsi0XI.js";
|
|
7
|
-
import { P as Y } from "./panel-header-D313n_9-.js";
|
|
8
|
-
import { P as q } from "./pdf-viewer-DF3VMaPo.js";
|
|
9
|
-
import { T as J, b as O, c as Q, a as X } from "./tabs-CVTukWRD.js";
|
|
10
|
-
import { u as Z } from "./registry-DvAUVLHh.js";
|
|
11
|
-
import { F as ee, a as te } from "./file-Cwe9VC1A.js";
|
|
12
|
-
import { F as ae } from "./file-text-5yv6r2ls.js";
|
|
13
|
-
import { c as ie } from "./createLucideIcon-DhHxpK9K.js";
|
|
14
|
-
/**
|
|
15
|
-
* @license lucide-react v1.22.0 - ISC
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the ISC license.
|
|
18
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
const ne = [
|
|
21
|
-
["path", { d: "M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8", key: "14sh0y" }],
|
|
22
|
-
[
|
|
23
|
-
"path",
|
|
24
|
-
{
|
|
25
|
-
d: "M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",
|
|
26
|
-
key: "1970lx"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
["path", { d: "M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1", key: "l4dndm" }]
|
|
30
|
-
], se = ie("files", ne), re = {
|
|
31
|
-
id: "document-preview",
|
|
32
|
-
capabilities: [],
|
|
33
|
-
state: {
|
|
34
|
-
kind: {
|
|
35
|
-
type: "'pdf' | 'image' | 'metadata' | 'empty'",
|
|
36
|
-
descriptionKey: "ui.agent.documentPreview.state.kind",
|
|
37
|
-
description: "Which render branch is active: pdf, image, metadata (no inline preview), or empty (no document). Structural — never the document name.",
|
|
38
|
-
read: (i) => i.getKind()
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
actions: {
|
|
42
|
-
get_name: {
|
|
43
|
-
// phi (not read): resolves the document display name, which can identify
|
|
44
|
-
// patients. PRS §26 — phi outranks read so the host gates it behind
|
|
45
|
-
// stricter confirm + audit. The always-on kind slot stays name-free.
|
|
46
|
-
safety: "phi",
|
|
47
|
-
returns: "string | undefined",
|
|
48
|
-
returnsSchema: { type: ["string", "null"] },
|
|
49
|
-
idempotent: !0,
|
|
50
|
-
descriptionKey: "ui.agent.documentPreview.actions.getName",
|
|
51
|
-
description: "Read the display name of the previewed document. May identify a patient (PHI).",
|
|
52
|
-
invoke: (i) => i.getName()
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
domHooks: {
|
|
56
|
-
root: {
|
|
57
|
-
attr: "data-component",
|
|
58
|
-
value: "document-preview",
|
|
59
|
-
description: "Marks the DocumentPreview region."
|
|
60
|
-
},
|
|
61
|
-
instanceId: {
|
|
62
|
-
attr: "data-component-id",
|
|
63
|
-
sourceProp: "id",
|
|
64
|
-
description: "Sourced from the id prop."
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, de = U(
|
|
68
|
-
[
|
|
69
|
-
"ds:flex ds:h-full ds:min-h-0 ds:min-w-0 ds:flex-col ds:overflow-auto",
|
|
70
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
71
|
-
"ds:focus-visible:outline-solid",
|
|
72
|
-
"ds:focus-visible:outline-ring"
|
|
73
|
-
].join(" ")
|
|
74
|
-
), me = {
|
|
75
|
-
signed: "success",
|
|
76
|
-
pending: "warning"
|
|
77
|
-
};
|
|
78
|
-
function k(i, n, l) {
|
|
79
|
-
if (!i) return "empty";
|
|
80
|
-
const r = n ?? "";
|
|
81
|
-
return r === "application/pdf" && l ? "pdf" : r.startsWith("image/") && l ? "image" : "metadata";
|
|
82
|
-
}
|
|
83
|
-
function B(i) {
|
|
84
|
-
const n = i ?? "";
|
|
85
|
-
return n.startsWith("image/") ? ee : n === "application/pdf" || n.startsWith("text/") || n.includes("word") ? ae : te;
|
|
86
|
-
}
|
|
87
|
-
const oe = [
|
|
88
|
-
"documentPreview.units.bytes",
|
|
89
|
-
"documentPreview.units.kilobytes",
|
|
90
|
-
"documentPreview.units.megabytes",
|
|
91
|
-
"documentPreview.units.gigabytes"
|
|
92
|
-
], M = ["B", "KB", "MB", "GB"];
|
|
93
|
-
function le(i, n, l) {
|
|
94
|
-
let r = i, m = 0;
|
|
95
|
-
for (; r >= 1024 && m < M.length - 1; )
|
|
96
|
-
r /= 1024, m++;
|
|
97
|
-
return `${new Intl.NumberFormat(n, {
|
|
98
|
-
maximumFractionDigits: m === 0 ? 0 : 1
|
|
99
|
-
}).format(r)} ${l(oe[m], M[m])}`;
|
|
100
|
-
}
|
|
101
|
-
const ce = j(({ id: i, name: n, mimeType: l, src: r, metadata: m, documents: u, className: K }, D) => {
|
|
102
|
-
const { t: s, i18n: v } = $(), o = S(() => u && u.length > 0 ? u : n ? [{ id: i ?? n, name: n, mimeType: l, src: r, metadata: m }] : [], [u, i, n, l, r, m]), w = o.length > 1, [L, _] = C(void 0), a = o.find((e) => e.id === L) ?? o[0], y = S(
|
|
103
|
-
() => ({
|
|
104
|
-
getKind: () => a ? k(a.name, a.mimeType, a.src) : "empty",
|
|
105
|
-
getName: () => a == null ? void 0 : a.name
|
|
106
|
-
}),
|
|
107
|
-
[a]
|
|
108
|
-
);
|
|
109
|
-
W(D, () => y, [y]), Z(re, y, i);
|
|
110
|
-
const b = (e) => {
|
|
111
|
-
var N, P, x, T, I, z, A, F;
|
|
112
|
-
const f = k(e.name, e.mimeType, e.src);
|
|
113
|
-
if (f === "pdf" && e.src)
|
|
114
|
-
return /* @__PURE__ */ t(
|
|
115
|
-
q,
|
|
116
|
-
{
|
|
117
|
-
src: e.src,
|
|
118
|
-
toolbarVariant: "minimal",
|
|
119
|
-
ariaLabel: e.name,
|
|
120
|
-
className: "ds:h-full"
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
if (f === "image" && e.src)
|
|
124
|
-
return /* @__PURE__ */ t(
|
|
125
|
-
"img",
|
|
126
|
-
{
|
|
127
|
-
src: e.src,
|
|
128
|
-
alt: s("documentPreview.imageAlt", "Preview of {{name}}", {
|
|
129
|
-
name: e.name
|
|
130
|
-
}),
|
|
131
|
-
className: "ds:max-h-full ds:max-w-full ds:ms-auto ds:me-auto ds:object-contain"
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
const c = (N = e.metadata) == null ? void 0 : N.signatureStatus, R = !!((P = e.metadata) != null && P.documentType) || !!((x = e.metadata) != null && x.clinical) || c !== void 0 && c !== "none";
|
|
135
|
-
return /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
136
|
-
R && /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
137
|
-
((T = e.metadata) == null ? void 0 : T.documentType) && /* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: e.metadata.documentType }),
|
|
138
|
-
((I = e.metadata) == null ? void 0 : I.clinical) && /* @__PURE__ */ t(h, { variant: "info", size: "sm", children: s("documentPreview.clinical", "Clinical") }),
|
|
139
|
-
c && c !== "none" && /* @__PURE__ */ t(h, { variant: me[c], size: "sm", withDot: !0, children: s(`documentPreview.signature.${c}`, c) })
|
|
140
|
-
] }),
|
|
141
|
-
/* @__PURE__ */ d("dl", { className: "ds:grid ds:grid-cols-[auto_1fr] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] type-body-sm", children: [
|
|
142
|
-
((z = e.metadata) == null ? void 0 : z.size) !== void 0 && /* @__PURE__ */ d(g, { children: [
|
|
143
|
-
/* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.size", "Size") }),
|
|
144
|
-
/* @__PURE__ */ t("dd", { className: "ds:m-0", children: le(e.metadata.size, v.language, s) })
|
|
145
|
-
] }),
|
|
146
|
-
((A = e.metadata) == null ? void 0 : A.updatedAt) && /* @__PURE__ */ d(g, { children: [
|
|
147
|
-
/* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.modified", "Modified") }),
|
|
148
|
-
/* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
|
|
149
|
-
dateStyle: "medium"
|
|
150
|
-
}).format(new Date(e.metadata.updatedAt)) })
|
|
151
|
-
] }),
|
|
152
|
-
((F = e.metadata) == null ? void 0 : F.expiresAt) && /* @__PURE__ */ d(g, { children: [
|
|
153
|
-
/* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.expires", "Expires") }),
|
|
154
|
-
/* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
|
|
155
|
-
dateStyle: "medium"
|
|
156
|
-
}).format(new Date(e.metadata.expiresAt)) })
|
|
157
|
-
] })
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-muted-foreground", children: s("documentPreview.noPreview", "No preview available.") })
|
|
160
|
-
] });
|
|
161
|
-
}, V = B(a == null ? void 0 : a.mimeType), E = w ? /* @__PURE__ */ t(se, { "aria-hidden": "true" }) : /* @__PURE__ */ t(V, { "aria-hidden": "true" }), H = w ? /* @__PURE__ */ d(g, { children: [
|
|
162
|
-
s("documentPreview.multiTitle", "Documents"),
|
|
163
|
-
/* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: o.length })
|
|
164
|
-
] }) : a == null ? void 0 : a.name;
|
|
165
|
-
let p;
|
|
166
|
-
return o.length === 0 ? p = /* @__PURE__ */ t(
|
|
167
|
-
G,
|
|
168
|
-
{
|
|
169
|
-
variant: "first-use",
|
|
170
|
-
size: "sm",
|
|
171
|
-
title: s("documentPreview.emptyTitle", "No document selected"),
|
|
172
|
-
description: s(
|
|
173
|
-
"documentPreview.emptyDescription",
|
|
174
|
-
"Select a document to preview it here."
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
) : w ? p = /* @__PURE__ */ d(
|
|
178
|
-
J,
|
|
179
|
-
{
|
|
180
|
-
value: (a == null ? void 0 : a.id) ?? "",
|
|
181
|
-
onValueChange: _,
|
|
182
|
-
variant: "underlined",
|
|
183
|
-
size: "sm",
|
|
184
|
-
className: "ds:min-h-0 ds:flex-1 ds:pt-[var(--spacing-sm)]",
|
|
185
|
-
children: [
|
|
186
|
-
/* @__PURE__ */ t(
|
|
187
|
-
O,
|
|
188
|
-
{
|
|
189
|
-
"aria-label": s("documentPreview.tabsLabel", "Selected documents"),
|
|
190
|
-
className: "ds:gap-[var(--spacing-sm)]",
|
|
191
|
-
children: o.map((e) => {
|
|
192
|
-
const f = B(e.mimeType);
|
|
193
|
-
return /* @__PURE__ */ t(
|
|
194
|
-
Q,
|
|
195
|
-
{
|
|
196
|
-
value: e.id,
|
|
197
|
-
icon: /* @__PURE__ */ t(
|
|
198
|
-
f,
|
|
199
|
-
{
|
|
200
|
-
"aria-hidden": "true",
|
|
201
|
-
className: "ds:size-4 ds:text-[color:var(--accent)]"
|
|
202
|
-
}
|
|
203
|
-
),
|
|
204
|
-
className: "ds:[min-inline-size:0]",
|
|
205
|
-
children: /* @__PURE__ */ t("span", { className: "ds:block ds:truncate ds:[min-inline-size:0]", children: e.name })
|
|
206
|
-
},
|
|
207
|
-
e.id
|
|
208
|
-
);
|
|
209
|
-
})
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
o.map((e) => /* @__PURE__ */ t(
|
|
213
|
-
X,
|
|
214
|
-
{
|
|
215
|
-
value: e.id,
|
|
216
|
-
className: "ds:min-h-0 ds:flex-1",
|
|
217
|
-
children: b(e)
|
|
218
|
-
},
|
|
219
|
-
e.id
|
|
220
|
-
))
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
) : p = b(a), /* @__PURE__ */ d(
|
|
224
|
-
"section",
|
|
225
|
-
{
|
|
226
|
-
"data-component": "document-preview",
|
|
227
|
-
"data-component-id": i,
|
|
228
|
-
tabIndex: 0,
|
|
229
|
-
"aria-label": s("documentPreview.regionLabel", "Document preview"),
|
|
230
|
-
className: de({ className: K }),
|
|
231
|
-
children: [
|
|
232
|
-
o.length > 0 && /* @__PURE__ */ t(Y, { sticky: !0, icon: E, title: H }),
|
|
233
|
-
p
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
);
|
|
237
|
-
});
|
|
238
|
-
ce.displayName = "DocumentPreview";
|
|
239
|
-
export {
|
|
240
|
-
ce as D,
|
|
241
|
-
re as d
|
|
242
|
-
};
|
|
243
|
-
//# sourceMappingURL=document-preview-CvHnHf6T.js.map
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Z, useRef as b, useState as T, useEffect as ee } from "react";
|
|
3
|
-
import { useTranslation as se } from "react-i18next";
|
|
4
|
-
import { D as d } from "./dialog-UbKJCi1X.js";
|
|
5
|
-
import { B as f } from "./button-CPGiR_bH.js";
|
|
6
|
-
import { I as ae } from "./icon-button-C_kbcd7I.js";
|
|
7
|
-
import { C as te } from "./checkbox-BuZ1u__2.js";
|
|
8
|
-
import { a as re } from "./whatsapp-button-BIy6NaJK.js";
|
|
9
|
-
import { S as B } from "./select-BW5ecXlX.js";
|
|
10
|
-
import { S as ne } from "./switch-OILsBLWo.js";
|
|
11
|
-
import { A as p } from "./alert-KJbsPYkI.js";
|
|
12
|
-
import { S as ie } from "./separator-CYU_bGFn.js";
|
|
13
|
-
import { A as j } from "./avatar-BNQNhoyL.js";
|
|
14
|
-
import { c as S } from "./createLucideIcon-DhHxpK9K.js";
|
|
15
|
-
import { M as le } from "./mail-BqXVF2zH.js";
|
|
16
|
-
import { P as de } from "./plus-DzMQ_c6b.js";
|
|
17
|
-
import { X as ce } from "./x-B5YnXwCz.js";
|
|
18
|
-
import { P as oe } from "./pen-line-D0De5zdl.js";
|
|
19
|
-
/**
|
|
20
|
-
* @license lucide-react v1.22.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
const ue = [
|
|
26
|
-
[
|
|
27
|
-
"path",
|
|
28
|
-
{
|
|
29
|
-
d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
|
|
30
|
-
key: "18887p"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
["path", { d: "M7 11h10", key: "1twpyw" }],
|
|
34
|
-
["path", { d: "M7 15h6", key: "d9of3u" }],
|
|
35
|
-
["path", { d: "M7 7h8", key: "af5zfr" }]
|
|
36
|
-
], me = S("message-square-text", ue);
|
|
37
|
-
/**
|
|
38
|
-
* @license lucide-react v1.22.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
const pe = [
|
|
44
|
-
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
45
|
-
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
46
|
-
], he = S("tablet", pe);
|
|
47
|
-
/**
|
|
48
|
-
* @license lucide-react v1.22.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/
|
|
53
|
-
const ge = [
|
|
54
|
-
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
55
|
-
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
56
|
-
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
57
|
-
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
58
|
-
], ve = S("user-plus", ge), h = "__assign-later__";
|
|
59
|
-
function H(c, x) {
|
|
60
|
-
var l;
|
|
61
|
-
return ((l = c.find((o) => o.value === x)) == null ? void 0 : l.label) ?? "";
|
|
62
|
-
}
|
|
63
|
-
const fe = Z(
|
|
64
|
-
({
|
|
65
|
-
open: c,
|
|
66
|
-
onOpenChange: x,
|
|
67
|
-
operators: l,
|
|
68
|
-
signerOptions: o,
|
|
69
|
-
currentOperatorId: k,
|
|
70
|
-
allowAssignLater: q = !0,
|
|
71
|
-
initialOperatorId: C,
|
|
72
|
-
initialSigners: R,
|
|
73
|
-
maxSigners: L = 2,
|
|
74
|
-
busy: i = !1,
|
|
75
|
-
error: z,
|
|
76
|
-
title: V,
|
|
77
|
-
description: E,
|
|
78
|
-
onRequestSignature: F,
|
|
79
|
-
contentProps: W
|
|
80
|
-
}, G) => {
|
|
81
|
-
const { t: a } = se(), _ = b(0), M = b(null), P = () => {
|
|
82
|
-
var s, r;
|
|
83
|
-
return C === null ? q ? h : ((s = l[0]) == null ? void 0 : s.value) ?? h : C ?? ((r = l[0]) == null ? void 0 : r.value) ?? (q ? h : "");
|
|
84
|
-
}, A = () => (R && R.length > 0 ? R : o.length > 0 ? [
|
|
85
|
-
{
|
|
86
|
-
signerId: o[0].value,
|
|
87
|
-
channel: "on-device"
|
|
88
|
-
}
|
|
89
|
-
] : []).map((r) => ({ ...r, rowId: _.current++ })), [g, w] = T(P), [u, v] = T(A), D = b(c);
|
|
90
|
-
ee(() => {
|
|
91
|
-
c && !D.current && (w(P()), v(A())), D.current = c;
|
|
92
|
-
}, [c]);
|
|
93
|
-
const U = q ? [
|
|
94
|
-
...l,
|
|
95
|
-
{ value: h, label: a("signatureRequest.assignLater") }
|
|
96
|
-
] : l, y = g === h, $ = [
|
|
97
|
-
{
|
|
98
|
-
value: "sms",
|
|
99
|
-
label: a("signatureRequest.viaSms"),
|
|
100
|
-
icon: /* @__PURE__ */ e(me, { className: "ds:size-4", "aria-hidden": !0 })
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
value: "email",
|
|
104
|
-
label: a("signatureRequest.viaEmail"),
|
|
105
|
-
icon: /* @__PURE__ */ e(le, { className: "ds:size-4", "aria-hidden": !0 })
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
value: "whatsapp",
|
|
109
|
-
label: a("signatureRequest.viaWhatsapp"),
|
|
110
|
-
icon: /* @__PURE__ */ e(re, { className: "ds:size-4", "aria-hidden": !0 })
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: "on-device",
|
|
114
|
-
label: a("signatureRequest.onThisDevice"),
|
|
115
|
-
icon: /* @__PURE__ */ e(he, { className: "ds:size-4", "aria-hidden": !0 })
|
|
116
|
-
}
|
|
117
|
-
], O = u.map((s) => s.signerId), I = o.find(
|
|
118
|
-
(s) => !O.includes(s.value)
|
|
119
|
-
), X = !i && u.length < L && I !== void 0, N = (s, r) => {
|
|
120
|
-
v(
|
|
121
|
-
(m) => m.map(
|
|
122
|
-
(t) => t.rowId === s ? { ...t, ...r } : t
|
|
123
|
-
)
|
|
124
|
-
);
|
|
125
|
-
}, J = () => {
|
|
126
|
-
I && v((s) => [
|
|
127
|
-
...s,
|
|
128
|
-
{
|
|
129
|
-
signerId: I.value,
|
|
130
|
-
channel: "sms",
|
|
131
|
-
rowId: _.current++
|
|
132
|
-
}
|
|
133
|
-
]);
|
|
134
|
-
}, K = (s) => {
|
|
135
|
-
var r;
|
|
136
|
-
(r = M.current) == null || r.focus(), v(
|
|
137
|
-
(m) => m.filter((t) => t.rowId !== s)
|
|
138
|
-
);
|
|
139
|
-
}, Q = () => {
|
|
140
|
-
F({
|
|
141
|
-
operatorId: y ? null : g,
|
|
142
|
-
signers: u.map(({ rowId: s, ...r }) => r)
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
return /* @__PURE__ */ e("div", { ref: G, className: "ds:contents", "data-component": "signature-request", children: /* @__PURE__ */ e(d, { open: c, onOpenChange: x, children: /* @__PURE__ */ n(d.Content, { size: "lg", hideCloseButton: !0, ...W, children: [
|
|
146
|
-
/* @__PURE__ */ n(d.Header, { children: [
|
|
147
|
-
/* @__PURE__ */ e(d.Title, { children: V ?? a("signatureRequest.title") }),
|
|
148
|
-
/* @__PURE__ */ e(d.Description, { children: E ?? a("signatureRequest.noSignedVersions") })
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ n(d.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
151
|
-
/* @__PURE__ */ n("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
152
|
-
/* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
153
|
-
/* @__PURE__ */ e("p", { className: "type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]", children: a("signatureRequest.operatorSection") }),
|
|
154
|
-
k !== void 0 ? /* @__PURE__ */ e(
|
|
155
|
-
f,
|
|
156
|
-
{
|
|
157
|
-
intent: "primary",
|
|
158
|
-
size: "sm",
|
|
159
|
-
startIcon: /* @__PURE__ */ e(ve, {}),
|
|
160
|
-
disabled: i,
|
|
161
|
-
onClick: () => w(k),
|
|
162
|
-
children: a("signatureRequest.assignToMe")
|
|
163
|
-
}
|
|
164
|
-
) : null
|
|
165
|
-
] }),
|
|
166
|
-
/* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
167
|
-
/* @__PURE__ */ e(
|
|
168
|
-
j,
|
|
169
|
-
{
|
|
170
|
-
"aria-hidden": "true",
|
|
171
|
-
name: y ? void 0 : H(l, g),
|
|
172
|
-
size: "sm"
|
|
173
|
-
}
|
|
174
|
-
),
|
|
175
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1 ds:text-start", children: /* @__PURE__ */ e(
|
|
176
|
-
B,
|
|
177
|
-
{
|
|
178
|
-
options: U,
|
|
179
|
-
value: g,
|
|
180
|
-
onValueChange: (s) => s && w(s),
|
|
181
|
-
required: !0,
|
|
182
|
-
disabled: i,
|
|
183
|
-
placeholder: a("signatureRequest.operatorPlaceholder"),
|
|
184
|
-
"aria-label": a("signatureRequest.operatorSection")
|
|
185
|
-
}
|
|
186
|
-
) })
|
|
187
|
-
] }),
|
|
188
|
-
y ? null : /* @__PURE__ */ e(p, { variant: "info", children: /* @__PURE__ */ e(p.Description, { children: a("signatureRequest.operatorHint") }) })
|
|
189
|
-
] }),
|
|
190
|
-
/* @__PURE__ */ e(ie, { decorative: !0 }),
|
|
191
|
-
/* @__PURE__ */ n("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start", children: [
|
|
192
|
-
/* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
193
|
-
/* @__PURE__ */ e("p", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: a("signatureRequest.signersSection") }),
|
|
194
|
-
/* @__PURE__ */ e(
|
|
195
|
-
f,
|
|
196
|
-
{
|
|
197
|
-
ref: M,
|
|
198
|
-
intent: "primary",
|
|
199
|
-
size: "sm",
|
|
200
|
-
startIcon: /* @__PURE__ */ e(de, {}),
|
|
201
|
-
disabled: !X,
|
|
202
|
-
onClick: J,
|
|
203
|
-
children: a("signatureRequest.addSigner")
|
|
204
|
-
}
|
|
205
|
-
)
|
|
206
|
-
] }),
|
|
207
|
-
u.map((s) => {
|
|
208
|
-
const r = o.filter(
|
|
209
|
-
(t) => t.value === s.signerId || !O.includes(t.value)
|
|
210
|
-
), m = H(o, s.signerId);
|
|
211
|
-
return /* @__PURE__ */ n(
|
|
212
|
-
"div",
|
|
213
|
-
{
|
|
214
|
-
role: "group",
|
|
215
|
-
"aria-label": m,
|
|
216
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
217
|
-
children: [
|
|
218
|
-
/* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
219
|
-
/* @__PURE__ */ e(j, { "aria-hidden": "true", name: m, size: "sm" }),
|
|
220
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
|
|
221
|
-
B,
|
|
222
|
-
{
|
|
223
|
-
options: r,
|
|
224
|
-
value: s.signerId,
|
|
225
|
-
onValueChange: (t) => t && N(s.rowId, { signerId: t }),
|
|
226
|
-
required: !0,
|
|
227
|
-
disabled: i,
|
|
228
|
-
placeholder: a(
|
|
229
|
-
"signatureRequest.signerPlaceholder"
|
|
230
|
-
),
|
|
231
|
-
"aria-label": a("signatureRequest.signerPlaceholder")
|
|
232
|
-
}
|
|
233
|
-
) }),
|
|
234
|
-
u.length > 1 ? /* @__PURE__ */ e(
|
|
235
|
-
ae,
|
|
236
|
-
{
|
|
237
|
-
intent: "ghost",
|
|
238
|
-
size: "sm",
|
|
239
|
-
icon: /* @__PURE__ */ e(ce, {}),
|
|
240
|
-
disabled: i,
|
|
241
|
-
"aria-label": a("signatureRequest.removeSigner"),
|
|
242
|
-
onClick: () => K(s.rowId)
|
|
243
|
-
}
|
|
244
|
-
) : null
|
|
245
|
-
] }),
|
|
246
|
-
/* @__PURE__ */ e(
|
|
247
|
-
"div",
|
|
248
|
-
{
|
|
249
|
-
role: "group",
|
|
250
|
-
"aria-label": a("signatureRequest.channelLabel"),
|
|
251
|
-
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)]",
|
|
252
|
-
children: $.map((t) => /* @__PURE__ */ e(
|
|
253
|
-
te,
|
|
254
|
-
{
|
|
255
|
-
checked: s.channel === t.value,
|
|
256
|
-
disabled: i,
|
|
257
|
-
onCheckedChange: (Y) => Y === !0 && N(s.rowId, {
|
|
258
|
-
channel: t.value,
|
|
259
|
-
skipOtp: void 0
|
|
260
|
-
}),
|
|
261
|
-
label: /* @__PURE__ */ n("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
262
|
-
/* @__PURE__ */ e(
|
|
263
|
-
"span",
|
|
264
|
-
{
|
|
265
|
-
"aria-hidden": "true",
|
|
266
|
-
className: "ds:text-[var(--accent)]",
|
|
267
|
-
children: t.icon
|
|
268
|
-
}
|
|
269
|
-
),
|
|
270
|
-
t.label
|
|
271
|
-
] })
|
|
272
|
-
},
|
|
273
|
-
t.value
|
|
274
|
-
))
|
|
275
|
-
}
|
|
276
|
-
),
|
|
277
|
-
s.channel === "on-device" ? /* @__PURE__ */ e("div", { className: "ds:ps-[var(--spacing-xl)]", children: /* @__PURE__ */ e(
|
|
278
|
-
ne,
|
|
279
|
-
{
|
|
280
|
-
label: a("signatureRequest.noOtp"),
|
|
281
|
-
checked: s.skipOtp === !0,
|
|
282
|
-
disabled: i,
|
|
283
|
-
onCheckedChange: (t) => N(s.rowId, { skipOtp: t })
|
|
284
|
-
}
|
|
285
|
-
) }) : null
|
|
286
|
-
]
|
|
287
|
-
},
|
|
288
|
-
s.rowId
|
|
289
|
-
);
|
|
290
|
-
})
|
|
291
|
-
] }),
|
|
292
|
-
u.some(
|
|
293
|
-
(s) => s.channel === "on-device" && s.skipOtp === !0
|
|
294
|
-
) ? /* @__PURE__ */ e(p, { variant: "warning", children: /* @__PURE__ */ e(p.Description, { children: a("signatureRequest.noOtpWarning") }) }) : null,
|
|
295
|
-
z ? /* @__PURE__ */ e(p, { variant: "error", children: /* @__PURE__ */ e(p.Description, { children: z }) }) : null
|
|
296
|
-
] }),
|
|
297
|
-
/* @__PURE__ */ n(d.Footer, { children: [
|
|
298
|
-
/* @__PURE__ */ e(
|
|
299
|
-
f,
|
|
300
|
-
{
|
|
301
|
-
intent: "primary",
|
|
302
|
-
startIcon: /* @__PURE__ */ e(oe, {}),
|
|
303
|
-
onClick: Q,
|
|
304
|
-
disabled: i || u.length === 0,
|
|
305
|
-
loading: i,
|
|
306
|
-
children: a("signatureRequest.requestSignature")
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
/* @__PURE__ */ e(d.Close, { asChild: !0, children: /* @__PURE__ */ e(f, { intent: "outline", disabled: i, children: a("signatureRequest.close") }) })
|
|
310
|
-
] })
|
|
311
|
-
] }) }) });
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
fe.displayName = "SignatureRequestModal";
|
|
315
|
-
export {
|
|
316
|
-
fe as S
|
|
317
|
-
};
|
|
318
|
-
//# sourceMappingURL=signature-request-C-mskXwi.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** Reset the dedup set — intended for use between tests. */
|
|
2
|
-
export declare function resetContrastWarnings(): void;
|
|
3
|
-
/**
|
|
4
|
-
* DEV-only WCAG AA guardrail for caller-supplied hex pairs.
|
|
5
|
-
*
|
|
6
|
-
* - No-op when `import.meta.env.DEV` is false.
|
|
7
|
-
* - No-op when either half of the pair is missing (the "fg missing →
|
|
8
|
-
* inherits DS token" case is a docs concern; the DS token isn't a
|
|
9
|
-
* hex at runtime so we can't check it here).
|
|
10
|
-
* - No-op when either hex can't be parsed (silent — not the helper's
|
|
11
|
-
* concern to police malformed input).
|
|
12
|
-
* - Deduplicated by `(bgHex, fgHex, contextLabel)` tuple so moving a
|
|
13
|
-
* ratio-bad event around the calendar doesn't spam the console.
|
|
14
|
-
*
|
|
15
|
-
* @param bgHex - Caller-supplied background hex (e.g. `'#c2185b'`)
|
|
16
|
-
* @param fgHex - Caller-supplied foreground hex (e.g. `'#ffffff'`)
|
|
17
|
-
* @param contextLabel - Short description for the warning (e.g. `'event e1'`).
|
|
18
|
-
*/
|
|
19
|
-
export declare function warnLowContrast(bgHex: string | undefined, fgHex: string | undefined, contextLabel: string): void;
|
|
20
|
-
//# sourceMappingURL=contrast-warning.d.ts.map
|