@alfadocs/ui-kit-debug 1.37.0 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/_chunks/{agenda-tray-DYGCTIWB.js → agenda-tray-CG6jUjKc.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-DYGCTIWB.js.map → agenda-tray-CG6jUjKc.js.map} +1 -1
  3. package/dist/_chunks/{anamnesis-summary-card-GYHa7VGp.js → anamnesis-summary-card-CclBbiXg.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-card-GYHa7VGp.js.map → anamnesis-summary-card-CclBbiXg.js.map} +1 -1
  5. package/dist/_chunks/{appointment-timeline-ByfovxqR.js → appointment-timeline-D-rNwKpS.js} +2 -2
  6. package/dist/_chunks/{appointment-timeline-ByfovxqR.js.map → appointment-timeline-D-rNwKpS.js.map} +1 -1
  7. package/dist/_chunks/{appointment-tray-D6UyJHej.js → appointment-tray-CK2CULg_.js} +2 -2
  8. package/dist/_chunks/{appointment-tray-D6UyJHej.js.map → appointment-tray-CK2CULg_.js.map} +1 -1
  9. package/dist/_chunks/{balance-badge-cell-B0Z8Dwn8.js → balance-badge-cell-DHs5p0bA.js} +2 -2
  10. package/dist/_chunks/{balance-badge-cell-B0Z8Dwn8.js.map → balance-badge-cell-DHs5p0bA.js.map} +1 -1
  11. package/dist/_chunks/{booking-Dp-9qR6F.js → booking-x3J7sS2G.js} +3 -3
  12. package/dist/_chunks/{booking-Dp-9qR6F.js.map → booking-x3J7sS2G.js.map} +1 -1
  13. package/dist/_chunks/{calendar-workspace-BqKBj26r.js → calendar-workspace-Cc1LRVWY.js} +1665 -1480
  14. package/dist/_chunks/calendar-workspace-Cc1LRVWY.js.map +1 -0
  15. package/dist/_chunks/{data-table-BYGK-gUJ.js → data-table-Dy1lyumT.js} +2 -2
  16. package/dist/_chunks/{data-table-BYGK-gUJ.js.map → data-table-Dy1lyumT.js.map} +1 -1
  17. package/dist/_chunks/editable-description-7ptNpJEg.js +142 -0
  18. package/dist/_chunks/editable-description-7ptNpJEg.js.map +1 -0
  19. package/dist/_chunks/{file-manager-DvkFgj7d.js → file-manager-UlcYQv8n.js} +3 -3
  20. package/dist/_chunks/{file-manager-DvkFgj7d.js.map → file-manager-UlcYQv8n.js.map} +1 -1
  21. package/dist/_chunks/{message-tray-BcLyaO-G.js → message-tray-CXjVsKqp.js} +2 -2
  22. package/dist/_chunks/{message-tray-BcLyaO-G.js.map → message-tray-CXjVsKqp.js.map} +1 -1
  23. package/dist/_chunks/{note-timeline-CXfSV3yX.js → note-timeline-D2oPuQP6.js} +134 -73
  24. package/dist/_chunks/note-timeline-D2oPuQP6.js.map +1 -0
  25. package/dist/_chunks/notes-panel-CkbfDDzj.js +614 -0
  26. package/dist/_chunks/notes-panel-CkbfDDzj.js.map +1 -0
  27. package/dist/_chunks/{notification-tray-CJ8jOe-U.js → notification-tray-_NoChRKi.js} +2 -2
  28. package/dist/_chunks/{notification-tray-CJ8jOe-U.js.map → notification-tray-_NoChRKi.js.map} +1 -1
  29. package/dist/_chunks/{patient-summary-card-BzmJH9a-.js → patient-summary-card-B131Q7Bp.js} +2 -2
  30. package/dist/_chunks/{patient-summary-card-BzmJH9a-.js.map → patient-summary-card-B131Q7Bp.js.map} +1 -1
  31. package/dist/_chunks/{practice-results-DOcORTkP.js → practice-results-CBNRJNnY.js} +2 -2
  32. package/dist/_chunks/{practice-results-DOcORTkP.js.map → practice-results-CBNRJNnY.js.map} +1 -1
  33. package/dist/_chunks/{product-hub-panel-C0TO69P7.js → product-hub-panel-C3bMjscm.js} +2 -2
  34. package/dist/_chunks/{product-hub-panel-C0TO69P7.js.map → product-hub-panel-C3bMjscm.js.map} +1 -1
  35. package/dist/_chunks/{reviews-panel-BaHZb_ai.js → reviews-panel-Cy969x7q.js} +2 -2
  36. package/dist/_chunks/{reviews-panel-BaHZb_ai.js.map → reviews-panel-Cy969x7q.js.map} +1 -1
  37. package/dist/_chunks/{signature-request-Dej2g86d.js → signature-request-b-86AGlT.js} +2 -2
  38. package/dist/_chunks/{signature-request-Dej2g86d.js.map → signature-request-b-86AGlT.js.map} +1 -1
  39. package/dist/_chunks/{skeleton-CZbwyJAA.js → skeleton-B1KTdJ4N.js} +46 -33
  40. package/dist/_chunks/skeleton-B1KTdJ4N.js.map +1 -0
  41. package/dist/_chunks/{slot-grid-8Ko6thzz.js → slot-grid-Bk3GZL1p.js} +2 -2
  42. package/dist/_chunks/{slot-grid-8Ko6thzz.js.map → slot-grid-Bk3GZL1p.js.map} +1 -1
  43. package/dist/_chunks/{task-tray-CQ8UAR2j.js → task-tray-5co9Jr2L.js} +2 -2
  44. package/dist/_chunks/{task-tray-CQ8UAR2j.js.map → task-tray-5co9Jr2L.js.map} +1 -1
  45. package/dist/_chunks/{tasks-panel-CBGMtQ_f.js → tasks-panel-BpH-x7U3.js} +2 -2
  46. package/dist/_chunks/{tasks-panel-CBGMtQ_f.js.map → tasks-panel-BpH-x7U3.js.map} +1 -1
  47. package/dist/_chunks/treatment-receipt-dUm99mdn.js +160 -0
  48. package/dist/_chunks/treatment-receipt-dUm99mdn.js.map +1 -0
  49. package/dist/agent-catalog.json +1 -1
  50. package/dist/components/agenda-tray/index.js +1 -1
  51. package/dist/components/anamnesis-summary-card/index.js +1 -1
  52. package/dist/components/appointment-card/index.js +1 -1
  53. package/dist/components/appointment-timeline/index.js +1 -1
  54. package/dist/components/booking/index.js +1 -1
  55. package/dist/components/data-table/index.js +1 -1
  56. package/dist/components/editable-description/editable-description.d.ts +6 -0
  57. package/dist/components/editable-description/editable-description.d.ts.map +1 -1
  58. package/dist/components/editable-description/index.js +1 -1
  59. package/dist/components/file-manager/index.js +1 -1
  60. package/dist/components/message-tray/index.js +1 -1
  61. package/dist/components/note-timeline/index.js +1 -1
  62. package/dist/components/note-timeline/note-timeline.d.ts +8 -0
  63. package/dist/components/note-timeline/note-timeline.d.ts.map +1 -1
  64. package/dist/components/notes-panel/index.js +1 -1
  65. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  66. package/dist/components/notification-tray/index.js +1 -1
  67. package/dist/components/patient-summary-card/index.js +1 -1
  68. package/dist/components/patient-table/index.js +1 -1
  69. package/dist/components/practice-results/index.js +1 -1
  70. package/dist/components/product-hub-tray/index.js +1 -1
  71. package/dist/components/reviews-panel/index.js +1 -1
  72. package/dist/components/skeleton/index.d.ts +1 -1
  73. package/dist/components/skeleton/index.d.ts.map +1 -1
  74. package/dist/components/skeleton/index.js +3 -2
  75. package/dist/components/skeleton/skeleton.d.ts +12 -0
  76. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  77. package/dist/components/slot-grid/index.js +1 -1
  78. package/dist/components/task-tray/index.js +1 -1
  79. package/dist/components/tasks-panel/index.js +1 -1
  80. package/dist/components/treatment-receipt/index.js +1 -1
  81. package/dist/components/treatment-receipt/treatment-receipt.d.ts +8 -0
  82. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -1
  83. package/dist/index.js +755 -754
  84. package/dist/patterns/calendar/calendar-appointment-details.d.ts +1 -1
  85. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  86. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +0 -2
  87. package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -1
  88. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  89. package/dist/patterns/calendar/index.js +1 -1
  90. package/dist/patterns/signature-request/index.js +1 -1
  91. package/dist/tokens.css +1 -1
  92. package/package.json +1 -1
  93. package/dist/_chunks/calendar-workspace-BqKBj26r.js.map +0 -1
  94. package/dist/_chunks/editable-description-BOfAeY3T.js +0 -112
  95. package/dist/_chunks/editable-description-BOfAeY3T.js.map +0 -1
  96. package/dist/_chunks/note-timeline-CXfSV3yX.js.map +0 -1
  97. package/dist/_chunks/notes-panel-4y5JioWN.js +0 -556
  98. package/dist/_chunks/notes-panel-4y5JioWN.js.map +0 -1
  99. package/dist/_chunks/skeleton-CZbwyJAA.js.map +0 -1
  100. package/dist/_chunks/treatment-receipt-D4kOLXOk.js +0 -94
  101. package/dist/_chunks/treatment-receipt-D4kOLXOk.js.map +0 -1
@@ -1,556 +0,0 @@
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(/&nbsp;/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