@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.
Files changed (211) hide show
  1. package/README.md +202 -0
  2. package/dist/data/cli-commands.d.ts +2 -0
  3. package/dist/data/cli-commands.d.ts.map +1 -0
  4. package/dist/data/cli-commands.js +100 -0
  5. package/dist/data/cli-commands.js.map +1 -0
  6. package/dist/data/components/Accordion.d.ts +15 -0
  7. package/dist/data/components/Accordion.d.ts.map +1 -0
  8. package/dist/data/components/Accordion.js +112 -0
  9. package/dist/data/components/Accordion.js.map +1 -0
  10. package/dist/data/components/ActivityIndicator.d.ts +15 -0
  11. package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
  12. package/dist/data/components/ActivityIndicator.js +82 -0
  13. package/dist/data/components/ActivityIndicator.js.map +1 -0
  14. package/dist/data/components/Alert.d.ts +15 -0
  15. package/dist/data/components/Alert.d.ts.map +1 -0
  16. package/dist/data/components/Alert.js +132 -0
  17. package/dist/data/components/Alert.js.map +1 -0
  18. package/dist/data/components/Avatar.d.ts +15 -0
  19. package/dist/data/components/Avatar.d.ts.map +1 -0
  20. package/dist/data/components/Avatar.js +93 -0
  21. package/dist/data/components/Avatar.js.map +1 -0
  22. package/dist/data/components/Badge.d.ts +15 -0
  23. package/dist/data/components/Badge.d.ts.map +1 -0
  24. package/dist/data/components/Badge.js +64 -0
  25. package/dist/data/components/Badge.js.map +1 -0
  26. package/dist/data/components/Breadcrumb.d.ts +15 -0
  27. package/dist/data/components/Breadcrumb.d.ts.map +1 -0
  28. package/dist/data/components/Breadcrumb.js +96 -0
  29. package/dist/data/components/Breadcrumb.js.map +1 -0
  30. package/dist/data/components/Button.d.ts +15 -0
  31. package/dist/data/components/Button.d.ts.map +1 -0
  32. package/dist/data/components/Button.js +87 -0
  33. package/dist/data/components/Button.js.map +1 -0
  34. package/dist/data/components/Card.d.ts +15 -0
  35. package/dist/data/components/Card.d.ts.map +1 -0
  36. package/dist/data/components/Card.js +67 -0
  37. package/dist/data/components/Card.js.map +1 -0
  38. package/dist/data/components/Checkbox.d.ts +15 -0
  39. package/dist/data/components/Checkbox.d.ts.map +1 -0
  40. package/dist/data/components/Checkbox.js +118 -0
  41. package/dist/data/components/Checkbox.js.map +1 -0
  42. package/dist/data/components/Chip.d.ts +15 -0
  43. package/dist/data/components/Chip.d.ts.map +1 -0
  44. package/dist/data/components/Chip.js +76 -0
  45. package/dist/data/components/Chip.js.map +1 -0
  46. package/dist/data/components/Dialog.d.ts +15 -0
  47. package/dist/data/components/Dialog.d.ts.map +1 -0
  48. package/dist/data/components/Dialog.js +137 -0
  49. package/dist/data/components/Dialog.js.map +1 -0
  50. package/dist/data/components/Divider.d.ts +15 -0
  51. package/dist/data/components/Divider.d.ts.map +1 -0
  52. package/dist/data/components/Divider.js +71 -0
  53. package/dist/data/components/Divider.js.map +1 -0
  54. package/dist/data/components/Icon.d.ts +15 -0
  55. package/dist/data/components/Icon.d.ts.map +1 -0
  56. package/dist/data/components/Icon.js +70 -0
  57. package/dist/data/components/Icon.js.map +1 -0
  58. package/dist/data/components/Image.d.ts +15 -0
  59. package/dist/data/components/Image.d.ts.map +1 -0
  60. package/dist/data/components/Image.js +122 -0
  61. package/dist/data/components/Image.js.map +1 -0
  62. package/dist/data/components/Input.d.ts +15 -0
  63. package/dist/data/components/Input.d.ts.map +1 -0
  64. package/dist/data/components/Input.js +109 -0
  65. package/dist/data/components/Input.js.map +1 -0
  66. package/dist/data/components/List.d.ts +15 -0
  67. package/dist/data/components/List.d.ts.map +1 -0
  68. package/dist/data/components/List.js +113 -0
  69. package/dist/data/components/List.js.map +1 -0
  70. package/dist/data/components/Menu.d.ts +15 -0
  71. package/dist/data/components/Menu.d.ts.map +1 -0
  72. package/dist/data/components/Menu.js +132 -0
  73. package/dist/data/components/Menu.js.map +1 -0
  74. package/dist/data/components/Popover.d.ts +15 -0
  75. package/dist/data/components/Popover.d.ts.map +1 -0
  76. package/dist/data/components/Popover.js +159 -0
  77. package/dist/data/components/Popover.js.map +1 -0
  78. package/dist/data/components/Pressable.d.ts +15 -0
  79. package/dist/data/components/Pressable.d.ts.map +1 -0
  80. package/dist/data/components/Pressable.js +125 -0
  81. package/dist/data/components/Pressable.js.map +1 -0
  82. package/dist/data/components/Progress.d.ts +15 -0
  83. package/dist/data/components/Progress.d.ts.map +1 -0
  84. package/dist/data/components/Progress.js +95 -0
  85. package/dist/data/components/Progress.js.map +1 -0
  86. package/dist/data/components/RadioButton.d.ts +15 -0
  87. package/dist/data/components/RadioButton.d.ts.map +1 -0
  88. package/dist/data/components/RadioButton.js +140 -0
  89. package/dist/data/components/RadioButton.js.map +1 -0
  90. package/dist/data/components/SVGImage.d.ts +15 -0
  91. package/dist/data/components/SVGImage.d.ts.map +1 -0
  92. package/dist/data/components/SVGImage.js +112 -0
  93. package/dist/data/components/SVGImage.js.map +1 -0
  94. package/dist/data/components/Screen.d.ts +15 -0
  95. package/dist/data/components/Screen.d.ts.map +1 -0
  96. package/dist/data/components/Screen.js +99 -0
  97. package/dist/data/components/Screen.js.map +1 -0
  98. package/dist/data/components/Select.d.ts +15 -0
  99. package/dist/data/components/Select.d.ts.map +1 -0
  100. package/dist/data/components/Select.js +146 -0
  101. package/dist/data/components/Select.js.map +1 -0
  102. package/dist/data/components/Skeleton.d.ts +15 -0
  103. package/dist/data/components/Skeleton.d.ts.map +1 -0
  104. package/dist/data/components/Skeleton.js +110 -0
  105. package/dist/data/components/Skeleton.js.map +1 -0
  106. package/dist/data/components/Slider.d.ts +15 -0
  107. package/dist/data/components/Slider.d.ts.map +1 -0
  108. package/dist/data/components/Slider.js +129 -0
  109. package/dist/data/components/Slider.js.map +1 -0
  110. package/dist/data/components/Switch.d.ts +15 -0
  111. package/dist/data/components/Switch.d.ts.map +1 -0
  112. package/dist/data/components/Switch.js +127 -0
  113. package/dist/data/components/Switch.js.map +1 -0
  114. package/dist/data/components/TabBar.d.ts +15 -0
  115. package/dist/data/components/TabBar.d.ts.map +1 -0
  116. package/dist/data/components/TabBar.js +145 -0
  117. package/dist/data/components/TabBar.js.map +1 -0
  118. package/dist/data/components/Table.d.ts +15 -0
  119. package/dist/data/components/Table.d.ts.map +1 -0
  120. package/dist/data/components/Table.js +151 -0
  121. package/dist/data/components/Table.js.map +1 -0
  122. package/dist/data/components/Tabs.d.ts +15 -0
  123. package/dist/data/components/Tabs.d.ts.map +1 -0
  124. package/dist/data/components/Tabs.js +150 -0
  125. package/dist/data/components/Tabs.js.map +1 -0
  126. package/dist/data/components/Text.d.ts +15 -0
  127. package/dist/data/components/Text.d.ts.map +1 -0
  128. package/dist/data/components/Text.js +85 -0
  129. package/dist/data/components/Text.js.map +1 -0
  130. package/dist/data/components/TextArea.d.ts +15 -0
  131. package/dist/data/components/TextArea.d.ts.map +1 -0
  132. package/dist/data/components/TextArea.js +155 -0
  133. package/dist/data/components/TextArea.js.map +1 -0
  134. package/dist/data/components/Tooltip.d.ts +15 -0
  135. package/dist/data/components/Tooltip.d.ts.map +1 -0
  136. package/dist/data/components/Tooltip.js +105 -0
  137. package/dist/data/components/Tooltip.js.map +1 -0
  138. package/dist/data/components/Video.d.ts +15 -0
  139. package/dist/data/components/Video.d.ts.map +1 -0
  140. package/dist/data/components/Video.js +168 -0
  141. package/dist/data/components/Video.js.map +1 -0
  142. package/dist/data/components/View.d.ts +15 -0
  143. package/dist/data/components/View.d.ts.map +1 -0
  144. package/dist/data/components/View.js +126 -0
  145. package/dist/data/components/View.js.map +1 -0
  146. package/dist/data/components/index.d.ts +37 -0
  147. package/dist/data/components/index.d.ts.map +1 -0
  148. package/dist/data/components/index.js +110 -0
  149. package/dist/data/components/index.js.map +1 -0
  150. package/dist/data/framework-guides.d.ts +2 -0
  151. package/dist/data/framework-guides.d.ts.map +1 -0
  152. package/dist/data/framework-guides.js +589 -0
  153. package/dist/data/framework-guides.js.map +1 -0
  154. package/dist/data/icon-guide.d.ts +2 -0
  155. package/dist/data/icon-guide.d.ts.map +1 -0
  156. package/dist/data/icon-guide.js +285 -0
  157. package/dist/data/icon-guide.js.map +1 -0
  158. package/dist/data/icons.json +7452 -0
  159. package/dist/data/navigation-guides.d.ts +2 -0
  160. package/dist/data/navigation-guides.d.ts.map +1 -0
  161. package/dist/data/navigation-guides.js +1196 -0
  162. package/dist/data/navigation-guides.js.map +1 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +422 -0
  166. package/dist/index.js.map +1 -0
  167. package/package.json +34 -0
  168. package/src/data/cli-commands.ts +103 -0
  169. package/src/data/components/Accordion.ts +106 -0
  170. package/src/data/components/ActivityIndicator.ts +82 -0
  171. package/src/data/components/Alert.ts +132 -0
  172. package/src/data/components/Avatar.ts +93 -0
  173. package/src/data/components/Badge.ts +63 -0
  174. package/src/data/components/Breadcrumb.ts +94 -0
  175. package/src/data/components/Button.ts +86 -0
  176. package/src/data/components/Card.ts +67 -0
  177. package/src/data/components/Checkbox.ts +117 -0
  178. package/src/data/components/Chip.ts +93 -0
  179. package/src/data/components/Dialog.ts +136 -0
  180. package/src/data/components/Divider.ts +70 -0
  181. package/src/data/components/Icon.ts +70 -0
  182. package/src/data/components/Image.ts +121 -0
  183. package/src/data/components/Input.ts +150 -0
  184. package/src/data/components/List.ts +103 -0
  185. package/src/data/components/Menu.ts +125 -0
  186. package/src/data/components/Popover.ts +159 -0
  187. package/src/data/components/Pressable.ts +123 -0
  188. package/src/data/components/Progress.ts +95 -0
  189. package/src/data/components/RadioButton.ts +130 -0
  190. package/src/data/components/SVGImage.ts +114 -0
  191. package/src/data/components/Screen.ts +103 -0
  192. package/src/data/components/Select.ts +140 -0
  193. package/src/data/components/Skeleton.ts +102 -0
  194. package/src/data/components/Slider.ts +150 -0
  195. package/src/data/components/Switch.ts +127 -0
  196. package/src/data/components/TabBar.ts +142 -0
  197. package/src/data/components/Table.ts +153 -0
  198. package/src/data/components/Tabs.ts +152 -0
  199. package/src/data/components/Text.ts +85 -0
  200. package/src/data/components/TextArea.ts +155 -0
  201. package/src/data/components/Tooltip.ts +105 -0
  202. package/src/data/components/Video.ts +168 -0
  203. package/src/data/components/View.ts +126 -0
  204. package/src/data/components/index.ts +109 -0
  205. package/src/data/framework-guides.ts +593 -0
  206. package/src/data/icon-guide.ts +284 -0
  207. package/src/data/icons.json +7452 -0
  208. package/src/data/navigation-guides.ts +1199 -0
  209. package/src/index.ts +473 -0
  210. package/test-client.js +86 -0
  211. package/tsconfig.json +20 -0
