@agentiffai/design 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +187 -0
- package/assets/layout/main-pane-section.png +0 -0
- package/assets/layout/nav-complete.png +0 -0
- package/assets/layout/nav-horizontal-section.png +0 -0
- package/assets/layout/nav-vertical-section.png +0 -0
- package/assets/layout/pane-section-dropdowns.png +0 -0
- package/assets/layout/pane-section-header.png +0 -0
- package/dist/Window-B6e_UfLV.d.ts +429 -0
- package/dist/Window-CgGFIYHS.d.cts +429 -0
- package/dist/chunk-CNVJ5UF2.js +2069 -0
- package/dist/chunk-CNVJ5UF2.js.map +1 -0
- package/dist/chunk-CVHHTWDQ.cjs +72 -0
- package/dist/chunk-CVHHTWDQ.cjs.map +1 -0
- package/dist/chunk-H4VHCHCP.cjs +1268 -0
- package/dist/chunk-H4VHCHCP.cjs.map +1 -0
- package/dist/chunk-JQ6Q7MDQ.js +67 -0
- package/dist/chunk-JQ6Q7MDQ.js.map +1 -0
- package/dist/chunk-KNSPBTTJ.cjs +2158 -0
- package/dist/chunk-KNSPBTTJ.cjs.map +1 -0
- package/dist/chunk-MNXQDDWP.js +2143 -0
- package/dist/chunk-MNXQDDWP.js.map +1 -0
- package/dist/chunk-P4Q3MHIY.cjs +2093 -0
- package/dist/chunk-P4Q3MHIY.cjs.map +1 -0
- package/dist/chunk-PAOXD7DF.js +1253 -0
- package/dist/chunk-PAOXD7DF.js.map +1 -0
- package/dist/copilotkit/index.cjs +611 -0
- package/dist/copilotkit/index.cjs.map +1 -0
- package/dist/copilotkit/index.d.cts +162 -0
- package/dist/copilotkit/index.d.ts +162 -0
- package/dist/copilotkit/index.js +538 -0
- package/dist/copilotkit/index.js.map +1 -0
- package/dist/icons/index.cjs +48 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +375 -0
- package/dist/icons/index.d.ts +375 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +536 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d-DYU1eVeb.d.cts +252 -0
- package/dist/index.d-DYU1eVeb.d.ts +252 -0
- package/dist/index.d.cts +185 -0
- package/dist/index.d.ts +185 -0
- package/dist/index.js +358 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.cjs +48 -0
- package/dist/layout/index.cjs.map +1 -0
- package/dist/layout/index.d.cts +206 -0
- package/dist/layout/index.d.ts +206 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/theme/index.cjs +24 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +95 -0
- package/dist/theme/index.d.ts +95 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +148 -0
- package/public/assets/bg-set/brand-logos/Google.svg +1 -0
- package/public/assets/bg-set/brand-logos/Google2.svg +1 -0
- package/public/assets/bg-set/brand-logos/Microsoft.svg +1 -0
- package/public/assets/bg-set/brand-logos/Microsoft2.svg +1 -0
- package/public/assets/bg-set/brand-logos/Slack.svg +1 -0
- package/public/assets/bg-set/brand-logos/Slack2.svg +1 -0
- package/public/assets/bg-set/brand-logos/YouTube.svg +1 -0
- package/public/assets/bg-set/brand-logos/YouTube2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=lg, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=md, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=sm, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=xl, Type=Waves Rays2.svg +1 -0
- package/public/assets/bg-set/pattern/Size=xs, Type=Waves Rays2.svg +1 -0
- package/public/assets/icon-set/Icon-add-circle-fill.svg +1 -0
- package/public/assets/icon-set/Icon-calendar-fill.svg +1 -0
- package/public/assets/icon-set/Icon-chat-1-fill.svg +1 -0
- package/public/assets/icon-set/Icon-download-2-fill.svg +1 -0
- package/public/assets/icon-set/Icon-home-fill.svg +1 -0
- package/public/assets/icon-set/Icon-mic-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-3-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-fill.svg +1 -0
- package/public/assets/icon-set/Icon-settings-line.svg +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2024-10-10
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of @agentiffai/design
|
|
12
|
+
- Layout components (Layout, ServiceIcon, NavHorizontal, PaneMenus, etc.)
|
|
13
|
+
- Icon components (Gmail, Slack, LinkedIn, YouTube, etc.)
|
|
14
|
+
- CopilotKit integration components (CustomCopilotSidebar)
|
|
15
|
+
- Theme system with light and dark themes
|
|
16
|
+
- Comprehensive icon set (2500+ SVG icons)
|
|
17
|
+
- Brand logos for popular services
|
|
18
|
+
- Full TypeScript support
|
|
19
|
+
- Tree-shakeable ESM and CJS builds
|
|
20
|
+
- React ARIA integration for accessibility
|
|
21
|
+
- Styled-components theming support
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
- **Layout System**: Complete application layout with vertical nav, horizontal nav, and main content areas
|
|
25
|
+
- **Service Icons**: 10+ branded service icons with active states
|
|
26
|
+
- **Action Buttons**: Calendar, settings, and chat action buttons
|
|
27
|
+
- **Icon Library**: Extensive icon set from the design system
|
|
28
|
+
- **CopilotKit Integration**: Custom sidebar and chat components
|
|
29
|
+
- **Theming**: Light and dark themes with full customization
|
|
30
|
+
- **Accessibility**: Built with React ARIA for keyboard navigation and screen readers
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
- Comprehensive Storybook documentation
|
|
34
|
+
- TypeScript type definitions
|
|
35
|
+
- Component usage examples
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Agentiffai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# @agentiffai/design
|
|
2
|
+
|
|
3
|
+
A comprehensive design system for CopilotKit components built with React, TypeScript, and styled-components. Features modern UI components optimized for AI-powered applications with full tree-shaking support.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@agentiffai/design)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 🎨 **30+ Components**: Comprehensive set of UI components for AI applications
|
|
11
|
+
- 🌲 **Tree-Shakeable**: Only bundle what you use
|
|
12
|
+
- 📦 **TypeScript**: Full type safety and autocomplete
|
|
13
|
+
- 🎭 **Theming**: Light and dark themes with custom styling
|
|
14
|
+
- ♿ **Accessible**: Built with React ARIA for accessibility
|
|
15
|
+
- 📱 **Responsive**: Mobile-first design
|
|
16
|
+
- 🚀 **Modern**: ES2022+ with ESM and CJS support
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @agentiffai/design
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Peer Dependencies
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install react react-dom styled-components @copilotkit/react-core @copilotkit/react-ui
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import React from 'react';
|
|
34
|
+
import { ThemeProvider } from 'styled-components';
|
|
35
|
+
import { darkTheme, GlobalStyle } from '@agentiffai/design/theme';
|
|
36
|
+
import { Button, Input, Messages } from '@agentiffai/design/copilotkit';
|
|
37
|
+
|
|
38
|
+
function App() {
|
|
39
|
+
return (
|
|
40
|
+
<ThemeProvider theme={darkTheme}>
|
|
41
|
+
<GlobalStyle />
|
|
42
|
+
<Messages />
|
|
43
|
+
<Input placeholder="Type a message..." />
|
|
44
|
+
<Button>Send</Button>
|
|
45
|
+
</ThemeProvider>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default App;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Component Categories
|
|
53
|
+
|
|
54
|
+
- **Core Components**: `AssistantThinking`, `ChatInput`, `NotificationCard`, `SideMenu`, `UserMessage`
|
|
55
|
+
- **CopilotKit Components**: `Actions`, `AgentState`, `Button`, `Input`, `Messages`, `Window`, etc.
|
|
56
|
+
- **Layout Components**: `Layout`, `NavHorizontal`, `NavVertical`, `Icon`, `PaneMenus`
|
|
57
|
+
- **Brand Icons**: `FacebookIcon`, `LinkedInIcon`, `InstagramIcon`, `XIcon`, etc.
|
|
58
|
+
- **Theme**: `darkTheme`, `lightTheme`, `GlobalStyle`, `tokens`
|
|
59
|
+
|
|
60
|
+
See [full documentation](./NPM_PUBLISHING.md) for detailed usage examples.
|
|
61
|
+
|
|
62
|
+
## Tree-Shaking
|
|
63
|
+
|
|
64
|
+
Import only what you need to minimize bundle size:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// ✅ Category-specific import (recommended)
|
|
68
|
+
import { Button, Input } from '@agentiffai/design/copilotkit';
|
|
69
|
+
import { LinkedInIcon } from '@agentiffai/design/icons';
|
|
70
|
+
import { darkTheme } from '@agentiffai/design/theme';
|
|
71
|
+
|
|
72
|
+
// ✅ Main entry point also works
|
|
73
|
+
import { Button } from '@agentiffai/design';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Technology Stack
|
|
77
|
+
|
|
78
|
+
- TypeScript
|
|
79
|
+
- React
|
|
80
|
+
- Styled-components
|
|
81
|
+
- React ARIA
|
|
82
|
+
- Playwright (testing)
|
|
83
|
+
|
|
84
|
+
## Getting Started
|
|
85
|
+
|
|
86
|
+
This project is scaffolded for optimal AI-assisted development with Claude Code.
|
|
87
|
+
|
|
88
|
+
### Prerequisites
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
- Node.js (v18+)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Launch Claude Code
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
./scripts/launch.sh
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
This script will:
|
|
102
|
+
- Check for required dependencies
|
|
103
|
+
- Start any necessary services
|
|
104
|
+
- Open Claude Code with optimal context
|
|
105
|
+
|
|
106
|
+
### Development Workflow
|
|
107
|
+
|
|
108
|
+
1. Check current tasks: `/tech tasks` or check Archon
|
|
109
|
+
2. Select a task to work on
|
|
110
|
+
3. Use `/prime-feature <name>` to load feature context
|
|
111
|
+
4. Develop and test
|
|
112
|
+
5. Commit with `/lint-and-commit "message"`
|
|
113
|
+
|
|
114
|
+
6. Archive feature spec with `/spec-compact`
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Project Structure
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
agentiffai-design/
|
|
121
|
+
├── .claude/ # Claude Code configuration
|
|
122
|
+
│ ├── commands/ # Custom slash commands
|
|
123
|
+
│ ├── agents/ # Sub-agent definitions
|
|
124
|
+
│ ├── hooks.json # Workflow automation hooks
|
|
125
|
+
│ └── docs/ # Project documentation
|
|
126
|
+
├── .specify/ # SpecKit constitution
|
|
127
|
+
├── specs/ # Feature specifications
|
|
128
|
+
├── scripts/ # Utility scripts
|
|
129
|
+
└── src/ # Source code
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## CopilotKit Integration
|
|
133
|
+
|
|
134
|
+
This design system includes a complete integration with CopilotKit's CopilotSidebar:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { CopilotKit } from "@copilotkit/react-core";
|
|
138
|
+
import { IntegratedSidebar } from "@agentiffai/design/copilotkit";
|
|
139
|
+
|
|
140
|
+
function App() {
|
|
141
|
+
return (
|
|
142
|
+
<CopilotKit runtimeUrl="/api/copilotkit">
|
|
143
|
+
<IntegratedSidebar>
|
|
144
|
+
<YourApp />
|
|
145
|
+
</IntegratedSidebar>
|
|
146
|
+
</CopilotKit>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Documentation:**
|
|
152
|
+
- 📖 [Quick Start Guide](./COPILOTKIT_QUICKSTART.md) - 5-minute setup
|
|
153
|
+
- 📚 [Integration Guide](./COPILOTKIT_INTEGRATION_GUIDE.md) - Complete technical documentation
|
|
154
|
+
- 🏗️ [Architecture](./COPILOTKIT_ARCHITECTURE.md) - Visual diagrams and data flow
|
|
155
|
+
- 📝 [Summary](./COPILOTKIT_INTEGRATION_SUMMARY.md) - Overview and key features
|
|
156
|
+
|
|
157
|
+
**Features:**
|
|
158
|
+
- ✅ Custom-designed AI chat sidebar
|
|
159
|
+
- ✅ Full React ARIA accessibility
|
|
160
|
+
- ✅ Theme support (light/dark)
|
|
161
|
+
- ✅ Loading states with AssistantThinking component
|
|
162
|
+
- ✅ TypeScript support
|
|
163
|
+
- ✅ Storybook examples
|
|
164
|
+
|
|
165
|
+
## Documentation
|
|
166
|
+
|
|
167
|
+
See `.claude/docs/` for detailed documentation on:
|
|
168
|
+
- Architecture patterns
|
|
169
|
+
- Development guidelines
|
|
170
|
+
- Testing strategies
|
|
171
|
+
- Deployment procedures
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Archon Integration
|
|
175
|
+
|
|
176
|
+
This project integrates with Archon for:
|
|
177
|
+
- Task management
|
|
178
|
+
- Knowledge base (RAG)
|
|
179
|
+
- Code examples
|
|
180
|
+
- Project documentation
|
|
181
|
+
|
|
182
|
+
Access Archon at: http://localhost:8181
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,429 @@
|
|
|
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 { A as AriaButtonProps$1 } from './index.d-DYU1eVeb.js';
|
|
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
|
+
interface ActionsProps {
|
|
21
|
+
actions: Action[];
|
|
22
|
+
layout?: ActionsLayout;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function Actions({ actions, layout, className }: ActionsProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare namespace Actions {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface AgentStateProps {
|
|
31
|
+
/** Current agent state */
|
|
32
|
+
state: 'idle' | 'thinking' | 'responding' | 'error';
|
|
33
|
+
/** Optional message to display */
|
|
34
|
+
message?: string;
|
|
35
|
+
/** Optional progress percentage (0-100) */
|
|
36
|
+
progress?: number;
|
|
37
|
+
/** Additional CSS class name */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* AgentState component for displaying agent status
|
|
42
|
+
* Styled to match AssistantThinking and Response components with dark theme
|
|
43
|
+
*/
|
|
44
|
+
declare const AgentState: ({ state, message, progress, className }: AgentStateProps) => react_jsx_runtime.JSX.Element | null;
|
|
45
|
+
|
|
46
|
+
type ButtonVariant = 'primary' | 'secondary' | 'icon';
|
|
47
|
+
type ButtonSize = 'small' | 'medium' | 'large';
|
|
48
|
+
interface ButtonProps extends AriaButtonProps {
|
|
49
|
+
variant?: ButtonVariant;
|
|
50
|
+
size?: ButtonSize;
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
className?: string;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
isLoading?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function Button({ variant, size, children, className, disabled, isLoading, ...ariaProps }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare namespace Button {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface FooterProps {
|
|
62
|
+
/**
|
|
63
|
+
* Branding text to display (e.g., "Powered by CopilotKit")
|
|
64
|
+
*/
|
|
65
|
+
branding?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Optional status text (e.g., "Connected", "Typing...", "3 tokens remaining")
|
|
68
|
+
*/
|
|
69
|
+
status?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional link URL for the branding text
|
|
72
|
+
*/
|
|
73
|
+
brandingUrl?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Callback when branding link is clicked
|
|
76
|
+
*/
|
|
77
|
+
onBrandingClick?: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Additional CSS class name for custom styling
|
|
80
|
+
*/
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Footer Component
|
|
85
|
+
*
|
|
86
|
+
* A chat footer component that displays branding, status information, and optional links.
|
|
87
|
+
* Typically used at the bottom of a chat interface to show provider information or connection status.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* <Footer
|
|
92
|
+
* branding="Powered by CopilotKit"
|
|
93
|
+
* status="Connected"
|
|
94
|
+
* brandingUrl="https://copilotkit.ai"
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare const Footer: React__default.FC<FooterProps>;
|
|
99
|
+
|
|
100
|
+
interface HeaderProps {
|
|
101
|
+
/**
|
|
102
|
+
* The main title text displayed in the header
|
|
103
|
+
*/
|
|
104
|
+
title: string;
|
|
105
|
+
/**
|
|
106
|
+
* Optional subtitle text displayed below the title
|
|
107
|
+
*/
|
|
108
|
+
subtitle?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Callback function triggered when the close button is clicked
|
|
111
|
+
*/
|
|
112
|
+
onClose?: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback function triggered when the minimize button is clicked
|
|
115
|
+
*/
|
|
116
|
+
onMinimize?: () => void;
|
|
117
|
+
/**
|
|
118
|
+
* Additional CSS class name for custom styling
|
|
119
|
+
*/
|
|
120
|
+
className?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Header Component
|
|
124
|
+
*
|
|
125
|
+
* A chat header component that displays a title, optional subtitle, and action buttons.
|
|
126
|
+
* Built with React ARIA for accessibility and Styled Components for theming.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* <Header
|
|
131
|
+
* title="AI Assistant"
|
|
132
|
+
* subtitle="How can I help you today?"
|
|
133
|
+
* onClose={() => console.log('Close clicked')}
|
|
134
|
+
* onMinimize={() => console.log('Minimize clicked')}
|
|
135
|
+
* />
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare const Header: React__default.FC<HeaderProps>;
|
|
139
|
+
|
|
140
|
+
interface InputProps extends Omit<AriaTextFieldProps, 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp'> {
|
|
141
|
+
/** Current message value */
|
|
142
|
+
value?: string;
|
|
143
|
+
/** Callback when message value changes */
|
|
144
|
+
onChange?: (value: string) => void;
|
|
145
|
+
/** Callback when message is submitted */
|
|
146
|
+
onSubmit?: (message: string) => void;
|
|
147
|
+
/** Placeholder text */
|
|
148
|
+
placeholder?: string;
|
|
149
|
+
/** Whether the input is disabled */
|
|
150
|
+
isDisabled?: boolean;
|
|
151
|
+
/** Whether the input is read-only */
|
|
152
|
+
isReadOnly?: boolean;
|
|
153
|
+
/** Maximum number of rows before scrolling */
|
|
154
|
+
maxRows?: number;
|
|
155
|
+
/** Whether to auto-focus the input */
|
|
156
|
+
autoFocus?: boolean;
|
|
157
|
+
/** Additional CSS class name */
|
|
158
|
+
className?: string;
|
|
159
|
+
/** ARIA label for the input */
|
|
160
|
+
'aria-label'?: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Input component for chat interfaces
|
|
164
|
+
* Features:
|
|
165
|
+
* - Multi-line text support
|
|
166
|
+
* - Submit on Enter, Shift+Enter for new line
|
|
167
|
+
* - React ARIA for accessibility
|
|
168
|
+
* - Auto-growing textarea
|
|
169
|
+
* - Integrated send button
|
|
170
|
+
*/
|
|
171
|
+
declare const Input: React__default.FC<InputProps>;
|
|
172
|
+
|
|
173
|
+
interface FileAttachmentProps extends Omit<AriaButtonProps$1, 'children'> {
|
|
174
|
+
/** File name/title */
|
|
175
|
+
title: string;
|
|
176
|
+
/** File subtitle/category (e.g., "Downloads", "Documents") */
|
|
177
|
+
subtitle?: string;
|
|
178
|
+
/** File size in human-readable format (e.g., "500 KB", "2.5 MB") */
|
|
179
|
+
size?: string;
|
|
180
|
+
/** File icon emoji or Unicode character */
|
|
181
|
+
icon?: string;
|
|
182
|
+
/** Click handler for file interaction */
|
|
183
|
+
onClick?: () => void;
|
|
184
|
+
/** Custom className for styling */
|
|
185
|
+
className?: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* FileAttachment component displays file information in assistant messages
|
|
189
|
+
*
|
|
190
|
+
* Features:
|
|
191
|
+
* - File icon display (emoji or Unicode)
|
|
192
|
+
* - File metadata (title, subtitle, size)
|
|
193
|
+
* - Accessible keyboard navigation via React ARIA
|
|
194
|
+
* - Clean, minimal card-based design
|
|
195
|
+
* - WCAG 2.1 AA compliant
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <FileAttachment
|
|
200
|
+
* title="Example File"
|
|
201
|
+
* subtitle="Downloads"
|
|
202
|
+
* size="500 KB"
|
|
203
|
+
* icon="📄"
|
|
204
|
+
* onPress={() => console.log('File clicked')}
|
|
205
|
+
* />
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
declare const FileAttachment: React__default.FC<FileAttachmentProps>;
|
|
209
|
+
|
|
210
|
+
interface AssistantMessageProps {
|
|
211
|
+
/** Message content to display */
|
|
212
|
+
content?: string;
|
|
213
|
+
/** Avatar image URL */
|
|
214
|
+
avatarUrl?: string;
|
|
215
|
+
/** Avatar initials when no image is provided */
|
|
216
|
+
avatarInitials?: string;
|
|
217
|
+
/** Whether to show loading state */
|
|
218
|
+
isLoading?: boolean;
|
|
219
|
+
/** Custom className for styling */
|
|
220
|
+
className?: string;
|
|
221
|
+
/** Support for markdown rendering (future enhancement) */
|
|
222
|
+
enableMarkdown?: boolean;
|
|
223
|
+
/** File attachments to display below the message */
|
|
224
|
+
attachments?: FileAttachmentProps[];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* AssistantMessage component displays AI assistant messages with avatar
|
|
228
|
+
*
|
|
229
|
+
* Features:
|
|
230
|
+
* - Avatar with image or initials fallback
|
|
231
|
+
* - Loading state with animated dots
|
|
232
|
+
* - Markdown support (optional)
|
|
233
|
+
* - Clean, modern design
|
|
234
|
+
*/
|
|
235
|
+
declare const AssistantMessage: React__default.FC<AssistantMessageProps>;
|
|
236
|
+
|
|
237
|
+
interface MessagesProps {
|
|
238
|
+
/**
|
|
239
|
+
* Children elements to be rendered inside the messages container
|
|
240
|
+
*/
|
|
241
|
+
children?: React__default.ReactNode;
|
|
242
|
+
/**
|
|
243
|
+
* Additional CSS class name
|
|
244
|
+
*/
|
|
245
|
+
className?: string;
|
|
246
|
+
/**
|
|
247
|
+
* ARIA label for accessibility
|
|
248
|
+
*/
|
|
249
|
+
ariaLabel?: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Messages component - Container for message list
|
|
253
|
+
*
|
|
254
|
+
* This component serves as a wrapper for the messages area,
|
|
255
|
+
* providing consistent spacing and layout for chat messages.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* <Messages ariaLabel="Chat messages">
|
|
260
|
+
* <MessagesList messages={messages} />
|
|
261
|
+
* </Messages>
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
declare const Messages: React__default.FC<MessagesProps>;
|
|
265
|
+
|
|
266
|
+
interface Message {
|
|
267
|
+
id: string;
|
|
268
|
+
content: ReactNode;
|
|
269
|
+
role: 'user' | 'assistant' | 'system';
|
|
270
|
+
timestamp?: Date;
|
|
271
|
+
}
|
|
272
|
+
interface MessagesListProps {
|
|
273
|
+
/** Array of messages to display */
|
|
274
|
+
messages: Message[];
|
|
275
|
+
/** Whether to automatically scroll to the bottom when new messages arrive */
|
|
276
|
+
autoScroll?: boolean;
|
|
277
|
+
/** Custom class name for the container */
|
|
278
|
+
className?: string;
|
|
279
|
+
/** Custom render function for individual messages */
|
|
280
|
+
renderMessage?: (message: Message) => ReactNode;
|
|
281
|
+
/** Callback when scroll reaches the top (for loading more messages) */
|
|
282
|
+
onScrollTop?: () => void;
|
|
283
|
+
/** Maximum height of the messages list */
|
|
284
|
+
maxHeight?: string;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* MessagesList Component
|
|
288
|
+
*
|
|
289
|
+
* A scrollable message list component with auto-scroll functionality.
|
|
290
|
+
* Designed for chat interfaces where messages need to be displayed
|
|
291
|
+
* in a scrollable container with automatic scrolling to the latest message.
|
|
292
|
+
*
|
|
293
|
+
* Features:
|
|
294
|
+
* - Auto-scroll to bottom on new messages
|
|
295
|
+
* - Overflow handling with custom scrollbar
|
|
296
|
+
* - Flexible message rendering
|
|
297
|
+
* - Scroll event handling for pagination
|
|
298
|
+
*/
|
|
299
|
+
declare const MessagesList: ({ messages, autoScroll, className, renderMessage, onScrollTop, maxHeight, }: MessagesListProps) => react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
declare const MessagesListContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
302
|
+
$maxHeight: string;
|
|
303
|
+
}>> & string;
|
|
304
|
+
declare const MessagesListContent: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
305
|
+
|
|
306
|
+
interface UserMessageProps {
|
|
307
|
+
/** The message content to display */
|
|
308
|
+
content: string;
|
|
309
|
+
/** Optional timestamp for the message */
|
|
310
|
+
timestamp?: string;
|
|
311
|
+
/** Optional CSS class name */
|
|
312
|
+
className?: string;
|
|
313
|
+
/** Optional avatar URL */
|
|
314
|
+
avatarUrl?: string;
|
|
315
|
+
/** Optional username */
|
|
316
|
+
username?: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* UserMessage component displays a user's message in a chat interface.
|
|
320
|
+
* Styled with right alignment and distinct styling from assistant messages.
|
|
321
|
+
*/
|
|
322
|
+
declare const UserMessage: ({ content, timestamp, className, avatarUrl, username, }: UserMessageProps) => react_jsx_runtime.JSX.Element;
|
|
323
|
+
|
|
324
|
+
interface ResponseProps {
|
|
325
|
+
/** Loading state - shows animated dots */
|
|
326
|
+
isLoading?: boolean;
|
|
327
|
+
/** Typing state - shows typing indicator */
|
|
328
|
+
isTyping?: boolean;
|
|
329
|
+
/** Streaming state - shows text being typed */
|
|
330
|
+
isStreaming?: boolean;
|
|
331
|
+
/** Content to display when streaming */
|
|
332
|
+
streamingContent?: string;
|
|
333
|
+
/** Message to display with loading/typing state */
|
|
334
|
+
message?: string;
|
|
335
|
+
/** Additional CSS class name */
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Response component for displaying loading and streaming states
|
|
340
|
+
* Shows animated loading dots, typing indicators, and streaming text
|
|
341
|
+
*/
|
|
342
|
+
declare const Response: ({ isLoading, isTyping, isStreaming, streamingContent, message, className, }: ResponseProps) => react_jsx_runtime.JSX.Element | null;
|
|
343
|
+
|
|
344
|
+
interface SuggestionsProps {
|
|
345
|
+
suggestions: string[];
|
|
346
|
+
onSelect: (suggestion: string) => void;
|
|
347
|
+
className?: string;
|
|
348
|
+
}
|
|
349
|
+
declare function Suggestions({ suggestions, onSelect, className }: SuggestionsProps): react_jsx_runtime.JSX.Element | null;
|
|
350
|
+
declare namespace Suggestions {
|
|
351
|
+
var displayName: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface WindowProps {
|
|
355
|
+
/**
|
|
356
|
+
* Whether the window is minimized to a small bar
|
|
357
|
+
*/
|
|
358
|
+
isMinimized?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Whether the window is fullscreen (100vw x 100vh)
|
|
361
|
+
*/
|
|
362
|
+
isFullscreen?: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Custom width for the window (e.g., "400px", "50vw")
|
|
365
|
+
* @default "400px"
|
|
366
|
+
*/
|
|
367
|
+
width?: string;
|
|
368
|
+
/**
|
|
369
|
+
* Custom height for the window (e.g., "600px", "80vh")
|
|
370
|
+
* @default "600px"
|
|
371
|
+
*/
|
|
372
|
+
height?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Children elements to be rendered inside the window
|
|
375
|
+
*/
|
|
376
|
+
children: React__default.ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Additional CSS class name for custom styling
|
|
379
|
+
*/
|
|
380
|
+
className?: string;
|
|
381
|
+
/**
|
|
382
|
+
* ARIA label for the window
|
|
383
|
+
*/
|
|
384
|
+
ariaLabel?: string;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Window Component
|
|
388
|
+
*
|
|
389
|
+
* Main container/window wrapper for the CopilotKit chat interface.
|
|
390
|
+
* This component holds the Header, Messages, Input, and Footer components.
|
|
391
|
+
*
|
|
392
|
+
* Features:
|
|
393
|
+
* - Default: 400px width x 600px height with rounded corners and shadow
|
|
394
|
+
* - Minimized: Collapsed to a small bar
|
|
395
|
+
* - Fullscreen: Takes full viewport (100vw x 100vh)
|
|
396
|
+
* - Smooth transitions between states
|
|
397
|
+
* - Customizable dimensions via width/height props
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```tsx
|
|
401
|
+
* // Default window
|
|
402
|
+
* <Window>
|
|
403
|
+
* <Header title="AI Assistant" />
|
|
404
|
+
* <Messages>...</Messages>
|
|
405
|
+
* <MessageInput />
|
|
406
|
+
* <Footer />
|
|
407
|
+
* </Window>
|
|
408
|
+
*
|
|
409
|
+
* // Minimized window
|
|
410
|
+
* <Window isMinimized>
|
|
411
|
+
* <Header title="AI Assistant" />
|
|
412
|
+
* </Window>
|
|
413
|
+
*
|
|
414
|
+
* // Fullscreen window
|
|
415
|
+
* <Window isFullscreen>
|
|
416
|
+
* <Header title="AI Assistant" />
|
|
417
|
+
* <Messages>...</Messages>
|
|
418
|
+
* <MessageInput />
|
|
419
|
+
* </Window>
|
|
420
|
+
*
|
|
421
|
+
* // Custom dimensions
|
|
422
|
+
* <Window width="500px" height="700px">
|
|
423
|
+
* ...
|
|
424
|
+
* </Window>
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
declare const Window: React__default.FC<WindowProps>;
|
|
428
|
+
|
|
429
|
+
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 };
|