@app-studio/web 0.9.44 → 0.9.46
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/Icon/Icon.d.ts +2 -1
- package/dist/pages/themeTest.page.d.ts +3 -0
- package/dist/web.cjs.development.js +7 -2
- 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 +7 -3
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +7 -2
- 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/components/Badge.mdx +1 -1
- package/docs/components/ColorPicker.mdx +16 -16
- package/docs/components/DragAndDrop.mdx +11 -11
- package/docs/components/Drawer.mdx +3 -3
- package/docs/components/Gradient.mdx +40 -40
- package/docs/components/Icon.mdx +90 -57
- package/docs/components/Loader.mdx +17 -17
- package/docs/components/ProgressBar.mdx +14 -14
- package/docs/components/StatusIndicator.mdx +5 -5
- package/docs/components.md +0 -164
- package/package.json +1 -1
- package/dist/bot/Bot.d.ts +0 -15
- package/dist/bot/Cache.d.ts +0 -13
- package/dist/bot/Config.d.ts +0 -13
- package/dist/bot/ContentFetcher.d.ts +0 -9
- package/dist/bot/DocuCode.d.ts +0 -19
- package/dist/bot/FileHandler.d.ts +0 -39
- package/dist/bot/ai/AnthropicConnector.d.ts +0 -6
- package/dist/bot/ai/GeminiConnector.d.ts +0 -7
- package/dist/bot/ai/GroqConnector.d.ts +0 -7
- package/dist/bot/ai/HuggingFaceConnector.d.ts +0 -6
- package/dist/bot/ai/OpenAIConnector.d.ts +0 -11
- package/dist/bot/ai/ReplicateConnector.d.ts +0 -7
- package/dist/bot/ai/SambaNovaConnector.d.ts +0 -6
- package/dist/bot/ai/ai.config.d.ts +0 -12
- package/dist/bot/ai/ai.service.d.ts +0 -36
- package/dist/bot/data.d.ts +0 -19
- package/dist/bot/extractors.d.ts +0 -8
- package/dist/bot/index.d.ts +0 -1
- package/dist/bot/prompt/1-project.d.ts +0 -1
- package/dist/bot/prompt/2-response.d.ts +0 -1
- package/dist/bot/prompt/3-comment.d.ts +0 -1
- package/docs/components/Calendar.mdx +0 -189
- package/docs/components/Flow.mdx +0 -258
- package/docs/components/KanbanBoard.mdx +0 -286
- package/docs/components/OKR.mdx +0 -452
- package/docs/components/Tree.mdx +0 -341
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
# KanbanBoard
|
|
2
|
-
|
|
3
|
-
A flexible Kanban board component for managing tasks and workflows. Features drag-and-drop functionality for cards between columns, customizable card and column rendering, and comprehensive styling options.
|
|
4
|
-
|
|
5
|
-
## When to use
|
|
6
|
-
Use the Kanban Board component to:
|
|
7
|
-
- Visualize a workflow or process.
|
|
8
|
-
- Manage tasks or items as they move through different stages.
|
|
9
|
-
- Allow users to reorder and re-categorize items using drag-and-drop.
|
|
10
|
-
- Build project management tools, task trackers, or any workflow-based UI.
|
|
11
|
-
|
|
12
|
-
### **Import**
|
|
13
|
-
```tsx
|
|
14
|
-
import { KanbanBoard } from '@app-studio/web';
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### **Default**
|
|
18
|
-
A basic Kanban board with three columns and some cards.
|
|
19
|
-
|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import React, { useState } from 'react';
|
|
24
|
-
import { KanbanBoard } from '@app-studio/web';
|
|
25
|
-
import { KanbanBoardColumn } from '@app-studio/web';
|
|
26
|
-
|
|
27
|
-
export const DefaultKanbanBoard = () => {
|
|
28
|
-
const [columns, setColumns] = useState<KanbanBoardColumn[]>([
|
|
29
|
-
{
|
|
30
|
-
id: 'todo',
|
|
31
|
-
title: 'To Do',
|
|
32
|
-
cards: [
|
|
33
|
-
{ id: '1', title: 'Design System', description: 'Create a new design system.' },
|
|
34
|
-
{ id: '2', title: 'API Integration', description: 'Integrate with the new API.' },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: 'inprogress',
|
|
39
|
-
title: 'In Progress',
|
|
40
|
-
cards: [
|
|
41
|
-
{ id: '3', title: 'User Dashboard', description: 'Develop the main user dashboard.' },
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: 'done',
|
|
46
|
-
title: 'Done',
|
|
47
|
-
cards: [
|
|
48
|
-
{ id: '4', title: 'Project Setup', description: 'Initial project setup and configuration.' },
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
]);
|
|
52
|
-
|
|
53
|
-
return <KanbanBoard columns={columns} onChange={setColumns} />;
|
|
54
|
-
};
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### **Custom Card Rendering**
|
|
58
|
-
Customize how cards are displayed using the `renderCard` prop. This is useful for adding priority indicators, avatars, or other custom elements to your cards.
|
|
59
|
-
|
|
60
|
-

|
|
61
|
-
|
|
62
|
-
```tsx
|
|
63
|
-
import React, { useState } from 'react';
|
|
64
|
-
import { KanbanBoard } from '@app-studio/web';
|
|
65
|
-
import { KanbanBoardColumn, KanbanBoardCard } from '@app-studio/web';
|
|
66
|
-
import { View, Text, Horizontal } from '@app-studio/web';
|
|
67
|
-
|
|
68
|
-
export const CustomRenderKanbanBoard = () => {
|
|
69
|
-
const [columns, setColumns] = useState<KanbanBoardColumn[]>([
|
|
70
|
-
{
|
|
71
|
-
id: 'todo',
|
|
72
|
-
title: 'To Do',
|
|
73
|
-
cards: [
|
|
74
|
-
{ id: '1', title: 'Design System', description: 'Create a new design system.', metadata: { priority: 'high' } },
|
|
75
|
-
{ id: '2', title: 'API Integration', description: 'Integrate with the new API.', metadata: { priority: 'low' } },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'inprogress',
|
|
80
|
-
title: 'In Progress',
|
|
81
|
-
cards: [
|
|
82
|
-
{ id: '3', title: 'User Dashboard', description: 'Develop the main user dashboard.', metadata: { priority: 'medium' } },
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'done',
|
|
87
|
-
title: 'Done',
|
|
88
|
-
cards: [
|
|
89
|
-
{ id: '4', title: 'Project Setup', description: 'Initial project setup and configuration.', metadata: { priority: 'low' } },
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
const renderCard = (card: KanbanBoardCard, column: KanbanBoardColumn) => {
|
|
95
|
-
const priority = card.metadata?.priority as string;
|
|
96
|
-
const priorityColors = {
|
|
97
|
-
low: 'color.green.500',
|
|
98
|
-
medium: 'color.yellow.500',
|
|
99
|
-
high: 'color.red.500',
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<View>
|
|
104
|
-
<Horizontal alignItems="center" marginBottom={8}>
|
|
105
|
-
<View
|
|
106
|
-
width={8}
|
|
107
|
-
height={8}
|
|
108
|
-
borderRadius="50%"
|
|
109
|
-
backgroundColor={priorityColors[priority]}
|
|
110
|
-
marginRight={8}
|
|
111
|
-
/>
|
|
112
|
-
<Text fontWeight="semibold">{card.title}</Text>
|
|
113
|
-
</Horizontal>
|
|
114
|
-
<Text fontSize={14} color="color.gray.600">
|
|
115
|
-
{card.description}
|
|
116
|
-
</Text>
|
|
117
|
-
</View>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
return <KanbanBoard columns={columns} onChange={setColumns} renderCard={renderCard} />;
|
|
122
|
-
};
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### **Custom Column Header and Adding Cards**
|
|
126
|
-
Use `renderColumnHeader` to create a custom header, for example to add an "Add Card" button. The `onCardCreate` prop can then be used to handle the creation of new cards.
|
|
127
|
-
|
|
128
|
-

|
|
129
|
-
|
|
130
|
-
```tsx
|
|
131
|
-
import React, { useState } from 'react';
|
|
132
|
-
import { KanbanBoard } from '@app-studio/web';
|
|
133
|
-
import { Button } from '@app-studio/web';
|
|
134
|
-
import { KanbanBoardColumn, KanbanBoardCard } from '@app-studio/web';
|
|
135
|
-
import { View, Text, Horizontal } from '@app-studio/web';
|
|
136
|
-
|
|
137
|
-
export const CustomHeaderKanbanBoard = () => {
|
|
138
|
-
const [columns, setColumns] = useState<KanbanBoardColumn[]>([
|
|
139
|
-
{ id: 'todo', title: 'To Do', cards: [] },
|
|
140
|
-
]);
|
|
141
|
-
|
|
142
|
-
const handleCardCreate = (card, column) => {
|
|
143
|
-
const newCard = {
|
|
144
|
-
id: `${Date.now()}`,
|
|
145
|
-
title: 'New Card',
|
|
146
|
-
description: 'A new card was added.',
|
|
147
|
-
};
|
|
148
|
-
const newColumns = columns.map(col => {
|
|
149
|
-
if (col.id === column.id) {
|
|
150
|
-
return { ...col, cards: [...col.cards, newCard] };
|
|
151
|
-
}
|
|
152
|
-
return col;
|
|
153
|
-
});
|
|
154
|
-
setColumns(newColumns);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const renderColumnHeader = (column: KanbanBoardColumn) => {
|
|
158
|
-
return (
|
|
159
|
-
<Horizontal justifyContent="space-between" alignItems="center">
|
|
160
|
-
<Text fontWeight="bold">{column.title}</Text>
|
|
161
|
-
<Button size="sm" onClick={() => handleCardCreate(null, column)}>+ Add</Button>
|
|
162
|
-
</Horizontal>
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
return <KanbanBoard columns={columns} onChange={setColumns} onCardCreate={handleCardCreate} renderColumnHeader={renderColumnHeader} />;
|
|
167
|
-
};
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### **Inline Editing**
|
|
171
|
-
You can implement inline editing of card titles by using the `onCardTitleChange` prop and a custom `renderCard` function that displays an input field on double click.
|
|
172
|
-
|
|
173
|
-

|
|
174
|
-
|
|
175
|
-
```tsx
|
|
176
|
-
import React, { useState } from 'react';
|
|
177
|
-
import { KanbanBoard } from '@app-studio/web';
|
|
178
|
-
import { KanbanBoardColumn, KanbanBoardCard } from '@app-studio/web';
|
|
179
|
-
import { Input, Text } from '@app-studio/web';
|
|
180
|
-
|
|
181
|
-
export const EditableKanbanBoard = () => {
|
|
182
|
-
const [columns, setColumns] = useState<KanbanBoardColumn[]>([
|
|
183
|
-
{
|
|
184
|
-
id: 'todo',
|
|
185
|
-
title: 'To Do',
|
|
186
|
-
cards: [{ id: '1', title: 'Editable Card' }],
|
|
187
|
-
},
|
|
188
|
-
]);
|
|
189
|
-
const [editingCardId, setEditingCardId] = useState<string | null>(null);
|
|
190
|
-
|
|
191
|
-
const handleTitleChange = (card, column, newTitle) => {
|
|
192
|
-
const newColumns = columns.map(col => {
|
|
193
|
-
if (col.id === column.id) {
|
|
194
|
-
const newCards = col.cards.map(c => c.id === card.id ? { ...c, title: newTitle } : c);
|
|
195
|
-
return { ...col, cards: newCards };
|
|
196
|
-
}
|
|
197
|
-
return col;
|
|
198
|
-
});
|
|
199
|
-
setColumns(newColumns);
|
|
200
|
-
setEditingCardId(null);
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const renderCard = (card, column) => {
|
|
204
|
-
if (editingCardId === card.id) {
|
|
205
|
-
return (
|
|
206
|
-
<Input
|
|
207
|
-
autoFocus
|
|
208
|
-
defaultValue={card.title}
|
|
209
|
-
onBlur={(e) => handleTitleChange(card, column, e.target.value)}
|
|
210
|
-
onKeyDown={(e) => {
|
|
211
|
-
if (e.key === 'Enter') {
|
|
212
|
-
handleTitleChange(card, column, e.currentTarget.value);
|
|
213
|
-
}
|
|
214
|
-
}}
|
|
215
|
-
/>
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
return <Text onDoubleClick={() => setEditingCardId(card.id)}>{card.title}</Text>;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
return (
|
|
222
|
-
<KanbanBoard
|
|
223
|
-
columns={columns}
|
|
224
|
-
onChange={setColumns}
|
|
225
|
-
onCardTitleChange={handleTitleChange}
|
|
226
|
-
renderCard={renderCard}
|
|
227
|
-
/>
|
|
228
|
-
);
|
|
229
|
-
};
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Live Demo
|
|
233
|
-
A live demo of the Kanban Board component with all its features is available [here](https://app-studio-web.vercel.app/components/kanban-board).
|
|
234
|
-
|
|
235
|
-
## Props
|
|
236
|
-
|
|
237
|
-
| Prop | Type | Description | Default |
|
|
238
|
-
| --- | --- | --- | --- |
|
|
239
|
-
| `columns` | `KanbanBoardColumn[]` | Array of columns to display. | `[]` |
|
|
240
|
-
| `onChange` | `(columns: KanbanBoardColumn[]) => void` | Callback when columns or cards are changed (e.g., after drag-and-drop). | - |
|
|
241
|
-
| `onCardMove` | `(card: KanbanBoardCard, fromColumn: KanbanBoardColumn, toColumn: KanbanBoardColumn) => void` | Callback when a card is moved to a different column. | - |
|
|
242
|
-
| `onCardCreate` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is created. | - |
|
|
243
|
-
| `onCardDelete` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is deleted. | - |
|
|
244
|
-
| `onCardClick` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is clicked. | - |
|
|
245
|
-
| `onCardDoubleClick` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is double-clicked. | - |
|
|
246
|
-
| `onCardTitleChange` | `(card: KanbanBoardCard, column: KanbanBoardColumn, newTitle: string) => void` | Callback when a card's title is changed. | - |
|
|
247
|
-
| `onCardDescriptionChange` | `(card: KanbanBoardCard, column: KanbanBoardColumn, newDescription: string) => void` | Callback when a card's description is changed. | - |
|
|
248
|
-
| `renderCard` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => React.ReactNode` | Custom render method for cards. | - |
|
|
249
|
-
| `renderColumnHeader` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for column headers. | - |
|
|
250
|
-
| `renderEmptyState` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for empty column state. | - |
|
|
251
|
-
| `views` | `KanbanBoardViews` | Style overrides for various parts of the component. | `{}` |
|
|
252
|
-
|
|
253
|
-
## KanbanBoardColumn Interface
|
|
254
|
-
|
|
255
|
-
| Property | Type | Description |
|
|
256
|
-
| --- | --- | --- |
|
|
257
|
-
| `id` | `string` | Unique identifier for the column. |
|
|
258
|
-
| `title` | `string` | Column title shown in the header. |
|
|
259
|
-
| `cards` | `KanbanBoardCard[]` | Array of cards within the column. |
|
|
260
|
-
| `footer` | `React.ReactNode` | Optional footer content for the column. |
|
|
261
|
-
| `metadata` | `Record<string, unknown>` | Additional metadata for the column. |
|
|
262
|
-
|
|
263
|
-
## KanbanBoardCard Interface
|
|
264
|
-
|
|
265
|
-
| Property | Type | Description |
|
|
266
|
-
| --- | --- | --- |
|
|
267
|
-
| `id` | `string` | Unique identifier for the card. |
|
|
268
|
-
| `title` | `string` | Card title. |
|
|
269
|
-
| `description` | `string` | Optional card description. |
|
|
270
|
-
| `metadata` | `Record<string, unknown>` | Additional metadata for the card. |
|
|
271
|
-
|
|
272
|
-
## KanbanBoardViews Interface
|
|
273
|
-
|
|
274
|
-
Customize the appearance of different Kanban board elements.
|
|
275
|
-
|
|
276
|
-
| Property | Type | Description |
|
|
277
|
-
| --- | --- | --- |
|
|
278
|
-
| `board` | `ViewProps` | Main board container. |
|
|
279
|
-
| `column` | `ViewProps` | Individual column container. |
|
|
280
|
-
| `columnHeader` | `ViewProps` | Column header container. |
|
|
281
|
-
| `columnTitle` | `TextProps` | Column title text. |
|
|
282
|
-
| `columnBody` | `ViewProps` | Column body container (wraps cards). |
|
|
283
|
-
| `columnFooter` | `ViewProps` | Column footer container. |
|
|
284
|
-
| `card` | `ViewProps` | Individual card container. |
|
|
285
|
-
| `cardContent` | `ViewProps` | Content wrapper inside the card. |
|
|
286
|
-
| `emptyState` | `ViewProps` | Empty state container in a column. |
|