create-tigra 2.1.2 → 2.1.3
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/package.json
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Design System
|
|
4
4
|
|
|
5
|
-
## Philosophy: "Neuro-Minimalism"
|
|
5
|
+
## Philosophy: "Mobile-First Neuro-Minimalism"
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Mobile is the default. Desktop is the enhancement.** 80%+ of traffic is mobile — design for thumbs first, cursors second.
|
|
8
|
+
|
|
9
|
+
Clean, airy, "expensive" look inspired by Linear, Vercel, Stripe, Arc. Every visual decision reduces cognitive load. Every screen must feel like a native app on mobile.
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
@@ -67,6 +69,34 @@ This project uses **Tailwind CSS v4** with **OKLCH color space** and the `@theme
|
|
|
67
69
|
- `@custom-variant dark` replaces `darkMode: 'class'`
|
|
68
70
|
- No `@layer base { :root { } }` — variables defined directly on `:root`
|
|
69
71
|
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Mobile-First Responsive Strategy
|
|
75
|
+
|
|
76
|
+
**All Tailwind utilities are written for mobile first.** `md:` and `lg:` are progressive enhancements, not the other way around.
|
|
77
|
+
|
|
78
|
+
### Rules
|
|
79
|
+
|
|
80
|
+
1. **Write mobile styles as the base.** Add `md:` / `lg:` to override for larger screens. Never use `max-*:` breakpoints.
|
|
81
|
+
2. **Breakpoints**: `sm:` (640px) → `md:` (768px) → `lg:` (1024px) → `xl:` (1280px). Scale UP, never down.
|
|
82
|
+
3. **Test mobile first** during development. Open DevTools at 375px before checking desktop.
|
|
83
|
+
4. **Every screen must be fully usable at 375px width.** No horizontal scroll, no truncated actions, no hidden critical UI.
|
|
84
|
+
|
|
85
|
+
### Viewport & Safe Areas
|
|
86
|
+
|
|
87
|
+
- **Use `dvh` instead of `vh`** for full-height layouts — accounts for mobile browser chrome (URL bar, bottom bar).
|
|
88
|
+
- **Viewport meta**: `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`.
|
|
89
|
+
- **Respect safe areas** on notched/dynamic island devices:
|
|
90
|
+
- Bottom-fixed elements: add `pb-[env(safe-area-inset-bottom)]`
|
|
91
|
+
- Top-fixed elements: add `pt-[env(safe-area-inset-top)]`
|
|
92
|
+
- **No `100vh` anywhere.** Always `100dvh` or `min-h-dvh`.
|
|
93
|
+
|
|
94
|
+
### Anti-patterns
|
|
95
|
+
|
|
96
|
+
- Do NOT write desktop-first classes like `w-1/3 max-md:w-full`. Write `w-full md:w-1/3`.
|
|
97
|
+
- Do NOT hide mobile-critical content behind `hidden md:block`. Content strategy must work on mobile first.
|
|
98
|
+
- Do NOT use fixed pixel widths. Use `w-full`, percentage-based, or `max-w-*` utilities.
|
|
99
|
+
|
|
70
100
|
## Color Usage
|
|
71
101
|
|
|
72
102
|
| Token | Purpose | Example use |
|
|
@@ -109,34 +139,41 @@ This project uses **Tailwind CSS v4** with **OKLCH color space** and the `@theme
|
|
|
109
139
|
## Typography
|
|
110
140
|
|
|
111
141
|
- **Font**: Inter v4 (variable) or Geist Sans via `next/font`.
|
|
112
|
-
- **Headings**: `text-wrap: balance`, `leading-tight`.
|
|
142
|
+
- **Headings**: `text-wrap: balance`, `leading-tight`. Mobile-first responsive sizes:
|
|
143
|
+
- H1: `text-2xl md:text-3xl lg:text-4xl`
|
|
144
|
+
- H2: `text-xl md:text-2xl`
|
|
145
|
+
- H3: `text-lg md:text-xl`
|
|
113
146
|
- **Body**: `text-base`, `leading-relaxed`. Max reading width: `max-w-prose` (~65ch).
|
|
114
147
|
- **Data/numbers**: Always `tabular-nums` for alignment.
|
|
115
148
|
- **Captions/meta**: `text-sm text-muted-foreground`.
|
|
149
|
+
- **Mobile readability**: Minimum `text-sm` (14px) for any readable text. Never go below 12px.
|
|
116
150
|
|
|
117
151
|
---
|
|
118
152
|
|
|
119
153
|
## Spacing
|
|
120
154
|
|
|
121
155
|
- **Whitespace IS the divider.** Prefer spacing over visible borders/lines.
|
|
122
|
-
- **Section gap = 2x internal gap**: `space-y-16` between sections, `space-y-6` within.
|
|
156
|
+
- **Section gap = 2x internal gap**: Mobile: `space-y-10` between sections, `space-y-4` within. Desktop: `space-y-16` between sections, `space-y-6` within.
|
|
123
157
|
- **Stick to scale**: `4, 6, 8, 12, 16, 20, 24` from Tailwind. Avoid arbitrary values.
|
|
124
|
-
- **Container**: `container mx-auto px-4
|
|
158
|
+
- **Container**: `container mx-auto px-4 sm:px-6 lg:px-8` (mobile gets comfortable 16px padding).
|
|
125
159
|
|
|
126
160
|
---
|
|
127
161
|
|
|
128
162
|
## Motion & Interactions
|
|
129
163
|
|
|
130
|
-
Every interactive element MUST have visible `:
|
|
164
|
+
Every interactive element MUST have visible `:active` and `:focus-visible` states. `:hover` is a desktop enhancement — never the only feedback.
|
|
131
165
|
|
|
132
|
-
### Standard Patterns
|
|
166
|
+
### Standard Patterns (Mobile-First)
|
|
133
167
|
```
|
|
134
|
-
Button: transition-all duration-200 ease-out
|
|
135
|
-
Card: transition-all duration-300 ease-out hover:shadow-lg hover:-translate-y-0.5
|
|
136
|
-
Link: transition-colors duration-150 hover:text-primary
|
|
168
|
+
Button: transition-all duration-200 ease-out active:scale-[0.97] md:hover:brightness-110
|
|
169
|
+
Card: transition-all duration-300 ease-out active:scale-[0.98] md:hover:shadow-lg md:hover:-translate-y-0.5
|
|
170
|
+
Link: transition-colors duration-150 active:opacity-70 md:hover:text-primary
|
|
137
171
|
```
|
|
138
172
|
|
|
139
173
|
### Rules
|
|
174
|
+
- **`active:` is the primary feedback** on mobile. Tap must feel instant and responsive.
|
|
175
|
+
- **`hover:` is desktop-only** — always prefix with `md:hover:` to avoid sticky hover on touch devices.
|
|
176
|
+
- **No hover-gated functionality**: Anything revealed on hover (tooltips, menus) MUST have a tap/click alternative.
|
|
140
177
|
- **Transform + opacity only** — never animate layout properties (`width`, `height`, `top`).
|
|
141
178
|
- **Respect `prefers-reduced-motion`**: Use `motion-safe:` / `motion-reduce:` variants.
|
|
142
179
|
- **Motion budget**: Max 2-3 animated elements in viewport at once.
|
|
@@ -144,6 +181,45 @@ Link: transition-colors duration-150 hover:text-primary
|
|
|
144
181
|
|
|
145
182
|
---
|
|
146
183
|
|
|
184
|
+
## Touch & Interaction Design
|
|
185
|
+
|
|
186
|
+
### Touch Targets
|
|
187
|
+
|
|
188
|
+
- **Minimum size**: 44x44px (`min-h-11 min-w-11`). Recommended: 48x48px (`min-h-12 min-w-12`).
|
|
189
|
+
- **Spacing between targets**: Minimum 8px gap to prevent mis-taps.
|
|
190
|
+
- **Icon-only buttons**: Use `p-2.5` or `p-3` to ensure the tap area is large enough even if the icon is small.
|
|
191
|
+
- **Inline links in text**: Add `py-1` for vertical tap padding without affecting line height visually.
|
|
192
|
+
|
|
193
|
+
### Thumb Zone Design
|
|
194
|
+
|
|
195
|
+
- **Primary actions in the bottom third** of the screen — thumbs naturally rest there.
|
|
196
|
+
- **Avoid top corners** for critical interactive elements (hardest to reach one-handed).
|
|
197
|
+
- **Sticky bottom CTAs**: Primary action buttons stick to bottom of viewport on mobile: `sticky bottom-0 pb-[env(safe-area-inset-bottom)]`.
|
|
198
|
+
- **FABs (Floating Action Buttons)**: Position `bottom-6 right-4` for primary creation actions.
|
|
199
|
+
|
|
200
|
+
### Gesture Support
|
|
201
|
+
|
|
202
|
+
- **Swipe-to-dismiss** on bottom sheets and drawers (use Vaul / shadcn Drawer).
|
|
203
|
+
- **Pull-to-refresh** where contextually appropriate (feed pages, lists).
|
|
204
|
+
- **Swipe actions on list items** for quick actions (archive, delete) — use sparingly, always with undo.
|
|
205
|
+
- **Pinch-to-zoom** on images and maps — never disable native zoom.
|
|
206
|
+
|
|
207
|
+
### Mobile Navigation Patterns
|
|
208
|
+
|
|
209
|
+
| Nav items | Mobile pattern | Desktop pattern |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| 2-5 core routes | **Bottom tab bar** (sticky, always visible) | Top horizontal nav |
|
|
212
|
+
| 6+ routes | Bottom tab bar (4 items + "More") | Sidebar or top nav with dropdowns |
|
|
213
|
+
| Contextual actions | **Bottom sheet** (Drawer component) | Dropdown menu or popover |
|
|
214
|
+
| Filters/settings | Full-screen sheet or slide-over panel | Side panel or modal |
|
|
215
|
+
|
|
216
|
+
- **Bottom nav is the default** on mobile. Top nav on `md:` and above.
|
|
217
|
+
- **Bottom sheets over modals** for contextual actions on mobile — they're within thumb reach and feel native.
|
|
218
|
+
- **Sticky action bars**: Form submit buttons, checkout CTAs — `sticky bottom-0` on mobile.
|
|
219
|
+
- **No hamburger menus** for ≤5 items. Use bottom tab bar instead.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
147
223
|
## Images
|
|
148
224
|
|
|
149
225
|
- **Format priority**: AVIF > WebP > JPEG (Next.js `<Image>` handles this).
|
|
@@ -170,10 +246,12 @@ Link: transition-colors duration-150 hover:text-primary
|
|
|
170
246
|
|
|
171
247
|
## Component Visual Patterns
|
|
172
248
|
|
|
173
|
-
- **Cards**: `rounded-xl border border-border/50 bg-card shadow-sm transition-all duration-300 hover:shadow-md hover:-translate-y-0.5`
|
|
249
|
+
- **Cards**: `rounded-xl border border-border/50 bg-card shadow-sm transition-all duration-300 active:scale-[0.98] md:hover:shadow-md md:hover:-translate-y-0.5`
|
|
174
250
|
- **Empty states**: Centered, muted icon, 2-line text max, one clear CTA.
|
|
175
251
|
- **Loading**: Skeleton loaders matching content shape. Show immediately, no delay.
|
|
176
|
-
- **Modals**: Max `max-w-lg`. Dismissible with Escape + backdrop click. Glassmorphism backdrop.
|
|
252
|
+
- **Modals (desktop)**: Max `max-w-lg`. Dismissible with Escape + backdrop click. Glassmorphism backdrop.
|
|
253
|
+
- **Bottom sheets (mobile)**: Prefer over centered modals on mobile. Use shadcn Drawer (Vaul). Swipe-down to dismiss. Max 70% viewport height for partial sheets. Respect `pb-[env(safe-area-inset-bottom)]`.
|
|
254
|
+
- **Lists**: Full-width on mobile (no horizontal padding on list items — let them bleed to edges for native feel). Add dividers with `border-b border-border/50`.
|
|
177
255
|
|
|
178
256
|
---
|
|
179
257
|
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
# Neuro-UX Checklist
|
|
4
4
|
|
|
5
|
+
## Mobile-First UX
|
|
6
|
+
|
|
7
|
+
**80%+ of traffic is mobile. Design for thumbs, not cursors. Every screen must feel like a native app.**
|
|
8
|
+
|
|
9
|
+
- Every screen must be fully usable on a 375px viewport. No exceptions.
|
|
10
|
+
- **One-handed reachability**: critical actions in the thumb zone (bottom 60% of screen).
|
|
11
|
+
- **App-like feel**: smooth transitions between views, no full-page flash reloads, instant feedback on every tap.
|
|
12
|
+
- **Content above the fold**: the most important action or information visible without scrolling on mobile.
|
|
13
|
+
- **Reduce input friction**: use native input types (`type="tel"`, `type="email"`, `inputMode="numeric"`), autofill, and smart defaults.
|
|
14
|
+
- **Scroll is natural**: long pages are fine on mobile — vertical scroll is free. Horizontal scroll is forbidden.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
5
18
|
## Cognitive Load — Miller's Law
|
|
6
19
|
|
|
7
20
|
- **Max 5-7 interactive elements** per viewport section. Use progressive disclosure (tabs, accordions, "Show more") for more.
|
|
@@ -17,38 +30,45 @@
|
|
|
17
30
|
|
|
18
31
|
| User action | Required feedback | Timing |
|
|
19
32
|
|---|---|---|
|
|
20
|
-
|
|
|
33
|
+
| Tap interactive | Press state (`active:scale-[0.97]`) | Instant |
|
|
34
|
+
| Tap button | Press state + ripple or scale | Instant |
|
|
21
35
|
| Submit form | Loading state on button + disable | Instant |
|
|
22
36
|
| Successful action | Toast notification | <500ms |
|
|
23
37
|
| Failed action | Inline error OR toast | <500ms |
|
|
24
|
-
| Navigate | Skeleton or page transition | Instant |
|
|
25
|
-
|
|
|
38
|
+
| Navigate | Skeleton or smooth page transition | Instant |
|
|
39
|
+
| Swipe drawer/sheet | Follow finger + snap or dismiss | Instant |
|
|
40
|
+
| Pull to refresh | Pull indicator + content reload | Instant |
|
|
41
|
+
| Hover interactive (desktop only) | Color/shadow/scale change | <100ms |
|
|
26
42
|
|
|
27
43
|
- **Optimistic UI**: Update UI immediately before server confirms. Revert on error.
|
|
28
44
|
- **Skeletons over spinners. Always.** Spinners only inside buttons during submission.
|
|
45
|
+
- **Touch feedback is non-negotiable**: Every tappable element must visually respond to touch immediately.
|
|
29
46
|
|
|
30
|
-
## Nielsen's 10 Heuristics
|
|
47
|
+
## Nielsen's 10 Heuristics (Mobile-Adapted)
|
|
31
48
|
|
|
32
|
-
1. **System status**: Show loading, toast on completion, inline validation as user types.
|
|
33
|
-
2. **Real-world match**: Human language ("Sign in" not "Authenticate"). Locale-formatted dates/currencies.
|
|
34
|
-
3. **User control**: Every modal dismissible with Escape + backdrop. Undo for destructive actions. Back always works.
|
|
35
|
-
4. **Consistency**: Same action = same button style, position, label everywhere.
|
|
36
|
-
5. **Error prevention**: Real-time validation. Disable submit until valid. Type-appropriate inputs. Confirm destructive actions.
|
|
37
|
-
6. **Recognition > recall**: Visible labels (not placeholder-only). Show recent searches.
|
|
38
|
-
7. **Flexibility**: Keyboard shortcuts (Cmd+K). Preserve filters in URL. Bulk actions where appropriate.
|
|
39
|
-
8. **Minimalist design**: Every element earns its place. Prefer whitespace over separators.
|
|
40
|
-
9. **Error recovery**: Say what went wrong + how to fix it. Highlight the field. Never clear form on error.
|
|
41
|
-
10. **Help**: Contextual tooltips on
|
|
49
|
+
1. **System status**: Show loading, toast on completion, inline validation as user types. On mobile: progress indicators for multi-step flows.
|
|
50
|
+
2. **Real-world match**: Human language ("Sign in" not "Authenticate"). Locale-formatted dates/currencies. Native input types (`type="email"`, `inputMode="numeric"`).
|
|
51
|
+
3. **User control**: Swipe gestures for dismiss/back. Bottom sheets dismissible by swipe-down. Every modal dismissible with Escape (desktop) + backdrop + swipe (mobile). Undo for destructive actions. Back always works — preserve scroll position on back navigation.
|
|
52
|
+
4. **Consistency**: Same action = same button style, position, label everywhere. Bottom nav consistent across all pages on mobile.
|
|
53
|
+
5. **Error prevention**: Real-time validation. Disable submit until valid. Type-appropriate inputs with correct keyboard (`inputMode`). Confirm destructive actions with bottom sheet confirmation on mobile.
|
|
54
|
+
6. **Recognition > recall**: Visible labels (not placeholder-only). Show recent searches. Bottom nav on mobile, top nav on desktop.
|
|
55
|
+
7. **Flexibility**: Keyboard shortcuts (Cmd+K) on desktop. Gesture shortcuts (swipe actions on list items) on mobile. Preserve filters in URL. Bulk actions where appropriate.
|
|
56
|
+
8. **Minimalist design**: Every element earns its place. Prefer whitespace over separators. On mobile: even more aggressive — reduce to one primary action per screen.
|
|
57
|
+
9. **Error recovery**: Say what went wrong + how to fix it. Highlight the field. Never clear form on error. On mobile: scroll to the first error field automatically.
|
|
58
|
+
10. **Help**: Contextual tooltips (tap-to-show on mobile, hover on desktop). Dismissible onboarding hints.
|
|
42
59
|
|
|
43
60
|
## Performance Targets
|
|
44
61
|
|
|
45
|
-
| Metric | Target |
|
|
46
|
-
|
|
47
|
-
| Lighthouse Performance | 98+ |
|
|
48
|
-
| Lighthouse Accessibility | 98+ |
|
|
49
|
-
| LCP | <2.5s |
|
|
50
|
-
| CLS | 0 |
|
|
51
|
-
| INP | <200ms |
|
|
62
|
+
| Metric | Mobile Target | Desktop Target |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| Lighthouse Performance | 90+ | 98+ |
|
|
65
|
+
| Lighthouse Accessibility | 98+ | 98+ |
|
|
66
|
+
| LCP | <2.5s | <2.0s |
|
|
67
|
+
| CLS | 0 | 0 |
|
|
68
|
+
| INP | <150ms | <200ms |
|
|
69
|
+
|
|
70
|
+
- **Test on real mobile devices** or throttled Chrome DevTools (4x CPU slowdown, Fast 3G).
|
|
71
|
+
- **Bundle size matters more on mobile**: lazy-load routes, code-split aggressively, defer non-critical JS.
|
|
52
72
|
|
|
53
73
|
## Accessibility
|
|
54
74
|
|
|
@@ -59,6 +79,9 @@
|
|
|
59
79
|
- Dynamic content updates: `aria-live="polite"`.
|
|
60
80
|
- All animations in `motion-safe:` variant.
|
|
61
81
|
- WCAG AA contrast: 4.5:1 for text, 3:1 for large text/UI.
|
|
82
|
+
- **Touch targets**: min 44x44px, recommended 48x48px. No exceptions.
|
|
83
|
+
- **Spacing between touch targets**: min 8px gap to prevent mis-taps.
|
|
84
|
+
- **No hover-only functionality**: everything accessible via tap on mobile.
|
|
62
85
|
|
|
63
86
|
## Microcopy
|
|
64
87
|
|
|
@@ -71,11 +94,18 @@
|
|
|
71
94
|
|
|
72
95
|
1. Interactive elements per section ≤ 7?
|
|
73
96
|
2. All elements on grid?
|
|
74
|
-
3. Every button/link has
|
|
97
|
+
3. Every button/link has active + focus-visible? (hover is `md:` only)
|
|
75
98
|
4. Skeletons for all async content?
|
|
76
99
|
5. Inline field-level errors on forms?
|
|
77
|
-
6. Every modal dismissible with Escape?
|
|
100
|
+
6. Every modal/sheet dismissible with Escape (desktop) + swipe (mobile)?
|
|
78
101
|
7. Tab through all elements in logical order?
|
|
79
102
|
8. Text passes WCAG AA contrast?
|
|
80
103
|
9. All animation in `motion-safe:`?
|
|
81
104
|
10. LCP image has `priority`?
|
|
105
|
+
11. All touch targets ≥ 44x44px?
|
|
106
|
+
12. Primary actions in thumb zone (bottom of screen)?
|
|
107
|
+
13. Bottom sheet used instead of centered modal on mobile?
|
|
108
|
+
14. Tested on 375px viewport width?
|
|
109
|
+
15. No hover-only functionality?
|
|
110
|
+
16. Safe areas respected on fixed/sticky elements?
|
|
111
|
+
17. Native input types used (`type="email"`, `inputMode="numeric"`, etc.)?
|
|
@@ -33,10 +33,11 @@ State: Server data (SSR) → Server Components
|
|
|
33
33
|
|
|
34
34
|
## Non-negotiable rules
|
|
35
35
|
|
|
36
|
-
1. **
|
|
37
|
-
2. **
|
|
38
|
-
3. **
|
|
39
|
-
4. **No
|
|
40
|
-
5. **
|
|
41
|
-
6. **
|
|
42
|
-
7. **
|
|
36
|
+
1. **Mobile-first**: All Tailwind classes start at mobile. Desktop is the enhancement (`md:`, `lg:`). Touch targets min 44x44px. No functionality behind hover-only states.
|
|
37
|
+
2. **Server Components by default.** Only add `'use client'` when you need hooks, state, or event handlers.
|
|
38
|
+
3. **Component limits**: Max 250 lines, max 5 props, max 3 JSX nesting levels.
|
|
39
|
+
4. **No hardcoded colors**: Use Tailwind semantic tokens (`bg-primary`, `text-foreground`). Never hex/rgb.
|
|
40
|
+
5. **No inline styles**: Tailwind only. Use `cn()` for conditional classes.
|
|
41
|
+
6. **Import order**: React/Next → third-party → UI → local → hooks → services → types → utils.
|
|
42
|
+
7. **Forms**: Validate with Zod. Always validate client-side AND server-side.
|
|
43
|
+
8. **Security**: Never inject raw HTML without sanitization. Never prefix secrets with `NEXT_PUBLIC_`.
|