@alfadocs/ui-kit-debug 1.4.13 → 1.4.14

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 (201) hide show
  1. package/dist/_chunks/{address-fields-D-8akw2m.js → address-fields-CZP4Wncx.js} +2 -2
  2. package/dist/_chunks/{address-fields-D-8akw2m.js.map → address-fields-CZP4Wncx.js.map} +1 -1
  3. package/dist/_chunks/{agenda-card-BQDs2ZMp.js → agenda-card-pdN49pMu.js} +2 -2
  4. package/dist/_chunks/{agenda-card-BQDs2ZMp.js.map → agenda-card-pdN49pMu.js.map} +1 -1
  5. package/dist/_chunks/{agenda-tray-BTyWsVwT.js → agenda-tray-CYR-znfE.js} +2 -2
  6. package/dist/_chunks/{agenda-tray-BTyWsVwT.js.map → agenda-tray-CYR-znfE.js.map} +1 -1
  7. package/dist/_chunks/{ai-consent-banner-gVcoiXxv.js → ai-consent-banner-DLF6FNXv.js} +2 -2
  8. package/dist/_chunks/{ai-consent-banner-gVcoiXxv.js.map → ai-consent-banner-DLF6FNXv.js.map} +1 -1
  9. package/dist/_chunks/{anamnesis-card-Bt0twrML.js → anamnesis-card-BylMLHYj.js} +2 -2
  10. package/dist/_chunks/{anamnesis-card-Bt0twrML.js.map → anamnesis-card-BylMLHYj.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-summary-card-BKGVcwny.js → anamnesis-summary-card-DGVKBQoq.js} +134 -116
  12. package/dist/_chunks/anamnesis-summary-card-DGVKBQoq.js.map +1 -0
  13. package/dist/_chunks/{anamnesis-summary-rows-B5MAYkJ-.js → anamnesis-summary-rows-C73SWVy3.js} +3034 -2954
  14. package/dist/_chunks/anamnesis-summary-rows-C73SWVy3.js.map +1 -0
  15. package/dist/_chunks/{antenatal-schedule-timeline-BSLrOQ3S.js → antenatal-schedule-timeline-BjlF2rTz.js} +2 -2
  16. package/dist/_chunks/{antenatal-schedule-timeline-BSLrOQ3S.js.map → antenatal-schedule-timeline-BjlF2rTz.js.map} +1 -1
  17. package/dist/_chunks/{appointment-card-kcUC7vWR.js → appointment-card-BhcPJpXh.js} +2 -2
  18. package/dist/_chunks/{appointment-card-kcUC7vWR.js.map → appointment-card-BhcPJpXh.js.map} +1 -1
  19. package/dist/_chunks/{appointment-timeline-BC3dlZu5.js → appointment-timeline-DT1uFp8z.js} +2 -2
  20. package/dist/_chunks/{appointment-timeline-BC3dlZu5.js.map → appointment-timeline-DT1uFp8z.js.map} +1 -1
  21. package/dist/_chunks/{appointment-tray-BPY5rATW.js → appointment-tray-DvyVK7um.js} +2 -2
  22. package/dist/_chunks/{appointment-tray-BPY5rATW.js.map → appointment-tray-DvyVK7um.js.map} +1 -1
  23. package/dist/_chunks/{badge-CIt-UFEx.js → badge-sTusUqZD.js} +23 -18
  24. package/dist/_chunks/{badge-CIt-UFEx.js.map → badge-sTusUqZD.js.map} +1 -1
  25. package/dist/_chunks/{bishop-score-B6iYYO0c.js → bishop-score-BV1JAEMV.js} +3 -3
  26. package/dist/_chunks/{bishop-score-B6iYYO0c.js.map → bishop-score-BV1JAEMV.js.map} +1 -1
  27. package/dist/_chunks/{bmi-calculator-DC5SaqXT.js → bmi-calculator-CdR-RLFj.js} +5 -5
  28. package/dist/_chunks/{bmi-calculator-DC5SaqXT.js.map → bmi-calculator-CdR-RLFj.js.map} +1 -1
  29. package/dist/_chunks/{booking-CmHX15dh.js → booking-CGKof8QU.js} +2 -2
  30. package/dist/_chunks/{booking-CmHX15dh.js.map → booking-CGKof8QU.js.map} +1 -1
  31. package/dist/_chunks/{care-plan-card-9tLgsDYY.js → care-plan-card-C83Hb9EE.js} +3 -3
  32. package/dist/_chunks/{care-plan-card-9tLgsDYY.js.map → care-plan-card-C83Hb9EE.js.map} +1 -1
  33. package/dist/_chunks/{care-plan-entry-card-CSan4h7A.js → care-plan-entry-card-CHMPSTCz.js} +2 -2
  34. package/dist/_chunks/{care-plan-entry-card-CSan4h7A.js.map → care-plan-entry-card-CHMPSTCz.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-header-D_BTi77b.js → care-plan-header-_B0TTWT1.js} +2 -2
  36. package/dist/_chunks/{care-plan-header-D_BTi77b.js.map → care-plan-header-_B0TTWT1.js.map} +1 -1
  37. package/dist/_chunks/{clinical-note-card-ByzQ86uz.js → clinical-note-card-BBgFd2nB.js} +2 -2
  38. package/dist/_chunks/{clinical-note-card-ByzQ86uz.js.map → clinical-note-card-BBgFd2nB.js.map} +1 -1
  39. package/dist/_chunks/{connection-status-D8mZ4klk.js → connection-status-NT8hUtYl.js} +2 -2
  40. package/dist/_chunks/{connection-status-D8mZ4klk.js.map → connection-status-NT8hUtYl.js.map} +1 -1
  41. package/dist/_chunks/{contact-profile-card-DuW6VpzY.js → contact-profile-card-BxHiG8e6.js} +2 -2
  42. package/dist/_chunks/{contact-profile-card-DuW6VpzY.js.map → contact-profile-card-BxHiG8e6.js.map} +1 -1
  43. package/dist/_chunks/{cycle-calculator-B_NlctlQ.js → cycle-calculator-DJZYvNhw.js} +4 -4
  44. package/dist/_chunks/{cycle-calculator-B_NlctlQ.js.map → cycle-calculator-DJZYvNhw.js.map} +1 -1
  45. package/dist/_chunks/{dependent-selector-BUvrZRi0.js → dependent-selector-cJlJFAKD.js} +2 -2
  46. package/dist/_chunks/{dependent-selector-BUvrZRi0.js.map → dependent-selector-cJlJFAKD.js.map} +1 -1
  47. package/dist/_chunks/{document-preview-Di15VrpQ.js → document-preview-Aae2yKvY.js} +2 -2
  48. package/dist/_chunks/{document-preview-Di15VrpQ.js.map → document-preview-Aae2yKvY.js.map} +1 -1
  49. package/dist/_chunks/{due-date-calculator-le1z3KpW.js → due-date-calculator-ajaQ4ya5.js} +6 -6
  50. package/dist/_chunks/{due-date-calculator-le1z3KpW.js.map → due-date-calculator-ajaQ4ya5.js.map} +1 -1
  51. package/dist/_chunks/{fetal-weight-DXA6ZpMq.js → fetal-weight-jon6GIfQ.js} +4 -4
  52. package/dist/_chunks/{fetal-weight-DXA6ZpMq.js.map → fetal-weight-jon6GIfQ.js.map} +1 -1
  53. package/dist/_chunks/{field-value-BCFLVBmu.js → field-value-BbiDRyNh.js} +2 -2
  54. package/dist/_chunks/{field-value-BCFLVBmu.js.map → field-value-BbiDRyNh.js.map} +1 -1
  55. package/dist/_chunks/{file-manager-BjCM2fZB.js → file-manager-CML_C6_h.js} +2 -2
  56. package/dist/_chunks/{file-manager-BjCM2fZB.js.map → file-manager-CML_C6_h.js.map} +1 -1
  57. package/dist/_chunks/form-field-CahJzTxp.js +131 -0
  58. package/dist/_chunks/form-field-CahJzTxp.js.map +1 -0
  59. package/dist/_chunks/{gestational-age-calculator-Ch8vmJAl.js → gestational-age-calculator-dEpQDWcb.js} +5 -5
  60. package/dist/_chunks/{gestational-age-calculator-Ch8vmJAl.js.map → gestational-age-calculator-dEpQDWcb.js.map} +1 -1
  61. package/dist/_chunks/{hcg-doubling-BT6lki_i.js → hcg-doubling-CC6TLtHd.js} +4 -4
  62. package/dist/_chunks/{hcg-doubling-BT6lki_i.js.map → hcg-doubling-CC6TLtHd.js.map} +1 -1
  63. package/dist/_chunks/{link-cell-renderer-C7GvyK66.js → link-cell-renderer-D3IsW_2R.js} +3 -3
  64. package/dist/_chunks/{link-cell-renderer-C7GvyK66.js.map → link-cell-renderer-D3IsW_2R.js.map} +1 -1
  65. package/dist/_chunks/{marketplace-app-shell-BhRH7Zi4.js → marketplace-app-shell-b5hN-Q0m.js} +2 -2
  66. package/dist/_chunks/{marketplace-app-shell-BhRH7Zi4.js.map → marketplace-app-shell-b5hN-Q0m.js.map} +1 -1
  67. package/dist/_chunks/{notes-panel-Bz83SO4-.js → notes-panel-D6HKLLS-.js} +2 -2
  68. package/dist/_chunks/{notes-panel-Bz83SO4-.js.map → notes-panel-D6HKLLS-.js.map} +1 -1
  69. package/dist/_chunks/{number-input-CM1q9zvH.js → number-input-Cgu2TtA8.js} +30 -21
  70. package/dist/_chunks/number-input-Cgu2TtA8.js.map +1 -0
  71. package/dist/_chunks/{operator-hero-CpJkDNAM.js → operator-hero-CCDnIa1S.js} +2 -2
  72. package/dist/_chunks/{operator-hero-CpJkDNAM.js.map → operator-hero-CCDnIa1S.js.map} +1 -1
  73. package/dist/_chunks/{optical-prescription-CQR_WJiS.js → optical-prescription-DtzEqFQm.js} +2 -2
  74. package/dist/_chunks/{optical-prescription-CQR_WJiS.js.map → optical-prescription-DtzEqFQm.js.map} +1 -1
  75. package/dist/_chunks/{patient-details-CnFgF3MU.js → patient-details-rENrE_qY.js} +3 -3
  76. package/dist/_chunks/{patient-details-CnFgF3MU.js.map → patient-details-rENrE_qY.js.map} +1 -1
  77. package/dist/_chunks/{patient-summary-card-DfbOtOV6.js → patient-summary-card-DQJgOOrA.js} +3 -3
  78. package/dist/_chunks/{patient-summary-card-DfbOtOV6.js.map → patient-summary-card-DQJgOOrA.js.map} +1 -1
  79. package/dist/_chunks/{patient-table-BXzcrC79.js → patient-table-BubxfOWL.js} +3 -3
  80. package/dist/_chunks/{patient-table-BXzcrC79.js.map → patient-table-BubxfOWL.js.map} +1 -1
  81. package/dist/_chunks/{payment-automation-upsell-Ckh3b7Xx.js → payment-automation-upsell-CnaBPt5e.js} +2 -2
  82. package/dist/_chunks/{payment-automation-upsell-Ckh3b7Xx.js.map → payment-automation-upsell-CnaBPt5e.js.map} +1 -1
  83. package/dist/_chunks/{payment-request-card-Dn6-tH-D.js → payment-request-card-CvhDzDNk.js} +2 -2
  84. package/dist/_chunks/{payment-request-card-Dn6-tH-D.js.map → payment-request-card-CvhDzDNk.js.map} +1 -1
  85. package/dist/_chunks/{periodontal-chart-B0yko9Xm.js → periodontal-chart-brakjj0s.js} +2 -2
  86. package/dist/_chunks/{periodontal-chart-B0yko9Xm.js.map → periodontal-chart-brakjj0s.js.map} +1 -1
  87. package/dist/_chunks/{periodontal-chart-card-HbYTmWlo.js → periodontal-chart-card-Bz-ebteE.js} +2 -2
  88. package/dist/_chunks/{periodontal-chart-card-HbYTmWlo.js.map → periodontal-chart-card-Bz-ebteE.js.map} +1 -1
  89. package/dist/_chunks/{periodontal-diagnosis-Qk4F3Wc_.js → periodontal-diagnosis-HrFsVi-C.js} +3 -3
  90. package/dist/_chunks/{periodontal-diagnosis-Qk4F3Wc_.js.map → periodontal-diagnosis-HrFsVi-C.js.map} +1 -1
  91. package/dist/_chunks/{periodontal-risk-chart-ByKuM4cF.js → periodontal-risk-chart-0x7KVZjL.js} +2 -2
  92. package/dist/_chunks/{periodontal-risk-chart-ByKuM4cF.js.map → periodontal-risk-chart-0x7KVZjL.js.map} +1 -1
  93. package/dist/_chunks/{practice-results-C5exrEn0.js → practice-results-DWUZRm2x.js} +2 -2
  94. package/dist/_chunks/{practice-results-C5exrEn0.js.map → practice-results-DWUZRm2x.js.map} +1 -1
  95. package/dist/_chunks/{pregnancy-dating-4tPV_Yko.js → pregnancy-dating-DQVpFs_f.js} +6 -6
  96. package/dist/_chunks/{pregnancy-dating-4tPV_Yko.js.map → pregnancy-dating-DQVpFs_f.js.map} +1 -1
  97. package/dist/_chunks/{pregnancy-weight-gain-BBgbWBGe.js → pregnancy-weight-gain-hm3QJALe.js} +5 -5
  98. package/dist/_chunks/{pregnancy-weight-gain-BBgbWBGe.js.map → pregnancy-weight-gain-hm3QJALe.js.map} +1 -1
  99. package/dist/_chunks/radio-group-rXDJADzW.js +175 -0
  100. package/dist/_chunks/radio-group-rXDJADzW.js.map +1 -0
  101. package/dist/_chunks/{radiograph-panel.agent-Drj0hYVV.js → radiograph-panel.agent-CAXFgCyn.js} +3 -3
  102. package/dist/_chunks/{radiograph-panel.agent-Drj0hYVV.js.map → radiograph-panel.agent-CAXFgCyn.js.map} +1 -1
  103. package/dist/_chunks/{signature-status-chip-DlLJk1VA.js → signature-status-chip-DqrPIJtH.js} +2 -2
  104. package/dist/_chunks/{signature-status-chip-DlLJk1VA.js.map → signature-status-chip-DqrPIJtH.js.map} +1 -1
  105. package/dist/_chunks/{tab-bar-Ddp_ZbnL.js → tab-bar-DvFJIQfL.js} +2 -2
  106. package/dist/_chunks/{tab-bar-Ddp_ZbnL.js.map → tab-bar-DvFJIQfL.js.map} +1 -1
  107. package/dist/_chunks/{tasks-panel-T7vaKJcA.js → tasks-panel-BBkZuejF.js} +2 -2
  108. package/dist/_chunks/{tasks-panel-T7vaKJcA.js.map → tasks-panel-BBkZuejF.js.map} +1 -1
  109. package/dist/_chunks/{unit-converter-Dsk__pjA.js → unit-converter-iDxlxKmm.js} +3 -3
  110. package/dist/_chunks/{unit-converter-Dsk__pjA.js.map → unit-converter-iDxlxKmm.js.map} +1 -1
  111. package/dist/_chunks/{widget-picker-DqMbjQy_.js → widget-picker-em4xGgv0.js} +2 -2
  112. package/dist/_chunks/{widget-picker-DqMbjQy_.js.map → widget-picker-em4xGgv0.js.map} +1 -1
  113. package/dist/_chunks/{workflow-map-BNBeG2zn.js → workflow-map-BVofnDYh.js} +2 -2
  114. package/dist/_chunks/{workflow-map-BNBeG2zn.js.map → workflow-map-BVofnDYh.js.map} +1 -1
  115. package/dist/agent-catalog.json +1 -1
  116. package/dist/components/address-fields/index.js +1 -1
  117. package/dist/components/agenda-card/index.js +1 -1
  118. package/dist/components/agenda-tray/index.js +1 -1
  119. package/dist/components/ai-consent-banner/index.js +1 -1
  120. package/dist/components/anamnesis-card/index.js +1 -1
  121. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts +2 -2
  122. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts.map +1 -1
  123. package/dist/components/anamnesis-summary-card/index.js +1 -1
  124. package/dist/components/appointment-card/index.js +2 -2
  125. package/dist/components/appointment-timeline/index.js +1 -1
  126. package/dist/components/badge/badge.d.ts.map +1 -1
  127. package/dist/components/badge/index.js +1 -1
  128. package/dist/components/bishop-score/index.js +1 -1
  129. package/dist/components/bmi-calculator/index.js +1 -1
  130. package/dist/components/booking/index.js +1 -1
  131. package/dist/components/care-plan-card/index.js +1 -1
  132. package/dist/components/care-plan-entry-card/index.js +1 -1
  133. package/dist/components/care-plan-header/index.js +1 -1
  134. package/dist/components/clinical-note-card/index.js +1 -1
  135. package/dist/components/connection-status/index.js +1 -1
  136. package/dist/components/contact-profile-card/index.js +1 -1
  137. package/dist/components/cycle-calculator/index.js +1 -1
  138. package/dist/components/data-table/index.js +1 -1
  139. package/dist/components/dependent-selector/index.js +1 -1
  140. package/dist/components/document-preview/index.js +1 -1
  141. package/dist/components/due-date-calculator/index.js +2 -2
  142. package/dist/components/fetal-weight/index.js +1 -1
  143. package/dist/components/file-manager/index.js +1 -1
  144. package/dist/components/form-field/form-field.d.ts +8 -0
  145. package/dist/components/form-field/form-field.d.ts.map +1 -1
  146. package/dist/components/form-field/index.js +1 -1
  147. package/dist/components/gestational-age-calculator/index.js +1 -1
  148. package/dist/components/hcg-doubling/index.js +1 -1
  149. package/dist/components/notes-panel/index.js +1 -1
  150. package/dist/components/number-input/index.js +1 -1
  151. package/dist/components/number-input/number-input.d.ts +5 -2
  152. package/dist/components/number-input/number-input.d.ts.map +1 -1
  153. package/dist/components/operator-hero/index.js +1 -1
  154. package/dist/components/optical-prescription/index.js +1 -1
  155. package/dist/components/patient-details/index.js +1 -1
  156. package/dist/components/patient-summary-card/index.js +1 -1
  157. package/dist/components/patient-table/index.js +1 -1
  158. package/dist/components/payment-card/index.js +1 -1
  159. package/dist/components/periodontal-chart/index.js +1 -1
  160. package/dist/components/periodontal-chart-card/index.js +1 -1
  161. package/dist/components/periodontal-diagnosis/index.js +1 -1
  162. package/dist/components/periodontal-risk-chart/index.js +1 -1
  163. package/dist/components/practice-results/index.js +1 -1
  164. package/dist/components/pregnancy-dating/index.js +1 -1
  165. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  166. package/dist/components/radio-group/index.js +1 -1
  167. package/dist/components/radio-group/radio-group.d.ts +5 -0
  168. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  169. package/dist/components/radiograph-panel/index.js +1 -1
  170. package/dist/components/signature-status-chip/index.js +1 -1
  171. package/dist/components/tab-bar/index.js +1 -1
  172. package/dist/components/tasks-panel/index.js +1 -1
  173. package/dist/components/unit-converter/index.js +1 -1
  174. package/dist/components/widget-picker/index.js +1 -1
  175. package/dist/components/workflow/index.js +1 -1
  176. package/dist/host-compat.css +4 -1
  177. package/dist/index.js +56 -56
  178. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +7 -1
  179. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts.map +1 -1
  180. package/dist/patterns/anamnesis/anamnesis-field.d.ts +15 -1
  181. package/dist/patterns/anamnesis/anamnesis-field.d.ts.map +1 -1
  182. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts.map +1 -1
  183. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +3 -1
  184. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts.map +1 -1
  185. package/dist/patterns/anamnesis/anamnesis-intake.d.ts +3 -2
  186. package/dist/patterns/anamnesis/anamnesis-intake.d.ts.map +1 -1
  187. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts.map +1 -1
  188. package/dist/patterns/anamnesis/anamnesis-types.d.ts +3 -0
  189. package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -1
  190. package/dist/patterns/anamnesis/index.js +1 -1
  191. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  192. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  193. package/dist/tokens.css +3 -3
  194. package/package.json +1 -1
  195. package/dist/_chunks/anamnesis-summary-card-BKGVcwny.js.map +0 -1
  196. package/dist/_chunks/anamnesis-summary-rows-B5MAYkJ-.js.map +0 -1
  197. package/dist/_chunks/form-field-D1oqYisL.js +0 -127
  198. package/dist/_chunks/form-field-D1oqYisL.js.map +0 -1
  199. package/dist/_chunks/number-input-CM1q9zvH.js.map +0 -1
  200. package/dist/_chunks/radio-group-BmIqhIT2.js +0 -171
  201. package/dist/_chunks/radio-group-BmIqhIT2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"field-value-BCFLVBmu.js","sources":["../../node_modules/lucide-react/dist/esm/icons/hourglass.mjs","../../node_modules/lucide-react/dist/esm/icons/mars.mjs","../../node_modules/lucide-react/dist/esm/icons/venus.mjs","../../src/components/_shared/patient-fields.ts","../../src/components/_shared/field-visibility.ts","../../src/components/_shared/field-visibility-cog.tsx","../../src/components/_shared/field-value.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n { d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\", key: \"1vvvr6\" }\n ]\n];\nconst Hourglass = createLucideIcon(\"hourglass\", __iconNode);\n\nexport { __iconNode, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 3h5v5\", key: \"1806ms\" }],\n [\"path\", { d: \"m21 3-6.75 6.75\", key: \"pv0uzu\" }],\n [\"circle\", { cx: \"10\", cy: \"14\", r: \"6\", key: \"1qwbdc\" }]\n];\nconst Mars = createLucideIcon(\"mars\", __iconNode);\n\nexport { __iconNode, Mars as default };\n//# sourceMappingURL=mars.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 15v7\", key: \"t2xh3l\" }],\n [\"path\", { d: \"M9 19h6\", key: \"456am0\" }],\n [\"circle\", { cx: \"12\", cy: \"9\", r: \"6\", key: \"1nw4tq\" }]\n];\nconst Venus = createLucideIcon(\"venus\", __iconNode);\n\nexport { __iconNode, Venus as default };\n//# sourceMappingURL=venus.mjs.map\n","import type { ReactElement, ReactNode } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Shared patient-field model */\n/* */\n/* The single field VOCABULARY every patient surface speaks — consumed */\n/* by both `PatientDetails` (full, inline-editable) and */\n/* `PatientSummaryCard` (compact). Either can surface a \"Customize */\n/* fields\" cog (show/hide + drag-and-drop reorder). The kit owns the */\n/* SHAPE; the CONSUMER owns the registry (which DoctorPatient field maps */\n/* to which id/label/PHI flag). */\n/* */\n/* Visibility + order are PER-CONTEXT, not global: the kit never persists */\n/* them — each PLACEMENT is wired to its own `visibleFieldOrder` / */\n/* `onVisibleFieldsChange`, so the SAME vocabulary can display */\n/* differently in different parts of the app (a care-plan card vs the */\n/* patient folder). The consumer chooses the persistence scope — global */\n/* per-user, or per-surface (PRS §Security; design doc D1/D2). */\n/* -------------------------------------------------------------------- */\n\n/**\n * Canonical field TYPE. When set (and no explicit `value` is supplied), the\n * kit renders the field's canonical chip from the shared `<FieldValue>`\n * registry instead of plain text — so the SAME field type looks the same on\n * every surface. Each chip is a high-contrast neutral pill with a glyph:\n *\n * - `sex` → Venus / Mars / User glyph + localised label\n * - `age` → hourglass glyph + localised, pluralised age\n * - `dob` → calendar glyph + locale-formatted date\n * - `fiscalCode` → hash glyph + monospace code (already mono — no `mono` flag\n * needed; copy + PHI lock stay the row-level affordance via\n * `copyable` / `sensitive`)\n * - `discount` → `TransactionChip` `state=\"discount\"` (the canonical monetary\n * discount chip — magnitude + `currency`, sign owned by the chip)\n * - `email` → a `mailto:` `Link` (the address is both display + target)\n * - `phone` → a `tel:` `Link` (formatted display, target normalised to\n * `+` and digits)\n *\n * The raw datum is read from `editValue` (the same scalar that seeds the\n * editor): a number for `age` / `discount`, an ISO string or `Date` for `dob`,\n * a code string for `sex`, the code string for `fiscalCode`. For the contact\n * link kinds the DISPLAY string is read from `value` (or `editValue`) and the\n * href is derived from it — so a plain-string `value` still becomes a link.\n * For every OTHER kind an explicit `value` ALWAYS wins, so a consumer can still\n * override per placement.\n */\nexport type PatientFieldKind =\n | 'sex'\n | 'age'\n | 'dob'\n | 'fiscalCode'\n | 'discount'\n | 'email'\n | 'phone';\n\n/** Editor control rendered when a field enters inline-edit mode. */\nexport type PatientFieldEditType =\n | 'text'\n | 'textarea'\n | 'select'\n | 'boolean'\n | 'date'\n | 'number'\n // Typed text variants — each renders the kit's dedicated input (validation,\n // formatting, masking) instead of a bare TextInput. Their edited value still\n // serialises to a plain string through the shared save callback.\n | 'email'\n | 'phone'\n | 'fiscalCode'\n // Address / location variants — each renders the dedicated kit picker.\n // `province`/`country`/`city` emit a plain string (UPPER sigla / alpha-2\n // lower / city name); `postalCode` validates the IT CAP format on blur.\n | 'province'\n | 'country'\n | 'postalCode'\n | 'city';\n\n/** A choice for an `editType: 'select'` field. */\nexport interface PatientFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Raw value seeded into an editor. The kit never inspects this beyond\n * handing it to the matching control and back through a save callback.\n */\nexport type PatientFieldEditValue =\n | string\n | number\n | boolean\n | Date\n | null\n | undefined;\n\n/** One label→value patient field. */\nexport interface PatientField {\n /**\n * Stable field key — drives visibility, ordering, the `data-field-id`\n * hook, and agent addressing. MUST NOT be the value (no PHI in keys).\n */\n id: string;\n /** Display label (already localised by the consumer, or a kit label). */\n label: string;\n /**\n * Display node — formatted by the consumer (Badge / Tag / Link / text).\n * Optional: omit it and set `kind` to let the kit render the field's\n * canonical chip from `editValue`. When present, `value` ALWAYS wins.\n */\n value?: ReactNode;\n /**\n * Canonical field type — when set and `value` is omitted, the kit renders\n * the matching canonical chip from the shared registry. Presentation only;\n * NEVER emitted into any `data-*` attribute (same rule as `sensitive`).\n */\n kind?: PatientFieldKind;\n /** Leading icon (a single lucide element). */\n icon?: ReactElement | null;\n /** Render the copy-to-clipboard affordance (fiscal code, ids). */\n copyable?: boolean;\n /** Text written to the clipboard when `copyable`. */\n copyText?: string;\n /** Render the value monospaced (codes, ids). */\n mono?: boolean;\n /**\n * High-sensitivity PHI marker — renders a lock glyph next to the label.\n * Presentation only; NEVER emitted into any `data-*` attribute.\n */\n sensitive?: boolean;\n /** Whether this field can be inline-edited (consumer gates by permission). */\n editable?: boolean;\n /** Control used in edit mode. Defaults to `'text'`. */\n editType?: PatientFieldEditType;\n /** Options for `editType: 'select'`. */\n options?: PatientFieldOption[];\n /** Value seeded into the editor when editing begins. */\n editValue?: PatientFieldEditValue;\n /** Currency code for `editType: 'number'` (renders a currency input). */\n currency?: string;\n}\n\n/** A labelled, collapsible group of fields. */\nexport interface PatientFieldSection {\n /** Stable section key. */\n id: string;\n /** Section heading. */\n heading: string;\n fields: PatientField[];\n /** Wrap the section in a Collapsible (default `true`). Honoured by PatientDetails. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` (default `true`). */\n defaultOpen?: boolean;\n}\n\n/** The flat declaration-order list of every field id — the \"show everything\" default. */\nexport function patientFieldCatalogue(\n sections: PatientFieldSection[],\n): string[] {\n return sections.flatMap((s) => s.fields.map((f) => f.id));\n}\n\n/** A section paired with its currently-visible fields, in the chosen order. */\nexport interface ResolvedPatientSection {\n section: PatientFieldSection;\n fields: PatientField[];\n}\n\n/**\n * Project `sections` to the visible fields per section, ordered by\n * `visibleFieldOrder`. This is the single piece of visibility logic shared\n * by every patient surface, so the card and the details panel always agree\n * on what is shown and in what order.\n *\n * `visibleFieldOrder` omitted (`undefined`) ⇒ every field visible in\n * declaration order (\"show everything by default\", design doc D3). An explicit\n * empty array `[]` ⇒ NO fields visible — a surface that starts collapsed and\n * reveals fields via the customize-fields cog. Unknown ids are ignored.\n * Sections stay in declaration order; only intra-section field order follows\n * `visibleFieldOrder`.\n */\nexport function resolveVisibleFields(\n sections: PatientFieldSection[],\n visibleFieldOrder?: string[],\n): ResolvedPatientSection[] {\n const order = visibleFieldOrder ?? patientFieldCatalogue(sections);\n const orderIndex = new Map(order.map((id, index) => [id, index]));\n return sections.map((section) => ({\n section,\n fields: section.fields\n .filter((field) => orderIndex.has(field.id))\n .sort(\n (a, b) =>\n (orderIndex.get(a.id) as number) - (orderIndex.get(b.id) as number),\n ),\n }));\n}\n","import { useCallback, useMemo } from 'react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n patientFieldCatalogue,\n type PatientField,\n type PatientFieldSection,\n} from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* usePatientFieldVisibility */\n/* */\n/* The single visibility + ordering engine behind the patient field */\n/* picker, shared by every surface that lets a user curate which patient */\n/* fields show and in what order (PatientDetails, PatientSummaryCard). */\n/* */\n/* CONTEXT-SCOPED, not global: the order is a per-INSTANCE prop the kit */\n/* never persists. Each placement (a care-plan card, the patient-folder */\n/* summary, the Control Room details panel) is wired to its OWN */\n/* `value` / `onChange`, so the SAME field vocabulary can be displayed */\n/* differently in different parts of the app. The consumer owns the */\n/* persistence scope — global per-user, or per-context. */\n/* */\n/* Every mutation filters to known field ids, so persisted / agent input */\n/* can never smuggle an unknown key into the visible set. */\n/* -------------------------------------------------------------------- */\n\nexport interface UsePatientFieldVisibilityOptions {\n /** Controlled ordered list of visible field ids. */\n value?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field, declaration order. */\n defaultValue?: string[];\n /** Fired on any show / hide / reorder, with the next ordered visible set. */\n onChange?: (orderedIds: string[]) => void;\n}\n\nexport interface PatientFieldVisibility {\n /** Current ordered list of visible field ids (filtered to known fields). */\n visible: string[];\n /** Flat declaration-order catalogue of every field id (\"show everything\"). */\n catalogueIds: string[];\n /** field id → its field + owning section id. */\n fieldById: Map<string, { field: PatientField; sectionId: string }>;\n /** Replace the visible set / order (filtered to known fields). */\n setOrder: (orderedIds: string[]) => void;\n /** Show or hide a single field. */\n toggleField: (fieldId: string) => void;\n /** Show or hide every field in a section. */\n toggleSection: (sectionId: string, show: boolean) => void;\n /**\n * Move a field to land at another field's slot, WITHIN its section's\n * visible subsequence. Cross-section moves are ignored — sections stay in\n * declaration order. Drives both pointer drops and keyboard (Alt+Arrow).\n */\n moveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to `defaultValue` (or the full catalogue when none was given). */\n reset: () => void;\n}\n\nexport function usePatientFieldVisibility(\n sections: PatientFieldSection[],\n { value, defaultValue, onChange }: UsePatientFieldVisibilityOptions = {},\n): PatientFieldVisibility {\n const catalogueIds = useMemo(\n () => patientFieldCatalogue(sections),\n [sections],\n );\n\n const [orderState, setOrderState] = useControllableState<string[]>({\n value,\n defaultValue: defaultValue ?? catalogueIds,\n onChange,\n });\n // `useControllableState` may yield `undefined` before the first write.\n const visible = orderState ?? defaultValue ?? catalogueIds;\n\n const fieldById = useMemo(() => {\n const map = new Map<string, { field: PatientField; sectionId: string }>();\n for (const section of sections) {\n for (const field of section.fields) {\n map.set(field.id, { field, sectionId: section.id });\n }\n }\n return map;\n }, [sections]);\n\n const setOrder = useCallback(\n (next: string[]) => {\n // Drop unknown ids so persisted / agent input can't smuggle keys.\n setOrderState(next.filter((fid) => fieldById.has(fid)));\n },\n [setOrderState, fieldById],\n );\n\n const toggleField = useCallback(\n (fieldId: string) => {\n setOrder(\n visible.includes(fieldId)\n ? visible.filter((fid) => fid !== fieldId)\n : [...visible, fieldId],\n );\n },\n [visible, setOrder],\n );\n\n const toggleSection = useCallback(\n (sectionId: string, show: boolean) => {\n const sectionIds =\n sections.find((s) => s.id === sectionId)?.fields.map((f) => f.id) ?? [];\n const sectionSet = new Set(sectionIds);\n if (show) {\n const missing = sectionIds.filter((fid) => !visible.includes(fid));\n setOrder([...visible, ...missing]);\n } else {\n setOrder(visible.filter((fid) => !sectionSet.has(fid)));\n }\n },\n [sections, visible, setOrder],\n );\n\n const moveFieldOnto = useCallback(\n (fromId: string, toId: string) => {\n if (fromId === toId) return;\n const fromSection = fieldById.get(fromId)?.sectionId;\n const toSection = fieldById.get(toId)?.sectionId;\n if (!fromSection || fromSection !== toSection) return;\n const sectionIds = new Set(\n sections.find((s) => s.id === fromSection)?.fields.map((f) => f.id) ??\n [],\n );\n const siblings = visible.filter((fid) => sectionIds.has(fid));\n const fromIdx = siblings.indexOf(fromId);\n const toIdx = siblings.indexOf(toId);\n if (fromIdx < 0 || toIdx < 0) return;\n const [moved] = siblings.splice(fromIdx, 1);\n siblings.splice(toIdx, 0, moved);\n // Splice the reordered siblings back into their positions in `visible`.\n let k = 0;\n const next = visible.map((fid) =>\n sectionIds.has(fid) ? siblings[k++] : fid,\n );\n setOrder(next);\n },\n [fieldById, sections, visible, setOrder],\n );\n\n const reset = useCallback(() => {\n setOrder(defaultValue ?? catalogueIds);\n }, [defaultValue, catalogueIds, setOrder]);\n\n return {\n visible,\n catalogueIds,\n fieldById,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset,\n };\n}\n","import {\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GripVertical, Settings } from 'lucide-react';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Popover } from '../popover/popover';\nimport { Separator } from '../separator/separator';\nimport type { PatientFieldSection } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldVisibilityCog — the patient field picker */\n/* */\n/* The shared \"Customize fields\" cog: a Popover of per-field checkboxes */\n/* (grouped by section, with a section-level toggle-all where the section */\n/* is named), a drag handle per visible field for pointer reordering, and */\n/* the canonical Sidebar keyboard reorder gesture (Alt+Arrow / Alt+Home / */\n/* Alt+End) with an sr-only live announcement. Pure UI — the visibility */\n/* state + reducers live in `usePatientFieldVisibility`, so PatientDetails */\n/* and PatientSummaryCard share ONE picker driving each surface's own */\n/* per-context order. */\n/* */\n/* Native-HTML5 DnD (no library), mirroring data-table's ColumnToggle; */\n/* the grip adds the keyboard channel that pattern lacks. Sections with an */\n/* empty heading render their fields flat with no toggle-all (the card's */\n/* legacy single-section mode) so no empty-named checkbox is emitted. */\n/* -------------------------------------------------------------------- */\n\nexport interface FieldVisibilityCogProps {\n /** The sectioned field catalogue. */\n sections: PatientFieldSection[];\n /** Current ordered visible field ids. */\n visible: string[];\n /** Show / hide a single field. */\n onToggleField: (fieldId: string) => void;\n /** Show / hide every field in a section. */\n onToggleSection: (sectionId: string, show: boolean) => void;\n /** Move a field onto another field's slot within its section. */\n onMoveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to the default field set / order. */\n onReset: () => void;\n /** Override the cog trigger's accessible name. */\n label?: string;\n}\n\nexport function FieldVisibilityCog({\n sections,\n visible,\n onToggleField,\n onToggleSection,\n onMoveFieldOnto,\n onReset,\n label,\n}: FieldVisibilityCogProps): ReactNode {\n const { t } = useTranslation();\n const visibleSet = useMemo(() => new Set(visible), [visible]);\n\n // Drag-and-drop reorder (pointer). The keyboard channel runs through each\n // grip handle's Alt+Arrow keys; both routes share `onMoveFieldOnto`.\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragOverId, setDragOverId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n // Field id → section id and → label: the cross-section drop guard and the\n // move announcement both need the DRAGGED field's section/label, which isn't\n // in the drop row's render scope.\n const { sectionOfField, labelOfField } = useMemo(() => {\n const sectionMap = new Map<string, string>();\n const labelMap = new Map<string, string>();\n for (const section of sections) {\n for (const field of section.fields) {\n sectionMap.set(field.id, section.id);\n labelMap.set(field.id, field.label);\n }\n }\n return { sectionOfField: sectionMap, labelOfField: labelMap };\n }, [sections]);\n\n const draggingSectionId = draggingId\n ? sectionOfField.get(draggingId)\n : undefined;\n\n const clearDrag = useCallback(() => {\n setDraggingId(null);\n setDragOverId(null);\n }, []);\n\n // Announce the moved field's new 1-based position to assistive tech.\n const announceMoved = useCallback(\n (fieldId: string, newIndex: number, count: number) => {\n setAnnouncement(\n t('fieldPicker.moved', {\n field: labelOfField.get(fieldId) ?? '',\n position: newIndex + 1,\n count,\n defaultValue: 'Moved {{field}} to position {{position}} of {{count}}',\n }),\n );\n },\n [t, labelOfField],\n );\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent=\"outline\"\n icon={<Settings aria-hidden=\"true\" />}\n aria-label={\n label ??\n t('fieldPicker.trigger', { defaultValue: 'Customize fields' })\n }\n className=\"ds:shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Content align=\"end\" size=\"sm\">\n <Popover.Heading>\n {t('fieldPicker.title', { defaultValue: 'Customize fields' })}\n </Popover.Heading>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]\">\n {sections.map((section) => {\n const fieldIds = section.fields.map((f) => f.id);\n const shownCount = fieldIds.filter((fid) =>\n visibleSet.has(fid),\n ).length;\n // Visible siblings in display order — the subsequence reordering\n // operates on. The keyboard arrows' no-op bounds key off the\n // field's index HERE, not the full declaration array.\n const orderedVisible = visible.filter((fid) =>\n fieldIds.includes(fid),\n );\n const sectionState: boolean | 'indeterminate' =\n shownCount === 0\n ? false\n : shownCount === fieldIds.length\n ? true\n : 'indeterminate';\n // A named section gets a toggle-all checkbox + indented field list;\n // an unnamed one (the card's single legacy section) renders flat.\n const named = !!section.heading;\n return (\n <div\n key={section.id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {named ? (\n <Checkbox\n size=\"sm\"\n label={section.heading}\n checked={sectionState}\n onCheckedChange={(checked) =>\n onToggleSection(section.id, checked === true)\n }\n />\n ) : null}\n <ul\n className={[\n 'ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]',\n named ? 'ds:ps-[var(--spacing-md)]' : 'ds:ps-0',\n ].join(' ')}\n >\n {section.fields.map((field) => {\n const shown = visibleSet.has(field.id);\n const visIndex = orderedVisible.indexOf(field.id);\n const count = orderedVisible.length;\n const isDragging = draggingId === field.id;\n const isDragOver =\n dragOverId === field.id &&\n draggingId !== null &&\n draggingId !== field.id &&\n draggingSectionId === section.id;\n\n // Native-HTML5 DnD wiring, applied only to visible rows —\n // a hidden field is neither a drag source nor a drop slot.\n const dragProps: HTMLAttributes<HTMLLIElement> = shown\n ? {\n draggable: true,\n onDragStart: (e) => {\n setDraggingId(field.id);\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', field.id);\n },\n onDragOver: (e) => {\n // Same-section drops only; sections stay fixed.\n if (\n draggingId === null ||\n draggingSectionId !== section.id\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDragOverId(field.id);\n },\n onDragLeave: () =>\n setDragOverId((prev) =>\n prev === field.id ? null : prev,\n ),\n onDrop: (e) => {\n e.preventDefault();\n const fromId = e.dataTransfer.getData('text/plain');\n if (\n fromId &&\n fromId !== field.id &&\n sectionOfField.get(fromId) === section.id\n ) {\n onMoveFieldOnto(fromId, field.id);\n announceMoved(fromId, visIndex, count);\n }\n clearDrag();\n },\n onDragEnd: clearDrag,\n }\n : {};\n\n return (\n <li\n key={field.id}\n {...dragProps}\n className={[\n 'ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)] ds:py-[var(--spacing-2xs)] ds:transition-colors ds:motion-reduce:transition-none',\n isDragging ? 'ds:opacity-50' : '',\n isDragOver\n ? 'ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <Checkbox\n size=\"sm\"\n label={field.label}\n checked={shown}\n onCheckedChange={() => onToggleField(field.id)}\n />\n {shown ? (\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<GripVertical aria-hidden=\"true\" />}\n aria-label={t('fieldPicker.reorder', {\n field: field.label,\n defaultValue:\n 'Reorder {{field}}. Press Alt + Up or Alt + Down to move.',\n })}\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End\"\n className=\"ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing\"\n onKeyDown={(e) => {\n // Reorder gestures mirror the canonical Sidebar\n // handle: Alt+Arrow (+ Alt+Home / Alt+End). Bare\n // arrows fall through to the browser default.\n if (!e.altKey) return;\n if (e.key === 'ArrowUp') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex - 1],\n );\n announceMoved(field.id, visIndex - 1, count);\n } else if (e.key === 'ArrowDown') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex + 1],\n );\n announceMoved(field.id, visIndex + 1, count);\n } else if (e.key === 'Home') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(field.id, orderedVisible[0]);\n announceMoved(field.id, 0, count);\n } else if (e.key === 'End') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[count - 1],\n );\n announceMoved(field.id, count - 1, count);\n }\n }}\n />\n ) : null}\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n <Separator orientation=\"horizontal\" />\n <Button type=\"button\" size=\"sm\" intent=\"ghost\" onClick={onReset}>\n {t('fieldPicker.reset', { defaultValue: 'Reset to defaults' })}\n </Button>\n </div>\n {/* Reorder announcements for assistive tech (drag drop + arrow keys). */}\n <span role=\"status\" className=\"ds:sr-only\">\n {announcement}\n </span>\n </Popover.Content>\n </Popover.Root>\n );\n}\n","import { cloneElement, type ReactElement, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Hash, Hourglass, Mars, User, Venus } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport type { PatientField } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldValue — the canonical field-chip registry */\n/* */\n/* Renders ONE patient field's value slot. When the consumer supplies an */\n/* explicit `value` (legacy rows, per-placement overrides) it wins */\n/* verbatim. Otherwise `kind` selects the canonical chip and the raw */\n/* datum is read from `editValue`, so a known field type looks the same */\n/* on every surface (PatientSummaryCard + PatientDetails share this). */\n/* */\n/* The per-type chips (`SexChip` / `AgeChip` / `NeutralChip`) are exported */\n/* so the PatientSummaryCard identity line renders the SAME chips under */\n/* the name. */\n/* */\n/* Pure composition over already-marked kit primitives (Badge / */\n/* TransactionChip) — it mounts no surface of its own, so it carries no */\n/* `data-component` (allowlisted in check-data-component-coverage.mjs). */\n/* -------------------------------------------------------------------- */\n\n// The neutral Badge's own text colour (`--muted-foreground`) is too low\n// contrast for primary demographic data — grey text on the grey pill reads at\n// ~5.8:1. The chip label + glyph are pinned to `--foreground` (~11:1) so the\n// data stays legible on every theme.\nconst STRONG = 'ds:text-[color:var(--foreground)]';\n\n/** Default English labels — real translations live under `patientField.*`. */\nconst SEX_LABEL_DEFAULT: Record<string, string> = {\n m: 'Male',\n f: 'Female',\n x: 'Other',\n};\n\n/** A neutral pill with high-contrast text + an optional leading glyph. */\nexport function NeutralChip({\n icon,\n mono,\n children,\n}: {\n icon?: ReactElement;\n mono?: boolean;\n children: ReactNode;\n}): ReactNode {\n return (\n <Badge\n variant=\"neutral\"\n className={mono ? 'ds:font-mono' : undefined}\n // Clone the glyph (don't wrap it) so it stays Badge's DIRECT <svg> child —\n // Badge's `[&>svg]:size-*` rule only sizes a direct child, so wrapping it\n // left the glyph at lucide's default 24px. The clone also carries `STRONG`.\n leading={\n icon\n ? cloneElement(icon as ReactElement<{ className?: string }>, {\n className: STRONG,\n })\n : undefined\n }\n >\n <span className={STRONG}>{children}</span>\n </Badge>\n );\n}\n\n/** Sex chip — Venus / Mars / User glyph + localised label. Female / male carry a\n * tonal pink / blue FILL; unspecified stays the neutral pill. */\nexport function SexChip({ code }: { code: string }): ReactNode {\n const { t } = useTranslation();\n const c = code.toLowerCase();\n const label = t(`patientField.sex.${c}`, {\n defaultValue: SEX_LABEL_DEFAULT[c] ?? code,\n });\n // The fill carries the colour; Badge sizes + tones the glyph from the variant.\n // `accentSoft` is the kit's tonal magenta (≈ pink); `info` the tonal indigo\n // (≈ blue, the closest the closed palette has to blue). Other → neutral.\n if (c === 'f') {\n return (\n <Badge variant=\"accentSoft\" leading={<Venus />}>\n {label}\n </Badge>\n );\n }\n if (c === 'm') {\n return (\n <Badge variant=\"info\" leading={<Mars />}>\n {label}\n </Badge>\n );\n }\n return <NeutralChip icon={<User />}>{label}</NeutralChip>;\n}\n\n/** Age chip — hourglass glyph + localised, pluralised age. */\nexport function AgeChip({ years }: { years: number }): ReactNode {\n const { t } = useTranslation();\n return (\n <NeutralChip icon={<Hourglass />}>\n {t('patientField.age', {\n count: years,\n defaultValue: '{{count}} years old',\n })}\n </NeutralChip>\n );\n}\n\nexport function FieldValue({ field }: { field: PatientField }): ReactNode {\n const { i18n } = useTranslation();\n\n // Contact kinds render as a mailto:/tel: Link — the display string is read\n // from `value` (or `editValue`), the href is derived from it. Checked BEFORE\n // the explicit-value short-circuit so a plain-string `value` still links.\n if (field.kind === 'email' || field.kind === 'phone') {\n const display =\n typeof field.value === 'string'\n ? field.value\n : (field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : ''));\n if (display) {\n // mailto: trims surrounding whitespace; tel: keeps only `+` and digits\n // (dialler-safe), leaving the formatted text as the visible label.\n const href =\n field.kind === 'email'\n ? `mailto:${display.trim()}`\n : `tel:${display.replace(/[^+\\d]/g, '')}`;\n return <Link href={href}>{display}</Link>;\n }\n // No string to link — fall through to any explicit node value below.\n }\n\n // An explicit value always wins — legacy rows + per-placement overrides.\n if (field.value != null) {\n return <>{field.value}</>;\n }\n if (!field.kind) {\n return null;\n }\n\n switch (field.kind) {\n case 'sex':\n return <SexChip code={String(field.editValue ?? '')} />;\n case 'age': {\n const years =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(years)) {\n return null;\n }\n return <AgeChip years={years} />;\n }\n case 'dob': {\n const raw = field.editValue;\n const date = raw instanceof Date ? raw : new Date(String(raw ?? ''));\n const formatted = Number.isNaN(date.getTime())\n ? String(raw ?? '')\n : new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(date);\n if (!formatted) {\n return null;\n }\n return <NeutralChip icon={<CalendarDays />}>{formatted}</NeutralChip>;\n }\n case 'fiscalCode': {\n // Copy + PHI lock stay the consumer's row-level affordance (PatientDetails\n // renders them from `copyable` / `sensitive`); the chip is the mono pill.\n const code =\n field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : '');\n if (!code) {\n return null;\n }\n return (\n <NeutralChip icon={<Hash />} mono>\n {code}\n </NeutralChip>\n );\n }\n case 'discount': {\n // The canonical monetary discount chip — magnitude + currency, the sign\n // (\"−\") and glyph owned by TransactionChip. The row label gives context,\n // so the chip itself shows only the amount (no duplicate state label).\n const amount =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(amount)) {\n return null;\n }\n return (\n <TransactionChip\n state=\"discount\"\n amount={Math.abs(amount)}\n currency={field.currency}\n size=\"sm\"\n />\n );\n }\n default:\n return null;\n }\n}\n"],"names":["__iconNode","Hourglass","createLucideIcon","Mars","Venus","patientFieldCatalogue","sections","s","f","resolveVisibleFields","visibleFieldOrder","order","orderIndex","id","index","section","field","a","b","usePatientFieldVisibility","value","defaultValue","onChange","catalogueIds","useMemo","orderState","setOrderState","useControllableState","visible","fieldById","map","setOrder","useCallback","next","fid","toggleField","fieldId","toggleSection","sectionId","show","sectionIds","_a","sectionSet","missing","moveFieldOnto","fromId","toId","fromSection","toSection","_b","_c","siblings","fromIdx","toIdx","moved","k","reset","FieldVisibilityCog","onToggleField","onToggleSection","onMoveFieldOnto","onReset","label","t","useTranslation","visibleSet","draggingId","setDraggingId","useState","dragOverId","setDragOverId","announcement","setAnnouncement","sectionOfField","labelOfField","sectionMap","labelMap","draggingSectionId","clearDrag","announceMoved","newIndex","count","jsxs","Popover","jsx","IconButton","Settings","fieldIds","shownCount","orderedVisible","sectionState","named","Checkbox","checked","shown","visIndex","isDragging","isDragOver","e","prev","GripVertical","Separator","Button","STRONG","SEX_LABEL_DEFAULT","NeutralChip","icon","mono","children","Badge","cloneElement","SexChip","code","c","User","AgeChip","years","FieldValue","i18n","display","href","Link","Fragment","raw","date","formatted","CalendarDays","Hash","amount","TransactionChip"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAQ;AAAA,EAChG;AACA,GACMC,KAAYC,EAAiB,aAAaF,EAAU;ACxB1D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,mBAAmB,KAAK,SAAQ,CAAE;AAAA,EAChD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMG,KAAOD,EAAiB,QAAQF,EAAU;ACdhD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACx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AA,UACvB,UAAUhH,EAAM;AAAA,UAChB,MAAK;AAAA,QAAA;AAAA,MAAA,IAPA;AAAA,IAUX;AAAA,IACA;AACE,aAAO;AAAA,EAAA;AAEb;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"field-value-BbiDRyNh.js","sources":["../../node_modules/lucide-react/dist/esm/icons/hourglass.mjs","../../node_modules/lucide-react/dist/esm/icons/mars.mjs","../../node_modules/lucide-react/dist/esm/icons/venus.mjs","../../src/components/_shared/patient-fields.ts","../../src/components/_shared/field-visibility.ts","../../src/components/_shared/field-visibility-cog.tsx","../../src/components/_shared/field-value.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n { d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\", key: \"1vvvr6\" }\n ]\n];\nconst Hourglass = createLucideIcon(\"hourglass\", __iconNode);\n\nexport { __iconNode, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 3h5v5\", key: \"1806ms\" }],\n [\"path\", { d: \"m21 3-6.75 6.75\", key: \"pv0uzu\" }],\n [\"circle\", { cx: \"10\", cy: \"14\", r: \"6\", key: \"1qwbdc\" }]\n];\nconst Mars = createLucideIcon(\"mars\", __iconNode);\n\nexport { __iconNode, Mars as default };\n//# sourceMappingURL=mars.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 15v7\", key: \"t2xh3l\" }],\n [\"path\", { d: \"M9 19h6\", key: \"456am0\" }],\n [\"circle\", { cx: \"12\", cy: \"9\", r: \"6\", key: \"1nw4tq\" }]\n];\nconst Venus = createLucideIcon(\"venus\", __iconNode);\n\nexport { __iconNode, Venus as default };\n//# sourceMappingURL=venus.mjs.map\n","import type { ReactElement, ReactNode } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Shared patient-field model */\n/* */\n/* The single field VOCABULARY every patient surface speaks — consumed */\n/* by both `PatientDetails` (full, inline-editable) and */\n/* `PatientSummaryCard` (compact). Either can surface a \"Customize */\n/* fields\" cog (show/hide + drag-and-drop reorder). The kit owns the */\n/* SHAPE; the CONSUMER owns the registry (which DoctorPatient field maps */\n/* to which id/label/PHI flag). */\n/* */\n/* Visibility + order are PER-CONTEXT, not global: the kit never persists */\n/* them — each PLACEMENT is wired to its own `visibleFieldOrder` / */\n/* `onVisibleFieldsChange`, so the SAME vocabulary can display */\n/* differently in different parts of the app (a care-plan card vs the */\n/* patient folder). The consumer chooses the persistence scope — global */\n/* per-user, or per-surface (PRS §Security; design doc D1/D2). */\n/* -------------------------------------------------------------------- */\n\n/**\n * Canonical field TYPE. When set (and no explicit `value` is supplied), the\n * kit renders the field's canonical chip from the shared `<FieldValue>`\n * registry instead of plain text — so the SAME field type looks the same on\n * every surface. Each chip is a high-contrast neutral pill with a glyph:\n *\n * - `sex` → Venus / Mars / User glyph + localised label\n * - `age` → hourglass glyph + localised, pluralised age\n * - `dob` → calendar glyph + locale-formatted date\n * - `fiscalCode` → hash glyph + monospace code (already mono — no `mono` flag\n * needed; copy + PHI lock stay the row-level affordance via\n * `copyable` / `sensitive`)\n * - `discount` → `TransactionChip` `state=\"discount\"` (the canonical monetary\n * discount chip — magnitude + `currency`, sign owned by the chip)\n * - `email` → a `mailto:` `Link` (the address is both display + target)\n * - `phone` → a `tel:` `Link` (formatted display, target normalised to\n * `+` and digits)\n *\n * The raw datum is read from `editValue` (the same scalar that seeds the\n * editor): a number for `age` / `discount`, an ISO string or `Date` for `dob`,\n * a code string for `sex`, the code string for `fiscalCode`. For the contact\n * link kinds the DISPLAY string is read from `value` (or `editValue`) and the\n * href is derived from it — so a plain-string `value` still becomes a link.\n * For every OTHER kind an explicit `value` ALWAYS wins, so a consumer can still\n * override per placement.\n */\nexport type PatientFieldKind =\n | 'sex'\n | 'age'\n | 'dob'\n | 'fiscalCode'\n | 'discount'\n | 'email'\n | 'phone';\n\n/** Editor control rendered when a field enters inline-edit mode. */\nexport type PatientFieldEditType =\n | 'text'\n | 'textarea'\n | 'select'\n | 'boolean'\n | 'date'\n | 'number'\n // Typed text variants — each renders the kit's dedicated input (validation,\n // formatting, masking) instead of a bare TextInput. Their edited value still\n // serialises to a plain string through the shared save callback.\n | 'email'\n | 'phone'\n | 'fiscalCode'\n // Address / location variants — each renders the dedicated kit picker.\n // `province`/`country`/`city` emit a plain string (UPPER sigla / alpha-2\n // lower / city name); `postalCode` validates the IT CAP format on blur.\n | 'province'\n | 'country'\n | 'postalCode'\n | 'city';\n\n/** A choice for an `editType: 'select'` field. */\nexport interface PatientFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Raw value seeded into an editor. The kit never inspects this beyond\n * handing it to the matching control and back through a save callback.\n */\nexport type PatientFieldEditValue =\n | string\n | number\n | boolean\n | Date\n | null\n | undefined;\n\n/** One label→value patient field. */\nexport interface PatientField {\n /**\n * Stable field key — drives visibility, ordering, the `data-field-id`\n * hook, and agent addressing. MUST NOT be the value (no PHI in keys).\n */\n id: string;\n /** Display label (already localised by the consumer, or a kit label). */\n label: string;\n /**\n * Display node — formatted by the consumer (Badge / Tag / Link / text).\n * Optional: omit it and set `kind` to let the kit render the field's\n * canonical chip from `editValue`. When present, `value` ALWAYS wins.\n */\n value?: ReactNode;\n /**\n * Canonical field type — when set and `value` is omitted, the kit renders\n * the matching canonical chip from the shared registry. Presentation only;\n * NEVER emitted into any `data-*` attribute (same rule as `sensitive`).\n */\n kind?: PatientFieldKind;\n /** Leading icon (a single lucide element). */\n icon?: ReactElement | null;\n /** Render the copy-to-clipboard affordance (fiscal code, ids). */\n copyable?: boolean;\n /** Text written to the clipboard when `copyable`. */\n copyText?: string;\n /** Render the value monospaced (codes, ids). */\n mono?: boolean;\n /**\n * High-sensitivity PHI marker — renders a lock glyph next to the label.\n * Presentation only; NEVER emitted into any `data-*` attribute.\n */\n sensitive?: boolean;\n /** Whether this field can be inline-edited (consumer gates by permission). */\n editable?: boolean;\n /** Control used in edit mode. Defaults to `'text'`. */\n editType?: PatientFieldEditType;\n /** Options for `editType: 'select'`. */\n options?: PatientFieldOption[];\n /** Value seeded into the editor when editing begins. */\n editValue?: PatientFieldEditValue;\n /** Currency code for `editType: 'number'` (renders a currency input). */\n currency?: string;\n}\n\n/** A labelled, collapsible group of fields. */\nexport interface PatientFieldSection {\n /** Stable section key. */\n id: string;\n /** Section heading. */\n heading: string;\n fields: PatientField[];\n /** Wrap the section in a Collapsible (default `true`). Honoured by PatientDetails. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` (default `true`). */\n defaultOpen?: boolean;\n}\n\n/** The flat declaration-order list of every field id — the \"show everything\" default. */\nexport function patientFieldCatalogue(\n sections: PatientFieldSection[],\n): string[] {\n return sections.flatMap((s) => s.fields.map((f) => f.id));\n}\n\n/** A section paired with its currently-visible fields, in the chosen order. */\nexport interface ResolvedPatientSection {\n section: PatientFieldSection;\n fields: PatientField[];\n}\n\n/**\n * Project `sections` to the visible fields per section, ordered by\n * `visibleFieldOrder`. This is the single piece of visibility logic shared\n * by every patient surface, so the card and the details panel always agree\n * on what is shown and in what order.\n *\n * `visibleFieldOrder` omitted (`undefined`) ⇒ every field visible in\n * declaration order (\"show everything by default\", design doc D3). An explicit\n * empty array `[]` ⇒ NO fields visible — a surface that starts collapsed and\n * reveals fields via the customize-fields cog. Unknown ids are ignored.\n * Sections stay in declaration order; only intra-section field order follows\n * `visibleFieldOrder`.\n */\nexport function resolveVisibleFields(\n sections: PatientFieldSection[],\n visibleFieldOrder?: string[],\n): ResolvedPatientSection[] {\n const order = visibleFieldOrder ?? patientFieldCatalogue(sections);\n const orderIndex = new Map(order.map((id, index) => [id, index]));\n return sections.map((section) => ({\n section,\n fields: section.fields\n .filter((field) => orderIndex.has(field.id))\n .sort(\n (a, b) =>\n (orderIndex.get(a.id) as number) - (orderIndex.get(b.id) as number),\n ),\n }));\n}\n","import { useCallback, useMemo } from 'react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n patientFieldCatalogue,\n type PatientField,\n type PatientFieldSection,\n} from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* usePatientFieldVisibility */\n/* */\n/* The single visibility + ordering engine behind the patient field */\n/* picker, shared by every surface that lets a user curate which patient */\n/* fields show and in what order (PatientDetails, PatientSummaryCard). */\n/* */\n/* CONTEXT-SCOPED, not global: the order is a per-INSTANCE prop the kit */\n/* never persists. Each placement (a care-plan card, the patient-folder */\n/* summary, the Control Room details panel) is wired to its OWN */\n/* `value` / `onChange`, so the SAME field vocabulary can be displayed */\n/* differently in different parts of the app. The consumer owns the */\n/* persistence scope — global per-user, or per-context. */\n/* */\n/* Every mutation filters to known field ids, so persisted / agent input */\n/* can never smuggle an unknown key into the visible set. */\n/* -------------------------------------------------------------------- */\n\nexport interface UsePatientFieldVisibilityOptions {\n /** Controlled ordered list of visible field ids. */\n value?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field, declaration order. */\n defaultValue?: string[];\n /** Fired on any show / hide / reorder, with the next ordered visible set. */\n onChange?: (orderedIds: string[]) => void;\n}\n\nexport interface PatientFieldVisibility {\n /** Current ordered list of visible field ids (filtered to known fields). */\n visible: string[];\n /** Flat declaration-order catalogue of every field id (\"show everything\"). */\n catalogueIds: string[];\n /** field id → its field + owning section id. */\n fieldById: Map<string, { field: PatientField; sectionId: string }>;\n /** Replace the visible set / order (filtered to known fields). */\n setOrder: (orderedIds: string[]) => void;\n /** Show or hide a single field. */\n toggleField: (fieldId: string) => void;\n /** Show or hide every field in a section. */\n toggleSection: (sectionId: string, show: boolean) => void;\n /**\n * Move a field to land at another field's slot, WITHIN its section's\n * visible subsequence. Cross-section moves are ignored — sections stay in\n * declaration order. Drives both pointer drops and keyboard (Alt+Arrow).\n */\n moveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to `defaultValue` (or the full catalogue when none was given). */\n reset: () => void;\n}\n\nexport function usePatientFieldVisibility(\n sections: PatientFieldSection[],\n { value, defaultValue, onChange }: UsePatientFieldVisibilityOptions = {},\n): PatientFieldVisibility {\n const catalogueIds = useMemo(\n () => patientFieldCatalogue(sections),\n [sections],\n );\n\n const [orderState, setOrderState] = useControllableState<string[]>({\n value,\n defaultValue: defaultValue ?? catalogueIds,\n onChange,\n });\n // `useControllableState` may yield `undefined` before the first write.\n const visible = orderState ?? defaultValue ?? catalogueIds;\n\n const fieldById = useMemo(() => {\n const map = new Map<string, { field: PatientField; sectionId: string }>();\n for (const section of sections) {\n for (const field of section.fields) {\n map.set(field.id, { field, sectionId: section.id });\n }\n }\n return map;\n }, [sections]);\n\n const setOrder = useCallback(\n (next: string[]) => {\n // Drop unknown ids so persisted / agent input can't smuggle keys.\n setOrderState(next.filter((fid) => fieldById.has(fid)));\n },\n [setOrderState, fieldById],\n );\n\n const toggleField = useCallback(\n (fieldId: string) => {\n setOrder(\n visible.includes(fieldId)\n ? visible.filter((fid) => fid !== fieldId)\n : [...visible, fieldId],\n );\n },\n [visible, setOrder],\n );\n\n const toggleSection = useCallback(\n (sectionId: string, show: boolean) => {\n const sectionIds =\n sections.find((s) => s.id === sectionId)?.fields.map((f) => f.id) ?? [];\n const sectionSet = new Set(sectionIds);\n if (show) {\n const missing = sectionIds.filter((fid) => !visible.includes(fid));\n setOrder([...visible, ...missing]);\n } else {\n setOrder(visible.filter((fid) => !sectionSet.has(fid)));\n }\n },\n [sections, visible, setOrder],\n );\n\n const moveFieldOnto = useCallback(\n (fromId: string, toId: string) => {\n if (fromId === toId) return;\n const fromSection = fieldById.get(fromId)?.sectionId;\n const toSection = fieldById.get(toId)?.sectionId;\n if (!fromSection || fromSection !== toSection) return;\n const sectionIds = new Set(\n sections.find((s) => s.id === fromSection)?.fields.map((f) => f.id) ??\n [],\n );\n const siblings = visible.filter((fid) => sectionIds.has(fid));\n const fromIdx = siblings.indexOf(fromId);\n const toIdx = siblings.indexOf(toId);\n if (fromIdx < 0 || toIdx < 0) return;\n const [moved] = siblings.splice(fromIdx, 1);\n siblings.splice(toIdx, 0, moved);\n // Splice the reordered siblings back into their positions in `visible`.\n let k = 0;\n const next = visible.map((fid) =>\n sectionIds.has(fid) ? siblings[k++] : fid,\n );\n setOrder(next);\n },\n [fieldById, sections, visible, setOrder],\n );\n\n const reset = useCallback(() => {\n setOrder(defaultValue ?? catalogueIds);\n }, [defaultValue, catalogueIds, setOrder]);\n\n return {\n visible,\n catalogueIds,\n fieldById,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset,\n };\n}\n","import {\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GripVertical, Settings } from 'lucide-react';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Popover } from '../popover/popover';\nimport { Separator } from '../separator/separator';\nimport type { PatientFieldSection } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldVisibilityCog — the patient field picker */\n/* */\n/* The shared \"Customize fields\" cog: a Popover of per-field checkboxes */\n/* (grouped by section, with a section-level toggle-all where the section */\n/* is named), a drag handle per visible field for pointer reordering, and */\n/* the canonical Sidebar keyboard reorder gesture (Alt+Arrow / Alt+Home / */\n/* Alt+End) with an sr-only live announcement. Pure UI — the visibility */\n/* state + reducers live in `usePatientFieldVisibility`, so PatientDetails */\n/* and PatientSummaryCard share ONE picker driving each surface's own */\n/* per-context order. */\n/* */\n/* Native-HTML5 DnD (no library), mirroring data-table's ColumnToggle; */\n/* the grip adds the keyboard channel that pattern lacks. Sections with an */\n/* empty heading render their fields flat with no toggle-all (the card's */\n/* legacy single-section mode) so no empty-named checkbox is emitted. */\n/* -------------------------------------------------------------------- */\n\nexport interface FieldVisibilityCogProps {\n /** The sectioned field catalogue. */\n sections: PatientFieldSection[];\n /** Current ordered visible field ids. */\n visible: string[];\n /** Show / hide a single field. */\n onToggleField: (fieldId: string) => void;\n /** Show / hide every field in a section. */\n onToggleSection: (sectionId: string, show: boolean) => void;\n /** Move a field onto another field's slot within its section. */\n onMoveFieldOnto: (fromId: string, toId: string) => void;\n /** Reset to the default field set / order. */\n onReset: () => void;\n /** Override the cog trigger's accessible name. */\n label?: string;\n}\n\nexport function FieldVisibilityCog({\n sections,\n visible,\n onToggleField,\n onToggleSection,\n onMoveFieldOnto,\n onReset,\n label,\n}: FieldVisibilityCogProps): ReactNode {\n const { t } = useTranslation();\n const visibleSet = useMemo(() => new Set(visible), [visible]);\n\n // Drag-and-drop reorder (pointer). The keyboard channel runs through each\n // grip handle's Alt+Arrow keys; both routes share `onMoveFieldOnto`.\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragOverId, setDragOverId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n // Field id → section id and → label: the cross-section drop guard and the\n // move announcement both need the DRAGGED field's section/label, which isn't\n // in the drop row's render scope.\n const { sectionOfField, labelOfField } = useMemo(() => {\n const sectionMap = new Map<string, string>();\n const labelMap = new Map<string, string>();\n for (const section of sections) {\n for (const field of section.fields) {\n sectionMap.set(field.id, section.id);\n labelMap.set(field.id, field.label);\n }\n }\n return { sectionOfField: sectionMap, labelOfField: labelMap };\n }, [sections]);\n\n const draggingSectionId = draggingId\n ? sectionOfField.get(draggingId)\n : undefined;\n\n const clearDrag = useCallback(() => {\n setDraggingId(null);\n setDragOverId(null);\n }, []);\n\n // Announce the moved field's new 1-based position to assistive tech.\n const announceMoved = useCallback(\n (fieldId: string, newIndex: number, count: number) => {\n setAnnouncement(\n t('fieldPicker.moved', {\n field: labelOfField.get(fieldId) ?? '',\n position: newIndex + 1,\n count,\n defaultValue: 'Moved {{field}} to position {{position}} of {{count}}',\n }),\n );\n },\n [t, labelOfField],\n );\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent=\"outline\"\n icon={<Settings aria-hidden=\"true\" />}\n aria-label={\n label ??\n t('fieldPicker.trigger', { defaultValue: 'Customize fields' })\n }\n className=\"ds:shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Content align=\"end\" size=\"sm\">\n <Popover.Heading>\n {t('fieldPicker.title', { defaultValue: 'Customize fields' })}\n </Popover.Heading>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]\">\n {sections.map((section) => {\n const fieldIds = section.fields.map((f) => f.id);\n const shownCount = fieldIds.filter((fid) =>\n visibleSet.has(fid),\n ).length;\n // Visible siblings in display order — the subsequence reordering\n // operates on. The keyboard arrows' no-op bounds key off the\n // field's index HERE, not the full declaration array.\n const orderedVisible = visible.filter((fid) =>\n fieldIds.includes(fid),\n );\n const sectionState: boolean | 'indeterminate' =\n shownCount === 0\n ? false\n : shownCount === fieldIds.length\n ? true\n : 'indeterminate';\n // A named section gets a toggle-all checkbox + indented field list;\n // an unnamed one (the card's single legacy section) renders flat.\n const named = !!section.heading;\n return (\n <div\n key={section.id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {named ? (\n <Checkbox\n size=\"sm\"\n label={section.heading}\n checked={sectionState}\n onCheckedChange={(checked) =>\n onToggleSection(section.id, checked === true)\n }\n />\n ) : null}\n <ul\n className={[\n 'ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]',\n named ? 'ds:ps-[var(--spacing-md)]' : 'ds:ps-0',\n ].join(' ')}\n >\n {section.fields.map((field) => {\n const shown = visibleSet.has(field.id);\n const visIndex = orderedVisible.indexOf(field.id);\n const count = orderedVisible.length;\n const isDragging = draggingId === field.id;\n const isDragOver =\n dragOverId === field.id &&\n draggingId !== null &&\n draggingId !== field.id &&\n draggingSectionId === section.id;\n\n // Native-HTML5 DnD wiring, applied only to visible rows —\n // a hidden field is neither a drag source nor a drop slot.\n const dragProps: HTMLAttributes<HTMLLIElement> = shown\n ? {\n draggable: true,\n onDragStart: (e) => {\n setDraggingId(field.id);\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', field.id);\n },\n onDragOver: (e) => {\n // Same-section drops only; sections stay fixed.\n if (\n draggingId === null ||\n draggingSectionId !== section.id\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDragOverId(field.id);\n },\n onDragLeave: () =>\n setDragOverId((prev) =>\n prev === field.id ? null : prev,\n ),\n onDrop: (e) => {\n e.preventDefault();\n const fromId = e.dataTransfer.getData('text/plain');\n if (\n fromId &&\n fromId !== field.id &&\n sectionOfField.get(fromId) === section.id\n ) {\n onMoveFieldOnto(fromId, field.id);\n announceMoved(fromId, visIndex, count);\n }\n clearDrag();\n },\n onDragEnd: clearDrag,\n }\n : {};\n\n return (\n <li\n key={field.id}\n {...dragProps}\n className={[\n 'ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)] ds:py-[var(--spacing-2xs)] ds:transition-colors ds:motion-reduce:transition-none',\n isDragging ? 'ds:opacity-50' : '',\n isDragOver\n ? 'ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <Checkbox\n size=\"sm\"\n label={field.label}\n checked={shown}\n onCheckedChange={() => onToggleField(field.id)}\n />\n {shown ? (\n <IconButton\n size=\"sm\"\n intent=\"ghost\"\n icon={<GripVertical aria-hidden=\"true\" />}\n aria-label={t('fieldPicker.reorder', {\n field: field.label,\n defaultValue:\n 'Reorder {{field}}. Press Alt + Up or Alt + Down to move.',\n })}\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End\"\n className=\"ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing\"\n onKeyDown={(e) => {\n // Reorder gestures mirror the canonical Sidebar\n // handle: Alt+Arrow (+ Alt+Home / Alt+End). Bare\n // arrows fall through to the browser default.\n if (!e.altKey) return;\n if (e.key === 'ArrowUp') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex - 1],\n );\n announceMoved(field.id, visIndex - 1, count);\n } else if (e.key === 'ArrowDown') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[visIndex + 1],\n );\n announceMoved(field.id, visIndex + 1, count);\n } else if (e.key === 'Home') {\n if (visIndex <= 0) return;\n e.preventDefault();\n onMoveFieldOnto(field.id, orderedVisible[0]);\n announceMoved(field.id, 0, count);\n } else if (e.key === 'End') {\n if (visIndex >= count - 1) return;\n e.preventDefault();\n onMoveFieldOnto(\n field.id,\n orderedVisible[count - 1],\n );\n announceMoved(field.id, count - 1, count);\n }\n }}\n />\n ) : null}\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n <Separator orientation=\"horizontal\" />\n <Button type=\"button\" size=\"sm\" intent=\"ghost\" onClick={onReset}>\n {t('fieldPicker.reset', { defaultValue: 'Reset to defaults' })}\n </Button>\n </div>\n {/* Reorder announcements for assistive tech (drag drop + arrow keys). */}\n <span role=\"status\" className=\"ds:sr-only\">\n {announcement}\n </span>\n </Popover.Content>\n </Popover.Root>\n );\n}\n","import { cloneElement, type ReactElement, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Hash, Hourglass, Mars, User, Venus } from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Link } from '../link/link';\nimport { TransactionChip } from '../transaction-chip/transaction-chip';\nimport type { PatientField } from './patient-fields';\n\n/* -------------------------------------------------------------------- */\n/* FieldValue — the canonical field-chip registry */\n/* */\n/* Renders ONE patient field's value slot. When the consumer supplies an */\n/* explicit `value` (legacy rows, per-placement overrides) it wins */\n/* verbatim. Otherwise `kind` selects the canonical chip and the raw */\n/* datum is read from `editValue`, so a known field type looks the same */\n/* on every surface (PatientSummaryCard + PatientDetails share this). */\n/* */\n/* The per-type chips (`SexChip` / `AgeChip` / `NeutralChip`) are exported */\n/* so the PatientSummaryCard identity line renders the SAME chips under */\n/* the name. */\n/* */\n/* Pure composition over already-marked kit primitives (Badge / */\n/* TransactionChip) — it mounts no surface of its own, so it carries no */\n/* `data-component` (allowlisted in check-data-component-coverage.mjs). */\n/* -------------------------------------------------------------------- */\n\n// The neutral Badge's own text colour (`--muted-foreground`) is too low\n// contrast for primary demographic data — grey text on the grey pill reads at\n// ~5.8:1. The chip label + glyph are pinned to `--foreground` (~11:1) so the\n// data stays legible on every theme.\nconst STRONG = 'ds:text-[color:var(--foreground)]';\n\n/** Default English labels — real translations live under `patientField.*`. */\nconst SEX_LABEL_DEFAULT: Record<string, string> = {\n m: 'Male',\n f: 'Female',\n x: 'Other',\n};\n\n/** A neutral pill with high-contrast text + an optional leading glyph. */\nexport function NeutralChip({\n icon,\n mono,\n children,\n}: {\n icon?: ReactElement;\n mono?: boolean;\n children: ReactNode;\n}): ReactNode {\n return (\n <Badge\n variant=\"neutral\"\n className={mono ? 'ds:font-mono' : undefined}\n // Clone the glyph (don't wrap it) so it stays Badge's DIRECT <svg> child —\n // Badge's `[&>svg]:size-*` rule only sizes a direct child, so wrapping it\n // left the glyph at lucide's default 24px. The clone also carries `STRONG`.\n leading={\n icon\n ? cloneElement(icon as ReactElement<{ className?: string }>, {\n className: STRONG,\n })\n : undefined\n }\n >\n <span className={STRONG}>{children}</span>\n </Badge>\n );\n}\n\n/** Sex chip — Venus / Mars / User glyph + localised label. Female / male carry a\n * tonal pink / blue FILL; unspecified stays the neutral pill. */\nexport function SexChip({ code }: { code: string }): ReactNode {\n const { t } = useTranslation();\n const c = code.toLowerCase();\n const label = t(`patientField.sex.${c}`, {\n defaultValue: SEX_LABEL_DEFAULT[c] ?? code,\n });\n // The fill carries the colour; Badge sizes + tones the glyph from the variant.\n // `accentSoft` is the kit's tonal magenta (≈ pink); `info` the tonal indigo\n // (≈ blue, the closest the closed palette has to blue). Other → neutral.\n if (c === 'f') {\n return (\n <Badge variant=\"accentSoft\" leading={<Venus />}>\n {label}\n </Badge>\n );\n }\n if (c === 'm') {\n return (\n <Badge variant=\"info\" leading={<Mars />}>\n {label}\n </Badge>\n );\n }\n return <NeutralChip icon={<User />}>{label}</NeutralChip>;\n}\n\n/** Age chip — hourglass glyph + localised, pluralised age. */\nexport function AgeChip({ years }: { years: number }): ReactNode {\n const { t } = useTranslation();\n return (\n <NeutralChip icon={<Hourglass />}>\n {t('patientField.age', {\n count: years,\n defaultValue: '{{count}} years old',\n })}\n </NeutralChip>\n );\n}\n\nexport function FieldValue({ field }: { field: PatientField }): ReactNode {\n const { i18n } = useTranslation();\n\n // Contact kinds render as a mailto:/tel: Link — the display string is read\n // from `value` (or `editValue`), the href is derived from it. Checked BEFORE\n // the explicit-value short-circuit so a plain-string `value` still links.\n if (field.kind === 'email' || field.kind === 'phone') {\n const display =\n typeof field.value === 'string'\n ? field.value\n : (field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : ''));\n if (display) {\n // mailto: trims surrounding whitespace; tel: keeps only `+` and digits\n // (dialler-safe), leaving the formatted text as the visible label.\n const href =\n field.kind === 'email'\n ? `mailto:${display.trim()}`\n : `tel:${display.replace(/[^+\\d]/g, '')}`;\n return <Link href={href}>{display}</Link>;\n }\n // No string to link — fall through to any explicit node value below.\n }\n\n // An explicit value always wins — legacy rows + per-placement overrides.\n if (field.value != null) {\n return <>{field.value}</>;\n }\n if (!field.kind) {\n return null;\n }\n\n switch (field.kind) {\n case 'sex':\n return <SexChip code={String(field.editValue ?? '')} />;\n case 'age': {\n const years =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(years)) {\n return null;\n }\n return <AgeChip years={years} />;\n }\n case 'dob': {\n const raw = field.editValue;\n const date = raw instanceof Date ? raw : new Date(String(raw ?? ''));\n const formatted = Number.isNaN(date.getTime())\n ? String(raw ?? '')\n : new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(date);\n if (!formatted) {\n return null;\n }\n return <NeutralChip icon={<CalendarDays />}>{formatted}</NeutralChip>;\n }\n case 'fiscalCode': {\n // Copy + PHI lock stay the consumer's row-level affordance (PatientDetails\n // renders them from `copyable` / `sensitive`); the chip is the mono pill.\n const code =\n field.copyText ??\n (typeof field.editValue === 'string' ? field.editValue : '');\n if (!code) {\n return null;\n }\n return (\n <NeutralChip icon={<Hash />} mono>\n {code}\n </NeutralChip>\n );\n }\n case 'discount': {\n // The canonical monetary discount chip — magnitude + currency, the sign\n // (\"−\") and glyph owned by TransactionChip. The row label gives context,\n // so the chip itself shows only the amount (no duplicate state label).\n const amount =\n typeof field.editValue === 'number'\n ? field.editValue\n : Number(field.editValue);\n if (!Number.isFinite(amount)) {\n return null;\n }\n return (\n <TransactionChip\n state=\"discount\"\n amount={Math.abs(amount)}\n currency={field.currency}\n size=\"sm\"\n />\n );\n }\n default:\n return null;\n }\n}\n"],"names":["__iconNode","Hourglass","createLucideIcon","Mars","Venus","patientFieldCatalogue","sections","s","f","resolveVisibleFields","visibleFieldOrder","order","orderIndex","id","index","section","field","a","b","usePatientFieldVisibility","value","defaultValue","onChange","catalogueIds","useMemo","orderState","setOrderState","useControllableState","visible","fieldById","map","setOrder","useCallback","next","fid","toggleField","fieldId","toggleSection","sectionId","show","sectionIds","_a","sectionSet","missing","moveFieldOnto","fromId","toId","fromSection","toSection","_b","_c","siblings","fromIdx","toIdx","moved","k","reset","FieldVisibilityCog","onToggleField","onToggleSection","onMoveFieldOnto","onReset","label","t","useTranslation","visibleSet","draggingId","setDraggingId","useState","dragOverId","setDragOverId","announcement","setAnnouncement","sectionOfField","labelOfField","sectionMap","labelMap","draggingSectionId","clearDrag","announceMoved","newIndex","count","jsxs","Popover","jsx","IconButton","Settings","fieldIds","shownCount","orderedVisible","sectionState","named","Checkbox","checked","shown","visIndex","isDragging","isDragOver","e","prev","GripVertical","Separator","Button","STRONG","SEX_LABEL_DEFAULT","NeutralChip","icon","mono","children","Badge","cloneElement","SexChip","code","c","User","AgeChip","years","FieldValue","i18n","display","href","Link","Fragment","raw","date","formatted","CalendarDays","Hash","amount","TransactionChip"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAQ;AAAA,EAChG;AACA,GACMC,KAAYC,EAAiB,aAAaF,EAAU;ACxB1D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,mBAAmB,KAAK,SAAQ,CAAE;AAAA,EAChD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMG,KAAO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AY;AAIf,YAAMgB,IACJ,OAAOhH,EAAM,aAAc,WACvBA,EAAM,YACN,OAAOA,EAAM,SAAS;AAC5B,aAAK,OAAO,SAASgH,CAAM,IAIzB,gBAAA5C;AAAA,QAAC6C;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,QAAQ,KAAK,IAAID,CAAM;AAAA,UACvB,UAAUhH,EAAM;AAAA,UAChB,MAAK;AAAA,QAAA;AAAA,MAAA,IAPA;AAAA,IAUX;AAAA,IACA;AACE,aAAO;AAAA,EAAA;AAEb;","x_google_ignoreList":[0,1,2]}
@@ -17,7 +17,7 @@ import { F as Ft } from "./file-text-5yv6r2ls.js";
17
17
  import { F as At } from "./file-spreadsheet-DmwyfV4O.js";
18
18
  import { C as Dt } from "./chevron-right-I9AeSxH2.js";
19
19
  import { A as Rt, d as It, D as Te } from "./actions-cell-renderer-BD-jruqA.js";
20
- import { B as $e } from "./badge-CIt-UFEx.js";
20
+ import { B as $e } from "./badge-sTusUqZD.js";
21
21
  import { D as Ge } from "./download-CfYKJO_j.js";
22
22
  import { P as zt } from "./pen-line-D0De5zdl.js";
23
23
  import { S as Ue } from "./share-2-B49jcW2I.js";
@@ -1756,4 +1756,4 @@ export {
1756
1756
  yn as F,
1757
1757
  Gt as f
1758
1758
  };
1759
- //# sourceMappingURL=file-manager-BjCM2fZB.js.map
1759
+ //# sourceMappingURL=file-manager-CML_C6_h.js.map