@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.
Files changed (206) hide show
  1. package/.cursor/rules +313 -0
  2. package/.rnstorybook/index.ts +11 -0
  3. package/.rnstorybook/main.ts +8 -0
  4. package/.rnstorybook/preview.tsx +14 -0
  5. package/.rnstorybook/storybook.requires.ts +49 -0
  6. package/.storybook/main.ts +16 -0
  7. package/.storybook/preview.ts +32 -0
  8. package/.storybook/vitest.setup.ts +7 -0
  9. package/App.tsx +422 -0
  10. package/README.md +229 -0
  11. package/app.json +33 -0
  12. package/assets/adaptive-icon.png +0 -0
  13. package/assets/favicon.png +0 -0
  14. package/assets/icon.png +0 -0
  15. package/assets/splash-icon.png +0 -0
  16. package/babel.config.js +16 -0
  17. package/docs/components/CodeBlock.tsx +80 -0
  18. package/docs/components/PropTable.tsx +93 -0
  19. package/docs/components/Sidebar.tsx +199 -0
  20. package/docs/components/index.ts +8 -0
  21. package/docs/data/colorTokens.ts +70 -0
  22. package/docs/data/componentData.tsx +1685 -0
  23. package/docs/data/index.ts +7 -0
  24. package/docs/index.ts +19 -0
  25. package/docs/navigation.ts +94 -0
  26. package/docs/pages/ColorsPage.tsx +226 -0
  27. package/docs/pages/ComponentPage.tsx +235 -0
  28. package/docs/pages/InstallationPage.tsx +232 -0
  29. package/docs/pages/IntroductionPage.tsx +163 -0
  30. package/docs/pages/ThemingPage.tsx +251 -0
  31. package/docs/pages/index.ts +10 -0
  32. package/docs/theme.ts +64 -0
  33. package/docs/types.ts +54 -0
  34. package/index.ts +8 -0
  35. package/llms.txt +1893 -0
  36. package/mcp-config.example.json +10 -0
  37. package/mcp-server/README.md +192 -0
  38. package/mcp-server/package-lock.json +1707 -0
  39. package/mcp-server/package.json +38 -0
  40. package/mcp-server/src/index.ts +1136 -0
  41. package/mcp-server/src/registry/components.ts +1446 -0
  42. package/mcp-server/src/registry/index.ts +3 -0
  43. package/mcp-server/src/registry/tokens.ts +256 -0
  44. package/mcp-server/tsconfig.json +19 -0
  45. package/package.json +92 -0
  46. package/src/components/Accordion/Accordion.stories.tsx +226 -0
  47. package/src/components/Accordion/Accordion.tsx +255 -0
  48. package/src/components/Accordion/index.ts +12 -0
  49. package/src/components/ActionSheet/ActionSheet.stories.tsx +393 -0
  50. package/src/components/ActionSheet/ActionSheet.tsx +258 -0
  51. package/src/components/ActionSheet/index.ts +2 -0
  52. package/src/components/Alert/Alert.stories.tsx +165 -0
  53. package/src/components/Alert/Alert.tsx +164 -0
  54. package/src/components/Alert/index.ts +2 -0
  55. package/src/components/AlertDialog/AlertDialog.stories.tsx +330 -0
  56. package/src/components/AlertDialog/AlertDialog.tsx +234 -0
  57. package/src/components/AlertDialog/index.ts +2 -0
  58. package/src/components/Avatar/Avatar.stories.tsx +154 -0
  59. package/src/components/Avatar/Avatar.tsx +219 -0
  60. package/src/components/Avatar/index.ts +2 -0
  61. package/src/components/Badge/Badge.stories.tsx +146 -0
  62. package/src/components/Badge/Badge.tsx +125 -0
  63. package/src/components/Badge/index.ts +2 -0
  64. package/src/components/Box/Box.stories.tsx +192 -0
  65. package/src/components/Box/Box.tsx +184 -0
  66. package/src/components/Box/index.ts +2 -0
  67. package/src/components/Button/Button.stories.tsx +157 -0
  68. package/src/components/Button/Button.tsx +180 -0
  69. package/src/components/Button/index.ts +2 -0
  70. package/src/components/Card/Card.stories.tsx +145 -0
  71. package/src/components/Card/Card.tsx +169 -0
  72. package/src/components/Card/index.ts +11 -0
  73. package/src/components/Center/Center.stories.tsx +215 -0
  74. package/src/components/Center/Center.tsx +29 -0
  75. package/src/components/Center/index.ts +2 -0
  76. package/src/components/Checkbox/Checkbox.stories.tsx +94 -0
  77. package/src/components/Checkbox/Checkbox.tsx +242 -0
  78. package/src/components/Checkbox/index.ts +2 -0
  79. package/src/components/DatePicker/DatePicker.stories.tsx +623 -0
  80. package/src/components/DatePicker/DatePicker.tsx +1228 -0
  81. package/src/components/DatePicker/index.ts +8 -0
  82. package/src/components/Divider/Divider.stories.tsx +224 -0
  83. package/src/components/Divider/Divider.tsx +73 -0
  84. package/src/components/Divider/index.ts +2 -0
  85. package/src/components/Drawer/Drawer.stories.tsx +414 -0
  86. package/src/components/Drawer/Drawer.tsx +342 -0
  87. package/src/components/Drawer/index.ts +11 -0
  88. package/src/components/Fab/Fab.stories.tsx +360 -0
  89. package/src/components/Fab/Fab.tsx +185 -0
  90. package/src/components/Fab/index.ts +2 -0
  91. package/src/components/FormControl/FormControl.stories.tsx +276 -0
  92. package/src/components/FormControl/FormControl.tsx +185 -0
  93. package/src/components/FormControl/index.ts +12 -0
  94. package/src/components/Grid/Grid.stories.tsx +244 -0
  95. package/src/components/Grid/Grid.tsx +93 -0
  96. package/src/components/Grid/index.ts +2 -0
  97. package/src/components/HStack/HStack.stories.tsx +230 -0
  98. package/src/components/HStack/HStack.tsx +80 -0
  99. package/src/components/HStack/index.ts +2 -0
  100. package/src/components/Heading/Heading.stories.tsx +111 -0
  101. package/src/components/Heading/Heading.tsx +85 -0
  102. package/src/components/Heading/index.ts +2 -0
  103. package/src/components/Icon/Icon.stories.tsx +320 -0
  104. package/src/components/Icon/Icon.tsx +117 -0
  105. package/src/components/Icon/index.ts +2 -0
  106. package/src/components/Image/Image.stories.tsx +357 -0
  107. package/src/components/Image/Image.tsx +168 -0
  108. package/src/components/Image/index.ts +2 -0
  109. package/src/components/Input/Input.stories.tsx +164 -0
  110. package/src/components/Input/Input.tsx +274 -0
  111. package/src/components/Input/index.ts +2 -0
  112. package/src/components/Link/Link.stories.tsx +187 -0
  113. package/src/components/Link/Link.tsx +104 -0
  114. package/src/components/Link/index.ts +2 -0
  115. package/src/components/Menu/Menu.stories.tsx +363 -0
  116. package/src/components/Menu/Menu.tsx +238 -0
  117. package/src/components/Menu/index.ts +2 -0
  118. package/src/components/Modal/Modal.stories.tsx +156 -0
  119. package/src/components/Modal/Modal.tsx +280 -0
  120. package/src/components/Modal/index.ts +11 -0
  121. package/src/components/Popover/Popover.stories.tsx +330 -0
  122. package/src/components/Popover/Popover.tsx +315 -0
  123. package/src/components/Popover/index.ts +11 -0
  124. package/src/components/Portal/Portal.stories.tsx +376 -0
  125. package/src/components/Portal/Portal.tsx +100 -0
  126. package/src/components/Portal/index.ts +2 -0
  127. package/src/components/Pressable/Pressable.stories.tsx +338 -0
  128. package/src/components/Pressable/Pressable.tsx +71 -0
  129. package/src/components/Pressable/index.ts +2 -0
  130. package/src/components/Progress/Progress.stories.tsx +131 -0
  131. package/src/components/Progress/Progress.tsx +219 -0
  132. package/src/components/Progress/index.ts +2 -0
  133. package/src/components/Radio/Radio.stories.tsx +101 -0
  134. package/src/components/Radio/Radio.tsx +234 -0
  135. package/src/components/Radio/index.ts +2 -0
  136. package/src/components/Select/Select.stories.tsx +908 -0
  137. package/src/components/Select/Select.tsx +659 -0
  138. package/src/components/Select/index.ts +8 -0
  139. package/src/components/Skeleton/Skeleton.stories.tsx +154 -0
  140. package/src/components/Skeleton/Skeleton.tsx +192 -0
  141. package/src/components/Skeleton/index.ts +8 -0
  142. package/src/components/Slider/Slider.stories.tsx +363 -0
  143. package/src/components/Slider/Slider.tsx +209 -0
  144. package/src/components/Slider/index.ts +2 -0
  145. package/src/components/Spinner/Spinner.stories.tsx +108 -0
  146. package/src/components/Spinner/Spinner.tsx +121 -0
  147. package/src/components/Spinner/index.ts +2 -0
  148. package/src/components/Switch/Switch.stories.tsx +116 -0
  149. package/src/components/Switch/Switch.tsx +172 -0
  150. package/src/components/Switch/index.ts +2 -0
  151. package/src/components/Table/Table.stories.tsx +417 -0
  152. package/src/components/Table/Table.tsx +233 -0
  153. package/src/components/Table/index.ts +2 -0
  154. package/src/components/Text/Text.stories.tsx +93 -0
  155. package/src/components/Text/Text.tsx +119 -0
  156. package/src/components/Text/index.ts +2 -0
  157. package/src/components/Textarea/Textarea.stories.tsx +280 -0
  158. package/src/components/Textarea/Textarea.tsx +212 -0
  159. package/src/components/Textarea/index.ts +2 -0
  160. package/src/components/Toast/Toast.stories.tsx +446 -0
  161. package/src/components/Toast/Toast.tsx +221 -0
  162. package/src/components/Toast/index.ts +2 -0
  163. package/src/components/Tooltip/Tooltip.stories.tsx +354 -0
  164. package/src/components/Tooltip/Tooltip.tsx +261 -0
  165. package/src/components/Tooltip/index.ts +2 -0
  166. package/src/components/VStack/VStack.stories.tsx +183 -0
  167. package/src/components/VStack/VStack.tsx +76 -0
  168. package/src/components/VStack/index.ts +2 -0
  169. package/src/components/index.ts +62 -0
  170. package/src/hooks/index.ts +7 -0
  171. package/src/hooks/useControllableState.ts +41 -0
  172. package/src/hooks/useDisclosure.ts +51 -0
  173. package/src/index.ts +22 -0
  174. package/src/stories/Button.stories.tsx +53 -0
  175. package/src/stories/Button.tsx +101 -0
  176. package/src/stories/Configure.mdx +364 -0
  177. package/src/stories/Header.stories.tsx +33 -0
  178. package/src/stories/Header.tsx +75 -0
  179. package/src/stories/Page.stories.tsx +25 -0
  180. package/src/stories/Page.tsx +154 -0
  181. package/src/stories/assets/accessibility.png +0 -0
  182. package/src/stories/assets/accessibility.svg +1 -0
  183. package/src/stories/assets/addon-library.png +0 -0
  184. package/src/stories/assets/assets.png +0 -0
  185. package/src/stories/assets/avif-test-image.avif +0 -0
  186. package/src/stories/assets/context.png +0 -0
  187. package/src/stories/assets/discord.svg +1 -0
  188. package/src/stories/assets/docs.png +0 -0
  189. package/src/stories/assets/figma-plugin.png +0 -0
  190. package/src/stories/assets/github.svg +1 -0
  191. package/src/stories/assets/share.png +0 -0
  192. package/src/stories/assets/styling.png +0 -0
  193. package/src/stories/assets/testing.png +0 -0
  194. package/src/stories/assets/theming.png +0 -0
  195. package/src/stories/assets/tutorials.svg +1 -0
  196. package/src/stories/assets/youtube.svg +1 -0
  197. package/src/styles/index.ts +7 -0
  198. package/src/styles/tokens.ts +318 -0
  199. package/src/styles/unistyles.ts +254 -0
  200. package/src/utils/createContext.tsx +25 -0
  201. package/src/utils/index.ts +7 -0
  202. package/src/utils/mergeRefs.ts +21 -0
  203. package/tsconfig.json +26 -0
  204. package/urbint-cl-1.0.0.tgz +0 -0
  205. package/vitest.config.ts +37 -0
  206. package/vitest.shims.d.ts +1 -0
