@app-studio/web 0.9.41 → 0.9.44

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.
Files changed (101) hide show
  1. package/dist/bot/Bot.d.ts +15 -0
  2. package/dist/bot/Cache.d.ts +13 -0
  3. package/dist/bot/Config.d.ts +13 -0
  4. package/dist/bot/ContentFetcher.d.ts +9 -0
  5. package/dist/bot/DocuCode.d.ts +19 -0
  6. package/dist/bot/FileHandler.d.ts +39 -0
  7. package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
  8. package/dist/bot/ai/GeminiConnector.d.ts +7 -0
  9. package/dist/bot/ai/GroqConnector.d.ts +7 -0
  10. package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
  11. package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
  12. package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
  13. package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
  14. package/dist/bot/ai/ai.config.d.ts +12 -0
  15. package/dist/bot/ai/ai.service.d.ts +36 -0
  16. package/dist/bot/data.d.ts +19 -0
  17. package/dist/bot/extractors.d.ts +8 -0
  18. package/dist/bot/index.d.ts +1 -0
  19. package/dist/bot/prompt/1-project.d.ts +1 -0
  20. package/dist/bot/prompt/2-response.d.ts +1 -0
  21. package/dist/bot/prompt/3-comment.d.ts +1 -0
  22. package/dist/components/Title/Title/SlideEffect.d.ts +14 -0
  23. package/dist/components/Title/Title/Title.props.d.ts +20 -0
  24. package/dist/components/Title/Title/Title.state.d.ts +4 -0
  25. package/dist/web.cjs.development.js +265 -78
  26. package/dist/web.cjs.development.js.map +1 -1
  27. package/dist/web.cjs.production.min.js +1 -1
  28. package/dist/web.cjs.production.min.js.map +1 -1
  29. package/dist/web.esm.js +265 -78
  30. package/dist/web.esm.js.map +1 -1
  31. package/dist/web.umd.development.js +265 -78
  32. package/dist/web.umd.development.js.map +1 -1
  33. package/dist/web.umd.production.min.js +1 -1
  34. package/dist/web.umd.production.min.js.map +1 -1
  35. package/docs/components/Accordion.mdx +74 -121
  36. package/docs/components/Alert.mdx +19 -70
  37. package/docs/components/AspectRatio.mdx +13 -11
  38. package/docs/components/AudioInput.mdx +43 -0
  39. package/docs/components/Avatar.mdx +18 -43
  40. package/docs/components/Background.mdx +100 -492
  41. package/docs/components/Badge.mdx +45 -130
  42. package/docs/components/Button.mdx +76 -128
  43. package/docs/components/Calendar.mdx +7 -7
  44. package/docs/components/Card.mdx +247 -290
  45. package/docs/components/Carousel.mdx +94 -321
  46. package/docs/components/Chart.mdx +171 -26
  47. package/docs/components/ChatInput.mdx +327 -275
  48. package/docs/components/Checkbox.mdx +3 -5
  49. package/docs/components/ColorInput.mdx +6 -6
  50. package/docs/components/ColorPicker.mdx +452 -0
  51. package/docs/components/ComboBox.mdx +13 -13
  52. package/docs/components/Command.mdx +140 -188
  53. package/docs/components/ContextMenu.mdx +47 -171
  54. package/docs/components/CookieConsent.mdx +53 -0
  55. package/docs/components/CountryPicker.mdx +8 -8
  56. package/docs/components/DatePicker.mdx +3 -3
  57. package/docs/components/DragAndDrop.mdx +279 -463
  58. package/docs/components/Drawer.mdx +392 -231
  59. package/docs/components/DropdownMenu.mdx +37 -155
  60. package/docs/components/EmojiPicker.mdx +84 -0
  61. package/docs/components/File.mdx +130 -4
  62. package/docs/components/Formik.mdx +39 -39
  63. package/docs/components/Gradient.mdx +359 -182
  64. package/docs/components/Horizontal.mdx +1 -2
  65. package/docs/components/HoverCard.mdx +57 -125
  66. package/docs/components/KanbanBoard.mdx +9 -9
  67. package/docs/components/Link.mdx +22 -30
  68. package/docs/components/Loader.mdx +230 -413
  69. package/docs/components/Menubar.mdx +73 -69
  70. package/docs/components/Message.mdx +210 -525
  71. package/docs/components/Modal.mdx +351 -475
  72. package/docs/components/NavigationMenu.mdx +8 -8
  73. package/docs/components/OTPInput.mdx +194 -0
  74. package/docs/components/Pagination.mdx +451 -107
  75. package/docs/components/Password.mdx +8 -8
  76. package/docs/components/ProgressBar.mdx +460 -0
  77. package/docs/components/Resizable.mdx +103 -102
  78. package/docs/components/Select.mdx +5 -5
  79. package/docs/components/Separator.mdx +11 -98
  80. package/docs/components/ShareButton.mdx +29 -0
  81. package/docs/components/Sidebar.mdx +70 -131
  82. package/docs/components/Slider.mdx +99 -185
  83. package/docs/components/StatusIndicator.mdx +373 -0
  84. package/docs/components/Switch.mdx +3 -3
  85. package/docs/components/Table.mdx +25 -105
  86. package/docs/components/Tabs.mdx +40 -143
  87. package/docs/components/TagInput.mdx +17 -17
  88. package/docs/components/Text.mdx +3 -3
  89. package/docs/components/TextArea.mdx +6 -6
  90. package/docs/components/TextField.mdx +12 -12
  91. package/docs/components/Title.mdx +267 -525
  92. package/docs/components/Toast.mdx +65 -142
  93. package/docs/components/Toggle.mdx +37 -49
  94. package/docs/components/ToggleGroup.mdx +36 -57
  95. package/docs/components/Tooltip.mdx +501 -138
  96. package/docs/components/Uploader.mdx +205 -351
  97. package/package.json +1 -1
  98. package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
  99. package/dist/components/AuthGuard/index.d.ts +0 -1
  100. package/docs/adk-components.md +0 -319
  101. package/docs/adk-quick-start.md +0 -268
