themelia-react-ui 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/MIGRATION.md +119 -0
  3. package/README.md +13 -6
  4. package/dist/{accordion-B9MHG0cT.js → accordion-0tQUZ20r.js} +7 -7
  5. package/dist/accordion-0tQUZ20r.js.map +1 -0
  6. package/dist/{action-menu-Dr8K-ghE.js → action-menu-C0gjzLyE.js} +7 -7
  7. package/dist/{action-menu-Dr8K-ghE.js.map → action-menu-C0gjzLyE.js.map} +1 -1
  8. package/dist/{ai-artifact-C58tQcBy.js → ai-artifact-CGGpQryR.js} +172 -157
  9. package/dist/ai-artifact-CGGpQryR.js.map +1 -0
  10. package/dist/{app-shell-B_IuNWOo.js → app-shell-EHuuRDGy.js} +5 -5
  11. package/dist/{app-shell-B_IuNWOo.js.map → app-shell-EHuuRDGy.js.map} +1 -1
  12. package/dist/{attachment-Dg_69lPS.js → attachment-BCpA4e7i.js} +8 -8
  13. package/dist/{attachment-Dg_69lPS.js.map → attachment-BCpA4e7i.js.map} +1 -1
  14. package/dist/{auth-DTkkshS8.js → auth-B0girIk_.js} +15 -15
  15. package/dist/auth-B0girIk_.js.map +1 -0
  16. package/dist/{avatar-CeZaFmNH.js → avatar-B9Jnp-T-.js} +3 -3
  17. package/dist/{avatar-CeZaFmNH.js.map → avatar-B9Jnp-T-.js.map} +1 -1
  18. package/dist/{badge-xIiV_E7f.js → badge-wWauMgAt.js} +3 -3
  19. package/dist/{badge-xIiV_E7f.js.map → badge-wWauMgAt.js.map} +1 -1
  20. package/dist/base/accordion.js +1 -1
  21. package/dist/base/action-menu.js +1 -1
  22. package/dist/base/attachment.js +1 -1
  23. package/dist/base/avatar.js +1 -1
  24. package/dist/base/badge.js +1 -1
  25. package/dist/base/batch-action-bar.js +1 -1
  26. package/dist/base/buttons.js +1 -1
  27. package/dist/base/cards.js +2 -2
  28. package/dist/base/carousel.js +3 -3
  29. package/dist/base/cascader.js +1 -1
  30. package/dist/base/chart.js +1 -1
  31. package/dist/base/choice-inputs.js +2 -2
  32. package/dist/base/code-block.js +1 -1
  33. package/dist/base/combobox.js +1 -1
  34. package/dist/base/command.js +1 -1
  35. package/dist/base/copyable.js +1 -1
  36. package/dist/base/date-pickers.js +2 -2
  37. package/dist/base/display.js +6 -6
  38. package/dist/base/feedback.js +4 -4
  39. package/dist/base/forms-numeric.js +1 -1
  40. package/dist/base/forms.js +2 -2
  41. package/dist/base/inline-edit.js +8 -8
  42. package/dist/base/item.js +1 -1
  43. package/dist/base/media-gallery.js +1 -1
  44. package/dist/base/metadata-list.js +1 -1
  45. package/dist/base/navigation.js +6 -6
  46. package/dist/base/popover-menu.js +1 -1
  47. package/dist/base/popover.js +1 -1
  48. package/dist/base/qr-code.js +1 -1
  49. package/dist/base/repeaters.js +195 -188
  50. package/dist/base/repeaters.js.map +1 -1
  51. package/dist/base/sheet.js +1 -1
  52. package/dist/base/sidebar.js +2 -2
  53. package/dist/base/signature-pad.js +7 -7
  54. package/dist/base/skeleton.js +1 -1
  55. package/dist/base/spinner.js +5 -5
  56. package/dist/base/spinner.js.map +1 -1
  57. package/dist/base/structure.js +1 -1
  58. package/dist/base/table.js +1 -1
  59. package/dist/base/text-inputs.js +2 -2
  60. package/dist/base/toaster.js +1 -1
  61. package/dist/base/tree.js +1 -1
  62. package/dist/base/upload-queue.js +1 -1
  63. package/dist/base/upload.js +3 -3
  64. package/dist/base/value-inputs.js +1 -1
  65. package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-BoqWIIpV.js} +5 -5
  66. package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-BoqWIIpV.js.map} +1 -1
  67. package/dist/blocks/admin.js +17 -17
  68. package/dist/blocks/ai.js +227 -221
  69. package/dist/blocks/ai.js.map +1 -1
  70. package/dist/blocks/analytics/usage-card.js +1 -1
  71. package/dist/blocks/analytics.js +424 -449
  72. package/dist/blocks/analytics.js.map +1 -1
  73. package/dist/blocks/collaboration.js +1 -1
  74. package/dist/blocks/commerce/receipt.js +1 -1
  75. package/dist/blocks/commerce.js +225 -220
  76. package/dist/blocks/commerce.js.map +1 -1
  77. package/dist/blocks/data-display.js +2 -2
  78. package/dist/blocks/onboarding.js +5 -5
  79. package/dist/blocks/planning.js +11 -11
  80. package/dist/blocks/timelines.js +1 -1
  81. package/dist/{breadcrumbs-J-K2kl4c.js → breadcrumbs-Bp9Ke7kd.js} +4 -4
  82. package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
  83. package/dist/{button-S2Cubiiz.js → button-ChBovTx0.js} +2 -2
  84. package/dist/{button-S2Cubiiz.js.map → button-ChBovTx0.js.map} +1 -1
  85. package/dist/{buttons-BedGfygC.js → buttons-DeW0bQeK.js} +6 -6
  86. package/dist/{buttons-BedGfygC.js.map → buttons-DeW0bQeK.js.map} +1 -1
  87. package/dist/{cards-rNX1M4Xn.js → cards-CNXnmvV5.js} +8 -8
  88. package/dist/{cards-rNX1M4Xn.js.map → cards-CNXnmvV5.js.map} +1 -1
  89. package/dist/{cascader-B1MiqkBq.js → cascader-CrAl9zD5.js} +15 -15
  90. package/dist/{cascader-B1MiqkBq.js.map → cascader-CrAl9zD5.js.map} +1 -1
  91. package/dist/{chart-Darg_0Kv.js → chart-I7ROnsl8.js} +5 -5
  92. package/dist/{chart-Darg_0Kv.js.map → chart-I7ROnsl8.js.map} +1 -1
  93. package/dist/{checkbox-fflqmODR.js → checkbox-MoyHIAPs.js} +3 -3
  94. package/dist/{checkbox-fflqmODR.js.map → checkbox-MoyHIAPs.js.map} +1 -1
  95. package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-DHGtx0QV.js} +122 -110
  96. package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
  97. package/dist/{code-block-BzmM9Eig.js → code-block-BSJyq9e-.js} +7 -7
  98. package/dist/{code-block-BzmM9Eig.js.map → code-block-BSJyq9e-.js.map} +1 -1
  99. package/dist/{collapsible-BkAI_XD4.js → collapsible-BzJ91LUG.js} +3 -3
  100. package/dist/{collapsible-BkAI_XD4.js.map → collapsible-BzJ91LUG.js.map} +1 -1
  101. package/dist/{collection-content-gDh1v6O4.js → collection-content-CSnwtOTH.js} +3 -3
  102. package/dist/{collection-content-gDh1v6O4.js.map → collection-content-CSnwtOTH.js.map} +1 -1
  103. package/dist/{combobox-BEx0vJgF.js → combobox-Bcvu5J8O.js} +11 -10
  104. package/dist/{combobox-BEx0vJgF.js.map → combobox-Bcvu5J8O.js.map} +1 -1
  105. package/dist/combobox-C2JiSQPc.js +915 -0
  106. package/dist/combobox-C2JiSQPc.js.map +1 -0
  107. package/dist/{command-CrlPIL6m.js → command-9e52NPgK.js} +6 -6
  108. package/dist/{command-CrlPIL6m.js.map → command-9e52NPgK.js.map} +1 -1
  109. package/dist/{comments-Dmpp0YIc.js → comments-BsgErEqd.js} +33 -28
  110. package/dist/comments-BsgErEqd.js.map +1 -0
  111. package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
  112. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
  113. package/dist/components/base/combobox/combobox-field.d.ts +2 -2
  114. package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
  115. package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
  116. package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
  117. package/dist/components/base/feedback/state-display.d.ts +5 -1
  118. package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
  119. package/dist/components/base/forms/form-field.d.ts +7 -2
  120. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
  121. package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
  122. package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
  123. package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
  124. package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
  125. package/dist/components/base/navigation/language-switcher.d.ts +12 -4
  126. package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
  127. package/dist/components/base/sidebar/sidebar.d.ts +2 -0
  128. package/dist/components/base/upload/avatar-upload.d.ts +2 -1
  129. package/dist/components/base/upload/image-upload.d.ts +2 -1
  130. package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
  131. package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
  132. package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
  133. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +2 -0
  134. package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
  135. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  136. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
  137. package/dist/components/blocks/analytics/types.d.ts +2 -2
  138. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  139. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
  140. package/dist/components/features/activities/activities.types.d.ts +18 -11
  141. package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
  142. package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
  143. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  144. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
  145. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  146. package/dist/components/features/combobox/combobox.d.ts +2 -2
  147. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
  148. package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
  149. package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
  150. package/dist/components/features/combobox/types.d.ts +37 -8
  151. package/dist/components/features/email-composer/types.d.ts +3 -1
  152. package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
  153. package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
  154. package/dist/components/features/filters/filters.types.d.ts +3 -3
  155. package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
  156. package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
  157. package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
  158. package/dist/components/features/filters/utils/filter-utils.d.ts +5 -1
  159. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  160. package/dist/components/features/media-library/media-library.d.ts +1 -1
  161. package/dist/components/features/media-library/media-library.strings.d.ts +6 -0
  162. package/dist/components/features/media-library/media-library.types.d.ts +36 -8
  163. package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
  164. package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
  165. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
  166. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
  167. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
  168. package/dist/components/features/products/products.types.d.ts +2 -2
  169. package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
  170. package/dist/components/features/resource/resource.d.ts +1 -1
  171. package/dist/components/features/resource/resource.types.d.ts +2 -0
  172. package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
  173. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
  174. package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
  175. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
  176. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
  177. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
  178. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
  179. package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
  180. package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
  181. package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
  182. package/dist/components/features/table/data-table.d.ts +1 -1
  183. package/dist/components/features/table/index.d.ts +1 -0
  184. package/dist/components/features/table/table-body.d.ts +1 -1
  185. package/dist/components/features/table/table-helpers.d.ts +6 -3
  186. package/dist/components/features/table/table.strings.d.ts +3 -0
  187. package/dist/components/features/table/table.types.d.ts +17 -1
  188. package/dist/components/layout/header/header.types.d.ts +3 -2
  189. package/dist/components/layout/layout.types.d.ts +5 -3
  190. package/dist/components/layout/navigation/side-nav.d.ts +3 -2
  191. package/dist/components/layout/normalize-layout-path.d.ts +1 -0
  192. package/dist/components/layout/settings/settings.d.ts +1 -1
  193. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  194. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +3 -1
  195. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
  196. package/dist/components/layout/sidebar/sidebar.types.d.ts +2 -0
  197. package/dist/components/primitives/link.d.ts +3 -2
  198. package/dist/components/primitives/money.d.ts +1 -1
  199. package/dist/components/primitives/number.d.ts +1 -1
  200. package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
  201. package/dist/{containers-CIxwbZt5.js → containers-CSdc32h9.js} +2 -2
  202. package/dist/{containers-CIxwbZt5.js.map → containers-CSdc32h9.js.map} +1 -1
  203. package/dist/{copyable-DIznBqiT.js → copyable-3fdHfMR3.js} +4 -4
  204. package/dist/{copyable-DIznBqiT.js.map → copyable-3fdHfMR3.js.map} +1 -1
  205. package/dist/{data-display-BdgCAw8T.js → data-display-Cmj-xZYl.js} +16 -15
  206. package/dist/data-display-Cmj-xZYl.js.map +1 -0
  207. package/dist/{date-Cq8ioE4o.js → date-Br0FicVv.js} +4 -4
  208. package/dist/{date-Cq8ioE4o.js.map → date-Br0FicVv.js.map} +1 -1
  209. package/dist/date-picker-CyQlFYsP.js +1617 -0
  210. package/dist/date-picker-CyQlFYsP.js.map +1 -0
  211. package/dist/date-pickers-tj2MXmXd.js +185 -0
  212. package/dist/date-pickers-tj2MXmXd.js.map +1 -0
  213. package/dist/{display-KsZLw9Ov.js → display-CT_N2a3w.js} +7 -7
  214. package/dist/{display-KsZLw9Ov.js.map → display-CT_N2a3w.js.map} +1 -1
  215. package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-C08iIugv.js} +6 -6
  216. package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-C08iIugv.js.map} +1 -1
  217. package/dist/features/activities.js +283 -270
  218. package/dist/features/activities.js.map +1 -1
  219. package/dist/features/ai-chat.js +40 -27
  220. package/dist/features/ai-chat.js.map +1 -1
  221. package/dist/features/appointment-calendar.js +126 -126
  222. package/dist/features/appointment-calendar.js.map +1 -1
  223. package/dist/features/async-preview.js +9 -9
  224. package/dist/features/combobox.js +1 -1
  225. package/dist/features/comments.js +1 -1
  226. package/dist/features/data-view.js +10 -10
  227. package/dist/features/email-composer.js +24 -19
  228. package/dist/features/email-composer.js.map +1 -1
  229. package/dist/features/event-calendar.js +129 -125
  230. package/dist/features/event-calendar.js.map +1 -1
  231. package/dist/features/filters.js +2 -2
  232. package/dist/features/global-search.js +16 -20
  233. package/dist/features/global-search.js.map +1 -1
  234. package/dist/features/kanban.js +18 -28
  235. package/dist/features/kanban.js.map +1 -1
  236. package/dist/features/map/style.css +15 -0
  237. package/dist/features/map.js +331 -314
  238. package/dist/features/map.js.map +1 -1
  239. package/dist/features/media-library.js +1044 -866
  240. package/dist/features/media-library.js.map +1 -1
  241. package/dist/features/mentions.js +2 -2
  242. package/dist/features/overlays.js +1 -1
  243. package/dist/features/products.js +978 -964
  244. package/dist/features/products.js.map +1 -1
  245. package/dist/features/questionnaire.js +159 -152
  246. package/dist/features/questionnaire.js.map +1 -1
  247. package/dist/features/resource-assignment.js +8 -8
  248. package/dist/features/resource.js +74 -71
  249. package/dist/features/resource.js.map +1 -1
  250. package/dist/features/rich-text-editor.js +28 -19
  251. package/dist/features/rich-text-editor.js.map +1 -1
  252. package/dist/features/schema-form.js +297 -256
  253. package/dist/features/schema-form.js.map +1 -1
  254. package/dist/features/suggestions.js +57 -50
  255. package/dist/features/suggestions.js.map +1 -1
  256. package/dist/features/sync.js +3 -3
  257. package/dist/features/table.js +1 -1
  258. package/dist/features/theme-tweaker.js +400 -399
  259. package/dist/features/theme-tweaker.js.map +1 -1
  260. package/dist/feedback-Dzo1xtAU.js +246 -0
  261. package/dist/feedback-Dzo1xtAU.js.map +1 -0
  262. package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-D6H7tVJi.js} +2 -2
  263. package/dist/{field-affordance-recipes-DWcNcOjh.js.map → field-affordance-recipes-D6H7tVJi.js.map} +1 -1
  264. package/dist/field-control-attributes-B6i335wr.js +18 -0
  265. package/dist/field-control-attributes-B6i335wr.js.map +1 -0
  266. package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
  267. package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
  268. package/dist/{filters-DzgSJpMK.js → filters-Dl80yYtN.js} +763 -605
  269. package/dist/filters-Dl80yYtN.js.map +1 -0
  270. package/dist/form-field-CAPdwdnZ.js +74 -0
  271. package/dist/form-field-CAPdwdnZ.js.map +1 -0
  272. package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-CgcrUbLU.js} +2 -2
  273. package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-CgcrUbLU.js.map} +1 -1
  274. package/dist/{forms-C0RGnJTe.js → forms-B3W8CH7-.js} +8 -8
  275. package/dist/{forms-C0RGnJTe.js.map → forms-B3W8CH7-.js.map} +1 -1
  276. package/dist/forms-numeric-CwjQJe-O.js +991 -0
  277. package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
  278. package/dist/{header-DMMxG__r.js → header-ZIIsRKxP.js} +113 -113
  279. package/dist/header-ZIIsRKxP.js.map +1 -0
  280. package/dist/hooks/use-files.d.ts +2 -0
  281. package/dist/{hooks-DB6CJ4MR.js → hooks-BitHSh-Y.js} +3 -3
  282. package/dist/{hooks-DB6CJ4MR.js.map → hooks-BitHSh-Y.js.map} +1 -1
  283. package/dist/{icon-badge-DZF-YjQp.js → icon-badge-npxF1SLX.js} +2 -2
  284. package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-npxF1SLX.js.map} +1 -1
  285. package/dist/index.js +1 -1
  286. package/dist/{input-CvyDQlY7.js → input-7KAc7XQL.js} +6 -6
  287. package/dist/{input-CvyDQlY7.js.map → input-7KAc7XQL.js.map} +1 -1
  288. package/dist/{input-DMBwAZmr.js → input-DIREVYHs.js} +3 -3
  289. package/dist/{input-DMBwAZmr.js.map → input-DIREVYHs.js.map} +1 -1
  290. package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
  291. package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
  292. package/dist/{item-DjCcM18E.js → item-FfWnaYST.js} +99 -98
  293. package/dist/item-FfWnaYST.js.map +1 -0
  294. package/dist/layout/app-shell.js +1 -1
  295. package/dist/layout/auth.js +1 -1
  296. package/dist/layout/containers.js +1 -1
  297. package/dist/layout/header.js +1 -1
  298. package/dist/layout/hooks.js +1 -1
  299. package/dist/layout/navigation.js +1 -1
  300. package/dist/layout/page.js +1 -1
  301. package/dist/layout/settings.js +1 -1
  302. package/dist/layout/sidebar.js +2 -2
  303. package/dist/layout/workspace.js +1 -1
  304. package/dist/layout.js +11 -11
  305. package/dist/layout.types-E_GAApzO.js +30 -0
  306. package/dist/layout.types-E_GAApzO.js.map +1 -0
  307. package/dist/lib/field-control-attributes.d.ts +11 -0
  308. package/dist/lib/field-state-recipes.d.ts +2 -0
  309. package/dist/lib/format.d.ts +1 -0
  310. package/dist/lib/surface-recipes.d.ts +1 -1
  311. package/dist/lib/token-merge.generated.d.ts +6 -6
  312. package/dist/lib/utils.js +1 -1
  313. package/dist/{media-gallery-C-vChPmE.js → media-gallery-C81DAnKI.js} +6 -6
  314. package/dist/{media-gallery-C-vChPmE.js.map → media-gallery-C81DAnKI.js.map} +1 -1
  315. package/dist/{mentions-0_4nWuI-.js → mentions-qOnedSt4.js} +236 -167
  316. package/dist/mentions-qOnedSt4.js.map +1 -0
  317. package/dist/message-BJHnn43M.js +135 -0
  318. package/dist/message-BJHnn43M.js.map +1 -0
  319. package/dist/{metadata-list-C3MkU-Om.js → metadata-list-XkqZ_UXH.js} +11 -11
  320. package/dist/{metadata-list-C3MkU-Om.js.map → metadata-list-XkqZ_UXH.js.map} +1 -1
  321. package/dist/{navigation-DaRjthVk.js → navigation-BgtPJAhi.js} +119 -119
  322. package/dist/navigation-BgtPJAhi.js.map +1 -0
  323. package/dist/{navigation-C90-oQFq.js → navigation-Bt-v7rWP.js} +52 -46
  324. package/dist/navigation-Bt-v7rWP.js.map +1 -0
  325. package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
  326. package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
  327. package/dist/{number-CRU3kGuk.js → number-CYqBcrSj.js} +78 -86
  328. package/dist/number-CYqBcrSj.js.map +1 -0
  329. package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-BQCA2Zn2.js} +7 -7
  330. package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-BQCA2Zn2.js.map} +1 -1
  331. package/dist/{overlays-BSgCtM2v.js → overlays-CC8zI3Du.js} +264 -260
  332. package/dist/overlays-CC8zI3Du.js.map +1 -0
  333. package/dist/{page-DUUKDAjo.js → page-BoQ1VaFJ.js} +13 -13
  334. package/dist/{page-DUUKDAjo.js.map → page-BoQ1VaFJ.js.map} +1 -1
  335. package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-DIKspJfx.js} +4 -4
  336. package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-DIKspJfx.js.map} +1 -1
  337. package/dist/{pagination-CgCjElfu.js → pagination-Br8TdV9A.js} +4 -4
  338. package/dist/{pagination-CgCjElfu.js.map → pagination-Br8TdV9A.js.map} +1 -1
  339. package/dist/{popover-B85RenIl.js → popover-k8TdUcAt.js} +10 -10
  340. package/dist/popover-k8TdUcAt.js.map +1 -0
  341. package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-yn-o0kyA.js} +7 -7
  342. package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
  343. package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-DJ0AkUan.js} +2 -2
  344. package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-DJ0AkUan.js.map} +1 -1
  345. package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-DyUXqUtD.js} +2 -2
  346. package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-DyUXqUtD.js.map} +1 -1
  347. package/dist/{primitives-ByWgGUgt.js → primitives-BkkQjYl7.js} +22 -17
  348. package/dist/primitives-BkkQjYl7.js.map +1 -0
  349. package/dist/primitives.js +4 -4
  350. package/dist/{progress-BJhQP9WX.js → progress-DZFXXzPs.js} +4 -4
  351. package/dist/{progress-BJhQP9WX.js.map → progress-DZFXXzPs.js.map} +1 -1
  352. package/dist/{receipt-tOc7B3hw.js → receipt-C7LhOg7Q.js} +6 -6
  353. package/dist/{receipt-tOc7B3hw.js.map → receipt-C7LhOg7Q.js.map} +1 -1
  354. package/dist/rich-text-BnTzZjIo.js +45 -0
  355. package/dist/rich-text-BnTzZjIo.js.map +1 -0
  356. package/dist/rich-text-editor-CAurDwT5.js +1273 -0
  357. package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
  358. package/dist/{rich-text-editor-toolbar-laT3tpBT.js → rich-text-editor-toolbar-DbXig7Jk.js} +36 -35
  359. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
  360. package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
  361. package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
  362. package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
  363. package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
  364. package/dist/{scroll-area-B0dB2cBi.js → scroll-area-Bj6CRUif.js} +2 -2
  365. package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
  366. package/dist/{separator-Bb17I4pu.js → separator-B9ewiCGO.js} +2 -2
  367. package/dist/{separator-Bb17I4pu.js.map → separator-B9ewiCGO.js.map} +1 -1
  368. package/dist/{separator-Ct_WSWTJ.js → separator-DM6gs2vu.js} +3 -3
  369. package/dist/{separator-Ct_WSWTJ.js.map → separator-DM6gs2vu.js.map} +1 -1
  370. package/dist/services/actions.js +1 -1
  371. package/dist/settings-DZPHgpx4.js +155 -0
  372. package/dist/settings-DZPHgpx4.js.map +1 -0
  373. package/dist/{sheet-BGPERY55.js → sheet-C4DHsgLk.js} +6 -6
  374. package/dist/{sheet-BGPERY55.js.map → sheet-C4DHsgLk.js.map} +1 -1
  375. package/dist/sidebar-C8BnDwTH.js +709 -0
  376. package/dist/sidebar-C8BnDwTH.js.map +1 -0
  377. package/dist/{sidebar-f9gRWXIR.js → sidebar-CmD6a-HK.js} +16 -13
  378. package/dist/sidebar-CmD6a-HK.js.map +1 -0
  379. package/dist/{skeleton-BapcJd9C.js → skeleton-DDgdhmu9.js} +5 -5
  380. package/dist/{skeleton-BapcJd9C.js.map → skeleton-DDgdhmu9.js.map} +1 -1
  381. package/dist/{smart-card-CW0hjetE.js → smart-card-B6vLxqa_.js} +8 -8
  382. package/dist/{smart-card-CW0hjetE.js.map → smart-card-B6vLxqa_.js.map} +1 -1
  383. package/dist/{structure-DuxKl954.js → structure-DZJ2wbAU.js} +2 -2
  384. package/dist/{structure-DuxKl954.js.map → structure-DZJ2wbAU.js.map} +1 -1
  385. package/dist/style.css +1 -1
  386. package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
  387. package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
  388. package/dist/{table-CFOWY9pQ.js → table-CBonSdTp.js} +534 -486
  389. package/dist/table-CBonSdTp.js.map +1 -0
  390. package/dist/{table-B4TE7iOV.js → table-CXSPHH25.js} +75 -71
  391. package/dist/table-CXSPHH25.js.map +1 -0
  392. package/dist/{tabs-e7ko9S2o.js → tabs-C4Kr_hCr.js} +50 -49
  393. package/dist/tabs-C4Kr_hCr.js.map +1 -0
  394. package/dist/{text-inputs-B1culiSK.js → text-inputs-jdkS3ReG.js} +9 -9
  395. package/dist/{text-inputs-B1culiSK.js.map → text-inputs-jdkS3ReG.js.map} +1 -1
  396. package/dist/{timelines-D3Sl9ueq.js → timelines-CoPwdJP0.js} +10 -10
  397. package/dist/{timelines-D3Sl9ueq.js.map → timelines-CoPwdJP0.js.map} +1 -1
  398. package/dist/{tooltip-8wz5S_Zr.js → tooltip-31NwIpTo.js} +4 -4
  399. package/dist/{tooltip-8wz5S_Zr.js.map → tooltip-31NwIpTo.js.map} +1 -1
  400. package/dist/{tree-CzUJHnFs.js → tree-CeYVzdFE.js} +6 -6
  401. package/dist/{tree-CzUJHnFs.js.map → tree-CeYVzdFE.js.map} +1 -1
  402. package/dist/typography/rich-text.js +1 -1
  403. package/dist/{typography-BQnine1k.js → typography-C7-YMW1S.js} +2 -2
  404. package/dist/{typography-BQnine1k.js.map → typography-C7-YMW1S.js.map} +1 -1
  405. package/dist/typography.js +1 -1
  406. package/dist/{upload-BOW6U2tI.js → upload-Hdm5gObf.js} +303 -291
  407. package/dist/upload-Hdm5gObf.js.map +1 -0
  408. package/dist/{upload-queue-qUXn1ykN.js → upload-queue-D0sYPuqo.js} +8 -8
  409. package/dist/{upload-queue-qUXn1ykN.js.map → upload-queue-D0sYPuqo.js.map} +1 -1
  410. package/dist/{usage-card-BeSLY0i0.js → usage-card-9s8hLDfn.js} +9 -9
  411. package/dist/{usage-card-BeSLY0i0.js.map → usage-card-9s8hLDfn.js.map} +1 -1
  412. package/dist/{utils-B6kKb8jB.js → utils-DhuoqFy4.js} +31 -37
  413. package/dist/utils-DhuoqFy4.js.map +1 -0
  414. package/dist/{value-inputs-skdVB2zh.js → value-inputs-D3aPgq9H.js} +15 -15
  415. package/dist/{value-inputs-skdVB2zh.js.map → value-inputs-D3aPgq9H.js.map} +1 -1
  416. package/dist/{value-typography-uAmWUAL1.js → value-typography-uSzzG9Gf.js} +32 -26
  417. package/dist/value-typography-uSzzG9Gf.js.map +1 -0
  418. package/dist/{workspace-DHeHv0qw.js → workspace-CC8Vchiu.js} +12 -12
  419. package/dist/{workspace-DHeHv0qw.js.map → workspace-CC8Vchiu.js.map} +1 -1
  420. package/docs/consumer-skill/examples/edit.tsx +3 -3
  421. package/docs/consumer-skill/references/agents-md.md +19 -19
  422. package/docs/consumer-skill/references/analytics.md +15 -0
  423. package/docs/consumer-skill/references/component-contracts.json +14724 -13057
  424. package/docs/consumer-skill/references/composition.md +21 -4
  425. package/docs/consumer-skill/references/design-contract.md +1 -0
  426. package/docs/consumer-skill/references/installation.md +51 -8
  427. package/docs/consumer-skill/references/integration.md +24 -1
  428. package/docs/consumer-skill/references/public-api.json +172 -34
  429. package/docs/consumer-skill/references/review.md +51 -11
  430. package/docs/consumer-skill/references/rhf-workflows.md +72 -0
  431. package/docs/consumer-skill/references/theming.md +7 -2
  432. package/docs/consumer-skill/references/tokens.json +1 -1
  433. package/docs/consumer-skill/scripts/composition-policy.mjs +144 -30
  434. package/docs/consumer-skill/scripts/setup-skills.mjs +46 -9
  435. package/package.json +4 -2
  436. package/templates/admin-shell-template.tsx +1 -2
  437. package/templates/customers-template.tsx +18 -16
  438. package/dist/accordion-B9MHG0cT.js.map +0 -1
  439. package/dist/ai-artifact-C58tQcBy.js.map +0 -1
  440. package/dist/auth-DTkkshS8.js.map +0 -1
  441. package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
  442. package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
  443. package/dist/combobox-BwzoXFSG.js +0 -884
  444. package/dist/combobox-BwzoXFSG.js.map +0 -1
  445. package/dist/comments-Dmpp0YIc.js.map +0 -1
  446. package/dist/data-display-BdgCAw8T.js.map +0 -1
  447. package/dist/date-picker-RlIzKom_.js +0 -1551
  448. package/dist/date-picker-RlIzKom_.js.map +0 -1
  449. package/dist/date-pickers-DY-CpXS1.js +0 -179
  450. package/dist/date-pickers-DY-CpXS1.js.map +0 -1
  451. package/dist/feedback-Dm4izqFn.js +0 -240
  452. package/dist/feedback-Dm4izqFn.js.map +0 -1
  453. package/dist/filters-DzgSJpMK.js.map +0 -1
  454. package/dist/form-field-BriWAXyg.js +0 -63
  455. package/dist/form-field-BriWAXyg.js.map +0 -1
  456. package/dist/forms-numeric-DIhghX1Q.js +0 -910
  457. package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
  458. package/dist/header-DMMxG__r.js.map +0 -1
  459. package/dist/item-DjCcM18E.js.map +0 -1
  460. package/dist/layout.types-Cn7aUzJp.js +0 -20
  461. package/dist/layout.types-Cn7aUzJp.js.map +0 -1
  462. package/dist/mentions-0_4nWuI-.js.map +0 -1
  463. package/dist/message-g8p7eVtN.js +0 -128
  464. package/dist/message-g8p7eVtN.js.map +0 -1
  465. package/dist/navigation-C90-oQFq.js.map +0 -1
  466. package/dist/navigation-DaRjthVk.js.map +0 -1
  467. package/dist/number-CRU3kGuk.js.map +0 -1
  468. package/dist/overlays-BSgCtM2v.js.map +0 -1
  469. package/dist/popover-B85RenIl.js.map +0 -1
  470. package/dist/primitives-ByWgGUgt.js.map +0 -1
  471. package/dist/rich-text-Dth5E882.js +0 -78
  472. package/dist/rich-text-Dth5E882.js.map +0 -1
  473. package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
  474. package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
  475. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
  476. package/dist/safe-image-src-C6kQSMBZ.js +0 -17
  477. package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
  478. package/dist/sanitize-html-DsQmI48u.js.map +0 -1
  479. package/dist/settings-Bar5wiSo.js +0 -167
  480. package/dist/settings-Bar5wiSo.js.map +0 -1
  481. package/dist/sidebar-D-JYMMbY.js +0 -686
  482. package/dist/sidebar-D-JYMMbY.js.map +0 -1
  483. package/dist/sidebar-f9gRWXIR.js.map +0 -1
  484. package/dist/table-B4TE7iOV.js.map +0 -1
  485. package/dist/table-CFOWY9pQ.js.map +0 -1
  486. package/dist/tabs-e7ko9S2o.js.map +0 -1
  487. package/dist/upload-BOW6U2tI.js.map +0 -1
  488. package/dist/utils-B6kKb8jB.js.map +0 -1
  489. package/dist/value-typography-uAmWUAL1.js.map +0 -1
