@agentiffai/design 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Window-CukhSS8T.d.cts +431 -0
- package/dist/Window-CukhSS8T.d.ts +431 -0
- package/dist/{chunk-YX4PWMZ6.js → chunk-H5TKEGIC.js} +3 -3
- package/dist/chunk-H5TKEGIC.js.map +1 -0
- package/dist/{chunk-TI5EB3ER.cjs → chunk-OPWUJP7J.cjs} +3 -3
- package/dist/chunk-OPWUJP7J.cjs.map +1 -0
- package/dist/copilotkit/index.cjs +29 -35
- package/dist/copilotkit/index.cjs.map +1 -1
- package/dist/copilotkit/index.d.cts +159 -0
- package/dist/copilotkit/index.d.ts +159 -0
- package/dist/copilotkit/index.js +3 -9
- package/dist/copilotkit/index.js.map +1 -1
- package/dist/icons/index.d.cts +375 -0
- package/dist/icons/index.d.ts +375 -0
- package/dist/index.cjs +20 -20
- package/dist/index.d.cts +185 -0
- package/dist/index.d.ts +185 -0
- package/dist/index.js +1 -1
- package/dist/layout/index.d.cts +218 -0
- package/dist/layout/index.d.ts +218 -0
- package/dist/theme/index.d.cts +95 -0
- package/dist/theme/index.d.ts +95 -0
- package/package.json +1 -1
- package/dist/chunk-TI5EB3ER.cjs.map +0 -1
- package/dist/chunk-YX4PWMZ6.js.map +0 -1
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import { AriaButtonProps } from '@react-aria/button';
|
|
5
|
+
import { AriaTextFieldProps } from '@react-aria/textfield';
|
|
6
|
+
import { AriaButtonProps as AriaButtonProps$1 } from '@react-types/button';
|
|
7
|
+
import * as styled_components from 'styled-components';
|
|
8
|
+
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
9
|
+
|
|
10
|
+
type ActionVariant = 'primary' | 'secondary' | 'icon';
|
|
11
|
+
type ActionsLayout = 'horizontal' | 'vertical';
|
|
12
|
+
interface Action {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
variant?: ActionVariant;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: React__default.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ActionsProps {
|
|
22
|
+
actions: Action[];
|
|
23
|
+
layout?: ActionsLayout;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
declare function Actions({ actions, layout, className }: ActionsProps): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare namespace Actions {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface AgentStateProps {
|
|
32
|
+
/** Current agent state */
|
|
33
|
+
state: 'idle' | 'thinking' | 'responding' | 'error';
|
|
34
|
+
/** Optional message to display */
|
|
35
|
+
message?: string;
|
|
36
|
+
/** Optional progress percentage (0-100) */
|
|
37
|
+
progress?: number;
|
|
38
|
+
/** Additional CSS class name */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* AgentState component for displaying agent status
|
|
43
|
+
* Styled to match AssistantThinking and Response components with dark theme
|
|
44
|
+
*/
|
|
45
|
+
declare const AgentState: ({ state, message, progress, className }: AgentStateProps) => react_jsx_runtime.JSX.Element | null;
|
|
46
|
+
|
|
47
|
+
type ButtonVariant = 'primary' | 'secondary' | 'icon';
|
|
48
|
+
type ButtonSize = 'small' | 'medium' | 'large';
|
|
49
|
+
|
|
50
|
+
interface ButtonProps extends AriaButtonProps {
|
|
51
|
+
variant?: ButtonVariant;
|
|
52
|
+
size?: ButtonSize;
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
isLoading?: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function Button({ variant, size, children, className, disabled, isLoading, ...ariaProps }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare namespace Button {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface FooterProps {
|
|
64
|
+
/**
|
|
65
|
+
* Branding text to display (e.g., "Powered by CopilotKit")
|
|
66
|
+
*/
|
|
67
|
+
branding?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Optional status text (e.g., "Connected", "Typing...", "3 tokens remaining")
|
|
70
|
+
*/
|
|
71
|
+
status?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional link URL for the branding text
|
|
74
|
+
*/
|
|
75
|
+
brandingUrl?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Callback when branding link is clicked
|
|
78
|
+
*/
|
|
79
|
+
onBrandingClick?: () => void;
|
|
80
|
+
/**
|
|
81
|
+
* Additional CSS class name for custom styling
|
|
82
|
+
*/
|
|
83
|
+
className?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Footer Component
|
|
87
|
+
*
|
|
88
|
+
* A chat footer component that displays branding, status information, and optional links.
|
|
89
|
+
* Typically used at the bottom of a chat interface to show provider information or connection status.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* <Footer
|
|
94
|
+
* branding="Powered by CopilotKit"
|
|
95
|
+
* status="Connected"
|
|
96
|
+
* brandingUrl="https://copilotkit.ai"
|
|
97
|
+
* />
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
declare const Footer: React__default.FC<FooterProps>;
|
|
101
|
+
|
|
102
|
+
interface HeaderProps {
|
|
103
|
+
/**
|
|
104
|
+
* The main title text displayed in the header
|
|
105
|
+
*/
|
|
106
|
+
title: string;
|
|
107
|
+
/**
|
|
108
|
+
* Optional subtitle text displayed below the title
|
|
109
|
+
*/
|
|
110
|
+
subtitle?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Callback function triggered when the close button is clicked
|
|
113
|
+
*/
|
|
114
|
+
onClose?: () => void;
|
|
115
|
+
/**
|
|
116
|
+
* Callback function triggered when the minimize button is clicked
|
|
117
|
+
*/
|
|
118
|
+
onMinimize?: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Additional CSS class name for custom styling
|
|
121
|
+
*/
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Header Component
|
|
126
|
+
*
|
|
127
|
+
* A chat header component that displays a title, optional subtitle, and action buttons.
|
|
128
|
+
* Built with React ARIA for accessibility and Styled Components for theming.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <Header
|
|
133
|
+
* title="AI Assistant"
|
|
134
|
+
* subtitle="How can I help you today?"
|
|
135
|
+
* onClose={() => console.log('Close clicked')}
|
|
136
|
+
* onMinimize={() => console.log('Minimize clicked')}
|
|
137
|
+
* />
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare const Header: React__default.FC<HeaderProps>;
|
|
141
|
+
|
|
142
|
+
interface InputProps extends Omit<AriaTextFieldProps, 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp'> {
|
|
143
|
+
/** Current message value */
|
|
144
|
+
value?: string;
|
|
145
|
+
/** Callback when message value changes */
|
|
146
|
+
onChange?: (value: string) => void;
|
|
147
|
+
/** Callback when message is submitted */
|
|
148
|
+
onSubmit?: (message: string) => void;
|
|
149
|
+
/** Placeholder text */
|
|
150
|
+
placeholder?: string;
|
|
151
|
+
/** Whether the input is disabled */
|
|
152
|
+
isDisabled?: boolean;
|
|
153
|
+
/** Whether the input is read-only */
|
|
154
|
+
isReadOnly?: boolean;
|
|
155
|
+
/** Maximum number of rows before scrolling */
|
|
156
|
+
maxRows?: number;
|
|
157
|
+
/** Whether to auto-focus the input */
|
|
158
|
+
autoFocus?: boolean;
|
|
159
|
+
/** Additional CSS class name */
|
|
160
|
+
className?: string;
|
|
161
|
+
/** ARIA label for the input */
|
|
162
|
+
'aria-label'?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Input component for chat interfaces
|
|
166
|
+
* Features:
|
|
167
|
+
* - Multi-line text support
|
|
168
|
+
* - Submit on Enter, Shift+Enter for new line
|
|
169
|
+
* - React ARIA for accessibility
|
|
170
|
+
* - Auto-growing textarea
|
|
171
|
+
* - Integrated send button
|
|
172
|
+
*/
|
|
173
|
+
declare const Input: React__default.FC<InputProps>;
|
|
174
|
+
|
|
175
|
+
interface FileAttachmentProps extends Omit<AriaButtonProps$1, 'children'> {
|
|
176
|
+
/** File name/title */
|
|
177
|
+
title: string;
|
|
178
|
+
/** File subtitle/category (e.g., "Downloads", "Documents") */
|
|
179
|
+
subtitle?: string;
|
|
180
|
+
/** File size in human-readable format (e.g., "500 KB", "2.5 MB") */
|
|
181
|
+
size?: string;
|
|
182
|
+
/** File icon emoji or Unicode character */
|
|
183
|
+
icon?: string;
|
|
184
|
+
/** Click handler for file interaction */
|
|
185
|
+
onClick?: () => void;
|
|
186
|
+
/** Custom className for styling */
|
|
187
|
+
className?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* FileAttachment component displays file information in assistant messages
|
|
191
|
+
*
|
|
192
|
+
* Features:
|
|
193
|
+
* - File icon display (emoji or Unicode)
|
|
194
|
+
* - File metadata (title, subtitle, size)
|
|
195
|
+
* - Accessible keyboard navigation via React ARIA
|
|
196
|
+
* - Clean, minimal card-based design
|
|
197
|
+
* - WCAG 2.1 AA compliant
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```tsx
|
|
201
|
+
* <FileAttachment
|
|
202
|
+
* title="Example File"
|
|
203
|
+
* subtitle="Downloads"
|
|
204
|
+
* size="500 KB"
|
|
205
|
+
* icon="📄"
|
|
206
|
+
* onPress={() => console.log('File clicked')}
|
|
207
|
+
* />
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
declare const FileAttachment: React__default.FC<FileAttachmentProps>;
|
|
211
|
+
|
|
212
|
+
interface AssistantMessageProps {
|
|
213
|
+
/** Message content to display */
|
|
214
|
+
content?: string;
|
|
215
|
+
/** Avatar image URL */
|
|
216
|
+
avatarUrl?: string;
|
|
217
|
+
/** Avatar initials when no image is provided */
|
|
218
|
+
avatarInitials?: string;
|
|
219
|
+
/** Whether to show loading state */
|
|
220
|
+
isLoading?: boolean;
|
|
221
|
+
/** Custom className for styling */
|
|
222
|
+
className?: string;
|
|
223
|
+
/** Support for markdown rendering (future enhancement) */
|
|
224
|
+
enableMarkdown?: boolean;
|
|
225
|
+
/** File attachments to display below the message */
|
|
226
|
+
attachments?: FileAttachmentProps[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* AssistantMessage component displays AI assistant messages with avatar
|
|
230
|
+
*
|
|
231
|
+
* Features:
|
|
232
|
+
* - Avatar with image or initials fallback
|
|
233
|
+
* - Loading state with animated dots
|
|
234
|
+
* - Markdown support (optional)
|
|
235
|
+
* - Clean, modern design
|
|
236
|
+
*/
|
|
237
|
+
declare const AssistantMessage: React__default.FC<AssistantMessageProps>;
|
|
238
|
+
|
|
239
|
+
interface MessagesProps {
|
|
240
|
+
/**
|
|
241
|
+
* Children elements to be rendered inside the messages container
|
|
242
|
+
*/
|
|
243
|
+
children?: React__default.ReactNode;
|
|
244
|
+
/**
|
|
245
|
+
* Additional CSS class name
|
|
246
|
+
*/
|
|
247
|
+
className?: string;
|
|
248
|
+
/**
|
|
249
|
+
* ARIA label for accessibility
|
|
250
|
+
*/
|
|
251
|
+
ariaLabel?: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Messages component - Container for message list
|
|
255
|
+
*
|
|
256
|
+
* This component serves as a wrapper for the messages area,
|
|
257
|
+
* providing consistent spacing and layout for chat messages.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```tsx
|
|
261
|
+
* <Messages ariaLabel="Chat messages">
|
|
262
|
+
* <MessagesList messages={messages} />
|
|
263
|
+
* </Messages>
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
declare const Messages: React__default.FC<MessagesProps>;
|
|
267
|
+
|
|
268
|
+
interface Message {
|
|
269
|
+
id: string;
|
|
270
|
+
content: ReactNode;
|
|
271
|
+
role: 'user' | 'assistant' | 'system';
|
|
272
|
+
timestamp?: Date;
|
|
273
|
+
}
|
|
274
|
+
interface MessagesListProps {
|
|
275
|
+
/** Array of messages to display */
|
|
276
|
+
messages: Message[];
|
|
277
|
+
/** Whether to automatically scroll to the bottom when new messages arrive */
|
|
278
|
+
autoScroll?: boolean;
|
|
279
|
+
/** Custom class name for the container */
|
|
280
|
+
className?: string;
|
|
281
|
+
/** Custom render function for individual messages */
|
|
282
|
+
renderMessage?: (message: Message) => ReactNode;
|
|
283
|
+
/** Callback when scroll reaches the top (for loading more messages) */
|
|
284
|
+
onScrollTop?: () => void;
|
|
285
|
+
/** Maximum height of the messages list */
|
|
286
|
+
maxHeight?: string;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* MessagesList Component
|
|
290
|
+
*
|
|
291
|
+
* A scrollable message list component with auto-scroll functionality.
|
|
292
|
+
* Designed for chat interfaces where messages need to be displayed
|
|
293
|
+
* in a scrollable container with automatic scrolling to the latest message.
|
|
294
|
+
*
|
|
295
|
+
* Features:
|
|
296
|
+
* - Auto-scroll to bottom on new messages
|
|
297
|
+
* - Overflow handling with custom scrollbar
|
|
298
|
+
* - Flexible message rendering
|
|
299
|
+
* - Scroll event handling for pagination
|
|
300
|
+
*/
|
|
301
|
+
declare const MessagesList: ({ messages, autoScroll, className, renderMessage, onScrollTop, maxHeight, }: MessagesListProps) => react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
declare const MessagesListContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
304
|
+
$maxHeight: string;
|
|
305
|
+
}>> & string;
|
|
306
|
+
declare const MessagesListContent: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
307
|
+
|
|
308
|
+
interface UserMessageProps {
|
|
309
|
+
/** The message content to display */
|
|
310
|
+
content: string;
|
|
311
|
+
/** Optional timestamp for the message */
|
|
312
|
+
timestamp?: string;
|
|
313
|
+
/** Optional CSS class name */
|
|
314
|
+
className?: string;
|
|
315
|
+
/** Optional avatar URL */
|
|
316
|
+
avatarUrl?: string;
|
|
317
|
+
/** Optional username */
|
|
318
|
+
username?: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* UserMessage component displays a user's message in a chat interface.
|
|
322
|
+
* Styled with right alignment and distinct styling from assistant messages.
|
|
323
|
+
*/
|
|
324
|
+
declare const UserMessage: ({ content, timestamp, className, avatarUrl, username, }: UserMessageProps) => react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
interface ResponseProps {
|
|
327
|
+
/** Loading state - shows animated dots */
|
|
328
|
+
isLoading?: boolean;
|
|
329
|
+
/** Typing state - shows typing indicator */
|
|
330
|
+
isTyping?: boolean;
|
|
331
|
+
/** Streaming state - shows text being typed */
|
|
332
|
+
isStreaming?: boolean;
|
|
333
|
+
/** Content to display when streaming */
|
|
334
|
+
streamingContent?: string;
|
|
335
|
+
/** Message to display with loading/typing state */
|
|
336
|
+
message?: string;
|
|
337
|
+
/** Additional CSS class name */
|
|
338
|
+
className?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Response component for displaying loading and streaming states
|
|
342
|
+
* Shows animated loading dots, typing indicators, and streaming text
|
|
343
|
+
*/
|
|
344
|
+
declare const Response: ({ isLoading, isTyping, isStreaming, streamingContent, message, className, }: ResponseProps) => react_jsx_runtime.JSX.Element | null;
|
|
345
|
+
|
|
346
|
+
interface SuggestionsProps {
|
|
347
|
+
suggestions: string[];
|
|
348
|
+
onSelect: (suggestion: string) => void;
|
|
349
|
+
className?: string;
|
|
350
|
+
}
|
|
351
|
+
declare function Suggestions({ suggestions, onSelect, className }: SuggestionsProps): react_jsx_runtime.JSX.Element | null;
|
|
352
|
+
declare namespace Suggestions {
|
|
353
|
+
var displayName: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
interface WindowProps {
|
|
357
|
+
/**
|
|
358
|
+
* Whether the window is minimized to a small bar
|
|
359
|
+
*/
|
|
360
|
+
isMinimized?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the window is fullscreen (100vw x 100vh)
|
|
363
|
+
*/
|
|
364
|
+
isFullscreen?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Custom width for the window (e.g., "400px", "50vw")
|
|
367
|
+
* @default "400px"
|
|
368
|
+
*/
|
|
369
|
+
width?: string;
|
|
370
|
+
/**
|
|
371
|
+
* Custom height for the window (e.g., "600px", "80vh")
|
|
372
|
+
* @default "600px"
|
|
373
|
+
*/
|
|
374
|
+
height?: string;
|
|
375
|
+
/**
|
|
376
|
+
* Children elements to be rendered inside the window
|
|
377
|
+
*/
|
|
378
|
+
children: React__default.ReactNode;
|
|
379
|
+
/**
|
|
380
|
+
* Additional CSS class name for custom styling
|
|
381
|
+
*/
|
|
382
|
+
className?: string;
|
|
383
|
+
/**
|
|
384
|
+
* ARIA label for the window
|
|
385
|
+
*/
|
|
386
|
+
ariaLabel?: string;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Window Component
|
|
390
|
+
*
|
|
391
|
+
* Main container/window wrapper for the CopilotKit chat interface.
|
|
392
|
+
* This component holds the Header, Messages, Input, and Footer components.
|
|
393
|
+
*
|
|
394
|
+
* Features:
|
|
395
|
+
* - Default: 400px width x 600px height with rounded corners and shadow
|
|
396
|
+
* - Minimized: Collapsed to a small bar
|
|
397
|
+
* - Fullscreen: Takes full viewport (100vw x 100vh)
|
|
398
|
+
* - Smooth transitions between states
|
|
399
|
+
* - Customizable dimensions via width/height props
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```tsx
|
|
403
|
+
* // Default window
|
|
404
|
+
* <Window>
|
|
405
|
+
* <Header title="AI Assistant" />
|
|
406
|
+
* <Messages>...</Messages>
|
|
407
|
+
* <MessageInput />
|
|
408
|
+
* <Footer />
|
|
409
|
+
* </Window>
|
|
410
|
+
*
|
|
411
|
+
* // Minimized window
|
|
412
|
+
* <Window isMinimized>
|
|
413
|
+
* <Header title="AI Assistant" />
|
|
414
|
+
* </Window>
|
|
415
|
+
*
|
|
416
|
+
* // Fullscreen window
|
|
417
|
+
* <Window isFullscreen>
|
|
418
|
+
* <Header title="AI Assistant" />
|
|
419
|
+
* <Messages>...</Messages>
|
|
420
|
+
* <MessageInput />
|
|
421
|
+
* </Window>
|
|
422
|
+
*
|
|
423
|
+
* // Custom dimensions
|
|
424
|
+
* <Window width="500px" height="700px">
|
|
425
|
+
* ...
|
|
426
|
+
* </Window>
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
declare const Window: React__default.FC<WindowProps>;
|
|
430
|
+
|
|
431
|
+
export { type Action as A, type ButtonProps as B, type FooterProps as F, type HeaderProps as H, type InputProps as I, type Message as M, type ResponseProps as R, type SuggestionsProps as S, type UserMessageProps as U, type WindowProps as W, type ActionsLayout as a, type ActionsProps as b, type ActionVariant as c, Actions as d, type AgentStateProps as e, AgentState as f, type ButtonSize as g, type ButtonVariant as h, Button as i, Footer as j, Header as k, Input as l, type AssistantMessageProps as m, type FileAttachmentProps as n, type MessagesListProps as o, type MessagesProps as p, AssistantMessage as q, FileAttachment as r, Messages as s, MessagesList as t, MessagesListContainer as u, MessagesListContent as v, UserMessage as w, Response as x, Suggestions as y, Window as z };
|