@@ -1,527 +1,344 @@
1
1
  # Loader
2
2
 
3
- A versatile loading indicator component with multiple animation types, customizable sizes, colors, and text positioning. Perfect for showing loading states, progress indicators, and providing visual feedback during asynchronous operations.
3
+ A loading indicator component with multiple types, sizes, speeds, and text positioning options.
4
4
 
5
5
  ### **Import**
6
- ```tsx
7
- import { Loader } from '@app-studio/web';
8
- ```
6
+ ```tsx
7
+ import { Loader } from '@app-studio/web';
8
+ ```
9
9
 
10
- ### **Basic Usage**
10
+ ### **Default**
11
11
  ```tsx
12
12
  import React from 'react';
13
13
  import { Loader } from '@app-studio/web';
14
14
 
15
- export const BasicLoader = () => (
16
- <Loader>Loading...</Loader>
15
+ export const DefaultLoader = () => (
16
+ <Loader />
17
17
  );
18
18
  ```
19
19
 
20
- ### **Loader Types**
20
+ ### **type**
21
+ Defines the type of the loader.
22
+
23
+ - **Type:** `LoaderType`
24
+ - **Default:** `'spinner'`
25
+ - **Possible Values:** `'spinner' | 'dotted' | 'quarter' | 'pulse' | 'bars'`
26
+
21
27
  ```tsx
22
28
  import React from 'react';
23
29
  import { Loader } from '@app-studio/web';
24
- import { Vertical, Horizontal } from '@app-studio/web';
30
+ import { Horizontal } from 'app-studio';
25
31
 
26
32
  export const LoaderTypes = () => (
27
- <Vertical gap={24}>
28
- <Horizontal gap={32} alignItems="center">
29
- <Loader type="default">Default Spinner</Loader>
30
- <Loader type="dotted">Dotted Loader</Loader>
31
- <Loader type="quarter">Quarter Loader</Loader>
32
- </Horizontal>
33
- </Vertical>
33
+ <Horizontal gap={30}>
34
+ <Loader type="spinner" />
35
+ <Loader type="dotted" />
36
+ <Loader type="quarter" />
37
+ <Loader type="pulse" />
38
+ <Loader type="bars" />
39
+ </Horizontal>
34
40
  );
35
41
  ```
