@orion-ds/react 5.1.13 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/AI_COMPONENTS.md +9 -2
  2. package/dist/blocks/index.cjs +1 -1
  3. package/dist/blocks/index.mjs +50 -54
  4. package/dist/blocks/sections/index.d.ts +0 -2
  5. package/dist/blocks/sections/index.d.ts.map +1 -1
  6. package/dist/blocks/templates/index.cjs +1 -1
  7. package/dist/blocks/templates/index.d.ts +0 -5
  8. package/dist/blocks/templates/index.d.ts.map +1 -1
  9. package/dist/blocks/templates/index.mjs +12 -14
  10. package/dist/blocks.css +0 -4
  11. package/dist/client.d.ts +1 -2
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/components/ThemeController/ThemeController.cjs +1 -1
  14. package/dist/components/ThemeController/ThemeController.d.ts.map +1 -1
  15. package/dist/components/ThemeController/ThemeController.mjs +19 -14
  16. package/dist/components/index.d.ts +0 -3
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/hooks/useTheme.cjs +1 -1
  19. package/dist/hooks/useTheme.d.ts +1 -1
  20. package/dist/hooks/useTheme.d.ts.map +1 -1
  21. package/dist/hooks/useTheme.mjs +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/styles.css +0 -2
  24. package/dist/tokens/types.d.ts +1 -18
  25. package/dist/tokens/types.d.ts.map +1 -1
  26. package/dist/utils/fonts.cjs +1 -1
  27. package/dist/utils/fonts.d.ts.map +1 -1
  28. package/dist/utils/fonts.mjs +1 -0
  29. package/package.json +1 -6
  30. package/dist/blocks/sections/Chat/Chat.cjs +0 -1
  31. package/dist/blocks/sections/Chat/Chat.d.ts +0 -5
  32. package/dist/blocks/sections/Chat/Chat.d.ts.map +0 -1
  33. package/dist/blocks/sections/Chat/Chat.mjs +0 -93
  34. package/dist/blocks/sections/Chat/Chat.module.css +0 -1
  35. package/dist/blocks/sections/Chat/Chat.module.css.cjs +0 -1
  36. package/dist/blocks/sections/Chat/Chat.module.css.mjs +0 -47
  37. package/dist/blocks/sections/Chat/Chat.types.d.ts +0 -33
  38. package/dist/blocks/sections/Chat/Chat.types.d.ts.map +0 -1
  39. package/dist/blocks/sections/Chat/index.d.ts +0 -3
  40. package/dist/blocks/sections/Chat/index.d.ts.map +0 -1
  41. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.cjs +0 -1
  42. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts +0 -5
  43. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts.map +0 -1
  44. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.mjs +0 -192
  45. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css +0 -1
  46. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.cjs +0 -1
  47. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.mjs +0 -81
  48. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.types.d.ts +0 -42
  49. package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.types.d.ts.map +0 -1
  50. package/dist/blocks/templates/app/ChatPageTemplate/index.d.ts +0 -3
  51. package/dist/blocks/templates/app/ChatPageTemplate/index.d.ts.map +0 -1
  52. package/dist/components/Chat/Chat.cjs +0 -1
  53. package/dist/components/Chat/Chat.d.ts +0 -22
  54. package/dist/components/Chat/Chat.d.ts.map +0 -1
  55. package/dist/components/Chat/Chat.mjs +0 -56
  56. package/dist/components/Chat/Chat.module.css +0 -1
  57. package/dist/components/Chat/Chat.module.css.cjs +0 -1
  58. package/dist/components/Chat/Chat.module.css.mjs +0 -237
  59. package/dist/components/Chat/Chat.types.d.ts +0 -387
  60. package/dist/components/Chat/Chat.types.d.ts.map +0 -1
  61. package/dist/components/Chat/components/ChatAttachment.cjs +0 -1
  62. package/dist/components/Chat/components/ChatAttachment.d.ts +0 -5
  63. package/dist/components/Chat/components/ChatAttachment.d.ts.map +0 -1
  64. package/dist/components/Chat/components/ChatAttachment.mjs +0 -125
  65. package/dist/components/Chat/components/ChatAudioPlayer.cjs +0 -1
  66. package/dist/components/Chat/components/ChatAudioPlayer.d.ts +0 -5
  67. package/dist/components/Chat/components/ChatAudioPlayer.d.ts.map +0 -1
  68. package/dist/components/Chat/components/ChatAudioPlayer.mjs +0 -127
  69. package/dist/components/Chat/components/ChatCodeBlock.cjs +0 -1
  70. package/dist/components/Chat/components/ChatCodeBlock.d.ts +0 -5
  71. package/dist/components/Chat/components/ChatCodeBlock.d.ts.map +0 -1
  72. package/dist/components/Chat/components/ChatCodeBlock.mjs +0 -93
  73. package/dist/components/Chat/components/ChatFileUpload.cjs +0 -1
  74. package/dist/components/Chat/components/ChatFileUpload.d.ts +0 -5
  75. package/dist/components/Chat/components/ChatFileUpload.d.ts.map +0 -1
  76. package/dist/components/Chat/components/ChatFileUpload.mjs +0 -114
  77. package/dist/components/Chat/components/ChatHeader.cjs +0 -1
  78. package/dist/components/Chat/components/ChatHeader.d.ts +0 -5
  79. package/dist/components/Chat/components/ChatHeader.d.ts.map +0 -1
  80. package/dist/components/Chat/components/ChatHeader.mjs +0 -36
  81. package/dist/components/Chat/components/ChatImagePreview.cjs +0 -1
  82. package/dist/components/Chat/components/ChatImagePreview.d.ts +0 -5
  83. package/dist/components/Chat/components/ChatImagePreview.d.ts.map +0 -1
  84. package/dist/components/Chat/components/ChatImagePreview.mjs +0 -69
  85. package/dist/components/Chat/components/ChatInput.cjs +0 -1
  86. package/dist/components/Chat/components/ChatInput.d.ts +0 -5
  87. package/dist/components/Chat/components/ChatInput.d.ts.map +0 -1
  88. package/dist/components/Chat/components/ChatInput.mjs +0 -188
  89. package/dist/components/Chat/components/ChatLightbox.cjs +0 -1
  90. package/dist/components/Chat/components/ChatLightbox.d.ts +0 -5
  91. package/dist/components/Chat/components/ChatLightbox.d.ts.map +0 -1
  92. package/dist/components/Chat/components/ChatLightbox.mjs +0 -57
  93. package/dist/components/Chat/components/ChatMarkdown.cjs +0 -1
  94. package/dist/components/Chat/components/ChatMarkdown.d.ts +0 -5
  95. package/dist/components/Chat/components/ChatMarkdown.d.ts.map +0 -1
  96. package/dist/components/Chat/components/ChatMarkdown.mjs +0 -70
  97. package/dist/components/Chat/components/ChatMessage.cjs +0 -1
  98. package/dist/components/Chat/components/ChatMessage.d.ts +0 -5
  99. package/dist/components/Chat/components/ChatMessage.d.ts.map +0 -1
  100. package/dist/components/Chat/components/ChatMessage.mjs +0 -173
  101. package/dist/components/Chat/components/ChatMessages.cjs +0 -1
  102. package/dist/components/Chat/components/ChatMessages.d.ts +0 -5
  103. package/dist/components/Chat/components/ChatMessages.d.ts.map +0 -1
  104. package/dist/components/Chat/components/ChatMessages.mjs +0 -46
  105. package/dist/components/Chat/components/ChatSidebar.cjs +0 -1
  106. package/dist/components/Chat/components/ChatSidebar.d.ts +0 -5
  107. package/dist/components/Chat/components/ChatSidebar.d.ts.map +0 -1
  108. package/dist/components/Chat/components/ChatSidebar.mjs +0 -217
  109. package/dist/components/Chat/components/ChatTypingIndicator.cjs +0 -1
  110. package/dist/components/Chat/components/ChatTypingIndicator.d.ts +0 -5
  111. package/dist/components/Chat/components/ChatTypingIndicator.d.ts.map +0 -1
  112. package/dist/components/Chat/components/ChatTypingIndicator.mjs +0 -31
  113. package/dist/components/Chat/components/ChatVoiceRecorder.cjs +0 -1
  114. package/dist/components/Chat/components/ChatVoiceRecorder.d.ts +0 -5
  115. package/dist/components/Chat/components/ChatVoiceRecorder.d.ts.map +0 -1
  116. package/dist/components/Chat/components/ChatVoiceRecorder.mjs +0 -111
  117. package/dist/components/Chat/components/index.d.ts +0 -18
  118. package/dist/components/Chat/components/index.d.ts.map +0 -1
  119. package/dist/components/Chat/hooks/index.d.ts +0 -12
  120. package/dist/components/Chat/hooks/index.d.ts.map +0 -1
  121. package/dist/components/Chat/hooks/useAutoScroll.cjs +0 -1
  122. package/dist/components/Chat/hooks/useAutoScroll.d.ts +0 -24
  123. package/dist/components/Chat/hooks/useAutoScroll.d.ts.map +0 -1
  124. package/dist/components/Chat/hooks/useAutoScroll.mjs +0 -50
  125. package/dist/components/Chat/hooks/useChatInput.cjs +0 -1
  126. package/dist/components/Chat/hooks/useChatInput.d.ts +0 -43
  127. package/dist/components/Chat/hooks/useChatInput.d.ts.map +0 -1
  128. package/dist/components/Chat/hooks/useChatInput.mjs +0 -44
  129. package/dist/components/Chat/hooks/useStreamingText.d.ts +0 -22
  130. package/dist/components/Chat/hooks/useStreamingText.d.ts.map +0 -1
  131. package/dist/components/Chat/hooks/useVoiceRecorder.cjs +0 -1
  132. package/dist/components/Chat/hooks/useVoiceRecorder.d.ts +0 -26
  133. package/dist/components/Chat/hooks/useVoiceRecorder.d.ts.map +0 -1
  134. package/dist/components/Chat/hooks/useVoiceRecorder.mjs +0 -74
  135. package/dist/components/Chat/index.d.ts +0 -28
  136. package/dist/components/Chat/index.d.ts.map +0 -1
  137. package/dist/components/Chat/utils.cjs +0 -1
  138. package/dist/components/Chat/utils.d.ts +0 -16
  139. package/dist/components/Chat/utils.d.ts.map +0 -1
  140. package/dist/components/Chat/utils.mjs +0 -12
  141. package/dist/rich.cjs +0 -1
  142. package/dist/rich.d.ts +0 -16
  143. package/dist/rich.d.ts.map +0 -1
  144. package/dist/rich.mjs +0 -4
