@carbon/ai-chat-components 0.5.0 → 0.6.0-rc.1

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 (483) hide show
  1. package/custom-elements.json +9201 -295
  2. package/dist/16-B6dpbhwk.js +91 -0
  3. package/dist/apl-Bkd9Mf6P.js +91 -0
  4. package/dist/asciiarmor-DL4R2aFc.js +91 -0
  5. package/dist/asn1-BNuq0wMN.js +91 -0
  6. package/dist/asterisk-CKsJI4Xo.js +91 -0
  7. package/dist/button-Cl3aa-QH.js +157 -0
  8. package/dist/button-skeleton-DpmYT5sr.js +116 -0
  9. package/dist/carbon-element-DtQeYrv7.js +91 -0
  10. package/dist/carbon-element-wyoWZuGw.js +91 -0
  11. package/dist/chain-of-thought.min.js +276 -0
  12. package/dist/chat-button.min.js +71 -81
  13. package/dist/checkbox-skeleton-77m2gyNb.js +166 -0
  14. package/dist/class-map-BgQK6m9u.js +106 -0
  15. package/dist/clike-7TJ9zfKW.js +91 -0
  16. package/dist/clojure-9jpZ60Lu.js +91 -0
  17. package/dist/cmake-UY0DwvRL.js +91 -0
  18. package/dist/cobol-DhfZi79a.js +91 -0
  19. package/dist/code-snippet.min.js +91 -0
  20. package/dist/codemirror-runtime-ClX6d06H.js +173 -0
  21. package/dist/coffeescript-mDf6LSpC.js +91 -0
  22. package/dist/collection-helpers-DTO_rBxT.js +91 -0
  23. package/dist/commonlisp-Qa7gZPAc.js +91 -0
  24. package/dist/crystal-C1gbEnje.js +91 -0
  25. package/dist/css-BLorXS28.js +91 -0
  26. package/dist/custom-element-C-oe1CPQ.js +96 -0
  27. package/dist/cypher-BY0J-JQD.js +91 -0
  28. package/dist/d-zkooxxUz.js +91 -0
  29. package/dist/diff-CrCOHpAq.js +91 -0
  30. package/dist/dockerfile-D7x4UVxN.js +91 -0
  31. package/dist/dtd-Cp_rfrvO.js +91 -0
  32. package/dist/dylan-BWjG5gpG.js +91 -0
  33. package/dist/ebnf-JN5Vq0lF.js +91 -0
  34. package/dist/ecl-De3xBvSp.js +91 -0
  35. package/dist/eiffel-BUg3McKi.js +91 -0
  36. package/dist/elm-BzEpaycL.js +91 -0
  37. package/dist/erlang-CRda3Szm.js +91 -0
  38. package/dist/factor-HH6tZH2o.js +91 -0
  39. package/dist/fcl-DethtZZ9.js +91 -0
  40. package/dist/feedback.min.js +300 -0
  41. package/dist/forth-CvRI4Fp8.js +91 -0
  42. package/dist/fortran-BlOOIWks.js +91 -0
  43. package/dist/gas-D13dt2I8.js +91 -0
  44. package/dist/gherkin-DeOVdg90.js +91 -0
  45. package/dist/groovy-HwkbYX11.js +91 -0
  46. package/dist/haskell-BrtcJMpO.js +91 -0
  47. package/dist/haxe-DLraHdYm.js +91 -0
  48. package/dist/http-DZFwp0rs.js +91 -0
  49. package/dist/icon-button-DLTQYCDh.js +143 -0
  50. package/dist/icon-loader-DNSGSUXr.js +101 -0
  51. package/dist/idl-9eLgsa_L.js +91 -0
  52. package/dist/if-defined-D_Efffcr.js +96 -0
  53. package/dist/index-07U-x-DZ.js +91 -0
  54. package/dist/index-B-leT4Qo.js +91 -0
  55. package/dist/index-BCIOZ3Iv.js +91 -0
  56. package/dist/index-BJcdJS87.js +91 -0
  57. package/dist/index-BlpbVMq_.js +91 -0
  58. package/dist/index-CB8fQWmx.js +91 -0
  59. package/dist/index-CDmjsjkj.js +91 -0
  60. package/dist/index-CHI0qSLN.js +91 -0
  61. package/dist/index-CHor-HRv.js +91 -0
  62. package/dist/index-C_x1WGc6.js +91 -0
  63. package/dist/index-Cg3MLvVN.js +91 -0
  64. package/dist/index-Cp5sEHjB.js +367 -0
  65. package/dist/index-CtUoNlIM.js +91 -0
  66. package/dist/index-CusUYvgE.js +91 -0
  67. package/dist/index-CvvPafwM.js +168 -0
  68. package/dist/index-DDjGfF24.js +91 -0
  69. package/dist/index-DxS06aLY.js +91 -0
  70. package/dist/index-FwP_JV-c.js +91 -0
  71. package/dist/index-Hcd_VCMd.js +91 -0
  72. package/dist/index-LlI0lXKE.js +91 -0
  73. package/dist/index-Q34JRmNZ.js +91 -0
  74. package/dist/index-f7UAoB15.js +91 -0
  75. package/dist/index-mQZVoo3c.js +91 -0
  76. package/dist/index-yd1vgygF.js +91 -0
  77. package/dist/javascript-hgM39w7C.js +91 -0
  78. package/dist/julia-DtM_gc7j.js +91 -0
  79. package/dist/{settings-XW6XylsZ.js → lit-element-BnGYooZk.js} +70 -12
  80. package/dist/livescript-BySrhTUe.js +91 -0
  81. package/dist/lua-ChD7R8km.js +91 -0
  82. package/dist/markdown.min.js +296 -0
  83. package/dist/mathematica-kcP6Cajy.js +91 -0
  84. package/dist/mbox-Bw_KHaUe.js +91 -0
  85. package/dist/mirc-jvko25mJ.js +91 -0
  86. package/dist/mllike-CNKOuVeX.js +91 -0
  87. package/dist/modelica-YfrFDmxR.js +91 -0
  88. package/dist/mscgen-Bok75bzR.js +91 -0
  89. package/dist/mumps-BTuSBaU1.js +91 -0
  90. package/dist/nginx-DwZuHJnC.js +91 -0
  91. package/dist/nsis-CIx93lk7.js +91 -0
  92. package/dist/ntriples-Djj269Be.js +91 -0
  93. package/dist/octave-CrdvfVOv.js +91 -0
  94. package/dist/oz-C4bYf6je.js +91 -0
  95. package/dist/pascal-D2KPt6vl.js +91 -0
  96. package/dist/perl-5YDHx0ay.js +91 -0
  97. package/dist/pig-DzmRINVg.js +91 -0
  98. package/dist/powershell-BT_ybnoW.js +91 -0
  99. package/dist/processing.min.js +71 -4
  100. package/dist/properties-4YytEGly.js +91 -0
  101. package/dist/protobuf-CI-p1B8j.js +91 -0
  102. package/dist/pug-DLHGbkXU.js +91 -0
  103. package/dist/puppet-BbNNtXxr.js +91 -0
  104. package/dist/python-D3PSFk0-.js +91 -0
  105. package/dist/q-ObXF982D.js +91 -0
  106. package/dist/query-DLqIY4Wn.js +101 -0
  107. package/dist/r-DiZLK5qY.js +91 -0
  108. package/dist/radio-group-manager-GuAarpdg.js +91 -0
  109. package/dist/reasoning-steps.min.js +171 -0
  110. package/dist/repeat-DQkjGru3.js +96 -0
  111. package/dist/rpm-BA1XlISV.js +91 -0
  112. package/dist/ruby-o3bYJp8s.js +91 -0
  113. package/dist/sas-YW-OKZPX.js +91 -0
  114. package/dist/scheme-D5iPrCDC.js +91 -0
  115. package/dist/settings-BfbbHBjJ.js +99 -0
  116. package/dist/shell-BMwJ8_g7.js +91 -0
  117. package/dist/sieve-BE4sKTG2.js +91 -0
  118. package/dist/simple-mode-2GmZ0AR1.js +91 -0
  119. package/dist/smalltalk-CI3t8V3g.js +91 -0
  120. package/dist/solr-xhjjvvCE.js +91 -0
  121. package/dist/sparql-D64FGxiD.js +91 -0
  122. package/dist/spreadsheet-CnwQq-zp.js +91 -0
  123. package/dist/sql-CWCB15es.js +91 -0
  124. package/dist/state-BF51fRID.js +96 -0
  125. package/dist/stex-DqIfOYF1.js +91 -0
  126. package/dist/stylus-xz-vruRQ.js +91 -0
  127. package/dist/swift-BPHP66va.js +91 -0
  128. package/dist/sync-HIZypRbs.js +91 -0
  129. package/dist/table-runtime-C7apcdgu.js +510 -0
  130. package/dist/table.min.js +91 -0
  131. package/dist/tcl-BSDESp20.js +91 -0
  132. package/dist/text-input-Ca8K1Ydg.js +158 -0
  133. package/dist/textile-COeIYMRW.js +91 -0
  134. package/dist/throttle-CN5lMS8t.js +91 -0
  135. package/dist/tiddlywiki-Bs5PoKQf.js +91 -0
  136. package/dist/tiki-DqKGtwP5.js +91 -0
  137. package/dist/tile-container.min.js +70 -14
  138. package/dist/toml-DA5Yl8WK.js +91 -0
  139. package/dist/toolbar.min.js +180 -0
  140. package/dist/troff-BRNQrjuW.js +91 -0
  141. package/dist/ttcn-Bn8eKWOh.js +91 -0
  142. package/dist/ttcn-cfg-BO-9W9JU.js +91 -0
  143. package/dist/turtle-CxuhUAyA.js +91 -0
  144. package/dist/vb-C40-VEDj.js +91 -0
  145. package/dist/vbscript-BogOMGMf.js +91 -0
  146. package/dist/velocity-CQs7G9b4.js +91 -0
  147. package/dist/verilog-CelFoyTQ.js +91 -0
  148. package/dist/vhdl-BlCs0iAG.js +91 -0
  149. package/dist/webidl-VWB4mjSa.js +91 -0
  150. package/dist/workspace-shell.min.js +162 -0
  151. package/dist/xquery-B8qd1YwF.js +91 -0
  152. package/dist/yacas-OhfCFLfI.js +91 -0
  153. package/dist/z80-oZfTgdDp.js +91 -0
  154. package/es/components/chain-of-thought/index.d.ts +4 -0
  155. package/es/components/chain-of-thought/index.js +11 -0
  156. package/es/components/chain-of-thought/index.js.map +1 -0
  157. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.d.ts +15 -0
  158. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js +36 -0
  159. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js.map +1 -0
  160. package/es/components/chain-of-thought/src/chain-of-thought.d.ts +87 -0
  161. package/es/components/chain-of-thought/src/chain-of-thought.js +189 -0
  162. package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -0
  163. package/es/components/chain-of-thought/src/chain-of-thought.scss.js +13 -0
  164. package/es/components/chain-of-thought/src/chain-of-thought.scss.js.map +1 -0
  165. package/es/components/chain-of-thought/src/chain-of-thought.template.d.ts +5 -0
  166. package/es/components/chain-of-thought/src/chain-of-thought.template.js +206 -0
  167. package/es/components/chain-of-thought/src/chain-of-thought.template.js.map +1 -0
  168. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.d.ts +10 -0
  169. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js +50 -0
  170. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js.map +1 -0
  171. package/es/components/chain-of-thought/src/types.d.ts +73 -0
  172. package/es/components/chain-of-thought/src/types.js +29 -0
  173. package/es/components/chain-of-thought/src/types.js.map +1 -0
  174. package/es/components/chat-button/defs.d.ts +25 -0
  175. package/es/components/chat-button/defs.js +36 -0
  176. package/es/components/chat-button/defs.js.map +1 -0
  177. package/es/components/chat-button/index.d.ts +1 -1
  178. package/es/components/chat-button/index.js +1 -1
  179. package/es/components/chat-button/src/chat-button.d.ts +32 -0
  180. package/es/components/chat-button/{chat-button.js → src/chat-button.js} +16 -10
  181. package/es/components/chat-button/src/chat-button.js.map +1 -0
  182. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  183. package/es/components/code-snippet/index.d.ts +3 -0
  184. package/es/components/code-snippet/index.js +10 -0
  185. package/es/components/code-snippet/index.js.map +1 -0
  186. package/es/components/code-snippet/src/code-snippet-tile-container.d.ts +32 -0
  187. package/es/components/code-snippet/src/code-snippet-tile-container.js +143 -0
  188. package/es/components/code-snippet/src/code-snippet-tile-container.js.map +1 -0
  189. package/es/components/code-snippet/src/code-snippet.d.ts +482 -0
  190. package/es/components/code-snippet/src/code-snippet.js +592 -0
  191. package/es/components/code-snippet/src/code-snippet.js.map +1 -0
  192. package/es/components/code-snippet/src/code-snippet.scss.js +13 -0
  193. package/es/components/code-snippet/src/code-snippet.scss.js.map +1 -0
  194. package/es/components/code-snippet/src/codemirror/base-setup.d.ts +12 -0
  195. package/es/components/code-snippet/src/codemirror/base-setup.js +65 -0
  196. package/es/components/code-snippet/src/codemirror/base-setup.js.map +1 -0
  197. package/es/components/code-snippet/src/codemirror/codemirror-loader.d.ts +12 -0
  198. package/es/components/code-snippet/src/codemirror/codemirror-loader.js +36 -0
  199. package/es/components/code-snippet/src/codemirror/codemirror-loader.js.map +1 -0
  200. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +7 -0
  201. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +13 -0
  202. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -0
  203. package/es/components/code-snippet/src/codemirror/content-sync.d.ts +12 -0
  204. package/es/components/code-snippet/src/codemirror/content-sync.js +72 -0
  205. package/es/components/code-snippet/src/codemirror/content-sync.js.map +1 -0
  206. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +28 -0
  207. package/es/components/code-snippet/src/codemirror/editor-manager.js +75 -0
  208. package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -0
  209. package/es/components/code-snippet/src/codemirror/language-controller.d.ts +38 -0
  210. package/es/components/code-snippet/src/codemirror/language-controller.js +220 -0
  211. package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -0
  212. package/es/components/code-snippet/src/codemirror/language-data.d.ts +6 -0
  213. package/es/components/code-snippet/src/codemirror/language-data.js +1043 -0
  214. package/es/components/code-snippet/src/codemirror/language-data.js.map +1 -0
  215. package/es/components/code-snippet/src/codemirror/language-utils.d.ts +79 -0
  216. package/es/components/code-snippet/src/codemirror/language-utils.js +219 -0
  217. package/es/components/code-snippet/src/codemirror/language-utils.js.map +1 -0
  218. package/es/components/code-snippet/src/codemirror/marker-utils.d.ts +123 -0
  219. package/es/components/code-snippet/src/codemirror/marker-utils.js +183 -0
  220. package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -0
  221. package/es/components/code-snippet/src/codemirror/theme.d.ts +54 -0
  222. package/es/components/code-snippet/src/codemirror/theme.js +320 -0
  223. package/es/components/code-snippet/src/codemirror/theme.js.map +1 -0
  224. package/es/components/code-snippet/src/dom-utils.d.ts +24 -0
  225. package/es/components/code-snippet/src/dom-utils.js +63 -0
  226. package/es/components/code-snippet/src/dom-utils.js.map +1 -0
  227. package/es/components/code-snippet/src/formatters.d.ts +4 -0
  228. package/es/components/code-snippet/src/formatters.js +19 -0
  229. package/es/components/code-snippet/src/formatters.js.map +1 -0
  230. package/es/components/code-snippet/src/layout-utils.d.ts +22 -0
  231. package/es/components/code-snippet/src/layout-utils.js +63 -0
  232. package/es/components/code-snippet/src/layout-utils.js.map +1 -0
  233. package/es/components/code-snippet/src/streaming-manager.d.ts +24 -0
  234. package/es/components/code-snippet/src/streaming-manager.js +120 -0
  235. package/es/components/code-snippet/src/streaming-manager.js.map +1 -0
  236. package/es/components/feedback/index.d.ts +7 -0
  237. package/es/components/feedback/index.js +12 -0
  238. package/es/components/feedback/index.js.map +1 -0
  239. package/es/components/feedback/src/cds-aichat-feedback-buttons.d.ts +15 -0
  240. package/es/components/feedback/src/cds-aichat-feedback-buttons.js +36 -0
  241. package/es/components/feedback/src/cds-aichat-feedback-buttons.js.map +1 -0
  242. package/es/components/feedback/src/cds-aichat-feedback.d.ts +15 -0
  243. package/es/components/feedback/src/cds-aichat-feedback.js +36 -0
  244. package/es/components/feedback/src/cds-aichat-feedback.js.map +1 -0
  245. package/es/components/feedback/src/feedback-buttons.d.ts +56 -0
  246. package/es/components/feedback/src/feedback-buttons.js +104 -0
  247. package/es/components/feedback/src/feedback-buttons.js.map +1 -0
  248. package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
  249. package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  250. package/es/components/feedback/src/feedback-buttons.template.d.ts +4 -0
  251. package/es/components/feedback/src/feedback-buttons.template.js +79 -0
  252. package/es/components/feedback/src/feedback-buttons.template.js.map +1 -0
  253. package/es/components/feedback/src/feedback.d.ts +114 -0
  254. package/es/components/feedback/src/feedback.js +182 -0
  255. package/es/components/feedback/src/feedback.js.map +1 -0
  256. package/es/components/feedback/src/feedback.scss.js +13 -0
  257. package/es/components/feedback/src/feedback.scss.js.map +1 -0
  258. package/es/components/feedback/src/feedback.template.d.ts +12 -0
  259. package/es/components/feedback/src/feedback.template.js +115 -0
  260. package/es/components/feedback/src/feedback.template.js.map +1 -0
  261. package/es/components/markdown/index.d.ts +2 -0
  262. package/es/components/markdown/index.js +9 -0
  263. package/es/components/markdown/index.js.map +1 -0
  264. package/es/components/markdown/src/cds-aichat-markdown.d.ts +13 -0
  265. package/es/components/markdown/src/cds-aichat-markdown.js +35 -0
  266. package/es/components/markdown/src/cds-aichat-markdown.js.map +1 -0
  267. package/es/components/markdown/src/markdown-renderer.d.ts +62 -0
  268. package/es/components/markdown/src/markdown-renderer.js +354 -0
  269. package/es/components/markdown/src/markdown-renderer.js.map +1 -0
  270. package/es/components/markdown/src/markdown-token-tree.d.ts +32 -0
  271. package/es/components/markdown/src/markdown-token-tree.js +178 -0
  272. package/es/components/markdown/src/markdown-token-tree.js.map +1 -0
  273. package/es/components/markdown/src/markdown.d.ts +44 -0
  274. package/es/components/markdown/src/markdown.js +238 -0
  275. package/es/components/markdown/src/markdown.js.map +1 -0
  276. package/es/components/markdown/src/markdown.scss.js +13 -0
  277. package/es/components/markdown/src/markdown.scss.js.map +1 -0
  278. package/es/components/markdown/src/markdown.template.d.ts +3 -0
  279. package/es/components/markdown/src/markdown.template.js +24 -0
  280. package/es/components/markdown/src/markdown.template.js.map +1 -0
  281. package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +7 -0
  282. package/es/components/markdown/src/plugins/markdown-it-attrs.js +84 -0
  283. package/es/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -0
  284. package/es/components/markdown/src/plugins/markdown-it-highlight.d.ts +7 -0
  285. package/es/components/markdown/src/plugins/markdown-it-highlight.js +59 -0
  286. package/es/components/markdown/src/plugins/markdown-it-highlight.js.map +1 -0
  287. package/es/components/markdown/src/plugins/markdown-it-task-lists.d.ts +12 -0
  288. package/es/components/markdown/src/plugins/markdown-it-task-lists.js +73 -0
  289. package/es/components/markdown/src/plugins/markdown-it-task-lists.js.map +1 -0
  290. package/es/components/markdown/src/plugins/markdownItAttrs/core.d.ts +26 -0
  291. package/es/components/markdown/src/plugins/markdownItAttrs/core.js +330 -0
  292. package/es/components/markdown/src/plugins/markdownItAttrs/core.js.map +1 -0
  293. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +6 -0
  294. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +63 -0
  295. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +1 -0
  296. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +6 -0
  297. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +43 -0
  298. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +1 -0
  299. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +5 -0
  300. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +55 -0
  301. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +1 -0
  302. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +19 -0
  303. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +210 -0
  304. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +1 -0
  305. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +13 -0
  306. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +156 -0
  307. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +1 -0
  308. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +13 -0
  309. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +216 -0
  310. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +1 -0
  311. package/es/components/markdown/src/plugins/markdownItAttrs/types.d.ts +34 -0
  312. package/es/components/markdown/src/plugins/markdownItAttrs/types.js +8 -0
  313. package/es/components/markdown/src/plugins/markdownItAttrs/types.js.map +1 -0
  314. package/es/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +25 -0
  315. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js +62 -0
  316. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js.map +1 -0
  317. package/es/components/markdown/src/utils/html-helpers.d.ts +2 -0
  318. package/es/components/markdown/src/utils/html-helpers.js +204 -0
  319. package/es/components/markdown/src/utils/html-helpers.js.map +1 -0
  320. package/es/components/markdown/src/utils/table-helpers.d.ts +31 -0
  321. package/es/components/markdown/src/utils/table-helpers.js +106 -0
  322. package/es/components/markdown/src/utils/table-helpers.js.map +1 -0
  323. package/es/components/markdown/src/utils.d.ts +8 -0
  324. package/es/components/markdown/src/utils.js +31 -0
  325. package/es/components/markdown/src/utils.js.map +1 -0
  326. package/es/components/reasoning-steps/index.d.ts +2 -0
  327. package/es/components/reasoning-steps/index.js +10 -0
  328. package/es/components/reasoning-steps/index.js.map +1 -0
  329. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.d.ts +29 -0
  330. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js +231 -0
  331. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js.map +1 -0
  332. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js +13 -0
  333. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js.map +1 -0
  334. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.d.ts +13 -0
  335. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js +96 -0
  336. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js.map +1 -0
  337. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js +13 -0
  338. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js.map +1 -0
  339. package/es/components/table/index.d.ts +3 -0
  340. package/es/components/table/index.js +9 -0
  341. package/es/components/table/index.js.map +1 -0
  342. package/es/components/table/src/cds-aichat-table.d.ts +262 -0
  343. package/es/components/table/src/cds-aichat-table.js +511 -0
  344. package/es/components/table/src/cds-aichat-table.js.map +1 -0
  345. package/es/components/table/src/table-loader.d.ts +4 -0
  346. package/es/components/table/src/table-loader.js +28 -0
  347. package/es/components/table/src/table-loader.js.map +1 -0
  348. package/es/components/table/src/table-pagination.template.d.ts +27 -0
  349. package/es/components/table/src/table-pagination.template.js +55 -0
  350. package/es/components/table/src/table-pagination.template.js.map +1 -0
  351. package/es/components/table/src/table-runtime.d.ts +2 -0
  352. package/es/components/table/src/table-runtime.js +10 -0
  353. package/es/components/table/src/table-runtime.js.map +1 -0
  354. package/es/components/table/src/table-skeleton.template.d.ts +6 -0
  355. package/es/components/table/src/table-skeleton.template.js +34 -0
  356. package/es/components/table/src/table-skeleton.template.js.map +1 -0
  357. package/es/components/table/src/table.scss.js +13 -0
  358. package/es/components/table/src/table.scss.js.map +1 -0
  359. package/es/components/table/src/table.template.d.ts +10 -0
  360. package/es/components/table/src/table.template.js +89 -0
  361. package/es/components/table/src/table.template.js.map +1 -0
  362. package/es/components/table/src/types.d.ts +13 -0
  363. package/es/components/table/src/types.js +8 -0
  364. package/es/components/table/src/types.js.map +1 -0
  365. package/es/components/tile-container/src/styles.scss.js +1 -1
  366. package/es/components/toolbar/index.d.ts +1 -0
  367. package/es/components/toolbar/index.js +9 -0
  368. package/es/components/toolbar/index.js.map +1 -0
  369. package/es/components/toolbar/src/toolbar.d.ts +39 -0
  370. package/es/components/toolbar/src/toolbar.js +179 -0
  371. package/es/components/toolbar/src/toolbar.js.map +1 -0
  372. package/es/components/toolbar/src/toolbar.scss.js +13 -0
  373. package/es/components/toolbar/src/toolbar.scss.js.map +1 -0
  374. package/es/components/workspace-shell/index.d.ts +5 -0
  375. package/es/components/workspace-shell/index.js +13 -0
  376. package/es/components/workspace-shell/index.js.map +1 -0
  377. package/es/components/workspace-shell/src/styles.scss.js +13 -0
  378. package/es/components/workspace-shell/src/styles.scss.js.map +1 -0
  379. package/es/components/workspace-shell/src/workspace-shell-body.d.ts +16 -0
  380. package/es/components/workspace-shell/src/workspace-shell-body.js +50 -0
  381. package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -0
  382. package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +19 -0
  383. package/es/components/workspace-shell/src/workspace-shell-footer.js +53 -0
  384. package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -0
  385. package/es/components/workspace-shell/src/workspace-shell-header.d.ts +27 -0
  386. package/es/components/workspace-shell/src/workspace-shell-header.js +77 -0
  387. package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -0
  388. package/es/components/workspace-shell/src/workspace-shell-toolbar.d.ts +22 -0
  389. package/es/components/workspace-shell/src/workspace-shell-toolbar.js +61 -0
  390. package/es/components/workspace-shell/src/workspace-shell-toolbar.js.map +1 -0
  391. package/es/components/workspace-shell/src/workspace-shell.d.ts +20 -0
  392. package/es/components/workspace-shell/src/workspace-shell.js +83 -0
  393. package/es/components/workspace-shell/src/workspace-shell.js.map +1 -0
  394. package/es/components/workspace-shell/src/workspace-shell.scss.js +13 -0
  395. package/es/components/workspace-shell/src/workspace-shell.scss.js.map +1 -0
  396. package/es/globals/utils/uuid.d.ts +5 -0
  397. package/es/globals/utils/uuid.js +32 -0
  398. package/es/globals/utils/uuid.js.map +1 -0
  399. package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js +9 -0
  400. package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +1 -0
  401. package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +11 -0
  402. package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +1 -0
  403. package/es/node_modules/@codemirror/autocomplete/dist/index.js +258 -0
  404. package/es/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
  405. package/es/node_modules/@codemirror/commands/dist/index.js +1140 -0
  406. package/es/node_modules/@codemirror/commands/dist/index.js.map +1 -0
  407. package/es/node_modules/@codemirror/lint/dist/index.js +636 -0
  408. package/es/node_modules/@codemirror/lint/dist/index.js.map +1 -0
  409. package/es/node_modules/@lezer/common/dist/index.js +253 -0
  410. package/es/node_modules/@lezer/common/dist/index.js.map +1 -0
  411. package/es/node_modules/crelt/index.js +37 -0
  412. package/es/node_modules/crelt/index.js.map +1 -0
  413. package/es/react/ai-label.d.ts +2 -1
  414. package/es/react/ai-label.js +3 -2
  415. package/es/react/ai-label.js.map +1 -1
  416. package/es/react/button.d.ts +2 -1
  417. package/es/react/button.js +3 -2
  418. package/es/react/button.js.map +1 -1
  419. package/es/react/chain-of-thought.d.ts +7 -0
  420. package/es/react/chain-of-thought.js +29 -0
  421. package/es/react/chain-of-thought.js.map +1 -0
  422. package/es/react/chat-button.d.ts +4 -4
  423. package/es/react/chat-button.js +6 -4
  424. package/es/react/chat-button.js.map +1 -1
  425. package/es/react/code-snippet-tile-container.d.ts +5 -0
  426. package/es/react/code-snippet-tile-container.js +30 -0
  427. package/es/react/code-snippet-tile-container.js.map +1 -0
  428. package/es/react/code-snippet.d.ts +4 -0
  429. package/es/react/code-snippet.js +31 -0
  430. package/es/react/code-snippet.js.map +1 -0
  431. package/es/react/content-switcher.d.ts +7 -0
  432. package/es/react/content-switcher.js +37 -0
  433. package/es/react/content-switcher.js.map +1 -0
  434. package/es/react/feedback-buttons.d.ts +4 -0
  435. package/es/react/feedback-buttons.js +28 -0
  436. package/es/react/feedback-buttons.js.map +1 -0
  437. package/es/react/feedback.d.ts +6 -0
  438. package/es/react/feedback.js +32 -0
  439. package/es/react/feedback.js.map +1 -0
  440. package/es/react/icon-button.d.ts +2 -1
  441. package/es/react/icon-button.js +3 -2
  442. package/es/react/icon-button.js.map +1 -1
  443. package/es/react/icon.d.ts +4 -0
  444. package/es/react/icon.js +28 -0
  445. package/es/react/icon.js.map +1 -0
  446. package/es/react/markdown.d.ts +4 -0
  447. package/es/react/markdown.js +28 -0
  448. package/es/react/markdown.js.map +1 -0
  449. package/es/react/overflow-menu.d.ts +9 -0
  450. package/es/react/overflow-menu.js +40 -0
  451. package/es/react/overflow-menu.js.map +1 -0
  452. package/es/react/processing.d.ts +2 -1
  453. package/es/react/processing.js +3 -2
  454. package/es/react/processing.js.map +1 -1
  455. package/es/react/reasoning-step.d.ts +6 -0
  456. package/es/react/reasoning-step.js +31 -0
  457. package/es/react/reasoning-step.js.map +1 -0
  458. package/es/react/reasoning-steps.d.ts +3 -0
  459. package/es/react/reasoning-steps.js +27 -0
  460. package/es/react/reasoning-steps.js.map +1 -0
  461. package/es/react/tile-container.d.ts +2 -1
  462. package/es/react/tile-container.js +3 -2
  463. package/es/react/tile-container.js.map +1 -1
  464. package/es/react/tile.d.ts +3 -2
  465. package/es/react/tile.js +5 -4
  466. package/es/react/tile.js.map +1 -1
  467. package/es/react/toolbar.d.ts +4 -0
  468. package/es/react/toolbar.js +28 -0
  469. package/es/react/toolbar.js.map +1 -0
  470. package/es/react/utils/withWebComponentBridge.d.ts +15 -0
  471. package/es/react/utils/withWebComponentBridge.js +95 -0
  472. package/es/react/utils/withWebComponentBridge.js.map +1 -0
  473. package/es/testing/load-all-lazy-deps.d.ts +10 -0
  474. package/es/testing/load-all-lazy-deps.js +30 -0
  475. package/es/testing/load-all-lazy-deps.js.map +1 -0
  476. package/package.json +39 -5
  477. package/dist/carbon-element-CMR7BOhG.js +0 -24
  478. package/dist/class-map-h7IEvsL_.js +0 -39
  479. package/es/components/chat-button/chat-button.d.ts +0 -23
  480. package/es/components/chat-button/chat-button.js.map +0 -1
  481. package/es/components/chat-button/src/chat-button.template.d.ts +0 -16
  482. package/es/components/chat-button/src/chat-button.template.js +0 -27
  483. package/es/components/chat-button/src/chat-button.template.js.map +0 -1