package/.cursor/rules ADDED
@@ -0,0 +1,313 @@
1
+ # Cursor Rules – Cross-Platform React Native Component Library
2
+ ## Using Unistyles + Storybook (Web, iOS, Android)
3
+
4
+ ---
5
+
6
+ ## 1. Project Scope & Intent
7
+
8
+ This repository is a **shared UI component library** used across:
9
+
10
+ - React Native (iOS)
11
+ - React Native (Android)
12
+ - React Native Web
13
+
14
+ The library must be:
15
+
16
+ - Theme-driven
17
+ - Platform-agnostic
18
+ - Accessible
19
+ - Performant
20
+ - Strictly typed
21
+ - Reusable across multiple apps
22
+
23
+ Cursor must **not** introduce app-specific logic.
24
+
25
+ ---
26
+
27
+ ## 2. Tech Stack (Non-Negotiable)
28
+
29
+ Cursor must assume and follow:
30
+
31
+ - React Native
32
+ - TypeScript (strict mode)
33
+ - react-native-unistyles
34
+ - react-native-web compatibility
35
+ - Storybook (React Native + Web)
36
+
37
+ Explicitly forbidden:
38
+
39
+ - Inline styles
40
+ - StyleSheet.create
41
+ - Tailwind / CSS-in-JS alternatives
42
+ - Zustand / Redux
43
+ - Side effects (analytics, storage, API calls)
44
+
45
+ ---
46
+
47
+ ## 3. Folder & Naming Conventions
48
+
49
+ ### Component Structure
50
+ components/
51
+ - Button/
52
+ Button.tsx
53
+ Button.styles.ts
54
+ Button.types.ts
55
+ Button.stories.tsx
56
+ index.ts
57
+
58
+
59
+ ### Rules
60
+
61
+ - One component per folder
62
+ - Logic, styles, and types must be separated
63
+ - Barrel export (`index.ts`) is mandatory
64
+ - Filenames must match component name
65
+ - Component names must be PascalCase
66
+
67
+ ---
68
+
69
+ ## 4. Component Authoring Rules
70
+
71
+ ### Design Principles
72
+
73
+ Components must be:
74
+
75
+ - Pure
76
+ - Stateless unless unavoidable
77
+ - Controlled via props
78
+ - Deterministic and predictable
79
+
80
+ Forbidden:
81
+
82
+ - Business logic
83
+ - Navigation
84
+ - Analytics
85
+ - API calls
86
+ - App-specific assumptions
87
+
88
+ ---
89
+
90
+ ## 5. Styling Rules (Unistyles)
91
+
92
+ ### Mandatory Pattern
93
+
94
+ ```ts
95
+ import { createStyleSheet } from 'react-native-unistyles';
96
+
97
+ export const stylesheet = createStyleSheet(theme => ({
98
+ container: {
99
+ paddingVertical: theme.spacing.sm,
100
+ paddingHorizontal: theme.spacing.md,
101
+ borderRadius: theme.radius.md,
102
+ },
103
+ text: {
104
+ color: theme.colors.text.primary,
105
+ fontSize: theme.typography.body.fontSize,
106
+ },
107
+ }));
108
+
109
+ Usage
110
+
111
+ const { styles } = useStyles(stylesheet);
112
+
113
+ Rules
114
+ • ❌ No inline styles
115
+ • ❌ No StyleSheet.create
116
+ • ❌ No hardcoded values
117
+ • ✅ Use semantic tokens from theme
118
+ • ✅ Support light & dark themes automatically
119
+
120
+
121
+ 6. Theme Contract Assumptions
122
+
123
+ Cursor must assume these theme keys exist:
124
+
125
+ theme.colors
126
+ theme.spacing
127
+ theme.radius
128
+ theme.typography
129
+ theme.shadows
130
+ theme.zIndex
131
+
132
+ Rules:
133
+ • Do not invent new tokens casually
134
+ • Prefer semantic tokens over raw intent
135
+ • Components must work with any theme
136
+
137
+
138
+ 7. Props & Type Rules
139
+
140
+ export interface ButtonProps {
141
+ label: string;
142
+ variant?: 'primary' | 'secondary' | 'ghost';
143
+ size?: 'sm' | 'md' | 'lg';
144
+ disabled?: boolean;
145
+ onPress?: () => void;
146
+ }
147
+
148
+ Rules:
149
+ • No any
150
+ • Explicit props only
151
+ • Optional props must have defaults
152
+ • Use discriminated unions when behavior differs
153
+ • Avoid extending native props unless necessary
154
+
155
+
156
+ 8. Accessibility (Mandatory)
157
+
158
+ Every interactive component must:
159
+ • Support accessibilityLabel
160
+ • Define accessibilityRole
161
+ • Respect font scaling
162
+ • Respect reduced motion preferences
163
+ • Use Pressable instead of Touchable*
164
+
165
+ Accessibility is not optional.
166
+
167
+
168
+ 9. Platform Compatibility Rules
169
+
170
+ Components must:
171
+ • Work on iOS, Android, and Web
172
+ • Avoid DOM-only APIs
173
+ • Avoid native-only APIs
174
+ • Use Platform.select() only when unavoidable
175
+
176
+ No pixel-perfect assumptions.
177
+
178
+
179
+ 10. Performance Rules
180
+ • Avoid anonymous functions in render
181
+ • Use memo where appropriate
182
+ • No heavy calculations during render
183
+ • No unnecessary re-renders
184
+
185
+ 11. Storybook (Mandatory)
186
+
187
+ Storybook is the source of truth for:
188
+ • Visual validation
189
+ • Theme coverage
190
+ • Accessibility review
191
+ • Cross-platform parity
192
+
193
+ Every component must include a story.
194
+
195
+ 13. Storybook Stack Assumptions
196
+
197
+ Cursor must assume:
198
+ • @storybook/react-native
199
+ • @storybook/react (for web)
200
+ • TypeScript stories
201
+ • CSF (Component Story Format)
202
+
203
+
204
+ 14. Story Placement
205
+
206
+ Stories must be co-located with components:
207
+ components/Button/Button.stories.tsx
208
+ No global stories folder.
209
+
210
+ 15. Story Format (Required)
211
+
212
+ import type { Meta, StoryObj } from '@storybook/react';
213
+ import { Button } from './Button';
214
+
215
+ const meta: Meta<typeof Button> = {
216
+ title: 'Components/Button',
217
+ component: Button,
218
+ argTypes: {
219
+ onPress: { action: 'pressed' },
220
+ },
221
+ };
222
+
223
+ export default meta;
224
+
225
+ type Story = StoryObj<typeof Button>;
226
+
227
+ export const Primary: Story = {
228
+ args: {
229
+ label: 'Primary Button',
230
+ variant: 'primary',
231
+ },
232
+ };
233
+
234
+ Rules:
235
+ • Use args, not inline JSX
236
+ • No anonymous components
237
+ • No logic inside stories
238
+
239
+
240
+
241
+ 16. Theme Integration in Storybook
242
+
243
+ Storybook must use a theme decorator:
244
+
245
+ <UnistylesThemeProvider theme="light">
246
+ <Story />
247
+ </UnistylesThemeProvider>
248
+ Rules:
249
+ • All stories must render in light & dark themes
250
+ • No hardcoded colors
251
+ • Prefer toolbar theme switching
252
+
253
+
254
+ 17. Story Coverage Requirements
255
+
256
+ Each component must include stories for:
257
+ • Default state
258
+ • All variants
259
+ • Disabled state
260
+ • Edge cases (long text, overflow)
261
+ • Interaction states
262
+
263
+
264
+
265
+ 18. Controls & Actions
266
+ • All public props must be exposed via args
267
+ • Use Storybook actions for callbacks
268
+ • No console logging
269
+
270
+ 19. Accessibility in Storybook
271
+
272
+ Stories must:
273
+ • Include accessible labels
274
+ • Be keyboard navigable on web
275
+ • Avoid visual-only meaning
276
+
277
+ Optional:
278
+ • @storybook/addon-a11y
279
+
280
+
281
+
282
+ 20. Cross-Platform Story Rules
283
+
284
+ Stories must:
285
+ • Render on iOS, Android, and Web
286
+ • Avoid platform-specific hacks
287
+ • Avoid DOM APIs
288
+
289
+ 21. Documentation Stories (Preferred)
290
+
291
+ Core components should include documentation stories using Storybook Docs.
292
+
293
+
294
+
295
+ 22. What Cursor Must NEVER Do
296
+
297
+ ❌ Add navigation
298
+ ❌ Add analytics
299
+ ❌ Add API calls
300
+ ❌ Add state management
301
+ ❌ Hardcode styles
302
+ ❌ Skip Storybook
303
+ ❌ Break web compatibility
304
+
305
+ 23. Quality Gate Before Completion
306
+
307
+ Cursor must verify:
308
+ • TypeScript passes
309
+ • Component renders on web
310
+ • Theme-driven styling
311
+ • Accessibility compliance
312
+ • Storybook coverage exists
313
+ • Clean public exports
@@ -0,0 +1,11 @@
1
+ import AsyncStorage from '@react-native-async-storage/async-storage';
2
+ import { view } from './storybook.requires';
3
+
4
+ const StorybookUIRoot = view.getStorybookUI({
5
+ storage: {
6
+ getItem: AsyncStorage.getItem,
7
+ setItem: AsyncStorage.setItem,
8
+ },
9
+ });
10
+
11
+ export default StorybookUIRoot;
@@ -0,0 +1,8 @@
1
+ import type { StorybookConfig } from '@storybook/react-native';
2
+
3
+ const main: StorybookConfig = {
4
+ stories: ['./stories/**/*.stories.?(ts|tsx|js|jsx)'],
5
+ addons: ['@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-actions'],
6
+ };
7
+
8
+ export default main;
@@ -0,0 +1,14 @@
1
+ import type { Preview } from '@storybook/react-native';
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/,
9
+ },
10
+ },
11
+ },
12
+ };
13
+
14
+ export default preview;
@@ -0,0 +1,49 @@
1
+ /* do not change this file, it is auto generated by storybook. */
2
+
3
+ import { start, updateView } from '@storybook/react-native';
4
+
5
+ import '@storybook/addon-ondevice-controls/register';
6
+ import '@storybook/addon-ondevice-actions/register';
7
+
8
+ const normalizedStories = [
9
+ {
10
+ titlePrefix: '',
11
+ directory: './.rnstorybook/stories',
12
+ files: '**/*.stories.?(ts|tsx|js|jsx)',
13
+ importPathMatcher:
14
+ /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
15
+ // @ts-ignore
16
+ req: require.context(
17
+ './stories',
18
+ true,
19
+ /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
20
+ ),
21
+ },
22
+ ];
23
+
24
+ declare global {
25
+ var view: ReturnType<typeof start>;
26
+ var STORIES: typeof normalizedStories;
27
+ }
28
+
29
+ const annotations = [
30
+ require('./preview'),
31
+ require('@storybook/react-native/dist/preview'),
32
+ require('@storybook/addon-ondevice-actions/preview'),
33
+ ];
34
+
35
+ global.STORIES = normalizedStories;
36
+
37
+ // @ts-ignore
38
+ module?.hot?.accept?.();
39
+
40
+ if (!global.view) {
41
+ global.view = start({
42
+ annotations,
43
+ storyEntries: normalizedStories,
44
+ });
45
+ } else {
46
+ updateView(global.view, annotations, normalizedStories);
47
+ }
48
+
49
+ export const view = global.view;
@@ -0,0 +1,16 @@
1
+ import type { StorybookConfig } from '@storybook/react-native-web-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ "stories": [
5
+ "../src/**/*.mdx",
6
+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
7
+ ],
8
+ "addons": [
9
+ "@chromatic-com/storybook",
10
+ "@storybook/addon-vitest",
11
+ "@storybook/addon-a11y",
12
+ "@storybook/addon-docs"
13
+ ],
14
+ "framework": "@storybook/react-native-web-vite"
15
+ };
16
+ export default config;
@@ -0,0 +1,32 @@
1
+ import type { Preview } from '@storybook/react-native-web-vite';
2
+
3
+ // Import Unistyles configuration - this is required for styled components
4
+ import '../src/styles/unistyles';
5
+
6
+ const preview: Preview = {
7
+ parameters: {
8
+ controls: {
9
+ matchers: {
10
+ color: /(background|color)$/i,
11
+ date: /Date$/i,
12
+ },
13
+ },
14
+ a11y: {
15
+ // 'todo' - show a11y violations in the test UI only
16
+ // 'error' - fail CI on a11y violations
17
+ // 'off' - skip a11y checks entirely
18
+ test: 'todo',
19
+ },
20
+ layout: 'centered',
21
+ backgrounds: {
22
+ default: 'light',
23
+ values: [
24
+ { name: 'light', value: '#ffffff' },
25
+ { name: 'dark', value: '#1a1a2e' },
26
+ { name: 'gray', value: '#f5f5f5' },
27
+ ],
28
+ },
29
+ },
30
+ };
31
+
32
+ export default preview;
@@ -0,0 +1,7 @@
1
+ import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
2
+ import { setProjectAnnotations } from '@storybook/react-native-web-vite';
3
+ import * as projectAnnotations from './preview';
4
+
5
+ // This is an important step to apply the right configuration when testing your stories.
6
+ // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
7
+ setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);