@alfadocs/ui-kit 1.27.0 → 1.28.1
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/{calendar-workspace-Cs4hNB40.js → calendar-workspace-a84AHQwj.js} +2 -2
- package/dist/_chunks/{practice-results-DL_ExLYE.js → practice-results-CxIsU2YO.js} +136 -135
- package/dist/_chunks/signature-status-chip-T5fyS-k9.js +196 -0
- package/dist/agent-catalog.json +2 -2
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +9 -0
- package/dist/components/signature-status-chip/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/index.js +3 -3
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/signature-status-chip-BSatI_Qc.js +0 -179
package/package.json
CHANGED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as P } from "react";
|
|
3
|
-
import { useTranslation as M } from "react-i18next";
|
|
4
|
-
import { B as K } from "./badge-sTusUqZD.js";
|
|
5
|
-
import { T as Y } from "./tooltip-DvmfrNvB.js";
|
|
6
|
-
function E(e) {
|
|
7
|
-
if (!e || typeof e == "string") return [];
|
|
8
|
-
const i = e.signedBy;
|
|
9
|
-
return i ? Array.isArray(i) ? i : [i] : [];
|
|
10
|
-
}
|
|
11
|
-
function u(e, i) {
|
|
12
|
-
if (e === "notRequired") return "notRequired";
|
|
13
|
-
const r = E(i).filter((t) => t.standing);
|
|
14
|
-
return r.length === 0 ? e : r.every((t) => t.standing === "signed") ? "signed" : "pending";
|
|
15
|
-
}
|
|
16
|
-
function z(e, i, r = "notRequired", t) {
|
|
17
|
-
const o = [
|
|
18
|
-
u(e, t == null ? void 0 : t.operator),
|
|
19
|
-
u(i, t == null ? void 0 : t.patient),
|
|
20
|
-
u(r, t == null ? void 0 : t.secondary)
|
|
21
|
-
].filter((d) => d !== "notRequired");
|
|
22
|
-
if (o.length === 0) return "notRequired";
|
|
23
|
-
const c = o.filter((d) => d === "signed").length;
|
|
24
|
-
return c === 0 ? "unsigned" : c === o.length ? "signed" : "partial";
|
|
25
|
-
}
|
|
26
|
-
const H = {
|
|
27
|
-
// Traffic light: green when everyone required has signed, amber when at
|
|
28
|
-
// least one party is still missing, red when nobody has.
|
|
29
|
-
signed: "success",
|
|
30
|
-
partial: "warning",
|
|
31
|
-
unsigned: "error",
|
|
32
|
-
notRequired: "neutral"
|
|
33
|
-
}, J = {
|
|
34
|
-
operator: "Operator",
|
|
35
|
-
patient: "Patient",
|
|
36
|
-
secondary: "Second signee"
|
|
37
|
-
}, Q = {
|
|
38
|
-
signed: "signed",
|
|
39
|
-
pending: "pending"
|
|
40
|
-
}, W = {
|
|
41
|
-
operator: "signatureStatusChip.missingOperator",
|
|
42
|
-
patient: "signatureStatusChip.missingPatient",
|
|
43
|
-
secondary: "signatureStatusChip.missingSecondary"
|
|
44
|
-
}, X = {
|
|
45
|
-
operator: "Operator signature missing",
|
|
46
|
-
patient: "Patient signature missing",
|
|
47
|
-
secondary: "Second signee signature missing"
|
|
48
|
-
};
|
|
49
|
-
function S(e) {
|
|
50
|
-
return `${e}`;
|
|
51
|
-
}
|
|
52
|
-
function Z(e, i, r) {
|
|
53
|
-
const t = [];
|
|
54
|
-
return e !== "notRequired" && t.push({ role: "operator", standing: e }), i !== "notRequired" && t.push({ role: "patient", standing: i }), r !== "notRequired" && t.push({ role: "secondary", standing: r }), t;
|
|
55
|
-
}
|
|
56
|
-
const tt = P(
|
|
57
|
-
({
|
|
58
|
-
operator: e,
|
|
59
|
-
patient: i,
|
|
60
|
-
secondary: r = "notRequired",
|
|
61
|
-
names: t,
|
|
62
|
-
size: o = "md",
|
|
63
|
-
detail: c = !1,
|
|
64
|
-
tooltip: d = !1,
|
|
65
|
-
id: w,
|
|
66
|
-
className: V,
|
|
67
|
-
"aria-label": _,
|
|
68
|
-
title: m,
|
|
69
|
-
...U
|
|
70
|
-
}, x) => {
|
|
71
|
-
const { t: n } = M(), y = z(e, i, r, t), N = Z(
|
|
72
|
-
u(e, t == null ? void 0 : t.operator),
|
|
73
|
-
u(i, t == null ? void 0 : t.patient),
|
|
74
|
-
u(r, t == null ? void 0 : t.secondary)
|
|
75
|
-
), l = (() => {
|
|
76
|
-
switch (y) {
|
|
77
|
-
case "signed":
|
|
78
|
-
return n("signatureStatusChip.signed", { defaultValue: "Signed" });
|
|
79
|
-
case "unsigned":
|
|
80
|
-
return n("signatureStatusChip.unsigned", {
|
|
81
|
-
defaultValue: "Not signed"
|
|
82
|
-
});
|
|
83
|
-
case "notRequired":
|
|
84
|
-
return n("signatureStatusChip.notRequired", {
|
|
85
|
-
defaultValue: "No signature required"
|
|
86
|
-
});
|
|
87
|
-
case "partial": {
|
|
88
|
-
const p = N.filter((a) => a.standing === "pending");
|
|
89
|
-
if (p.length === 1) {
|
|
90
|
-
const a = p[0].role;
|
|
91
|
-
return n(W[a], {
|
|
92
|
-
defaultValue: X[a]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return n("signatureStatusChip.missingCount", {
|
|
96
|
-
defaultValue: "{{count}} signatures missing",
|
|
97
|
-
count: p.length
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
})(), T = (p) => N.map(({ role: a, standing: b }) => {
|
|
102
|
-
const C = n(`signatureStatusChip.party.${a}`, {
|
|
103
|
-
defaultValue: J[a]
|
|
104
|
-
}), B = n(`signatureStatusChip.state.${b}`, {
|
|
105
|
-
defaultValue: Q[b]
|
|
106
|
-
}), h = p ? t == null ? void 0 : t[a] : void 0;
|
|
107
|
-
if (!h)
|
|
108
|
-
return n("signatureStatusChip.breakdownItem", {
|
|
109
|
-
defaultValue: "{{party}} {{state}}",
|
|
110
|
-
party: C,
|
|
111
|
-
state: B
|
|
112
|
-
});
|
|
113
|
-
const R = typeof h == "string" ? { name: h } : h, q = E(R);
|
|
114
|
-
if (q.length > 0) {
|
|
115
|
-
const L = (s) => s.relationship ? n("signatureStatusChip.representative", {
|
|
116
|
-
defaultValue: "{{name}} ({{relationship}})",
|
|
117
|
-
name: S(s.name),
|
|
118
|
-
relationship: s.relationship
|
|
119
|
-
}) : S(s.name), $ = (s) => s.standing ?? b, j = q.filter((s) => $(s) === "signed"), k = q.filter((s) => $(s) === "pending"), v = [];
|
|
120
|
-
return j.length > 0 && v.push(
|
|
121
|
-
n("signatureStatusChip.signedByList", {
|
|
122
|
-
defaultValue: "signed by {{signers}}",
|
|
123
|
-
signers: j.map(L).join(", ")
|
|
124
|
-
})
|
|
125
|
-
), k.length > 0 && v.push(
|
|
126
|
-
n("signatureStatusChip.awaitingList", {
|
|
127
|
-
defaultValue: "awaiting {{signers}}",
|
|
128
|
-
signers: k.map(L).join(", ")
|
|
129
|
-
})
|
|
130
|
-
), n("signatureStatusChip.breakdownItemOnBehalf", {
|
|
131
|
-
defaultValue: "{{party}}: {{name}}, {{detail}}",
|
|
132
|
-
party: C,
|
|
133
|
-
name: S(R.name),
|
|
134
|
-
detail: v.join(", ")
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return n("signatureStatusChip.breakdownItemNamed", {
|
|
138
|
-
defaultValue: "{{party}}: {{name}} ({{state}})",
|
|
139
|
-
party: C,
|
|
140
|
-
name: S(R.name),
|
|
141
|
-
state: B
|
|
142
|
-
});
|
|
143
|
-
}).join(" · "), f = T(!0), I = T(!1), F = f ? `${l}, ${f}` : l, G = c && I ? `${l} · ${I}` : l, g = d && f.length > 0, A = _ ?? (g ? l : F), O = /* @__PURE__ */ D(
|
|
144
|
-
K,
|
|
145
|
-
{
|
|
146
|
-
ref: x,
|
|
147
|
-
variant: H[y],
|
|
148
|
-
size: o,
|
|
149
|
-
withDot: !0,
|
|
150
|
-
role: "img",
|
|
151
|
-
"aria-label": A,
|
|
152
|
-
title: g ? m : m ?? A,
|
|
153
|
-
tabIndex: g ? 0 : void 0,
|
|
154
|
-
"data-component": "signature-status-chip",
|
|
155
|
-
"data-status": y,
|
|
156
|
-
"data-component-id": w,
|
|
157
|
-
id: w,
|
|
158
|
-
className: g ? [
|
|
159
|
-
"ds:rounded-[var(--radius-full)]",
|
|
160
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
161
|
-
"ds:focus-visible:outline-solid",
|
|
162
|
-
"ds:focus-visible:outline-ring",
|
|
163
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
164
|
-
V
|
|
165
|
-
].filter(Boolean).join(" ") : V,
|
|
166
|
-
...U,
|
|
167
|
-
children: G
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
return g ? /* @__PURE__ */ D(Y, { label: f, children: O }) : O;
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
tt.displayName = "SignatureStatusChip";
|
|
174
|
-
export {
|
|
175
|
-
tt as S,
|
|
176
|
-
u as e,
|
|
177
|
-
z as s
|
|
178
|
-
};
|
|
179
|
-
//# sourceMappingURL=signature-status-chip-BSatI_Qc.js.map
|