@agentiffai/design 0.1.2 → 0.1.4

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.
@@ -1,2116 +0,0 @@
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(
510
- StyledUserMessage,
511
- {
512
- as: "div",
513
- className,
514
- $isPressed: isPressed,
515
- role: "presentation",
516
- children
517
- }
518
- );
519
- }
520
- const { buttonProps, isPressed: ariaPressedState } = button.useButton(
521
- {
522
- ...ariaProps,
523
- onPress
524
- },
525
- ref
526
- );
527
- return /* @__PURE__ */ jsxRuntime.jsx(
528
- StyledUserMessage,
529
- {
530
- ...buttonProps,
531
- ref,
532
- className,
533
- $isPressed: isPressed || ariaPressedState,
534
- role: "button",
535
- tabIndex: 0,
536
- children
537
- }
538
- );
539
- }
540
- UserMessage.displayName = "UserMessage";
541
- var variantStyles = {
542
- primary: styled7.css`
543
- background-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
544
- color: white;
545
- border: none;
546
-
547
- &:hover:not(:disabled) {
548
- opacity: 0.9;
549
- transform: translateY(-1px);
550
- }
551
-
552
- &:active:not(:disabled) {
553
- opacity: 0.8;
554
- transform: translateY(0);
555
- }
556
-
557
- &:focus-visible {
558
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
559
- outline-offset: 2px;
560
- }
561
- `,
562
- secondary: styled7.css`
563
- background-color: transparent;
564
- color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
565
- border: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
566
-
567
- &:hover:not(:disabled) {
568
- background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
569
- border-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
570
- }
571
-
572
- &:active:not(:disabled) {
573
- background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
574
- }
575
-
576
- &:focus-visible {
577
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
578
- outline-offset: 2px;
579
- }
580
- `,
581
- icon: styled7.css`
582
- background-color: transparent;
583
- color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
584
- border: none;
585
- padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
586
- min-width: auto;
587
-
588
- &:hover:not(:disabled) {
589
- background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
590
- opacity: 0.8;
591
- }
592
-
593
- &:active:not(:disabled) {
594
- opacity: 0.6;
595
- }
596
-
597
- &:focus-visible {
598
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
599
- outline-offset: 2px;
600
- }
601
- `
602
- };
603
- var sizeStyles = {
604
- small: styled7.css`
605
- padding: ${({ theme }) => theme?.spacing?.xs ?? "4px"} ${({ theme }) => theme?.spacing?.sm ?? "8px"};
606
- font-size: 0.875rem;
607
- min-width: 60px;
608
- height: 28px;
609
- `,
610
- medium: styled7.css`
611
- padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
612
- font-size: 1rem;
613
- min-width: 80px;
614
- height: 36px;
615
- `,
616
- large: styled7.css`
617
- padding: ${({ theme }) => theme?.spacing?.md ?? "16px"} ${({ theme }) => theme?.spacing?.lg ?? "24px"};
618
- font-size: 1.125rem;
619
- min-width: 100px;
620
- height: 44px;
621
- `
622
- };
623
- var StyledButton = styled7__default.default.button`
624
- /* Base styles */
625
- display: inline-flex;
626
- align-items: center;
627
- justify-content: center;
628
- gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
629
- font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
630
- font-weight: 500;
631
- border-radius: ${({ theme }) => theme?.radii?.md ?? "8px"};
632
- cursor: pointer;
633
- transition: all 0.2s ease-in-out;
634
- white-space: nowrap;
635
- user-select: none;
636
-
637
- /* Variant styles */
638
- ${({ $variant }) => variantStyles[$variant]}
639
-
640
- /* Size styles */
641
- ${({ $size, $variant }) => $variant !== "icon" && sizeStyles[$size]}
642
-
643
- /* Icon variant size overrides */
644
- ${({ $variant, $size }) => $variant === "icon" && styled7.css`
645
- width: ${$size === "small" ? "28px" : $size === "large" ? "44px" : "36px"};
646
- height: ${$size === "small" ? "28px" : $size === "large" ? "44px" : "36px"};
647
- border-radius: ${({ theme }) => theme?.radii?.sm ?? "4px"};
648
- `}
649
-
650
- /* Pressed state */
651
- ${({ $isPressed }) => $isPressed && styled7.css`
652
- transform: scale(0.98);
653
- `}
654
-
655
- /* Loading state */
656
- ${({ $isLoading }) => $isLoading && styled7.css`
657
- cursor: wait;
658
- opacity: 0.7;
659
- `}
660
-
661
- /* Disabled state */
662
- &:disabled {
663
- cursor: not-allowed;
664
- opacity: 0.5;
665
- transform: none;
666
- }
667
-
668
- /* Remove default focus outline, using focus-visible instead */
669
- &:focus {
670
- outline: none;
671
- }
672
- `;
673
- function Button({
674
- variant = "primary",
675
- size = "medium",
676
- children,
677
- className,
678
- disabled = false,
679
- isLoading = false,
680
- ...ariaProps
681
- }) {
682
- const ref = react.useRef(null);
683
- const { buttonProps, isPressed } = button.useButton(
684
- {
685
- ...ariaProps,
686
- isDisabled: disabled || isLoading
687
- },
688
- ref
689
- );
690
- return /* @__PURE__ */ jsxRuntime.jsx(
691
- StyledButton,
692
- {
693
- ...buttonProps,
694
- ref,
695
- className,
696
- $variant: variant,
697
- $size: size,
698
- $isPressed: isPressed,
699
- $isLoading: isLoading,
700
- disabled: disabled || isLoading,
701
- children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", "aria-busy": "true", children: "Loading..." }) : children
702
- }
703
- );
704
- }
705
- Button.displayName = "Button";
706
- var ActionsContainer = styled7__default.default.div`
707
- display: flex;
708
- gap: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
709
- align-items: center;
710
-
711
- ${({ $layout }) => $layout === "horizontal" ? styled7.css`
712
- flex-direction: row;
713
- flex-wrap: wrap;
714
- ` : styled7.css`
715
- flex-direction: column;
716
- align-items: stretch;
717
-
718
- button {
719
- width: 100%;
720
- }
721
- `}
722
- `;
723
- function Actions({ actions, layout = "horizontal", className }) {
724
- return /* @__PURE__ */ jsxRuntime.jsx(ActionsContainer, { $layout: layout, className, children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
725
- Button,
726
- {
727
- variant: action.variant || "secondary",
728
- onPress: action.onClick,
729
- isDisabled: action.disabled,
730
- "aria-label": action.label,
731
- children: [
732
- action.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: action.icon }),
733
- action.variant !== "icon" && action.label
734
- ]
735
- },
736
- action.id
737
- )) });
738
- }
739
- Actions.displayName = "Actions";
740
- var dotPulse2 = styled7.keyframes`
741
- 0%, 100% {
742
- opacity: 0.3;
743
- transform: scale(0.8);
744
- }
745
- 50% {
746
- opacity: 1;
747
- transform: scale(1);
748
- }
749
- `;
750
- var fadeIn = styled7.keyframes`
751
- from {
752
- opacity: 0;
753
- }
754
- to {
755
- opacity: 1;
756
- }
757
- `;
758
- var blink = styled7.keyframes`
759
- 0%, 49% {
760
- opacity: 1;
761
- }
762
- 50%, 100% {
763
- opacity: 0;
764
- }
765
- `;
766
- var ResponseContainer = styled7__default.default.div`
767
- display: inline-flex;
768
- align-items: center;
769
- gap: 12px;
770
- padding: 12px 16px;
771
- background-color: #2c2c2e;
772
- border-radius: 16px;
773
- box-shadow: none;
774
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
775
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
776
- max-width: fit-content;
777
- margin: 0 auto;
778
- `;
779
- var LoadingDots2 = styled7__default.default.div`
780
- display: flex;
781
- align-items: center;
782
- gap: 4px;
783
- padding: 0 4px;
784
- `;
785
- var Dot2 = styled7__default.default.span`
786
- width: 6px;
787
- height: 6px;
788
- border-radius: 50%;
789
- background-color: #8e8e93;
790
- animation: ${dotPulse2} 1.4s ease-in-out infinite;
791
- animation-delay: ${(props) => props.delay}s;
792
- `;
793
- var TypingIndicator = styled7__default.default.div`
794
- display: flex;
795
- align-items: center;
796
- gap: 4px;
797
- padding: 0 4px;
798
-
799
- ${Dot2} {
800
- width: 6px;
801
- height: 6px;
802
- background-color: #8e8e93;
803
- animation: ${dotPulse2} 1.4s ease-in-out infinite;
804
- }
805
- `;
806
- var Message2 = styled7__default.default.span`
807
- font-size: 14px;
808
- color: #e5e5e7;
809
- font-weight: 400;
810
- line-height: 1.5;
811
- white-space: nowrap;
812
- `;
813
- var StreamingText = styled7__default.default.div`
814
- font-size: 14px;
815
- line-height: 1.5;
816
- color: #e5e5e7;
817
- animation: ${fadeIn} 0.3s ease-in;
818
- position: relative;
819
- font-weight: 400;
820
- white-space: nowrap;
821
-
822
- /* Blinking cursor effect */
823
- &::after {
824
- content: '|';
825
- margin-left: 0.125rem;
826
- animation: ${blink} 1s infinite;
827
- color: #8e8e93;
828
- font-weight: 400;
829
- }
830
- `;
831
- var Response = ({
832
- isLoading = false,
833
- isTyping = false,
834
- isStreaming = false,
835
- streamingContent = "",
836
- message = "Thinking...",
837
- className
838
- }) => {
839
- if (isLoading) {
840
- return /* @__PURE__ */ jsxRuntime.jsxs(ResponseContainer, { className, "data-testid": "response-loading", children: [
841
- /* @__PURE__ */ jsxRuntime.jsxs(LoadingDots2, { "aria-hidden": "true", children: [
842
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0 }),
843
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.15 }),
844
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.3 })
845
- ] }),
846
- /* @__PURE__ */ jsxRuntime.jsx(Message2, { children: message })
847
- ] });
848
- }
849
- if (isTyping) {
850
- return /* @__PURE__ */ jsxRuntime.jsxs(ResponseContainer, { className, "data-testid": "response-typing", children: [
851
- /* @__PURE__ */ jsxRuntime.jsxs(TypingIndicator, { "aria-hidden": "true", children: [
852
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0 }),
853
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.15 }),
854
- /* @__PURE__ */ jsxRuntime.jsx(Dot2, { delay: 0.3 })
855
- ] }),
856
- /* @__PURE__ */ jsxRuntime.jsx(Message2, { children: message })
857
- ] });
858
- }
859
- if (isStreaming && streamingContent) {
860
- return /* @__PURE__ */ jsxRuntime.jsx(ResponseContainer, { className, "data-testid": "response-streaming", children: /* @__PURE__ */ jsxRuntime.jsx(StreamingText, { children: streamingContent }) });
861
- }
862
- return null;
863
- };
864
- var dotPulse3 = styled7.keyframes`
865
- 0%, 100% {
866
- opacity: 0.3;
867
- transform: scale(0.8);
868
- }
869
- 50% {
870
- opacity: 1;
871
- transform: scale(1);
872
- }
873
- `;
874
- var shake = styled7.keyframes`
875
- 0%, 100% {
876
- transform: translateX(0);
877
- }
878
- 25% {
879
- transform: translateX(-5px);
880
- }
881
- 75% {
882
- transform: translateX(5px);
883
- }
884
- `;
885
- var AgentStateContainer = styled7__default.default.div`
886
- display: inline-flex;
887
- flex-direction: column;
888
- align-items: center;
889
- gap: 12px;
890
- padding: 12px 16px;
891
- background-color: ${(props) => props.isError ? "#3a1f1f" : "#2c2c2e"};
892
- border-radius: 16px;
893
- border: ${(props) => props.isError ? "1px solid #7f1d1d" : "none"};
894
- box-shadow: none;
895
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
896
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
897
- max-width: fit-content;
898
- margin: 0 auto;
899
- `;
900
- var StateContent = styled7__default.default.div`
901
- display: flex;
902
- flex-direction: column;
903
- gap: 8px;
904
- align-items: center;
905
- width: 100%;
906
- `;
907
- var IdleIndicator = styled7__default.default.div`
908
- width: 6px;
909
- height: 6px;
910
- background-color: #8e8e93;
911
- border-radius: 50%;
912
- animation: ${dotPulse3} 2s infinite ease-in-out;
913
- `;
914
- var ErrorIndicator = styled7__default.default.div`
915
- width: 6px;
916
- height: 6px;
917
- background-color: #ff6b6b;
918
- border-radius: 50%;
919
- animation: ${shake} 0.5s ease-in-out;
920
- `;
921
- var StateLabel = styled7__default.default.span`
922
- font-size: 14px;
923
- font-weight: 400;
924
- color: #e5e5e7;
925
- line-height: 1.5;
926
- white-space: nowrap;
927
- `;
928
- styled7__default.default.p`
929
- font-size: 14px;
930
- color: #8e8e93;
931
- line-height: 1.5;
932
- margin: 0;
933
- text-align: center;
934
- white-space: nowrap;
935
- `;
936
- var ProgressBar = styled7__default.default.div`
937
- width: 100%;
938
- height: 4px;
939
- background-color: #3a3a3c;
940
- border-radius: 2px;
941
- overflow: hidden;
942
- margin-top: 4px;
943
- `;
944
- var ProgressBarFill = styled7__default.default.div`
945
- height: 100%;
946
- width: ${(props) => Math.min(Math.max(props.progress, 0), 100)}%;
947
- background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
948
- border-radius: 2px;
949
- transition: width 0.3s ease-in-out;
950
- `;
951
- var AgentState = ({ state, message, progress, className }) => {
952
- if (state === "idle") {
953
- return /* @__PURE__ */ jsxRuntime.jsx(AgentStateContainer, { className, "data-testid": "agent-state-idle", children: /* @__PURE__ */ jsxRuntime.jsxs(StateContent, { children: [
954
- /* @__PURE__ */ jsxRuntime.jsx(IdleIndicator, {}),
955
- /* @__PURE__ */ jsxRuntime.jsx(StateLabel, { children: message || "Agent is idle" }),
956
- progress !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarFill, { progress }) })
957
- ] }) });
958
- }
959
- if (state === "error") {
960
- return /* @__PURE__ */ jsxRuntime.jsx(AgentStateContainer, { className, "data-testid": "agent-state-error", isError: true, children: /* @__PURE__ */ jsxRuntime.jsxs(StateContent, { children: [
961
- /* @__PURE__ */ jsxRuntime.jsx(ErrorIndicator, {}),
962
- /* @__PURE__ */ jsxRuntime.jsx(StateLabel, { children: message || "Error occurred" })
963
- ] }) });
964
- }
965
- if (state === "thinking") {
966
- return /* @__PURE__ */ jsxRuntime.jsx(
967
- Response,
968
- {
969
- isLoading: true,
970
- message: message || "Agent is thinking...",
971
- className
972
- }
973
- );
974
- }
975
- if (state === "responding") {
976
- return /* @__PURE__ */ jsxRuntime.jsx(
977
- Response,
978
- {
979
- isTyping: true,
980
- message: message || "Agent is responding...",
981
- className
982
- }
983
- );
984
- }
985
- return null;
986
- };
987
- var FooterContainer = styled7__default.default.footer`
988
- display: flex;
989
- align-items: center;
990
- justify-content: center;
991
- padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
992
- background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
993
- border-top: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
994
- min-height: 44px;
995
- `;
996
- var FooterContent = styled7__default.default.div`
997
- display: flex;
998
- align-items: center;
999
- justify-content: space-between;
1000
- gap: ${({ theme }) => theme?.spacing?.md ?? "16px"};
1001
- width: 100%;
1002
- max-width: 100%;
1003
- font-size: 0.75rem;
1004
- color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
1005
- opacity: 0.6;
1006
- font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
1007
- line-height: 1.4;
1008
- `;
1009
- var FooterBranding = styled7__default.default.div`
1010
- display: flex;
1011
- align-items: center;
1012
- gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
1013
- flex-shrink: 0;
1014
- `;
1015
- var FooterStatus = styled7__default.default.div`
1016
- display: flex;
1017
- align-items: center;
1018
- gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
1019
- overflow: hidden;
1020
- text-overflow: ellipsis;
1021
- white-space: nowrap;
1022
- font-size: 0.75rem;
1023
- opacity: 0.8;
1024
- `;
1025
- var FooterLink = styled7__default.default.a`
1026
- color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
1027
- text-decoration: none;
1028
- transition: opacity 150ms ease;
1029
- cursor: pointer;
1030
-
1031
- &:hover {
1032
- opacity: 0.8;
1033
- text-decoration: underline;
1034
- }
1035
-
1036
- &:focus-visible {
1037
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
1038
- outline-offset: 2px;
1039
- border-radius: ${({ theme }) => theme?.radii?.sm ?? "4px"};
1040
- }
1041
- `;
1042
- var Footer = ({
1043
- branding,
1044
- status,
1045
- brandingUrl,
1046
- onBrandingClick,
1047
- className
1048
- }) => {
1049
- if (!branding && !status) {
1050
- return null;
1051
- }
1052
- const handleBrandingClick = (e) => {
1053
- if (onBrandingClick) {
1054
- e.preventDefault();
1055
- onBrandingClick();
1056
- }
1057
- };
1058
- return /* @__PURE__ */ jsxRuntime.jsx(FooterContainer, { className, children: /* @__PURE__ */ jsxRuntime.jsxs(FooterContent, { children: [
1059
- branding && /* @__PURE__ */ jsxRuntime.jsx(FooterBranding, { children: brandingUrl ? /* @__PURE__ */ jsxRuntime.jsx(
1060
- FooterLink,
1061
- {
1062
- href: brandingUrl,
1063
- onClick: handleBrandingClick,
1064
- target: "_blank",
1065
- rel: "noopener noreferrer",
1066
- children: branding
1067
- }
1068
- ) : branding }),
1069
- status && /* @__PURE__ */ jsxRuntime.jsx(FooterStatus, { children: status })
1070
- ] }) });
1071
- };
1072
- Footer.displayName = "Footer";
1073
- var HeaderContainer = styled7__default.default.header`
1074
- display: flex;
1075
- align-items: center;
1076
- justify-content: space-between;
1077
- padding: 8px;
1078
- background-color: #2c2c2e;
1079
- border-bottom: 1px solid #3a3a3c;
1080
- min-height: 60px;
1081
- box-sizing: border-box;
1082
-
1083
- @media (min-width: 640px) {
1084
- padding: 12px;
1085
- }
1086
- `;
1087
- var HeaderContent = styled7__default.default.div`
1088
- display: flex;
1089
- flex-direction: column;
1090
- gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
1091
- flex: 1;
1092
- min-width: 0;
1093
- `;
1094
- var HeaderTitle = styled7__default.default.h1`
1095
- margin: 0;
1096
- font-size: 1rem;
1097
- font-weight: 600;
1098
- color: #e5e5e7;
1099
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
1100
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1101
- line-height: 1.5;
1102
- overflow: hidden;
1103
- text-overflow: ellipsis;
1104
- white-space: nowrap;
1105
- `;
1106
- var HeaderSubtitle = styled7__default.default.p`
1107
- margin: 0;
1108
- font-size: 0.875rem;
1109
- color: #8e8e93;
1110
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
1111
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1112
- line-height: 1.4;
1113
- overflow: hidden;
1114
- text-overflow: ellipsis;
1115
- white-space: nowrap;
1116
- `;
1117
- var HeaderActions = styled7__default.default.div`
1118
- display: flex;
1119
- align-items: center;
1120
- gap: ${({ theme }) => theme?.spacing?.xs ?? "4px"};
1121
- margin-left: ${({ theme }) => theme?.spacing?.md ?? "16px"};
1122
- `;
1123
- var ActionButton = styled7__default.default.button`
1124
- display: inline-flex;
1125
- align-items: center;
1126
- justify-content: center;
1127
- width: 32px;
1128
- height: 32px;
1129
- padding: 0;
1130
- background-color: transparent;
1131
- border: none;
1132
- border-radius: 6px;
1133
- color: #e5e5e7;
1134
- cursor: pointer;
1135
- transition: all 150ms ease;
1136
-
1137
- &:hover:not(:disabled) {
1138
- background-color: #3a3a3c;
1139
- }
1140
-
1141
- &:active:not(:disabled) {
1142
- transform: scale(0.95);
1143
- background-color: #48484a;
1144
- }
1145
-
1146
- &:focus-visible {
1147
- outline: 2px solid #5B9FFF;
1148
- outline-offset: 2px;
1149
- }
1150
-
1151
- &:disabled {
1152
- cursor: not-allowed;
1153
- opacity: 0.3;
1154
- }
1155
-
1156
- svg {
1157
- width: 16px;
1158
- height: 16px;
1159
- display: block;
1160
- }
1161
- `;
1162
- var Header = ({
1163
- title,
1164
- subtitle,
1165
- onClose,
1166
- onMinimize,
1167
- className
1168
- }) => {
1169
- const minimizeRef = react.useRef(null);
1170
- const closeRef = react.useRef(null);
1171
- const { buttonProps: minimizeProps } = button.useButton(
1172
- {
1173
- onPress: onMinimize,
1174
- "aria-label": "Minimize",
1175
- isDisabled: !onMinimize
1176
- },
1177
- minimizeRef
1178
- );
1179
- const { buttonProps: closeProps } = button.useButton(
1180
- {
1181
- onPress: onClose,
1182
- "aria-label": "Close",
1183
- isDisabled: !onClose
1184
- },
1185
- closeRef
1186
- );
1187
- return /* @__PURE__ */ jsxRuntime.jsxs(HeaderContainer, { className, children: [
1188
- /* @__PURE__ */ jsxRuntime.jsxs(HeaderContent, { children: [
1189
- /* @__PURE__ */ jsxRuntime.jsx(HeaderTitle, { children: title }),
1190
- subtitle && /* @__PURE__ */ jsxRuntime.jsx(HeaderSubtitle, { children: subtitle })
1191
- ] }),
1192
- /* @__PURE__ */ jsxRuntime.jsxs(HeaderActions, { children: [
1193
- onMinimize && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { ref: minimizeRef, ...minimizeProps, "data-action": "minimize", children: /* @__PURE__ */ jsxRuntime.jsxs(
1194
- "svg",
1195
- {
1196
- width: "16",
1197
- height: "16",
1198
- viewBox: "0 0 16 16",
1199
- fill: "none",
1200
- xmlns: "http://www.w3.org/2000/svg",
1201
- "aria-hidden": "true",
1202
- children: [
1203
- /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Minimize" }),
1204
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "8", x2: "13", y2: "8", stroke: "currentColor", strokeWidth: "2" })
1205
- ]
1206
- }
1207
- ) }),
1208
- onClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { ref: closeRef, ...closeProps, "data-action": "close", children: /* @__PURE__ */ jsxRuntime.jsxs(
1209
- "svg",
1210
- {
1211
- width: "16",
1212
- height: "16",
1213
- viewBox: "0 0 16 16",
1214
- fill: "none",
1215
- xmlns: "http://www.w3.org/2000/svg",
1216
- "aria-hidden": "true",
1217
- children: [
1218
- /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Close" }),
1219
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "4", x2: "12", y2: "12", stroke: "currentColor", strokeWidth: "2" }),
1220
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "4", x2: "4", y2: "12", stroke: "currentColor", strokeWidth: "2" })
1221
- ]
1222
- }
1223
- ) })
1224
- ] })
1225
- ] });
1226
- };
1227
- Header.displayName = "Header";
1228
- var InputContainer = styled7__default.default.div`
1229
- display: flex;
1230
- flex-direction: column;
1231
- width: 100%;
1232
- position: relative;
1233
- `;
1234
- var InputWrapper2 = styled7__default.default.div`
1235
- display: flex;
1236
- align-items: flex-end;
1237
- gap: 8px;
1238
- padding: 12px;
1239
- background-color: #ffffff;
1240
- border: 1px solid #e5e7eb;
1241
- border-radius: 12px;
1242
- transition: all 0.2s ease;
1243
-
1244
- &:focus-within {
1245
- border-color: #3b82f6;
1246
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
1247
- }
1248
-
1249
- &:hover:not(:focus-within) {
1250
- border-color: #d1d5db;
1251
- }
1252
- `;
1253
- var TextArea = styled7__default.default.textarea`
1254
- flex: 1;
1255
- min-height: 24px;
1256
- max-height: ${(props) => `${(props.$maxRows || 5) * 24}px`};
1257
- padding: 0;
1258
- border: none;
1259
- outline: none;
1260
- resize: none;
1261
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
1262
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1263
- font-size: 14px;
1264
- line-height: 24px;
1265
- color: #111827;
1266
- background: transparent;
1267
- overflow-y: auto;
1268
-
1269
- &::placeholder {
1270
- color: #9ca3af;
1271
- }
1272
-
1273
- &:disabled {
1274
- color: #9ca3af;
1275
- cursor: not-allowed;
1276
- }
1277
-
1278
- &:read-only {
1279
- cursor: default;
1280
- }
1281
-
1282
- /* Custom scrollbar */
1283
- &::-webkit-scrollbar {
1284
- width: 6px;
1285
- }
1286
-
1287
- &::-webkit-scrollbar-track {
1288
- background: transparent;
1289
- }
1290
-
1291
- &::-webkit-scrollbar-thumb {
1292
- background: #d1d5db;
1293
- border-radius: 3px;
1294
- }
1295
-
1296
- &::-webkit-scrollbar-thumb:hover {
1297
- background: #9ca3af;
1298
- }
1299
- `;
1300
- var SendButton = styled7__default.default.button`
1301
- display: flex;
1302
- align-items: center;
1303
- justify-content: center;
1304
- width: 36px;
1305
- height: 36px;
1306
- padding: 0;
1307
- border: none;
1308
- border-radius: 8px;
1309
- background-color: ${(props) => props.disabled ? "#e5e7eb" : "#3b82f6"};
1310
- color: ${(props) => props.disabled ? "#9ca3af" : "#ffffff"};
1311
- cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
1312
- transition: all 0.2s ease;
1313
- flex-shrink: 0;
1314
-
1315
- &:hover:not(:disabled) {
1316
- background-color: #2563eb;
1317
- transform: translateY(-1px);
1318
- }
1319
-
1320
- &:active:not(:disabled) {
1321
- transform: translateY(0);
1322
- }
1323
-
1324
- &:focus-visible {
1325
- outline: 2px solid #3b82f6;
1326
- outline-offset: 2px;
1327
- }
1328
-
1329
- svg {
1330
- width: 20px;
1331
- height: 20px;
1332
- }
1333
- `;
1334
- var Input = ({
1335
- value = "",
1336
- onChange,
1337
- onSubmit,
1338
- placeholder = "Type a message...",
1339
- isDisabled = false,
1340
- isReadOnly = false,
1341
- maxRows = 5,
1342
- autoFocus = false,
1343
- className,
1344
- "aria-label": ariaLabel = "Message input",
1345
- ...ariaProps
1346
- }) => {
1347
- const textareaRef = react.useRef(null);
1348
- const { inputProps } = textfield.useTextField(
1349
- {
1350
- ...ariaProps,
1351
- "aria-label": ariaLabel,
1352
- value,
1353
- onChange: (newValue) => {
1354
- onChange?.(newValue);
1355
- },
1356
- isDisabled,
1357
- isReadOnly,
1358
- inputElementType: "textarea"
1359
- },
1360
- textareaRef
1361
- );
1362
- const handleKeyDown = (e) => {
1363
- if (e.key === "Enter" && !e.shiftKey) {
1364
- e.preventDefault();
1365
- if (value.trim() && onSubmit && !isDisabled && !isReadOnly) {
1366
- onSubmit(value.trim());
1367
- onChange?.("");
1368
- }
1369
- }
1370
- };
1371
- const handleSend = () => {
1372
- if (value.trim() && onSubmit && !isDisabled && !isReadOnly) {
1373
- onSubmit(value.trim());
1374
- onChange?.("");
1375
- textareaRef.current?.focus();
1376
- }
1377
- };
1378
- const canSend = value.trim().length > 0 && !isDisabled && !isReadOnly;
1379
- return /* @__PURE__ */ jsxRuntime.jsx(InputContainer, { className, children: /* @__PURE__ */ jsxRuntime.jsxs(InputWrapper2, { children: [
1380
- /* @__PURE__ */ jsxRuntime.jsx(
1381
- TextArea,
1382
- {
1383
- ...inputProps,
1384
- ref: textareaRef,
1385
- placeholder,
1386
- onKeyDown: handleKeyDown,
1387
- $maxRows: maxRows,
1388
- autoFocus,
1389
- disabled: isDisabled,
1390
- readOnly: isReadOnly
1391
- }
1392
- ),
1393
- /* @__PURE__ */ jsxRuntime.jsx(
1394
- SendButton,
1395
- {
1396
- type: "button",
1397
- onClick: handleSend,
1398
- disabled: !canSend,
1399
- "aria-label": "Send message",
1400
- title: "Send message (Enter)",
1401
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1402
- "svg",
1403
- {
1404
- width: "20",
1405
- height: "20",
1406
- viewBox: "0 0 20 20",
1407
- fill: "none",
1408
- xmlns: "http://www.w3.org/2000/svg",
1409
- role: "img",
1410
- "aria-hidden": "true",
1411
- children: [
1412
- /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Send Icon" }),
1413
- /* @__PURE__ */ jsxRuntime.jsx(
1414
- "path",
1415
- {
1416
- d: "M2.5 10L17.5 3.75L11.25 18.75L10 12.5L2.5 10Z",
1417
- stroke: "currentColor",
1418
- strokeWidth: "2",
1419
- strokeLinecap: "round",
1420
- strokeLinejoin: "round"
1421
- }
1422
- )
1423
- ]
1424
- }
1425
- )
1426
- }
1427
- )
1428
- ] }) });
1429
- };
1430
- var FileAttachmentContainer = styled7__default.default.div`
1431
- display: flex;
1432
- align-items: center;
1433
- gap: 8px;
1434
- padding: 12px;
1435
- background-color: #3a3a3c;
1436
- border: 1px solid #48484a;
1437
- border-radius: 8px;
1438
- max-width: 320px;
1439
- cursor: ${(props) => props.$isInteractive ? "pointer" : "default"};
1440
- transition: border-color 0.15s ease;
1441
-
1442
- /* Remove default button styles when used as button */
1443
- ${(props) => props.$isInteractive && `
1444
- font: inherit;
1445
- color: inherit;
1446
- text-align: left;
1447
- appearance: none;
1448
- -webkit-appearance: none;
1449
-
1450
- &:hover {
1451
- border-color: #5a5a5c;
1452
- background-color: #48484a;
1453
- }
1454
-
1455
- &:focus-visible {
1456
- outline: 2px solid #5B9FFF;
1457
- outline-offset: 2px;
1458
- border-color: #5B9FFF;
1459
- }
1460
-
1461
- &:active {
1462
- border-color: #6a6a6c;
1463
- }
1464
- `}
1465
- `;
1466
- var FileIconContainer = styled7__default.default.div`
1467
- flex-shrink: 0;
1468
- width: 32px;
1469
- height: 32px;
1470
- display: flex;
1471
- align-items: center;
1472
- justify-content: center;
1473
- font-size: 24px;
1474
- line-height: 1;
1475
- `;
1476
- var FileInfo = styled7__default.default.div`
1477
- flex: 1;
1478
- min-width: 0;
1479
- display: flex;
1480
- flex-direction: column;
1481
- gap: 2px;
1482
- `;
1483
- var FileTitle = styled7__default.default.div`
1484
- font-size: 14px;
1485
- font-weight: 500;
1486
- color: #e5e5e7;
1487
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
1488
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1489
- line-height: 1.4;
1490
- overflow: hidden;
1491
- text-overflow: ellipsis;
1492
- white-space: nowrap;
1493
- `;
1494
- var FileMetadata = styled7__default.default.div`
1495
- display: flex;
1496
- align-items: center;
1497
- gap: 4px;
1498
- font-size: 12px;
1499
- color: #8e8e93;
1500
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
1501
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1502
- line-height: 1.4;
1503
- overflow: hidden;
1504
- `;
1505
- var FileSubtitle = styled7__default.default.span`
1506
- color: #8e8e93;
1507
- white-space: nowrap;
1508
- overflow: hidden;
1509
- text-overflow: ellipsis;
1510
-
1511
- &:last-child {
1512
- flex-shrink: 0;
1513
- }
1514
- `;
1515
- var FileAttachment = ({
1516
- title,
1517
- subtitle,
1518
- size,
1519
- icon = "\u{1F4C4}",
1520
- onClick,
1521
- onPress,
1522
- className,
1523
- ...ariaProps
1524
- }) => {
1525
- const ref = react.useRef(null);
1526
- const isInteractive = !!(onClick || onPress);
1527
- const handlePress = (e) => {
1528
- if (onClick) onClick();
1529
- if (onPress) onPress(e);
1530
- };
1531
- const { buttonProps } = button.useButton(
1532
- {
1533
- ...ariaProps,
1534
- onPress: isInteractive ? handlePress : void 0,
1535
- isDisabled: !isInteractive
1536
- },
1537
- ref
1538
- );
1539
- return /* @__PURE__ */ jsxRuntime.jsxs(
1540
- FileAttachmentContainer,
1541
- {
1542
- ...isInteractive ? buttonProps : {},
1543
- ref: isInteractive ? ref : void 0,
1544
- className,
1545
- $isInteractive: isInteractive,
1546
- as: isInteractive ? "button" : "div",
1547
- children: [
1548
- /* @__PURE__ */ jsxRuntime.jsx(FileIconContainer, { children: icon }),
1549
- /* @__PURE__ */ jsxRuntime.jsxs(FileInfo, { children: [
1550
- /* @__PURE__ */ jsxRuntime.jsx(FileTitle, { children: title }),
1551
- /* @__PURE__ */ jsxRuntime.jsxs(FileMetadata, { children: [
1552
- subtitle && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { children: subtitle }),
1553
- size && subtitle && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { "aria-hidden": "true", children: " \u2022 " }),
1554
- size && /* @__PURE__ */ jsxRuntime.jsx(FileSubtitle, { children: size })
1555
- ] })
1556
- ] })
1557
- ]
1558
- }
1559
- );
1560
- };
1561
- var MessageContainer = styled7__default.default.div`
1562
- display: flex;
1563
- gap: 12px;
1564
- align-items: flex-start;
1565
- padding: 8px 0;
1566
- max-width: 100%;
1567
- `;
1568
- var AvatarContainer = styled7__default.default.div`
1569
- flex-shrink: 0;
1570
- `;
1571
- var Avatar2 = styled7__default.default.img`
1572
- width: 32px;
1573
- height: 32px;
1574
- border-radius: 50%;
1575
- object-fit: cover;
1576
- background-color: #e5e7eb;
1577
- `;
1578
- var AvatarInitials = styled7__default.default.div`
1579
- width: 32px;
1580
- height: 32px;
1581
- border-radius: 50%;
1582
- background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
1583
- color: white;
1584
- display: flex;
1585
- align-items: center;
1586
- justify-content: center;
1587
- font-size: 12px;
1588
- font-weight: 600;
1589
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
1590
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1591
-
1592
- svg {
1593
- width: 18px;
1594
- height: 18px;
1595
- }
1596
- `;
1597
- var ContentContainer = styled7__default.default.div`
1598
- flex: 1;
1599
- min-width: 0;
1600
- `;
1601
- var MessageContent = styled7__default.default.div`
1602
- background-color: #2c2c2e;
1603
- padding: 12px 16px;
1604
- border-radius: 16px;
1605
- border-top-left-radius: 4px;
1606
- color: #e5e5e7;
1607
- font-size: 14px;
1608
- line-height: 1.5;
1609
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
1610
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1611
- word-wrap: break-word;
1612
- white-space: pre-wrap;
1613
- `;
1614
- var LoadingDots3 = styled7__default.default.div`
1615
- display: flex;
1616
- gap: 6px;
1617
- padding: 12px 16px;
1618
- background-color: #2c2c2e;
1619
- border-radius: 16px;
1620
- border-top-left-radius: 4px;
1621
- width: fit-content;
1622
- `;
1623
- var bounce = styled7.keyframes`
1624
- 0%, 60%, 100% {
1625
- transform: translateY(0);
1626
- }
1627
- 30% {
1628
- transform: translateY(-8px);
1629
- }
1630
- `;
1631
- var LoadingDot = styled7__default.default.div`
1632
- width: 8px;
1633
- height: 8px;
1634
- border-radius: 50%;
1635
- background-color: #8e8e93;
1636
- animation: ${bounce} 1.4s ease-in-out infinite;
1637
- animation-delay: ${(props) => props.delay}s;
1638
- `;
1639
- var AttachmentsContainer = styled7__default.default.div`
1640
- display: flex;
1641
- flex-direction: column;
1642
- gap: 8px;
1643
- margin-top: 12px;
1644
- `;
1645
- var AssistantMessage = ({
1646
- content = "",
1647
- avatarUrl,
1648
- avatarInitials: _avatarInitials = "AI",
1649
- isLoading = false,
1650
- className,
1651
- attachments = [],
1652
- enableMarkdown: _enableMarkdown = false
1653
- }) => {
1654
- const renderContent = () => {
1655
- if (isLoading) {
1656
- return /* @__PURE__ */ jsxRuntime.jsxs(LoadingDots3, { children: [
1657
- /* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0 }),
1658
- /* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0.2 }),
1659
- /* @__PURE__ */ jsxRuntime.jsx(LoadingDot, { delay: 0.4 })
1660
- ] });
1661
- }
1662
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1663
- content && /* @__PURE__ */ jsxRuntime.jsx(MessageContent, { children: content }),
1664
- attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(AttachmentsContainer, { children: attachments.map((attachment, index) => /* @__PURE__ */ jsxRuntime.jsx(FileAttachment, { ...attachment }, `${attachment.title}-${index}`)) })
1665
- ] });
1666
- };
1667
- return /* @__PURE__ */ jsxRuntime.jsxs(MessageContainer, { className, children: [
1668
- /* @__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" }) }) }) }),
1669
- /* @__PURE__ */ jsxRuntime.jsx(ContentContainer, { children: renderContent() })
1670
- ] });
1671
- };
1672
- var MessagesContainer = styled7__default.default.div`
1673
- display: flex;
1674
- flex-direction: column;
1675
- flex: 1;
1676
- overflow: hidden;
1677
- background-color: #1c1c1e;
1678
- padding: 8px;
1679
- gap: 12px;
1680
- box-sizing: border-box;
1681
-
1682
- /* Ensure proper scrolling behavior for child components */
1683
- position: relative;
1684
- min-height: 0;
1685
-
1686
- /* Desktop padding */
1687
- @media (min-width: 640px) {
1688
- padding: 12px;
1689
- }
1690
- `;
1691
- var Messages = ({
1692
- children,
1693
- className,
1694
- ariaLabel = "Messages"
1695
- }) => {
1696
- return /* @__PURE__ */ jsxRuntime.jsx(MessagesContainer, { className, role: "region", "aria-label": ariaLabel, children });
1697
- };
1698
- Messages.displayName = "Messages";
1699
- var MessagesListContainer = styled7__default.default.div`
1700
- display: flex;
1701
- flex-direction: column;
1702
- width: 100%;
1703
- max-height: ${(props) => props.$maxHeight};
1704
- overflow-y: auto;
1705
- overflow-x: hidden;
1706
- position: relative;
1707
- background: #ffffff;
1708
- border: 1px solid #e5e7eb;
1709
- border-radius: 8px;
1710
- scroll-behavior: smooth;
1711
-
1712
- /* Custom scrollbar styling */
1713
- &::-webkit-scrollbar {
1714
- width: 8px;
1715
- }
1716
-
1717
- &::-webkit-scrollbar-track {
1718
- background: #f1f5f9;
1719
- border-radius: 4px;
1720
- }
1721
-
1722
- &::-webkit-scrollbar-thumb {
1723
- background: #cbd5e1;
1724
- border-radius: 4px;
1725
- transition: background 0.2s ease;
1726
- }
1727
-
1728
- &::-webkit-scrollbar-thumb:hover {
1729
- background: #94a3b8;
1730
- }
1731
-
1732
- /* Firefox scrollbar styling */
1733
- scrollbar-width: thin;
1734
- scrollbar-color: #cbd5e1 #f1f5f9;
1735
-
1736
- /* Ensure proper rendering on mobile */
1737
- -webkit-overflow-scrolling: touch;
1738
- `;
1739
- var MessagesListContent = styled7__default.default.div`
1740
- display: flex;
1741
- flex-direction: column;
1742
- gap: 12px;
1743
- padding: 16px;
1744
- min-height: min-content;
1745
-
1746
- /* Message styling */
1747
- .message {
1748
- display: flex;
1749
- flex-direction: column;
1750
- gap: 4px;
1751
- padding: 12px 16px;
1752
- border-radius: 8px;
1753
- max-width: 85%;
1754
- word-wrap: break-word;
1755
- animation: messageSlideIn 0.2s ease-out;
1756
- }
1757
-
1758
- @keyframes messageSlideIn {
1759
- from {
1760
- opacity: 0;
1761
- transform: translateY(8px);
1762
- }
1763
- to {
1764
- opacity: 1;
1765
- transform: translateY(0);
1766
- }
1767
- }
1768
-
1769
- /* Role-specific message styling */
1770
- .message--user {
1771
- align-self: flex-end;
1772
- background: #3b82f6;
1773
- color: #ffffff;
1774
- border-bottom-right-radius: 4px;
1775
- }
1776
-
1777
- .message--assistant {
1778
- align-self: flex-start;
1779
- background: #f1f5f9;
1780
- color: #1e293b;
1781
- border-bottom-left-radius: 4px;
1782
- }
1783
-
1784
- .message--system {
1785
- align-self: center;
1786
- background: #fef3c7;
1787
- color: #92400e;
1788
- font-size: 0.875rem;
1789
- font-style: italic;
1790
- max-width: 100%;
1791
- text-align: center;
1792
- }
1793
- `;
1794
- var MessagesList = ({
1795
- messages,
1796
- autoScroll = true,
1797
- className,
1798
- renderMessage,
1799
- onScrollTop,
1800
- maxHeight = "600px"
1801
- }) => {
1802
- const containerRef = react.useRef(null);
1803
- const contentRef = react.useRef(null);
1804
- const isUserScrollingRef = react.useRef(false);
1805
- const scrollTimeoutRef = react.useRef(null);
1806
- react.useEffect(() => {
1807
- if (autoScroll && !isUserScrollingRef.current && containerRef.current) {
1808
- const container = containerRef.current;
1809
- container.scrollTop = container.scrollHeight;
1810
- }
1811
- }, [messages.length, autoScroll]);
1812
- const handleScroll = () => {
1813
- if (!containerRef.current) return;
1814
- const container = containerRef.current;
1815
- const isAtBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 10;
1816
- isUserScrollingRef.current = !isAtBottom;
1817
- if (scrollTimeoutRef.current) {
1818
- clearTimeout(scrollTimeoutRef.current);
1819
- }
1820
- scrollTimeoutRef.current = setTimeout(() => {
1821
- isUserScrollingRef.current = false;
1822
- }, 1e3);
1823
- if (container.scrollTop === 0 && onScrollTop) {
1824
- onScrollTop();
1825
- }
1826
- };
1827
- react.useEffect(() => {
1828
- return () => {
1829
- if (scrollTimeoutRef.current) {
1830
- clearTimeout(scrollTimeoutRef.current);
1831
- }
1832
- };
1833
- }, []);
1834
- const defaultRenderMessage = (message) => /* @__PURE__ */ jsxRuntime.jsx(
1835
- "div",
1836
- {
1837
- className: `message message--${message.role}`,
1838
- "data-message-id": message.id,
1839
- "data-role": message.role,
1840
- children: message.content
1841
- },
1842
- message.id
1843
- );
1844
- return /* @__PURE__ */ jsxRuntime.jsx(
1845
- MessagesListContainer,
1846
- {
1847
- ref: containerRef,
1848
- onScroll: handleScroll,
1849
- className,
1850
- $maxHeight: maxHeight,
1851
- children: /* @__PURE__ */ jsxRuntime.jsx(MessagesListContent, { ref: contentRef, children: messages.map(renderMessage || defaultRenderMessage) })
1852
- }
1853
- );
1854
- };
1855
- var StyledUserMessage2 = styled7__default.default.div`
1856
- display: flex;
1857
- justify-content: flex-end;
1858
- align-items: flex-start;
1859
- margin: 8px 0;
1860
- padding: 0 16px;
1861
- width: 100%;
1862
- `;
1863
- var MessageBubble = styled7__default.default.div`
1864
- display: flex;
1865
- flex-direction: column;
1866
- max-width: 70%;
1867
- padding: 12px 16px;
1868
- border-radius: 18px 18px 4px 18px;
1869
-
1870
- /* User message colors - distinct from assistant messages */
1871
- background-color: #007AFF;
1872
- color: #FFFFFF;
1873
-
1874
- /* Box shadow for depth */
1875
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1876
-
1877
- /* Smooth transitions */
1878
- transition: all 0.2s ease-in-out;
1879
-
1880
- &:hover {
1881
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
1882
- }
1883
-
1884
- /* Username styling */
1885
- strong {
1886
- font-size: 12px;
1887
- font-weight: 600;
1888
- margin-bottom: 4px;
1889
- opacity: 0.9;
1890
- }
1891
- `;
1892
- var MessageContent2 = styled7__default.default.p`
1893
- margin: 0;
1894
- font-size: 14px;
1895
- line-height: 1.5;
1896
- word-wrap: break-word;
1897
- white-space: pre-wrap;
1898
- `;
1899
- var MessageTime = styled7__default.default.time`
1900
- font-size: 11px;
1901
- opacity: 0.7;
1902
- margin-top: 4px;
1903
- text-align: right;
1904
- `;
1905
- var UserMessage2 = ({
1906
- content,
1907
- timestamp,
1908
- className,
1909
- avatarUrl,
1910
- username
1911
- }) => {
1912
- return /* @__PURE__ */ jsxRuntime.jsxs(StyledUserMessage2, { className, children: [
1913
- /* @__PURE__ */ jsxRuntime.jsxs(MessageBubble, { children: [
1914
- username && /* @__PURE__ */ jsxRuntime.jsx("strong", { children: username }),
1915
- /* @__PURE__ */ jsxRuntime.jsx(MessageContent2, { children: content }),
1916
- timestamp && /* @__PURE__ */ jsxRuntime.jsx(MessageTime, { children: timestamp })
1917
- ] }),
1918
- avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(
1919
- "img",
1920
- {
1921
- src: avatarUrl,
1922
- alt: username || "User",
1923
- style: { width: "32px", height: "32px", borderRadius: "50%", marginLeft: "8px" }
1924
- }
1925
- )
1926
- ] });
1927
- };
1928
- var SuggestionsContainer = styled7__default.default.div`
1929
- display: flex;
1930
- flex-wrap: wrap;
1931
- gap: ${({ theme }) => theme?.spacing?.sm ?? "8px"};
1932
- padding: ${({ theme }) => theme?.spacing?.md ?? "16px"} 0;
1933
- `;
1934
- var StyledSuggestion = styled7__default.default.button`
1935
- /* Base styles */
1936
- display: inline-flex;
1937
- align-items: center;
1938
- justify-content: center;
1939
- padding: ${({ theme }) => theme?.spacing?.sm ?? "8px"} ${({ theme }) => theme?.spacing?.md ?? "16px"};
1940
- font-family: ${({ theme }) => theme?.fonts?.body ?? "system-ui, sans-serif"};
1941
- font-size: 0.875rem;
1942
- font-weight: 500;
1943
- color: ${({ theme }) => theme?.colors?.text ?? "#000000"};
1944
- background-color: ${({ theme }) => theme?.colors?.surface ?? "#ffffff"};
1945
- border: 1px solid ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
1946
- border-radius: ${({ theme }) => theme?.radii?.lg ?? "12px"};
1947
- cursor: pointer;
1948
- transition: all 0.2s ease-in-out;
1949
- white-space: nowrap;
1950
- user-select: none;
1951
-
1952
- /* Hover state */
1953
- &:hover:not(:disabled) {
1954
- background-color: ${({ theme }) => theme?.colors?.border ?? "#E0E0E0"};
1955
- border-color: ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
1956
- transform: translateY(-1px);
1957
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
1958
- }
1959
-
1960
- /* Active/Pressed state */
1961
- &:active:not(:disabled) {
1962
- transform: translateY(0);
1963
- box-shadow: none;
1964
- }
1965
-
1966
- ${({ $isPressed }) => $isPressed && styled7.css`
1967
- transform: scale(0.98);
1968
- `}
1969
-
1970
- /* Focus state */
1971
- &:focus-visible {
1972
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
1973
- outline-offset: 2px;
1974
- }
1975
-
1976
- /* Remove default focus outline */
1977
- &:focus {
1978
- outline: none;
1979
- }
1980
-
1981
- /* Disabled state */
1982
- &:disabled {
1983
- cursor: not-allowed;
1984
- opacity: 0.5;
1985
- transform: none;
1986
- }
1987
- `;
1988
- function Suggestions({ suggestions, onSelect, className }) {
1989
- if (suggestions.length === 0) {
1990
- return null;
1991
- }
1992
- return /* @__PURE__ */ jsxRuntime.jsx(SuggestionsContainer, { className, role: "list", "aria-label": "Suggested prompts", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxRuntime.jsx(SuggestionChip, { suggestion, onSelect }, suggestion)) });
1993
- }
1994
- function SuggestionChip({ suggestion, onSelect }) {
1995
- const ref = react.useRef(null);
1996
- const { buttonProps, isPressed } = button.useButton(
1997
- {
1998
- onPress: () => onSelect(suggestion),
1999
- "aria-label": `Select suggestion: ${suggestion}`
2000
- },
2001
- ref
2002
- );
2003
- return /* @__PURE__ */ jsxRuntime.jsx(StyledSuggestion, { ...buttonProps, ref, $isPressed: isPressed, role: "listitem", children: suggestion });
2004
- }
2005
- Suggestions.displayName = "Suggestions";
2006
- var WindowContainer = styled7__default.default.div`
2007
- display: flex;
2008
- flex-direction: column;
2009
- background-color: #1c1c1e;
2010
- border-radius: 0;
2011
- box-shadow: none;
2012
- overflow: hidden;
2013
- transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
2014
- position: relative;
2015
-
2016
- /* Default dimensions */
2017
- width: ${({ $width }) => $width};
2018
- height: ${({ $height }) => $height};
2019
-
2020
- /* Fullscreen state */
2021
- ${({ $isFullscreen }) => $isFullscreen && styled7.css`
2022
- width: 100vw;
2023
- height: 100vh;
2024
- border-radius: 0;
2025
- box-shadow: none;
2026
- position: fixed;
2027
- top: 0;
2028
- left: 0;
2029
- z-index: 1000;
2030
- `}
2031
-
2032
- /* Minimized state */
2033
- ${({ $isMinimized }) => $isMinimized && styled7.css`
2034
- height: 60px;
2035
- width: 300px;
2036
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
2037
- cursor: pointer;
2038
-
2039
- /* Hide all content except header when minimized */
2040
- > *:not(:first-child) {
2041
- display: none;
2042
- }
2043
-
2044
- /* Keep header visible but adjust styling */
2045
- > *:first-child {
2046
- border-bottom: none;
2047
- }
2048
- `}
2049
-
2050
- /* Responsive behavior for smaller screens */
2051
- @media (max-width: 768px) {
2052
- ${({ $isFullscreen, $isMinimized }) => !$isFullscreen && !$isMinimized && styled7.css`
2053
- width: 100vw;
2054
- height: 100vh;
2055
- border-radius: 0;
2056
- max-width: 100%;
2057
- max-height: 100%;
2058
- `}
2059
- }
2060
-
2061
- /* Focus states for accessibility */
2062
- &:focus-visible {
2063
- outline: 2px solid ${({ theme }) => theme?.colors?.primary ?? "#0066FF"};
2064
- outline-offset: 2px;
2065
- }
2066
-
2067
- /* Ensure proper stacking context */
2068
- z-index: ${({ $isFullscreen }) => $isFullscreen ? 1e3 : 100};
2069
- `;
2070
- var Window = ({
2071
- isMinimized = false,
2072
- isFullscreen = false,
2073
- width = "400px",
2074
- height = "600px",
2075
- children,
2076
- className,
2077
- ariaLabel = "Chat window"
2078
- }) => {
2079
- return /* @__PURE__ */ jsxRuntime.jsx(
2080
- WindowContainer,
2081
- {
2082
- className,
2083
- $isMinimized: isMinimized,
2084
- $isFullscreen: isFullscreen,
2085
- $width: width,
2086
- $height: height,
2087
- role: "dialog",
2088
- "aria-label": ariaLabel,
2089
- "aria-modal": "false",
2090
- children
2091
- }
2092
- );
2093
- };
2094
- Window.displayName = "Window";
2095
-
2096
- exports.Actions = Actions;
2097
- exports.AgentState = AgentState;
2098
- exports.AssistantMessage = AssistantMessage;
2099
- exports.AssistantThinking = AssistantThinking;
2100
- exports.Button = Button;
2101
- exports.ChatInput = ChatInput;
2102
- exports.FileAttachment = FileAttachment;
2103
- exports.Footer = Footer;
2104
- exports.Header = Header;
2105
- exports.Input = Input;
2106
- exports.Messages = Messages;
2107
- exports.MessagesList = MessagesList;
2108
- exports.MessagesListContainer = MessagesListContainer;
2109
- exports.MessagesListContent = MessagesListContent;
2110
- exports.Response = Response;
2111
- exports.Suggestions = Suggestions;
2112
- exports.UserMessage = UserMessage;
2113
- exports.UserMessage2 = UserMessage2;
2114
- exports.Window = Window;
2115
- //# sourceMappingURL=chunk-OPWUJP7J.cjs.map
2116
- //# sourceMappingURL=chunk-OPWUJP7J.cjs.map