@kood/claude-code 0.3.7 → 0.3.9
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/agents/code-reviewer.md +138 -123
- package/templates/.claude/agents/dependency-manager.md +99 -84
- package/templates/.claude/agents/deployment-validator.md +70 -55
- package/templates/.claude/agents/git-operator.md +78 -63
- package/templates/.claude/agents/implementation-executor.md +109 -94
- package/templates/.claude/agents/ko-to-en-translator.md +74 -0
- package/templates/.claude/agents/lint-fixer.md +93 -78
- package/templates/.claude/agents/refactor-advisor.md +136 -121
- package/templates/.claude/commands/agent-creator.md +199 -184
- package/templates/.claude/commands/bug-fix.md +207 -192
- package/templates/.claude/commands/command-creator.md +69 -53
- package/templates/.claude/commands/docs-creator.md +72 -56
- package/templates/.claude/commands/docs-refactor.md +41 -25
- package/templates/.claude/commands/execute.md +27 -11
- package/templates/.claude/commands/git-all.md +46 -31
- package/templates/.claude/commands/git-session.md +57 -41
- package/templates/.claude/commands/git.md +49 -33
- package/templates/.claude/commands/lint-fix.md +153 -137
- package/templates/.claude/commands/lint-init.md +76 -60
- package/templates/.claude/commands/plan.md +275 -259
- package/templates/.claude/commands/prd.md +39 -23
- package/templates/.claude/commands/pre-deploy.md +124 -108
- package/templates/.claude/commands/refactor.md +162 -146
- package/templates/.claude/commands/version-update.md +32 -16
- package/templates/hono/CLAUDE.md +28 -27
- package/templates/hono/docs/architecture.md +24 -24
- package/templates/hono/docs/deployment/cloudflare.md +18 -18
- package/templates/hono/docs/deployment/docker.md +13 -13
- package/templates/hono/docs/deployment/index.md +19 -19
- package/templates/hono/docs/deployment/railway.md +32 -32
- package/templates/hono/docs/deployment/vercel.md +29 -29
- package/templates/hono/docs/guides/conventions.md +57 -57
- package/templates/hono/docs/guides/env-setup.md +47 -47
- package/templates/hono/docs/guides/getting-started.md +27 -27
- package/templates/hono/docs/library/hono/error-handling.md +11 -11
- package/templates/hono/docs/library/hono/index.md +4 -4
- package/templates/hono/docs/library/hono/middleware.md +18 -18
- package/templates/hono/docs/library/hono/rpc.md +7 -7
- package/templates/hono/docs/library/hono/validation.md +6 -6
- package/templates/hono/docs/library/prisma/cloudflare-d1.md +29 -29
- package/templates/hono/docs/library/prisma/config.md +16 -16
- package/templates/hono/docs/library/prisma/index.md +32 -32
- package/templates/hono/docs/library/t3-env/index.md +22 -22
- package/templates/hono/docs/library/zod/index.md +31 -31
- package/templates/nextjs/CLAUDE.md +54 -51
- package/templates/nextjs/docs/architecture.md +812 -0
- package/templates/nextjs/docs/design.md +183 -183
- package/templates/nextjs/docs/guides/conventions.md +86 -86
- package/templates/nextjs/docs/guides/getting-started.md +28 -28
- package/templates/nextjs/docs/guides/routes.md +32 -32
- package/templates/nextjs/docs/library/better-auth/index.md +70 -70
- package/templates/nextjs/docs/library/nextjs/app-router.md +43 -43
- package/templates/nextjs/docs/library/nextjs/caching.md +73 -73
- package/templates/nextjs/docs/library/nextjs/index.md +51 -51
- package/templates/nextjs/docs/library/nextjs/middleware.md +41 -41
- package/templates/nextjs/docs/library/nextjs/route-handlers.md +31 -31
- package/templates/nextjs/docs/library/nextjs/server-actions.md +34 -34
- package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +20 -20
- package/templates/nextjs/docs/library/prisma/config.md +18 -18
- package/templates/nextjs/docs/library/prisma/crud.md +17 -17
- package/templates/nextjs/docs/library/prisma/index.md +18 -18
- package/templates/nextjs/docs/library/prisma/relations.md +16 -16
- package/templates/nextjs/docs/library/prisma/schema.md +23 -23
- package/templates/nextjs/docs/library/prisma/setup.md +6 -6
- package/templates/nextjs/docs/library/prisma/transactions.md +10 -10
- package/templates/nextjs/docs/library/tanstack-query/index.md +6 -6
- package/templates/nextjs/docs/library/tanstack-query/invalidation.md +20 -20
- package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +4 -4
- package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +15 -15
- package/templates/nextjs/docs/library/tanstack-query/use-query.md +22 -22
- package/templates/nextjs/docs/library/zod/complex-types.md +11 -11
- package/templates/nextjs/docs/library/zod/index.md +8 -8
- package/templates/nextjs/docs/library/zod/transforms.md +11 -11
- package/templates/nextjs/docs/library/zod/validation.md +9 -9
- package/templates/npx/CLAUDE.md +38 -37
- package/templates/npx/docs/library/commander/index.md +12 -12
- package/templates/npx/docs/library/fs-extra/index.md +9 -9
- package/templates/npx/docs/library/prompts/index.md +3 -3
- package/templates/npx/docs/references/patterns.md +12 -12
- package/templates/tanstack-start/CLAUDE.md +54 -53
- package/templates/tanstack-start/docs/architecture.md +128 -128
- package/templates/tanstack-start/docs/design.md +169 -169
- package/templates/tanstack-start/docs/guides/conventions.md +43 -43
- package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
- package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
- package/templates/tanstack-start/docs/guides/hooks.md +45 -45
- package/templates/tanstack-start/docs/guides/routes.md +54 -54
- package/templates/tanstack-start/docs/guides/services.md +45 -45
- package/templates/tanstack-start/docs/library/better-auth/index.md +68 -68
- package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
- package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
- package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
- package/templates/tanstack-start/docs/library/prisma/index.md +17 -17
- package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
- package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
- package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
- package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
- package/templates/tanstack-start/docs/library/t3-env/index.md +21 -160
- package/templates/tanstack-start/docs/library/tanstack-query/index.md +6 -6
- package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
- package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
- package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
- package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
- package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
- package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
- package/templates/tanstack-start/docs/library/tanstack-router/index.md +18 -18
- package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
- package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
- package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
- package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
- package/templates/tanstack-start/docs/library/tanstack-start/index.md +15 -15
- package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
- package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
- package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
- package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
- package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
- package/templates/tanstack-start/docs/library/zod/index.md +8 -8
- package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
- package/templates/tanstack-start/docs/library/zod/validation.md +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# UI/UX & Tailwind
|
|
1
|
+
# UI/UX & Tailwind Guidelines
|
|
2
2
|
|
|
3
3
|
> TanStack Start + Tailwind CSS v4 + iOS Safe Area
|
|
4
4
|
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
<forbidden>
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
| **Spacing** |
|
|
12
|
-
|
|
|
13
|
-
| **@apply** |
|
|
14
|
-
|
|
|
15
|
-
| **Safe Area** |
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
9
|
+
| Category | Forbidden |
|
|
10
|
+
|----------|-----------|
|
|
11
|
+
| **Spacing** | Arbitrary values (`mt-[13px]`), values outside theme |
|
|
12
|
+
| **Components** | Different style combinations for same element |
|
|
13
|
+
| **@apply** | Use in individual screens, outside base components |
|
|
14
|
+
| **Responsive** | Desktop-first approach |
|
|
15
|
+
| **Safe Area** | Apply inside components, direct `env(safe-area-inset-*)` use |
|
|
16
|
+
| **Shadows** | `shadow-lg` or larger (except special cases) |
|
|
17
|
+
| **Fonts** | 4+ fonts, `text-xs` overuse |
|
|
18
|
+
| **Colors** | Using Primary for regular text/background, dark borders |
|
|
19
|
+
| **Accessibility** | Color-only differentiation, `outline-none`, placeholder-only labels |
|
|
20
|
+
| **Errors** | Technical term messages ("code: 500") |
|
|
21
|
+
| **Buttons** | 2+ Primary buttons per screen |
|
|
22
22
|
|
|
23
23
|
</forbidden>
|
|
24
24
|
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
|
|
27
27
|
<required>
|
|
28
28
|
|
|
29
|
-
|
|
|
30
|
-
|
|
31
|
-
| **Spacing** | Tailwind
|
|
32
|
-
|
|
|
33
|
-
| **Safe Area** | `tailwindcss-safe-area
|
|
34
|
-
| **Viewport** | `viewport-fit=cover`
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
29
|
+
| Category | Required |
|
|
30
|
+
|----------|----------|
|
|
31
|
+
| **Spacing** | Tailwind default scale only (4px units) |
|
|
32
|
+
| **Responsive** | Mobile first → `sm:` → `md:` → `lg:` |
|
|
33
|
+
| **Safe Area** | Use `tailwindcss-safe-area`, apply at layout level |
|
|
34
|
+
| **Viewport** | Set `viewport-fit=cover` |
|
|
35
|
+
| **Accessibility** | 4.5:1+ contrast, labels required, keyboard access |
|
|
36
|
+
| **Button States** | Clearly distinguish Default/Hover/Active/Disabled/Loading |
|
|
37
|
+
| **Errors** | User action-oriented messages |
|
|
38
|
+
| **Focus** | Clear indication with `focus:ring-2` etc |
|
|
39
|
+
| **Loading** | Loading states for key actions, prevent duplicate clicks |
|
|
40
|
+
| **Class Order** | Layout → Box → Typography → Color → State |
|
|
41
41
|
|
|
42
42
|
</required>
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<design_tokens>
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Design Tokens (Tailwind @theme)
|
|
49
49
|
|
|
50
50
|
```css
|
|
51
51
|
@import "tailwindcss";
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
| Spacing | 4px
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
73
|
+
| Token | Value |
|
|
74
|
+
|-------|-------|
|
|
75
|
+
| Spacing | 4px grid (`gap-2`=8px, `p-4`=16px) |
|
|
76
|
+
| Colors | Primary (action), Neutral (background), Semantic (state) |
|
|
77
|
+
| Font Size | `text-2xl` (heading), `text-base` (body), `text-sm` (secondary) |
|
|
78
|
+
| Container | `max-w-md` (forms), `max-w-3xl` (blog), `max-w-7xl` (dashboard) |
|
|
79
79
|
|
|
80
80
|
</design_tokens>
|
|
81
81
|
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
|
|
84
84
|
<patterns>
|
|
85
85
|
|
|
86
|
-
## Tailwind
|
|
86
|
+
## Tailwind Patterns
|
|
87
87
|
|
|
88
|
-
###
|
|
88
|
+
### Buttons
|
|
89
89
|
|
|
90
90
|
```tsx
|
|
91
91
|
// Primary
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
</button>
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
|
|
|
117
|
-
|
|
116
|
+
| Size | Class |
|
|
117
|
+
|------|-------|
|
|
118
118
|
| Small | `px-3 py-1.5 text-sm` |
|
|
119
119
|
| Medium | `px-4 py-2 text-base` |
|
|
120
120
|
| Large | `px-6 py-3 text-lg` |
|
|
121
121
|
|
|
122
|
-
###
|
|
122
|
+
### Input Fields
|
|
123
123
|
|
|
124
124
|
```tsx
|
|
125
125
|
// 기본
|
|
@@ -155,71 +155,71 @@
|
|
|
155
155
|
</div>
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
###
|
|
158
|
+
### Cards
|
|
159
159
|
|
|
160
160
|
```tsx
|
|
161
161
|
<div className="bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden">
|
|
162
162
|
<div className="px-6 py-4 border-b border-gray-200">
|
|
163
|
-
<h3 className="text-lg font-semibold text-gray-900"
|
|
163
|
+
<h3 className="text-lg font-semibold text-gray-900">Title</h3>
|
|
164
164
|
</div>
|
|
165
165
|
<div className="px-6 py-4">
|
|
166
|
-
<p className="text-base text-gray-600"
|
|
166
|
+
<p className="text-base text-gray-600">Body content</p>
|
|
167
167
|
</div>
|
|
168
168
|
<div className="px-6 py-4 bg-gray-50 border-t border-gray-200">
|
|
169
|
-
<button
|
|
169
|
+
<button>Footer button</button>
|
|
170
170
|
</div>
|
|
171
171
|
</div>
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
###
|
|
174
|
+
### Modals
|
|
175
175
|
|
|
176
176
|
```tsx
|
|
177
177
|
<div className="fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4">
|
|
178
178
|
<div className="bg-white rounded-lg shadow-xl w-full max-w-md">
|
|
179
179
|
<div className="px-6 py-4 border-b border-gray-200 flex items-center justify-between">
|
|
180
|
-
<h2 className="text-lg font-semibold text-gray-900"
|
|
180
|
+
<h2 className="text-lg font-semibold text-gray-900">Title</h2>
|
|
181
181
|
<button><XIcon className="w-5 h-5" /></button>
|
|
182
182
|
</div>
|
|
183
|
-
<div className="px-6 py-4"
|
|
183
|
+
<div className="px-6 py-4">Body</div>
|
|
184
184
|
<div className="px-6 py-4 bg-gray-50 flex justify-end gap-3">
|
|
185
|
-
<button className="px-4 py-2 border border-gray-300 rounded-lg"
|
|
186
|
-
<button className="px-4 py-2 bg-primary-600 text-white rounded-lg"
|
|
185
|
+
<button className="px-4 py-2 border border-gray-300 rounded-lg">Cancel</button>
|
|
186
|
+
<button className="px-4 py-2 bg-primary-600 text-white rounded-lg">Confirm</button>
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
###
|
|
192
|
+
### Alerts
|
|
193
193
|
|
|
194
194
|
```tsx
|
|
195
|
-
//
|
|
195
|
+
// Success
|
|
196
196
|
<div className="p-4 bg-green-50 border border-green-200 rounded-lg flex gap-3">
|
|
197
197
|
<CheckCircleIcon className="w-5 h-5 text-green-600 flex-shrink-0" />
|
|
198
|
-
<p className="text-sm text-green-800"
|
|
198
|
+
<p className="text-sm text-green-800">Saved successfully</p>
|
|
199
199
|
</div>
|
|
200
200
|
|
|
201
|
-
//
|
|
201
|
+
// Error
|
|
202
202
|
<div className="p-4 bg-red-50 border border-red-200 rounded-lg flex gap-3">
|
|
203
203
|
<XCircleIcon className="w-5 h-5 text-red-600 flex-shrink-0" />
|
|
204
|
-
<p className="text-sm text-red-800"
|
|
204
|
+
<p className="text-sm text-red-800">Server error occurred. Please try again later.</p>
|
|
205
205
|
</div>
|
|
206
206
|
|
|
207
|
-
//
|
|
207
|
+
// Warning
|
|
208
208
|
<div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg flex gap-3">
|
|
209
209
|
<AlertIcon className="w-5 h-5 text-yellow-600 flex-shrink-0" />
|
|
210
|
-
<p className="text-sm text-yellow-800"
|
|
210
|
+
<p className="text-sm text-yellow-800">Confirmation needed</p>
|
|
211
211
|
</div>
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
###
|
|
214
|
+
### Empty States
|
|
215
215
|
|
|
216
216
|
```tsx
|
|
217
217
|
<div className="py-12 text-center">
|
|
218
218
|
<InboxIcon className="mx-auto w-12 h-12 text-gray-400" />
|
|
219
|
-
<h3 className="mt-4 text-lg font-medium text-gray-900"
|
|
220
|
-
<p className="mt-2 text-sm text-gray-600"
|
|
219
|
+
<h3 className="mt-4 text-lg font-medium text-gray-900">No items yet</h3>
|
|
220
|
+
<p className="mt-2 text-sm text-gray-600">Add your first item</p>
|
|
221
221
|
<button className="mt-6 px-4 py-2 bg-primary-600 text-white rounded-lg">
|
|
222
|
-
|
|
222
|
+
Add
|
|
223
223
|
</button>
|
|
224
224
|
</div>
|
|
225
225
|
```
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
|
|
233
233
|
## iOS Safe Area
|
|
234
234
|
|
|
235
|
-
###
|
|
235
|
+
### Installation & Setup
|
|
236
236
|
|
|
237
237
|
```bash
|
|
238
238
|
yarn add tailwindcss-safe-area
|
|
@@ -250,25 +250,25 @@ export const Route = createRootRoute({
|
|
|
250
250
|
})
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
-
###
|
|
253
|
+
### Utility Classes
|
|
254
254
|
|
|
255
|
-
|
|
|
256
|
-
|
|
257
|
-
| `pt-safe` |
|
|
258
|
-
| `pb-safe` |
|
|
259
|
-
| `px-safe` |
|
|
260
|
-
| `h-screen-safe` | safe area
|
|
261
|
-
| `min-h-screen-safe` |
|
|
262
|
-
| `pt-safe-or-4` |
|
|
263
|
-
| `pb-safe-offset-4` |
|
|
255
|
+
| Class | Purpose |
|
|
256
|
+
|-------|---------|
|
|
257
|
+
| `pt-safe` | Top safe area (notch) |
|
|
258
|
+
| `pb-safe` | Bottom safe area (home indicator) |
|
|
259
|
+
| `px-safe` | Left/right safe area |
|
|
260
|
+
| `h-screen-safe` | Height excluding safe area |
|
|
261
|
+
| `min-h-screen-safe` | Minimum height |
|
|
262
|
+
| `pt-safe-or-4` | Safe area or 1rem (larger value) |
|
|
263
|
+
| `pb-safe-offset-4` | Safe area + 1rem |
|
|
264
264
|
|
|
265
|
-
###
|
|
265
|
+
### Layout Patterns
|
|
266
266
|
|
|
267
267
|
```tsx
|
|
268
|
-
//
|
|
268
|
+
// Basic app layout
|
|
269
269
|
<div className="min-h-screen-safe flex flex-col">
|
|
270
270
|
<header className="pt-safe-or-2 px-safe-or-4 bg-white border-b">
|
|
271
|
-
<nav className="h-14 flex items-center"
|
|
271
|
+
<nav className="h-14 flex items-center">Header</nav>
|
|
272
272
|
</header>
|
|
273
273
|
|
|
274
274
|
<main className="flex-1 px-safe-or-4 py-6">
|
|
@@ -276,18 +276,18 @@ export const Route = createRootRoute({
|
|
|
276
276
|
</main>
|
|
277
277
|
|
|
278
278
|
<footer className="pb-safe-or-2 px-safe-or-4 bg-white border-t">
|
|
279
|
-
<nav className="h-14 flex items-center justify-around"
|
|
279
|
+
<nav className="h-14 flex items-center justify-around">Tab bar</nav>
|
|
280
280
|
</footer>
|
|
281
281
|
</div>
|
|
282
282
|
|
|
283
|
-
//
|
|
283
|
+
// Fixed bottom button
|
|
284
284
|
<div className="fixed bottom-0 left-0 right-0 pb-safe-or-4 px-safe-or-4 bg-white border-t">
|
|
285
285
|
<button className="w-full h-12 bg-primary-600 text-white rounded-lg">
|
|
286
|
-
|
|
286
|
+
Confirm
|
|
287
287
|
</button>
|
|
288
288
|
</div>
|
|
289
289
|
|
|
290
|
-
//
|
|
290
|
+
// Full screen modal
|
|
291
291
|
<div className="fixed inset-0 bg-white z-50">
|
|
292
292
|
<div className="h-screen-safe flex flex-col p-safe">
|
|
293
293
|
{children}
|
|
@@ -298,26 +298,26 @@ export const Route = createRootRoute({
|
|
|
298
298
|
### ✅ / ❌ Safe Area
|
|
299
299
|
|
|
300
300
|
```tsx
|
|
301
|
-
// ❌
|
|
301
|
+
// ❌ Hidden by notch
|
|
302
302
|
<header className="fixed top-0">
|
|
303
303
|
|
|
304
|
-
// ✅ Safe area
|
|
304
|
+
// ✅ Safe area applied
|
|
305
305
|
<header className="fixed top-0 pt-safe">
|
|
306
306
|
|
|
307
|
-
// ❌
|
|
307
|
+
// ❌ Overlaps with home indicator
|
|
308
308
|
<button className="fixed bottom-4">
|
|
309
309
|
|
|
310
|
-
// ✅ Safe area
|
|
310
|
+
// ✅ Safe area applied
|
|
311
311
|
<div className="fixed bottom-0 pb-safe-or-4">
|
|
312
312
|
<button>...</button>
|
|
313
313
|
</div>
|
|
314
314
|
|
|
315
|
-
// ❌
|
|
316
|
-
<Button className="pb-safe"
|
|
315
|
+
// ❌ Applied inside component
|
|
316
|
+
<Button className="pb-safe">Button</Button>
|
|
317
317
|
|
|
318
|
-
// ✅
|
|
318
|
+
// ✅ Applied in layout
|
|
319
319
|
<div className="pb-safe-or-4">
|
|
320
|
-
<Button
|
|
320
|
+
<Button>Button</Button>
|
|
321
321
|
</div>
|
|
322
322
|
```
|
|
323
323
|
|
|
@@ -327,55 +327,55 @@ export const Route = createRootRoute({
|
|
|
327
327
|
|
|
328
328
|
<guidelines>
|
|
329
329
|
|
|
330
|
-
##
|
|
330
|
+
## Core Principles
|
|
331
331
|
|
|
332
|
-
|
|
|
333
|
-
|
|
334
|
-
|
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
|
332
|
+
| Principle | Description |
|
|
333
|
+
|-----------|-------------|
|
|
334
|
+
| **Consistency** | Same role = Same style |
|
|
335
|
+
| **Simplicity** | Remove unnecessary elements |
|
|
336
|
+
| **Responsive** | Mobile first |
|
|
337
|
+
| **Accessibility** | WCAG AA (4.5:1+ contrast) |
|
|
338
338
|
|
|
339
|
-
###
|
|
339
|
+
### Colors (60-30-10)
|
|
340
340
|
|
|
341
|
-
|
|
|
342
|
-
|
|
343
|
-
| 60% |
|
|
344
|
-
| 30% |
|
|
345
|
-
| 10% |
|
|
341
|
+
| Ratio | Purpose | Example |
|
|
342
|
+
|-------|---------|---------|
|
|
343
|
+
| 60% | Background | `bg-white`, `bg-gray-50` |
|
|
344
|
+
| 30% | Secondary | Cards, sections |
|
|
345
|
+
| 10% | Accent | Primary buttons, CTA |
|
|
346
346
|
|
|
347
|
-
###
|
|
347
|
+
### Typography
|
|
348
348
|
|
|
349
|
-
|
|
|
350
|
-
|
|
351
|
-
|
|
|
352
|
-
|
|
|
353
|
-
|
|
|
354
|
-
|
|
|
349
|
+
| Purpose | Class | Size |
|
|
350
|
+
|---------|-------|------|
|
|
351
|
+
| Heading | `text-2xl` | 24px |
|
|
352
|
+
| Subheading | `text-xl` | 20px |
|
|
353
|
+
| Body | `text-base` | 16px |
|
|
354
|
+
| Secondary | `text-sm` | 14px |
|
|
355
355
|
|
|
356
356
|
### Spacing
|
|
357
357
|
|
|
358
|
-
|
|
|
359
|
-
|
|
360
|
-
|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
363
|
-
|
|
|
364
|
-
|
|
|
358
|
+
| Purpose | Class | Size |
|
|
359
|
+
|---------|-------|------|
|
|
360
|
+
| Icon-text | `gap-1` | 4px |
|
|
361
|
+
| Inline elements | `gap-2` | 8px |
|
|
362
|
+
| Card inner | `p-4` | 16px |
|
|
363
|
+
| Card spacing | `gap-6` | 24px |
|
|
364
|
+
| Section spacing | `py-12` | 48px |
|
|
365
365
|
|
|
366
|
-
###
|
|
366
|
+
### Responsive
|
|
367
367
|
|
|
368
368
|
```tsx
|
|
369
369
|
<div className="p-4 md:p-6 lg:p-8">
|
|
370
370
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
|
|
|
374
|
-
|
|
375
|
-
| `sm` | 640px |
|
|
376
|
-
| `md` | 768px |
|
|
377
|
-
| `lg` | 1024px |
|
|
378
|
-
| `xl` | 1280px |
|
|
373
|
+
| Breakpoint | Size | Purpose |
|
|
374
|
+
|------------|------|---------|
|
|
375
|
+
| `sm` | 640px | Mobile landscape |
|
|
376
|
+
| `md` | 768px | Tablet |
|
|
377
|
+
| `lg` | 1024px | Laptop |
|
|
378
|
+
| `xl` | 1280px | Desktop |
|
|
379
379
|
|
|
380
380
|
</guidelines>
|
|
381
381
|
|
|
@@ -383,39 +383,39 @@ export const Route = createRootRoute({
|
|
|
383
383
|
|
|
384
384
|
<accessibility>
|
|
385
385
|
|
|
386
|
-
##
|
|
386
|
+
## Accessibility Checklist
|
|
387
387
|
|
|
388
388
|
```tsx
|
|
389
|
-
// ✅
|
|
390
|
-
<label htmlFor="email"
|
|
389
|
+
// ✅ Clear label
|
|
390
|
+
<label htmlFor="email">Email</label>
|
|
391
391
|
<input id="email" />
|
|
392
392
|
|
|
393
|
-
// ✅
|
|
393
|
+
// ✅ Error connection
|
|
394
394
|
<input aria-invalid={hasError} aria-describedby="error" />
|
|
395
|
-
{hasError && <p id="error" role="alert"
|
|
395
|
+
{hasError && <p id="error" role="alert">Error</p>}
|
|
396
396
|
|
|
397
|
-
// ✅
|
|
397
|
+
// ✅ Focus indication
|
|
398
398
|
<button className="focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
|
|
399
399
|
|
|
400
|
-
// ✅
|
|
400
|
+
// ✅ Color + Icon
|
|
401
401
|
<span className="text-red-600 flex items-center gap-1">
|
|
402
402
|
<XCircleIcon className="w-4 h-4" />
|
|
403
|
-
|
|
403
|
+
Error
|
|
404
404
|
</span>
|
|
405
405
|
|
|
406
|
-
// ✅
|
|
406
|
+
// ✅ Keyboard access
|
|
407
407
|
<div tabIndex={0} onKeyDown={handleKeyDown}>
|
|
408
408
|
|
|
409
|
-
// ❌
|
|
409
|
+
// ❌ Do not remove focus
|
|
410
410
|
<button className="outline-none focus:outline-none">
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
|
|
|
414
|
-
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
413
|
+
| Item | Standard |
|
|
414
|
+
|------|----------|
|
|
415
|
+
| Text contrast | 4.5:1+ |
|
|
416
|
+
| Large text (18px+) | 3:1+ |
|
|
417
|
+
| Touch area | 44px × 44px+ |
|
|
418
|
+
| Focus indication | Always visible |
|
|
419
419
|
|
|
420
420
|
</accessibility>
|
|
421
421
|
|
|
@@ -423,16 +423,16 @@ export const Route = createRootRoute({
|
|
|
423
423
|
|
|
424
424
|
<examples>
|
|
425
425
|
|
|
426
|
-
##
|
|
426
|
+
## Real-World Examples
|
|
427
427
|
|
|
428
|
-
###
|
|
428
|
+
### Form Layout
|
|
429
429
|
|
|
430
430
|
```tsx
|
|
431
431
|
<form className="max-w-md mx-auto space-y-6">
|
|
432
|
-
{/*
|
|
432
|
+
{/* Input field */}
|
|
433
433
|
<div>
|
|
434
434
|
<label htmlFor="name" className="block text-sm font-medium text-gray-700 mb-1">
|
|
435
|
-
|
|
435
|
+
Name
|
|
436
436
|
</label>
|
|
437
437
|
<input
|
|
438
438
|
id="name"
|
|
@@ -442,10 +442,10 @@ export const Route = createRootRoute({
|
|
|
442
442
|
/>
|
|
443
443
|
</div>
|
|
444
444
|
|
|
445
|
-
{/*
|
|
445
|
+
{/* Input with error */}
|
|
446
446
|
<div>
|
|
447
447
|
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
|
|
448
|
-
|
|
448
|
+
Email
|
|
449
449
|
</label>
|
|
450
450
|
<input
|
|
451
451
|
id="email"
|
|
@@ -456,29 +456,29 @@ export const Route = createRootRoute({
|
|
|
456
456
|
aria-describedby="email-error"
|
|
457
457
|
/>
|
|
458
458
|
<p id="email-error" className="mt-1 text-sm text-red-600" role="alert">
|
|
459
|
-
|
|
459
|
+
Enter a valid email
|
|
460
460
|
</p>
|
|
461
461
|
</div>
|
|
462
462
|
|
|
463
|
-
{/*
|
|
463
|
+
{/* Button group */}
|
|
464
464
|
<div className="flex gap-3">
|
|
465
465
|
<button
|
|
466
466
|
type="button"
|
|
467
467
|
className="flex-1 px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50"
|
|
468
468
|
>
|
|
469
|
-
|
|
469
|
+
Cancel
|
|
470
470
|
</button>
|
|
471
471
|
<button
|
|
472
472
|
type="submit"
|
|
473
473
|
className="flex-1 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700"
|
|
474
474
|
>
|
|
475
|
-
|
|
475
|
+
Save
|
|
476
476
|
</button>
|
|
477
477
|
</div>
|
|
478
478
|
</form>
|
|
479
479
|
```
|
|
480
480
|
|
|
481
|
-
###
|
|
481
|
+
### Card List
|
|
482
482
|
|
|
483
483
|
```tsx
|
|
484
484
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
@@ -489,7 +489,7 @@ export const Route = createRootRoute({
|
|
|
489
489
|
<h3 className="text-lg font-semibold text-gray-900">{item.title}</h3>
|
|
490
490
|
<p className="mt-2 text-sm text-gray-600">{item.description}</p>
|
|
491
491
|
<button className="mt-4 w-full px-4 py-2 bg-primary-600 text-white rounded-lg">
|
|
492
|
-
|
|
492
|
+
Learn more
|
|
493
493
|
</button>
|
|
494
494
|
</div>
|
|
495
495
|
</div>
|
|
@@ -497,34 +497,34 @@ export const Route = createRootRoute({
|
|
|
497
497
|
</div>
|
|
498
498
|
```
|
|
499
499
|
|
|
500
|
-
###
|
|
500
|
+
### Dashboard Layout
|
|
501
501
|
|
|
502
502
|
```tsx
|
|
503
503
|
<div className="min-h-screen-safe bg-gray-50">
|
|
504
|
-
{/*
|
|
504
|
+
{/* Header */}
|
|
505
505
|
<header className="pt-safe-or-2 px-safe-or-4 bg-white border-b border-gray-200">
|
|
506
506
|
<div className="h-16 flex items-center justify-between">
|
|
507
|
-
<h1 className="text-xl font-bold"
|
|
508
|
-
<button
|
|
507
|
+
<h1 className="text-xl font-bold">Dashboard</h1>
|
|
508
|
+
<button>Menu</button>
|
|
509
509
|
</div>
|
|
510
510
|
</header>
|
|
511
511
|
|
|
512
|
-
{/*
|
|
512
|
+
{/* Main */}
|
|
513
513
|
<main className="px-safe-or-4 py-6">
|
|
514
514
|
<div className="max-w-7xl mx-auto space-y-6">
|
|
515
|
-
{/*
|
|
515
|
+
{/* Stats cards */}
|
|
516
516
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
517
517
|
<div className="bg-white p-6 rounded-lg border border-gray-200">
|
|
518
|
-
<p className="text-sm text-gray-600"
|
|
518
|
+
<p className="text-sm text-gray-600">Total users</p>
|
|
519
519
|
<p className="mt-2 text-3xl font-bold text-gray-900">1,234</p>
|
|
520
520
|
</div>
|
|
521
521
|
{/* ... */}
|
|
522
522
|
</div>
|
|
523
523
|
|
|
524
|
-
{/*
|
|
524
|
+
{/* Chart */}
|
|
525
525
|
<div className="bg-white p-6 rounded-lg border border-gray-200">
|
|
526
|
-
<h2 className="text-lg font-semibold text-gray-900"
|
|
527
|
-
{/*
|
|
526
|
+
<h2 className="text-lg font-semibold text-gray-900">Activity</h2>
|
|
527
|
+
{/* Chart component */}
|
|
528
528
|
</div>
|
|
529
529
|
</div>
|
|
530
530
|
</main>
|
|
@@ -537,22 +537,22 @@ export const Route = createRootRoute({
|
|
|
537
537
|
|
|
538
538
|
<claude_requirements>
|
|
539
539
|
|
|
540
|
-
## Claude Code
|
|
540
|
+
## Claude Code Requirements
|
|
541
541
|
|
|
542
|
-
|
|
542
|
+
**When Creating New Screens/Components:**
|
|
543
543
|
|
|
544
|
-
1. **Tailwind
|
|
545
|
-
2.
|
|
546
|
-
3. **Safe area
|
|
547
|
-
4.
|
|
548
|
-
5.
|
|
549
|
-
6.
|
|
550
|
-
7.
|
|
544
|
+
1. **Use Tailwind scale only** - No arbitrary values
|
|
545
|
+
2. **Mobile first** - Base styles → `sm:` → `md:` → `lg:`
|
|
546
|
+
3. **Safe area at layout level** - Not inside components
|
|
547
|
+
4. **Accessibility required** - Labels, contrast, focus, keyboard
|
|
548
|
+
5. **Consistent patterns** - Same element = Same class combination
|
|
549
|
+
6. **Loading/Error states** - Required for key actions
|
|
550
|
+
7. **Microcopy** - Suggest button/error messages together
|
|
551
551
|
|
|
552
|
-
|
|
553
|
-
-
|
|
552
|
+
**When Exceptions Occur:**
|
|
553
|
+
- Explain reason in code comments
|
|
554
554
|
|
|
555
|
-
**Theme
|
|
556
|
-
-
|
|
555
|
+
**When Theme Extension Needed:**
|
|
556
|
+
- Suggest `@theme` extension instead of arbitrary values
|
|
557
557
|
|
|
558
558
|
</claude_requirements>
|