@orion-ds/react 4.2.11 → 4.2.14

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 (303) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.mjs +1 -1
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.mjs +46 -14
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.mjs +14 -28
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.mjs +28 -27
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.mjs +29 -29
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.mjs +44 -20
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.mjs +52 -44
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.mjs +42 -54
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.mjs +18 -40
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.mjs +50 -36
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.mjs +20 -64
  23. package/dist/index11.cjs +1 -1
  24. package/dist/index11.mjs +1 -1
  25. package/dist/index110.cjs +1 -1
  26. package/dist/index110.mjs +36 -24
  27. package/dist/index111.cjs +1 -1
  28. package/dist/index111.mjs +20 -52
  29. package/dist/index112.cjs +1 -1
  30. package/dist/index112.mjs +29 -37
  31. package/dist/index113.cjs +1 -1
  32. package/dist/index113.mjs +18 -28
  33. package/dist/index114.cjs +1 -1
  34. package/dist/index114.mjs +62 -44
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.mjs +12 -36
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.mjs +35 -28
  39. package/dist/index118.cjs +1 -1
  40. package/dist/index118.mjs +49 -19
  41. package/dist/index119.cjs +1 -1
  42. package/dist/index119.mjs +36 -38
  43. package/dist/index12.cjs +1 -1
  44. package/dist/index12.mjs +1 -1
  45. package/dist/index120.cjs +1 -1
  46. package/dist/index120.mjs +32 -40
  47. package/dist/index121.cjs +1 -1
  48. package/dist/index121.mjs +27 -28
  49. package/dist/index122.cjs +1 -1
  50. package/dist/index122.mjs +12 -52
  51. package/dist/index123.cjs +1 -1
  52. package/dist/index123.mjs +40 -32
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.mjs +42 -35
  55. package/dist/index126.cjs +1 -1
  56. package/dist/index126.mjs +27 -27
  57. package/dist/index127.cjs +1 -1
  58. package/dist/index127.mjs +37 -21
  59. package/dist/index128.cjs +1 -1
  60. package/dist/index128.mjs +26 -44
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.mjs +55 -51
  63. package/dist/index13.cjs +1 -1
  64. package/dist/index13.mjs +1 -1
  65. package/dist/index130.cjs +1 -1
  66. package/dist/index130.mjs +20 -64
  67. package/dist/index131.cjs +1 -1
  68. package/dist/index131.mjs +26 -44
  69. package/dist/index132.cjs +1 -1
  70. package/dist/index132.mjs +52 -42
  71. package/dist/index133.cjs +1 -1
  72. package/dist/index133.mjs +106 -28
  73. package/dist/index134.cjs +1 -1
  74. package/dist/index134.mjs +55 -12
  75. package/dist/index135.cjs +1 -1
  76. package/dist/index135.mjs +18 -20
  77. package/dist/index136.cjs +1 -1
  78. package/dist/index136.mjs +65 -24
  79. package/dist/index137.cjs +1 -1
  80. package/dist/index137.mjs +64 -16
  81. package/dist/index138.cjs +1 -1
  82. package/dist/index138.mjs +28 -50
  83. package/dist/index139.cjs +1 -1
  84. package/dist/index139.mjs +24 -40
  85. package/dist/index14.cjs +1 -1
  86. package/dist/index14.mjs +1 -1
  87. package/dist/index140.cjs +1 -1
  88. package/dist/index140.mjs +18 -42
  89. package/dist/index141.cjs +1 -1
  90. package/dist/index141.mjs +24 -18
  91. package/dist/index142.cjs +1 -1
  92. package/dist/index142.mjs +40 -55
  93. package/dist/index143.cjs +1 -1
  94. package/dist/index143.mjs +22 -65
  95. package/dist/index144.cjs +1 -1
  96. package/dist/index144.mjs +46 -33
  97. package/dist/index145.cjs +1 -1
  98. package/dist/index145.mjs +20 -18
  99. package/dist/index146.cjs +1 -1
  100. package/dist/index146.mjs +33 -67
  101. package/dist/index147.cjs +1 -1
  102. package/dist/index147.mjs +24 -56
  103. package/dist/index148.cjs +1 -1
  104. package/dist/index148.mjs +67 -18
  105. package/dist/index149.cjs +1 -1
  106. package/dist/index149.mjs +46 -62
  107. package/dist/index15.cjs +1 -1
  108. package/dist/index15.mjs +1 -1
  109. package/dist/index150.cjs +1 -1
  110. package/dist/index150.mjs +24 -76
  111. package/dist/index151.cjs +1 -1
  112. package/dist/index151.mjs +45 -24
  113. package/dist/index152.cjs +1 -1
  114. package/dist/index152.mjs +42 -32
  115. package/dist/index154.cjs +1 -1
  116. package/dist/index154.mjs +64 -30
  117. package/dist/index155.cjs +1 -1
  118. package/dist/index155.mjs +53 -106
  119. package/dist/index156.cjs +1 -1
  120. package/dist/index156.mjs +76 -45
  121. package/dist/index157.cjs +1 -1
  122. package/dist/index157.mjs +38 -234
  123. package/dist/index158.cjs +1 -1
  124. package/dist/index158.mjs +235 -34
  125. package/dist/index159.cjs +1 -1
  126. package/dist/index159.mjs +32 -42
  127. package/dist/index16.cjs +1 -1
  128. package/dist/index16.mjs +1 -1
  129. package/dist/index160.cjs +1 -1
  130. package/dist/index160.mjs +42 -169
  131. package/dist/index161.cjs +1 -1
  132. package/dist/index161.mjs +162 -177
  133. package/dist/index162.cjs +1 -1
  134. package/dist/index162.mjs +181 -24
  135. package/dist/index163.cjs +1 -1
  136. package/dist/index163.mjs +28 -90
  137. package/dist/index164.cjs +1 -1
  138. package/dist/index164.mjs +89 -51
  139. package/dist/index165.cjs +1 -1
  140. package/dist/index165.mjs +49 -63
  141. package/dist/index166.cjs +1 -1
  142. package/dist/index166.mjs +60 -118
  143. package/dist/index167.cjs +1 -1
  144. package/dist/index167.mjs +109 -93
  145. package/dist/index168.cjs +1 -1
  146. package/dist/index168.mjs +97 -100
  147. package/dist/index169.cjs +1 -1
  148. package/dist/index169.mjs +101 -112
  149. package/dist/index17.cjs +1 -1
  150. package/dist/index17.mjs +1 -1
  151. package/dist/index170.cjs +1 -1
  152. package/dist/index170.mjs +118 -210
  153. package/dist/index171.cjs +1 -1
  154. package/dist/index171.mjs +214 -33
  155. package/dist/index172.cjs +1 -1
  156. package/dist/index172.mjs +44 -26
  157. package/dist/index173.cjs +1 -1
  158. package/dist/index173.mjs +30 -20
  159. package/dist/index174.cjs +1 -1
  160. package/dist/index174.mjs +36 -46
  161. package/dist/index175.cjs +1 -1
  162. package/dist/index175.mjs +56 -28
  163. package/dist/index176.cjs +1 -1
  164. package/dist/index176.mjs +30 -57
  165. package/dist/index177.cjs +1 -1
  166. package/dist/index177.mjs +32 -24
  167. package/dist/index178.cjs +1 -1
  168. package/dist/index178.mjs +28 -12
  169. package/dist/index179.cjs +1 -1
  170. package/dist/index179.mjs +28 -18
  171. package/dist/index18.cjs +1 -1
  172. package/dist/index18.mjs +1 -1
  173. package/dist/index180.cjs +1 -1
  174. package/dist/index180.mjs +16 -38
  175. package/dist/index181.cjs +1 -1
  176. package/dist/index181.mjs +33 -30
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.mjs +1 -1
  179. package/dist/index19.cjs +1 -1
  180. package/dist/index19.mjs +2 -2
  181. package/dist/index20.cjs +1 -1
  182. package/dist/index20.mjs +14 -14
  183. package/dist/index22.cjs +1 -1
  184. package/dist/index22.mjs +1 -1
  185. package/dist/index23.cjs +1 -1
  186. package/dist/index23.mjs +1 -1
  187. package/dist/index24.cjs +1 -1
  188. package/dist/index24.mjs +1 -1
  189. package/dist/index25.cjs +1 -1
  190. package/dist/index25.mjs +1 -1
  191. package/dist/index27.cjs +1 -1
  192. package/dist/index27.mjs +1 -1
  193. package/dist/index28.cjs +1 -1
  194. package/dist/index28.mjs +1 -1
  195. package/dist/index30.cjs +1 -1
  196. package/dist/index30.mjs +1 -1
  197. package/dist/index31.cjs +1 -1
  198. package/dist/index31.mjs +1 -1
  199. package/dist/index32.cjs +1 -1
  200. package/dist/index32.mjs +1 -1
  201. package/dist/index33.cjs +1 -1
  202. package/dist/index33.mjs +1 -1
  203. package/dist/index34.cjs +1 -1
  204. package/dist/index34.mjs +1 -1
  205. package/dist/index35.cjs +1 -1
  206. package/dist/index35.mjs +1 -1
  207. package/dist/index36.cjs +1 -1
  208. package/dist/index36.mjs +1 -1
  209. package/dist/index37.cjs +1 -1
  210. package/dist/index37.mjs +1 -1
  211. package/dist/index38.cjs +1 -1
  212. package/dist/index38.mjs +1 -1
  213. package/dist/index39.cjs +1 -1
  214. package/dist/index39.mjs +1 -1
  215. package/dist/index40.cjs +1 -1
  216. package/dist/index40.mjs +1 -1
  217. package/dist/index42.cjs +1 -1
  218. package/dist/index42.mjs +1 -1
  219. package/dist/index43.cjs +1 -1
  220. package/dist/index43.mjs +1 -1
  221. package/dist/index44.cjs +1 -1
  222. package/dist/index44.mjs +1 -1
  223. package/dist/index46.cjs +1 -1
  224. package/dist/index46.mjs +1 -1
  225. package/dist/index47.cjs +1 -1
  226. package/dist/index47.mjs +1 -1
  227. package/dist/index49.cjs +1 -1
  228. package/dist/index49.mjs +1 -1
  229. package/dist/index5.cjs +1 -1
  230. package/dist/index5.mjs +1 -1
  231. package/dist/index50.cjs +1 -1
  232. package/dist/index50.mjs +1 -1
  233. package/dist/index51.cjs +1 -1
  234. package/dist/index51.mjs +1 -1
  235. package/dist/index52.cjs +1 -1
  236. package/dist/index52.mjs +1 -1
  237. package/dist/index53.cjs +1 -1
  238. package/dist/index53.mjs +1 -1
  239. package/dist/index54.cjs +1 -1
  240. package/dist/index54.mjs +1 -1
  241. package/dist/index55.cjs +1 -1
  242. package/dist/index55.mjs +1 -1
  243. package/dist/index56.cjs +1 -1
  244. package/dist/index56.mjs +1 -1
  245. package/dist/index57.cjs +1 -1
  246. package/dist/index57.mjs +1 -1
  247. package/dist/index58.cjs +1 -1
  248. package/dist/index58.mjs +1 -1
  249. package/dist/index59.cjs +1 -1
  250. package/dist/index59.mjs +1 -1
  251. package/dist/index6.cjs +1 -1
  252. package/dist/index6.mjs +1 -1
  253. package/dist/index60.cjs +1 -1
  254. package/dist/index60.mjs +1 -1
  255. package/dist/index61.cjs +1 -1
  256. package/dist/index61.mjs +1 -1
  257. package/dist/index62.cjs +1 -1
  258. package/dist/index62.mjs +1 -1
  259. package/dist/index64.cjs +1 -1
  260. package/dist/index64.mjs +1 -1
  261. package/dist/index65.cjs +1 -1
  262. package/dist/index65.mjs +1 -1
  263. package/dist/index66.cjs +1 -1
  264. package/dist/index66.mjs +1 -1
  265. package/dist/index67.cjs +1 -1
  266. package/dist/index67.mjs +1 -1
  267. package/dist/index69.cjs +1 -1
  268. package/dist/index69.mjs +1 -1
  269. package/dist/index7.cjs +1 -1
  270. package/dist/index7.mjs +1 -1
  271. package/dist/index70.cjs +1 -1
  272. package/dist/index70.mjs +1 -1
  273. package/dist/index71.cjs +1 -1
  274. package/dist/index71.mjs +1 -1
  275. package/dist/index72.cjs +1 -1
  276. package/dist/index72.mjs +1 -1
  277. package/dist/index73.cjs +1 -1
  278. package/dist/index73.mjs +1 -1
  279. package/dist/index76.cjs +1 -1
  280. package/dist/index76.mjs +1 -1
  281. package/dist/index77.cjs +1 -1
  282. package/dist/index77.mjs +1 -1
  283. package/dist/index78.cjs +1 -1
  284. package/dist/index78.mjs +1 -1
  285. package/dist/index79.cjs +1 -1
  286. package/dist/index79.mjs +1 -1
  287. package/dist/index8.cjs +1 -1
  288. package/dist/index8.mjs +1 -1
  289. package/dist/index80.cjs +1 -1
  290. package/dist/index80.mjs +1 -1
  291. package/dist/index81.cjs +1 -1
  292. package/dist/index81.mjs +1 -1
  293. package/dist/index82.cjs +1 -1
  294. package/dist/index82.mjs +2 -2
  295. package/dist/index9.cjs +1 -1
  296. package/dist/index9.mjs +1 -1
  297. package/dist/index97.cjs +1 -1
  298. package/dist/index97.mjs +154 -30
  299. package/dist/index98.cjs +1 -1
  300. package/dist/index98.mjs +202 -138
  301. package/dist/index99.cjs +1 -1
  302. package/dist/index99.mjs +30 -218
  303. package/package.json +1 -1
