@neo4j-ndl/react 4.2.6 → 4.2.8

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 (402) hide show
  1. package/lib/cjs/accordion/stories/index.js +1 -1
  2. package/lib/cjs/accordion/stories/index.js.map +1 -1
  3. package/lib/cjs/ai/code-preview/stories/index.js +1 -1
  4. package/lib/cjs/ai/code-preview/stories/index.js.map +1 -1
  5. package/lib/cjs/ai/file-tag/FileTag.js.map +1 -1
  6. package/lib/cjs/ai/file-tag/stories/index.js +1 -1
  7. package/lib/cjs/ai/file-tag/stories/index.js.map +1 -1
  8. package/lib/cjs/ai/image-tag/ImageTag.js.map +1 -1
  9. package/lib/cjs/ai/image-tag/stories/index.js +1 -1
  10. package/lib/cjs/ai/image-tag/stories/index.js.map +1 -1
  11. package/lib/cjs/ai/more-files/MoreFiles.js +18 -19
  12. package/lib/cjs/ai/more-files/MoreFiles.js.map +1 -1
  13. package/lib/cjs/ai/more-files/stories/index.js +1 -1
  14. package/lib/cjs/ai/more-files/stories/index.js.map +1 -1
  15. package/lib/cjs/ai/more-files/stories/more-files.story.js +5 -5
  16. package/lib/cjs/ai/more-files/stories/more-files.story.js.map +1 -1
  17. package/lib/cjs/ai/presence/Presence.js.map +1 -1
  18. package/lib/cjs/ai/presence/stories/index.js +1 -1
  19. package/lib/cjs/ai/presence/stories/index.js.map +1 -1
  20. package/lib/cjs/ai/prompt/Prompt.js.map +1 -1
  21. package/lib/cjs/ai/prompt/stories/index.js +1 -1
  22. package/lib/cjs/ai/prompt/stories/index.js.map +1 -1
  23. package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -1
  24. package/lib/cjs/ai/reasoning/stories/index.js +1 -1
  25. package/lib/cjs/ai/reasoning/stories/index.js.map +1 -1
  26. package/lib/cjs/ai/response/Response.js.map +1 -1
  27. package/lib/cjs/ai/response/stories/index.js +1 -1
  28. package/lib/cjs/ai/response/stories/index.js.map +1 -1
  29. package/lib/cjs/ai/suggestion/Suggestion.js +18 -19
  30. package/lib/cjs/ai/suggestion/Suggestion.js.map +1 -1
  31. package/lib/cjs/ai/suggestion/stories/index.js +1 -1
  32. package/lib/cjs/ai/suggestion/stories/index.js.map +1 -1
  33. package/lib/cjs/ai/thinking/Thinking.js +18 -19
  34. package/lib/cjs/ai/thinking/Thinking.js.map +1 -1
  35. package/lib/cjs/ai/thinking/stories/index.js +1 -1
  36. package/lib/cjs/ai/thinking/stories/index.js.map +1 -1
  37. package/lib/cjs/ai/tool-call/ToolCall.js.map +1 -1
  38. package/lib/cjs/ai/tool-call/stories/index.js +1 -1
  39. package/lib/cjs/ai/tool-call/stories/index.js.map +1 -1
  40. package/lib/cjs/ai/user-bubble/UserBubble.js.map +1 -1
  41. package/lib/cjs/ai/user-bubble/stories/index.js +1 -1
  42. package/lib/cjs/ai/user-bubble/stories/index.js.map +1 -1
  43. package/lib/cjs/ai/user-bubble/stories/user-bubble-action.story.js +2 -2
  44. package/lib/cjs/ai/user-bubble/stories/user-bubble-action.story.js.map +1 -1
  45. package/lib/cjs/ai/user-bubble/stories/user-bubble-and-files.story.js +5 -5
  46. package/lib/cjs/ai/user-bubble/stories/user-bubble-and-files.story.js.map +1 -1
  47. package/lib/cjs/avatar/stories/index.js +1 -1
  48. package/lib/cjs/avatar/stories/index.js.map +1 -1
  49. package/lib/cjs/banner/stories/index.js +1 -1
  50. package/lib/cjs/banner/stories/index.js.map +1 -1
  51. package/lib/cjs/box/stories/index.js +1 -1
  52. package/lib/cjs/box/stories/index.js.map +1 -1
  53. package/lib/cjs/button/stories/index.js +1 -1
  54. package/lib/cjs/button/stories/index.js.map +1 -1
  55. package/lib/cjs/clean-icon-button/stories/index.js +1 -1
  56. package/lib/cjs/clean-icon-button/stories/index.js.map +1 -1
  57. package/lib/cjs/clipboard-button/stories/index.js +1 -1
  58. package/lib/cjs/clipboard-button/stories/index.js.map +1 -1
  59. package/lib/cjs/code/stories/index.js +1 -1
  60. package/lib/cjs/code/stories/index.js.map +1 -1
  61. package/lib/cjs/code-block/stories/index.js +1 -1
  62. package/lib/cjs/code-block/stories/index.js.map +1 -1
  63. package/lib/cjs/color-picker/stories/index.js +1 -1
  64. package/lib/cjs/color-picker/stories/index.js.map +1 -1
  65. package/lib/cjs/conditional-wrap/stories/index.js +1 -1
  66. package/lib/cjs/conditional-wrap/stories/index.js.map +1 -1
  67. package/lib/cjs/data-grid/Components.js +2 -2
  68. package/lib/cjs/data-grid/Components.js.map +1 -1
  69. package/lib/cjs/data-grid/stories/datagrid-virtualization.story.js.map +1 -1
  70. package/lib/cjs/data-grid/stories/index.js +1 -1
  71. package/lib/cjs/data-grid/stories/index.js.map +1 -1
  72. package/lib/cjs/date-picker/stories/index.js +1 -1
  73. package/lib/cjs/date-picker/stories/index.js.map +1 -1
  74. package/lib/cjs/dialog/stories/index.js +1 -1
  75. package/lib/cjs/dialog/stories/index.js.map +1 -1
  76. package/lib/cjs/divider/stories/index.js +1 -1
  77. package/lib/cjs/divider/stories/index.js.map +1 -1
  78. package/lib/cjs/drawer/stories/index.js +1 -1
  79. package/lib/cjs/drawer/stories/index.js.map +1 -1
  80. package/lib/cjs/dropdown-button/stories/index.js +1 -1
  81. package/lib/cjs/dropdown-button/stories/index.js.map +1 -1
  82. package/lib/cjs/dropzone/stories/index.js +1 -1
  83. package/lib/cjs/dropzone/stories/index.js.map +1 -1
  84. package/lib/cjs/flex/stories/index.js +1 -1
  85. package/lib/cjs/flex/stories/index.js.map +1 -1
  86. package/lib/cjs/graph-label/stories/index.js +1 -1
  87. package/lib/cjs/graph-label/stories/index.js.map +1 -1
  88. package/lib/cjs/icon-button/stories/index.js +1 -1
  89. package/lib/cjs/icon-button/stories/index.js.map +1 -1
  90. package/lib/cjs/icon-button-array/stories/index.js +1 -1
  91. package/lib/cjs/icon-button-array/stories/index.js.map +1 -1
  92. package/lib/cjs/icons/manual/Neo4JAiColor.js +15 -16
  93. package/lib/cjs/icons/manual/Neo4JAiColor.js.map +1 -1
  94. package/lib/cjs/inline-edit/stories/index.js +1 -1
  95. package/lib/cjs/inline-edit/stories/index.js.map +1 -1
  96. package/lib/cjs/kbd/stories/index.js +1 -1
  97. package/lib/cjs/kbd/stories/index.js.map +1 -1
  98. package/lib/cjs/loading-bar/stories/index.js +1 -1
  99. package/lib/cjs/loading-bar/stories/index.js.map +1 -1
  100. package/lib/cjs/loading-spinner/stories/index.js +1 -1
  101. package/lib/cjs/loading-spinner/stories/index.js.map +1 -1
  102. package/lib/cjs/logo/stories/index.js +1 -1
  103. package/lib/cjs/logo/stories/index.js.map +1 -1
  104. package/lib/cjs/menu/stories/index.js +1 -1
  105. package/lib/cjs/menu/stories/index.js.map +1 -1
  106. package/lib/cjs/menu/stories/menu-custom-items.story.js +2 -1
  107. package/lib/cjs/menu/stories/menu-custom-items.story.js.map +1 -1
  108. package/lib/cjs/progress-bar/stories/index.js +1 -1
  109. package/lib/cjs/progress-bar/stories/index.js.map +1 -1
  110. package/lib/cjs/segmented-control/stories/index.js +1 -1
  111. package/lib/cjs/segmented-control/stories/index.js.map +1 -1
  112. package/lib/cjs/select/stories/index.js +1 -1
  113. package/lib/cjs/select/stories/index.js.map +1 -1
  114. package/lib/cjs/slider/stories/index.js +1 -1
  115. package/lib/cjs/slider/stories/index.js.map +1 -1
  116. package/lib/cjs/spotlight/stories/index.js +1 -1
  117. package/lib/cjs/spotlight/stories/index.js.map +1 -1
  118. package/lib/cjs/status-indicator/stories/index.js +1 -1
  119. package/lib/cjs/status-indicator/stories/index.js.map +1 -1
  120. package/lib/cjs/status-label/stories/index.js +1 -1
  121. package/lib/cjs/status-label/stories/index.js.map +1 -1
  122. package/lib/cjs/switch/stories/index.js +1 -1
  123. package/lib/cjs/switch/stories/index.js.map +1 -1
  124. package/lib/cjs/tabs/stories/index.js +1 -1
  125. package/lib/cjs/tabs/stories/index.js.map +1 -1
  126. package/lib/cjs/tag/stories/index.js +1 -1
  127. package/lib/cjs/tag/stories/index.js.map +1 -1
  128. package/lib/cjs/text-area/stories/index.js +1 -1
  129. package/lib/cjs/text-area/stories/index.js.map +1 -1
  130. package/lib/cjs/text-input/stories/index.js +1 -1
  131. package/lib/cjs/text-input/stories/index.js.map +1 -1
  132. package/lib/cjs/text-link/stories/index.js +1 -1
  133. package/lib/cjs/text-link/stories/index.js.map +1 -1
  134. package/lib/cjs/time-picker/stories/index.js +1 -1
  135. package/lib/cjs/time-picker/stories/index.js.map +1 -1
  136. package/lib/cjs/timezone-picker/stories/index.js +1 -1
  137. package/lib/cjs/timezone-picker/stories/index.js.map +1 -1
  138. package/lib/cjs/toast/stories/index.js +1 -1
  139. package/lib/cjs/toast/stories/index.js.map +1 -1
  140. package/lib/cjs/tooltip/stories/index.js +1 -1
  141. package/lib/cjs/tooltip/stories/index.js.map +1 -1
  142. package/lib/cjs/tree-view/stories/index.js +1 -1
  143. package/lib/cjs/tree-view/stories/index.js.map +1 -1
  144. package/lib/cjs/tree-view/stories/treeview-custom.story.js +5 -5
  145. package/lib/cjs/tree-view/stories/treeview-custom.story.js.map +1 -1
  146. package/lib/cjs/tree-view/stories/treeview-default.story.js +4 -4
  147. package/lib/cjs/tree-view/stories/treeview-default.story.js.map +1 -1
  148. package/lib/cjs/tree-view/stories/treeview-skeleton-loading.story.js +4 -4
  149. package/lib/cjs/tree-view/stories/treeview-skeleton-loading.story.js.map +1 -1
  150. package/lib/cjs/typography/stories/index.js +1 -1
  151. package/lib/cjs/typography/stories/index.js.map +1 -1
  152. package/lib/cjs/wizard/stories/index.js +1 -1
  153. package/lib/cjs/wizard/stories/index.js.map +1 -1
  154. package/lib/esm/accordion/stories/index.js +1 -1
  155. package/lib/esm/accordion/stories/index.js.map +1 -1
  156. package/lib/esm/ai/code-preview/stories/index.js +1 -1
  157. package/lib/esm/ai/code-preview/stories/index.js.map +1 -1
  158. package/lib/esm/ai/file-tag/FileTag.js.map +1 -1
  159. package/lib/esm/ai/file-tag/stories/index.js +1 -1
  160. package/lib/esm/ai/file-tag/stories/index.js.map +1 -1
  161. package/lib/esm/ai/image-tag/ImageTag.js.map +1 -1
  162. package/lib/esm/ai/image-tag/stories/index.js +1 -1
  163. package/lib/esm/ai/image-tag/stories/index.js.map +1 -1
  164. package/lib/esm/ai/more-files/MoreFiles.js +12 -13
  165. package/lib/esm/ai/more-files/MoreFiles.js.map +1 -1
  166. package/lib/esm/ai/more-files/stories/index.js +1 -1
  167. package/lib/esm/ai/more-files/stories/index.js.map +1 -1
  168. package/lib/esm/ai/more-files/stories/more-files.story.js +1 -1
  169. package/lib/esm/ai/more-files/stories/more-files.story.js.map +1 -1
  170. package/lib/esm/ai/presence/Presence.js.map +1 -1
  171. package/lib/esm/ai/presence/stories/index.js +1 -1
  172. package/lib/esm/ai/presence/stories/index.js.map +1 -1
  173. package/lib/esm/ai/prompt/Prompt.js.map +1 -1
  174. package/lib/esm/ai/prompt/stories/index.js +1 -1
  175. package/lib/esm/ai/prompt/stories/index.js.map +1 -1
  176. package/lib/esm/ai/reasoning/Reasoning.js.map +1 -1
  177. package/lib/esm/ai/reasoning/stories/index.js +1 -1
  178. package/lib/esm/ai/reasoning/stories/index.js.map +1 -1
  179. package/lib/esm/ai/response/Response.js.map +1 -1
  180. package/lib/esm/ai/response/stories/index.js +1 -1
  181. package/lib/esm/ai/response/stories/index.js.map +1 -1
  182. package/lib/esm/ai/suggestion/Suggestion.js +12 -13
  183. package/lib/esm/ai/suggestion/Suggestion.js.map +1 -1
  184. package/lib/esm/ai/suggestion/stories/index.js +1 -1
  185. package/lib/esm/ai/suggestion/stories/index.js.map +1 -1
  186. package/lib/esm/ai/thinking/Thinking.js +12 -13
  187. package/lib/esm/ai/thinking/Thinking.js.map +1 -1
  188. package/lib/esm/ai/thinking/stories/index.js +1 -1
  189. package/lib/esm/ai/thinking/stories/index.js.map +1 -1
  190. package/lib/esm/ai/tool-call/ToolCall.js.map +1 -1
  191. package/lib/esm/ai/tool-call/stories/index.js +1 -1
  192. package/lib/esm/ai/tool-call/stories/index.js.map +1 -1
  193. package/lib/esm/ai/user-bubble/UserBubble.js.map +1 -1
  194. package/lib/esm/ai/user-bubble/stories/index.js +1 -1
  195. package/lib/esm/ai/user-bubble/stories/index.js.map +1 -1
  196. package/lib/esm/ai/user-bubble/stories/user-bubble-action.story.js +1 -1
  197. package/lib/esm/ai/user-bubble/stories/user-bubble-action.story.js.map +1 -1
  198. package/lib/esm/ai/user-bubble/stories/user-bubble-and-files.story.js +1 -1
  199. package/lib/esm/ai/user-bubble/stories/user-bubble-and-files.story.js.map +1 -1
  200. package/lib/esm/avatar/stories/index.js +1 -1
  201. package/lib/esm/avatar/stories/index.js.map +1 -1
  202. package/lib/esm/banner/stories/index.js +1 -1
  203. package/lib/esm/banner/stories/index.js.map +1 -1
  204. package/lib/esm/box/stories/index.js +1 -1
  205. package/lib/esm/box/stories/index.js.map +1 -1
  206. package/lib/esm/button/stories/index.js +1 -1
  207. package/lib/esm/button/stories/index.js.map +1 -1
  208. package/lib/esm/clean-icon-button/stories/index.js +1 -1
  209. package/lib/esm/clean-icon-button/stories/index.js.map +1 -1
  210. package/lib/esm/clipboard-button/stories/index.js +1 -1
  211. package/lib/esm/clipboard-button/stories/index.js.map +1 -1
  212. package/lib/esm/code/stories/index.js +1 -1
  213. package/lib/esm/code/stories/index.js.map +1 -1
  214. package/lib/esm/code-block/stories/index.js +1 -1
  215. package/lib/esm/code-block/stories/index.js.map +1 -1
  216. package/lib/esm/color-picker/stories/index.js +1 -1
  217. package/lib/esm/color-picker/stories/index.js.map +1 -1
  218. package/lib/esm/conditional-wrap/stories/index.js +1 -1
  219. package/lib/esm/conditional-wrap/stories/index.js.map +1 -1
  220. package/lib/esm/data-grid/Components.js +2 -2
  221. package/lib/esm/data-grid/Components.js.map +1 -1
  222. package/lib/esm/data-grid/stories/datagrid-virtualization.story.js.map +1 -1
  223. package/lib/esm/data-grid/stories/index.js +1 -1
  224. package/lib/esm/data-grid/stories/index.js.map +1 -1
  225. package/lib/esm/date-picker/stories/index.js +1 -1
  226. package/lib/esm/date-picker/stories/index.js.map +1 -1
  227. package/lib/esm/dialog/stories/index.js +1 -1
  228. package/lib/esm/dialog/stories/index.js.map +1 -1
  229. package/lib/esm/divider/stories/index.js +1 -1
  230. package/lib/esm/divider/stories/index.js.map +1 -1
  231. package/lib/esm/drawer/stories/index.js +1 -1
  232. package/lib/esm/drawer/stories/index.js.map +1 -1
  233. package/lib/esm/dropdown-button/stories/index.js +1 -1
  234. package/lib/esm/dropdown-button/stories/index.js.map +1 -1
  235. package/lib/esm/dropzone/stories/index.js +1 -1
  236. package/lib/esm/dropzone/stories/index.js.map +1 -1
  237. package/lib/esm/flex/stories/index.js +1 -1
  238. package/lib/esm/flex/stories/index.js.map +1 -1
  239. package/lib/esm/graph-label/stories/index.js +1 -1
  240. package/lib/esm/graph-label/stories/index.js.map +1 -1
  241. package/lib/esm/icon-button/stories/index.js +1 -1
  242. package/lib/esm/icon-button/stories/index.js.map +1 -1
  243. package/lib/esm/icon-button-array/stories/index.js +1 -1
  244. package/lib/esm/icon-button-array/stories/index.js.map +1 -1
  245. package/lib/esm/icons/manual/Neo4JAiColor.js +12 -13
  246. package/lib/esm/icons/manual/Neo4JAiColor.js.map +1 -1
  247. package/lib/esm/inline-edit/stories/index.js +1 -1
  248. package/lib/esm/inline-edit/stories/index.js.map +1 -1
  249. package/lib/esm/kbd/stories/index.js +1 -1
  250. package/lib/esm/kbd/stories/index.js.map +1 -1
  251. package/lib/esm/loading-bar/stories/index.js +1 -1
  252. package/lib/esm/loading-bar/stories/index.js.map +1 -1
  253. package/lib/esm/loading-spinner/stories/index.js +1 -1
  254. package/lib/esm/loading-spinner/stories/index.js.map +1 -1
  255. package/lib/esm/logo/stories/index.js +1 -1
  256. package/lib/esm/logo/stories/index.js.map +1 -1
  257. package/lib/esm/menu/stories/index.js +1 -1
  258. package/lib/esm/menu/stories/index.js.map +1 -1
  259. package/lib/esm/menu/stories/menu-custom-items.story.js +2 -1
  260. package/lib/esm/menu/stories/menu-custom-items.story.js.map +1 -1
  261. package/lib/esm/progress-bar/stories/index.js +1 -1
  262. package/lib/esm/progress-bar/stories/index.js.map +1 -1
  263. package/lib/esm/segmented-control/stories/index.js +1 -1
  264. package/lib/esm/segmented-control/stories/index.js.map +1 -1
  265. package/lib/esm/select/stories/index.js +1 -1
  266. package/lib/esm/select/stories/index.js.map +1 -1
  267. package/lib/esm/slider/stories/index.js +1 -1
  268. package/lib/esm/slider/stories/index.js.map +1 -1
  269. package/lib/esm/spotlight/stories/index.js +1 -1
  270. package/lib/esm/spotlight/stories/index.js.map +1 -1
  271. package/lib/esm/status-indicator/stories/index.js +1 -1
  272. package/lib/esm/status-indicator/stories/index.js.map +1 -1
  273. package/lib/esm/status-label/stories/index.js +1 -1
  274. package/lib/esm/status-label/stories/index.js.map +1 -1
  275. package/lib/esm/switch/stories/index.js +1 -1
  276. package/lib/esm/switch/stories/index.js.map +1 -1
  277. package/lib/esm/tabs/stories/index.js +1 -1
  278. package/lib/esm/tabs/stories/index.js.map +1 -1
  279. package/lib/esm/tag/stories/index.js +1 -1
  280. package/lib/esm/tag/stories/index.js.map +1 -1
  281. package/lib/esm/text-area/stories/index.js +1 -1
  282. package/lib/esm/text-area/stories/index.js.map +1 -1
  283. package/lib/esm/text-input/stories/index.js +1 -1
  284. package/lib/esm/text-input/stories/index.js.map +1 -1
  285. package/lib/esm/text-link/stories/index.js +1 -1
  286. package/lib/esm/text-link/stories/index.js.map +1 -1
  287. package/lib/esm/time-picker/stories/index.js +1 -1
  288. package/lib/esm/time-picker/stories/index.js.map +1 -1
  289. package/lib/esm/timezone-picker/stories/index.js +1 -1
  290. package/lib/esm/timezone-picker/stories/index.js.map +1 -1
  291. package/lib/esm/toast/stories/index.js +1 -1
  292. package/lib/esm/toast/stories/index.js.map +1 -1
  293. package/lib/esm/tooltip/stories/index.js +1 -1
  294. package/lib/esm/tooltip/stories/index.js.map +1 -1
  295. package/lib/esm/tree-view/stories/index.js +1 -1
  296. package/lib/esm/tree-view/stories/index.js.map +1 -1
  297. package/lib/esm/tree-view/stories/treeview-custom.story.js +1 -1
  298. package/lib/esm/tree-view/stories/treeview-custom.story.js.map +1 -1
  299. package/lib/esm/tree-view/stories/treeview-default.story.js +1 -1
  300. package/lib/esm/tree-view/stories/treeview-default.story.js.map +1 -1
  301. package/lib/esm/tree-view/stories/treeview-skeleton-loading.story.js +1 -1
  302. package/lib/esm/tree-view/stories/treeview-skeleton-loading.story.js.map +1 -1
  303. package/lib/esm/typography/stories/index.js +1 -1
  304. package/lib/esm/typography/stories/index.js.map +1 -1
  305. package/lib/esm/wizard/stories/index.js +1 -1
  306. package/lib/esm/wizard/stories/index.js.map +1 -1
  307. package/lib/types/accordion/stories/index.d.ts.map +1 -1
  308. package/lib/types/ai/code-preview/stories/index.d.ts.map +1 -1
  309. package/lib/types/ai/file-tag/FileTag.d.ts +1 -1
  310. package/lib/types/ai/file-tag/FileTag.d.ts.map +1 -1
  311. package/lib/types/ai/file-tag/stories/index.d.ts.map +1 -1
  312. package/lib/types/ai/image-tag/ImageTag.d.ts +1 -1
  313. package/lib/types/ai/image-tag/ImageTag.d.ts.map +1 -1
  314. package/lib/types/ai/image-tag/stories/index.d.ts.map +1 -1
  315. package/lib/types/ai/more-files/MoreFiles.d.ts +1 -1
  316. package/lib/types/ai/more-files/MoreFiles.d.ts.map +1 -1
  317. package/lib/types/ai/more-files/stories/index.d.ts.map +1 -1
  318. package/lib/types/ai/presence/Presence.d.ts +1 -1
  319. package/lib/types/ai/presence/Presence.d.ts.map +1 -1
  320. package/lib/types/ai/presence/stories/index.d.ts.map +1 -1
  321. package/lib/types/ai/prompt/Prompt.d.ts +1 -1
  322. package/lib/types/ai/prompt/Prompt.d.ts.map +1 -1
  323. package/lib/types/ai/prompt/stories/index.d.ts.map +1 -1
  324. package/lib/types/ai/reasoning/Reasoning.d.ts +1 -1
  325. package/lib/types/ai/reasoning/Reasoning.d.ts.map +1 -1
  326. package/lib/types/ai/reasoning/stories/index.d.ts.map +1 -1
  327. package/lib/types/ai/response/Response.d.ts +1 -1
  328. package/lib/types/ai/response/Response.d.ts.map +1 -1
  329. package/lib/types/ai/response/stories/index.d.ts.map +1 -1
  330. package/lib/types/ai/suggestion/Suggestion.d.ts +1 -1
  331. package/lib/types/ai/suggestion/Suggestion.d.ts.map +1 -1
  332. package/lib/types/ai/suggestion/stories/index.d.ts.map +1 -1
  333. package/lib/types/ai/thinking/Thinking.d.ts +1 -1
  334. package/lib/types/ai/thinking/Thinking.d.ts.map +1 -1
  335. package/lib/types/ai/tool-call/ToolCall.d.ts +1 -1
  336. package/lib/types/ai/tool-call/ToolCall.d.ts.map +1 -1
  337. package/lib/types/ai/tool-call/stories/index.d.ts.map +1 -1
  338. package/lib/types/ai/user-bubble/UserBubble.d.ts +1 -1
  339. package/lib/types/ai/user-bubble/UserBubble.d.ts.map +1 -1
  340. package/lib/types/ai/user-bubble/stories/index.d.ts.map +1 -1
  341. package/lib/types/avatar/stories/index.d.ts.map +1 -1
  342. package/lib/types/banner/stories/index.d.ts.map +1 -1
  343. package/lib/types/box/stories/index.d.ts.map +1 -1
  344. package/lib/types/button/stories/index.d.ts.map +1 -1
  345. package/lib/types/clean-icon-button/stories/index.d.ts.map +1 -1
  346. package/lib/types/clipboard-button/stories/index.d.ts.map +1 -1
  347. package/lib/types/code/stories/index.d.ts.map +1 -1
  348. package/lib/types/code-block/stories/index.d.ts.map +1 -1
  349. package/lib/types/color-picker/stories/index.d.ts.map +1 -1
  350. package/lib/types/conditional-wrap/stories/index.d.ts.map +1 -1
  351. package/lib/types/data-grid/Components.d.ts +4 -1
  352. package/lib/types/data-grid/Components.d.ts.map +1 -1
  353. package/lib/types/data-grid/DataGrid.d.ts +2 -1
  354. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  355. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +2 -1
  356. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts.map +1 -1
  357. package/lib/types/data-grid/stories/datagrid-placeholder-states.stories.d.ts +2 -1
  358. package/lib/types/data-grid/stories/datagrid-placeholder-states.stories.d.ts.map +1 -1
  359. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +2 -1
  360. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
  361. package/lib/types/data-grid/stories/datagrid-virtualization.story.d.ts.map +1 -1
  362. package/lib/types/data-grid/stories/index.d.ts.map +1 -1
  363. package/lib/types/date-picker/stories/index.d.ts.map +1 -1
  364. package/lib/types/dialog/stories/index.d.ts.map +1 -1
  365. package/lib/types/divider/stories/index.d.ts.map +1 -1
  366. package/lib/types/drawer/stories/index.d.ts.map +1 -1
  367. package/lib/types/dropdown-button/stories/index.d.ts.map +1 -1
  368. package/lib/types/dropzone/stories/index.d.ts.map +1 -1
  369. package/lib/types/flex/stories/index.d.ts.map +1 -1
  370. package/lib/types/graph-label/stories/index.d.ts.map +1 -1
  371. package/lib/types/icon-button/stories/index.d.ts.map +1 -1
  372. package/lib/types/icon-button-array/stories/index.d.ts.map +1 -1
  373. package/lib/types/icons/manual/Neo4JAiColor.d.ts +4 -3
  374. package/lib/types/icons/manual/Neo4JAiColor.d.ts.map +1 -1
  375. package/lib/types/inline-edit/stories/index.d.ts.map +1 -1
  376. package/lib/types/kbd/stories/index.d.ts.map +1 -1
  377. package/lib/types/loading-bar/stories/index.d.ts.map +1 -1
  378. package/lib/types/loading-spinner/stories/index.d.ts.map +1 -1
  379. package/lib/types/logo/stories/index.d.ts.map +1 -1
  380. package/lib/types/menu/stories/index.d.ts.map +1 -1
  381. package/lib/types/menu/stories/menu-custom-items.story.d.ts.map +1 -1
  382. package/lib/types/progress-bar/stories/index.d.ts.map +1 -1
  383. package/lib/types/segmented-control/stories/index.d.ts.map +1 -1
  384. package/lib/types/select/stories/index.d.ts.map +1 -1
  385. package/lib/types/slider/stories/index.d.ts.map +1 -1
  386. package/lib/types/spotlight/stories/index.d.ts.map +1 -1
  387. package/lib/types/status-indicator/stories/index.d.ts.map +1 -1
  388. package/lib/types/status-label/stories/index.d.ts.map +1 -1
  389. package/lib/types/switch/stories/index.d.ts.map +1 -1
  390. package/lib/types/tabs/stories/index.d.ts.map +1 -1
  391. package/lib/types/tag/stories/index.d.ts.map +1 -1
  392. package/lib/types/text-area/stories/index.d.ts.map +1 -1
  393. package/lib/types/text-input/stories/index.d.ts.map +1 -1
  394. package/lib/types/text-link/stories/index.d.ts.map +1 -1
  395. package/lib/types/time-picker/stories/index.d.ts.map +1 -1
  396. package/lib/types/timezone-picker/stories/index.d.ts.map +1 -1
  397. package/lib/types/toast/stories/index.d.ts.map +1 -1
  398. package/lib/types/tooltip/stories/index.d.ts.map +1 -1
  399. package/lib/types/tree-view/stories/index.d.ts.map +1 -1
  400. package/lib/types/typography/stories/index.d.ts.map +1 -1
  401. package/lib/types/wizard/stories/index.d.ts.map +1 -1
  402. package/package.json +1 -1
