@alfadocs/ui-kit-debug 1.90.2 → 1.91.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 (272) hide show
  1. package/dist/_chunks/{agenda-card-BDuvreCe.js → agenda-card-BhY342MA.js} +2 -2
  2. package/dist/_chunks/{agenda-card-BDuvreCe.js.map → agenda-card-BhY342MA.js.map} +1 -1
  3. package/dist/_chunks/{agenda-tray-D-jvptdo.js → agenda-tray-BmxBGEci.js} +2 -2
  4. package/dist/_chunks/{agenda-tray-D-jvptdo.js.map → agenda-tray-BmxBGEci.js.map} +1 -1
  5. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js → alia-sidebar-ovRX_oti.js} +3 -3
  6. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js.map → alia-sidebar-ovRX_oti.js.map} +1 -1
  7. package/dist/_chunks/{appointment-card-5JMWi9_f.js → appointment-card-Bstc1p7a.js} +2 -2
  8. package/dist/_chunks/{appointment-card-5JMWi9_f.js.map → appointment-card-Bstc1p7a.js.map} +1 -1
  9. package/dist/_chunks/{appointment-peek-39BwVMUf.js → appointment-peek-C0kKqnFk.js} +2 -2
  10. package/dist/_chunks/{appointment-peek-39BwVMUf.js.map → appointment-peek-C0kKqnFk.js.map} +1 -1
  11. package/dist/_chunks/{appointment-timeline-1-Za2miy.js → appointment-timeline-rbt9AwHO.js} +2 -2
  12. package/dist/_chunks/{appointment-timeline-1-Za2miy.js.map → appointment-timeline-rbt9AwHO.js.map} +1 -1
  13. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js → appointment-tray-6zd8RLIL.js} +2 -2
  14. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js.map → appointment-tray-6zd8RLIL.js.map} +1 -1
  15. package/dist/_chunks/{avatar-BPiPL7ND.js → avatar-a6042Ox2.js} +52 -52
  16. package/dist/_chunks/avatar-a6042Ox2.js.map +1 -0
  17. package/dist/_chunks/{balance-badge-cell-D9VhFp0L.js → balance-badge-cell-BtJvre1-.js} +2 -2
  18. package/dist/_chunks/{balance-badge-cell-D9VhFp0L.js.map → balance-badge-cell-BtJvre1-.js.map} +1 -1
  19. package/dist/_chunks/booking-opt_h7Uc.js +4590 -0
  20. package/dist/_chunks/booking-opt_h7Uc.js.map +1 -0
  21. package/dist/_chunks/{calendar-ClB-jWH1.js → calendar-CmiMS4FJ.js} +2 -2
  22. package/dist/_chunks/{calendar-ClB-jWH1.js.map → calendar-CmiMS4FJ.js.map} +1 -1
  23. package/dist/_chunks/{calendar-appointment-editor-dialog-CiAGAX2t.js → calendar-appointment-editor-dialog-sJKLoVJ2.js} +7 -7
  24. package/dist/_chunks/{calendar-appointment-editor-dialog-CiAGAX2t.js.map → calendar-appointment-editor-dialog-sJKLoVJ2.js.map} +1 -1
  25. package/dist/_chunks/{care-plan-card-BYCPNDvA.js → care-plan-card-DD9rEWYN.js} +2 -2
  26. package/dist/_chunks/{care-plan-card-BYCPNDvA.js.map → care-plan-card-DD9rEWYN.js.map} +1 -1
  27. package/dist/_chunks/{care-plan-header-BzsAg6oY.js → care-plan-header-CXUJQt8Q.js} +2 -2
  28. package/dist/_chunks/{care-plan-header-BzsAg6oY.js.map → care-plan-header-CXUJQt8Q.js.map} +1 -1
  29. package/dist/_chunks/{chat-message-CmFJdEre.js → chat-message-LRO_6Ee3.js} +2 -2
  30. package/dist/_chunks/{chat-message-CmFJdEre.js.map → chat-message-LRO_6Ee3.js.map} +1 -1
  31. package/dist/_chunks/{clinical-note-card-Caidqcwa.js → clinical-note-card-Cut2lNmu.js} +3 -3
  32. package/dist/_chunks/{clinical-note-card-Caidqcwa.js.map → clinical-note-card-Cut2lNmu.js.map} +1 -1
  33. package/dist/_chunks/{contact-card-Czu60UvU.js → contact-card-ClvEDM9e.js} +2 -2
  34. package/dist/_chunks/{contact-card-Czu60UvU.js.map → contact-card-ClvEDM9e.js.map} +1 -1
  35. package/dist/_chunks/{contact-profile-card-Da1vmJQI.js → contact-profile-card-CX45mZA3.js} +106 -95
  36. package/dist/_chunks/contact-profile-card-CX45mZA3.js.map +1 -0
  37. package/dist/_chunks/{dependent-selector-C4kOgO8b.js → dependent-selector-CyNi7M_f.js} +2 -2
  38. package/dist/_chunks/{dependent-selector-C4kOgO8b.js.map → dependent-selector-CyNi7M_f.js.map} +1 -1
  39. package/dist/_chunks/{entity-summary-BLxzSSXK.js → entity-summary-B_bOloqP.js} +3 -3
  40. package/dist/_chunks/{entity-summary-BLxzSSXK.js.map → entity-summary-B_bOloqP.js.map} +1 -1
  41. package/dist/_chunks/error-page-B0fGNTRB.js +419 -0
  42. package/dist/_chunks/error-page-B0fGNTRB.js.map +1 -0
  43. package/dist/_chunks/{languages-CZqBaPwI.js → languages-CGLX6Qpe.js} +3 -15
  44. package/dist/_chunks/languages-CGLX6Qpe.js.map +1 -0
  45. package/dist/_chunks/link-DtCfnLnF.js +332 -0
  46. package/dist/_chunks/link-DtCfnLnF.js.map +1 -0
  47. package/dist/_chunks/{link-cell-renderer-CnCgudvq.js → link-cell-renderer-BS3V4LA6.js} +2 -2
  48. package/dist/_chunks/{link-cell-renderer-CnCgudvq.js.map → link-cell-renderer-BS3V4LA6.js.map} +1 -1
  49. package/dist/_chunks/{marketplace-app-shell-CmZx0Oam.js → marketplace-app-shell-CJQtx3sv.js} +2 -2
  50. package/dist/_chunks/{marketplace-app-shell-CmZx0Oam.js.map → marketplace-app-shell-CJQtx3sv.js.map} +1 -1
  51. package/dist/_chunks/{message-card-CvCnCssc.js → message-card-B6SduXJv.js} +2 -2
  52. package/dist/_chunks/{message-card-CvCnCssc.js.map → message-card-B6SduXJv.js.map} +1 -1
  53. package/dist/_chunks/{message-tray-IJYvy6Cf.js → message-tray-Cllf-v0G.js} +2 -2
  54. package/dist/_chunks/{message-tray-IJYvy6Cf.js.map → message-tray-Cllf-v0G.js.map} +1 -1
  55. package/dist/_chunks/{nav-grid-Oc4aCPrg.js → nav-grid-D2xVcHTO.js} +2 -2
  56. package/dist/_chunks/{nav-grid-Oc4aCPrg.js.map → nav-grid-D2xVcHTO.js.map} +1 -1
  57. package/dist/_chunks/{note-attachment-DIlIQ7JF.js → note-attachment-cnj2JRrg.js} +2 -2
  58. package/dist/_chunks/{note-attachment-DIlIQ7JF.js.map → note-attachment-cnj2JRrg.js.map} +1 -1
  59. package/dist/_chunks/{note-timeline-KzL52MmB.js → note-timeline-BrjHBQfx.js} +2 -2
  60. package/dist/_chunks/{note-timeline-KzL52MmB.js.map → note-timeline-BrjHBQfx.js.map} +1 -1
  61. package/dist/_chunks/{notes-panel-Dywo6R55.js → notes-panel-ib7I3aNf.js} +2 -2
  62. package/dist/_chunks/{notes-panel-Dywo6R55.js.map → notes-panel-ib7I3aNf.js.map} +1 -1
  63. package/dist/_chunks/{operator-hero-6aAIQaFZ.js → operator-hero-C_5B-8Qp.js} +43 -41
  64. package/dist/_chunks/operator-hero-C_5B-8Qp.js.map +1 -0
  65. package/dist/_chunks/{patient-details-BUr7Oemx.js → patient-details-BjcUpD9S.js} +3 -3
  66. package/dist/_chunks/{patient-details-BUr7Oemx.js.map → patient-details-BjcUpD9S.js.map} +1 -1
  67. package/dist/_chunks/{patient-field-row-bJk8Q_qr.js → patient-field-row-B0tdiaWi.js} +2 -2
  68. package/dist/_chunks/{patient-field-row-bJk8Q_qr.js.map → patient-field-row-B0tdiaWi.js.map} +1 -1
  69. package/dist/_chunks/{patient-summary-card-CCQZ8X37.js → patient-summary-card-Cvv6_Ugk.js} +4 -4
  70. package/dist/_chunks/{patient-summary-card-CCQZ8X37.js.map → patient-summary-card-Cvv6_Ugk.js.map} +1 -1
  71. package/dist/_chunks/{payment-request-card-MndSlVoK.js → payment-request-card-BfGauFY0.js} +2 -2
  72. package/dist/_chunks/{payment-request-card-MndSlVoK.js.map → payment-request-card-BfGauFY0.js.map} +1 -1
  73. package/dist/_chunks/{practice-profile-hero-qfrsFQI_.js → practice-profile-hero-ClzE-4CB.js} +76 -73
  74. package/dist/_chunks/practice-profile-hero-ClzE-4CB.js.map +1 -0
  75. package/dist/_chunks/{practice-results-DQuOfqej.js → practice-results-CQ_KvEXK.js} +517 -514
  76. package/dist/_chunks/practice-results-CQ_KvEXK.js.map +1 -0
  77. package/dist/_chunks/{product-hub-panel-Blag8t8f.js → product-hub-panel-bHi7lkVD.js} +2 -2
  78. package/dist/_chunks/{product-hub-panel-Blag8t8f.js.map → product-hub-panel-bHi7lkVD.js.map} +1 -1
  79. package/dist/_chunks/public-footer-IoRWoAMz.js +596 -0
  80. package/dist/_chunks/public-footer-IoRWoAMz.js.map +1 -0
  81. package/dist/_chunks/{signature-request-DjY-X62H.js → signature-request-DvhyrRpn.js} +3 -3
  82. package/dist/_chunks/{signature-request-DjY-X62H.js.map → signature-request-DvhyrRpn.js.map} +1 -1
  83. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js → signed-out-frame-CgRXOUzi.js} +2 -2
  84. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js.map → signed-out-frame-CgRXOUzi.js.map} +1 -1
  85. package/dist/_chunks/{slot-grid-DrwynKeN.js → slot-grid-B-IAFX3C.js} +180 -169
  86. package/dist/_chunks/slot-grid-B-IAFX3C.js.map +1 -0
  87. package/dist/_chunks/{timeline-wUuTDFY_.js → timeline-BcYHdP56.js} +2 -2
  88. package/dist/_chunks/{timeline-wUuTDFY_.js.map → timeline-BcYHdP56.js.map} +1 -1
  89. package/dist/_chunks/{use-appointment-details-read-BytPq3Ux.js → use-appointment-details-read-D8vDg0sg.js} +5 -5
  90. package/dist/_chunks/{use-appointment-details-read-BytPq3Ux.js.map → use-appointment-details-read-D8vDg0sg.js.map} +1 -1
  91. package/dist/agent-catalog.json +2 -2
  92. package/dist/components/_shared/social-brand-icons.d.ts +29 -0
  93. package/dist/components/_shared/social-brand-icons.d.ts.map +1 -0
  94. package/dist/components/agenda-card/index.js +1 -1
  95. package/dist/components/agenda-tray/index.js +1 -1
  96. package/dist/components/appointment-card/index.js +2 -2
  97. package/dist/components/appointment-details-panel/index.js +1 -1
  98. package/dist/components/appointment-peek/index.js +1 -1
  99. package/dist/components/appointment-timeline/index.js +1 -1
  100. package/dist/components/avatar/avatar.d.ts +14 -0
  101. package/dist/components/avatar/avatar.d.ts.map +1 -1
  102. package/dist/components/avatar/index.js +1 -1
  103. package/dist/components/booking/booking-types.d.ts +26 -0
  104. package/dist/components/booking/booking-types.d.ts.map +1 -1
  105. package/dist/components/booking/booking.d.ts.map +1 -1
  106. package/dist/components/booking/details-form.d.ts.map +1 -1
  107. package/dist/components/booking/index.js +1 -1
  108. package/dist/components/booking/slot-load-state.d.ts +11 -0
  109. package/dist/components/booking/slot-load-state.d.ts.map +1 -0
  110. package/dist/components/calendar/index.js +1 -1
  111. package/dist/components/care-plan-card/index.js +1 -1
  112. package/dist/components/care-plan-header/index.js +1 -1
  113. package/dist/components/chat-message/index.js +1 -1
  114. package/dist/components/clinical-note-card/index.js +1 -1
  115. package/dist/components/contact-card/index.js +1 -1
  116. package/dist/components/contact-profile-card/index.js +1 -1
  117. package/dist/components/data-table/index.js +1 -1
  118. package/dist/components/dependent-selector/index.js +1 -1
  119. package/dist/components/entity-summary/index.js +1 -1
  120. package/dist/components/link/index.js +1 -1
  121. package/dist/components/link/link.d.ts +10 -1
  122. package/dist/components/link/link.d.ts.map +1 -1
  123. package/dist/components/link/social-url.d.ts +71 -0
  124. package/dist/components/link/social-url.d.ts.map +1 -0
  125. package/dist/components/message-card/index.js +1 -1
  126. package/dist/components/message-tray/index.js +1 -1
  127. package/dist/components/nav-grid/index.js +1 -1
  128. package/dist/components/note-timeline/index.js +1 -1
  129. package/dist/components/notes-panel/index.js +1 -1
  130. package/dist/components/operator-hero/index.js +1 -1
  131. package/dist/components/operator-hero/operator-hero.d.ts +6 -0
  132. package/dist/components/operator-hero/operator-hero.d.ts.map +1 -1
  133. package/dist/components/patient-details/index.js +1 -1
  134. package/dist/components/patient-summary-card/index.js +1 -1
  135. package/dist/components/patient-table/index.js +1 -1
  136. package/dist/components/payment-card/index.js +1 -1
  137. package/dist/components/practice-profile-hero/index.js +1 -1
  138. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +6 -0
  139. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -1
  140. package/dist/components/practice-results/index.js +1 -1
  141. package/dist/components/practice-results/practice-results.d.ts +8 -2
  142. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  143. package/dist/components/product-hub-tray/index.js +1 -1
  144. package/dist/components/public-footer/index.js +1 -1
  145. package/dist/components/public-footer/public-footer.d.ts +13 -1
  146. package/dist/components/public-footer/public-footer.d.ts.map +1 -1
  147. package/dist/components/public-footer/socials.d.ts +6 -5
  148. package/dist/components/public-footer/socials.d.ts.map +1 -1
  149. package/dist/components/slot-grid/index.js +1 -1
  150. package/dist/components/slot-grid/slot-grid.d.ts +2 -0
  151. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  152. package/dist/components/timeline/index.js +1 -1
  153. package/dist/i18n/config.d.ts.map +1 -1
  154. package/dist/i18n/config.js +224 -96
  155. package/dist/i18n/config.js.map +1 -1
  156. package/dist/i18n/locales/ar.d.ts +3 -0
  157. package/dist/i18n/locales/ar.d.ts.map +1 -1
  158. package/dist/i18n/locales/ar.js +4 -1
  159. package/dist/i18n/locales/ar.js.map +1 -1
  160. package/dist/i18n/locales/de.d.ts +3 -0
  161. package/dist/i18n/locales/de.d.ts.map +1 -1
  162. package/dist/i18n/locales/de.js +4 -1
  163. package/dist/i18n/locales/de.js.map +1 -1
  164. package/dist/i18n/locales/el.d.ts +3 -0
  165. package/dist/i18n/locales/el.d.ts.map +1 -1
  166. package/dist/i18n/locales/el.js +4 -1
  167. package/dist/i18n/locales/el.js.map +1 -1
  168. package/dist/i18n/locales/en.d.ts +3 -0
  169. package/dist/i18n/locales/en.d.ts.map +1 -1
  170. package/dist/i18n/locales/en.js +3 -0
  171. package/dist/i18n/locales/en.js.map +1 -1
  172. package/dist/i18n/locales/es.d.ts +3 -0
  173. package/dist/i18n/locales/es.d.ts.map +1 -1
  174. package/dist/i18n/locales/es.js +4 -1
  175. package/dist/i18n/locales/es.js.map +1 -1
  176. package/dist/i18n/locales/fr.d.ts +3 -0
  177. package/dist/i18n/locales/fr.d.ts.map +1 -1
  178. package/dist/i18n/locales/fr.js +4 -1
  179. package/dist/i18n/locales/fr.js.map +1 -1
  180. package/dist/i18n/locales/hi.d.ts +3 -0
  181. package/dist/i18n/locales/hi.d.ts.map +1 -1
  182. package/dist/i18n/locales/hi.js +4 -1
  183. package/dist/i18n/locales/hi.js.map +1 -1
  184. package/dist/i18n/locales/it.d.ts +3 -0
  185. package/dist/i18n/locales/it.d.ts.map +1 -1
  186. package/dist/i18n/locales/it.js +4 -1
  187. package/dist/i18n/locales/it.js.map +1 -1
  188. package/dist/i18n/locales/ja.d.ts +3 -0
  189. package/dist/i18n/locales/ja.d.ts.map +1 -1
  190. package/dist/i18n/locales/ja.js +4 -1
  191. package/dist/i18n/locales/ja.js.map +1 -1
  192. package/dist/i18n/locales/nl.d.ts +3 -0
  193. package/dist/i18n/locales/nl.d.ts.map +1 -1
  194. package/dist/i18n/locales/nl.js +4 -1
  195. package/dist/i18n/locales/nl.js.map +1 -1
  196. package/dist/i18n/locales/pl.d.ts +3 -0
  197. package/dist/i18n/locales/pl.d.ts.map +1 -1
  198. package/dist/i18n/locales/pl.js +4 -1
  199. package/dist/i18n/locales/pl.js.map +1 -1
  200. package/dist/i18n/locales/pt.d.ts +3 -0
  201. package/dist/i18n/locales/pt.d.ts.map +1 -1
  202. package/dist/i18n/locales/pt.js +4 -1
  203. package/dist/i18n/locales/pt.js.map +1 -1
  204. package/dist/i18n/locales/ro.d.ts +3 -0
  205. package/dist/i18n/locales/ro.d.ts.map +1 -1
  206. package/dist/i18n/locales/ro.js +4 -1
  207. package/dist/i18n/locales/ro.js.map +1 -1
  208. package/dist/i18n/locales/ru.d.ts +3 -0
  209. package/dist/i18n/locales/ru.d.ts.map +1 -1
  210. package/dist/i18n/locales/ru.js +4 -1
  211. package/dist/i18n/locales/ru.js.map +1 -1
  212. package/dist/i18n/locales/sq.d.ts +3 -0
  213. package/dist/i18n/locales/sq.d.ts.map +1 -1
  214. package/dist/i18n/locales/sq.js +4 -1
  215. package/dist/i18n/locales/sq.js.map +1 -1
  216. package/dist/i18n/locales/sv.d.ts +3 -0
  217. package/dist/i18n/locales/sv.d.ts.map +1 -1
  218. package/dist/i18n/locales/sv.js +4 -1
  219. package/dist/i18n/locales/sv.js.map +1 -1
  220. package/dist/i18n/locales/tr.d.ts +3 -0
  221. package/dist/i18n/locales/tr.d.ts.map +1 -1
  222. package/dist/i18n/locales/tr.js +4 -1
  223. package/dist/i18n/locales/tr.js.map +1 -1
  224. package/dist/i18n/locales/zh.d.ts +3 -0
  225. package/dist/i18n/locales/zh.d.ts.map +1 -1
  226. package/dist/i18n/locales/zh.js +4 -1
  227. package/dist/i18n/locales/zh.js.map +1 -1
  228. package/dist/index.js +42 -42
  229. package/dist/locales/ar.json +4 -1
  230. package/dist/locales/de.json +4 -1
  231. package/dist/locales/el.json +4 -1
  232. package/dist/locales/en.json +3 -0
  233. package/dist/locales/es.json +4 -1
  234. package/dist/locales/fr.json +4 -1
  235. package/dist/locales/hi.json +4 -1
  236. package/dist/locales/it.json +4 -1
  237. package/dist/locales/ja.json +4 -1
  238. package/dist/locales/nl.json +4 -1
  239. package/dist/locales/pl.json +4 -1
  240. package/dist/locales/pt.json +4 -1
  241. package/dist/locales/ro.json +4 -1
  242. package/dist/locales/ru.json +4 -1
  243. package/dist/locales/sq.json +4 -1
  244. package/dist/locales/sv.json +4 -1
  245. package/dist/locales/tr.json +4 -1
  246. package/dist/locales/zh.json +4 -1
  247. package/dist/patterns/alia-assistant/index.js +1 -1
  248. package/dist/patterns/calendar/index.js +1 -1
  249. package/dist/patterns/error-page/error-page-english.d.ts +71 -0
  250. package/dist/patterns/error-page/error-page-english.d.ts.map +1 -0
  251. package/dist/patterns/error-page/error-page.d.ts.map +1 -1
  252. package/dist/patterns/error-page/index.js +1 -1
  253. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  254. package/dist/patterns/signature-request/index.js +1 -1
  255. package/dist/patterns/signed-out-frame/index.js +1 -1
  256. package/dist/tokens.css +1 -1
  257. package/package.json +1 -1
  258. package/dist/_chunks/avatar-BPiPL7ND.js.map +0 -1
  259. package/dist/_chunks/booking-CcE_oviI.js +0 -4373
  260. package/dist/_chunks/booking-CcE_oviI.js.map +0 -1
  261. package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +0 -1
  262. package/dist/_chunks/error-page-Bhai-spN.js +0 -344
  263. package/dist/_chunks/error-page-Bhai-spN.js.map +0 -1
  264. package/dist/_chunks/languages-CZqBaPwI.js.map +0 -1
  265. package/dist/_chunks/link-N5_YpLtm.js +0 -138
  266. package/dist/_chunks/link-N5_YpLtm.js.map +0 -1
  267. package/dist/_chunks/operator-hero-6aAIQaFZ.js.map +0 -1
  268. package/dist/_chunks/practice-profile-hero-qfrsFQI_.js.map +0 -1
  269. package/dist/_chunks/practice-results-DQuOfqej.js.map +0 -1
  270. package/dist/_chunks/public-footer-CXOrdAaS.js +0 -568
  271. package/dist/_chunks/public-footer-CXOrdAaS.js.map +0 -1
  272. package/dist/_chunks/slot-grid-DrwynKeN.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as O, useId as P, useRef as z } from "react";
