@alfadocs/ui-kit 1.67.0 → 1.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/dist/_chunks/{address-fields-CJtu7LQU.js → address-fields-BUPRs3n-.js} +3 -3
  2. package/dist/_chunks/{agenda-card-DR9gDdKp.js → agenda-card-BDuvreCe.js} +2 -2
  3. package/dist/_chunks/{agenda-tray-DGB1Zup-.js → agenda-tray-CfwylhWf.js} +3 -3
  4. package/dist/_chunks/{ai-credits-exhausted-notice-DfAgfZDF.js → ai-credits-exhausted-notice-Bg8NpW2K.js} +2 -2
  5. package/dist/_chunks/{ai-permission-notice-qsdm4Sx4.js → ai-permission-notice-C00i6VhY.js} +2 -2
  6. package/dist/_chunks/{ai-prompt-input-DSGSe4LH.js → ai-prompt-input-DzgyoKyk.js} +141 -139
  7. package/dist/_chunks/{alert-DjsJMGRE.js → alert-9kEwDza3.js} +122 -112
  8. package/dist/_chunks/{alia-sidebar-qe0quZkB.js → alia-sidebar-DEMMoefU.js} +4 -4
  9. package/dist/_chunks/{anamnesis-card-CsUBOG32.js → anamnesis-card-Bey9qQu4.js} +2 -2
  10. package/dist/_chunks/{anamnesis-summary-card-CMzBLTiN.js → anamnesis-summary-card-DQ3iE1gD.js} +2 -2
  11. package/dist/_chunks/{anamnesis-summary-rows-BQ_EokKz.js → anamnesis-summary-rows-rNwSrNWZ.js} +393 -389
  12. package/dist/_chunks/{appointment-card-CL32sux-.js → appointment-card-5JMWi9_f.js} +2 -2
  13. package/dist/_chunks/{appointment-peek-B5mcDcXt.js → appointment-peek-CpcqB8oO.js} +3 -3
  14. package/dist/_chunks/{appointment-timeline-CCqjORFb.js → appointment-timeline-VFP6HoXT.js} +4 -4
  15. package/dist/_chunks/{appointment-tray-qtpJt8e0.js → appointment-tray-B3PDER3I.js} +3 -3
  16. package/dist/_chunks/{audio-recorder-B11RR-rC.js → audio-recorder-4Ll0pwYK.js} +3 -3
  17. package/dist/_chunks/{auth-form-parts-DwUTH6YN.js → auth-form-parts-B40zvD-a.js} +2 -2
  18. package/dist/_chunks/avatar-BPiPL7ND.js +199 -0
  19. package/dist/_chunks/{balance-badge-cell-DZNthHO1.js → balance-badge-cell-BG3DMly4.js} +4 -4
  20. package/dist/_chunks/{bishop-score-CaNTrikJ.js → bishop-score-Df8nF1qg.js} +2 -2
  21. package/dist/_chunks/{booking-tTVxKPQY.js → booking-B1pDbERi.js} +377 -335
  22. package/dist/_chunks/{calendar-BhN-jisv.js → calendar-BvOM8rG3.js} +2 -2
  23. package/dist/_chunks/{calendar-workspace-MRrzcxAy.js → calendar-workspace-Ct8_454k.js} +18 -18
  24. package/dist/_chunks/{chat-message-fRLZ95O5.js → chat-message-C2VXQMoB.js} +3 -3
  25. package/dist/_chunks/{clinical-note-card-BnFTIs6x.js → clinical-note-card-Caidqcwa.js} +2 -2
  26. package/dist/_chunks/{code-block-vwEv1jEa.js → code-block-RSKdF3E-.js} +35 -35
  27. package/dist/_chunks/{color-picker-BsggJovx.js → color-picker-AcaWuKah.js} +99 -95
  28. package/dist/_chunks/{combobox-U5yfO6o0.js → combobox-vF9O-QoG.js} +92 -83
  29. package/dist/_chunks/{connection-status--wYsgreh.js → connection-status-BOZC5QU5.js} +2 -2
  30. package/dist/_chunks/{contact-profile-card-C4-OCshj.js → contact-profile-card-CAwwOqHl.js} +40 -40
  31. package/dist/_chunks/{control-room-rail-DUerqHeo.js → control-room-rail-BB6rCDWI.js} +3 -3
  32. package/dist/_chunks/{country-select-DF5Bd_mn.js → country-select-CSE2Zm_s.js} +2 -2
  33. package/dist/_chunks/dashboard-grid-7JzaiKnk.js +1487 -0
  34. package/dist/_chunks/{data-table-COoCQ4n_.js → data-table-Cty4-Jht.js} +3 -3
  35. package/dist/_chunks/{dependent-selector-DBr1AhLg.js → dependent-selector-C4kOgO8b.js} +2 -2
  36. package/dist/_chunks/{description-list-Q8640NHu.js → description-list-DQQ2OA_t.js} +68 -66
  37. package/dist/_chunks/{document-preview-VyQOjFVL.js → document-preview-513f3iPn.js} +4 -4
  38. package/dist/_chunks/{document-scanner-CXH_GYh4.js → document-scanner-Bd3wbzpI.js} +2 -2
  39. package/dist/_chunks/{editable-description-ChGNdYY8.js → editable-description-DnAFi360.js} +2 -2
  40. package/dist/_chunks/{entity-summary-Bj-Wxq7Y.js → entity-summary-C2B8yNmc.js} +4 -4
  41. package/dist/_chunks/{error-summary-PUE5Zxp9.js → error-summary-mGxIyDAY.js} +2 -2
  42. package/dist/_chunks/{face-scheme-DAD-mXzM.js → face-scheme-CSJdRNad.js} +248 -244
  43. package/dist/_chunks/{file-manager-RiV7-OEE.js → file-manager-D4cPnRhL.js} +3 -3
  44. package/dist/_chunks/{forgot-password-form-CPOfRE0C.js → forgot-password-form-Dqi7R-NL.js} +4 -4
  45. package/dist/_chunks/format-number-DdzqwMs1.js +13 -0
  46. package/dist/_chunks/{freemium-paywall-6DO7noHX.js → freemium-paywall-C73C8Rgd.js} +2 -2
  47. package/dist/_chunks/{gestational-age-calculator-CZYa2D6m.js → gestational-age-calculator-Du53p8MH.js} +2 -2
  48. package/dist/_chunks/{header-settings-BSH9Gk0J.js → header-settings-DlUbvAUx.js} +37 -36
  49. package/dist/_chunks/{heatmap-C1TeC7wT.js → heatmap-DbZIQg14.js} +4 -4
  50. package/dist/_chunks/{help-me-write-templates-Bw3Q58x-.js → help-me-write-templates-5WkUfvc_.js} +3 -3
  51. package/dist/_chunks/{kit-extensions-DWs1UEXb.js → kit-extensions-CYvLL4ee.js} +3 -3
  52. package/dist/_chunks/length-token-DwMnGEYT.js +24 -0
  53. package/dist/_chunks/{link-cell-renderer-CtTsvfPY.js → link-cell-renderer-DtIsQWDO.js} +4 -4
  54. package/dist/_chunks/{login-dev-card-A-CL3mjt.js → login-dev-card-vEL-o5wq.js} +3 -3
  55. package/dist/_chunks/{map-view-BuVfJMEa.js → map-view-CtohteZD.js} +300 -191
  56. package/dist/_chunks/{marketplace-app-shell-DtSX8sYb.js → marketplace-app-shell-CcLQ0Dn-.js} +4 -4
  57. package/dist/_chunks/{message-card-A3mJNqfy.js → message-card-C_ksqIYM.js} +2 -2
  58. package/dist/_chunks/{message-tray-Ft6vSr71.js → message-tray-DCoQ4GQb.js} +3 -3
  59. package/dist/_chunks/{multi-select-CMaAQQgb.js → multi-select-BOad3za9.js} +110 -98
  60. package/dist/_chunks/{muscle-scheme-YoN3rYXV.js → muscle-scheme-C66WlCxG.js} +2 -2
  61. package/dist/_chunks/{note-timeline-DDqNU46n.js → note-timeline-KzL52MmB.js} +2 -2
  62. package/dist/_chunks/{notes-panel-IdsmqRFC.js → notes-panel-BXN46XkF.js} +6 -6
  63. package/dist/_chunks/notice-group-DkYzKyAZ.js +291 -0
  64. package/dist/_chunks/{notification-tray-BR3seWA7.js → notification-tray-Cp18MW5b.js} +2 -2
  65. package/dist/_chunks/{operator-hero-3_RG4Dkj.js → operator-hero-6aAIQaFZ.js} +83 -66
  66. package/dist/_chunks/{optical-prescription-CxfMsbxi.js → optical-prescription-D5c7FBlT.js} +526 -510
  67. package/dist/_chunks/panel-header-CbtlTe85.js +190 -0
  68. package/dist/_chunks/{panel-subview-yP4qIbKS.js → panel-subview-BPU7220K.js} +2 -2
  69. package/dist/_chunks/{patient-details-C-EWQTms.js → patient-details-qWOsn1MX.js} +5 -5
  70. package/dist/_chunks/{patient-field-row-lY-Tb5Mo.js → patient-field-row-CAl5ydtX.js} +5 -5
  71. package/dist/_chunks/{patient-search-DpAKidZ5.js → patient-search-BADdx3M1.js} +2 -2
  72. package/dist/_chunks/{patient-summary-card-Bpto_VCD.js → patient-summary-card-BhuRh9AE.js} +4 -4
  73. package/dist/_chunks/{payment-automation-upsell-BQ307qEX.js → payment-automation-upsell-CiwF5UrC.js} +2 -2
  74. package/dist/_chunks/{payment-form-XKtinW8r.js → payment-form-PBuh8PIa.js} +2 -2
  75. package/dist/_chunks/{payment-request-card-0DjQgVgX.js → payment-request-card-bysjRZrP.js} +2 -2
  76. package/dist/_chunks/{pdf-viewer-BvoVMjH4.js → pdf-viewer-gAsNUsA8.js} +2 -2
  77. package/dist/_chunks/{periodontal-risk-chart-CPy7CNFe.js → periodontal-risk-chart-B7S9OmPC.js} +97 -89
  78. package/dist/_chunks/practice-profile-hero-qfrsFQI_.js +236 -0
  79. package/dist/_chunks/{practice-results-BrUDDMXC.js → practice-results-BzThnpnm.js} +328 -298
  80. package/dist/_chunks/{pregnancy-dating-B8wo4l_r.js → pregnancy-dating-EFcFUJkQ.js} +2 -2
  81. package/dist/_chunks/{privacy-mask-Ch7743uk.js → privacy-mask-CCz9zuIh.js} +2 -2
  82. package/dist/_chunks/{product-hub-panel-C_ZosrBt.js → product-hub-panel-YuFbNPlT.js} +2 -2
  83. package/dist/_chunks/progress-notice-DiHWZ8Ms.js +279 -0
  84. package/dist/_chunks/{province-select-Bd20Z9Br.js → province-select-CDjs5obD.js} +2 -2
  85. package/dist/_chunks/{radiograph-panel.agent-8Ewv8-d7.js → radiograph-panel.agent-4UllIoTQ.js} +2 -2
  86. package/dist/_chunks/{rating-C1Vrmpsi.js → rating-CGYpg5dj.js} +43 -44
  87. package/dist/_chunks/{registration-form-BxwqUZzk.js → registration-form-1B0PTDal.js} +4 -4
  88. package/dist/_chunks/{reviews-panel-AvsVgtJu.js → reviews-panel-sbsVmmCA.js} +30 -8
  89. package/dist/_chunks/{rich-text-editor-aCIoptbg.js → rich-text-editor-56dSsyZI.js} +3 -3
  90. package/dist/_chunks/{select-k4gBdS8N.js → select-4S-eYZUf.js} +244 -214
  91. package/dist/_chunks/{sign-document-D1P1nUQA.js → sign-document-BiOTs1P4.js} +2 -2
  92. package/dist/_chunks/{signature-request-3u6TvRt2.js → signature-request-DAmNj_uq.js} +5 -5
  93. package/dist/_chunks/skeleton-tTWJpvAq.js +415 -0
  94. package/dist/_chunks/{slot-grid-dj5f6R2w.js → slot-grid-D_gix9mJ.js} +2 -2
  95. package/dist/_chunks/{streaming-text-zFViGexf.js → streaming-text-DbqKTsmj.js} +2 -2
  96. package/dist/_chunks/{tabs-2x3L13jn.js → tabs-BTj-2qMZ.js} +2 -2
  97. package/dist/_chunks/{task-card-BS7Uqevr.js → task-card-Ci2XbLmq.js} +2 -2
  98. package/dist/_chunks/{task-editor-Bb5MMcid.js → task-editor-BomyxGoZ.js} +8 -8
  99. package/dist/_chunks/{task-tray-eQU4KJcA.js → task-tray-Dnc72nl-.js} +3 -3
  100. package/dist/_chunks/{tasks-panel-BOb57Ysw.js → tasks-panel-ATz9JDy8.js} +6 -6
  101. package/dist/_chunks/{theme-toggle-Ctb77x6O.js → theme-toggle-DT_Jn4DC.js} +147 -138
  102. package/dist/_chunks/{timeline-DEIuHrWz.js → timeline-wUuTDFY_.js} +2 -2
  103. package/dist/_chunks/{tool-rail-C-03rH2I.js → tool-rail-C-M3eVdY.js} +2 -2
  104. package/dist/_chunks/{transcript-panel-XudW5l6l.js → transcript-panel-CoHHpcFg.js} +2 -2
  105. package/dist/_chunks/{treatment-receipt-Cpm8tqQN.js → treatment-receipt-pFqWFyD_.js} +2 -2
  106. package/dist/_chunks/{unit-converter-BPZ0Ldkb.js → unit-converter-CIoTmCmP.js} +2 -2
  107. package/dist/_chunks/{use-appointment-details-read-CVSPoP5j.js → use-appointment-details-read-1gjZuup4.js} +13 -13
  108. package/dist/_chunks/use-dismissed-CTOWqA0e.js +177 -0
  109. package/dist/_chunks/{voice-control-panel-BJIEbDq6.js → voice-control-panel-B8Lrk0C4.js} +4 -4
  110. package/dist/_chunks/{warning-stack-BdY-0bd3.js → warning-stack-BhHUmRiD.js} +2 -2
  111. package/dist/_chunks/{workflow-map-CYbRD9ek.js → workflow-map-ln4_OG8A.js} +2 -2
  112. package/dist/_chunks/workflow-webhook-action-Ct8tFYi7.js +691 -0
  113. package/dist/agent-catalog.json +271 -4
  114. package/dist/agent-i18n/en.json +34 -1
  115. package/dist/components/_shared/code-block.d.ts +6 -0
  116. package/dist/components/_shared/format-number.d.ts +20 -0
  117. package/dist/components/_shared/length-token.d.ts +12 -0
  118. package/dist/components/_shared/option.d.ts +1 -0
  119. package/dist/components/address-fields/index.js +1 -1
  120. package/dist/components/agenda-card/index.js +1 -1
  121. package/dist/components/agenda-tray/index.js +1 -1
  122. package/dist/components/ai-credits-notice/index.js +1 -1
  123. package/dist/components/ai-permission-notice/index.js +1 -1
  124. package/dist/components/ai-prompt-input/index.js +1 -1
  125. package/dist/components/alert/alert.d.ts +26 -0
  126. package/dist/components/alert/index.js +1 -1
  127. package/dist/components/anamnesis-card/index.js +1 -1
  128. package/dist/components/anamnesis-summary-card/index.js +1 -1
  129. package/dist/components/appointment-card/index.js +2 -2
  130. package/dist/components/appointment-details-panel/index.js +1 -1
  131. package/dist/components/appointment-peek/index.js +1 -1
  132. package/dist/components/appointment-timeline/index.js +1 -1
  133. package/dist/components/audio-recorder/index.js +1 -1
  134. package/dist/components/avatar/avatar.d.ts +2 -0
  135. package/dist/components/avatar/index.js +1 -1
  136. package/dist/components/bishop-score/index.js +1 -1
  137. package/dist/components/booking/index.js +1 -1
  138. package/dist/components/calendar/index.js +1 -1
  139. package/dist/components/chat-message/index.js +1 -1
  140. package/dist/components/clinical-note-card/index.js +1 -1
  141. package/dist/components/color-picker/index.js +1 -1
  142. package/dist/components/combobox/index.js +1 -1
  143. package/dist/components/connection-status/index.js +1 -1
  144. package/dist/components/contact-profile-card/index.js +1 -1
  145. package/dist/components/control-room-rail/index.js +1 -1
  146. package/dist/components/country-select/index.js +1 -1
  147. package/dist/components/dashboard-grid/dashboard-grid.d.ts +20 -1
  148. package/dist/components/dashboard-grid/index.js +1 -1
  149. package/dist/components/data-table/index.js +2 -2
  150. package/dist/components/dependent-selector/index.js +1 -1
  151. package/dist/components/description-list/index.js +1 -1
  152. package/dist/components/document-preview/index.js +1 -1
  153. package/dist/components/document-scanner/index.js +1 -1
  154. package/dist/components/editable-description/index.js +1 -1
  155. package/dist/components/entity-summary/index.js +1 -1
  156. package/dist/components/error-summary/index.js +1 -1
  157. package/dist/components/face-scheme/index.js +1 -1
  158. package/dist/components/file-manager/index.js +1 -1
  159. package/dist/components/freemium-paywall/index.js +1 -1
  160. package/dist/components/gestational-age-calculator/index.js +1 -1
  161. package/dist/components/header-settings/index.js +1 -1
  162. package/dist/components/heatmap/index.js +1 -1
  163. package/dist/components/index.d.ts +5 -2
  164. package/dist/components/map-view/index.d.ts +1 -1
  165. package/dist/components/map-view/index.js +1 -1
  166. package/dist/components/map-view/map-view.d.ts +51 -0
  167. package/dist/components/message-card/index.js +1 -1
  168. package/dist/components/message-tray/index.js +1 -1
  169. package/dist/components/multi-select/index.js +1 -1
  170. package/dist/components/muscle-scheme/index.js +1 -1
  171. package/dist/components/note-timeline/index.js +1 -1
  172. package/dist/components/notes-panel/index.js +1 -1
  173. package/dist/components/notice-group/index.d.ts +3 -0
  174. package/dist/components/notice-group/index.js +6 -0
  175. package/dist/components/notice-group/notice-group.agent.d.ts +4 -0
  176. package/dist/components/notice-group/notice-group.d.ts +43 -0
  177. package/dist/components/notification-tray/index.js +1 -1
  178. package/dist/components/operator-hero/index.js +1 -1
  179. package/dist/components/optical-prescription/index.js +1 -1
  180. package/dist/components/optical-prescription/optical-prescription-data.d.ts +8 -8
  181. package/dist/components/panel-header/index.js +1 -1
  182. package/dist/components/panel-header/panel-header.d.ts +10 -0
  183. package/dist/components/panel-subview/index.js +1 -1
  184. package/dist/components/patient-details/index.js +1 -1
  185. package/dist/components/patient-search/index.js +1 -1
  186. package/dist/components/patient-summary-card/index.js +1 -1
  187. package/dist/components/patient-table/index.js +1 -1
  188. package/dist/components/payment-card/index.js +1 -1
  189. package/dist/components/payment-form/index.js +1 -1
  190. package/dist/components/pdf-viewer/index.js +1 -1
  191. package/dist/components/periodontal-risk-chart/index.js +1 -1
  192. package/dist/components/practice-profile-hero/index.js +1 -1
  193. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +4 -1
  194. package/dist/components/practice-results/index.js +1 -1
  195. package/dist/components/practice-results/practice-results.d.ts +10 -2
  196. package/dist/components/pregnancy-dating/index.js +1 -1
  197. package/dist/components/product-hub-tray/index.js +1 -1
  198. package/dist/components/progress-notice/index.d.ts +3 -0
  199. package/dist/components/progress-notice/index.js +6 -0
  200. package/dist/components/progress-notice/progress-notice.agent.d.ts +4 -0
  201. package/dist/components/progress-notice/progress-notice.d.ts +81 -0
  202. package/dist/components/province-select/index.js +1 -1
  203. package/dist/components/radiograph-panel/index.js +1 -1
  204. package/dist/components/rating/index.js +1 -1
  205. package/dist/components/reviews-panel/index.js +1 -1
  206. package/dist/components/rich-text-editor/index.js +2 -2
  207. package/dist/components/select/index.js +1 -1
  208. package/dist/components/select/select.d.ts +6 -0
  209. package/dist/components/sign-document/index.js +1 -1
  210. package/dist/components/skeleton/index.d.ts +1 -1
  211. package/dist/components/skeleton/index.js +1 -1
  212. package/dist/components/skeleton/skeleton.d.ts +41 -1
  213. package/dist/components/skeleton-scheme/index.js +1 -1
  214. package/dist/components/slot-grid/index.js +1 -1
  215. package/dist/components/streaming-text/index.js +1 -1
  216. package/dist/components/tabs/index.js +1 -1
  217. package/dist/components/task-card/index.js +1 -1
  218. package/dist/components/task-editor/index.js +1 -1
  219. package/dist/components/task-tray/index.js +1 -1
  220. package/dist/components/tasks-panel/index.js +1 -1
  221. package/dist/components/theme-toggle/index.js +1 -1
  222. package/dist/components/timeline/index.js +1 -1
  223. package/dist/components/tool-rail/index.js +1 -1
  224. package/dist/components/transcript-panel/index.js +1 -1
  225. package/dist/components/treatment-receipt/index.js +1 -1
  226. package/dist/components/unit-converter/index.js +1 -1
  227. package/dist/components/voice-control-panel/index.js +1 -1
  228. package/dist/components/warning-stack/index.js +1 -1
  229. package/dist/components/workflow/index.js +1 -1
  230. package/dist/hooks/index.d.ts +1 -0
  231. package/dist/hooks/index.js +81 -76
  232. package/dist/hooks/use-dismissed.d.ts +58 -0
  233. package/dist/i18n/locales/ar.d.ts +77 -0
  234. package/dist/i18n/locales/ar.js +77 -0
  235. package/dist/i18n/locales/de.d.ts +77 -0
  236. package/dist/i18n/locales/de.js +77 -0
  237. package/dist/i18n/locales/el.d.ts +77 -0
  238. package/dist/i18n/locales/el.js +77 -0
  239. package/dist/i18n/locales/en.d.ts +77 -0
  240. package/dist/i18n/locales/en.js +77 -0
  241. package/dist/i18n/locales/es.d.ts +77 -0
  242. package/dist/i18n/locales/es.js +77 -0
  243. package/dist/i18n/locales/fr.d.ts +77 -0
  244. package/dist/i18n/locales/fr.js +77 -0
  245. package/dist/i18n/locales/hi.d.ts +77 -0
  246. package/dist/i18n/locales/hi.js +77 -0
  247. package/dist/i18n/locales/it.d.ts +77 -0
  248. package/dist/i18n/locales/it.js +77 -0
  249. package/dist/i18n/locales/ja.d.ts +77 -0
  250. package/dist/i18n/locales/ja.js +77 -0
  251. package/dist/i18n/locales/nl.d.ts +77 -0
  252. package/dist/i18n/locales/nl.js +77 -0
  253. package/dist/i18n/locales/pl.d.ts +77 -0
  254. package/dist/i18n/locales/pl.js +77 -0
  255. package/dist/i18n/locales/pt.d.ts +77 -0
  256. package/dist/i18n/locales/pt.js +77 -0
  257. package/dist/i18n/locales/ro.d.ts +77 -0
  258. package/dist/i18n/locales/ro.js +77 -0
  259. package/dist/i18n/locales/ru.d.ts +77 -0
  260. package/dist/i18n/locales/ru.js +77 -0
  261. package/dist/i18n/locales/sq.d.ts +77 -0
  262. package/dist/i18n/locales/sq.js +77 -0
  263. package/dist/i18n/locales/sv.d.ts +77 -0
  264. package/dist/i18n/locales/sv.js +77 -0
  265. package/dist/i18n/locales/tr.d.ts +77 -0
  266. package/dist/i18n/locales/tr.js +77 -0
  267. package/dist/i18n/locales/zh.d.ts +77 -0
  268. package/dist/i18n/locales/zh.js +77 -0
  269. package/dist/index.js +1197 -1183
  270. package/dist/locales/ar.json +77 -0
  271. package/dist/locales/de.json +77 -0
  272. package/dist/locales/el.json +77 -0
  273. package/dist/locales/en.json +77 -0
  274. package/dist/locales/es.json +77 -0
  275. package/dist/locales/fr.json +77 -0
  276. package/dist/locales/hi.json +77 -0
  277. package/dist/locales/it.json +77 -0
  278. package/dist/locales/ja.json +77 -0
  279. package/dist/locales/nl.json +77 -0
  280. package/dist/locales/pl.json +77 -0
  281. package/dist/locales/pt.json +77 -0
  282. package/dist/locales/ro.json +77 -0
  283. package/dist/locales/ru.json +77 -0
  284. package/dist/locales/sq.json +77 -0
  285. package/dist/locales/sv.json +77 -0
  286. package/dist/locales/tr.json +77 -0
  287. package/dist/locales/zh.json +77 -0
  288. package/dist/patterns/alia-assistant/index.js +1 -1
  289. package/dist/patterns/anamnesis/index.js +1 -1
  290. package/dist/patterns/calendar/index.js +1 -1
  291. package/dist/patterns/forgot-password-form/index.js +1 -1
  292. package/dist/patterns/help-me-write-templates/index.js +2 -2
  293. package/dist/patterns/login-form/index.js +1 -1
  294. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  295. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  296. package/dist/patterns/registration-form/index.js +1 -1
  297. package/dist/patterns/signature-request/index.js +1 -1
  298. package/dist/patterns/workflow-webhook-action/index.d.ts +3 -0
  299. package/dist/patterns/workflow-webhook-action/index.js +6 -0
  300. package/dist/patterns/workflow-webhook-action/workflow-webhook-action.d.ts +93 -0
  301. package/dist/tokens.css +1 -1
  302. package/package.json +13 -1
  303. package/dist/_chunks/avatar-WZY3eGE7.js +0 -123
  304. package/dist/_chunks/dashboard-grid-B2MB7SRS.js +0 -1428
  305. package/dist/_chunks/panel-header-BJkaUwnl.js +0 -128
  306. package/dist/_chunks/practice-profile-hero-Dfc0F60y.js +0 -193
  307. package/dist/_chunks/skeleton-B1KTdJ4N.js +0 -116