@@ -20,9 +20,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
22
  import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { Menu } from '@neo4j-ndl/react';
23
24
  import { MoreFiles } from '@neo4j-ndl/react/ai';
24
25
  import { DocumentIconOutline, PhotoIconOutline, TableCellsIconOutline, } from '@neo4j-ndl/react/icons';
25
- import { Menu } from '@neo4j-ndl/react/menu';
26
26
  import { useRef, useState } from 'react';
27
27
  const Component = () => {
28
28
  const [isMenuOpen, setIsMenuOpen] = useState(false);
@@ -1 +1 @@
1
- {"version":3,"file":"more-files.story.js","sourceRoot":"","sources":["../../../../../src/ai/more-files/stories/more-files.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB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S,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { MoreFiles } from '@neo4j-ndl/react/ai';\nimport {\n DocumentIconOutline,\n PhotoIconOutline,\n TableCellsIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { Menu } from '@neo4j-ndl/react/menu';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n\n return (\n <>\n <MoreFiles\n count={4}\n isActive={isMenuOpen}\n onClick={() => setIsMenuOpen(!isMenuOpen)}\n ref={anchorRef}\n />\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<DocumentIconOutline />}\n title=\"Science fiction bestseller\"\n description=\"PDF\"\n onClick={() => alert('Science fiction bestseller')}\n />\n <Menu.Item\n leadingVisual={<TableCellsIconOutline />}\n title=\"MoviesDecade\"\n description=\"CSV\"\n onClick={() => alert('MoviesDecade')}\n />\n <Menu.Item\n leadingVisual={<PhotoIconOutline />}\n title=\"Family photo\"\n description=\"JPG\"\n onClick={() => alert('Family photos')}\n />\n </Menu.Items>\n </Menu>\n </>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"more-files.story.js","sourceRoot":"","sources":["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C,IAAI,CAAC,IAAI,IACR,aAAa,EAAE,KAAC,gBAAgB,KAAG,EACnC,KAAK,EAAC,cAAc,EACpB,WAAW,EAAC,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,GACrC,IACS,GACR,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Menu } from '@neo4j-ndl/react';\nimport { MoreFiles } from '@neo4j-ndl/react/ai';\nimport {\n DocumentIconOutline,\n PhotoIconOutline,\n TableCellsIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst Component = () => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n\n return (\n <>\n <MoreFiles\n count={4}\n isActive={isMenuOpen}\n onClick={() => setIsMenuOpen(!isMenuOpen)}\n ref={anchorRef}\n />\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n >\n <Menu.Items>\n <Menu.Item\n leadingVisual={<DocumentIconOutline />}\n title=\"Science fiction bestseller\"\n description=\"PDF\"\n onClick={() => alert('Science fiction bestseller')}\n />\n <Menu.Item\n leadingVisual={<TableCellsIconOutline />}\n title=\"MoviesDecade\"\n description=\"CSV\"\n onClick={() => alert('MoviesDecade')}\n />\n <Menu.Item\n leadingVisual={<PhotoIconOutline />}\n title=\"Family photo\"\n description=\"JPG\"\n onClick={() => alert('Family photos')}\n />\n </Menu.Items>\n </Menu>\n </>\n );\n};\n\nexport default Component;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../../../src/ai/presence/Presence.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAAM,QAAQ,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EAChB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,cAAc,EACd,GAAG,OAE+B,EAD/B,SAAS,cANI,6DAOjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,cAAc,EAAE,UAAU,KAAK,IAAI;KACpC,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IAEnC,MAAM,SAAS,GACb,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAEnE,OAAO,CACL,KAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,CAAC,UAAU,KAAK,IAAI,IAAI;QAC1B,YAAY,EAAE,UAAU;QACxB,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;KACf,CAAC,EACE,SAAS,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useNeedleTheme } from '@neo4j-ndl/react';\nimport type { CommonProps } from '@neo4j-ndl/react/_common/types';\nimport {\n Neo4JAiColorDarkIcon,\n Neo4JAiColorLightIcon,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\ntype PresenceProps = {\n /** Whether the AI is thinking. Animates the underlying SVG */\n isThinking?: boolean;\n};\n\nconst Presence = ({\n className,\n isThinking = false,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'svg', PresenceProps>) => {\n const classes = classNames('ndl-ai-presence', className, {\n 'ndl-thinking': isThinking === true,\n });\n const { theme } = useNeedleTheme();\n\n const Component =\n theme === 'light' ? Neo4JAiColorLightIcon : Neo4JAiColorDarkIcon;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...(isThinking === true && {\n 'aria-label': 'Thinking',\n 'aria-live': 'polite',\n role: 'status',\n })}\n {...restProps}\n />\n );\n};\n\nPresence.displayName = 'Presence';\n\nexport { Presence };\n"]}
1
+ {"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../../../src/ai/presence/Presence.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AASpC,MAAM,QAAQ,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EAChB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,cAAc,EACd,GAAG,OAE+B,EAD/B,SAAS,cANI,6DAOjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,cAAc,EAAE,UAAU,KAAK,IAAI;KACpC,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IAEnC,MAAM,SAAS,GACb,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAEnE,OAAO,CACL,KAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,CAAC,UAAU,KAAK,IAAI,IAAI;QAC1B,YAAY,EAAE,UAAU;QACxB,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;KACf,CAAC,EACE,SAAS,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useNeedleTheme } from '@neo4j-ndl/react';\nimport {\n Neo4JAiColorDarkIcon,\n Neo4JAiColorLightIcon,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\nimport type { CommonProps } from '../../_common/types';\n\ntype PresenceProps = {\n /** Whether the AI is thinking. Animates the underlying SVG */\n isThinking?: boolean;\n};\n\nconst Presence = ({\n className,\n isThinking = false,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'svg', PresenceProps>) => {\n const classes = classNames('ndl-ai-presence', className, {\n 'ndl-thinking': isThinking === true,\n });\n const { theme } = useNeedleTheme();\n\n const Component =\n theme === 'light' ? Neo4JAiColorLightIcon : Neo4JAiColorDarkIcon;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...(isThinking === true && {\n 'aria-label': 'Thinking',\n 'aria-live': 'polite',\n role: 'status',\n })}\n {...restProps}\n />\n );\n};\n\nPresence.displayName = 'Presence';\n\nexport { Presence };\n"]}
@@ -20,7 +20,7 @@
20
20
  */
21
21
  export { default as PresenceDefault } from './ai-presence-default.story';
22
22
  export { default as PresenceThinking } from './ai-presence-thinking.story';
23
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
23
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
24
24
  import PresenceDefaultSrcRaw from './ai-presence-default.story?raw';
25
25
  import PresenceThinkingSrcRaw from './ai-presence-thinking.story?raw';
26
26
  export const PresenceDefaultSrc = removeLicenseHeader(PresenceDefaultSrcRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as PresenceDefault } from './ai-presence-default.story';\nexport { default as PresenceThinking } from './ai-presence-thinking.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport PresenceDefaultSrcRaw from './ai-presence-default.story?raw';\nimport PresenceThinkingSrcRaw from './ai-presence-thinking.story?raw';\n\nexport const PresenceDefaultSrc = removeLicenseHeader(PresenceDefaultSrcRaw);\nexport const PresenceThinkingSrc = removeLicenseHeader(PresenceThinkingSrcRaw);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as PresenceDefault } from './ai-presence-default.story';\nexport { default as PresenceThinking } from './ai-presence-thinking.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport PresenceDefaultSrcRaw from './ai-presence-default.story?raw';\nimport PresenceThinkingSrcRaw from './ai-presence-thinking.story?raw';\n\nexport const PresenceDefaultSrc = removeLicenseHeader(PresenceDefaultSrcRaw);\nexport const PresenceThinkingSrc = removeLicenseHeader(PresenceThinkingSrcRaw);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Prompt.js","sourceRoot":"","sources":["../../../../src/ai/prompt/Prompt.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EACd,IAAI,EACJ,UAAU,GACX,MAA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AC;QACnB,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,cAAc,IACb,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAC3C,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,SAAS,YAEb,YAAY,GACE,EACjB,KAAC,IAAI,IACH,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAC,wBAAwB,YAElC,KAAC,IAAI,CAAC,KAAK,cACR,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,IAAI,CAAC,IAAI,IAER,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EACtC,aAAa,EACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,IAAI,IAJxD,MAAM,CAAC,KAAK,CAMjB,CACH,CAAC,GACS,GACR,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n CleanIconButton,\n DropdownButton,\n Menu,\n Typography,\n} from '@neo4j-ndl/react';\nimport type {\n CommonProps,\n HtmlAttributes,\n} from '@neo4j-ndl/react/_common/types';\nimport {\n ArrowSmallUpIconOutline,\n CheckIconOutline,\n StopCircleIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\ntype PromptProps = {\n /** The prompt text */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n /** Callback function called when the prompt text changes */\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /** Whether the submit button is disabled */\n isSubmitDisabled?: boolean;\n /** Maximum number of rows the textarea can expand to */\n maxRows?: number;\n /** Whether the submit button is \"running\". Shows a stop icon when true. */\n isRunningPrompt?: boolean;\n /** Callback function called when the submit button is clicked */\n onSubmitPrompt?: (\n e:\n | React.KeyboardEvent<HTMLTextAreaElement>\n | React.MouseEvent<HTMLButtonElement, MouseEvent>,\n ) => void;\n /** Content to display above the textarea */\n topContent?: React.ReactNode;\n /** Content to display below the textarea */\n bottomContent?: React.ReactNode;\n /** Disclaimer to display below the component */\n disclaimer?: React.ReactNode;\n /** Props for the textarea element */\n textareaProps?: HtmlAttributes<'textarea'>;\n};\n\n/**\n * The component is used to display the prompt input for an LLM.\n * It includes a textarea for the user to enter their prompt and a submit button.\n * It can also display content above and below the textarea, like uploaded files or a select for changing agents.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PromptComponent = ({\n value,\n onChange,\n maxRows = 5,\n isRunningPrompt = false,\n onSubmitPrompt,\n isSubmitDisabled = false,\n topContent,\n bottomContent,\n disclaimer = 'All information should be verified.',\n className,\n style,\n htmlAttributes,\n ref,\n textareaProps,\n ...restProps\n}: CommonProps<'div', PromptProps>) => {\n const classes = classNames('ndl-ai-prompt', className);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const textareaAboveRef = useRef<HTMLDivElement>(null);\n const [lineHeight, setLineHeight] = useState(0);\n\n /** File overflow stuff */\n useEffect(() => {\n let rafId: number | null = null;\n\n const checkOverflow = () => {\n if (textareaAboveRef.current !== null) {\n const element = textareaAboveRef.current;\n const maxHeight = parseFloat(\n getComputedStyle(element).maxHeight.replace('px', ''),\n );\n const scrollHeight = element.scrollHeight;\n\n if (scrollHeight > maxHeight) {\n element.classList.add('ndl-can-scroll');\n } else {\n element.classList.remove('ndl-can-scroll');\n }\n }\n };\n\n const debouncedCheck = () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n rafId = requestAnimationFrame(checkOverflow);\n };\n\n // Initial check\n checkOverflow();\n\n const resizeObserver = new ResizeObserver(debouncedCheck);\n const mutationObserver = new MutationObserver(debouncedCheck);\n\n if (textareaAboveRef.current !== null) {\n resizeObserver.observe(textareaAboveRef.current);\n mutationObserver.observe(textareaAboveRef.current, {\n childList: true,\n subtree: true,\n });\n }\n\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, []);\n\n /** Textarea stuff */\n useEffect(() => {\n if (textareaRef.current !== null) {\n const computed = window.getComputedStyle(textareaRef.current);\n setLineHeight(parseInt(computed.lineHeight));\n }\n }, []);\n\n const adjustTextareaHeight = useCallback(() => {\n const ta = textareaRef.current;\n\n if (ta !== null && lineHeight > 0) {\n // Reset height so scrollHeight measures correctly\n ta.style.height = 'auto';\n\n const maxHeight = lineHeight * maxRows;\n\n if (ta.scrollHeight <= maxHeight) {\n ta.style.overflowY = 'hidden';\n ta.style.height = `${ta.scrollHeight}px`;\n } else {\n ta.style.overflowY = 'auto';\n ta.style.height = `${maxHeight}px`;\n }\n }\n }, [lineHeight, maxRows]);\n\n // Adjust height when prompt value changes (including when cleared)\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight]);\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n adjustTextareaHeight();\n onChange?.(e);\n };\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-prompt-wrapper\">\n <div className=\"ndl-ai-prompt-wrapper-inner\">\n {Boolean(topContent) && (\n <div\n className=\"ndl-ai-prompt-textarea-above\"\n ref={textareaAboveRef}\n >\n {topContent}\n </div>\n )}\n <textarea\n placeholder=\"Ask anything\"\n className=\"ndl-ai-prompt-textarea\"\n rows={1}\n onChange={handleInput}\n value={value}\n ref={textareaRef}\n onKeyDown={(e) => {\n if (\n e.key === 'Enter' &&\n !e.shiftKey &&\n isSubmitDisabled !== true\n ) {\n e.preventDefault();\n onSubmitPrompt?.(e);\n }\n }}\n {...textareaProps}\n />\n <div className=\"ndl-ai-prompt-textarea-below\">\n {Boolean(bottomContent) && (\n <div className=\"ndl-ai-prompt-textarea-below-leading\">\n {bottomContent}\n </div>\n )}\n <SumbitPromptButton\n isDisabled={isSubmitDisabled}\n isRunningPrompt={isRunningPrompt}\n onClick={onSubmitPrompt}\n />\n </div>\n </div>\n </div>\n {Boolean(disclaimer) && (\n <Typography variant=\"body-small\" className=\"ndl-ai-prompt-footer\">\n {disclaimer}\n </Typography>\n )}\n </div>\n );\n};\n\nconst SumbitPromptButton = ({\n onClick,\n isDisabled,\n isRunningPrompt,\n}: {\n isDisabled?: boolean;\n isRunningPrompt?: boolean;\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n}) => {\n const description = isRunningPrompt === true ? 'Cancel' : 'Send';\n\n return (\n <CleanIconButton\n className=\"ndl-ai-prompt-submit-button\"\n description={description}\n size=\"medium\"\n onClick={onClick}\n isDisabled={isDisabled}\n >\n <ArrowSmallUpIconOutline\n style={{\n opacity: isRunningPrompt === true ? 0 : 1,\n position: isRunningPrompt === true ? 'absolute' : 'relative',\n transform:\n isRunningPrompt === true ? 'translateY(-8px)' : 'translateY(0)',\n }}\n />\n <StopCircleIconOutline\n style={{\n opacity: isRunningPrompt === true ? 1 : 0,\n position: isRunningPrompt === true ? 'relative' : 'absolute',\n }}\n />\n </CleanIconButton>\n );\n};\n\ntype AgentSelectProps = {\n value: { label: React.ReactNode; value: string };\n options: Array<{ label: React.ReactNode; value: string }>;\n onChange: (option: { label: React.ReactNode; value: string }) => void;\n};\n\nconst AgentSelect = ({ value, options = [], onChange }: AgentSelectProps) => {\n const anchorRef = useRef<HTMLButtonElement>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const displayLabel = value?.label ?? options[0]?.label ?? '';\n\n const handleItemClick = (option: {\n label: React.ReactNode;\n value: string;\n }) => {\n onChange?.(option);\n setIsMenuOpen(false);\n };\n\n return (\n <>\n <DropdownButton\n size=\"small\"\n className=\"ndl-ai-prompt-dropdown-button\"\n onClick={() => setIsMenuOpen((old) => !old)}\n isOpen={isMenuOpen}\n ref={anchorRef}\n >\n {displayLabel}\n </DropdownButton>\n <Menu\n isOpen={isMenuOpen}\n onClose={() => setIsMenuOpen(false)}\n anchorRef={anchorRef}\n placement=\"top-start-bottom-start\"\n >\n <Menu.Items>\n {options.map((option) => (\n <Menu.Item\n key={option.value}\n title={option.label}\n onClick={() => handleItemClick(option)}\n leadingVisual={\n value?.value === option.value ? <CheckIconOutline /> : null\n }\n />\n ))}\n </Menu.Items>\n </Menu>\n </>\n );\n};\n\nconst Prompt = Object.assign(PromptComponent, {\n Select: AgentSelect,\n});\n\nexport { Prompt };\n"]}
1
+ {"version":3,"file":"Prompt.js","sourceRoot":"","sources":["../../../../src/ai/prompt/Prompt.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,cAA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BAAR,QAAQ,CAAG,MAAM,CAAC,CAAC;QACnB,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,cAAc,IACb,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAC3C,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,SAAS,YAEb,YAAY,GACE,EACjB,KAAC,IAAI,IACH,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAC,wBAAwB,YAElC,KAAC,IAAI,CAAC,KAAK,cACR,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,IAAI,CAAC,IAAI,IAER,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EACtC,aAAa,EACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,IAAI,IAJxD,MAAM,CAAC,KAAK,CAMjB,CACH,CAAC,GACS,GACR,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n CleanIconButton,\n DropdownButton,\n Menu,\n Typography,\n} from '@neo4j-ndl/react';\nimport {\n ArrowSmallUpIconOutline,\n CheckIconOutline,\n StopCircleIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { CommonProps, HtmlAttributes } from '../../_common/types';\n\ntype PromptProps = {\n /** The prompt text */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n /** Callback function called when the prompt text changes */\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /** Whether the submit button is disabled */\n isSubmitDisabled?: boolean;\n /** Maximum number of rows the textarea can expand to */\n maxRows?: number;\n /** Whether the submit button is \"running\". Shows a stop icon when true. */\n isRunningPrompt?: boolean;\n /** Callback function called when the submit button is clicked */\n onSubmitPrompt?: (\n e:\n | React.KeyboardEvent<HTMLTextAreaElement>\n | React.MouseEvent<HTMLButtonElement, MouseEvent>,\n ) => void;\n /** Content to display above the textarea */\n topContent?: React.ReactNode;\n /** Content to display below the textarea */\n bottomContent?: React.ReactNode;\n /** Disclaimer to display below the component */\n disclaimer?: React.ReactNode;\n /** Props for the textarea element */\n textareaProps?: HtmlAttributes<'textarea'>;\n};\n\n/**\n * The component is used to display the prompt input for an LLM.\n * It includes a textarea for the user to enter their prompt and a submit button.\n * It can also display content above and below the textarea, like uploaded files or a select for changing agents.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PromptComponent = ({\n value,\n onChange,\n maxRows = 5,\n isRunningPrompt = false,\n onSubmitPrompt,\n isSubmitDisabled = false,\n topContent,\n bottomContent,\n disclaimer = 'All information should be verified.',\n className,\n style,\n htmlAttributes,\n ref,\n textareaProps,\n ...restProps\n}: CommonProps<'div', PromptProps>) => {\n const classes = classNames('ndl-ai-prompt', className);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const textareaAboveRef = useRef<HTMLDivElement>(null);\n const [lineHeight, setLineHeight] = useState(0);\n\n /** File overflow stuff */\n useEffect(() => {\n let rafId: number | null = null;\n\n const checkOverflow = () => {\n if (textareaAboveRef.current !== null) {\n const element = textareaAboveRef.current;\n const maxHeight = parseFloat(\n getComputedStyle(element).maxHeight.replace('px', ''),\n );\n const scrollHeight = element.scrollHeight;\n\n if (scrollHeight > maxHeight) {\n element.classList.add('ndl-can-scroll');\n } else {\n element.classList.remove('ndl-can-scroll');\n }\n }\n };\n\n const debouncedCheck = () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n rafId = requestAnimationFrame(checkOverflow);\n };\n\n // Initial check\n checkOverflow();\n\n const resizeObserver = new ResizeObserver(debouncedCheck);\n const mutationObserver = new MutationObserver(debouncedCheck);\n\n if (textareaAboveRef.current !== null) {\n resizeObserver.observe(textareaAboveRef.current);\n mutationObserver.observe(textareaAboveRef.current, {\n childList: true,\n subtree: true,\n });\n }\n\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, []);\n\n /** Textarea stuff */\n useEffect(() => {\n if (textareaRef.current !== null) {\n const computed = window.getComputedStyle(textareaRef.current);\n setLineHeight(parseInt(computed.lineHeight));\n }\n }, []);\n\n const adjustTextareaHeight = useCallback(() => {\n const ta = textareaRef.current;\n\n if (ta !== null && lineHeight > 0) {\n // Reset height so scrollHeight measures correctly\n ta.style.height = 'auto';\n\n const maxHeight = lineHeight * maxRows;\n\n if (ta.scrollHeight <= maxHeight) {\n ta.style.overflowY = 'hidden';\n ta.style.height = `${ta.scrollHeight}px`;\n } else {\n ta.style.overflowY = 'auto';\n ta.style.height = `${maxHeight}px`;\n }\n }\n }, [lineHeight, maxRows]);\n\n // Adjust height when prompt value changes (including when cleared)\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight]);\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n adjustTextareaHeight();\n onChange?.(e);\n };\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-prompt-wrapper\">\n <div className=\"ndl-ai-prompt-wrapper-inner\">\n {Boolean(topContent) && (\n <div\n className=\"ndl-ai-prompt-textarea-above\"\n ref={textareaAboveRef}\n >\n {topContent}\n </div>\n )}\n <textarea\n placeholder=\"Ask anything\"\n className=\"ndl-ai-prompt-textarea\"\n rows={1}\n onChange={handleInput}\n value={value}\n ref={textareaRef}\n onKeyDown={(e) => {\n if (\n e.key === 'Enter' &&\n !e.shiftKey &&\n isSubmitDisabled !== true\n ) {\n e.preventDefault();\n onSubmitPrompt?.(e);\n }\n }}\n {...textareaProps}\n />\n <div className=\"ndl-ai-prompt-textarea-below\">\n {Boolean(bottomContent) && (\n <div className=\"ndl-ai-prompt-textarea-below-leading\">\n {bottomContent}\n </div>\n )}\n <SumbitPromptButton\n isDisabled={isSubmitDisabled}\n isRunningPrompt={isRunningPrompt}\n onClick={onSubmitPrompt}\n />\n </div>\n </div>\n </div>\n {Boolean(disclaimer) && (\n <Typography variant=\"body-small\" className=\"ndl-ai-prompt-footer\">\n {disclaimer}\n </Typography>\n )}\n </div>\n );\n};\n\nconst SumbitPromptButton = ({\n onClick,\n isDisabled,\n isRunningPrompt,\n}: {\n isDisabled?: boolean;\n isRunningPrompt?: boolean;\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n}) => {\n const description = isRunningPrompt === true ? 'Cancel' : 'Send';\n\n return (\n <CleanIconButton\n className=\"ndl-ai-prompt-submit-button\"\n description={description}\n size=\"medium\"\n onClick={onClick}\n isDisabled={isDisabled}\n >\n <ArrowSmallUpIconOutline\n style={{\n opacity: isRunningPrompt === true ? 0 : 1,\n position: isRunningPrompt === true ? 'absolute' : 'relative',\n transform:\n isRunningPrompt === true ? 'translateY(-8px)' : 'translateY(0)',\n }}\n />\n <StopCircleIconOutline\n style={{\n opacity: isRunningPrompt === true ? 1 : 0,\n position: isRunningPrompt === true ? 'relative' : 'absolute',\n }}\n />\n </CleanIconButton>\n );\n};\n\ntype AgentSelectProps = {\n value: { label: React.ReactNode; value: string };\n options: Array<{ label: React.ReactNode; value: string }>;\n onChange: (option: { label: React.ReactNode; value: string }) => void;\n};\n\nconst AgentSelect = ({ value, options = [], onChange }: AgentSelectProps) => {\n const anchorRef = useRef<HTMLButtonElement>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n const displayLabel = value?.label ?? options[0]?.label ?? '';\n\n const handleItemClick = (option: {\n label: React.ReactNode;\n value: string;\n }) => {\n onChange?.(option);\n setIsMenuOpen(false);\n };\n\n return (\n <>\n <DropdownButton\n size=\"small\"\n className=\"ndl-ai-prompt-dropdown-button\"\n onClick={() => setIsMenuOpen((old) => !old)}\n isOpen={isMenuOpen}\n ref={anchorRef}\n >\n {displayLabel}\n </DropdownButton>\n <Menu\n isOpen={isMenuOpen}\n onClose={() => setIsMenuOpen(false)}\n anchorRef={anchorRef}\n placement=\"top-start-bottom-start\"\n >\n <Menu.Items>\n {options.map((option) => (\n <Menu.Item\n key={option.value}\n title={option.label}\n onClick={() => handleItemClick(option)}\n leadingVisual={\n value?.value === option.value ? <CheckIconOutline /> : null\n }\n />\n ))}\n </Menu.Items>\n </Menu>\n </>\n );\n};\n\nconst Prompt = Object.assign(PromptComponent, {\n Select: AgentSelect,\n});\n\nexport { Prompt };\n"]}
@@ -20,7 +20,7 @@
20
20
  */
21
21
  export { default as PromptDefault } from './prompt-default.story';
22
22
  export { default as PromptAdvanced } from './prompt-advanced.story';
23
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
23
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
24
24
  import PromptAdvancedSrcRaw from './prompt-advanced.story?raw';
25
25
  import PromptDefaultSrcRaw from './prompt-default.story?raw';
26
26
  export const PromptDefaultSrc = removeLicenseHeader(PromptDefaultSrcRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as PromptDefault } from './prompt-default.story';\nexport { default as PromptAdvanced } from './prompt-advanced.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport PromptAdvancedSrcRaw from './prompt-advanced.story?raw';\nimport PromptDefaultSrcRaw from './prompt-default.story?raw';\n\nexport const PromptDefaultSrc = removeLicenseHeader(PromptDefaultSrcRaw);\nexport const PromptAdvancedSrc = removeLicenseHeader(PromptAdvancedSrcRaw);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as PromptDefault } from './prompt-default.story';\nexport { default as PromptAdvanced } from './prompt-advanced.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport PromptAdvancedSrcRaw from './prompt-advanced.story?raw';\nimport PromptDefaultSrcRaw from './prompt-default.story?raw';\n\nexport const PromptDefaultSrc = removeLicenseHeader(PromptDefaultSrcRaw);\nexport const PromptAdvancedSrc = removeLicenseHeader(PromptAdvancedSrcRaw);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Reasoning.js","sourceRoot":"","sources":["../../../../src/ai/reasoning/Reasoning.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAajF;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,EAUS,EAAE,EAAE;QAVb,EAC1B,UAAU,GAAG,IAAI,EACjB,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,UAAU,EAC1B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEgC,EADhC,SAAS,cATc,wGAU3B,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,kBAAkB,GAAG,UAAU,IAAI,UAAU,KAAK,KAAK,CAAC;IAE9D,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc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D,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAElB,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cAAK,SAAS,EAAC,kCAAkC,YAAE,aAAa,GAAO,EACvE,KAAC,UAAU,IAAC,OAAO,EAAC,kBAAkB,YAAE,OAAO,GAAc,EAC7D,KAAC,eAAe,IACd,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAC/C,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,SAAS,EACjB,SAAS,EAAE,UAAU,CAAC,gCAAgC,EAAE;4BACtD,cAAc,EAAE,UAAU;yBAC3B,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,YAEzC,KAAC,sBAAsB,KAAG,GACV,IACd,EACN,cACE,SAAS,EAAE,UAAU,CAAC,kCAAkC,EAAE;oBACxD,cAAc,EAAE,UAAU;iBAC3B,CAAC,EACF,KAAK,EAAE,CAAC,UAAU,YAElB,cAAK,SAAS,EAAC,wCAAwC,YACrD,eAAK,SAAS,EAAC,0CAA0C,aACvD,cAAK,SAAS,EAAC,iDAAiD,YAC9D,cAAK,SAAS,EAAC,uCAAuC,GAAG,GACrD,EACN,cAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,IACF,GACF,GACF,KACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,OAAO;CACR,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport { ChevronDownIconOutline } from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\nimport { useState } from 'react';\n\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from '../thinking/thinking-duration-formatter';\n\ntype ReasoningProps = {\n /** What should be displayed inside the reasoning component. */\n children?: React.ReactNode;\n /** Whether the AI is thinking */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n /** The current action the AI is performing */\n currentAction?: string;\n};\n\n/**\n * The component is used to display the reasoning state of an LLM.\n * It has an accordion like behavior to show the reasoning steps.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ReasoningComponent = ({\n isThinking = true,\n thinkingMs = 1000,\n currentAction = 'Thinking',\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ReasoningProps>) => {\n const classes = classNames('ndl-ai-reasoning', className);\n const [isExpanded, setIsExpanded] = useState(false);\n const shouldShowChildren = isExpanded && isThinking === false;\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography variant=\"label\" className=\"ndl-ai-reasoning-header\">\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-24\" />\n <span className=\"ndl-ai-reasoning-header-text\">\n {currentAction}...\n </span>\n </>\n ) : (\n <>\n <span>\n Thought for {thinkingDuration} {unit}\n </span>\n <CleanIconButton\n size=\"small\"\n variant=\"neutral\"\n onClick={() => setIsExpanded(!isExpanded)}\n description={isExpanded ? 'Collapse' : 'Expand'}\n className={classNames('ndl-ai-reasoning-expand-button', {\n 'ndl-expanded': isExpanded,\n })}\n >\n <ChevronDownIconOutline />\n </CleanIconButton>\n </>\n )}\n </Typography>\n <div\n className={classNames('ndl-ai-reasoning-content', {\n 'ndl-expanded': shouldShowChildren,\n })}\n inert={!shouldShowChildren}\n >\n <div className=\"ndl-ai-reasoning-content-inner\">\n <div className=\"ndl-ai-reasoning-content-inner-2\">{children}</div>\n </div>\n </div>\n </div>\n );\n};\n\ntype SectionProps = {\n /** The heading of the section */\n heading?: React.ReactNode;\n /** The children of the section */\n children?: React.ReactNode;\n /** The visual leading the section */\n leadingVisual?: React.ReactNode;\n};\n\nconst Section = ({\n heading,\n leadingVisual,\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', SectionProps>) => {\n const classes = classNames('ndl-ai-reasoning-section', className);\n const [isExpanded, setIsExpanded] = useState(false);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-reasoning-section-header\">\n <div className=\"ndl-ai-reasoning-section-leading\">{leadingVisual}</div>\n <Typography variant=\"subheading-small\">{heading}</Typography>\n <CleanIconButton\n description={isExpanded ? 'Collapse' : 'Expand'}\n size=\"small\"\n variant=\"neutral\"\n className={classNames('ndl-ai-reasoning-expand-button', {\n 'ndl-expanded': isExpanded,\n })}\n onClick={() => setIsExpanded(!isExpanded)}\n >\n <ChevronDownIconOutline />\n </CleanIconButton>\n </div>\n <div\n className={classNames('ndl-ai-reasoning-section-content', {\n 'ndl-expanded': isExpanded,\n })}\n inert={!isExpanded}\n >\n <div className=\"ndl-ai-reasoning-section-content-inner\">\n <div className=\"ndl-ai-reasoning-section-content-inner-2\">\n <div className=\"ndl-ai-reasoning-section-content-line-container\">\n <div className=\"ndl-ai-reasoning-section-content-line\" />\n </div>\n <div className=\"ndl-ai-reasoning-section-content-children\">\n {children}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nconst Reasoning = Object.assign(ReasoningComponent, {\n Section,\n});\n\nexport { Reasoning };\n"]}
1
+ {"version":3,"file":"Reasoning.js","sourceRoot":"","sources":["../../../../src/ai/reasoning/Reasoning.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAajF;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,EAUS,EAAE,EAAE;QAVb,EAC1B,UAAU,GAAG,IAAI,EACjB,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,UAAU,EAC1B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEgC,EADhC,SAAS,cATc,wGAU3B,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,kBAAkB,GAAG,UAAU,IAAI,UAAU,KAAK,KAAK,CAAC;IAE9D,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAElB,K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CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAElB,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cAAK,SAAS,EAAC,kCAAkC,YAAE,aAAa,GAAO,EACvE,KAAC,UAAU,IAAC,OAAO,EAAC,kBAAkB,YAAE,OAAO,GAAc,EAC7D,KAAC,eAAe,IACd,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAC/C,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,SAAS,EACjB,SAAS,EAAE,UAAU,CAAC,gCAAgC,EAAE;4BACtD,cAAc,EAAE,UAAU;yBAC3B,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,YAEzC,KAAC,sBAAsB,KAAG,GACV,IACd,EACN,cACE,SAAS,EAAE,UAAU,CAAC,kCAAkC,EAAE;oBACxD,cAAc,EAAE,UAAU;iBAC3B,CAAC,EACF,KAAK,EAAE,CAAC,UAAU,YAElB,cAAK,SAAS,EAAC,wCAAwC,YACrD,eAAK,SAAS,EAAC,0CAA0C,aACvD,cAAK,SAAS,EAAC,iDAAiD,YAC9D,cAAK,SAAS,EAAC,uCAAuC,GAAG,GACrD,EACN,cAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,IACF,GACF,GACF,KACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,OAAO;CACR,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { CleanIconButton, Typography } from '@neo4j-ndl/react';\nimport { ChevronDownIconOutline } from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\nimport { useState } from 'react';\n\nimport { type CommonProps } from '../../_common/types';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from '../thinking/thinking-duration-formatter';\n\ntype ReasoningProps = {\n /** What should be displayed inside the reasoning component. */\n children?: React.ReactNode;\n /** Whether the AI is thinking */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n /** The current action the AI is performing */\n currentAction?: string;\n};\n\n/**\n * The component is used to display the reasoning state of an LLM.\n * It has an accordion like behavior to show the reasoning steps.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ReasoningComponent = ({\n isThinking = true,\n thinkingMs = 1000,\n currentAction = 'Thinking',\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ReasoningProps>) => {\n const classes = classNames('ndl-ai-reasoning', className);\n const [isExpanded, setIsExpanded] = useState(false);\n const shouldShowChildren = isExpanded && isThinking === false;\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography variant=\"label\" className=\"ndl-ai-reasoning-header\">\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-24\" />\n <span className=\"ndl-ai-reasoning-header-text\">\n {currentAction}...\n </span>\n </>\n ) : (\n <>\n <span>\n Thought for {thinkingDuration} {unit}\n </span>\n <CleanIconButton\n size=\"small\"\n variant=\"neutral\"\n onClick={() => setIsExpanded(!isExpanded)}\n description={isExpanded ? 'Collapse' : 'Expand'}\n className={classNames('ndl-ai-reasoning-expand-button', {\n 'ndl-expanded': isExpanded,\n })}\n >\n <ChevronDownIconOutline />\n </CleanIconButton>\n </>\n )}\n </Typography>\n <div\n className={classNames('ndl-ai-reasoning-content', {\n 'ndl-expanded': shouldShowChildren,\n })}\n inert={!shouldShowChildren}\n >\n <div className=\"ndl-ai-reasoning-content-inner\">\n <div className=\"ndl-ai-reasoning-content-inner-2\">{children}</div>\n </div>\n </div>\n </div>\n );\n};\n\ntype SectionProps = {\n /** The heading of the section */\n heading?: React.ReactNode;\n /** The children of the section */\n children?: React.ReactNode;\n /** The visual leading the section */\n leadingVisual?: React.ReactNode;\n};\n\nconst Section = ({\n heading,\n leadingVisual,\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', SectionProps>) => {\n const classes = classNames('ndl-ai-reasoning-section', className);\n const [isExpanded, setIsExpanded] = useState(false);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-reasoning-section-header\">\n <div className=\"ndl-ai-reasoning-section-leading\">{leadingVisual}</div>\n <Typography variant=\"subheading-small\">{heading}</Typography>\n <CleanIconButton\n description={isExpanded ? 'Collapse' : 'Expand'}\n size=\"small\"\n variant=\"neutral\"\n className={classNames('ndl-ai-reasoning-expand-button', {\n 'ndl-expanded': isExpanded,\n })}\n onClick={() => setIsExpanded(!isExpanded)}\n >\n <ChevronDownIconOutline />\n </CleanIconButton>\n </div>\n <div\n className={classNames('ndl-ai-reasoning-section-content', {\n 'ndl-expanded': isExpanded,\n })}\n inert={!isExpanded}\n >\n <div className=\"ndl-ai-reasoning-section-content-inner\">\n <div className=\"ndl-ai-reasoning-section-content-inner-2\">\n <div className=\"ndl-ai-reasoning-section-content-line-container\">\n <div className=\"ndl-ai-reasoning-section-content-line\" />\n </div>\n <div className=\"ndl-ai-reasoning-section-content-children\">\n {children}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nconst Reasoning = Object.assign(ReasoningComponent, {\n Section,\n});\n\nexport { Reasoning };\n"]}
@@ -19,7 +19,7 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
  export { default as ReasoningFull } from './reasoning-full.story';
22
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
22
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
23
23
  import ReasoningFullSrcRaw from './reasoning-full.story?raw';
24
24
  export const ReasoningFullSrc = removeLicenseHeader(ReasoningFullSrcRaw);
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/reasoning/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ReasoningFull } from './reasoning-full.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport ReasoningFullSrcRaw from './reasoning-full.story?raw';\n\nexport const ReasoningFullSrc = removeLicenseHeader(ReasoningFullSrcRaw);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/reasoning/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ReasoningFull } from './reasoning-full.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport ReasoningFullSrcRaw from './reasoning-full.story?raw';\n\nexport const ReasoningFullSrc = removeLicenseHeader(ReasoningFullSrcRaw);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,UAAU,MAAM,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,cAAK,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,YAAG,QAAQ,GAAO,CAAC;QACjE,CAAC;QACD,CAAC,EAAE,CAAC,EAAiC,EAAE,EAAE;gBAArC,EAAE,QAAQ,EAAE,SAAS,OAAY,EAAP,KAAK,cAA/B,yBAAiC,CAAF;YAAO,OAAA,CACxC,KAAC,UAAU,kBACT,EAAE,EAAC,GAAG,EACN,OAAO,EAAC,aAAa,EACrB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,IAC5B,KAAK,cAER,QAAQ,IACE,CACd,CAAA;SAAA;QACD,GAAG,EAAE,CAAC,EAAiC,EAAE,EAAE;gBAArC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAY,EAAP,KAAK,cAA/B,2BAAiC,CAAF;YAAO,OAAA,CAC1C,4BACE,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,EAChC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,IACJ,KAAK,EACT,CACH,CAAA;SAAA;KACF,CAAC,EACF,EAAE,CACH,CAAC;IAEJ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CACnB,wEAAwE,EACxE,SAAS,CACV,IACG,SAAS,EACT,cAAc,cAElB,KAAC,UAAU,IACT,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,IAAI,EAC7B,UAAU,EAAE,UAAU,YAErB,QAAQ,GACE,IACT,CACP,CAAC;AACJ,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CACpE,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Code, TextLink, Typography } from '@neo4j-ndl/react';\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport classNames from 'classnames';\nimport { memo, useMemo, useRef } from 'react';\nimport { Streamdown } from 'streamdown';\n\nimport { type LanguageProp, Languages } from '../../code-block/code-languages';\nimport { CodePreview } from '../code-preview';\n\ntype ResponseProps = {\n /** The response from the AI */\n children: string;\n /** Whether the response is animating */\n isAnimating?: React.ComponentProps<typeof Streamdown>['isAnimating'];\n};\n\n/**\n * The component is used to display the response from an LLM.\n * It handles markdown rendering and streaming.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Response = memo(\n ({\n className,\n children,\n isAnimating = false,\n ref,\n style,\n htmlAttributes,\n ...restProps\n }: CommonProps<'div', ResponseProps>) => {\n // Use a ref to store the current markdown content so we can check for unclosed fences\n // without recreating the components object on every render\n const childrenRef = useRef(children);\n childrenRef.current = children;\n\n const components: React.ComponentProps<typeof Streamdown>['components'] =\n useMemo(\n () => ({\n ol: ({ children, className, ...props }) => (\n <ol className={className} {...props}>\n {children}\n </ol>\n ),\n ul: ({ children, className, ...props }) => (\n <ul className={classNames(className)} {...props}>\n {children}\n </ul>\n ),\n li: ({ children, className, ...props }) => (\n <li className={className} {...props}>\n {children}\n </li>\n ),\n hr: ({ className, ...props }) => (\n <hr className={classNames(className)} {...props} />\n ),\n strong: ({ children, className, style, ...props }) => (\n <Typography\n as=\"strong\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontWeight: 'bold' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n em: ({ children, className, style, ...props }) => (\n <Typography\n as=\"em\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontStyle: 'italic' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n a: ({ children, className, href, ...props }) => (\n <TextLink\n type=\"internal-underline\"\n className={className}\n href={href}\n htmlAttributes={props}\n >\n {children}\n </TextLink>\n ),\n h1: ({ children, className, ...props }) => (\n <Typography\n as=\"h1\"\n variant=\"display\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h2: ({ children, className, ...props }) => (\n <Typography\n as=\"h2\"\n variant=\"title-1\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h3: ({ children, className, ...props }) => (\n <Typography\n as=\"h3\"\n variant=\"title-2\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h4: ({ children, className, ...props }) => (\n <Typography\n as=\"h4\"\n variant=\"title-3\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h5: ({ children, className, ...props }) => (\n <Typography\n as=\"h5\"\n variant=\"title-4\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h6: ({ children, className, ...props }) => (\n <Typography\n as=\"h6\"\n variant=\"subheading-large\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n table: ({ children, className, ...props }) => (\n <div className=\"my-4 overflow-x-auto\">\n <table\n className={classNames(\n 'w-full border-collapse border border-border',\n className,\n )}\n {...props}\n >\n {children}\n </table>\n </div>\n ),\n thead: ({ children, className, ...props }) => (\n <thead className={classNames('bg-muted/50', className)} {...props}>\n {children}\n </thead>\n ),\n tbody: ({ children, className, ...props }) => (\n <tbody\n className={classNames('divide-y divide-border', className)}\n {...props}\n >\n {children}\n </tbody>\n ),\n tr: ({ children, className, ...props }) => (\n <tr\n className={classNames('border-border border-b', className)}\n {...props}\n >\n {children}\n </tr>\n ),\n th: ({ children, className, ...props }) => (\n <th\n className={classNames(\n 'px-4 py-2 text-left font-semibold text-sm',\n className,\n )}\n {...props}\n >\n {children}\n </th>\n ),\n td: ({ children, className, ...props }) => (\n <td\n className={classNames('px-4 py-2 text-sm', className)}\n {...props}\n >\n {children}\n </td>\n ),\n blockquote: ({ children, className, ...props }) => (\n <blockquote className={classNames(className)} {...props}>\n {children}\n </blockquote>\n ),\n code: ({\n node,\n className,\n key,\n children: codeChildren,\n ...props\n }) => {\n const isInline =\n node?.position?.start.line === node?.position?.end.line;\n let language: LanguageProp | 'text' = 'javascript';\n if (typeof node?.properties?.className === 'string') {\n const rawLanguage = node.properties.className.replace(\n 'language-',\n '',\n );\n language = (Languages as readonly string[]).includes(rawLanguage)\n ? (rawLanguage as LanguageProp)\n : 'text';\n }\n if (isInline) {\n return (\n <Code\n isRunnable={false}\n className={className}\n htmlAttributes={props}\n >\n {codeChildren}\n </Code>\n );\n }\n if (typeof codeChildren === 'string') {\n // Check if code fences are balanced in the markdown\n // If there are an odd number of fences, it means there's an unclosed code block\n const fenceMatches = childrenRef.current.match(/```/g);\n const fenceCount = fenceMatches ? fenceMatches.length : 0;\n const hasUnclosedFence = fenceCount % 2 !== 0;\n\n // Show loading state when there's an unclosed fence (code block is streaming)\n const isCodeBlockLoading = hasUnclosedFence;\n return (\n <CodePreview\n key={key}\n code={codeChildren}\n isLoading={isCodeBlockLoading}\n language={language}\n className={className}\n htmlAttributes={{\n ...props,\n }}\n />\n );\n } else {\n return <code className={className}>{codeChildren}</code>;\n }\n },\n pre: ({ className, children }) => {\n return <pre className={classNames(className)}>{children}</pre>;\n },\n p: ({ children, className, ...props }) => (\n <Typography\n as=\"p\"\n variant=\"body-medium\"\n className={classNames(className)}\n {...props}\n >\n {children}\n </Typography>\n ),\n img: ({ className, src, alt, ...props }) => (\n <img\n className={classNames(className)}\n src={src}\n alt={alt}\n {...props}\n />\n ),\n }),\n [],\n );\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames(\n 'ndl-ai-response size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n className,\n )}\n {...restProps}\n {...htmlAttributes}\n >\n <Streamdown\n isAnimating={isAnimating}\n parseIncompleteMarkdown={true}\n components={components}\n >\n {children}\n </Streamdown>\n </div>\n );\n },\n (prevProps, nextProps) => prevProps.children === nextProps.children,\n);\n\nResponse.displayName = 'Response';\n\nexport { Response };\n"]}
1
+ {"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAqB,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAS9C;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,IAAI,CACnB,CAAC,EAQmC,EAAE,EAAE;QARvC,EACC,SAAS,EACT,QAAQ,EACR,WAAW,GAAG,KAAK,EACnB,GAAG,EACH,KAAK,EACL,cAAc,OAEoB,EAD/B,SAAS,cAPb,0EAQA,CADa;IAEZ,sFAAsF;IACtF,2DAA2D;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE/B,MAAM,UAAU,GACd,OAAO,CACL,GAAG,EAAE,CAAC,CAAC;QACL,EAAE,EAAE,CAAC,EAAiC,EAAE,EAAE;gBAArC,EAAE,QAAQ,EAAE,SAAS,OAAY,EAAP,KAAK,cAA/B,yBAAiC,CAAF;YAAO,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CACnB,wEAAwE,EACxE,SAAS,CACV,IACG,SAAS,EACT,cAAc,cAElB,KAAC,UAAU,IACT,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,IAAI,EAC7B,UAAU,EAAE,UAAU,YAErB,QAAQ,GACE,IACT,CACP,CAAC;AACJ,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CACpE,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Code, TextLink, Typography } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { memo, useMemo, useRef } from 'react';\nimport { Streamdown } from 'streamdown';\n\nimport { type CommonProps } from '../../_common/types';\nimport { type LanguageProp, Languages } from '../../code-block/code-languages';\nimport { CodePreview } from '../code-preview';\n\ntype ResponseProps = {\n /** The response from the AI */\n children: string;\n /** Whether the response is animating */\n isAnimating?: React.ComponentProps<typeof Streamdown>['isAnimating'];\n};\n\n/**\n * The component is used to display the response from an LLM.\n * It handles markdown rendering and streaming.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Response = memo(\n ({\n className,\n children,\n isAnimating = false,\n ref,\n style,\n htmlAttributes,\n ...restProps\n }: CommonProps<'div', ResponseProps>) => {\n // Use a ref to store the current markdown content so we can check for unclosed fences\n // without recreating the components object on every render\n const childrenRef = useRef(children);\n childrenRef.current = children;\n\n const components: React.ComponentProps<typeof Streamdown>['components'] =\n useMemo(\n () => ({\n ol: ({ children, className, ...props }) => (\n <ol className={className} {...props}>\n {children}\n </ol>\n ),\n ul: ({ children, className, ...props }) => (\n <ul className={classNames(className)} {...props}>\n {children}\n </ul>\n ),\n li: ({ children, className, ...props }) => (\n <li className={className} {...props}>\n {children}\n </li>\n ),\n hr: ({ className, ...props }) => (\n <hr className={classNames(className)} {...props} />\n ),\n strong: ({ children, className, style, ...props }) => (\n <Typography\n as=\"strong\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontWeight: 'bold' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n em: ({ children, className, style, ...props }) => (\n <Typography\n as=\"em\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontStyle: 'italic' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n a: ({ children, className, href, ...props }) => (\n <TextLink\n type=\"internal-underline\"\n className={className}\n href={href}\n htmlAttributes={props}\n >\n {children}\n </TextLink>\n ),\n h1: ({ children, className, ...props }) => (\n <Typography\n as=\"h1\"\n variant=\"display\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h2: ({ children, className, ...props }) => (\n <Typography\n as=\"h2\"\n variant=\"title-1\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h3: ({ children, className, ...props }) => (\n <Typography\n as=\"h3\"\n variant=\"title-2\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h4: ({ children, className, ...props }) => (\n <Typography\n as=\"h4\"\n variant=\"title-3\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h5: ({ children, className, ...props }) => (\n <Typography\n as=\"h5\"\n variant=\"title-4\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n h6: ({ children, className, ...props }) => (\n <Typography\n as=\"h6\"\n variant=\"subheading-large\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n table: ({ children, className, ...props }) => (\n <div className=\"my-4 overflow-x-auto\">\n <table\n className={classNames(\n 'w-full border-collapse border border-border',\n className,\n )}\n {...props}\n >\n {children}\n </table>\n </div>\n ),\n thead: ({ children, className, ...props }) => (\n <thead className={classNames('bg-muted/50', className)} {...props}>\n {children}\n </thead>\n ),\n tbody: ({ children, className, ...props }) => (\n <tbody\n className={classNames('divide-y divide-border', className)}\n {...props}\n >\n {children}\n </tbody>\n ),\n tr: ({ children, className, ...props }) => (\n <tr\n className={classNames('border-border border-b', className)}\n {...props}\n >\n {children}\n </tr>\n ),\n th: ({ children, className, ...props }) => (\n <th\n className={classNames(\n 'px-4 py-2 text-left font-semibold text-sm',\n className,\n )}\n {...props}\n >\n {children}\n </th>\n ),\n td: ({ children, className, ...props }) => (\n <td\n className={classNames('px-4 py-2 text-sm', className)}\n {...props}\n >\n {children}\n </td>\n ),\n blockquote: ({ children, className, ...props }) => (\n <blockquote className={classNames(className)} {...props}>\n {children}\n </blockquote>\n ),\n code: ({\n node,\n className,\n key,\n children: codeChildren,\n ...props\n }) => {\n const isInline =\n node?.position?.start.line === node?.position?.end.line;\n let language: LanguageProp | 'text' = 'javascript';\n if (typeof node?.properties?.className === 'string') {\n const rawLanguage = node.properties.className.replace(\n 'language-',\n '',\n );\n language = (Languages as readonly string[]).includes(rawLanguage)\n ? (rawLanguage as LanguageProp)\n : 'text';\n }\n if (isInline) {\n return (\n <Code\n isRunnable={false}\n className={className}\n htmlAttributes={props}\n >\n {codeChildren}\n </Code>\n );\n }\n if (typeof codeChildren === 'string') {\n // Check if code fences are balanced in the markdown\n // If there are an odd number of fences, it means there's an unclosed code block\n const fenceMatches = childrenRef.current.match(/```/g);\n const fenceCount = fenceMatches ? fenceMatches.length : 0;\n const hasUnclosedFence = fenceCount % 2 !== 0;\n\n // Show loading state when there's an unclosed fence (code block is streaming)\n const isCodeBlockLoading = hasUnclosedFence;\n return (\n <CodePreview\n key={key}\n code={codeChildren}\n isLoading={isCodeBlockLoading}\n language={language}\n className={className}\n htmlAttributes={{\n ...props,\n }}\n />\n );\n } else {\n return <code className={className}>{codeChildren}</code>;\n }\n },\n pre: ({ className, children }) => {\n return <pre className={classNames(className)}>{children}</pre>;\n },\n p: ({ children, className, ...props }) => (\n <Typography\n as=\"p\"\n variant=\"body-medium\"\n className={classNames(className)}\n {...props}\n >\n {children}\n </Typography>\n ),\n img: ({ className, src, alt, ...props }) => (\n <img\n className={classNames(className)}\n src={src}\n alt={alt}\n {...props}\n />\n ),\n }),\n [],\n );\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames(\n 'ndl-ai-response size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n className,\n )}\n {...restProps}\n {...htmlAttributes}\n >\n <Streamdown\n isAnimating={isAnimating}\n parseIncompleteMarkdown={true}\n components={components}\n >\n {children}\n </Streamdown>\n </div>\n );\n },\n (prevProps, nextProps) => prevProps.children === nextProps.children,\n);\n\nResponse.displayName = 'Response';\n\nexport { Response };\n"]}
@@ -25,7 +25,7 @@ export { default as ResponseCodeExamples } from './response-code-examples.story'
25
25
  export { default as ResponseHeadings } from './response-headings.story';
26
26
  export { default as ResponseLists } from './response-lists.story';
27
27
  export { default as ResponseFullExample } from './response-full-example.story';
28
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
28
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
29
29
  import ResponseAllComponentsSourceRaw from './response-all-components.story?raw';
30
30
  import ResponseCodeExamplesSourceRaw from './response-code-examples.story?raw';
31
31
  import ResponseDefaultSourceRaw from './response-default.story?raw';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/response/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,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MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAC1D,4BAA4B,CAC7B,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ResponseDefault } from './response-default.story';\nexport { default as ResponseStreaming } from './response-streaming.story';\nexport { default as ResponseAllComponents } from './response-all-components.story';\nexport { default as ResponseCodeExamples } from './response-code-examples.story';\nexport { default as ResponseHeadings } from './response-headings.story';\nexport { default as ResponseLists } from './response-lists.story';\nexport { default as ResponseFullExample } from './response-full-example.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport ResponseAllComponentsSourceRaw from './response-all-components.story?raw';\nimport ResponseCodeExamplesSourceRaw from './response-code-examples.story?raw';\nimport ResponseDefaultSourceRaw from './response-default.story?raw';\nimport ResponseFullExampleSourceRaw from './response-full-example.story?raw';\nimport ResponseHeadingsSourceRaw from './response-headings.story?raw';\nimport ResponseListsSourceRaw from './response-lists.story?raw';\nimport ResponseStreamingSourceRaw from './response-streaming.story?raw';\n\nexport const ResponseDefaultSource = removeLicenseHeader(\n ResponseDefaultSourceRaw,\n);\nexport const ResponseStreamingSource = removeLicenseHeader(\n ResponseStreamingSourceRaw,\n);\nexport const ResponseAllComponentsSource = removeLicenseHeader(\n ResponseAllComponentsSourceRaw,\n);\nexport const ResponseCodeExamplesSource = removeLicenseHeader(\n ResponseCodeExamplesSourceRaw,\n);\nexport const ResponseHeadingsSource = removeLicenseHeader(\n ResponseHeadingsSourceRaw,\n);\nexport const ResponseListsSource = removeLicenseHeader(ResponseListsSourceRaw);\nexport const ResponseFullExampleSource = removeLicenseHeader(\n ResponseFullExampleSourceRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/response/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,8BAA8B,MAAM,qCAAqC,CAAC;AACjF,OAAO,6BAA6B,MAAM,oCAAoC,CAAC;AAC/E,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,4BAA4B,MAAM,mCAAmC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,+BAA+B,CAAC;AACtE,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAChE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;AAExE,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CACxD,0BAA0B,CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAC3D,6BAA6B,CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAC1D,4BAA4B,CAC7B,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ResponseDefault } from './response-default.story';\nexport { default as ResponseStreaming } from './response-streaming.story';\nexport { default as ResponseAllComponents } from './response-all-components.story';\nexport { default as ResponseCodeExamples } from './response-code-examples.story';\nexport { default as ResponseHeadings } from './response-headings.story';\nexport { default as ResponseLists } from './response-lists.story';\nexport { default as ResponseFullExample } from './response-full-example.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport ResponseAllComponentsSourceRaw from './response-all-components.story?raw';\nimport ResponseCodeExamplesSourceRaw from './response-code-examples.story?raw';\nimport ResponseDefaultSourceRaw from './response-default.story?raw';\nimport ResponseFullExampleSourceRaw from './response-full-example.story?raw';\nimport ResponseHeadingsSourceRaw from './response-headings.story?raw';\nimport ResponseListsSourceRaw from './response-lists.story?raw';\nimport ResponseStreamingSourceRaw from './response-streaming.story?raw';\n\nexport const ResponseDefaultSource = removeLicenseHeader(\n ResponseDefaultSourceRaw,\n);\nexport const ResponseStreamingSource = removeLicenseHeader(\n ResponseStreamingSourceRaw,\n);\nexport const ResponseAllComponentsSource = removeLicenseHeader(\n ResponseAllComponentsSourceRaw,\n);\nexport const ResponseCodeExamplesSource = removeLicenseHeader(\n ResponseCodeExamplesSourceRaw,\n);\nexport const ResponseHeadingsSource = removeLicenseHeader(\n ResponseHeadingsSourceRaw,\n);\nexport const ResponseListsSource = removeLicenseHeader(ResponseListsSourceRaw);\nexport const ResponseFullExampleSource = removeLicenseHeader(\n ResponseFullExampleSourceRaw,\n);\n"]}
@@ -1,3 +1,15 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
13
  /**
2
14
  *
3
15
  * Copyright (c) "Neo4j"
@@ -18,19 +30,6 @@
18
30
  * You should have received a copy of the GNU General Public License
19
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
32
  */
