themelia-react-ui 2.0.4 → 2.0.6

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 (715) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/MIGRATION.md +119 -0
  3. package/README.md +122 -20
  4. package/dist/{accordion-96o0pN62.js → accordion-0tQUZ20r.js} +13 -13
  5. package/dist/accordion-0tQUZ20r.js.map +1 -0
  6. package/dist/{action-menu-CHgs8vmj.js → action-menu-C0gjzLyE.js} +48 -45
  7. package/dist/action-menu-C0gjzLyE.js.map +1 -0
  8. package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
  9. package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
  10. package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-CGGpQryR.js} +281 -230
  11. package/dist/ai-artifact-CGGpQryR.js.map +1 -0
  12. package/dist/app-shell-EHuuRDGy.js +321 -0
  13. package/dist/app-shell-EHuuRDGy.js.map +1 -0
  14. package/dist/{attachment-DkoqHPPl.js → attachment-BCpA4e7i.js} +10 -10
  15. package/dist/{attachment-DkoqHPPl.js.map → attachment-BCpA4e7i.js.map} +1 -1
  16. package/dist/{auth-D2FVZ1MH.js → auth-B0girIk_.js} +49 -52
  17. package/dist/auth-B0girIk_.js.map +1 -0
  18. package/dist/{avatar-DWO_HHhB.js → avatar-B9Jnp-T-.js} +8 -8
  19. package/dist/avatar-B9Jnp-T-.js.map +1 -0
  20. package/dist/{badge-DErMA7ul.js → badge-wWauMgAt.js} +5 -5
  21. package/dist/{badge-DErMA7ul.js.map → badge-wWauMgAt.js.map} +1 -1
  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 +3 -3
  31. package/dist/base/cascader.js +2 -372
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +2 -2
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +4 -4
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +10 -10
  44. package/dist/base/item.js +1 -1
  45. package/dist/base/media-gallery.js +1 -1
  46. package/dist/base/metadata-list.js +1 -1
  47. package/dist/base/navigation.js +7 -7
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +1 -1
  51. package/dist/base/repeaters.js +200 -193
  52. package/dist/base/repeaters.js.map +1 -1
  53. package/dist/base/sheet.js +1 -1
  54. package/dist/base/sidebar.js +2 -2
  55. package/dist/base/signature-pad.js +8 -8
  56. package/dist/base/signature-pad.js.map +1 -1
  57. package/dist/base/skeleton.js +1 -1
  58. package/dist/base/spinner.js +6 -6
  59. package/dist/base/spinner.js.map +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +36 -36
  64. package/dist/base/toaster.js.map +1 -1
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +1 -1
  69. package/dist/{batch-action-bar-CdfIkCsV.js → batch-action-bar-BoqWIIpV.js} +7 -7
  70. package/dist/batch-action-bar-BoqWIIpV.js.map +1 -0
  71. package/dist/blocks/admin.js +21 -21
  72. package/dist/blocks/admin.js.map +1 -1
  73. package/dist/blocks/ai.js +267 -247
  74. package/dist/blocks/ai.js.map +1 -1
  75. package/dist/blocks/analytics/usage-card.js +1 -1
  76. package/dist/blocks/analytics.js +537 -543
  77. package/dist/blocks/analytics.js.map +1 -1
  78. package/dist/blocks/collaboration.js +1 -1
  79. package/dist/blocks/commerce/receipt.js +1 -1
  80. package/dist/blocks/commerce.js +1330 -1250
  81. package/dist/blocks/commerce.js.map +1 -1
  82. package/dist/blocks/data-display.js +2 -2
  83. package/dist/blocks/onboarding.js +6 -6
  84. package/dist/blocks/onboarding.js.map +1 -1
  85. package/dist/blocks/planning.js +11 -11
  86. package/dist/blocks/timelines.js +1 -1
  87. package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-Bp9Ke7kd.js} +7 -7
  88. package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
  89. package/dist/{button-DkmK-z8E.js → button-ChBovTx0.js} +3 -3
  90. package/dist/button-ChBovTx0.js.map +1 -0
  91. package/dist/{buttons-BbfzgczK.js → buttons-DeW0bQeK.js} +16 -16
  92. package/dist/buttons-DeW0bQeK.js.map +1 -0
  93. package/dist/cards-CNXnmvV5.js +69 -0
  94. package/dist/cards-CNXnmvV5.js.map +1 -0
  95. package/dist/cascader-CrAl9zD5.js +439 -0
  96. package/dist/cascader-CrAl9zD5.js.map +1 -0
  97. package/dist/chart-I7ROnsl8.js +162 -0
  98. package/dist/chart-I7ROnsl8.js.map +1 -0
  99. package/dist/{checkbox-CzYUTPeJ.js → checkbox-MoyHIAPs.js} +3 -3
  100. package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-MoyHIAPs.js.map} +1 -1
  101. package/dist/choice-inputs-DHGtx0QV.js +789 -0
  102. package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
  103. package/dist/{code-block-CGNaUtAE.js → code-block-BSJyq9e-.js} +9 -9
  104. package/dist/code-block-BSJyq9e-.js.map +1 -0
  105. package/dist/{collapsible-Do4G0zcC.js → collapsible-BzJ91LUG.js} +5 -5
  106. package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BzJ91LUG.js.map} +1 -1
  107. package/dist/{collection-content-C0e8SsTm.js → collection-content-CSnwtOTH.js} +3 -3
  108. package/dist/{collection-content-C0e8SsTm.js.map → collection-content-CSnwtOTH.js.map} +1 -1
  109. package/dist/combobox-Bcvu5J8O.js +363 -0
  110. package/dist/combobox-Bcvu5J8O.js.map +1 -0
  111. package/dist/combobox-C2JiSQPc.js +915 -0
  112. package/dist/combobox-C2JiSQPc.js.map +1 -0
  113. package/dist/{command-D8NrBj-b.js → command-9e52NPgK.js} +11 -11
  114. package/dist/command-9e52NPgK.js.map +1 -0
  115. package/dist/{comments-Di4w0H_S.js → comments-BsgErEqd.js} +44 -39
  116. package/dist/comments-BsgErEqd.js.map +1 -0
  117. package/dist/components/base/action-menu/action-menu.d.ts +7 -1
  118. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  119. package/dist/components/base/cards/card.recipes.d.ts +6 -4
  120. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
  121. package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
  122. package/dist/components/base/cards/smart-card.types.d.ts +3 -4
  123. package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
  124. package/dist/components/base/chart/chart.d.ts +6 -1
  125. package/dist/components/base/choice-inputs/choice-types.d.ts +5 -1
  126. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
  127. package/dist/components/base/combobox/combobox-field.d.ts +2 -2
  128. package/dist/components/base/combobox/index.d.ts +4 -2
  129. package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
  130. package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
  131. package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
  132. package/dist/components/base/feedback/alert.d.ts +1 -1
  133. package/dist/components/base/feedback/state-display.d.ts +5 -1
  134. package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
  135. package/dist/components/base/forms/form-field.d.ts +7 -2
  136. package/dist/components/base/forms/form-sizing.d.ts +7 -7
  137. package/dist/components/base/forms/workflow.d.ts +7 -1
  138. package/dist/components/base/forms-numeric/coordinates-input.d.ts +8 -1
  139. package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
  140. package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
  141. package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
  142. package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
  143. package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
  144. package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
  145. package/dist/components/base/navigation/language-switcher.d.ts +12 -4
  146. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
  147. package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
  148. package/dist/components/base/popover/popover.d.ts +3 -3
  149. package/dist/components/base/popover/popover.recipes.d.ts +10 -6
  150. package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
  151. package/dist/components/base/sheet/sheet.d.ts +2 -0
  152. package/dist/components/base/sidebar/index.d.ts +1 -1
  153. package/dist/components/base/sidebar/sidebar.d.ts +29 -5
  154. package/dist/components/base/toaster/index.d.ts +1 -0
  155. package/dist/components/base/upload/avatar-upload.d.ts +2 -1
  156. package/dist/components/base/upload/image-upload.d.ts +2 -1
  157. package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
  158. package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
  159. package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
  160. package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
  161. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +5 -1
  162. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  163. package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
  164. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +4 -0
  165. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
  166. package/dist/components/blocks/analytics/types.d.ts +2 -2
  167. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  168. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
  169. package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
  170. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
  171. package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
  172. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  173. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
  174. package/dist/components/blocks/commerce/index.d.ts +7 -6
  175. package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
  176. package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
  177. package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
  178. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  179. package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
  180. package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
  181. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
  182. package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
  183. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
  184. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
  185. package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
  186. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  187. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
  188. package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
  189. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  190. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
  191. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  192. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
  193. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
  194. package/dist/components/features/activities/activities.types.d.ts +26 -13
  195. package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
  196. package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
  197. package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
  198. package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
  199. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  200. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
  201. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  202. package/dist/components/features/combobox/combobox.d.ts +2 -2
  203. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
  204. package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
  205. package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
  206. package/dist/components/features/combobox/types.d.ts +37 -8
  207. package/dist/components/features/email-composer/types.d.ts +3 -1
  208. package/dist/components/features/event-calendar/colors.d.ts +2 -2
  209. package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
  210. package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
  211. package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
  212. package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
  213. package/dist/components/features/filters/filters.strings.d.ts +4 -0
  214. package/dist/components/features/filters/filters.types.d.ts +6 -3
  215. package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
  216. package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
  217. package/dist/components/features/filters/partials/filter-popover-content.d.ts +5 -3
  218. package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
  219. package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
  220. package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
  221. package/dist/components/features/filters/utils/filter-utils.d.ts +25 -3
  222. package/dist/components/features/global-search/global-search.types.d.ts +2 -0
  223. package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
  224. package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
  225. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  226. package/dist/components/features/media-library/media-library.d.ts +1 -1
  227. package/dist/components/features/media-library/media-library.strings.d.ts +8 -0
  228. package/dist/components/features/media-library/media-library.types.d.ts +50 -12
  229. package/dist/components/features/media-library/partials/media-library-partials.d.ts +4 -4
  230. package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
  231. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
  232. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
  233. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
  234. package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
  235. package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
  236. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  237. package/dist/components/features/products/products.strings.d.ts +9 -1
  238. package/dist/components/features/products/products.types.d.ts +45 -8
  239. package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
  240. package/dist/components/features/resource/resource.d.ts +6 -2
  241. package/dist/components/features/resource/resource.types.d.ts +14 -1
  242. package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
  243. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
  244. package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
  245. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
  246. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
  247. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
  248. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
  249. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
  250. package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
  251. package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
  252. package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
  253. package/dist/components/features/table/data-table.d.ts +1 -1
  254. package/dist/components/features/table/index.d.ts +1 -0
  255. package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
  256. package/dist/components/features/table/table-body.d.ts +1 -1
  257. package/dist/components/features/table/table-helpers.d.ts +6 -3
  258. package/dist/components/features/table/table.strings.d.ts +3 -0
  259. package/dist/components/features/table/table.types.d.ts +18 -2
  260. package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
  261. package/dist/components/layout/app-shell/index.d.ts +1 -1
  262. package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
  263. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  264. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  265. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  266. package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
  267. package/dist/components/layout/header/header.recipes.d.ts +6 -0
  268. package/dist/components/layout/header/header.types.d.ts +9 -8
  269. package/dist/components/layout/layout.types.d.ts +5 -3
  270. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
  271. package/dist/components/layout/navigation/side-nav.d.ts +3 -2
  272. package/dist/components/layout/normalize-layout-path.d.ts +1 -0
  273. package/dist/components/layout/page/index.d.ts +2 -1
  274. package/dist/components/layout/page/page.d.ts +1 -0
  275. package/dist/components/layout/page/page.strings.d.ts +11 -0
  276. package/dist/components/layout/page/page.types.d.ts +69 -17
  277. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  278. package/dist/components/layout/settings/settings.d.ts +10 -3
  279. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  280. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  281. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  282. package/dist/components/layout/sidebar/index.d.ts +2 -1
  283. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +38 -0
  284. package/dist/components/layout/sidebar/sidebar.context.d.ts +6 -7
  285. package/dist/components/layout/sidebar/sidebar.types.d.ts +50 -10
  286. package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
  287. package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
  288. package/dist/components/primitives/link.d.ts +3 -2
  289. package/dist/components/primitives/money.d.ts +1 -1
  290. package/dist/components/primitives/number.d.ts +1 -1
  291. package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
  292. package/dist/components/ui/alert-dialog.d.ts +2 -2
  293. package/dist/components/ui/combobox.d.ts +1 -1
  294. package/dist/components/ui/dialog.d.ts +2 -2
  295. package/dist/components/ui/overlay-layer.d.ts +18 -0
  296. package/dist/components/ui/sheet.d.ts +5 -1
  297. package/dist/components/ui/sidebar-state.d.ts +82 -0
  298. package/dist/components/ui/sidebar.d.ts +5 -17
  299. package/dist/{containers-CRmHf7GP.js → containers-CSdc32h9.js} +26 -18
  300. package/dist/containers-CSdc32h9.js.map +1 -0
  301. package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
  302. package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
  303. package/dist/{copyable-CnGCZdX4.js → copyable-3fdHfMR3.js} +7 -7
  304. package/dist/{copyable-CnGCZdX4.js.map → copyable-3fdHfMR3.js.map} +1 -1
  305. package/dist/{data-display-D4oujtx0.js → data-display-Cmj-xZYl.js} +271 -279
  306. package/dist/data-display-Cmj-xZYl.js.map +1 -0
  307. package/dist/{date-Q7jnXxpk.js → date-Br0FicVv.js} +5 -5
  308. package/dist/{date-Q7jnXxpk.js.map → date-Br0FicVv.js.map} +1 -1
  309. package/dist/date-picker-CyQlFYsP.js +1617 -0
  310. package/dist/date-picker-CyQlFYsP.js.map +1 -0
  311. package/dist/date-pickers-tj2MXmXd.js +185 -0
  312. package/dist/date-pickers-tj2MXmXd.js.map +1 -0
  313. package/dist/{display-BB4BL_-K.js → display-CT_N2a3w.js} +9 -9
  314. package/dist/{display-BB4BL_-K.js.map → display-CT_N2a3w.js.map} +1 -1
  315. package/dist/dropdown-menu-C08iIugv.js +194 -0
  316. package/dist/dropdown-menu-C08iIugv.js.map +1 -0
  317. package/dist/features/activities.js +388 -326
  318. package/dist/features/activities.js.map +1 -1
  319. package/dist/features/ai-chat.js +46 -32
  320. package/dist/features/ai-chat.js.map +1 -1
  321. package/dist/features/appointment-calendar.js +130 -130
  322. package/dist/features/appointment-calendar.js.map +1 -1
  323. package/dist/features/async-preview.js +11 -10
  324. package/dist/features/async-preview.js.map +1 -1
  325. package/dist/features/combobox.js +1 -1
  326. package/dist/features/comments.js +1 -1
  327. package/dist/features/data-view.js +13 -13
  328. package/dist/features/data-view.js.map +1 -1
  329. package/dist/features/email-composer.js +243 -239
  330. package/dist/features/email-composer.js.map +1 -1
  331. package/dist/features/event-calendar.js +197 -199
  332. package/dist/features/event-calendar.js.map +1 -1
  333. package/dist/features/filters.js +2 -2
  334. package/dist/features/global-search.js +168 -143
  335. package/dist/features/global-search.js.map +1 -1
  336. package/dist/features/kanban.js +19 -30
  337. package/dist/features/kanban.js.map +1 -1
  338. package/dist/features/map/style.css +15 -0
  339. package/dist/features/map.js +369 -343
  340. package/dist/features/map.js.map +1 -1
  341. package/dist/features/media-library.js +1202 -975
  342. package/dist/features/media-library.js.map +1 -1
  343. package/dist/features/mentions.js +2 -2
  344. package/dist/features/overlays.js +1 -1
  345. package/dist/features/products.js +1270 -1183
  346. package/dist/features/products.js.map +1 -1
  347. package/dist/features/questionnaire.js +160 -153
  348. package/dist/features/questionnaire.js.map +1 -1
  349. package/dist/features/resource-assignment.js +8 -8
  350. package/dist/features/resource.js +119 -113
  351. package/dist/features/resource.js.map +1 -1
  352. package/dist/features/rich-text-editor.js +28 -19
  353. package/dist/features/rich-text-editor.js.map +1 -1
  354. package/dist/features/schema-form.js +297 -256
  355. package/dist/features/schema-form.js.map +1 -1
  356. package/dist/features/suggestions.js +57 -50
  357. package/dist/features/suggestions.js.map +1 -1
  358. package/dist/features/sync.js +3 -3
  359. package/dist/features/table.js +1 -1
  360. package/dist/features/theme-tweaker.js +470 -470
  361. package/dist/features/theme-tweaker.js.map +1 -1
  362. package/dist/feedback-Dzo1xtAU.js +246 -0
  363. package/dist/feedback-Dzo1xtAU.js.map +1 -0
  364. package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-D6H7tVJi.js} +5 -5
  365. package/dist/field-affordance-recipes-D6H7tVJi.js.map +1 -0
  366. package/dist/field-control-attributes-B6i335wr.js +18 -0
  367. package/dist/field-control-attributes-B6i335wr.js.map +1 -0
  368. package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
  369. package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
  370. package/dist/filters-Dl80yYtN.js +2415 -0
  371. package/dist/filters-Dl80yYtN.js.map +1 -0
  372. package/dist/form-field-CAPdwdnZ.js +74 -0
  373. package/dist/form-field-CAPdwdnZ.js.map +1 -0
  374. package/dist/{form-sizing-NXgjkmBG.js → form-sizing-CgcrUbLU.js} +5 -5
  375. package/dist/form-sizing-CgcrUbLU.js.map +1 -0
  376. package/dist/{forms-BV5m5aQF.js → forms-B3W8CH7-.js} +17 -13
  377. package/dist/forms-B3W8CH7-.js.map +1 -0
  378. package/dist/forms-numeric-CwjQJe-O.js +991 -0
  379. package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
  380. package/dist/{header-BA697l4a.js → header-ZIIsRKxP.js} +145 -141
  381. package/dist/header-ZIIsRKxP.js.map +1 -0
  382. package/dist/header.recipes-BigdJjw1.js +6 -0
  383. package/dist/header.recipes-BigdJjw1.js.map +1 -0
  384. package/dist/hooks/use-files.d.ts +2 -0
  385. package/dist/{hooks-BQ-L7Uu2.js → hooks-BitHSh-Y.js} +27 -15
  386. package/dist/hooks-BitHSh-Y.js.map +1 -0
  387. package/dist/{icon-badge-COWbCCWu.js → icon-badge-npxF1SLX.js} +4 -4
  388. package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-npxF1SLX.js.map} +1 -1
  389. package/dist/index.js +4 -5
  390. package/dist/{input-Cdw4k0fb.js → input-7KAc7XQL.js} +9 -9
  391. package/dist/{input-Cdw4k0fb.js.map → input-7KAc7XQL.js.map} +1 -1
  392. package/dist/input-DIREVYHs.js +21 -0
  393. package/dist/input-DIREVYHs.js.map +1 -0
  394. package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
  395. package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
  396. package/dist/item-FfWnaYST.js +278 -0
  397. package/dist/item-FfWnaYST.js.map +1 -0
  398. package/dist/layout/app-shell.js +1 -1
  399. package/dist/layout/auth.js +1 -1
  400. package/dist/layout/containers.js +1 -1
  401. package/dist/layout/header.js +1 -1
  402. package/dist/layout/hooks.js +1 -1
  403. package/dist/layout/navigation.js +1 -1
  404. package/dist/layout/page.js +2 -2
  405. package/dist/layout/settings.js +1 -1
  406. package/dist/layout/sidebar.js +3 -3
  407. package/dist/layout/workspace.js +1 -1
  408. package/dist/layout.js +12 -12
  409. package/dist/layout.types-E_GAApzO.js +30 -0
  410. package/dist/layout.types-E_GAApzO.js.map +1 -0
  411. package/dist/lib/affordance-geometry.generated.d.ts +35 -35
  412. package/dist/lib/control-group-recipes.d.ts +5 -5
  413. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  414. package/dist/lib/field-control-attributes.d.ts +11 -0
  415. package/dist/lib/field-state-recipes.d.ts +2 -0
  416. package/dist/lib/format.d.ts +1 -0
  417. package/dist/lib/motion-recipes.d.ts +3 -0
  418. package/dist/lib/navigation-row-recipes.d.ts +7 -7
  419. package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
  420. package/dist/lib/portal-recipes.d.ts +3 -0
  421. package/dist/lib/surface-recipes.d.ts +1 -1
  422. package/dist/lib/token-merge.generated.d.ts +18 -15
  423. package/dist/lib/utils.js +1 -1
  424. package/dist/map-demo-tile.svg +1 -1
  425. package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C81DAnKI.js} +6 -6
  426. package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C81DAnKI.js.map} +1 -1
  427. package/dist/{mentions-RKOQaaIB.js → mentions-qOnedSt4.js} +237 -168
  428. package/dist/mentions-qOnedSt4.js.map +1 -0
  429. package/dist/message-BJHnn43M.js +135 -0
  430. package/dist/message-BJHnn43M.js.map +1 -0
  431. package/dist/{metadata-list-qVV7AVxa.js → metadata-list-XkqZ_UXH.js} +64 -64
  432. package/dist/metadata-list-XkqZ_UXH.js.map +1 -0
  433. package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
  434. package/dist/motion-recipes-DitYv6P2.js.map +1 -0
  435. package/dist/navigation-BgtPJAhi.js +288 -0
  436. package/dist/navigation-BgtPJAhi.js.map +1 -0
  437. package/dist/navigation-Bt-v7rWP.js +261 -0
  438. package/dist/navigation-Bt-v7rWP.js.map +1 -0
  439. package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
  440. package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
  441. package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
  442. package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
  443. package/dist/{number-E_OiIfJz.js → number-CYqBcrSj.js} +79 -87
  444. package/dist/number-CYqBcrSj.js.map +1 -0
  445. package/dist/overflow-tab-bar-BQCA2Zn2.js +172 -0
  446. package/dist/overflow-tab-bar-BQCA2Zn2.js.map +1 -0
  447. package/dist/overlays-CC8zI3Du.js +1017 -0
  448. package/dist/overlays-CC8zI3Du.js.map +1 -0
  449. package/dist/page-BoQ1VaFJ.js +331 -0
  450. package/dist/page-BoQ1VaFJ.js.map +1 -0
  451. package/dist/page-header-commands-DIKspJfx.js +193 -0
  452. package/dist/page-header-commands-DIKspJfx.js.map +1 -0
  453. package/dist/{pagination-Ch8X_47u.js → pagination-Br8TdV9A.js} +7 -7
  454. package/dist/{pagination-Ch8X_47u.js.map → pagination-Br8TdV9A.js.map} +1 -1
  455. package/dist/popover-k8TdUcAt.js +201 -0
  456. package/dist/popover-k8TdUcAt.js.map +1 -0
  457. package/dist/{popover-menu-BYaCdFhf.js → popover-menu-yn-o0kyA.js} +7 -7
  458. package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
  459. package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DJ0AkUan.js} +19 -12
  460. package/dist/popover.recipes-DJ0AkUan.js.map +1 -0
  461. package/dist/portal-recipes-DyUXqUtD.js +9 -0
  462. package/dist/portal-recipes-DyUXqUtD.js.map +1 -0
  463. package/dist/{primitives-Du64iDbb.js → primitives-BkkQjYl7.js} +23 -18
  464. package/dist/primitives-BkkQjYl7.js.map +1 -0
  465. package/dist/primitives.js +4 -4
  466. package/dist/{progress-BvF2oCdV.js → progress-DZFXXzPs.js} +9 -9
  467. package/dist/{progress-BvF2oCdV.js.map → progress-DZFXXzPs.js.map} +1 -1
  468. package/dist/{receipt-D789Jwyy.js → receipt-C7LhOg7Q.js} +7 -7
  469. package/dist/receipt-C7LhOg7Q.js.map +1 -0
  470. package/dist/rich-text-BnTzZjIo.js +45 -0
  471. package/dist/rich-text-BnTzZjIo.js.map +1 -0
  472. package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-CAurDwT5.js} +501 -424
  473. package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
  474. package/dist/rich-text-editor-toolbar-DbXig7Jk.js +99 -0
  475. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
  476. package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
  477. package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
  478. package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
  479. package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
  480. package/dist/{scroll-area-La5RXsEk.js → scroll-area-Bj6CRUif.js} +2 -2
  481. package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
  482. package/dist/{separator-DAEV0w65.js → separator-B9ewiCGO.js} +2 -2
  483. package/dist/{separator-DAEV0w65.js.map → separator-B9ewiCGO.js.map} +1 -1
  484. package/dist/{separator-GNfPG-90.js → separator-DM6gs2vu.js} +3 -3
  485. package/dist/{separator-GNfPG-90.js.map → separator-DM6gs2vu.js.map} +1 -1
  486. package/dist/services/actions.js +1 -1
  487. package/dist/settings-DZPHgpx4.js +155 -0
  488. package/dist/settings-DZPHgpx4.js.map +1 -0
  489. package/dist/sheet-C4DHsgLk.js +250 -0
  490. package/dist/sheet-C4DHsgLk.js.map +1 -0
  491. package/dist/sidebar-C8BnDwTH.js +709 -0
  492. package/dist/sidebar-C8BnDwTH.js.map +1 -0
  493. package/dist/sidebar-CmD6a-HK.js +1004 -0
  494. package/dist/sidebar-CmD6a-HK.js.map +1 -0
  495. package/dist/skeleton-DDgdhmu9.js +265 -0
  496. package/dist/skeleton-DDgdhmu9.js.map +1 -0
  497. package/dist/smart-card-B6vLxqa_.js +617 -0
  498. package/dist/smart-card-B6vLxqa_.js.map +1 -0
  499. package/dist/{structure-C0V0_Fyf.js → structure-DZJ2wbAU.js} +2 -2
  500. package/dist/{structure-C0V0_Fyf.js.map → structure-DZJ2wbAU.js.map} +1 -1
  501. package/dist/style.css +1 -1
  502. package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
  503. package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
  504. package/dist/{table-DH7rozUv.js → table-CBonSdTp.js} +573 -519
  505. package/dist/table-CBonSdTp.js.map +1 -0
  506. package/dist/{table-CpvnzJn9.js → table-CXSPHH25.js} +75 -71
  507. package/dist/table-CXSPHH25.js.map +1 -0
  508. package/dist/tabs-C4Kr_hCr.js +192 -0
  509. package/dist/tabs-C4Kr_hCr.js.map +1 -0
  510. package/dist/{text-inputs-DXItiR0O.js → text-inputs-jdkS3ReG.js} +18 -18
  511. package/dist/text-inputs-jdkS3ReG.js.map +1 -0
  512. package/dist/theme.css +40 -37
  513. package/dist/{timelines-DmtztAY_.js → timelines-CoPwdJP0.js} +13 -12
  514. package/dist/timelines-CoPwdJP0.js.map +1 -0
  515. package/dist/tooltip-31NwIpTo.js +113 -0
  516. package/dist/tooltip-31NwIpTo.js.map +1 -0
  517. package/dist/{tree-CV11PURP.js → tree-CeYVzdFE.js} +9 -9
  518. package/dist/{tree-CV11PURP.js.map → tree-CeYVzdFE.js.map} +1 -1
  519. package/dist/typography/rich-text.js +1 -1
  520. package/dist/{typography-CSyJrh28.js → typography-C7-YMW1S.js} +12 -12
  521. package/dist/{typography-CSyJrh28.js.map → typography-C7-YMW1S.js.map} +1 -1
  522. package/dist/typography.js +1 -1
  523. package/dist/ui-provider-C-74NVLc.js +178 -0
  524. package/dist/ui-provider-C-74NVLc.js.map +1 -0
  525. package/dist/ui-provider.js +2 -3
  526. package/dist/{upload-C9SA0X-8.js → upload-Hdm5gObf.js} +309 -296
  527. package/dist/upload-Hdm5gObf.js.map +1 -0
  528. package/dist/{upload-queue-DhQJiSRc.js → upload-queue-D0sYPuqo.js} +16 -14
  529. package/dist/upload-queue-D0sYPuqo.js.map +1 -0
  530. package/dist/{usage-card-DVTRDmGz.js → usage-card-9s8hLDfn.js} +24 -17
  531. package/dist/usage-card-9s8hLDfn.js.map +1 -0
  532. package/dist/{utils-CF3c95Io.js → utils-DhuoqFy4.js} +255 -165
  533. package/dist/utils-DhuoqFy4.js.map +1 -0
  534. package/dist/value-inputs-D3aPgq9H.js +980 -0
  535. package/dist/value-inputs-D3aPgq9H.js.map +1 -0
  536. package/dist/{value-typography-ClupF0Gz.js → value-typography-uSzzG9Gf.js} +32 -26
  537. package/dist/value-typography-uSzzG9Gf.js.map +1 -0
  538. package/dist/{workspace-9EFVXUyk.js → workspace-CC8Vchiu.js} +51 -50
  539. package/dist/workspace-CC8Vchiu.js.map +1 -0
  540. package/docs/consumer-skill/SKILL.md +4 -3
  541. package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
  542. package/docs/consumer-skill/examples/app-layout.tsx +52 -1
  543. package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
  544. package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
  545. package/docs/consumer-skill/examples/detail.tsx +5 -4
  546. package/docs/consumer-skill/examples/edit.tsx +3 -3
  547. package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
  548. package/docs/consumer-skill/examples/index-table.tsx +4 -4
  549. package/docs/consumer-skill/examples/manifest.json +38 -1
  550. package/docs/consumer-skill/examples/product-media.tsx +41 -0
  551. package/docs/consumer-skill/examples/product-parts.tsx +81 -0
  552. package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
  553. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
  554. package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
  555. package/docs/consumer-skill/references/agents-md.md +21 -19
  556. package/docs/consumer-skill/references/analytics.md +33 -1
  557. package/docs/consumer-skill/references/commerce-composition.md +97 -0
  558. package/docs/consumer-skill/references/component-contracts.json +21249 -14205
  559. package/docs/consumer-skill/references/composition-mapping.md +17 -3
  560. package/docs/consumer-skill/references/composition.md +177 -32
  561. package/docs/consumer-skill/references/critique-rubric.md +98 -0
  562. package/docs/consumer-skill/references/custom-composition.md +261 -0
  563. package/docs/consumer-skill/references/data-reading.md +79 -0
  564. package/docs/consumer-skill/references/design-contract.md +12 -9
  565. package/docs/consumer-skill/references/discovery.md +27 -3
  566. package/docs/consumer-skill/references/domain-structures.md +124 -0
  567. package/docs/consumer-skill/references/installation.md +62 -8
  568. package/docs/consumer-skill/references/integration.md +59 -1
  569. package/docs/consumer-skill/references/product-composition.md +94 -0
  570. package/docs/consumer-skill/references/public-api.json +3044 -445
  571. package/docs/consumer-skill/references/review.md +87 -10
  572. package/docs/consumer-skill/references/rhf-workflows.md +79 -0
  573. package/docs/consumer-skill/references/screen-archetypes.md +19 -7
  574. package/docs/consumer-skill/references/screen-decisions.md +126 -0
  575. package/docs/consumer-skill/references/theming.md +24 -20
  576. package/docs/consumer-skill/references/tokens.json +9 -9
  577. package/docs/consumer-skill/references/view-craft.md +153 -0
  578. package/docs/consumer-skill/references/view-spec.md +73 -0
  579. package/docs/consumer-skill/references/workflows.md +7 -1
  580. package/docs/consumer-skill/scripts/composition-policy.mjs +176 -26
  581. package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
  582. package/docs/consumer-skill/scripts/composition.mjs +61 -5
  583. package/docs/consumer-skill/scripts/discovery.mjs +54 -0
  584. package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
  585. package/docs/consumer-skill/scripts/inspection.mjs +73 -18
  586. package/docs/consumer-skill/scripts/setup-skills.mjs +79 -7
  587. package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
  588. package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
  589. package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
  590. package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
  591. package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
  592. package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
  593. package/package.json +4 -2
  594. package/templates/admin-shell-template.tsx +1 -2
  595. package/templates/customers-template.tsx +18 -16
  596. package/dist/accordion-96o0pN62.js.map +0 -1
  597. package/dist/action-menu-CHgs8vmj.js.map +0 -1
  598. package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
  599. package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
  600. package/dist/app-shell-D63ATkIK.js +0 -237
  601. package/dist/app-shell-D63ATkIK.js.map +0 -1
  602. package/dist/auth-D2FVZ1MH.js.map +0 -1
  603. package/dist/avatar-DWO_HHhB.js.map +0 -1
  604. package/dist/base/cascader.js.map +0 -1
  605. package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
  606. package/dist/breadcrumbs-B-WFKecD.js.map +0 -1
  607. package/dist/button-DkmK-z8E.js.map +0 -1
  608. package/dist/buttons-BbfzgczK.js.map +0 -1
  609. package/dist/cards-4JTWqvVe.js +0 -68
  610. package/dist/cards-4JTWqvVe.js.map +0 -1
  611. package/dist/chart-C19flDQb.js +0 -155
  612. package/dist/chart-C19flDQb.js.map +0 -1
  613. package/dist/choice-inputs-JLtij2y4.js +0 -776
  614. package/dist/choice-inputs-JLtij2y4.js.map +0 -1
  615. package/dist/code-block-CGNaUtAE.js.map +0 -1
  616. package/dist/combobox-CBJDs6w_.js +0 -877
  617. package/dist/combobox-CBJDs6w_.js.map +0 -1
  618. package/dist/combobox-hbhSS18O.js +0 -355
  619. package/dist/combobox-hbhSS18O.js.map +0 -1
  620. package/dist/command-D8NrBj-b.js.map +0 -1
  621. package/dist/comments-Di4w0H_S.js.map +0 -1
  622. package/dist/containers-CRmHf7GP.js.map +0 -1
  623. package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
  624. package/dist/data-display-D4oujtx0.js.map +0 -1
  625. package/dist/date-picker-zOt1oNss.js +0 -1542
  626. package/dist/date-picker-zOt1oNss.js.map +0 -1
  627. package/dist/date-pickers-cj8IXbDC.js +0 -179
  628. package/dist/date-pickers-cj8IXbDC.js.map +0 -1
  629. package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
  630. package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
  631. package/dist/feedback-DZNL5Lg1.js +0 -239
  632. package/dist/feedback-DZNL5Lg1.js.map +0 -1
  633. package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
  634. package/dist/filters-BcT-uoFy.js +0 -2209
  635. package/dist/filters-BcT-uoFy.js.map +0 -1
  636. package/dist/form-field-CsgRmdit.js +0 -63
  637. package/dist/form-field-CsgRmdit.js.map +0 -1
  638. package/dist/form-sizing-NXgjkmBG.js.map +0 -1
  639. package/dist/forms-BV5m5aQF.js.map +0 -1
  640. package/dist/forms-numeric-Cd33AKbD.js +0 -906
  641. package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
  642. package/dist/header-BA697l4a.js.map +0 -1
  643. package/dist/hooks-BQ-L7Uu2.js.map +0 -1
  644. package/dist/input-DOPL5_QE.js +0 -21
  645. package/dist/input-DOPL5_QE.js.map +0 -1
  646. package/dist/item-BvZ2DR_x.js +0 -277
  647. package/dist/item-BvZ2DR_x.js.map +0 -1
  648. package/dist/layout.types-Cn7aUzJp.js +0 -20
  649. package/dist/layout.types-Cn7aUzJp.js.map +0 -1
  650. package/dist/mentions-RKOQaaIB.js.map +0 -1
  651. package/dist/message-INU2xsxu.js +0 -128
  652. package/dist/message-INU2xsxu.js.map +0 -1
  653. package/dist/metadata-list-qVV7AVxa.js.map +0 -1
  654. package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
  655. package/dist/navigation-BQNcg1jT.js +0 -269
  656. package/dist/navigation-BQNcg1jT.js.map +0 -1
  657. package/dist/navigation-DLF3E1IC.js +0 -145
  658. package/dist/navigation-DLF3E1IC.js.map +0 -1
  659. package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
  660. package/dist/number-E_OiIfJz.js.map +0 -1
  661. package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
  662. package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
  663. package/dist/overlays-BlKynmde.js +0 -1004
  664. package/dist/overlays-BlKynmde.js.map +0 -1
  665. package/dist/page-CIwNUtGr.js +0 -227
  666. package/dist/page-CIwNUtGr.js.map +0 -1
  667. package/dist/page-header-commands-DFMlNYzN.js +0 -128
  668. package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
  669. package/dist/popover-uwzX2vo7.js +0 -198
  670. package/dist/popover-uwzX2vo7.js.map +0 -1
  671. package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
  672. package/dist/primitives-Du64iDbb.js.map +0 -1
  673. package/dist/receipt-D789Jwyy.js.map +0 -1
  674. package/dist/rich-text-CLJEf76s.js +0 -78
  675. package/dist/rich-text-CLJEf76s.js.map +0 -1
  676. package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
  677. package/dist/rich-text-editor-toolbar-L__e4x47.js +0 -94
  678. package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
  679. package/dist/safe-image-src-C6kQSMBZ.js +0 -17
  680. package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
  681. package/dist/sanitize-html-DsQmI48u.js.map +0 -1
  682. package/dist/settings-BA2iboic.js +0 -174
  683. package/dist/settings-BA2iboic.js.map +0 -1
  684. package/dist/sheet-DoAxTb2J.js +0 -213
  685. package/dist/sheet-DoAxTb2J.js.map +0 -1
  686. package/dist/sidebar-ByqKR_W5.js +0 -512
  687. package/dist/sidebar-ByqKR_W5.js.map +0 -1
  688. package/dist/sidebar-D2iSnGJ7.js +0 -619
  689. package/dist/sidebar-D2iSnGJ7.js.map +0 -1
  690. package/dist/skeleton-CUj8O5Bd.js +0 -264
  691. package/dist/skeleton-CUj8O5Bd.js.map +0 -1
  692. package/dist/smart-card-CqkzQsK-.js +0 -614
  693. package/dist/smart-card-CqkzQsK-.js.map +0 -1
  694. package/dist/table-CpvnzJn9.js.map +0 -1
  695. package/dist/table-DH7rozUv.js.map +0 -1
  696. package/dist/tabs-eqVsJZWO.js +0 -191
  697. package/dist/tabs-eqVsJZWO.js.map +0 -1
  698. package/dist/text-inputs-DXItiR0O.js.map +0 -1
  699. package/dist/theme-scope-BJ6eE2xt.js +0 -50
  700. package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
  701. package/dist/timelines-DmtztAY_.js.map +0 -1
  702. package/dist/tooltip-B4hjKtoV.js +0 -111
  703. package/dist/tooltip-B4hjKtoV.js.map +0 -1
  704. package/dist/ui-provider-CQCuCBcy.js +0 -136
  705. package/dist/ui-provider-CQCuCBcy.js.map +0 -1
  706. package/dist/upload-C9SA0X-8.js.map +0 -1
  707. package/dist/upload-queue-DhQJiSRc.js.map +0 -1
  708. package/dist/usage-card-DVTRDmGz.js.map +0 -1
  709. package/dist/use-mobile-vaLKwgyf.js +0 -15
  710. package/dist/use-mobile-vaLKwgyf.js.map +0 -1
  711. package/dist/utils-CF3c95Io.js.map +0 -1
  712. package/dist/value-inputs-C0o70p-U.js +0 -980
  713. package/dist/value-inputs-C0o70p-U.js.map +0 -1
  714. package/dist/value-typography-ClupF0Gz.js.map +0 -1
  715. package/dist/workspace-9EFVXUyk.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"tooltip-B4hjKtoV.js","names":["TooltipProvider","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","Tooltip","BaseTooltip","TooltipProviderPrimitive","TooltipTriggerPrimitive","TooltipContentPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","TooltipProvider$1","props","Tooltip","delayDuration","delay","Tooltip$2","TooltipTrigger$1","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","TooltipContent$1","resolvedContainer","container","cn","className","children","TooltipDescriptionContext","createContext","SharedTooltipProviderContext","Tooltip$1","hasSharedProvider","useContext","generatedId","useId","descriptionId","setDescriptionId","useState","root","TooltipProvider","TooltipTrigger","TooltipContent","description","content"],"sources":["../src/components/ui/tooltip.tsx","../src/components/base/display/tooltip.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction TooltipProvider({\n delay = 0,\n delayDuration,\n ...props\n}: TooltipPrimitive.Provider.Props & { delayDuration?: number }) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delayDuration ?? delay}\n {...props}\n />\n )\n}\n\nfunction Tooltip({ ...props }: TooltipPrimitive.Root.Props) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n asChild = false,\n render,\n children,\n ...props\n}: TooltipPrimitive.Trigger.Props & { asChild?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: TooltipPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n\n return (\n <TooltipPrimitive.Trigger\n data-slot=\"tooltip-trigger\"\n render={slotRender ?? safeRender}\n {...props}\n >\n {children}\n </TooltipPrimitive.Trigger>\n )\n}\n\nfunction TooltipContent({\n className,\n container,\n side = \"top\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n positionMethod = anchoredPositionMethod,\n children,\n ...props\n}: TooltipPrimitive.Popup.Props &\n Pick<\n TooltipPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"positionMethod\"\n > & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <TooltipPrimitive.Portal container={resolvedContainer}>\n <TooltipPrimitive.Positioner\n positionMethod={positionMethod}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-content\"\n className={cn(\n motionRecipes.popup,\n \"rounded-radius px-space-md py-space-xs text-xs bg-inverse-background text-inverse-foreground z-50 w-fit max-w-xs origin-(--transform-origin)\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-inverse-background fill-inverse-background z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5\" />\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","/** Tokenized base wrappers for short, non-interactive contextual help. */\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport { createContext, useContext, useId, useLayoutEffect, useState, type ComponentProps } from 'react';\n\nimport {\n\tTooltipContent as TooltipContentPrimitive,\n\tTooltipProvider as TooltipProviderPrimitive,\n\tTooltipTrigger as TooltipTriggerPrimitive,\n} from '../../ui/tooltip';\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\n\nexport type TooltipProps = ComponentProps<typeof BaseTooltip.Root>;\nexport type TooltipProviderProps = ComponentProps<typeof TooltipProviderPrimitive>;\nexport type TooltipTriggerProps = ComponentProps<typeof TooltipTriggerPrimitive>;\nexport type TooltipContentProps = ComponentProps<typeof TooltipContentPrimitive>;\n\nconst TooltipDescriptionContext = createContext<{ id: string; setId: (id: string) => void } | undefined>(undefined);\n\nconst SharedTooltipProviderContext = createContext(false);\n\n/** Tooltip state root. It does not render a DOM node. */\nexport function Tooltip(props: TooltipProps) {\n\tconst hasSharedProvider = useContext(SharedTooltipProviderContext);\n\tconst generatedId = useId();\n\tconst [descriptionId, setDescriptionId] = useState(generatedId);\n\tconst root = <TooltipDescriptionContext.Provider value={{ id: descriptionId, setId: setDescriptionId }}><BaseTooltip.Root data-slot=\"tooltip\" {...props} /></TooltipDescriptionContext.Provider>;\n\n\treturn hasSharedProvider ? root : <TooltipProviderPrimitive>{root}</TooltipProviderPrimitive>;\n}\n\n/** Shared delay provider for a group of tooltip roots. Nested Tooltip roots reuse it. */\nexport function TooltipProvider(props: TooltipProviderProps) {\n\treturn (\n\t\t<SharedTooltipProviderContext.Provider value>\n\t\t\t<TooltipProviderPrimitive {...props} />\n\t\t</SharedTooltipProviderContext.Provider>\n\t);\n}\n\n/** Polymorphic tooltip anchor. */\nexport function TooltipTrigger({ className, ...props }: TooltipTriggerProps) {\n\tconst description = useContext(TooltipDescriptionContext);\n\tconst descriptionId = description?.id;\n\treturn (\n\t\t<TooltipTriggerPrimitive\n\t\t\tclassName={cn('tooltip-trigger--component active:translate-y-0!', className)}\n\t\t\t{...props}\n\t\t\taria-describedby={[props['aria-describedby'], descriptionId].filter(Boolean).join(' ') || undefined}\n\t\t/>\n\t);\n}\n\n/** Inverse contextual-help surface with package spacing and typography. */\nexport function TooltipContent({ children, className, ...props }: TooltipContentProps) {\n\tconst description = useContext(TooltipDescriptionContext);\n\tconst descriptionId = props.id ?? description?.id;\n\tuseLayoutEffect(() => { if (descriptionId) description?.setId(descriptionId); }, [descriptionId, description?.setId]);\n\tconst isSimpleText = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint';\n\tconst content = isSimpleText ? (\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"inherit\"\n\t\t\t\t\n\t\t\t\tlineHeight=\"snug\"\n\t\t\t\tclassName=\"tooltip-content--text text-inherit\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Text>\n\t\t) : children;\n\n\treturn (\n\t\t<TooltipContentPrimitive\n\t\t\tid={descriptionId}\n\t\t\trole=\"tooltip\"\n\t\t\tclassName={cn(\n\t\t\t\t// One tooltip anatomy everywhere (plain, Button `withTooltip`, TooltipButton):\n\t\t\t\t// the inline inset clears the fully rounded ends of a one-line tooltip.\n\t\t\t\t'tooltip-content--component max-w-xs rounded-radius px-space-md py-space-xs text-xs leading-snug',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{content}\n\t\t</TooltipContentPrimitive>\n\t);\n}\n\nTooltip.displayName = 'Tooltip';\nTooltipProvider.displayName = 'TooltipProvider';\nTooltipTrigger.displayName = 'TooltipTrigger';\nTooltipContent.displayName = 'TooltipContent';\n"],"mappings":";;;;;;;;;;;AAQA,SAASA,EAAgB,EACvB,WAAQ,GACR,kBACA,GAAGgB,KAC4D;CAC/D,OACE,kBAACf,EAAiB,UAAlB;EACE,aAAU;EACV,OAAOiB,KAAiBC;EACxB,GAAIH;CACL,CAAA;AAEL;AAEA,SAASd,EAAQ,EAAE,GAAGc,KAAsC;CAC1D,OACE,kBAAChB,GAAD,EAAA,UACE,kBAACC,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIe;CAAQ,CAAA,EACxC,CAAA;AAErB;AAEA,SAASb,EAAe,EACtB,aAAU,IACV,WACA,aACA,GAAGa,KACsD;CACzD,IAAMM,IAAaC,IAAU,kBAACT,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCU,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ;CAEJ,OACE,kBAACxB,EAAiB,SAAlB;EACE,aAAU;EACV,QAAQqB,KAAcE;EACtB,GAAIR;EAEH;CACuB,CAAA;AAE9B;AAEA,SAASZ,EAAe,EACtB,cACA,cACA,UAAO,OACP,gBAAa,GACb,WAAQ,UACR,iBAAc,GACd,oBAAiBQ,GACjB,aACA,GAAGI,KAKuC;CAC1C,IAAMe,IAAoBrB,EAAwBsB,CAAS;CAC3D,OACE,kBAAC/B,EAAiB,QAAlB;EAAyB,WAAW8B;EAClC,UAAA,kBAAC9B,EAAiB,YAAlB;GACkB;GACT;GACM;GACP;GACM;GACZ,WAAU;GAEV,UAAA,kBAACA,EAAiB,OAAlB;IACE,aAAU;IACV,WAAWgC,EACXpB,EAAc,OACZ,gJACAqB,CACF;IACA,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AAa,KAAK,CAAC;CAEpH,IAAMC,IADe,OAAOjB,KAAa,YAAY,OAAOA,KAAa,YAAY,OAAOA,KAAa,WAEvG,kBAACxB,GAAD;EACC,KAAI;EACJ,MAAK;EAEL,YAAW;EACX,WAAU;EAET;CACI,CAAA,IACHwB;CAEL,OACC,kBAAC1B,GAAD;EACC,IAAImC;EACJ,MAAK;EACL,WAAWX,EAGV,mGACAC,CACD;EACA,GAAIlB;EAEH,UAAAoC;CACuB,CAAA;AAE3B;AAEA,EAAQ,cAAc,WACtB,EAAgB,cAAc,mBAC9B,EAAe,cAAc,kBAC7B,EAAe,cAAc"}
