@alfadocs/ui-kit 1.43.0 → 1.44.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 (105) hide show
  1. package/dist/_chunks/{calendar-ChJQzRw-.js → calendar-U6N0F99w.js} +383 -359
  2. package/dist/_chunks/calendar-workspace-DBYAtdyd.js +12161 -0
  3. package/dist/_chunks/{face-scheme-Dg6ZyLKb.js → face-scheme-Bm6pe7R8.js} +265 -275
  4. package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js +741 -0
  5. package/dist/_chunks/{notes-panel-CRAovkjx.js → notes-panel-CY4KmDo-.js} +159 -152
  6. package/dist/_chunks/{panel-subview-PMBRPFOa.js → panel-subview-CYnuX-KR.js} +61 -40
  7. package/dist/_chunks/rich-text-editor-BYE6kK4u.js +3839 -0
  8. package/dist/_chunks/undo-2-CYNAzclj.js +26 -0
  9. package/dist/_chunks/variables-menu-vXUaSBj4.js +401 -0
  10. package/dist/agent-catalog.json +84 -3
  11. package/dist/agent-i18n/en.json +14 -3
  12. package/dist/components/calendar/calendar.d.ts +6 -0
  13. package/dist/components/calendar/index.js +1 -1
  14. package/dist/components/face-scheme/index.js +1 -1
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/notes-panel/index.js +1 -1
  17. package/dist/components/notes-panel/notes-panel.d.ts +4 -0
  18. package/dist/components/panel-subview/index.js +1 -1
  19. package/dist/components/panel-subview/panel-subview.d.ts +6 -0
  20. package/dist/components/rich-text-editor/editor-toolbar.d.ts +35 -3
  21. package/dist/components/rich-text-editor/index.d.ts +1 -1
  22. package/dist/components/rich-text-editor/index.js +1 -1
  23. package/dist/components/rich-text-editor/rich-text-editor.d.ts +98 -15
  24. package/dist/components/variables-menu/index.d.ts +4 -0
  25. package/dist/components/variables-menu/index.js +6 -0
  26. package/dist/components/variables-menu/variables-menu.agent.d.ts +10 -0
  27. package/dist/components/variables-menu/variables-menu.d.ts +53 -0
  28. package/dist/host-compat.css +5 -5
  29. package/dist/i18n/locales/ar.d.ts +77 -6
  30. package/dist/i18n/locales/ar.js +78 -7
  31. package/dist/i18n/locales/de.d.ts +77 -6
  32. package/dist/i18n/locales/de.js +78 -7
  33. package/dist/i18n/locales/el.d.ts +77 -6
  34. package/dist/i18n/locales/el.js +78 -7
  35. package/dist/i18n/locales/en.d.ts +77 -6
  36. package/dist/i18n/locales/en.js +85 -7
  37. package/dist/i18n/locales/es.d.ts +77 -6
  38. package/dist/i18n/locales/es.js +78 -7
  39. package/dist/i18n/locales/fr.d.ts +77 -6
  40. package/dist/i18n/locales/fr.js +78 -7
  41. package/dist/i18n/locales/hi.d.ts +77 -6
  42. package/dist/i18n/locales/hi.js +78 -7
  43. package/dist/i18n/locales/it.d.ts +77 -6
  44. package/dist/i18n/locales/it.js +78 -7
  45. package/dist/i18n/locales/ja.d.ts +77 -6
  46. package/dist/i18n/locales/ja.js +78 -7
  47. package/dist/i18n/locales/nl.d.ts +77 -6
  48. package/dist/i18n/locales/nl.js +78 -7
  49. package/dist/i18n/locales/pl.d.ts +77 -6
  50. package/dist/i18n/locales/pl.js +78 -7
  51. package/dist/i18n/locales/pt.d.ts +77 -6
  52. package/dist/i18n/locales/pt.js +78 -7
  53. package/dist/i18n/locales/ro.d.ts +77 -6
  54. package/dist/i18n/locales/ro.js +78 -7
  55. package/dist/i18n/locales/ru.d.ts +77 -6
  56. package/dist/i18n/locales/ru.js +78 -7
  57. package/dist/i18n/locales/sq.d.ts +77 -6
  58. package/dist/i18n/locales/sq.js +78 -7
  59. package/dist/i18n/locales/sv.d.ts +77 -6
  60. package/dist/i18n/locales/sv.js +78 -7
  61. package/dist/i18n/locales/tr.d.ts +77 -6
  62. package/dist/i18n/locales/tr.js +78 -7
  63. package/dist/i18n/locales/zh.d.ts +77 -6
  64. package/dist/i18n/locales/zh.js +78 -7
  65. package/dist/index.js +916 -913
  66. package/dist/locales/ar.json +78 -7
  67. package/dist/locales/de.json +78 -7
  68. package/dist/locales/el.json +78 -7
  69. package/dist/locales/en.json +78 -7
  70. package/dist/locales/es.json +78 -7
  71. package/dist/locales/fr.json +78 -7
  72. package/dist/locales/hi.json +78 -7
  73. package/dist/locales/it.json +78 -7
  74. package/dist/locales/ja.json +78 -7
  75. package/dist/locales/nl.json +78 -7
  76. package/dist/locales/pl.json +78 -7
  77. package/dist/locales/pt.json +78 -7
  78. package/dist/locales/ro.json +78 -7
  79. package/dist/locales/ru.json +78 -7
  80. package/dist/locales/sq.json +78 -7
  81. package/dist/locales/sv.json +78 -7
  82. package/dist/locales/tr.json +78 -7
  83. package/dist/locales/zh.json +78 -7
  84. package/dist/patterns/calendar/calendar-bookings-panel.d.ts +8 -3
  85. package/dist/patterns/calendar/calendar-care-rules.d.ts +49 -0
  86. package/dist/patterns/calendar/calendar-task-editor.d.ts +31 -0
  87. package/dist/patterns/calendar/calendar-workspace.d.ts +8 -1
  88. package/dist/patterns/calendar/calendar-workspace.model.d.ts +39 -12
  89. package/dist/patterns/calendar/calendar.data.d.ts +9 -0
  90. package/dist/patterns/calendar/calendar.journey.d.ts +35 -3
  91. package/dist/patterns/calendar/calendar.model.d.ts +23 -1
  92. package/dist/patterns/calendar/calendar.sheets.d.ts +21 -3
  93. package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
  94. package/dist/patterns/calendar/calendar.types.d.ts +32 -1
  95. package/dist/patterns/calendar/index.js +1 -1
  96. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +58 -26
  97. package/dist/patterns/help-me-write-templates/index.d.ts +1 -1
  98. package/dist/patterns/help-me-write-templates/index.js +1 -1
  99. package/dist/tokens.css +6 -6
  100. package/package.json +5 -1
  101. package/dist/_chunks/calendar-workspace-DhXqqu-D.js +0 -11392
  102. package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +0 -775
  103. package/dist/_chunks/highlighter-DSkckT2Q.js +0 -15
  104. package/dist/_chunks/rich-text-editor-DUMeifwc.js +0 -3176
  105. package/dist/_chunks/wand-sparkles-DAjKyhz7.js +0 -27