36
42
 
37
- ### **Loader Sizes**
43
+ ### **size**
44
+ Sets the size of the loader.
45
+
46
+ - **Type:** `number | Size`
47
+ - **Default:** `'md'`
48
+ - **Possible Values:** `'xs' | 'sm' | 'md' | 'lg' | 'xl'` or pixel number
49
+
38
50
  ```tsx
39
51
  import React from 'react';
40
52
  import { Loader } from '@app-studio/web';
41
- import { Horizontal } from '@app-studio/web';
53
+ import { Horizontal } from 'app-studio';
42
54
 
43
55
  export const LoaderSizes = () => (
44
- <Horizontal gap={24} alignItems="center">
45
- <Loader size="xs">XS</Loader>
46
- <Loader size="sm">Small</Loader>
47
- <Loader size="md">Medium</Loader>
48
- <Loader size="lg">Large</Loader>
49
- <Loader size="xl">XL</Loader>
56
+ <Horizontal gap={20} alignItems="center">
57
+ <Loader size="xs" />
58
+ <Loader size="sm" />
59
+ <Loader size="md" />
60
+ <Loader size="lg" />
61
+ <Loader size="xl" />
50
62
  </Horizontal>
51
63
  );
52
64
  ```
53
65
 
54
- ### **Custom Sizes**
66
+ ### **Custom Size**
67
+ Using pixel values for custom sizes.
68
+
55
69
  ```tsx
56
70
  import React from 'react';
57
71
  import { Loader } from '@app-studio/web';
58
- import { Horizontal } from '@app-studio/web';
59
-
60
- export const CustomSizes = () => (
61
- <Horizontal gap={24} alignItems="center">
62
- <Loader size={16}>16px</Loader>
63
- <Loader size={32}>32px</Loader>
64
- <Loader size={48}>48px</Loader>
65
- <Loader size={64}>64px</Loader>
72
+ import { Horizontal } from 'app-studio';
73
+
74
+ export const CustomSizeLoaders = () => (
75
+ <Horizontal gap={20} alignItems="center">
76
+ <Loader size={16} />
77
+ <Loader size={32} />
78
+ <Loader size={48} />
79
+ <Loader size={64} />
66
80
  </Horizontal>
67
81
  );
68
82
  ```
69
83
 
70
- ### **Text Positioning**
71
- ```tsx
72
- import React from 'react';
73
- import { Loader } from '@app-studio/web';
74
- import { Vertical } from '@app-studio/web';
75
-
76
- export const TextPositioning = () => (
77
- <Vertical gap={32}>
78
- <Loader textPosition="right">Loading (Right)</Loader>
79
- <Loader textPosition="left">Loading (Left)</Loader>
80
- <Loader textPosition="top">Loading (Top)</Loader>
81
- <Loader textPosition="bottom">Loading (Bottom)</Loader>
82
- </Vertical>
83
- );
84
- ```
84
+ ### **loaderColor**
85
+ Defines the color of the loader element.
86
+
87
+ - **Type:** `string`
85
88
 
