@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,122 @@
|
|
|
1
|
+
export const Image = {
|
|
2
|
+
category: "media",
|
|
3
|
+
description: "Image component with loading states, fallback support, and various object-fit modes",
|
|
4
|
+
props: `
|
|
5
|
+
- \`source\`: ImageSourcePropType | string - Image source (URL, require(), or URI object)
|
|
6
|
+
- \`alt\`: string - Alt text for accessibility
|
|
7
|
+
- \`width\`: number | string - Image width
|
|
8
|
+
- \`height\`: number | string - Image height
|
|
9
|
+
- \`aspectRatio\`: number - Aspect ratio (width/height)
|
|
10
|
+
- \`objectFit\`: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down' - How image fits container
|
|
11
|
+
- \`loading\`: 'lazy' | 'eager' - Loading strategy (web)
|
|
12
|
+
- \`placeholder\`: ReactNode - Content shown while loading
|
|
13
|
+
- \`fallback\`: ReactNode - Content shown on error
|
|
14
|
+
- \`onLoad\`: () => void - Called when image loads successfully
|
|
15
|
+
- \`onError\`: (error: any) => void - Called on image load error
|
|
16
|
+
- \`borderRadius\`: number - Border radius in pixels
|
|
17
|
+
- \`style\`: ImageStyle - Additional custom styles
|
|
18
|
+
- \`testID\`: string - Test identifier
|
|
19
|
+
- \`accessibilityLabel\`: string - Accessibility label
|
|
20
|
+
`,
|
|
21
|
+
features: [
|
|
22
|
+
"Remote and local image sources",
|
|
23
|
+
"Lazy loading support (web)",
|
|
24
|
+
"Loading placeholder",
|
|
25
|
+
"Error fallback",
|
|
26
|
+
"Multiple object-fit modes",
|
|
27
|
+
"Aspect ratio control",
|
|
28
|
+
"Border radius support",
|
|
29
|
+
"Load/error callbacks",
|
|
30
|
+
],
|
|
31
|
+
bestPractices: [
|
|
32
|
+
"Always provide alt text for accessibility",
|
|
33
|
+
"Use lazy loading for images below the fold",
|
|
34
|
+
"Provide placeholder for better perceived performance",
|
|
35
|
+
"Use fallback for graceful error handling",
|
|
36
|
+
"Use objectFit: 'cover' for thumbnails",
|
|
37
|
+
"Use objectFit: 'contain' to show full image",
|
|
38
|
+
],
|
|
39
|
+
usage: `
|
|
40
|
+
import { Image, ActivityIndicator } from '@idealyst/components';
|
|
41
|
+
|
|
42
|
+
<Image
|
|
43
|
+
source="https://example.com/image.jpg"
|
|
44
|
+
alt="Product photo"
|
|
45
|
+
width={300}
|
|
46
|
+
height={200}
|
|
47
|
+
objectFit="cover"
|
|
48
|
+
borderRadius={8}
|
|
49
|
+
placeholder={<ActivityIndicator />}
|
|
50
|
+
fallback={<Text>Failed to load</Text>}
|
|
51
|
+
/>
|
|
52
|
+
`,
|
|
53
|
+
examples: {
|
|
54
|
+
basic: `import { Image } from '@idealyst/components';
|
|
55
|
+
|
|
56
|
+
<Image
|
|
57
|
+
source="https://picsum.photos/200/300"
|
|
58
|
+
alt="Random image"
|
|
59
|
+
width={200}
|
|
60
|
+
height={300}
|
|
61
|
+
/>`,
|
|
62
|
+
variants: `import { Image, View } from '@idealyst/components';
|
|
63
|
+
|
|
64
|
+
<View spacing="md">
|
|
65
|
+
<Image
|
|
66
|
+
source="https://picsum.photos/300/200"
|
|
67
|
+
alt="Cover"
|
|
68
|
+
width={300}
|
|
69
|
+
height={200}
|
|
70
|
+
objectFit="cover"
|
|
71
|
+
/>
|
|
72
|
+
<Image
|
|
73
|
+
source="https://picsum.photos/300/200"
|
|
74
|
+
alt="Contain"
|
|
75
|
+
width={300}
|
|
76
|
+
height={200}
|
|
77
|
+
objectFit="contain"
|
|
78
|
+
/>
|
|
79
|
+
</View>`,
|
|
80
|
+
"with-icons": `import { Image, Card, View, Text } from '@idealyst/components';
|
|
81
|
+
|
|
82
|
+
<Card variant="outlined">
|
|
83
|
+
<Image
|
|
84
|
+
source="https://picsum.photos/400/250"
|
|
85
|
+
alt="Card image"
|
|
86
|
+
width="100%"
|
|
87
|
+
aspectRatio={16 / 9}
|
|
88
|
+
objectFit="cover"
|
|
89
|
+
borderRadius={8}
|
|
90
|
+
/>
|
|
91
|
+
<View spacing="sm" style={{ padding: 16 }}>
|
|
92
|
+
<Text weight="bold">Image Title</Text>
|
|
93
|
+
<Text size="small">Description text</Text>
|
|
94
|
+
</View>
|
|
95
|
+
</Card>`,
|
|
96
|
+
interactive: `import { Image, ActivityIndicator, Text, View } from '@idealyst/components';
|
|
97
|
+
import { useState } from 'react';
|
|
98
|
+
|
|
99
|
+
function Example() {
|
|
100
|
+
const [loaded, setLoaded] = useState(false);
|
|
101
|
+
const [error, setError] = useState(false);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<View spacing="sm">
|
|
105
|
+
<Image
|
|
106
|
+
source="https://picsum.photos/300/200"
|
|
107
|
+
alt="Example"
|
|
108
|
+
width={300}
|
|
109
|
+
height={200}
|
|
110
|
+
onLoad={() => setLoaded(true)}
|
|
111
|
+
onError={() => setError(true)}
|
|
112
|
+
placeholder={<ActivityIndicator />}
|
|
113
|
+
fallback={<Text>Failed to load image</Text>}
|
|
114
|
+
/>
|
|
115
|
+
{loaded && <Text color="success">Image loaded!</Text>}
|
|
116
|
+
{error && <Text color="error">Failed to load</Text>}
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
}`,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../src/data/components/Image.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,qFAAqF;IAClG,KAAK,EAAE;;;;;;;;;;;;;;;;CAgBR;IACC,QAAQ,EAAE;QACR,gCAAgC;QAChC,4BAA4B;QAC5B,qBAAqB;QACrB,gBAAgB;QAChB,2BAA2B;QAC3B,sBAAsB;QACtB,uBAAuB;QACvB,sBAAsB;KACvB;IACD,aAAa,EAAE;QACb,2CAA2C;QAC3C,4CAA4C;QAC5C,sDAAsD;QACtD,0CAA0C;QAC1C,uCAAuC;QACvC,6CAA6C;KAC9C;IACD,KAAK,EAAE;;;;;;;;;;;;;CAaR;IACC,QAAQ,EAAE;QACR,KAAK,EAAE;;;;;;;GAOR;QAEC,QAAQ,EAAE;;;;;;;;;;;;;;;;;QAiBN;QAEJ,YAAY,EAAE;;;;;;;;;;;;;;;QAeV;QAEJ,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;EAuBf;KACC;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const Input: {
|
|
2
|
+
category: string;
|
|
3
|
+
description: string;
|
|
4
|
+
props: string;
|
|
5
|
+
features: string[];
|
|
6
|
+
bestPractices: string[];
|
|
7
|
+
usage: string;
|
|
8
|
+
examples: {
|
|
9
|
+
basic: string;
|
|
10
|
+
variants: string;
|
|
11
|
+
"with-icons": string;
|
|
12
|
+
interactive: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/data/components/Input.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;;;CA2GjB,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export const Input = {
|
|
2
|
+
category: "form",
|
|
3
|
+
description: "Text input field with label, validation, and various input types",
|
|
4
|
+
props: `
|
|
5
|
+
- \`label\`: string - Input label text
|
|
6
|
+
- \`value\`: string - Current input value
|
|
7
|
+
- \`onChangeText\`: (text: string) => void - Text change handler
|
|
8
|
+
- \`placeholder\`: string - Placeholder text
|
|
9
|
+
- \`error\`: string - Error message to display
|
|
10
|
+
- \`helperText\`: string - Helper text below input
|
|
11
|
+
- \`disabled\`: boolean - Disable input
|
|
12
|
+
- \`multiline\`: boolean - Allow multiple lines
|
|
13
|
+
- \`secureTextEntry\`: boolean - Hide input (for passwords)
|
|
14
|
+
- \`autoFocus\`: boolean - Focus input on mount
|
|
15
|
+
`,
|
|
16
|
+
features: [
|
|
17
|
+
"Label and placeholder support",
|
|
18
|
+
"Error and helper text states",
|
|
19
|
+
"Multiline text area mode",
|
|
20
|
+
"Secure text entry for passwords",
|
|
21
|
+
"Disabled state",
|
|
22
|
+
"Auto-focus capability",
|
|
23
|
+
],
|
|
24
|
+
bestPractices: [
|
|
25
|
+
"Always provide a label for accessibility",
|
|
26
|
+
"Use helperText to guide users",
|
|
27
|
+
"Show error messages inline",
|
|
28
|
+
"Use secureTextEntry for password fields",
|
|
29
|
+
],
|
|
30
|
+
usage: `
|
|
31
|
+
import { Input } from '@idealyst/components';
|
|
32
|
+
import { useState } from 'react';
|
|
33
|
+
|
|
34
|
+
function Example() {
|
|
35
|
+
const [email, setEmail] = useState('');
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Input
|
|
39
|
+
label="Email"
|
|
40
|
+
value={email}
|
|
41
|
+
onChangeText={setEmail}
|
|
42
|
+
placeholder="Enter your email"
|
|
43
|
+
helperText="We'll never share your email"
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
examples: {
|
|
49
|
+
basic: `import { Input } from '@idealyst/components';
|
|
50
|
+
|
|
51
|
+
<Input
|
|
52
|
+
label="Username"
|
|
53
|
+
placeholder="Enter username"
|
|
54
|
+
/>`,
|
|
55
|
+
variants: `import { Input } from '@idealyst/components';
|
|
56
|
+
|
|
57
|
+
// With error
|
|
58
|
+
<Input
|
|
59
|
+
label="Email"
|
|
60
|
+
error="Invalid email address"
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
// Disabled
|
|
64
|
+
<Input
|
|
65
|
+
label="Locked Field"
|
|
66
|
+
disabled
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
// Multiline
|
|
70
|
+
<Input
|
|
71
|
+
label="Description"
|
|
72
|
+
multiline
|
|
73
|
+
/>`,
|
|
74
|
+
"with-icons": `import { Input } from '@idealyst/components';
|
|
75
|
+
|
|
76
|
+
// Password input
|
|
77
|
+
<Input
|
|
78
|
+
label="Password"
|
|
79
|
+
secureTextEntry
|
|
80
|
+
placeholder="Enter password"
|
|
81
|
+
/>`,
|
|
82
|
+
interactive: `import { Input } from '@idealyst/components';
|
|
83
|
+
import { useState } from 'react';
|
|
84
|
+
|
|
85
|
+
function Example() {
|
|
86
|
+
const [value, setValue] = useState('');
|
|
87
|
+
const [error, setError] = useState('');
|
|
88
|
+
|
|
89
|
+
const validate = (text: string) => {
|
|
90
|
+
setValue(text);
|
|
91
|
+
if (text.length < 3) {
|
|
92
|
+
setError('Must be at least 3 characters');
|
|
93
|
+
} else {
|
|
94
|
+
setError('');
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Input
|
|
100
|
+
label="Username"
|
|
101
|
+
value={value}
|
|
102
|
+
onChangeText={validate}
|
|
103
|
+
error={error}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
}`,
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/data/components/Input.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACrB,QAAQ,EAAE,MAAM;IACZ,WAAW,EAAE,kEAAkE;IAC/E,KAAK,EAAE;;;;;;;;;;;CAWV;IACG,QAAQ,EAAE;QACR,+BAA+B;QAC/B,8BAA8B;QAC9B,0BAA0B;QAC1B,iCAAiC;QACjC,gBAAgB;QAChB,uBAAuB;KACxB;IACD,aAAa,EAAE;QACb,0CAA0C;QAC1C,+BAA+B;QAC/B,4BAA4B;QAC5B,yCAAyC;KAC1C;IACD,KAAK,EAAE;;;;;;;;;;;;;;;;;CAiBV;IACG,QAAQ,EAAE;QACR,KAAK,EAAE;;;;;GAKV;QACG,QAAQ,EAAE;;;;;;;;;;;;;;;;;;GAkBb;QACG,YAAY,EAAE;;;;;;;GAOjB;QACG,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;EAwBjB;KACG;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const List: {
|
|
2
|
+
category: string;
|
|
3
|
+
description: string;
|
|
4
|
+
props: string;
|
|
5
|
+
features: string[];
|
|
6
|
+
bestPractices: string[];
|
|
7
|
+
usage: string;
|
|
8
|
+
examples: {
|
|
9
|
+
basic: string;
|
|
10
|
+
variants: string;
|
|
11
|
+
"with-icons": string;
|
|
12
|
+
interactive: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/data/components/List.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;CA+GhB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export const List = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Vertical list container with support for sections, icons, and interactive items",
|
|
4
|
+
props: `
|
|
5
|
+
List Props:
|
|
6
|
+
- \`variant\`: 'default' | 'bordered' | 'divided' - Visual style
|
|
7
|
+
- \`size\`: 'small' | 'medium' | 'large' - Item size
|
|
8
|
+
- \`children\`: ListItem | ListSection - List content
|
|
9
|
+
|
|
10
|
+
ListItem Props:
|
|
11
|
+
- \`label\`: string - Item label text
|
|
12
|
+
- \`leading\`: string | ReactNode - Leading icon or element
|
|
13
|
+
- \`trailing\`: string | ReactNode - Trailing icon or element
|
|
14
|
+
- \`selected\`: boolean - Selected state
|
|
15
|
+
- \`active\`: boolean - Active state
|
|
16
|
+
- \`disabled\`: boolean - Disabled state
|
|
17
|
+
- \`indent\`: number - Indentation level
|
|
18
|
+
- \`onPress\`: () => void - Press handler
|
|
19
|
+
`,
|
|
20
|
+
features: [
|
|
21
|
+
"Three visual variants",
|
|
22
|
+
"Configurable item sizes",
|
|
23
|
+
"Leading and trailing elements (icons, badges, etc.)",
|
|
24
|
+
"Selected and active states",
|
|
25
|
+
"Section grouping with titles",
|
|
26
|
+
"Indentation for hierarchy",
|
|
27
|
+
"Icon support via string names",
|
|
28
|
+
],
|
|
29
|
+
bestPractices: [
|
|
30
|
+
"Use sections to organize related items",
|
|
31
|
+
"Use leading icons for visual categorization",
|
|
32
|
+
"Use trailing elements for metadata or actions",
|
|
33
|
+
"Keep list items concise and scannable",
|
|
34
|
+
],
|
|
35
|
+
usage: `
|
|
36
|
+
import { List, ListItem, ListSection } from '@idealyst/components';
|
|
37
|
+
|
|
38
|
+
<List variant="bordered">
|
|
39
|
+
<ListSection title="Main">
|
|
40
|
+
<ListItem
|
|
41
|
+
label="Dashboard"
|
|
42
|
+
leading="home"
|
|
43
|
+
onPress={() => navigate('/dashboard')}
|
|
44
|
+
/>
|
|
45
|
+
<ListItem
|
|
46
|
+
label="Settings"
|
|
47
|
+
leading="cog"
|
|
48
|
+
onPress={() => navigate('/settings')}
|
|
49
|
+
/>
|
|
50
|
+
</ListSection>
|
|
51
|
+
</List>
|
|
52
|
+
`,
|
|
53
|
+
examples: {
|
|
54
|
+
basic: `import { List, ListItem } from '@idealyst/components';
|
|
55
|
+
|
|
56
|
+
<List variant="divided">
|
|
57
|
+
<ListItem label="Item 1" />
|
|
58
|
+
<ListItem label="Item 2" />
|
|
59
|
+
<ListItem label="Item 3" />
|
|
60
|
+
</List>`,
|
|
61
|
+
variants: `import { List, ListItem } from '@idealyst/components';
|
|
62
|
+
|
|
63
|
+
<List variant="default">
|
|
64
|
+
<ListItem label="Default" />
|
|
65
|
+
</List>
|
|
66
|
+
|
|
67
|
+
<List variant="bordered">
|
|
68
|
+
<ListItem label="Bordered" />
|
|
69
|
+
</List>
|
|
70
|
+
|
|
71
|
+
<List variant="divided">
|
|
72
|
+
<ListItem label="Divided" />
|
|
73
|
+
</List>`,
|
|
74
|
+
"with-icons": `import { List, ListItem, Badge } from '@idealyst/components';
|
|
75
|
+
|
|
76
|
+
<List variant="bordered">
|
|
77
|
+
<ListItem
|
|
78
|
+
label="Notifications"
|
|
79
|
+
leading="bell"
|
|
80
|
+
trailing={<Badge>3</Badge>}
|
|
81
|
+
/>
|
|
82
|
+
<ListItem
|
|
83
|
+
label="Messages"
|
|
84
|
+
leading="email"
|
|
85
|
+
trailing={<Badge>12</Badge>}
|
|
86
|
+
/>
|
|
87
|
+
</List>`,
|
|
88
|
+
interactive: `import { List, ListItem } from '@idealyst/components';
|
|
89
|
+
import { useState } from 'react';
|
|
90
|
+
|
|
91
|
+
function Example() {
|
|
92
|
+
const [selected, setSelected] = useState('home');
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<List variant="bordered">
|
|
96
|
+
<ListItem
|
|
97
|
+
label="Home"
|
|
98
|
+
leading="home"
|
|
99
|
+
selected={selected === 'home'}
|
|
100
|
+
onPress={() => setSelected('home')}
|
|
101
|
+
/>
|
|
102
|
+
<ListItem
|
|
103
|
+
label="Profile"
|
|
104
|
+
leading="account"
|
|
105
|
+
selected={selected === 'profile'}
|
|
106
|
+
onPress={() => setSelected('profile')}
|
|
107
|
+
/>
|
|
108
|
+
</List>
|
|
109
|
+
);
|
|
110
|
+
}`,
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/data/components/List.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;IACpB,QAAQ,EAAE,SAAS;IACf,WAAW,EAAE,iFAAiF;IAC9F,KAAK,EAAE;;;;;;;;;;;;;;;CAeV;IACG,QAAQ,EAAE;QACR,uBAAuB;QACvB,yBAAyB;QACzB,qDAAqD;QACrD,4BAA4B;QAC5B,8BAA8B;QAC9B,2BAA2B;QAC3B,+BAA+B;KAChC;IACD,aAAa,EAAE;QACb,wCAAwC;QACxC,6CAA6C;QAC7C,+CAA+C;QAC/C,uCAAuC;KACxC;IACD,KAAK,EAAE;;;;;;;;;;;;;;;;;CAiBV;IACG,QAAQ,EAAE;QACR,KAAK,EAAE;;;;;;QAML;QACF,QAAQ,EAAE;;;;;;;;;;;;QAYR;QACF,YAAY,EAAE;;;;;;;;;;;;;QAaZ;QACF,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBjB;KACG;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const Menu: {
|
|
2
|
+
category: string;
|
|
3
|
+
description: string;
|
|
4
|
+
props: string;
|
|
5
|
+
features: string[];
|
|
6
|
+
bestPractices: string[];
|
|
7
|
+
usage: string;
|
|
8
|
+
examples: {
|
|
9
|
+
basic: string;
|
|
10
|
+
variants: string;
|
|
11
|
+
"with-icons": string;
|
|
12
|
+
interactive: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/data/components/Menu.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAqIhB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export const Menu = {
|
|
2
|
+
category: "overlay",
|
|
3
|
+
description: "Contextual menu with list of actions, typically triggered by a button or other element",
|
|
4
|
+
props: `
|
|
5
|
+
- \`items\`: MenuItem[] - Array of menu items
|
|
6
|
+
- \`id\`: string - Unique identifier
|
|
7
|
+
- \`label\`: string - Menu item label
|
|
8
|
+
- \`onClick\`: () => void - Click handler
|
|
9
|
+
- \`disabled\`: boolean - Whether item is disabled
|
|
10
|
+
- \`icon\`: IconName | ReactNode - Icon (string name or custom element)
|
|
11
|
+
- \`intent\`: 'primary' | 'neutral' | 'success' | 'error' | 'warning' - Color scheme
|
|
12
|
+
- \`separator\`: boolean - Show separator after this item
|
|
13
|
+
- \`open\`: boolean - Whether menu is open
|
|
14
|
+
- \`onOpenChange\`: (open: boolean) => void - Open state change handler
|
|
15
|
+
- \`anchor\`: React.RefObject<HTMLElement> - Anchor element to position menu
|
|
16
|
+
- \`placement\`: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right' - Menu placement
|
|
17
|
+
- \`closeOnSelection\`: boolean - Close menu when item selected (default: true)
|
|
18
|
+
- \`size\`: 'small' | 'medium' | 'large' - Menu item size
|
|
19
|
+
- \`style\`: ViewStyle - Additional custom styles
|
|
20
|
+
- \`testID\`: string - Test identifier
|
|
21
|
+
`,
|
|
22
|
+
features: [
|
|
23
|
+
"Icon support for menu items",
|
|
24
|
+
"Intent colors for items",
|
|
25
|
+
"Separators between items",
|
|
26
|
+
"Disabled items",
|
|
27
|
+
"Multiple placement options",
|
|
28
|
+
"Auto-close on selection",
|
|
29
|
+
"Three size options",
|
|
30
|
+
],
|
|
31
|
+
bestPractices: [
|
|
32
|
+
"Use separators to group related actions",
|
|
33
|
+
"Place destructive actions at the bottom with error intent",
|
|
34
|
+
"Keep menu items concise (1-3 words)",
|
|
35
|
+
"Use icons for visual scanning",
|
|
36
|
+
"Close menu after action unless multi-select",
|
|
37
|
+
],
|
|
38
|
+
usage: `
|
|
39
|
+
import { Menu, Button } from '@idealyst/components';
|
|
40
|
+
import { useState, useRef } from 'react';
|
|
41
|
+
|
|
42
|
+
function Example() {
|
|
43
|
+
const [open, setOpen] = useState(false);
|
|
44
|
+
const buttonRef = useRef(null);
|
|
45
|
+
|
|
46
|
+
const items = [
|
|
47
|
+
{ id: '1', label: 'Edit', icon: 'pencil', onClick: () => handleEdit() },
|
|
48
|
+
{ id: '2', label: 'Duplicate', icon: 'content-copy', onClick: () => handleDuplicate() },
|
|
49
|
+
{ id: '3', label: 'Delete', icon: 'delete', intent: 'error', onClick: () => handleDelete(), separator: true },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<div ref={buttonRef}>
|
|
55
|
+
<Button onPress={() => setOpen(true)}>Actions</Button>
|
|
56
|
+
</div>
|
|
57
|
+
<Menu
|
|
58
|
+
items={items}
|
|
59
|
+
open={open}
|
|
60
|
+
onOpenChange={setOpen}
|
|
61
|
+
anchor={buttonRef}
|
|
62
|
+
placement="bottom-start"
|
|
63
|
+
/>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
`,
|
|
68
|
+
examples: {
|
|
69
|
+
basic: `import { Menu, Button } from '@idealyst/components';
|
|
70
|
+
import { useRef, useState } from 'react';
|
|
71
|
+
|
|
72
|
+
const buttonRef = useRef(null);
|
|
73
|
+
const [open, setOpen] = useState(false);
|
|
74
|
+
|
|
75
|
+
const items = [
|
|
76
|
+
{ id: '1', label: 'Option 1', onClick: () => console.log('1') },
|
|
77
|
+
{ id: '2', label: 'Option 2', onClick: () => console.log('2') },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
<div ref={buttonRef}>
|
|
81
|
+
<Button onPress={() => setOpen(true)}>Menu</Button>
|
|
82
|
+
</div>
|
|
83
|
+
<Menu items={items} open={open} onOpenChange={setOpen} anchor={buttonRef} />`,
|
|
84
|
+
variants: `import { Menu } from '@idealyst/components';
|
|
85
|
+
|
|
86
|
+
// Different sizes
|
|
87
|
+
<Menu items={items} open={open} onOpenChange={setOpen} anchor={ref} size="small" />
|
|
88
|
+
<Menu items={items} open={open} onOpenChange={setOpen} anchor={ref} size="medium" />
|
|
89
|
+
<Menu items={items} open={open} onOpenChange={setOpen} anchor={ref} size="large" />`,
|
|
90
|
+
"with-icons": `import { Menu, Button } from '@idealyst/components';
|
|
91
|
+
import { useRef, useState } from 'react';
|
|
92
|
+
|
|
93
|
+
const items = [
|
|
94
|
+
{ id: '1', label: 'Profile', icon: 'account', onClick: () => navigate('/profile') },
|
|
95
|
+
{ id: '2', label: 'Settings', icon: 'cog', onClick: () => navigate('/settings') },
|
|
96
|
+
{ id: '3', label: 'Logout', icon: 'logout', intent: 'error', onClick: () => logout(), separator: true },
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
<Menu items={items} open={open} onOpenChange={setOpen} anchor={buttonRef} />`,
|
|
100
|
+
interactive: `import { Menu, Button, Text, View } from '@idealyst/components';
|
|
101
|
+
import { useRef, useState } from 'react';
|
|
102
|
+
|
|
103
|
+
function Example() {
|
|
104
|
+
const [open, setOpen] = useState(false);
|
|
105
|
+
const [selected, setSelected] = useState('');
|
|
106
|
+
const buttonRef = useRef(null);
|
|
107
|
+
|
|
108
|
+
const items = [
|
|
109
|
+
{ id: 'edit', label: 'Edit', icon: 'pencil', onClick: () => setSelected('edit') },
|
|
110
|
+
{ id: 'share', label: 'Share', icon: 'share', onClick: () => setSelected('share') },
|
|
111
|
+
{ id: 'delete', label: 'Delete', icon: 'delete', intent: 'error', onClick: () => setSelected('delete') },
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<View spacing="md">
|
|
116
|
+
<div ref={buttonRef}>
|
|
117
|
+
<Button onPress={() => setOpen(true)}>Actions</Button>
|
|
118
|
+
</div>
|
|
119
|
+
<Menu
|
|
120
|
+
items={items}
|
|
121
|
+
open={open}
|
|
122
|
+
onOpenChange={setOpen}
|
|
123
|
+
anchor={buttonRef}
|
|
124
|
+
placement="bottom-start"
|
|
125
|
+
/>
|
|
126
|
+
{selected && <Text>Selected: {selected}</Text>}
|
|
127
|
+
</View>
|
|
128
|
+
);
|
|
129
|
+
}`,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/data/components/Menu.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,wFAAwF;IACrG,KAAK,EAAE;;;;;;;;;;;;;;;;;CAiBR;IACC,QAAQ,EAAE;QACR,6BAA6B;QAC7B,yBAAyB;QACzB,0BAA0B;QAC1B,gBAAgB;QAChB,4BAA4B;QAC5B,yBAAyB;QACzB,oBAAoB;KACrB;IACD,aAAa,EAAE;QACb,yCAAyC;QACzC,2DAA2D;QAC3D,qCAAqC;QACrC,+BAA+B;QAC/B,6CAA6C;KAC9C;IACD,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BR;IACC,QAAQ,EAAE;QACR,KAAK,EAAE;;;;;;;;;;;;;;6EAckE;QAEzE,QAAQ,EAAE;;;;;oFAKsE;QAEhF,YAAY,EAAE;;;;;;;;;6EAS2D;QAEzE,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6Bf;KACC;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const Popover: {
|
|
2
|
+
category: string;
|
|
3
|
+
description: string;
|
|
4
|
+
props: string;
|
|
5
|
+
features: string[];
|
|
6
|
+
bestPractices: string[];
|
|
7
|
+
usage: string;
|
|
8
|
+
examples: {
|
|
9
|
+
basic: string;
|
|
10
|
+
variants: string;
|
|
11
|
+
"with-icons": string;
|
|
12
|
+
interactive: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/data/components/Popover.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;;CAgKnB,CAAC"}
|