themelia-react-ui 2.0.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (912) hide show
  1. package/CHANGELOG.md +250 -0
  2. package/MIGRATION.md +746 -7
  3. package/README.md +27 -23
  4. package/dist/{accordion-0tQUZ20r.js → accordion-DNVqwEIC.js} +36 -36
  5. package/dist/accordion-DNVqwEIC.js.map +1 -0
  6. package/dist/action-menu-D5343RwT.js +286 -0
  7. package/dist/action-menu-D5343RwT.js.map +1 -0
  8. package/dist/ai-artifact-otrz9ZwS.js +1214 -0
  9. package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
  10. package/dist/anchored-positioning-1U_eBFNx.js +9 -0
  11. package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
  12. package/dist/app-shell-CPN30Nb1.js +372 -0
  13. package/dist/app-shell-CPN30Nb1.js.map +1 -0
  14. package/dist/{attachment-BCpA4e7i.js → attachment-D2-fpfmv.js} +15 -15
  15. package/dist/{attachment-BCpA4e7i.js.map → attachment-D2-fpfmv.js.map} +1 -1
  16. package/dist/{auth-B0girIk_.js → auth-g_oUTDDC.js} +234 -241
  17. package/dist/auth-g_oUTDDC.js.map +1 -0
  18. package/dist/{avatar-B9Jnp-T-.js → avatar-Ca3Ihrq4.js} +4 -4
  19. package/dist/{avatar-B9Jnp-T-.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
  20. package/dist/{badge-wWauMgAt.js → badge-oGiXblW7.js} +8 -9
  21. package/dist/badge-oGiXblW7.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +2 -2
  29. package/dist/base/cards.js +3 -3
  30. package/dist/base/carousel.js +11 -11
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +2 -2
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +4 -4
  42. package/dist/base/forms-numeric.js +2 -2
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +13 -13
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +203 -2
  48. package/dist/base/media-gallery.js.map +1 -0
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +7 -7
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +32 -22
  54. package/dist/base/qr-code.js.map +1 -1
  55. package/dist/base/repeaters.js +91 -88
  56. package/dist/base/repeaters.js.map +1 -1
  57. package/dist/base/sidebar.js +2 -2
  58. package/dist/base/signature-pad.js +14 -14
  59. package/dist/base/signature-pad.js.map +1 -1
  60. package/dist/base/skeleton.js +1 -1
  61. package/dist/base/spinner.js +6 -12
  62. package/dist/base/spinner.js.map +1 -1
  63. package/dist/base/structure.js +1 -1
  64. package/dist/base/table.js +1 -1
  65. package/dist/base/text-inputs.js +3 -3
  66. package/dist/base/toaster.js +2 -2
  67. package/dist/base/tree.js +2 -2
  68. package/dist/base/upload-queue.js +303 -2
  69. package/dist/base/upload-queue.js.map +1 -0
  70. package/dist/base/upload.js +3 -4
  71. package/dist/base/value-inputs.js +1 -1
  72. package/dist/{batch-action-bar-BoqWIIpV.js → batch-action-bar-D6MZQNnC.js} +10 -10
  73. package/dist/{batch-action-bar-BoqWIIpV.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
  74. package/dist/blocks/admin.js +242 -228
  75. package/dist/blocks/admin.js.map +1 -1
  76. package/dist/blocks/ai.js +395 -357
  77. package/dist/blocks/ai.js.map +1 -1
  78. package/dist/blocks/analytics/charts.js +1022 -0
  79. package/dist/blocks/analytics/charts.js.map +1 -0
  80. package/dist/blocks/analytics/usage-card.js +1 -1
  81. package/dist/blocks/analytics.js +171 -1365
  82. package/dist/blocks/analytics.js.map +1 -1
  83. package/dist/blocks/collaboration.js +1 -1
  84. package/dist/blocks/commerce/receipt.js +1 -1
  85. package/dist/blocks/commerce.js +1487 -1358
  86. package/dist/blocks/commerce.js.map +1 -1
  87. package/dist/blocks/data-display.js +2 -3
  88. package/dist/blocks/onboarding.js +91 -82
  89. package/dist/blocks/onboarding.js.map +1 -1
  90. package/dist/blocks/planning.js +25 -25
  91. package/dist/blocks/planning.js.map +1 -1
  92. package/dist/blocks/timelines.js +2 -2
  93. package/dist/{breadcrumbs-Bp9Ke7kd.js → breadcrumbs-CQ9JSlez.js} +52 -45
  94. package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
  95. package/dist/{button-ChBovTx0.js → button-rd6FiHfQ.js} +12 -8
  96. package/dist/button-rd6FiHfQ.js.map +1 -0
  97. package/dist/{buttons-DeW0bQeK.js → buttons-pZVgPTZn.js} +230 -246
  98. package/dist/buttons-pZVgPTZn.js.map +1 -0
  99. package/dist/{cards-CNXnmvV5.js → cards-CgWyqvgZ.js} +25 -22
  100. package/dist/{cards-CNXnmvV5.js.map → cards-CgWyqvgZ.js.map} +1 -1
  101. package/dist/cascader-Cf05pwaq.js +444 -0
  102. package/dist/cascader-Cf05pwaq.js.map +1 -0
  103. package/dist/{chart-I7ROnsl8.js → chart-CygRCyIZ.js} +5 -5
  104. package/dist/{chart-I7ROnsl8.js.map → chart-CygRCyIZ.js.map} +1 -1
  105. package/dist/{checkbox-MoyHIAPs.js → checkbox-Dy5_XBMZ.js} +4 -4
  106. package/dist/{checkbox-MoyHIAPs.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
  107. package/dist/{choice-inputs-DHGtx0QV.js → choice-inputs-oJEsrb5Y.js} +113 -114
  108. package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
  109. package/dist/{code-block-BSJyq9e-.js → code-block-BrLD7mCi.js} +44 -60
  110. package/dist/code-block-BrLD7mCi.js.map +1 -0
  111. package/dist/collapsible-CRCCg_bO.js +80 -0
  112. package/dist/collapsible-CRCCg_bO.js.map +1 -0
  113. package/dist/{collection-content-CSnwtOTH.js → collection-content-D7SoDlYd.js} +3 -3
  114. package/dist/{collection-content-CSnwtOTH.js.map → collection-content-D7SoDlYd.js.map} +1 -1
  115. package/dist/combobox-Dl6f6kHz.js +362 -0
  116. package/dist/combobox-Dl6f6kHz.js.map +1 -0
  117. package/dist/combobox-DrDXtSSt.js +929 -0
  118. package/dist/combobox-DrDXtSSt.js.map +1 -0
  119. package/dist/command-CjZ2VzKC.js +432 -0
  120. package/dist/command-CjZ2VzKC.js.map +1 -0
  121. package/dist/comments-C2MZyRmh.js +1214 -0
  122. package/dist/comments-C2MZyRmh.js.map +1 -0
  123. package/dist/components/base/accordion/accordion.d.ts +11 -3
  124. package/dist/components/base/action-menu/action-menu.d.ts +11 -3
  125. package/dist/components/base/buttons/button.d.ts +2 -2
  126. package/dist/components/base/buttons/index.d.ts +1 -1
  127. package/dist/components/base/buttons/loader-button.d.ts +6 -15
  128. package/dist/components/base/cards/index.d.ts +1 -1
  129. package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
  130. package/dist/components/base/cards/smart-card.d.ts +0 -2
  131. package/dist/components/base/cards/smart-card.types.d.ts +12 -10
  132. package/dist/components/base/cascader/cascader.d.ts +8 -2
  133. package/dist/components/base/cascader/cascader.types.d.ts +24 -2
  134. package/dist/components/base/cascader/index.d.ts +1 -1
  135. package/dist/components/base/choice-inputs/switch.d.ts +1 -1
  136. package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
  137. package/dist/components/base/command/command.d.ts +1 -1
  138. package/dist/components/base/date-pickers/datepicker.types.d.ts +1 -3
  139. package/dist/components/base/display/dialog.d.ts +3 -9
  140. package/dist/components/base/display/index.d.ts +2 -3
  141. package/dist/components/base/display/separator.d.ts +1 -1
  142. package/dist/components/base/feedback/alert.d.ts +2 -1
  143. package/dist/components/base/feedback/empty.d.ts +10 -2
  144. package/dist/components/base/forms/workflow.d.ts +2 -2
  145. package/dist/components/base/forms-numeric/dimensions-input.d.ts +9 -17
  146. package/dist/components/base/forms-numeric/index.d.ts +3 -3
  147. package/dist/components/base/item/item.types.d.ts +6 -2
  148. package/dist/components/base/metadata-list/index.d.ts +1 -3
  149. package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
  150. package/dist/components/base/navigation/index.d.ts +2 -2
  151. package/dist/components/base/navigation/language-switcher.d.ts +7 -6
  152. package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
  153. package/dist/components/base/navigation/page-header/index.d.ts +1 -1
  154. package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
  155. package/dist/components/base/navigation/pagination.d.ts +5 -5
  156. package/dist/components/base/popover/popover.recipes.d.ts +0 -1
  157. package/dist/components/base/qr-code/qr-code.d.ts +4 -0
  158. package/dist/components/base/repeaters/index.d.ts +1 -1
  159. package/dist/components/base/repeaters/key-value-editor.d.ts +4 -0
  160. package/dist/components/base/sheet/sheet.d.ts +6 -15
  161. package/dist/components/base/sidebar/index.d.ts +1 -6
  162. package/dist/components/base/sidebar/sidebar.d.ts +38 -10
  163. package/dist/components/base/skeleton/skeleton.d.ts +1 -1
  164. package/dist/components/base/structure/structure.types.d.ts +11 -2
  165. package/dist/components/base/text-inputs/index.d.ts +1 -1
  166. package/dist/components/base/tree/index.d.ts +1 -0
  167. package/dist/components/base/tree/tree.d.ts +2 -2
  168. package/dist/components/base/tree/tree.types.d.ts +7 -1
  169. package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
  170. package/dist/components/base/upload/image-upload.d.ts +2 -0
  171. package/dist/components/base/upload/index.d.ts +3 -9
  172. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
  173. package/dist/components/base/value-inputs/slider.d.ts +5 -2
  174. package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
  175. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
  176. package/dist/components/blocks/admin/index.d.ts +1 -1
  177. package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
  178. package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
  179. package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
  180. package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
  181. package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
  182. package/dist/components/blocks/ai/ai-citation/types.d.ts +6 -0
  183. package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
  184. package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
  185. package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
  186. package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
  187. package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
  188. package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
  189. package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
  190. package/dist/components/blocks/ai/ai-sources/types.d.ts +8 -2
  191. package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
  192. package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
  193. package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
  194. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +6 -0
  195. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  196. package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
  197. package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
  198. package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
  199. package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
  200. package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
  201. package/dist/components/blocks/analytics/index.d.ts +17 -24
  202. package/dist/components/blocks/analytics/metric/metric.d.ts +5 -5
  203. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +2 -2
  204. package/dist/components/blocks/analytics/types.d.ts +12 -3
  205. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  206. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  207. package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
  208. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
  209. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
  210. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
  211. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  212. package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
  213. package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
  214. package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
  215. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
  216. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  217. package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
  218. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  219. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
  220. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
  221. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
  222. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
  223. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
  224. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
  225. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
  226. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
  227. package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
  228. package/dist/components/blocks/commerce/index.d.ts +8 -8
  229. package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
  230. package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
  231. package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
  232. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
  233. package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
  234. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
  235. package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
  236. package/dist/components/blocks/commerce/order-status/types.d.ts +8 -8
  237. package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
  238. package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
  239. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  240. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
  241. package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
  242. package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
  243. package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
  244. package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
  245. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  246. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
  247. package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
  248. package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
  249. package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
  250. package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
  251. package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
  252. package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
  253. package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
  254. package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
  255. package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
  256. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
  257. package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
  258. package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
  259. package/dist/components/blocks/content-block-hooks.d.ts +22 -0
  260. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
  261. package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
  262. package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
  263. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
  264. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
  265. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
  266. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
  267. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
  268. package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
  269. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +6 -0
  270. package/dist/components/blocks/data-display/index.d.ts +0 -1
  271. package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
  272. package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
  273. package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
  274. package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
  275. package/dist/components/blocks/timelines/index.d.ts +2 -2
  276. package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
  277. package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
  278. package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
  279. package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
  280. package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
  281. package/dist/components/features/activities/activities.strings.d.ts +5 -3
  282. package/dist/components/features/activities/activities.types.d.ts +28 -11
  283. package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
  284. package/dist/components/features/activities/index.d.ts +1 -1
  285. package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
  286. package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
  287. package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
  288. package/dist/components/features/activities/relative-time.d.ts +18 -0
  289. package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
  290. package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
  291. package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
  292. package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
  293. package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
  294. package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
  295. package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
  296. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  297. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +19 -5
  298. package/dist/components/features/appointment-calendar/index.d.ts +1 -1
  299. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
  300. package/dist/components/features/async-preview/async-preview.d.ts +2 -2
  301. package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
  302. package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
  303. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  304. package/dist/components/features/combobox/combobox.d.ts +12 -3
  305. package/dist/components/features/combobox/components/error-message.d.ts +3 -1
  306. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -2
  307. package/dist/components/features/combobox/index.d.ts +1 -1
  308. package/dist/components/features/combobox/types.d.ts +47 -45
  309. package/dist/components/features/comments/comments.strings.d.ts +6 -5
  310. package/dist/components/features/comments/comments.types.d.ts +40 -26
  311. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
  312. package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
  313. package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
  314. package/dist/components/features/data-view/data-view.types.d.ts +15 -2
  315. package/dist/components/features/email-composer/email-html.d.ts +5 -0
  316. package/dist/components/features/email-composer/http.d.ts +2 -0
  317. package/dist/components/features/email-composer/strings.d.ts +17 -2
  318. package/dist/components/features/email-composer/types.d.ts +17 -2
  319. package/dist/components/features/email-composer/use-composer.d.ts +2 -78
  320. package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
  321. package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
  322. package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
  323. package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
  324. package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
  325. package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
  326. package/dist/components/features/filters/facets/range-facet.d.ts +13 -8
  327. package/dist/components/features/filters/filter-context.d.ts +9 -0
  328. package/dist/components/features/filters/filters.strings.d.ts +36 -3
  329. package/dist/components/features/filters/filters.types.d.ts +72 -5
  330. package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
  331. package/dist/components/features/filters/index.d.ts +2 -2
  332. package/dist/components/features/filters/operator-options.d.ts +25 -2
  333. package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
  334. package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
  335. package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
  336. package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
  337. package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
  338. package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
  339. package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
  340. package/dist/components/features/filters/utils/filter-utils.d.ts +29 -4
  341. package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
  342. package/dist/components/features/global-search/global-search.d.ts +7 -1
  343. package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
  344. package/dist/components/features/global-search/global-search.types.d.ts +30 -6
  345. package/dist/components/features/global-search/index.d.ts +1 -1
  346. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
  347. package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
  348. package/dist/components/features/kanban/index.d.ts +2 -2
  349. package/dist/components/features/kanban/kanban-context.d.ts +4 -0
  350. package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
  351. package/dist/components/features/kanban/kanban.d.ts +10 -1
  352. package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
  353. package/dist/components/features/kanban/kanban.types.d.ts +26 -0
  354. package/dist/components/features/map/map.d.ts +4 -0
  355. package/dist/components/features/map/place-autocomplete.d.ts +10 -1
  356. package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
  357. package/dist/components/features/media-library/media-library.d.ts +1 -1
  358. package/dist/components/features/media-library/media-library.strings.d.ts +33 -3
  359. package/dist/components/features/media-library/media-library.types.d.ts +47 -2
  360. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  361. package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
  362. package/dist/components/features/mentions/index.d.ts +1 -1
  363. package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
  364. package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
  365. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +8 -1
  366. package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
  367. package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
  368. package/dist/components/features/mentions/utils/index.d.ts +0 -1
  369. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  370. package/dist/components/features/overlays/dialog.d.ts +1 -1
  371. package/dist/components/features/overlays/drawer.d.ts +1 -1
  372. package/dist/components/features/overlays/index.d.ts +2 -2
  373. package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
  374. package/dist/components/features/overlays/overlays.types.d.ts +27 -10
  375. package/dist/components/features/products/components/index.d.ts +0 -10
  376. package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
  377. package/dist/components/features/products/components/product-details-card.d.ts +1 -1
  378. package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
  379. package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
  380. package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
  381. package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
  382. package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
  383. package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
  384. package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
  385. package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
  386. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  387. package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
  388. package/dist/components/features/products/partials/product-surface.d.ts +15 -0
  389. package/dist/components/features/products/products.strings.d.ts +8 -0
  390. package/dist/components/features/products/products.types.d.ts +25 -7
  391. package/dist/components/features/questionnaire/questionnaire.types.d.ts +6 -4
  392. package/dist/components/features/resource/index.d.ts +2 -3
  393. package/dist/components/features/resource/resource.d.ts +2 -10
  394. package/dist/components/features/resource/resource.types.d.ts +7 -149
  395. package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
  396. package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
  397. package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
  398. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
  399. package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
  400. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
  401. package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
  402. package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
  403. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +2 -3
  404. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +13 -1
  405. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -0
  406. package/dist/components/features/schema-form/schema-form.d.ts +1 -1
  407. package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
  408. package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
  409. package/dist/components/features/suggestions/suggestions.types.d.ts +12 -4
  410. package/dist/components/features/table/data-table.d.ts +1 -1
  411. package/dist/components/features/table/filter-bar.d.ts +1 -1
  412. package/dist/components/features/table/pagination.d.ts +1 -1
  413. package/dist/components/features/table/partials/cell-value.d.ts +1 -1
  414. package/dist/components/features/table/table-body.d.ts +1 -1
  415. package/dist/components/features/table/table-header.d.ts +1 -1
  416. package/dist/components/features/table/table-helpers.d.ts +31 -9
  417. package/dist/components/features/table/table-region.recipes.d.ts +11 -0
  418. package/dist/components/features/table/table-toolbar.d.ts +1 -1
  419. package/dist/components/features/table/table.strings.d.ts +1 -0
  420. package/dist/components/features/table/table.types.d.ts +74 -48
  421. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
  422. package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
  423. package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
  424. package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
  425. package/dist/components/layout/app-shell/index.d.ts +2 -2
  426. package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
  427. package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
  428. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  429. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  430. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  431. package/dist/components/layout/auth/auth-shell.d.ts +1 -1
  432. package/dist/components/layout/auth/auth.types.d.ts +0 -5
  433. package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
  434. package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
  435. package/dist/components/layout/header/header.types.d.ts +16 -6
  436. package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
  437. package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
  438. package/dist/components/layout/header/partials/header-search.d.ts +1 -1
  439. package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
  440. package/dist/components/layout/layout.types.d.ts +2 -2
  441. package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
  442. package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
  443. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
  444. package/dist/components/layout/page/index.d.ts +2 -3
  445. package/dist/components/layout/page/page.strings.d.ts +12 -0
  446. package/dist/components/layout/page/page.types.d.ts +7 -110
  447. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  448. package/dist/components/layout/settings/index.d.ts +1 -1
  449. package/dist/components/layout/settings/settings.d.ts +3 -5
  450. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  451. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  452. package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
  453. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  454. package/dist/components/layout/sidebar/index.d.ts +1 -1
  455. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +15 -7
  456. package/dist/components/layout/sidebar/sidebar.types.d.ts +10 -12
  457. package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
  458. package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
  459. package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
  460. package/dist/components/primitives/date.d.ts +22 -3
  461. package/dist/components/primitives/file-size.d.ts +8 -2
  462. package/dist/components/primitives/index.d.ts +1 -1
  463. package/dist/components/primitives/initials.d.ts +3 -1
  464. package/dist/components/primitives/link.d.ts +8 -1
  465. package/dist/components/primitives/money.d.ts +1 -1
  466. package/dist/components/primitives/number.d.ts +2 -1
  467. package/dist/components/typography/heading.d.ts +9 -3
  468. package/dist/components/typography/index.d.ts +1 -1
  469. package/dist/components/typography/text-link.d.ts +10 -3
  470. package/dist/components/ui/badge.d.ts +2 -4
  471. package/dist/components/ui/breadcrumb.d.ts +2 -3
  472. package/dist/components/ui/button.d.ts +8 -2
  473. package/dist/components/ui/collapsible.d.ts +1 -4
  474. package/dist/components/ui/command.d.ts +20 -18
  475. package/dist/components/ui/dialog.d.ts +3 -9
  476. package/dist/components/ui/empty.d.ts +2 -2
  477. package/dist/components/ui/input-group.d.ts +3 -3
  478. package/dist/components/ui/item.d.ts +3 -3
  479. package/dist/components/ui/popover.d.ts +3 -7
  480. package/dist/components/ui/sheet.d.ts +4 -12
  481. package/dist/components/ui/sidebar-state.d.ts +6 -1
  482. package/dist/components/ui/sidebar.d.ts +7 -4
  483. package/dist/components/ui/tabs.d.ts +2 -2
  484. package/dist/components/ui/toggle-group.d.ts +3 -3
  485. package/dist/components/ui/toggle.d.ts +2 -2
  486. package/dist/components/ui/tooltip.d.ts +1 -3
  487. package/dist/{containers-CSdc32h9.js → containers-BdfLTP4w.js} +37 -32
  488. package/dist/containers-BdfLTP4w.js.map +1 -0
  489. package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
  490. package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
  491. package/dist/{copyable-3fdHfMR3.js → copyable-Bmr14W0d.js} +6 -6
  492. package/dist/{copyable-3fdHfMR3.js.map → copyable-Bmr14W0d.js.map} +1 -1
  493. package/dist/{data-display-Cmj-xZYl.js → data-display-CWe9SOYh.js} +264 -251
  494. package/dist/data-display-CWe9SOYh.js.map +1 -0
  495. package/dist/date-3qsCE1ID.js +209 -0
  496. package/dist/date-3qsCE1ID.js.map +1 -0
  497. package/dist/{date-picker-CyQlFYsP.js → date-picker-D1keJQIG.js} +129 -129
  498. package/dist/date-picker-D1keJQIG.js.map +1 -0
  499. package/dist/date-pickers-D8aJoeHc.js +185 -0
  500. package/dist/date-pickers-D8aJoeHc.js.map +1 -0
  501. package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
  502. package/dist/{display-CT_N2a3w.js → display-VlmP1I0i.js} +23 -46
  503. package/dist/display-VlmP1I0i.js.map +1 -0
  504. package/dist/{dropdown-menu-C08iIugv.js → dropdown-menu-B8hjvbkS.js} +9 -9
  505. package/dist/{dropdown-menu-C08iIugv.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
  506. package/dist/dropzone-CHBNK3de.js +116 -0
  507. package/dist/dropzone-CHBNK3de.js.map +1 -0
  508. package/dist/features/activities.js +682 -628
  509. package/dist/features/activities.js.map +1 -1
  510. package/dist/features/ai-chat.js +258 -226
  511. package/dist/features/ai-chat.js.map +1 -1
  512. package/dist/features/appointment-calendar.js +436 -340
  513. package/dist/features/appointment-calendar.js.map +1 -1
  514. package/dist/features/async-preview.js +351 -265
  515. package/dist/features/async-preview.js.map +1 -1
  516. package/dist/features/combobox.js +2 -2
  517. package/dist/features/comments.js +1 -1
  518. package/dist/features/data-view.js +212 -151
  519. package/dist/features/data-view.js.map +1 -1
  520. package/dist/features/email-composer/engine.js +1 -1
  521. package/dist/features/email-composer.js +344 -315
  522. package/dist/features/email-composer.js.map +1 -1
  523. package/dist/features/event-calendar.js +504 -355
  524. package/dist/features/event-calendar.js.map +1 -1
  525. package/dist/features/filters.js +2 -2
  526. package/dist/features/global-search.js +250 -206
  527. package/dist/features/global-search.js.map +1 -1
  528. package/dist/features/kanban.js +269 -189
  529. package/dist/features/kanban.js.map +1 -1
  530. package/dist/features/map.js +385 -371
  531. package/dist/features/map.js.map +1 -1
  532. package/dist/features/media-library.js +1571 -1199
  533. package/dist/features/media-library.js.map +1 -1
  534. package/dist/features/mentions.js +2 -2
  535. package/dist/features/overlays.js +2 -2
  536. package/dist/features/products.js +1780 -1691
  537. package/dist/features/products.js.map +1 -1
  538. package/dist/features/questionnaire.js +165 -152
  539. package/dist/features/questionnaire.js.map +1 -1
  540. package/dist/features/resource-assignment.js +223 -191
  541. package/dist/features/resource-assignment.js.map +1 -1
  542. package/dist/features/resource.js +55 -220
  543. package/dist/features/resource.js.map +1 -1
  544. package/dist/features/rich-text-editor.js +3 -3
  545. package/dist/features/schema-form.js +280 -228
  546. package/dist/features/schema-form.js.map +1 -1
  547. package/dist/features/suggestions.js +48 -39
  548. package/dist/features/suggestions.js.map +1 -1
  549. package/dist/features/table.js +2 -2
  550. package/dist/features/theme-tweaker.js +723 -633
  551. package/dist/features/theme-tweaker.js.map +1 -1
  552. package/dist/feedback-DmqmXKLn.js +254 -0
  553. package/dist/feedback-DmqmXKLn.js.map +1 -0
  554. package/dist/{field-affordance-recipes-D6H7tVJi.js → field-affordance-recipes-DfbMadot.js} +13 -9
  555. package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
  556. package/dist/{field-state-recipes-7sza8QbC.js → field-state-recipes-EtCxpEy3.js} +6 -2
  557. package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
  558. package/dist/filters-BviMRMLS.js +2692 -0
  559. package/dist/filters-BviMRMLS.js.map +1 -0
  560. package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
  561. package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
  562. package/dist/{form-field-CAPdwdnZ.js → form-field-BdfCwSoQ.js} +5 -5
  563. package/dist/{form-field-CAPdwdnZ.js.map → form-field-BdfCwSoQ.js.map} +1 -1
  564. package/dist/{form-sizing-CgcrUbLU.js → form-sizing-DE_dZw32.js} +3 -3
  565. package/dist/{form-sizing-CgcrUbLU.js.map → form-sizing-DE_dZw32.js.map} +1 -1
  566. package/dist/{forms-B3W8CH7-.js → forms-B8DzJnBN.js} +35 -35
  567. package/dist/forms-B8DzJnBN.js.map +1 -0
  568. package/dist/forms-numeric-DOBswjKj.js +992 -0
  569. package/dist/forms-numeric-DOBswjKj.js.map +1 -0
  570. package/dist/{header-ZIIsRKxP.js → header-Cq3G0ZRP.js} +100 -95
  571. package/dist/header-Cq3G0ZRP.js.map +1 -0
  572. package/dist/{hooks-BitHSh-Y.js → hooks-DHfeSMAO.js} +34 -14
  573. package/dist/hooks-DHfeSMAO.js.map +1 -0
  574. package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
  575. package/dist/http-Cu-GPpss.js.map +1 -0
  576. package/dist/{icon-badge-npxF1SLX.js → icon-badge-B0Kq7wom.js} +3 -3
  577. package/dist/{icon-badge-npxF1SLX.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
  578. package/dist/index.js +6 -6
  579. package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
  580. package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
  581. package/dist/{input-DIREVYHs.js → input-2YrgTUrz.js} +3 -3
  582. package/dist/{input-DIREVYHs.js.map → input-2YrgTUrz.js.map} +1 -1
  583. package/dist/{input-7KAc7XQL.js → input-DfJyrjoR.js} +6 -6
  584. package/dist/{input-7KAc7XQL.js.map → input-DfJyrjoR.js.map} +1 -1
  585. package/dist/{interaction-recipes-4wZ2tvfb.js → interaction-recipes-DmuS1ase.js} +2 -2
  586. package/dist/{interaction-recipes-4wZ2tvfb.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
  587. package/dist/item-GJ9mvCcg.js +279 -0
  588. package/dist/item-GJ9mvCcg.js.map +1 -0
  589. package/dist/layout/app-shell.js +1 -1
  590. package/dist/layout/auth.js +1 -1
  591. package/dist/layout/containers.js +1 -1
  592. package/dist/layout/header.js +1 -1
  593. package/dist/layout/hooks.js +1 -1
  594. package/dist/layout/navigation.js +1 -1
  595. package/dist/layout/page.js +2 -2
  596. package/dist/layout/settings.js +2 -2
  597. package/dist/layout/sidebar.js +3 -3
  598. package/dist/layout/workspace.js +1 -1
  599. package/dist/layout.js +12 -12
  600. package/dist/{layout.types-E_GAApzO.js → layout.types-DbtnyAtd.js} +11 -8
  601. package/dist/layout.types-DbtnyAtd.js.map +1 -0
  602. package/dist/lib/anchored-positioning.d.ts +11 -0
  603. package/dist/lib/field-affordance-recipes.d.ts +10 -0
  604. package/dist/lib/field-state-recipes.d.ts +6 -0
  605. package/dist/lib/focus-recipes.d.ts +7 -0
  606. package/dist/lib/format.d.ts +25 -0
  607. package/dist/lib/money-format.d.ts +6 -0
  608. package/dist/lib/motion-recipes.d.ts +6 -0
  609. package/dist/lib/surface-recipes.d.ts +32 -2
  610. package/dist/lib/theme-scope.d.ts +17 -1
  611. package/dist/lib/token-merge.generated.d.ts +13 -19
  612. package/dist/lib/ui-provider/index.d.ts +1 -1
  613. package/dist/lib/ui-provider/types.d.ts +5 -0
  614. package/dist/lib/use-controllable-state.d.ts +16 -0
  615. package/dist/lib/use-copy-feedback.d.ts +15 -0
  616. package/dist/lib/utils.js +1 -1
  617. package/dist/lib/variant-props.d.ts +9 -0
  618. package/dist/main-landmark-context-BAsyqp2I.js +11 -0
  619. package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
  620. package/dist/mentions-zz0ewNIq.js +670 -0
  621. package/dist/mentions-zz0ewNIq.js.map +1 -0
  622. package/dist/{message-BJHnn43M.js → message-BiiVrRrm.js} +10 -7
  623. package/dist/{message-BJHnn43M.js.map → message-BiiVrRrm.js.map} +1 -1
  624. package/dist/{metadata-list-XkqZ_UXH.js → metadata-list-G85roWjS.js} +13 -12
  625. package/dist/metadata-list-G85roWjS.js.map +1 -0
  626. package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
  627. package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
  628. package/dist/navigation-C0Be5C3i.js +304 -0
  629. package/dist/navigation-C0Be5C3i.js.map +1 -0
  630. package/dist/{navigation-Bt-v7rWP.js → navigation-CmqaQR_G.js} +99 -103
  631. package/dist/navigation-CmqaQR_G.js.map +1 -0
  632. package/dist/number-NFWKIoiK.js +340 -0
  633. package/dist/number-NFWKIoiK.js.map +1 -0
  634. package/dist/{overflow-tab-bar-BQCA2Zn2.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
  635. package/dist/{overflow-tab-bar-BQCA2Zn2.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
  636. package/dist/overlays-D-gAIfPF.js +1018 -0
  637. package/dist/overlays-D-gAIfPF.js.map +1 -0
  638. package/dist/page-D4pQhgSq.js +216 -0
  639. package/dist/page-D4pQhgSq.js.map +1 -0
  640. package/dist/{page-header-commands-DIKspJfx.js → page-header-commands-elelNOfd.js} +29 -29
  641. package/dist/{page-header-commands-DIKspJfx.js.map → page-header-commands-elelNOfd.js.map} +1 -1
  642. package/dist/{pagination-Br8TdV9A.js → pagination-BuSWw1US.js} +22 -23
  643. package/dist/pagination-BuSWw1US.js.map +1 -0
  644. package/dist/{popover-k8TdUcAt.js → popover-BpMxbqEK.js} +73 -69
  645. package/dist/popover-BpMxbqEK.js.map +1 -0
  646. package/dist/{popover-menu-yn-o0kyA.js → popover-menu-CO-_iiuz.js} +7 -7
  647. package/dist/{popover-menu-yn-o0kyA.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
  648. package/dist/{popover.recipes-DJ0AkUan.js → popover.recipes-BqkdvlZn.js} +3 -4
  649. package/dist/{popover.recipes-DJ0AkUan.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
  650. package/dist/{portal-recipes-DyUXqUtD.js → portal-recipes-BPeS4rGB.js} +2 -2
  651. package/dist/{portal-recipes-DyUXqUtD.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
  652. package/dist/primitives-BlC1lXBr.js +447 -0
  653. package/dist/primitives-BlC1lXBr.js.map +1 -0
  654. package/dist/primitives.js +4 -4
  655. package/dist/{progress-DZFXXzPs.js → progress-RARK8AjB.js} +5 -5
  656. package/dist/{progress-DZFXXzPs.js.map → progress-RARK8AjB.js.map} +1 -1
  657. package/dist/receipt-CUf2Vegp.js +114 -0
  658. package/dist/receipt-CUf2Vegp.js.map +1 -0
  659. package/dist/{rich-text-BnTzZjIo.js → rich-text-Cypm9__d.js} +7 -8
  660. package/dist/{rich-text-BnTzZjIo.js.map → rich-text-Cypm9__d.js.map} +1 -1
  661. package/dist/rich-text-editor-Z6cQepsA.js +919 -0
  662. package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
  663. package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
  664. package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
  665. package/dist/rich-text-tree-DdKHIJx4.js +154 -0
  666. package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
  667. package/dist/safe-image-src-C6kQSMBZ.js +17 -0
  668. package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
  669. package/dist/{scroll-area-Bj6CRUif.js → scroll-area-B9HKbji0.js} +3 -3
  670. package/dist/{scroll-area-Bj6CRUif.js.map → scroll-area-B9HKbji0.js.map} +1 -1
  671. package/dist/{separator-DM6gs2vu.js → separator-DaDe26sf.js} +3 -3
  672. package/dist/separator-DaDe26sf.js.map +1 -0
  673. package/dist/{separator-B9ewiCGO.js → separator-KGsNXt2J.js} +2 -2
  674. package/dist/{separator-B9ewiCGO.js.map → separator-KGsNXt2J.js.map} +1 -1
  675. package/dist/services/actions/action-adapters.d.ts +5 -2
  676. package/dist/services/actions/index.d.ts +1 -1
  677. package/dist/services/actions.js +2 -2
  678. package/dist/services/actions.js.map +1 -1
  679. package/dist/settings-D5j_RJvT.js +160 -0
  680. package/dist/settings-D5j_RJvT.js.map +1 -0
  681. package/dist/sheet-B6j_BE9O.js +241 -0
  682. package/dist/sheet-B6j_BE9O.js.map +1 -0
  683. package/dist/{sidebar-CmD6a-HK.js → sidebar-C-iQ_TJP.js} +377 -351
  684. package/dist/sidebar-C-iQ_TJP.js.map +1 -0
  685. package/dist/sidebar-D5VO2W8S.js +715 -0
  686. package/dist/sidebar-D5VO2W8S.js.map +1 -0
  687. package/dist/{skeleton-DDgdhmu9.js → skeleton-Cab_KgVo.js} +12 -12
  688. package/dist/skeleton-Cab_KgVo.js.map +1 -0
  689. package/dist/{smart-card-B6vLxqa_.js → smart-card-C59z6KFO.js} +217 -210
  690. package/dist/smart-card-C59z6KFO.js.map +1 -0
  691. package/dist/{structure-DZJ2wbAU.js → structure-DElaQwwN.js} +2 -2
  692. package/dist/{structure-DZJ2wbAU.js.map → structure-DElaQwwN.js.map} +1 -1
  693. package/dist/style.css +1 -1
  694. package/dist/{surface-recipes-C8mNycaY.js → surface-recipes-DV6rrOFq.js} +10 -2
  695. package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
  696. package/dist/{table-CXSPHH25.js → table-CSRUgpdK.js} +62 -61
  697. package/dist/table-CSRUgpdK.js.map +1 -0
  698. package/dist/table-DdXDBsR_.js +1657 -0
  699. package/dist/table-DdXDBsR_.js.map +1 -0
  700. package/dist/{tabs-C4Kr_hCr.js → tabs-WnHfV2pM.js} +27 -27
  701. package/dist/tabs-WnHfV2pM.js.map +1 -0
  702. package/dist/{text-inputs-jdkS3ReG.js → text-inputs-ljyBYaCd.js} +112 -112
  703. package/dist/text-inputs-ljyBYaCd.js.map +1 -0
  704. package/dist/theme.css +21 -5
  705. package/dist/timelines-mOmS9Eh3.js +479 -0
  706. package/dist/timelines-mOmS9Eh3.js.map +1 -0
  707. package/dist/tooltip-yjX-Uv-p.js +112 -0
  708. package/dist/tooltip-yjX-Uv-p.js.map +1 -0
  709. package/dist/{tree-CeYVzdFE.js → tree-YpkxUG2Z.js} +80 -72
  710. package/dist/tree-YpkxUG2Z.js.map +1 -0
  711. package/dist/typography/rich-text.js +1 -1
  712. package/dist/{typography-C7-YMW1S.js → typography-C0dELqYV.js} +46 -40
  713. package/dist/typography-C0dELqYV.js.map +1 -0
  714. package/dist/typography.js +1 -1
  715. package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
  716. package/dist/ui-provider-Bu1S-o96.js.map +1 -0
  717. package/dist/ui-provider.js +2 -2
  718. package/dist/{upload-Hdm5gObf.js → upload-DMuMYJFT.js} +276 -268
  719. package/dist/upload-DMuMYJFT.js.map +1 -0
  720. package/dist/{usage-card-9s8hLDfn.js → usage-card-DDPki5P1.js} +57 -54
  721. package/dist/usage-card-DDPki5P1.js.map +1 -0
  722. package/dist/use-controllable-state-BlP8SyBI.js +13 -0
  723. package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
  724. package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
  725. package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
  726. package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
  727. package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
  728. package/dist/{utils-DhuoqFy4.js → utils-BVbAG2J6.js} +98 -76
  729. package/dist/utils-BVbAG2J6.js.map +1 -0
  730. package/dist/value-inputs-h5MwjGCo.js +982 -0
  731. package/dist/value-inputs-h5MwjGCo.js.map +1 -0
  732. package/dist/value-typography-D15uwfj-.js +154 -0
  733. package/dist/value-typography-D15uwfj-.js.map +1 -0
  734. package/dist/workspace-DIryPqBt.js +400 -0
  735. package/dist/workspace-DIryPqBt.js.map +1 -0
  736. package/docs/consumer-skill/SKILL.md +7 -0
  737. package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
  738. package/docs/consumer-skill/examples/analytics.tsx +1 -1
  739. package/docs/consumer-skill/examples/app-layout.tsx +3 -3
  740. package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
  741. package/docs/consumer-skill/examples/detail.tsx +3 -2
  742. package/docs/consumer-skill/examples/email-composer.tsx +1 -1
  743. package/docs/consumer-skill/examples/index-table.tsx +2 -2
  744. package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
  745. package/docs/consumer-skill/references/agents-md.md +20 -16
  746. package/docs/consumer-skill/references/analytics.md +20 -6
  747. package/docs/consumer-skill/references/building-views.md +213 -0
  748. package/docs/consumer-skill/references/catalogue.md +617 -0
  749. package/docs/consumer-skill/references/component-contracts.json +10202 -18084
  750. package/docs/consumer-skill/references/composition.md +21 -17
  751. package/docs/consumer-skill/references/discovery.md +8 -5
  752. package/docs/consumer-skill/references/installation.md +10 -4
  753. package/docs/consumer-skill/references/integration.md +5 -5
  754. package/docs/consumer-skill/references/product-composition.md +2 -2
  755. package/docs/consumer-skill/references/public-api.json +580 -633
  756. package/docs/consumer-skill/references/review.md +6 -4
  757. package/docs/consumer-skill/references/screen-archetypes.md +2 -2
  758. package/docs/consumer-skill/references/theming.md +1 -1
  759. package/docs/consumer-skill/references/tokens.json +4 -4
  760. package/docs/consumer-skill/references/workflows.md +7 -7
  761. package/docs/consumer-skill/scripts/composition-policy.mjs +40 -20
  762. package/docs/consumer-skill/scripts/composition.mjs +4 -1
  763. package/docs/consumer-skill/scripts/discovery.mjs +3 -1
  764. package/docs/consumer-skill/scripts/setup-skills.mjs +31 -4
  765. package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
  766. package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
  767. package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
  768. package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
  769. package/package.json +9 -12
  770. package/templates/README.md +3 -2
  771. package/templates/admin-shell-template.tsx +49 -9
  772. package/templates/analytics-operations-template.tsx +20 -24
  773. package/templates/customers-template.tsx +12 -9
  774. package/templates/index.ts +2 -8
  775. package/templates/orders-template.tsx +28 -24
  776. package/templates/products-template.tsx +14 -4
  777. package/templates/user-permissions-template.tsx +11 -14
  778. package/dist/accordion-0tQUZ20r.js.map +0 -1
  779. package/dist/action-menu-C0gjzLyE.js +0 -284
  780. package/dist/action-menu-C0gjzLyE.js.map +0 -1
  781. package/dist/ai-artifact-CGGpQryR.js +0 -1200
  782. package/dist/ai-artifact-CGGpQryR.js.map +0 -1
  783. package/dist/anchored-positioning-DPnKTvNs.js +0 -6
  784. package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
  785. package/dist/app-shell-EHuuRDGy.js +0 -321
  786. package/dist/app-shell-EHuuRDGy.js.map +0 -1
  787. package/dist/auth-B0girIk_.js.map +0 -1
  788. package/dist/badge-wWauMgAt.js.map +0 -1
  789. package/dist/base/sheet.js +0 -3
  790. package/dist/breadcrumbs-Bp9Ke7kd.js.map +0 -1
  791. package/dist/button-ChBovTx0.js.map +0 -1
  792. package/dist/buttons-DeW0bQeK.js.map +0 -1
  793. package/dist/cascader-CrAl9zD5.js +0 -439
  794. package/dist/cascader-CrAl9zD5.js.map +0 -1
  795. package/dist/choice-inputs-DHGtx0QV.js.map +0 -1
  796. package/dist/code-block-BSJyq9e-.js.map +0 -1
  797. package/dist/collapsible-BzJ91LUG.js +0 -81
  798. package/dist/collapsible-BzJ91LUG.js.map +0 -1
  799. package/dist/combobox-Bcvu5J8O.js +0 -363
  800. package/dist/combobox-Bcvu5J8O.js.map +0 -1
  801. package/dist/combobox-C2JiSQPc.js +0 -915
  802. package/dist/combobox-C2JiSQPc.js.map +0 -1
  803. package/dist/command-9e52NPgK.js +0 -425
  804. package/dist/command-9e52NPgK.js.map +0 -1
  805. package/dist/comments-BsgErEqd.js +0 -1174
  806. package/dist/comments-BsgErEqd.js.map +0 -1
  807. package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
  808. package/dist/components/base/display/content-block.d.ts +0 -75
  809. package/dist/components/base/display/content-block.strings.d.ts +0 -5
  810. package/dist/components/base/sheet/index.d.ts +0 -29
  811. package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
  812. package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
  813. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -10
  814. package/dist/components/features/resource/resource.strings.d.ts +0 -12
  815. package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
  816. package/dist/components/features/sync/index.d.ts +0 -26
  817. package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
  818. package/dist/components/features/sync/sync.strings.d.ts +0 -18
  819. package/dist/components/features/sync/sync.types.d.ts +0 -44
  820. package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
  821. package/dist/components/ui/slot.d.ts +0 -6
  822. package/dist/containers-CSdc32h9.js.map +0 -1
  823. package/dist/data-display-Cmj-xZYl.js.map +0 -1
  824. package/dist/date-Br0FicVv.js +0 -144
  825. package/dist/date-Br0FicVv.js.map +0 -1
  826. package/dist/date-picker-CyQlFYsP.js.map +0 -1
  827. package/dist/date-pickers-tj2MXmXd.js +0 -185
  828. package/dist/date-pickers-tj2MXmXd.js.map +0 -1
  829. package/dist/display-CT_N2a3w.js.map +0 -1
  830. package/dist/features/sync.js +0 -142
  831. package/dist/features/sync.js.map +0 -1
  832. package/dist/feedback-Dzo1xtAU.js +0 -246
  833. package/dist/feedback-Dzo1xtAU.js.map +0 -1
  834. package/dist/field-affordance-recipes-D6H7tVJi.js.map +0 -1
  835. package/dist/field-state-recipes-7sza8QbC.js.map +0 -1
  836. package/dist/filters-Dl80yYtN.js +0 -2415
  837. package/dist/filters-Dl80yYtN.js.map +0 -1
  838. package/dist/focus-recipes-B653VaLq.js.map +0 -1
  839. package/dist/forms-B3W8CH7-.js.map +0 -1
  840. package/dist/forms-numeric-CwjQJe-O.js +0 -991
  841. package/dist/forms-numeric-CwjQJe-O.js.map +0 -1
  842. package/dist/header-ZIIsRKxP.js.map +0 -1
  843. package/dist/hooks-BitHSh-Y.js.map +0 -1
  844. package/dist/http-D_6rOnzU.js.map +0 -1
  845. package/dist/item-FfWnaYST.js +0 -278
  846. package/dist/item-FfWnaYST.js.map +0 -1
  847. package/dist/layout.types-E_GAApzO.js.map +0 -1
  848. package/dist/media-gallery-C81DAnKI.js +0 -203
  849. package/dist/media-gallery-C81DAnKI.js.map +0 -1
  850. package/dist/mentions-qOnedSt4.js +0 -639
  851. package/dist/mentions-qOnedSt4.js.map +0 -1
  852. package/dist/metadata-list-XkqZ_UXH.js.map +0 -1
  853. package/dist/motion-recipes-DitYv6P2.js.map +0 -1
  854. package/dist/navigation-BgtPJAhi.js +0 -288
  855. package/dist/navigation-BgtPJAhi.js.map +0 -1
  856. package/dist/navigation-Bt-v7rWP.js.map +0 -1
  857. package/dist/number-CYqBcrSj.js +0 -346
  858. package/dist/number-CYqBcrSj.js.map +0 -1
  859. package/dist/overlays-CC8zI3Du.js +0 -1017
  860. package/dist/overlays-CC8zI3Du.js.map +0 -1
  861. package/dist/page-BoQ1VaFJ.js +0 -331
  862. package/dist/page-BoQ1VaFJ.js.map +0 -1
  863. package/dist/pagination-Br8TdV9A.js.map +0 -1
  864. package/dist/popover-k8TdUcAt.js.map +0 -1
  865. package/dist/primitives-BkkQjYl7.js +0 -385
  866. package/dist/primitives-BkkQjYl7.js.map +0 -1
  867. package/dist/receipt-C7LhOg7Q.js +0 -116
  868. package/dist/receipt-C7LhOg7Q.js.map +0 -1
  869. package/dist/rich-text-editor-CAurDwT5.js +0 -1273
  870. package/dist/rich-text-editor-CAurDwT5.js.map +0 -1
  871. package/dist/rich-text-editor-toolbar-DbXig7Jk.js +0 -99
  872. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +0 -1
  873. package/dist/rich-text-tree-BqyQ_7-R.js +0 -66
  874. package/dist/rich-text-tree-BqyQ_7-R.js.map +0 -1
  875. package/dist/sanitize-html-BWkH4dLM.js +0 -105
  876. package/dist/sanitize-html-BWkH4dLM.js.map +0 -1
  877. package/dist/separator-DM6gs2vu.js.map +0 -1
  878. package/dist/settings-DZPHgpx4.js +0 -155
  879. package/dist/settings-DZPHgpx4.js.map +0 -1
  880. package/dist/sheet-C4DHsgLk.js +0 -250
  881. package/dist/sheet-C4DHsgLk.js.map +0 -1
  882. package/dist/sidebar-C8BnDwTH.js +0 -709
  883. package/dist/sidebar-C8BnDwTH.js.map +0 -1
  884. package/dist/sidebar-CmD6a-HK.js.map +0 -1
  885. package/dist/skeleton-DDgdhmu9.js.map +0 -1
  886. package/dist/slot-CLF9kLrS.js +0 -16
  887. package/dist/slot-CLF9kLrS.js.map +0 -1
  888. package/dist/smart-card-B6vLxqa_.js.map +0 -1
  889. package/dist/surface-recipes-C8mNycaY.js.map +0 -1
  890. package/dist/table-CBonSdTp.js +0 -1584
  891. package/dist/table-CBonSdTp.js.map +0 -1
  892. package/dist/table-CXSPHH25.js.map +0 -1
  893. package/dist/tabs-C4Kr_hCr.js.map +0 -1
  894. package/dist/text-inputs-jdkS3ReG.js.map +0 -1
  895. package/dist/timelines-CoPwdJP0.js +0 -458
  896. package/dist/timelines-CoPwdJP0.js.map +0 -1
  897. package/dist/tooltip-31NwIpTo.js +0 -113
  898. package/dist/tooltip-31NwIpTo.js.map +0 -1
  899. package/dist/tree-CeYVzdFE.js.map +0 -1
  900. package/dist/typography-C7-YMW1S.js.map +0 -1
  901. package/dist/ui-provider-C-74NVLc.js.map +0 -1
  902. package/dist/upload-Hdm5gObf.js.map +0 -1
  903. package/dist/upload-queue-D0sYPuqo.js +0 -409
  904. package/dist/upload-queue-D0sYPuqo.js.map +0 -1
  905. package/dist/usage-card-9s8hLDfn.js.map +0 -1
  906. package/dist/utils-DhuoqFy4.js.map +0 -1
  907. package/dist/value-inputs-D3aPgq9H.js +0 -980
  908. package/dist/value-inputs-D3aPgq9H.js.map +0 -1
  909. package/dist/value-typography-uSzzG9Gf.js +0 -122
  910. package/dist/value-typography-uSzzG9Gf.js.map +0 -1
  911. package/dist/workspace-CC8Vchiu.js +0 -411
  912. package/dist/workspace-CC8Vchiu.js.map +0 -1
@@ -1,113 +0,0 @@
1
- "use client";
2
- import { i as e } from "./ui-provider-C-74NVLc.js";
3
- import { t } from "./utils-DhuoqFy4.js";
4
- import { c as n } from "./typography-C7-YMW1S.js";
5
- import { t as r } from "./anchored-positioning-DPnKTvNs.js";
6
- import { t as i } from "./portal-recipes-DyUXqUtD.js";
7
- import { t as a } from "./motion-recipes-DitYv6P2.js";
8
- import { t as o } from "./slot-CLF9kLrS.js";
9
- import { createContext as s, useContext as c, useId as l, useLayoutEffect as u, useState as d } from "react";
10
- import { jsx as f } from "react/jsx-runtime";
11
- import { Tooltip as p } from "@base-ui/react/tooltip";
12
- //#region src/components/ui/tooltip.tsx
13
- function m({ delay: e = 0, delayDuration: t, ...n }) {
14
- return /* @__PURE__ */ f(p.Provider, {
15
- "data-slot": "tooltip-provider",
16
- delay: t ?? e,
17
- ...n
18
- });
19
- }
20
- function h({ ...e }) {
21
- return /* @__PURE__ */ f(m, { children: /* @__PURE__ */ f(p.Root, {
22
- "data-slot": "tooltip",
23
- ...e
24
- }) });
25
- }
26
- function g({ asChild: e = !1, render: t, children: n, ...r }) {
27
- let i = e ? /* @__PURE__ */ f(o, {}) : void 0, a = typeof t == "function" ? ((e, n) => {
28
- let { nativeButton: r, ...i } = e;
29
- return t(i, n);
30
- }) : t;
31
- return /* @__PURE__ */ f(p.Trigger, {
32
- "data-slot": "tooltip-trigger",
33
- render: i ?? a,
34
- ...r,
35
- children: n
36
- });
37
- }
38
- function _({ className: n, container: o, side: s = "top", sideOffset: c = 4, align: l = "center", alignOffset: u = 0, positionMethod: d = r, children: m, ...h }) {
39
- let g = e(o);
40
- return /* @__PURE__ */ f(p.Portal, {
41
- container: g,
42
- className: i(),
43
- children: /* @__PURE__ */ f(p.Positioner, {
44
- positionMethod: d,
45
- align: l,
46
- alignOffset: u,
47
- side: s,
48
- sideOffset: c,
49
- className: "isolate z-50",
50
- children: /* @__PURE__ */ f(p.Popup, {
51
- "data-slot": "tooltip-content",
52
- className: t(a.popup, "rounded-radius-xs 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),
53
- ...h,
54
- children: m
55
- })
56
- })
57
- });
58
- }
59
- //#endregion
60
- //#region src/components/base/display/tooltip.tsx
61
- var v = s(void 0), y = s(!1);
62
- function b(e) {
63
- let t = c(y), n = l(), [r, i] = d(n), a = /* @__PURE__ */ f(v.Provider, {
64
- value: {
65
- id: r,
66
- setId: i
67
- },
68
- children: /* @__PURE__ */ f(p.Root, {
69
- "data-slot": "tooltip",
70
- ...e
71
- })
72
- });
73
- return t ? a : /* @__PURE__ */ f(m, { children: a });
74
- }
75
- function x(e) {
76
- return /* @__PURE__ */ f(y.Provider, {
77
- value: !0,
78
- children: /* @__PURE__ */ f(m, { ...e })
79
- });
80
- }
81
- function S({ className: e, ...n }) {
82
- let r = c(v)?.id;
83
- return /* @__PURE__ */ f(g, {
84
- className: t("tooltip-trigger--component", e),
85
- ...n,
86
- "aria-describedby": [n["aria-describedby"], r].filter(Boolean).join(" ") || void 0
87
- });
88
- }
89
- function C({ children: e, className: r, ...i }) {
90
- let a = c(v), o = i.id ?? a?.id;
91
- u(() => {
92
- o && a?.setId(o);
93
- }, [o, a?.setId]);
94
- let s = typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ f(n, {
95
- tag: "span",
96
- size: "inherit",
97
- lineHeight: "snug",
98
- className: "tooltip-content--text text-inherit",
99
- children: e
100
- }) : e;
101
- return /* @__PURE__ */ f(_, {
102
- id: o,
103
- role: "tooltip",
104
- className: t("tooltip-content--component max-w-xs rounded-radius-xs px-space-md py-space-xs text-xs leading-snug", r),
105
- ...i,
106
- children: s
107
- });
108
- }
109
- b.displayName = "Tooltip", x.displayName = "TooltipProvider", S.displayName = "TooltipTrigger", C.displayName = "TooltipContent";
110
- //#endregion
111
- export { h as a, S as i, C as n, _ as o, x as r, g as s, b as t };
112
-
113
- //# sourceMappingURL=tooltip-31NwIpTo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tooltip-31NwIpTo.js","names":["TooltipProvider","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","Tooltip","BaseTooltip","TooltipProviderPrimitive","TooltipTriggerPrimitive","TooltipContentPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","portalClassName","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","TooltipDescriptionContext","createContext","SharedTooltipProviderContext","Tooltip$1","hasSharedProvider","useContext","generatedId","useId","descriptionId","setDescriptionId","useState","root","TooltipProvider","TooltipTrigger","TooltipContent","description","content","children"],"sources":["../src/components/ui/tooltip.tsx","../src/components/base/display/tooltip.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { portalClassName } from '../../lib/portal-recipes';\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} className={portalClassName()}>\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-xs 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.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', 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// Short labels use compact corners, including Button and sidebar hints.\n\t\t\t\t'tooltip-content--component max-w-xs rounded-radius-xs 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":";;;;;;;;;;;;AASA,SAASA,EAAgB,EACvB,WAAQ,GACR,kBACA,GAAGiB,KAC4D;CAC/D,OACE,kBAAChB,EAAiB,UAAlB;EACE,aAAU;EACV,OAAOkB,KAAiBC;EACxB,GAAIH;CACL,CAAA;AAEL;AAEA,SAASf,EAAQ,EAAE,GAAGe,KAAsC;CAC1D,OACE,kBAACjB,GAAD,EAAA,UACE,kBAACC,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIgB;CAAQ,CAAA,EACxC,CAAA;AAErB;AAEA,SAASd,EAAe,EACtB,aAAU,IACV,WACA,aACA,GAAGc,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,kBAACzB,EAAiB,SAAlB;EACE,aAAU;EACV,QAAQsB,KAAcE;EACtB,GAAIR;EAEH;CACuB,CAAA;AAE9B;AAEA,SAASb,EAAe,EACtB,cACA,cACA,UAAO,OACP,gBAAa,GACb,WAAQ,UACR,iBAAc,GACd,oBAAiBQ,GACjB,aACA,GAAGK,KAKuC;CAC1C,IAAMe,IAAoBtB,EAAwBuB,CAAS;CAC3D,OACE,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8B;CACtF,IAAMkC,IAAcV,EAAWL,CAAyB,GAClDQ,IAAgB3B,EAAM,MAAMkC,GAAa;CAC/C,QAAsB;EAAE,AAAIP,KAAeO,GAAa,MAAMP,CAAa;CAAG,GAAG,CAACA,GAAeO,GAAa,KAAK,CAAC;CAEpH,IAAMC,IADe,OAAOC,KAAa,YAAY,OAAOA,KAAa,YAAY,OAAOA,KAAa,WAEvG,kBAAC1C,GAAD;EACC,KAAI;EACJ,MAAK;EAEL,YAAW;EACX,WAAU;EAET;CACI,CAAA,IACH0C;CAEL,OACC,kBAAC5C,GAAD;EACC,IAAImC;EACJ,MAAK;EACL,WAAWV,EAEV,sGACAC,CACD;EACA,GAAIlB;EAEH,UAAAmC;CACuB,CAAA;AAE3B;AAEA,EAAQ,cAAc,WACtB,EAAgB,cAAc,mBAC9B,EAAe,cAAc,kBAC7B,EAAe,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-CeYVzdFE.js","names":["DisclosureButton","useTypographyConfig","Text","textSizes","focusRecipes","Button","ICON_DESCENDANT_SIZE_CLASSNAMES","rowBlockPaddingClasses","CollectionContent","interactionRecipes","navigationRowDensityRecipes","navigationRowInlineClasses","navigationChildInsetClasses","indexHierarchy","index","visit","node","nodes","entry","path","disabled","items","visibleHierarchy","open","expanded","isBranch","Tree","props","localExpanded","setLocalExpanded","useState","defaultExpandedValues","localSelected","setLocalSelected","defaultSelectedValues","expandedValues","selected","selectedValues","useMemo","visible","focused","setFocused","visibleValues","visibleAncestor","focusValue","refs","useRef","focusedElement","search","recipe","density","rich","rowLayout","previous","focus","value","toggle","next","onExpandedValuesChange","select","branchActivation","selectionMode","onSelectedValuesChange","keyboard","onKeyDown","event","position","rtl","forward","backward","item","now","term","letter","rows","blocked","branch","checked","element","level","cn","defaultTextSize","strings","ChevronDown","ChevronRight","renderLabel","Check","showGuides","indent","className","empty"],"sources":["../src/components/base/tree/hierarchy.ts","../src/components/base/tree/tree.tsx"],"sourcesContent":["import type { TreeNode } from './tree.types';\nexport interface HierarchyEntry<T> { node: TreeNode<T>; parent: string | null; path: TreeNode<T>[]; disabled: boolean }\n/** One canonical traversal for tree focus, cascader paths and local search. */\nexport function indexHierarchy<T>(items: readonly TreeNode<T>[]): Map<string, HierarchyEntry<T>> {\n const index = new Map<string, HierarchyEntry<T>>();\n function visit(nodes: readonly TreeNode<T>[], path: TreeNode<T>[], disabled: boolean) {\n for (const node of nodes) {\n if (index.has(node.value)) throw new Error(`Hierarchy values must be unique: ${node.value}`);\n const entry = { node, parent: path.at(-1)?.value ?? null, path: [...path, node], disabled: disabled || !!node.disabled };\n index.set(node.value, entry);\n visit(node.children ?? [], entry.path, entry.disabled);\n }\n }\n visit(items, [], false);\n return index;\n}\nexport function visibleHierarchy<T>(index: Map<string, HierarchyEntry<T>>, expanded: readonly string[]) {\n const open = new Set(expanded);\n return [...index.values()].filter(entry => entry.path.slice(0, -1).every(node => open.has(node.value)));\n}\nexport function isBranch(node: TreeNode) { return !!(node.hasChildren || node.children?.length); }\n","import { useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react';\nimport { Check, ChevronDown, ChevronRight } from 'lucide-react';\nimport { Button as DisclosureButton } from '../../ui/button';\nimport { CollectionContent } from '../popover/collection-content';\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { textSizes } from '../../typography/text.styles';\nimport { ICON_DESCENDANT_SIZE_CLASSNAMES } from '../display/icon-size';\nimport { navigationChildInsetClasses, navigationRowDensityRecipes, navigationRowInlineClasses } from '../../../lib/navigation-row-recipes';\nimport { rowBlockPaddingClasses } from '../../../lib/row-recipes';\nimport { indexHierarchy, isBranch, visibleHierarchy } from './hierarchy';\nimport type { TreeNode, TreeProps } from './tree.types';\nimport { focusRecipes } from '../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\n/** Accessible data-driven hierarchy. Focus moves independently from selection. */\nexport function Tree<T = unknown>({items, expandedValues, defaultExpandedValues = [], onExpandedValuesChange, selectedValues, defaultSelectedValues = [], onSelectedValuesChange, selectionMode = 'single', branchActivation = 'select', disabled = false, density = 'compact', rowLayout = 'line', indent, showGuides = true, empty = 'No items', strings, renderLabel, className, onKeyDown, ...props}: TreeProps<T>) {\n const [localExpanded, setLocalExpanded] = useState<readonly string[]>(defaultExpandedValues);\n const [localSelected, setLocalSelected] = useState<readonly string[]>(defaultSelectedValues);\n const expanded = expandedValues ?? localExpanded;\n const selected = selectedValues ?? localSelected;\n const index = useMemo(() => indexHierarchy(items), [items]);\n const visible = visibleHierarchy(index, expanded).filter(entry => !entry.disabled);\n const [focused, setFocused] = useState<string | null>(null);\n const visibleValues = new Set(visible.map(entry => entry.node.value));\n const visibleAncestor = focused === null ? undefined : index.get(focused)?.path.slice(0, -1).reverse().find(node => visibleValues.has(node.value))?.value;\n const focusValue = focused !== null && visibleValues.has(focused) ? focused : visibleAncestor ?? visible.find(entry => selected.includes(entry.node.value))?.node.value ?? visible[0]?.node.value;\n const refs = useRef(new Map<string, HTMLDivElement>());\n const focusedElement = useRef<HTMLDivElement | null>(null);\n const search = useRef({ text: '', time: 0 });\n const { defaultTextSize } = useTypographyConfig();\n const recipe = navigationRowDensityRecipes[density];\n const rich = rowLayout === 'rich';\n useLayoutEffect(() => {\n const previous = focusedElement.current;\n if (disabled || focusValue === undefined || !previous) return;\n // Keep focus inside a changing hierarchy, but do not reclaim it from another control.\n if (previous === document.activeElement || (!previous.isConnected && document.activeElement === document.body)) refs.current.get(focusValue)?.focus();\n }, [focusValue, disabled]);\n function focus(value: string | undefined) { if (value !== undefined) { setFocused(value); refs.current.get(value)?.focus(); } }\n function toggle(node: TreeNode<T>) {\n if (disabled || index.get(node.value)?.disabled) return;\n const next = expanded.includes(node.value) ? expanded.filter(value => value !== node.value) : [...expanded, node.value];\n if (expandedValues === undefined) setLocalExpanded(next);\n onExpandedValuesChange?.(next, node);\n }\n function select(node: TreeNode<T>) {\n if (disabled || index.get(node.value)?.disabled) return;\n if (branchActivation === 'toggle' && isBranch(node)) { toggle(node); return; }\n if (selectionMode === 'none') return;\n const next = selectionMode === 'multiple' ? selected.includes(node.value) ? selected.filter(value => value !== node.value) : [...selected, node.value] : [node.value];\n if (selectedValues === undefined) setLocalSelected(next);\n onSelectedValuesChange?.(next, node);\n }\n function keyboard(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || disabled || (event.target as HTMLElement).closest('button') || (event.target as HTMLElement).closest('[role=tree]') !== event.currentTarget) return;\n const position = visible.findIndex(entry => entry.node.value === focused);\n const entry = index.get(focused ?? focusValue ?? '');\n if (!entry) return;\n const rtl = getComputedStyle(event.currentTarget).direction === 'rtl';\n const forward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const backward = rtl ? 'ArrowRight' : 'ArrowLeft';\n if (event.key === 'ArrowDown') focus(visible[Math.min(position + 1, visible.length - 1)]?.node.value);\n else if (event.key === 'ArrowUp') focus(visible[Math.max(position - 1, 0)]?.node.value);\n else if (event.key === 'Home') focus(visible[0]?.node.value);\n else if (event.key === 'End') focus(visible.at(-1)?.node.value);\n else if (event.key === forward && isBranch(entry.node)) {\n if (!expanded.includes(entry.node.value)) toggle(entry.node);\n else focus(entry.node.children?.find(node => !index.get(node.value)?.disabled)?.value);\n } else if (event.key === backward) {\n if (isBranch(entry.node) && expanded.includes(entry.node.value)) toggle(entry.node);\n else focus(entry.parent ?? undefined);\n } else if (event.key === 'Enter' || event.key === ' ') select(entry.node);\n else if (event.key === '*') {\n const next = [...new Set([...expanded, ...[...index.values()].filter(item => item.parent === entry.parent && !item.disabled && isBranch(item.node)).map(item => item.node.value)])];\n if (expandedValues === undefined) setLocalExpanded(next);\n onExpandedValuesChange?.(next, entry.node);\n } else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const now = Date.now();\n search.current.text = (now - search.current.time < 500 ? search.current.text : '') + event.key.toLocaleLowerCase();\n search.current.time = now;\n const term = [...search.current.text].every(letter => letter === event.key.toLocaleLowerCase()) ? event.key.toLocaleLowerCase() : search.current.text;\n const rotated = [...visible.slice(position + 1), ...visible.slice(0, position + 1)];\n focus(rotated.find(item => item.node.label.toLocaleLowerCase().startsWith(term))?.node.value);\n } else return;\n event.preventDefault();\n }\n function rows(nodes: readonly TreeNode<T>[], level: number) { return nodes.map((node, position) => {\n const blocked = disabled || !!index.get(node.value)?.disabled;\n const branch = isBranch(node);\n const open = expanded.includes(node.value);\n const checked = selected.includes(node.value);\n return <div key={node.value} data-tree-value={node.value} className=\"tree--branch min-w-0 outline-none [&:focus-visible>.tree--item]:inset-ring [&:focus-visible>.tree--item]:inset-ring-ring [&:focus-visible>.tree--item]:ring-3 [&:focus-visible>.tree--item]:ring-ring/50\" ref={element => { if (element) refs.current.set(node.value, element); else refs.current.delete(node.value); }}\n role=\"treeitem\" aria-label={node.label} aria-level={level} aria-posinset={position + 1} aria-setsize={nodes.length}\n title={!rich && typeof node.description === 'string' ? node.description : undefined}\n aria-description={!rich && typeof node.description === 'string' ? node.description : undefined}\n aria-expanded={branch ? open : undefined} aria-selected={selectionMode !== 'none' && !(branch && branchActivation === 'toggle') ? checked : undefined} aria-disabled={blocked || undefined}\n tabIndex={!blocked && focusValue === node.value ? 0 : -1}\n onFocus={event => { if (event.target === event.currentTarget) { focusedElement.current = event.currentTarget; setFocused(node.value); } }}\n onClick={event => { if (!blocked && (event.target as HTMLElement).closest('[role=treeitem]') === event.currentTarget) { focus(node.value); select(node); } }}>\n <div data-selected={checked || undefined} data-disabled={blocked || undefined}\n className={cn(`tree--item flex w-full items-center cursor-default outline-none ${interactionRecipes.rowHover} ${focusRecipes.edge} data-selected:bg-accent data-selected:hover:bg-accent data-selected:text-accent-foreground data-disabled:opacity-50`, navigationRowInlineClasses, rich ? rowBlockPaddingClasses[density] : level === 1 ? recipe.height : recipe.childHeight, textSizes[defaultTextSize ?? 'sm'])}\n >\n <span className=\"tree--caret relative size-icon-sm shrink-0\">\n {branch && <DisclosureButton variant=\"ghost\" size=\"icon-xs\" className=\"tree--disclosure absolute start-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-radius rtl:translate-x-1/2 disabled:opacity-100 aria-disabled:opacity-100\" tabIndex={-1} disabled={blocked} aria-label={open ? strings?.collapse?.(node.label) ?? `Collapse ${node.label}` : strings?.expand?.(node.label) ?? `Expand ${node.label}`} onClick={event => {event.stopPropagation(); focus(node.value); toggle(node);}}>\n {open ? <ChevronDown aria-hidden=\"true\" className=\"size-icon-sm\" /> : <ChevronRight aria-hidden=\"true\" className=\"size-icon-sm rtl:rotate-180\" />}\n </DisclosureButton>}\n </span>\n <CollectionContent label={renderLabel?.(node) ?? node.label} description={rich ? node.description : undefined} leading={node.icon} leadingClassName={ICON_DESCENDANT_SIZE_CLASSNAMES.md} leadingDecorative wrap={rich}\n bodyClassName={rich ? undefined : 'overflow-hidden'}\n trailing={node.trailing != null || (checked && selectionMode === 'multiple') ? <span className=\"inline-flex shrink-0 items-center gap-space-sm\">{node.trailing}{checked && selectionMode === 'multiple' && <Check aria-hidden=\"true\" className=\"size-icon shrink-0\" />}</span> : undefined} />\n </div>\n {branch && open && !!node.children?.length && <div role=\"group\" className={cn('tree--group flex flex-col border-s', navigationChildInsetClasses, recipe.childGap, showGuides ? 'border-border' : 'border-transparent')}\n style={indent === undefined ? undefined : { marginInlineStart: Math.max(0, indent) / 2, paddingInlineStart: Math.max(0, indent) / 2 }}>{rows(node.children, level + 1)}</div>}\n </div>;\n }); }\n return <div {...props} role=\"tree\" data-row-layout={rowLayout} aria-multiselectable={selectionMode === 'multiple' || undefined} aria-disabled={disabled || undefined} onKeyDown={keyboard} className={cn('tree--component flex min-w-0 flex-col', recipe.gap, className)}>\n {items.length ? rows(items, 1) : <Text type=\"secondary\">{empty}</Text>}\n </div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAgBa,EAAkB,GAA+D;CAChG,IAAMC,oBAAQ,IAAI,IAA+B;CACjD,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Aa,UAAAwF;EAAY,CAAA;CACjE,CAAA;AACN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typography-C7-YMW1S.js","names":["resolveComponentScale","useDensityConfig","useTypographyConfig","cn","textAlignments","textVariants","headingRoleSizes","headingSizes","focusRecipes","RunningTextContext","createContext","useInRunningText","useContext","Text","forwardRef","Tag","props","value","children","content","invert","type","size","defaultTextSize","className","Heading","align","containerClassName","divider","subHeading","subHeadingSize","subHeadingClassName","DisplayLabel","tone","sizes","Label","defaultScale","inlineLinkClassName","linkUnderlineClassName","descendantInlineLinkClassName","TextLink","inText","weight","lineHeight","underline"],"sources":["../src/components/typography/running-text.ts","../src/components/typography/text.tsx","../src/components/typography/heading.tsx","../src/components/typography/display-label.tsx","../src/components/typography/label.tsx","../src/components/typography/text-link.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * True below an element that renders running text: `Text`, `Heading`,\n * `DisplayLabel`, `Label`, `TextLink` and the inline value primitives.\n *\n * Inline value primitives read it to tell a value inside a sentence from a\n * standalone value. Inside running text their unset size, colour, weight and\n * leading inherit from the surrounding text; standalone values keep their role\n * defaults. Explicit props always win.\n */\nexport const RunningTextContext = createContext(false);\n\n/** Whether the caller renders inside running text owned by a typography role. */\nexport function useInRunningText(): boolean {\n\treturn useContext(RunningTextContext);\n}\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport { useTypographyConfig, type TextSize } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\nimport { RunningTextContext } from './running-text';\nimport { textVariants, type textTypes, type textWeights, type textAlignments, type textLineHeights } from './text.styles';\n\nexport interface TextProps extends Omit<ComponentPropsWithoutRef<'p'>, 'children'> {\n /** Plain text fallback; children take precedence, including zero and empty strings. */\n content?: string;\n children?: ReactNode;\n /** Colour role. Defaults to `main`; `inherit` keeps the surrounding text colour. */\n type?: keyof typeof textTypes;\n /** Text size. Defaults to the provider `typography.defaultTextSize` (`sm`). */\n size?: TextSize;\n /** Font weight. Defaults to `regular`; `inherit` keeps the surrounding weight. */\n weight?: keyof typeof textWeights;\n /** Text alignment. Defaults to `left`; `left` and `right` follow the reading direction. */\n align?: keyof typeof textAlignments;\n /** Line height. Defaults to `normal`; `inherit` keeps the surrounding leading. */\n lineHeight?: keyof typeof textLineHeights;\n /** Renders the inverse colour role on inverse surfaces. Defaults to `false`. */\n invert?: boolean;\n /**\n * Monospace with tabular figures, for identifiers and code-like values. Numbers,\n * amounts and dates use the number primitives (tabular sans figures) instead.\n * Defaults to `false`.\n */\n numeric?: boolean;\n /** Rendered element. Defaults to `p`. */\n tag?: 'div' | 'p' | 'span';\n}\n\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text({\n content, children, type = 'main', size, weight, align, lineHeight,\n numeric, invert = false, tag: Tag = 'p', className, ...props\n}, ref) {\n const {defaultTextSize} = useTypographyConfig();\n const value = children ?? content;\n if (value === undefined || value === null || value === '') return null;\n return <Tag data-typography=\"text\" {...props} ref={ref as never} className={cn('text--component', textVariants({type: invert ? 'inverse' : type, size: size ?? defaultTextSize, weight, align, lineHeight, numeric}), className)}>\n <RunningTextContext.Provider value>{value}</RunningTextContext.Provider>\n </Tag>;\n});\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\nimport { RunningTextContext } from './running-text';\nimport { headingRoleSizes, headingSizes, textAlignments } from './text.styles';\nimport { Text } from './text';\n\nexport type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\nexport type HeadingSize = keyof typeof headingSizes;\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n ref?: Ref<HTMLHeadingElement>;\n /** Semantic outline level. Defaults to `h3`; it never changes the visual size. */\n tag?: HeadingTag;\n /**\n * Visual emphasis, independent of `tag`. Defaults to the compact admin `base`.\n * `xl` and larger tighten tracking; `2xl` and larger also tighten leading.\n */\n size?: HeadingSize;\n /** Secondary line under the title, rendered as secondary `Text`. */\n subHeading?: ReactNode;\n subHeadingClassName?: string;\n /** Text size of `subHeading`; defaults to the provider text size. */\n subHeadingSize?: TextSize;\n containerClassName?: string;\n /** Text alignment for the title and sub-heading. Defaults to `left`. */\n align?: keyof typeof textAlignments;\n /** Adds a bottom rule under the title. Defaults to `false`. */\n divider?: boolean;\n}\n\n/** Semantic heading levels share Themelia's restrained admin heading scale. */\nexport function Heading({tag: Tag = 'h3', size = headingRoleSizes.subject, subHeading, subHeadingClassName, subHeadingSize, containerClassName, align = 'left', divider = false, className, children, ref, ...props}: HeadingProps) {\n return <div className={cn('heading--component flex min-w-0 flex-col gap-dense', textAlignments[align], containerClassName)}>\n {children != null && <Tag {...props} ref={ref} data-typography=\"heading\" className={cn('heading--title m-0 font-heading', headingSizes[size], 'font-semibold text-foreground text-balance break-words', textAlignments[align], divider && 'border-b border-border pb-space-md', className)}><RunningTextContext.Provider value>{children}</RunningTextContext.Provider></Tag>}\n {subHeading != null && <Text type=\"secondary\" size={subHeadingSize} align={align} className={subHeadingClassName}>{subHeading}</Text>}\n </div>;\n}\n","import { Text, type TextProps } from './text';\nimport { cn } from '../../lib/utils';\n\nexport interface DisplayLabelProps extends Omit<TextProps, 'size' | 'type' | 'weight' | 'lineHeight'> {tone?: 'default' | 'inverse'}\nexport function DisplayLabel({tag = 'span', tone = 'default', className, ...props}: DisplayLabelProps) {\n return <Text {...props} tag={tag} size=\"sm\" type=\"main\" weight=\"medium\" lineHeight=\"tight\" data-typography=\"display-label\" className={cn('display-label--component', tone === 'inverse' && 'text-inverse-muted', className)} />;\n}\n","import type { LabelHTMLAttributes, ReactNode, Ref } from 'react';\nimport type { ComponentScale } from '../../lib/component-vocabulary';\nimport { useDensityConfig } from '../../lib/ui-provider';\nimport { resolveComponentScale } from '../../lib/ui-provider/scale';\nimport { cn } from '../../lib/utils';\nimport { RunningTextContext } from './running-text';\n\nexport interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'content'> {\n /** Fallback content; children take precedence. */\n content?: ReactNode;\n /** Control scale the caption belongs to (`sm` → xs, `md` → sm, `lg` → base). Defaults to the provider density scale. */\n size?: ComponentScale;\n ref?: Ref<HTMLLabelElement>;\n}\nconst sizes = {sm: 'text-xs', md: 'text-sm', lg: 'text-base'} as const;\n/** Form caption for a control; medium weight, foreground, no incidental margins. */\nexport function Label({content, children, size, className, ref, ...props}: LabelProps) {\n const {defaultScale} = useDensityConfig();\n return <label {...props} ref={ref} data-typography=\"label\" className={cn('label--component font-sans font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50', sizes[resolveComponentScale(size, defaultScale)], className)}>\n <RunningTextContext.Provider value>{children ?? content}</RunningTextContext.Provider>\n </label>;\n}\n","import type { AnchorHTMLAttributes, Ref } from 'react';\nimport { useTypographyConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\nimport { RunningTextContext, useInRunningText } from './running-text';\nimport { textVariants } from './text.styles';\nimport type { TextProps } from './text';\nimport { focusRecipes } from '../../lib/focus-recipes';\n\n/**\n * Inline-link mechanics shared by `TextLink` and the link primitives. As a flex\n * or grid item the link hugs its text, so neither the hit area nor the focus\n * ring stretches across the row. The shared focus edge sits just outside the\n * glyphs inside the soft halo, uses the small radius role and follows every line\n * of a wrapped link. Links keep one colour whether\n * or not they were visited: the role colour is explicit.\n */\nexport const inlineLinkClassName = `w-fit max-w-full rounded-radius-xs outline-none box-decoration-clone transition-colors motion-reduce:transition-none ${focusRecipes.text}`;\n\n/** Underline geometry shared with content links: proportional to the text size. */\nexport const linkUnderlineClassName = 'underline decoration-current underline-offset-[0.2em]';\n\n/** Private counterpart for native anchors inside package-owned copy regions.\n * Keep selectors literal for the standalone stylesheet. These anchors inherit\n * the region's colour and follow TextLink's focus and underline mechanics. */\nexport const descendantInlineLinkClassName = '[&_a]:w-fit [&_a]:max-w-full [&_a]:rounded-radius-xs [&_a]:outline-none [&_a]:box-decoration-clone [&_a]:transition-colors motion-reduce:[&_a]:transition-none [&_a]:text-inherit [&_a]:underline [&_a]:decoration-current [&_a]:underline-offset-[0.2em] [&_a:hover]:decoration-transparent [&_a:focus-visible]:outline-solid [&_a:focus-visible]:outline-1 [&_a:focus-visible]:outline-offset-0 [&_a:focus-visible]:outline-ring [&_a:focus-visible]:ring-3 [&_a:focus-visible]:ring-ring/50';\n\nexport interface TextLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type'>, Pick<TextProps, 'type' | 'size' | 'weight' | 'align' | 'lineHeight'> {\n /** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n size?: TextProps['size'];\n /**\n * Underlined at rest, clearing on hover. Defaults to `true`; keep it for links\n * whose colour matches the surrounding text. `false` renders no underline and\n * leaves the hover treatment to the composition (a row, chip or menu).\n */\n underline?: boolean;\n ref?: Ref<HTMLAnchorElement>;\n}\n\n/**\n * Native anchor sibling of `Text`: the same roles plus link focus and hover\n * states. Inside running text an unset size, weight and leading follow the\n * sentence; the colour role stays, so the link still reads as a link.\n */\nexport function TextLink({type = 'main', size, weight, align, lineHeight, underline = true, className, ref, children, ...props}: TextLinkProps) {\n const {defaultTextSize} = useTypographyConfig();\n const inText = useInRunningText();\n return <a {...props} ref={ref} data-typography=\"link\" className={cn('text-link--component', inlineLinkClassName, textVariants({type, size: size ?? (inText ? 'inherit' : defaultTextSize), weight: weight ?? (inText ? 'inherit' : undefined), align, lineHeight: lineHeight ?? (inText ? 'inherit' : undefined)}), underline ? `${linkUnderlineClassName} hover:decoration-transparent` : 'no-underline', className)}>\n <RunningTextContext.Provider value>{children}</RunningTextContext.Provider>\n </a>;\n}\n"],"mappings":";;;;;;;;AAWA,IAAaS,IAAqBC,EAAc,EAAK;AAGrD,SAAgBC,IAA4B;CAC3C,OAAOC,EAAWH,CAAkB;AACrC;;;ACgBA,IAAaI,IAAOC,EAAmC,SAAc,EACnE,YAAS,aAAU,UAAO,QAAQ,SAAM,WAAQ,UAAO,eACvD,YAAS,YAAS,IAAO,KAAKC,IAAM,K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MAAS,aAAa,sBAAsBT,CAAS;CAAI,CAAA;AAChO;;;ACQA,IAAMU,IAAQ;CAAC,IAAI;CAAW,IAAI;CAAW,IAAI;AAAW;AAE5D,SAAgBC,EAAM,EAAC,YAAS,aAAU,SAAM,cAAW,QAAK,GAAGnB,KAAoB;CACrF,IAAM,EAAC,oBAAgBf,EAAiB;CACxC,OAAO,kBAAC,SAAD;EAAO,GAAIe;EAAY;EAAK,mBAAgB;EAAQ,WAAWb,EAAG,iIAAiI+B,EAAMlC,EAAsBsB,GAAMc,CAAY,IAAIZ,CAAS;EACnQ,UAAA,kBAACf,EAAmB,UAApB;GAA6B,OAAA;GAAO,UAAAS,KAAYC;EAAqC,CAAA;CAChF,CAAA;AACT;;;ACLA,IAAakB,IAAsB,wHAAwH7B,EAAa,QAG3J8B,IAAyB,yDAKzBC,IAAgC;AAmB7C,SAAgBC,EAAS,EAAC,UAAO,QAAQ,SAAM,WAAQ,UAAO,eAAY,eAAY,IAAM,cAAW,QAAK,aAAU,GAAGxB,KAAuB;CAC9I,IAAM,EAAC,uBAAmBd,EAAoB,GACxCuC,IAAS9B,EAAiB;CAChC,OAAO,kBAAC,KAAD;EAAG,GAAIK;EAAY;EAAK,mBAAgB;EAAO,WAAWb,EAAG,wBAAwBkC,GAAqBhC,EAAa;GAAC;GAAM,MAAMiB,MAASmB,IAAS,YAAYlB;GAAkB,QAAQmB,MAAWD,IAAS,YAAY,KAAA;GAAY;GAAO,YAAYE,MAAeF,IAAS,YAAY,KAAA;EAAU,CAAC,GAAGG,IAAY,GAAGN,EAAuB,iCAAiC,gBAAgBd,CAAS;EAClZ,UAAA,kBAACf,EAAmB,UAApB;GAA6B,OAAA;GAAO;EAAsC,CAAA;CACzE,CAAA;AACL"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui-provider-C-74NVLc.js","names":["React","React$1","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","ThemeScopeContext","scopeAliasRoots","suppliedScopeRoots","style","root","ThemeScopeHostProvider","useThemeScopeHost","host","mounted","setMounted","node","ThemeScope","props","forwardedRef","context","attachHost","useThemePortalContainer","scope","container","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","../src/lib/theme-scope.tsx"],"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 =>\n\tuseUIStore((s) => s.spinner);\n","import * as React from 'react';\n\n/** Native Base UI portal container contract, shared by internal portal owners. */\nexport type ThemePortalContainer = HTMLElement | ShadowRoot | React.RefObject<HTMLElement | ShadowRoot | null> | null;\n\ntype ThemeScopeContextValue = {\n host: React.RefObject<HTMLElement | null>;\n mounted: boolean;\n};\nconst ThemeScopeContext = React.createContext<ThemeScopeContextValue | null>(null);\n\nexport type ThemeScopeProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'style'> & {\n style?: React.CSSProperties & { [property: `--${string}`]: string | number | undefined };\n};\n\n// CSS owns alias references. This private marker identifies explicitly supplied\n// source roots so low-specificity defaults can rebind at this boundary without\n// overriding independent roles from consumer classes or inline styles.\nconst scopeAliasRoots = ['--primary', '--primary-foreground', '--foreground', '--font-sans'] as const;\nfunction suppliedScopeRoots(style: ThemeScopeProps['style']) {\n return scopeAliasRoots.filter(root => style?.[root] != null && style[root] !== '').map(root => root.slice(2)).join(' ') || undefined;\n}\n\n/** Internal host mechanics shared by native themed regions and the public div scope. */\nexport const ThemeScopeHostProvider = ThemeScopeContext.Provider;\n\nexport function useThemeScopeHost<T extends HTMLElement>() {\n const host = React.useRef<T>(null);\n const [mounted, setMounted] = React.useState(false);\n const attachHost = React.useCallback((node: T | null) => {\n host.current = node;\n setMounted(node !== null);\n }, []);\n const context = React.useMemo(() => ({ host, mounted }), [mounted]);\n return { host, attachHost, context };\n}\n\n/** CSS inheritance boundary for local themes, including descendant overlays. */\nexport const ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(function ThemeScope(\n { children, style, ...props }, forwardedRef,\n) {\n const { host, attachHost, context } = useThemeScopeHost<HTMLDivElement>();\n React.useImperativeHandle(forwardedRef, () => host.current!, []);\n return <ThemeScopeHostProvider value={context}>\n <div data-theme-scope=\"\" {...props} data-theme-roots={suppliedScopeRoots(style)} style={style} ref={attachHost}>{children}</div>\n </ThemeScopeHostProvider>;\n});\n\n/** Explicit container wins; scoped portals wait until their CSS host is attached. */\nexport function useThemePortalContainer(container?: ThemePortalContainer): ThemePortalContainer | undefined {\n const scope = React.useContext(ThemeScopeContext);\n if (container !== undefined) return container;\n if (!scope) return undefined;\n return scope.mounted ? scope.host : null;\n}\n"],"mappings":";;;;;;;;;AAYA,IAAaE,IAAsC;CAClD,SAAS,EACR,cAAc,KACf;CACA,YAAY,EACX,QAAQ,QACT;CACA,OAAO;EACN,iBAAiB;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IAAMC,IAAQ3D,EAAM,WAAW0C,CAAiB;CAChD,IAAIkB,MAAc,KAAA,GAAW,OAAOA;CACpC,IAAKD,GACL,OAAOA,EAAM,UAAUA,EAAM,OAAO;AACrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-Hdm5gObf.js","names":["React","resolveComponentScale","useDensityConfig","useFormattingConfig","cn","Button","Text","AlertDescription","Alert","AlertTitle","formatFileSize","FileSize","fieldAffordanceRecipes","resolveFieldInvalid","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","matchesAccept","rules","name","type","extension","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","invalidProp","ariaLabel","ariaLabelledBy","ariaInvalidProp","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","ariaInvalid","ImageUpload","defaultAvatarUploadStrings","getAvatarUploadRejectionMessage","SIZE_PX","AvatarUploadImpl","sizes","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{/* Quiet at rest like the replace action; the destructive tone marks the\n\t\t\t\t remove action only once it is hovered or focused. */}\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"secondary\"\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\tclassName=\"file-upload--remove text-muted-foreground hover:text-destructive focus-visible:text-destructive\"\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\t/** Native file accept specifiers, including extensions, MIME types and wildcards. */\n\taccept?: 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 matchesAccept(file: File, extension: string, accept: string): boolean {\n\tconst rules = accept.split(',').map(rule => rule.trim().toLowerCase()).filter(Boolean);\n\tconst name = file.name.toLowerCase();\n\tconst type = file.type.toLowerCase();\n\treturn rules.length === 0 || rules.some(rule => {\n\t\tif (rule.startsWith('.')) return name.endsWith(rule);\n\t\tif (rule.endsWith('/*')) return type.startsWith(rule.slice(0, -1));\n\t\treturn rule.includes('/') ? type === rule : extension === rule;\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\t(rules?.accept && !matchesAccept(file, extension, rules.accept)) ||\n\t\t(rules?.allowedExtensions &&\n\t\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 { resolveFieldInvalid, type FieldControlAttributes } from '../../../lib/field-control-attributes';\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 extends FieldControlAttributes {\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: invalidProp,\n\t\tstrings: stringsProp,\n\t\tid,\n\t\t'aria-label': ariaLabel,\n\t\t'aria-labelledby': ariaLabelledBy,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t'aria-invalid': ariaInvalidProp,\n}: ImageUploadProps,\n\t\tforwardedRef: React.ForwardedRef<HTMLInputElement>,\n) {\n\t\tconst strings = useStrings(defaultImageUploadStrings, stringsProp);\n\t\tconst { invalid, ariaInvalid } = resolveFieldInvalid(invalidProp, ariaInvalidProp);\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-surface 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 id={id}\n\t aria-label={ariaLabel}\n\t aria-labelledby={ariaLabelledBy}\n\t aria-describedby={ariaDescribedBy}\n\t aria-invalid={ariaInvalid}\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, 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 { resolveFieldInvalid, type FieldControlAttributes } from '../../../lib/field-control-attributes';\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 extends FieldControlAttributes {\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: invalidProp,\n\tsize: sizeProp,\n\tclassName,\n\tstrings: stringsProp,\n\tinitials,\n\tid,\n\t'aria-label': ariaLabel,\n\t'aria-labelledby': ariaLabelledBy,\n\t'aria-describedby': ariaDescribedBy,\n\t'aria-invalid': ariaInvalidProp,\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 { invalid, ariaInvalid } = resolveFieldInvalid(invalidProp, ariaInvalidProp);\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\taccept,\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// The circle, hint and errors share that start edge, so a hint wider than the\n\t\t// circle never pushes it off the label's edge.\n\t\t<div className={cn('avatar-upload--component', 'inline-flex w-fit flex-col items-start 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={id ?? 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={ariaLabel ?? strings.change}\n\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\taria-invalid={ariaInvalid}\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,IAAa4B,IAA8C;CAC1D,aAAa;CACb,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,eAAe;CACf,kBAAkB,MAAa,WAAWC;CAC1C,iBAAiB,MAAa,UAAUA;CACxC,cAAc,GAAU,MAAW,GAAGA,EAAS,iCAAiCC,EAAO;CACvF,eAAe,GAAU,MAAY,GAAGD,EAAS,uCAAuCE,EAAQ;CAChG,eAAe,GAAU,MAAY,GAAGF,EAAS,s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