@idealyst/mcp-server 1.0.84
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/README.md +202 -0
- package/dist/data/cli-commands.d.ts +2 -0
- package/dist/data/cli-commands.d.ts.map +1 -0
- package/dist/data/cli-commands.js +100 -0
- package/dist/data/cli-commands.js.map +1 -0
- package/dist/data/components/Accordion.d.ts +15 -0
- package/dist/data/components/Accordion.d.ts.map +1 -0
- package/dist/data/components/Accordion.js +112 -0
- package/dist/data/components/Accordion.js.map +1 -0
- package/dist/data/components/ActivityIndicator.d.ts +15 -0
- package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/data/components/ActivityIndicator.js +82 -0
- package/dist/data/components/ActivityIndicator.js.map +1 -0
- package/dist/data/components/Alert.d.ts +15 -0
- package/dist/data/components/Alert.d.ts.map +1 -0
- package/dist/data/components/Alert.js +132 -0
- package/dist/data/components/Alert.js.map +1 -0
- package/dist/data/components/Avatar.d.ts +15 -0
- package/dist/data/components/Avatar.d.ts.map +1 -0
- package/dist/data/components/Avatar.js +93 -0
- package/dist/data/components/Avatar.js.map +1 -0
- package/dist/data/components/Badge.d.ts +15 -0
- package/dist/data/components/Badge.d.ts.map +1 -0
- package/dist/data/components/Badge.js +64 -0
- package/dist/data/components/Badge.js.map +1 -0
- package/dist/data/components/Breadcrumb.d.ts +15 -0
- package/dist/data/components/Breadcrumb.d.ts.map +1 -0
- package/dist/data/components/Breadcrumb.js +96 -0
- package/dist/data/components/Breadcrumb.js.map +1 -0
- package/dist/data/components/Button.d.ts +15 -0
- package/dist/data/components/Button.d.ts.map +1 -0
- package/dist/data/components/Button.js +87 -0
- package/dist/data/components/Button.js.map +1 -0
- package/dist/data/components/Card.d.ts +15 -0
- package/dist/data/components/Card.d.ts.map +1 -0
- package/dist/data/components/Card.js +67 -0
- package/dist/data/components/Card.js.map +1 -0
- package/dist/data/components/Checkbox.d.ts +15 -0
- package/dist/data/components/Checkbox.d.ts.map +1 -0
- package/dist/data/components/Checkbox.js +118 -0
- package/dist/data/components/Checkbox.js.map +1 -0
- package/dist/data/components/Chip.d.ts +15 -0
- package/dist/data/components/Chip.d.ts.map +1 -0
- package/dist/data/components/Chip.js +76 -0
- package/dist/data/components/Chip.js.map +1 -0
- package/dist/data/components/Dialog.d.ts +15 -0
- package/dist/data/components/Dialog.d.ts.map +1 -0
- package/dist/data/components/Dialog.js +137 -0
- package/dist/data/components/Dialog.js.map +1 -0
- package/dist/data/components/Divider.d.ts +15 -0
- package/dist/data/components/Divider.d.ts.map +1 -0
- package/dist/data/components/Divider.js +71 -0
- package/dist/data/components/Divider.js.map +1 -0
- package/dist/data/components/Icon.d.ts +15 -0
- package/dist/data/components/Icon.d.ts.map +1 -0
- package/dist/data/components/Icon.js +70 -0
- package/dist/data/components/Icon.js.map +1 -0
- package/dist/data/components/Image.d.ts +15 -0
- package/dist/data/components/Image.d.ts.map +1 -0
- package/dist/data/components/Image.js +122 -0
- package/dist/data/components/Image.js.map +1 -0
- package/dist/data/components/Input.d.ts +15 -0
- package/dist/data/components/Input.d.ts.map +1 -0
- package/dist/data/components/Input.js +109 -0
- package/dist/data/components/Input.js.map +1 -0
- package/dist/data/components/List.d.ts +15 -0
- package/dist/data/components/List.d.ts.map +1 -0
- package/dist/data/components/List.js +113 -0
- package/dist/data/components/List.js.map +1 -0
- package/dist/data/components/Menu.d.ts +15 -0
- package/dist/data/components/Menu.d.ts.map +1 -0
- package/dist/data/components/Menu.js +132 -0
- package/dist/data/components/Menu.js.map +1 -0
- package/dist/data/components/Popover.d.ts +15 -0
- package/dist/data/components/Popover.d.ts.map +1 -0
- package/dist/data/components/Popover.js +159 -0
- package/dist/data/components/Popover.js.map +1 -0
- package/dist/data/components/Pressable.d.ts +15 -0
- package/dist/data/components/Pressable.d.ts.map +1 -0
- package/dist/data/components/Pressable.js +125 -0
- package/dist/data/components/Pressable.js.map +1 -0
- package/dist/data/components/Progress.d.ts +15 -0
- package/dist/data/components/Progress.d.ts.map +1 -0
- package/dist/data/components/Progress.js +95 -0
- package/dist/data/components/Progress.js.map +1 -0
- package/dist/data/components/RadioButton.d.ts +15 -0
- package/dist/data/components/RadioButton.d.ts.map +1 -0
- package/dist/data/components/RadioButton.js +140 -0
- package/dist/data/components/RadioButton.js.map +1 -0
- package/dist/data/components/SVGImage.d.ts +15 -0
- package/dist/data/components/SVGImage.d.ts.map +1 -0
- package/dist/data/components/SVGImage.js +112 -0
- package/dist/data/components/SVGImage.js.map +1 -0
- package/dist/data/components/Screen.d.ts +15 -0
- package/dist/data/components/Screen.d.ts.map +1 -0
- package/dist/data/components/Screen.js +99 -0
- package/dist/data/components/Screen.js.map +1 -0
- package/dist/data/components/Select.d.ts +15 -0
- package/dist/data/components/Select.d.ts.map +1 -0
- package/dist/data/components/Select.js +146 -0
- package/dist/data/components/Select.js.map +1 -0
- package/dist/data/components/Skeleton.d.ts +15 -0
- package/dist/data/components/Skeleton.d.ts.map +1 -0
- package/dist/data/components/Skeleton.js +110 -0
- package/dist/data/components/Skeleton.js.map +1 -0
- package/dist/data/components/Slider.d.ts +15 -0
- package/dist/data/components/Slider.d.ts.map +1 -0
- package/dist/data/components/Slider.js +129 -0
- package/dist/data/components/Slider.js.map +1 -0
- package/dist/data/components/Switch.d.ts +15 -0
- package/dist/data/components/Switch.d.ts.map +1 -0
- package/dist/data/components/Switch.js +127 -0
- package/dist/data/components/Switch.js.map +1 -0
- package/dist/data/components/TabBar.d.ts +15 -0
- package/dist/data/components/TabBar.d.ts.map +1 -0
- package/dist/data/components/TabBar.js +145 -0
- package/dist/data/components/TabBar.js.map +1 -0
- package/dist/data/components/Table.d.ts +15 -0
- package/dist/data/components/Table.d.ts.map +1 -0
- package/dist/data/components/Table.js +151 -0
- package/dist/data/components/Table.js.map +1 -0
- package/dist/data/components/Tabs.d.ts +15 -0
- package/dist/data/components/Tabs.d.ts.map +1 -0
- package/dist/data/components/Tabs.js +150 -0
- package/dist/data/components/Tabs.js.map +1 -0
- package/dist/data/components/Text.d.ts +15 -0
- package/dist/data/components/Text.d.ts.map +1 -0
- package/dist/data/components/Text.js +85 -0
- package/dist/data/components/Text.js.map +1 -0
- package/dist/data/components/TextArea.d.ts +15 -0
- package/dist/data/components/TextArea.d.ts.map +1 -0
- package/dist/data/components/TextArea.js +155 -0
- package/dist/data/components/TextArea.js.map +1 -0
- package/dist/data/components/Tooltip.d.ts +15 -0
- package/dist/data/components/Tooltip.d.ts.map +1 -0
- package/dist/data/components/Tooltip.js +105 -0
- package/dist/data/components/Tooltip.js.map +1 -0
- package/dist/data/components/Video.d.ts +15 -0
- package/dist/data/components/Video.d.ts.map +1 -0
- package/dist/data/components/Video.js +168 -0
- package/dist/data/components/Video.js.map +1 -0
- package/dist/data/components/View.d.ts +15 -0
- package/dist/data/components/View.d.ts.map +1 -0
- package/dist/data/components/View.js +126 -0
- package/dist/data/components/View.js.map +1 -0
- package/dist/data/components/index.d.ts +37 -0
- package/dist/data/components/index.d.ts.map +1 -0
- package/dist/data/components/index.js +110 -0
- package/dist/data/components/index.js.map +1 -0
- package/dist/data/framework-guides.d.ts +2 -0
- package/dist/data/framework-guides.d.ts.map +1 -0
- package/dist/data/framework-guides.js +589 -0
- package/dist/data/framework-guides.js.map +1 -0
- package/dist/data/icon-guide.d.ts +2 -0
- package/dist/data/icon-guide.d.ts.map +1 -0
- package/dist/data/icon-guide.js +285 -0
- package/dist/data/icon-guide.js.map +1 -0
- package/dist/data/icons.json +7452 -0
- package/dist/data/navigation-guides.d.ts +2 -0
- package/dist/data/navigation-guides.d.ts.map +1 -0
- package/dist/data/navigation-guides.js +1196 -0
- package/dist/data/navigation-guides.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +422 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -0
- package/src/data/cli-commands.ts +103 -0
- package/src/data/components/Accordion.ts +106 -0
- package/src/data/components/ActivityIndicator.ts +82 -0
- package/src/data/components/Alert.ts +132 -0
- package/src/data/components/Avatar.ts +93 -0
- package/src/data/components/Badge.ts +63 -0
- package/src/data/components/Breadcrumb.ts +94 -0
- package/src/data/components/Button.ts +86 -0
- package/src/data/components/Card.ts +67 -0
- package/src/data/components/Checkbox.ts +117 -0
- package/src/data/components/Chip.ts +93 -0
- package/src/data/components/Dialog.ts +136 -0
- package/src/data/components/Divider.ts +70 -0
- package/src/data/components/Icon.ts +70 -0
- package/src/data/components/Image.ts +121 -0
- package/src/data/components/Input.ts +150 -0
- package/src/data/components/List.ts +103 -0
- package/src/data/components/Menu.ts +125 -0
- package/src/data/components/Popover.ts +159 -0
- package/src/data/components/Pressable.ts +123 -0
- package/src/data/components/Progress.ts +95 -0
- package/src/data/components/RadioButton.ts +130 -0
- package/src/data/components/SVGImage.ts +114 -0
- package/src/data/components/Screen.ts +103 -0
- package/src/data/components/Select.ts +140 -0
- package/src/data/components/Skeleton.ts +102 -0
- package/src/data/components/Slider.ts +150 -0
- package/src/data/components/Switch.ts +127 -0
- package/src/data/components/TabBar.ts +142 -0
- package/src/data/components/Table.ts +153 -0
- package/src/data/components/Tabs.ts +152 -0
- package/src/data/components/Text.ts +85 -0
- package/src/data/components/TextArea.ts +155 -0
- package/src/data/components/Tooltip.ts +105 -0
- package/src/data/components/Video.ts +168 -0
- package/src/data/components/View.ts +126 -0
- package/src/data/components/index.ts +109 -0
- package/src/data/framework-guides.ts +593 -0
- package/src/data/icon-guide.ts +284 -0
- package/src/data/icons.json +7452 -0
- package/src/data/navigation-guides.ts +1199 -0
- package/src/index.ts +473 -0
- package/test-client.js +86 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export const Tabs = {
|
|
2
|
+
category: "navigation",
|
|
3
|
+
description: "Tabs component with content panels for organizing information into tabbed sections",
|
|
4
|
+
props: `
|
|
5
|
+
Tab Props:
|
|
6
|
+
- \`value\`: string - Unique tab identifier
|
|
7
|
+
- \`label\`: string - Tab label text
|
|
8
|
+
- \`disabled\`: boolean - Whether tab is disabled
|
|
9
|
+
- \`children\`: ReactNode - Tab panel content
|
|
10
|
+
|
|
11
|
+
Tabs Props:
|
|
12
|
+
- \`value\`: string - Currently active tab value
|
|
13
|
+
- \`defaultValue\`: string - Default tab (uncontrolled)
|
|
14
|
+
- \`onChange\`: (value: string) => void - Tab change handler
|
|
15
|
+
- \`variant\`: 'default' | 'pills' | 'underline' - Visual style
|
|
16
|
+
- \`size\`: 'sm' | 'md' | 'lg' - Tab size
|
|
17
|
+
- \`intent\`: 'primary' | 'neutral' | 'success' | 'error' | 'warning' - Color scheme
|
|
18
|
+
- \`style\`: ViewStyle - Additional styles
|
|
19
|
+
- \`testID\`: string - Test identifier
|
|
20
|
+
- \`children\`: ReactNode - Tab components
|
|
21
|
+
`,
|
|
22
|
+
features: [
|
|
23
|
+
"Integrated tab navigation and content panels",
|
|
24
|
+
"Three visual variants",
|
|
25
|
+
"Controlled and uncontrolled modes",
|
|
26
|
+
"Three sizes",
|
|
27
|
+
"Five intent colors",
|
|
28
|
+
"Disabled tabs",
|
|
29
|
+
"Automatic content switching",
|
|
30
|
+
],
|
|
31
|
+
bestPractices: [
|
|
32
|
+
"Use Tabs for content that belongs together",
|
|
33
|
+
"Use TabBar for navigation without content management",
|
|
34
|
+
"Keep 3-5 tabs for optimal UX",
|
|
35
|
+
"Lazy load tab content if heavy",
|
|
36
|
+
"Use descriptive tab labels",
|
|
37
|
+
"Consider vertical tabs for many options",
|
|
38
|
+
],
|
|
39
|
+
usage: `
|
|
40
|
+
import { Tabs, Tab, Text } from '@idealyst/components';
|
|
41
|
+
|
|
42
|
+
<Tabs defaultValue="tab1" variant="underline">
|
|
43
|
+
<Tab value="tab1" label="Overview">
|
|
44
|
+
<Text>Overview content</Text>
|
|
45
|
+
</Tab>
|
|
46
|
+
<Tab value="tab2" label="Details">
|
|
47
|
+
<Text>Details content</Text>
|
|
48
|
+
</Tab>
|
|
49
|
+
<Tab value="tab3" label="Settings">
|
|
50
|
+
<Text>Settings content</Text>
|
|
51
|
+
</Tab>
|
|
52
|
+
</Tabs>
|
|
53
|
+
`,
|
|
54
|
+
examples: {
|
|
55
|
+
basic: `import { Tabs, Tab, Text } from '@idealyst/components';
|
|
56
|
+
|
|
57
|
+
<Tabs defaultValue="1">
|
|
58
|
+
<Tab value="1" label="First">
|
|
59
|
+
<Text>First tab content</Text>
|
|
60
|
+
</Tab>
|
|
61
|
+
<Tab value="2" label="Second">
|
|
62
|
+
<Text>Second tab content</Text>
|
|
63
|
+
</Tab>
|
|
64
|
+
</Tabs>`,
|
|
65
|
+
|
|
66
|
+
variants: `import { Tabs, Tab, View, Text } from '@idealyst/components';
|
|
67
|
+
|
|
68
|
+
<View spacing="lg">
|
|
69
|
+
<Tabs defaultValue="a" variant="default">
|
|
70
|
+
<Tab value="a" label="Default"><Text>Content A</Text></Tab>
|
|
71
|
+
<Tab value="b" label="Style"><Text>Content B</Text></Tab>
|
|
72
|
+
</Tabs>
|
|
73
|
+
|
|
74
|
+
<Tabs defaultValue="a" variant="pills">
|
|
75
|
+
<Tab value="a" label="Pills"><Text>Content A</Text></Tab>
|
|
76
|
+
<Tab value="b" label="Style"><Text>Content B</Text></Tab>
|
|
77
|
+
</Tabs>
|
|
78
|
+
|
|
79
|
+
<Tabs defaultValue="a" variant="underline">
|
|
80
|
+
<Tab value="a" label="Underline"><Text>Content A</Text></Tab>
|
|
81
|
+
<Tab value="b" label="Style"><Text>Content B</Text></Tab>
|
|
82
|
+
</Tabs>
|
|
83
|
+
</View>`,
|
|
84
|
+
|
|
85
|
+
"with-icons": `import { Tabs, Tab, View, Text, Card } from '@idealyst/components';
|
|
86
|
+
|
|
87
|
+
<Tabs defaultValue="profile" variant="pills" intent="primary">
|
|
88
|
+
<Tab value="profile" label="Profile">
|
|
89
|
+
<Card padding="md">
|
|
90
|
+
<View spacing="md">
|
|
91
|
+
<Text weight="bold">Profile Settings</Text>
|
|
92
|
+
<Text>Update your profile information</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</Card>
|
|
95
|
+
</Tab>
|
|
96
|
+
<Tab value="security" label="Security">
|
|
97
|
+
<Card padding="md">
|
|
98
|
+
<View spacing="md">
|
|
99
|
+
<Text weight="bold">Security Settings</Text>
|
|
100
|
+
<Text>Manage your security preferences</Text>
|
|
101
|
+
</View>
|
|
102
|
+
</Card>
|
|
103
|
+
</Tab>
|
|
104
|
+
</Tabs>`,
|
|
105
|
+
|
|
106
|
+
interactive: `import { Tabs, Tab, View, Text, Input, Button } from '@idealyst/components';
|
|
107
|
+
import { useState } from 'react';
|
|
108
|
+
|
|
109
|
+
function Example() {
|
|
110
|
+
const [activeTab, setActiveTab] = useState('account');
|
|
111
|
+
const [name, setName] = useState('');
|
|
112
|
+
const [email, setEmail] = useState('');
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Tabs value={activeTab} onChange={setActiveTab} variant="underline">
|
|
116
|
+
<Tab value="account" label="Account">
|
|
117
|
+
<View spacing="md" style={{ padding: 16 }}>
|
|
118
|
+
<Text weight="bold">Account Information</Text>
|
|
119
|
+
<Input
|
|
120
|
+
label="Name"
|
|
121
|
+
value={name}
|
|
122
|
+
onChangeText={setName}
|
|
123
|
+
placeholder="Enter your name"
|
|
124
|
+
/>
|
|
125
|
+
<Input
|
|
126
|
+
label="Email"
|
|
127
|
+
value={email}
|
|
128
|
+
onChangeText={setEmail}
|
|
129
|
+
placeholder="Enter your email"
|
|
130
|
+
/>
|
|
131
|
+
<Button intent="primary">Save Changes</Button>
|
|
132
|
+
</View>
|
|
133
|
+
</Tab>
|
|
134
|
+
|
|
135
|
+
<Tab value="privacy" label="Privacy">
|
|
136
|
+
<View spacing="md" style={{ padding: 16 }}>
|
|
137
|
+
<Text weight="bold">Privacy Settings</Text>
|
|
138
|
+
<Text>Manage your privacy preferences here</Text>
|
|
139
|
+
</View>
|
|
140
|
+
</Tab>
|
|
141
|
+
|
|
142
|
+
<Tab value="notifications" label="Notifications">
|
|
143
|
+
<View spacing="md" style={{ padding: 16 }}>
|
|
144
|
+
<Text weight="bold">Notification Preferences</Text>
|
|
145
|
+
<Text>Configure how you receive notifications</Text>
|
|
146
|
+
</View>
|
|
147
|
+
</Tab>
|
|
148
|
+
</Tabs>
|
|
149
|
+
);
|
|
150
|
+
}`,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const Text = {
|
|
2
|
+
category: "typography",
|
|
3
|
+
description: "Styled text component with size, weight, and color variants",
|
|
4
|
+
props: `
|
|
5
|
+
- \`children\`: React.ReactNode - The text content to display
|
|
6
|
+
- \`size\`: TextSizeVariant - The size variant of the text
|
|
7
|
+
- \`weight\`: TextWeightVariant - The weight of the text
|
|
8
|
+
- \`color\`: TextColorVariant - The color of the text
|
|
9
|
+
- \`align\`: TextAlignVariant - Text alignment
|
|
10
|
+
`,
|
|
11
|
+
features: [
|
|
12
|
+
"Four size variants",
|
|
13
|
+
"Five weight options",
|
|
14
|
+
"Theme color variants",
|
|
15
|
+
"Three alignment options",
|
|
16
|
+
"Cross-platform support",
|
|
17
|
+
"Inherits parent text styles",
|
|
18
|
+
],
|
|
19
|
+
bestPractices: [
|
|
20
|
+
"Use semantic sizes (xl for headings, sm for captions)",
|
|
21
|
+
"Use appropriate weights for hierarchy",
|
|
22
|
+
"Prefer theme colors over custom colors",
|
|
23
|
+
"Use 'left' alignment for body text",
|
|
24
|
+
"Use 'center' for short, important text",
|
|
25
|
+
"Nest Text components for mixed styles",
|
|
26
|
+
],
|
|
27
|
+
usage: `
|
|
28
|
+
import { Text } from '@idealyst/components';
|
|
29
|
+
|
|
30
|
+
<Text size="xl" weight="bold" color="primary">
|
|
31
|
+
Heading Text
|
|
32
|
+
</Text>
|
|
33
|
+
|
|
34
|
+
<Text size="md" color="secondary">
|
|
35
|
+
Body text with normal weight
|
|
36
|
+
</Text>
|
|
37
|
+
`,
|
|
38
|
+
examples: {
|
|
39
|
+
basic: `import { Text } from '@idealyst/components';
|
|
40
|
+
|
|
41
|
+
<Text>Simple text content</Text>`,
|
|
42
|
+
|
|
43
|
+
variants: `import { Text, View } from '@idealyst/components';
|
|
44
|
+
|
|
45
|
+
<View spacing="md">
|
|
46
|
+
<Text size="sm">Small text</Text>
|
|
47
|
+
<Text size="md">Medium text</Text>
|
|
48
|
+
<Text size="lg">Large text</Text>
|
|
49
|
+
<Text size="xl">Extra large text</Text>
|
|
50
|
+
</View>`,
|
|
51
|
+
|
|
52
|
+
"with-icons": `import { Text, View, Icon } from '@idealyst/components';
|
|
53
|
+
|
|
54
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
55
|
+
<Icon name="check-circle" size="md" color="success" />
|
|
56
|
+
<Text color="success" weight="medium">
|
|
57
|
+
Verified Account
|
|
58
|
+
</Text>
|
|
59
|
+
</View>`,
|
|
60
|
+
|
|
61
|
+
interactive: `import { Text, View, Button } from '@idealyst/components';
|
|
62
|
+
import { useState } from 'react';
|
|
63
|
+
|
|
64
|
+
function Example() {
|
|
65
|
+
const [count, setCount] = useState(0);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<View spacing="md">
|
|
69
|
+
<Text size="xl" weight="bold" align="center">
|
|
70
|
+
Counter: {count}
|
|
71
|
+
</Text>
|
|
72
|
+
|
|
73
|
+
<View style={{ flexDirection: 'row', gap: 8, justifyContent: 'center' }}>
|
|
74
|
+
<Button onPress={() => setCount(count - 1)}>-</Button>
|
|
75
|
+
<Button onPress={() => setCount(count + 1)}>+</Button>
|
|
76
|
+
</View>
|
|
77
|
+
|
|
78
|
+
<Text size="sm" color="secondary" align="center">
|
|
79
|
+
Click buttons to change the count
|
|
80
|
+
</Text>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
}`,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export const TextArea = {
|
|
2
|
+
category: "form",
|
|
3
|
+
description: "Multi-line text input field for longer text content",
|
|
4
|
+
props: `
|
|
5
|
+
- \`value\`: string - The current value of the textarea (controlled)
|
|
6
|
+
- \`defaultValue\`: string - The default value for uncontrolled usage
|
|
7
|
+
- \`onChange\`: function - Called when the text content changes
|
|
8
|
+
- \`placeholder\`: string - Placeholder text shown when empty
|
|
9
|
+
- \`disabled\`: boolean - Whether the textarea is disabled
|
|
10
|
+
- \`rows\`: number - Initial number of visible text rows
|
|
11
|
+
- \`minHeight\`: number - Minimum height in pixels
|
|
12
|
+
- \`maxHeight\`: number - Maximum height in pixels
|
|
13
|
+
- \`autoGrow\`: boolean - Whether to automatically grow height to fit content
|
|
14
|
+
- \`maxLength\`: number - Maximum number of characters allowed
|
|
15
|
+
- \`label\`: string - Label text displayed above the textarea
|
|
16
|
+
- \`error\`: string - Error message to display
|
|
17
|
+
- \`helperText\`: string - Helper text displayed below the textarea
|
|
18
|
+
- \`resize\`: TextAreaResizeVariant - How the textarea can be resized (none, vertical, horizontal, both)
|
|
19
|
+
- \`showCharacterCount\`: boolean - Whether to show the character count
|
|
20
|
+
- \`intent\`: TextAreaIntentVariant - The intent/color scheme (for validation states)
|
|
21
|
+
- \`size\`: TextAreaSizeVariant - The size variant of the textarea
|
|
22
|
+
- \`textareaStyle\`: StyleProp<TextStyle> - Additional custom styles for the textarea element
|
|
23
|
+
`,
|
|
24
|
+
features: [
|
|
25
|
+
"Multi-line text input",
|
|
26
|
+
"Auto-grow to fit content",
|
|
27
|
+
"Character count display",
|
|
28
|
+
"Min/max height constraints",
|
|
29
|
+
"Max length validation",
|
|
30
|
+
"Label and helper text",
|
|
31
|
+
"Error state",
|
|
32
|
+
"Resize control (web)",
|
|
33
|
+
"Three sizes",
|
|
34
|
+
],
|
|
35
|
+
bestPractices: [
|
|
36
|
+
"Always provide a label",
|
|
37
|
+
"Use helperText to guide users",
|
|
38
|
+
"Set maxLength to prevent excessive input",
|
|
39
|
+
"Show character count for limited fields",
|
|
40
|
+
"Use autoGrow for dynamic content",
|
|
41
|
+
"Set minHeight for comfortable input area",
|
|
42
|
+
"Show inline error messages",
|
|
43
|
+
],
|
|
44
|
+
usage: `
|
|
45
|
+
import { TextArea } from '@idealyst/components';
|
|
46
|
+
import { useState } from 'react';
|
|
47
|
+
|
|
48
|
+
function Example() {
|
|
49
|
+
const [text, setText] = useState('');
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<TextArea
|
|
53
|
+
label="Description"
|
|
54
|
+
value={text}
|
|
55
|
+
onChange={setText}
|
|
56
|
+
placeholder="Enter a detailed description"
|
|
57
|
+
rows={4}
|
|
58
|
+
maxLength={500}
|
|
59
|
+
showCharacterCount
|
|
60
|
+
helperText="Provide as much detail as possible"
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
examples: {
|
|
66
|
+
basic: `import { TextArea } from '@idealyst/components';
|
|
67
|
+
|
|
68
|
+
<TextArea
|
|
69
|
+
label="Message"
|
|
70
|
+
placeholder="Enter your message"
|
|
71
|
+
rows={4}
|
|
72
|
+
/>`,
|
|
73
|
+
|
|
74
|
+
variants: `import { TextArea, View } from '@idealyst/components';
|
|
75
|
+
|
|
76
|
+
<View spacing="md">
|
|
77
|
+
<TextArea label="Small" size="sm" rows={3} />
|
|
78
|
+
<TextArea label="Medium" size="md" rows={4} />
|
|
79
|
+
<TextArea label="Large" size="lg" rows={5} />
|
|
80
|
+
</View>`,
|
|
81
|
+
|
|
82
|
+
"with-icons": `import { TextArea, View, Text } from '@idealyst/components';
|
|
83
|
+
import { useState } from 'react';
|
|
84
|
+
|
|
85
|
+
function Example() {
|
|
86
|
+
const [feedback, setFeedback] = useState('');
|
|
87
|
+
const maxLength = 200;
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<View spacing="sm">
|
|
91
|
+
<TextArea
|
|
92
|
+
label="Feedback"
|
|
93
|
+
value={feedback}
|
|
94
|
+
onChange={setFeedback}
|
|
95
|
+
placeholder="Share your thoughts..."
|
|
96
|
+
maxLength={maxLength}
|
|
97
|
+
showCharacterCount
|
|
98
|
+
autoGrow
|
|
99
|
+
minHeight={100}
|
|
100
|
+
maxHeight={300}
|
|
101
|
+
/>
|
|
102
|
+
<Text size="sm" color="secondary">
|
|
103
|
+
{feedback.length}/{maxLength} characters
|
|
104
|
+
</Text>
|
|
105
|
+
</View>
|
|
106
|
+
);
|
|
107
|
+
}`,
|
|
108
|
+
|
|
109
|
+
interactive: `import { TextArea, View, Button, Text } from '@idealyst/components';
|
|
110
|
+
import { useState } from 'react';
|
|
111
|
+
|
|
112
|
+
function Example() {
|
|
113
|
+
const [message, setMessage] = useState('');
|
|
114
|
+
const [error, setError] = useState('');
|
|
115
|
+
const [submitted, setSubmitted] = useState(false);
|
|
116
|
+
|
|
117
|
+
const handleSubmit = () => {
|
|
118
|
+
if (message.trim().length < 10) {
|
|
119
|
+
setError('Message must be at least 10 characters');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
setError('');
|
|
123
|
+
setSubmitted(true);
|
|
124
|
+
// Submit logic here
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
if (submitted) {
|
|
128
|
+
return <Text color="success">Message submitted successfully!</Text>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<View spacing="md">
|
|
133
|
+
<TextArea
|
|
134
|
+
label="Your Message"
|
|
135
|
+
value={message}
|
|
136
|
+
onChange={(val) => {
|
|
137
|
+
setMessage(val);
|
|
138
|
+
setError('');
|
|
139
|
+
}}
|
|
140
|
+
placeholder="Type your message here..."
|
|
141
|
+
rows={5}
|
|
142
|
+
maxLength={500}
|
|
143
|
+
showCharacterCount
|
|
144
|
+
error={error}
|
|
145
|
+
helperText={error || 'Minimum 10 characters required'}
|
|
146
|
+
autoGrow
|
|
147
|
+
/>
|
|
148
|
+
<Button intent="primary" onPress={handleSubmit}>
|
|
149
|
+
Submit
|
|
150
|
+
</Button>
|
|
151
|
+
</View>
|
|
152
|
+
);
|
|
153
|
+
}`,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export const Tooltip = {
|
|
2
|
+
category: "overlay",
|
|
3
|
+
description: "Contextual tooltip that displays information on hover or focus",
|
|
4
|
+
props: `
|
|
5
|
+
- \`content\`: string | React.ReactNode - The tooltip content to display
|
|
6
|
+
- \`children\`: React.ReactNode - The element that triggers the tooltip on hover/focus
|
|
7
|
+
- \`placement\`: TooltipPlacement - The placement of the tooltip relative to the trigger
|
|
8
|
+
- \`delay\`: number - Delay in milliseconds before showing the tooltip
|
|
9
|
+
- \`intent\`: TooltipIntentVariant - The intent/color scheme of the tooltip
|
|
10
|
+
- \`size\`: TooltipSizeVariant - The size variant of the tooltip
|
|
11
|
+
`,
|
|
12
|
+
features: [
|
|
13
|
+
"Hover and focus triggers",
|
|
14
|
+
"Four placement options",
|
|
15
|
+
"Configurable delay",
|
|
16
|
+
"Five intent colors",
|
|
17
|
+
"Three sizes",
|
|
18
|
+
"String or custom content",
|
|
19
|
+
"Auto-positioning on overflow",
|
|
20
|
+
],
|
|
21
|
+
bestPractices: [
|
|
22
|
+
"Keep tooltip content concise",
|
|
23
|
+
"Use for supplementary information only",
|
|
24
|
+
"Don't hide critical information in tooltips",
|
|
25
|
+
"Ensure tooltips are keyboard accessible",
|
|
26
|
+
"Use appropriate placement to avoid obscuring content",
|
|
27
|
+
"Add small delay to prevent flashing",
|
|
28
|
+
],
|
|
29
|
+
usage: `
|
|
30
|
+
import { Tooltip, Button } from '@idealyst/components';
|
|
31
|
+
|
|
32
|
+
<Tooltip content="Click to save your changes" placement="top">
|
|
33
|
+
<Button icon="content-save">Save</Button>
|
|
34
|
+
</Tooltip>
|
|
35
|
+
`,
|
|
36
|
+
examples: {
|
|
37
|
+
basic: `import { Tooltip, Button } from '@idealyst/components';
|
|
38
|
+
|
|
39
|
+
<Tooltip content="This is a tooltip">
|
|
40
|
+
<Button>Hover me</Button>
|
|
41
|
+
</Tooltip>`,
|
|
42
|
+
|
|
43
|
+
variants: `import { Tooltip, Button, View } from '@idealyst/components';
|
|
44
|
+
|
|
45
|
+
<View spacing="md">
|
|
46
|
+
<Tooltip content="Top placement" placement="top">
|
|
47
|
+
<Button>Top</Button>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
<Tooltip content="Bottom placement" placement="bottom">
|
|
50
|
+
<Button>Bottom</Button>
|
|
51
|
+
</Tooltip>
|
|
52
|
+
<Tooltip content="Left placement" placement="left">
|
|
53
|
+
<Button>Left</Button>
|
|
54
|
+
</Tooltip>
|
|
55
|
+
<Tooltip content="Right placement" placement="right">
|
|
56
|
+
<Button>Right</Button>
|
|
57
|
+
</Tooltip>
|
|
58
|
+
</View>`,
|
|
59
|
+
|
|
60
|
+
"with-icons": `import { Tooltip, Icon, Text, View } from '@idealyst/components';
|
|
61
|
+
|
|
62
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
63
|
+
<Text>Need help?</Text>
|
|
64
|
+
<Tooltip
|
|
65
|
+
content="Click here for assistance"
|
|
66
|
+
placement="right"
|
|
67
|
+
intent="primary"
|
|
68
|
+
>
|
|
69
|
+
<Icon name="help-circle" size="md" color="primary" />
|
|
70
|
+
</Tooltip>
|
|
71
|
+
</View>`,
|
|
72
|
+
|
|
73
|
+
interactive: `import { Tooltip, Button, View, Text } from '@idealyst/components';
|
|
74
|
+
|
|
75
|
+
function ActionButtons() {
|
|
76
|
+
return (
|
|
77
|
+
<View spacing="sm">
|
|
78
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
79
|
+
<Tooltip content="Save your work" placement="top" delay={500}>
|
|
80
|
+
<Button icon="content-save" type="contained" intent="primary">
|
|
81
|
+
Save
|
|
82
|
+
</Button>
|
|
83
|
+
</Tooltip>
|
|
84
|
+
|
|
85
|
+
<Tooltip content="Undo last action" placement="top" delay={500}>
|
|
86
|
+
<Button icon="undo" type="outlined">
|
|
87
|
+
Undo
|
|
88
|
+
</Button>
|
|
89
|
+
</Tooltip>
|
|
90
|
+
|
|
91
|
+
<Tooltip content="Delete selected items" placement="top" intent="error" delay={500}>
|
|
92
|
+
<Button icon="delete" type="outlined" intent="error">
|
|
93
|
+
Delete
|
|
94
|
+
</Button>
|
|
95
|
+
</Tooltip>
|
|
96
|
+
</View>
|
|
97
|
+
|
|
98
|
+
<Text size="sm" color="secondary">
|
|
99
|
+
Hover over buttons to see tooltips
|
|
100
|
+
</Text>
|
|
101
|
+
</View>
|
|
102
|
+
);
|
|
103
|
+
}`,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export const Video = {
|
|
2
|
+
category: "media",
|
|
3
|
+
description: "Video player component with playback controls and event handlers",
|
|
4
|
+
props: `
|
|
5
|
+
- \`source\`: VideoSource | string - The video source URL or source object with uri and type
|
|
6
|
+
- \`poster\`: string - URL of the poster image to display before playback
|
|
7
|
+
- \`width\`: number | string - The width of the video player
|
|
8
|
+
- \`height\`: number | string - The height of the video player
|
|
9
|
+
- \`aspectRatio\`: number - The aspect ratio of the video (e.g., 16/9, 4/3)
|
|
10
|
+
- \`controls\`: boolean - Whether to show native playback controls
|
|
11
|
+
- \`autoPlay\`: boolean - Whether to automatically start playing when loaded
|
|
12
|
+
- \`loop\`: boolean - Whether to loop the video playback
|
|
13
|
+
- \`muted\`: boolean - Whether to mute the audio
|
|
14
|
+
- \`playsInline\`: boolean - Whether to play inline on mobile devices (prevents fullscreen)
|
|
15
|
+
- \`preload\`: 'auto' | 'metadata' | 'none' - How much of the video to preload
|
|
16
|
+
- \`onLoad\`: function - Called when the video has loaded
|
|
17
|
+
- \`onError\`: function - Called when an error occurs during playback
|
|
18
|
+
- \`onPlay\`: function - Called when the video starts playing
|
|
19
|
+
- \`onPause\`: function - Called when the video is paused
|
|
20
|
+
- \`onEnd\`: function - Called when the video playback ends
|
|
21
|
+
- \`onProgress\`: function - Called periodically during playback with progress information
|
|
22
|
+
- \`borderRadius\`: number - The border radius of the video player
|
|
23
|
+
`,
|
|
24
|
+
features: [
|
|
25
|
+
"Remote and local video sources",
|
|
26
|
+
"Poster image support",
|
|
27
|
+
"Playback controls",
|
|
28
|
+
"Auto-play and loop",
|
|
29
|
+
"Multiple event callbacks",
|
|
30
|
+
"Progress tracking",
|
|
31
|
+
"Aspect ratio control",
|
|
32
|
+
"Border radius support",
|
|
33
|
+
],
|
|
34
|
+
bestPractices: [
|
|
35
|
+
"Always provide a poster image",
|
|
36
|
+
"Use appropriate video formats for cross-platform",
|
|
37
|
+
"Enable controls for user control",
|
|
38
|
+
"Avoid autoPlay with audio (UX best practice)",
|
|
39
|
+
"Use playsInline for better mobile experience",
|
|
40
|
+
"Provide onError fallback",
|
|
41
|
+
"Set explicit dimensions or aspect ratio",
|
|
42
|
+
"Use preload: 'metadata' for better performance",
|
|
43
|
+
],
|
|
44
|
+
usage: `
|
|
45
|
+
import { Video } from '@idealyst/components';
|
|
46
|
+
|
|
47
|
+
<Video
|
|
48
|
+
source={{ uri: 'https://example.com/video.mp4', type: 'video/mp4' }}
|
|
49
|
+
poster="https://example.com/poster.jpg"
|
|
50
|
+
width="100%"
|
|
51
|
+
aspectRatio={16/9}
|
|
52
|
+
controls
|
|
53
|
+
playsInline
|
|
54
|
+
onLoad={() => console.log('Video loaded')}
|
|
55
|
+
onError={(error) => console.error('Video error:', error)}
|
|
56
|
+
/>
|
|
57
|
+
`,
|
|
58
|
+
examples: {
|
|
59
|
+
basic: `import { Video } from '@idealyst/components';
|
|
60
|
+
|
|
61
|
+
<Video
|
|
62
|
+
source="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
|
|
63
|
+
width={640}
|
|
64
|
+
height={360}
|
|
65
|
+
controls
|
|
66
|
+
/>`,
|
|
67
|
+
|
|
68
|
+
variants: `import { Video, View } from '@idealyst/components';
|
|
69
|
+
|
|
70
|
+
<View spacing="md">
|
|
71
|
+
{/* With controls */}
|
|
72
|
+
<Video
|
|
73
|
+
source={{ uri: 'https://example.com/video.mp4' }}
|
|
74
|
+
width="100%"
|
|
75
|
+
aspectRatio={16/9}
|
|
76
|
+
controls
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
{/* Auto-play, looped, muted */}
|
|
80
|
+
<Video
|
|
81
|
+
source={{ uri: 'https://example.com/video.mp4' }}
|
|
82
|
+
width="100%"
|
|
83
|
+
aspectRatio={16/9}
|
|
84
|
+
autoPlay
|
|
85
|
+
loop
|
|
86
|
+
muted
|
|
87
|
+
controls={false}
|
|
88
|
+
/>
|
|
89
|
+
</View>`,
|
|
90
|
+
|
|
91
|
+
"with-icons": `import { Video, Card, View, Text } from '@idealyst/components';
|
|
92
|
+
|
|
93
|
+
<Card type="elevated" padding="none">
|
|
94
|
+
<Video
|
|
95
|
+
source="https://example.com/video.mp4"
|
|
96
|
+
poster="https://example.com/poster.jpg"
|
|
97
|
+
width="100%"
|
|
98
|
+
aspectRatio={16/9}
|
|
99
|
+
controls
|
|
100
|
+
borderRadius={8}
|
|
101
|
+
/>
|
|
102
|
+
<View spacing="sm" style={{ padding: 16 }}>
|
|
103
|
+
<Text weight="bold">Video Title</Text>
|
|
104
|
+
<Text size="sm">Video description and details</Text>
|
|
105
|
+
</View>
|
|
106
|
+
</Card>`,
|
|
107
|
+
|
|
108
|
+
interactive: `import { Video, View, Text, Button } from '@idealyst/components';
|
|
109
|
+
import { useState, useRef } from 'react';
|
|
110
|
+
|
|
111
|
+
function Example() {
|
|
112
|
+
const [playing, setPlaying] = useState(false);
|
|
113
|
+
const [progress, setProgress] = useState(0);
|
|
114
|
+
const videoRef = useRef(null);
|
|
115
|
+
|
|
116
|
+
const handleProgress = ({ currentTime, playableDuration }) => {
|
|
117
|
+
if (playableDuration > 0) {
|
|
118
|
+
setProgress((currentTime / playableDuration) * 100);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<View spacing="md">
|
|
124
|
+
<Video
|
|
125
|
+
ref={videoRef}
|
|
126
|
+
source={{ uri: 'https://example.com/video.mp4' }}
|
|
127
|
+
poster="https://example.com/poster.jpg"
|
|
128
|
+
width="100%"
|
|
129
|
+
aspectRatio={16/9}
|
|
130
|
+
controls
|
|
131
|
+
playsInline
|
|
132
|
+
onPlay={() => setPlaying(true)}
|
|
133
|
+
onPause={() => setPlaying(false)}
|
|
134
|
+
onEnd={() => {
|
|
135
|
+
setPlaying(false);
|
|
136
|
+
setProgress(0);
|
|
137
|
+
}}
|
|
138
|
+
onProgress={handleProgress}
|
|
139
|
+
onError={(error) => console.error('Video error:', error)}
|
|
140
|
+
/>
|
|
141
|
+
|
|
142
|
+
<View spacing="sm">
|
|
143
|
+
<Text>
|
|
144
|
+
Status: {playing ? 'Playing' : 'Paused'} | Progress: {progress.toFixed(1)}%
|
|
145
|
+
</Text>
|
|
146
|
+
|
|
147
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
148
|
+
<Button
|
|
149
|
+
size="sm"
|
|
150
|
+
type="outlined"
|
|
151
|
+
onPress={() => videoRef.current?.play()}
|
|
152
|
+
>
|
|
153
|
+
Play
|
|
154
|
+
</Button>
|
|
155
|
+
<Button
|
|
156
|
+
size="sm"
|
|
157
|
+
type="outlined"
|
|
158
|
+
onPress={() => videoRef.current?.pause()}
|
|
159
|
+
>
|
|
160
|
+
Pause
|
|
161
|
+
</Button>
|
|
162
|
+
</View>
|
|
163
|
+
</View>
|
|
164
|
+
</View>
|
|
165
|
+
);
|
|
166
|
+
}`,
|
|
167
|
+
},
|
|
168
|
+
};
|