@alfadocs/ui-kit 1.30.0 → 1.32.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 (233) hide show
  1. package/dist/_chunks/{address-fields-CZ0pEdEI.js → address-fields-jFfjxOQR.js} +3 -3
  2. package/dist/_chunks/{agenda-card-pdN49pMu.js → agenda-card-DVz3jwTf.js} +2 -2
  3. package/dist/_chunks/{agenda-tray-BweO8pDo.js → agenda-tray-1oDWCJdB.js} +2 -2
  4. package/dist/_chunks/{ai-prompt-input-CrHr-5H8.js → ai-prompt-input-Dt7tpCBh.js} +2 -2
  5. package/dist/_chunks/{alia-sidebar-BWcWZivN.js → alia-sidebar-D18kp3p9.js} +3 -3
  6. package/dist/_chunks/{anamnesis-summary-rows-DMO3MWSt.js → anamnesis-summary-rows-BYgyp_i2.js} +6 -6
  7. package/dist/_chunks/{appointment-card-Dzr3GeVz.js → appointment-card-D-oj_ugh.js} +9 -7
  8. package/dist/_chunks/{appointment-timeline-DhHwmHo1.js → appointment-timeline-CymGHyIP.js} +2 -2
  9. package/dist/_chunks/{appointment-tray-4FUu_5NX.js → appointment-tray-DCk8gHod.js} +2 -2
  10. package/dist/_chunks/{audio-recorder-DXG6LTtO.js → audio-recorder-11wClczr.js} +2 -2
  11. package/dist/_chunks/{avatar-BNQNhoyL.js → avatar-CkDeQOSI.js} +37 -37
  12. package/dist/_chunks/{balance-badge-cell-CX6b0ML4.js → balance-badge-cell-DhBtFRoW.js} +4 -4
  13. package/dist/_chunks/{bishop-score-CJUVBfAu.js → bishop-score-CAl7C5hm.js} +2 -2
  14. package/dist/_chunks/{bmi-calculator-CcH6upht.js → bmi-calculator-Dwkih9a4.js} +3 -3
  15. package/dist/_chunks/{booking-AabCk7CI.js → booking-l6UGNiE1.js} +3 -3
  16. package/dist/_chunks/{calculator-dialog-12d3Sxaz.js → calculator-dialog-C0ixc3SU.js} +2 -2
  17. package/dist/_chunks/{calendar-CI9MINcR.js → calendar-Dgvl5L4T.js} +494 -438
  18. package/dist/_chunks/{calendar-event-card-66CEEWU6.js → calendar-event-card-DSh-69HT.js} +130 -122
  19. package/dist/_chunks/calendar-workspace-BX-zDyVR.js +9392 -0
  20. package/dist/_chunks/{care-plan-card-CQVboTn1.js → care-plan-card-CZW476Kg.js} +2 -2
  21. package/dist/_chunks/{care-plan-entry-card-jxHkzez5.js → care-plan-entry-card-BMUYagEw.js} +2 -2
  22. package/dist/_chunks/{chat-message-DBQu10rs.js → chat-message-C-8UU2av.js} +2 -2
  23. package/dist/_chunks/{clinical-note-card-BBgFd2nB.js → clinical-note-card-D2WTV2CO.js} +185 -188
  24. package/dist/_chunks/{color-picker-CU303VjY.js → color-picker-Bl5f0iK1.js} +28 -25
  25. package/dist/_chunks/{combobox-D7_NLE2Z.js → combobox-DnSdYssy.js} +216 -215
  26. package/dist/_chunks/{country-select-DzbPFktV.js → country-select-CfDNFG5c.js} +2 -2
  27. package/dist/_chunks/{data-table-DB5BiVQ0.js → data-table-DC96JJIq.js} +2 -2
  28. package/dist/_chunks/{dependent-selector-cJlJFAKD.js → dependent-selector-yTKKsuc9.js} +2 -2
  29. package/dist/_chunks/{dialog-UbKJCi1X.js → dialog-BJiLqhx6.js} +54 -46
  30. package/dist/_chunks/{document-preview-CDb-n_W7.js → document-preview-BrhMHNh8.js} +2 -2
  31. package/dist/_chunks/{due-date-calculator-BtgWeFqp.js → due-date-calculator-CxgK8vzt.js} +3 -3
  32. package/dist/_chunks/{entity-summary-B_vO5Ur4.js → entity-summary-5o768XLU.js} +2 -2
  33. package/dist/_chunks/{face-scheme-DA2vjqaM.js → face-scheme-l-CQyLs-.js} +2 -2
  34. package/dist/_chunks/{file-manager-Cd8V9IcZ.js → file-manager-CI2Qn8qW.js} +3 -3
  35. package/dist/_chunks/{gestational-age-calculator-KdMg9z9H.js → gestational-age-calculator-CZHVrERT.js} +4 -4
  36. package/dist/_chunks/{link-cell-renderer-tWEOv3Sc.js → link-cell-renderer-BEpMNtAa.js} +3 -3
  37. package/dist/_chunks/{marketplace-app-shell-C4AjQmvz.js → marketplace-app-shell-CK_ND8Tr.js} +2 -2
  38. package/dist/_chunks/{message-card-D8GB4FdF.js → message-card-BUMv16un.js} +2 -2
  39. package/dist/_chunks/{message-tray-CGIRQjx5.js → message-tray-0zsv27xX.js} +2 -2
  40. package/dist/_chunks/{muscle-scheme-BSJsI4-I.js → muscle-scheme-UVz_x4iE.js} +2 -2
  41. package/dist/_chunks/notes-panel-C4G-mhZ9.js +380 -0
  42. package/dist/_chunks/{operator-hero-BnFv-Uef.js → operator-hero-D7-iiFQ9.js} +2 -2
  43. package/dist/_chunks/{optical-prescription-BvwuqTpl.js → optical-prescription-DUJOhKz_.js} +2 -2
  44. package/dist/_chunks/{patient-details-DYAmq76G.js → patient-details-BGiawUHd.js} +5 -5
  45. package/dist/_chunks/{patient-summary-card-C9WBwct-.js → patient-summary-card--CT_gbaQ.js} +2 -2
  46. package/dist/_chunks/{periodontal-diagnosis-HrFsVi-C.js → periodontal-diagnosis-lEwA8wqX.js} +3 -3
  47. package/dist/_chunks/{practice-profile-hero-YQ7h2K4o.js → practice-profile-hero-DQyDvpJL.js} +2 -2
  48. package/dist/_chunks/{practice-results-CxIsU2YO.js → practice-results-DjEzPgAK.js} +2 -2
  49. package/dist/_chunks/{pregnancy-dating-m-c05DOI.js → pregnancy-dating-n5j5dAKy.js} +4 -4
  50. package/dist/_chunks/{pregnancy-weight-gain-CJwbs9W-.js → pregnancy-weight-gain-D5A8vPjj.js} +3 -3
  51. package/dist/_chunks/{province-select-BBc7s7vR.js → province-select-BaUnkg4S.js} +2 -2
  52. package/dist/_chunks/qr-code-DOJs4suh.js +750 -0
  53. package/dist/_chunks/radio-DNRe6H_8.js +193 -0
  54. package/dist/_chunks/radio-group-DyVBgnA3.js +297 -0
  55. package/dist/_chunks/{radiograph-panel.agent-ByM9M3qm.js → radiograph-panel.agent-o4jwEJPC.js} +2 -2
  56. package/dist/_chunks/{rich-text-editor-lSCiE0Zz.js → rich-text-editor-CQ7yZdG3.js} +3 -3
  57. package/dist/_chunks/select-CLSUnKjF.js +520 -0
  58. package/dist/_chunks/signature-request-vihDT8On.js +2232 -0
  59. package/dist/_chunks/{tabs-DqKtTIjZ.js → tabs-BnRaLT0y.js} +2 -2
  60. package/dist/_chunks/{tasks-panel-DPCNaRko.js → tasks-panel-DQuaVvl5.js} +2 -2
  61. package/dist/_chunks/{timeline-r-8IUoBS.js → timeline-Bs9Erxlo.js} +38 -36
  62. package/dist/_chunks/{tooth-scheme-C9jssOmy.js → tooth-scheme-Qe7LO5Di.js} +2 -2
  63. package/dist/_chunks/{unit-converter-C6jMjqL9.js → unit-converter-BTgU50gk.js} +2 -2
  64. package/dist/_chunks/{widget-picker-em4xGgv0.js → widget-picker-DvUkBemi.js} +2 -2
  65. package/dist/agent-catalog.json +366 -29
  66. package/dist/agent-i18n/en.json +27 -15
  67. package/dist/components/_shared/get-error-message.d.ts +3 -0
  68. package/dist/components/address-fields/index.js +1 -1
  69. package/dist/components/agenda-card/index.js +1 -1
  70. package/dist/components/agenda-tray/index.js +1 -1
  71. package/dist/components/ai-prompt-input/index.js +1 -1
  72. package/dist/components/appointment-card/index.js +2 -2
  73. package/dist/components/appointment-timeline/index.js +1 -1
  74. package/dist/components/audio-recorder/index.js +1 -1
  75. package/dist/components/avatar/avatar.d.ts +2 -0
  76. package/dist/components/avatar/index.js +1 -1
  77. package/dist/components/bishop-score/index.js +1 -1
  78. package/dist/components/bmi-calculator/index.js +1 -1
  79. package/dist/components/booking/index.js +1 -1
  80. package/dist/components/calculator-dialog/index.js +1 -1
  81. package/dist/components/calendar/calendar.d.ts +26 -2
  82. package/dist/components/calendar/index.js +1 -1
  83. package/dist/components/calendar-event-card/calendar-event-card.d.ts +9 -0
  84. package/dist/components/calendar-event-card/index.js +1 -1
  85. package/dist/components/care-plan-card/index.js +1 -1
  86. package/dist/components/care-plan-entry-card/index.js +1 -1
  87. package/dist/components/chat-message/index.js +1 -1
  88. package/dist/components/clinical-note-card/clinical-note-card.d.ts +16 -1
  89. package/dist/components/clinical-note-card/index.js +1 -1
  90. package/dist/components/color-picker/index.js +1 -1
  91. package/dist/components/combobox/combobox.d.ts +5 -0
  92. package/dist/components/combobox/index.js +1 -1
  93. package/dist/components/country-select/index.js +1 -1
  94. package/dist/components/data-table/index.js +2 -2
  95. package/dist/components/dependent-selector/index.js +1 -1
  96. package/dist/components/dialog/dialog.d.ts +9 -0
  97. package/dist/components/dialog/index.js +1 -1
  98. package/dist/components/document-preview/index.js +1 -1
  99. package/dist/components/due-date-calculator/index.js +1 -1
  100. package/dist/components/entity-summary/index.js +1 -1
  101. package/dist/components/face-scheme/index.js +1 -1
  102. package/dist/components/file-manager/index.js +1 -1
  103. package/dist/components/gestational-age-calculator/index.js +1 -1
  104. package/dist/components/message-card/index.js +1 -1
  105. package/dist/components/message-tray/index.js +1 -1
  106. package/dist/components/muscle-scheme/index.js +1 -1
  107. package/dist/components/notes-panel/index.d.ts +1 -1
  108. package/dist/components/notes-panel/index.js +1 -1
  109. package/dist/components/notes-panel/notes-panel.d.ts +24 -5
  110. package/dist/components/operator-hero/index.js +1 -1
  111. package/dist/components/optical-prescription/index.js +1 -1
  112. package/dist/components/patient-details/index.js +1 -1
  113. package/dist/components/patient-summary-card/index.js +1 -1
  114. package/dist/components/patient-table/index.js +1 -1
  115. package/dist/components/periodontal-diagnosis/index.js +1 -1
  116. package/dist/components/practice-profile-hero/index.js +1 -1
  117. package/dist/components/practice-results/index.js +1 -1
  118. package/dist/components/pregnancy-dating/index.js +1 -1
  119. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  120. package/dist/components/province-select/index.js +1 -1
  121. package/dist/components/qr-code/index.js +1 -1
  122. package/dist/components/qr-code/qr-encode.d.ts +14 -16
  123. package/dist/components/radio/index.js +1 -1
  124. package/dist/components/radio-group/index.js +2 -2
  125. package/dist/components/radio-group/radio-group-context.d.ts +4 -1
  126. package/dist/components/radio-group/radio-group.d.ts +13 -1
  127. package/dist/components/radio-group/radio.d.ts +24 -1
  128. package/dist/components/radiograph-panel/index.js +1 -1
  129. package/dist/components/rich-text-editor/index.js +1 -1
  130. package/dist/components/select/index.js +1 -1
  131. package/dist/components/select/select.d.ts +33 -0
  132. package/dist/components/skeleton-scheme/index.js +1 -1
  133. package/dist/components/tabs/index.js +1 -1
  134. package/dist/components/tasks-panel/index.js +1 -1
  135. package/dist/components/timeline/index.js +1 -1
  136. package/dist/components/timeline/timeline.d.ts +2 -0
  137. package/dist/components/tooth-scheme/index.js +1 -1
  138. package/dist/components/unit-converter/index.js +1 -1
  139. package/dist/components/widget-picker/index.js +1 -1
  140. package/dist/host-compat.css +7 -1
  141. package/dist/i18n/locales/ar.d.ts +118 -0
  142. package/dist/i18n/locales/ar.js +123 -5
  143. package/dist/i18n/locales/de.d.ts +128 -10
  144. package/dist/i18n/locales/de.js +135 -15
  145. package/dist/i18n/locales/el.d.ts +118 -0
  146. package/dist/i18n/locales/el.js +123 -5
  147. package/dist/i18n/locales/en.d.ts +118 -0
  148. package/dist/i18n/locales/en.js +123 -5
  149. package/dist/i18n/locales/es.d.ts +118 -0
  150. package/dist/i18n/locales/es.js +123 -5
  151. package/dist/i18n/locales/fr.d.ts +118 -0
  152. package/dist/i18n/locales/fr.js +122 -4
  153. package/dist/i18n/locales/hi.d.ts +118 -0
  154. package/dist/i18n/locales/hi.js +123 -5
  155. package/dist/i18n/locales/it.d.ts +128 -10
  156. package/dist/i18n/locales/it.js +133 -15
  157. package/dist/i18n/locales/ja.d.ts +118 -0
  158. package/dist/i18n/locales/ja.js +123 -5
  159. package/dist/i18n/locales/nl.d.ts +118 -0
  160. package/dist/i18n/locales/nl.js +123 -5
  161. package/dist/i18n/locales/pl.d.ts +118 -0
  162. package/dist/i18n/locales/pl.js +123 -5
  163. package/dist/i18n/locales/pt.d.ts +118 -0
  164. package/dist/i18n/locales/pt.js +123 -5
  165. package/dist/i18n/locales/ro.d.ts +118 -0
  166. package/dist/i18n/locales/ro.js +122 -4
  167. package/dist/i18n/locales/ru.d.ts +118 -0
  168. package/dist/i18n/locales/ru.js +123 -5
  169. package/dist/i18n/locales/sq.d.ts +118 -0
  170. package/dist/i18n/locales/sq.js +123 -5
  171. package/dist/i18n/locales/sv.d.ts +118 -0
  172. package/dist/i18n/locales/sv.js +123 -5
  173. package/dist/i18n/locales/tr.d.ts +118 -0
  174. package/dist/i18n/locales/tr.js +123 -5
  175. package/dist/i18n/locales/zh.d.ts +118 -0
  176. package/dist/i18n/locales/zh.js +123 -5
  177. package/dist/index.js +131 -130
  178. package/dist/locales/ar.json +123 -5
  179. package/dist/locales/de.json +133 -15
  180. package/dist/locales/el.json +123 -5
  181. package/dist/locales/en.json +123 -5
  182. package/dist/locales/es.json +123 -5
  183. package/dist/locales/fr.json +122 -4
  184. package/dist/locales/hi.json +123 -5
  185. package/dist/locales/it.json +133 -15
  186. package/dist/locales/ja.json +123 -5
  187. package/dist/locales/nl.json +123 -5
  188. package/dist/locales/pl.json +123 -5
  189. package/dist/locales/pt.json +123 -5
  190. package/dist/locales/ro.json +122 -4
  191. package/dist/locales/ru.json +123 -5
  192. package/dist/locales/sq.json +123 -5
  193. package/dist/locales/sv.json +123 -5
  194. package/dist/locales/tr.json +123 -5
  195. package/dist/locales/zh.json +123 -5
  196. package/dist/patterns/alia-assistant/index.js +1 -1
  197. package/dist/patterns/anamnesis/index.js +1 -1
  198. package/dist/patterns/calendar/calendar-appointment-details.d.ts +145 -0
  199. package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +32 -0
  200. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +59 -0
  201. package/dist/patterns/calendar/calendar-notes-tool.d.ts +14 -0
  202. package/dist/patterns/calendar/calendar-patient-picker.d.ts +11 -0
  203. package/dist/patterns/calendar/calendar-series-scope-chooser.d.ts +18 -0
  204. package/dist/patterns/calendar/calendar-workspace.d.ts +26 -1
  205. package/dist/patterns/calendar/calendar-workspace.model.d.ts +8 -5
  206. package/dist/patterns/calendar/calendar.data.d.ts +66 -1
  207. package/dist/patterns/calendar/calendar.host.d.ts +2 -0
  208. package/dist/patterns/calendar/calendar.journey.d.ts +42 -7
  209. package/dist/patterns/calendar/calendar.model.d.ts +54 -5
  210. package/dist/patterns/calendar/calendar.sheets.d.ts +68 -15
  211. package/dist/patterns/calendar/calendar.surface.d.ts +12 -2
  212. package/dist/patterns/calendar/calendar.types.d.ts +29 -1
  213. package/dist/patterns/calendar/index.d.ts +9 -6
  214. package/dist/patterns/calendar/index.js +15 -14
  215. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  216. package/dist/patterns/signature-request/channel-meta.d.ts +27 -0
  217. package/dist/patterns/signature-request/index.d.ts +1 -1
  218. package/dist/patterns/signature-request/index.js +1 -1
  219. package/dist/patterns/signature-request/load-status.d.ts +13 -0
  220. package/dist/patterns/signature-request/person-grid.d.ts +32 -0
  221. package/dist/patterns/signature-request/required-documents.d.ts +127 -0
  222. package/dist/patterns/signature-request/signature-history.d.ts +57 -0
  223. package/dist/patterns/signature-request/signature-outcome.d.ts +29 -0
  224. package/dist/patterns/signature-request/signature-request.d.ts +390 -26
  225. package/dist/tokens.css +10 -2
  226. package/package.json +3 -1
  227. package/dist/_chunks/calendar-workspace-a84AHQwj.js +0 -7506
  228. package/dist/_chunks/notes-panel-CTNpsByN.js +0 -353
  229. package/dist/_chunks/qr-code-CPkEs5mG.js +0 -574
  230. package/dist/_chunks/radio-TWf9Q-mp.js +0 -108
  231. package/dist/_chunks/radio-group-rXDJADzW.js +0 -175
  232. package/dist/_chunks/select-Bi8zril7.js +0 -471
  233. package/dist/_chunks/signature-request-C-IsbkPf.js +0 -417