@@ -58,7 +58,7 @@ export function checkCopiedConsumerBundle({ packageRoot, destination }) {
58
58
 
59
59
  export function copyConsumerBundle({ packageRoot, destination }) {
60
60
  const files = consumerBundleFiles(packageRoot, destination);
61
- for (const name of [sharedSkillName, ...focusedSkills]) assert(!fs.existsSync(path.join(destination, name)), `Destination exists: ${name}. Preserve or move the previous skill before copying.`);
61
+ assertSkillDestination(destination);
62
62
  for (const { target, content } of files) {
63
63
  fs.mkdirSync(path.dirname(target), { recursive: true });
64
64
  fs.writeFileSync(target, content);
@@ -66,6 +66,22 @@ export function copyConsumerBundle({ packageRoot, destination }) {
66
66
  return checkCopiedConsumerBundle({ packageRoot, destination });
67
67
  }
68
68
 
69
+ function assertSkillDestination(destination) {
70
+ assertDirectoryPath(destination);
71
+ for (const name of [sharedSkillName, ...focusedSkills]) assert(!pathExists(path.join(destination, name)), `Destination exists: ${name}. Preserve or move the previous skill before copying.`);
72
+ }
73
+
74
+ function pathExists(target) {
75
+ try { fs.lstatSync(target); return true; }
76
+ catch (error) { if (error.code === 'ENOENT') return false; throw error; }
77
+ }
78
+
79
+ function assertDirectoryPath(destination) {
80
+ let directory = path.resolve(destination);
81
+ while (!pathExists(directory)) directory = path.dirname(directory);
82
+ assert(fs.statSync(directory).isDirectory(), `Destination is not a directory: ${directory}`);
83
+ }
84
+
69
85
  /** Agent definitions are single files copied into an agents directory, such as `.claude/agents`. */
70
86
  function agentBundleFiles(packageRoot, destination) {
71
87
  return agentFiles.map(name => {
@@ -85,27 +101,48 @@ export function checkCopiedAgents({ packageRoot, destination }) {
85
101
 
86
102
  export function copyAgents({ packageRoot, destination }) {
87
103
  const files = agentBundleFiles(packageRoot, destination);
88
- for (const { target } of files) assert(!fs.existsSync(target), `Destination exists: ${path.basename(target)}. Preserve or move the previous agent before copying.`);
104
+ assertAgentDestination(files);
89
105
  fs.mkdirSync(destination, { recursive: true });
90
106
  for (const { target, content } of files) fs.writeFileSync(target, content);
91
107
  return checkCopiedAgents({ packageRoot, destination });
92
108
  }
93
109
 
110
+ function assertAgentDestination(files) {
111
+ for (const { target } of files) {
112
+ assertDirectoryPath(path.dirname(target));
113
+ assert(!pathExists(target), `Destination exists: ${path.basename(target)}. Preserve or move the previous agent before copying.`);
114
+ }
115
+ }
116
+
94
117
  if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
95
118
  try {
96
- const usage = 'Usage: node setup-skills.mjs --copy|--check [--destination <agent-skills-directory>] [--agents <agent-definitions-directory>]';
119
+ const usage = 'Usage: node setup-skills.mjs --copy|--check [--destination <agent-skills-directory>] [--agents <markdown-agent-directory> | --no-agents]';
97
120
  const [mode, ...rest] = process.argv.slice(2);
98
121
  const options = {};
99
- for (let index = 0; index < rest.length; index += 2) {
100
- assert(['--destination', '--agents'].includes(rest[index]) && rest[index + 1] && !(rest[index] in options), usage);
101
- options[rest[index]] = path.resolve(rest[index + 1]);
122
+ for (let index = 0; index < rest.length; index++) {
123
+ const flag = rest[index];
124
+ assert(!(flag in options), usage);
125
+ if (flag === '--no-agents') { options[flag] = true; continue; }
126
+ assert(['--destination', '--agents'].includes(flag) && rest[index + 1] && !rest[index + 1].startsWith('--'), usage);
127
+ options[flag] = path.resolve(rest[++index]);
102
128
  }
103
- assert(['--copy', '--check'].includes(mode) && Object.keys(options).length, usage);
129
+ assert(['--copy', '--check'].includes(mode) && (options['--destination'] || options['--agents']) && !(options['--agents'] && options['--no-agents']), usage);
104
130
  const packageRoot = fileURLToPath(new URL('../../..', import.meta.url));
105
131
  const copy = mode === '--copy';
132
+ const destination = options['--destination'];
133
+ // `.agents/skills` is shared by Codex and Antigravity. It cannot identify
134
+ // a Markdown-agent host; Codex custom agents have a different TOML format.
135
+ const claudeSkills = destination && path.basename(destination) === 'skills' && path.basename(path.dirname(destination)) === '.claude';
136
+ const agentsDestination = options['--agents'] ?? (!options['--no-agents'] && claudeSkills ? path.join(path.dirname(destination), 'agents') : undefined);
137
+ // Validate every source and destination first: an agent conflict must not
138
+ // leave a newly copied skill bundle behind after reporting failure.
139
+ if (copy) {
140
+ if (destination) { consumerBundleFiles(packageRoot, destination); assertSkillDestination(destination); }
141
+ if (agentsDestination) assertAgentDestination(agentBundleFiles(packageRoot, agentsDestination));
142
+ }
106
143
  const result = {};
107
- if (options['--destination']) Object.assign(result, (copy ? copyConsumerBundle : checkCopiedConsumerBundle)({ packageRoot, destination: options['--destination'] }), { destination: options['--destination'] });
108
- if (options['--agents']) Object.assign(result, (copy ? copyAgents : checkCopiedAgents)({ packageRoot, destination: options['--agents'] }), { agentsDestination: options['--agents'] });
144
+ if (destination) Object.assign(result, (copy ? copyConsumerBundle : checkCopiedConsumerBundle)({ packageRoot, destination }), { destination });
145
+ if (agentsDestination) Object.assign(result, (copy ? copyAgents : checkCopiedAgents)({ packageRoot, destination: agentsDestination }), { agentsDestination });
109
146
  console.log(JSON.stringify(result, null, 2));
110
147
  } catch (error) { console.error(error.message); process.exitCode = 1; }
111
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themelia-react-ui",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "A composable React UI library for modern admin applications, built on Base UI and Tailwind with shadcn-compatible themes, shared design tokens, reusable layouts, blocks and workflows.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -29,6 +29,7 @@
29
29
  "dist",
30
30
  "README.md",
31
31
  "CHANGELOG.md",
32
+ "MIGRATION.md",
32
33
  "docs/consumer-skill",
33
34
  "docs/consumer-skills",
34
35
  "templates",
@@ -462,7 +463,7 @@
462
463
  "test:browser": "npm run build:preview && node scripts/run-browser.mjs",
463
464
  "check:package": "node scripts/check-package.mjs",
464
465
  "check": "npm run check:contract && npm run check:preview && npm run check:docs && npm run lint && npm run check:design-lint && npm run typecheck && npm test && npm run build && npm run check:skill && npm run check:maps && npm run check:package && npm run build:preview",
465
- "check:contract": "node --test scripts/test-runtime-ownership.mjs scripts/test-primitive-geometry.mjs scripts/test-source-entrypoints.mjs scripts/test-utility-vocabulary.mjs scripts/test-theme-contrast.mjs scripts/test-theme-modes.mjs && node scripts/check-contract.mjs",
466
+ "check:contract": "node --test scripts/test-runtime-ownership.mjs scripts/test-primitive-geometry.mjs scripts/test-source-entrypoints.mjs scripts/test-utility-vocabulary.mjs scripts/test-example-utilities.mjs scripts/test-theme-contrast.mjs scripts/test-theme-modes.mjs && node scripts/check-contract.mjs",
466
467
  "lint": "node scripts/generate-utilities.mjs && oxlint src/components src/lib src/preview docs/consumer-skill/examples templates --deny-warnings",
467
468
  "check:design-lint": "node scripts/generate-utilities.mjs && node scripts/check-design-lint.mjs",
468
469
  "check:preview": "node scripts/check-preview.mjs",
@@ -521,6 +522,7 @@
521
522
  "hast-util-sanitize": "^5.0.2",
522
523
  "hast-util-to-html": "^9.0.5",
523
524
  "react-resizable-panels": "^4.11.2",
525
+ "style-to-js": "^1.1.21",
524
526
  "tailwind-merge": "^3.5.0",
525
527
  "zustand": "^5.0.12"
526
528
  },
@@ -201,13 +201,12 @@ export interface AdminStarterShellProps {
201
201
  }
202
202
 
203
203
  function TemplateLink({ href, children, active, disabled, external, target, rel, onClick, onNavigate, ...props }: LayoutLinkRenderProps & { onNavigate: (id: AdminTemplateId) => void }) {
204
- const { setOpenMobile } = useSidebar();
205
204
  return <a {...props} href={disabled ? undefined : href} target={target ?? (external ? '_blank' : undefined)} rel={rel ?? (external ? 'noopener noreferrer' : undefined)} aria-current={active ? 'page' : undefined} aria-disabled={disabled || undefined} onClick={(event) => {
206
205
  onClick?.(event);
207
206
  if (disabled) { event.preventDefault(); return; }
208
207
  if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || external || (target && target !== '_self')) return;
209
208
  const route = Object.values(TEMPLATE_ROUTES).find((item) => item.url === href);
210
- if (route) { event.preventDefault(); onNavigate(route.id); setOpenMobile(false); }
209
+ if (route) { event.preventDefault(); onNavigate(route.id); }
211
210
  }}>{children}</a>;
212
211
  }
213
212
 
@@ -25,7 +25,7 @@ import { DataTable } from 'themelia-react-ui/features/table';
25
25
  import { TwoColumnLayout } from 'themelia-react-ui/layout/containers';
26
26
  import { Page } from 'themelia-react-ui/layout/page';
27
27
  import { Date as DateValue, Money, useMoneyFormatter } from 'themelia-react-ui/primitives';
28
- import { Text } from 'themelia-react-ui/typography';
28
+ import { Heading, Text } from 'themelia-react-ui/typography';
29
29
 
30
30
  interface CustomerOrderSummary {
31
31
  id: string;
@@ -282,19 +282,21 @@ export function CustomersAdminTemplate() {
282
282
  stickyAside
283
283
  main={
284
284
  <Stack gap="2xl">
285
- <Card
286
- title="Orders placed"
287
- titleSuffix={<Badge tone="neutral">{CUSTOMER_ORDERS.length}</Badge>}
288
- description="Orders placed across Online Store and SoHo POS."
289
- >
290
- <DataTable<CustomerOrderSummary>
291
- columns={orderColumns}
292
- data={CUSTOMER_ORDERS}
293
- surface="flat"
294
- enableSorting
295
- getRowId={(order) => order.id}
296
- />
297
- </Card>
285
+ <DataTable<CustomerOrderSummary>
286
+ columns={orderColumns}
287
+ data={CUSTOMER_ORDERS}
288
+ topbarContent={
289
+ <Stack gap="dense">
290
+ <Stack direction="horizontal" align="center" gap="md" wrap>
291
+ <Heading tag="h2" size="base" className="text-inherit">Orders placed</Heading>
292
+ <Badge tone="neutral">{CUSTOMER_ORDERS.length}</Badge>
293
+ </Stack>
294
+ <Text size="xs" type="secondary">Orders placed across Online Store and SoHo POS.</Text>
295
+ </Stack>
296
+ }
297
+ enableSorting
298
+ getRowId={(order) => order.id}
299
+ />
298
300
 
299
301
  <Card
300
302
  title="Timeline"
@@ -418,7 +420,7 @@ export function CustomersAdminTemplate() {
418
420
  >
419
421
  <form id={contactFormId} onSubmit={(event) => { event.preventDefault(); saveContact(); }}>
420
422
  <Stack gap="xl">
421
- <FormSection title="Contact information">
423
+ <FormSection title="Contact information" surface="flat" padding="none">
422
424
  <Grid columns={{ base: 1, sm: 2 }} gap="lg">
423
425
  <FormField label="Full name" required>
424
426
  <Input
@@ -477,7 +479,7 @@ export function CustomersAdminTemplate() {
477
479
  formId={creditFormId}
478
480
  >
479
481
  <form id={creditFormId} onSubmit={(event) => { event.preventDefault(); handleIssueStoreCredit(); }}>
480
- <FormSection title="Store credit adjustment">
482
+ <FormSection title="Store credit adjustment" surface="flat" padding="none">
481
483
  <FormField
482
484
  label="Credit amount (USD)"
483
485
  required
@@ -1 +0,0 @@
1
- {"version":3,"file":"accordion-B9MHG0cT.js","names":["Accordion","AccordionPrimitive","AccordionItem","AccordionTrigger","AccordionContent","Accordion","React","PrimitiveAccordion","PrimitiveAccordionItem","PrimitiveAccordionTrigger","PrimitiveAccordionContent","Accordion","Text","focusRecipes","motionRecipes","Stack","interactionRecipes","DisclosurePanelElement","IconBadge","React$1","Accordion$2","props","Accordion","cn","className","AccordionItem$1","AccordionTrigger$1","children","ChevronDownIcon","AccordionContent$1","panelProps","Accordion$1","AccordionItem","AccordionTrigger","isSimpleText","AccordionContent","ACCORDION_ROOT_VARIANT_CLASS","ACCORDION_ITEM_VARIANT_CLASS","ACCORDION_TRIGGER_BASE","ACCORDION_CONTENT_PADDING","defaultSmartAccordionStrings","SmartAccordion","forwardRef","stringsProp","strings","useStrings","hasIconColumn","iconStyle","items","item","contentPadding","triggerGridClass","onValueChange","next","variant","itemClassName","triggerClassName","SmartAccordionIcon","isSimpleContent","contentClassName","content","reserveSpace","icon"],"sources":["../src/components/ui/accordion.tsx","../src/components/base/accordion/accordion.tsx","../src/components/base/accordion/accordion-variants.ts","../src/components/base/accordion/accordion.strings.ts","../src/components/base/accordion/smart-accordion.tsx"],"sourcesContent":["import { DisclosurePanelElement } from './disclosure-panel';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { Accordion as AccordionPrimitive } from \"@base-ui/react/accordion\"\n\nimport { cn } from \"../../lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nfunction Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={cn(\"border-border accordion--component flex w-full flex-col border box-border overflow-hidden\", className)}\n {...props}\n />\n )\n}\n\nfunction AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn(\"border-border accordion-item--component border-b last:border-b-0\", className)}\n {...props}\n />\n )\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: AccordionPrimitive.Trigger.Props) {\n return (\n <AccordionPrimitive.Header className=\"accordion-header m-0\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\"accordion-trigger--component flex w-full items-center justify-between border-0 bg-transparent outline-none cursor-pointer box-border\", className)}\n {...props}\n >\n {children}\n <ChevronDownIcon data-slot=\"accordion-trigger-icon\" className={cn(\"accordion-trigger--icon size-icon text-muted-foreground shrink-0 [[aria-expanded=true]_&]:rotate-180\", motionRecipes.chevron)} />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n}\n\nfunction AccordionContent({\n className,\n children,\n render,\n ...props\n}: AccordionPrimitive.Panel.Props) {\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-content\"\n className={cn(\"accordion-content--component box-border text-inherit h-(--accordion-panel-height)\", motionRecipes.disclosure, className)}\n {...props}\n render={(panelProps, state) => <DisclosurePanelElement props={panelProps} state={state} render={render} heightVariable=\"--accordion-panel-height\" />}\n >\n {children}\n </AccordionPrimitive.Panel>\n )\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n\n","/**\n * Accordion — tokenized base wrapper around the shadcn/Base UI primitive.\n *\n * The internal primitive intentionally keeps shadcn's roomy defaults. This\n * public layer calibrates them for admin surfaces: radius tokens, 12px row\n * insets, density-aware vertical rhythm, quiet hover/focus treatments, and\n * matching trigger/content columns. Consumers retain the complete compound\n * API and can override any treatment with `className`.\n */\nimport * as React from 'react';\n\nimport {\n\tAccordion as PrimitiveAccordion,\n\tAccordionContent as PrimitiveAccordionContent,\n\tAccordionItem as PrimitiveAccordionItem,\n\tAccordionTrigger as PrimitiveAccordionTrigger,\n} from '../../ui/accordion';\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { focusRecipes } from '../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport type AccordionProps = React.ComponentPropsWithoutRef<typeof PrimitiveAccordion>;\nexport type AccordionItemProps = React.ComponentPropsWithoutRef<typeof PrimitiveAccordionItem>;\nexport type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof PrimitiveAccordionTrigger>;\nexport type AccordionContentProps = React.ComponentPropsWithoutRef<typeof PrimitiveAccordionContent>;\n\nconst Accordion = React.forwardRef<React.ElementRef<typeof PrimitiveAccordion>, AccordionProps>(\n\tfunction Accordion({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<PrimitiveAccordion\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'accordion--component rounded-surface border-border bg-card text-card-foreground',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAccordion.displayName = 'Accordion';\n\nconst AccordionItem = React.forwardRef<React.ElementRef<typeof PrimitiveAccordionItem>, AccordionItemProps>(\n\tfunction AccordionItem({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<PrimitiveAccordionItem\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'accordion-item--component border-border',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAccordionItem.displayName = 'AccordionItem';\n\nconst AccordionTrigger = React.forwardRef<React.ElementRef<typeof PrimitiveAccordionTrigger>, AccordionTriggerProps>(\n\tfunction AccordionTrigger({ className, children, ...props }, ref) {\n\t\tconst isSimpleText = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint';\n\t\treturn (\n\t\t\t<PrimitiveAccordionTrigger\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'accordion-trigger--component min-h-action items-center gap-space-lg px-row-x py-row-y',\n\t\t\t\t\t`text-start text-inherit text-sm font-medium transition-colors ${interactionRecipes.rowHover} hover:no-underline`,\n\t\t\t\t\t// Inset: the shell clips its rounded corners, so an outer ring was cut off.\n\t\t\t\t\t`focus-visible:z-10 ${focusRecipes.inset}`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{isSimpleText ? (\n\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Text>\n\t\t\t\t) : children}\n\t\t\t</PrimitiveAccordionTrigger>\n\t\t);\n\t},\n);\nAccordionTrigger.displayName = 'AccordionTrigger';\n\nconst AccordionContent = React.forwardRef<React.ElementRef<typeof PrimitiveAccordionContent>, AccordionContentProps>(\n\tfunction AccordionContent({ className, children, ...props }, ref) {\n\t\tconst isSimpleText = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint';\n\t\treturn (\n\t\t\t<PrimitiveAccordionContent\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'accordion-content--component px-row-x pb-space-lg text-sm',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{isSimpleText ? (\n\t\t\t\t\t<Text tag=\"div\" size=\"inherit\" lineHeight=\"relaxed\" className=\"text-inherit\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Text>\n\t\t\t\t) : children}\n\t\t\t</PrimitiveAccordionContent>\n\t\t);\n\t},\n);\nAccordionContent.displayName = 'AccordionContent';\n\nexport {\n\tAccordion,\n\tAccordionItem,\n\tAccordionTrigger,\n\tAccordionContent,\n};\n","/**\n * Shared accordion-shell variant classes — used by both `SmartAccordion`\n * and any blocks surface that builds on `base/accordion` directly\n * (e.g. `blocks/onboarding/checklist`).\n *\n * Exported because two consumers already keep it in lockstep; a third\n * one will copy this exact map. Centralising means a future tweak\n * (e.g. tighten `card` items to `border-border/70`) propagates.\n *\n * Padding tokens for trigger / content live alongside so the rhythm\n * is shared too:\n *\n * - Trigger: `gap-space-lg px-row-x py-row-y` — density-driven,\n * `<UIProvider>`\n * override flows through.\n * - Content padding accounts for the base panel's `px-row-x`.\n * Medallion and inline rows use shared media/spacing tokens, and\n * no-icon rows add no extra left padding so body copy tracks the\n * trigger text column instead of drifting.\n */\nimport type { DisclosureSurface } from '../../../lib/component-vocabulary';\n\nexport type AccordionShellVariant = DisclosureSurface;\n\n// Flat sits inside a surface that already owns the inset. It outdents by the row\n// inset, so trigger and panel text align with that surface's content edge while\n// the hover fill and focus edge keep their room in the surface gutter.\nexport const ACCORDION_ROOT_VARIANT_CLASS: Record<AccordionShellVariant, string> = {\n\tcard: 'gap-space-md border-0 rounded-none bg-transparent text-inherit overflow-visible',\n\tbordered: 'rounded-surface border border-border bg-card text-card-foreground overflow-hidden',\n\tflat: '-mx-row-x w-auto border-0 rounded-none bg-transparent text-inherit overflow-visible',\n};\n\n// The chevron and the revealed panel carry the open state; an open item is not\n// tinted into a box. Rounded items clip their trigger so its inset focus ring and\n// hover fill follow the item's corners.\nexport const ACCORDION_ITEM_VARIANT_CLASS: Record<AccordionShellVariant, string> = {\n\tcard: 'border border-border bg-card text-card-foreground rounded-surface overflow-hidden',\n\tbordered: 'bg-transparent not-last:border-b border-border',\n\tflat: 'border-0 not-last:border-b-0 bg-transparent rounded-surface overflow-hidden',\n};\n\nexport const ACCORDION_TRIGGER_BASE =\n\t'items-center gap-space-lg px-row-x py-row-y text-start hover:no-underline';\n\n/**\n * Content-padding presets keyed off the leading-icon width. Use\n * `withMedallion` when the trigger renders a default `IconBadge`\n * plus the shared row gap so body text aligns under the title at every\n * consumer density.\n */\nexport const ACCORDION_CONTENT_PADDING = {\n\t// Composed from root tokens so a scoped density/space boundary applies (the\n\t// `--spacing-*` aliases resolve once at :root inside arbitrary values).\n\twithMedallion: 'ps-[calc(var(--row-x)*var(--space-scale)+var(--avatar)+0.75rem*var(--space-scale))] pe-row-x pt-0',\n\twithInline: 'ps-[calc(var(--row-x)*var(--space-scale)+var(--icon)*1.25+0.75rem*var(--space-scale))] pe-row-x pt-0',\n\twithoutIcon: 'px-row-x pt-0',\n} as const;\n","/**\n * Strings for `SmartAccordion`. There aren't many — Radix handles the\n * trigger ARIA states automatically, so the only library-owned copy is\n * the optional landmark label on the wrapping nav region. Consumers\n * override per-item `title` / `badge` / `content` directly via\n * `SmartAccordionItem` props (the strings live in the data, not here).\n */\nexport interface SmartAccordionStrings {\n\t/**\n\t * Sets `aria-label` on the wrapping element so screen readers can name\n\t * the accordion region. Optional — when absent, no aria-label is set.\n\t */\n\tregionAriaLabel?: string;\n}\n\nexport const defaultSmartAccordionStrings: SmartAccordionStrings = {\n\tregionAriaLabel: undefined,\n};\n","/**\n * SmartAccordion — the canonical \"icon + title + optional badge + body\"\n * accordion pattern, with three visual variants for the surface chrome\n * (`card` | `bordered` | `flat`) and three icon framings (`medallion` |\n * `inline` | `none`).\n *\n * Composes the wrapped `base/accordion` parts (rule 2 — blocks-style\n * convenience built from re-exports, not the raw shadcn primitive).\n *\n * For richer rows (multi-line metadata, custom layouts), drop down to\n * the compound API:\n *\n * import { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n * from '.';\n */\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { IconBadge } from '../display/icon-badge';\nimport { Stack } from '../structure';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './accordion';\nimport {\n\tACCORDION_CONTENT_PADDING,\n\tACCORDION_ITEM_VARIANT_CLASS,\n\tACCORDION_ROOT_VARIANT_CLASS,\n\tACCORDION_TRIGGER_BASE,\n} from './accordion-variants';\nimport { defaultSmartAccordionStrings } from './accordion.strings';\nimport type {\n\tSmartAccordionIconStyle,\n\tSmartAccordionProps,\n} from './accordion.types';\n\n/**\n * Bounded accordion composition for repeated icon, title, description, badge,\n * and body sections. Use the compound Accordion parts when row structure or\n * per-item presentation differs.\n */\nexport const SmartAccordion = forwardRef<HTMLDivElement, SmartAccordionProps>(function SmartAccordion({\n\titems,\n\tmultiple = false,\n\tdefaultValue,\n\tvalue,\n\tonValueChange,\n\tvariant = 'bordered',\n\ticonStyle = 'inline',\n\tclassName,\n\titemClassName,\n\ttriggerClassName,\n\tcontentClassName,\n\tstrings: stringsProp,\n}, ref) {\n\tconst strings = useStrings(defaultSmartAccordionStrings, stringsProp);\n\tconst hasIconColumn = iconStyle !== 'none' && items.some((item) => item.icon != null);\n\tconst contentPadding =\n\t\t!hasIconColumn\n\t\t\t? ACCORDION_CONTENT_PADDING.withoutIcon\n\t\t\t: iconStyle === 'medallion'\n\t\t\t? ACCORDION_CONTENT_PADDING.withMedallion\n\t\t\t: ACCORDION_CONTENT_PADDING.withInline;\n\tconst triggerGridClass = !hasIconColumn\n\t\t? 'grid-cols-[minmax(0,1fr)]'\n\t\t: 'grid-cols-[auto_minmax(0,1fr)]';\n\treturn (\n\t\t<Accordion\n\t\t\tref={ref}\n\t\t\tmultiple={multiple}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tvalue={value}\n\t\t\tonValueChange={\n\t\t\t\tonValueChange\n\t\t\t\t\t? (next) => onValueChange(next as string[])\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\taria-label={strings.regionAriaLabel}\n\t\t\tdata-variant={variant}\n\t\t\tdata-icon-style={iconStyle}\n\t\t\tclassName={cn('smart-accordion--component', ACCORDION_ROOT_VARIANT_CLASS[variant], className)}\n\t\t>\n\t\t\t{items.map((item) => (\n\t\t\t\t<AccordionItem\n\t\t\t\t\tkey={item.value}\n\t\t\t\t\tvalue={item.value}\n\t\t\t\t\tclassName={cn('smart-accordion--item', ACCORDION_ITEM_VARIANT_CLASS[variant], itemClassName)}\n\t\t\t\t>\n\t\t\t\t\t<AccordionTrigger\n\t\t\t\t\t\tclassName={cn('smart-accordion--trigger', ACCORDION_TRIGGER_BASE, triggerClassName)}\n\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className={cn('grid min-w-0 flex-1 items-center gap-x-space-lg', triggerGridClass)}>\n\t\t\t\t\t\t\t<SmartAccordionIcon\n\t\t\t\t\t\t\t\ticonStyle={iconStyle}\n\t\t\t\t\t\t\t\ticon={item.icon}\n\t\t\t\t\t\t\t\treserveSpace={hasIconColumn}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Stack render={<span />} gap=\"dense\" className=\"smart-accordion--heading flex-1\">\n\t\t\t\t\t\t\t\t<span className=\"flex min-w-0 flex-wrap items-center gap-x-space-md gap-y-space-xs\">\n\t\t\t\t\t\t\t\t\t{isSimpleContent(item.title) ? (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"semibold\" className=\"smart-accordion--title min-w-0\">\n\t\t\t\t\t\t\t\t\t\t\t{item.title}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : item.title}\n\t\t\t\t\t\t\t\t\t{item.badge != null && (\n\t\t\t\t\t\t\t\t\t\t<span className=\"smart-accordion--badge inline-flex shrink-0\">{item.badge}</span>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{!!item.description && (\n\t\t\t\t\t\t\t\t\tisSimpleContent(item.description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"secondary\" className=\"smart-accordion--description min-w-0\">\n\t\t\t\t\t\t\t\t\t\t\t{item.description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : item.description\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</AccordionTrigger>\n\t\t\t\t\t<AccordionContent\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'smart-accordion--content',\n\t\t\t\t\t\t\tcontentPadding,\n\t\t\t\t\t\t\tcontentClassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{isSimpleContent(item.content) ? (\n\t\t\t\t\t\t\t<Text tag=\"div\" type=\"secondary\" lineHeight=\"relaxed\">\n\t\t\t\t\t\t\t\t{item.content}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : item.content}\n\t\t\t\t\t</AccordionContent>\n\t\t\t\t</AccordionItem>\n\t\t\t))}\n\t\t</Accordion>\n\t);\n});\n\nSmartAccordion.displayName = 'SmartAccordion';\n\nfunction isSimpleContent(content: ReactNode): content is string | number | bigint {\n\treturn typeof content === 'string' || typeof content === 'number' || typeof content === 'bigint';\n}\n\nfunction SmartAccordionIcon({\n\ticonStyle,\n\ticon,\n\treserveSpace,\n}: {\n\ticonStyle: SmartAccordionIconStyle;\n\ticon?: ReactNode;\n\treserveSpace: boolean;\n}) {\n\tif (iconStyle === 'none' || !reserveSpace) return null;\n\tif (!icon) {\n\t\treturn (\n\t\t\t<span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'smart-accordion--icon inline-flex shrink-0',\n\t\t\t\t\ticonStyle === 'inline' ? 'size-icon-lg' : 'size-avatar',\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t}\n\tif (iconStyle === 'inline') {\n\t\treturn (\n\t\t\t<span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName=\"smart-accordion--icon inline-flex size-icon-lg shrink-0 self-center text-muted-foreground [&>svg]:size-icon\"\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t</span>\n\t\t);\n\t}\n\treturn (\n\t\t<IconBadge size=\"md\" tone=\"neutral\" shape=\"circle\" aria-hidden=\"true\" className=\"smart-accordion--icon self-center\">\n\t\t\t{icon}\n\t\t</IconBadge>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAOA,SAASA,EAAU,EAAE,cAAW,GAAGqB,KAAwC;CACzE,OACE,kBAACpB,EAAmB,MAApB;EACE,aAAU;EACV,WAAWsB,EAAG,6FAA6FC,CAAS;EACpH,GAAIH;CACL,CAAA;AAEL;AAEA,SAASnB,EAAc,EAAE,cAAW,GAAGmB,KAAwC;CAC7E,OACE,kBAACpB,EAAmB,MAApB;EACE,aAAU;EACV,WAAWsB,EAAG,oEAAoEC,CAAS;EAC3F,GAAIH;CACL,CAAA;AAEL;AAEA,SAASlB,EAAiB,EACxB,cACA,aACA,GAAGkB,KACgC;CACnC,OACE,kBAACpB,EAAmB,QAApB;EAA2B,WAAU;EACnC,UAAA,kBAACA,EAAmB,SAApB;GACE,aAAU;GACV,WAAWsB,EAAG,wIAAwIC,CAAS;GAC/J,GAAIH;GAHN,UAAA,CAKGM,GACD,kBAACC,GAAD;IAAiB,aAAU;IAAyB,WAAWL,EAAG,wGAAwGT,EAAc,OAAO;GAAI,CAAA,CACzK;;CACH,CAAA;AAE/B;AAEA,SAASV,EAAiB,EACxB,cACA,aACA,WACA,GAAGiB,KAC8B;CACjC,OACE,kBAACpB,EAAmB,OAApB;EACE,aAAU;EACV,WAAWsB,EAAG,qFAAqFT,EAAc,YAAYU,CAAS;EACtI,GAAIH;EACJ,SAAS,G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EACV,8CACAwB,MAAc,WAAW,iBAAiB,aAC3C;CACA,CAAA;AAkBJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-artifact-C58tQcBy.js","names":["_Fragment","STATUS_VARIANT","_Fragment","NumberValue","_Fragment","_Fragment","_Fragment","cn","Button","Text","DisplayLabel","TextLink","focusRecipes","Stack","toneRecipes","Card","compositionRhythm","interactionRecipes","SecondaryValue","Duration","Number$1","IconBadge","Badge","AttachmentFileIcon","AttachmentTitle","AttachmentDescription","AttachmentActions","AttachmentMedia","AttachmentContent","AttachmentProgress","Attachment","Message","CodeBlock","Fragment$1","useCopyFeedback","copied","setCopied","useState","failed","setFailed","mounted","useRef","attempt","timer","useEffect","source","request","text","error","onCopyError","defaultAiMessageBubbleStrings","AiMessageBubble","stringsProp","strings","useStrings","copyText","plainText","children","renderedAvatar","avatar","role","User","Bot","avatarLabel","showActions","onCopy","onRegenerate","authorName","className","loading","copy","Copy","RotateCcw","defaultAiToolCallStrings","STATUS_BADGE","DurationValue","label","ms","AiToolCall","IconComponent","expandedProp","internalExpanded","setInternalExpanded","defaultExpanded","expanded","setExpanded","next","onExpandedChange","labelByStatus","statusBadge","status","hasDetails","args","result","finished","MonoValue","name","durationMs","jsx","ChevronDown","ChevronRight","DetailBlock","tone","AiShimmer","paused","style","duration","defaultAiCodeBlockStrings","AiCodeBlock","props","defaultAiAttachmentStrings","AiAttachment","Icon","showProgress","errored","progress","thumbnailUrl","AlertCircle","meta","onRemove","X","defaultAiAgentStrings","STATUS_VARIANT$1","AiAgent","icon","variant","live","StatusPill","subtitle","trailing","defaultAiConfirmationStrings","TONE","AiConfirmation","toneCfg","title","description","details","onReject","rejectLabel","onApprove","approveLabel","Check","defaultAiSourcesStrings","interpolate","template","v","params","k","m","AiSources","mergeStrings","titleText","sources","AvatarStrip","maxAvatars","visible","AvatarStack","SourceRow","idx","onSelect","max","overflow","visual","s","SourceFavicon","i","visitLabel","src","Globe","interactive","rowClassName","rowContent","index","ExternalLink","defaultAiReasoningStrings","renderThoughtFor","durationParts","seconds","AiReasoning","streaming","expandWhileStreaming","headerLabel","durationSeconds","Brain","defaultAiChainOfThoughtStrings","STATUS_VISUAL","Circle","Loader2","AiChainOfThought","hideHeader","steps","step","isLast","defaultAiTaskStrings","STATUS_ICON","XCircle","MinusCircle","STATUS_VARIANT","AiTask","columns","someItem","task","hasStatusBadge","item","TRAILING_COLUMNS","TaskRow","test","child","hasChildren","open","setOpen","density","depth","mutedTitle","indent","defaultAiArtifactStrings","AiArtifact","FileText","actions","ActionIcon","action","onDownload","Download","onOpen","collapsed"],"sources":["../src/components/blocks/ai/use-copy-feedback.ts","../src/components/blocks/ai/ai-message-bubble/types.ts","../src/components/blocks/ai/ai-message-bubble/ai-message-bubble.tsx","../src/components/blocks/ai/ai-tool-call/types.ts","../src/components/blocks/ai/ai-tool-call/ai-tool-call.tsx","../src/components/blocks/ai/ai-shimmer/ai-shimmer.tsx","../src/components/blocks/ai/ai-code-block/types.ts","../src/components/blocks/ai/ai-code-block/ai-code-block.tsx","../src/components/blocks/ai/ai-attachment/types.ts","../src/components/blocks/ai/ai-attachment/ai-attachment.tsx","../src/components/blocks/ai/ai-agent/types.ts","../src/components/blocks/ai/ai-agent/ai-agent.tsx","../src/components/blocks/ai/ai-confirmation/types.ts","../src/components/blocks/ai/ai-confirmation/ai-confirmation.tsx","../src/components/blocks/ai/ai-sources/types.ts","../src/components/blocks/ai/ai-sources/ai-sources.tsx","../src/components/blocks/ai/ai-reasoning/types.ts","../src/components/blocks/ai/ai-reasoning/ai-reasoning.tsx","../src/components/blocks/ai/ai-chain-of-thought/types.ts","../src/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.tsx","../src/components/blocks/ai/ai-task/types.ts","../src/components/blocks/ai/ai-task/ai-task.tsx","../src/components/blocks/ai/ai-artifact/types.ts","../src/components/blocks/ai/ai-artifact/ai-artifact.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\n/** Shared clipboard lifecycle for AI surfaces; callbacks and text stay per mount. */\nexport function useCopyFeedback(onCopyError?: (error: unknown) => void, source?: string) {\n\tconst [copied, setCopied] = useState(false);\n\tconst [failed, setFailed] = useState(false);\n\tconst mounted = useRef(false);\n\tconst attempt = useRef(0);\n\tconst timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n\tuseEffect(() => {\n\t\tmounted.current = true;\n\t\tsetCopied(false);\n\t\tsetFailed(false);\n\t\treturn () => {\n\t\t\tmounted.current = false;\n\t\t\tattempt.current += 1;\n\t\t\tclearTimeout(timer.current);\n\t\t};\n\t}, [source]);\n\n\tconst copy = async (text: string) => {\n\t\tconst request = ++attempt.current;\n\t\tclearTimeout(timer.current);\n\t\tsetCopied(false);\n\t\tsetFailed(false);\n\t\ttry {\n\t\t\tif (typeof navigator === 'undefined' || !navigator.clipboard?.writeText) {\n\t\t\t\tthrow new Error('Clipboard unavailable');\n\t\t\t}\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t} catch (error) {\n\t\t\tif (mounted.current && request === attempt.current) {\n\t\t\t\tsetFailed(true);\n\t\t\t\tonCopyError?.(error);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (!mounted.current || request !== attempt.current) return false;\n\t\tsetCopied(true);\n\t\ttimer.current = setTimeout(() => setCopied(false), 1500);\n\t\treturn true;\n\t};\n\n\treturn { copied, failed, copy };\n}\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiMessageRole = 'assistant' | 'user' | 'system';\n\nexport interface AiMessageBubbleStrings {\n\t/** Optional localized loading announcement. */\n\tloading?: string;\n\tcopyAria: string;\n /** Failure feedback, additive for existing string dictionaries. */\n copyError?: string;\n\tcopied: string;\n\tregenerateAria: string;\n}\n\nexport const defaultAiMessageBubbleStrings: AiMessageBubbleStrings = {\n copyError: 'Could not copy. Please try again.',\n\tcopyAria: 'Copy message',\n\tcopied: 'Copied',\n\tregenerateAria: 'Regenerate response',\n};\n\nexport interface AiMessageBubbleProps {\n\trole?: AiMessageRole;\n\t/** Leading avatar. */\n\tavatar?: ReactNode;\n\tavatarLabel?: string;\n\tauthorName?: ReactNode;\n\t/** Formatted time for the entry. */\n\ttimestamp?: ReactNode;\n\tchildren?: ReactNode;\n\t/** Plain-text version of the message content; used for the copy action. */\n\tplainText?: string;\n\tloading?: boolean;\n\t/** Fired when an entry is copied. */\n\tonCopy?: () => void;\n\tonRegenerate?: () => void;\n\t/** Merged onto the outermost node. */\n\t/** Called when the clipboard is unavailable or the write fails. */\n onCopyError?: (error: unknown) => void;\n className?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiMessageBubbleStrings>;\n}\n","import { Bot, Copy, RotateCcw, User } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { IconBadge } from '../../../base/display';\nimport { Message } from '../../collaboration/message';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { useCopyFeedback } from '../use-copy-feedback';\nimport { defaultAiMessageBubbleStrings, type AiMessageBubbleProps } from './types';\n/** AI-specific copy/regenerate actions on the generic message presentation owner. */\nexport function AiMessageBubble({ role = 'assistant', avatar, avatarLabel, authorName, timestamp, children, plainText, loading = false, onCopy, onRegenerate, onCopyError, className, strings: stringsProp }: AiMessageBubbleProps) {\n const strings = useStrings(defaultAiMessageBubbleStrings, stringsProp);\n const copyText = plainText ?? (typeof children === 'string' ? children : '');\n const { copied, failed, copy } = useCopyFeedback(onCopyError, copyText);\n const Icon = role === 'user' ? User : Bot;\n // The default author mark is the shared compact avatar disc; a label names it as an image.\n const renderedAvatar = avatar ?? <IconBadge icon={Icon} tone=\"neutral\" size=\"sm\" aria-label={avatarLabel} />;\n const showActions = (onCopy !== undefined || plainText || onRegenerate) && role === 'assistant';\n return <Message align={role === 'user' ? 'end' : 'start'} tone={role === 'user' ? 'primary' : role === 'system' ? 'muted' : 'surface'} avatar={renderedAvatar} author={authorName} timestamp={timestamp} loading={loading} strings={{ loading: strings.loading }} className={cn('ai-message-bubble--component', className)} actions={showActions ? <>\n <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly aria-label={strings.copyAria} disabled={!copyText || loading} onClick={async () => { if (copyText && await copy(copyText)) onCopy?.(); }}><Copy aria-hidden=\"true\" className=\"size-icon-md\" /></Button>\n {copied && <Text size=\"xs\" type=\"success\">{strings.copied}</Text>}\n {onRegenerate && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly aria-label={strings.regenerateAria} onClick={onRegenerate}><RotateCcw aria-hidden=\"true\" className=\"size-icon-md\" /></Button>}\n {failed && <Text role=\"alert\" size=\"xs\" type=\"error\">{strings.copyError ?? defaultAiMessageBubbleStrings.copyError}</Text>}\n </> : undefined}>{children}</Message>;\n}\nAiMessageBubble.displayName = 'AiMessageBubble';\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiToolCallStatus = 'pending' | 'running' | 'success' | 'error';\n\nexport interface AiToolCallStrings {\n\tpending: string;\n\trunning: string;\n\tsuccess: string;\n\terror: string;\n\texpand: string;\n\tcollapse: string;\n\targs: string;\n\tresult: string;\n\tdurationLabel: string;\n\t/** Label before the elapsed time of a call that is still queued or running. Additive. */\n\telapsedLabel?: string;\n}\n\nexport const defaultAiToolCallStrings: AiToolCallStrings = {\n\tpending: 'Queued',\n\trunning: 'Running',\n\tsuccess: 'Success',\n\terror: 'Failed',\n\texpand: 'Show details',\n\tcollapse: 'Hide details',\n\targs: 'Arguments',\n\tresult: 'Result',\n\tdurationLabel: 'Took',\n\telapsedLabel: 'Elapsed',\n};\n\nexport interface AiToolCallProps {\n\t/** Display name. */\n\tname: string;\n\tstatus: AiToolCallStatus;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\targs?: ReactNode;\n\tresult?: ReactNode;\n\terror?: ReactNode;\n\t/** Duration in ms; rendered as \"Took 1.2s\", or \"Elapsed 1.2s\" while the call is queued or running. */\n\tdurationMs?: number;\n\t/** Expanded state, for controlled use. */\n\texpanded?: boolean;\n\t/** Initial expanded state, for uncontrolled use. */\n\tdefaultExpanded?: boolean;\n\t/** Fired whenever the disclosure state changes. */\n\tonExpandedChange?: (expanded: boolean) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiToolCallStrings>;\n}\n","/**\n * AiToolCall — collapsible trace for a model-invoked tool / function. Header\n * shows the tool name, status pill, and an expand/collapse toggle. Expanded\n * content reveals JSON-style `args` and `result` blocks (or an error block\n * when status is `error`) plus an optional duration. Use to surface tool-use\n * transparency in chat / agent UIs. Strings overridable for i18n.\n */\nimport {\n\tuseState,\n\ttype ReactNode } from 'react';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { IconBadge,\n} from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Duration, MonoValue, SecondaryValue } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiToolCallStrings,\n\ttype AiToolCallProps,\n\ttype AiToolCallStatus,\n} from './types';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n// The badge text states the status; only a running call adds the shared live dot.\n// Primary is reserved for the main command, so a running call reads as info.\nconst STATUS_BADGE: Record<\n\tAiToolCallStatus,\n\t{ tone: 'secondary' | 'info' | 'success' | 'destructive'; live?: boolean }\n> = {\n\tpending: { tone: 'secondary' },\n\trunning: { tone: 'info', live: true },\n\tsuccess: { tone: 'success' },\n\terror: { tone: 'destructive' },\n};\n\nfunction DurationValue({ label, ms }: { label: string; ms: number }) {\n\treturn (\n\t\t<span className=\"inline-flex shrink-0 items-baseline gap-space-xs\">\n\t\t\t<SecondaryValue size=\"xs\">\n\t\t\t\t{label}\n\t\t\t</SecondaryValue>\n\t\t\t<Duration\n\t\t\t\tvalue={ms}\n\t\t\t\tfrom=\"milliseconds\"\n\t\t\t\tmaxParts={1}\n\t\t\t\tsize=\"xs\"\n\t\t\t\talign=\"left\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\tmaximumFractionDigits={ms < 10_000 ? 1 : 0}\n\t\t\t/>\n\t\t</span>\n\t);\n}\n\nexport function AiToolCall({\n\tname,\n\tstatus,\n\ticon: IconComponent,\n\targs,\n\tresult,\n\terror,\n\tdurationMs,\n\texpanded: expandedProp,\n\tdefaultExpanded = false,\n\tonExpandedChange,\n\tclassName,\n\tstrings: stringsProp,\n}: AiToolCallProps) {\n\tconst strings = useStrings(defaultAiToolCallStrings, stringsProp);\n\tconst [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n\tconst expanded = expandedProp ?? internalExpanded;\n\tconst setExpanded = (next: boolean) => {\n\t\tif (expandedProp === undefined) setInternalExpanded(next);\n\t\tonExpandedChange?.(next);\n\t};\n\tconst labelByStatus: Record<AiToolCallStatus, string> = {\n\t\tpending: strings.pending,\n\t\trunning: strings.running,\n\t\tsuccess: strings.success,\n\t\terror: strings.error,\n\t};\n\tconst statusBadge = STATUS_BADGE[status];\n\n\tconst hasDetails = Boolean(args || result || error);\n\t// A finished call states how long it took; one still queued or running\n\t// states the time elapsed so far.\n\tconst finished = status === 'success' || status === 'error';\n\n\treturn (\n\t\t// The public Card owns the frame and its `@container/card` query root; the\n\t\t// trigger and details own their insets. An error swaps the frame to the\n\t\t// destructive edge and wash.\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"none\"\n\t\t\tclassName={cn('ai-tool-call--component',\n\t\t\t\tstatus === 'error' && cn(toneRecipes.destructive.edge, toneRecipes.destructive.wash),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\tsize=\"md\"\n\t\t\t\tonClick={() => hasDetails && setExpanded(!expanded)}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'ai-tool-call--trigger h-auto min-h-0 w-full flex-wrap justify-start gap-space-md whitespace-normal rounded-none px-space-lg py-space-md text-left @md/card:flex-nowrap',\n\t\t\t\t\thasDetails ? `cursor-pointer ${interactionRecipes.rowHover}` : 'cursor-default',\n\t\t\t\t)}\n\t\t\t\taria-expanded={hasDetails ? expanded : undefined}\n\t\t\t\taria-label={hasDetails ? (expanded ? strings.collapse : strings.expand) : undefined}\n\t\t\t>\n\t\t\t\t{/* No default glyph: the monospace tool name identifies the call. */}\n\t\t\t\t{!!IconComponent && <IconBadge icon={IconComponent} tone=\"neutral\" size=\"md\" shape=\"square\" />}\n\t\t\t\t<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t<MonoValue type=\"inherit\" className=\"truncate\">\n\t\t\t\t\t\t{name}\n\t\t\t\t\t</MonoValue>\n\t\t\t\t</div>\n\t\t\t\t<span className=\"ai-tool-call--meta order-last flex w-full flex-wrap items-center gap-space-sm @md/card:order-none @md/card:w-auto @md/card:flex-nowrap\">\n\t\t\t\t\t<Badge tone={statusBadge.tone} dot={statusBadge.live} pulse={statusBadge.live}>\n\t\t\t\t\t\t{labelByStatus[status]}\n\t\t\t\t\t</Badge>\n\t\t\t\t\t{!!durationMs && (\n\t\t\t\t\t\t<DurationValue\n\t\t\t\t\t\t\tlabel={finished ? strings.durationLabel : (strings.elapsedLabel ?? defaultAiToolCallStrings.elapsedLabel ?? strings.durationLabel)}\n\t\t\t\t\t\t\tms={durationMs}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t\t{/* A call without details keeps the disclosure column, so its status and\n\t\t\t\t duration end on the same edge as a stack of expandable siblings. */}\n\t\t\t\t{hasDetails ? (\n\t\t\t\t\texpanded ? (\n\t\t\t\t\t\t<ChevronDown className=\"size-icon-md shrink-0 text-muted-foreground\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<ChevronRight className=\"size-icon-md shrink-0 text-muted-foreground\" />\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<span aria-hidden=\"true\" className=\"ai-tool-call--affordance hidden size-icon-md shrink-0 @md/card:block\" />\n\t\t\t\t)}\n\t\t\t</Button>\n\n\t\t\t{!!expanded && hasDetails && (\n\t\t\t\t<Stack gap=\"md\" className=\"ai-tool-call--details border-t border-border/60 bg-muted/30 px-space-lg py-space-md\">\n\t\t\t\t\t{!!args && (\n\t\t\t\t\t\t<DetailBlock label={strings.args}>{args}</DetailBlock>\n\t\t\t\t\t)}\n\t\t\t\t\t{status === 'error' && !!error ? (\n\t\t\t\t\t\t<DetailBlock label={strings.error} tone=\"destructive\">\n\t\t\t\t\t\t\t{error}\n\t\t\t\t\t\t</DetailBlock>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t!!result && <DetailBlock label={strings.result}>{result}</DetailBlock>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nAiToolCall.displayName = 'AiToolCall';\n\nfunction DetailBlock({\n\tlabel,\n\tchildren,\n\ttone = 'neutral',\n}: {\n\t/** Display label. */\n\tlabel: string;\n\tchildren: ReactNode;\n\ttone?: 'neutral' | 'destructive';\n}) {\n\treturn (\n\t\t<Stack gap=\"sm\" className=\"ai-tool-call--detail-block\">\n\t\t\t<DisplayLabel>\n\t\t\t\t{label}\n\t\t\t</DisplayLabel>\n\t\t\t<pre\n\t\t\t\ttabIndex={0}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'box-border m-0 max-w-full overflow-x-auto rounded-radius bg-card text-card-foreground px-space-md py-space-md font-mono text-xs leading-relaxed',\n\t\t\t\t\ttone === 'destructive' && cn(toneRecipes.destructive.ink, toneRecipes.destructive.wash),\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</pre>\n\t\t</Stack>\n\t);\n}\n","/**\n * AiShimmer — gradient text shimmer for streaming / loading copy. Renders\n * children with a moving highlight band that draws the eye while a model is\n * thinking. Use anywhere a static \"Loading…\" feels too inert: agent typing,\n * tool warm-up, awaiting first token.\n */\nimport type { CSSProperties } from 'react';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { AiShimmerProps } from './types';\n\nexport function AiShimmer({\n\tchildren = 'Thinking…',\n\tpaused = false,\n\tduration = 2.4,\n\tsize,\n\tclassName,\n}: AiShimmerProps) {\n\tif (paused) {\n\t\treturn (\n\t\t\t<Text tag=\"span\" type=\"secondary\" size={size} weight=\"medium\" className={cn('ai-shimmer--component', className)}>\n\t\t\t\t{children}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\t// `CSSProperties` has no index signature for custom properties, which is the\n\t// only reason this needed a cast. Widening the annotation states the intent\n\t// — one known custom property — instead of switching the key off.\n\tconst style: CSSProperties & Record<'--ai-shimmer-duration', string> = {\n\t\t'--ai-shimmer-duration': `${duration}s`,\n\t};\n\n\treturn (\n\t\t<Text\n\t\t\ttag=\"span\"\n\t\t\tsize={size}\n\t\t\tweight=\"medium\"\n\t\t\tdata-ai-shimmer\n\t\t\trole=\"status\"\n\t\t\taria-live=\"polite\"\n\t\t\tclassName={cn(\n\t\t\t\t'ai-shimmer--component inline-block bg-clip-text text-transparent',\n\t\t\t\t// foreground -> muted -> foreground gradient swept across\n\t\t\t\t'bg-[linear-gradient(110deg,var(--ai-shimmer-base,var(--muted-foreground))_30%,var(--ai-shimmer-highlight,var(--foreground))_50%,var(--ai-shimmer-base,var(--muted-foreground))_70%)]',\n\t\t\t\t'bg-[length:200%_100%]',\n\t\t\t\t'animate-[ai-shimmer-sweep_var(--ai-shimmer-duration,2.4s)_linear_infinite] motion-reduce:animate-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\nAiShimmer.displayName = 'AiShimmer';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface AiCodeBlockStrings {\n\tcopy: string;\n\tcopied: string;\n\tcopyAria: string;\n /** Failure feedback, additive for existing string dictionaries. */\n copyError?: string;\n\t/** Header label when no language is provided. */\n\tdefaultLanguageLabel: string;\n}\n\nexport const defaultAiCodeBlockStrings: AiCodeBlockStrings = {\n\tcopy: 'Copy',\n\tcopied: 'Copied',\n copyError: 'Could not copy. Please try again.',\n\tcopyAria: 'Copy code',\n\tdefaultLanguageLabel: 'Code',\n};\n\nexport interface AiCodeBlockProps {\n\t/** The code to render. Pre-formatted text. */\n\tcode: string;\n\t/** Display label for the language (e.g. \"TypeScript\", \"shell\"). */\n\tlanguage?: string;\n\t/** Optional filename rendered in the header next to the language label. */\n\tfilename?: string;\n\t/** Render with line numbers. */\n\tshowLineNumbers?: boolean;\n\t/** Highlight specific 1-indexed line numbers. */\n\thighlightLines?: ReadonlyArray<number>;\n\t/** Hide the header strip entirely. */\n\thideHeader?: boolean;\n\t/** Force max-height before scroll. */\n\tmaxHeight?: number | string;\n\t/** Trailing slot inside the header (e.g. extra action button). */\n\theaderActions?: ReactNode;\n\t/** Fired when the user copies (after the navigator.clipboard write). */\n\tonCopy?: () => void;\n\t/** Merged onto the outermost node. */\n\t/** Called when the clipboard is unavailable or the write fails. */\n onCopyError?: (error: unknown) => void;\n className?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiCodeBlockStrings>;\n}\n","import { CodeBlock } from '../../../base/code-block';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { defaultAiCodeBlockStrings, type AiCodeBlockProps } from './types';\n/** Compatibility adapter; the generic code display owns layout and copying. */\nexport function AiCodeBlock({ strings: stringsProp, className, onCopy, ...props }: AiCodeBlockProps) {\n const strings = useStrings(defaultAiCodeBlockStrings, stringsProp);\n return <CodeBlock {...props} className={cn('ai-code-block--component', className)} onCopy={onCopy ? () => onCopy() : undefined} strings={{ copyAria: strings.copyAria, copied: strings.copied, copyError: strings.copyError, defaultLanguageLabel: strings.defaultLanguageLabel }} />;\n}\nAiCodeBlock.displayName = 'AiCodeBlock';\n","import type { LucideIcon } from 'lucide-react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiAttachmentKind = 'image' | 'document' | 'audio' | 'video' | 'code' | 'archive' | 'generic';\n\nexport interface AiAttachmentStrings {\n\tremoveAria: string;\n\topenAria: string;\n\tuploadProgressAria: string;\n\t/** Text feedback when the attachment cannot be used. */\n\terror?: string;\n}\n\nexport const defaultAiAttachmentStrings: AiAttachmentStrings = {\n\tremoveAria: 'Remove attachment',\n\topenAria: 'Open attachment',\n\tuploadProgressAria: 'Upload progress',\n\terror: 'Failed',\n};\n\nexport interface AiAttachmentProps {\n\t/** Filename / display label. */\n\tname: string;\n\t/** Optional secondary label — formatted size, file extension, etc. */\n\tmeta?: string;\n\t/** Pre-categorized kind. Defaults to \"generic\" — drives the fallback icon. */\n\tkind?: AiAttachmentKind;\n\t/** Override the auto-picked kind icon. */\n\ticon?: LucideIcon;\n\t/** When set, renders the chip as a thumbnail tile with this image. */\n\tthumbnailUrl?: string;\n\t/** Show a small loading bar (in-flight upload). */\n\tprogress?: number; // 0..1\n\t/** Show as errored — overrides progress. */\n\terrored?: boolean;\n\t/** Open / download callback (clicking the chip body). */\n\tonOpen?: () => void;\n\t/** Render a remove (×) action. */\n\tonRemove?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiAttachmentStrings>;\n}\n","/** Compatibility presentation for staged AI files; Attachment owns the file anatomy. */\nimport { AlertCircle, X } from 'lucide-react';\nimport { Attachment, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentProgress, AttachmentFileIcon } from '../../../base/attachment';\nimport { Button } from '../../../base/buttons';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { defaultAiAttachmentStrings, type AiAttachmentProps } from './types';\n\nexport function AiAttachment({ name, meta, kind = 'generic', icon: Icon, thumbnailUrl, progress, errored = false, onOpen, onRemove, className, strings: stringsProp }: AiAttachmentProps) {\n const strings = useStrings(defaultAiAttachmentStrings, stringsProp);\n const showProgress = !errored && typeof progress === 'number' && progress >= 0 && progress < 1;\n return <Attachment name={name} layout=\"compact\" status={errored ? 'error' : showProgress ? 'uploading' : undefined} onOpen={onOpen} strings={{ preview: () => strings.openAria }} className={cn('ai-attachment--component inline-flex w-auto', className)}>\n <AttachmentMedia variant={thumbnailUrl ? 'image' : 'icon'}>\n {thumbnailUrl ? <img src={thumbnailUrl} alt=\"\" /> : errored ? <AlertCircle aria-hidden=\"true\" /> : Icon ? <Icon aria-hidden=\"true\" /> : <AttachmentFileIcon name={name} kind={kind} />}\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle title={name}>{name}</AttachmentTitle>\n {meta && <AttachmentDescription clamp={1}>{meta}</AttachmentDescription>}\n {errored && <AttachmentDescription clamp=\"none\"><Text tag=\"span\" size=\"xs\" type=\"error\" role=\"alert\">{strings.error ?? defaultAiAttachmentStrings.error}</Text></AttachmentDescription>}\n {showProgress && <AttachmentProgress value={Math.round((progress ?? 0) * 100)} size=\"sm\" aria-label={strings.uploadProgressAria} />}\n </AttachmentContent>\n {onRemove && <AttachmentActions><Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly aria-label={strings.removeAria} onClick={onRemove}><X aria-hidden=\"true\" className=\"size-icon-sm\" /></Button></AttachmentActions>}\n </Attachment>;\n}\nAiAttachment.displayName = 'AiAttachment';\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiAgentStatus = 'idle' | 'thinking' | 'working' | 'done' | 'error' | 'offline';\n\nexport interface AiAgentStrings {\n\tstatusLabels: Record<AiAgentStatus, string>;\n}\n\nexport const defaultAiAgentStrings: AiAgentStrings = {\n\tstatusLabels: {\n\t\tidle: 'Idle',\n\t\tthinking: 'Thinking',\n\t\tworking: 'Working',\n\t\tdone: 'Done',\n\t\terror: 'Error',\n\t\toffline: 'Offline',\n\t},\n};\n\nexport interface AiAgentProps {\n\t/** Display name (e.g. \"Atlas\", \"Claude\"). */\n\tname: string;\n\t/** Avatar / mark — typically an icon or short emoji. */\n\ticon?: LucideIcon;\n\t/** Override avatar with arbitrary content (image, gradient mark, etc.). */\n\tavatar?: ReactNode;\n\t/** Short blurb / model identifier rendered under the name. */\n\tsubtitle?: ReactNode;\n\t/** Tone color for the avatar wash. */\n\ttone?: 'primary' | 'success' | 'warning' | 'destructive' | 'info' | 'neutral';\n\t/** Live status displayed as a pill next to the name. */\n\tstatus?: AiAgentStatus;\n\t/** Density variant — `inline` is a single-line chip, `card` is a tile. */\n\tvariant?: 'inline' | 'card';\n\t/** Trailing slot — typically actions, badges. */\n\ttrailing?: ReactNode;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiAgentStrings>;\n}\n","/**\n * AiAgent — identity card for an AI persona / model. Renders avatar (icon\n * or custom), name, optional subtitle (model id, role), and a live status\n * pill. `variant='inline'` is a one-line chip (header strips, breadcrumbs);\n * `variant='card'` is a small tile (model picker, agent dock).\n */\nimport { Bot, type LucideIcon } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { IconBadge } from '../../../base/display';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiAgentStrings,\n\ttype AiAgentProps,\n\ttype AiAgentStatus,\n} from './types';\n\n// Live states use the info status tone; primary is reserved for the main command.\nconst STATUS_VARIANT: Record<\n\tAiAgentStatus,\n\t'secondary' | 'info' | 'success' | 'warning' | 'destructive'\n> = {\n\tidle: 'secondary',\n\tthinking: 'info',\n\tworking: 'info',\n\tdone: 'success',\n\terror: 'destructive',\n\toffline: 'secondary',\n};\n\nexport function AiAgent({\n\tname,\n\ticon,\n\tavatar,\n\tsubtitle,\n\ttone = 'primary',\n\tstatus,\n\tvariant = 'inline',\n\ttrailing,\n\tclassName,\n\tstrings: stringsProp,\n}: AiAgentProps) {\n\tconst strings = useStrings(defaultAiAgentStrings, stringsProp);\n\tconst Icon: LucideIcon = icon ?? Bot;\n\n\t// The tile takes the default avatar disc; the one-line chip takes the compact one.\n\tconst renderedAvatar =\n\t\tavatar ?? <IconBadge icon={Icon} tone={tone} size={variant === 'card' ? 'md' : 'sm'} />;\n\n\t// Live states pulse the Badge's own status dot.\n\tconst live = status === 'thinking' || status === 'working';\n\tconst StatusPill = !!status && (\n\t\t<Badge tone={STATUS_VARIANT[status]} dot pulse={live}>\n\t\t\t{strings.statusLabels[status]}\n\t\t</Badge>\n\t);\n\n\tif (variant === 'card') {\n\t\t// The public Card owns the tile's frame and compact inset.\n\t\treturn (\n\t\t\t<Card surface=\"card\" padding=\"sm\" className={cn('ai-agent--component', className)}>\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"lg\">\n\t\t\t\t{renderedAvatar}\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"truncate\">\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{StatusPill}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!subtitle && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"line-clamp-1\">\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t{!!trailing && <div className=\"ml-auto flex items-center gap-space-xs\">{trailing}</div>}\n\t\t\t</Stack>\n\t\t\t</Card>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className={cn('ai-agent--component', 'inline-flex items-center gap-space-md', className)}>\n\t\t\t{renderedAvatar}\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\" className=\"min-w-0\">\n\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t{name}\n\t\t\t\t</Text>\n\t\t\t\t{!!subtitle && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t{StatusPill}\n\t\t\t</Stack>\n\t\t\t{!!trailing && <div className=\"ml-1 flex items-center gap-space-xs\">{trailing}</div>}\n\t\t</div>\n\t);\n}\n\nAiAgent.displayName = 'AiAgent';\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\nimport type { SemanticTone } from '../../../../lib/component-vocabulary';\n\nexport type AiConfirmationTone = Extract<\n\tSemanticTone,\n\t'neutral' | 'destructive' | 'warning' | 'info' | 'primary'\n>;\n\nexport interface AiConfirmationStrings {\n\tapprove: string;\n\treject: string;\n\tpending: string;\n\tapproved: string;\n\trejected: string;\n}\n\nexport const defaultAiConfirmationStrings: AiConfirmationStrings = {\n\tapprove: 'Approve',\n\treject: 'Reject',\n\tpending: 'Awaiting your approval',\n\tapproved: 'Approved',\n\trejected: 'Rejected',\n};\n\nexport type AiConfirmationStatus = 'pending' | 'approved' | 'rejected';\n\nexport interface AiConfirmationProps {\n\t/** Title — short, action-oriented (e.g. \"Run npm install\"). */\n\ttitle: ReactNode;\n\t/** Body description / details. */\n\tdescription?: ReactNode;\n\t/** Decorative icon. */\n\ticon?: LucideIcon;\n\t/** Semantic color intent. */\n\ttone?: AiConfirmationTone;\n\t/** Current status — when set, the action row is replaced with a result pill. */\n\tstatus?: AiConfirmationStatus;\n\t/** Approve callback. */\n\tonApprove?: () => void;\n\t/** Reject callback. */\n\tonReject?: () => void;\n\t/** Override the approve button label. */\n\tapproveLabel?: ReactNode;\n\t/** Override the reject button label. */\n\trejectLabel?: ReactNode;\n\t/** Render a \"details\" expandable area. */\n\tdetails?: ReactNode;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiConfirmationStrings>;\n}\n","import {compositionRhythm} from '../../../base/structure/composition.recipes';\n/**\n * AiConfirmation — inline approval prompt rendered in-stream when an agent\n * needs user permission before taking a side-effecting action (run command,\n * call write API, charge a card). Carries title, description, icon, optional\n * details, and an approve/reject pair. After resolution, the action row\n * collapses into a status pill.\n */\nimport { Check, X } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { IconBadge,\n} from '../../../base/display';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiConfirmationStrings,\n\ttype AiConfirmationProps,\n\ttype AiConfirmationTone,\n} from './types';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n// Neutral keeps the Card's own frame; a risk tone swaps it for that tone's edge and wash.\nconst TONE: Record<\n\tAiConfirmationTone,\n\t{ ring?: string; icon: 'neutral' | 'primary' | 'success' | 'warning' | 'destructive' | 'info' }\n> = {\n\tneutral: { icon: 'neutral' },\n\tdestructive: { ring: `${toneRecipes.destructive.edge} ${toneRecipes.destructive.wash}`, icon: 'destructive' },\n\twarning: { ring: `${toneRecipes.warning.edge} ${toneRecipes.warning.wash}`, icon: 'warning' },\n\tinfo: { ring: `${toneRecipes.info.edge} ${toneRecipes.info.wash}`, icon: 'info' },\n\tprimary: { ring: `${toneRecipes.primary.edge} ${toneRecipes.primary.wash}`, icon: 'primary' },\n};\n\nexport function AiConfirmation({\n\ttitle,\n\tdescription,\n\ticon,\n\ttone = 'neutral',\n\tstatus = 'pending',\n\tonApprove,\n\tonReject,\n\tapproveLabel,\n\trejectLabel,\n\tdetails,\n\tclassName,\n\tstrings: stringsProp,\n}: AiConfirmationProps) {\n\tconst strings = useStrings(defaultAiConfirmationStrings, stringsProp);\n\t// No default glyph: the title states the action and the tone states the risk.\n\tconst Icon = icon;\n\tconst toneCfg = TONE[tone];\n\n\t// The public Card owns the frame, its compact inset and the `@container/card`\n\t// query root. Header, details and the action row are spaced by the Stack gaps.\n\treturn (\n\t\t<Card\n\t\t\trole=\"region\"\n\t\t\taria-live=\"polite\"\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"sm\"\n\t\t\tclassName={cn('ai-confirmation--component', toneCfg.ring, className)}\n\t\t>\n\t\t\t<Stack gap=\"lg\">\n\t\t\t<div className=\"ai-confirmation--header flex items-start gap-space-lg\">\n\t\t\t\t{!!Icon && <IconBadge icon={Icon} tone={toneCfg.icon} size=\"md\" shape=\"square\" />}\n\t\t\t\t<Stack gap=\"md\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack gap=\"normal\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\">{title}</Text>\n\t\t\t\t\t{!!description && (\n\t\t\t\t\t\t<Text type=\"secondary\">\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t{!!details && <div className=\"ai-confirmation--details min-w-0\">{details}</div>}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{status === 'pending' ? (\n\t\t\t\t<div className=\"ai-confirmation--footer flex flex-col items-stretch gap-space-md @sm/card:flex-row @sm/card:items-center @sm/card:justify-between\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.pending}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap={compositionRhythm.commands} className=\"ai-confirmation--actions\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\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={onReject}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{rejectLabel ?? strings.reject}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone={tone === 'destructive' ? 'destructive' : 'primary'}\n\t\t\t\t\t\t\tonClick={onApprove}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{approveLabel ?? strings.approve}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<div className=\"ai-confirmation--footer flex items-center gap-space-md\">\n\t\t\t\t\t{status === 'approved' ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Check aria-hidden=\"true\" className=\"size-icon-md text-success\" />\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"success\" weight=\"medium\">\n\t\t\t\t\t\t\t\t{strings.approved}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<X aria-hidden=\"true\" className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" weight=\"medium\">\n\t\t\t\t\t\t\t\t{strings.rejected}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nAiConfirmation.displayName = 'AiConfirmation';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface AiSourceItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Surface title. */\n\ttitle: ReactNode;\n\turl?: string;\n\t/** Hostname / publisher / \"doc-section\" — rendered under the title. */\n\tpublisher?: string;\n\t/** Favicon / logo URL — rendered as a small avatar; falls back to a globe. */\n\tfaviconUrl?: string;\n\t/** Optional short snippet shown only in the expanded variant. */\n\tsnippet?: ReactNode;\n}\n\nexport interface AiSourcesStrings {\n\t/** Header title — `{{count}}` placeholder for the source count. */\n\ttitle: string;\n\texpand: string;\n\tcollapse: string;\n\tvisit: string;\n}\n\nexport const defaultAiSourcesStrings: AiSourcesStrings = {\n\ttitle: '{{count}} sources',\n\texpand: 'Show all sources',\n\tcollapse: 'Hide sources',\n\tvisit: 'Visit source',\n};\n\nexport type AiSourcesVariant = 'list' | 'avatars';\n\nexport interface AiSourcesProps {\n\t/** Source list. Order is significant — index drives the displayed number. */\n\tsources: ReadonlyArray<AiSourceItem>;\n\t/** `list` is a vertical row layout; `avatars` is a stacked-favicons strip. */\n\tvariant?: AiSourcesVariant;\n\t/** Number of sources rendered in the avatar strip before the \"+N\" overflow. */\n\tmaxAvatars?: number;\n\t/** Expanded state, for controlled use in the list variant. */\n\texpanded?: boolean;\n\t/** Render the list expanded by default (only applies to `list` variant). */\n\tdefaultExpanded?: boolean;\n\t/** Fired whenever the disclosure state changes. */\n\tonExpandedChange?: (expanded: boolean) => void;\n\t/** Click handler — preferred over `url` for SPA routing. */\n\tonSelect?: (source: AiSourceItem, index: number) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiSourcesStrings>;\n}\n","/**\n * AiSources — light-weight source list rendered under streamed content. Two\n * shapes: `list` is a vertical stack of source rows (favicon + title + host);\n * `avatars` is a compact stacked-favicon strip used when space is tight (chat\n * footer, side panel header). For richer \"expandable\" footnote-style sources\n * with relevance bars and snippets, see `<AiCitation>`.\n */\nimport { useEffect, useState } from 'react';\nimport { ChevronDown, ChevronRight, ExternalLink, Globe } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { mergeStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultAiSourcesStrings, type AiSourceItem, type AiSourcesProps } from './types';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { IconBadge } from '../../../base/display';\n\nfunction interpolate(template: string, params: Record<string, string | number>): string {\n\treturn template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (m, k) => {\n\t\tconst v = params[k];\n\t\treturn v === undefined ? m : String(v);\n\t});\n}\n\nexport function AiSources({\n\tsources,\n\tvariant = 'list',\n\tmaxAvatars = 5,\n\texpanded: expandedProp,\n\tdefaultExpanded = false,\n\tonExpandedChange,\n\tonSelect,\n\tclassName,\n\tstrings: stringsProp,\n}: AiSourcesProps) {\n\tconst strings = mergeStrings(defaultAiSourcesStrings, stringsProp);\n\tconst [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n\tconst expanded = expandedProp ?? internalExpanded;\n\tconst setExpanded = (next: boolean) => {\n\t\tif (expandedProp === undefined) setInternalExpanded(next);\n\t\tonExpandedChange?.(next);\n\t};\n\tconst titleText = interpolate(strings.title, { count: sources.length });\n\n\tif (variant === 'avatars') {\n\t\treturn (\n\t\t\t<AvatarStrip\n\t\t\t\tsources={sources}\n\t\t\t\tmax={maxAvatars}\n\t\t\t\ttitle={titleText}\n\t\t\t\tvisitLabel={strings.visit}\n\t\t\t\tonSelect={onSelect}\n\t\t\t\tclassName={cn('ai-sources--component', className)}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst visible = expanded ? sources : sources.slice(0, 0);\n\n\t// The public Card owns the frame; the trigger and list own their compact insets.\n\treturn (\n\t\t<Card surface=\"card\" padding=\"none\" className={cn('ai-sources--component', className)}>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\tsize=\"md\"\n\t\t\t\tonClick={() => setExpanded(!expanded)}\n\t\t\t\taria-expanded={expanded}\n\t\t\t\taria-label={expanded ? strings.collapse : strings.expand}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'ai-sources--trigger h-auto min-h-0 w-full justify-start gap-space-md px-surface-xs py-row-y text-left',\n\t\t\t\t\t`rounded-radius ${interactionRecipes.rowHover}`,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<AvatarStack sources={sources.slice(0, 4)} />\n\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"flex-1\">\n\t\t\t\t\t{titleText}\n\t\t\t\t</Text>\n\t\t\t\t{expanded ? (\n\t\t\t\t\t<ChevronDown className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t) : (\n\t\t\t\t\t<ChevronRight className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t)}\n\t\t\t</Button>\n\n\t\t\t{expanded && (\n\t\t\t\t<div className=\"ai-sources--list border-t border-border/60 px-surface-xs py-row-y\">\n\t\t\t\t\t<Stack render={<ol />} gap=\"2xs\" className=\"m-0 list-none p-0 font-sans\">\n\t\t\t\t\t\t{visible.map((source, idx) => (\n\t\t\t\t\t\t\t<SourceRow\n\t\t\t\t\t\t\t\tkey={source.id}\n\t\t\t\t\t\t\t\tsource={source}\n\t\t\t\t\t\t\t\tindex={idx + 1}\n\t\t\t\t\t\t\t\tonSelect={onSelect ? () => onSelect(source, idx) : undefined}\n\t\t\t\t\t\t\t\tvisitLabel={strings.visit}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nAiSources.displayName = 'AiSources';\n\nfunction AvatarStrip({\n\tsources,\n\tmax,\n\ttitle,\n\tvisitLabel,\n\tonSelect,\n\tclassName,\n}: {\n\tsources: ReadonlyArray<AiSourceItem>;\n\tmax: number;\n\ttitle: string;\n\tvisitLabel: string;\n\tonSelect?: (source: AiSourceItem, index: number) => void;\n\tclassName?: string;\n}) {\n\tconst visible = sources.slice(0, max);\n\tconst overflow = sources.length - visible.length;\n\treturn (\n\t\t<div className={cn('inline-flex items-center gap-space-md', className)}>\n\t\t\t<AvatarStack sources={visible} onSelect={onSelect} visitLabel={visitLabel} overflow={overflow} />\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{title}\n\t\t\t</Text>\n\t\t</div>\n\t);\n}\n\nfunction AvatarStack({\n\tsources,\n\tonSelect,\n\tvisitLabel,\n\toverflow = 0,\n}: {\n\tsources: ReadonlyArray<AiSourceItem>;\n\tonSelect?: (source: AiSourceItem, index: number) => void;\n\tvisitLabel?: string;\n\t/** Sources beyond the visible avatars, counted as the stack's last disc. */\n\toverflow?: number;\n}) {\n\treturn (\n\t\t<div className={cn('flex items-center', onSelect ? 'gap-space-2xs' : '-space-x-space-sm')}>\n\t\t\t{sources.map((s, i) => {\n\t\t\t\tconst visual = (\n\t\t\t\t\t<span\n\t\t\t\t\t\tkey={s.id}\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\ttitle={typeof s.title === 'string' ? s.title : undefined}\n\t\t\t\t\t\tclassName=\"inline-flex size-icon-lg items-center justify-center overflow-hidden rounded-full border border-card bg-muted text-muted-foreground ring-1 ring-border/60\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<SourceFavicon src={s.faviconUrl} />\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t\tif (onSelect) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tkey={s.id}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={() => onSelect(s, i)}\n\t\t\t\t\t\t\taria-label={typeof s.title === 'string' ? `${visitLabel}: ${s.title}` : visitLabel}\n\t\t\t\t\t\t\tclassName={`${interactionRecipes.nativeButtonReset} inline-flex size-action-xs shrink-0 items-center justify-center rounded-radius focus-visible:outline-none ${focusRecipes.edge}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{visual}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn visual;\n\t\t\t})}\n\t\t\t{/* The hidden count belongs to the stack it extends, not to the label after it. */}\n\t\t\t{overflow > 0 && (\n\t\t\t\t<span className=\"ai-sources--overflow inline-flex size-icon-lg items-center justify-center overflow-hidden rounded-full border border-card bg-muted text-muted-foreground ring-1 ring-border/60\">\n\t\t\t\t\t<SecondaryValue size=\"xxs\" className=\"tabular-nums\">\n\t\t\t\t\t\t+\n\t\t\t\t\t\t<NumberValue value={overflow} size=\"xxs\" type=\"secondary\" align=\"left\" />\n\t\t\t\t\t</SecondaryValue>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction SourceFavicon({ src }: { src?: string }) {\n\tconst [failed, setFailed] = useState(false);\n\n\tuseEffect(() => {\n\t\tsetFailed(false);\n\t}, [src]);\n\n\tif (!src || failed) {\n\t\treturn <Globe className=\"size-icon-sm\" />;\n\t}\n\n\treturn <img src={src} alt=\"\" className=\"size-full object-cover\" onError={() => setFailed(true)} />;\n}\n\nfunction SourceRow({\n\tsource,\n\tindex,\n\tonSelect,\n\tvisitLabel,\n}: {\n\tsource: AiSourceItem;\n\tindex: number;\n\tonSelect?: () => void;\n\tvisitLabel: string;\n}) {\n\tconst interactive = Boolean(source.url || onSelect);\n\tconst rowClassName = cn(\n\t\tinteractionRecipes.nativeButtonReset,\n\t\t'group flex w-full items-start gap-space-lg rounded-radius px-row-x py-row-y-sm text-left text-foreground',\n\t\tinteractive && `${interactionRecipes.rowHover} focus-visible:outline-none ${focusRecipes.edge}`,\n\t);\n\tconst rowContent = (\n\t\t<>\n\t\t\t{/* The source number stays readable: it is how a citation names its source. */}\n\t\t\t<IconBadge tone=\"neutral\" size=\"sm\" aria-hidden={false} className=\"shrink-0\">\n\t\t\t\t<NumberValue value={index} size=\"xs\" weight=\"semibold\" type=\"secondary\" align=\"center\" />\n\t\t\t</IconBadge>\n\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t{source.title}\n\t\t\t\t\t{!!source.url && (\n\t\t\t\t\t\t<ExternalLink className=\"ml-1 inline size-icon-sm text-muted-foreground align-baseline\" />\n\t\t\t\t\t)}\n\t\t\t\t</Text>\n\t\t\t\t{!!source.publisher && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t{source.publisher}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t{!!source.snippet && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"line-clamp-2\">\n\t\t\t\t\t\t{source.snippet}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<li>\n\t\t\t{source.url && !onSelect ? (\n\t\t\t\t<TextLink\n\t\t\t\t\thref={source.url}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\tunderline={false}\n\t\t\t\t\tclassName={rowClassName}\n\t\t\t\t\taria-label={visitLabel}\n\t\t\t\t>\n\t\t\t\t\t{rowContent}\n\t\t\t\t</TextLink>\n\t\t\t) : onSelect ? (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={onSelect}\n\t\t\t\t\tclassName={cn(rowClassName, 'h-auto justify-start whitespace-normal')}\n\t\t\t\t\taria-label={source.url ? visitLabel : undefined}\n\t\t\t\t>\n\t\t\t\t\t{rowContent}\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<span className={rowClassName}>{rowContent}</span>\n\t\t\t)}\n\t\t</li>\n\t);\n}\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface AiReasoningStrings {\n\t/** Header label when collapsed and reasoning is in progress. */\n\tthinking: string;\n\t/** Header label when reasoning is complete. Use `{{duration}}` for the formatted elapsed time. */\n\tthoughtFor: string;\n\t/** Header label when no duration is available. */\n\tthoughtDone: string;\n\texpandAria: string;\n\tcollapseAria: string;\n}\n\nexport const defaultAiReasoningStrings: AiReasoningStrings = {\n\tthinking: 'Thinking…',\n\tthoughtFor: 'Thought for {{duration}}',\n\tthoughtDone: 'Reasoning complete',\n\texpandAria: 'Expand reasoning',\n\tcollapseAria: 'Collapse reasoning',\n};\n\nexport interface AiReasoningProps {\n\t/** Reasoning trace — typically streamed plaintext. */\n\tchildren?: ReactNode;\n\t/** Show the live \"Thinking…\" header with shimmer. */\n\tstreaming?: boolean;\n\t/** Total elapsed time in seconds — shown in the collapsed-done header. */\n\tdurationSeconds?: number;\n\t/** Auto-expand while streaming. */\n\texpandWhileStreaming?: boolean;\n\t/** Initial expanded state. */\n\tdefaultExpanded?: boolean;\n\t/** Controlled expanded state. */\n\texpanded?: boolean;\n\tonExpandedChange?: (expanded: boolean) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiReasoningStrings>;\n}\n","/**\n * AiReasoning — collapsible \"thinking\" trace shown above the assistant's\n * final answer. While `streaming` is true the header runs the shimmer label\n * and the body is auto-expanded; once streaming ends, the header switches\n * to a localized duration summary and the body collapses to a peek.\n *\n * Accept the trace as `children` so the consumer can stream raw text, JSX\n * blocks (substeps, code), or Markdown via their own renderer.\n */\nimport { useEffect, useState, type ReactNode } from 'react';\nimport { Brain, ChevronDown, ChevronRight } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Duration } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AiShimmer } from '../ai-shimmer/ai-shimmer';\nimport { defaultAiReasoningStrings, type AiReasoningProps } from './types';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\n\nfunction renderThoughtFor(template: string, seconds: number): ReactNode {\n\tconst durationParts = template.split(/\\{\\{\\s*duration\\s*\\}\\}/);\n\tif (durationParts.length === 1) return template;\n\n\treturn (\n\t\t<>\n\t\t\t{durationParts[0]}\n\t\t\t<Duration value={seconds} maxParts={1} align=\"left\" />\n\t\t\t{durationParts.slice(1).join('{{duration}}')}\n\t\t</>\n\t);\n}\n\nexport function AiReasoning({\n\tchildren,\n\tstreaming = false,\n\tdurationSeconds,\n\texpandWhileStreaming = true,\n\tdefaultExpanded = false,\n\texpanded: expandedProp,\n\tonExpandedChange,\n\tclassName,\n\tstrings: stringsProp,\n}: AiReasoningProps) {\n\tconst strings = useStrings(defaultAiReasoningStrings, stringsProp);\n\tconst [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n\tconst expanded = expandedProp ?? internalExpanded;\n\tconst setExpanded = (next: boolean) => {\n\t\tif (expandedProp === undefined) setInternalExpanded(next);\n\t\tonExpandedChange?.(next);\n\t};\n\n\tuseEffect(() => {\n\t\tif (streaming && expandWhileStreaming && !expanded) {\n\t\t\tsetExpanded(true);\n\t\t}\n\t\tif (!streaming && expandWhileStreaming && expanded && !defaultExpanded && expandedProp === undefined) {\n\t\t\t// auto-collapse only once when streaming flips off and consumer hasn't pinned state\n\t\t\tsetExpanded(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [streaming]);\n\n\tconst headerLabel: ReactNode = streaming ? (\n\t\t<AiShimmer className=\"flex-1\">{strings.thinking}</AiShimmer>\n\t) : durationSeconds !== undefined ? (\n\t\t<Text type=\"inherit\" weight=\"medium\" className=\"flex-1\">\n\t\t\t{renderThoughtFor(strings.thoughtFor, durationSeconds)}\n\t\t</Text>\n\t) : (\n\t\t<Text type=\"inherit\" weight=\"medium\" className=\"flex-1\">\n\t\t\t{strings.thoughtDone}\n\t\t</Text>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('ai-reasoning--component', \n\t\t\t\t'overflow-hidden rounded-radius border border-border/60 bg-muted/30',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\tsize=\"md\"\n\t\t\t\tonClick={() => setExpanded(!expanded)}\n\t\t\t\taria-expanded={expanded}\n\t\t\t\taria-label={expanded ? strings.collapseAria : strings.expandAria}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'ai-reasoning--trigger h-auto min-h-0 w-full justify-start gap-space-md rounded-none px-surface-xs py-row-y text-left',\n\t\t\t\t\tinteractionRecipes.rowHover,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<Brain className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t{headerLabel}\n\t\t\t\t{expanded ? (\n\t\t\t\t\t<ChevronDown className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t) : (\n\t\t\t\t\t<ChevronRight className=\"size-icon-md text-muted-foreground\" />\n\t\t\t\t)}\n\t\t\t</Button>\n\n\t\t\t{expanded && (\n\t\t\t\t<div className=\"ai-reasoning--body border-t border-border/60 p-surface-xs\">\n\t\t\t\t\t{typeof children === 'string' ? (\n\t\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"whitespace-pre-wrap\">\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"whitespace-pre-wrap\">{children}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiReasoning.displayName = 'AiReasoning';\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiChainStepStatus = 'pending' | 'active' | 'completed' | 'failed';\n\nexport interface AiChainStep {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Surface title. */\n\ttitle: ReactNode;\n\t/** Optional rationale rendered under the title. */\n\tdescription?: ReactNode;\n\t/** Step status — drives the marker style. */\n\tstatus?: AiChainStepStatus;\n\t/** Custom icon override for the step marker. */\n\ticon?: LucideIcon;\n\t/** Free-form children rendered inside the step body (substeps, code, …). */\n\tbody?: ReactNode;\n}\n\nexport interface AiChainOfThoughtStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tstreamingHint: string;\n}\n\nexport const defaultAiChainOfThoughtStrings: AiChainOfThoughtStrings = {\n\ttitle: 'Reasoning',\n\tstreamingHint: 'Working through the steps…',\n};\n\nexport interface AiChainOfThoughtProps {\n\t/** Step list — order is significant. */\n\tsteps: ReadonlyArray<AiChainStep>;\n\t/** Hide the header strip. */\n\thideHeader?: boolean;\n\t/** Show the streaming hint under the header. */\n\tstreaming?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChainOfThoughtStrings>;\n}\n","/**\n * AiChainOfThought — vertical timeline of reasoning steps an agent took (or\n * is taking) to reach a conclusion. Status-aware markers; per-step body slot\n * for nested content (tool calls, code, sub-steps). Pair with `AiReasoning`\n * (free-form trace) when the model emits structured plan steps.\n */\nimport { AlertCircle, Check, Circle, Loader2, type LucideIcon } from 'lucide-react';\nimport { Card } from '../../../base/cards';\nimport { IconBadge, type IconBadgeTone } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AiShimmer } from '../ai-shimmer/ai-shimmer';\nimport {\n\tdefaultAiChainOfThoughtStrings,\n\ttype AiChainOfThoughtProps,\n\ttype AiChainStepStatus,\n} from './types';\n\n// Each status is one IconBadge recipe: pending is a quiet neutral disc, the\n// active step takes the primary tint, and settled steps fill solid.\nconst STATUS_VISUAL: Record<\n\tAiChainStepStatus,\n\t{ icon: LucideIcon; tone: IconBadgeTone; solid?: boolean; spin?: boolean }\n> = {\n\tpending: { icon: Circle, tone: 'neutral' },\n\tactive: { icon: Loader2, tone: 'primary', spin: true },\n\tcompleted: { icon: Check, tone: 'success', solid: true },\n\tfailed: { icon: AlertCircle, tone: 'destructive', solid: true },\n};\n\nexport function AiChainOfThought({\n\tsteps,\n\thideHeader = false,\n\tstreaming = false,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChainOfThoughtProps) {\n\tconst strings = useStrings(defaultAiChainOfThoughtStrings, stringsProp);\n\n\treturn (\n\t\t// The public Card owns the frame and its one inset; the header flows into\n\t\t// the steps by the Stack gap rather than sitting on a rule of its own.\n\t\t<Card surface=\"card\" className={cn('ai-chain-of-thought--component', className)}>\n\t\t\t<Stack gap=\"lg\">\n\t\t\t{!hideHeader && (\n\t\t\t\t<div className=\"ai-chain-of-thought--header\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.title}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t{streaming && (\n\t\t\t\t\t\t<AiShimmer size=\"xs\" className=\"ml-auto\">\n\t\t\t\t\t\t\t{strings.streamingHint}\n\t\t\t\t\t\t</AiShimmer>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<ol className=\"ai-chain-of-thought--body m-0 list-none p-0 font-sans\">\n\t\t\t\t{steps.map((step, idx) => {\n\t\t\t\t\tconst status: AiChainStepStatus = step.status ?? 'pending';\n\t\t\t\t\tconst visual = STATUS_VISUAL[status];\n\t\t\t\t\tconst Icon = step.icon ?? visual.icon;\n\t\t\t\t\tconst isLast = idx === steps.length - 1;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={step.id} className=\"ai-chain-of-thought--step flex gap-space-lg\">\n\t\t\t\t\t\t\t{/* The marker column stretches to the step's full height, so the\n\t\t\t\t\t\t\t rail runs from this disc to the next one whatever the disc size. */}\n\t\t\t\t\t\t\t<span aria-hidden className=\"ai-chain-of-thought--marker flex shrink-0 flex-col items-center\">\n\t\t\t\t\t\t\t\t<IconBadge tone={visual.tone} solid={visual.solid} size=\"sm\">\n\t\t\t\t\t\t\t\t\t<Icon className={cn(visual.spin && 'animate-spin')} />\n\t\t\t\t\t\t\t\t</IconBadge>\n\t\t\t\t\t\t\t\t{!isLast && <span className=\"ai-chain-of-thought--rail w-px flex-1 bg-border/60\" />}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{/* The step's bottom inset is the space the rail crosses to the next disc. */}\n\t\t\t\t\t\t\t<Stack gap=\"md\" className={cn('min-w-0 flex-1', !isLast && 'pb-space-lg')}>\n\t\t\t\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tweight={status === 'active' ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\t\ttype={status === 'pending' ? 'secondary' : 'inherit'}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{step.title}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{!!step.description && (\n\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t{step.description}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t{!!step.body && (\n\t\t\t\t\t\t\t\t\t<div className=\"ai-chain-of-thought--step-body min-w-0\">{step.body}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nAiChainOfThought.displayName = 'AiChainOfThought';\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AiTaskStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'skipped';\n\nexport interface AiTaskItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Surface title. */\n\ttitle: ReactNode;\n\t/** Status — drives the marker pill and icon. */\n\tstatus?: AiTaskStatus;\n\t/** Optional sub-task list rendered nested. */\n\tchildren?: ReadonlyArray<AiTaskItem>;\n\t/** Decorative icon override. */\n\ticon?: LucideIcon;\n\t/** Right-aligned slot — duration, byte count, etc. */\n\trightSlot?: ReactNode;\n\t/** Free-form body rendered under the title (logs, code, …). */\n\tbody?: ReactNode;\n}\n\nexport interface AiTaskStrings {\n\tstatusLabels: Record<AiTaskStatus, string>;\n\tcollapseSubtasks: string;\n\texpandSubtasks: string;\n}\n\nexport const defaultAiTaskStrings: AiTaskStrings = {\n\tstatusLabels: {\n\t\tqueued: 'Queued',\n\t\trunning: 'Running',\n\t\tcompleted: 'Done',\n\t\tfailed: 'Failed',\n\t\tcancelled: 'Cancelled',\n\t\tskipped: 'Skipped',\n\t},\n\tcollapseSubtasks: 'Collapse subtasks',\n\texpandSubtasks: 'Expand subtasks',\n};\n\nexport interface AiTaskProps {\n\t/** Top-level task. */\n\ttask: AiTaskItem;\n\t/** Compact = single row with collapsible children; expanded = always show. */\n\tdensity?: 'compact' | 'expanded';\n\t/** Indentation width per nesting level (px). */\n\tindent?: number;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiTaskStrings>;\n}\n","/**\n * AiTask — single task (with optional sub-tasks) used by agent surfaces to\n * surface long-running plans: scaffolding, package installs, multi-file\n * edits. Each row carries a status marker, a title, and optional body /\n * right-slot. Children render nested under the parent and are auto-\n * collapsed by default in the `compact` density.\n */\nimport { useState } from 'react';\nimport {\n\tAlertCircle,\n\tCheck,\n\tChevronDown,\n\tChevronRight,\n\tCircle,\n\tLoader2,\n\tMinusCircle,\n\tXCircle,\n\ttype LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiTaskStrings,\n\ttype AiTaskItem,\n\ttype AiTaskProps,\n\ttype AiTaskStatus,\n} from './types';\n\nconst STATUS_ICON: Record<AiTaskStatus, { icon: LucideIcon; cls: string; spin?: boolean }> = {\n\tqueued: { icon: Circle, cls: 'text-muted-foreground' },\n\trunning: { icon: Loader2, cls: 'text-primary-accent', spin: true },\n\tcompleted: { icon: Check, cls: 'text-success' },\n\tfailed: { icon: AlertCircle, cls: 'text-destructive' },\n\tcancelled: { icon: XCircle, cls: 'text-muted-foreground' },\n\tskipped: { icon: MinusCircle, cls: 'text-muted-foreground' },\n};\n\n// A running task states a live status (info); primary is reserved for the main command.\nconst STATUS_VARIANT: Record<\n\tAiTaskStatus,\n\t'secondary' | 'info' | 'success' | 'destructive' | 'warning'\n> = {\n\tqueued: 'secondary',\n\trunning: 'info',\n\tcompleted: 'success',\n\tfailed: 'destructive',\n\tcancelled: 'secondary',\n\tskipped: 'secondary',\n};\n\nexport function AiTask({\n\ttask,\n\tdensity = 'compact',\n\tindent = 18,\n\tclassName,\n\tstrings: stringsProp,\n}: AiTaskProps) {\n\tconst strings = useStrings(defaultAiTaskStrings, stringsProp);\n\tconst columns = { status: someItem(task, (item) => hasStatusBadge(item.status ?? 'queued')), slot: someItem(task, (item) => item.rightSlot != null && item.rightSlot !== false) };\n\t// The public Card owns the frame; rows own their own inset, so the card adds none.\n\t// Every row is a subgrid of one task grid, so the status badges and the trailing\n\t// slot (duration, size) each keep one column edge whatever their siblings hold.\n\treturn (\n\t\t<Card surface=\"card\" padding=\"none\" className={cn('ai-task--component', className)}>\n\t\t\t<div className={cn('ai-task--rows grid gap-x-space-md', TRAILING_COLUMNS[Number(columns.status) + Number(columns.slot)])}>\n\t\t\t\t<TaskRow\n\t\t\t\t\titem={task}\n\t\t\t\t\tdepth={0}\n\t\t\t\t\tdensity={density}\n\t\t\t\t\tindent={indent}\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tstrings={strings}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Card>\n\t);\n}\n\n/** The status glyph already states a finished row; only other states add a badge. */\nfunction hasStatusBadge(status: AiTaskStatus): boolean {\n\treturn status !== 'completed';\n}\n\nfunction someItem(item: AiTaskItem, test: (item: AiTaskItem) => boolean): boolean {\n\treturn test(item) || !!item.children?.some((child) => someItem(child, test));\n}\n\nconst TRAILING_COLUMNS = ['grid-cols-1', 'grid-cols-[minmax(0,1fr)_auto]', 'grid-cols-[minmax(0,1fr)_auto_auto]'] as const;\n\nAiTask.displayName = 'AiTask';\n\nfunction TaskRow({\n\titem,\n\tdepth,\n\tdensity,\n\tindent,\n\tcolumns,\n\tstrings,\n}: {\n\titem: AiTaskItem;\n\tdepth: number;\n\tdensity: 'compact' | 'expanded';\n\tindent: number;\n\tcolumns: { status: boolean; slot: boolean };\n\tstrings: ReturnType<typeof useStrings<typeof defaultAiTaskStrings>>;\n}) {\n\tconst status: AiTaskStatus = item.status ?? 'queued';\n\tconst visual = STATUS_ICON[status];\n\tconst Icon = item.icon ?? visual.icon;\n\tconst hasChildren = !!item.children?.length;\n\tconst [open, setOpen] = useState(density === 'expanded' || depth === 0 ? true : false);\n\n\t// Muted rows read secondary through the Text role; a cancelled title is also struck through.\n\tconst mutedTitle = status === 'queued' || status === 'cancelled' || status === 'skipped';\n\n\treturn (\n\t\t<>\n\t\t\t{/* The row spans the task grid: a lead cell, then the shared status and\n\t\t\t trailing-slot columns. The lead keeps two tracks (disclosure + status\n\t\t\t glyph, then title) and the body sits under the title. Every first line\n\t\t\t reserves the disclosure height, so the trailing cells centre on it. */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'ai-task--row col-span-full grid grid-cols-subgrid items-start px-row-x py-row-y',\n\t\t\t\t\tdepth > 0 && 'border-t border-border/60',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"ai-task--lead grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-space-md gap-y-space-md\"\n\t\t\t\t\tstyle={depth > 0 ? { paddingInlineStart: `${depth * indent}px` } : undefined}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"ai-task--marker flex min-h-action-sm items-center gap-space-md\">\n\t\t\t\t\t\t{hasChildren ? (\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\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\t\t\tonClick={() => setOpen((v) => !v)}\n\t\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\t\taria-label={open ? strings.collapseSubtasks : strings.expandSubtasks}\n\t\t\t\t\t\t\t\tclassName=\"ai-task--toggle\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{open ? (\n\t\t\t\t\t\t\t\t\t<ChevronDown aria-hidden=\"true\" className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<ChevronRight aria-hidden=\"true\" className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// Nested leaves keep the disclosure track so sibling status glyphs align.\n\t\t\t\t\t\t\tdepth > 0 && <span aria-hidden className=\"w-action-sm shrink-0\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\tclassName={cn('size-icon-md shrink-0', visual.cls, visual.spin && 'animate-spin')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tweight={status === 'running' ? 'semibold' : 'medium'}\n\t\t\t\t\t\ttype={mutedTitle ? 'secondary' : 'inherit'}\n\t\t\t\t\t\tclassName={cn('ai-task--title min-w-0 truncate', status === 'cancelled' && 'line-through')}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.title}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!item.body && <div className=\"ai-task--body col-start-2 min-w-0\">{item.body}</div>}\n\t\t\t\t</div>\n\t\t\t\t{columns.status && (\n\t\t\t\t\t<span className=\"ai-task--status flex min-h-action-sm items-center justify-end\">\n\t\t\t\t\t\t{hasStatusBadge(status) ? (\n\t\t\t\t\t\t\t<Badge tone={STATUS_VARIANT[status]}>\n\t\t\t\t\t\t\t\t{strings.statusLabels[status]}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"sr-only\">{strings.statusLabels[status]}</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{!columns.status && !hasStatusBadge(status) && (\n\t\t\t\t\t<span className=\"sr-only\">{strings.statusLabels[status]}</span>\n\t\t\t\t)}\n\t\t\t\t{columns.slot && (\n\t\t\t\t\t<span className=\"ai-task--slot flex min-h-action-sm items-center justify-end tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t{item.rightSlot}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{hasChildren && open && (\n\t\t\t\t<div className=\"ai-task--children col-span-full grid grid-cols-subgrid\">\n\t\t\t\t\t{item.children!.map((child) => (\n\t\t\t\t\t\t<TaskRow\n\t\t\t\t\t\t\tkey={child.id}\n\t\t\t\t\t\t\titem={child}\n\t\t\t\t\t\t\tdepth={depth + 1}\n\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\tindent={indent}\n\t\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface AiArtifactStrings {\n\topenAria: string;\n\tcopy: string;\n\tcopied: string;\n\tcopyAria: string;\n /** Failure feedback, additive for existing string dictionaries. */\n copyError?: string;\n\tdownloadAria: string;\n\texpandAria: string;\n}\n\nexport const defaultAiArtifactStrings: AiArtifactStrings = {\n\topenAria: 'Open artifact',\n\tcopy: 'Copy',\n\tcopied: 'Copied',\n copyError: 'Could not copy. Please try again.',\n\tcopyAria: 'Copy artifact',\n\tdownloadAria: 'Download artifact',\n\texpandAria: 'Expand artifact',\n};\n\nexport interface AiArtifactAction {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Fired when an entry is activated. */\n\tonSelect?: () => void;\n}\n\nexport interface AiArtifactProps {\n\t/** Title — typically the artifact name (e.g. \"App.tsx\", \"design-spec.md\"). */\n\ttitle: ReactNode;\n\t/** Subtitle — typically the kind / language (\"React component\", \"Markdown\"). */\n\tsubtitle?: ReactNode;\n\t/** Icon override for the leading badge. */\n\ticon?: LucideIcon;\n\t/** Plain text content used by the default copy action. */\n\tcopyText?: string;\n\t/** Body content — preview, code, sandbox iframe, etc. */\n\tchildren?: ReactNode;\n\t/** Hide the body and render the artifact as a clickable preview-only chip. */\n\tcollapsed?: boolean;\n\t/** Click handler for the whole header (e.g. open in side panel). */\n\tonOpen?: () => void;\n\t/** Custom actions in the header. */\n\tactions?: ReadonlyArray<AiArtifactAction>;\n\t/** Provide a download handler — adds a download button. */\n\tonDownload?: () => void;\n\t/** Merged onto the outermost node. */\n\t/** Called when the clipboard is unavailable or the write fails. */\n onCopyError?: (error: unknown) => void;\n className?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiArtifactStrings>;\n}\n","import { useCopyFeedback } from '../use-copy-feedback';\n/**\n * AiArtifact — generic shell for a model-produced asset (code file, document,\n * design spec, sandbox preview, …). Header carries a leading icon, title /\n * subtitle, and an action toolbar (open, copy, download, custom actions).\n * Body slot accepts the preview itself: `<AiCodeBlock>`, an `<iframe>`, an\n * `<AiPackageInfo>`, etc.\n */\n\nimport {\n\tCheck,\n\tCopy,\n\tDownload,\n\tExternalLink,\n\tFileText,\n\ttype LucideIcon,\n\t} from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { IconBadge,\n} from '../../../base/display';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultAiArtifactStrings, type AiArtifactProps } from './types';\n\nexport function AiArtifact({\n\ttitle,\n\tsubtitle,\n\ticon,\n\tcopyText,\n\tchildren,\n\tcollapsed = false,\n\tonOpen,\n\tactions,\n\tonDownload,\n\tonCopyError,\n\tclassName,\n\tstrings: stringsProp,\n}: AiArtifactProps) {\n\tconst strings = useStrings(defaultAiArtifactStrings, stringsProp);\n\tconst Icon: LucideIcon = icon ?? FileText;\n\tconst { copied, failed, copy } = useCopyFeedback(onCopyError, copyText);\n\n\tconst handleCopy = async () => {\n\t\tif (copyText) await copy(copyText);\n\t};\n\n\treturn (\n\t\t// The public Card owns the frame; the header band and the flush preview body\n\t\t// own their own insets, so the card adds none.\n\t\t<Card surface=\"card\" padding=\"none\" className={cn('ai-artifact--component', className)}>\n\t\t\t<div className=\"ai-artifact--header @container/ai-artifact-header border-b border-border/60 bg-muted/50 p-surface\">\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"lg\">\n\t\t\t\t<div className=\"ai-artifact--identity flex min-w-0 basis-full items-center gap-space-lg @sm/ai-artifact-header:flex-1 @sm/ai-artifact-header:basis-0\">\n\t\t\t\t<IconBadge icon={Icon} tone=\"neutral\" size=\"md\" shape=\"square\" />\n\t\t\t\t<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"break-words\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!subtitle && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"break-words\">\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"ai-artifact--actions flex flex-wrap items-center gap-space-xs\">\n\t\t\t\t\t{actions?.map((action) => {\n\t\t\t\t\t\tconst ActionIcon = action.icon;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tkey={action.id}\n\t\t\t\t\t\t\t\ttype=\"button\"\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\tonClick={action.onSelect}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!!ActionIcon && <ActionIcon className=\"size-icon-md\" />}\n\t\t\t\t\t\t\t\t{action.label}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t\t{!!copyText && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\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\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.copyAria}\n\t\t\t\t\t\t\tonClick={handleCopy}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{copied ? (\n\t\t\t\t\t\t\t\t<Check className=\"size-icon-md text-success\" />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Copy className=\"size-icon-md\" />\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{!!onDownload && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\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\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.downloadAria}\n\t\t\t\t\t\t\tonClick={onDownload}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Download className=\"size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onOpen && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\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\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.openAria}\n\t\t\t\t\t\t\tonClick={onOpen}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ExternalLink className=\"size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t\t</div>\n\t\t\t{/* The artifact card is the frame: a direct code preview joins it flush\n\t\t\t (joined-edge reset) instead of drawing a second bordered box inside. */}\n\t\t\t{!collapsed && !!children && <div className=\"ai-artifact--body min-w-0 [&>.code-block--component]:rounded-none [&>.code-block--component]:border-0\">{children}</div>}\n\n\t\t\t{failed && <div className=\"px-control py-row-y\"><Text role=\"alert\" size=\"xs\" type=\"error\">{strings.copyError ?? defaultAiArtifactStrings.copyError}</Text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