@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.
- package/dist/components/Background/Background/Background.props.d.ts +13 -0
- package/dist/components/Background/Background/Background.view.d.ts +3 -1
- package/dist/components/Background/Background.d.ts +1 -0
- package/dist/web.cjs.development.js +81 -6
- 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 +81 -6
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +81 -6
- 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/Icon.mdx +139 -304
- package/package.json +1 -1
package/docs/components/Icon.mdx
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
# Icon
|
|
2
2
|
|
|
3
|
-
A comprehensive collection of SVG icons
|
|
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
|
|
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
|
-
### **
|
|
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
|
|
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
|
|
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>
|
|
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
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- `ArrowIcon`
|
|
126
|
-
- `AttachmentIcon`
|
|
127
|
-
- `AudioIcon`
|
|
128
|
-
- `
|
|
129
|
-
- `
|
|
130
|
-
- `
|
|
131
|
-
- `
|
|
132
|
-
- `
|
|
133
|
-
- `
|
|
134
|
-
- `
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
139
|
-
- `
|
|
140
|
-
- `
|
|
141
|
-
- `
|
|
142
|
-
- `
|
|
143
|
-
- `
|
|
144
|
-
- `
|
|
145
|
-
- `
|
|
146
|
-
- `
|
|
147
|
-
- `
|
|
148
|
-
- `
|
|
149
|
-
- `
|
|
150
|
-
- `
|
|
151
|
-
- `
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
154
|
-
- `
|
|
155
|
-
- `
|
|
156
|
-
- `
|
|
157
|
-
- `
|
|
158
|
-
- `
|
|
159
|
-
- `
|
|
160
|
-
- `
|
|
161
|
-
- `
|
|
162
|
-
- `
|
|
163
|
-
- `
|
|
164
|
-
- `
|
|
165
|
-
- `
|
|
166
|
-
- `
|
|
167
|
-
- `
|
|
168
|
-
- `
|
|
169
|
-
- `
|
|
170
|
-
- `
|
|
171
|
-
- `
|
|
172
|
-
- `
|
|
173
|
-
- `
|
|
174
|
-
- `
|
|
175
|
-
- `
|
|
176
|
-
- `
|
|
177
|
-
- `
|
|
178
|
-
- `
|
|
179
|
-
- `
|
|
180
|
-
- `
|
|
181
|
-
- `
|
|
182
|
-
- `
|
|
183
|
-
- `
|
|
184
|
-
- `
|
|
185
|
-
- `
|
|
186
|
-
- `
|
|
187
|
-
- `
|
|
188
|
-
- `
|
|
189
|
-
- `
|
|
190
|
-
- `
|
|
191
|
-
- `
|
|
192
|
-
- `
|
|
193
|
-
- `
|
|
194
|
-
- `
|
|
195
|
-
- `
|
|
196
|
-
- `
|
|
197
|
-
- `
|
|
198
|
-
- `
|
|
199
|
-
- `
|
|
200
|
-
- `
|
|
201
|
-
- `
|
|
202
|
-
- `
|
|
203
|
-
- `
|
|
204
|
-
- `
|
|
205
|
-
- `
|
|
206
|
-
- `
|
|
207
|
-
- `
|
|
208
|
-
- `
|
|
209
|
-
- `
|
|
210
|
-
- `
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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 |
|
|
279
|
-
| strokeWidth | number | 1-2 | Stroke width for
|
|
280
|
-
| orientation | `'left' \| 'right' \| 'up' \| 'down'` | 'up' |
|
|
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
|
-
|
|
|
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
|
-
|
|
304
|
-
const { isMobile, isTablet, isDesktop } = useBreakpoint();
|
|
256
|
+
### **Custom Icons**
|
|
305
257
|
|
|
306
|
-
|
|
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 {
|
|
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
|
|
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
|
-
|
|
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
|
-
```
|