@@ -1,28 +1,29 @@
1
- import { jsxs as o, jsx as n, Fragment as st } from "react/jsx-runtime";
2
- import { forwardRef as lt, useRef as f, useState as w, useId as rt, useCallback as T, useEffect as me, useImperativeHandle as ot, useMemo as dt } from "react";
1
+ import { jsxs as d, jsx as n, Fragment as rt } from "react/jsx-runtime";
2
+ import { forwardRef as ot, useRef as p, useState as x, useId as dt, useCallback as T, useEffect as me, useImperativeHandle as ct, useMemo as ut } from "react";
3
3
  import { c as Ce } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ct } from "react-i18next";
5
- import { u as ut } from "./registry-DvAUVLHh.js";
6
- import { C as ft } from "./clinical-note-card-DdsGYMmI.js";
7
- import { R as pt } from "./rich-text-editor-DUMeifwc.js";
8
- import { T as mt } from "./text-area-Bt3p7Pt0.js";
4
+ import { useTranslation as pt } from "react-i18next";
5
+ import { u as ft } from "./registry-DvAUVLHh.js";
6
+ import { C as mt } from "./clinical-note-card-DdsGYMmI.js";
7
+ import { R as gt } from "./rich-text-editor-BYE6kK4u.js";
8
+ import { T as ht } from "./text-area-Bt3p7Pt0.js";
9
9
  import { A as I } from "./alert-CiQ5Pa3Q.js";
10
10
  import { B as z } from "./button-CaUe1uyd.js";
11
11
  import { I as ge } from "./icon-button-CehAeZoP.js";
12
- import { C as gt } from "./checkbox-CZkipDn7.js";
12
+ import { S as vt } from "./switch-OILsBLWo.js";
13
+ import { T as yt } from "./tooltip-Cp-PLePW.js";
13
14
  import { C as he } from "./card-DPmk26CL.js";
14
- import { C as ht, S as M } from "./skeleton-B1KTdJ4N.js";
15
+ import { C as bt, S as M } from "./skeleton-B1KTdJ4N.js";
15
16
  import { D as v } from "./dialog-BJiLqhx6.js";
