Repository navigation
Expand file tree
/
Copy pathui-layer.todo
More file actions
227 lines (202 loc) · 6.31 KB
/
Copy pathui-layer.todo
File metadata and controls
227 lines (202 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# UI Layer Organization
## Particles (Invisible Components)
- [ ] ErrorBoundary
- [ ] Unit tests with Vitest
- [ ] Integration tests with Testing Library
- [ ] Suspense
- [ ] Unit tests for loading states
- [ ] Integration tests for async behavior
- [ ] VirtualList
- [ ] Performance tests
- [ ] Scroll behavior tests
- [ ] IntersectionObserver
- [ ] Mock intersection events tests
- [ ] Integration with real DOM
- [ ] Portal
- [ ] DOM manipulation tests
- [ ] Event bubbling tests
## Atoms
- [ ] Button
- [ ] Unit tests for all variants
- [ ] A11y tests with Testing Library
- [ ] Visual regression tests with Playwright
- [ ] Input
- [ ] Form integration tests
- [ ] Validation behavior tests
- [ ] A11y keyboard tests
- [ ] Icon
- [ ] Visual tests
- [ ] Loading tests
- [ ] Typography
- [ ] Visual consistency tests
- [ ] Responsive behavior tests
- [ ] Spinner
- [ ] Animation tests
- [ ] Loading state integration
## Molecules
- [ ] Form Fields
- [ ] Complex validation tests
- [ ] Error state tests
- [ ] Integration with form libraries
- [ ] SearchBar
- [ ] Debounce tests
- [ ] Results rendering tests
- [ ] Keyboard navigation tests
- [ ] Dropdown
- [ ] Click outside tests
- [ ] Keyboard navigation
- [ ] A11y compliance tests
- [ ] Card
- [ ] Layout tests
- [ ] Responsive tests
- [ ] Modal
- [ ] Focus trap tests
- [ ] Keyboard escape tests
- [ ] Animation tests
## Organisms
- [ ] Forms
- [ ] E2E submission tests
- [ ] Error handling tests
- [ ] Success flow tests
- [ ] Navigation
- [ ] Route change tests
- [ ] Active state tests
- [ ] Mobile menu tests
- [ ] DataTable
- [ ] Sorting tests
- [ ] Filtering tests
- [ ] Pagination tests
- [ ] Performance tests
- [ ] FileUploader
- [ ] Upload flow E2E tests
- [ ] Error handling tests
- [ ] Progress indicator tests
- [ ] Charts
- [ ] Data rendering tests
- [ ] Interaction tests
- [ ] Responsive behavior tests
## Templates
- [ ] AuthLayout
- [ ] Layout tests
- [ ] Responsive tests
- [ ] Integration tests
- [ ] DashboardLayout
- [ ] Navigation integration
- [ ] Sidebar behavior
- [ ] Mobile layout tests
- [ ] SettingsLayout
- [ ] Form integration
- [ ] Navigation tests
## Features (Feature-Sliced)
### Auth
- [ ] SignIn
- [ ] E2E happy path
- [ ] Error scenarios
- [ ] Rate limiting tests
- [ ] SignUp
- [ ] Form validation E2E
- [ ] Success flow
- [ ] Error handling
- [ ] PasswordReset
- [ ] Email flow tests
- [ ] Token validation
- [ ] Security tests
### Dashboard
- [ ] Overview
- [ ] Data loading tests
- [ ] Widget integration
- [ ] Analytics
- [ ] Chart rendering
- [ ] Data accuracy tests
- [ ] Reports
- [ ] Export functionality
- [ ] Filter tests
### Settings
- [ ] Profile
- [ ] Update flow E2E
- [ ] Image upload tests
- [ ] Preferences
- [ ] Save/Load tests
- [ ] Theme switching
- [ ] Security
- [ ] 2FA flow tests
- [ ] Password change
## Shared
### UI Kit
- [ ] Theme Provider
- [ ] Theme switching tests
- [ ] SSR tests
- [ ] Toast System
- [ ] Multiple toasts tests
- [ ] Animation tests
- [ ] Dialog System
- [ ] Stack management tests
- [ ] A11y tests
### Hooks
- [ ] useForm
- [ ] Validation tests
- [ ] Submit handling
- [ ] useQuery
- [ ] Cache tests
- [ ] Error handling
- [ ] useIntersection
- [ ] Threshold tests
- [ ] Cleanup tests
### Utils
- [ ] Validation
- [ ] Unit tests for all rules
- [ ] Formatting
- [ ] Edge cases
- [ ] Locale tests
- [ ] Testing Utils
- [ ] Mock function tests
- [ ] Helper utilities tests
## Test Coverage Requirements
- [ ] Unit Tests (Vitest)
- [ ] 100% coverage for utils
- [ ] Component logic coverage
- [ ] Hook implementation tests
- [ ] Integration Tests (Testing Library)
- [ ] Component interaction tests
- [ ] User event simulation
- [ ] A11y compliance
- [ ] E2E Tests (Playwright)
- [ ] Critical user flows
- [ ] Cross-browser testing
- [ ] Visual regression
- [ ] Performance metrics
Lets implement UI layer.
For that - lets create a ui lib in root /libs folder.
We want to use shadcn components.
We will have components for
- web - to be used in NextJS
- mobile - to be used in Expo
We will generate expo/react native components based on shadcn and make sure thay stay in sync.
We might use Solarwind - to use tailwind styles in expo/react native.
We might move logic to custom hooks - and reuse them for web and mobile versions of components.
UI components should:
- support light and dark theme
- support i18n
- support accessibility
- have read-only, disabled, loading state - where appropriate (including cursor hover states)
- should support success / failure / waring / info states - where appropriate
- should support skeleton loading (on initial loading/mounting) and loading indicators (spinner)
- should support error boudaties and lazy loading - where appropriate
We need to setup storybook for both web and mobile components.
We can have root/global configs common for both web and mobile - and then extend them to add specific congiguratins.
For storybook we want to be able to
- change theme (light/dark)
- see i18n, a11y, etc configs
- show component in different states (loading, success, error, etc)
UI components should follow atomic design principles:
- use atomic design to create reusable components
- use composition to create complex components
- use props to create configurable components
- use hooks to create reusable components
- in addition to atomic design - atoms, molecules, organisns, templates and pages - we gonna have particles - components, that are not visible to the user, but include some helper logic - like error boundaries, virtual lists, etc.
At any cost - try to keep original shadcn components untouched - create wrappers around them when possible.
Since we are using nx monorepo, and we can import from libs/packages to apps, but we can't import from apps/packages to libs, we might want to have NextJS and Expo configs in libs folder - and them import (and extend if nececary) in /apps folder.
We might want to move all configs to libs
- for tailwind (to be reused in web and mobile, maybe later for desktop app, browser extentions, emails [using resend], etc.)
- vitest and vite configs - so we have one core/base setup that we can import and extend if nececary
- eslint - same as for vitest and vite - to have one core/base setup