3
- import { c as j } from "./index-D2ZczOXr.js";
4
- import { useTranslation as I } from "react-i18next";
5
- import { A as T } from "./avatar-BPiPL7ND.js";
6
- import { B as V } from "./badge-BUk4RjTS.js";
7
- import { C as B } from "./card-BA4Ig_kn.js";
8
- import { R as K } from "./rating-CGYpg5dj.js";
9
- import { f as S } from "./format-number-DdzqwMs1.js";
10
- import { u as E } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
11
- import { u as M } from "./registry-DvAUVLHh.js";
12
- import { c as W } from "./entity-card-fpm-KUKc.js";
13
- const $ = {
2
+ import { forwardRef as P, useId as z, useRef as j } from "react";
3
+ import { c as I } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as T } from "react-i18next";
5
+ import { A as V } from "./avatar-a6042Ox2.js";
6
+ import { B } from "./badge-BUk4RjTS.js";
7
+ import { C as K } from "./card-BA4Ig_kn.js";
8
+ import { R as S } from "./rating-CGYpg5dj.js";
9
+ import { f as E } from "./format-number-DdzqwMs1.js";
10
+ import { u as M } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
11
+ import { u as W } from "./registry-DvAUVLHh.js";
12
+ import { c as $ } from "./entity-card-fpm-KUKc.js";
13
+ const q = {
14
14
  id: "operator-hero",
15
15
  // Purely observable hero region — no interactive affordances and no
16
16
  // imperative actions on the handle (getName / getHasColor are read-only
@@ -44,7 +44,7 @@ const $ = {
44
44
  description: "Sourced from the id prop."
45
45
  }
46
46
  }