16
- import { P as vt } from "./panel-header-D_mTdhUp.js";
17
- import { a as yt, u as bt, R as Ct } from "./use-list-reflow-Cw43nxw5.js";
18
- import { u as Pt } from "./use-theme-CAuo6EYT.js";
19
- import { N as xt } from "./notebook-pen-CO7HoM-W.js";
20
- import { P as wt } from "./pencil-B1sKKyuT.js";
21
- import { T as Tt } from "./trash-2-uumy3fy1.js";
17
+ import { P as Ct } from "./panel-header-D_mTdhUp.js";
18
+ import { a as Pt, u as wt, R as xt } from "./use-list-reflow-Cw43nxw5.js";
19
+ import { u as Tt } from "./use-theme-CAuo6EYT.js";
20
+ import { N as Et } from "./notebook-pen-CO7HoM-W.js";
21
+ import { P as Nt } from "./pencil-B1sKKyuT.js";
22
+ import { T as Vt } from "./trash-2-uumy3fy1.js";
22
23
  function ve(i, c) {
23
24
  return typeof i == "object" && i !== null && "message" in i && typeof i.message == "string" && i.message.trim() ? i.message : c;
24
25
  }
25
- const Et = {
26
+ const Rt = {
26
27
  id: "notes-panel",
27
28
  // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
28
29
  // with no dedicated capability in the closed vocabulary.
@@ -121,7 +122,7 @@ const Et = {
121
122
  description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
122
123
  }
123
124
  }
124
- }, Nt = "ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]", Vt = Ce(
125
+ }, kt = "ds:isolate ds:[&_[data-component=card]>*]:relative ds:[&_[data-component=card]>*]:z-[1]", St = Ce(
125
126
  "ds:relative ds:flex ds:flex-col ds:rounded-[var(--radius-lg)]",
126
127
  {
127
128
  variants: {
@@ -129,7 +130,7 @@ const Et = {
129
130
  true: "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)]",
130
131
  false: ""
131
132
  },
132
- washed: { true: Nt, false: "" }
133
+ washed: { true: kt, false: "" }
133
134
  },
134
135
  defaultVariants: { current: !1, washed: !1 }
135
136
  }
@@ -148,14 +149,14 @@ const Et = {
148
149
  }
149
150
  }
150
151
  }
151
- ), Rt = "ds:opacity-0", kt = [
152
+ ), _t = "ds:opacity-0", It = [
152
153
  "ds:transition-opacity ds:duration-[var(--animation-duration)]",
153
154
  "ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
154
- ].join(" "), _t = [3, 2, 3];
155
+ ].join(" "), zt = [3, 2, 3];
155
156
  function be(i) {
156
157
  return i ? /<img\b/i.test(i) ? !0 : i.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
157
158
  }
