@idealyst/mcp-server 1.0.86 → 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,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabBar Component Examples
|
|
3
|
+
*
|
|
4
|
+
* These examples are type-checked against the actual TabBarProps interface
|
|
5
|
+
* to ensure accuracy and correctness.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { TabBar, View, Text } from '@idealyst/components';
|
|
10
|
+
import type { TabBarItem } from '@idealyst/components';
|
|
11
|
+
|
|
12
|
+
// Example 1: Basic TabBar
|
|
13
|
+
export function BasicTabBar() {
|
|
14
|
+
const [value, setValue] = React.useState('home');
|
|
15
|
+
|
|
16
|
+
const items: TabBarItem[] = [
|
|
17
|
+
{ value: 'home', label: 'Home' },
|
|
18
|
+
{ value: 'profile', label: 'Profile' },
|
|
19
|
+
{ value: 'settings', label: 'Settings' },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<View spacing="md">
|
|
24
|
+
<TabBar items={items} value={value} onChange={setValue} />
|
|
25
|
+
<Text>Selected: {value}</Text>
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Example 2: TabBar Types
|
|
31
|
+
export function TabBarTypes() {
|
|
32
|
+
const [value, setValue] = React.useState('home');
|
|
33
|
+
|
|
34
|
+
const items: TabBarItem[] = [
|
|
35
|
+
{ value: 'home', label: 'Home' },
|
|
36
|
+
{ value: 'explore', label: 'Explore' },
|
|
37
|
+
{ value: 'profile', label: 'Profile' },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<View spacing="lg">
|
|
42
|
+
<View spacing="md">
|
|
43
|
+
<Text weight="semibold">Standard</Text>
|
|
44
|
+
<TabBar type="standard" items={items} value={value} onChange={setValue} />
|
|
45
|
+
</View>
|
|
46
|
+
<View spacing="md">
|
|
47
|
+
<Text weight="semibold">Pills</Text>
|
|
48
|
+
<TabBar type="pills" items={items} value={value} onChange={setValue} />
|
|
49
|
+
</View>
|
|
50
|
+
<View spacing="md">
|
|
51
|
+
<Text weight="semibold">Underline</Text>
|
|
52
|
+
<TabBar type="underline" items={items} value={value} onChange={setValue} />
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Example 3: TabBar Sizes
|
|
59
|
+
export function TabBarSizes() {
|
|
60
|
+
const [value, setValue] = React.useState('tab1');
|
|
61
|
+
|
|
62
|
+
const items: TabBarItem[] = [
|
|
63
|
+
{ value: 'tab1', label: 'Tab 1' },
|
|
64
|
+
{ value: 'tab2', label: 'Tab 2' },
|
|
65
|
+
{ value: 'tab3', label: 'Tab 3' },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<View spacing="lg">
|
|
70
|
+
<TabBar size="xs" items={items} value={value} onChange={setValue} />
|
|
71
|
+
<TabBar size="sm" items={items} value={value} onChange={setValue} />
|
|
72
|
+
<TabBar size="md" items={items} value={value} onChange={setValue} />
|
|
73
|
+
<TabBar size="lg" items={items} value={value} onChange={setValue} />
|
|
74
|
+
<TabBar size="xl" items={items} value={value} onChange={setValue} />
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Example 4: TabBar with Disabled Items
|
|
80
|
+
export function TabBarWithDisabledItems() {
|
|
81
|
+
const [value, setValue] = React.useState('home');
|
|
82
|
+
|
|
83
|
+
const items: TabBarItem[] = [
|
|
84
|
+
{ value: 'home', label: 'Home' },
|
|
85
|
+
{ value: 'explore', label: 'Explore', disabled: true },
|
|
86
|
+
{ value: 'profile', label: 'Profile' },
|
|
87
|
+
{ value: 'settings', label: 'Settings', disabled: true },
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<View spacing="md">
|
|
92
|
+
<TabBar items={items} value={value} onChange={setValue} />
|
|
93
|
+
<Text size="sm" >
|
|
94
|
+
Explore and Settings tabs are disabled
|
|
95
|
+
</Text>
|
|
96
|
+
</View>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Example 5: Pills with Light/Dark Modes
|
|
101
|
+
export function TabBarPillModes() {
|
|
102
|
+
const [value, setValue] = React.useState('tab1');
|
|
103
|
+
|
|
104
|
+
const items: TabBarItem[] = [
|
|
105
|
+
{ value: 'tab1', label: 'Tab 1' },
|
|
106
|
+
{ value: 'tab2', label: 'Tab 2' },
|
|
107
|
+
{ value: 'tab3', label: 'Tab 3' },
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<View spacing="lg">
|
|
112
|
+
<View spacing="md">
|
|
113
|
+
<Text weight="semibold">Light Mode (for light backgrounds)</Text>
|
|
114
|
+
<TabBar
|
|
115
|
+
type="pills"
|
|
116
|
+
pillMode="light"
|
|
117
|
+
items={items}
|
|
118
|
+
value={value}
|
|
119
|
+
onChange={setValue}
|
|
120
|
+
/>
|
|
121
|
+
</View>
|
|
122
|
+
<View spacing="md" backgroundColor="gray.800" radius="md">
|
|
123
|
+
<Text weight="semibold" >
|
|
124
|
+
Dark Mode (for dark backgrounds)
|
|
125
|
+
</Text>
|
|
126
|
+
<TabBar
|
|
127
|
+
type="pills"
|
|
128
|
+
pillMode="dark"
|
|
129
|
+
items={items}
|
|
130
|
+
value={value}
|
|
131
|
+
onChange={setValue}
|
|
132
|
+
/>
|
|
133
|
+
</View>
|
|
134
|
+
</View>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Example 6: TabBar with Content
|
|
139
|
+
export function TabBarWithContent() {
|
|
140
|
+
const [value, setValue] = React.useState('overview');
|
|
141
|
+
|
|
142
|
+
const items: TabBarItem[] = [
|
|
143
|
+
{ value: 'overview', label: 'Overview' },
|
|
144
|
+
{ value: 'details', label: 'Details' },
|
|
145
|
+
{ value: 'reviews', label: 'Reviews' },
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<View spacing="md">
|
|
150
|
+
<TabBar items={items} value={value} onChange={setValue} />
|
|
151
|
+
<View background="primary" spacing="lg" radius="md">
|
|
152
|
+
{value === 'overview' && (
|
|
153
|
+
<View spacing="sm">
|
|
154
|
+
<Text size="lg" weight="bold">
|
|
155
|
+
Overview
|
|
156
|
+
</Text>
|
|
157
|
+
<Text>This is the overview content section.</Text>
|
|
158
|
+
</View>
|
|
159
|
+
)}
|
|
160
|
+
{value === 'details' && (
|
|
161
|
+
<View spacing="sm">
|
|
162
|
+
<Text size="lg" weight="bold">
|
|
163
|
+
Details
|
|
164
|
+
</Text>
|
|
165
|
+
<Text>This is the details content section.</Text>
|
|
166
|
+
</View>
|
|
167
|
+
)}
|
|
168
|
+
{value === 'reviews' && (
|
|
169
|
+
<View spacing="sm">
|
|
170
|
+
<Text size="lg" weight="bold">
|
|
171
|
+
Reviews
|
|
172
|
+
</Text>
|
|
173
|
+
<Text>This is the reviews content section.</Text>
|
|
174
|
+
</View>
|
|
175
|
+
)}
|
|
176
|
+
</View>
|
|
177
|
+
</View>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Example 7: TabBar with Default Value
|
|
182
|
+
export function TabBarWithDefaultValue() {
|
|
183
|
+
const items: TabBarItem[] = [
|
|
184
|
+
{ value: 'home', label: 'Home' },
|
|
185
|
+
{ value: 'messages', label: 'Messages' },
|
|
186
|
+
{ value: 'notifications', label: 'Notifications' },
|
|
187
|
+
];
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<View spacing="md">
|
|
191
|
+
<TabBar items={items} defaultValue="messages" />
|
|
192
|
+
<Text size="sm" >
|
|
193
|
+
Default value is set to "messages"
|
|
194
|
+
</Text>
|
|
195
|
+
</View>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Example 8: Navigation TabBar
|
|
200
|
+
export function NavigationTabBar() {
|
|
201
|
+
const [activeTab, setActiveTab] = React.useState('home');
|
|
202
|
+
|
|
203
|
+
const items: TabBarItem[] = [
|
|
204
|
+
{ value: 'home', label: 'Home' },
|
|
205
|
+
{ value: 'explore', label: 'Explore' },
|
|
206
|
+
{ value: 'create', label: 'Create' },
|
|
207
|
+
{ value: 'messages', label: 'Messages' },
|
|
208
|
+
{ value: 'profile', label: 'Profile' },
|
|
209
|
+
];
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<View spacing="md">
|
|
213
|
+
<TabBar
|
|
214
|
+
type="standard"
|
|
215
|
+
items={items}
|
|
216
|
+
value={activeTab}
|
|
217
|
+
onChange={setActiveTab}
|
|
218
|
+
/>
|
|
219
|
+
<View background="primary" spacing="md" radius="md">
|
|
220
|
+
<Text weight="bold">{activeTab.charAt(0).toUpperCase() + activeTab.slice(1)} Screen</Text>
|
|
221
|
+
<Text size="sm" >
|
|
222
|
+
Content for {activeTab} goes here
|
|
223
|
+
</Text>
|
|
224
|
+
</View>
|
|
225
|
+
</View>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Example 9: Settings TabBar
|
|
230
|
+
export function SettingsTabBar() {
|
|
231
|
+
const [section, setSection] = React.useState('general');
|
|
232
|
+
|
|
233
|
+
const items: TabBarItem[] = [
|
|
234
|
+
{ value: 'general', label: 'General' },
|
|
235
|
+
{ value: 'privacy', label: 'Privacy' },
|
|
236
|
+
{ value: 'security', label: 'Security' },
|
|
237
|
+
{ value: 'notifications', label: 'Notifications' },
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<View spacing="lg">
|
|
242
|
+
<View spacing="sm">
|
|
243
|
+
<Text size="xl" weight="bold">
|
|
244
|
+
Settings
|
|
245
|
+
</Text>
|
|
246
|
+
<Text size="sm" >
|
|
247
|
+
Manage your account settings
|
|
248
|
+
</Text>
|
|
249
|
+
</View>
|
|
250
|
+
<TabBar
|
|
251
|
+
type="underline"
|
|
252
|
+
items={items}
|
|
253
|
+
value={section}
|
|
254
|
+
onChange={setSection}
|
|
255
|
+
/>
|
|
256
|
+
<View spacing="md">
|
|
257
|
+
<Text weight="semibold" size="lg">
|
|
258
|
+
{section.charAt(0).toUpperCase() + section.slice(1)} Settings
|
|
259
|
+
</Text>
|
|
260
|
+
<Text>Configure your {section} preferences here.</Text>
|
|
261
|
+
</View>
|
|
262
|
+
</View>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Example 10: Dashboard TabBar
|
|
267
|
+
export function DashboardTabBar() {
|
|
268
|
+
const [period, setPeriod] = React.useState('day');
|
|
269
|
+
|
|
270
|
+
const items: TabBarItem[] = [
|
|
271
|
+
{ value: 'day', label: 'Day' },
|
|
272
|
+
{ value: 'week', label: 'Week' },
|
|
273
|
+
{ value: 'month', label: 'Month' },
|
|
274
|
+
{ value: 'year', label: 'Year' },
|
|
275
|
+
];
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<View spacing="lg">
|
|
279
|
+
<View spacing="md">
|
|
280
|
+
<Text size="xl" weight="bold">
|
|
281
|
+
Analytics Dashboard
|
|
282
|
+
</Text>
|
|
283
|
+
<TabBar
|
|
284
|
+
type="pills"
|
|
285
|
+
size="sm"
|
|
286
|
+
items={items}
|
|
287
|
+
value={period}
|
|
288
|
+
onChange={setPeriod}
|
|
289
|
+
/>
|
|
290
|
+
</View>
|
|
291
|
+
<View background="primary" spacing="lg" radius="lg">
|
|
292
|
+
<Text size="lg" weight="semibold">
|
|
293
|
+
Statistics for: {period.charAt(0).toUpperCase() + period.slice(1)}
|
|
294
|
+
</Text>
|
|
295
|
+
<View spacing="sm">
|
|
296
|
+
<Text>• Visitors: 1,234</Text>
|
|
297
|
+
<Text>• Page Views: 5,678</Text>
|
|
298
|
+
<Text>• Conversions: 89</Text>
|
|
299
|
+
</View>
|
|
300
|
+
</View>
|
|
301
|
+
</View>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Example 11: Product Details TabBar
|
|
306
|
+
export function ProductDetailsTabBar() {
|
|
307
|
+
const [tab, setTab] = React.useState('description');
|
|
308
|
+
|
|
309
|
+
const items: TabBarItem[] = [
|
|
310
|
+
{ value: 'description', label: 'Description' },
|
|
311
|
+
{ value: 'specs', label: 'Specifications' },
|
|
312
|
+
{ value: 'reviews', label: 'Reviews' },
|
|
313
|
+
{ value: 'shipping', label: 'Shipping' },
|
|
314
|
+
];
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<View spacing="lg">
|
|
318
|
+
<View spacing="md">
|
|
319
|
+
<Text size="xl" weight="bold">
|
|
320
|
+
Product Name
|
|
321
|
+
</Text>
|
|
322
|
+
<Text size="lg" >
|
|
323
|
+
$99.99
|
|
324
|
+
</Text>
|
|
325
|
+
</View>
|
|
326
|
+
<TabBar
|
|
327
|
+
type="underline"
|
|
328
|
+
size="md"
|
|
329
|
+
items={items}
|
|
330
|
+
value={tab}
|
|
331
|
+
onChange={setTab}
|
|
332
|
+
/>
|
|
333
|
+
<View spacing="md">
|
|
334
|
+
{tab === 'description' && (
|
|
335
|
+
<Text>
|
|
336
|
+
This is a detailed product description with all the information about the features
|
|
337
|
+
and benefits.
|
|
338
|
+
</Text>
|
|
339
|
+
)}
|
|
340
|
+
{tab === 'specs' && (
|
|
341
|
+
<View spacing="sm">
|
|
342
|
+
<Text>• Weight: 500g</Text>
|
|
343
|
+
<Text>• Dimensions: 10 x 5 x 2 cm</Text>
|
|
344
|
+
<Text>• Material: Aluminum</Text>
|
|
345
|
+
</View>
|
|
346
|
+
)}
|
|
347
|
+
{tab === 'reviews' && (
|
|
348
|
+
<Text>Customer reviews and ratings will be displayed here.</Text>
|
|
349
|
+
)}
|
|
350
|
+
{tab === 'shipping' && (
|
|
351
|
+
<Text>Shipping information and delivery options.</Text>
|
|
352
|
+
)}
|
|
353
|
+
</View>
|
|
354
|
+
</View>
|
|
355
|
+
);
|
|
356
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text Component Examples
|
|
3
|
+
*
|
|
4
|
+
* These examples are type-checked against the actual TextProps interface
|
|
5
|
+
* to ensure accuracy and correctness.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Text, View } from '@idealyst/components';
|
|
10
|
+
|
|
11
|
+
// Example 1: Basic Text
|
|
12
|
+
export function BasicText() {
|
|
13
|
+
return <Text>This is basic text content</Text>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Example 2: Text Sizes
|
|
17
|
+
export function TextSizes() {
|
|
18
|
+
return (
|
|
19
|
+
<View spacing="md">
|
|
20
|
+
<Text size="sm">Small text</Text>
|
|
21
|
+
<Text size="md">Medium text</Text>
|
|
22
|
+
<Text size="lg">Large text</Text>
|
|
23
|
+
<Text size="xl">Extra large text</Text>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Example 3: Text Weights
|
|
29
|
+
export function TextWeights() {
|
|
30
|
+
return (
|
|
31
|
+
<View spacing="md">
|
|
32
|
+
<Text weight="light">Light weight text</Text>
|
|
33
|
+
<Text weight="normal">Normal weight text</Text>
|
|
34
|
+
<Text weight="medium">Medium weight text</Text>
|
|
35
|
+
<Text weight="semibold">Semibold weight text</Text>
|
|
36
|
+
<Text weight="bold">Bold weight text</Text>
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Example 4: Text Alignment
|
|
42
|
+
export function TextAlignment() {
|
|
43
|
+
return (
|
|
44
|
+
<View spacing="md">
|
|
45
|
+
<Text align="left">Left aligned text</Text>
|
|
46
|
+
<Text align="center">Center aligned text</Text>
|
|
47
|
+
<Text align="right">Right aligned text</Text>
|
|
48
|
+
</View>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Example 5: Text with Color
|
|
53
|
+
export function TextWithColor() {
|
|
54
|
+
return (
|
|
55
|
+
<View spacing="md">
|
|
56
|
+
<Text >Blue text</Text>
|
|
57
|
+
<Text >Green text</Text>
|
|
58
|
+
<Text >Red text</Text>
|
|
59
|
+
<Text >Gray text</Text>
|
|
60
|
+
<Text >Purple text</Text>
|
|
61
|
+
</View>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Example 6: Combining Size, Weight, and Color
|
|
66
|
+
export function CombinedTextStyles() {
|
|
67
|
+
return (
|
|
68
|
+
<View spacing="md">
|
|
69
|
+
<Text size="xl" weight="bold" >
|
|
70
|
+
Heading 1
|
|
71
|
+
</Text>
|
|
72
|
+
<Text size="lg" weight="semibold" >
|
|
73
|
+
Heading 2
|
|
74
|
+
</Text>
|
|
75
|
+
<Text size="md" weight="medium" >
|
|
76
|
+
Subheading
|
|
77
|
+
</Text>
|
|
78
|
+
<Text size="sm" weight="normal" >
|
|
79
|
+
Body text
|
|
80
|
+
</Text>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Example 7: Paragraph Text
|
|
86
|
+
export function ParagraphText() {
|
|
87
|
+
return (
|
|
88
|
+
<View spacing="md">
|
|
89
|
+
<Text size="lg" weight="bold" >
|
|
90
|
+
Article Title
|
|
91
|
+
</Text>
|
|
92
|
+
<Text size="md" >
|
|
93
|
+
This is a paragraph of text that demonstrates how the Text component can be used for
|
|
94
|
+
longer content. It maintains good readability with appropriate sizing and spacing.
|
|
95
|
+
</Text>
|
|
96
|
+
<Text size="md" >
|
|
97
|
+
You can create multiple paragraphs by using multiple Text components, each with their own
|
|
98
|
+
styling and configuration.
|
|
99
|
+
</Text>
|
|
100
|
+
</View>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Example 8: Labels and Descriptions
|
|
105
|
+
export function LabelsAndDescriptions() {
|
|
106
|
+
return (
|
|
107
|
+
<View spacing="lg">
|
|
108
|
+
<View spacing="xs">
|
|
109
|
+
<Text size="sm" weight="semibold" >
|
|
110
|
+
Username
|
|
111
|
+
</Text>
|
|
112
|
+
<Text size="md" >
|
|
113
|
+
johndoe
|
|
114
|
+
</Text>
|
|
115
|
+
</View>
|
|
116
|
+
<View spacing="xs">
|
|
117
|
+
<Text size="sm" weight="semibold" >
|
|
118
|
+
Email
|
|
119
|
+
</Text>
|
|
120
|
+
<Text size="md" >
|
|
121
|
+
john.doe@example.com
|
|
122
|
+
</Text>
|
|
123
|
+
</View>
|
|
124
|
+
<View spacing="xs">
|
|
125
|
+
<Text size="sm" weight="semibold" >
|
|
126
|
+
Status
|
|
127
|
+
</Text>
|
|
128
|
+
<Text size="md" weight="medium">
|
|
129
|
+
Active
|
|
130
|
+
</Text>
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Example 9: Error and Success Messages
|
|
137
|
+
export function StatusMessages() {
|
|
138
|
+
return (
|
|
139
|
+
<View spacing="md">
|
|
140
|
+
<Text size="sm" weight="medium">
|
|
141
|
+
✓ Form submitted successfully
|
|
142
|
+
</Text>
|
|
143
|
+
<Text size="sm" weight="medium">
|
|
144
|
+
✗ Please fill out all required fields
|
|
145
|
+
</Text>
|
|
146
|
+
<Text size="sm" weight="medium">
|
|
147
|
+
ℹ Your changes have been saved
|
|
148
|
+
</Text>
|
|
149
|
+
<Text size="sm" weight="medium">
|
|
150
|
+
⚠ This action cannot be undone
|
|
151
|
+
</Text>
|
|
152
|
+
</View>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Example 10: Typography Hierarchy
|
|
157
|
+
export function TypographyHierarchy() {
|
|
158
|
+
return (
|
|
159
|
+
<View spacing="lg">
|
|
160
|
+
<Text size="xl" weight="bold" >
|
|
161
|
+
Page Title
|
|
162
|
+
</Text>
|
|
163
|
+
<Text size="lg" weight="semibold" >
|
|
164
|
+
Section Heading
|
|
165
|
+
</Text>
|
|
166
|
+
<Text size="md" weight="medium" >
|
|
167
|
+
Subsection Title
|
|
168
|
+
</Text>
|
|
169
|
+
<Text size="md" >
|
|
170
|
+
Body text content goes here with regular weight and medium size for optimal readability.
|
|
171
|
+
</Text>
|
|
172
|
+
<Text size="sm" >
|
|
173
|
+
Small print or supplementary information can use smaller text size.
|
|
174
|
+
</Text>
|
|
175
|
+
</View>
|
|
176
|
+
);
|
|
177
|
+
}
|