21
-
22
- var __rest = (this && this.__rest) || function (s, e) {
23
- var t = {};
24
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25
- t[p] = s[p];
26
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
27
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
28
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
29
- t[p[i]] = s[p[i]];
30
- }
31
- return t;
32
- };
33
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
33
  import classNames from 'classnames';
35
34
  /**
36
35
  * The component is used to display a suggestion in a chat, or in a prompt.
@@ -1 +1 @@
1
- {"version":3,"file":"Suggestion.js","sourceRoot":"","sources":["../../../../src/ai/suggestion/Suggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,UAAU,MAAM,YAAY,CAAC;AAepC;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,EAWqB,EAAE,EAAE;QAXzB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,GAAG,OAAO,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEyB,EADpC,SAAS,cAVM,4GAWnB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,mBAAmB,EAAE,SAAS,EAAE;QACzD,2BAA2B,EAAE,SAAS;QACtC,cAAc,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,QAAQ;QACxC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,+BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,IACZ,SAAS,EACT,cAAc,cAElB,eAAK,SAAS,EAAC,yBAAyB,aACrC,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,cAAK,SAAS,EAAC,2BAA2B,YAAE,aAAa,GAAO,CACjE,EACA,QAAQ,IACL,IACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport classNames from 'classnames';\n\ntype SuggestionProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** The visual to display before the content. Should be an icon. */\n leadingVisual?: React.ReactNode;\n /** Whether the suggestion is primary. Renders an animated border. */\n isPrimary?: boolean;\n /** Callback function triggered when the suggestion is clicked */\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** The size of the suggestion */\n size?: 'small' | 'large';\n};\n\n/**\n * The component is used to display a suggestion in a chat, or in a prompt.\n * It can be primary, which animates its border.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Suggestion = ({\n children,\n leadingVisual,\n isPrimary,\n onClick,\n size = 'small',\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'button', SuggestionProps>) => {\n const classes = classNames('ndl-ai-suggestion', className, {\n 'ndl-ai-suggestion-special': isPrimary,\n 'ndl-disabled': htmlAttributes?.disabled,\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n\n return (\n <button\n ref={ref}\n className={classes}\n style={style}\n onClick={onClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-suggestion-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-ai-suggestion-leading\">{leadingVisual}</div>\n )}\n {children}\n </div>\n </button>\n );\n};\n\nexport { Suggestion };\n"]}
1
+ {"version":3,"file":"Suggestion.js","sourceRoot":"","sources":["../../../../src/ai/suggestion/Suggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAiBpC;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,EAWqB,EAAE,EAAE;QAXzB,EAClB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,GAAG,OAAO,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEyB,EADpC,SAAS,cAVM,4GAWnB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,mBAAmB,EAAE,SAAS,EAAE;QACzD,2BAA2B,EAAE,SAAS;QACtC,cAAc,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,QAAQ;QACxC,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;KAC9B,CAAC,CAAC;IAEH,OAAO,CACL,+BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,IACZ,SAAS,EACT,cAAc,cAElB,eAAK,SAAS,EAAC,yBAAyB,aACrC,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,cAAK,SAAS,EAAC,2BAA2B,YAAE,aAAa,GAAO,CACjE,EACA,QAAQ,IACL,IACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\n\nimport { type CommonProps } from '../../_common/types';\n\ntype SuggestionProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** The visual to display before the content. Should be an icon. */\n leadingVisual?: React.ReactNode;\n /** Whether the suggestion is primary. Renders an animated border. */\n isPrimary?: boolean;\n /** Callback function triggered when the suggestion is clicked */\n onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** The size of the suggestion */\n size?: 'small' | 'large';\n};\n\n/**\n * The component is used to display a suggestion in a chat, or in a prompt.\n * It can be primary, which animates its border.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Suggestion = ({\n children,\n leadingVisual,\n isPrimary,\n onClick,\n size = 'small',\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'button', SuggestionProps>) => {\n const classes = classNames('ndl-ai-suggestion', className, {\n 'ndl-ai-suggestion-special': isPrimary,\n 'ndl-disabled': htmlAttributes?.disabled,\n 'ndl-large': size === 'large',\n 'ndl-small': size === 'small',\n });\n\n return (\n <button\n ref={ref}\n className={classes}\n style={style}\n onClick={onClick}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-suggestion-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-ai-suggestion-leading\">{leadingVisual}</div>\n )}\n {children}\n </div>\n </button>\n );\n};\n\nexport { Suggestion };\n"]}
@@ -22,7 +22,7 @@ export { default as SuggestionDefault } from './suggestion-default.story';
22
22
  export { default as SuggestionSizes } from './suggestion-sizes.story';
23
23
  export { default as SuggestionIcon } from './suggestion-icon.story';
24
24
  export { default as SuggestionPrimary } from './suggestion-primary.story';
25
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
25
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
26
26
  import SuggestionDefaultSrcRaw from './suggestion-default.story?raw';
27
27
  import SuggestionIconSrcRaw from './suggestion-icon.story?raw';
28
28
  import SuggestionPrimarySrcRaw from './suggestion-primary.story?raw';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/suggestion/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as SuggestionDefault } from './suggestion-default.story';\nexport { default as SuggestionSizes } from './suggestion-sizes.story';\nexport { default as SuggestionIcon } from './suggestion-icon.story';\nexport { default as SuggestionPrimary } from './suggestion-primary.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport SuggestionDefaultSrcRaw from './suggestion-default.story?raw';\nimport SuggestionIconSrcRaw from './suggestion-icon.story?raw';\nimport SuggestionPrimarySrcRaw from './suggestion-primary.story?raw';\nimport SuggestionSizesSrcRaw from './suggestion-sizes.story?raw';\n\nexport const SuggestionDefaultSrc = removeLicenseHeader(\n SuggestionDefaultSrcRaw,\n);\nexport const SuggestionSizesSrc = removeLicenseHeader(SuggestionSizesSrcRaw);\nexport const SuggestionIconSrc = removeLicenseHeader(SuggestionIconSrcRaw);\nexport const SuggestionPrimarySrc = removeLicenseHeader(\n SuggestionPrimarySrcRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/suggestion/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as SuggestionDefault } from './suggestion-default.story';\nexport { default as SuggestionSizes } from './suggestion-sizes.story';\nexport { default as SuggestionIcon } from './suggestion-icon.story';\nexport { default as SuggestionPrimary } from './suggestion-primary.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport SuggestionDefaultSrcRaw from './suggestion-default.story?raw';\nimport SuggestionIconSrcRaw from './suggestion-icon.story?raw';\nimport SuggestionPrimarySrcRaw from './suggestion-primary.story?raw';\nimport SuggestionSizesSrcRaw from './suggestion-sizes.story?raw';\n\nexport const SuggestionDefaultSrc = removeLicenseHeader(\n SuggestionDefaultSrcRaw,\n);\nexport const SuggestionSizesSrc = removeLicenseHeader(SuggestionSizesSrcRaw);\nexport const SuggestionIconSrc = removeLicenseHeader(SuggestionIconSrcRaw);\nexport const SuggestionPrimarySrc = removeLicenseHeader(\n SuggestionPrimarySrcRaw,\n);\n"]}
@@ -1,3 +1,15 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
13
  /**
2
14
  *
3
15
  * Copyright (c) "Neo4j"
@@ -18,19 +30,6 @@
18
30
  * You should have received a copy of the GNU General Public License
19
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
32
  */
