@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,106 @@
|
|
|
1
|
+
export const Accordion = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Expandable/collapsible content sections with support for single or multiple open items",
|
|
4
|
+
props: `
|
|
5
|
+
- \`items\`: AccordionItem[] - Array of accordion items with title and content
|
|
6
|
+
- \`allowMultiple\`: boolean - Whether multiple items can be expanded at once
|
|
7
|
+
- \`defaultExpanded\`: string[] - Array of item IDs that should be expanded by default
|
|
8
|
+
- \`type\`: AccordionType - The visual style variant of the accordion
|
|
9
|
+
- \`size\`: AccordionSizeVariant - The size variant of accordion items
|
|
10
|
+
`,
|
|
11
|
+
features: [
|
|
12
|
+
"Single or multiple item expansion modes",
|
|
13
|
+
"Default expanded items support",
|
|
14
|
+
"Three visual variants",
|
|
15
|
+
"Three size options",
|
|
16
|
+
"Disabled item state",
|
|
17
|
+
"Controlled and uncontrolled modes",
|
|
18
|
+
],
|
|
19
|
+
bestPractices: [
|
|
20
|
+
"Use 'default' variant for standard content organization",
|
|
21
|
+
"Use 'separated' variant for distinct sections",
|
|
22
|
+
"Set allowMultiple to true for FAQs where users may need to compare answers",
|
|
23
|
+
"Keep accordion titles concise and descriptive",
|
|
24
|
+
"Use defaultExpanded sparingly to avoid overwhelming users",
|
|
25
|
+
],
|
|
26
|
+
usage: `
|
|
27
|
+
import { Accordion } from '@idealyst/components';
|
|
28
|
+
|
|
29
|
+
const items = [
|
|
30
|
+
{
|
|
31
|
+
id: '1',
|
|
32
|
+
title: 'What is Idealyst?',
|
|
33
|
+
content: <Text>Idealyst is a cross-platform React framework...</Text>,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: '2',
|
|
37
|
+
title: 'How do I get started?',
|
|
38
|
+
content: <Text>Install the CLI and create a new project...</Text>,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
<Accordion
|
|
43
|
+
items={items}
|
|
44
|
+
type="bordered"
|
|
45
|
+
defaultExpanded={['1']}
|
|
46
|
+
/>
|
|
47
|
+
`,
|
|
48
|
+
examples: {
|
|
49
|
+
basic: `import { Accordion, Text } from '@idealyst/components';
|
|
50
|
+
|
|
51
|
+
const items = [
|
|
52
|
+
{ id: '1', title: 'Section 1', content: <Text>Content 1</Text> },
|
|
53
|
+
{ id: '2', title: 'Section 2', content: <Text>Content 2</Text> },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
<Accordion items={items} />`,
|
|
57
|
+
|
|
58
|
+
variants: `import { Accordion, Text } from '@idealyst/components';
|
|
59
|
+
|
|
60
|
+
const items = [
|
|
61
|
+
{ id: '1', title: 'Item', content: <Text>Content</Text> },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
// Different variants
|
|
65
|
+
<Accordion items={items} type="default" />
|
|
66
|
+
<Accordion items={items} type="separated" />
|
|
67
|
+
<Accordion items={items} type="bordered" />`,
|
|
68
|
+
|
|
69
|
+
"with-icons": `import { Accordion, View, Icon, Text } from '@idealyst/components';
|
|
70
|
+
|
|
71
|
+
const items = [
|
|
72
|
+
{
|
|
73
|
+
id: '1',
|
|
74
|
+
title: 'Account Settings',
|
|
75
|
+
content: (
|
|
76
|
+
<View spacing="sm">
|
|
77
|
+
<Icon name="account" size="md" />
|
|
78
|
+
<Text>Manage your account preferences</Text>
|
|
79
|
+
</View>
|
|
80
|
+
),
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
<Accordion items={items} intent="primary" />`,
|
|
85
|
+
|
|
86
|
+
interactive: `import { Accordion, Text } from '@idealyst/components';
|
|
87
|
+
import { useState } from 'react';
|
|
88
|
+
|
|
89
|
+
function Example() {
|
|
90
|
+
const items = [
|
|
91
|
+
{ id: '1', title: 'FAQ 1', content: <Text>Answer 1</Text> },
|
|
92
|
+
{ id: '2', title: 'FAQ 2', content: <Text>Answer 2</Text> },
|
|
93
|
+
{ id: '3', title: 'FAQ 3', content: <Text>Answer 3</Text> },
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Accordion
|
|
98
|
+
items={items}
|
|
99
|
+
allowMultiple
|
|
100
|
+
defaultExpanded={['1']}
|
|
101
|
+
type="bordered"
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}`,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const ActivityIndicator = {
|
|
2
|
+
category: "feedback",
|
|
3
|
+
description: "Loading spinner/indicator for showing ongoing processes or loading states",
|
|
4
|
+
props: `
|
|
5
|
+
- \`animating\`: boolean - Whether the indicator is animating (visible)
|
|
6
|
+
- \`size\`: ActivityIndicatorSizeVariant - The size of the indicator
|
|
7
|
+
- \`intent\`: ActivityIndicatorIntentVariant - The color/intent of the indicator
|
|
8
|
+
- \`color\`: string - Custom color to override intent
|
|
9
|
+
- \`hidesWhenStopped\`: boolean - Whether to hide the indicator when not animating
|
|
10
|
+
`,
|
|
11
|
+
features: [
|
|
12
|
+
"Animated loading spinner",
|
|
13
|
+
"Three predefined sizes plus custom numeric size",
|
|
14
|
+
"Five intent colors",
|
|
15
|
+
"Custom color support",
|
|
16
|
+
"Auto-hide when stopped",
|
|
17
|
+
"Cross-platform support",
|
|
18
|
+
],
|
|
19
|
+
bestPractices: [
|
|
20
|
+
"Use 'primary' intent for general loading states",
|
|
21
|
+
"Use 'sm' size for inline loading indicators",
|
|
22
|
+
"Use 'lg' size for full-screen loading overlays",
|
|
23
|
+
"Always provide context about what is loading",
|
|
24
|
+
"Consider using with overlay for blocking operations",
|
|
25
|
+
],
|
|
26
|
+
usage: `
|
|
27
|
+
import { ActivityIndicator, View, Text } from '@idealyst/components';
|
|
28
|
+
|
|
29
|
+
<View spacing="md">
|
|
30
|
+
<ActivityIndicator size="lg" intent="primary" />
|
|
31
|
+
<Text>Loading data...</Text>
|
|
32
|
+
</View>
|
|
33
|
+
`,
|
|
34
|
+
examples: {
|
|
35
|
+
basic: `import { ActivityIndicator } from '@idealyst/components';
|
|
36
|
+
|
|
37
|
+
<ActivityIndicator />`,
|
|
38
|
+
|
|
39
|
+
variants: `import { ActivityIndicator, View } from '@idealyst/components';
|
|
40
|
+
|
|
41
|
+
<View spacing="md">
|
|
42
|
+
<ActivityIndicator size="sm" />
|
|
43
|
+
<ActivityIndicator size="md" />
|
|
44
|
+
<ActivityIndicator size="lg" />
|
|
45
|
+
<ActivityIndicator size={48} />
|
|
46
|
+
</View>`,
|
|
47
|
+
|
|
48
|
+
"with-icons": `import { ActivityIndicator, View, Text } from '@idealyst/components';
|
|
49
|
+
|
|
50
|
+
<View spacing="sm" style={{ alignItems: 'center' }}>
|
|
51
|
+
<ActivityIndicator intent="success" size="lg" />
|
|
52
|
+
<Text>Processing...</Text>
|
|
53
|
+
</View>`,
|
|
54
|
+
|
|
55
|
+
interactive: `import { ActivityIndicator, Button, View, Text } from '@idealyst/components';
|
|
56
|
+
import { useState } from 'react';
|
|
57
|
+
|
|
58
|
+
function Example() {
|
|
59
|
+
const [loading, setLoading] = useState(false);
|
|
60
|
+
|
|
61
|
+
const handleLoad = async () => {
|
|
62
|
+
setLoading(true);
|
|
63
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
64
|
+
setLoading(false);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<View spacing="md">
|
|
69
|
+
<Button onPress={handleLoad} disabled={loading}>
|
|
70
|
+
Load Data
|
|
71
|
+
</Button>
|
|
72
|
+
{loading && (
|
|
73
|
+
<View spacing="sm" style={{ alignItems: 'center' }}>
|
|
74
|
+
<ActivityIndicator size="lg" />
|
|
75
|
+
<Text>Loading...</Text>
|
|
76
|
+
</View>
|
|
77
|
+
)}
|
|
78
|
+
</View>
|
|
79
|
+
);
|
|
80
|
+
}`,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export const Alert = {
|
|
2
|
+
category: "feedback",
|
|
3
|
+
description: "Message banner for displaying important information, warnings, errors, and success messages",
|
|
4
|
+
props: `
|
|
5
|
+
- \`title\`: string - The title text of the alert
|
|
6
|
+
- \`message\`: string - The message text of the alert
|
|
7
|
+
- \`children\`: React.ReactNode - Custom content to display (overrides title and message)
|
|
8
|
+
- \`intent\`: AlertIntentVariant - The intent/color scheme (success, error, warning, info, neutral)
|
|
9
|
+
- \`type\`: AlertType - The visual style variant (filled, outlined, subtle)
|
|
10
|
+
- \`icon\`: React.ReactNode - Custom icon to display (overrides default intent icon)
|
|
11
|
+
- \`showIcon\`: boolean - Whether to show the icon (defaults to true)
|
|
12
|
+
- \`dismissible\`: boolean - Whether the alert can be dismissed with a close button
|
|
13
|
+
- \`onDismiss\`: function - Called when the alert is dismissed
|
|
14
|
+
- \`actions\`: React.ReactNode - Action buttons to display in the alert
|
|
15
|
+
`,
|
|
16
|
+
features: [
|
|
17
|
+
"Five intent types with semantic meaning",
|
|
18
|
+
"Three visual variants",
|
|
19
|
+
"Default icons for each intent",
|
|
20
|
+
"Custom icon support",
|
|
21
|
+
"Dismissible with close button",
|
|
22
|
+
"Action buttons support",
|
|
23
|
+
"Title and message or custom children",
|
|
24
|
+
],
|
|
25
|
+
bestPractices: [
|
|
26
|
+
"Use 'error' intent for critical errors requiring immediate attention",
|
|
27
|
+
"Use 'warning' intent for important but non-critical information",
|
|
28
|
+
"Use 'success' intent for positive confirmations",
|
|
29
|
+
"Use 'info' intent for general informational messages",
|
|
30
|
+
"Keep alert messages concise and actionable",
|
|
31
|
+
"Make alerts dismissible unless they require action",
|
|
32
|
+
],
|
|
33
|
+
usage: `
|
|
34
|
+
import { Alert } from '@idealyst/components';
|
|
35
|
+
|
|
36
|
+
<Alert
|
|
37
|
+
intent="error"
|
|
38
|
+
title="Error"
|
|
39
|
+
message="Failed to save changes. Please try again."
|
|
40
|
+
dismissible
|
|
41
|
+
onDismiss={() => setShowAlert(false)}
|
|
42
|
+
/>
|
|
43
|
+
`,
|
|
44
|
+
examples: {
|
|
45
|
+
basic: `import { Alert } from '@idealyst/components';
|
|
46
|
+
|
|
47
|
+
<Alert
|
|
48
|
+
intent="info"
|
|
49
|
+
message="This is an informational message"
|
|
50
|
+
/>`,
|
|
51
|
+
|
|
52
|
+
variants: `import { Alert, View } from '@idealyst/components';
|
|
53
|
+
|
|
54
|
+
<View spacing="md">
|
|
55
|
+
<Alert
|
|
56
|
+
intent="success"
|
|
57
|
+
type="filled"
|
|
58
|
+
message="Success message"
|
|
59
|
+
/>
|
|
60
|
+
<Alert
|
|
61
|
+
intent="warning"
|
|
62
|
+
type="outlined"
|
|
63
|
+
message="Warning message"
|
|
64
|
+
/>
|
|
65
|
+
<Alert
|
|
66
|
+
intent="error"
|
|
67
|
+
type="soft"
|
|
68
|
+
message="Error message"
|
|
69
|
+
/>
|
|
70
|
+
</View>`,
|
|
71
|
+
|
|
72
|
+
"with-icons": `import { Alert, View } from '@idealyst/components';
|
|
73
|
+
|
|
74
|
+
<View spacing="md">
|
|
75
|
+
<Alert
|
|
76
|
+
intent="success"
|
|
77
|
+
title="Success!"
|
|
78
|
+
message="Your changes have been saved"
|
|
79
|
+
showIcon
|
|
80
|
+
/>
|
|
81
|
+
<Alert
|
|
82
|
+
intent="error"
|
|
83
|
+
title="Error"
|
|
84
|
+
message="Something went wrong"
|
|
85
|
+
showIcon
|
|
86
|
+
dismissible
|
|
87
|
+
/>
|
|
88
|
+
</View>`,
|
|
89
|
+
|
|
90
|
+
interactive: `import { Alert, Button, View } from '@idealyst/components';
|
|
91
|
+
import { useState } from 'react';
|
|
92
|
+
|
|
93
|
+
function Example() {
|
|
94
|
+
const [showAlert, setShowAlert] = useState(false);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<View spacing="md">
|
|
98
|
+
<Button onPress={() => setShowAlert(true)}>
|
|
99
|
+
Show Alert
|
|
100
|
+
</Button>
|
|
101
|
+
|
|
102
|
+
{showAlert && (
|
|
103
|
+
<Alert
|
|
104
|
+
intent="warning"
|
|
105
|
+
title="Unsaved Changes"
|
|
106
|
+
message="You have unsaved changes that will be lost."
|
|
107
|
+
dismissible
|
|
108
|
+
onDismiss={() => setShowAlert(false)}
|
|
109
|
+
actions={
|
|
110
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
111
|
+
<Button size="sm" onPress={() => setShowAlert(false)}>
|
|
112
|
+
Cancel
|
|
113
|
+
</Button>
|
|
114
|
+
<Button
|
|
115
|
+
size="sm"
|
|
116
|
+
intent="warning"
|
|
117
|
+
onPress={() => {
|
|
118
|
+
handleSave();
|
|
119
|
+
setShowAlert(false);
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
Save
|
|
123
|
+
</Button>
|
|
124
|
+
</View>
|
|
125
|
+
}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
</View>
|
|
129
|
+
);
|
|
130
|
+
}`,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const Avatar = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Profile picture or user avatar with fallback text support",
|
|
4
|
+
props: `
|
|
5
|
+
- \`src\`: string | ImageSourcePropType - Image source (URL or require())
|
|
6
|
+
- \`alt\`: string - Alt text for the image
|
|
7
|
+
- \`fallback\`: string - Fallback text (usually initials)
|
|
8
|
+
- \`size\`: AvatarSizeVariant - Size of the avatar
|
|
9
|
+
- \`shape\`: AvatarShapeVariant - Shape of the avatar
|
|
10
|
+
- \`color\`: AvatarColorVariant - The color scheme of the avatar (for background when no image)
|
|
11
|
+
`,
|
|
12
|
+
features: [
|
|
13
|
+
"Image display with automatic fallback",
|
|
14
|
+
"Fallback text (initials) support",
|
|
15
|
+
"Four size options",
|
|
16
|
+
"Circle and square shapes",
|
|
17
|
+
"Theme color variants for fallback backgrounds",
|
|
18
|
+
"Accessible with alt text",
|
|
19
|
+
],
|
|
20
|
+
bestPractices: [
|
|
21
|
+
"Always provide alt text for accessibility",
|
|
22
|
+
"Use initials (2 characters) for fallback text",
|
|
23
|
+
"Use 'circle' shape for user avatars",
|
|
24
|
+
"Use 'square' shape for brands or organizations",
|
|
25
|
+
"Choose contrasting colors for fallback backgrounds",
|
|
26
|
+
],
|
|
27
|
+
usage: `
|
|
28
|
+
import { Avatar } from '@idealyst/components';
|
|
29
|
+
|
|
30
|
+
<Avatar
|
|
31
|
+
src="https://example.com/avatar.jpg"
|
|
32
|
+
alt="John Doe"
|
|
33
|
+
fallback="JD"
|
|
34
|
+
size="lg"
|
|
35
|
+
shape="circle"
|
|
36
|
+
/>
|
|
37
|
+
`,
|
|
38
|
+
examples: {
|
|
39
|
+
basic: `import { Avatar } from '@idealyst/components';
|
|
40
|
+
|
|
41
|
+
<Avatar
|
|
42
|
+
fallback="JD"
|
|
43
|
+
size="md"
|
|
44
|
+
/>`,
|
|
45
|
+
|
|
46
|
+
variants: `import { Avatar, View } from '@idealyst/components';
|
|
47
|
+
|
|
48
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
49
|
+
<Avatar fallback="SM" size="sm" />
|
|
50
|
+
<Avatar fallback="MD" size="md" />
|
|
51
|
+
<Avatar fallback="LG" size="lg" />
|
|
52
|
+
<Avatar fallback="XL" size="xl" />
|
|
53
|
+
</View>`,
|
|
54
|
+
|
|
55
|
+
"with-icons": `import { Avatar, View } from '@idealyst/components';
|
|
56
|
+
|
|
57
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
58
|
+
{/* Circle avatars */}
|
|
59
|
+
<Avatar
|
|
60
|
+
src="https://i.pravatar.cc/150?img=1"
|
|
61
|
+
alt="User 1"
|
|
62
|
+
fallback="U1"
|
|
63
|
+
shape="circle"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{/* Square avatars */}
|
|
67
|
+
<Avatar
|
|
68
|
+
src="https://i.pravatar.cc/150?img=2"
|
|
69
|
+
alt="User 2"
|
|
70
|
+
fallback="U2"
|
|
71
|
+
shape="square"
|
|
72
|
+
/>
|
|
73
|
+
</View>`,
|
|
74
|
+
|
|
75
|
+
interactive: `import { Avatar, View, Text } from '@idealyst/components';
|
|
76
|
+
|
|
77
|
+
function UserProfile({ user }) {
|
|
78
|
+
return (
|
|
79
|
+
<View spacing="sm" style={{ alignItems: 'center' }}>
|
|
80
|
+
<Avatar
|
|
81
|
+
src={user.avatar}
|
|
82
|
+
alt={user.name}
|
|
83
|
+
fallback={user.initials}
|
|
84
|
+
size="xl"
|
|
85
|
+
color="primary"
|
|
86
|
+
/>
|
|
87
|
+
<Text weight="bold">{user.name}</Text>
|
|
88
|
+
<Text size="sm" color="secondary">{user.email}</Text>
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
}`,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const Badge = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Small status indicator with various styles and colors",
|
|
4
|
+
props: `
|
|
5
|
+
- \`children\`: React.ReactNode - The content to display inside the badge
|
|
6
|
+
- \`size\`: BadgeSizeVariant - The size of the badge
|
|
7
|
+
- \`type\`: BadgeType - The visual style variant of the badge
|
|
8
|
+
- \`color\`: BadgeColorVariant - The color scheme of the badge
|
|
9
|
+
- \`icon\`: IconName | React.ReactNode - Icon to display. Can be an icon name or custom component (ReactNode)
|
|
10
|
+
`,
|
|
11
|
+
features: [
|
|
12
|
+
"Three visual variants",
|
|
13
|
+
"Theme palette color support",
|
|
14
|
+
"Three sizes",
|
|
15
|
+
"Icon support",
|
|
16
|
+
"Dot variant for minimal indicators",
|
|
17
|
+
],
|
|
18
|
+
bestPractices: [
|
|
19
|
+
"Use 'dot' variant for minimal status indicators",
|
|
20
|
+
"Use 'filled' variant for prominent badges",
|
|
21
|
+
"Keep badge content short (numbers or 1-2 words)",
|
|
22
|
+
"Use appropriate colors for semantic meaning",
|
|
23
|
+
],
|
|
24
|
+
usage: `
|
|
25
|
+
import { Badge } from '@idealyst/components';
|
|
26
|
+
|
|
27
|
+
<Badge type="filled" color="red">
|
|
28
|
+
3
|
|
29
|
+
</Badge>
|
|
30
|
+
`,
|
|
31
|
+
examples: {
|
|
32
|
+
basic: `import { Badge } from '@idealyst/components';
|
|
33
|
+
|
|
34
|
+
<Badge>New</Badge>`,
|
|
35
|
+
variants: `import { Badge } from '@idealyst/components';
|
|
36
|
+
|
|
37
|
+
<Badge type="filled" color="blue">5</Badge>
|
|
38
|
+
<Badge type="outlined" color="green">Active</Badge>
|
|
39
|
+
<Badge type="dot" color="red" />`,
|
|
40
|
+
"with-icons": `import { Badge } from '@idealyst/components';
|
|
41
|
+
|
|
42
|
+
<Badge icon="star" color="yellow">
|
|
43
|
+
Featured
|
|
44
|
+
</Badge>`,
|
|
45
|
+
interactive: `import { Badge, Button, View } from '@idealyst/components';
|
|
46
|
+
import { useState } from 'react';
|
|
47
|
+
|
|
48
|
+
function Example() {
|
|
49
|
+
const [count, setCount] = useState(0);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<View spacing="sm">
|
|
53
|
+
<Badge type="filled" color="red">
|
|
54
|
+
{count}
|
|
55
|
+
</Badge>
|
|
56
|
+
<Button onPress={() => setCount(count + 1)}>
|
|
57
|
+
Increment
|
|
58
|
+
</Button>
|
|
59
|
+
</View>
|
|
60
|
+
);
|
|
61
|
+
}`,
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const Breadcrumb = {
|
|
2
|
+
category: "navigation",
|
|
3
|
+
description: "Navigation aid showing the current location within a hierarchy",
|
|
4
|
+
props: `
|
|
5
|
+
- \`items\`: BreadcrumbItem[] - Array of breadcrumb items
|
|
6
|
+
- \`separator\`: React.ReactNode - Custom separator between items (default: '/')
|
|
7
|
+
- \`maxItems\`: number - Maximum number of items to show before truncating
|
|
8
|
+
- \`intent\`: BreadcrumbIntentVariant - Intent color for links
|
|
9
|
+
- \`size\`: BreadcrumbSizeVariant - Size of the breadcrumb text
|
|
10
|
+
- \`itemStyle\`: StyleProp<ViewStyle> - Custom item style
|
|
11
|
+
- \`separatorStyle\`: StyleProp<TextStyle> - Custom separator style
|
|
12
|
+
- \`responsive\`: boolean - Enable responsive collapsing on narrow screens
|
|
13
|
+
- \`minVisibleItems\`: number - Minimum number of items to show before collapsing (default: 3)
|
|
14
|
+
`,
|
|
15
|
+
features: [
|
|
16
|
+
"Icon support with string names or custom components",
|
|
17
|
+
"Custom separators",
|
|
18
|
+
"Truncation with maxItems",
|
|
19
|
+
"Two intent colors",
|
|
20
|
+
"Three sizes",
|
|
21
|
+
"Disabled items",
|
|
22
|
+
"Click handlers for navigation",
|
|
23
|
+
],
|
|
24
|
+
bestPractices: [
|
|
25
|
+
"Keep breadcrumb labels short and clear",
|
|
26
|
+
"Last item should represent current page (typically not clickable)",
|
|
27
|
+
"Use icons sparingly for visual clarity",
|
|
28
|
+
"Set maxItems for deep hierarchies to avoid overflow",
|
|
29
|
+
"Use 'neutral' intent for subtle breadcrumbs",
|
|
30
|
+
],
|
|
31
|
+
usage: `
|
|
32
|
+
import { Breadcrumb } from '@idealyst/components';
|
|
33
|
+
|
|
34
|
+
const items = [
|
|
35
|
+
{ label: 'Home', icon: 'home', onPress: () => navigate('/') },
|
|
36
|
+
{ label: 'Products', onPress: () => navigate('/products') },
|
|
37
|
+
{ label: 'Electronics', onPress: () => navigate('/products/electronics') },
|
|
38
|
+
{ label: 'Laptop' }, // Current page, no onPress
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
<Breadcrumb items={items} intent="primary" />
|
|
42
|
+
`,
|
|
43
|
+
examples: {
|
|
44
|
+
basic: `import { Breadcrumb } from '@idealyst/components';
|
|
45
|
+
|
|
46
|
+
const items = [
|
|
47
|
+
{ label: 'Home', onPress: () => console.log('Home') },
|
|
48
|
+
{ label: 'Products', onPress: () => console.log('Products') },
|
|
49
|
+
{ label: 'Item' },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
<Breadcrumb items={items} />`,
|
|
53
|
+
|
|
54
|
+
variants: `import { Breadcrumb, View } from '@idealyst/components';
|
|
55
|
+
|
|
56
|
+
const items = [
|
|
57
|
+
{ label: 'Home', onPress: () => {} },
|
|
58
|
+
{ label: 'Category', onPress: () => {} },
|
|
59
|
+
{ label: 'Item' },
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
<View spacing="md">
|
|
63
|
+
<Breadcrumb items={items} size="sm" />
|
|
64
|
+
<Breadcrumb items={items} size="md" />
|
|
65
|
+
<Breadcrumb items={items} size="lg" />
|
|
66
|
+
</View>`,
|
|
67
|
+
|
|
68
|
+
"with-icons": `import { Breadcrumb } from '@idealyst/components';
|
|
69
|
+
|
|
70
|
+
const items = [
|
|
71
|
+
{ label: 'Home', icon: 'home', onPress: () => navigate('/') },
|
|
72
|
+
{ label: 'Settings', icon: 'cog', onPress: () => navigate('/settings') },
|
|
73
|
+
{ label: 'Profile', icon: 'account' },
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
<Breadcrumb items={items} intent="primary" />`,
|
|
77
|
+
|
|
78
|
+
interactive: `import { Breadcrumb } from '@idealyst/components';
|
|
79
|
+
import { useState } from 'react';
|
|
80
|
+
|
|
81
|
+
function Example() {
|
|
82
|
+
const [path, setPath] = useState(['Home', 'Products', 'Electronics']);
|
|
83
|
+
|
|
84
|
+
const items = path.map((label, index) => ({
|
|
85
|
+
label,
|
|
86
|
+
onPress: index < path.length - 1
|
|
87
|
+
? () => setPath(path.slice(0, index + 1))
|
|
88
|
+
: undefined,
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
return <Breadcrumb items={items} maxItems={4} />;
|
|
92
|
+
}`,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const Button = {
|
|
2
|
+
category: "form",
|
|
3
|
+
description: "Interactive button component with multiple variants, sizes, and icon support",
|
|
4
|
+
props: `
|
|
5
|
+
- \`children\`: React.ReactNode - The text or content to display inside the button
|
|
6
|
+
- \`title\`: string - The text title to display inside the button (for web)
|
|
7
|
+
- \`onPress\`: function - Called when the button is pressed
|
|
8
|
+
- \`disabled\`: boolean - Whether the button is disabled
|
|
9
|
+
- \`type\`: ButtonType - The visual style type of the button
|
|
10
|
+
- \`intent\`: ButtonIntentVariant - The intent/color scheme of the button
|
|
11
|
+
- \`size\`: ButtonSizeVariant - The size of the button
|
|
12
|
+
- \`leftIcon\`: IconName | React.ReactNode - Icon to display on the left side. Can be an icon name or custom component (ReactNode)
|
|
13
|
+
- \`rightIcon\`: IconName | React.ReactNode - Icon to display on the right side. Can be an icon name or custom component (ReactNode)
|
|
14
|
+
`,
|
|
15
|
+
features: [
|
|
16
|
+
"Three variants: contained, outlined, text",
|
|
17
|
+
"Five intent colors for semantic meaning",
|
|
18
|
+
"Three sizes: sm, md, lg",
|
|
19
|
+
"Icon support with string names or custom React elements",
|
|
20
|
+
"Loading and disabled states",
|
|
21
|
+
"Full width option",
|
|
22
|
+
"Cross-platform (React & React Native)",
|
|
23
|
+
],
|
|
24
|
+
bestPractices: [
|
|
25
|
+
"Use 'primary' intent for main actions",
|
|
26
|
+
"Use 'contained' variant for prominent actions",
|
|
27
|
+
"Use icon names (strings) for consistency with design system",
|
|
28
|
+
"Keep button labels concise and action-oriented",
|
|
29
|
+
],
|
|
30
|
+
usage: `
|
|
31
|
+
import { Button } from '@idealyst/components';
|
|
32
|
+
|
|
33
|
+
<Button
|
|
34
|
+
type="contained"
|
|
35
|
+
intent="primary"
|
|
36
|
+
icon="check"
|
|
37
|
+
onPress={() => console.log('Pressed')}
|
|
38
|
+
>
|
|
39
|
+
Save Changes
|
|
40
|
+
</Button>
|
|
41
|
+
`,
|
|
42
|
+
examples: {
|
|
43
|
+
basic: `import { Button } from '@idealyst/components';
|
|
44
|
+
|
|
45
|
+
// Basic button
|
|
46
|
+
<Button onPress={() => console.log('Clicked')}>
|
|
47
|
+
Click Me
|
|
48
|
+
</Button>`,
|
|
49
|
+
variants: `import { Button } from '@idealyst/components';
|
|
50
|
+
|
|
51
|
+
// Different variants
|
|
52
|
+
<Button type="contained" intent="primary">Contained</Button>
|
|
53
|
+
<Button type="outlined" intent="primary">Outlined</Button>
|
|
54
|
+
<Button type="text" intent="primary">Text</Button>`,
|
|
55
|
+
"with-icons": `import { Button } from '@idealyst/components';
|
|
56
|
+
|
|
57
|
+
// Button with icon
|
|
58
|
+
<Button icon="check" iconPosition="left">
|
|
59
|
+
Confirm
|
|
60
|
+
</Button>
|
|
61
|
+
|
|
62
|
+
// Icon-only button
|
|
63
|
+
<Button icon="close" />`,
|
|
64
|
+
interactive: `import { Button } from '@idealyst/components';
|
|
65
|
+
import { useState } from 'react';
|
|
66
|
+
|
|
67
|
+
function Example() {
|
|
68
|
+
const [loading, setLoading] = useState(false);
|
|
69
|
+
|
|
70
|
+
const handlePress = async () => {
|
|
71
|
+
setLoading(true);
|
|
72
|
+
await someAsyncOperation();
|
|
73
|
+
setLoading(false);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Button
|
|
78
|
+
loading={loading}
|
|
79
|
+
onPress={handlePress}
|
|
80
|
+
>
|
|
81
|
+
Save
|
|
82
|
+
</Button>
|
|
83
|
+
);
|
|
84
|
+
}`,
|
|
85
|
+
}
|
|
86
|
+
};
|