@alfadocs/ui-kit 0.78.0 → 0.80.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.
Files changed (28) hide show
  1. package/dist/_chunks/{alia-sidebar-w6B0TEx7.js → alia-sidebar-DzNz1gDf.js} +2 -2
  2. package/dist/_chunks/calendar-4dXTvsCz.js +1136 -0
  3. package/dist/_chunks/calendar-event-card-C6qGtywL.js +257 -0
  4. package/dist/_chunks/{chat-input-BTCDqUDX.js → chat-input-QpHxBEnN.js} +32 -31
  5. package/dist/_chunks/{fiscal-code-input-DWA6C8x8.js → fiscal-code-input-QP9gkyDE.js} +2 -2
  6. package/dist/_chunks/{patient-details-zy76MRh7.js → patient-details-COvYWp2e.js} +2 -2
  7. package/dist/_chunks/signature-request-CEOrCDyk.js +341 -0
  8. package/dist/agent-catalog.json +1 -1
  9. package/dist/components/_shared/contrast-warning.d.ts +46 -0
  10. package/dist/components/calendar/calendar.d.ts +284 -7
  11. package/dist/components/calendar/index.d.ts +1 -1
  12. package/dist/components/calendar/index.js +1 -1
  13. package/dist/components/calendar-event-card/calendar-event-card.d.ts +103 -0
  14. package/dist/components/calendar-event-card/index.d.ts +3 -0
  15. package/dist/components/calendar-event-card/index.js +5 -0
  16. package/dist/components/chat-input/index.js +1 -1
  17. package/dist/components/fiscal-code-input/index.js +1 -1
  18. package/dist/components/index.d.ts +1 -0
  19. package/dist/components/patient-details/index.js +1 -1
  20. package/dist/index.js +252 -250
  21. package/dist/patterns/alia-assistant/index.js +1 -1
  22. package/dist/patterns/signature-request/index.js +1 -1
  23. package/dist/patterns/signature-request/signature-request.d.ts +7 -0
  24. package/dist/tokens.css +8 -5
  25. package/package.json +5 -1
  26. package/dist/_chunks/calendar-DeAlFPsF.js +0 -1050
  27. package/dist/_chunks/signature-request-C-mskXwi.js +0 -318
  28. package/dist/components/calendar/contrast-warning.d.ts +0 -20
@@ -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