86
- ### **Colors and Theming**
87
89
  ```tsx
88
90
  import React from 'react';
89
91
  import { Loader } from '@app-studio/web';
90
- import { Vertical } from '@app-studio/web';
92
+ import { Horizontal } from 'app-studio';
91
93
 
92
94
  export const ColoredLoaders = () => (
93
- <Vertical gap={20}>
94
- <Loader
95
- loaderColor="color.blue.500"
96
- textColor="color.blue.700"
97
- >
98
- Blue Loader
99
- </Loader>
100
-
101
- <Loader
102
- loaderColor="color.green.500"
103
- textColor="color.green.700"
104
- >
105
- Green Loader
106
- </Loader>
107
-
108
- <Loader
109
- loaderColor="color.red.500"
110
- textColor="color.red.700"
111
- >
112
- Red Loader
113
- </Loader>
114
-
115
- <Loader
116
- loaderColor="theme.primary"
117
- textColor="theme.primary"
118
- >
119
- Theme Primary
120
- </Loader>
121
- </Vertical>
95
+ <Horizontal gap={30}>
96
+ <Loader loaderColor="#3b82f6" />
97
+ <Loader loaderColor="#10b981" />
98
+ <Loader loaderColor="#ef4444" />
99
+ <Loader loaderColor="#f59e0b" />
100
+ <Loader loaderColor="#8b5cf6" />
101
+ </Horizontal>
122
102
  );
123
103
  ```
124
104
 
125
- ### **Animation Speeds**
105
+ ### **speed**
106
+ Controls the speed of the loader's animation.
107
+
108
+ - **Type:** `Speed`
109
+ - **Default:** `'normal'`
110
+ - **Possible Values:** `'slow' | 'normal' | 'fast'`
111
+
126
112
  ```tsx
127
113
  import React from 'react';
128
114
  import { Loader } from '@app-studio/web';
129
- import { Horizontal } from '@app-studio/web';
115
+ import { Horizontal } from 'app-studio';
130
116
 
131
- export const AnimationSpeeds = () => (
132
- <Horizontal gap={32} alignItems="center">
133
- <Loader speed="slow">Slow</Loader>
134
- <Loader speed="normal">Normal</Loader>
135
- <Loader speed="fast">Fast</Loader>
117
+ export const LoaderSpeeds = () => (
118
+ <Horizontal gap={30}>
119
+ <Loader speed="slow" />
120
+ <Loader speed="normal" />
121
+ <Loader speed="fast" />
136
122
  </Horizontal>
137
123
  );
138
124
  ```
139
125
 
140
- ### **Loading States in Components**
141
- ```tsx
142
- import React, { useState } from 'react';
143
- import { Loader } from '@app-studio/web';
144
- import { Button } from '@app-studio/web';
145
- import { View, Text, Vertical } from '@app-studio/web';
126
+ ### **children**
127
+ Text or content to display with the loader.
146
128
 
147
- export const LoadingStates = () => {
148
- const [isLoading, setIsLoading] = useState(false);
149
- const [data, setData] = useState(null);
150
-
151
- const handleLoad = async () => {
152
- setIsLoading(true);
153
- // Simulate API call
154
- setTimeout(() => {
155
- setData('Data loaded successfully!');
156
- setIsLoading(false);
157
- }, 2000);
158
- };
129
+ - **Type:** `React.ReactNode`
159
130
 
160
- return (
161
- <Vertical gap={20} alignItems="center">
162
- <Button onClick={handleLoad} disabled={isLoading}>
163
- Load Data
164
- </Button>
131
+ ```tsx
132
+ import React from 'react';
133
+ import { Loader } from '@app-studio/web';
165
134
 
166
- <View
167
- height={100}
168
- width={300}
169
- border="1px solid"
170
- borderColor="color.gray.200"
171
- borderRadius={8}
172
- display="flex"
173
- alignItems="center"
174
- justifyContent="center"
175
- >
176
- {isLoading ? (
177
- <Loader loaderColor="theme.primary">
178
- Loading data...
179
- </Loader>
180
- ) : data ? (
181
- <Text color="color.green.600">{data}</Text>
182
- ) : (
183
- <Text color="color.gray.500">No data loaded</Text>
184
- )}
185
- </View>
186
- </Vertical>
187
- );
188
- };
135
+ export const LoaderWithText = () => (
136
+ <Loader>Loading...</Loader>
137
+ );
189
138
  ```
190
139
 
191
- ### **Props**
192
-
193
- | Prop | Type | Default | Description |
194
- | ---- | ---- | ------- | ----------- |
195
- | children | React.ReactNode | undefined | Text to display alongside the loader |
196
- | type | `'default' \| 'dotted' \| 'quarter'` | 'default' | Type of loading animation |
197
- | size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| number` | 'md' | Size of the loader |
198
- | speed | `'slow' \| 'normal' \| 'fast'` | 'normal' | Animation speed |
199
- | loaderColor | string | 'currentColor' | Color of the loader animation |
200
- | textColor | string | 'currentColor' | Color of the text |
201
- | textPosition | `'left' \| 'right' \| 'top' \| 'bottom'` | 'right' | Position of text relative to loader |
140
+ ### **textPosition**
141
+ Determines the position of the text relative to the loader.
202
142
 
