@alfadocs/ui-kit 1.7.0 → 1.9.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-ALEAGO3j.js → actions-cell-renderer-B2pw6iH8.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-F-cCmFAn.js → anamnesis-summary-rows-d44s_whc.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-BjlF2rTz.js → antenatal-schedule-timeline-B1k8QkA6.js} +3 -3
- package/dist/_chunks/{appointment-card-BhcPJpXh.js → appointment-card-Dzr3GeVz.js} +73 -90
- package/dist/_chunks/{appointment-timeline-CMPvzlGZ.js → appointment-timeline-0mwtpErq.js} +3 -3
- package/dist/_chunks/{appointment-tray-3c_FLxXJ.js → appointment-tray-4FUu_5NX.js} +2 -2
- package/dist/_chunks/armchair-BaLDW6Hz.js +23 -0
- package/dist/_chunks/{booking-CQMJUFG-.js → booking-DHkKcUIl.js} +4 -4
- package/dist/_chunks/{calendar-4dXTvsCz.js → calendar-B4Gnyu1C.js} +553 -437
- package/dist/_chunks/calendar-event-card-Bjdbik8G.js +425 -0
- package/dist/_chunks/{care-plan-card-DQjVRDxO.js → care-plan-card-aDN4oem9.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CMpoeNkb.js → care-plan-entry-card-BEhANdBE.js} +2 -2
- package/dist/_chunks/{care-plan-header-CxYoq23f.js → care-plan-header-CkpPyQqG.js} +2 -2
- package/dist/_chunks/{color-picker-D-tUwxxT.js → color-picker-oZ6zYks8.js} +164 -151
- package/dist/_chunks/control-room-rail-Cj2iX9h_.js +337 -0
- package/dist/_chunks/{cycle-calculator-DzgO1vzP.js → cycle-calculator-DmtYGhqq.js} +3 -3
- package/dist/_chunks/{date-picker-Bp64zk2p.js → date-picker-CepI_oI2.js} +77 -74
- package/dist/_chunks/{date-picker-variants-pKAJfnWr.js → date-picker-variants-DfuooXEK.js} +7 -2
- package/dist/_chunks/{date-range-picker-CDrZ8Zh0.js → date-range-picker-BD8P_rJq.js} +46 -45
- package/dist/_chunks/{date-time-picker-DVETwpzc.js → date-time-picker-3I2vVKGV.js} +2 -2
- package/dist/_chunks/{due-date-calculator-wK8Tajzz.js → due-date-calculator-BF_Ikofx.js} +4 -4
- package/dist/_chunks/{entity-card-9_62gY7l.js → entity-card-DmrgYSEX.js} +4 -4
- package/dist/_chunks/{file-manager-Cc_upjZX.js → file-manager-Crg5dKez.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-C_uDAeP_.js → gestational-age-calculator-CxZelpu2.js} +5 -5
- package/dist/_chunks/{hcg-doubling-BaXkJhT-.js → hcg-doubling-CpU7H5rQ.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-DH4JYpKU.js → link-cell-renderer-BZQtsuFz.js} +2 -2
- package/dist/_chunks/{notes-panel-DlnENphf.js → notes-panel-e9cJWVRg.js} +2 -2
- package/dist/_chunks/{operator-hero-CCDnIa1S.js → operator-hero-BnFv-Uef.js} +2 -2
- package/dist/_chunks/{parse-JqixfsU0.js → parse-MN9bGkrY.js} +2 -2
- package/dist/_chunks/{patient-details-qnsqYBGQ.js → patient-details-xrqe13az.js} +160 -159
- package/dist/_chunks/{patient-table-DwshfVsQ.js → patient-table-ChXM2K7H.js} +11 -7
- package/dist/_chunks/{payment-automation-upsell-BBIG7NFL.js → payment-automation-upsell-DwQW2fRp.js} +52 -63
- package/dist/_chunks/{payment-request-card-BjjBMdsp.js → payment-request-card-YVCcCZ25.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BVS_9YU2.js → pregnancy-dating-DtToyMyc.js} +5 -5
- package/dist/_chunks/{radiograph-panel.agent-CiHwgISa.js → radiograph-panel.agent-C3trfWqB.js} +3 -3
- package/dist/_chunks/repeat-CvQa5rZt.js +17 -0
- package/dist/_chunks/resource-chip-DYTG0IQQ.js +83 -0
- package/dist/_chunks/{rich-text-editor-DARnq_6N.js → rich-text-editor-BDfFtK4H.js} +2 -2
- package/dist/_chunks/subDays-BLl3y3pd.js +8 -0
- package/dist/agent-catalog.json +2 -2
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/calendar.d.ts +138 -12
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/calendar-event-card.d.ts +48 -11
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/color-picker/index.d.ts +1 -1
- package/dist/components/color-picker/index.js +4 -3
- package/dist/components/color-picker/palettes.d.ts +10 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/date-picker/date-picker.d.ts +11 -0
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-details/patient-details.d.ts +8 -0
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/patient-table/patient-table.d.ts +5 -4
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/resource-chip/index.d.ts +3 -0
- package/dist/components/resource-chip/index.js +5 -0
- package/dist/components/resource-chip/resource-chip.d.ts +26 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/host-compat.css +7 -1
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.js +4 -0
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.js +4 -0
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.js +4 -0
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.js +4 -0
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.js +4 -0
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.js +4 -0
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.js +4 -0
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.js +4 -0
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.js +4 -0
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.js +4 -0
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.js +4 -0
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.js +4 -0
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.js +4 -0
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.js +4 -0
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.js +4 -0
- package/dist/index.js +961 -958
- package/dist/locales/ar.json +4 -0
- package/dist/locales/de.json +4 -0
- package/dist/locales/el.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/es.json +4 -0
- package/dist/locales/fr.json +4 -0
- package/dist/locales/hi.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/locales/ja.json +4 -0
- package/dist/locales/nl.json +4 -0
- package/dist/locales/pl.json +4 -0
- package/dist/locales/pt.json +4 -0
- package/dist/locales/ro.json +4 -0
- package/dist/locales/ru.json +4 -0
- package/dist/locales/sq.json +4 -0
- package/dist/locales/sv.json +4 -0
- package/dist/locales/tr.json +4 -0
- package/dist/locales/zh.json +4 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/tokens.css +41 -24
- package/package.json +5 -1
- package/dist/_chunks/calendar-event-card-C6qGtywL.js +0 -257
- package/dist/_chunks/control-room-rail-IH1eBjrK.js +0 -333
- package/dist/_chunks/subDays-CAUv47M1.js +0 -8
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as t, jsxs as c, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { A as
|
|
1
|
+
import { jsx as t, jsxs as c, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as se, useId as M, useMemo as ie, Fragment as re, useState as v, useCallback as I } from "react";
|
|
3
|
+
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as C } from "react-i18next";
|
|
5
|
+
import { A as ne } from "./avatar-BNQNhoyL.js";
|
|
6
6
|
import { I as z } from "./icon-button-DA2CAGHZ.js";
|
|
7
7
|
import { C as F } from "./card-DPmk26CL.js";
|
|
8
|
-
import { C as
|
|
9
|
-
import { D as
|
|
8
|
+
import { C as le, b as oe, a as de } from "./collapsible-CTjxzGuF.js";
|
|
9
|
+
import { D as ce } from "./date-picker-CepI_oI2.js";
|
|
10
10
|
import { D as S } from "./description-list-CjJqR8WK.js";
|
|
11
|
-
import { E as
|
|
12
|
-
import { F as
|
|
13
|
-
import { N as
|
|
14
|
-
import { P as
|
|
15
|
-
import { P as
|
|
16
|
-
import { S as
|
|
17
|
-
import { S as
|
|
18
|
-
import { T as
|
|
19
|
-
import { T as
|
|
20
|
-
import { C as
|
|
21
|
-
import { P as
|
|
22
|
-
import { P as
|
|
23
|
-
import { C as
|
|
24
|
-
import { u as
|
|
25
|
-
import { u as
|
|
26
|
-
import { c as
|
|
27
|
-
import { L as
|
|
28
|
-
import { C as
|
|
29
|
-
import { X as
|
|
30
|
-
import { P as
|
|
31
|
-
import { C as
|
|
11
|
+
import { E as pe } from "./email-input-Dpe63k0K.js";
|
|
12
|
+
import { F as ue } from "./fiscal-code-input-B_nYMSEM.js";
|
|
13
|
+
import { N as me } from "./number-input-Cgu2TtA8.js";
|
|
14
|
+
import { P as fe } from "./panel-header-D313n_9-.js";
|
|
15
|
+
import { P as ge } from "./phone-input-BsZIoE36.js";
|
|
16
|
+
import { S as ye } from "./select-BW5ecXlX.js";
|
|
17
|
+
import { S as be } from "./switch-OILsBLWo.js";
|
|
18
|
+
import { T as he } from "./text-area-Bt3p7Pt0.js";
|
|
19
|
+
import { T as ve } from "./text-input-CUvCb6ST.js";
|
|
20
|
+
import { C as xe } from "./country-select-UEF9BEeQ.js";
|
|
21
|
+
import { P as Ne } from "./province-select-BDywtmL-.js";
|
|
22
|
+
import { P as Ve } from "./postal-code-input-BznBxVxf.js";
|
|
23
|
+
import { C as Ce } from "./city-input-towzBenY.js";
|
|
24
|
+
import { u as ke } from "./registry-DvAUVLHh.js";
|
|
25
|
+
import { u as we, F as De, r as Pe, a as Te } from "./field-value-DG8zaZvo.js";
|
|
26
|
+
import { c as Fe } from "./createLucideIcon-DhHxpK9K.js";
|
|
27
|
+
import { L as Ie } from "./lock-ClAFG1gy.js";
|
|
28
|
+
import { C as $ } from "./check-DrFSN__t.js";
|
|
29
|
+
import { X as ze } from "./x-B5YnXwCz.js";
|
|
30
|
+
import { P as Se } from "./pencil-B1sKKyuT.js";
|
|
31
|
+
import { C as Ee } from "./copy-vRpqqHtY.js";
|
|
32
32
|
/**
|
|
33
33
|
* @license lucide-react v1.22.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
37
|
*/
|
|
38
|
-
const
|
|
38
|
+
const Oe = [
|
|
39
39
|
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
40
40
|
[
|
|
41
41
|
"path",
|
|
@@ -48,7 +48,7 @@ const Ee = [
|
|
|
48
48
|
["path", { d: "M12 16h4", key: "n85exb" }],
|
|
49
49
|
["path", { d: "M8 11h.01", key: "1dfujw" }],
|
|
50
50
|
["path", { d: "M8 16h.01", key: "18s6g9" }]
|
|
51
|
-
],
|
|
51
|
+
], je = Fe("clipboard-list", Oe), Ae = {
|
|
52
52
|
id: "patient-details",
|
|
53
53
|
// `view_change` backs the view-config actions (show/hide + reorder are both
|
|
54
54
|
// view reconfigurations); `set_value` backs the single-value `update_field`
|
|
@@ -152,7 +152,7 @@ const Ee = [
|
|
|
152
152
|
description: "Stable field KEY on each row. Never the field value (no PHI in the DOM hook)."
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, L = H(
|
|
156
156
|
"ds:flex ds:flex-col ds:text-[color:var(--foreground)]",
|
|
157
157
|
{
|
|
158
158
|
variants: {
|
|
@@ -167,7 +167,7 @@ const Ee = [
|
|
|
167
167
|
density: "compact"
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
),
|
|
170
|
+
), q = H("ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", {
|
|
171
171
|
variants: {
|
|
172
172
|
density: {
|
|
173
173
|
comfortable: "ds:p-[var(--spacing-md)]",
|
|
@@ -177,7 +177,7 @@ const Ee = [
|
|
|
177
177
|
defaultVariants: {
|
|
178
178
|
density: "compact"
|
|
179
179
|
}
|
|
180
|
-
}),
|
|
180
|
+
}), Me = se(
|
|
181
181
|
function({
|
|
182
182
|
title: a,
|
|
183
183
|
sections: n,
|
|
@@ -187,68 +187,69 @@ const Ee = [
|
|
|
187
187
|
editable: r = !1,
|
|
188
188
|
onFieldSave: o,
|
|
189
189
|
validate: d,
|
|
190
|
-
visibleFieldOrder:
|
|
190
|
+
visibleFieldOrder: f,
|
|
191
191
|
defaultVisibleFieldOrder: s,
|
|
192
|
-
onVisibleFieldsChange:
|
|
193
|
-
loading:
|
|
194
|
-
emptyState:
|
|
192
|
+
onVisibleFieldsChange: y,
|
|
193
|
+
loading: k = !1,
|
|
194
|
+
emptyState: b,
|
|
195
195
|
patientId: m,
|
|
196
|
-
id:
|
|
197
|
-
locale:
|
|
196
|
+
id: g,
|
|
197
|
+
locale: w,
|
|
198
198
|
cogLabel: E,
|
|
199
|
+
panelTitle: O,
|
|
199
200
|
"aria-label": x,
|
|
200
|
-
className:
|
|
201
|
-
...
|
|
202
|
-
},
|
|
203
|
-
const { t:
|
|
204
|
-
visible:
|
|
205
|
-
catalogueIds:
|
|
206
|
-
setOrder:
|
|
207
|
-
toggleField:
|
|
208
|
-
toggleSection:
|
|
209
|
-
moveFieldOnto:
|
|
210
|
-
reset:
|
|
211
|
-
} =
|
|
212
|
-
value:
|
|
201
|
+
className: D,
|
|
202
|
+
...P
|
|
203
|
+
}, T) {
|
|
204
|
+
const { t: N } = C(), h = M(), {
|
|
205
|
+
visible: V,
|
|
206
|
+
catalogueIds: U,
|
|
207
|
+
setOrder: j,
|
|
208
|
+
toggleField: W,
|
|
209
|
+
toggleSection: Y,
|
|
210
|
+
moveFieldOnto: X,
|
|
211
|
+
reset: G
|
|
212
|
+
} = we(n, {
|
|
213
|
+
value: f,
|
|
213
214
|
defaultValue: s,
|
|
214
|
-
onChange:
|
|
215
|
-
}),
|
|
215
|
+
onChange: y
|
|
216
|
+
}), J = ie(
|
|
216
217
|
() => ({
|
|
217
|
-
getVisibleFieldOrder: () =>
|
|
218
|
+
getVisibleFieldOrder: () => V,
|
|
218
219
|
getPatientId: () => m,
|
|
219
|
-
setVisibleFields: (p) =>
|
|
220
|
-
setFieldOrder: (p) =>
|
|
221
|
-
updateField: (p,
|
|
220
|
+
setVisibleFields: (p) => j(p),
|
|
221
|
+
setFieldOrder: (p) => j(p),
|
|
222
|
+
updateField: (p, A) => o ? o(p, A) : Promise.reject(
|
|
222
223
|
new Error("PatientDetails: no onFieldSave handler is wired.")
|
|
223
224
|
)
|
|
224
225
|
}),
|
|
225
|
-
[
|
|
226
|
+
[V, m, j, o]
|
|
226
227
|
);
|
|
227
|
-
|
|
228
|
-
const
|
|
228
|
+
ke(Ae, J, g);
|
|
229
|
+
const _ = O ?? N("patientDetails.regionLabel", {
|
|
229
230
|
defaultValue: "Patient details"
|
|
230
|
-
}),
|
|
231
|
-
if (
|
|
231
|
+
}), Q = x ?? _, B = (i == null ? void 0 : i.name) ?? (typeof a == "string" ? a : void 0), Z = !!(i != null && i.src || B), ee = U.some((p) => V.includes(p));
|
|
232
|
+
if (k)
|
|
232
233
|
return /* @__PURE__ */ t(
|
|
233
234
|
"section",
|
|
234
235
|
{
|
|
235
|
-
ref:
|
|
236
|
+
ref: T,
|
|
236
237
|
"data-component": "patient-details",
|
|
237
|
-
"data-component-id":
|
|
238
|
+
"data-component-id": g,
|
|
238
239
|
"data-patient-id": m,
|
|
239
|
-
"aria-label":
|
|
240
|
+
"aria-label": Q,
|
|
240
241
|
"aria-busy": "true",
|
|
241
|
-
className:
|
|
242
|
-
...
|
|
243
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
242
|
+
className: L({ className: D }),
|
|
243
|
+
...P,
|
|
244
|
+
children: /* @__PURE__ */ t("div", { className: q(), children: /* @__PURE__ */ t(Le, {}) })
|
|
244
245
|
}
|
|
245
246
|
);
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
const te = n.length === 0 || !ee, K = /* @__PURE__ */ c("div", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-sm)]", children: [
|
|
248
|
+
Z ? /* @__PURE__ */ t(
|
|
249
|
+
ne,
|
|
249
250
|
{
|
|
250
251
|
size: "md",
|
|
251
|
-
name:
|
|
252
|
+
name: B,
|
|
252
253
|
src: i == null ? void 0 : i.src,
|
|
253
254
|
className: "ds:shrink-0"
|
|
254
255
|
}
|
|
@@ -261,54 +262,54 @@ const Ee = [
|
|
|
261
262
|
return /* @__PURE__ */ c(
|
|
262
263
|
"section",
|
|
263
264
|
{
|
|
264
|
-
ref:
|
|
265
|
+
ref: T,
|
|
265
266
|
"data-component": "patient-details",
|
|
266
|
-
"data-component-id":
|
|
267
|
+
"data-component-id": g,
|
|
267
268
|
"data-patient-id": m,
|
|
268
|
-
"aria-labelledby": x ? void 0 :
|
|
269
|
+
"aria-labelledby": x ? void 0 : h,
|
|
269
270
|
"aria-label": x ?? void 0,
|
|
270
|
-
className:
|
|
271
|
-
...
|
|
271
|
+
className: L({ className: D }),
|
|
272
|
+
...P,
|
|
272
273
|
children: [
|
|
273
274
|
/* @__PURE__ */ t(
|
|
274
|
-
|
|
275
|
+
fe,
|
|
275
276
|
{
|
|
276
|
-
title:
|
|
277
|
-
icon: /* @__PURE__ */ t(
|
|
278
|
-
headingId:
|
|
277
|
+
title: _,
|
|
278
|
+
icon: /* @__PURE__ */ t(je, { "aria-hidden": "true" }),
|
|
279
|
+
headingId: h,
|
|
279
280
|
sticky: !0,
|
|
280
281
|
divider: !0,
|
|
281
282
|
actions: /* @__PURE__ */ t(
|
|
282
|
-
|
|
283
|
+
De,
|
|
283
284
|
{
|
|
284
285
|
sections: n,
|
|
285
|
-
visible:
|
|
286
|
-
onToggleField:
|
|
287
|
-
onToggleSection:
|
|
288
|
-
onMoveFieldOnto:
|
|
289
|
-
onReset:
|
|
286
|
+
visible: V,
|
|
287
|
+
onToggleField: W,
|
|
288
|
+
onToggleSection: Y,
|
|
289
|
+
onMoveFieldOnto: X,
|
|
290
|
+
onReset: G,
|
|
290
291
|
label: E
|
|
291
292
|
}
|
|
292
293
|
)
|
|
293
294
|
}
|
|
294
295
|
),
|
|
295
|
-
/* @__PURE__ */ c("div", { className:
|
|
296
|
-
u ? /* @__PURE__ */ t(F, { variant: "elevated", children: /* @__PURE__ */ t(F.Body, { children:
|
|
297
|
-
|
|
296
|
+
/* @__PURE__ */ c("div", { className: q(), children: [
|
|
297
|
+
u ? /* @__PURE__ */ t(F, { variant: "elevated", children: /* @__PURE__ */ t(F.Body, { children: K }) }) : K,
|
|
298
|
+
te ? /* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: b ?? N("patientDetails.empty", {
|
|
298
299
|
defaultValue: "No patient selected."
|
|
299
|
-
}) }) :
|
|
300
|
-
const
|
|
301
|
-
|
|
300
|
+
}) }) : Pe(n, V).filter(({ fields: p }) => p.length > 0).map(({ section: p, fields: A }) => {
|
|
301
|
+
const R = /* @__PURE__ */ t(
|
|
302
|
+
_e,
|
|
302
303
|
{
|
|
303
304
|
section: p,
|
|
304
|
-
fields:
|
|
305
|
+
fields: A,
|
|
305
306
|
editable: r,
|
|
306
307
|
onFieldSave: o,
|
|
307
308
|
validate: d,
|
|
308
|
-
locale:
|
|
309
|
+
locale: w
|
|
309
310
|
}
|
|
310
311
|
);
|
|
311
|
-
return u ? /* @__PURE__ */ t(F, { variant: "elevated", children: /* @__PURE__ */ t(F.Body, { children:
|
|
312
|
+
return u ? /* @__PURE__ */ t(F, { variant: "elevated", children: /* @__PURE__ */ t(F.Body, { children: R }) }, p.id) : /* @__PURE__ */ t(re, { children: R }, p.id);
|
|
312
313
|
})
|
|
313
314
|
] })
|
|
314
315
|
]
|
|
@@ -316,8 +317,8 @@ const Ee = [
|
|
|
316
317
|
);
|
|
317
318
|
}
|
|
318
319
|
);
|
|
319
|
-
|
|
320
|
-
function
|
|
320
|
+
Me.displayName = "PatientDetails";
|
|
321
|
+
function _e({
|
|
321
322
|
section: e,
|
|
322
323
|
fields: a,
|
|
323
324
|
editable: n,
|
|
@@ -325,7 +326,7 @@ function Me({
|
|
|
325
326
|
validate: l,
|
|
326
327
|
locale: u
|
|
327
328
|
}) {
|
|
328
|
-
const { t: r } =
|
|
329
|
+
const { t: r } = C(), o = M(), d = e.collapsible ?? !0, f = a.length === 0 ? /* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: r("patientDetails.section.empty", {
|
|
329
330
|
defaultValue: "No fields shown."
|
|
330
331
|
}) }) : /* @__PURE__ */ t(
|
|
331
332
|
S,
|
|
@@ -335,7 +336,7 @@ function Me({
|
|
|
335
336
|
divider: "none",
|
|
336
337
|
className: "ds:[--description-list-icon-color:var(--accent)]",
|
|
337
338
|
children: a.map((s) => /* @__PURE__ */ t(
|
|
338
|
-
|
|
339
|
+
Be,
|
|
339
340
|
{
|
|
340
341
|
field: s,
|
|
341
342
|
icon: s.icon ?? null,
|
|
@@ -349,13 +350,13 @@ function Me({
|
|
|
349
350
|
}
|
|
350
351
|
);
|
|
351
352
|
return d ? /* @__PURE__ */ c(
|
|
352
|
-
|
|
353
|
+
le,
|
|
353
354
|
{
|
|
354
355
|
defaultOpen: e.defaultOpen ?? !0,
|
|
355
356
|
variant: "minimal",
|
|
356
357
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
357
358
|
children: [
|
|
358
|
-
/* @__PURE__ */ t("h3", { className: "ds:m-0", children: /* @__PURE__ */ t(
|
|
359
|
+
/* @__PURE__ */ t("h3", { className: "ds:m-0", children: /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
359
360
|
"button",
|
|
360
361
|
{
|
|
361
362
|
type: "button",
|
|
@@ -364,7 +365,7 @@ function Me({
|
|
|
364
365
|
children: e.heading
|
|
365
366
|
}
|
|
366
367
|
) }) }),
|
|
367
|
-
/* @__PURE__ */ t(
|
|
368
|
+
/* @__PURE__ */ t(de, { "aria-labelledby": o, children: f })
|
|
368
369
|
]
|
|
369
370
|
}
|
|
370
371
|
) : /* @__PURE__ */ c(
|
|
@@ -381,12 +382,12 @@ function Me({
|
|
|
381
382
|
children: e.heading
|
|
382
383
|
}
|
|
383
384
|
),
|
|
384
|
-
|
|
385
|
+
f
|
|
385
386
|
]
|
|
386
387
|
}
|
|
387
388
|
);
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function Be({
|
|
390
391
|
field: e,
|
|
391
392
|
icon: a,
|
|
392
393
|
editable: n,
|
|
@@ -394,33 +395,33 @@ function _e({
|
|
|
394
395
|
validate: l,
|
|
395
396
|
locale: u
|
|
396
397
|
}) {
|
|
397
|
-
const { t: r } =
|
|
398
|
-
|
|
399
|
-
}, [e.editValue]),
|
|
398
|
+
const { t: r } = C(), o = M(), d = n && !!e.editable && !!i, [f, s] = v(!1), [y, k] = v(e.editValue), [b, m] = v(null), [g, w] = v(!1), E = I(() => {
|
|
399
|
+
k(e.editValue), m(null), s(!0);
|
|
400
|
+
}, [e.editValue]), O = I(() => {
|
|
400
401
|
s(!1), m(null);
|
|
401
|
-
}, []),
|
|
402
|
+
}, []), x = I(async () => {
|
|
402
403
|
if (!i) return;
|
|
403
|
-
const N = (l == null ? void 0 : l(e.id,
|
|
404
|
+
const N = (l == null ? void 0 : l(e.id, y)) ?? null;
|
|
404
405
|
if (N) {
|
|
405
406
|
m(N);
|
|
406
407
|
return;
|
|
407
408
|
}
|
|
408
|
-
|
|
409
|
+
w(!0), m(null);
|
|
409
410
|
try {
|
|
410
|
-
await i(e.id,
|
|
411
|
-
} catch (
|
|
411
|
+
await i(e.id, y), s(!1);
|
|
412
|
+
} catch (h) {
|
|
412
413
|
m(
|
|
413
|
-
|
|
414
|
+
h instanceof Error && h.message ? h.message : r("patientDetails.edit.saveFailed", {
|
|
414
415
|
defaultValue: "Could not save. Try again."
|
|
415
416
|
})
|
|
416
417
|
);
|
|
417
418
|
} finally {
|
|
418
|
-
|
|
419
|
+
w(!1);
|
|
419
420
|
}
|
|
420
|
-
}, [i, l, e.id,
|
|
421
|
+
}, [i, l, e.id, y, r]), D = /* @__PURE__ */ c("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
421
422
|
e.label,
|
|
422
423
|
e.sensitive ? /* @__PURE__ */ t(
|
|
423
|
-
|
|
424
|
+
Ie,
|
|
424
425
|
{
|
|
425
426
|
"aria-label": r("patientDetails.sensitive", {
|
|
426
427
|
defaultValue: "Sensitive"
|
|
@@ -428,18 +429,18 @@ function _e({
|
|
|
428
429
|
className: "ds:size-3 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
|
|
429
430
|
}
|
|
430
431
|
) : null
|
|
431
|
-
] }), P = typeof e.value == "string" ? e.value : e.copyText ?? (typeof e.editValue == "string" ? e.editValue : void 0), T =
|
|
432
|
+
] }), P = typeof e.value == "string" ? e.value : e.copyText ?? (typeof e.editValue == "string" ? e.editValue : void 0), T = f ? /* @__PURE__ */ c("span", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
432
433
|
/* @__PURE__ */ c("span", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-2xs)]", children: [
|
|
433
434
|
/* @__PURE__ */ t(
|
|
434
|
-
|
|
435
|
+
Ke,
|
|
435
436
|
{
|
|
436
437
|
field: e,
|
|
437
|
-
value:
|
|
438
|
-
onChange:
|
|
439
|
-
invalid: !!
|
|
440
|
-
errorId:
|
|
438
|
+
value: y,
|
|
439
|
+
onChange: k,
|
|
440
|
+
invalid: !!b,
|
|
441
|
+
errorId: b ? o : void 0,
|
|
441
442
|
locale: u,
|
|
442
|
-
disabled:
|
|
443
|
+
disabled: g
|
|
443
444
|
}
|
|
444
445
|
),
|
|
445
446
|
/* @__PURE__ */ t(
|
|
@@ -447,10 +448,10 @@ function _e({
|
|
|
447
448
|
{
|
|
448
449
|
size: "sm",
|
|
449
450
|
intent: "primary",
|
|
450
|
-
icon: /* @__PURE__ */ t(
|
|
451
|
+
icon: /* @__PURE__ */ t($, { "aria-hidden": "true" }),
|
|
451
452
|
"aria-label": r("patientDetails.edit.save", { defaultValue: "Save" }),
|
|
452
|
-
loading:
|
|
453
|
-
onClick:
|
|
453
|
+
loading: g,
|
|
454
|
+
onClick: x
|
|
454
455
|
}
|
|
455
456
|
),
|
|
456
457
|
/* @__PURE__ */ t(
|
|
@@ -458,22 +459,22 @@ function _e({
|
|
|
458
459
|
{
|
|
459
460
|
size: "sm",
|
|
460
461
|
intent: "ghost",
|
|
461
|
-
icon: /* @__PURE__ */ t(
|
|
462
|
+
icon: /* @__PURE__ */ t(ze, { "aria-hidden": "true" }),
|
|
462
463
|
"aria-label": r("patientDetails.edit.cancel", {
|
|
463
464
|
defaultValue: "Cancel"
|
|
464
465
|
}),
|
|
465
|
-
disabled:
|
|
466
|
-
onClick:
|
|
466
|
+
disabled: g,
|
|
467
|
+
onClick: O
|
|
467
468
|
}
|
|
468
469
|
)
|
|
469
470
|
] }),
|
|
470
|
-
|
|
471
|
+
b ? /* @__PURE__ */ t(
|
|
471
472
|
"span",
|
|
472
473
|
{
|
|
473
474
|
id: o,
|
|
474
475
|
role: "alert",
|
|
475
476
|
className: "type-meta ds:text-[color:var(--destructive)]",
|
|
476
|
-
children:
|
|
477
|
+
children: b
|
|
477
478
|
}
|
|
478
479
|
) : null
|
|
479
480
|
] }) : /* @__PURE__ */ c("span", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-2xs)] ds:min-w-0", children: [
|
|
@@ -482,17 +483,17 @@ function _e({
|
|
|
482
483
|
{
|
|
483
484
|
className: `ds:min-w-0 ${e.editType === "textarea" ? "" : "ds:truncate"}${e.mono ? " ds:font-mono" : ""}`,
|
|
484
485
|
title: P,
|
|
485
|
-
children: /* @__PURE__ */ t(
|
|
486
|
+
children: /* @__PURE__ */ t(Te, { field: e })
|
|
486
487
|
}
|
|
487
488
|
),
|
|
488
|
-
e.copyable && e.copyText ? /* @__PURE__ */ t(
|
|
489
|
+
e.copyable && e.copyText ? /* @__PURE__ */ t(Re, { text: e.copyText, label: e.label }) : null,
|
|
489
490
|
d ? /* @__PURE__ */ t(
|
|
490
491
|
z,
|
|
491
492
|
{
|
|
492
493
|
size: "sm",
|
|
493
494
|
intent: "ghost",
|
|
494
495
|
className: "ds:shrink-0 ds:opacity-0 ds:transition-opacity ds:motion-reduce:transition-none ds:group-hover:opacity-100 ds:focus-visible:opacity-100",
|
|
495
|
-
icon: /* @__PURE__ */ t(
|
|
496
|
+
icon: /* @__PURE__ */ t(Se, { "aria-hidden": "true" }),
|
|
496
497
|
"aria-label": r("patientDetails.edit.editField", {
|
|
497
498
|
field: e.label,
|
|
498
499
|
defaultValue: "Edit {{field}}"
|
|
@@ -514,7 +515,7 @@ function _e({
|
|
|
514
515
|
}
|
|
515
516
|
);
|
|
516
517
|
}
|
|
517
|
-
function
|
|
518
|
+
function Ke({
|
|
518
519
|
field: e,
|
|
519
520
|
value: a,
|
|
520
521
|
onChange: n,
|
|
@@ -523,11 +524,11 @@ function Be({
|
|
|
523
524
|
locale: u,
|
|
524
525
|
disabled: r
|
|
525
526
|
}) {
|
|
526
|
-
const { t: o } =
|
|
527
|
+
const { t: o } = C(), d = i ? "error" : "default";
|
|
527
528
|
switch (e.editType ?? "text") {
|
|
528
529
|
case "textarea":
|
|
529
530
|
return /* @__PURE__ */ t(
|
|
530
|
-
|
|
531
|
+
he,
|
|
531
532
|
{
|
|
532
533
|
size: "sm",
|
|
533
534
|
value: typeof a == "string" ? a : "",
|
|
@@ -542,7 +543,7 @@ function Be({
|
|
|
542
543
|
);
|
|
543
544
|
case "select":
|
|
544
545
|
return /* @__PURE__ */ t(
|
|
545
|
-
|
|
546
|
+
ye,
|
|
546
547
|
{
|
|
547
548
|
size: "sm",
|
|
548
549
|
options: e.options ?? [],
|
|
@@ -557,7 +558,7 @@ function Be({
|
|
|
557
558
|
);
|
|
558
559
|
case "boolean":
|
|
559
560
|
return /* @__PURE__ */ t(
|
|
560
|
-
|
|
561
|
+
be,
|
|
561
562
|
{
|
|
562
563
|
label: e.label,
|
|
563
564
|
checked: a === !0,
|
|
@@ -567,7 +568,7 @@ function Be({
|
|
|
567
568
|
);
|
|
568
569
|
case "date":
|
|
569
570
|
return /* @__PURE__ */ t(
|
|
570
|
-
|
|
571
|
+
ce,
|
|
571
572
|
{
|
|
572
573
|
size: "sm",
|
|
573
574
|
value: a instanceof Date ? a : void 0,
|
|
@@ -578,7 +579,7 @@ function Be({
|
|
|
578
579
|
);
|
|
579
580
|
case "number":
|
|
580
581
|
return /* @__PURE__ */ t(
|
|
581
|
-
|
|
582
|
+
me,
|
|
582
583
|
{
|
|
583
584
|
size: "sm",
|
|
584
585
|
value: typeof a == "number" ? a : null,
|
|
@@ -595,7 +596,7 @@ function Be({
|
|
|
595
596
|
);
|
|
596
597
|
case "email":
|
|
597
598
|
return /* @__PURE__ */ t(
|
|
598
|
-
|
|
599
|
+
pe,
|
|
599
600
|
{
|
|
600
601
|
size: "sm",
|
|
601
602
|
value: typeof a == "string" ? a : "",
|
|
@@ -609,7 +610,7 @@ function Be({
|
|
|
609
610
|
);
|
|
610
611
|
case "phone":
|
|
611
612
|
return /* @__PURE__ */ t(
|
|
612
|
-
|
|
613
|
+
ge,
|
|
613
614
|
{
|
|
614
615
|
size: "sm",
|
|
615
616
|
value: typeof a == "string" ? a : "",
|
|
@@ -624,7 +625,7 @@ function Be({
|
|
|
624
625
|
);
|
|
625
626
|
case "fiscalCode":
|
|
626
627
|
return /* @__PURE__ */ t(
|
|
627
|
-
|
|
628
|
+
ue,
|
|
628
629
|
{
|
|
629
630
|
size: "sm",
|
|
630
631
|
value: typeof a == "string" ? a : "",
|
|
@@ -643,7 +644,7 @@ function Be({
|
|
|
643
644
|
// conveyed by colour alone.
|
|
644
645
|
case "province":
|
|
645
646
|
return /* @__PURE__ */ t(
|
|
646
|
-
|
|
647
|
+
Ne,
|
|
647
648
|
{
|
|
648
649
|
size: "sm",
|
|
649
650
|
country: "it",
|
|
@@ -659,7 +660,7 @@ function Be({
|
|
|
659
660
|
);
|
|
660
661
|
case "country":
|
|
661
662
|
return /* @__PURE__ */ t(
|
|
662
|
-
|
|
663
|
+
xe,
|
|
663
664
|
{
|
|
664
665
|
size: "sm",
|
|
665
666
|
value: typeof a == "string" ? a : "",
|
|
@@ -674,7 +675,7 @@ function Be({
|
|
|
674
675
|
);
|
|
675
676
|
case "postalCode":
|
|
676
677
|
return /* @__PURE__ */ t(
|
|
677
|
-
|
|
678
|
+
Ve,
|
|
678
679
|
{
|
|
679
680
|
size: "sm",
|
|
680
681
|
country: "it",
|
|
@@ -689,7 +690,7 @@ function Be({
|
|
|
689
690
|
);
|
|
690
691
|
case "city":
|
|
691
692
|
return /* @__PURE__ */ t(
|
|
692
|
-
|
|
693
|
+
Ce,
|
|
693
694
|
{
|
|
694
695
|
size: "sm",
|
|
695
696
|
value: typeof a == "string" ? a : "",
|
|
@@ -705,7 +706,7 @@ function Be({
|
|
|
705
706
|
case "text":
|
|
706
707
|
default:
|
|
707
708
|
return /* @__PURE__ */ t(
|
|
708
|
-
|
|
709
|
+
ve,
|
|
709
710
|
{
|
|
710
711
|
size: "sm",
|
|
711
712
|
value: typeof a == "string" ? a : "",
|
|
@@ -724,11 +725,11 @@ function Be({
|
|
|
724
725
|
);
|
|
725
726
|
}
|
|
726
727
|
}
|
|
727
|
-
function
|
|
728
|
+
function Re({
|
|
728
729
|
text: e,
|
|
729
730
|
label: a
|
|
730
731
|
}) {
|
|
731
|
-
const { t: n } =
|
|
732
|
+
const { t: n } = C(), [i, l] = v(!1), [u, r] = v(""), o = I(async () => {
|
|
732
733
|
try {
|
|
733
734
|
await navigator.clipboard.writeText(e), l(!0), r(n("keyValuePair.copied", { defaultValue: "Copied" })), setTimeout(() => {
|
|
734
735
|
l(!1), r("");
|
|
@@ -739,13 +740,13 @@ function Ke({
|
|
|
739
740
|
), setTimeout(() => r(""), 3e3);
|
|
740
741
|
}
|
|
741
742
|
}, [e, n]);
|
|
742
|
-
return /* @__PURE__ */ c(
|
|
743
|
+
return /* @__PURE__ */ c(ae, { children: [
|
|
743
744
|
/* @__PURE__ */ t(
|
|
744
745
|
z,
|
|
745
746
|
{
|
|
746
747
|
size: "sm",
|
|
747
748
|
intent: "ghost",
|
|
748
|
-
icon: i ? /* @__PURE__ */ t(
|
|
749
|
+
icon: i ? /* @__PURE__ */ t($, { "aria-hidden": "true" }) : /* @__PURE__ */ t(Ee, { "aria-hidden": "true" }),
|
|
749
750
|
"aria-label": n("keyValuePair.copy", {
|
|
750
751
|
label: a,
|
|
751
752
|
defaultValue: "Copy {{label}}"
|
|
@@ -756,7 +757,7 @@ function Ke({
|
|
|
756
757
|
/* @__PURE__ */ t("span", { role: "status", className: "ds:sr-only", children: u })
|
|
757
758
|
] });
|
|
758
759
|
}
|
|
759
|
-
function
|
|
760
|
+
function Le() {
|
|
760
761
|
return /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
761
762
|
/* @__PURE__ */ c("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
762
763
|
/* @__PURE__ */ t("span", { className: "ds:size-10 ds:shrink-0 ds:rounded-full ds:bg-[color:var(--muted)]" }),
|
|
@@ -772,7 +773,7 @@ function Re() {
|
|
|
772
773
|
] });
|
|
773
774
|
}
|
|
774
775
|
export {
|
|
775
|
-
|
|
776
|
-
|
|
776
|
+
Me as P,
|
|
777
|
+
Ae as p
|
|
777
778
|
};
|
|
778
|
-
//# sourceMappingURL=patient-details-
|
|
779
|
+
//# sourceMappingURL=patient-details-xrqe13az.js.map
|