@@ -0,0 +1,511 @@
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, html } from 'lit';
10
+ import { property, state } from 'lit/decorators.js';
11
+ import { carbonElement } from '../../../globals/decorators/carbon-element.js';
12
+ import { tableSkeletonTemplate } from './table-skeleton.template.js';
13
+ import { loadTableRuntime } from './table-loader.js';
14
+ import styles from './table.scss.js';
15
+
16
+ /*
17
+ * Copyright IBM Corp. 2025
18
+ *
19
+ * This source code is licensed under the Apache-2.0 license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ *
22
+ * @license
23
+ */
24
+ // Width threshold for determining default page size. Tables wider than this get 10 rows, narrower get 5 rows.
25
+ const PAGE_SIZE_WIDTH_THRESHOLD = 400;
26
+ // We will have to give this component a unique ID on the name when we register it to avoid conflicts in a world where
27
+ // multiple versions of the Carbon AI Chat can be on the same page.
28
+ const TABLE_COMPONENT_TAG_NAME = "cds-aichat-table";
29
+ /**
30
+ * Class functionality for the Table custom element.
31
+ */
32
+ let TableElement = class TableElement extends LitElement {
33
+ constructor() {
34
+ super(...arguments);
35
+ /**
36
+ * The array of cells for the header.
37
+ */
38
+ this.headers = [];
39
+ /**
40
+ * The array of rows. Each row includes an array of cells.
41
+ */
42
+ this.rows = [];
43
+ /**
44
+ * Whether or not the table content is loading. If it is then a skeleton state should be shown instead.
45
+ */
46
+ this.loading = false;
47
+ /**
48
+ * The text used for the filter placeholder.
49
+ */
50
+ this.filterPlaceholderText = "";
51
+ /**
52
+ * The text used for the pagination's previous button tooltip.
53
+ */
54
+ this.previousPageText = "";
55
+ /**
56
+ * The text used for the pagination's next button tooltip.
57
+ */
58
+ this.nextPageText = "";
59
+ /**
60
+ * The text used for the pagination's item pre page text.
61
+ */
62
+ this.itemsPerPageText = "";
63
+ /**
64
+ * The locale. Used by the carbon table component to change the collator for sorting.
65
+ */
66
+ this.locale = "";
67
+ /**
68
+ * The calculated default page size based on component width.
69
+ * 10 for width > PAGE_SIZE_WIDTH_THRESHOLD, 5 for width <= PAGE_SIZE_WIDTH_THRESHOLD.
70
+ */
71
+ this._defaultPageSize = 5;
72
+ /**
73
+ * If the table is valid or not.
74
+ */
75
+ this._isValid = true;
76
+ /**
77
+ * The current page of the table we're on.
78
+ */
79
+ this._currentPageNumber = 1;
80
+ /**
81
+ * How many rows are on each page of the table.
82
+ */
83
+ this._currentPageSize = this.defaultPageSize;
84
+ /**
85
+ * Whether or not the number of rows per page was changed with the pagination component. If the user used the
86
+ * pagination controls to show all rows, the pagination component would normally hide itself because the number of is
87
+ * no longer greater than the page size. However the pagination component needs to persist in this case, since the
88
+ * user may want to change the page size again. This is used to keep track of whether the pagination controls were
89
+ * used to change page size, and if they have, it forces pagination component to persist.
90
+ */
91
+ this._rowsPerPageChanged = false;
92
+ /**
93
+ * The rows that have not been filtered out.
94
+ */
95
+ this._filterVisibleRowIDs = new Set();
96
+ /**
97
+ * All of the rows for the table with IDs.
98
+ */
99
+ this._rowsWithIDs = [];
100
+ /**
101
+ * Whether or not the table should be able to be filtered.
102
+ */
103
+ this._allowFiltering = false;
104
+ this.tableRuntime = null;
105
+ this.tableRuntimePromise = null;
106
+ /**
107
+ * Handles pagination events from the Carbon pagination component.
108
+ * Updates the visible rows when the user navigates to a different page.
109
+ *
110
+ * Note: This event sometimes fires twice due to a Carbon framework quirk,
111
+ * but since the page/size values are identical, it doesn't affect functionality.
112
+ *
113
+ * @param event - The page change event containing the new page number and size
114
+ * @public
115
+ */
116
+ this._handlePageChangeEvent = (event) => {
117
+ this._updateVisibleRows(event.detail?.page, event.detail?.pageSize);
118
+ event.stopPropagation();
119
+ };
120
+ /**
121
+ * Handles page size change events from the pagination component.
122
+ * Updates the current page size and recalculates visible rows.
123
+ * Marks that the page size has been manually changed by the user.
124
+ *
125
+ * @param event - The page size change event containing the new page size
126
+ * @public
127
+ */
128
+ this._handlePageSizeChangeEvent = (event) => {
129
+ this._rowsPerPageChanged = true;
130
+ this._currentPageSize = event.detail?.pageSize;
131
+ this._updateVisibleRows();
132
+ event.stopPropagation();
133
+ };
134
+ /**
135
+ * Handles filter and sort events from the Carbon table component.
136
+ * Updates the set of visible rows based on filtering/sorting results and resets to the first page.
137
+ *
138
+ * This event is triggered by:
139
+ * - Column sorting (clicking on sortable column headers)
140
+ * - Table filtering (using the search bar)
141
+ *
142
+ * @param event - The filter event containing the array of unfiltered rows
143
+ * @public
144
+ */
145
+ this._handleFilterEvent = (event) => {
146
+ // Record the new set of unfiltered row ids.
147
+ this._filterVisibleRowIDs = new Set(event?.detail?.unfilteredRows.map((row) => row.id));
148
+ // Go back to the first page.
149
+ this._currentPageNumber = 1;
150
+ // Update which rows are visible.
151
+ this._updateVisibleRows();
152
+ event.stopPropagation();
153
+ };
154
+ }
155
+ get defaultPageSize() {
156
+ return this._defaultPageSize;
157
+ }
158
+ set defaultPageSize(value) {
159
+ this._defaultPageSize = value;
160
+ }
161
+ connectedCallback() {
162
+ super.connectedCallback();
163
+ void this.ensureTableRuntime();
164
+ }
165
+ /**
166
+ * Called after the element's DOM has been updated for the first time.
167
+ * Initializes the table page size.
168
+ *
169
+ * @param _changedProperties - Map of properties that changed during the update
170
+ */
171
+ async firstUpdated(_changedProperties) {
172
+ await this.updateComplete;
173
+ this._updateDefaultPageSize();
174
+ this._setPageSize();
175
+ }
176
+ /**
177
+ * Updates the CSS custom property `--cds-chat-table-width` based on the parent element's width.
178
+ * Also calculates the default page size on first run based on the measured width.
179
+ * This method is called once during component initialization.
180
+ *
181
+ * @private
182
+ */
183
+ _updateDefaultPageSize() {
184
+ if (this.parentElement) {
185
+ let parentWidth = this.parentElement.offsetWidth;
186
+ // If parent width is 0, use fallback width that ensures 5-row default page size
187
+ if (parentWidth === 0) {
188
+ parentWidth = PAGE_SIZE_WIDTH_THRESHOLD - 1;
189
+ }
190
+ // Calculate default page size based on the width we just measured
191
+ // Only set it once, don't recalculate on resize
192
+ if (parentWidth > 0 && this._defaultPageSize === 5) {
193
+ this._defaultPageSize =
194
+ parentWidth > PAGE_SIZE_WIDTH_THRESHOLD ? 10 : 5;
195
+ // Update _currentPageSize if it's still at the initial value
196
+ if (this._currentPageSize === 5) {
197
+ this._currentPageSize = this._defaultPageSize;
198
+ }
199
+ }
200
+ }
201
+ }
202
+ /**
203
+ * Called before the element updates to prepare state changes.
204
+ * Handles validation and re-initialization of table data when headers or rows change.
205
+ *
206
+ * @param changedProperties - Map of properties that changed during the update
207
+ * @protected
208
+ */
209
+ willUpdate(changedProperties) {
210
+ // If the headers or rows has recently updated and both are defined than we should validate the table
211
+ // data. This will likely only happen on the web components first render cycle when the props go from undefined to
212
+ // defined.
213
+ if ((changedProperties.has("headers") || changedProperties.has("rows")) &&
214
+ this.headers !== undefined &&
215
+ this.rows !== undefined) {
216
+ this._calcIsTableValid();
217
+ }
218
+ // If the value of tableRows updated then initialize the internal rows arrays.
219
+ if (changedProperties.has("rows") && this.rows !== undefined) {
220
+ this._initializeRowsArrays();
221
+ this._setPageSize();
222
+ }
223
+ }
224
+ /**
225
+ * Validates the table structure by checking if all rows have the same number of cells as the header.
226
+ * Sets the internal `_isValid` state to false if any row has a mismatched cell count.
227
+ *
228
+ * A valid table requires:
229
+ * - All rows must have the same number of cells as there are headers
230
+ * - No rows can have more or fewer cells than the column count
231
+ *
232
+ * @private
233
+ */
234
+ _calcIsTableValid() {
235
+ const columnCount = this.headers.length;
236
+ // If one of the rows has a different number of cells than the number of columns in the header then set our internal
237
+ // valid state to false.
238
+ this._isValid = !this.rows.some((row) => row.cells.length !== columnCount);
239
+ // In the future, once we have an inlineError web component to use, we can render that when our table is not valid
240
+ // (as well as throwing the below error). Until then our React container is rendering the error component and
241
+ // throwing the error.
242
+ // throw new Error(
243
+ // `${WA_CONSOLE_PREFIX} Number of cells in the table header does not match the number of cells in one or more of the table rows. In order to render a table there needs to be the same number of columns in the table header and all of the table rows.`,
244
+ // );
245
+ }
246
+ /**
247
+ * Initializes internal arrays used for table functionality.
248
+ * Creates a new array of rows with unique IDs and initializes the filter visibility tracking.
249
+ *
250
+ * This method:
251
+ * 1. Resets the `_rowsWithIDs` array and `_filterVisibleRowIDs` set
252
+ * 2. Assigns string-based IDs to each row for tracking purposes
253
+ * 3. Marks all rows as initially visible (not filtered out)
254
+ *
255
+ * @private
256
+ */
257
+ _initializeRowsArrays() {
258
+ // Reset both arrays.
259
+ this._rowsWithIDs = [];
260
+ this._filterVisibleRowIDs = new Set();
261
+ this.rows.forEach((row, index) => {
262
+ const id = index.toString();
263
+ this._rowsWithIDs.push({ ...row, id });
264
+ this._filterVisibleRowIDs.add(id);
265
+ });
266
+ }
267
+ /**
268
+ * Configures the table's page size and filtering behavior.
269
+ * Determines whether filtering/searching should be enabled based on the number of rows
270
+ * relative to the current page size.
271
+ *
272
+ * Filtering is enabled when there are more rows than can fit on a single page,
273
+ * allowing users to search and paginate through large datasets.
274
+ *
275
+ * @private
276
+ */
277
+ _setPageSize() {
278
+ // If there are more rows than the page size then enable filtering.
279
+ this._allowFiltering = this.rows.length > this._currentPageSize;
280
+ // Update the visible rows in case the page size has changed or this is the first time this web component has
281
+ // rendered.
282
+ this._updateVisibleRows();
283
+ }
284
+ async ensureTableRuntime() {
285
+ if (this.tableRuntime) {
286
+ return this.tableRuntime;
287
+ }
288
+ if (typeof window === "undefined") {
289
+ return null;
290
+ }
291
+ if (!this.tableRuntimePromise) {
292
+ this.tableRuntimePromise = loadTableRuntime();
293
+ }
294
+ try {
295
+ const runtime = await this.tableRuntimePromise;
296
+ this.tableRuntime = runtime;
297
+ this.requestUpdate();
298
+ return runtime;
299
+ }
300
+ catch (error) {
301
+ console.error("Failed to load table runtime", error);
302
+ this.tableRuntimePromise = null;
303
+ return null;
304
+ }
305
+ }
306
+ /**
307
+ * Controls which table rows are visible based on pagination and filtering.
308
+ * Uses CSS display properties to show/hide rows rather than DOM manipulation.
309
+ *
310
+ * This approach is necessary because Carbon's table component handles its own
311
+ * sorting and we need to preserve the DOM order it creates. The method:
312
+ * 1. Hides all rows initially
313
+ * 2. Filters to only rows that haven't been filtered out
314
+ * 3. Shows only the rows that belong to the current page
315
+ *
316
+ * @param page - The page number to display (1-based)
317
+ * @param pageSize - Number of rows per page
318
+ * @private
319
+ */
320
+ _updateVisibleRows(page = this._currentPageNumber, pageSize = this._currentPageSize) {
321
+ // Set the current page number and only show the rows for that page.
322
+ this._currentPageNumber = page;
323
+ // Grab all the rows that have been rendered. It's necessary to grab them from the page because the cds-table puts
324
+ // the rows in a specific order when sorting and we want to preserve that order.
325
+ const rows = Array.from(this.renderRoot.querySelectorAll("cds-table-row"));
326
+ // This is similar to the carbon example here https://stackblitz.com/edit/github-kbd9xw-s3y3s6?file=index.html. I
327
+ // originally tried creating and passing an array of the specific rows the template should render for the current
328
+ // page. Unfortunately doing that doesn't work with the combination of the is-sortable prop for the table and
329
+ // page-size prop for pagination. What would happen is old rows would persist if you were on the last page and there
330
+ // weren't enough rows to fill the page (even though the old rows weren't included in the new rows provided to the
331
+ // template). Using Carbon's example of hiding the rows with styling works so I'm extending that concept here even
332
+ // though, ideally, render controls the view and reacts to the state that would be determined here.
333
+ // Hide all the rows to start.
334
+ rows.forEach((row) => row.style.setProperty("display", "none"));
335
+ // Now filter the rows down to what is visible according to the filter.
336
+ const filterVisibleRows = rows.filter((row) => this._filterVisibleRowIDs.has(row.id));
337
+ // Now show all the rows that are within the current page.
338
+ const pageStart = (page - 1) * pageSize;
339
+ const pageEnd = page * pageSize - 1;
340
+ for (let index = pageStart; index <= pageEnd; index++) {
341
+ // If there is a row at that index then show it. If there aren't enough rows to fill the page then there won't be
342
+ // a row at that index.
343
+ filterVisibleRows[index]?.removeAttribute("style");
344
+ }
345
+ }
346
+ /**
347
+ * Handles the table download functionality by exporting all table data as a CSV file.
348
+ *
349
+ * This custom implementation is necessary because Carbon's default download feature:
350
+ * - Only exports selected rows (we want all data)
351
+ * - Only exports as JSON (we want CSV format)
352
+ * - Doesn't include all the data we need
353
+ *
354
+ * The method dynamically imports the CSV stringify library to avoid bundle bloat,
355
+ * creates a data URL to comply with CSP policies, and triggers a download.
356
+ *
357
+ * @public
358
+ */
359
+ async _handleDownload() {
360
+ // Don't save content from the expandable rows at this time. This could be added in the future but it's unclear how
361
+ // this would look in the download.
362
+ const tableArray = [
363
+ this.headers.map((cell) => cell.text),
364
+ ...this.rows.map((row) => row.cells.map((cell) => cell.text)),
365
+ ];
366
+ try {
367
+ // Lazy load the CSV stringify function only when needed
368
+ const { stringify } = await import('csv-stringify/browser/esm/sync');
369
+ // Convert table data to CSV format
370
+ const csvContent = stringify(tableArray);
371
+ // Use data URL instead of Blob to avoid CSP issues with object-src
372
+ const dataUrl = `data:text/csv;charset=utf-8,${encodeURIComponent(csvContent)}`;
373
+ // Create and trigger download using anchor element
374
+ const link = document.createElement("a");
375
+ link.setAttribute("href", dataUrl);
376
+ link.setAttribute("download", "table-data.csv");
377
+ link.style.visibility = "hidden";
378
+ document.body.appendChild(link);
379
+ // Trigger download and cleanup
380
+ link.click();
381
+ document.body.removeChild(link);
382
+ }
383
+ catch (error) {
384
+ console.error("Failed to download table data:", error);
385
+ // Fallback: could show user notification or use alternative method
386
+ }
387
+ }
388
+ /**
389
+ * Renders the table component based on current state and data.
390
+ *
391
+ * The render logic follows this priority:
392
+ * 1. Shows skeleton loading state if `loading` is true
393
+ * 2. Shows table with pagination if there are more rows than the page size OR pagination was used
394
+ * 3. Shows table only if all rows fit on one page
395
+ *
396
+ * The method also applies the appropriate Carbon theme class (cds--g90 for dark, cds--white for light)
397
+ * to ensure proper styling based on the `dark` property.
398
+ *
399
+ * @returns The lit-html template for the table component
400
+ * @public
401
+ */
402
+ render() {
403
+ // TODO TABLE: Once we have a web component version of the inline error state we could render that here if
404
+ // !this._isValid.
405
+ // This could be used while we wait for a md stream containing a table to complete.
406
+ const runtime = this.tableRuntime;
407
+ if (this.loading || !runtime) {
408
+ if (!runtime) {
409
+ void this.ensureTableRuntime();
410
+ }
411
+ return tableSkeletonTemplate(this._currentPageSize);
412
+ }
413
+ const { tableTemplate, tablePaginationTemplate } = runtime;
414
+ // If there are more rows than the page size then we need to add the pagination component. If the rows per page has
415
+ // been changed by the pagination component then we need to keep the pagination component around so the user can
416
+ // change the page size again, even if the current page size is the same as the number of table rows.
417
+ if (this.rows.length > this._currentPageSize || this._rowsPerPageChanged) {
418
+ return html `<div class="cds-ai-chat-table-container">
419
+ ${tableTemplate(this)}
420
+ ${tablePaginationTemplate({
421
+ _currentPageSize: this._currentPageSize,
422
+ _currentPageNumber: this._currentPageNumber,
423
+ _filterVisibleRowIDs: this._filterVisibleRowIDs,
424
+ rows: this.rows,
425
+ previousPageText: this.previousPageText,
426
+ nextPageText: this.nextPageText,
427
+ itemsPerPageText: this.itemsPerPageText,
428
+ getPaginationSupplementalText: this.getPaginationSupplementalText,
429
+ getPaginationStatusText: this.getPaginationStatusText,
430
+ _handlePageChangeEvent: this._handlePageChangeEvent,
431
+ _handlePageSizeChangeEvent: this._handlePageSizeChangeEvent,
432
+ })}
433
+ </div>`;
434
+ }
435
+ // Otherwise, just render the table.
436
+ return html `<div class="cds-ai-chat-table-container">
437
+ ${tableTemplate(this)}
438
+ </div>`;
439
+ }
440
+ };
441
+ TableElement.styles = styles;
442
+ __decorate([
443
+ property({ type: String, attribute: "table-title" })
444
+ ], TableElement.prototype, "tableTitle", void 0);
445
+ __decorate([
446
+ property({ type: String, attribute: "table-description" })
447
+ ], TableElement.prototype, "tableDescription", void 0);
448
+ __decorate([
449
+ property({ type: Array, attribute: false })
450
+ ], TableElement.prototype, "headers", void 0);
451
+ __decorate([
452
+ property({ type: Array, attribute: false })
453
+ ], TableElement.prototype, "rows", void 0);
454
+ __decorate([
455
+ property({ type: Boolean, attribute: "loading" })
456
+ ], TableElement.prototype, "loading", void 0);
457
+ __decorate([
458
+ property({ type: String, attribute: "filter-placeholder-text" })
459
+ ], TableElement.prototype, "filterPlaceholderText", void 0);
460
+ __decorate([
461
+ property({ type: String, attribute: "previous-page-text" })
462
+ ], TableElement.prototype, "previousPageText", void 0);
463
+ __decorate([
464
+ property({ type: String, attribute: "next-page-text" })
465
+ ], TableElement.prototype, "nextPageText", void 0);
466
+ __decorate([
467
+ property({ type: String, attribute: "items-per-page-text" })
468
+ ], TableElement.prototype, "itemsPerPageText", void 0);
469
+ __decorate([
470
+ property({ type: String, attribute: "locale" })
471
+ ], TableElement.prototype, "locale", void 0);
472
+ __decorate([
473
+ state()
474
+ ], TableElement.prototype, "_defaultPageSize", void 0);
475
+ __decorate([
476
+ property({ type: Number, attribute: "default-page-size" })
477
+ ], TableElement.prototype, "defaultPageSize", null);
478
+ __decorate([
479
+ property({ type: Function, attribute: false })
480
+ ], TableElement.prototype, "getPaginationSupplementalText", void 0);
481
+ __decorate([
482
+ property({ type: Function, attribute: false })
483
+ ], TableElement.prototype, "getPaginationStatusText", void 0);
484
+ __decorate([
485
+ state()
486
+ ], TableElement.prototype, "_isValid", void 0);
487
+ __decorate([
488
+ state()
489
+ ], TableElement.prototype, "_currentPageNumber", void 0);
490
+ __decorate([
491
+ state()
492
+ ], TableElement.prototype, "_currentPageSize", void 0);
493
+ __decorate([
494
+ state()
495
+ ], TableElement.prototype, "_rowsPerPageChanged", void 0);
496
+ __decorate([
497
+ state()
498
+ ], TableElement.prototype, "_filterVisibleRowIDs", void 0);
499
+ __decorate([
500
+ state()
501
+ ], TableElement.prototype, "_rowsWithIDs", void 0);
502
+ __decorate([
503
+ state()
504
+ ], TableElement.prototype, "_allowFiltering", void 0);
505
+ TableElement = __decorate([
506
+ carbonElement(TABLE_COMPONENT_TAG_NAME)
507
+ ], TableElement);
508
+ var TableElement_default = TableElement;
509
+
510
+ export { TABLE_COMPONENT_TAG_NAME, TableElement, TableElement_default as default };
511
+ //# sourceMappingURL=cds-aichat-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cds-aichat-table.js","sources":["../../../../src/components/table/src/cds-aichat-table.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAuCH;AACA,MAAM,yBAAyB,GAAG,GAAG;AAErC;AACA;AACA,MAAM,wBAAwB,GAAG;AAEjC;;AAEG;AAEH,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU,CAAA;AAArC,IAAA,WAAA,GAAA;;AAaE;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAuB,EAAE;AAEhC;;AAEG;QAEH,IAAA,CAAA,IAAI,GAAsB,EAAE;AAE5B;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAG,KAAK;AAEf;;AAEG;QAEH,IAAA,CAAA,qBAAqB,GAAG,EAAE;AAE1B;;AAEG;QAEH,IAAA,CAAA,gBAAgB,GAAG,EAAE;AAErB;;AAEG;QAEH,IAAA,CAAA,YAAY,GAAG,EAAE;AAEjB;;AAEG;QAEH,IAAA,CAAA,gBAAgB,GAAG,EAAE;AAErB;;AAEG;QAEH,IAAA,CAAA,MAAM,GAAG,EAAE;AAEX;;;AAGG;QAEK,IAAA,CAAA,gBAAgB,GAAG,CAAC;AA+B5B;;AAEG;QAEO,IAAA,CAAA,QAAQ,GAAG,IAAI;AAEzB;;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AAA,EAAA,YAAA,CAAA,SAAA,EAAA,qBAAA,EAAA,MAAA,CAAA;AAM5B,UAAA,CAAA;AADN,IAAA,KAAK;AAC+C,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,MAAA,CAAA;AAM9C,UAAA,CAAA;AADN,IAAA,KAAK;AACsC,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAMrC,UAAA,CAAA;AADN,IAAA,KAAK;AACyB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;AA7I3B,YAAY,GAAA,UAAA,CAAA;IADjB,aAAa,CAAC,wBAAwB;AACjC,CAAA,EAAA,YAAY,CA+gBjB;AAID,2BAAe,YAAY;;;;"}
@@ -0,0 +1,4 @@
1
+ type TableRuntimeModule = typeof import("./table-runtime.js");
2
+ export declare function loadTableRuntime(): Promise<TableRuntimeModule>;
3
+ export declare function loadTableDeps(): Promise<TableRuntimeModule>;
4
+ export type { TableRuntimeModule };
@@ -0,0 +1,28 @@
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
+ * Copyright IBM Corp. 2025
10
+ *
11
+ * This source code is licensed under the Apache-2.0 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ *
14
+ * @license
15
+ */
16
+ let tableRuntimePromise = null;
17
+ function loadTableRuntime() {
18
+ if (!tableRuntimePromise) {
19
+ tableRuntimePromise = import('./table-runtime.js');
20
+ }
21
+ return tableRuntimePromise;
22
+ }
23
+ function loadTableDeps() {
24
+ return loadTableRuntime();
25
+ }
26
+
27
+ export { loadTableDeps, loadTableRuntime };
28
+ //# sourceMappingURL=table-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-loader.js","sources":["../../../../src/components/table/src/table-loader.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAIH,IAAI,mBAAmB,GAAuC,IAAI;SAElD,gBAAgB,GAAA;IAC9B,IAAI,CAAC,mBAAmB,EAAE;AACxB,QAAA,mBAAmB,GAAG,OAAO,oBAAoB,CAAC;IACpD;AACA,IAAA,OAAO,mBAAmB;AAC5B;SAEgB,aAAa,GAAA;IAC3B,OAAO,gBAAgB,EAAE;AAC3B;;;;"}
@@ -0,0 +1,27 @@
1
+ import "@carbon/web-components/es/components/pagination/index.js";
2
+ import "@carbon/web-components/es/components/select/index.js";
3
+ import { TableRowContent } from "./cds-aichat-table.js";
4
+ interface TablePaginationProps {
5
+ _currentPageSize: number;
6
+ _currentPageNumber: number;
7
+ _filterVisibleRowIDs: Set<string>;
8
+ rows: TableRowContent[];
9
+ previousPageText: string;
10
+ nextPageText: string;
11
+ itemsPerPageText: string;
12
+ getPaginationSupplementalText?: ({ count }: {
13
+ count: number;
14
+ }) => string;
15
+ getPaginationStatusText?: ({ start, end, count, }: {
16
+ start: number;
17
+ end: number;
18
+ count: number;
19
+ }) => string;
20
+ _handlePageChangeEvent: (event: any) => void;
21
+ _handlePageSizeChangeEvent: (event: any) => void;
22
+ }
23
+ /**
24
+ * Table pagination view logic.
25
+ */
26
+ declare function tablePaginationTemplate(props: TablePaginationProps): import("lit-html").TemplateResult<1>;
27
+ export { tablePaginationTemplate };
@@ -0,0 +1,55 @@
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 '@carbon/web-components/es/components/pagination/index.js';
9
+ import '@carbon/web-components/es/components/select/index.js';
10
+ import { html } from 'lit';
11
+
12
+ /*
13
+ * Copyright IBM Corp. 2025
14
+ *
15
+ * This source code is licensed under the Apache-2.0 license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ *
18
+ * @license
19
+ */
20
+ // Import only the constants, not the class
21
+ const POSSIBLE_PAGE_SIZES = [5, 10, 15, 20, 50];
22
+ /**
23
+ * Table pagination view logic.
24
+ */
25
+ function tablePaginationTemplate(props) {
26
+ const { _currentPageSize: currentPageSize, _currentPageNumber: currentPageNumber, _filterVisibleRowIDs: filterVisibleRowIDs, rows, previousPageText, nextPageText, itemsPerPageText, getPaginationSupplementalText, getPaginationStatusText, _handlePageChangeEvent: handlePageChangeEvent, _handlePageSizeChangeEvent: handlePageSizeChangeEvent, } = props;
27
+ if (!filterVisibleRowIDs || !filterVisibleRowIDs.size) {
28
+ return html ``;
29
+ }
30
+ const totalVisibleRows = filterVisibleRowIDs.size;
31
+ const totalRows = rows.length;
32
+ // Page sizes will only be included if the page size is less than the total number of rows.
33
+ const supportedPageSizes = POSSIBLE_PAGE_SIZES.filter((pageSize) => pageSize < totalRows);
34
+ return html `<cds-pagination
35
+ page-size=${currentPageSize}
36
+ page=${currentPageNumber}
37
+ total-items=${totalVisibleRows}
38
+ totalPages=${Math.ceil(totalVisibleRows / currentPageSize)}
39
+ backward-text=${previousPageText}
40
+ forward-text=${nextPageText}
41
+ items-per-page-text=${itemsPerPageText}
42
+ .formatSupplementalText=${getPaginationSupplementalText}
43
+ .formatStatusWithDeterminateTotal=${getPaginationStatusText}
44
+ @cds-pagination-changed-current=${handlePageChangeEvent}
45
+ @cds-page-sizes-select-changed=${handlePageSizeChangeEvent}
46
+ >
47
+ ${supportedPageSizes.map((pageSize) => html `<cds-select-item value="${pageSize}"
48
+ >${pageSize}</cds-select-item
49
+ >`)}
50
+ <cds-select-item value="${totalRows}">${totalRows}</cds-select-item>
51
+ </cds-pagination>`;
52
+ }
53
+
54
+ export { tablePaginationTemplate };
55
+ //# sourceMappingURL=table-pagination.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-pagination.template.js","sources":["../../../../src/components/table/src/table-pagination.template.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;AAOG;AAQH;AACA,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAwB/C;;AAEG;AACH,SAAS,uBAAuB,CAAC,KAA2B,EAAA;AAC1D,IAAA,MAAM,EACJ,gBAAgB,EAAE,eAAe,EACjC,kBAAkB,EAAE,iBAAiB,EACrC,oBAAoB,EAAE,mBAAmB,EACzC,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,EAAE,qBAAqB,EAC7C,0BAA0B,EAAE,yBAAyB,GACtD,GAAG,KAAK;IAET,IAAI,CAAC,mBAAmB,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE;QACrD,OAAO,IAAI,CAAA,CAAA,CAAE;IACf;AAEA,IAAA,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI;AACjD,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM;;AAG7B,IAAA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CACnD,CAAC,QAAQ,KAAK,QAAQ,GAAG,SAAS,CACnC;AAED,IAAA,OAAO,IAAI,CAAA,CAAA;gBACG,eAAe;WACpB,iBAAiB;kBACV,gBAAgB;AACjB,eAAA,EAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;oBAC1C,gBAAgB;mBACjB,YAAY;0BACL,gBAAgB;8BACZ,6BAA6B;wCACnB,uBAAuB;sCACzB,qBAAqB;qCACtB,yBAAyB;;MAExD,kBAAkB,CAAC,GAAG,CACtB,CAAC,QAAQ,KACP,IAAI,CAAA,CAAA,wBAAA,EAA2B,QAAQ,CAAA;aAClC,QAAQ,CAAA;UACX,CACL;AACyB,4BAAA,EAAA,SAAS,KAAK,SAAS,CAAA;oBACjC;AACpB;;;;"}
@@ -0,0 +1,2 @@
1
+ export { tableTemplate } from "./table.template.js";
2
+ export { tablePaginationTemplate } from "./table-pagination.template.js";
@@ -0,0 +1,10 @@
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
+ export { tableTemplate } from './table.template.js';
9
+ export { tablePaginationTemplate } from './table-pagination.template.js';
10
+ //# sourceMappingURL=table-runtime.js.map