21
-
22
- var __rest = (this && this.__rest) || function (s, e) {
23
- var t = {};
24
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25
- t[p] = s[p];
26
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
27
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
28
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
29
- t[p[i]] = s[p[i]];
30
- }
31
- return t;
32
- };
33
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
34
33
  import classNames from 'classnames';
35
34
  import { Presence } from '../presence';
36
35
  import { formatThinkingDuration } from './thinking-duration-formatter';
@@ -1 +1 @@
1
- {"version":3,"file":"Thinking.js","sourceRoot":"","sources":["../../../../src/ai/thinking/Thinking.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAYvE;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQkB,EAAE,EAAE;QARtB,EAChB,SAAS,EACT,UAAU,GAAG,IAAI,EACjB,KAAK,EACL,cAAc,EACd,GAAG,EACH,UAAU,GAAG,IAAI,OAEiB,EAD/B,SAAS,cAPI,2EAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,gDAAgD,EAChD,SAAS,CACV,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CACrB,8BACE,KAAC,QAAQ,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,iBAAiB,GAAG,EAChE,eAAM,SAAS,EAAC,gDAAgD,yBAEzD,IACN,CACJ,CAAC,CAAC,CAAC,CACF,gBAAM,SAAS,EAAC,6CAA6C,wBACnD,GAAG,EACX,gBAAM,SAAS,EAAC,eAAe,qBACxB,gBAAgB,OAAG,IAAI,IACvB,IACF,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { CommonProps } from '@neo4j-ndl/react/_common/types';\nimport classNames from 'classnames';\n\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from './thinking-duration-formatter';\n\ntype ThinkingProps = {\n /** Whether the AI is thinking.\n * If true, will render a thinking presence icon and the text \"Thinking\".\n * If false, will render the duration of the thinking.\n */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n};\n\n/**\n * The component is used to display the thinking state of an LLM.\n * If the `isThinking` prop is true, it will render a thinking presence icon and the text \"Thinking\".\n * If the `isThinking` prop is false, it will render the duration of the thinking.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Thinking = ({\n className,\n isThinking = true,\n style,\n htmlAttributes,\n ref,\n thinkingMs = 1000,\n ...restProps\n}: CommonProps<'div', ThinkingProps>) => {\n const classes = classNames(\n 'n-flex n-flex-col n-items-start n-gap-token-12',\n className,\n );\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-32\" />\n <span className=\"n-subheading-small n-text-neutral-text-default\">\n Thinking\n </span>\n </>\n ) : (\n <span className=\"n-subheading-small n-text-neutral-text-weak\">\n Thought{' '}\n <span className=\"n-font-normal\">\n for {thinkingDuration} {unit}\n </span>\n </span>\n )}\n </div>\n );\n};\n\nexport { Thinking };\n"]}
1
+ {"version":3,"file":"Thinking.js","sourceRoot":"","sources":["../../../../src/ai/thinking/Thinking.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAYvE;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQkB,EAAE,EAAE;QARtB,EAChB,SAAS,EACT,UAAU,GAAG,IAAI,EACjB,KAAK,EACL,cAAc,EACd,GAAG,EACH,UAAU,GAAG,IAAI,OAEiB,EAD/B,SAAS,cAPI,2EAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,gDAAgD,EAChD,SAAS,CACV,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CACrB,8BACE,KAAC,QAAQ,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,iBAAiB,GAAG,EAChE,eAAM,SAAS,EAAC,gDAAgD,yBAEzD,IACN,CACJ,CAAC,CAAC,CAAC,CACF,gBAAM,SAAS,EAAC,6CAA6C,wBACnD,GAAG,EACX,gBAAM,SAAS,EAAC,eAAe,qBACxB,gBAAgB,OAAG,IAAI,IACvB,IACF,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\n\nimport type { CommonProps } from '../../_common/types';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from './thinking-duration-formatter';\n\ntype ThinkingProps = {\n /** Whether the AI is thinking.\n * If true, will render a thinking presence icon and the text \"Thinking\".\n * If false, will render the duration of the thinking.\n */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n};\n\n/**\n * The component is used to display the thinking state of an LLM.\n * If the `isThinking` prop is true, it will render a thinking presence icon and the text \"Thinking\".\n * If the `isThinking` prop is false, it will render the duration of the thinking.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Thinking = ({\n className,\n isThinking = true,\n style,\n htmlAttributes,\n ref,\n thinkingMs = 1000,\n ...restProps\n}: CommonProps<'div', ThinkingProps>) => {\n const classes = classNames(\n 'n-flex n-flex-col n-items-start n-gap-token-12',\n className,\n );\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-32\" />\n <span className=\"n-subheading-small n-text-neutral-text-default\">\n Thinking\n </span>\n </>\n ) : (\n <span className=\"n-subheading-small n-text-neutral-text-weak\">\n Thought{' '}\n <span className=\"n-font-normal\">\n for {thinkingDuration} {unit}\n </span>\n </span>\n )}\n </div>\n );\n};\n\nexport { Thinking };\n"]}
@@ -20,7 +20,7 @@
20
20
  */
