@alfadocs/ui-kit-debug 1.36.0 → 1.37.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/appointment-peek-5S4O1VQP.js +115 -0
- package/dist/_chunks/appointment-peek-5S4O1VQP.js.map +1 -0
- package/dist/_chunks/appointment-peek.agent-C539tNFM.js +17 -0
- package/dist/_chunks/appointment-peek.agent-C539tNFM.js.map +1 -0
- package/dist/_chunks/building-2-D33bLCWL.js +24 -0
- package/dist/_chunks/building-2-D33bLCWL.js.map +1 -0
- package/dist/_chunks/calendar-workspace-BqKBj26r.js +9715 -0
- package/dist/_chunks/calendar-workspace-BqKBj26r.js.map +1 -0
- package/dist/_chunks/{control-room-rail-Ds45_g4f.js → control-room-rail-DQoHdE1U.js} +2 -2
- package/dist/_chunks/{control-room-rail-Ds45_g4f.js.map → control-room-rail-DQoHdE1U.js.map} +1 -1
- package/dist/_chunks/editable-description-BOfAeY3T.js +112 -0
- package/dist/_chunks/editable-description-BOfAeY3T.js.map +1 -0
- package/dist/_chunks/editable-description.agent-Bm_LBV2j.js +21 -0
- package/dist/_chunks/editable-description.agent-Bm_LBV2j.js.map +1 -0
- package/dist/_chunks/{money.agent-Dw55UxUA.js → money-BY-HmKhZ.js} +33 -47
- package/dist/_chunks/money-BY-HmKhZ.js.map +1 -0
- package/dist/_chunks/money.agent-BjJ6gOkx.js +17 -0
- package/dist/_chunks/money.agent-BjJ6gOkx.js.map +1 -0
- package/dist/_chunks/notes-panel-4y5JioWN.js +556 -0
- package/dist/_chunks/notes-panel-4y5JioWN.js.map +1 -0
- package/dist/_chunks/panel-subview-BNXN8OEL.js +160 -0
- package/dist/_chunks/panel-subview-BNXN8OEL.js.map +1 -0
- package/dist/_chunks/panel-subview.agent-BIBvE-IW.js +17 -0
- package/dist/_chunks/panel-subview.agent-BIBvE-IW.js.map +1 -0
- package/dist/_chunks/{patient-details-f7SSXkTJ.js → patient-details-2cIaL-Zb.js} +2 -2
- package/dist/_chunks/{patient-details-f7SSXkTJ.js.map → patient-details-2cIaL-Zb.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BQZoP4m2.js → patient-field-row-IHb2VFc2.js} +193 -172
- package/dist/_chunks/patient-field-row-IHb2VFc2.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-Bz7KdUin.js → patient-summary-card-BzmJH9a-.js} +2 -2
- package/dist/_chunks/{patient-summary-card-Bz7KdUin.js.map → patient-summary-card-BzmJH9a-.js.map} +1 -1
- package/dist/_chunks/{section-card.agent-W18CHEgX.js → section-card-XR2bW1Ie.js} +20 -34
- package/dist/_chunks/{section-card.agent-W18CHEgX.js.map → section-card-XR2bW1Ie.js.map} +1 -1
- package/dist/_chunks/section-card.agent-Bz1BhM_j.js +17 -0
- package/dist/_chunks/section-card.agent-Bz1BhM_j.js.map +1 -0
- package/dist/_chunks/smartphone-DaPcFw-X.js +32 -0
- package/dist/_chunks/smartphone-DaPcFw-X.js.map +1 -0
- package/dist/_chunks/{task-card-BalrLkSz.js → task-card-qTKD1fIT.js} +39 -57
- package/dist/_chunks/task-card-qTKD1fIT.js.map +1 -0
- package/dist/_chunks/{task-tray-wl9eti6J.js → task-tray-CQ8UAR2j.js} +2 -2
- package/dist/_chunks/{task-tray-wl9eti6J.js.map → task-tray-CQ8UAR2j.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-BDNB7hsZ.js → tasks-panel-CBGMtQ_f.js} +2 -2
- package/dist/_chunks/{tasks-panel-BDNB7hsZ.js.map → tasks-panel-CBGMtQ_f.js.map} +1 -1
- package/dist/_chunks/{tool-rail-Bq5eiFMG.js → tool-rail-BP8sjxCw.js} +310 -231
- package/dist/_chunks/tool-rail-BP8sjxCw.js.map +1 -0
- package/dist/_chunks/treatment-receipt-D4kOLXOk.js +94 -0
- package/dist/_chunks/treatment-receipt-D4kOLXOk.js.map +1 -0
- package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js +21 -0
- package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js.map +1 -0
- package/dist/_chunks/use-presence-transition-cDwWUXV-.js +58 -0
- package/dist/_chunks/use-presence-transition-cDwWUXV-.js.map +1 -0
- package/dist/_chunks/{workflow-map-D-LEni11.js → workflow-map-CXdsxvUj.js} +140 -156
- package/dist/_chunks/workflow-map-CXdsxvUj.js.map +1 -0
- package/dist/agent-catalog.json +65 -1
- package/dist/components/appointment-peek/appointment-peek.agent.d.ts +3 -0
- package/dist/components/appointment-peek/appointment-peek.agent.d.ts.map +1 -0
- package/dist/components/appointment-peek/appointment-peek.d.ts +45 -0
- package/dist/components/appointment-peek/appointment-peek.d.ts.map +1 -0
- package/dist/components/appointment-peek/index.d.ts +4 -0
- package/dist/components/appointment-peek/index.d.ts.map +1 -0
- package/dist/components/appointment-peek/index.js +7 -0
- package/dist/components/appointment-peek/index.js.map +1 -0
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/editable-description/editable-description.agent.d.ts +3 -0
- package/dist/components/editable-description/editable-description.agent.d.ts.map +1 -0
- package/dist/components/editable-description/editable-description.d.ts +20 -0
- package/dist/components/editable-description/editable-description.d.ts.map +1 -0
- package/dist/components/editable-description/index.d.ts +4 -0
- package/dist/components/editable-description/index.d.ts.map +1 -0
- package/dist/components/editable-description/index.js +7 -0
- package/dist/components/editable-description/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/money/index.js +2 -1
- package/dist/components/money/index.js.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +16 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/panel-subview/index.d.ts +4 -0
- package/dist/components/panel-subview/index.d.ts.map +1 -0
- package/dist/components/panel-subview/index.js +7 -0
- package/dist/components/panel-subview/index.js.map +1 -0
- package/dist/components/panel-subview/panel-subview.agent.d.ts +3 -0
- package/dist/components/panel-subview/panel-subview.agent.d.ts.map +1 -0
- package/dist/components/panel-subview/panel-subview.d.ts +32 -0
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/section-card/index.js +4 -3
- package/dist/components/section-card/index.js.map +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/treatment-receipt/index.d.ts +4 -0
- package/dist/components/treatment-receipt/index.d.ts.map +1 -0
- package/dist/components/treatment-receipt/index.js +7 -0
- package/dist/components/treatment-receipt/index.js.map +1 -0
- package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts +3 -0
- package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts.map +1 -0
- package/dist/components/treatment-receipt/treatment-receipt.d.ts +30 -0
- package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -0
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +9 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-presence-transition.d.ts +40 -0
- package/dist/hooks/use-presence-transition.d.ts.map +1 -0
- package/dist/host-compat.css +7 -1
- package/dist/i18n/locales/ar.d.ts +29 -5
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +29 -5
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +29 -5
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +29 -5
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +29 -5
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +29 -5
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +29 -5
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +29 -5
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +29 -5
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +29 -5
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +29 -5
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +29 -5
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +29 -5
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +29 -5
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +29 -5
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +29 -5
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +29 -5
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +29 -5
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +29 -5
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +29 -5
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +29 -5
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +29 -5
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +29 -5
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +29 -5
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +29 -5
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +29 -5
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +29 -5
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +29 -5
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +29 -5
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +29 -5
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +29 -5
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +29 -5
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +29 -5
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +29 -5
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +29 -5
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +29 -5
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +958 -940
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +29 -5
- package/dist/locales/de.json +29 -5
- package/dist/locales/el.json +29 -5
- package/dist/locales/en.json +29 -5
- package/dist/locales/es.json +29 -5
- package/dist/locales/fr.json +29 -5
- package/dist/locales/hi.json +29 -5
- package/dist/locales/it.json +29 -5
- package/dist/locales/ja.json +29 -5
- package/dist/locales/nl.json +29 -5
- package/dist/locales/pl.json +29 -5
- package/dist/locales/pt.json +29 -5
- package/dist/locales/ro.json +29 -5
- package/dist/locales/ru.json +29 -5
- package/dist/locales/sq.json +29 -5
- package/dist/locales/sv.json +29 -5
- package/dist/locales/tr.json +29 -5
- package/dist/locales/zh.json +29 -5
- package/dist/patterns/calendar/calendar-appointment-details.d.ts +15 -6
- package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +23 -23
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-info-hover.d.ts +18 -0
- package/dist/patterns/calendar/calendar-info-hover.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +10 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +2 -2
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/calendar-workspace-Duv_5B4j.js +0 -9471
- package/dist/_chunks/calendar-workspace-Duv_5B4j.js.map +0 -1
- package/dist/_chunks/hourglass-BEAzW1wE.js +0 -26
- package/dist/_chunks/hourglass-BEAzW1wE.js.map +0 -1
- package/dist/_chunks/money.agent-Dw55UxUA.js.map +0 -1
- package/dist/_chunks/notes-panel-Co8D3uDd.js +0 -469
- package/dist/_chunks/notes-panel-Co8D3uDd.js.map +0 -1
- package/dist/_chunks/patient-field-row-BQZoP4m2.js.map +0 -1
- package/dist/_chunks/smartphone-C0rFF2if.js +0 -15
- package/dist/_chunks/smartphone-C0rFF2if.js.map +0 -1
- package/dist/_chunks/task-card-BalrLkSz.js.map +0 -1
- package/dist/_chunks/tool-rail-Bq5eiFMG.js.map +0 -1
- package/dist/_chunks/workflow-map-D-LEni11.js.map +0 -1
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n, Fragment as We } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Oe, useRef as f, useState as C, useId as Ge, useCallback as x, useEffect as ue, useImperativeHandle as Ye, useMemo as Je } from "react";
|
|
3
|
+
import { c as Qe } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Ue } from "react-i18next";
|
|
5
|
+
import { u as Xe } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { C as Ze } from "./clinical-note-card-DdsGYMmI.js";
|
|
7
|
+
import { R as $e } from "./rich-text-editor-BTXlorm5.js";
|
|
8
|
+
import { T as et } from "./text-area-Bt3p7Pt0.js";
|
|
9
|
+
import { A as j } from "./alert-CiQ5Pa3Q.js";
|
|
10
|
+
import { B as S } from "./button-nJaPh_HC.js";
|
|
11
|
+
import { I as fe } from "./icon-button-8xqRnkdG.js";
|
|
12
|
+
import { C as tt } from "./checkbox-CZkipDn7.js";
|
|
13
|
+
import { S as nt } from "./spinner-hbwuKwMf.js";
|
|
14
|
+
import { D as h } from "./dialog-BJiLqhx6.js";
|
|
15
|
+
import { P as it } from "./panel-header-D_mTdhUp.js";
|
|
16
|
+
import { a as at, u as rt, R as lt } from "./use-list-reflow-Cw43nxw5.js";
|
|
17
|
+
import { u as st } from "./use-theme-CAuo6EYT.js";
|
|
18
|
+
import { N as ot } from "./notebook-pen-CO7HoM-W.js";
|
|
19
|
+
import { P as dt } from "./pencil-B1sKKyuT.js";
|
|
20
|
+
import { T as ct } from "./trash-2-uumy3fy1.js";
|
|
21
|
+
function pe(a, c) {
|
|
22
|
+
return typeof a == "object" && a !== null && "message" in a && typeof a.message == "string" && a.message.trim() ? a.message : c;
|
|
23
|
+
}
|
|
24
|
+
const ut = {
|
|
25
|
+
id: "notes-panel",
|
|
26
|
+
// 'submit' backs add_note (compose + commit a note). pin / flag are toggles
|
|
27
|
+
// with no dedicated capability in the closed vocabulary.
|
|
28
|
+
capabilities: ["submit"],
|
|
29
|
+
state: {
|
|
30
|
+
notes: {
|
|
31
|
+
type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
|
|
32
|
+
descriptionKey: "ui.agent.notesPanel.state.notes",
|
|
33
|
+
description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
|
|
34
|
+
read: (a) => a.getNotes()
|
|
35
|
+
},
|
|
36
|
+
canAddClinical: {
|
|
37
|
+
type: "boolean",
|
|
38
|
+
descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
|
|
39
|
+
description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
|
|
40
|
+
read: (a) => a.canAddClinical()
|
|
41
|
+
},
|
|
42
|
+
currentNoteId: {
|
|
43
|
+
type: "string | null",
|
|
44
|
+
descriptionKey: "ui.agent.notesPanel.state.currentNoteId",
|
|
45
|
+
description: "Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.",
|
|
46
|
+
read: (a) => a.getCurrentNoteId()
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
actions: {
|
|
50
|
+
add_note: {
|
|
51
|
+
// Writes a clinical/admin note body — patient-identifiable content. PHI.
|
|
52
|
+
safety: "phi",
|
|
53
|
+
argsType: "{ content: string; clinical: boolean }",
|
|
54
|
+
argsSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
content: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Note body. Rich HTML for the rich composer, else plain text."
|
|
60
|
+
},
|
|
61
|
+
clinical: {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: ["content", "clinical"]
|
|
67
|
+
},
|
|
68
|
+
openWorld: !0,
|
|
69
|
+
descriptionKey: "ui.agent.notesPanel.actions.addNote",
|
|
70
|
+
description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
|
|
71
|
+
examples: [
|
|
72
|
+
{
|
|
73
|
+
args: { content: "Patient reported improvement.", clinical: !0 },
|
|
74
|
+
note: "Add a clinical note."
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
invoke: (a, c) => a.addNote(c)
|
|
78
|
+
},
|
|
79
|
+
toggle_pin: {
|
|
80
|
+
// Re-orders the timeline (pinned notes lead) — reversible view write.
|
|
81
|
+
safety: "write",
|
|
82
|
+
argsType: "{ id: string }",
|
|
83
|
+
argsSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: { id: { type: "string" } },
|
|
86
|
+
required: ["id"]
|
|
87
|
+
},
|
|
88
|
+
idempotent: !1,
|
|
89
|
+
descriptionKey: "ui.agent.notesPanel.actions.togglePin",
|
|
90
|
+
description: "Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.",
|
|
91
|
+
invoke: (a, c) => {
|
|
92
|
+
a.togglePin(c.id);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
toggle_flag: {
|
|
96
|
+
safety: "write",
|
|
97
|
+
argsType: "{ id: string }",
|
|
98
|
+
argsSchema: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: { id: { type: "string" } },
|
|
101
|
+
required: ["id"]
|
|
102
|
+
},
|
|
103
|
+
idempotent: !1,
|
|
104
|
+
descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
|
|
105
|
+
description: "Toggle the flagged state of the note with the given id.",
|
|
106
|
+
invoke: (a, c) => {
|
|
107
|
+
a.toggleFlag(c.id);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
domHooks: {
|
|
112
|
+
root: {
|
|
113
|
+
attr: "data-component",
|
|
114
|
+
value: "notes-panel",
|
|
115
|
+
description: "Marks the NotesPanel region."
|
|
116
|
+
},
|
|
117
|
+
instanceId: {
|
|
118
|
+
attr: "data-component-id",
|
|
119
|
+
sourceProp: "id",
|
|
120
|
+
description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}, ft = Qe(
|
|
124
|
+
"ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]",
|
|
125
|
+
{
|
|
126
|
+
variants: {
|
|
127
|
+
current: {
|
|
128
|
+
true: "ds:border-[color:var(--info)] ds:bg-[color:var(--info)]/10 ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]",
|
|
129
|
+
false: "ds:border-transparent"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
defaultVariants: { current: !1 }
|
|
133
|
+
}
|
|
134
|
+
), pt = "ds:opacity-0", mt = [
|
|
135
|
+
"ds:transition-opacity ds:duration-[var(--animation-duration)]",
|
|
136
|
+
"ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
|
|
137
|
+
].join(" ");
|
|
138
|
+
function me(a) {
|
|
139
|
+
return a ? /<img\b/i.test(a) ? !0 : a.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim().length > 0 : !1;
|
|
140
|
+
}
|
|
141
|
+
const Ht = Oe(
|
|
142
|
+
function({
|
|
143
|
+
id: c,
|
|
144
|
+
notes: z,
|
|
145
|
+
onAddNote: p,
|
|
146
|
+
status: M = "ready",
|
|
147
|
+
onRetry: X,
|
|
148
|
+
currentNoteId: y,
|
|
149
|
+
currentNoteKey: ge,
|
|
150
|
+
composer: m = "rich",
|
|
151
|
+
editorToolbar: he = "standard",
|
|
152
|
+
redactor: ve,
|
|
153
|
+
imageUploadUrl: ye,
|
|
154
|
+
showClinicalToggle: be = !0,
|
|
155
|
+
canAddClinicalNote: N = !0,
|
|
156
|
+
clinicalGatedReason: Pe,
|
|
157
|
+
defaultClinical: w = !1,
|
|
158
|
+
onRequestAiDraft: Ce,
|
|
159
|
+
aiDraftFormat: xe,
|
|
160
|
+
aiPrivacyNotice: we,
|
|
161
|
+
onDictate: Re,
|
|
162
|
+
onProofread: Ve,
|
|
163
|
+
onAutoFormat: ke,
|
|
164
|
+
onTogglePin: A,
|
|
165
|
+
onToggleFlag: H,
|
|
166
|
+
noteActions: Z,
|
|
167
|
+
onEditNote: R,
|
|
168
|
+
editClinical: Te = !1,
|
|
169
|
+
onDeleteNote: g,
|
|
170
|
+
confirmDelete: W = !0,
|
|
171
|
+
title: Ie,
|
|
172
|
+
composerPlaceholder: Ee,
|
|
173
|
+
addNoteLabel: je,
|
|
174
|
+
emptyState: Se,
|
|
175
|
+
className: ze,
|
|
176
|
+
"aria-label": O,
|
|
177
|
+
...Ne
|
|
178
|
+
}, Ae) {
|
|
179
|
+
const { t: i, i18n: $ } = Ue(), v = f(null), [b, V] = C(""), [L, _] = C(w), [u, ee] = C(!1), [te, k] = C(null), [l, G] = C(null), He = Ie ?? i("notesPanel.title", { defaultValue: "Notes" }), ne = Ge(), ie = Ee ?? i("notesPanel.placeholder", { defaultValue: "Add a note…" }), ae = l !== null ? i("notesPanel.edit", { defaultValue: "Edit note" }) : i("notesPanel.composerLabel", { defaultValue: "New note" }), Le = m === "rich" ? me(b) : b.trim().length > 0, _e = x(() => {
|
|
180
|
+
var E;
|
|
181
|
+
if (!(l !== null ? R : p) || u) return;
|
|
182
|
+
const t = m === "rich", o = t ? ((E = v.current) == null ? void 0 : E.getHTML()) ?? b : b.trim();
|
|
183
|
+
if (t ? !me(o) : !o) return;
|
|
184
|
+
const s = () => {
|
|
185
|
+
var P;
|
|
186
|
+
t && ((P = v.current) == null || P.clear()), V(""), _(w), G(null);
|
|
187
|
+
};
|
|
188
|
+
k(null);
|
|
189
|
+
let r;
|
|
190
|
+
try {
|
|
191
|
+
r = l !== null && R ? R(l, { content: o, clinical: L }) : p == null ? void 0 : p({ content: o, clinical: L });
|
|
192
|
+
} catch (P) {
|
|
193
|
+
k(pe(P, i("notesPanel.addFailed")));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!r || typeof r.then != "function") return s();
|
|
197
|
+
ee(!0), Promise.resolve(r).then(
|
|
198
|
+
s,
|
|
199
|
+
(P) => k(pe(P, i("notesPanel.addFailed")))
|
|
200
|
+
).finally(() => ee(!1));
|
|
201
|
+
}, [
|
|
202
|
+
m,
|
|
203
|
+
b,
|
|
204
|
+
L,
|
|
205
|
+
w,
|
|
206
|
+
l,
|
|
207
|
+
p,
|
|
208
|
+
R,
|
|
209
|
+
u,
|
|
210
|
+
i
|
|
211
|
+
]), re = be && (l === null || Te), le = x(
|
|
212
|
+
(e) => {
|
|
213
|
+
try {
|
|
214
|
+
return new Intl.DateTimeFormat($.language, {
|
|
215
|
+
day: "numeric",
|
|
216
|
+
month: "long",
|
|
217
|
+
year: "numeric",
|
|
218
|
+
hour: "2-digit",
|
|
219
|
+
minute: "2-digit"
|
|
220
|
+
}).format(new Date(e.dateIso));
|
|
221
|
+
} catch {
|
|
222
|
+
return e.dateIso;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
[$.language]
|
|
226
|
+
), Be = x(
|
|
227
|
+
(e) => {
|
|
228
|
+
var o, s, r;
|
|
229
|
+
if (!e.id || u) return;
|
|
230
|
+
const t = e.content ?? "";
|
|
231
|
+
k(null), G(e.id), _(e.clinical ?? !1), V(t), m === "rich" && ((o = v.current) == null || o.clear(), (s = v.current) == null || s.insertAtCursor(t, { asHtml: !0 })), (r = v.current) == null || r.focus();
|
|
232
|
+
},
|
|
233
|
+
[m, u]
|
|
234
|
+
), B = x(() => {
|
|
235
|
+
var e;
|
|
236
|
+
m === "rich" && ((e = v.current) == null || e.clear()), V(""), _(w), k(null), G(null);
|
|
237
|
+
}, [m, w]), se = l === null || z.some((e) => e.id === l && !e.deleted);
|
|
238
|
+
ue(() => {
|
|
239
|
+
se || B();
|
|
240
|
+
}, [se, B]);
|
|
241
|
+
const Y = [...z].sort(
|
|
242
|
+
(e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
|
|
243
|
+
), { resolvedTheme: De } = st(), oe = De.endsWith("-accessible") || void 0, { containerRef: qe } = at({
|
|
244
|
+
key: Y.map((e) => e.id).join(),
|
|
245
|
+
reduceMotion: oe
|
|
246
|
+
}), T = rt({ reduceMotion: oe }), [D, q] = C(null), Fe = x(
|
|
247
|
+
(e) => {
|
|
248
|
+
g && (W ? q(e) : T.leave(e, () => g(e)));
|
|
249
|
+
},
|
|
250
|
+
[W, T, g]
|
|
251
|
+
), Ke = x(() => {
|
|
252
|
+
if (!D || !g) return;
|
|
253
|
+
const e = D;
|
|
254
|
+
q(null), T.leave(e, () => g(e));
|
|
255
|
+
}, [D, g, T]), J = f(null);
|
|
256
|
+
ue(() => {
|
|
257
|
+
var e, t;
|
|
258
|
+
y && ((e = J.current) == null || e.scrollIntoView({ block: "center" }), (t = J.current) == null || t.focus());
|
|
259
|
+
}, [y, ge]);
|
|
260
|
+
const Q = f(z);
|
|
261
|
+
Q.current = z;
|
|
262
|
+
const I = f(p);
|
|
263
|
+
I.current = p;
|
|
264
|
+
const F = f(A);
|
|
265
|
+
F.current = A;
|
|
266
|
+
const K = f(H);
|
|
267
|
+
K.current = H;
|
|
268
|
+
const U = f(N);
|
|
269
|
+
U.current = N;
|
|
270
|
+
const de = f(y);
|
|
271
|
+
de.current = y;
|
|
272
|
+
const ce = f(null);
|
|
273
|
+
Ye(Ae, () => ce.current, []);
|
|
274
|
+
const Me = Je(
|
|
275
|
+
() => ({
|
|
276
|
+
// Ids + flags only — never the note body or author (both PHI).
|
|
277
|
+
getNotes: () => Q.current.map((e) => ({
|
|
278
|
+
id: e.id,
|
|
279
|
+
pinned: !!e.pinned,
|
|
280
|
+
flagged: !!e.flagged,
|
|
281
|
+
clinical: !!e.clinical
|
|
282
|
+
})),
|
|
283
|
+
canAddNote: () => !!I.current,
|
|
284
|
+
canAddClinical: () => U.current,
|
|
285
|
+
getCurrentNoteId: () => de.current ?? null,
|
|
286
|
+
addNote: (e) => {
|
|
287
|
+
var t;
|
|
288
|
+
if (!(e.clinical && !U.current))
|
|
289
|
+
return (t = I.current) == null ? void 0 : t.call(I, e);
|
|
290
|
+
},
|
|
291
|
+
togglePin: (e) => {
|
|
292
|
+
var o, s;
|
|
293
|
+
const t = Q.current.find((r) => r.id === e);
|
|
294
|
+
t && (t.deleted || ((o = t.actions) == null ? void 0 : o.pin) === !1) || (s = F.current) == null || s.call(F, e);
|
|
295
|
+
},
|
|
296
|
+
toggleFlag: (e) => {
|
|
297
|
+
var t;
|
|
298
|
+
return (t = K.current) == null ? void 0 : t.call(K, e);
|
|
299
|
+
}
|
|
300
|
+
}),
|
|
301
|
+
[]
|
|
302
|
+
);
|
|
303
|
+
return Xe(ut, Me, c), /* @__PURE__ */ d(
|
|
304
|
+
"section",
|
|
305
|
+
{
|
|
306
|
+
ref: ce,
|
|
307
|
+
"data-component": "notes-panel",
|
|
308
|
+
"data-component-id": c,
|
|
309
|
+
"aria-labelledby": O ? void 0 : ne,
|
|
310
|
+
"aria-label": O,
|
|
311
|
+
className: ["ds:flex ds:flex-col", ze].filter(Boolean).join(" "),
|
|
312
|
+
...Ne,
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ n(
|
|
315
|
+
it,
|
|
316
|
+
{
|
|
317
|
+
title: He,
|
|
318
|
+
icon: /* @__PURE__ */ n(ot, { "aria-hidden": "true" }),
|
|
319
|
+
headingId: O ? void 0 : ne,
|
|
320
|
+
sticky: !0,
|
|
321
|
+
divider: !0
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
325
|
+
p || l !== null ? /* @__PURE__ */ d(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
"data-notes-panel-composer": l !== null ? "edit" : "add",
|
|
329
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
330
|
+
children: [
|
|
331
|
+
m === "rich" ? /* @__PURE__ */ n(
|
|
332
|
+
$e,
|
|
333
|
+
{
|
|
334
|
+
ref: v,
|
|
335
|
+
ariaLabel: ae,
|
|
336
|
+
placeholder: ie,
|
|
337
|
+
toolbar: he,
|
|
338
|
+
minHeight: "fill",
|
|
339
|
+
redactor: ve,
|
|
340
|
+
imageUploadUrl: ye,
|
|
341
|
+
readOnly: u,
|
|
342
|
+
onChange: ({ html: e }) => V(e),
|
|
343
|
+
onRequestAiDraft: Ce,
|
|
344
|
+
aiDraftFormat: xe,
|
|
345
|
+
aiPrivacyNotice: we,
|
|
346
|
+
onDictate: Re,
|
|
347
|
+
onProofread: Ve,
|
|
348
|
+
onAutoFormat: ke
|
|
349
|
+
}
|
|
350
|
+
) : /* @__PURE__ */ n(
|
|
351
|
+
et,
|
|
352
|
+
{
|
|
353
|
+
value: b,
|
|
354
|
+
readOnly: u,
|
|
355
|
+
onChange: (e) => V(e.target.value),
|
|
356
|
+
placeholder: ie,
|
|
357
|
+
autoResize: !0,
|
|
358
|
+
minRows: 2,
|
|
359
|
+
maxRows: 6,
|
|
360
|
+
"aria-label": ae
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
/* @__PURE__ */ d(
|
|
364
|
+
"div",
|
|
365
|
+
{
|
|
366
|
+
className: [
|
|
367
|
+
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
368
|
+
re ? "ds:justify-between" : "ds:justify-end"
|
|
369
|
+
].join(" "),
|
|
370
|
+
children: [
|
|
371
|
+
re ? /* @__PURE__ */ n(
|
|
372
|
+
tt,
|
|
373
|
+
{
|
|
374
|
+
size: "sm",
|
|
375
|
+
label: i("notesPanel.clinicalToggle", {
|
|
376
|
+
defaultValue: "Clinical note"
|
|
377
|
+
}),
|
|
378
|
+
checked: L,
|
|
379
|
+
onCheckedChange: (e) => _(e === !0),
|
|
380
|
+
disabled: u || !N,
|
|
381
|
+
disabledReason: N ? void 0 : Pe ?? i("notesPanel.clinicalGated", {
|
|
382
|
+
defaultValue: "You do not have permission to write clinical notes."
|
|
383
|
+
})
|
|
384
|
+
}
|
|
385
|
+
) : null,
|
|
386
|
+
/* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
387
|
+
l !== null ? /* @__PURE__ */ n(
|
|
388
|
+
S,
|
|
389
|
+
{
|
|
390
|
+
type: "button",
|
|
391
|
+
size: "sm",
|
|
392
|
+
intent: "ghost",
|
|
393
|
+
onClick: B,
|
|
394
|
+
disabled: u,
|
|
395
|
+
children: i("notesPanel.cancelEdit", { defaultValue: "Cancel" })
|
|
396
|
+
}
|
|
397
|
+
) : null,
|
|
398
|
+
/* @__PURE__ */ n(
|
|
399
|
+
S,
|
|
400
|
+
{
|
|
401
|
+
type: "button",
|
|
402
|
+
size: "sm",
|
|
403
|
+
onClick: _e,
|
|
404
|
+
disabled: !Le,
|
|
405
|
+
loading: u,
|
|
406
|
+
children: l !== null ? i("notesPanel.saveEdit", { defaultValue: "Save note" }) : je ?? i("notesPanel.add", { defaultValue: "Add note" })
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] })
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
te ? /* @__PURE__ */ n(j, { variant: "error", children: /* @__PURE__ */ n(j.Description, { children: te }) }) : null
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
) : null,
|
|
417
|
+
M === "loading" ? /* @__PURE__ */ d("p", { className: "ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]", children: [
|
|
418
|
+
/* @__PURE__ */ n(nt, { size: "sm", label: i("notesPanel.loading") }),
|
|
419
|
+
/* @__PURE__ */ n("span", { "aria-hidden": "true", children: i("notesPanel.loading") })
|
|
420
|
+
] }) : M === "error" ? /* @__PURE__ */ d(j, { variant: "error", children: [
|
|
421
|
+
/* @__PURE__ */ n(j.Description, { children: i("notesPanel.loadError") }),
|
|
422
|
+
X ? /* @__PURE__ */ n(j.Action, { children: /* @__PURE__ */ n(S, { intent: "secondary", size: "sm", onClick: X, children: i("notesPanel.retry") }) }) : null
|
|
423
|
+
] }) : null,
|
|
424
|
+
Y.length > 0 ? /* @__PURE__ */ n(
|
|
425
|
+
"ul",
|
|
426
|
+
{
|
|
427
|
+
ref: qe,
|
|
428
|
+
className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
|
|
429
|
+
children: Y.map(({ actions: e, ...t }, o) => {
|
|
430
|
+
const s = y != null && t.id === y, r = t.id, E = r != null && T.isLeaving(r);
|
|
431
|
+
return /* @__PURE__ */ d(
|
|
432
|
+
"li",
|
|
433
|
+
{
|
|
434
|
+
ref: s ? J : void 0,
|
|
435
|
+
tabIndex: s ? -1 : void 0,
|
|
436
|
+
"aria-current": s ? "true" : void 0,
|
|
437
|
+
"data-reflow-id": r,
|
|
438
|
+
"data-leaving": E ? "" : void 0,
|
|
439
|
+
"data-editing": l === r ? "" : void 0,
|
|
440
|
+
className: [
|
|
441
|
+
ft({
|
|
442
|
+
current: s || l === r
|
|
443
|
+
}),
|
|
444
|
+
mt,
|
|
445
|
+
lt,
|
|
446
|
+
E ? pt : ""
|
|
447
|
+
].filter(Boolean).join(" "),
|
|
448
|
+
children: [
|
|
449
|
+
s ? /* @__PURE__ */ n("span", { className: "ds:sr-only", children: i("notesPanel.current", {
|
|
450
|
+
defaultValue: "Current note"
|
|
451
|
+
}) }) : null,
|
|
452
|
+
/* @__PURE__ */ n(
|
|
453
|
+
Ze,
|
|
454
|
+
{
|
|
455
|
+
surface: "elevated",
|
|
456
|
+
truncate: !s,
|
|
457
|
+
headerActions: /* @__PURE__ */ d(We, { children: [
|
|
458
|
+
Z ? Z({ ...t, actions: e }) : null,
|
|
459
|
+
R && r && !t.deleted && (e == null ? void 0 : e.edit) !== !1 ? /* @__PURE__ */ n(
|
|
460
|
+
fe,
|
|
461
|
+
{
|
|
462
|
+
icon: /* @__PURE__ */ n(dt, {}),
|
|
463
|
+
intent: "ghost",
|
|
464
|
+
size: "sm",
|
|
465
|
+
"aria-label": i("notesPanel.editNamed", {
|
|
466
|
+
date: le(t),
|
|
467
|
+
defaultValue: "Edit note · {{date}}"
|
|
468
|
+
}),
|
|
469
|
+
tooltip: i("notesPanel.edit", {
|
|
470
|
+
defaultValue: "Edit note"
|
|
471
|
+
}),
|
|
472
|
+
"aria-pressed": l === r,
|
|
473
|
+
disabled: u,
|
|
474
|
+
"data-notes-panel-edit": "",
|
|
475
|
+
onClick: () => l === r ? B() : Be(t)
|
|
476
|
+
}
|
|
477
|
+
) : null,
|
|
478
|
+
g && r && !t.deleted ? /* @__PURE__ */ n(
|
|
479
|
+
fe,
|
|
480
|
+
{
|
|
481
|
+
icon: /* @__PURE__ */ n(ct, {}),
|
|
482
|
+
intent: "ghost",
|
|
483
|
+
size: "sm",
|
|
484
|
+
"aria-label": i("notesPanel.deleteNamed", {
|
|
485
|
+
date: le(t),
|
|
486
|
+
defaultValue: "Delete note · {{date}}"
|
|
487
|
+
}),
|
|
488
|
+
tooltip: i("notesPanel.delete", {
|
|
489
|
+
defaultValue: "Delete note"
|
|
490
|
+
}),
|
|
491
|
+
onClick: () => Fe(r)
|
|
492
|
+
}
|
|
493
|
+
) : null
|
|
494
|
+
] }),
|
|
495
|
+
...t,
|
|
496
|
+
onTogglePin: A && t.id && (e == null ? void 0 : e.pin) !== !1 && !t.deleted ? () => A(t.id) : void 0,
|
|
497
|
+
onToggleFlag: H && t.id ? () => H(t.id) : void 0
|
|
498
|
+
}
|
|
499
|
+
)
|
|
500
|
+
]
|
|
501
|
+
},
|
|
502
|
+
t.id ?? o
|
|
503
|
+
);
|
|
504
|
+
})
|
|
505
|
+
}
|
|
506
|
+
) : M !== "ready" ? null : Se ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: i("notesPanel.empty", { defaultValue: "No notes yet." }) })
|
|
507
|
+
] }),
|
|
508
|
+
g && W ? /* @__PURE__ */ n(
|
|
509
|
+
h,
|
|
510
|
+
{
|
|
511
|
+
open: D !== null,
|
|
512
|
+
onOpenChange: (e) => !e && q(null),
|
|
513
|
+
children: /* @__PURE__ */ d(h.Content, { variant: "alert", size: "sm", children: [
|
|
514
|
+
/* @__PURE__ */ n(h.Header, { children: /* @__PURE__ */ n(h.Title, { children: i("notesPanel.deleteConfirmTitle", {
|
|
515
|
+
defaultValue: "Delete this note?"
|
|
516
|
+
}) }) }),
|
|
517
|
+
/* @__PURE__ */ n(h.Body, { children: /* @__PURE__ */ n(h.Description, { children: i("notesPanel.deleteConfirmBody", {
|
|
518
|
+
defaultValue: "The note will be removed from the record."
|
|
519
|
+
}) }) }),
|
|
520
|
+
/* @__PURE__ */ d(h.Footer, { children: [
|
|
521
|
+
/* @__PURE__ */ n(h.Close, { asChild: !0, children: /* @__PURE__ */ n(
|
|
522
|
+
S,
|
|
523
|
+
{
|
|
524
|
+
intent: "secondary",
|
|
525
|
+
size: "sm",
|
|
526
|
+
onClick: () => q(null),
|
|
527
|
+
children: i("notesPanel.deleteConfirmCancel", {
|
|
528
|
+
defaultValue: "Cancel"
|
|
529
|
+
})
|
|
530
|
+
}
|
|
531
|
+
) }),
|
|
532
|
+
/* @__PURE__ */ n(
|
|
533
|
+
S,
|
|
534
|
+
{
|
|
535
|
+
intent: "destructive",
|
|
536
|
+
size: "sm",
|
|
537
|
+
onClick: Ke,
|
|
538
|
+
children: i("notesPanel.deleteConfirmAction", {
|
|
539
|
+
defaultValue: "Delete"
|
|
540
|
+
})
|
|
541
|
+
}
|
|
542
|
+
)
|
|
543
|
+
] })
|
|
544
|
+
] })
|
|
545
|
+
}
|
|
546
|
+
) : null
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
export {
|
|
553
|
+
Ht as N,
|
|
554
|
+
pe as g
|
|
555
|
+
};
|
|
556
|
+
//# sourceMappingURL=notes-panel-4y5JioWN.js.map
|