@@ -1,1428 +0,0 @@
1
- import { jsxs as ge, jsx as R } from "react/jsx-runtime";
2
- import { forwardRef as Dt, useRef as S, useState as J, useCallback as L, useMemo as se, useEffect as B, useImperativeHandle as Pt, useContext as Wt, Children as Ht, isValidElement as zt, Fragment as Xt, createContext as Ft, cloneElement as lt } from "react";
3
- import { c as ue } from "./index-D2ZczOXr.js";
4
- import { useTranslation as xt } from "react-i18next";
5
- import { I as Fe } from "./icon-button-C_1TgRiK.js";
6
- import { D as Ie } from "./dropdown-menu-D1we7oAY.js";
7
- import { T as Yt } from "./tooltip-uEBdD1-5.js";
8
- import { u as re } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
9
- import { u as Ot } from "./registry-DvAUVLHh.js";
10
- import { P as jt } from "./plus-DzMQ_c6b.js";
11
- import { X as Vt } from "./x-B5YnXwCz.js";
12
- import { G as $t } from "./grip-vertical-onSb1JXO.js";
13
- import { E as qt } from "./ellipsis-dRo9ouSU.js";
14
- import { c as Kt } from "./createLucideIcon-DhHxpK9K.js";
15
- /**
16
- * @license lucide-react v1.22.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- const Ut = [
22
- ["path", { d: "M19 13v6h-6", key: "1hxl6d" }],
23
- ["path", { d: "M5 11V5h6", key: "12e2xe" }],
24
- ["path", { d: "m5 5 14 14", key: "11anup" }]
25
- ], Bt = Kt("move-diagonal-2", Ut), Jt = {
26
- id: "dashboard-grid",
27
- // The board's whole purpose is in-place rearrangement of its widgets.
28
- // `scroll` is backed by reveal_widget (the catalogue's name heuristic
29
- // cannot see that and warns).
30
- capabilities: ["edit_inline", "scroll"],
31
- state: {
32
- layout: {
33
- type: "{ id: string, x: number, y: number, w: number, h: number }[]",
34
- descriptionKey: "ui.agent.dashboardGrid.state.layout",
35
- description: "Current widget geometry in cell units — ids and rectangles only, no widget content.",
36
- read: (r) => r.getGridState().layout
37
- },
38
- cols: {
39
- type: "number",
40
- descriptionKey: "ui.agent.dashboardGrid.state.cols",
41
- description: "Logical column count of the board.",
42
- read: (r) => r.getGridState().cols
43
- },
44
- editing: {
45
- type: "boolean",
46
- descriptionKey: "ui.agent.dashboardGrid.state.editing",
47
- description: "Whether edit mode is on. Move/resize actions are refused while it is off — the host app owns the toggle.",
48
- read: (r) => r.getGridState().editing
49
- },
50
- stacked: {
51
- type: "boolean",
52
- descriptionKey: "ui.agent.dashboardGrid.state.stacked",
53
- description: "Whether the board is narrower than its stackBelow width and shows its widgets as one read-only column. Move/resize actions are unavailable while it is true, even in edit mode; the saved layout is unchanged.",
54
- read: (r) => r.getGridState().stacked
55
- },
56
- selectedId: {
57
- type: "string | null",
58
- descriptionKey: "ui.agent.dashboardGrid.state.selectedId",
59
- description: "The widget the host has marked (for example while its settings are open), or null. Set by the host, not by agents.",
60
- read: (r) => r.getGridState().selectedId
61
- }
62
- },
63
- actions: {
64
- reveal_widget: {
65
- // Scrolls the view and rings a widget for a moment; changes nothing.
66
- safety: "read",
67
- argsType: "id",
68
- argsSchema: {
69
- type: "object",
70
- properties: {
71
- id: { type: "string", description: "Widget id (see layout state)." }
72
- },
73
- required: ["id"]
74
- },
75
- returns: "Promise<boolean> (revealed)",
76
- returnsSchema: {
77
- type: "boolean",
78
- description: "True once the widget is in view; false if it has not appeared within a second."
79
- },
80
- idempotent: !0,
81
- errors: [
82
- "Unknown or not yet rendered widget id: waits up to a second, then resolves false."
83
- ],
84
- descriptionKey: "ui.agent.dashboardGrid.actions.revealWidget",
85
- description: "Scroll a widget into view (its scrolling ancestor and the window) and highlight it briefly. Works in view and edit mode, and for a widget added a moment ago. Does not move focus.",
86
- invoke: (r, i) => r.revealWidget(i.id)
87
- },
88
- move_widget: {
89
- // Rearranging the board mutates user configuration — a write,
90
- // reversible by moving back.
91
- safety: "write",
92
- argsType: "id, x, y",
93
- argsSchema: {
94
- type: "object",
95
- properties: {
96
- id: { type: "string", description: "Widget id (see layout state)." },
97
- x: {
98
- type: "integer",
99
- minimum: 0,
100
- description: "0-based logical column."
101
- },
102
- y: { type: "integer", minimum: 0, description: "0-based row." }
103
- },
104
- required: ["id", "x", "y"]
105
- },
106
- returns: "boolean (accepted)",
107
- returnsSchema: {
108
- type: "boolean",
109
- description: "True when applied; false when edit mode is off, the board is stacked, or the id is unknown."
110
- },
111
- idempotent: !0,
112
- errors: [
113
- "Unavailable while the board is stacked (state stacked is true): returns false and changes nothing.",
114
- "Unavailable while edit mode is off: returns false.",
115
- "Unknown widget id: returns false."
116
- ],
117
- descriptionKey: "ui.agent.dashboardGrid.actions.moveWidget",
118
- description: "Move a widget to a cell. Out-of-bounds targets are clamped; colliding widgets are pushed down and the layout re-compacts. Refused while edit mode is off or the board is stacked.",
119
- invoke: (r, i) => r.moveWidgetTo(i.id, i.x, i.y)
120
- },
121
- resize_widget: {
122
- safety: "write",
123
- argsType: "id, w, h",
124
- argsSchema: {
125
- type: "object",
126
- properties: {
127
- id: { type: "string", description: "Widget id (see layout state)." },
128
- w: {
129
- type: "integer",
130
- minimum: 1,
131
- description: "Column span (≥ 1)."
132
- },
133
- h: { type: "integer", minimum: 1, description: "Row span (≥ 1)." }
134
- },
135
- required: ["id", "w", "h"]
136
- },
137
- returns: "boolean (accepted)",
138
- returnsSchema: {
139
- type: "boolean",
140
- description: "True when applied; false when edit mode is off, the board is stacked, or the id is unknown."
141
- },
142
- idempotent: !0,
143
- errors: [
144
- "Unavailable while the board is stacked (state stacked is true): returns false and changes nothing.",
145
- "Unavailable while edit mode is off: returns false.",
146
- "Unknown widget id: returns false."
147
- ],
148
- descriptionKey: "ui.agent.dashboardGrid.actions.resizeWidget",
149
- description: "Resize a widget to a span. Clamped to the grid and the widget’s min/max; colliding widgets are pushed down. Refused while edit mode is off or the board is stacked.",
150
- invoke: (r, i) => r.resizeWidgetTo(i.id, i.w, i.h)
151
- }
152
- },
153
- domHooks: {
154
- root: {
155
- attr: "data-component",
156
- value: "dashboard-grid",
157
- description: 'Also carries data-stacked="true" while the board shows one read-only column.'
158
- },
159
- instanceId: {
160
- attr: "data-component-id",
161
- sourceProp: "id",
162
- description: "Sourced from the id prop."
163
- },
164
- item: {
165
- attr: "data-widget-id",
166
- description: "Each widget wrapper carries its layout id."
167
- }
168
- }
169
- };
170
- function X(r, i) {
171
- return r.x < i.x + i.w && i.x < r.x + r.w && r.y < i.y + i.h && i.y < r.y + r.h;
172
- }
173
- function Ne(r, i) {
174
- const s = Math.max(1, r.minW ?? 1), l = Math.max(1, r.minH ?? 1), g = Math.min(i, r.maxW ?? i), N = r.maxH ?? Number.POSITIVE_INFINITY, p = Math.min(Math.max(r.w, s), g), a = Math.min(Math.max(r.h, l), N), I = Math.min(Math.max(0, r.x), i - p), W = Math.max(0, r.y);
175
- return { ...r, x: I, y: W, w: p, h: a };
176
- }
177
- function ut(r, i) {
178
- if (i.some((s) => X(s, r))) return !1;
179
- for (let s = r.y; s < r.y + r.h; s += 1)
180
- if (!i.some(
181
- (g) => g.x >= r.x + r.w && s >= g.y && s < g.y + g.h
182
- )) return !1;
183
- return !0;
184
- }
185
- function ft(r, i, s) {
186
- return Math.abs(r.y * s + r.x - (i.y * s + i.x));
187
- }
188
- function oe(r, i, s, l) {
189
- const g = r.map((o) => Ne(o, i)), N = [...g].sort((o, w) => o.id === s ? -1 : w.id === s ? 1 : o.y - w.y || o.x - w.x), p = [], a = s ? g.find((o) => o.id === s) : void 0, I = /* @__PURE__ */ new Set();
190
- for (const o of N) {
191
- if (o.id !== s) {
192
- if (a && X(a, o)) {
193
- const w = { ...o, y: Math.max(0, a.y - o.h) };
194
- !X(a, w) && !p.some((x) => x.id !== s && X(x, w)) && (o.y = w.y);
195
- }
196
- if (p.some((w) => X(w, o))) {
197
- I.add(o.id);
198
- const w = g.filter((k) => k.id !== o.id);
199
- let x = o.y;
200
- for (; p.some((k) => X(k, { ...o, y: x })); )
201
- x += 1;
202
- let _ = null;
203
- for (let k = Math.max(0, o.y - o.h); k <= x; k += 1)
204
- for (let E = 0; E <= i - o.w; E += 1) {
205
- const H = { ...o, x: E, y: k };
206
- (ut(H, w) || l !== void 0 && X(l, H) && !w.some(($) => X($, H))) && (!_ || ft({ x: E, y: k }, o, i) < ft(_, o, i)) && (_ = { x: E, y: k });
207
- }
208
- if (_)
209
- o.x = _.x, o.y = _.y;
210
- else {
211
- o.y = x;
212
- const k = a !== void 0 && a.x < o.x && o.x < a.x + a.w, E = a ? a.x : o.x;
213
- for (; k && o.x > E && !w.some((H) => X(H, { ...o, x: o.x - 1 })); )
214
- o.x -= 1;
215
- }
216
- }
217
- for (; p.some((w) => X(w, o)); )
218
- o.y += 1;
219
- for (; o.y > 0; ) {
220
- const w = { ...o, y: o.y - 1 };
221
- if (p.some((x) => X(x, w))) break;
222
- o.y -= 1;
223
- }
224
- }
225
- p.push(o);
226
- }
227
- const W = a ? [...p].sort((o, w) => o.y - w.y || o.x - w.x) : [];
228
- for (const o of W) {
229
- if (o.id === s || I.has(o.id)) continue;
230
- const w = p.filter((_) => _.id !== o.id);
231
- let x = null;
232
- for (let _ = 0; _ < o.y && !x; _ += 1) {
233
- const k = Array.from(
234
- { length: 2 * o.w + 1 },
235
- (E, H) => o.x - o.w + H
236
- ).filter((E) => E >= 0 && E <= i - o.w).sort((E, H) => Math.abs(E - o.x) - Math.abs(H - o.x) || E - H);
237
- for (const E of k)
238
- if (ut({ ...o, x: E, y: _ }, w)) {
239
- x = { x: E, y: _ };
240
- break;
241
- }
242
- }
243
- if (x)
244
- for (o.x = x.x, o.y = x.y; o.y > 0; ) {
245
- const _ = { ...o, y: o.y - 1 };
246
- if (w.some((k) => X(k, _))) break;
247
- o.y -= 1;
248
- }
249
- }
250
- const b = new Map(p.map((o) => [o.id, o]));
251
- return r.map((o) => b.get(o.id));
252
- }
253
- function Qt(r, i, s, l, g) {
254
- const N = r.map(
255
- (p) => p.id === i ? Ne({ ...p, x: s, y: l }, g) : p
256
- );
257
- return oe(
258
- N,
259
- g,
260
- i,
261
- r.find((p) => p.id === i)
262
- );
263
- }
264
- function Zt(r, i, s, l, g) {
265
- const N = r.map(
266
- (p) => p.id === i ? (
267
- // Resizing never moves the widget: the width clamps to the space
268
- // between its position and the grid edge (clampRect would slide it).
269
- // minW wins over the edge clamp so clampRect cannot re-raise w and
270
- // slide x as a side effect.
271
- Ne(
272
- {
273
- ...p,
274
- w: Math.max(p.minW ?? 1, Math.min(s, g - p.x)),
275
- h: l
276
- },
277
- g
278
- )
279
- ) : p
280
- );
281
- return oe(N, g, i);
282
- }
283
- function mt(r, i, s, l) {
284
- const g = Math.min(Math.max(1, s), i), N = r.reduce((p, a) => Math.max(p, a.y + a.h), 0);
285
- for (let p = 0; p <= N; p += 1)
286
- for (let a = 0; a <= i - g; a += 1) {
287
- const I = {
288
- x: a,
289
- y: p,
290
- w: g,
291
- h: l
292
- };
293
- if (!r.some((W) => X(W, I)))
294
- return { x: a, y: p };
295
- }
296
- return { x: 0, y: N };
297
- }
298
- function kt(r) {
299
- return r.reduce((i, s) => Math.max(i, s.y + s.h), 0);
300
- }
301
- const er = 24;
302
- function pt(r, i, s) {
303
- return i === void 0 || !Number.isFinite(i) || i <= 0 ? !1 : !Number.isFinite(r) || r <= 0 ? s : s ? r < i + er : r < i;
304
- }
305
- function tr(r, i) {
306
- const s = new Map(i.map((l) => [l.id, l]));
307
- return r.map((l, g) => ({ id: l, index: g, entry: s.get(l) })).sort((l, g) => !l.entry || !g.entry ? l.entry ? -1 : g.entry ? 1 : l.index - g.index : l.entry.y - g.entry.y || l.entry.x - g.entry.x || l.index - g.index).map(({ id: l }) => l);
308
- }
309
- const rr = ue(
310
- [
311
- "ds:grid ds:w-full",
312
- // A stacking context: a grabbed widget's lift stays inside the board.
313
- "ds:isolate",
314
- "ds:gap-[var(--spacing-md)]",
315
- // Edit-mode surface: tint the whole plane, draw faint cell lines, and
316
- // reserve spare rows (--dg-min-block) so the AVAILABLE space reads at
317
- // a glance instead of the board ending at the last occupied row.
318
- "ds:data-[editing=true]:rounded-[var(--radius-lg)] ds:data-[editing=true]:bg-muted/10",
319
- "ds:data-[editing=true]:[background-image:var(--dg-grid-lines)]",
320
- "ds:data-[editing=true]:min-h-[var(--dg-min-block)]"
321
- ].join(" "),
322
- {
323
- variants: {
324
- // Stacked: one full-width column; each row takes its widget's block
325
- // size. Focus can fall back to the board here (see the focus effect),
326
- // so it gets the kit's focus ring.
327
- stacked: {
328
- false: [
329
- "ds:[grid-template-columns:repeat(var(--dg-cols),minmax(0,1fr))]",
330
- "ds:[grid-auto-rows:var(--dg-row)]"
331
- ].join(" "),
332
- true: [
333
- "ds:grid-cols-1 ds:auto-rows-auto",
334
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
335
- ].join(" ")
336
- }
337
- },
338
- defaultVariants: { stacked: !1 }
339
- }
340
- ), nr = ue(
341
- [
342
- "ds:relative ds:min-h-0 ds:min-w-0 ds:overflow-hidden",
343
- // Its own stacking context: a sticky or raised layer inside a widget
344
- // can never paint over the page's chrome (a sticky toolbar, say).
345
- "ds:isolate",
346
- // Header actions fold into one menu below a set widget width.
347
- "ds:@container/widget",
348
- // Mirror of Card variant="elevated" so widgets read as kit cards.
349
- "ds:rounded-[var(--radius-lg)] ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
350
- "ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)] ds:shadow-[var(--shadow-card)]",
351
- // Grabbed feedback (keyboard or pointer drag in flight).
352
- "ds:data-[grabbed=true]:ring-[length:var(--focus-ring-width)] ds:data-[grabbed=true]:ring-ring ds:data-[grabbed=true]:z-10",
353
- // Selected (and briefly revealed): an inset edge in --primary, the
354
- // kit's selected colour, so it reads apart from focus and from a grab.
355
- "ds:data-[selected=true]:ring-[length:var(--border-width-md)] ds:data-[selected=true]:ring-inset ds:data-[selected=true]:ring-[color:var(--primary)]",
356
- "ds:data-[revealed=true]:ring-[length:var(--border-width-md)] ds:data-[revealed=true]:ring-inset ds:data-[revealed=true]:ring-[color:var(--primary)]",
357
- "ds:forced-colors:data-[selected=true]:outline-[length:var(--border-width-md)] ds:forced-colors:data-[selected=true]:outline-solid ds:forced-colors:data-[selected=true]:outline-[Highlight]",
358
- // Only reachable when stacking removes the focused edit control: the
359
- // widget then takes focus itself (tabindex -1, set at that moment).
360
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
361
- ].join(" "),
362
- {
363
- variants: {
364
- stacked: {
365
- false: [
366
- "ds:[grid-column-start:var(--dg-x)] ds:[grid-column-end:span_var(--dg-w)]",
367
- "ds:[grid-row-start:var(--dg-y)] ds:[grid-row-end:span_var(--dg-h)]"
368
- ].join(" "),
369
- true: "ds:col-span-full ds:row-auto"
370
- },
371
- stackedHeight: { grid: "", content: "" }
372
- },
373
- compoundVariants: [
374
- { stacked: !1, class: "ds:flex ds:flex-col" },
375
- // At least the block size the widget has in the grid (h rows plus the
376
- // h - 1 gaps). A minimum, not a fixed size: at 200% zoom the widget
377
- // grows instead of clipping its content (WCAG 1.4.4, 1.4.10).
378
- {
379
- stacked: !0,
380
- stackedHeight: "grid",
381
- class: [
382
- "ds:flex ds:flex-col",
383
- "ds:[min-block-size:calc(var(--dg-h)*var(--dg-row)_+_(var(--dg-h)_-_1)*var(--spacing-md))]"
384
- ].join(" ")
385
- },
386
- // As tall as the content, or minStackedHeight. A grid, not a flex
387
- // column, so the body row is a definite box a 100% chart can fill.
388
- {
389
- stacked: !0,
390
- stackedHeight: "content",
391
- class: [
392
- "ds:grid ds:grid-cols-[minmax(0,1fr)] ds:grid-rows-[auto_1fr]",
393
- "ds:[min-block-size:var(--dg-min-stacked)]"
394
- ].join(" ")
395
- }
396
- ],
397
- defaultVariants: { stacked: !1, stackedHeight: "grid" }
398
- }
399
- ), ir = ue(
400
- "ds:ps-[var(--spacing-md)] ds:pt-[var(--spacing-xs)]",
401
- {
402
- variants: {
403
- // `box`: fill the widget's block size and clip to it. `content`: take
404
- // the content's own height (the content-height stack), never a box.
405
- fit: {
406
- box: "ds:min-h-0 ds:flex-1 ds:overflow-hidden",
407
- content: "ds:min-w-0"
408
- },
409
- // Editing: clear of the resize grip's whole hit area, a
410
- // --min-target-size square in the corner. Block-end takes the full
411
- // size, keeping the width narrow widgets need; inline-end the glyph.
412
- editing: {
413
- false: "ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
414
- true: [
415
- "ds:pe-[calc(var(--spacing-lg)_+_var(--spacing-2xs))]",
416
- "ds:pb-[var(--min-target-size)]"
417
- ].join(" ")
418
- }
419
- },
420
- defaultVariants: { fit: "box", editing: !1 }
421
- }
422
- ), sr = ue(
423
- [
424
- "ds:absolute ds:bottom-[var(--spacing-2xs)] ds:end-[var(--spacing-2xs)]",
425
- "ds:inline-flex ds:size-[var(--spacing-lg)] ds:items-center ds:justify-center",
426
- "ds:rounded-[var(--radius-sm)] ds:text-[var(--muted-foreground)] ds:touch-none",
427
- "ds:cursor-nwse-resize ds:rtl:cursor-nesw-resize",
428
- "ds:hover:bg-muted/20 ds:hover:text-[var(--foreground)]",
429
- "ds:aria-pressed:bg-muted/20 ds:aria-pressed:text-[var(--foreground)]",
430
- "ds:[&_svg]:size-3.5 ds:rtl:[&_svg]:-scale-x-100",
431
- "ds:before:absolute ds:before:content-['']",
432
- "ds:before:bottom-[calc(-1*var(--spacing-2xs))] ds:before:end-[calc(-1*var(--spacing-2xs))]",
433
- "ds:before:size-[var(--min-target-size)]",
434
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
435
- ].join(" ")
436
- ), gt = ue(
437
- "ds:items-center ds:gap-[calc(var(--min-target-size)_-_var(--spacing-xl))]",
438
- {
439
- variants: {
440
- when: {
441
- always: "ds:flex",
442
- wide: "ds:flex ds:@max-[300px]/widget:hidden",
443
- narrow: "ds:hidden ds:@max-[300px]/widget:flex"
444
- }
445
- },
446
- defaultVariants: { when: "always" }
447
- }
448
- ), Ye = "ds:bg-[var(--card)] ds:data-[component=icon-button]:sm:before:block", or = ue(
449
- "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]",
450
- {
451
- variants: {
452
- editing: {
453
- false: "",
454
- true: "ds:cursor-grab ds:select-none ds:[-webkit-touch-callout:none]"
455
- }
456
- },
457
- defaultVariants: { editing: !1 }
458
- }
459
- ), dr = ue(
460
- [
461
- "ds:m-0 ds:min-w-0 ds:flex-1 ds:truncate ds:text-sm ds:font-medium",
462
- "ds:rounded-[var(--radius-sm)]",
463
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
464
- ].join(" ")
465
- ), St = Ft(
466
- null
467
- );
468
- function ht(r) {
469
- return r !== void 0 && Number.isFinite(r) && r >= 1 ? Math.floor(r) : void 0;
470
- }
471
- function Le(r, i) {
472
- Ht.forEach(r, (s) => {
473
- if (zt(s)) {
474
- if (s.type === Xt) {
475
- Le(
476
- s.props.children,
477
- i
478
- );
479
- return;
480
- }
481
- i(s);
482
- }
483
- });
484
- }
485
- function Mt({
486
- id: r,
487
- title: i,
488
- minStackedHeight: s,
489
- actions: l,
490
- actionsSlot: g,
491
- children: N
492
- }) {
493
- var fe, de, T;
494
- const { t: p } = xt("ui"), a = Wt(St), I = S(null), W = S(null), b = a == null ? void 0 : a.layoutById.get(r), [o, w] = J(null), [x, _] = J(!1), [k, E] = J(!1), [H, A] = J(!1);
495
- if (B(() => {
496
- if (!o) return;
497
- const h = () => _(o.scrollWidth > o.clientWidth);
498
- h();
499
- const z = typeof document < "u" ? document.fonts : void 0;
500
- z == null || z.addEventListener("loadingdone", h);
501
- const q = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(h);
502
- return q == null || q.observe(o), () => {
503
- z == null || z.removeEventListener("loadingdone", h), q == null || q.disconnect();
504
- };
505
- }, [o, i]), B(() => {
506
- x || A(!1);
507
- }, [x]), re(() => {
508
- const h = I.current;
509
- !h || !b || (h.style.setProperty("--dg-x", String(b.x + 1)), h.style.setProperty("--dg-y", String(b.y + 1)), h.style.setProperty("--dg-w", String(b.w)), h.style.setProperty("--dg-h", String(b.h)), h.style.setProperty(
510
- "--dg-min-stacked",
511
- s !== void 0 && Number.isFinite(s) && s > 0 ? `${s}px` : "auto"
512
- ));
513
- }, [b == null ? void 0 : b.x, b == null ? void 0 : b.y, b == null ? void 0 : b.w, b == null ? void 0 : b.h, b, s]), !a || !b) return null;
514
- const $ = ((fe = a.grab) == null ? void 0 : fe.id) === r, G = a.editing, M = [
515
- ...l ?? [],
516
- ...G && a.canRemove ? [
517
- {
518
- id: bt,
519
- label: p("dashboardGrid.remove", { title: i }),
520
- icon: /* @__PURE__ */ R(Vt, {}),
521
- onSelect: () => a.requestRemove(r)
522
- }
523
- ] : []
524
- ], xe = M.length > 1, Q = a.headingLevel ? `h${a.headingLevel}` : "span";
525
- return /* @__PURE__ */ ge(
526
- "div",
527
- {
528
- ref: I,
529
- role: "listitem",
530
- "aria-label": i,
531
- "data-component": "dashboard-grid-widget",
532
- "data-widget-id": r,
533
- "data-grabbed": $ || void 0,
534
- "data-selected": a.selectedId === r || void 0,
535
- "data-revealed": a.revealedId === r || void 0,
536
- "aria-current": a.selectedId === r ? "true" : void 0,
537
- className: nr({
538
- stacked: a.stacked,
539
- stackedHeight: a.stackedHeight
540
- }),
541
- children: [
542
- /* @__PURE__ */ ge(
543
- "div",
544
- {
545
- className: or({ editing: G }),
546
- onPointerDown: G ? (h) => a.startHeaderPress(r, h) : void 0,
547
- children: [
548
- G ? /* @__PURE__ */ R(
549
- Fe,
550
- {
551
- size: "sm",
552
- intent: "outline",
553
- type: "button",
554
- icon: /* @__PURE__ */ R($t, {}),
555
- "aria-label": p("dashboardGrid.move", { title: i }),
556
- "aria-pressed": $ && ((de = a.grab) == null ? void 0 : de.kind) === "move",
557
- className: `ds:cursor-grab ds:touch-none ${Ye}`,
558
- onPointerDown: (h) => a.startPointerGrab("move", r, h),
559
- onKeyDown: (h) => a.keyboardStep(h, r),
560
- onClick: () => a.startKeyboardGrab("move", r)
561
- }
562
- ) : null,
563
- /* @__PURE__ */ R(
564
- Yt,
565
- {
566
- label: i,
567
- open: x && H,
568
- onOpenChange: (h) => A(h && x),
569
- children: /* @__PURE__ */ R(
570
- Q,
571
- {
572
- ref: w,
573
- tabIndex: x || k ? 0 : void 0,
574
- "data-dashboard-grid-title": "",
575
- onFocus: () => E(!0),
576
- onBlur: () => E(!1),
577
- className: dr(),
578
- children: i
579
- }
580
- )
581
- }
582
- ),
583
- g,
584
- M.length > 0 ? /* @__PURE__ */ R(
585
- "div",
586
- {
587
- className: gt({
588
- when: xe ? "wide" : "always"
589
- }),
590
- children: M.map((h) => /* @__PURE__ */ R(
591
- Fe,
592
- {
593
- size: "sm",
594
- intent: "outline",
595
- type: "button",
596
- icon: h.icon,
597
- className: Ye,
598
- "aria-label": h.label,
599
- onClick: h.onSelect
600
- },
601
- h.id
602
- ))
603
- }
604
- ) : null,
605
- xe ? /* @__PURE__ */ R("div", { className: gt({ when: "narrow" }), children: /* @__PURE__ */ ge(Ie.Root, { modal: !1, children: [
606
- /* @__PURE__ */ R(Ie.Trigger, { asChild: !0, children: /* @__PURE__ */ R(
607
- Fe,
608
- {
609
- size: "sm",
610
- intent: "outline",
611
- type: "button",
612
- icon: /* @__PURE__ */ R(qt, {}),
613
- className: Ye,
614
- "aria-label": p("dashboardGrid.moreActions", { title: i })
615
- }
616
- ) }),
617
- /* @__PURE__ */ R(
618
- Ie.Content,
619
- {
620
- align: "end",
621
- onCloseAutoFocus: (h) => {
622
- const z = W.current;
623
- if (W.current = null, !z) return;
624
- const q = document.activeElement;
625
- z.onSelect(), (z.id === bt || document.activeElement !== q) && h.preventDefault();
626
- },
627
- children: M.map((h) => /* @__PURE__ */ R(
628
- Ie.Item,
629
- {
630
- startIcon: h.icon,
631
- onSelect: () => {
632
- W.current = h;
633
- },
634
- children: h.label
635
- },
636
- h.id
637
- ))
638
- }
639
- )
640
- ] }) }) : null
641
- ]
642
- }
643
- ),
644
- /* @__PURE__ */ R(
645
- "div",
646
- {
647
- className: ir({
648
- fit: a.stacked && a.stackedHeight === "content" ? "content" : "box",
649
- editing: G
650
- }),
651
- children: N
652
- }
653
- ),
654
- G ? /* @__PURE__ */ R(
655
- "button",
656
- {
657
- type: "button",
658
- "aria-label": p("dashboardGrid.resize", { title: i }),
659
- "aria-pressed": $ && ((T = a.grab) == null ? void 0 : T.kind) === "resize",
660
- className: sr(),
661
- onPointerDown: (h) => a.startPointerGrab("resize", r, h),
662
- onKeyDown: (h) => a.keyboardStep(h, r),
663
- onClick: () => a.startKeyboardGrab("resize", r),
664
- children: /* @__PURE__ */ R(Bt, { "aria-hidden": "true" })
665
- }
666
- ) : null
667
- ]
668
- }
669
- );
670
- }
671
- Mt.displayName = "DashboardGrid.Widget";
672
- const vt = 1e3, ar = 1600, cr = [
673
- "button",
674
- "a",
675
- "input",
676
- "select",
677
- "textarea",
678
- "label",
679
- "summary",
680
- '[contenteditable]:not([contenteditable="false"])',
681
- '[role="button"]',
682
- '[role="menuitem"]',
683
- "[tabindex]:not([data-dashboard-grid-title])"
684
- ].join(", "), bt = "__remove__", wt = 4, lr = 400, ur = 8, Oe = 48, fr = 18;
685
- function mr(r) {
686
- const i = {
687
- x: null,
688
- y: null
689
- }, s = (l) => l === "auto" || l === "scroll" || l === "overlay";
690
- for (let l = r.parentElement; l && l !== document.body && l !== document.documentElement && !(i.x && i.y); l = l.parentElement) {
691
- const g = window.getComputedStyle(l);
692
- !i.y && s(g.overflowY) && l.scrollHeight > l.clientHeight && (i.y = l), !i.x && s(g.overflowX) && l.scrollWidth > l.clientWidth && (i.x = l);
693
- }
694
- return i;
695
- }
696
- function pe(r, i, s, l, g, N, p = !0) {
697
- const a = r.find((w) => w.id === s);
698
- if (!a) return r;
699
- const I = p ? kt(r) + 2 : Number.POSITIVE_INFINITY, W = i === "move" ? Qt(r, s, l, Math.min(g, I - a.h), N) : Zt(r, s, l, Math.min(g, I - a.y), N), b = W.find((w) => w.id === s);
700
- return b !== void 0 && b.x === a.x && b.y === a.y && b.w === a.w && b.h === a.h ? r : W;
701
- }
702
- function yt(r) {
703
- if (r >= Oe) return 0;
704
- const i = (Oe - Math.max(0, r)) / Oe;
705
- return Math.ceil(i * fr);
706
- }
707
- const Et = Dt(
708
- ({
709
- "aria-label": r,
710
- id: i,
711
- cols: s = 12,
712
- rowHeight: l = 96,
713
- layout: g,
714
- defaultLayout: N,
715
- onLayoutChange: p,
716
- editing: a = !1,
717
- onRemoveWidget: I,
718
- onRequestAdd: W,
719
- stackBelow: b,
720
- onStackedChange: o,
721
- stackedHeight: w = "grid",
722
- selectedId: x,
723
- widgetHeadingLevel: _,
724
- children: k,
725
- className: E
726
- }, H) => {
727
- const { t: A } = xt("ui"), $ = S(null), G = S(null), [M, xe] = J(!1), Q = S(!1);
728
- Q.current = M;
729
- const fe = S(null), de = L((e) => {
730
- var d;
731
- if (e === Q.current) return;
732
- const t = $.current, n = typeof document < "u" ? document.activeElement : null;
733
- fe.current = t && n instanceof HTMLElement && t.contains(n) ? {
734
- element: n,
735
- widgetId: ((d = n.closest("[data-widget-id]")) == null ? void 0 : d.getAttribute("data-widget-id")) ?? null
736
- } : null, Q.current = e, xe(e);
737
- }, []);
738
- re(() => {
739
- const e = $.current;
740
- if (!e) return;
741
- if (b === void 0) {
742
- de(!1);
743
- return;
744
- }
745
- if (de(
746
- pt(e.offsetWidth, b, Q.current)
747
- ), typeof ResizeObserver > "u") return;
748
- const t = new ResizeObserver((n) => {
749
- var c, m;
750
- const d = n[n.length - 1];
751
- if (!d) return;
752
- const u = ((m = (c = d.borderBoxSize) == null ? void 0 : c[0]) == null ? void 0 : m.inlineSize) ?? d.contentRect.width;
753
- de(pt(u, b, Q.current));
754
- });
755
- return t.observe(e), () => t.disconnect();
756
- }, [b, de]);
757
- const T = a && !M, h = se(() => {
758
- const e = [];
759
- return Le(k, (t) => {
760
- t.props.id && e.push(t.props.id);
761
- }), e;
762
- }, [k]), z = se(() => {
763
- const e = /* @__PURE__ */ new Map();
764
- return Le(k, (t) => {
765
- t.props.id && e.set(t.props.id, {
766
- defaultW: t.props.defaultW ?? 4,
767
- defaultH: t.props.defaultH ?? 2,
768
- minW: ht(t.props.minW),
769
- minH: ht(t.props.minH)
770
- });
771
- }), e;
772
- }, [k]), [q, Gt] = J(() => N ?? []), ke = g ?? q, je = S(ke);
773
- je.current = ke;
774
- const Se = L(
775
- (e) => e.map((t) => {
776
- const n = je.current.find((m) => m.id === t.id), { minW: d, minH: u, ...c } = t;
777
- return {
778
- ...c,
779
- ...(n == null ? void 0 : n.minW) !== void 0 ? { minW: n.minW } : {},
780
- ...(n == null ? void 0 : n.minH) !== void 0 ? { minH: n.minH } : {}
781
- };
782
- }),
783
- []
784
- ), Z = L(
785
- (e) => {
786
- const t = Se(e);
787
- g === void 0 && Gt(t), p == null || p(t);
788
- },
789
- [g, p, Se]
790
- ), { resolved: P, autoPlaced: Ve } = se(() => {
791
- const e = (u) => {
792
- const c = z.get(u.id);
793
- return Ne(
794
- {
795
- ...u,
796
- ...(c == null ? void 0 : c.minW) !== void 0 ? { minW: Math.max(u.minW ?? 1, c.minW) } : {},
797
- ...(c == null ? void 0 : c.minH) !== void 0 ? { minH: Math.max(u.minH ?? 1, c.minH) } : {}
798
- },
799
- s
800
- );
801
- }, t = ke.map(e), n = h.filter(
802
- (u) => !t.some((c) => c.id === u)
803
- );
804
- if (n.length === 0)
805
- return {
806
- resolved: t.some(
807
- (c, m) => t.some((y, f) => f > m && X(c, y))
808
- ) ? oe(t, s) : t,
809
- autoPlaced: !1
810
- };
811
- const d = [...t];
812
- for (const u of n) {
813
- const c = z.get(u) ?? { defaultW: 4, defaultH: 2 }, m = Math.min(Math.max(c.defaultW, c.minW ?? 1), s), y = Math.max(c.defaultH, c.minH ?? 1), f = mt(d, s, m, y);
814
- d.push(e({ id: u, x: f.x, y: f.y, w: m, h: y }));
815
- }
816
- return { resolved: oe(d, s), autoPlaced: !0 };
817
- }, [ke, h, z, s]), $e = S("");
818
- B(() => {
819
- if (!Ve) return;
820
- const e = P.map(
821
- (t) => `${t.id}:${t.x},${t.y},${t.w},${t.h}`
822
- ).join("|");
823
- $e.current !== e && ($e.current = e, Z(P));
824
- }, [Ve, P, Z]);
825
- const [Tt, _t] = J(null), [ae, qe] = J(null), [At, ce] = J(""), De = S(null), V = S(null), le = S(null), Pe = S(!1), he = S(s);
826
- he.current = s;
827
- const me = S(P);
828
- me.current = P;
829
- const ne = L((e) => {
830
- De.current = e, _t(e);
831
- }, []), Me = L(
832
- (e, t, n) => {
833
- const d = { kind: e, id: t, via: n };
834
- V.current = { ...d, baseLayout: me.current }, qe(d), ne(me.current);
835
- },
836
- [ne]
837
- ), ve = Tt ?? P, Ke = se(
838
- () => new Map(ve.map((e) => [e.id, e])),
839
- [ve]
840
- ), Ue = L(
841
- (e, t) => {
842
- ce(
843
- e === "move" ? A("dashboardGrid.movedTo", { col: t.x + 1, row: t.y + 1 }) : A("dashboardGrid.resizedTo", { cols: t.w, rows: t.h })
844
- );
845
- },
846
- [A]
847
- ), Y = S(null), O = L(
848
- (e) => {
849
- var m;
850
- (m = Y.current) == null || m.call(Y), Y.current = null;
851
- const t = De.current, n = V.current;
852
- if (V.current = null, le.current = null, qe(null), ne(null), !e || !t || !n) {
853
- ce(A("dashboardGrid.cancelled"));
854
- return;
855
- }
856
- const d = oe(t, he.current), u = (y) => y.map((f) => `${f.id}:${f.x},${f.y},${f.w},${f.h}`).join("|");
857
- if (u(d) === u(me.current)) {
858
- ce(A("dashboardGrid.cancelled"));
859
- return;
860
- }
861
- Z(d);
862
- const c = d.find((y) => y.id === n.id);
863
- ce(
864
- c ? A("dashboardGrid.droppedAt", {
865
- col: c.x + 1,
866
- row: c.y + 1
867
- }) : A("dashboardGrid.cancelled")
868
- );
869
- },
870
- [ne, Z, A]
871
- ), We = S(O);
872
- We.current = O;
873
- const Be = L(
874
- (e, t) => {
875
- if (!T) return;
876
- if (Pe.current) {
877
- Pe.current = !1;
878
- return;
879
- }
880
- const n = V.current;
881
- if ((n == null ? void 0 : n.via) !== "pointer") {
882
- if (n && n.id === t && n.kind === e) {
883
- O(!0);
884
- return;
885
- }
886
- Me(e, t, "keyboard"), ce(
887
- A(e === "move" ? "dashboardGrid.grabbed" : "dashboardGrid.resizeGrabbed")
888
- );
889
- }
890
- },
891
- [T, Me, O, A]
892
- ), Je = L(
893
- (e, t) => {
894
- const n = V.current;
895
- if (!n || n.id !== t || n.via !== "keyboard")
896
- return;
897
- if (e.key === "Escape") {
898
- e.preventDefault(), O(!1);
899
- return;
900
- }
901
- if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key)) return;
902
- e.preventDefault();
903
- const u = typeof window < "u" && G.current ? window.getComputedStyle(G.current).direction === "rtl" : !1, c = e.key === "ArrowRight" ? u ? -1 : 1 : e.key === "ArrowLeft" ? u ? 1 : -1 : 0, m = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0, f = (De.current ?? n.baseLayout).find((D) => D.id === t);
904
- if (!f) return;
905
- const v = n.kind === "move" ? pe(
906
- n.baseLayout,
907
- "move",
908
- t,
909
- f.x + c,
910
- f.y + m,
911
- s
912
- ) : pe(
913
- n.baseLayout,
914
- "resize",
915
- t,
916
- f.w + c,
917
- f.h + m,
918
- s
919
- );
920
- ne(v);
921
- const C = v.find((D) => D.id === t);
922
- C && Ue(n.kind, C);
923
- },
924
- [s, O, ne, Ue]
925
- ), be = L(() => {
926
- const e = le.current, t = V.current, n = G.current;
927
- if (!e || !t || !n) return;
928
- const d = n.getBoundingClientRect(), u = e.lastClientX - d.left - e.startGridX, c = e.lastClientY - d.top - e.startGridY, m = Math.round(u / e.colStride) * (e.isRtl ? -1 : 1), y = Math.round(c / e.rowStride), { origin: f } = e;
929
- ne(
930
- e.kind === "move" ? pe(
931
- t.baseLayout,
932
- "move",
933
- e.id,
934
- f.x + m,
935
- f.y + y,
936
- he.current
937
- ) : pe(
938
- t.baseLayout,
939
- "resize",
940
- e.id,
941
- f.w + m,
942
- f.h + y,
943
- he.current
944
- )
945
- );
946
- }, [ne]), Ee = S(!1), Qe = L(() => {
947
- var y;
948
- (y = Y.current) == null || y.call(Y);
949
- const e = (f) => {
950
- const v = le.current;
951
- !v || f.pointerId !== v.pointerId || (v.lastClientX = f.clientX, v.lastClientY = f.clientY, v.travelled || (v.travelled = Math.hypot(
952
- f.clientX - v.pressX,
953
- f.clientY - v.pressY
954
- ) > wt), be());
955
- }, t = (f) => (v) => {
956
- const C = le.current;
957
- !C || v.pointerId !== C.pointerId || (Pe.current = C.fromHandle, We.current(f));
958
- }, n = t(!0), d = t(!1), u = () => be();
959
- let c = 0;
960
- const m = () => {
961
- c = requestAnimationFrame(m);
962
- const f = le.current;
963
- if (!(f != null && f.travelled)) return;
964
- const v = G.current;
965
- if (!v) return;
966
- const { lastClientX: C, lastClientY: D } = f, K = mr(v), Re = (U, at, te) => {
967
- const Xe = te ? window.innerHeight : window.innerWidth, j = U == null ? void 0 : U.getBoundingClientRect(), It = Math.max(
968
- te ? (j == null ? void 0 : j.top) ?? 0 : (j == null ? void 0 : j.left) ?? 0,
969
- 0
970
- ), Lt = Math.min(
971
- te ? (j == null ? void 0 : j.bottom) ?? Xe : (j == null ? void 0 : j.right) ?? Xe,
972
- Xe
973
- ), ye = yt(Lt - at) - yt(at - It);
974
- if (ye === 0) return;
975
- const ct = () => U ? te ? U.scrollTop : U.scrollLeft : te ? window.scrollY : window.scrollX, Nt = ct();
976
- U == null || U.scrollBy(te ? 0 : ye, te ? ye : 0), (!U || ct() === Nt) && window.scrollBy(te ? 0 : ye, te ? ye : 0);
977
- };
978
- Re(K.y, D, !0), Re(K.x, C, !1);
979
- };
980
- c = requestAnimationFrame(m), window.addEventListener("pointermove", e), window.addEventListener("pointerup", n), window.addEventListener("pointercancel", d), window.addEventListener("scroll", u, {
981
- capture: !0,
982
- passive: !0
983
- }), Y.current = () => {
984
- cancelAnimationFrame(c), Ee.current = !1, window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", d), window.removeEventListener("scroll", u, { capture: !0 });
985
- };
986
- }, [be]);
987
- B(
988
- () => () => {
989
- var e;
990
- (e = Y.current) == null || e.call(Y), Y.current = null;
991
- },
992
- []
993
- );
994
- const Ge = L(
995
- (e, t, n, d, u) => {
996
- var K;
997
- const c = G.current, m = me.current.find((Re) => Re.id === t);
998
- if (!c || !m) return !1;
999
- const y = c.getBoundingClientRect();
1000
- if (y.width <= 0) return !1;
1001
- const f = window.getComputedStyle(c), v = Number.parseFloat(f.columnGap) || 0, C = Number.parseFloat(f.rowGap) || 0, D = (y.width - v * (s - 1)) / s;
1002
- le.current = {
1003
- kind: e,
1004
- id: t,
1005
- pointerId: n.pointerId,
1006
- startGridX: n.clientX - y.left,
1007
- startGridY: n.clientY - y.top,
1008
- lastClientX: n.clientX,
1009
- lastClientY: n.clientY,
1010
- origin: m,
1011
- colStride: D + v,
1012
- rowStride: l + C,
1013
- isRtl: f.direction === "rtl",
1014
- fromHandle: u,
1015
- pressX: n.clientX,
1016
- pressY: n.clientY,
1017
- travelled: !1
1018
- };
1019
- try {
1020
- (K = d.setPointerCapture) == null || K.call(d, n.pointerId);
1021
- } catch {
1022
- }
1023
- return Me(e, t, "pointer"), Qe(), !0;
1024
- },
1025
- [s, l, Me, Qe]
1026
- ), Ze = L(
1027
- (e, t, n) => {
1028
- var d, u;
1029
- T && (V.current || (n.preventDefault(), (u = (d = n.currentTarget).focus) == null || u.call(d), Ge(e, t, n, n.currentTarget, !0)));
1030
- },
1031
- [T, Ge]
1032
- ), ee = S(null), ie = L(() => {
1033
- const e = ee.current;
1034
- ee.current = null, e && (e.holdTimer && clearTimeout(e.holdTimer), e.cleanup());
1035
- }, []), et = L(
1036
- (e, t) => {
1037
- if (!T || V.current || ee.current || t.button !== 0 || !t.isPrimary) return;
1038
- const n = t.target;
1039
- if (!t.currentTarget.contains(n)) return;
1040
- const d = n.closest(cr);
1041
- if (d && t.currentTarget.contains(d)) return;
1042
- const u = t.currentTarget, c = t.pointerType === "touch";
1043
- c || t.preventDefault();
1044
- const m = (v, C) => {
1045
- const D = ee.current;
1046
- if (ie(), !(!D || V.current) && Ge(
1047
- "move",
1048
- D.id,
1049
- {
1050
- pointerId: D.pointerId,
1051
- clientX: D.startClientX,
1052
- clientY: D.startClientY
1053
- },
1054
- D.surface,
1055
- !1
1056
- )) {
1057
- Ee.current = c;
1058
- const K = le.current;
1059
- K && (K.lastClientX = v, K.lastClientY = C, K.travelled = !c), be();
1060
- }
1061
- }, y = (v) => {
1062
- const C = ee.current;
1063
- if (!C || v.pointerId !== C.pointerId) return;
1064
- const D = Math.hypot(
1065
- v.clientX - C.startClientX,
1066
- v.clientY - C.startClientY
1067
- );
1068
- c ? D > ur && ie() : D > wt && m(v.clientX, v.clientY);
1069
- }, f = (v) => {
1070
- var C;
1071
- v.pointerId === ((C = ee.current) == null ? void 0 : C.pointerId) && ie();
1072
- };
1073
- window.addEventListener("pointermove", y), window.addEventListener("pointerup", f), window.addEventListener("pointercancel", f), ee.current = {
1074
- id: e,
1075
- pointerId: t.pointerId,
1076
- pointerType: t.pointerType,
1077
- startClientX: t.clientX,
1078
- startClientY: t.clientY,
1079
- surface: u,
1080
- holdTimer: c ? setTimeout(() => {
1081
- const v = ee.current;
1082
- v && m(v.startClientX, v.startClientY);
1083
- }, lr) : null,
1084
- cleanup: () => {
1085
- window.removeEventListener("pointermove", y), window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", f);
1086
- }
1087
- };
1088
- },
1089
- [T, Ge, be, ie]
1090
- );
1091
- B(() => {
1092
- T || (ie(), V.current && We.current(!1));
1093
- }, [T, ie]), B(() => ie, [ie]), B(() => {
1094
- const e = G.current;
1095
- if (!T || !e) return;
1096
- const t = (d) => {
1097
- Ee.current && d.cancelable && d.preventDefault();
1098
- }, n = (d) => {
1099
- (ee.current || Ee.current) && d.preventDefault();
1100
- };
1101
- return e.addEventListener("touchmove", t, { passive: !1 }), e.addEventListener("contextmenu", n), () => {
1102
- e.removeEventListener("touchmove", t), e.removeEventListener("contextmenu", n);
1103
- };
1104
- }, [T]), B(() => {
1105
- if (!ae) return;
1106
- const e = (t) => {
1107
- t.key === "Escape" && O(!1);
1108
- };
1109
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1110
- }, [ae, O]), B(() => {
1111
- if (!ae || ae.via !== "keyboard") return;
1112
- const e = (n) => {
1113
- var u;
1114
- const d = n.relatedTarget;
1115
- (!d || !((u = G.current) != null && u.contains(d))) && O(!1);
1116
- }, t = G.current;
1117
- return t == null || t.addEventListener("focusout", e), () => t == null ? void 0 : t.removeEventListener("focusout", e);
1118
- }, [ae, O]), re(() => {
1119
- M && (V.current && O(!1), a && ce(A("dashboardGrid.stackedReadOnly")));
1120
- }, [M, a, O, A]), re(() => {
1121
- var u;
1122
- const e = fe.current;
1123
- fe.current = null;
1124
- const t = $.current;
1125
- if (!e || !t) return;
1126
- const n = document.activeElement;
1127
- if (n === e.element || n !== null && n !== document.body) return;
1128
- if (t.contains(e.element)) {
1129
- e.element.focus();
1130
- return;
1131
- }
1132
- const d = e.widgetId ? Array.from(
1133
- t.querySelectorAll("[data-widget-id]")
1134
- ).find(
1135
- (c) => c.getAttribute("data-widget-id") === e.widgetId
1136
- ) : void 0;
1137
- if (d) {
1138
- d.setAttribute("tabindex", "-1"), d.focus();
1139
- return;
1140
- }
1141
- (u = G.current) == null || u.focus();
1142
- }, [M]);
1143
- const Te = S(o);
1144
- Te.current = o;
1145
- const tt = S(!1);
1146
- re(() => {
1147
- var e;
1148
- tt.current !== M && (tt.current = M, (e = Te.current) == null || e.call(Te, M));
1149
- }, [M]), re(() => {
1150
- const e = G.current;
1151
- e && (e.style.setProperty("--dg-cols", String(s)), e.style.setProperty("--dg-row", `${l}px`));
1152
- }, [s, l]);
1153
- const rt = kt(ve);
1154
- re(() => {
1155
- const e = G.current;
1156
- e && (e.style.setProperty(
1157
- "--dg-grid-lines",
1158
- `repeating-linear-gradient(to right, color-mix(in srgb, var(--border) 50%, transparent) 0 1px, transparent 1px calc((100% + var(--spacing-md)) / ${s})), repeating-linear-gradient(to bottom, color-mix(in srgb, var(--border) 50%, transparent) 0 1px, transparent 1px calc(${l}px + var(--spacing-md)))`
1159
- ), e.style.setProperty(
1160
- "--dg-min-block",
1161
- `calc(${rt + 2} * (${l}px + var(--spacing-md)) - var(--spacing-md))`
1162
- ));
1163
- }, [s, l, rt]);
1164
- const nt = S(null), He = T && !!W, _e = se(
1165
- () => He ? mt(ve, s, 2, 2) : null,
1166
- [He, ve, s]
1167
- );
1168
- re(() => {
1169
- const e = nt.current;
1170
- !e || !_e || (e.style.setProperty("--dg-x", String(_e.x + 1)), e.style.setProperty("--dg-y", String(_e.y + 1)), e.style.setProperty("--dg-w", "2"), e.style.setProperty("--dg-h", "2"));
1171
- }, [_e]);
1172
- const it = L(
1173
- (e) => {
1174
- var u, c;
1175
- const t = Array.from(
1176
- ((u = G.current) == null ? void 0 : u.querySelectorAll("[data-widget-id]")) ?? []
1177
- ), n = t.findIndex(
1178
- (m) => m.getAttribute("data-widget-id") === e
1179
- ), d = (c = t[n + 1] ?? t[n - 1]) == null ? void 0 : c.getAttribute(
1180
- "data-widget-id"
1181
- );
1182
- Z(
1183
- oe(
1184
- me.current.filter((m) => m.id !== e),
1185
- he.current
1186
- )
1187
- ), ce(A("dashboardGrid.removed")), I == null || I(e), requestAnimationFrame(() => {
1188
- const m = G.current;
1189
- if (!m) return;
1190
- const y = Array.from(
1191
- m.querySelectorAll("[data-widget-id]")
1192
- ).find((v) => v.getAttribute("data-widget-id") === d), f = (y == null ? void 0 : y.querySelector("button")) ?? m.querySelector("button");
1193
- f ? f.focus() : m.focus();
1194
- });
1195
- },
1196
- [Z, I, A]
1197
- ), [st, ot] = J(null), F = S(null), we = S(null), Ae = S(0), Ce = L(() => {
1198
- var c;
1199
- const e = F.current, t = G.current;
1200
- if (!e || !t) return !1;
1201
- const n = Array.from(
1202
- t.querySelectorAll("[data-widget-id]")
1203
- ).find((m) => m.getAttribute("data-widget-id") === e.id), d = n == null ? void 0 : n.getBoundingClientRect();
1204
- if (!n || !d || d.height <= 0)
1205
- return performance.now() > e.deadline && (F.current = null, e.resolve(!1)), !1;
1206
- F.current = null;
1207
- const u = ((c = window.matchMedia) == null ? void 0 : c.call(window, "(prefers-reduced-motion: reduce)").matches) || window.getComputedStyle(t).getPropertyValue("--animation-duration").trim() === "0ms";
1208
- return n.scrollIntoView({
1209
- block: "nearest",
1210
- inline: "nearest",
1211
- behavior: u ? "auto" : "smooth"
1212
- }), ot(e.id), we.current && clearTimeout(we.current), we.current = setTimeout(
1213
- () => ot(null),
1214
- ar
1215
- ), e.resolve(!0), !0;
1216
- }, []), dt = L(
1217
- (e) => new Promise((t) => {
1218
- var c;
1219
- (c = F.current) == null || c.resolve(!1), cancelAnimationFrame(Ae.current);
1220
- const n = setTimeout(() => {
1221
- const m = F.current;
1222
- (m == null ? void 0 : m.resolve) === d && !Ce() && F.current === m && (F.current = null, d(!1));
1223
- }, vt), d = (m) => {
1224
- clearTimeout(n), t(m);
1225
- };
1226
- F.current = {
1227
- id: e,
1228
- deadline: performance.now() + vt,
1229
- resolve: d
1230
- };
1231
- const u = () => {
1232
- F.current && !Ce() && F.current && (Ae.current = requestAnimationFrame(u));
1233
- };
1234
- Ae.current = requestAnimationFrame(u);
1235
- }),
1236
- [Ce]
1237
- );
1238
- re(() => {
1239
- F.current && Ce();
1240
- }), B(
1241
- () => () => {
1242
- var e;
1243
- cancelAnimationFrame(Ae.current), we.current && clearTimeout(we.current), (e = F.current) == null || e.resolve(!1), F.current = null;
1244
- },
1245
- []
1246
- );
1247
- const ze = se(
1248
- () => ({
1249
- moveWidgetTo(e, t, n) {
1250
- if (!T || Q.current || !Number.isFinite(t) || !Number.isFinite(n) || !P.some((u) => u.id === e)) return !1;
1251
- const d = pe(
1252
- P,
1253
- "move",
1254
- e,
1255
- Math.round(t),
1256
- Math.round(n),
1257
- s,
1258
- !1
1259
- );
1260
- return d !== P && Z(oe(d, s)), !0;
1261
- },
1262
- resizeWidgetTo(e, t, n) {
1263
- if (!T || Q.current || !Number.isFinite(t) || !Number.isFinite(n) || !P.some((u) => u.id === e)) return !1;
1264
- const d = pe(
1265
- P,
1266
- "resize",
1267
- e,
1268
- Math.round(t),
1269
- Math.round(n),
1270
- s,
1271
- !1
1272
- );
1273
- return d !== P && Z(oe(d, s)), !0;
1274
- },
1275
- revealWidget: dt,
1276
- getGridState() {
1277
- return {
1278
- cols: s,
1279
- editing: a,
1280
- stacked: M,
1281
- layout: Se(P),
1282
- selectedId: x ?? null
1283
- };
1284
- }
1285
- }),
1286
- [
1287
- T,
1288
- a,
1289
- M,
1290
- P,
1291
- s,
1292
- Z,
1293
- Se,
1294
- dt,
1295
- x
1296
- ]
1297
- );
1298
- Pt(H, () => ze, [ze]), Ot(Jt, ze, i);
1299
- const Ct = se(
1300
- () => ({
1301
- editing: T,
1302
- stacked: M,
1303
- stackedHeight: w,
1304
- selectedId: x,
1305
- revealedId: st,
1306
- headingLevel: _,
1307
- layoutById: Ke,
1308
- grab: ae,
1309
- canRemove: !!I,
1310
- requestRemove: it,
1311
- startKeyboardGrab: Be,
1312
- keyboardStep: Je,
1313
- startPointerGrab: Ze,
1314
- startHeaderPress: et
1315
- }),
1316
- [
1317
- T,
1318
- M,
1319
- w,
1320
- x,
1321
- st,
1322
- _,
1323
- Ke,
1324
- ae,
1325
- I,
1326
- it,
1327
- Be,
1328
- Je,
1329
- Ze,
1330
- et
1331
- ]
1332
- ), Rt = se(() => {
1333
- if (b === void 0) return k;
1334
- const e = [], t = /* @__PURE__ */ new Map(), n = [];
1335
- return Le(k, (d) => {
1336
- const u = d.props.id;
1337
- if (u && !t.has(u)) {
1338
- const c = lt(d, {
1339
- key: `widget:${u}:${d.key ?? ""}`
1340
- });
1341
- t.set(u, c), e.push(c);
1342
- } else {
1343
- const c = lt(d, {
1344
- key: d.key === null ? `child:at:${n.length}` : `child:key:${d.key}`
1345
- });
1346
- n.push(c), e.push(c);
1347
- }
1348
- }), M ? [
1349
- ...tr([...t.keys()], P).map(
1350
- (d) => t.get(d)
1351
- ),
1352
- ...n
1353
- ] : e;
1354
- }, [b, k, M, P]);
1355
- return /* @__PURE__ */ ge(
1356
- "div",
1357
- {
1358
- ref: $,
1359
- "data-component": "dashboard-grid",
1360
- "data-component-id": i,
1361
- "data-editing": T || void 0,
1362
- "data-stacked": M || void 0,
1363
- className: `ds:block ds:w-full ${E ?? ""}`.trim(),
1364
- children: [
1365
- /* @__PURE__ */ R("div", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: At }),
1366
- /* @__PURE__ */ ge(
1367
- "div",
1368
- {
1369
- ref: G,
1370
- role: "list",
1371
- "aria-label": r,
1372
- tabIndex: -1,
1373
- "data-editing": T || void 0,
1374
- "data-stacked": M || void 0,
1375
- className: rr({ stacked: M }),
1376
- children: [
1377
- /* @__PURE__ */ R(St.Provider, { value: Ct, children: Rt }),
1378
- He ? (
1379
- // role="list" allows only listitem children — the tile wrapper
1380
- // carries the grid placement, the button fills it.
1381
- /* @__PURE__ */ R(
1382
- "div",
1383
- {
1384
- ref: nt,
1385
- role: "listitem",
1386
- className: [
1387
- "ds:flex",
1388
- "ds:[grid-column-start:var(--dg-x)] ds:[grid-column-end:span_var(--dg-w)]",
1389
- "ds:[grid-row-start:var(--dg-y)] ds:[grid-row-end:span_var(--dg-h)]"
1390
- ].join(" "),
1391
- children: /* @__PURE__ */ ge(
1392
- "button",
1393
- {
1394
- type: "button",
1395
- onClick: W,
1396
- className: [
1397
- "ds:flex ds:flex-1 ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
1398
- "ds:rounded-[var(--radius-lg)] ds:border ds:border-dashed ds:border-border",
1399
- "ds:text-sm ds:text-muted-foreground ds:transition-colors",
1400
- "ds:hover:bg-muted/10 ds:hover:text-foreground",
1401
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring"
1402
- ].join(" "),
1403
- children: [
1404
- /* @__PURE__ */ R(jt, { "aria-hidden": "true", className: "ds:size-4" }),
1405
- A("dashboardGrid.add")
1406
- ]
1407
- }
1408
- )
1409
- }
1410
- )
1411
- ) : null
1412
- ]
1413
- }
1414
- )
1415
- ]
1416
- }
1417
- );
1418
- }
1419
- );
1420
- Et.displayName = "DashboardGrid";
1421
- const _r = Object.assign(Et, {
1422
- Widget: Mt
1423
- });
1424
- export {
1425
- _r as D,
1426
- Jt as d
1427
- };
1428
- //# sourceMappingURL=dashboard-grid-B2MB7SRS.js.map