21
21
  export { default as ThinkingDefault } from './ai-thinking-default.story';
22
22
  export { default as ThinkingFinished } from './ai-thinking-finished.story';
23
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
23
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
24
24
  import ThinkingDefaultSrcRaw from './ai-thinking-default.story?raw';
25
25
  import ThinkingFinishedSrcRaw from './ai-thinking-finished.story?raw';
26
26
  export const ThinkingDefaultSrc = removeLicenseHeader(ThinkingDefaultSrcRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/thinking/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ThinkingDefault } from './ai-thinking-default.story';\nexport { default as ThinkingFinished } from './ai-thinking-finished.story';\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport ThinkingDefaultSrcRaw from './ai-thinking-default.story?raw';\nimport ThinkingFinishedSrcRaw from './ai-thinking-finished.story?raw';\n\nexport const ThinkingDefaultSrc = removeLicenseHeader(ThinkingDefaultSrcRaw);\nexport const ThinkingFinishedSrc = removeLicenseHeader(ThinkingFinishedSrcRaw);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/thinking/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ThinkingDefault } from './ai-thinking-default.story';\nexport { default as ThinkingFinished } from './ai-thinking-finished.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport ThinkingDefaultSrcRaw from './ai-thinking-default.story?raw';\nimport ThinkingFinishedSrcRaw from './ai-thinking-finished.story?raw';\n\nexport const ThinkingDefaultSrc = removeLicenseHeader(ThinkingDefaultSrcRaw);\nexport const ThinkingFinishedSrc = removeLicenseHeader(ThinkingFinishedSrcRaw);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolCall.js","sourceRoot":"","sources":["../../../../src/ai/tool-call/ToolCall.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAC;AASpC;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQmB,EAAE,EAAE;QARvB,EAChB,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEqB,EADhC,SAAS,cAPI,qEAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,oEAAoE,EACpE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,MAAC,UAAU,kBACT,OAAO,EAAC,aAAa,EACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,SAAS,eAEb,eAAM,SAAS,EAAC,6FAA6F,YAC1G,MAAM,CAAC,CAAC,CAAC,CACR,8BACE,KAAC,gBAAgB,IAAC,SAAS,EAAC,4CAA4C,GAAG,WAE1E,CACJ,CAAC,CAAC,CAAC,CACF,OAAO,CACR,GACI,EACP,KAAC,IAAI,IAAC,UAAU,EAAE,KAAK,YAAG,QAAQ,GAAQ,KAC/B,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Code, Typography } from '@neo4j-ndl/react';\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport { CheckIconOutline } from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\ntype ToolCallProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** Whether the AI is done with using the tool*/\n isDone?: boolean;\n};\n\n/**\n * The component is used to display that an LLM is using a tool.\n * Per default, the component will display the text \"Using\".\n * If the `isDone` prop is true, the component will display the check icon and the text \"Ran\".\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ToolCall = ({\n children,\n isDone = false,\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'span', ToolCallProps>) => {\n const classes = classNames(\n 'ndl-ai-tool n-inline-flex n-items-center n-gap-token-12 n-flex-row',\n className,\n );\n\n return (\n <Typography\n variant=\"body-medium\"\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n <span className=\"n-text-neutral-text-weak n-capitalize n-inline-flex n-items-center n-gap-token-6 n-flex-row\">\n {isDone ? (\n <>\n <CheckIconOutline className=\"n-size-token-16 n-text-neutral-text-weaker\" />\n Ran\n </>\n ) : (\n 'Using'\n )}\n </span>\n <Code isRunnable={false}>{children}</Code>\n </Typography>\n );\n};\n\nexport { ToolCall };\n"]}