@@ -1,353 +0,0 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as oe, useRef as a, useState as M, useId as le, useCallback as ce, useEffect as de, useImperativeHandle as ue, useMemo as pe } from "react";
3
- import { c as fe } from "./index-D2ZczOXr.js";
4
- import { useTranslation as me } from "react-i18next";
5
- import { u as ge } from "./registry-DvAUVLHh.js";
6
- import { C as he } from "./clinical-note-card-BBgFd2nB.js";
7
- import { R as ve } from "./rich-text-editor-lSCiE0Zz.js";
8
- import { T as be } from "./text-area-Bt3p7Pt0.js";
9
- import { B as ye } from "./button-nJaPh_HC.js";
10
- import { C as xe } from "./checkbox-BuZ1u__2.js";
11
- import { P as Pe } from "./panel-header-D313n_9-.js";
12
- import { N as Ce } from "./notebook-pen-CO7HoM-W.js";
13
- const Ne = {
14
- id: "notes-panel",
15
- // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
16
- // with no dedicated capability in the closed vocabulary.
17
- capabilities: ["submit"],
18
- state: {
19
- notes: {
20
- type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
21
- descriptionKey: "ui.agent.notesPanel.state.notes",
22
- description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
23
- read: (n) => n.getNotes()
24
- },
25
- canAddClinical: {
26
- type: "boolean",
27
- descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
28
- description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
29
- read: (n) => n.canAddClinical()
30
- },
31
- currentNoteId: {
32
- type: "string | null",
33
- descriptionKey: "ui.agent.notesPanel.state.currentNoteId",
34
- 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.",
35
- read: (n) => n.getCurrentNoteId()
36
- }
37
- },
38
- actions: {
39
- add_note: {
40
- // Writes a clinical/admin note body — patient-identifiable content. PHI.
41
- safety: "phi",
42
- argsType: "{ content: string; clinical: boolean }",
43
- argsSchema: {
44
- type: "object",
45
- properties: {
46
- content: {
47
- type: "string",
48
- description: "Note body. Rich HTML for the rich composer, else plain text."
49
- },
50
- clinical: {
51
- type: "boolean",
52
- description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
53
- }
54
- },
55
- required: ["content", "clinical"]
56
- },
57
- openWorld: !0,
58
- descriptionKey: "ui.agent.notesPanel.actions.addNote",
59
- description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
60
- examples: [
61
- {
62
- args: { content: "Patient reported improvement.", clinical: !0 },
63
- note: "Add a clinical note."
64
- }
65
- ],
66
- invoke: (n, s) => {
67
- n.addNote(s);
68
- }
69
- },
70
- toggle_pin: {
71
- // Re-orders the timeline (pinned notes lead) — reversible view write.
72
- safety: "write",
73
- argsType: "{ id: string }",
74
- argsSchema: {
75
- type: "object",
76
- properties: { id: { type: "string" } },
77
- required: ["id"]
78
- },
79
- idempotent: !1,
80
- descriptionKey: "ui.agent.notesPanel.actions.togglePin",
81
- description: "Toggle the pinned state of the note with the given id.",
82
- invoke: (n, s) => {
83
- n.togglePin(s.id);
84
- }
85
- },
86
- toggle_flag: {
87
- safety: "write",
88
- argsType: "{ id: string }",
89
- argsSchema: {
90
- type: "object",
91
- properties: { id: { type: "string" } },
92
- required: ["id"]
93
- },
94
- idempotent: !1,
95
- descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
96
- description: "Toggle the flagged state of the note with the given id.",
97
- invoke: (n, s) => {
98
- n.toggleFlag(s.id);
99
- }
100
- }
101
- },
102
- domHooks: {
103
- root: {
104
- attr: "data-component",
105
- value: "notes-panel",
106
- description: "Marks the NotesPanel region."
107
- },
108
- instanceId: {
109
- attr: "data-component-id",
110
- sourceProp: "id",
111
- description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
112
- }
113
- }
114
- }, we = fe(
115
- "ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]",
116
- {
117
- variants: {
118
- current: {
119
- 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)]",
120
- false: "ds:border-transparent"
121
- }
122
- },
123
- defaultVariants: { current: !1 }
124
- }
125
- );
126
- function z(n) {
127
- return n ? /<img\b/i.test(n) ? !0 : n.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
128
- }
129
- const Me = oe(
130
- function({
131
- id: s,
132
- notes: x,
133
- onAddNote: l,
134
- currentNoteId: c,
135
- currentNoteKey: B,
136
- composer: f = "rich",
137
- editorToolbar: L = "standard",
138
- redactor: W,
139
- imageUploadUrl: E,
140
- showClinicalToggle: I = !0,
141
- canAddClinicalNote: m = !0,
142
- clinicalGatedReason: D,
143
- defaultClinical: P = !1,
144
- onRequestAiDraft: G,
145
- aiDraftFormat: Y,
146
- aiPrivacyNotice: F,
147
- onDictate: J,
148
- onProofread: O,
149
- onAutoFormat: Q,
150
- onTogglePin: g,
151
- onToggleFlag: h,
152
- noteActions: V,
153
- title: U,
154
- composerPlaceholder: X,
155
- addNoteLabel: Z,
156
- emptyState: $,
157
- className: ee,
158
- "aria-label": C,
159
- ...te
160
- }, ne) {
161
- const { t: o } = me(), N = a(null), [d, w] = M(""), [v, j] = M(P), ie = U ?? o("notesPanel.title", { defaultValue: "Notes" }), H = le(), q = X ?? o("notesPanel.placeholder", { defaultValue: "Add a note…" }), K = o("notesPanel.composerLabel", {
162
- defaultValue: "New note"
163
- }), re = f === "rich" ? z(d) : d.trim().length > 0, ae = ce(() => {
164
- var e, t;
165
- if (l) {
166
- if (f === "rich") {
167
- const i = ((e = N.current) == null ? void 0 : e.getHTML()) ?? d;
168
- if (!z(i)) return;
169
- l({ content: i, clinical: v }), (t = N.current) == null || t.clear();
170
- } else {
171
- const i = d.trim();
172
- if (!i) return;
173
- l({ content: i, clinical: v });
174
- }
175
- w(""), j(P);
176
- }
177
- }, [f, d, v, P, l]), T = [...x].sort(
178
- (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
179
- ), R = a(null);
180
- de(() => {
181
- var e, t;
182
- c && ((e = R.current) == null || e.scrollIntoView({ block: "center" }), (t = R.current) == null || t.focus());
183
- }, [c, B]);
184
- const _ = a(x);
185
- _.current = x;
186
- const u = a(l);
187
- u.current = l;
188
- const b = a(g);
189
- b.current = g;
190
- const y = a(h);
191
- y.current = h;
192
- const k = a(m);
193
- k.current = m;
194
- const A = a(c);
195
- A.current = c;
196
- const S = a(null);
197
- ue(ne, () => S.current, []);
198
- const se = pe(
199
- () => ({
200
- // Ids + flags only — never the note body or author (both PHI).
201
- getNotes: () => _.current.map((e) => ({
202
- id: e.id,
203
- pinned: !!e.pinned,
204
- flagged: !!e.flagged,
205
- clinical: !!e.clinical
206
- })),
207
- canAddNote: () => !!u.current,
208
- canAddClinical: () => k.current,
209
- getCurrentNoteId: () => A.current ?? null,
210
- addNote: (e) => {
211
- var t;
212
- e.clinical && !k.current || (t = u.current) == null || t.call(u, e);
213
- },
214
- togglePin: (e) => {
215
- var t;
216
- return (t = b.current) == null ? void 0 : t.call(b, e);
217
- },
218
- toggleFlag: (e) => {
219
- var t;
220
- return (t = y.current) == null ? void 0 : t.call(y, e);
221
- }
222
- }),
223
- []
224
- );
225
- return ge(Ne, se, s), /* @__PURE__ */ p(
226
- "section",
227
- {
228
- ref: S,
229
- "data-component": "notes-panel",
230
- "data-component-id": s,
231
- "aria-labelledby": C ? void 0 : H,
232
- "aria-label": C,
233
- className: ["ds:flex ds:flex-col", ee].filter(Boolean).join(" "),
234
- ...te,
235
- children: [
236
- /* @__PURE__ */ r(
237
- Pe,
238
- {
239
- title: ie,
240
- icon: /* @__PURE__ */ r(Ce, { "aria-hidden": "true" }),
241
- headingId: C ? void 0 : H,
242
- sticky: !0,
243
- divider: !0
244
- }
245
- ),
246
- /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
247
- l ? /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
248
- f === "rich" ? /* @__PURE__ */ r(
249
- ve,
250
- {
251
- ref: N,
252
- ariaLabel: K,
253
- placeholder: q,
254
- toolbar: L,
255
- minHeight: "sm",
256
- redactor: W,
257
- imageUploadUrl: E,
258
- onChange: ({ html: e }) => w(e),
259
- onRequestAiDraft: G,
260
- aiDraftFormat: Y,
261
- aiPrivacyNotice: F,
262
- onDictate: J,
263
- onProofread: O,
264
- onAutoFormat: Q
265
- }
266
- ) : /* @__PURE__ */ r(
267
- be,
268
- {
269
- value: d,
270
- onChange: (e) => w(e.target.value),
271
- placeholder: q,
272
- autoResize: !0,
273
- minRows: 2,
274
- maxRows: 6,
275
- "aria-label": K
276
- }
277
- ),
278
- /* @__PURE__ */ p(
279
- "div",
280
- {
281
- className: [
282
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
283
- I ? "ds:justify-between" : "ds:justify-end"
284
- ].join(" "),
285
- children: [
286
- I ? /* @__PURE__ */ r(
287
- xe,
288
- {
289
- size: "sm",
290
- label: o("notesPanel.clinicalToggle", {
291
- defaultValue: "Clinical note"
292
- }),
293
- checked: v,
294
- onCheckedChange: (e) => j(e === !0),
295
- disabled: !m,
296
- disabledReason: m ? void 0 : D ?? o("notesPanel.clinicalGated", {
297
- defaultValue: "You do not have permission to write clinical notes."
298
- })
299
- }
300
- ) : null,
301
- /* @__PURE__ */ r(
302
- ye,
303
- {
304
- type: "button",
305
- size: "sm",
306
- onClick: ae,
307
- disabled: !re,
308
- children: Z ?? o("notesPanel.add", { defaultValue: "Add note" })
309
- }
310
- )
311
- ]
312
- }
313
- )
314
- ] }) : null,
315
- T.length > 0 ? /* @__PURE__ */ r("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: T.map((e, t) => {
316
- const i = c != null && e.id === c;
317
- return /* @__PURE__ */ p(
318
- "li",
319
- {
320
- ref: i ? R : void 0,
321
- tabIndex: i ? -1 : void 0,
322
- "aria-current": i ? "true" : void 0,
323
- className: we({ current: i }),
324
- children: [
325
- i ? /* @__PURE__ */ r("span", { className: "ds:sr-only", children: o("notesPanel.current", {
326
- defaultValue: "Current note"
327
- }) }) : null,
328
- /* @__PURE__ */ r(
329
- he,
330
- {
331
- surface: "elevated",
332
- truncate: !i,
333
- ...e,
334
- onTogglePin: g && e.id ? () => g(e.id) : void 0,
335
- onToggleFlag: h && e.id ? () => h(e.id) : void 0
336
- }
337
- ),
338
- V ? /* @__PURE__ */ r("div", { className: "ds:flex ds:justify-end ds:gap-[var(--spacing-2xs)] ds:pt-[var(--spacing-2xs)]", children: V(e) }) : null
339
- ]
340
- },
341
- e.id ?? t
342
- );
343
- }) }) : $ ?? /* @__PURE__ */ r("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: o("notesPanel.empty", { defaultValue: "No notes yet." }) })
344
- ] })
345
- ]
346
- }
347
- );
348
- }
349
- );
350
- export {
351
- Me as N
352
- };
353
- //# sourceMappingURL=notes-panel-CTNpsByN.js.map