@app-studio/web 0.9.41 → 0.9.43
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/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +19 -70
- package/docs/components/AspectRatio.mdx +13 -11
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +18 -43
- package/docs/components/Background.mdx +100 -492
- package/docs/components/Badge.mdx +45 -130
- package/docs/components/Button.mdx +76 -128
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +247 -290
- package/docs/components/Carousel.mdx +94 -321
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +6 -6
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +13 -13
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +8 -8
- package/docs/components/DatePicker.mdx +3 -3
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +392 -231
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Formik.mdx +39 -39
- package/docs/components/Gradient.mdx +359 -182
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/KanbanBoard.mdx +9 -9
- package/docs/components/Link.mdx +22 -30
- package/docs/components/Loader.mdx +230 -413
- package/docs/components/Menubar.mdx +73 -69
- package/docs/components/Message.mdx +210 -525
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +17 -17
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +6 -6
- package/docs/components/TextField.mdx +12 -12
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +37 -49
- package/docs/components/ToggleGroup.mdx +36 -57
- package/docs/components/Tooltip.mdx +501 -138
- package/docs/components/Uploader.mdx +205 -351
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
# ProgressBar
|
|
2
|
+
|
|
3
|
+
A progress bar component for displaying progress or completion status with customizable colors, height, and styling.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { ProgressBar } from '@app-studio/web';
|
|
8
|
+
```
|
|
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
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { ProgressBar } from '@app-studio/web';
|
|
29
|
+
import { Vertical } from 'app-studio';
|
|
30
|
+
|
|
31
|
+
export const ProgressValues = () => (
|
|
32
|
+
<Vertical gap={15}>
|
|
33
|
+
<ProgressBar value={0} />
|
|
34
|
+
<ProgressBar value={25} />
|
|
35
|
+
<ProgressBar value={50} />
|
|
36
|
+
<ProgressBar value={75} />
|
|
37
|
+
<ProgressBar value={100} />
|
|
38
|
+
</Vertical>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### **max**
|
|
43
|
+
Maximum progress value.
|
|
44
|
+
|
|
45
|
+
- **Type:** `number`
|
|
46
|
+
- **Default:** `100`
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import React from 'react';
|
|
50
|
+
import { ProgressBar } from '@app-studio/web';
|
|
51
|
+
import { Vertical, Text } from 'app-studio';
|
|
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
|
+
```
|
|
60
|
+
|
|
61
|
+
### **color**
|
|
62
|
+
Color of the filled portion.
|
|
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="#3b82f6" />
|
|
74
|
+
<ProgressBar value={60} color="#10b981" />
|
|
75
|
+
<ProgressBar value={60} color="#ef4444" />
|
|
76
|
+
<ProgressBar value={60} color="#f59e0b" />
|
|
77
|
+
<ProgressBar value={60} color="#8b5cf6" />
|
|
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}>
|
|
94
|
+
<ProgressBar
|
|
95
|
+
value={60}
|
|
96
|
+
color="#3b82f6"
|
|
97
|
+
backgroundColor="#dbeafe"
|
|
98
|
+
/>
|
|
99
|
+
<ProgressBar
|
|
100
|
+
value={60}
|
|
101
|
+
color="#10b981"
|
|
102
|
+
backgroundColor="#d1fae5"
|
|
103
|
+
/>
|
|
104
|
+
<ProgressBar
|
|
105
|
+
value={60}
|
|
106
|
+
color="#ef4444"
|
|
107
|
+
backgroundColor="#fee2e2"
|
|
108
|
+
/>
|
|
109
|
+
</Vertical>
|
|
110
|
+
);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### **height**
|
|
114
|
+
Height of the progress bar.
|
|
115
|
+
|
|
116
|
+
- **Type:** `number | string`
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import React from 'react';
|
|
120
|
+
import { ProgressBar } from '@app-studio/web';
|
|
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
|
+
```
|
|
152
|
+
|
|
153
|
+
### **views**
|
|
154
|
+
Custom styles for container or bar.
|
|
155
|
+
|
|
156
|
+
- **Type:** `{ container?: ViewProps; bar?: ViewProps }`
|
|
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.
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import React, { useState, useEffect } from 'react';
|
|
184
|
+
import { ProgressBar } from '@app-studio/web';
|
|
185
|
+
import { Vertical, Text } from 'app-studio';
|
|
186
|
+
|
|
187
|
+
export const AnimatedProgressBar = () => {
|
|
188
|
+
const [progress, setProgress] = useState(0);
|
|
189
|
+
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
const interval = setInterval(() => {
|
|
192
|
+
setProgress((prev) => {
|
|
193
|
+
if (prev >= 100) return 0;
|
|
194
|
+
return prev + 1;
|
|
195
|
+
});
|
|
196
|
+
}, 50);
|
|
197
|
+
|
|
198
|
+
return () => clearInterval(interval);
|
|
199
|
+
}, []);
|
|
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="#10b981"
|
|
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
|
+
|
|
267
|
+
export const MultiStepProgress = () => {
|
|
268
|
+
const [step, setStep] = useState(1);
|
|
269
|
+
const totalSteps = 4;
|
|
270
|
+
const progress = (step / totalSteps) * 100;
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<Vertical gap={20}>
|
|
274
|
+
<Vertical gap={10}>
|
|
275
|
+
<Text>Step {step} of {totalSteps}</Text>
|
|
276
|
+
<ProgressBar
|
|
277
|
+
value={progress}
|
|
278
|
+
color="#3b82f6"
|
|
279
|
+
height={10}
|
|
280
|
+
/>
|
|
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
|
+
</Horizontal>
|
|
297
|
+
</Vertical>
|
|
298
|
+
);
|
|
299
|
+
};
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### **Gradient Progress Bar**
|
|
303
|
+
Progress bar with gradient fill.
|
|
304
|
+
|
|
305
|
+
```tsx
|
|
306
|
+
import React from 'react';
|
|
307
|
+
import { ProgressBar } from '@app-studio/web';
|
|
308
|
+
|
|
309
|
+
export const GradientProgressBar = () => (
|
|
310
|
+
<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}
|
|
333
|
+
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
|
+
views={{
|
|
396
|
+
bar: {
|
|
397
|
+
animation: 'progress-loading 1.5s ease-in-out infinite',
|
|
398
|
+
background: 'linear-gradient(90deg, transparent, #3b82f6, transparent)',
|
|
399
|
+
}
|
|
400
|
+
}}
|
|
401
|
+
/>
|
|
402
|
+
);
|
|
403
|
+
```
|
|
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="#3b82f6"
|
|
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
|
+
|
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
# Resizable
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A flexible container that allows users to resize its content areas by dragging adjustable dividers.
|
|
4
4
|
|
|
5
5
|
### **Import**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
```tsx
|
|
7
|
+
import { Resizable } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
9
|
|
|
10
10
|
### **Default**
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Resizable } from '@app-studio/web';
|
|
14
|
-
import { View } from '
|
|
15
|
-
import { Text } from '
|
|
14
|
+
import { View } from 'app-studio';
|
|
15
|
+
import { Text } from 'app-studio';
|
|
16
16
|
|
|
17
17
|
export const DefaultResizable = () => {
|
|
18
18
|
return (
|
|
19
|
-
<View
|
|
19
|
+
<View
|
|
20
|
+
height="400px"
|
|
21
|
+
width="100%"
|
|
22
|
+
border="1px solid #e2e8f0"
|
|
23
|
+
borderRadius="8px"
|
|
24
|
+
overflow="hidden"
|
|
25
|
+
>
|
|
20
26
|
<Resizable>
|
|
21
27
|
<Resizable.Panel id="panel1" defaultSize="30%">
|
|
22
28
|
<View padding="16px" height="100%" backgroundColor="color.blue.50">
|
|
23
|
-
<Text fontWeight="bold"
|
|
29
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
30
|
+
Panel 1
|
|
31
|
+
</Text>
|
|
24
32
|
<Text>This is the first panel. Drag the handle to resize.</Text>
|
|
25
33
|
</View>
|
|
26
34
|
</Resizable.Panel>
|
|
27
|
-
|
|
35
|
+
|
|
28
36
|
<Resizable.Handle id="handle1" withVisualIndicator />
|
|
29
|
-
|
|
37
|
+
|
|
30
38
|
<Resizable.Panel id="panel2" defaultSize="40%">
|
|
31
39
|
<View padding="16px" height="100%" backgroundColor="color.green.50">
|
|
32
|
-
<Text fontWeight="bold"
|
|
40
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
41
|
+
Panel 2
|
|
42
|
+
</Text>
|
|
33
43
|
<Text>This is the second panel. Drag the handle to resize.</Text>
|
|
34
44
|
</View>
|
|
35
45
|
</Resizable.Panel>
|
|
36
|
-
|
|
46
|
+
|
|
37
47
|
<Resizable.Handle id="handle2" withVisualIndicator />
|
|
38
|
-
|
|
48
|
+
|
|
39
49
|
<Resizable.Panel id="panel3" defaultSize="30%">
|
|
40
50
|
<View padding="16px" height="100%" backgroundColor="color.purple.50">
|
|
41
|
-
<Text fontWeight="bold"
|
|
51
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
52
|
+
Panel 3
|
|
53
|
+
</Text>
|
|
42
54
|
<Text>This is the third panel. Drag the handle to resize.</Text>
|
|
43
55
|
</View>
|
|
44
56
|
</Resizable.Panel>
|
|
@@ -48,101 +60,90 @@ export const DefaultResizable = () => {
|
|
|
48
60
|
};
|
|
49
61
|
```
|
|
50
62
|
|
|
51
|
-
### **
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
// Horizontal (default)
|
|
56
|
-
<Resizable orientation="horizontal">
|
|
57
|
-
{/* Panels and handles */}
|
|
58
|
-
</Resizable>
|
|
59
|
-
|
|
60
|
-
// Vertical
|
|
61
|
-
<Resizable orientation="vertical">
|
|
62
|
-
{/* Panels and handles */}
|
|
63
|
-
</Resizable>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### **Nested Layouts**
|
|
67
|
-
The Resizable component can be nested to create complex layouts:
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
<Resizable>
|
|
71
|
-
<Resizable.Panel id="left" defaultSize="30%">
|
|
72
|
-
{/* Left panel content */}
|
|
73
|
-
</Resizable.Panel>
|
|
74
|
-
|
|
75
|
-
<Resizable.Handle id="handle1" />
|
|
76
|
-
|
|
77
|
-
<Resizable.Panel id="right" defaultSize="70%">
|
|
78
|
-
{/* Nested vertical resizable */}
|
|
79
|
-
<Resizable orientation="vertical">
|
|
80
|
-
<Resizable.Panel id="top" defaultSize="50%">
|
|
81
|
-
{/* Top right panel content */}
|
|
82
|
-
</Resizable.Panel>
|
|
83
|
-
|
|
84
|
-
<Resizable.Handle id="handle2" />
|
|
85
|
-
|
|
86
|
-
<Resizable.Panel id="bottom" defaultSize="50%">
|
|
87
|
-
{/* Bottom right panel content */}
|
|
88
|
-
</Resizable.Panel>
|
|
89
|
-
</Resizable>
|
|
90
|
-
</Resizable.Panel>
|
|
91
|
-
</Resizable>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### **Handle Variants**
|
|
95
|
-
The Resizable component supports different handle variants:
|
|
96
|
-
|
|
97
|
-
```tsx
|
|
98
|
-
<Resizable variant="default">
|
|
99
|
-
{/* Panels and handles */}
|
|
100
|
-
</Resizable>
|
|
101
|
-
|
|
102
|
-
<Resizable variant="subtle">
|
|
103
|
-
{/* Panels and handles */}
|
|
104
|
-
</Resizable>
|
|
105
|
-
|
|
106
|
-
<Resizable variant="prominent">
|
|
107
|
-
{/* Panels and handles */}
|
|
108
|
-
</Resizable>
|
|
109
|
-
```
|
|
63
|
+
### **collapsible**
|
|
64
|
+
Enables or disables the ability for panels to collapse.
|
|
110
65
|
|
|
111
|
-
|
|
112
|
-
|
|
66
|
+
- **Type:** `boolean`
|
|
67
|
+
- **Default:** `false`
|
|
113
68
|
|
|
114
69
|
```tsx
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<Resizable size="md">
|
|
120
|
-
{/* Panels and handles */}
|
|
121
|
-
</Resizable>
|
|
70
|
+
import React from 'react';
|
|
71
|
+
import { Resizable } from '@app-studio/web';
|
|
72
|
+
import { View } from 'app-studio';
|
|
73
|
+
import { Text } from 'app-studio';
|
|
122
74
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
75
|
+
export const CollapsibleResizable = () => {
|
|
76
|
+
return (
|
|
77
|
+
<View
|
|
78
|
+
height="400px"
|
|
79
|
+
width="100%"
|
|
80
|
+
border="1px solid #e2e8f0"
|
|
81
|
+
borderRadius="8px"
|
|
82
|
+
overflow="hidden"
|
|
83
|
+
>
|
|
84
|
+
<Resizable
|
|
85
|
+
collapsible={true}
|
|
86
|
+
autoSaveId="collapsible-example"
|
|
87
|
+
keyboardResizeBy={20}
|
|
88
|
+
>
|
|
89
|
+
<Resizable.Panel
|
|
90
|
+
id="panel1"
|
|
91
|
+
defaultSize="25%"
|
|
92
|
+
collapsible={true}
|
|
93
|
+
minSize={100}
|
|
94
|
+
maxSize={300}
|
|
95
|
+
>
|
|
96
|
+
<View padding="16px" height="100%" backgroundColor="color.blue.50">
|
|
97
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
98
|
+
Collapsible Panel
|
|
99
|
+
</Text>
|
|
100
|
+
<Text>
|
|
101
|
+
This panel can be collapsed using the button on the handle. It
|
|
102
|
+
also has min (100px) and max (300px) constraints.
|
|
103
|
+
</Text>
|
|
104
|
+
</View>
|
|
105
|
+
</Resizable.Panel>
|
|
127
106
|
|
|
128
|
-
|
|
129
|
-
The Resizable component can be controlled externally:
|
|
107
|
+
<Resizable.Handle id="handle1" withVisualIndicator withCollapseButton />
|
|
130
108
|
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
<Resizable.Panel id="panel2" defaultSize="50%">
|
|
110
|
+
<View padding="16px" height="100%" backgroundColor="color.green.50">
|
|
111
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
112
|
+
Main Panel
|
|
113
|
+
</Text>
|
|
114
|
+
<Text>
|
|
115
|
+
This is the main content panel. Try using keyboard navigation with
|
|
116
|
+
arrow keys to resize panels. Home/End keys make larger jumps.
|
|
117
|
+
</Text>
|
|
118
|
+
</View>
|
|
119
|
+
</Resizable.Panel>
|
|
133
120
|
|
|
134
|
-
|
|
135
|
-
|
|
121
|
+
<Resizable.Handle
|
|
122
|
+
id="handle2"
|
|
123
|
+
withVisualIndicator
|
|
124
|
+
withCollapseButton
|
|
125
|
+
collapseTarget="panel3"
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<Resizable.Panel
|
|
129
|
+
id="panel3"
|
|
130
|
+
defaultSize="25%"
|
|
131
|
+
collapsible={true}
|
|
132
|
+
defaultCollapsed={true}
|
|
133
|
+
>
|
|
134
|
+
<View padding="16px" height="100%" backgroundColor="color.purple.50">
|
|
135
|
+
<Text fontWeight="bold" marginBottom="8px">
|
|
136
|
+
Initially Collapsed Panel
|
|
137
|
+
</Text>
|
|
138
|
+
<Text>
|
|
139
|
+
This panel starts collapsed. The layout is persisted in
|
|
140
|
+
localStorage so your changes will be remembered when you return.
|
|
141
|
+
</Text>
|
|
142
|
+
</View>
|
|
143
|
+
</Resizable.Panel>
|
|
144
|
+
</Resizable>
|
|
145
|
+
</View>
|
|
146
|
+
);
|
|
136
147
|
};
|
|
137
|
-
|
|
138
|
-
<Resizable defaultSizes={sizes} onSizesChange={handleSizesChange}>
|
|
139
|
-
{/* Panels and handles */}
|
|
140
|
-
</Resizable>
|
|
141
148
|
```
|
|
142
149
|
|
|
143
|
-
### **Accessibility**
|
|
144
|
-
The Resizable component is fully accessible:
|
|
145
|
-
|
|
146
|
-
- Handles have proper ARIA attributes
|
|
147
|
-
- Keyboard navigation is supported (arrow keys to resize, Enter to start resizing, Escape to cancel)
|
|
148
|
-
- Focus management for keyboard users
|