@alfadocs/ui-kit-debug 1.5.0 → 1.6.1

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 (419) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js → actions-cell-renderer-ALEAGO3j.js} +6 -6
  2. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js.map → actions-cell-renderer-ALEAGO3j.js.map} +1 -1
  3. package/dist/_chunks/{agenda-tray-CYR-znfE.js → agenda-tray-BweO8pDo.js} +3 -3
  4. package/dist/_chunks/{agenda-tray-CYR-znfE.js.map → agenda-tray-BweO8pDo.js.map} +1 -1
  5. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js → ai-consent-banner-OggpS5hW.js} +2 -2
  6. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js.map → ai-consent-banner-OggpS5hW.js.map} +1 -1
  7. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js → ai-prompt-input-DnbfEJnr.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js.map → ai-prompt-input-DnbfEJnr.js.map} +1 -1
  9. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js → alia-sidebar-BWcWZivN.js} +7 -7
  10. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js.map → alia-sidebar-BWcWZivN.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-card-BylMLHYj.js → anamnesis-card-NTi4LLzI.js} +2 -2
  12. package/dist/_chunks/{anamnesis-card-BylMLHYj.js.map → anamnesis-card-NTi4LLzI.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js → anamnesis-summary-rows-F-cCmFAn.js} +7 -7
  14. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js.map → anamnesis-summary-rows-F-cCmFAn.js.map} +1 -1
  15. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js → appointment-timeline-CMPvzlGZ.js} +4 -4
  16. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js.map → appointment-timeline-CMPvzlGZ.js.map} +1 -1
  17. package/dist/_chunks/{appointment-tray-DvyVK7um.js → appointment-tray-3c_FLxXJ.js} +3 -3
  18. package/dist/_chunks/{appointment-tray-DvyVK7um.js.map → appointment-tray-3c_FLxXJ.js.map} +1 -1
  19. package/dist/_chunks/{audio-recorder-nVRN4PSK.js → audio-recorder-EWBCNIsd.js} +3 -3
  20. package/dist/_chunks/{audio-recorder-nVRN4PSK.js.map → audio-recorder-EWBCNIsd.js.map} +1 -1
  21. package/dist/_chunks/{bishop-score-BV1JAEMV.js → bishop-score-Cnu0xs-z.js} +2 -2
  22. package/dist/_chunks/{bishop-score-BV1JAEMV.js.map → bishop-score-Cnu0xs-z.js.map} +1 -1
  23. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js → bmi-calculator-CcH6upht.js} +2 -2
  24. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js.map → bmi-calculator-CcH6upht.js.map} +1 -1
  25. package/dist/_chunks/{booking-CGKof8QU.js → booking-CQMJUFG-.js} +556 -549
  26. package/dist/_chunks/booking-CQMJUFG-.js.map +1 -0
  27. package/dist/_chunks/{button-group-Be_In68J.js → button-group-CaxRJsNG.js} +2 -2
  28. package/dist/_chunks/{button-group-Be_In68J.js.map → button-group-CaxRJsNG.js.map} +1 -1
  29. package/dist/_chunks/{button-BvNtqHAS.js → button-nJaPh_HC.js} +68 -38
  30. package/dist/_chunks/button-nJaPh_HC.js.map +1 -0
  31. package/dist/_chunks/{care-plan-card-CehAU7F_.js → care-plan-card-DQjVRDxO.js} +2 -2
  32. package/dist/_chunks/{care-plan-card-CehAU7F_.js.map → care-plan-card-DQjVRDxO.js.map} +1 -1
  33. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js → care-plan-entry-card-CMpoeNkb.js} +2 -2
  34. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js.map → care-plan-entry-card-CMpoeNkb.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-header-_B0TTWT1.js → care-plan-header-CxYoq23f.js} +2 -2
  36. package/dist/_chunks/{care-plan-header-_B0TTWT1.js.map → care-plan-header-CxYoq23f.js.map} +1 -1
  37. package/dist/_chunks/{carousel.agent-pjORsMS8.js → carousel.agent-CLxdHEBP.js} +2 -2
  38. package/dist/_chunks/{carousel.agent-pjORsMS8.js.map → carousel.agent-CLxdHEBP.js.map} +1 -1
  39. package/dist/_chunks/{chart-Y-gso_Uz.js → chart-Bkr1Sh4o.js} +3 -3
  40. package/dist/_chunks/{chart-Y-gso_Uz.js.map → chart-Bkr1Sh4o.js.map} +1 -1
  41. package/dist/_chunks/{chat-input-BqI9GXQh.js → chat-input-BsB5Umpj.js} +2 -2
  42. package/dist/_chunks/{chat-input-BqI9GXQh.js.map → chat-input-BsB5Umpj.js.map} +1 -1
  43. package/dist/_chunks/{chat-message-DHNUbjXA.js → chat-message-DBQu10rs.js} +3 -3
  44. package/dist/_chunks/{chat-message-DHNUbjXA.js.map → chat-message-DBQu10rs.js.map} +1 -1
  45. package/dist/_chunks/{code-block-BONe9fJi.js → code-block-BIkpRLkl.js} +2 -2
  46. package/dist/_chunks/{code-block-BONe9fJi.js.map → code-block-BIkpRLkl.js.map} +1 -1
  47. package/dist/_chunks/{connection-status-NT8hUtYl.js → connection-status-DRZIcMqM.js} +3 -3
  48. package/dist/_chunks/{connection-status-NT8hUtYl.js.map → connection-status-DRZIcMqM.js.map} +1 -1
  49. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js → contact-profile-card-CE9OJKcl.js} +2 -2
  50. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js.map → contact-profile-card-CE9OJKcl.js.map} +1 -1
  51. package/dist/_chunks/{control-room-rail-DDyPDBji.js → control-room-rail-IH1eBjrK.js} +3 -3
  52. package/dist/_chunks/{control-room-rail-DDyPDBji.js.map → control-room-rail-IH1eBjrK.js.map} +1 -1
  53. package/dist/_chunks/{copy-field-B-DoMBH_.js → copy-field-fYKpl6aN.js} +2 -2
  54. package/dist/_chunks/{copy-field-B-DoMBH_.js.map → copy-field-fYKpl6aN.js.map} +1 -1
  55. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js → cycle-calculator-DzgO1vzP.js} +2 -2
  56. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js.map → cycle-calculator-DzgO1vzP.js.map} +1 -1
  57. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js → dashboard-grid-BFtdHqfn.js} +2 -2
  58. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js.map → dashboard-grid-BFtdHqfn.js.map} +1 -1
  59. package/dist/_chunks/{data-table-tabs-C8uDThT3.js → data-table-tabs-C1kRUzat.js} +3 -3
  60. package/dist/_chunks/{data-table-tabs-C8uDThT3.js.map → data-table-tabs-C1kRUzat.js.map} +1 -1
  61. package/dist/_chunks/{description-list-Ck7fKdt5.js → description-list-CjJqR8WK.js} +2 -2
  62. package/dist/_chunks/{description-list-Ck7fKdt5.js.map → description-list-CjJqR8WK.js.map} +1 -1
  63. package/dist/_chunks/{document-preview-Aae2yKvY.js → document-preview-oyx9RhCo.js} +2 -2
  64. package/dist/_chunks/{document-preview-Aae2yKvY.js.map → document-preview-oyx9RhCo.js.map} +1 -1
  65. package/dist/_chunks/{document-scanner-qNZLhH_r.js → document-scanner-C5Vrbu21.js} +2 -2
  66. package/dist/_chunks/{document-scanner-qNZLhH_r.js.map → document-scanner-C5Vrbu21.js.map} +1 -1
  67. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js → due-date-calculator-wK8Tajzz.js} +2 -2
  68. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js.map → due-date-calculator-wK8Tajzz.js.map} +1 -1
  69. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js → editable-currency-cell-renderer-DYdzKpjL.js} +3 -3
  70. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js.map → editable-currency-cell-renderer-DYdzKpjL.js.map} +1 -1
  71. package/dist/_chunks/{editor-overlay-DE-gxj9L.js → editor-overlay-DEc5yYwo.js} +2 -2
  72. package/dist/_chunks/{editor-overlay-DE-gxj9L.js.map → editor-overlay-DEc5yYwo.js.map} +1 -1
  73. package/dist/_chunks/{empty-state-Df0tM6Kn.js → empty-state-X0sVPfVo.js} +2 -2
  74. package/dist/_chunks/{empty-state-Df0tM6Kn.js.map → empty-state-X0sVPfVo.js.map} +1 -1
  75. package/dist/_chunks/{entity-summary-DBOI5di6.js → entity-summary-B_vO5Ur4.js} +3 -3
  76. package/dist/_chunks/{entity-summary-DBOI5di6.js.map → entity-summary-B_vO5Ur4.js.map} +1 -1
  77. package/dist/_chunks/{face-scheme-D7Pub04e.js → face-scheme-BfDi4YkW.js} +5 -5
  78. package/dist/_chunks/{face-scheme-D7Pub04e.js.map → face-scheme-BfDi4YkW.js.map} +1 -1
  79. package/dist/_chunks/{fetal-weight-jon6GIfQ.js → fetal-weight-Dqy0T1fP.js} +2 -2
  80. package/dist/_chunks/{fetal-weight-jon6GIfQ.js.map → fetal-weight-Dqy0T1fP.js.map} +1 -1
  81. package/dist/_chunks/{field-array-BQFX5OYi.js → field-array-BjkXZzSr.js} +3 -3
  82. package/dist/_chunks/{field-array-BQFX5OYi.js.map → field-array-BjkXZzSr.js.map} +1 -1
  83. package/dist/_chunks/{field-value-BbiDRyNh.js → field-value-DG8zaZvo.js} +4 -4
  84. package/dist/_chunks/{field-value-BbiDRyNh.js.map → field-value-DG8zaZvo.js.map} +1 -1
  85. package/dist/_chunks/{file-manager-CML_C6_h.js → file-manager-Cc_upjZX.js} +6 -6
  86. package/dist/_chunks/{file-manager-CML_C6_h.js.map → file-manager-Cc_upjZX.js.map} +1 -1
  87. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js → finished-terminal-Br61Ip4e.js} +2 -2
  88. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js.map → finished-terminal-Br61Ip4e.js.map} +1 -1
  89. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js → fiscal-code-input-B_nYMSEM.js} +2 -2
  90. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js.map → fiscal-code-input-B_nYMSEM.js.map} +1 -1
  91. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js → freemium-paywall-DrXzYfv-.js} +2 -2
  92. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js.map → freemium-paywall-DrXzYfv-.js.map} +1 -1
  93. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js → gestational-age-calculator-C_uDAeP_.js} +2 -2
  94. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js.map → gestational-age-calculator-C_uDAeP_.js.map} +1 -1
  95. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js → hcg-doubling-BaXkJhT-.js} +2 -2
  96. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js.map → hcg-doubling-BaXkJhT-.js.map} +1 -1
  97. package/dist/_chunks/{header-CimZS-J9.js → header-DUXRIPyM.js} +2 -2
  98. package/dist/_chunks/{header-CimZS-J9.js.map → header-DUXRIPyM.js.map} +1 -1
  99. package/dist/_chunks/{header-settings-C0zHLXJE.js → header-settings-CVC_davE.js} +4 -4
  100. package/dist/_chunks/{header-settings-C0zHLXJE.js.map → header-settings-CVC_davE.js.map} +1 -1
  101. package/dist/_chunks/{icon-button-9c9Gp41m.js → icon-button-DA2CAGHZ.js} +2 -2
  102. package/dist/_chunks/{icon-button-9c9Gp41m.js.map → icon-button-DA2CAGHZ.js.map} +1 -1
  103. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js → icon-button-group-D6SVMteH.js} +2 -2
  104. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js.map → icon-button-group-D6SVMteH.js.map} +1 -1
  105. package/dist/_chunks/{icon-picker-DXV3sDp1.js → icon-picker-ChzpCnZ-.js} +3 -3
  106. package/dist/_chunks/{icon-picker-DXV3sDp1.js.map → icon-picker-ChzpCnZ-.js.map} +1 -1
  107. package/dist/_chunks/{image-cropper-DWSnyLwW.js → image-cropper-C84NDTB7.js} +2 -2
  108. package/dist/_chunks/{image-cropper-DWSnyLwW.js.map → image-cropper-C84NDTB7.js.map} +1 -1
  109. package/dist/_chunks/{info-tip-C4mPSJbS.js → info-tip-C119cwQl.js} +2 -2
  110. package/dist/_chunks/{info-tip-C4mPSJbS.js.map → info-tip-C119cwQl.js.map} +1 -1
  111. package/dist/_chunks/{insert-result-98J1QEp7.js → insert-result-LCNTskNJ.js} +2 -2
  112. package/dist/_chunks/{insert-result-98J1QEp7.js.map → insert-result-LCNTskNJ.js.map} +1 -1
  113. package/dist/_chunks/{key-value-pair-DGkGlgCF.js → key-value-pair-BubG4fUa.js} +2 -2
  114. package/dist/_chunks/{key-value-pair-DGkGlgCF.js.map → key-value-pair-BubG4fUa.js.map} +1 -1
  115. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js → link-cell-renderer-DH4JYpKU.js} +2 -2
  116. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js.map → link-cell-renderer-DH4JYpKU.js.map} +1 -1
  117. package/dist/_chunks/{locale-picker-sI0HWgZy.js → locale-picker-BvbVjDQ-.js} +3 -3
  118. package/dist/_chunks/{locale-picker-sI0HWgZy.js.map → locale-picker-BvbVjDQ-.js.map} +1 -1
  119. package/dist/_chunks/{map-view-iwSDRW3t.js → map-view-CCAlC9IL.js} +2 -2
  120. package/dist/_chunks/{map-view-iwSDRW3t.js.map → map-view-CCAlC9IL.js.map} +1 -1
  121. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js → marketplace-app-shell-Chfdia7m.js} +4 -4
  122. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js.map → marketplace-app-shell-Chfdia7m.js.map} +1 -1
  123. package/dist/_chunks/{message-card-BCJ-Jgs6.js → message-card-D8GB4FdF.js} +3 -3
  124. package/dist/_chunks/{message-card-BCJ-Jgs6.js.map → message-card-D8GB4FdF.js.map} +1 -1
  125. package/dist/_chunks/{message-tray-DHtm_WaF.js → message-tray-CGIRQjx5.js} +4 -4
  126. package/dist/_chunks/{message-tray-DHtm_WaF.js.map → message-tray-CGIRQjx5.js.map} +1 -1
  127. package/dist/_chunks/{notes-panel-D6HKLLS-.js → notes-panel-DlnENphf.js} +3 -3
  128. package/dist/_chunks/{notes-panel-D6HKLLS-.js.map → notes-panel-DlnENphf.js.map} +1 -1
  129. package/dist/_chunks/{notification-card-CcMQn2RX.js → notification-card-CtrzoTUO.js} +3 -3
  130. package/dist/_chunks/{notification-card-CcMQn2RX.js.map → notification-card-CtrzoTUO.js.map} +1 -1
  131. package/dist/_chunks/{notification-tray-nr7dv-Q8.js → notification-tray-BiRzXHDf.js} +4 -4
  132. package/dist/_chunks/{notification-tray-nr7dv-Q8.js.map → notification-tray-BiRzXHDf.js.map} +1 -1
  133. package/dist/_chunks/{optical-prescription-DtzEqFQm.js → optical-prescription-Dj3Eh5Ok.js} +2 -2
  134. package/dist/_chunks/{optical-prescription-DtzEqFQm.js.map → optical-prescription-Dj3Eh5Ok.js.map} +1 -1
  135. package/dist/_chunks/{patient-details-rENrE_qY.js → patient-details-qnsqYBGQ.js} +5 -5
  136. package/dist/_chunks/{patient-details-rENrE_qY.js.map → patient-details-qnsqYBGQ.js.map} +1 -1
  137. package/dist/_chunks/{patient-search-NQemeJlL.js → patient-search-D5ufYoRc.js} +2 -2
  138. package/dist/_chunks/{patient-search-NQemeJlL.js.map → patient-search-D5ufYoRc.js.map} +1 -1
  139. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js → patient-summary-card-CBfuDvJ5.js} +3 -3
  140. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js.map → patient-summary-card-CBfuDvJ5.js.map} +1 -1
  141. package/dist/_chunks/{patient-table-BubxfOWL.js → patient-table-DwshfVsQ.js} +3 -3
  142. package/dist/_chunks/{patient-table-BubxfOWL.js.map → patient-table-DwshfVsQ.js.map} +1 -1
  143. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js → payment-automation-upsell-BBIG7NFL.js} +2 -2
  144. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js.map → payment-automation-upsell-BBIG7NFL.js.map} +1 -1
  145. package/dist/_chunks/{payment-request-card-CvhDzDNk.js → payment-request-card-BjjBMdsp.js} +3 -3
  146. package/dist/_chunks/{payment-request-card-CvhDzDNk.js.map → payment-request-card-BjjBMdsp.js.map} +1 -1
  147. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js → periodontal-chart-BatZEFar.js} +2 -2
  148. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js.map → periodontal-chart-BatZEFar.js.map} +1 -1
  149. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js → periodontal-chart-card-BBpY_rBc.js} +2 -2
  150. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js.map → periodontal-chart-card-BBpY_rBc.js.map} +1 -1
  151. package/dist/_chunks/{popover-Btj6N25H.js → popover-Cqcjx-Ny.js} +2 -2
  152. package/dist/_chunks/{popover-Btj6N25H.js.map → popover-Cqcjx-Ny.js.map} +1 -1
  153. package/dist/_chunks/practice-profile-hero-Bdd0bFqC.js +187 -0
  154. package/dist/_chunks/practice-profile-hero-Bdd0bFqC.js.map +1 -0
  155. package/dist/_chunks/{practice-results-DWUZRm2x.js → practice-results-F_Rf7c4H.js} +224 -210
  156. package/dist/_chunks/practice-results-F_Rf7c4H.js.map +1 -0
  157. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js → pregnancy-dating-BVS_9YU2.js} +2 -2
  158. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js.map → pregnancy-dating-BVS_9YU2.js.map} +1 -1
  159. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js → pregnancy-weight-gain-CJwbs9W-.js} +2 -2
  160. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js.map → pregnancy-weight-gain-CJwbs9W-.js.map} +1 -1
  161. package/dist/_chunks/{privacy-lock-SQYFRSuH.js → privacy-lock-CkAUo6Dz.js} +3 -3
  162. package/dist/_chunks/{privacy-lock-SQYFRSuH.js.map → privacy-lock-CkAUo6Dz.js.map} +1 -1
  163. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js → product-hub-panel-BScCotGD.js} +3 -3
  164. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js.map → product-hub-panel-BScCotGD.js.map} +1 -1
  165. package/dist/_chunks/{public-header.agent-DseNK2NQ.js → public-header.agent-kth2SdXn.js} +3 -3
  166. package/dist/_chunks/{public-header.agent-DseNK2NQ.js.map → public-header.agent-kth2SdXn.js.map} +1 -1
  167. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js → radiograph-panel.agent-CiHwgISa.js} +4 -4
  168. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js.map → radiograph-panel.agent-CiHwgISa.js.map} +1 -1
  169. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js → reviews-panel-BKHEfqVQ.js} +4 -4
  170. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js.map → reviews-panel-BKHEfqVQ.js.map} +1 -1
  171. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js → rich-text-editor-DARnq_6N.js} +5 -5
  172. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js.map → rich-text-editor-DARnq_6N.js.map} +1 -1
  173. package/dist/_chunks/{session-countdown-q4r5TlCo.js → session-countdown-QMsnRa1x.js} +2 -2
  174. package/dist/_chunks/{session-countdown-q4r5TlCo.js.map → session-countdown-QMsnRa1x.js.map} +1 -1
  175. package/dist/_chunks/{sheet-CD99CdXr.js → sheet-BSznOyJs.js} +2 -2
  176. package/dist/_chunks/{sheet-CD99CdXr.js.map → sheet-BSznOyJs.js.map} +1 -1
  177. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js → sign-in-with-alfadocs-button-BLe_quy5.js} +2 -2
  178. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js.map → sign-in-with-alfadocs-button-BLe_quy5.js.map} +1 -1
  179. package/dist/_chunks/{signature-request-C4UBfVRZ.js → signature-request-DXhpphlp.js} +4 -4
  180. package/dist/_chunks/{signature-request-C4UBfVRZ.js.map → signature-request-DXhpphlp.js.map} +1 -1
  181. package/dist/_chunks/{slot-grid-P_e9p5t5.js → slot-grid-BuZOKfcd.js} +4 -4
  182. package/dist/_chunks/{slot-grid-P_e9p5t5.js.map → slot-grid-BuZOKfcd.js.map} +1 -1
  183. package/dist/_chunks/{streaming-text-BuW7I0Zu.js → streaming-text-CvsjIQ7S.js} +2 -2
  184. package/dist/_chunks/{streaming-text-BuW7I0Zu.js.map → streaming-text-CvsjIQ7S.js.map} +1 -1
  185. package/dist/_chunks/{task-tray-BT288xoM.js → task-tray-CYG6rj2s.js} +3 -3
  186. package/dist/_chunks/{task-tray-BT288xoM.js.map → task-tray-CYG6rj2s.js.map} +1 -1
  187. package/dist/_chunks/{tasks-panel-BBkZuejF.js → tasks-panel-Do5SFp-j.js} +5 -5
  188. package/dist/_chunks/{tasks-panel-BBkZuejF.js.map → tasks-panel-Do5SFp-j.js.map} +1 -1
  189. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js → theme-toggle-DuMhQNFS.js} +3 -3
  190. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js.map → theme-toggle-DuMhQNFS.js.map} +1 -1
  191. package/dist/_chunks/{toast.agent-C44mtGrW.js → toast.agent-D1tdg6DS.js} +2 -2
  192. package/dist/_chunks/{toast.agent-C44mtGrW.js.map → toast.agent-D1tdg6DS.js.map} +1 -1
  193. package/dist/_chunks/{token-insert-menu-D8FgXl33.js → token-insert-menu-9Um0JinI.js} +2 -2
  194. package/dist/_chunks/{token-insert-menu-D8FgXl33.js.map → token-insert-menu-9Um0JinI.js.map} +1 -1
  195. package/dist/_chunks/{tool-rail-BF3F2Ihq.js → tool-rail-CHyUmulN.js} +2 -2
  196. package/dist/_chunks/{tool-rail-BF3F2Ihq.js.map → tool-rail-CHyUmulN.js.map} +1 -1
  197. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js → tooth-scheme-WdyVymQ1.js} +3 -3
  198. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js.map → tooth-scheme-WdyVymQ1.js.map} +1 -1
  199. package/dist/_chunks/{unit-converter-iDxlxKmm.js → unit-converter-BPumXMA6.js} +2 -2
  200. package/dist/_chunks/{unit-converter-iDxlxKmm.js.map → unit-converter-BPumXMA6.js.map} +1 -1
  201. package/dist/_chunks/{warning-stack-nczJf52p.js → warning-stack-DQz0Jyir.js} +3 -3
  202. package/dist/_chunks/{warning-stack-nczJf52p.js.map → warning-stack-DQz0Jyir.js.map} +1 -1
  203. package/dist/_chunks/{workflow-map-BVofnDYh.js → workflow-map-DE_ribRM.js} +5 -5
  204. package/dist/_chunks/{workflow-map-BVofnDYh.js.map → workflow-map-DE_ribRM.js.map} +1 -1
  205. package/dist/agent-catalog.json +33 -36
  206. package/dist/agent-i18n/en.json +6 -5
  207. package/dist/components/agenda-tray/index.js +1 -1
  208. package/dist/components/ai-consent-banner/index.js +1 -1
  209. package/dist/components/ai-prompt-input/index.js +1 -1
  210. package/dist/components/anamnesis-card/index.js +1 -1
  211. package/dist/components/appointment-card/index.js +1 -1
  212. package/dist/components/appointment-timeline/index.js +1 -1
  213. package/dist/components/audio-recorder/index.js +1 -1
  214. package/dist/components/bishop-score/index.js +1 -1
  215. package/dist/components/bmi-calculator/index.js +1 -1
  216. package/dist/components/booking/booking-types.d.ts +9 -0
  217. package/dist/components/booking/booking-types.d.ts.map +1 -1
  218. package/dist/components/booking/booking.d.ts.map +1 -1
  219. package/dist/components/booking/index.js +1 -1
  220. package/dist/components/button/button.d.ts +10 -0
  221. package/dist/components/button/button.d.ts.map +1 -1
  222. package/dist/components/button/index.js +2 -2
  223. package/dist/components/button-group/index.js +1 -1
  224. package/dist/components/care-plan-card/index.js +1 -1
  225. package/dist/components/care-plan-entry-card/index.js +1 -1
  226. package/dist/components/care-plan-header/index.js +1 -1
  227. package/dist/components/carousel/index.js +1 -1
  228. package/dist/components/chart/index.js +1 -1
  229. package/dist/components/chat-input/index.js +1 -1
  230. package/dist/components/chat-message/index.js +1 -1
  231. package/dist/components/connection-status/index.js +1 -1
  232. package/dist/components/contact-profile-card/index.js +1 -1
  233. package/dist/components/control-room-rail/index.js +1 -1
  234. package/dist/components/copy-field/index.js +1 -1
  235. package/dist/components/cycle-calculator/index.js +1 -1
  236. package/dist/components/dashboard-grid/index.js +1 -1
  237. package/dist/components/data-table/index.js +3 -3
  238. package/dist/components/data-table-tabs/index.js +1 -1
  239. package/dist/components/description-list/index.js +1 -1
  240. package/dist/components/document-preview/index.js +1 -1
  241. package/dist/components/document-scanner/index.js +1 -1
  242. package/dist/components/due-date-calculator/index.js +1 -1
  243. package/dist/components/editor-overlay/index.js +1 -1
  244. package/dist/components/empty-state/index.js +1 -1
  245. package/dist/components/entity-summary/index.js +1 -1
  246. package/dist/components/face-scheme/index.js +1 -1
  247. package/dist/components/fetal-weight/index.js +1 -1
  248. package/dist/components/field-array/index.js +1 -1
  249. package/dist/components/file-manager/index.js +1 -1
  250. package/dist/components/finished-terminal/index.js +1 -1
  251. package/dist/components/fiscal-code-input/index.js +1 -1
  252. package/dist/components/freemium-paywall/index.js +1 -1
  253. package/dist/components/gestational-age-calculator/index.js +1 -1
  254. package/dist/components/hcg-doubling/index.js +1 -1
  255. package/dist/components/header/index.js +1 -1
  256. package/dist/components/header-settings/index.js +1 -1
  257. package/dist/components/icon-button/index.js +1 -1
  258. package/dist/components/icon-button-group/index.js +1 -1
  259. package/dist/components/icon-picker/index.js +1 -1
  260. package/dist/components/image-cropper/index.js +1 -1
  261. package/dist/components/index.d.ts +1 -0
  262. package/dist/components/index.d.ts.map +1 -1
  263. package/dist/components/info-tip/index.js +1 -1
  264. package/dist/components/key-value-pair/index.js +1 -1
  265. package/dist/components/locale-picker/index.js +1 -1
  266. package/dist/components/map-view/index.js +1 -1
  267. package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
  268. package/dist/components/message-card/index.js +1 -1
  269. package/dist/components/message-tray/index.js +1 -1
  270. package/dist/components/notes-panel/index.js +1 -1
  271. package/dist/components/notification-card/index.js +1 -1
  272. package/dist/components/notification-tray/index.js +1 -1
  273. package/dist/components/optical-prescription/index.js +1 -1
  274. package/dist/components/patient-details/index.js +1 -1
  275. package/dist/components/patient-search/index.js +1 -1
  276. package/dist/components/patient-summary-card/index.js +1 -1
  277. package/dist/components/patient-table/index.js +1 -1
  278. package/dist/components/payment-card/index.js +1 -1
  279. package/dist/components/periodontal-chart/index.js +1 -1
  280. package/dist/components/periodontal-chart-card/index.js +1 -1
  281. package/dist/components/popover/index.js +1 -1
  282. package/dist/components/practice-profile-hero/index.d.ts +4 -0
  283. package/dist/components/practice-profile-hero/index.d.ts.map +1 -0
  284. package/dist/components/practice-profile-hero/index.js +6 -0
  285. package/dist/components/practice-profile-hero/index.js.map +1 -0
  286. package/dist/components/practice-profile-hero/practice-profile-hero.agent.d.ts +4 -0
  287. package/dist/components/practice-profile-hero/practice-profile-hero.agent.d.ts.map +1 -0
  288. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +60 -0
  289. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -0
  290. package/dist/components/practice-results/index.js +1 -1
  291. package/dist/components/practice-results/practice-results.d.ts +15 -1
  292. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  293. package/dist/components/pregnancy-dating/index.js +1 -1
  294. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  295. package/dist/components/privacy-lock/index.js +1 -1
  296. package/dist/components/product-hub-tray/index.js +1 -1
  297. package/dist/components/public-header/index.js +1 -1
  298. package/dist/components/public-header/public-header.d.ts +1 -1
  299. package/dist/components/radiograph-panel/index.js +1 -1
  300. package/dist/components/reviews-panel/index.js +1 -1
  301. package/dist/components/rich-text-editor/index.js +1 -1
  302. package/dist/components/session-countdown/index.js +1 -1
  303. package/dist/components/sheet/index.js +1 -1
  304. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  305. package/dist/components/slot-grid/index.js +1 -1
  306. package/dist/components/streaming-text/index.js +1 -1
  307. package/dist/components/task-tray/index.js +1 -1
  308. package/dist/components/tasks-panel/index.js +1 -1
  309. package/dist/components/theme-toggle/index.js +1 -1
  310. package/dist/components/toast/index.js +1 -1
  311. package/dist/components/token-insert-menu/index.js +1 -1
  312. package/dist/components/tool-rail/index.js +1 -1
  313. package/dist/components/tooth-scheme/index.js +1 -1
  314. package/dist/components/unit-converter/index.js +1 -1
  315. package/dist/components/warning-stack/index.js +1 -1
  316. package/dist/components/workflow/index.js +1 -1
  317. package/dist/host-compat.css +1 -4
  318. package/dist/i18n/locales/ar.d.ts +1 -0
  319. package/dist/i18n/locales/ar.d.ts.map +1 -1
  320. package/dist/i18n/locales/ar.js +1 -0
  321. package/dist/i18n/locales/ar.js.map +1 -1
  322. package/dist/i18n/locales/de.d.ts +1 -0
  323. package/dist/i18n/locales/de.d.ts.map +1 -1
  324. package/dist/i18n/locales/de.js +1 -0
  325. package/dist/i18n/locales/de.js.map +1 -1
  326. package/dist/i18n/locales/el.d.ts +1 -0
  327. package/dist/i18n/locales/el.d.ts.map +1 -1
  328. package/dist/i18n/locales/el.js +1 -0
  329. package/dist/i18n/locales/el.js.map +1 -1
  330. package/dist/i18n/locales/en.d.ts +1 -0
  331. package/dist/i18n/locales/en.d.ts.map +1 -1
  332. package/dist/i18n/locales/en.js +1 -0
  333. package/dist/i18n/locales/en.js.map +1 -1
  334. package/dist/i18n/locales/es.d.ts +1 -0
  335. package/dist/i18n/locales/es.d.ts.map +1 -1
  336. package/dist/i18n/locales/es.js +1 -0
  337. package/dist/i18n/locales/es.js.map +1 -1
  338. package/dist/i18n/locales/fr.d.ts +1 -0
  339. package/dist/i18n/locales/fr.d.ts.map +1 -1
  340. package/dist/i18n/locales/fr.js +1 -0
  341. package/dist/i18n/locales/fr.js.map +1 -1
  342. package/dist/i18n/locales/hi.d.ts +1 -0
  343. package/dist/i18n/locales/hi.d.ts.map +1 -1
  344. package/dist/i18n/locales/hi.js +1 -0
  345. package/dist/i18n/locales/hi.js.map +1 -1
  346. package/dist/i18n/locales/it.d.ts +1 -0
  347. package/dist/i18n/locales/it.d.ts.map +1 -1
  348. package/dist/i18n/locales/it.js +1 -0
  349. package/dist/i18n/locales/it.js.map +1 -1
  350. package/dist/i18n/locales/ja.d.ts +1 -0
  351. package/dist/i18n/locales/ja.d.ts.map +1 -1
  352. package/dist/i18n/locales/ja.js +1 -0
  353. package/dist/i18n/locales/ja.js.map +1 -1
  354. package/dist/i18n/locales/nl.d.ts +1 -0
  355. package/dist/i18n/locales/nl.d.ts.map +1 -1
  356. package/dist/i18n/locales/nl.js +1 -0
  357. package/dist/i18n/locales/nl.js.map +1 -1
  358. package/dist/i18n/locales/pl.d.ts +1 -0
  359. package/dist/i18n/locales/pl.d.ts.map +1 -1
  360. package/dist/i18n/locales/pl.js +1 -0
  361. package/dist/i18n/locales/pl.js.map +1 -1
  362. package/dist/i18n/locales/pt.d.ts +1 -0
  363. package/dist/i18n/locales/pt.d.ts.map +1 -1
  364. package/dist/i18n/locales/pt.js +1 -0
  365. package/dist/i18n/locales/pt.js.map +1 -1
  366. package/dist/i18n/locales/ro.d.ts +1 -0
  367. package/dist/i18n/locales/ro.d.ts.map +1 -1
  368. package/dist/i18n/locales/ro.js +1 -0
  369. package/dist/i18n/locales/ro.js.map +1 -1
  370. package/dist/i18n/locales/ru.d.ts +1 -0
  371. package/dist/i18n/locales/ru.d.ts.map +1 -1
  372. package/dist/i18n/locales/ru.js +1 -0
  373. package/dist/i18n/locales/ru.js.map +1 -1
  374. package/dist/i18n/locales/sq.d.ts +1 -0
  375. package/dist/i18n/locales/sq.d.ts.map +1 -1
  376. package/dist/i18n/locales/sq.js +1 -0
  377. package/dist/i18n/locales/sq.js.map +1 -1
  378. package/dist/i18n/locales/sv.d.ts +1 -0
  379. package/dist/i18n/locales/sv.d.ts.map +1 -1
  380. package/dist/i18n/locales/sv.js +1 -0
  381. package/dist/i18n/locales/sv.js.map +1 -1
  382. package/dist/i18n/locales/tr.d.ts +1 -0
  383. package/dist/i18n/locales/tr.d.ts.map +1 -1
  384. package/dist/i18n/locales/tr.js +1 -0
  385. package/dist/i18n/locales/tr.js.map +1 -1
  386. package/dist/i18n/locales/zh.d.ts +1 -0
  387. package/dist/i18n/locales/zh.d.ts.map +1 -1
  388. package/dist/i18n/locales/zh.js +1 -0
  389. package/dist/i18n/locales/zh.js.map +1 -1
  390. package/dist/index.js +409 -406
  391. package/dist/index.js.map +1 -1
  392. package/dist/locales/ar.json +1 -0
  393. package/dist/locales/de.json +1 -0
  394. package/dist/locales/el.json +1 -0
  395. package/dist/locales/en.json +1 -0
  396. package/dist/locales/es.json +1 -0
  397. package/dist/locales/fr.json +1 -0
  398. package/dist/locales/hi.json +1 -0
  399. package/dist/locales/it.json +1 -0
  400. package/dist/locales/ja.json +1 -0
  401. package/dist/locales/nl.json +1 -0
  402. package/dist/locales/pl.json +1 -0
  403. package/dist/locales/pt.json +1 -0
  404. package/dist/locales/ro.json +1 -0
  405. package/dist/locales/ru.json +1 -0
  406. package/dist/locales/sq.json +1 -0
  407. package/dist/locales/sv.json +1 -0
  408. package/dist/locales/tr.json +1 -0
  409. package/dist/locales/zh.json +1 -0
  410. package/dist/patterns/alia-assistant/index.js +1 -1
  411. package/dist/patterns/anamnesis/index.js +1 -1
  412. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  413. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  414. package/dist/patterns/signature-request/index.js +1 -1
  415. package/dist/tokens.css +1 -1
  416. package/package.json +5 -1
  417. package/dist/_chunks/booking-CGKof8QU.js.map +0 -1
  418. package/dist/_chunks/button-BvNtqHAS.js.map +0 -1
  419. package/dist/_chunks/practice-results-DWUZRm2x.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"header-settings-C0zHLXJE.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n 'Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.',\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Monitor, Moon, Settings, Sun } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { IconButtonGroup } from '../icon-button-group/icon-button-group';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport { Switch } from '../switch/switch';\nimport {\n LocalePicker,\n LOCALE_STORAGE_KEY,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\n\nfunction safeWriteStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* Storage can throw in private mode — silent-fail per use-theme.ts. */\n }\n}\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\nconst dropdownContentClasses = [\n 'ds:w-[20rem] ds:p-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-background ds:text-foreground ds:shadow-[var(--shadow-lg)]',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. Defaults to `md` to preserve the existing visual.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row — keeps the visual rhythm consistent.\n *\n * The internal dropdown chrome (Appearance toggle group, locale\n * picker, accessibility switch) stays at kit defaults regardless\n * — this prop only sizes the trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface. Inside the menu, the */\n/* \"Language\" section embeds `LocalePicker.SearchList` (the kit's */\n/* searchable list without its own trigger / popover) and the */\n/* \"Appearance\" section mirrors `ThemeToggle`'s menu-variant internals */\n/* using `DropdownMenu.RadioGroup` + `CheckboxItem`. Both sections */\n/* read/write the same hooks (`useLocale`, `useTheme`) that the */\n/* standalone components use, so there's no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation();\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Inlined here (rather than exported from locale-picker) because\n // it's three small calls; the LocalePicker.SearchList component\n // continues to own its own copy for inline use, and both apply\n // the same persistence key (`alfadocs-ui.locale`) so a write from\n // either path is visible to the other on next mount.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n safeWriteStorage(LOCALE_STORAGE_KEY, next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n setLocaleRef.current(next as Locale);\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align={align}\n sideOffset={8}\n className={dropdownContentClasses}\n // Search input inside the menu owns its own keyboard\n // capture (cmdk). Stop Radix Menu's typeahead from\n // intercepting letters typed into the search field —\n // `onKeyDownCapture` runs before the menu's listener.\n onKeyDownCapture={(event) => {\n const target = event.target as HTMLElement | null;\n if (\n target?.tagName === 'INPUT' &&\n // Always allow Escape so the menu can close.\n event.key !== 'Escape'\n ) {\n event.stopPropagation();\n }\n }}\n >\n <DropdownMenu.Label>\n {t('navigation.headerSettings.language.label')}\n </DropdownMenu.Label>\n {/* Render the kit's compact LocalePicker (its own\n Popover trigger + content). Clicking the trigger\n opens a nested popover containing the full\n searchable list — the HeaderSettings menu stays\n open behind it so the user can return to Appearance\n / Accessibility without re-opening.\n\n Wrapped in `role=\"group\"` so the menu's\n `aria-required-children` rule sees a permitted child\n role (the LocalePicker compact button alone would\n appear as a raw button child of `role=\"menu\"`). */}\n <div\n role=\"group\"\n aria-label={t('navigation.headerSettings.language.label')}\n className={[\n 'ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n // Stretch the compact LocalePicker to the full menu\n // width so it reads as a single row affordance (not\n // a centred pill). The picker's root is\n // inline-flex; the `*:` child selector + `flex-1`\n // gives it `flex: 1 1 0%` once it's a child of the\n // flex container we make this div into.\n 'ds:flex ds:[&>*]:flex-1',\n ].join(' ')}\n >\n {/* `popoverSide=\"end\"` opens the nested search popover\n as a side-flyout (inline-end, RTL-aware) rather\n than below the compact row — without this the\n nested popover stacks under the trigger inside the\n outer DropdownMenu and the two surfaces visually\n merge. Radix Popover auto-flips to the opposite\n side if there's no viewport room. */}\n <LocalePicker variant=\"compact\" popoverSide=\"end\" />\n </div>\n\n <DropdownMenu.Separator />\n\n <DropdownMenu.Label>\n {t('navigation.headerSettings.appearance.label')}\n </DropdownMenu.Label>\n {/* Horizontal segmented toggle (mirrors ThemeToggle's\n `split` variant) instead of stacked radio rows — uses\n fewer rows of menu real estate and reads as a single\n control. `role=\"radiogroup\"` keeps the screen-reader\n semantics correct, and the group is wrapped in\n `role=\"group\"` for the same reason the language\n search-list wrapper is — the menu's\n aria-required-children doesn't permit raw IconButtons\n as direct menu descendants. */}\n <div\n role=\"group\"\n aria-label={t('navigation.headerSettings.appearance.label')}\n className=\"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]\"\n >\n <IconButtonGroup\n role=\"radiogroup\"\n mode=\"toggle-single\"\n size=\"sm\"\n aria-label={t('navigation.headerSettings.appearance.label')}\n value={theme.theme}\n onValueChange={(next) =>\n theme.setTheme(next as ThemePreference)\n }\n >\n <IconButton\n icon={<Sun aria-hidden />}\n aria-label={t('navigation.headerSettings.appearance.light')}\n value=\"light\"\n />\n <IconButton\n icon={<Moon aria-hidden />}\n aria-label={t('navigation.headerSettings.appearance.dark')}\n value=\"dark\"\n />\n <IconButton\n icon={<Monitor aria-hidden />}\n aria-label={t(\n 'navigation.headerSettings.appearance.system',\n )}\n value=\"system\"\n />\n </IconButtonGroup>\n </div>\n\n <DropdownMenu.Separator />\n\n {/* Accessible-mode toggle uses the kit's Switch primitive\n for a clearer visual affordance than a checkbox tick.\n Rendered inside a `presentation` row (not a\n DropdownMenu.CheckboxItem) — the Switch is focusable\n via Tab while the menu is open, so keyboard users\n still reach it; arrow keys keep moving between the\n three theme radios above without falling into the\n switch's roving collection.\n\n When the switch flips, `setAccessibility` writes\n through useTheme (the same store the standalone\n ThemeToggle uses) so document.documentElement gets\n the `theme-accessible` class instantly — including\n swapping `--font-sans` to Lexend for Latin scripts\n (see src/tokens/index.css). */}\n {/* `role=\"group\"` so the menu's `aria-required-children`\n (which only permits menuitem* / group / separator /\n menu inside `role=\"menu\"`) is satisfied — the Switch's\n `role=\"switch\"` would be a forbidden direct child of\n the menu. `aria-label` names the group so SR users\n hear \"Accessibility toggle, group\". */}\n <div\n role=\"group\"\n aria-label={t(\n 'navigation.headerSettings.appearance.accessible',\n )}\n className=\"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]\"\n >\n <Switch\n label={t('navigation.headerSettings.appearance.accessible')}\n labelSide=\"start\"\n size=\"sm\"\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n />\n </div>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","safeWriteStorage","key","value","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","dropdownContentClasses","HeaderSettings","forwardRef","props","ref","align","size","disabled","className","id","rest","t","useTranslation","theme","useTheme","setLocaleI18n","useLocale","forwardedRef","useRef","useImperativeHandle","setLocaleWithPersistence","useCallback","next","LOCALE_STORAGE_KEY","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","useAgentRegistration","accessibleChecked","jsx","jsxs","DropdownMenu","IconButton","Settings","event","target","LocalePicker","IconButtonGroup","Sun","Moon","Monitor","Switch"],"mappings":";;;;;;;;;;;;;;;AAOO,MAAMA,IAA0D;A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BAACG;AAAA,4BAAA;AAAA,8BACC,MAAM,gBAAAH,EAACU,GAAA,EAAK,eAAW,GAAA,CAAC;AAAA,8BACxB,cAAY9B,EAAE,2CAA2C;AAAA,8BACzD,OAAM;AAAA,4BAAA;AAAA,0BAAA;AAAA,0BAER,gBAAAoB;AAAA,4BAACG;AAAA,4BAAA;AAAA,8BACC,MAAM,gBAAAH,EAACW,GAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,8BAC3B,cAAY/B;AAAA,gCACV;AAAA,8BAAA;AAAA,8BAEF,OAAM;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACR;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA;AAAA,gBAGF,gBAAAoB,EAACE,EAAa,WAAb,EAAuB;AAAA,gBAuBxB,gBAAAF;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,cAAYpB;AAAA,sBACV;AAAA,oBAAA;AAAA,oBAEF,WAAU;AAAA,oBAEV,UAAA,gBAAAoB;AAAA,sBAACY;AAAA,sBAAA;AAAA,wBACC,OAAOhC,EAAE,iDAAiD;AAAA,wBAC1D,WAAU;AAAA,wBACV,MAAK;AAAA,wBACL,SAASmB;AAAA,wBACT,iBAAiB,CAACR,MAChBT,EAAM,iBAAiBS,IAAO,eAAe,SAAS;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAE1D;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEArB,EAAe,cAAc;"}
