@carbon/ai-chat-components 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/README.md +0 -3
  2. package/custom-elements.json +4827 -2917
  3. package/es/components/card/src/card-footer.d.ts +1 -1
  4. package/es/components/card/src/card-footer.js +2 -1
  5. package/es/components/card/src/card-footer.js.map +1 -1
  6. package/es/components/card/src/card-footer.scss.js +1 -1
  7. package/es/components/card/src/card-steps.d.ts +1 -1
  8. package/es/components/card/src/card-steps.js +2 -1
  9. package/es/components/card/src/card-steps.js.map +1 -1
  10. package/es/components/card/src/card-steps.scss.js +1 -1
  11. package/es/components/card/src/card.d.ts +1 -1
  12. package/es/components/card/src/card.js +2 -1
  13. package/es/components/card/src/card.js.map +1 -1
  14. package/es/components/card/src/card.scss.js +1 -1
  15. package/es/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
  16. package/es/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
  17. package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
  18. package/es/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
  19. package/es/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
  20. package/es/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
  21. package/es/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
  22. package/es/components/chain-of-thought/src/chain-of-thought.js +3 -2
  23. package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
  24. package/es/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
  25. package/es/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
  26. package/es/components/chain-of-thought/src/tool-call-data.js +2 -1
  27. package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
  28. package/es/components/chat-button/src/chat-button.d.ts +2 -2
  29. package/es/components/chat-button/src/chat-button.js +3 -2
  30. package/es/components/chat-button/src/chat-button.js.map +1 -1
  31. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  32. package/es/components/chat-shell/index.d.ts +2 -0
  33. package/es/components/chat-shell/index.js +1 -0
  34. package/es/components/chat-shell/index.js.map +1 -1
  35. package/es/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
  36. package/es/components/chat-shell/src/aria-announcer-manager.js +104 -0
  37. package/es/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
  38. package/es/components/chat-shell/src/chat-header.d.ts +177 -0
  39. package/es/components/chat-shell/src/chat-header.js +415 -0
  40. package/es/components/chat-shell/src/chat-header.js.map +1 -0
  41. package/es/components/chat-shell/src/chat-header.scss.js +13 -0
  42. package/es/components/chat-shell/src/chat-header.scss.js.map +1 -0
  43. package/es/components/chat-shell/src/corner-manager.d.ts +35 -0
  44. package/es/components/chat-shell/src/corner-manager.js +87 -0
  45. package/es/components/chat-shell/src/corner-manager.js.map +1 -0
  46. package/es/components/chat-shell/src/initialization-manager.d.ts +44 -0
  47. package/es/components/chat-shell/src/initialization-manager.js +88 -0
  48. package/es/components/chat-shell/src/initialization-manager.js.map +1 -0
  49. package/es/components/chat-shell/src/panel.d.ts +14 -1
  50. package/es/components/chat-shell/src/panel.js +32 -4
  51. package/es/components/chat-shell/src/panel.js.map +1 -1
  52. package/es/components/chat-shell/src/panel.scss.js +1 -1
  53. package/es/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
  54. package/es/components/chat-shell/src/resize-observer-manager.js +219 -0
  55. package/es/components/chat-shell/src/resize-observer-manager.js.map +1 -0
  56. package/es/components/chat-shell/src/shell.d.ts +54 -21
  57. package/es/components/chat-shell/src/shell.js +297 -287
  58. package/es/components/chat-shell/src/shell.js.map +1 -1
  59. package/es/components/chat-shell/src/shell.scss.js +1 -1
  60. package/es/components/chat-shell/src/slot-observer.d.ts +53 -0
  61. package/es/components/chat-shell/src/slot-observer.js +156 -0
  62. package/es/components/chat-shell/src/slot-observer.js.map +1 -0
  63. package/es/components/chat-shell/src/types.d.ts +66 -0
  64. package/es/components/chat-shell/src/types.js +8 -0
  65. package/es/components/chat-shell/src/types.js.map +1 -0
  66. package/es/components/chat-shell/src/workspace-manager.d.ts +12 -1
  67. package/es/components/chat-shell/src/workspace-manager.js +42 -2
  68. package/es/components/chat-shell/src/workspace-manager.js.map +1 -1
  69. package/es/components/code-snippet/index.d.ts +3 -2
  70. package/es/components/code-snippet/index.js +1 -1
  71. package/es/components/code-snippet/src/code-snippet.d.ts +58 -15
  72. package/es/components/code-snippet/src/code-snippet.js +261 -95
  73. package/es/components/code-snippet/src/code-snippet.js.map +1 -1
  74. package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
  75. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
  76. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
  77. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
  78. package/es/components/code-snippet/src/codemirror/editor-manager.js +18 -3
  79. package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  80. package/es/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
  81. package/es/components/code-snippet/src/codemirror/language-controller.js +11 -5
  82. package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
  83. package/es/components/code-snippet/src/codemirror/marker-utils.js +2 -1
  84. package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
  85. package/es/components/code-snippet/src/codemirror/theme.d.ts +12 -0
  86. package/es/components/code-snippet/src/codemirror/theme.js +26 -2
  87. package/es/components/code-snippet/src/codemirror/theme.js.map +1 -1
  88. package/es/components/code-snippet/src/dom-utils.d.ts +1 -0
  89. package/es/components/code-snippet/src/dom-utils.js +12 -1
  90. package/es/components/code-snippet/src/dom-utils.js.map +1 -1
  91. package/es/components/code-snippet/src/layout-utils.d.ts +9 -1
  92. package/es/components/code-snippet/src/layout-utils.js +21 -16
  93. package/es/components/code-snippet/src/layout-utils.js.map +1 -1
  94. package/es/components/code-snippet/src/streaming-manager.js +7 -0
  95. package/es/components/code-snippet/src/streaming-manager.js.map +1 -1
  96. package/es/components/feedback/src/feedback-buttons.d.ts +2 -0
  97. package/es/components/feedback/src/feedback-buttons.js +65 -3
  98. package/es/components/feedback/src/feedback-buttons.js.map +1 -1
  99. package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
  100. package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  101. package/es/components/feedback/src/feedback.d.ts +20 -10
  102. package/es/components/feedback/src/feedback.js +114 -20
  103. package/es/components/feedback/src/feedback.js.map +1 -1
  104. package/es/components/feedback/src/feedback.scss.js +1 -1
  105. package/es/components/markdown/src/markdown-renderer.d.ts +31 -21
  106. package/es/components/markdown/src/markdown-renderer.js +57 -48
  107. package/es/components/markdown/src/markdown-renderer.js.map +1 -1
  108. package/es/components/markdown/src/markdown.d.ts +34 -31
  109. package/es/components/markdown/src/markdown.js +221 -138
  110. package/es/components/markdown/src/markdown.js.map +1 -1
  111. package/es/components/markdown/src/markdown.scss.js +1 -1
  112. package/es/components/markdown/src/markdown.template.js +1 -1
  113. package/es/components/markdown/src/utils.d.ts +0 -4
  114. package/es/components/markdown/src/utils.js +1 -7
  115. package/es/components/markdown/src/utils.js.map +1 -1
  116. package/es/components/processing/src/processing.d.ts +1 -1
  117. package/es/components/processing/src/processing.js +2 -1
  118. package/es/components/processing/src/processing.js.map +1 -1
  119. package/es/components/processing/src/processing.scss.js +1 -1
  120. package/es/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
  121. package/es/components/reasoning-steps/src/reasoning-step.js +2 -1
  122. package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  123. package/es/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
  124. package/es/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
  125. package/es/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
  126. package/es/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  127. package/es/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
  128. package/es/components/reasoning-steps/src/reasoning-steps.js +3 -5
  129. package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  130. package/es/components/table/src/table-pagination.template.js +3 -2
  131. package/es/components/table/src/table-pagination.template.js.map +1 -1
  132. package/es/components/table/src/table-skeleton.template.js +8 -6
  133. package/es/components/table/src/table-skeleton.template.js.map +1 -1
  134. package/es/components/table/src/table.d.ts +29 -3
  135. package/es/components/table/src/table.js +99 -6
  136. package/es/components/table/src/table.js.map +1 -1
  137. package/es/components/table/src/table.scss.js +1 -1
  138. package/es/components/table/src/table.template.js +11 -2
  139. package/es/components/table/src/table.template.js.map +1 -1
  140. package/es/components/toolbar/src/toolbar.d.ts +32 -5
  141. package/es/components/toolbar/src/toolbar.js +111 -47
  142. package/es/components/toolbar/src/toolbar.js.map +1 -1
  143. package/es/components/toolbar/src/toolbar.scss.js +1 -1
  144. package/es/components/truncated-text/index.d.ts +9 -0
  145. package/es/components/truncated-text/index.js +9 -0
  146. package/es/components/truncated-text/index.js.map +1 -0
  147. package/es/components/truncated-text/src/truncated-text.d.ts +81 -0
  148. package/es/components/truncated-text/src/truncated-text.js +282 -0
  149. package/es/components/truncated-text/src/truncated-text.js.map +1 -0
  150. package/es/components/truncated-text/src/truncated-text.scss.js +13 -0
  151. package/es/components/truncated-text/src/truncated-text.scss.js.map +1 -0
  152. package/es/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
  153. package/es/components/workspace-shell/src/header-collapsible-manager.js +223 -0
  154. package/es/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
  155. package/es/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
  156. package/es/components/workspace-shell/src/workspace-shell-body.js +2 -1
  157. package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
  158. package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
  159. package/es/components/workspace-shell/src/workspace-shell-footer.js +8 -6
  160. package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
  161. package/es/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
  162. package/es/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
  163. package/es/components/workspace-shell/src/workspace-shell-header.js +88 -14
  164. package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
  165. package/es/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
  166. package/es/components/workspace-shell/src/workspace-shell.d.ts +16 -2
  167. package/es/components/workspace-shell/src/workspace-shell.js +77 -7
  168. package/es/components/workspace-shell/src/workspace-shell.js.map +1 -1
  169. package/es/components/workspace-shell/src/workspace-shell.scss.js +1 -1
  170. package/es/globals/scss/common.scss.js +13 -0
  171. package/es/globals/scss/common.scss.js.map +1 -0
  172. package/es/globals/utils/focus-utils.d.ts +57 -0
  173. package/es/globals/utils/focus-utils.js +180 -0
  174. package/es/globals/utils/focus-utils.js.map +1 -0
  175. package/es/react/card.d.ts +3 -6
  176. package/es/react/chain-of-thought-step.d.ts +1 -2
  177. package/es/react/chain-of-thought-toggle.d.ts +1 -2
  178. package/es/react/chain-of-thought.d.ts +1 -2
  179. package/es/react/chat-button.d.ts +2 -2
  180. package/es/react/chat-button.js +1 -1
  181. package/es/react/chat-header.d.ts +73 -0
  182. package/es/react/chat-header.js +55 -0
  183. package/es/react/chat-header.js.map +1 -0
  184. package/es/react/chat-shell.d.ts +1 -2
  185. package/es/react/code-snippet.d.ts +35 -2
  186. package/es/react/code-snippet.js +65 -9
  187. package/es/react/code-snippet.js.map +1 -1
  188. package/es/react/feedback-buttons.d.ts +1 -2
  189. package/es/react/feedback.d.ts +1 -2
  190. package/es/react/markdown.d.ts +1 -2
  191. package/es/react/markdown.js +11 -1
  192. package/es/react/markdown.js.map +1 -1
  193. package/es/react/panel.d.ts +1 -2
  194. package/es/react/processing.d.ts +1 -2
  195. package/es/react/reasoning-step.d.ts +1 -2
  196. package/es/react/reasoning-steps-toggle.d.ts +1 -2
  197. package/es/react/reasoning-steps.d.ts +1 -2
  198. package/es/react/tool-call-data.d.ts +1 -2
  199. package/es/react/toolbar.d.ts +14 -10
  200. package/es/react/toolbar.js +2 -0
  201. package/es/react/toolbar.js.map +1 -1
  202. package/es/react/utils/withWebComponentBridge.d.ts +5 -2
  203. package/es/react/utils/withWebComponentBridge.js +49 -1
  204. package/es/react/utils/withWebComponentBridge.js.map +1 -1
  205. package/es/react/workspace-shell.d.ts +4 -8
  206. package/es/testing/PageObjectId.d.ts +22 -0
  207. package/es/testing/PageObjectId.js +38 -0
  208. package/es/testing/PageObjectId.js.map +1 -0
  209. package/es/typings/overflow-menu.d.ts +30 -0
  210. package/es/typings/overflow-menu.js +8 -0
  211. package/es/typings/overflow-menu.js.map +1 -0
  212. package/es-custom/components/card/src/card-footer.d.ts +1 -1
  213. package/es-custom/components/card/src/card-footer.js +2 -1
  214. package/es-custom/components/card/src/card-footer.js.map +1 -1
  215. package/es-custom/components/card/src/card-footer.scss.js +1 -1
  216. package/es-custom/components/card/src/card-steps.d.ts +1 -1
  217. package/es-custom/components/card/src/card-steps.js +2 -1
  218. package/es-custom/components/card/src/card-steps.js.map +1 -1
  219. package/es-custom/components/card/src/card-steps.scss.js +1 -1
  220. package/es-custom/components/card/src/card.d.ts +1 -1
  221. package/es-custom/components/card/src/card.js +2 -1
  222. package/es-custom/components/card/src/card.js.map +1 -1
  223. package/es-custom/components/card/src/card.scss.js +1 -1
  224. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
  225. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
  226. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
  227. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
  228. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
  229. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
  230. package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
  231. package/es-custom/components/chain-of-thought/src/chain-of-thought.js +3 -2
  232. package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
  233. package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
  234. package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
  235. package/es-custom/components/chain-of-thought/src/tool-call-data.js +2 -1
  236. package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
  237. package/es-custom/components/chat-button/src/chat-button.d.ts +2 -2
  238. package/es-custom/components/chat-button/src/chat-button.js +3 -2
  239. package/es-custom/components/chat-button/src/chat-button.js.map +1 -1
  240. package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
  241. package/es-custom/components/chat-shell/index.d.ts +2 -0
  242. package/es-custom/components/chat-shell/index.js +1 -0
  243. package/es-custom/components/chat-shell/index.js.map +1 -1
  244. package/es-custom/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
  245. package/es-custom/components/chat-shell/src/aria-announcer-manager.js +104 -0
  246. package/es-custom/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
  247. package/es-custom/components/chat-shell/src/chat-header.d.ts +177 -0
  248. package/es-custom/components/chat-shell/src/chat-header.js +415 -0
  249. package/es-custom/components/chat-shell/src/chat-header.js.map +1 -0
  250. package/es-custom/components/chat-shell/src/chat-header.scss.js +13 -0
  251. package/es-custom/components/chat-shell/src/chat-header.scss.js.map +1 -0
  252. package/es-custom/components/chat-shell/src/corner-manager.d.ts +35 -0
  253. package/es-custom/components/chat-shell/src/corner-manager.js +87 -0
  254. package/es-custom/components/chat-shell/src/corner-manager.js.map +1 -0
  255. package/es-custom/components/chat-shell/src/initialization-manager.d.ts +44 -0
  256. package/es-custom/components/chat-shell/src/initialization-manager.js +88 -0
  257. package/es-custom/components/chat-shell/src/initialization-manager.js.map +1 -0
  258. package/es-custom/components/chat-shell/src/panel.d.ts +14 -1
  259. package/es-custom/components/chat-shell/src/panel.js +32 -4
  260. package/es-custom/components/chat-shell/src/panel.js.map +1 -1
  261. package/es-custom/components/chat-shell/src/panel.scss.js +1 -1
  262. package/es-custom/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
  263. package/es-custom/components/chat-shell/src/resize-observer-manager.js +219 -0
  264. package/es-custom/components/chat-shell/src/resize-observer-manager.js.map +1 -0
  265. package/es-custom/components/chat-shell/src/shell.d.ts +54 -21
  266. package/es-custom/components/chat-shell/src/shell.js +297 -287
  267. package/es-custom/components/chat-shell/src/shell.js.map +1 -1
  268. package/es-custom/components/chat-shell/src/shell.scss.js +1 -1
  269. package/es-custom/components/chat-shell/src/slot-observer.d.ts +53 -0
  270. package/es-custom/components/chat-shell/src/slot-observer.js +156 -0
  271. package/es-custom/components/chat-shell/src/slot-observer.js.map +1 -0
  272. package/es-custom/components/chat-shell/src/types.d.ts +66 -0
  273. package/es-custom/components/chat-shell/src/types.js +8 -0
  274. package/es-custom/components/chat-shell/src/types.js.map +1 -0
  275. package/es-custom/components/chat-shell/src/workspace-manager.d.ts +12 -1
  276. package/es-custom/components/chat-shell/src/workspace-manager.js +42 -2
  277. package/es-custom/components/chat-shell/src/workspace-manager.js.map +1 -1
  278. package/es-custom/components/code-snippet/index.d.ts +3 -2
  279. package/es-custom/components/code-snippet/index.js +1 -1
  280. package/es-custom/components/code-snippet/src/code-snippet.d.ts +58 -15
  281. package/es-custom/components/code-snippet/src/code-snippet.js +261 -95
  282. package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
  283. package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
  284. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
  285. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
  286. package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
  287. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +18 -3
  288. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  289. package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
  290. package/es-custom/components/code-snippet/src/codemirror/language-controller.js +11 -5
  291. package/es-custom/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
  292. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +2 -1
  293. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
  294. package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +12 -0
  295. package/es-custom/components/code-snippet/src/codemirror/theme.js +26 -2
  296. package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -1
  297. package/es-custom/components/code-snippet/src/dom-utils.d.ts +1 -0
  298. package/es-custom/components/code-snippet/src/dom-utils.js +12 -1
  299. package/es-custom/components/code-snippet/src/dom-utils.js.map +1 -1
  300. package/es-custom/components/code-snippet/src/layout-utils.d.ts +9 -1
  301. package/es-custom/components/code-snippet/src/layout-utils.js +21 -16
  302. package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -1
  303. package/es-custom/components/code-snippet/src/streaming-manager.js +7 -0
  304. package/es-custom/components/code-snippet/src/streaming-manager.js.map +1 -1
  305. package/es-custom/components/feedback/src/feedback-buttons.d.ts +2 -0
  306. package/es-custom/components/feedback/src/feedback-buttons.js +65 -3
  307. package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
  308. package/es-custom/components/feedback/src/feedback-buttons.scss.js +13 -0
  309. package/es-custom/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  310. package/es-custom/components/feedback/src/feedback.d.ts +20 -10
  311. package/es-custom/components/feedback/src/feedback.js +114 -20
  312. package/es-custom/components/feedback/src/feedback.js.map +1 -1
  313. package/es-custom/components/feedback/src/feedback.scss.js +1 -1
  314. package/es-custom/components/markdown/src/markdown-renderer.d.ts +31 -21
  315. package/es-custom/components/markdown/src/markdown-renderer.js +57 -48
  316. package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
  317. package/es-custom/components/markdown/src/markdown.d.ts +34 -31
  318. package/es-custom/components/markdown/src/markdown.js +221 -138
  319. package/es-custom/components/markdown/src/markdown.js.map +1 -1
  320. package/es-custom/components/markdown/src/markdown.scss.js +1 -1
  321. package/es-custom/components/markdown/src/markdown.template.js +1 -1
  322. package/es-custom/components/markdown/src/utils.d.ts +0 -4
  323. package/es-custom/components/markdown/src/utils.js +1 -7
  324. package/es-custom/components/markdown/src/utils.js.map +1 -1
  325. package/es-custom/components/processing/src/processing.d.ts +1 -1
  326. package/es-custom/components/processing/src/processing.js +2 -1
  327. package/es-custom/components/processing/src/processing.js.map +1 -1
  328. package/es-custom/components/processing/src/processing.scss.js +1 -1
  329. package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
  330. package/es-custom/components/reasoning-steps/src/reasoning-step.js +2 -1
  331. package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  332. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
  333. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
  334. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
  335. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  336. package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
  337. package/es-custom/components/reasoning-steps/src/reasoning-steps.js +3 -5
  338. package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  339. package/es-custom/components/table/src/table-pagination.template.js +3 -2
  340. package/es-custom/components/table/src/table-pagination.template.js.map +1 -1
  341. package/es-custom/components/table/src/table-skeleton.template.js +8 -6
  342. package/es-custom/components/table/src/table-skeleton.template.js.map +1 -1
  343. package/es-custom/components/table/src/table.d.ts +29 -3
  344. package/es-custom/components/table/src/table.js +99 -6
  345. package/es-custom/components/table/src/table.js.map +1 -1
  346. package/es-custom/components/table/src/table.scss.js +1 -1
  347. package/es-custom/components/table/src/table.template.js +11 -2
  348. package/es-custom/components/table/src/table.template.js.map +1 -1
  349. package/es-custom/components/toolbar/src/toolbar.d.ts +32 -5
  350. package/es-custom/components/toolbar/src/toolbar.js +111 -47
  351. package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
  352. package/es-custom/components/toolbar/src/toolbar.scss.js +1 -1
  353. package/es-custom/components/truncated-text/index.d.ts +9 -0
  354. package/es-custom/components/truncated-text/index.js +9 -0
  355. package/es-custom/components/truncated-text/index.js.map +1 -0
  356. package/es-custom/components/truncated-text/src/truncated-text.d.ts +81 -0
  357. package/es-custom/components/truncated-text/src/truncated-text.js +282 -0
  358. package/es-custom/components/truncated-text/src/truncated-text.js.map +1 -0
  359. package/es-custom/components/truncated-text/src/truncated-text.scss.js +13 -0
  360. package/es-custom/components/truncated-text/src/truncated-text.scss.js.map +1 -0
  361. package/es-custom/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
  362. package/es-custom/components/workspace-shell/src/header-collapsible-manager.js +223 -0
  363. package/es-custom/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
  364. package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
  365. package/es-custom/components/workspace-shell/src/workspace-shell-body.js +2 -1
  366. package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
  367. package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
  368. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +8 -6
  369. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
  370. package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
  371. package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
  372. package/es-custom/components/workspace-shell/src/workspace-shell-header.js +88 -14
  373. package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
  374. package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
  375. package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +16 -2
  376. package/es-custom/components/workspace-shell/src/workspace-shell.js +77 -7
  377. package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -1
  378. package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +1 -1
  379. package/es-custom/globals/scss/common.scss.js +13 -0
  380. package/es-custom/globals/scss/common.scss.js.map +1 -0
  381. package/es-custom/globals/utils/focus-utils.d.ts +57 -0
  382. package/es-custom/globals/utils/focus-utils.js +180 -0
  383. package/es-custom/globals/utils/focus-utils.js.map +1 -0
  384. package/es-custom/react/card.d.ts +3 -6
  385. package/es-custom/react/chain-of-thought-step.d.ts +1 -2
  386. package/es-custom/react/chain-of-thought-toggle.d.ts +1 -2
  387. package/es-custom/react/chain-of-thought.d.ts +1 -2
  388. package/es-custom/react/chat-button.d.ts +2 -2
  389. package/es-custom/react/chat-button.js +1 -1
  390. package/es-custom/react/chat-header.d.ts +73 -0
  391. package/es-custom/react/chat-header.js +55 -0
  392. package/es-custom/react/chat-header.js.map +1 -0
  393. package/es-custom/react/chat-shell.d.ts +1 -2
  394. package/es-custom/react/code-snippet.d.ts +35 -2
  395. package/es-custom/react/code-snippet.js +65 -9
  396. package/es-custom/react/code-snippet.js.map +1 -1
  397. package/es-custom/react/feedback-buttons.d.ts +1 -2
  398. package/es-custom/react/feedback.d.ts +1 -2
  399. package/es-custom/react/markdown.d.ts +1 -2
  400. package/es-custom/react/markdown.js +11 -1
  401. package/es-custom/react/markdown.js.map +1 -1
  402. package/es-custom/react/panel.d.ts +1 -2
  403. package/es-custom/react/processing.d.ts +1 -2
  404. package/es-custom/react/reasoning-step.d.ts +1 -2
  405. package/es-custom/react/reasoning-steps-toggle.d.ts +1 -2
  406. package/es-custom/react/reasoning-steps.d.ts +1 -2
  407. package/es-custom/react/tool-call-data.d.ts +1 -2
  408. package/es-custom/react/toolbar.d.ts +14 -10
  409. package/es-custom/react/toolbar.js +2 -0
  410. package/es-custom/react/toolbar.js.map +1 -1
  411. package/es-custom/react/utils/withWebComponentBridge.d.ts +5 -2
  412. package/es-custom/react/utils/withWebComponentBridge.js +49 -1
  413. package/es-custom/react/utils/withWebComponentBridge.js.map +1 -1
  414. package/es-custom/react/workspace-shell.d.ts +4 -8
  415. package/es-custom/testing/PageObjectId.d.ts +22 -0
  416. package/es-custom/testing/PageObjectId.js +38 -0
  417. package/es-custom/testing/PageObjectId.js.map +1 -0
  418. package/es-custom/typings/overflow-menu.d.ts +30 -0
  419. package/es-custom/typings/overflow-menu.js +8 -0
  420. package/es-custom/typings/overflow-menu.js.map +1 -0
  421. package/package.json +6 -4
  422. package/scss/_custom-properties.scss +70 -0
  423. package/scss/_modifiers.scss +231 -0
  424. package/scss/_tokens-component.scss +30 -0
  425. package/scss/_tokens-layout.scss +29 -0
  426. package/scss/_utilities.scss +32 -0
  427. package/scss/common.scss +150 -0
  428. package/scss/grid.scss +11 -0
  429. package/scss/themes.scss +33 -0
  430. package/scss/vars.scss +12 -0
  431. package/telemetry.yml +73 -33
  432. package/es/components/code-snippet/src/code-snippet-card.d.ts +0 -63
  433. package/es/components/code-snippet/src/code-snippet-card.js +0 -187
  434. package/es/components/code-snippet/src/code-snippet-card.js.map +0 -1
  435. package/es/components/feedback/src/feedback-buttons.template.d.ts +0 -4
  436. package/es/components/feedback/src/feedback-buttons.template.js +0 -79
  437. package/es/components/feedback/src/feedback-buttons.template.js.map +0 -1
  438. package/es/components/feedback/src/feedback.template.d.ts +0 -12
  439. package/es/components/feedback/src/feedback.template.js +0 -115
  440. package/es/components/feedback/src/feedback.template.js.map +0 -1
  441. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
  442. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
  443. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
  444. package/es/react/code-snippet-card.d.ts +0 -4
  445. package/es/react/code-snippet-card.js +0 -31
  446. package/es/react/code-snippet-card.js.map +0 -1
  447. package/es-custom/components/code-snippet/src/code-snippet-card.d.ts +0 -63
  448. package/es-custom/components/code-snippet/src/code-snippet-card.js +0 -187
  449. package/es-custom/components/code-snippet/src/code-snippet-card.js.map +0 -1
  450. package/es-custom/components/feedback/src/feedback-buttons.template.d.ts +0 -4
  451. package/es-custom/components/feedback/src/feedback-buttons.template.js +0 -79
  452. package/es-custom/components/feedback/src/feedback-buttons.template.js.map +0 -1
  453. package/es-custom/components/feedback/src/feedback.template.d.ts +0 -12
  454. package/es-custom/components/feedback/src/feedback.template.js +0 -115
  455. package/es-custom/components/feedback/src/feedback.template.js.map +0 -1
  456. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
  457. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
  458. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
  459. package/es-custom/react/code-snippet-card.d.ts +0 -4
  460. package/es-custom/react/code-snippet-card.js +0 -31
  461. package/es-custom/react/code-snippet-card.js.map +0 -1
