@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,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Urbint Component Library - Design Tokens Registry
|
|
3
|
+
* Complete design token documentation for the design system
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface TokenCategory {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
tokens: TokenValue[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TokenValue {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
cssVariable?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const colorTokens: TokenCategory[] = [
|
|
20
|
+
{
|
|
21
|
+
name: 'Brand Colors',
|
|
22
|
+
description: 'Primary brand colors used across the application',
|
|
23
|
+
tokens: [
|
|
24
|
+
{ name: 'brand.navy', value: '#0D2B3E', description: 'Primary dark brand color' },
|
|
25
|
+
{ name: 'brand.blue', value: '#00A0CC', description: 'Primary action color' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Text Colors',
|
|
30
|
+
description: 'Colors for text content',
|
|
31
|
+
tokens: [
|
|
32
|
+
{ name: 'text.primary', value: '#1F2937', description: 'Primary text color' },
|
|
33
|
+
{ name: 'text.secondary', value: '#6B7280', description: 'Secondary/muted text' },
|
|
34
|
+
{ name: 'text.disabled', value: '#9CA3AF', description: 'Disabled text color' },
|
|
35
|
+
{ name: 'text.inverse', value: '#FFFFFF', description: 'Text on dark backgrounds' },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Background Colors',
|
|
40
|
+
description: 'Surface and background colors',
|
|
41
|
+
tokens: [
|
|
42
|
+
{ name: 'background.primary', value: '#FFFFFF', description: 'Main background' },
|
|
43
|
+
{ name: 'background.secondary', value: '#F9FAFB', description: 'Subtle/alternate background' },
|
|
44
|
+
{ name: 'background.tertiary', value: '#F3F4F6', description: 'Elevated surfaces' },
|
|
45
|
+
{ name: 'background.inverse', value: '#111827', description: 'Dark background' },
|
|
46
|
+
{ name: 'background.hover', value: '#F5F6F7', description: 'Hover state background' },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Border Colors',
|
|
51
|
+
description: 'Colors for borders and dividers',
|
|
52
|
+
tokens: [
|
|
53
|
+
{ name: 'border.disabled', value: '#E5E7EB', description: 'Subtle/disabled borders' },
|
|
54
|
+
{ name: 'border.default', value: '#D1D5DB', description: 'Standard borders' },
|
|
55
|
+
{ name: 'border.hover', value: '#9CA3AF', description: 'Hover state borders' },
|
|
56
|
+
{ name: 'border.active', value: '#00A0CC', description: 'Focus/active state borders' },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Feedback Colors',
|
|
61
|
+
description: 'Semantic colors for feedback states',
|
|
62
|
+
tokens: [
|
|
63
|
+
{ name: 'feedback.info', value: '#3B82F6', description: 'Information state' },
|
|
64
|
+
{ name: 'feedback.success', value: '#22C55E', description: 'Success state' },
|
|
65
|
+
{ name: 'feedback.warning', value: '#F59E0B', description: 'Warning state' },
|
|
66
|
+
{ name: 'feedback.error', value: '#EF4444', description: 'Error state' },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Badge Colors',
|
|
71
|
+
description: 'Colors for badge variants',
|
|
72
|
+
tokens: [
|
|
73
|
+
{ name: 'badge.gray', value: '#6B7280', description: 'Default/neutral badge' },
|
|
74
|
+
{ name: 'badge.red', value: '#DC2626', description: 'Critical/error badge' },
|
|
75
|
+
{ name: 'badge.orange', value: '#EA580C', description: 'Warning badge' },
|
|
76
|
+
{ name: 'badge.yellow', value: '#CA8A04', description: 'Pending badge' },
|
|
77
|
+
{ name: 'badge.green', value: '#16A34A', description: 'Success/active badge' },
|
|
78
|
+
{ name: 'badge.blue', value: '#2563EB', description: 'Info badge' },
|
|
79
|
+
{ name: 'badge.purple', value: '#7C3AED', description: 'New/highlight badge' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
export const spacingTokens: TokenCategory = {
|
|
85
|
+
name: 'Spacing',
|
|
86
|
+
description: 'Consistent spacing values for padding, margin, and gaps. Use token names for component props.',
|
|
87
|
+
tokens: [
|
|
88
|
+
{ name: 'none', value: '0px', description: 'No spacing' },
|
|
89
|
+
{ name: 'xs', value: '4px', description: 'Extra small spacing' },
|
|
90
|
+
{ name: 'sm', value: '8px', description: 'Small spacing' },
|
|
91
|
+
{ name: 'md', value: '12px', description: 'Medium spacing' },
|
|
92
|
+
{ name: 'lg', value: '16px', description: 'Large spacing' },
|
|
93
|
+
{ name: 'xl', value: '24px', description: 'Extra large spacing' },
|
|
94
|
+
{ name: '2xl', value: '32px', description: '2x extra large spacing' },
|
|
95
|
+
{ name: '3xl', value: '48px', description: '3x extra large spacing' },
|
|
96
|
+
{ name: '4xl', value: '64px', description: '4x extra large spacing' },
|
|
97
|
+
{ name: '5xl', value: '72px', description: '5x extra large spacing' },
|
|
98
|
+
// Legacy multiplier tokens
|
|
99
|
+
{ name: '0.5x', value: '2px', description: 'Legacy: 0.5x base (2px)' },
|
|
100
|
+
{ name: 'base', value: '4px', description: 'Legacy: base unit (4px)' },
|
|
101
|
+
{ name: '2x', value: '8px', description: 'Legacy: 2x base (8px)' },
|
|
102
|
+
{ name: '3x', value: '12px', description: 'Legacy: 3x base (12px)' },
|
|
103
|
+
{ name: '4x', value: '16px', description: 'Legacy: 4x base (16px)' },
|
|
104
|
+
{ name: '6x', value: '24px', description: 'Legacy: 6x base (24px)' },
|
|
105
|
+
{ name: '8x', value: '32px', description: 'Legacy: 8x base (32px)' },
|
|
106
|
+
{ name: '12x', value: '48px', description: 'Legacy: 12x base (48px)' },
|
|
107
|
+
{ name: '18x', value: '72px', description: 'Legacy: 18x base (72px)' },
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const typographyTokens: TokenCategory = {
|
|
112
|
+
name: 'Typography',
|
|
113
|
+
description: 'Font sizes and weights for text styles',
|
|
114
|
+
tokens: [
|
|
115
|
+
{ name: 'h1', value: '32px / bold (700)', description: 'Page titles' },
|
|
116
|
+
{ name: 'h2', value: '24px / semibold (600)', description: 'Section titles' },
|
|
117
|
+
{ name: 'h3', value: '20px / semibold (600)', description: 'Subsection titles' },
|
|
118
|
+
{ name: 'h4', value: '18px / semibold (600)', description: 'Minor headings' },
|
|
119
|
+
{ name: 'body', value: '16px / regular (400)', description: 'Body text' },
|
|
120
|
+
{ name: 'label', value: '14px / regular (400)', description: 'Form labels' },
|
|
121
|
+
{ name: 'caption', value: '13px / regular (400)', description: 'Captions and hints' },
|
|
122
|
+
{ name: 'small', value: '12px / regular (400)', description: 'Small text' },
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const borderRadiusTokens: TokenCategory = {
|
|
127
|
+
name: 'Border Radius',
|
|
128
|
+
description: 'Corner rounding values',
|
|
129
|
+
tokens: [
|
|
130
|
+
{ name: 'none', value: '0', description: 'No rounding' },
|
|
131
|
+
{ name: 'sm', value: '2px', description: 'Subtle rounding' },
|
|
132
|
+
{ name: 'md', value: '4px', description: 'Standard rounding' },
|
|
133
|
+
{ name: 'lg', value: '8px', description: 'Medium rounding' },
|
|
134
|
+
{ name: 'xl', value: '12px', description: 'Large rounding' },
|
|
135
|
+
{ name: '2xl', value: '16px', description: 'Extra large rounding' },
|
|
136
|
+
{ name: '3xl', value: '24px', description: 'Maximum rounding' },
|
|
137
|
+
{ name: 'full', value: '9999px', description: 'Fully rounded (circular)' },
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const elevationTokens: TokenCategory = {
|
|
142
|
+
name: 'Elevation (Shadows)',
|
|
143
|
+
description: 'Shadow levels for depth and elevation',
|
|
144
|
+
tokens: [
|
|
145
|
+
{ name: '5', value: '0 1px 2px rgba(0,0,0,0.05)', description: 'Subtle shadow' },
|
|
146
|
+
{ name: '10', value: '0 1px 3px rgba(0,0,0,0.1)', description: 'Light shadow' },
|
|
147
|
+
{ name: '20', value: '0 4px 6px rgba(0,0,0,0.1)', description: 'Medium shadow' },
|
|
148
|
+
{ name: '30', value: '0 10px 15px rgba(0,0,0,0.1)', description: 'Strong shadow' },
|
|
149
|
+
{ name: '40', value: '0 20px 25px rgba(0,0,0,0.15)', description: 'Heavy shadow' },
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const allTokenCategories = {
|
|
154
|
+
colors: colorTokens,
|
|
155
|
+
spacing: spacingTokens,
|
|
156
|
+
typography: typographyTokens,
|
|
157
|
+
borderRadius: borderRadiusTokens,
|
|
158
|
+
elevation: elevationTokens,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// Helper functions
|
|
162
|
+
export function getTokensByCategory(category: keyof typeof allTokenCategories) {
|
|
163
|
+
return allTokenCategories[category];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function searchTokens(query: string): TokenValue[] {
|
|
167
|
+
const lowerQuery = query.toLowerCase();
|
|
168
|
+
const results: TokenValue[] = [];
|
|
169
|
+
|
|
170
|
+
// Search in color tokens
|
|
171
|
+
colorTokens.forEach((category) => {
|
|
172
|
+
category.tokens.forEach((token) => {
|
|
173
|
+
if (
|
|
174
|
+
token.name.toLowerCase().includes(lowerQuery) ||
|
|
175
|
+
token.description?.toLowerCase().includes(lowerQuery)
|
|
176
|
+
) {
|
|
177
|
+
results.push(token);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Search in other tokens
|
|
183
|
+
[spacingTokens, typographyTokens, borderRadiusTokens, elevationTokens].forEach(
|
|
184
|
+
(category) => {
|
|
185
|
+
category.tokens.forEach((token) => {
|
|
186
|
+
if (
|
|
187
|
+
token.name.toLowerCase().includes(lowerQuery) ||
|
|
188
|
+
token.description?.toLowerCase().includes(lowerQuery)
|
|
189
|
+
) {
|
|
190
|
+
results.push(token);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
return results;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function formatTokensAsMarkdown(): string {
|
|
200
|
+
let markdown = '# Urbint Design Tokens\n\n';
|
|
201
|
+
|
|
202
|
+
// Colors
|
|
203
|
+
markdown += '## Colors\n\n';
|
|
204
|
+
colorTokens.forEach((category) => {
|
|
205
|
+
markdown += `### ${category.name}\n`;
|
|
206
|
+
markdown += `${category.description}\n\n`;
|
|
207
|
+
markdown += '| Token | Value | Description |\n';
|
|
208
|
+
markdown += '|-------|-------|-------------|\n';
|
|
209
|
+
category.tokens.forEach((token) => {
|
|
210
|
+
markdown += `| \`${token.name}\` | ${token.value} | ${token.description || ''} |\n`;
|
|
211
|
+
});
|
|
212
|
+
markdown += '\n';
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Spacing
|
|
216
|
+
markdown += `## ${spacingTokens.name}\n`;
|
|
217
|
+
markdown += `${spacingTokens.description}\n\n`;
|
|
218
|
+
markdown += '| Token | Value | Description |\n';
|
|
219
|
+
markdown += '|-------|-------|-------------|\n';
|
|
220
|
+
spacingTokens.tokens.forEach((token) => {
|
|
221
|
+
markdown += `| \`'${token.name}'\` | ${token.value} | ${token.description || ''} |\n`;
|
|
222
|
+
});
|
|
223
|
+
markdown += '\n';
|
|
224
|
+
|
|
225
|
+
// Typography
|
|
226
|
+
markdown += `## ${typographyTokens.name}\n`;
|
|
227
|
+
markdown += `${typographyTokens.description}\n\n`;
|
|
228
|
+
markdown += '| Token | Value | Description |\n';
|
|
229
|
+
markdown += '|-------|-------|-------------|\n';
|
|
230
|
+
typographyTokens.tokens.forEach((token) => {
|
|
231
|
+
markdown += `| \`${token.name}\` | ${token.value} | ${token.description || ''} |\n`;
|
|
232
|
+
});
|
|
233
|
+
markdown += '\n';
|
|
234
|
+
|
|
235
|
+
// Border Radius
|
|
236
|
+
markdown += `## ${borderRadiusTokens.name}\n`;
|
|
237
|
+
markdown += `${borderRadiusTokens.description}\n\n`;
|
|
238
|
+
markdown += '| Token | Value | Description |\n';
|
|
239
|
+
markdown += '|-------|-------|-------------|\n';
|
|
240
|
+
borderRadiusTokens.tokens.forEach((token) => {
|
|
241
|
+
markdown += `| \`'${token.name}'\` | ${token.value} | ${token.description || ''} |\n`;
|
|
242
|
+
});
|
|
243
|
+
markdown += '\n';
|
|
244
|
+
|
|
245
|
+
// Elevation
|
|
246
|
+
markdown += `## ${elevationTokens.name}\n`;
|
|
247
|
+
markdown += `${elevationTokens.description}\n\n`;
|
|
248
|
+
markdown += '| Token | Value | Description |\n';
|
|
249
|
+
markdown += '|-------|-------|-------------|\n';
|
|
250
|
+
elevationTokens.tokens.forEach((token) => {
|
|
251
|
+
markdown += `| \`'${token.name}'\` | ${token.value} | ${token.description || ''} |\n`;
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
return markdown;
|
|
255
|
+
}
|
|
256
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"rootDir": "./src",
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"resolveJsonModule": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"]
|
|
18
|
+
}
|
|
19
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@urbint/cl",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Enterprise-ready React Native component library built with Unistyles",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"types": "src/index.ts",
|
|
7
|
+
"module": "src/index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "expo start",
|
|
10
|
+
"android": "expo run:android",
|
|
11
|
+
"ios": "expo run:ios",
|
|
12
|
+
"web": "expo start --web",
|
|
13
|
+
"storybook": "storybook dev -p 6006",
|
|
14
|
+
"build-storybook": "storybook build",
|
|
15
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"prebuild": "expo prebuild --clean",
|
|
19
|
+
"mcp:install": "cd mcp-server && npm install",
|
|
20
|
+
"mcp:build": "cd mcp-server && npm run build",
|
|
21
|
+
"mcp:dev": "cd mcp-server && npm run dev",
|
|
22
|
+
"mcp:start": "node mcp-server/dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"react-native",
|
|
26
|
+
"component-library",
|
|
27
|
+
"ui-components",
|
|
28
|
+
"unistyles",
|
|
29
|
+
"enterprise",
|
|
30
|
+
"urbint",
|
|
31
|
+
"design-system",
|
|
32
|
+
"mcp",
|
|
33
|
+
"model-context-protocol"
|
|
34
|
+
],
|
|
35
|
+
"author": "Urbint",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@expo/metro-runtime": "^6.1.2",
|
|
39
|
+
"@expo/vector-icons": "^15.0.3",
|
|
40
|
+
"@gorhom/bottom-sheet": "^5.2.8",
|
|
41
|
+
"@react-native-community/datetimepicker": "^8.5.1",
|
|
42
|
+
"@react-native-community/slider": "^5.1.1",
|
|
43
|
+
"expo": "~54.0.27",
|
|
44
|
+
"expo-status-bar": "~3.0.9",
|
|
45
|
+
"react": "19.1.0",
|
|
46
|
+
"react-dom": "19.1.0",
|
|
47
|
+
"react-native": "0.81.5",
|
|
48
|
+
"react-native-edge-to-edge": "^1.7.0",
|
|
49
|
+
"react-native-gesture-handler": "^2.29.1",
|
|
50
|
+
"react-native-nitro-modules": "^0.31.10",
|
|
51
|
+
"react-native-reanimated": "^4.2.0",
|
|
52
|
+
"react-native-safe-area-context": "^5.6.2",
|
|
53
|
+
"react-native-svg": "^15.15.1",
|
|
54
|
+
"react-native-unistyles": "^3.0.19",
|
|
55
|
+
"react-native-web": "^0.21.2"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/core": "^7.28.5",
|
|
59
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
60
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
61
|
+
"@storybook/addon-a11y": "^10.1.9",
|
|
62
|
+
"@storybook/addon-docs": "^10.1.9",
|
|
63
|
+
"@storybook/addon-vitest": "^10.1.9",
|
|
64
|
+
"@storybook/react-native-web-vite": "^10.1.9",
|
|
65
|
+
"@types/react": "~19.1.0",
|
|
66
|
+
"@vitest/browser-playwright": "^4.0.15",
|
|
67
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
68
|
+
"babel-loader": "^8.4.1",
|
|
69
|
+
"babel-preset-expo": "^54.0.8",
|
|
70
|
+
"playwright": "^1.57.0",
|
|
71
|
+
"storybook": "^10.1.9",
|
|
72
|
+
"typescript": "~5.9.2",
|
|
73
|
+
"vite": "^7.3.0",
|
|
74
|
+
"vitest": "^4.0.15"
|
|
75
|
+
},
|
|
76
|
+
"private": false,
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public",
|
|
79
|
+
"registry": "https://registry.npmjs.org/"
|
|
80
|
+
},
|
|
81
|
+
"directories": {
|
|
82
|
+
"doc": "docs"
|
|
83
|
+
},
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "git+https://github.com/urbint/urbint-cl.git"
|
|
87
|
+
},
|
|
88
|
+
"bugs": {
|
|
89
|
+
"url": "https://github.com/urbint/urbint-cl/issues"
|
|
90
|
+
},
|
|
91
|
+
"homepage": "https://github.com/urbint/urbint-cl#readme"
|
|
92
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Accordion, AccordionItem, AccordionButton, AccordionPanel } from './Accordion';
|
|
3
|
+
import { VStack } from '../VStack';
|
|
4
|
+
import { Text } from '../Text';
|
|
5
|
+
import { colors, spacing } from '../../styles/tokens';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Accordion> = {
|
|
8
|
+
title: 'Components/Accordion',
|
|
9
|
+
component: Accordion,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof Accordion>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<Accordion defaultIndex={['item-1']}>
|
|
19
|
+
<AccordionItem value="item-1">
|
|
20
|
+
<AccordionButton>Section 1</AccordionButton>
|
|
21
|
+
<AccordionPanel>
|
|
22
|
+
<Text color={colors.text.secondary}>
|
|
23
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
24
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
25
|
+
</Text>
|
|
26
|
+
</AccordionPanel>
|
|
27
|
+
</AccordionItem>
|
|
28
|
+
<AccordionItem value="item-2">
|
|
29
|
+
<AccordionButton>Section 2</AccordionButton>
|
|
30
|
+
<AccordionPanel>
|
|
31
|
+
<Text color={colors.text.secondary}>
|
|
32
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
33
|
+
nisi ut aliquip ex ea commodo consequat.
|
|
34
|
+
</Text>
|
|
35
|
+
</AccordionPanel>
|
|
36
|
+
</AccordionItem>
|
|
37
|
+
<AccordionItem value="item-3">
|
|
38
|
+
<AccordionButton>Section 3</AccordionButton>
|
|
39
|
+
<AccordionPanel>
|
|
40
|
+
<Text color={colors.text.secondary}>
|
|
41
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse
|
|
42
|
+
cillum dolore eu fugiat nulla pariatur.
|
|
43
|
+
</Text>
|
|
44
|
+
</AccordionPanel>
|
|
45
|
+
</AccordionItem>
|
|
46
|
+
</Accordion>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const AllowMultiple: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<VStack space={spacing.sm}>
|
|
53
|
+
<Text weight="semiBold">Allow Multiple Open</Text>
|
|
54
|
+
<Accordion allowMultiple defaultIndex={['item-1', 'item-2']}>
|
|
55
|
+
<AccordionItem value="item-1">
|
|
56
|
+
<AccordionButton>First Section</AccordionButton>
|
|
57
|
+
<AccordionPanel>
|
|
58
|
+
<Text color="#6B7280">Content for the first section.</Text>
|
|
59
|
+
</AccordionPanel>
|
|
60
|
+
</AccordionItem>
|
|
61
|
+
<AccordionItem value="item-2">
|
|
62
|
+
<AccordionButton>Second Section</AccordionButton>
|
|
63
|
+
<AccordionPanel>
|
|
64
|
+
<Text color="#6B7280">Content for the second section.</Text>
|
|
65
|
+
</AccordionPanel>
|
|
66
|
+
</AccordionItem>
|
|
67
|
+
<AccordionItem value="item-3">
|
|
68
|
+
<AccordionButton>Third Section</AccordionButton>
|
|
69
|
+
<AccordionPanel>
|
|
70
|
+
<Text color="#6B7280">Content for the third section.</Text>
|
|
71
|
+
</AccordionPanel>
|
|
72
|
+
</AccordionItem>
|
|
73
|
+
</Accordion>
|
|
74
|
+
</VStack>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const DisabledItem: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<VStack space={spacing.sm}>
|
|
81
|
+
<Text weight="semiBold">With Disabled Item</Text>
|
|
82
|
+
<Accordion>
|
|
83
|
+
<AccordionItem value="item-1">
|
|
84
|
+
<AccordionButton>Available Section</AccordionButton>
|
|
85
|
+
<AccordionPanel>
|
|
86
|
+
<Text color="#6B7280">This section is available.</Text>
|
|
87
|
+
</AccordionPanel>
|
|
88
|
+
</AccordionItem>
|
|
89
|
+
<AccordionItem value="item-2" isDisabled>
|
|
90
|
+
<AccordionButton>Disabled Section</AccordionButton>
|
|
91
|
+
<AccordionPanel>
|
|
92
|
+
<Text color="#6B7280">This content is not accessible.</Text>
|
|
93
|
+
</AccordionPanel>
|
|
94
|
+
</AccordionItem>
|
|
95
|
+
<AccordionItem value="item-3">
|
|
96
|
+
<AccordionButton>Another Available Section</AccordionButton>
|
|
97
|
+
<AccordionPanel>
|
|
98
|
+
<Text color="#6B7280">This section is also available.</Text>
|
|
99
|
+
</AccordionPanel>
|
|
100
|
+
</AccordionItem>
|
|
101
|
+
</Accordion>
|
|
102
|
+
</VStack>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const FAQ: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<VStack space={spacing.lg}>
|
|
109
|
+
<Text weight="semiBold" style={{ fontSize: 20 }}>Frequently Asked Questions</Text>
|
|
110
|
+
<Accordion>
|
|
111
|
+
<AccordionItem value="faq-1">
|
|
112
|
+
<AccordionButton>What is Urbint Component Library?</AccordionButton>
|
|
113
|
+
<AccordionPanel>
|
|
114
|
+
<Text color="#6B7280">
|
|
115
|
+
Urbint Component Library is an enterprise-ready React Native
|
|
116
|
+
component library built with Unistyles for consistent styling
|
|
117
|
+
across platforms.
|
|
118
|
+
</Text>
|
|
119
|
+
</AccordionPanel>
|
|
120
|
+
</AccordionItem>
|
|
121
|
+
<AccordionItem value="faq-2">
|
|
122
|
+
<AccordionButton>How do I install the library?</AccordionButton>
|
|
123
|
+
<AccordionPanel>
|
|
124
|
+
<Text color="#6B7280">
|
|
125
|
+
You can install the library using npm or yarn. Simply run
|
|
126
|
+
`npm install urbint-cl` or `yarn add urbint-cl` in your project.
|
|
127
|
+
</Text>
|
|
128
|
+
</AccordionPanel>
|
|
129
|
+
</AccordionItem>
|
|
130
|
+
<AccordionItem value="faq-3">
|
|
131
|
+
<AccordionButton>Is it compatible with Expo?</AccordionButton>
|
|
132
|
+
<AccordionPanel>
|
|
133
|
+
<Text color="#6B7280">
|
|
134
|
+
Yes! The library is fully compatible with Expo SDK 53+ and
|
|
135
|
+
supports both iOS and Android platforms.
|
|
136
|
+
</Text>
|
|
137
|
+
</AccordionPanel>
|
|
138
|
+
</AccordionItem>
|
|
139
|
+
<AccordionItem value="faq-4">
|
|
140
|
+
<AccordionButton>Can I customize the theme?</AccordionButton>
|
|
141
|
+
<AccordionPanel>
|
|
142
|
+
<Text color="#6B7280">
|
|
143
|
+
Absolutely! The library uses Unistyles for theming, which allows
|
|
144
|
+
you to customize colors, typography, spacing, and more through
|
|
145
|
+
the theme configuration.
|
|
146
|
+
</Text>
|
|
147
|
+
</AccordionPanel>
|
|
148
|
+
</AccordionItem>
|
|
149
|
+
</Accordion>
|
|
150
|
+
</VStack>
|
|
151
|
+
),
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const IconOnLeft: Story = {
|
|
155
|
+
render: () => (
|
|
156
|
+
<VStack space={spacing.lg}>
|
|
157
|
+
<Text weight="semiBold" style={{ fontSize: 20 }}>Icon Position: Left</Text>
|
|
158
|
+
<Accordion iconPosition="left" defaultIndex={['item-1']}>
|
|
159
|
+
<AccordionItem value="item-1">
|
|
160
|
+
<AccordionButton>Site Conditions</AccordionButton>
|
|
161
|
+
<AccordionPanel>
|
|
162
|
+
<Text color="#6B7280">
|
|
163
|
+
Site conditions include weather, terrain, and environmental factors
|
|
164
|
+
that may affect the work.
|
|
165
|
+
</Text>
|
|
166
|
+
</AccordionPanel>
|
|
167
|
+
</AccordionItem>
|
|
168
|
+
<AccordionItem value="item-2">
|
|
169
|
+
<AccordionButton>Activities</AccordionButton>
|
|
170
|
+
<AccordionPanel>
|
|
171
|
+
<Text color="#6B7280">
|
|
172
|
+
Activities include installation, maintenance, and removal tasks
|
|
173
|
+
that need to be performed.
|
|
174
|
+
</Text>
|
|
175
|
+
</AccordionPanel>
|
|
176
|
+
</AccordionItem>
|
|
177
|
+
<AccordionItem value="item-3">
|
|
178
|
+
<AccordionButton>Equipment</AccordionButton>
|
|
179
|
+
<AccordionPanel>
|
|
180
|
+
<Text color="#6B7280">
|
|
181
|
+
Equipment details for the job site including machinery and tools.
|
|
182
|
+
</Text>
|
|
183
|
+
</AccordionPanel>
|
|
184
|
+
</AccordionItem>
|
|
185
|
+
</Accordion>
|
|
186
|
+
</VStack>
|
|
187
|
+
),
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const MixedIconPosition: Story = {
|
|
191
|
+
render: () => (
|
|
192
|
+
<VStack space={spacing.lg}>
|
|
193
|
+
<Text weight="semiBold" style={{ fontSize: 20 }}>Mixed Icon Positions</Text>
|
|
194
|
+
<Text color={colors.text.secondary} style={{ marginBottom: spacing.sm }}>
|
|
195
|
+
Default is right, but individual items can override to left
|
|
196
|
+
</Text>
|
|
197
|
+
<Accordion iconPosition="right" defaultIndex={['item-1']}>
|
|
198
|
+
<AccordionItem value="item-1">
|
|
199
|
+
<AccordionButton iconPosition="left">Icon on Left (override)</AccordionButton>
|
|
200
|
+
<AccordionPanel>
|
|
201
|
+
<Text color="#6B7280">
|
|
202
|
+
This item has its icon position overridden to left.
|
|
203
|
+
</Text>
|
|
204
|
+
</AccordionPanel>
|
|
205
|
+
</AccordionItem>
|
|
206
|
+
<AccordionItem value="item-2">
|
|
207
|
+
<AccordionButton>Icon on Right (default)</AccordionButton>
|
|
208
|
+
<AccordionPanel>
|
|
209
|
+
<Text color="#6B7280">
|
|
210
|
+
This item uses the default right icon position.
|
|
211
|
+
</Text>
|
|
212
|
+
</AccordionPanel>
|
|
213
|
+
</AccordionItem>
|
|
214
|
+
<AccordionItem value="item-3">
|
|
215
|
+
<AccordionButton iconPosition="left">Icon on Left (override)</AccordionButton>
|
|
216
|
+
<AccordionPanel>
|
|
217
|
+
<Text color="#6B7280">
|
|
218
|
+
Another item with left icon position override.
|
|
219
|
+
</Text>
|
|
220
|
+
</AccordionPanel>
|
|
221
|
+
</AccordionItem>
|
|
222
|
+
</Accordion>
|
|
223
|
+
</VStack>
|
|
224
|
+
),
|
|
225
|
+
};
|
|
226
|
+
|