158
- const Xt = lt(
159
+ const nn = ot(
159
160
  function({
160
161
  id: c,
161
162
  notes: j,
@@ -166,8 +167,8 @@ const Xt = lt(
166
167
  currentNoteKey: Z,
167
168
  composer: g = "rich",
168
169
  editorToolbar: Pe = "standard",
169
- redactor: xe,
170
- imageUploadUrl: we,
170
+ redactor: we,
171
+ imageUploadUrl: xe,
171
172
  showClinicalToggle: Te = !0,
172
173
  canAddClinicalNote: A = !0,
173
174
  clinicalGatedReason: Ee,
@@ -176,55 +177,57 @@ const Xt = lt(
176
177
  aiDraftFormat: Ve,
177
178
  aiPrivacyNotice: Re,
178
179
  onDictate: ke,
179
- onProofread: _e,
180
- onAutoFormat: Se,
180
+ onProofread: Se,
181
+ onAutoFormat: _e,
181
182
  aiConsent: Ie,
182
183
  variables: ze,
183
184
  validateVariable: je,
184
185
  onVariableValidityChange: Ae,
185
186
  renderHelpMeWrite: Le,
186
- onUploadImage: He,
187
- onAiCreditsExhausted: Oe,
188
- composerBefore: Be,
189
- composerAfter: We,
187
+ aiTemplates: He,
188
+ onAiApplied: Oe,
189
+ onUploadImage: Be,
190
+ onAiCreditsExhausted: De,
191
+ composerBefore: We,
192
+ composerAfter: qe,
190
193
  onTogglePin: L,
191
194
  onToggleFlag: H,
192
195
  noteActions: ee,
193
196
  onEditNote: N,
194
- editClinical: De = !1,
197
+ editClinical: Fe = !1,
195
198
  onDeleteNote: h,
196
199
  confirmDelete: $ = !0,
197
- title: qe,
198
- composerPlaceholder: Fe,
199
- addNoteLabel: Ke,
200
- emptyState: Me,
201
- className: $e,
200
+ title: Ke,
201
+ composerPlaceholder: Me,
202
+ addNoteLabel: $e,
203
+ emptyState: Ge,
204
+ className: Ye,
202
205
  "aria-label": G,
203
- ...Ge
204
- }, Ye) {
205
- const { t: a, i18n: te } = ct(), b = f(null), [P, V] = w(""), [O, B] = w(E), [u, ne] = w(!1), [ae, R] = w(null), [r, Y] = w(null), ie = f(!1);
206
+ ...Je
207
+ }, Qe) {
208
+ const { t: a, i18n: te } = pt(), b = p(null), [P, V] = x(""), [O, B] = x(E), [u, ne] = x(!1), [ae, R] = x(null), [r, Y] = x(null), ie = p(!1);
206
209
  C === "loading" && (ie.current = !0);
207
- const Je = ie.current ? ht : "", Qe = qe ?? a("notesPanel.title", { defaultValue: "Notes" }), se = rt(), le = Fe ?? a("notesPanel.placeholder", { defaultValue: "Add a note…" }), re = r !== null ? a("notesPanel.edit", { defaultValue: "Edit note" }) : a("notesPanel.composerLabel", { defaultValue: "New note" }), Ue = g === "rich" ? be(P) : P.trim().length > 0, Xe = T(() => {
208
- var x;
210
+ const Ue = ie.current ? bt : "", Xe = Ke ?? a("notesPanel.title", { defaultValue: "Notes" }), se = dt(), le = Me ?? a("notesPanel.placeholder", { defaultValue: "Add a note…" }), re = r !== null ? a("notesPanel.edit", { defaultValue: "Edit note" }) : a("notesPanel.composerLabel", { defaultValue: "New note" }), Ze = g === "rich" ? be(P) : P.trim().length > 0, et = T(() => {
211
+ var w;
209
212
  if (!(r !== null ? N : m) || u) return;
210
- const t = g === "rich", d = t ? ((x = b.current) == null ? void 0 : x.getHTML()) ?? P : P.trim();
211
- if (t ? !be(d) : !d) return;
213
+ const t = g === "rich", o = t ? ((w = b.current) == null ? void 0 : w.getHTML()) ?? P : P.trim();
214
+ if (t ? !be(o) : !o) return;
212
215
  const l = () => {
213
- var p;
214
- t && ((p = b.current) == null || p.clear()), V(""), B(E), Y(null);
216
+ var f;
217
+ t && ((f = b.current) == null || f.clear()), V(""), B(E), Y(null);
215
218
  };
216
219
  R(null);
217
220
  let s;
218
221
  try {
219
- s = r !== null && N ? N(r, { content: d, clinical: O }) : m == null ? void 0 : m({ content: d, clinical: O });
220
- } catch (p) {
221
- R(ve(p, a("notesPanel.addFailed")));
222
+ s = r !== null && N ? N(r, { content: o, clinical: O }) : m == null ? void 0 : m({ content: o, clinical: O });
223
+ } catch (f) {
224
+ R(ve(f, a("notesPanel.addFailed")));
222
225
  return;
223
226
  }
224
227
  if (!s || typeof s.then != "function") return l();
225
228
  ne(!0), Promise.resolve(s).then(
226
229
  l,
227
- (p) => R(ve(p, a("notesPanel.addFailed")))
230
+ (f) => R(ve(f, a("notesPanel.addFailed")))
228
231
  ).finally(() => ne(!1));
229
232
  }, [
230
233
  g,
@@ -236,7 +239,7 @@ const Xt = lt(
236
239
  N,
237
240
  u,
238
241
  a
239
- ]), oe = Te && (r === null || De), de = T(
242
+ ]), oe = Te && (r === null || Fe), de = T(
240
243
  (e) => {
241
244
  try {
242
245
  return new Intl.DateTimeFormat(te.language, {
@@ -251,55 +254,55 @@ const Xt = lt(
251
254
  }
252
255
  },
253
256
  [te.language]
254
- ), Ze = T(
257
+ ), tt = T(
255
258
  (e) => {
256
- var d, l, s;
259
+ var o, l, s;
257
260
  if (!e.id || u) return;
258
261
  const t = e.content ?? "";
259
- R(null), Y(e.id), B(e.clinical ?? !1), V(t), g === "rich" && ((d = b.current) == null || d.clear(), (l = b.current) == null || l.insertAtCursor(t, { asHtml: !0 })), (s = b.current) == null || s.focus();
262
+ R(null), Y(e.id), B(e.clinical ?? !1), V(t), g === "rich" && ((o = b.current) == null || o.clear(), (l = b.current) == null || l.insertAtCursor(t, { asHtml: !0 })), (s = b.current) == null || s.focus();
260
263
  },
261
264
  [g, u]
262
- ), W = T(() => {
265
+ ), D = T(() => {
263
266
  var e;
264
267
  g === "rich" && ((e = b.current) == null || e.clear()), V(""), B(E), R(null), Y(null);
265
268
  }, [g, E]), ce = r === null || j.some((e) => e.id === r && !e.deleted);
266
269
  me(() => {
267
- ce || W();
268
- }, [ce, W]);
270
+ ce || D();
271
+ }, [ce, D]);
269
272
  const k = [...j].sort(
270
273
  (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
271
- ), { resolvedTheme: et } = Pt(), ue = et.endsWith("-accessible") || void 0, { containerRef: tt } = yt({
274
+ ), { resolvedTheme: nt } = Tt(), ue = nt.endsWith("-accessible") || void 0, { containerRef: at } = Pt({
272
275
  key: k.map((e) => e.id).join(),
273
276
  reduceMotion: ue
274
- }), _ = bt({ reduceMotion: ue }), [D, q] = w(null), nt = T(
277
+ }), S = wt({ reduceMotion: ue }), [W, q] = x(null), it = T(
275
278
  (e) => {
276
- h && ($ ? q(e) : _.leave(e, () => h(e)));
279
+ h && ($ ? q(e) : S.leave(e, () => h(e)));
277
280
  },
278
- [$, _, h]
279
- ), at = T(() => {
280
- if (!D || !h) return;
281
- const e = D;
282
- q(null), _.leave(e, () => h(e));
283
- }, [D, h, _]), J = f(null);
281
+ [$, S, h]
282
+ ), st = T(() => {
283
+ if (!W || !h) return;
284
+ const e = W;
285
+ q(null), S.leave(e, () => h(e));
286
+ }, [W, h, S]), J = p(null);
284
287
  me(() => {
285
288
  var e, t;
286
289
  y && ((e = J.current) == null || e.scrollIntoView({ block: "center" }), (t = J.current) == null || t.focus());
287
290
  }, [y, Z]);
288
- const Q = f(j);
291
+ const Q = p(j);
289
292
  Q.current = j;
290
- const S = f(m);
291
- S.current = m;
292
- const F = f(L);
293
+ const _ = p(m);
294
+ _.current = m;
295
+ const F = p(L);
293
296
  F.current = L;
294
- const K = f(H);
297
+ const K = p(H);
295
298
  K.current = H;
296
- const U = f(A);
299
+ const U = p(A);
297
300
  U.current = A;
298
- const fe = f(y);
299
- fe.current = y;
300
- const pe = f(null);
301
- ot(Ye, () => pe.current, []);
302
- const it = dt(
301
+ const pe = p(y);
302
+ pe.current = y;
303
+ const fe = p(null);
304
+ ct(Qe, () => fe.current, []);
305
+ const lt = ut(
303
306
  () => ({
304
307
  // Ids + flags only — never the note body or author (both PHI).
305
308
  getNotes: () => Q.current.map((e) => ({
@@ -308,18 +311,18 @@ const Xt = lt(
308
311
  flagged: !!e.flagged,
309
312
  clinical: !!e.clinical
310
313
  })),
311
- canAddNote: () => !!S.current,
314
+ canAddNote: () => !!_.current,
312
315
  canAddClinical: () => U.current,
313
- getCurrentNoteId: () => fe.current ?? null,
316
+ getCurrentNoteId: () => pe.current ?? null,
314
317
  addNote: (e) => {
315
318
  var t;
316
319
  if (!(e.clinical && !U.current))
317
- return (t = S.current) == null ? void 0 : t.call(S, e);
320
+ return (t = _.current) == null ? void 0 : t.call(_, e);
318
321
  },
319
322
  togglePin: (e) => {
320
- var d, l;
323
+ var o, l;
321
324
  const t = Q.current.find((s) => s.id === e);
322
- t && (t.deleted || ((d = t.actions) == null ? void 0 : d.pin) === !1) || (l = F.current) == null || l.call(F, e);
325
+ t && (t.deleted || ((o = t.actions) == null ? void 0 : o.pin) === !1) || (l = F.current) == null || l.call(F, e);
323
326
  },
324
327
  toggleFlag: (e) => {
325
328
  var t;
@@ -328,64 +331,66 @@ const Xt = lt(
328
331
  }),
329
332
  []
330
333
  );
331
- return ut(Et, it, c), /* @__PURE__ */ o(
334
+ return ft(Rt, lt, c), /* @__PURE__ */ d(
332
335
  "section",
333
336
  {
334
- ref: pe,
337
+ ref: fe,
335
338
  "data-component": "notes-panel",
336
339
  "data-component-id": c,
337
340
  "aria-labelledby": G ? void 0 : se,
338
341
  "aria-label": G,
339
- className: ["ds:flex ds:flex-col", $e].filter(Boolean).join(" "),
340
- ...Ge,
342
+ className: ["ds:flex ds:flex-col", Ye].filter(Boolean).join(" "),
343
+ ...Je,
341
344
  children: [
342
345
  /* @__PURE__ */ n(
343
- vt,
346
+ Ct,
344
347
  {
345
- title: Qe,
346
- icon: /* @__PURE__ */ n(xt, { "aria-hidden": "true" }),
348
+ title: Xe,
349
+ icon: /* @__PURE__ */ n(Et, { "aria-hidden": "true" }),
347
350
  headingId: G ? void 0 : se,
348
351
  sticky: !0,
349
352
  divider: !0
350
353
  }
351
354
  ),
352
- /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
353
- m || r !== null ? /* @__PURE__ */ o(
355
+ /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
356
+ m || r !== null ? /* @__PURE__ */ d(
354
357
  "div",
355
358
  {
356
359
  "data-notes-panel-composer": r !== null ? "edit" : "add",
357
360
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
358
361
  children: [
359
- Be,
362
+ We,
360
363
  g === "rich" ? /* @__PURE__ */ n(
361
- pt,
364
+ gt,
362
365
  {
363
366
  ref: b,
364
367
  ariaLabel: re,
365
368
  placeholder: le,
366
369
  toolbar: Pe,
367
370
  minHeight: "fill",
368
- redactor: xe,
369
- imageUploadUrl: we,
371
+ redactor: we,
372
+ imageUploadUrl: xe,
370
373
  readOnly: u,
371
374
  onChange: ({ html: e }) => V(e),
372
375
  onRequestAiDraft: Ne,
373
376
  aiDraftFormat: Ve,
374
377
  aiPrivacyNotice: Re,
375
378
  onDictate: ke,
376
- onProofread: _e,
377
- onAutoFormat: Se,
379
+ onProofread: Se,
380
+ onAutoFormat: _e,
378
381
  aiConsent: Ie,
379
382
  variables: ze,
380
383
  validateVariable: je,
381
384
  onVariableValidityChange: Ae,
382
385
  renderHelpMeWrite: Le,
383
- onUploadImage: He,
384
- onAiCreditsExhausted: Oe,
386
+ aiTemplates: He,
387
+ onAiApplied: Oe,
388
+ onUploadImage: Be,
389
+ onAiCreditsExhausted: De,
385
390
  aiConsentHeadingLevel: 3
386
391
  }
387
392
  ) : /* @__PURE__ */ n(
388
- mt,
393
+ ht,
389
394
  {
390
395
  value: P,
391
396
  readOnly: u,
@@ -397,7 +402,7 @@ const Xt = lt(
397
402
  "aria-label": re
398
403
  }
399
404
  ),
400
- /* @__PURE__ */ o(
405
+ /* @__PURE__ */ d(
401
406
  "div",
402
407
  {
403
408
  className: [
@@ -405,29 +410,31 @@ const Xt = lt(
405
410
  oe ? "ds:justify-between" : "ds:justify-end"
406
411
  ].join(" "),
407
412
  children: [
408
- oe ? /* @__PURE__ */ n(
409
- gt,
410
- {
411
- size: "sm",
412
- label: a("notesPanel.clinicalToggle", {
413
- defaultValue: "Clinical note"
414
- }),
415
- checked: O,
416
- onCheckedChange: (e) => B(e === !0),
417
- disabled: u || !A,
418
- disabledReason: A ? void 0 : Ee ?? a("notesPanel.clinicalGated", {
419
- defaultValue: "You do not have permission to write clinical notes."
420
- })
421
- }
422
- ) : null,
423
- /* @__PURE__ */ o("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
413
+ oe ? (() => {
414
+ const e = u || !A, t = A ? void 0 : Ee ?? a("notesPanel.clinicalGated", {
415
+ defaultValue: "You do not have permission to write clinical notes."
416
+ }), o = /* @__PURE__ */ n(
417
+ vt,
418
+ {
419
+ size: "sm",
420
+ label: a("notesPanel.clinicalToggle", {
421
+ defaultValue: "Clinical note"
422
+ }),
423
+ checked: O,
424
+ onCheckedChange: B,
425
+ disabled: e
426
+ }
427
+ );
428
+ return e && t ? /* @__PURE__ */ n(yt, { label: t, children: /* @__PURE__ */ n("span", { tabIndex: 0, children: o }) }) : o;
429
+ })() : null,
430
+ /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
424
431
  r !== null ? /* @__PURE__ */ n(
425
432
  z,
426
433
  {
427
434
  type: "button",
428
435
  size: "sm",
429
436
  intent: "ghost",
430
- onClick: W,
437
+ onClick: D,
431
438
  disabled: u,
432
439
  children: a("notesPanel.cancelEdit", { defaultValue: "Cancel" })
433
440
  }
@@ -437,10 +444,10 @@ const Xt = lt(
437
444
  {
438
445
  type: "button",
439
446
  size: "sm",
440
- onClick: Xe,
441
- disabled: !Ue,
447
+ onClick: et,
448
+ disabled: !Ze,
442
449
  loading: u,
443
- children: r !== null ? a("notesPanel.saveEdit", { defaultValue: "Save note" }) : Ke ?? a("notesPanel.add", { defaultValue: "Add note" })
450
+ children: r !== null ? a("notesPanel.saveEdit", { defaultValue: "Save note" }) : $e ?? a("notesPanel.add", { defaultValue: "Add note" })
444
451
  }
445
452
  )
446
453
  ] })
@@ -448,7 +455,7 @@ const Xt = lt(
448
455
  }
449
456
  ),
450
457
  ae ? /* @__PURE__ */ n(I, { variant: "error", children: /* @__PURE__ */ n(I.Description, { children: ae }) }) : null,
451
- We
458
+ qe
452
459
  ]
453
460
  }
454
461
  ) : null,
@@ -456,7 +463,7 @@ const Xt = lt(
456
463
  /* Note-shaped placeholders, not a spinner: the reader sees where
457
464
  the notes will land and how many to expect. The status text is
458
465
  for assistive tech only; sighted readers get the motion. */
459
- /* @__PURE__ */ o(
466
+ /* @__PURE__ */ d(
460
467
  "div",
461
468
  {
462
469
  "data-notes-panel-loading": "",
@@ -464,8 +471,8 @@ const Xt = lt(
464
471
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
465
472
  children: [
466
473
  /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: a("notesPanel.loading") }),
467
- _t.map((e, t) => /* @__PURE__ */ n(he, { variant: "elevated", "aria-hidden": "true", children: /* @__PURE__ */ n(he.Body, { children: /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
468
- /* @__PURE__ */ o("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
474
+ zt.map((e, t) => /* @__PURE__ */ n(he, { variant: "elevated", "aria-hidden": "true", children: /* @__PURE__ */ n(he.Body, { children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
475
+ /* @__PURE__ */ d("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
469
476
  /* @__PURE__ */ n(
470
477
  M,
471
478
  {
@@ -474,7 +481,7 @@ const Xt = lt(
474
481
  stagger: t * 2
475
482
  }
476
483
  ),
477
- /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
484
+ /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
478
485
  /* @__PURE__ */ n(
479
486
  M,
480
487
  {
@@ -508,7 +515,7 @@ const Xt = lt(
508
515
  ]
509
516
  }
510
517
  )
511
- ) : C === "error" ? /* @__PURE__ */ o(I, { variant: "error", children: [
518
+ ) : C === "error" ? /* @__PURE__ */ d(I, { variant: "error", children: [
512
519
  /* @__PURE__ */ n(I.Description, { children: a("notesPanel.loadError") }),
513
520
  X ? /* @__PURE__ */ n(I.Action, { children: /* @__PURE__ */ n(z, { intent: "secondary", size: "sm", onClick: X, children: a("notesPanel.retry") }) }) : null
514
521
  ] }) : null,
@@ -516,34 +523,34 @@ const Xt = lt(
516
523
  k.length > 0 ? /* @__PURE__ */ n(
517
524
  "ul",
518
525
  {
519
- ref: tt,
526
+ ref: at,
520
527
  "aria-busy": C === "loading" || void 0,
521
- className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${Je}`.trim(),
522
- children: k.map(({ actions: e, ...t }, d) => {
523
- const l = y != null && t.id === y, s = t.id, x = s != null && r === s, p = s != null && _.isLeaving(s);
524
- return /* @__PURE__ */ o(
528
+ className: `ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${Ue}`.trim(),
529
+ children: k.map(({ actions: e, ...t }, o) => {
530
+ const l = y != null && t.id === y, s = t.id, w = s != null && r === s, f = s != null && S.isLeaving(s);
531
+ return /* @__PURE__ */ d(
525
532
  "li",
526
533
  {
527
534
  ref: l ? J : void 0,
528
535
  tabIndex: l ? -1 : void 0,
529
536
  "aria-current": l ? "true" : void 0,
530
537
  "data-reflow-id": s,
531
- "data-leaving": p ? "" : void 0,
532
- "data-editing": x ? "" : void 0,
538
+ "data-leaving": f ? "" : void 0,
539
+ "data-editing": w ? "" : void 0,
533
540
  className: [
534
- Vt({
541
+ St({
535
542
  current: l,
536
- washed: l || x
543
+ washed: l || w
537
544
  }),
538
- kt,
539
- Ct,
540
- p ? Rt : ""
545
+ It,
546
+ xt,
547
+ f ? _t : ""
541
548
  ].filter(Boolean).join(" "),
542
549
  children: [
543
550
  l ? /* @__PURE__ */ n("span", { className: "ds:sr-only", children: a("notesPanel.current", {
544
551
  defaultValue: "Current note"
545
552
  }) }) : null,
546
- x ? /* @__PURE__ */ n(
553
+ w ? /* @__PURE__ */ n(
547
554
  "span",
548
555
  {
549
556
  "aria-hidden": "true",
@@ -560,16 +567,16 @@ const Xt = lt(
560
567
  `${y}:${Z ?? ""}`
561
568
  ) : null,
562
569
  /* @__PURE__ */ n(
563
- ft,
570
+ mt,
564
571
  {
565
572
  surface: "elevated",
566
573
  truncate: !l,
567
- headerActions: /* @__PURE__ */ o(st, { children: [
574
+ headerActions: /* @__PURE__ */ d(rt, { children: [
568
575
  ee ? ee({ ...t, actions: e }) : null,
569
576
  N && s && !t.deleted && (e == null ? void 0 : e.edit) !== !1 ? /* @__PURE__ */ n(
570
577
  ge,
571
578
  {
572
- icon: /* @__PURE__ */ n(wt, {}),
579
+ icon: /* @__PURE__ */ n(Nt, {}),
573
580
  intent: "ghost",
574
581
  size: "sm",
575
582
  "aria-label": a("notesPanel.editNamed", {
@@ -582,13 +589,13 @@ const Xt = lt(
582
589
  "aria-pressed": r === s,
583
590
  disabled: u,
584
591
  "data-notes-panel-edit": "",
585
- onClick: () => r === s ? W() : Ze(t)
592
+ onClick: () => r === s ? D() : tt(t)
586
593
  }
587
594
  ) : null,
588
595
  h && s && !t.deleted ? /* @__PURE__ */ n(
589
596
  ge,
590
597
  {
591
- icon: /* @__PURE__ */ n(Tt, {}),
598
+ icon: /* @__PURE__ */ n(Vt, {}),
592
599
  intent: "ghost",
593
600
  size: "sm",
594
601
  "aria-label": a("notesPanel.deleteNamed", {
@@ -598,7 +605,7 @@ const Xt = lt(
598
605
  tooltip: a("notesPanel.delete", {
599
606
  defaultValue: "Delete note"
600
607
  }),
601
- onClick: () => nt(s)
608
+ onClick: () => it(s)
602
609
  }
603
610
  ) : null
604
611
  ] }),
@@ -609,25 +616,25 @@ const Xt = lt(
609
616
  )
610
617
  ]
611
618
  },
612
- t.id ?? d
619
+ t.id ?? o
613
620
  );
614
621
  })
615
622
  }
616
- ) : C !== "ready" ? null : Me ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: a("notesPanel.empty", { defaultValue: "No notes yet." }) })
623
+ ) : C !== "ready" ? null : Ge ?? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: a("notesPanel.empty", { defaultValue: "No notes yet." }) })
617
624
  ] }),
618
625
  h && $ ? /* @__PURE__ */ n(
619
626
  v,
620
627
  {
621
- open: D !== null,
628
+ open: W !== null,
622
629
  onOpenChange: (e) => !e && q(null),
623
- children: /* @__PURE__ */ o(v.Content, { variant: "alert", size: "sm", children: [
630
+ children: /* @__PURE__ */ d(v.Content, { variant: "alert", size: "sm", children: [
624
631
  /* @__PURE__ */ n(v.Header, { children: /* @__PURE__ */ n(v.Title, { children: a("notesPanel.deleteConfirmTitle", {
625
632
  defaultValue: "Delete this note?"
626
633
  }) }) }),
627
634
  /* @__PURE__ */ n(v.Body, { children: /* @__PURE__ */ n(v.Description, { children: a("notesPanel.deleteConfirmBody", {
628
635
  defaultValue: "The note will be removed from the record."
629
636
  }) }) }),
630
- /* @__PURE__ */ o(v.Footer, { children: [
637
+ /* @__PURE__ */ d(v.Footer, { children: [
631
638
  /* @__PURE__ */ n(v.Close, { asChild: !0, children: /* @__PURE__ */ n(
632
639
  z,
633
640
  {
@@ -644,7 +651,7 @@ const Xt = lt(
644
651
  {
645
652
  intent: "destructive",
646
653
  size: "sm",
647
- onClick: at,
654
+ onClick: st,
648
655
  children: a("notesPanel.deleteConfirmAction", {
649
656
  defaultValue: "Delete"
650
657
  })
@@ -660,7 +667,7 @@ const Xt = lt(
660
667
  }
661
668
  );
662
669
  export {
663
- Xt as N,
670
+ nn as N,
664
671
  ve as g
665
672
  };
666
- //# sourceMappingURL=notes-panel-CRAovkjx.js.map
673
+ //# sourceMappingURL=notes-panel-CY4KmDo-.js.map