@app-studio/web 0.9.36 → 0.9.38
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/ChatInput/ChatInput/ChatInput.style.d.ts +31 -0
- package/dist/components/Drawer/Drawer/Drawer.props.d.ts +61 -0
- package/dist/components/Drawer/Drawer/Drawer.style.d.ts +4 -0
- package/dist/components/Drawer/Drawer/Drawer.view.d.ts +7 -0
- package/dist/components/Drawer/Drawer.d.ts +2 -0
- package/dist/components/index.d.ts +2 -22
- package/dist/pages/drawer.page.d.ts +3 -0
- package/dist/utils/apiConfig.d.ts +2 -2
- package/dist/utils/typography.d.ts +3 -4
- package/dist/web.cjs.development.js +2321 -12073
- 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 +2114 -11857
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +3019 -12768
- 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/Accordion.mdx +4 -4
- package/docs/components/Alert.mdx +1 -1
- package/docs/components/Background.mdx +5 -5
- package/docs/components/Badge.mdx +1 -1
- package/docs/components/Calendar.mdx +3 -0
- package/docs/components/Card.mdx +8 -8
- package/docs/components/Carousel.mdx +6 -6
- package/docs/components/ColorInput.mdx +1 -1
- package/docs/components/Drawer.mdx +164 -0
- package/docs/components/Gradient.mdx +6 -6
- package/docs/components/HoverCard.mdx +5 -5
- package/docs/components/KanbanBoard.mdx +132 -2
- package/docs/components/Link.mdx +2 -2
- package/docs/components/Menubar.mdx +1 -1
- package/docs/components/Message.mdx +4 -4
- package/docs/components/Modal.mdx +4 -4
- package/docs/components/OKR.mdx +40 -63
- package/docs/components/Tabs.mdx +1 -1
- package/docs/components/ToggleGroup.mdx +4 -4
- package/docs/components/Tooltip.mdx +2 -2
- package/docs/conventions.md +1 -1
- package/package.json +2 -2
- package/dist/components/Calendar/Calendar/Calendar.props.d.ts +0 -74
- package/dist/components/Calendar/Calendar/Calendar.style.d.ts +0 -107
- package/dist/components/Calendar/Calendar/Calendar.utils.d.ts +0 -91
- package/dist/components/Calendar/Calendar/Calendar.view.d.ts +0 -3
- package/dist/components/Calendar/Calendar.d.ts +0 -1
- package/dist/components/Flow/Flow/Flow.props.d.ts +0 -144
- package/dist/components/Flow/Flow/Flow.state.d.ts +0 -95
- package/dist/components/Flow/Flow/Flow.style.d.ts +0 -40
- package/dist/components/Flow/Flow/Flow.type.d.ts +0 -181
- package/dist/components/Flow/Flow/Flow.view.d.ts +0 -28
- package/dist/components/Flow/Flow.d.ts +0 -2
- package/dist/components/Flow/index.d.ts +0 -2
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +0 -47
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +0 -13
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.view.d.ts +0 -3
- package/dist/components/KanbanBoard/KanbanBoard.d.ts +0 -3
- package/dist/components/OKR/OKR/OKR.props.d.ts +0 -72
- package/dist/components/OKR/OKR/OKR.style.d.ts +0 -19
- package/dist/components/OKR/OKR/OKR.view.d.ts +0 -4
- package/dist/components/OKR/OKR.d.ts +0 -4
- package/dist/components/Text/Text/Text.props.d.ts +0 -29
- package/dist/components/Text/Text/Text.style.d.ts +0 -27
- package/dist/components/Text/Text/Text.utils.d.ts +0 -2
- package/dist/components/Text/Text/Text.view.d.ts +0 -19
- package/dist/components/Text/Text.d.ts +0 -5
- package/dist/components/Tree/Tree/Tree.props.d.ts +0 -106
- package/dist/components/Tree/Tree/Tree.state.d.ts +0 -38
- package/dist/components/Tree/Tree/Tree.style.d.ts +0 -41
- package/dist/components/Tree/Tree/Tree.type.d.ts +0 -133
- package/dist/components/Tree/Tree/Tree.view.d.ts +0 -36
- package/dist/components/Tree/Tree.d.ts +0 -2
- package/dist/components/adk/AgentChat/AgentChat/AgentChat.props.d.ts +0 -180
- package/dist/components/adk/AgentChat/AgentChat/AgentChat.state.d.ts +0 -24
- package/dist/components/adk/AgentChat/AgentChat/AgentChat.style.d.ts +0 -132
- package/dist/components/adk/AgentChat/AgentChat/AgentChat.view.d.ts +0 -12
- package/dist/components/adk/AgentChat/AgentChat/AgentMessage.d.ts +0 -21
- package/dist/components/adk/AgentChat/AgentChat/AgentRunProgress.d.ts +0 -11
- package/dist/components/adk/AgentChat/AgentChat/AgentTypingIndicator.d.ts +0 -7
- package/dist/components/adk/AgentChat/AgentChat/MessageAttachmentPreview.d.ts +0 -12
- package/dist/components/adk/AgentChat/AgentChat.d.ts +0 -41
- package/dist/components/adk/AgentEval/AgentEval/AgentEval.props.d.ts +0 -213
- package/dist/components/adk/AgentEval/AgentEval/AgentEval.state.d.ts +0 -27
- package/dist/components/adk/AgentEval/AgentEval/AgentEval.style.d.ts +0 -144
- package/dist/components/adk/AgentEval/AgentEval/AgentEval.view.d.ts +0 -12
- package/dist/components/adk/AgentEval/AgentEval/EvaluationCreator.d.ts +0 -17
- package/dist/components/adk/AgentEval/AgentEval/EvaluationList.d.ts +0 -23
- package/dist/components/adk/AgentEval/AgentEval/EvaluationMetrics.d.ts +0 -15
- package/dist/components/adk/AgentEval/AgentEval/EvaluationResults.d.ts +0 -19
- package/dist/components/adk/AgentEval/AgentEval.d.ts +0 -41
- package/dist/components/adk/AgentSession/AgentSession/AgentSession.props.d.ts +0 -170
- package/dist/components/adk/AgentSession/AgentSession/AgentSession.state.d.ts +0 -32
- package/dist/components/adk/AgentSession/AgentSession/AgentSession.style.d.ts +0 -105
- package/dist/components/adk/AgentSession/AgentSession/AgentSession.view.d.ts +0 -12
- package/dist/components/adk/AgentSession/AgentSession/SessionActions.d.ts +0 -20
- package/dist/components/adk/AgentSession/AgentSession/SessionFilters.d.ts +0 -14
- package/dist/components/adk/AgentSession/AgentSession/SessionListItem.d.ts +0 -26
- package/dist/components/adk/AgentSession/AgentSession.d.ts +0 -42
- package/dist/components/adk/AgentTrace/AgentTrace/AgentTrace.props.d.ts +0 -194
- package/dist/components/adk/AgentTrace/AgentTrace/AgentTrace.state.d.ts +0 -27
- package/dist/components/adk/AgentTrace/AgentTrace/AgentTrace.style.d.ts +0 -146
- package/dist/components/adk/AgentTrace/AgentTrace/AgentTrace.view.d.ts +0 -12
- package/dist/components/adk/AgentTrace/AgentTrace/TraceEventList.d.ts +0 -20
- package/dist/components/adk/AgentTrace/AgentTrace/TraceFilters.d.ts +0 -13
- package/dist/components/adk/AgentTrace/AgentTrace/TraceMetrics.d.ts +0 -16
- package/dist/components/adk/AgentTrace/AgentTrace/TraceTimeline.d.ts +0 -19
- package/dist/components/adk/AgentTrace/AgentTrace/TraceVisualization.d.ts +0 -19
- package/dist/components/adk/AgentTrace/AgentTrace.d.ts +0 -44
- package/dist/components/adk/useAdk.d.ts +0 -42
- package/dist/pages/adk/CompleteAgentApp.d.ts +0 -30
- package/dist/pages/adk/adkComponents.page.d.ts +0 -8
- package/dist/pages/adk/adkIntegration.page.d.ts +0 -6
- package/dist/pages/adk/agentChat.page.d.ts +0 -8
- package/dist/pages/adk/providers/AdkProvider.d.ts +0 -83
- package/dist/pages/adk/providers/index.d.ts +0 -1
- package/dist/pages/adk/services/AgentService.d.ts +0 -167
- package/dist/pages/adk/services/AgentServiceProvider.d.ts +0 -83
- package/dist/pages/adk/services/AgentServiceUtils.d.ts +0 -176
- package/dist/pages/adk/services/index.d.ts +0 -50
- package/dist/pages/calendar.page.d.ts +0 -3
- package/dist/pages/flow.page.d.ts +0 -3
- package/dist/pages/kanbanBoard.page.d.ts +0 -3
- package/dist/pages/okr.page.d.ts +0 -3
- package/dist/pages/text.page.d.ts +0 -3
- package/dist/pages/tree.page.d.ts +0 -3
|
@@ -11,7 +11,7 @@ A component that displays collapsible content panels for presenting information
|
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Accordion } from '../Accordion';
|
|
14
|
-
import { Text } from '
|
|
14
|
+
import { Text } from 'app-studio';
|
|
15
15
|
|
|
16
16
|
export const DefaultAccordion = () => {
|
|
17
17
|
return (
|
|
@@ -48,7 +48,7 @@ Allow multiple items to be expanded at once.
|
|
|
48
48
|
```tsx
|
|
49
49
|
import React from 'react';
|
|
50
50
|
import { Accordion } from '../Accordion';
|
|
51
|
-
import { Text } from '
|
|
51
|
+
import { Text } from 'app-studio';
|
|
52
52
|
|
|
53
53
|
export const MultipleAccordion = () => {
|
|
54
54
|
return (
|
|
@@ -85,7 +85,7 @@ Different visual styles for the accordion.
|
|
|
85
85
|
```tsx
|
|
86
86
|
import React from 'react';
|
|
87
87
|
import { Accordion } from '../Accordion';
|
|
88
|
-
import { Text } from '
|
|
88
|
+
import { Text } from 'app-studio';
|
|
89
89
|
|
|
90
90
|
export const AccordionVariants = () => {
|
|
91
91
|
return (
|
|
@@ -126,7 +126,7 @@ Disable specific accordion items.
|
|
|
126
126
|
```tsx
|
|
127
127
|
import React from 'react';
|
|
128
128
|
import { Accordion } from '../Accordion';
|
|
129
|
-
import { Text } from '
|
|
129
|
+
import { Text } from 'app-studio';
|
|
130
130
|
|
|
131
131
|
export const DisabledAccordion = () => {
|
|
132
132
|
return (
|
|
@@ -96,7 +96,7 @@ The Alert component supports both light and dark themes through the `themeMode`
|
|
|
96
96
|
import React from 'react';
|
|
97
97
|
import { Alert } from '../Alert';
|
|
98
98
|
import { Vertical } from 'app-studio';
|
|
99
|
-
import { Text } from '
|
|
99
|
+
import { Text } from 'app-studio';
|
|
100
100
|
|
|
101
101
|
export const DarkModeDemo = () => {
|
|
102
102
|
return (
|
|
@@ -13,7 +13,7 @@ Creates a beautiful animated aurora gradient background effect.
|
|
|
13
13
|
```tsx
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { Background } from '../Background';
|
|
16
|
-
import { Text } from '
|
|
16
|
+
import { Text } from 'app-studio';
|
|
17
17
|
|
|
18
18
|
export const AuroraDemo = () => (
|
|
19
19
|
<Background.Aurora height="300px" showRadialGradient={true}>
|
|
@@ -30,7 +30,7 @@ Animated falling meteors effect with customizable count.
|
|
|
30
30
|
```tsx
|
|
31
31
|
import React from 'react';
|
|
32
32
|
import { Background } from '../Background';
|
|
33
|
-
import { Text } from '
|
|
33
|
+
import { Text } from 'app-studio';
|
|
34
34
|
|
|
35
35
|
export const MeteorsDemo = () => (
|
|
36
36
|
<Background.Meteors number={20} height="300px">
|
|
@@ -106,7 +106,7 @@ Display images as backgrounds with overlay support and blend modes.
|
|
|
106
106
|
```tsx
|
|
107
107
|
import React from 'react';
|
|
108
108
|
import { Background } from '../Background';
|
|
109
|
-
import { Text } from '
|
|
109
|
+
import { Text } from 'app-studio';
|
|
110
110
|
|
|
111
111
|
export const BackgroundImageDemo = () => (
|
|
112
112
|
<Background.Image
|
|
@@ -129,7 +129,7 @@ Create beautiful gradient backgrounds with animation support.
|
|
|
129
129
|
```tsx
|
|
130
130
|
import React from 'react';
|
|
131
131
|
import { Background } from '../Background';
|
|
132
|
-
import { Text } from '
|
|
132
|
+
import { Text } from 'app-studio';
|
|
133
133
|
|
|
134
134
|
// Simple two-color gradient
|
|
135
135
|
export const SimpleGradientDemo = () => (
|
|
@@ -228,7 +228,7 @@ Multiple background effects can be combined for rich visual experiences.
|
|
|
228
228
|
```tsx
|
|
229
229
|
import React from 'react';
|
|
230
230
|
import { Background } from '../Background';
|
|
231
|
-
import { Text } from '
|
|
231
|
+
import { Text } from 'app-studio';
|
|
232
232
|
import { Vertical, Horizontal } from 'app-studio';
|
|
233
233
|
|
|
234
234
|
// Aurora with content
|
|
@@ -182,7 +182,7 @@ The Badge component supports both light and dark themes through the `themeMode`
|
|
|
182
182
|
import React from 'react';
|
|
183
183
|
import { Badge } from '../Badge';
|
|
184
184
|
import { Vertical, Horizontal } from 'app-studio';
|
|
185
|
-
import { Text } from '
|
|
185
|
+
import { Text } from 'app-studio';
|
|
186
186
|
import { Variant } from '../Badge/Badge.type';
|
|
187
187
|
|
|
188
188
|
export const DarkModeDemo = () => {
|
|
@@ -114,6 +114,9 @@ Customize the appearance of calendar elements using the `views` prop.
|
|
|
114
114
|
| `onEventDrop` | `(event: CalendarEvent) => void` | Callback when an event is moved to a new date. | - |
|
|
115
115
|
| `onEventResize` | `(event: CalendarEvent) => void` | Callback when an event is resized. | - |
|
|
116
116
|
| `onEventAdd` | `(start: string, end: string) => void` | Callback when a date is double-clicked to add an event. | - |
|
|
117
|
+
| `onEventTitleChange` | `(event: CalendarEvent, newTitle: string) => void` | Callback when an event's title is changed. | - |
|
|
118
|
+
| `onEventDescriptionChange` | `(event: CalendarEvent, newDescription: string) => void` | Callback when an event's description is changed. | - |
|
|
119
|
+
| `onEventDelete` | `(event: CalendarEvent) => void` | Callback when an event is deleted. | - |
|
|
117
120
|
| `onDateClick` | `(date: string) => void` | Callback when a date is clicked. | - |
|
|
118
121
|
| `onDateChange` | `(date: Date) => void` | Callback when the visible date range changes. | - |
|
|
119
122
|
| `onViewChange` | `(view: CalendarView) => void` | Callback when the active view changes. | - |
|
package/docs/components/Card.mdx
CHANGED
|
@@ -11,7 +11,7 @@ A flexible container component for organizing and displaying content.
|
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Card } from '../Card';
|
|
14
|
-
import { Text } from '
|
|
14
|
+
import { Text } from 'app-studio';
|
|
15
15
|
|
|
16
16
|
export const DefaultDemo = () => {
|
|
17
17
|
return (
|
|
@@ -28,7 +28,7 @@ Different visual styles for the card.
|
|
|
28
28
|
```tsx
|
|
29
29
|
import React from 'react';
|
|
30
30
|
import { Card } from '../Card';
|
|
31
|
-
import { Text } from '
|
|
31
|
+
import { Text } from 'app-studio';
|
|
32
32
|
import { Vertical } from 'app-studio';
|
|
33
33
|
|
|
34
34
|
export const VariantsDemo = () => {
|
|
@@ -65,7 +65,7 @@ Using Card.Header, Card.Content, and Card.Footer for structured layout.
|
|
|
65
65
|
```tsx
|
|
66
66
|
import React from 'react';
|
|
67
67
|
import { Card } from '../Card';
|
|
68
|
-
import { Text } from '
|
|
68
|
+
import { Text } from 'app-studio';
|
|
69
69
|
import { Horizontal } from 'app-studio';
|
|
70
70
|
import { Button } from '../../Button/Button';
|
|
71
71
|
|
|
@@ -100,7 +100,7 @@ Different corner styles for the card.
|
|
|
100
100
|
```tsx
|
|
101
101
|
import React from 'react';
|
|
102
102
|
import { Card } from '../Card';
|
|
103
|
-
import { Text } from '
|
|
103
|
+
import { Text } from 'app-studio';
|
|
104
104
|
import { Vertical } from 'app-studio';
|
|
105
105
|
import { Shape } from '../Card/Card.type';
|
|
106
106
|
|
|
@@ -128,7 +128,7 @@ Different padding sizes for the card.
|
|
|
128
128
|
```tsx
|
|
129
129
|
import React from 'react';
|
|
130
130
|
import { Card } from '../Card';
|
|
131
|
-
import { Text } from '
|
|
131
|
+
import { Text } from 'app-studio';
|
|
132
132
|
import { Vertical } from 'app-studio';
|
|
133
133
|
import { Size } from '../Card/Card.type';
|
|
134
134
|
|
|
@@ -156,7 +156,7 @@ Customize the appearance of the card.
|
|
|
156
156
|
```tsx
|
|
157
157
|
import React from 'react';
|
|
158
158
|
import { Card } from '../Card';
|
|
159
|
-
import { Text } from '
|
|
159
|
+
import { Text } from 'app-studio';
|
|
160
160
|
import { Horizontal } from 'app-studio';
|
|
161
161
|
import { Button } from '../../Button/Button';
|
|
162
162
|
|
|
@@ -215,7 +215,7 @@ The Card component uses a context-based styling system that allows styles to be
|
|
|
215
215
|
```tsx
|
|
216
216
|
import React from 'react';
|
|
217
217
|
import { Card } from '../Card';
|
|
218
|
-
import { Text } from '
|
|
218
|
+
import { Text } from 'app-studio';
|
|
219
219
|
import { Button } from '../../Button/Button';
|
|
220
220
|
import { Horizontal } from 'app-studio';
|
|
221
221
|
|
|
@@ -275,7 +275,7 @@ The Card component supports both light and dark themes through the `themeMode` p
|
|
|
275
275
|
```tsx
|
|
276
276
|
import React from 'react';
|
|
277
277
|
import { Card } from '../Card';
|
|
278
|
-
import { Text } from '
|
|
278
|
+
import { Text } from 'app-studio';
|
|
279
279
|
import { Horizontal, Vertical } from 'app-studio';
|
|
280
280
|
import { Button } from '../../Button/Button';
|
|
281
281
|
|
|
@@ -15,7 +15,7 @@ A component for displaying a series of content items that can be navigated throu
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Carousel } from '../Carousel';
|
|
17
17
|
import { View } from 'app-studio';
|
|
18
|
-
import { Text } from '
|
|
18
|
+
import { Text } from 'app-studio';
|
|
19
19
|
|
|
20
20
|
export const DefaultDemo = () => {
|
|
21
21
|
// Create an array of slides with different background colors
|
|
@@ -56,7 +56,7 @@ Use the compound component pattern for more flexibility and control over the car
|
|
|
56
56
|
import React from 'react';
|
|
57
57
|
import { Carousel } from '../Carousel';
|
|
58
58
|
import { View } from 'app-studio';
|
|
59
|
-
import { Text } from '
|
|
59
|
+
import { Text } from 'app-studio';
|
|
60
60
|
|
|
61
61
|
export const CompoundDemo = () => {
|
|
62
62
|
const slides = [
|
|
@@ -182,7 +182,7 @@ Automatically advance through slides with customizable interval.
|
|
|
182
182
|
import React from 'react';
|
|
183
183
|
import { Carousel } from '../Carousel';
|
|
184
184
|
import { View } from 'app-studio';
|
|
185
|
-
import { Text } from '
|
|
185
|
+
import { Text } from 'app-studio';
|
|
186
186
|
|
|
187
187
|
export const AutoPlayDemo = () => {
|
|
188
188
|
const slides = [
|
|
@@ -226,7 +226,7 @@ Different styles of indicators to show the current slide position.
|
|
|
226
226
|
import React from 'react';
|
|
227
227
|
import { Carousel } from '../Carousel';
|
|
228
228
|
import { View } from 'app-studio';
|
|
229
|
-
import { Text } from '
|
|
229
|
+
import { Text } from 'app-studio';
|
|
230
230
|
|
|
231
231
|
export const IndicatorsDemo = () => {
|
|
232
232
|
const slides = [
|
|
@@ -269,7 +269,7 @@ Customize the navigation controls.
|
|
|
269
269
|
import React from 'react';
|
|
270
270
|
import { Carousel } from '../Carousel';
|
|
271
271
|
import { View } from 'app-studio';
|
|
272
|
-
import { Text } from '
|
|
272
|
+
import { Text } from 'app-studio';
|
|
273
273
|
import { Button } from '../../Button/Button';
|
|
274
274
|
|
|
275
275
|
export const NavigationDemo = () => {
|
|
@@ -322,7 +322,7 @@ Customize the appearance of the carousel.
|
|
|
322
322
|
import React from 'react';
|
|
323
323
|
import { Carousel } from '../Carousel';
|
|
324
324
|
import { View } from 'app-studio';
|
|
325
|
-
import { Text } from '
|
|
325
|
+
import { Text } from 'app-studio';
|
|
326
326
|
import { Card } from '../../Card/Card';
|
|
327
327
|
|
|
328
328
|
export const CustomDemo = () => {
|
|
@@ -122,7 +122,7 @@ import React, { useState } from 'react';
|
|
|
122
122
|
import { Vertical, Horizontal } from 'app-studio';
|
|
123
123
|
import { ColorInput } from '../ColorInput';
|
|
124
124
|
import { Button } from '../../Button/Button';
|
|
125
|
-
import { Text } from '
|
|
125
|
+
import { Text } from 'app-studio';
|
|
126
126
|
|
|
127
127
|
export const ColorInputForm = () => {
|
|
128
128
|
const [backgroundColor, setBackgroundColor] = useState('color.blue.500');
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
A drawer is a panel that slides out from the edge of the screen. It can be useful when you need users to complete a task or view some details without leaving the current page.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { Drawer } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React, { useState } from 'react';
|
|
13
|
+
import { Drawer } from '../Drawer';
|
|
14
|
+
import { Button } from '../Button';
|
|
15
|
+
import { Vertical } from 'app-studio';
|
|
16
|
+
|
|
17
|
+
export const DefaultDrawer = () => {
|
|
18
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Button onClick={() => setIsOpen(true)}>Open Drawer</Button>
|
|
23
|
+
<Drawer isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
24
|
+
<Drawer.Header>Drawer Title</Drawer.Header>
|
|
25
|
+
<Drawer.Body>
|
|
26
|
+
<p>This is the content of the drawer.</p>
|
|
27
|
+
</Drawer.Body>
|
|
28
|
+
<Drawer.Footer>
|
|
29
|
+
<Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
30
|
+
</Drawer.Footer>
|
|
31
|
+
</Drawer>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### **Placement**
|
|
38
|
+
The `placement` prop determines which side of the screen the drawer will appear from. It can be `top`, `right`, `bottom`, or `left`.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import React, { useState } from 'react';
|
|
42
|
+
import { Drawer } from '../Drawer';
|
|
43
|
+
import { Button } from '../Button';
|
|
44
|
+
import { Horizontal } from 'app-studio';
|
|
45
|
+
|
|
46
|
+
export const PlacementDrawer = () => {
|
|
47
|
+
const [placement, setPlacement] = useState('right');
|
|
48
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
49
|
+
|
|
50
|
+
const openDrawer = (p) => {
|
|
51
|
+
setPlacement(p);
|
|
52
|
+
setIsOpen(true);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Horizontal gap={10}>
|
|
57
|
+
<Button onClick={() => openDrawer('top')}>Top</Button>
|
|
58
|
+
<Button onClick={() => openDrawer('right')}>Right</Button>
|
|
59
|
+
<Button onClick={() => openDrawer('bottom')}>Bottom</Button>
|
|
60
|
+
<Button onClick={() => openDrawer('left')}>Left</Button>
|
|
61
|
+
<Drawer isOpen={isOpen} onClose={() => setIsOpen(false)} placement={placement}>
|
|
62
|
+
<Drawer.Header>Drawer Title</Drawer.Header>
|
|
63
|
+
<Drawer.Body>
|
|
64
|
+
<p>This is the content of the drawer.</p>
|
|
65
|
+
</Drawer.Body>
|
|
66
|
+
</Drawer>
|
|
67
|
+
</Horizontal>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### **Size**
|
|
73
|
+
The `size` prop controls the width or height of the drawer, depending on the placement.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import React, { useState } from 'react';
|
|
77
|
+
import { Drawer } from '../Drawer';
|
|
78
|
+
import { Button } from '../Button';
|
|
79
|
+
import { Horizontal } from 'app-studio';
|
|
80
|
+
|
|
81
|
+
export const SizeDrawer = () => {
|
|
82
|
+
const [size, setSize] = useState('md');
|
|
83
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
84
|
+
|
|
85
|
+
const openDrawer = (s) => {
|
|
86
|
+
setSize(s);
|
|
87
|
+
setIsOpen(true);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<Horizontal gap={10}>
|
|
92
|
+
<Button onClick={() => openDrawer('xs')}>xs</Button>
|
|
93
|
+
<Button onClick={() => openDrawer('sm')}>sm</Button>
|
|
94
|
+
<Button onClick={() => openDrawer('md')}>md</Button>
|
|
95
|
+
<Button onClick={() => openDrawer('lg')}>lg</Button>
|
|
96
|
+
<Button onClick={() => openDrawer('xl')}>xl</Button>
|
|
97
|
+
<Drawer isOpen={isOpen} onClose={() => setIsOpen(false)} size={size}>
|
|
98
|
+
<Drawer.Header>Drawer Title</Drawer.Header>
|
|
99
|
+
<Drawer.Body>
|
|
100
|
+
<p>This is the content of the drawer.</p>
|
|
101
|
+
</Drawer.Body>
|
|
102
|
+
</Drawer>
|
|
103
|
+
</Horizontal>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### **Prevent Closing**
|
|
109
|
+
The `isClosePrevented` prop prevents the drawer from closing when the overlay is clicked.
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import React, { useState } from 'react';
|
|
113
|
+
import { Drawer } from '../Drawer';
|
|
114
|
+
import { Button } from '../Button';
|
|
115
|
+
|
|
116
|
+
export const PreventCloseDrawer = () => {
|
|
117
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<Button onClick={() => setIsOpen(true)}>Open Drawer</Button>
|
|
122
|
+
<Drawer isOpen={isOpen} onClose={() => setIsOpen(false)} isClosePrevented>
|
|
123
|
+
<Drawer.Header>Drawer Title</Drawer.Header>
|
|
124
|
+
<Drawer.Body>
|
|
125
|
+
<p>This drawer cannot be closed by clicking the overlay.</p>
|
|
126
|
+
</Drawer.Body>
|
|
127
|
+
<Drawer.Footer>
|
|
128
|
+
<Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
129
|
+
</Drawer.Footer>
|
|
130
|
+
</Drawer>
|
|
131
|
+
</>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### **Props**
|
|
137
|
+
|
|
138
|
+
#### **Drawer**
|
|
139
|
+
| Prop | Type | Default | Description |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| `placement` | `top` \| `right` \| `bottom` \| `left` | `right` | The placement of the drawer. |
|
|
142
|
+
| `size` | `xs` \| `sm` \| `md` \| `lg` \| `xl` | `md` | The size of the drawer. |
|
|
143
|
+
| `isOpen` | `boolean` | - | If `true`, the drawer will be open. |
|
|
144
|
+
| `onClose` | `() => void` | - | Callback fired when the drawer closes. |
|
|
145
|
+
| `isClosePrevented` | `boolean` | `false` | If `true`, the drawer will not close when clicking the overlay. |
|
|
146
|
+
| `children` | `React.ReactNode` | - | The children of the drawer. |
|
|
147
|
+
|
|
148
|
+
#### **Drawer.Header**
|
|
149
|
+
| Prop | Type | Default | Description |
|
|
150
|
+
| --- | --- | --- | --- |
|
|
151
|
+
| `onClose` | `() => void` | - | Callback fired when the close button is clicked. |
|
|
152
|
+
| `buttonPosition` | `left` \| `right` | `right` | The position of the close button. |
|
|
153
|
+
| `children` | `React.ReactNode` | - | The content of the drawer header. |
|
|
154
|
+
|
|
155
|
+
#### **Drawer.Body**
|
|
156
|
+
| Prop | Type | Default | Description |
|
|
157
|
+
| --- | --- | --- | --- |
|
|
158
|
+
| `children` | `React.ReactNode` | - | The content of the drawer body. |
|
|
159
|
+
|
|
160
|
+
#### **Drawer.Footer**
|
|
161
|
+
| Prop | Type | Default | Description |
|
|
162
|
+
| --- | --- | --- | --- |
|
|
163
|
+
| `children` | `React.ReactNode` | - | The content of the drawer footer. |
|
|
164
|
+
|
|
@@ -29,7 +29,7 @@ Specifies the type of gradient to render.
|
|
|
29
29
|
import React from 'react';
|
|
30
30
|
import { Gradient } from '../Gradient';
|
|
31
31
|
import { Vertical } from 'app-studio';
|
|
32
|
-
import { Text } from '
|
|
32
|
+
import { Text } from 'app-studio';
|
|
33
33
|
|
|
34
34
|
export const TypesDemo = () => (
|
|
35
35
|
<Vertical gap={16}>
|
|
@@ -82,7 +82,7 @@ import React from 'react';
|
|
|
82
82
|
import { Gradient } from '../Gradient';
|
|
83
83
|
import { Vertical } from 'app-studio';
|
|
84
84
|
import { Horizontal } from 'app-studio';
|
|
85
|
-
import { Text } from '
|
|
85
|
+
import { Text } from 'app-studio';
|
|
86
86
|
|
|
87
87
|
export const DirectionsDemo = () => (
|
|
88
88
|
<Vertical gap={16}>
|
|
@@ -130,7 +130,7 @@ Specifies an array of color stops for multi-color gradients.
|
|
|
130
130
|
import React from 'react';
|
|
131
131
|
import { Gradient } from '../Gradient';
|
|
132
132
|
import { Vertical } from 'app-studio';
|
|
133
|
-
import { Text } from '
|
|
133
|
+
import { Text } from 'app-studio';
|
|
134
134
|
|
|
135
135
|
export const MulticolorDemo = () => (
|
|
136
136
|
<Vertical gap={16}>
|
|
@@ -178,7 +178,7 @@ Enables animation for the gradient.
|
|
|
178
178
|
import React from 'react';
|
|
179
179
|
import { Gradient } from '../Gradient';
|
|
180
180
|
import { Vertical } from 'app-studio';
|
|
181
|
-
import { Text } from '
|
|
181
|
+
import { Text } from 'app-studio';
|
|
182
182
|
|
|
183
183
|
export const AnimatedDemo = () => (
|
|
184
184
|
<Vertical gap={16}>
|
|
@@ -207,7 +207,7 @@ Content to render inside the gradient.
|
|
|
207
207
|
import React from 'react';
|
|
208
208
|
import { Gradient } from '../Gradient';
|
|
209
209
|
import { Vertical } from 'app-studio';
|
|
210
|
-
import { Text } from '
|
|
210
|
+
import { Text } from 'app-studio';
|
|
211
211
|
import { Button } from '../../Button/Button';
|
|
212
212
|
import { Center } from 'app-studio';
|
|
213
213
|
|
|
@@ -241,7 +241,7 @@ Custom styling that overrides default views.
|
|
|
241
241
|
import React from 'react';
|
|
242
242
|
import { Gradient } from '../Gradient';
|
|
243
243
|
import { Center } from 'app-studio';
|
|
244
|
-
import { Text } from '
|
|
244
|
+
import { Text } from 'app-studio';
|
|
245
245
|
|
|
246
246
|
export const StylesDemo = () => (
|
|
247
247
|
<Gradient
|
|
@@ -12,7 +12,7 @@ A floating card that appears when hovering over a trigger element. Supports conf
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { HoverCard } from '../HoverCard';
|
|
14
14
|
import { Button } from '../../Button/Button';
|
|
15
|
-
import { Text } from '
|
|
15
|
+
import { Text } from 'app-studio';
|
|
16
16
|
|
|
17
17
|
export const DefaultHoverCard = () => {
|
|
18
18
|
return (
|
|
@@ -37,7 +37,7 @@ You can control the position of the HoverCard content using the `side` and `alig
|
|
|
37
37
|
import React from 'react';
|
|
38
38
|
import { HoverCard } from '../HoverCard';
|
|
39
39
|
import { Button } from '../../Button/Button';
|
|
40
|
-
import { Text } from '
|
|
40
|
+
import { Text } from 'app-studio';
|
|
41
41
|
|
|
42
42
|
export const PositionedHoverCard = () => {
|
|
43
43
|
return (
|
|
@@ -62,7 +62,7 @@ You can customize the appearance of the HoverCard using the `views` prop.
|
|
|
62
62
|
import React from 'react';
|
|
63
63
|
import { HoverCard } from '../HoverCard';
|
|
64
64
|
import { Button } from '../../Button/Button';
|
|
65
|
-
import { Text } from '
|
|
65
|
+
import { Text } from 'app-studio';
|
|
66
66
|
|
|
67
67
|
export const StyledHoverCard = () => {
|
|
68
68
|
return (
|
|
@@ -96,7 +96,7 @@ You can control the timing of when the HoverCard opens and closes using the `ope
|
|
|
96
96
|
import React from 'react';
|
|
97
97
|
import { HoverCard } from '../HoverCard';
|
|
98
98
|
import { Button } from '../../Button/Button';
|
|
99
|
-
import { Text } from '
|
|
99
|
+
import { Text } from 'app-studio';
|
|
100
100
|
|
|
101
101
|
export const DelayedHoverCard = () => {
|
|
102
102
|
return (
|
|
@@ -121,7 +121,7 @@ You can use the `asChild` prop on the Trigger to apply hover behavior directly t
|
|
|
121
121
|
import React from 'react';
|
|
122
122
|
import { HoverCard } from '../HoverCard';
|
|
123
123
|
import { Link } from '../../Link/Link';
|
|
124
|
-
import { Text } from '
|
|
124
|
+
import { Text } from 'app-studio';
|
|
125
125
|
|
|
126
126
|
export const LinkHoverCard = () => {
|
|
127
127
|
return (
|
|
@@ -2,12 +2,23 @@
|
|
|
2
2
|
|
|
3
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
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
|
+
|
|
5
12
|
### **Import**
|
|
6
13
|
```tsx
|
|
7
14
|
import { KanbanBoard } from '@app-studio/web';
|
|
8
15
|
```
|
|
9
16
|
|
|
10
17
|
### **Default**
|
|
18
|
+
A basic Kanban board with three columns and some cards.
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
11
22
|
```tsx
|
|
12
23
|
import React, { useState } from 'react';
|
|
13
24
|
import { KanbanBoard } from '../KanbanBoard';
|
|
@@ -44,7 +55,9 @@ export const DefaultKanbanBoard = () => {
|
|
|
44
55
|
```
|
|
45
56
|
|
|
46
57
|
### **Custom Card Rendering**
|
|
47
|
-
Customize how cards are displayed using the `renderCard` prop.
|
|
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
|
+

|
|
48
61
|
|
|
49
62
|
```tsx
|
|
50
63
|
import React, { useState } from 'react';
|
|
@@ -109,12 +122,129 @@ export const CustomRenderKanbanBoard = () => {
|
|
|
109
122
|
};
|
|
110
123
|
```
|
|
111
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 '../KanbanBoard';
|
|
133
|
+
import { Button } from '../Button';
|
|
134
|
+
import { KanbanBoardColumn, KanbanBoardCard } from '../KanbanBoard/KanbanBoard.props';
|
|
135
|
+
import { View, Text, Horizontal } from 'app-studio';
|
|
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 '../KanbanBoard';
|
|
178
|
+
import { KanbanBoardColumn, KanbanBoardCard } from '../KanbanBoard/KanbanBoard.props';
|
|
179
|
+
import { Input, Text } from 'app-studio';
|
|
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
|
+
|
|
112
235
|
## Props
|
|
113
236
|
|
|
114
237
|
| Prop | Type | Description | Default |
|
|
115
238
|
| --- | --- | --- | --- |
|
|
116
239
|
| `columns` | `KanbanBoardColumn[]` | Array of columns to display. | `[]` |
|
|
117
|
-
| `onChange` | `(columns: KanbanBoardColumn[]) => void` | Callback when columns or cards are changed. | - |
|
|
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. | - |
|
|
118
248
|
| `renderCard` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => React.ReactNode` | Custom render method for cards. | - |
|
|
119
249
|
| `renderColumnHeader` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for column headers. | - |
|
|
120
250
|
| `renderEmptyState` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for empty column state. | - |
|