@alfadocs/ui-kit 0.1.9 → 0.2.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 (281) hide show
  1. package/README.md +30 -0
  2. package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
  3. package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
  4. package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
  5. package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
  6. package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
  7. package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
  8. package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
  9. package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
  10. package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
  11. package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
  12. package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
  13. package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
  14. package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
  15. package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
  16. package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
  17. package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
  18. package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
  19. package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
  20. package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
  21. package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
  22. package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
  23. package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
  24. package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
  25. package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
  26. package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
  27. package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
  28. package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
  29. package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
  30. package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
  31. package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
  32. package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
  33. package/dist/_chunks/file-upload-C947ACDK.js +829 -0
  34. package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
  35. package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
  36. package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
  37. package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
  38. package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
  39. package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
  40. package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
  41. package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
  42. package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
  43. package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
  44. package/dist/_chunks/list-qP6p0NTw.js +434 -0
  45. package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
  46. package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
  47. package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
  48. package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
  49. package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
  50. package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
  51. package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
  52. package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
  53. package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
  54. package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
  55. package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
  56. package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
  57. package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
  58. package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
  59. package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
  60. package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
  61. package/dist/_chunks/popover-DekUKNBk.js +293 -0
  62. package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
  63. package/dist/_chunks/progress-C11tqhoI.js +298 -0
  64. package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
  65. package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
  66. package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
  67. package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
  68. package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
  69. package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
  70. package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
  71. package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
  72. package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
  73. package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
  74. package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
  75. package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
  76. package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
  77. package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
  78. package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
  79. package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
  80. package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
  81. package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
  82. package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
  83. package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
  84. package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
  85. package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
  86. package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
  87. package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
  88. package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
  89. package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
  90. package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
  91. package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
  92. package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
  93. package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
  94. package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
  95. package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
  96. package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
  97. package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
  98. package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
  99. package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
  100. package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
  101. package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
  102. package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
  103. package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
  104. package/dist/agent-catalog.json +580 -15
  105. package/dist/components/_shared/index.d.ts +2 -2
  106. package/dist/components/accordion/index.d.ts +1 -1
  107. package/dist/components/accordion/index.js +5 -6
  108. package/dist/components/agenda-card/index.js +1 -1
  109. package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
  110. package/dist/components/agenda-tray/index.js +1 -1
  111. package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
  112. package/dist/components/ai-prompt-input/index.js +1 -1
  113. package/dist/components/alert/index.d.ts +1 -1
  114. package/dist/components/alert/index.js +1 -1
  115. package/dist/components/app-frame/index.js +1 -1
  116. package/dist/components/audio-recorder/index.js +1 -1
  117. package/dist/components/audio-visualiser/index.js +1 -1
  118. package/dist/components/autocomplete/index.js +1 -1
  119. package/dist/components/badge/index.js +1 -1
  120. package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
  121. package/dist/components/breadcrumb/index.js +1 -1
  122. package/dist/components/button/index.js +2 -2
  123. package/dist/components/calendar/index.js +1 -1
  124. package/dist/components/card/index.js +1 -1
  125. package/dist/components/chart/index.d.ts +1 -1
  126. package/dist/components/chart/index.js +1 -1
  127. package/dist/components/chat-container/chat-container.d.ts +1 -1
  128. package/dist/components/chat-container/index.js +2 -3
  129. package/dist/components/chat-input/chat-input.d.ts +1 -1
  130. package/dist/components/chat-input/index.js +3 -4
  131. package/dist/components/chat-message/index.js +1 -1
  132. package/dist/components/checkbox-group/index.d.ts +1 -1
  133. package/dist/components/collapsible/collapsible.d.ts +1 -1
  134. package/dist/components/collapsible/index.d.ts +1 -1
  135. package/dist/components/collapsible/index.js +1 -1
  136. package/dist/components/color-picker/index.js +1 -1
  137. package/dist/components/combobox/index.d.ts +1 -1
  138. package/dist/components/combobox/index.js +1 -1
  139. package/dist/components/command-palette/command-palette.d.ts +46 -13
  140. package/dist/components/command-palette/index.js +1 -1
  141. package/dist/components/data-table/data-table.d.ts +3 -1
  142. package/dist/components/data-table/index.js +1 -1
  143. package/dist/components/data-table/toolbar.d.ts +6 -5
  144. package/dist/components/date-picker/date-picker.d.ts +1 -1
  145. package/dist/components/date-picker/index.d.ts +1 -1
  146. package/dist/components/date-picker/index.js +1 -1
  147. package/dist/components/date-range-picker/index.js +1 -1
  148. package/dist/components/date-time-picker/index.d.ts +1 -1
  149. package/dist/components/date-time-picker/index.js +1 -1
  150. package/dist/components/description-list/description-list.d.ts +1 -2
  151. package/dist/components/description-list/index.js +1 -1
  152. package/dist/components/dialog/dialog.d.ts +2 -2
  153. package/dist/components/dialog/index.js +1 -1
  154. package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
  155. package/dist/components/dropdown-menu/index.js +3 -4
  156. package/dist/components/empty-state/index.js +1 -1
  157. package/dist/components/file-upload/index.d.ts +1 -1
  158. package/dist/components/file-upload/index.js +1 -1
  159. package/dist/components/floating-action-button/index.js +1 -1
  160. package/dist/components/form-field/index.js +2 -2
  161. package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
  162. package/dist/components/freemium-paywall/index.js +1 -1
  163. package/dist/components/header/index.js +1 -1
  164. package/dist/components/icon-button/index.js +1 -1
  165. package/dist/components/kbd/index.js +1 -1
  166. package/dist/components/key-value-pair/index.js +1 -1
  167. package/dist/components/link/index.js +1 -1
  168. package/dist/components/list/index.js +1 -1
  169. package/dist/components/logo/index.js +1 -1
  170. package/dist/components/matrix-rain/index.js +1 -1
  171. package/dist/components/message-card/index.d.ts +1 -1
  172. package/dist/components/message-card/index.js +1 -1
  173. package/dist/components/message-tray/index.js +1 -1
  174. package/dist/components/message-tray/message-tray.d.ts +1 -1
  175. package/dist/components/multi-select/index.js +1 -1
  176. package/dist/components/navigation-menu/index.js +1 -1
  177. package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
  178. package/dist/components/notification-card/index.d.ts +1 -1
  179. package/dist/components/notification-card/index.js +1 -1
  180. package/dist/components/notification-tray/index.js +1 -1
  181. package/dist/components/notification-tray/notification-tray.d.ts +1 -1
  182. package/dist/components/number-input/index.js +1 -1
  183. package/dist/components/otp-input/index.js +1 -1
  184. package/dist/components/pagination/index.js +1 -1
  185. package/dist/components/pagination/pagination.d.ts +4 -6
  186. package/dist/components/password-input/index.js +1 -1
  187. package/dist/components/payment-form/index.js +7 -8
  188. package/dist/components/payment-form/payment-form.d.ts +1 -1
  189. package/dist/components/pdf-viewer/index.js +1 -1
  190. package/dist/components/phone-input/index.d.ts +1 -1
  191. package/dist/components/phone-input/index.js +1 -1
  192. package/dist/components/popover/index.js +3 -4
  193. package/dist/components/privacy-lock/index.js +1 -1
  194. package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
  195. package/dist/components/progress/index.js +3 -4
  196. package/dist/components/recaptcha-widget/index.js +1 -1
  197. package/dist/components/resizable/index.d.ts +1 -1
  198. package/dist/components/resizable/index.js +1 -1
  199. package/dist/components/rich-text-editor/index.js +1 -1
  200. package/dist/components/scroll-area/index.js +1 -1
  201. package/dist/components/search-bar/index.js +1 -1
  202. package/dist/components/search-bar/search-bar.d.ts +1 -1
  203. package/dist/components/search-input/index.js +1 -1
  204. package/dist/components/select/index.js +1 -1
  205. package/dist/components/select/select.d.ts +1 -1
  206. package/dist/components/separator/index.js +1 -1
  207. package/dist/components/sheet/index.js +3 -4
  208. package/dist/components/sheet/sheet.d.ts +2 -2
  209. package/dist/components/sidebar/index.js +7 -8
  210. package/dist/components/sidebar/sidebar.d.ts +0 -2
  211. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  212. package/dist/components/signature-capture/index.js +1 -1
  213. package/dist/components/skeleton/index.js +1 -1
  214. package/dist/components/slider/index.js +1 -1
  215. package/dist/components/slot-grid/index.js +1 -1
  216. package/dist/components/sparkline/index.js +1 -1
  217. package/dist/components/spinner/index.js +1 -1
  218. package/dist/components/stat/index.js +1 -1
  219. package/dist/components/stepper-calendar/index.js +1 -1
  220. package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
  221. package/dist/components/stepper-progress/index.d.ts +1 -1
  222. package/dist/components/stepper-progress/index.js +1 -2
  223. package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
  224. package/dist/components/suggestion-chip/index.js +1 -1
  225. package/dist/components/switch/index.js +1 -1
  226. package/dist/components/tabs/index.d.ts +1 -1
  227. package/dist/components/tabs/index.js +1 -1
  228. package/dist/components/tag/index.js +1 -1
  229. package/dist/components/task-card/index.js +1 -1
  230. package/dist/components/task-tray/index.js +1 -1
  231. package/dist/components/task-tray/task-tray.d.ts +1 -1
  232. package/dist/components/text-area/index.js +1 -1
  233. package/dist/components/text-input/index.js +1 -1
  234. package/dist/components/theme-root/index.js +1 -1
  235. package/dist/components/theme-toggle/index.js +1 -1
  236. package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
  237. package/dist/components/time-picker/index.js +1 -1
  238. package/dist/components/time-picker/time-picker.d.ts +1 -1
  239. package/dist/components/timeline/index.js +1 -1
  240. package/dist/components/timeline/timeline.d.ts +1 -1
  241. package/dist/components/toast/index.js +1 -1
  242. package/dist/components/tooth-scheme/index.js +1 -1
  243. package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
  244. package/dist/components/transcript-panel/index.js +1 -1
  245. package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
  246. package/dist/components/typing-indicator/index.js +1 -1
  247. package/dist/components/visually-hidden/index.js +1 -1
  248. package/dist/components/warning-stack/index.js +1 -1
  249. package/dist/components/workflow/index.js +1 -1
  250. package/dist/components/workflow/workflow-editor.d.ts +1 -1
  251. package/dist/hooks/index.js +1 -1
  252. package/dist/index.js +392 -402
  253. package/dist/patterns/leo-assistant/index.js +1 -1
  254. package/dist/patterns/patient-shell/index.js +1 -1
  255. package/dist/safe-html/index.js +20 -3
  256. package/dist/tokens.css +2 -2
  257. package/package.json +12 -2
  258. package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
  259. package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
  260. package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
  261. package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
  262. package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
  263. package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
  264. package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
  265. package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
  266. package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
  267. package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
  268. package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
  269. package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
  270. package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
  271. package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
  272. package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
  273. package/dist/_chunks/popover-kFN8s84V.js +0 -229
  274. package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
  275. package/dist/_chunks/progress-wNsqkw8I.js +0 -253
  276. package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
  277. package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
  278. package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
  279. package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
  280. package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
  281. package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