@@ -0,0 +1,415 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { __decorate } from 'tslib';
9
+ import { LitElement, nothing, html } from 'lit';
10
+ import { property } from 'lit/decorators.js';
11
+ import { carbonElement } from '../../../globals/decorators/carbon-element.js';
12
+ import { iconLoader } from '@carbon/web-components/es/globals/internal/icon-loader.js';
13
+ import '@carbon/web-components/es/components/button/index.js';
14
+ import '@carbon/web-components/es/components/overflow-menu/index.js';
15
+ import '../../toolbar/src/toolbar.js';
16
+ import prefix from '../../../globals/settings.js';
17
+ import { PageObjectId } from '../../../testing/PageObjectId.js';
18
+ import { tryFocus } from '../../../globals/utils/focus-utils.js';
19
+ import styles from './chat-header.scss.js';
20
+
21
+ /*
22
+ * Copyright IBM Corp. 2025
23
+ *
24
+ * This source code is licensed under the Apache-2.0 license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ *
27
+ * @license
28
+ */
29
+ var CdsAiChatChatHeader_1;
30
+ /**
31
+ * Chat Header component that wraps the Toolbar component.
32
+ * Provides a consistent header for chat interfaces with support for
33
+ * navigation, title, actions, and decorators (like AI labels).
34
+ *
35
+ * @element cds-aichat-chat-header
36
+ * @slot navigation - Navigation controls (e.g., back button, overflow menu)
37
+ * @slot title - Title and name content (can also use title/name properties)
38
+ * @slot decorator - Decorative elements like AI labels
39
+ * @slot fixed-actions - Actions that never overflow (allows passing custom components)
40
+ */
41
+ let CdsAiChatChatHeader = CdsAiChatChatHeader_1 = class CdsAiChatChatHeader extends LitElement {
42
+ constructor() {
43
+ super(...arguments);
44
+ /**
45
+ * Array of actions that can overflow into a menu when space is limited.
46
+ */
47
+ this.actions = [];
48
+ /**
49
+ * Enable overflow behavior for actions.
50
+ */
51
+ this.overflow = false;
52
+ /**
53
+ * Optional header title text to display.
54
+ */
55
+ this.headerTitle = "";
56
+ /**
57
+ * Optional name text to display after the title.
58
+ */
59
+ this.headerName = "";
60
+ /**
61
+ * Type of navigation to display: 'back', 'overflow', or 'none'.
62
+ */
63
+ this.navigationType = "none";
64
+ /**
65
+ * Label/tooltip text for the back button.
66
+ */
67
+ this.navigationBackLabel = "";
68
+ /**
69
+ * Label/tooltip text for the overflow menu button.
70
+ */
71
+ this.navigationOverflowLabel = "";
72
+ }
73
+ /**
74
+ * Attempts to focus an element if it's focusable and not disabled.
75
+ * Uses the enhanced tryFocus utility from focus-utils which checks
76
+ * visibility, accessibility attributes, and proper focusability.
77
+ *
78
+ * @param element - The element to attempt to focus
79
+ * @returns True if focus was successfully set, false otherwise
80
+ */
81
+ tryFocusElement(element) {
82
+ return tryFocus(element);
83
+ }
84
+ /**
85
+ * Attempts to focus buttons within a named slot.
86
+ * Reduces duplication by centralizing slot querying logic.
87
+ *
88
+ * @param slotName - The name of the slot to query
89
+ * @param selectors - CSS selector string for buttons to find
90
+ * @returns True if a button was focused, false otherwise
91
+ */
92
+ tryFocusSlotButtons(slotName, selectors) {
93
+ const slot = this.shadowRoot?.querySelector(`slot[name="${slotName}"]`);
94
+ if (!slot) {
95
+ return false;
96
+ }
97
+ for (const el of slot.assignedElements()) {
98
+ const button = el.querySelector(selectors);
99
+ if (button instanceof HTMLElement && this.tryFocusElement(button)) {
100
+ return true;
101
+ }
102
+ }
103
+ return false;
104
+ }
105
+ /**
106
+ * Requests focus on the best available focusable element within the component.
107
+ * This method implements a generic focus management pattern that can be used
108
+ * across all web components.
109
+ *
110
+ * Priority order:
111
+ * 1. First enabled button in navigation (either slotted or rendered from properties)
112
+ * 2. First enabled button in fixed-actions slot (usually close button)
113
+ * 3. First enabled action button from toolbar (rendered by actions array)
114
+ * 4. Any other focusable element (last resort)
115
+ *
116
+ * @returns True if focus was successfully set, false otherwise
117
+ */
118
+ requestFocus() {
119
+ // Check if navigation is rendered from properties
120
+ const hasNavigationProps = this.navigationType && this.navigationType !== "none";
121
+ // Define focus strategies in priority order
122
+ const focusStrategies = [
123
+ // 1. Try navigation - either slotted or rendered from properties
124
+ () => {
125
+ if (hasNavigationProps) {
126
+ // Navigation rendered from properties - query toolbar's navigation slot
127
+ const toolbar = this.shadowRoot?.querySelector(`${prefix}-toolbar`);
128
+ const navSlot = toolbar?.shadowRoot?.querySelector('slot[name="navigation"]');
129
+ if (navSlot) {
130
+ // Get the assigned elements from the toolbar's navigation slot
131
+ const assignedElements = navSlot.assignedElements();
132
+ for (const el of assignedElements) {
133
+ // The element itself might be the button (e.g., cds-icon-button)
134
+ if (this.tryFocusElement(el)) {
135
+ return true;
136
+ }
137
+ // Or it might be a wrapper div containing the button
138
+ const button = el.querySelector(CdsAiChatChatHeader_1.NAV_BUTTON_SELECTORS);
139
+ if (button && this.tryFocusElement(button)) {
140
+ return true;
141
+ }
142
+ }
143
+ }
144
+ return false;
145
+ }
146
+ else {
147
+ // Navigation slotted - query slot for buttons
148
+ return this.tryFocusSlotButtons("navigation", CdsAiChatChatHeader_1.NAV_BUTTON_SELECTORS);
149
+ }
150
+ },
151
+ // 2. Try fixed-actions slot
152
+ () => this.tryFocusSlotButtons("fixed-actions", CdsAiChatChatHeader_1.BUTTON_SELECTORS),
153
+ // 3. Try toolbar action buttons
154
+ () => {
155
+ const toolbar = this.shadowRoot?.querySelector(`${prefix}-toolbar`);
156
+ const buttons = toolbar?.shadowRoot?.querySelectorAll(CdsAiChatChatHeader_1.TOOLBAR_ACTION_SELECTOR);
157
+ return (buttons?.[0] instanceof HTMLElement &&
158
+ this.tryFocusElement(buttons[0]));
159
+ },
160
+ // 4. Try any focusable element as last resort
161
+ () => {
162
+ const focusable = this.shadowRoot?.querySelector(CdsAiChatChatHeader_1.FOCUSABLE_SELECTORS);
163
+ return (focusable instanceof HTMLElement && this.tryFocusElement(focusable));
164
+ },
165
+ ];
166
+ // Execute strategies until one succeeds
167
+ return focusStrategies.some((strategy) => strategy());
168
+ }
169
+ /**
170
+ * Renders the overflow menu items.
171
+ */
172
+ renderOverflowMenuItems() {
173
+ return this.navigationOverflowItems?.map((item) => html `
174
+ <cds-overflow-menu-item
175
+ @click=${item.onClick}
176
+ href=${item.href || nothing}
177
+ target=${item.href ? item.target || "_self" : nothing}
178
+ ?disabled=${item.disabled}
179
+ ?danger=${item.danger}
180
+ danger-description=${item.dangerDescription || nothing}
181
+ ?divider=${item.divider}
182
+ data-testid=${item.testId || nothing}
183
+ >
184
+ ${item.text}
185
+ </cds-overflow-menu-item>
186
+ `);
187
+ }
188
+ /**
189
+ * Checks if back navigation should be rendered.
190
+ * @returns True if back navigation type is set and icon is provided
191
+ */
192
+ shouldRenderBackNavigation() {
193
+ return this.navigationType === "back" && !!this.navigationBackIcon;
194
+ }
195
+ /**
196
+ * Checks if overflow navigation should be rendered.
197
+ * @returns True if overflow navigation type is set and items are available
198
+ */
199
+ shouldRenderOverflowNavigation() {
200
+ return (this.navigationType === "overflow" &&
201
+ !!this.navigationOverflowItems?.length);
202
+ }
203
+ /**
204
+ * Gets the configuration object for overflow menu icon.
205
+ * @returns Icon loader configuration with class and slot
206
+ */
207
+ getOverflowIconConfig() {
208
+ return {
209
+ class: `${prefix}-chat-header-overflow-icon`,
210
+ slot: "icon",
211
+ };
212
+ }
213
+ /**
214
+ * Renders the back navigation button.
215
+ * @returns Template result for back button
216
+ */
217
+ renderBackNavigation() {
218
+ return html `
219
+ <div slot="navigation">
220
+ <cds-icon-button
221
+ kind="ghost"
222
+ size="md"
223
+ tooltip-alignment=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.alignment}
224
+ tooltip-position=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.position}
225
+ enter-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.enterDelayMs}
226
+ leave-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.leaveDelayMs}
227
+ @click=${this.navigationBackOnClick}
228
+ >
229
+ ${iconLoader(this.navigationBackIcon, CdsAiChatChatHeader_1.BACK_ICON_CONFIG)}
230
+ <span slot="tooltip-content">${this.navigationBackLabel}</span>
231
+ </cds-icon-button>
232
+ </div>
233
+ `;
234
+ }
235
+ /**
236
+ * Renders the overflow navigation menu.
237
+ * @returns Template result for overflow menu
238
+ */
239
+ renderOverflowNavigation() {
240
+ // Check if RTL direction is set
241
+ const isRTL = document.dir === "rtl" || document.documentElement.dir === "rtl";
242
+ // For LTR: menu opens right
243
+ // For RTL: menu opens left
244
+ const menuAlignment = isRTL ? "left" : "right";
245
+ return html `
246
+ <div
247
+ slot="navigation"
248
+ data-floating-menu-container
249
+ class="${prefix}-chat-header-overflow-wrapper"
250
+ >
251
+ <cds-overflow-menu
252
+ align=${menuAlignment}
253
+ tooltip-alignment=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.alignment}
254
+ tooltip-position=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.position}
255
+ enter-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.enterDelayMs}
256
+ leave-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.leaveDelayMs}
257
+ @click=${this.navigationOverflowOnClick}
258
+ >
259
+ ${this.navigationOverflowIcon
260
+ ? iconLoader(this.navigationOverflowIcon, this.getOverflowIconConfig())
261
+ : nothing}
262
+ <span slot="tooltip-content">${this.navigationOverflowLabel}</span>
263
+ <cds-overflow-menu-body>
264
+ ${this.renderOverflowMenuItems()}
265
+ </cds-overflow-menu-body>
266
+ </cds-overflow-menu>
267
+ </div>
268
+ `;
269
+ }
270
+ /**
271
+ * Renders the navigation content based on navigationType.
272
+ * Uses guard clauses and extracted methods for clarity.
273
+ * @returns Template result for navigation or nothing
274
+ */
275
+ renderNavigation() {
276
+ if (!this.navigationType || this.navigationType === "none") {
277
+ return nothing;
278
+ }
279
+ if (this.shouldRenderBackNavigation()) {
280
+ return this.renderBackNavigation();
281
+ }
282
+ if (this.shouldRenderOverflowNavigation()) {
283
+ return this.renderOverflowNavigation();
284
+ }
285
+ return nothing;
286
+ }
287
+ /**
288
+ * Renders the title content based on headerTitle and headerName properties.
289
+ * @returns Template result for title content or title slot
290
+ */
291
+ renderTitle() {
292
+ const hasTitle = this.headerTitle || this.headerName;
293
+ if (!hasTitle) {
294
+ return html `<slot name="title"></slot>`;
295
+ }
296
+ return html `
297
+ <div slot="title" class="cds-aichat-chat-header__title">
298
+ ${this.headerTitle
299
+ ? html `
300
+ <span
301
+ class="cds-aichat-chat-header__title-text"
302
+ data-testid=${PageObjectId.HEADER_TITLE}
303
+ >
304
+ ${this.headerTitle}
305
+ </span>
306
+ `
307
+ : nothing}
308
+ ${this.headerName
309
+ ? html `
310
+ <span
311
+ class="cds-aichat-chat-header__name-text"
312
+ data-testid=${PageObjectId.HEADER_NAME}
313
+ >
314
+ ${this.headerName}
315
+ </span>
316
+ `
317
+ : nothing}
318
+ </div>
319
+ `;
320
+ }
321
+ render() {
322
+ // Determine if we should render navigation from props or use slot
323
+ const hasNavigationProps = this.navigationType && this.navigationType !== "none";
324
+ const navigationContent = hasNavigationProps
325
+ ? this.renderNavigation()
326
+ : html `<slot name="navigation"></slot>`;
327
+ return html `
328
+ <cds-aichat-toolbar
329
+ .actions=${this.actions}
330
+ ?overflow=${this.overflow}
331
+ titleText=${this.headerTitle || nothing}
332
+ nameText=${this.headerName || nothing}
333
+ data-testid=${PageObjectId.CHAT_HEADER}
334
+ >
335
+ ${navigationContent}
336
+ ${!this.headerTitle && !this.headerName ? this.renderTitle() : nothing}
337
+ <slot name="fixed-actions" slot="fixed-actions"></slot>
338
+ <slot name="decorator" slot="decorator"></slot>
339
+ </cds-aichat-toolbar>
340
+ `;
341
+ }
342
+ };
343
+ CdsAiChatChatHeader.styles = styles;
344
+ /**
345
+ * Selector strings for finding focusable elements.
346
+ *
347
+ * Design rationale:
348
+ * - BUTTON_SELECTORS: Used for fixed-actions slot. Targets Carbon buttons and native buttons.
349
+ * - NAV_BUTTON_SELECTORS: Used for navigation slot. Includes overflow menu for navigation patterns.
350
+ * - TOOLBAR_ACTION_SELECTOR: Specifically targets toolbar icon buttons (most common action type).
351
+ * - FOCUSABLE_SELECTORS: Fallback selector for any focusable element. Uses "*" because the
352
+ * tryFocus() utility already performs comprehensive validation including:
353
+ * - Visibility checks (display, visibility, hidden, inert, aria-hidden)
354
+ * - Focusability validation (handles standard elements and custom elements with delegatesFocus)
355
+ * - Actual focus verification (checks if document.activeElement changed)
356
+ * This approach avoids duplicating validation logic and properly handles Carbon components.
357
+ */
358
+ CdsAiChatChatHeader.BUTTON_SELECTORS = "cds-button, cds-icon-button, button";
359
+ CdsAiChatChatHeader.NAV_BUTTON_SELECTORS = "cds-button, cds-icon-button, cds-overflow-menu, button";
360
+ CdsAiChatChatHeader.FOCUSABLE_SELECTORS = "*";
361
+ CdsAiChatChatHeader.TOOLBAR_ACTION_SELECTOR = "cds-icon-button:not([disabled])";
362
+ /**
363
+ * Configuration constants for navigation elements.
364
+ */
365
+ CdsAiChatChatHeader.BACK_ICON_CONFIG = { slot: "icon" };
366
+ CdsAiChatChatHeader.NAV_TOOLTIP_CONFIG = {
367
+ alignment: "end",
368
+ position: "right",
369
+ enterDelayMs: "0",
370
+ leaveDelayMs: "0",
371
+ };
372
+ __decorate([
373
+ property({ type: Array, attribute: false })
374
+ ], CdsAiChatChatHeader.prototype, "actions", void 0);
375
+ __decorate([
376
+ property({ type: Boolean, attribute: "overflow", reflect: true })
377
+ ], CdsAiChatChatHeader.prototype, "overflow", void 0);
378
+ __decorate([
379
+ property({ type: String, attribute: "header-title" })
380
+ ], CdsAiChatChatHeader.prototype, "headerTitle", void 0);
381
+ __decorate([
382
+ property({ type: String, attribute: "header-name" })
383
+ ], CdsAiChatChatHeader.prototype, "headerName", void 0);
384
+ __decorate([
385
+ property({ type: String, attribute: "navigation-type" })
386
+ ], CdsAiChatChatHeader.prototype, "navigationType", void 0);
387
+ __decorate([
388
+ property({ type: Object, attribute: false })
389
+ ], CdsAiChatChatHeader.prototype, "navigationBackIcon", void 0);
390
+ __decorate([
391
+ property({ type: String, attribute: "navigation-back-label" })
392
+ ], CdsAiChatChatHeader.prototype, "navigationBackLabel", void 0);
393
+ __decorate([
394
+ property({ type: Object, attribute: false })
395
+ ], CdsAiChatChatHeader.prototype, "navigationBackOnClick", void 0);
396
+ __decorate([
397
+ property({ type: Array, attribute: false })
398
+ ], CdsAiChatChatHeader.prototype, "navigationOverflowItems", void 0);
399
+ __decorate([
400
+ property({ type: String, attribute: "navigation-overflow-label" })
401
+ ], CdsAiChatChatHeader.prototype, "navigationOverflowLabel", void 0);
402
+ __decorate([
403
+ property({ type: Object, attribute: false })
404
+ ], CdsAiChatChatHeader.prototype, "navigationOverflowIcon", void 0);
405
+ __decorate([
406
+ property({ type: Object, attribute: false })
407
+ ], CdsAiChatChatHeader.prototype, "navigationOverflowOnClick", void 0);
408
+ CdsAiChatChatHeader = CdsAiChatChatHeader_1 = __decorate([
409
+ carbonElement(`${prefix}-chat-header`)
410
+ ], CdsAiChatChatHeader);
411
+ var CdsAiChatChatHeader$1 = CdsAiChatChatHeader;
412
+ // Made with Bob
413
+
414
+ export { CdsAiChatChatHeader, CdsAiChatChatHeader$1 as default };
415
+ //# sourceMappingURL=chat-header.js.map
@@ -0,0 +1 @@
1
+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AAM,EAAE,SAAS,EAAE,KAAK,EAAE;AACf,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,wBAAA,EAAA,MAAA,CAAA;AAM7B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE;AACL,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,2BAAA,EAAA,MAAA,CAAA;AA3OnC,mBAAmB,GAAA,qBAAA,GAAA,UAAA,CAAA;AADxB,IAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,YAAA,CAAc;AAChC,CAAA,EAAA,mBAAmB,CAsbxB;AASD,4BAAe,mBAAmB;AAElC;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { css } from 'lit';
9
+
10
+ var styles = css([":host{box-sizing:border-box;display:block;inline-size:100%}.cds-aichat-chat-header-overflow-wrapper{position:relative}.cds-aichat-chat-header-overflow-wrapper cds-overflow-menu{border-start-start-radius:calc(var(--cds-aichat-border-radius-start-start, var(--cds-aichat-border-radius)) - .0625rem)}.cds-aichat-chat-header-overflow-wrapper cds-overflow-menu::part(button){border-start-start-radius:calc(var(--cds-aichat-border-radius-start-start, var(--cds-aichat-border-radius)) - .0625rem)}.cds-aichat-chat-header-overflow-icon{color:var(--cds-icon-primary,#161616)}.cds-aichat-chat-header__title{color:var(--cds-text-primary,#161616);inline-size:100%;min-inline-size:4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cds-aichat-chat-header__name-text{font-weight:700}"]);
11
+
12
+ export { styles as default };
13
+ //# sourceMappingURL=chat-header.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-header.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { CornerConfig, CornerStyle, CornerPosition } from "./types.js";
10
+ /**
11
+ * Manages rounded corner calculations and CSS variable updates for the chat shell.
12
+ * Handles the logic for determining effective corner styles and applying them
13
+ * to CSS custom properties.
14
+ */
15
+ export declare class CornerManager {
16
+ private readonly shellRoot;
17
+ private config;
18
+ constructor(shellRoot: HTMLElement, config: CornerConfig);
19
+ /**
20
+ * Update corner configuration and apply CSS variables
21
+ */
22
+ updateCorners(config: CornerConfig): void;
23
+ /**
24
+ * Check if any corner is rounded
25
+ */
26
+ hasAnyRoundedCorner(): boolean;
27
+ /**
28
+ * Get the effective corner value (individual corner overrides cornerAll)
29
+ */
30
+ getEffectiveCorner(position: CornerPosition): CornerStyle;
31
+ /**
32
+ * Updates CSS custom properties for corner radii based on corner configuration
33
+ */
34
+ private updateCornerCSSVariables;
35
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ /**
9
+ * @license
10
+ *
11
+ * Copyright IBM Corp. 2025
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ /**
17
+ * Manages rounded corner calculations and CSS variable updates for the chat shell.
18
+ * Handles the logic for determining effective corner styles and applying them
19
+ * to CSS custom properties.
20
+ */
21
+ class CornerManager {
22
+ constructor(shellRoot, config) {
23
+ this.shellRoot = shellRoot;
24
+ this.config = config;
25
+ this.updateCornerCSSVariables();
26
+ }
27
+ /**
28
+ * Update corner configuration and apply CSS variables
29
+ */
30
+ updateCorners(config) {
31
+ this.config = config;
32
+ this.updateCornerCSSVariables();
33
+ }
34
+ /**
35
+ * Check if any corner is rounded
36
+ */
37
+ hasAnyRoundedCorner() {
38
+ return (this.config.cornerAll === "round" ||
39
+ this.config.cornerStartStart === "round" ||
40
+ this.config.cornerStartEnd === "round" ||
41
+ this.config.cornerEndStart === "round" ||
42
+ this.config.cornerEndEnd === "round");
43
+ }
44
+ /**
45
+ * Get the effective corner value (individual corner overrides cornerAll)
46
+ */
47
+ getEffectiveCorner(position) {
48
+ switch (position) {
49
+ case "start-start":
50
+ return this.config.cornerStartStart ?? this.config.cornerAll;
51
+ case "start-end":
52
+ return this.config.cornerStartEnd ?? this.config.cornerAll;
53
+ case "end-start":
54
+ return this.config.cornerEndStart ?? this.config.cornerAll;
55
+ case "end-end":
56
+ return this.config.cornerEndEnd ?? this.config.cornerAll;
57
+ }
58
+ }
59
+ /**
60
+ * Updates CSS custom properties for corner radii based on corner configuration
61
+ */
62
+ updateCornerCSSVariables() {
63
+ if (!this.shellRoot) {
64
+ return;
65
+ }
66
+ const radiusValue = (corner) => corner === "round" ? "0.5rem" : "0";
67
+ // Calculate effective values for each corner
68
+ const startStartValue = radiusValue(this.getEffectiveCorner("start-start"));
69
+ const startEndValue = radiusValue(this.getEffectiveCorner("start-end"));
70
+ const endStartValue = radiusValue(this.getEffectiveCorner("end-start"));
71
+ const endEndValue = radiusValue(this.getEffectiveCorner("end-end"));
72
+ // Set -base variables (source of truth for per-corner control)
73
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-start-base", startStartValue);
74
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-end-base", startEndValue);
75
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-start-base", endStartValue);
76
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-end-base", endEndValue);
77
+ // Also set regular variables for direct usage (backward compatibility)
78
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-start", startStartValue);
79
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-end", startEndValue);
80
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-start", endStartValue);
81
+ this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-end", endEndValue);
82
+ }
83
+ }
84
+ // Made with Bob
85
+
86
+ export { CornerManager };
87
+ //# sourceMappingURL=corner-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corner-manager.js","sources":["../../../../src/components/chat-shell/src/corner-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAIH;;;;AAIG;MACU,aAAa,CAAA;IAGxB,WAAA,CACmB,SAAsB,EACvC,MAAoB,EAAA;QADH,IAAA,CAAA,SAAS,GAAT,SAAS;AAG1B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,wBAAwB,EAAE;IACjC;AAEA;;AAEG;AACH,IAAA,aAAa,CAAC,MAAoB,EAAA;AAChC,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,wBAAwB,EAAE;IACjC;AAEA;;AAEG;IACH,mBAAmB,GAAA;AACjB,QAAA,QACE,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,OAAO;AACjC,YAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,KAAK,OAAO;AACxC,YAAA,IAAI,CAAC,MAAM,CAAC,cAAc,KAAK,OAAO;AACtC,YAAA,IAAI,CAAC,MAAM,CAAC,cAAc,KAAK,OAAO;AACtC,YAAA,IAAI,CAAC,MAAM,CAAC,YAAY,KAAK,OAAO;IAExC;AAEA;;AAEG;AACH,IAAA,kBAAkB,CAAC,QAAwB,EAAA;QACzC,QAAQ,QAAQ;AACd,YAAA,KAAK,aAAa;gBAChB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS;AAC9D,YAAA,KAAK,WAAW;gBACd,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS;AAC5D,YAAA,KAAK,WAAW;gBACd,OAAO,IAAI,CAAC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EACtC,aAAa,CACd;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,oCAAoC,EACpC,WAAW,CACZ;IACH;AACD;AAED;;;;"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { InitialStateKey } from "./types.js";
10
+ /**
11
+ * Manages component initialization state tracking.
12
+ * Tracks when various initial state properties have been set and determines
13
+ * when initialization is complete to prevent visible layout thrashing.
14
+ */
15
+ export declare class InitializationManager {
16
+ private initialStateSet;
17
+ private isInitializing;
18
+ private onCompleteCallback?;
19
+ /**
20
+ * Mark a specific initial state property as set
21
+ */
22
+ markStateSet(key: InitialStateKey): void;
23
+ /**
24
+ * Check if initialization is complete
25
+ */
26
+ isInitializationComplete(): boolean;
27
+ /**
28
+ * Get the current initializing state
29
+ */
30
+ getInitializingState(): boolean;
31
+ /**
32
+ * Set callback to be called when initialization completes
33
+ */
34
+ onComplete(callback: () => void): void;
35
+ /**
36
+ * Reset initialization state (useful for testing or re-initialization)
37
+ */
38
+ reset(): void;
39
+ /**
40
+ * Check if all initial state properties have been set
41
+ * and mark initialization as complete if so
42
+ */
43
+ private checkInitializationComplete;
44
+ }