@alfadocs/ui-kit 1.13.0 → 1.14.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/actions-cell-renderer-yy03OgRL.js +137 -0
- package/dist/_chunks/{balance-badge-cell--iQ_gtmi.js → balance-badge-cell-CgkxYO96.js} +7 -6
- package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
- package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
- package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
- package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
- package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
- package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
- package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
- package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
- package/dist/_chunks/{file-manager-UsD8e_AB.js → file-manager-DJMeB3V8.js} +138 -153
- package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
- package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
- package/dist/_chunks/{patient-details-BQaUzPqp.js → patient-details-BfzvFnxQ.js} +73 -92
- package/dist/_chunks/{patient-summary-card-CvDxhbBR.js → patient-summary-card-D5Vfa321.js} +2 -2
- package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
- package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
- package/dist/_chunks/signature-CpFNpsVK.js +21 -0
- package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
- package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
- package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
- package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
- package/dist/_chunks/{workflow-map-wcw3t6g4.js → workflow-map-dNzJjBWG.js} +103 -112
- package/dist/agent-catalog.json +867 -1
- package/dist/agent-i18n/en.json +27 -0
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/data-table/index.js +39 -38
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/toast/index.js +7 -6
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +680 -0
- package/dist/i18n/locales/ar.js +680 -0
- package/dist/i18n/locales/de.d.ts +680 -0
- package/dist/i18n/locales/de.js +680 -0
- package/dist/i18n/locales/el.d.ts +680 -0
- package/dist/i18n/locales/el.js +680 -0
- package/dist/i18n/locales/en.d.ts +680 -0
- package/dist/i18n/locales/en.js +680 -0
- package/dist/i18n/locales/es.d.ts +680 -0
- package/dist/i18n/locales/es.js +680 -0
- package/dist/i18n/locales/fr.d.ts +680 -0
- package/dist/i18n/locales/fr.js +680 -0
- package/dist/i18n/locales/hi.d.ts +680 -0
- package/dist/i18n/locales/hi.js +680 -0
- package/dist/i18n/locales/it.d.ts +680 -0
- package/dist/i18n/locales/it.js +680 -0
- package/dist/i18n/locales/ja.d.ts +680 -0
- package/dist/i18n/locales/ja.js +680 -0
- package/dist/i18n/locales/nl.d.ts +680 -0
- package/dist/i18n/locales/nl.js +680 -0
- package/dist/i18n/locales/pl.d.ts +680 -0
- package/dist/i18n/locales/pl.js +680 -0
- package/dist/i18n/locales/pt.d.ts +680 -0
- package/dist/i18n/locales/pt.js +680 -0
- package/dist/i18n/locales/ro.d.ts +680 -0
- package/dist/i18n/locales/ro.js +680 -0
- package/dist/i18n/locales/ru.d.ts +680 -0
- package/dist/i18n/locales/ru.js +680 -0
- package/dist/i18n/locales/sq.d.ts +680 -0
- package/dist/i18n/locales/sq.js +680 -0
- package/dist/i18n/locales/sv.d.ts +680 -0
- package/dist/i18n/locales/sv.js +680 -0
- package/dist/i18n/locales/tr.d.ts +680 -0
- package/dist/i18n/locales/tr.js +680 -0
- package/dist/i18n/locales/zh.d.ts +680 -0
- package/dist/i18n/locales/zh.js +680 -0
- package/dist/index.js +821 -803
- package/dist/locales/ar.json +680 -0
- package/dist/locales/de.json +680 -0
- package/dist/locales/el.json +680 -0
- package/dist/locales/en.json +680 -0
- package/dist/locales/es.json +680 -0
- package/dist/locales/fr.json +680 -0
- package/dist/locales/hi.json +680 -0
- package/dist/locales/it.json +680 -0
- package/dist/locales/ja.json +680 -0
- package/dist/locales/nl.json +680 -0
- package/dist/locales/pl.json +680 -0
- package/dist/locales/pt.json +680 -0
- package/dist/locales/ro.json +680 -0
- package/dist/locales/ru.json +680 -0
- package/dist/locales/sq.json +680 -0
- package/dist/locales/sv.json +680 -0
- package/dist/locales/tr.json +680 -0
- package/dist/locales/zh.json +680 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts +62 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +358 -0
- package/dist/patterns/calendar/calendar.data.d.ts +122 -0
- package/dist/patterns/calendar/calendar.host.d.ts +10 -0
- package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
- package/dist/patterns/calendar/calendar.model.d.ts +684 -0
- package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
- package/dist/patterns/calendar/calendar.types.d.ts +413 -0
- package/dist/patterns/calendar/index.d.ts +13 -0
- package/dist/patterns/calendar/index.js +19 -0
- package/package.json +5 -1
- package/dist/_chunks/actions-cell-renderer-ReurEy5i.js +0 -1945
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
id: "toast",
|
|
3
|
+
capabilities: ["dismiss"],
|
|
4
|
+
state: {
|
|
5
|
+
visibleToasts: {
|
|
6
|
+
type: "Array<{ id: string }>",
|
|
7
|
+
descriptionKey: "ui.agent.toast.state.visibleToasts",
|
|
8
|
+
description: "Snapshot of currently-visible toasts by opaque id. Never carries the toast body text.",
|
|
9
|
+
read: (t) => t.getVisibleToasts()
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
actions: {
|
|
13
|
+
dismiss: {
|
|
14
|
+
safety: "destructive",
|
|
15
|
+
argsType: "{ id: string }",
|
|
16
|
+
argsSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: { id: { type: "string" } },
|
|
19
|
+
required: ["id"]
|
|
20
|
+
},
|
|
21
|
+
idempotent: !0,
|
|
22
|
+
descriptionKey: "ui.agent.toast.actions.dismiss",
|
|
23
|
+
description: "Dismiss the toast with the given id. Irreversible from the same UI.",
|
|
24
|
+
invoke: (t, s) => {
|
|
25
|
+
t.dismiss(s.id);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
dismiss_all: {
|
|
29
|
+
safety: "destructive",
|
|
30
|
+
idempotent: !0,
|
|
31
|
+
descriptionKey: "ui.agent.toast.actions.dismissAll",
|
|
32
|
+
description: "Dismiss every visible toast.",
|
|
33
|
+
invoke: (t) => {
|
|
34
|
+
t.dismissAll();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
domHooks: {
|
|
39
|
+
root: {
|
|
40
|
+
attr: "data-component",
|
|
41
|
+
// The sonner <ol> region wrapper emits `data-component="toast-region"`
|
|
42
|
+
// (not the bare adapter id) — toasts are imperatively created and
|
|
43
|
+
// addressed individually by id, not by a per-instance component root.
|
|
44
|
+
value: "toast-region",
|
|
45
|
+
description: 'Marks the Toaster region wrapper (data-component="toast-region"). Toast is imperatively created; the registry addresses individual toasts by id, not by per-instance root.'
|
|
46
|
+
},
|
|
47
|
+
item: {
|
|
48
|
+
attr: "data-toast-id",
|
|
49
|
+
description: "Stable opaque toast id assigned at creation. Used by `dismiss({id})`."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
i as t
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=toast.agent-DNQ0JYGv.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as u, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as H, useMemo as
|
|
2
|
+
import { forwardRef as H, useMemo as W, useRef as z, useCallback as F, useState as ge, useImperativeHandle as be, useEffect as ke } from "react";
|
|
3
3
|
import { c as j } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as M } from "react-i18next";
|
|
5
5
|
import { C } from "./card-DPmk26CL.js";
|
|
@@ -8,11 +8,11 @@ import { a as Z } from "./key-value-pair-BIBdZBLg.js";
|
|
|
8
8
|
import { T as xe } from "./timestamp-BV2lC-wV.js";
|
|
9
9
|
import { I as S } from "./icon-button-DA2CAGHZ.js";
|
|
10
10
|
import { P as U } from "./pencil-B1sKKyuT.js";
|
|
11
|
-
import { c as
|
|
11
|
+
import { c as q } from "./createLucideIcon-DhHxpK9K.js";
|
|
12
12
|
import { T as ae } from "./trash-2-uumy3fy1.js";
|
|
13
13
|
import { C as Ne } from "./circle-j7oZoouK.js";
|
|
14
14
|
import { u as Ce } from "./registry-DvAUVLHh.js";
|
|
15
|
-
import { A as
|
|
15
|
+
import { A as V } from "./alert-CiJT540z.js";
|
|
16
16
|
import { B as _e } from "./button-nJaPh_HC.js";
|
|
17
17
|
import { D as N } from "./dropdown-menu-DU-Hrf33.js";
|
|
18
18
|
import { E } from "./empty-state-X0sVPfVo.js";
|
|
@@ -21,8 +21,9 @@ import { G as ie } from "./globe-sHBW1JN5.js";
|
|
|
21
21
|
import { U as de } from "./user-cog-BTn98Arm.js";
|
|
22
22
|
import { M as le } from "./message-circle-Bepl9JT5.js";
|
|
23
23
|
import { S as ce } from "./square-check-big-dj0o8yA3.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { S as ue } from "./smartphone-C0rFF2if.js";
|
|
25
|
+
import { M as fe } from "./mail-BqXVF2zH.js";
|
|
26
|
+
import { C as me } from "./clock-Drd4Wtis.js";
|
|
26
27
|
import { C as Se } from "./chevron-up-umRGgtJA.js";
|
|
27
28
|
import { C as Me } from "./chevron-down-DWE7GSq9.js";
|
|
28
29
|
import { C as ze } from "./clipboard-check-BeAGxDVT.js";
|
|
@@ -42,7 +43,7 @@ const Ie = [
|
|
|
42
43
|
["path", { d: "M21.818 10.1a10 10 0 0 1 0 3.8", key: "qkgqxc" }],
|
|
43
44
|
["path", { d: "M3.721 6.391a10 10 0 0 1 2.7-2.69", key: "1mcia2" }],
|
|
44
45
|
["path", { d: "M6.391 20.279a10 10 0 0 1-2.69-2.7", key: "1fvljs" }]
|
|
45
|
-
], Te =
|
|
46
|
+
], Te = q("circle-dashed", Ie);
|
|
46
47
|
/**
|
|
47
48
|
* @license lucide-react v1.22.0 - ISC
|
|
48
49
|
*
|
|
@@ -53,7 +54,7 @@ const Ee = [
|
|
|
53
54
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
54
55
|
["line", { x1: "10", x2: "10", y1: "15", y2: "9", key: "c1nkhi" }],
|
|
55
56
|
["line", { x1: "14", x2: "14", y1: "15", y2: "9", key: "h65svq" }]
|
|
56
|
-
], je =
|
|
57
|
+
], je = q("circle-pause", Ee);
|
|
57
58
|
/**
|
|
58
59
|
* @license lucide-react v1.22.0 - ISC
|
|
59
60
|
*
|
|
@@ -65,7 +66,7 @@ const De = [
|
|
|
65
66
|
["path", { d: "M6.16 6.16a9 9 0 1 0 12.68 12.68", key: "1x7qb5" }],
|
|
66
67
|
["path", { d: "M12 2v4", key: "3427ic" }],
|
|
67
68
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
68
|
-
], Le =
|
|
69
|
+
], Le = q("power-off", De);
|
|
69
70
|
/**
|
|
70
71
|
* @license lucide-react v1.22.0 - ISC
|
|
71
72
|
*
|
|
@@ -75,17 +76,7 @@ const De = [
|
|
|
75
76
|
const Ke = [
|
|
76
77
|
["path", { d: "M12 2v10", key: "mnfbl" }],
|
|
77
78
|
["path", { d: "M18.4 6.6a9 9 0 1 1-12.77.04", key: "obofu9" }]
|
|
78
|
-
], Be =
|
|
79
|
-
/**
|
|
80
|
-
* @license lucide-react v1.22.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/
|
|
85
|
-
const Pe = [
|
|
86
|
-
["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
|
|
87
|
-
["path", { d: "M12 18h.01", key: "mhygvu" }]
|
|
88
|
-
], me = D("smartphone", Pe), Re = j("ds:relative ds:w-full", {
|
|
79
|
+
], Be = q("power", Ke), Pe = j("ds:relative ds:w-full", {
|
|
89
80
|
variants: {
|
|
90
81
|
density: {
|
|
91
82
|
comfortable: "",
|
|
@@ -96,7 +87,7 @@ const Pe = [
|
|
|
96
87
|
density: "comfortable"
|
|
97
88
|
}
|
|
98
89
|
});
|
|
99
|
-
function
|
|
90
|
+
function Re(e) {
|
|
100
91
|
switch (e) {
|
|
101
92
|
case "active":
|
|
102
93
|
return {
|
|
@@ -116,7 +107,7 @@ function We(e) {
|
|
|
116
107
|
};
|
|
117
108
|
}
|
|
118
109
|
}
|
|
119
|
-
const
|
|
110
|
+
const We = H(
|
|
120
111
|
function({
|
|
121
112
|
workflow: r,
|
|
122
113
|
density: s = "comfortable",
|
|
@@ -126,7 +117,7 @@ const Fe = H(
|
|
|
126
117
|
onToggleActive: a,
|
|
127
118
|
className: p
|
|
128
119
|
}, m) {
|
|
129
|
-
const { t: c } = M(), i =
|
|
120
|
+
const { t: c } = M(), i = Re(r.status), l = r.status === "active", v = s === "compact", h = (w) => (k) => {
|
|
130
121
|
k.stopPropagation(), w == null || w();
|
|
131
122
|
}, y = /* @__PURE__ */ t(
|
|
132
123
|
ye,
|
|
@@ -142,7 +133,7 @@ const Fe = H(
|
|
|
142
133
|
{
|
|
143
134
|
ref: m,
|
|
144
135
|
variant: "default",
|
|
145
|
-
className:
|
|
136
|
+
className: Pe({ density: s, className: p }),
|
|
146
137
|
"data-component": "workflow-card",
|
|
147
138
|
"data-component-id": r.id,
|
|
148
139
|
children: [
|
|
@@ -247,7 +238,7 @@ const Fe = H(
|
|
|
247
238
|
);
|
|
248
239
|
}
|
|
249
240
|
);
|
|
250
|
-
|
|
241
|
+
We.displayName = "WorkflowCard";
|
|
251
242
|
const Ft = {
|
|
252
243
|
id: "workflow-card",
|
|
253
244
|
// Presentational summary card — no agent-facing action or state. Navigation
|
|
@@ -289,7 +280,7 @@ const Ft = {
|
|
|
289
280
|
description: "Stable opaque workflow node id emitted on each step."
|
|
290
281
|
}
|
|
291
282
|
}
|
|
292
|
-
},
|
|
283
|
+
}, Fe = {
|
|
293
284
|
id: "workflow-editor",
|
|
294
285
|
// `goto_step` focuses a node (navigation). No `expand` capability: the
|
|
295
286
|
// WorkflowEditorHandle exposes no expand/collapse method to back it.
|
|
@@ -362,7 +353,7 @@ function G(e) {
|
|
|
362
353
|
p.has(i.id) || m.push(i);
|
|
363
354
|
return m;
|
|
364
355
|
}
|
|
365
|
-
function
|
|
356
|
+
function $(e, r, s) {
|
|
366
357
|
const o = [...e.nodes, s];
|
|
367
358
|
if (r === null) {
|
|
368
359
|
const a = e.nodes[0];
|
|
@@ -406,7 +397,7 @@ function ee(e, r) {
|
|
|
406
397
|
edges: n
|
|
407
398
|
};
|
|
408
399
|
}
|
|
409
|
-
function
|
|
400
|
+
function qe(e, r, s) {
|
|
410
401
|
var h;
|
|
411
402
|
const o = G(e), d = o.findIndex((y) => y.id === r);
|
|
412
403
|
if (d === -1) return e;
|
|
@@ -414,10 +405,10 @@ function Oe(e, r, s) {
|
|
|
414
405
|
if (n < 0 || n >= o.length) return e;
|
|
415
406
|
const a = o[d], p = o[n];
|
|
416
407
|
if (!a || !p) return e;
|
|
417
|
-
const m = ee(ee(e, a.id), p.id), c = s === "up" ? a : p, i = s === "up" ? p : a, l = ((h = o[Math.min(d, n) - 1]) == null ? void 0 : h.id) ?? null, v =
|
|
418
|
-
return
|
|
408
|
+
const m = ee(ee(e, a.id), p.id), c = s === "up" ? a : p, i = s === "up" ? p : a, l = ((h = o[Math.min(d, n) - 1]) == null ? void 0 : h.id) ?? null, v = $(m, l, c);
|
|
409
|
+
return $(v, c.id, i);
|
|
419
410
|
}
|
|
420
|
-
const
|
|
411
|
+
const Oe = /* @__PURE__ */ new Set([
|
|
421
412
|
"dateOfBirth",
|
|
422
413
|
"date_of_birth",
|
|
423
414
|
"firstName",
|
|
@@ -438,9 +429,9 @@ const $e = /* @__PURE__ */ new Set([
|
|
|
438
429
|
"id"
|
|
439
430
|
]);
|
|
440
431
|
function Ve(e) {
|
|
441
|
-
return
|
|
432
|
+
return Oe.has(e);
|
|
442
433
|
}
|
|
443
|
-
const
|
|
434
|
+
const D = {
|
|
444
435
|
add_delay: {
|
|
445
436
|
labelKey: "workflow.action.addDelay",
|
|
446
437
|
iconName: "Clock"
|
|
@@ -469,10 +460,10 @@ const L = {
|
|
|
469
460
|
labelKey: "workflow.action.webhook",
|
|
470
461
|
iconName: "Globe"
|
|
471
462
|
}
|
|
472
|
-
},
|
|
473
|
-
Clock:
|
|
474
|
-
Mail:
|
|
475
|
-
Smartphone:
|
|
463
|
+
}, $e = {
|
|
464
|
+
Clock: me,
|
|
465
|
+
Mail: fe,
|
|
466
|
+
Smartphone: ue,
|
|
476
467
|
CheckSquare: ce,
|
|
477
468
|
MessageCircle: le,
|
|
478
469
|
UserCog: de,
|
|
@@ -482,14 +473,14 @@ function Y({
|
|
|
482
473
|
iconName: e,
|
|
483
474
|
className: r
|
|
484
475
|
}) {
|
|
485
|
-
const s =
|
|
476
|
+
const s = $e[e];
|
|
486
477
|
return /* @__PURE__ */ t(s, { "aria-hidden": "true", className: r ?? "ds:size-4" });
|
|
487
478
|
}
|
|
488
|
-
const
|
|
479
|
+
const He = 40, Ue = 60;
|
|
489
480
|
function te(e, r) {
|
|
490
481
|
return e.length <= r ? e : `${e.slice(0, r - 1)}…`;
|
|
491
482
|
}
|
|
492
|
-
function
|
|
483
|
+
function Ge(e, r) {
|
|
493
484
|
switch (e.kind) {
|
|
494
485
|
case "add_delay": {
|
|
495
486
|
const s = e.days ?? 0, o = r("workflow.delay.summary", { count: s });
|
|
@@ -497,11 +488,11 @@ function Ye(e, r) {
|
|
|
497
488
|
}
|
|
498
489
|
case "send_email": {
|
|
499
490
|
const s = e.subject ?? "", d = `${r("workflow.action.sendEmail")}: ${s}`;
|
|
500
|
-
return { text: te(d,
|
|
491
|
+
return { text: te(d, He), full: d };
|
|
501
492
|
}
|
|
502
493
|
case "send_sms": {
|
|
503
494
|
const s = e.body ?? "";
|
|
504
|
-
return { text: te(s,
|
|
495
|
+
return { text: te(s, Ue), full: s };
|
|
505
496
|
}
|
|
506
497
|
case "create_task": {
|
|
507
498
|
const s = e.title ?? "";
|
|
@@ -528,7 +519,7 @@ const re = [
|
|
|
528
519
|
"ds:border-inline-start-[var(--border-width-hairline)]",
|
|
529
520
|
"ds:border-solid",
|
|
530
521
|
"ds:border-[color:var(--border)]"
|
|
531
|
-
].join(" "),
|
|
522
|
+
].join(" "), Ye = [
|
|
532
523
|
"ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
|
|
533
524
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
534
525
|
"ds:rounded-[var(--radius-full)]",
|
|
@@ -543,21 +534,21 @@ const re = [
|
|
|
543
534
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
544
535
|
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
545
536
|
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed"
|
|
546
|
-
].join(" "),
|
|
537
|
+
].join(" "), Je = [
|
|
547
538
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
548
539
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
549
540
|
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
550
541
|
"ds:rounded-[var(--radius-lg)]"
|
|
551
|
-
].join(" "),
|
|
552
|
-
|
|
542
|
+
].join(" "), Qe = Object.keys(
|
|
543
|
+
D
|
|
553
544
|
);
|
|
554
545
|
let se = 0;
|
|
555
|
-
function
|
|
546
|
+
function Xe() {
|
|
556
547
|
se += 1;
|
|
557
548
|
const e = Math.random().toString(36).slice(2, 8);
|
|
558
549
|
return `wf-node-${Date.now()}-${se}-${e}`;
|
|
559
550
|
}
|
|
560
|
-
function
|
|
551
|
+
function Ze(e) {
|
|
561
552
|
switch (e) {
|
|
562
553
|
case "add_delay":
|
|
563
554
|
return { kind: "add_delay", days: 1 };
|
|
@@ -580,13 +571,13 @@ function et(e) {
|
|
|
580
571
|
return { kind: "webhook", url: "", method: "POST" };
|
|
581
572
|
}
|
|
582
573
|
}
|
|
583
|
-
function
|
|
584
|
-
const r = z(e), s =
|
|
574
|
+
function et(e = 0) {
|
|
575
|
+
const r = z(e), s = F((o) => {
|
|
585
576
|
r.current = o;
|
|
586
577
|
}, []);
|
|
587
578
|
return [r, s];
|
|
588
579
|
}
|
|
589
|
-
function
|
|
580
|
+
function tt({
|
|
590
581
|
node: e,
|
|
591
582
|
position: r,
|
|
592
583
|
total: s,
|
|
@@ -596,22 +587,22 @@ function rt({
|
|
|
596
587
|
onMove: a,
|
|
597
588
|
registerRef: p
|
|
598
589
|
}) {
|
|
599
|
-
const { t: m } = M(), c =
|
|
590
|
+
const { t: m } = M(), c = D[e.type], i = z(null), [l, v] = et(0), h = F(
|
|
600
591
|
(g) => {
|
|
601
|
-
var
|
|
602
|
-
const _ = (
|
|
592
|
+
var B, P;
|
|
593
|
+
const _ = (B = i.current) == null ? void 0 : B.querySelectorAll(
|
|
603
594
|
"button[data-wf-control]:not([disabled])"
|
|
604
595
|
);
|
|
605
596
|
if (!_ || _.length === 0) return;
|
|
606
|
-
const
|
|
607
|
-
(
|
|
597
|
+
const K = Math.max(0, Math.min(g, _.length - 1));
|
|
598
|
+
(P = _[K]) == null || P.focus(), v(K);
|
|
608
599
|
},
|
|
609
600
|
[v]
|
|
610
601
|
), y = (g) => {
|
|
611
602
|
g.target === g.currentTarget && (g.key === "ArrowRight" || g.key === "ArrowDown") && (g.preventDefault(), h(0));
|
|
612
603
|
}, x = (g) => {
|
|
613
604
|
g.key === "ArrowRight" ? (g.preventDefault(), h(l.current + 1)) : g.key === "ArrowLeft" ? (g.preventDefault(), h(l.current - 1)) : g.key === "Home" ? (g.preventDefault(), h(0)) : g.key === "End" && (g.preventDefault(), h(Number.POSITIVE_INFINITY));
|
|
614
|
-
}, w =
|
|
605
|
+
}, w = Ge(e.settings, m), k = m(c.labelKey), A = r > 0, I = r < s - 1, L = m("workflow.editor.position", {
|
|
615
606
|
current: r + 1,
|
|
616
607
|
total: s
|
|
617
608
|
}), T = m("workflow.editor.nodeAriaLabel", {
|
|
@@ -629,7 +620,7 @@ function rt({
|
|
|
629
620
|
onKeyDown: y,
|
|
630
621
|
"aria-label": T,
|
|
631
622
|
"data-node-id": e.id,
|
|
632
|
-
className:
|
|
623
|
+
className: Je,
|
|
633
624
|
children: /* @__PURE__ */ u(C, { variant: "outlined", children: [
|
|
634
625
|
/* @__PURE__ */ t(C.Header, { className: "ds:pb-[var(--spacing-sm)]", children: /* @__PURE__ */ u("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
635
626
|
/* @__PURE__ */ t(
|
|
@@ -642,7 +633,7 @@ function rt({
|
|
|
642
633
|
),
|
|
643
634
|
/* @__PURE__ */ u("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col", children: [
|
|
644
635
|
/* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-semibold)] ds:text-[color:var(--foreground)] ds:[overflow-wrap:anywhere] ds:break-words", children: k }),
|
|
645
|
-
/* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]", children:
|
|
636
|
+
/* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]", children: L })
|
|
646
637
|
] }),
|
|
647
638
|
/* @__PURE__ */ u(
|
|
648
639
|
"div",
|
|
@@ -715,7 +706,7 @@ function rt({
|
|
|
715
706
|
children: w.text
|
|
716
707
|
}
|
|
717
708
|
) }) : null,
|
|
718
|
-
e.settings.kind === "update_patient_field" && Ve(e.settings.fieldId) ? /* @__PURE__ */ t(C.Body, { className: "ds:pt-0", children: /* @__PURE__ */ t(
|
|
709
|
+
e.settings.kind === "update_patient_field" && Ve(e.settings.fieldId) ? /* @__PURE__ */ t(C.Body, { className: "ds:pt-0", children: /* @__PURE__ */ t(V, { variant: "error", "data-testid": "workflow-editor-invalid-field", children: m("workflow.editor.invalidField") }) }) : null
|
|
719
710
|
] })
|
|
720
711
|
}
|
|
721
712
|
)
|
|
@@ -736,7 +727,7 @@ function oe({
|
|
|
736
727
|
type: "button",
|
|
737
728
|
disabled: s,
|
|
738
729
|
"aria-label": o,
|
|
739
|
-
className:
|
|
730
|
+
className: Ye,
|
|
740
731
|
children: [
|
|
741
732
|
/* @__PURE__ */ t(ne, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
742
733
|
d ? null : /* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)]", children: o })
|
|
@@ -746,7 +737,7 @@ function oe({
|
|
|
746
737
|
/* @__PURE__ */ u(N.Content, { align: "start", sideOffset: 6, children: [
|
|
747
738
|
/* @__PURE__ */ t(N.Label, { children: n("workflow.editor.addAction") }),
|
|
748
739
|
e.map((a) => {
|
|
749
|
-
const p =
|
|
740
|
+
const p = D[a];
|
|
750
741
|
return /* @__PURE__ */ t(
|
|
751
742
|
N.Item,
|
|
752
743
|
{
|
|
@@ -760,7 +751,7 @@ function oe({
|
|
|
760
751
|
] })
|
|
761
752
|
] });
|
|
762
753
|
}
|
|
763
|
-
function
|
|
754
|
+
function rt({ criteria: e, onEdit: r, disabled: s }) {
|
|
764
755
|
const { t: o } = M(), d = (e == null ? void 0 : e.ruleCount) ?? 0, n = d > 0 ? o("workflow.editor.criteriaCount", { count: d }) : o("workflow.editor.noCriteria");
|
|
765
756
|
return /* @__PURE__ */ t(C, { variant: "outlined", children: /* @__PURE__ */ t(C.Header, { className: "ds:pb-[var(--spacing-sm)]", children: /* @__PURE__ */ u("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
766
757
|
/* @__PURE__ */ u("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col", children: [
|
|
@@ -780,7 +771,7 @@ function st({ criteria: e, onEdit: r, disabled: s }) {
|
|
|
780
771
|
) : null
|
|
781
772
|
] }) }) });
|
|
782
773
|
}
|
|
783
|
-
const
|
|
774
|
+
const st = H(
|
|
784
775
|
function({
|
|
785
776
|
graph: r,
|
|
786
777
|
onChange: s,
|
|
@@ -792,21 +783,21 @@ const ot = H(
|
|
|
792
783
|
onDeleteNode: m,
|
|
793
784
|
className: c
|
|
794
785
|
}, i) {
|
|
795
|
-
const { t: l } = M(), v = a ??
|
|
786
|
+
const { t: l } = M(), v = a ?? Qe, h = W(() => G(r), [r]), y = z(/* @__PURE__ */ new Map()), x = z(null), w = F(
|
|
796
787
|
(f) => {
|
|
797
788
|
n || s(f);
|
|
798
789
|
},
|
|
799
790
|
[n, s]
|
|
800
|
-
), k =
|
|
791
|
+
), k = F((f, b) => {
|
|
801
792
|
b ? y.current.set(f, b) : y.current.delete(f);
|
|
802
|
-
}, []), [A, I] = ge(null),
|
|
803
|
-
|
|
793
|
+
}, []), [A, I] = ge(null), L = z(null);
|
|
794
|
+
L.current = A;
|
|
804
795
|
const T = z(null);
|
|
805
796
|
be(i, () => T.current, []);
|
|
806
|
-
const g =
|
|
797
|
+
const g = W(
|
|
807
798
|
() => ({
|
|
808
799
|
getTotalSteps: () => h.length,
|
|
809
|
-
getCurrentStep: () =>
|
|
800
|
+
getCurrentStep: () => L.current,
|
|
810
801
|
gotoStep: (f) => {
|
|
811
802
|
const b = y.current.get(f);
|
|
812
803
|
b && (b.focus(), I(f));
|
|
@@ -814,7 +805,7 @@ const ot = H(
|
|
|
814
805
|
}),
|
|
815
806
|
[h.length]
|
|
816
807
|
);
|
|
817
|
-
Ce(
|
|
808
|
+
Ce(Fe, g, void 0), ke(() => {
|
|
818
809
|
const f = x.current;
|
|
819
810
|
if (!f) return;
|
|
820
811
|
const b = y.current.get(f);
|
|
@@ -822,21 +813,21 @@ const ot = H(
|
|
|
822
813
|
});
|
|
823
814
|
const _ = (f, b) => {
|
|
824
815
|
if (n) return;
|
|
825
|
-
const
|
|
826
|
-
id:
|
|
816
|
+
const R = {
|
|
817
|
+
id: Xe(),
|
|
827
818
|
type: b,
|
|
828
|
-
settings:
|
|
819
|
+
settings: Ze(b)
|
|
829
820
|
};
|
|
830
|
-
x.current =
|
|
831
|
-
},
|
|
832
|
-
n || (x.current = f, w(
|
|
833
|
-
},
|
|
821
|
+
x.current = R.id, w($(r, f, R));
|
|
822
|
+
}, K = (f, b) => {
|
|
823
|
+
n || (x.current = f, w(qe(r, f, b)));
|
|
824
|
+
}, B = (f) => {
|
|
834
825
|
n || !p || p(f);
|
|
835
|
-
},
|
|
826
|
+
}, P = (f) => {
|
|
836
827
|
n || !m || m(f);
|
|
837
|
-
}, J = () => n ? /* @__PURE__ */ t(
|
|
828
|
+
}, J = () => n ? /* @__PURE__ */ t(V, { variant: "warning", children: /* @__PURE__ */ t(V.Title, { as: "p", children: l("workflow.editor.activeLock") }) }) : null, Q = () => o || d ? /* @__PURE__ */ u(ve, { children: [
|
|
838
829
|
/* @__PURE__ */ t(
|
|
839
|
-
|
|
830
|
+
rt,
|
|
840
831
|
{
|
|
841
832
|
criteria: o,
|
|
842
833
|
onEdit: d,
|
|
@@ -914,7 +905,7 @@ const ot = H(
|
|
|
914
905
|
/* @__PURE__ */ u(N.Content, { align: "center", sideOffset: 6, children: [
|
|
915
906
|
/* @__PURE__ */ t(N.Label, { children: l("workflow.editor.addAction") }),
|
|
916
907
|
v.map((f) => {
|
|
917
|
-
const b =
|
|
908
|
+
const b = D[f];
|
|
918
909
|
return /* @__PURE__ */ t(
|
|
919
910
|
N.Item,
|
|
920
911
|
{
|
|
@@ -959,15 +950,15 @@ const ot = H(
|
|
|
959
950
|
children: h.map((f, b) => /* @__PURE__ */ u("li", { className: "ds:list-none ds:flex ds:flex-col", children: [
|
|
960
951
|
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: O }),
|
|
961
952
|
/* @__PURE__ */ t(
|
|
962
|
-
|
|
953
|
+
tt,
|
|
963
954
|
{
|
|
964
955
|
node: f,
|
|
965
956
|
position: b,
|
|
966
957
|
total: X,
|
|
967
958
|
disabled: n,
|
|
968
|
-
onEdit: p ?
|
|
969
|
-
onDelete: m ?
|
|
970
|
-
onMove:
|
|
959
|
+
onEdit: p ? B : void 0,
|
|
960
|
+
onDelete: m ? P : void 0,
|
|
961
|
+
onMove: K,
|
|
971
962
|
registerRef: k
|
|
972
963
|
}
|
|
973
964
|
),
|
|
@@ -978,7 +969,7 @@ const ot = H(
|
|
|
978
969
|
availableActions: v,
|
|
979
970
|
disabled: n,
|
|
980
971
|
label: l("workflow.editor.addActionAfter"),
|
|
981
|
-
onSelect: (
|
|
972
|
+
onSelect: (R) => _(f.id, R)
|
|
982
973
|
}
|
|
983
974
|
) })
|
|
984
975
|
] }, f.id))
|
|
@@ -989,16 +980,16 @@ const ot = H(
|
|
|
989
980
|
);
|
|
990
981
|
}
|
|
991
982
|
);
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
Clock:
|
|
995
|
-
Mail:
|
|
996
|
-
Smartphone:
|
|
983
|
+
st.displayName = "WorkflowEditor";
|
|
984
|
+
const ot = {
|
|
985
|
+
Clock: me,
|
|
986
|
+
Mail: fe,
|
|
987
|
+
Smartphone: ue,
|
|
997
988
|
CheckSquare: ce,
|
|
998
989
|
MessageCircle: le,
|
|
999
990
|
UserCog: de,
|
|
1000
991
|
Globe: ie
|
|
1001
|
-
},
|
|
992
|
+
}, at = j(
|
|
1002
993
|
// The map is a list of steps — never a list of meaningful controls.
|
|
1003
994
|
// Layout via logical properties only; connectors are sibling spacers
|
|
1004
995
|
// styled with border-inline-start / border-block-end (see node/spacer).
|
|
@@ -1121,7 +1112,7 @@ const at = {
|
|
|
1121
1112
|
]
|
|
1122
1113
|
}
|
|
1123
1114
|
);
|
|
1124
|
-
function
|
|
1115
|
+
function nt(e) {
|
|
1125
1116
|
switch (e.kind) {
|
|
1126
1117
|
case "add_delay":
|
|
1127
1118
|
return typeof e.days == "number" && e.days > 0 ? {
|
|
@@ -1150,11 +1141,11 @@ function it(e) {
|
|
|
1150
1141
|
return;
|
|
1151
1142
|
}
|
|
1152
1143
|
}
|
|
1153
|
-
function
|
|
1144
|
+
function it(e, r) {
|
|
1154
1145
|
if (e !== void 0)
|
|
1155
1146
|
return typeof e == "string" ? e : r(e.key, e.options);
|
|
1156
1147
|
}
|
|
1157
|
-
const
|
|
1148
|
+
const dt = H(
|
|
1158
1149
|
function({
|
|
1159
1150
|
graph: r,
|
|
1160
1151
|
activeNodeId: s,
|
|
@@ -1166,7 +1157,7 @@ const lt = H(
|
|
|
1166
1157
|
"aria-label": m,
|
|
1167
1158
|
...c
|
|
1168
1159
|
}, i) {
|
|
1169
|
-
const { t: l } = M(), v =
|
|
1160
|
+
const { t: l } = M(), v = W(() => G(r), [r]), h = W(
|
|
1170
1161
|
() => s ? v.findIndex((w) => w.id === s) : -1,
|
|
1171
1162
|
[v, s]
|
|
1172
1163
|
), y = m ?? l("workflow.map.label", { count: v.length }), x = (w) => h === -1 ? "neutral" : w === h ? "current" : w < h ? "completed" : "pending";
|
|
@@ -1180,11 +1171,11 @@ const lt = H(
|
|
|
1180
1171
|
"aria-label": y,
|
|
1181
1172
|
"data-component": "workflow-map",
|
|
1182
1173
|
"data-component-id": c.id,
|
|
1183
|
-
className:
|
|
1174
|
+
className: at({ orientation: n, compact: a, className: p }),
|
|
1184
1175
|
...c,
|
|
1185
1176
|
children: [
|
|
1186
1177
|
d ? /* @__PURE__ */ t(
|
|
1187
|
-
|
|
1178
|
+
ct,
|
|
1188
1179
|
{
|
|
1189
1180
|
orientation: n,
|
|
1190
1181
|
compact: a,
|
|
@@ -1194,7 +1185,7 @@ const lt = H(
|
|
|
1194
1185
|
v.map((w, k) => {
|
|
1195
1186
|
const A = x(k), I = k === v.length - 1;
|
|
1196
1187
|
return /* @__PURE__ */ t(
|
|
1197
|
-
|
|
1188
|
+
lt,
|
|
1198
1189
|
{
|
|
1199
1190
|
node: w,
|
|
1200
1191
|
state: A,
|
|
@@ -1212,8 +1203,8 @@ const lt = H(
|
|
|
1212
1203
|
);
|
|
1213
1204
|
}
|
|
1214
1205
|
);
|
|
1215
|
-
|
|
1216
|
-
function
|
|
1206
|
+
dt.displayName = "WorkflowMap";
|
|
1207
|
+
function lt({
|
|
1217
1208
|
node: e,
|
|
1218
1209
|
state: r,
|
|
1219
1210
|
orientation: s,
|
|
@@ -1221,7 +1212,7 @@ function ct({
|
|
|
1221
1212
|
isLast: d,
|
|
1222
1213
|
onNodeClick: n
|
|
1223
1214
|
}) {
|
|
1224
|
-
const { t: a } = M(), p =
|
|
1215
|
+
const { t: a } = M(), p = D[e.type], m = ot[p.iconName], c = a(p.labelKey), i = it(nt(e.settings), a), l = typeof n == "function", v = r === "current", h = r === "completed", y = (k) => {
|
|
1225
1216
|
l && (k.preventDefault(), n == null || n(e.id));
|
|
1226
1217
|
}, x = (k) => {
|
|
1227
1218
|
l && (k.key === "Enter" || k.key === " ") && (k.preventDefault(), n == null || n(e.id));
|
|
@@ -1294,7 +1285,7 @@ function ct({
|
|
|
1294
1285
|
] })
|
|
1295
1286
|
);
|
|
1296
1287
|
}
|
|
1297
|
-
function
|
|
1288
|
+
function ct({
|
|
1298
1289
|
orientation: e,
|
|
1299
1290
|
compact: r,
|
|
1300
1291
|
criteria: s
|
|
@@ -1339,18 +1330,18 @@ function ut({
|
|
|
1339
1330
|
] });
|
|
1340
1331
|
}
|
|
1341
1332
|
export {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1333
|
+
Oe as C,
|
|
1334
|
+
We as W,
|
|
1335
|
+
st as a,
|
|
1336
|
+
dt as b,
|
|
1337
|
+
$ as c,
|
|
1347
1338
|
Ft as d,
|
|
1348
|
-
|
|
1339
|
+
Fe as e,
|
|
1349
1340
|
qt as f,
|
|
1350
1341
|
Ve as i,
|
|
1351
1342
|
G as l,
|
|
1352
|
-
|
|
1343
|
+
qe as m,
|
|
1353
1344
|
ee as r,
|
|
1354
|
-
|
|
1345
|
+
D as w
|
|
1355
1346
|
};
|
|
1356
|
-
//# sourceMappingURL=workflow-map-
|
|
1347
|
+
//# sourceMappingURL=workflow-map-dNzJjBWG.js.map
|