@app-studio/web 0.9.31 → 0.9.33

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 (61) hide show
  1. package/docs/components/Accordion.mdx +158 -0
  2. package/docs/components/Alert.mdx +123 -0
  3. package/docs/components/AspectRatio.mdx +55 -0
  4. package/docs/components/Avatar.mdx +85 -0
  5. package/docs/components/Background.mdx +522 -0
  6. package/docs/components/Badge.mdx +220 -0
  7. package/docs/components/Button.mdx +272 -0
  8. package/docs/components/Calendar.mdx +274 -0
  9. package/docs/components/Card.mdx +341 -0
  10. package/docs/components/Carousel.mdx +411 -0
  11. package/docs/components/Center.mdx +474 -0
  12. package/docs/components/Chart.mdx +232 -0
  13. package/docs/components/ChatInput.mdx +373 -0
  14. package/docs/components/Checkbox.mdx +66 -0
  15. package/docs/components/ColorInput.mdx +209 -0
  16. package/docs/components/ComboBox.mdx +364 -0
  17. package/docs/components/Command.mdx +252 -0
  18. package/docs/components/ContextMenu.mdx +219 -0
  19. package/docs/components/CountryPicker.mdx +123 -0
  20. package/docs/components/DatePicker.mdx +77 -0
  21. package/docs/components/DragAndDrop.mdx +539 -0
  22. package/docs/components/DropdownMenu.mdx +205 -0
  23. package/docs/components/File.mdx +8 -0
  24. package/docs/components/Flow.mdx +257 -0
  25. package/docs/components/Form.mdx +681 -0
  26. package/docs/components/Formik.mdx +621 -0
  27. package/docs/components/Gradient.mdx +271 -0
  28. package/docs/components/Horizontal.mdx +40 -0
  29. package/docs/components/HoverCard.mdx +140 -0
  30. package/docs/components/Icon.mdx +438 -0
  31. package/docs/components/Label.mdx +438 -0
  32. package/docs/components/Link.mdx +83 -0
  33. package/docs/components/Loader.mdx +527 -0
  34. package/docs/components/Menubar.mdx +124 -0
  35. package/docs/components/Message.mdx +571 -0
  36. package/docs/components/Modal.mdx +533 -0
  37. package/docs/components/NavigationMenu.mdx +165 -0
  38. package/docs/components/Pagination.mdx +150 -0
  39. package/docs/components/Password.mdx +121 -0
  40. package/docs/components/Resizable.mdx +148 -0
  41. package/docs/components/Select.mdx +126 -0
  42. package/docs/components/Separator.mdx +121 -0
  43. package/docs/components/Sidebar.mdx +147 -0
  44. package/docs/components/Slider.mdx +232 -0
  45. package/docs/components/Switch.mdx +62 -0
  46. package/docs/components/Table.mdx +409 -0
  47. package/docs/components/Tabs.mdx +215 -0
  48. package/docs/components/TagInput.mdx +528 -0
  49. package/docs/components/Text.mdx +163 -0
  50. package/docs/components/TextArea.mdx +136 -0
  51. package/docs/components/TextField.mdx +225 -0
  52. package/docs/components/Title.mdx +535 -0
  53. package/docs/components/Toast.mdx +165 -0
  54. package/docs/components/Toggle.mdx +141 -0
  55. package/docs/components/ToggleGroup.mdx +165 -0
  56. package/docs/components/Tooltip.mdx +191 -0
  57. package/docs/components/Tree.mdx +340 -0
  58. package/docs/components/Uploader.mdx +426 -0
  59. package/docs/components/Vertical.mdx +566 -0
  60. package/docs/components.md +285 -0
  61. package/package.json +1 -1