@@ -1,136 +0,0 @@
1
- "use client";
2
- import { COMPONENT_SCALES as e } from "./component-vocabulary.js";
3
- import { createContext as t, useContext as n, useEffect as r, useRef as i } from "react";
4
- import { useStore as a } from "zustand";
5
- import { createStore as o } from "zustand/vanilla";
6
- import { jsx as s } from "react/jsx-runtime";
7
- import { DirectionProvider as c } from "@base-ui/react/direction-provider";
8
- //#region src/lib/ui-provider/defaults.ts
9
- var l = {
10
- density: { defaultScale: "md" },
11
- formatting: { locale: "en-US" },
12
- money: {
13
- defaultCurrency: "USD",
14
- dualPricingEnabled: !1,
15
- displayMode: "default_only",
16
- dualPricingDisplay: "lines",
17
- formatMode: "with_code"
18
- },
19
- dates: {
20
- weekStartsOn: 1,
21
- format: "dd MMM yyyy"
22
- },
23
- comments: { composerPosition: "top" },
24
- typography: { defaultTextSize: "sm" },
25
- item: { defaultVariant: "default" },
26
- button: {
27
- defaultTone: "secondary",
28
- defaultButtonStyle: "outline"
29
- },
30
- badge: { defaultTone: "neutral" },
31
- card: {
32
- defaultSurface: "card",
33
- defaultHeaderDivider: !1,
34
- defaultFooterDivider: !0
35
- },
36
- overlay: {
37
- defaultConfirmAlign: "center",
38
- defaultDialogAlign: "start"
39
- },
40
- toast: {
41
- duration: 5e3,
42
- position: "bottom-center",
43
- theme: "dark",
44
- closeButton: !0,
45
- richColors: !1,
46
- visibleToasts: 4
47
- },
48
- spinner: { defaultVariant: "default" }
49
- };
50
- //#endregion
51
- //#region src/lib/ui-provider/scale.ts
52
- function u(t) {
53
- return e.includes(t);
54
- }
55
- function d(e, t, n = "md") {
56
- return u(e) ? e : u(t) ? t : u(n) ? n : "md";
57
- }
58
- //#endregion
59
- //#region src/lib/ui-provider/store.ts
60
- function f(e = {}, t = l) {
61
- return {
62
- density: { defaultScale: d(e.density?.defaultScale, t.density.defaultScale) },
63
- formatting: {
64
- ...t.formatting,
65
- ...e.formatting
66
- },
67
- money: {
68
- ...t.money,
69
- ...e.money
70
- },
71
- dates: {
72
- ...t.dates,
73
- ...e.dates
74
- },
75
- comments: {
76
- ...t.comments,
77
- ...e.comments
78
- },
79
- typography: {
80
- ...t.typography,
81
- ...e.typography
82
- },
83
- item: {
84
- ...t.item,
85
- ...e.item
86
- },
87
- button: {
88
- ...t.button,
89
- ...e.button
90
- },
91
- badge: {
92
- ...t.badge,
93
- ...e.badge
94
- },
95
- card: {
96
- ...t.card,
97
- ...e.card
98
- },
99
- overlay: {
100
- ...t.overlay,
101
- ...e.overlay
102
- },
103
- toast: {
104
- ...t.toast,
105
- ...e.toast
106
- },
107
- spinner: {
108
- ...t.spinner,
109
- ...e.spinner
110
- }
111
- };
112
- }
113
- function p(e = {}, t) {
114
- return o(() => f(e, t));
115
- }
116
- var m = t(null), h = p();
117
- function g(e) {
118
- let t = n(m);
119
- return a(t ?? h, e);
120
- }
121
- //#endregion
122
- //#region src/lib/ui-provider/provider.tsx
123
- function _({ config: e, children: t }) {
124
- let a = n(m), o = i(null);
125
- return i(e), o.current === null && (o.current = p(e, a?.getState())), r(() => {}, [e]), /* @__PURE__ */ s(m.Provider, {
126
- value: o.current,
127
- children: t
128
- });
129
- }
130
- //#endregion
131
- //#region src/lib/ui-provider/hooks.ts
132
- var v = () => g((e) => e.density), y = () => g((e) => e.formatting), b = () => g((e) => e.money), x = () => g((e) => e.dates), S = () => g((e) => e.comments), C = () => g((e) => e.typography), w = () => g((e) => e.item), T = () => g((e) => e.button), E = () => g((e) => e.badge), D = () => g((e) => e.card), O = () => g((e) => e.overlay), k = () => g((e) => e.toast), A = () => g((e) => e.spinner);
133
- //#endregion
134
- export { u as _, S as a, y as c, O as d, A as f, f as g, _ as h, D as i, w as l, C as m, E as n, x as o, k as p, T as r, v as s, c as t, b as u, d as v, l as y };
135
-
136
- //# sourceMappingURL=ui-provider-CQCuCBcy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui-provider-CQCuCBcy.js","names":["DEFAULT_UI_CONFIG","isComponentScale","COMPONENT_SCALES","value","resolveComponentScale","propScale","providerScale","fallback","resolveUIConfig","config","base","createUIStore","createStore","UIStoreContext","createContext","fallbackUIStore","useUIStore","contextualStore","useContext","useStore","selector","UIProvider","parentStore","storeRef","useRef","useEffect","useDensityConfig","s","useFormattingConfig","useMoneyConfig","useDatesConfig","useCommentsConfig","useTypographyConfig","useItemConfig","useButtonConfig","useBadgeConfig","useCardConfig","useOverlayConfig","useToastConfig","useSpinnerConfig","DirectionProvider"],"sources":["../src/lib/ui-provider/defaults.ts","../src/lib/ui-provider/scale.ts","../src/lib/ui-provider/store.ts","../src/lib/ui-provider/provider.tsx","../src/lib/ui-provider/hooks.ts"],"sourcesContent":["/**\n * Hardcoded library-wide defaults.\n *\n * These are the values the store ships with — every component reading via\n * `useFooConfig()` gets these even when no `<UIProvider>` is mounted.\n *\n * Each `<UIProvider>` creates an isolated mount-once store synchronously, so\n * these defaults work for browser rendering, SSR, and multiple React roots.\n * Components outside a provider read the no-provider fallback store.\n */\nimport type { ResolvedUIConfig } from './types';\n\nexport const DEFAULT_UI_CONFIG: ResolvedUIConfig = {\n\tdensity: {\n\t\tdefaultScale: 'md',\n\t},\n\tformatting: {\n\t\tlocale: 'en-US',\n\t},\n\tmoney: {\n\t\tdefaultCurrency: 'USD',\n\t\tdualPricingEnabled: false,\n\t\tdisplayMode: 'default_only',\n\t\tdualPricingDisplay: 'lines',\n\t\tformatMode: 'with_code',\n\t},\n\tdates: {\n\t\tweekStartsOn: 1,\n\t\tformat: 'dd MMM yyyy',\n\t},\n\tcomments: {\n\t\tcomposerPosition: 'top',\n\t},\n\ttypography: {\n\t\tdefaultTextSize: 'sm',\n\t},\n\titem: {\n\t\tdefaultVariant: 'default',\n\t},\n\tbutton: {\n\t\t// The neutral button; the one main command opts into tone=\"primary\".\n\t\tdefaultTone: 'secondary',\n\t\tdefaultButtonStyle: 'outline',\n\t},\n\tbadge: {\n\t\tdefaultTone: 'neutral',\n\t},\n\tcard: {\n\t\tdefaultSurface: 'card',\n\t\tdefaultHeaderDivider: false,\n\t\tdefaultFooterDivider: true,\n\t},\n\toverlay: {\n\t\t// A confirmation reads as one centred question above its answers; a task\n\t\t// dialog keeps its heading and actions on the reading edge.\n\t\tdefaultConfirmAlign: 'center',\n\t\tdefaultDialogAlign: 'start',\n\t},\n\ttoast: {\n\t\tduration: 5000,\n\t\tposition: 'bottom-center',\n\t\ttheme: 'dark',\n\t\tcloseButton: true,\n\t\trichColors: false,\n\t\tvisibleToasts: 4,\n\t},\n\tspinner: {\n\t\tdefaultVariant: 'default',\n\t},\n};\n","import {\n\tCOMPONENT_SCALES,\n\ttype ComponentScale,\n} from '../component-vocabulary';\n\n/** Runtime guard for serialized or otherwise untyped component scale values. */\nexport function isComponentScale(value: unknown): value is ComponentScale {\n\treturn COMPONENT_SCALES.includes(value as ComponentScale);\n}\n\n/** Resolve direct, provider, and local scale defaults in precedence order. */\nexport function resolveComponentScale(\n\tpropScale: ComponentScale | undefined,\n\tproviderScale: ComponentScale | undefined,\n\tfallback: ComponentScale = 'md',\n): ComponentScale {\n\tif (isComponentScale(propScale)) return propScale;\n\tif (isComponentScale(providerScale)) return providerScale;\n\treturn isComponentScale(fallback) ? fallback : 'md';\n}\n","/**\n * Store plumbing for `<UIProvider>`.\n *\n * Each provider owns a vanilla Zustand store. This keeps independent React\n * roots and concurrent SSR requests isolated while retaining slice-scoped\n * subscriptions. A fallback store keeps components functional when no\n * provider is mounted and preserves the historical test bootstrap helpers.\n */\nimport { createContext, useContext } from 'react';\nimport { useStore } from 'zustand';\nimport { createStore, type StoreApi } from 'zustand/vanilla';\n\nimport { DEFAULT_UI_CONFIG } from './defaults';\nimport { resolveComponentScale } from './scale';\nimport type { ResolvedUIConfig, UIConfig } from './types';\n\nexport type UIStore = StoreApi<ResolvedUIConfig>;\n\n/**\n * Merge a partial config over a resolved base: the package defaults for a\n * root provider, or the parent provider's resolved defaults when nested.\n */\nexport function resolveUIConfig(\n\tconfig: UIConfig = {},\n\tbase: ResolvedUIConfig = DEFAULT_UI_CONFIG,\n): ResolvedUIConfig {\n\treturn {\n\t\tdensity: {\n\t\t\tdefaultScale: resolveComponentScale(\n\t\t\t\tconfig.density?.defaultScale,\n\t\t\t\tbase.density.defaultScale,\n\t\t\t),\n\t\t},\n\t\tformatting: { ...base.formatting, ...config.formatting },\n\t\tmoney: { ...base.money, ...config.money },\n\t\tdates: { ...base.dates, ...config.dates },\n\t\tcomments: { ...base.comments, ...config.comments },\n\t\ttypography: { ...base.typography, ...config.typography },\n\t\titem: { ...base.item, ...config.item },\n\t\tbutton: { ...base.button, ...config.button },\n\t\tbadge: { ...base.badge, ...config.badge },\n\t\tcard: { ...base.card, ...config.card },\n\t\toverlay: { ...base.overlay, ...config.overlay },\n\t\ttoast: { ...base.toast, ...config.toast },\n\t\tspinner: { ...base.spinner, ...config.spinner },\n\t};\n}\n\nexport function createUIStore(config: UIConfig = {}, base?: ResolvedUIConfig): UIStore {\n\treturn createStore<ResolvedUIConfig>(() => resolveUIConfig(config, base));\n}\n\nexport const UIStoreContext = createContext<UIStore | null>(null);\n\nconst fallbackUIStore = createUIStore();\n\nexport function useUIStore<T>(selector: (state: ResolvedUIConfig) => T): T {\n\tconst contextualStore = useContext(UIStoreContext);\n\treturn useStore(contextualStore ?? fallbackUIStore, selector);\n}\n\n/** Test-only helper for components rendered without a provider. */\nexport function applyUIConfig(config: UIConfig): void {\n\tfallbackUIStore.setState((state) => {\n\t\tconst next = { ...state };\n\t\tconst nextSlices = next as unknown as Record<keyof UIConfig, object>;\n\t\tconst currentSlices = state as unknown as Record<keyof UIConfig, object>;\n\n\t\tfor (const key of Object.keys(config) as Array<keyof UIConfig>) {\n\t\t\tconst override = config[key];\n\t\t\tif (!override) continue;\n\t\t\tnextSlices[key] = { ...currentSlices[key], ...override };\n\t\t}\n\n\t\treturn next;\n\t});\n}\n\n/** Test-only reset for the no-provider fallback store. */\nexport function resetUIConfig(): void {\n\tfallbackUIStore.setState(resolveUIConfig(), true);\n}\n","/**\n * `<UIProvider>` — an isolated, mount-once display-default boundary.\n *\n * The store is created synchronously on the first render, so server output,\n * hydration, and the first browser render all observe the same configuration.\n * Independent roots and SSR requests never share mutable provider state. A\n * nested provider starts from its parent's resolved defaults and overrides\n * only the keys it sets.\n */\nimport { useContext, useEffect, useRef, type ReactNode } from 'react';\n\nimport { createUIStore, UIStoreContext, type UIStore } from './store';\nimport type { UIConfig } from './types';\n\nexport interface UIProviderProps {\n\t/**\n\t * Partial display-default tree merged over the nearest parent provider's\n\t * defaults, or over `DEFAULT_UI_CONFIG` at the root.\n\t */\n\tconfig?: UIConfig;\n\tchildren: ReactNode;\n}\n\nexport function UIProvider({ config, children }: UIProviderProps) {\n\tconst parentStore = useContext(UIStoreContext);\n\tconst storeRef = useRef<UIStore | null>(null);\n\tconst initialConfigRef = useRef<UIConfig | undefined>(config);\n\n\tif (storeRef.current === null) {\n\t\t// Both providers are mount-once, so the parent snapshot stays exact.\n\t\tstoreRef.current = createUIStore(config, parentStore?.getState());\n\t}\n\n\tuseEffect(() => {\n\t\tif (import.meta.env?.DEV && initialConfigRef.current !== config) {\n\t\t\tconsole.warn(\n\t\t\t\t'[UIProvider] `config` is mount-once. Subsequent prop identity ' +\n\t\t\t\t\t'changes are ignored; use direct component props for per-mount state.',\n\t\t\t);\n\t\t}\n\t}, [config]);\n\n\treturn (\n\t\t<UIStoreContext.Provider value={storeRef.current}>\n\t\t\t{children}\n\t\t</UIStoreContext.Provider>\n\t);\n}\n","/**\n * Slice selector hooks.\n *\n * Each hook reads exactly one slice from the store. Components that only\n * care about `money` will not re-render when `dates` changes, etc.\n *\n * Every selector returns a guaranteed-populated slice (the store is\n * initialized with `DEFAULT_UI_CONFIG`), so component code can write:\n *\n * const { defaultCurrency } = useMoneyConfig();\n * const currency = props.currency ?? defaultCurrency;\n *\n * — no need to chain optional-access through the slice.\n */\nimport { useUIStore } from './store';\nimport type {\n\tButtonConfigSlice,\n\tBadgeConfigSlice,\n\tCardConfigSlice,\n\tCommentsDefaultsConfig,\n\tDatesConfig,\n\tDensityConfigSlice,\n\tFormattingConfigSlice,\n\tItemConfigSlice,\n\tMoneyConfig,\n\tOverlayConfigSlice,\n\tSpinnerConfigSlice,\n\tToastConfig,\n\tTypographyConfigSlice,\n} from './types';\n\nexport const useDensityConfig = (): DensityConfigSlice =>\n\tuseUIStore((s) => s.density);\n\nexport const useFormattingConfig = (): FormattingConfigSlice =>\n\tuseUIStore((s) => s.formatting);\n\nexport const useMoneyConfig = (): MoneyConfig =>\n\tuseUIStore((s) => s.money);\n\nexport const useDatesConfig = (): DatesConfig =>\n\tuseUIStore((s) => s.dates);\n\nexport const useCommentsConfig = (): CommentsDefaultsConfig =>\n\tuseUIStore((s) => s.comments);\n\nexport const useTypographyConfig = (): TypographyConfigSlice =>\n\tuseUIStore((s) => s.typography);\n\nexport const useItemConfig = (): ItemConfigSlice =>\n\tuseUIStore((s) => s.item);\n\nexport const useButtonConfig = (): ButtonConfigSlice =>\n\tuseUIStore((s) => s.button);\n\nexport const useBadgeConfig = (): BadgeConfigSlice =>\n\tuseUIStore((s) => s.badge);\n\nexport const useCardConfig = (): CardConfigSlice =>\n\tuseUIStore((s) => s.card);\n\nexport const useOverlayConfig = (): OverlayConfigSlice =>\n\tuseUIStore((s) => s.overlay);\n\nexport const useToastConfig = (): ToastConfig =>\n\tuseUIStore((s) => s.toast);\n\nexport const useSpinnerConfig = (): SpinnerConfigSlice =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,GAAY,MAAMW,EAAE,QAAQ,GAEhBK,UACZhB,GAAY,MAAMW,EAAE,UAAU,GAElBM,UACZjB,GAAY,MAAMW,EAAE,IAAI,GAEZO,UACZlB,GAAY,MAAMW,EAAE,MAAM,GAEdQ,UACZnB,GAAY,MAAMW,EAAE,KAAK,GAEbS,UACZpB,GAAY,MAAMW,EAAE,IAAI,GAEZU,UACZrB,GAAY,MAAMW,EAAE,OAAO,GAEfW,UACZtB,GAAY,MAAMW,EAAE,KAAK,GAEbY,UACZvB,GAAY,MAAMW,EAAE,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-C9SA0X-8.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;CAC1D,aAAa;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,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 +0,0 @@
1
- {"version":3,"file":"upload-queue-DhQJiSRc.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\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</Stack>\n\t);\n});\n\nUploadTray.displayName = 'UploadTray';\n"],"mappings":";;;;;;;;;;;;;;;AAwBA,IAAaqB,IAAkBC,EAC9B,SACC,EAAE,cAAW,YAAS,YAAS,GAAGC,KAClC,GACC;CACD,IAAMC,KAAe,MAAwC;EA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MA,GAAU;GAChB,UAAUA,GAAU;GACpB,SAASA,GAAU;GACnB,SAASA,GAAU;EACnB,CAAA,GAEA,CAAC,CAACD,KACF,kBAAAxF,GAAA,EAAA,UAAA,CACC,kBAACM,GAAD;GAAO,WAAU;GAAa,MAAA;GAAK,OAAM;GAAS,SAAQ;GAAU,KAAI;GAAxE,UAAA,CACC,kBAACA,GAAD;IAAO,WAAU;IAAa,MAAA;IAAK,OAAM;IAAS,KAAI;IAAtD,UAAA;KACC,kBAACD,GAAD;MAAM,KAAI;MAAO,MAAK;MAAU,QAAO;MACrC,UAAAkC,EAAQ;KACJ,CAAA;KACLyC,IAAY,KACZ,kBAACvE,GAAD;MAAO,MAAK;MAAZ,UAAA;OACE8B,EAAQ;OAAe;OAAGyC;MACrB;;KAEPC,IAAS,KACT,kBAACxE,GAAD;MAAO,MAAK;MAAZ,UAAA;OACE8B,EAAQ;OAAY;OAAG0C;MAClB;;KAEPC,IAAY,KACZ,kBAACzE,GAAD;MAAO,MAAK;MAAZ,UAAA;OACE8B,EAAQ;OAAe;OAAG2C;MACrB;;KAEPC,IAAS,KACT,kBAAC1E,GAAD;MAAO,MAAK;MAAZ,UAAA;OACE8B,EAAQ;OAAY;OAAG4C;MAClB;;IAEF;GACN,CAAA,GAAA,CAAC,CAACO,KACF,kBAACtF,GAAD;IAAQ,MAAK;IAAS,MAAK;IAAY,aAAY;IAAQ,SAASsF;IAClE,UAAAnD,EAAQ;GACF,CAAA,CAEH;EAEP,CAAA,GAAA,kBAACuB,GAAD;GACQ;GACI;GACC;GACF;GACD;GACC;GACV,SAAS6B;EACT,CAAA,CACA,EAAA,CAAA,CAEG;;AAET,CAAC;AAED,EAAW,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-card-DVTRDmGz.js","names":["NumberValue","_Fragment","useFormattingConfig","cn","Button","Text","DisplayLabel","Grid","Stack","Card","ProgressTrack","Progress","compositionRhythm","Percent","Number$1","TabsTrigger","TabsContent","TabsList","Tabs","validUsage","value","usageExceeds","actual","expected","tolerance","terms","quotaSummary","used","usedValue","limit","limitValue","kind","ratio","dailySummary","values","days","day","complete","maximum","max","sum","defaultUsageCardStrings","chartColors","categoryColor","category","index","QuotaValue","summary","quota","strings","prominent","Fragment","QuotaProgress","formatting","categories","total","segmented","denominator","unclassified","format","label","DailyUsage","unit","UsageBody","data","categoryTotal","inconsistent","percent","resource","UsageCard","stringsProp","cardProps","useStrings","ready","status","selectedPeriod","period","periods","hasPeriods","body","loadingSlot","errorSlot","onRetry","emptySlot","footer","footerAction","card","item","onPeriodChange"],"sources":["../src/components/blocks/analytics/usage-card/usage-card.data.ts","../src/components/blocks/analytics/usage-card/usage-card.strings.ts","../src/components/blocks/analytics/usage-card/usage-card.tsx"],"sourcesContent":["import type { UsageCardDay } from './types';\n\nexport function validUsage(value: number | null | undefined): number | null {\n\treturn typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;\n}\n\n/** Account only for rounding accumulated by positive finite category additions. */\nexport function usageExceeds(actual: number, expected: number, terms = 1): boolean {\n\tif (validUsage(actual) === null || validUsage(expected) === null) return true;\n\tconst magnitude = Math.max(actual, expected);\n\tconst tolerance = magnitude * Number.EPSILON * Math.max(1, terms);\n\treturn actual - expected > tolerance;\n}\n\n/** Retain actual numbers; cap only geometry. Zero quota has no finite percentage. */\nexport function quotaSummary(usedValue: number | null, limitValue: number | null | undefined) {\n\tconst used = validUsage(usedValue);\n\tconst limit = validUsage(limitValue);\n\tconst kind = used === null ? 'unavailable' : limitValue === null ? 'unlimited' : limit === null ? 'unavailable' : 'limited';\n\tconst ratio = used !== null && limit !== null && limit > 0 ? used / limit * 100 : used === 0 && limit === 0 ? 0 : null;\n\tconst percent = ratio !== null && Number.isFinite(ratio) ? ratio : null;\n\treturn {\n\t\tkind, used, limit, percent,\n\t\tprogress: kind === 'limited' ? limit === 0 ? used === 0 ? 0 : 100 : Math.min(100, ratio ?? 0) : null,\n\t\tremaining: kind === 'limited' ? Math.max(0, (limit ?? 0) - (used ?? 0)) : null,\n\t\texcess: kind === 'limited' ? Math.max(0, (used ?? 0) - (limit ?? 0)) : null,\n\t} as const;\n}\n\nexport function dailySummary(days: readonly UsageCardDay[]) {\n\tconst values = days.map(day => validUsage(day.value));\n\tconst complete = values.length > 0 && values.every(value => value !== null);\n\tconst maximum = values.reduce<number>((max, value) => Math.max(max, value ?? 0), 0);\n\treturn {\n\t\tvalues,\n\t\t// Dividing before summing avoids overflow for finite, very large values.\n\t\taverage: complete ? values.reduce<number>((sum, value) => sum + (value ?? 0) / values.length, 0) : null,\n\t\tmaximum: maximum > 0 ? maximum : 1,\n\t};\n}\n","export interface UsageCardStrings {\n\ttitle: string;\n\tusage: string;\n\tused: string;\n\tof: string;\n\tunlimited: string;\n\tunavailable: string;\n\tremaining: string;\n\toverLimit: string;\n\tbreakdown: string;\n\tinconsistentBreakdown: string;\n\tdaily: string;\n\taverage: string;\n\tperDay: string;\n\tresources: string;\n\tperiods: string;\n\tloading: string;\n\terror: string;\n\tempty: string;\n\tretry: string;\n}\nexport const defaultUsageCardStrings: UsageCardStrings = {\n\ttitle: 'Usage', usage: 'Usage', used: 'used', of: 'of', unlimited: 'Unlimited',\n\tunavailable: 'Unavailable', remaining: 'remaining', overLimit: 'over limit',\n\tbreakdown: 'Usage breakdown', inconsistentBreakdown: 'Category totals exceed reported usage.',\n\tdaily: 'Daily usage', average: 'Average', perDay: 'per day', resources: 'Resources',\n\tperiods: 'Usage period', loading: 'Loading usage', error: 'Unable to load usage',\n\tempty: 'No usage data', retry: 'Retry',\n};\n","import {compositionRhythm} from '../../../base/structure/composition.recipes';\nimport type { ReactNode } from 'react';\n\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Progress, ProgressTrack } from '../../../base/feedback';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../base/navigation';\nimport { Grid, Stack } from '../../../base/structure';\nimport { Number as NumberValue, Percent } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { useFormattingConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\n\nimport { dailySummary, quotaSummary, usageExceeds, validUsage } from './usage-card.data';\nimport { defaultUsageCardStrings, type UsageCardStrings } from './usage-card.strings';\nimport type { UsageCardCategory, UsageCardData, UsageCardDay, UsageCardProps, UsageCardQuota } from './types';\n\nconst chartColors = ['bg-chart-1', 'bg-chart-2', 'bg-chart-3', 'bg-chart-4', 'bg-chart-5'] as const;\nfunction categoryColor(category: UsageCardCategory, index: number) {\n\treturn chartColors[(category.color === undefined ? index : category.color - 1) % chartColors.length];\n}\n\nfunction QuotaValue({ quota, strings, prominent = false }: { quota: UsageCardQuota; strings: UsageCardStrings; prominent?: boolean }) {\n\tconst summary = quotaSummary(quota.used, quota.limit);\n\treturn <Stack gap=\"dense\" className=\"usage-card--quota\">\n\t\t<Stack direction=\"horizontal\" gap=\"xs\" align=\"baseline\">\n\t\t\t<NumberValue type=\"inherit\" value={summary.used} emptyLabel={strings.unavailable} size={prominent ? 'xl' : undefined} weight={prominent ? 'semibold' : 'medium'} align=\"left\" />\n\t\t\t{!prominent && summary.kind === 'limited' && <>\n\t\t\t\t<Text tag=\"span\" type=\"secondary\">{strings.of}</Text>\n\t\t\t\t<NumberValue value={summary.limit} type=\"secondary\" align=\"left\" />\n\t\t\t</>}\n\t\t\t{quota.unit && <Text tag=\"span\" type=\"secondary\">{quota.unit}</Text>}\n\t\t\t{prominent && summary.used !== null && <Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.used}</Text>}\n\t\t</Stack>\n\t\t{prominent && summary.kind === 'limited' && <Stack direction=\"horizontal\" gap=\"xs\" align=\"baseline\">\n\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.of}</Text>\n\t\t\t<NumberValue value={summary.limit} size=\"xs\" type=\"secondary\" align=\"left\" />\n\t\t</Stack>}\n\t\t{summary.kind === 'unlimited' && <Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.unlimited}</Text>}\n\t\t{summary.kind === 'unavailable' && summary.used !== null && <Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.unavailable}</Text>}\n\t</Stack>;\n}\n\nfunction QuotaProgress({ quota, label, strings, categories }: { quota: UsageCardQuota; label: string; strings: UsageCardStrings; categories?: readonly UsageCardCategory[] }) {\n\tconst summary = quotaSummary(quota.used, quota.limit);\n\tconst formatting = useFormattingConfig();\n\tif (summary.kind !== 'limited') return null;\n\tconst sum = categories?.reduce((total, category) => total + (validUsage(category.value) ?? 0), 0) ?? 0;\n\tconst segmented = !!categories?.length && categories.every(category => validUsage(category.value) !== null) && !usageExceeds(sum, summary.used ?? 0, categories.length);\n\tconst maximum = Math.max(summary.limit ?? 0, summary.used ?? 0);\n\tconst denominator = maximum > 0 ? maximum : 1;\n\tconst unclassified = usageExceeds(summary.used ?? 0, sum, categories?.length) ? (summary.used ?? 0) - sum : 0;\n\tconst format = new Intl.NumberFormat(formatting.locale);\n\treturn <Progress\n\t\tvalue={summary.progress ?? 0}\n\t\taria-label={label}\n\t\tgetAriaValueText={() => `${format.format(summary.used ?? 0)} ${strings.of} ${format.format(summary.limit ?? 0)} ${quota.unit ?? ''} ${strings.used}`}\n\t\ttone={summary.excess ? 'destructive' : 'primary'}\n\t\ttrackSlot={segmented ? <ProgressTrack>\n\t\t\t{categories?.map((category, index) => <span key={category.id} aria-hidden=\"true\" className={cn('h-full shrink-0', categoryColor(category, index))} style={{ width: `${(category.value ?? 0) / denominator * 100}%` }} />)}\n\t\t\t{unclassified > 0 && <span aria-hidden=\"true\" className=\"h-full shrink-0 bg-primary\" style={{ width: `${unclassified / denominator * 100}%` }} />}\n\t\t</ProgressTrack> : undefined}\n\t/>;\n}\n\nfunction DailyUsage({ days, unit, strings }: { days: readonly UsageCardDay[]; unit?: string; strings: UsageCardStrings }) {\n\tconst summary = dailySummary(days);\n\treturn <Stack gap=\"sm\" className=\"usage-card--daily\">\n\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"baseline\" gap=\"sm\">\n\t\t\t<DisplayLabel className=\"text-inherit\">{strings.daily}</DisplayLabel>\n\t\t\t<Stack direction=\"horizontal\" gap=\"xs\" align=\"baseline\">\n\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.average}</Text>\n\t\t\t\t<NumberValue type=\"inherit\" value={summary.average} emptyLabel={strings.unavailable} options={{ maximumFractionDigits: 0 }} weight=\"medium\" />\n\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">{strings.perDay}</Text>\n\t\t\t</Stack>\n\t\t</Stack>\n\t\t{days.length > 0 && <>\n\t\t\t<svg viewBox={`0 0 ${days.length * 10} 40`} preserveAspectRatio=\"none\" aria-hidden=\"true\" className=\"usage-card--daily-chart h-control-lg w-full overflow-visible\">\n\t\t\t\t{summary.values.map((value, index) => value === null ? null : <rect key={index} x={index * 10 + 1} y={40 - value / summary.maximum * 40} width={8} height={value / summary.maximum * 40} className=\"fill-chart-1\" />)}\n\t\t\t</svg>\n\t\t\t<Stack direction=\"horizontal\" justify=\"between\" gap=\"sm\" aria-hidden=\"true\">\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">{days[0]?.label}</Text>\n\t\t\t\t{days.length > 1 && <Text size=\"xs\" type=\"secondary\">{days[days.length - 1]?.label}</Text>}\n\t\t\t</Stack>\n\t\t</>}\n\t\t<ol className=\"sr-only\" aria-label={strings.daily}>\n\t\t\t{days.map((day, index) => <li key={index}>{day.label}: <NumberValue type=\"inherit\" value={validUsage(day.value)} emptyLabel={strings.unavailable} /> {unit}</li>)}\n\t\t</ol>\n\t</Stack>;\n}\n\nfunction UsageBody({ data, strings }: { data: UsageCardData; strings: UsageCardStrings }) {\n\tconst summary = quotaSummary(data.used, data.limit);\n\tconst categoryTotal = data.categories?.reduce((total, category) => total + (validUsage(category.value) ?? 0), 0) ?? 0;\n\tconst inconsistent = summary.used !== null && usageExceeds(categoryTotal, summary.used, data.categories?.length);\n\treturn <Stack gap=\"lg\">\n\t\t<Stack gap=\"md\" className=\"usage-card--summary\">\n\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"start\" gap=\"sm\">\n\t\t\t\t<QuotaValue quota={data} strings={strings} prominent />\n\t\t\t\t{summary.percent !== null && <Percent value={summary.percent} scaled size=\"lg\" weight=\"medium\" type=\"secondary\" options={{ maximumFractionDigits: 0 }} />}\n\t\t\t</Stack>\n\t\t\t<QuotaProgress quota={data} label={strings.usage} strings={strings} categories={data.categories} />\n\t\t\t{!!data.categories?.length && <Grid render={<ul aria-label={strings.breakdown} />} columns={3} gap=\"sm\" className=\"m-0 list-none p-0 font-sans usage-card--categories grid-cols-[minmax(0,1fr)_auto_minmax(5ch,max-content)]\">\n\t\t\t\t{data.categories.map((category, index) => {\n\t\t\t\t\tconst value = validUsage(category.value);\n\t\t\t\t\tconst percent = summary.used === null || value === null || inconsistent ? null : summary.used === 0 ? 0 : value / summary.used;\n\t\t\t\t\treturn <li key={category.id} className=\"usage-card--category col-span-full grid grid-cols-subgrid items-baseline\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t<span aria-hidden=\"true\" className={cn('size-icon-sm shrink-0 rounded-full', categoryColor(category, index))} />\n\t\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" className=\"break-words\">{category.label}</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<NumberValue type=\"inherit\" value={value} emptyLabel={strings.unavailable} weight=\"medium\" className=\"usage-card--category-value\" />\n\t\t\t\t\t\t<Percent value={percent} emptyLabel={strings.unavailable} type=\"secondary\" options={{ maximumFractionDigits: 0 }} className=\"usage-card--category-share\" />\n\t\t\t\t\t</li>;\n\t\t\t\t})}\n\t\t\t</Grid>}\n\t\t\t{inconsistent && <Text size=\"xs\" type=\"secondary\">{strings.inconsistentBreakdown}</Text>}\n\t\t</Stack>\n\t\t{data.daily && <DailyUsage days={data.daily} unit={data.unit} strings={strings} />}\n\t\t{!!data.resources?.length && <Stack gap=\"sm\">\n\t\t\t<DisplayLabel className=\"text-inherit\">{strings.resources}</DisplayLabel>\n\t\t\t<Grid columns={1} gap=\"md\" className=\"usage-card--resources @sm/card:grid-cols-3\">\n\t\t\t\t{data.resources.map(resource => <Stack key={resource.id} gap=\"sm\" className=\"usage-card--resource min-w-0\" role=\"group\" aria-label={resource.label}>\n\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\">{resource.label}</Text>\n\t\t\t\t\t<QuotaValue quota={resource} strings={strings} />\n\t\t\t\t\t<QuotaProgress quota={resource} label={resource.label} strings={strings} />\n\t\t\t\t</Stack>)}\n\t\t\t</Grid>\n\t\t</Stack>}\n\t</Stack>;\n}\n\n/** App-owned usage data and period callbacks in the canonical Card composition. */\nexport function UsageCard({ data, status = 'ready', periods, period, onPeriodChange, onRetry, loadingSlot, errorSlot, emptySlot, footerAction, strings: stringsProp, ...cardProps }: UsageCardProps) {\n\tconst strings = useStrings(defaultUsageCardStrings, stringsProp);\n\tconst ready = status === 'ready' && !!data;\n\tconst summary = ready ? quotaSummary(data.used, data.limit) : null;\n\tconst selectedPeriod = period ?? periods?.[0]?.value ?? '';\n\tconst hasPeriods = !!periods?.length;\n\tlet body: ReactNode;\n\tif (status === 'loading') body = <div role=\"status\">{loadingSlot ?? <Text type=\"secondary\">{strings.loading}</Text>}</div>;\n\telse if (status === 'error') body = <Stack role=\"alert\" gap=\"sm\">{errorSlot ?? <Text type=\"inherit\">{strings.error}</Text>}{onRetry && <Button tone=\"secondary\" onClick={onRetry}>{strings.retry}</Button>}</Stack>;\n\telse if (!ready) body = <div>{emptySlot ?? <Text type=\"secondary\">{strings.empty}</Text>}</div>;\n\telse body = <UsageBody data={data} strings={strings} />;\n\tconst footer = (summary?.kind === 'limited' || footerAction) && <Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\">\n\t\t{summary?.kind === 'limited' && <Stack direction=\"horizontal\" gap=\"xs\" align=\"baseline\">\n\t\t\t<NumberValue type=\"inherit\" value={summary.excess ? summary.excess : summary.remaining} weight=\"medium\" />\n\t\t\t{data?.unit && <Text tag=\"span\" type=\"secondary\">{data.unit}</Text>}\n\t\t\t<Text tag=\"span\" type=\"secondary\">{summary.excess ? strings.overLimit : strings.remaining}</Text>\n\t\t</Stack>}\n\t\t{footerAction}\n\t</Stack>;\n\tconst card = <Card\n\t\t{...cardProps}\n\t\ttitle={cardProps.title ?? strings.title}\n\t\tclassName={cn('usage-card--component min-w-0', cardProps.className)}\n\t\tdata-component=\"usage-card\"\n\t\tdata-slot=\"usage-card\"\n\t\taria-busy={status === 'loading' || undefined}\n\t\theaderAction={hasPeriods ? <Stack direction=\"horizontal\" gap={compositionRhythm.commands} align=\"center\" className=\"usage-card--header-actions max-w-full\">\n\t\t\t<TabsList scrollable aria-label={strings.periods}>\n\t\t\t\t{periods.map(item => <TabsTrigger key={item.value} value={item.value} disabled={item.disabled || !onPeriodChange}>{item.label}</TabsTrigger>)}\n\t\t\t</TabsList>\n\t\t\t{cardProps.headerAction}\n\t\t</Stack> : cardProps.headerAction}\n\t\tfooterSlot={footer}\n\t>\n\t\t{hasPeriods ? <TabsContent value={selectedPeriod}>{body}</TabsContent> : body}\n\t</Card>;\n\treturn hasPeriods ? <Tabs value={selectedPeriod} onValueChange={value => { if (typeof value === 'string') onPeriodChange?.(value); }} className=\"min-w-0\">{card}</Tabs> : card;\n}\n\nUsageCard.displayName = 'UsageCard';\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAgBmB,EAAW,GAAiD;CAC3E,OAAO,OAAOC,KAAU,YAAY,OAAO,SAASA,CAAK,KAAKA,KAAS,IAAIA,IAAQ;AACpF;AAGA,SAAgBC,EAAa,GAAgB,GAAkB,IAAQ,GAAY;CAClF,IAAIF,EAAWG,CAAM,MAAM,QAAQH,EAAWI,CAAQ,MAAM,MAAM,OAAO;CAEzE,IAAMC,IADY,KAAK,IAAIF,GAA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KAAW,QAAO;IAAU,CAAA;IACxGiB,GAAM,QAAQ,kBAAC3D,GAAD;KAAM,KAAI;KAAO,MAAK;KAAa,UAAA2D,EAAK;IAAW,CAAA;IAClE,kBAAC3D,GAAD;KAAM,KAAI;KAAO,MAAK;KAAa,UAAA0C,EAAQ,SAASE,EAAQ,YAAYA,EAAQ;IAAgB,CAAA;GAC1F;EACN,CAAA,GAAAoC,CACK;KACDC,IAAO,kBAAC7E,GAAD;EACZ,GAAI8D;EACJ,OAAOA,EAAU,SAAStB,EAAQ;EAClC,WAAW9C,EAAG,iCAAiCoE,EAAU,SAAS;EAClE,kBAAe;EACf,aAAU;EACV,aAAWG,MAAW,aAAa,KAAA;EACnC,cAAcI,IAAa,kBAACtE,GAAD;GAAO,WAAU;GAAa,KAAKI,EAAkB;GAAU,OAAM;GAAS,WAAU;GAAxF,UAAA,CAC1B,kBAACK,GAAD;IAAU,YAAA;IAAW,cAAYgC,EAAQ;IACvC,UAAA4B,EAAQ,KAAI,MAAQ,kBAAC9D,GAAD;KAA8B,OAAOwE,EAAK;KAAO,UAAUA,EAAK,YAAY,CAACC;KAAiB,UAAAD,EAAK;IAAmB,GAApGA,EAAK,KAA+F,CAAC;GACnI,CAAA,GACThB,EAAU,YACL;EAAI,CAAA,IAAAA,EAAU;EACrB,YAAYa;EAEX,UAAAN,IAAa,kBAAC9D,GAAD;GAAa,OAAO2D;GAAiB,UAAAI;EAAkB,CAAA,IAAIA;CACpE,CAAA;CACN,OAAOD,IAAa,kBAAC5D,GAAD;EAAM,OAAOyD;EAAgB,gBAAe,MAAS;GAAE,AAAI,OAAOvD,KAAU,YAAUoE,IAAiBpE,CAAK;EAAG;EAAG,WAAU;EAAW,UAAAkE;CAAW,CAAA,IAAIA;AAC3K;AAEA,EAAU,cAAc"}
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { useEffect as e, useState as t } from "react";
3
- function n() {
4
- let [n, r] = t();
5
- return e(() => {
6
- let e = window.matchMedia("(max-width: 767px)"), t = () => {
7
- r(window.innerWidth < 768);
8
- };
9
- return e.addEventListener("change", t), r(window.innerWidth < 768), () => e.removeEventListener("change", t);
10
- }, []), !!n;
11
- }
12
- //#endregion
13
- export { n as t };
14
-
15
- //# sourceMappingURL=use-mobile-vaLKwgyf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-mobile-vaLKwgyf.js","names":["useIsMobile","isMobile","setIsMobile","useState","useEffect","mql","onChange"],"sources":["../src/hooks/use-mobile.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport const MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n\tconst [isMobile, setIsMobile] = useState<boolean>();\n\n\tuseEffect(() => {\n\t\tconst mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n\n\t\tconst onChange = () => {\n\t\t\tsetIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n\t\t};\n\n\t\tmql.addEventListener('change', onChange);\n\t\tsetIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n\n\t\treturn () => mql.removeEventListener('change', onChange);\n\t}, []);\n\n\treturn !!isMobile;\n}\n"],"mappings":";;AAIA,SAAgBA,IAAc;CAC7B,IAAM,CAACC,GAAUC,KAAeC,EAAkB;CAelD,OAbAC,QAAgB;EACf,IAAMC,IAAM,OAAO,WAAW,oBAAyC,GAEjEC,UAAiB;GACtB,EAAY,OAAO,aAAA,GAA8B;EAClD;EAKA,OAHAD,EAAI,iBAAiB,UAAUC,CAAQ,GACvCJ,EAAY,OAAO,aAAA,GAA8B,SAEpCG,EAAI,oBAAoB,UAAUC,CAAQ;CACxD,GAAG,CAAC,CAAC,GAEE,CAAC,CAACL;AACV"}