@urbint/cl 1.0.1
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/.cursor/rules +313 -0
- package/.rnstorybook/index.ts +11 -0
- package/.rnstorybook/main.ts +8 -0
- package/.rnstorybook/preview.tsx +14 -0
- package/.rnstorybook/storybook.requires.ts +49 -0
- package/.storybook/main.ts +16 -0
- package/.storybook/preview.ts +32 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/App.tsx +422 -0
- package/README.md +229 -0
- package/app.json +33 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash-icon.png +0 -0
- package/babel.config.js +16 -0
- package/docs/components/CodeBlock.tsx +80 -0
- package/docs/components/PropTable.tsx +93 -0
- package/docs/components/Sidebar.tsx +199 -0
- package/docs/components/index.ts +8 -0
- package/docs/data/colorTokens.ts +70 -0
- package/docs/data/componentData.tsx +1685 -0
- package/docs/data/index.ts +7 -0
- package/docs/index.ts +19 -0
- package/docs/navigation.ts +94 -0
- package/docs/pages/ColorsPage.tsx +226 -0
- package/docs/pages/ComponentPage.tsx +235 -0
- package/docs/pages/InstallationPage.tsx +232 -0
- package/docs/pages/IntroductionPage.tsx +163 -0
- package/docs/pages/ThemingPage.tsx +251 -0
- package/docs/pages/index.ts +10 -0
- package/docs/theme.ts +64 -0
- package/docs/types.ts +54 -0
- package/index.ts +8 -0
- package/llms.txt +1893 -0
- package/mcp-config.example.json +10 -0
- package/mcp-server/README.md +192 -0
- package/mcp-server/package-lock.json +1707 -0
- package/mcp-server/package.json +38 -0
- package/mcp-server/src/index.ts +1136 -0
- package/mcp-server/src/registry/components.ts +1446 -0
- package/mcp-server/src/registry/index.ts +3 -0
- package/mcp-server/src/registry/tokens.ts +256 -0
- package/mcp-server/tsconfig.json +19 -0
- package/package.json +92 -0
- package/src/components/Accordion/Accordion.stories.tsx +226 -0
- package/src/components/Accordion/Accordion.tsx +255 -0
- package/src/components/Accordion/index.ts +12 -0
- package/src/components/ActionSheet/ActionSheet.stories.tsx +393 -0
- package/src/components/ActionSheet/ActionSheet.tsx +258 -0
- package/src/components/ActionSheet/index.ts +2 -0
- package/src/components/Alert/Alert.stories.tsx +165 -0
- package/src/components/Alert/Alert.tsx +164 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/AlertDialog/AlertDialog.stories.tsx +330 -0
- package/src/components/AlertDialog/AlertDialog.tsx +234 -0
- package/src/components/AlertDialog/index.ts +2 -0
- package/src/components/Avatar/Avatar.stories.tsx +154 -0
- package/src/components/Avatar/Avatar.tsx +219 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Badge/Badge.stories.tsx +146 -0
- package/src/components/Badge/Badge.tsx +125 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Box/Box.stories.tsx +192 -0
- package/src/components/Box/Box.tsx +184 -0
- package/src/components/Box/index.ts +2 -0
- package/src/components/Button/Button.stories.tsx +157 -0
- package/src/components/Button/Button.tsx +180 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +145 -0
- package/src/components/Card/Card.tsx +169 -0
- package/src/components/Card/index.ts +11 -0
- package/src/components/Center/Center.stories.tsx +215 -0
- package/src/components/Center/Center.tsx +29 -0
- package/src/components/Center/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +94 -0
- package/src/components/Checkbox/Checkbox.tsx +242 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +623 -0
- package/src/components/DatePicker/DatePicker.tsx +1228 -0
- package/src/components/DatePicker/index.ts +8 -0
- package/src/components/Divider/Divider.stories.tsx +224 -0
- package/src/components/Divider/Divider.tsx +73 -0
- package/src/components/Divider/index.ts +2 -0
- package/src/components/Drawer/Drawer.stories.tsx +414 -0
- package/src/components/Drawer/Drawer.tsx +342 -0
- package/src/components/Drawer/index.ts +11 -0
- package/src/components/Fab/Fab.stories.tsx +360 -0
- package/src/components/Fab/Fab.tsx +185 -0
- package/src/components/Fab/index.ts +2 -0
- package/src/components/FormControl/FormControl.stories.tsx +276 -0
- package/src/components/FormControl/FormControl.tsx +185 -0
- package/src/components/FormControl/index.ts +12 -0
- package/src/components/Grid/Grid.stories.tsx +244 -0
- package/src/components/Grid/Grid.tsx +93 -0
- package/src/components/Grid/index.ts +2 -0
- package/src/components/HStack/HStack.stories.tsx +230 -0
- package/src/components/HStack/HStack.tsx +80 -0
- package/src/components/HStack/index.ts +2 -0
- package/src/components/Heading/Heading.stories.tsx +111 -0
- package/src/components/Heading/Heading.tsx +85 -0
- package/src/components/Heading/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +320 -0
- package/src/components/Icon/Icon.tsx +117 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Image/Image.stories.tsx +357 -0
- package/src/components/Image/Image.tsx +168 -0
- package/src/components/Image/index.ts +2 -0
- package/src/components/Input/Input.stories.tsx +164 -0
- package/src/components/Input/Input.tsx +274 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Link/Link.stories.tsx +187 -0
- package/src/components/Link/Link.tsx +104 -0
- package/src/components/Link/index.ts +2 -0
- package/src/components/Menu/Menu.stories.tsx +363 -0
- package/src/components/Menu/Menu.tsx +238 -0
- package/src/components/Menu/index.ts +2 -0
- package/src/components/Modal/Modal.stories.tsx +156 -0
- package/src/components/Modal/Modal.tsx +280 -0
- package/src/components/Modal/index.ts +11 -0
- package/src/components/Popover/Popover.stories.tsx +330 -0
- package/src/components/Popover/Popover.tsx +315 -0
- package/src/components/Popover/index.ts +11 -0
- package/src/components/Portal/Portal.stories.tsx +376 -0
- package/src/components/Portal/Portal.tsx +100 -0
- package/src/components/Portal/index.ts +2 -0
- package/src/components/Pressable/Pressable.stories.tsx +338 -0
- package/src/components/Pressable/Pressable.tsx +71 -0
- package/src/components/Pressable/index.ts +2 -0
- package/src/components/Progress/Progress.stories.tsx +131 -0
- package/src/components/Progress/Progress.tsx +219 -0
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Radio/Radio.stories.tsx +101 -0
- package/src/components/Radio/Radio.tsx +234 -0
- package/src/components/Radio/index.ts +2 -0
- package/src/components/Select/Select.stories.tsx +908 -0
- package/src/components/Select/Select.tsx +659 -0
- package/src/components/Select/index.ts +8 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +154 -0
- package/src/components/Skeleton/Skeleton.tsx +192 -0
- package/src/components/Skeleton/index.ts +8 -0
- package/src/components/Slider/Slider.stories.tsx +363 -0
- package/src/components/Slider/Slider.tsx +209 -0
- package/src/components/Slider/index.ts +2 -0
- package/src/components/Spinner/Spinner.stories.tsx +108 -0
- package/src/components/Spinner/Spinner.tsx +121 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Switch/Switch.stories.tsx +116 -0
- package/src/components/Switch/Switch.tsx +172 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/Table.stories.tsx +417 -0
- package/src/components/Table/Table.tsx +233 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Text/Text.stories.tsx +93 -0
- package/src/components/Text/Text.tsx +119 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Textarea/Textarea.stories.tsx +280 -0
- package/src/components/Textarea/Textarea.tsx +212 -0
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Toast/Toast.stories.tsx +446 -0
- package/src/components/Toast/Toast.tsx +221 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +354 -0
- package/src/components/Tooltip/Tooltip.tsx +261 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/VStack/VStack.stories.tsx +183 -0
- package/src/components/VStack/VStack.tsx +76 -0
- package/src/components/VStack/index.ts +2 -0
- package/src/components/index.ts +62 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useControllableState.ts +41 -0
- package/src/hooks/useDisclosure.ts +51 -0
- package/src/index.ts +22 -0
- package/src/stories/Button.stories.tsx +53 -0
- package/src/stories/Button.tsx +101 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.tsx +33 -0
- package/src/stories/Header.tsx +75 -0
- package/src/stories/Page.stories.tsx +25 -0
- package/src/stories/Page.tsx +154 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/styles/index.ts +7 -0
- package/src/styles/tokens.ts +318 -0
- package/src/styles/unistyles.ts +254 -0
- package/src/utils/createContext.tsx +25 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/mergeRefs.ts +21 -0
- package/tsconfig.json +26 -0
- package/urbint-cl-1.0.0.tgz +0 -0
- package/vitest.config.ts +37 -0
- package/vitest.shims.d.ts +1 -0
package/docs/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation Exports
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Types
|
|
6
|
+
export * from './types';
|
|
7
|
+
|
|
8
|
+
// Theme and navigation
|
|
9
|
+
export * from './theme';
|
|
10
|
+
export * from './navigation';
|
|
11
|
+
|
|
12
|
+
// Data
|
|
13
|
+
export * from './data';
|
|
14
|
+
|
|
15
|
+
// Components
|
|
16
|
+
export * from './components';
|
|
17
|
+
|
|
18
|
+
// Pages
|
|
19
|
+
export * from './pages';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation Configuration
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { NavItem } from './types';
|
|
6
|
+
|
|
7
|
+
export const NAV_ITEMS: NavItem[] = [
|
|
8
|
+
{
|
|
9
|
+
id: 'getting-started',
|
|
10
|
+
title: 'Getting Started',
|
|
11
|
+
icon: '🚀',
|
|
12
|
+
children: [
|
|
13
|
+
{ id: 'introduction', title: 'Introduction' },
|
|
14
|
+
{ id: 'installation', title: 'Installation' },
|
|
15
|
+
{ id: 'quick-start', title: 'Quick Start' },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'design-system',
|
|
20
|
+
title: 'Design System',
|
|
21
|
+
icon: '🎨',
|
|
22
|
+
children: [
|
|
23
|
+
{ id: 'colors', title: 'Colors' },
|
|
24
|
+
{ id: 'typography', title: 'Typography' },
|
|
25
|
+
{ id: 'spacing', title: 'Spacing' },
|
|
26
|
+
{ id: 'elevation', title: 'Elevation' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'customization',
|
|
31
|
+
title: 'Customization',
|
|
32
|
+
icon: '⚙️',
|
|
33
|
+
children: [
|
|
34
|
+
{ id: 'theming', title: 'Theming' },
|
|
35
|
+
{ id: 'dark-mode', title: 'Dark Mode' },
|
|
36
|
+
{ id: 'custom-tokens', title: 'Custom Tokens' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'components',
|
|
41
|
+
title: 'Components',
|
|
42
|
+
icon: '📦',
|
|
43
|
+
children: [
|
|
44
|
+
// Layout
|
|
45
|
+
{ id: 'component-box', title: 'Box' },
|
|
46
|
+
{ id: 'component-hstack', title: 'HStack' },
|
|
47
|
+
{ id: 'component-vstack', title: 'VStack' },
|
|
48
|
+
{ id: 'component-center', title: 'Center' },
|
|
49
|
+
{ id: 'component-grid', title: 'Grid' },
|
|
50
|
+
{ id: 'component-divider', title: 'Divider' },
|
|
51
|
+
// Typography
|
|
52
|
+
{ id: 'component-text', title: 'Text' },
|
|
53
|
+
{ id: 'component-heading', title: 'Heading' },
|
|
54
|
+
{ id: 'component-link', title: 'Link' },
|
|
55
|
+
// Form Controls
|
|
56
|
+
{ id: 'component-button', title: 'Button' },
|
|
57
|
+
{ id: 'component-input', title: 'Input' },
|
|
58
|
+
{ id: 'component-textarea', title: 'Textarea' },
|
|
59
|
+
{ id: 'component-checkbox', title: 'Checkbox' },
|
|
60
|
+
{ id: 'component-radio', title: 'Radio' },
|
|
61
|
+
{ id: 'component-switch', title: 'Switch' },
|
|
62
|
+
{ id: 'component-select', title: 'Select' },
|
|
63
|
+
{ id: 'component-slider', title: 'Slider' },
|
|
64
|
+
{ id: 'component-formcontrol', title: 'FormControl' },
|
|
65
|
+
// Feedback
|
|
66
|
+
{ id: 'component-alert', title: 'Alert' },
|
|
67
|
+
{ id: 'component-toast', title: 'Toast' },
|
|
68
|
+
{ id: 'component-progress', title: 'Progress' },
|
|
69
|
+
{ id: 'component-spinner', title: 'Spinner' },
|
|
70
|
+
{ id: 'component-skeleton', title: 'Skeleton' },
|
|
71
|
+
// Data Display
|
|
72
|
+
{ id: 'component-avatar', title: 'Avatar' },
|
|
73
|
+
{ id: 'component-badge', title: 'Badge' },
|
|
74
|
+
{ id: 'component-card', title: 'Card' },
|
|
75
|
+
{ id: 'component-table', title: 'Table' },
|
|
76
|
+
{ id: 'component-icon', title: 'Icon' },
|
|
77
|
+
{ id: 'component-image', title: 'Image' },
|
|
78
|
+
// Actions
|
|
79
|
+
{ id: 'component-pressable', title: 'Pressable' },
|
|
80
|
+
{ id: 'component-fab', title: 'Fab' },
|
|
81
|
+
{ id: 'component-accordion', title: 'Accordion' },
|
|
82
|
+
// Overlay
|
|
83
|
+
{ id: 'component-modal', title: 'Modal' },
|
|
84
|
+
{ id: 'component-drawer', title: 'Drawer' },
|
|
85
|
+
{ id: 'component-alertdialog', title: 'AlertDialog' },
|
|
86
|
+
{ id: 'component-popover', title: 'Popover' },
|
|
87
|
+
{ id: 'component-tooltip', title: 'Tooltip' },
|
|
88
|
+
{ id: 'component-menu', title: 'Menu' },
|
|
89
|
+
{ id: 'component-actionsheet', title: 'ActionSheet' },
|
|
90
|
+
// Utility
|
|
91
|
+
{ id: 'component-portal', title: 'Portal' },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
];
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors Documentation Page
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
7
|
+
import { COLOR_GROUPS } from '../data/colorTokens';
|
|
8
|
+
import { CodeBlock } from '../components/CodeBlock';
|
|
9
|
+
import { colors, spacing, fontSize } from '../theme';
|
|
10
|
+
|
|
11
|
+
const ColorSwatch = ({ name, value, description }: { name: string; value: string; description?: string }) => {
|
|
12
|
+
const isLight = value === '#FFFFFF' || value === '#F9FAFB' || value === '#F3F4F6';
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<View style={styles.swatchContainer}>
|
|
16
|
+
<View style={[styles.swatch, { backgroundColor: value, borderWidth: isLight ? 1 : 0, borderColor: colors.borderLight }]}>
|
|
17
|
+
<Text style={[styles.swatchValue, { color: isLight ? colors.textPrimary : colors.textInverse }]}>
|
|
18
|
+
{value}
|
|
19
|
+
</Text>
|
|
20
|
+
</View>
|
|
21
|
+
<View style={styles.swatchInfo}>
|
|
22
|
+
<Text style={styles.swatchName}>{name}</Text>
|
|
23
|
+
{description && <Text style={styles.swatchDesc}>{description}</Text>}
|
|
24
|
+
</View>
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const ColorsPage = () => {
|
|
30
|
+
return (
|
|
31
|
+
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
|
|
32
|
+
<View style={styles.content}>
|
|
33
|
+
<Text style={styles.title}>Colors</Text>
|
|
34
|
+
<Text style={styles.subtitle}>
|
|
35
|
+
A comprehensive color palette designed for enterprise applications with proper contrast ratios and semantic meaning.
|
|
36
|
+
</Text>
|
|
37
|
+
|
|
38
|
+
<View style={styles.section}>
|
|
39
|
+
<Text style={styles.sectionTitle}>Usage</Text>
|
|
40
|
+
<Text style={styles.paragraph}>
|
|
41
|
+
Access colors through the theme object or use semantic color names in your components:
|
|
42
|
+
</Text>
|
|
43
|
+
<CodeBlock
|
|
44
|
+
language="tsx"
|
|
45
|
+
code={`import { useUnistyles } from 'react-native-unistyles';
|
|
46
|
+
|
|
47
|
+
function MyComponent() {
|
|
48
|
+
const { theme } = useUnistyles();
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Box bg={theme.colors.background.primary}>
|
|
52
|
+
<Text color={theme.colors.text.primary}>
|
|
53
|
+
Hello World
|
|
54
|
+
</Text>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Or use semantic props directly
|
|
60
|
+
<Text color="text.secondary">Subtitle</Text>
|
|
61
|
+
<Button variant="primary">Submit</Button>`}
|
|
62
|
+
/>
|
|
63
|
+
</View>
|
|
64
|
+
|
|
65
|
+
{COLOR_GROUPS.map((group) => (
|
|
66
|
+
<View key={group.name} style={styles.colorSection}>
|
|
67
|
+
<Text style={styles.colorGroupTitle}>{group.name}</Text>
|
|
68
|
+
<Text style={styles.colorGroupDesc}>{group.description}</Text>
|
|
69
|
+
<View style={styles.swatchGrid}>
|
|
70
|
+
{group.colors.map((color) => (
|
|
71
|
+
<ColorSwatch
|
|
72
|
+
key={color.name}
|
|
73
|
+
name={color.name}
|
|
74
|
+
value={color.value}
|
|
75
|
+
description={color.description}
|
|
76
|
+
/>
|
|
77
|
+
))}
|
|
78
|
+
</View>
|
|
79
|
+
</View>
|
|
80
|
+
))}
|
|
81
|
+
|
|
82
|
+
<View style={styles.section}>
|
|
83
|
+
<Text style={styles.sectionTitle}>Customizing Colors</Text>
|
|
84
|
+
<Text style={styles.paragraph}>
|
|
85
|
+
Override default colors by extending the theme configuration:
|
|
86
|
+
</Text>
|
|
87
|
+
<CodeBlock
|
|
88
|
+
language="tsx"
|
|
89
|
+
code={`// styles/unistyles.ts
|
|
90
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
91
|
+
|
|
92
|
+
const customTheme = {
|
|
93
|
+
colors: {
|
|
94
|
+
brand: {
|
|
95
|
+
primary: '#YOUR_PRIMARY_COLOR',
|
|
96
|
+
secondary: '#YOUR_SECONDARY_COLOR',
|
|
97
|
+
},
|
|
98
|
+
// Override other colors as needed
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
StyleSheet.configure({
|
|
103
|
+
themes: {
|
|
104
|
+
light: customTheme,
|
|
105
|
+
dark: customDarkTheme,
|
|
106
|
+
},
|
|
107
|
+
});`}
|
|
108
|
+
/>
|
|
109
|
+
</View>
|
|
110
|
+
|
|
111
|
+
<View style={styles.infoBox}>
|
|
112
|
+
<Text style={styles.infoTitle}>🎨 Design Tip</Text>
|
|
113
|
+
<Text style={styles.infoText}>
|
|
114
|
+
All colors are designed to meet WCAG 2.1 contrast requirements. Brand colors
|
|
115
|
+
maintain a 4.5:1 contrast ratio with background colors for accessibility.
|
|
116
|
+
</Text>
|
|
117
|
+
</View>
|
|
118
|
+
</View>
|
|
119
|
+
</ScrollView>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const styles = StyleSheet.create({
|
|
124
|
+
container: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
},
|
|
127
|
+
content: {
|
|
128
|
+
padding: spacing['2xl'],
|
|
129
|
+
maxWidth: 900,
|
|
130
|
+
},
|
|
131
|
+
title: {
|
|
132
|
+
fontSize: 36,
|
|
133
|
+
fontWeight: '700',
|
|
134
|
+
color: colors.textPrimary,
|
|
135
|
+
marginBottom: spacing.md,
|
|
136
|
+
},
|
|
137
|
+
subtitle: {
|
|
138
|
+
fontSize: fontSize.xl,
|
|
139
|
+
color: colors.textSecondary,
|
|
140
|
+
lineHeight: 28,
|
|
141
|
+
marginBottom: spacing['2xl'],
|
|
142
|
+
},
|
|
143
|
+
section: {
|
|
144
|
+
marginBottom: spacing['2xl'],
|
|
145
|
+
},
|
|
146
|
+
sectionTitle: {
|
|
147
|
+
fontSize: fontSize['2xl'],
|
|
148
|
+
fontWeight: '600',
|
|
149
|
+
color: colors.textPrimary,
|
|
150
|
+
marginBottom: spacing.md,
|
|
151
|
+
},
|
|
152
|
+
paragraph: {
|
|
153
|
+
fontSize: fontSize.lg,
|
|
154
|
+
color: colors.textSecondary,
|
|
155
|
+
lineHeight: 26,
|
|
156
|
+
marginBottom: spacing.lg,
|
|
157
|
+
},
|
|
158
|
+
colorSection: {
|
|
159
|
+
marginBottom: spacing['3xl'],
|
|
160
|
+
},
|
|
161
|
+
colorGroupTitle: {
|
|
162
|
+
fontSize: fontSize['2xl'],
|
|
163
|
+
fontWeight: '600',
|
|
164
|
+
color: colors.textPrimary,
|
|
165
|
+
marginBottom: spacing.xs,
|
|
166
|
+
},
|
|
167
|
+
colorGroupDesc: {
|
|
168
|
+
fontSize: fontSize.base,
|
|
169
|
+
color: colors.textTertiary,
|
|
170
|
+
marginBottom: spacing.lg,
|
|
171
|
+
},
|
|
172
|
+
swatchGrid: {
|
|
173
|
+
flexDirection: 'row',
|
|
174
|
+
flexWrap: 'wrap',
|
|
175
|
+
gap: spacing.lg,
|
|
176
|
+
},
|
|
177
|
+
swatchContainer: {
|
|
178
|
+
minWidth: 180,
|
|
179
|
+
flex: 1,
|
|
180
|
+
},
|
|
181
|
+
swatch: {
|
|
182
|
+
height: 80,
|
|
183
|
+
borderRadius: 8,
|
|
184
|
+
justifyContent: 'flex-end',
|
|
185
|
+
padding: spacing.sm,
|
|
186
|
+
marginBottom: spacing.sm,
|
|
187
|
+
},
|
|
188
|
+
swatchValue: {
|
|
189
|
+
fontFamily: 'monospace',
|
|
190
|
+
fontSize: fontSize.sm,
|
|
191
|
+
fontWeight: '500',
|
|
192
|
+
},
|
|
193
|
+
swatchInfo: {
|
|
194
|
+
gap: spacing.xs,
|
|
195
|
+
},
|
|
196
|
+
swatchName: {
|
|
197
|
+
fontSize: fontSize.base,
|
|
198
|
+
fontWeight: '600',
|
|
199
|
+
color: colors.textPrimary,
|
|
200
|
+
},
|
|
201
|
+
swatchDesc: {
|
|
202
|
+
fontSize: fontSize.sm,
|
|
203
|
+
color: colors.textTertiary,
|
|
204
|
+
lineHeight: 18,
|
|
205
|
+
},
|
|
206
|
+
infoBox: {
|
|
207
|
+
backgroundColor: '#EFF6FF',
|
|
208
|
+
padding: spacing.lg,
|
|
209
|
+
borderRadius: 12,
|
|
210
|
+
borderLeftWidth: 4,
|
|
211
|
+
borderLeftColor: colors.info,
|
|
212
|
+
marginTop: spacing.xl,
|
|
213
|
+
},
|
|
214
|
+
infoTitle: {
|
|
215
|
+
fontSize: fontSize.lg,
|
|
216
|
+
fontWeight: '600',
|
|
217
|
+
color: colors.info,
|
|
218
|
+
marginBottom: spacing.sm,
|
|
219
|
+
},
|
|
220
|
+
infoText: {
|
|
221
|
+
fontSize: fontSize.base,
|
|
222
|
+
color: colors.textSecondary,
|
|
223
|
+
lineHeight: 22,
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Documentation Page
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
7
|
+
import { COMPONENT_CATEGORIES } from '../data/componentData';
|
|
8
|
+
import { PropTable } from '../components/PropTable';
|
|
9
|
+
import { CodeBlock } from '../components/CodeBlock';
|
|
10
|
+
import { colors, spacing, fontSize } from '../theme';
|
|
11
|
+
|
|
12
|
+
type ComponentPageProps = {
|
|
13
|
+
componentId: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Map component IDs to component names
|
|
17
|
+
const componentIdMap: Record<string, string> = {
|
|
18
|
+
'box': 'Box',
|
|
19
|
+
'hstack': 'HStack',
|
|
20
|
+
'vstack': 'VStack',
|
|
21
|
+
'center': 'Center',
|
|
22
|
+
'grid': 'Grid',
|
|
23
|
+
'divider': 'Divider',
|
|
24
|
+
'text': 'Text',
|
|
25
|
+
'heading': 'Heading',
|
|
26
|
+
'link': 'Link',
|
|
27
|
+
'button': 'Button',
|
|
28
|
+
'input': 'Input',
|
|
29
|
+
'textarea': 'Textarea',
|
|
30
|
+
'checkbox': 'Checkbox',
|
|
31
|
+
'radio': 'Radio',
|
|
32
|
+
'switch': 'Switch',
|
|
33
|
+
'select': 'Select',
|
|
34
|
+
'slider': 'Slider',
|
|
35
|
+
'formcontrol': 'FormControl',
|
|
36
|
+
'alert': 'Alert',
|
|
37
|
+
'toast': 'Toast',
|
|
38
|
+
'progress': 'Progress',
|
|
39
|
+
'spinner': 'Spinner',
|
|
40
|
+
'skeleton': 'Skeleton',
|
|
41
|
+
'avatar': 'Avatar',
|
|
42
|
+
'badge': 'Badge',
|
|
43
|
+
'card': 'Card',
|
|
44
|
+
'table': 'Table',
|
|
45
|
+
'icon': 'Icon',
|
|
46
|
+
'image': 'Image',
|
|
47
|
+
'pressable': 'Pressable',
|
|
48
|
+
'fab': 'Fab',
|
|
49
|
+
'accordion': 'Accordion',
|
|
50
|
+
'modal': 'Modal',
|
|
51
|
+
'drawer': 'Drawer',
|
|
52
|
+
'alertdialog': 'AlertDialog',
|
|
53
|
+
'popover': 'Popover',
|
|
54
|
+
'tooltip': 'Tooltip',
|
|
55
|
+
'menu': 'Menu',
|
|
56
|
+
'actionsheet': 'ActionSheet',
|
|
57
|
+
'portal': 'Portal',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Find component across all categories
|
|
61
|
+
const findComponent = (componentName: string) => {
|
|
62
|
+
for (const category of COMPONENT_CATEGORIES) {
|
|
63
|
+
const component = category.components.find(
|
|
64
|
+
c => c.name.toLowerCase() === componentName.toLowerCase()
|
|
65
|
+
);
|
|
66
|
+
if (component) {
|
|
67
|
+
return { component, categoryName: category.name };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const ComponentPage = ({ componentId }: ComponentPageProps) => {
|
|
74
|
+
const componentName = componentIdMap[componentId.toLowerCase()] || componentId;
|
|
75
|
+
const result = findComponent(componentName);
|
|
76
|
+
|
|
77
|
+
if (!result) {
|
|
78
|
+
return (
|
|
79
|
+
<ScrollView style={styles.container}>
|
|
80
|
+
<View style={styles.content}>
|
|
81
|
+
<Text style={styles.title}>Component not found</Text>
|
|
82
|
+
<Text style={styles.subtitle}>
|
|
83
|
+
The component "{componentId}" could not be found.
|
|
84
|
+
</Text>
|
|
85
|
+
</View>
|
|
86
|
+
</ScrollView>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { component, categoryName } = result;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
|
|
94
|
+
<View style={styles.content}>
|
|
95
|
+
{/* Category Badge */}
|
|
96
|
+
<View style={styles.categoryBadge}>
|
|
97
|
+
<Text style={styles.categoryBadgeText}>{categoryName}</Text>
|
|
98
|
+
</View>
|
|
99
|
+
|
|
100
|
+
{/* Component Header */}
|
|
101
|
+
<Text style={styles.componentTitle}>{component.name}</Text>
|
|
102
|
+
<Text style={styles.componentDesc}>{component.description}</Text>
|
|
103
|
+
|
|
104
|
+
{/* Import */}
|
|
105
|
+
<View style={styles.section}>
|
|
106
|
+
<Text style={styles.sectionTitle}>Import</Text>
|
|
107
|
+
<CodeBlock
|
|
108
|
+
language="tsx"
|
|
109
|
+
code={`import { ${component.name} } from '@urbint/cl';`}
|
|
110
|
+
/>
|
|
111
|
+
</View>
|
|
112
|
+
|
|
113
|
+
{/* Props */}
|
|
114
|
+
{component.props && component.props.length > 0 && (
|
|
115
|
+
<View style={styles.section}>
|
|
116
|
+
<Text style={styles.sectionTitle}>Props</Text>
|
|
117
|
+
<PropTable props={component.props} />
|
|
118
|
+
</View>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
{/* Examples */}
|
|
122
|
+
{component.examples && component.examples.length > 0 && (
|
|
123
|
+
<View style={styles.section}>
|
|
124
|
+
<Text style={styles.sectionTitle}>Examples</Text>
|
|
125
|
+
{component.examples.map((example, index) => (
|
|
126
|
+
<View key={index} style={styles.exampleCard}>
|
|
127
|
+
<View style={styles.exampleHeader}>
|
|
128
|
+
<Text style={styles.exampleTitle}>{example.title}</Text>
|
|
129
|
+
{example.description && (
|
|
130
|
+
<Text style={styles.exampleDesc}>{example.description}</Text>
|
|
131
|
+
)}
|
|
132
|
+
</View>
|
|
133
|
+
<View style={styles.examplePreview}>
|
|
134
|
+
{example.render()}
|
|
135
|
+
</View>
|
|
136
|
+
{example.code && (
|
|
137
|
+
<View style={styles.exampleCode}>
|
|
138
|
+
<CodeBlock code={example.code} />
|
|
139
|
+
</View>
|
|
140
|
+
)}
|
|
141
|
+
</View>
|
|
142
|
+
))}
|
|
143
|
+
</View>
|
|
144
|
+
)}
|
|
145
|
+
</View>
|
|
146
|
+
</ScrollView>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const styles = StyleSheet.create({
|
|
151
|
+
container: {
|
|
152
|
+
flex: 1,
|
|
153
|
+
},
|
|
154
|
+
content: {
|
|
155
|
+
padding: spacing['2xl'],
|
|
156
|
+
maxWidth: 900,
|
|
157
|
+
},
|
|
158
|
+
title: {
|
|
159
|
+
fontSize: 36,
|
|
160
|
+
fontWeight: '700',
|
|
161
|
+
color: colors.textPrimary,
|
|
162
|
+
marginBottom: spacing.md,
|
|
163
|
+
},
|
|
164
|
+
subtitle: {
|
|
165
|
+
fontSize: fontSize.xl,
|
|
166
|
+
color: colors.textSecondary,
|
|
167
|
+
lineHeight: 28,
|
|
168
|
+
marginBottom: spacing['2xl'],
|
|
169
|
+
},
|
|
170
|
+
categoryBadge: {
|
|
171
|
+
backgroundColor: colors.bgTertiary,
|
|
172
|
+
paddingHorizontal: spacing.md,
|
|
173
|
+
paddingVertical: spacing.xs,
|
|
174
|
+
borderRadius: 16,
|
|
175
|
+
alignSelf: 'flex-start',
|
|
176
|
+
marginBottom: spacing.lg,
|
|
177
|
+
},
|
|
178
|
+
categoryBadgeText: {
|
|
179
|
+
fontSize: fontSize.sm,
|
|
180
|
+
fontWeight: '500',
|
|
181
|
+
color: colors.textSecondary,
|
|
182
|
+
},
|
|
183
|
+
componentTitle: {
|
|
184
|
+
fontSize: 36,
|
|
185
|
+
fontWeight: '700',
|
|
186
|
+
color: colors.textPrimary,
|
|
187
|
+
marginBottom: spacing.sm,
|
|
188
|
+
},
|
|
189
|
+
componentDesc: {
|
|
190
|
+
fontSize: fontSize.lg,
|
|
191
|
+
color: colors.textSecondary,
|
|
192
|
+
lineHeight: 26,
|
|
193
|
+
marginBottom: spacing['2xl'],
|
|
194
|
+
},
|
|
195
|
+
section: {
|
|
196
|
+
marginBottom: spacing['2xl'],
|
|
197
|
+
},
|
|
198
|
+
sectionTitle: {
|
|
199
|
+
fontSize: fontSize['2xl'],
|
|
200
|
+
fontWeight: '600',
|
|
201
|
+
color: colors.textPrimary,
|
|
202
|
+
marginBottom: spacing.lg,
|
|
203
|
+
},
|
|
204
|
+
exampleCard: {
|
|
205
|
+
borderWidth: 1,
|
|
206
|
+
borderColor: colors.borderLight,
|
|
207
|
+
borderRadius: 12,
|
|
208
|
+
overflow: 'hidden',
|
|
209
|
+
marginBottom: spacing.lg,
|
|
210
|
+
},
|
|
211
|
+
exampleHeader: {
|
|
212
|
+
backgroundColor: colors.bgTertiary,
|
|
213
|
+
padding: spacing.md,
|
|
214
|
+
borderBottomWidth: 1,
|
|
215
|
+
borderBottomColor: colors.borderLight,
|
|
216
|
+
},
|
|
217
|
+
exampleTitle: {
|
|
218
|
+
fontSize: fontSize.lg,
|
|
219
|
+
fontWeight: '600',
|
|
220
|
+
color: colors.textPrimary,
|
|
221
|
+
},
|
|
222
|
+
exampleDesc: {
|
|
223
|
+
fontSize: fontSize.base,
|
|
224
|
+
color: colors.textTertiary,
|
|
225
|
+
marginTop: spacing.xs,
|
|
226
|
+
},
|
|
227
|
+
examplePreview: {
|
|
228
|
+
padding: spacing.lg,
|
|
229
|
+
backgroundColor: colors.bgSecondary,
|
|
230
|
+
},
|
|
231
|
+
exampleCode: {
|
|
232
|
+
borderTopWidth: 1,
|
|
233
|
+
borderTopColor: colors.borderLight,
|
|
234
|
+
},
|
|
235
|
+
});
|