@app-studio/web 0.9.34 → 0.9.36
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/Calendar/Calendar/Calendar.style.d.ts +4 -0
- package/dist/components/OKR/OKR/OKR.props.d.ts +72 -0
- package/dist/components/OKR/OKR/OKR.style.d.ts +19 -0
- package/dist/components/OKR/OKR/OKR.view.d.ts +4 -0
- package/dist/components/OKR/OKR.d.ts +4 -0
- package/dist/components/index.d.ts +4 -3
- package/dist/pages/okr.page.d.ts +3 -0
- package/dist/web.cjs.development.js +595 -760
- 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 +595 -760
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +598 -762
- 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/README.md +2 -1
- package/docs/components/Calendar.mdx +22 -110
- package/docs/components/Flow.mdx +1 -0
- package/docs/components/KanbanBoard.mdx +156 -0
- package/docs/components/OKR.mdx +475 -0
- package/docs/components/Title.mdx +1 -0
- package/docs/components/Tree.mdx +1 -0
- package/docs/components.md +178 -0
- package/package.json +1 -1
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.props.d.ts +0 -51
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.style.d.ts +0 -90
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.utils.d.ts +0 -51
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.view.d.ts +0 -3
- package/dist/components/CalendarWeek/CalendarWeek.d.ts +0 -1
- package/docs/api-reference/README.md +0 -103
- package/docs/api-reference/data-display/flow.md +0 -220
- package/docs/api-reference/data-display/tree.md +0 -210
- package/docs/api-reference/form/chat-input.md +0 -206
- package/docs/api-reference/utility/button.md +0 -145
- package/docs/api-reference/utility/title.md +0 -301
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# OKR
|
|
4
|
+
|
|
5
|
+
The OKR (Objectives and Key Results) component is used for displaying and tracking organizational objectives and their associated key results. It provides a comprehensive view of progress, status, and ownership for strategic goals.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
import { OKR } from '@app-studio/web';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| ---- | ---- | ------- | ----------- |
|
|
17
|
+
| objectives | OKRObjective[] | **required** | Array of objectives to display |
|
|
18
|
+
| themeMode | 'light' \| 'dark' | 'light' | Theme mode for the component |
|
|
19
|
+
| views | OKRViews | undefined | Custom styling for different parts of the component |
|
|
20
|
+
| onKeyResultClick | (keyResult: OKRKeyResult, objective: OKRObjective) => void | undefined | Callback when a key result is clicked |
|
|
21
|
+
| renderObjectiveFooter | (objective: OKRObjective) => ReactNode | undefined | Custom footer renderer for objectives |
|
|
22
|
+
| renderKeyResultFooter | (keyResult: OKRKeyResult, objective: OKRObjective) => ReactNode | undefined | Custom footer renderer for key results |
|
|
23
|
+
|
|
24
|
+
## Type Definitions
|
|
25
|
+
|
|
26
|
+
### OKRStatus
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
type OKRStatus =
|
|
30
|
+
| 'notStarted' // No progress made (0%)
|
|
31
|
+
| 'onTrack' // Good progress (70-99%)
|
|
32
|
+
| 'atRisk' // Moderate progress (40-69%)
|
|
33
|
+
| 'offTrack' // Poor progress (1-39%)
|
|
34
|
+
| 'achieved'; // Goal completed (100%)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### OKRObjective
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
interface OKRObjective {
|
|
41
|
+
id: string; // Unique identifier
|
|
42
|
+
title: string; // Objective title
|
|
43
|
+
description?: string; // Objective description
|
|
44
|
+
owner?: string; // Person responsible
|
|
45
|
+
timeframe?: string; // Time period (e.g., "Q4 2025")
|
|
46
|
+
tags?: string[]; // Category tags
|
|
47
|
+
progress?: number; // Overall progress (0-100)
|
|
48
|
+
status?: OKRStatus; // Current status
|
|
49
|
+
keyResults: OKRKeyResult[]; // Associated key results
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### OKRKeyResult
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
interface OKRKeyResult {
|
|
57
|
+
id: string; // Unique identifier
|
|
58
|
+
title: string; // Key result title
|
|
59
|
+
description?: string; // Key result description
|
|
60
|
+
progress?: number; // Progress percentage (0-100)
|
|
61
|
+
metric?: string; // Measurement metric
|
|
62
|
+
target?: string; // Target value
|
|
63
|
+
current?: string; // Current value
|
|
64
|
+
owner?: string; // Person responsible
|
|
65
|
+
status?: OKRStatus; // Current status
|
|
66
|
+
confidence?: 'low' | 'medium' | 'high'; // Confidence level
|
|
67
|
+
lastUpdated?: string; // Last update timestamp
|
|
68
|
+
tags?: string[]; // Category tags
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
### Basic Usage
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
import React from 'react';
|
|
78
|
+
import { OKR } from '@app-studio/web';
|
|
79
|
+
|
|
80
|
+
export const BasicOKR = () => {
|
|
81
|
+
const objectives = [
|
|
82
|
+
{
|
|
83
|
+
id: '1',
|
|
84
|
+
title: 'Launch New Feature',
|
|
85
|
+
description: 'Successfully launch the new feature to all users.',
|
|
86
|
+
owner: 'John Doe',
|
|
87
|
+
timeframe: 'Q4 2025',
|
|
88
|
+
tags: ['new-feature', 'launch'],
|
|
89
|
+
progress: 50,
|
|
90
|
+
status: 'onTrack',
|
|
91
|
+
keyResults: [
|
|
92
|
+
{
|
|
93
|
+
id: '1.1',
|
|
94
|
+
title: 'Complete development',
|
|
95
|
+
progress: 80,
|
|
96
|
+
status: 'onTrack',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: '1.2',
|
|
100
|
+
title: 'Complete QA testing',
|
|
101
|
+
progress: 40,
|
|
102
|
+
status: 'atRisk',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: '1.3',
|
|
106
|
+
title: 'Reach 10,000 active users',
|
|
107
|
+
progress: 10,
|
|
108
|
+
status: 'offTrack',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
return <OKR objectives={objectives} />;
|
|
115
|
+
};
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### With Detailed Key Results
|
|
119
|
+
|
|
120
|
+
```jsx
|
|
121
|
+
import React from 'react';
|
|
122
|
+
import { OKR } from '@app-studio/web';
|
|
123
|
+
|
|
124
|
+
export const DetailedOKR = () => {
|
|
125
|
+
const objectives = [
|
|
126
|
+
{
|
|
127
|
+
id: '2',
|
|
128
|
+
title: 'Improve Customer Satisfaction',
|
|
129
|
+
description: 'Increase customer satisfaction scores by 20%',
|
|
130
|
+
owner: 'Jane Smith',
|
|
131
|
+
timeframe: 'Q1 2026',
|
|
132
|
+
tags: ['customer-experience', 'support'],
|
|
133
|
+
keyResults: [
|
|
134
|
+
{
|
|
135
|
+
id: '2.1',
|
|
136
|
+
title: 'Reduce support ticket response time',
|
|
137
|
+
description: 'Decrease average response time from 4h to 2h',
|
|
138
|
+
progress: 65,
|
|
139
|
+
metric: 'Average Response Time',
|
|
140
|
+
current: '2.5h',
|
|
141
|
+
target: '2h',
|
|
142
|
+
owner: 'Support Team',
|
|
143
|
+
status: 'onTrack',
|
|
144
|
+
confidence: 'high',
|
|
145
|
+
lastUpdated: '2 days ago',
|
|
146
|
+
tags: ['support', 'efficiency'],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: '2.2',
|
|
150
|
+
title: 'Increase NPS score',
|
|
151
|
+
description: 'Improve Net Promoter Score from 40 to 50',
|
|
152
|
+
progress: 30,
|
|
153
|
+
metric: 'NPS Score',
|
|
154
|
+
current: '43',
|
|
155
|
+
target: '50',
|
|
156
|
+
owner: 'Customer Success',
|
|
157
|
+
status: 'atRisk',
|
|
158
|
+
confidence: 'medium',
|
|
159
|
+
lastUpdated: '1 week ago',
|
|
160
|
+
tags: ['nps', 'metrics'],
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
return <OKR objectives={objectives} themeMode="dark" />;
|
|
167
|
+
};
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### With Click Handlers
|
|
171
|
+
|
|
172
|
+
```jsx
|
|
173
|
+
import React from 'react';
|
|
174
|
+
import { OKR } from '@app-studio/web';
|
|
175
|
+
|
|
176
|
+
export const InteractiveOKR = () => {
|
|
177
|
+
const objectives = [
|
|
178
|
+
{
|
|
179
|
+
id: '3',
|
|
180
|
+
title: 'Increase Revenue',
|
|
181
|
+
owner: 'Sales Team',
|
|
182
|
+
timeframe: 'Q2 2026',
|
|
183
|
+
keyResults: [
|
|
184
|
+
{
|
|
185
|
+
id: '3.1',
|
|
186
|
+
title: 'Close 50 new enterprise deals',
|
|
187
|
+
progress: 40,
|
|
188
|
+
current: '20',
|
|
189
|
+
target: '50',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
];
|
|
194
|
+
|
|
195
|
+
const handleKeyResultClick = (keyResult, objective) => {
|
|
196
|
+
console.log('Clicked key result:', keyResult.title);
|
|
197
|
+
console.log('From objective:', objective.title);
|
|
198
|
+
// Navigate to detail view, open modal, etc.
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<OKR
|
|
203
|
+
objectives={objectives}
|
|
204
|
+
onKeyResultClick={handleKeyResultClick}
|
|
205
|
+
/>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### With Custom Footers
|
|
211
|
+
|
|
212
|
+
```jsx
|
|
213
|
+
import React from 'react';
|
|
214
|
+
import { OKR, Button, Horizontal } from '@app-studio/web';
|
|
215
|
+
|
|
216
|
+
export const OKRWithFooters = () => {
|
|
217
|
+
const objectives = [
|
|
218
|
+
{
|
|
219
|
+
id: '4',
|
|
220
|
+
title: 'Expand Market Presence',
|
|
221
|
+
owner: 'Marketing',
|
|
222
|
+
timeframe: 'Q3 2026',
|
|
223
|
+
keyResults: [
|
|
224
|
+
{
|
|
225
|
+
id: '4.1',
|
|
226
|
+
title: 'Launch in 3 new regions',
|
|
227
|
+
progress: 33,
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<OKR
|
|
235
|
+
objectives={objectives}
|
|
236
|
+
renderObjectiveFooter={(objective) => (
|
|
237
|
+
<Horizontal gap={8}>
|
|
238
|
+
<Button size="sm" variant="outline">View Details</Button>
|
|
239
|
+
<Button size="sm" variant="ghost">Edit</Button>
|
|
240
|
+
</Horizontal>
|
|
241
|
+
)}
|
|
242
|
+
renderKeyResultFooter={(keyResult, objective) => (
|
|
243
|
+
<Horizontal gap={8}>
|
|
244
|
+
<Button size="sm" variant="link">Update Progress</Button>
|
|
245
|
+
<Button size="sm" variant="link">Add Comment</Button>
|
|
246
|
+
</Horizontal>
|
|
247
|
+
)}
|
|
248
|
+
/>
|
|
249
|
+
);
|
|
250
|
+
};
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Auto-calculated Progress
|
|
254
|
+
|
|
255
|
+
If you don't specify an objective's progress, it will be automatically calculated as the average of its key results:
|
|
256
|
+
|
|
257
|
+
```jsx
|
|
258
|
+
import React from 'react';
|
|
259
|
+
import { OKR } from '@app-studio/web';
|
|
260
|
+
|
|
261
|
+
export const AutoProgressOKR = () => {
|
|
262
|
+
const objectives = [
|
|
263
|
+
{
|
|
264
|
+
id: '5',
|
|
265
|
+
title: 'Improve Engineering Efficiency',
|
|
266
|
+
// No progress specified - will be auto-calculated
|
|
267
|
+
keyResults: [
|
|
268
|
+
{ id: '5.1', title: 'Reduce build time by 50%', progress: 70 },
|
|
269
|
+
{ id: '5.2', title: 'Increase test coverage to 90%', progress: 60 },
|
|
270
|
+
{ id: '5.3', title: 'Automate deployment process', progress: 80 },
|
|
271
|
+
],
|
|
272
|
+
// Objective progress will be: (70 + 60 + 80) / 3 = 70%
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
return <OKR objectives={objectives} />;
|
|
277
|
+
};
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Customization
|
|
281
|
+
|
|
282
|
+
The OKR component can be extensively customized using the `views` prop:
|
|
283
|
+
|
|
284
|
+
```jsx
|
|
285
|
+
<OKR
|
|
286
|
+
objectives={objectives}
|
|
287
|
+
views={{
|
|
288
|
+
// Main container
|
|
289
|
+
container: { /* ViewProps */ },
|
|
290
|
+
|
|
291
|
+
// Objective card styling
|
|
292
|
+
objectiveCard: { /* ViewProps */ },
|
|
293
|
+
objectiveHeader: { /* ViewProps */ },
|
|
294
|
+
objectiveTitle: { /* TextProps */ },
|
|
295
|
+
objectiveDescription: { /* TextProps */ },
|
|
296
|
+
objectiveMeta: { /* ViewProps */ },
|
|
297
|
+
objectiveOwner: { /* TextProps */ },
|
|
298
|
+
objectiveTimeframe: { /* TextProps */ },
|
|
299
|
+
objectiveTags: { /* ViewProps */ },
|
|
300
|
+
objectiveProgressSection: { /* ViewProps */ },
|
|
301
|
+
objectiveProgressLabel: { /* TextProps */ },
|
|
302
|
+
objectiveProgressValue: { /* TextProps */ },
|
|
303
|
+
objectiveProgressBar: { /* ProgressBarStyles */ },
|
|
304
|
+
objectiveStatus: { /* StatusIndicatorStyles */ },
|
|
305
|
+
|
|
306
|
+
// Tag styling
|
|
307
|
+
tag: { /* ViewProps */ },
|
|
308
|
+
tagText: { /* TextProps */ },
|
|
309
|
+
|
|
310
|
+
// Key result styling
|
|
311
|
+
keyResultList: { /* ViewProps */ },
|
|
312
|
+
keyResultItem: { /* ViewProps */ },
|
|
313
|
+
keyResultHeader: { /* ViewProps */ },
|
|
314
|
+
keyResultTitle: { /* TextProps */ },
|
|
315
|
+
keyResultDescription: { /* TextProps */ },
|
|
316
|
+
keyResultMeta: { /* ViewProps */ },
|
|
317
|
+
keyResultOwner: { /* TextProps */ },
|
|
318
|
+
keyResultStatus: { /* StatusIndicatorStyles */ },
|
|
319
|
+
keyResultTags: { /* ViewProps */ },
|
|
320
|
+
keyResultTag: { /* ViewProps */ },
|
|
321
|
+
keyResultTagText: { /* TextProps */ },
|
|
322
|
+
keyResultProgressSection: { /* ViewProps */ },
|
|
323
|
+
keyResultProgressValue: { /* TextProps */ },
|
|
324
|
+
keyResultProgressBar: { /* ProgressBarStyles */ },
|
|
325
|
+
|
|
326
|
+
// Footer styling
|
|
327
|
+
footer: { /* ViewProps */ },
|
|
328
|
+
}}
|
|
329
|
+
/>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Custom Styling Example
|
|
333
|
+
|
|
334
|
+
```jsx
|
|
335
|
+
import React from 'react';
|
|
336
|
+
import { OKR } from '@app-studio/web';
|
|
337
|
+
|
|
338
|
+
export const CustomStyledOKR = () => {
|
|
339
|
+
const objectives = [
|
|
340
|
+
{
|
|
341
|
+
id: '6',
|
|
342
|
+
title: 'Custom Styled Objective',
|
|
343
|
+
keyResults: [
|
|
344
|
+
{ id: '6.1', title: 'Key Result 1', progress: 75 },
|
|
345
|
+
],
|
|
346
|
+
},
|
|
347
|
+
];
|
|
348
|
+
|
|
349
|
+
return (
|
|
350
|
+
<OKR
|
|
351
|
+
objectives={objectives}
|
|
352
|
+
views={{
|
|
353
|
+
objectiveCard: {
|
|
354
|
+
backgroundColor: 'color.blue.50',
|
|
355
|
+
borderColor: 'color.blue.300',
|
|
356
|
+
borderRadius: 20,
|
|
357
|
+
},
|
|
358
|
+
objectiveTitle: {
|
|
359
|
+
color: 'color.blue.800',
|
|
360
|
+
size: 'xl',
|
|
361
|
+
},
|
|
362
|
+
keyResultItem: {
|
|
363
|
+
backgroundColor: 'color.blue.100',
|
|
364
|
+
borderRadius: 16,
|
|
365
|
+
},
|
|
366
|
+
}}
|
|
367
|
+
/>
|
|
368
|
+
);
|
|
369
|
+
};
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Status Derivation
|
|
373
|
+
|
|
374
|
+
If a status is not explicitly provided, it will be automatically derived from the progress value:
|
|
375
|
+
|
|
376
|
+
| Progress | Derived Status |
|
|
377
|
+
| -------- | -------------- |
|
|
378
|
+
| 0% | `notStarted` |
|
|
379
|
+
| 1-39% | `offTrack` |
|
|
380
|
+
| 40-69% | `atRisk` |
|
|
381
|
+
| 70-99% | `onTrack` |
|
|
382
|
+
| 100% | `achieved` |
|
|
383
|
+
|
|
384
|
+
## Status Indicators
|
|
385
|
+
|
|
386
|
+
Each status is displayed with a corresponding visual indicator:
|
|
387
|
+
|
|
388
|
+
| Status | Indicator | Label |
|
|
389
|
+
| ------ | --------- | ----- |
|
|
390
|
+
| `notStarted` | Info (blue) | "Not started" |
|
|
391
|
+
| `onTrack` | Success (green) | "On track" |
|
|
392
|
+
| `atRisk` | Warning (yellow) | "At risk" |
|
|
393
|
+
| `offTrack` | Error (red) | "Off track" |
|
|
394
|
+
| `achieved` | Success (green) | "Achieved" |
|
|
395
|
+
|
|
396
|
+
## Theme Support
|
|
397
|
+
|
|
398
|
+
The OKR component fully supports both light and dark themes:
|
|
399
|
+
|
|
400
|
+
```jsx
|
|
401
|
+
// Light theme (default)
|
|
402
|
+
<OKR objectives={objectives} themeMode="light" />
|
|
403
|
+
|
|
404
|
+
// Dark theme
|
|
405
|
+
<OKR objectives={objectives} themeMode="dark" />
|
|
406
|
+
|
|
407
|
+
// Auto-detect from theme context
|
|
408
|
+
<OKR objectives={objectives} />
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## Accessibility
|
|
412
|
+
|
|
413
|
+
The OKR component implements the following accessibility features:
|
|
414
|
+
|
|
415
|
+
- Proper semantic HTML structure
|
|
416
|
+
- Keyboard navigation support for interactive elements
|
|
417
|
+
- ARIA attributes for status indicators
|
|
418
|
+
- High contrast colors for text and backgrounds in both themes
|
|
419
|
+
- Proper focus states for clickable key results
|
|
420
|
+
- Screen reader friendly progress indicators
|
|
421
|
+
|
|
422
|
+
## Best Practices
|
|
423
|
+
|
|
424
|
+
### Data Structure
|
|
425
|
+
|
|
426
|
+
- Always provide unique `id` values for objectives and key results
|
|
427
|
+
- Use descriptive titles that clearly communicate the goal
|
|
428
|
+
- Include descriptions for complex objectives or key results
|
|
429
|
+
- Specify owners to establish accountability
|
|
430
|
+
- Add tags for easy categorization and filtering
|
|
431
|
+
|
|
432
|
+
### Progress Tracking
|
|
433
|
+
|
|
434
|
+
- Keep progress values between 0-100 (they will be clamped automatically)
|
|
435
|
+
- Update progress regularly to maintain accuracy
|
|
436
|
+
- Use the `lastUpdated` field to show recency of data
|
|
437
|
+
- Consider using confidence levels to indicate certainty
|
|
438
|
+
- Provide both `current` and `target` values for transparency
|
|
439
|
+
|
|
440
|
+
### Status Management
|
|
441
|
+
|
|
442
|
+
- Let the component auto-derive status from progress when possible
|
|
443
|
+
- Only override status when you have specific business logic
|
|
444
|
+
- Use appropriate statuses to drive action and attention
|
|
445
|
+
- Review `atRisk` and `offTrack` items regularly
|
|
446
|
+
|
|
447
|
+
### User Experience
|
|
448
|
+
|
|
449
|
+
- Use `onKeyResultClick` to provide drill-down functionality
|
|
450
|
+
- Implement custom footers for actions like updating progress or adding comments
|
|
451
|
+
- Group related objectives using tags
|
|
452
|
+
- Keep the number of key results per objective manageable (3-5 is ideal)
|
|
453
|
+
- Use consistent timeframes across related objectives
|
|
454
|
+
|
|
455
|
+
### Performance
|
|
456
|
+
|
|
457
|
+
- For large datasets, consider pagination or filtering
|
|
458
|
+
- Memoize event handlers to prevent unnecessary re-renders
|
|
459
|
+
- Use virtualization if displaying many objectives simultaneously
|
|
460
|
+
|
|
461
|
+
## Related Components
|
|
462
|
+
|
|
463
|
+
- [ProgressBar](../utility/progress-bar.md) - Used internally for progress visualization
|
|
464
|
+
- [StatusIndicator](../feedback/status-indicator.md) - Used internally for status display
|
|
465
|
+
- [Card](./card.md) - Similar container component for content display
|
|
466
|
+
- [Badge](./badge.md) - Can be used in custom footers for additional metadata
|
|
467
|
+
|
|
468
|
+
## Common Use Cases
|
|
469
|
+
|
|
470
|
+
- Strategic planning and goal tracking
|
|
471
|
+
- Team performance dashboards
|
|
472
|
+
- Product roadmap visualization
|
|
473
|
+
- Project milestone tracking
|
|
474
|
+
- KPI monitoring and reporting
|
|
475
|
+
- Quarterly business reviews (QBRs)
|
package/docs/components/Tree.mdx
CHANGED
|
@@ -338,3 +338,4 @@ export const TreeVariants = () => {
|
|
|
338
338
|
| onDragStart | (itemId: string, event: React.DragEvent) => void | undefined | Callback when drag starts on an item |
|
|
339
339
|
| onDragEnd | (itemId: string) => void | undefined | Callback when drag ends |
|
|
340
340
|
| views | object | {} | Custom styling for different parts of the component |
|
|
341
|
+
|
package/docs/components.md
CHANGED
|
@@ -129,6 +129,30 @@ const TextExamples = () => (
|
|
|
129
129
|
);
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
### Title
|
|
133
|
+
|
|
134
|
+
A component for rendering animated and highlighted titles in hero sections and other prominent areas of the UI.
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```tsx
|
|
138
|
+
import { Title } from '@app-studio/web';
|
|
139
|
+
|
|
140
|
+
const HeroTitle = () => (
|
|
141
|
+
<Title
|
|
142
|
+
size="xl"
|
|
143
|
+
highlightText="Platform"
|
|
144
|
+
highlightStyle="gradient"
|
|
145
|
+
highlightColor="theme.primary"
|
|
146
|
+
highlightSecondaryColor="theme.secondary"
|
|
147
|
+
centered
|
|
148
|
+
>
|
|
149
|
+
Welcome to Our Platform
|
|
150
|
+
</Title>
|
|
151
|
+
);
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
For detailed documentation, see [Title Component](./components/Title.mdx).
|
|
155
|
+
|
|
132
156
|
## III. Form Components
|
|
133
157
|
|
|
134
158
|
### TextField
|
|
@@ -172,6 +196,37 @@ const MyForm = () => (
|
|
|
172
196
|
);
|
|
173
197
|
```
|
|
174
198
|
|
|
199
|
+
### ChatInput
|
|
200
|
+
|
|
201
|
+
A customizable chat input field with support for file uploads, prompt examples, and agent controls.
|
|
202
|
+
|
|
203
|
+
**Example:**
|
|
204
|
+
```tsx
|
|
205
|
+
import { ChatInput } from '@app-studio/web';
|
|
206
|
+
import { useState } from 'react';
|
|
207
|
+
|
|
208
|
+
const ChatExample = () => {
|
|
209
|
+
const [inputValue, setInputValue] = useState('');
|
|
210
|
+
|
|
211
|
+
const handleSubmit = (message) => {
|
|
212
|
+
console.log('Message submitted:', message);
|
|
213
|
+
setInputValue('');
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<ChatInput
|
|
218
|
+
onSubmit={handleSubmit}
|
|
219
|
+
value={inputValue}
|
|
220
|
+
onChange={setInputValue}
|
|
221
|
+
placeholder="Type your message here..."
|
|
222
|
+
hideAttachments={false}
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
For detailed documentation, see [ChatInput Component](./components/ChatInput.mdx).
|
|
229
|
+
|
|
175
230
|
## IV. Feedback Components
|
|
176
231
|
|
|
177
232
|
### Alert
|
|
@@ -283,3 +338,126 @@ const KanbanCardExample = () => (
|
|
|
283
338
|
/>
|
|
284
339
|
);
|
|
285
340
|
```
|
|
341
|
+
|
|
342
|
+
### Tree
|
|
343
|
+
|
|
344
|
+
A component for displaying hierarchical data with expandable/collapsible nodes. Supports both a compound component pattern and a data-driven approach.
|
|
345
|
+
|
|
346
|
+
**Example:**
|
|
347
|
+
```tsx
|
|
348
|
+
import { Tree } from '@app-studio/web';
|
|
349
|
+
import { FolderIcon, FileIcon } from '@app-studio/web';
|
|
350
|
+
|
|
351
|
+
const FileTreeExample = () => {
|
|
352
|
+
const treeData = [
|
|
353
|
+
{
|
|
354
|
+
id: 'root',
|
|
355
|
+
label: 'Project',
|
|
356
|
+
icon: <FolderIcon size={16} />,
|
|
357
|
+
children: [
|
|
358
|
+
{
|
|
359
|
+
id: 'src',
|
|
360
|
+
label: 'src',
|
|
361
|
+
icon: <FolderIcon size={16} />,
|
|
362
|
+
children: [
|
|
363
|
+
{ id: 'components', label: 'components', icon: <FileIcon size={16} /> },
|
|
364
|
+
{ id: 'utils', label: 'utils', icon: <FileIcon size={16} /> },
|
|
365
|
+
],
|
|
366
|
+
},
|
|
367
|
+
],
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
|
|
371
|
+
return (
|
|
372
|
+
<Tree
|
|
373
|
+
items={treeData}
|
|
374
|
+
defaultExpandedItems={['root', 'src']}
|
|
375
|
+
onItemSelect={(itemId) => console.log(`Selected: ${itemId}`)}
|
|
376
|
+
/>
|
|
377
|
+
);
|
|
378
|
+
};
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
For detailed documentation, see [Tree Component](./components/Tree.mdx).
|
|
382
|
+
|
|
383
|
+
### Flow
|
|
384
|
+
|
|
385
|
+
A component for creating interactive workflow diagrams and flowcharts with support for node connections, drag-and-drop functionality, and viewport controls.
|
|
386
|
+
|
|
387
|
+
**Example:**
|
|
388
|
+
```tsx
|
|
389
|
+
import { Flow } from '@app-studio/web';
|
|
390
|
+
import { useState } from 'react';
|
|
391
|
+
|
|
392
|
+
const FlowExample = () => {
|
|
393
|
+
const [nodes, setNodes] = useState([
|
|
394
|
+
{
|
|
395
|
+
id: 'node-1',
|
|
396
|
+
position: { x: 50, y: 50 },
|
|
397
|
+
data: { label: 'Start Node', subtitle: 'Begin here' },
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 'node-2',
|
|
401
|
+
position: { x: 50, y: 200 },
|
|
402
|
+
data: { label: 'Process Node', subtitle: 'Do something' },
|
|
403
|
+
},
|
|
404
|
+
]);
|
|
405
|
+
|
|
406
|
+
const [edges, setEdges] = useState([
|
|
407
|
+
{ id: 'edge-1-2', source: 'node-1', target: 'node-2' },
|
|
408
|
+
]);
|
|
409
|
+
|
|
410
|
+
return (
|
|
411
|
+
<Flow
|
|
412
|
+
nodes={nodes}
|
|
413
|
+
edges={edges}
|
|
414
|
+
onNodesChange={setNodes}
|
|
415
|
+
onEdgesChange={setEdges}
|
|
416
|
+
/>
|
|
417
|
+
);
|
|
418
|
+
};
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
For detailed documentation, see [Flow Component](./components/Flow.mdx).
|
|
422
|
+
|
|
423
|
+
### OKR
|
|
424
|
+
|
|
425
|
+
A component for displaying and tracking Objectives and Key Results (OKRs). Provides a comprehensive view of progress, status, and ownership for strategic goals.
|
|
426
|
+
|
|
427
|
+
**Example:**
|
|
428
|
+
```tsx
|
|
429
|
+
import { OKR } from '@app-studio/web';
|
|
430
|
+
|
|
431
|
+
const OKRExample = () => {
|
|
432
|
+
const objectives = [
|
|
433
|
+
{
|
|
434
|
+
id: '1',
|
|
435
|
+
title: 'Launch New Feature',
|
|
436
|
+
description: 'Successfully launch the new feature to all users.',
|
|
437
|
+
owner: 'John Doe',
|
|
438
|
+
timeframe: 'Q4 2025',
|
|
439
|
+
tags: ['new-feature', 'launch'],
|
|
440
|
+
progress: 50,
|
|
441
|
+
status: 'onTrack',
|
|
442
|
+
keyResults: [
|
|
443
|
+
{
|
|
444
|
+
id: '1.1',
|
|
445
|
+
title: 'Complete development',
|
|
446
|
+
progress: 80,
|
|
447
|
+
status: 'onTrack',
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
id: '1.2',
|
|
451
|
+
title: 'Complete QA testing',
|
|
452
|
+
progress: 40,
|
|
453
|
+
status: 'atRisk',
|
|
454
|
+
},
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
];
|
|
458
|
+
|
|
459
|
+
return <OKR objectives={objectives} />;
|
|
460
|
+
};
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
For detailed documentation, see [OKR Component](./components/OKR.mdx).
|