47
- }, q = j("ds:w-full ds:text-[color:var(--foreground)]", {
47
+ }, D = I("ds:w-full ds:text-[color:var(--foreground)]", {
48
48
  variants: {
49
49
  // Density toggle. Default `comfortable` matches the practice hero's
50
50
  // visual weight minus the cover strip. `compact` is for embedded
@@ -65,51 +65,53 @@ const $ = {
65
65
  density: "comfortable",
66
66
  surface: "elevated"
67
67
  }
68
- }), D = O(
68
+ }), F = P(
69
69
  ({
70
70
  name: r,
71
71
  colorId: l,
72
72
  tagline: p,
73
73
  imageUrl: x,
74
+ imageAlt: b,
74
75
  rating: a,
75
76
  badges: i,
76
77
  actionSlot: m,
77
78
  density: s = "comfortable",
78
79
  surface: u = "elevated",
79
- "aria-label": b,
80
+ "aria-label": y,
80
81
  id: n,
81
- className: y,
82
- ...N
83
- }, H) => {
84
- const { t: c, i18n: C } = I("ui"), f = P(), k = b ?? c("operatorHero.regionLabel"), d = l != null, v = z(null);
85
- M(
86
- $,
82
+ className: N,
83
+ ...H
84
+ }, C) => {
85
+ const { t: c, i18n: k } = T("ui"), f = z(), R = y ?? c("operatorHero.regionLabel"), d = l != null, v = j(null);
86
+ W(
87
+ q,
87
88
  { getName: () => r, getHasColor: () => d },
88
89
  n
89
- ), E(() => {
90
+ ), M(() => {
90
91
  const o = v.current;
91
- o && (d ? o.style.setProperty("--operator-hero-color", W(l)) : o.style.removeProperty("--operator-hero-color"));
92
+ o && (d ? o.style.setProperty("--operator-hero-color", $(l)) : o.style.removeProperty("--operator-hero-color"));
92
93
  }, [d, l]);
93
- const g = a ? S(a.value, C.language) : void 0, R = a ? c("operatorHero.ratingLabel", {
94
+ const g = a ? E(a.value, k.language) : void 0, L = a ? c("operatorHero.ratingLabel", {
94
95
  value: g,
95
96
  count: a.count
96
- }) : void 0, L = s === "comfortable" ? "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]" : "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", w = s === "comfortable" ? "2xl" : "xl", A = s === "comfortable" ? "type-title-page" : "type-title-card", h = /* @__PURE__ */ t(
97
+ }) : void 0, w = s === "comfortable" ? "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]" : "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", A = s === "comfortable" ? "2xl" : "xl", O = s === "comfortable" ? "type-title-page" : "type-title-card", h = /* @__PURE__ */ t(
97
98
  "div",
98
99
  {
99
100
  className: [
100
101
  "ds:flex ds:items-start ds:gap-[var(--spacing-lg)]",
101
- L,
102
+ w,
102
103
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]"
103
104
  ].join(" "),
104
105
  children: [
105
106
  /* @__PURE__ */ e(
106
- T,
107
+ V,
107
108
  {
108
- size: w,
109
+ size: A,
109
110
  shape: "rounded",
110
111
  ratio: "3:4",
111
112
  name: r,
112
113
  src: x,
114
+ alt: b,
113
115
  className: "ds:shrink-0"
114
116
  }
115
117
  ),
@@ -119,7 +121,7 @@ const $ = {
119
121
  "h1",
120
122
  {
121
123
  id: f,
122
- className: `${A} ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]`,
124
+ className: `${O} ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]`,
123
125
  children: [
124
126
  d ? /* @__PURE__ */ e(
125
127
  "span",
@@ -153,10 +155,10 @@ const $ = {
153
155
  {
154
156
  role: "img",
155
157
  className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
156
- "aria-label": R,
158
+ "aria-label": L,
157
159
  children: [
158
160
  /* @__PURE__ */ e(
159
- K,
161
+ S,
160
162
  {
161
163
  value: a.value,
162
164
  max: 5,
@@ -179,7 +181,7 @@ const $ = {
179
181
  role: "list",
180
182
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)] ds:mt-[var(--spacing-2xs)]",
181
183
  children: i.map((o) => /* @__PURE__ */ e(
182
- V,
184
+ B,
183
185
  {
184
186
  variant: o.variant ?? "neutral",
185
187
  role: "listitem",
@@ -196,24 +198,24 @@ const $ = {
196
198
  return /* @__PURE__ */ e(
197
199
  "div",
198
200
  {
199
- ref: H,
201
+ ref: C,
200
202
  role: "region",
201
- "aria-label": k,
203
+ "aria-label": R,
202
204
  "aria-labelledby": f,
203
205
  "data-component": "operator-hero",
204
206
  "data-component-id": n,
205
207
  "data-density": s,
206
208
  id: n,
207
- className: q({ surface: u, density: s, className: y }),
208
- ...N,
209
- children: u === "elevated" ? /* @__PURE__ */ e(B, { variant: "elevated", children: h }) : h
209
+ className: D({ surface: u, density: s, className: N }),
210
+ ...H,
211
+ children: u === "elevated" ? /* @__PURE__ */ e(K, { variant: "elevated", children: h }) : h
210
212
  }
211
213
  );
212
214
  }
213
215
  );
214
- D.displayName = "OperatorHero";
216
+ F.displayName = "OperatorHero";
215
217
  export {
216
- D as O,
217
- $ as o
218
+ F as O,
219
+ q as o
218
220
  };
219
- //# sourceMappingURL=operator-hero-6aAIQaFZ.js.map
221
+ //# sourceMappingURL=operator-hero-C_5B-8Qp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-hero-C_5B-8Qp.js","sources":["../../src/components/operator-hero/operator-hero.agent.ts","../../src/components/operator-hero/operator-hero.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { OperatorHeroHandle } from './operator-hero';\n\nexport const operatorHeroAgent: AgentAdapter<OperatorHeroHandle> = {\n id: 'operator-hero',\n // Purely observable hero region — no interactive affordances and no\n // imperative actions on the handle (getName / getHasColor are read-only\n // projections). The previous `view_change` capability had no backing\n // action and is removed.\n capabilities: [],\n state: {\n name: {\n type: 'string',\n descriptionKey: 'ui.agent.operatorHero.state.name',\n description: 'Operator display name currently rendered.',\n read: (handle) => handle.getName(),\n },\n hasColor: {\n type: 'boolean',\n descriptionKey: 'ui.agent.operatorHero.state.hasColor',\n description:\n 'Whether a calendar-colour identity dot is rendered. Structural flag only — never the colour id or any PHI.',\n read: (handle) => handle.getHasColor(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'operator-hero',\n description: 'Marks the OperatorHero root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { Rating } from '../rating/rating';\nimport { formatRating } from '../_shared/format-number';\nimport { colorIdToToken } from '../_shared/entity-card';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { operatorHeroAgent } from './operator-hero.agent';\n\n/* -------------------------------------------------------------------- */\n/* OperatorHero */\n/* */\n/* The operator-page counterpart to the consumer-side `<PracticeHero>` */\n/* / `<PracticeProfileHero>` pattern. Differences from the practice */\n/* hero (per the spec): */\n/* */\n/* - Avatar instead of a full hero image background */\n/* - Ratings + reviews summary rendered inline */\n/* - Slightly shorter vertically — no cover strip, denser padding */\n/* */\n/* Use case: individual operator profile page (`/dentista/<slug>/ */\n/* operatori/<name>`), pair with `<ContactProfileCard>` below to fill */\n/* in the operator's contact + profession info. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Density toggle. Default `comfortable` matches the practice hero's\n // visual weight minus the cover strip. `compact` is for embedded\n // surfaces (booking aside, ROI Dashboard practice panel) where the\n // hero needs to fit in <12rem vertical.\n density: {\n comfortable: '',\n compact: '',\n },\n // Matches the kit's other `surface` props (Booking, ReviewsPanel,\n // ContactProfileCard). `'elevated'` wraps in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: {\n density: 'comfortable',\n surface: 'elevated',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface OperatorHeroBadge {\n /** Display key — i18n is up to the consumer. */\n key: string;\n /** Display label. */\n label: string;\n /** Badge variant — falls back to `neutral`. */\n variant?: 'neutral' | 'info' | 'success' | 'warning' | 'error';\n}\n\nexport interface OperatorHeroRating {\n /** Mean rating, 0–5. */\n value: number;\n /** Total number of reviews. */\n count: number;\n}\n\nexport interface OperatorHeroHandle {\n getName: () => string;\n /** Structural flag — whether a calendar-colour dot is rendered. No PHI. */\n getHasColor: () => boolean;\n}\n\nexport interface OperatorHeroProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Operator's display name. Rendered as the H1 heading. */\n name: string;\n /**\n * Optional calendar-colour identity for the operator. AlfaDocs assigns each\n * operator a numeric colour id; when present, a small colour dot is rendered\n * next to the name, tinted via `colorIdToToken(colorId)` (a `var(--…)` palette\n * token — never a literal). The id itself is a structural identifier, not PHI.\n */\n colorId?: string;\n /** Specialty / tagline subtitle (e.g. \"Dermatologa · 12 anni di esperienza\"). */\n tagline?: string;\n /**\n * Optional photo / avatar URL. The kit always renders an `<Avatar>` —\n * when `imageUrl` is missing the avatar falls back to initials.\n */\n imageUrl?: string;\n /**\n * Text alternative for the photo's `<img>`, for image search and crawlers.\n * Pass the professional's name. Leave it out and the photo stays decorative\n * (`alt=\"\"`), as before. Added in 1.91.0.\n */\n imageAlt?: string;\n /** Rating summary — when present, renders a Rating + numeric breakdown line. */\n rating?: OperatorHeroRating;\n /**\n * Optional badge row beneath the rating. Use sparingly — 1–3 chips\n * suit the hero's density; longer lists belong in `<ContactProfileCard>`.\n */\n badges?: OperatorHeroBadge[];\n\n /* ----- Slots ----- */\n\n /**\n * Rendered at the inline-end of the heading row (right side on LTR).\n * Use for a \"Book with this operator\" `<Button>` or a \"Back to\n * practice\" link.\n */\n actionSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `comfortable` (default) — matches the practice hero's visual\n * weight minus the cover strip. `compact` halves the vertical\n * padding for embedded surfaces.\n */\n density?: 'comfortable' | 'compact';\n /**\n * `elevated` (default) wraps in `<Card variant=\"elevated\">`. `flat`\n * drops the Card — use inside another card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n 'aria-label'?: string;\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const OperatorHero = forwardRef<HTMLDivElement, OperatorHeroProps>(\n (\n {\n name,\n colorId,\n tagline,\n imageUrl,\n imageAlt,\n rating,\n badges,\n actionSlot,\n density = 'comfortable',\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const resolvedAriaLabel = ariaLabel ?? t('operatorHero.regionLabel');\n\n // Calendar-colour dot. Tint via a component-scoped CSS custom property set\n // imperatively on a ref — mirrors the Avatar `--avatar-color-override`\n // idiom so no `style={{…}}` attribute lands on the JSX (constraint §4).\n const hasColor = colorId !== undefined && colorId !== null;\n const dotRef = useRef<HTMLSpanElement>(null);\n\n useAgentRegistration(\n operatorHeroAgent,\n { getName: () => name, getHasColor: () => hasColor },\n id,\n );\n useIsomorphicLayoutEffect(() => {\n const el = dotRef.current;\n if (!el) return;\n if (hasColor) {\n el.style.setProperty('--operator-hero-color', colorIdToToken(colorId));\n } else {\n el.style.removeProperty('--operator-hero-color');\n }\n }, [hasColor, colorId]);\n\n // Same figure as the practice hero's Rating (\"4,9\" in Italian, \"5\"\n // for a whole score), so the visible line, this label and the\n // inner Rating's label all agree.\n const ratingValue = rating\n ? formatRating(rating.value, i18n.language)\n : undefined;\n const ratingLabel = rating\n ? t('operatorHero.ratingLabel', {\n value: ratingValue,\n count: rating.count,\n })\n : undefined;\n\n // Padding scales with density. Comfortable matches the practice\n // hero's `pt-xl pb-md` minus the cover strip; compact halves it.\n const bodyPaddingClass =\n density === 'comfortable'\n ? 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]'\n : 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]';\n\n // Avatar size keys off density: its height. Comfortable = 2xl\n // (128px) to read as the page hero, compact = xl (64px) for embedded\n // use. The 3:4 photo is three quarters as wide.\n const avatarSize = density === 'comfortable' ? '2xl' : 'xl';\n\n // Heading scale tracks density too. Comfortable uses the kit's\n // page-title token; compact drops to title-card so the operator\n // name doesn't dominate an embedded surface.\n const headingClass =\n density === 'comfortable' ? 'type-title-page' : 'type-title-card';\n\n const inner = (\n <div\n className={[\n 'ds:flex ds:items-start ds:gap-[var(--spacing-lg)]',\n bodyPaddingClass,\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n ].join(' ')}\n >\n {/* HTP-6712: the professional's photo is a 3:4 rounded rectangle,\n cropped towards the top so the face stays in. Same height as\n the old circle (128px, compact 64px). */}\n <Avatar\n size={avatarSize}\n shape=\"rounded\"\n ratio=\"3:4\"\n name={name}\n src={imageUrl}\n alt={imageAlt}\n className=\"ds:shrink-0\"\n />\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap\">\n <h1\n id={headingId}\n className={`${headingClass} ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]`}\n >\n {hasColor ? (\n <span\n ref={dotRef}\n role=\"img\"\n aria-label={t('operatorHero.colorLabel', 'Calendar colour')}\n className=\"ds:inline-block ds:size-[var(--spacing-sm)] ds:shrink-0 ds:rounded-[var(--radius-full)] ds:bg-[var(--operator-hero-color)]\"\n />\n ) : null}\n {/* Practice-written name and tagline keep the direction they\n were typed in. The name gets its own span: `dir` on the\n flex h1 would move the colour dot too. */}\n <span dir=\"auto\">{name}</span>\n </h1>\n {actionSlot ? (\n <div className=\"ds:ms-auto ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-xs)]\">\n {actionSlot}\n </div>\n ) : null}\n </div>\n {tagline ? (\n <p\n dir=\"auto\"\n className=\"type-body ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {tagline}\n </p>\n ) : null}\n {rating ? (\n // One image with one name (\"4,9 out of 5 stars. Reviews: 7.\"):\n // a name on a div without a role is ignored by screen readers,\n // which then read the stars and \"4,9 · 7\" with no \"reviews\".\n <div\n role=\"img\"\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n aria-label={ratingLabel}\n >\n {/* Decorative: the group above carries the one name. */}\n <Rating\n value={rating.value}\n max={5}\n size={density === 'comfortable' ? 'md' : 'sm'}\n decorative\n />\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {ratingValue} · {rating.count}\n </span>\n </div>\n ) : null}\n {badges && badges.length > 0 ? (\n <div\n role=\"list\"\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)] ds:mt-[var(--spacing-2xs)]\"\n >\n {badges.map((badge) => (\n <Badge\n key={badge.key}\n variant={badge.variant ?? 'neutral'}\n role=\"listitem\"\n >\n {badge.label}\n </Badge>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"operator-hero\"\n data-component-id={id}\n data-density={density}\n id={id}\n className={rootVariants({ surface, density, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">{inner}</Card>\n ) : (\n inner\n )}\n </div>\n );\n },\n);\n\nOperatorHero.displayName = 'OperatorHero';\n\nexport type OperatorHeroDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["operatorHeroAgent","handle","rootVariants","cva","OperatorHero","forwardRef","name","colorId","tagline","imageUrl","imageAlt","rating","badges","actionSlot","density","surface","ariaLabel","id","className","rest","ref","t","i18n","useTranslation","headingId","useId","resolvedAriaLabel","hasColor","dotRef","useRef","useAgentRegistration","useIsomorphicLayoutEffect","el","colorIdToToken","ratingValue","formatRating","ratingLabel","bodyPaddingClass","avatarSize","headingClass","inner","jsxs","jsx","Avatar","Rating","badge","Badge","Card"],"mappings":";;;;;;;;;;;;AAGO,MAAMA,IAAsD;AAAA,EACjE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAKJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,IAEnC,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,EACvC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,M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kBAAe;AAAA,QACf,qBAAmBP;AAAA,QACnB,gBAAcH;AAAA,QACd,IAAAG;AAAA,QACA,WAAWf,EAAa,EAAE,SAAAa,GAAS,SAAAD,GAAS,WAAAI,GAAW;AAAA,QACtD,GAAGC;AAAA,QAEH,gBAAY,aACX,gBAAAuB,EAACK,KAAK,SAAQ,YAAY,aAAM,IAEhCP;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEApC,EAAa,cAAc;"}
@@ -2,13 +2,13 @@ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
2
  import { forwardRef as X, useId as T, useMemo as Z, Fragment as $ } from "react";
3
3
  import { c as j } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as A } from "react-i18next";
5
- import { A as ee } from "./avatar-BPiPL7ND.js";
5
+ import { A as ee } from "./avatar-a6042Ox2.js";
6
6
  import { C as f } from "./card-BA4Ig_kn.js";
7
7
  import { C as ie, b as te, a as se } from "./collapsible-DVPM46bq.js";
8
8
  import { D as ae } from "./description-list-BxzDN9o2.js";
9
9
  import { P as de } from "./panel-header-CbtlTe85.js";
10
10
  import { u as re } from "./registry-DvAUVLHh.js";
11
- import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-bJk8Q_qr.js";
11
+ import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-B0tdiaWi.js";
12
12
  import { C as pe } from "./clipboard-list-rSzfIYZB.js";
13
13
  const me = {
14
14
  id: "patient-details",
@@ -368,4 +368,4 @@ export {
368
368
  ue as P,
369
369
  me as p
370
370
  };
371
- //# sourceMappingURL=patient-details-BUr7Oemx.js.map
371
+ //# sourceMappingURL=patient-details-BjcUpD9S.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-details-BUr7Oemx.js","sources":["../../src/components/patient-details/patient-details.agent.ts","../../src/components/patient-details/patient-details.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { PatientDetailsHandle } from './patient-details';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientDetails */\n/* */\n/* Exposes the patient panel to a future MCP runtime: */\n/* - VIEW CONFIG (safety: write) — show/hide + reorder the visible */\n/* field set. These mutate the user's view, not the patient record. */\n/* - PHI WRITE (safety: phi) — `update_field` writes a patient field */\n/* value. It is the ONLY PHI mutation and routes through the same */\n/* `onFieldSave` path as a human inline edit, so the consumer's */\n/* permission + validation + audit are the single write authority. */\n/* `phi` (not `write`) forces the runtime's confirm-before-act gate. */\n/* */\n/* STATE exposes only field KEYS (`visibleFieldOrder`) and an opaque */\n/* `patientId` — never a field value or patient identity (PRS §Security, */\n/* 26-agent-readiness §6.1/§7). */\n/* -------------------------------------------------------------------- */\n\nexport const patientDetailsAgent: AgentAdapter<PatientDetailsHandle> = {\n id: 'patient-details',\n // `view_change` backs the view-config actions (show/hide + reorder are both\n // view reconfigurations); `set_value` backs the single-value `update_field`\n // (not `edit_inline`, which is for granular free-text/formatting edits).\n capabilities: ['view_change', 'set_value'],\n state: {\n visibleFieldOrder: {\n type: 'string[]',\n descriptionKey: 'ui.agent.patientDetails.state.visibleFieldOrder',\n description:\n 'Ordered list of visible field KEYS (e.g. \"fiscalCode\"). Never a field value.',\n read: (handle) => handle.getVisibleFieldOrder(),\n },\n patientId: {\n type: 'string | undefined',\n descriptionKey: 'ui.agent.patientDetails.state.patientId',\n description:\n 'Opaque patient id the panel is bound to. No patient-identifiable data.',\n read: (handle) => handle.getPatientId(),\n },\n },\n actions: {\n set_visible_fields: {\n safety: 'write',\n argsType: '{ fieldIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['fieldIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setVisibleFields',\n description:\n 'Set which fields are visible (and their order). Unknown ids are ignored.',\n examples: [\n {\n args: { fieldIds: ['lastName', 'firstName', 'phone', 'email'] },\n note: 'Show only name + contact fields.',\n },\n ],\n invoke: (handle, args: { fieldIds: string[] }) => {\n handle.setVisibleFields(args.fieldIds);\n },\n },\n set_field_order: {\n safety: 'write',\n argsType: '{ orderedIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n orderedIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['orderedIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setFieldOrder',\n description:\n 'Reorder the visible fields. Order within a section is honoured; sections stay fixed.',\n invoke: (handle, args: { orderedIds: string[] }) => {\n handle.setFieldOrder(args.orderedIds);\n },\n },\n update_field: {\n // PHI: mutates a patient-identifiable value. NOT `write` — the runtime\n // must confirm + audit. Routes through `onFieldSave` (server write).\n safety: 'phi',\n openWorld: true,\n argsType: '{ fieldId: string; value: unknown }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldId: { type: 'string' },\n value: {},\n },\n required: ['fieldId', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.updateField',\n description:\n \"Write a patient field value via the consumer's audited save path. Subject to the same permissions and validation as a human edit.\",\n errors: ['no-save-handler', 'validation-failed', 'permission-denied'],\n examples: [\n {\n args: { fieldId: 'job', value: 'Architect' },\n note: 'Update the patient’s occupation.',\n },\n ],\n invoke: (handle, args: { fieldId: string; value: unknown }) =>\n handle.updateField(args.fieldId, args.value),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-details',\n description: 'Marks the PatientDetails root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific panel.',\n },\n item: {\n attr: 'data-field-id',\n description:\n 'Stable field KEY on each row. Never the field value (no PHI in the DOM hook).',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useId,\n useMemo,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ClipboardList } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Card } from '../card/card';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { DescriptionList } from '../description-list/description-list';\nimport { PanelHeader } from '../panel-header/panel-header';\nimport { useAgentRegistration } from '../../agent/registry';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldEditType,\n type PatientFieldEditValue,\n type PatientFieldOption,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport { PatientFieldRow } from '../_shared/patient-field-row';\nimport { patientDetailsAgent } from './patient-details.agent';\n\n/* -------------------------------------------------------------------- */\n/* PatientDetails */\n/* */\n/* The customizable, inline-editable patient record panel — the kit's */\n/* replacement for platform's hardcoded, per-user-identical patient */\n/* \"scheda paziente\" table. Mounts as a CONTEXTUAL tool in the Control */\n/* Room rail (a separate tool from EntitySummary, the AI brief). */\n/* */\n/* Boundaries (PRS §Security + 26-agent-readiness §PHI): */\n/* - DATA-IN for values: the consumer maps DoctorPatient → sections. */\n/* The kit owns the layout, the cog field-picker, i18n & theming. */\n/* - PERSISTENCE-OUT: the cog emits `onVisibleFieldsChange`; the */\n/* consumer persists the user's chosen ordered field set (platform: */\n/* a per-user × per-practice JSON column). */\n/* - WRITE-OUT: inline edits AND the agent's `update_field` BOTH route */\n/* through the single `onFieldSave` callback, so platform's */\n/* permission + validation + audit path is the only write channel. */\n/* - DOM hooks + agent state carry only field KEYS and an opaque */\n/* `patientId` — never a field VALUE / patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:flex ds:flex-col ds:text-[color:var(--foreground)]',\n {\n variants: {\n // `compact` (default) suits the narrow rail panel; `comfortable`\n // relaxes spacing for a wider host (a full-width profile page).\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n },\n);\n\n// The scrolling body sits BELOW the shared PanelHeader (which owns the title\n// row + divider + its own top/side padding). The header is full-bleed at the\n// top of the scroll region; the body carries the panel's content padding.\nconst bodyVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-md)]', {\n variants: {\n density: {\n comfortable: 'ds:p-[var(--spacing-md)]',\n compact: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* */\n/* The field model is the shared `_shared/patient-fields` vocabulary, so */\n/* PatientDetails and PatientSummaryCard speak ONE field language. The */\n/* visible set + order are a PER-CONTEXT preference the consumer owns and */\n/* wires per placement — never a single value synced across surfaces. The */\n/* `PatientDetails*` names below are kept as aliases for back-compat. */\n/* -------------------------------------------------------------------- */\n\nexport type {\n PatientField,\n PatientFieldSection,\n PatientFieldOption,\n PatientFieldEditType,\n PatientFieldEditValue,\n} from '../_shared/patient-fields';\n\n/** A label→value patient field. Alias of the shared {@link PatientField}. */\nexport type PatientDetailsField = PatientField;\n/** A labelled, collapsible group of fields. Alias of {@link PatientFieldSection}. */\nexport type PatientDetailsSection = PatientFieldSection;\n/** Alias of the shared {@link PatientFieldOption}. */\nexport type PatientDetailsFieldOption = PatientFieldOption;\n/** Alias of the shared {@link PatientFieldEditType}. */\nexport type PatientDetailsEditType = PatientFieldEditType;\n/** Alias of the shared {@link PatientFieldEditValue}. */\nexport type PatientDetailsEditValue = PatientFieldEditValue;\n\n/**\n * Imperative handle the agent adapter drives. Exposes only field KEYS and\n * an opaque `patientId` for reads; `updateField` routes writes through the\n * same `onFieldSave` path as a human inline edit (no second channel).\n */\nexport interface PatientDetailsHandle {\n /** The current ordered list of visible field ids. */\n getVisibleFieldOrder: () => string[];\n /** Opaque patient id (no PHI). */\n getPatientId: () => string | undefined;\n /** Replace the visible set, preserving the given order (filtered to known fields). */\n setVisibleFields: (fieldIds: string[]) => void;\n /** Replace the full ordered visible list (filtered to known fields). */\n setFieldOrder: (orderedIds: string[]) => void;\n /** Write a field value — delegates to `onFieldSave`. Rejects if no handler. */\n updateField: (fieldId: string, value: unknown) => Promise<void>;\n}\n\nexport interface PatientDetailsProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /** Patient display name — the panel heading. */\n title: ReactNode;\n /** The sectioned field catalogue (consumer-mapped from DoctorPatient). */\n sections: PatientDetailsSection[];\n /**\n * Header avatar photo / initials override. The panel always fronts the name\n * with an Avatar — initials derive from a string `title` by default; pass\n * `src` for a photo, or `name` to override the initials source.\n */\n avatar?: { src?: string; name?: string };\n /** At-a-glance chips under the name (consumer-composed Badge/Tag/Chip row). */\n headerChips?: ReactNode;\n\n /* ----- inline editing (kit-owned controls, consumer-owned write) ----- */\n\n /**\n * Frame the identity header and each section in its own elevated `Card`,\n * for a \"control-room\" rail that reads as a stack of cards rather than one\n * flat panel. Default `false` (the flat panel with a header rule + eyebrow\n * section headings). When framed, the header rule is dropped — the cards\n * provide the separation.\n */\n framed?: boolean;\n /** Master switch — show edit affordances on `editable` fields. */\n editable?: boolean;\n /**\n * Persist a field edit. Resolve ⇒ committed; reject(Error) ⇒ the message\n * is shown inline and the row stays in edit mode. Also the single channel\n * the agent's `update_field` uses.\n */\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n /** Domain validation — return an error message, or `null` when valid. */\n validate?: (fieldId: string, value: unknown) => string | null;\n\n /* ----- customization (the cog; controlled OR uncontrolled) ----- */\n\n /**\n * Controlled ordered list of visible field ids. `undefined` ⇒ every field\n * visible; an explicit `[]` ⇒ none (a panel that starts collapsed).\n */\n visibleFieldOrder?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field visible, in declaration order. */\n defaultVisibleFieldOrder?: string[];\n /** Fired whenever the user shows/hides/reorders fields via the cog. */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- states ----- */\n\n /** Render the loading skeleton. */\n loading?: boolean;\n /** Shown when there are no sections / no patient. Defaults to a localised hint. */\n emptyState?: ReactNode;\n\n /* ----- agent / a11y ----- */\n\n /** Opaque patient id — emitted as `data-patient-id` + agent stateRead. No PHI. */\n patientId?: string;\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /** BCP-47 locale override (currency / number editors). */\n locale?: string;\n /** Override the cog trigger's accessible name. */\n cogLabel?: string;\n /**\n * Visible panel-chrome heading (the sticky PanelHeader title). Defaults\n * to the kit's localised \"Patient details\". Pass an app-translated\n * string when the panel fronts a different record built from the same\n * chrome — \"Appointment details\", \"Task details\" — so the header names\n * what is actually shown. Also the `aria-label` fallback.\n */\n panelTitle?: string;\n /** Override the panel region's accessible name (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientDetails = forwardRef<HTMLElement, PatientDetailsProps>(\n function PatientDetails(\n {\n title,\n sections,\n avatar,\n headerChips,\n framed = false,\n editable = false,\n onFieldSave,\n validate,\n visibleFieldOrder,\n defaultVisibleFieldOrder,\n onVisibleFieldsChange,\n loading = false,\n emptyState,\n patientId,\n id,\n locale,\n cogLabel,\n panelTitle: panelTitleProp,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const headingId = useId();\n\n // Per-context field visibility + ordering. The order is a per-INSTANCE\n // preference the kit never persists — the consumer wires its own\n // value/onChange, so the same field vocabulary can render differently in\n // different parts of the app (see usePatientFieldVisibility).\n const {\n visible,\n catalogueIds,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset: resetToDefaults,\n } = usePatientFieldVisibility(sections, {\n value: visibleFieldOrder,\n defaultValue: defaultVisibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n /* ---- imperative handle (agent) ------------------------------- */\n\n const handle = useMemo<PatientDetailsHandle>(\n () => ({\n getVisibleFieldOrder: () => visible,\n getPatientId: () => patientId,\n setVisibleFields: (fieldIds) => setOrder(fieldIds),\n setFieldOrder: (orderedIds) => setOrder(orderedIds),\n updateField: (fieldId, value) => {\n if (!onFieldSave) {\n return Promise.reject(\n new Error('PatientDetails: no onFieldSave handler is wired.'),\n );\n }\n return onFieldSave(fieldId, value);\n },\n }),\n [visible, patientId, setOrder, onFieldSave],\n );\n useAgentRegistration(patientDetailsAgent, handle, id);\n\n /* ---- region accessible name ---------------------------------- */\n\n const panelTitle =\n panelTitleProp ??\n t('patientDetails.regionLabel', {\n defaultValue: 'Patient details',\n });\n const resolvedAriaLabel = ariaLabel ?? panelTitle;\n\n /* ---- header avatar ------------------------------------------- */\n // Parity with the card: the panel fronts the name with an Avatar (photo via\n // `avatar.src`, else initials from the name). Omitted only when `title` is a\n // non-string node and no `avatar.name` is given (nothing to derive from).\n const avatarName =\n avatar?.name ?? (typeof title === 'string' ? title : undefined);\n const showAvatar = Boolean(avatar?.src || avatarName);\n\n /* ---- loading / empty ----------------------------------------- */\n\n const hasVisible = catalogueIds.some((cid) => visible.includes(cid));\n\n if (loading) {\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-label={resolvedAriaLabel}\n aria-busy=\"true\"\n className={rootVariants({ className })}\n {...rest}\n >\n <div className={bodyVariants()}>\n <PatientDetailsSkeleton />\n </div>\n </section>\n );\n }\n\n const isEmpty = sections.length === 0 || !hasVisible;\n\n // The identity card (avatar + name + chips) is now the FIRST block of the\n // scrolling body — the shared PanelHeader owns the panel title row. The\n // name demotes to <h3> (the PanelHeader title is the <h2>).\n const identityBlock = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n {showAvatar ? (\n <Avatar\n size=\"md\"\n name={avatarName}\n src={avatar?.src}\n className=\"ds:shrink-0\"\n />\n ) : null}\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3 className=\"ds:m-0 type-title-item ds:text-[color:var(--foreground)]\">\n {title}\n </h3>\n {/* Chips sit under the NAME (not the avatar) — same column shape\n as the card's identity line. */}\n {headerChips ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {headerChips}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel ?? undefined}\n className={rootVariants({ className })}\n {...rest}\n >\n {/* The shared rail-panel header: panel title + the field-picker cog as\n its panel-owned action; the rail injects favourite/close after it.\n Sticky + divider so the title stays as the body scrolls. */}\n <PanelHeader\n title={panelTitle}\n icon={<ClipboardList aria-hidden=\"true\" />}\n headingId={headingId}\n sticky\n divider\n actions={\n <FieldVisibilityCog\n sections={sections}\n visible={visible}\n onToggleField={toggleField}\n onToggleSection={toggleSection}\n onMoveFieldOnto={moveFieldOnto}\n onReset={resetToDefaults}\n label={cogLabel}\n />\n }\n />\n\n <div className={bodyVariants()}>\n {/* Identity card — first block of the body; framed wraps it in its\n own elevated card alongside each section. */}\n {framed ? (\n <Card variant=\"elevated\">\n <Card.Body>{identityBlock}</Card.Body>\n </Card>\n ) : (\n identityBlock\n )}\n\n {/* Body — one card per section when framed, otherwise a flat stack. */}\n {isEmpty ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {emptyState ??\n t('patientDetails.empty', {\n defaultValue: 'No patient selected.',\n })}\n </p>\n ) : (\n resolveVisibleFields(sections, visible)\n // A section whose fields are all hidden drops out entirely —\n // no empty card / \"No fields shown.\" placeholder. (The field\n // picker still lists it, so hidden fields can be re-added.)\n .filter(({ fields }) => fields.length > 0)\n .map(({ section, fields }) => {\n const block = (\n <SectionBlock\n section={section}\n fields={fields}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n );\n return framed ? (\n <Card key={section.id} variant=\"elevated\">\n <Card.Body>{block}</Card.Body>\n </Card>\n ) : (\n <Fragment key={section.id}>{block}</Fragment>\n );\n })\n )}\n </div>\n </section>\n );\n },\n);\n\nPatientDetails.displayName = 'PatientDetails';\n\n/* -------------------------------------------------------------------- */\n/* SectionBlock — one collapsible group */\n/* -------------------------------------------------------------------- */\n\nfunction SectionBlock({\n section,\n fields,\n editable,\n onFieldSave,\n validate,\n locale,\n}: {\n section: PatientDetailsSection;\n fields: PatientDetailsField[];\n editable: boolean;\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n validate?: (fieldId: string, value: unknown) => string | null;\n locale?: string;\n}): ReactNode {\n const { t } = useTranslation('ui');\n const headingId = useId();\n const collapsible = section.collapsible ?? true;\n\n // The empty hint must be a SIBLING of the <dl>, never a child — a <p> is\n // not a valid direct child of <dl> (axe `definition-list`).\n const rows =\n fields.length === 0 ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('patientDetails.section.empty', {\n defaultValue: 'No fields shown.',\n })}\n </p>\n ) : (\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n divider=\"none\"\n // Label icons paint in the accent (the slot's recolour hook); no row rules.\n className=\"ds:[--description-list-icon-color:var(--accent)]\"\n >\n {fields.map((field) => (\n <PatientFieldRow\n key={field.id}\n field={field}\n // Surface the icon on the direct child: DescriptionList reserves its\n // icon column by inspecting direct children only, so the FieldRow\n // wrapper must carry it (not just the nested Row).\n icon={field.icon ?? null}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n ))}\n </DescriptionList>\n );\n\n if (!collapsible) {\n return (\n <section\n aria-labelledby={headingId}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h3\n id={headingId}\n className=\"ds:m-0 type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </h3>\n {rows}\n </section>\n );\n }\n\n return (\n <Collapsible\n defaultOpen={section.defaultOpen ?? true}\n variant=\"minimal\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n {/* Real <h3> so collapsible sections appear in the heading outline\n (the non-collapsible branch is an <h3> too); the WAI-ARIA accordion\n pattern is a heading wrapping the disclosure button. */}\n <h3 className=\"ds:m-0\">\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={headingId}\n className=\"ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)] ds:bg-transparent ds:border-0 ds:p-0 ds:text-start ds:cursor-pointer ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText] type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </button>\n </CollapsibleTrigger>\n </h3>\n <CollapsibleContent aria-labelledby={headingId}>\n {rows}\n </CollapsibleContent>\n </Collapsible>\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Skeleton */\n/* -------------------------------------------------------------------- */\n\nfunction PatientDetailsSkeleton(): ReactNode {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:size-10 ds:shrink-0 ds:rounded-full ds:bg-[color:var(--muted)]\" />\n <span className=\"ds:h-4 ds:w-1/2 ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\" />\n </div>\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"ds:h-4 ds:w-full ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\"\n />\n ))}\n </div>\n );\n}\n\n/** Density variant union re-exported for downstream typing. */\nexport type PatientDetailsDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["patientDetailsAgent","handle","args","rootVariants","cva","bodyVariants","PatientDetails","forwardRef","title","sections","avatar","headerChips","framed","editable","onFieldSave","validate","visibleFieldOrder","defaultVisibleFieldOrder","onVisibleFieldsChange","loading","emptyState","patientId","id","locale","cogLabel","panelTitleProp","ariaLabel","className","rest","ref","t","useTranslation","headingId","useId","visible","catalogueIds","setOrder","toggleField","toggleSection","moveFieldOnto","resetToDefaults","usePatientFieldVisibility","useMemo","fieldIds","orderedIds","fieldId","value","useAgentRegistration","panelTitle","resolvedAriaLabel","avatarName","showAvatar","hasVisible","cid","jsx","PatientDetailsSkeleton","isEmpty","identityBlock","jsxs","Avatar","PanelHeader","ClipboardList","FieldVisibilityCog","Card","resolveVisibleFields","fields","section","block","SectionBlock","Fragment","collapsible","rows","DescriptionList","field","PatientFieldRow","Collapsible","CollapsibleTrigger","CollapsibleContent"],"mappings":";;;;;;;;;;;;AAoBO,MAAMA,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,eAAe,WAAW;AAAA,EACzC,OAAO;AAAA,IACL,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,qBAAA;AAAA,IAAqB;AAAA,IAEhD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,EACxC;AAAA,EAEF,SAAS;AAAA,IACP,oBAAoB;AAAA,MAClB,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,UAAU,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,WAAS;AAAA,QAAE;AAAA,QAEvD,UAAU,CAAC,UAAU;AAAA,MAAA;AAAA,MAEvB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,UAAU;AAAA,QACR;AAAA,UACE,MAAM,EAAE,UAAU,CAAC,YAAY,aAAa,SAAS,OAAO,EAAA;AAAA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UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,sDACb,UAAA;AAAA,MAAA,gBAAAJ,EAAC,QAAA,EAAK,WAAU,oEAAA,CAAoE;AAAA,MACpF,gBAAAA,EAAC,QAAA,EAAK,WAAU,2EAAA,CAA2E;AAAA,IAAA,GAC7F;AAAA,IACC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MACd,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAU;AAAA,MAAA;AAAA,MADL;AAAA,IAAA,CAGR;AAAA,EAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"patient-details-BjcUpD9S.js","sources":["../../src/components/patient-details/patient-details.agent.ts","../../src/components/patient-details/patient-details.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { PatientDetailsHandle } from './patient-details';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientDetails */\n/* */\n/* Exposes the patient panel to a future MCP runtime: */\n/* - VIEW CONFIG (safety: write) — show/hide + reorder the visible */\n/* field set. These mutate the user's view, not the patient record. */\n/* - PHI WRITE (safety: phi) — `update_field` writes a patient field */\n/* value. It is the ONLY PHI mutation and routes through the same */\n/* `onFieldSave` path as a human inline edit, so the consumer's */\n/* permission + validation + audit are the single write authority. */\n/* `phi` (not `write`) forces the runtime's confirm-before-act gate. */\n/* */\n/* STATE exposes only field KEYS (`visibleFieldOrder`) and an opaque */\n/* `patientId` — never a field value or patient identity (PRS §Security, */\n/* 26-agent-readiness §6.1/§7). */\n/* -------------------------------------------------------------------- */\n\nexport const patientDetailsAgent: AgentAdapter<PatientDetailsHandle> = {\n id: 'patient-details',\n // `view_change` backs the view-config actions (show/hide + reorder are both\n // view reconfigurations); `set_value` backs the single-value `update_field`\n // (not `edit_inline`, which is for granular free-text/formatting edits).\n capabilities: ['view_change', 'set_value'],\n state: {\n visibleFieldOrder: {\n type: 'string[]',\n descriptionKey: 'ui.agent.patientDetails.state.visibleFieldOrder',\n description:\n 'Ordered list of visible field KEYS (e.g. \"fiscalCode\"). Never a field value.',\n read: (handle) => handle.getVisibleFieldOrder(),\n },\n patientId: {\n type: 'string | undefined',\n descriptionKey: 'ui.agent.patientDetails.state.patientId',\n description:\n 'Opaque patient id the panel is bound to. No patient-identifiable data.',\n read: (handle) => handle.getPatientId(),\n },\n },\n actions: {\n set_visible_fields: {\n safety: 'write',\n argsType: '{ fieldIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['fieldIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setVisibleFields',\n description:\n 'Set which fields are visible (and their order). Unknown ids are ignored.',\n examples: [\n {\n args: { fieldIds: ['lastName', 'firstName', 'phone', 'email'] },\n note: 'Show only name + contact fields.',\n },\n ],\n invoke: (handle, args: { fieldIds: string[] }) => {\n handle.setVisibleFields(args.fieldIds);\n },\n },\n set_field_order: {\n safety: 'write',\n argsType: '{ orderedIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n orderedIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['orderedIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setFieldOrder',\n description:\n 'Reorder the visible fields. Order within a section is honoured; sections stay fixed.',\n invoke: (handle, args: { orderedIds: string[] }) => {\n handle.setFieldOrder(args.orderedIds);\n },\n },\n update_field: {\n // PHI: mutates a patient-identifiable value. NOT `write` — the runtime\n // must confirm + audit. Routes through `onFieldSave` (server write).\n safety: 'phi',\n openWorld: true,\n argsType: '{ fieldId: string; value: unknown }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldId: { type: 'string' },\n value: {},\n },\n required: ['fieldId', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.updateField',\n description:\n \"Write a patient field value via the consumer's audited save path. Subject to the same permissions and validation as a human edit.\",\n errors: ['no-save-handler', 'validation-failed', 'permission-denied'],\n examples: [\n {\n args: { fieldId: 'job', value: 'Architect' },\n note: 'Update the patient’s occupation.',\n },\n ],\n invoke: (handle, args: { fieldId: string; value: unknown }) =>\n handle.updateField(args.fieldId, args.value),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-details',\n description: 'Marks the PatientDetails root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific panel.',\n },\n item: {\n attr: 'data-field-id',\n description:\n 'Stable field KEY on each row. Never the field value (no PHI in the DOM hook).',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useId,\n useMemo,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ClipboardList } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Card } from '../card/card';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { DescriptionList } from '../description-list/description-list';\nimport { PanelHeader } from '../panel-header/panel-header';\nimport { useAgentRegistration } from '../../agent/registry';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldEditType,\n type PatientFieldEditValue,\n type PatientFieldOption,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport { PatientFieldRow } from '../_shared/patient-field-row';\nimport { patientDetailsAgent } from './patient-details.agent';\n\n/* -------------------------------------------------------------------- */\n/* PatientDetails */\n/* */\n/* The customizable, inline-editable patient record panel — the kit's */\n/* replacement for platform's hardcoded, per-user-identical patient */\n/* \"scheda paziente\" table. Mounts as a CONTEXTUAL tool in the Control */\n/* Room rail (a separate tool from EntitySummary, the AI brief). */\n/* */\n/* Boundaries (PRS §Security + 26-agent-readiness §PHI): */\n/* - DATA-IN for values: the consumer maps DoctorPatient → sections. */\n/* The kit owns the layout, the cog field-picker, i18n & theming. */\n/* - PERSISTENCE-OUT: the cog emits `onVisibleFieldsChange`; the */\n/* consumer persists the user's chosen ordered field set (platform: */\n/* a per-user × per-practice JSON column). */\n/* - WRITE-OUT: inline edits AND the agent's `update_field` BOTH route */\n/* through the single `onFieldSave` callback, so platform's */\n/* permission + validation + audit path is the only write channel. */\n/* - DOM hooks + agent state carry only field KEYS and an opaque */\n/* `patientId` — never a field VALUE / patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:flex ds:flex-col ds:text-[color:var(--foreground)]',\n {\n variants: {\n // `compact` (default) suits the narrow rail panel; `comfortable`\n // relaxes spacing for a wider host (a full-width profile page).\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n },\n);\n\n// The scrolling body sits BELOW the shared PanelHeader (which owns the title\n// row + divider + its own top/side padding). The header is full-bleed at the\n// top of the scroll region; the body carries the panel's content padding.\nconst bodyVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-md)]', {\n variants: {\n density: {\n comfortable: 'ds:p-[var(--spacing-md)]',\n compact: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* */\n/* The field model is the shared `_shared/patient-fields` vocabulary, so */\n/* PatientDetails and PatientSummaryCard speak ONE field language. The */\n/* visible set + order are a PER-CONTEXT preference the consumer owns and */\n/* wires per placement — never a single value synced across surfaces. The */\n/* `PatientDetails*` names below are kept as aliases for back-compat. */\n/* -------------------------------------------------------------------- */\n\nexport type {\n PatientField,\n PatientFieldSection,\n PatientFieldOption,\n PatientFieldEditType,\n PatientFieldEditValue,\n} from '../_shared/patient-fields';\n\n/** A label→value patient field. Alias of the shared {@link PatientField}. */\nexport type PatientDetailsField = PatientField;\n/** A labelled, collapsible group of fields. Alias of {@link PatientFieldSection}. */\nexport type PatientDetailsSection = PatientFieldSection;\n/** Alias of the shared {@link PatientFieldOption}. */\nexport type PatientDetailsFieldOption = PatientFieldOption;\n/** Alias of the shared {@link PatientFieldEditType}. */\nexport type PatientDetailsEditType = PatientFieldEditType;\n/** Alias of the shared {@link PatientFieldEditValue}. */\nexport type PatientDetailsEditValue = PatientFieldEditValue;\n\n/**\n * Imperative handle the agent adapter drives. Exposes only field KEYS and\n * an opaque `patientId` for reads; `updateField` routes writes through the\n * same `onFieldSave` path as a human inline edit (no second channel).\n */\nexport interface PatientDetailsHandle {\n /** The current ordered list of visible field ids. */\n getVisibleFieldOrder: () => string[];\n /** Opaque patient id (no PHI). */\n getPatientId: () => string | undefined;\n /** Replace the visible set, preserving the given order (filtered to known fields). */\n setVisibleFields: (fieldIds: string[]) => void;\n /** Replace the full ordered visible list (filtered to known fields). */\n setFieldOrder: (orderedIds: string[]) => void;\n /** Write a field value — delegates to `onFieldSave`. Rejects if no handler. */\n updateField: (fieldId: string, value: unknown) => Promise<void>;\n}\n\nexport interface PatientDetailsProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /** Patient display name — the panel heading. */\n title: ReactNode;\n /** The sectioned field catalogue (consumer-mapped from DoctorPatient). */\n sections: PatientDetailsSection[];\n /**\n * Header avatar photo / initials override. The panel always fronts the name\n * with an Avatar — initials derive from a string `title` by default; pass\n * `src` for a photo, or `name` to override the initials source.\n */\n avatar?: { src?: string; name?: string };\n /** At-a-glance chips under the name (consumer-composed Badge/Tag/Chip row). */\n headerChips?: ReactNode;\n\n /* ----- inline editing (kit-owned controls, consumer-owned write) ----- */\n\n /**\n * Frame the identity header and each section in its own elevated `Card`,\n * for a \"control-room\" rail that reads as a stack of cards rather than one\n * flat panel. Default `false` (the flat panel with a header rule + eyebrow\n * section headings). When framed, the header rule is dropped — the cards\n * provide the separation.\n */\n framed?: boolean;\n /** Master switch — show edit affordances on `editable` fields. */\n editable?: boolean;\n /**\n * Persist a field edit. Resolve ⇒ committed; reject(Error) ⇒ the message\n * is shown inline and the row stays in edit mode. Also the single channel\n * the agent's `update_field` uses.\n */\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n /** Domain validation — return an error message, or `null` when valid. */\n validate?: (fieldId: string, value: unknown) => string | null;\n\n /* ----- customization (the cog; controlled OR uncontrolled) ----- */\n\n /**\n * Controlled ordered list of visible field ids. `undefined` ⇒ every field\n * visible; an explicit `[]` ⇒ none (a panel that starts collapsed).\n */\n visibleFieldOrder?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field visible, in declaration order. */\n defaultVisibleFieldOrder?: string[];\n /** Fired whenever the user shows/hides/reorders fields via the cog. */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- states ----- */\n\n /** Render the loading skeleton. */\n loading?: boolean;\n /** Shown when there are no sections / no patient. Defaults to a localised hint. */\n emptyState?: ReactNode;\n\n /* ----- agent / a11y ----- */\n\n /** Opaque patient id — emitted as `data-patient-id` + agent stateRead. No PHI. */\n patientId?: string;\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /** BCP-47 locale override (currency / number editors). */\n locale?: string;\n /** Override the cog trigger's accessible name. */\n cogLabel?: string;\n /**\n * Visible panel-chrome heading (the sticky PanelHeader title). Defaults\n * to the kit's localised \"Patient details\". Pass an app-translated\n * string when the panel fronts a different record built from the same\n * chrome — \"Appointment details\", \"Task details\" — so the header names\n * what is actually shown. Also the `aria-label` fallback.\n */\n panelTitle?: string;\n /** Override the panel region's accessible name (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientDetails = forwardRef<HTMLElement, PatientDetailsProps>(\n function PatientDetails(\n {\n title,\n sections,\n avatar,\n headerChips,\n framed = false,\n editable = false,\n onFieldSave,\n validate,\n visibleFieldOrder,\n defaultVisibleFieldOrder,\n onVisibleFieldsChange,\n loading = false,\n emptyState,\n patientId,\n id,\n locale,\n cogLabel,\n panelTitle: panelTitleProp,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const headingId = useId();\n\n // Per-context field visibility + ordering. The order is a per-INSTANCE\n // preference the kit never persists — the consumer wires its own\n // value/onChange, so the same field vocabulary can render differently in\n // different parts of the app (see usePatientFieldVisibility).\n const {\n visible,\n catalogueIds,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset: resetToDefaults,\n } = usePatientFieldVisibility(sections, {\n value: visibleFieldOrder,\n defaultValue: defaultVisibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n /* ---- imperative handle (agent) ------------------------------- */\n\n const handle = useMemo<PatientDetailsHandle>(\n () => ({\n getVisibleFieldOrder: () => visible,\n getPatientId: () => patientId,\n setVisibleFields: (fieldIds) => setOrder(fieldIds),\n setFieldOrder: (orderedIds) => setOrder(orderedIds),\n updateField: (fieldId, value) => {\n if (!onFieldSave) {\n return Promise.reject(\n new Error('PatientDetails: no onFieldSave handler is wired.'),\n );\n }\n return onFieldSave(fieldId, value);\n },\n }),\n [visible, patientId, setOrder, onFieldSave],\n );\n useAgentRegistration(patientDetailsAgent, handle, id);\n\n /* ---- region accessible name ---------------------------------- */\n\n const panelTitle =\n panelTitleProp ??\n t('patientDetails.regionLabel', {\n defaultValue: 'Patient details',\n });\n const resolvedAriaLabel = ariaLabel ?? panelTitle;\n\n /* ---- header avatar ------------------------------------------- */\n // Parity with the card: the panel fronts the name with an Avatar (photo via\n // `avatar.src`, else initials from the name). Omitted only when `title` is a\n // non-string node and no `avatar.name` is given (nothing to derive from).\n const avatarName =\n avatar?.name ?? (typeof title === 'string' ? title : undefined);\n const showAvatar = Boolean(avatar?.src || avatarName);\n\n /* ---- loading / empty ----------------------------------------- */\n\n const hasVisible = catalogueIds.some((cid) => visible.includes(cid));\n\n if (loading) {\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-label={resolvedAriaLabel}\n aria-busy=\"true\"\n className={rootVariants({ className })}\n {...rest}\n >\n <div className={bodyVariants()}>\n <PatientDetailsSkeleton />\n </div>\n </section>\n );\n }\n\n const isEmpty = sections.length === 0 || !hasVisible;\n\n // The identity card (avatar + name + chips) is now the FIRST block of the\n // scrolling body — the shared PanelHeader owns the panel title row. The\n // name demotes to <h3> (the PanelHeader title is the <h2>).\n const identityBlock = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n {showAvatar ? (\n <Avatar\n size=\"md\"\n name={avatarName}\n src={avatar?.src}\n className=\"ds:shrink-0\"\n />\n ) : null}\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3 className=\"ds:m-0 type-title-item ds:text-[color:var(--foreground)]\">\n {title}\n </h3>\n {/* Chips sit under the NAME (not the avatar) — same column shape\n as the card's identity line. */}\n {headerChips ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {headerChips}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel ?? undefined}\n className={rootVariants({ className })}\n {...rest}\n >\n {/* The shared rail-panel header: panel title + the field-picker cog as\n its panel-owned action; the rail injects favourite/close after it.\n Sticky + divider so the title stays as the body scrolls. */}\n <PanelHeader\n title={panelTitle}\n icon={<ClipboardList aria-hidden=\"true\" />}\n headingId={headingId}\n sticky\n divider\n actions={\n <FieldVisibilityCog\n sections={sections}\n visible={visible}\n onToggleField={toggleField}\n onToggleSection={toggleSection}\n onMoveFieldOnto={moveFieldOnto}\n onReset={resetToDefaults}\n label={cogLabel}\n />\n }\n />\n\n <div className={bodyVariants()}>\n {/* Identity card — first block of the body; framed wraps it in its\n own elevated card alongside each section. */}\n {framed ? (\n <Card variant=\"elevated\">\n <Card.Body>{identityBlock}</Card.Body>\n </Card>\n ) : (\n identityBlock\n )}\n\n {/* Body — one card per section when framed, otherwise a flat stack. */}\n {isEmpty ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {emptyState ??\n t('patientDetails.empty', {\n defaultValue: 'No patient selected.',\n })}\n </p>\n ) : (\n resolveVisibleFields(sections, visible)\n // A section whose fields are all hidden drops out entirely —\n // no empty card / \"No fields shown.\" placeholder. (The field\n // picker still lists it, so hidden fields can be re-added.)\n .filter(({ fields }) => fields.length > 0)\n .map(({ section, fields }) => {\n const block = (\n <SectionBlock\n section={section}\n fields={fields}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n );\n return framed ? (\n <Card key={section.id} variant=\"elevated\">\n <Card.Body>{block}</Card.Body>\n </Card>\n ) : (\n <Fragment key={section.id}>{block}</Fragment>\n );\n })\n )}\n </div>\n </section>\n );\n },\n);\n\nPatientDetails.displayName = 'PatientDetails';\n\n/* -------------------------------------------------------------------- */\n/* SectionBlock — one collapsible group */\n/* -------------------------------------------------------------------- */\n\nfunction SectionBlock({\n section,\n fields,\n editable,\n onFieldSave,\n validate,\n locale,\n}: {\n section: PatientDetailsSection;\n fields: PatientDetailsField[];\n editable: boolean;\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n validate?: (fieldId: string, value: unknown) => string | null;\n locale?: string;\n}): ReactNode {\n const { t } = useTranslation('ui');\n const headingId = useId();\n const collapsible = section.collapsible ?? true;\n\n // The empty hint must be a SIBLING of the <dl>, never a child — a <p> is\n // not a valid direct child of <dl> (axe `definition-list`).\n const rows =\n fields.length === 0 ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('patientDetails.section.empty', {\n defaultValue: 'No fields shown.',\n })}\n </p>\n ) : (\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n divider=\"none\"\n // Label icons paint in the accent (the slot's recolour hook); no row rules.\n className=\"ds:[--description-list-icon-color:var(--accent)]\"\n >\n {fields.map((field) => (\n <PatientFieldRow\n key={field.id}\n field={field}\n // Surface the icon on the direct child: DescriptionList reserves its\n // icon column by inspecting direct children only, so the FieldRow\n // wrapper must carry it (not just the nested Row).\n icon={field.icon ?? null}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n ))}\n </DescriptionList>\n );\n\n if (!collapsible) {\n return (\n <section\n aria-labelledby={headingId}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h3\n id={headingId}\n className=\"ds:m-0 type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </h3>\n {rows}\n </section>\n );\n }\n\n return (\n <Collapsible\n defaultOpen={section.defaultOpen ?? true}\n variant=\"minimal\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n {/* Real <h3> so collapsible sections appear in the heading outline\n (the non-collapsible branch is an <h3> too); the WAI-ARIA accordion\n pattern is a heading wrapping the disclosure button. */}\n <h3 className=\"ds:m-0\">\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={headingId}\n className=\"ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)] ds:bg-transparent ds:border-0 ds:p-0 ds:text-start ds:cursor-pointer ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText] type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </button>\n </CollapsibleTrigger>\n </h3>\n <CollapsibleContent aria-labelledby={headingId}>\n {rows}\n </CollapsibleContent>\n </Collapsible>\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Skeleton */\n/* -------------------------------------------------------------------- */\n\nfunction PatientDetailsSkeleton(): ReactNode {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:size-10 ds:shrink-0 ds:rounded-full ds:bg-[color:var(--muted)]\" />\n <span className=\"ds:h-4 ds:w-1/2 ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\" />\n </div>\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"ds:h-4 ds:w-full ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\"\n />\n ))}\n </div>\n );\n}\n\n/** Density variant union re-exported for downstream typing. */\nexport type PatientDetailsDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["patientDetailsAgent","handle","args","rootVariants","cva","bodyVariants","PatientDetails","forwardRef","title","sections","avatar","headerChips","framed","editable","onFieldSave","validate","visibleFieldOrder","defaultVisibleFieldOrder","onVisibleFieldsChange","loading","emptyState","patientId","id","locale","cogLabel","panelTitleProp","ariaLabel","className","rest","ref","t","useTranslation","headingId","useId","visible","catalogueIds","setOrder","toggleField","toggleSection","moveFieldOnto","resetToDefaults","usePatientFieldVisibility","useMemo","fieldIds","orderedIds","fieldId","value","useAgentRegistration","panelTitle","resolvedAriaLabel","avatarName","showAvatar","hasVisible","cid","jsx","PatientDetailsSkeleton","isEmpty","identityBlock","jsxs","Avatar","PanelHeader","ClipboardList","FieldVisibilityCog","Card","resolveVisibleFields","fields","section","block","SectionBlock","Fragment","collapsible","rows","DescriptionList","field","PatientFieldRow","Collapsible","CollapsibleTrigger","CollapsibleContent"],"mappings":";;;;;;;;;;;;AAoBO,MAAMA,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,eAAe,WAAW;AAAA,EACzC,OAAO;AAAA,IACL,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,M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,IAAItB;AAAA,YACJ,WAAU;AAAA,YAET,UAAAkC,EAAQ;AAAA,UAAA;AAAA,QAAA,GAEb,EAAA,CACF;AAAA,QACA,gBAAAZ,EAACuB,IAAA,EAAmB,mBAAiB7C,GAClC,UAAAuC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IArCA,gBAAAb;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,mBAAiB1B;AAAA,MACjB,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAsB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAItB;AAAA,YACJ,WAAU;AAAA,YAET,UAAAkC,EAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEVK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AA8BT;AAMA,SAAShB,KAAoC;AAC3C,SACE,gBAAAG,EAAC,OAAA,EAAI,WAAU,kDACb,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,sDACb,UAAA;AAAA,MAAA,gBAAAJ,EAAC,QAAA,EAAK,WAAU,oEAAA,CAAoE;AAAA,MACpF,gBAAAA,EAAC,QAAA,EAAK,WAAU,2EAAA,CAA2E;AAAA,IAAA,GAC7F;AAAA,IACC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MACd,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAU;AAAA,MAAA;AAAA,MADL;AAAA,IAAA,CAGR;AAAA,EAAA,GACH;AAEJ;"}
@@ -11,7 +11,7 @@ import { S as ae } from "./settings-d25ju_6L.js";
11
11
  import { G as re } from "./grip-vertical-onSb1JXO.js";
12
12
  import { D as j } from "./description-list-BxzDN9o2.js";
13
13
  import { B as q } from "./badge-BUk4RjTS.js";
14
- import { L as se } from "./link-N5_YpLtm.js";
14
+ import { L as se } from "./link-DtCfnLnF.js";
15
15
  import { T as ne } from "./transaction-chip-CohY6sTA.js";
16
16
  import { H as ie } from "./hash-CSQ9SChR.js";
17
17
  import { C as oe } from "./calendar-days-BGWklvE-.js";
@@ -805,4 +805,4 @@ export {
805
805
  Dt as r,
806
806
  St as u
807
807
  };
808
- //# sourceMappingURL=patient-field-row-bJk8Q_qr.js.map
808
+ //# sourceMappingURL=patient-field-row-B0tdiaWi.js.map