@@ -0,0 +1,150 @@
1
+ export const Slider = {
2
+ category: "form",
3
+ description: "Input slider for selecting numeric values from a range",
4
+ props: `
5
+ - \`value\`: number - The current value of the slider (controlled)
6
+ - \`defaultValue\`: number - The default value for uncontrolled usage
7
+ - \`min\`: number - The minimum value of the slider range
8
+ - \`max\`: number - The maximum value of the slider range
9
+ - \`step\`: number - The increment step when moving the slider
10
+ - \`disabled\`: boolean - Whether the slider is disabled
11
+ - \`showValue\`: boolean - Whether to display the current value
12
+ - \`showMinMax\`: boolean - Whether to show min and max labels
13
+ - \`marks\`: SliderMark[] - Array of marks to display on the slider track
14
+ - \`intent\`: SliderIntentVariant - The intent/color scheme of the slider
15
+ - \`size\`: SliderSizeVariant - The size variant of the slider
16
+ - \`icon\`: IconName | React.ReactNode - Icon to display in the slider thumb
17
+ - \`onValueChange\`: function - Called when the slider value changes during dragging
18
+ - \`onValueCommit\`: function - Called when the user finishes changing the value (on release)
19
+ `,
20
+ features: [
21
+ "Controlled and uncontrolled modes",
22
+ "Min/max value constraints",
23
+ "Step increment",
24
+ "Custom marks",
25
+ "Value display",
26
+ "Min/max labels",
27
+ "Three sizes",
28
+ "Five intent colors",
29
+ "Icon support in thumb",
30
+ "Change and commit callbacks",
31
+ ],
32
+ bestPractices: [
33
+ "Use for continuous numeric values",
34
+ "Show current value for user feedback",
35
+ "Use marks for important values",
36
+ "Set appropriate step size for precision",
37
+ "Use onValueCommit for expensive operations",
38
+ "Provide min/max labels for context",
39
+ ],
40
+ usage: `
41
+ import { Slider } from '@idealyst/components';
42
+ import { useState } from 'react';
43
+
44
+ function Example() {
45
+ const [value, setValue] = useState(50);
46
+
47
+ return (
48
+ <Slider
49
+ value={value}
50
+ onValueChange={setValue}
51
+ min={0}
52
+ max={100}
53
+ step={5}
54
+ showValue
55
+ showMinMax
56
+ />
57
+ );
58
+ }
59
+ `,
60
+ examples: {
61
+ basic: `import { Slider } from '@idealyst/components';
62
+
63
+ <Slider min={0} max={100} defaultValue={50} />`,
64
+
65
+ variants: `import { Slider, View } from '@idealyst/components';
66
+
67
+ <View spacing="md">
68
+ <Slider size="sm" value={25} />
69
+ <Slider size="md" value={50} />
70
+ <Slider size="lg" value={75} />
71
+ </View>`,
72
+
73
+ "with-icons": `import { Slider, View, Text, Icon } from '@idealyst/components';
74
+ import { useState } from 'react';
75
+
76
+ function VolumeControl() {
77
+ const [volume, setVolume] = useState(50);
78
+
79
+ return (
80
+ <View spacing="sm">
81
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 12 }}>
82
+ <Icon name="volume-low" size="md" />
83
+ <Slider
84
+ value={volume}
85
+ onValueChange={setVolume}
86
+ min={0}
87
+ max={100}
88
+ icon="volume-medium"
89
+ style={{ flex: 1 }}
90
+ />
91
+ <Icon name="volume-high" size="md" />
92
+ </View>
93
+ <Text align="center">{volume}%</Text>
94
+ </View>
95
+ );
96
+ }
97
+
98
+ // Brightness control with icon in thumb
99
+ function BrightnessControl() {
100
+ const [brightness, setBrightness] = useState(75);
101
+
102
+ return (
103
+ <View spacing="sm">
104
+ <Text>Brightness: {brightness}%</Text>
105
+ <Slider
106
+ value={brightness}
107
+ onValueChange={setBrightness}
108
+ min={0}
109
+ max={100}
110
+ icon="brightness-6"
111
+ intent="warning"
112
+ showMinMax
113
+ />
114
+ </View>
115
+ );
116
+ }`,
117
+
118
+ interactive: `import { Slider, View, Text, Button } from '@idealyst/components';
119
+ import { useState } from 'react';
120
+
121
+ function Example() {
122
+ const [price, setPrice] = useState(50);
123
+
124
+ const marks = [
125
+ { value: 0, label: '$0' },
126
+ { value: 50, label: '$50' },
127
+ { value: 100, label: '$100' },
128
+ ];
129
+
130
+ return (
131
+ <View spacing="md">
132
+ <Text weight="bold">Price Range: \${price}</Text>
133
+ <Slider
134
+ value={price}
135
+ onValueChange={setPrice}
136
+ min={0}
137
+ max={100}
138
+ step={5}
139
+ marks={marks}
140
+ showValue
141
+ intent="primary"
142
+ />
143
+ <Button onPress={() => console.log('Filter:', price)}>
144
+ Apply Filter
145
+ </Button>
146
+ </View>
147
+ );
148
+ }`,
149
+ },
150
+ };
@@ -0,0 +1,127 @@
1
+ export const Switch = {
2
+ category: "form",
3
+ description: "Toggle switch for binary on/off states",
4
+ props: `
5
+ - \`checked\`: boolean - Whether the switch is in the on/checked state
6
+ - \`onCheckedChange\`: function - Called when the switch state changes
7
+ - \`disabled\`: boolean - Whether the switch is disabled
8
+ - \`label\`: string - Label text to display next to the switch
9
+ - \`labelPosition\`: 'left' | 'right' - Position of the label relative to the switch
10
+ - \`intent\`: SwitchIntentVariant - The intent/color scheme of the switch
11
+ - \`size\`: SwitchSizeVariant - The size variant of the switch
12
+ - \`enabledIcon\`: IconName | React.ReactNode - Icon to display when switch is on
13
+ - \`disabledIcon\`: IconName | React.ReactNode - Icon to display when switch is off
14
+ `,
15
+ features: [
16
+ "Binary on/off toggle",
17
+ "Label with configurable position",
18
+ "Three sizes",
19
+ "Five intent colors",
20
+ "Custom icons for states",
21
+ "Disabled state",
22
+ "Animated transition",
23
+ ],
24
+ bestPractices: [
25
+ "Use for binary settings (on/off, enabled/disabled)",
26
+ "Provide clear labels",
27
+ "Use intent colors to indicate state meaning",
28
+ "Place label on left for form layouts",
29
+ "Use icons sparingly for clarity",
30
+ "Immediate effect - no submit button needed",
31
+ ],
32
+ usage: `
33
+ import { Switch } from '@idealyst/components';
34
+ import { useState } from 'react';
35
+
36
+ function Example() {
37
+ const [enabled, setEnabled] = useState(false);
38
+
39
+ return (
40
+ <Switch
41
+ checked={enabled}
42
+ onCheckedChange={setEnabled}
43
+ label="Enable notifications"
44
+ intent="primary"
45
+ />
46
+ );
47
+ }
48
+ `,
49
+ examples: {
50
+ basic: `import { Switch } from '@idealyst/components';
51
+
52
+ <Switch label="Enable feature" />`,
53
+
54
+ variants: `import { Switch, View } from '@idealyst/components';
55
+
56
+ <View spacing="md">
57
+ <Switch label="Small" size="sm" checked />
58
+ <Switch label="Medium" size="md" checked />
59
+ <Switch label="Large" size="lg" checked />
60
+ </View>`,
61
+
62
+ "with-icons": `import { Switch, View } from '@idealyst/components';
63
+ import { useState } from 'react';
64
+
65
+ function Example() {
66
+ const [darkMode, setDarkMode] = useState(false);
67
+
68
+ return (
69
+ <Switch
70
+ checked={darkMode}
71
+ onCheckedChange={setDarkMode}
72
+ label="Dark Mode"
73
+ enabledIcon="weather-night"
74
+ disabledIcon="white-balance-sunny"
75
+ intent="primary"
76
+ />
77
+ );
78
+ }`,
79
+
80
+ interactive: `import { Switch, View, Text, Card } from '@idealyst/components';
81
+ import { useState } from 'react';
82
+
83
+ function SettingsPanel() {
84
+ const [settings, setSettings] = useState({
85
+ notifications: true,
86
+ location: false,
87
+ analytics: true,
88
+ });
89
+
90
+ const toggle = (key: string) => {
91
+ setSettings({ ...settings, [key]: !settings[key] });
92
+ };
93
+
94
+ return (
95
+ <Card type="outlined" padding="md">
96
+ <View spacing="md">
97
+ <Text weight="bold">Privacy Settings</Text>
98
+
99
+ <Switch
100
+ checked={settings.notifications}
101
+ onCheckedChange={() => toggle('notifications')}
102
+ label="Push Notifications"
103
+ labelPosition="left"
104
+ intent="primary"
105
+ />
106
+
107
+ <Switch
108
+ checked={settings.location}
109
+ onCheckedChange={() => toggle('location')}
110
+ label="Location Services"
111
+ labelPosition="left"
112
+ intent="warning"
113
+ />
114
+
115
+ <Switch
116
+ checked={settings.analytics}
117
+ onCheckedChange={() => toggle('analytics')}
118
+ label="Analytics & Data"
119
+ labelPosition="left"
120
+ intent="neutral"
121
+ />
122
+ </View>
123
+ </Card>
124
+ );
125
+ }`,
126
+ },
127
+ };
@@ -0,0 +1,142 @@
1
+ export const TabBar = {
2
+ category: "navigation",
3
+ description: "Tab bar navigation component for switching between views or sections",
4
+ props: `
5
+ - \`items\`: TabBarItem[] - Array of tab items to display
6
+ - \`value\`: string - The currently selected tab value (controlled)
7
+ - \`defaultValue\`: string - The default selected tab for uncontrolled usage
8
+ - \`onChange\`: function - Called when the selected tab changes
9
+ - \`type\`: TabBarType - The visual style variant (default, underlined, pills)
10
+ - \`size\`: TabBarSizeVariant - The size variant of the tabs
11
+ - \`pillMode\`: TabBarPillMode - Mode for pills variant: 'light' for light backgrounds (dark pill), 'dark' for dark backgrounds (light pill)
12
+ `,
13
+ features: [
14
+ "Three visual variants",
15
+ "Controlled and uncontrolled modes",
16
+ "Three sizes",
17
+ "Five intent colors",
18
+ "Disabled tabs",
19
+ "Simple configuration",
20
+ ],
21
+ bestPractices: [
22
+ "Use 'underline' variant for page-level navigation",
23
+ "Use 'pills' variant for contained sections",
24
+ "Keep tab labels short (1-2 words)",
25
+ "Use 3-5 tabs for optimal UX",
26
+ "Disable tabs when content is unavailable",
27
+ "Preload tab content for smooth transitions",
28
+ ],
29
+ usage: `
30
+ import { TabBar } from '@idealyst/components';
31
+ import { useState } from 'react';
32
+
33
+ function Example() {
34
+ const [activeTab, setActiveTab] = useState('home');
35
+
36
+ const items = [
37
+ { value: 'home', label: 'Home' },
38
+ { value: 'profile', label: 'Profile' },
39
+ { value: 'settings', label: 'Settings' },
40
+ ];
41
+
42
+ return (
43
+ <TabBar
44
+ items={items}
45
+ value={activeTab}
46
+ onChange={setActiveTab}
47
+ type="underline"
48
+ />
49
+ );
50
+ }
51
+ `,
52
+ examples: {
53
+ basic: `import { TabBar } from '@idealyst/components';
54
+
55
+ const items = [
56
+ { value: '1', label: 'Tab 1' },
57
+ { value: '2', label: 'Tab 2' },
58
+ ];
59
+
60
+ <TabBar items={items} defaultValue="1" />`,
61
+
62
+ variants: `import { TabBar, View } from '@idealyst/components';
63
+
64
+ const items = [
65
+ { value: 'a', label: 'First' },
66
+ { value: 'b', label: 'Second' },
67
+ ];
68
+
69
+ <View spacing="md">
70
+ <TabBar items={items} type="default" />
71
+ <TabBar items={items} type="pills" />
72
+ <TabBar items={items} type="underline" />
73
+ </View>`,
74
+
75
+ "with-icons": `import { TabBar, View, Text } from '@idealyst/components';
76
+ import { useState } from 'react';
77
+
78
+ function Example() {
79
+ const [tab, setTab] = useState('overview');
80
+
81
+ const items = [
82
+ { value: 'overview', label: 'Overview' },
83
+ { value: 'analytics', label: 'Analytics' },
84
+ { value: 'reports', label: 'Reports' },
85
+ ];
86
+
87
+ return (
88
+ <View spacing="md">
89
+ <TabBar
90
+ items={items}
91
+ value={tab}
92
+ onChange={setTab}
93
+ type="underline"
94
+ intent="primary"
95
+ />
96
+ <Text>{tab} content here</Text>
97
+ </View>
98
+ );
99
+ }`,
100
+
101
+ interactive: `import { TabBar, View, Text, Card } from '@idealyst/components';
102
+ import { useState } from 'react';
103
+
104
+ function Example() {
105
+ const [activeTab, setActiveTab] = useState('personal');
106
+
107
+ const items = [
108
+ { value: 'personal', label: 'Personal Info' },
109
+ { value: 'security', label: 'Security' },
110
+ { value: 'notifications', label: 'Notifications' },
111
+ { value: 'billing', label: 'Billing', disabled: true },
112
+ ];
113
+
114
+ const renderContent = () => {
115
+ switch (activeTab) {
116
+ case 'personal':
117
+ return <Text>Personal information settings</Text>;
118
+ case 'security':
119
+ return <Text>Security and privacy settings</Text>;
120
+ case 'notifications':
121
+ return <Text>Notification preferences</Text>;
122
+ default:
123
+ return null;
124
+ }
125
+ };
126
+
127
+ return (
128
+ <View spacing="md">
129
+ <TabBar
130
+ items={items}
131
+ value={activeTab}
132
+ onChange={setActiveTab}
133
+ type="pills"
134
+ />
135
+ <Card type="outlined" padding="md">
136
+ {renderContent()}
137
+ </Card>
138
+ </View>
139
+ );
140
+ }`,
141
+ },
142
+ };
@@ -0,0 +1,153 @@
1
+ export const Table = {
2
+ category: "data",
3
+ description: "Data table component for displaying structured tabular data",
4
+ props: `
5
+ - \`columns\`: TableColumn<T>[] - Column definitions
6
+ - \`key\`: string - Unique column key
7
+ - \`title\`: string - Column header title
8
+ - \`dataIndex\`: string - Key in data object (optional)
9
+ - \`render\`: (value, row, index) => ReactNode - Custom cell renderer
10
+ - \`width\`: number | string - Column width
11
+ - \`align\`: 'left' | 'center' | 'right' - Text alignment
12
+ - \`data\`: T[] - Array of data objects
13
+ - \`variant\`: 'default' | 'bordered' | 'striped' - Visual style
14
+ - \`size\`: 'sm' | 'md' | 'lg' - Cell padding/size
15
+ - \`stickyHeader\`: boolean - Keep header fixed on scroll
16
+ - \`onRowPress\`: (row: T, index: number) => void - Row click handler
17
+ - \`style\`: ViewStyle - Additional styles
18
+ - \`testID\`: string - Test identifier
19
+ `,
20
+ features: [
21
+ "Column-based configuration",
22
+ "Custom cell renderers",
23
+ "Three visual variants",
24
+ "Three sizes",
25
+ "Sticky header support",
26
+ "Row click handling",
27
+ "Column alignment",
28
+ "Custom column widths",
29
+ ],
30
+ bestPractices: [
31
+ "Use render function for complex cell content",
32
+ "Enable stickyHeader for long tables",
33
+ "Use 'striped' variant for better readability",
34
+ "Set column widths for important columns",
35
+ "Keep column count reasonable for mobile",
36
+ "Use appropriate size for data density",
37
+ ],
38
+ usage: `
39
+ import { Table } from '@idealyst/components';
40
+
41
+ const columns = [
42
+ { key: 'name', title: 'Name', dataIndex: 'name' },
43
+ { key: 'email', title: 'Email', dataIndex: 'email' },
44
+ {
45
+ key: 'status',
46
+ title: 'Status',
47
+ render: (_, row) => <Badge>{row.status}</Badge>,
48
+ },
49
+ ];
50
+
51
+ const data = [
52
+ { id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
53
+ { id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Inactive' },
54
+ ];
55
+
56
+ <Table columns={columns} data={data} variant="striped" />
57
+ `,
58
+ examples: {
59
+ basic: `import { Table } from '@idealyst/components';
60
+
61
+ const columns = [
62
+ { key: 'id', title: 'ID', dataIndex: 'id' },
63
+ { key: 'name', title: 'Name', dataIndex: 'name' },
64
+ ];
65
+
66
+ const data = [
67
+ { id: 1, name: 'Item 1' },
68
+ { id: 2, name: 'Item 2' },
69
+ ];
70
+
71
+ <Table columns={columns} data={data} />`,
72
+
73
+ variants: `import { Table, View } from '@idealyst/components';
74
+
75
+ const columns = [{ key: 'name', title: 'Name', dataIndex: 'name' }];
76
+ const data = [{ name: 'Test' }];
77
+
78
+ <View spacing="md">
79
+ <Table columns={columns} data={data} variant="default" />
80
+ <Table columns={columns} data={data} variant="bordered" />
81
+ <Table columns={columns} data={data} variant="striped" />
82
+ </View>`,
83
+
84
+ "with-icons": `import { Table, Badge, Icon, View, Text } from '@idealyst/components';
85
+
86
+ const columns = [
87
+ {
88
+ key: 'user',
89
+ title: 'User',
90
+ render: (_, row) => (
91
+ <View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
92
+ <Icon name="account-circle" size="sm" />
93
+ <Text>{row.name}</Text>
94
+ </View>
95
+ ),
96
+ },
97
+ {
98
+ key: 'status',
99
+ title: 'Status',
100
+ render: (_, row) => (
101
+ <Badge color={row.active ? 'green' : 'gray'}>
102
+ {row.active ? 'Active' : 'Inactive'}
103
+ </Badge>
104
+ ),
105
+ },
106
+ ];
107
+
108
+ <Table columns={columns} data={users} />`,
109
+
110
+ interactive: `import { Table, Button, View, Text } from '@idealyst/components';
111
+ import { useState } from 'react';
112
+
113
+ function Example() {
114
+ const [selected, setSelected] = useState(null);
115
+
116
+ const columns = [
117
+ { key: 'id', title: 'ID', dataIndex: 'id', width: 60 },
118
+ { key: 'product', title: 'Product', dataIndex: 'name' },
119
+ { key: 'price', title: 'Price', dataIndex: 'price', align: 'right' },
120
+ {
121
+ key: 'actions',
122
+ title: 'Actions',
123
+ render: (_, row) => (
124
+ <Button
125
+ size="sm"
126
+ variant="outlined"
127
+ onPress={() => setSelected(row)}
128
+ >
129
+ View
130
+ </Button>
131
+ ),
132
+ },
133
+ ];
134
+
135
+ const data = [
136
+ { id: 1, name: 'Product A', price: '$29.99' },
137
+ { id: 2, name: 'Product B', price: '$49.99' },
138
+ ];
139
+
140
+ return (
141
+ <View spacing="md">
142
+ <Table
143
+ columns={columns}
144
+ data={data}
145
+ variant="bordered"
146
+ onRowPress={(row) => setSelected(row)}
147
+ />
148
+ {selected && <Text>Selected: {selected.name}</Text>}
149
+ </View>
150
+ );
151
+ }`,
152
+ },
153
+ };