1
+ {"version":3,"file":"ToolCall.js","sourceRoot":"","sources":["../../../../src/ai/tool-call/ToolCall.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAC;AAWpC;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQmB,EAAE,EAAE;QARvB,EAChB,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,GAAG,EACH,SAAS,EACT,KAAK,EACL,cAAc,OAEqB,EADhC,SAAS,cAPI,qEAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,oEAAoE,EACpE,SAAS,CACV,CAAC;IAEF,OAAO,CACL,MAAC,UAAU,kBACT,OAAO,EAAC,aAAa,EACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,SAAS,eAEb,eAAM,SAAS,EAAC,6FAA6F,YAC1G,MAAM,CAAC,CAAC,CAAC,CACR,8BACE,KAAC,gBAAgB,IAAC,SAAS,EAAC,4CAA4C,GAAG,WAE1E,CACJ,CAAC,CAAC,CAAC,CACF,OAAO,CACR,GACI,EACP,KAAC,IAAI,IAAC,UAAU,EAAE,KAAK,YAAG,QAAQ,GAAQ,KAC/B,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Code, Typography } from '@neo4j-ndl/react';\nimport { CheckIconOutline } from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\nimport { type CommonProps } from '../../_common/types';\n\ntype ToolCallProps = {\n /** The content of the suggestion */\n children?: React.ReactNode;\n /** Whether the AI is done with using the tool*/\n isDone?: boolean;\n};\n\n/**\n * The component is used to display that an LLM is using a tool.\n * Per default, the component will display the text \"Using\".\n * If the `isDone` prop is true, the component will display the check icon and the text \"Ran\".\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ToolCall = ({\n children,\n isDone = false,\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'span', ToolCallProps>) => {\n const classes = classNames(\n 'ndl-ai-tool n-inline-flex n-items-center n-gap-token-12 n-flex-row',\n className,\n );\n\n return (\n <Typography\n variant=\"body-medium\"\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n <span className=\"n-text-neutral-text-weak n-capitalize n-inline-flex n-items-center n-gap-token-6 n-flex-row\">\n {isDone ? (\n <>\n <CheckIconOutline className=\"n-size-token-16 n-text-neutral-text-weaker\" />\n Ran\n </>\n ) : (\n 'Using'\n )}\n </span>\n <Code isRunnable={false}>{children}</Code>\n </Typography>\n );\n};\n\nexport { ToolCall };\n"]}
@@ -20,7 +20,7 @@
20
20
  */
21
21
  export { default as ToolCallDefault } from './tool-call-default.story';
22
22
  export { default as ToolCallDone } from './tool-call-done.story';
23
- import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
23
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
24
24
  import ToolCallDefaultSrcRaw from './tool-call-default.story?raw';
25
25
  import ToolCallDoneSrcRaw from './tool-call-done.story?raw';
26
26
  export const ToolCallDefaultSrc = removeLicenseHeader(ToolCallDefaultSrcRaw);