@app-studio/web 0.9.35 → 0.9.37
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.props.d.ts +8 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +5 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +7 -3
- 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 -0
- package/dist/pages/okr.page.d.ts +3 -0
- package/dist/web.cjs.development.js +774 -199
- 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 +774 -200
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +774 -199
- 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 +3 -0
- package/docs/components/Flow.mdx +1 -0
- package/docs/components/KanbanBoard.mdx +4 -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/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
package/docs/README.md
CHANGED
|
@@ -12,7 +12,8 @@ Welcome to the comprehensive documentation for the App Studio Web Component Libr
|
|
|
12
12
|
|
|
13
13
|
### Specialized Documentation
|
|
14
14
|
- **[ADK Components](../README-ADK.md)** - Agent Development Kit integration
|
|
15
|
-
- **[
|
|
15
|
+
- **[Compoments Reference](./components.md)** - Summary of all component APIs
|
|
16
|
+
- **[Detailed Copoments](./components/)** - Detailed component APIs
|
|
16
17
|
- **[Tutorials](./tutorials/README.md)** - Step-by-step guides
|
|
17
18
|
- **[Contributing](./contributing/documentation.md)** - Contribution guidelines
|
|
18
19
|
|
|
@@ -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/Flow.mdx
CHANGED
|
@@ -255,3 +255,4 @@ The Flow component implements the following accessibility features:
|
|
|
255
255
|
- Consider viewport size when determining initial node positions
|
|
256
256
|
- Use the `onNodeAdd` callback to validate new node positions
|
|
257
257
|
- Implement undo/redo functionality for node operations when needed
|
|
258
|
+
|
|
@@ -115,6 +115,10 @@ export const CustomRenderKanbanBoard = () => {
|
|
|
115
115
|
| --- | --- | --- | --- |
|
|
116
116
|
| `columns` | `KanbanBoardColumn[]` | Array of columns to display. | `[]` |
|
|
117
117
|
| `onChange` | `(columns: KanbanBoardColumn[]) => void` | Callback when columns or cards are changed. | - |
|
|
118
|
+
| `onCardCreate` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is created. | - |
|
|
119
|
+
| `onCardDelete` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => void` | Callback when a card is deleted. | - |
|
|
120
|
+
| `onCardTitleChange` | `(card: KanbanBoardCard, column: KanbanBoardColumn, newTitle: string) => void` | Callback when a card's title is changed. | - |
|
|
121
|
+
| `onCardDescriptionChange` | `(card: KanbanBoardCard, column: KanbanBoardColumn, newDescription: string) => void` | Callback when a card's description is changed. | - |
|
|
118
122
|
| `renderCard` | `(card: KanbanBoardCard, column: KanbanBoardColumn) => React.ReactNode` | Custom render method for cards. | - |
|
|
119
123
|
| `renderColumnHeader` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for column headers. | - |
|
|
120
124
|
| `renderEmptyState` | `(column: KanbanBoardColumn) => React.ReactNode` | Custom render method for empty column state. | - |
|
|
@@ -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
|
+
|