1
+ {"version":3,"file":"header-settings-CVC_davE.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n 'Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.',\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Monitor, Moon, Settings, Sun } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { IconButtonGroup } from '../icon-button-group/icon-button-group';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport { Switch } from '../switch/switch';\nimport {\n LocalePicker,\n LOCALE_STORAGE_KEY,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\n\nfunction safeWriteStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* Storage can throw in private mode — silent-fail per use-theme.ts. */\n }\n}\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\nconst dropdownContentClasses = [\n 'ds:w-[20rem] ds:p-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-background ds:text-foreground ds:shadow-[var(--shadow-lg)]',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. Defaults to `md` to preserve the existing visual.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row — keeps the visual rhythm consistent.\n *\n * The internal dropdown chrome (Appearance toggle group, locale\n * picker, accessibility switch) stays at kit defaults regardless\n * — this prop only sizes the trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface. Inside the menu, the */\n/* \"Language\" section embeds `LocalePicker.SearchList` (the kit's */\n/* searchable list without its own trigger / popover) and the */\n/* \"Appearance\" section mirrors `ThemeToggle`'s menu-variant internals */\n/* using `DropdownMenu.RadioGroup` + `CheckboxItem`. Both sections */\n/* read/write the same hooks (`useLocale`, `useTheme`) that the */\n/* standalone components use, so there's no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation();\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Inlined here (rather than exported from locale-picker) because\n // it's three small calls; the LocalePicker.SearchList component\n // continues to own its own copy for inline use, and both apply\n // the same persistence key (`alfadocs-ui.locale`) so a write from\n // either path is visible to the other on next mount.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n safeWriteStorage(LOCALE_STORAGE_KEY, next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n setLocaleRef.current(next as Locale);\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align={align}\n sideOffset={8}\n className={dropdownContentClasses}\n // Search input inside the menu owns its own keyboard\n // capture (cmdk). Stop Radix Menu's typeahead from\n // intercepting letters typed into the search field —\n // `onKeyDownCapture` runs before the menu's listener.\n onKeyDownCapture={(event) => {\n const target = event.target as HTMLElement | null;\n if (\n target?.tagName === 'INPUT' &&\n // Always allow Escape so the menu can close.\n event.key !== 'Escape'\n ) {\n event.stopPropagation();\n }\n }}\n >\n <DropdownMenu.Label>\n {t('navigation.headerSettings.language.label')}\n </DropdownMenu.Label>\n {/* Render the kit's compact LocalePicker (its own\n Popover trigger + content). Clicking the trigger\n opens a nested popover containing the full\n searchable list — the HeaderSettings menu stays\n open behind it so the user can return to Appearance\n / Accessibility without re-opening.\n\n Wrapped in `role=\"group\"` so the menu's\n `aria-required-children` rule sees a permitted child\n role (the LocalePicker compact button alone would\n appear as a raw button child of `role=\"menu\"`). */}\n <div\n role=\"group\"\n aria-label={t('navigation.headerSettings.language.label')}\n className={[\n 'ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n // Stretch the compact LocalePicker to the full menu\n // width so it reads as a single row affordance (not\n // a centred pill). The picker's root is\n // inline-flex; the `*:` child selector + `flex-1`\n // gives it `flex: 1 1 0%` once it's a child of the\n // flex container we make this div into.\n 'ds:flex ds:[&>*]:flex-1',\n ].join(' ')}\n >\n {/* `popoverSide=\"end\"` opens the nested search popover\n as a side-flyout (inline-end, RTL-aware) rather\n than below the compact row — without this the\n nested popover stacks under the trigger inside the\n outer DropdownMenu and the two surfaces visually\n merge. Radix Popover auto-flips to the opposite\n side if there's no viewport room. */}\n <LocalePicker variant=\"compact\" popoverSide=\"end\" />\n </div>\n\n <DropdownMenu.Separator />\n\n <DropdownMenu.Label>\n {t('navigation.headerSettings.appearance.label')}\n </DropdownMenu.Label>\n {/* Horizontal segmented toggle (mirrors ThemeToggle's\n `split` variant) instead of stacked radio rows — uses\n fewer rows of menu real estate and reads as a single\n control. `role=\"radiogroup\"` keeps the screen-reader\n semantics correct, and the group is wrapped in\n `role=\"group\"` for the same reason the language\n search-list wrapper is — the menu's\n aria-required-children doesn't permit raw IconButtons\n as direct menu descendants. */}\n <div\n role=\"group\"\n aria-label={t('navigation.headerSettings.appearance.label')}\n className=\"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]\"\n >\n <IconButtonGroup\n role=\"radiogroup\"\n mode=\"toggle-single\"\n size=\"sm\"\n aria-label={t('navigation.headerSettings.appearance.label')}\n value={theme.theme}\n onValueChange={(next) =>\n theme.setTheme(next as ThemePreference)\n }\n >\n <IconButton\n icon={<Sun aria-hidden />}\n aria-label={t('navigation.headerSettings.appearance.light')}\n value=\"light\"\n />\n <IconButton\n icon={<Moon aria-hidden />}\n aria-label={t('navigation.headerSettings.appearance.dark')}\n value=\"dark\"\n />\n <IconButton\n icon={<Monitor aria-hidden />}\n aria-label={t(\n 'navigation.headerSettings.appearance.system',\n )}\n value=\"system\"\n />\n </IconButtonGroup>\n </div>\n\n <DropdownMenu.Separator />\n\n {/* Accessible-mode toggle uses the kit's Switch primitive\n for a clearer visual affordance than a checkbox tick.\n Rendered inside a `presentation` row (not a\n DropdownMenu.CheckboxItem) — the Switch is focusable\n via Tab while the menu is open, so keyboard users\n still reach it; arrow keys keep moving between the\n three theme radios above without falling into the\n switch's roving collection.\n\n When the switch flips, `setAccessibility` writes\n through useTheme (the same store the standalone\n ThemeToggle uses) so document.documentElement gets\n the `theme-accessible` class instantly — including\n swapping `--font-sans` to Lexend for Latin scripts\n (see src/tokens/index.css). */}\n {/* `role=\"group\"` so the menu's `aria-required-children`\n (which only permits menuitem* / group / separator /\n menu inside `role=\"menu\"`) is satisfied — the Switch's\n `role=\"switch\"` would be a forbidden direct child of\n the menu. `aria-label` names the group so SR users\n hear \"Accessibility toggle, group\". */}\n <div\n role=\"group\"\n aria-label={t(\n 'navigation.headerSettings.appearance.accessible',\n )}\n className=\"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]\"\n >\n <Switch\n label={t('navigation.headerSettings.appearance.accessible')}\n labelSide=\"start\"\n size=\"sm\"\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n />\n </div>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","safeWriteStorage","key","value","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","dropdownContentClasses","HeaderSettings","forwardRef","props","ref","align","size","disabled","className","id","rest","t","useTranslation","theme","useTheme","setLocaleI18n","useLocale","forwardedRef","useRef","useImperativeHandle","setLocaleWithPersistence","useCallback","next","LOCALE_STORAGE_KEY","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","useAgentRegistration","accessibleChecked","jsx","jsxs","DropdownMenu","IconButton","Settings","event","target","LocalePicker","IconButtonGroup","Sun","Moon","Monitor","Switch"],"mappings":";;;;;;;;;;;;;;;AAOO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AA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B,cAAY9B,EAAE,2CAA2C;AAAA,8BACzD,OAAM;AAAA,4BAAA;AAAA,0BAAA;AAAA,0BAER,gBAAAoB;AAAA,4BAACG;AAAA,4BAAA;AAAA,8BACC,MAAM,gBAAAH,EAACW,GAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,8BAC3B,cAAY/B;AAAA,gCACV;AAAA,8BAAA;AAAA,8BAEF,OAAM;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACR;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA;AAAA,gBAGF,gBAAAoB,EAACE,EAAa,WAAb,EAAuB;AAAA,gBAuBxB,gBAAAF;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,cAAYpB;AAAA,sBACV;AAAA,oBAAA;AAAA,oBAEF,WAAU;AAAA,oBAEV,UAAA,gBAAAoB;AAAA,sBAACY;AAAA,sBAAA;AAAA,wBACC,OAAOhC,EAAE,iDAAiD;AAAA,wBAC1D,WAAU;AAAA,wBACV,MAAK;AAAA,wBACL,SAASmB;AAAA,wBACT,iBAAiB,CAACR,MAChBT,EAAM,iBAAiBS,IAAO,eAAe,SAAS;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAE1D;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEArB,EAAe,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as b } from "react";
3
- import { B as u } from "./button-BvNtqHAS.js";
3
+ import { B as u } from "./button-nJaPh_HC.js";
4
4
  import { c as p } from "./index-D2ZczOXr.js";
