themelia-react-ui 1.0.1 → 2.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 (640) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/README.md +67 -16
  3. package/dist/{accordion-B-5Focs8.js → accordion-CQXVcd7Q.js} +15 -15
  4. package/dist/accordion-CQXVcd7Q.js.map +1 -0
  5. package/dist/action-menu-BTpyPWJ2.js +264 -0
  6. package/dist/action-menu-BTpyPWJ2.js.map +1 -0
  7. package/dist/affordance-geometry.generated-CCIXb2A1.js +68 -0
  8. package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
  9. package/dist/{ai-artifact-B5tPpXnS.js → ai-artifact-2PQ2fItc.js} +206 -215
  10. package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
  11. package/dist/{app-shell-at8Kt4l_.js → app-shell-BE_j8-AT.js} +11 -10
  12. package/dist/app-shell-BE_j8-AT.js.map +1 -0
  13. package/dist/{attachment-BO2R47wn.js → attachment-q69dlt5Y.js} +14 -14
  14. package/dist/attachment-q69dlt5Y.js.map +1 -0
  15. package/dist/auth-M3vGMgDR.js +723 -0
  16. package/dist/auth-M3vGMgDR.js.map +1 -0
  17. package/dist/{avatar-Bpzty83c.js → avatar-djdaaQ_s.js} +15 -13
  18. package/dist/avatar-djdaaQ_s.js.map +1 -0
  19. package/dist/{badge-BZXZT9wd.js → badge-0tATj-tW.js} +9 -9
  20. package/dist/badge-0tATj-tW.js.map +1 -0
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/buttons.js +3 -2
  27. package/dist/base/cards.js +3 -3
  28. package/dist/base/carousel.js +33 -35
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +246 -222
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +1 -1
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +3 -3
  39. package/dist/base/display.js +7 -7
  40. package/dist/base/feedback.js +4 -4
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +94 -92
  44. package/dist/base/inline-edit.js.map +1 -1
  45. package/dist/base/item.js +1 -1
  46. package/dist/base/media-gallery.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +7 -4
  51. package/dist/base/qr-code.js.map +1 -1
  52. package/dist/base/repeaters.js +53 -53
  53. package/dist/base/repeaters.js.map +1 -1
  54. package/dist/base/sheet.js +1 -1
  55. package/dist/base/sidebar.js +1 -1
  56. package/dist/base/signature-pad.js +84 -82
  57. package/dist/base/signature-pad.js.map +1 -1
  58. package/dist/base/skeleton.js +1 -1
  59. package/dist/base/spinner.js +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +7 -7
  64. package/dist/base/toaster.js.map +1 -1
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +1 -1
  69. package/dist/blocks/admin.js +228 -219
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +182 -212
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +665 -620
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +2 -2
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1439 -1553
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +1 -1
  81. package/dist/blocks/onboarding.js +6 -6
  82. package/dist/blocks/onboarding.js.map +1 -1
  83. package/dist/blocks/planning.js +88 -97
  84. package/dist/blocks/planning.js.map +1 -1
  85. package/dist/blocks/timelines.js +1 -1
  86. package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BG_FfMK4.js} +10 -9
  87. package/dist/breadcrumbs-BG_FfMK4.js.map +1 -0
  88. package/dist/button-BS3KDg00.js +674 -0
  89. package/dist/button-BS3KDg00.js.map +1 -0
  90. package/dist/{button-BS6l5JUw.js → button-R9CCoH7A.js} +3 -3
  91. package/dist/button-R9CCoH7A.js.map +1 -0
  92. package/dist/buttons-DS0ZIwJ_.js +99 -0
  93. package/dist/buttons-DS0ZIwJ_.js.map +1 -0
  94. package/dist/{cards-Cum56XOF.js → cards-QoJ4syG9.js} +12 -12
  95. package/dist/{cards-Cum56XOF.js.map → cards-QoJ4syG9.js.map} +1 -1
  96. package/dist/chart-DwYRKKc-.js +152 -0
  97. package/dist/chart-DwYRKKc-.js.map +1 -0
  98. package/dist/checkbox-B7ygNTYp.js +35 -0
  99. package/dist/checkbox-B7ygNTYp.js.map +1 -0
  100. package/dist/choice-inputs-DrJ17tpL.js +752 -0
  101. package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
  102. package/dist/{code-block-xHKbAJDj.js → code-block-CD0B7M93.js} +27 -27
  103. package/dist/code-block-CD0B7M93.js.map +1 -0
  104. package/dist/{collapsible-DsnktFNv.js → collapsible-oMUGM4tr.js} +3 -3
  105. package/dist/{collapsible-DsnktFNv.js.map → collapsible-oMUGM4tr.js.map} +1 -1
  106. package/dist/{collection-content-C4fthJV_.js → collection-content-Ys-OZOkY.js} +3 -3
  107. package/dist/{collection-content-C4fthJV_.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
  108. package/dist/combobox-6dvVny2q.js +272 -0
  109. package/dist/combobox-6dvVny2q.js.map +1 -0
  110. package/dist/combobox-CB7039j7.js +865 -0
  111. package/dist/combobox-CB7039j7.js.map +1 -0
  112. package/dist/{command-C0xe7u9B.js → command-kPMPjIxJ.js} +35 -31
  113. package/dist/command-kPMPjIxJ.js.map +1 -0
  114. package/dist/{comments-DviPLnwy.js → comments-You0Bzbr.js} +434 -409
  115. package/dist/comments-You0Bzbr.js.map +1 -0
  116. package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
  117. package/dist/components/base/action-menu/action-menu.d.ts +7 -2
  118. package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
  119. package/dist/components/base/badge/badge.d.ts +1 -1
  120. package/dist/components/base/badge/badge.recipes.d.ts +4 -4
  121. package/dist/components/base/buttons/base-button.d.ts +7 -0
  122. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  123. package/dist/components/base/buttons/button.recipes.d.ts +10 -19
  124. package/dist/components/base/buttons/button.variants.d.ts +1 -0
  125. package/dist/components/base/buttons/loader-button.d.ts +3 -1
  126. package/dist/components/base/buttons/text-button.d.ts +2 -2
  127. package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
  128. package/dist/components/base/cards/card.recipes.d.ts +13 -5
  129. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
  130. package/dist/components/base/cards/smart-card.types.d.ts +1 -1
  131. package/dist/components/base/carousel/carousel.d.ts +3 -1
  132. package/dist/components/base/chart/chart.d.ts +7 -7
  133. package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
  134. package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
  135. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
  136. package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
  137. package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
  138. package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
  139. package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
  140. package/dist/components/base/date-pickers/datepicker.types.d.ts +16 -3
  141. package/dist/components/base/display/alert-dialog.d.ts +8 -2
  142. package/dist/components/base/display/content-block.d.ts +4 -2
  143. package/dist/components/base/display/date-block.d.ts +1 -1
  144. package/dist/components/base/display/dialog.d.ts +12 -5
  145. package/dist/components/base/display/surface-title.d.ts +6 -1
  146. package/dist/components/base/feedback/alert.d.ts +1 -1
  147. package/dist/components/base/feedback/state-display.d.ts +5 -4
  148. package/dist/components/base/forms/form-field.d.ts +1 -0
  149. package/dist/components/base/forms/form-sizing.d.ts +35 -3
  150. package/dist/components/base/forms/workflow.d.ts +2 -0
  151. package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
  152. package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
  153. package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
  154. package/dist/components/base/navigation/language-switcher.d.ts +4 -1
  155. package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
  156. package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
  157. package/dist/components/base/navigation/tabs.d.ts +3 -5
  158. package/dist/components/base/popover/popover.recipes.d.ts +3 -3
  159. package/dist/components/base/qr-code/qr-code.d.ts +2 -0
  160. package/dist/components/base/sheet/index.d.ts +29 -1
  161. package/dist/components/base/sheet/sheet.d.ts +14 -5
  162. package/dist/components/base/spinner/spinner.d.ts +3 -2
  163. package/dist/components/base/structure/structure.types.d.ts +1 -1
  164. package/dist/components/base/table/index.d.ts +1 -1
  165. package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
  166. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  167. package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
  168. package/dist/components/base/upload/upload.recipes.d.ts +11 -0
  169. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
  170. package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
  171. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
  172. package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
  173. package/dist/components/blocks/analytics/index.d.ts +1 -1
  174. package/dist/components/blocks/analytics/types.d.ts +1 -1
  175. package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
  176. package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
  177. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  178. package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
  179. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
  180. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
  181. package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
  182. package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
  183. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
  184. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  185. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
  186. package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
  187. package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
  188. package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
  189. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
  190. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
  191. package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
  192. package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
  193. package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
  194. package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
  195. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
  196. package/dist/components/features/combobox/components/error-message.d.ts +1 -1
  197. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
  198. package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
  199. package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
  200. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
  201. package/dist/components/features/media-library/media-library.d.ts +1 -1
  202. package/dist/components/features/media-library/media-library.types.d.ts +9 -1
  203. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  204. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  205. package/dist/components/features/overlays/drawer.d.ts +1 -1
  206. package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
  207. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
  208. package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
  209. package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
  210. package/dist/components/features/overlays/overlays.types.d.ts +46 -22
  211. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  212. package/dist/components/features/products/partials/index.d.ts +1 -1
  213. package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
  214. package/dist/components/features/products/partials/product-tone.d.ts +11 -1
  215. package/dist/components/features/products/products.types.d.ts +2 -1
  216. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
  217. package/dist/components/features/table/data-table.d.ts +1 -1
  218. package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
  219. package/dist/components/features/table/table.types.d.ts +1 -1
  220. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
  221. package/dist/components/layout/auth/auth.types.d.ts +1 -0
  222. package/dist/components/layout/page/index.d.ts +1 -1
  223. package/dist/components/layout/page/page.d.ts +0 -1
  224. package/dist/components/layout/page/page.types.d.ts +62 -6
  225. package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
  226. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  227. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
  228. package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
  229. package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
  230. package/dist/components/primitives/date.d.ts +16 -3
  231. package/dist/components/primitives/dimensions.d.ts +6 -0
  232. package/dist/components/primitives/duration.d.ts +6 -0
  233. package/dist/components/primitives/file-size.d.ts +6 -0
  234. package/dist/components/primitives/index.d.ts +1 -1
  235. package/dist/components/primitives/initials.d.ts +11 -2
  236. package/dist/components/primitives/link.d.ts +7 -0
  237. package/dist/components/primitives/money.d.ts +29 -7
  238. package/dist/components/primitives/number.d.ts +17 -0
  239. package/dist/components/primitives/value-typography.d.ts +54 -0
  240. package/dist/components/primitives/value.d.ts +31 -6
  241. package/dist/components/typography/heading.d.ts +13 -2
  242. package/dist/components/typography/index.d.ts +1 -1
  243. package/dist/components/typography/label.d.ts +3 -0
  244. package/dist/components/typography/running-text.d.ts +12 -0
  245. package/dist/components/typography/text-link.d.ts +23 -1
  246. package/dist/components/typography/text.d.ts +12 -0
  247. package/dist/components/typography/text.styles.d.ts +37 -5
  248. package/dist/components/ui/button.d.ts +1 -1
  249. package/dist/components/ui/checkbox.d.ts +5 -0
  250. package/dist/components/ui/overlay.recipes.d.ts +15 -2
  251. package/dist/components/ui/popover.d.ts +1 -1
  252. package/dist/components/ui/select.d.ts +3 -1
  253. package/dist/components/ui/sidebar.d.ts +1 -1
  254. package/dist/components/ui/switch.d.ts +5 -0
  255. package/dist/components/ui/table.d.ts +2 -1
  256. package/dist/container.recipes-D9t8MHR3.js +27 -0
  257. package/dist/container.recipes-D9t8MHR3.js.map +1 -0
  258. package/dist/{containers-6s-ucRQQ.js → containers-D_L4mTVb.js} +34 -57
  259. package/dist/containers-D_L4mTVb.js.map +1 -0
  260. package/dist/control-group-recipes-DBXmfh2E.js +21 -0
  261. package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
  262. package/dist/{copyable-B7SBXJMr.js → copyable-DDjTeW_j.js} +6 -6
  263. package/dist/{copyable-B7SBXJMr.js.map → copyable-DDjTeW_j.js.map} +1 -1
  264. package/dist/data-display-3xWQUnMA.js +1335 -0
  265. package/dist/data-display-3xWQUnMA.js.map +1 -0
  266. package/dist/date-picker-DrDFj8Lo.js +1527 -0
  267. package/dist/date-picker-DrDFj8Lo.js.map +1 -0
  268. package/dist/date-pickers-CnFCb0n2.js +174 -0
  269. package/dist/date-pickers-CnFCb0n2.js.map +1 -0
  270. package/dist/date-uf3z37Nm.js +144 -0
  271. package/dist/date-uf3z37Nm.js.map +1 -0
  272. package/dist/{display-CFM5myut.js → display-DrdvPwF0.js} +25 -25
  273. package/dist/display-DrdvPwF0.js.map +1 -0
  274. package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-CURh59jb.js} +22 -15
  275. package/dist/dropdown-menu-CURh59jb.js.map +1 -0
  276. package/dist/features/activities.js +177 -163
  277. package/dist/features/activities.js.map +1 -1
  278. package/dist/features/ai-chat.js +187 -183
  279. package/dist/features/ai-chat.js.map +1 -1
  280. package/dist/features/async-preview.js +9 -9
  281. package/dist/features/async-preview.js.map +1 -1
  282. package/dist/features/combobox.js +1 -1
  283. package/dist/features/comments.js +1 -1
  284. package/dist/features/data-view.js +25 -23
  285. package/dist/features/data-view.js.map +1 -1
  286. package/dist/features/email-composer/engine.js +1 -1
  287. package/dist/features/email-composer.js +353 -355
  288. package/dist/features/email-composer.js.map +1 -1
  289. package/dist/features/event-calendar.js +346 -354
  290. package/dist/features/event-calendar.js.map +1 -1
  291. package/dist/features/filters.js +1 -1
  292. package/dist/features/global-search.js +225 -227
  293. package/dist/features/global-search.js.map +1 -1
  294. package/dist/features/kanban.js +29 -29
  295. package/dist/features/kanban.js.map +1 -1
  296. package/dist/features/map.js +59 -58
  297. package/dist/features/map.js.map +1 -1
  298. package/dist/features/media-library.js +898 -900
  299. package/dist/features/media-library.js.map +1 -1
  300. package/dist/features/mentions.js +1 -1
  301. package/dist/features/overlays.js +1 -1
  302. package/dist/features/products.js +1412 -1444
  303. package/dist/features/products.js.map +1 -1
  304. package/dist/features/questionnaire.js +51 -49
  305. package/dist/features/questionnaire.js.map +1 -1
  306. package/dist/features/resource-assignment.js +103 -97
  307. package/dist/features/resource-assignment.js.map +1 -1
  308. package/dist/features/resource.js +13 -13
  309. package/dist/features/resource.js.map +1 -1
  310. package/dist/features/rich-text-editor.js +2 -2
  311. package/dist/features/schema-form.js +187 -183
  312. package/dist/features/schema-form.js.map +1 -1
  313. package/dist/features/suggestions.js +3 -3
  314. package/dist/features/sync.js +7 -7
  315. package/dist/features/sync.js.map +1 -1
  316. package/dist/features/table.js +1 -1
  317. package/dist/features/theme-tweaker.js +508 -503
  318. package/dist/features/theme-tweaker.js.map +1 -1
  319. package/dist/{feedback-DWUkgEjR.js → feedback-C7nR0UtT.js} +30 -31
  320. package/dist/feedback-C7nR0UtT.js.map +1 -0
  321. package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
  322. package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
  323. package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-C-MFBX_8.js} +5 -5
  324. package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
  325. package/dist/{filters-BhsUtsxW.js → filters-Da-gNPsE.js} +760 -765
  326. package/dist/filters-Da-gNPsE.js.map +1 -0
  327. package/dist/{form-field-Bn7ZH1rA.js → form-field-VZRULhUK.js} +20 -12
  328. package/dist/form-field-VZRULhUK.js.map +1 -0
  329. package/dist/form-sizing-uWP4lzVh.js +126 -0
  330. package/dist/form-sizing-uWP4lzVh.js.map +1 -0
  331. package/dist/{forms-B7pzS25o.js → forms-DDeEnXSY.js} +38 -38
  332. package/dist/forms-DDeEnXSY.js.map +1 -0
  333. package/dist/forms-numeric-D3CO60IF.js +905 -0
  334. package/dist/forms-numeric-D3CO60IF.js.map +1 -0
  335. package/dist/{header-C59QZyxV.js → header-2ycNqGOR.js} +42 -37
  336. package/dist/header-2ycNqGOR.js.map +1 -0
  337. package/dist/{hooks-CM1Vp9Pe.js → hooks-DQ5SPwZw.js} +2 -2
  338. package/dist/{hooks-CM1Vp9Pe.js.map → hooks-DQ5SPwZw.js.map} +1 -1
  339. package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
  340. package/dist/http-CdEIHyQf.js.map +1 -0
  341. package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-DKlaKXoo.js} +4 -4
  342. package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
  343. package/dist/index.js +2 -2
  344. package/dist/input-BoLm9Hks.js +20 -0
  345. package/dist/input-BoLm9Hks.js.map +1 -0
  346. package/dist/input-DhQdBnV3.js +255 -0
  347. package/dist/input-DhQdBnV3.js.map +1 -0
  348. package/dist/item-xzh8Df65.js +264 -0
  349. package/dist/item-xzh8Df65.js.map +1 -0
  350. package/dist/layout/app-shell.js +1 -1
  351. package/dist/layout/auth.js +1 -1
  352. package/dist/layout/containers.js +1 -1
  353. package/dist/layout/header.js +1 -1
  354. package/dist/layout/hooks.js +1 -1
  355. package/dist/layout/navigation.js +1 -1
  356. package/dist/layout/page.js +1 -1
  357. package/dist/layout/settings.js +1 -1
  358. package/dist/layout/sidebar.js +2 -2
  359. package/dist/layout/workspace.js +1 -1
  360. package/dist/layout.js +10 -10
  361. package/dist/lib/affordance-geometry.generated.d.ts +46 -10
  362. package/dist/lib/control-group-recipes.d.ts +22 -0
  363. package/dist/lib/field-affordance-recipes.d.ts +70 -2
  364. package/dist/lib/field-state-recipes.d.ts +6 -4
  365. package/dist/lib/format.d.ts +9 -0
  366. package/dist/lib/money-format.d.ts +30 -0
  367. package/dist/lib/navigation-row-recipes.d.ts +3 -2
  368. package/dist/lib/overlay-anatomy-recipes.d.ts +2 -2
  369. package/dist/lib/surface-recipes.d.ts +13 -8
  370. package/dist/lib/token-merge.generated.d.ts +144 -2
  371. package/dist/lib/track-recipes.d.ts +1 -1
  372. package/dist/lib/ui-provider/provider.d.ts +7 -2
  373. package/dist/lib/ui-provider/store.d.ts +6 -2
  374. package/dist/lib/ui-provider/types.d.ts +9 -4
  375. package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
  376. package/dist/lib/utils.js +1 -1
  377. package/dist/media-gallery-DQUQ0m3O.js +201 -0
  378. package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
  379. package/dist/{mentions-B8Ko-fhS.js → mentions-DwnO1hh4.js} +40 -39
  380. package/dist/{mentions-B8Ko-fhS.js.map → mentions-DwnO1hh4.js.map} +1 -1
  381. package/dist/message-YfFmbXNP.js +127 -0
  382. package/dist/message-YfFmbXNP.js.map +1 -0
  383. package/dist/{navigation-BUIn2Qxx.js → navigation-Cbp5V8gG.js} +27 -28
  384. package/dist/navigation-Cbp5V8gG.js.map +1 -0
  385. package/dist/navigation-Cs1npsPm.js +300 -0
  386. package/dist/navigation-Cs1npsPm.js.map +1 -0
  387. package/dist/{navigation-row-recipes-GVh11KiT.js → navigation-row-recipes-DlU-4QYO.js} +3 -3
  388. package/dist/navigation-row-recipes-DlU-4QYO.js.map +1 -0
  389. package/dist/number-CKRBYmZK.js +352 -0
  390. package/dist/number-CKRBYmZK.js.map +1 -0
  391. package/dist/overlay.recipes-CNO2S9V6.js +34 -0
  392. package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
  393. package/dist/overlays-DhZO7N-I.js +994 -0
  394. package/dist/overlays-DhZO7N-I.js.map +1 -0
  395. package/dist/page-C6R_8jFt.js +325 -0
  396. package/dist/page-C6R_8jFt.js.map +1 -0
  397. package/dist/{page-header-DQRa0jug.js → page-header-hUTzcRZX.js} +12 -12
  398. package/dist/page-header-hUTzcRZX.js.map +1 -0
  399. package/dist/{pagination-C29vvt3I.js → pagination-Cm0jqa3I.js} +21 -21
  400. package/dist/pagination-Cm0jqa3I.js.map +1 -0
  401. package/dist/{popover-CoLDEg19.js → popover-Dcv_9jxr.js} +23 -22
  402. package/dist/popover-Dcv_9jxr.js.map +1 -0
  403. package/dist/{popover-menu-GLIQTJTx.js → popover-menu-DnRFKnHP.js} +6 -6
  404. package/dist/{popover-menu-GLIQTJTx.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
  405. package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-wmbvL8Ah.js} +5 -5
  406. package/dist/popover.recipes-wmbvL8Ah.js.map +1 -0
  407. package/dist/primitives-BHrwQXFC.js +379 -0
  408. package/dist/primitives-BHrwQXFC.js.map +1 -0
  409. package/dist/primitives.js +5 -5
  410. package/dist/{progress-BOe8l_FZ.js → progress-Br9WTFya.js} +12 -11
  411. package/dist/progress-Br9WTFya.js.map +1 -0
  412. package/dist/{receipt-BM8xsGFy.js → receipt-CV89q1fs.js} +8 -8
  413. package/dist/{receipt-BM8xsGFy.js.map → receipt-CV89q1fs.js.map} +1 -1
  414. package/dist/rich-text-editor-CF8QYt5p.js +574 -0
  415. package/dist/rich-text-editor-CF8QYt5p.js.map +1 -0
  416. package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-CnrbmTS1.js} +35 -26
  417. package/dist/rich-text-editor.recipes-CnrbmTS1.js.map +1 -0
  418. package/dist/{rich-text-B7sBAdDG.js → rich-text-j-FGAeZW.js} +4 -4
  419. package/dist/{rich-text-B7sBAdDG.js.map → rich-text-j-FGAeZW.js.map} +1 -1
  420. package/dist/{scroll-area-BheMQ270.js → scroll-area-DRdr16Pt.js} +3 -3
  421. package/dist/scroll-area-DRdr16Pt.js.map +1 -0
  422. package/dist/{separator-DO0EbCEm.js → separator-BMEvwnSX.js} +2 -2
  423. package/dist/{separator-DO0EbCEm.js.map → separator-BMEvwnSX.js.map} +1 -1
  424. package/dist/{separator-Gk_WXH-l.js → separator-Do5GWDYi.js} +4 -4
  425. package/dist/separator-Do5GWDYi.js.map +1 -0
  426. package/dist/services/actions/action-adapters.d.ts +4 -0
  427. package/dist/services/actions.js +8 -3
  428. package/dist/services/actions.js.map +1 -1
  429. package/dist/{settings-BnCyyPOJ.js → settings-DHk0L2MF.js} +20 -19
  430. package/dist/settings-DHk0L2MF.js.map +1 -0
  431. package/dist/sheet-DRFNY1_D.js +207 -0
  432. package/dist/sheet-DRFNY1_D.js.map +1 -0
  433. package/dist/sidebar-Cb8WzOvE.js +511 -0
  434. package/dist/sidebar-Cb8WzOvE.js.map +1 -0
  435. package/dist/{sidebar-DPR7fmqN.js → sidebar-Crc9M9JV.js} +220 -201
  436. package/dist/sidebar-Crc9M9JV.js.map +1 -0
  437. package/dist/{skeleton-CmT1ppqb.js → skeleton-DVMXr15h.js} +5 -5
  438. package/dist/{skeleton-CmT1ppqb.js.map → skeleton-DVMXr15h.js.map} +1 -1
  439. package/dist/smart-card-Bek-TwUp.js +599 -0
  440. package/dist/smart-card-Bek-TwUp.js.map +1 -0
  441. package/dist/{spinner-BY9HbUEh.js → spinner-CmTAbEp0.js} +8 -6
  442. package/dist/spinner-CmTAbEp0.js.map +1 -0
  443. package/dist/{structure-MvKVq-oL.js → structure-hzCW-XsV.js} +3 -3
  444. package/dist/{structure-MvKVq-oL.js.map → structure-hzCW-XsV.js.map} +1 -1
  445. package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
  446. package/dist/structure.recipes-EPz60cU8.js.map +1 -0
  447. package/dist/style.css +1 -1
  448. package/dist/surface-recipes-DOdoBXGm.js +28 -0
  449. package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
  450. package/dist/table-D6zKeYQX.js +162 -0
  451. package/dist/table-D6zKeYQX.js.map +1 -0
  452. package/dist/table-Dn4XSrSB.js +1444 -0
  453. package/dist/table-Dn4XSrSB.js.map +1 -0
  454. package/dist/tabs-Dk8E_knt.js +189 -0
  455. package/dist/tabs-Dk8E_knt.js.map +1 -0
  456. package/dist/text-inputs-BFpku0Qd.js +331 -0
  457. package/dist/text-inputs-BFpku0Qd.js.map +1 -0
  458. package/dist/{text.styles-BwB7vAF2.js → text.styles-g4He6UIW.js} +26 -15
  459. package/dist/text.styles-g4He6UIW.js.map +1 -0
  460. package/dist/theme.css +90 -124
  461. package/dist/themes/green.css +24 -0
  462. package/dist/{timelines-B9ICkQcV.js → timelines-CxuAFIc2.js} +97 -104
  463. package/dist/timelines-CxuAFIc2.js.map +1 -0
  464. package/dist/track-recipes-CDcKmndW.js +10 -0
  465. package/dist/track-recipes-CDcKmndW.js.map +1 -0
  466. package/dist/{tree-BdWSaoFT.js → tree-BotPlyiD.js} +13 -13
  467. package/dist/{tree-BdWSaoFT.js.map → tree-BotPlyiD.js.map} +1 -1
  468. package/dist/typography/rich-text.js +1 -1
  469. package/dist/typography-CAr3dQhX.js +116 -0
  470. package/dist/typography-CAr3dQhX.js.map +1 -0
  471. package/dist/typography.js +2 -2
  472. package/dist/{ui-provider-CftIB6TY.js → ui-provider-D2_TeLqw.js} +22 -22
  473. package/dist/ui-provider-D2_TeLqw.js.map +1 -0
  474. package/dist/ui-provider.js +1 -1
  475. package/dist/{upload-D8Za5x_c.js → upload-B0WHW7ak.js} +278 -274
  476. package/dist/upload-B0WHW7ak.js.map +1 -0
  477. package/dist/{upload-queue-hIIYBLS7.js → upload-queue-BHZ_wBfd.js} +72 -75
  478. package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
  479. package/dist/{usage-card-DnmnJ58D.js → usage-card-U0YBLTNT.js} +31 -33
  480. package/dist/usage-card-U0YBLTNT.js.map +1 -0
  481. package/dist/utils-Cospvlj1.js +4445 -0
  482. package/dist/utils-Cospvlj1.js.map +1 -0
  483. package/dist/value-inputs-CjfzGMsN.js +854 -0
  484. package/dist/value-inputs-CjfzGMsN.js.map +1 -0
  485. package/dist/value-typography-Deb3yQZg.js +116 -0
  486. package/dist/value-typography-Deb3yQZg.js.map +1 -0
  487. package/dist/{workspace-C1PZmk8L.js → workspace-YoFjXi6i.js} +97 -105
  488. package/dist/workspace-YoFjXi6i.js.map +1 -0
  489. package/docs/consumer-skill/SKILL.md +123 -119
  490. package/docs/consumer-skill/examples/analytics.tsx +34 -0
  491. package/docs/consumer-skill/examples/app-layout.tsx +42 -14
  492. package/docs/consumer-skill/examples/detail.tsx +20 -5
  493. package/docs/consumer-skill/examples/edit.tsx +1 -1
  494. package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
  495. package/docs/consumer-skill/examples/manifest.json +37 -3
  496. package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
  497. package/docs/consumer-skill/examples/website.tsx +56 -0
  498. package/docs/consumer-skill/references/analytics.md +70 -0
  499. package/docs/consumer-skill/references/composition.md +195 -9
  500. package/docs/consumer-skill/references/design-contract.md +33 -7
  501. package/docs/consumer-skill/references/discovery.md +80 -5
  502. package/docs/consumer-skill/references/installation.md +22 -0
  503. package/docs/consumer-skill/references/integration.md +46 -1
  504. package/docs/consumer-skill/references/public-api.json +2083 -237
  505. package/docs/consumer-skill/references/review.md +74 -6
  506. package/docs/consumer-skill/references/theming.md +59 -8
  507. package/docs/consumer-skill/references/tokens.json +180 -9
  508. package/docs/consumer-skill/references/workflows.md +34 -0
  509. package/docs/consumer-skill/scripts/check-composition.mjs +1 -1
  510. package/docs/consumer-skill/scripts/composition-policy.mjs +271 -18
  511. package/docs/consumer-skill/scripts/discovery.mjs +69 -9
  512. package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
  513. package/docs/consumer-skill/scripts/surface-policy.mjs +44 -0
  514. package/package.json +11 -6
  515. package/dist/accordion-B-5Focs8.js.map +0 -1
  516. package/dist/action-menu-Cx3SdfbN.js +0 -265
  517. package/dist/action-menu-Cx3SdfbN.js.map +0 -1
  518. package/dist/affordance-geometry.generated-D8Jcfb0G.js +0 -32
  519. package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +0 -1
  520. package/dist/ai-artifact-B5tPpXnS.js.map +0 -1
  521. package/dist/app-shell-at8Kt4l_.js.map +0 -1
  522. package/dist/attachment-BO2R47wn.js.map +0 -1
  523. package/dist/auth-OFwWSAap.js +0 -704
  524. package/dist/auth-OFwWSAap.js.map +0 -1
  525. package/dist/avatar-Bpzty83c.js.map +0 -1
  526. package/dist/badge-BZXZT9wd.js.map +0 -1
  527. package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
  528. package/dist/button-BS6l5JUw.js.map +0 -1
  529. package/dist/buttons-Co6GavvM.js +0 -674
  530. package/dist/buttons-Co6GavvM.js.map +0 -1
  531. package/dist/chart-DVfcwQu6.js +0 -149
  532. package/dist/chart-DVfcwQu6.js.map +0 -1
  533. package/dist/checkbox-BavDRjF7.js +0 -34
  534. package/dist/checkbox-BavDRjF7.js.map +0 -1
  535. package/dist/choice-inputs-CC7XqPQO.js +0 -619
  536. package/dist/choice-inputs-CC7XqPQO.js.map +0 -1
  537. package/dist/code-block-xHKbAJDj.js.map +0 -1
  538. package/dist/combobox-DEbdr-3u.js +0 -273
  539. package/dist/combobox-DEbdr-3u.js.map +0 -1
  540. package/dist/combobox-xv3yJbzl.js +0 -850
  541. package/dist/combobox-xv3yJbzl.js.map +0 -1
  542. package/dist/command-C0xe7u9B.js.map +0 -1
  543. package/dist/comments-DviPLnwy.js.map +0 -1
  544. package/dist/containers-6s-ucRQQ.js.map +0 -1
  545. package/dist/data-display-cWIRdeaf.js +0 -1129
  546. package/dist/data-display-cWIRdeaf.js.map +0 -1
  547. package/dist/date-BFNMnrS5.js +0 -140
  548. package/dist/date-BFNMnrS5.js.map +0 -1
  549. package/dist/date-picker-CA6ogMQB.js +0 -1521
  550. package/dist/date-picker-CA6ogMQB.js.map +0 -1
  551. package/dist/date-pickers-BPIKLdsD.js +0 -224
  552. package/dist/date-pickers-BPIKLdsD.js.map +0 -1
  553. package/dist/display-CFM5myut.js.map +0 -1
  554. package/dist/dropdown-menu-BlnyHr-9.js.map +0 -1
  555. package/dist/feedback-DWUkgEjR.js.map +0 -1
  556. package/dist/field-affordance-recipes-IjzPrCTw.js +0 -17
  557. package/dist/field-affordance-recipes-IjzPrCTw.js.map +0 -1
  558. package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
  559. package/dist/filters-BhsUtsxW.js.map +0 -1
  560. package/dist/form-field-Bn7ZH1rA.js.map +0 -1
  561. package/dist/form-sizing-BWs70_a2.js +0 -100
  562. package/dist/form-sizing-BWs70_a2.js.map +0 -1
  563. package/dist/format-iamDSqs2.js +0 -110
  564. package/dist/format-iamDSqs2.js.map +0 -1
  565. package/dist/forms-B7pzS25o.js.map +0 -1
  566. package/dist/forms-numeric-BUBxELBv.js +0 -867
  567. package/dist/forms-numeric-BUBxELBv.js.map +0 -1
  568. package/dist/header-C59QZyxV.js.map +0 -1
  569. package/dist/http-CLTVJc5I.js.map +0 -1
  570. package/dist/input-WwYQZJzG.js +0 -202
  571. package/dist/input-WwYQZJzG.js.map +0 -1
  572. package/dist/input-ci9fIgFH.js +0 -20
  573. package/dist/input-ci9fIgFH.js.map +0 -1
  574. package/dist/item-pJ0GsOiJ.js +0 -257
  575. package/dist/item-pJ0GsOiJ.js.map +0 -1
  576. package/dist/media-gallery-DhDRgnVZ.js +0 -200
  577. package/dist/media-gallery-DhDRgnVZ.js.map +0 -1
  578. package/dist/message-COsdEvXT.js +0 -108
  579. package/dist/message-COsdEvXT.js.map +0 -1
  580. package/dist/navigation-BUIn2Qxx.js.map +0 -1
  581. package/dist/navigation-DBEu4POU.js +0 -267
  582. package/dist/navigation-DBEu4POU.js.map +0 -1
  583. package/dist/navigation-row-recipes-GVh11KiT.js.map +0 -1
  584. package/dist/number-BNT_BIzJ.js +0 -269
  585. package/dist/number-BNT_BIzJ.js.map +0 -1
  586. package/dist/overlay.recipes-BxW5FIfK.js +0 -6
  587. package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
  588. package/dist/overlays-B11wZka6.js +0 -982
  589. package/dist/overlays-B11wZka6.js.map +0 -1
  590. package/dist/page-BV6ioQg3.js +0 -202
  591. package/dist/page-BV6ioQg3.js.map +0 -1
  592. package/dist/page-header-DQRa0jug.js.map +0 -1
  593. package/dist/pagination-C29vvt3I.js.map +0 -1
  594. package/dist/popover-CoLDEg19.js.map +0 -1
  595. package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
  596. package/dist/primitives-DKPOGVpj.js +0 -330
  597. package/dist/primitives-DKPOGVpj.js.map +0 -1
  598. package/dist/progress-BOe8l_FZ.js.map +0 -1
  599. package/dist/rich-text-editor-CoVrTiSv.js +0 -575
  600. package/dist/rich-text-editor-CoVrTiSv.js.map +0 -1
  601. package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
  602. package/dist/scroll-area-BheMQ270.js.map +0 -1
  603. package/dist/select-B2mb-qN2.js +0 -108
  604. package/dist/select-B2mb-qN2.js.map +0 -1
  605. package/dist/separator-Gk_WXH-l.js.map +0 -1
  606. package/dist/settings-BnCyyPOJ.js.map +0 -1
  607. package/dist/sheet-B-q914Ad.js +0 -205
  608. package/dist/sheet-B-q914Ad.js.map +0 -1
  609. package/dist/sidebar-C_2p3Tfj.js +0 -501
  610. package/dist/sidebar-C_2p3Tfj.js.map +0 -1
  611. package/dist/sidebar-DPR7fmqN.js.map +0 -1
  612. package/dist/smart-card-CYLn46e6.js +0 -578
  613. package/dist/smart-card-CYLn46e6.js.map +0 -1
  614. package/dist/spinner-BY9HbUEh.js.map +0 -1
  615. package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
  616. package/dist/surface-recipes-CQfRr-VL.js +0 -27
  617. package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
  618. package/dist/table-BS39xnlq.js +0 -1424
  619. package/dist/table-BS39xnlq.js.map +0 -1
  620. package/dist/table-DnlAJ-xR.js +0 -146
  621. package/dist/table-DnlAJ-xR.js.map +0 -1
  622. package/dist/tabs-B5cNMWiP.js +0 -187
  623. package/dist/tabs-B5cNMWiP.js.map +0 -1
  624. package/dist/text-inputs-Dh9XGyiS.js +0 -331
  625. package/dist/text-inputs-Dh9XGyiS.js.map +0 -1
  626. package/dist/text.styles-BwB7vAF2.js.map +0 -1
  627. package/dist/timelines-B9ICkQcV.js.map +0 -1
  628. package/dist/track-recipes-LLPNVwFg.js +0 -10
  629. package/dist/track-recipes-LLPNVwFg.js.map +0 -1
  630. package/dist/typography-Cv8MT-82.js +0 -96
  631. package/dist/typography-Cv8MT-82.js.map +0 -1
  632. package/dist/ui-provider-CftIB6TY.js.map +0 -1
  633. package/dist/upload-D8Za5x_c.js.map +0 -1
  634. package/dist/upload-queue-hIIYBLS7.js.map +0 -1
  635. package/dist/usage-card-DnmnJ58D.js.map +0 -1
  636. package/dist/utils-C2EKeIw3.js +0 -72
  637. package/dist/utils-C2EKeIw3.js.map +0 -1
  638. package/dist/value-inputs-DX2dbxjj.js +0 -824
  639. package/dist/value-inputs-DX2dbxjj.js.map +0 -1
  640. package/dist/workspace-C1PZmk8L.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments-You0Bzbr.js","names":["ImageIcon","_Fragment","NumberValue","_Fragment","useCommentsUIDefaults","useCommentsConfig","useDatesConfig","cn","TextButton","DisplayLabel","TextLink","Tooltip","TooltipTrigger","TooltipContent","TooltipProvider","Button","Stack","rowBlockPaddingClasses","useOverlayVisibility","ConfirmDialog","sanitizeHtml","contentTypographyClassName","RichText","SecondaryValue","FileSize","Percent","Number$1","RelativeTime","AvatarFallback","Avatar","AvatarImage","Badge","fieldAffordanceRecipes","PopoverTrigger","Popover","EmptyState","RichTextEditor","useMentions","MentionInlineSuggestions","MentionContent","MentionPicker","parseMentionsFromHtml","Fragment$1","defaultCommentsStrings","useResolvedStrings","useStrings","propStrings","useResolvedAccessors","dates","useMemo","propAccessors","useComments","options","composerMode","setComposerMode","useState","isSubmitting","setIsSubmitting","isSubmittingRef","useRef","formErrors","setFormErrors","resetKey","setResetKey","setSubmitting","useCallback","submitting","resetComposer","k","helpers","reportError","error","onError","comment","onUpdate","payload","values","onAfterMutate","onSubmit","onDelete","id","pickIcon","att","Image","FileText","File","Paperclip","CommentAttachmentChip","stringsProp","strings","url","accessors","attachment","name","Icon","isUploading","isFailed","meta","surface","compact","className","iconNode","Loader2","labelRow","Text","onRetry","editable","onRemove","X","defaultAttachmentUploadStrings","useAttachmentUpload","attachments","setAttachmentsState","initialAttachments","inFlightRef","fileCacheRef","attachmentsRef","commitAttachments","list","next","onValueChangeRef","onValueChange","updateAttachment","a","patch","setAttachments","beginUpload","onUpload","controller","uploaded","message","err","addFiles","disabled","files","filesInput","pending","file","maxFiles","maxSize","removeAttachment","entry","retryAttachment","reset","useEffect","inFlight","cache","hasMeaningfulContent","html","CommentComposer","forwardRef","resourcesProp","onResourceSearchProp","attachmentsProp","maxAttachmentsProp","allowAttachmentsProp","resources","onResourceSearch","allowAttachments","maxAttachments","attachmentsConfig","editorRef","body","setBody","initialValues","editingComment","contentError","setContentError","attachmentError","setAttachmentError","mentions","attachmentUpload","handleCancel","onCancel","useImperativeHandle","ref","context","errors","handleSubmit","event","replyingTo","fileInputRef","handleAttachmentClick","handleFiles","hasAttachments","isEditing","isReplying","submitLabel","eyebrow","ComposerEyebrow","makeReplyEyebrow","extraToolbarItems","items","AtSign","canComment","submitButton","cancelButton","attachmentChips","footerSlot","trailingSubmit","inlineSubmit","showFooterRow","kind","parsed","previous","m","byId","merged","p","placeholder","autoFocus","label","onClose","closeLabel","interpolateString","template","CommentEmpty","icon","MessageCircle","CommentContent","props","contentType","richContent","renderRichContent","renderReference","plainContent","decodeQuotedString","rawContent","Fragment","renderRichBlock","block","index","decoded","data","raw","text","stripHtml","level","createElement","sanitizedItems","item","caption","value","trimmed","FALLBACK_INITIAL","defaultGetMediaUrl","defaultGetMediaName","defaultGetStatusLabel","s","CommentItem","memo","allowReactionsProp","allowRepliesProp","allowReactions","allowReplies","resolvedGetMediaUrl","resolvedGetMediaName","resolvedGetStatusLabel","resolvedFormatRelativeTime","authorName","avatarUrl","fallbackInitial","tagList","tag","reactions","isPinned","isEdited","showStatus","statusLabel","canDeleteComment","canModerate","canEditComment","canReply","onReply","canReact","onReact","canPin","onPinToggle","canEdit","onEdit","canDelete","hasActions","attachmentConfirm","pendingAttachmentId","setPendingAttachmentId","requestAttachmentRemoval","attachmentId","Pin","renderAttachment","canRemoveAttachment","onAttachmentRemove","reaction","CornerDownRight","Smile","Pencil","Trash2","CommentTimeline","comments","defaultItem","renderItem","emptySlot","Comments","ui","composerPosition","title","confirmDelete","deleteConfirm","pendingDeleteId","setPendingDeleteId","commentsState","requestDelete","startReply","handleReply","commentId","composer","timeline","composerBlock","inner","ariaLabel"],"sources":["../src/components/features/comments/comments.strings.ts","../src/components/features/comments/comments-provider.tsx","../src/components/features/comments/hooks/use-comments.ts","../src/components/features/comments/partials/comment-attachment-chip.tsx","../src/components/features/comments/hooks/use-attachment-upload.ts","../src/components/features/comments/partials/comment-composer.tsx","../src/components/features/comments/partials/comment-empty.tsx","../src/components/features/comments/partials/comment-content.tsx","../src/components/features/comments/partials/comment-item.tsx","../src/components/features/comments/partials/comment-timeline.tsx","../src/components/features/comments/comments.tsx"],"sourcesContent":["/**\n * Strings for the Comments feature. Consumers override via the `strings`\n * prop on `<Comments>` / sub-components — values are\n * deep-merged over these defaults.\n */\nexport interface CommentsStrings {\n\t/** Card title — usually \"Comments\". Set to \"\" to hide. */\n\ttitle: string;\n\t/** Subtitle under the card title — optional. */\n\tsubtitle: string;\n\t/** Empty-state copy for the timeline. */\n\tempty: string;\n\t/** Empty-state secondary copy. */\n\temptyHint: string;\n\n\t// Composer ---------------------------------------------------------\n\t/** Composer rich-text placeholder. */\n\tcomposerPlaceholder: string;\n\t/** Submit label for new comments. */\n\tcomposerSubmit: string;\n\t/** Submit label while pending. */\n\tcomposerSubmitting: string;\n\t/** Submit label when editing. */\n\tcomposerSave: string;\n\t/** Required-content error. */\n\tinvalidContent: string;\n\t/** Cancel/dismiss draft. */\n\tcomposerCancel: string;\n\t/** \"Edit comment\" eyebrow shown above the composer in edit mode. */\n\tcomposerEditingEyebrow: string;\n\t/** \"Reply to {{name}}\" eyebrow shown above the composer in reply mode. */\n\tcomposerReplyingEyebrow: string;\n\n\t// Toolbar buttons --------------------------------------------------\n\tcomposerAttachmentLabel: string;\n\t/** Control that inserts a mention or link. */\n\tcomposerReferenceLabel: string;\n\t/** Heading of the insert-reference menu. */\n\tcomposerReferenceMenuTitle: string;\n\t/** Placeholder in the reference search field. */\n\tcomposerReferenceSearchPlaceholder: string;\n\t/** Shown when a reference search matches nothing. */\n\tcomposerReferenceEmpty: string;\n\t/** Shown while reference results are loading. */\n\tcomposerReferenceLoading: string;\n\n\t// Item -------------------------------------------------------------\n\tfallbackAuthor: string;\n\t/** Chip marking a pinned comment. */\n\tpinned: string;\n\t/** Suffix marking an edited comment. */\n\tedited: string;\n\t/** Trash button aria-label / tooltip. */\n\tdeleteLabel: string;\n\t/** Edit button label. */\n\teditLabel: string;\n\t/** Reply button label. */\n\treplyLabel: string;\n\t/** Pin/unpin button label. */\n\tpinLabel: string;\n\t/** Action that unpins a comment. */\n\tunpinLabel: string;\n\t/** \"More actions\" trigger aria-label. */\n\tmoreActionsLabel: string;\n\t/** Confirm-delete button label inside the action menu. */\n\tconfirmDeleteLabel: string;\n\t/** Title of the confirmation shown before a comment is deleted. */\n\tconfirmDeleteTitle: string;\n\t/** Title of the confirmation shown before an attachment is removed. */\n\tconfirmRemoveAttachmentTitle: string;\n\t/** Consequence of removing an attachment from a posted comment. */\n\tconfirmRemoveAttachmentDescription: string;\n\t/** Sentence explaining the consequence before the delete is committed. */\n\tconfirmDeleteDescription: string;\n\n\t// Attachments ------------------------------------------------------\n\tattachmentFallback: string;\n\t/** Removes an attachment — staged in the composer, or posted on a comment. */\n\tattachmentRemoveLabel: string;\n\t/** Shown while an attachment uploads. */\n\tattachmentUploadingLabel: string;\n\t/** Shown when an attachment upload fails. */\n\tattachmentFailedLabel: string;\n\t/** Shown when a file exceeds the size limit. */\n\tattachmentTooLargeError: string;\n\t/** Shown when too many files are attached. */\n\tattachmentTooManyError: string;\n\t/** Action that retries a failed upload. */\n\tattachmentRetryLabel: string;\n\t/** Action that downloads an attachment. */\n\tattachmentDownloadLabel: string;\n\n\t// Reactions --------------------------------------------------------\n\taddReactionLabel: string;\n\t/** Reaction button name; interpolates {{emoji}} and {{count}}. Optional for existing complete string objects. */\n\treactionLabel?: string;\n\n\t// Misc -------------------------------------------------------------\n\tshowRepliesLabel: string;\n\t/** Control that collapses a reply thread. */\n\thideRepliesLabel: string;\n}\n\nexport const defaultCommentsStrings: CommentsStrings = {\n\ttitle: 'Comments',\n\tsubtitle: '',\n\tempty: 'No comments yet.',\n\temptyHint: 'Start the conversation — your team will see it instantly.',\n\n\tcomposerPlaceholder: 'Write a comment…',\n\tcomposerSubmit: 'Post comment',\n\tcomposerSubmitting: 'Posting…',\n\tcomposerSave: 'Save changes',\n\tinvalidContent: 'Comment cannot be empty.',\n\tcomposerCancel: 'Cancel',\n\tcomposerEditingEyebrow: 'Editing comment',\n\tcomposerReplyingEyebrow: 'Replying to {{name}}',\n\n\tcomposerAttachmentLabel: 'Attach file',\n\tcomposerReferenceLabel: 'Mention or link',\n\tcomposerReferenceMenuTitle: 'Insert reference',\n\tcomposerReferenceSearchPlaceholder: 'Search…',\n\tcomposerReferenceEmpty: 'No matches.',\n\tcomposerReferenceLoading: 'Searching…',\n\n\tfallbackAuthor: 'Anonymous',\n\tpinned: 'Pinned',\n\tedited: 'edited',\n\tdeleteLabel: 'Delete',\n\teditLabel: 'Edit',\n\treplyLabel: 'Reply',\n\tpinLabel: 'Pin',\n\tunpinLabel: 'Unpin',\n\tmoreActionsLabel: 'More actions',\n\tconfirmDeleteLabel: 'Delete comment',\n\tconfirmDeleteTitle: 'Delete this comment?',\n\tconfirmRemoveAttachmentTitle: 'Remove this attachment?',\n\tconfirmRemoveAttachmentDescription: 'The file is detached from the comment for everyone. This cannot be undone.',\n\tconfirmDeleteDescription: 'The comment and its replies are removed for everyone. This cannot be undone.',\n\n\tattachmentFallback: 'Attachment',\n\tattachmentRemoveLabel: 'Remove attachment',\n\tattachmentUploadingLabel: 'Uploading…',\n\tattachmentFailedLabel: 'Upload failed',\n\tattachmentTooLargeError: 'File is too large.',\n\tattachmentTooManyError: 'Too many attachments.',\n\tattachmentRetryLabel: 'Retry',\n\tattachmentDownloadLabel: 'Download',\n\n\taddReactionLabel: 'Add reaction',\n\treactionLabel: 'Reaction {{emoji}}: {{count}}',\n\n\tshowRepliesLabel: 'Show replies',\n\thideRepliesLabel: 'Hide replies',\n};\n","/**\n * Comments — internal helper hooks for resolving strings and accessors.\n *\n * Rationale: the previous `<CommentsProvider>` is gone. Library-wide\n * Per-mount overrides flow as direct props on `<Comments>` and its partials.\n * Date formatting may still inherit the app-wide dates configuration.\n *\n * Resolution order everywhere:\n *\n * props.strings ← deep-merged over `defaultCommentsStrings`\n * props.accessor.X ← falls back to UIProvider's dates formatter, then\n * to a built-in default at the call site.\n */\nimport { useMemo } from 'react';\n\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { useDatesConfig } from '../../../lib/ui-provider';\n\nimport {\n\tdefaultCommentsStrings,\n\ttype CommentsStrings,\n} from './comments.strings';\nimport type { CommentsAccessors } from './comments.types';\n\n/**\n * Resolve final strings by merging defaults → component prop. Stable\n * identity when the prop reference is unchanged.\n */\nexport function useResolvedStrings(\n\tpropStrings?: StringsProp<CommentsStrings>,\n): CommentsStrings {\n\treturn useStrings(defaultCommentsStrings, propStrings);\n}\n\n/**\n * Resolve accessors. Order:\n * 1. explicit prop accessor\n * 2. the UIProvider date formatter for relative time\n * 3. caller's own fallback when neither is present (handled at call site)\n */\nexport function useResolvedAccessors(\n\tpropAccessors?: CommentsAccessors,\n): CommentsAccessors {\n\tconst dates = useDatesConfig();\n\treturn useMemo<CommentsAccessors>(\n\t\t() => ({\n\t\t\tgetMediaUrl: propAccessors?.getMediaUrl,\n\t\t\tgetMediaName: propAccessors?.getMediaName,\n\t\t\tgetStatusLabel: propAccessors?.getStatusLabel,\n\t\t\tformatRelativeTime:\n\t\t\t\tpropAccessors?.formatRelativeTime ?? dates.formatRelativeTime,\n\t\t}),\n\t\t[propAccessors, dates.formatRelativeTime],\n\t);\n}\n","/**\n * useComments — headless state machine for the Comments feature.\n *\n * Tracks composer mode (idle | replying | editing), submit/delete\n * helpers, error state, and resetKey bumping. The default `<Comments>`\n * component composes this hook; consumers building a fully custom UI\n * can use it directly.\n */\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport type {\n\tCommentData,\n\tCommentFormValues,\n\tCommentSubmitHelpers,\n\tCommentUser,\n\tCommentsConfig,\n} from '../comments.types';\n\nexport type ComposerMode<\n\tTResource extends string = string,\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n> =\n\t| { kind: 'idle' }\n\t| { kind: 'editing'; comment: CommentData<TUser, TMeta, TResource> }\n\t| { kind: 'replying'; commentId: string; authorName?: string };\n\nexport interface UseCommentsOptions<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n> {\n\tonSubmit?: CommentsConfig<TUser, TMeta, TResource>['onSubmit'];\n\tonUpdate?: CommentsConfig<TUser, TMeta, TResource>['onUpdate'];\n\tonDelete?: CommentsConfig<TUser, TMeta, TResource>['onDelete'];\n\tonAfterMutate?: CommentsConfig<TUser, TMeta, TResource>['onAfterMutate'];\n\tonError?: CommentsConfig<TUser, TMeta, TResource>['onError'];\n}\n\nexport interface UseCommentsReturn<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n> {\n\tcomposerMode: ComposerMode<TResource, TUser, TMeta>;\n\tisSubmitting: boolean;\n\tformErrors: Record<string, string>;\n\tresetKey: number;\n\n\tstartReply: (comment: CommentData<TUser, TMeta, TResource>) => void;\n\tstartEdit: (comment: CommentData<TUser, TMeta, TResource>) => void;\n\tcancelComposerMode: () => void;\n\n\tsubmit: (values: CommentFormValues<TResource>) => Promise<void>;\n\tdeleteComment: (id: string) => Promise<void>;\n\n\t/** Imperative reset — bumps `resetKey` so the composer clears itself. */\n\tresetComposer: () => void;\n\t/** Helpers exposed to onSubmit/onUpdate. */\n\thelpers: CommentSubmitHelpers;\n}\n\nexport function useComments<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>(\n\toptions: UseCommentsOptions<TUser, TMeta, TResource> = {},\n): UseCommentsReturn<TUser, TMeta, TResource> {\n\tconst { onSubmit, onUpdate, onDelete, onAfterMutate, onError } = options;\n\n\tconst [composerMode, setComposerMode] = useState<\n\t\tComposerMode<TResource, TUser, TMeta>\n\t>({\n\t\tkind: 'idle',\n\t});\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\n\tconst isSubmittingRef = useRef(false);\n\tconst [formErrors, setFormErrors] = useState<Record<string, string>>({});\n\tconst [resetKey, setResetKey] = useState(0);\n\n\tconst setSubmitting = useCallback((submitting: boolean) => {\n\t\tisSubmittingRef.current = submitting;\n\t\tsetIsSubmitting(submitting);\n\t}, []);\n\n\tconst resetComposer = useCallback(() => {\n\t\tsetResetKey((k) => k + 1);\n\t\tsetComposerMode({ kind: 'idle' });\n\t\tsetFormErrors({});\n\t\tsetSubmitting(false);\n\t}, [setSubmitting]);\n\n\tconst helpers = useMemo<CommentSubmitHelpers>(\n\t\t() => ({\n\t\t\tsetErrors: setFormErrors,\n\t\t\treset: resetComposer,\n\t\t\tsetSubmitting,\n\t\t}),\n\t\t[resetComposer, setSubmitting],\n\t);\n\n\tconst reportError = useCallback(\n\t\t(error: unknown) => {\n\t\t\ttry {\n\t\t\t\tonError?.(error);\n\t\t\t} catch (callbackError) {\n\t\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\t\tconsole.warn('[Comments] onError callback failed.', callbackError);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[onError],\n\t);\n\n\tconst startReply = useCallback(\n\t\t(comment: CommentData<TUser, TMeta, TResource>) => {\n\t\t\tif (!comment.id) return;\n\t\t\tsetFormErrors({});\n\t\t\tsetComposerMode({\n\t\t\t\tkind: 'replying',\n\t\t\t\tcommentId: comment.id,\n\t\t\t\tauthorName: comment.user?.name,\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst startEdit = useCallback(\n\t\t(comment: CommentData<TUser, TMeta, TResource>) => {\n\t\t\tif (!comment.id) return;\n\t\t\tsetFormErrors({});\n\t\t\tsetComposerMode({ kind: 'editing', comment });\n\t\t},\n\t\t[],\n\t);\n\n\tconst cancelComposerMode = useCallback(() => {\n\t\tresetComposer();\n\t}, [resetComposer]);\n\n\tconst submit = useCallback(\n\t\tasync (values: CommentFormValues<TResource>) => {\n\t\t\tif (composerMode.kind === 'editing' && composerMode.comment.id) {\n\t\t\t\tif (!onUpdate) return;\n\t\t\t\tif (isSubmittingRef.current) return;\n\n\t\t\t\tconst payload = {\n\t\t\t\t\t...values,\n\t\t\t\t\teditingId: composerMode.comment.id,\n\t\t\t\t};\n\t\t\t\tsetSubmitting(true);\n\t\t\t\tsetFormErrors({});\n\t\t\t\ttry {\n\t\t\t\t\tawait onUpdate(composerMode.comment.id, payload, helpers);\n\t\t\t\t\tonAfterMutate?.('update', payload);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treportError(error);\n\t\t\t\t} finally {\n\t\t\t\t\tsetSubmitting(false);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!onSubmit) return;\n\t\t\tif (isSubmittingRef.current) return;\n\n\t\t\tconst payload: CommentFormValues<TResource> =\n\t\t\t\tcomposerMode.kind === 'replying'\n\t\t\t\t\t? { ...values, replyToId: composerMode.commentId }\n\t\t\t\t\t: values;\n\n\t\t\tsetSubmitting(true);\n\t\t\tsetFormErrors({});\n\t\t\ttry {\n\t\t\t\tawait onSubmit(payload, helpers);\n\t\t\t\tonAfterMutate?.('create', payload);\n\t\t\t} catch (error) {\n\t\t\t\treportError(error);\n\t\t\t} finally {\n\t\t\t\tsetSubmitting(false);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tcomposerMode,\n\t\t\thelpers,\n\t\t\tonAfterMutate,\n\t\t\tonSubmit,\n\t\t\tonUpdate,\n\t\t\treportError,\n\t\t\tsetSubmitting,\n\t\t],\n\t);\n\n\tconst deleteComment = useCallback(\n\t\tasync (id: string) => {\n\t\t\tif (!onDelete || !id) return;\n\t\t\ttry {\n\t\t\t\tawait onDelete(id);\n\t\t\t\tonAfterMutate?.('delete', { commentId: id });\n\t\t\t} catch (error) {\n\t\t\t\treportError(error);\n\t\t\t}\n\t\t},\n\t\t[onAfterMutate, onDelete, reportError],\n\t);\n\n\treturn {\n\t\tcomposerMode,\n\t\tisSubmitting,\n\t\tformErrors,\n\t\tresetKey,\n\t\tstartReply,\n\t\tstartEdit,\n\t\tcancelComposerMode,\n\t\tsubmit,\n\t\tdeleteComment,\n\t\tresetComposer,\n\t\thelpers,\n\t};\n}\n","/**\n * CommentAttachmentChip — small attachment pill used in the composer draft\n * and the timeline. Single inline row: icon + name · size, with progress /\n * error states overlaid on the same line. Editable mode reveals a remove\n * button; failed uploads expose a retry pill.\n */\nimport { File, FileText, Image as ImageIcon, Loader2, Paperclip, X } from 'lucide-react';\nimport type { FC, ReactNode } from 'react';\n\nimport { TextButton } from '../../../base/buttons';\nimport { FileSize, Percent, SecondaryValue } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { rowBlockPaddingClasses } from '../../../../lib/row-recipes';\nimport { fieldAffordanceRecipes } from '../../../../lib/field-affordance-recipes';\n\nimport type {\n\t\tCommentAttachment,\n\t\tCommentsAccessors,\n} from '../comments.types';\nimport {\n\t\tdefaultCommentsStrings,\n\t\ttype CommentsStrings,\n} from '../comments.strings';\n\nexport interface CommentAttachmentChipProps {\n\t\t/** The attachment this chip represents. */\n\t\tattachment: CommentAttachment;\n\t\t/** Editable mode shows a remove button. */\n\t\teditable?: boolean;\n\t\t/** Fired when an entry is removed. */\n\t\tonRemove?: (id: string) => void;\n\t\t/** Fired when the user retries after an entry failure. */\n\t\tonRetry?: (id: string) => void;\n\t\t/** Reads the fields this surface needs off your own shape. */\n\t\taccessors?: CommentsAccessors;\n\t\t/** Overrides this surface's own copy. */\n\t\tstrings?: StringsProp<CommentsStrings>;\n\t\t/** Compact chips have smaller text and tighter padding. */\n\t\tcompact?: boolean;\n\t\t/** Merged onto the outermost node. */\n\t\tclassName?: string;\n}\n\nfunction pickIcon(att: CommentAttachment) {\n\t\tif (att.mimeType?.startsWith('image/')) return ImageIcon;\n\t\tif (att.mimeType === 'application/pdf') return FileText;\n\t\tif (att.mimeType?.startsWith('text/')) return FileText;\n\t\tif (att.mimeType) return File;\n\t\treturn Paperclip;\n}\n\nexport const CommentAttachmentChip: FC<CommentAttachmentChipProps> = ({\n\t\tattachment,\n\t\teditable = false,\n\t\tonRemove,\n\t\tonRetry,\n\t\taccessors,\n\t\tstrings: stringsProp,\n\t\tcompact = false,\n\t\tclassName,\n}) => {\n\t\tconst strings = useStrings(defaultCommentsStrings, stringsProp);\n\n\t\tconst url = accessors?.getMediaUrl?.(attachment) ?? attachment.url;\n\t\tconst name =\n\t\t\t\taccessors?.getMediaName?.(attachment) ??\n\t\t\t\tattachment.name ??\n\t\t\t\tstrings.attachmentFallback;\n\t\tconst Icon = pickIcon(attachment);\n\n\t\tconst isUploading = attachment.status === 'uploading';\n\t\tconst isFailed = attachment.status === 'failed';\n\t\tconst meta: ReactNode = isUploading\n\t\t\t\t? (\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.attachmentUploadingLabel}\n\t\t\t\t\t\t\t\t{typeof attachment.progress === 'number' ? (\n\t\t\t\t\t\t\t\t\t\t<>\n\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<Percent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={Math.round(attachment.progress)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tscaled\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talign=\"left\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"secondary\"\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) : null}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t)\n\t\t\t\t: isFailed\n\t\t\t\t\t? (\n\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t{attachment.error ?? strings.attachmentFailedLabel}\n\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t)\n\t\t\t\t\t: typeof attachment.size === 'number'\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t<FileSize value={attachment.size} size=\"xs\" className=\"shrink-0\" />\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: null;\n\n\t\tconst surface = cn(\n\t\t'comment-attachment-chip--component',\n\t\t\t\t'relative inline-flex min-w-0 max-w-[20rem] items-center gap-space-sm rounded-radius',\n\t\t\t\t'ring-1 ring-inset transition-colors',\n\t\t\t\tcompact ? 'px-control-xs' : 'px-control-sm',\n\t\t\t\trowBlockPaddingClasses.compact,\n\t\t\t\tisFailed\n\t\t\t\t\t\t? 'bg-destructive/[0.04] ring-destructive/30 hover:bg-destructive/[0.08]'\n\t\t\t\t\t\t: 'bg-foreground/[0.03] ring-border/60 hover:bg-foreground/[0.06]',\n\t\t\t\tclassName,\n\t\t);\n\n\t\tconst iconNode = isUploading ? (\n\t\t\t\t<Loader2\n\t\t\t\t\t\tclassName={cn('shrink-0 animate-spin text-muted-foreground', 'size-icon-md')}\n\t\t\t\t\t\taria-hidden\n\t\t\t\t/>\n\t\t) : (\n\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'shrink-0',\n\t\t\t\t\t\t\t\t'size-icon-md',\n\t\t\t\t\t\t\t\tisFailed ? 'text-destructive' : 'text-muted-foreground',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\taria-hidden\n\t\t\t\t/>\n\t\t);\n\n\t\tconst labelRow = (\n\t\t\t\t<span className=\"inline-flex min-w-0 items-baseline gap-space-sm\">\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tclassName={cn('truncate', isFailed && 'text-destructive')}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{meta}\n\t\t\t\t</span>\n\t\t);\n\n\t\tconst isInteractive = !!url && !isUploading && !isFailed;\n\n\t\treturn (\n\t\t\t\t<div className={surface}>\n\t\t\t\t\t\t{iconNode}\n\t\t\t\t\t\t{isInteractive ? (\n\t\t\t\t<TextLink\n\t\t\t\t\thref={url}\n\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\tunderline={false}\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\tclassName=\"inline-flex min-w-0 flex-1 items-baseline gap-space-sm hover:underline\"\n\t\t\t\t\t\t\t\t\t\taria-label={strings.attachmentDownloadLabel}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{labelRow}\n\t\t\t\t</TextLink>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\tlabelRow\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{isUploading && typeof attachment.progress === 'number' && (\n\t\t\t\t\t\t\t\t<div className=\"bg-primary/15 absolute bottom-0 left-2 right-2 h-px overflow-hidden rounded-full\">\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"bg-primary h-full transition-[width]\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: `${Math.min(100, Math.max(0, attachment.progress))}%`,\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</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{isFailed && onRetry && (\n\t\t\t\t\t\t\t\t<TextButton\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => onRetry(attachment.id)}\n\t\t\t\t\t\t\t\t\t\tclassName=\"shrink-0 text-destructive decoration-destructive/30 hover:decoration-destructive/60\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" weight=\"medium\" className=\"text-inherit\">{strings.attachmentRetryLabel}</Text>\n\t\t\t\t\t\t\t\t</TextButton>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{editable && onRemove && (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => onRemove(attachment.id)}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target, fieldAffordanceRecipes.focus, fieldAffordanceRecipes.toggle)}\n\t\t\t\t\t\t\t\t\t\taria-label={strings.attachmentRemoveLabel}\n\t\t\t\t\t\t\t\t\t\ttitle={strings.attachmentRemoveLabel}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t);\n};\n","/**\n * useAttachmentUpload — manages a list of in-flight + uploaded\n * `CommentAttachment`s for a comment composer.\n *\n * Pass the consumer-supplied `onUpload` callback directly via the\n * `attachments` prop on `<Comments>` (or `<CommentComposer>`). Aborts\n * in-flight uploads when an attachment is removed.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { defaultCommentsStrings, type CommentsStrings } from '../comments.strings';\n\nimport type {\n\tCommentAttachment,\n\tCommentsAttachmentsConfig,\n} from '../comments.types';\n\ninterface InFlightEntry {\n\tcontroller: AbortController;\n}\n\nconst defaultAttachmentUploadStrings = {\n\tattachmentTooLargeError: defaultCommentsStrings.attachmentTooLargeError,\n\tattachmentTooManyError: defaultCommentsStrings.attachmentTooManyError,\n\tattachmentFailedLabel: defaultCommentsStrings.attachmentFailedLabel,\n};\n\nexport interface UseAttachmentUploadOptions extends CommentsAttachmentsConfig {\n\t/** Initial attachments — useful when editing an existing comment. */\n\tinitialAttachments?: ReadonlyArray<CommentAttachment>;\n\t/** Fires when the list of uploaded attachments changes. */\n\tonValueChange?: (attachments: ReadonlyArray<CommentAttachment>) => void;\n\t/** Fires when a validation or upload error happens. */\n\tonError?: (error: string) => void;\n\t/** Validation and non-Error upload fallback copy; omitted keys use Comments defaults.\n\t * Error objects retain their caller-supplied message. */\n\tstrings?: StringsProp<Pick<CommentsStrings, 'attachmentTooLargeError' | 'attachmentTooManyError' | 'attachmentFailedLabel'>>;\n}\n\nexport interface UseAttachmentUploadReturn {\n\t/** All attachments — uploading + uploaded + failed. */\n\tattachments: ReadonlyArray<CommentAttachment>;\n\t/** Subset of attachments that finished uploading. Use this in the form payload. */\n\tuploadedAttachments: ReadonlyArray<CommentAttachment>;\n\t/** True while at least one upload is in flight. */\n\tisUploading: boolean;\n\t/** Add files. Validates against `maxSize` / `maxFiles` first. */\n\taddFiles: (files: ReadonlyArray<File> | FileList) => void;\n\t/** Remove an attachment by id (aborts in-flight uploads). */\n\tremoveAttachment: (id: string) => void;\n\t/** Retry a failed upload. */\n\tretryAttachment: (id: string) => void;\n\t/** Replace the list (used when editing or after submit). */\n\tsetAttachments: (attachments: ReadonlyArray<CommentAttachment>) => void;\n\t/** Clear the list and abort everything in flight. */\n\treset: () => void;\n}\n\nexport function useAttachmentUpload(\n\toptions: UseAttachmentUploadOptions = {},\n): UseAttachmentUploadReturn {\n\tconst {\n\t\tonUpload,\n\t\tmaxSize,\n\t\tmaxFiles,\n\t\t// `accept` is consumed by the surrounding `<input type=\"file\"\n\t\t// accept>` element, not here — destructuring is intentional\n\t\t// even though we don't reference it inside the hook.\n\t\tdisabled,\n\t\tinitialAttachments,\n\t\tonValueChange,\n\t\tonError,\n\t\tstrings: stringsProp,\n\t} = options;\n\tconst strings = useStrings(defaultAttachmentUploadStrings, stringsProp);\n\n\tconst [attachments, setAttachmentsState] = useState<CommentAttachment[]>(() =>\n\t\tinitialAttachments ? [...initialAttachments] : [],\n\t);\n\tconst inFlightRef = useRef<Map<string, InFlightEntry>>(new Map());\n\tconst fileCacheRef = useRef<Map<string, File>>(new Map());\n\tconst attachmentsRef = useRef(attachments);\n\t// Keep sequential picks and async updates current without calling consumers\n\t// from a React state updater (which StrictMode may evaluate more than once).\n\tconst commitAttachments = useCallback((next: ReadonlyArray<CommentAttachment>) => {\n\t\tconst list = [...next];\n\t\tattachmentsRef.current = list;\n\t\tsetAttachmentsState(list);\n\t}, []);\n\tconst onValueChangeRef = useRef(onValueChange);\n\tonValueChangeRef.current = onValueChange;\n\n\tconst updateAttachment = useCallback(\n\t\t(id: string, patch: Partial<CommentAttachment>) => {\n\t\t\tcommitAttachments(attachmentsRef.current.map((a) => (a.id === id ? { ...a, ...patch } : a)));\n\t\t},\n\t\t[commitAttachments],\n\t);\n\n\tconst setAttachments = useCallback(\n\t\t(next: ReadonlyArray<CommentAttachment>) => {\n\t\t\tcommitAttachments(next);\n\t\t},\n\t\t[commitAttachments],\n\t);\n\n\tconst beginUpload = useCallback(\n\t\t(id: string, file: File) => {\n\t\t\tif (!onUpload || !fileCacheRef.current.has(id)) return;\n\t\t\tconst controller = new AbortController();\n\t\t\tinFlightRef.current.set(id, { controller });\n\n\t\t\tupdateAttachment(id, {\n\t\t\t\tstatus: 'uploading',\n\t\t\t\tprogress: 0,\n\t\t\t\terror: undefined,\n\t\t\t});\n\n\t\t\tconst onProgress = (progress: number) => {\n\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\tupdateAttachment(id, { progress });\n\t\t\t};\n\n\t\t\tonUpload({ file, onProgress, signal: controller.signal })\n\t\t\t\t.then((uploaded) => {\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tinFlightRef.current.delete(id);\n\t\t\t\t\tupdateAttachment(id, {\n\t\t\t\t\t\t...uploaded,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tstatus: 'uploaded',\n\t\t\t\t\t\tprogress: 100,\n\t\t\t\t\t\terror: undefined,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tinFlightRef.current.delete(id);\n\t\t\t\t\tif (controller.signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terr instanceof Error ? err.message : strings.attachmentFailedLabel;\n\t\t\t\t\tupdateAttachment(id, {\n\t\t\t\t\t\tstatus: 'failed',\n\t\t\t\t\t\terror: message,\n\t\t\t\t\t});\n\t\t\t\t\tonError?.(message);\n\t\t\t\t});\n\t\t},\n\t\t[onError, onUpload, strings.attachmentFailedLabel, updateAttachment],\n\t);\n\n\tconst addFiles = useCallback(\n\t\t(filesInput: ReadonlyArray<File> | FileList) => {\n\t\t\tif (disabled || !onUpload) return;\n\t\t\tconst files = Array.from(filesInput);\n\t\t\tif (files.length === 0) return;\n\n\t\t\tconst next = [...attachmentsRef.current];\n\t\t\tconst pending: Array<{id: string; file: File}> = [];\n\t\t\tfor (const file of files) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof maxFiles === 'number' &&\n\t\t\t\t\tnext.length >= maxFiles\n\t\t\t\t) {\n\t\t\t\t\tonError?.(strings.attachmentTooManyError);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\ttypeof maxSize === 'number' &&\n\t\t\t\t\tfile.size > maxSize\n\t\t\t\t) {\n\t\t\t\t\tonError?.(strings.attachmentTooLargeError);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst id =\n\t\t\t\t\ttypeof crypto !== 'undefined' && 'randomUUID' in crypto\n\t\t\t\t\t\t? crypto.randomUUID()\n\t\t\t\t\t\t: `att-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n\n\t\t\t\tfileCacheRef.current.set(id, file);\n\n\t\t\t\tnext.push({\n\t\t\t\t\tid,\n\t\t\t\t\tname: file.name,\n\t\t\t\t\tsize: file.size,\n\t\t\t\t\tmimeType: file.type,\n\t\t\t\t\tstatus: 'uploading',\n\t\t\t\t\tprogress: 0,\n\t\t\t\t});\n\n\t\t\t\tpending.push({id, file});\n\t\t\t}\n\t\t\tcommitAttachments(next);\n\t\t\tfor (const {id, file} of pending) queueMicrotask(() => beginUpload(id, file));\n\t\t},\n\t\t[beginUpload, commitAttachments, disabled, maxFiles, maxSize, onError, onUpload, strings.attachmentTooLargeError, strings.attachmentTooManyError],\n\t);\n\n\tconst removeAttachment = useCallback((id: string) => {\n\t\tconst entry = inFlightRef.current.get(id);\n\t\tif (entry) {\n\t\t\tentry.controller.abort();\n\t\t\tinFlightRef.current.delete(id);\n\t\t}\n\t\tfileCacheRef.current.delete(id);\n\t\tcommitAttachments(attachmentsRef.current.filter((a) => a.id !== id));\n\t}, [commitAttachments]);\n\n\tconst retryAttachment = useCallback(\n\t\t(id: string) => {\n\t\t\tconst file = fileCacheRef.current.get(id);\n\t\t\tif (!file) return;\n\t\t\tbeginUpload(id, file);\n\t\t},\n\t\t[beginUpload],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tfor (const entry of inFlightRef.current.values()) {\n\t\t\tentry.controller.abort();\n\t\t}\n\t\tinFlightRef.current.clear();\n\t\tfileCacheRef.current.clear();\n\t\tcommitAttachments([]);\n\t}, [commitAttachments]);\n\n\tuseEffect(() => {\n\t\tonValueChangeRef.current?.(attachments);\n\t}, [attachments]);\n\n\tuseEffect(() => {\n\t\tconst inFlight = inFlightRef.current;\n\t\tconst cache = fileCacheRef.current;\n\t\treturn () => {\n\t\t\tfor (const entry of inFlight.values()) {\n\t\t\t\tentry.controller.abort();\n\t\t\t}\n\t\t\tcache.clear();\n\t\t};\n\t}, []);\n\n\tconst uploadedAttachments = useMemo(\n\t\t() => attachments.filter((a) => a.status === 'uploaded' || !a.status),\n\t\t[attachments],\n\t);\n\n\tconst isUploading = useMemo(\n\t\t() => attachments.some((a) => a.status === 'uploading'),\n\t\t[attachments],\n\t);\n\n\treturn {\n\t\tattachments,\n\t\tuploadedAttachments,\n\t\tisUploading,\n\t\taddFiles,\n\t\tremoveAttachment,\n\t\tretryAttachment,\n\t\tsetAttachments,\n\t\treset,\n\t};\n}\n","/**\n * CommentComposer — TipTap-backed rich text editor with inline reference\n * picker and attachment uploader. Default composer for `<Comments>`.\n *\n * Mention/reference handling is delegated to the shared\n * `features/mentions` module: `useMentions` drives picker state +\n * caret-trigger detection, `<MentionPicker>` renders the popover, and\n * `<MentionChip>` renders draft-list chips. The same primitives power\n * inline references in `features/activities`.\n */\nimport { AtSign, Loader2, Paperclip, X } from 'lucide-react';\nimport {\n\t\tforwardRef,\n\t\tuseEffect,\n\t\tuseImperativeHandle,\n\t\tuseMemo,\n\t\tuseRef,\n\t\tuseState,\n} from 'react';\nimport type { ReactNode } from 'react';\nimport type { ReactElement, RefAttributes } from 'react';\n\nimport { Button } from '../../../base/buttons';\nimport { Popover, PopoverTrigger } from '../../../base/popover';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport {\n\t\tRichTextEditor,\n\t\ttype RichTextEditorHandle,\n\t\ttype RichTextEditorToolbarItem,\n} from '../../rich-text-editor/rich-text-editor';\nimport {\n\t\tMentionInlineSuggestions,\n\t\tMentionPicker,\n\t\tparseMentionsFromHtml,\n\t\tuseMentions,\n} from '../../mentions';\nimport { useResolvedStrings } from '../comments-provider';\nimport { interpolateString } from '../../../../lib/strings';\nimport { rowBlockPaddingClasses } from '../../../../lib/row-recipes';\nimport { cn } from '../../../../lib/utils';\nimport { fieldAffordanceRecipes } from '../../../../lib/field-affordance-recipes';\nimport type {\n\t\tCommentComposerProps,\n\t\tCommentFormValues,\n} from '../comments.types';\nimport { CommentAttachmentChip } from './comment-attachment-chip';\nimport { useAttachmentUpload } from '../hooks/use-attachment-upload';\n\nexport interface CommentComposerHandle {\n\t\tfocus(): void;\n\t\tclear(): void;\n\t\t/** Imperatively set the draft body. */\n\t\tsetBody(html: string): void;\n}\n\nfunction hasMeaningfulContent(html: string): boolean {\n\t\tif (!html || typeof html !== 'string') return false;\n\t\tconst text = html.replace(/<[^>]*>/g, '').trim();\n\t\treturn text.length > 0;\n}\n\nconst CommentComposerBase = forwardRef<\n\t\tCommentComposerHandle,\n\t\tCommentComposerProps\n>(function CommentComposer(\n\t\t{\n\t\t\t\tcontext,\n\t\t\t\tcanComment = true,\n\t\t\t\tsubmitting = false,\n\t\t\t\terrors,\n\t\t\t\tresetKey = 0,\n\t\t\t\tonSubmit,\n\t\t\t\tonCancel,\n\t\t\t\teditingComment,\n\t\t\t\treplyingTo,\n\t\t\t\tstrings: stringsProp,\n\t\t\t\tresources: resourcesProp,\n\t\t\t\tonResourceSearch: onResourceSearchProp,\n\t\t\t\tattachments: attachmentsProp,\n\t\t\t\tmaxAttachments: maxAttachmentsProp,\n\t\t\t\tallowAttachments: allowAttachmentsProp,\n\t\t\t\tinitialValues,\n\t\t\t\tautoFocus = false,\n\t\t\t\tinlineSubmit = true,\n\t\t\t\tplaceholder,\n\t\t},\n\t\tref,\n) {\n\t\tconst strings = useResolvedStrings(stringsProp);\n\t\tconst resources = resourcesProp;\n\t\tconst onResourceSearch = onResourceSearchProp;\n\t\tconst allowAttachments = allowAttachmentsProp ?? true;\n\t\tconst maxAttachments =\n\t\t\t\tattachmentsProp?.maxFiles ??\n\t\t\t\tmaxAttachmentsProp ??\n\t\t\t\t5;\n\t\tconst attachmentsConfig = useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\t\t...attachmentsProp,\n\t\t\t\t\t\tmaxFiles: maxAttachments,\n\t\t\t\t\t\tdisabled: attachmentsProp?.disabled === true || !allowAttachments,\n\t\t\t\t}),\n\t\t\t\t[allowAttachments, attachmentsProp, maxAttachments],\n\t\t);\n\n\t\tconst editorRef = useRef<RichTextEditorHandle>(null);\n\t\tconst [body, setBody] = useState<string>(\n\t\t\t\t() => initialValues?.content ?? editingComment?.content ?? '',\n\t\t);\n\t\tconst [contentError, setContentError] = useState<string | null>(null);\n\t\tconst [attachmentError, setAttachmentError] = useState<string | null>(null);\n\n\t\t/**\n\t\t * Mentions state — picker + caret-trigger detection. The hook reads\n\t\t * the editor handle via the ref we pass; on suggestion select it\n\t\t * inserts the chip and replaces the trigger range automatically.\n\t\t */\n\t\tconst mentions = useMentions({\n\t\t\t\tresources,\n\t\t\t\tonResourceSearch,\n\t\t\t\teditorRef,\n\t\t\t\tinitialMentions:\n\t\t\t\t\t\tinitialValues?.references ?? editingComment?.references,\n\t\t});\n\n\t\tconst attachmentUpload = useAttachmentUpload({\n\t\t\t\t...attachmentsConfig,\n\t\t\t\tinitialAttachments: initialValues?.attachments ?? undefined,\n\t\t\t\tstrings,\n\t\t\t\tonError: setAttachmentError,\n\t\t});\n\t\tconst handleCancel = () => {\n\t\t\t\tattachmentUpload.reset();\n\t\t\t\tsetAttachmentError(null);\n\t\t\t\tonCancel?.();\n\t\t};\n\n\t\tuseImperativeHandle(\n\t\t\t\tref,\n\t\t\t\t() => ({\n\t\t\t\t\t\tfocus: () => editorRef.current?.focus(),\n\t\t\t\t\t\tclear: () => {\n\t\t\t\t\t\t\t\teditorRef.current?.clear();\n\t\t\t\t\t\t\t\tmentions.reset();\n\t\t\t\t\t\t\t\tattachmentUpload.reset();\n\t\t\t\t\t\t\t\tsetContentError(null);\n\t\t\t\t\t\t\t\tsetAttachmentError(null);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsetBody: (html) => {\n\t\t\t\t\t\t\t\teditorRef.current?.setHTML(html);\n\t\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\t[attachmentUpload, mentions],\n\t\t);\n\n\t\t// Reset on context change / resetKey bump\n\t\tuseEffect(() => {\n\t\t\t\teditorRef.current?.setHTML(initialValues?.content ?? '');\n\t\t\t\tmentions.setMentions(initialValues?.references ?? []);\n\t\t\t\tattachmentUpload.reset();\n\t\t\t\tattachmentUpload.setAttachments(initialValues?.attachments ?? []);\n\t\t\t\tsetContentError(null);\n\t\t\t\tsetAttachmentError(null);\n\t\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [context.id, context.type, resetKey]);\n\n\t\t// Sync editing comment payload\n\t\tuseEffect(() => {\n\t\t\t\tif (!editingComment) return;\n\t\t\t\teditorRef.current?.setHTML(editingComment.content ?? '');\n\t\t\t\tmentions.setMentions(editingComment.references ?? []);\n\t\t\t\tconst list = (editingComment.attachments ?? []).filter(\n\t\t\t\t\t\t(a): a is NonNullable<typeof a> => !!a,\n\t\t\t\t);\n\t\t\t\tattachmentUpload.reset();\n\t\t\t\tattachmentUpload.setAttachments(list);\n\t\t\t\tsetAttachmentError(null);\n\t\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [editingComment?.id]);\n\n\t\t// Surface server-side errors\n\t\tuseEffect(() => {\n\t\t\t\tif (errors?.content) {\n\t\t\t\t\t\tsetContentError(errors.content);\n\t\t\t\t}\n\t\t}, [errors]);\n\n\t\tconst handleSubmit = (event?: React.FormEvent) => {\n\t\t\t\tevent?.preventDefault();\n\t\t\t\tif (submitting || attachmentUpload.isUploading) return;\n\t\t\t\tconst html = editorRef.current?.getHTML() ?? body;\n\t\t\t\tif (!hasMeaningfulContent(html)) {\n\t\t\t\t\t\tsetContentError(strings.invalidContent);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetContentError(null);\n\n\t\t\t\tconst values: CommentFormValues = {\n\t\t\t\t\t\tcontent: html,\n\t\t\t\t\t\tcommentableId: context.id,\n\t\t\t\t\t\tcommentableType: context.type,\n\t\t\t\t\t\tmoduleKey: context.moduleKey,\n\t\t\t\t\t\tcontentType: 'html',\n\t\t\t\t\t\treferences: mentions.mentions,\n\t\t\t\t\t\tattachments: attachmentUpload.uploadedAttachments,\n\t\t\t\t\t\treplyToId: replyingTo?.commentId ?? initialValues?.replyToId,\n\t\t\t\t\t\teditingId: editingComment?.id,\n\t\t\t\t};\n\n\t\t\t\tonSubmit(values);\n\t\t};\n\n\t\tconst fileInputRef = useRef<HTMLInputElement>(null);\n\t\tconst handleAttachmentClick = () => fileInputRef.current?.click();\n\t\tconst handleFiles = (files: FileList | null) => {\n\t\t\t\tif (!files?.length) return;\n\t\t\t\tsetAttachmentError(null);\n\t\t\t\tattachmentUpload.addFiles(files);\n\t\t};\n\n\t\tconst hasAttachments = attachmentUpload.attachments.length > 0;\n\t\tconst isEditing = !!editingComment;\n\t\tconst isReplying = !isEditing && !!replyingTo;\n\n\t\tconst submitLabel = submitting\n\t\t\t\t? strings.composerSubmitting\n\t\t\t\t: isEditing\n\t\t\t\t\t? strings.composerSave\n\t\t\t\t\t: strings.composerSubmit;\n\n\t\tconst eyebrow: ReactNode = isEditing ? (\n\t\t\t\t<ComposerEyebrow\n\t\t\t\t\t\tlabel={strings.composerEditingEyebrow}\n\t\t\t\t\t\tcloseLabel={strings.composerCancel}\n\t\t\t\t\t\tonClose={onCancel ? handleCancel : undefined}\n\t\t\t\t/>\n\t\t) : isReplying ? (\n\t\t\t\t<ComposerEyebrow\n\t\t\t\t\t\tlabel={makeReplyEyebrow(\n\t\t\t\t\t\t\t\tstrings.composerReplyingEyebrow,\n\t\t\t\t\t\t\t\treplyingTo.authorName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tcloseLabel={strings.composerCancel}\n\t\t\t\t\t\tonClose={onCancel ? handleCancel : undefined}\n\t\t\t\t/>\n\t\t) : null;\n\n\t\tconst extraToolbarItems = useMemo<ReadonlyArray<RichTextEditorToolbarItem>>(() => {\n\t\t\t\tconst items: RichTextEditorToolbarItem[] = [];\n\t\t\t\tif (resources && Object.keys(resources).length > 0) {\n\t\t\t\t\t\titems.push({\n\t\t\t\t\t\t\t\tid: 'reference',\n\t\t\t\t\t\t\t\ticon: AtSign,\n\t\t\t\t\t\t\t\tlabel: strings.composerReferenceLabel,\n\t\t\t\t\t\t\t\tonClick: () => mentions.setPickerOpen(true),\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (attachmentsConfig?.onUpload && !attachmentsConfig.disabled) {\n\t\t\t\t\t\titems.push({\n\t\t\t\t\t\t\t\tid: 'attachment',\n\t\t\t\t\t\t\t\ticon: Paperclip,\n\t\t\t\t\t\t\t\tlabel: strings.composerAttachmentLabel,\n\t\t\t\t\t\t\t\tonClick: handleAttachmentClick,\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn items;\n\t\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [\n\t\t\t\tresources,\n\t\t\t\tattachmentsConfig?.onUpload,\n\t\t\t\tattachmentsConfig?.disabled,\n\t\t\t\tstrings.composerReferenceLabel,\n\t\t\t\tstrings.composerAttachmentLabel,\n\t\t]);\n\n\t\tif (!canComment) return null;\n\n\t\tconst submitButton = (\n\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={() => handleSubmit()}\n\t\t\t\t\t\tdisabled={submitting || attachmentUpload.isUploading}\n\t\t\t\t\t\ticon={submitting ? Loader2 : undefined}\n\t\t\t\t>\n\t\t\t\t\t\t{submitLabel}\n\t\t\t\t</Button>\n\t\t);\n\n\t\tconst cancelButton = (isEditing || isReplying || onCancel) ? (\n\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\tonClick={handleCancel}\n\t\t\t\t\t\tdisabled={submitting}\n\t\t\t\t>\n\t\t\t\t\t\t{strings.composerCancel}\n\t\t\t\t</Button>\n\t\t) : null;\n\n\t\t// Mentions live as inline `<span class=\"rsc-mention\" contenteditable=\"false\">`\n\t\t// chips inside the editor body — they're visible, dismissible (single\n\t\t// backspace deletes the whole span), and the HTML→mentions sync keeps\n\t\t// `mentions.mentions` aligned automatically. Rendering them again as a\n\t\t// chip-list below the editor was redundant and confusing.\n\n\t\tconst attachmentChips = hasAttachments ? (\n\t\t\t\t<Stack direction=\"horizontal\" wrap align=\"center\" gap=\"sm\">\n\t\t\t\t\t\t{attachmentUpload.attachments.map((attachment) => (\n\t\t\t\t\t\t\t\t<CommentAttachmentChip\n\t\t\t\t\t\t\t\t\t\tkey={attachment.id}\n\t\t\t\t\t\t\t\t\t\tattachment={attachment}\n\t\t\t\t\t\t\t\t\t\teditable\n\t\t\t\t\t\t\t\t\t\tonRemove={(id) => { setAttachmentError(null); attachmentUpload.removeAttachment(id); }}\n\t\t\t\t\t\t\t\t\t\tonRetry={(id) => { setAttachmentError(null); attachmentUpload.retryAttachment(id); }}\n\t\t\t\t\t\t\t\t\t\tstrings={stringsProp}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t) : null;\n\n\t\tconst footerSlot = hasAttachments ? attachmentChips : null;\n\n\t\tconst trailingSubmit =\n\t\t\t\tinlineSubmit !== false && !isEditing && !isReplying\n\t\t\t\t\t\t? submitButton\n\t\t\t\t\t\t: null;\n\t\tconst showFooterRow = inlineSubmit === false || isEditing || isReplying;\n\n\t\treturn (\n\t\t<Stack render={<form />} gap=\"md\" onSubmit={handleSubmit} className=\"comment-composer--component\">\n\t\t\t\t\t\t{eyebrow}\n\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tref={fileInputRef}\n\t\t\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\t\taccept={attachmentsConfig?.accept}\n\t\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\t\t\thandleFiles(e.target.files);\n\t\t\t\t\t\t\t\t\t\te.target.value = '';\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{/* Manual button-click flow: regular popover anchored to the\n\t\t\t\t\t\t\t\thidden trigger. The inline-trigger flow uses the panel\n\t\t\t\t\t\t\t\trendered below — no focus stealing while the user types. */}\n\t\t\t\t\t\t{!mentions.triggerActive && (\n\t\t\t\t\t\t\t\t<Popover open={mentions.pickerOpen} onOpenChange={mentions.setPickerOpen}>\n\t\t\t\t\t\t\t\t\t\t<PopoverTrigger\n\t\t\t\t\t\t\t\t\t\t\t\trender={\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=\"secondary\"\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\tclassName=\"sr-only\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttabIndex={-1}\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.composerReferenceLabel}\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}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<MentionPicker\n\t\t\t\t\t\t\t\t\t\t\t\topen={mentions.pickerOpen}\n\t\t\t\t\t\t\t\t\t\t\t\tactiveKind={mentions.activeKind}\n\t\t\t\t\t\t\t\t\t\t\t\tsetActiveKind={(kind) => { mentions.setActiveKind(kind); mentions.setManualKindOverride(true); }}\n\t\t\t\t\t\t\t\t\t\t\t\tkinds={mentions.kinds}\n\t\t\t\t\t\t\t\t\t\t\t\tresources={resources}\n\t\t\t\t\t\t\t\t\t\t\t\tquery={mentions.query}\n\t\t\t\t\t\t\t\t\t\t\t\tsetQuery={mentions.setQuery}\n\t\t\t\t\t\t\t\t\t\t\t\tsuggestions={mentions.suggestions}\n\t\t\t\t\t\t\t\t\t\t\t\tloading={mentions.isLoading}\n\t\t\t\t\t\t\t\t\t\t\t\tonSelect={mentions.pickSuggestion}\n\t\t\t\t\t\t\t\t\t\t\t\tstrings={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: strings.composerReferenceMenuTitle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchPlaceholder: strings.composerReferenceSearchPlaceholder,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tempty: strings.composerReferenceEmpty,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tloading: strings.composerReferenceLoading,\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</Popover>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<div className=\"comment-composer--editor relative\">\n\t\t\t\t\t\t\t\t<RichTextEditor\n\t\t\t\t\t\t\t\t\t\tref={editorRef}\n\t\t\t\t\t\t\t\t\t\tvalue={body}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(html) => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetBody(html);\n\t\t\t\t\t\t\t\t\t\t\t\t// Sync the draft's mentions list with what's\n\t\t\t\t\t\t\t\t\t\t\t\t// actually present in the HTML — when the user\n\t\t\t\t\t\t\t\t\t\t\t\t// backspaces a chip span out of the body, the\n\t\t\t\t\t\t\t\t\t\t\t\t// chip-list below shrinks too. We merge with\n\t\t\t\t\t\t\t\t\t\t\t\t// the previously-known list so consumer-supplied\n\t\t\t\t\t\t\t\t\t\t\t\t// `href` / `data` payloads survive parsing.\n\t\t\t\t\t\t\t\t\t\t\t\tconst parsed = parseMentionsFromHtml<string>(html);\n\t\t\t\t\t\t\t\t\t\t\t\tconst previous = mentions.mentions;\n\t\t\t\t\t\t\t\t\t\t\t\tconst previousIds = previous.map((m) => m.id).join('|');\n\t\t\t\t\t\t\t\t\t\t\t\tconst currentIds = parsed.map((m) => m.id).join('|');\n\t\t\t\t\t\t\t\t\t\t\t\tif (previousIds !== currentIds) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst byId = new Map(previous.map((m) => [m.id, m]));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst merged = parsed.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(p) => byId.get(p.id) ?? p,\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\tmentions.setMentions(merged);\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\tplaceholder={placeholder ?? strings.composerPlaceholder}\n\t\t\t\t\t\t\t\t\t\tstrings={{\n\t\t\t\t\t\t\t\t\t\t\t\teditorLabel: placeholder ?? strings.composerPlaceholder,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tminHeight=\"3rem\"\n\t\t\t\t\t\t\t\t\t\tautoFocus={autoFocus || isEditing || isReplying}\n\t\t\t\t\t\t\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\t\t\t\t\t\t\ttoolbarTrailing={trailingSubmit}\n\t\t\t\t\t\t\t\t\t\tfooterSlot={footerSlot}\n\t\t\t\t\t\t\t\t\t\tonCaretChange={mentions.handleCaretChange}\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t<MentionInlineSuggestions\n\t\t\t\t\t\t\t\t\t\topen={mentions.triggerActive && mentions.pickerOpen}\n\t\t\t\t\t\t\t\t\t\tactiveKind={mentions.activeKind}\n\t\t\t\t\t\t\t\t\t\tsetActiveKind={(kind) => { mentions.setActiveKind(kind); mentions.setManualKindOverride(true); }}\n\t\t\t\t\t\t\t\t\t\tkinds={mentions.kinds}\n\t\t\t\t\t\t\t\t\t\tresources={resources}\n\t\t\t\t\t\t\t\t\t\tquery={mentions.query}\n\t\t\t\t\t\t\t\t\t\tsuggestions={mentions.suggestions}\n\t\t\t\t\t\t\t\t\t\tsuggestionsByKind={mentions.suggestionsByKind}\n\t\t\t\t\t\t\t\t\t\tloading={mentions.isLoading}\n\t\t\t\t\t\t\t\t\t\tonSelect={mentions.pickSuggestion}\n\t\t\t\t\t\t\t\t\t\tstrings={{\n\t\t\t\t\t\t\t\t\t\t\t\ttitle: strings.composerReferenceMenuTitle,\n\t\t\t\t\t\t\t\t\t\t\t\tempty: strings.composerReferenceEmpty,\n\t\t\t\t\t\t\t\t\t\t\t\tloading: strings.composerReferenceLoading,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{attachmentError && (\n\t\t\t\t\t\t\t\t<Text role=\"alert\" size=\"xs\" type=\"error\" className=\"comment-composer--attachment-error\">\n\t\t\t\t\t\t\t\t\t\t{attachmentError}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{contentError && (\n\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"error\">\n\t\t\t\t\t\t\t\t\t\t{contentError}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{showFooterRow && (\n\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap=\"md\" className=\"comment-composer--footer-actions\">\n\t\t\t\t\t\t\t\t\t\t{cancelButton}\n\t\t\t\t\t\t\t\t\t\t{submitButton}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t</Stack>\n\t\t);\n});\n\n/** Preserve the consumer's resource-kind union through the forwarded-ref boundary. */\nexport const CommentComposer = CommentComposerBase as <\n\t\tTResource extends string = string,\n>(\n\t\tprops: CommentComposerProps<TResource> & RefAttributes<CommentComposerHandle>,\n) => ReactElement | null;\n\n/* ------------------------------------------------------------------ */\n/* ComposerEyebrow */\n/* ------------------------------------------------------------------ */\n\nfunction ComposerEyebrow({\n\t\tlabel,\n\t\tcloseLabel,\n\t\tonClose,\n}: {\n\t\tlabel: string;\n\t\tcloseLabel: string;\n\t\tonClose?: () => void;\n}) {\n\t\treturn (\n\t\t\t\t<div className={cn('comment-composer--eyebrow bg-muted/40 ring-border/60 flex min-w-0 items-center justify-between gap-space-sm rounded-radius px-row-x ring-1 ring-inset', rowBlockPaddingClasses.compact)}>\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t{onClose ? (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target, fieldAffordanceRecipes.focus, fieldAffordanceRecipes.toggle)}\n\t\t\t\t\t\t\t\t\t\taria-label={closeLabel}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t);\n}\n\n/** Helper export for templated reply eyebrow. */\nexport function makeReplyEyebrow(template: string, name?: string): string {\n\t\treturn interpolateString(template, { name }, { missing: 'empty' });\n}\n","/**\n * CommentEmpty — default empty state for the timeline. Replaceable via\n * the `emptySlot` prop on `<Comments>` / `<CommentTimeline>`.\n */\nimport { MessageCircle } from 'lucide-react';\nimport type { FC, ReactNode } from 'react';\n\nimport { EmptyState } from '../../../blocks/data-display';\nimport type { StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { useResolvedStrings } from '../comments-provider';\nimport type { CommentsStrings } from '../comments.strings';\n\nexport interface CommentEmptyProps {\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CommentsStrings>;\n\t/** Leading glyph. */\n\ticon?: ReactNode;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport const CommentEmpty: FC<CommentEmptyProps> = ({\n\tstrings: stringsProp,\n\ticon,\n\tclassName,\n}) => {\n\tconst strings = useResolvedStrings(stringsProp);\n\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={strings.empty}\n\t\t\tdescription={strings.emptyHint || false}\n\t\t\tmedia={icon ?? <MessageCircle className=\"size-icon\" aria-hidden=\"true\" />}\n\t\t\tmediaVariant=\"icon-soft\"\n\t\t\tpadding=\"md\"\n\t\t\tclassName={cn('comment-empty--component', className)}\n\t\t/>\n\t);\n};\n","import type { ReactNode } from 'react';\nimport { Fragment, createElement } from 'react';\n\nimport { Text } from '../../../typography';\nimport { sanitizeHtml } from '../../../../lib/sanitize-html';\nimport { contentTypographyClassName } from '../../../typography/content-typography';\n\nimport { RichText } from '../../../typography/rich-text';\nimport { MentionContent } from '../../mentions';\n\nimport type {\n\tCommentData,\n\tCommentUser,\n\tCommentsConfig,\n\tCommentsSlots,\n} from '../comments.types';\n\nexport interface CommentContentProps<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n> {\n\t/** The comment to render. */\n\tcomment: CommentData<TUser, TMeta, TResource>;\n\t/** Resource registry — passed through to `<MentionContent>`. */\n\tresources?: CommentsConfig<TUser, TMeta, TResource>['resources'];\n\t/** Replaces the default rendering of an inline reference. */\n\trenderReference?: CommentsSlots<\n\t\tTUser,\n\t\tTMeta,\n\t\tTResource\n\t>['renderReference'];\n\t/** Optional sanitizer override. The package safe allowlist is the default. */\n\tsanitizer?: (html: string) => string;\n}\n\nexport function CommentContent<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>(\n\tprops: CommentContentProps<TUser, TMeta, TResource>,\n): ReactNode {\n\tconst { comment, resources, renderReference, sanitizer } = props;\n\tconst contentType =\n\t\tcomment.contentType ??\n\t\t(comment as Record<string, unknown>).content_type ??\n\t\t'text';\n\n\tif (contentType === 'rich') {\n\t\tconst richContent = renderRichContent(comment.content);\n\t\treturn richContent ? (\n\t\t\t<div className=\"comment-content--component\">{richContent}</div>\n\t\t) : null;\n\t}\n\n\tif (contentType === 'html') {\n\t\treturn (\n\t\t\t<div className=\"comment-content--component\">\n\t\t\t\t<MentionContent<TResource>\n\t\t\t\t\thtml={comment.content ?? ''}\n\t\t\t\t\tmentions={comment.references}\n\t\t\t\t\tresources={resources}\n\t\t\t\t\trenderMention={renderReference}\n\t\t\t\t\tsanitizer={sanitizer}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst plainContent = decodeQuotedString(comment.content ?? '');\n\n\treturn (\n\t\t<Text className=\"comment-content--component whitespace-pre-line\">\n\t\t\t{plainContent}\n\t\t</Text>\n\t);\n}\n\n/* ------------------------------------------------------------------ */\n/* Rich-block renderer for Editor.js-style structured content */\n/* ------------------------------------------------------------------ */\n\nfunction renderRichContent(rawContent: string | null | undefined): ReactNode {\n\tif (!rawContent) return null;\n\n\ttry {\n\t\tconst parsed = JSON.parse(rawContent) as {\n\t\t\tblocks?: Array<{ id?: string; type: string; data?: Record<string, unknown> }>;\n\t\t};\n\n\t\tif (!parsed || !Array.isArray(parsed.blocks) || parsed.blocks.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<Text tag=\"div\" className={contentTypographyClassName}>\n\t\t\t\t{parsed.blocks.map((block, index) => (\n\t\t\t\t\t<Fragment key={block.id ?? `${block.type}-${index}`}>\n\t\t\t\t\t\t{renderRichBlock(block)}\n\t\t\t\t\t</Fragment>\n\t\t\t\t))}\n\t\t\t</Text>\n\t\t);\n\t} catch {\n\t\tconst decoded = decodeQuotedString(rawContent);\n\t\treturn (\n\t\t\t<Text className=\"whitespace-pre-line\">\n\t\t\t\t{decoded}\n\t\t\t</Text>\n\t\t);\n\t}\n}\n\nfunction renderRichBlock(block: { type: string; data?: Record<string, unknown> }): ReactNode {\n\tconst data = block.data ?? {};\n\n\tswitch (block.type) {\n\t\tcase 'paragraph': {\n\t\t\tconst raw = String(data.text ?? '').trim();\n\t\t\tif (!raw) return null;\n\t\t\tconst html = sanitizeHtml(raw);\n\t\t\treturn html ? <p dangerouslySetInnerHTML={{ __html: html }} /> : null;\n\t\t}\n\t\tcase 'header': {\n\t\t\tconst text = stripHtml(String(data.text ?? ''));\n\t\t\tconst level = Number(data.level ?? 3);\n\t\t\tif (!text) return null;\n\t\t\tconst safeLevel = Math.min(Math.max(level, 1), 6);\n\t\t\treturn createElement(\n\t\t\t\t`h${safeLevel}`,\n\t\t\t\tnull,\n\t\t\t\ttext,\n\t\t\t);\n\t\t}\n\t\tcase 'list': {\n\t\t\tconst items = Array.isArray(data.items) ? data.items : [];\n\t\t\tconst sanitizedItems = items\n\t\t\t\t.map((item) => stripHtml(String(item ?? '')))\n\t\t\t\t.filter((item) => item.length > 0);\n\n\t\t\tif (sanitizedItems.length === 0) return null;\n\n\t\t\tif (data.style === 'ordered') {\n\t\t\t\treturn (\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t{sanitizedItems.map((item, index) => (\n\t\t\t\t\t\t\t<li key={`${item}-${index}`}>\n\t\t\t\t\t\t\t\t<Text tag=\"span\">{item}</Text>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ol>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<ul>\n\t\t\t\t\t{sanitizedItems.map((item) => (\n\t\t\t\t\t\t<li key={item}>\n\t\t\t\t\t\t\t<Text tag=\"span\">{item}</Text>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t);\n\t\t}\n\t\tcase 'quote': {\n\t\t\tconst text = String(data.text ?? '').trim();\n\t\t\tif (!text) return null;\n\t\t\tconst caption = stripHtml(String(data.caption ?? ''));\n\t\t\treturn (\n\t\t\t\t<blockquote className=\"italic\">\n\t\t\t\t\t<RichText tag=\"div\" html={text} type=\"secondary\" />\n\t\t\t\t\t{caption.length > 0 && (\n\t\t\t\t\t\t<cite className=\"mt-1 block not-italic\">\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"opacity-80\">\n\t\t\t\t\t\t\t\t— {caption}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</cite>\n\t\t\t\t\t)}\n\t\t\t\t</blockquote>\n\t\t\t);\n\t\t}\n\t\tcase 'delimiter':\n\t\t\treturn (\n\t\t\t\t<hr\n\t\t\t\t\tclassName=\"border-dashed\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault: {\n\t\t\tconst text = stripHtml(String(data.text ?? ''));\n\t\t\tif (!text) return null;\n\t\t\treturn <p className=\"whitespace-pre-line\">{text}</p>;\n\t\t}\n\t}\n}\n\nfunction stripHtml(value: string): string {\n\treturn value.replace(/<[^>]*>/g, '').trim();\n}\n\nfunction decodeQuotedString(value: string | null | undefined): string {\n\tif (typeof value !== 'string') return '';\n\tconst trimmed = value.trim();\n\tif (trimmed === '') return '';\n\tif (trimmed.startsWith('{') || trimmed.startsWith('[')) return trimmed;\n\ttry {\n\t\tconst parsed = JSON.parse(trimmed);\n\t\tif (typeof parsed === 'string') return parsed;\n\t} catch {\n\t\t// ignore\n\t}\n\tif (trimmed.startsWith('\"') && trimmed.endsWith('\"')) {\n\t\treturn trimmed.slice(1, -1);\n\t}\n\treturn trimmed;\n}\n","import {\n\tCornerDownRight,\n\tPencil,\n\tPin,\n\tSmile,\n\tTrash2,\n} from 'lucide-react';\nimport type { FC } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport {\n\tAvatar,\n\tAvatarFallback,\n\tAvatarImage,\n} from '../../../base/avatar';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ConfirmDialog, useOverlayVisibility } from '../../overlays';\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from '../../../base/display/tooltip';\nimport { Number as NumberValue, RelativeTime } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport { fieldAffordanceRecipes } from '../../../../lib/field-affordance-recipes';\nimport { interpolateString } from '../../../../lib/strings';\nimport { defaultCommentsStrings } from '../comments.strings';\n\nimport {\n\tuseResolvedAccessors,\n\tuseResolvedStrings,\n} from '../comments-provider';\nimport type {\n\tCommentAttachment,\n\tCommentItemProps,\n\tCommentUser,\n} from '../comments.types';\nimport { CommentAttachmentChip } from './comment-attachment-chip';\nimport { CommentContent } from './comment-content';\n\nconst FALLBACK_INITIAL = '?';\n\nconst defaultGetMediaUrl = (m: CommentAttachment | null | undefined) => m?.url;\nconst defaultGetMediaName = (m: CommentAttachment | null | undefined) => m?.name;\nconst defaultGetStatusLabel = (s: string) =>\n\ts.charAt(0).toUpperCase() + s.slice(1).replace(/_/g, ' ');\n\nexport const CommentItem = memo(function CommentItem<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>({\n\tcomment,\n\tcanModerate,\n\tonDelete,\n\tonAttachmentRemove,\n\tonEdit,\n\tonPinToggle,\n\tonReact,\n\tonReply,\n\tallowReactions: allowReactionsProp,\n\tallowReplies: allowRepliesProp,\n\tsanitizer,\n\tstrings: stringsProp,\n\tgetMediaUrl,\n\tgetMediaName,\n\tgetStatusLabel,\n\tformatRelativeTime,\n\tresources,\n\trenderAttachment,\n\trenderReference,\n}: CommentItemProps<TUser, TMeta, TResource>) {\n\tconst strings = useResolvedStrings(stringsProp);\n\tconst allowReactions = allowReactionsProp ?? true;\n\tconst allowReplies = allowRepliesProp ?? true;\n\tconst accessors = useResolvedAccessors({\n\t\tgetMediaUrl,\n\t\tgetMediaName,\n\t\tgetStatusLabel,\n\t\tformatRelativeTime,\n\t});\n\n\tconst resolvedGetMediaUrl = accessors.getMediaUrl ?? defaultGetMediaUrl;\n\tconst resolvedGetMediaName = accessors.getMediaName ?? defaultGetMediaName;\n\tconst resolvedGetStatusLabel =\n\t\taccessors.getStatusLabel ?? defaultGetStatusLabel;\n\tconst resolvedFormatRelativeTime = accessors.formatRelativeTime;\n\n\tconst authorName = comment.user?.name ?? strings.fallbackAuthor;\n\tconst avatarUrl = comment.user?.avatar ?? undefined;\n\n\tconst fallbackInitial = useMemo(() => {\n\t\tif (!authorName) return FALLBACK_INITIAL;\n\t\tconst trimmed = authorName.trim();\n\t\treturn trimmed === ''\n\t\t\t? FALLBACK_INITIAL\n\t\t\t: trimmed.charAt(0).toUpperCase();\n\t}, [authorName]);\n\n\tconst tagList = useMemo(() => {\n\t\tif (Array.isArray(comment.tagsArray)) {\n\t\t\treturn comment.tagsArray.filter(\n\t\t\t\t(tag): tag is string => typeof tag === 'string',\n\t\t\t);\n\t\t}\n\t\tif (comment.tagsArray && typeof comment.tagsArray === 'object') {\n\t\t\treturn Object.values(comment.tagsArray).filter(\n\t\t\t\t(value): value is string => typeof value === 'string',\n\t\t\t);\n\t\t}\n\t\treturn [];\n\t}, [comment.tagsArray]);\n\n\tconst attachments = useMemo(() => {\n\t\tconst list = comment.attachments ?? [];\n\t\treturn list.filter(\n\t\t\t(a): a is CommentAttachment => !!a && typeof a === 'object',\n\t\t);\n\t}, [comment.attachments]);\n\n\tconst reactions = allowReactions ? (comment.reactions ?? []) : [];\n\n\tconst isPinned = comment.isPinned === true;\n\tconst isEdited = comment.isEdited === true;\n\tconst showStatus = comment.status && comment.status !== 'active';\n\tconst statusLabel =\n\t\tshowStatus && comment.status ? resolvedGetStatusLabel(comment.status) : null;\n\tconst canDeleteComment =\n\t\tcomment.canDelete === true || canModerate === true;\n\tconst canEditComment = comment.canEdit === true || canModerate === true;\n\tconst canReply = !!allowReplies && !!onReply && !!comment.id;\n\tconst canReact = !!allowReactions && !!onReact && !!comment.id;\n\tconst canPin = !!onPinToggle && !!canModerate;\n\tconst canEdit = !!canEditComment && !!onEdit && !!comment.id;\n\tconst canDelete = !!canDeleteComment && !!onDelete && !!comment.id;\n\tconst hasActions = canReply || canReact || canPin || canEdit || canDelete;\n\n\tconst attachmentConfirm = useOverlayVisibility();\n\tconst [pendingAttachmentId, setPendingAttachmentId] = useState<string | null>(null);\n\tconst requestAttachmentRemoval = useCallback(\n\t\t(attachmentId: string) => {\n\t\t\tsetPendingAttachmentId(attachmentId);\n\t\t\tattachmentConfirm.show();\n\t\t},\n\t\t[attachmentConfirm],\n\t);\n\n\tconst hasAttachments = attachments.length > 0;\n\n\treturn (\n\t\t<article\n\t\t\tclassName={cn(\n\t\t\t\t'comment-item--component group relative overflow-hidden rounded-radius border transition-colors',\n\t\t\t\t'border-border/60 bg-card hover:bg-muted/30 p-surface',\n\t\t\t)}\n\t\t\tdata-comment-id={comment.id}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" align=\"start\" gap=\"lg\" className=\"min-w-0\">\n\t\t\t\t<Avatar className=\"mt-0.5 size-avatar shrink-0\">\n\t\t\t\t\t{!!avatarUrl && (\n\t\t\t\t\t\t<AvatarImage src={avatarUrl} alt={authorName} />\n\t\t\t\t\t)}\n\t\t\t\t\t<AvatarFallback className=\"bg-muted text-muted-foreground text-xs font-medium\">\n\t\t\t\t\t\t{fallbackInitial}\n\t\t\t\t\t</AvatarFallback>\n\t\t\t\t</Avatar>\n\n\t\t\t\t<div className=\"comment-item--body min-w-0 flex-1\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"md\" className=\"min-w-0\">\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\tclassName=\"truncate\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{authorName}\n\t\t\t\t\t\t</Text>\n\n\t\t\t\t\t\t{!!isPinned && (\n\t\t\t\t\t\t\t<TooltipProvider delayDuration={0}>\n\t\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t\t<TooltipTrigger render={<span className=\"inline-flex shrink-0 self-center\" />}>\n\t\t\t\t\t\t\t\t\t\t<Pin className=\"text-muted-foreground size-icon-sm\" aria-hidden />\n\t\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t\t<TooltipContent\n\t\t\t\t\t\t\t\t\t\tside=\"top\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-xs\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{strings.pinned}\n\t\t\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t</TooltipProvider>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<RelativeTime\n\t\t\t\t\t\t\tvalue={comment.createdAt}\n\t\t\t\t\t\t\tformatRelativeTime={resolvedFormatRelativeTime}\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\tclassName=\"shrink-0 tabular-nums\"\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{!!isEdited && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{strings.edited}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!!showStatus && !!statusLabel && (\n\t\t\t\t\t\t\t<Badge size=\"sm\" tone=\"secondary\" className=\"self-center\">\n\t\t\t\t\t\t\t\t{statusLabel}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t<div className=\"mt-1 leading-relaxed\">\n\t\t\t\t\t\t<CommentContent\n\t\t\t\t\t\t\tcomment={comment}\n\t\t\t\t\t\t\tresources={resources}\n\t\t\t\t\t\t\trenderReference={renderReference}\n\t\t\t\t\t\t\tsanitizer={sanitizer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{tagList.length > 0 && (\n\t\t\t\t\t\t<div className=\"mt-space-md flex flex-wrap gap-space-sm\">\n\t\t\t\t\t\t\t{tagList.map((tag) => (\n\t\t\t\t\t\t\t\t<Badge key={tag} size=\"sm\" tone=\"secondary\">\n\t\t\t\t\t\t\t\t\t{tag}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{hasAttachments && (\n\t\t\t\t\t\t<div className=\"mt-space-md flex flex-wrap gap-space-sm\">\n\t\t\t\t\t\t\t{attachments.map((attachment) => {\n\t\t\t\t\t\t\t\tif (renderAttachment) {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<div key={attachment.id ?? attachment.name}>\n\t\t\t\t\t\t\t\t\t\t\t{renderAttachment(attachment)}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * Posted attachments were read-only: no control, no\n\t\t\t\t\t\t\t\t * callback, nothing to remove. The control appears only\n\t\t\t\t\t\t\t\t * when the consumer supplies `onAttachmentRemove` and the\n\t\t\t\t\t\t\t\t * viewer may edit the comment, and detaching a published\n\t\t\t\t\t\t\t\t * file is irreversible, so it asks first.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tconst canRemoveAttachment =\n\t\t\t\t\t\t\t\t\t!!onAttachmentRemove && !!attachment.id && canDeleteComment;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<CommentAttachmentChip\n\t\t\t\t\t\t\t\t\t\tkey={attachment.id ?? attachment.name}\n\t\t\t\t\t\t\t\t\t\tattachment={attachment}\n\t\t\t\t\t\t\t\t\t\teditable={canRemoveAttachment}\n\t\t\t\t\t\t\t\t\t\tonRemove={\n\t\t\t\t\t\t\t\t\t\t\tcanRemoveAttachment\n\t\t\t\t\t\t\t\t\t\t\t\t? () => requestAttachmentRemoval(attachment.id as string)\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\taccessors={{\n\t\t\t\t\t\t\t\t\t\t\tgetMediaUrl: resolvedGetMediaUrl,\n\t\t\t\t\t\t\t\t\t\t\tgetMediaName: resolvedGetMediaName,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstrings={stringsProp}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{reactions.length > 0 && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" wrap align=\"center\" gap=\"xs\" className=\"mt-space-md\">\n\t\t\t\t\t\t\t{reactions.map((reaction) => (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={reaction.emoji}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\taria-label={interpolateString(strings.reactionLabel ?? defaultCommentsStrings.reactionLabel!, { emoji: reaction.emoji, count: reaction.count })}\n\t\t\t\t\t\t\t\t\taria-pressed={reaction.mine ?? false}\n\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\tonReact && comment.id\n\t\t\t\t\t\t\t\t\t\t\t? onReact(comment.id, reaction.emoji)\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttitle={reaction.users?.join(', ')}\n\t\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.inline, fieldAffordanceRecipes.focus)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\ttone={reaction.mine ? 'info' : 'secondary'}\n\t\t\t\t\t\t\t\t\t\tclassName=\"cursor-pointer transition-colors hover:opacity-90\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-inherit\"\n\t\t\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{reaction.emoji}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t<NumberValue\n\t\t\t\t\t\t\t\t\t\t\tvalue={reaction.count}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\t\t\t\talign=\"left\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"tabular-nums text-current\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\n\t\t\t\t{/* Actions own a separate row so they never reserve message width. */}\n\t\t\t\t{hasActions && <div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'comment-item--actions relative mt-space-md ms-auto w-fit max-w-full flex-wrap opacity-100 transition-opacity',\n\t\t\t\t\t\t'group-hover:opacity-100 focus-within:opacity-100',\n\t\t\t\t\t\t'inline-flex items-center gap-space-2xs',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{canReply && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\tcomment.id && onReply(comment.id)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttitle={strings.replyLabel}\n\t\t\t\t\t\t\taria-label={strings.replyLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CornerDownRight className=\"size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{canReact && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\tcomment.id && onReact(comment.id, '👍')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttitle={strings.addReactionLabel}\n\t\t\t\t\t\t\taria-label={strings.addReactionLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Smile className=\"size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{canPin && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tonClick={() => onPinToggle(comment)}\n\t\t\t\t\t\t\ttitle={isPinned ? strings.unpinLabel : strings.pinLabel}\n\t\t\t\t\t\t\taria-label={isPinned ? strings.unpinLabel : strings.pinLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Pin\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'size-icon-md',\n\t\t\t\t\t\t\t\t\tisPinned && 'text-foreground',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{canEdit && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\ttitle={strings.editLabel}\n\t\t\t\t\t\t\taria-label={strings.editLabel}\n\t\t\t\t\t\t\tonClick={() => onEdit(comment)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Pencil className=\"size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{canDelete && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tclassName=\"hover:bg-destructive/10 hover:text-destructive\"\n\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\tonDelete(comment.id as string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttitle={strings.deleteLabel}\n\t\t\t\t\t\t\t\taria-label={strings.deleteLabel}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Trash2 className=\"size-icon-md\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t</div>}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t\t{!!onAttachmentRemove && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\t{...attachmentConfirm.overlayProps}\n\t\t\t\t\tdestructive\n\t\t\t\t\ttitle={strings.confirmRemoveAttachmentTitle}\n\t\t\t\t\tdescription={strings.confirmRemoveAttachmentDescription}\n\t\t\t\t\tstrings={{ confirm: strings.attachmentRemoveLabel }}\n\t\t\t\t\tonConfirm={() => {\n\t\t\t\t\t\tif (pendingAttachmentId && comment.id) {\n\t\t\t\t\t\t\tvoid onAttachmentRemove(comment.id as string, pendingAttachmentId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</article>\n\t);\n}) as <\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>(\n\tprops: CommentItemProps<TUser, TMeta, TResource>,\n) => ReturnType<FC>;\n","import type { FC } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport type { CommentTimelineProps, CommentUser } from '../comments.types';\nimport { CommentEmpty } from './comment-empty';\nimport { CommentItem } from './comment-item';\n\nexport const CommentTimeline = function CommentTimeline<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>({\n\tcomments,\n\tcanModerate,\n\tonDelete,\n\tonAttachmentRemove,\n\tonEdit,\n\tonPinToggle,\n\tonReact,\n\tonReply,\n\tallowReactions,\n\tallowReplies,\n\tsanitizer,\n\tstrings: stringsProp,\n\tgetMediaUrl,\n\tgetMediaName,\n\tgetStatusLabel,\n\tformatRelativeTime,\n\tresources,\n\trenderItem,\n\trenderAttachment,\n\trenderReference,\n\temptySlot,\n}: CommentTimelineProps<TUser, TMeta, TResource>) {\n\tif (!comments.length) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{emptySlot ?? <CommentEmpty strings={stringsProp} />}\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Stack gap=\"sm\" className=\"comment-timeline--component\">\n\t\t\t{comments.map((comment, index) => {\n\t\t\t\tconst defaultItem = (\n\t\t\t\t\t<CommentItem<TUser, TMeta, TResource>\n\t\t\t\t\t\tcomment={comment}\n\t\t\t\t\t\tcanModerate={canModerate}\n\t\t\t\t\t\tonDelete={onDelete}\n\t\t\t\t\t\tonAttachmentRemove={onAttachmentRemove}\n\t\t\t\t\t\tonEdit={onEdit}\n\t\t\t\t\t\tonPinToggle={onPinToggle}\n\t\t\t\t\t\tonReact={onReact}\n\t\t\t\t\t\tonReply={onReply}\n\t\t\t\t\t\tallowReactions={allowReactions}\n\t\t\t\t\t\tallowReplies={allowReplies}\n\t\t\t\t\t\tsanitizer={sanitizer}\n\t\t\t\t\t\tstrings={stringsProp}\n\t\t\t\t\t\tgetMediaUrl={getMediaUrl}\n\t\t\t\t\t\tgetMediaName={getMediaName}\n\t\t\t\t\t\tgetStatusLabel={getStatusLabel}\n\t\t\t\t\t\tformatRelativeTime={formatRelativeTime}\n\t\t\t\t\t\tresources={resources}\n\t\t\t\t\t\trenderAttachment={renderAttachment}\n\t\t\t\t\t\trenderReference={renderReference}\n\t\t\t\t\t/>\n\t\t\t\t);\n\n\t\t\t\tif (renderItem) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={comment.id ?? `comment-${index}`}>\n\t\t\t\t\t\t\t{renderItem({\n\t\t\t\t\t\t\t\tcomment,\n\t\t\t\t\t\t\t\tcanModerate: canModerate ?? false,\n\t\t\t\t\t\t\t\tonDelete,\n\t\t\t\t\t\t\t\tonAttachmentRemove,\n\t\t\t\t\t\t\t\tonEdit,\n\t\t\t\t\t\t\t\tdefaultItem,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<div key={comment.id ?? `comment-${index}`}>\n\t\t\t\t\t\t{defaultItem}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Stack>\n\t);\n} as <\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>(\n\tprops: CommentTimelineProps<TUser, TMeta, TResource>,\n) => ReturnType<FC>;\n","/**\n * Comments — top-level entry for the Comments feature.\n *\n * Composes the composer + timeline + empty state behind a single API.\n * Generic in `<TUser, TMeta, TResource>` so consumers can type their\n * domain (user shape, custom meta payload, resource-kind union).\n *\n * Per-mount wiring (callbacks, resources, accessors) flows as direct\n * props. Library-wide display defaults (composer position, etc.) come\n * from `<UIProvider>` — see `@/lib/ui-provider`. Slots, render-props,\n * and the headless `useComments()` hook cover the composability\n * spectrum.\n *\n * Wrap the feature in `Card` at the call site when card chrome is desired.\n */\nimport { useCallback, useState } from 'react';\n\nimport { Stack } from '../../base/structure';\nimport { ConfirmDialog, useOverlayVisibility } from '../overlays';\nimport { Text } from '../../typography';\nimport { useCommentsConfig as useCommentsUIDefaults } from '../../../lib/ui-provider';\n\nimport { useResolvedStrings } from './comments-provider';\nimport type { CommentUser, CommentsProps } from './comments.types';\nimport { useComments } from './hooks/use-comments';\nimport { CommentComposer } from './partials/comment-composer';\nimport { CommentEmpty } from './partials/comment-empty';\nimport { CommentTimeline } from './partials/comment-timeline';\n\nimport { cn } from '../../../lib/utils';\nexport function Comments<\n\tTUser extends CommentUser = CommentUser,\n\tTMeta = unknown,\n\tTResource extends string = string,\n>(props: CommentsProps<TUser, TMeta, TResource>) {\n\tconst ui = useCommentsUIDefaults();\n\n\tconst composerPosition =\n\t\tprops.composerPosition ?? ui.composerPosition ?? 'top';\n\tconst maxAttachments = props.maxAttachments ?? 5;\n\tconst allowAttachments = props.allowAttachments ?? true;\n\tconst allowReactions = props.allowReactions ?? true;\n\tconst allowReplies = props.allowReplies ?? true;\n\n\tconst canComment = props.canComment ?? false;\n\tconst canModerate = props.canModerate ?? false;\n\n\tconst onPinToggle = props.onPinToggle;\n\n\tconst resources = props.resources;\n\tconst attachments = props.attachments;\n\n\tconst strings = useResolvedStrings(props.strings);\n\tconst title = props.title === undefined ? strings.title : props.title;\n\n\t/*\n\t * Deleting a comment is irreversible and the trigger is a bare icon button\n\t * next to Edit, so the confirmation is the component's job rather than every\n\t * consumer's. `confirmDelete={false}` opts out for apps that already confirm\n\t * upstream — otherwise they would ask twice.\n\t */\n\tconst confirmDelete = props.confirmDelete ?? true;\n\tconst deleteConfirm = useOverlayVisibility();\n\tconst [pendingDeleteId, setPendingDeleteId] = useState<string | null>(null);\n\n\tconst commentsState = useComments<TUser, TMeta, TResource>({\n\t\tonSubmit: props.onSubmit,\n\t\tonUpdate: props.onUpdate,\n\t\tonDelete: props.onDelete,\n\t\tonAfterMutate: props.onAfterMutate,\n\t\tonError: props.onError,\n\t});\n\n\tconst requestDelete = useCallback(\n\t\t(id: string) => {\n\t\t\tif (!confirmDelete) {\n\t\t\t\tvoid commentsState.deleteComment(id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetPendingDeleteId(id);\n\t\t\tdeleteConfirm.show();\n\t\t},\n\t\t[confirmDelete, commentsState, deleteConfirm],\n\t);\n\tconst startReply = commentsState.startReply;\n\tconst comments = props.comments;\n\tconst onReply = props.onReply;\n\n\tconst handleReply = useCallback(\n\t\t(commentId: string) => {\n\t\t\tconst comment = comments.find((item) => item.id === commentId);\n\t\t\tif (comment) startReply(comment);\n\t\t\tonReply?.(commentId);\n\t\t},\n\t\t[comments, onReply, startReply],\n\t);\n\n\tconst editingComment =\n\t\tcommentsState.composerMode.kind === 'editing'\n\t\t\t? commentsState.composerMode.comment\n\t\t\t: undefined;\n\tconst replyingTo =\n\t\tcommentsState.composerMode.kind === 'replying'\n\t\t\t? {\n\t\t\t\t\tcommentId: commentsState.composerMode.commentId,\n\t\t\t\t\tauthorName: commentsState.composerMode.authorName,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst composer = props.composerSlot ?? (\n\t\tcanComment ? (\n\t\t\t<CommentComposer<TResource>\n\t\t\t\tcontext={props.context}\n\t\t\t\tcanComment={canComment}\n\t\t\t\tsubmitting={commentsState.isSubmitting}\n\t\t\t\terrors={commentsState.formErrors}\n\t\t\t\tresetKey={commentsState.resetKey}\n\t\t\t\teditingComment={editingComment}\n\t\t\t\treplyingTo={replyingTo}\n\t\t\t\tonCancel={\n\t\t\t\t\tcommentsState.composerMode.kind === 'idle'\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: commentsState.cancelComposerMode\n\t\t\t\t}\n\t\t\t\tonSubmit={commentsState.submit}\n\t\t\t\tstrings={props.strings}\n\t\t\t\tresources={resources}\n\t\t\t\tonResourceSearch={props.onResourceSearch}\n\t\t\t\tattachments={attachments}\n\t\t\t\tmaxAttachments={maxAttachments}\n\t\t\t\tallowAttachments={allowAttachments}\n\t\t\t/>\n\t\t) : null\n\t);\n\n\tconst timeline = (\n\t\t<CommentTimeline<TUser, TMeta, TResource>\n\t\t\tcomments={props.comments}\n\t\t\tcanModerate={canModerate}\n\t\t\tonDelete={props.onDelete ? requestDelete : undefined}\n\t\t\tonAttachmentRemove={props.onAttachmentRemove}\n\t\t\tonEdit={\n\t\t\t\tcanComment && props.onUpdate\n\t\t\t\t\t? commentsState.startEdit\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonPinToggle={onPinToggle}\n\t\t\tonReact={props.onReact}\n\t\t\tonReply={canComment && allowReplies ? handleReply : undefined}\n\t\t\tallowReactions={allowReactions}\n\t\t\tallowReplies={allowReplies}\n\t\t\tsanitizer={props.sanitizer}\n\t\t\tstrings={props.strings}\n\t\t\tgetMediaUrl={props.getMediaUrl}\n\t\t\tgetMediaName={props.getMediaName}\n\t\t\tgetStatusLabel={props.getStatusLabel}\n\t\t\tformatRelativeTime={props.formatRelativeTime}\n\t\t\tresources={resources}\n\t\t\trenderItem={props.renderItem}\n\t\t\trenderAttachment={props.renderAttachment}\n\t\t\trenderReference={props.renderReference}\n\t\t\temptySlot={\n\t\t\t\tprops.emptySlot ?? <CommentEmpty strings={props.strings} />\n\t\t\t}\n\t\t/>\n\t);\n\n\tconst composerBlock = composer ? <div>{composer}</div> : null;\n\n\tconst inner = (\n\t\t<Stack gap=\"xl\" className=\"comments--body\">\n\t\t\t{props.headerSlot}\n\t\t\t{composerPosition === 'top' && composerBlock}\n\t\t\t{timeline}\n\t\t\t{composerPosition === 'bottom' && composerBlock}\n\t\t\t{props.footerSlot}\n\t\t</Stack>\n\t);\n\n\tif (props.bare) {\n\t\treturn inner;\n\t}\n\n\tconst ariaLabel = typeof title === 'string' ? title : undefined;\n\n\treturn (\n\t\t<Stack\n\t\t\trender={<section />}\n\t\t\tgap=\"lg\"\n\t\t\tdata-component=\"comments\"\n\t\t\tdata-slot=\"comments\"\n\t\t\tclassName={cn('comments--component', props.className)}\n\t\t\taria-label={ariaLabel}\n\t\t>\n\t\t\t{!!(title !== false && (title || strings.subtitle)) && (\n\t\t\t\t<Stack gap=\"normal\" className=\"comments--header\">\n\t\t\t\t\t{!!title && <Text weight=\"semibold\">{title}</Text>}\n\t\t\t\t\t{!!strings.subtitle && <Text type=\"secondary\">{strings.subtitle}</Text>}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t\t{inner}\n\t\t\t{!!(confirmDelete && props.onDelete) && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\t{...deleteConfirm.overlayProps}\n\t\t\t\t\tdestructive\n\t\t\t\t\ttitle={strings.confirmDeleteTitle}\n\t\t\t\t\tdescription={strings.confirmDeleteDescription}\n\t\t\t\t\tstrings={{ confirm: strings.confirmDeleteLabel }}\n\t\t\t\t\tonAsyncConfirm={async () => {\n\t\t\t\t\t\tif (pendingDeleteId) await commentsState.deleteComment(pendingDeleteId);\n\t\t\t\t\t}}\n\t\t\t\t\tonError={props.onError}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,IAAa2C,IAA0C;CACtD,OAAO;CACP,UAAU;CACV,OAAO;CACP,WAAW;CAEX,qBAAqB;CACrB,gBAAgB;CAChB,oBAAoB;CACpB,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB;CACxB,yBAAyB;CAEzB,yBAAyB;C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,KAAiBrF,EAAM,aAC1B,kBAACzM,GAAD;IACC,GAAI+R,EAAc;IAClB,aAAA;IACA,OAAOzN,EAAQ;IACf,aAAaA,EAAQ;IACrB,SAAS,EAAE,SAASA,EAAQ,mBAAmB;IAC/C,gBAAgB,YAAY;KAC3B,AAAI0N,KAAiB,MAAME,EAAc,cAAcF,CAAe;IACvE;IACA,SAASvF,EAAM;GACf,CAAA;EAEI;;AAET"}
@@ -22,7 +22,7 @@ import type { DisclosureSurface } from '../../../lib/component-vocabulary';
22
22
  export type AccordionShellVariant = DisclosureSurface;
23
23
  export declare const ACCORDION_ROOT_VARIANT_CLASS: Record<AccordionShellVariant, string>;
24
24
  export declare const ACCORDION_ITEM_VARIANT_CLASS: Record<AccordionShellVariant, string>;
25
- export declare const ACCORDION_TRIGGER_BASE = "items-center gap-space-lg px-row-x py-row-y text-left hover:no-underline";
25
+ export declare const ACCORDION_TRIGGER_BASE = "items-center gap-space-lg px-row-x py-row-y text-start hover:no-underline";
26
26
  /**
27
27
  * Content-padding presets keyed off the leading-icon width. Use
28
28
  * `withMedallion` when the trigger renders a default `IconBadge`
@@ -30,7 +30,7 @@ export declare const ACCORDION_TRIGGER_BASE = "items-center gap-space-lg px-row-
30
30
  * consumer density.
31
31
  */
32
32
  export declare const ACCORDION_CONTENT_PADDING: {
33
- readonly withMedallion: "pl-[calc(var(--spacing-row-x)+var(--spacing-avatar)+var(--spacing-space-lg))] pr-row-x pt-0";
34
- readonly withInline: "pl-[calc(var(--spacing-row-x)+var(--spacing-icon-lg)+var(--spacing-space-lg))] pr-row-x pt-0";
33
+ readonly withMedallion: "ps-[calc(var(--row-x)*var(--space-scale)+var(--avatar)+0.75rem*var(--space-scale))] pe-row-x pt-0";
34
+ readonly withInline: "ps-[calc(var(--row-x)*var(--space-scale)+var(--icon)*1.25+0.75rem*var(--space-scale))] pe-row-x pt-0";
35
35
  readonly withoutIcon: "px-row-x pt-0";
36
36
  };
@@ -84,7 +84,7 @@ export interface ActionMenuProps {
84
84
  actions: readonly ActionMenuAction[];
85
85
  /** Trigger text. Omit for an icon-only trigger, and set `srText` instead. */
86
86
  label?: string;
87
- /** Trigger glyph. Defaults to the horizontal ellipsis. */
87
+ /** Trigger glyph. Defaults to the vertical ellipsis (`MoreVertical`). */
88
88
  icon?: ActionMenuIcon;
89
89
  /** Accessible name when the trigger shows no visible `label`. */
90
90
  srText?: string;
@@ -131,7 +131,12 @@ export interface ActionMenuProps {
131
131
  strings?: StringsProp<ActionMenuStrings>;
132
132
  }
133
133
  export interface ActionButtonsProps {
134
- /** Commands to render side by side rather than collapsed into a menu. */
134
+ /**
135
+ * Commands to render side by side rather than collapsed into a menu. Each
136
+ * resolves like `Button`: untoned actions are the default outline button and
137
+ * a `tone` without `buttonStyle` is solid, so mark the main command
138
+ * `tone: 'primary'`.
139
+ */
135
140
  actions: readonly ActionMenuAction[];
136
141
  /** Merged onto the button group. */
137
142
  className?: string;
@@ -3,8 +3,9 @@
3
3
  * configurable size, and an optional semantic `tone` for fallbacks (initials)
4
4
  * when the consumer hasn't passed `imageUrl`.
5
5
  *
6
- * Wraps the shadcn AvatarGroup primitive with library-default sizes and a
7
- * deterministic tone picker so fallbacks stay stable without raw hue utilities.
6
+ * Fallbacks are neutral by default: colour states meaning, so a person's
7
+ * initials are not tinted by a hash of their name. Pass `tone` per user when a
8
+ * fallback does carry meaning; numeric tones map onto the semantic token set.
8
9
  */
9
10
  import * as React from 'react';
10
11
  import { type ComponentScale } from '../../../lib/ui-provider';
@@ -14,10 +15,10 @@ export type StackedAvatarTone = SemanticTone;
14
15
  export interface StackedAvatarUser {
15
16
  /** Stable identity for this entry. */
16
17
  id?: string;
17
- /** Form field name, forwarded for native submits. */
18
+ /** The person's name; supplies the initials and the hover title. */
18
19
  name: string;
19
20
  imageUrl?: string;
20
- /** Optional semantic tone override for this user's fallback. Numeric values map to the token set. */
21
+ /** Semantic tone for this user's fallback. Defaults to `neutral`. Numeric values map to the token set. */
21
22
  tone?: StackedAvatarTone | number;
22
23
  }
23
24
  export interface StackedAvatarsProps {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type BadgeSize, type BadgeTone } from '../../../lib/ui-provider';
3
3
  export interface BadgeProps extends Omit<React.ComponentProps<'span'>, 'content'> {
4
- /** Semantic tone. Falls back to `UIProvider.badge.defaultTone`, then `primary`. */
4
+ /** Semantic tone. Falls back to `UIProvider.badge.defaultTone`, then `neutral`: an untoned badge carries no state. */
5
5
  tone?: BadgeTone;
6
6
  /** Display scale. Falls back to `UIProvider.density.defaultScale`. */
7
7
  size?: BadgeSize;
@@ -1,9 +1,9 @@
1
1
  /** Private Tailwind recipes; public props and DOM hooks remain owned by the component. */
2
2
  export declare const badgeRecipes: {
3
- readonly root: "inline-flex items-center justify-center shrink-0 self-center rounded-radius font-sans font-medium border border-transparent w-fit max-w-full whitespace-nowrap overflow-visible box-border align-middle";
4
- readonly sizeSm: "h-auto min-h-0 py-space-2xs px-control-xs gap-space-xs text-xs leading-none";
5
- readonly sizeMd: "h-auto min-h-0 py-space-2xs px-control-xs gap-space-xs text-xs leading-tight";
6
- readonly sizeLg: "h-auto min-h-0 py-space-xs px-control-sm gap-space-sm text-sm leading-tight";
3
+ readonly root: "inline-flex items-center justify-center shrink-0 h-fit rounded-radius font-sans font-medium border border-transparent w-fit max-w-full whitespace-nowrap overflow-visible box-border align-middle";
4
+ readonly sizeSm: "min-h-0 py-space-2xs px-control-xs gap-space-xs text-xs leading-none";
5
+ readonly sizeMd: "min-h-0 py-space-2xs px-control-xs gap-space-xs text-xs leading-tight";
6
+ readonly sizeLg: "min-h-0 py-space-xs px-control-sm gap-space-sm text-sm leading-tight";
7
7
  readonly isInline: "inline-flex align-baseline text-xs py-space-2xs px-control-xs leading-none";
8
8
  readonly isPending: "[&_.badge-dot]:bg-transparent [&_.badge-dot]:border-[1.5px] [&_.badge-dot]:border-current";
9
9
  readonly isPulse: "[&_.badge-dot]:animate-badge-pulse motion-reduce:[&_.badge-dot]:animate-none";
@@ -4,8 +4,15 @@ import { type ButtonSize, type ButtonStyle, type ButtonTone } from '../../../lib
4
4
  export type { ButtonSize, ButtonStyle, ButtonTone } from '../../../lib/ui-provider';
5
5
  export type IconPosition = 'left' | 'right';
6
6
  interface PresentationProps {
7
+ /** Semantic color. Omit for the neutral button (`UIProvider.button.defaultTone`, `secondary`); use `primary` for the one main command. */
7
8
  tone?: ButtonTone;
9
+ /** Emphasis. Defaults to `solid` when `tone` is set, otherwise to `UIProvider.button.defaultButtonStyle` (`outline`). */
8
10
  buttonStyle?: ButtonStyle;
11
+ /**
12
+ * Keep the label on one line and end it with an ellipsis instead of wrapping.
13
+ * Use where the button cannot grow, such as a joined group or a dense toolbar.
14
+ */
15
+ truncate?: boolean;
9
16
  size?: ButtonSize;
10
17
  iconOnly?: boolean;
11
18
  fullWidth?: boolean;
@@ -1,6 +1,6 @@
1
1
  /** Private Tailwind recipes; public props and DOM hooks remain owned by the component. */
2
2
  export declare const buttonGroupRecipes: {
3
- readonly root: "inline-flex items-stretch rounded-radius box-border data-[orientation=vertical]:flex-col [&[data-orientation=horizontal]>:not(:last-child)]:rounded-e-none [&[data-orientation=horizontal]>:not(:first-child)]:rounded-s-none [&[data-orientation=horizontal]>:not(:first-child)]:-ms-px [&[data-orientation=vertical]>:not(:last-child)]:rounded-b-none [&[data-orientation=vertical]>:not(:first-child)]:rounded-t-none [&[data-orientation=vertical]>:not(:first-child)]:-mt-px";
4
- readonly text: "inline-flex items-center px-control-sm py-0 bg-muted border border-border text-sm text-muted-foreground";
3
+ readonly root: "inline-flex items-stretch rounded-inner box-border data-[orientation=vertical]:flex-col [&[data-orientation=horizontal]>:not(:last-child)]:rounded-e-none [&[data-orientation=horizontal]>:not(:first-child)]:rounded-s-none [&[data-orientation=horizontal]>:not(:first-child)]:border-s-0 [&[data-orientation=vertical]>:not(:last-child)]:rounded-b-none [&[data-orientation=vertical]>:not(:first-child)]:rounded-t-none [&[data-orientation=vertical]>:not(:first-child)]:border-t-0";
4
+ readonly text: "inline-flex items-center rounded-inner px-control-sm py-0 bg-muted border border-foreground/15 text-sm text-muted-foreground";
5
5
  readonly separator: "bg-border w-px self-stretch";
6
6
  };
@@ -1,23 +1,14 @@
1
- /** Private Tailwind recipes; public props and DOM hooks remain owned by the component. */
1
+ /** Shared interaction states and loader anatomy; public variants own geometry. */
2
2
  export declare const buttonRecipes: {
3
- readonly root: "inline-flex items-center justify-center font-[inherit] font-medium leading-tight whitespace-nowrap no-underline select-none border border-transparent rounded-radius box-border align-middle outline-none cursor-pointer transition-[background-color,color,border-color,box-shadow] duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none";
4
- readonly isDisabled: "opacity-50 cursor-not-allowed pointer-events-none";
5
- readonly sizeSm: "h-action-sm min-h-0 px-control-sm gap-space-sm text-sm [&_.base-button-icon]:size-icon-sm";
6
- readonly sizeMd: "h-action min-h-0 px-control gap-space-md text-sm [&_.base-button-icon]:size-icon";
7
- readonly sizeLg: "h-action-lg min-h-0 px-control gap-space-lg text-sm [&_.base-button-icon]:size-icon-lg";
8
- readonly isIconOnly: "w-auto aspect-square p-0";
9
- readonly isFullWidth: "w-full";
3
+ readonly solidInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:brightness-95 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:brightness-90";
4
+ readonly neutralInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-accent [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-muted";
5
+ readonly secondaryInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-secondary [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-accent";
6
+ readonly primaryInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-primary/10 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-primary/20";
7
+ readonly destructiveInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-destructive/10 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-destructive/20";
8
+ readonly successInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-success/10 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-success/20";
9
+ readonly warningInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-warning/10 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-warning/20";
10
+ readonly infoInteractive: "[&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-info/10 [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-info/20";
10
11
  readonly isLoading: "cursor-wait";
11
- readonly styleSolid: "";
12
- readonly styleOutline: "";
13
- readonly styleGhost: "";
14
12
  readonly icon: "base-button-icon pointer-events-none shrink-0";
15
- readonly spinner: "animate-spin me-space-md";
16
- readonly toneNeutral: "data-[style=solid]:bg-foreground data-[style=solid]:text-background data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-border data-[style=outline]:text-foreground data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-muted data-[style=ghost]:bg-transparent data-[style=ghost]:text-foreground data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-muted";
17
- readonly tonePrimary: "data-[style=solid]:bg-primary data-[style=solid]:text-primary-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-primary data-[style=outline]:text-primary-accent data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-primary/10 data-[style=ghost]:bg-transparent data-[style=ghost]:text-primary-accent data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-primary/10";
18
- readonly toneSecondary: "data-[style=solid]:bg-secondary data-[style=solid]:text-secondary-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-border data-[style=outline]:text-foreground data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-secondary data-[style=ghost]:bg-transparent data-[style=ghost]:text-foreground data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-secondary";
19
- readonly toneDestructive: "data-[style=solid]:bg-destructive data-[style=solid]:text-destructive-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-destructive data-[style=outline]:text-destructive data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-destructive/10 data-[style=ghost]:bg-transparent data-[style=ghost]:text-destructive data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-destructive/10";
20
- readonly toneSuccess: "data-[style=solid]:bg-success data-[style=solid]:text-success-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-success data-[style=outline]:text-success data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-success/10 data-[style=ghost]:bg-transparent data-[style=ghost]:text-success data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-success/10";
21
- readonly toneWarning: "data-[style=solid]:bg-warning data-[style=solid]:text-warning-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-warning data-[style=outline]:text-warning-accent data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-warning/10 data-[style=ghost]:bg-transparent data-[style=ghost]:text-warning-accent data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-warning/10";
22
- readonly toneInfo: "data-[style=solid]:bg-info data-[style=solid]:text-info-foreground data-[style=solid]:[&:hover:not(:disabled):not([aria-disabled=true])]:brightness-95 data-[style=outline]:bg-transparent data-[style=outline]:border-info data-[style=outline]:text-info data-[style=outline]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-info/10 data-[style=ghost]:bg-transparent data-[style=ghost]:text-info data-[style=ghost]:[&:hover:not(:disabled):not([aria-disabled=true])]:bg-info/10";
13
+ readonly spinner: "animate-spin";
23
14
  };
@@ -4,5 +4,6 @@ export declare const buttonVariants: (props?: ({
4
4
  buttonStyle?: "outline" | "solid" | "ghost" | null | undefined;
5
5
  size?: "sm" | "md" | "lg" | null | undefined;
6
6
  iconOnly?: boolean | null | undefined;
7
+ truncate?: boolean | null | undefined;
7
8
  fullWidth?: boolean | null | undefined;
8
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -33,8 +33,10 @@ interface LoaderButtonContentProps {
33
33
  icon?: BaseButtonProps['icon'];
34
34
  iconPosition?: BaseButtonProps['iconPosition'];
35
35
  size?: ButtonSize;
36
+ /** Ends the label with an ellipsis instead of wrapping it. */
37
+ truncate?: boolean;
36
38
  children: React.ReactNode;
37
39
  }
38
- export declare function LoaderButtonContent({ isLoading, loadingText, icon: Icon, iconPosition, size: _size, children, }: LoaderButtonContentProps): React.JSX.Element;
40
+ export declare function LoaderButtonContent({ isLoading, loadingText, icon: Icon, iconPosition, size: _size, truncate, children, }: LoaderButtonContentProps): React.JSX.Element;
39
41
  declare const LoaderButton: React.ForwardRefExoticComponent<Omit<LoaderButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
40
42
  export { LoaderButton };
@@ -8,12 +8,12 @@ import * as React from 'react';
8
8
  import { type ComponentScale } from '../../../lib/ui-provider';
9
9
  export type TextButtonSize = ComponentScale;
10
10
  export type TextButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size'> & {
11
- /** Size preset. */
11
+ /** Size preset. `md` (default) matches body text; `sm` is the compact 13px role. Defaults to `UIProvider.density.defaultScale`. */
12
12
  size?: TextButtonSize;
13
13
  children: React.ReactNode;
14
14
  };
15
15
  export declare const TextButton: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & {
16
- /** Size preset. */
16
+ /** Size preset. `md` (default) matches body text; `sm` is the compact 13px role. Defaults to `UIProvider.density.defaultScale`. */
17
17
  size?: TextButtonSize;
18
18
  children: React.ReactNode;
19
19
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ import { type ForwardedRef, type RefCallback } from 'react';
2
+ /** Native disabling can drop focused busy actions to body; restore only an unclaimed focus. */
3
+ export declare function usePendingButtonFocus(pending: boolean, forwardedRef: ForwardedRef<HTMLElement>): RefCallback<HTMLElement>;
@@ -1,7 +1,14 @@
1
+ /** Explicit region insets; omitted padding preserves the compound's inline-only defaults. */
2
+ export declare const cardRegionPaddingClasses: {
3
+ readonly none: "p-0";
4
+ readonly sm: "p-surface-xs";
5
+ readonly md: "p-surface";
6
+ readonly lg: "p-surface-lg";
7
+ };
1
8
  /** Private Tailwind recipes; public props and DOM hooks remain owned by the component. */
2
9
  export declare const cardRecipes: {
3
- readonly root: "flex flex-col w-full rounded-radius box-border overflow-hidden py-surface gap-space-xl transition-[background-color,border-color,box-shadow] duration-150";
4
- readonly shell: "@container/card flex flex-col w-full rounded-radius box-border overflow-hidden py-surface gap-space-xl transition-[background-color,border-color,box-shadow] duration-150";
10
+ readonly root: "flex flex-col w-full font-sans rounded-radius box-border overflow-hidden py-surface gap-space-xl transition-[background-color,border-color,box-shadow] duration-150";
11
+ readonly shell: "@container/card flex flex-col w-full font-sans rounded-radius box-border overflow-hidden py-surface gap-space-xl transition-[background-color,border-color,box-shadow] duration-150";
5
12
  readonly surfaceCard: "bg-card border border-border shadow-sm text-card-foreground";
6
13
  readonly surfaceDefault: "bg-card border border-border shadow-sm text-card-foreground";
7
14
  readonly surfaceFlat: "bg-transparent border-0 shadow-none text-foreground";
@@ -9,9 +16,10 @@ export declare const cardRecipes: {
9
16
  readonly surfaceRaised: "bg-card border border-border shadow-md text-card-foreground";
10
17
  readonly surfaceSunken: "bg-muted border border-border text-foreground";
11
18
  readonly header: "flex flex-col gap-normal px-surface box-border";
12
- readonly headerRow: "flex-col @sm/card:flex-row items-start justify-between gap-space-lg pb-0";
13
- readonly headerRowSingle: "@sm/card:items-center";
14
- readonly headerLeading: "min-w-0 w-full @sm/card:w-auto flex-1";
19
+ readonly headerRow: "flex-row flex-wrap items-start justify-between gap-space-lg pb-0";
20
+ readonly headerRowSingle: "items-center";
21
+ readonly headerLeading: "min-w-0 max-w-full flex-1 basis-64";
22
+ readonly headerLeadingSingle: "basis-36";
15
23
  readonly headerTrailing: "flex max-w-full flex-wrap shrink-0 items-center gap-space-md";
16
24
  readonly headerDivider: "border-b border-border [&.border-b]:!pb-surface";
17
25
  readonly title: "min-w-0 leading-tight text-card-foreground";
@@ -8,14 +8,19 @@ import type { TextGap } from '../../structure';
8
8
  * applied here so the public DOM contract lives in one place.
9
9
  */
10
10
  import { type ComponentPropsWithRef, type ComponentPropsWithoutRef } from 'react';
11
- import type { CardTitleSize } from '../smart-card.types';
11
+ import type { CardTitleSize, SmartCardProps } from '../smart-card.types';
12
+ type CardRegionProps = ComponentPropsWithRef<'div'> & {
13
+ /** Full surface inset. Omit to retain the established inline-only inset. */
14
+ padding?: SmartCardProps['padding'];
15
+ };
12
16
  export declare function CardShell({ className, ...props }: ComponentPropsWithRef<'div'>): import("react").JSX.Element;
13
- export declare function CardHeader({ className, textGap, ...props }: ComponentPropsWithoutRef<'div'> & {
17
+ export declare function CardHeader({ className, textGap, padding, ...props }: CardRegionProps & {
14
18
  textGap?: TextGap;
15
19
  }): import("react").JSX.Element;
16
20
  export declare function CardTitle({ className, children, size: sizeProp, ...props }: ComponentPropsWithoutRef<'div'> & {
17
21
  size?: CardTitleSize;
18
22
  }): import("react").JSX.Element | null;
19
23
  export declare function CardDescription({ className, children, ...props }: ComponentPropsWithoutRef<'div'>): import("react").JSX.Element | null;
20
- export declare function CardContent({ className, ...props }: ComponentPropsWithoutRef<'div'>): import("react").JSX.Element;
21
- export declare function CardFooter({ className, ...props }: ComponentPropsWithoutRef<'div'>): import("react").JSX.Element;
24
+ export declare function CardContent({ className, padding, ...props }: CardRegionProps): import("react").JSX.Element;
25
+ export declare function CardFooter({ className, padding, ...props }: CardRegionProps): import("react").JSX.Element;
26
+ export {};
@@ -109,7 +109,7 @@ export interface SmartCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'c
109
109
  * With no body/alert, header and footer share one footer-owned divider.
110
110
  */
111
111
  headerDivider?: boolean;
112
- /** Render a `border-t` rule above the footer; adjacent header/footer regions share one rule. */
112
+ /** Footer rule inherits UIProvider.card.defaultFooterDivider; false suppresses it. Adjacent header/footer regions share one rule. */
113
113
  footerDivider?: boolean;
114
114
  /**
115
115
  * Make the card body collapsible. Pass `true` for default behavior
@@ -37,7 +37,9 @@ export interface CarouselProps extends ComponentPropsWithoutRef<'div'> {
37
37
  * ```
38
38
  *
39
39
  * Use `inside` to overlay the controls on the viewport and skip the gutter
40
- * entirely.
40
+ * entirely; they get an opaque background so slide content never shows
41
+ * through. `overlay` adds a shadow for media slides, and `inline` keeps
42
+ * the controls in document flow (see `CarouselNavigation`).
41
43
  */
42
44
  controlPlacement?: CarouselControlPlacement;
43
45
  /** Receives the carousel API so the consumer can drive it from outside. */