@idealyst/mcp-server 1.0.87 → 1.0.88
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/ARCHITECTURE.md +313 -0
- package/README.md +292 -104
- package/TYPE-SYSTEM.md +397 -0
- package/dist/index.js +170 -1
- package/examples/components/Accordion.examples.tsx +147 -0
- package/examples/components/ActivityIndicator.examples.tsx +350 -0
- package/examples/components/Alert.examples.tsx +335 -0
- package/examples/components/Avatar.examples.tsx +188 -0
- package/examples/components/Badge.examples.tsx +242 -0
- package/examples/components/Breadcrumb.examples.tsx +303 -0
- package/examples/components/Button.examples.tsx +113 -0
- package/examples/components/Card.examples.tsx +131 -0
- package/examples/components/Checkbox.examples.tsx +195 -0
- package/examples/components/Chip.examples.tsx +87 -0
- package/examples/components/Dialog.examples.tsx +344 -0
- package/examples/components/Divider.examples.tsx +258 -0
- package/examples/components/Icon.examples.tsx +202 -0
- package/examples/components/Input.examples.tsx +205 -0
- package/examples/components/Menu.examples.tsx +321 -0
- package/examples/components/Popover.examples.tsx +439 -0
- package/examples/components/Progress.examples.tsx +340 -0
- package/examples/components/RadioButton.examples.tsx +443 -0
- package/examples/components/Screen.examples.tsx +347 -0
- package/examples/components/Select.examples.tsx +279 -0
- package/examples/components/Skeleton.examples.tsx +278 -0
- package/examples/components/Slider.examples.tsx +249 -0
- package/examples/components/Switch.examples.tsx +94 -0
- package/examples/components/TabBar.examples.tsx +356 -0
- package/examples/components/Text.examples.tsx +177 -0
- package/examples/components/TextArea.examples.tsx +203 -0
- package/examples/components/Tooltip.examples.tsx +318 -0
- package/examples/components/View.examples.tsx +307 -0
- package/package.json +15 -2
- package/scripts/extract-types.ts +71 -0
- package/scripts/type-extractor.ts +286 -0
- package/scripts/validate-examples.ts +142 -0
- package/src/data/components/Icon.ts +1 -1
- package/src/data/components/index.ts +2 -0
- package/src/index.ts +181 -1
- package/src/tools/get-types.ts +169 -0
- package/tsconfig.examples.json +14 -0
- package/dist/data/cli-commands.d.ts +0 -2
- package/dist/data/cli-commands.d.ts.map +0 -1
- package/dist/data/cli-commands.js +0 -100
- package/dist/data/cli-commands.js.map +0 -1
- package/dist/data/components/Accordion.d.ts +0 -15
- package/dist/data/components/Accordion.d.ts.map +0 -1
- package/dist/data/components/Accordion.js +0 -112
- package/dist/data/components/Accordion.js.map +0 -1
- package/dist/data/components/ActivityIndicator.d.ts +0 -15
- package/dist/data/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/data/components/ActivityIndicator.js +0 -82
- package/dist/data/components/ActivityIndicator.js.map +0 -1
- package/dist/data/components/Alert.d.ts +0 -15
- package/dist/data/components/Alert.d.ts.map +0 -1
- package/dist/data/components/Alert.js +0 -132
- package/dist/data/components/Alert.js.map +0 -1
- package/dist/data/components/Avatar.d.ts +0 -15
- package/dist/data/components/Avatar.d.ts.map +0 -1
- package/dist/data/components/Avatar.js +0 -93
- package/dist/data/components/Avatar.js.map +0 -1
- package/dist/data/components/Badge.d.ts +0 -15
- package/dist/data/components/Badge.d.ts.map +0 -1
- package/dist/data/components/Badge.js +0 -64
- package/dist/data/components/Badge.js.map +0 -1
- package/dist/data/components/Breadcrumb.d.ts +0 -15
- package/dist/data/components/Breadcrumb.d.ts.map +0 -1
- package/dist/data/components/Breadcrumb.js +0 -96
- package/dist/data/components/Breadcrumb.js.map +0 -1
- package/dist/data/components/Button.d.ts +0 -15
- package/dist/data/components/Button.d.ts.map +0 -1
- package/dist/data/components/Button.js +0 -87
- package/dist/data/components/Button.js.map +0 -1
- package/dist/data/components/Card.d.ts +0 -15
- package/dist/data/components/Card.d.ts.map +0 -1
- package/dist/data/components/Card.js +0 -67
- package/dist/data/components/Card.js.map +0 -1
- package/dist/data/components/Checkbox.d.ts +0 -15
- package/dist/data/components/Checkbox.d.ts.map +0 -1
- package/dist/data/components/Checkbox.js +0 -118
- package/dist/data/components/Checkbox.js.map +0 -1
- package/dist/data/components/Chip.d.ts +0 -15
- package/dist/data/components/Chip.d.ts.map +0 -1
- package/dist/data/components/Chip.js +0 -76
- package/dist/data/components/Chip.js.map +0 -1
- package/dist/data/components/Dialog.d.ts +0 -15
- package/dist/data/components/Dialog.d.ts.map +0 -1
- package/dist/data/components/Dialog.js +0 -137
- package/dist/data/components/Dialog.js.map +0 -1
- package/dist/data/components/Divider.d.ts +0 -15
- package/dist/data/components/Divider.d.ts.map +0 -1
- package/dist/data/components/Divider.js +0 -71
- package/dist/data/components/Divider.js.map +0 -1
- package/dist/data/components/Icon.d.ts +0 -15
- package/dist/data/components/Icon.d.ts.map +0 -1
- package/dist/data/components/Icon.js +0 -70
- package/dist/data/components/Icon.js.map +0 -1
- package/dist/data/components/Image.d.ts +0 -15
- package/dist/data/components/Image.d.ts.map +0 -1
- package/dist/data/components/Image.js +0 -122
- package/dist/data/components/Image.js.map +0 -1
- package/dist/data/components/Input.d.ts +0 -15
- package/dist/data/components/Input.d.ts.map +0 -1
- package/dist/data/components/Input.js +0 -109
- package/dist/data/components/Input.js.map +0 -1
- package/dist/data/components/List.d.ts +0 -15
- package/dist/data/components/List.d.ts.map +0 -1
- package/dist/data/components/List.js +0 -113
- package/dist/data/components/List.js.map +0 -1
- package/dist/data/components/Menu.d.ts +0 -15
- package/dist/data/components/Menu.d.ts.map +0 -1
- package/dist/data/components/Menu.js +0 -132
- package/dist/data/components/Menu.js.map +0 -1
- package/dist/data/components/Popover.d.ts +0 -15
- package/dist/data/components/Popover.d.ts.map +0 -1
- package/dist/data/components/Popover.js +0 -159
- package/dist/data/components/Popover.js.map +0 -1
- package/dist/data/components/Pressable.d.ts +0 -15
- package/dist/data/components/Pressable.d.ts.map +0 -1
- package/dist/data/components/Pressable.js +0 -125
- package/dist/data/components/Pressable.js.map +0 -1
- package/dist/data/components/Progress.d.ts +0 -15
- package/dist/data/components/Progress.d.ts.map +0 -1
- package/dist/data/components/Progress.js +0 -95
- package/dist/data/components/Progress.js.map +0 -1
- package/dist/data/components/RadioButton.d.ts +0 -15
- package/dist/data/components/RadioButton.d.ts.map +0 -1
- package/dist/data/components/RadioButton.js +0 -140
- package/dist/data/components/RadioButton.js.map +0 -1
- package/dist/data/components/SVGImage.d.ts +0 -15
- package/dist/data/components/SVGImage.d.ts.map +0 -1
- package/dist/data/components/SVGImage.js +0 -112
- package/dist/data/components/SVGImage.js.map +0 -1
- package/dist/data/components/Screen.d.ts +0 -15
- package/dist/data/components/Screen.d.ts.map +0 -1
- package/dist/data/components/Screen.js +0 -99
- package/dist/data/components/Screen.js.map +0 -1
- package/dist/data/components/Select.d.ts +0 -15
- package/dist/data/components/Select.d.ts.map +0 -1
- package/dist/data/components/Select.js +0 -146
- package/dist/data/components/Select.js.map +0 -1
- package/dist/data/components/Skeleton.d.ts +0 -15
- package/dist/data/components/Skeleton.d.ts.map +0 -1
- package/dist/data/components/Skeleton.js +0 -110
- package/dist/data/components/Skeleton.js.map +0 -1
- package/dist/data/components/Slider.d.ts +0 -15
- package/dist/data/components/Slider.d.ts.map +0 -1
- package/dist/data/components/Slider.js +0 -129
- package/dist/data/components/Slider.js.map +0 -1
- package/dist/data/components/Switch.d.ts +0 -15
- package/dist/data/components/Switch.d.ts.map +0 -1
- package/dist/data/components/Switch.js +0 -127
- package/dist/data/components/Switch.js.map +0 -1
- package/dist/data/components/TabBar.d.ts +0 -15
- package/dist/data/components/TabBar.d.ts.map +0 -1
- package/dist/data/components/TabBar.js +0 -145
- package/dist/data/components/TabBar.js.map +0 -1
- package/dist/data/components/Table.d.ts +0 -15
- package/dist/data/components/Table.d.ts.map +0 -1
- package/dist/data/components/Table.js +0 -151
- package/dist/data/components/Table.js.map +0 -1
- package/dist/data/components/Tabs.d.ts +0 -15
- package/dist/data/components/Tabs.d.ts.map +0 -1
- package/dist/data/components/Tabs.js +0 -150
- package/dist/data/components/Tabs.js.map +0 -1
- package/dist/data/components/Text.d.ts +0 -15
- package/dist/data/components/Text.d.ts.map +0 -1
- package/dist/data/components/Text.js +0 -85
- package/dist/data/components/Text.js.map +0 -1
- package/dist/data/components/TextArea.d.ts +0 -15
- package/dist/data/components/TextArea.d.ts.map +0 -1
- package/dist/data/components/TextArea.js +0 -155
- package/dist/data/components/TextArea.js.map +0 -1
- package/dist/data/components/Tooltip.d.ts +0 -15
- package/dist/data/components/Tooltip.d.ts.map +0 -1
- package/dist/data/components/Tooltip.js +0 -105
- package/dist/data/components/Tooltip.js.map +0 -1
- package/dist/data/components/Video.d.ts +0 -15
- package/dist/data/components/Video.d.ts.map +0 -1
- package/dist/data/components/Video.js +0 -168
- package/dist/data/components/Video.js.map +0 -1
- package/dist/data/components/View.d.ts +0 -15
- package/dist/data/components/View.d.ts.map +0 -1
- package/dist/data/components/View.js +0 -126
- package/dist/data/components/View.js.map +0 -1
- package/dist/data/components/index.d.ts +0 -37
- package/dist/data/components/index.d.ts.map +0 -1
- package/dist/data/components/index.js +0 -110
- package/dist/data/components/index.js.map +0 -1
- package/dist/data/framework-guides.d.ts +0 -2
- package/dist/data/framework-guides.d.ts.map +0 -1
- package/dist/data/framework-guides.js +0 -589
- package/dist/data/framework-guides.js.map +0 -1
- package/dist/data/icon-guide.d.ts +0 -2
- package/dist/data/icon-guide.d.ts.map +0 -1
- package/dist/data/icon-guide.js +0 -285
- package/dist/data/icon-guide.js.map +0 -1
- package/dist/data/icons.json +0 -7452
- package/dist/data/navigation-guides.d.ts +0 -2
- package/dist/data/navigation-guides.d.ts.map +0 -1
- package/dist/data/navigation-guides.js +0 -1196
- package/dist/data/navigation-guides.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert Component Examples
|
|
3
|
+
*
|
|
4
|
+
* These examples are type-checked against the actual AlertProps interface
|
|
5
|
+
* to ensure accuracy and correctness.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Alert, View, Text, Button, Icon } from '@idealyst/components';
|
|
10
|
+
|
|
11
|
+
// Example 1: Basic Alert
|
|
12
|
+
export function BasicAlert() {
|
|
13
|
+
return (
|
|
14
|
+
<Alert
|
|
15
|
+
title="Basic Alert"
|
|
16
|
+
message="This is a simple alert message."
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Example 2: Alert Intents
|
|
22
|
+
export function AlertIntents() {
|
|
23
|
+
return (
|
|
24
|
+
<View spacing="md">
|
|
25
|
+
<Alert
|
|
26
|
+
intent="primary"
|
|
27
|
+
title="Primary Alert"
|
|
28
|
+
message="This is a primary alert message."
|
|
29
|
+
/>
|
|
30
|
+
<Alert
|
|
31
|
+
intent="success"
|
|
32
|
+
title="Success"
|
|
33
|
+
message="Your changes have been saved successfully."
|
|
34
|
+
/>
|
|
35
|
+
<Alert
|
|
36
|
+
intent="error"
|
|
37
|
+
title="Error"
|
|
38
|
+
message="An error occurred while processing your request."
|
|
39
|
+
/>
|
|
40
|
+
<Alert
|
|
41
|
+
intent="warning"
|
|
42
|
+
title="Warning"
|
|
43
|
+
message="Please review your information before proceeding."
|
|
44
|
+
/>
|
|
45
|
+
<Alert
|
|
46
|
+
intent="info"
|
|
47
|
+
title="Information"
|
|
48
|
+
message="Here's some helpful information for you."
|
|
49
|
+
/>
|
|
50
|
+
<Alert
|
|
51
|
+
intent="neutral"
|
|
52
|
+
title="Neutral"
|
|
53
|
+
message="This is a neutral alert message."
|
|
54
|
+
/>
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Example 3: Alert Types
|
|
60
|
+
export function AlertTypes() {
|
|
61
|
+
return (
|
|
62
|
+
<View spacing="md">
|
|
63
|
+
<Alert
|
|
64
|
+
type="filled"
|
|
65
|
+
intent="success"
|
|
66
|
+
title="Filled Alert"
|
|
67
|
+
message="This is a filled alert with a solid background."
|
|
68
|
+
/>
|
|
69
|
+
<Alert
|
|
70
|
+
type="outlined"
|
|
71
|
+
intent="info"
|
|
72
|
+
title="Outlined Alert"
|
|
73
|
+
message="This is an outlined alert with a border."
|
|
74
|
+
/>
|
|
75
|
+
<Alert
|
|
76
|
+
type="soft"
|
|
77
|
+
intent="warning"
|
|
78
|
+
title="Soft Alert"
|
|
79
|
+
message="This is a soft alert with a subtle background."
|
|
80
|
+
/>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Example 4: Alert with Icons
|
|
86
|
+
export function AlertWithIcons() {
|
|
87
|
+
return (
|
|
88
|
+
<View spacing="md">
|
|
89
|
+
<Alert
|
|
90
|
+
intent="success"
|
|
91
|
+
title="Success"
|
|
92
|
+
message="Operation completed successfully."
|
|
93
|
+
showIcon
|
|
94
|
+
/>
|
|
95
|
+
<Alert
|
|
96
|
+
intent="error"
|
|
97
|
+
title="Error"
|
|
98
|
+
message="Something went wrong."
|
|
99
|
+
showIcon
|
|
100
|
+
/>
|
|
101
|
+
<Alert
|
|
102
|
+
intent="warning"
|
|
103
|
+
title="Warning"
|
|
104
|
+
message="Please be careful."
|
|
105
|
+
showIcon
|
|
106
|
+
/>
|
|
107
|
+
<Alert
|
|
108
|
+
intent="info"
|
|
109
|
+
title="Info"
|
|
110
|
+
message="Did you know?"
|
|
111
|
+
showIcon
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Example 5: Alert with Custom Icon
|
|
118
|
+
export function AlertWithCustomIcon() {
|
|
119
|
+
return (
|
|
120
|
+
<View spacing="md">
|
|
121
|
+
<Alert
|
|
122
|
+
intent="primary"
|
|
123
|
+
title="Custom Icon"
|
|
124
|
+
message="This alert has a custom icon."
|
|
125
|
+
icon={<Icon name="rocket" size="lg" />}
|
|
126
|
+
/>
|
|
127
|
+
<Alert
|
|
128
|
+
intent="success"
|
|
129
|
+
title="Verified"
|
|
130
|
+
message="Your account has been verified."
|
|
131
|
+
icon={<Icon name="check-decagram" size="lg" />}
|
|
132
|
+
/>
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Example 6: Dismissible Alert
|
|
138
|
+
export function DismissibleAlert() {
|
|
139
|
+
const [visible1, setVisible1] = React.useState(true);
|
|
140
|
+
const [visible2, setVisible2] = React.useState(true);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<View spacing="md">
|
|
144
|
+
{visible1 && (
|
|
145
|
+
<Alert
|
|
146
|
+
intent="info"
|
|
147
|
+
title="Dismissible Alert"
|
|
148
|
+
message="You can close this alert by clicking the X button."
|
|
149
|
+
dismissible
|
|
150
|
+
onDismiss={() => setVisible1(false)}
|
|
151
|
+
showIcon
|
|
152
|
+
/>
|
|
153
|
+
)}
|
|
154
|
+
{visible2 && (
|
|
155
|
+
<Alert
|
|
156
|
+
intent="warning"
|
|
157
|
+
title="Another Dismissible Alert"
|
|
158
|
+
message="This one can also be dismissed."
|
|
159
|
+
dismissible
|
|
160
|
+
onDismiss={() => setVisible2(false)}
|
|
161
|
+
showIcon
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
{!visible1 && !visible2 && (
|
|
165
|
+
<Button
|
|
166
|
+
onPress={() => {
|
|
167
|
+
setVisible1(true);
|
|
168
|
+
setVisible2(true);
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
Reset Alerts
|
|
172
|
+
</Button>
|
|
173
|
+
)}
|
|
174
|
+
</View>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Example 7: Alert with Actions
|
|
179
|
+
export function AlertWithActions() {
|
|
180
|
+
return (
|
|
181
|
+
<View spacing="md">
|
|
182
|
+
<Alert
|
|
183
|
+
intent="info"
|
|
184
|
+
title="Update Available"
|
|
185
|
+
message="A new version of the app is available."
|
|
186
|
+
showIcon
|
|
187
|
+
actions={
|
|
188
|
+
<View spacing="sm">
|
|
189
|
+
<Button size="sm" intent="primary">
|
|
190
|
+
Update Now
|
|
191
|
+
</Button>
|
|
192
|
+
<Button size="sm" type="outlined">
|
|
193
|
+
Later
|
|
194
|
+
</Button>
|
|
195
|
+
</View>
|
|
196
|
+
}
|
|
197
|
+
/>
|
|
198
|
+
<Alert
|
|
199
|
+
intent="error"
|
|
200
|
+
title="Connection Lost"
|
|
201
|
+
message="Unable to connect to the server."
|
|
202
|
+
showIcon
|
|
203
|
+
actions={
|
|
204
|
+
<Button size="sm" intent="error">
|
|
205
|
+
Retry
|
|
206
|
+
</Button>
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
</View>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Example 8: Alert with Children
|
|
214
|
+
export function AlertWithChildren() {
|
|
215
|
+
return (
|
|
216
|
+
<Alert intent="info" showIcon>
|
|
217
|
+
<View spacing="sm">
|
|
218
|
+
<View spacing="xs">
|
|
219
|
+
<Text weight="bold" size="md">
|
|
220
|
+
Important Notice
|
|
221
|
+
</Text>
|
|
222
|
+
<Text size="sm" >
|
|
223
|
+
Please read the following information carefully:
|
|
224
|
+
</Text>
|
|
225
|
+
</View>
|
|
226
|
+
<View spacing="xs">
|
|
227
|
+
<Text size="sm">• Your account will expire in 30 days</Text>
|
|
228
|
+
<Text size="sm">• Make sure to backup your data</Text>
|
|
229
|
+
<Text size="sm">• Contact support if you need help</Text>
|
|
230
|
+
</View>
|
|
231
|
+
</View>
|
|
232
|
+
</Alert>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Example 9: Notification-style Alerts
|
|
237
|
+
export function NotificationStyleAlerts() {
|
|
238
|
+
return (
|
|
239
|
+
<View spacing="md">
|
|
240
|
+
<Alert
|
|
241
|
+
type="soft"
|
|
242
|
+
intent="success"
|
|
243
|
+
title="Payment Received"
|
|
244
|
+
message="Your payment of $99.99 has been processed."
|
|
245
|
+
showIcon
|
|
246
|
+
dismissible
|
|
247
|
+
onDismiss={() => {}}
|
|
248
|
+
/>
|
|
249
|
+
<Alert
|
|
250
|
+
type="soft"
|
|
251
|
+
intent="info"
|
|
252
|
+
title="New Message"
|
|
253
|
+
message="You have 3 unread messages from Sarah."
|
|
254
|
+
showIcon
|
|
255
|
+
dismissible
|
|
256
|
+
onDismiss={() => {}}
|
|
257
|
+
/>
|
|
258
|
+
<Alert
|
|
259
|
+
type="soft"
|
|
260
|
+
intent="warning"
|
|
261
|
+
title="Subscription Expiring"
|
|
262
|
+
message="Your subscription expires in 7 days."
|
|
263
|
+
showIcon
|
|
264
|
+
dismissible
|
|
265
|
+
onDismiss={() => {}}
|
|
266
|
+
actions={
|
|
267
|
+
<Button size="sm" type="outlined">
|
|
268
|
+
Renew
|
|
269
|
+
</Button>
|
|
270
|
+
}
|
|
271
|
+
/>
|
|
272
|
+
</View>
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Example 10: Form Validation Alerts
|
|
277
|
+
export function FormValidationAlerts() {
|
|
278
|
+
return (
|
|
279
|
+
<View spacing="md">
|
|
280
|
+
<Alert
|
|
281
|
+
type="outlined"
|
|
282
|
+
intent="error"
|
|
283
|
+
title="Form Validation Failed"
|
|
284
|
+
message="Please correct the following errors:"
|
|
285
|
+
showIcon
|
|
286
|
+
>
|
|
287
|
+
<View spacing="xs">
|
|
288
|
+
<Text size="sm" >
|
|
289
|
+
• Email address is required
|
|
290
|
+
</Text>
|
|
291
|
+
<Text size="sm" >
|
|
292
|
+
• Password must be at least 8 characters
|
|
293
|
+
</Text>
|
|
294
|
+
<Text size="sm" >
|
|
295
|
+
• Terms and conditions must be accepted
|
|
296
|
+
</Text>
|
|
297
|
+
</View>
|
|
298
|
+
</Alert>
|
|
299
|
+
</View>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Example 11: System Status Alerts
|
|
304
|
+
export function SystemStatusAlerts() {
|
|
305
|
+
return (
|
|
306
|
+
<View spacing="md">
|
|
307
|
+
<Alert
|
|
308
|
+
type="filled"
|
|
309
|
+
intent="success"
|
|
310
|
+
title="All Systems Operational"
|
|
311
|
+
message="All services are running normally."
|
|
312
|
+
showIcon
|
|
313
|
+
/>
|
|
314
|
+
<Alert
|
|
315
|
+
type="filled"
|
|
316
|
+
intent="warning"
|
|
317
|
+
title="Scheduled Maintenance"
|
|
318
|
+
message="The system will be down for maintenance on Sunday at 2 AM."
|
|
319
|
+
showIcon
|
|
320
|
+
actions={
|
|
321
|
+
<Button size="sm">
|
|
322
|
+
Learn More
|
|
323
|
+
</Button>
|
|
324
|
+
}
|
|
325
|
+
/>
|
|
326
|
+
<Alert
|
|
327
|
+
type="filled"
|
|
328
|
+
intent="error"
|
|
329
|
+
title="Service Disruption"
|
|
330
|
+
message="We're experiencing technical difficulties. Our team is working on it."
|
|
331
|
+
showIcon
|
|
332
|
+
/>
|
|
333
|
+
</View>
|
|
334
|
+
);
|
|
335
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar Component Examples
|
|
3
|
+
*
|
|
4
|
+
* These examples are type-checked against the actual AvatarProps interface
|
|
5
|
+
* to ensure accuracy and correctness.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Avatar, View, Text } from '@idealyst/components';
|
|
10
|
+
|
|
11
|
+
// Example 1: Basic Avatar with Image
|
|
12
|
+
export function BasicAvatar() {
|
|
13
|
+
return (
|
|
14
|
+
<Avatar
|
|
15
|
+
src="https://i.pravatar.cc/150?img=1"
|
|
16
|
+
alt="User avatar"
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Example 2: Avatar Sizes
|
|
22
|
+
export function AvatarSizes() {
|
|
23
|
+
return (
|
|
24
|
+
<View spacing="md">
|
|
25
|
+
<Avatar size="sm" src="https://i.pravatar.cc/150?img=2" alt="Small avatar" />
|
|
26
|
+
<Avatar size="md" src="https://i.pravatar.cc/150?img=3" alt="Medium avatar" />
|
|
27
|
+
<Avatar size="lg" src="https://i.pravatar.cc/150?img=4" alt="Large avatar" />
|
|
28
|
+
<Avatar size="xl" src="https://i.pravatar.cc/150?img=5" alt="Extra large avatar" />
|
|
29
|
+
</View>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Example 3: Avatar Shapes
|
|
34
|
+
export function AvatarShapes() {
|
|
35
|
+
return (
|
|
36
|
+
<View spacing="md">
|
|
37
|
+
<Avatar
|
|
38
|
+
shape="circle"
|
|
39
|
+
src="https://i.pravatar.cc/150?img=6"
|
|
40
|
+
alt="Circle avatar"
|
|
41
|
+
/>
|
|
42
|
+
<Avatar
|
|
43
|
+
shape="square"
|
|
44
|
+
src="https://i.pravatar.cc/150?img=7"
|
|
45
|
+
alt="Square avatar"
|
|
46
|
+
/>
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Example 4: Avatar with Fallback Text
|
|
52
|
+
export function AvatarWithFallback() {
|
|
53
|
+
return (
|
|
54
|
+
<View spacing="md">
|
|
55
|
+
<Avatar fallback="JD" size="md" />
|
|
56
|
+
<Avatar fallback="AB" size="md" />
|
|
57
|
+
<Avatar fallback="CD" size="md" />
|
|
58
|
+
<Avatar fallback="EF" size="md" />
|
|
59
|
+
</View>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Example 5: Avatar with Different Colors
|
|
64
|
+
export function AvatarColors() {
|
|
65
|
+
return (
|
|
66
|
+
<View spacing="md">
|
|
67
|
+
<Avatar fallback="AA" size="lg" />
|
|
68
|
+
<Avatar fallback="BB" size="lg" />
|
|
69
|
+
<Avatar fallback="CC" size="lg" />
|
|
70
|
+
<Avatar fallback="DD" size="lg" />
|
|
71
|
+
<Avatar fallback="EE" size="lg" />
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Example 6: User Profile List
|
|
77
|
+
export function UserProfileList() {
|
|
78
|
+
return (
|
|
79
|
+
<View spacing="md">
|
|
80
|
+
<View spacing="sm">
|
|
81
|
+
<Avatar src="https://i.pravatar.cc/150?img=8" size="md" />
|
|
82
|
+
<View spacing="xs">
|
|
83
|
+
<Text weight="semibold">John Doe</Text>
|
|
84
|
+
<Text size="sm" >
|
|
85
|
+
john.doe@example.com
|
|
86
|
+
</Text>
|
|
87
|
+
</View>
|
|
88
|
+
</View>
|
|
89
|
+
<View spacing="sm">
|
|
90
|
+
<Avatar src="https://i.pravatar.cc/150?img=9" size="md" />
|
|
91
|
+
<View spacing="xs">
|
|
92
|
+
<Text weight="semibold">Jane Smith</Text>
|
|
93
|
+
<Text size="sm" >
|
|
94
|
+
jane.smith@example.com
|
|
95
|
+
</Text>
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
<View spacing="sm">
|
|
99
|
+
<Avatar fallback="AB" size="md" />
|
|
100
|
+
<View spacing="xs">
|
|
101
|
+
<Text weight="semibold">Alex Brown</Text>
|
|
102
|
+
<Text size="sm" >
|
|
103
|
+
alex.brown@example.com
|
|
104
|
+
</Text>
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
</View>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Example 7: Avatar Group
|
|
112
|
+
export function AvatarGroup() {
|
|
113
|
+
return (
|
|
114
|
+
<View spacing="md">
|
|
115
|
+
<Text weight="semibold" size="sm" >
|
|
116
|
+
Team Members
|
|
117
|
+
</Text>
|
|
118
|
+
<View spacing="sm">
|
|
119
|
+
<Avatar src="https://i.pravatar.cc/150?img=10" size="sm" />
|
|
120
|
+
<Avatar src="https://i.pravatar.cc/150?img=11" size="sm" />
|
|
121
|
+
<Avatar src="https://i.pravatar.cc/150?img=12" size="sm" />
|
|
122
|
+
<Avatar fallback="+3" size="sm" />
|
|
123
|
+
</View>
|
|
124
|
+
</View>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Example 8: Large Profile Avatar
|
|
129
|
+
export function LargeProfileAvatar() {
|
|
130
|
+
return (
|
|
131
|
+
<View spacing="md">
|
|
132
|
+
<Avatar
|
|
133
|
+
src="https://i.pravatar.cc/300?img=13"
|
|
134
|
+
size="xl"
|
|
135
|
+
alt="Profile picture"
|
|
136
|
+
/>
|
|
137
|
+
<View spacing="xs">
|
|
138
|
+
<Text size="xl" weight="bold">
|
|
139
|
+
Sarah Johnson
|
|
140
|
+
</Text>
|
|
141
|
+
<Text size="md" >
|
|
142
|
+
Product Designer
|
|
143
|
+
</Text>
|
|
144
|
+
</View>
|
|
145
|
+
</View>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Example 9: Avatar with Fallback on Error
|
|
150
|
+
export function AvatarWithFallbackOnError() {
|
|
151
|
+
return (
|
|
152
|
+
<View spacing="md">
|
|
153
|
+
<Avatar
|
|
154
|
+
src="https://invalid-url.com/image.jpg"
|
|
155
|
+
fallback="???"
|
|
156
|
+
alt="Broken image"
|
|
157
|
+
size="lg"
|
|
158
|
+
/>
|
|
159
|
+
<Text size="sm" >
|
|
160
|
+
Fallback shown when image fails to load
|
|
161
|
+
</Text>
|
|
162
|
+
</View>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Example 10: Mixed Avatars
|
|
167
|
+
export function MixedAvatars() {
|
|
168
|
+
return (
|
|
169
|
+
<View spacing="lg">
|
|
170
|
+
<View spacing="sm">
|
|
171
|
+
<Avatar src="https://i.pravatar.cc/150?img=14" size="md" shape="circle" />
|
|
172
|
+
<Text weight="medium">Circle with Image</Text>
|
|
173
|
+
</View>
|
|
174
|
+
<View spacing="sm">
|
|
175
|
+
<Avatar src="https://i.pravatar.cc/150?img=15" size="md" shape="square" />
|
|
176
|
+
<Text weight="medium">Square with Image</Text>
|
|
177
|
+
</View>
|
|
178
|
+
<View spacing="sm">
|
|
179
|
+
<Avatar fallback="JD" size="md" shape="circle" />
|
|
180
|
+
<Text weight="medium">Circle with Initials</Text>
|
|
181
|
+
</View>
|
|
182
|
+
<View spacing="sm">
|
|
183
|
+
<Avatar fallback="JD" size="md" shape="square" />
|
|
184
|
+
<Text weight="medium">Square with Initials</Text>
|
|
185
|
+
</View>
|
|
186
|
+
</View>
|
|
187
|
+
);
|
|
188
|
+
}
|