5
5
  import { T as h } from "./tooltip-DvmfrNvB.js";
6
6
  const g = p(
@@ -75,4 +75,4 @@ x.displayName = "IconButton";
75
75
  export {
76
76
  x as I
77
77
  };
78
- //# sourceMappingURL=icon-button-9c9Gp41m.js.map
78
+ //# sourceMappingURL=icon-button-DA2CAGHZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-9c9Gp41m.js","sources":["../../src/components/button/icon-button.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Button, type ButtonProps } from './button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Tooltip } from '../tooltip';\n\nconst iconButtonVariants = cva(\n [\n 'ds:p-0',\n // Active-state styling when an IconButton participates in an\n // IconButtonGroup's `toggle-single` / `toggle-multi` mode. The\n // group sets `aria-checked=\"true\"` (radiogroup) or\n // `aria-pressed=\"true\"` (toolbar/group) on the selected child;\n // without these utility classes the selection wouldn't read at a\n // glance — see HeaderSettings' Appearance row + ThemeToggle's\n // split variant.\n 'ds:aria-checked:bg-muted ds:aria-checked:text-foreground',\n 'ds:aria-checked:border-primary',\n 'ds:aria-pressed:bg-muted ds:aria-pressed:text-foreground',\n 'ds:aria-pressed:border-primary',\n ].join(' '),\n {\n variants: {\n size: {\n // `sm` (32px) and `md` (40px) sit below `--min-target-size` (44/48px).\n // IconButton overrides Button's `size` variant, so it doesn't inherit\n // Button's touch-target `::before`. Re-add it here for the under-target\n // sizes: a transparent pseudo-element expands the *hit area* to\n // `--min-target-size` on touch / small screens, then is hidden from the\n // `sm:` breakpoint up (desktop pointer input keeps the compact box, so\n // there's no visual/layout change on the desktop Chromatic baselines).\n // `lg` (48px) already clears the target, so it needs no expansion.\n sm: 'ds:w-8 ds:h-8 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n md: 'ds:w-10 ds:h-10 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n lg: 'ds:w-12 ds:h-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type IconButtonProps = Omit<\n ButtonProps,\n 'startIcon' | 'endIcon' | 'children' | 'size' | 'flipIconInRtl'\n> &\n VariantProps<typeof iconButtonVariants> & {\n icon: React.ReactNode;\n tooltip?: string;\n 'aria-label'?: string;\n /**\n * Mirror the icon horizontally in RTL. Default `false` — only enable\n * for directional glyphs (arrows, chevrons). See Button.flipIconInRtl.\n */\n flipIconInRtl?: boolean;\n };\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n icon,\n size,\n intent = 'outline',\n className,\n tooltip,\n flipIconInRtl = false,\n ...props\n },\n ref,\n ) => {\n const ariaLabel = props['aria-label'] || tooltip;\n\n if (import.meta.env.DEV && !ariaLabel) {\n console.warn(\n 'IconButton: aria-label or tooltip prop is required for accessibility.',\n );\n }\n\n const iconSizeClass =\n size === 'sm'\n ? 'ds:size-4'\n : size === 'lg'\n ? 'ds:size-5'\n : 'ds:size-[18px]';\n const iconFlipClass = flipIconInRtl ? 'ds:rtl:rotate-180' : '';\n\n const button = (\n <Button\n ref={ref}\n size={size}\n intent={intent}\n className={iconButtonVariants({ size, className })}\n aria-label={ariaLabel}\n data-component=\"icon-button\"\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconSizeClass} ${iconFlipClass}`.trim()}\n >\n {icon}\n </span>\n </Button>\n );\n\n if (tooltip) {\n return <Tooltip label={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n },\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["iconButtonVariants","cva","IconButton","forwardRef","icon","size","intent","className","tooltip","flipIconInRtl","props","ref","ariaLabel","iconSizeClass","iconFlipClass","button","jsx","Button","Tooltip"],"mappings":";;;;;AAKA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,IACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAiBaC,IAAaC;AAAA,EACxB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAYF,EAAM,YAAY,KAAKF,GAQnCK,IACJR,MAAS,OACL,cACAA,MAAS,OACP,cACA,kBACFS,IAAgBL,IAAgB,sBAAsB,IAEtDM,IACJ,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAN;AAAA,QACA,MAAAN;AAAA,QACA,QAAAC;AAAA,QACA,WAAWN,EAAmB,EAAE,MAAAK,GAAM,WAAAE,GAAW;AAAA,QACjD,cAAYK;AAAA,QACZ,kBAAe;AAAA,QACd,GAAGF;AAAA,QAEJ,UAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAW,oDAAoDH,CAAa,IAAIC,CAAa,GAAG,KAAA;AAAA,YAE/F,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAIJ,WAAII,sBACMU,GAAA,EAAQ,OAAOV,GAAU,UAAAO,GAAO,IAGnCA;AAAA,EACT;AACF;AAEAb,EAAW,cAAc;"}
1
+ {"version":3,"file":"icon-button-DA2CAGHZ.js","sources":["../../src/components/button/icon-button.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Button, type ButtonProps } from './button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Tooltip } from '../tooltip';\n\nconst iconButtonVariants = cva(\n [\n 'ds:p-0',\n // Active-state styling when an IconButton participates in an\n // IconButtonGroup's `toggle-single` / `toggle-multi` mode. The\n // group sets `aria-checked=\"true\"` (radiogroup) or\n // `aria-pressed=\"true\"` (toolbar/group) on the selected child;\n // without these utility classes the selection wouldn't read at a\n // glance — see HeaderSettings' Appearance row + ThemeToggle's\n // split variant.\n 'ds:aria-checked:bg-muted ds:aria-checked:text-foreground',\n 'ds:aria-checked:border-primary',\n 'ds:aria-pressed:bg-muted ds:aria-pressed:text-foreground',\n 'ds:aria-pressed:border-primary',\n ].join(' '),\n {\n variants: {\n size: {\n // `sm` (32px) and `md` (40px) sit below `--min-target-size` (44/48px).\n // IconButton overrides Button's `size` variant, so it doesn't inherit\n // Button's touch-target `::before`. Re-add it here for the under-target\n // sizes: a transparent pseudo-element expands the *hit area* to\n // `--min-target-size` on touch / small screens, then is hidden from the\n // `sm:` breakpoint up (desktop pointer input keeps the compact box, so\n // there's no visual/layout change on the desktop Chromatic baselines).\n // `lg` (48px) already clears the target, so it needs no expansion.\n sm: 'ds:w-8 ds:h-8 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n md: 'ds:w-10 ds:h-10 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n lg: 'ds:w-12 ds:h-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type IconButtonProps = Omit<\n ButtonProps,\n 'startIcon' | 'endIcon' | 'children' | 'size' | 'flipIconInRtl'\n> &\n VariantProps<typeof iconButtonVariants> & {\n icon: React.ReactNode;\n tooltip?: string;\n 'aria-label'?: string;\n /**\n * Mirror the icon horizontally in RTL. Default `false` — only enable\n * for directional glyphs (arrows, chevrons). See Button.flipIconInRtl.\n */\n flipIconInRtl?: boolean;\n };\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n icon,\n size,\n intent = 'outline',\n className,\n tooltip,\n flipIconInRtl = false,\n ...props\n },\n ref,\n ) => {\n const ariaLabel = props['aria-label'] || tooltip;\n\n if (import.meta.env.DEV && !ariaLabel) {\n console.warn(\n 'IconButton: aria-label or tooltip prop is required for accessibility.',\n );\n }\n\n const iconSizeClass =\n size === 'sm'\n ? 'ds:size-4'\n : size === 'lg'\n ? 'ds:size-5'\n : 'ds:size-[18px]';\n const iconFlipClass = flipIconInRtl ? 'ds:rtl:rotate-180' : '';\n\n const button = (\n <Button\n ref={ref}\n size={size}\n intent={intent}\n className={iconButtonVariants({ size, className })}\n aria-label={ariaLabel}\n data-component=\"icon-button\"\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconSizeClass} ${iconFlipClass}`.trim()}\n >\n {icon}\n </span>\n </Button>\n );\n\n if (tooltip) {\n return <Tooltip label={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n },\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["iconButtonVariants","cva","IconButton","forwardRef","icon","size","intent","className","tooltip","flipIconInRtl","props","ref","ariaLabel","iconSizeClass","iconFlipClass","button","jsx","Button","Tooltip"],"mappings":";;;;;AAKA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,IACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAiBaC,IAAaC;AAAA,EACxB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAYF,EAAM,YAAY,KAAKF,GAQnCK,IACJR,MAAS,OACL,cACAA,MAAS,OACP,cACA,kBACFS,IAAgBL,IAAgB,sBAAsB,IAEtDM,IACJ,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAN;AAAA,QACA,MAAAN;AAAA,QACA,QAAAC;AAAA,QACA,WAAWN,EAAmB,EAAE,MAAAK,GAAM,WAAAE,GAAW;AAAA,QACjD,cAAYK;AAAA,QACZ,kBAAe;AAAA,QACd,GAAGF;AAAA,QAEJ,UAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAW,oDAAoDH,CAAa,IAAIC,CAAa,GAAG,KAAA;AAAA,YAE/F,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAIJ,WAAII,sBACMU,GAAA,EAAQ,OAAOV,GAAU,UAAAO,GAAO,IAGnCA;AAAA,EACT;AACF;AAEAb,EAAW,cAAc;"}
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as _ } from "react/jsx-runtime";
2
2
  import { forwardRef as je, useState as U, useCallback as W, useRef as z, Children as pe, isValidElement as H, useEffect as ge, cloneElement as me } from "react";
3
3
  import { c as ze } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as Se } from "react-i18next";
5
- import { I as be } from "./icon-button-9c9Gp41m.js";
5
+ import { I as be } from "./icon-button-DA2CAGHZ.js";
6
6
  import { D as w } from "./dropdown-menu-DU-Hrf33.js";
7
7
  import { u as Be } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
8
8
  import { u as Ke } from "./use-priority-overflow-c9SjxZkZ.js";
@@ -403,4 +403,4 @@ function Te(d, v, m, u) {
403
403
  export {
404
404
  Pe as I
405
405
  };
406
- //# sourceMappingURL=icon-button-group-DrvuWPGJ.js.map
406
+ //# sourceMappingURL=icon-button-group-D6SVMteH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-group-DrvuWPGJ.js","sources":["../../src/components/icon-button-group/icon-button-group.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Ellipsis } from 'lucide-react';\nimport { IconButton, type IconButtonProps } from '../button/icon-button';\nimport type { ButtonProps } from '../button/button';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { usePriorityOverflow } from '../../hooks/use-priority-overflow';\n\ntype ButtonIntent = NonNullable<ButtonProps['intent']>;\n\n// Intentionally does NOT compose `@radix-ui/react-toggle-group`. Radix\n// ToggleGroup's render shape makes it hard to layer shared-border chrome\n// across children (first-child / last-child / internal-divider CSS), and\n// the three-mode + three-role matrix (group / toolbar / radiogroup × momentary\n// / toggle-single / toggle-multi) is broader than Radix's single / multi\n// contract. The roving-tabindex implementation below mirrors Radix's pattern\n// so keyboard semantics stay consistent. See 05-accessibility.mdx for the\n// WAI-ARIA toolbar / radiogroup references.\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst iconButtonGroupVariants = cva(\n [\n 'ds:inline-flex ds:isolate',\n // Hairline border around the group unifies the children into one\n // visual unit. Internal child dividers are drawn via the per-child\n // class list below.\n 'ds:border ds:border-border',\n 'ds:rounded-[var(--radius-md)]',\n // Ensure the focus ring of a pressed child sits above its siblings.\n 'ds:[&>*]:relative ds:[&>*:focus-visible]:z-10',\n ].join(' '),\n {\n variants: {\n orientation: {\n horizontal: [\n 'ds:flex-row',\n // Flatten internal corners on children so the outer radius owns\n // the rounded edges.\n 'ds:[&>*:not(:first-child)]:rounded-s-none',\n 'ds:[&>*:not(:last-child)]:rounded-e-none',\n // Internal divider — logical so it flips in RTL.\n 'ds:[&>*:not(:first-child)]:border-s',\n 'ds:[&>*:not(:first-child)]:border-border',\n // The children already own an outer border (from IconButton's\n // own border in secondary/outline variants). Collapse the doubled\n // border so we don't get a 2px seam.\n 'ds:[&>*]:border-0',\n ].join(' '),\n vertical: [\n 'ds:flex-col',\n // Vertical groups flow block-wise. Reading direction doesn't\n // invert vertical stacks in any locale this DS targets, so the\n // physical `rounded-t/b` is intentional.\n 'ds:[&>*:not(:first-child)]:rounded-t-none',\n 'ds:[&>*:not(:last-child)]:rounded-b-none',\n 'ds:[&>*:not(:first-child)]:border-t',\n 'ds:[&>*:not(:first-child)]:border-border',\n 'ds:[&>*]:border-0',\n ].join(' '),\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n },\n);\n\n// Hidden measurement rows: laid out (so widths are real) but invisible,\n// non-interactive and out of the a11y tree. Never display:none.\nconst MEASURE_ROW_CLASSES =\n 'ds:absolute ds:start-0 ds:top-0 ds:invisible ds:pointer-events-none';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type IconButtonGroupRole = 'group' | 'toolbar' | 'radiogroup';\nexport type IconButtonGroupMode =\n | 'momentary'\n | 'toggle-single'\n | 'toggle-multi';\n\ntype SharedPropsBase = {\n /** Forwarded to every child that does not set its own `size`. */\n size?: 'sm' | 'md' | 'lg';\n orientation?: 'horizontal' | 'vertical';\n /** Disables every child. Uses `aria-disabled` on children (not the HTML\n * attribute) so each child still takes focus — matches WAI-ARIA toolbar\n * guidance. Visual disabled styling picks up the `aria-disabled:*`\n * variant declared on the Button base class. */\n disabled?: boolean;\n /** Intent applied to every child that does not set its own `intent`.\n * Defaults to `outline` — grouped icon buttons are peers, not a row\n * of solid-primary CTAs. */\n intent?: ButtonIntent;\n /** `'menu'` keeps the strip on one line whatever the container width:\n * children that stop fitting move into a dropdown behind an ellipsis\n * trigger, preserving toggle semantics (radio / checkbox items). The\n * group then fills its container's inline size. Horizontal only.\n * Children set `data-overflow-pin` to always stay in the strip. */\n overflow?: 'none' | 'menu';\n children: ReactNode;\n};\n\n// At least one of `aria-label` / `aria-labelledby` must be present. This\n// discriminated pair makes the TypeScript compiler reject a group with\n// neither — see the a11y acceptance criteria in the user story.\ntype AccessibleNameProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-label'?: never; 'aria-labelledby': string };\n\ntype SharedProps = SharedPropsBase & AccessibleNameProps;\n\n// Role + mode combinations are not all valid. Encoded via a discriminated\n// union so the compiler rejects nonsensical pairings (e.g. a multi-select\n// radiogroup).\ntype GroupRoleProps =\n | { role?: 'group'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'toolbar'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'radiogroup'; mode: 'toggle-single' };\n\ntype MomentaryProps = SharedProps & {\n mode?: 'momentary';\n value?: never;\n defaultValue?: never;\n onValueChange?: never;\n};\n\ntype ToggleSingleProps = SharedProps & {\n mode: 'toggle-single';\n value?: string;\n defaultValue?: string;\n onValueChange?: (next: string) => void;\n};\n\ntype ToggleMultiProps = SharedProps & {\n mode: 'toggle-multi';\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (next: string[]) => void;\n};\n\nexport type IconButtonGroupProps = (\n | MomentaryProps\n | ToggleSingleProps\n | ToggleMultiProps\n) &\n GroupRoleProps &\n Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'onChange' | 'children'> &\n VariantProps<typeof iconButtonGroupVariants>;\n\n/* ------------------------------------------------------------------ */\n/* IconButtonGroup */\n/* ------------------------------------------------------------------ */\n\nexport const IconButtonGroup = forwardRef<HTMLDivElement, IconButtonGroupProps>(\n (props, ref) => {\n const {\n size,\n orientation = 'horizontal',\n role = 'group',\n mode = 'momentary',\n disabled = false,\n intent = 'outline',\n overflow = 'none',\n className,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n // Controlled-value props are consumed via `props as …` below; strip them\n // here so they never spread onto the root <div> (React would warn that\n // `onValueChange` is an unknown DOM event handler).\n value: _value,\n defaultValue: _defaultValue,\n onValueChange: _onValueChange,\n ...rest\n } = props as IconButtonGroupProps & { className?: string };\n const { t } = useTranslation();\n\n if (import.meta.env.DEV && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'IconButtonGroup: `aria-label` or `aria-labelledby` is required for accessibility.',\n );\n }\n if (\n import.meta.env.DEV &&\n overflow === 'menu' &&\n orientation === 'vertical'\n ) {\n console.warn(\n 'IconButtonGroup: overflow=\"menu\" is horizontal-only; falling back to overflow=\"none\".',\n );\n }\n const overflowEnabled = overflow === 'menu' && orientation !== 'vertical';\n\n /* ---- Controlled / uncontrolled value for toggle modes --------- */\n const [internalValue, setInternalValue] = useState<string | string[]>(\n () => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.defaultValue ?? '';\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.defaultValue ?? [];\n }\n return '';\n },\n );\n\n const resolvedValue: string | string[] = (() => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n return '';\n })();\n\n const commitValue = useCallback(\n (next: string | string[]) => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n if (p.value === undefined) setInternalValue(next as string);\n p.onValueChange?.(next as string);\n } else if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n if (p.value === undefined) setInternalValue(next as string[]);\n p.onValueChange?.(next as string[]);\n }\n },\n [mode, props],\n );\n\n /* ---- Roving tabindex state — only active in toolbar / radiogroup - */\n const rovingTabindex = role === 'toolbar' || role === 'radiogroup';\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const [focusIndex, setFocusIndex] = useState(0);\n\n const registerIndex = useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonsRef.current[index] = el;\n },\n [],\n );\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [isRTL, setIsRTL] = useState(false);\n // `useLayoutEffect` so the direction is correct BEFORE the first paint\n // (otherwise a user pressing an arrow key on the first frame after mount\n // would hit the default-LTR mapping even in an RTL document).\n useIsomorphicLayoutEffect(() => {\n if (typeof window === 'undefined') return;\n const node = rootRef.current;\n if (!node) return;\n // Read the computed direction from the group's own wrapper so a\n // scoped `dir='rtl'` on any ancestor (not just <html>) flips arrow\n // navigation. `getComputedStyle` walks up automatically.\n const dir = window.getComputedStyle(node).direction;\n setIsRTL(dir === 'rtl');\n }, []);\n\n /* ---- Arrow-key navigation for roving tabindex ----------------- */\n const handleRootKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!rovingTabindex) return;\n const count = buttonsRef.current.filter(Boolean).length;\n if (count === 0) return;\n\n const forwardKey =\n orientation === 'vertical'\n ? 'ArrowDown'\n : isRTL\n ? 'ArrowLeft'\n : 'ArrowRight';\n const backwardKey =\n orientation === 'vertical'\n ? 'ArrowUp'\n : isRTL\n ? 'ArrowRight'\n : 'ArrowLeft';\n\n let next: number | null = null;\n if (event.key === forwardKey) next = (focusIndex + 1) % count;\n else if (event.key === backwardKey)\n next = (focusIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n\n if (next === null) return;\n // Skip over disabled children.\n const maxAttempts = count;\n let attempts = 0;\n let candidate = next;\n while (attempts < maxAttempts) {\n const el = buttonsRef.current[candidate];\n if (\n el &&\n el.getAttribute('aria-disabled') !== 'true' &&\n !el.disabled\n ) {\n break;\n }\n candidate =\n event.key === backwardKey || event.key === 'End'\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n // WAI-ARIA radiogroup pattern: arrow keys MOVE focus AND CHANGE\n // the selected radio in one action. toolbar pattern (and plain\n // group) only moves focus.\n if (role === 'radiogroup' && mode === 'toggle-single') {\n const child = childArrayRef.current[candidate];\n if (child && typeof child === 'object' && 'props' in child) {\n const cValue = (child as ReactElement<{ value?: string }>).props\n .value;\n // Same guard as the click path: re-committing the already\n // selected value is a no-op, so Home/End on the selected radio\n // never fires a spurious onValueChange.\n if (cValue && cValue !== resolvedValue) commitValue(cValue);\n }\n }\n },\n [\n rovingTabindex,\n orientation,\n isRTL,\n focusIndex,\n role,\n mode,\n commitValue,\n resolvedValue,\n ],\n );\n\n /* ---- Overflow bookkeeping (menu mode only) --------------------- */\n type OverflowChildProps = IconButtonProps & {\n value?: string;\n 'data-overflow-pin'?: boolean | 'true' | '';\n };\n const allElements = overflowEnabled\n ? (Children.toArray(children).filter(isValidElement) as Array<\n ReactElement<OverflowChildProps>\n >)\n : [];\n const mirrorLabel = (child: ReactElement<OverflowChildProps>) => {\n const aria = child.props['aria-label'];\n if (typeof aria === 'string') return aria;\n return typeof child.props.tooltip === 'string'\n ? child.props.tooltip\n : null;\n };\n const warnedRef = useRef(false);\n const pinnedFlags = allElements.map((child) => {\n const explicit = child.props['data-overflow-pin'] !== undefined;\n const mirrorable = mirrorLabel(child) !== null;\n if (\n import.meta.env.DEV &&\n !explicit &&\n !mirrorable &&\n !warnedRef.current\n ) {\n warnedRef.current = true;\n console.warn(\n 'IconButtonGroup: a child without aria-label / tooltip cannot move into the overflow menu — it stays pinned in the strip.',\n );\n }\n return explicit || !mirrorable;\n });\n\n const { containerRef, fullRowRef, triggerProbeRef, visible, overflowing } =\n usePriorityOverflow({\n enabled: overflowEnabled,\n count: allElements.length,\n pinned: pinnedFlags,\n });\n\n const triggerNodeRef = useRef<HTMLButtonElement | null>(null);\n\n /* ---- Build enhanced children ---------------------------------- */\n const childArray = overflowEnabled\n ? allElements.filter((_, i) => visible[i])\n : Children.toArray(children);\n if (overflowEnabled) {\n buttonsRef.current.length = childArray.length + (overflowing ? 1 : 0);\n }\n // Mirror into a ref so the keydown handler (referenced from Memo deps)\n // can read the latest child list without inflating the dep array.\n const childArrayRef = useRef<ReturnType<typeof Children.toArray>>([]);\n childArrayRef.current = childArray;\n\n // APG radiogroup pattern: Tab must land on the CHECKED radio, not the\n // first one. Keep the roving tab stop pinned to the selected child —\n // covers initial mount (checked child not first) and controlled value\n // changes. Arrow/click interactions already align focusIndex with the\n // selection, so this effect is a no-op for them.\n const checkedIndex =\n role === 'radiogroup' && mode === 'toggle-single'\n ? childArray.findIndex(\n (child) =>\n isValidElement(child) &&\n (child as ReactElement<{ value?: string }>).props.value ===\n resolvedValue,\n )\n : -1;\n useEffect(() => {\n if (checkedIndex >= 0) setFocusIndex(checkedIndex);\n }, [checkedIndex]);\n\n const visibleCount = childArray.length;\n // Clamp the roving focus when items move into the menu; hand real focus\n // to the trigger only when the focused node was the one that left.\n useEffect(() => {\n if (!rovingTabindex || !overflowEnabled) return;\n const total = visibleCount + (overflowing ? 1 : 0);\n if (total > 0 && focusIndex >= total) {\n setFocusIndex(total - 1);\n if (document.activeElement === document.body) {\n triggerNodeRef.current?.focus();\n }\n }\n }, [\n rovingTabindex,\n overflowEnabled,\n visibleCount,\n overflowing,\n focusIndex,\n ]);\n\n const enhanced = childArray.map((child, index) => {\n if (!isValidElement(child)) {\n if (import.meta.env.DEV) {\n console.warn(\n 'IconButtonGroup: children should be <IconButton> elements.',\n );\n }\n return child;\n }\n\n const childEl = child as ReactElement<\n IconButtonProps & {\n value?: string;\n asChild?: boolean;\n children?: ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n }\n >;\n\n // DEV-time sanity: warn if we got something that isn't an IconButton.\n // `React.cloneElement` would still work, but IconButton-specific\n // props (::before target size, forwarded tooltip) wouldn't apply.\n // `asChild` wrappers (e.g. DropdownMenu.Trigger) are fine when they\n // Slot-merge the cloned props onto their own IconButton child, as are\n // components that declare a static `rendersIconButton` marker (the\n // DataTable toolbar leaves — each renders one IconButton trigger and\n // forwards ref/tabIndex/onFocus to it).\n if (import.meta.env.DEV && childEl.type !== IconButton) {\n const slotChild =\n childEl.props.asChild === true ? childEl.props.children : null;\n const wrapsIconButton =\n isValidElement(slotChild) && slotChild.type === IconButton;\n const rendersIconButton =\n (childEl.type as { rendersIconButton?: boolean })\n .rendersIconButton === true;\n if (!wrapsIconButton && !rendersIconButton) {\n console.warn(\n 'IconButtonGroup: each child should be a DS <IconButton>. Other elements break target-size + focus-ring contracts.',\n );\n }\n }\n\n const childValue = childEl.props.value;\n\n // Compute aria-pressed / aria-checked for toggle modes.\n const { ariaPressed, ariaChecked } = computeToggleAria(\n mode,\n role,\n childValue,\n resolvedValue,\n );\n\n const groupDisabled = disabled === true;\n const childDisabled = childEl.props.disabled === true;\n\n // Click handling — wrap so aria-disabled (group-level) blocks\n // activation, then forward to the child's own onClick.\n const wrappedOnClick: React.MouseEventHandler<HTMLButtonElement> = (\n event,\n ) => {\n // aria-disabled is advisory; the native click still fires. Block\n // it explicitly when the GROUP (not the child) is disabled.\n if (groupDisabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n // Forward to the child's own handler first so consumers can run\n // analytics / preventDefault.\n childEl.props.onClick?.(event);\n if (event.defaultPrevented) return;\n if (!childValue) return;\n if (mode === 'toggle-single') {\n // Contract: exactly one pressed. Clicking the pressed one is a\n // no-op. This matches Radix ToggleGroup type='single' and the\n // radiogroup pattern.\n if (resolvedValue === childValue) return;\n commitValue(childValue);\n } else if (mode === 'toggle-multi') {\n const list = resolvedValue as string[];\n const next = list.includes(childValue)\n ? list.filter((v) => v !== childValue)\n : [...list, childValue];\n commitValue(next);\n }\n };\n\n // cloneElement's typed overload rejects `ref` as a prop, so we\n // build the override bag as `unknown` and cast to the element's\n // prop type. React at runtime routes `ref` via its usual channel.\n const setMergedRef = (node: HTMLButtonElement | null) => {\n registerIndex(index, node);\n const originalRef = (\n childEl as unknown as { ref?: React.Ref<HTMLButtonElement> }\n ).ref;\n if (typeof originalRef === 'function') originalRef(node);\n else if (\n originalRef !== null &&\n originalRef !== undefined &&\n typeof originalRef === 'object'\n ) {\n (\n originalRef as React.MutableRefObject<HTMLButtonElement | null>\n ).current = node;\n }\n };\n\n // Per the user story: group-level disabled injects `aria-disabled`\n // so the child stays focusable; child-level `disabled` still uses\n // the HTML attribute (child's own contract). When both are true\n // we leave the HTML disabled in place (strictest cue wins).\n const ariaDisabled = groupDisabled && !childDisabled ? true : undefined;\n\n // If the group is disabled OR we are in a toggle mode, we need the\n // wrapped click handler. In pure momentary mode with no group\n // disable, the child's own onClick is passed through unchanged.\n const needsWrappedClick = mode !== 'momentary' || groupDisabled;\n\n const overrides = {\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n disabled: childDisabled,\n 'aria-disabled': ariaDisabled,\n onClick: needsWrappedClick ? wrappedOnClick : childEl.props.onClick,\n 'aria-pressed': ariaPressed,\n 'aria-checked': ariaChecked,\n // When the group is a radiogroup, children must be `role=\"radio\"`\n // so screen readers announce them as radio buttons and so\n // `getByRole('radio')` works in tests. The button element is\n // re-purposed as a radio; `aria-checked` above carries the state.\n role: role === 'radiogroup' ? 'radio' : undefined,\n tabIndex: rovingTabindex ? (index === focusIndex ? 0 : -1) : undefined,\n onFocus: (ev: React.FocusEvent<HTMLButtonElement>) => {\n if (rovingTabindex) setFocusIndex(index);\n childEl.props.onFocus?.(ev);\n },\n ref: setMergedRef,\n } as unknown as Partial<IconButtonProps>;\n\n return cloneElement(childEl, overrides);\n });\n\n const mergedRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref && typeof ref === 'object') {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n };\n\n if (!overflowEnabled) {\n return (\n <div\n ref={mergedRootRef}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={handleRootKeyDown}\n className={iconButtonGroupVariants({ orientation, className })}\n data-component=\"icon-button-group\"\n {...rest}\n >\n {enhanced}\n </div>\n );\n }\n\n /* ---- Menu path: measurement rows + strip + ellipsis trigger ---- */\n const moreLabel = t('buttonGroup.more', 'More options');\n const groupDisabled = disabled === true;\n const overflowItems = allElements\n .map((childEl, i) => ({ childEl, i }))\n .filter(({ i }) => !visible[i]);\n\n let menuContent: ReactNode = null;\n if (mode === 'toggle-single') {\n menuContent = (\n <DropdownMenu.RadioGroup\n value={resolvedValue as string}\n onValueChange={(v) => {\n if (!groupDisabled && v !== resolvedValue) commitValue(v);\n }}\n >\n {overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.RadioItem\n key={childEl.key ?? i}\n value={childEl.props.value ?? ''}\n disabled={groupDisabled || childEl.props.disabled === true}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n );\n } else if (mode === 'toggle-multi') {\n menuContent = overflowItems.map(({ childEl, i }) => {\n const v = childEl.props.value;\n const list = resolvedValue as string[];\n const checked = v ? list.includes(v) : false;\n return (\n <DropdownMenu.CheckboxItem\n key={childEl.key ?? i}\n checked={checked}\n disabled={groupDisabled || childEl.props.disabled === true}\n onCheckedChange={() => {\n if (groupDisabled || !v) return;\n commitValue(checked ? list.filter((x) => x !== v) : [...list, v]);\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.CheckboxItem>\n );\n });\n } else {\n menuContent = overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.Item\n key={childEl.key ?? i}\n startIcon={childEl.props.icon}\n disabled={groupDisabled || childEl.props.disabled === true}\n onSelect={(event) => {\n childEl.props.onClick?.(\n event as unknown as React.MouseEvent<HTMLButtonElement>,\n );\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.Item>\n ));\n }\n\n const trigger = overflowing ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n ref={(node: HTMLButtonElement | null) => {\n triggerNodeRef.current = node;\n registerIndex(visibleCount, node);\n }}\n tabIndex={\n rovingTabindex\n ? focusIndex === visibleCount\n ? 0\n : -1\n : undefined\n }\n onFocus={\n rovingTabindex ? () => setFocusIndex(visibleCount) : undefined\n }\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">{menuContent}</DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null;\n\n const stripClasses = iconButtonGroupVariants({ orientation });\n // A radiogroup may own only radios, so its trigger sits beside the strip;\n // toolbar / group keep the trigger inside as the last joined control.\n const triggerInside = role !== 'radiogroup';\n const stripDiv = (\n <div\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={triggerInside ? handleRootKeyDown : undefined}\n className={`${stripClasses} ds:max-w-full`}\n >\n {enhanced}\n {triggerInside ? trigger : null}\n </div>\n );\n\n return (\n <div\n ref={mergedRootRef}\n data-component=\"icon-button-group\"\n className={[\n 'ds:relative ds:block ds:w-full ds:min-w-0 ds:overflow-x-clip',\n className ?? '',\n ]\n .join(' ')\n .trim()}\n {...rest}\n >\n <div ref={containerRef} className=\"ds:block ds:w-full ds:min-w-0\">\n <div\n ref={fullRowRef}\n aria-hidden=\"true\"\n inert\n className={`${MEASURE_ROW_CLASSES} ${stripClasses}`}\n >\n {allElements.map((childEl, i) =>\n cloneElement(childEl, {\n key: childEl.key ?? i,\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n tabIndex: -1,\n ref: null,\n } as Partial<OverflowChildProps>),\n )}\n </div>\n <span\n ref={triggerProbeRef}\n aria-hidden=\"true\"\n inert\n className={MEASURE_ROW_CLASSES}\n >\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n tabIndex={-1}\n />\n </span>\n {triggerInside ? (\n stripDiv\n ) : (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- non-focusable wrapper; arrow-key roving bubbles up from the focusable IconButtons in the strip and the overflow trigger\n <div\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n onKeyDown={handleRootKeyDown}\n >\n {stripDiv}\n {trigger}\n </div>\n )}\n </div>\n </div>\n );\n },\n);\n\nIconButtonGroup.displayName = 'IconButtonGroup';\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction computeToggleAria(\n mode: IconButtonGroupMode,\n role: IconButtonGroupRole,\n childValue: string | undefined,\n resolvedValue: string | string[],\n): { ariaPressed?: boolean; ariaChecked?: boolean } {\n if (mode === 'momentary' || !childValue) return {};\n\n const isActive =\n mode === 'toggle-multi'\n ? (resolvedValue as string[]).includes(childValue)\n : resolvedValue === childValue;\n\n // radiogroup uses aria-checked; toolbar/group use aria-pressed.\n if (role === 'radiogroup') {\n return { ariaChecked: isActive };\n }\n return { ariaPressed: isActive };\n}\n"],"names":["iconButtonGroupVariants","cva","MEASURE_ROW_CLASSES","IconButtonGroup","forwardRef","props","ref","size","orientation","role","mode","disabled","intent","overflow","className","children","ariaLabel","ariaLabelledBy","_value","_defaultValue","_onValueChange","rest","t","useTranslation","overflowEnabled","internalValue","setInternalValue","useState","resolvedValue","p","commitValue","useCallback","next","_a","_b","rovingTabindex","buttonsRef","useRef","focusIndex","setFocusIndex","registerIndex","index","el","rootRef","isRTL","setIsRTL","useIsomorphicLayoutEffect","node","dir","handleRootKeyDown","event","count","forwardKey","backwardKey","maxAttempts","attempts","candidate","child","childArrayRef","cValue","allElements","Children","isValidElement","mirrorLabel","aria","pinnedFlags","explicit","mirrorable","containerRef","fullRowRef","triggerProbeRef","visible","overflowing","usePriorityOverflow","triggerNodeRef","childArray","_","i","checkedIndex","useEffect","visibleCount","total","enhanced","childEl","childValue","ariaPressed","ariaChecked","computeToggleAria","groupDisabled","childDisabled","wrappedOnClick","list","v","setMergedRef","originalRef","ariaDisabled","needsWrappedClick","overrides","ev","cloneElement","mergedRootRef","jsx","moreLabel","overflowItems","menuContent","DropdownMenu","checked","x","trigger","jsxs","IconButton","Ellipsis","stripClasses","triggerInside","stripDiv","isActive"],"mappings":";;;;;;;;;AAsCA,MAAMA,KAA0BC;AAAA,EAC9B;AAAA,IACE;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,YAAY;AAAA,UACV;AAAA;AAAA;AAAA,UAGA;AAAA,UACA;AAAA;AAAA,UAEA;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,UAIA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,UAAU;AAAA,UACR;AAAA;AAAA;AAAA;AAAA,UAIA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB;AAAA,MACf,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAIMC,KACJ,uEAqFWC,KAAkBC;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,MAAAC;AAAA,MACA,aAAAC,IAAc;AAAA,MACd,MAAAC,IAAO;AAAA,MACP,MAAAC,IAAO;AAAA,MACP,UAAAC,IAAW;AAAA,MACX,QAAAC,IAAS;AAAA,MACT,UAAAC,KAAW;AAAA,MACX,WAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAcC;AAAA,MACd,mBAAmBC;AAAA;AAAA;AAAA;AAAA,M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C5B,UAAU;AAAA,kBACV,KAAK;AAAA,gBAAA,CACyB;AAAA,cAAA;AAAA,YAClC;AAAA,UAAA;AAAA,UAEF,gBAAA8F;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK/B;AAAA,cACL,eAAY;AAAA,cACZ,OAAK;AAAA,cACL,WAAWpE;AAAA,cAEX,UAAA,gBAAAmG;AAAA,gBAACS;AAAA,gBAAA;AAAA,kBACC,wBAAOC,IAAA,EAAS;AAAA,kBAChB,QAAAnG;AAAA,kBACA,MAAAL;AAAA,kBACA,cAAY+F;AAAA,kBACZ,UAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA;AAAA,UAEDW,IACCC;AAAA;AAAA,YAGA,gBAAAL;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,WAAW5D;AAAA,gBAEV,UAAA;AAAA,kBAAAiE;AAAA,kBACAN;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA;AAAA,QACH,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAzG,GAAgB,cAAc;AAM9B,SAASoF,GACP7E,GACAD,GACA2E,GACAxD,GACkD;AAClD,MAAIlB,MAAS,eAAe,CAAC0E,UAAmB,CAAA;AAEhD,QAAM+B,IACJzG,MAAS,iBACJkB,EAA2B,SAASwD,CAAU,IAC/CxD,MAAkBwD;AAGxB,SAAI3E,MAAS,eACJ,EAAE,aAAa0G,EAAA,IAEjB,EAAE,aAAaA,EAAA;AACxB;"}
1
+ {"version":3,"file":"icon-button-group-D6SVMteH.js","sources":["../../src/components/icon-button-group/icon-button-group.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Ellipsis } from 'lucide-react';\nimport { IconButton, type IconButtonProps } from '../button/icon-button';\nimport type { ButtonProps } from '../button/button';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { usePriorityOverflow } from '../../hooks/use-priority-overflow';\n\ntype ButtonIntent = NonNullable<ButtonProps['intent']>;\n\n// Intentionally does NOT compose `@radix-ui/react-toggle-group`. Radix\n// ToggleGroup's render shape makes it hard to layer shared-border chrome\n// across children (first-child / last-child / internal-divider CSS), and\n// the three-mode + three-role matrix (group / toolbar / radiogroup × momentary\n// / toggle-single / toggle-multi) is broader than Radix's single / multi\n// contract. The roving-tabindex implementation below mirrors Radix's pattern\n// so keyboard semantics stay consistent. See 05-accessibility.mdx for the\n// WAI-ARIA toolbar / radiogroup references.\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst iconButtonGroupVariants = cva(\n [\n 'ds:inline-flex ds:isolate',\n // Hairline border around the group unifies the children into one\n // visual unit. Internal child dividers are drawn via the per-child\n // class list below.\n 'ds:border ds:border-border',\n 'ds:rounded-[var(--radius-md)]',\n // Ensure the focus ring of a pressed child sits above its siblings.\n 'ds:[&>*]:relative ds:[&>*:focus-visible]:z-10',\n ].join(' '),\n {\n variants: {\n orientation: {\n horizontal: [\n 'ds:flex-row',\n // Flatten internal corners on children so the outer radius owns\n // the rounded edges.\n 'ds:[&>*:not(:first-child)]:rounded-s-none',\n 'ds:[&>*:not(:last-child)]:rounded-e-none',\n // Internal divider — logical so it flips in RTL.\n 'ds:[&>*:not(:first-child)]:border-s',\n 'ds:[&>*:not(:first-child)]:border-border',\n // The children already own an outer border (from IconButton's\n // own border in secondary/outline variants). Collapse the doubled\n // border so we don't get a 2px seam.\n 'ds:[&>*]:border-0',\n ].join(' '),\n vertical: [\n 'ds:flex-col',\n // Vertical groups flow block-wise. Reading direction doesn't\n // invert vertical stacks in any locale this DS targets, so the\n // physical `rounded-t/b` is intentional.\n 'ds:[&>*:not(:first-child)]:rounded-t-none',\n 'ds:[&>*:not(:last-child)]:rounded-b-none',\n 'ds:[&>*:not(:first-child)]:border-t',\n 'ds:[&>*:not(:first-child)]:border-border',\n 'ds:[&>*]:border-0',\n ].join(' '),\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n },\n);\n\n// Hidden measurement rows: laid out (so widths are real) but invisible,\n// non-interactive and out of the a11y tree. Never display:none.\nconst MEASURE_ROW_CLASSES =\n 'ds:absolute ds:start-0 ds:top-0 ds:invisible ds:pointer-events-none';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type IconButtonGroupRole = 'group' | 'toolbar' | 'radiogroup';\nexport type IconButtonGroupMode =\n | 'momentary'\n | 'toggle-single'\n | 'toggle-multi';\n\ntype SharedPropsBase = {\n /** Forwarded to every child that does not set its own `size`. */\n size?: 'sm' | 'md' | 'lg';\n orientation?: 'horizontal' | 'vertical';\n /** Disables every child. Uses `aria-disabled` on children (not the HTML\n * attribute) so each child still takes focus — matches WAI-ARIA toolbar\n * guidance. Visual disabled styling picks up the `aria-disabled:*`\n * variant declared on the Button base class. */\n disabled?: boolean;\n /** Intent applied to every child that does not set its own `intent`.\n * Defaults to `outline` — grouped icon buttons are peers, not a row\n * of solid-primary CTAs. */\n intent?: ButtonIntent;\n /** `'menu'` keeps the strip on one line whatever the container width:\n * children that stop fitting move into a dropdown behind an ellipsis\n * trigger, preserving toggle semantics (radio / checkbox items). The\n * group then fills its container's inline size. Horizontal only.\n * Children set `data-overflow-pin` to always stay in the strip. */\n overflow?: 'none' | 'menu';\n children: ReactNode;\n};\n\n// At least one of `aria-label` / `aria-labelledby` must be present. This\n// discriminated pair makes the TypeScript compiler reject a group with\n// neither — see the a11y acceptance criteria in the user story.\ntype AccessibleNameProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-label'?: never; 'aria-labelledby': string };\n\ntype SharedProps = SharedPropsBase & AccessibleNameProps;\n\n// Role + mode combinations are not all valid. Encoded via a discriminated\n// union so the compiler rejects nonsensical pairings (e.g. a multi-select\n// radiogroup).\ntype GroupRoleProps =\n | { role?: 'group'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'toolbar'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'radiogroup'; mode: 'toggle-single' };\n\ntype MomentaryProps = SharedProps & {\n mode?: 'momentary';\n value?: never;\n defaultValue?: never;\n onValueChange?: never;\n};\n\ntype ToggleSingleProps = SharedProps & {\n mode: 'toggle-single';\n value?: string;\n defaultValue?: string;\n onValueChange?: (next: string) => void;\n};\n\ntype ToggleMultiProps = SharedProps & {\n mode: 'toggle-multi';\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (next: string[]) => void;\n};\n\nexport type IconButtonGroupProps = (\n | MomentaryProps\n | ToggleSingleProps\n | ToggleMultiProps\n) &\n GroupRoleProps &\n Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'onChange' | 'children'> &\n VariantProps<typeof iconButtonGroupVariants>;\n\n/* ------------------------------------------------------------------ */\n/* IconButtonGroup */\n/* ------------------------------------------------------------------ */\n\nexport const IconButtonGroup = forwardRef<HTMLDivElement, IconButtonGroupProps>(\n (props, ref) => {\n const {\n size,\n orientation = 'horizontal',\n role = 'group',\n mode = 'momentary',\n disabled = false,\n intent = 'outline',\n overflow = 'none',\n className,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n // Controlled-value props are consumed via `props as …` below; strip them\n // here so they never spread onto the root <div> (React would warn that\n // `onValueChange` is an unknown DOM event handler).\n value: _value,\n defaultValue: _defaultValue,\n onValueChange: _onValueChange,\n ...rest\n } = props as IconButtonGroupProps & { className?: string };\n const { t } = useTranslation();\n\n if (import.meta.env.DEV && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'IconButtonGroup: `aria-label` or `aria-labelledby` is required for accessibility.',\n );\n }\n if (\n import.meta.env.DEV &&\n overflow === 'menu' &&\n orientation === 'vertical'\n ) {\n console.warn(\n 'IconButtonGroup: overflow=\"menu\" is horizontal-only; falling back to overflow=\"none\".',\n );\n }\n const overflowEnabled = overflow === 'menu' && orientation !== 'vertical';\n\n /* ---- Controlled / uncontrolled value for toggle modes --------- */\n const [internalValue, setInternalValue] = useState<string | string[]>(\n () => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.defaultValue ?? '';\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.defaultValue ?? [];\n }\n return '';\n },\n );\n\n const resolvedValue: string | string[] = (() => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n return '';\n })();\n\n const commitValue = useCallback(\n (next: string | string[]) => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n if (p.value === undefined) setInternalValue(next as string);\n p.onValueChange?.(next as string);\n } else if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n if (p.value === undefined) setInternalValue(next as string[]);\n p.onValueChange?.(next as string[]);\n }\n },\n [mode, props],\n );\n\n /* ---- Roving tabindex state — only active in toolbar / radiogroup - */\n const rovingTabindex = role === 'toolbar' || role === 'radiogroup';\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const [focusIndex, setFocusIndex] = useState(0);\n\n const registerIndex = useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonsRef.current[index] = el;\n },\n [],\n );\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [isRTL, setIsRTL] = useState(false);\n // `useLayoutEffect` so the direction is correct BEFORE the first paint\n // (otherwise a user pressing an arrow key on the first frame after mount\n // would hit the default-LTR mapping even in an RTL document).\n useIsomorphicLayoutEffect(() => {\n if (typeof window === 'undefined') return;\n const node = rootRef.current;\n if (!node) return;\n // Read the computed direction from the group's own wrapper so a\n // scoped `dir='rtl'` on any ancestor (not just <html>) flips arrow\n // navigation. `getComputedStyle` walks up automatically.\n const dir = window.getComputedStyle(node).direction;\n setIsRTL(dir === 'rtl');\n }, []);\n\n /* ---- Arrow-key navigation for roving tabindex ----------------- */\n const handleRootKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!rovingTabindex) return;\n const count = buttonsRef.current.filter(Boolean).length;\n if (count === 0) return;\n\n const forwardKey =\n orientation === 'vertical'\n ? 'ArrowDown'\n : isRTL\n ? 'ArrowLeft'\n : 'ArrowRight';\n const backwardKey =\n orientation === 'vertical'\n ? 'ArrowUp'\n : isRTL\n ? 'ArrowRight'\n : 'ArrowLeft';\n\n let next: number | null = null;\n if (event.key === forwardKey) next = (focusIndex + 1) % count;\n else if (event.key === backwardKey)\n next = (focusIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n\n if (next === null) return;\n // Skip over disabled children.\n const maxAttempts = count;\n let attempts = 0;\n let candidate = next;\n while (attempts < maxAttempts) {\n const el = buttonsRef.current[candidate];\n if (\n el &&\n el.getAttribute('aria-disabled') !== 'true' &&\n !el.disabled\n ) {\n break;\n }\n candidate =\n event.key === backwardKey || event.key === 'End'\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n // WAI-ARIA radiogroup pattern: arrow keys MOVE focus AND CHANGE\n // the selected radio in one action. toolbar pattern (and plain\n // group) only moves focus.\n if (role === 'radiogroup' && mode === 'toggle-single') {\n const child = childArrayRef.current[candidate];\n if (child && typeof child === 'object' && 'props' in child) {\n const cValue = (child as ReactElement<{ value?: string }>).props\n .value;\n // Same guard as the click path: re-committing the already\n // selected value is a no-op, so Home/End on the selected radio\n // never fires a spurious onValueChange.\n if (cValue && cValue !== resolvedValue) commitValue(cValue);\n }\n }\n },\n [\n rovingTabindex,\n orientation,\n isRTL,\n focusIndex,\n role,\n mode,\n commitValue,\n resolvedValue,\n ],\n );\n\n /* ---- Overflow bookkeeping (menu mode only) --------------------- */\n type OverflowChildProps = IconButtonProps & {\n value?: string;\n 'data-overflow-pin'?: boolean | 'true' | '';\n };\n const allElements = overflowEnabled\n ? (Children.toArray(children).filter(isValidElement) as Array<\n ReactElement<OverflowChildProps>\n >)\n : [];\n const mirrorLabel = (child: ReactElement<OverflowChildProps>) => {\n const aria = child.props['aria-label'];\n if (typeof aria === 'string') return aria;\n return typeof child.props.tooltip === 'string'\n ? child.props.tooltip\n : null;\n };\n const warnedRef = useRef(false);\n const pinnedFlags = allElements.map((child) => {\n const explicit = child.props['data-overflow-pin'] !== undefined;\n const mirrorable = mirrorLabel(child) !== null;\n if (\n import.meta.env.DEV &&\n !explicit &&\n !mirrorable &&\n !warnedRef.current\n ) {\n warnedRef.current = true;\n console.warn(\n 'IconButtonGroup: a child without aria-label / tooltip cannot move into the overflow menu — it stays pinned in the strip.',\n );\n }\n return explicit || !mirrorable;\n });\n\n const { containerRef, fullRowRef, triggerProbeRef, visible, overflowing } =\n usePriorityOverflow({\n enabled: overflowEnabled,\n count: allElements.length,\n pinned: pinnedFlags,\n });\n\n const triggerNodeRef = useRef<HTMLButtonElement | null>(null);\n\n /* ---- Build enhanced children ---------------------------------- */\n const childArray = overflowEnabled\n ? allElements.filter((_, i) => visible[i])\n : Children.toArray(children);\n if (overflowEnabled) {\n buttonsRef.current.length = childArray.length + (overflowing ? 1 : 0);\n }\n // Mirror into a ref so the keydown handler (referenced from Memo deps)\n // can read the latest child list without inflating the dep array.\n const childArrayRef = useRef<ReturnType<typeof Children.toArray>>([]);\n childArrayRef.current = childArray;\n\n // APG radiogroup pattern: Tab must land on the CHECKED radio, not the\n // first one. Keep the roving tab stop pinned to the selected child —\n // covers initial mount (checked child not first) and controlled value\n // changes. Arrow/click interactions already align focusIndex with the\n // selection, so this effect is a no-op for them.\n const checkedIndex =\n role === 'radiogroup' && mode === 'toggle-single'\n ? childArray.findIndex(\n (child) =>\n isValidElement(child) &&\n (child as ReactElement<{ value?: string }>).props.value ===\n resolvedValue,\n )\n : -1;\n useEffect(() => {\n if (checkedIndex >= 0) setFocusIndex(checkedIndex);\n }, [checkedIndex]);\n\n const visibleCount = childArray.length;\n // Clamp the roving focus when items move into the menu; hand real focus\n // to the trigger only when the focused node was the one that left.\n useEffect(() => {\n if (!rovingTabindex || !overflowEnabled) return;\n const total = visibleCount + (overflowing ? 1 : 0);\n if (total > 0 && focusIndex >= total) {\n setFocusIndex(total - 1);\n if (document.activeElement === document.body) {\n triggerNodeRef.current?.focus();\n }\n }\n }, [\n rovingTabindex,\n overflowEnabled,\n visibleCount,\n overflowing,\n focusIndex,\n ]);\n\n const enhanced = childArray.map((child, index) => {\n if (!isValidElement(child)) {\n if (import.meta.env.DEV) {\n console.warn(\n 'IconButtonGroup: children should be <IconButton> elements.',\n );\n }\n return child;\n }\n\n const childEl = child as ReactElement<\n IconButtonProps & {\n value?: string;\n asChild?: boolean;\n children?: ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n }\n >;\n\n // DEV-time sanity: warn if we got something that isn't an IconButton.\n // `React.cloneElement` would still work, but IconButton-specific\n // props (::before target size, forwarded tooltip) wouldn't apply.\n // `asChild` wrappers (e.g. DropdownMenu.Trigger) are fine when they\n // Slot-merge the cloned props onto their own IconButton child, as are\n // components that declare a static `rendersIconButton` marker (the\n // DataTable toolbar leaves — each renders one IconButton trigger and\n // forwards ref/tabIndex/onFocus to it).\n if (import.meta.env.DEV && childEl.type !== IconButton) {\n const slotChild =\n childEl.props.asChild === true ? childEl.props.children : null;\n const wrapsIconButton =\n isValidElement(slotChild) && slotChild.type === IconButton;\n const rendersIconButton =\n (childEl.type as { rendersIconButton?: boolean })\n .rendersIconButton === true;\n if (!wrapsIconButton && !rendersIconButton) {\n console.warn(\n 'IconButtonGroup: each child should be a DS <IconButton>. Other elements break target-size + focus-ring contracts.',\n );\n }\n }\n\n const childValue = childEl.props.value;\n\n // Compute aria-pressed / aria-checked for toggle modes.\n const { ariaPressed, ariaChecked } = computeToggleAria(\n mode,\n role,\n childValue,\n resolvedValue,\n );\n\n const groupDisabled = disabled === true;\n const childDisabled = childEl.props.disabled === true;\n\n // Click handling — wrap so aria-disabled (group-level) blocks\n // activation, then forward to the child's own onClick.\n const wrappedOnClick: React.MouseEventHandler<HTMLButtonElement> = (\n event,\n ) => {\n // aria-disabled is advisory; the native click still fires. Block\n // it explicitly when the GROUP (not the child) is disabled.\n if (groupDisabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n // Forward to the child's own handler first so consumers can run\n // analytics / preventDefault.\n childEl.props.onClick?.(event);\n if (event.defaultPrevented) return;\n if (!childValue) return;\n if (mode === 'toggle-single') {\n // Contract: exactly one pressed. Clicking the pressed one is a\n // no-op. This matches Radix ToggleGroup type='single' and the\n // radiogroup pattern.\n if (resolvedValue === childValue) return;\n commitValue(childValue);\n } else if (mode === 'toggle-multi') {\n const list = resolvedValue as string[];\n const next = list.includes(childValue)\n ? list.filter((v) => v !== childValue)\n : [...list, childValue];\n commitValue(next);\n }\n };\n\n // cloneElement's typed overload rejects `ref` as a prop, so we\n // build the override bag as `unknown` and cast to the element's\n // prop type. React at runtime routes `ref` via its usual channel.\n const setMergedRef = (node: HTMLButtonElement | null) => {\n registerIndex(index, node);\n const originalRef = (\n childEl as unknown as { ref?: React.Ref<HTMLButtonElement> }\n ).ref;\n if (typeof originalRef === 'function') originalRef(node);\n else if (\n originalRef !== null &&\n originalRef !== undefined &&\n typeof originalRef === 'object'\n ) {\n (\n originalRef as React.MutableRefObject<HTMLButtonElement | null>\n ).current = node;\n }\n };\n\n // Per the user story: group-level disabled injects `aria-disabled`\n // so the child stays focusable; child-level `disabled` still uses\n // the HTML attribute (child's own contract). When both are true\n // we leave the HTML disabled in place (strictest cue wins).\n const ariaDisabled = groupDisabled && !childDisabled ? true : undefined;\n\n // If the group is disabled OR we are in a toggle mode, we need the\n // wrapped click handler. In pure momentary mode with no group\n // disable, the child's own onClick is passed through unchanged.\n const needsWrappedClick = mode !== 'momentary' || groupDisabled;\n\n const overrides = {\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n disabled: childDisabled,\n 'aria-disabled': ariaDisabled,\n onClick: needsWrappedClick ? wrappedOnClick : childEl.props.onClick,\n 'aria-pressed': ariaPressed,\n 'aria-checked': ariaChecked,\n // When the group is a radiogroup, children must be `role=\"radio\"`\n // so screen readers announce them as radio buttons and so\n // `getByRole('radio')` works in tests. The button element is\n // re-purposed as a radio; `aria-checked` above carries the state.\n role: role === 'radiogroup' ? 'radio' : undefined,\n tabIndex: rovingTabindex ? (index === focusIndex ? 0 : -1) : undefined,\n onFocus: (ev: React.FocusEvent<HTMLButtonElement>) => {\n if (rovingTabindex) setFocusIndex(index);\n childEl.props.onFocus?.(ev);\n },\n ref: setMergedRef,\n } as unknown as Partial<IconButtonProps>;\n\n return cloneElement(childEl, overrides);\n });\n\n const mergedRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref && typeof ref === 'object') {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n };\n\n if (!overflowEnabled) {\n return (\n <div\n ref={mergedRootRef}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={handleRootKeyDown}\n className={iconButtonGroupVariants({ orientation, className })}\n data-component=\"icon-button-group\"\n {...rest}\n >\n {enhanced}\n </div>\n );\n }\n\n /* ---- Menu path: measurement rows + strip + ellipsis trigger ---- */\n const moreLabel = t('buttonGroup.more', 'More options');\n const groupDisabled = disabled === true;\n const overflowItems = allElements\n .map((childEl, i) => ({ childEl, i }))\n .filter(({ i }) => !visible[i]);\n\n let menuContent: ReactNode = null;\n if (mode === 'toggle-single') {\n menuContent = (\n <DropdownMenu.RadioGroup\n value={resolvedValue as string}\n onValueChange={(v) => {\n if (!groupDisabled && v !== resolvedValue) commitValue(v);\n }}\n >\n {overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.RadioItem\n key={childEl.key ?? i}\n value={childEl.props.value ?? ''}\n disabled={groupDisabled || childEl.props.disabled === true}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n );\n } else if (mode === 'toggle-multi') {\n menuContent = overflowItems.map(({ childEl, i }) => {\n const v = childEl.props.value;\n const list = resolvedValue as string[];\n const checked = v ? list.includes(v) : false;\n return (\n <DropdownMenu.CheckboxItem\n key={childEl.key ?? i}\n checked={checked}\n disabled={groupDisabled || childEl.props.disabled === true}\n onCheckedChange={() => {\n if (groupDisabled || !v) return;\n commitValue(checked ? list.filter((x) => x !== v) : [...list, v]);\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.CheckboxItem>\n );\n });\n } else {\n menuContent = overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.Item\n key={childEl.key ?? i}\n startIcon={childEl.props.icon}\n disabled={groupDisabled || childEl.props.disabled === true}\n onSelect={(event) => {\n childEl.props.onClick?.(\n event as unknown as React.MouseEvent<HTMLButtonElement>,\n );\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.Item>\n ));\n }\n\n const trigger = overflowing ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n ref={(node: HTMLButtonElement | null) => {\n triggerNodeRef.current = node;\n registerIndex(visibleCount, node);\n }}\n tabIndex={\n rovingTabindex\n ? focusIndex === visibleCount\n ? 0\n : -1\n : undefined\n }\n onFocus={\n rovingTabindex ? () => setFocusIndex(visibleCount) : undefined\n }\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">{menuContent}</DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null;\n\n const stripClasses = iconButtonGroupVariants({ orientation });\n // A radiogroup may own only radios, so its trigger sits beside the strip;\n // toolbar / group keep the trigger inside as the last joined control.\n const triggerInside = role !== 'radiogroup';\n const stripDiv = (\n <div\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={triggerInside ? handleRootKeyDown : undefined}\n className={`${stripClasses} ds:max-w-full`}\n >\n {enhanced}\n {triggerInside ? trigger : null}\n </div>\n );\n\n return (\n <div\n ref={mergedRootRef}\n data-component=\"icon-button-group\"\n className={[\n 'ds:relative ds:block ds:w-full ds:min-w-0 ds:overflow-x-clip',\n className ?? '',\n ]\n .join(' ')\n .trim()}\n {...rest}\n >\n <div ref={containerRef} className=\"ds:block ds:w-full ds:min-w-0\">\n <div\n ref={fullRowRef}\n aria-hidden=\"true\"\n inert\n className={`${MEASURE_ROW_CLASSES} ${stripClasses}`}\n >\n {allElements.map((childEl, i) =>\n cloneElement(childEl, {\n key: childEl.key ?? i,\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n tabIndex: -1,\n ref: null,\n } as Partial<OverflowChildProps>),\n )}\n </div>\n <span\n ref={triggerProbeRef}\n aria-hidden=\"true\"\n inert\n className={MEASURE_ROW_CLASSES}\n >\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n tabIndex={-1}\n />\n </span>\n {triggerInside ? (\n stripDiv\n ) : (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- non-focusable wrapper; arrow-key roving bubbles up from the focusable IconButtons in the strip and the overflow trigger\n <div\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n onKeyDown={handleRootKeyDown}\n >\n {stripDiv}\n {trigger}\n </div>\n )}\n </div>\n </div>\n );\n },\n);\n\nIconButtonGroup.displayName = 'IconButtonGroup';\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction computeToggleAria(\n mode: IconButtonGroupMode,\n role: IconButtonGroupRole,\n childValue: string | undefined,\n resolvedValue: string | string[],\n): { ariaPressed?: boolean; ariaChecked?: boolean } {\n if (mode === 'momentary' || !childValue) return {};\n\n const isActive =\n mode === 'toggle-multi'\n ? (resolvedValue as string[]).includes(childValue)\n : resolvedValue === childValue;\n\n // radiogroup uses aria-checked; toolbar/group use aria-pressed.\n if (role === 'radiogroup') {\n return { ariaChecked: isActive };\n }\n return { ariaPressed: isActive };\n}\n"],"names":["iconButtonGroupVariants","cva","MEASURE_ROW_CLASSES","IconButtonGroup","forwardRef","props","ref","size","orientation","role","mode","disabled","intent","overflow","className","children","ariaLabel","ariaLabelledBy","_value","_defaultValue","_onValueChange","rest","t","useTranslation","overflowEnabled","internalValue","setInternalValue","useState","resolvedValue","p","commitValue","useCallback","next","_a","_b","rovingTabindex","buttonsRef","useRef","focusIndex","setFocusIndex","registerIndex","index","el","rootRef","isRTL","setIsRTL","useIsomorphicLayoutEffect","node","dir","handleRootKeyDown","event","count","forwardKey","backwardKey","maxAttempts","attempts","candidate","child","childArrayRef","cValue","allElements","Children","isValidElement","mirrorLabel","aria","pinnedFlags","explicit","mirrorable","containerRef","fullRowRef","triggerProbeRef","visible","overflowing","usePriorityOverflow","triggerNodeRef","childArray","_","i","checkedIndex","useEffect","visibleCount","total","enhanced","childEl","childValue","ariaPressed","ariaChecked","computeToggleAria","groupDisabled","childDisabled","wrappedOnClick","list","v","setMergedRef","originalRef","ariaDisabled","needsWrappedClick","overrides","ev","cloneElement","mergedRootRef","jsx","moreLabel","overflowItems","menuContent","DropdownMenu","checked","x","trigger","jsxs","IconButton","Ellipsis","stripClasses","triggerInside","stripDiv","isActive"],"mappings":";;;;;;;;;AAsCA,MAAMA,KAA0BC;AAAA,EAC9B;AAAA,IACE;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;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A;AAAA,gBACC,WAAU;AAAA,gBACV,WAAW5D;AAAA,gBAEV,UAAA;AAAA,kBAAAiE;AAAA,kBACAN;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA;AAAA,QACH,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAzG,GAAgB,cAAc;AAM9B,SAASoF,GACP7E,GACAD,GACA2E,GACAxD,GACkD;AAClD,MAAIlB,MAAS,eAAe,CAAC0E,UAAmB,CAAA;AAEhD,QAAM+B,IACJzG,MAAS,iBACJkB,EAA2B,SAASwD,CAAU,IAC/CxD,MAAkBwD;AAGxB,SAAI3E,MAAS,eACJ,EAAE,aAAa0G,EAAA,IAEjB,EAAE,aAAaA,EAAA;AACxB;"}
@@ -2,8 +2,8 @@ import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as H, useState as y, useRef as h, useCallback as v, useMemo as b } from "react";
3
3
  import { c as M } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as F } from "react-i18next";
5
- import { P as k } from "./popover-Btj6N25H.js";
6
- import { B as D } from "./button-BvNtqHAS.js";
5
+ import { P as k } from "./popover-Cqcjx-Ny.js";
6
+ import { B as D } from "./button-nJaPh_HC.js";
7
7
  import { T as E } from "./text-input-CUvCb6ST.js";
8
8
  import { u as G } from "./registry-DvAUVLHh.js";
9
9
  import { S as J } from "./search-QbWPlY5f.js";
@@ -269,4 +269,4 @@ export {
269
269
  X as I,
270
270
  U as i
271
271
  };
272
- //# sourceMappingURL=icon-picker-DXV3sDp1.js.map
272
+ //# sourceMappingURL=icon-picker-ChzpCnZ-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-picker-DXV3sDp1.js","sources":["../../src/components/icon-picker/icon-picker.agent.ts","../../src/components/icon-picker/icon-picker.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — IconPicker. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { IconPickerHandle } from './icon-picker';\n\nexport const iconPickerAgent: AgentAdapter<IconPickerHandle> = {\n id: 'icon-picker',\n capabilities: ['pick', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.iconPicker.state.value',\n description:\n 'Id of the currently selected icon, or an empty string when nothing is picked.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.iconPicker.state.isOpen',\n description: 'True when the picker popover is currently open.',\n read: (handle) => handle.isOpen(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.iconPicker.state.query',\n description: 'Current search query filtering the icon grid by label.',\n read: (handle) => handle.getQuery(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'Id of an icon in the supplied `icons` set.',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.setValue',\n description: 'Select the icon with the given id.',\n examples: [{ args: { id: 'star' }, note: 'Pick the \"star\" icon.' }],\n invoke: (handle, args: { id: string }) => {\n handle.setValue(args.id);\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.open',\n description: 'Open the picker popover.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.close',\n description: 'Close the picker popover.',\n invoke: (handle) => {\n handle.close();\n },\n },\n filter: {\n safety: 'write',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description:\n 'Case-insensitive substring matched against icon labels.',\n },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.filter',\n description: 'Filter the icon grid to labels containing the query.',\n examples: [\n {\n args: { query: 'star' },\n note: 'Show icons whose label contains \"star\".',\n },\n ],\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'icon-picker',\n description: 'Marks the IconPicker trigger button.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Search } from 'lucide-react';\nimport { Popover } from '../popover';\nimport { Button } from '../button/button';\nimport { TextInput } from '../text-input/text-input';\nimport { useAgentRegistration } from '../../agent';\nimport { iconPickerAgent } from './icon-picker.agent';\n\n/** One selectable glyph. `label` is the accessible name (consumer-localised);\n * `node` is the rendered lucide/SVG element. */\nexport interface IconPickerIcon {\n id: string;\n label: string;\n node: ReactNode;\n}\n\n/** Agent-readiness curated handle for IconPicker. */\nexport interface IconPickerHandle {\n getValue: () => string;\n setValue: (id: string) => void;\n isOpen: () => boolean;\n open: () => void;\n close: () => void;\n getQuery: () => string;\n setQuery: (query: string) => void;\n}\n\nexport interface IconPickerProps {\n /** The glyph set. `label` is each glyph's accessible name. */\n icons: IconPickerIcon[];\n /** Controlled selected icon id. Pair with onChange. */\n value?: string;\n /** Uncontrolled initial selected icon id. */\n defaultValue?: string;\n /** Fires with the chosen icon id when a glyph is picked. */\n onChange?: (id: string) => void;\n /** Shown on the trigger when nothing is selected. */\n placeholder?: ReactNode;\n disabled?: boolean;\n id?: string;\n className?: string;\n /** Trigger accessible name. Defaults to the bundled `iconPicker.trigger`. */\n 'aria-label'?: string;\n}\n\n// Selectable glyph cell. The only variant is selection state — selected cells\n// take a tokenised highlight (primary border + muted fill); `aria-pressed`\n// carries the state non-visually so it never reads by colour alone.\nconst optionVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:items-center ds:justify-center',\n 'ds:size-[var(--min-target-size)] ds:rounded-[var(--radius-sm)]',\n 'ds:border ds:text-foreground ds:bg-transparent',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-muted/10',\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:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:[&_svg]:size-5',\n ].join(' '),\n {\n variants: {\n selected: {\n true: 'ds:border-primary ds:bg-muted',\n false: 'ds:border-transparent',\n },\n },\n defaultVariants: { selected: false },\n },\n);\n\nexport const IconPicker = forwardRef<HTMLButtonElement, IconPickerProps>(\n function IconPicker(\n {\n icons,\n value,\n defaultValue,\n onChange,\n placeholder,\n disabled,\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t } = useTranslation();\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const currentValue = isControlled ? (value ?? '') : internalValue;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n // Live snapshots for the synchronous agent handle.\n const currentValueRef = useRef(currentValue);\n currentValueRef.current = currentValue;\n const openRef = useRef(open);\n openRef.current = open;\n const queryRef = useRef(query);\n queryRef.current = query;\n\n const handleOpenChange = useCallback((next: boolean) => {\n setOpen(next);\n // Reset the filter when the popover closes so the next open starts fresh.\n if (!next) setQuery('');\n }, []);\n\n const setValueImperative = useCallback(\n (iconId: string) => {\n if (!isControlled) setInternalValue(iconId);\n onChange?.(iconId);\n },\n [isControlled, onChange],\n );\n\n const handleSelect = useCallback(\n (iconId: string) => {\n setValueImperative(iconId);\n handleOpenChange(false);\n },\n [setValueImperative, handleOpenChange],\n );\n\n const agentHandle = useMemo<IconPickerHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (iconId) => setValueImperative(iconId),\n isOpen: () => openRef.current,\n open: () => handleOpenChange(true),\n close: () => handleOpenChange(false),\n getQuery: () => queryRef.current,\n setQuery: (next) => setQuery(next),\n }),\n [setValueImperative, handleOpenChange],\n );\n useAgentRegistration(iconPickerAgent, agentHandle, id);\n\n const selectedIcon = useMemo(\n () => icons.find((icon) => icon.id === currentValue),\n [icons, currentValue],\n );\n\n const normalisedQuery = query.trim().toLowerCase();\n const filtered = useMemo(\n () =>\n normalisedQuery\n ? icons.filter((icon) =>\n icon.label.toLowerCase().includes(normalisedQuery),\n )\n : icons,\n [icons, normalisedQuery],\n );\n\n const triggerLabel = ariaLabel ?? t('iconPicker.trigger');\n const resolvedPlaceholder = placeholder ?? t('iconPicker.trigger');\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange} id={id}>\n <Popover.Trigger asChild>\n <Button\n ref={ref}\n type=\"button\"\n intent=\"outline\"\n disabled={disabled}\n aria-label={triggerLabel}\n className={className}\n data-component=\"icon-picker\"\n data-component-id={id}\n >\n {selectedIcon ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:[&_svg]:size-5\"\n >\n {selectedIcon.node}\n </span>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:text-muted-foreground\">\n {resolvedPlaceholder}\n </span>\n )}\n </Button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n showArrow={false}\n aria-label={triggerLabel}\n className=\"ds:w-72\"\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <TextInput\n size=\"sm\"\n value={query}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n setQuery(event.target.value)\n }\n placeholder={t('iconPicker.search')}\n aria-label={t('iconPicker.search')}\n startAdornment={<Search />}\n clearable\n onClear={() => setQuery('')}\n autoComplete=\"off\"\n />\n\n {filtered.length === 0 ? (\n <p\n role=\"status\"\n className=\"type-body-sm ds:text-muted-foreground ds:text-center ds:py-[var(--spacing-sm)]\"\n >\n {t('iconPicker.noResults')}\n </p>\n ) : (\n <div\n role=\"group\"\n aria-label={triggerLabel}\n className=\"ds:grid ds:grid-cols-5 ds:gap-[var(--spacing-xs)] ds:max-h-64 ds:overflow-y-auto\"\n >\n {filtered.map((icon) => {\n const selected = icon.id === currentValue;\n return (\n <button\n key={icon.id}\n type=\"button\"\n aria-label={icon.label}\n aria-pressed={selected}\n onClick={() => handleSelect(icon.id)}\n className={optionVariants({ selected })}\n >\n <span aria-hidden=\"true\" className=\"ds:inline-flex\">\n {icon.node}\n </span>\n </button>\n );\n })}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Root>\n );\n },\n);\n\nIconPicker.displayName = 'IconPicker';\n\nexport { optionVariants as iconPickerOptionVariants };\n"],"names":["iconPickerAgent","handle","args","optionVariants","cva","IconPicker","forwardRef","icons","value","defaultValue","onChange","placeholder","disabled","id","className","ariaLabel","ref","t","useTranslation","isControlled","internalValue","setInternalValue","useState","currentValue","open","setOpen","query","setQuery","currentValueRef","useRef","openRef","queryRef","handleOpenChange","useCallback","next","setValueImperative","iconId","handleSelect","agentHandle","useMemo","useAgentRegistration","selectedIcon","icon","normalisedQuery","filtered","triggerLabel","resolvedPlaceholder","Popover","jsx","Button","jsxs","TextInput","event","Search","selected"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,UAAU,QAAQ,OAAO;AAAA,EAChD,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,IAElC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MA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gBAAAI;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,WAAU;AAAA,gBAET,YAAE,sBAAsB;AAAA,cAAA;AAAA,YAAA,IAG3B,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,cAAYH;AAAA,gBACZ,WAAU;AAAA,gBAET,UAAAD,EAAS,IAAI,CAACF,MAAS;AACtB,wBAAMY,IAAWZ,EAAK,OAAOnB;AAC7B,yBACE,gBAAAyB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBAEC,MAAK;AAAA,sBACL,cAAYN,EAAK;AAAA,sBACjB,gBAAcY;AAAA,sBACd,SAAS,MAAMjB,EAAaK,EAAK,EAAE;AAAA,sBACnC,WAAWvC,EAAe,EAAE,UAAAmD,GAAU;AAAA,sBAEtC,4BAAC,QAAA,EAAK,eAAY,QAAO,WAAU,kBAChC,YAAK,KAAA,CACR;AAAA,oBAAA;AAAA,oBATKZ,EAAK;AAAA,kBAAA;AAAA,gBAYhB,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEArC,EAAW,cAAc;"}
1
+ {"version":3,"file":"icon-picker-ChzpCnZ-.js","sources":["../../src/components/icon-picker/icon-picker.agent.ts","../../src/components/icon-picker/icon-picker.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — IconPicker. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { IconPickerHandle } from './icon-picker';\n\nexport const iconPickerAgent: AgentAdapter<IconPickerHandle> = {\n id: 'icon-picker',\n capabilities: ['pick', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.iconPicker.state.value',\n description:\n 'Id of the currently selected icon, or an empty string when nothing is picked.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.iconPicker.state.isOpen',\n description: 'True when the picker popover is currently open.',\n read: (handle) => handle.isOpen(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.iconPicker.state.query',\n description: 'Current search query filtering the icon grid by label.',\n read: (handle) => handle.getQuery(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'Id of an icon in the supplied `icons` set.',\n },\n },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.setValue',\n description: 'Select the icon with the given id.',\n examples: [{ args: { id: 'star' }, note: 'Pick the \"star\" icon.' }],\n invoke: (handle, args: { id: string }) => {\n handle.setValue(args.id);\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.open',\n description: 'Open the picker popover.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.close',\n description: 'Close the picker popover.',\n invoke: (handle) => {\n handle.close();\n },\n },\n filter: {\n safety: 'write',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description:\n 'Case-insensitive substring matched against icon labels.',\n },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.iconPicker.actions.filter',\n description: 'Filter the icon grid to labels containing the query.',\n examples: [\n {\n args: { query: 'star' },\n note: 'Show icons whose label contains \"star\".',\n },\n ],\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'icon-picker',\n description: 'Marks the IconPicker trigger button.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Search } from 'lucide-react';\nimport { Popover } from '../popover';\nimport { Button } from '../button/button';\nimport { TextInput } from '../text-input/text-input';\nimport { useAgentRegistration } from '../../agent';\nimport { iconPickerAgent } from './icon-picker.agent';\n\n/** One selectable glyph. `label` is the accessible name (consumer-localised);\n * `node` is the rendered lucide/SVG element. */\nexport interface IconPickerIcon {\n id: string;\n label: string;\n node: ReactNode;\n}\n\n/** Agent-readiness curated handle for IconPicker. */\nexport interface IconPickerHandle {\n getValue: () => string;\n setValue: (id: string) => void;\n isOpen: () => boolean;\n open: () => void;\n close: () => void;\n getQuery: () => string;\n setQuery: (query: string) => void;\n}\n\nexport interface IconPickerProps {\n /** The glyph set. `label` is each glyph's accessible name. */\n icons: IconPickerIcon[];\n /** Controlled selected icon id. Pair with onChange. */\n value?: string;\n /** Uncontrolled initial selected icon id. */\n defaultValue?: string;\n /** Fires with the chosen icon id when a glyph is picked. */\n onChange?: (id: string) => void;\n /** Shown on the trigger when nothing is selected. */\n placeholder?: ReactNode;\n disabled?: boolean;\n id?: string;\n className?: string;\n /** Trigger accessible name. Defaults to the bundled `iconPicker.trigger`. */\n 'aria-label'?: string;\n}\n\n// Selectable glyph cell. The only variant is selection state — selected cells\n// take a tokenised highlight (primary border + muted fill); `aria-pressed`\n// carries the state non-visually so it never reads by colour alone.\nconst optionVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:items-center ds:justify-center',\n 'ds:size-[var(--min-target-size)] ds:rounded-[var(--radius-sm)]',\n 'ds:border ds:text-foreground ds:bg-transparent',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-muted/10',\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:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:[&_svg]:size-5',\n ].join(' '),\n {\n variants: {\n selected: {\n true: 'ds:border-primary ds:bg-muted',\n false: 'ds:border-transparent',\n },\n },\n defaultVariants: { selected: false },\n },\n);\n\nexport const IconPicker = forwardRef<HTMLButtonElement, IconPickerProps>(\n function IconPicker(\n {\n icons,\n value,\n defaultValue,\n onChange,\n placeholder,\n disabled,\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t } = useTranslation();\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const currentValue = isControlled ? (value ?? '') : internalValue;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n // Live snapshots for the synchronous agent handle.\n const currentValueRef = useRef(currentValue);\n currentValueRef.current = currentValue;\n const openRef = useRef(open);\n openRef.current = open;\n const queryRef = useRef(query);\n queryRef.current = query;\n\n const handleOpenChange = useCallback((next: boolean) => {\n setOpen(next);\n // Reset the filter when the popover closes so the next open starts fresh.\n if (!next) setQuery('');\n }, []);\n\n const setValueImperative = useCallback(\n (iconId: string) => {\n if (!isControlled) setInternalValue(iconId);\n onChange?.(iconId);\n },\n [isControlled, onChange],\n );\n\n const handleSelect = useCallback(\n (iconId: string) => {\n setValueImperative(iconId);\n handleOpenChange(false);\n },\n [setValueImperative, handleOpenChange],\n );\n\n const agentHandle = useMemo<IconPickerHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (iconId) => setValueImperative(iconId),\n isOpen: () => openRef.current,\n open: () => handleOpenChange(true),\n close: () => handleOpenChange(false),\n getQuery: () => queryRef.current,\n setQuery: (next) => setQuery(next),\n }),\n [setValueImperative, handleOpenChange],\n );\n useAgentRegistration(iconPickerAgent, agentHandle, id);\n\n const selectedIcon = useMemo(\n () => icons.find((icon) => icon.id === currentValue),\n [icons, currentValue],\n );\n\n const normalisedQuery = query.trim().toLowerCase();\n const filtered = useMemo(\n () =>\n normalisedQuery\n ? icons.filter((icon) =>\n icon.label.toLowerCase().includes(normalisedQuery),\n )\n : icons,\n [icons, normalisedQuery],\n );\n\n const triggerLabel = ariaLabel ?? t('iconPicker.trigger');\n const resolvedPlaceholder = placeholder ?? t('iconPicker.trigger');\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange} id={id}>\n <Popover.Trigger asChild>\n <Button\n ref={ref}\n type=\"button\"\n intent=\"outline\"\n disabled={disabled}\n aria-label={triggerLabel}\n className={className}\n data-component=\"icon-picker\"\n data-component-id={id}\n >\n {selectedIcon ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:[&_svg]:size-5\"\n >\n {selectedIcon.node}\n </span>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:text-muted-foreground\">\n {resolvedPlaceholder}\n </span>\n )}\n </Button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n showArrow={false}\n aria-label={triggerLabel}\n className=\"ds:w-72\"\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <TextInput\n size=\"sm\"\n value={query}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n setQuery(event.target.value)\n }\n placeholder={t('iconPicker.search')}\n aria-label={t('iconPicker.search')}\n startAdornment={<Search />}\n clearable\n onClear={() => setQuery('')}\n autoComplete=\"off\"\n />\n\n {filtered.length === 0 ? (\n <p\n role=\"status\"\n className=\"type-body-sm ds:text-muted-foreground ds:text-center ds:py-[var(--spacing-sm)]\"\n >\n {t('iconPicker.noResults')}\n </p>\n ) : (\n <div\n role=\"group\"\n aria-label={triggerLabel}\n className=\"ds:grid ds:grid-cols-5 ds:gap-[var(--spacing-xs)] ds:max-h-64 ds:overflow-y-auto\"\n >\n {filtered.map((icon) => {\n const selected = icon.id === currentValue;\n return (\n <button\n key={icon.id}\n type=\"button\"\n aria-label={icon.label}\n aria-pressed={selected}\n onClick={() => handleSelect(icon.id)}\n className={optionVariants({ selected })}\n >\n <span aria-hidden=\"true\" className=\"ds:inline-flex\">\n {icon.node}\n </span>\n </button>\n );\n })}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Root>\n );\n },\n);\n\nIconPicker.displayName = 'IconPicker';\n\nexport { optionVariants as iconPickerOptionVariants };\n"],"names":["iconPickerAgent","handle","args","optionVariants","cva","IconPicker","forwardRef","icons","value","defaultValue","onChange","placeholder","disabled","id","className","ariaLabel","ref","t","useTranslation","isControlled","internalValue","setInternalValue","useState","currentValue","open","setOpen","query","setQuery","currentValueRef","useRef","openRef","queryRef","handleOpenChange","useCallback","next","setValueImperative","iconId","handleSelect","agentHandle","useMemo","useAgentRegistration","selectedIcon","icon","normalisedQuery","filtered","triggerLabel","resolvedPlaceholder","Popover","jsx","Button","jsxs","TextInput","event","Search","selected"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,UAAU,QAAQ,OAAO;AAAA,EAChD,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,IAElC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,IAAI;AAAA,YACF,MAAM;AAAA,YACN,aAAa;AAAA,UAAA;AAAA,QACf;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CAACF,MAAS;AACtB,wBAAMY,IAAWZ,EAAK,OAAOnB;AAC7B,yBACE,gBAAAyB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBAEC,MAAK;AAAA,sBACL,cAAYN,EAAK;AAAA,sBACjB,gBAAcY;AAAA,sBACd,SAAS,MAAMjB,EAAaK,EAAK,EAAE;AAAA,sBACnC,WAAWvC,EAAe,EAAE,UAAAmD,GAAU;AAAA,sBAEtC,4BAAC,QAAA,EAAK,eAAY,QAAO,WAAU,kBAChC,YAAK,KAAA,CACR;AAAA,oBAAA;AAAA,oBATKZ,EAAK;AAAA,kBAAA;AAAA,gBAYhB,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEArC,EAAW,cAAc;"}
@@ -4,7 +4,7 @@ import { c as Y } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as se } from "react-i18next";
5
5
  import { c as ne } from "./compose-refs-C0k0tdqF.js";
6
6
  import { u as ae } from "./registry-DvAUVLHh.js";
7
- import { B as ce } from "./button-BvNtqHAS.js";
7
+ import { B as ce } from "./button-nJaPh_HC.js";
8
8
  import { R as de } from "./rotate-ccw-BBQnIVTr.js";
9
9
  const le = {
10
10
  type: "object",
@@ -364,4 +364,4 @@ export {
364
364
  pe as i,
365
365
  ue as t
366
366
  };
367
- //# sourceMappingURL=image-cropper-DWSnyLwW.js.map
367
+ //# sourceMappingURL=image-cropper-C84NDTB7.js.map