@@ -1,125 +0,0 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { X as u, FileText as P, Code as w, Music as z, Image as y } from "lucide-react";
3
- import { ChatImagePreview as C } from "./ChatImagePreview.mjs";
4
- import { ChatAudioPlayer as N } from "./ChatAudioPlayer.mjs";
5
- import { ChatCodeBlock as I } from "./ChatCodeBlock.mjs";
6
- import { formatFileSize as k } from "../utils.mjs";
7
- import t from "../Chat.module.css.mjs";
8
- const x = (d) => {
9
- switch (d) {
10
- case "image":
11
- return /* @__PURE__ */ e(y, { size: 18 });
12
- case "audio":
13
- return /* @__PURE__ */ e(z, { size: 18 });
14
- case "code":
15
- return /* @__PURE__ */ e(w, { size: 18 });
16
- default:
17
- return /* @__PURE__ */ e(P, { size: 18 });
18
- }
19
- }, $ = ({
20
- attachment: d,
21
- removable: h = !1,
22
- onRemove: a,
23
- onClick: n,
24
- className: s,
25
- ...c
26
- }) => {
27
- const { type: p, name: i, url: l, content: v, language: b, size: f, duration: m, thumbnail: g } = d;
28
- switch (p) {
29
- case "image":
30
- if (l)
31
- return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
32
- /* @__PURE__ */ e(
33
- C,
34
- {
35
- src: l,
36
- alt: i,
37
- thumbnail: g,
38
- onClick: n
39
- }
40
- ),
41
- h && a && /* @__PURE__ */ e(
42
- "button",
43
- {
44
- className: t.attachmentPreviewRemove,
45
- onClick: (r) => {
46
- r.stopPropagation(), a();
47
- },
48
- "aria-label": `Remove ${i}`,
49
- style: {
50
- position: "absolute",
51
- top: 4,
52
- right: 4,
53
- background: "var(--surface-base)"
54
- },
55
- children: /* @__PURE__ */ e(u, { size: 14 })
56
- }
57
- )
58
- ] });
59
- break;
60
- case "audio":
61
- if (l)
62
- return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
63
- /* @__PURE__ */ e(N, { src: l, duration: m, title: i }),
64
- h && a && /* @__PURE__ */ e(
65
- "button",
66
- {
67
- className: t.attachmentPreviewRemove,
68
- onClick: (r) => {
69
- r.stopPropagation(), a();
70
- },
71
- "aria-label": `Remove ${i}`,
72
- children: /* @__PURE__ */ e(u, { size: 14 })
73
- }
74
- )
75
- ] });
76
- break;
77
- case "code":
78
- if (v)
79
- return /* @__PURE__ */ e(
80
- I,
81
- {
82
- code: v,
83
- language: b,
84
- className: s,
85
- ...c
86
- }
87
- );
88
- break;
89
- }
90
- return /* @__PURE__ */ o(
91
- "div",
92
- {
93
- className: [t.attachmentPreview, s].filter(Boolean).join(" "),
94
- onClick: n,
95
- role: n ? "button" : void 0,
96
- tabIndex: n ? 0 : void 0,
97
- ...c,
98
- children: [
99
- /* @__PURE__ */ e("div", { className: t.attachmentPreviewIcon, children: x(p) }),
100
- /* @__PURE__ */ o("div", { className: t.attachmentPreviewInfo, children: [
101
- /* @__PURE__ */ e("span", { className: t.attachmentPreviewName, children: i }),
102
- f && /* @__PURE__ */ o("span", { className: t.attachmentPreviewMeta, children: [
103
- k(f),
104
- m && ` · ${Math.floor(m / 60)}:${(m % 60).toString().padStart(2, "0")}`
105
- ] })
106
- ] }),
107
- h && a && /* @__PURE__ */ e(
108
- "button",
109
- {
110
- className: t.attachmentPreviewRemove,
111
- onClick: (r) => {
112
- r.stopPropagation(), a();
113
- },
114
- "aria-label": `Remove ${i}`,
115
- children: /* @__PURE__ */ e(u, { size: 14 })
116
- }
117
- )
118
- ]
119
- }
120
- );
121
- };
122
- $.displayName = "ChatAttachment";
123
- export {
124
- $ as ChatAttachment
125
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),P=require("lucide-react"),m=require("../utils.cjs"),l=require("../Chat.module.css.cjs"),p=({src:k,duration:T,title:h,className:b,...x})=>{const[o,f]=r.useState(!1),[s,d]=r.useState(0),[a,g]=r.useState(T||0),n=r.useRef(null),j=r.useCallback(()=>{const e=n.current;e&&!isNaN(e.duration)&&isFinite(e.duration)&&g(e.duration)},[]),v=r.useCallback(()=>{const e=n.current;e&&d(e.currentTime)},[]),C=r.useCallback(()=>{f(!1),d(0)},[]),w=r.useCallback(()=>{const e=n.current;e&&(o?e.pause():e.play().catch(()=>{f(!1)}),f(!o))},[o]),N=r.useCallback(e=>{const c=n.current;if(!c||!a)return;const u=e.currentTarget.getBoundingClientRect(),y=(e.clientX-u.left)/u.width*a;c.currentTime=y,d(y)},[a]),A=r.useCallback(e=>{const c=n.current;if(!c||!a)return;const u=5;let i=s;switch(e.key){case"ArrowRight":case"ArrowUp":e.preventDefault(),i=Math.min(s+u,a);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),i=Math.max(s-u,0);break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=a;break;default:return}c.currentTime=i,d(i)},[s,a]),D=a>0?s/a*100:0;return r.useEffect(()=>()=>{const e=n.current;e&&e.pause()},[]),t.jsxs("div",{className:[l.default.audioPlayer,b].filter(Boolean).join(" "),...x,children:[t.jsx("audio",{ref:n,src:k,onLoadedMetadata:j,onTimeUpdate:v,onEnded:C,preload:"metadata"}),t.jsx("button",{className:l.default.audioPlayerButton,onClick:w,"aria-label":o?"Pause":"Play",children:o?t.jsx(P.Pause,{size:16}):t.jsx(P.Play,{size:16})}),t.jsxs("div",{className:l.default.audioPlayerProgress,children:[h&&t.jsx("span",{className:l.default.attachmentPreviewName,children:h}),t.jsx("div",{className:l.default.audioPlayerTrack,onClick:N,onKeyDown:A,role:"slider","aria-label":"Audio progress","aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":s,"aria-valuetext":`${m.formatTime(s)} of ${m.formatTime(a)}`,tabIndex:0,children:t.jsx("div",{className:l.default.audioPlayerFill,style:{width:`${D}%`}})}),t.jsxs("div",{className:l.default.audioPlayerTime,children:[t.jsx("span",{children:m.formatTime(s)}),t.jsx("span",{children:m.formatTime(a)})]})]})]})};p.displayName="ChatAudioPlayer";exports.ChatAudioPlayer=p;
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatAudioPlayerProps } from '../Chat.types';
3
-
4
- export declare const ChatAudioPlayer: React.FC<ChatAudioPlayerProps>;
5
- //# sourceMappingURL=ChatAudioPlayer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatAudioPlayer.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatAudioPlayer.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsK1D,CAAC"}
@@ -1,127 +0,0 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { useState as h, useRef as M, useCallback as s, useEffect as R } from "react";
3
- import { Pause as j, Play as B } from "lucide-react";
4
- import { formatTime as m } from "../utils.mjs";
5
- import o from "../Chat.module.css.mjs";
6
- const L = ({
7
- src: g,
8
- duration: v,
9
- title: y,
10
- className: w,
11
- ...T
12
- }) => {
13
- const [c, f] = h(!1), [t, u] = h(0), [a, k] = h(v || 0), n = M(null), N = s(() => {
14
- const e = n.current;
15
- e && !isNaN(e.duration) && isFinite(e.duration) && k(e.duration);
16
- }, []), b = s(() => {
17
- const e = n.current;
18
- e && u(e.currentTime);
19
- }, []), C = s(() => {
20
- f(!1), u(0);
21
- }, []), D = s(() => {
22
- const e = n.current;
23
- e && (c ? e.pause() : e.play().catch(() => {
24
- f(!1);
25
- }), f(!c));
26
- }, [c]), x = s(
27
- (e) => {
28
- const l = n.current;
29
- if (!l || !a) return;
30
- const d = e.currentTarget.getBoundingClientRect(), P = (e.clientX - d.left) / d.width * a;
31
- l.currentTime = P, u(P);
32
- },
33
- [a]
34
- ), A = s(
35
- (e) => {
36
- const l = n.current;
37
- if (!l || !a) return;
38
- const d = 5;
39
- let i = t;
40
- switch (e.key) {
41
- case "ArrowRight":
42
- case "ArrowUp":
43
- e.preventDefault(), i = Math.min(t + d, a);
44
- break;
45
- case "ArrowLeft":
46
- case "ArrowDown":
47
- e.preventDefault(), i = Math.max(t - d, 0);
48
- break;
49
- case "Home":
50
- e.preventDefault(), i = 0;
51
- break;
52
- case "End":
53
- e.preventDefault(), i = a;
54
- break;
55
- default:
56
- return;
57
- }
58
- l.currentTime = i, u(i);
59
- },
60
- [t, a]
61
- ), E = a > 0 ? t / a * 100 : 0;
62
- return R(() => () => {
63
- const e = n.current;
64
- e && e.pause();
65
- }, []), /* @__PURE__ */ p(
66
- "div",
67
- {
68
- className: [o.audioPlayer, w].filter(Boolean).join(" "),
69
- ...T,
70
- children: [
71
- /* @__PURE__ */ r(
72
- "audio",
73
- {
74
- ref: n,
75
- src: g,
76
- onLoadedMetadata: N,
77
- onTimeUpdate: b,
78
- onEnded: C,
79
- preload: "metadata"
80
- }
81
- ),
82
- /* @__PURE__ */ r(
83
- "button",
84
- {
85
- className: o.audioPlayerButton,
86
- onClick: D,
87
- "aria-label": c ? "Pause" : "Play",
88
- children: c ? /* @__PURE__ */ r(j, { size: 16 }) : /* @__PURE__ */ r(B, { size: 16 })
89
- }
90
- ),
91
- /* @__PURE__ */ p("div", { className: o.audioPlayerProgress, children: [
92
- y && /* @__PURE__ */ r("span", { className: o.attachmentPreviewName, children: y }),
93
- /* @__PURE__ */ r(
94
- "div",
95
- {
96
- className: o.audioPlayerTrack,
97
- onClick: x,
98
- onKeyDown: A,
99
- role: "slider",
100
- "aria-label": "Audio progress",
101
- "aria-valuemin": 0,
102
- "aria-valuemax": a,
103
- "aria-valuenow": t,
104
- "aria-valuetext": `${m(t)} of ${m(a)}`,
105
- tabIndex: 0,
106
- children: /* @__PURE__ */ r(
107
- "div",
108
- {
109
- className: o.audioPlayerFill,
110
- style: { width: `${E}%` }
111
- }
112
- )
113
- }
114
- ),
115
- /* @__PURE__ */ p("div", { className: o.audioPlayerTime, children: [
116
- /* @__PURE__ */ r("span", { children: m(t) }),
117
- /* @__PURE__ */ r("span", { children: m(a) })
118
- ] })
119
- ] })
120
- ]
121
- }
122
- );
123
- };
124
- L.displayName = "ChatAudioPlayer";
125
- export {
126
- L as ChatAudioPlayer
127
- };
@@ -1 +0,0 @@
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("../Chat.module.css.cjs"),k=require("../../../contexts/ThemeContext.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,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatCodeBlockProps } from '../Chat.types';
3
-
4
- export declare const ChatCodeBlock: React.FC<ChatCodeBlockProps>;
5
- //# sourceMappingURL=ChatCodeBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatCodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatCodeBlock.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAOrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAwBxD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwFtD,CAAC"}
@@ -1,93 +0,0 @@
1
- import { jsxs as r, jsx as o, Fragment as d } from "react/jsx-runtime";
2
- import { useState as g, useCallback as k } from "react";
3
- import { Prism as x } from "react-syntax-highlighter";
4
- import { oneLight as B, oneDark as b } from "react-syntax-highlighter/dist/esm/styles/prism";
5
- import { Check as j, Copy as v } from "lucide-react";
6
- import t from "../Chat.module.css.mjs";
7
- import { useThemeContext as L } from "../../../contexts/ThemeContext.mjs";
8
- const N = (e) => e ? {
9
- js: "javascript",
10
- ts: "typescript",
11
- jsx: "jsx",
12
- tsx: "tsx",
13
- py: "python",
14
- rb: "ruby",
15
- sh: "bash",
16
- shell: "bash",
17
- yml: "yaml",
18
- md: "markdown"
19
- }[e.toLowerCase()] || e.toLowerCase() : "text", w = ({
20
- code: e,
21
- language: s,
22
- showLineNumbers: m = !1,
23
- showCopyButton: p = !0,
24
- maxHeight: h = "400px",
25
- className: y,
26
- ...C
27
- }) => {
28
- const [a, i] = g(!1);
29
- let l = "dark";
30
- try {
31
- l = L().theme;
32
- } catch {
33
- }
34
- const u = k(async () => {
35
- try {
36
- await navigator.clipboard.writeText(e), i(!0), setTimeout(() => i(!1), 2e3);
37
- } catch (n) {
38
- console.error("Failed to copy code:", n);
39
- }
40
- }, [e]), c = N(s), f = l === "light" ? B : b;
41
- return /* @__PURE__ */ r(
42
- "div",
43
- {
44
- className: [t.codeBlock, y].filter(Boolean).join(" "),
45
- ...C,
46
- children: [
47
- /* @__PURE__ */ r("div", { className: t.codeBlockHeader, children: [
48
- /* @__PURE__ */ o("span", { className: t.codeBlockLanguage, children: c }),
49
- p && /* @__PURE__ */ o(
50
- "button",
51
- {
52
- className: [t.codeBlockCopy, a && t.codeBlockCopied].filter(Boolean).join(" "),
53
- onClick: u,
54
- "aria-label": a ? "Copied!" : "Copy code",
55
- children: a ? /* @__PURE__ */ r(d, { children: [
56
- /* @__PURE__ */ o(j, { size: 14 }),
57
- "Copied!"
58
- ] }) : /* @__PURE__ */ r(d, { children: [
59
- /* @__PURE__ */ o(v, { size: 14 }),
60
- "Copy"
61
- ] })
62
- }
63
- )
64
- ] }),
65
- /* @__PURE__ */ o("div", { className: t.codeBlockContent, style: { maxHeight: h }, children: /* @__PURE__ */ o(
66
- x,
67
- {
68
- language: c,
69
- style: f,
70
- showLineNumbers: m,
71
- customStyle: {
72
- margin: 0,
73
- padding: 0,
74
- background: "transparent",
75
- fontSize: "inherit",
76
- lineHeight: "inherit"
77
- },
78
- codeTagProps: {
79
- style: {
80
- fontFamily: "var(--font-mono)"
81
- }
82
- },
83
- children: e
84
- }
85
- ) })
86
- ]
87
- }
88
- );
89
- };
90
- w.displayName = "ChatCodeBlock";
91
- export {
92
- w as ChatCodeBlock
93
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),R=require("lucide-react"),h=require("../utils.cjs"),o=require("../Chat.module.css.cjs"),g=({onFilesSelected:f,accept:i=["*/*"],multiple:C=!0,maxSize:s=10*1024*1024,children:v,className:D,...k})=>{const[m,u]=t.useState(!1),c=t.useRef(null),d=t.useCallback(e=>{if(!e||e.length===0)return;const r=[];Array.from(e).forEach(l=>{if(s&&l.size>s){console.warn(`File ${l.name} exceeds max size of ${h.formatFileSize(s)}`);return}const F=i.includes("*/*"),q=i.flatMap(n=>(n.endsWith("/*"),n));if(!(F||q.some(n=>{if(n.endsWith("/*")){const N=n.split("/")[0];return l.type.startsWith(`${N}/`)}return l.type===n||l.name.endsWith(n)}))){console.warn(`File ${l.name} type not accepted`);return}r.push(l)}),r.length>0&&f?.(r)},[i,s,f]),b=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!0)},[]),j=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!1)},[]),y=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!1);const{files:r}=e.dataTransfer;d(r)},[d]),x=t.useCallback(e=>{d(e.target.files),c.current&&(c.current.value="")},[d]),p=t.useCallback(()=>{c.current?.click()},[]),U=t.useCallback(e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),p())},[p]);return a.jsxs("div",{className:[o.default.fileUpload,m&&o.default.fileUploadDragging,D].filter(Boolean).join(" "),onDragOver:b,onDragLeave:j,onDrop:y,onClick:p,onKeyDown:U,role:"button",tabIndex:0,"aria-label":"Upload files",...k,children:[a.jsx("input",{ref:c,type:"file",accept:i.join(","),multiple:C,onChange:x,style:{display:"none"},"aria-hidden":"true"}),v||a.jsxs(a.Fragment,{children:[a.jsx("div",{className:o.default.fileUploadIcon,children:a.jsx(R.Upload,{size:32})}),a.jsxs("div",{className:o.default.fileUploadText,children:[a.jsx("strong",{children:"Click to upload"})," or drag and drop"]}),a.jsxs("div",{className:o.default.fileUploadHint,children:["Max file size: ",h.formatFileSize(s)]})]})]})};g.displayName="ChatFileUpload";exports.ChatFileUpload=g;
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatFileUploadProps } from '../Chat.types';
3
-
4
- export declare const ChatFileUpload: React.FC<ChatFileUploadProps>;
5
- //# sourceMappingURL=ChatFileUpload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatFileUpload.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatFileUpload.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIzD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+JxD,CAAC"}
@@ -1,114 +0,0 @@
1
- import { jsxs as d, jsx as p, Fragment as A } from "react/jsx-runtime";
2
- import { useState as I, useRef as W, useCallback as a } from "react";
3
- import { Upload as $ } from "lucide-react";
4
- import { formatFileSize as g } from "../utils.mjs";
5
- import l from "../Chat.module.css.mjs";
6
- const P = ({
7
- onFilesSelected: h,
8
- accept: s = ["*/*"],
9
- multiple: m = !0,
10
- maxSize: r = 10 * 1024 * 1024,
11
- // 10MB default
12
- children: D,
13
- className: v,
14
- ...y
15
- }) => {
16
- const [U, f] = I(!1), i = W(null), c = a(
17
- (e) => {
18
- if (!e || e.length === 0) return;
19
- const o = [];
20
- Array.from(e).forEach((t) => {
21
- if (r && t.size > r) {
22
- console.warn(
23
- `File ${t.name} exceeds max size of ${g(r)}`
24
- );
25
- return;
26
- }
27
- const j = s.includes("*/*"), w = s.flatMap((n) => (n.endsWith("/*"), n));
28
- if (!(j || w.some((n) => {
29
- if (n.endsWith("/*")) {
30
- const x = n.split("/")[0];
31
- return t.type.startsWith(`${x}/`);
32
- }
33
- return t.type === n || t.name.endsWith(n);
34
- }))) {
35
- console.warn(`File ${t.name} type not accepted`);
36
- return;
37
- }
38
- o.push(t);
39
- }), o.length > 0 && h?.(o);
40
- },
41
- [s, r, h]
42
- ), C = a((e) => {
43
- e.preventDefault(), e.stopPropagation(), f(!0);
44
- }, []), k = a((e) => {
45
- e.preventDefault(), e.stopPropagation(), f(!1);
46
- }, []), F = a(
47
- (e) => {
48
- e.preventDefault(), e.stopPropagation(), f(!1);
49
- const { files: o } = e.dataTransfer;
50
- c(o);
51
- },
52
- [c]
53
- ), N = a(
54
- (e) => {
55
- c(e.target.files), i.current && (i.current.value = "");
56
- },
57
- [c]
58
- ), u = a(() => {
59
- i.current?.click();
60
- }, []), b = a(
61
- (e) => {
62
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
63
- },
64
- [u]
65
- );
66
- return /* @__PURE__ */ d(
67
- "div",
68
- {
69
- className: [
70
- l.fileUpload,
71
- U && l.fileUploadDragging,
72
- v
73
- ].filter(Boolean).join(" "),
74
- onDragOver: C,
75
- onDragLeave: k,
76
- onDrop: F,
77
- onClick: u,
78
- onKeyDown: b,
79
- role: "button",
80
- tabIndex: 0,
81
- "aria-label": "Upload files",
82
- ...y,
83
- children: [
84
- /* @__PURE__ */ p(
85
- "input",
86
- {
87
- ref: i,
88
- type: "file",
89
- accept: s.join(","),
90
- multiple: m,
91
- onChange: N,
92
- style: { display: "none" },
93
- "aria-hidden": "true"
94
- }
95
- ),
96
- D || /* @__PURE__ */ d(A, { children: [
97
- /* @__PURE__ */ p("div", { className: l.fileUploadIcon, children: /* @__PURE__ */ p($, { size: 32 }) }),
98
- /* @__PURE__ */ d("div", { className: l.fileUploadText, children: [
99
- /* @__PURE__ */ p("strong", { children: "Click to upload" }),
100
- " or drag and drop"
101
- ] }),
102
- /* @__PURE__ */ d("div", { className: l.fileUploadHint, children: [
103
- "Max file size: ",
104
- g(r)
105
- ] })
106
- ] })
107
- ]
108
- }
109
- );
110
- };
111
- P.displayName = "ChatFileUpload";
112
- export {
113
- P as ChatFileUpload
114
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("lucide-react"),a=require("../Chat.module.css.cjs"),d=({title:r="AI Assistant",subtitle:s,avatar:l,actions:t,children:i,className:n,...c})=>e.jsxs("div",{className:[a.default.header,n].filter(Boolean).join(" "),...c,children:[e.jsx("div",{className:a.default.headerAvatar,children:l||e.jsx("div",{className:[a.default.messageAvatar,a.default.headerAvatarDefault].filter(Boolean).join(" "),children:e.jsx(h.Bot,{size:20})})}),e.jsx("div",{className:a.default.headerContent,children:i||e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:a.default.headerTitle,children:r}),s&&e.jsx("p",{className:a.default.headerSubtitle,children:s})]})}),t&&e.jsx("div",{className:a.default.headerActions,children:t})]});d.displayName="ChatHeader";exports.ChatHeader=d;
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatHeaderProps } from '../Chat.types';
3
-
4
- export declare const ChatHeader: React.FC<ChatHeaderProps>;
5
- //# sourceMappingURL=ChatHeader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatHeader.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyChD,CAAC"}
@@ -1,36 +0,0 @@
1
- import { jsxs as i, jsx as a, Fragment as c } from "react/jsx-runtime";
2
- import { Bot as m } from "lucide-react";
3
- import e from "../Chat.module.css.mjs";
4
- const o = ({
5
- title: d = "AI Assistant",
6
- subtitle: r,
7
- avatar: l,
8
- actions: s,
9
- children: t,
10
- className: h,
11
- ...n
12
- }) => /* @__PURE__ */ i(
13
- "div",
14
- {
15
- className: [e.header, h].filter(Boolean).join(" "),
16
- ...n,
17
- children: [
18
- /* @__PURE__ */ a("div", { className: e.headerAvatar, children: l || /* @__PURE__ */ a(
19
- "div",
20
- {
21
- className: [e.messageAvatar, e.headerAvatarDefault].filter(Boolean).join(" "),
22
- children: /* @__PURE__ */ a(m, { size: 20 })
23
- }
24
- ) }),
25
- /* @__PURE__ */ a("div", { className: e.headerContent, children: t || /* @__PURE__ */ i(c, { children: [
26
- /* @__PURE__ */ a("h2", { className: e.headerTitle, children: d }),
27
- r && /* @__PURE__ */ a("p", { className: e.headerSubtitle, children: r })
28
- ] }) }),
29
- s && /* @__PURE__ */ a("div", { className: e.headerActions, children: s })
30
- ]
31
- }
32
- );
33
- o.displayName = "ChatHeader";
34
- export {
35
- o as ChatHeader
36
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),I=require("lucide-react"),a=require("../Chat.module.css.cjs"),w=require("./ChatLightbox.cjs"),u=({src:i,alt:t="Image attachment",thumbnail:g,onClick:n,enableLightbox:s=!0,className:o,...l})=>{const[h,c]=d.useState(!1),[f,v]=d.useState(!1),m=()=>{n?n():s&&c(!0)},x=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),m())},j=()=>{v(!0)};return f?e.jsxs("div",{className:[a.default.imagePreview,a.default.attachmentPreview,o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:a.default.attachmentPreviewIcon,children:e.jsx(I.ImageOff,{size:20})}),e.jsx("span",{className:a.default.attachmentPreviewName,children:"Image failed to load"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:[a.default.imagePreview,o].filter(Boolean).join(" "),onClick:m,onKeyDown:x,role:"button",tabIndex:0,"aria-label":t,...l,children:e.jsx("img",{src:g||i,alt:t,className:a.default.imagePreviewImg,onError:j,loading:"lazy"})}),s&&e.jsx(w.ChatLightbox,{src:i,alt:t,isOpen:h,onClose:()=>c(!1)})]})};u.displayName="ChatImagePreview";exports.ChatImagePreview=u;
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatImagePreviewProps } from '../Chat.types';
3
-
4
- export declare const ChatImagePreview: React.FC<ChatImagePreviewProps>;
5
- //# sourceMappingURL=ChatImagePreview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatImagePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatImagePreview.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAI3D,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+E5D,CAAC"}
@@ -1,69 +0,0 @@
1
- import { jsxs as f, jsx as e, Fragment as u } from "react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { ImageOff as P } from "lucide-react";
4
- import a from "../Chat.module.css.mjs";
5
- import { ChatLightbox as y } from "./ChatLightbox.mjs";
6
- const x = ({
7
- src: i,
8
- alt: r = "Image attachment",
9
- thumbnail: h,
10
- onClick: o,
11
- enableLightbox: n = !0,
12
- className: m,
13
- ...s
14
- }) => {
15
- const [d, l] = g(!1), [p, v] = g(!1), c = () => {
16
- o ? o() : n && l(!0);
17
- }, I = (t) => {
18
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), c());
19
- }, w = () => {
20
- v(!0);
21
- };
22
- return p ? /* @__PURE__ */ f(
23
- "div",
24
- {
25
- className: [a.imagePreview, a.attachmentPreview, m].filter(Boolean).join(" "),
26
- ...s,
27
- children: [
28
- /* @__PURE__ */ e("div", { className: a.attachmentPreviewIcon, children: /* @__PURE__ */ e(P, { size: 20 }) }),
29
- /* @__PURE__ */ e("span", { className: a.attachmentPreviewName, children: "Image failed to load" })
30
- ]
31
- }
32
- ) : /* @__PURE__ */ f(u, { children: [
33
- /* @__PURE__ */ e(
34
- "div",
35
- {
36
- className: [a.imagePreview, m].filter(Boolean).join(" "),
37
- onClick: c,
38
- onKeyDown: I,
39
- role: "button",
40
- tabIndex: 0,
41
- "aria-label": r,
42
- ...s,
43
- children: /* @__PURE__ */ e(
44
- "img",
45
- {
46
- src: h || i,
47
- alt: r,
48
- className: a.imagePreviewImg,
49
- onError: w,
50
- loading: "lazy"
51
- }
52
- )
53
- }
54
- ),
55
- n && /* @__PURE__ */ e(
56
- y,
57
- {
58
- src: i,
59
- alt: r,
60
- isOpen: d,
61
- onClose: () => l(!1)
62
- }
63
- )
64
- ] });
65
- };
66
- x.displayName = "ChatImagePreview";
67
- export {
68
- x as ChatImagePreview
69
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),o=require("lucide-react"),_=require("../hooks/useChatInput.cjs"),$=require("./ChatVoiceRecorder.cjs"),E=require("../utils.cjs"),a=require("../Chat.module.css.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,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChatInputProps } from '../Chat.types';
3
-
4
- export declare const ChatInput: React.ForwardRefExoticComponent<ChatInputProps & React.RefAttributes<HTMLTextAreaElement>>;
5
- //# sourceMappingURL=ChatInput.d.ts.map