@kood/claude-code 0.5.4 → 0.5.6
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 +6 -2
- package/package.json +1 -1
- package/templates/.claude/agents/document-writer.md +2 -2
- package/templates/.claude/skills/docs-creator/SKILL.md +2 -2
- package/templates/.claude/skills/docs-refactor/SKILL.md +1 -1
- package/templates/.claude/skills/plan/SKILL.md +15 -15
- package/templates/.claude/skills/ralph/SKILL.md +425 -72
- package/templates/hono/CLAUDE.md +28 -28
- 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 -54
- package/templates/nextjs/docs/architecture.md +146 -146
- 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 -38
- 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 -54
- 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/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/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/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/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/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/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 가이드라인
|
|
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
|
+
| 분류 | 금지 |
|
|
10
|
+
|------|------|
|
|
11
|
+
| **Spacing** | 임의값 (`mt-[13px]`), theme 외 값 |
|
|
12
|
+
| **컴포넌트** | 동일 요소에 다른 스타일 조합 |
|
|
13
|
+
| **@apply** | 개별 화면에서 사용, base 컴포넌트 외 |
|
|
14
|
+
| **반응형** | 데스크탑 우선 작성 |
|
|
15
|
+
| **Safe Area** | 컴포넌트 내부 적용, `env(safe-area-inset-*)` 직접 사용 |
|
|
16
|
+
| **그림자** | `shadow-lg` 이상 (특별한 경우 제외) |
|
|
17
|
+
| **폰트** | 4개 이상, `text-xs` 남용 |
|
|
18
|
+
| **색상** | Primary를 일반 텍스트/배경에 사용, 진한 보더 |
|
|
19
|
+
| **접근성** | 색상만으로 구분, `outline-none`, placeholder만 레이블 |
|
|
20
|
+
| **에러** | 기술 용어 메시지 ("code: 500") |
|
|
21
|
+
| **버튼** | 화면당 Primary 2개 이상 |
|
|
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** |
|
|
34
|
-
| **Viewport** |
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
29
|
+
| 분류 | 필수 |
|
|
30
|
+
|------|------|
|
|
31
|
+
| **Spacing** | Tailwind 기본 스케일만 (4px 단위) |
|
|
32
|
+
| **반응형** | 모바일 퍼스트 → `sm:` → `md:` → `lg:` |
|
|
33
|
+
| **Safe Area** | `tailwindcss-safe-area` 사용, 레이아웃 단위 적용 |
|
|
34
|
+
| **Viewport** | `viewport-fit=cover` 설정 |
|
|
35
|
+
| **접근성** | 대비 4.5:1 이상, 레이블 필수, 키보드 접근 |
|
|
36
|
+
| **버튼 상태** | Default/Hover/Active/Disabled/Loading 명확히 구분 |
|
|
37
|
+
| **에러** | 사용자 행동 중심 메시지 |
|
|
38
|
+
| **포커스** | `focus:ring-2` 등 명확한 표시 |
|
|
39
|
+
| **로딩** | 주요 액션에 로딩 상태, 중복 클릭 방지 |
|
|
40
|
+
| **클래스 순서** | 레이아웃 → 박스 → 타이포 → 색상 → 상태 |
|
|
41
41
|
|
|
42
42
|
</required>
|
|
43
43
|
|
|
@@ -45,37 +45,37 @@
|
|
|
45
45
|
|
|
46
46
|
<design_tokens>
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## 디자인 토큰 (Tailwind @theme)
|
|
49
49
|
|
|
50
50
|
```css
|
|
51
51
|
@import "tailwindcss";
|
|
52
52
|
@import "tailwindcss-safe-area";
|
|
53
53
|
|
|
54
54
|
@theme {
|
|
55
|
-
/*
|
|
55
|
+
/* 색상 (60-30-10 규칙) */
|
|
56
56
|
--color-primary-500: oklch(0.55 0.2 250);
|
|
57
57
|
--color-primary-600: oklch(0.48 0.22 250);
|
|
58
58
|
--color-primary-700: oklch(0.42 0.2 250);
|
|
59
59
|
|
|
60
|
-
/*
|
|
60
|
+
/* 폰트 (최대 2-3개) */
|
|
61
61
|
--font-sans: "Pretendard", "Inter", system-ui, sans-serif;
|
|
62
62
|
--font-mono: "JetBrains Mono", monospace;
|
|
63
63
|
|
|
64
|
-
/*
|
|
64
|
+
/* 반경 */
|
|
65
65
|
--radius: 0.5rem; /* 8px */
|
|
66
66
|
|
|
67
|
-
/*
|
|
67
|
+
/* 그림자 */
|
|
68
68
|
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
69
69
|
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
| Spacing | 4px
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
73
|
+
| 토큰 | 값 |
|
|
74
|
+
|------|-----|
|
|
75
|
+
| Spacing | 4px 그리드 (`gap-2`=8px, `p-4`=16px) |
|
|
76
|
+
| 색상 | Primary(액션), Neutral(배경), Semantic(상태) |
|
|
77
|
+
| 폰트 크기 | `text-2xl`(제목), `text-base`(본문), `text-sm`(보조) |
|
|
78
|
+
| 컨테이너 | `max-w-md`(폼), `max-w-3xl`(블로그), `max-w-7xl`(대시보드) |
|
|
79
79
|
|
|
80
80
|
</design_tokens>
|
|
81
81
|
|
|
@@ -83,49 +83,49 @@
|
|
|
83
83
|
|
|
84
84
|
<patterns>
|
|
85
85
|
|
|
86
|
-
## Tailwind
|
|
86
|
+
## Tailwind 패턴
|
|
87
87
|
|
|
88
|
-
###
|
|
88
|
+
### 버튼
|
|
89
89
|
|
|
90
90
|
```tsx
|
|
91
91
|
// Primary
|
|
92
92
|
<button className="px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg
|
|
93
93
|
hover:bg-primary-700 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2
|
|
94
94
|
disabled:opacity-50 disabled:cursor-not-allowed">
|
|
95
|
-
|
|
95
|
+
저장하기
|
|
96
96
|
</button>
|
|
97
97
|
|
|
98
98
|
// Secondary
|
|
99
99
|
<button className="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg
|
|
100
100
|
hover:bg-gray-50 focus:ring-2 focus:ring-gray-300">
|
|
101
|
-
|
|
101
|
+
취소
|
|
102
102
|
</button>
|
|
103
103
|
|
|
104
104
|
// Destructive
|
|
105
105
|
<button className="px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700">
|
|
106
|
-
|
|
106
|
+
삭제
|
|
107
107
|
</button>
|
|
108
108
|
|
|
109
|
-
//
|
|
109
|
+
// 로딩 상태
|
|
110
110
|
<button disabled={isLoading} className="flex items-center gap-2">
|
|
111
111
|
{isLoading && <Spinner className="w-4 h-4 animate-spin" />}
|
|
112
|
-
{isLoading ? '
|
|
112
|
+
{isLoading ? '저장 중...' : '저장하기'}
|
|
113
113
|
</button>
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
|
|
|
117
|
-
|
|
116
|
+
| 크기 | 클래스 |
|
|
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
|
+
### 입력 필드
|
|
123
123
|
|
|
124
124
|
```tsx
|
|
125
|
-
//
|
|
125
|
+
// 기본
|
|
126
126
|
<div>
|
|
127
127
|
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
|
|
128
|
-
|
|
128
|
+
이메일
|
|
129
129
|
</label>
|
|
130
130
|
<input
|
|
131
131
|
id="email"
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
/>
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
//
|
|
140
|
+
// 에러 상태
|
|
141
141
|
<input
|
|
142
142
|
className="w-full px-3 py-2 border border-red-500 rounded-lg
|
|
143
143
|
focus:ring-2 focus:ring-red-500"
|
|
@@ -145,81 +145,81 @@
|
|
|
145
145
|
aria-describedby="email-error"
|
|
146
146
|
/>
|
|
147
147
|
<p id="email-error" className="mt-1 text-sm text-red-600" role="alert">
|
|
148
|
-
|
|
148
|
+
올바른 이메일을 입력하세요
|
|
149
149
|
</p>
|
|
150
150
|
|
|
151
|
-
//
|
|
151
|
+
// 아이콘 포함
|
|
152
152
|
<div className="relative">
|
|
153
153
|
<SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" />
|
|
154
154
|
<input className="pl-10 pr-3 py-2 w-full border border-gray-300 rounded-lg" />
|
|
155
155
|
</div>
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
###
|
|
158
|
+
### 카드
|
|
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">제목</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">본문 내용</p>
|
|
167
167
|
</div>
|
|
168
168
|
<div className="px-6 py-4 bg-gray-50 border-t border-gray-200">
|
|
169
|
-
<button
|
|
169
|
+
<button>푸터 버튼</button>
|
|
170
170
|
</div>
|
|
171
171
|
</div>
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
###
|
|
174
|
+
### 모달
|
|
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">제목</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">본문</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">취소</button>
|
|
186
|
+
<button className="px-4 py-2 bg-primary-600 text-white rounded-lg">확인</button>
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
###
|
|
192
|
+
### 알림
|
|
193
193
|
|
|
194
194
|
```tsx
|
|
195
|
-
//
|
|
195
|
+
// 성공
|
|
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">저장되었습니다</p>
|
|
199
199
|
</div>
|
|
200
200
|
|
|
201
|
-
//
|
|
201
|
+
// 에러
|
|
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">서버에 문제가 발생했어요. 잠시 후 다시 시도해주세요.</p>
|
|
205
205
|
</div>
|
|
206
206
|
|
|
207
|
-
//
|
|
207
|
+
// 경고
|
|
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">확인이 필요합니다</p>
|
|
211
211
|
</div>
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
###
|
|
214
|
+
### 빈 상태
|
|
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">아직 항목이 없어요</h3>
|
|
220
|
+
<p className="mt-2 text-sm text-gray-600">첫 항목을 추가해보세요</p>
|
|
221
221
|
<button className="mt-6 px-4 py-2 bg-primary-600 text-white rounded-lg">
|
|
222
|
-
|
|
222
|
+
추가하기
|
|
223
223
|
</button>
|
|
224
224
|
</div>
|
|
225
225
|
```
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
|
|
233
233
|
## iOS Safe Area
|
|
234
234
|
|
|
235
|
-
###
|
|
235
|
+
### 설치 & 설정
|
|
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
|
+
### 유틸리티 클래스
|
|
254
254
|
|
|
255
|
-
|
|
|
256
|
-
|
|
257
|
-
| `pt-safe` |
|
|
258
|
-
| `pb-safe` |
|
|
259
|
-
| `px-safe` |
|
|
260
|
-
| `h-screen-safe` |
|
|
261
|
-
| `min-h-screen-safe` |
|
|
262
|
-
| `pt-safe-or-4` |
|
|
263
|
-
| `pb-safe-offset-4` |
|
|
255
|
+
| 클래스 | 용도 |
|
|
256
|
+
|--------|------|
|
|
257
|
+
| `pt-safe` | 상단 safe area (노치) |
|
|
258
|
+
| `pb-safe` | 하단 safe area (홈 인디케이터) |
|
|
259
|
+
| `px-safe` | 좌우 safe area |
|
|
260
|
+
| `h-screen-safe` | safe area 제외 높이 |
|
|
261
|
+
| `min-h-screen-safe` | 최소 높이 |
|
|
262
|
+
| `pt-safe-or-4` | safe area 또는 1rem (더 큰 값) |
|
|
263
|
+
| `pb-safe-offset-4` | safe area + 1rem |
|
|
264
264
|
|
|
265
|
-
###
|
|
265
|
+
### 레이아웃 패턴
|
|
266
266
|
|
|
267
267
|
```tsx
|
|
268
|
-
//
|
|
268
|
+
// 기본 앱 레이아웃
|
|
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">헤더</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">탭바</nav>
|
|
280
280
|
</footer>
|
|
281
281
|
</div>
|
|
282
282
|
|
|
283
|
-
//
|
|
283
|
+
// 고정 하단 버튼
|
|
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
|
+
확인
|
|
287
287
|
</button>
|
|
288
288
|
</div>
|
|
289
289
|
|
|
290
|
-
//
|
|
290
|
+
// 전체 화면 모달
|
|
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
|
+
// ❌ 노치에 가려짐
|
|
302
302
|
<header className="fixed top-0">
|
|
303
303
|
|
|
304
|
-
// ✅ Safe area
|
|
304
|
+
// ✅ Safe area 적용
|
|
305
305
|
<header className="fixed top-0 pt-safe">
|
|
306
306
|
|
|
307
|
-
// ❌
|
|
307
|
+
// ❌ 홈 인디케이터와 겹침
|
|
308
308
|
<button className="fixed bottom-4">
|
|
309
309
|
|
|
310
|
-
// ✅ Safe area
|
|
310
|
+
// ✅ Safe area 적용
|
|
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
|
+
// ❌ 컴포넌트 내부에 적용
|
|
316
|
+
<Button className="pb-safe">버튼</Button>
|
|
317
317
|
|
|
318
|
-
// ✅
|
|
318
|
+
// ✅ 레이아웃에서 적용
|
|
319
319
|
<div className="pb-safe-or-4">
|
|
320
|
-
<Button
|
|
320
|
+
<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
|
+
## 핵심 원칙
|
|
331
331
|
|
|
332
|
-
|
|
|
333
|
-
|
|
334
|
-
|
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
|
332
|
+
| 원칙 | 설명 |
|
|
333
|
+
|------|------|
|
|
334
|
+
| **일관성** | 동일 역할 = 동일 스타일 |
|
|
335
|
+
| **단순함** | 불필요한 요소 제거 |
|
|
336
|
+
| **반응형** | 모바일 퍼스트 |
|
|
337
|
+
| **접근성** | WCAG AA (대비 4.5:1+) |
|
|
338
338
|
|
|
339
|
-
###
|
|
339
|
+
### 색상 (60-30-10)
|
|
340
340
|
|
|
341
|
-
|
|
|
342
|
-
|
|
343
|
-
| 60% |
|
|
344
|
-
| 30% |
|
|
345
|
-
| 10% |
|
|
341
|
+
| 비율 | 용도 | 예시 |
|
|
342
|
+
|------|------|------|
|
|
343
|
+
| 60% | 배경 | `bg-white`, `bg-gray-50` |
|
|
344
|
+
| 30% | 보조 | 카드, 섹션 |
|
|
345
|
+
| 10% | 강조 | Primary 버튼, CTA |
|
|
346
346
|
|
|
347
|
-
###
|
|
347
|
+
### 타이포그래피
|
|
348
348
|
|
|
349
|
-
|
|
|
350
|
-
|
|
351
|
-
|
|
|
352
|
-
|
|
|
353
|
-
|
|
|
354
|
-
|
|
|
349
|
+
| 용도 | 클래스 | 크기 |
|
|
350
|
+
|------|--------|------|
|
|
351
|
+
| 제목 | `text-2xl` | 24px |
|
|
352
|
+
| 부제목 | `text-xl` | 20px |
|
|
353
|
+
| 본문 | `text-base` | 16px |
|
|
354
|
+
| 보조 | `text-sm` | 14px |
|
|
355
355
|
|
|
356
356
|
### Spacing
|
|
357
357
|
|
|
358
|
-
|
|
|
359
|
-
|
|
360
|
-
|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
363
|
-
|
|
|
364
|
-
|
|
|
358
|
+
| 용도 | 클래스 | 크기 |
|
|
359
|
+
|------|--------|------|
|
|
360
|
+
| 아이콘-텍스트 | `gap-1` | 4px |
|
|
361
|
+
| 인라인 요소 | `gap-2` | 8px |
|
|
362
|
+
| 카드 내부 | `p-4` | 16px |
|
|
363
|
+
| 카드 간격 | `gap-6` | 24px |
|
|
364
|
+
| 섹션 간격 | `py-12` | 48px |
|
|
365
365
|
|
|
366
|
-
###
|
|
366
|
+
### 반응형
|
|
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
|
+
| 브레이크포인트 | 크기 | 용도 |
|
|
374
|
+
|--------------|------|------|
|
|
375
|
+
| `sm` | 640px | 모바일 가로 |
|
|
376
|
+
| `md` | 768px | 태블릿 |
|
|
377
|
+
| `lg` | 1024px | 노트북 |
|
|
378
|
+
| `xl` | 1280px | 데스크탑 |
|
|
379
379
|
|
|
380
380
|
</guidelines>
|
|
381
381
|
|
|
@@ -383,39 +383,39 @@ export const Route = createRootRoute({
|
|
|
383
383
|
|
|
384
384
|
<accessibility>
|
|
385
385
|
|
|
386
|
-
##
|
|
386
|
+
## 접근성 체크리스트
|
|
387
387
|
|
|
388
388
|
```tsx
|
|
389
|
-
// ✅
|
|
390
|
-
<label htmlFor="email"
|
|
389
|
+
// ✅ 명확한 레이블
|
|
390
|
+
<label htmlFor="email">이메일</label>
|
|
391
391
|
<input id="email" />
|
|
392
392
|
|
|
393
|
-
// ✅
|
|
393
|
+
// ✅ 에러 연결
|
|
394
394
|
<input aria-invalid={hasError} aria-describedby="error" />
|
|
395
|
-
{hasError && <p id="error" role="alert"
|
|
395
|
+
{hasError && <p id="error" role="alert">오류</p>}
|
|
396
396
|
|
|
397
|
-
// ✅
|
|
397
|
+
// ✅ 포커스 표시
|
|
398
398
|
<button className="focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
|
|
399
399
|
|
|
400
|
-
// ✅
|
|
400
|
+
// ✅ 색상 + 아이콘 병행
|
|
401
401
|
<span className="text-red-600 flex items-center gap-1">
|
|
402
402
|
<XCircleIcon className="w-4 h-4" />
|
|
403
|
-
|
|
403
|
+
오류
|
|
404
404
|
</span>
|
|
405
405
|
|
|
406
|
-
// ✅
|
|
406
|
+
// ✅ 키보드 접근
|
|
407
407
|
<div tabIndex={0} onKeyDown={handleKeyDown}>
|
|
408
408
|
|
|
409
|
-
// ❌
|
|
409
|
+
// ❌ 포커스 제거 금지
|
|
410
410
|
<button className="outline-none focus:outline-none">
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
|
|
|
414
|
-
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
413
|
+
| 항목 | 기준 |
|
|
414
|
+
|------|------|
|
|
415
|
+
| 텍스트 대비 | 4.5:1 이상 |
|
|
416
|
+
| 큰 텍스트 (18px+) | 3:1 이상 |
|
|
417
|
+
| 터치 영역 | 44px × 44px 이상 |
|
|
418
|
+
| 포커스 표시 | 항상 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
|
+
## 실전 예시
|
|
427
427
|
|
|
428
|
-
###
|
|
428
|
+
### 폼 레이아웃
|
|
429
429
|
|
|
430
430
|
```tsx
|
|
431
431
|
<form className="max-w-md mx-auto space-y-6">
|
|
432
|
-
{/*
|
|
432
|
+
{/* 입력 필드 */}
|
|
433
433
|
<div>
|
|
434
434
|
<label htmlFor="name" className="block text-sm font-medium text-gray-700 mb-1">
|
|
435
|
-
|
|
435
|
+
이름
|
|
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
|
+
{/* 에러가 있는 입력 */}
|
|
446
446
|
<div>
|
|
447
447
|
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
|
|
448
|
-
|
|
448
|
+
이메일
|
|
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
|
+
올바른 이메일을 입력하세요
|
|
460
460
|
</p>
|
|
461
461
|
</div>
|
|
462
462
|
|
|
463
|
-
{/*
|
|
463
|
+
{/* 버튼 그룹 */}
|
|
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
|
+
취소
|
|
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
|
+
저장
|
|
476
476
|
</button>
|
|
477
477
|
</div>
|
|
478
478
|
</form>
|
|
479
479
|
```
|
|
480
480
|
|
|
481
|
-
###
|
|
481
|
+
### 카드 리스트
|
|
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
|
+
자세히 보기
|
|
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
|
+
### 대시보드 레이아웃
|
|
501
501
|
|
|
502
502
|
```tsx
|
|
503
503
|
<div className="min-h-screen-safe bg-gray-50">
|
|
504
|
-
{/*
|
|
504
|
+
{/* 헤더 */}
|
|
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">대시보드</h1>
|
|
508
|
+
<button>메뉴</button>
|
|
509
509
|
</div>
|
|
510
510
|
</header>
|
|
511
511
|
|
|
512
|
-
{/*
|
|
512
|
+
{/* 메인 */}
|
|
513
513
|
<main className="px-safe-or-4 py-6">
|
|
514
514
|
<div className="max-w-7xl mx-auto space-y-6">
|
|
515
|
-
{/*
|
|
515
|
+
{/* 통계 카드 */}
|
|
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">총 사용자</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
|
+
{/* 차트 */}
|
|
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">활동</h2>
|
|
527
|
+
{/* 차트 컴포넌트 */}
|
|
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 요구사항
|
|
541
541
|
|
|
542
|
-
|
|
542
|
+
**새 화면/컴포넌트 작성 시:**
|
|
543
543
|
|
|
544
|
-
1. **
|
|
545
|
-
2.
|
|
546
|
-
3. **
|
|
547
|
-
4.
|
|
548
|
-
5.
|
|
549
|
-
6.
|
|
550
|
-
7.
|
|
544
|
+
1. **Tailwind 스케일만 사용** - 임의값 금지
|
|
545
|
+
2. **모바일 퍼스트** - 기본 스타일 → `sm:` → `md:` → `lg:`
|
|
546
|
+
3. **Safe area 레이아웃에서 처리** - 컴포넌트 내부 금지
|
|
547
|
+
4. **접근성 필수** - 레이블, 대비, 포커스, 키보드
|
|
548
|
+
5. **일관된 패턴** - 같은 요소는 항상 같은 클래스 조합
|
|
549
|
+
6. **로딩/에러 상태** - 주요 액션에 필수
|
|
550
|
+
7. **마이크로카피** - 버튼/에러 메시지 함께 제안
|
|
551
551
|
|
|
552
|
-
|
|
553
|
-
-
|
|
552
|
+
**예외 발생 시:**
|
|
553
|
+
- 코드 주석으로 이유 설명
|
|
554
554
|
|
|
555
|
-
**
|
|
556
|
-
-
|
|
555
|
+
**Theme 확장 필요 시:**
|
|
556
|
+
- 임의값 대신 `@theme` 확장 제안
|
|
557
557
|
|
|
558
558
|
</claude_requirements>
|