203
- **Inherited ViewProps:**
204
- - All standard view properties like `margin`, `padding`, `width`, `height`
205
- - Layout properties like `display`, `position`, `flex`
206
- - Styling properties like `backgroundColor`, `borderRadius`
143
+ - **Type:** `TextPosition`
144
+ - **Default:** `'bottom'`
145
+ - **Possible Values:** `'top' | 'bottom' | 'left' | 'right'`
207
146
 
208
- ### **Full Page Loading**
209
147
  ```tsx
210
148
  import React from 'react';
211
149
  import { Loader } from '@app-studio/web';
212
- import { Center } from '@app-studio/web';
213
-
214
- export const FullPageLoader = () => (
215
- <Center
216
- position="fixed"
217
- top={0}
218
- left={0}
219
- right={0}
220
- bottom={0}
221
- backgroundColor="rgba(255, 255, 255, 0.9)"
222
- zIndex={9999}
223
- >
224
- <Loader
225
- size="lg"
226
- loaderColor="theme.primary"
227
- textColor="theme.primary"
228
- >
229
- Loading application...
230
- </Loader>
231
- </Center>
150
+ import { Vertical } from 'app-studio';
151
+
152
+ export const TextPositions = () => (
153
+ <Vertical gap={30}>
154
+ <Loader textPosition="top">Loading from top</Loader>
155
+ <Loader textPosition="bottom">Loading from bottom</Loader>
156
+ <Loader textPosition="left">Loading from left</Loader>
157
+ <Loader textPosition="right">Loading from right</Loader>
158
+ </Vertical>
232
159
  );
233
160
  ```
234
161
 
235
- ### **Inline Loading**
236
- ```tsx
237
- import React, { useState } from 'react';
238
- import { Loader } from '@app-studio/web';
239
- import { Button } from '@app-studio/web';
240
- import { Horizontal, Text } from '@app-studio/web';
241
-
242
- export const InlineLoader = () => {
243
- const [saving, setSaving] = useState(false);
162
+ ### **textColor**
163
+ Sets the color of the text displayed with the loader.
244
164
 
245
- const handleSave = () => {
246
- setSaving(true);
247
- setTimeout(() => setSaving(false), 2000);
248
- };
165
+ - **Type:** `string`
249
166
 
250
- return (
251
- <Horizontal gap={16} alignItems="center">
252
- <Button onClick={handleSave} disabled={saving}>
253
- Save Changes
254
- </Button>
255
-
256
- {saving && (
257
- <Loader size="sm" loaderColor="color.blue.500">
258
- Saving...
259
- </Loader>
260
- )}
261
-
262
- {!saving && (
263
- <Text color="color.green.600" fontSize={14}>
264
- All changes saved
265
- </Text>
266
- )}
267
- </Horizontal>
268
- );
269
- };
270
- ```
271
-
272
- ### **Card Loading State**
273
167
  ```tsx
274
- import React, { useState, useEffect } from 'react';
168
+ import React from 'react';
275
169
  import { Loader } from '@app-studio/web';
276
- import { View, Text, Vertical } from '@app-studio/web';
277
-
278
- export const CardLoader = () => {
279
- const [loading, setLoading] = useState(true);
280
- const [content, setContent] = useState(null);
281
-
282
- useEffect(() => {
283
- // Simulate data loading
284
- setTimeout(() => {
285
- setContent({
286
- title: 'Card Title',
287
- description: 'This is the card content that was loaded.',
288
- });
289
- setLoading(false);
290
- }, 3000);
291
- }, []);
292
170
 
293
- return (
294
- <View
295
- width={300}
296
- height={200}
297
- border="1px solid"
298
- borderColor="color.gray.200"
299
- borderRadius={12}
300
- padding={20}
301
- backgroundColor="color.white"
302
- >
303
- {loading ? (
304
- <Center height="100%">
305
- <Loader
306
- type="dotted"
307
- loaderColor="color.gray.400"
308
- textColor="color.gray.600"
309
- >
310
- Loading content...
311
- </Loader>
312
- </Center>
313
- ) : (
314
- <Vertical gap={12}>
315
- <Text fontSize={18} fontWeight="bold">
316
- {content.title}
317
- </Text>
318
- <Text color="color.gray.600">
319
- {content.description}
320
- </Text>
321
- </Vertical>
322
- )}
323
- </View>
324
- );
325
- };
171
+ export const ColoredTextLoader = () => (
172
+ <Loader
173
+ loaderColor="#3b82f6"
174
+ textColor="#3b82f6"
175
+ >
176
+ Loading...
177
+ </Loader>
178
+ );
326
179
  ```
