@app-studio/web 0.9.80 → 0.9.82
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/Accordion/Accordion/Accordion.type.d.ts +1 -1
- package/dist/components/Accordion/Accordion/Accordion.view.d.ts +1 -1
- package/dist/components/Badge/Badge/Badge.type.d.ts +1 -1
- package/dist/components/Card/Card/Card.type.d.ts +1 -1
- package/dist/components/ChatInput/ChatInput/ChatInput.type.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker/ColorPicker.type.d.ts +1 -1
- package/dist/components/EmojiPicker/EmojiPicker/EmojiPicker.type.d.ts +1 -1
- package/dist/components/Form/ColorInput/ColorInput/ColorInput.type.d.ts +1 -1
- package/dist/components/Form/TagInput/TagInput/TagInput.type.d.ts +1 -1
- package/dist/components/Form/TextArea/TextArea/TextArea.type.d.ts +1 -1
- package/dist/components/Input/Input.type.d.ts +1 -1
- package/dist/components/Message/Message/Message.type.d.ts +1 -1
- package/dist/components/Modal/Modal/Modal.props.d.ts +2 -2
- package/dist/components/Slider/Slider/Slider.type.d.ts +1 -1
- package/dist/components/Title/Title/Title.props.d.ts +0 -5
- package/dist/components/Toggle/Toggle/Toggle.type.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup/ToggleGroup.type.d.ts +1 -1
- package/dist/pages/tabs.page.d.ts +1 -1
- package/dist/web.cjs.development.js +61 -77
- 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 +61 -77
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +61 -77
- 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/Background.mdx +133 -134
- package/docs/components/Button.mdx +154 -131
- package/docs/components/Chart.mdx +93 -368
- package/docs/components/ChatWidget.mdx +106 -0
- package/docs/components/EditComponent.mdx +76 -0
- package/docs/components/ProgressBar.mdx +77 -394
- package/docs/components/Title.mdx +102 -290
- package/package.json +1 -1
- package/docs/components/ChatInput.mdx +0 -1039
|
@@ -1,460 +1,143 @@
|
|
|
1
1
|
# ProgressBar
|
|
2
2
|
|
|
3
|
-
A progress bar component for displaying progress or completion status with customizable colors,
|
|
3
|
+
A progress bar component for displaying progress or completion status with customizable colors, shapes (linear or circular), and styling.
|
|
4
4
|
|
|
5
5
|
### **Import**
|
|
6
6
|
```tsx
|
|
7
7
|
import { ProgressBar } from '@app-studio/web';
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
### **Default**
|
|
11
|
-
```tsx
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { ProgressBar } from '@app-studio/web';
|
|
14
|
-
|
|
15
|
-
export const DefaultProgressBar = () => (
|
|
16
|
-
<ProgressBar value={50} />
|
|
17
|
-
);
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### **value**
|
|
21
|
-
Current progress value.
|
|
22
|
-
|
|
23
|
-
- **Type:** `number`
|
|
24
|
-
- **Default:** `0`
|
|
25
|
-
|
|
10
|
+
### **Linear Progress (Default)**
|
|
26
11
|
```tsx
|
|
27
12
|
import React from 'react';
|
|
28
13
|
import { ProgressBar } from '@app-studio/web';
|
|
29
14
|
import { Vertical } from 'app-studio';
|
|
30
15
|
|
|
31
|
-
export const
|
|
32
|
-
<Vertical gap={
|
|
33
|
-
<ProgressBar value={
|
|
34
|
-
<ProgressBar value={
|
|
35
|
-
<ProgressBar value={
|
|
36
|
-
<ProgressBar value={75} />
|
|
37
|
-
<ProgressBar value={100} />
|
|
16
|
+
export const LinearExamples = () => (
|
|
17
|
+
<Vertical gap={20}>
|
|
18
|
+
<ProgressBar value={30} />
|
|
19
|
+
<ProgressBar value={60} color="color.blue.500" height={8} radius={4} />
|
|
20
|
+
<ProgressBar value={90} color="color.green.500" height={12} radius={6} />
|
|
38
21
|
</Vertical>
|
|
39
22
|
);
|
|
40
23
|
```
|
|
41
24
|
|
|
42
|
-
### **
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **Type:** `number`
|
|
46
|
-
- **Default:** `100`
|
|
25
|
+
### **Circular Progress**
|
|
26
|
+
Display progress in a circular format.
|
|
47
27
|
|
|
48
28
|
```tsx
|
|
49
29
|
import React from 'react';
|
|
50
30
|
import { ProgressBar } from '@app-studio/web';
|
|
51
|
-
import {
|
|
52
|
-
|
|
53
|
-
export const CustomMaxProgressBar = () => (
|
|
54
|
-
<Vertical gap={10}>
|
|
55
|
-
<Text>Progress: 30 out of 200</Text>
|
|
56
|
-
<ProgressBar value={30} max={200} />
|
|
57
|
-
</Vertical>
|
|
58
|
-
);
|
|
59
|
-
```
|
|
31
|
+
import { Horizontal } from 'app-studio';
|
|
60
32
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- **Type:** `string`
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
import React from 'react';
|
|
68
|
-
import { ProgressBar } from '@app-studio/web';
|
|
69
|
-
import { Vertical } from 'app-studio';
|
|
70
|
-
|
|
71
|
-
export const ColoredProgressBars = () => (
|
|
72
|
-
<Vertical gap={15}>
|
|
73
|
-
<ProgressBar value={60} color="color.blue.500" />
|
|
74
|
-
<ProgressBar value={60} color="color.emerald.500" />
|
|
75
|
-
<ProgressBar value={60} color="color.red.500" />
|
|
76
|
-
<ProgressBar value={60} color="color.amber.500" />
|
|
77
|
-
<ProgressBar value={60} color="color.violet.500" />
|
|
78
|
-
</Vertical>
|
|
79
|
-
);
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### **backgroundColor**
|
|
83
|
-
Background color of the track.
|
|
84
|
-
|
|
85
|
-
- **Type:** `string`
|
|
86
|
-
|
|
87
|
-
```tsx
|
|
88
|
-
import React from 'react';
|
|
89
|
-
import { ProgressBar } from '@app-studio/web';
|
|
90
|
-
import { Vertical } from 'app-studio';
|
|
91
|
-
|
|
92
|
-
export const BackgroundColorProgressBars = () => (
|
|
93
|
-
<Vertical gap={15}>
|
|
33
|
+
export const CircularExamples = () => (
|
|
34
|
+
<Horizontal gap={30}>
|
|
94
35
|
<ProgressBar
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
36
|
+
shape="circle"
|
|
37
|
+
value={45}
|
|
38
|
+
size={60}
|
|
98
39
|
/>
|
|
99
40
|
<ProgressBar
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
41
|
+
shape="circle"
|
|
42
|
+
value={75}
|
|
43
|
+
size={80}
|
|
44
|
+
color="color.purple.500"
|
|
45
|
+
strokeWidth={8}
|
|
46
|
+
showLabel
|
|
103
47
|
/>
|
|
104
48
|
<ProgressBar
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
49
|
+
shape="circle"
|
|
50
|
+
value={90}
|
|
51
|
+
size={100}
|
|
52
|
+
color="color.orange.500"
|
|
53
|
+
strokeWidth={10}
|
|
54
|
+
backgroundColor="color.orange.100"
|
|
55
|
+
showLabel
|
|
56
|
+
labelColor="color.orange.700"
|
|
108
57
|
/>
|
|
109
|
-
</
|
|
58
|
+
</Horizontal>
|
|
110
59
|
);
|
|
111
60
|
```
|
|
112
61
|
|
|
113
|
-
### **
|
|
114
|
-
Height of the progress bar.
|
|
62
|
+
### **Props**
|
|
115
63
|
|
|
116
|
-
|
|
64
|
+
#### **Common Props**
|
|
65
|
+
- **value** (`number`): Current progress value (default: 0).
|
|
66
|
+
- **max** (`number`): Maximum progress value (default: 100).
|
|
67
|
+
- **color** (`string`): Color of the filled portion.
|
|
68
|
+
- **backgroundColor** (`string`): Background color of the track.
|
|
69
|
+
- **animated** (`boolean`): Whether to animate the progress change (default: true).
|
|
70
|
+
- **animationDuration** (`string`): Duration of the animation (e.g., '0.5s').
|
|
71
|
+
- **views** (`ProgressBarStyles`): Custom styles object.
|
|
117
72
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
import { Vertical } from 'app-studio';
|
|
122
|
-
|
|
123
|
-
export const HeightProgressBars = () => (
|
|
124
|
-
<Vertical gap={15}>
|
|
125
|
-
<ProgressBar value={60} height={4} />
|
|
126
|
-
<ProgressBar value={60} height={8} />
|
|
127
|
-
<ProgressBar value={60} height={12} />
|
|
128
|
-
<ProgressBar value={60} height={20} />
|
|
129
|
-
</Vertical>
|
|
130
|
-
);
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### **radius**
|
|
134
|
-
Border radius for rounded corners.
|
|
135
|
-
|
|
136
|
-
- **Type:** `number | string`
|
|
137
|
-
|
|
138
|
-
```tsx
|
|
139
|
-
import React from 'react';
|
|
140
|
-
import { ProgressBar } from '@app-studio/web';
|
|
141
|
-
import { Vertical } from 'app-studio';
|
|
142
|
-
|
|
143
|
-
export const RadiusProgressBars = () => (
|
|
144
|
-
<Vertical gap={15}>
|
|
145
|
-
<ProgressBar value={60} height={12} radius={0} />
|
|
146
|
-
<ProgressBar value={60} height={12} radius={4} />
|
|
147
|
-
<ProgressBar value={60} height={12} radius={8} />
|
|
148
|
-
<ProgressBar value={60} height={12} radius={20} />
|
|
149
|
-
</Vertical>
|
|
150
|
-
);
|
|
151
|
-
```
|
|
73
|
+
#### **Linear Props**
|
|
74
|
+
- **height** (`number | string`): Height of the bar.
|
|
75
|
+
- **radius** (`number | string`): Border radius for rounded corners.
|
|
152
76
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- **
|
|
157
|
-
|
|
158
|
-
```tsx
|
|
159
|
-
import React from 'react';
|
|
160
|
-
import { ProgressBar } from '@app-studio/web';
|
|
161
|
-
|
|
162
|
-
export const StyledProgressBar = () => (
|
|
163
|
-
<ProgressBar
|
|
164
|
-
value={60}
|
|
165
|
-
views={{
|
|
166
|
-
container: {
|
|
167
|
-
borderWidth: 2,
|
|
168
|
-
borderColor: '#3b82f6',
|
|
169
|
-
padding: 2,
|
|
170
|
-
},
|
|
171
|
-
bar: {
|
|
172
|
-
background: 'linear-gradient(90deg, #3b82f6, #8b5cf6)',
|
|
173
|
-
}
|
|
174
|
-
}}
|
|
175
|
-
/>
|
|
176
|
-
);
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### **Animated Progress**
|
|
180
|
-
Progress bar with smooth animation.
|
|
77
|
+
#### **Circular Props (shape="circle")**
|
|
78
|
+
- **size** (`number`): Diameter of the circle.
|
|
79
|
+
- **strokeWidth** (`number`): Width of the progress stroke.
|
|
80
|
+
- **showLabel** (`boolean`): Whether to show the percentage label in the center.
|
|
81
|
+
- **labelColor** (`string`): Color of the label text.
|
|
181
82
|
|
|
83
|
+
### **Animated & Dynamic**
|
|
182
84
|
```tsx
|
|
183
85
|
import React, { useState, useEffect } from 'react';
|
|
184
86
|
import { ProgressBar } from '@app-studio/web';
|
|
185
|
-
import { Vertical, Text } from 'app-studio';
|
|
87
|
+
import { Vertical, Button, Text } from 'app-studio';
|
|
186
88
|
|
|
187
|
-
export const
|
|
89
|
+
export const DynamicProgress = () => {
|
|
188
90
|
const [progress, setProgress] = useState(0);
|
|
189
|
-
|
|
91
|
+
|
|
190
92
|
useEffect(() => {
|
|
191
|
-
const
|
|
192
|
-
setProgress((prev) =>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
196
|
-
}, 50);
|
|
197
|
-
|
|
198
|
-
return () => clearInterval(interval);
|
|
93
|
+
const timer = setInterval(() => {
|
|
94
|
+
setProgress((prev) => (prev >= 100 ? 0 : prev + 10));
|
|
95
|
+
}, 800);
|
|
96
|
+
return () => clearInterval(timer);
|
|
199
97
|
}, []);
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<Vertical gap={10}>
|
|
203
|
-
<Text>{progress}%</Text>
|
|
204
|
-
<ProgressBar value={progress} />
|
|
205
|
-
</Vertical>
|
|
206
|
-
);
|
|
207
|
-
};
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### **File Upload Progress**
|
|
211
|
-
Progress bar for file upload.
|
|
212
|
-
|
|
213
|
-
```tsx
|
|
214
|
-
import React, { useState } from 'react';
|
|
215
|
-
import { ProgressBar } from '@app-studio/web';
|
|
216
|
-
import { Vertical, Text, Button } from 'app-studio';
|
|
217
|
-
|
|
218
|
-
export const FileUploadProgress = () => {
|
|
219
|
-
const [progress, setProgress] = useState(0);
|
|
220
|
-
const [uploading, setUploading] = useState(false);
|
|
221
|
-
|
|
222
|
-
const simulateUpload = () => {
|
|
223
|
-
setUploading(true);
|
|
224
|
-
setProgress(0);
|
|
225
|
-
|
|
226
|
-
const interval = setInterval(() => {
|
|
227
|
-
setProgress((prev) => {
|
|
228
|
-
if (prev >= 100) {
|
|
229
|
-
clearInterval(interval);
|
|
230
|
-
setUploading(false);
|
|
231
|
-
return 100;
|
|
232
|
-
}
|
|
233
|
-
return prev + 10;
|
|
234
|
-
});
|
|
235
|
-
}, 200);
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
return (
|
|
239
|
-
<Vertical gap={15}>
|
|
240
|
-
<Button onClick={simulateUpload} isDisabled={uploading}>
|
|
241
|
-
Upload File
|
|
242
|
-
</Button>
|
|
243
|
-
|
|
244
|
-
{uploading && (
|
|
245
|
-
<Vertical gap={5}>
|
|
246
|
-
<Text fontSize={14}>Uploading... {progress}%</Text>
|
|
247
|
-
<ProgressBar
|
|
248
|
-
value={progress}
|
|
249
|
-
color="color.emerald.500"
|
|
250
|
-
height={8}
|
|
251
|
-
/>
|
|
252
|
-
</Vertical>
|
|
253
|
-
)}
|
|
254
|
-
</Vertical>
|
|
255
|
-
);
|
|
256
|
-
};
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### **Multi-Step Progress**
|
|
260
|
-
Progress bar for multi-step processes.
|
|
261
|
-
|
|
262
|
-
```tsx
|
|
263
|
-
import React, { useState } from 'react';
|
|
264
|
-
import { ProgressBar } from '@app-studio/web';
|
|
265
|
-
import { Vertical, Horizontal, Text, Button } from 'app-studio';
|
|
266
98
|
|
|
267
|
-
export const MultiStepProgress = () => {
|
|
268
|
-
const [step, setStep] = useState(1);
|
|
269
|
-
const totalSteps = 4;
|
|
270
|
-
const progress = (step / totalSteps) * 100;
|
|
271
|
-
|
|
272
99
|
return (
|
|
273
100
|
<Vertical gap={20}>
|
|
274
|
-
<
|
|
275
|
-
|
|
101
|
+
<Text>Uploading... {progress}%</Text>
|
|
102
|
+
<ProgressBar value={progress} color="color.blue.600" animated />
|
|
103
|
+
|
|
104
|
+
<Horizontal gap={20} marginTop={20}>
|
|
276
105
|
<ProgressBar
|
|
106
|
+
shape="circle"
|
|
277
107
|
value={progress}
|
|
278
|
-
|
|
279
|
-
|
|
108
|
+
size={50}
|
|
109
|
+
showLabel
|
|
110
|
+
color="color.blue.600"
|
|
280
111
|
/>
|
|
281
|
-
</Vertical>
|
|
282
|
-
|
|
283
|
-
<Horizontal gap={10}>
|
|
284
|
-
<Button
|
|
285
|
-
onClick={() => setStep(Math.max(1, step - 1))}
|
|
286
|
-
isDisabled={step === 1}
|
|
287
|
-
>
|
|
288
|
-
Previous
|
|
289
|
-
</Button>
|
|
290
|
-
<Button
|
|
291
|
-
onClick={() => setStep(Math.min(totalSteps, step + 1))}
|
|
292
|
-
isDisabled={step === totalSteps}
|
|
293
|
-
>
|
|
294
|
-
Next
|
|
295
|
-
</Button>
|
|
296
112
|
</Horizontal>
|
|
297
113
|
</Vertical>
|
|
298
114
|
);
|
|
299
115
|
};
|
|
300
116
|
```
|
|
301
117
|
|
|
302
|
-
### **
|
|
303
|
-
|
|
118
|
+
### **Custom Styling (Views)**
|
|
119
|
+
Customize internal parts using the `views` prop.
|
|
304
120
|
|
|
305
121
|
```tsx
|
|
306
122
|
import React from 'react';
|
|
307
123
|
import { ProgressBar } from '@app-studio/web';
|
|
308
124
|
|
|
309
|
-
export const
|
|
125
|
+
export const CustomStyle = () => (
|
|
310
126
|
<ProgressBar
|
|
311
|
-
value={70}
|
|
312
|
-
height={16}
|
|
313
|
-
radius={8}
|
|
314
|
-
views={{
|
|
315
|
-
bar: {
|
|
316
|
-
background: 'linear-gradient(90deg, #667eea 0%, #764ba2 100%)',
|
|
317
|
-
}
|
|
318
|
-
}}
|
|
319
|
-
/>
|
|
320
|
-
);
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### **Striped Progress Bar**
|
|
324
|
-
Progress bar with striped pattern.
|
|
325
|
-
|
|
326
|
-
```tsx
|
|
327
|
-
import React from 'react';
|
|
328
|
-
import { ProgressBar } from '@app-studio/web';
|
|
329
|
-
|
|
330
|
-
export const StripedProgressBar = () => (
|
|
331
|
-
<ProgressBar
|
|
332
|
-
value={65}
|
|
127
|
+
value={70}
|
|
333
128
|
height={20}
|
|
334
|
-
radius={10}
|
|
335
|
-
views={{
|
|
336
|
-
bar: {
|
|
337
|
-
background: `
|
|
338
|
-
repeating-linear-gradient(
|
|
339
|
-
45deg,
|
|
340
|
-
#3b82f6,
|
|
341
|
-
#3b82f6 10px,
|
|
342
|
-
#60a5fa 10px,
|
|
343
|
-
#60a5fa 20px
|
|
344
|
-
)
|
|
345
|
-
`,
|
|
346
|
-
}
|
|
347
|
-
}}
|
|
348
|
-
/>
|
|
349
|
-
);
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
### **Status-Based Progress**
|
|
353
|
-
Different colors based on progress value.
|
|
354
|
-
|
|
355
|
-
```tsx
|
|
356
|
-
import React from 'react';
|
|
357
|
-
import { ProgressBar } from '@app-studio/web';
|
|
358
|
-
import { Vertical, Text } from 'app-studio';
|
|
359
|
-
|
|
360
|
-
export const StatusProgressBars = () => {
|
|
361
|
-
const getColor = (value: number) => {
|
|
362
|
-
if (value < 30) return '#ef4444'; // Red
|
|
363
|
-
if (value < 70) return '#f59e0b'; // Orange
|
|
364
|
-
return '#10b981'; // Green
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
return (
|
|
368
|
-
<Vertical gap={15}>
|
|
369
|
-
{[20, 50, 90].map((value) => (
|
|
370
|
-
<Vertical key={value} gap={5}>
|
|
371
|
-
<Text>{value}%</Text>
|
|
372
|
-
<ProgressBar
|
|
373
|
-
value={value}
|
|
374
|
-
color={getColor(value)}
|
|
375
|
-
height={10}
|
|
376
|
-
/>
|
|
377
|
-
</Vertical>
|
|
378
|
-
))}
|
|
379
|
-
</Vertical>
|
|
380
|
-
);
|
|
381
|
-
};
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
### **Loading Progress**
|
|
385
|
-
Indeterminate loading state.
|
|
386
|
-
|
|
387
|
-
```tsx
|
|
388
|
-
import React from 'react';
|
|
389
|
-
import { ProgressBar } from '@app-studio/web';
|
|
390
|
-
|
|
391
|
-
export const LoadingProgressBar = () => (
|
|
392
|
-
<ProgressBar
|
|
393
|
-
value={100}
|
|
394
|
-
height={4}
|
|
395
129
|
views={{
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
130
|
+
container: {
|
|
131
|
+
borderColor: 'color.gray.300',
|
|
132
|
+
borderWidth: 1,
|
|
133
|
+
padding: 2,
|
|
134
|
+
borderRadius: 12
|
|
135
|
+
},
|
|
136
|
+
bar: {
|
|
137
|
+
borderRadius: 10,
|
|
138
|
+
background: 'linear-gradient(90deg, #FF5C97, #705CFF)'
|
|
399
139
|
}
|
|
400
|
-
}}
|
|
140
|
+
}}
|
|
401
141
|
/>
|
|
402
142
|
);
|
|
403
143
|
```
|
|
404
|
-
|
|
405
|
-
### **Complete Example**
|
|
406
|
-
A comprehensive progress tracking example.
|
|
407
|
-
|
|
408
|
-
```tsx
|
|
409
|
-
import React, { useState, useEffect } from 'react';
|
|
410
|
-
import { ProgressBar } from '@app-studio/web';
|
|
411
|
-
import { Vertical, Horizontal, Text, Button, Card } from 'app-studio';
|
|
412
|
-
|
|
413
|
-
export const CompleteProgressExample = () => {
|
|
414
|
-
const [tasks, setTasks] = useState([
|
|
415
|
-
{ id: 1, name: 'Design', progress: 100, color: '#10b981' },
|
|
416
|
-
{ id: 2, name: 'Development', progress: 65, color: '#3b82f6' },
|
|
417
|
-
{ id: 3, name: 'Testing', progress: 30, color: '#f59e0b' },
|
|
418
|
-
{ id: 4, name: 'Deployment', progress: 0, color: '#6b7280' },
|
|
419
|
-
]);
|
|
420
|
-
|
|
421
|
-
const overallProgress = tasks.reduce((sum, task) => sum + task.progress, 0) / tasks.length;
|
|
422
|
-
|
|
423
|
-
return (
|
|
424
|
-
<Card padding={20}>
|
|
425
|
-
<Vertical gap={20}>
|
|
426
|
-
<Vertical gap={10}>
|
|
427
|
-
<Horizontal justifyContent="space-between">
|
|
428
|
-
<Text fontSize={18} fontWeight="bold">Project Progress</Text>
|
|
429
|
-
<Text fontSize={18} fontWeight="bold">{Math.round(overallProgress)}%</Text>
|
|
430
|
-
</Horizontal>
|
|
431
|
-
<ProgressBar
|
|
432
|
-
value={overallProgress}
|
|
433
|
-
color="color.blue.500"
|
|
434
|
-
height={12}
|
|
435
|
-
radius={6}
|
|
436
|
-
/>
|
|
437
|
-
</Vertical>
|
|
438
|
-
|
|
439
|
-
<Vertical gap={15}>
|
|
440
|
-
{tasks.map((task) => (
|
|
441
|
-
<Vertical key={task.id} gap={5}>
|
|
442
|
-
<Horizontal justifyContent="space-between">
|
|
443
|
-
<Text fontSize={14}>{task.name}</Text>
|
|
444
|
-
<Text fontSize={14}>{task.progress}%</Text>
|
|
445
|
-
</Horizontal>
|
|
446
|
-
<ProgressBar
|
|
447
|
-
value={task.progress}
|
|
448
|
-
color={task.color}
|
|
449
|
-
height={8}
|
|
450
|
-
radius={4}
|
|
451
|
-
/>
|
|
452
|
-
</Vertical>
|
|
453
|
-
))}
|
|
454
|
-
</Vertical>
|
|
455
|
-
</Vertical>
|
|
456
|
-
</Card>
|
|
457
|
-
);
|
|
458
|
-
};
|
|
459
|
-
```
|
|
460
|
-
|