@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
@@ -0,0 +1,829 @@
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as Ne, useId as Ue, useState as ie, useRef as V, useCallback as y, useMemo as q, useEffect as ze } from "react";
3
+ import { u as je } from "./index-CeY1nNvd.js";
4
+ import { c as _ } from "./index-D2ZczOXr.js";
5
+ import { useTranslation as Me } from "react-i18next";
6
+ import { u as Ce } from "./form-field-context-B3APVHKx.js";
7
+ import { u as Le } from "./registry-C9nwlNyL.js";
8
+ import { C as le } from "./circle-alert-ChA9opNA.js";
9
+ import { c as w } from "./createLucideIcon-CrFbzy84.js";
10
+ import { X as re } from "./x-CCcI3eJp.js";
11
+ import { F as Fe } from "./file-text-DSNuv2B8.js";
12
+ import { C as Ae } from "./circle-check-9AeSgJD_.js";
13
+ /**
14
+ * @license lucide-react v1.8.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const Re = [
20
+ ["path", { d: "M12 13v8", key: "1l5pq0" }],
21
+ ["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
22
+ ["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
23
+ ], De = w("cloud-upload", Re);
24
+ /**
25
+ * @license lucide-react v1.8.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */
30
+ const Ie = [
31
+ [
32
+ "path",
33
+ {
34
+ d: "M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",
35
+ key: "4pqfef"
36
+ }
37
+ ],
38
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
39
+ ["path", { d: "M8 12v-1", key: "1ej8lb" }],
40
+ ["path", { d: "M8 18v-2", key: "qcmpov" }],
41
+ ["path", { d: "M8 7V6", key: "1nbb54" }],
42
+ ["circle", { cx: "8", cy: "20", r: "2", key: "ckkr5m" }]
43
+ ], _e = w("file-archive", Ie);
44
+ /**
45
+ * @license lucide-react v1.8.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */
50
+ const Be = [
51
+ [
52
+ "path",
53
+ {
54
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
55
+ key: "1oefj6"
56
+ }
57
+ ],
58
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
59
+ ["circle", { cx: "10", cy: "12", r: "2", key: "737tya" }],
60
+ ["path", { d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22", key: "wt3hpn" }]
61
+ ], He = w("file-image", Be);
62
+ /**
63
+ * @license lucide-react v1.8.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */
68
+ const Oe = [
69
+ [
70
+ "path",
71
+ {
72
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
73
+ key: "1oefj6"
74
+ }
75
+ ],
76
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
77
+ ["path", { d: "M8 13h2", key: "yr2amv" }],
78
+ ["path", { d: "M14 13h2", key: "un5t4a" }],
79
+ ["path", { d: "M8 17h2", key: "2yhykz" }],
80
+ ["path", { d: "M14 17h2", key: "10kma7" }]
81
+ ], $e = w("file-spreadsheet", Oe);
82
+ /**
83
+ * @license lucide-react v1.8.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */
88
+ const Ee = [
89
+ [
90
+ "path",
91
+ {
92
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
93
+ key: "1oefj6"
94
+ }
95
+ ],
96
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
97
+ ], Ve = w("file", Ee);
98
+ /**
99
+ * @license lucide-react v1.8.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */
104
+ const qe = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Te = w("loader-circle", qe);
105
+ /**
106
+ * @license lucide-react v1.8.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */
111
+ const We = [
112
+ ["path", { d: "M12 3v12", key: "1x0j5s" }],
113
+ ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
114
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
115
+ ], T = w("upload", We), Pe = {
116
+ id: "file-upload",
117
+ capabilities: ["submit", "dismiss"],
118
+ state: {
119
+ files: {
120
+ type: "Array<{ id, name, size, status }>",
121
+ description: "Files currently tracked by the uploader. Identifiers and metadata only — never file content.",
122
+ read: (d) => d.getFiles()
123
+ }
124
+ },
125
+ actions: {
126
+ remove_file: {
127
+ safety: "destructive",
128
+ argsType: "{ id: string }",
129
+ description: "Remove the file with the given id from the upload list.",
130
+ invoke: (d, n) => {
131
+ d.removeFile(n.id);
132
+ }
133
+ },
134
+ clear: {
135
+ safety: "destructive",
136
+ description: "Remove all files from the upload list.",
137
+ invoke: (d) => {
138
+ d.clear();
139
+ }
140
+ }
141
+ },
142
+ domHooks: {
143
+ root: { attr: "data-component", value: "file-upload" },
144
+ instanceId: {
145
+ attr: "data-component-id",
146
+ sourceProp: "id",
147
+ description: "Sourced from the id prop."
148
+ },
149
+ item: {
150
+ attr: "data-file-id",
151
+ description: "Each tracked file emits its id as data-file-id."
152
+ }
153
+ }
154
+ }, Ke = _(
155
+ [
156
+ "ds:relative ds:flex ds:flex-col ds:items-center ds:justify-center",
157
+ "ds:min-h-48 ds:px-[var(--spacing-lg)] ds:py-[var(--spacing-xl)]",
158
+ "ds:rounded-[var(--radius-lg)] ds:border-2 ds:border-dashed",
159
+ "ds:bg-background",
160
+ "ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
161
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
162
+ "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
163
+ "ds:cursor-pointer",
164
+ "ds:group"
165
+ ].join(" "),
166
+ {
167
+ variants: {
168
+ isDragActive: {
169
+ true: "ds:border-primary ds:bg-primary/10 ds:scale-[1.01]",
170
+ false: "ds:border-border ds:hover:border-muted-foreground/40 ds:hover:bg-muted/5"
171
+ },
172
+ hasError: {
173
+ true: "ds:border-destructive ds:bg-destructive/5 ds:hover:border-destructive",
174
+ false: ""
175
+ },
176
+ isDisabled: {
177
+ true: "ds:cursor-not-allowed ds:opacity-50 ds:hover:border-border ds:hover:bg-background",
178
+ false: ""
179
+ }
180
+ },
181
+ defaultVariants: {
182
+ isDragActive: !1,
183
+ hasError: !1,
184
+ isDisabled: !1
185
+ }
186
+ }
187
+ ), ae = _(
188
+ [
189
+ "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
190
+ "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
191
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-primary/30 ds:bg-primary/5",
192
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-sm)]",
193
+ "ds:text-primary ds:text-[length:var(--font-size-sm)] ds:font-medium",
194
+ "ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
195
+ "ds:hover:bg-primary/10 ds:hover:border-primary/50",
196
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
197
+ "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
198
+ "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
199
+ ].join(" ")
200
+ ), Ge = _(
201
+ [
202
+ "ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
203
+ "ds:rounded-[var(--radius-md)] ds:border ds:bg-background",
204
+ "ds:p-[var(--spacing-md)]",
205
+ "ds:text-[length:var(--font-size-sm)] ds:text-foreground",
206
+ "ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
207
+ ].join(" "),
208
+ {
209
+ variants: {
210
+ status: {
211
+ pending: "ds:border-border",
212
+ uploading: "ds:border-primary/30 ds:bg-primary/[0.02]",
213
+ complete: "ds:border-[var(--success)]/30 ds:bg-[var(--success)]/[0.02]",
214
+ error: "ds:border-destructive/30 ds:bg-destructive/[0.02]"
215
+ }
216
+ },
217
+ defaultVariants: {
218
+ status: "pending"
219
+ }
220
+ }
221
+ ), oe = _(
222
+ [
223
+ "ds:inline-flex ds:items-center ds:justify-center",
224
+ "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
225
+ "ds:rounded-[var(--radius-sm)]",
226
+ "ds:text-muted-foreground",
227
+ "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
228
+ "ds:hover:text-foreground ds:hover:bg-muted/40",
229
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
230
+ "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
231
+ ].join(" ")
232
+ );
233
+ function Xe() {
234
+ return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
235
+ }
236
+ function Ye(d) {
237
+ return d.type.startsWith("image/");
238
+ }
239
+ function Je(d) {
240
+ var c;
241
+ const n = ((c = d.name.split(".").pop()) == null ? void 0 : c.toLowerCase()) ?? "";
242
+ return ["pdf", "doc", "docx", "txt", "rtf"].includes(n) ? /* @__PURE__ */ i(
243
+ Fe,
244
+ {
245
+ "aria-hidden": "true",
246
+ className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
247
+ }
248
+ ) : ["zip", "rar", "7z", "tar", "gz"].includes(n) ? /* @__PURE__ */ i(
249
+ _e,
250
+ {
251
+ "aria-hidden": "true",
252
+ className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
253
+ }
254
+ ) : ["xls", "xlsx", "csv"].includes(n) ? /* @__PURE__ */ i(
255
+ $e,
256
+ {
257
+ "aria-hidden": "true",
258
+ className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
259
+ }
260
+ ) : ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(n) ? /* @__PURE__ */ i(
261
+ He,
262
+ {
263
+ "aria-hidden": "true",
264
+ className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
265
+ }
266
+ ) : /* @__PURE__ */ i(
267
+ Ve,
268
+ {
269
+ "aria-hidden": "true",
270
+ className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
271
+ }
272
+ );
273
+ }
274
+ function Qe(d) {
275
+ switch (d) {
276
+ case "uploading":
277
+ return /* @__PURE__ */ i(
278
+ Te,
279
+ {
280
+ "aria-hidden": "true",
281
+ className: "ds:size-4 ds:shrink-0 ds:text-primary ds:animate-spin"
282
+ }
283
+ );
284
+ case "complete":
285
+ return /* @__PURE__ */ i(
286
+ Ae,
287
+ {
288
+ "aria-hidden": "true",
289
+ className: "ds:size-4 ds:shrink-0 ds:text-[var(--success)]"
290
+ }
291
+ );
292
+ case "error":
293
+ return /* @__PURE__ */ i(
294
+ le,
295
+ {
296
+ "aria-hidden": "true",
297
+ className: "ds:size-4 ds:shrink-0 ds:text-destructive"
298
+ }
299
+ );
300
+ default:
301
+ return null;
302
+ }
303
+ }
304
+ const Ze = [
305
+ "ui.inputs.fileUpload.units.bytes",
306
+ "ui.inputs.fileUpload.units.kilobytes",
307
+ "ui.inputs.fileUpload.units.megabytes",
308
+ "ui.inputs.fileUpload.units.gigabytes"
309
+ ], ne = ["B", "KB", "MB", "GB"];
310
+ function I(d, n, c) {
311
+ let u = d, p = 0;
312
+ for (; u >= 1024 && p < ne.length - 1; )
313
+ u /= 1024, p++;
314
+ const h = new Intl.NumberFormat(n, {
315
+ maximumFractionDigits: p === 0 ? 0 : 1
316
+ }).format(u), B = c(Ze[p], ne[p]);
317
+ return `${h} ${B}`;
318
+ }
319
+ function Se(d) {
320
+ switch (d) {
321
+ case "file-too-large":
322
+ return "file-too-large";
323
+ case "file-too-small":
324
+ return "file-too-small";
325
+ case "file-invalid-type":
326
+ return "file-invalid-type";
327
+ case "too-many-files":
328
+ return "too-many-files";
329
+ default:
330
+ return "file-invalid-type";
331
+ }
332
+ }
333
+ function de(d) {
334
+ const n = d.split(".");
335
+ return n.length > 1 ? `.${n.pop().toLowerCase()}` : "";
336
+ }
337
+ function es(d) {
338
+ const n = [];
339
+ for (const u of Object.values(d))
340
+ for (const p of u)
341
+ n.push(p.toUpperCase().replace(".", ""));
342
+ if (n.length > 0) return n.join(", ");
343
+ const c = [];
344
+ for (const u of Object.keys(d))
345
+ u.endsWith("/*") ? c.push(u.replace("/*", "").split("/").pop() ?? u) : c.push(u.split("/").pop() ?? u);
346
+ return c.join(", ");
347
+ }
348
+ const ss = Ne(
349
+ ({
350
+ id: d,
351
+ accept: n,
352
+ maxSize: c,
353
+ minSize: u,
354
+ maxFiles: p = 1,
355
+ multiple: h = !1,
356
+ disabled: B,
357
+ strictAccept: W = !1,
358
+ onDrop: L,
359
+ onUpload: H,
360
+ onRemove: F,
361
+ onReject: A,
362
+ variant: g = "both",
363
+ showPreview: ce = !0,
364
+ className: P
365
+ }, j) => {
366
+ const { t: o, i18n: N } = Me(), v = Ce(), ue = Ue(), x = v.disabled || B, pe = v.invalid, K = v.id || ue, [R, b] = ie([]), [G, fe] = ie([]), D = V(/* @__PURE__ */ new Map()), O = V(null), M = V(R);
367
+ M.current = R;
368
+ const U = y((e) => {
369
+ O.current && (O.current.textContent = e);
370
+ }, []), X = y(
371
+ (e) => {
372
+ if (!W || !n) return !0;
373
+ for (const [s, a] of Object.entries(n)) {
374
+ const t = s === "*/*" || s.endsWith("/*") && e.type.startsWith(s.replace("/*", "/")) || e.type === s, r = de(e.name), f = a.length === 0 || a.some((z) => z.toLowerCase() === r);
375
+ if (t && f) return !0;
376
+ }
377
+ return !1;
378
+ },
379
+ [W, n]
380
+ ), Y = y(
381
+ async (e) => {
382
+ if (!H) return;
383
+ const s = new AbortController();
384
+ D.current.set(e.id, s), b(
385
+ (a) => a.map(
386
+ (t) => t.id === e.id ? { ...t, status: "uploading", progress: 0 } : t
387
+ )
388
+ ), U(o("ui.inputs.fileUpload.uploading", "Uploading…"));
389
+ try {
390
+ await H(e.file, {
391
+ signal: s.signal,
392
+ onProgress: (a) => {
393
+ b(
394
+ (t) => t.map(
395
+ (r) => r.id === e.id ? { ...r, progress: a } : r
396
+ )
397
+ ), U(
398
+ o("ui.inputs.fileUpload.progress", "{{percent}}% uploaded", {
399
+ percent: a
400
+ })
401
+ );
402
+ }
403
+ }), b(
404
+ (a) => a.map(
405
+ (t) => t.id === e.id ? { ...t, status: "complete", progress: 100 } : t
406
+ )
407
+ ), U(o("ui.inputs.fileUpload.complete", "Upload complete"));
408
+ } catch (a) {
409
+ if (s.signal.aborted) {
410
+ b((r) => r.filter((f) => f.id !== e.id));
411
+ return;
412
+ }
413
+ const t = a instanceof Error ? a.message : o("ui.inputs.fileUpload.errors.uploadFailed", "Upload failed");
414
+ b(
415
+ (r) => r.map(
416
+ (f) => f.id === e.id ? { ...f, status: "error", error: t } : f
417
+ )
418
+ );
419
+ } finally {
420
+ D.current.delete(e.id);
421
+ }
422
+ },
423
+ [H, U, o]
424
+ ), $ = y(
425
+ (e, s) => {
426
+ const a = s.flatMap(
427
+ (l) => l.errors.map((k) => ({
428
+ file: l.file,
429
+ reason: Se(k.code)
430
+ }))
431
+ ), t = [], r = [];
432
+ for (const l of e)
433
+ X(l) ? r.push(l) : t.push({ file: l, reason: "file-invalid-type" });
434
+ const f = [...a, ...t];
435
+ fe(f), f.length > 0 && (A == null || A(f));
436
+ const z = r.map((l) => ({
437
+ file: l,
438
+ id: Xe(),
439
+ status: "pending",
440
+ progress: 0,
441
+ preview: Ye(l) ? URL.createObjectURL(l) : void 0
442
+ }));
443
+ b((l) => {
444
+ if (!h && p === 1) {
445
+ for (const k of l)
446
+ k.preview && URL.revokeObjectURL(k.preview);
447
+ return z;
448
+ }
449
+ return [...l, ...z];
450
+ }), L == null || L(r, f), U(
451
+ o(
452
+ "ui.inputs.fileUpload.filesSelected",
453
+ "{{count}} file(s) selected",
454
+ {
455
+ count: r.length
456
+ }
457
+ )
458
+ );
459
+ for (const l of z)
460
+ Y(l);
461
+ },
462
+ [
463
+ h,
464
+ p,
465
+ L,
466
+ A,
467
+ X,
468
+ U,
469
+ Y,
470
+ o
471
+ ]
472
+ ), { getRootProps: me, getInputProps: J, isDragActive: C, open: Q } = je({
473
+ accept: n,
474
+ maxSize: c,
475
+ minSize: u,
476
+ maxFiles: h ? p : 1,
477
+ multiple: h,
478
+ disabled: x,
479
+ onDrop: $,
480
+ noClick: g === "button",
481
+ noKeyboard: g === "button"
482
+ }), he = y((e) => {
483
+ const s = D.current.get(e);
484
+ s == null || s.abort(), b((a) => {
485
+ const t = a.find((r) => r.id === e);
486
+ return t != null && t.preview && URL.revokeObjectURL(t.preview), a.filter((r) => r.id !== e);
487
+ });
488
+ }, []), E = y(
489
+ (e) => {
490
+ const s = M.current.find((a) => a.id === e);
491
+ s != null && s.preview && URL.revokeObjectURL(s.preview), b((a) => a.filter((t) => t.id !== e)), s && (F == null || F(s));
492
+ },
493
+ [F]
494
+ ), Z = y(() => {
495
+ for (const e of M.current) {
496
+ const s = D.current.get(e.id);
497
+ s == null || s.abort(), e.preview && URL.revokeObjectURL(e.preview);
498
+ }
499
+ b([]);
500
+ }, []), ge = q(
501
+ () => ({
502
+ getFiles: () => M.current.map((e) => ({
503
+ id: e.id,
504
+ name: e.file.name,
505
+ size: e.file.size,
506
+ status: e.status
507
+ })),
508
+ removeFile: (e) => E(e),
509
+ clear: () => Z()
510
+ }),
511
+ [E, Z]
512
+ );
513
+ Le(Pe, ge, d);
514
+ const S = y(
515
+ (e) => {
516
+ const s = [], a = [], t = h ? p : 1;
517
+ for (const r of e) {
518
+ if (s.length >= t) {
519
+ a.push({ file: r, reason: "too-many-files" });
520
+ continue;
521
+ }
522
+ if (c !== void 0 && r.size > c) {
523
+ a.push({ file: r, reason: "file-too-large" });
524
+ continue;
525
+ }
526
+ if (u !== void 0 && r.size < u) {
527
+ a.push({ file: r, reason: "file-too-small" });
528
+ continue;
529
+ }
530
+ if (n) {
531
+ const f = de(r.name);
532
+ if (!Object.entries(n).some(
533
+ ([l, k]) => {
534
+ const xe = l === "*/*" || l.endsWith("/*") && r.type.startsWith(l.replace("/*", "/")) || r.type === l, ke = k.length > 0 && k.some((we) => we.toLowerCase() === f);
535
+ return xe || ke;
536
+ }
537
+ )) {
538
+ a.push({ file: r, reason: "file-invalid-type" });
539
+ continue;
540
+ }
541
+ }
542
+ s.push(r);
543
+ }
544
+ return { accepted: s, rejected: a };
545
+ },
546
+ [n, c, u, p, h]
547
+ ), ee = y(
548
+ (e) => {
549
+ if (x) return;
550
+ const s = Array.from(e.clipboardData.files);
551
+ if (s.length > 0) {
552
+ e.preventDefault();
553
+ const { accepted: a, rejected: t } = S(s), r = t.map((f) => ({
554
+ file: f.file,
555
+ errors: [{ code: f.reason, message: f.reason }]
556
+ }));
557
+ $(a, r);
558
+ }
559
+ },
560
+ [x, $, S]
561
+ );
562
+ ze(() => () => {
563
+ for (const e of M.current)
564
+ e.preview && URL.revokeObjectURL(e.preview);
565
+ }, []);
566
+ const se = q(() => {
567
+ const e = [];
568
+ return n && e.push(es(n)), c && e.push(
569
+ o("ui.inputs.fileUpload.maxSizeHint", "Max {{size}}", {
570
+ size: I(c, N.language, o)
571
+ })
572
+ ), h && p > 1 && e.push(
573
+ o("ui.inputs.fileUpload.maxFilesHint", "Up to {{count}} files", {
574
+ count: p
575
+ })
576
+ ), e;
577
+ }, [n, c, h, p, o, N.language]), te = q(() => G.map((e) => {
578
+ switch (e.reason) {
579
+ case "file-too-large":
580
+ return o(
581
+ "ui.inputs.fileUpload.errors.fileTooLarge",
582
+ "File exceeds {{maxSize}}",
583
+ {
584
+ maxSize: c ? I(c, N.language, o) : ""
585
+ }
586
+ );
587
+ case "file-too-small":
588
+ return o(
589
+ "ui.inputs.fileUpload.errors.fileTooSmall",
590
+ "File is smaller than {{minSize}}",
591
+ {
592
+ minSize: u ? I(u, N.language, o) : ""
593
+ }
594
+ );
595
+ case "file-invalid-type":
596
+ return o(
597
+ "ui.inputs.fileUpload.errors.fileInvalidType",
598
+ "File type not accepted"
599
+ );
600
+ case "too-many-files":
601
+ return o(
602
+ "ui.inputs.fileUpload.errors.tooManyFiles",
603
+ "Maximum {{maxFiles}} files allowed",
604
+ {
605
+ maxFiles: p
606
+ }
607
+ );
608
+ }
609
+ }), [G, o, c, u, p, N.language]), ve = () => R.length === 0 ? null : /* @__PURE__ */ i("ul", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:list-none ds:p-0 ds:m-0", children: R.map((e) => /* @__PURE__ */ m(
610
+ "li",
611
+ {
612
+ "data-file-id": e.id,
613
+ className: Ge({ status: e.status }),
614
+ children: [
615
+ ce && e.preview ? /* @__PURE__ */ i(
616
+ "img",
617
+ {
618
+ src: e.preview,
619
+ alt: "",
620
+ "aria-hidden": "true",
621
+ className: "ds:size-12 ds:shrink-0 ds:rounded-[var(--radius-md)] ds:object-cover ds:border ds:border-border"
622
+ }
623
+ ) : Je(e.file),
624
+ /* @__PURE__ */ m("div", { className: "ds:flex-1 ds:min-w-0", children: [
625
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
626
+ /* @__PURE__ */ i("p", { className: "ds:truncate type-label ds:m-0", children: e.file.name }),
627
+ Qe(e.status)
628
+ ] }),
629
+ /* @__PURE__ */ m("p", { className: "type-meta ds:text-muted-foreground ds:m-0 ds:mt-0.5", children: [
630
+ I(e.file.size, N.language, o),
631
+ e.status === "uploading" && /* @__PURE__ */ m("span", { className: "ds:ms-[var(--spacing-sm)] ds:text-primary ds:font-medium", children: [
632
+ e.progress,
633
+ "%"
634
+ ] }),
635
+ e.status === "complete" && /* @__PURE__ */ i("span", { className: "ds:ms-[var(--spacing-sm)] ds:text-[var(--success)] ds:font-medium", children: o("ui.inputs.fileUpload.complete", "Complete") })
636
+ ] }),
637
+ e.status === "uploading" && /* @__PURE__ */ i(
638
+ "div",
639
+ {
640
+ role: "progressbar",
641
+ "aria-label": e.file.name,
642
+ "aria-valuenow": e.progress,
643
+ "aria-valuemin": 0,
644
+ "aria-valuemax": 100,
645
+ className: "ds:mt-[var(--spacing-sm)] ds:h-1.5 ds:w-full ds:rounded-[var(--radius-full)] ds:bg-muted ds:overflow-hidden",
646
+ children: /* @__PURE__ */ i(
647
+ "div",
648
+ {
649
+ className: "ds:h-full ds:rounded-[var(--radius-full)] ds:bg-primary ds:transition-[inline-size] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
650
+ style: { inlineSize: `${e.progress}%` }
651
+ }
652
+ )
653
+ }
654
+ ),
655
+ e.status === "error" && e.error && /* @__PURE__ */ i(
656
+ "p",
657
+ {
658
+ role: "alert",
659
+ className: "type-meta ds:text-destructive ds:m-0 ds:mt-[var(--spacing-xs)]",
660
+ children: e.error
661
+ }
662
+ )
663
+ ] }),
664
+ e.status === "uploading" && /* @__PURE__ */ i(
665
+ "button",
666
+ {
667
+ type: "button",
668
+ onClick: () => he(e.id),
669
+ "aria-label": o("ui.inputs.fileUpload.cancel", "Cancel upload"),
670
+ className: oe(),
671
+ children: /* @__PURE__ */ i(re, { "aria-hidden": "true", className: "ds:size-4" })
672
+ }
673
+ ),
674
+ (e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */ i(
675
+ "button",
676
+ {
677
+ type: "button",
678
+ onClick: () => E(e.id),
679
+ "aria-label": o("ui.inputs.fileUpload.remove", "Remove file"),
680
+ className: oe(),
681
+ children: /* @__PURE__ */ i(re, { "aria-hidden": "true", className: "ds:size-4" })
682
+ }
683
+ )
684
+ ]
685
+ },
686
+ e.id
687
+ )) }), be = () => {
688
+ if (g === "button") return null;
689
+ const e = me({
690
+ className: Ke({
691
+ isDragActive: C,
692
+ hasError: pe ?? !1,
693
+ isDisabled: x ?? !1,
694
+ className: P
695
+ }),
696
+ tabIndex: x ? -1 : 0
697
+ }), s = e.ref;
698
+ return /* @__PURE__ */ m(
699
+ "div",
700
+ {
701
+ ...e,
702
+ ref: (t) => {
703
+ typeof s == "function" ? s(t) : s && (s.current = t), typeof j == "function" ? j(t) : j && (j.current = t);
704
+ },
705
+ onPaste: ee,
706
+ id: K,
707
+ "aria-label": o(
708
+ "ui.inputs.fileUpload.dropHere",
709
+ "Drop files here or click to browse"
710
+ ),
711
+ "aria-describedby": v.describedBy || void 0,
712
+ "aria-invalid": v.invalid || void 0,
713
+ "aria-required": v.required || void 0,
714
+ "data-testid": "file-upload-dropzone",
715
+ children: [
716
+ /* @__PURE__ */ i(
717
+ "input",
718
+ {
719
+ ...J({
720
+ "aria-label": o(
721
+ "ui.inputs.fileUpload.dropHere",
722
+ "Drop files here or click to browse"
723
+ )
724
+ })
725
+ }
726
+ ),
727
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
728
+ /* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:justify-center ds:size-14 ds:rounded-[var(--radius-full)] ds:bg-primary/10 ds:text-primary ds:transition-colors ds:duration-[var(--animation-duration)] ds:group-hover:bg-primary/15 ds:motion-reduce:transition-none", children: C ? /* @__PURE__ */ i(De, { "aria-hidden": "true", className: "ds:size-7" }) : /* @__PURE__ */ i(T, { "aria-hidden": "true", className: "ds:size-7" }) }),
729
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)]", children: [
730
+ /* @__PURE__ */ i("p", { className: "type-label ds:text-foreground ds:text-center ds:m-0", children: C ? o("ui.inputs.fileUpload.dropActive", "Drop files here") : o(
731
+ "ui.inputs.fileUpload.dropHere",
732
+ "Drop files here or click to browse"
733
+ ) }),
734
+ se.length > 0 && !C && /* @__PURE__ */ i("p", { className: "type-meta ds:text-muted-foreground ds:text-center ds:m-0", children: se.join(" · ") })
735
+ ] }),
736
+ g === "both" && !C && /* @__PURE__ */ m(
737
+ "button",
738
+ {
739
+ type: "button",
740
+ onClick: (t) => {
741
+ t.stopPropagation(), Q();
742
+ },
743
+ disabled: x,
744
+ className: ae({
745
+ className: "ds:mt-[var(--spacing-xs)]"
746
+ }),
747
+ children: [
748
+ /* @__PURE__ */ i(T, { "aria-hidden": "true", className: "ds:size-4" }),
749
+ o("ui.inputs.fileUpload.browse", "Browse files")
750
+ ]
751
+ }
752
+ )
753
+ ] })
754
+ ]
755
+ }
756
+ );
757
+ }, ye = () => g === "dropzone" ? null : g === "button" ? /* @__PURE__ */ m("div", { onPaste: ee, ref: j, children: [
758
+ /* @__PURE__ */ i(
759
+ "input",
760
+ {
761
+ ...J({
762
+ "aria-label": o("ui.inputs.fileUpload.browse", "Browse files")
763
+ })
764
+ }
765
+ ),
766
+ /* @__PURE__ */ m(
767
+ "button",
768
+ {
769
+ type: "button",
770
+ onClick: Q,
771
+ disabled: x,
772
+ className: ae({ className: P }),
773
+ id: g === "button" ? K : void 0,
774
+ "aria-describedby": g === "button" && v.describedBy || void 0,
775
+ "aria-invalid": g === "button" && v.invalid || void 0,
776
+ "aria-required": g === "button" && v.required || void 0,
777
+ children: [
778
+ /* @__PURE__ */ i(T, { "aria-hidden": "true", className: "ds:size-4" }),
779
+ o("ui.inputs.fileUpload.browse", "Browse files")
780
+ ]
781
+ }
782
+ )
783
+ ] }) : null;
784
+ return /* @__PURE__ */ m("div", { "data-component": "file-upload", "data-component-id": d, children: [
785
+ be(),
786
+ ye(),
787
+ ve(),
788
+ te.length > 0 && /* @__PURE__ */ i(
789
+ "div",
790
+ {
791
+ role: "alert",
792
+ className: "ds:mt-[var(--spacing-sm)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
793
+ children: te.map((e, s) => /* @__PURE__ */ m(
794
+ "div",
795
+ {
796
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
797
+ children: [
798
+ /* @__PURE__ */ i(
799
+ le,
800
+ {
801
+ "aria-hidden": "true",
802
+ className: "ds:size-3.5 ds:shrink-0 ds:text-destructive"
803
+ }
804
+ ),
805
+ /* @__PURE__ */ i("p", { className: "type-meta ds:text-destructive ds:m-0", children: e })
806
+ ]
807
+ },
808
+ s
809
+ ))
810
+ }
811
+ ),
812
+ /* @__PURE__ */ i(
813
+ "span",
814
+ {
815
+ ref: O,
816
+ role: "status",
817
+ "aria-live": "polite",
818
+ className: "ds:sr-only"
819
+ }
820
+ )
821
+ ] });
822
+ }
823
+ );
824
+ ss.displayName = "FileUpload";
825
+ export {
826
+ ss as F,
827
+ Pe as f
828
+ };
829
+ //# sourceMappingURL=file-upload-C947ACDK.js.map