@@ -0,0 +1,438 @@
1
+ # Icon
2
+
3
+ A comprehensive collection of SVG icons with consistent styling, customizable colors, sizes, and orientations. All icons are optimized for accessibility and performance, with support for filled and outlined variants.
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import * as Icon from '@app-studio/web';
8
+ // Or import specific icons
9
+ import {
10
+ UploadIcon,
11
+ DownloadIcon,
12
+ EditIcon,
13
+ DeleteIcon,
14
+ CloseIcon,
15
+ CheckIcon
16
+ } from '@app-studio/web';
17
+ ```
18
+
19
+ ### **Basic Usage**
20
+ ```tsx
21
+ import React from 'react';
22
+ import { UploadIcon, EditIcon, DeleteIcon } from '@app-studio/web';
23
+ import { Horizontal } from 'app-studio';
24
+
25
+ export const BasicIcons = () => (
26
+ <Horizontal gap={16}>
27
+ <UploadIcon widthHeight={24} />
28
+ <EditIcon widthHeight={24} />
29
+ <DeleteIcon widthHeight={24} />
30
+ </Horizontal>
31
+ );
32
+ ```
33
+
34
+ ### **Icon Sizes**
35
+ ```tsx
36
+ import React from 'react';
37
+ import { StarIcon } from '@app-studio/web';
38
+ import { Horizontal } from 'app-studio';
39
+
40
+ export const IconSizes = () => (
41
+ <Horizontal gap={16} alignItems="center">
42
+ <StarIcon widthHeight={16} />
43
+ <StarIcon widthHeight={24} />
44
+ <StarIcon widthHeight={32} />
45
+ <StarIcon widthHeight={48} />
46
+ <StarIcon widthHeight={64} />
47
+ </Horizontal>
48
+ );
49
+ ```
50
+
51
+ ### **Icon Colors**
52
+ ```tsx
53
+ import React from 'react';
54
+ import { HeartIcon } from '@app-studio/web';
55
+ import { Horizontal } from 'app-studio';
56
+
57
+ export const IconColors = () => (
58
+ <Horizontal gap={16}>
59
+ <HeartIcon widthHeight={32} color="color.red.500" />
60
+ <HeartIcon widthHeight={32} color="color.blue.500" />
61
+ <HeartIcon widthHeight={32} color="color.green.500" />
62
+ <HeartIcon widthHeight={32} color="color.purple.500" />
63
+ <HeartIcon widthHeight={32} color="color.orange.500" />
64
+ </Horizontal>
65
+ );
66
+ ```
67
+
68
+ ### **Filled vs Outlined**
69
+ ```tsx
70
+ import React from 'react';
71
+ import { StarIcon, HeartIcon, BookmarkIcon } from '@app-studio/web';
72
+ import { Horizontal, Vertical, Text } from 'app-studio';
73
+
74
+ export const IconVariants = () => (
75
+ <Vertical gap={16}>
76
+ <Text>Filled Icons</Text>
77
+ <Horizontal gap={16}>
78
+ <StarIcon widthHeight={32} filled={true} color="color.yellow.500" />
79
+ <HeartIcon widthHeight={32} filled={true} color="color.red.500" />
80
+ <BookmarkIcon widthHeight={32} filled={true} color="color.blue.500" />
81
+ </Horizontal>
82
+
83
+ <Text>Outlined Icons</Text>
84
+ <Horizontal gap={16}>
85
+ <StarIcon widthHeight={32} filled={false} color="color.yellow.500" />
86
+ <HeartIcon widthHeight={32} filled={false} color="color.red.500" />
87
+ <BookmarkIcon widthHeight={32} filled={false} color="color.blue.500" />
88
+ </Horizontal>
89
+ </Vertical>
90
+ );
91
+ ```
92
+
93
+ ### **Icon Orientations**
94
+ ```tsx
95
+ import React from 'react';
96
+ import { ArrowIcon } from '@app-studio/web';
97
+ import { Horizontal, Text } from 'app-studio';
98
+
99
+ export const IconOrientations = () => (
100
+ <Horizontal gap={24} alignItems="center">
101
+ <div>
102
+ <Text fontSize={12}>Up</Text>
103
+ <ArrowIcon widthHeight={32} orientation="up" />
104
+ </div>
105
+ <div>
106
+ <Text fontSize={12}>Right</Text>
107
+ <ArrowIcon widthHeight={32} orientation="right" />
108
+ </div>
109
+ <div>
110
+ <Text fontSize={12}>Down</Text>
111
+ <ArrowIcon widthHeight={32} orientation="down" />
112
+ </div>
113
+ <div>
114
+ <Text fontSize={12}>Left</Text>
115
+ <ArrowIcon widthHeight={32} orientation="left" />
116
+ </div>
117
+ </Horizontal>
118
+ );
119
+ ```
120
+
121
+ ### **Available Icons**
122
+
123
+ The icon library includes a comprehensive set of icons organized by category:
124
+
125
+ **Navigation & Actions:**
126
+ - `ArrowIcon` - Directional arrows with orientation support
127
+ - `ChevronIcon` - Chevron arrows for dropdowns and navigation
128
+ - `CloseIcon` - Close/X icon for modals and dismissible elements
129
+ - `MenuIcon` - Hamburger menu icon
130
+ - `BackIcon` - Back navigation arrow
131
+ - `ForwardIcon` - Forward navigation arrow
132
+
133
+ **File & Media:**
134
+ - `UploadIcon` - File upload indicator
135
+ - `DownloadIcon` - File download indicator
136
+ - `ImageIcon` - Image file representation
137
+ - `VideoIcon` - Video file representation
138
+ - `FileIcon` - Generic file representation
139
+ - `FolderIcon` - Folder/directory representation
140
+ - `AttachmentIcon` - File attachment indicator
141
+
142
+ **User Interface:**
143
+ - `EditIcon` - Edit/pencil icon for editing actions
144
+ - `DeleteIcon` / `DustBinIcon` - Delete/trash actions
145
+ - `CopyIcon` - Copy to clipboard actions
146
+ - `SearchIcon` - Search functionality
147
+ - `FilterIcon` - Filter/sort functionality
148
+ - `SettingsIcon` - Settings and configuration
149
+ - `InfoIcon` - Information and help
150
+ - `WarningIcon` - Warning and alert states
151
+ - `ErrorIcon` - Error states
152
+ - `CheckIcon` - Success and confirmation
153
+ - `PlusIcon` - Add/create actions
154
+ - `MinusIcon` - Remove/subtract actions
155
+
156
+ **Social & Communication:**
157
+ - `FacebookIcon` - Facebook social media
158
+ - `XIcon` - X (Twitter) social media
159
+ - `MessageIcon` - Chat and messaging
160
+ - `MailIcon` - Email communication
161
+ - `PhoneIcon` - Phone and calling
162
+ - `ShareIcon` - Share functionality
163
+
164
+ **Media Controls:**
165
+ - `PlayIcon` - Play media content
166
+ - `PauseIcon` - Pause media content
167
+ - `StopIcon` - Stop media content
168
+ - `VolumeIcon` - Audio volume control
169
+ - `MuteIcon` - Mute audio
170
+
171
+ **Status & Indicators:**
172
+ - `LoadingSpinnerIcon` - Loading and progress states
173
+ - `StarIcon` - Ratings and favorites
174
+ - `HeartIcon` - Likes and favorites
175
+ - `BookmarkIcon` - Bookmarks and saved items
176
+ - `BellIcon` - Notifications
177
+ - `BadgeIcon` - Status badges
178
+
179
+ ### **Icon Usage in Components**
180
+ ```tsx
181
+ import React from 'react';
182
+ import { Button } from '@app-studio/web';
183
+ import { EditIcon, DeleteIcon, SaveIcon } from '@app-studio/web';
184
+ import { Horizontal } from 'app-studio';
185
+
186
+ export const IconButtons = () => (
187
+ <Horizontal gap={12}>
188
+ <Button
189
+ icon={<EditIcon widthHeight={16} />}
190
+ variant="outline"
191
+ >
192
+ Edit
193
+ </Button>
194
+ <Button
195
+ icon={<DeleteIcon widthHeight={16} />}
196
+ variant="outline"
197
+ colorScheme="theme.error"
198
+ >
199
+ Delete
200
+ </Button>
201
+ <Button
202
+ icon={<SaveIcon widthHeight={16} />}
203
+ variant="filled"
204
+ colorScheme="theme.primary"
205
+ >
206
+ Save
207
+ </Button>
208
+ </Horizontal>
209
+ );
210
+ ```
211
+
212
+ ### **Custom Icon Styling**
213
+ ```tsx
214
+ import React from 'react';
215
+ import { StarIcon } from '@app-studio/web';
216
+ import { View } from 'app-studio';
217
+
218
+ export const CustomStyledIcon = () => (
219
+ <View>
220
+ <StarIcon
221
+ widthHeight={48}
222
+ color="color.yellow.400"
223
+ filled={true}
224
+ style={{
225
+ filter: 'drop-shadow(0 2px 4px rgba(0,0,0,0.2))',
226
+ transition: 'transform 0.2s ease',
227
+ }}
228
+ onMouseEnter={(e) => {
229
+ e.currentTarget.style.transform = 'scale(1.1)';
230
+ }}
231
+ onMouseLeave={(e) => {
232
+ e.currentTarget.style.transform = 'scale(1)';
233
+ }}
234
+ />
235
+ </View>
236
+ );
237
+ ```
238
+
239
+ ### **Props**
240
+
241
+ | Prop | Type | Default | Description |
242
+ | ---- | ---- | ------- | ----------- |
243
+ | widthHeight | number | 24 | Size of the icon in pixels (sets both width and height) |
244
+ | color | string | 'currentColor' | Color of the icon (supports theme colors) |
245
+ | filled | boolean | varies by icon | Whether the icon should be filled or outlined |
246
+ | strokeWidth | number | 1-2 | Stroke width for outlined icons |
247
+ | orientation | `'left' \| 'right' \| 'up' \| 'down'` | 'up' | Orientation/rotation of the icon |
248
+ | transform | string | undefined | Custom CSS transform property |
249
+
250
+ ### **IconWrapper Props**
251
+
252
+ All icons inherit from the base `IconWrapper` component which extends `ViewProps`:
253
+
254
+ | Prop | Type | Description |
255
+ | ---- | ---- | ----------- |
256
+ | className | string | CSS class name for styling |
257
+ | style | CSSProperties | Inline styles |
258
+ | onClick | function | Click event handler |
259
+ | onMouseEnter | function | Mouse enter event handler |
260
+ | onMouseLeave | function | Mouse leave event handler |
261
+ | aria-label | string | Accessibility label |
262
+ | role | string | ARIA role |
263
+
264
+ ### **Responsive Icons**
265
+ ```tsx
266
+ import React from 'react';
267
+ import { MenuIcon } from '@app-studio/web';
268
+ import { useBreakpoint } from 'app-studio';
269
+
270
+ export const ResponsiveIcon = () => {
271
+ const { isMobile, isTablet, isDesktop } = useBreakpoint();
272
+
273
+ const iconSize = isMobile ? 20 : isTablet ? 24 : 28;
274
+
275
+ return (
276
+ <MenuIcon
277
+ widthHeight={iconSize}
278
+ color="color.gray.700"
279
+ />
280
+ );
281
+ };
282
+ ```
283
+
284
+ ### **Icon with Tooltip**
285
+ ```tsx
286
+ import React from 'react';
287
+ import { Tooltip } from '@app-studio/web';
288
+ import { InfoIcon } from '@app-studio/web';
289
+
290
+ export const IconWithTooltip = () => (
291
+ <Tooltip content="This provides additional information">
292
+ <InfoIcon
293
+ widthHeight={20}
294
+ color="color.blue.500"
295
+ style={{ cursor: 'help' }}
296
+ />
297
+ </Tooltip>
298
+ );
299
+ ```
300
+
301
+ ### **Animated Icons**
302
+ ```tsx
303
+ import React, { useState } from 'react';
304
+ import { HeartIcon } from '@app-studio/web';
305
+ import { View } from 'app-studio';
306
+
307
+ export const AnimatedIcon = () => {
308
+ const [isLiked, setIsLiked] = useState(false);
309
+
310
+ return (
311
+ <View
312
+ onClick={() => setIsLiked(!isLiked)}
313
+ style={{ cursor: 'pointer' }}
314
+ >
315
+ <HeartIcon
316
+ widthHeight={32}
317
+ color={isLiked ? 'color.red.500' : 'color.gray.400'}
318
+ filled={isLiked}
319
+ style={{
320
+ transition: 'all 0.2s ease',
321
+ transform: isLiked ? 'scale(1.2)' : 'scale(1)',
322
+ }}
323
+ />
324
+ </View>
325
+ );
326
+ };
327
+ ```
328
+
329
+ ### **Icon Grid Display**
330
+ ```tsx
331
+ import React from 'react';
332
+ import * as Icons from '@app-studio/web';
333
+ import { View, Text } from 'app-studio';
334
+
335
+ export const IconGrid = () => {
336
+ const iconNames = Object.keys(Icons).filter(name =>
337
+ name.endsWith('Icon') && name !== 'IconWrapper'
338
+ );
339
+
340
+ return (
341
+ <View
342
+ display="grid"
343
+ gridTemplateColumns="repeat(auto-fill, minmax(120px, 1fr))"
344
+ gap={16}
345
+ >
346
+ {iconNames.map((iconName) => {
347
+ const IconComponent = Icons[iconName as keyof typeof Icons];
348
+ return (
349
+ <View
350
+ key={iconName}
351
+ padding={12}
352
+ border="1px solid"
353
+ borderColor="color.gray.200"
354
+ borderRadius={8}
355
+ textAlign="center"
356
+ >
357
+ <IconComponent widthHeight={24} color="color.gray.700" />
358
+ <Text fontSize={10} marginTop={4}>
359
+ {iconName}
360
+ </Text>
361
+ </View>
362
+ );
363
+ })}
364
+ </View>
365
+ );
366
+ };
367
+ ```
368
+
369
+ ### **Best Practices**
370
+
371
+ **Sizing:**
372
+ - Use consistent icon sizes within the same context
373
+ - Standard sizes: 16px (small), 20px (medium), 24px (large), 32px+ (extra large)
374
+ - Consider touch targets for interactive icons (minimum 44px)
375
+
376
+ **Colors:**
377
+ - Use semantic colors for status icons (red for errors, green for success)
378
+ - Maintain sufficient contrast for accessibility
379
+ - Use theme colors for consistency across your application
380
+
381
+ **Accessibility:**
382
+ - Provide `aria-label` for standalone icons
383
+ - Use `role="img"` for decorative icons
384
+ - Ensure icons are not the only way to convey information
385
+
386
+ **Performance:**
387
+ - Icons are SVG-based for crisp rendering at any size
388
+ - Import only the icons you need to reduce bundle size
389
+ - Consider icon sprites for large applications
390
+
391
+ ### **Customization**
392
+
393
+ **Creating Custom Icons:**
394
+ ```tsx
395
+ import React from 'react';
396
+ import { IconWrapper, IconProps } from '@app-studio/web';
397
+
398
+ export const CustomIcon: React.FC<IconProps> = ({
399
+ widthHeight = 24,
400
+ color = 'currentColor',
401
+ filled = true,
402
+ ...props
403
+ }) => (
404
+ <IconWrapper widthHeight={widthHeight} color={color} {...props}>
405
+ <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
406
+ <path
407
+ d="M12 2L2 7v10c0 5.55 3.84 9.74 9 11 5.16-1.26 9-5.45 9-11V7l-10-5z"
408
+ fill={filled ? color : 'none'}
409
+ stroke={filled ? 'none' : color}
410
+ strokeWidth={filled ? 0 : 2}
411
+ />
412
+ </svg>
413
+ </IconWrapper>
414
+ );
415
+ ```
416
+
417
+ ### **Integration Examples**
418
+
419
+ **With Navigation:**
420
+ ```tsx
421
+ import React from 'react';
422
+ import { NavigationMenu } from '@app-studio/web';
423
+ import { HomeIcon, UserIcon, SettingsIcon } from '@app-studio/web';
424
+
425
+ export const IconNavigation = () => (
426
+ <NavigationMenu>
427
+ <NavigationMenu.Item icon={<HomeIcon widthHeight={20} />}>
428
+ Home
429
+ </NavigationMenu.Item>
430
+ <NavigationMenu.Item icon={<UserIcon widthHeight={20} />}>
431
+ Profile
432
+ </NavigationMenu.Item>
433
+ <NavigationMenu.Item icon={<SettingsIcon widthHeight={20} />}>
434
+ Settings
435
+ </NavigationMenu.Item>
436
+ </NavigationMenu>
437
+ );
438
+ ```