@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,67 @@
|
|
|
1
|
+
export const Card = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Container component for grouping related content with various visual styles",
|
|
4
|
+
props: `
|
|
5
|
+
- \`children\`: React.ReactNode - The content to display inside the card
|
|
6
|
+
- \`type\`: CardType - The visual style variant of the card
|
|
7
|
+
- \`padding\`: CardPaddingVariant - The padding size inside the card
|
|
8
|
+
- \`radius\`: CardRadiusVariant - The border radius of the card
|
|
9
|
+
- \`intent\`: CardIntentVariant - The intent/color scheme of the card
|
|
10
|
+
- \`clickable\`: boolean - Whether the card is clickable
|
|
11
|
+
- \`onPress\`: function - Called when the card is pressed (if clickable)
|
|
12
|
+
- \`disabled\`: boolean - Whether the card is disabled
|
|
13
|
+
`,
|
|
14
|
+
features: [
|
|
15
|
+
"Four visual variants",
|
|
16
|
+
"Intent-based color schemes",
|
|
17
|
+
"Configurable padding and border radius",
|
|
18
|
+
"Clickable with press handler",
|
|
19
|
+
"Flexible content container",
|
|
20
|
+
],
|
|
21
|
+
bestPractices: [
|
|
22
|
+
"Use 'elevated' variant for prominent content",
|
|
23
|
+
"Group related content within cards",
|
|
24
|
+
"Use appropriate padding for content density",
|
|
25
|
+
"Make cards clickable only when they represent an action",
|
|
26
|
+
],
|
|
27
|
+
usage: `
|
|
28
|
+
import { Card, Text, View } from '@idealyst/components';
|
|
29
|
+
|
|
30
|
+
<Card type="elevated" padding="md">
|
|
31
|
+
<View spacing="sm">
|
|
32
|
+
<Text weight="bold">Card Title</Text>
|
|
33
|
+
<Text size="sm">Card content goes here</Text>
|
|
34
|
+
</View>
|
|
35
|
+
</Card>
|
|
36
|
+
`,
|
|
37
|
+
examples: {
|
|
38
|
+
basic: `import { Card, Text } from '@idealyst/components';
|
|
39
|
+
|
|
40
|
+
<Card>
|
|
41
|
+
<Text>Simple card content</Text>
|
|
42
|
+
</Card>`,
|
|
43
|
+
variants: `import { Card, Text } from '@idealyst/components';
|
|
44
|
+
|
|
45
|
+
<Card type="default"><Text>Default</Text></Card>
|
|
46
|
+
<Card type="outlined"><Text>Outlined</Text></Card>
|
|
47
|
+
<Card type="elevated"><Text>Elevated</Text></Card>
|
|
48
|
+
<Card type="filled"><Text>Filled</Text></Card>`,
|
|
49
|
+
"with-icons": `import { Card, View, Text, Icon } from '@idealyst/components';
|
|
50
|
+
|
|
51
|
+
<Card type="outlined">
|
|
52
|
+
<View spacing="sm">
|
|
53
|
+
<Icon name="information" size="lg" />
|
|
54
|
+
<Text>Card with icon header</Text>
|
|
55
|
+
</View>
|
|
56
|
+
</Card>`,
|
|
57
|
+
interactive: `import { Card, Text } from '@idealyst/components';
|
|
58
|
+
|
|
59
|
+
<Card
|
|
60
|
+
clickable
|
|
61
|
+
onPress={() => console.log('Card clicked')}
|
|
62
|
+
type="outlined"
|
|
63
|
+
>
|
|
64
|
+
<Text>Click this card</Text>
|
|
65
|
+
</Card>`,
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export const Checkbox = {
|
|
2
|
+
category: "form",
|
|
3
|
+
description: "Form checkbox for boolean selection with label and validation support",
|
|
4
|
+
props: `
|
|
5
|
+
- \`checked\`: boolean - Whether the checkbox is checked
|
|
6
|
+
- \`indeterminate\`: boolean - Whether the checkbox is in an indeterminate state
|
|
7
|
+
- \`disabled\`: boolean - Whether the checkbox is disabled
|
|
8
|
+
- \`onCheckedChange\`: function - Called when the checkbox state changes
|
|
9
|
+
- \`size\`: CheckboxSizeVariant - The size of the checkbox
|
|
10
|
+
- \`intent\`: CheckboxIntentVariant - The intent/color scheme of the checkbox
|
|
11
|
+
- \`variant\`: CheckboxVariant - The visual style variant of the checkbox
|
|
12
|
+
- \`label\`: string - Label text to display next to the checkbox
|
|
13
|
+
- \`children\`: React.ReactNode - Custom label content (ReactNode)
|
|
14
|
+
- \`required\`: boolean - Whether the checkbox is required
|
|
15
|
+
- \`error\`: string - Error message to display
|
|
16
|
+
- \`helperText\`: string - Helper text to display
|
|
17
|
+
`,
|
|
18
|
+
features: [
|
|
19
|
+
"Checked, unchecked, and indeterminate states",
|
|
20
|
+
"Label support (string or custom ReactNode)",
|
|
21
|
+
"Three sizes",
|
|
22
|
+
"Intent-based colors",
|
|
23
|
+
"Error and helper text",
|
|
24
|
+
"Required field support",
|
|
25
|
+
"Accessible with proper ARIA attributes",
|
|
26
|
+
],
|
|
27
|
+
bestPractices: [
|
|
28
|
+
"Always provide a label for accessibility",
|
|
29
|
+
"Use indeterminate state for parent checkboxes with partial children selection",
|
|
30
|
+
"Show error messages inline",
|
|
31
|
+
"Use helperText to clarify checkbox meaning",
|
|
32
|
+
"Group related checkboxes visually",
|
|
33
|
+
],
|
|
34
|
+
usage: `
|
|
35
|
+
import { Checkbox } from '@idealyst/components';
|
|
36
|
+
import { useState } from 'react';
|
|
37
|
+
|
|
38
|
+
function Example() {
|
|
39
|
+
const [checked, setChecked] = useState(false);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Checkbox
|
|
43
|
+
checked={checked}
|
|
44
|
+
onCheckedChange={setChecked}
|
|
45
|
+
label="Accept terms and conditions"
|
|
46
|
+
required
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
examples: {
|
|
52
|
+
basic: `import { Checkbox } from '@idealyst/components';
|
|
53
|
+
|
|
54
|
+
<Checkbox label="Subscribe to newsletter" />`,
|
|
55
|
+
|
|
56
|
+
variants: `import { Checkbox, View } from '@idealyst/components';
|
|
57
|
+
|
|
58
|
+
<View spacing="sm">
|
|
59
|
+
<Checkbox label="Small" size="sm" />
|
|
60
|
+
<Checkbox label="Medium" size="md" />
|
|
61
|
+
<Checkbox label="Large" size="lg" />
|
|
62
|
+
</View>`,
|
|
63
|
+
|
|
64
|
+
"with-icons": `import { Checkbox, View } from '@idealyst/components';
|
|
65
|
+
|
|
66
|
+
<View spacing="sm">
|
|
67
|
+
<Checkbox
|
|
68
|
+
label="Enable notifications"
|
|
69
|
+
intent="primary"
|
|
70
|
+
checked
|
|
71
|
+
/>
|
|
72
|
+
<Checkbox
|
|
73
|
+
label="Dark mode"
|
|
74
|
+
intent="success"
|
|
75
|
+
checked
|
|
76
|
+
/>
|
|
77
|
+
</View>`,
|
|
78
|
+
|
|
79
|
+
interactive: `import { Checkbox, View, Text } from '@idealyst/components';
|
|
80
|
+
import { useState } from 'react';
|
|
81
|
+
|
|
82
|
+
function Example() {
|
|
83
|
+
const [options, setOptions] = useState({
|
|
84
|
+
email: false,
|
|
85
|
+
sms: false,
|
|
86
|
+
push: false,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<View spacing="md">
|
|
91
|
+
<Text weight="bold">Notification Preferences</Text>
|
|
92
|
+
<Checkbox
|
|
93
|
+
label="Email notifications"
|
|
94
|
+
checked={options.email}
|
|
95
|
+
onCheckedChange={(checked) =>
|
|
96
|
+
setOptions({ ...options, email: checked })
|
|
97
|
+
}
|
|
98
|
+
/>
|
|
99
|
+
<Checkbox
|
|
100
|
+
label="SMS notifications"
|
|
101
|
+
checked={options.sms}
|
|
102
|
+
onCheckedChange={(checked) =>
|
|
103
|
+
setOptions({ ...options, sms: checked })
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
<Checkbox
|
|
107
|
+
label="Push notifications"
|
|
108
|
+
checked={options.push}
|
|
109
|
+
onCheckedChange={(checked) =>
|
|
110
|
+
setOptions({ ...options, push: checked })
|
|
111
|
+
}
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
}`,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const Chip = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Compact element for tags, filters, and selections with optional delete action",
|
|
4
|
+
props: `
|
|
5
|
+
- \`label\`: string - The text content of the chip
|
|
6
|
+
- \`type\`: ChipType - Visual style variant
|
|
7
|
+
- \`intent\`: ChipIntent - Color intent/semantic meaning
|
|
8
|
+
- \`size\`: ChipSize - Size of the chip
|
|
9
|
+
- \`icon\`: IconName | React.ReactNode - Icon to display before the label. Can be an icon name (string) or a custom React element
|
|
10
|
+
- \`deletable\`: boolean - Whether the chip can be deleted
|
|
11
|
+
- \`onDelete\`: function - Callback when delete button is pressed
|
|
12
|
+
- \`deleteIcon\`: IconName | React.ReactNode - Icon to display in the delete button. Defaults to 'close'
|
|
13
|
+
- \`selectable\`: boolean - Whether the chip is selectable
|
|
14
|
+
- \`selected\`: boolean - Whether the chip is selected (when selectable)
|
|
15
|
+
- \`onPress\`: function - Callback when chip is pressed
|
|
16
|
+
- \`disabled\`: boolean - Whether the chip is disabled
|
|
17
|
+
`,
|
|
18
|
+
features: [
|
|
19
|
+
"Three variants: filled, outlined, soft",
|
|
20
|
+
"Five intent colors",
|
|
21
|
+
"Icon support with MDI icons",
|
|
22
|
+
"Deletable with onDelete handler",
|
|
23
|
+
"Customizable delete icon (defaults to MDI 'close')",
|
|
24
|
+
"Selectable with selected state",
|
|
25
|
+
"Three sizes",
|
|
26
|
+
"Disabled state",
|
|
27
|
+
],
|
|
28
|
+
bestPractices: [
|
|
29
|
+
"Use for tags, filters, and multi-select options",
|
|
30
|
+
"Use deletable chips for removable tags",
|
|
31
|
+
"Use selectable chips for filter options",
|
|
32
|
+
"Keep chip labels concise",
|
|
33
|
+
],
|
|
34
|
+
usage: `
|
|
35
|
+
import { Chip } from '@idealyst/components';
|
|
36
|
+
|
|
37
|
+
<Chip
|
|
38
|
+
label="React"
|
|
39
|
+
icon="check"
|
|
40
|
+
deletable
|
|
41
|
+
onDelete={() => removeTag('React')}
|
|
42
|
+
/>
|
|
43
|
+
`,
|
|
44
|
+
examples: {
|
|
45
|
+
basic: `import { Chip } from '@idealyst/components';
|
|
46
|
+
|
|
47
|
+
<Chip label="Tag" />`,
|
|
48
|
+
variants: `import { Chip } from '@idealyst/components';
|
|
49
|
+
|
|
50
|
+
<Chip label="Filled" type="filled" intent="primary" />
|
|
51
|
+
<Chip label="Outlined" type="outlined" intent="success" />
|
|
52
|
+
<Chip label="Soft" type="soft" intent="warning" />`,
|
|
53
|
+
"with-icons": `import { Chip } from '@idealyst/components';
|
|
54
|
+
|
|
55
|
+
<Chip label="Star" icon="star" />
|
|
56
|
+
<Chip label="Heart" icon="heart" intent="error" />
|
|
57
|
+
|
|
58
|
+
// Custom delete icon
|
|
59
|
+
<Chip
|
|
60
|
+
label="Custom Delete"
|
|
61
|
+
deletable
|
|
62
|
+
deleteIcon="close-circle"
|
|
63
|
+
onDelete={() => console.log('deleted')}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
// Alternative delete icons
|
|
67
|
+
<Chip
|
|
68
|
+
label="Remove"
|
|
69
|
+
deletable
|
|
70
|
+
deleteIcon="delete"
|
|
71
|
+
onDelete={() => console.log('deleted')}
|
|
72
|
+
/>`,
|
|
73
|
+
interactive: `import { Chip, View } from '@idealyst/components';
|
|
74
|
+
import { useState } from 'react';
|
|
75
|
+
|
|
76
|
+
function Example() {
|
|
77
|
+
const [tags, setTags] = useState(['React', 'TypeScript', 'Node.js']);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<View spacing="sm">
|
|
81
|
+
{tags.map(tag => (
|
|
82
|
+
<Chip
|
|
83
|
+
key={tag}
|
|
84
|
+
label={tag}
|
|
85
|
+
deletable
|
|
86
|
+
onDelete={() => setTags(tags.filter(t => t !== tag))}
|
|
87
|
+
/>
|
|
88
|
+
))}
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
}`,
|
|
92
|
+
}
|
|
93
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export const Dialog = {
|
|
2
|
+
category: "overlay",
|
|
3
|
+
description: "Modal overlay for focused user interactions and important information",
|
|
4
|
+
props: `
|
|
5
|
+
- \`open\`: boolean - Whether the dialog is open/visible
|
|
6
|
+
- \`onOpenChange\`: function - Called when the dialog should be opened or closed
|
|
7
|
+
- \`title\`: string - Optional title for the dialog
|
|
8
|
+
- \`children\`: React.ReactNode - The content to display inside the dialog
|
|
9
|
+
- \`size\`: DialogSizeVariant - The size of the dialog
|
|
10
|
+
- \`showCloseButton\`: boolean - The visual style variant of the dialog Whether to show the close button in the header
|
|
11
|
+
- \`closeOnBackdropClick\`: boolean - Whether clicking the backdrop should close the dialog
|
|
12
|
+
- \`closeOnEscapeKey\`: boolean - Whether pressing escape key should close the dialog (web only)
|
|
13
|
+
- \`animationType\`: DialogAnimationType - Animation type for the dialog (native only)
|
|
14
|
+
`,
|
|
15
|
+
features: [
|
|
16
|
+
"Controlled open state",
|
|
17
|
+
"Multiple sizes including fullscreen",
|
|
18
|
+
"Alert variant for important messages",
|
|
19
|
+
"Optional close button",
|
|
20
|
+
"Backdrop click and Escape key handling",
|
|
21
|
+
"Focus trap and accessibility support",
|
|
22
|
+
],
|
|
23
|
+
bestPractices: [
|
|
24
|
+
"Use for actions requiring user attention",
|
|
25
|
+
"Keep dialog content focused and concise",
|
|
26
|
+
"Provide clear action buttons",
|
|
27
|
+
"Use alert variant for critical confirmations",
|
|
28
|
+
"Always provide a way to close the dialog",
|
|
29
|
+
],
|
|
30
|
+
usage: `
|
|
31
|
+
import { Dialog, Button, View, Text } from '@idealyst/components';
|
|
32
|
+
import { useState } from 'react';
|
|
33
|
+
|
|
34
|
+
function Example() {
|
|
35
|
+
const [open, setOpen] = useState(false);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<Button onPress={() => setOpen(true)}>
|
|
40
|
+
Open Dialog
|
|
41
|
+
</Button>
|
|
42
|
+
|
|
43
|
+
<Dialog
|
|
44
|
+
open={open}
|
|
45
|
+
onOpenChange={setOpen}
|
|
46
|
+
title="Confirm Action"
|
|
47
|
+
size="md"
|
|
48
|
+
>
|
|
49
|
+
<View spacing="md">
|
|
50
|
+
<Text>Are you sure you want to proceed?</Text>
|
|
51
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
52
|
+
<Button type="outlined" onPress={() => setOpen(false)}>
|
|
53
|
+
Cancel
|
|
54
|
+
</Button>
|
|
55
|
+
<Button onPress={() => { handleConfirm(); setOpen(false); }}>
|
|
56
|
+
Confirm
|
|
57
|
+
</Button>
|
|
58
|
+
</View>
|
|
59
|
+
</View>
|
|
60
|
+
</Dialog>
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
examples: {
|
|
66
|
+
basic: `import { Dialog, Button, Text } from '@idealyst/components';
|
|
67
|
+
|
|
68
|
+
<Dialog open={true} onOpenChange={setOpen} title="Simple Dialog">
|
|
69
|
+
<Text>Dialog content here</Text>
|
|
70
|
+
</Dialog>`,
|
|
71
|
+
variants: `import { Dialog, Text } from '@idealyst/components';
|
|
72
|
+
|
|
73
|
+
// Default dialog
|
|
74
|
+
<Dialog open={open} onOpenChange={setOpen} title="Information">
|
|
75
|
+
<Text>Information content</Text>
|
|
76
|
+
</Dialog>
|
|
77
|
+
|
|
78
|
+
// Alert dialog
|
|
79
|
+
<Dialog open={open} onOpenChange={setOpen} title="Warning" type="alert">
|
|
80
|
+
<Text>This action cannot be undone</Text>
|
|
81
|
+
</Dialog>`,
|
|
82
|
+
"with-icons": `import { Dialog, View, Icon, Text, Button } from '@idealyst/components';
|
|
83
|
+
|
|
84
|
+
<Dialog open={open} onOpenChange={setOpen} title="Delete Item">
|
|
85
|
+
<View spacing="md">
|
|
86
|
+
<View style={{ alignItems: 'center' }}>
|
|
87
|
+
<Icon name="delete" size="xl" color="error" />
|
|
88
|
+
</View>
|
|
89
|
+
<Text>This action cannot be undone. Continue?</Text>
|
|
90
|
+
<Button intent="error" onPress={handleDelete}>Delete</Button>
|
|
91
|
+
</View>
|
|
92
|
+
</Dialog>`,
|
|
93
|
+
interactive: `import { Dialog, Button, View, Text } from '@idealyst/components';
|
|
94
|
+
import { useState } from 'react';
|
|
95
|
+
|
|
96
|
+
function Example() {
|
|
97
|
+
const [open, setOpen] = useState(false);
|
|
98
|
+
const [confirmed, setConfirmed] = useState(false);
|
|
99
|
+
|
|
100
|
+
const handleConfirm = () => {
|
|
101
|
+
setConfirmed(true);
|
|
102
|
+
setOpen(false);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<View spacing="md">
|
|
107
|
+
<Button onPress={() => setOpen(true)}>
|
|
108
|
+
Open Dialog
|
|
109
|
+
</Button>
|
|
110
|
+
|
|
111
|
+
{confirmed && <Text>Action confirmed!</Text>}
|
|
112
|
+
|
|
113
|
+
<Dialog
|
|
114
|
+
open={open}
|
|
115
|
+
onOpenChange={setOpen}
|
|
116
|
+
title="Confirm Action"
|
|
117
|
+
closeOnBackdropClick
|
|
118
|
+
closeOnEscapeKey
|
|
119
|
+
>
|
|
120
|
+
<View spacing="md">
|
|
121
|
+
<Text>Proceed with this action?</Text>
|
|
122
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
123
|
+
<Button type="outlined" onPress={() => setOpen(false)}>
|
|
124
|
+
Cancel
|
|
125
|
+
</Button>
|
|
126
|
+
<Button intent="primary" onPress={handleConfirm}>
|
|
127
|
+
Confirm
|
|
128
|
+
</Button>
|
|
129
|
+
</View>
|
|
130
|
+
</View>
|
|
131
|
+
</Dialog>
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
}`,
|
|
135
|
+
}
|
|
136
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const Divider = {
|
|
2
|
+
category: "layout",
|
|
3
|
+
description: "Visual separator for content sections with horizontal or vertical orientation",
|
|
4
|
+
props: `
|
|
5
|
+
- \`orientation\`: DividerOrientationVariant - The orientation of the divider
|
|
6
|
+
- \`type\`: DividerType - The visual style type of the divider
|
|
7
|
+
- \`thickness\`: DividerThicknessVariant - The thickness of the divider
|
|
8
|
+
- \`intent\`: DividerIntentVariant - The color intent of the divider
|
|
9
|
+
- \`length\`: DividerLengthVariant - The length of the divider (percentage or fixed)
|
|
10
|
+
- \`spacing\`: DividerSpacingVariant - Spacing around the divider
|
|
11
|
+
- \`children\`: React.ReactNode - Content to display in the center of the divider (for horizontal dividers)
|
|
12
|
+
`,
|
|
13
|
+
features: [
|
|
14
|
+
"Horizontal and vertical orientations",
|
|
15
|
+
"Three line styles (solid, dashed, dotted)",
|
|
16
|
+
"Three thickness options",
|
|
17
|
+
"Configurable spacing",
|
|
18
|
+
"Text content in center (horizontal)",
|
|
19
|
+
"Intent-based colors",
|
|
20
|
+
],
|
|
21
|
+
bestPractices: [
|
|
22
|
+
"Use horizontal dividers to separate vertical content",
|
|
23
|
+
"Use vertical dividers in horizontal layouts (toolbars, menus)",
|
|
24
|
+
"Keep divider thickness subtle unless emphasizing separation",
|
|
25
|
+
"Use 'md' spacing for standard content separation",
|
|
26
|
+
"Add text content sparingly for important section breaks",
|
|
27
|
+
],
|
|
28
|
+
usage: `
|
|
29
|
+
import { Divider, View, Text } from '@idealyst/components';
|
|
30
|
+
|
|
31
|
+
<View spacing="md">
|
|
32
|
+
<Text>Content above</Text>
|
|
33
|
+
<Divider spacing="md" />
|
|
34
|
+
<Text>Content below</Text>
|
|
35
|
+
</View>
|
|
36
|
+
`,
|
|
37
|
+
examples: {
|
|
38
|
+
basic: `import { Divider } from '@idealyst/components';
|
|
39
|
+
|
|
40
|
+
<Divider />`,
|
|
41
|
+
|
|
42
|
+
variants: `import { Divider, View } from '@idealyst/components';
|
|
43
|
+
|
|
44
|
+
<View spacing="md">
|
|
45
|
+
<Divider type="solid" />
|
|
46
|
+
<Divider type="dashed" />
|
|
47
|
+
<Divider type="dotted" />
|
|
48
|
+
</View>`,
|
|
49
|
+
|
|
50
|
+
"with-icons": `import { Divider, View, Text } from '@idealyst/components';
|
|
51
|
+
|
|
52
|
+
<View spacing="lg">
|
|
53
|
+
<Text>Section 1</Text>
|
|
54
|
+
<Divider spacing="md">
|
|
55
|
+
<Text size="sm" color="secondary">OR</Text>
|
|
56
|
+
</Divider>
|
|
57
|
+
<Text>Section 2</Text>
|
|
58
|
+
</View>`,
|
|
59
|
+
|
|
60
|
+
interactive: `import { Divider, View, Text } from '@idealyst/components';
|
|
61
|
+
|
|
62
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 16 }}>
|
|
63
|
+
<Text>Left</Text>
|
|
64
|
+
<Divider orientation="vertical" thickness="medium" style={{ height: 40 }} />
|
|
65
|
+
<Text>Center</Text>
|
|
66
|
+
<Divider orientation="vertical" thickness="medium" style={{ height: 40 }} />
|
|
67
|
+
<Text>Right</Text>
|
|
68
|
+
</View>`,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const Icon = {
|
|
2
|
+
category: "display",
|
|
3
|
+
description: "Material Design icon display component with size and color variants",
|
|
4
|
+
props: `
|
|
5
|
+
- \`name\`: IconName | `mdi:${IconName}` - The name of the icon to display
|
|
6
|
+
- \`size\`: IconSizeVariant - The size variant of the icon
|
|
7
|
+
- \`color\`: Color - Predefined color variant based on theme
|
|
8
|
+
- \`intent\`: Intent - Intent variant for the icon
|
|
9
|
+
`,
|
|
10
|
+
features: [
|
|
11
|
+
"Material Design Icons library",
|
|
12
|
+
"Five predefined sizes plus custom numeric size",
|
|
13
|
+
"Theme color variants",
|
|
14
|
+
"Custom color support",
|
|
15
|
+
"Accessible with labels",
|
|
16
|
+
"Cross-platform support",
|
|
17
|
+
],
|
|
18
|
+
bestPractices: [
|
|
19
|
+
"Use semantic icon names that clearly convey meaning",
|
|
20
|
+
"Provide accessibilityLabel for screen readers",
|
|
21
|
+
"Use theme color variants for consistency",
|
|
22
|
+
"Match icon size to surrounding text size",
|
|
23
|
+
"Don't rely solely on icons - provide text labels when possible",
|
|
24
|
+
],
|
|
25
|
+
usage: `
|
|
26
|
+
import { Icon } from '@idealyst/components';
|
|
27
|
+
|
|
28
|
+
<Icon name="home" size="md" color="primary" />
|
|
29
|
+
`,
|
|
30
|
+
examples: {
|
|
31
|
+
basic: `import { Icon } from '@idealyst/components';
|
|
32
|
+
|
|
33
|
+
<Icon name="star" size="md" />`,
|
|
34
|
+
|
|
35
|
+
variants: `import { Icon, View } from '@idealyst/components';
|
|
36
|
+
|
|
37
|
+
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
38
|
+
<Icon name="check" size="xs" />
|
|
39
|
+
<Icon name="check" size="sm" />
|
|
40
|
+
<Icon name="check" size="md" />
|
|
41
|
+
<Icon name="check" size="lg" />
|
|
42
|
+
<Icon name="check" size="xl" />
|
|
43
|
+
</View>`,
|
|
44
|
+
|
|
45
|
+
"with-icons": `import { Icon, View, Text } from '@idealyst/components';
|
|
46
|
+
|
|
47
|
+
<View spacing="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
48
|
+
<Icon name="information" size="md" color="primary" />
|
|
49
|
+
<Text>Informational message with icon</Text>
|
|
50
|
+
</View>`,
|
|
51
|
+
|
|
52
|
+
interactive: `import { Icon, Button, View } from '@idealyst/components';
|
|
53
|
+
import { useState } from 'react';
|
|
54
|
+
|
|
55
|
+
function Example() {
|
|
56
|
+
const [favorited, setFavorited] = useState(false);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Button
|
|
60
|
+
icon={favorited ? 'heart' : 'heart-outline'}
|
|
61
|
+
intent={favorited ? 'error' : 'neutral'}
|
|
62
|
+
type="text"
|
|
63
|
+
onPress={() => setFavorited(!favorited)}
|
|
64
|
+
>
|
|
65
|
+
{favorited ? 'Favorited' : 'Favorite'}
|
|
66
|
+
</Button>
|
|
67
|
+
);
|
|
68
|
+
}`,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
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 - The image source URL or source object
|
|
6
|
+
- \`alt\`: string - Alternative text for accessibility
|
|
7
|
+
- \`width\`: number | string - The width of the image
|
|
8
|
+
- \`height\`: number | string - The height of the image
|
|
9
|
+
- \`aspectRatio\`: number - The aspect ratio of the image
|
|
10
|
+
- \`objectFit\`: ImageObjectFit - How the image should be fitted (cover, contain, fill, none, scale-down)
|
|
11
|
+
- \`loading\`: 'lazy' | 'eager' - When to load the image (lazy for below the fold, eager for above)
|
|
12
|
+
- \`placeholder\`: React.ReactNode - Content to show while the image is loading
|
|
13
|
+
- \`fallback\`: React.ReactNode - Content to show if the image fails to load
|
|
14
|
+
- \`onLoad\`: function - Called when the image successfully loads
|
|
15
|
+
- \`onError\`: function - Called when the image fails to load
|
|
16
|
+
- \`borderRadius\`: number - The border radius of the image
|
|
17
|
+
`,
|
|
18
|
+
features: [
|
|
19
|
+
"Remote and local image sources",
|
|
20
|
+
"Lazy loading support (web)",
|
|
21
|
+
"Loading placeholder",
|
|
22
|
+
"Error fallback",
|
|
23
|
+
"Multiple object-fit modes",
|
|
24
|
+
"Aspect ratio control",
|
|
25
|
+
"Border radius support",
|
|
26
|
+
"Load/error callbacks",
|
|
27
|
+
],
|
|
28
|
+
bestPractices: [
|
|
29
|
+
"Always provide alt text for accessibility",
|
|
30
|
+
"Use lazy loading for images below the fold",
|
|
31
|
+
"Provide placeholder for better perceived performance",
|
|
32
|
+
"Use fallback for graceful error handling",
|
|
33
|
+
"Use objectFit: 'cover' for thumbnails",
|
|
34
|
+
"Use objectFit: 'contain' to show full image",
|
|
35
|
+
],
|
|
36
|
+
usage: `
|
|
37
|
+
import { Image, ActivityIndicator } from '@idealyst/components';
|
|
38
|
+
|
|
39
|
+
<Image
|
|
40
|
+
source="https://example.com/image.jpg"
|
|
41
|
+
alt="Product photo"
|
|
42
|
+
width={300}
|
|
43
|
+
height={200}
|
|
44
|
+
objectFit="cover"
|
|
45
|
+
borderRadius={8}
|
|
46
|
+
placeholder={<ActivityIndicator />}
|
|
47
|
+
fallback={<Text>Failed to load</Text>}
|
|
48
|
+
/>
|
|
49
|
+
`,
|
|
50
|
+
examples: {
|
|
51
|
+
basic: `import { Image } from '@idealyst/components';
|
|
52
|
+
|
|
53
|
+
<Image
|
|
54
|
+
source="https://picsum.photos/200/300"
|
|
55
|
+
alt="Random image"
|
|
56
|
+
width={200}
|
|
57
|
+
height={300}
|
|
58
|
+
/>`,
|
|
59
|
+
|
|
60
|
+
variants: `import { Image, View } from '@idealyst/components';
|
|
61
|
+
|
|
62
|
+
<View spacing="md">
|
|
63
|
+
<Image
|
|
64
|
+
source="https://picsum.photos/300/200"
|
|
65
|
+
alt="Cover"
|
|
66
|
+
width={300}
|
|
67
|
+
height={200}
|
|
68
|
+
objectFit="cover"
|
|
69
|
+
/>
|
|
70
|
+
<Image
|
|
71
|
+
source="https://picsum.photos/300/200"
|
|
72
|
+
alt="Contain"
|
|
73
|
+
width={300}
|
|
74
|
+
height={200}
|
|
75
|
+
objectFit="contain"
|
|
76
|
+
/>
|
|
77
|
+
</View>`,
|
|
78
|
+
|
|
79
|
+
"with-icons": `import { Image, Card, View, Text } from '@idealyst/components';
|
|
80
|
+
|
|
81
|
+
<Card type="outlined">
|
|
82
|
+
<Image
|
|
83
|
+
source="https://picsum.photos/400/250"
|
|
84
|
+
alt="Card image"
|
|
85
|
+
width="100%"
|
|
86
|
+
aspectRatio={16 / 9}
|
|
87
|
+
objectFit="cover"
|
|
88
|
+
borderRadius={8}
|
|
89
|
+
/>
|
|
90
|
+
<View spacing="sm" style={{ padding: 16 }}>
|
|
91
|
+
<Text weight="bold">Image Title</Text>
|
|
92
|
+
<Text size="sm">Description text</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</Card>`,
|
|
95
|
+
|
|
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
|
+
};
|