themelia-react-ui 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/CHANGELOG.md +317 -131
  2. package/README.md +25 -9
  3. package/THIRD_PARTY_NOTICES.md +7 -0
  4. package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
  5. package/dist/accordion-Cjb6sx0G.js.map +1 -0
  6. package/dist/action-menu-CllU52Mm.js +280 -0
  7. package/dist/action-menu-CllU52Mm.js.map +1 -0
  8. package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
  9. package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
  10. package/dist/ai-artifact-DvTwDVyL.js +1148 -0
  11. package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
  12. package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
  13. package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
  14. package/dist/attachment-BxDfL2mw.js +246 -0
  15. package/dist/attachment-BxDfL2mw.js.map +1 -0
  16. package/dist/{auth-CYxKfo69.js → auth-BGua8ouh.js} +58 -54
  17. package/dist/auth-BGua8ouh.js.map +1 -0
  18. package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
  19. package/dist/avatar-DAPlDvhJ.js.map +1 -0
  20. package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
  21. package/dist/badge-HpFqoqSY.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +40 -36
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +92 -92
  33. package/dist/base/cascader.js.map +1 -1
  34. package/dist/base/chart.js +1 -1
  35. package/dist/base/choice-inputs.js +2 -2
  36. package/dist/base/code-block.js +1 -1
  37. package/dist/base/combobox.js +2 -2
  38. package/dist/base/command.js +1 -1
  39. package/dist/base/copyable.js +1 -1
  40. package/dist/base/date-pickers.js +2 -2
  41. package/dist/base/display.js +6 -6
  42. package/dist/base/feedback.js +3 -3
  43. package/dist/base/forms-numeric.js +1 -1
  44. package/dist/base/forms.js +2 -2
  45. package/dist/base/inline-edit.js +14 -14
  46. package/dist/base/inline-edit.js.map +1 -1
  47. package/dist/base/item.js +1 -1
  48. package/dist/base/media-gallery.js +1 -1
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +6 -6
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +1 -1
  54. package/dist/base/repeaters.js +171 -176
  55. package/dist/base/repeaters.js.map +1 -1
  56. package/dist/base/sheet.js +1 -1
  57. package/dist/base/sidebar.js +1 -1
  58. package/dist/base/signature-pad.js +6 -6
  59. package/dist/base/skeleton.js +1 -1
  60. package/dist/base/spinner.js +79 -2
  61. package/dist/base/spinner.js.map +1 -0
  62. package/dist/base/structure.js +1 -1
  63. package/dist/base/table.js +1 -1
  64. package/dist/base/text-inputs.js +2 -2
  65. package/dist/base/toaster.js +46 -45
  66. package/dist/base/toaster.js.map +1 -1
  67. package/dist/base/tree.js +1 -1
  68. package/dist/base/upload-queue.js +1 -1
  69. package/dist/base/upload.js +3 -3
  70. package/dist/base/value-inputs.js +1 -1
  71. package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
  72. package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
  73. package/dist/blocks/admin.js +42 -42
  74. package/dist/blocks/admin.js.map +1 -1
  75. package/dist/blocks/ai.js +260 -240
  76. package/dist/blocks/ai.js.map +1 -1
  77. package/dist/blocks/analytics/usage-card.js +1 -1
  78. package/dist/blocks/analytics.js +620 -585
  79. package/dist/blocks/analytics.js.map +1 -1
  80. package/dist/blocks/collaboration.js +1 -1
  81. package/dist/blocks/commerce/receipt.js +1 -1
  82. package/dist/blocks/commerce.js +1152 -1109
  83. package/dist/blocks/commerce.js.map +1 -1
  84. package/dist/blocks/data-display.js +2 -2
  85. package/dist/blocks/onboarding.js +48 -39
  86. package/dist/blocks/onboarding.js.map +1 -1
  87. package/dist/blocks/planning.js +13 -12
  88. package/dist/blocks/planning.js.map +1 -1
  89. package/dist/blocks/timelines.js +1 -1
  90. package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
  91. package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
  92. package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
  93. package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
  94. package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
  95. package/dist/buttons-DPZekJFu.js.map +1 -0
  96. package/dist/cards-BaBZR-AU.js +68 -0
  97. package/dist/cards-BaBZR-AU.js.map +1 -0
  98. package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
  99. package/dist/chart-ZOYyK2xG.js.map +1 -0
  100. package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
  101. package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
  102. package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
  103. package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
  104. package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
  105. package/dist/code-block-DeneBJR_.js.map +1 -0
  106. package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
  107. package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
  108. package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
  109. package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
  110. package/dist/combobox-DaHESuiL.js +355 -0
  111. package/dist/combobox-DaHESuiL.js.map +1 -0
  112. package/dist/{combobox-DLl0bfiq.js → combobox-Dxo2fAYQ.js} +289 -279
  113. package/dist/combobox-Dxo2fAYQ.js.map +1 -0
  114. package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
  115. package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
  116. package/dist/{comments-BpDuCUUu.js → comments-DD0DUPwJ.js} +114 -105
  117. package/dist/comments-DD0DUPwJ.js.map +1 -0
  118. package/dist/components/base/badge/badge.recipes.d.ts +1 -1
  119. package/dist/components/base/buttons/loader-button.d.ts +2 -1
  120. package/dist/components/base/cards/card.recipes.d.ts +2 -3
  121. package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
  122. package/dist/components/base/cards/smart-card.types.d.ts +11 -4
  123. package/dist/components/base/chart/chart.d.ts +2 -5
  124. package/dist/components/base/combobox/combobox-field.d.ts +16 -0
  125. package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
  126. package/dist/components/base/combobox/index.d.ts +30 -4
  127. package/dist/components/base/forms/form-sizing.d.ts +11 -3
  128. package/dist/components/base/navigation/pagination.d.ts +5 -2
  129. package/dist/components/base/popover/popover.recipes.d.ts +15 -1
  130. package/dist/components/base/table/index.d.ts +9 -2
  131. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  132. package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
  133. package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
  134. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
  135. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
  136. package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
  137. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
  138. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
  139. package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
  140. package/dist/components/features/appointment-calendar/index.d.ts +3 -0
  141. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
  142. package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
  143. package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
  144. package/dist/components/features/combobox/types.d.ts +4 -0
  145. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  146. package/dist/components/features/rich-text-editor/index.d.ts +1 -1
  147. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
  148. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
  149. package/dist/components/features/table/table-header.d.ts +1 -1
  150. package/dist/components/features/table/table.strings.d.ts +55 -1
  151. package/dist/components/features/table/table.types.d.ts +17 -4
  152. package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
  153. package/dist/components/primitives/number.d.ts +4 -2
  154. package/dist/components/primitives/value.d.ts +3 -1
  155. package/dist/components/typography/text-link.d.ts +4 -0
  156. package/dist/components/ui/combobox-dismiss.d.ts +16 -0
  157. package/dist/components/ui/combobox.d.ts +16 -7
  158. package/dist/components/ui/dialog.d.ts +1 -1
  159. package/dist/components/ui/item.d.ts +8 -8
  160. package/dist/components/ui/popover.d.ts +1 -1
  161. package/dist/components/ui/sheet.d.ts +1 -1
  162. package/dist/components/ui/tabs.d.ts +1 -1
  163. package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
  164. package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
  165. package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
  166. package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
  167. package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
  168. package/dist/data-display-DT_khPl_.js.map +1 -0
  169. package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
  170. package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
  171. package/dist/{date-picker-CF-DtUpF.js → date-picker-B2K3ucWn.js} +594 -593
  172. package/dist/date-picker-B2K3ucWn.js.map +1 -0
  173. package/dist/date-pickers-Ds8gLaoP.js +175 -0
  174. package/dist/date-pickers-Ds8gLaoP.js.map +1 -0
  175. package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
  176. package/dist/display-hAc1HjpI.js.map +1 -0
  177. package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
  178. package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
  179. package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
  180. package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
  181. package/dist/features/activities.js +398 -375
  182. package/dist/features/activities.js.map +1 -1
  183. package/dist/features/ai-chat.js +188 -179
  184. package/dist/features/ai-chat.js.map +1 -1
  185. package/dist/features/appointment-calendar.js +683 -0
  186. package/dist/features/appointment-calendar.js.map +1 -0
  187. package/dist/features/async-preview.js +109 -107
  188. package/dist/features/async-preview.js.map +1 -1
  189. package/dist/features/combobox.js +1 -1
  190. package/dist/features/comments.js +1 -1
  191. package/dist/features/data-view.js +137 -137
  192. package/dist/features/data-view.js.map +1 -1
  193. package/dist/features/email-composer.js +255 -255
  194. package/dist/features/email-composer.js.map +1 -1
  195. package/dist/features/event-calendar.js +254 -248
  196. package/dist/features/event-calendar.js.map +1 -1
  197. package/dist/features/filters.js +1 -1
  198. package/dist/features/global-search.js +35 -32
  199. package/dist/features/global-search.js.map +1 -1
  200. package/dist/features/kanban.js +118 -117
  201. package/dist/features/kanban.js.map +1 -1
  202. package/dist/features/map.js +233 -231
  203. package/dist/features/map.js.map +1 -1
  204. package/dist/features/media-library.js +789 -775
  205. package/dist/features/media-library.js.map +1 -1
  206. package/dist/features/mentions.js +1 -1
  207. package/dist/features/overlays.js +1 -1
  208. package/dist/features/products.js +922 -902
  209. package/dist/features/products.js.map +1 -1
  210. package/dist/features/questionnaire.js +28 -24
  211. package/dist/features/questionnaire.js.map +1 -1
  212. package/dist/features/resource-assignment.js +18 -15
  213. package/dist/features/resource-assignment.js.map +1 -1
  214. package/dist/features/resource.js +12 -12
  215. package/dist/features/resource.js.map +1 -1
  216. package/dist/features/rich-text-editor.js +2 -2
  217. package/dist/features/schema-form.js +15 -13
  218. package/dist/features/schema-form.js.map +1 -1
  219. package/dist/features/suggestions.js +3 -3
  220. package/dist/features/sync.js +11 -5
  221. package/dist/features/sync.js.map +1 -1
  222. package/dist/features/table.js +1 -1
  223. package/dist/features/theme-tweaker.js +493 -489
  224. package/dist/features/theme-tweaker.js.map +1 -1
  225. package/dist/feedback-BYIhtitP.js +239 -0
  226. package/dist/feedback-BYIhtitP.js.map +1 -0
  227. package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
  228. package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
  229. package/dist/{filters-BkHH53uv.js → filters-DJVAveHA.js} +589 -580
  230. package/dist/filters-DJVAveHA.js.map +1 -0
  231. package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
  232. package/dist/form-field-CwH9y77i.js.map +1 -0
  233. package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
  234. package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
  235. package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
  236. package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
  237. package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
  238. package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
  239. package/dist/{header-BOefOKd1.js → header-BSfIEWbI.js} +160 -153
  240. package/dist/header-BSfIEWbI.js.map +1 -0
  241. package/dist/{hooks-9k_TtmKh.js → hooks-ClH9thn4.js} +2 -2
  242. package/dist/{hooks-9k_TtmKh.js.map → hooks-ClH9thn4.js.map} +1 -1
  243. package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
  244. package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
  245. package/dist/index.js +3 -3
  246. package/dist/input-CZw8iU99.js +21 -0
  247. package/dist/input-CZw8iU99.js.map +1 -0
  248. package/dist/input-DQdEd0YD.js +263 -0
  249. package/dist/input-DQdEd0YD.js.map +1 -0
  250. package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
  251. package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
  252. package/dist/item-K5_ghvze.js +275 -0
  253. package/dist/item-K5_ghvze.js.map +1 -0
  254. package/dist/layout/app-shell.js +1 -1
  255. package/dist/layout/auth.js +1 -1
  256. package/dist/layout/containers.js +1 -1
  257. package/dist/layout/header.js +1 -1
  258. package/dist/layout/hooks.js +1 -1
  259. package/dist/layout/navigation.js +1 -1
  260. package/dist/layout/page.js +1 -1
  261. package/dist/layout/settings.js +1 -1
  262. package/dist/layout/sidebar.js +2 -2
  263. package/dist/layout/workspace.js +1 -1
  264. package/dist/layout.js +10 -10
  265. package/dist/lib/affordance-geometry.generated.d.ts +71 -0
  266. package/dist/lib/editable-text-recipe.d.ts +4 -4
  267. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  268. package/dist/lib/interaction-recipes.d.ts +5 -0
  269. package/dist/lib/theme-mode-css.d.ts +7 -0
  270. package/dist/lib/tone-recipes.d.ts +8 -0
  271. package/dist/lib/ui-provider/types.d.ts +2 -2
  272. package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
  273. package/dist/lib/utils.js +1 -1
  274. package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
  275. package/dist/media-gallery-3zIVLMWH.js.map +1 -0
  276. package/dist/{mentions-D-uyCh01.js → mentions-CGlEJ15c.js} +144 -142
  277. package/dist/mentions-CGlEJ15c.js.map +1 -0
  278. package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
  279. package/dist/message-DZ_ruyUV.js.map +1 -0
  280. package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
  281. package/dist/metadata-list-8N16ZMW_.js.map +1 -0
  282. package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
  283. package/dist/navigation-Bnotn4AQ.js.map +1 -0
  284. package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
  285. package/dist/navigation-BzhHI3lo.js.map +1 -0
  286. package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
  287. package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
  288. package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
  289. package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
  290. package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
  291. package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
  292. package/dist/{overlays-I0axtYA6.js → overlays-tMkF-VAN.js} +282 -278
  293. package/dist/overlays-tMkF-VAN.js.map +1 -0
  294. package/dist/{page-B5dTH9gE.js → page-CL9YeH_V.js} +8 -8
  295. package/dist/{page-B5dTH9gE.js.map → page-CL9YeH_V.js.map} +1 -1
  296. package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
  297. package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
  298. package/dist/pagination-BL25hu2s.js +158 -0
  299. package/dist/pagination-BL25hu2s.js.map +1 -0
  300. package/dist/{popover-Di55PyAI.js → popover-gnTOhbFM.js} +69 -66
  301. package/dist/popover-gnTOhbFM.js.map +1 -0
  302. package/dist/popover-menu-Cn9rUkdc.js +100 -0
  303. package/dist/popover-menu-Cn9rUkdc.js.map +1 -0
  304. package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
  305. package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
  306. package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
  307. package/dist/primitives-BFK08r9M.js.map +1 -0
  308. package/dist/primitives.js +4 -4
  309. package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
  310. package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
  311. package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
  312. package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
  313. package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
  314. package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
  315. package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
  316. package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
  317. package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
  318. package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
  319. package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
  320. package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
  321. package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
  322. package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
  323. package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
  324. package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
  325. package/dist/services/actions.js +1 -1
  326. package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
  327. package/dist/settings-ybnjVwbd.js.map +1 -0
  328. package/dist/{sheet-4SEvVYzA.js → sheet-ijlsjq-n.js} +76 -73
  329. package/dist/sheet-ijlsjq-n.js.map +1 -0
  330. package/dist/{sidebar-C7WWR29L.js → sidebar-Db6gkh3U.js} +183 -182
  331. package/dist/sidebar-Db6gkh3U.js.map +1 -0
  332. package/dist/{sidebar-d7Dg80ln.js → sidebar-DkTO4VTO.js} +14 -13
  333. package/dist/{sidebar-d7Dg80ln.js.map → sidebar-DkTO4VTO.js.map} +1 -1
  334. package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
  335. package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
  336. package/dist/smart-card-DiC5aac3.js +604 -0
  337. package/dist/smart-card-DiC5aac3.js.map +1 -0
  338. package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
  339. package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
  340. package/dist/style.css +1 -1
  341. package/dist/table-BweFy_P9.js +1530 -0
  342. package/dist/table-BweFy_P9.js.map +1 -0
  343. package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
  344. package/dist/table-DsfzoUia.js.map +1 -0
  345. package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
  346. package/dist/tabs-CDocW5D1.js.map +1 -0
  347. package/dist/text-inputs-f9Ia-aCi.js +353 -0
  348. package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
  349. package/dist/theme-mode-css-BB-_RYab.js +14 -0
  350. package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
  351. package/dist/theme-scope-BJ6eE2xt.js +50 -0
  352. package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
  353. package/dist/theme.css +285 -228
  354. package/dist/themes/green.css +16 -12
  355. package/dist/timelines-CwM_9IhD.js +457 -0
  356. package/dist/timelines-CwM_9IhD.js.map +1 -0
  357. package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
  358. package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
  359. package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
  360. package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
  361. package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
  362. package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
  363. package/dist/typography/rich-text.js +1 -1
  364. package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
  365. package/dist/typography-UTnveOEy.js.map +1 -0
  366. package/dist/typography.js +2 -2
  367. package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
  368. package/dist/ui-provider-C_U0Xma4.js.map +1 -0
  369. package/dist/ui-provider.js +2 -2
  370. package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
  371. package/dist/upload-CXyxmQBP.js.map +1 -0
  372. package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
  373. package/dist/upload-queue-Boscubn9.js.map +1 -0
  374. package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
  375. package/dist/usage-card-BhO5eqkX.js.map +1 -0
  376. package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
  377. package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
  378. package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
  379. package/dist/utils-BRhFDwuU.js.map +1 -0
  380. package/dist/{value-inputs-TAYMX111.js → value-inputs-TaX4OjNk.js} +268 -252
  381. package/dist/value-inputs-TaX4OjNk.js.map +1 -0
  382. package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
  383. package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
  384. package/dist/{workspace-DH0v0KcB.js → workspace-B-OEm3Kf.js} +34 -33
  385. package/dist/workspace-B-OEm3Kf.js.map +1 -0
  386. package/docs/consumer-skill/SKILL.md +3 -3
  387. package/docs/consumer-skill/references/agents-md.md +1 -1
  388. package/docs/consumer-skill/references/composition.md +8 -6
  389. package/docs/consumer-skill/references/installation.md +6 -0
  390. package/docs/consumer-skill/references/integration.md +4 -3
  391. package/docs/consumer-skill/references/public-api.json +105 -2
  392. package/docs/consumer-skill/references/review.md +7 -0
  393. package/docs/consumer-skill/references/theming.md +71 -6
  394. package/docs/consumer-skill/references/tokens.json +1 -1
  395. package/docs/consumer-skill/references/workflows.md +26 -0
  396. package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
  397. package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
  398. package/package.json +8 -4
  399. package/dist/accordion-B6a3vVgA.js.map +0 -1
  400. package/dist/action-menu-TzCoSlwL.js +0 -280
  401. package/dist/action-menu-TzCoSlwL.js.map +0 -1
  402. package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
  403. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
  404. package/dist/ai-artifact-BMJdv-6q.js +0 -1115
  405. package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
  406. package/dist/attachment-BtfhGm8i.js +0 -245
  407. package/dist/attachment-BtfhGm8i.js.map +0 -1
  408. package/dist/auth-CYxKfo69.js.map +0 -1
  409. package/dist/avatar-BBnEJIx8.js.map +0 -1
  410. package/dist/badge-MrKVNzW9.js.map +0 -1
  411. package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
  412. package/dist/breadcrumbs-D5t7I023.js.map +0 -1
  413. package/dist/buttons-SbIcm1HJ.js.map +0 -1
  414. package/dist/cards-CiiHpKYd.js +0 -66
  415. package/dist/cards-CiiHpKYd.js.map +0 -1
  416. package/dist/chart-QfrARkXl.js.map +0 -1
  417. package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
  418. package/dist/code-block-Dgbu-CU3.js.map +0 -1
  419. package/dist/combobox-2Ic8N9bL.js +0 -278
  420. package/dist/combobox-2Ic8N9bL.js.map +0 -1
  421. package/dist/combobox-DLl0bfiq.js.map +0 -1
  422. package/dist/comments-BpDuCUUu.js.map +0 -1
  423. package/dist/data-display-DafIvCl5.js.map +0 -1
  424. package/dist/date-picker-CF-DtUpF.js.map +0 -1
  425. package/dist/date-pickers-BmzxJl5l.js +0 -174
  426. package/dist/date-pickers-BmzxJl5l.js.map +0 -1
  427. package/dist/display-DsQTVzMz.js.map +0 -1
  428. package/dist/dropdown-menu-E2qmdC7o.js +0 -193
  429. package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
  430. package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
  431. package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
  432. package/dist/feedback-qNuMBtRH.js +0 -233
  433. package/dist/feedback-qNuMBtRH.js.map +0 -1
  434. package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
  435. package/dist/filters-BkHH53uv.js.map +0 -1
  436. package/dist/form-field-DUt4UxSV.js.map +0 -1
  437. package/dist/form-sizing-By94KzXE.js.map +0 -1
  438. package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
  439. package/dist/header-BOefOKd1.js.map +0 -1
  440. package/dist/input-DWhBBBww.js +0 -262
  441. package/dist/input-DWhBBBww.js.map +0 -1
  442. package/dist/input-Ddi_LSYv.js +0 -20
  443. package/dist/input-Ddi_LSYv.js.map +0 -1
  444. package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
  445. package/dist/item-DEmDiTlD.js +0 -265
  446. package/dist/item-DEmDiTlD.js.map +0 -1
  447. package/dist/media-gallery-DcTtAaeC.js.map +0 -1
  448. package/dist/mentions-D-uyCh01.js.map +0 -1
  449. package/dist/message-CdHgIWKf.js.map +0 -1
  450. package/dist/metadata-list-X5rYAKSB.js.map +0 -1
  451. package/dist/navigation-D3KwXmaq.js.map +0 -1
  452. package/dist/navigation-HJf5zxlH.js.map +0 -1
  453. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
  454. package/dist/overlays-I0axtYA6.js.map +0 -1
  455. package/dist/pagination-3bPA_a6K.js +0 -149
  456. package/dist/pagination-3bPA_a6K.js.map +0 -1
  457. package/dist/popover-Di55PyAI.js.map +0 -1
  458. package/dist/popover-menu-B71Tn2Qz.js +0 -99
  459. package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
  460. package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
  461. package/dist/primitives-B-CkiEMU.js.map +0 -1
  462. package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
  463. package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
  464. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
  465. package/dist/settings-CQW3b-Cu.js.map +0 -1
  466. package/dist/sheet-4SEvVYzA.js.map +0 -1
  467. package/dist/sidebar-C7WWR29L.js.map +0 -1
  468. package/dist/smart-card-lFKxn5Hu.js +0 -595
  469. package/dist/smart-card-lFKxn5Hu.js.map +0 -1
  470. package/dist/spinner-fa3h1Aif.js +0 -80
  471. package/dist/spinner-fa3h1Aif.js.map +0 -1
  472. package/dist/table-CIKyLUsy.js.map +0 -1
  473. package/dist/table-CrcLN9Io.js +0 -1458
  474. package/dist/table-CrcLN9Io.js.map +0 -1
  475. package/dist/tabs-DwBJfjxX.js.map +0 -1
  476. package/dist/text-inputs-aaK9wcDT.js +0 -326
  477. package/dist/text-inputs-aaK9wcDT.js.map +0 -1
  478. package/dist/theme-scope-kStaAer0.js +0 -39
  479. package/dist/theme-scope-kStaAer0.js.map +0 -1
  480. package/dist/timelines-C_SBwHNP.js +0 -442
  481. package/dist/timelines-C_SBwHNP.js.map +0 -1
  482. package/dist/tone-recipes-CPoExcTE.js.map +0 -1
  483. package/dist/typography-DTRkE9zL.js.map +0 -1
  484. package/dist/ui-provider-1D_NSYzO.js.map +0 -1
  485. package/dist/upload-BO8-CLN6.js.map +0 -1
  486. package/dist/upload-queue-EOC8g1gf.js.map +0 -1
  487. package/dist/usage-card-obRaBskq.js.map +0 -1
  488. package/dist/utils-l5LpDw2z.js.map +0 -1
  489. package/dist/value-inputs-TAYMX111.js.map +0 -1
  490. package/dist/workspace-DH0v0KcB.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-artifact-BMJdv-6q.js","names":["_Fragment","STATUS_VARIANT","_Fragment","NumberValue","_Fragment","_Fragment","_Fragment","cn","Button","DisplayLabel","Text","TextLink","focusRecipes","Stack","toneRecipes","interactionRecipes","SecondaryValue","MonoValue","Duration","Number","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","avatarLabel","role","User","Bot","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","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","TONE_AVATAR","STATUS_VARIANT$1","AiAgent","icon","avatarSize","variant","iconSize","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","TaskRow","task","item","hasChildren","open","setOpen","density","depth","indent","child","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 { 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 const renderedAvatar = avatar ?? <span aria-label={avatarLabel} className=\"inline-flex size-avatar-sm shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\"><Icon aria-hidden=\"true\" className=\"size-icon-md\" /></span>;\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}\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};\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\". */\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 { 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\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('ai-tool-call--component @container/ai-tool-call', \n\t\t\t\t'overflow-hidden rounded-radius border border-border/60 bg-card',\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/ai-tool-call: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 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/ai-tool-call:order-none @md/ai-tool-call:w-auto @md/ai-tool-call: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 label={strings.durationLabel} ms={durationMs} />\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t\t{hasDetails &&\n\t\t\t\t\t(expanded ? (\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</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</div>\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'max-w-full overflow-x-auto rounded-inner bg-card 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\tclassName,\n}: AiShimmerProps) {\n\tif (paused) {\n\t\treturn (\n\t\t\t<Text tag=\"span\" type=\"secondary\" 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\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 { 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';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nconst TONE_AVATAR: Record<NonNullable<AiAgentProps['tone']>, string> = {\n\tprimary: `${toneRecipes.primary.tint} ${toneRecipes.primary.ink}`,\n\tsuccess: `${toneRecipes.success.tint} ${toneRecipes.success.ink}`,\n\twarning: `${toneRecipes.warning.tint} ${toneRecipes.warning.ink}`,\n\tdestructive: `${toneRecipes.destructive.tint} ${toneRecipes.destructive.ink}`,\n\tinfo: `${toneRecipes.info.tint} ${toneRecipes.info.ink}`,\n\tneutral: 'bg-muted text-muted-foreground',\n};\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\tconst avatarSize = variant === 'card' ? 'size-9' : 'size-7';\n\tconst iconSize = variant === 'card' ? 'size-icon' : 'size-icon-md';\n\n\tconst renderedAvatar =\n\t\tavatar ?? (\n\t\t\t<span\n\t\t\t\taria-hidden\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'inline-flex shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\tavatarSize,\n\t\t\t\t\tTONE_AVATAR[tone],\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<Icon className={iconSize} />\n\t\t\t</span>\n\t\t);\n\n\tconst StatusPill = !!status && (\n\t\t<Badge tone={STATUS_VARIANT[status]} className=\"gap-space-xs\">\n\t\t\t<span\n\t\t\t\taria-hidden\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'inline-block size-1.5 rounded-full',\n\t\t\t\t\tstatus === 'thinking' || status === 'working'\n\t\t\t\t\t\t? 'animate-pulse bg-current'\n\t\t\t\t\t\t: 'bg-current',\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t{strings.statusLabels[status]}\n\t\t</Badge>\n\t);\n\n\tif (variant === 'card') {\n\t\treturn (\n\t\t\t<div className={cn('ai-agent--component',\n\t\t\t\t\t'rounded-radius border border-border/60 bg-card p-surface-xs',\n\t\t\t\t\tclassName,\n\t\t\t\t)}>\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 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</div>\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 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","/**\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 { 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\nconst TONE: Record<\n\tAiConfirmationTone,\n\t{ ring: string; icon: 'neutral' | 'primary' | 'success' | 'warning' | 'destructive' | 'info' }\n> = {\n\tneutral: { ring: 'border-border/60 bg-card', 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\treturn (\n\t\t<div\n\t\t\trole=\"region\"\n\t\t\taria-live=\"polite\"\n\t\t\tclassName={cn('ai-confirmation--component',\n\t\t\t\t'@container/ai-confirmation rounded-radius border p-surface-xs',\n\t\t\t\ttoneCfg.ring,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\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<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack gap=\"normal\">\n\t\t\t\t\t<Text 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=\"mt-space-md\">{details}</div>}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{status === 'pending' ? (\n\t\t\t\t<div className=\"ai-confirmation--footer mt-space-lg flex flex-col items-stretch gap-space-md @sm/ai-confirmation:flex-row @sm/ai-confirmation:items-center @sm/ai-confirmation: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=\"md\" 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 mt-space-lg 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 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 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</div>\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 { 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';\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\treturn (\n\t\t<div className={cn('ai-sources--component rounded-radius border border-border/60 bg-card', 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-inner ${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 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</div>\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} />\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{title}\n\t\t\t</Text>\n\t\t\t{overflow > 0 && (\n\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t+\n\t\t\t\t\t<NumberValue value={overflow} size=\"xs\" type=\"secondary\" align=\"left\" />\n\t\t\t\t</SecondaryValue>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction AvatarStack({\n\tsources,\n\tonSelect,\n\tvisitLabel,\n}: {\n\tsources: ReadonlyArray<AiSourceItem>;\n\tonSelect?: (source: AiSourceItem, index: number) => void;\n\tvisitLabel?: string;\n}) {\n\treturn (\n\t\t<div className={cn('flex', 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={`box-border inline-flex size-action-xs shrink-0 items-center justify-center rounded-inner border-0 bg-transparent p-0 font-sans 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</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\t'group box-border flex w-full items-start gap-space-lg rounded-inner border-0 bg-transparent px-row-x py-row-y-sm text-left font-sans 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<NumberValue\n\t\t\t\tvalue={index}\n\t\t\t\tsize=\"xs\"\n\t\t\t\tweight=\"semibold\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\talign=\"center\"\n\t\t\t\tclassName=\"inline-flex size-icon-lg shrink-0 items-center justify-center rounded-full bg-muted\"\n\t\t\t/>\n\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t<Text 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 weight=\"medium\" className=\"flex-1\">\n\t\t\t{renderThoughtFor(strings.thoughtFor, durationSeconds)}\n\t\t</Text>\n\t) : (\n\t\t<Text 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 { 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';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nconst STATUS_VISUAL: Record<\n\tAiChainStepStatus,\n\t{ icon: LucideIcon; iconCls: string; ring: string; spin?: boolean }\n> = {\n\tpending: {\n\t\ticon: Circle,\n\t\ticonCls: 'text-muted-foreground',\n\t\tring: 'border-border/60 bg-card',\n\t},\n\tactive: {\n\t\ticon: Loader2,\n\t\ticonCls: 'text-primary-accent',\n\t\tring: `${toneRecipes.primary.edge} ${toneRecipes.primary.wash}`,\n\t\tspin: true,\n\t},\n\tcompleted: {\n\t\ticon: Check,\n\t\ticonCls: 'text-success-foreground',\n\t\tring: `${toneRecipes.success.edge} ${toneRecipes.success.solid}`,\n\t},\n\tfailed: {\n\t\ticon: AlertCircle,\n\t\ticonCls: 'text-destructive-foreground',\n\t\tring: `${toneRecipes.destructive.edge} ${toneRecipes.destructive.solid}`,\n\t},\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 surface owns one inset; the header flows into the steps by the Stack gap\n\t\t// rather than sitting on a rule of its own.\n\t\t<Stack\n\t\t\tgap=\"lg\"\n\t\t\tclassName={cn('ai-chain-of-thought--component', 'rounded-radius border border-border/60 bg-card p-surface', className)}\n\t\t>\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 className=\"ml-auto !text-xs\">\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 relative 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=\"relative flex gap-space-lg pb-space-lg last:pb-0\">\n\t\t\t\t\t\t\t{!isLast && (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\tclassName=\"absolute bottom-0 left-[11px] top-[26px] w-px bg-border/60\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'relative z-[1] mt-0.5 inline-flex size-6 shrink-0 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\tvisual.ring,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'size-icon-sm',\n\t\t\t\t\t\t\t\t\t\tvisual.iconCls,\n\t\t\t\t\t\t\t\t\t\tvisual.spin && 'animate-spin',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div className=\"min-w-0 flex-1\">\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\tclassName={cn(status === 'pending' && 'text-muted-foreground')}\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=\"mt-space-md\">{step.body}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\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</Stack>\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 { 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\treturn (\n\t\t<div className={cn('ai-task--component', 'rounded-radius border border-border/60 bg-card', className)}>\n\t\t\t<TaskRow\n\t\t\t\titem={task}\n\t\t\t\tdepth={0}\n\t\t\t\tdensity={density}\n\t\t\t\tindent={indent}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nAiTask.displayName = 'AiTask';\n\nfunction TaskRow({\n\titem,\n\tdepth,\n\tdensity,\n\tindent,\n\tstrings,\n}: {\n\titem: AiTaskItem;\n\tdepth: number;\n\tdensity: 'compact' | 'expanded';\n\tindent: number;\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\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex items-start gap-space-md 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\tstyle={{ paddingInlineStart: `calc(var(--row-x) * var(--space-scale) + ${depth * indent}px)` }}\n\t\t\t>\n\t\t\t\t{hasChildren ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\tonClick={() => setOpen((v) => !v)}\n\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\taria-label={open ? strings.collapseSubtasks : strings.expandSubtasks}\n\t\t\t\t\t\tclassName=\"-ml-1 mt-0.5 size-icon rounded-inner p-0 text-muted-foreground hover:text-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{open ? (\n\t\t\t\t\t\t\t<ChevronDown className=\"size-icon-md\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ChevronRight className=\"size-icon-md\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\t<span aria-hidden className=\"mt-0.5 size-icon\" />\n\t\t\t\t)}\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={cn('mt-[3px] size-icon-md shrink-0', visual.cls, visual.spin && 'animate-spin')}\n\t\t\t\t/>\n\t\t\t\t<div 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\n\t\t\t\t\t\t\tweight={status === 'running' ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'flex-1 truncate',\n\t\t\t\t\t\t\t\tstatus === 'queued' && 'text-muted-foreground',\n\t\t\t\t\t\t\t\tstatus === 'cancelled' && 'line-through text-muted-foreground',\n\t\t\t\t\t\t\t\tstatus === 'skipped' && 'text-muted-foreground',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.title}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Badge tone={STATUS_VARIANT[status]}>\n\t\t\t\t\t\t\t{strings.statusLabels[status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t{!!item.rightSlot && (\n\t\t\t\t\t\t\t<span className=\"tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t{item.rightSlot}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!item.body && <div className=\"mt-space-md\">{item.body}</div>}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{hasChildren && open && (\n\t\t\t\t<div>\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\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 { 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<div\n\t\t\tclassName={cn('ai-artifact--component', \n\t\t\t\t'overflow-hidden rounded-radius border border-border/60 bg-card',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\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 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{!collapsed && !!children && <div className=\"bg-card\">{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></div>}\n\t\t</div>\n\t);\n}\n\nAiArtifact.displayName = 'AiArtifact';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,SAAgBiC,EAAgB,GAAwC,GAAiB;CACxF,IAAM,CAACC,GAAQC,KAAaC,EAAS,EAAK,GACpC,CAACC,GAAQC,KAAaF,EAAS,EAAK,GACpCG,IAAUC,EAAO,EAAK,GACtBC,IAA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AAQ,aAAa4J,EAAyB;IAAgB,CAAA;GAAM,CAAA;EAC3J;;AAEP;AAEA,GAAW,cAAc"}
