themelia-react-ui 2.0.1 → 2.0.3

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 (490) hide show
  1. package/CHANGELOG.md +317 -131
  2. package/README.md +25 -9
  3. package/THIRD_PARTY_NOTICES.md +7 -0
  4. package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
  5. package/dist/accordion-Cjb6sx0G.js.map +1 -0
  6. package/dist/action-menu-CllU52Mm.js +280 -0
  7. package/dist/action-menu-CllU52Mm.js.map +1 -0
  8. package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
  9. package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
  10. package/dist/ai-artifact-DvTwDVyL.js +1148 -0
  11. package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
  12. package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
  13. package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
  14. package/dist/attachment-BxDfL2mw.js +246 -0
  15. package/dist/attachment-BxDfL2mw.js.map +1 -0
  16. package/dist/{auth-CYxKfo69.js → auth-BGua8ouh.js} +58 -54
  17. package/dist/auth-BGua8ouh.js.map +1 -0
  18. package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
  19. package/dist/avatar-DAPlDvhJ.js.map +1 -0
  20. package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
  21. package/dist/badge-HpFqoqSY.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +40 -36
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +92 -92
  33. package/dist/base/cascader.js.map +1 -1
  34. package/dist/base/chart.js +1 -1
  35. package/dist/base/choice-inputs.js +2 -2
  36. package/dist/base/code-block.js +1 -1
  37. package/dist/base/combobox.js +2 -2
  38. package/dist/base/command.js +1 -1
  39. package/dist/base/copyable.js +1 -1
  40. package/dist/base/date-pickers.js +2 -2
  41. package/dist/base/display.js +6 -6
  42. package/dist/base/feedback.js +3 -3
  43. package/dist/base/forms-numeric.js +1 -1
  44. package/dist/base/forms.js +2 -2
  45. package/dist/base/inline-edit.js +14 -14
  46. package/dist/base/inline-edit.js.map +1 -1
  47. package/dist/base/item.js +1 -1
  48. package/dist/base/media-gallery.js +1 -1
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +6 -6
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +1 -1
  54. package/dist/base/repeaters.js +171 -176
  55. package/dist/base/repeaters.js.map +1 -1
  56. package/dist/base/sheet.js +1 -1
  57. package/dist/base/sidebar.js +1 -1
  58. package/dist/base/signature-pad.js +6 -6
  59. package/dist/base/skeleton.js +1 -1
  60. package/dist/base/spinner.js +79 -2
  61. package/dist/base/spinner.js.map +1 -0
  62. package/dist/base/structure.js +1 -1
  63. package/dist/base/table.js +1 -1
  64. package/dist/base/text-inputs.js +2 -2
  65. package/dist/base/toaster.js +46 -45
  66. package/dist/base/toaster.js.map +1 -1
  67. package/dist/base/tree.js +1 -1
  68. package/dist/base/upload-queue.js +1 -1
  69. package/dist/base/upload.js +3 -3
  70. package/dist/base/value-inputs.js +1 -1
  71. package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
  72. package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
  73. package/dist/blocks/admin.js +42 -42
  74. package/dist/blocks/admin.js.map +1 -1
  75. package/dist/blocks/ai.js +260 -240
  76. package/dist/blocks/ai.js.map +1 -1
  77. package/dist/blocks/analytics/usage-card.js +1 -1
  78. package/dist/blocks/analytics.js +620 -585
  79. package/dist/blocks/analytics.js.map +1 -1
  80. package/dist/blocks/collaboration.js +1 -1
  81. package/dist/blocks/commerce/receipt.js +1 -1
  82. package/dist/blocks/commerce.js +1152 -1109
  83. package/dist/blocks/commerce.js.map +1 -1
  84. package/dist/blocks/data-display.js +2 -2
  85. package/dist/blocks/onboarding.js +48 -39
  86. package/dist/blocks/onboarding.js.map +1 -1
  87. package/dist/blocks/planning.js +13 -12
  88. package/dist/blocks/planning.js.map +1 -1
  89. package/dist/blocks/timelines.js +1 -1
  90. package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
  91. package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
  92. package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
  93. package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
  94. package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
  95. package/dist/buttons-DPZekJFu.js.map +1 -0
  96. package/dist/cards-BaBZR-AU.js +68 -0
  97. package/dist/cards-BaBZR-AU.js.map +1 -0
  98. package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
  99. package/dist/chart-ZOYyK2xG.js.map +1 -0
  100. package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
  101. package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
  102. package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
  103. package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
  104. package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
  105. package/dist/code-block-DeneBJR_.js.map +1 -0
  106. package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
  107. package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
  108. package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
  109. package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
  110. package/dist/combobox-DaHESuiL.js +355 -0
  111. package/dist/combobox-DaHESuiL.js.map +1 -0
  112. package/dist/{combobox-DLl0bfiq.js → combobox-Dxo2fAYQ.js} +289 -279
  113. package/dist/combobox-Dxo2fAYQ.js.map +1 -0
  114. package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
  115. package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
  116. package/dist/{comments-BpDuCUUu.js → comments-DD0DUPwJ.js} +114 -105
  117. package/dist/comments-DD0DUPwJ.js.map +1 -0
  118. package/dist/components/base/badge/badge.recipes.d.ts +1 -1
  119. package/dist/components/base/buttons/loader-button.d.ts +2 -1
  120. package/dist/components/base/cards/card.recipes.d.ts +2 -3
  121. package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
  122. package/dist/components/base/cards/smart-card.types.d.ts +11 -4
  123. package/dist/components/base/chart/chart.d.ts +2 -5
  124. package/dist/components/base/combobox/combobox-field.d.ts +16 -0
  125. package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
  126. package/dist/components/base/combobox/index.d.ts +30 -4
  127. package/dist/components/base/forms/form-sizing.d.ts +11 -3
  128. package/dist/components/base/navigation/pagination.d.ts +5 -2
  129. package/dist/components/base/popover/popover.recipes.d.ts +15 -1
  130. package/dist/components/base/table/index.d.ts +9 -2
  131. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  132. package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
  133. package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
  134. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
  135. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
  136. package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
  137. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
  138. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
  139. package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
  140. package/dist/components/features/appointment-calendar/index.d.ts +3 -0
  141. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
  142. package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
  143. package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
  144. package/dist/components/features/combobox/types.d.ts +4 -0
  145. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  146. package/dist/components/features/rich-text-editor/index.d.ts +1 -1
  147. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
  148. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
  149. package/dist/components/features/table/table-header.d.ts +1 -1
  150. package/dist/components/features/table/table.strings.d.ts +55 -1
  151. package/dist/components/features/table/table.types.d.ts +17 -4
  152. package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
  153. package/dist/components/primitives/number.d.ts +4 -2
  154. package/dist/components/primitives/value.d.ts +3 -1
  155. package/dist/components/typography/text-link.d.ts +4 -0
  156. package/dist/components/ui/combobox-dismiss.d.ts +16 -0
  157. package/dist/components/ui/combobox.d.ts +16 -7
  158. package/dist/components/ui/dialog.d.ts +1 -1
  159. package/dist/components/ui/item.d.ts +8 -8
  160. package/dist/components/ui/popover.d.ts +1 -1
  161. package/dist/components/ui/sheet.d.ts +1 -1
  162. package/dist/components/ui/tabs.d.ts +1 -1
  163. package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
  164. package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
  165. package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
  166. package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
  167. package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
  168. package/dist/data-display-DT_khPl_.js.map +1 -0
  169. package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
  170. package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
  171. package/dist/{date-picker-CF-DtUpF.js → date-picker-B2K3ucWn.js} +594 -593
  172. package/dist/date-picker-B2K3ucWn.js.map +1 -0
  173. package/dist/date-pickers-Ds8gLaoP.js +175 -0
  174. package/dist/date-pickers-Ds8gLaoP.js.map +1 -0
  175. package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
  176. package/dist/display-hAc1HjpI.js.map +1 -0
  177. package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
  178. package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
  179. package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
  180. package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
  181. package/dist/features/activities.js +398 -375
  182. package/dist/features/activities.js.map +1 -1
  183. package/dist/features/ai-chat.js +188 -179
  184. package/dist/features/ai-chat.js.map +1 -1
  185. package/dist/features/appointment-calendar.js +683 -0
  186. package/dist/features/appointment-calendar.js.map +1 -0
  187. package/dist/features/async-preview.js +109 -107
  188. package/dist/features/async-preview.js.map +1 -1
  189. package/dist/features/combobox.js +1 -1
  190. package/dist/features/comments.js +1 -1
  191. package/dist/features/data-view.js +137 -137
  192. package/dist/features/data-view.js.map +1 -1
  193. package/dist/features/email-composer.js +255 -255
  194. package/dist/features/email-composer.js.map +1 -1
  195. package/dist/features/event-calendar.js +254 -248
  196. package/dist/features/event-calendar.js.map +1 -1
  197. package/dist/features/filters.js +1 -1
  198. package/dist/features/global-search.js +35 -32
  199. package/dist/features/global-search.js.map +1 -1
  200. package/dist/features/kanban.js +118 -117
  201. package/dist/features/kanban.js.map +1 -1
  202. package/dist/features/map.js +233 -231
  203. package/dist/features/map.js.map +1 -1
  204. package/dist/features/media-library.js +789 -775
  205. package/dist/features/media-library.js.map +1 -1
  206. package/dist/features/mentions.js +1 -1
  207. package/dist/features/overlays.js +1 -1
  208. package/dist/features/products.js +922 -902
  209. package/dist/features/products.js.map +1 -1
  210. package/dist/features/questionnaire.js +28 -24
  211. package/dist/features/questionnaire.js.map +1 -1
  212. package/dist/features/resource-assignment.js +18 -15
  213. package/dist/features/resource-assignment.js.map +1 -1
  214. package/dist/features/resource.js +12 -12
  215. package/dist/features/resource.js.map +1 -1
  216. package/dist/features/rich-text-editor.js +2 -2
  217. package/dist/features/schema-form.js +15 -13
  218. package/dist/features/schema-form.js.map +1 -1
  219. package/dist/features/suggestions.js +3 -3
  220. package/dist/features/sync.js +11 -5
  221. package/dist/features/sync.js.map +1 -1
  222. package/dist/features/table.js +1 -1
  223. package/dist/features/theme-tweaker.js +493 -489
  224. package/dist/features/theme-tweaker.js.map +1 -1
  225. package/dist/feedback-BYIhtitP.js +239 -0
  226. package/dist/feedback-BYIhtitP.js.map +1 -0
  227. package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
  228. package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
  229. package/dist/{filters-BkHH53uv.js → filters-DJVAveHA.js} +589 -580
  230. package/dist/filters-DJVAveHA.js.map +1 -0
  231. package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
  232. package/dist/form-field-CwH9y77i.js.map +1 -0
  233. package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
  234. package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
  235. package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
  236. package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
  237. package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
  238. package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
  239. package/dist/{header-BOefOKd1.js → header-BSfIEWbI.js} +160 -153
  240. package/dist/header-BSfIEWbI.js.map +1 -0
  241. package/dist/{hooks-9k_TtmKh.js → hooks-ClH9thn4.js} +2 -2
  242. package/dist/{hooks-9k_TtmKh.js.map → hooks-ClH9thn4.js.map} +1 -1
  243. package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
  244. package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
  245. package/dist/index.js +3 -3
  246. package/dist/input-CZw8iU99.js +21 -0
  247. package/dist/input-CZw8iU99.js.map +1 -0
  248. package/dist/input-DQdEd0YD.js +263 -0
  249. package/dist/input-DQdEd0YD.js.map +1 -0
  250. package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
  251. package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
  252. package/dist/item-K5_ghvze.js +275 -0
  253. package/dist/item-K5_ghvze.js.map +1 -0
  254. package/dist/layout/app-shell.js +1 -1
  255. package/dist/layout/auth.js +1 -1
  256. package/dist/layout/containers.js +1 -1
  257. package/dist/layout/header.js +1 -1
  258. package/dist/layout/hooks.js +1 -1
  259. package/dist/layout/navigation.js +1 -1
  260. package/dist/layout/page.js +1 -1
  261. package/dist/layout/settings.js +1 -1
  262. package/dist/layout/sidebar.js +2 -2
  263. package/dist/layout/workspace.js +1 -1
  264. package/dist/layout.js +10 -10
  265. package/dist/lib/affordance-geometry.generated.d.ts +71 -0
  266. package/dist/lib/editable-text-recipe.d.ts +4 -4
  267. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  268. package/dist/lib/interaction-recipes.d.ts +5 -0
  269. package/dist/lib/theme-mode-css.d.ts +7 -0
  270. package/dist/lib/tone-recipes.d.ts +8 -0
  271. package/dist/lib/ui-provider/types.d.ts +2 -2
  272. package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
  273. package/dist/lib/utils.js +1 -1
  274. package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
  275. package/dist/media-gallery-3zIVLMWH.js.map +1 -0
  276. package/dist/{mentions-D-uyCh01.js → mentions-CGlEJ15c.js} +144 -142
  277. package/dist/mentions-CGlEJ15c.js.map +1 -0
  278. package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
  279. package/dist/message-DZ_ruyUV.js.map +1 -0
  280. package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
  281. package/dist/metadata-list-8N16ZMW_.js.map +1 -0
  282. package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
  283. package/dist/navigation-Bnotn4AQ.js.map +1 -0
  284. package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
  285. package/dist/navigation-BzhHI3lo.js.map +1 -0
  286. package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
  287. package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
  288. package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
  289. package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
  290. package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
  291. package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
  292. package/dist/{overlays-I0axtYA6.js → overlays-tMkF-VAN.js} +282 -278
  293. package/dist/overlays-tMkF-VAN.js.map +1 -0
  294. package/dist/{page-B5dTH9gE.js → page-CL9YeH_V.js} +8 -8
  295. package/dist/{page-B5dTH9gE.js.map → page-CL9YeH_V.js.map} +1 -1
  296. package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
  297. package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
  298. package/dist/pagination-BL25hu2s.js +158 -0
  299. package/dist/pagination-BL25hu2s.js.map +1 -0
  300. package/dist/{popover-Di55PyAI.js → popover-gnTOhbFM.js} +69 -66
  301. package/dist/popover-gnTOhbFM.js.map +1 -0
  302. package/dist/popover-menu-Cn9rUkdc.js +100 -0
  303. package/dist/popover-menu-Cn9rUkdc.js.map +1 -0
  304. package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
  305. package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
  306. package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
  307. package/dist/primitives-BFK08r9M.js.map +1 -0
  308. package/dist/primitives.js +4 -4
  309. package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
  310. package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
  311. package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
  312. package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
  313. package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
  314. package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
  315. package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
  316. package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
  317. package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
  318. package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
  319. package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
  320. package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
  321. package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
  322. package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
  323. package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
  324. package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
  325. package/dist/services/actions.js +1 -1
  326. package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
  327. package/dist/settings-ybnjVwbd.js.map +1 -0
  328. package/dist/{sheet-4SEvVYzA.js → sheet-ijlsjq-n.js} +76 -73
  329. package/dist/sheet-ijlsjq-n.js.map +1 -0
  330. package/dist/{sidebar-C7WWR29L.js → sidebar-Db6gkh3U.js} +183 -182
  331. package/dist/sidebar-Db6gkh3U.js.map +1 -0
  332. package/dist/{sidebar-d7Dg80ln.js → sidebar-DkTO4VTO.js} +14 -13
  333. package/dist/{sidebar-d7Dg80ln.js.map → sidebar-DkTO4VTO.js.map} +1 -1
  334. package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
  335. package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
  336. package/dist/smart-card-DiC5aac3.js +604 -0
  337. package/dist/smart-card-DiC5aac3.js.map +1 -0
  338. package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
  339. package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
  340. package/dist/style.css +1 -1
  341. package/dist/table-BweFy_P9.js +1530 -0
  342. package/dist/table-BweFy_P9.js.map +1 -0
  343. package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
  344. package/dist/table-DsfzoUia.js.map +1 -0
  345. package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
  346. package/dist/tabs-CDocW5D1.js.map +1 -0
  347. package/dist/text-inputs-f9Ia-aCi.js +353 -0
  348. package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
  349. package/dist/theme-mode-css-BB-_RYab.js +14 -0
  350. package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
  351. package/dist/theme-scope-BJ6eE2xt.js +50 -0
  352. package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
  353. package/dist/theme.css +285 -228
  354. package/dist/themes/green.css +16 -12
  355. package/dist/timelines-CwM_9IhD.js +457 -0
  356. package/dist/timelines-CwM_9IhD.js.map +1 -0
  357. package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
  358. package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
  359. package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
  360. package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
  361. package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
  362. package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
  363. package/dist/typography/rich-text.js +1 -1
  364. package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
  365. package/dist/typography-UTnveOEy.js.map +1 -0
  366. package/dist/typography.js +2 -2
  367. package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
  368. package/dist/ui-provider-C_U0Xma4.js.map +1 -0
  369. package/dist/ui-provider.js +2 -2
  370. package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
  371. package/dist/upload-CXyxmQBP.js.map +1 -0
  372. package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
  373. package/dist/upload-queue-Boscubn9.js.map +1 -0
  374. package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
  375. package/dist/usage-card-BhO5eqkX.js.map +1 -0
  376. package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
  377. package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
  378. package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
  379. package/dist/utils-BRhFDwuU.js.map +1 -0
  380. package/dist/{value-inputs-TAYMX111.js → value-inputs-TaX4OjNk.js} +268 -252
  381. package/dist/value-inputs-TaX4OjNk.js.map +1 -0
  382. package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
  383. package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
  384. package/dist/{workspace-DH0v0KcB.js → workspace-B-OEm3Kf.js} +34 -33
  385. package/dist/workspace-B-OEm3Kf.js.map +1 -0
  386. package/docs/consumer-skill/SKILL.md +3 -3
  387. package/docs/consumer-skill/references/agents-md.md +1 -1
  388. package/docs/consumer-skill/references/composition.md +8 -6
  389. package/docs/consumer-skill/references/installation.md +6 -0
  390. package/docs/consumer-skill/references/integration.md +4 -3
  391. package/docs/consumer-skill/references/public-api.json +105 -2
  392. package/docs/consumer-skill/references/review.md +7 -0
  393. package/docs/consumer-skill/references/theming.md +71 -6
  394. package/docs/consumer-skill/references/tokens.json +1 -1
  395. package/docs/consumer-skill/references/workflows.md +26 -0
  396. package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
  397. package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
  398. package/package.json +8 -4
  399. package/dist/accordion-B6a3vVgA.js.map +0 -1
  400. package/dist/action-menu-TzCoSlwL.js +0 -280
  401. package/dist/action-menu-TzCoSlwL.js.map +0 -1
  402. package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
  403. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
  404. package/dist/ai-artifact-BMJdv-6q.js +0 -1115
  405. package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
  406. package/dist/attachment-BtfhGm8i.js +0 -245
  407. package/dist/attachment-BtfhGm8i.js.map +0 -1
  408. package/dist/auth-CYxKfo69.js.map +0 -1
  409. package/dist/avatar-BBnEJIx8.js.map +0 -1
  410. package/dist/badge-MrKVNzW9.js.map +0 -1
  411. package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
  412. package/dist/breadcrumbs-D5t7I023.js.map +0 -1
  413. package/dist/buttons-SbIcm1HJ.js.map +0 -1
  414. package/dist/cards-CiiHpKYd.js +0 -66
  415. package/dist/cards-CiiHpKYd.js.map +0 -1
  416. package/dist/chart-QfrARkXl.js.map +0 -1
  417. package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
  418. package/dist/code-block-Dgbu-CU3.js.map +0 -1
  419. package/dist/combobox-2Ic8N9bL.js +0 -278
  420. package/dist/combobox-2Ic8N9bL.js.map +0 -1
  421. package/dist/combobox-DLl0bfiq.js.map +0 -1
  422. package/dist/comments-BpDuCUUu.js.map +0 -1
  423. package/dist/data-display-DafIvCl5.js.map +0 -1
  424. package/dist/date-picker-CF-DtUpF.js.map +0 -1
  425. package/dist/date-pickers-BmzxJl5l.js +0 -174
  426. package/dist/date-pickers-BmzxJl5l.js.map +0 -1
  427. package/dist/display-DsQTVzMz.js.map +0 -1
  428. package/dist/dropdown-menu-E2qmdC7o.js +0 -193
  429. package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
  430. package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
  431. package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
  432. package/dist/feedback-qNuMBtRH.js +0 -233
  433. package/dist/feedback-qNuMBtRH.js.map +0 -1
  434. package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
  435. package/dist/filters-BkHH53uv.js.map +0 -1
  436. package/dist/form-field-DUt4UxSV.js.map +0 -1
  437. package/dist/form-sizing-By94KzXE.js.map +0 -1
  438. package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
  439. package/dist/header-BOefOKd1.js.map +0 -1
  440. package/dist/input-DWhBBBww.js +0 -262
  441. package/dist/input-DWhBBBww.js.map +0 -1
  442. package/dist/input-Ddi_LSYv.js +0 -20
  443. package/dist/input-Ddi_LSYv.js.map +0 -1
  444. package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
  445. package/dist/item-DEmDiTlD.js +0 -265
  446. package/dist/item-DEmDiTlD.js.map +0 -1
  447. package/dist/media-gallery-DcTtAaeC.js.map +0 -1
  448. package/dist/mentions-D-uyCh01.js.map +0 -1
  449. package/dist/message-CdHgIWKf.js.map +0 -1
  450. package/dist/metadata-list-X5rYAKSB.js.map +0 -1
  451. package/dist/navigation-D3KwXmaq.js.map +0 -1
  452. package/dist/navigation-HJf5zxlH.js.map +0 -1
  453. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
  454. package/dist/overlays-I0axtYA6.js.map +0 -1
  455. package/dist/pagination-3bPA_a6K.js +0 -149
  456. package/dist/pagination-3bPA_a6K.js.map +0 -1
  457. package/dist/popover-Di55PyAI.js.map +0 -1
  458. package/dist/popover-menu-B71Tn2Qz.js +0 -99
  459. package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
  460. package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
  461. package/dist/primitives-B-CkiEMU.js.map +0 -1
  462. package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
  463. package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
  464. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
  465. package/dist/settings-CQW3b-Cu.js.map +0 -1
  466. package/dist/sheet-4SEvVYzA.js.map +0 -1
  467. package/dist/sidebar-C7WWR29L.js.map +0 -1
  468. package/dist/smart-card-lFKxn5Hu.js +0 -595
  469. package/dist/smart-card-lFKxn5Hu.js.map +0 -1
  470. package/dist/spinner-fa3h1Aif.js +0 -80
  471. package/dist/spinner-fa3h1Aif.js.map +0 -1
  472. package/dist/table-CIKyLUsy.js.map +0 -1
  473. package/dist/table-CrcLN9Io.js +0 -1458
  474. package/dist/table-CrcLN9Io.js.map +0 -1
  475. package/dist/tabs-DwBJfjxX.js.map +0 -1
  476. package/dist/text-inputs-aaK9wcDT.js +0 -326
  477. package/dist/text-inputs-aaK9wcDT.js.map +0 -1
  478. package/dist/theme-scope-kStaAer0.js +0 -39
  479. package/dist/theme-scope-kStaAer0.js.map +0 -1
  480. package/dist/timelines-C_SBwHNP.js +0 -442
  481. package/dist/timelines-C_SBwHNP.js.map +0 -1
  482. package/dist/tone-recipes-CPoExcTE.js.map +0 -1
  483. package/dist/typography-DTRkE9zL.js.map +0 -1
  484. package/dist/ui-provider-1D_NSYzO.js.map +0 -1
  485. package/dist/upload-BO8-CLN6.js.map +0 -1
  486. package/dist/upload-queue-EOC8g1gf.js.map +0 -1
  487. package/dist/usage-card-obRaBskq.js.map +0 -1
  488. package/dist/utils-l5LpDw2z.js.map +0 -1
  489. package/dist/value-inputs-TAYMX111.js.map +0 -1
  490. package/dist/workspace-DH0v0KcB.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-CXyxmQBP.js","names":["React","useFormattingConfig","useDensityConfig","resolveComponentScale","cn","Button","Text","AlertDescription","Alert","AlertTitle","formatFileSize","FileSize","fieldAffordanceRecipes","ItemGroup","useFileDropTarget","uploadDropTargetRecipes","Dropzone","FilePickerInput","AttachmentFileIcon","AttachmentTitle","AttachmentDescription","AttachmentActions","AttachmentMedia","AttachmentContent","Attachment","React$1","React","defaultFileUploadStrings","fileName","accept","minimum","maximum","fileFingerprint","file","fileMatchesAccept","fileType","part","rule","validateOneFile","options","strings","minSizeBytes","formatSize","maxSizeBytes","validateFile","result","validateFileSelection","nextFiles","append","current","fingerprints","accepted","rejections","incoming","validationRejection","fingerprint","maxFiles","hasOwnValue","props","normalizeMaximum","value","fileKey","index","assignInputRef","node","forwardedRef","SelectedFileRow","replaceLabel","removeLabel","showReplace","UploadIcon","onReplace","Trash2Icon","onRemove","FileUploadImpl","sizeProp","stringsProp","_value","_defaultValue","_onValueChange","_selectionMode","_maxFiles","ariaDescribedBy","nativeAriaInvalid","nativeInputProps","useStrings","size","defaultScale","controlled","uncontrolledFiles","setUncontrolledFiles","useState","setRejections","inputRef","useRef","rootRef","continueFocus","pickerWasFocused","generatedId","useId","files","useMemo","target","multipleProps","multiple","errorId","describedBy","hasInvalidState","invalid","commitFiles","useCallback","nextFile","bytes","locale","handleFiles","disabled","onRejectedFiles","clearNativeInput","handleRemove","fileIndex","openPicker","inputProps","picker","className","dropTargetProps","isDragging","TriangleAlert","rejection","FileUpload","forwardRef","FILE_SIZE_UNITS","defaultFormatSize","unitIndex","idCounter","generateId","getExtension","getFingerprint","createMeta","extension","rules","allowed","toErrorMap","useFiles","setFilesState","filesRef","processFiles","incomingFiles","previousFiles","replace","meta","nextRejections","id","MAX_FILE_SIZE_MB","ASPECT_RATIO_CLASSES","defaultImageUploadStrings","count","getImageUploadRejectionMessage","code","details","ImageUploadImpl","inputId","allowedExtensions","parsed","item","subtype","ext","setFiles","removeAll","selected","selectOrChangeButtonLabel","filePreviewUrl","setFilePreviewUrl","acceptedExtensionsLabel","url","previewUrl","initialPreviewUrl","hasPreview","previewAlt","aspectClass","aspectRatio","imgFitClass","fit","computedMaxWidth","maxWidth","wrapperStyle","layout","inlinePreviewStyle","acceptedFile","onValueChange","handleInput","event","triggerFileDialog","remove","ImageIcon","ImageUpload","defaultAvatarUploadStrings","getAvatarUploadRejectionMessage","SIZE_PX","AvatarUploadImpl","sizes","s","list","initials","Camera","X","AvatarUpload"],"sources":["../src/components/base/upload/file-upload.strings.ts","../src/components/base/upload/file-upload.validation.ts","../src/components/base/upload/file-upload.tsx","../src/hooks/use-files.ts","../src/components/base/upload/image-upload.tsx","../src/components/base/upload/avatar-upload.tsx"],"sourcesContent":["export interface FileUploadStrings {\n\tinstruction: string;\n\thelper: string;\n\tbrowse: string;\n\treplace: string;\n\tremove: string;\n\tdragOver: string;\n\terrorsHeading: string;\n\treplaceFileAria: (fileName: string) => string;\n\tremoveFileAria: (fileName: string) => string;\n\tinvalidType: (fileName: string, accept: string) => string;\n\tfileTooSmall: (fileName: string, minimum: string) => string;\n\tfileTooLarge: (fileName: string, maximum: string) => string;\n\ttooManyFiles: (fileName: string, maximum: number) => string;\n\tduplicateFile: (fileName: string) => string;\n\tcustomValidationFailed: (fileName: string) => string;\n}\n\nexport const defaultFileUploadStrings: FileUploadStrings = {\n\tinstruction: 'Drag files here or click to browse',\n\thelper: '',\n\tbrowse: 'Browse files',\n\treplace: 'Replace file',\n\tremove: 'Remove file',\n\tdragOver: 'Release to select',\n\terrorsHeading: 'Some files could not be selected',\n\treplaceFileAria: (fileName) => `Replace ${fileName}`,\n\tremoveFileAria: (fileName) => `Remove ${fileName}`,\n\tinvalidType: (fileName, accept) => `${fileName} is not an accepted file type (${accept}).`,\n\tfileTooSmall: (fileName, minimum) => `${fileName} is smaller than the minimum size of ${minimum}.`,\n\tfileTooLarge: (fileName, maximum) => `${fileName} is larger than the maximum size of ${maximum}.`,\n\ttooManyFiles: (fileName, maximum) => `${fileName} exceeds the limit of ${maximum} files.`,\n\tduplicateFile: (fileName) => `${fileName} has already been selected.`,\n\tcustomValidationFailed: (fileName) => `${fileName} did not pass validation.`,\n};\n\n","import type {\n\tFileUploadRejection,\n\tFileUploadValidator,\n} from './file-upload.types';\nimport type { FileUploadStrings } from './file-upload.strings';\n\ninterface ValidateFileSelectionOptions {\n\tincoming: File[];\n\tcurrent: File[];\n\taccept?: string;\n\tminSizeBytes?: number;\n\tmaxSizeBytes?: number;\n\tmaxFiles: number;\n\tappend: boolean;\n\tvalidateFile?: FileUploadValidator;\n\tformatSize: (bytes: number) => string;\n\tstrings: FileUploadStrings;\n}\n\nexport interface FileSelectionResult {\n\taccepted: File[];\n\tnextFiles: File[];\n\trejections: FileUploadRejection[];\n}\n\nfunction fileFingerprint(file: File) {\n\treturn `${file.name}\\u0000${file.size}\\u0000${file.type}\\u0000${file.lastModified}`;\n}\n\nfunction fileMatchesAccept(file: File, accept?: string) {\n\tif (!accept?.trim()) return true;\n\n\tconst fileName = file.name.toLowerCase();\n\tconst fileType = file.type.toLowerCase();\n\treturn accept\n\t\t.split(',')\n\t\t.map((part) => part.trim().toLowerCase())\n\t\t.filter(Boolean)\n\t\t.some((rule) => {\n\t\t\tif (rule.startsWith('.')) return fileName.endsWith(rule);\n\t\t\tif (rule.endsWith('/*')) return fileType.startsWith(rule.slice(0, -1));\n\t\t\treturn fileType === rule;\n\t\t});\n}\n\nfunction validateOneFile(\n\tfile: File,\n\toptions: Pick<\n\t\tValidateFileSelectionOptions,\n\t\t'accept' | 'minSizeBytes' | 'maxSizeBytes' | 'validateFile' | 'formatSize' | 'strings'\n\t>,\n): FileUploadRejection | undefined {\n\tconst { accept, minSizeBytes, maxSizeBytes, validateFile, formatSize, strings } = options;\n\n\tif (!fileMatchesAccept(file, accept)) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'invalid-type',\n\t\t\tmessage: strings.invalidType(file.name, accept ?? ''),\n\t\t};\n\t}\n\tif (minSizeBytes !== undefined && file.size < minSizeBytes) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'too-small',\n\t\t\tmessage: strings.fileTooSmall(file.name, formatSize(minSizeBytes)),\n\t\t};\n\t}\n\tif (maxSizeBytes !== undefined && file.size > maxSizeBytes) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'too-large',\n\t\t\tmessage: strings.fileTooLarge(file.name, formatSize(maxSizeBytes)),\n\t\t};\n\t}\n\tif (validateFile) {\n\t\tlet result: boolean | string;\n\t\ttry {\n\t\t\tresult = validateFile(file);\n\t\t} catch {\n\t\t\tresult = false;\n\t\t}\n\t\tif (result !== true) {\n\t\t\treturn {\n\t\t\t\tfile,\n\t\t\t\tcode: 'custom',\n\t\t\t\tmessage: typeof result === 'string'\n\t\t\t\t\t? result\n\t\t\t\t\t: strings.customValidationFailed(file.name),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function validateFileSelection({\n\tincoming,\n\tcurrent,\n\taccept,\n\tminSizeBytes,\n\tmaxSizeBytes,\n\tmaxFiles,\n\tappend,\n\tvalidateFile,\n\tformatSize,\n\tstrings,\n}: ValidateFileSelectionOptions): FileSelectionResult {\n\tconst nextFiles = append ? [...current] : [];\n\tconst fingerprints = new Set(nextFiles.map(fileFingerprint));\n\tconst accepted: File[] = [];\n\tconst rejections: FileUploadRejection[] = [];\n\n\tfor (const file of incoming) {\n\t\tconst validationRejection = validateOneFile(file, {\n\t\t\taccept,\n\t\t\tminSizeBytes,\n\t\t\tmaxSizeBytes,\n\t\t\tvalidateFile,\n\t\t\tformatSize,\n\t\t\tstrings,\n\t\t});\n\t\tif (validationRejection) {\n\t\t\trejections.push(validationRejection);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst fingerprint = fileFingerprint(file);\n\t\tif (fingerprints.has(fingerprint)) {\n\t\t\trejections.push({\n\t\t\t\tfile,\n\t\t\t\tcode: 'duplicate',\n\t\t\t\tmessage: strings.duplicateFile(file.name),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (nextFiles.length >= maxFiles) {\n\t\t\trejections.push({\n\t\t\t\tfile,\n\t\t\t\tcode: 'too-many',\n\t\t\t\tmessage: strings.tooManyFiles(file.name, maxFiles),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\taccepted.push(file);\n\t\tnextFiles.push(file);\n\t\tfingerprints.add(fingerprint);\n\t}\n\n\treturn { accepted, nextFiles, rejections };\n}\n","/**\n * FileUpload — controlled or uncontrolled local-file selection with validation.\n * The component never transfers files; consumers own upload/network behavior.\n */\nimport {\n\tforwardRef,\n\tuseCallback,\n\tuseLayoutEffect,\n\tuseId,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype ForwardedRef,\n\ttype MutableRefObject,\n} from 'react';\nimport {\n\tTrash2Icon,\n\tTriangleAlert,\n\tUploadIcon,\n} from 'lucide-react';\n\nimport { Button } from '../buttons';\nimport { Alert, AlertDescription, AlertTitle } from '../feedback';\nimport {\n\tItemGroup,\n} from '../item';\nimport { Attachment, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentFileIcon } from '../attachment';\nimport { FileSize, formatFileSize } from '../../primitives';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { useFormattingConfig, useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\n\nimport { Dropzone } from './dropzone';\nimport {\n\tFilePickerInput,\n\ttype FilePickerNativeInputProps,\n} from './file-picker-input';\nimport {\n\tdefaultFileUploadStrings,\n\ttype FileUploadStrings,\n} from './file-upload.strings';\nimport type {\n\tFileUploadRejection,\n\tMultipleFileUploadProps,\n\tSingleFileUploadProps,\n} from './file-upload.types';\nimport { validateFileSelection } from './file-upload.validation';\nimport { useFileDropTarget } from './use-file-drop-target';\nimport { uploadDropTargetRecipes } from './upload.recipes';\n\n/** Public discriminated single/multiple contract, declared here for docgen discoverability. */\nexport type FileUploadProps = SingleFileUploadProps | MultipleFileUploadProps;\n\nfunction hasOwnValue(props: FileUploadProps) {\n\treturn Object.prototype.hasOwnProperty.call(props, 'value');\n}\n\nfunction normalizeMaximum(value: number | undefined) {\n\tif (value === undefined) return Number.MAX_SAFE_INTEGER;\n\tif (!Number.isFinite(value)) return Number.MAX_SAFE_INTEGER;\n\treturn Math.max(1, Math.floor(value));\n}\n\nfunction fileKey(file: File, index: number) {\n\treturn `${file.name}-${file.size}-${file.type}-${file.lastModified}-${index}`;\n}\n\nfunction assignInputRef(\n\tnode: HTMLInputElement | null,\n\tlocalRef: MutableRefObject<HTMLInputElement | null>,\n\tforwardedRef: ForwardedRef<HTMLInputElement>,\n) {\n\tlocalRef.current = node;\n\tif (typeof forwardedRef === 'function') forwardedRef(node);\n\telse if (forwardedRef) forwardedRef.current = node;\n}\n\ninterface SelectedFileRowProps {\n\tfile: File;\n\tindex: number;\n\tdisabled: boolean;\n\tsize: ComponentScale;\n\tlocale?: string;\n\tstrings: FileUploadStrings;\n\tshowReplace: boolean;\n\tonReplace: () => void;\n\tonRemove: (index: number) => void;\n}\n\nfunction SelectedFileRow({\n\tfile,\n\tindex,\n\tdisabled,\n\tsize,\n\tlocale,\n\tstrings,\n\tshowReplace,\n\tonReplace,\n\tonRemove,\n}: SelectedFileRowProps) {\n\tconst replaceLabel = strings.replaceFileAria(file.name);\n\tconst removeLabel = strings.removeFileAria(file.name);\n\n\treturn (\n\t\t<Attachment\n\t\t\tvariant=\"outline\"\n\t\t\tsize={size}\n\t\t\tclassName=\"file-upload--file flex-nowrap bg-card text-card-foreground\"\n\t\t>\n\t\t\t<AttachmentMedia variant=\"icon\" className=\"file-upload--file-media self-center group-has-data-[slot=item-description]/item:self-center\">\n\t\t\t\t<AttachmentFileIcon name={file.name} />\n\t\t\t</AttachmentMedia>\n\t\t\t<AttachmentContent className=\"file-upload--file-content min-w-0\">\n\t\t\t\t<AttachmentTitle className=\"file-upload--file-name truncate\" title={file.name}>\n\t\t\t\t\t{file.name}\n\t\t\t\t</AttachmentTitle>\n\t\t\t\t<AttachmentDescription className=\"file-upload--file-size\" clamp={1}>\n\t\t\t\t\t<FileSize\n\t\t\t\t\t\tvalue={file.size}\n\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\talign=\"left\"\n\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t/>\n\t\t\t\t</AttachmentDescription>\n\t\t\t</AttachmentContent>\n\t\t\t<AttachmentActions className=\"file-upload--actions gap-space-xs\">\n\t\t\t\t{showReplace && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\ticon={UploadIcon}\n\t\t\t\t\t\taria-label={replaceLabel}\n\t\t\t\t\t\ttitle={replaceLabel}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonClick={onReplace}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" className=\"sr-only\">\n\t\t\t\t\t\t\t{strings.replace}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\ticon={Trash2Icon}\n\t\t\t\t\taria-label={removeLabel}\n\t\t\t\t\ttitle={removeLabel}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonClick={() => onRemove(index)}\n\t\t\t\t>\n\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" className=\"sr-only\">\n\t\t\t\t\t\t{strings.remove}\n\t\t\t\t\t</Text>\n\t\t\t\t</Button>\n\t\t\t</AttachmentActions>\n\t\t</Attachment>\n\t);\n}\n\nfunction FileUploadImpl(\n\tprops: FileUploadProps,\n\tforwardedRef: ForwardedRef<HTMLInputElement>,\n) {\n\tconst {\n\t\taccept,\n\t\tdisabled = false,\n\t\tinvalid = false,\n\t\tsize: sizeProp,\n\t\tminSizeBytes,\n\t\tmaxSizeBytes,\n\t\tvalidateFile,\n\t\tonRejectedFiles,\n\t\tclassName,\n\t\tstrings: stringsProp,\n\t\tmultiple = false,\n\t\tvalue: _value,\n\t\tdefaultValue: _defaultValue,\n\t\tonValueChange: _onValueChange,\n\t\tselectionMode: _selectionMode,\n\t\tmaxFiles: _maxFiles,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t'aria-invalid': nativeAriaInvalid,\n\t\t...nativeInputProps\n\t} = props;\n\tconst strings = useStrings(defaultFileUploadStrings, stringsProp);\n\tconst { defaultScale } = useDensityConfig();\n\tconst { locale } = useFormattingConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst controlled = hasOwnValue(props);\n\tconst [uncontrolledFiles, setUncontrolledFiles] = useState<File[]>(() => {\n\t\tif (props.multiple) return [...(props.defaultValue ?? [])];\n\t\treturn props.defaultValue ? [props.defaultValue] : [];\n\t});\n\tconst [rejections, setRejections] = useState<FileUploadRejection[]>([]);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst rootRef = useRef<HTMLDivElement | null>(null);\n\tconst continueFocus = useRef(false);\n\tconst pickerWasFocused = useRef(false);\n\tconst generatedId = useId();\n\n\tconst files = useMemo(() => {\n\t\tif (!controlled) return uncontrolledFiles;\n\t\tif (props.multiple) return props.value ?? [];\n\t\treturn props.value ? [props.value] : [];\n\t}, [controlled, props.multiple, props.value, uncontrolledFiles]);\n\tuseLayoutEffect(() => {\n\t\tif (!continueFocus.current) return;\n\t\tconst target = rootRef.current?.querySelector<HTMLElement>('.file-upload--actions button, .file-upload--dropzone input[type=file], .file-upload--dropzone button');\n\t\tif (target) {\n\t\t\ttarget.focus();\n\t\t\tcontinueFocus.current = false;\n\t\t}\n\t}, [files]);\n\tconst multipleProps = props.multiple ? props as MultipleFileUploadProps : undefined;\n\tconst maxFiles = multiple ? normalizeMaximum(multipleProps?.maxFiles) : 1;\n\tconst append = multiple && (multipleProps?.selectionMode ?? 'append') === 'append';\n\tconst errorId = `${nativeInputProps.id ?? `file-upload-${generatedId}`}-errors`;\n\tconst describedBy = [ariaDescribedBy, rejections.length > 0 ? errorId : undefined]\n\t\t.filter(Boolean)\n\t\t.join(' ') || undefined;\n\tconst hasInvalidState = invalid || rejections.length > 0;\n\n\tconst commitFiles = useCallback((nextFiles: File[]) => {\n\t\tif (!controlled) setUncontrolledFiles(nextFiles);\n\t\tif (props.multiple) {\n\t\t\tprops.onValueChange?.(nextFiles);\n\t\t} else {\n\t\t\tconst nextFile = nextFiles[0];\n\t\t\tprops.onValueChange?.(nextFile);\n\t\t}\n\t}, [controlled, props]);\n\n\tconst formatSize = useCallback((bytes: number) => (\n\t\tformatFileSize(bytes, { locale }) ?? `${bytes} B`\n\t), [locale]);\n\n\tconst handleFiles = useCallback((incoming: File[]) => {\n\t\tif (disabled || incoming.length === 0) return false;\n\t\tconst result = validateFileSelection({\n\t\t\tincoming,\n\t\t\tcurrent: files,\n\t\t\taccept,\n\t\t\tminSizeBytes,\n\t\t\tmaxSizeBytes,\n\t\t\tmaxFiles,\n\t\t\tappend,\n\t\t\tvalidateFile,\n\t\t\tformatSize,\n\t\t\tstrings,\n\t\t});\n\n\t\tsetRejections(result.rejections);\n\t\tif (result.rejections.length > 0) onRejectedFiles?.(result.rejections);\n\t\tif (result.accepted.length === 0) return false;\n\t\tcontinueFocus.current = !multiple && (pickerWasFocused.current || Boolean(rootRef.current?.contains(document.activeElement)));\n\t\tpickerWasFocused.current = false;\n\t\tcommitFiles(result.nextFiles);\n\t\treturn result.rejections.length === 0;\n\t}, [\n\t\taccept,\n\t\tappend,\n\t\tcommitFiles,\n\t\tdisabled,\n\t\tmultiple,\n\t\tfiles,\n\t\tformatSize,\n\t\tmaxFiles,\n\t\tmaxSizeBytes,\n\t\tminSizeBytes,\n\t\tonRejectedFiles,\n\t\tstrings,\n\t\tvalidateFile,\n\t]);\n\n\tconst clearNativeInput = useCallback(() => {\n\t\tif (inputRef.current) inputRef.current.value = '';\n\t}, []);\n\n\tconst handleRemove = useCallback((index: number) => {\n\t\tif (disabled) return;\n\t\tsetRejections([]);\n\t\tclearNativeInput();\n\t\tcontinueFocus.current = Boolean(rootRef.current?.contains(document.activeElement));\n\t\tcommitFiles(files.filter((_, fileIndex) => fileIndex !== index));\n\t}, [clearNativeInput, commitFiles, disabled, files]);\n\n\tconst openPicker = useCallback(() => {\n\t\tif (!disabled) {\n\t\t\tpickerWasFocused.current = Boolean(rootRef.current?.contains(document.activeElement));\n\t\t\tinputRef.current?.click();\n\t\t}\n\t}, [disabled]);\n\n\tconst { isDragging, dropTargetProps } = useFileDropTarget({\n\t\tdisabled,\n\t\tonFiles: handleFiles,\n\t});\n\n\tconst inputProps: FilePickerNativeInputProps = {\n\t\t...(nativeInputProps as FilePickerNativeInputProps),\n\t\taccept,\n\t\tmultiple,\n\t\tdisabled,\n\t\t'aria-describedby': describedBy,\n\t\t'aria-invalid': hasInvalidState ? true : nativeAriaInvalid,\n\t};\n\n\tconst picker = (\n\t\t<Dropzone\n\t\t\tref={(node) => assignInputRef(node, inputRef, forwardedRef)}\n\t\t\tonDrop={handleFiles}\n\t\t\taccept={accept}\n\t\t\tmultiple={multiple}\n\t\t\tdisabled={disabled}\n\t\t\tinvalid={hasInvalidState}\n\t\t\tsize={size}\n\t\t\tclassName=\"file-upload--dropzone\"\n\t\t\tinputProps={inputProps}\n\t\t\tstrings={{\n\t\t\t\tinstruction: strings.instruction,\n\t\t\t\thelper: strings.helper,\n\t\t\t\tdragOver: strings.dragOver,\n\t\t\t}}\n\t\t>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\tsize={size}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tclassName=\"disabled:opacity-100 aria-disabled:opacity-100\"\n\t\t\t\tonClick={openPicker}\n\t\t\t>\n\t\t\t\t{strings.browse}\n\t\t\t</Button>\n\t\t</Dropzone>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={rootRef}\n\t\t\tdata-disabled={disabled || undefined}\n\t\t\tdata-invalid={hasInvalidState || undefined}\n\t\t\tclassName={cn('file-upload--component grid gap-space-md', className)}\n\t\t>\n\t\t\t{(multiple || files.length === 0) && picker}\n\n\t\t\t{!multiple && files[0] && (\n\t\t\t\t<div\n\t\t\t\t\t{...dropTargetProps}\n\t\t\t\t\tdata-dragging={isDragging || undefined}\n\t\t\t\t\tdata-invalid={hasInvalidState || undefined}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'file-upload--selected rounded-radius transition-shadow',\n\t\t\t\t\t\thasInvalidState && '[&_.file-upload--file]:border-destructive',\n\t\t\t\t\t\t!disabled && isDragging && (\n\t\t\t\t\t\t\thasInvalidState\n\t\t\t\t\t\t\t\t? uploadDropTargetRecipes.invalidDraggingRing\n\t\t\t\t\t\t\t\t: uploadDropTargetRecipes.draggingRing\n\t\t\t\t\t\t),\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<FilePickerInput\n\t\t\t\t\t\t{...inputProps}\n\t\t\t\t\t\tref={(node) => assignInputRef(node, inputRef, forwardedRef)}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tclassName=\"file-upload--input\"\n\t\t\t\t\t\tonFiles={handleFiles}\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectedFileRow\n\t\t\t\t\t\tfile={files[0]}\n\t\t\t\t\t\tindex={0}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\tshowReplace\n\t\t\t\t\t\tonReplace={openPicker}\n\t\t\t\t\t\tonRemove={handleRemove}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{multiple && files.length > 0 && (\n\t\t\t\t<ItemGroup className=\"file-upload--files\">\n\t\t\t\t\t{files.map((file, index) => (\n\t\t\t\t\t\t<SelectedFileRow\n\t\t\t\t\t\t\tkey={fileKey(file, index)}\n\t\t\t\t\t\t\tfile={file}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\tshowReplace={false}\n\t\t\t\t\t\t\tonReplace={openPicker}\n\t\t\t\t\t\t\tonRemove={handleRemove}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</ItemGroup>\n\t\t\t)}\n\n\t\t\t{rejections.length > 0 && (\n\t\t\t\t<Alert\n\t\t\t\t\tid={errorId}\n\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'file-upload--errors',\n\t\t\t\t\t\tsize === 'sm' && 'p-surface-xs',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<TriangleAlert aria-hidden=\"true\" />\n\t\t\t\t\t<AlertTitle>{strings.errorsHeading}</AlertTitle>\n\t\t\t\t\t<AlertDescription>\n\t\t\t\t\t\t<ul className=\"m-0 p-0 list-none grid gap-space-2xs\">\n\t\t\t\t\t\t\t{rejections.map((rejection, index) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tkey={`${rejection.code}-${fileKey(rejection.file, index)}`}\n\t\t\t\t\t\t\t\t\tclassName=\"file-upload--error\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"error\">\n\t\t\t\t\t\t\t\t\t\t{rejection.message}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</AlertDescription>\n\t\t\t\t</Alert>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\n/** Selects and validates local File values without performing network uploads. */\nexport const FileUpload = forwardRef<HTMLInputElement, FileUploadProps>(FileUploadImpl);\nFileUpload.displayName = 'FileUpload';\n\nexport { defaultFileUploadStrings };\nexport type { FileUploadStrings };\nexport type {\n\tFileUploadRejection,\n\tFileUploadRejectionCode,\n\tFileUploadCommonProps,\n\tFileUploadSelectionMode,\n\tFileUploadValidator,\n\tMultipleFileUploadProps,\n\tSingleFileUploadProps,\n} from './file-upload.types';\n","import { useCallback, useRef, useState } from 'react';\n\nexport type FileRejectionCode =\n\t| 'invalid-type'\n\t| 'too-small'\n\t| 'too-large'\n\t| 'too-many'\n\t| 'duplicate'\n\t| 'custom';\n\nexport interface FileRejectionDetails {\n\textension?: string;\n\tminimumBytes?: number;\n\tmaximumBytes?: number;\n\tmaximumFiles?: number;\n\t/** Consumer-provided custom copy. The hook never manufactures a message. */\n\tcustomMessage?: string;\n}\n\nexport interface FileRejection {\n\tfile: File;\n\tcode: FileRejectionCode;\n\tdetails: FileRejectionDetails;\n}\n\nexport interface FileValidationRules {\n\tmaxSize?: number;\n\tminSize?: number;\n\tallowedExtensions?: string[];\n\tmaxFiles?: number;\n\tcustomValidator?: (file: File) => boolean | string;\n}\n\nexport interface FileMeta {\n\tid: string;\n\tfile: File;\n\tname: string;\n\tsize: number;\n\tformattedSize: string;\n\ttype: string;\n\textension: string;\n\tlastModified: number;\n}\n\nexport interface FileProcessingResult {\n\taccepted: FileMeta[];\n\tfiles: FileMeta[];\n\trejections: FileRejection[];\n}\n\nexport interface UseFilesReturn {\n\tfiles: FileMeta[];\n\taddFiles: (incoming: FileList | File[]) => FileProcessingResult;\n\tsetFiles: (incoming: FileList | File[]) => FileProcessingResult;\n\tremove: (id: string) => void;\n\tremoveAll: () => void;\n\tformatSize: (bytes: number) => string;\n\t/** Compatibility lookup keyed by file name. Values are typed details, never copy. */\n\tvalidationErrors: Record<string, FileRejection>;\n\trejections: FileRejection[];\n}\n\nconst FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\n\nfunction defaultFormatSize(bytes: number): string {\n\tif (!Number.isFinite(bytes) || bytes <= 0) return '0 B';\n\tconst unitIndex = Math.min(\n\t\tMath.floor(Math.log(bytes) / Math.log(1024)),\n\t\tFILE_SIZE_UNITS.length - 1,\n\t);\n\tconst value = bytes / 1024 ** unitIndex;\n\tconst formattedValue = unitIndex === 0\n\t\t? value.toFixed(0)\n\t\t: Number(value.toFixed(1)).toString();\n\treturn `${formattedValue} ${FILE_SIZE_UNITS[unitIndex]}`;\n}\n\nlet idCounter = 0;\nfunction generateId(): string {\n\tconst timestamp = Date.now().toString(36);\n\tconst count = (idCounter++).toString(36);\n\treturn `${timestamp}-${count}`;\n}\n\nfunction getExtension(file: File) {\n\treturn file.name.split('.').pop()?.toLowerCase() ?? '';\n}\n\nfunction getFingerprint(file: File) {\n\treturn `${file.name}\\u0000${file.size}\\u0000${file.type}\\u0000${file.lastModified}`;\n}\n\nfunction createMeta(file: File): FileMeta {\n\treturn {\n\t\tid: generateId(),\n\t\tfile,\n\t\tname: file.name,\n\t\tsize: file.size,\n\t\tformattedSize: defaultFormatSize(file.size),\n\t\ttype: file.type,\n\t\textension: getExtension(file),\n\t\tlastModified: file.lastModified,\n\t};\n}\n\nfunction validateFile(\n\tfile: File,\n\trules?: FileValidationRules,\n): FileRejection | undefined {\n\tconst extension = getExtension(file);\n\tif (rules?.minSize !== undefined && file.size < rules.minSize) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'too-small',\n\t\t\tdetails: { minimumBytes: rules.minSize },\n\t\t};\n\t}\n\tif (rules?.maxSize !== undefined && file.size > rules.maxSize) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'too-large',\n\t\t\tdetails: { maximumBytes: rules.maxSize },\n\t\t};\n\t}\n\tif (\n\t\trules?.allowedExtensions &&\n\t\t!rules.allowedExtensions.some((allowed) => allowed.toLowerCase().replace(/^\\./, '') === extension)\n\t) {\n\t\treturn {\n\t\t\tfile,\n\t\t\tcode: 'invalid-type',\n\t\t\tdetails: { extension },\n\t\t};\n\t}\n\tif (rules?.customValidator) {\n\t\tlet result: boolean | string;\n\t\ttry {\n\t\t\tresult = rules.customValidator(file);\n\t\t} catch {\n\t\t\tresult = false;\n\t\t}\n\t\tif (result !== true) {\n\t\t\treturn {\n\t\t\t\tfile,\n\t\t\t\tcode: 'custom',\n\t\t\t\tdetails: {\n\t\t\t\t\tcustomMessage: typeof result === 'string' && result.length > 0\n\t\t\t\t\t\t? result\n\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction toErrorMap(rejections: FileRejection[]) {\n\treturn Object.fromEntries(rejections.map((rejection) => [rejection.file.name, rejection]));\n}\n\nexport function useFiles(rules?: FileValidationRules): UseFilesReturn {\n\tconst [files, setFilesState] = useState<FileMeta[]>([]);\n\tconst filesRef = useRef<FileMeta[]>([]);\n\tconst [rejections, setRejections] = useState<FileRejection[]>([]);\n\n\tconst formatSize = useCallback(defaultFormatSize, []);\n\n\tconst processFiles = useCallback((incoming: FileList | File[], replace: boolean) => {\n\t\tconst incomingFiles = Array.isArray(incoming) ? incoming : Array.from(incoming);\n\t\tconst previousFiles = filesRef.current;\n\t\tlet nextFiles = replace ? [] : [...previousFiles];\n\t\tconst fingerprints = new Set(nextFiles.map((meta) => getFingerprint(meta.file)));\n\t\tconst accepted: FileMeta[] = [];\n\t\tconst nextRejections: FileRejection[] = [];\n\n\t\tfor (const file of incomingFiles) {\n\t\t\tconst fingerprint = getFingerprint(file);\n\t\t\tif (fingerprints.has(fingerprint)) {\n\t\t\t\tnextRejections.push({ file, code: 'duplicate', details: {} });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst rejection = validateFile(file, rules);\n\t\t\tif (rejection) {\n\t\t\t\tnextRejections.push(rejection);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (rules?.maxFiles !== undefined && nextFiles.length >= rules.maxFiles) {\n\t\t\t\tnextRejections.push({\n\t\t\t\t\tfile,\n\t\t\t\t\tcode: 'too-many',\n\t\t\t\t\tdetails: { maximumFiles: rules.maxFiles },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst meta = createMeta(file);\n\t\t\taccepted.push(meta);\n\t\t\tnextFiles.push(meta);\n\t\t\tfingerprints.add(fingerprint);\n\t\t}\n\t\tif (replace && accepted.length === 0 && nextRejections.length > 0) {\n\t\t\tnextFiles = previousFiles;\n\t\t}\n\n\t\tfilesRef.current = nextFiles;\n\t\tsetFilesState(nextFiles);\n\t\tsetRejections(nextRejections);\n\t\treturn { accepted, files: nextFiles, rejections: nextRejections };\n\t}, [rules]);\n\n\tconst addFiles = useCallback(\n\t\t(incoming: FileList | File[]) => processFiles(incoming, false),\n\t\t[processFiles],\n\t);\n\tconst setFiles = useCallback(\n\t\t(incoming: FileList | File[]) => processFiles(incoming, true),\n\t\t[processFiles],\n\t);\n\tconst remove = useCallback((id: string) => {\n\t\tconst nextFiles = filesRef.current.filter((file) => file.id !== id);\n\t\tfilesRef.current = nextFiles;\n\t\tsetFilesState(nextFiles);\n\t}, []);\n\tconst removeAll = useCallback(() => {\n\t\tfilesRef.current = [];\n\t\tsetFilesState([]);\n\t\tsetRejections([]);\n\t}, []);\n\n\treturn {\n\t\tfiles,\n\t\taddFiles,\n\t\tsetFiles,\n\t\tremove,\n\t\tremoveAll,\n\t\tformatSize,\n\t\tvalidationErrors: toErrorMap(rejections),\n\t\trejections,\n\t};\n}\n","/**\n * ImageUpload — preview-first image picker. Drops in a file → renders an img\n * preview with a configurable aspect ratio and fit mode. Layout can be\n * stacked (preview on top, controls below) or inline (preview alongside\n * controls). Reflects controlled `value` and reports change via `onValueChange`.\n * Strings overridable for i18n.\n */\nimport { ImageIcon } from 'lucide-react';\nimport React, { useEffect, useId, useMemo, useRef, useState, useCallback } from 'react';\nimport { Button } from '../buttons';\nimport { Text } from '../../typography';\nimport { useFiles, type FileRejection } from '../../../hooks/use-files';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { useFileDropTarget } from './use-file-drop-target';\nimport { uploadDropTargetRecipes } from './upload.recipes';\n\nconst MAX_FILE_SIZE_MB = 2;\n\ntype ImageUploadAspectRatio = 'square' | 'standard' | 'widescreen' | 'portrait';\ntype ImageUploadLayout = 'stacked' | 'inline';\ntype ImageUploadFit = 'cover' | 'contain';\n\nconst ASPECT_RATIO_CLASSES: Record<ImageUploadAspectRatio, string> = {\n\t\tsquare: 'aspect-square',\n\t\tstandard: 'aspect-[4/3]',\n\t\twidescreen: 'aspect-[16/9]',\n\t\tportrait: 'aspect-[9/16]',\n};\n\nexport interface ImageUploadStrings {\n\t\tselect: string;\n\t\tchange: string;\n\t\tremove: string;\n\t\tnoSelection: string;\n\t\tkeepCurrent: string;\n\t/** Accessible description for an existing preview without a selected file name. */\n\tpreviewAlt?: string;\n\t\t/** Template for the supports-text. `{ext}` is the comma-separated allowed\n\t\t * extensions; `{size}` is the max-size MB number. */\n\t\tsupportsTemplate: string;\n\tinvalidType: (fileName: string, extension: string) => string;\n\ttooSmall: (fileName: string, minimum: string) => string;\n\ttooLarge: (fileName: string, maximum: string) => string;\n\ttooMany: (fileName: string, maximum: number) => string;\n\tduplicate: (fileName: string) => string;\n\tcustomValidationFailed: (fileName: string) => string;\n\t\t/** Summary line when `multiple` is set and more than one file is selected.\n\t\t * Receives the count of files beyond the displayed one — e.g. `count=3`\n\t\t * for \"+ 3 more files\". Override to swap the English plural-`s` rule\n\t\t * (`'+ ' + count + ' more file' + (count === 1 ? '' : 's')`) for the\n\t\t * consumer locale. */\n\t\tmoreFiles: (count: number) => string;\n}\n\nexport const defaultImageUploadStrings: ImageUploadStrings = {\n\t\tselect: 'Select image',\n\t\tchange: 'Change image',\n\t\tremove: 'Remove',\n\t\tnoSelection: 'No file selected yet.',\n\t\tkeepCurrent: 'Current image stays until you upload a new one.',\n\tpreviewAlt: 'Selected image',\n\t\tsupportsTemplate: 'Supports {ext} files up to {size} MB.',\n\tinvalidType: (fileName, extension) => `${fileName} uses an unsupported .${extension || 'unknown'} file type.`,\n\ttooSmall: (fileName, minimum) => `${fileName} is smaller than ${minimum}.`,\n\ttooLarge: (fileName, maximum) => `${fileName} is larger than ${maximum}.`,\n\ttooMany: (fileName, maximum) => `${fileName} exceeds the limit of ${maximum} images.`,\n\tduplicate: (fileName) => `${fileName} is already selected.`,\n\tcustomValidationFailed: (fileName) => `${fileName} did not pass validation.`,\n\t\tmoreFiles: (count) => `+ ${count} more file${count === 1 ? '' : 's'}`,\n};\n\nfunction getImageUploadRejectionMessage(\n\trejection: FileRejection,\n\tstrings: ImageUploadStrings,\n\tformatSize: (bytes: number) => string,\n) {\n\tconst { file, code, details } = rejection;\n\tswitch (code) {\n\t\tcase 'invalid-type':\n\t\t\treturn strings.invalidType(file.name, details.extension ?? '');\n\t\tcase 'too-small':\n\t\t\treturn strings.tooSmall(file.name, formatSize(details.minimumBytes ?? 0));\n\t\tcase 'too-large':\n\t\t\treturn strings.tooLarge(file.name, formatSize(details.maximumBytes ?? 0));\n\t\tcase 'too-many':\n\t\t\treturn strings.tooMany(file.name, details.maximumFiles ?? 1);\n\t\tcase 'duplicate':\n\t\t\treturn strings.duplicate(file.name);\n\t\tcase 'custom':\n\t\t\treturn details.customMessage ?? strings.customValidationFailed(file.name);\n\t}\n}\n\nexport interface ImageUploadProps {\n\t\t/** Accepted MIME types or extensions, as the native `accept` attribute. */\n\t\taccept?: string;\n\t\t/** Allows more than one file to be chosen. */\n\t\tmultiple?: boolean;\n\t\t/** Selected files. Controlled. */\n\t\tvalue?: File;\n\t\tonValueChange?: (file?: File) => void;\n\t\t/** Disables the control and blocks drops. */\n\t\tdisabled?: boolean;\n\t\t/** Image shown before anything is chosen — an existing upload. */\n\t\tinitialPreviewUrl?: string;\n\t\t/** Aspect ratio the preview is cropped to. */\n\t\taspectRatio?: ImageUploadAspectRatio;\n\t\t/** How the preview fills its frame — cover or contain. */\n\t\tfit?: ImageUploadFit;\n\t\t/** Caps the preview's width. */\n\t\tmaxWidth?: number | string;\n\t\t/** Arrangement of the preview and drop target. */\n\t\tlayout?: ImageUploadLayout;\n\t\t/** Applies the invalid styling. */\n\t\tinvalid?: boolean;\n\t\t/** Override default strings (button labels, helper text, supports template). */\n\t\tstrings?: StringsProp<ImageUploadStrings>;\n}\n\nfunction ImageUploadImpl(\n\t\t{\n\t\taccept = '.png,.jpg,.jpeg,.gif,.svg',\n\t\tmultiple = false,\n\t\tvalue,\n\t\tonValueChange,\n\t\tdisabled,\n\t\tinitialPreviewUrl,\n\t\taspectRatio = 'square',\n\t\tfit = 'cover',\n\t\tmaxWidth,\n\t\tlayout = 'stacked',\n\t\tinvalid,\n\t\tstrings: stringsProp,\n}: ImageUploadProps,\n\t\tforwardedRef: React.ForwardedRef<HTMLInputElement>,\n) {\n\t\tconst strings = useStrings(defaultImageUploadStrings, stringsProp);\n\t\tconst inputId = useId();\n\t\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\n\t\tconst allowedExtensions = useMemo(() => {\n\t\t\t\tif (!accept) {\n\t\t\t\t\t\treturn ['png', 'jpg', 'jpeg', 'gif', 'svg'];\n\t\t\t\t}\n\n\t\t\t\tconst parsed = accept\n\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t.map((item) => item.trim())\n\t\t\t\t\t\t.map((item) => {\n\t\t\t\t\t\t\t\tif (!item) return null;\n\t\t\t\t\t\t\t\tif (item.startsWith('.')) {\n\t\t\t\t\t\t\t\t\t\treturn item.slice(1).toLowerCase();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (item.includes('/')) {\n\t\t\t\t\t\t\t\t\t\tconst subtype = item.split('/')[1] ?? '';\n\t\t\t\t\t\t\t\t\t\tif (subtype === '*' || subtype.length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn subtype.replace(/\\+.*/, '').toLowerCase();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn item.toLowerCase();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((ext): ext is string => Boolean(ext));\n\n\t\t\t\tif (parsed.length === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn Array.from(new Set(parsed));\n\t\t}, [accept]);\n\n\t\tconst fileRules = useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\t\tmaxFiles: multiple ? undefined : 1,\n\t\t\tmaxSize: MAX_FILE_SIZE_MB * 1024 * 1024,\n\t\t\t\t\t\tallowedExtensions,\n\t\t\t\t}),\n\t\t\t\t[multiple, allowedExtensions]\n\t\t);\n\n\t\tconst { files, setFiles, remove, removeAll, formatSize, rejections } = useFiles(fileRules);\n\n\t\t// Reflect controlled value into local preview if provided\n\t\tuseEffect(() => {\n\t\t\t\tif (value) {\n\t\t\t\t\t\tsetFiles([value]);\n\t\t\t\t} else {\n\t\t\t\t\t\tremoveAll();\n\t\t\t\t\t\tif (inputRef.current) {\n\t\t\t\t\t\t\t\tinputRef.current.value = '';\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}, [value, setFiles, removeAll]);\n\n\t\tconst selected = files[0];\n\tconst selectOrChangeButtonLabel = selected ? strings.change : strings.select;\n\t\tconst [filePreviewUrl, setFilePreviewUrl] = useState<string | undefined>(undefined);\n\n\t\tconst acceptedExtensionsLabel = useMemo(() => {\n\t\t\t\tif (!allowedExtensions || allowedExtensions.length === 0) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn allowedExtensions.map((ext) => ext.toUpperCase()).join(', ');\n\t\t}, [allowedExtensions]);\n\n\t\tuseEffect(() => {\n\t\t\t\tconst file = selected?.file ?? value;\n\t\t\t\tif (!file) {\n\t\t\t\t\t\tsetFilePreviewUrl(undefined);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst url = URL.createObjectURL(file);\n\t\t\t\tsetFilePreviewUrl(url);\n\t\t\t\treturn () => URL.revokeObjectURL(url);\n\t\t}, [selected, value]);\n\n\t\tconst previewUrl = filePreviewUrl ?? initialPreviewUrl;\n\t\tconst hasPreview = Boolean(previewUrl);\n\tconst previewAlt = selected?.name ?? strings.previewAlt ?? defaultImageUploadStrings.previewAlt;\n\t\tconst aspectClass = ASPECT_RATIO_CLASSES[aspectRatio] ?? ASPECT_RATIO_CLASSES.square;\n\t\tconst imgFitClass = fit === 'contain' ? 'object-contain p-space-sm' : 'object-cover';\n\t\t// Default max-width caps the preview at a sensible thumbnail size — without\n\t\t// this, an `aspect-square` preview inside a wide form column becomes a\n\t\t// huge square (`w-full` × 1:1 ratio = container width tall). Consumers\n\t\t// can override via the `maxWidth` prop.\n\t\tconst computedMaxWidth = maxWidth ? (typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth) : '240px';\n\t\tconst wrapperStyle = layout === 'inline' ? undefined : { maxWidth: computedMaxWidth };\n\t\tconst inlinePreviewStyle =\n\t\t\t\tlayout === 'inline'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tmaxWidth: maxWidth ? computedMaxWidth : '185px',\n\t\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined;\n\n\t\tconst handleFiles = useCallback((incoming: File[]) => {\n\t\t\tif (disabled || incoming.length === 0) return;\n\t\t\tconst result = setFiles(incoming);\n\t\t\tconst acceptedFile = result.accepted[0]?.file;\n\t\t\tif (acceptedFile) onValueChange?.(acceptedFile);\n\t\t}, [disabled, setFiles, onValueChange]);\n\t\tconst handleInput = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\thandleFiles(Array.from(event.target.files ?? []));\n\t\t}, [handleFiles]);\n\t\tconst { isDragging, dropTargetProps } = useFileDropTarget({ disabled, onFiles: handleFiles });\n\n\t\tconst triggerFileDialog = useCallback(() => {\n\t\t\t\tif (disabled) return;\n\t\t\t\tinputRef.current?.click();\n\t\t}, [disabled]);\n\n\t\tconst handleRemove = useCallback(() => {\n\t\t\t\tif (selected) {\n\t\t\t\t\t\tremove(selected.id);\n\t\t\t\t}\n\t\t\t\tonValueChange?.(undefined);\n\t\t\t\tif (inputRef.current) {\n\t\t\t\t\t\tinputRef.current.value = '';\n\t\t\t\t}\n\t\t}, [selected, remove, onValueChange]);\n\n\t\treturn (\n\t\t\t\t<div className={cn('image-upload--component', 'grid gap-space-md')} style={wrapperStyle}>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tref={(node) => { inputRef.current = node; if (typeof forwardedRef === \"function\") forwardedRef(node); else if (forwardedRef) forwardedRef.current = node; }}\n\t\t\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\t\t\tclassName=\"sr-only\"\n\t\t\t\t\t\t\t\t// The visible button is the keyboard affordance; an invisible\n\t\t\t\t\t\t\t\t// second Tab stop would have no focus indicator.\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\taria-label={selectOrChangeButtonLabel}\n\t\t\t\t\t\t\t\taccept={accept}\n\t\t\t\t\t\t\t\tmultiple={multiple}\n\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\tonChange={handleInput}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className={cn(layout === 'inline' ? 'flex flex-wrap items-start gap-space-xl' : 'grid gap-space-md')}>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t{...dropTargetProps}\n\t\t\t\t\t\t\t\t\t\tdata-dragging={isDragging || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'relative overflow-hidden rounded-radius border transition-colors',\n\t\t\t\t\t\t\t\t\t\t\t\tlayout === 'inline' ? 'flex-shrink-0 w-full' : 'w-full',\n\t\t\t\t\t\t\t\t\t\t\t\taspectClass,\n\t\t\t\t\t\t\t\t\t\t\t\thasPreview\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'border-border bg-muted'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Same dashed control boundary as Dropzone and AvatarUpload.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'border-dashed bg-background text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tuploadDropTargetRecipes.idle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tinvalid && uploadDropTargetRecipes.invalid,\n\t\t\t\t\t\t\t\t\t\t\t\t!disabled && isDragging && uploadDropTargetRecipes.dragging\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\tstyle={inlinePreviewStyle}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{hasPreview && previewUrl ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc={previewUrl}\n\t\t\t\t\t\t\t\t\t\t\t\talt={previewAlt}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn('absolute inset-0 box-border h-full w-full', imgFitClass)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"absolute inset-0 flex items-center justify-center\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ImageIcon aria-hidden className=\"size-icon-lg\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div className={cn('grid gap-space-sm', layout === 'inline' && 'flex-1 min-w-0 basis-40')}>\n\t\t\t\t\t\t\t\t\t\t<div className=\"flex flex-wrap items-center gap-space-md\">\n\t <Button\n\t type=\"button\"\n\t tone=\"secondary\"\n\t buttonStyle=\"outline\"\n\t onClick={triggerFileDialog}\n\t disabled={disabled}\n\t >\n\t {selectOrChangeButtonLabel}\n\t </Button>\n\t\t\t\t\t\t\t\t\t\t\t\t{!selected && !!hasPreview && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">{strings.keepCurrent}</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t{!!acceptedExtensionsLabel && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{strings.supportsTemplate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace('{ext}', acceptedExtensionsLabel)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace('{size}', String(MAX_FILE_SIZE_MB))}\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t\t\t{!!selected && (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"grid gap-space-2xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text weight=\"medium\" title={selected.name} className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{selected.name}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{selected.formattedSize}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{!!multiple && files.length > 1 && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{strings.moreFiles(files.length - 1)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={handleRemove}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"justify-self-start\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{strings.remove}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t\t\t{!selected && !hasPreview && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">{strings.noSelection}</Text>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{/* Validation errors */}\n\t\t\t\t\t\t{rejections.length > 0 && (\n\t\t\t\t\t\t\t\t<div className=\"image-upload--errors grid gap-space-2xs\" role=\"alert\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t\t{rejections.map((rejection, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<Text key={`${rejection.file.name}-${rejection.code}-${index}`} size=\"xs\" type=\"error\">\n\t\t\t\t\t\t\t{getImageUploadRejectionMessage(rejection, strings, formatSize)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t);\n}\n\nconst ImageUpload = React.forwardRef<HTMLInputElement, ImageUploadProps>(ImageUploadImpl);\nImageUpload.displayName = 'ImageUpload';\n\nexport { ImageUpload };\n","import * as React from 'react';\n/**\n * AvatarUpload — round avatar picker. Click or drag a file onto the circle to\n * upload; an X button (visible on hover) clears the selection. Honours\n * controlled `value` (a `File`), and reflects an existing `initialPreviewUrl`\n * when no file is staged. Use for profile photos / org logos where the\n * preview is small and the only meaningful interaction is replace + clear.\n *\n * Pair with a separate \"remove from server\" handler if your data model\n * needs to delete a previously persisted image (this component only manages\n * the local staged file).\n *\n * Strings overridable for i18n.\n */\nimport { useCallback, useEffect, useId, useMemo, useRef, useState} from 'react';\nimport type { ChangeEvent, ForwardedRef} from 'react';\nimport { Camera, X } from 'lucide-react';\nimport { Text } from '../../typography';\nimport { useFiles, type FileRejection } from '../../../hooks/use-files';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport { fieldAffordanceRecipes } from '../../../lib/field-affordance-recipes';\nimport { useFileDropTarget } from './use-file-drop-target';\nimport { uploadDropTargetRecipes } from './upload.recipes';\n\nexport type AvatarUploadSize = ComponentScale;\n\nexport interface AvatarUploadStrings {\n\tchange: string;\n\tremove: string;\n\thint: string;\n\tdragOver: string;\n\tinvalidType: (fileName: string, extension: string) => string;\n\ttooSmall: (fileName: string, minimum: string) => string;\n\ttooLarge: (fileName: string, maximum: string) => string;\n\ttooMany: (fileName: string, maximum: number) => string;\n\tduplicate: (fileName: string) => string;\n\tcustomValidationFailed: (fileName: string) => string;\n}\n\nexport const defaultAvatarUploadStrings: AvatarUploadStrings = {\n\tchange: 'Change photo',\n\tremove: 'Remove photo',\n\thint: 'Click or drop an image',\n\tdragOver: 'Drop image to upload',\n\tinvalidType: (fileName, extension) => `${fileName} uses an unsupported .${extension || 'unknown'} file type.`,\n\ttooSmall: (fileName, minimum) => `${fileName} is smaller than ${minimum}.`,\n\ttooLarge: (fileName, maximum) => `${fileName} is larger than ${maximum}.`,\n\ttooMany: (fileName, maximum) => `${fileName} exceeds the limit of ${maximum} images.`,\n\tduplicate: (fileName) => `${fileName} is already selected.`,\n\tcustomValidationFailed: (fileName) => `${fileName} did not pass validation.`,\n};\n\nfunction getAvatarUploadRejectionMessage(\n\trejection: FileRejection,\n\tstrings: AvatarUploadStrings,\n\tformatSize: (bytes: number) => string,\n) {\n\tconst { file, code, details } = rejection;\n\tswitch (code) {\n\t\tcase 'invalid-type':\n\t\t\treturn strings.invalidType(file.name, details.extension ?? '');\n\t\tcase 'too-small':\n\t\t\treturn strings.tooSmall(file.name, formatSize(details.minimumBytes ?? 0));\n\t\tcase 'too-large':\n\t\t\treturn strings.tooLarge(file.name, formatSize(details.maximumBytes ?? 0));\n\t\tcase 'too-many':\n\t\t\treturn strings.tooMany(file.name, details.maximumFiles ?? 1);\n\t\tcase 'duplicate':\n\t\t\treturn strings.duplicate(file.name);\n\t\tcase 'custom':\n\t\t\treturn details.customMessage ?? strings.customValidationFailed(file.name);\n\t}\n}\n\nexport interface AvatarUploadProps {\n\t/** Selected file. Controlled. */\n\tvalue?: File;\n\tonValueChange?: (file?: File) => void;\n\t/** Image shown before anything is chosen — an existing avatar. */\n\tinitialPreviewUrl?: string;\n\t/** Accepted MIME types or extensions. */\n\taccept?: string;\n\t/** Disables the control and blocks drops. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\t/** Diameter preset for the avatar. */\n\tsize?: AvatarUploadSize;\n\tclassName?: string;\n\t/** Overrides the upload and remove copy. */\n\tstrings?: StringsProp<AvatarUploadStrings>;\n\t/** Initials shown when no preview is available. */\n\tinitials?: string;\n}\n\nconst SIZE_PX: Record<AvatarUploadSize, { box: string; icon: string; remove: string }> = {\n\tsm: { box: 'size-upload-avatar-small', icon: 'size-icon', remove: 'size-control-clear' },\n\tmd: { box: 'size-upload-avatar', icon: 'size-icon-lg', remove: 'size-action' },\n\tlg: { box: 'size-upload-avatar-large', icon: 'size-icon-lg', remove: 'size-action-lg' },\n};\n\nfunction AvatarUploadImpl(\n\t{\n\tvalue,\n\tonValueChange,\n\tinitialPreviewUrl,\n\taccept = '.png,.jpg,.jpeg,.gif,.webp',\n\tdisabled = false,\n\tinvalid = false,\n\tsize: sizeProp,\n\tclassName,\n\tstrings: stringsProp,\n\tinitials,\n}: AvatarUploadProps,\n\tforwardedRef: ForwardedRef<HTMLInputElement>,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst strings = useStrings(defaultAvatarUploadStrings, stringsProp);\n\tconst inputId = useId();\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst sizes = SIZE_PX[size];\n\n\tconst { files, setFiles, removeAll, formatSize, rejections } = useFiles({\n\t\tmaxFiles: 1,\n\t\tallowedExtensions: useMemo(\n\t\t\t() =>\n\t\t\t\taccept\n\t\t\t\t\t.split(',')\n\t\t\t\t\t.map((s) => s.trim().replace(/^\\./, '').toLowerCase())\n\t\t\t\t\t.filter(Boolean),\n\t\t\t[accept],\n\t\t),\n\t});\n\n\tuseEffect(() => {\n\t\tif (value) setFiles([value]);\n\t\telse removeAll();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [value]);\n\n\tconst selected = files[0];\n\tconst [filePreviewUrl, setFilePreviewUrl] = useState<string | undefined>(undefined);\n\n\tuseEffect(() => {\n\t\tconst file = selected?.file ?? value;\n\t\tif (!file) {\n\t\t\tsetFilePreviewUrl(undefined);\n\t\t\treturn;\n\t\t}\n\t\tconst url = URL.createObjectURL(file);\n\t\tsetFilePreviewUrl(url);\n\t\treturn () => URL.revokeObjectURL(url);\n\t}, [selected, value]);\n\n\tconst previewUrl = filePreviewUrl ?? initialPreviewUrl;\n\tconst hasPreview = Boolean(previewUrl);\n\n\tconst handleInput = useCallback(\n\t\t(e: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst list = e.target.files;\n\t\t\tif (!list || list.length === 0) return;\n\t\t\tconst result = setFiles(list);\n\t\t\tconst acceptedFile = result.accepted[0]?.file;\n\t\t\tif (acceptedFile) onValueChange?.(acceptedFile);\n\t\t\tif (inputRef.current) inputRef.current.value = '';\n\t\t},\n\t\t[onValueChange, setFiles],\n\t);\n\n\tconst handleRemove = useCallback(() => {\n\t\tremoveAll();\n\t\tonValueChange?.(undefined);\n\t\tif (inputRef.current) inputRef.current.value = '';\n\t}, [onValueChange, removeAll]);\n\n\tconst handleFiles = useCallback((incoming: File[]) => {\n\t\tconst result = setFiles(incoming);\n\t\tconst acceptedFile = result.accepted[0]?.file;\n\t\tif (acceptedFile) onValueChange?.(acceptedFile);\n\t}, [onValueChange, setFiles]);\n\tconst { isDragging, dropTargetProps } = useFileDropTarget({ disabled, onFiles: handleFiles });\n\n\treturn (\n\t\t// Intrinsic width, aligned to the field's start edge even inside a stretching stack.\n\t\t<div className={cn('avatar-upload--component', 'inline-flex w-fit flex-col items-center gap-space-md self-start', className)}>\n\t\t\t<div\n\t\t\t\t{...dropTargetProps}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'group relative flex shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t'border transition-colors duration-150 outline-none',\n\t\t\t\t\t// Keyboard focus only: a pointer click on the file input draws no ring.\n\t\t\t\t\t'has-[input:focus-visible]:ring-3',\n\t\t\t\t\thasPreview\n\t\t\t\t\t\t? 'border-border bg-muted'\n\t\t\t\t\t\t: cn(\n\t\t\t\t\t\t\t\t// The empty drop target shares the upload family's dashed control boundary.\n\t\t\t\t\t\t\t\t'border-dashed bg-muted',\n\t\t\t\t\t\t\t\t!disabled && uploadDropTargetRecipes.hover,\n\t\t\t\t\t\t\t\tuploadDropTargetRecipes.idle,\n\t\t\t\t\t\t\t),\n\t\t\t\t\tinvalid ? cn(uploadDropTargetRecipes.invalid, uploadDropTargetRecipes.focus.input.invalid) : uploadDropTargetRecipes.focus.input.valid,\n\t\t\t\t\tdisabled && 'cursor-not-allowed opacity-50',\n\t\t\t\t\t!disabled && isDragging && uploadDropTargetRecipes.dragging,\n\t\t\t\t\tsizes.box,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tref={(node) => { inputRef.current = node; if (typeof forwardedRef === \"function\") forwardedRef(node); else if (forwardedRef) forwardedRef.current = node; }}\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tclassName=\"absolute inset-0 z-10 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n\t\t\t\t\taria-label={strings.change}\n\t\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\t\taccept={accept}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonChange={handleInput}\n\t\t\t\t/>\n\n\t\t\t\t{/* Only the visual preview is circularly clipped; removal and focus\n\t\t\t\t remain outside that clip as space and density scale independently. */}\n\t\t\t\t<div className=\"pointer-events-none absolute inset-0 flex items-center justify-center overflow-hidden rounded-full\">\n\t\t\t\t\t{hasPreview && previewUrl ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={previewUrl}\n\t\t\t\t\t\t\talt={strings.change}\n\t\t\t\t\t\t\tclassName=\"absolute inset-0 size-full object-cover\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : initials ? (\n\t\t\t\t\t\t<Text size={size === 'sm' ? 'sm' : size === 'lg' ? 'lg' : 'base'} weight=\"medium\" lineHeight=\"none\">\n\t\t\t\t\t\t\t{initials}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Camera className={cn(sizes.icon, 'text-muted-foreground')} aria-hidden=\"true\" />\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Hover overlay: a plain inverse scrim, dark in both themes, keeps the\n\t\t\t\t\t glyph legible over any photo without blurring it. */}\n\t\t\t\t\t{!disabled && hasPreview && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"absolute inset-0 hidden items-center justify-center bg-inverse-background/60 text-inverse-foreground group-hover:flex\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Camera className={sizes.icon} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t{/* Remove pill */}\n\t\t\t\t{!disabled && hasPreview && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\thandleRemove();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\tfieldAffordanceRecipes.target,\n\t\t\t\t\t\t\tfieldAffordanceRecipes.focus,\n\t\t\t\t\t\t\t'absolute end-0.5 top-0.5 z-10 bg-card text-card-foreground shadow-sm ring-1 ring-border',\n\t\t\t\t\t\t\t'opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100',\n\t\t\t\t\t\t\tsizes.remove,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<X className={fieldAffordanceRecipes.icon} />\n\t\t\t\t\t</button>\n\t\t\t\t)}\n\n\t\t\t\t{!disabled && !hasPreview && isDragging && (\n\t\t\t\t\t<Text size=\"xs\" weight=\"medium\" className=\"absolute inset-x-0 bottom-1.5 text-center text-primary-accent\">\n\t\t\t\t\t\t{strings.dragOver}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{!hasPreview && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.hint}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{rejections.length > 0 && (\n\t\t\t\t<div className=\"avatar-upload--errors grid gap-space-2xs\" role=\"alert\" aria-live=\"polite\">\n\t\t\t\t\t{rejections.map((rejection, index) => (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tkey={`${rejection.file.name}-${rejection.code}-${index}`}\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\ttype=\"error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getAvatarUploadRejectionMessage(rejection, strings, formatSize)}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nconst AvatarUpload = React.forwardRef<HTMLInputElement, AvatarUploadProps>(AvatarUploadImpl);\nAvatarUpload.displayName = 'AvatarUpload';\n\nexport { AvatarUpload };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAa2B,IAA8C;C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Aa;MACd;MACA,WAAWlH,EACVQ,EAAuB,QACvBA,EAAuB,OACvB,2FACA,mIACA2L,EAAM,MACP;MAEA,UAAA,kBAACK,IAAD,EAAG,WAAWhM,EAAuB,KAAO,CAAA;KACrC,CAAA;KAGR,CAACuG,KAAY,CAAC6D,KAAcnD,KAC5B,kBAACvH,GAAD;MAAM,MAAK;MAAK,QAAO;MAAS,WAAU;MACxC,UAAAkC,EAAQ;KACJ,CAAA;IAEH;;GAEJ,CAACwI,KACD,kBAAC1K,GAAD;IAAM,MAAK;IAAK,MAAK;IACnB,UAAAkC,EAAQ;GACJ,CAAA;GAENY,GAAW,SAAS,KACpB,kBAAC,OAAD;IAAK,WAAU;IAA2C,MAAK;IAAQ,aAAU;IAC/E,UAAAA,GAAW,KAAK,GAAW,MAC3B,kBAAC9C,GAAD;KAEC,MAAK;KACL,MAAK;KAEJ,UAAA8L,GAAgCrE,GAAWvF,GAASE,EAAU;IAC1D,GALA,GAAGqF,EAAU,KAAK,KAAK,GAAGA,EAAU,KAAK,GAAGjE,GAK5C,CACN;GACG,CAAA;EAEF;;AAEP;AAEA,IAAM+I,KAAe7M,EAAM,WAAgDsM,CAAgB;AAC3F,GAAa,cAAc"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { s as e, v as t } from "./ui-provider-1D_NSYzO.js";
2
+ import { s as e, v as t } from "./ui-provider-C_U0Xma4.js";
3
3
  import { useStrings as n } from "./lib/strings.js";
4
- import { t as r } from "./utils-l5LpDw2z.js";
5
- import { n as i } from "./buttons-SbIcm1HJ.js";
6
- import { s as a } from "./typography-DTRkE9zL.js";
7
- import { t as o } from "./structure-DC2dygdA.js";
8
- import { g as s, i as c } from "./primitives-B-CkiEMU.js";
9
- import { t as l } from "./badge-MrKVNzW9.js";
4
+ import { t as r } from "./utils-BRhFDwuU.js";
5
+ import { n as i } from "./buttons-DPZekJFu.js";
6
+ import { c as a } from "./typography-UTnveOEy.js";
7
+ import { t as o } from "./structure-BmisBK-3.js";
8
+ import { g as s, i as c } from "./primitives-BFK08r9M.js";
9
+ import { t as l } from "./badge-HpFqoqSY.js";
10
10
  import { n as u, t as d } from "./upload.recipes-BbxTqrCT.js";
11
- import { a as f, c as p, i as m, n as h, o as g, r as _, s as v, t as y } from "./attachment-BtfhGm8i.js";
11
+ import { a as f, c as p, i as m, n as h, o as g, r as _, s as v, t as y } from "./attachment-BxDfL2mw.js";
12
12
  import { forwardRef as b, useCallback as x, useId as S } from "react";
13
13
  import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
14
14
  import { AlertCircle as E, Check as D, Clock as O, Download as k, Eye as A, RefreshCw as j, UploadCloud as M, X as N } from "lucide-react";
@@ -191,6 +191,7 @@ function H({ items: e, onPreview: t, onDownload: l, onCancel: u, onRetry: d, onR
191
191
  title: e.name,
192
192
  children: /* @__PURE__ */ w(a, {
193
193
  tag: "span",
194
+ type: "inherit",
194
195
  weight: "medium",
195
196
  className: "truncate",
196
197
  children: e.name
@@ -344,6 +345,7 @@ var G = b(function({ items: e, onAddFiles: t, onPreview: s, onDownload: c, onCan
344
345
  children: [
345
346
  /* @__PURE__ */ w(a, {
346
347
  tag: "span",
348
+ type: "inherit",
347
349
  weight: "semibold",
348
350
  children: y.heading
349
351
  }),
@@ -402,4 +404,4 @@ G.displayName = "UploadTray";
402
404
  //#endregion
403
405
  export { z as a, B as i, U as n, F as o, H as r, P as s, G as t };
404
406
 
405
- //# sourceMappingURL=upload-queue-EOC8g1gf.js.map
407
+ //# sourceMappingURL=upload-queue-Boscubn9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-queue-Boscubn9.js","names":["_Fragment","useDensityConfig","resolveComponentScale","cn","Button","Text","Stack","SecondaryValue","FileSize","Badge","useFileDropTarget","uploadDropTargetRecipes","AttachmentFileIcon","AttachmentTitle","AttachmentDescription","AttachmentActions","AttachmentMedia","AttachmentContent","AttachmentProgress","Attachment","Fragment$1","FilePickerInput","forwardRef","props","handleClick","event","onClick","handleChange","files","onFiles","className","defaultDropzoneStrings","SIZE_CHROME","assignInputRef","forwardedRef","node","DropzoneImpl","sizeProp","stringsProp","strings","useStrings","generatedId","useId","inputId","inputProps","onDrop","chrome","defaultScale","dropTargetProps","disabled","invalid","isDragging","icon","UploadCloud","children","Dropzone","defaultUploadProgressListStrings","STATUS_TONE","Clock","Check","AlertCircle","X","UploadProgressList","statusLabel","items","tone","item","Icon","pct","showProgress","onPreview","Eye","onDownload","Download","onCancel","onRetry","RefreshCw","onRemove","defaultUploadTrayStrings","countStatus","completed","failed","uploading","queued","UploadTray","handleDrop","useCallback","onAddFiles","hasItems","dropzone","onClearAll","listStrings"],"sources":["../src/components/base/upload/file-picker-input.tsx","../src/components/base/upload/dropzone.tsx","../src/components/base/upload-queue/upload-progress-list.tsx","../src/components/base/upload-queue/upload-tray.tsx"],"sourcesContent":["import {\n\tforwardRef,\n\ttype ChangeEvent,\n\ttype InputHTMLAttributes,\n\ttype MouseEvent,\n} from 'react';\n\nimport { cn } from '../../../lib/utils';\n\ntype DataAttributes = {\n\t[key: `data-${string}`]: string | number | boolean | undefined;\n};\n\nexport type FilePickerNativeInputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t'type' | 'value' | 'defaultValue' | 'onChange' | 'children'\n> & DataAttributes;\n\nexport type FilePickerInputProps = FilePickerNativeInputProps & {\n\t/** Return `false` when the native FileList must be cleared (for example, after rejection). */\n\tonFiles: (files: File[]) => boolean | void;\n};\n\n/** Shared native-input plumbing for FileUpload and Dropzone. Not a public export. */\nexport const FilePickerInput = forwardRef<HTMLInputElement, FilePickerInputProps>(\n\tfunction FilePickerInput(\n\t\t{ className, onFiles, onClick, ...props },\n\t\tref,\n\t) {\n\t\tconst handleClick = (event: MouseEvent<HTMLInputElement>) => {\n\t\t\tevent.stopPropagation();\n\t\t\tonClick?.(event);\n\t\t\tif (!event.defaultPrevented) {\n\t\t\t\t// Clearing before the picker opens makes choosing the same file again\n\t\t\t\t// observable without retaining an opaque native FileList as state.\n\t\t\t\tevent.currentTarget.value = '';\n\t\t\t}\n\t\t};\n\n\t\tconst handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = event.currentTarget.files;\n\t\t\tif (files?.length && onFiles(Array.from(files)) === false) {\n\t\t\t\tevent.currentTarget.value = '';\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t\ttype=\"file\"\n\t\t\t\tdata-slot=\"file-picker-input\"\n\t\t\t\tclassName={cn('file-picker-input--component sr-only', className)}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nFilePickerInput.displayName = 'FilePickerInput';\n","/**\n * Dropzone — accessible drag-and-drop chrome with a native file-input fallback.\n * It owns no validation or file state; consumers receive local `File` values.\n */\nimport { forwardRef, useId, type ForwardedRef, type ReactNode } from 'react';\nimport { UploadCloud } from 'lucide-react';\n\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\n\nimport {\n\tFilePickerInput,\n\ttype FilePickerNativeInputProps,\n} from './file-picker-input';\nimport { useFileDropTarget } from './use-file-drop-target';\nimport { uploadDropTargetRecipes } from './upload.recipes';\n\nexport type DropzoneSize = ComponentScale;\n\nexport interface DropzoneStrings {\n\tinstruction: string;\n\thelper: string;\n\tdragOver: string;\n}\n\nexport const defaultDropzoneStrings: DropzoneStrings = {\n\tinstruction: 'Drag files here or click to browse',\n\thelper: '',\n\tdragOver: 'Release to select',\n};\n\nexport type DropzoneInputProps = Omit<\n\tFilePickerNativeInputProps,\n\t'accept' | 'disabled' | 'multiple'\n>;\n\nexport interface DropzoneProps {\n\tonDrop: (files: File[]) => void;\n\t/** Accepted MIME types or extensions. */\n\taccept?: string;\n\t/** Allows more than one file to be dropped. */\n\tmultiple?: boolean;\n\t/** Disables the control and blocks drops. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\t/** Height preset for the drop target. */\n\tsize?: DropzoneSize;\n\t/** Glyph shown inside the drop target. */\n\ticon?: ReactNode;\n\tclassName?: string;\n\t/** Native form, ARIA, data, and event attributes forwarded to the file input. */\n\tinputProps?: DropzoneInputProps;\n\t/** Optional action rendered outside the input label, so nested controls remain valid. */\n\tchildren?: ReactNode;\n\t/** Overrides the prompt and constraint copy. */\n\tstrings?: StringsProp<DropzoneStrings>;\n}\n\nconst SIZE_CHROME: Record<\n\tDropzoneSize,\n\t{ padding: string; minHeight: string; iconSize: string }\n> = {\n\tsm: {\n\t\tpadding: 'p-surface-xs',\n\t\tminHeight: 'min-h-24',\n\t\ticonSize: 'size-icon',\n\t},\n\tmd: {\n\t\tpadding: 'p-surface',\n\t\tminHeight: 'min-h-32',\n\t\ticonSize: 'size-icon-lg',\n\t},\n\tlg: {\n\t\tpadding: 'p-surface-lg',\n\t\tminHeight: 'min-h-40',\n\t\ticonSize: 'size-icon-lg',\n\t},\n};\n\nfunction assignInputRef(\n\tnode: HTMLInputElement | null,\n\tforwardedRef: ForwardedRef<HTMLInputElement>,\n) {\n\tif (typeof forwardedRef === 'function') forwardedRef(node);\n\telse if (forwardedRef) forwardedRef.current = node;\n}\n\nfunction DropzoneImpl(\n\t{\n\t\tonDrop,\n\t\taccept,\n\t\tmultiple = false,\n\t\tdisabled = false,\n\t\tinvalid = false,\n\t\tsize: sizeProp,\n\t\ticon,\n\t\tclassName,\n\t\tinputProps,\n\t\tchildren,\n\t\tstrings: stringsProp,\n\t}: DropzoneProps,\n\tforwardedRef: ForwardedRef<HTMLInputElement>,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst strings = useStrings(defaultDropzoneStrings, stringsProp);\n\tconst generatedId = useId();\n\tconst inputId = inputProps?.id ?? `dropzone-${generatedId}`;\n\tconst { isDragging, dropTargetProps } = useFileDropTarget({\n\t\tdisabled,\n\t\tonFiles: onDrop,\n\t});\n\tconst resolvedSize = resolveComponentScale(sizeProp, defaultScale);\n\tconst chrome = SIZE_CHROME[resolvedSize];\n\n\treturn (\n\t\t<div\n\t\t\t{...dropTargetProps}\n\t\t\tdata-disabled={disabled || undefined}\n\t\t\tdata-invalid={invalid || undefined}\n\t\t\tdata-dragging={isDragging || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'dropzone--component relative flex flex-col items-center justify-center gap-space-md rounded-radius border border-dashed text-center transition-colors duration-150',\n\t\t\t\t'has-[[data-slot=file-picker-input]:focus-visible]:ring-3',\n\t\t\t\tchrome.minHeight,\n\t\t\t\tchrome.padding,\n\t\t\t\tinvalid ? cn(uploadDropTargetRecipes.invalid, uploadDropTargetRecipes.focus.filePicker.invalid) : cn(uploadDropTargetRecipes.idle, uploadDropTargetRecipes.focus.filePicker.valid),\n\t\t\t\tinvalid\n\t\t\t\t\t? !disabled && uploadDropTargetRecipes.invalidHover\n\t\t\t\t\t: !disabled && uploadDropTargetRecipes.hover,\n\t\t\t\tdisabled && 'cursor-not-allowed opacity-50',\n\t\t\t\t!disabled && isDragging && (\n\t\t\t\t\tinvalid\n\t\t\t\t\t\t? uploadDropTargetRecipes.invalidDragging\n\t\t\t\t\t\t: uploadDropTargetRecipes.dragging\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<FilePickerInput\n\t\t\t\t{...inputProps}\n\t\t\t\tref={(node) => assignInputRef(node, forwardedRef)}\n\t\t\t\tid={inputId}\n\t\t\t\taccept={accept}\n\t\t\t\tmultiple={multiple}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\tclassName={cn('dropzone--input', inputProps?.className)}\n\t\t\t\tonFiles={onDrop}\n\t\t\t/>\n\n\t\t\t<label\n\t\t\t\thtmlFor={disabled ? undefined : inputId}\n\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'dropzone--trigger flex w-full flex-1 cursor-pointer flex-col items-center justify-center gap-space-md',\n\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{/* The glyph names the affordance; it needs no tinted tile around it. */}\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"dropzone--icon inline-flex items-center justify-center text-muted-foreground\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t{icon ?? <UploadCloud className={chrome.iconSize} />}\n\t\t\t\t</span>\n\n\t\t\t\t{/* Text sets its own start alignment, and the copy column is as wide as\n\t\t\t\t its longest line, so each line centres itself. */}\n\t\t\t\t<span className=\"dropzone--copy grid gap-normal\">\n\t\t\t\t\t<Text\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tclassName=\"dropzone--instruction\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{isDragging ? strings.dragOver : strings.instruction}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!strings.helper && (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tclassName=\"dropzone--helper\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.helper}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</label>\n\n\t\t\t{!!children && <div className=\"dropzone--action\">{children}</div>}\n\t\t</div>\n\t);\n}\n\nconst Dropzone = forwardRef<HTMLInputElement, DropzoneProps>(DropzoneImpl);\nDropzone.displayName = 'Dropzone';\n\nexport { Dropzone };\n","/**\n * UploadProgressList — render-only list of in-flight uploads. Each row shows\n * a status icon (queued / uploading / done / error / cancelled), filename,\n * size, a progress bar driven by `progress` (0–100), and an action button\n * that maps to the row's status (cancel while uploading, retry on error,\n * remove when done). Pair with FileUpload / MediaGallery / Dropzone — those\n * components emit raw `File` instances; this one displays the upload UI\n * once the consumer has wired them to its API.\n *\n * Strings overridable for i18n.\n */\nimport { AlertCircle, Check, Clock, RefreshCw, UploadCloud, X, Eye, Download } from 'lucide-react';\nimport { Button } from '../buttons';\nimport { Stack } from '../structure';\nimport { SecondaryValue } from '../../primitives';\nimport { Attachment, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentProgress, AttachmentFileIcon, type AttachmentKind } from '../attachment';\nimport { FileSize } from '../../primitives';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nexport type UploadStatus = 'queued' | 'uploading' | 'done' | 'error' | 'cancelled';\n\nexport interface UploadItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Displayed file name. */\n\tname: string;\n\t/** Pre-formatted size string (e.g. \"2.4 MB\"). */\n\tsize?: string;\n\t/** Numeric file size used when the formatted size is absent. */\n\tbytes?: number;\n\tkind?: AttachmentKind;\n\t/** Upload progress 0–100. Omit for an indeterminate transfer. Ignored when status is `done`/`error`/`cancelled`. */\n\tprogress?: number;\n\tstatus: UploadStatus;\n\t/** Error message rendered under the row when status is `error`. */\n\terror?: string;\n\t/**\n\t * Optional thumbnail URL, shown in place of the status icon.\n\t * The status remains visible beside the file name.\n\t */\n\tpreview?: string;\n}\n\nexport interface UploadProgressListStrings {\n\tqueued: string;\n\tuploading: string;\n\tdone: string;\n\terror: string;\n\tcancelled: string;\n\tcancel: string;\n\tretry: string;\n\tremove: string;\n\tpreview?: string;\n\tdownload?: string;\n}\n\nexport const defaultUploadProgressListStrings: UploadProgressListStrings = {\n\tqueued: 'Queued',\n\tuploading: 'Uploading',\n\tdone: 'Uploaded',\n\terror: 'Failed',\n\tcancelled: 'Cancelled',\n\tcancel: 'Cancel',\n\tretry: 'Retry',\n\tremove: 'Remove',\n\tpreview: 'Preview',\n\tdownload: 'Download',\n};\n\nexport interface UploadProgressListProps {\n\t/** Entries to render, in order. */\n\titems: UploadItem[];\n\t/** File preview action; consumers own the effect. */\n\tonPreview?: (id: string) => void;\n\t/** Download action for completed files. Receives the stable item identity. */\n\tonDownload?: (id: string) => void;\n\tonCancel?: (id: string) => void;\n\tonRetry?: (id: string) => void;\n\tonRemove?: (id: string) => void;\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<UploadProgressListStrings>;\n}\n\n// Colour is reserved for the state that needs attention. A finished upload shows\n// its neutral file-type icon, like a selected FileUpload row.\nconst STATUS_TONE: Record<UploadStatus, { icon: typeof Check; fg: string }> = {\n\tqueued: { icon: Clock, fg: 'text-muted-foreground' },\n\tuploading: { icon: UploadCloud, fg: 'text-primary-accent' },\n\tdone: { icon: Check, fg: 'text-muted-foreground' },\n\terror: { icon: AlertCircle, fg: 'text-destructive' },\n\tcancelled: { icon: X, fg: 'text-muted-foreground' },\n};\n\nexport function UploadProgressList({\n\titems,\n\tonPreview,\n\tonDownload,\n\tonCancel,\n\tonRetry,\n\tonRemove,\n\tclassName,\n\tstrings: stringsProp,\n}: UploadProgressListProps) {\n\tconst strings = useStrings(defaultUploadProgressListStrings, stringsProp);\n\tconst statusLabel: Record<UploadStatus, string> = {\n\t\tqueued: strings.queued,\n\t\tuploading: strings.uploading,\n\t\tdone: strings.done,\n\t\terror: strings.error,\n\t\tcancelled: strings.cancelled,\n\t};\n\n\tif (items.length === 0) return null;\n\n\treturn (\n\t\t<Stack render={<ul />} gap=\"sm\" className={cn('upload-progress-list--component m-0 p-0 list-none', className)}>\n\t\t\t{items.map((item) => {\n\t\t\t\tconst tone = STATUS_TONE[item.status];\n\t\t\t\tconst Icon = tone.icon;\n\t\t\t\tconst pct = item.progress === undefined ? null : Number.isFinite(item.progress) ? Math.max(0, Math.min(100, item.progress ?? 0)) : 0;\n\t\t\t\tconst showProgress = item.status === 'uploading' || item.status === 'queued';\n\t\t\t\treturn (\n\t\t\t\t\t<Attachment key={item.id} render={<li />} variant=\"outline\" className=\"upload-progress-list--item flex-nowrap bg-card text-card-foreground\">\n\t\t\t\t\t\t<AttachmentMedia variant={item.preview ? 'image' : 'icon'} className={cn('upload-progress-list--media self-center group-has-data-[slot=item-description]/item:self-center', tone.fg)}>\n\t\t\t\t\t\t\t{item.preview ? <img src={item.preview} alt=\"\" /> : item.status === 'done' ? <AttachmentFileIcon name={item.name} kind={item.kind} /> : <Icon aria-hidden=\"true\" className={cn('size-icon', item.status === 'uploading' && 'animate-pulse motion-reduce:animate-none')} />}\n\t\t\t\t\t\t</AttachmentMedia>\n\t\t\t\t\t\t{/* Same anatomy as Attachment: name, size line, status line, one gap. */}\n\t\t\t\t\t\t<AttachmentContent className=\"min-w-0 gap-space-xs\">\n\t\t\t\t\t\t\t<AttachmentTitle className=\"min-w-0 max-w-full\" title={item.name}><Text tag=\"span\" type=\"inherit\" weight=\"medium\" className=\"truncate\">{item.name}</Text></AttachmentTitle>\n\t\t\t\t\t\t\t{(item.size !== undefined || item.bytes !== undefined) && (\n\t\t\t\t\t\t\t\t<AttachmentDescription clamp={1}>\n\t\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">{item.size ?? <FileSize value={item.bytes} size=\"xs\" type=\"secondary\" />}</SecondaryValue>\n\t\t\t\t\t\t\t\t</AttachmentDescription>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<AttachmentDescription clamp=\"none\"><Text tag=\"span\" size=\"xs\" type={item.status === 'error' ? 'error' : 'secondary'} role={item.status === 'error' ? 'alert' : undefined}>{`${statusLabel[item.status]}${item.status === 'error' && item.error ? ` — ${item.error}` : ''}`}</Text></AttachmentDescription>\n\t\t\t\t\t\t\t{showProgress && <AttachmentProgress value={item.status === 'queued' && pct === null ? 0 : pct} aria-label={item.name} size=\"sm\" tone={item.status === 'queued' ? 'neutral' : 'primary'} className=\"upload-progress-list--progress\" />}\n\t\t\t\t\t\t</AttachmentContent>\n\t\t\t\t\t\t<AttachmentActions className=\"shrink-0\">\n {!!onPreview && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly aria-label={`${strings.preview ?? 'Preview'} ${item.name}`} onClick={() => onPreview(item.id)}><Eye aria-hidden=\"true\" className=\"size-icon-md\" /></Button>}\n {!!onDownload && item.status === 'done' && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly aria-label={`${strings.download ?? 'Download'} ${item.name}`} onClick={() => onDownload(item.id)}><Download aria-hidden=\"true\" className=\"size-icon-md\" /></Button>}\n\n\t\t\t\t\t\t\t\t{(item.status === 'uploading' || item.status === 'queued') && !!onCancel && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\t\t\taria-label={`${strings.cancel} ${item.name}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => onCancel(item.id)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{item.status === 'error' && !!onRetry && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\t\t\taria-label={`${strings.retry} ${item.name}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => onRetry(item.id)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<RefreshCw className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{(item.status === 'done' || item.status === 'error' || item.status === 'cancelled' || (item.status === 'queued' && !onCancel)) && !!onRemove && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\t\t\taria-label={`${strings.remove} ${item.name}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => onRemove(item.id)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</AttachmentActions>\n\t\t\t\t\t</Attachment>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Stack>\n\t);\n}\n\nUploadProgressList.displayName = 'UploadProgressList';\n","/**\n * UploadTray — the canonical \"drag-and-drop area + per-file progress\n * rows + summary toolbar\" surface. Composes:\n *\n * - `Dropzone` — drag/drop chrome + click-to-browse\n * - `UploadProgressList` — per-file row with status icon + progress\n * bar + cancel/retry/remove actions\n * - `Badge` — status counters in the toolbar\n * - `Button` — \"Clear all\" action\n *\n * Framework-agnostic. Every action is callback-driven — the library\n * doesn't perform the upload; it surfaces the UX. The consumer wires\n * the actual transfer (XHR, fetch, S3 multipart, …) and feeds back\n * `progress` / `status` updates by mutating the `items` array.\n *\n * Pair with `useFiles` (the existing client-side validation hook) at\n * the call site if you want pre-flight size/type rejection.\n */\nimport { forwardRef, useCallback } from 'react';\n\nimport { Badge } from '../badge';\nimport { Button } from '../buttons';\nimport { Stack } from '../structure';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { Dropzone, type DropzoneProps } from '../upload/dropzone';\nimport { UploadProgressList, type UploadItem, type UploadProgressListStrings } from './upload-progress-list';\n\nexport interface UploadTrayStrings {\n\theading: string;\n\tcompletedLabel: string;\n\tfailedLabel: string;\n\tuploadingLabel: string;\n\tqueuedLabel: string;\n\tclearAll: string;\n}\n\nexport const defaultUploadTrayStrings: UploadTrayStrings = {\n\theading: 'Upload progress',\n\tcompletedLabel: 'Completed',\n\tfailedLabel: 'Failed',\n\tuploadingLabel: 'Uploading',\n\tqueuedLabel: 'Queued',\n\tclearAll: 'Clear all',\n};\n\nexport interface UploadTrayProps {\n\t/** Files currently in the tray (queued / uploading / done / error / cancelled). */\n\titems: UploadItem[];\n\t/**\n\t * Fires when the user drops or browses files. The library does NOT\n\t * write to the items array — the consumer turns these into queued\n\t * `UploadItem`s, kicks off the actual transfer, and updates progress.\n\t */\n\tonAddFiles: (files: File[]) => void;\n\t/** Preview callback forwarded with the item identity. */\n\tonPreview?: (id: string) => void;\n\t/** Download callback for completed files, forwarded with the item identity. */\n\tonDownload?: (id: string) => void;\n\t/** Per-row cancel handler (passed through to UploadProgressList). */\n\tonCancel?: (id: string) => void;\n\t/** Per-row retry handler. */\n\tonRetry?: (id: string) => void;\n\t/** Per-row remove handler. */\n\tonRemove?: (id: string) => void;\n\t/**\n\t * Clears the entire tray. When omitted, the \"Clear all\" button is\n\t * hidden — useful for surfaces where in-flight uploads can't be\n\t * cancelled in bulk.\n\t */\n\tonClearAll?: () => void;\n\t/** Forwarded to the inner `<Dropzone>`. Only the meaningful subset. */\n\tdropzone?: Pick<DropzoneProps, 'accept' | 'multiple' | 'size' | 'disabled' | 'invalid' | 'strings'>;\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<UploadTrayStrings>;\n\t/** Strings forwarded to the inner `<UploadProgressList>`. */\n\tlistStrings?: StringsProp<UploadProgressListStrings>;\n}\n\nfunction countStatus(items: UploadItem[]) {\n\tlet completed = 0;\n\tlet failed = 0;\n\tlet uploading = 0;\n\tlet queued = 0;\n\tfor (const item of items) {\n\t\tif (item.status === 'done') completed += 1;\n\t\telse if (item.status === 'error') failed += 1;\n\t\telse if (item.status === 'uploading') uploading += 1;\n\t\telse if (item.status === 'queued') queued += 1;\n\t}\n\treturn { completed, failed, uploading, queued };\n}\n\nexport const UploadTray = forwardRef<HTMLDivElement, UploadTrayProps>(function UploadTray(\n\t{\n\t\titems,\n\t\tonAddFiles,\n\t\tonPreview,\n\t\tonDownload,\n\t\tonCancel,\n\t\tonRetry,\n\t\tonRemove,\n\t\tonClearAll,\n\t\tdropzone,\n\t\tclassName,\n\t\tstrings: stringsProp,\n\t\tlistStrings,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultUploadTrayStrings, stringsProp);\n\tconst { completed, failed, uploading, queued } = countStatus(items);\n\n\tconst handleDrop = useCallback(\n\t\t(files: File[]) => {\n\t\t\tif (files.length > 0) onAddFiles(files);\n\t\t},\n\t\t[onAddFiles],\n\t);\n\n\tconst hasItems = items.length > 0;\n\n\treturn (\n\t\t<Stack ref={ref} gap=\"md\" className={cn('upload-tray--component', className)}>\n\t\t\t<Dropzone\n\t\t\t\tonDrop={handleDrop}\n\t\t\t\taccept={dropzone?.accept}\n\t\t\t\tmultiple={dropzone?.multiple}\n\t\t\t\tsize={dropzone?.size}\n\t\t\t\tdisabled={dropzone?.disabled}\n\t\t\t\tinvalid={dropzone?.invalid}\n\t\t\t\tstrings={dropzone?.strings}\n\t\t\t/>\n\n\t\t\t{!!hasItems && (\n\t\t\t\t<>\n\t\t\t\t\t<Stack direction=\"horizontal\" wrap align=\"center\" justify=\"between\" gap=\"md\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" wrap align=\"center\" gap=\"md\">\n\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"semibold\">\n\t\t\t\t\t\t\t\t{strings.heading}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t{completed > 0 && (\n\t\t\t\t\t\t\t\t<Badge tone=\"success\">\n\t\t\t\t\t\t\t\t\t{strings.completedLabel}: {completed}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{failed > 0 && (\n\t\t\t\t\t\t\t\t<Badge tone=\"destructive\">\n\t\t\t\t\t\t\t\t\t{strings.failedLabel}: {failed}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{uploading > 0 && (\n\t\t\t\t\t\t\t\t<Badge tone=\"info\">\n\t\t\t\t\t\t\t\t\t{strings.uploadingLabel}: {uploading}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{queued > 0 && (\n\t\t\t\t\t\t\t\t<Badge tone=\"secondary\">\n\t\t\t\t\t\t\t\t\t{strings.queuedLabel}: {queued}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{!!onClearAll && (\n\t\t\t\t\t\t\t<Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" onClick={onClearAll}>\n\t\t\t\t\t\t\t\t{strings.clearAll}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t<UploadProgressList\n\t\t\t\t\t\titems={items}\n\t\t\t\t\t\tonPreview={onPreview}\n\t\t\t\t\t\tonDownload={onDownload}\n\t\t\t\t\t\tonCancel={onCancel}\n\t\t\t\t\t\tonRetry={onRetry}\n\t\t\t\t\t\tonRemove={onRemove}\n\t\t\t\t\t\tstrings={listStrings}\n\t\t\t\t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EG;;AAET,CAAC;AAED,EAAW,cAAc"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { c as e } from "./ui-provider-1D_NSYzO.js";
2
+ import { c as e } from "./ui-provider-C_U0Xma4.js";
3
3
  import { useStrings as t } from "./lib/strings.js";
4
- import { t as n } from "./utils-l5LpDw2z.js";
5
- import { n as r } from "./buttons-SbIcm1HJ.js";
6
- import { a as i, s as a } from "./typography-DTRkE9zL.js";
7
- import { r as o, t as s } from "./structure-DC2dygdA.js";
8
- import { t as c } from "./smart-card-lFKxn5Hu.js";
9
- import { i as l, t as u } from "./progress-rnS8-uAW.js";
10
- import { n as d, t as f } from "./number-DMhe-Vsk.js";
11
- import { i as p, n as m, r as h, t as g } from "./tabs-DwBJfjxX.js";
4
+ import { t as n } from "./utils-BRhFDwuU.js";
5
+ import { n as r } from "./buttons-DPZekJFu.js";
6
+ import { c as i, o as a } from "./typography-UTnveOEy.js";
7
+ import { r as o, t as s } from "./structure-BmisBK-3.js";
8
+ import { t as c } from "./smart-card-DiC5aac3.js";
9
+ import { i as l, t as u } from "./progress-B1VnCT0K.js";
10
+ import { n as d, t as f } from "./number-DbV1Dija.js";
11
+ import { i as p, n as m, r as h, t as g } from "./tabs-CDocW5D1.js";
12
12
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
13
  //#region src/components/blocks/analytics/usage-card/usage-card.data.ts
14
14
  function b(e) {
@@ -83,13 +83,14 @@ function D({ quota: e, strings: t, prominent: n = !1 }) {
83
83
  align: "baseline",
84
84
  children: [
85
85
  /* @__PURE__ */ v(f, {
86
+ type: "inherit",
86
87
  value: r.used,
87
88
  emptyLabel: t.unavailable,
88
89
  size: n ? "xl" : void 0,
89
90
  weight: n ? "semibold" : "medium",
90
91
  align: "left"
91
92
  }),
92
- !n && r.kind === "limited" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(a, {
93
+ !n && r.kind === "limited" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(i, {
93
94
  tag: "span",
94
95
  type: "secondary",
95
96
  children: t.of
@@ -98,12 +99,12 @@ function D({ quota: e, strings: t, prominent: n = !1 }) {
98
99
  type: "secondary",
99
100
  align: "left"
100
101
  })] }),
101
- e.unit && /* @__PURE__ */ v(a, {
102
+ e.unit && /* @__PURE__ */ v(i, {
102
103
  tag: "span",
103
104
  type: "secondary",
104
105
  children: e.unit
105
106
  }),
106
- n && r.used !== null && /* @__PURE__ */ v(a, {
107
+ n && r.used !== null && /* @__PURE__ */ v(i, {
107
108
  tag: "span",
108
109
  size: "xs",
109
110
  type: "secondary",
@@ -115,7 +116,7 @@ function D({ quota: e, strings: t, prominent: n = !1 }) {
115
116
  direction: "horizontal",
116
117
  gap: "xs",
117
118
  align: "baseline",
118
- children: [/* @__PURE__ */ v(a, {
119
+ children: [/* @__PURE__ */ v(i, {
119
120
  tag: "span",
120
121
  size: "xs",
121
122
  type: "secondary",
@@ -127,13 +128,13 @@ function D({ quota: e, strings: t, prominent: n = !1 }) {
127
128
  align: "left"
128
129
  })]
129
130
  }),
130
- r.kind === "unlimited" && /* @__PURE__ */ v(a, {
131
+ r.kind === "unlimited" && /* @__PURE__ */ v(i, {
131
132
  tag: "span",
132
133
  size: "xs",
133
134
  type: "secondary",
134
135
  children: t.unlimited
135
136
  }),
136
- r.kind === "unavailable" && r.used !== null && /* @__PURE__ */ v(a, {
137
+ r.kind === "unavailable" && r.used !== null && /* @__PURE__ */ v(i, {
137
138
  tag: "span",
138
139
  size: "xs",
139
140
  type: "secondary",
@@ -173,24 +174,28 @@ function k({ days: e, unit: t, strings: n }) {
173
174
  justify: "between",
174
175
  align: "baseline",
175
176
  gap: "sm",
176
- children: [/* @__PURE__ */ v(i, { children: n.daily }), /* @__PURE__ */ y(s, {
177
+ children: [/* @__PURE__ */ v(a, {
178
+ className: "text-inherit",
179
+ children: n.daily
180
+ }), /* @__PURE__ */ y(s, {
177
181
  direction: "horizontal",
178
182
  gap: "xs",
179
183
  align: "baseline",
180
184
  children: [
181
- /* @__PURE__ */ v(a, {
185
+ /* @__PURE__ */ v(i, {
182
186
  tag: "span",
183
187
  size: "xs",
184
188
  type: "secondary",
185
189
  children: n.average
186
190
  }),
187
191
  /* @__PURE__ */ v(f, {
192
+ type: "inherit",
188
193
  value: r.average,
189
194
  emptyLabel: n.unavailable,
190
195
  options: { maximumFractionDigits: 0 },
191
196
  weight: "medium"
192
197
  }),
193
- /* @__PURE__ */ v(a, {
198
+ /* @__PURE__ */ v(i, {
194
199
  tag: "span",
195
200
  size: "xs",
196
201
  type: "secondary",
@@ -216,11 +221,11 @@ function k({ days: e, unit: t, strings: n }) {
216
221
  justify: "between",
217
222
  gap: "sm",
218
223
  "aria-hidden": "true",
219
- children: [/* @__PURE__ */ v(a, {
224
+ children: [/* @__PURE__ */ v(i, {
220
225
  size: "xs",
221
226
  type: "secondary",
222
227
  children: e[0]?.label
223
- }), e.length > 1 && /* @__PURE__ */ v(a, {
228
+ }), e.length > 1 && /* @__PURE__ */ v(i, {
224
229
  size: "xs",
225
230
  type: "secondary",
226
231
  children: e[e.length - 1]?.label
@@ -233,6 +238,7 @@ function k({ days: e, unit: t, strings: n }) {
233
238
  e.label,
234
239
  ": ",
235
240
  /* @__PURE__ */ v(f, {
241
+ type: "inherit",
236
242
  value: b(e.value),
237
243
  emptyLabel: n.unavailable
238
244
  }),
@@ -281,7 +287,7 @@ function A({ data: e, strings: t }) {
281
287
  columns: 3,
282
288
  gap: "sm",
283
289
  className: "m-0 list-none p-0 font-sans usage-card--categories grid-cols-[minmax(0,1fr)_auto_minmax(5ch,max-content)]",
284
- children: e.categories.map((e, i) => {
290
+ children: e.categories.map((e, a) => {
285
291
  let o = b(e.value), c = r.used === null || o === null || l ? null : r.used === 0 ? 0 : o / r.used;
286
292
  return /* @__PURE__ */ y("li", {
287
293
  className: "usage-card--category col-span-full grid grid-cols-subgrid items-baseline",
@@ -294,14 +300,16 @@ function A({ data: e, strings: t }) {
294
300
  className: "min-w-0",
295
301
  children: [/* @__PURE__ */ v("span", {
296
302
  "aria-hidden": "true",
297
- className: n("size-icon-sm shrink-0 rounded-full", E(e, i))
298
- }), /* @__PURE__ */ v(a, {
303
+ className: n("size-icon-sm shrink-0 rounded-full", E(e, a))
304
+ }), /* @__PURE__ */ v(i, {
305
+ type: "inherit",
299
306
  tag: "span",
300
307
  className: "break-words",
301
308
  children: e.label
302
309
  })]
303
310
  }),
304
311
  /* @__PURE__ */ v(f, {
312
+ type: "inherit",
305
313
  value: o,
306
314
  emptyLabel: t.unavailable,
307
315
  weight: "medium",
@@ -318,7 +326,7 @@ function A({ data: e, strings: t }) {
318
326
  }, e.id);
319
327
  })
320
328
  }),
321
- l && /* @__PURE__ */ v(a, {
329
+ l && /* @__PURE__ */ v(i, {
322
330
  size: "xs",
323
331
  type: "secondary",
324
332
  children: t.inconsistentBreakdown
@@ -332,7 +340,10 @@ function A({ data: e, strings: t }) {
332
340
  }),
333
341
  !!e.resources?.length && /* @__PURE__ */ y(s, {
334
342
  gap: "sm",
335
- children: [/* @__PURE__ */ v(i, { children: t.resources }), /* @__PURE__ */ v(o, {
343
+ children: [/* @__PURE__ */ v(a, {
344
+ className: "text-inherit",
345
+ children: t.resources
346
+ }), /* @__PURE__ */ v(o, {
336
347
  columns: 1,
337
348
  gap: "md",
338
349
  className: "usage-card--resources @sm/card:grid-cols-3",
@@ -342,7 +353,8 @@ function A({ data: e, strings: t }) {
342
353
  role: "group",
343
354
  "aria-label": e.label,
344
355
  children: [
345
- /* @__PURE__ */ v(a, {
356
+ /* @__PURE__ */ v(i, {
357
+ type: "inherit",
346
358
  tag: "span",
347
359
  weight: "medium",
348
360
  children: e.label
@@ -363,18 +375,21 @@ function A({ data: e, strings: t }) {
363
375
  ]
364
376
  });
365
377
  }
366
- function j({ data: e, status: i = "ready", periods: o, period: l, onPeriodChange: u, onRetry: d, loadingSlot: _, errorSlot: b, emptySlot: x, footerAction: C, strings: T, ...E }) {
367
- let D = t(w, T), O = i === "ready" && !!e, k = O ? S(e.used, e.limit) : null, j = l ?? o?.[0]?.value ?? "", M = !!o?.length, N;
368
- N = i === "loading" ? /* @__PURE__ */ v("div", {
378
+ function j({ data: e, status: a = "ready", periods: o, period: l, onPeriodChange: u, onRetry: d, loadingSlot: _, errorSlot: b, emptySlot: x, footerAction: C, strings: T, ...E }) {
379
+ let D = t(w, T), O = a === "ready" && !!e, k = O ? S(e.used, e.limit) : null, j = l ?? o?.[0]?.value ?? "", M = !!o?.length, N;
380
+ N = a === "loading" ? /* @__PURE__ */ v("div", {
369
381
  role: "status",
370
- children: _ ?? /* @__PURE__ */ v(a, {
382
+ children: _ ?? /* @__PURE__ */ v(i, {
371
383
  type: "secondary",
372
384
  children: D.loading
373
385
  })
374
- }) : i === "error" ? /* @__PURE__ */ y(s, {
386
+ }) : a === "error" ? /* @__PURE__ */ y(s, {
375
387
  role: "alert",
376
388
  gap: "sm",
377
- children: [b ?? /* @__PURE__ */ v(a, { children: D.error }), d && /* @__PURE__ */ v(r, {
389
+ children: [b ?? /* @__PURE__ */ v(i, {
390
+ type: "inherit",
391
+ children: D.error
392
+ }), d && /* @__PURE__ */ v(r, {
378
393
  tone: "secondary",
379
394
  onClick: d,
380
395
  children: D.retry
@@ -382,7 +397,7 @@ function j({ data: e, status: i = "ready", periods: o, period: l, onPeriodChange
382
397
  }) : O ? /* @__PURE__ */ v(A, {
383
398
  data: e,
384
399
  strings: D
385
- }) : /* @__PURE__ */ v("div", { children: x ?? /* @__PURE__ */ v(a, {
400
+ }) : /* @__PURE__ */ v("div", { children: x ?? /* @__PURE__ */ v(i, {
386
401
  type: "secondary",
387
402
  children: D.empty
388
403
  }) });
@@ -397,15 +412,16 @@ function j({ data: e, status: i = "ready", periods: o, period: l, onPeriodChange
397
412
  align: "baseline",
398
413
  children: [
399
414
  /* @__PURE__ */ v(f, {
415
+ type: "inherit",
400
416
  value: k.excess ? k.excess : k.remaining,
401
417
  weight: "medium"
402
418
  }),
403
- e?.unit && /* @__PURE__ */ v(a, {
419
+ e?.unit && /* @__PURE__ */ v(i, {
404
420
  tag: "span",
405
421
  type: "secondary",
406
422
  children: e.unit
407
423
  }),
408
- /* @__PURE__ */ v(a, {
424
+ /* @__PURE__ */ v(i, {
409
425
  tag: "span",
410
426
  type: "secondary",
411
427
  children: k.excess ? D.overLimit : D.remaining
@@ -418,7 +434,7 @@ function j({ data: e, status: i = "ready", periods: o, period: l, onPeriodChange
418
434
  className: n("usage-card--component min-w-0", E.className),
419
435
  "data-component": "usage-card",
420
436
  "data-slot": "usage-card",
421
- "aria-busy": i === "loading" || void 0,
437
+ "aria-busy": a === "loading" || void 0,
422
438
  headerAction: M ? /* @__PURE__ */ y(s, {
423
439
  direction: "horizontal",
424
440
  gap: "sm",
@@ -453,4 +469,4 @@ j.displayName = "UsageCard";
453
469
  //#endregion
454
470
  export { w as n, j as t };
455
471
 
456
- //# sourceMappingURL=usage-card-obRaBskq.js.map
472
+ //# sourceMappingURL=usage-card-BhO5eqkX.js.map