@alfadocs/ui-kit-debug 1.96.0 → 1.97.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 (303) hide show
  1. package/dist/_chunks/{address-autocomplete-DR4Xn23Z.js → address-autocomplete-DC-H-MZw.js} +2 -2
  2. package/dist/_chunks/{address-autocomplete-DR4Xn23Z.js.map → address-autocomplete-DC-H-MZw.js.map} +1 -1
  3. package/dist/_chunks/{address-fields-qxQkGwPf.js → address-fields-D5Ije0S2.js} +7 -7
  4. package/dist/_chunks/{address-fields-qxQkGwPf.js.map → address-fields-D5Ije0S2.js.map} +1 -1
  5. package/dist/_chunks/{agenda-card-BhY342MA.js → agenda-card-bRQ4j6U6.js} +2 -2
  6. package/dist/_chunks/{agenda-card-BhY342MA.js.map → agenda-card-bRQ4j6U6.js.map} +1 -1
  7. package/dist/_chunks/{agenda-tray-BmxBGEci.js → agenda-tray-CzE3E8GU.js} +2 -2
  8. package/dist/_chunks/{agenda-tray-BmxBGEci.js.map → agenda-tray-CzE3E8GU.js.map} +1 -1
  9. package/dist/_chunks/{alia-sidebar-ovRX_oti.js → alia-sidebar-B5mu44g2.js} +3 -3
  10. package/dist/_chunks/{alia-sidebar-ovRX_oti.js.map → alia-sidebar-B5mu44g2.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-summary-rows-CdRUXoaA.js → anamnesis-summary-rows-B9HqOGd7.js} +4 -4
  12. package/dist/_chunks/{anamnesis-summary-rows-CdRUXoaA.js.map → anamnesis-summary-rows-B9HqOGd7.js.map} +1 -1
  13. package/dist/_chunks/{appointment-card-Csx4544A.js → appointment-card-zPr0brha.js} +3 -3
  14. package/dist/_chunks/{appointment-card-Csx4544A.js.map → appointment-card-zPr0brha.js.map} +1 -1
  15. package/dist/_chunks/{appointment-peek-CcDCWb-F.js → appointment-peek-xFTBany4.js} +3 -3
  16. package/dist/_chunks/{appointment-peek-CcDCWb-F.js.map → appointment-peek-xFTBany4.js.map} +1 -1
  17. package/dist/_chunks/{appointment-timeline-DW6FN6u8.js → appointment-timeline-AKkVx9AN.js} +2 -2
  18. package/dist/_chunks/{appointment-timeline-DW6FN6u8.js.map → appointment-timeline-AKkVx9AN.js.map} +1 -1
  19. package/dist/_chunks/{appointment-tray-CZfXwHWz.js → appointment-tray-B8qQBW65.js} +2 -2
  20. package/dist/_chunks/{appointment-tray-CZfXwHWz.js.map → appointment-tray-B8qQBW65.js.map} +1 -1
  21. package/dist/_chunks/{aspect-ratio-DeSNzASA.js → aspect-ratio-B-6cyOpm.js} +13 -13
  22. package/dist/_chunks/aspect-ratio-B-6cyOpm.js.map +1 -0
  23. package/dist/_chunks/{autocomplete-BXMcNoa3.js → autocomplete-D10ydpgi.js} +2 -2
  24. package/dist/_chunks/{autocomplete-BXMcNoa3.js.map → autocomplete-D10ydpgi.js.map} +1 -1
  25. package/dist/_chunks/{avatar-a6042Ox2.js → avatar-BoqdWsNe.js} +2 -2
  26. package/dist/_chunks/avatar-BoqdWsNe.js.map +1 -0
  27. package/dist/_chunks/{balance-badge-cell-DcBmtijD.js → balance-badge-cell-DaZokVZY.js} +3 -3
  28. package/dist/_chunks/{balance-badge-cell-DcBmtijD.js.map → balance-badge-cell-DaZokVZY.js.map} +1 -1
  29. package/dist/_chunks/{breadcrumb-Bn29NCnf.js → breadcrumb-zxa_PNhF.js} +2 -2
  30. package/dist/_chunks/breadcrumb-zxa_PNhF.js.map +1 -0
  31. package/dist/_chunks/{calendar-CmiMS4FJ.js → calendar-DVe5eArk.js} +2 -2
  32. package/dist/_chunks/{calendar-CmiMS4FJ.js.map → calendar-DVe5eArk.js.map} +1 -1
  33. package/dist/_chunks/{calendar-appointment-editor-dialog-BOZ5wk96.js → calendar-appointment-editor-dialog-26LEMx0q.js} +12 -12
  34. package/dist/_chunks/{calendar-appointment-editor-dialog-BOZ5wk96.js.map → calendar-appointment-editor-dialog-26LEMx0q.js.map} +1 -1
  35. package/dist/_chunks/{chat-message-LRO_6Ee3.js → chat-message-CkBCAcwn.js} +2 -2
  36. package/dist/_chunks/{chat-message-LRO_6Ee3.js.map → chat-message-CkBCAcwn.js.map} +1 -1
  37. package/dist/_chunks/{city-input-CA59CjnV.js → city-input-DXipzTfZ.js} +3 -3
  38. package/dist/_chunks/{city-input-CA59CjnV.js.map → city-input-DXipzTfZ.js.map} +1 -1
  39. package/dist/_chunks/{clinical-note-card-CWHFnCmY.js → clinical-note-card--juv_ELr.js} +2 -2
  40. package/dist/_chunks/{clinical-note-card-CWHFnCmY.js.map → clinical-note-card--juv_ELr.js.map} +1 -1
  41. package/dist/_chunks/{combobox-D-gpgEDy.js → combobox-duuDRI1t.js} +2 -2
  42. package/dist/_chunks/{combobox-D-gpgEDy.js.map → combobox-duuDRI1t.js.map} +1 -1
  43. package/dist/_chunks/{command-palette-B3dVqm9D.js → command-palette-DxQBU4wH.js} +3 -3
  44. package/dist/_chunks/command-palette-DxQBU4wH.js.map +1 -0
  45. package/dist/_chunks/{contact-profile-card-jBf9U4At.js → contact-profile-card-QPUgGu-t.js} +57 -57
  46. package/dist/_chunks/contact-profile-card-QPUgGu-t.js.map +1 -0
  47. package/dist/_chunks/{copy-field-hgVSc51W.js → copy-field-BaYEDJ9f.js} +24 -24
  48. package/dist/_chunks/copy-field-BaYEDJ9f.js.map +1 -0
  49. package/dist/_chunks/{country-select-BfmX9y5i.js → country-select-CUuGOAoZ.js} +2 -2
  50. package/dist/_chunks/{country-select-BfmX9y5i.js.map → country-select-CUuGOAoZ.js.map} +1 -1
  51. package/dist/_chunks/{data-table-xUDjZS_O.js → data-table-C4UT4L9B.js} +3 -3
  52. package/dist/_chunks/{data-table-xUDjZS_O.js.map → data-table-C4UT4L9B.js.map} +1 -1
  53. package/dist/_chunks/{data-table-tabs-CcgU2lr5.js → data-table-tabs-Db7zToFD.js} +2 -2
  54. package/dist/_chunks/{data-table-tabs-CcgU2lr5.js.map → data-table-tabs-Db7zToFD.js.map} +1 -1
  55. package/dist/_chunks/{dependent-selector-CyNi7M_f.js → dependent-selector-DRN0P0Kr.js} +2 -2
  56. package/dist/_chunks/{dependent-selector-CyNi7M_f.js.map → dependent-selector-DRN0P0Kr.js.map} +1 -1
  57. package/dist/_chunks/{document-preview-DWIQryMW.js → document-preview-U8H6tnDJ.js} +2 -2
  58. package/dist/_chunks/{document-preview-DWIQryMW.js.map → document-preview-U8H6tnDJ.js.map} +1 -1
  59. package/dist/_chunks/{document-scanner-BQP0Rqrt.js → document-scanner-Bf3VUp00.js} +24 -24
  60. package/dist/_chunks/document-scanner-Bf3VUp00.js.map +1 -0
  61. package/dist/_chunks/{editable-currency-cell-renderer-BEaj2NT_.js → editable-currency-cell-renderer-BUdFMh67.js} +2 -2
  62. package/dist/_chunks/{editable-currency-cell-renderer-BEaj2NT_.js.map → editable-currency-cell-renderer-BUdFMh67.js.map} +1 -1
  63. package/dist/_chunks/{email-input-C7THAwh2.js → email-input-BEO3vonE.js} +2 -2
  64. package/dist/_chunks/{email-input-C7THAwh2.js.map → email-input-BEO3vonE.js.map} +1 -1
  65. package/dist/_chunks/{entity-summary-BJdfIsk_.js → entity-summary-B4p8zP1J.js} +2 -2
  66. package/dist/_chunks/{entity-summary-BJdfIsk_.js.map → entity-summary-B4p8zP1J.js.map} +1 -1
  67. package/dist/_chunks/{face-scheme-BmygzbZr.js → face-scheme-DdVLQ5dP.js} +3 -3
  68. package/dist/_chunks/{face-scheme-BmygzbZr.js.map → face-scheme-DdVLQ5dP.js.map} +1 -1
  69. package/dist/_chunks/{file-manager-Ba_TcfCj.js → file-manager-B4K2j7jB.js} +4 -4
  70. package/dist/_chunks/{file-manager-Ba_TcfCj.js.map → file-manager-B4K2j7jB.js.map} +1 -1
  71. package/dist/_chunks/{fiscal-code-input-BzWmNDnl.js → fiscal-code-input-BBvU7sAo.js} +2 -2
  72. package/dist/_chunks/{fiscal-code-input-BzWmNDnl.js.map → fiscal-code-input-BBvU7sAo.js.map} +1 -1
  73. package/dist/_chunks/{forgot-password-form-BCk4rGIh.js → forgot-password-form-CeTb5p-x.js} +2 -2
  74. package/dist/_chunks/{forgot-password-form-BCk4rGIh.js.map → forgot-password-form-CeTb5p-x.js.map} +1 -1
  75. package/dist/_chunks/{header-settings-C2D74i4g.js → header-settings-Df9q1uHt.js} +2 -2
  76. package/dist/_chunks/{header-settings-C2D74i4g.js.map → header-settings-Df9q1uHt.js.map} +1 -1
  77. package/dist/_chunks/{heatmap-C9tEvqEm.js → heatmap-B2Z1_kDn.js} +2 -2
  78. package/dist/_chunks/{heatmap-C9tEvqEm.js.map → heatmap-B2Z1_kDn.js.map} +1 -1
  79. package/dist/_chunks/{help-me-write-templates-BJSf24xS.js → help-me-write-templates-ra5a__Yy.js} +2 -2
  80. package/dist/_chunks/{help-me-write-templates-BJSf24xS.js.map → help-me-write-templates-ra5a__Yy.js.map} +1 -1
  81. package/dist/_chunks/{iban-input-B9L2QDHh.js → iban-input-DuTwKok5.js} +2 -2
  82. package/dist/_chunks/{iban-input-B9L2QDHh.js.map → iban-input-DuTwKok5.js.map} +1 -1
  83. package/dist/_chunks/{icon-picker-DQMG9L6M.js → icon-picker-BmU6gpZT.js} +2 -2
  84. package/dist/_chunks/{icon-picker-DQMG9L6M.js.map → icon-picker-BmU6gpZT.js.map} +1 -1
  85. package/dist/_chunks/{input-surface-iBmxVBfr.js → input-surface-BMffm2Vd.js} +4 -4
  86. package/dist/_chunks/{input-surface-iBmxVBfr.js.map → input-surface-BMffm2Vd.js.map} +1 -1
  87. package/dist/_chunks/{link-cell-renderer-OmvrkUeN.js → link-cell-renderer-DKMgD-2v.js} +4 -4
  88. package/dist/_chunks/{link-cell-renderer-OmvrkUeN.js.map → link-cell-renderer-DKMgD-2v.js.map} +1 -1
  89. package/dist/_chunks/{locale-picker-B1NAHW4U.js → locale-picker-C86h8Yt1.js} +2 -2
  90. package/dist/_chunks/{locale-picker-B1NAHW4U.js.map → locale-picker-C86h8Yt1.js.map} +1 -1
  91. package/dist/_chunks/{login-dev-card-DcfcFJrm.js → login-dev-card-D5BV5j1i.js} +4 -4
  92. package/dist/_chunks/{login-dev-card-DcfcFJrm.js.map → login-dev-card-D5BV5j1i.js.map} +1 -1
  93. package/dist/_chunks/{map-view--c9bJDRw.js → map-view-V7etHnyF.js} +2 -2
  94. package/dist/_chunks/map-view-V7etHnyF.js.map +1 -0
  95. package/dist/_chunks/{marketplace-app-shell-DDZI-uBl.js → marketplace-app-shell-D2qgIuXX.js} +4 -4
  96. package/dist/_chunks/{marketplace-app-shell-DDZI-uBl.js.map → marketplace-app-shell-D2qgIuXX.js.map} +1 -1
  97. package/dist/_chunks/{message-card-B6SduXJv.js → message-card-BzJEITml.js} +2 -2
  98. package/dist/_chunks/{message-card-B6SduXJv.js.map → message-card-BzJEITml.js.map} +1 -1
  99. package/dist/_chunks/{message-tray-18_TrLCy.js → message-tray-DiPgJbOb.js} +2 -2
  100. package/dist/_chunks/{message-tray-18_TrLCy.js.map → message-tray-DiPgJbOb.js.map} +1 -1
  101. package/dist/_chunks/{multi-select-i5MFRpXg.js → multi-select-Df3R8lv_.js} +30 -30
  102. package/dist/_chunks/multi-select-Df3R8lv_.js.map +1 -0
  103. package/dist/_chunks/{navigation-menu-DbaSlvdO.js → navigation-menu-1MrpIVkY.js} +3 -3
  104. package/dist/_chunks/navigation-menu-1MrpIVkY.js.map +1 -0
  105. package/dist/_chunks/{notes-panel-DfjF83IK.js → notes-panel-BbNLYcdv.js} +3 -3
  106. package/dist/_chunks/{notes-panel-DfjF83IK.js.map → notes-panel-BbNLYcdv.js.map} +1 -1
  107. package/dist/_chunks/{operator-hero-N_ziNGFF.js → operator-hero-BcuPTzS_.js} +2 -2
  108. package/dist/_chunks/{operator-hero-N_ziNGFF.js.map → operator-hero-BcuPTzS_.js.map} +1 -1
  109. package/dist/_chunks/{pagination-DvKGrsXu.js → pagination-C7N_NiRN.js} +2 -2
  110. package/dist/_chunks/{pagination-DvKGrsXu.js.map → pagination-C7N_NiRN.js.map} +1 -1
  111. package/dist/_chunks/{password-input-BokZ_rnT.js → password-input-SJGHFdOO.js} +2 -2
  112. package/dist/_chunks/{password-input-BokZ_rnT.js.map → password-input-SJGHFdOO.js.map} +1 -1
  113. package/dist/_chunks/{patient-details-DGHkAErB.js → patient-details-DoIOWP6j.js} +3 -3
  114. package/dist/_chunks/{patient-details-DGHkAErB.js.map → patient-details-DoIOWP6j.js.map} +1 -1
  115. package/dist/_chunks/{patient-field-row-BVK4y98C.js → patient-field-row--dCDO5oB.js} +9 -9
  116. package/dist/_chunks/{patient-field-row-BVK4y98C.js.map → patient-field-row--dCDO5oB.js.map} +1 -1
  117. package/dist/_chunks/{patient-search-CL6dtBIq.js → patient-search-DJy0IZSx.js} +2 -2
  118. package/dist/_chunks/{patient-search-CL6dtBIq.js.map → patient-search-DJy0IZSx.js.map} +1 -1
  119. package/dist/_chunks/{patient-summary-card-DXz07c2X.js → patient-summary-card-CL04aq8h.js} +3 -3
  120. package/dist/_chunks/{patient-summary-card-DXz07c2X.js.map → patient-summary-card-CL04aq8h.js.map} +1 -1
  121. package/dist/_chunks/{payment-automation-upsell-CZk6f8aK.js → payment-automation-upsell-BPF0c-5D.js} +2 -2
  122. package/dist/_chunks/{payment-automation-upsell-CZk6f8aK.js.map → payment-automation-upsell-BPF0c-5D.js.map} +1 -1
  123. package/dist/_chunks/{pdf-viewer-gAsNUsA8.js → pdf-viewer-DlceXkfW.js} +267 -286
  124. package/dist/_chunks/pdf-viewer-DlceXkfW.js.map +1 -0
  125. package/dist/_chunks/{phone-input-DJ4BN8tG.js → phone-input-BL8Sj6OG.js} +3 -3
  126. package/dist/_chunks/phone-input-BL8Sj6OG.js.map +1 -0
  127. package/dist/_chunks/{postal-code-input-CfZOnIkW.js → postal-code-input-dJdSAVkP.js} +2 -2
  128. package/dist/_chunks/{postal-code-input-CfZOnIkW.js.map → postal-code-input-dJdSAVkP.js.map} +1 -1
  129. package/dist/_chunks/{practice-profile-hero-DKmnB-M0.js → practice-profile-hero-B8vykoci.js} +2 -2
  130. package/dist/_chunks/{practice-profile-hero-DKmnB-M0.js.map → practice-profile-hero-B8vykoci.js.map} +1 -1
  131. package/dist/_chunks/{practice-results-ZOVlrb43.js → practice-results-U-5kpnJa.js} +3 -3
  132. package/dist/_chunks/{practice-results-ZOVlrb43.js.map → practice-results-U-5kpnJa.js.map} +1 -1
  133. package/dist/_chunks/{province-select-D64whw0m.js → province-select-cVOlwEc5.js} +2 -2
  134. package/dist/_chunks/{province-select-D64whw0m.js.map → province-select-cVOlwEc5.js.map} +1 -1
  135. package/dist/_chunks/{public-footer-BiPiU_lk.js → public-footer-t6gx6sjn.js} +163 -152
  136. package/dist/_chunks/public-footer-t6gx6sjn.js.map +1 -0
  137. package/dist/_chunks/{registration-form-K4j2tdLt.js → registration-form-JzzTomhd.js} +5 -5
  138. package/dist/_chunks/{registration-form-K4j2tdLt.js.map → registration-form-JzzTomhd.js.map} +1 -1
  139. package/dist/_chunks/{reserved.agent-TRbKB39d.js → reserved.agent-CB-92Vi9.js} +8 -8
  140. package/dist/_chunks/{reserved.agent-TRbKB39d.js.map → reserved.agent-CB-92Vi9.js.map} +1 -1
  141. package/dist/_chunks/{reset-password-form-C6XLV7SI.js → reset-password-form-DDdGEoIL.js} +3 -3
  142. package/dist/_chunks/{reset-password-form-C6XLV7SI.js.map → reset-password-form-DDdGEoIL.js.map} +1 -1
  143. package/dist/_chunks/{rich-text-editor-CJfT08It.js → rich-text-editor-F04przIt.js} +2 -2
  144. package/dist/_chunks/{rich-text-editor-CJfT08It.js.map → rich-text-editor-F04przIt.js.map} +1 -1
  145. package/dist/_chunks/{search-bar-mA4bPe3t.js → search-bar-CQ9_V3EJ.js} +2 -2
  146. package/dist/_chunks/{search-bar-mA4bPe3t.js.map → search-bar-CQ9_V3EJ.js.map} +1 -1
  147. package/dist/_chunks/{search-input-BAlDd05M.js → search-input-CRAMo1CA.js} +2 -2
  148. package/dist/_chunks/{search-input-BAlDd05M.js.map → search-input-CRAMo1CA.js.map} +1 -1
  149. package/dist/_chunks/{send-registration-link-form-yLSfcaPk.js → send-registration-link-form-DHCQpA4C.js} +3 -3
  150. package/dist/_chunks/{send-registration-link-form-yLSfcaPk.js.map → send-registration-link-form-DHCQpA4C.js.map} +1 -1
  151. package/dist/_chunks/{sidebar-BS24EnYd.js → sidebar-2VsPlNkZ.js} +3 -3
  152. package/dist/_chunks/sidebar-2VsPlNkZ.js.map +1 -0
  153. package/dist/_chunks/{sign-document-BiOTs1P4.js → sign-document-B5qZhthO.js} +10 -10
  154. package/dist/_chunks/sign-document-B5qZhthO.js.map +1 -0
  155. package/dist/_chunks/{signature-capture-Chqh62Pc.js → signature-capture-BJc7kfqi.js} +2 -2
  156. package/dist/_chunks/signature-capture-BJc7kfqi.js.map +1 -0
  157. package/dist/_chunks/{signature-field-Y01UB5DA.js → signature-field-DjabvRZm.js} +28 -34
  158. package/dist/_chunks/{signature-field-Y01UB5DA.js.map → signature-field-DjabvRZm.js.map} +1 -1
  159. package/dist/_chunks/{signature-request-CLtMgQKi.js → signature-request-CQ0torGq.js} +2 -2
  160. package/dist/_chunks/{signature-request-CLtMgQKi.js.map → signature-request-CQ0torGq.js.map} +1 -1
  161. package/dist/_chunks/{signed-out-frame-CRwVTCjY.js → signed-out-frame-BcQE00H1.js} +2 -2
  162. package/dist/_chunks/{signed-out-frame-CRwVTCjY.js.map → signed-out-frame-BcQE00H1.js.map} +1 -1
  163. package/dist/_chunks/{stat-Dno2ZihS.js → stat-BFKZV50y.js} +137 -117
  164. package/dist/_chunks/stat-BFKZV50y.js.map +1 -0
  165. package/dist/_chunks/{state-backed-text-input-Cgh4ms3p.js → state-backed-text-input-DVETOhSS.js} +2 -2
  166. package/dist/_chunks/{state-backed-text-input-Cgh4ms3p.js.map → state-backed-text-input-DVETOhSS.js.map} +1 -1
  167. package/dist/_chunks/{stepper-accordion-DDTSOUHc.js → stepper-accordion-CYjrmRte.js} +44 -44
  168. package/dist/_chunks/stepper-accordion-CYjrmRte.js.map +1 -0
  169. package/dist/_chunks/{task-editor-qXfMbHsy.js → task-editor-BiPGFXtB.js} +3 -3
  170. package/dist/_chunks/{task-editor-qXfMbHsy.js.map → task-editor-BiPGFXtB.js.map} +1 -1
  171. package/dist/_chunks/{text-input-CaG9ApoE.js → text-input-B6iAgCr3.js} +2 -2
  172. package/dist/_chunks/{text-input-CaG9ApoE.js.map → text-input-B6iAgCr3.js.map} +1 -1
  173. package/dist/_chunks/{timeline-B32dylRJ.js → timeline-tn5QQJdS.js} +2 -2
  174. package/dist/_chunks/{timeline-B32dylRJ.js.map → timeline-tn5QQJdS.js.map} +1 -1
  175. package/dist/_chunks/{transcript-panel-CoHHpcFg.js → transcript-panel-A781Pkzr.js} +2 -2
  176. package/dist/_chunks/{transcript-panel-CoHHpcFg.js.map → transcript-panel-A781Pkzr.js.map} +1 -1
  177. package/dist/_chunks/{use-appointment-details-read-UXXvBeGZ.js → use-appointment-details-read-BbIoPWO6.js} +5 -5
  178. package/dist/_chunks/{use-appointment-details-read-UXXvBeGZ.js.map → use-appointment-details-read-BbIoPWO6.js.map} +1 -1
  179. package/dist/_chunks/{widget-picker-B9HpT2Tb.js → widget-picker-DNYIqRT1.js} +2 -2
  180. package/dist/_chunks/{widget-picker-B9HpT2Tb.js.map → widget-picker-DNYIqRT1.js.map} +1 -1
  181. package/dist/_chunks/{workflow-map-flsvqQ3L.js → workflow-map-k-dQkpe7.js} +20 -20
  182. package/dist/_chunks/{workflow-map-flsvqQ3L.js.map → workflow-map-k-dQkpe7.js.map} +1 -1
  183. package/dist/_chunks/{workflow-status-HQ6ziE46.js → workflow-status-9wb7iWUd.js} +2 -2
  184. package/dist/_chunks/{workflow-status-HQ6ziE46.js.map → workflow-status-9wb7iWUd.js.map} +1 -1
  185. package/dist/_chunks/{workflow-webhook-action-BD-6UyOs.js → workflow-webhook-action-B_52rH7O.js} +3 -3
  186. package/dist/_chunks/{workflow-webhook-action-BD-6UyOs.js.map → workflow-webhook-action-B_52rH7O.js.map} +1 -1
  187. package/dist/agent-catalog.json +1 -1
  188. package/dist/components/_shared/input-surface.d.ts +3 -3
  189. package/dist/components/address-autocomplete/index.js +1 -1
  190. package/dist/components/address-fields/index.js +1 -1
  191. package/dist/components/agenda-card/index.js +1 -1
  192. package/dist/components/agenda-tray/index.js +1 -1
  193. package/dist/components/appointment-card/index.js +2 -2
  194. package/dist/components/appointment-details-panel/index.js +1 -1
  195. package/dist/components/appointment-peek/index.js +1 -1
  196. package/dist/components/appointment-timeline/index.js +1 -1
  197. package/dist/components/aspect-ratio/index.js +1 -1
  198. package/dist/components/autocomplete/index.js +1 -1
  199. package/dist/components/avatar/index.js +1 -1
  200. package/dist/components/booking/index.js +1 -1
  201. package/dist/components/breadcrumb/index.js +1 -1
  202. package/dist/components/calendar/index.js +1 -1
  203. package/dist/components/chat-message/index.js +1 -1
  204. package/dist/components/city-input/index.js +1 -1
  205. package/dist/components/clinical-note-card/index.js +1 -1
  206. package/dist/components/combobox/index.js +1 -1
  207. package/dist/components/command-palette/index.js +1 -1
  208. package/dist/components/contact-profile-card/index.js +1 -1
  209. package/dist/components/copy-field/index.js +1 -1
  210. package/dist/components/country-select/index.js +1 -1
  211. package/dist/components/data-table/index.js +3 -3
  212. package/dist/components/data-table-tabs/index.js +1 -1
  213. package/dist/components/dependent-selector/index.js +1 -1
  214. package/dist/components/document-preview/index.js +1 -1
  215. package/dist/components/document-scanner/index.js +1 -1
  216. package/dist/components/email-input/index.js +1 -1
  217. package/dist/components/entity-summary/index.js +1 -1
  218. package/dist/components/face-scheme/index.js +1 -1
  219. package/dist/components/file-manager/index.js +1 -1
  220. package/dist/components/fiscal-code-input/index.js +1 -1
  221. package/dist/components/header-settings/index.js +1 -1
  222. package/dist/components/heatmap/index.js +1 -1
  223. package/dist/components/iban-input/index.js +1 -1
  224. package/dist/components/icon-picker/index.js +1 -1
  225. package/dist/components/locale-picker/index.js +1 -1
  226. package/dist/components/map-view/index.js +1 -1
  227. package/dist/components/message-card/index.js +1 -1
  228. package/dist/components/message-tray/index.js +1 -1
  229. package/dist/components/multi-select/index.js +1 -1
  230. package/dist/components/navigation-menu/index.js +1 -1
  231. package/dist/components/notes-panel/index.js +1 -1
  232. package/dist/components/operator-hero/index.js +1 -1
  233. package/dist/components/pagination/index.js +1 -1
  234. package/dist/components/password-input/index.js +1 -1
  235. package/dist/components/patient-details/index.js +1 -1
  236. package/dist/components/patient-search/index.js +1 -1
  237. package/dist/components/patient-summary-card/index.js +1 -1
  238. package/dist/components/patient-table/index.js +1 -1
  239. package/dist/components/pdf-viewer/index.js +1 -1
  240. package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
  241. package/dist/components/phone-input/index.js +1 -1
  242. package/dist/components/postal-code-input/index.js +1 -1
  243. package/dist/components/practice-profile-hero/index.js +1 -1
  244. package/dist/components/practice-results/index.js +1 -1
  245. package/dist/components/province-select/index.js +1 -1
  246. package/dist/components/public-footer/index.js +1 -1
  247. package/dist/components/public-footer/public-footer.d.ts.map +1 -1
  248. package/dist/components/rich-text-editor/index.js +1 -1
  249. package/dist/components/search-bar/index.js +1 -1
  250. package/dist/components/search-input/index.js +1 -1
  251. package/dist/components/sidebar/index.js +1 -1
  252. package/dist/components/sign-document/index.js +1 -1
  253. package/dist/components/signature-capture/index.js +1 -1
  254. package/dist/components/signature-field/index.js +1 -1
  255. package/dist/components/signature-field/signature-field.d.ts.map +1 -1
  256. package/dist/components/stat/index.js +1 -1
  257. package/dist/components/stat/stat.d.ts +8 -0
  258. package/dist/components/stat/stat.d.ts.map +1 -1
  259. package/dist/components/stepper-accordion/index.js +1 -1
  260. package/dist/components/task-editor/index.js +1 -1
  261. package/dist/components/text-input/index.js +1 -1
  262. package/dist/components/timeline/index.js +1 -1
  263. package/dist/components/transcript-panel/index.js +1 -1
  264. package/dist/components/widget-picker/index.js +1 -1
  265. package/dist/components/workflow/index.js +1 -1
  266. package/dist/components/workflow-status/index.js +1 -1
  267. package/dist/core.css +1 -1
  268. package/dist/host-compat.css +13 -1
  269. package/dist/index.js +88 -88
  270. package/dist/patterns/alia-assistant/index.js +1 -1
  271. package/dist/patterns/anamnesis/index.js +1 -1
  272. package/dist/patterns/calendar/index.js +1 -1
  273. package/dist/patterns/forgot-password-form/index.js +1 -1
  274. package/dist/patterns/help-me-write-templates/index.js +1 -1
  275. package/dist/patterns/login-form/index.js +1 -1
  276. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  277. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  278. package/dist/patterns/registration-form/index.js +1 -1
  279. package/dist/patterns/reset-password-form/index.js +1 -1
  280. package/dist/patterns/send-registration-link-form/index.js +1 -1
  281. package/dist/patterns/signature-request/index.js +1 -1
  282. package/dist/patterns/signed-out-frame/index.js +1 -1
  283. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  284. package/dist/tokens.css +1 -1
  285. package/package.json +1 -1
  286. package/dist/_chunks/aspect-ratio-DeSNzASA.js.map +0 -1
  287. package/dist/_chunks/avatar-a6042Ox2.js.map +0 -1
  288. package/dist/_chunks/breadcrumb-Bn29NCnf.js.map +0 -1
  289. package/dist/_chunks/command-palette-B3dVqm9D.js.map +0 -1
  290. package/dist/_chunks/contact-profile-card-jBf9U4At.js.map +0 -1
  291. package/dist/_chunks/copy-field-hgVSc51W.js.map +0 -1
  292. package/dist/_chunks/document-scanner-BQP0Rqrt.js.map +0 -1
  293. package/dist/_chunks/map-view--c9bJDRw.js.map +0 -1
  294. package/dist/_chunks/multi-select-i5MFRpXg.js.map +0 -1
  295. package/dist/_chunks/navigation-menu-DbaSlvdO.js.map +0 -1
  296. package/dist/_chunks/pdf-viewer-gAsNUsA8.js.map +0 -1
  297. package/dist/_chunks/phone-input-DJ4BN8tG.js.map +0 -1
  298. package/dist/_chunks/public-footer-BiPiU_lk.js.map +0 -1
  299. package/dist/_chunks/sidebar-BS24EnYd.js.map +0 -1
  300. package/dist/_chunks/sign-document-BiOTs1P4.js.map +0 -1
  301. package/dist/_chunks/signature-capture-Chqh62Pc.js.map +0 -1
  302. package/dist/_chunks/stat-Dno2ZihS.js.map +0 -1
  303. package/dist/_chunks/stepper-accordion-DDTSOUHc.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-D-gpgEDy.js","sources":["../../src/components/combobox/combobox.agent.ts","../../src/components/combobox/combobox.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ComboboxHandle } from './combobox';\n\nexport const comboboxAgent: AgentAdapter<ComboboxHandle> = {\n id: 'combobox',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_single', 'set_value', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string | null',\n descriptionKey: 'ui.agent.combobox.state.value',\n description:\n 'Currently-selected option value, or null when nothing is selected.',\n read: (handle) => handle.getValue(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.combobox.state.query',\n description: 'Current filter query in the combobox input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.combobox.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the user's chosen option — reversible via the same UI.\n safety: 'write',\n argsType: '{ value: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['string', 'null'],\n description: 'Option value to select, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.setValue',\n description: 'Set the selected value programmatically.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string | null }) => {\n handle.setValue(args.value);\n },\n },\n apply_filter: {\n // Pure ephemeral filter of the visible options — no persisted change.\n safety: 'read',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Filter text for the list.' },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.applyFilter',\n description: 'Set the filter query for the option list.',\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n clear_selection: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'combobox' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description: 'Each option emits its value as data-option-id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command, defaultFilter, useCommandState } from 'cmdk';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlRef,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { groupOptions } from '../_shared/group-options';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport {\n OPTION_BODY_CLASSES,\n OPTION_END_CLASSES,\n OPTION_LABEL_ROW_CLASSES,\n optionDescriptionVariants,\n optionLabelVariants,\n} from '../_shared/option-row';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TONE,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { comboboxAgent } from './combobox.agent';\n\nexport type ComboboxOption<T extends string = string> = OptionShape<T>;\n\n// Curated agent-readiness handle — see combobox.agent.ts.\nexport interface ComboboxHandle {\n getValue: () => string | null;\n getQuery: () => string;\n getIsOpen: () => boolean;\n setValue: (value: string | null) => void;\n setQuery: (query: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n /** Custom score. All three arguments are diacritics-stripped and\n * lower-cased. `label` is the option's label ('' for the create row).\n * The filter is not consulted while the query is still the chosen\n * option's own label: then every option shows. */\n filter?: (value: string, search: string, label: string) => number;\n allowCreate?: boolean;\n onCreate?: (value: string) => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Query typed by the user (including IME commits and Clear), or set\n * through the agent handle. Selection and closing do not emit queries.\n * Pair with `filter` for host-provided results and `emptyMessage` for\n * their state. This callback also fires when there are no options. */\n onQueryChange?: (query: string) => void;\n emptyMessage?: ReactNode;\n 'aria-label'?: string;\n /**\n * Invalid-state fallback for use OUTSIDE a `<FormField>` (e.g. an inline\n * editor). Inside a FormField the context wins. Drives the error border and\n * the input's `aria-invalid`.\n */\n 'aria-invalid'?: boolean;\n /**\n * Error-message id fallback for use OUTSIDE a `<FormField>`. Inside a\n * FormField the context's `describedBy` wins.\n */\n 'aria-describedby'?: string;\n /**\n * The input's HTML `autocomplete` token (e.g. `country`,\n * `address-level1`, WCAG 2.1 §1.3.5). With a token, the browser can fill\n * the field from a saved address: text it fills in is matched to an\n * option (see `matchAutofill`) and that option is chosen.\n */\n autoComplete?: string;\n /**\n * Which option the browser's filled-in text means: return its `value`,\n * or `undefined` for none. Used only with `autoComplete`. The default\n * matches an option's value or label, ignoring case and accents.\n */\n matchAutofill?: (text: string) => string | undefined;\n /**\n * Let a long option label wrap onto a second line instead of ending in an\n * ellipsis. Longer still, it is clipped after two lines. Off by default.\n * An option's `description` always sits on its own line under the label.\n */\n wrapOptionLabels?: boolean;\n className?: string;\n}\n\nconst comboboxInputVariants = cva(\n [\n 'ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:outline-none ds:border-0',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full',\n INPUT_SURFACE_CHROME,\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ${INPUT_SURFACE_PADDING_X.sm}`,\n md: `${INPUT_SURFACE_HEIGHT.md} ${INPUT_SURFACE_PADDING_X.md}`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ${INPUT_SURFACE_PADDING_X.lg}`,\n },\n tone: INPUT_SURFACE_TONE,\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst comboboxContentVariants = cva(\n [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]',\n // A guard: the list is as wide as the field, so only a field that is\n // itself wider than the screen could take it past the edge.\n 'ds:max-w-[var(--radix-popover-content-available-width)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst comboboxItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:pointer-events-none ds:aria-disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst comboboxListClasses =\n 'ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst comboboxEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst iconSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\ninterface CreateRowProps {\n search: string;\n label: string;\n iconClass: string;\n size: 'sm' | 'md' | 'lg';\n onSelect: (value: string) => void;\n}\n\nfunction ComboboxCreateRow({\n search,\n label,\n iconClass,\n size,\n onSelect,\n}: CreateRowProps): ReactElement | null {\n // Only surface the create row when no existing item matches the query.\n const filteredCount = useCommandState((state) => state.filtered.count);\n if (filteredCount > 0) return null;\n return (\n <Command.Item\n value={`__combobox-create__${search}`}\n keywords={[]}\n forceMount\n onSelect={() => onSelect(search)}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n />\n <span className=\"ds:flex-1 ds:truncate\">{label}</span>\n </Command.Item>\n );\n}\n\nconst ComboboxImpl = forwardRef<HTMLInputElement, ComboboxProps>(\n function Combobox(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n readOnly,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n filter: externalFilter,\n allowCreate = false,\n onCreate,\n open: openProp,\n onOpenChange,\n onQueryChange,\n emptyMessage,\n className,\n 'aria-label': ariaLabel,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n autoComplete,\n matchAutofill,\n wrapOptionLabels = false,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setComboboxValue] = useControllableState<string>({\n value,\n defaultValue: defaultValue ?? '',\n onChange: onValueChange as ((next: string) => void) | undefined,\n });\n const currentValue = currentValueRaw ?? '';\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === currentValue),\n [options, currentValue],\n );\n const selectedLabel = selectedOption?.label ?? '';\n\n const [search, setSearch] = useState<string>(selectedLabel);\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpenControlled = openProp !== undefined;\n const open = isOpenControlled ? openProp : internalOpen;\n const composingRef = useRef(false);\n /* The query is still the chosen option's own label: nothing typed yet. */\n const untouched = selectedLabel !== '' && search === selectedLabel;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const [mountedList, setMountedList] = useState<HTMLDivElement | null>(null);\n\n /* cmdk writes its own id on the input and focuses it by that id, so\n the field's label follows that id. */\n useFormFieldControlRef(ctx, inputRef);\n\n /* cmdk's relevance sort moves DOM nodes. Remounting the list once the\n query is untouched again puts the options back in source order. */\n const [listEpoch, setListEpoch] = useState(0);\n const listMountedRef = useRef(false);\n useIsomorphicLayoutEffect(() => {\n /* The first render is already in source order. */\n if (!listMountedRef.current) {\n listMountedRef.current = true;\n return;\n }\n if (untouched) setListEpoch((n) => n + 1);\n }, [untouched]);\n\n /* Whether the user has reached a row since the list opened or the\n query changed: arrow keys, Home, End or the pointer. */\n const navigatedRef = useRef(false);\n useEffect(() => {\n navigatedRef.current = false;\n }, [search, open]);\n /* True while the kit itself makes the chosen option the active row. */\n const activatingRef = useRef(false);\n\n /* Opening on an untouched value shows the chosen option mid-list.\n Rect maths rather than scrollIntoView, which would scroll the page. */\n const centredListRef = useRef<HTMLDivElement | null>(null);\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (list !== mountedList) return;\n if (!open || !untouched || !currentValue) return;\n /* Only on opening: once per mounted list. A value that changes while\n the list is open must not scroll it or reset the active row. */\n if (list === centredListRef.current) return;\n const item = list?.querySelector<HTMLElement>(\n `[data-option-id=\"${CSS.escape(currentValue)}\"]`,\n );\n if (!list || !item) return;\n centredListRef.current = list;\n const centrePickedOption = () => {\n if (navigatedRef.current) return;\n const listRect = list.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n /* The opening zoom scales both rects; scrollTop is unscaled. */\n const scale =\n list.offsetHeight > 0 ? listRect.height / list.offsetHeight : 1;\n const offset = (itemRect.top - listRect.top) / (scale || 1);\n const itemHeight = itemRect.height / (scale || 1);\n list.scrollTop += offset - (list.clientHeight - itemHeight) / 2;\n };\n centrePickedOption();\n // cmdk measures a newly mounted list on the next frame. Centre it\n // again after that measurement without scrolling the page.\n const frame = requestAnimationFrame(centrePickedOption);\n /* The chosen option becomes the active row, so the arrow keys move on\n from it. cmdk's pointer path sets the row and the input's\n aria-activedescendant without scrolling. */\n activatingRef.current = true;\n try {\n item.dispatchEvent(new PointerEvent('pointermove', { bubbles: true }));\n } finally {\n activatingRef.current = false;\n }\n // A remounted option has a new id even when cmdk keeps the value.\n inputRef.current?.setAttribute('aria-activedescendant', item.id);\n return () => cancelAnimationFrame(frame);\n }, [open, mountedList, untouched, currentValue]);\n\n const autofillToken =\n autoComplete && autoComplete !== 'off' ? autoComplete : undefined;\n const syncPopupAria = useCallback(() => {\n const input = inputRef.current;\n if (!input) return;\n input.setAttribute('aria-expanded', String(open));\n if (open && listRef.current?.id) {\n input.setAttribute('aria-controls', listRef.current.id);\n } else if (!open) {\n input.removeAttribute('aria-controls');\n input.removeAttribute('aria-activedescendant');\n }\n /* cmdk writes autocomplete=\"off\" over the prop on every render. */\n if (autofillToken) input.setAttribute('autocomplete', autofillToken);\n }, [open, autofillToken]);\n useIsomorphicLayoutEffect(syncPopupAria);\n const setListRef = useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n syncPopupAria();\n if (node) setMountedList(node);\n },\n [syncPopupAria],\n );\n\n /* Text the browser fills in arrives as an input event that is not\n typing: no input type, or a replacement. The listener sits on the\n input itself, so it runs before React hands the change to cmdk. */\n const autofilledRef = useRef(false);\n useEffect(() => {\n const input = inputRef.current;\n if (!input || !autofillToken) return;\n const onInput = (event: Event) => {\n const inputType = (event as InputEvent).inputType;\n autofilledRef.current =\n !inputType || inputType === 'insertReplacementText';\n };\n input.addEventListener('input', onInput);\n return () => input.removeEventListener('input', onInput);\n }, [autofillToken]);\n\n useEffect(() => {\n if (!open) {\n setSearch(selectedLabel);\n }\n }, [selectedLabel, open]);\n\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveReadOnly = Boolean(readOnly);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : Boolean(ariaInvalid);\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : ariaDescribedBy;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.combobox.placeholder', 'Search…');\n\n const filterFn = useMemo(\n () => (candidate: string, searchStr: string, keywords?: string[]) => {\n if (composingRef.current) return 1;\n /* Untouched query: every option shows, whatever the filter says. */\n if (selectedLabel !== '' && searchStr === selectedLabel) return 1;\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n if (externalFilter) {\n return externalFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords?.[0] ?? '',\n );\n }\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [externalFilter, selectedLabel],\n );\n\n const commit = (next: string) => {\n setComboboxValue(next);\n };\n\n const setOpen = (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const handleSelect = (optValue: string) => {\n const option = options.find((o) => o.value === optValue);\n commit(optValue);\n setSearch(option?.label ?? '');\n setOpen(false);\n };\n\n const handleCreate = (nextValue: string) => {\n onCreate?.(nextValue);\n setOpen(false);\n };\n\n const optionForAutofill = (text: string) => {\n const wanted = normalizeDiacritics(text.trim());\n if (!wanted) return undefined;\n const match = matchAutofill\n ? matchAutofill(text.trim())\n : options.find(\n (o) =>\n normalizeDiacritics(o.value) === wanted ||\n normalizeDiacritics(o.label) === wanted,\n )?.value;\n return options.find((o) => o.value === match && !o.disabled);\n };\n\n const handleSearchChange = (next: string) => {\n if (effectiveReadOnly) return;\n if (autofilledRef.current) {\n autofilledRef.current = false;\n const option = optionForAutofill(next);\n if (option) {\n commit(option.value);\n setSearch(option.label);\n if (open) setOpen(false);\n return;\n }\n /* Filled from another field and no option means it: the list\n must not open over a field the user is not in. */\n if (document.activeElement !== inputRef.current) {\n setSearch(selectedLabel);\n return;\n }\n }\n setSearch(next);\n if (!composingRef.current) onQueryChange?.(next);\n if (!open && next.length > 0 && !composingRef.current) {\n setOpen(true);\n }\n };\n\n const handleFocus = () => {\n if (!effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n /* A pick keeps focus in the input, so no focus event follows. A\n click on the focused input reopens the list instead. */\n const handleClick = () => {\n if (!open && !effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n const handleCompositionStart = () => {\n composingRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n composingRef.current = false;\n if (effectiveReadOnly) return;\n const next = inputRef.current?.value ?? '';\n setSearch(next);\n onQueryChange?.(next);\n if (next.length > 0) setOpen(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) return;\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n !open &&\n !effectiveDisabled &&\n !effectiveReadOnly\n ) {\n /* The arrow that opens the list only opens it. The next arrow\n moves on from the chosen option, or from the top. */\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Home' ||\n event.key === 'End' ||\n /* cmdk's own Ctrl+N, J, P and K move the highlight too. */\n (event.ctrlKey && ['n', 'j', 'p', 'k'].includes(event.key))\n ) {\n navigatedRef.current = true;\n }\n /* Handled before cmdk sees it: Enter commits only a row the user\n reached, never from a closed list. On an untouched open the lit\n row is the chosen option, so keeping the value matches it. */\n if (\n event.key === 'Enter' &&\n (!open || (!navigatedRef.current && (untouched || search === '')))\n ) {\n event.preventDefault();\n if (open) setOpen(false);\n return;\n }\n if (event.key === 'Escape' && open) {\n event.preventDefault();\n setOpen(false);\n setSearch(selectedLabel);\n }\n };\n\n const handleClear = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n commit('');\n setSearch('');\n onQueryChange?.('');\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean) => {\n if (effectiveReadOnly && next) return;\n setOpen(next);\n if (!next) setSearch(selectedLabel);\n };\n\n // Agent handle — refs mirror state for fresh reads.\n const valueRef = useRef<string>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const searchRef = useRef<string>(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const setOpenStable = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const agentHandle = useMemo<ComboboxHandle>(\n () => ({\n getValue: () => valueRef.current || null,\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n setValue: (next) => {\n const v = next ?? '';\n setComboboxValue(v);\n const opt = options.find((o) => o.value === v);\n setSearch(opt?.label ?? '');\n },\n setQuery: (query) => {\n setSearch(query);\n onQueryChange?.(query);\n },\n clear: () => {\n setComboboxValue('');\n setSearch('');\n onQueryChange?.('');\n },\n open: () => setOpenStable(true),\n close: () => setOpenStable(false),\n }),\n [setComboboxValue, options, setOpenStable, onQueryChange],\n );\n useAgentRegistration(comboboxAgent, agentHandle, id);\n\n const showClear =\n clearable &&\n Boolean(currentValue) &&\n !effectiveDisabled &&\n !effectiveReadOnly;\n\n const groups = groupOptions(options);\n const iconClass = iconSizeBySize[size];\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Command\n filter={filterFn}\n shouldFilter\n loop\n // cmdk points the input's `aria-labelledby` at its own hidden\n // `<label cmdk-label>`, whose text is this `label`: it is the\n // input's accessible name. The caller's `aria-label` wins, then\n // the FormField's label. The placeholder is the last resort, so\n // the input is never unnamed.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className=\"ds:w-full\"\n >\n <Popover.Anchor asChild>\n <div\n ref={anchorRef}\n className={comboboxWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n data-component=\"combobox\"\n data-component-id={id}\n >\n <Command.Input\n ref={composeRefs(ref, inputRef)}\n value={search}\n onValueChange={handleSearchChange}\n // The picked label shows in the field: keep its direction.\n dir={selectedOption?.dir}\n name={name}\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={effectiveReadOnly}\n required={effectiveRequired}\n autoComplete={autoComplete}\n // cmdk writes `id` and `aria-labelledby` after the props it\n // is given, so neither can be set here: the name goes through\n // the Command root's `label` above.\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onFocus={handleFocus}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={comboboxInputVariants({ size })}\n />\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.combobox.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4 ds:shrink-0',\n /* A 24px hit area with no visual change. */\n \"ds:relative ds:before:absolute ds:before:inset-[calc(var(--spacing-xs)*-1)] ds:before:content-['']\",\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n </div>\n </Popover.Anchor>\n <Popover.Portal forceMount>\n {open ? (\n <Popover.Content\n // Radix Popover.Content carries `role=\"dialog\"`; axe's\n // `aria-dialog-name` rule requires a name. Surface the\n // surrounding combobox label so the popover is named after\n // the field it serves (or fall back to the i18n default).\n aria-label={\n ariaLabel ?? t('inputs.combobox.popupLabel', 'Options')\n }\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target as Node | null;\n if (target && anchorRef.current?.contains(target)) {\n event.preventDefault();\n }\n }}\n sideOffset={4}\n align=\"start\"\n className={comboboxContentVariants()}\n >\n <Command.List\n key={listEpoch}\n ref={setListRef}\n // cmdk names the listbox \"Suggestions\" in English otherwise.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className={comboboxListClasses}\n onPointerMove={() => {\n if (!activatingRef.current) navigatedRef.current = true;\n }}\n /* The list is focusable: without this a pointer pick\n moves focus into it, then loses it to the page when\n the list hides. */\n onMouseDown={(event) => event.preventDefault()}\n >\n <Command.Empty className={comboboxEmptyClasses}>\n {/* cmdk owns the presentational wrapper. This unavailable\n option gives an empty list valid semantics without\n registering a selectable cmdk item. */}\n <div\n role=\"option\"\n aria-selected={false}\n aria-disabled=\"true\"\n >\n {emptyMessage ??\n t('inputs.combobox.empty', 'No results found')}\n </div>\n </Command.Empty>\n {groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => {\n const isSelected = option.value === currentValue;\n return (\n <Command.Item\n /* The label is in the key because cmdk only reads\n keywords when the value changes. */\n key={`${option.value}\\u0000${option.label}`}\n value={option.value}\n data-option-id={option.value}\n keywords={[option.label]}\n disabled={option.disabled}\n onSelect={handleSelect}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n >\n {isSelected ? (\n <Check className={iconClass} />\n ) : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the option's accessible\n // name comes from its label. Hide so a text-bearing\n // adornment can't leak into the computed name.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked: the label and its end content on one\n // row, the description on a line of its own\n // under them. In this DOM order the option's\n // name reads label, end content, description.\n <span\n className={`${OPTION_BODY_CLASSES} ds:py-[var(--spacing-xs)]`}\n >\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1',\n })}\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Announced, as below.\n <span className={OPTION_END_CLASSES}>\n {option.endContent}\n </span>\n ) : null}\n </span>\n {option.description ? (\n <span\n className={optionDescriptionVariants({\n tone: option.descriptionTone,\n })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:truncate\"\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Deliberately NOT aria-hidden — unlike\n // `startAdornment`, this slot carries meaning\n // (a price, a count) and must reach the\n // option's accessible name. `ms-auto` pins it\n // to the inline-end and flips under RTL.\n <span className=\"ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n });\n if (!group) {\n return (\n <Command.Group key={`group-${groupIndex}`}>\n {body}\n </Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={\n <span className={comboboxGroupHeadingClasses}>\n {group}\n </span>\n }\n >\n {body}\n </Command.Group>\n );\n })}\n {allowCreate && search.length > 0 ? (\n <ComboboxCreateRow\n search={search}\n label={t('inputs.combobox.create', 'Create \"{{value}}\"', {\n value: search,\n })}\n iconClass={iconClass}\n size={size}\n onSelect={handleCreate}\n />\n ) : null}\n </Command.List>\n </Popover.Content>\n ) : null}\n </Popover.Portal>\n </Command>\n </Popover.Root>\n );\n },\n);\nComboboxImpl.displayName = 'Combobox';\n\ninterface ComboboxComponent {\n <T extends string = string>(\n props: ComboboxProps<T> & { ref?: Ref<HTMLInputElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\n// forwardRef erases component-level generics, so we re-widen via a callable\n// interface to preserve the `<T extends string>` signature at the call site.\nexport const Combobox = ComboboxImpl as unknown as ComboboxComponent;\n\nexport {\n comboboxInputVariants,\n comboboxWrapperVariants,\n comboboxContentVariants,\n comboboxItemVariants,\n};\n"],"names":["comboboxAgent","handle","args","comboboxInputVariants","cva","comboboxWrapperVariants","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","INPUT_SURFACE_TONE","comboboxContentVariants","comboboxItemVariants","MENU_ROW_HIGHLIGHT","comboboxGroupHeadingClasses","comboboxListClasses","comboboxEmptyClasses","iconSizeBySize","ComboboxCreateRow","search","label","iconClass","size","onSelect","useCommandState","state","jsxs","Command","jsx","ComboboxImpl","forwardRef","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","readOnly","required","name","id","tone","externalFilter","allowCreate","onCreate","openProp","onOpenChange","onQueryChange","emptyMessage","className","ariaLabel","ariaInvalid","ariaDescribedBy","autoComplete","matchAutofill","wrapOptionLabels","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setComboboxValue","useControllableState","currentValue","selectedOption","useMemo","o","selectedLabel","setSearch","useState","internalOpen","setInternalOpen","isOpenControlled","open","composingRef","useRef","untouched","inputRef","anchorRef","listRef","mountedList","setMountedList","useFormFieldControlRef","listEpoch","setListEpoch","listMountedRef","useIsomorphicLayoutEffect","n","navigatedRef","useEffect","activatingRef","centredListRef","list","item","centrePickedOption","listRect","itemRect","scale","offset","itemHeight","frame","_a","autofillToken","syncPopupAria","useCallback","input","setListRef","node","autofilledRef","onInput","event","inputType","effectiveDisabled","effectiveReadOnly","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","filterFn","candidate","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","commit","next","setOpen","handleSelect","optValue","option","handleCreate","nextValue","optionForAutofill","text","wanted","match","handleSearchChange","handleFocus","handleClick","handleCompositionStart","handleCompositionEnd","handleKeyDown","handleClear","handleOpenChange","valueRef","searchRef","openRef","setOpenStable","agentHandle","v","opt","query","useAgentRegistration","showClear","groups","groupOptions","Popover","composeRefs","X","target","group","items","groupIndex","body","isSelected","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,UAAU,QAAQ,OAAO;AAAA,EACtE,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA;AAAA,MAET,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM,CAAC,UAAU,MAAM;AAAA,YACvB,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,QAAQ,MAAM,2BAA2B;AAAA,MACrE,QAAQ,CAACA,GAAQC,MAAmC;AAClD,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,cAAc;AAAA;AAAA,MAEZ,QAAQ;AAAA,MACR,UAAU;AA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AAA,wBACA,UAAUqH;AAAA,sBAAA;AAAA,oBAAA,IAEV;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBApJCnD;AAAA,cAAA;AAAA,YAqJP;AAAA,UAAA,IAEA,KAAA,CACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACA3D,GAAa,cAAc;AAWpB,MAAMwJ,KAAWxJ;"}
1
+ {"version":3,"file":"combobox-duuDRI1t.js","sources":["../../src/components/combobox/combobox.agent.ts","../../src/components/combobox/combobox.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ComboboxHandle } from './combobox';\n\nexport const comboboxAgent: AgentAdapter<ComboboxHandle> = {\n id: 'combobox',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_single', 'set_value', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string | null',\n descriptionKey: 'ui.agent.combobox.state.value',\n description:\n 'Currently-selected option value, or null when nothing is selected.',\n read: (handle) => handle.getValue(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.combobox.state.query',\n description: 'Current filter query in the combobox input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.combobox.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the user's chosen option — reversible via the same UI.\n safety: 'write',\n argsType: '{ value: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['string', 'null'],\n description: 'Option value to select, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.setValue',\n description: 'Set the selected value programmatically.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string | null }) => {\n handle.setValue(args.value);\n },\n },\n apply_filter: {\n // Pure ephemeral filter of the visible options — no persisted change.\n safety: 'read',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Filter text for the list.' },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.applyFilter',\n description: 'Set the filter query for the option list.',\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n clear_selection: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'combobox' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description: 'Each option emits its value as data-option-id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command, defaultFilter, useCommandState } from 'cmdk';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlRef,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { groupOptions } from '../_shared/group-options';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport {\n OPTION_BODY_CLASSES,\n OPTION_END_CLASSES,\n OPTION_LABEL_ROW_CLASSES,\n optionDescriptionVariants,\n optionLabelVariants,\n} from '../_shared/option-row';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TONE,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { comboboxAgent } from './combobox.agent';\n\nexport type ComboboxOption<T extends string = string> = OptionShape<T>;\n\n// Curated agent-readiness handle — see combobox.agent.ts.\nexport interface ComboboxHandle {\n getValue: () => string | null;\n getQuery: () => string;\n getIsOpen: () => boolean;\n setValue: (value: string | null) => void;\n setQuery: (query: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n /** Custom score. All three arguments are diacritics-stripped and\n * lower-cased. `label` is the option's label ('' for the create row).\n * The filter is not consulted while the query is still the chosen\n * option's own label: then every option shows. */\n filter?: (value: string, search: string, label: string) => number;\n allowCreate?: boolean;\n onCreate?: (value: string) => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Query typed by the user (including IME commits and Clear), or set\n * through the agent handle. Selection and closing do not emit queries.\n * Pair with `filter` for host-provided results and `emptyMessage` for\n * their state. This callback also fires when there are no options. */\n onQueryChange?: (query: string) => void;\n emptyMessage?: ReactNode;\n 'aria-label'?: string;\n /**\n * Invalid-state fallback for use OUTSIDE a `<FormField>` (e.g. an inline\n * editor). Inside a FormField the context wins. Drives the error border and\n * the input's `aria-invalid`.\n */\n 'aria-invalid'?: boolean;\n /**\n * Error-message id fallback for use OUTSIDE a `<FormField>`. Inside a\n * FormField the context's `describedBy` wins.\n */\n 'aria-describedby'?: string;\n /**\n * The input's HTML `autocomplete` token (e.g. `country`,\n * `address-level1`, WCAG 2.1 §1.3.5). With a token, the browser can fill\n * the field from a saved address: text it fills in is matched to an\n * option (see `matchAutofill`) and that option is chosen.\n */\n autoComplete?: string;\n /**\n * Which option the browser's filled-in text means: return its `value`,\n * or `undefined` for none. Used only with `autoComplete`. The default\n * matches an option's value or label, ignoring case and accents.\n */\n matchAutofill?: (text: string) => string | undefined;\n /**\n * Let a long option label wrap onto a second line instead of ending in an\n * ellipsis. Longer still, it is clipped after two lines. Off by default.\n * An option's `description` always sits on its own line under the label.\n */\n wrapOptionLabels?: boolean;\n className?: string;\n}\n\nconst comboboxInputVariants = cva(\n [\n 'ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:outline-none ds:border-0',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full',\n INPUT_SURFACE_CHROME,\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ${INPUT_SURFACE_PADDING_X.sm}`,\n md: `${INPUT_SURFACE_HEIGHT.md} ${INPUT_SURFACE_PADDING_X.md}`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ${INPUT_SURFACE_PADDING_X.lg}`,\n },\n tone: INPUT_SURFACE_TONE,\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst comboboxContentVariants = cva(\n [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]',\n // A guard: the list is as wide as the field, so only a field that is\n // itself wider than the screen could take it past the edge.\n 'ds:max-w-[var(--radix-popover-content-available-width)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst comboboxItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:pointer-events-none ds:aria-disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst comboboxListClasses =\n 'ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst comboboxEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst iconSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\ninterface CreateRowProps {\n search: string;\n label: string;\n iconClass: string;\n size: 'sm' | 'md' | 'lg';\n onSelect: (value: string) => void;\n}\n\nfunction ComboboxCreateRow({\n search,\n label,\n iconClass,\n size,\n onSelect,\n}: CreateRowProps): ReactElement | null {\n // Only surface the create row when no existing item matches the query.\n const filteredCount = useCommandState((state) => state.filtered.count);\n if (filteredCount > 0) return null;\n return (\n <Command.Item\n value={`__combobox-create__${search}`}\n keywords={[]}\n forceMount\n onSelect={() => onSelect(search)}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n />\n <span className=\"ds:flex-1 ds:truncate\">{label}</span>\n </Command.Item>\n );\n}\n\nconst ComboboxImpl = forwardRef<HTMLInputElement, ComboboxProps>(\n function Combobox(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n readOnly,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n filter: externalFilter,\n allowCreate = false,\n onCreate,\n open: openProp,\n onOpenChange,\n onQueryChange,\n emptyMessage,\n className,\n 'aria-label': ariaLabel,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n autoComplete,\n matchAutofill,\n wrapOptionLabels = false,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setComboboxValue] = useControllableState<string>({\n value,\n defaultValue: defaultValue ?? '',\n onChange: onValueChange as ((next: string) => void) | undefined,\n });\n const currentValue = currentValueRaw ?? '';\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === currentValue),\n [options, currentValue],\n );\n const selectedLabel = selectedOption?.label ?? '';\n\n const [search, setSearch] = useState<string>(selectedLabel);\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpenControlled = openProp !== undefined;\n const open = isOpenControlled ? openProp : internalOpen;\n const composingRef = useRef(false);\n /* The query is still the chosen option's own label: nothing typed yet. */\n const untouched = selectedLabel !== '' && search === selectedLabel;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const [mountedList, setMountedList] = useState<HTMLDivElement | null>(null);\n\n /* cmdk writes its own id on the input and focuses it by that id, so\n the field's label follows that id. */\n useFormFieldControlRef(ctx, inputRef);\n\n /* cmdk's relevance sort moves DOM nodes. Remounting the list once the\n query is untouched again puts the options back in source order. */\n const [listEpoch, setListEpoch] = useState(0);\n const listMountedRef = useRef(false);\n useIsomorphicLayoutEffect(() => {\n /* The first render is already in source order. */\n if (!listMountedRef.current) {\n listMountedRef.current = true;\n return;\n }\n if (untouched) setListEpoch((n) => n + 1);\n }, [untouched]);\n\n /* Whether the user has reached a row since the list opened or the\n query changed: arrow keys, Home, End or the pointer. */\n const navigatedRef = useRef(false);\n useEffect(() => {\n navigatedRef.current = false;\n }, [search, open]);\n /* True while the kit itself makes the chosen option the active row. */\n const activatingRef = useRef(false);\n\n /* Opening on an untouched value shows the chosen option mid-list.\n Rect maths rather than scrollIntoView, which would scroll the page. */\n const centredListRef = useRef<HTMLDivElement | null>(null);\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (list !== mountedList) return;\n if (!open || !untouched || !currentValue) return;\n /* Only on opening: once per mounted list. A value that changes while\n the list is open must not scroll it or reset the active row. */\n if (list === centredListRef.current) return;\n const item = list?.querySelector<HTMLElement>(\n `[data-option-id=\"${CSS.escape(currentValue)}\"]`,\n );\n if (!list || !item) return;\n centredListRef.current = list;\n const centrePickedOption = () => {\n if (navigatedRef.current) return;\n const listRect = list.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n /* The opening zoom scales both rects; scrollTop is unscaled. */\n const scale =\n list.offsetHeight > 0 ? listRect.height / list.offsetHeight : 1;\n const offset = (itemRect.top - listRect.top) / (scale || 1);\n const itemHeight = itemRect.height / (scale || 1);\n list.scrollTop += offset - (list.clientHeight - itemHeight) / 2;\n };\n centrePickedOption();\n // cmdk measures a newly mounted list on the next frame. Centre it\n // again after that measurement without scrolling the page.\n const frame = requestAnimationFrame(centrePickedOption);\n /* The chosen option becomes the active row, so the arrow keys move on\n from it. cmdk's pointer path sets the row and the input's\n aria-activedescendant without scrolling. */\n activatingRef.current = true;\n try {\n item.dispatchEvent(new PointerEvent('pointermove', { bubbles: true }));\n } finally {\n activatingRef.current = false;\n }\n // A remounted option has a new id even when cmdk keeps the value.\n inputRef.current?.setAttribute('aria-activedescendant', item.id);\n return () => cancelAnimationFrame(frame);\n }, [open, mountedList, untouched, currentValue]);\n\n const autofillToken =\n autoComplete && autoComplete !== 'off' ? autoComplete : undefined;\n const syncPopupAria = useCallback(() => {\n const input = inputRef.current;\n if (!input) return;\n input.setAttribute('aria-expanded', String(open));\n if (open && listRef.current?.id) {\n input.setAttribute('aria-controls', listRef.current.id);\n } else if (!open) {\n input.removeAttribute('aria-controls');\n input.removeAttribute('aria-activedescendant');\n }\n /* cmdk writes autocomplete=\"off\" over the prop on every render. */\n if (autofillToken) input.setAttribute('autocomplete', autofillToken);\n }, [open, autofillToken]);\n useIsomorphicLayoutEffect(syncPopupAria);\n const setListRef = useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n syncPopupAria();\n if (node) setMountedList(node);\n },\n [syncPopupAria],\n );\n\n /* Text the browser fills in arrives as an input event that is not\n typing: no input type, or a replacement. The listener sits on the\n input itself, so it runs before React hands the change to cmdk. */\n const autofilledRef = useRef(false);\n useEffect(() => {\n const input = inputRef.current;\n if (!input || !autofillToken) return;\n const onInput = (event: Event) => {\n const inputType = (event as InputEvent).inputType;\n autofilledRef.current =\n !inputType || inputType === 'insertReplacementText';\n };\n input.addEventListener('input', onInput);\n return () => input.removeEventListener('input', onInput);\n }, [autofillToken]);\n\n useEffect(() => {\n if (!open) {\n setSearch(selectedLabel);\n }\n }, [selectedLabel, open]);\n\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveReadOnly = Boolean(readOnly);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : Boolean(ariaInvalid);\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : ariaDescribedBy;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.combobox.placeholder', 'Search…');\n\n const filterFn = useMemo(\n () => (candidate: string, searchStr: string, keywords?: string[]) => {\n if (composingRef.current) return 1;\n /* Untouched query: every option shows, whatever the filter says. */\n if (selectedLabel !== '' && searchStr === selectedLabel) return 1;\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n if (externalFilter) {\n return externalFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords?.[0] ?? '',\n );\n }\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [externalFilter, selectedLabel],\n );\n\n const commit = (next: string) => {\n setComboboxValue(next);\n };\n\n const setOpen = (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const handleSelect = (optValue: string) => {\n const option = options.find((o) => o.value === optValue);\n commit(optValue);\n setSearch(option?.label ?? '');\n setOpen(false);\n };\n\n const handleCreate = (nextValue: string) => {\n onCreate?.(nextValue);\n setOpen(false);\n };\n\n const optionForAutofill = (text: string) => {\n const wanted = normalizeDiacritics(text.trim());\n if (!wanted) return undefined;\n const match = matchAutofill\n ? matchAutofill(text.trim())\n : options.find(\n (o) =>\n normalizeDiacritics(o.value) === wanted ||\n normalizeDiacritics(o.label) === wanted,\n )?.value;\n return options.find((o) => o.value === match && !o.disabled);\n };\n\n const handleSearchChange = (next: string) => {\n if (effectiveReadOnly) return;\n if (autofilledRef.current) {\n autofilledRef.current = false;\n const option = optionForAutofill(next);\n if (option) {\n commit(option.value);\n setSearch(option.label);\n if (open) setOpen(false);\n return;\n }\n /* Filled from another field and no option means it: the list\n must not open over a field the user is not in. */\n if (document.activeElement !== inputRef.current) {\n setSearch(selectedLabel);\n return;\n }\n }\n setSearch(next);\n if (!composingRef.current) onQueryChange?.(next);\n if (!open && next.length > 0 && !composingRef.current) {\n setOpen(true);\n }\n };\n\n const handleFocus = () => {\n if (!effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n /* A pick keeps focus in the input, so no focus event follows. A\n click on the focused input reopens the list instead. */\n const handleClick = () => {\n if (!open && !effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n const handleCompositionStart = () => {\n composingRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n composingRef.current = false;\n if (effectiveReadOnly) return;\n const next = inputRef.current?.value ?? '';\n setSearch(next);\n onQueryChange?.(next);\n if (next.length > 0) setOpen(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) return;\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n !open &&\n !effectiveDisabled &&\n !effectiveReadOnly\n ) {\n /* The arrow that opens the list only opens it. The next arrow\n moves on from the chosen option, or from the top. */\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Home' ||\n event.key === 'End' ||\n /* cmdk's own Ctrl+N, J, P and K move the highlight too. */\n (event.ctrlKey && ['n', 'j', 'p', 'k'].includes(event.key))\n ) {\n navigatedRef.current = true;\n }\n /* Handled before cmdk sees it: Enter commits only a row the user\n reached, never from a closed list. On an untouched open the lit\n row is the chosen option, so keeping the value matches it. */\n if (\n event.key === 'Enter' &&\n (!open || (!navigatedRef.current && (untouched || search === '')))\n ) {\n event.preventDefault();\n if (open) setOpen(false);\n return;\n }\n if (event.key === 'Escape' && open) {\n event.preventDefault();\n setOpen(false);\n setSearch(selectedLabel);\n }\n };\n\n const handleClear = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n commit('');\n setSearch('');\n onQueryChange?.('');\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean) => {\n if (effectiveReadOnly && next) return;\n setOpen(next);\n if (!next) setSearch(selectedLabel);\n };\n\n // Agent handle — refs mirror state for fresh reads.\n const valueRef = useRef<string>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const searchRef = useRef<string>(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const setOpenStable = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const agentHandle = useMemo<ComboboxHandle>(\n () => ({\n getValue: () => valueRef.current || null,\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n setValue: (next) => {\n const v = next ?? '';\n setComboboxValue(v);\n const opt = options.find((o) => o.value === v);\n setSearch(opt?.label ?? '');\n },\n setQuery: (query) => {\n setSearch(query);\n onQueryChange?.(query);\n },\n clear: () => {\n setComboboxValue('');\n setSearch('');\n onQueryChange?.('');\n },\n open: () => setOpenStable(true),\n close: () => setOpenStable(false),\n }),\n [setComboboxValue, options, setOpenStable, onQueryChange],\n );\n useAgentRegistration(comboboxAgent, agentHandle, id);\n\n const showClear =\n clearable &&\n Boolean(currentValue) &&\n !effectiveDisabled &&\n !effectiveReadOnly;\n\n const groups = groupOptions(options);\n const iconClass = iconSizeBySize[size];\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Command\n filter={filterFn}\n shouldFilter\n loop\n // cmdk points the input's `aria-labelledby` at its own hidden\n // `<label cmdk-label>`, whose text is this `label`: it is the\n // input's accessible name. The caller's `aria-label` wins, then\n // the FormField's label. The placeholder is the last resort, so\n // the input is never unnamed.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className=\"ds:w-full\"\n >\n <Popover.Anchor asChild>\n <div\n ref={anchorRef}\n className={comboboxWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n data-component=\"combobox\"\n data-component-id={id}\n >\n <Command.Input\n ref={composeRefs(ref, inputRef)}\n value={search}\n onValueChange={handleSearchChange}\n // The picked label shows in the field: keep its direction.\n dir={selectedOption?.dir}\n name={name}\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={effectiveReadOnly}\n required={effectiveRequired}\n autoComplete={autoComplete}\n // cmdk writes `id` and `aria-labelledby` after the props it\n // is given, so neither can be set here: the name goes through\n // the Command root's `label` above.\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onFocus={handleFocus}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={comboboxInputVariants({ size })}\n />\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.combobox.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4 ds:shrink-0',\n /* A 24px hit area with no visual change. */\n \"ds:relative ds:before:absolute ds:before:inset-[calc(var(--spacing-xs)*-1)] ds:before:content-['']\",\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n </div>\n </Popover.Anchor>\n <Popover.Portal forceMount>\n {open ? (\n <Popover.Content\n // Radix Popover.Content carries `role=\"dialog\"`; axe's\n // `aria-dialog-name` rule requires a name. Surface the\n // surrounding combobox label so the popover is named after\n // the field it serves (or fall back to the i18n default).\n aria-label={\n ariaLabel ?? t('inputs.combobox.popupLabel', 'Options')\n }\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target as Node | null;\n if (target && anchorRef.current?.contains(target)) {\n event.preventDefault();\n }\n }}\n sideOffset={4}\n align=\"start\"\n className={comboboxContentVariants()}\n >\n <Command.List\n key={listEpoch}\n ref={setListRef}\n // cmdk names the listbox \"Suggestions\" in English otherwise.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className={comboboxListClasses}\n onPointerMove={() => {\n if (!activatingRef.current) navigatedRef.current = true;\n }}\n /* The list is focusable: without this a pointer pick\n moves focus into it, then loses it to the page when\n the list hides. */\n onMouseDown={(event) => event.preventDefault()}\n >\n <Command.Empty className={comboboxEmptyClasses}>\n {/* cmdk owns the presentational wrapper. This unavailable\n option gives an empty list valid semantics without\n registering a selectable cmdk item. */}\n <div\n role=\"option\"\n aria-selected={false}\n aria-disabled=\"true\"\n >\n {emptyMessage ??\n t('inputs.combobox.empty', 'No results found')}\n </div>\n </Command.Empty>\n {groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => {\n const isSelected = option.value === currentValue;\n return (\n <Command.Item\n /* The label is in the key because cmdk only reads\n keywords when the value changes. */\n key={`${option.value}\\u0000${option.label}`}\n value={option.value}\n data-option-id={option.value}\n keywords={[option.label]}\n disabled={option.disabled}\n onSelect={handleSelect}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n >\n {isSelected ? (\n <Check className={iconClass} />\n ) : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the option's accessible\n // name comes from its label. Hide so a text-bearing\n // adornment can't leak into the computed name.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked: the label and its end content on one\n // row, the description on a line of its own\n // under them. In this DOM order the option's\n // name reads label, end content, description.\n <span\n className={`${OPTION_BODY_CLASSES} ds:py-[var(--spacing-xs)]`}\n >\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1',\n })}\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Announced, as below.\n <span className={OPTION_END_CLASSES}>\n {option.endContent}\n </span>\n ) : null}\n </span>\n {option.description ? (\n <span\n className={optionDescriptionVariants({\n tone: option.descriptionTone,\n })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:truncate\"\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Deliberately NOT aria-hidden — unlike\n // `startAdornment`, this slot carries meaning\n // (a price, a count) and must reach the\n // option's accessible name. `ms-auto` pins it\n // to the inline-end and flips under RTL.\n <span className=\"ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n });\n if (!group) {\n return (\n <Command.Group key={`group-${groupIndex}`}>\n {body}\n </Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={\n <span className={comboboxGroupHeadingClasses}>\n {group}\n </span>\n }\n >\n {body}\n </Command.Group>\n );\n })}\n {allowCreate && search.length > 0 ? (\n <ComboboxCreateRow\n search={search}\n label={t('inputs.combobox.create', 'Create \"{{value}}\"', {\n value: search,\n })}\n iconClass={iconClass}\n size={size}\n onSelect={handleCreate}\n />\n ) : null}\n </Command.List>\n </Popover.Content>\n ) : null}\n </Popover.Portal>\n </Command>\n </Popover.Root>\n );\n },\n);\nComboboxImpl.displayName = 'Combobox';\n\ninterface ComboboxComponent {\n <T extends string = string>(\n props: ComboboxProps<T> & { ref?: Ref<HTMLInputElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\n// forwardRef erases component-level generics, so we re-widen via a callable\n// interface to preserve the `<T extends string>` signature at the call site.\nexport const Combobox = ComboboxImpl as unknown as ComboboxComponent;\n\nexport {\n comboboxInputVariants,\n comboboxWrapperVariants,\n comboboxContentVariants,\n comboboxItemVariants,\n};\n"],"names":["comboboxAgent","handle","args","comboboxInputVariants","cva","comboboxWrapperVariants","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","INPUT_SURFACE_TONE","comboboxContentVariants","comboboxItemVariants","MENU_ROW_HIGHLIGHT","comboboxGroupHeadingClasses","comboboxListClasses","comboboxEmptyClasses","iconSizeBySize","ComboboxCreateRow","search","label","iconClass","size","onSelect","useCommandState","state","jsxs","Command","jsx","ComboboxImpl","forwardRef","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","readOnly","required","name","id","tone","externalFilter","allowCreate","onCreate","openProp","onOpenChange","onQueryChange","emptyMessage","className","ariaLabel","ariaInvalid","ariaDescribedBy","autoComplete","matchAutofill","wrapOptionLabels","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setComboboxValue","useControllableState","currentValue","selectedOption","useMemo","o","selectedLabel","setSearch","useState","internalOpen","setInternalOpen","isOpenControlled","open","composingRef","useRef","untouched","inputRef","anchorRef","listRef","mountedList","setMountedList","useFormFieldControlRef","listEpoch","setListEpoch","listMountedRef","useIsomorphicLayoutEffect","n","navigatedRef","useEffect","activatingRef","centredListRef","list","item","centrePickedOption","listRect","itemRect","scale","offset","itemHeight","frame","_a","autofillToken","syncPopupAria","useCallback","input","setListRef","node","autofilledRef","onInput","event","inputType","effectiveDisabled","effectiveReadOnly","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","filterFn","candidate","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","commit","next","setOpen","handleSelect","optValue","option","handleCreate","nextValue","optionForAutofill","text","wanted","match","handleSearchChange","handleFocus","handleClick","handleCompositionStart","handleCompositionEnd","handleKeyDown","handleClear","handleOpenChange","valueRef","searchRef","openRef","setOpenStable","agentHandle","v","opt","query","useAgentRegistration","showClear","groups","groupOptions","Popover","composeRefs","X","target","group","items","groupIndex","body","isSelected","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,UAAU,QAAQ,OAAO;AAAA,EACtE,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA;AAAA,MAET,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM,CAAC,UAAU,MAAM;AAAA,YACvB,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,QAAQ,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9B,gBAAAS;AAAA,sBAACV;AAAA,sBAAA;AAAA,wBACC,QAAAC;AAAA,wBACA,OAAOuC,EAAE,0BAA0B,sBAAsB;AAAA,0BACvD,OAAOvC;AAAA,wBAAA,CACR;AAAA,wBACD,WAAAE;AAAA,wBACA,MAAAC;AAAA,wBACA,UAAUqH;AAAA,sBAAA;AAAA,oBAAA,IAEV;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBApJCnD;AAAA,cAAA;AAAA,YAqJP;AAAA,UAAA,IAEA,KAAA,CACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACA3D,GAAa,cAAc;AAWpB,MAAMwJ,KAAWxJ;"}
@@ -141,7 +141,7 @@ const ee = [
141
141
  ].join(" "), te = [
142
142
  "ds:flex ds:w-full ds:bg-transparent",
143
143
  "ds:min-h-[var(--min-target-size)]",
144
- "ds:text-[var(--font-size-base)] ds:text-[var(--foreground)]",
144
+ "ds:text-[length:var(--font-size-base)] ds:text-[var(--foreground)]",
145
145
  "ds:placeholder:text-[var(--muted-foreground)]",
146
146
  "ds:outline-none",
147
147
  "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
@@ -224,7 +224,7 @@ const ae = [
224
224
  "ds:min-h-[var(--min-target-size)]",
225
225
  "ds:rounded-[var(--radius-sm)]",
226
226
  "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
227
- "ds:text-[var(--font-size-sm)] ds:text-[var(--foreground)]",
227
+ "ds:text-[length:var(--font-size-sm)] ds:text-[var(--foreground)]",
228
228
  "ds:cursor-pointer ds:select-none ds:outline-none",
229
229
  V.selected,
230
230
  "ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50",
@@ -472,4 +472,4 @@ export {
472
472
  ne as k,
473
473
  pe as u
474
474
  };
475
- //# sourceMappingURL=command-palette-B3dVqm9D.js.map
475
+ //# sourceMappingURL=command-palette-DxQBU4wH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-palette-DxQBU4wH.js","sources":["../../src/components/command-palette/command-palette.agent.ts","../../src/components/command-palette/command-palette.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { CommandPaletteHandle } from './command-palette';\n\nexport const commandPaletteAgent: AgentAdapter<CommandPaletteHandle> = {\n id: 'command-palette',\n // The curated handle exposes open/close + the filter query only. Running a\n // highlighted command is internal to the dialog (not on the handle), so no\n // 'submit'/'pick' capability is claimed here.\n capabilities: ['open', 'close', 'filter'],\n state: {\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.commandPalette.state.query',\n description: 'Current filter query in the command palette input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.commandPalette.state.isOpen',\n description: 'True when the palette is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.commandPalette.actions.open',\n description: 'Open the command palette.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.commandPalette.actions.close',\n description: 'Close the command palette.',\n invoke: (handle) => {\n handle.close();\n },\n },\n apply_filter: {\n safety: 'read',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'Filter text matched against command labels.',\n },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.commandPalette.actions.applyFilter',\n description: 'Set the filter query.',\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'command-palette' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-command-id',\n description: 'Each command item emits its key as data-command-id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport { Command as CommandPrimitive, defaultFilter } from 'cmdk';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { useTranslation } from 'react-i18next';\nimport { Search } from 'lucide-react';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport { useAgentRegistration } from '../../agent';\nimport { commandPaletteAgent } from './command-palette.agent';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface Command {\n id: string;\n label: string;\n group: string;\n keywords?: string[];\n shortcut?: string;\n onSelect: () => void;\n /** Optional leading icon. */\n icon?: ReactNode;\n}\n\n/* -------------------------------------------------------------------- */\n/* Diacritic-insensitive normaliser */\n/* -------------------------------------------------------------------- */\n\nfunction normalise(value: string): string {\n return value\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLowerCase();\n}\n\nexport const diacriticInsensitiveFilter = (\n value: string,\n search: string,\n keywords?: string[],\n) =>\n defaultFilter(normalise(value), normalise(search), keywords?.map(normalise));\n\n/* -------------------------------------------------------------------- */\n/* Recents (localStorage, SSR-safe) */\n/* -------------------------------------------------------------------- */\n\nconst RECENTS_KEY = 'ui.cmdk.recents';\nconst MAX_RECENTS = 5;\n\nfunction readRecents(): string[] {\n if (typeof window === 'undefined') return [];\n try {\n const raw = window.localStorage.getItem(RECENTS_KEY);\n if (!raw) return [];\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed)\n ? parsed.slice(0, MAX_RECENTS).filter((v) => typeof v === 'string')\n : [];\n } catch {\n return [];\n }\n}\n\nfunction writeRecents(ids: string[]) {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(\n RECENTS_KEY,\n JSON.stringify(ids.slice(0, MAX_RECENTS)),\n );\n } catch {\n /* noop */\n }\n}\n\n/* -------------------------------------------------------------------- */\n/* useCommandPalette — Cmd/Ctrl+K hook */\n/* -------------------------------------------------------------------- */\n\nexport function useCommandPalette() {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n function handler(event: KeyboardEvent) {\n // Cmd/Ctrl+K must work even from inside inputs; check the\n // modifier first and bail on edit-context only for plain keys.\n const isMeta = event.metaKey || event.ctrlKey;\n if (isMeta && event.key === 'k') {\n event.preventDefault();\n setOpen((v) => !v);\n return;\n }\n\n const target = event.target as HTMLElement | null;\n const tag = target?.tagName.toLowerCase();\n const isEditable =\n tag === 'input' || tag === 'textarea' || target?.isContentEditable;\n if (isEditable && !(open && event.key === 'Escape')) return;\n }\n document.addEventListener('keydown', handler);\n return () => document.removeEventListener('keydown', handler);\n }, [open]);\n\n return { open, setOpen };\n}\n\n/* -------------------------------------------------------------------- */\n/* Primitives (forwardRef wrappers around cmdk + dialog chrome) */\n/* -------------------------------------------------------------------- */\n\nconst rootClasses = [\n 'ds:flex ds:h-full ds:w-full ds:flex-col ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n].join(' ');\n\nexport type CommandPaletteRootProps = ComponentPropsWithoutRef<\n typeof CommandPrimitive\n>;\n\n// Curated agent-readiness handle — see command-palette.agent.ts.\nexport interface CommandPaletteHandle {\n getQuery: () => string;\n getIsOpen: () => boolean;\n open: () => void;\n close: () => void;\n setQuery: (query: string) => void;\n}\n\nconst CommandPalette = forwardRef<\n ElementRef<typeof CommandPrimitive>,\n CommandPaletteRootProps\n>(({ className, filter = diacriticInsensitiveFilter, id, ...rest }, ref) => (\n <CommandPrimitive\n ref={ref}\n filter={filter}\n className={[rootClasses, className].filter(Boolean).join(' ')}\n data-component=\"command-palette\"\n data-component-id={id}\n {...rest}\n />\n));\nCommandPalette.displayName = 'CommandPalette';\n\n/* -------------------------------------------------------------------- */\n/* Input */\n/* -------------------------------------------------------------------- */\n\nconst inputWrapClasses = [\n 'ds:flex ds:items-center',\n 'ds:border-block-end ds:border-[var(--border)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-sm)]',\n].join(' ');\n\nconst inputClasses = [\n 'ds:flex ds:w-full ds:bg-transparent',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:text-[length:var(--font-size-base)] ds:text-[var(--foreground)]',\n 'ds:placeholder:text-[var(--muted-foreground)]',\n 'ds:outline-none',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:border-0',\n].join(' ');\n\nexport type CommandInputProps = ComponentPropsWithoutRef<\n typeof CommandPrimitive.Input\n>;\n\nconst CommandInput = forwardRef<\n ElementRef<typeof CommandPrimitive.Input>,\n CommandInputProps\n>(({ className, placeholder, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n return (\n <div className={inputWrapClasses}>\n <Search\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:me-2 ds:text-[var(--muted-foreground)]\"\n />\n <CommandPrimitive.Input\n ref={ref}\n placeholder={\n placeholder ??\n t('navigation.cmdk.placeholder', 'Type a command or search\\u2026')\n }\n className={[inputClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n </div>\n );\n});\nCommandInput.displayName = 'CommandInput';\n\n/* -------------------------------------------------------------------- */\n/* List / Empty / Group / Item / Separator */\n/* -------------------------------------------------------------------- */\n\nconst CommandList = forwardRef<\n ElementRef<typeof CommandPrimitive.List>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...rest }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={[\n 'ds:max-h-[20rem] ds:overflow-y-auto',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:py-[var(--spacing-xs)]',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n />\n));\nCommandList.displayName = 'CommandList';\n\nconst CommandEmpty = forwardRef<\n ElementRef<typeof CommandPrimitive.Empty>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>(({ className, children, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n return (\n <CommandPrimitive.Empty\n ref={ref}\n className={[\n 'ds:py-[var(--spacing-lg)] ds:text-center',\n 'type-body-sm ds:text-[var(--muted-foreground)]',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n {children ?? t('navigation.cmdk.empty', 'No results found')}\n </CommandPrimitive.Empty>\n );\n});\nCommandEmpty.displayName = 'CommandEmpty';\n\nconst CommandGroup = forwardRef<\n ElementRef<typeof CommandPrimitive.Group>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, heading, ...rest }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n heading={heading}\n className={[\n 'ds:overflow-hidden',\n 'ds:text-[var(--foreground)]',\n 'ds:[&_[cmdk-group-heading]]:ps-[var(--spacing-sm)]',\n 'ds:[&_[cmdk-group-heading]]:pe-[var(--spacing-sm)]',\n 'ds:[&_[cmdk-group-heading]]:py-[var(--spacing-xs)]',\n 'ds:[&_[cmdk-group-heading]]:type-eyebrow',\n 'ds:[&_[cmdk-group-heading]]:text-[var(--muted-foreground)]',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n />\n));\nCommandGroup.displayName = 'CommandGroup';\n\nconst itemClasses = [\n 'ds:relative ds:flex ds:items-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:text-[length:var(--font-size-sm)] ds:text-[var(--foreground)]',\n 'ds:cursor-pointer ds:select-none ds:outline-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nexport type CommandItemProps = ComponentPropsWithoutRef<\n typeof CommandPrimitive.Item\n>;\n\nconst CommandItem = forwardRef<\n ElementRef<typeof CommandPrimitive.Item>,\n CommandItemProps\n>(({ className, ...rest }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={[itemClasses, className].filter(Boolean).join(' ')}\n {...rest}\n />\n));\nCommandItem.displayName = 'CommandItem';\n\nconst CommandSeparator = forwardRef<\n ElementRef<typeof CommandPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...rest }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={[\n 'ds:-ms-[var(--spacing-xs)] ds:-me-[var(--spacing-xs)]',\n 'ds:my-[var(--spacing-xs)]',\n 'ds:h-px ds:bg-[var(--border)]',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n />\n));\nCommandSeparator.displayName = 'CommandSeparator';\n\nexport type CommandShortcutProps = ComponentPropsWithoutRef<'kbd'>;\n\nconst CommandShortcut = forwardRef<HTMLElement, CommandShortcutProps>(\n ({ className, children, ...rest }, ref) => (\n <kbd\n ref={ref}\n className={[\n 'ds:ms-auto',\n 'ds:inline-flex ds:items-center',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:h-5 ds:rounded-[var(--radius-sm)]',\n 'ds:bg-[var(--muted)]/20 ds:text-[var(--muted-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-[var(--font-weight-medium)]',\n // On the lit row the chip matches the row fill, so an inset ring\n // keeps it a key cap.\n 'ds:group-data-[selected=true]/menu-row:ring-[length:var(--border-width-sm)] ds:group-data-[selected=true]/menu-row:ring-inset',\n 'ds:group-data-[selected=true]/menu-row:ring-[color:var(--accent-foreground)]',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n {children}\n </kbd>\n ),\n);\nCommandShortcut.displayName = 'CommandShortcut';\n\n/* -------------------------------------------------------------------- */\n/* Highlight helper */\n/* -------------------------------------------------------------------- */\n\n/**\n * Returns React nodes that wrap the matching segments of `label` in `<mark>`.\n * Diacritic-insensitive. No `dangerouslySetInnerHTML`.\n */\nexport function highlightMatch(label: string, query: string): ReactNode {\n if (!query) return label;\n const norm = normalise(label);\n const normQ = normalise(query);\n const idx = norm.indexOf(normQ);\n if (idx === -1) return label;\n // Walk the original label using character-by-character correspondence with the\n // normalised string. Since normalise may drop diacritics, we use index mapping.\n const before = label.slice(0, idx);\n const match = label.slice(idx, idx + normQ.length);\n const after = label.slice(idx + normQ.length);\n return (\n <>\n {before}\n <mark className=\"ds:bg-[var(--accent)]/20 ds:text-inherit ds:rounded-[var(--radius-sm)] ds:px-[0.125em] ds:group-data-[selected=true]/menu-row:bg-transparent ds:group-data-[selected=true]/menu-row:underline\">\n {match}\n </mark>\n {after}\n </>\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* CommandPaletteDialog — Dialog shell + commands-as-data API */\n/* -------------------------------------------------------------------- */\n\nexport interface CommandPaletteDialogProps {\n /** Controlled open state. */\n open: boolean;\n /** Fires when the dialog opens/closes. */\n onOpenChange: (open: boolean) => void;\n /** Commands to display. */\n commands: Command[];\n /** Extra content rendered above the input (optional). */\n header?: ReactNode;\n /** Stable id for agent registration / DOM addressing. */\n id?: string;\n}\n\nconst overlayClasses = [\n 'ds:fixed ds:inset-0 ds:z-[var(--z-modal-backdrop)]',\n 'ds:bg-[var(--background)]/70 ds:backdrop-blur-sm',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=open]:fade-in ds:data-[state=closed]:fade-out',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst dialogContentClasses = [\n 'ds:fixed ds:z-[var(--z-modal)]',\n // Logical-inset arbitrary-value positioning: `inset-inline-start-1/2`\n // isn't a real Tailwind class (the generator maps fractions only to\n // `start-*`), so use `start-1/2` for horizontal and `top-*` for the\n // top offset — matching the working Dialog component.\n 'ds:top-[12vh] ds:start-1/2 ds:-translate-x-1/2 ds:rtl:translate-x-1/2',\n 'ds:w-[92vw] ds:max-w-[var(--dialog-width-lg)]',\n 'ds:rounded-[var(--radius-lg)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:shadow-[var(--shadow-xl)]',\n 'ds:border ds:border-[var(--border)]',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=open]:zoom-in-95 ds:data-[state=closed]:zoom-out-95',\n 'ds:motion-reduce:animate-none',\n 'ds:focus:outline-none',\n].join(' ');\n\nconst VisuallyHidden = ({ children }: { children: ReactNode }) => (\n <span className=\"ds:sr-only\">{children}</span>\n);\n\nfunction CommandPaletteDialog({\n open,\n onOpenChange,\n commands,\n header,\n id,\n}: CommandPaletteDialogProps) {\n const { t } = useTranslation('ui');\n const [search, setSearch] = useState('');\n const [recents, setRecents] = useState<string[]>(readRecents);\n\n useEffect(() => {\n if (!open) setSearch('');\n }, [open]);\n\n // Agent handle — refs mirror state for fresh reads from the memoized handle.\n const openRef = useRef(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n const searchRef = useRef(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const onOpenChangeRef = useRef(onOpenChange);\n useEffect(() => {\n onOpenChangeRef.current = onOpenChange;\n }, [onOpenChange]);\n\n const agentHandle = useMemo<CommandPaletteHandle>(\n () => ({\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n open: () => onOpenChangeRef.current(true),\n close: () => onOpenChangeRef.current(false),\n setQuery: (query) => setSearch(query),\n }),\n [],\n );\n useAgentRegistration(commandPaletteAgent, agentHandle, id);\n\n const grouped = useMemo(() => {\n const byGroup = new Map<string, Command[]>();\n commands.forEach((c) => {\n const list = byGroup.get(c.group) ?? [];\n list.push(c);\n byGroup.set(c.group, list);\n });\n return byGroup;\n }, [commands]);\n\n const recentCommands = useMemo(() => {\n if (search) return [];\n const byId = new Map(commands.map((c) => [c.id, c]));\n return recents.map((id) => byId.get(id)).filter(Boolean) as Command[];\n }, [commands, recents, search]);\n\n const runCommand = useCallback(\n (cmd: Command) => {\n onOpenChange(false);\n const next = [cmd.id, ...recents.filter((id) => id !== cmd.id)].slice(\n 0,\n MAX_RECENTS,\n );\n setRecents(next);\n writeRecents(next);\n // Defer so Dialog unmount doesn't swallow the callback\n setTimeout(() => cmd.onSelect(), 0);\n },\n [recents, onOpenChange],\n );\n\n const clearRecents = useCallback(() => {\n setRecents([]);\n writeRecents([]);\n }, []);\n\n return (\n <RadixDialog.Root open={open} onOpenChange={onOpenChange}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n data-component=\"command-palette-overlay\"\n className={overlayClasses}\n />\n <RadixDialog.Content\n data-component=\"command-palette-dialog\"\n className={dialogContentClasses}\n aria-label={t('navigation.cmdk.title', 'Command palette')}\n >\n <RadixDialog.Title asChild>\n <VisuallyHidden>\n {t('navigation.cmdk.title', 'Command palette')}\n </VisuallyHidden>\n </RadixDialog.Title>\n <RadixDialog.Description asChild>\n <VisuallyHidden>\n {t(\n 'navigation.cmdk.description',\n 'Search for commands, pages, and actions',\n )}\n </VisuallyHidden>\n </RadixDialog.Description>\n <CommandPalette\n id={id}\n label={t('navigation.cmdk.title', 'Command palette')}\n >\n {header}\n <CommandInput value={search} onValueChange={setSearch} />\n <CommandList label={t('navigation.cmdk.title', 'Command palette')}>\n <CommandEmpty />\n {recentCommands.length > 0 ? (\n <>\n <CommandGroup\n heading={t('navigation.cmdk.recents', 'Recent')}\n >\n {recentCommands.map((cmd) => (\n <CommandItem\n key={`recent-${cmd.id}`}\n value={`recent-${cmd.label}`}\n data-command-id={cmd.id}\n onSelect={() => runCommand(cmd)}\n >\n {cmd.icon ? (\n <span aria-hidden=\"true\">{cmd.icon}</span>\n ) : null}\n <span>{cmd.label}</span>\n {cmd.shortcut ? (\n <CommandShortcut>{cmd.shortcut}</CommandShortcut>\n ) : null}\n </CommandItem>\n ))}\n <CommandItem\n value=\"__clear-recents\"\n onSelect={clearRecents}\n >\n <span>\n {t(\n 'navigation.cmdk.clearRecents',\n 'Clear recent commands',\n )}\n </span>\n </CommandItem>\n </CommandGroup>\n <CommandSeparator />\n </>\n ) : null}\n {Array.from(grouped.entries()).map(([group, list]) => (\n <CommandGroup key={group} heading={group}>\n {list.map((cmd) => (\n <CommandItem\n key={cmd.id}\n value={cmd.label}\n data-command-id={cmd.id}\n keywords={cmd.keywords}\n onSelect={() => runCommand(cmd)}\n >\n {cmd.icon ? (\n <span aria-hidden=\"true\">{cmd.icon}</span>\n ) : null}\n <span>{highlightMatch(cmd.label, search)}</span>\n {cmd.shortcut ? (\n <CommandShortcut>{cmd.shortcut}</CommandShortcut>\n ) : null}\n </CommandItem>\n ))}\n </CommandGroup>\n ))}\n </CommandList>\n </CommandPalette>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n\nexport {\n CommandPalette,\n CommandPaletteDialog,\n CommandInput,\n CommandList,\n CommandGroup,\n CommandItem,\n CommandEmpty,\n CommandSeparator,\n CommandShortcut,\n};\n"],"names":["commandPaletteAgent","handle","args","normalise","value","diacriticInsensitiveFilter","search","keywords","defaultFilter","RECENTS_KEY","MAX_RECENTS","readRecents","raw","parsed","v","writeRecents","ids","useCommandPalette","open","setOpen","useState","useEffect","handler","event","target","tag","rootClasses","CommandPalette","forwardRef","className","filter","id","rest","ref","jsx","CommandPrimitive","inputWrapClasses","inputClasses","CommandInput","placeholder","t","useTranslation","jsxs","Search","CommandList","CommandEmpty","children","CommandGroup","heading","itemClasses","MENU_ROW_HIGHLIGHT","CommandItem","CommandSeparator","CommandShortcut","highlightMatch","label","query","norm","normQ","idx","before","match","after","Fragment","overlayClasses","dialogContentClasses","VisuallyHidden","CommandPaletteDialog","onOpenChange","commands","header","setSearch","recents","setRecents","openRef","useRef","searchRef","onOpenChangeRef","agentHandle","useMemo","useAgentRegistration","grouped","byGroup","list","recentCommands","byId","runCommand","useCallback","cmd","next","clearRecents","RadixDialog","group"],"mappings":";;;;;;;;AAGO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,QAAQ,SAAS,QAAQ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