@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.
Files changed (82) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +187 -0
  4. package/assets/layout/main-pane-section.png +0 -0
  5. package/assets/layout/nav-complete.png +0 -0
  6. package/assets/layout/nav-horizontal-section.png +0 -0
  7. package/assets/layout/nav-vertical-section.png +0 -0
  8. package/assets/layout/pane-section-dropdowns.png +0 -0
  9. package/assets/layout/pane-section-header.png +0 -0
  10. package/dist/Window-B6e_UfLV.d.ts +429 -0
  11. package/dist/Window-CgGFIYHS.d.cts +429 -0
  12. package/dist/chunk-CNVJ5UF2.js +2069 -0
  13. package/dist/chunk-CNVJ5UF2.js.map +1 -0
  14. package/dist/chunk-CVHHTWDQ.cjs +72 -0
  15. package/dist/chunk-CVHHTWDQ.cjs.map +1 -0
  16. package/dist/chunk-H4VHCHCP.cjs +1268 -0
  17. package/dist/chunk-H4VHCHCP.cjs.map +1 -0
  18. package/dist/chunk-JQ6Q7MDQ.js +67 -0
  19. package/dist/chunk-JQ6Q7MDQ.js.map +1 -0
  20. package/dist/chunk-KNSPBTTJ.cjs +2158 -0
  21. package/dist/chunk-KNSPBTTJ.cjs.map +1 -0
  22. package/dist/chunk-MNXQDDWP.js +2143 -0
  23. package/dist/chunk-MNXQDDWP.js.map +1 -0
  24. package/dist/chunk-P4Q3MHIY.cjs +2093 -0
  25. package/dist/chunk-P4Q3MHIY.cjs.map +1 -0
  26. package/dist/chunk-PAOXD7DF.js +1253 -0
  27. package/dist/chunk-PAOXD7DF.js.map +1 -0
  28. package/dist/copilotkit/index.cjs +611 -0
  29. package/dist/copilotkit/index.cjs.map +1 -0
  30. package/dist/copilotkit/index.d.cts +162 -0
  31. package/dist/copilotkit/index.d.ts +162 -0
  32. package/dist/copilotkit/index.js +538 -0
  33. package/dist/copilotkit/index.js.map +1 -0
  34. package/dist/icons/index.cjs +48 -0
  35. package/dist/icons/index.cjs.map +1 -0
  36. package/dist/icons/index.d.cts +375 -0
  37. package/dist/icons/index.d.ts +375 -0
  38. package/dist/icons/index.js +3 -0
  39. package/dist/icons/index.js.map +1 -0
  40. package/dist/index.cjs +536 -0
  41. package/dist/index.cjs.map +1 -0
  42. package/dist/index.d-DYU1eVeb.d.cts +252 -0
  43. package/dist/index.d-DYU1eVeb.d.ts +252 -0
  44. package/dist/index.d.cts +185 -0
  45. package/dist/index.d.ts +185 -0
  46. package/dist/index.js +358 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/layout/index.cjs +48 -0
  49. package/dist/layout/index.cjs.map +1 -0
  50. package/dist/layout/index.d.cts +206 -0
  51. package/dist/layout/index.d.ts +206 -0
  52. package/dist/layout/index.js +3 -0
  53. package/dist/layout/index.js.map +1 -0
  54. package/dist/theme/index.cjs +24 -0
  55. package/dist/theme/index.cjs.map +1 -0
  56. package/dist/theme/index.d.cts +95 -0
  57. package/dist/theme/index.d.ts +95 -0
  58. package/dist/theme/index.js +3 -0
  59. package/dist/theme/index.js.map +1 -0
  60. package/package.json +148 -0
  61. package/public/assets/bg-set/brand-logos/Google.svg +1 -0
  62. package/public/assets/bg-set/brand-logos/Google2.svg +1 -0
  63. package/public/assets/bg-set/brand-logos/Microsoft.svg +1 -0
  64. package/public/assets/bg-set/brand-logos/Microsoft2.svg +1 -0
  65. package/public/assets/bg-set/brand-logos/Slack.svg +1 -0
  66. package/public/assets/bg-set/brand-logos/Slack2.svg +1 -0
  67. package/public/assets/bg-set/brand-logos/YouTube.svg +1 -0
  68. package/public/assets/bg-set/brand-logos/YouTube2.svg +1 -0
  69. package/public/assets/bg-set/pattern/Size=lg, Type=Waves Rays2.svg +1 -0
  70. package/public/assets/bg-set/pattern/Size=md, Type=Waves Rays2.svg +1 -0
  71. package/public/assets/bg-set/pattern/Size=sm, Type=Waves Rays2.svg +1 -0
  72. package/public/assets/bg-set/pattern/Size=xl, Type=Waves Rays2.svg +1 -0
  73. package/public/assets/bg-set/pattern/Size=xs, Type=Waves Rays2.svg +1 -0
  74. package/public/assets/icon-set/Icon-add-circle-fill.svg +1 -0
  75. package/public/assets/icon-set/Icon-calendar-fill.svg +1 -0
  76. package/public/assets/icon-set/Icon-chat-1-fill.svg +1 -0
  77. package/public/assets/icon-set/Icon-download-2-fill.svg +1 -0
  78. package/public/assets/icon-set/Icon-home-fill.svg +1 -0
  79. package/public/assets/icon-set/Icon-mic-fill.svg +1 -0
  80. package/public/assets/icon-set/Icon-settings-3-fill.svg +1 -0
  81. package/public/assets/icon-set/Icon-settings-fill.svg +1 -0
  82. package/public/assets/icon-set/Icon-settings-line.svg +1 -0
