@app-studio/web 0.9.24 → 0.9.26
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/components/Background/Background/Background.props.d.ts +49 -0
- package/dist/components/Background/Background/Background.style.d.ts +9 -0
- package/dist/components/Background/Background/Background.type.d.ts +1 -1
- package/dist/components/Background/Background/Background.view.d.ts +2 -1
- package/dist/components/Background/Background.d.ts +1 -0
- package/dist/components/Background/index.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar/ProgressBar.props.d.ts +35 -0
- package/dist/components/ProgressBar/ProgressBar/ProgressBar.view.d.ts +4 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/components/StatusIndicator/StatusIndicator/StatusIndicator.props.d.ts +12 -0
- package/dist/components/StatusIndicator/StatusIndicator/StatusIndicator.style.d.ts +10 -0
- package/dist/components/StatusIndicator/StatusIndicator/StatusIndicator.type.d.ts +7 -0
- package/dist/components/StatusIndicator/StatusIndicator/StatusIndicator.view.d.ts +3 -0
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +3 -0
- package/dist/{hooks → components/adk}/useAdk.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/pages/progressBar.page.d.ts +3 -0
- package/dist/pages/statusIndicator.page.d.ts +3 -0
- package/dist/web.cjs.development.js +255 -60
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +254 -61
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +255 -60
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/docs/adk-components.md +40 -37
- package/docs/adk-quick-start.md +11 -37
- package/package.json +1 -1
- package/docs/adk-customization-guide.md +0 -204
- package/docs/adk-customization-summary.md +0 -157
- /package/dist/{hooks → components/AudioInput}/useAudioRecording.d.ts +0 -0
package/docs/adk-components.md
CHANGED
|
@@ -4,19 +4,20 @@ This document provides an overview of the React components created for compatibi
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
The ADK Agent Components are a collection of React components designed to work seamlessly with ADK agents
|
|
7
|
+
The ADK Agent Components are a collection of React components designed to work seamlessly with ADK agents. These components are self-contained, handling their own state and API communications, providing a complete interface for agent interaction, session management, and more.
|
|
8
8
|
|
|
9
9
|
## Components
|
|
10
10
|
|
|
11
11
|
### 1. AgentChat Component
|
|
12
12
|
|
|
13
|
-
**Location**: `src/components/AgentChat/`
|
|
13
|
+
**Location**: `src/components/adk/AgentChat/`
|
|
14
14
|
|
|
15
15
|
A comprehensive chat interface for interacting with ADK agents.
|
|
16
16
|
|
|
17
17
|
#### Key Features:
|
|
18
18
|
- ✅ Real-time messaging via Server-Sent Events (SSE)
|
|
19
19
|
- ✅ File upload support (images, videos, audio, documents)
|
|
20
|
+
- ✅ Audio recording with live waveform visualization
|
|
20
21
|
- ✅ Function call visualization and execution
|
|
21
22
|
- ✅ Code execution and result display
|
|
22
23
|
- ✅ Agent thought process visualization
|
|
@@ -32,7 +33,9 @@ import { AgentChat } from '@app-studio/web';
|
|
|
32
33
|
<AgentChat
|
|
33
34
|
appName="my-agent"
|
|
34
35
|
userId="user123"
|
|
36
|
+
apiBaseUrl="https://your-adk-api.com"
|
|
35
37
|
enableFileUpload={true}
|
|
38
|
+
enableAudioRecording={true}
|
|
36
39
|
enableStreaming={true}
|
|
37
40
|
enableThoughts={true}
|
|
38
41
|
onSessionCreate={(session) => console.log('Session created:', session)}
|
|
@@ -41,18 +44,19 @@ import { AgentChat } from '@app-studio/web';
|
|
|
41
44
|
```
|
|
42
45
|
|
|
43
46
|
#### Props:
|
|
44
|
-
- `appName` (required): Name of the ADK agent application
|
|
45
|
-
- `userId` (required): Unique identifier for the user
|
|
46
|
-
- `sessionId`: Existing session ID to resume
|
|
47
|
-
- `apiBaseUrl`: Base URL for ADK API endpoints
|
|
48
|
-
- `enableFileUpload`: Enable file attachment functionality
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
47
|
+
- `appName` (required): Name of the ADK agent application.
|
|
48
|
+
- `userId` (required): Unique identifier for the user.
|
|
49
|
+
- `sessionId`: Existing session ID to resume.
|
|
50
|
+
- `apiBaseUrl`: Base URL for ADK API endpoints.
|
|
51
|
+
- `enableFileUpload`: Enable file attachment functionality.
|
|
52
|
+
- `enableAudioRecording`: Enable audio recording from the microphone.
|
|
53
|
+
- `enableStreaming`: Enable real-time streaming responses.
|
|
54
|
+
- `enableThoughts`: Show agent thought processes.
|
|
55
|
+
- `views`: Custom styling options.
|
|
52
56
|
|
|
53
57
|
### 2. AgentSession Component
|
|
54
58
|
|
|
55
|
-
**Location**: `src/components/AgentSession/`
|
|
59
|
+
**Location**: `src/components/adk/AgentSession/`
|
|
56
60
|
|
|
57
61
|
A comprehensive session management component for ADK agents.
|
|
58
62
|
|
|
@@ -73,6 +77,7 @@ import { AgentSession } from '@app-studio/web';
|
|
|
73
77
|
<AgentSession
|
|
74
78
|
appName="my-agent"
|
|
75
79
|
userId="user123"
|
|
80
|
+
apiBaseUrl="https://your-adk-api.com"
|
|
76
81
|
showSessionHistory={true}
|
|
77
82
|
enableSessionImport={true}
|
|
78
83
|
enableSessionExport={true}
|
|
@@ -82,14 +87,15 @@ import { AgentSession } from '@app-studio/web';
|
|
|
82
87
|
```
|
|
83
88
|
|
|
84
89
|
#### Props:
|
|
85
|
-
- `appName` (required): Name of the ADK agent application
|
|
86
|
-
- `userId` (required): Unique identifier for the user
|
|
87
|
-
- `
|
|
88
|
-
- `
|
|
89
|
-
- `
|
|
90
|
-
- `
|
|
91
|
-
- `
|
|
92
|
-
- `
|
|
90
|
+
- `appName` (required): Name of the ADK agent application.
|
|
91
|
+
- `userId` (required): Unique identifier for the user.
|
|
92
|
+
- `apiBaseUrl`: Base URL for ADK API endpoints.
|
|
93
|
+
- `showSessionHistory`: Show session history list.
|
|
94
|
+
- `enableSessionImport`: Enable session import from JSON.
|
|
95
|
+
- `enableSessionExport`: Enable session export to JSON.
|
|
96
|
+
- `enableSessionSearch`: Enable search functionality.
|
|
97
|
+
- `maxSessions`: Maximum number of sessions to display.
|
|
98
|
+
- `views`: Custom styling options.
|
|
93
99
|
|
|
94
100
|
## Architecture
|
|
95
101
|
|
|
@@ -112,7 +118,7 @@ ComponentName/
|
|
|
112
118
|
|
|
113
119
|
### ADK Integration
|
|
114
120
|
|
|
115
|
-
The components are
|
|
121
|
+
The components are self-contained and integrate directly with an ADK backend using `fetch`. You can specify the backend URL via the `apiBaseUrl` prop.
|
|
116
122
|
|
|
117
123
|
#### Required Backend Endpoints:
|
|
118
124
|
- `POST /sessions` - Create new agent session
|
|
@@ -138,6 +144,17 @@ interface AgentRunRequest {
|
|
|
138
144
|
}
|
|
139
145
|
```
|
|
140
146
|
|
|
147
|
+
### Direct API Interaction (`useAdk` Hook)
|
|
148
|
+
For developers who need to interact with the ADK API without using the pre-built UI components, a `useAdk` hook is available. This hook provides functions for all core ADK operations like creating sessions, running agents, and managing responses.
|
|
149
|
+
|
|
150
|
+
**Location**: `src/components/adk/useAdk.ts`
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { useAdk } from '@app-studio/web';
|
|
154
|
+
|
|
155
|
+
const { createSession, runAgent, sessions, isLoadingSessions } = useAdk();
|
|
156
|
+
```
|
|
157
|
+
|
|
141
158
|
### Design System Compliance
|
|
142
159
|
|
|
143
160
|
All components follow the app-studio design system:
|
|
@@ -204,6 +221,7 @@ const MyAgentApp = () => {
|
|
|
204
221
|
<AgentSession
|
|
205
222
|
appName="my-agent"
|
|
206
223
|
userId="user123"
|
|
224
|
+
apiBaseUrl="https://api.example.com"
|
|
207
225
|
/>
|
|
208
226
|
</View>
|
|
209
227
|
|
|
@@ -212,6 +230,7 @@ const MyAgentApp = () => {
|
|
|
212
230
|
<AgentChat
|
|
213
231
|
appName="my-agent"
|
|
214
232
|
userId="user123"
|
|
233
|
+
apiBaseUrl="https://api.example.com"
|
|
215
234
|
/>
|
|
216
235
|
</View>
|
|
217
236
|
</Horizontal>
|
|
@@ -277,22 +296,6 @@ All planned components have been successfully implemented:
|
|
|
277
296
|
- **Error handling and retry logic**
|
|
278
297
|
- **Connection status monitoring**
|
|
279
298
|
|
|
280
|
-
## Service Integration
|
|
281
|
-
|
|
282
|
-
The ADK components include a comprehensive service layer:
|
|
283
|
-
|
|
284
|
-
```tsx
|
|
285
|
-
import { AgentServiceProvider, useAgentService } from '@app-studio/web';
|
|
286
|
-
|
|
287
|
-
// Wrap your app with the service provider
|
|
288
|
-
<AgentServiceProvider config={{ baseUrl: 'https://api.example.com' }}>
|
|
289
|
-
<MyApp />
|
|
290
|
-
</AgentServiceProvider>
|
|
291
|
-
|
|
292
|
-
// Use the service in components
|
|
293
|
-
const { service, isConnected } = useAgentService();
|
|
294
|
-
```
|
|
295
|
-
|
|
296
299
|
## Demo Page
|
|
297
300
|
|
|
298
301
|
A comprehensive demo page showcasing all components is available at:
|
|
@@ -313,4 +316,4 @@ All ADK Agent Components are **production-ready** and provide:
|
|
|
313
316
|
- ✅ Comprehensive error handling and loading states
|
|
314
317
|
- ✅ Real-time updates and streaming support
|
|
315
318
|
- ✅ Extensive customization options
|
|
316
|
-
- ✅ Complete documentation and examples
|
|
319
|
+
- ✅ Complete documentation and examples
|
package/docs/adk-quick-start.md
CHANGED
|
@@ -19,26 +19,13 @@ import {
|
|
|
19
19
|
AgentChat,
|
|
20
20
|
AgentSession,
|
|
21
21
|
AgentTrace,
|
|
22
|
-
AgentEval
|
|
23
|
-
AgentServiceProvider
|
|
22
|
+
AgentEval
|
|
24
23
|
} from '@app-studio/web';
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
### 2.
|
|
26
|
+
### 2. Use Components
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
import { AgentServiceProvider } from '@app-studio/web';
|
|
31
|
-
|
|
32
|
-
function App() {
|
|
33
|
-
return (
|
|
34
|
-
<AgentServiceProvider config={{ baseUrl: 'https://your-adk-api.com' }}>
|
|
35
|
-
<YourApp />
|
|
36
|
-
</AgentServiceProvider>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 3. Use Components
|
|
28
|
+
The ADK components are self-contained and handle their own API communications. Simply add them to your application and provide the necessary props.
|
|
42
29
|
|
|
43
30
|
```tsx
|
|
44
31
|
function YourApp() {
|
|
@@ -49,6 +36,7 @@ function YourApp() {
|
|
|
49
36
|
<AgentSession
|
|
50
37
|
appName="my-agent"
|
|
51
38
|
userId="user123"
|
|
39
|
+
apiBaseUrl="https://your-adk-api.com"
|
|
52
40
|
/>
|
|
53
41
|
</div>
|
|
54
42
|
|
|
@@ -57,6 +45,7 @@ function YourApp() {
|
|
|
57
45
|
<AgentChat
|
|
58
46
|
appName="my-agent"
|
|
59
47
|
userId="user123"
|
|
48
|
+
apiBaseUrl="https://your-adk-api.com"
|
|
60
49
|
enableFileUpload={true}
|
|
61
50
|
enableStreaming={true}
|
|
62
51
|
/>
|
|
@@ -70,13 +59,14 @@ function YourApp() {
|
|
|
70
59
|
|
|
71
60
|
### AgentChat
|
|
72
61
|
**Purpose**: Real-time chat interface with ADK agents
|
|
73
|
-
**Key Features**: File uploads, streaming, function calls, code execution
|
|
62
|
+
**Key Features**: File uploads, audio recording, streaming, function calls, code execution
|
|
74
63
|
|
|
75
64
|
```tsx
|
|
76
65
|
<AgentChat
|
|
77
66
|
appName="my-agent"
|
|
78
67
|
userId="user123"
|
|
79
68
|
enableFileUpload={true}
|
|
69
|
+
enableAudioRecording={true}
|
|
80
70
|
enableStreaming={true}
|
|
81
71
|
enableThoughts={true}
|
|
82
72
|
onMessageSent={(message) => console.log(message)}
|
|
@@ -173,7 +163,7 @@ function AgentInterface() {
|
|
|
173
163
|
container: { backgroundColor: 'color.blue.50' },
|
|
174
164
|
userMessage: { backgroundColor: 'color.blue.500' },
|
|
175
165
|
botMessage: { backgroundColor: 'color.green.100' },
|
|
176
|
-
|
|
166
|
+
inputField: { borderColor: 'color.blue.300' },
|
|
177
167
|
}}
|
|
178
168
|
/>
|
|
179
169
|
```
|
|
@@ -259,25 +249,9 @@ import type {
|
|
|
259
249
|
|
|
260
250
|
### Common Issues
|
|
261
251
|
|
|
262
|
-
1.
|
|
263
|
-
2.
|
|
264
|
-
3.
|
|
265
|
-
4. **TypeScript errors**: Import types from the correct package
|
|
266
|
-
|
|
267
|
-
### Debug Mode
|
|
268
|
-
|
|
269
|
-
Enable debug logging:
|
|
270
|
-
|
|
271
|
-
```tsx
|
|
272
|
-
<AgentServiceProvider
|
|
273
|
-
config={{
|
|
274
|
-
baseUrl: 'https://api.example.com',
|
|
275
|
-
enableLogging: true
|
|
276
|
-
}}
|
|
277
|
-
>
|
|
278
|
-
<App />
|
|
279
|
-
</AgentServiceProvider>
|
|
280
|
-
```
|
|
252
|
+
1. **API errors**: Check the `apiBaseUrl` prop and ensure your backend URL and API endpoints are correct.
|
|
253
|
+
2. **Styling issues**: Verify you're using the app-studio color system.
|
|
254
|
+
3. **TypeScript errors**: Import types from the correct package.
|
|
281
255
|
|
|
282
256
|
## Next Steps
|
|
283
257
|
|
package/package.json
CHANGED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# ADK Components Customization Guide
|
|
2
|
-
|
|
3
|
-
This guide demonstrates how to customize ADK components using the enhanced `views` prop and `containerProps` for complete control over appearance and behavior.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
All ADK components now support comprehensive customization through:
|
|
8
|
-
|
|
9
|
-
1. **Enhanced `views` prop** - Granular control over individual component parts
|
|
10
|
-
2. **Container props** - Direct styling of the main container
|
|
11
|
-
3. **Theme props** - Built-in color schemes and layout options
|
|
12
|
-
4. **Responsive design** - Automatic adaptation across devices
|
|
13
|
-
|
|
14
|
-
## Component Customization
|
|
15
|
-
|
|
16
|
-
### AgentChat Component
|
|
17
|
-
|
|
18
|
-
The AgentChat component supports extensive customization of all its parts:
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
<AgentChat
|
|
22
|
-
appName="my-agent"
|
|
23
|
-
userId="user123"
|
|
24
|
-
colorScheme="purple"
|
|
25
|
-
compact={false}
|
|
26
|
-
rounded={true}
|
|
27
|
-
containerProps={{
|
|
28
|
-
backgroundColor: 'color.purple.25',
|
|
29
|
-
border: '2px solid',
|
|
30
|
-
borderColor: 'color.purple.300',
|
|
31
|
-
}}
|
|
32
|
-
views={{
|
|
33
|
-
// Main areas
|
|
34
|
-
container: { backgroundColor: 'color.purple.25' },
|
|
35
|
-
header: { backgroundColor: 'color.purple.500', color: 'white' },
|
|
36
|
-
messageList: { backgroundColor: 'color.white', padding: '20px' },
|
|
37
|
-
inputArea: { backgroundColor: 'color.purple.50', padding: '16px' },
|
|
38
|
-
|
|
39
|
-
// Message styling
|
|
40
|
-
userMessage: {
|
|
41
|
-
backgroundColor: 'color.purple.500',
|
|
42
|
-
color: 'white',
|
|
43
|
-
borderRadius: '18px 18px 4px 18px',
|
|
44
|
-
padding: '12px 16px',
|
|
45
|
-
},
|
|
46
|
-
botMessage: {
|
|
47
|
-
backgroundColor: 'color.purple.100',
|
|
48
|
-
color: 'color.purple.900',
|
|
49
|
-
borderRadius: '18px 18px 18px 4px',
|
|
50
|
-
padding: '12px 16px',
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
// Input components
|
|
54
|
-
inputField: {
|
|
55
|
-
borderRadius: '24px',
|
|
56
|
-
border: '2px solid',
|
|
57
|
-
borderColor: 'color.purple.200',
|
|
58
|
-
},
|
|
59
|
-
sendButton: {
|
|
60
|
-
backgroundColor: 'color.purple.500',
|
|
61
|
-
borderRadius: '50%',
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
// State indicators
|
|
65
|
-
typingIndicator: {
|
|
66
|
-
color: 'color.purple.600',
|
|
67
|
-
backgroundColor: 'color.purple.100',
|
|
68
|
-
borderRadius: '16px',
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
// Function calls and code
|
|
72
|
-
functionCall: {
|
|
73
|
-
backgroundColor: 'color.purple.50',
|
|
74
|
-
border: '1px solid',
|
|
75
|
-
borderColor: 'color.purple.200',
|
|
76
|
-
borderRadius: '8px',
|
|
77
|
-
},
|
|
78
|
-
codeBlock: {
|
|
79
|
-
backgroundColor: 'color.gray.900',
|
|
80
|
-
color: 'color.gray.100',
|
|
81
|
-
borderRadius: '8px',
|
|
82
|
-
},
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### AgentSession Component
|
|
88
|
-
|
|
89
|
-
The AgentSession component provides comprehensive session management customization:
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
<AgentSession
|
|
93
|
-
appName="my-agent"
|
|
94
|
-
userId="user123"
|
|
95
|
-
colorScheme="green"
|
|
96
|
-
layout="list"
|
|
97
|
-
showPreviews={true}
|
|
98
|
-
enableBulkOperations={true}
|
|
99
|
-
containerProps={{
|
|
100
|
-
backgroundColor: 'color.green.25',
|
|
101
|
-
border: '2px solid',
|
|
102
|
-
borderColor: 'color.green.300',
|
|
103
|
-
}}
|
|
104
|
-
views={{
|
|
105
|
-
// Main areas
|
|
106
|
-
container: { backgroundColor: 'color.green.25' },
|
|
107
|
-
header: { backgroundColor: 'color.green.500', color: 'white' },
|
|
108
|
-
sessionList: { backgroundColor: 'color.white', padding: '16px' },
|
|
109
|
-
|
|
110
|
-
// Session items
|
|
111
|
-
sessionItem: {
|
|
112
|
-
backgroundColor: 'color.green.50',
|
|
113
|
-
borderRadius: '8px',
|
|
114
|
-
padding: '12px',
|
|
115
|
-
border: '1px solid',
|
|
116
|
-
borderColor: 'color.green.200',
|
|
117
|
-
},
|
|
118
|
-
activeSessionItem: {
|
|
119
|
-
backgroundColor: 'color.green.100',
|
|
120
|
-
borderColor: 'color.green.500',
|
|
121
|
-
borderWidth: '2px',
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
// Session content
|
|
125
|
-
sessionTitle: { fontWeight: '600', color: 'color.green.900' },
|
|
126
|
-
sessionDescription: { color: 'color.green.700' },
|
|
127
|
-
sessionTimestamp: { color: 'color.green.600', fontSize: '12px' },
|
|
128
|
-
|
|
129
|
-
// Action buttons
|
|
130
|
-
createButton: {
|
|
131
|
-
backgroundColor: 'color.green.500',
|
|
132
|
-
color: 'white',
|
|
133
|
-
borderRadius: '8px',
|
|
134
|
-
},
|
|
135
|
-
deleteButton: {
|
|
136
|
-
backgroundColor: 'color.red.500',
|
|
137
|
-
color: 'white',
|
|
138
|
-
borderRadius: '6px',
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
// Search and filters
|
|
142
|
-
searchInput: {
|
|
143
|
-
borderRadius: '20px',
|
|
144
|
-
border: '2px solid',
|
|
145
|
-
borderColor: 'color.green.200',
|
|
146
|
-
},
|
|
147
|
-
}}
|
|
148
|
-
/>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Available Views Properties
|
|
152
|
-
|
|
153
|
-
### AgentChat Views
|
|
154
|
-
|
|
155
|
-
- **Main Areas**: `container`, `header`, `messageList`, `inputArea`, `attachmentArea`
|
|
156
|
-
- **Messages**: `message`, `userMessage`, `botMessage`, `systemMessage`, `messageContent`, `messageTimestamp`, `messageAvatar`, `messageActions`
|
|
157
|
-
- **Input**: `inputField`, `sendButton`, `attachButton`, `recordButton`, `inputToolbar`
|
|
158
|
-
- **States**: `loadingIndicator`, `typingIndicator`, `errorMessage`, `emptyState`
|
|
159
|
-
- **Features**: `functionCall`, `functionResponse`, `codeBlock`, `codeOutput`, `thoughtBubble`
|
|
160
|
-
- **Attachments**: `attachmentPreview`, `attachmentItem`, `attachmentRemoveButton`
|
|
161
|
-
|
|
162
|
-
### AgentSession Views
|
|
163
|
-
|
|
164
|
-
- **Main Areas**: `container`, `header`, `toolbar`, `sessionList`, `sessionActions`, `filtersPanel`
|
|
165
|
-
- **Session Items**: `sessionItem`, `activeSessionItem`, `sessionInfo`, `sessionTitle`, `sessionDescription`, `sessionMetadata`, `sessionTimestamp`, `sessionTags`, `sessionStats`
|
|
166
|
-
- **Actions**: `createButton`, `deleteButton`, `exportButton`, `importButton`, `refreshButton`, `selectButton`, `duplicateButton`
|
|
167
|
-
- **Search/Filter**: `searchInput`, `filterDropdown`, `sortDropdown`, `dateRangePicker`, `tagFilter`
|
|
168
|
-
- **States**: `emptyState`, `loadingState`, `errorState`
|
|
169
|
-
- **Bulk Operations**: `bulkActions`, `selectAllCheckbox`, `bulkDeleteButton`, `bulkExportButton`
|
|
170
|
-
|
|
171
|
-
## Theme Options
|
|
172
|
-
|
|
173
|
-
### Color Schemes
|
|
174
|
-
- `blue` (default)
|
|
175
|
-
- `purple`
|
|
176
|
-
- `green`
|
|
177
|
-
- `orange`
|
|
178
|
-
- `red`
|
|
179
|
-
- `gray`
|
|
180
|
-
|
|
181
|
-
### Layout Options
|
|
182
|
-
|
|
183
|
-
**AgentSession Layouts:**
|
|
184
|
-
- `list` - Vertical list layout
|
|
185
|
-
- `grid` - Grid layout for sessions
|
|
186
|
-
- `compact` - Condensed view
|
|
187
|
-
|
|
188
|
-
**AgentTrace Layouts:**
|
|
189
|
-
- `timeline` - Timeline visualization
|
|
190
|
-
- `tree` - Tree structure
|
|
191
|
-
- `table` - Tabular view
|
|
192
|
-
- `graph` - Graph visualization
|
|
193
|
-
|
|
194
|
-
## Best Practices
|
|
195
|
-
|
|
196
|
-
1. **Consistent Color Schemes**: Use the same color scheme across related components
|
|
197
|
-
2. **Responsive Design**: Test customizations across different screen sizes
|
|
198
|
-
3. **Accessibility**: Ensure sufficient color contrast and readable fonts
|
|
199
|
-
4. **Performance**: Avoid overly complex styling that might impact performance
|
|
200
|
-
5. **Maintainability**: Use design tokens from the app-studio color system
|
|
201
|
-
|
|
202
|
-
## Examples
|
|
203
|
-
|
|
204
|
-
See the enhanced examples in each component's `examples/default.tsx` file for comprehensive demonstrations of all customization options.
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
# ADK Components Customization Enhancement Summary
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The ADK components have been enhanced with comprehensive customization capabilities through expanded `views` props and new container customization options. This provides developers with granular control over every aspect of the component appearance and behavior.
|
|
6
|
-
|
|
7
|
-
## Key Enhancements
|
|
8
|
-
|
|
9
|
-
### 1. Enhanced Views Props
|
|
10
|
-
|
|
11
|
-
All ADK components now support significantly more granular customization through expanded `views` interfaces:
|
|
12
|
-
|
|
13
|
-
#### AgentChat Views (40+ customizable parts)
|
|
14
|
-
- **Main Areas**: container, header, messageList, inputArea, attachmentArea
|
|
15
|
-
- **Message Components**: userMessage, botMessage, systemMessage, messageContent, messageTimestamp, messageAvatar, messageActions
|
|
16
|
-
- **Input Components**: inputField, sendButton, attachButton, recordButton, inputToolbar
|
|
17
|
-
- **State Indicators**: loadingIndicator, typingIndicator, errorMessage, emptyState
|
|
18
|
-
- **Feature Components**: functionCall, functionResponse, codeBlock, codeOutput, thoughtBubble
|
|
19
|
-
- **Attachment Components**: attachmentPreview, attachmentItem, attachmentRemoveButton
|
|
20
|
-
|
|
21
|
-
#### AgentSession Views (40+ customizable parts)
|
|
22
|
-
- **Main Areas**: container, header, toolbar, sessionList, sessionActions, filtersPanel
|
|
23
|
-
- **Session Items**: sessionItem, activeSessionItem, sessionInfo, sessionTitle, sessionDescription, sessionMetadata, sessionTimestamp, sessionTags, sessionStats
|
|
24
|
-
- **Action Buttons**: createButton, deleteButton, exportButton, importButton, refreshButton, selectButton, duplicateButton
|
|
25
|
-
- **Search/Filter**: searchInput, filterDropdown, sortDropdown, dateRangePicker, tagFilter
|
|
26
|
-
- **Bulk Operations**: bulkActions, selectAllCheckbox, bulkDeleteButton, bulkExportButton
|
|
27
|
-
|
|
28
|
-
#### AgentEval Views (50+ customizable parts)
|
|
29
|
-
- **Main Areas**: container, header, toolbar, evaluationList, createPanel, resultsPanel, metricsPanel
|
|
30
|
-
- **Evaluation Items**: evaluationItem, activeEvaluationItem, evaluationTitle, evaluationStatus, evaluationProgress
|
|
31
|
-
- **Test Cases**: testCaseList, testCaseItem, testCaseInput, testCaseOutput, testCaseResult
|
|
32
|
-
- **Progress/Status**: progressBar, statusIndicator, statusBadge, scoreDisplay, durationDisplay
|
|
33
|
-
- **Visualization**: chartContainer, metricsChart, resultsTable, summaryCard
|
|
34
|
-
|
|
35
|
-
#### AgentTrace Views (50+ customizable parts)
|
|
36
|
-
- **Main Areas**: container, header, toolbar, timeline, eventList, detailsPanel, metricsPanel
|
|
37
|
-
- **Event Components**: eventItem, selectedEventItem, eventHeader, eventContent, eventMetadata
|
|
38
|
-
- **Timeline**: timelineContainer, timelineAxis, timelineEvent, timelineSpan, timelineMarker
|
|
39
|
-
- **Metrics**: metricsCard, performanceChart, errorRateChart, latencyChart, throughputChart
|
|
40
|
-
- **Visualization**: flowDiagram, dependencyGraph, heatmap
|
|
41
|
-
|
|
42
|
-
### 2. Container Props Support
|
|
43
|
-
|
|
44
|
-
All components now accept `containerProps` for direct styling of the main container:
|
|
45
|
-
|
|
46
|
-
```tsx
|
|
47
|
-
<AgentChat
|
|
48
|
-
containerProps={{
|
|
49
|
-
backgroundColor: 'color.purple.25',
|
|
50
|
-
border: '2px solid',
|
|
51
|
-
borderColor: 'color.purple.300',
|
|
52
|
-
borderRadius: '12px',
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 3. Theme and Appearance Props
|
|
58
|
-
|
|
59
|
-
New theme-related props for consistent styling:
|
|
60
|
-
|
|
61
|
-
- **colorScheme**: `'blue' | 'purple' | 'green' | 'orange' | 'red' | 'gray'`
|
|
62
|
-
- **layout**: Component-specific layout options
|
|
63
|
-
- **compact**: Boolean for condensed layouts
|
|
64
|
-
- **rounded**: Boolean for rounded corners
|
|
65
|
-
- **showPreviews**: Boolean for preview features
|
|
66
|
-
|
|
67
|
-
### 4. Dynamic Styling
|
|
68
|
-
|
|
69
|
-
Components now include dynamic styling functions that apply theme-based styles automatically:
|
|
70
|
-
|
|
71
|
-
```tsx
|
|
72
|
-
const getThemeStyles = () => {
|
|
73
|
-
const colorStyles = {
|
|
74
|
-
blue: { borderColor: 'color.blue.200' },
|
|
75
|
-
purple: { borderColor: 'color.purple.200' },
|
|
76
|
-
// ... other colors
|
|
77
|
-
};
|
|
78
|
-
return colorStyles[colorScheme];
|
|
79
|
-
};
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Implementation Details
|
|
83
|
-
|
|
84
|
-
### File Changes
|
|
85
|
-
|
|
86
|
-
1. **Props Interfaces Enhanced**:
|
|
87
|
-
- `AgentChat/AgentChat.props.ts` - Expanded AgentChatViews interface
|
|
88
|
-
- `AgentSession/AgentSession.props.ts` - Expanded AgentSessionViews interface
|
|
89
|
-
- `AgentEval/AgentEval.props.ts` - Expanded AgentEvalViews interface
|
|
90
|
-
- `AgentTrace/AgentTrace.props.ts` - Expanded AgentTraceViews interface
|
|
91
|
-
|
|
92
|
-
2. **View Components Updated**:
|
|
93
|
-
- `AgentChat/AgentChat.view.tsx` - Added theme support and containerProps
|
|
94
|
-
- `AgentSession/AgentSession.view.tsx` - Added theme support and containerProps
|
|
95
|
-
|
|
96
|
-
3. **Examples Enhanced**:
|
|
97
|
-
- `AgentChat/examples/default.tsx` - Comprehensive customization example
|
|
98
|
-
- `AgentSession/examples/default.tsx` - Enhanced customization example
|
|
99
|
-
|
|
100
|
-
4. **Documentation Created**:
|
|
101
|
-
- `docs/adk-customization-guide.md` - Complete customization guide
|
|
102
|
-
- `docs/adk-customization-summary.md` - This summary document
|
|
103
|
-
|
|
104
|
-
## Usage Examples
|
|
105
|
-
|
|
106
|
-
### Basic Customization
|
|
107
|
-
```tsx
|
|
108
|
-
<AgentChat
|
|
109
|
-
appName="my-agent"
|
|
110
|
-
userId="user123"
|
|
111
|
-
colorScheme="purple"
|
|
112
|
-
views={{
|
|
113
|
-
userMessage: { backgroundColor: 'color.purple.500' },
|
|
114
|
-
botMessage: { backgroundColor: 'color.purple.100' },
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Advanced Customization
|
|
120
|
-
```tsx
|
|
121
|
-
<AgentSession
|
|
122
|
-
appName="my-agent"
|
|
123
|
-
userId="user123"
|
|
124
|
-
colorScheme="green"
|
|
125
|
-
layout="grid"
|
|
126
|
-
containerProps={{ backgroundColor: 'color.green.25' }}
|
|
127
|
-
views={{
|
|
128
|
-
sessionItem: {
|
|
129
|
-
backgroundColor: 'color.green.50',
|
|
130
|
-
borderRadius: '8px',
|
|
131
|
-
padding: '12px',
|
|
132
|
-
},
|
|
133
|
-
activeSessionItem: {
|
|
134
|
-
backgroundColor: 'color.green.100',
|
|
135
|
-
borderColor: 'color.green.500',
|
|
136
|
-
},
|
|
137
|
-
}}
|
|
138
|
-
/>
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Benefits
|
|
142
|
-
|
|
143
|
-
1. **Complete Control**: Developers can customize every visual aspect of the components
|
|
144
|
-
2. **Consistent Theming**: Built-in color schemes ensure visual consistency
|
|
145
|
-
3. **Responsive Design**: Components adapt to different layouts and screen sizes
|
|
146
|
-
4. **Maintainable**: Uses app-studio design tokens for consistent styling
|
|
147
|
-
5. **Flexible**: Supports both simple theme-based and complex custom styling
|
|
148
|
-
|
|
149
|
-
## Next Steps
|
|
150
|
-
|
|
151
|
-
The enhanced customization system provides a solid foundation for:
|
|
152
|
-
- Creating branded component themes
|
|
153
|
-
- Building custom layouts and designs
|
|
154
|
-
- Implementing responsive component behaviors
|
|
155
|
-
- Maintaining visual consistency across applications
|
|
156
|
-
|
|
157
|
-
All components are now ready for comprehensive customization while maintaining their core functionality and accessibility features.
|
|
File without changes
|