@@ -1,245 +0,0 @@
1
- "use client";
2
- import { useStrings as e } from "./lib/strings.js";
3
- import { t } from "./utils-l5LpDw2z.js";
4
- import { n } from "./buttons-SbIcm1HJ.js";
5
- import { s as r } from "./typography-DTRkE9zL.js";
6
- import { t as i } from "./focus-recipes-B653VaLq.js";
7
- import { t as a } from "./progress-rnS8-uAW.js";
8
- import { i as o } from "./primitives-B-CkiEMU.js";
9
- import { c as s, i as c, n as l, r as u, t as d, u as f } from "./item-DEmDiTlD.js";
10
- import { forwardRef as p } from "react";
11
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
12
- import { Archive as _, AudioLines as v, Download as y, Eye as b, FileCode as x, FileText as S, ImageIcon as C, Video as w, X as T } from "lucide-react";
13
- import { Button as E } from "@base-ui/react/button";
14
- //#region src/components/base/attachment/attachment.types.ts
15
- var D = {
16
- preview: (e) => `Preview ${e}`,
17
- download: (e) => `Download ${e}`,
18
- remove: (e) => `Remove ${e}`,
19
- queued: "Queued",
20
- uploading: "Uploading",
21
- done: "Uploaded",
22
- error: "Failed",
23
- cancelled: "Cancelled"
24
- }, O = {
25
- image: C,
26
- document: S,
27
- audio: v,
28
- video: w,
29
- code: x,
30
- archive: _,
31
- generic: S
32
- };
33
- function k(e) {
34
- let t = e.split(".").at(-1)?.toLowerCase();
35
- return t && [
36
- "png",
37
- "jpg",
38
- "jpeg",
39
- "gif",
40
- "webp",
41
- "svg",
42
- "avif"
43
- ].includes(t) ? "image" : t && [
44
- "mp3",
45
- "wav",
46
- "ogg",
47
- "flac",
48
- "m4a"
49
- ].includes(t) ? "audio" : t && [
50
- "mp4",
51
- "webm",
52
- "mov",
53
- "avi"
54
- ].includes(t) ? "video" : t && [
55
- "zip",
56
- "gz",
57
- "tar",
58
- "rar",
59
- "7z"
60
- ].includes(t) ? "archive" : t && [
61
- "ts",
62
- "tsx",
63
- "js",
64
- "jsx",
65
- "css",
66
- "html",
67
- "json",
68
- "py",
69
- "sh",
70
- "sql"
71
- ].includes(t) ? "code" : t && [
72
- "pdf",
73
- "doc",
74
- "docx",
75
- "txt",
76
- "md",
77
- "xls",
78
- "xlsx",
79
- "csv"
80
- ].includes(t) ? "document" : "generic";
81
- }
82
- function A({ name: e, kind: t }) {
83
- let n = O[t ?? k(e)];
84
- return /* @__PURE__ */ h(n, { "aria-hidden": "true" });
85
- }
86
- var j = p(function({ className: e, ...n }, r) {
87
- return /* @__PURE__ */ h(s, {
88
- ...n,
89
- ref: r,
90
- className: t("attachment--media self-center group-has-data-[slot=item-description]/item:self-center", e)
91
- });
92
- }), M = p(function({ className: e, ...n }, r) {
93
- return /* @__PURE__ */ h(u, {
94
- ...n,
95
- ref: r,
96
- className: t("attachment--content w-full max-w-full", e)
97
- });
98
- }), N = p(function({ className: e, ...n }, r) {
99
- return /* @__PURE__ */ h(f, {
100
- ...n,
101
- ref: r,
102
- className: t("attachment--title block w-full truncate [&>span]:block [&>span]:min-w-0 [&>span]:truncate", e)
103
- });
104
- }), P = p(function({ className: e, ...n }, r) {
105
- return /* @__PURE__ */ h(c, {
106
- ...n,
107
- ref: r,
108
- className: t("attachment--description", e)
109
- });
110
- }), F = p(function({ className: e, ...n }, r) {
111
- return /* @__PURE__ */ h(l, {
112
- ...n,
113
- ref: r,
114
- className: t("attachment--actions relative z-10", e)
115
- });
116
- });
117
- function I({ className: e, ...n }) {
118
- return /* @__PURE__ */ h(a, {
119
- ...n,
120
- className: t("attachment--progress", e)
121
- });
122
- }
123
- var L = p(function({ name: a = "", meta: s, bytes: c, locale: l, kind: u, media: f, thumbnailUrl: p, status: _, progress: v, error: x, description: S, actions: C, onOpen: w, onPreview: O, onDownload: k, onRemove: L, disabled: R = !1, layout: z = "list", size: B, density: V, variant: H = "outline", render: U, strings: W, children: G, className: K, ...q }, J) {
124
- let Y = e(D, W), X = _ === "queued" || _ === "uploading", Z = v == null ? null : Number.isFinite(v) ? Math.max(0, Math.min(100, v)) : 0, Q = _ ? Y[_] : void 0;
125
- return /* @__PURE__ */ g(d, {
126
- ...q,
127
- ref: J,
128
- render: U,
129
- size: B,
130
- density: V ?? (z === "compact" ? "compact" : "default"),
131
- variant: H,
132
- padding: "default",
133
- "data-status": _,
134
- "data-layout": z,
135
- "data-disabled": R || void 0,
136
- className: t("attachment--component relative isolate min-w-0 max-w-full bg-card text-card-foreground", z === "gallery" ? "flex-col items-stretch" : "flex-nowrap", _ === "error" && "border-destructive", K),
137
- children: [G ?? /* @__PURE__ */ g(m, { children: [
138
- /* @__PURE__ */ h(j, {
139
- variant: p && z !== "gallery" ? "image" : "icon",
140
- className: z === "gallery" ? "aspect-video h-auto w-full overflow-hidden rounded-inner bg-muted text-muted-foreground" : void 0,
141
- children: f ?? (p ? /* @__PURE__ */ h("img", {
142
- src: p,
143
- alt: "",
144
- className: "h-full w-full object-cover"
145
- }) : /* @__PURE__ */ h(A, {
146
- name: a,
147
- kind: u
148
- }))
149
- }),
150
- /* @__PURE__ */ g(M, { children: [
151
- /* @__PURE__ */ h(N, {
152
- title: a,
153
- children: a
154
- }),
155
- (s !== void 0 || c !== void 0) && /* @__PURE__ */ h(P, {
156
- clamp: 1,
157
- children: s ?? /* @__PURE__ */ h(o, {
158
- value: c,
159
- locale: l,
160
- size: "xs",
161
- type: "secondary",
162
- align: "left"
163
- })
164
- }),
165
- (S !== void 0 || Q) && /* @__PURE__ */ g(P, {
166
- clamp: "none",
167
- children: [S === void 0 ? /* @__PURE__ */ h(r, {
168
- tag: "span",
169
- size: "xs",
170
- type: _ === "error" ? "error" : "secondary",
171
- children: Q
172
- }) : S, _ === "error" && x ? /* @__PURE__ */ g(m, { children: [" — ", /* @__PURE__ */ h(r, {
173
- tag: "span",
174
- role: "alert",
175
- size: "xs",
176
- type: "error",
177
- children: x
178
- })] }) : null]
179
- }),
180
- X && /* @__PURE__ */ h(I, {
181
- value: _ === "queued" && Z === null ? 0 : Z,
182
- "aria-label": a,
183
- size: "sm",
184
- tone: _ === "queued" ? "neutral" : "primary"
185
- })
186
- ] }),
187
- (C || O || k || L) && /* @__PURE__ */ g(F, { children: [
188
- O && /* @__PURE__ */ h(n, {
189
- type: "button",
190
- tone: "secondary",
191
- buttonStyle: "ghost",
192
- size: "sm",
193
- iconOnly: !0,
194
- disabled: R,
195
- "aria-label": Y.preview(a),
196
- onClick: O,
197
- children: /* @__PURE__ */ h(b, {
198
- "aria-hidden": "true",
199
- className: "size-icon-sm"
200
- })
201
- }),
202
- k && /* @__PURE__ */ h(n, {
203
- type: "button",
204
- tone: "secondary",
205
- buttonStyle: "ghost",
206
- size: "sm",
207
- iconOnly: !0,
208
- disabled: R,
209
- "aria-label": Y.download(a),
210
- onClick: k,
211
- children: /* @__PURE__ */ h(y, {
212
- "aria-hidden": "true",
213
- className: "size-icon-sm"
214
- })
215
- }),
216
- L && /* @__PURE__ */ h(n, {
217
- type: "button",
218
- tone: "secondary",
219
- buttonStyle: "ghost",
220
- size: "sm",
221
- iconOnly: !0,
222
- disabled: R,
223
- "aria-label": Y.remove(a),
224
- onClick: L,
225
- children: /* @__PURE__ */ h(T, {
226
- "aria-hidden": "true",
227
- className: "size-icon-sm"
228
- })
229
- }),
230
- C
231
- ] })
232
- ] }), w && /* @__PURE__ */ h(E, {
233
- type: "button",
234
- disabled: R,
235
- "aria-label": Y.preview(a),
236
- onClick: w,
237
- className: `attachment--trigger absolute inset-0 z-0 cursor-pointer rounded-radius outline-none ${i.inset} disabled:cursor-not-allowed`
238
- })]
239
- });
240
- });
241
- L.displayName = "Attachment";
242
- //#endregion
243
- export { A as a, N as c, P as i, k as l, F as n, j as o, M as r, I as s, L as t, D as u };
244
-
245
- //# sourceMappingURL=attachment-BtfhGm8i.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment-BtfhGm8i.js","names":["_Fragment","Button","ButtonPrimitive","Text","focusRecipes","Progress","FileSize","ItemMedia","ItemDescription","ItemActions","ItemContent","Item","ItemTitle","Fragment$1","defaultAttachmentStrings","name","icons","ImageIcon","FileText","AudioLines","Video","FileCode","Archive","getAttachmentKind","extension","AttachmentFileIcon","Icon","kind","AttachmentMedia","forwardRef","props","cn","className","AttachmentContent","AttachmentTitle","AttachmentDescription","AttachmentActions","AttachmentProgress","Attachment","stringsProp","strings","useStrings","showProgress","status","pct","progress","statusCopy","density","layout","disabled","children","thumbnailUrl","media","meta","bytes","description","error","actions","onPreview","onDownload","onRemove","Button$1","Eye","Download","X","onOpen","Button"],"sources":["../src/components/base/attachment/attachment.types.ts","../src/components/base/attachment/attachment.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode, ReactElement } from 'react';\nimport type { StringsProp } from '../../../lib/strings';\nimport type { ItemDensity, ItemSize, ItemVariant } from '../item';\nexport type AttachmentKind = 'image' | 'document' | 'audio' | 'video' | 'code' | 'archive' | 'generic';\nexport type AttachmentStatus = 'queued' | 'uploading' | 'done' | 'error' | 'cancelled';\nexport interface AttachmentStrings {\n preview: (name: string) => string;\n download: (name: string) => string;\n remove: (name: string) => string;\n queued: string; uploading: string; done: string; error: string; cancelled: string;\n}\nexport const defaultAttachmentStrings: AttachmentStrings = {\n preview: name => `Preview ${name}`, download: name => `Download ${name}`, remove: name => `Remove ${name}`,\n queued: 'Queued', uploading: 'Uploading', done: 'Uploaded', error: 'Failed', cancelled: 'Cancelled',\n};\nexport interface AttachmentProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title' | 'onError'> {\n /** Display filename. Omit only when assembling children using Attachment anatomy. */\n name?: string;\n /** Caller-formatted metadata takes precedence over bytes. */\n meta?: ReactNode;\n bytes?: number;\n locale?: string;\n kind?: AttachmentKind;\n media?: ReactNode;\n thumbnailUrl?: string;\n status?: AttachmentStatus;\n /** Upload progress in the 0–100 range. A missing uploading value is indeterminate. */\n progress?: number | null;\n error?: ReactNode;\n /** Override generated status copy while preserving status/progress behavior. */\n description?: ReactNode;\n /** Additional sibling actions. */\n actions?: ReactNode;\n /** Open or preview the whole body, with independent sibling action buttons. Uses the preview string for its accessible name. */\n onOpen?: () => void;\n onPreview?: () => void;\n onDownload?: () => void;\n onRemove?: () => void;\n disabled?: boolean;\n /** Compact horizontal chip, full list row, or a media-first gallery tile. */\n layout?: 'compact' | 'list' | 'gallery';\n size?: ItemSize;\n density?: ItemDensity;\n variant?: ItemVariant;\n /** Element used for a list item without wrapping or inspecting children. */\n render?: ReactElement;\n strings?: StringsProp<AttachmentStrings>;\n}\n","import { forwardRef } from 'react';\nimport { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { Archive, AudioLines, Download, Eye, FileCode, FileText, ImageIcon, Video, X } from 'lucide-react';\nimport { Button } from '../buttons';\nimport { FileSize } from '../../primitives';\nimport { Text } from '../../typography';\nimport { Progress, type ProgressProps } from '../feedback';\nimport { Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, type ItemMediaProps, type ItemContentProps, type ItemTitleProps, type ItemDescriptionProps, type ItemActionsProps } from '../item';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { defaultAttachmentStrings, type AttachmentProps, type AttachmentKind } from './attachment.types';\nimport { focusRecipes } from '../../../lib/focus-recipes';\n\nconst icons = { image: ImageIcon, document: FileText, audio: AudioLines, video: Video, code: FileCode, archive: Archive, generic: FileText };\n/** Filename categorization is display-only and does not trust a file's extension for validation. */\nexport function getAttachmentKind(name: string): AttachmentKind {\n const extension = name.split('.').at(-1)?.toLowerCase();\n if (extension && ['png','jpg','jpeg','gif','webp','svg','avif'].includes(extension)) return 'image';\n if (extension && ['mp3','wav','ogg','flac','m4a'].includes(extension)) return 'audio';\n if (extension && ['mp4','webm','mov','avi'].includes(extension)) return 'video';\n if (extension && ['zip','gz','tar','rar','7z'].includes(extension)) return 'archive';\n if (extension && ['ts','tsx','js','jsx','css','html','json','py','sh','sql'].includes(extension)) return 'code';\n if (extension && ['pdf','doc','docx','txt','md','xls','xlsx','csv'].includes(extension)) return 'document';\n return 'generic';\n}\nexport function AttachmentFileIcon({ name, kind }: { name: string; kind?: AttachmentKind }) { const Icon = icons[kind ?? getAttachmentKind(name)]; return <Icon aria-hidden=\"true\" />; }\nexport const AttachmentMedia = forwardRef<HTMLDivElement, ItemMediaProps>(function AttachmentMedia({ className, ...props }, ref) { return <ItemMedia {...props} ref={ref} className={cn('attachment--media self-center group-has-data-[slot=item-description]/item:self-center', className)} />; });\nexport const AttachmentContent = forwardRef<HTMLDivElement, ItemContentProps>(function AttachmentContent({ className, ...props }, ref) { return <ItemContent {...props} ref={ref} className={cn('attachment--content w-full max-w-full', className)} />; });\nexport const AttachmentTitle = forwardRef<HTMLDivElement, ItemTitleProps>(function AttachmentTitle({ className, ...props }, ref) { return <ItemTitle {...props} ref={ref} className={cn('attachment--title block w-full truncate [&>span]:block [&>span]:min-w-0 [&>span]:truncate', className)} />; });\nexport const AttachmentDescription = forwardRef<HTMLParagraphElement, ItemDescriptionProps>(function AttachmentDescription({ className, ...props }, ref) { return <ItemDescription {...props} ref={ref} className={cn('attachment--description', className)} />; });\nexport const AttachmentActions = forwardRef<HTMLDivElement, ItemActionsProps>(function AttachmentActions({ className, ...props }, ref) { return <ItemActions {...props} ref={ref} className={cn('attachment--actions relative z-10', className)} />; });\nexport function AttachmentProgress({ className, ...props }: ProgressProps) { return <Progress {...props} className={cn('attachment--progress', className)} />; }\n/** File presentation; callbacks own preview, transfer and removal. Card framing belongs to the caller. */\nexport const Attachment = forwardRef<HTMLDivElement, AttachmentProps>(function Attachment({\n name = '', meta, bytes, locale, kind, media, thumbnailUrl, status, progress, error, description, actions, onOpen, onPreview, onDownload, onRemove,\n disabled = false, layout = 'list', size, density, variant = 'outline', render, strings: stringsProp, children, className, ...props\n}, ref) {\n const strings = useStrings(defaultAttachmentStrings, stringsProp);\n const showProgress = status === 'queued' || status === 'uploading';\n const pct = progress === null || progress === undefined ? null : Number.isFinite(progress) ? Math.max(0, Math.min(100, progress)) : 0;\n const statusCopy = status ? strings[status] : undefined;\n return <Item {...props} ref={ref} render={render} size={size} density={density ?? (layout === 'compact' ? 'compact' : 'default')} variant={variant} padding=\"default\" data-status={status} data-layout={layout} data-disabled={disabled || undefined} className={cn('attachment--component relative isolate min-w-0 max-w-full bg-card text-card-foreground', layout === 'gallery' ? 'flex-col items-stretch' : 'flex-nowrap', status === 'error' && 'border-destructive', className)}>\n {children ?? <>\n {/* A gallery tile owns one full-width media frame. The row thumbnail recipe (a\n size-scaled square) would otherwise shrink a gallery image to an icon. */}\n <AttachmentMedia variant={thumbnailUrl && layout !== 'gallery' ? 'image' : 'icon'} className={layout === 'gallery' ? 'aspect-video h-auto w-full overflow-hidden rounded-inner bg-muted text-muted-foreground' : undefined}>{media ?? (thumbnailUrl ? <img src={thumbnailUrl} alt=\"\" className=\"h-full w-full object-cover\" /> : <AttachmentFileIcon name={name} kind={kind} />)}</AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle title={name}>{name}</AttachmentTitle>\n {(meta !== undefined || bytes !== undefined) && <AttachmentDescription clamp={1}>{meta ?? <FileSize value={bytes} locale={locale} size=\"xs\" type=\"secondary\" align=\"left\" />}</AttachmentDescription>}\n {(description !== undefined || statusCopy) && <AttachmentDescription clamp=\"none\">{description !== undefined ? description : <Text tag=\"span\" size=\"xs\" type={status === 'error' ? 'error' : 'secondary'}>{statusCopy}</Text>}{status === 'error' && error ? <> — <Text tag=\"span\" role=\"alert\" size=\"xs\" type=\"error\">{error}</Text></> : null}</AttachmentDescription>}\n {showProgress && <AttachmentProgress value={status === 'queued' && pct === null ? 0 : pct} aria-label={name} size=\"sm\" tone={status === 'queued' ? 'neutral' : 'primary'} />}\n </AttachmentContent>\n {(actions || onPreview || onDownload || onRemove) && <AttachmentActions>\n {onPreview && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly disabled={disabled} aria-label={strings.preview(name)} onClick={onPreview}><Eye aria-hidden=\"true\" className=\"size-icon-sm\" /></Button>}\n {onDownload && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly disabled={disabled} aria-label={strings.download(name)} onClick={onDownload}><Download aria-hidden=\"true\" className=\"size-icon-sm\" /></Button>}\n {onRemove && <Button type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly disabled={disabled} aria-label={strings.remove(name)} onClick={onRemove}><X aria-hidden=\"true\" className=\"size-icon-sm\" /></Button>}\n {actions}\n </AttachmentActions>}\n </>}\n {onOpen && <ButtonPrimitive type=\"button\" disabled={disabled} aria-label={strings.preview(name)} onClick={onOpen} className={`attachment--trigger absolute inset-0 z-0 cursor-pointer rounded-radius outline-none ${focusRecipes.inset} disabled:cursor-not-allowed`} />}\n </Item>;\n});\nAttachment.displayName = 'Attachment';\n"],"mappings":";;;;;;;;;;;;;;AAWA,IAAac,IAA8C;CAC1D,UAAS,MAAQ,WAAWC;CAAQ,WAAU,MAAQ,YAAYA;CAAQ,SAAQ,MAAQ,UAAUA;CACpG,QAAQ;CAAU,WAAW;CAAa,MAAM;CAAY,OAAO;CAAU,WAAW;AACzF,GCDMC,IAAQ;CAAE,OAAOC;CAAW,UAAUC;CAAU,OAAOC;CAAY,OAAOC;CAAO,MAAMC;CAAU,SAASC;CAAS,SAASJ;AAAS;AAE3I,SAAgBK,EAAkB,GAA8B;CAC/D,IAAMC,IAAYT,EAAK,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY;CAOtD,OANIS,KAAa;EAAC;EAAM;EAAM;EAAO;EAAM;EAAO;EAAM;CAAM,CAAC,CAAC,SAASA,CAAS,IAAU,UACxFA,KAAa;EAAC;EAAM;EAAM;EAAM;EAAO;CAAK,CAAC,CAAC,SAASA,CAAS,IAAU,UAC1EA,KAAa;EAAC;EAAM;EAAO;EAAM;CAAK,CAAC,CAAC,SAASA,CAAS,IAAU,UACpEA,KAAa;EAAC;EAAM;EAAK;EAAM;EAAM;CAAI,CAAC,CAAC,SAASA,CAAS,IAAU,YACvE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