@@ -1,34 +1,106 @@
1
- import { jsx as r, jsxs as I } from "react/jsx-runtime";
2
- import { forwardRef as Fe, useContext as De, useState as E, useRef as M, useMemo as P, useLayoutEffect as Le } from "react";
3
- import * as V from "@radix-ui/react-popover";
1
+ import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
+ import { forwardRef as Me, useContext as Pe, useState as L, useRef as k, useMemo as O, useEffect as Q, useCallback as je, useLayoutEffect as $e } from "react";
3
+ import * as z from "@radix-ui/react-popover";
4
4
  import { _ as u } from "./index-4xgbg-sn.js";
5
- import { c as oe } from "./index-D2ZczOXr.js";
6
- import { useTranslation as ze } from "react-i18next";
7
- import { u as Oe, F as qe } from "./form-field-context-94LwgYTQ.js";
8
- import { T as se } from "./tooltip-DHik5yRI.js";
9
- import { c as Me } from "./compose-refs-C0k0tdqF.js";
10
- import { g as Pe } from "./group-options-BvKhQ3xb.js";
11
- import { b as j, c as je } from "./input-surface-u4QB0lxe.js";
12
- import { X as $e } from "./x-CCcI3eJp.js";
13
- import { C as Be } from "./check-DPdL_Sm7.js";
14
- const Ke = oe(
5
+ import { c as ue } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as Be } from "react-i18next";
7
+ import { u as Ke, F as Ue } from "./form-field-context-B3APVHKx.js";
8
+ import { T as de } from "./tooltip-DHik5yRI.js";
9
+ import { c as Qe } from "./compose-refs-C0k0tdqF.js";
10
+ import { g as Ye } from "./group-options-BvKhQ3xb.js";
11
+ import { b as Y, c as Ge } from "./input-surface-u4QB0lxe.js";
12
+ import { u as He } from "./registry-C9nwlNyL.js";
13
+ import { X as Xe } from "./x-CCcI3eJp.js";
14
+ import { C as Je } from "./check-DPdL_Sm7.js";
15
+ const We = {
16
+ id: "multi-select",
17
+ capabilities: ["select_multiple", "filter", "open", "close"],
18
+ state: {
19
+ selection: {
20
+ type: "string[]",
21
+ description: "Values of currently-selected options.",
22
+ read: (i) => i.getSelection()
23
+ },
24
+ query: {
25
+ type: "string",
26
+ description: "Current filter query.",
27
+ read: (i) => i.getQuery()
28
+ },
29
+ isOpen: {
30
+ type: "boolean",
31
+ description: "True when the option list is visible.",
32
+ read: (i) => i.getIsOpen()
33
+ }
34
+ },
35
+ actions: {
36
+ set_selection: {
37
+ safety: "read",
38
+ argsType: "{ values: string[] }",
39
+ description: "Replace the current selection with the given list of values.",
40
+ invoke: (i, c) => {
41
+ i.setSelection(c.values);
42
+ }
43
+ },
44
+ clear_selection: {
45
+ safety: "read",
46
+ description: "Clear the current selection.",
47
+ invoke: (i) => {
48
+ i.clearSelection();
49
+ }
50
+ },
51
+ apply_filter: {
52
+ safety: "read",
53
+ argsType: "{ query: string }",
54
+ description: "Set the filter query for the option list.",
55
+ invoke: (i, c) => {
56
+ i.setQuery(c.query);
57
+ }
58
+ },
59
+ open: {
60
+ safety: "read",
61
+ description: "Open the option list.",
62
+ invoke: (i) => {
63
+ i.open();
64
+ }
65
+ },
66
+ close: {
67
+ safety: "read",
68
+ description: "Close the option list.",
69
+ invoke: (i) => {
70
+ i.close();
71
+ }
72
+ }
73
+ },
74
+ domHooks: {
75
+ root: { attr: "data-component", value: "multi-select" },
76
+ instanceId: {
77
+ attr: "data-component-id",
78
+ sourceProp: "id",
79
+ description: "Sourced from the id prop."
80
+ },
81
+ item: {
82
+ attr: "data-option-id",
83
+ description: "Each option emits its value as data-option-id."
84
+ }
85
+ }
86
+ }, Ze = ue(
15
87
  [
16
88
  "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full",
17
- je,
89
+ Ge,
18
90
  "ds:aria-[invalid=true]:border-destructive",
19
91
  "ds:aria-disabled:cursor-not-allowed ds:aria-disabled:opacity-50"
20
92
  ],
21
93
  {
22
94
  variants: {
23
95
  size: {
24
- sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${j.sm}`,
25
- md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${j.md}`,
26
- lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${j.lg}`
96
+ sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${Y.sm}`,
97
+ md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${Y.md}`,
98
+ lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${Y.lg}`
27
99
  }
28
100
  },
29
101
  defaultVariants: { size: "md" }
30
102
  }
31
- ), re = oe(
103
+ ), le = ue(
32
104
  [
33
105
  "ds:inline-flex ds:items-center ds:gap-1",
34
106
  "ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted",
@@ -48,7 +120,7 @@ const Ke = oe(
48
120
  },
49
121
  defaultVariants: { size: "md" }
50
122
  }
51
- ), Ue = [
123
+ ), et = [
52
124
  "ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
53
125
  "ds:rounded-[var(--radius-sm)]",
54
126
  "ds:text-muted-foreground ds:hover:text-foreground",
@@ -57,7 +129,7 @@ const Ke = oe(
57
129
  "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
58
130
  "ds:size-4",
59
131
  'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""]'
60
- ].join(" "), Ye = [
132
+ ].join(" "), tt = [
61
133
  "ds:z-[var(--z-dropdown)] ds:overflow-hidden",
62
134
  "ds:min-w-[var(--radix-popover-trigger-width)]",
63
135
  "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
@@ -68,258 +140,292 @@ const Ke = oe(
68
140
  "ds:data-[side=bottom]:slide-in-from-top-2",
69
141
  "ds:data-[side=top]:slide-in-from-bottom-2",
70
142
  "ds:motion-reduce:animate-none"
71
- ].join(" "), Ge = [
143
+ ].join(" "), st = [
72
144
  "ds:relative ds:flex ds:cursor-pointer ds:items-center",
73
145
  "ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
74
146
  "ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none ds:select-none",
75
147
  "ds:data-[selected=true]:bg-muted ds:data-[selected=true]:text-foreground",
76
148
  "ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50",
77
149
  "ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50"
78
- ].join(" "), ne = [
150
+ ].join(" "), ce = [
79
151
  "ds:relative ds:flex ds:cursor-pointer ds:items-center",
80
152
  "ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
81
153
  "ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none",
82
154
  "ds:data-[selected=true]:bg-muted"
83
- ].join(" "), Qe = "__ui-multiselect-select-all__", He = "__ui-multiselect-clear-all__", ie = Fe(
155
+ ].join(" "), rt = "__ui-multiselect-select-all__", nt = "__ui-multiselect-clear-all__", fe = Me(
84
156
  function({
85
157
  options: c,
86
- value: $,
87
- defaultValue: de,
88
- onChange: F,
89
- onComplete: D,
90
- placeholder: ae,
91
- maxSelections: g,
92
- allowSelectAll: B = !1,
93
- allowClear: K = !1,
94
- filter: L,
95
- size: S = "md",
96
- disabled: le,
97
- className: ce,
98
- id: U,
99
- ...ue
100
- }, fe) {
101
- const { t: f } = ze(), v = Oe(), x = De(qe) !== null, [me, pe] = E(
102
- de ?? []
103
- ), Y = $ !== void 0, n = Y ? $ : me, [G, p] = E(!1), [b, Q] = E(""), y = M(null), w = M([]), H = M(null), he = Me(fe, H), h = x && v.disabled || !!le, ge = x && v.required, X = x && v.invalid, ve = x && v.describedBy ? v.describedBy : void 0, be = U ?? (x ? v.id : void 0), ye = P(() => {
158
+ value: G,
159
+ defaultValue: me,
160
+ onChange: v,
161
+ onComplete: q,
162
+ placeholder: pe,
163
+ maxSelections: b,
164
+ allowSelectAll: H = !1,
165
+ allowClear: X = !1,
166
+ filter: M,
167
+ size: T = "md",
168
+ disabled: he,
169
+ className: ve,
170
+ id: P,
171
+ ...ge
172
+ }, be) {
173
+ const { t: f } = Be(), y = Ke(), S = Pe(Ue) !== null, [ye, J] = L(
174
+ me ?? []
175
+ ), E = G !== void 0, r = E ? G : ye, [A, m] = L(!1), [p, j] = L(""), w = k(null), I = k([]), W = k(null), we = Qe(be, W), g = S && y.disabled || !!he, Ie = S && y.required, Z = S && y.invalid, xe = S && y.describedBy ? y.describedBy : void 0, ke = P ?? (S ? y.id : void 0), Se = O(() => {
104
176
  const e = /* @__PURE__ */ new Map();
105
177
  for (const t of c) e.set(t.value, t.label);
106
178
  return e;
107
- }, [c]), J = typeof g == "number" && n.length >= g, k = (e) => {
108
- Y || pe(e), F == null || F(e);
109
- }, we = (e) => {
110
- if (n.includes(e)) {
111
- k(n.filter((t) => t !== e));
179
+ }, [c]), ee = typeof b == "number" && r.length >= b, N = (e) => {
180
+ E || J(e), v == null || v(e);
181
+ }, Ae = (e) => {
182
+ if (r.includes(e)) {
183
+ N(r.filter((t) => t !== e));
112
184
  return;
113
185
  }
114
- J || k([...n, e]);
115
- }, z = (e) => {
116
- const t = n.filter((s, o) => o !== e);
117
- return k(t), t;
118
- }, Ie = () => {
119
- const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof g == "number" ? g : e.length;
120
- k(e.slice(0, t));
121
- }, xe = () => {
122
- k([]);
123
- }, W = ae ?? f("ui.inputs.multiSelect.placeholder", "Select…"), Z = P(() => {
124
- if (!b) return c;
125
- const e = b.toLowerCase();
126
- return c.filter((t) => L ? L(b, t) : t.label.toLowerCase().includes(e));
127
- }, [c, b, L]), ke = P(
128
- () => Pe(Z),
129
- [Z]
130
- ), Ne = (e) => {
186
+ ee || N([...r, e]);
187
+ }, $ = (e) => {
188
+ const t = r.filter((s, o) => o !== e);
189
+ return N(t), t;
190
+ }, Ne = () => {
191
+ const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof b == "number" ? b : e.length;
192
+ N(e.slice(0, t));
193
+ }, _e = () => {
194
+ N([]);
195
+ }, te = k(r);
196
+ Q(() => {
197
+ te.current = r;
198
+ }, [r]);
199
+ const se = k(p);
200
+ Q(() => {
201
+ se.current = p;
202
+ }, [p]);
203
+ const re = k(A);
204
+ Q(() => {
205
+ re.current = A;
206
+ }, [A]);
207
+ const B = je(
208
+ (e) => {
209
+ E || J(e), v == null || v(e);
210
+ },
211
+ [E, v]
212
+ ), Re = O(
213
+ () => ({
214
+ getSelection: () => [...te.current],
215
+ getQuery: () => se.current,
216
+ getIsOpen: () => re.current,
217
+ setSelection: (e) => B(e),
218
+ clearSelection: () => B([]),
219
+ setQuery: (e) => j(e),
220
+ open: () => m(!0),
221
+ close: () => m(!1)
222
+ }),
223
+ [B]
224
+ );
225
+ He(We, Re, P);
226
+ const ne = pe ?? f("ui.inputs.multiSelect.placeholder", "Select…"), oe = O(() => {
227
+ if (!p) return c;
228
+ const e = p.toLowerCase();
229
+ return c.filter((t) => M ? M(p, t) : t.label.toLowerCase().includes(e));
230
+ }, [c, p, M]), Ce = O(
231
+ () => Ye(oe),
232
+ [oe]
233
+ ), Te = (e) => {
131
234
  var o;
132
235
  const t = e.currentTarget;
133
- if (e.key === "Backspace" && b === "" && n.length > 0) {
236
+ if (e.key === "Backspace" && p === "" && r.length > 0) {
134
237
  e.preventDefault();
135
- const d = n.length - 1, l = z(d).length - 1;
238
+ const a = r.length - 1, l = $(a).length - 1;
136
239
  l >= 0 && requestAnimationFrame(() => {
137
- var m;
138
- (m = w.current[l]) == null || m.focus();
240
+ var h;
241
+ (h = I.current[l]) == null || h.focus();
139
242
  });
140
243
  return;
141
244
  }
142
245
  const s = t.selectionStart === 0 && t.selectionEnd === 0;
143
- if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s && n.length > 0) {
144
- const d = document.dir === "rtl" || t.dir === "rtl";
145
- if (d && e.key === "ArrowRight" || !d && e.key === "ArrowLeft") {
246
+ if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s && r.length > 0) {
247
+ const a = document.dir === "rtl" || t.dir === "rtl";
248
+ if (a && e.key === "ArrowRight" || !a && e.key === "ArrowLeft") {
146
249
  e.preventDefault();
147
- const l = n.length - 1;
148
- (o = w.current[l]) == null || o.focus();
250
+ const l = r.length - 1;
251
+ (o = I.current[l]) == null || o.focus();
149
252
  }
150
253
  return;
151
254
  }
152
255
  if (e.key === "Escape") {
153
- p(!1);
256
+ m(!1);
154
257
  return;
155
258
  }
156
- !G && (e.key === "ArrowDown" || e.key === "Enter") && p(!0);
157
- }, Ae = (e) => (t) => {
158
- var a, l, m, A;
259
+ !A && (e.key === "ArrowDown" || e.key === "Enter") && m(!0);
260
+ }, Ee = (e) => (t) => {
261
+ var d, l, h, R;
159
262
  if (t.key === "Backspace" || t.key === "Delete" || t.key === "Enter" || t.key === " ") {
160
263
  t.preventDefault(), t.stopPropagation();
161
- const R = z(e);
162
- if (R.length === 0) {
264
+ const D = $(e);
265
+ if (D.length === 0) {
163
266
  requestAnimationFrame(() => {
164
267
  var C;
165
- return (C = y.current) == null ? void 0 : C.focus();
268
+ return (C = w.current) == null ? void 0 : C.focus();
166
269
  });
167
270
  return;
168
271
  }
169
- const Ve = Math.min(e, R.length - 1);
272
+ const qe = Math.min(e, D.length - 1);
170
273
  requestAnimationFrame(() => {
171
274
  var C;
172
- (C = w.current[Ve]) == null || C.focus();
275
+ (C = I.current[qe]) == null || C.focus();
173
276
  });
174
277
  return;
175
278
  }
176
- const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", d = s ? "ArrowLeft" : "ArrowRight";
279
+ const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", a = s ? "ArrowLeft" : "ArrowRight";
177
280
  if (t.key === o) {
178
281
  t.preventDefault();
179
- const R = Math.max(0, e - 1);
180
- (a = w.current[R]) == null || a.focus();
282
+ const D = Math.max(0, e - 1);
283
+ (d = I.current[D]) == null || d.focus();
181
284
  return;
182
285
  }
183
- if (t.key === d) {
184
- t.preventDefault(), e < n.length - 1 ? (l = w.current[e + 1]) == null || l.focus() : (m = y.current) == null || m.focus();
286
+ if (t.key === a) {
287
+ t.preventDefault(), e < r.length - 1 ? (l = I.current[e + 1]) == null || l.focus() : (h = w.current) == null || h.focus();
185
288
  return;
186
289
  }
187
- t.key === "Escape" && (p(!1), (A = y.current) == null || A.focus());
188
- }, [_, O] = E(
290
+ t.key === "Escape" && (m(!1), (R = w.current) == null || R.focus());
291
+ }, [V, K] = L(
189
292
  Number.POSITIVE_INFINITY
190
293
  );
191
- Le(() => {
192
- const e = H.current;
294
+ $e(() => {
295
+ const e = W.current;
193
296
  if (!e) return;
194
297
  const t = () => {
195
298
  const o = Array.from(
196
299
  e.querySelectorAll('[data-ui-chip="true"]')
197
300
  );
198
301
  if (o.length === 0) {
199
- O(Number.POSITIVE_INFINITY);
302
+ K(Number.POSITIVE_INFINITY);
200
303
  return;
201
304
  }
202
- const d = o[0].offsetTop;
203
- let a = 0;
305
+ const a = o[0].offsetTop;
306
+ let d = 0;
204
307
  for (const l of o)
205
- if (l.offsetTop === d) a++;
308
+ if (l.offsetTop === a) d++;
206
309
  else break;
207
- a === o.length ? O(Number.POSITIVE_INFINITY) : O(Math.max(1, a - 1));
310
+ d === o.length ? K(Number.POSITIVE_INFINITY) : K(Math.max(1, d - 1));
208
311
  };
209
312
  t();
210
313
  const s = new ResizeObserver(t);
211
314
  return s.observe(e), () => s.disconnect();
212
- }, [n.length, S]);
213
- const T = n.map((e) => ({
315
+ }, [r.length, T]);
316
+ const F = r.map((e) => ({
214
317
  value: e,
215
- label: ye.get(e) ?? e
216
- })), ee = _ === Number.POSITIVE_INFINITY || _ >= T.length, Ce = ee ? T : T.slice(0, _), te = ee ? [] : T.slice(_), N = te.length, Se = (e) => {
318
+ label: Se.get(e) ?? e
319
+ })), ie = V === Number.POSITIVE_INFINITY || V >= F.length, Ve = ie ? F : F.slice(0, V), ae = ie ? [] : F.slice(V), _ = ae.length, Fe = (e) => {
217
320
  var s;
218
- if (h) return;
321
+ if (g) return;
219
322
  const t = e.target;
220
- t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (p(!0), (s = y.current) == null || s.focus());
221
- }, _e = (e) => {
222
- if (h) {
223
- p(!1);
323
+ t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (m(!0), (s = w.current) == null || s.focus());
324
+ }, De = (e) => {
325
+ if (g) {
326
+ m(!1);
224
327
  return;
225
328
  }
226
- p(e), e || (Q(""), D == null || D(n));
227
- }, Te = B || K, Re = f("ui.inputs.multiSelect.selected", {
228
- count: n.length,
229
- defaultValue: `${n.length} selected`
230
- }), { onClick: q, ...Ee } = ue;
231
- return /* @__PURE__ */ r(u, { shouldFilter: !1, label: Re, children: /* @__PURE__ */ I(V.Root, { open: G, onOpenChange: _e, children: [
232
- /* @__PURE__ */ r(V.Anchor, { asChild: !0, children: /* @__PURE__ */ I(
329
+ m(e), e || (j(""), q == null || q(r));
330
+ }, Le = H || X, Oe = f("ui.inputs.multiSelect.selected", {
331
+ count: r.length,
332
+ defaultValue: `${r.length} selected`
333
+ }), { onClick: U, ...ze } = ge;
334
+ return /* @__PURE__ */ n(u, { shouldFilter: !1, label: Oe, children: /* @__PURE__ */ x(z.Root, { open: A, onOpenChange: De, children: [
335
+ /* @__PURE__ */ n(z.Anchor, { asChild: !0, children: /* @__PURE__ */ x(
233
336
  "div",
234
337
  {
235
- ref: he,
236
- className: Ke({ size: S, className: ce }),
237
- "aria-disabled": h || void 0,
238
- "aria-invalid": X || void 0,
338
+ ref: we,
339
+ className: Ze({ size: T, className: ve }),
340
+ "aria-disabled": g || void 0,
341
+ "aria-invalid": Z || void 0,
239
342
  "data-component": "multi-select",
240
- "data-component-id": U,
343
+ "data-component-id": P,
241
344
  onClick: (e) => {
242
- q == null || q(e), Se(e);
345
+ U == null || U(e), Fe(e);
243
346
  },
244
- ...Ee,
347
+ ...ze,
245
348
  children: [
246
- Ce.map((e, t) => /* @__PURE__ */ I(
247
- "span",
248
- {
249
- ref: (s) => {
250
- w.current[t] = s;
349
+ Ve.map((e, t) => (
350
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button
351
+ /* @__PURE__ */ x(
352
+ "span",
353
+ {
354
+ ref: (s) => {
355
+ I.current[t] = s;
356
+ },
357
+ tabIndex: g ? -1 : 0,
358
+ "data-ui-chip": "true",
359
+ className: le({ size: T }),
360
+ onKeyDown: Ee(t),
361
+ "aria-label": e.label,
362
+ children: [
363
+ /* @__PURE__ */ n("span", { children: e.label }),
364
+ /* @__PURE__ */ n(
365
+ "button",
366
+ {
367
+ type: "button",
368
+ tabIndex: -1,
369
+ "data-ui-chip-dismiss": "true",
370
+ "aria-label": f("ui.inputs.multiSelect.remove", {
371
+ label: e.label,
372
+ defaultValue: `Remove ${e.label}`
373
+ }),
374
+ disabled: g,
375
+ onClick: (s) => {
376
+ s.stopPropagation(), $(t), requestAnimationFrame(() => {
377
+ var o;
378
+ return (o = w.current) == null ? void 0 : o.focus();
379
+ });
380
+ },
381
+ className: et,
382
+ children: /* @__PURE__ */ n(Xe, { "aria-hidden": "true", className: "ds:size-3.5" })
383
+ }
384
+ )
385
+ ]
251
386
  },
252
- tabIndex: h ? -1 : 0,
253
- "data-ui-chip": "true",
254
- className: re({ size: S }),
255
- onKeyDown: Ae(t),
256
- "aria-label": e.label,
257
- children: [
258
- /* @__PURE__ */ r("span", { children: e.label }),
259
- /* @__PURE__ */ r(
260
- "button",
261
- {
262
- type: "button",
263
- tabIndex: -1,
264
- "data-ui-chip-dismiss": "true",
265
- "aria-label": f("ui.inputs.multiSelect.remove", {
266
- label: e.label,
267
- defaultValue: `Remove ${e.label}`
268
- }),
269
- disabled: h,
270
- onClick: (s) => {
271
- s.stopPropagation(), z(t), requestAnimationFrame(() => {
272
- var o;
273
- return (o = y.current) == null ? void 0 : o.focus();
274
- });
275
- },
276
- className: Ue,
277
- children: /* @__PURE__ */ r($e, { "aria-hidden": "true", className: "ds:size-3.5" })
278
- }
279
- )
280
- ]
281
- },
282
- e.value
387
+ e.value
388
+ )
283
389
  )),
284
- N > 0 ? /* @__PURE__ */ r(
285
- se,
390
+ _ > 0 ? /* @__PURE__ */ n(
391
+ de,
286
392
  {
287
- label: te.map((e) => e.label).join(", "),
393
+ label: ae.map((e) => e.label).join(", "),
288
394
  delayDuration: 200,
289
- children: /* @__PURE__ */ r(
395
+ children: /* @__PURE__ */ n(
290
396
  "span",
291
397
  {
292
- className: re({ size: S }),
398
+ className: le({ size: T }),
293
399
  tabIndex: 0,
294
400
  role: "button",
295
401
  "aria-label": f("ui.inputs.multiSelect.overflow", {
296
- count: N,
297
- defaultValue: `+${N} more`
402
+ count: _,
403
+ defaultValue: `+${_} more`
298
404
  }),
299
- children: /* @__PURE__ */ r("span", { children: f("ui.inputs.multiSelect.overflow", {
300
- count: N,
301
- defaultValue: `+${N} more`
405
+ children: /* @__PURE__ */ n("span", { children: f("ui.inputs.multiSelect.overflow", {
406
+ count: _,
407
+ defaultValue: `+${_} more`
302
408
  }) })
303
409
  }
304
410
  )
305
411
  }
306
412
  ) : null,
307
- /* @__PURE__ */ r(
413
+ /* @__PURE__ */ n(
308
414
  u.Input,
309
415
  {
310
- ref: y,
311
- value: b,
312
- onValueChange: Q,
313
- onKeyDown: Ne,
416
+ ref: w,
417
+ value: p,
418
+ onValueChange: j,
419
+ onKeyDown: Te,
314
420
  onFocus: () => {
315
- h || p(!0);
421
+ g || m(!0);
316
422
  },
317
- placeholder: n.length === 0 ? W : "",
318
- id: be,
319
- "aria-describedby": ve,
320
- "aria-invalid": X || void 0,
321
- "aria-required": ge || void 0,
322
- disabled: h,
423
+ placeholder: r.length === 0 ? ne : "",
424
+ id: ke,
425
+ "aria-describedby": xe,
426
+ "aria-invalid": Z || void 0,
427
+ "aria-required": Ie || void 0,
428
+ disabled: g,
323
429
  className: [
324
430
  "ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none",
325
431
  "ds:placeholder:text-muted-foreground ds:text-start",
@@ -330,88 +436,88 @@ const Ke = oe(
330
436
  ]
331
437
  }
332
438
  ) }),
333
- /* @__PURE__ */ r(V.Portal, { children: /* @__PURE__ */ r(
334
- V.Content,
439
+ /* @__PURE__ */ n(z.Portal, { children: /* @__PURE__ */ n(
440
+ z.Content,
335
441
  {
336
442
  onOpenAutoFocus: (e) => e.preventDefault(),
337
443
  onCloseAutoFocus: (e) => e.preventDefault(),
338
444
  align: "start",
339
445
  sideOffset: 4,
340
- className: Ye,
341
- children: /* @__PURE__ */ I(
446
+ className: tt,
447
+ children: /* @__PURE__ */ x(
342
448
  u.List,
343
449
  {
344
450
  role: "listbox",
345
451
  "aria-multiselectable": "true",
346
- "aria-label": W,
452
+ "aria-label": ne,
347
453
  className: "ds:max-h-[20rem] ds:overflow-y-auto ds:p-1",
348
454
  children: [
349
- Te ? /* @__PURE__ */ I(u.Group, { children: [
350
- B ? /* @__PURE__ */ r(
455
+ Le ? /* @__PURE__ */ x(u.Group, { children: [
456
+ H ? /* @__PURE__ */ n(
351
457
  u.Item,
352
458
  {
353
- value: Qe,
354
- onSelect: Ie,
355
- className: ne,
459
+ value: rt,
460
+ onSelect: Ne,
461
+ className: ce,
356
462
  children: f("ui.inputs.multiSelect.selectAll", "Select all")
357
463
  }
358
464
  ) : null,
359
- K ? /* @__PURE__ */ r(
465
+ X ? /* @__PURE__ */ n(
360
466
  u.Item,
361
467
  {
362
- value: He,
363
- onSelect: xe,
364
- className: ne,
468
+ value: nt,
469
+ onSelect: _e,
470
+ className: ce,
365
471
  children: f("ui.inputs.multiSelect.clearAll", "Clear all")
366
472
  }
367
473
  ) : null
368
474
  ] }) : null,
369
- /* @__PURE__ */ r(u.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: f("ui.inputs.multiSelect.noOptions", "No options found") }),
370
- ke.map(({ group: e, items: t }, s) => {
371
- const o = t.map((d) => {
372
- const a = n.includes(d.value), l = !a && J, m = !!d.disabled || l, A = /* @__PURE__ */ I(
475
+ /* @__PURE__ */ n(u.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: f("ui.inputs.multiSelect.noOptions", "No options found") }),
476
+ Ce.map(({ group: e, items: t }, s) => {
477
+ const o = t.map((a) => {
478
+ const d = r.includes(a.value), l = !d && ee, h = !!a.disabled || l, R = /* @__PURE__ */ x(
373
479
  u.Item,
374
480
  {
375
- value: d.value,
376
- disabled: m,
481
+ value: a.value,
482
+ disabled: h,
377
483
  onSelect: () => {
378
- m || we(d.value);
484
+ h || Ae(a.value);
379
485
  },
380
- "aria-selected": a,
381
- "aria-disabled": m || void 0,
382
- className: Ge,
486
+ "aria-selected": d,
487
+ "aria-disabled": h || void 0,
488
+ className: st,
383
489
  children: [
384
- /* @__PURE__ */ r(
490
+ /* @__PURE__ */ n(
385
491
  "span",
386
492
  {
387
493
  className: [
388
494
  "ds:inline-flex ds:items-center ds:justify-center ds:me-2 ds:shrink-0",
389
495
  "ds:size-4 ds:rounded-[var(--radius-sm)] ds:border ds:border-border",
390
- a ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background"
496
+ d ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background"
391
497
  ].join(" "),
392
498
  "aria-hidden": "true",
393
- children: a ? /* @__PURE__ */ r(Be, { className: "ds:size-3.5" }) : null
499
+ children: d ? /* @__PURE__ */ n(Je, { className: "ds:size-3.5" }) : null
394
500
  }
395
501
  ),
396
- /* @__PURE__ */ r("span", { className: "ds:flex-1 ds:text-start", children: d.label })
502
+ /* @__PURE__ */ n("span", { className: "ds:flex-1 ds:text-start", children: a.label })
397
503
  ]
398
504
  },
399
- d.value
505
+ a.value
400
506
  );
401
- return l ? /* @__PURE__ */ r(
402
- se,
507
+ return l ? /* @__PURE__ */ n(
508
+ de,
403
509
  {
404
510
  label: f("ui.inputs.multiSelect.maxReached", {
405
- count: g,
406
- defaultValue: `Maximum ${g} selections`
511
+ count: b,
512
+ defaultValue: `Maximum ${b} selections`
407
513
  }),
408
514
  delayDuration: 200,
409
- children: A
515
+ children: R
410
516
  },
411
- d.value
412
- ) : A;
517
+ a.value
518
+ ) : R;
413
519
  });
414
- return e ? /* @__PURE__ */ r(
520
+ return e ? /* @__PURE__ */ n(
415
521
  u.Group,
416
522
  {
417
523
  heading: e,
@@ -419,7 +525,7 @@ const Ke = oe(
419
525
  children: o
420
526
  },
421
527
  `group-${e}`
422
- ) : /* @__PURE__ */ r(u.Group, { children: o }, `group-${s}`);
528
+ ) : /* @__PURE__ */ n(u.Group, { children: o }, `group-${s}`);
423
529
  })
424
530
  ]
425
531
  }
@@ -429,82 +535,11 @@ const Ke = oe(
429
535
  ] }) });
430
536
  }
431
537
  );
432
- ie.displayName = "MultiSelect";
433
- const at = ie, lt = {
434
- id: "multi-select",
435
- capabilities: ["select_multiple", "filter", "open", "close"],
436
- state: {
437
- selection: {
438
- type: "string[]",
439
- description: "Values of currently-selected options.",
440
- read: (i) => i.getSelection()
441
- },
442
- query: {
443
- type: "string",
444
- description: "Current filter query.",
445
- read: (i) => i.getQuery()
446
- },
447
- isOpen: {
448
- type: "boolean",
449
- description: "True when the option list is visible.",
450
- read: (i) => i.getIsOpen()
451
- }
452
- },
453
- actions: {
454
- set_selection: {
455
- safety: "read",
456
- argsType: "{ values: string[] }",
457
- description: "Replace the current selection with the given list of values.",
458
- invoke: (i, c) => {
459
- i.setSelection(c.values);
460
- }
461
- },
462
- clear_selection: {
463
- safety: "read",
464
- description: "Clear the current selection.",
465
- invoke: (i) => {
466
- i.clearSelection();
467
- }
468
- },
469
- apply_filter: {
470
- safety: "read",
471
- argsType: "{ query: string }",
472
- description: "Set the filter query for the option list.",
473
- invoke: (i, c) => {
474
- i.setQuery(c.query);
475
- }
476
- },
477
- open: {
478
- safety: "read",
479
- description: "Open the option list.",
480
- invoke: (i) => {
481
- i.open();
482
- }
483
- },
484
- close: {
485
- safety: "read",
486
- description: "Close the option list.",
487
- invoke: (i) => {
488
- i.close();
489
- }
490
- }
491
- },
492
- domHooks: {
493
- root: { attr: "data-component", value: "multi-select" },
494
- instanceId: {
495
- attr: "data-component-id",
496
- sourceProp: "id",
497
- description: "Sourced from the id prop."
498
- },
499
- item: {
500
- attr: "data-option-id",
501
- description: "Each option emits its value as data-option-id."
502
- }
503
- }
504
- };
538
+ fe.displayName = "MultiSelect";
539
+ const bt = fe;
505
540
  export {
506
- at as M,
507
- Ke as a,
508
- lt as m
541
+ bt as M,
542
+ Ze as a,
543
+ We as m
509
544
  };
510
- //# sourceMappingURL=multi-select.agent-Do6CeQUT.js.map
545
+ //# sourceMappingURL=multi-select-wqqrgjUQ.js.map