@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,443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RadioButton Component Examples
|
|
3
|
+
*
|
|
4
|
+
* These examples are type-checked against the actual RadioButtonProps interface
|
|
5
|
+
* to ensure accuracy and correctness.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { RadioButton, View, Text } from '@idealyst/components';
|
|
10
|
+
|
|
11
|
+
// Example 1: Basic RadioButton
|
|
12
|
+
export function BasicRadioButton() {
|
|
13
|
+
const [selected, setSelected] = React.useState('option1');
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View spacing="md">
|
|
17
|
+
<RadioButton
|
|
18
|
+
value="option1"
|
|
19
|
+
checked={selected === 'option1'}
|
|
20
|
+
onPress={() => setSelected('option1')}
|
|
21
|
+
label="Option 1"
|
|
22
|
+
/>
|
|
23
|
+
<RadioButton
|
|
24
|
+
value="option2"
|
|
25
|
+
checked={selected === 'option2'}
|
|
26
|
+
onPress={() => setSelected('option2')}
|
|
27
|
+
label="Option 2"
|
|
28
|
+
/>
|
|
29
|
+
<RadioButton
|
|
30
|
+
value="option3"
|
|
31
|
+
checked={selected === 'option3'}
|
|
32
|
+
onPress={() => setSelected('option3')}
|
|
33
|
+
label="Option 3"
|
|
34
|
+
/>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Example 2: RadioButton Sizes
|
|
40
|
+
export function RadioButtonSizes() {
|
|
41
|
+
const [selected, setSelected] = React.useState('md');
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<View spacing="md">
|
|
45
|
+
<RadioButton
|
|
46
|
+
value="xs"
|
|
47
|
+
checked={selected === 'xs'}
|
|
48
|
+
onPress={() => setSelected('xs')}
|
|
49
|
+
label="Extra Small"
|
|
50
|
+
size="xs"
|
|
51
|
+
/>
|
|
52
|
+
<RadioButton
|
|
53
|
+
value="sm"
|
|
54
|
+
checked={selected === 'sm'}
|
|
55
|
+
onPress={() => setSelected('sm')}
|
|
56
|
+
label="Small"
|
|
57
|
+
size="sm"
|
|
58
|
+
/>
|
|
59
|
+
<RadioButton
|
|
60
|
+
value="md"
|
|
61
|
+
checked={selected === 'md'}
|
|
62
|
+
onPress={() => setSelected('md')}
|
|
63
|
+
label="Medium"
|
|
64
|
+
size="md"
|
|
65
|
+
/>
|
|
66
|
+
<RadioButton
|
|
67
|
+
value="lg"
|
|
68
|
+
checked={selected === 'lg'}
|
|
69
|
+
onPress={() => setSelected('lg')}
|
|
70
|
+
label="Large"
|
|
71
|
+
size="lg"
|
|
72
|
+
/>
|
|
73
|
+
<RadioButton
|
|
74
|
+
value="xl"
|
|
75
|
+
checked={selected === 'xl'}
|
|
76
|
+
onPress={() => setSelected('xl')}
|
|
77
|
+
label="Extra Large"
|
|
78
|
+
size="xl"
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Example 3: RadioButton with Intent Colors
|
|
85
|
+
export function RadioButtonWithIntent() {
|
|
86
|
+
const [selected, setSelected] = React.useState('primary');
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<View spacing="md">
|
|
90
|
+
<RadioButton
|
|
91
|
+
value="primary"
|
|
92
|
+
checked={selected === 'primary'}
|
|
93
|
+
onPress={() => setSelected('primary')}
|
|
94
|
+
label="Primary"
|
|
95
|
+
intent="primary"
|
|
96
|
+
/>
|
|
97
|
+
<RadioButton
|
|
98
|
+
value="success"
|
|
99
|
+
checked={selected === 'success'}
|
|
100
|
+
onPress={() => setSelected('success')}
|
|
101
|
+
label="Success"
|
|
102
|
+
intent="success"
|
|
103
|
+
/>
|
|
104
|
+
<RadioButton
|
|
105
|
+
value="error"
|
|
106
|
+
checked={selected === 'error'}
|
|
107
|
+
onPress={() => setSelected('error')}
|
|
108
|
+
label="Error"
|
|
109
|
+
intent="error"
|
|
110
|
+
/>
|
|
111
|
+
<RadioButton
|
|
112
|
+
value="warning"
|
|
113
|
+
checked={selected === 'warning'}
|
|
114
|
+
onPress={() => setSelected('warning')}
|
|
115
|
+
label="Warning"
|
|
116
|
+
intent="warning"
|
|
117
|
+
/>
|
|
118
|
+
<RadioButton
|
|
119
|
+
value="info"
|
|
120
|
+
checked={selected === 'info'}
|
|
121
|
+
onPress={() => setSelected('info')}
|
|
122
|
+
label="Info"
|
|
123
|
+
intent="info"
|
|
124
|
+
/>
|
|
125
|
+
<RadioButton
|
|
126
|
+
value="neutral"
|
|
127
|
+
checked={selected === 'neutral'}
|
|
128
|
+
onPress={() => setSelected('neutral')}
|
|
129
|
+
label="Neutral"
|
|
130
|
+
intent="neutral"
|
|
131
|
+
/>
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Example 4: RadioButton Group with Header
|
|
137
|
+
export function RadioButtonGroup() {
|
|
138
|
+
const [preference, setPreference] = React.useState('email');
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<View spacing="md">
|
|
142
|
+
<Text weight="bold" size="md">
|
|
143
|
+
Contact Preference
|
|
144
|
+
</Text>
|
|
145
|
+
<View spacing="sm">
|
|
146
|
+
<RadioButton
|
|
147
|
+
value="email"
|
|
148
|
+
checked={preference === 'email'}
|
|
149
|
+
onPress={() => setPreference('email')}
|
|
150
|
+
label="Email"
|
|
151
|
+
/>
|
|
152
|
+
<RadioButton
|
|
153
|
+
value="phone"
|
|
154
|
+
checked={preference === 'phone'}
|
|
155
|
+
onPress={() => setPreference('phone')}
|
|
156
|
+
label="Phone"
|
|
157
|
+
/>
|
|
158
|
+
<RadioButton
|
|
159
|
+
value="sms"
|
|
160
|
+
checked={preference === 'sms'}
|
|
161
|
+
onPress={() => setPreference('sms')}
|
|
162
|
+
label="SMS"
|
|
163
|
+
/>
|
|
164
|
+
<RadioButton
|
|
165
|
+
value="none"
|
|
166
|
+
checked={preference === 'none'}
|
|
167
|
+
onPress={() => setPreference('none')}
|
|
168
|
+
label="Do not contact me"
|
|
169
|
+
/>
|
|
170
|
+
</View>
|
|
171
|
+
<Text size="sm" >
|
|
172
|
+
Selected: {preference}
|
|
173
|
+
</Text>
|
|
174
|
+
</View>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Example 5: Disabled RadioButton
|
|
179
|
+
export function DisabledRadioButton() {
|
|
180
|
+
const [selected, setSelected] = React.useState('option1');
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<View spacing="md">
|
|
184
|
+
<RadioButton
|
|
185
|
+
value="option1"
|
|
186
|
+
checked={selected === 'option1'}
|
|
187
|
+
onPress={() => setSelected('option1')}
|
|
188
|
+
label="Available Option"
|
|
189
|
+
/>
|
|
190
|
+
<RadioButton
|
|
191
|
+
value="option2"
|
|
192
|
+
checked={selected === 'option2'}
|
|
193
|
+
onPress={() => setSelected('option2')}
|
|
194
|
+
label="Disabled Unchecked"
|
|
195
|
+
disabled
|
|
196
|
+
/>
|
|
197
|
+
<RadioButton
|
|
198
|
+
value="option3"
|
|
199
|
+
checked={true}
|
|
200
|
+
onPress={() => {}}
|
|
201
|
+
label="Disabled Checked"
|
|
202
|
+
disabled
|
|
203
|
+
/>
|
|
204
|
+
</View>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Example 6: Shipping Method Selection
|
|
209
|
+
export function ShippingMethodSelection() {
|
|
210
|
+
const [shipping, setShipping] = React.useState('standard');
|
|
211
|
+
|
|
212
|
+
const shippingOptions = [
|
|
213
|
+
{ value: 'standard', label: 'Standard Shipping', price: 'Free', duration: '5-7 business days' },
|
|
214
|
+
{ value: 'express', label: 'Express Shipping', price: '$9.99', duration: '2-3 business days' },
|
|
215
|
+
{ value: 'overnight', label: 'Overnight Shipping', price: '$24.99', duration: '1 business day' },
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<View spacing="lg">
|
|
220
|
+
<Text weight="bold" size="lg">
|
|
221
|
+
Select Shipping Method
|
|
222
|
+
</Text>
|
|
223
|
+
<View spacing="md">
|
|
224
|
+
{shippingOptions.map((option) => (
|
|
225
|
+
<View
|
|
226
|
+
key={option.value}
|
|
227
|
+
background="primary"
|
|
228
|
+
spacing="md"
|
|
229
|
+
radius="md"
|
|
230
|
+
border="thin"
|
|
231
|
+
style={{
|
|
232
|
+
borderColor: shipping === option.value ? 'blue' : 'gray',
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
235
|
+
<RadioButton
|
|
236
|
+
value={option.value}
|
|
237
|
+
checked={shipping === option.value}
|
|
238
|
+
onPress={() => setShipping(option.value)}
|
|
239
|
+
label={option.label}
|
|
240
|
+
/>
|
|
241
|
+
<View spacing="xs">
|
|
242
|
+
<Text size="sm" >
|
|
243
|
+
{option.price} • {option.duration}
|
|
244
|
+
</Text>
|
|
245
|
+
</View>
|
|
246
|
+
</View>
|
|
247
|
+
))}
|
|
248
|
+
</View>
|
|
249
|
+
</View>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Example 7: Payment Method Selection
|
|
254
|
+
export function PaymentMethodSelection() {
|
|
255
|
+
const [payment, setPayment] = React.useState('card');
|
|
256
|
+
|
|
257
|
+
return (
|
|
258
|
+
<View spacing="lg">
|
|
259
|
+
<Text weight="bold" size="lg">
|
|
260
|
+
Payment Method
|
|
261
|
+
</Text>
|
|
262
|
+
<View spacing="md">
|
|
263
|
+
<RadioButton
|
|
264
|
+
value="card"
|
|
265
|
+
checked={payment === 'card'}
|
|
266
|
+
onPress={() => setPayment('card')}
|
|
267
|
+
label="Credit or Debit Card"
|
|
268
|
+
/>
|
|
269
|
+
<RadioButton
|
|
270
|
+
value="paypal"
|
|
271
|
+
checked={payment === 'paypal'}
|
|
272
|
+
onPress={() => setPayment('paypal')}
|
|
273
|
+
label="PayPal"
|
|
274
|
+
/>
|
|
275
|
+
<RadioButton
|
|
276
|
+
value="bank"
|
|
277
|
+
checked={payment === 'bank'}
|
|
278
|
+
onPress={() => setPayment('bank')}
|
|
279
|
+
label="Bank Transfer"
|
|
280
|
+
/>
|
|
281
|
+
<RadioButton
|
|
282
|
+
value="cash"
|
|
283
|
+
checked={payment === 'cash'}
|
|
284
|
+
onPress={() => setPayment('cash')}
|
|
285
|
+
label="Cash on Delivery"
|
|
286
|
+
/>
|
|
287
|
+
</View>
|
|
288
|
+
</View>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Example 8: Subscription Plan Selection
|
|
293
|
+
export function SubscriptionPlanSelection() {
|
|
294
|
+
const [plan, setPlan] = React.useState('pro');
|
|
295
|
+
|
|
296
|
+
const plans = [
|
|
297
|
+
{ value: 'free', label: 'Free Plan', price: '$0/month', features: 'Basic features' },
|
|
298
|
+
{ value: 'pro', label: 'Pro Plan', price: '$9.99/month', features: 'All features included' },
|
|
299
|
+
{ value: 'enterprise', label: 'Enterprise Plan', price: '$29.99/month', features: 'Priority support' },
|
|
300
|
+
];
|
|
301
|
+
|
|
302
|
+
return (
|
|
303
|
+
<View spacing="lg">
|
|
304
|
+
<Text weight="bold" size="lg">
|
|
305
|
+
Choose Your Plan
|
|
306
|
+
</Text>
|
|
307
|
+
<View spacing="md">
|
|
308
|
+
{plans.map((planOption) => (
|
|
309
|
+
<View
|
|
310
|
+
key={planOption.value}
|
|
311
|
+
background="primary"
|
|
312
|
+
spacing="lg"
|
|
313
|
+
radius="lg"
|
|
314
|
+
border="thin"
|
|
315
|
+
style={{
|
|
316
|
+
borderColor: plan === planOption.value ? 'blue' : 'gray',
|
|
317
|
+
}}
|
|
318
|
+
>
|
|
319
|
+
<RadioButton
|
|
320
|
+
value={planOption.value}
|
|
321
|
+
checked={plan === planOption.value}
|
|
322
|
+
onPress={() => setPlan(planOption.value)}
|
|
323
|
+
label={planOption.label}
|
|
324
|
+
intent={plan === planOption.value ? 'primary' : 'neutral'}
|
|
325
|
+
/>
|
|
326
|
+
<View spacing="xs">
|
|
327
|
+
<Text weight="bold" size="lg">
|
|
328
|
+
{planOption.price}
|
|
329
|
+
</Text>
|
|
330
|
+
<Text size="sm" >
|
|
331
|
+
{planOption.features}
|
|
332
|
+
</Text>
|
|
333
|
+
</View>
|
|
334
|
+
</View>
|
|
335
|
+
))}
|
|
336
|
+
</View>
|
|
337
|
+
</View>
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Example 9: Survey Question
|
|
342
|
+
export function SurveyQuestion() {
|
|
343
|
+
const [satisfaction, setSatisfaction] = React.useState<string>('');
|
|
344
|
+
|
|
345
|
+
return (
|
|
346
|
+
<View spacing="lg">
|
|
347
|
+
<View spacing="sm">
|
|
348
|
+
<Text weight="bold" size="md">
|
|
349
|
+
How satisfied are you with our service?
|
|
350
|
+
</Text>
|
|
351
|
+
<Text size="sm" >
|
|
352
|
+
Please select one option
|
|
353
|
+
</Text>
|
|
354
|
+
</View>
|
|
355
|
+
<View spacing="md">
|
|
356
|
+
<RadioButton
|
|
357
|
+
value="very-satisfied"
|
|
358
|
+
checked={satisfaction === 'very-satisfied'}
|
|
359
|
+
onPress={() => setSatisfaction('very-satisfied')}
|
|
360
|
+
label="Very Satisfied"
|
|
361
|
+
intent="success"
|
|
362
|
+
/>
|
|
363
|
+
<RadioButton
|
|
364
|
+
value="satisfied"
|
|
365
|
+
checked={satisfaction === 'satisfied'}
|
|
366
|
+
onPress={() => setSatisfaction('satisfied')}
|
|
367
|
+
label="Satisfied"
|
|
368
|
+
/>
|
|
369
|
+
<RadioButton
|
|
370
|
+
value="neutral"
|
|
371
|
+
checked={satisfaction === 'neutral'}
|
|
372
|
+
onPress={() => setSatisfaction('neutral')}
|
|
373
|
+
label="Neutral"
|
|
374
|
+
/>
|
|
375
|
+
<RadioButton
|
|
376
|
+
value="dissatisfied"
|
|
377
|
+
checked={satisfaction === 'dissatisfied'}
|
|
378
|
+
onPress={() => setSatisfaction('dissatisfied')}
|
|
379
|
+
label="Dissatisfied"
|
|
380
|
+
intent="warning"
|
|
381
|
+
/>
|
|
382
|
+
<RadioButton
|
|
383
|
+
value="very-dissatisfied"
|
|
384
|
+
checked={satisfaction === 'very-dissatisfied'}
|
|
385
|
+
onPress={() => setSatisfaction('very-dissatisfied')}
|
|
386
|
+
label="Very Dissatisfied"
|
|
387
|
+
intent="error"
|
|
388
|
+
/>
|
|
389
|
+
</View>
|
|
390
|
+
</View>
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Example 10: Notification Frequency
|
|
395
|
+
export function NotificationFrequency() {
|
|
396
|
+
const [frequency, setFrequency] = React.useState('daily');
|
|
397
|
+
|
|
398
|
+
return (
|
|
399
|
+
<View spacing="lg">
|
|
400
|
+
<Text weight="bold" size="lg">
|
|
401
|
+
Notification Frequency
|
|
402
|
+
</Text>
|
|
403
|
+
<View spacing="md">
|
|
404
|
+
<RadioButton
|
|
405
|
+
value="realtime"
|
|
406
|
+
checked={frequency === 'realtime'}
|
|
407
|
+
onPress={() => setFrequency('realtime')}
|
|
408
|
+
label="Real-time"
|
|
409
|
+
/>
|
|
410
|
+
<Text size="sm" style={{ marginLeft: 32 }}>
|
|
411
|
+
Get notified immediately when something happens
|
|
412
|
+
</Text>
|
|
413
|
+
<RadioButton
|
|
414
|
+
value="daily"
|
|
415
|
+
checked={frequency === 'daily'}
|
|
416
|
+
onPress={() => setFrequency('daily')}
|
|
417
|
+
label="Daily Digest"
|
|
418
|
+
/>
|
|
419
|
+
<Text size="sm" style={{ marginLeft: 32 }}>
|
|
420
|
+
Receive a summary once per day
|
|
421
|
+
</Text>
|
|
422
|
+
<RadioButton
|
|
423
|
+
value="weekly"
|
|
424
|
+
checked={frequency === 'weekly'}
|
|
425
|
+
onPress={() => setFrequency('weekly')}
|
|
426
|
+
label="Weekly Digest"
|
|
427
|
+
/>
|
|
428
|
+
<Text size="sm" style={{ marginLeft: 32 }}>
|
|
429
|
+
Receive a summary once per week
|
|
430
|
+
</Text>
|
|
431
|
+
<RadioButton
|
|
432
|
+
value="never"
|
|
433
|
+
checked={frequency === 'never'}
|
|
434
|
+
onPress={() => setFrequency('never')}
|
|
435
|
+
label="Never"
|
|
436
|
+
/>
|
|
437
|
+
<Text size="sm" style={{ marginLeft: 32 }}>
|
|
438
|
+
Don't send me any notifications
|
|
439
|
+
</Text>
|
|
440
|
+
</View>
|
|
441
|
+
</View>
|
|
442
|
+
);
|
|
443
|
+
}
|