327
180
 
328
- ### **Button Loading States**
181
+ ### **Loading States**
182
+ Common loading state patterns.
183
+
329
184
  ```tsx
330
185
  import React, { useState } from 'react';
331
186
  import { Loader } from '@app-studio/web';
332
- import { Button } from '@app-studio/web';
333
- import { Horizontal } from '@app-studio/web';
334
-
335
- export const ButtonLoaders = () => {
336
- const [loading1, setLoading1] = useState(false);
337
- const [loading2, setLoading2] = useState(false);
187
+ import { Button, Vertical } from 'app-studio';
338
188
 
189
+ export const LoadingStates = () => {
190
+ const [loading, setLoading] = useState(false);
191
+
339
192
  return (
340
- <Horizontal gap={16}>
341
- <Button
342
- onClick={() => {
343
- setLoading1(true);
344
- setTimeout(() => setLoading1(false), 2000);
345
- }}
346
- disabled={loading1}
347
- icon={loading1 ? <Loader size={16} loaderColor="currentColor" /> : undefined}
348
- >
349
- {loading1 ? 'Submitting...' : 'Submit'}
350
- </Button>
351
-
352
- <Button
353
- variant="outline"
193
+ <Vertical gap={20}>
194
+ <Button
354
195
  onClick={() => {
355
- setLoading2(true);
356
- setTimeout(() => setLoading2(false), 2000);
196
+ setLoading(true);
197
+ setTimeout(() => setLoading(false), 3000);
357
198
  }}
358
- disabled={loading2}
359
199
  >
360
- {loading2 ? (
361
- <Loader size={16} loaderColor="currentColor">
362
- Processing
363
- </Loader>
364
- ) : (
365
- 'Process'
366
- )}
200
+ Start Loading
367
201
  </Button>
368
- </Horizontal>
202
+
203
+ {loading && (
204
+ <Loader>Please wait...</Loader>
205
+ )}
206
+ </Vertical>
369
207
  );
370
208
  };
371
209
  ```
372
210
 
373
- ### **Custom Loader Styling**
211
+ ### **Inline Loader**
212
+ Small loader for inline use.
213
+
374
214
  ```tsx
375
215
  import React from 'react';
376
216
  import { Loader } from '@app-studio/web';
377
- import { View } from '@app-studio/web';
217
+ import { Text, Horizontal } from 'app-studio';
378
218
 
379
- export const CustomLoader = () => (
380
- <View
381
- padding={24}
382
- backgroundColor="color.gray.900"
383
- borderRadius={12}
384
- >
385
- <Loader
386
- type="quarter"
387
- size={48}
388
- loaderColor="color.white"
389
- textColor="color.white"
390
- textPosition="bottom"
391
- views={{
392
- container: {
393
- gap: 16,
394
- },
395
- text: {
396
- fontWeight: 'medium',
397
- fontSize: 16,
398
- },
399
- }}
400
- >
401
- Loading...
402
- </Loader>
403
- </View>
219
+ export const InlineLoader = () => (
220
+ <Horizontal gap={10} alignItems="center">
221
+ <Text>Saving</Text>
222
+ <Loader size={16} />
223
+ </Horizontal>
404
224
  );
405
225
  ```