package/dist/index161.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),o=require("lucide-react"),_=require("./index85.cjs"),$=require("./index167.cjs"),E=require("./index184.cjs"),a=require("./index157.cjs"),X=m=>m.type.startsWith("image/")?e.jsx(o.Image,{size:14}):e.jsx(o.File,{size:14}),y=l.forwardRef(({onSend:m,placeholder:R="Type a message...",allowAttachments:N=!0,allowVoiceRecording:S=!0,allowAudioUpload:G=!0,disabled:i=!1,maxLength:f,acceptedFileTypes:k=["image/*","audio/*",".pdf",".doc",".docx",".txt"],isLoading:s=!1,pendingAttachments:z,onRemoveAttachment:I,className:q,...w},r)=>{const[j,h]=l.useState(!1),u=l.useRef(null),{value:x,setValue:B,attachments:D,addAttachments:c,removeAttachment:F,handleSubmit:g,handleKeyDown:V,textareaRef:C,isEmpty:P}=_.useChatInput({maxLength:f,onSend:m,disabled:i||s}),d=z||D,M=I||F,T=l.useCallback(t=>{C.current=t,typeof r=="function"?r(t):r&&(r.current=t)},[r,C]),W=l.useCallback(t=>{const n=t.target.files;n&&n.length>0&&c(Array.from(n)),u.current&&(u.current.value="")},[c]),K=l.useCallback(t=>{const n=t.clipboardData.items,p=[];for(const v of n)if(v.type.startsWith("image/")){const A=v.getAsFile();A&&p.push(A)}p.length>0&&(t.preventDefault(),c(p))},[c]),O=l.useCallback(t=>{const n=Object.assign(t,{name:`voice-${Date.now()}.webm`,lastModified:Date.now()});c([n]),h(!1)},[c]),U=l.useCallback(()=>{i||s||g()},[i,s,g]),b=!P||d.length>0;return e.jsx("div",{className:[a.default.inputContainer,q].filter(Boolean).join(" "),children:e.jsxs("div",{className:a.default.inputWrapper,children:[d.length>0&&e.jsx("div",{className:a.default.pendingAttachments,children:d.map((t,n)=>e.jsxs("div",{className:a.default.pendingAttachment,children:[X(t),e.jsx("span",{children:t.name}),e.jsxs("span",{className:a.default.pendingAttachmentSize,children:["(",E.formatFileSize(t.size),")"]}),e.jsx("button",{className:a.default.pendingAttachmentRemove,onClick:()=>M(n),"aria-label":`Remove ${t.name}`,children:e.jsx(o.X,{size:14})})]},n))}),j&&e.jsx($.ChatVoiceRecorder,{onRecordingComplete:O,onCancel:()=>h(!1)}),!j&&e.jsxs("div",{className:a.default.inputBox,children:[N&&e.jsxs("div",{className:a.default.inputActions,children:[e.jsx("input",{ref:u,type:"file",accept:k.join(","),multiple:!0,onChange:W,style:{display:"none"},"aria-hidden":"true"}),e.jsx("button",{className:a.default.inputButton,onClick:()=>u.current?.click(),disabled:i||s,"aria-label":"Attach file",title:"Attach file",children:e.jsx(o.Paperclip,{size:20})})]}),e.jsx("textarea",{ref:T,className:a.default.inputTextarea,value:x,onChange:t=>B(t.target.value),onKeyDown:V,onPaste:K,placeholder:R,disabled:i||s,maxLength:f,rows:1,"aria-label":"Message input",...w}),e.jsxs("div",{className:a.default.inputActions,children:[S&&!x&&d.length===0&&e.jsx("button",{className:a.default.inputButton,onClick:()=>h(!0),disabled:i||s,"aria-label":"Record voice message",title:"Record voice message",children:e.jsx(o.Mic,{size:20})}),e.jsx("button",{className:[a.default.inputButton,b&&a.default.inputButtonPrimary].filter(Boolean).join(" "),onClick:U,disabled:i||s||!b,"aria-label":"Send message",title:"Send message",children:s?e.jsx("span",{className:a.default.inputSpinner}):e.jsx(o.Send,{size:20})})]})]})]})})});y.displayName="ChatInput";exports.ChatInput=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("lucide-react"),p=require("./index165.cjs"),y=require("./index170.cjs"),e=require("./index158.cjs"),R=a=>a?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(a):"",S=a=>{switch(a){case"sending":return s.jsx(t.Clock,{size:12});case"sent":return s.jsx(t.Check,{size:12});case"error":return s.jsx(t.AlertCircle,{size:12});default:return null}},b=({role:a,content:u,timestamp:m,status:i,attachments:d,avatar:C,showAvatar:N,actions:c,isStreaming:k,onImageClick:f,onRetry:g,reaction:l,onReaction:o,children:j,className:h,...x})=>{const r=a==="user",A=a==="system",v=a==="assistant",B=N??!1;return A?s.jsx("div",{className:[e.default.message,h].filter(Boolean).join(" "),role:"listitem",...x,children:s.jsx("div",{className:e.default.messageContent,children:s.jsx("div",{className:e.default.messageBubbleSystem,children:j||u})})}):s.jsxs("div",{className:[e.default.message,r&&e.default.messageUser,v&&e.default.messageAssistant,h].filter(Boolean).join(" "),role:"listitem",...x,children:[B&&s.jsx("div",{className:[e.default.messageAvatar,r?e.default.messageAvatarUser:e.default.messageAvatarAssistant].filter(Boolean).join(" "),"aria-hidden":"true",children:C||(r?s.jsx(t.User,{size:18}):s.jsx(t.Bot,{size:18}))}),s.jsxs("div",{className:e.default.messageContent,children:[s.jsxs("div",{className:[e.default.messageBubble,r?e.default.messageBubbleUser:e.default.messageBubbleAssistant].filter(Boolean).join(" "),children:[j||s.jsx(p.ChatMarkdown,{content:u,className:r?e.default.markdownUser:void 0}),k&&s.jsx("span",{className:e.default.streamingCursor})]}),d&&d.length>0&&s.jsx("div",{className:e.default.messageAttachments,children:d.map(n=>s.jsx(y.ChatAttachment,{attachment:n,onClick:n.type==="image"&&f?()=>f(n):void 0},n.id))}),s.jsxs("div",{className:e.default.messageFooter,children:[m&&s.jsx("span",{className:e.default.messageTimestamp,children:R(m)}),i&&s.jsxs("span",{className:[e.default.messageStatus,i==="error"&&e.default.messageStatusError].filter(Boolean).join(" "),children:[S(i),i==="error"&&"Failed to send"]}),i==="error"&&g&&s.jsxs("button",{className:e.default.messageRetry,onClick:g,"aria-label":"Retry sending message",children:[s.jsx(t.RotateCcw,{size:12}),"Retry"]}),c&&s.jsx("div",{className:e.default.messageActions,children:c}),v&&o&&s.jsxs("div",{className:[e.default.messageReactions,l&&e.default.messageReactionsVisible].filter(Boolean).join(" "),children:[s.jsx("button",{className:[e.default.messageReactionButton,l==="like"&&e.default.messageReactionActive].filter(Boolean).join(" "),onClick:()=>o("like"),"aria-label":"Like this response","aria-pressed":l==="like",children:s.jsx(t.ThumbsUp,{size:14})}),s.jsx("button",{className:[e.default.messageReactionButton,l==="dislike"&&e.default.messageReactionActive].filter(Boolean).join(" "),onClick:()=>o("dislike"),"aria-label":"Dislike this response","aria-pressed":l==="dislike",children:s.jsx(t.ThumbsDown,{size:14})})]})]})]})]})};b.displayName="ChatMessage";exports.ChatMessage=b;
package/dist/index161.mjs CHANGED
@@ -1,188 +1,173 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { forwardRef as E, useState as O, useRef as X, useCallback as r } from "react";
3
- import { X as _, Paperclip as q, Mic as G, Send as H, Image as J, File as Q } from "lucide-react";
4
- import { useChatInput as Y } from "./index85.mjs";
5
- import { ChatVoiceRecorder as Z } from "./index167.mjs";
6
- import { formatFileSize as L } from "./index184.mjs";
7
- import n from "./index157.mjs";
8
- const ee = (p) => p.type.startsWith("image/") ? /* @__PURE__ */ t(J, { size: 14 }) : /* @__PURE__ */ t(Q, { size: 14 }), te = E(
9
- ({
10
- onSend: p,
11
- placeholder: S = "Type a message...",
12
- allowAttachments: R = !0,
13
- allowVoiceRecording: z = !0,
14
- allowAudioUpload: ne = !0,
15
- disabled: s = !1,
16
- maxLength: f,
17
- acceptedFileTypes: w = [
18
- "image/*",
19
- "audio/*",
20
- ".pdf",
21
- ".doc",
22
- ".docx",
23
- ".txt"
24
- ],
25
- isLoading: i = !1,
26
- pendingAttachments: x,
27
- onRemoveAttachment: B,
28
- className: j,
29
- ...k
30
- }, o) => {
31
- const [g, h] = O(!1), m = X(null), {
32
- value: v,
33
- setValue: D,
34
- attachments: F,
35
- addAttachments: l,
36
- removeAttachment: I,
37
- handleSubmit: A,
38
- handleKeyDown: V,
39
- textareaRef: b,
40
- isEmpty: P
41
- } = Y({
42
- maxLength: f,
43
- onSend: p,
44
- disabled: s || i
45
- }), u = x || F, M = B || I, W = r(
46
- (e) => {
47
- b.current = e, typeof o == "function" ? o(e) : o && (o.current = e);
48
- },
49
- [o, b]
50
- ), K = r(
51
- (e) => {
52
- const a = e.target.files;
53
- a && a.length > 0 && l(Array.from(a)), m.current && (m.current.value = "");
54
- },
55
- [l]
56
- ), T = r(
57
- (e) => {
58
- const a = e.clipboardData.items, d = [];
59
- for (const C of a)
60
- if (C.type.startsWith("image/")) {
61
- const N = C.getAsFile();
62
- N && d.push(N);
1
+ import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
+ import { User as j, Bot as y, RotateCcw as z, ThumbsUp as U, ThumbsDown as w, AlertCircle as R, Check as S, Clock as T } from "lucide-react";
3
+ import { ChatMarkdown as x } from "./index165.mjs";
4
+ import { ChatAttachment as D } from "./index170.mjs";
5
+ import e from "./index158.mjs";
6
+ const F = (a) => a ? new Intl.DateTimeFormat("en-US", {
7
+ hour: "numeric",
8
+ minute: "2-digit",
9
+ hour12: !0
10
+ }).format(a) : "", M = (a) => {
11
+ switch (a) {
12
+ case "sending":
13
+ return /* @__PURE__ */ s(T, { size: 12 });
14
+ case "sent":
15
+ return /* @__PURE__ */ s(S, { size: 12 });
16
+ case "error":
17
+ return /* @__PURE__ */ s(R, { size: 12 });
18
+ default:
19
+ return null;
20
+ }
21
+ }, E = ({
22
+ role: a,
23
+ content: c,
24
+ timestamp: d,
25
+ status: r,
26
+ attachments: o,
27
+ avatar: b,
28
+ showAvatar: k,
29
+ actions: g,
30
+ isStreaming: B,
31
+ onImageClick: u,
32
+ onRetry: h,
33
+ reaction: l,
34
+ onReaction: m,
35
+ children: f,
36
+ className: v,
37
+ ...p
38
+ }) => {
39
+ const t = a === "user", A = a === "system", N = a === "assistant", C = k ?? !1;
40
+ return A ? /* @__PURE__ */ s(
41
+ "div",
42
+ {
43
+ className: [e.message, v].filter(Boolean).join(" "),
44
+ role: "listitem",
45
+ ...p,
46
+ children: /* @__PURE__ */ s("div", { className: e.messageContent, children: /* @__PURE__ */ s("div", { className: e.messageBubbleSystem, children: f || c }) })
47
+ }
48
+ ) : /* @__PURE__ */ i(
49
+ "div",
50
+ {
51
+ className: [
52
+ e.message,
53
+ t && e.messageUser,
54
+ N && e.messageAssistant,
55
+ v
56
+ ].filter(Boolean).join(" "),
57
+ role: "listitem",
58
+ ...p,
59
+ children: [
60
+ C && /* @__PURE__ */ s(
61
+ "div",
62
+ {
63
+ className: [
64
+ e.messageAvatar,
65
+ t ? e.messageAvatarUser : e.messageAvatarAssistant
66
+ ].filter(Boolean).join(" "),
67
+ "aria-hidden": "true",
68
+ children: b || (t ? /* @__PURE__ */ s(j, { size: 18 }) : /* @__PURE__ */ s(y, { size: 18 }))
63
69
  }
64
- d.length > 0 && (e.preventDefault(), l(d));
65
- },
66
- [l]
67
- ), U = r(
68
- (e) => {
69
- const a = Object.assign(e, {
70
- name: `voice-${Date.now()}.webm`,
71
- lastModified: Date.now()
72
- });
73
- l([a]), h(!1);
74
- },
75
- [l]
76
- ), $ = r(() => {
77
- s || i || A();
78
- }, [s, i, A]), y = !P || u.length > 0;
79
- return /* @__PURE__ */ t(
80
- "div",
81
- {
82
- className: [n.inputContainer, j].filter(Boolean).join(" "),
83
- children: /* @__PURE__ */ c("div", { className: n.inputWrapper, children: [
84
- u.length > 0 && /* @__PURE__ */ t("div", { className: n.pendingAttachments, children: u.map((e, a) => /* @__PURE__ */ c("div", { className: n.pendingAttachment, children: [
85
- ee(e),
86
- /* @__PURE__ */ t("span", { children: e.name }),
87
- /* @__PURE__ */ c("span", { className: n.pendingAttachmentSize, children: [
88
- "(",
89
- L(e.size),
90
- ")"
91
- ] }),
92
- /* @__PURE__ */ t(
93
- "button",
94
- {
95
- className: n.pendingAttachmentRemove,
96
- onClick: () => M(a),
97
- "aria-label": `Remove ${e.name}`,
98
- children: /* @__PURE__ */ t(_, { size: 14 })
99
- }
100
- )
101
- ] }, a)) }),
102
- g && /* @__PURE__ */ t(
103
- Z,
70
+ ),
71
+ /* @__PURE__ */ i("div", { className: e.messageContent, children: [
72
+ /* @__PURE__ */ i(
73
+ "div",
104
74
  {
105
- onRecordingComplete: U,
106
- onCancel: () => h(!1)
75
+ className: [
76
+ e.messageBubble,
77
+ t ? e.messageBubbleUser : e.messageBubbleAssistant
78
+ ].filter(Boolean).join(" "),
79
+ children: [
80
+ f || /* @__PURE__ */ s(
81
+ x,
82
+ {
83
+ content: c,
84
+ className: t ? e.markdownUser : void 0
85
+ }
86
+ ),
87
+ B && /* @__PURE__ */ s("span", { className: e.streamingCursor })
88
+ ]
107
89
  }
108
90
  ),
109
- !g && /* @__PURE__ */ c("div", { className: n.inputBox, children: [
110
- R && /* @__PURE__ */ c("div", { className: n.inputActions, children: [
111
- /* @__PURE__ */ t(
112
- "input",
113
- {
114
- ref: m,
115
- type: "file",
116
- accept: w.join(","),
117
- multiple: !0,
118
- onChange: K,
119
- style: { display: "none" },
120
- "aria-hidden": "true"
121
- }
122
- ),
123
- /* @__PURE__ */ t(
124
- "button",
125
- {
126
- className: n.inputButton,
127
- onClick: () => m.current?.click(),
128
- disabled: s || i,
129
- "aria-label": "Attach file",
130
- title: "Attach file",
131
- children: /* @__PURE__ */ t(q, { size: 20 })
132
- }
133
- )
134
- ] }),
135
- /* @__PURE__ */ t(
136
- "textarea",
91
+ o && o.length > 0 && /* @__PURE__ */ s("div", { className: e.messageAttachments, children: o.map((n) => /* @__PURE__ */ s(
92
+ D,
93
+ {
94
+ attachment: n,
95
+ onClick: n.type === "image" && u ? () => u(n) : void 0
96
+ },
97
+ n.id
98
+ )) }),
99
+ /* @__PURE__ */ i("div", { className: e.messageFooter, children: [
100
+ d && /* @__PURE__ */ s("span", { className: e.messageTimestamp, children: F(d) }),
101
+ r && /* @__PURE__ */ i(
102
+ "span",
137
103
  {
138
- ref: W,
139
- className: n.inputTextarea,
140
- value: v,
141
- onChange: (e) => D(e.target.value),
142
- onKeyDown: V,
143
- onPaste: T,
144
- placeholder: S,
145
- disabled: s || i,
146
- maxLength: f,
147
- rows: 1,
148
- "aria-label": "Message input",
149
- ...k
104
+ className: [
105
+ e.messageStatus,
106
+ r === "error" && e.messageStatusError
107
+ ].filter(Boolean).join(" "),
108
+ children: [
109
+ M(r),
110
+ r === "error" && "Failed to send"
111
+ ]
150
112
  }
151
113
  ),
152
- /* @__PURE__ */ c("div", { className: n.inputActions, children: [
153
- z && !v && u.length === 0 && /* @__PURE__ */ t(
154
- "button",
155
- {
156
- className: n.inputButton,
157
- onClick: () => h(!0),
158
- disabled: s || i,
159
- "aria-label": "Record voice message",
160
- title: "Record voice message",
161
- children: /* @__PURE__ */ t(G, { size: 20 })
162
- }
163
- ),
164
- /* @__PURE__ */ t(
165
- "button",
166
- {
167
- className: [
168
- n.inputButton,
169
- y && n.inputButtonPrimary
170
- ].filter(Boolean).join(" "),
171
- onClick: $,
172
- disabled: s || i || !y,
173
- "aria-label": "Send message",
174
- title: "Send message",
175
- children: i ? /* @__PURE__ */ t("span", { className: n.inputSpinner }) : /* @__PURE__ */ t(H, { size: 20 })
176
- }
177
- )
178
- ] })
114
+ r === "error" && h && /* @__PURE__ */ i(
115
+ "button",
116
+ {
117
+ className: e.messageRetry,
118
+ onClick: h,
119
+ "aria-label": "Retry sending message",
120
+ children: [
121
+ /* @__PURE__ */ s(z, { size: 12 }),
122
+ "Retry"
123
+ ]
124
+ }
125
+ ),
126
+ g && /* @__PURE__ */ s("div", { className: e.messageActions, children: g }),
127
+ N && m && /* @__PURE__ */ i(
128
+ "div",
129
+ {
130
+ className: [
131
+ e.messageReactions,
132
+ l && e.messageReactionsVisible
133
+ ].filter(Boolean).join(" "),
134
+ children: [
135
+ /* @__PURE__ */ s(
136
+ "button",
137
+ {
138
+ className: [
139
+ e.messageReactionButton,
140
+ l === "like" && e.messageReactionActive
141
+ ].filter(Boolean).join(" "),
142
+ onClick: () => m("like"),
143
+ "aria-label": "Like this response",
144
+ "aria-pressed": l === "like",
145
+ children: /* @__PURE__ */ s(U, { size: 14 })
146
+ }
147
+ ),
148
+ /* @__PURE__ */ s(
149
+ "button",
150
+ {
151
+ className: [
152
+ e.messageReactionButton,
153
+ l === "dislike" && e.messageReactionActive
154
+ ].filter(Boolean).join(" "),
155
+ onClick: () => m("dislike"),
156
+ "aria-label": "Dislike this response",
157
+ "aria-pressed": l === "dislike",
158
+ children: /* @__PURE__ */ s(w, { size: 14 })
159
+ }
160
+ )
161
+ ]
162
+ }
163
+ )
179
164
  ] })
180
165
  ] })
181
- }
182
- );
183
- }
184
- );
185
- te.displayName = "ChatInput";
166
+ ]
167
+ }
168
+ );
169
+ };
170
+ E.displayName = "ChatMessage";
186
171
  export {
187
- te as ChatInput
172
+ E as ChatMessage
188
173
  };
package/dist/index162.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("./index157.cjs"),s=({label:t="Generating response",className:i,...n})=>a.jsx("div",{className:[e.default.message,e.default.messageAssistant,i].filter(Boolean).join(" "),role:"status","aria-live":"polite","aria-label":t,...n,children:a.jsx("div",{className:e.default.messageContent,children:a.jsx("div",{className:[e.default.messageBubble,e.default.messageBubbleAssistant,e.default.thinkingBubble].join(" "),children:a.jsx("span",{className:e.default.thinkingSpinner})})})});s.displayName="ChatTypingIndicator";exports.ChatTypingIndicator=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),o=require("lucide-react"),_=require("./index85.cjs"),$=require("./index168.cjs"),E=require("./index184.cjs"),a=require("./index158.cjs"),X=m=>m.type.startsWith("image/")?e.jsx(o.Image,{size:14}):e.jsx(o.File,{size:14}),y=l.forwardRef(({onSend:m,placeholder:R="Type a message...",allowAttachments:N=!0,allowVoiceRecording:S=!0,allowAudioUpload:G=!0,disabled:i=!1,maxLength:f,acceptedFileTypes:k=["image/*","audio/*",".pdf",".doc",".docx",".txt"],isLoading:s=!1,pendingAttachments:z,onRemoveAttachment:I,className:q,...w},r)=>{const[j,h]=l.useState(!1),u=l.useRef(null),{value:x,setValue:B,attachments:D,addAttachments:c,removeAttachment:F,handleSubmit:g,handleKeyDown:V,textareaRef:C,isEmpty:P}=_.useChatInput({maxLength:f,onSend:m,disabled:i||s}),d=z||D,M=I||F,T=l.useCallback(t=>{C.current=t,typeof r=="function"?r(t):r&&(r.current=t)},[r,C]),W=l.useCallback(t=>{const n=t.target.files;n&&n.length>0&&c(Array.from(n)),u.current&&(u.current.value="")},[c]),K=l.useCallback(t=>{const n=t.clipboardData.items,p=[];for(const v of n)if(v.type.startsWith("image/")){const A=v.getAsFile();A&&p.push(A)}p.length>0&&(t.preventDefault(),c(p))},[c]),O=l.useCallback(t=>{const n=Object.assign(t,{name:`voice-${Date.now()}.webm`,lastModified:Date.now()});c([n]),h(!1)},[c]),U=l.useCallback(()=>{i||s||g()},[i,s,g]),b=!P||d.length>0;return e.jsx("div",{className:[a.default.inputContainer,q].filter(Boolean).join(" "),children:e.jsxs("div",{className:a.default.inputWrapper,children:[d.length>0&&e.jsx("div",{className:a.default.pendingAttachments,children:d.map((t,n)=>e.jsxs("div",{className:a.default.pendingAttachment,children:[X(t),e.jsx("span",{children:t.name}),e.jsxs("span",{className:a.default.pendingAttachmentSize,children:["(",E.formatFileSize(t.size),")"]}),e.jsx("button",{className:a.default.pendingAttachmentRemove,onClick:()=>M(n),"aria-label":`Remove ${t.name}`,children:e.jsx(o.X,{size:14})})]},n))}),j&&e.jsx($.ChatVoiceRecorder,{onRecordingComplete:O,onCancel:()=>h(!1)}),!j&&e.jsxs("div",{className:a.default.inputBox,children:[N&&e.jsxs("div",{className:a.default.inputActions,children:[e.jsx("input",{ref:u,type:"file",accept:k.join(","),multiple:!0,onChange:W,style:{display:"none"},"aria-hidden":"true"}),e.jsx("button",{className:a.default.inputButton,onClick:()=>u.current?.click(),disabled:i||s,"aria-label":"Attach file",title:"Attach file",children:e.jsx(o.Paperclip,{size:20})})]}),e.jsx("textarea",{ref:T,className:a.default.inputTextarea,value:x,onChange:t=>B(t.target.value),onKeyDown:V,onPaste:K,placeholder:R,disabled:i||s,maxLength:f,rows:1,"aria-label":"Message input",...w}),e.jsxs("div",{className:a.default.inputActions,children:[S&&!x&&d.length===0&&e.jsx("button",{className:a.default.inputButton,onClick:()=>h(!0),disabled:i||s,"aria-label":"Record voice message",title:"Record voice message",children:e.jsx(o.Mic,{size:20})}),e.jsx("button",{className:[a.default.inputButton,b&&a.default.inputButtonPrimary].filter(Boolean).join(" "),onClick:U,disabled:i||s||!b,"aria-label":"Send message",title:"Send message",children:s?e.jsx("span",{className:a.default.inputSpinner}):e.jsx(o.Send,{size:20})})]})]})]})})});y.displayName="ChatInput";exports.ChatInput=y;
package/dist/index162.mjs CHANGED
@@ -1,31 +1,188 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import e from "./index157.mjs";
3
- const t = ({
4
- label: a = "Generating response",
5
- className: i,
6
- ...n
7
- }) => /* @__PURE__ */ s(
8
- "div",
9
- {
10
- className: [e.message, e.messageAssistant, i].filter(Boolean).join(" "),
11
- role: "status",
12
- "aria-live": "polite",
13
- "aria-label": a,
14
- ...n,
15
- children: /* @__PURE__ */ s("div", { className: e.messageContent, children: /* @__PURE__ */ s(
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import { forwardRef as E, useState as O, useRef as X, useCallback as r } from "react";
3
+ import { X as _, Paperclip as q, Mic as G, Send as H, Image as J, File as Q } from "lucide-react";
4
+ import { useChatInput as Y } from "./index85.mjs";
5
+ import { ChatVoiceRecorder as Z } from "./index168.mjs";
6
+ import { formatFileSize as L } from "./index184.mjs";
7
+ import n from "./index158.mjs";
8
+ const ee = (p) => p.type.startsWith("image/") ? /* @__PURE__ */ t(J, { size: 14 }) : /* @__PURE__ */ t(Q, { size: 14 }), te = E(
9
+ ({
10
+ onSend: p,
11
+ placeholder: S = "Type a message...",
12
+ allowAttachments: R = !0,
13
+ allowVoiceRecording: z = !0,
14
+ allowAudioUpload: ne = !0,
15
+ disabled: s = !1,
16
+ maxLength: f,
17
+ acceptedFileTypes: w = [
18
+ "image/*",
19
+ "audio/*",
20
+ ".pdf",
21
+ ".doc",
22
+ ".docx",
23
+ ".txt"
24
+ ],
25
+ isLoading: i = !1,
26
+ pendingAttachments: x,
27
+ onRemoveAttachment: B,
28
+ className: j,
29
+ ...k
30
+ }, o) => {
31
+ const [g, h] = O(!1), m = X(null), {
32
+ value: v,
33
+ setValue: D,
34
+ attachments: F,
35
+ addAttachments: l,
36
+ removeAttachment: I,
37
+ handleSubmit: A,
38
+ handleKeyDown: V,
39
+ textareaRef: b,
40
+ isEmpty: P
41
+ } = Y({
42
+ maxLength: f,
43
+ onSend: p,
44
+ disabled: s || i
45
+ }), u = x || F, M = B || I, W = r(
46
+ (e) => {
47
+ b.current = e, typeof o == "function" ? o(e) : o && (o.current = e);
48
+ },
49
+ [o, b]
50
+ ), K = r(
51
+ (e) => {
52
+ const a = e.target.files;
53
+ a && a.length > 0 && l(Array.from(a)), m.current && (m.current.value = "");
54
+ },
55
+ [l]
56
+ ), T = r(
57
+ (e) => {
58
+ const a = e.clipboardData.items, d = [];
59
+ for (const C of a)
60
+ if (C.type.startsWith("image/")) {
61
+ const N = C.getAsFile();
62
+ N && d.push(N);
63
+ }
64
+ d.length > 0 && (e.preventDefault(), l(d));
65
+ },
66
+ [l]
67
+ ), U = r(
68
+ (e) => {
69
+ const a = Object.assign(e, {
70
+ name: `voice-${Date.now()}.webm`,
71
+ lastModified: Date.now()
72
+ });
73
+ l([a]), h(!1);
74
+ },
75
+ [l]
76
+ ), $ = r(() => {
77
+ s || i || A();
78
+ }, [s, i, A]), y = !P || u.length > 0;
79
+ return /* @__PURE__ */ t(
16
80
  "div",
17
81
  {
18
- className: [
19
- e.messageBubble,
20
- e.messageBubbleAssistant,
21
- e.thinkingBubble
22
- ].join(" "),
23
- children: /* @__PURE__ */ s("span", { className: e.thinkingSpinner })
82
+ className: [n.inputContainer, j].filter(Boolean).join(" "),
83
+ children: /* @__PURE__ */ c("div", { className: n.inputWrapper, children: [
84
+ u.length > 0 && /* @__PURE__ */ t("div", { className: n.pendingAttachments, children: u.map((e, a) => /* @__PURE__ */ c("div", { className: n.pendingAttachment, children: [
85
+ ee(e),
86
+ /* @__PURE__ */ t("span", { children: e.name }),
87
+ /* @__PURE__ */ c("span", { className: n.pendingAttachmentSize, children: [
88
+ "(",
89
+ L(e.size),
90
+ ")"
91
+ ] }),
92
+ /* @__PURE__ */ t(
93
+ "button",
94
+ {
95
+ className: n.pendingAttachmentRemove,
96
+ onClick: () => M(a),
97
+ "aria-label": `Remove ${e.name}`,
98
+ children: /* @__PURE__ */ t(_, { size: 14 })
99
+ }
100
+ )
101
+ ] }, a)) }),
102
+ g && /* @__PURE__ */ t(
103
+ Z,
104
+ {
105
+ onRecordingComplete: U,
106
+ onCancel: () => h(!1)
107
+ }
108
+ ),
109
+ !g && /* @__PURE__ */ c("div", { className: n.inputBox, children: [
110
+ R && /* @__PURE__ */ c("div", { className: n.inputActions, children: [
111
+ /* @__PURE__ */ t(
112
+ "input",
113
+ {
114
+ ref: m,
115
+ type: "file",
116
+ accept: w.join(","),
117
+ multiple: !0,
118
+ onChange: K,
119
+ style: { display: "none" },
120
+ "aria-hidden": "true"
121
+ }
122
+ ),
123
+ /* @__PURE__ */ t(
124
+ "button",
125
+ {
126
+ className: n.inputButton,
127
+ onClick: () => m.current?.click(),
128
+ disabled: s || i,
129
+ "aria-label": "Attach file",
130
+ title: "Attach file",
131
+ children: /* @__PURE__ */ t(q, { size: 20 })
132
+ }
133
+ )
134
+ ] }),
135
+ /* @__PURE__ */ t(
136
+ "textarea",
137
+ {
138
+ ref: W,
139
+ className: n.inputTextarea,
140
+ value: v,
141
+ onChange: (e) => D(e.target.value),
142
+ onKeyDown: V,
143
+ onPaste: T,
144
+ placeholder: S,
145
+ disabled: s || i,
146
+ maxLength: f,
147
+ rows: 1,
148
+ "aria-label": "Message input",
149
+ ...k
150
+ }
151
+ ),
152
+ /* @__PURE__ */ c("div", { className: n.inputActions, children: [
153
+ z && !v && u.length === 0 && /* @__PURE__ */ t(
154
+ "button",
155
+ {
156
+ className: n.inputButton,
157
+ onClick: () => h(!0),
158
+ disabled: s || i,
159
+ "aria-label": "Record voice message",
160
+ title: "Record voice message",
161
+ children: /* @__PURE__ */ t(G, { size: 20 })
162
+ }
163
+ ),
164
+ /* @__PURE__ */ t(
165
+ "button",
166
+ {
167
+ className: [
168
+ n.inputButton,
169
+ y && n.inputButtonPrimary
170
+ ].filter(Boolean).join(" "),
171
+ onClick: $,
172
+ disabled: s || i || !y,
173
+ "aria-label": "Send message",
174
+ title: "Send message",
175
+ children: i ? /* @__PURE__ */ t("span", { className: n.inputSpinner }) : /* @__PURE__ */ t(H, { size: 20 })
176
+ }
177
+ )
178
+ ] })
179
+ ] })
180
+ ] })
24
181
  }
25
- ) })
182
+ );
26
183
  }
27
184
  );
28
- t.displayName = "ChatTypingIndicator";
185
+ te.displayName = "ChatInput";
29
186
  export {
30
- t as ChatTypingIndicator
187
+ te as ChatInput
31
188
  };
package/dist/index163.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),f=require("react-syntax-highlighter"),d=require("react-syntax-highlighter/dist/esm/styles/prism"),u=require("lucide-react"),o=require("./index157.cjs"),k=require("./index75.cjs"),b=t=>t?{js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",yml:"yaml",md:"markdown"}[t.toLowerCase()]||t.toLowerCase():"text",h=({code:t,language:s,showLineNumbers:m=!1,showCopyButton:p=!0,maxHeight:y="400px",className:C,...x})=>{const[a,r]=n.useState(!1);let c="dark";try{c=k.useThemeContext().theme}catch{}const g=n.useCallback(async()=>{try{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)}catch(l){console.error("Failed to copy code:",l)}},[t]),i=b(s),j=c==="light"?d.oneLight:d.oneDark;return e.jsxs("div",{className:[o.default.codeBlock,C].filter(Boolean).join(" "),...x,children:[e.jsxs("div",{className:o.default.codeBlockHeader,children:[e.jsx("span",{className:o.default.codeBlockLanguage,children:i}),p&&e.jsx("button",{className:[o.default.codeBlockCopy,a&&o.default.codeBlockCopied].filter(Boolean).join(" "),onClick:g,"aria-label":a?"Copied!":"Copy code",children:a?e.jsxs(e.Fragment,{children:[e.jsx(u.Check,{size:14}),"Copied!"]}):e.jsxs(e.Fragment,{children:[e.jsx(u.Copy,{size:14}),"Copy"]})})]}),e.jsx("div",{className:o.default.codeBlockContent,style:{maxHeight:y},children:e.jsx(f.Prism,{language:i,style:j,showLineNumbers:m,customStyle:{margin:0,padding:0,background:"transparent",fontSize:"inherit",lineHeight:"inherit"},codeTagProps:{style:{fontFamily:"var(--font-mono)"}},children:t})})]})};h.displayName="ChatCodeBlock";exports.ChatCodeBlock=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("./index158.cjs"),s=({label:t="Generating response",className:i,...n})=>a.jsx("div",{className:[e.default.message,e.default.messageAssistant,i].filter(Boolean).join(" "),role:"status","aria-live":"polite","aria-label":t,...n,children:a.jsx("div",{className:e.default.messageContent,children:a.jsx("div",{className:[e.default.messageBubble,e.default.messageBubbleAssistant,e.default.thinkingBubble].join(" "),children:a.jsx("span",{className:e.default.thinkingSpinner})})})});s.displayName="ChatTypingIndicator";exports.ChatTypingIndicator=s;