@app-studio/web 0.9.69 → 0.9.70

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.
@@ -1,22 +1,16 @@
1
1
  # Icon
2
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.
3
+ A comprehensive collection of SVG icons powered by [Lucide React](https://lucide.dev/), offering consistent styling, customizable colors, sizes, and orientations. All icons are optimized for accessibility and performance.
4
4
 
5
5
  ### **Import**
6
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';
7
+ import { Icon, UploadIcon, EditIcon } from '@app-studio/web';
17
8
  ```
18
9
 
19
10
  ### **Basic Usage**
11
+
12
+ You can use the named exports for common icons or the generic `Icon` component for any Lucide icon.
13
+
20
14
  ```tsx
21
15
  import React from 'react';
22
16
  import { UploadIcon, EditIcon, DeleteIcon } from '@app-studio/web';
@@ -31,6 +25,19 @@ export const BasicIcons = () => (
31
25
  );
32
26
  ```
33
27
 
28
+ ### **Dynamic Usage (All Lucide Icons)**
29
+
30
+ Access any icon from the [Lucide library](https://lucide.dev/icons) using the `name` prop.
31
+
32
+ ```tsx
33
+ import React from 'react';
34
+ import { Icon } from '@app-studio/web';
35
+
36
+ export const DynamicIcons = () => (
37
+ <Icon name="camera" widthHeight={24} color="color.primary.500" />
38
+ );
39
+ ```
40
+
34
41
  ### **Icon Sizes**
35
42
  ```tsx
36
43
  import React from 'react';
@@ -65,26 +72,26 @@ export const IconColors = () => (
65
72
  );
66
73
  ```
67
74
 
68
- ### **Filled vs Outlined**
75
+ ### **Icon Styles**
76
+ Since we use Lucide, `filled` creates a solid style where applicable, but generally Lucide icons are line-art. The `filled` prop typically fills the path with the current color.
77
+
69
78
  ```tsx
70
79
  import React from 'react';
71
- import { StarIcon, HeartIcon, BookmarkIcon } from '@app-studio/web';
80
+ import { StarIcon, HeartIcon } from '@app-studio/web';
72
81
  import { Horizontal, Vertical, Text } from '@app-studio/web';
73
82
 
74
83
  export const IconVariants = () => (
75
84
  <Vertical gap={16}>
76
- <Text>Filled Icons</Text>
85
+ <Text>Filled Styles</Text>
77
86
  <Horizontal gap={16}>
78
87
  <StarIcon widthHeight={32} filled={true} color="color.yellow.500" />
79
88
  <HeartIcon widthHeight={32} filled={true} color="color.red.500" />
80
- <BookmarkIcon widthHeight={32} filled={true} color="color.blue.500" />
81
89
  </Horizontal>
82
90
 
83
- <Text>Outlined Icons</Text>
91
+ <Text>Line Styles</Text>
84
92
  <Horizontal gap={16}>
85
93
  <StarIcon widthHeight={32} filled={false} color="color.yellow.500" />
86
94
  <HeartIcon widthHeight={32} filled={false} color="color.red.500" />
87
- <BookmarkIcon widthHeight={32} filled={false} color="color.blue.500" />
88
95
  </Horizontal>
89
96
  </Vertical>
90
97
  );
@@ -118,166 +125,121 @@ export const IconOrientations = () => (
118
125
  );
119
126
  ```
120
127
 
121
- ### **Available Icons (complete list)**
122
-
123
- Below is the complete list of exported icons with short English descriptions. Use the "Icon Grid Display" example to preview them.
124
-
125
- - `ArrowIcon` — Directional arrow with orientation (up/right/down/left).
126
- - `AttachmentIcon` — Attach a file (paperclip).
127
- - `AudioIcon` — Speaker with sound waves (audio on).
128
- - `BatteryIcon` — Battery/energy status.
129
- - `BluetoothIcon` — Bluetooth logo, wireless connectivity.
130
- - `BoldArrowIcon` — Thick arrow for primary action.
131
- - `BookmarkIcon` Bookmark / saved item.
132
- - `CalendarIcon` — Calendar / date / agenda.
133
- - `CameraIcon` — Camera / image capture.
134
- - `ChartIcon` — Document with lines, report/graph context.
135
- - `CheckIcon` — Validation / success (tick).
136
- - `ChevronIcon` — Chevron (navigation, expand/collapse).
137
- - `ClockIcon` — Clock / time / deadlines.
138
- - `CloseEyeIcon` — Eye-off, hide/mask content.
139
- - `CloseIcon` — Close / dismiss (cross).
140
- - `CloudIcon` — Cloud / storage / weather.
141
- - `CopyIcon` — Copy to clipboard.
142
- - `CropIcon` — Crop tool / image cropping.
143
- - `DeleteIcon` — Delete / trash.
144
- - `DocumentIcon` — Document/file with lines.
145
- - `DragHandleIcon` — Drag handle (grid of dots).
146
- - `DragHandleLinesIcon` — Drag handle (two lines).
147
- - `DustBinIcon` — Trash bin (alias of Delete).
148
- - `EditIcon` — Edit/modify (pencil).
149
- - `ErrorIcon` — Error / critical state.
150
- - `ExternalLinkIcon` — Open in new tab / external link.
151
- - `FacebookIcon` — Facebook social network.
152
- - `FileIcon` — Generic file.
153
- - `FilterIcon` — Filter / sort.
154
- - `FolderIcon` — Folder / directory.
155
- - `GiftIcon` — Gift / reward / promo.
156
- - `HeartIcon` — Like / favorite / love.
157
- - `HelpIcon` — Help / support / question mark.
158
- - `HomeIcon` — Home / main page.
159
- - `ImageIcon` — Image / media.
160
- - `InfoIcon` — Information / details.
161
- - `InstagramIcon` — Instagram social network.
162
- - `LikeIcon` — Thumbs up / like.
163
- - `LinkedinIcon` — LinkedIn social network.
164
- - `LoadingSpinnerIcon` — Loading / in progress.
165
- - `LocationIcon` — Location / pin.
166
- - `LockIcon` — Locked / secure.
167
- - `LogoutIcon` — Logout / sign out.
168
- - `MagicWandIcon` — Assistant / automation / magic.
169
- - `MenuIcon` — Hamburger menu.
170
- - `MicrophoneIcon` — Microphone / audio input.
171
- - `MinusIcon` — Minus / reduce / remove.
172
- - `MoonIcon` — Moon / dark mode / night.
173
- - `NotificationIcon` — Notifications / alert.
174
- - `OpenEyeIcon` — Eye-on, show/visibility.
175
- - `PanelIcon` — Layout with side panel.
176
- - `PauseIcon` — Pause media.
177
- - `PlayIcon` — Play media.
178
- - `PlusIcon` — Plus / add / create.
179
- - `PowerOffIcon` — Power / turn off.
180
- - `PrintIcon` — Print.
181
- - `ProfileIcon` — Profile / user.
182
- - `RefreshIcon` — Refresh / reload.
183
- - `RotateIcon` — Rotate / pivot.
184
- - `SaveIcon` — Save / persist.
185
- - `SearchIcon` — Search.
186
- - `SendIcon` — Send (paper plane).
187
- - `SettingsIcon` — Settings / configuration.
188
- - `ShapeIcon` — Shapes (rectangle/circle/polygon).
189
- - `ShieldIcon` — Shield / protection / security.
190
- - `SliderIcon` — Slider controls.
191
- - `SpinnerIcon` — Circular progress indicator.
192
- - `StarIcon` — Star / rating / favorite.
193
- - `StopIcon` — Stop media (square).
194
- - `SuccessIcon` — Success / validated (circle + tick).
195
- - `TextIcon` — Text / title.
196
- - `ThreadsIcon` — Threads social network.
197
- - `TickIcon` — Checkmark / validated.
198
- - `TrashIcon` — Trash (alias of Delete).
199
- - `TwitchIcon` — Twitch platform.
200
- - `TwitterIcon` — Twitter/X social network.
201
- - `UploadIcon` — Upload / send a file.
202
- - `UnLikeIcon` — Thumbs down / dislike.
203
- - `UnlockIcon` — Unlock / access.
204
- - `UserIcon` — User / account.
205
- - `VideoIcon` — Video / media.
206
- - `WifiIcon` — Wi‑Fi network.
207
- - `XIcon` — X social network.
208
- - `YoutubeIcon` — YouTube platform.
209
- - `ZoomInIcon` — Zoom in.
210
- - `ZoomOutIcon` — Zoom out.
211
-
212
- ### **Icon Usage in Components**
213
- ```tsx
214
- import React from 'react';
215
- import { Button } from '@app-studio/web';
216
- import { EditIcon, DeleteIcon, SaveIcon } from '@app-studio/web';
217
- import { Horizontal } from '@app-studio/web';
218
-
219
- export const IconButtons = () => (
220
- <Horizontal gap={12}>
221
- <Button
222
- icon={<EditIcon widthHeight={16} />}
223
- variant="outline"
224
- >
225
- Edit
226
- </Button>
227
- <Button
228
- icon={<DeleteIcon widthHeight={16} />}
229
- variant="outline"
230
- colorScheme="theme.error"
231
- >
232
- Delete
233
- </Button>
234
- <Button
235
- icon={<SaveIcon widthHeight={16} />}
236
- variant="filled"
237
- colorScheme="theme.primary"
238
- >
239
- Save
240
- </Button>
241
- </Horizontal>
242
- );
243
- ```
244
-
245
- ### **Custom Icon Styling**
246
- ```tsx
247
- import React from 'react';
248
- import { StarIcon } from '@app-studio/web';
249
- import { View } from '@app-studio/web';
250
-
251
- export const CustomStyledIcon = () => (
252
- <View>
253
- <StarIcon
254
- widthHeight={48}
255
- color="color.yellow.400"
256
- filled={true}
257
- style={{
258
- filter: 'drop-shadow(0 2px 4px rgba(0,0,0,0.2))',
259
- transition: 'transform 0.2s ease',
260
- }}
261
- onMouseEnter={(e) => {
262
- e.currentTarget.style.transform = 'scale(1.1)';
263
- }}
264
- onMouseLeave={(e) => {
265
- e.currentTarget.style.transform = 'scale(1)';
266
- }}
267
- />
268
- </View>
269
- );
270
- ```
128
+ ### **Available Pre-exported Icons**
129
+
130
+ We provide named exports for common icons for convenience and backward compatibility. For everything else, use `<Icon name="..." />`.
131
+
132
+ - `ArrowIcon` (arrow-up)
133
+ - `AttachmentIcon` (paperclip)
134
+ - `AudioIcon` (volume)
135
+ - `BackIcon` (chevron-left)
136
+ - `BatteryIcon` (battery)
137
+ - `BluetoothIcon` (bluetooth)
138
+ - `BoldArrowIcon` (arrow-right, approximate)
139
+ - `BookmarkIcon` (bookmark)
140
+ - `CalendarIcon` (calendar)
141
+ - `CameraIcon` (camera)
142
+ - `ChartIcon` (bar-chart)
143
+ - `CheckIcon` (check)
144
+ - `ChevronIcon` (chevron-up)
145
+ - `ClockIcon` (clock)
146
+ - `CloseEyeIcon` (eye-off)
147
+ - `CloseIcon` (x)
148
+ - `CloudIcon` (cloud)
149
+ - `CopyIcon` (copy)
150
+ - `CreditCardIcon` (credit-card)
151
+ - `CropIcon` (crop)
152
+ - `DeleteIcon` (trash)
153
+ - `DocumentIcon` (file-text)
154
+ - `DownloadIcon` (download)
155
+ - `DragHandleIcon` (grip-vertical)
156
+ - `DragHandleLinesIcon` (grip-horizontal)
157
+ - `DustBinIcon` (trash)
158
+ - `EditIcon` (edit)
159
+ - `ErrorIcon` (alert-circle)
160
+ - `ExternalLinkIcon` (external-link)
161
+ - `FacebookIcon` (facebook)
162
+ - `FileIcon` (file)
163
+ - `FilterIcon` (filter)
164
+ - `FolderIcon` (folder)
165
+ - `GiftIcon` (gift)
166
+ - `HeartIcon` (heart)
167
+ - `HelpIcon` (circle-help)
168
+ - `HomeIcon` (home)
169
+ - `ImageIcon` (image)
170
+ - `InfoIcon` (info)
171
+ - `InstagramIcon` (instagram)
172
+ - `LayoutIcon` (layout)
173
+ - `LikeIcon` (thumbs-up)
174
+ - `LinkIcon` (link)
175
+ - `LinkedinIcon` (linkedin)
176
+ - `LoadingSpinnerIcon` (loader)
177
+ - `LocationIcon` (map-pin)
178
+ - `LockIcon` (lock)
179
+ - `LogoutIcon` (log-out)
180
+ - `MagicWandIcon` (wand)
181
+ - `MapPinIcon` (map-pin)
182
+ - `MenuIcon` (menu)
183
+ - `MicrophoneIcon` (mic)
184
+ - `MinusIcon` (minus)
185
+ - `MoonIcon` (moon)
186
+ - `MoreHorizontalIcon` (more-horizontal)
187
+ - `MoreVerticalIcon` (more-vertical)
188
+ - `NotificationIcon` (bell)
189
+ - `OpenEyeIcon` (eye)
190
+ - `PanelIcon` (panel-left)
191
+ - `PauseIcon` (pause)
192
+ - `PlayIcon` (play)
193
+ - `PlusIcon` (plus)
194
+ - `PowerOffIcon` (power)
195
+ - `PrintIcon` (printer)
196
+ - `ProfileIcon` (user)
197
+ - `RefreshIcon` (refresh-cw)
198
+ - `RotateIcon` (rotate-cw)
199
+ - `SaveIcon` (save)
200
+ - `SearchIcon` (search)
201
+ - `SendIcon` (send)
202
+ - `SettingsIcon` (settings)
203
+ - `ShapeIcon` (shapes)
204
+ - `ShareIcon` (share)
205
+ - `ShieldIcon` (shield)
206
+ - `SliderIcon` (sliders-horizontal)
207
+ - `SpinnerIcon` (loader)
208
+ - `StarIcon` (star)
209
+ - `StopIcon` (square)
210
+ - `SuccessIcon` (check-circle)
211
+ - `TextIcon` (type)
212
+ - `ThreadsIcon` (at-sign)
213
+ - `TickIcon` (check)
214
+ - `TrashIcon` (trash)
215
+ - `TwitchIcon` (twitch)
216
+ - `TwitterIcon` (twitter)
217
+ - `UnLikeIcon` (thumbs-down)
218
+ - `UnlockIcon` (unlock)
219
+ - `UploadIcon` (upload)
220
+ - `UserIcon` (user)
221
+ - `VideoIcon` (video)
222
+ - `WarningIcon` (triangle-alert)
223
+ - `WifiIcon` (wifi)
224
+ - `XIcon` (x)
225
+ - `YoutubeIcon` (youtube)
226
+ - `ZapIcon` (zap)
227
+ - `ZoomInIcon` (zoom-in)
228
+ - `ZoomOutIcon` (zoom-out)
271
229
 
272
230
  ### **Props**
273
231
 
232
+ The `Icon` component accepts the following props:
233
+
274
234
  | Prop | Type | Default | Description |
275
235
  | ---- | ---- | ------- | ----------- |
236
+ | name | string | 'circle' | **Required for generic component.** The name of the Lucide icon to render (kebab-case). |
276
237
  | widthHeight | number | 24 | Size of the icon in pixels (sets both width and height) |
238
+ | size | number | undefined | Alternative to widthHeight, consistent with Lucide props |
277
239
  | color | string | 'currentColor' | Color of the icon (supports theme colors) |
278
- | filled | boolean | varies by icon | Whether the icon should be filled or outlined |
279
- | strokeWidth | number | 1-2 | Stroke width for outlined icons |
280
- | orientation | `'left' \| 'right' \| 'up' \| 'down'` | 'up' | Orientation/rotation of the icon |
240
+ | filled | boolean | false | Whether to fill the icon body with color. Note: applies to all line-art. |
241
+ | strokeWidth | number | 1-2 | Stroke width for the icon lines |
242
+ | orientation | `'left' \| 'right' \| 'up' \| 'down'` | 'up' | Rotates the icon |
281
243
  | transform | string | undefined | Custom CSS transform property |
282
244
 
283
245
  ### **IconWrapper Props**
@@ -289,74 +251,17 @@ All icons inherit from the base `IconWrapper` component which extends `ViewProps
289
251
  | className | string | CSS class name for styling |
290
252
  | style | CSSProperties | Inline styles |
291
253
  | onClick | function | Click event handler |
292
- | onMouseEnter | function | Mouse enter event handler |
293
- | onMouseLeave | function | Mouse leave event handler |
294
- | aria-label | string | Accessibility label |
295
- | role | string | ARIA role |
296
-
297
- ### **Responsive Icons**
298
- ```tsx
299
- import React from 'react';
300
- import { MenuIcon } from '@app-studio/web';
301
- import { useBreakpoint } from '@app-studio/web';
254
+ | ... | ... | Standard HTML attributes |
302
255
 
303
- export const ResponsiveIcon = () => {
304
- const { isMobile, isTablet, isDesktop } = useBreakpoint();
256
+ ### **Custom Icons**
305
257
 
306
- const iconSize = isMobile ? 20 : isTablet ? 24 : 28;
258
+ You generally don't need to create custom wrappers anymore, as you can use `<Icon name="..." />` directly. However, if you want to create a named export for a generic Lucide icon:
307
259
 
308
- return (
309
- <MenuIcon
310
- widthHeight={iconSize}
311
- color="color.gray.700"
312
- />
313
- );
314
- };
315
- ```
316
-
317
- ### **Icon with Tooltip**
318
260
  ```tsx
319
261
  import React from 'react';
320
- import { Tooltip } from '@app-studio/web';
321
- import { InfoIcon } from '@app-studio/web';
322
-
323
- export const IconWithTooltip = () => (
324
- <Tooltip content="This provides additional information">
325
- <InfoIcon
326
- widthHeight={20}
327
- color="color.blue.500"
328
- style={{ cursor: 'help' }}
329
- />
330
- </Tooltip>
331
- );
332
- ```
333
-
334
- ### **Animated Icons**
335
- ```tsx
336
- import React, { useState } from 'react';
337
- import { HeartIcon } from '@app-studio/web';
338
- import { View } from '@app-studio/web';
262
+ import { Icon } from '@app-studio/web';
339
263
 
340
- export const AnimatedIcon = () => {
341
- const [isLiked, setIsLiked] = useState(false);
342
-
343
- return (
344
- <View
345
- onClick={() => setIsLiked(!isLiked)}
346
- style={{ cursor: 'pointer' }}
347
- >
348
- <HeartIcon
349
- widthHeight={32}
350
- color={isLiked ? 'color.red.500' : 'color.gray.400'}
351
- filled={isLiked}
352
- style={{
353
- transition: 'all 0.2s ease',
354
- transform: isLiked ? 'scale(1.2)' : 'scale(1)',
355
- }}
356
- />
357
- </View>
358
- );
359
- };
264
+ export const MyNewIcon = (props) => <Icon name="rocket" {...props} />;
360
265
  ```
361
266
 
362
267
  ### **Icon Grid Display**
@@ -387,7 +292,8 @@ export const IconGrid = () => {
387
292
  borderRadius={8}
388
293
  textAlign="center"
389
294
  >
390
- <IconComponent widthHeight={24} color="color.gray.700" />
295
+ {/* Some icons might need specific props, generic render here */}
296
+ <IconComponent widthHeight={24} color="color.gray.700" />
391
297
  <Text fontSize={10} marginTop={4}>
392
298
  {iconName}
393
299
  </Text>
@@ -398,74 +304,3 @@ export const IconGrid = () => {
398
304
  );
399
305
  };
400
306
  ```
401
-
402
- ### **Best Practices**
403
-
404
- **Sizing:**
405
- - Use consistent icon sizes within the same context
406
- - Standard sizes: 16px (small), 20px (medium), 24px (large), 32px+ (extra large)
407
- - Consider touch targets for interactive icons (minimum 44px)
408
-
409
- **Colors:**
410
- - Use semantic colors for status icons (red for errors, green for success)
411
- - Maintain sufficient contrast for accessibility
412
- - Use theme colors for consistency across your application
413
-
414
- **Accessibility:**
415
- - Provide `aria-label` for standalone icons
416
- - Use `role="img"` for decorative icons
417
- - Ensure icons are not the only way to convey information
418
-
419
- **Performance:**
420
- - Icons are SVG-based for crisp rendering at any size
421
- - Import only the icons you need to reduce bundle size
422
- - Consider icon sprites for large applications
423
-
424
- ### **Customization**
425
-
426
- **Creating Custom Icons:**
427
- ```tsx
428
- import React from 'react';
429
- import { IconWrapper, IconProps } from '@app-studio/web';
430
-
431
- export const CustomIcon: React.FC<IconProps> = ({
432
- widthHeight = 24,
433
- color = 'currentColor',
434
- filled = true,
435
- ...props
436
- }) => (
437
- <IconWrapper widthHeight={widthHeight} color={color} {...props}>
438
- <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
439
- <path
440
- d="M12 2L2 7v10c0 5.55 3.84 9.74 9 11 5.16-1.26 9-5.45 9-11V7l-10-5z"
441
- fill={filled ? color : 'none'}
442
- stroke={filled ? 'none' : color}
443
- strokeWidth={filled ? 0 : 2}
444
- />
445
- </svg>
446
- </IconWrapper>
447
- );
448
- ```
449
-
450
- ### **Integration Examples**
451
-
452
- **With Navigation:**
453
- ```tsx
454
- import React from 'react';
455
- import { NavigationMenu } from '@app-studio/web';
456
- import { HomeIcon, UserIcon, SettingsIcon } from '@app-studio/web';
457
-
458
- export const IconNavigation = () => (
459
- <NavigationMenu>
460
- <NavigationMenu.Item icon={<HomeIcon widthHeight={20} />}>
461
- Home
462
- </NavigationMenu.Item>
463
- <NavigationMenu.Item icon={<UserIcon widthHeight={20} />}>
464
- Profile
465
- </NavigationMenu.Item>
466
- <NavigationMenu.Item icon={<SettingsIcon widthHeight={20} />}>
467
- Settings
468
- </NavigationMenu.Item>
469
- </NavigationMenu>
470
- );
471
- ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-studio/web",
3
- "version": "0.9.69",
3
+ "version": "0.9.70",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/components/index.d.ts",
6
6
  "files": [