@agentiffai/design 0.1.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.
- package/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +187 -0
- package/assets/layout/main-pane-section.png +0 -0
- package/assets/layout/nav-complete.png +0 -0
- package/assets/layout/nav-horizontal-section.png +0 -0
- package/assets/layout/nav-vertical-section.png +0 -0
- package/assets/layout/pane-section-dropdowns.png +0 -0
- package/assets/layout/pane-section-header.png +0 -0
- package/dist/Window-B6e_UfLV.d.ts +429 -0
- package/dist/Window-CgGFIYHS.d.cts +429 -0
- package/dist/chunk-CNVJ5UF2.js +2069 -0
- package/dist/chunk-CNVJ5UF2.js.map +1 -0
- package/dist/chunk-CVHHTWDQ.cjs +72 -0
- package/dist/chunk-CVHHTWDQ.cjs.map +1 -0
- package/dist/chunk-H4VHCHCP.cjs +1268 -0
- package/dist/chunk-H4VHCHCP.cjs.map +1 -0
- package/dist/chunk-JQ6Q7MDQ.js +67 -0
- package/dist/chunk-JQ6Q7MDQ.js.map +1 -0
- package/dist/chunk-KNSPBTTJ.cjs +2158 -0
- package/dist/chunk-KNSPBTTJ.cjs.map +1 -0
- package/dist/chunk-MNXQDDWP.js +2143 -0
- package/dist/chunk-MNXQDDWP.js.map +1 -0
- package/dist/chunk-P4Q3MHIY.cjs +2093 -0
- package/dist/chunk-P4Q3MHIY.cjs.map +1 -0
- package/dist/chunk-PAOXD7DF.js +1253 -0
- package/dist/chunk-PAOXD7DF.js.map +1 -0
- package/dist/copilotkit/index.cjs +611 -0
- package/dist/copilotkit/index.cjs.map +1 -0
- package/dist/copilotkit/index.d.cts +162 -0
- package/dist/copilotkit/index.d.ts +162 -0
- package/dist/copilotkit/index.js +538 -0
- package/dist/copilotkit/index.js.map +1 -0
- package/dist/icons/index.cjs +48 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +375 -0
- package/dist/icons/index.d.ts +375 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +536 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d-DYU1eVeb.d.cts +252 -0
- package/dist/index.d-DYU1eVeb.d.ts +252 -0
- package/dist/index.d.cts +185 -0
- package/dist/index.d.ts +185 -0
- package/dist/index.js +358 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.cjs +48 -0
- package/dist/layout/index.cjs.map +1 -0
- package/dist/layout/index.d.cts +206 -0
- package/dist/layout/index.d.ts +206 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/theme/index.cjs +24 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +95 -0
- package/dist/theme/index.d.ts +95 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +148 -0
- package/public/assets/bg-set/brand-logos/Google.svg +1 -0
- package/public/assets/bg-set/brand-logos/Google2.svg +1 -0
- package/public/assets/bg-set/brand-logos/Microsoft.svg +1 -0
- package/public/assets/bg-set/brand-logos/Microsoft2.svg +1 -0
- package/public/assets/bg-set/brand-logos/Slack.svg +1 -0
- package/public/assets/bg-set/brand-logos/Slack2.svg +1 -0
- package/public/assets/bg-set/brand-logos/YouTube.svg +1 -0
- package/public/assets/bg-set/brand-logos/YouTube2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=lg, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=md, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=sm, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=xl, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=xs, Type=Waves Rays2.svg +1 -0
- package/public/assets/icon-set/Icon-add-circle-fill.svg +1 -0
- package/public/assets/icon-set/Icon-calendar-fill.svg +1 -0
- package/public/assets/icon-set/Icon-chat-1-fill.svg +1 -0
- package/public/assets/icon-set/Icon-download-2-fill.svg +1 -0
- package/public/assets/icon-set/Icon-home-fill.svg +1 -0
- package/public/assets/icon-set/Icon-mic-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-3-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-line.svg +1 -0
|
@@ -0,0 +1,2093 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var styled7 = require('styled-components');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var button = require('@react-aria/button');
|
|
7
|
+
var textfield = require('@react-aria/textfield');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styled7__default = /*#__PURE__*/_interopDefault(styled7);
|
|
12
|
+
|
|
13
|
+
// src/components/AssistantThinking/AssistantThinking.tsx
|
|
14
|
+
var dotPulse = styled7.keyframes`
|
|
15
|
+
0%, 100% {
|
|
16
|
+
opacity: 0.3;
|
|
17
|
+
transform: scale(0.8);
|
|
18
|
+
}
|
|
19
|
+
50% {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transform: scale(1);
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
var Container = styled7__default.default.div`
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 12px;
|
|
28
|
+
padding: 12px 16px;
|
|
29
|
+
background-color: #2c2c2e;
|
|
30
|
+
border-radius: 16px;
|
|
31
|
+
box-shadow: none;
|
|
32
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
33
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
34
|
+
max-width: fit-content;
|
|
35
|
+
margin: 0 auto;
|
|
36
|
+
`;
|
|
37
|
+
var Avatar = styled7__default.default.div`
|
|
38
|
+
width: 40px;
|
|
39
|
+
height: 40px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
|
|
47
|
+
`;
|
|
48
|
+
var HeadphonesIcon = styled7__default.default.svg`
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
color: #FFFFFF;
|
|
52
|
+
`;
|
|
53
|
+
var Content = styled7__default.default.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
`;
|
|
58
|
+
var LoadingDots = styled7__default.default.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 4px;
|
|
62
|
+
padding: 0 4px;
|
|
63
|
+
`;
|
|
64
|
+
var Dot = styled7__default.default.span`
|
|
65
|
+
width: 6px;
|
|
66
|
+
height: 6px;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
background-color: #8e8e93;
|
|
69
|
+
animation: ${dotPulse} 1.4s ease-in-out infinite;
|
|
70
|
+
`;
|
|
71
|
+
var Message = styled7__default.default.span`
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
color: #e5e5e7;
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
line-height: 1.5;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
`;
|
|
78
|
+
function AssistantThinking({
|
|
79
|
+
message = "Analyzing data, please wait...",
|
|
80
|
+
className,
|
|
81
|
+
ariaLabel = "Assistant is thinking"
|
|
82
|
+
}) {
|
|
83
|
+
const containerRef = react.useRef(null);
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85
|
+
Container,
|
|
86
|
+
{
|
|
87
|
+
ref: containerRef,
|
|
88
|
+
className,
|
|
89
|
+
role: "status",
|
|
90
|
+
"aria-live": "polite",
|
|
91
|
+
"aria-label": ariaLabel,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(HeadphonesIcon, { viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 13a4 4 0 0 1 0 8c-2.142 0-4-1.79-4-4h-2a4 4 0 1 1-.535-2h3.07A4 4 0 0 1 17 13M2 12v-2h2V7a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v3h2v2z" }) }) }),
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Content, { children: [
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsxs(LoadingDots, { "aria-hidden": "true", children: [
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot, { style: { animationDelay: "0ms" } }),
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot, { style: { animationDelay: "150ms" } }),
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot, { style: { animationDelay: "300ms" } })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(Message, { children: message })
|
|
101
|
+
] })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
AssistantThinking.displayName = "AssistantThinking";
|
|
107
|
+
var ChatInputContainer = styled7__default.default.div`
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
width: 100%;
|
|
111
|
+
padding: 8px;
|
|
112
|
+
background: transparent;
|
|
113
|
+
border-radius: 0;
|
|
114
|
+
box-shadow: none;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
|
|
117
|
+
@media (min-width: 640px) {
|
|
118
|
+
padding: 12px;
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
var SuggestionsWrapper = styled7__default.default.div`
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: row;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
gap: 8px;
|
|
126
|
+
margin-bottom: 12px;
|
|
127
|
+
width: 100%;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
`;
|
|
130
|
+
var SuggestionButton = styled7__default.default.button`
|
|
131
|
+
padding: 8px 16px;
|
|
132
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
133
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
134
|
+
font-size: 13px;
|
|
135
|
+
font-weight: 400;
|
|
136
|
+
text-align: center;
|
|
137
|
+
border: 1px solid #3a3a3c;
|
|
138
|
+
border-radius: 20px;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
transition: all 0.15s ease;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
|
|
143
|
+
/* Dark theme colors */
|
|
144
|
+
background-color: #2c2c2e;
|
|
145
|
+
color: #e5e5e7;
|
|
146
|
+
|
|
147
|
+
/* Hover state */
|
|
148
|
+
&:hover:not(:disabled) {
|
|
149
|
+
background-color: #3a3a3c;
|
|
150
|
+
border-color: #48484a;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Active state */
|
|
154
|
+
&:active:not(:disabled) {
|
|
155
|
+
background-color: #48484a;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Focus state */
|
|
159
|
+
&:focus-visible {
|
|
160
|
+
outline: 2px solid #5B9FFF;
|
|
161
|
+
outline-offset: 2px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Disabled state */
|
|
165
|
+
&:disabled {
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
opacity: 0.4;
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
var InputWrapper = styled7__default.default.div`
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 10px;
|
|
174
|
+
padding: 10px 14px;
|
|
175
|
+
background-color: #2c2c2e;
|
|
176
|
+
border: 1px solid #3a3a3c;
|
|
177
|
+
border-radius: 12px;
|
|
178
|
+
transition: all 0.2s ease;
|
|
179
|
+
width: 100%;
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
|
|
182
|
+
&:focus-within {
|
|
183
|
+
border-color: #5B9FFF;
|
|
184
|
+
background-color: #323234;
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
var InputField = styled7__default.default.input`
|
|
188
|
+
flex: 1;
|
|
189
|
+
border: none;
|
|
190
|
+
outline: none;
|
|
191
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
192
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
color: #e5e5e7;
|
|
195
|
+
background: transparent;
|
|
196
|
+
|
|
197
|
+
&::placeholder {
|
|
198
|
+
color: #6e6e73;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&:disabled {
|
|
202
|
+
color: #6e6e73;
|
|
203
|
+
cursor: not-allowed;
|
|
204
|
+
}
|
|
205
|
+
`;
|
|
206
|
+
var SubmitButton = styled7__default.default.button`
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
width: 32px;
|
|
211
|
+
height: 32px;
|
|
212
|
+
padding: 0;
|
|
213
|
+
border: none;
|
|
214
|
+
border-radius: 50%;
|
|
215
|
+
background-color: ${(props) => props.disabled ? "#3a3a3c" : "#5B9FFF"};
|
|
216
|
+
color: ${(props) => props.disabled ? "#6e6e73" : "#ffffff"};
|
|
217
|
+
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
218
|
+
transition: all 0.2s ease;
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
|
|
221
|
+
&:hover:not(:disabled) {
|
|
222
|
+
background-color: #4A8FEF;
|
|
223
|
+
transform: scale(1.05);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&:active:not(:disabled) {
|
|
227
|
+
transform: scale(0.98);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&:focus-visible {
|
|
231
|
+
outline: 2px solid #5B9FFF;
|
|
232
|
+
outline-offset: 2px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
svg {
|
|
236
|
+
width: 18px;
|
|
237
|
+
height: 18px;
|
|
238
|
+
}
|
|
239
|
+
`;
|
|
240
|
+
var ChatInput = ({
|
|
241
|
+
suggestions = [],
|
|
242
|
+
onSuggestionSelect,
|
|
243
|
+
value = "",
|
|
244
|
+
onChange,
|
|
245
|
+
onSubmit,
|
|
246
|
+
placeholder = "Ask, write or search for anything...",
|
|
247
|
+
isDisabled = false,
|
|
248
|
+
isReadOnly = false,
|
|
249
|
+
autoFocus = false,
|
|
250
|
+
className,
|
|
251
|
+
"aria-label": ariaLabel = "Chat message input",
|
|
252
|
+
...ariaProps
|
|
253
|
+
}) => {
|
|
254
|
+
const [internalValue, setInternalValue] = react.useState(value);
|
|
255
|
+
const inputRef = react.useRef(null);
|
|
256
|
+
const currentValue = value !== void 0 ? value : internalValue;
|
|
257
|
+
const setValue = onChange || setInternalValue;
|
|
258
|
+
const { inputProps } = textfield.useTextField(
|
|
259
|
+
{
|
|
260
|
+
...ariaProps,
|
|
261
|
+
"aria-label": ariaLabel,
|
|
262
|
+
value: currentValue,
|
|
263
|
+
onChange: (newValue) => {
|
|
264
|
+
setValue(newValue);
|
|
265
|
+
},
|
|
266
|
+
isDisabled,
|
|
267
|
+
isReadOnly
|
|
268
|
+
},
|
|
269
|
+
inputRef
|
|
270
|
+
);
|
|
271
|
+
const handleKeyDown = (e) => {
|
|
272
|
+
if (e.key === "Enter") {
|
|
273
|
+
e.preventDefault();
|
|
274
|
+
handleSubmit();
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const handleSubmit = () => {
|
|
278
|
+
if (currentValue.trim() && onSubmit && !isDisabled && !isReadOnly) {
|
|
279
|
+
onSubmit(currentValue.trim());
|
|
280
|
+
setValue("");
|
|
281
|
+
inputRef.current?.focus();
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
const handleSuggestionClick = (suggestionText) => {
|
|
285
|
+
if (onSuggestionSelect && !isDisabled && !isReadOnly) {
|
|
286
|
+
onSuggestionSelect(suggestionText);
|
|
287
|
+
setValue(suggestionText);
|
|
288
|
+
inputRef.current?.focus();
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const canSubmit = currentValue.trim().length > 0 && !isDisabled && !isReadOnly;
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ChatInputContainer, { className, children: [
|
|
293
|
+
suggestions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(SuggestionsWrapper, { role: "list", "aria-label": "Suggested prompts", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
294
|
+
SuggestionButtonComponent,
|
|
295
|
+
{
|
|
296
|
+
suggestion,
|
|
297
|
+
onSelect: handleSuggestionClick,
|
|
298
|
+
isDisabled: isDisabled || isReadOnly
|
|
299
|
+
},
|
|
300
|
+
`${suggestion.text}-${index}`
|
|
301
|
+
)) }),
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InputWrapper, { children: [
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
+
InputField,
|
|
305
|
+
{
|
|
306
|
+
...inputProps,
|
|
307
|
+
ref: inputRef,
|
|
308
|
+
type: "text",
|
|
309
|
+
placeholder,
|
|
310
|
+
onKeyDown: handleKeyDown,
|
|
311
|
+
autoFocus,
|
|
312
|
+
disabled: isDisabled,
|
|
313
|
+
readOnly: isReadOnly
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
317
|
+
SubmitButtonComponent,
|
|
318
|
+
{
|
|
319
|
+
onPress: handleSubmit,
|
|
320
|
+
isDisabled: !canSubmit,
|
|
321
|
+
ariaLabel: "Send message"
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
] })
|
|
325
|
+
] });
|
|
326
|
+
};
|
|
327
|
+
var SuggestionButtonComponent = ({
|
|
328
|
+
suggestion,
|
|
329
|
+
onSelect,
|
|
330
|
+
isDisabled = false
|
|
331
|
+
}) => {
|
|
332
|
+
const ref = react.useRef(null);
|
|
333
|
+
const { buttonProps } = button.useButton(
|
|
334
|
+
{
|
|
335
|
+
onPress: () => onSelect(suggestion.text),
|
|
336
|
+
isDisabled,
|
|
337
|
+
"aria-label": `Select suggestion: ${suggestion.text}`
|
|
338
|
+
},
|
|
339
|
+
ref
|
|
340
|
+
);
|
|
341
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SuggestionButton, { ...buttonProps, ref, role: "listitem", children: suggestion.text });
|
|
342
|
+
};
|
|
343
|
+
var SubmitButtonComponent = ({
|
|
344
|
+
onPress,
|
|
345
|
+
isDisabled = false,
|
|
346
|
+
ariaLabel = "Send message"
|
|
347
|
+
}) => {
|
|
348
|
+
const ref = react.useRef(null);
|
|
349
|
+
const { buttonProps } = button.useButton(
|
|
350
|
+
{
|
|
351
|
+
onPress,
|
|
352
|
+
isDisabled,
|
|
353
|
+
"aria-label": ariaLabel
|
|
354
|
+
},
|
|
355
|
+
ref
|
|
356
|
+
);
|
|
357
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { ...buttonProps, ref, disabled: isDisabled, title: ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
|
+
"svg",
|
|
359
|
+
{
|
|
360
|
+
width: "20",
|
|
361
|
+
height: "20",
|
|
362
|
+
viewBox: "0 0 20 20",
|
|
363
|
+
fill: "none",
|
|
364
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
365
|
+
role: "img",
|
|
366
|
+
"aria-hidden": "true",
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Arrow Right Icon" }),
|
|
369
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
+
"path",
|
|
371
|
+
{
|
|
372
|
+
d: "M4 10H16M16 10L10 4M16 10L10 16",
|
|
373
|
+
stroke: "currentColor",
|
|
374
|
+
strokeWidth: "2",
|
|
375
|
+
strokeLinecap: "round",
|
|
376
|
+
strokeLinejoin: "round"
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
) });
|
|
382
|
+
};
|
|
383
|
+
ChatInput.displayName = "ChatInput";
|
|
384
|
+
var StyledUserMessage = styled7__default.default.button`
|
|
385
|
+
/* Base styles */
|
|
386
|
+
display: inline-flex;
|
|
387
|
+
align-items: center;
|
|
388
|
+
justify-content: center;
|
|
389
|
+
padding: 12px 20px;
|
|
390
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
391
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
392
|
+
font-size: 14px;
|
|
393
|
+
font-weight: 400;
|
|
394
|
+
line-height: 1.4;
|
|
395
|
+
color: #ffffff;
|
|
396
|
+
border: none;
|
|
397
|
+
cursor: default;
|
|
398
|
+
user-select: none;
|
|
399
|
+
white-space: pre-wrap;
|
|
400
|
+
word-wrap: break-word;
|
|
401
|
+
position: relative;
|
|
402
|
+
text-align: left;
|
|
403
|
+
|
|
404
|
+
/* Pill shape - fully rounded ends */
|
|
405
|
+
border-radius: 999px;
|
|
406
|
+
|
|
407
|
+
/* Purple to blue gradient (left to right) */
|
|
408
|
+
background: linear-gradient(90deg, #8B5CF6 0%, #5B8DEF 100%);
|
|
409
|
+
|
|
410
|
+
/* Subtle shadow and glow effect */
|
|
411
|
+
box-shadow:
|
|
412
|
+
0 2px 8px rgba(91, 141, 239, 0.25),
|
|
413
|
+
0 1px 3px rgba(139, 92, 246, 0.15);
|
|
414
|
+
|
|
415
|
+
/* Smooth transitions */
|
|
416
|
+
transition: all 0.2s ease-in-out;
|
|
417
|
+
|
|
418
|
+
/* Speech bubble tail */
|
|
419
|
+
&::after {
|
|
420
|
+
content: '';
|
|
421
|
+
position: absolute;
|
|
422
|
+
bottom: -4px;
|
|
423
|
+
right: -6px;
|
|
424
|
+
width: 18px;
|
|
425
|
+
height: 18px;
|
|
426
|
+
background: #5B8DEF;
|
|
427
|
+
transform: rotate(45deg);
|
|
428
|
+
border-radius: 0 0 16px 0;
|
|
429
|
+
box-shadow:
|
|
430
|
+
2px 2px 4px rgba(91, 141, 239, 0.15);
|
|
431
|
+
transition: all 0.2s ease-in-out;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* Hover state - only for button elements */
|
|
435
|
+
&[role="button"]:hover:not(:disabled) {
|
|
436
|
+
transform: translateY(-1px);
|
|
437
|
+
cursor: pointer;
|
|
438
|
+
box-shadow:
|
|
439
|
+
0 4px 12px rgba(91, 141, 239, 0.35),
|
|
440
|
+
0 2px 6px rgba(139, 92, 246, 0.25);
|
|
441
|
+
|
|
442
|
+
&::after {
|
|
443
|
+
box-shadow:
|
|
444
|
+
3px 3px 6px rgba(91, 141, 239, 0.2);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* Active/Pressed state - only for button elements */
|
|
449
|
+
&[role="button"]:active:not(:disabled) {
|
|
450
|
+
transform: translateY(0);
|
|
451
|
+
box-shadow:
|
|
452
|
+
0 1px 4px rgba(91, 141, 239, 0.2),
|
|
453
|
+
0 1px 2px rgba(139, 92, 246, 0.1);
|
|
454
|
+
|
|
455
|
+
&::after {
|
|
456
|
+
box-shadow:
|
|
457
|
+
1px 1px 2px rgba(91, 141, 239, 0.1);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
${({ $isPressed }) => $isPressed && styled7.css`
|
|
462
|
+
transform: translateY(0) scale(0.98);
|
|
463
|
+
box-shadow:
|
|
464
|
+
0 1px 4px rgba(91, 141, 239, 0.2),
|
|
465
|
+
0 1px 2px rgba(139, 92, 246, 0.1);
|
|
466
|
+
|
|
467
|
+
&::after {
|
|
468
|
+
box-shadow:
|
|
469
|
+
1px 1px 2px rgba(91, 141, 239, 0.1);
|
|
470
|
+
}
|
|
471
|
+
`}
|
|
472
|
+
|
|
473
|
+
/* Focus state for accessibility */
|
|
474
|
+
&:focus {
|
|
475
|
+
outline: none;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
&:focus-visible {
|
|
479
|
+
outline: 2px solid #5B8DEF;
|
|
480
|
+
outline-offset: 3px;
|
|
481
|
+
box-shadow:
|
|
482
|
+
0 4px 12px rgba(91, 141, 239, 0.35),
|
|
483
|
+
0 2px 6px rgba(139, 92, 246, 0.25),
|
|
484
|
+
0 0 0 3px rgba(91, 141, 239, 0.1);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/* Disabled state */
|
|
488
|
+
&:disabled {
|
|
489
|
+
cursor: not-allowed;
|
|
490
|
+
opacity: 0.5;
|
|
491
|
+
transform: none;
|
|
492
|
+
box-shadow: none;
|
|
493
|
+
|
|
494
|
+
&::after {
|
|
495
|
+
opacity: 0.5;
|
|
496
|
+
box-shadow: none;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
`;
|
|
500
|
+
function UserMessage({
|
|
501
|
+
children,
|
|
502
|
+
className,
|
|
503
|
+
isPressed = false,
|
|
504
|
+
onPress,
|
|
505
|
+
...ariaProps
|
|
506
|
+
}) {
|
|
507
|
+
const ref = react.useRef(null);
|
|
508
|
+
if (!onPress) {
|
|
509
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledUserMessage, { as: "div", className, $isPressed: isPressed, role: "presentation", children });
|
|
510
|
+
}
|
|
511
|
+
const { buttonProps, isPressed: ariaPressedState } = button.useButton(
|
|
512
|
+
{
|
|
513
|
+
...ariaProps,
|
|
514
|
+
onPress
|
|
515
|
+
},
|
|
516
|
+
ref
|
|
517
|
+
);
|
|
518
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
519
|
+
StyledUserMessage,
|
|
520
|
+
{
|
|
521
|
+
...buttonProps,
|
|
522
|
+
ref,
|
|
523
|
+
className,
|
|
524
|
+
$isPressed: isPressed || ariaPressedState,
|
|
525
|
+
role: "button",
|
|
526
|
+
tabIndex: 0,
|
|
527
|
+
children
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
UserMessage.displayName = "UserMessage";
|
|
532
|
+
var variantStyles = {
|
|
533
|
+
primary: styled7.css`
|
|
534
|
+
background-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
535
|
+
color: white;
|
|
536
|
+
border: none;
|
|
537
|
+
|
|
538
|
+
&:hover:not(:disabled) {
|
|
539
|
+
opacity: 0.9;
|
|
540
|
+
transform: translateY(-1px);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
&:active:not(:disabled) {
|
|
544
|
+
opacity: 0.8;
|
|
545
|
+
transform: translateY(0);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
&:focus-visible {
|
|
549
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
550
|
+
outline-offset: 2px;
|
|
551
|
+
}
|
|
552
|
+
`,
|
|
553
|
+
secondary: styled7.css`
|
|
554
|
+
background-color: transparent;
|
|
555
|
+
color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
|
|
556
|
+
border: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
557
|
+
|
|
558
|
+
&:hover:not(:disabled) {
|
|
559
|
+
background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
|
|
560
|
+
border-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
&:active:not(:disabled) {
|
|
564
|
+
background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
&:focus-visible {
|
|
568
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
569
|
+
outline-offset: 2px;
|
|
570
|
+
}
|
|
571
|
+
`,
|
|
572
|
+
icon: styled7.css`
|
|
573
|
+
background-color: transparent;
|
|
574
|
+
color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
|
|
575
|
+
border: none;
|
|
576
|
+
padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
|
|
577
|
+
min-width: auto;
|
|
578
|
+
|
|
579
|
+
&:hover:not(:disabled) {
|
|
580
|
+
background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
581
|
+
opacity: 0.8;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
&:active:not(:disabled) {
|
|
585
|
+
opacity: 0.6;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
&:focus-visible {
|
|
589
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
590
|
+
outline-offset: 2px;
|
|
591
|
+
}
|
|
592
|
+
`
|
|
593
|
+
};
|
|
594
|
+
var sizeStyles = {
|
|
595
|
+
small: styled7.css`
|
|
596
|
+
padding: ${({ theme }) => theme?.spacing?.xs ?? "4px"} ${({ theme }) => theme?.spacing?.sm ?? "8px"};
|
|
597
|
+
font-size: 0.875rem;
|
|
598
|
+
min-width: 60px;
|
|
599
|
+
height: 28px;
|
|
600
|
+
`,
|
|
601
|
+
medium: styled7.css`
|
|
602
|
+
padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
|
|
603
|
+
font-size: 1rem;
|
|
604
|
+
min-width: 80px;
|
|
605
|
+
height: 36px;
|
|
606
|
+
`,
|
|
607
|
+
large: styled7.css`
|
|
608
|
+
padding: ${({ theme }) => theme?.spacing?.md ?? "16px"} ${({ theme }) => theme?.spacing?.lg ?? "24px"};
|
|
609
|
+
font-size: 1.125rem;
|
|
610
|
+
min-width: 100px;
|
|
611
|
+
height: 44px;
|
|
612
|
+
`
|
|
613
|
+
};
|
|
614
|
+
var StyledButton = styled7__default.default.button`
|
|
615
|
+
/* Base styles */
|
|
616
|
+
display: inline-flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
justify-content: center;
|
|
619
|
+
gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
|
|
620
|
+
font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
|
|
621
|
+
font-weight: 500;
|
|
622
|
+
border-radius: ${({ theme }) => theme?.radii?.md ?? "8px"};
|
|
623
|
+
cursor: pointer;
|
|
624
|
+
transition: all 0.2s ease-in-out;
|
|
625
|
+
white-space: nowrap;
|
|
626
|
+
user-select: none;
|
|
627
|
+
|
|
628
|
+
/* Variant styles */
|
|
629
|
+
${({ $variant }) => variantStyles[$variant]}
|
|
630
|
+
|
|
631
|
+
/* Size styles */
|
|
632
|
+
${({ $size, $variant }) => $variant !== "icon" && sizeStyles[$size]}
|
|
633
|
+
|
|
634
|
+
/* Icon variant size overrides */
|
|
635
|
+
${({ $variant, $size }) => $variant === "icon" && styled7.css`
|
|
636
|
+
width: ${$size === "small" ? "28px" : $size === "large" ? "44px" : "36px"};
|
|
637
|
+
height: ${$size === "small" ? "28px" : $size === "large" ? "44px" : "36px"};
|
|
638
|
+
border-radius: ${({ theme }) => theme?.radii?.sm ?? "4px"};
|
|
639
|
+
`}
|
|
640
|
+
|
|
641
|
+
/* Pressed state */
|
|
642
|
+
${({ $isPressed }) => $isPressed && styled7.css`
|
|
643
|
+
transform: scale(0.98);
|
|
644
|
+
`}
|
|
645
|
+
|
|
646
|
+
/* Loading state */
|
|
647
|
+
${({ $isLoading }) => $isLoading && styled7.css`
|
|
648
|
+
cursor: wait;
|
|
649
|
+
opacity: 0.7;
|
|
650
|
+
`}
|
|
651
|
+
|
|
652
|
+
/* Disabled state */
|
|
653
|
+
&:disabled {
|
|
654
|
+
cursor: not-allowed;
|
|
655
|
+
opacity: 0.5;
|
|
656
|
+
transform: none;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/* Remove default focus outline, using focus-visible instead */
|
|
660
|
+
&:focus {
|
|
661
|
+
outline: none;
|
|
662
|
+
}
|
|
663
|
+
`;
|
|
664
|
+
function Button({
|
|
665
|
+
variant = "primary",
|
|
666
|
+
size = "medium",
|
|
667
|
+
children,
|
|
668
|
+
className,
|
|
669
|
+
disabled = false,
|
|
670
|
+
isLoading = false,
|
|
671
|
+
...ariaProps
|
|
672
|
+
}) {
|
|
673
|
+
const ref = react.useRef(null);
|
|
674
|
+
const { buttonProps, isPressed } = button.useButton(
|
|
675
|
+
{
|
|
676
|
+
...ariaProps,
|
|
677
|
+
isDisabled: disabled || isLoading
|
|
678
|
+
},
|
|
679
|
+
ref
|
|
680
|
+
);
|
|
681
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
682
|
+
StyledButton,
|
|
683
|
+
{
|
|
684
|
+
...buttonProps,
|
|
685
|
+
ref,
|
|
686
|
+
className,
|
|
687
|
+
$variant: variant,
|
|
688
|
+
$size: size,
|
|
689
|
+
$isPressed: isPressed,
|
|
690
|
+
$isLoading: isLoading,
|
|
691
|
+
disabled: disabled || isLoading,
|
|
692
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", "aria-busy": "true", children: "Loading..." }) : children
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
Button.displayName = "Button";
|
|
697
|
+
var ActionsContainer = styled7__default.default.div`
|
|
698
|
+
display: flex;
|
|
699
|
+
gap: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
|
|
700
|
+
align-items: center;
|
|
701
|
+
|
|
702
|
+
${({ $layout }) => $layout === "horizontal" ? styled7.css`
|
|
703
|
+
flex-direction: row;
|
|
704
|
+
flex-wrap: wrap;
|
|
705
|
+
` : styled7.css`
|
|
706
|
+
flex-direction: column;
|
|
707
|
+
align-items: stretch;
|
|
708
|
+
|
|
709
|
+
button {
|
|
710
|
+
width: 100%;
|
|
711
|
+
}
|
|
712
|
+
`}
|
|
713
|
+
`;
|
|
714
|
+
function Actions({ actions, layout = "horizontal", className }) {
|
|
715
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ActionsContainer, { $layout: layout, className, children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
716
|
+
Button,
|
|
717
|
+
{
|
|
718
|
+
variant: action.variant || "secondary",
|
|
719
|
+
onPress: action.onClick,
|
|
720
|
+
isDisabled: action.disabled,
|
|
721
|
+
"aria-label": action.label,
|
|
722
|
+
children: [
|
|
723
|
+
action.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: action.icon }),
|
|
724
|
+
action.variant !== "icon" && action.label
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
action.id
|
|
728
|
+
)) });
|
|
729
|
+
}
|
|
730
|
+
Actions.displayName = "Actions";
|
|
731
|
+
var dotPulse2 = styled7.keyframes`
|
|
732
|
+
0%, 100% {
|
|
733
|
+
opacity: 0.3;
|
|
734
|
+
transform: scale(0.8);
|
|
735
|
+
}
|
|
736
|
+
50% {
|
|
737
|
+
opacity: 1;
|
|
738
|
+
transform: scale(1);
|
|
739
|
+
}
|
|
740
|
+
`;
|
|
741
|
+
var fadeIn = styled7.keyframes`
|
|
742
|
+
from {
|
|
743
|
+
opacity: 0;
|
|
744
|
+
}
|
|
745
|
+
to {
|
|
746
|
+
opacity: 1;
|
|
747
|
+
}
|
|
748
|
+
`;
|
|
749
|
+
var blink = styled7.keyframes`
|
|
750
|
+
0%, 49% {
|
|
751
|
+
opacity: 1;
|
|
752
|
+
}
|
|
753
|
+
50%, 100% {
|
|
754
|
+
opacity: 0;
|
|
755
|
+
}
|
|
756
|
+
`;
|
|
757
|
+
var ResponseContainer = styled7__default.default.div`
|
|
758
|
+
display: inline-flex;
|
|
759
|
+
align-items: center;
|
|
760
|
+
gap: 12px;
|
|
761
|
+
padding: 12px 16px;
|
|
762
|
+
background-color: #2c2c2e;
|
|
763
|
+
border-radius: 16px;
|
|
764
|
+
box-shadow: none;
|
|
765
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
766
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
767
|
+
max-width: fit-content;
|
|
768
|
+
margin: 0 auto;
|
|
769
|
+
`;
|
|
770
|
+
var LoadingDots2 = styled7__default.default.div`
|
|
771
|
+
display: flex;
|
|
772
|
+
align-items: center;
|
|
773
|
+
gap: 4px;
|
|
774
|
+
padding: 0 4px;
|
|
775
|
+
`;
|
|
776
|
+
var Dot2 = styled7__default.default.span`
|
|
777
|
+
width: 6px;
|
|
778
|
+
height: 6px;
|
|
779
|
+
border-radius: 50%;
|
|
780
|
+
background-color: #8e8e93;
|
|
781
|
+
animation: ${dotPulse2} 1.4s ease-in-out infinite;
|
|
782
|
+
animation-delay: ${(props) => props.delay}s;
|
|
783
|
+
`;
|
|
784
|
+
var TypingIndicator = styled7__default.default.div`
|
|
785
|
+
display: flex;
|
|
786
|
+
align-items: center;
|
|
787
|
+
gap: 4px;
|
|
788
|
+
padding: 0 4px;
|
|
789
|
+
|
|
790
|
+
${Dot2} {
|
|
791
|
+
width: 6px;
|
|
792
|
+
height: 6px;
|
|
793
|
+
background-color: #8e8e93;
|
|
794
|
+
animation: ${dotPulse2} 1.4s ease-in-out infinite;
|
|
795
|
+
}
|
|
796
|
+
`;
|
|
797
|
+
var Message2 = styled7__default.default.span`
|
|
798
|
+
font-size: 14px;
|
|
799
|
+
color: #e5e5e7;
|
|
800
|
+
font-weight: 400;
|
|
801
|
+
line-height: 1.5;
|
|
802
|
+
white-space: nowrap;
|
|
803
|
+
`;
|
|
804
|
+
var StreamingText = styled7__default.default.div`
|
|
805
|
+
font-size: 14px;
|
|
806
|
+
line-height: 1.5;
|
|
807
|
+
color: #e5e5e7;
|
|
808
|
+
animation: ${fadeIn} 0.3s ease-in;
|
|
809
|
+
position: relative;
|
|
810
|
+
font-weight: 400;
|
|
811
|
+
white-space: nowrap;
|
|
812
|
+
|
|
813
|
+
/* Blinking cursor effect */
|
|
814
|
+
&::after {
|
|
815
|
+
content: '|';
|
|
816
|
+
margin-left: 0.125rem;
|
|
817
|
+
animation: ${blink} 1s infinite;
|
|
818
|
+
color: #8e8e93;
|
|
819
|
+
font-weight: 400;
|
|
820
|
+
}
|
|
821
|
+
`;
|
|
822
|
+
var Response = ({
|
|
823
|
+
isLoading = false,
|
|
824
|
+
isTyping = false,
|
|
825
|
+
isStreaming = false,
|
|
826
|
+
streamingContent = "",
|
|
827
|
+
message = "Thinking...",
|
|
828
|
+
className
|
|
829
|
+
}) => {
|
|
830
|
+
if (isLoading) {
|
|
831
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ResponseContainer, { className, "data-testid": "response-loading", children: [
|
|
832
|
+
/* @__PURE__ */ jsxRuntime.jsxs(LoadingDots2, { "aria-hidden": "true", children: [
|
|
833
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0 }),
|
|
834
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.15 }),
|
|
835
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.3 })
|
|
836
|
+
] }),
|
|
837
|
+
/* @__PURE__ */ jsxRuntime.jsx(Message2, { children: message })
|
|
838
|
+
] });
|
|
839
|
+
}
|
|
840
|
+
if (isTyping) {
|
|
841
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ResponseContainer, { className, "data-testid": "response-typing", children: [
|
|
842
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TypingIndicator, { "aria-hidden": "true", children: [
|
|
843
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0 }),
|
|
844
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.15 }),
|
|
845
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.3 })
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ jsxRuntime.jsx(Message2, { children: message })
|
|
848
|
+
] });
|
|
849
|
+
}
|
|
850
|
+
if (isStreaming && streamingContent) {
|
|
851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ResponseContainer, { className, "data-testid": "response-streaming", children: /* @__PURE__ */ jsxRuntime.jsx(StreamingText, { children: streamingContent }) });
|
|
852
|
+
}
|
|
853
|
+
return null;
|
|
854
|
+
};
|
|
855
|
+
var dotPulse3 = styled7.keyframes`
|
|
856
|
+
0%, 100% {
|
|
857
|
+
opacity: 0.3;
|
|
858
|
+
transform: scale(0.8);
|
|
859
|
+
}
|
|
860
|
+
50% {
|
|
861
|
+
opacity: 1;
|
|
862
|
+
transform: scale(1);
|
|
863
|
+
}
|
|
864
|
+
`;
|
|
865
|
+
var shake = styled7.keyframes`
|
|
866
|
+
0%, 100% {
|
|
867
|
+
transform: translateX(0);
|
|
868
|
+
}
|
|
869
|
+
25% {
|
|
870
|
+
transform: translateX(-5px);
|
|
871
|
+
}
|
|
872
|
+
75% {
|
|
873
|
+
transform: translateX(5px);
|
|
874
|
+
}
|
|
875
|
+
`;
|
|
876
|
+
var AgentStateContainer = styled7__default.default.div`
|
|
877
|
+
display: inline-flex;
|
|
878
|
+
flex-direction: column;
|
|
879
|
+
align-items: center;
|
|
880
|
+
gap: 12px;
|
|
881
|
+
padding: 12px 16px;
|
|
882
|
+
background-color: ${(props) => props.isError ? "#3a1f1f" : "#2c2c2e"};
|
|
883
|
+
border-radius: 16px;
|
|
884
|
+
border: ${(props) => props.isError ? "1px solid #7f1d1d" : "none"};
|
|
885
|
+
box-shadow: none;
|
|
886
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
887
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
888
|
+
max-width: fit-content;
|
|
889
|
+
margin: 0 auto;
|
|
890
|
+
`;
|
|
891
|
+
var StateContent = styled7__default.default.div`
|
|
892
|
+
display: flex;
|
|
893
|
+
flex-direction: column;
|
|
894
|
+
gap: 8px;
|
|
895
|
+
align-items: center;
|
|
896
|
+
width: 100%;
|
|
897
|
+
`;
|
|
898
|
+
var IdleIndicator = styled7__default.default.div`
|
|
899
|
+
width: 6px;
|
|
900
|
+
height: 6px;
|
|
901
|
+
background-color: #8e8e93;
|
|
902
|
+
border-radius: 50%;
|
|
903
|
+
animation: ${dotPulse3} 2s infinite ease-in-out;
|
|
904
|
+
`;
|
|
905
|
+
var ErrorIndicator = styled7__default.default.div`
|
|
906
|
+
width: 6px;
|
|
907
|
+
height: 6px;
|
|
908
|
+
background-color: #ff6b6b;
|
|
909
|
+
border-radius: 50%;
|
|
910
|
+
animation: ${shake} 0.5s ease-in-out;
|
|
911
|
+
`;
|
|
912
|
+
var StateLabel = styled7__default.default.span`
|
|
913
|
+
font-size: 14px;
|
|
914
|
+
font-weight: 400;
|
|
915
|
+
color: #e5e5e7;
|
|
916
|
+
line-height: 1.5;
|
|
917
|
+
white-space: nowrap;
|
|
918
|
+
`;
|
|
919
|
+
styled7__default.default.p`
|
|
920
|
+
font-size: 14px;
|
|
921
|
+
color: #8e8e93;
|
|
922
|
+
line-height: 1.5;
|
|
923
|
+
margin: 0;
|
|
924
|
+
text-align: center;
|
|
925
|
+
white-space: nowrap;
|
|
926
|
+
`;
|
|
927
|
+
var ProgressBar = styled7__default.default.div`
|
|
928
|
+
width: 100%;
|
|
929
|
+
height: 4px;
|
|
930
|
+
background-color: #3a3a3c;
|
|
931
|
+
border-radius: 2px;
|
|
932
|
+
overflow: hidden;
|
|
933
|
+
margin-top: 4px;
|
|
934
|
+
`;
|
|
935
|
+
var ProgressBarFill = styled7__default.default.div`
|
|
936
|
+
height: 100%;
|
|
937
|
+
width: ${(props) => Math.min(Math.max(props.progress, 0), 100)}%;
|
|
938
|
+
background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
|
|
939
|
+
border-radius: 2px;
|
|
940
|
+
transition: width 0.3s ease-in-out;
|
|
941
|
+
`;
|
|
942
|
+
var AgentState = ({ state, message, progress, className }) => {
|
|
943
|
+
if (state === "idle") {
|
|
944
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AgentStateContainer, { className, "data-testid": "agent-state-idle", children: /* @__PURE__ */ jsxRuntime.jsxs(StateContent, { children: [
|
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx(IdleIndicator, {}),
|
|
946
|
+
/* @__PURE__ */ jsxRuntime.jsx(StateLabel, { children: message || "Agent is idle" }),
|
|
947
|
+
progress !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarFill, { progress }) })
|
|
948
|
+
] }) });
|
|
949
|
+
}
|
|
950
|
+
if (state === "error") {
|
|
951
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AgentStateContainer, { className, "data-testid": "agent-state-error", isError: true, children: /* @__PURE__ */ jsxRuntime.jsxs(StateContent, { children: [
|
|
952
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorIndicator, {}),
|
|
953
|
+
/* @__PURE__ */ jsxRuntime.jsx(StateLabel, { children: message || "Error occurred" })
|
|
954
|
+
] }) });
|
|
955
|
+
}
|
|
956
|
+
if (state === "thinking") {
|
|
957
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Response, { isLoading: true, message: message || "Agent is thinking...", className });
|
|
958
|
+
}
|
|
959
|
+
if (state === "responding") {
|
|
960
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Response, { isTyping: true, message: message || "Agent is responding...", className });
|
|
961
|
+
}
|
|
962
|
+
return null;
|
|
963
|
+
};
|
|
964
|
+
var FooterContainer = styled7__default.default.footer`
|
|
965
|
+
display: flex;
|
|
966
|
+
align-items: center;
|
|
967
|
+
justify-content: center;
|
|
968
|
+
padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
|
|
969
|
+
background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
|
|
970
|
+
border-top: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
971
|
+
min-height: 44px;
|
|
972
|
+
`;
|
|
973
|
+
var FooterContent = styled7__default.default.div`
|
|
974
|
+
display: flex;
|
|
975
|
+
align-items: center;
|
|
976
|
+
justify-content: space-between;
|
|
977
|
+
gap: ${({ theme }) => theme?.spacing?.md ?? "16px"};
|
|
978
|
+
width: 100%;
|
|
979
|
+
max-width: 100%;
|
|
980
|
+
font-size: 0.75rem;
|
|
981
|
+
color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
|
|
982
|
+
opacity: 0.6;
|
|
983
|
+
font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
|
|
984
|
+
line-height: 1.4;
|
|
985
|
+
`;
|
|
986
|
+
var FooterBranding = styled7__default.default.div`
|
|
987
|
+
display: flex;
|
|
988
|
+
align-items: center;
|
|
989
|
+
gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
|
|
990
|
+
flex-shrink: 0;
|
|
991
|
+
`;
|
|
992
|
+
var FooterStatus = styled7__default.default.div`
|
|
993
|
+
display: flex;
|
|
994
|
+
align-items: center;
|
|
995
|
+
gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
|
|
996
|
+
overflow: hidden;
|
|
997
|
+
text-overflow: ellipsis;
|
|
998
|
+
white-space: nowrap;
|
|
999
|
+
font-size: 0.75rem;
|
|
1000
|
+
opacity: 0.8;
|
|
1001
|
+
`;
|
|
1002
|
+
var FooterLink = styled7__default.default.a`
|
|
1003
|
+
color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
1004
|
+
text-decoration: none;
|
|
1005
|
+
transition: opacity 150ms ease;
|
|
1006
|
+
cursor: pointer;
|
|
1007
|
+
|
|
1008
|
+
&:hover {
|
|
1009
|
+
opacity: 0.8;
|
|
1010
|
+
text-decoration: underline;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
&:focus-visible {
|
|
1014
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
1015
|
+
outline-offset: 2px;
|
|
1016
|
+
border-radius: ${({ theme }) => theme?.radii?.sm ?? "4px"};
|
|
1017
|
+
}
|
|
1018
|
+
`;
|
|
1019
|
+
var Footer = ({
|
|
1020
|
+
branding,
|
|
1021
|
+
status,
|
|
1022
|
+
brandingUrl,
|
|
1023
|
+
onBrandingClick,
|
|
1024
|
+
className
|
|
1025
|
+
}) => {
|
|
1026
|
+
if (!branding && !status) {
|
|
1027
|
+
return null;
|
|
1028
|
+
}
|
|
1029
|
+
const handleBrandingClick = (e) => {
|
|
1030
|
+
if (onBrandingClick) {
|
|
1031
|
+
e.preventDefault();
|
|
1032
|
+
onBrandingClick();
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FooterContainer, { className, children: /* @__PURE__ */ jsxRuntime.jsxs(FooterContent, { children: [
|
|
1036
|
+
branding && /* @__PURE__ */ jsxRuntime.jsx(FooterBranding, { children: brandingUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1037
|
+
FooterLink,
|
|
1038
|
+
{
|
|
1039
|
+
href: brandingUrl,
|
|
1040
|
+
onClick: handleBrandingClick,
|
|
1041
|
+
target: "_blank",
|
|
1042
|
+
rel: "noopener noreferrer",
|
|
1043
|
+
children: branding
|
|
1044
|
+
}
|
|
1045
|
+
) : branding }),
|
|
1046
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(FooterStatus, { children: status })
|
|
1047
|
+
] }) });
|
|
1048
|
+
};
|
|
1049
|
+
Footer.displayName = "Footer";
|
|
1050
|
+
var HeaderContainer = styled7__default.default.header`
|
|
1051
|
+
display: flex;
|
|
1052
|
+
align-items: center;
|
|
1053
|
+
justify-content: space-between;
|
|
1054
|
+
padding: 8px;
|
|
1055
|
+
background-color: #2c2c2e;
|
|
1056
|
+
border-bottom: 1px solid #3a3a3c;
|
|
1057
|
+
min-height: 60px;
|
|
1058
|
+
box-sizing: border-box;
|
|
1059
|
+
|
|
1060
|
+
@media (min-width: 640px) {
|
|
1061
|
+
padding: 12px;
|
|
1062
|
+
}
|
|
1063
|
+
`;
|
|
1064
|
+
var HeaderContent = styled7__default.default.div`
|
|
1065
|
+
display: flex;
|
|
1066
|
+
flex-direction: column;
|
|
1067
|
+
gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
|
|
1068
|
+
flex: 1;
|
|
1069
|
+
min-width: 0;
|
|
1070
|
+
`;
|
|
1071
|
+
var HeaderTitle = styled7__default.default.h1`
|
|
1072
|
+
margin: 0;
|
|
1073
|
+
font-size: 1rem;
|
|
1074
|
+
font-weight: 600;
|
|
1075
|
+
color: #e5e5e7;
|
|
1076
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1077
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1078
|
+
line-height: 1.5;
|
|
1079
|
+
overflow: hidden;
|
|
1080
|
+
text-overflow: ellipsis;
|
|
1081
|
+
white-space: nowrap;
|
|
1082
|
+
`;
|
|
1083
|
+
var HeaderSubtitle = styled7__default.default.p`
|
|
1084
|
+
margin: 0;
|
|
1085
|
+
font-size: 0.875rem;
|
|
1086
|
+
color: #8e8e93;
|
|
1087
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1088
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1089
|
+
line-height: 1.4;
|
|
1090
|
+
overflow: hidden;
|
|
1091
|
+
text-overflow: ellipsis;
|
|
1092
|
+
white-space: nowrap;
|
|
1093
|
+
`;
|
|
1094
|
+
var HeaderActions = styled7__default.default.div`
|
|
1095
|
+
display: flex;
|
|
1096
|
+
align-items: center;
|
|
1097
|
+
gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
|
|
1098
|
+
margin-left: ${({ theme }) => theme?.spacing?.md ?? "16px"};
|
|
1099
|
+
`;
|
|
1100
|
+
var ActionButton = styled7__default.default.button`
|
|
1101
|
+
display: inline-flex;
|
|
1102
|
+
align-items: center;
|
|
1103
|
+
justify-content: center;
|
|
1104
|
+
width: 32px;
|
|
1105
|
+
height: 32px;
|
|
1106
|
+
padding: 0;
|
|
1107
|
+
background-color: transparent;
|
|
1108
|
+
border: none;
|
|
1109
|
+
border-radius: 6px;
|
|
1110
|
+
color: #e5e5e7;
|
|
1111
|
+
cursor: pointer;
|
|
1112
|
+
transition: all 150ms ease;
|
|
1113
|
+
|
|
1114
|
+
&:hover:not(:disabled) {
|
|
1115
|
+
background-color: #3a3a3c;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
&:active:not(:disabled) {
|
|
1119
|
+
transform: scale(0.95);
|
|
1120
|
+
background-color: #48484a;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
&:focus-visible {
|
|
1124
|
+
outline: 2px solid #5B9FFF;
|
|
1125
|
+
outline-offset: 2px;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
&:disabled {
|
|
1129
|
+
cursor: not-allowed;
|
|
1130
|
+
opacity: 0.3;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
svg {
|
|
1134
|
+
width: 16px;
|
|
1135
|
+
height: 16px;
|
|
1136
|
+
display: block;
|
|
1137
|
+
}
|
|
1138
|
+
`;
|
|
1139
|
+
var Header = ({
|
|
1140
|
+
title,
|
|
1141
|
+
subtitle,
|
|
1142
|
+
onClose,
|
|
1143
|
+
onMinimize,
|
|
1144
|
+
className
|
|
1145
|
+
}) => {
|
|
1146
|
+
const minimizeRef = react.useRef(null);
|
|
1147
|
+
const closeRef = react.useRef(null);
|
|
1148
|
+
const { buttonProps: minimizeProps } = button.useButton(
|
|
1149
|
+
{
|
|
1150
|
+
onPress: onMinimize,
|
|
1151
|
+
"aria-label": "Minimize",
|
|
1152
|
+
isDisabled: !onMinimize
|
|
1153
|
+
},
|
|
1154
|
+
minimizeRef
|
|
1155
|
+
);
|
|
1156
|
+
const { buttonProps: closeProps } = button.useButton(
|
|
1157
|
+
{
|
|
1158
|
+
onPress: onClose,
|
|
1159
|
+
"aria-label": "Close",
|
|
1160
|
+
isDisabled: !onClose
|
|
1161
|
+
},
|
|
1162
|
+
closeRef
|
|
1163
|
+
);
|
|
1164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HeaderContainer, { className, children: [
|
|
1165
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HeaderContent, { children: [
|
|
1166
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeaderTitle, { children: title }),
|
|
1167
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(HeaderSubtitle, { children: subtitle })
|
|
1168
|
+
] }),
|
|
1169
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HeaderActions, { children: [
|
|
1170
|
+
onMinimize && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { ref: minimizeRef, ...minimizeProps, "data-action": "minimize", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1171
|
+
"svg",
|
|
1172
|
+
{
|
|
1173
|
+
width: "16",
|
|
1174
|
+
height: "16",
|
|
1175
|
+
viewBox: "0 0 16 16",
|
|
1176
|
+
fill: "none",
|
|
1177
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1178
|
+
"aria-hidden": "true",
|
|
1179
|
+
children: [
|
|
1180
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Minimize" }),
|
|
1181
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "8", x2: "13", y2: "8", stroke: "currentColor", strokeWidth: "2" })
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
) }),
|
|
1185
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { ref: closeRef, ...closeProps, "data-action": "close", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1186
|
+
"svg",
|
|
1187
|
+
{
|
|
1188
|
+
width: "16",
|
|
1189
|
+
height: "16",
|
|
1190
|
+
viewBox: "0 0 16 16",
|
|
1191
|
+
fill: "none",
|
|
1192
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1193
|
+
"aria-hidden": "true",
|
|
1194
|
+
children: [
|
|
1195
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Close" }),
|
|
1196
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "4", x2: "12", y2: "12", stroke: "currentColor", strokeWidth: "2" }),
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "4", x2: "4", y2: "12", stroke: "currentColor", strokeWidth: "2" })
|
|
1198
|
+
]
|
|
1199
|
+
}
|
|
1200
|
+
) })
|
|
1201
|
+
] })
|
|
1202
|
+
] });
|
|
1203
|
+
};
|
|
1204
|
+
Header.displayName = "Header";
|
|
1205
|
+
var InputContainer = styled7__default.default.div`
|
|
1206
|
+
display: flex;
|
|
1207
|
+
flex-direction: column;
|
|
1208
|
+
width: 100%;
|
|
1209
|
+
position: relative;
|
|
1210
|
+
`;
|
|
1211
|
+
var InputWrapper2 = styled7__default.default.div`
|
|
1212
|
+
display: flex;
|
|
1213
|
+
align-items: flex-end;
|
|
1214
|
+
gap: 8px;
|
|
1215
|
+
padding: 12px;
|
|
1216
|
+
background-color: #ffffff;
|
|
1217
|
+
border: 1px solid #e5e7eb;
|
|
1218
|
+
border-radius: 12px;
|
|
1219
|
+
transition: all 0.2s ease;
|
|
1220
|
+
|
|
1221
|
+
&:focus-within {
|
|
1222
|
+
border-color: #3b82f6;
|
|
1223
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
&:hover:not(:focus-within) {
|
|
1227
|
+
border-color: #d1d5db;
|
|
1228
|
+
}
|
|
1229
|
+
`;
|
|
1230
|
+
var TextArea = styled7__default.default.textarea`
|
|
1231
|
+
flex: 1;
|
|
1232
|
+
min-height: 24px;
|
|
1233
|
+
max-height: ${(props) => `${(props.$maxRows || 5) * 24}px`};
|
|
1234
|
+
padding: 0;
|
|
1235
|
+
border: none;
|
|
1236
|
+
outline: none;
|
|
1237
|
+
resize: none;
|
|
1238
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1239
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1240
|
+
font-size: 14px;
|
|
1241
|
+
line-height: 24px;
|
|
1242
|
+
color: #111827;
|
|
1243
|
+
background: transparent;
|
|
1244
|
+
overflow-y: auto;
|
|
1245
|
+
|
|
1246
|
+
&::placeholder {
|
|
1247
|
+
color: #9ca3af;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
&:disabled {
|
|
1251
|
+
color: #9ca3af;
|
|
1252
|
+
cursor: not-allowed;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
&:read-only {
|
|
1256
|
+
cursor: default;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/* Custom scrollbar */
|
|
1260
|
+
&::-webkit-scrollbar {
|
|
1261
|
+
width: 6px;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
&::-webkit-scrollbar-track {
|
|
1265
|
+
background: transparent;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
&::-webkit-scrollbar-thumb {
|
|
1269
|
+
background: #d1d5db;
|
|
1270
|
+
border-radius: 3px;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1274
|
+
background: #9ca3af;
|
|
1275
|
+
}
|
|
1276
|
+
`;
|
|
1277
|
+
var SendButton = styled7__default.default.button`
|
|
1278
|
+
display: flex;
|
|
1279
|
+
align-items: center;
|
|
1280
|
+
justify-content: center;
|
|
1281
|
+
width: 36px;
|
|
1282
|
+
height: 36px;
|
|
1283
|
+
padding: 0;
|
|
1284
|
+
border: none;
|
|
1285
|
+
border-radius: 8px;
|
|
1286
|
+
background-color: ${(props) => props.disabled ? "#e5e7eb" : "#3b82f6"};
|
|
1287
|
+
color: ${(props) => props.disabled ? "#9ca3af" : "#ffffff"};
|
|
1288
|
+
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
1289
|
+
transition: all 0.2s ease;
|
|
1290
|
+
flex-shrink: 0;
|
|
1291
|
+
|
|
1292
|
+
&:hover:not(:disabled) {
|
|
1293
|
+
background-color: #2563eb;
|
|
1294
|
+
transform: translateY(-1px);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
&:active:not(:disabled) {
|
|
1298
|
+
transform: translateY(0);
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
&:focus-visible {
|
|
1302
|
+
outline: 2px solid #3b82f6;
|
|
1303
|
+
outline-offset: 2px;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
svg {
|
|
1307
|
+
width: 20px;
|
|
1308
|
+
height: 20px;
|
|
1309
|
+
}
|
|
1310
|
+
`;
|
|
1311
|
+
var Input = ({
|
|
1312
|
+
value = "",
|
|
1313
|
+
onChange,
|
|
1314
|
+
onSubmit,
|
|
1315
|
+
placeholder = "Type a message...",
|
|
1316
|
+
isDisabled = false,
|
|
1317
|
+
isReadOnly = false,
|
|
1318
|
+
maxRows = 5,
|
|
1319
|
+
autoFocus = false,
|
|
1320
|
+
className,
|
|
1321
|
+
"aria-label": ariaLabel = "Message input",
|
|
1322
|
+
...ariaProps
|
|
1323
|
+
}) => {
|
|
1324
|
+
const textareaRef = react.useRef(null);
|
|
1325
|
+
const { inputProps } = textfield.useTextField(
|
|
1326
|
+
{
|
|
1327
|
+
...ariaProps,
|
|
1328
|
+
"aria-label": ariaLabel,
|
|
1329
|
+
value,
|
|
1330
|
+
onChange: (newValue) => {
|
|
1331
|
+
onChange?.(newValue);
|
|
1332
|
+
},
|
|
1333
|
+
isDisabled,
|
|
1334
|
+
isReadOnly,
|
|
1335
|
+
inputElementType: "textarea"
|
|
1336
|
+
},
|
|
1337
|
+
textareaRef
|
|
1338
|
+
);
|
|
1339
|
+
const handleKeyDown = (e) => {
|
|
1340
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
1341
|
+
e.preventDefault();
|
|
1342
|
+
if (value.trim() && onSubmit && !isDisabled && !isReadOnly) {
|
|
1343
|
+
onSubmit(value.trim());
|
|
1344
|
+
onChange?.("");
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
const handleSend = () => {
|
|
1349
|
+
if (value.trim() && onSubmit && !isDisabled && !isReadOnly) {
|
|
1350
|
+
onSubmit(value.trim());
|
|
1351
|
+
onChange?.("");
|
|
1352
|
+
textareaRef.current?.focus();
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
const canSend = value.trim().length > 0 && !isDisabled && !isReadOnly;
|
|
1356
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputContainer, { className, children: /* @__PURE__ */ jsxRuntime.jsxs(InputWrapper2, { children: [
|
|
1357
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1358
|
+
TextArea,
|
|
1359
|
+
{
|
|
1360
|
+
...inputProps,
|
|
1361
|
+
ref: textareaRef,
|
|
1362
|
+
placeholder,
|
|
1363
|
+
onKeyDown: handleKeyDown,
|
|
1364
|
+
$maxRows: maxRows,
|
|
1365
|
+
autoFocus,
|
|
1366
|
+
disabled: isDisabled,
|
|
1367
|
+
readOnly: isReadOnly
|
|
1368
|
+
}
|
|
1369
|
+
),
|
|
1370
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1371
|
+
SendButton,
|
|
1372
|
+
{
|
|
1373
|
+
type: "button",
|
|
1374
|
+
onClick: handleSend,
|
|
1375
|
+
disabled: !canSend,
|
|
1376
|
+
"aria-label": "Send message",
|
|
1377
|
+
title: "Send message (Enter)",
|
|
1378
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1379
|
+
"svg",
|
|
1380
|
+
{
|
|
1381
|
+
width: "20",
|
|
1382
|
+
height: "20",
|
|
1383
|
+
viewBox: "0 0 20 20",
|
|
1384
|
+
fill: "none",
|
|
1385
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1386
|
+
role: "img",
|
|
1387
|
+
"aria-hidden": "true",
|
|
1388
|
+
children: [
|
|
1389
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Send Icon" }),
|
|
1390
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1391
|
+
"path",
|
|
1392
|
+
{
|
|
1393
|
+
d: "M2.5 10L17.5 3.75L11.25 18.75L10 12.5L2.5 10Z",
|
|
1394
|
+
stroke: "currentColor",
|
|
1395
|
+
strokeWidth: "2",
|
|
1396
|
+
strokeLinecap: "round",
|
|
1397
|
+
strokeLinejoin: "round"
|
|
1398
|
+
}
|
|
1399
|
+
)
|
|
1400
|
+
]
|
|
1401
|
+
}
|
|
1402
|
+
)
|
|
1403
|
+
}
|
|
1404
|
+
)
|
|
1405
|
+
] }) });
|
|
1406
|
+
};
|
|
1407
|
+
var FileAttachmentContainer = styled7__default.default.div`
|
|
1408
|
+
display: flex;
|
|
1409
|
+
align-items: center;
|
|
1410
|
+
gap: 8px;
|
|
1411
|
+
padding: 12px;
|
|
1412
|
+
background-color: #3a3a3c;
|
|
1413
|
+
border: 1px solid #48484a;
|
|
1414
|
+
border-radius: 8px;
|
|
1415
|
+
max-width: 320px;
|
|
1416
|
+
cursor: ${(props) => props.$isInteractive ? "pointer" : "default"};
|
|
1417
|
+
transition: border-color 0.15s ease;
|
|
1418
|
+
|
|
1419
|
+
/* Remove default button styles when used as button */
|
|
1420
|
+
${(props) => props.$isInteractive && `
|
|
1421
|
+
font: inherit;
|
|
1422
|
+
color: inherit;
|
|
1423
|
+
text-align: left;
|
|
1424
|
+
appearance: none;
|
|
1425
|
+
-webkit-appearance: none;
|
|
1426
|
+
|
|
1427
|
+
&:hover {
|
|
1428
|
+
border-color: #5a5a5c;
|
|
1429
|
+
background-color: #48484a;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
&:focus-visible {
|
|
1433
|
+
outline: 2px solid #5B9FFF;
|
|
1434
|
+
outline-offset: 2px;
|
|
1435
|
+
border-color: #5B9FFF;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
&:active {
|
|
1439
|
+
border-color: #6a6a6c;
|
|
1440
|
+
}
|
|
1441
|
+
`}
|
|
1442
|
+
`;
|
|
1443
|
+
var FileIconContainer = styled7__default.default.div`
|
|
1444
|
+
flex-shrink: 0;
|
|
1445
|
+
width: 32px;
|
|
1446
|
+
height: 32px;
|
|
1447
|
+
display: flex;
|
|
1448
|
+
align-items: center;
|
|
1449
|
+
justify-content: center;
|
|
1450
|
+
font-size: 24px;
|
|
1451
|
+
line-height: 1;
|
|
1452
|
+
`;
|
|
1453
|
+
var FileInfo = styled7__default.default.div`
|
|
1454
|
+
flex: 1;
|
|
1455
|
+
min-width: 0;
|
|
1456
|
+
display: flex;
|
|
1457
|
+
flex-direction: column;
|
|
1458
|
+
gap: 2px;
|
|
1459
|
+
`;
|
|
1460
|
+
var FileTitle = styled7__default.default.div`
|
|
1461
|
+
font-size: 14px;
|
|
1462
|
+
font-weight: 500;
|
|
1463
|
+
color: #e5e5e7;
|
|
1464
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1465
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1466
|
+
line-height: 1.4;
|
|
1467
|
+
overflow: hidden;
|
|
1468
|
+
text-overflow: ellipsis;
|
|
1469
|
+
white-space: nowrap;
|
|
1470
|
+
`;
|
|
1471
|
+
var FileMetadata = styled7__default.default.div`
|
|
1472
|
+
display: flex;
|
|
1473
|
+
align-items: center;
|
|
1474
|
+
gap: 4px;
|
|
1475
|
+
font-size: 12px;
|
|
1476
|
+
color: #8e8e93;
|
|
1477
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1478
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1479
|
+
line-height: 1.4;
|
|
1480
|
+
overflow: hidden;
|
|
1481
|
+
`;
|
|
1482
|
+
var FileSubtitle = styled7__default.default.span`
|
|
1483
|
+
color: #8e8e93;
|
|
1484
|
+
white-space: nowrap;
|
|
1485
|
+
overflow: hidden;
|
|
1486
|
+
text-overflow: ellipsis;
|
|
1487
|
+
|
|
1488
|
+
&:last-child {
|
|
1489
|
+
flex-shrink: 0;
|
|
1490
|
+
}
|
|
1491
|
+
`;
|
|
1492
|
+
var FileAttachment = ({
|
|
1493
|
+
title,
|
|
1494
|
+
subtitle,
|
|
1495
|
+
size,
|
|
1496
|
+
icon = "\u{1F4C4}",
|
|
1497
|
+
onClick,
|
|
1498
|
+
onPress,
|
|
1499
|
+
className,
|
|
1500
|
+
...ariaProps
|
|
1501
|
+
}) => {
|
|
1502
|
+
const ref = react.useRef(null);
|
|
1503
|
+
const isInteractive = !!(onClick || onPress);
|
|
1504
|
+
const handlePress = (e) => {
|
|
1505
|
+
if (onClick) onClick();
|
|
1506
|
+
if (onPress) onPress(e);
|
|
1507
|
+
};
|
|
1508
|
+
const { buttonProps } = button.useButton(
|
|
1509
|
+
{
|
|
1510
|
+
...ariaProps,
|
|
1511
|
+
onPress: isInteractive ? handlePress : void 0,
|
|
1512
|
+
isDisabled: !isInteractive
|
|
1513
|
+
},
|
|
1514
|
+
ref
|
|
1515
|
+
);
|
|
1516
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1517
|
+
FileAttachmentContainer,
|
|
1518
|
+
{
|
|
1519
|
+
...isInteractive ? buttonProps : {},
|
|
1520
|
+
ref: isInteractive ? ref : void 0,
|
|
1521
|
+
className,
|
|
1522
|
+
$isInteractive: isInteractive,
|
|
1523
|
+
as: isInteractive ? "button" : "div",
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsxRuntime.jsx(FileIconContainer, { children: icon }),
|
|
1526
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FileInfo, { children: [
|
|
1527
|
+
/* @__PURE__ */ jsxRuntime.jsx(FileTitle, { children: title }),
|
|
1528
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FileMetadata, { children: [
|
|
1529
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { children: subtitle }),
|
|
1530
|
+
size && subtitle && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { "aria-hidden": "true", children: " \u2022 " }),
|
|
1531
|
+
size && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { children: size })
|
|
1532
|
+
] })
|
|
1533
|
+
] })
|
|
1534
|
+
]
|
|
1535
|
+
}
|
|
1536
|
+
);
|
|
1537
|
+
};
|
|
1538
|
+
var MessageContainer = styled7__default.default.div`
|
|
1539
|
+
display: flex;
|
|
1540
|
+
gap: 12px;
|
|
1541
|
+
align-items: flex-start;
|
|
1542
|
+
padding: 8px 0;
|
|
1543
|
+
max-width: 100%;
|
|
1544
|
+
`;
|
|
1545
|
+
var AvatarContainer = styled7__default.default.div`
|
|
1546
|
+
flex-shrink: 0;
|
|
1547
|
+
`;
|
|
1548
|
+
var Avatar2 = styled7__default.default.img`
|
|
1549
|
+
width: 32px;
|
|
1550
|
+
height: 32px;
|
|
1551
|
+
border-radius: 50%;
|
|
1552
|
+
object-fit: cover;
|
|
1553
|
+
background-color: #e5e7eb;
|
|
1554
|
+
`;
|
|
1555
|
+
var AvatarInitials = styled7__default.default.div`
|
|
1556
|
+
width: 32px;
|
|
1557
|
+
height: 32px;
|
|
1558
|
+
border-radius: 50%;
|
|
1559
|
+
background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
|
|
1560
|
+
color: white;
|
|
1561
|
+
display: flex;
|
|
1562
|
+
align-items: center;
|
|
1563
|
+
justify-content: center;
|
|
1564
|
+
font-size: 12px;
|
|
1565
|
+
font-weight: 600;
|
|
1566
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
1567
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1568
|
+
|
|
1569
|
+
svg {
|
|
1570
|
+
width: 18px;
|
|
1571
|
+
height: 18px;
|
|
1572
|
+
}
|
|
1573
|
+
`;
|
|
1574
|
+
var ContentContainer = styled7__default.default.div`
|
|
1575
|
+
flex: 1;
|
|
1576
|
+
min-width: 0;
|
|
1577
|
+
`;
|
|
1578
|
+
var MessageContent = styled7__default.default.div`
|
|
1579
|
+
background-color: #2c2c2e;
|
|
1580
|
+
padding: 12px 16px;
|
|
1581
|
+
border-radius: 16px;
|
|
1582
|
+
border-top-left-radius: 4px;
|
|
1583
|
+
color: #e5e5e7;
|
|
1584
|
+
font-size: 14px;
|
|
1585
|
+
line-height: 1.5;
|
|
1586
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
1587
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1588
|
+
word-wrap: break-word;
|
|
1589
|
+
white-space: pre-wrap;
|
|
1590
|
+
`;
|
|
1591
|
+
var LoadingDots3 = styled7__default.default.div`
|
|
1592
|
+
display: flex;
|
|
1593
|
+
gap: 6px;
|
|
1594
|
+
padding: 12px 16px;
|
|
1595
|
+
background-color: #2c2c2e;
|
|
1596
|
+
border-radius: 16px;
|
|
1597
|
+
border-top-left-radius: 4px;
|
|
1598
|
+
width: fit-content;
|
|
1599
|
+
`;
|
|
1600
|
+
var bounce = styled7.keyframes`
|
|
1601
|
+
0%, 60%, 100% {
|
|
1602
|
+
transform: translateY(0);
|
|
1603
|
+
}
|
|
1604
|
+
30% {
|
|
1605
|
+
transform: translateY(-8px);
|
|
1606
|
+
}
|
|
1607
|
+
`;
|
|
1608
|
+
var LoadingDot = styled7__default.default.div`
|
|
1609
|
+
width: 8px;
|
|
1610
|
+
height: 8px;
|
|
1611
|
+
border-radius: 50%;
|
|
1612
|
+
background-color: #8e8e93;
|
|
1613
|
+
animation: ${bounce} 1.4s ease-in-out infinite;
|
|
1614
|
+
animation-delay: ${(props) => props.delay}s;
|
|
1615
|
+
`;
|
|
1616
|
+
var AttachmentsContainer = styled7__default.default.div`
|
|
1617
|
+
display: flex;
|
|
1618
|
+
flex-direction: column;
|
|
1619
|
+
gap: 8px;
|
|
1620
|
+
margin-top: 12px;
|
|
1621
|
+
`;
|
|
1622
|
+
var AssistantMessage = ({
|
|
1623
|
+
content = "",
|
|
1624
|
+
avatarUrl,
|
|
1625
|
+
avatarInitials: _avatarInitials = "AI",
|
|
1626
|
+
isLoading = false,
|
|
1627
|
+
className,
|
|
1628
|
+
attachments = [],
|
|
1629
|
+
enableMarkdown: _enableMarkdown = false
|
|
1630
|
+
}) => {
|
|
1631
|
+
const renderContent = () => {
|
|
1632
|
+
if (isLoading) {
|
|
1633
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(LoadingDots3, { children: [
|
|
1634
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0 }),
|
|
1635
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0.2 }),
|
|
1636
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0.4 })
|
|
1637
|
+
] });
|
|
1638
|
+
}
|
|
1639
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1640
|
+
content && /* @__PURE__ */ jsxRuntime.jsx(MessageContent, { children: content }),
|
|
1641
|
+
attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(AttachmentsContainer, { children: attachments.map((attachment, index) => /* @__PURE__ */ jsxRuntime.jsx(FileAttachment, { ...attachment }, `${attachment.title}-${index}`)) })
|
|
1642
|
+
] });
|
|
1643
|
+
};
|
|
1644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(MessageContainer, { className, children: [
|
|
1645
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarContainer, { children: avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(Avatar2, { src: avatarUrl, alt: "Assistant avatar" }) : /* @__PURE__ */ jsxRuntime.jsx(AvatarInitials, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 13a4 4 0 0 1 0 8c-2.142 0-4-1.79-4-4h-2a4 4 0 1 1-.535-2h3.07A4 4 0 0 1 17 13M2 12v-2h2V7a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v3h2v2z" }) }) }) }),
|
|
1646
|
+
/* @__PURE__ */ jsxRuntime.jsx(ContentContainer, { children: renderContent() })
|
|
1647
|
+
] });
|
|
1648
|
+
};
|
|
1649
|
+
var MessagesContainer = styled7__default.default.div`
|
|
1650
|
+
display: flex;
|
|
1651
|
+
flex-direction: column;
|
|
1652
|
+
flex: 1;
|
|
1653
|
+
overflow: hidden;
|
|
1654
|
+
background-color: #1c1c1e;
|
|
1655
|
+
padding: 8px;
|
|
1656
|
+
gap: 12px;
|
|
1657
|
+
box-sizing: border-box;
|
|
1658
|
+
|
|
1659
|
+
/* Ensure proper scrolling behavior for child components */
|
|
1660
|
+
position: relative;
|
|
1661
|
+
min-height: 0;
|
|
1662
|
+
|
|
1663
|
+
/* Desktop padding */
|
|
1664
|
+
@media (min-width: 640px) {
|
|
1665
|
+
padding: 12px;
|
|
1666
|
+
}
|
|
1667
|
+
`;
|
|
1668
|
+
var Messages = ({
|
|
1669
|
+
children,
|
|
1670
|
+
className,
|
|
1671
|
+
ariaLabel = "Messages"
|
|
1672
|
+
}) => {
|
|
1673
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MessagesContainer, { className, role: "region", "aria-label": ariaLabel, children });
|
|
1674
|
+
};
|
|
1675
|
+
Messages.displayName = "Messages";
|
|
1676
|
+
var MessagesListContainer = styled7__default.default.div`
|
|
1677
|
+
display: flex;
|
|
1678
|
+
flex-direction: column;
|
|
1679
|
+
width: 100%;
|
|
1680
|
+
max-height: ${(props) => props.$maxHeight};
|
|
1681
|
+
overflow-y: auto;
|
|
1682
|
+
overflow-x: hidden;
|
|
1683
|
+
position: relative;
|
|
1684
|
+
background: #ffffff;
|
|
1685
|
+
border: 1px solid #e5e7eb;
|
|
1686
|
+
border-radius: 8px;
|
|
1687
|
+
scroll-behavior: smooth;
|
|
1688
|
+
|
|
1689
|
+
/* Custom scrollbar styling */
|
|
1690
|
+
&::-webkit-scrollbar {
|
|
1691
|
+
width: 8px;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
&::-webkit-scrollbar-track {
|
|
1695
|
+
background: #f1f5f9;
|
|
1696
|
+
border-radius: 4px;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
&::-webkit-scrollbar-thumb {
|
|
1700
|
+
background: #cbd5e1;
|
|
1701
|
+
border-radius: 4px;
|
|
1702
|
+
transition: background 0.2s ease;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1706
|
+
background: #94a3b8;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/* Firefox scrollbar styling */
|
|
1710
|
+
scrollbar-width: thin;
|
|
1711
|
+
scrollbar-color: #cbd5e1 #f1f5f9;
|
|
1712
|
+
|
|
1713
|
+
/* Ensure proper rendering on mobile */
|
|
1714
|
+
-webkit-overflow-scrolling: touch;
|
|
1715
|
+
`;
|
|
1716
|
+
var MessagesListContent = styled7__default.default.div`
|
|
1717
|
+
display: flex;
|
|
1718
|
+
flex-direction: column;
|
|
1719
|
+
gap: 12px;
|
|
1720
|
+
padding: 16px;
|
|
1721
|
+
min-height: min-content;
|
|
1722
|
+
|
|
1723
|
+
/* Message styling */
|
|
1724
|
+
.message {
|
|
1725
|
+
display: flex;
|
|
1726
|
+
flex-direction: column;
|
|
1727
|
+
gap: 4px;
|
|
1728
|
+
padding: 12px 16px;
|
|
1729
|
+
border-radius: 8px;
|
|
1730
|
+
max-width: 85%;
|
|
1731
|
+
word-wrap: break-word;
|
|
1732
|
+
animation: messageSlideIn 0.2s ease-out;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
@keyframes messageSlideIn {
|
|
1736
|
+
from {
|
|
1737
|
+
opacity: 0;
|
|
1738
|
+
transform: translateY(8px);
|
|
1739
|
+
}
|
|
1740
|
+
to {
|
|
1741
|
+
opacity: 1;
|
|
1742
|
+
transform: translateY(0);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/* Role-specific message styling */
|
|
1747
|
+
.message--user {
|
|
1748
|
+
align-self: flex-end;
|
|
1749
|
+
background: #3b82f6;
|
|
1750
|
+
color: #ffffff;
|
|
1751
|
+
border-bottom-right-radius: 4px;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.message--assistant {
|
|
1755
|
+
align-self: flex-start;
|
|
1756
|
+
background: #f1f5f9;
|
|
1757
|
+
color: #1e293b;
|
|
1758
|
+
border-bottom-left-radius: 4px;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
.message--system {
|
|
1762
|
+
align-self: center;
|
|
1763
|
+
background: #fef3c7;
|
|
1764
|
+
color: #92400e;
|
|
1765
|
+
font-size: 0.875rem;
|
|
1766
|
+
font-style: italic;
|
|
1767
|
+
max-width: 100%;
|
|
1768
|
+
text-align: center;
|
|
1769
|
+
}
|
|
1770
|
+
`;
|
|
1771
|
+
var MessagesList = ({
|
|
1772
|
+
messages,
|
|
1773
|
+
autoScroll = true,
|
|
1774
|
+
className,
|
|
1775
|
+
renderMessage,
|
|
1776
|
+
onScrollTop,
|
|
1777
|
+
maxHeight = "600px"
|
|
1778
|
+
}) => {
|
|
1779
|
+
const containerRef = react.useRef(null);
|
|
1780
|
+
const contentRef = react.useRef(null);
|
|
1781
|
+
const isUserScrollingRef = react.useRef(false);
|
|
1782
|
+
const scrollTimeoutRef = react.useRef(null);
|
|
1783
|
+
react.useEffect(() => {
|
|
1784
|
+
if (autoScroll && !isUserScrollingRef.current && containerRef.current) {
|
|
1785
|
+
const container = containerRef.current;
|
|
1786
|
+
container.scrollTop = container.scrollHeight;
|
|
1787
|
+
}
|
|
1788
|
+
}, [messages.length, autoScroll]);
|
|
1789
|
+
const handleScroll = () => {
|
|
1790
|
+
if (!containerRef.current) return;
|
|
1791
|
+
const container = containerRef.current;
|
|
1792
|
+
const isAtBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 10;
|
|
1793
|
+
isUserScrollingRef.current = !isAtBottom;
|
|
1794
|
+
if (scrollTimeoutRef.current) {
|
|
1795
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
1796
|
+
}
|
|
1797
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
1798
|
+
isUserScrollingRef.current = false;
|
|
1799
|
+
}, 1e3);
|
|
1800
|
+
if (container.scrollTop === 0 && onScrollTop) {
|
|
1801
|
+
onScrollTop();
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
react.useEffect(() => {
|
|
1805
|
+
return () => {
|
|
1806
|
+
if (scrollTimeoutRef.current) {
|
|
1807
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
}, []);
|
|
1811
|
+
const defaultRenderMessage = (message) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1812
|
+
"div",
|
|
1813
|
+
{
|
|
1814
|
+
className: `message message--${message.role}`,
|
|
1815
|
+
"data-message-id": message.id,
|
|
1816
|
+
"data-role": message.role,
|
|
1817
|
+
children: message.content
|
|
1818
|
+
},
|
|
1819
|
+
message.id
|
|
1820
|
+
);
|
|
1821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1822
|
+
MessagesListContainer,
|
|
1823
|
+
{
|
|
1824
|
+
ref: containerRef,
|
|
1825
|
+
onScroll: handleScroll,
|
|
1826
|
+
className,
|
|
1827
|
+
$maxHeight: maxHeight,
|
|
1828
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MessagesListContent, { ref: contentRef, children: messages.map(renderMessage || defaultRenderMessage) })
|
|
1829
|
+
}
|
|
1830
|
+
);
|
|
1831
|
+
};
|
|
1832
|
+
var StyledUserMessage2 = styled7__default.default.div`
|
|
1833
|
+
display: flex;
|
|
1834
|
+
justify-content: flex-end;
|
|
1835
|
+
align-items: flex-start;
|
|
1836
|
+
margin: 8px 0;
|
|
1837
|
+
padding: 0 16px;
|
|
1838
|
+
width: 100%;
|
|
1839
|
+
`;
|
|
1840
|
+
var MessageBubble = styled7__default.default.div`
|
|
1841
|
+
display: flex;
|
|
1842
|
+
flex-direction: column;
|
|
1843
|
+
max-width: 70%;
|
|
1844
|
+
padding: 12px 16px;
|
|
1845
|
+
border-radius: 18px 18px 4px 18px;
|
|
1846
|
+
|
|
1847
|
+
/* User message colors - distinct from assistant messages */
|
|
1848
|
+
background-color: #007AFF;
|
|
1849
|
+
color: #FFFFFF;
|
|
1850
|
+
|
|
1851
|
+
/* Box shadow for depth */
|
|
1852
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1853
|
+
|
|
1854
|
+
/* Smooth transitions */
|
|
1855
|
+
transition: all 0.2s ease-in-out;
|
|
1856
|
+
|
|
1857
|
+
&:hover {
|
|
1858
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
/* Username styling */
|
|
1862
|
+
strong {
|
|
1863
|
+
font-size: 12px;
|
|
1864
|
+
font-weight: 600;
|
|
1865
|
+
margin-bottom: 4px;
|
|
1866
|
+
opacity: 0.9;
|
|
1867
|
+
}
|
|
1868
|
+
`;
|
|
1869
|
+
var MessageContent2 = styled7__default.default.p`
|
|
1870
|
+
margin: 0;
|
|
1871
|
+
font-size: 14px;
|
|
1872
|
+
line-height: 1.5;
|
|
1873
|
+
word-wrap: break-word;
|
|
1874
|
+
white-space: pre-wrap;
|
|
1875
|
+
`;
|
|
1876
|
+
var MessageTime = styled7__default.default.time`
|
|
1877
|
+
font-size: 11px;
|
|
1878
|
+
opacity: 0.7;
|
|
1879
|
+
margin-top: 4px;
|
|
1880
|
+
text-align: right;
|
|
1881
|
+
`;
|
|
1882
|
+
var UserMessage2 = ({
|
|
1883
|
+
content,
|
|
1884
|
+
timestamp,
|
|
1885
|
+
className,
|
|
1886
|
+
avatarUrl,
|
|
1887
|
+
username
|
|
1888
|
+
}) => {
|
|
1889
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledUserMessage2, { className, children: [
|
|
1890
|
+
/* @__PURE__ */ jsxRuntime.jsxs(MessageBubble, { children: [
|
|
1891
|
+
username && /* @__PURE__ */ jsxRuntime.jsx("strong", { children: username }),
|
|
1892
|
+
/* @__PURE__ */ jsxRuntime.jsx(MessageContent2, { children: content }),
|
|
1893
|
+
timestamp && /* @__PURE__ */ jsxRuntime.jsx(MessageTime, { children: timestamp })
|
|
1894
|
+
] }),
|
|
1895
|
+
avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1896
|
+
"img",
|
|
1897
|
+
{
|
|
1898
|
+
src: avatarUrl,
|
|
1899
|
+
alt: username || "User",
|
|
1900
|
+
style: { width: "32px", height: "32px", borderRadius: "50%", marginLeft: "8px" }
|
|
1901
|
+
}
|
|
1902
|
+
)
|
|
1903
|
+
] });
|
|
1904
|
+
};
|
|
1905
|
+
var SuggestionsContainer = styled7__default.default.div`
|
|
1906
|
+
display: flex;
|
|
1907
|
+
flex-wrap: wrap;
|
|
1908
|
+
gap: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
|
|
1909
|
+
padding: ${({ theme }) => theme?.spacing?.md ?? "16px"} 0;
|
|
1910
|
+
`;
|
|
1911
|
+
var StyledSuggestion = styled7__default.default.button`
|
|
1912
|
+
/* Base styles */
|
|
1913
|
+
display: inline-flex;
|
|
1914
|
+
align-items: center;
|
|
1915
|
+
justify-content: center;
|
|
1916
|
+
padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
|
|
1917
|
+
font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
|
|
1918
|
+
font-size: 0.875rem;
|
|
1919
|
+
font-weight: 500;
|
|
1920
|
+
color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
|
|
1921
|
+
background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
|
|
1922
|
+
border: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
1923
|
+
border-radius: ${({ theme }) => theme?.radii?.lg ?? "12px"};
|
|
1924
|
+
cursor: pointer;
|
|
1925
|
+
transition: all 0.2s ease-in-out;
|
|
1926
|
+
white-space: nowrap;
|
|
1927
|
+
user-select: none;
|
|
1928
|
+
|
|
1929
|
+
/* Hover state */
|
|
1930
|
+
&:hover:not(:disabled) {
|
|
1931
|
+
background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
|
|
1932
|
+
border-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
1933
|
+
transform: translateY(-1px);
|
|
1934
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
/* Active/Pressed state */
|
|
1938
|
+
&:active:not(:disabled) {
|
|
1939
|
+
transform: translateY(0);
|
|
1940
|
+
box-shadow: none;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
${({ $isPressed }) => $isPressed && styled7.css`
|
|
1944
|
+
transform: scale(0.98);
|
|
1945
|
+
`}
|
|
1946
|
+
|
|
1947
|
+
/* Focus state */
|
|
1948
|
+
&:focus-visible {
|
|
1949
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
1950
|
+
outline-offset: 2px;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/* Remove default focus outline */
|
|
1954
|
+
&:focus {
|
|
1955
|
+
outline: none;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
/* Disabled state */
|
|
1959
|
+
&:disabled {
|
|
1960
|
+
cursor: not-allowed;
|
|
1961
|
+
opacity: 0.5;
|
|
1962
|
+
transform: none;
|
|
1963
|
+
}
|
|
1964
|
+
`;
|
|
1965
|
+
function Suggestions({ suggestions, onSelect, className }) {
|
|
1966
|
+
if (suggestions.length === 0) {
|
|
1967
|
+
return null;
|
|
1968
|
+
}
|
|
1969
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SuggestionsContainer, { className, role: "list", "aria-label": "Suggested prompts", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxRuntime.jsx(SuggestionChip, { suggestion, onSelect }, suggestion)) });
|
|
1970
|
+
}
|
|
1971
|
+
function SuggestionChip({ suggestion, onSelect }) {
|
|
1972
|
+
const ref = react.useRef(null);
|
|
1973
|
+
const { buttonProps, isPressed } = button.useButton(
|
|
1974
|
+
{
|
|
1975
|
+
onPress: () => onSelect(suggestion),
|
|
1976
|
+
"aria-label": `Select suggestion: ${suggestion}`
|
|
1977
|
+
},
|
|
1978
|
+
ref
|
|
1979
|
+
);
|
|
1980
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledSuggestion, { ...buttonProps, ref, $isPressed: isPressed, role: "listitem", children: suggestion });
|
|
1981
|
+
}
|
|
1982
|
+
Suggestions.displayName = "Suggestions";
|
|
1983
|
+
var WindowContainer = styled7__default.default.div`
|
|
1984
|
+
display: flex;
|
|
1985
|
+
flex-direction: column;
|
|
1986
|
+
background-color: #1c1c1e;
|
|
1987
|
+
border-radius: 0;
|
|
1988
|
+
box-shadow: none;
|
|
1989
|
+
overflow: hidden;
|
|
1990
|
+
transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1991
|
+
position: relative;
|
|
1992
|
+
|
|
1993
|
+
/* Default dimensions */
|
|
1994
|
+
width: ${({ $width }) => $width};
|
|
1995
|
+
height: ${({ $height }) => $height};
|
|
1996
|
+
|
|
1997
|
+
/* Fullscreen state */
|
|
1998
|
+
${({ $isFullscreen }) => $isFullscreen && styled7.css`
|
|
1999
|
+
width: 100vw;
|
|
2000
|
+
height: 100vh;
|
|
2001
|
+
border-radius: 0;
|
|
2002
|
+
box-shadow: none;
|
|
2003
|
+
position: fixed;
|
|
2004
|
+
top: 0;
|
|
2005
|
+
left: 0;
|
|
2006
|
+
z-index: 1000;
|
|
2007
|
+
`}
|
|
2008
|
+
|
|
2009
|
+
/* Minimized state */
|
|
2010
|
+
${({ $isMinimized }) => $isMinimized && styled7.css`
|
|
2011
|
+
height: 60px;
|
|
2012
|
+
width: 300px;
|
|
2013
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
2014
|
+
cursor: pointer;
|
|
2015
|
+
|
|
2016
|
+
/* Hide all content except header when minimized */
|
|
2017
|
+
> *:not(:first-child) {
|
|
2018
|
+
display: none;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
/* Keep header visible but adjust styling */
|
|
2022
|
+
> *:first-child {
|
|
2023
|
+
border-bottom: none;
|
|
2024
|
+
}
|
|
2025
|
+
`}
|
|
2026
|
+
|
|
2027
|
+
/* Responsive behavior for smaller screens */
|
|
2028
|
+
@media (max-width: 768px) {
|
|
2029
|
+
${({ $isFullscreen, $isMinimized }) => !$isFullscreen && !$isMinimized && styled7.css`
|
|
2030
|
+
width: 100vw;
|
|
2031
|
+
height: 100vh;
|
|
2032
|
+
border-radius: 0;
|
|
2033
|
+
max-width: 100%;
|
|
2034
|
+
max-height: 100%;
|
|
2035
|
+
`}
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/* Focus states for accessibility */
|
|
2039
|
+
&:focus-visible {
|
|
2040
|
+
outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
|
|
2041
|
+
outline-offset: 2px;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
/* Ensure proper stacking context */
|
|
2045
|
+
z-index: ${({ $isFullscreen }) => $isFullscreen ? 1e3 : 100};
|
|
2046
|
+
`;
|
|
2047
|
+
var Window = ({
|
|
2048
|
+
isMinimized = false,
|
|
2049
|
+
isFullscreen = false,
|
|
2050
|
+
width = "400px",
|
|
2051
|
+
height = "600px",
|
|
2052
|
+
children,
|
|
2053
|
+
className,
|
|
2054
|
+
ariaLabel = "Chat window"
|
|
2055
|
+
}) => {
|
|
2056
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2057
|
+
WindowContainer,
|
|
2058
|
+
{
|
|
2059
|
+
className,
|
|
2060
|
+
$isMinimized: isMinimized,
|
|
2061
|
+
$isFullscreen: isFullscreen,
|
|
2062
|
+
$width: width,
|
|
2063
|
+
$height: height,
|
|
2064
|
+
role: "dialog",
|
|
2065
|
+
"aria-label": ariaLabel,
|
|
2066
|
+
"aria-modal": "false",
|
|
2067
|
+
children
|
|
2068
|
+
}
|
|
2069
|
+
);
|
|
2070
|
+
};
|
|
2071
|
+
Window.displayName = "Window";
|
|
2072
|
+
|
|
2073
|
+
exports.Actions = Actions;
|
|
2074
|
+
exports.AgentState = AgentState;
|
|
2075
|
+
exports.AssistantMessage = AssistantMessage;
|
|
2076
|
+
exports.AssistantThinking = AssistantThinking;
|
|
2077
|
+
exports.Button = Button;
|
|
2078
|
+
exports.ChatInput = ChatInput;
|
|
2079
|
+
exports.FileAttachment = FileAttachment;
|
|
2080
|
+
exports.Footer = Footer;
|
|
2081
|
+
exports.Header = Header;
|
|
2082
|
+
exports.Input = Input;
|
|
2083
|
+
exports.Messages = Messages;
|
|
2084
|
+
exports.MessagesList = MessagesList;
|
|
2085
|
+
exports.MessagesListContainer = MessagesListContainer;
|
|
2086
|
+
exports.MessagesListContent = MessagesListContent;
|
|
2087
|
+
exports.Response = Response;
|
|
2088
|
+
exports.Suggestions = Suggestions;
|
|
2089
|
+
exports.UserMessage = UserMessage;
|
|
2090
|
+
exports.UserMessage2 = UserMessage2;
|
|
2091
|
+
exports.Window = Window;
|
|
2092
|
+
//# sourceMappingURL=chunk-P4Q3MHIY.cjs.map
|
|
2093
|
+
//# sourceMappingURL=chunk-P4Q3MHIY.cjs.map
|