406
226
 
407
- ### **Best Practices**
408
-
409
- **When to Use:**
410
- - During API calls and data fetching
411
- - File uploads and downloads
412
- - Form submissions
413
- - Page transitions
414
- - Long-running operations
415
-
416
- **User Experience:**
417
- - Show loaders for operations taking longer than 200ms
418
- - Provide meaningful loading text when possible
419
- - Use appropriate sizes for the context
420
- - Consider skeleton screens for content loading
421
- - Ensure loaders are accessible to screen readers
422
-
423
- **Performance:**
424
- - Use CSS animations instead of JavaScript when possible
425
- - Avoid showing loaders for very quick operations
426
- - Consider lazy loading for better perceived performance
427
- - Use appropriate animation speeds (not too fast or slow)
428
-
429
- **Accessibility:**
430
- - Include descriptive text for screen readers
431
- - Use `aria-live` regions for dynamic loading states
432
- - Ensure sufficient color contrast
433
- - Provide alternative feedback for users who can't see animations
434
-
435
- ### **Integration Examples**
436
-
437
- **With Forms:**
438
- ```tsx
439
- import { FormikForm, FormikTextField } from '@app-studio/web';
227
+ ### **Full Page Loader**
228
+ Centered loader for full page loading.
440
229
 
441
- const FormWithLoader = () => {
442
- const [submitting, setSubmitting] = useState(false);
230
+ ```tsx
231
+ import React from 'react';
232
+ import { Loader } from '@app-studio/web';
233
+ import { Center } from 'app-studio';
443
234
 
444
- return (
445
- <FormikForm>
446
- <FormikTextField name="email" label="Email" />
447
- <Button
448
- type="submit"
449
- disabled={submitting}
450
- icon={submitting ? <Loader size={16} /> : undefined}
451
- >
452
- {submitting ? 'Submitting...' : 'Submit'}
453
- </Button>
454
- </FormikForm>
455
- );
456
- };
235
+ export const FullPageLoader = () => (
236
+ <Center width="100vw" height="100vh">
237
+ <Loader size="xl">Loading application...</Loader>
238
+ </Center>
239
+ );
457
240
  ```
458
241
 
459
- **With Data Tables:**
242
+ ### **Card Loading**
243
+ Loader inside a card component.
244
+
460
245
  ```tsx