@@ -0,0 +1,538 @@
1
+ import { AssistantThinking, AssistantMessage, ChatInput, UserMessage, Header, Window, Messages } from '../chunk-CNVJ5UF2.js';
2
+ export { Actions, AgentState, AssistantMessage, Button, FileAttachment, Footer, Header, Input, Messages, MessagesList, MessagesListContainer, MessagesListContent, Response, Suggestions, UserMessage2 as UserMessage, Window } from '../chunk-CNVJ5UF2.js';
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import { useState } from 'react';
5
+ import styled, { createGlobalStyle } from 'styled-components';
6
+ import { CopilotSidebar, useChatContext } from '@copilotkit/react-ui';
7
+
8
+ var AssistantMessageAdapter = ({
9
+ message,
10
+ isLoading,
11
+ isGenerating
12
+ // These are available but not used in our current implementation:
13
+ // isCurrentMessage,
14
+ // onRegenerate,
15
+ // onCopy,
16
+ // onThumbsUp,
17
+ // onThumbsDown,
18
+ // markdownTagRenderers,
19
+ // ImageRenderer,
20
+ }) => {
21
+ if (isLoading) {
22
+ return /* @__PURE__ */ jsx(AssistantThinking, { message: "Thinking..." });
23
+ }
24
+ if (isGenerating && !message?.content) {
25
+ return /* @__PURE__ */ jsx(AssistantThinking, { message: "Generating response..." });
26
+ }
27
+ const content = message?.content || "";
28
+ const attachments = [];
29
+ return /* @__PURE__ */ jsx(
30
+ AssistantMessage,
31
+ {
32
+ content,
33
+ avatarInitials: "AI",
34
+ isLoading: isGenerating,
35
+ attachments,
36
+ enableMarkdown: true
37
+ }
38
+ );
39
+ };
40
+ AssistantMessageAdapter.displayName = "AssistantMessageAdapter";
41
+ var InputAdapter = ({
42
+ inProgress,
43
+ onSend,
44
+ isVisible = true
45
+ }) => {
46
+ const [value, setValue] = useState("");
47
+ const handleSubmit = async (message) => {
48
+ if (!message.trim() || inProgress) return;
49
+ await onSend(message);
50
+ setValue("");
51
+ };
52
+ return /* @__PURE__ */ jsx(
53
+ ChatInput,
54
+ {
55
+ value,
56
+ onChange: setValue,
57
+ onSubmit: handleSubmit,
58
+ placeholder: "Ask, write or search for anything...",
59
+ isDisabled: inProgress,
60
+ autoFocus: isVisible,
61
+ "aria-label": "Chat message input",
62
+ suggestions: [
63
+ { text: "Create in-depth analysis" },
64
+ { text: "Identify actionable tasks" },
65
+ { text: "Summarize key points" }
66
+ ],
67
+ onSuggestionSelect: (suggestion) => {
68
+ setValue(suggestion);
69
+ handleSubmit(suggestion);
70
+ }
71
+ }
72
+ );
73
+ };
74
+ InputAdapter.displayName = "InputAdapter";
75
+ var UserMessageWrapper = styled.div`
76
+ display: flex;
77
+ justify-content: flex-end;
78
+ width: 100%;
79
+ padding: 8px 0;
80
+ `;
81
+ var UserMessageAdapter = ({
82
+ message,
83
+ ImageRenderer
84
+ }) => {
85
+ if (message?.image) {
86
+ return /* @__PURE__ */ jsx(ImageRenderer, { image: message.image, content: message.content });
87
+ }
88
+ const content = message?.content || "";
89
+ return /* @__PURE__ */ jsx(UserMessageWrapper, { children: /* @__PURE__ */ jsx(UserMessage, { children: content }) });
90
+ };
91
+ UserMessageAdapter.displayName = "UserMessageAdapter";
92
+ var GlobalSidebarStyles = createGlobalStyle`
93
+ /* Override CopilotKit's default positioning - start off-screen */
94
+ .copilotKitSidebar {
95
+ position: fixed !important;
96
+ right: -100vw !important;
97
+ bottom: 0 !important;
98
+ transition: right 0.3s ease !important;
99
+ }
100
+
101
+ /* Move sidebar container into view when expanded */
102
+ .copilotKitSidebarContentWrapper.sidebarExpanded .copilotKitSidebar {
103
+ right: 0 !important;
104
+ }
105
+
106
+ /* Mobile-first: Full viewport sidebar */
107
+ .copilotKitSidebar .copilotKitWindow {
108
+ position: fixed !important;
109
+ top: 0 !important;
110
+ right: 0 !important;
111
+ bottom: 0 !important;
112
+ left: auto !important;
113
+ width: 100vw !important;
114
+ height: 100vh !important;
115
+ max-width: 100vw !important;
116
+ max-height: 100vh !important;
117
+ margin: 0 !important;
118
+ border-radius: 0 !important;
119
+ z-index: 1001 !important;
120
+
121
+ transform: translateX(100%) !important;
122
+ visibility: hidden !important;
123
+ pointer-events: none !important;
124
+ opacity: 0 !important;
125
+ display: none !important;
126
+
127
+ transition: transform 0.3s ease, visibility 0.3s ease, opacity 0.3s ease !important;
128
+ }
129
+
130
+ /* When window has .open class (CopilotKit's native class), show it */
131
+ .copilotKitSidebar .copilotKitWindow.open {
132
+ display: flex !important;
133
+ transform: translateX(0) !important;
134
+ visibility: visible !important;
135
+ pointer-events: auto !important;
136
+ opacity: 1 !important;
137
+ }
138
+
139
+ /* Desktop: Sidebar panel on the right (640px = CopilotKit's breakpoint) */
140
+ @media (min-width: 640px) {
141
+ .copilotKitSidebar .copilotKitWindow {
142
+ inset: auto !important;
143
+ top: 0 !important;
144
+ right: 0 !important;
145
+ bottom: 0 !important;
146
+ left: auto !important;
147
+ width: 28rem !important;
148
+ height: 100vh !important;
149
+ max-width: 28rem !important;
150
+ max-height: 100vh !important;
151
+ }
152
+ }
153
+
154
+ /* Hide button when sidebar is open */
155
+ .copilotKitSidebarContentWrapper.sidebarExpanded {
156
+ button[aria-label="Open chat"],
157
+ button[aria-label="Close chat"] {
158
+ display: none !important;
159
+ }
160
+ }
161
+
162
+ /* Show button when sidebar is closed */
163
+ .copilotKitSidebarContentWrapper:not(.sidebarExpanded) {
164
+ button[aria-label="Open chat"],
165
+ button[aria-label="Close chat"] {
166
+ display: flex !important;
167
+ }
168
+ }
169
+
170
+ /* Override CopilotKit's default message styles with our custom components */
171
+ .copilotKitSidebar {
172
+ /* Reset all default CopilotKit message styling */
173
+ [class*="copilotKitMessage"],
174
+ [class*="Message-module"] {
175
+ all: unset !important;
176
+ display: contents !important;
177
+ }
178
+
179
+ /* Ensure our custom UserMessage gradient pill shows through */
180
+ button[role="presentation"] {
181
+ all: revert !important;
182
+ display: inline-flex !important;
183
+ }
184
+
185
+ /* Reset input styles to allow our custom ChatInput */
186
+ [class*="Input-module"],
187
+ [class*="copilotKitInput"] {
188
+ all: unset !important;
189
+ display: contents !important;
190
+ }
191
+
192
+ /* Reset header styles */
193
+ [class*="Header-module"],
194
+ [class*="copilotKitHeader"] {
195
+ all: unset !important;
196
+ display: contents !important;
197
+ }
198
+ }
199
+ `;
200
+ var StyledChatButton = styled.button`
201
+ position: fixed;
202
+ bottom: 8px;
203
+ right: 8px;
204
+ width: 36px;
205
+ height: 36px;
206
+ border-radius: 18px;
207
+ border: none;
208
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
209
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ cursor: pointer;
214
+ z-index: 1000;
215
+ transition: all 0.2s ease;
216
+
217
+ &:hover {
218
+ transform: scale(1.05);
219
+ box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
220
+ }
221
+
222
+ &:active {
223
+ transform: scale(0.95);
224
+ }
225
+
226
+ svg {
227
+ width: 20px;
228
+ height: 20px;
229
+ fill: white;
230
+ }
231
+ `;
232
+ var CustomCopilotSidebar = ({
233
+ children,
234
+ instructions = "You are a helpful AI assistant.",
235
+ labels,
236
+ icons,
237
+ defaultOpen = false,
238
+ clickOutsideToClose = true,
239
+ hitEscapeToClose = true,
240
+ shortcut = "/",
241
+ onSetOpen,
242
+ className,
243
+ ...props
244
+ }) => {
245
+ const HeaderAdapter = (_props) => {
246
+ const { setOpen } = useChatContext();
247
+ const handleClose = () => {
248
+ setOpen(false);
249
+ onSetOpen?.(false);
250
+ };
251
+ return /* @__PURE__ */ jsx(Header, { title: "AI Assistant", subtitle: "How can I help you today?", onClose: handleClose });
252
+ };
253
+ const WindowAdapter = (props2) => {
254
+ return /* @__PURE__ */ jsx(Window, { children: props2.children });
255
+ };
256
+ const MessagesAdapter = (props2) => {
257
+ return /* @__PURE__ */ jsx(Messages, { children: props2.messages.map((message, index) => /* @__PURE__ */ jsx(
258
+ props2.RenderMessage,
259
+ {
260
+ message,
261
+ inProgress: props2.inProgress,
262
+ index,
263
+ isCurrentMessage: index === props2.messages.length - 1
264
+ },
265
+ message.id || `message-${index}`
266
+ )) });
267
+ };
268
+ const CustomButton = (_props) => {
269
+ const { open, setOpen } = useChatContext();
270
+ const handleClick = () => {
271
+ const newOpenState = !open;
272
+ setOpen(newOpenState);
273
+ onSetOpen?.(newOpenState);
274
+ };
275
+ return /* @__PURE__ */ jsx(
276
+ StyledChatButton,
277
+ {
278
+ onClick: handleClick,
279
+ "aria-label": open ? "Close chat" : "Open chat",
280
+ type: "button",
281
+ children: /* @__PURE__ */ jsxs(
282
+ "svg",
283
+ {
284
+ width: "20",
285
+ height: "20",
286
+ viewBox: "0 0 24 24",
287
+ fill: "currentColor",
288
+ xmlns: "http://www.w3.org/2000/svg",
289
+ role: "img",
290
+ "aria-label": "Chat icon",
291
+ children: [
292
+ /* @__PURE__ */ jsx("title", { children: "Chat" }),
293
+ /* @__PURE__ */ jsx("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" })
294
+ ]
295
+ }
296
+ )
297
+ }
298
+ );
299
+ };
300
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
301
+ /* @__PURE__ */ jsx(GlobalSidebarStyles, {}),
302
+ /* @__PURE__ */ jsx(
303
+ CopilotSidebar,
304
+ {
305
+ AssistantMessage: AssistantMessageAdapter,
306
+ UserMessage: UserMessageAdapter,
307
+ Input: InputAdapter,
308
+ Header: HeaderAdapter,
309
+ Window: WindowAdapter,
310
+ Messages: MessagesAdapter,
311
+ Button: CustomButton,
312
+ instructions,
313
+ labels: {
314
+ title: "AI Assistant",
315
+ initial: "Hi! How can I help you today?",
316
+ ...labels
317
+ },
318
+ icons,
319
+ defaultOpen,
320
+ clickOutsideToClose,
321
+ hitEscapeToClose,
322
+ shortcut,
323
+ onSetOpen,
324
+ className,
325
+ ...props,
326
+ children
327
+ }
328
+ )
329
+ ] });
330
+ };
331
+ CustomCopilotSidebar.displayName = "CustomCopilotSidebar";
332
+ var GlobalSidebarStyles2 = createGlobalStyle`
333
+ /* Override CopilotKit's default positioning - start off-screen */
334
+ .copilotKitSidebar {
335
+ position: fixed !important;
336
+ right: -100vw !important;
337
+ bottom: 0 !important;
338
+ transition: right 0.3s ease !important;
339
+ }
340
+
341
+ /* Move sidebar container into view when expanded */
342
+ .copilotKitSidebarContentWrapper.sidebarExpanded .copilotKitSidebar {
343
+ right: 0 !important;
344
+ }
345
+
346
+ /* Mobile-first: Full viewport sidebar */
347
+ .copilotKitSidebar .copilotKitWindow {
348
+ /* Override CopilotKit defaults for mobile */
349
+ position: fixed !important;
350
+ top: 0 !important;
351
+ right: 0 !important;
352
+ bottom: 0 !important;
353
+ left: auto !important;
354
+ width: 100vw !important;
355
+ height: 100vh !important;
356
+ max-width: 100vw !important;
357
+ max-height: 100vh !important;
358
+ margin: 0 !important;
359
+ border-radius: 0 !important;
360
+ z-index: 1001 !important;
361
+
362
+ /* Hidden by default - translateX(100%) moves it off-screen to the right */
363
+ transform: translateX(100%) !important;
364
+ visibility: hidden !important;
365
+ pointer-events: none !important;
366
+ opacity: 0 !important;
367
+ display: none !important;
368
+
369
+ /* Smooth slide transition */
370
+ transition: transform 0.3s ease, visibility 0.3s ease, opacity 0.3s ease !important;
371
+ }
372
+
373
+ /* When window has .open class (CopilotKit's native class), show it */
374
+ .copilotKitSidebar .copilotKitWindow.open {
375
+ display: flex !important;
376
+ transform: translateX(0) !important;
377
+ visibility: visible !important;
378
+ pointer-events: auto !important;
379
+ opacity: 1 !important;
380
+ }
381
+
382
+ /* Desktop: Sidebar panel on the right (640px = CopilotKit's breakpoint) */
383
+ @media (min-width: 640px) {
384
+ .copilotKitSidebar .copilotKitWindow {
385
+ inset: auto !important;
386
+ top: 0 !important;
387
+ right: 0 !important;
388
+ bottom: 0 !important;
389
+ left: auto !important;
390
+ width: 28rem !important;
391
+ height: 100vh !important;
392
+ max-width: 28rem !important;
393
+ max-height: 100vh !important;
394
+ }
395
+ }
396
+
397
+ /* Hide button when sidebar is open */
398
+ .copilotKitSidebarContentWrapper.sidebarExpanded {
399
+ button[aria-label="Open chat"],
400
+ button[aria-label="Close chat"] {
401
+ display: none !important;
402
+ }
403
+ }
404
+
405
+ /* Show button when sidebar is closed */
406
+ .copilotKitSidebarContentWrapper:not(.sidebarExpanded) {
407
+ button[aria-label="Open chat"],
408
+ button[aria-label="Close chat"] {
409
+ display: flex !important;
410
+ }
411
+ }
412
+ `;
413
+ var StyledChatButton2 = styled.button`
414
+ position: fixed;
415
+ bottom: 8px;
416
+ right: 8px;
417
+ width: 36px;
418
+ height: 36px;
419
+ border-radius: 18px;
420
+ border: none;
421
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
422
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
423
+ display: flex;
424
+ align-items: center;
425
+ justify-content: center;
426
+ cursor: pointer;
427
+ z-index: 1000;
428
+ transition: all 0.2s ease;
429
+
430
+ &:hover {
431
+ transform: scale(1.05);
432
+ box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
433
+ }
434
+
435
+ &:active {
436
+ transform: scale(0.95);
437
+ }
438
+
439
+ svg {
440
+ width: 20px;
441
+ height: 20px;
442
+ fill: white;
443
+ }
444
+ `;
445
+ function CustomCopilotSidebar2({
446
+ children,
447
+ defaultOpen = false,
448
+ onSetOpen,
449
+ instructions,
450
+ className
451
+ }) {
452
+ const HeaderAdapterWithClose = (_props) => {
453
+ const { setOpen } = useChatContext();
454
+ const handleClose = () => {
455
+ setOpen(false);
456
+ onSetOpen?.(false);
457
+ };
458
+ return /* @__PURE__ */ jsx(Header, { title: "AI Assistant", subtitle: "How can I help you today?", onClose: handleClose });
459
+ };
460
+ const WindowAdapterLocal = (props) => {
461
+ return /* @__PURE__ */ jsx(Window, { children: props.children });
462
+ };
463
+ const MessagesAdapter = (props) => {
464
+ return /* @__PURE__ */ jsx(Messages, { children: props.messages.map((message, index) => /* @__PURE__ */ jsx(
465
+ props.RenderMessage,
466
+ {
467
+ message,
468
+ inProgress: props.inProgress,
469
+ index,
470
+ isCurrentMessage: index === props.messages.length - 1
471
+ },
472
+ message.id || `message-${index}`
473
+ )) });
474
+ };
475
+ const CustomButton = (_props) => {
476
+ const { open, setOpen } = useChatContext();
477
+ const handleClick = () => {
478
+ const newOpenState = !open;
479
+ setOpen(newOpenState);
480
+ onSetOpen?.(newOpenState);
481
+ };
482
+ return /* @__PURE__ */ jsx(
483
+ StyledChatButton2,
484
+ {
485
+ onClick: handleClick,
486
+ "aria-label": open ? "Close chat" : "Open chat",
487
+ type: "button",
488
+ children: /* @__PURE__ */ jsxs(
489
+ "svg",
490
+ {
491
+ width: "20",
492
+ height: "20",
493
+ viewBox: "0 0 24 24",
494
+ fill: "currentColor",
495
+ xmlns: "http://www.w3.org/2000/svg",
496
+ role: "img",
497
+ "aria-label": "Chat icon",
498
+ children: [
499
+ /* @__PURE__ */ jsx("title", { children: "Chat" }),
500
+ /* @__PURE__ */ jsx("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" })
501
+ ]
502
+ }
503
+ )
504
+ }
505
+ );
506
+ };
507
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
508
+ /* @__PURE__ */ jsx(GlobalSidebarStyles2, {}),
509
+ /* @__PURE__ */ jsx(
510
+ CopilotSidebar,
511
+ {
512
+ AssistantMessage: AssistantMessageAdapter,
513
+ UserMessage: UserMessageAdapter,
514
+ Input: InputAdapter,
515
+ Header: HeaderAdapterWithClose,
516
+ Window: WindowAdapterLocal,
517
+ Messages: MessagesAdapter,
518
+ Button: CustomButton,
519
+ instructions,
520
+ labels: {
521
+ title: "AI Assistant",
522
+ initial: "Hi! How can I help you today?"
523
+ },
524
+ defaultOpen,
525
+ clickOutsideToClose: true,
526
+ hitEscapeToClose: true,
527
+ onSetOpen,
528
+ className,
529
+ children
530
+ }
531
+ )
532
+ ] });
533
+ }
534
+ CustomCopilotSidebar2.displayName = "CustomCopilotSidebar";
535
+
536
+ export { AssistantMessageAdapter, CustomCopilotSidebar2 as CustomCopilotSidebar, InputAdapter, CustomCopilotSidebar as IntegratedSidebar, UserMessageAdapter };
537
+ //# sourceMappingURL=index.js.map
538
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/copilotkit/adapters/AssistantMessageAdapter.tsx","../../src/components/copilotkit/adapters/InputAdapter.tsx","../../src/components/copilotkit/adapters/UserMessageAdapter.tsx","../../src/components/copilotkit/CopilotSidebarIntegration.tsx","../../src/components/copilotkit/CustomCopilotSidebar/CustomCopilotSidebar.tsx"],"names":["jsx","styled","props","GlobalSidebarStyles","createGlobalStyle","StyledChatButton","CustomCopilotSidebar","useChatContext","jsxs","Fragment","CopilotSidebar"],"mappings":";;;;;;;AAiBO,IAAM,0BAAkE,CAAC;AAAA,EAC9E,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASF,CAAA,KAAM;AAEJ,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAkB,OAAA,EAAQ,aAAA,EAAc,CAAA;AAAA,EAClD;AAGA,EAAA,IAAI,YAAA,IAAgB,CAAC,OAAA,EAA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,QAAA,EAAA;AAAA,oBAAAT,GAAAA,CAACG,sBAAA,EAAoB,CAAA;AAAA,oBACrBH,GAAAA;AAAA,MAACU,cAAAA;AAAA,MAAA;AAAA,QAEC,gBAAA,EAAkB,uBAAA;AAAA,QAClB,WAAA,EAAa,kBAAA;AAAA,QACb,KAAA,EAAO,YAAA;AAAA,QACP,MAAA,EAAQ,sBAAA;AAAA,QACR,MAAA,EAAQ,kBAAA;AAAA,QACR,QAAA,EAAU,eAAA;AAAA,QACV,MAAA,EAAQ,YAAA;AAAA,QAER,YAAA;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,KAAA,EAAO,cAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACX;AAAA,QAEA,WAAA;AAAA,QACA,mBAAA,EAAqB,IAAA;AAAA,QACrB,gBAAA,EAAkB,IAAA;AAAA,QAClB,SAAA;AAAA,QAEA,SAAA;AAAA,QAEC;AAAA;AAAA;AACH,GAAA,EACF,CAAA;AAEJ;AAEAJ,qBAAAA,CAAqB,WAAA,GAAc,sBAAA","file":"index.js","sourcesContent":["/**\n * Adapter component that bridges custom AssistantMessage with CopilotKit's expected interface\n *\n * This adapter:\n * 1. Converts CopilotKit's AssistantMessageProps to our custom component props\n * 2. Handles loading states by showing AssistantThinking component\n * 3. Extracts message content and renders with our styled component\n */\n\nimport type { AssistantMessageProps as CopilotAssistantMessageProps } from '@copilotkit/react-ui';\nimport type React from 'react';\nimport { AssistantThinking } from '../../AssistantThinking/AssistantThinking';\nimport { AssistantMessage } from '../Messages/AssistantMessage';\n\n/**\n * Adapter that converts CopilotKit's AssistantMessageProps to our custom component\n */\nexport const AssistantMessageAdapter: React.FC<CopilotAssistantMessageProps> = ({\n message,\n isLoading,\n isGenerating,\n // These are available but not used in our current implementation:\n // isCurrentMessage,\n // onRegenerate,\n // onCopy,\n // onThumbsUp,\n // onThumbsDown,\n // markdownTagRenderers,\n // ImageRenderer,\n}) => {\n // Show thinking state when loading (before content arrives)\n if (isLoading) {\n return <AssistantThinking message=\"Thinking...\" />;\n }\n\n // Show thinking state when generating (content is streaming)\n if (isGenerating && !message?.content) {\n return <AssistantThinking message=\"Generating response...\" />;\n }\n\n // Extract content from the message\n const content = message?.content || '';\n\n // Parse attachments if present in the message\n // Note: generativeUI is a function in CopilotKit's AIMessage, not an array\n // For now, we don't extract attachments from the message\n // TODO: Implement proper attachment extraction when CopilotKit supports it\n const attachments: any[] = [];\n\n return (\n <AssistantMessage\n content={content}\n avatarInitials=\"AI\"\n isLoading={isGenerating} // Show loading dots while generating\n attachments={attachments}\n enableMarkdown={true}\n />\n );\n};\n\nAssistantMessageAdapter.displayName = 'AssistantMessageAdapter';\n","/**\n * Adapter component that bridges custom Input with CopilotKit's expected interface\n *\n * This adapter:\n * 1. Converts CopilotKit's InputProps to our custom component props\n * 2. Handles the onSend callback to work with CopilotKit's message system\n * 3. Manages input state and submission\n */\n\nimport type { InputProps as CopilotInputProps } from '@copilotkit/react-ui';\nimport type React from 'react';\nimport { useState } from 'react';\nimport { ChatInput } from '../../ChatInput/ChatInput';\n\n/**\n * Adapter that converts CopilotKit's InputProps to our custom component\n */\nexport const InputAdapter: React.FC<CopilotInputProps> = ({\n inProgress,\n onSend,\n isVisible = true,\n}) => {\n const [value, setValue] = useState('');\n\n const handleSubmit = async (message: string) => {\n if (!message.trim() || inProgress) return;\n\n // Call CopilotKit's onSend which returns a Promise<Message>\n await onSend(message);\n setValue(''); // Clear input after sending\n };\n\n // TODO: Add support for stop button and file upload if needed\n\n return (\n <ChatInput\n value={value}\n onChange={setValue}\n onSubmit={handleSubmit}\n placeholder=\"Ask, write or search for anything...\"\n isDisabled={inProgress}\n autoFocus={isVisible}\n aria-label=\"Chat message input\"\n suggestions={[\n { text: 'Create in-depth analysis' },\n { text: 'Identify actionable tasks' },\n { text: 'Summarize key points' },\n ]}\n onSuggestionSelect={(suggestion) => {\n setValue(suggestion);\n handleSubmit(suggestion);\n }}\n />\n );\n};\n\nInputAdapter.displayName = 'InputAdapter';\n","/**\n * Adapter component that bridges custom UserMessage with CopilotKit's expected interface\n *\n * This adapter:\n * 1. Converts CopilotKit's UserMessageProps to our custom component props\n * 2. Extracts message content from CopilotKit's message object\n * 3. Handles image messages appropriately\n */\n\nimport type { UserMessageProps as CopilotUserMessageProps } from '@copilotkit/react-ui';\nimport type React from 'react';\nimport styled from 'styled-components';\nimport { UserMessage } from '../../UserMessage/UserMessage';\n\n// Wrapper to align user messages to the right\nconst UserMessageWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n width: 100%;\n padding: 8px 0;\n`;\n\n/**\n * Adapter that converts CopilotKit's UserMessageProps to our custom component\n */\nexport const UserMessageAdapter: React.FC<CopilotUserMessageProps> = ({\n message,\n ImageRenderer,\n}) => {\n // Handle image messages\n if (message?.image) {\n return <ImageRenderer image={message.image} content={message.content} />;\n }\n\n // Extract text content\n const content = message?.content || '';\n\n // Our UserMessage is a button-like component with React ARIA\n // In the chat context, it's not interactive, so we don't provide onPress\n return (\n <UserMessageWrapper>\n <UserMessage>{content}</UserMessage>\n </UserMessageWrapper>\n );\n};\n\nUserMessageAdapter.displayName = 'UserMessageAdapter';\n","/**\n * Complete CopilotSidebar Integration Example\n *\n * This file demonstrates how to integrate custom-designed components\n * (AssistantMessage, UserMessage, AssistantThinking, Input) with CopilotKit's\n * CopilotSidebar component using adapter components.\n *\n * Usage:\n * ```tsx\n * import { CopilotKit } from \"@copilotkit/react-core\";\n * import { CustomCopilotSidebar } from \"./CopilotSidebarIntegration\";\n *\n * function App() {\n * return (\n * <CopilotKit runtimeUrl=\"/api/copilotkit\">\n * <CustomCopilotSidebar>\n * <YourApp />\n * </CustomCopilotSidebar>\n * </CopilotKit>\n * );\n * }\n * ```\n */\n\nimport type {\n ButtonProps as CopilotButtonProps,\n HeaderProps as CopilotHeaderProps,\n MessagesProps as CopilotMessagesProps,\n WindowProps as CopilotWindowProps,\n} from '@copilotkit/react-ui';\nimport { CopilotSidebar, useChatContext } from '@copilotkit/react-ui';\nimport type React from 'react';\nimport styled, { createGlobalStyle } from 'styled-components';\nimport { AssistantMessageAdapter, InputAdapter, UserMessageAdapter } from './adapters';\nimport { Header } from './Header/Header';\nimport { Messages } from './Messages/Messages';\nimport { Window } from './Window/Window';\n\n// Global styles to ensure sidebar starts hidden and button visibility\nconst GlobalSidebarStyles = createGlobalStyle`\n /* Override CopilotKit's default positioning - start off-screen */\n .copilotKitSidebar {\n position: fixed !important;\n right: -100vw !important;\n bottom: 0 !important;\n transition: right 0.3s ease !important;\n }\n\n /* Move sidebar container into view when expanded */\n .copilotKitSidebarContentWrapper.sidebarExpanded .copilotKitSidebar {\n right: 0 !important;\n }\n\n /* Mobile-first: Full viewport sidebar */\n .copilotKitSidebar .copilotKitWindow {\n position: fixed !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: auto !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n margin: 0 !important;\n border-radius: 0 !important;\n z-index: 1001 !important;\n\n transform: translateX(100%) !important;\n visibility: hidden !important;\n pointer-events: none !important;\n opacity: 0 !important;\n display: none !important;\n\n transition: transform 0.3s ease, visibility 0.3s ease, opacity 0.3s ease !important;\n }\n\n /* When window has .open class (CopilotKit's native class), show it */\n .copilotKitSidebar .copilotKitWindow.open {\n display: flex !important;\n transform: translateX(0) !important;\n visibility: visible !important;\n pointer-events: auto !important;\n opacity: 1 !important;\n }\n\n /* Desktop: Sidebar panel on the right (640px = CopilotKit's breakpoint) */\n @media (min-width: 640px) {\n .copilotKitSidebar .copilotKitWindow {\n inset: auto !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: auto !important;\n width: 28rem !important;\n height: 100vh !important;\n max-width: 28rem !important;\n max-height: 100vh !important;\n }\n }\n\n /* Hide button when sidebar is open */\n .copilotKitSidebarContentWrapper.sidebarExpanded {\n button[aria-label=\"Open chat\"],\n button[aria-label=\"Close chat\"] {\n display: none !important;\n }\n }\n\n /* Show button when sidebar is closed */\n .copilotKitSidebarContentWrapper:not(.sidebarExpanded) {\n button[aria-label=\"Open chat\"],\n button[aria-label=\"Close chat\"] {\n display: flex !important;\n }\n }\n\n /* Override CopilotKit's default message styles with our custom components */\n .copilotKitSidebar {\n /* Reset all default CopilotKit message styling */\n [class*=\"copilotKitMessage\"],\n [class*=\"Message-module\"] {\n all: unset !important;\n display: contents !important;\n }\n\n /* Ensure our custom UserMessage gradient pill shows through */\n button[role=\"presentation\"] {\n all: revert !important;\n display: inline-flex !important;\n }\n\n /* Reset input styles to allow our custom ChatInput */\n [class*=\"Input-module\"],\n [class*=\"copilotKitInput\"] {\n all: unset !important;\n display: contents !important;\n }\n\n /* Reset header styles */\n [class*=\"Header-module\"],\n [class*=\"copilotKitHeader\"] {\n all: unset !important;\n display: contents !important;\n }\n }\n`;\n\n// Styled button positioned in the bottom-right corner\nconst StyledChatButton = styled.button`\n position: fixed;\n bottom: 8px;\n right: 8px;\n width: 36px;\n height: 36px;\n border-radius: 18px;\n border: none;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 1000;\n transition: all 0.2s ease;\n\n &:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n svg {\n width: 20px;\n height: 20px;\n fill: white;\n }\n`;\n\nexport interface CustomCopilotSidebarProps {\n /**\n * Children to render alongside the sidebar\n */\n children?: React.ReactNode;\n /**\n * Instructions for the AI assistant\n */\n instructions?: string;\n /**\n * Custom labels for the sidebar\n */\n labels?: {\n title?: string;\n initial?: string;\n };\n /**\n * Custom icons\n */\n icons?: Record<string, React.ReactNode>;\n /**\n * Whether the sidebar starts open\n */\n defaultOpen?: boolean;\n /**\n * Allow closing by clicking outside\n */\n clickOutsideToClose?: boolean;\n /**\n * Allow closing with Escape key\n */\n hitEscapeToClose?: boolean;\n /**\n * Keyboard shortcut to open\n */\n shortcut?: string;\n /**\n * Callback when open state changes\n */\n onSetOpen?: (open: boolean) => void;\n /**\n * CSS class name\n */\n className?: string;\n}\n\n/**\n * CopilotSidebar with custom-designed components\n *\n * This component wraps CopilotKit's CopilotSidebar and injects our\n * custom components via adapter components.\n *\n * Features:\n * - Custom AssistantMessage with avatar and loading states\n * - AssistantThinking component shown during loading\n * - Custom UserMessage with gradient pill design\n * - Custom Input with React ARIA accessibility\n * - Styled chat button with gradient\n */\nexport const CustomCopilotSidebar: React.FC<CustomCopilotSidebarProps> = ({\n children,\n instructions = 'You are a helpful AI assistant.',\n labels,\n icons,\n defaultOpen = false,\n clickOutsideToClose = true,\n hitEscapeToClose = true,\n shortcut = '/',\n onSetOpen,\n className,\n ...props\n}) => {\n // Header adapter with close handler\n // biome-ignore lint/correctness/noNestedComponentDefinitions: This component must be defined here to access CopilotKit's ChatContext and the onSetOpen prop\n const HeaderAdapter = (_props: CopilotHeaderProps) => {\n const { setOpen } = useChatContext();\n\n const handleClose = () => {\n setOpen(false);\n onSetOpen?.(false);\n };\n\n return (\n <Header title=\"AI Assistant\" subtitle=\"How can I help you today?\" onClose={handleClose} />\n );\n };\n\n // Window adapter - wraps our custom Window component\n // biome-ignore lint/correctness/noNestedComponentDefinitions: Simple adapter component\n const WindowAdapter = (props: CopilotWindowProps) => {\n return <Window>{props.children}</Window>;\n };\n\n // Messages adapter - wraps our custom Messages component\n // biome-ignore lint/correctness/noNestedComponentDefinitions: Simple adapter component\n const MessagesAdapter = (props: CopilotMessagesProps) => {\n return (\n <Messages>\n {props.messages.map((message, index) => (\n <props.RenderMessage\n key={message.id || `message-${index}`}\n message={message}\n inProgress={props.inProgress}\n index={index}\n isCurrentMessage={index === props.messages.length - 1}\n />\n ))}\n </Messages>\n );\n };\n\n // Custom Button component that uses CopilotKit's ChatContext\n // biome-ignore lint/correctness/noNestedComponentDefinitions: This component must be defined here to access CopilotKit's ChatContext and the onSetOpen prop\n const CustomButton = (_props: CopilotButtonProps) => {\n const { open, setOpen } = useChatContext();\n\n const handleClick = () => {\n const newOpenState = !open;\n setOpen(newOpenState);\n onSetOpen?.(newOpenState);\n };\n\n return (\n <StyledChatButton\n onClick={handleClick}\n aria-label={open ? 'Close chat' : 'Open chat'}\n type=\"button\"\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-label=\"Chat icon\"\n >\n <title>Chat</title>\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n </StyledChatButton>\n );\n };\n\n return (\n <>\n <GlobalSidebarStyles />\n <CopilotSidebar\n // Pass through custom components via adapters\n AssistantMessage={AssistantMessageAdapter}\n UserMessage={UserMessageAdapter}\n Input={InputAdapter}\n Header={HeaderAdapter}\n Window={WindowAdapter}\n Messages={MessagesAdapter}\n Button={CustomButton}\n // Configuration\n instructions={instructions}\n labels={{\n title: 'AI Assistant',\n initial: 'Hi! How can I help you today?',\n ...labels,\n }}\n icons={icons}\n // Behavior\n defaultOpen={defaultOpen}\n clickOutsideToClose={clickOutsideToClose}\n hitEscapeToClose={hitEscapeToClose}\n shortcut={shortcut}\n onSetOpen={onSetOpen}\n // Styling\n className={className}\n // Other props\n {...props}\n >\n {children}\n </CopilotSidebar>\n </>\n );\n};\n\nCustomCopilotSidebar.displayName = 'CustomCopilotSidebar';\n","import type {\n ButtonProps as CopilotButtonProps,\n HeaderProps as CopilotHeaderProps,\n MessagesProps as CopilotMessagesProps,\n WindowProps as CopilotWindowProps,\n} from '@copilotkit/react-ui';\nimport { CopilotSidebar, useChatContext } from '@copilotkit/react-ui';\nimport type { ReactNode } from 'react';\nimport styled, { createGlobalStyle } from 'styled-components';\nimport { AssistantMessageAdapter, InputAdapter, UserMessageAdapter } from '../adapters';\nimport { Header } from '../Header/Header';\nimport { Messages } from '../Messages/Messages';\nimport { Window } from '../Window/Window';\n\n// Global styles to ensure sidebar starts hidden and button visibility\nconst GlobalSidebarStyles = createGlobalStyle`\n /* Override CopilotKit's default positioning - start off-screen */\n .copilotKitSidebar {\n position: fixed !important;\n right: -100vw !important;\n bottom: 0 !important;\n transition: right 0.3s ease !important;\n }\n\n /* Move sidebar container into view when expanded */\n .copilotKitSidebarContentWrapper.sidebarExpanded .copilotKitSidebar {\n right: 0 !important;\n }\n\n /* Mobile-first: Full viewport sidebar */\n .copilotKitSidebar .copilotKitWindow {\n /* Override CopilotKit defaults for mobile */\n position: fixed !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: auto !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n margin: 0 !important;\n border-radius: 0 !important;\n z-index: 1001 !important;\n\n /* Hidden by default - translateX(100%) moves it off-screen to the right */\n transform: translateX(100%) !important;\n visibility: hidden !important;\n pointer-events: none !important;\n opacity: 0 !important;\n display: none !important;\n\n /* Smooth slide transition */\n transition: transform 0.3s ease, visibility 0.3s ease, opacity 0.3s ease !important;\n }\n\n /* When window has .open class (CopilotKit's native class), show it */\n .copilotKitSidebar .copilotKitWindow.open {\n display: flex !important;\n transform: translateX(0) !important;\n visibility: visible !important;\n pointer-events: auto !important;\n opacity: 1 !important;\n }\n\n /* Desktop: Sidebar panel on the right (640px = CopilotKit's breakpoint) */\n @media (min-width: 640px) {\n .copilotKitSidebar .copilotKitWindow {\n inset: auto !important;\n top: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n left: auto !important;\n width: 28rem !important;\n height: 100vh !important;\n max-width: 28rem !important;\n max-height: 100vh !important;\n }\n }\n\n /* Hide button when sidebar is open */\n .copilotKitSidebarContentWrapper.sidebarExpanded {\n button[aria-label=\"Open chat\"],\n button[aria-label=\"Close chat\"] {\n display: none !important;\n }\n }\n\n /* Show button when sidebar is closed */\n .copilotKitSidebarContentWrapper:not(.sidebarExpanded) {\n button[aria-label=\"Open chat\"],\n button[aria-label=\"Close chat\"] {\n display: flex !important;\n }\n }\n`;\n\n// Styled button positioned in the bottom-right corner\nconst StyledChatButton = styled.button`\n position: fixed;\n bottom: 8px;\n right: 8px;\n width: 36px;\n height: 36px;\n border-radius: 18px;\n border: none;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 1000;\n transition: all 0.2s ease;\n\n &:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n svg {\n width: 20px;\n height: 20px;\n fill: white;\n }\n`;\n\nexport interface CustomCopilotSidebarProps {\n children: ReactNode;\n defaultOpen?: boolean;\n onSetOpen?: (open: boolean) => void;\n instructions?: string;\n className?: string;\n}\n\n/**\n * CustomCopilotSidebar - A CopilotSidebar wrapper using our custom components\n *\n * This component wraps CopilotKit's CopilotSidebar and provides our custom\n * design system components for a consistent look and feel.\n *\n * @example\n * ```tsx\n * <CustomCopilotSidebar defaultOpen={false} onSetOpen={(open) => console.log(open)}>\n * <YourApp />\n * </CustomCopilotSidebar>\n * ```\n */\nexport function CustomCopilotSidebar({\n children,\n defaultOpen = false,\n onSetOpen,\n instructions,\n className,\n}: CustomCopilotSidebarProps) {\n // Header adapter with close handler\n // biome-ignore lint/correctness/noNestedComponentDefinitions: This component must be defined here to access CopilotKit's ChatContext and the onSetOpen prop\n const HeaderAdapterWithClose = (_props: CopilotHeaderProps) => {\n const { setOpen } = useChatContext();\n\n const handleClose = () => {\n setOpen(false);\n onSetOpen?.(false);\n };\n\n return (\n <Header title=\"AI Assistant\" subtitle=\"How can I help you today?\" onClose={handleClose} />\n );\n };\n\n // Window adapter - wraps our custom Window component\n // biome-ignore lint/correctness/noNestedComponentDefinitions: Simple adapter component\n const WindowAdapterLocal = (props: CopilotWindowProps) => {\n return <Window>{props.children}</Window>;\n };\n\n // Messages adapter - wraps our custom Messages component\n // biome-ignore lint/correctness/noNestedComponentDefinitions: Simple adapter component\n const MessagesAdapter = (props: CopilotMessagesProps) => {\n return (\n <Messages>\n {props.messages.map((message, index) => (\n <props.RenderMessage\n key={message.id || `message-${index}`}\n message={message}\n inProgress={props.inProgress}\n index={index}\n isCurrentMessage={index === props.messages.length - 1}\n />\n ))}\n </Messages>\n );\n };\n\n // Custom Button component that uses CopilotKit's ChatContext\n // biome-ignore lint/correctness/noNestedComponentDefinitions: This component must be defined here to access CopilotKit's ChatContext and the onSetOpen prop\n const CustomButton = (_props: CopilotButtonProps) => {\n const { open, setOpen } = useChatContext();\n\n const handleClick = () => {\n const newOpenState = !open;\n setOpen(newOpenState);\n onSetOpen?.(newOpenState);\n };\n\n return (\n <StyledChatButton\n onClick={handleClick}\n aria-label={open ? 'Close chat' : 'Open chat'}\n type=\"button\"\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-label=\"Chat icon\"\n >\n <title>Chat</title>\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z\" />\n </svg>\n </StyledChatButton>\n );\n };\n\n return (\n <>\n <GlobalSidebarStyles />\n <CopilotSidebar\n // Pass through custom components via adapters\n AssistantMessage={AssistantMessageAdapter}\n UserMessage={UserMessageAdapter}\n Input={InputAdapter}\n Header={HeaderAdapterWithClose}\n Window={WindowAdapterLocal}\n Messages={MessagesAdapter}\n Button={CustomButton}\n // Configuration\n instructions={instructions}\n labels={{\n title: 'AI Assistant',\n initial: 'Hi! How can I help you today?',\n }}\n // Behavior\n defaultOpen={defaultOpen}\n clickOutsideToClose={true}\n hitEscapeToClose={true}\n onSetOpen={onSetOpen}\n // Styling\n className={className}\n >\n {children}\n </CopilotSidebar>\n </>\n );\n}\n\nCustomCopilotSidebar.displayName = 'CustomCopilotSidebar';\n"]}
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var chunkH4VHCHCP_cjs = require('../chunk-H4VHCHCP.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "FacebookIcon", {
8
+ enumerable: true,
9
+ get: function () { return chunkH4VHCHCP_cjs.FacebookIcon; }
10
+ });
11
+ Object.defineProperty(exports, "GmailIcon", {
12
+ enumerable: true,
13
+ get: function () { return chunkH4VHCHCP_cjs.GmailIcon; }
14
+ });
15
+ Object.defineProperty(exports, "InstagramIcon", {
16
+ enumerable: true,
17
+ get: function () { return chunkH4VHCHCP_cjs.InstagramIcon; }
18
+ });
19
+ Object.defineProperty(exports, "LinkedInIcon", {
20
+ enumerable: true,
21
+ get: function () { return chunkH4VHCHCP_cjs.LinkedInIcon; }
22
+ });
23
+ Object.defineProperty(exports, "RedditIcon", {
24
+ enumerable: true,
25
+ get: function () { return chunkH4VHCHCP_cjs.RedditIcon; }
26
+ });
27
+ Object.defineProperty(exports, "SlackIcon", {
28
+ enumerable: true,
29
+ get: function () { return chunkH4VHCHCP_cjs.SlackIcon; }
30
+ });
31
+ Object.defineProperty(exports, "TelegramIcon", {
32
+ enumerable: true,
33
+ get: function () { return chunkH4VHCHCP_cjs.TelegramIcon; }
34
+ });
35
+ Object.defineProperty(exports, "WhatsAppIcon", {
36
+ enumerable: true,
37
+ get: function () { return chunkH4VHCHCP_cjs.WhatsAppIcon; }
38
+ });
39
+ Object.defineProperty(exports, "XIcon", {
40
+ enumerable: true,
41
+ get: function () { return chunkH4VHCHCP_cjs.XIcon; }
42
+ });
43
+ Object.defineProperty(exports, "YouTubeIcon", {
44
+ enumerable: true,
45
+ get: function () { return chunkH4VHCHCP_cjs.YouTubeIcon; }
46
+ });
47
+ //# sourceMappingURL=index.cjs.map
48
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}