@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
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installation Page
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
7
|
+
import { CodeBlock } from '../components/CodeBlock';
|
|
8
|
+
import { colors, spacing, fontSize } from '../theme';
|
|
9
|
+
|
|
10
|
+
export const InstallationPage = () => {
|
|
11
|
+
return (
|
|
12
|
+
<View style={styles.container}>
|
|
13
|
+
<Text style={styles.title}>Installation</Text>
|
|
14
|
+
<Text style={styles.subtitle}>
|
|
15
|
+
Get started with Urbint Component Library in your React Native project.
|
|
16
|
+
</Text>
|
|
17
|
+
|
|
18
|
+
<View style={styles.section}>
|
|
19
|
+
<Text style={styles.sectionTitle}>Prerequisites</Text>
|
|
20
|
+
<Text style={styles.paragraph}>
|
|
21
|
+
Before installing Urbint CL, ensure you have the following:
|
|
22
|
+
</Text>
|
|
23
|
+
<View style={styles.list}>
|
|
24
|
+
<Text style={styles.listItem}>• React Native 0.81 or higher</Text>
|
|
25
|
+
<Text style={styles.listItem}>• Node.js 18 or higher</Text>
|
|
26
|
+
<Text style={styles.listItem}>• Expo SDK 54+ (if using Expo)</Text>
|
|
27
|
+
</View>
|
|
28
|
+
</View>
|
|
29
|
+
|
|
30
|
+
<View style={styles.section}>
|
|
31
|
+
<Text style={styles.sectionTitle}>Step 1: Install the Package</Text>
|
|
32
|
+
<Text style={styles.paragraph}>
|
|
33
|
+
Install the component library and its peer dependencies:
|
|
34
|
+
</Text>
|
|
35
|
+
<CodeBlock
|
|
36
|
+
language="bash"
|
|
37
|
+
code={`# Using npm
|
|
38
|
+
npm install @urbint/component-library react-native-unistyles
|
|
39
|
+
|
|
40
|
+
# Using yarn
|
|
41
|
+
yarn add @urbint/component-library react-native-unistyles
|
|
42
|
+
|
|
43
|
+
# Using pnpm
|
|
44
|
+
pnpm add @urbint/component-library react-native-unistyles`}
|
|
45
|
+
/>
|
|
46
|
+
</View>
|
|
47
|
+
|
|
48
|
+
<View style={styles.section}>
|
|
49
|
+
<Text style={styles.sectionTitle}>Step 2: Configure Babel</Text>
|
|
50
|
+
<Text style={styles.paragraph}>
|
|
51
|
+
Add the Unistyles Babel plugin to your <Text style={styles.code}>babel.config.js</Text>:
|
|
52
|
+
</Text>
|
|
53
|
+
<CodeBlock
|
|
54
|
+
language="javascript"
|
|
55
|
+
code={`// babel.config.js
|
|
56
|
+
module.exports = function (api) {
|
|
57
|
+
api.cache(true);
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
presets: ['babel-preset-expo'],
|
|
61
|
+
plugins: [
|
|
62
|
+
[
|
|
63
|
+
'react-native-unistyles/plugin',
|
|
64
|
+
{
|
|
65
|
+
root: 'src',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
};`}
|
|
71
|
+
/>
|
|
72
|
+
</View>
|
|
73
|
+
|
|
74
|
+
<View style={styles.section}>
|
|
75
|
+
<Text style={styles.sectionTitle}>Step 3: Setup Theme Provider</Text>
|
|
76
|
+
<Text style={styles.paragraph}>
|
|
77
|
+
Import and configure the theme in your app's entry point:
|
|
78
|
+
</Text>
|
|
79
|
+
<CodeBlock
|
|
80
|
+
language="tsx"
|
|
81
|
+
code={`// App.tsx or index.tsx
|
|
82
|
+
import '@urbint/component-library/styles'; // Import styles first
|
|
83
|
+
import { ThemeProvider } from '@urbint/component-library';
|
|
84
|
+
|
|
85
|
+
export default function App() {
|
|
86
|
+
return (
|
|
87
|
+
<ThemeProvider>
|
|
88
|
+
{/* Your app content */}
|
|
89
|
+
</ThemeProvider>
|
|
90
|
+
);
|
|
91
|
+
}`}
|
|
92
|
+
/>
|
|
93
|
+
</View>
|
|
94
|
+
|
|
95
|
+
<View style={styles.section}>
|
|
96
|
+
<Text style={styles.sectionTitle}>Step 4: Start Using Components</Text>
|
|
97
|
+
<Text style={styles.paragraph}>
|
|
98
|
+
Import and use components in your application:
|
|
99
|
+
</Text>
|
|
100
|
+
<CodeBlock
|
|
101
|
+
language="tsx"
|
|
102
|
+
code={`import {
|
|
103
|
+
Box,
|
|
104
|
+
VStack,
|
|
105
|
+
HStack,
|
|
106
|
+
Text,
|
|
107
|
+
Button,
|
|
108
|
+
Input,
|
|
109
|
+
} from '@urbint/component-library';
|
|
110
|
+
|
|
111
|
+
function MyComponent() {
|
|
112
|
+
return (
|
|
113
|
+
<Box p={16} bg="background.primary">
|
|
114
|
+
<VStack space={16}>
|
|
115
|
+
<Text variant="heading">Hello World</Text>
|
|
116
|
+
<Input
|
|
117
|
+
label="Email"
|
|
118
|
+
placeholder="Enter your email"
|
|
119
|
+
/>
|
|
120
|
+
<HStack space={8}>
|
|
121
|
+
<Button variant="primary">Submit</Button>
|
|
122
|
+
<Button variant="ghost">Cancel</Button>
|
|
123
|
+
</HStack>
|
|
124
|
+
</VStack>
|
|
125
|
+
</Box>
|
|
126
|
+
);
|
|
127
|
+
}`}
|
|
128
|
+
/>
|
|
129
|
+
</View>
|
|
130
|
+
|
|
131
|
+
<View style={styles.section}>
|
|
132
|
+
<Text style={styles.sectionTitle}>TypeScript Support</Text>
|
|
133
|
+
<Text style={styles.paragraph}>
|
|
134
|
+
Urbint CL is built with TypeScript and provides full type definitions.
|
|
135
|
+
No additional setup is required for TypeScript projects.
|
|
136
|
+
</Text>
|
|
137
|
+
<CodeBlock
|
|
138
|
+
language="tsx"
|
|
139
|
+
code={`// Types are automatically inferred
|
|
140
|
+
import { Button, ButtonProps } from '@urbint/component-library';
|
|
141
|
+
|
|
142
|
+
// Custom button with typed props
|
|
143
|
+
const MyButton = (props: ButtonProps) => (
|
|
144
|
+
<Button {...props} variant="primary" />
|
|
145
|
+
);`}
|
|
146
|
+
/>
|
|
147
|
+
</View>
|
|
148
|
+
|
|
149
|
+
<View style={styles.infoBox}>
|
|
150
|
+
<Text style={styles.infoTitle}>💡 Tip</Text>
|
|
151
|
+
<Text style={styles.infoText}>
|
|
152
|
+
For the best development experience, restart Metro bundler after installing
|
|
153
|
+
the library to ensure the Babel plugin is properly loaded.
|
|
154
|
+
</Text>
|
|
155
|
+
<CodeBlock
|
|
156
|
+
language="bash"
|
|
157
|
+
code={`npx expo start --clear`}
|
|
158
|
+
/>
|
|
159
|
+
</View>
|
|
160
|
+
</View>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const styles = StyleSheet.create({
|
|
165
|
+
container: {
|
|
166
|
+
padding: spacing['2xl'],
|
|
167
|
+
maxWidth: 900,
|
|
168
|
+
},
|
|
169
|
+
title: {
|
|
170
|
+
fontSize: 36,
|
|
171
|
+
fontWeight: '700',
|
|
172
|
+
color: colors.textPrimary,
|
|
173
|
+
marginBottom: spacing.md,
|
|
174
|
+
},
|
|
175
|
+
subtitle: {
|
|
176
|
+
fontSize: fontSize.xl,
|
|
177
|
+
color: colors.textSecondary,
|
|
178
|
+
lineHeight: 28,
|
|
179
|
+
marginBottom: spacing['2xl'],
|
|
180
|
+
},
|
|
181
|
+
section: {
|
|
182
|
+
marginBottom: spacing['2xl'],
|
|
183
|
+
},
|
|
184
|
+
sectionTitle: {
|
|
185
|
+
fontSize: fontSize['2xl'],
|
|
186
|
+
fontWeight: '600',
|
|
187
|
+
color: colors.textPrimary,
|
|
188
|
+
marginBottom: spacing.md,
|
|
189
|
+
},
|
|
190
|
+
paragraph: {
|
|
191
|
+
fontSize: fontSize.lg,
|
|
192
|
+
color: colors.textSecondary,
|
|
193
|
+
lineHeight: 26,
|
|
194
|
+
marginBottom: spacing.lg,
|
|
195
|
+
},
|
|
196
|
+
code: {
|
|
197
|
+
fontFamily: 'monospace',
|
|
198
|
+
backgroundColor: colors.bgTertiary,
|
|
199
|
+
paddingHorizontal: 6,
|
|
200
|
+
paddingVertical: 2,
|
|
201
|
+
borderRadius: 4,
|
|
202
|
+
},
|
|
203
|
+
list: {
|
|
204
|
+
marginTop: spacing.md,
|
|
205
|
+
gap: spacing.sm,
|
|
206
|
+
},
|
|
207
|
+
listItem: {
|
|
208
|
+
fontSize: fontSize.lg,
|
|
209
|
+
color: colors.textSecondary,
|
|
210
|
+
marginLeft: spacing.md,
|
|
211
|
+
},
|
|
212
|
+
infoBox: {
|
|
213
|
+
backgroundColor: '#EFF6FF',
|
|
214
|
+
padding: spacing.lg,
|
|
215
|
+
borderRadius: 12,
|
|
216
|
+
borderLeftWidth: 4,
|
|
217
|
+
borderLeftColor: colors.info,
|
|
218
|
+
},
|
|
219
|
+
infoTitle: {
|
|
220
|
+
fontSize: fontSize.lg,
|
|
221
|
+
fontWeight: '600',
|
|
222
|
+
color: colors.info,
|
|
223
|
+
marginBottom: spacing.sm,
|
|
224
|
+
},
|
|
225
|
+
infoText: {
|
|
226
|
+
fontSize: fontSize.base,
|
|
227
|
+
color: colors.textSecondary,
|
|
228
|
+
lineHeight: 22,
|
|
229
|
+
marginBottom: spacing.md,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Introduction Page
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
7
|
+
import { colors, spacing, fontSize } from '../theme';
|
|
8
|
+
|
|
9
|
+
export const IntroductionPage = () => {
|
|
10
|
+
return (
|
|
11
|
+
<View style={styles.container}>
|
|
12
|
+
<Text style={styles.title}>Welcome to Urbint Component Library</Text>
|
|
13
|
+
<Text style={styles.subtitle}>
|
|
14
|
+
Enterprise-ready React Native components built with Unistyles for B2B SAAS applications.
|
|
15
|
+
</Text>
|
|
16
|
+
|
|
17
|
+
<View style={styles.section}>
|
|
18
|
+
<Text style={styles.sectionTitle}>Overview</Text>
|
|
19
|
+
<Text style={styles.paragraph}>
|
|
20
|
+
Urbint Component Library (Urbint CL) is a comprehensive collection of 40+ production-ready
|
|
21
|
+
React Native components designed for enterprise B2B applications. Built with Unistyles 3.0,
|
|
22
|
+
it provides a consistent design system that works seamlessly across iOS, Android, and Web platforms.
|
|
23
|
+
</Text>
|
|
24
|
+
</View>
|
|
25
|
+
|
|
26
|
+
<View style={styles.section}>
|
|
27
|
+
<Text style={styles.sectionTitle}>Key Features</Text>
|
|
28
|
+
<View style={styles.featureGrid}>
|
|
29
|
+
{[
|
|
30
|
+
{ icon: '📱', title: 'Cross-Platform', desc: 'iOS, Android, and Web support out of the box' },
|
|
31
|
+
{ icon: '🎨', title: 'Themeable', desc: 'Light and dark modes with customizable design tokens' },
|
|
32
|
+
{ icon: '📝', title: 'TypeScript', desc: '100% TypeScript with full type safety' },
|
|
33
|
+
{ icon: '⚡', title: 'Performant', desc: 'Optimized for 60fps animations and interactions' },
|
|
34
|
+
{ icon: '♿', title: 'Accessible', desc: 'WCAG 2.1 compliant with proper ARIA labels' },
|
|
35
|
+
{ icon: '📦', title: '40+ Components', desc: 'Comprehensive set of UI primitives and patterns' },
|
|
36
|
+
].map((feature, i) => (
|
|
37
|
+
<View key={i} style={styles.featureCard}>
|
|
38
|
+
<Text style={styles.featureIcon}>{feature.icon}</Text>
|
|
39
|
+
<Text style={styles.featureTitle}>{feature.title}</Text>
|
|
40
|
+
<Text style={styles.featureDesc}>{feature.desc}</Text>
|
|
41
|
+
</View>
|
|
42
|
+
))}
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
<View style={styles.section}>
|
|
47
|
+
<Text style={styles.sectionTitle}>Tech Stack</Text>
|
|
48
|
+
<View style={styles.techList}>
|
|
49
|
+
{[
|
|
50
|
+
{ name: 'React Native', version: '0.81+' },
|
|
51
|
+
{ name: 'Unistyles', version: '3.0+' },
|
|
52
|
+
{ name: 'TypeScript', version: '5.0+' },
|
|
53
|
+
{ name: 'Expo', version: '54+' },
|
|
54
|
+
].map((tech, i) => (
|
|
55
|
+
<View key={i} style={styles.techItem}>
|
|
56
|
+
<Text style={styles.techName}>{tech.name}</Text>
|
|
57
|
+
<Text style={styles.techVersion}>{tech.version}</Text>
|
|
58
|
+
</View>
|
|
59
|
+
))}
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
|
|
63
|
+
<View style={styles.section}>
|
|
64
|
+
<Text style={styles.sectionTitle}>Getting Started</Text>
|
|
65
|
+
<Text style={styles.paragraph}>
|
|
66
|
+
Ready to start using Urbint CL? Head over to the{' '}
|
|
67
|
+
<Text style={styles.link}>Installation</Text> guide to add the library to your project,
|
|
68
|
+
or check out the <Text style={styles.link}>Quick Start</Text> for a hands-on tutorial.
|
|
69
|
+
</Text>
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const styles = StyleSheet.create({
|
|
76
|
+
container: {
|
|
77
|
+
padding: spacing['2xl'],
|
|
78
|
+
maxWidth: 900,
|
|
79
|
+
},
|
|
80
|
+
title: {
|
|
81
|
+
fontSize: 36,
|
|
82
|
+
fontWeight: '700',
|
|
83
|
+
color: colors.textPrimary,
|
|
84
|
+
marginBottom: spacing.md,
|
|
85
|
+
},
|
|
86
|
+
subtitle: {
|
|
87
|
+
fontSize: fontSize.xl,
|
|
88
|
+
color: colors.textSecondary,
|
|
89
|
+
lineHeight: 28,
|
|
90
|
+
marginBottom: spacing['2xl'],
|
|
91
|
+
},
|
|
92
|
+
section: {
|
|
93
|
+
marginBottom: spacing['2xl'],
|
|
94
|
+
},
|
|
95
|
+
sectionTitle: {
|
|
96
|
+
fontSize: fontSize['2xl'],
|
|
97
|
+
fontWeight: '600',
|
|
98
|
+
color: colors.textPrimary,
|
|
99
|
+
marginBottom: spacing.lg,
|
|
100
|
+
},
|
|
101
|
+
paragraph: {
|
|
102
|
+
fontSize: fontSize.lg,
|
|
103
|
+
color: colors.textSecondary,
|
|
104
|
+
lineHeight: 26,
|
|
105
|
+
},
|
|
106
|
+
link: {
|
|
107
|
+
color: colors.accent,
|
|
108
|
+
fontWeight: '500',
|
|
109
|
+
},
|
|
110
|
+
featureGrid: {
|
|
111
|
+
flexDirection: 'row',
|
|
112
|
+
flexWrap: 'wrap',
|
|
113
|
+
gap: spacing.lg,
|
|
114
|
+
},
|
|
115
|
+
featureCard: {
|
|
116
|
+
backgroundColor: colors.bgSecondary,
|
|
117
|
+
padding: spacing.lg,
|
|
118
|
+
borderRadius: 12,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: colors.borderLight,
|
|
121
|
+
minWidth: 250,
|
|
122
|
+
flex: 1,
|
|
123
|
+
},
|
|
124
|
+
featureIcon: {
|
|
125
|
+
fontSize: 28,
|
|
126
|
+
marginBottom: spacing.sm,
|
|
127
|
+
},
|
|
128
|
+
featureTitle: {
|
|
129
|
+
fontSize: fontSize.lg,
|
|
130
|
+
fontWeight: '600',
|
|
131
|
+
color: colors.textPrimary,
|
|
132
|
+
marginBottom: spacing.xs,
|
|
133
|
+
},
|
|
134
|
+
featureDesc: {
|
|
135
|
+
fontSize: fontSize.base,
|
|
136
|
+
color: colors.textTertiary,
|
|
137
|
+
lineHeight: 20,
|
|
138
|
+
},
|
|
139
|
+
techList: {
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
flexWrap: 'wrap',
|
|
142
|
+
gap: spacing.md,
|
|
143
|
+
},
|
|
144
|
+
techItem: {
|
|
145
|
+
flexDirection: 'row',
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
backgroundColor: colors.bgTertiary,
|
|
148
|
+
paddingHorizontal: spacing.lg,
|
|
149
|
+
paddingVertical: spacing.sm,
|
|
150
|
+
borderRadius: 8,
|
|
151
|
+
gap: spacing.sm,
|
|
152
|
+
},
|
|
153
|
+
techName: {
|
|
154
|
+
fontSize: fontSize.base,
|
|
155
|
+
fontWeight: '500',
|
|
156
|
+
color: colors.textPrimary,
|
|
157
|
+
},
|
|
158
|
+
techVersion: {
|
|
159
|
+
fontSize: fontSize.sm,
|
|
160
|
+
color: colors.textTertiary,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theming Documentation Page
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
7
|
+
import { CodeBlock } from '../components/CodeBlock';
|
|
8
|
+
import { colors, spacing, fontSize } from '../theme';
|
|
9
|
+
|
|
10
|
+
export const ThemingPage = () => {
|
|
11
|
+
return (
|
|
12
|
+
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
|
|
13
|
+
<View style={styles.content}>
|
|
14
|
+
<Text style={styles.title}>Theming</Text>
|
|
15
|
+
<Text style={styles.subtitle}>
|
|
16
|
+
Learn how to customize the look and feel of Urbint CL to match your brand.
|
|
17
|
+
</Text>
|
|
18
|
+
|
|
19
|
+
<View style={styles.section}>
|
|
20
|
+
<Text style={styles.sectionTitle}>Theme Structure</Text>
|
|
21
|
+
<Text style={styles.paragraph}>
|
|
22
|
+
The theme object contains all design tokens used throughout the library.
|
|
23
|
+
It's organized into logical groups for easy customization:
|
|
24
|
+
</Text>
|
|
25
|
+
<CodeBlock
|
|
26
|
+
language="tsx"
|
|
27
|
+
code={`const theme = {
|
|
28
|
+
colors: {
|
|
29
|
+
brand: { navy: '#0D2B3E', blue: '#00A0CC' },
|
|
30
|
+
text: { primary: '#1F2937', secondary: '#6B7280' },
|
|
31
|
+
background: { primary: '#FFFFFF', secondary: '#F9FAFB' },
|
|
32
|
+
border: { default: '#D1D5DB', active: '#00A0CC' },
|
|
33
|
+
feedback: { success: '#22C55E', error: '#EF4444' },
|
|
34
|
+
badge: { red: '#DC2626', green: '#16A34A', ... },
|
|
35
|
+
},
|
|
36
|
+
spacing: { xs: 4, sm: 8, md: 12, lg: 16, xl: 24 },
|
|
37
|
+
typography: {
|
|
38
|
+
h1: { fontSize: 32, fontWeight: '700' },
|
|
39
|
+
body: { fontSize: 16, fontWeight: '400' },
|
|
40
|
+
// ... more styles
|
|
41
|
+
},
|
|
42
|
+
borderRadius: { sm: 2, md: 4, lg: 8, xl: 12, full: 9999 },
|
|
43
|
+
elevation: { '5': {...}, '10': {...}, '20': {...} },
|
|
44
|
+
};`}
|
|
45
|
+
/>
|
|
46
|
+
</View>
|
|
47
|
+
|
|
48
|
+
<View style={styles.section}>
|
|
49
|
+
<Text style={styles.sectionTitle}>Creating a Custom Theme</Text>
|
|
50
|
+
<Text style={styles.paragraph}>
|
|
51
|
+
Create a custom theme by extending the default theme with your brand colors and styles:
|
|
52
|
+
</Text>
|
|
53
|
+
<CodeBlock
|
|
54
|
+
language="tsx"
|
|
55
|
+
code={`// src/styles/customTheme.ts
|
|
56
|
+
import { lightTheme, darkTheme } from '@urbint/component-library';
|
|
57
|
+
|
|
58
|
+
export const myLightTheme = {
|
|
59
|
+
...lightTheme,
|
|
60
|
+
colors: {
|
|
61
|
+
...lightTheme.colors,
|
|
62
|
+
brand: {
|
|
63
|
+
primary: '#YOUR_PRIMARY', // Replace with your brand color
|
|
64
|
+
secondary: '#YOUR_SECONDARY',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const myDarkTheme = {
|
|
70
|
+
...darkTheme,
|
|
71
|
+
colors: {
|
|
72
|
+
...darkTheme.colors,
|
|
73
|
+
brand: {
|
|
74
|
+
primary: '#YOUR_PRIMARY_DARK',
|
|
75
|
+
secondary: '#YOUR_SECONDARY_DARK',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};`}
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
81
|
+
|
|
82
|
+
<View style={styles.section}>
|
|
83
|
+
<Text style={styles.sectionTitle}>Configuring Unistyles</Text>
|
|
84
|
+
<Text style={styles.paragraph}>
|
|
85
|
+
Register your custom themes with Unistyles:
|
|
86
|
+
</Text>
|
|
87
|
+
<CodeBlock
|
|
88
|
+
language="tsx"
|
|
89
|
+
code={`// src/styles/unistyles.ts
|
|
90
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
91
|
+
import { myLightTheme, myDarkTheme } from './customTheme';
|
|
92
|
+
|
|
93
|
+
// Define breakpoints (optional)
|
|
94
|
+
const breakpoints = {
|
|
95
|
+
xs: 0,
|
|
96
|
+
sm: 576,
|
|
97
|
+
md: 768,
|
|
98
|
+
lg: 992,
|
|
99
|
+
xl: 1200,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Configure Unistyles
|
|
103
|
+
StyleSheet.configure({
|
|
104
|
+
themes: {
|
|
105
|
+
light: myLightTheme,
|
|
106
|
+
dark: myDarkTheme,
|
|
107
|
+
},
|
|
108
|
+
breakpoints,
|
|
109
|
+
settings: {
|
|
110
|
+
adaptiveThemes: true, // Auto-switch based on system preference
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// TypeScript: Extend module for theme types
|
|
115
|
+
declare module 'react-native-unistyles' {
|
|
116
|
+
export interface UnistylesThemes {
|
|
117
|
+
light: typeof myLightTheme;
|
|
118
|
+
dark: typeof myDarkTheme;
|
|
119
|
+
}
|
|
120
|
+
}`}
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
|
|
124
|
+
<View style={styles.section}>
|
|
125
|
+
<Text style={styles.sectionTitle}>Using the Theme in Components</Text>
|
|
126
|
+
<Text style={styles.paragraph}>
|
|
127
|
+
Access theme values in your components using the useUnistyles hook:
|
|
128
|
+
</Text>
|
|
129
|
+
<CodeBlock
|
|
130
|
+
language="tsx"
|
|
131
|
+
code={`import { useUnistyles } from 'react-native-unistyles';
|
|
132
|
+
|
|
133
|
+
function MyComponent() {
|
|
134
|
+
const { theme, breakpoint } = useUnistyles();
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<View style={{
|
|
138
|
+
backgroundColor: theme.colors.background.primary,
|
|
139
|
+
padding: theme.spacing.lg,
|
|
140
|
+
}}>
|
|
141
|
+
<Text style={{
|
|
142
|
+
color: theme.colors.text.primary,
|
|
143
|
+
...theme.typography.h2,
|
|
144
|
+
}}>
|
|
145
|
+
{breakpoint === 'xs' ? 'Mobile' : 'Desktop'}
|
|
146
|
+
</Text>
|
|
147
|
+
</View>
|
|
148
|
+
);
|
|
149
|
+
}`}
|
|
150
|
+
/>
|
|
151
|
+
</View>
|
|
152
|
+
|
|
153
|
+
<View style={styles.section}>
|
|
154
|
+
<Text style={styles.sectionTitle}>Switching Themes Programmatically</Text>
|
|
155
|
+
<Text style={styles.paragraph}>
|
|
156
|
+
Allow users to switch between themes in your app:
|
|
157
|
+
</Text>
|
|
158
|
+
<CodeBlock
|
|
159
|
+
language="tsx"
|
|
160
|
+
code={`import { UnistylesRuntime } from 'react-native-unistyles';
|
|
161
|
+
|
|
162
|
+
function ThemeSwitcher() {
|
|
163
|
+
const toggleTheme = () => {
|
|
164
|
+
const currentTheme = UnistylesRuntime.themeName;
|
|
165
|
+
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
|
166
|
+
|
|
167
|
+
UnistylesRuntime.setTheme(newTheme);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<Button onPress={toggleTheme}>
|
|
172
|
+
Toggle Theme
|
|
173
|
+
</Button>
|
|
174
|
+
);
|
|
175
|
+
}`}
|
|
176
|
+
/>
|
|
177
|
+
</View>
|
|
178
|
+
|
|
179
|
+
<View style={styles.tipBox}>
|
|
180
|
+
<Text style={styles.tipTitle}>💡 Best Practices</Text>
|
|
181
|
+
<View style={styles.tipList}>
|
|
182
|
+
<Text style={styles.tipItem}>• Keep color semantics consistent (primary, secondary, etc.)</Text>
|
|
183
|
+
<Text style={styles.tipItem}>• Test contrast ratios for accessibility (4.5:1 minimum)</Text>
|
|
184
|
+
<Text style={styles.tipItem}>• Use design tokens instead of hardcoded values</Text>
|
|
185
|
+
<Text style={styles.tipItem}>• Provide both light and dark theme variants</Text>
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
</View>
|
|
189
|
+
</ScrollView>
|
|
190
|
+
);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const styles = StyleSheet.create({
|
|
194
|
+
container: {
|
|
195
|
+
flex: 1,
|
|
196
|
+
},
|
|
197
|
+
content: {
|
|
198
|
+
padding: spacing['2xl'],
|
|
199
|
+
maxWidth: 900,
|
|
200
|
+
},
|
|
201
|
+
title: {
|
|
202
|
+
fontSize: 36,
|
|
203
|
+
fontWeight: '700',
|
|
204
|
+
color: colors.textPrimary,
|
|
205
|
+
marginBottom: spacing.md,
|
|
206
|
+
},
|
|
207
|
+
subtitle: {
|
|
208
|
+
fontSize: fontSize.xl,
|
|
209
|
+
color: colors.textSecondary,
|
|
210
|
+
lineHeight: 28,
|
|
211
|
+
marginBottom: spacing['2xl'],
|
|
212
|
+
},
|
|
213
|
+
section: {
|
|
214
|
+
marginBottom: spacing['2xl'],
|
|
215
|
+
},
|
|
216
|
+
sectionTitle: {
|
|
217
|
+
fontSize: fontSize['2xl'],
|
|
218
|
+
fontWeight: '600',
|
|
219
|
+
color: colors.textPrimary,
|
|
220
|
+
marginBottom: spacing.md,
|
|
221
|
+
},
|
|
222
|
+
paragraph: {
|
|
223
|
+
fontSize: fontSize.lg,
|
|
224
|
+
color: colors.textSecondary,
|
|
225
|
+
lineHeight: 26,
|
|
226
|
+
marginBottom: spacing.lg,
|
|
227
|
+
},
|
|
228
|
+
tipBox: {
|
|
229
|
+
backgroundColor: '#F0FDF4',
|
|
230
|
+
padding: spacing.lg,
|
|
231
|
+
borderRadius: 12,
|
|
232
|
+
borderLeftWidth: 4,
|
|
233
|
+
borderLeftColor: colors.success,
|
|
234
|
+
marginTop: spacing.xl,
|
|
235
|
+
},
|
|
236
|
+
tipTitle: {
|
|
237
|
+
fontSize: fontSize.lg,
|
|
238
|
+
fontWeight: '600',
|
|
239
|
+
color: colors.success,
|
|
240
|
+
marginBottom: spacing.md,
|
|
241
|
+
},
|
|
242
|
+
tipList: {
|
|
243
|
+
gap: spacing.sm,
|
|
244
|
+
},
|
|
245
|
+
tipItem: {
|
|
246
|
+
fontSize: fontSize.base,
|
|
247
|
+
color: colors.textSecondary,
|
|
248
|
+
lineHeight: 22,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page Exports
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { IntroductionPage } from './IntroductionPage';
|
|
6
|
+
export { InstallationPage } from './InstallationPage';
|
|
7
|
+
export { ColorsPage } from './ColorsPage';
|
|
8
|
+
export { ThemingPage } from './ThemingPage';
|
|
9
|
+
export { ComponentPage } from './ComponentPage';
|
|
10
|
+
|