461
- const DataTable = ({ data, loading }) => (
462
- <View>
463
- {loading ? (
464
- <Center height={200}>
465
- <Loader>Loading table data...</Loader>
466
- </Center>
467
- ) : (
468
- <Table data={data} />
469
- )}
470
- </View>
246
+ import React from 'react';
247
+ import { Loader } from '@app-studio/web';
248
+ import { Card } from '@app-studio/web';
249
+ import { Center } from 'app-studio';
250
+
251
+ export const CardLoader = () => (
252
+ <Card width={300} height={200}>
253
+ <Center width="100%" height="100%">
254
+ <Loader>Loading content...</Loader>
255
+ </Center>
256
+ </Card>
471
257
  );
472
258
  ```
473
259
 
474
- **With Image Loading:**
260
+ ### **Button Loading**
261
+ Loader integrated with button.
262
+
475
263
  ```tsx
476
- const ImageWithLoader = ({ src, alt }) => {
477
- const [loading, setLoading] = useState(true);
264
+ import React, { useState } from 'react';
265
+ import { Loader } from '@app-studio/web';
266
+ import { Button, Horizontal } from 'app-studio';
478
267
 
268
+ export const ButtonLoader = () => {
269
+ const [loading, setLoading] = useState(false);
270
+
479
271
  return (
480
- <View position="relative">
481
- {loading && (
482
- <Center
483
- position="absolute"
484
- top={0}
485
- left={0}
486
- right={0}
487
- bottom={0}
488
- backgroundColor="color.gray.100"
489
- >
490
- <Loader size="sm">Loading image...</Loader>
491
- </Center>
492
- )}
493
- <img
494
- src={src}
495
- alt={alt}
496
- onLoad={() => setLoading(false)}
497
- style={{ opacity: loading ? 0 : 1 }}
498
- />
499
- </View>
272
+ <Button
273
+ onClick={() => {
274
+ setLoading(true);
275
+ setTimeout(() => setLoading(false), 2000);
276
+ }}
277
+ isDisabled={loading}
278
+ >
279
+ <Horizontal gap={10} alignItems="center">
280
+ {loading && <Loader size={16} loaderColor="#ffffff" />}
281
+ {loading ? 'Submitting...' : 'Submit'}
282
+ </Horizontal>
283
+ </Button>
500
284
  );
501
285
  };
502
286
  ```
503
287
 
504
- ### **Advanced Patterns**
288
+ ### **Different Types Showcase**
289
+ Showcasing all loader types with customization.
505
290
 
506
- **Progress Loader:**
507
291
  ```tsx
508
- const ProgressLoader = ({ progress }) => (
509
- <Vertical gap={8} alignItems="center">
510
- <Loader size="lg" />
511
- <Text fontSize={14} color="color.gray.600">
512
- {progress}% complete
513
- </Text>
292
+ import React from 'react';
293
+ import { Loader } from '@app-studio/web';
294
+ import { Vertical, Horizontal, Text } from 'app-studio';
295
+
296
+ export const LoaderShowcase = () => (
297
+ <Vertical gap={30}>
298
+ <Vertical gap={15}>
299
+ <Text fontWeight="bold">Spinner Variants</Text>
300
+ <Horizontal gap={20}>
301
+ <Loader type="spinner" size="sm" loaderColor="#3b82f6" />
302
+ <Loader type="spinner" size="md" loaderColor="#10b981" />
303
+ <Loader type="spinner" size="lg" loaderColor="#ef4444" />
304
+ </Horizontal>
305
+ </Vertical>
306
+
307
+ <Vertical gap={15}>
308
+ <Text fontWeight="bold">Dotted Variants</Text>
309
+ <Horizontal gap={20}>
310
+ <Loader type="dotted" size="sm" loaderColor="#3b82f6" />
311
+ <Loader type="dotted" size="md" loaderColor="#10b981" />
312
+ <Loader type="dotted" size="lg" loaderColor="#ef4444" />
313
+ </Horizontal>
314
+ </Vertical>
315
+
316
+ <Vertical gap={15}>
317
+ <Text fontWeight="bold">With Text</Text>
318
+ <Horizontal gap={30}>
319
+ <Loader type="spinner" loaderColor="#3b82f6" textColor="#3b82f6">
320
+ Loading...
321
+ </Loader>
322
+ <Loader
323
+ type="dotted"
324
+ loaderColor="#10b981"
325
+ textColor="#10b981"
326
+ textPosition="right"
327
+ >
328
+ Processing
329
+ </Loader>
330
+ </Horizontal>
331
+ </Vertical>
332
+
333
+ <Vertical gap={15}>
334
+ <Text fontWeight="bold">Different Speeds</Text>
335
+ <Horizontal gap={30}>
336
+ <Loader speed="slow">Slow</Loader>
337
+ <Loader speed="normal">Normal</Loader>
338
+ <Loader speed="fast">Fast</Loader>
339
+ </Horizontal>
340
+ </Vertical>
514
341
  </Vertical>
515
342
  );
516
343
  ```
517
344
 
518
- **Conditional Loader:**
519
- ```tsx
520
- const ConditionalLoader = ({ condition, children }) => (
521
- condition ? (
522
- <Loader>Loading...</Loader>
523
- ) : (
524
- children
525
- )
526
- );
527
- ```