@sonamu-kit/react-components 0.1.0 → 0.1.2
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/components/index.d.ts +65 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/async-select.d.ts +36 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/calendar.d.ts +5 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/carousel.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts +8 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/combobox.d.ts +20 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/common-modal.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/date-input.d.ts +7 -0
- package/dist/components/ui/date-picker.d.ts +26 -0
- package/dist/components/ui/date-selector-multiple.d.ts +38 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/image-uploader.d.ts +14 -0
- package/dist/components/ui/input-otp.d.ts +34 -0
- package/dist/components/ui/input.d.ts +7 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +28 -0
- package/dist/components/ui/month-picker-multiple.d.ts +41 -0
- package/dist/components/ui/multi-image-uploader.d.ts +15 -0
- package/dist/components/ui/multi-select.d.ts +229 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/pagination.d.ts +10 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +20 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +8 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/table.d.ts +24 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +7 -0
- package/dist/components/ui/toast.d.ts +15 -0
- package/dist/components/ui/toaster.d.ts +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +44 -0
- package/dist/index.d.ts +3 -0
- package/dist/lib/caster.d.ts +3 -0
- package/dist/lib/helpers.d.ts +72 -0
- package/dist/lib/index.d.ts +6 -0
- package/{src/lib/lazy-upload.ts → dist/lib/lazy-upload.d.ts} +1 -12
- package/dist/lib/use-mobile.d.ts +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/react-components.es.js +28375 -0
- package/package.json +105 -76
- package/COMPONENTS_LIST.md +0 -106
- package/COMPONENTS_STATUS.md +0 -114
- package/HELPERS_GUIDE.md +0 -489
- package/MIGRATION_PLAN.md +0 -404
- package/SETUP_GUIDE.md +0 -125
- package/components.json +0 -21
- package/postcss.config.js +0 -6
- package/src/components/index.ts +0 -315
- package/src/components/ui/accordion.tsx +0 -54
- package/src/components/ui/alert-dialog.tsx +0 -115
- package/src/components/ui/alert.tsx +0 -49
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/async-select.tsx +0 -186
- package/src/components/ui/avatar.tsx +0 -45
- package/src/components/ui/badge.tsx +0 -38
- package/src/components/ui/breadcrumb.tsx +0 -102
- package/src/components/ui/button.tsx +0 -54
- package/src/components/ui/calendar.tsx +0 -193
- package/src/components/ui/card.tsx +0 -65
- package/src/components/ui/carousel.tsx +0 -243
- package/src/components/ui/checkbox.tsx +0 -67
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/combobox.tsx +0 -135
- package/src/components/ui/command.tsx +0 -143
- package/src/components/ui/common-modal.tsx +0 -95
- package/src/components/ui/context-menu.tsx +0 -189
- package/src/components/ui/date-picker.tsx +0 -112
- package/src/components/ui/date-selector-multiple.tsx +0 -197
- package/src/components/ui/dialog.tsx +0 -104
- package/src/components/ui/drawer.tsx +0 -100
- package/src/components/ui/dropdown-menu.tsx +0 -189
- package/src/components/ui/form.tsx +0 -171
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/image-uploader.tsx +0 -251
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.tsx +0 -38
- package/src/components/ui/label.tsx +0 -19
- package/src/components/ui/menubar.tsx +0 -231
- package/src/components/ui/month-picker-multiple.tsx +0 -351
- package/src/components/ui/multi-image-uploader.tsx +0 -283
- package/src/components/ui/multi-select.tsx +0 -1143
- package/src/components/ui/navigation-menu.tsx +0 -120
- package/src/components/ui/pagination.tsx +0 -72
- package/src/components/ui/popover.tsx +0 -42
- package/src/components/ui/progress.tsx +0 -25
- package/src/components/ui/radio-group.tsx +0 -38
- package/src/components/ui/resizable.tsx +0 -42
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -235
- package/src/components/ui/separator.tsx +0 -24
- package/src/components/ui/sheet.tsx +0 -119
- package/src/components/ui/sidebar.tsx +0 -683
- package/src/components/ui/skeleton.tsx +0 -7
- package/src/components/ui/slider.tsx +0 -57
- package/src/components/ui/sonner.tsx +0 -39
- package/src/components/ui/switch.tsx +0 -63
- package/src/components/ui/table.tsx +0 -94
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -34
- package/src/components/ui/toast.tsx +0 -122
- package/src/components/ui/toaster.tsx +0 -29
- package/src/components/ui/toggle-group.tsx +0 -55
- package/src/components/ui/toggle.tsx +0 -41
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/hooks/index.ts +0 -2
- package/src/hooks/use-toast.ts +0 -189
- package/src/icons.d.ts +0 -1
- package/src/index.ts +0 -4
- package/src/lib/caster.ts +0 -66
- package/src/lib/helpers.ts +0 -394
- package/src/lib/index.ts +0 -31
- package/src/lib/use-mobile.ts +0 -19
- package/src/lib/utils.ts +0 -6
- package/src/styles/globals.css +0 -658
- package/tailwind.config.ts +0 -8
- package/tsconfig.json +0 -31
- package/tsconfig.node.json +0 -11
package/MIGRATION_PLAN.md
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
# UI 프레임워크 마이그레이션 계획
|
|
2
|
-
|
|
3
|
-
## 📋 목표
|
|
4
|
-
|
|
5
|
-
semantic-ui-react → shadcn/ui + tailwindcss로 전환하고,
|
|
6
|
-
최종적으로 sonamu/ui로 모듈화하여 이전
|
|
7
|
-
|
|
8
|
-
## ✅ 완료된 작업 (Phase 1) - 100% 완료!
|
|
9
|
-
|
|
10
|
-
### 1. 기본 인프라 구축
|
|
11
|
-
|
|
12
|
-
- ✅ `packages/react-components` 디렉토리 구조 생성
|
|
13
|
-
- ✅ yarn workspace 설정 (`@sonamu-kit/react-components`)
|
|
14
|
-
- ✅ tailwindcss + PostCSS + shadcn/ui 기본 설정
|
|
15
|
-
- ✅ TypeScript 설정 (`moduleResolution: "bundler"`)
|
|
16
|
-
- ✅ 경로 문제 완벽 해결 (상대 경로 사용)
|
|
17
|
-
- ✅ 로컬 패키지 연결 및 동작 확인
|
|
18
|
-
|
|
19
|
-
### 2. shadcn/ui 컴포넌트 설치 (48개 완료!)
|
|
20
|
-
|
|
21
|
-
**Form & Input (12개):**
|
|
22
|
-
|
|
23
|
-
- ✅ Button, Form, Input, Textarea, Select
|
|
24
|
-
- ✅ Checkbox, Radio Group, Label, Switch, Slider
|
|
25
|
-
- ✅ Input OTP, Combobox (커스텀 구현)
|
|
26
|
-
|
|
27
|
-
**Data Display (7개):**
|
|
28
|
-
|
|
29
|
-
- ✅ Table, Card, Badge, Avatar
|
|
30
|
-
- ✅ Separator, Skeleton, Progress
|
|
31
|
-
|
|
32
|
-
**Feedback & Overlay (10개):**
|
|
33
|
-
|
|
34
|
-
- ✅ Dialog, Alert Dialog, Alert
|
|
35
|
-
- ✅ Toast + Toaster, Tooltip, Popover
|
|
36
|
-
- ✅ Sheet, Hover Card, Drawer
|
|
37
|
-
|
|
38
|
-
**Navigation (6개):**
|
|
39
|
-
|
|
40
|
-
- ✅ Tabs, Pagination, Navigation Menu
|
|
41
|
-
- ✅ Menubar, Breadcrumb, Command
|
|
42
|
-
|
|
43
|
-
**Menus (2개):**
|
|
44
|
-
|
|
45
|
-
- ✅ Dropdown Menu, Context Menu
|
|
46
|
-
|
|
47
|
-
**Date & Time (2개):**
|
|
48
|
-
|
|
49
|
-
- ✅ Calendar
|
|
50
|
-
- ✅ Date Picker (커스텀 구현, Popover + Calendar 조합)
|
|
51
|
-
|
|
52
|
-
**Layout (5개):**
|
|
53
|
-
|
|
54
|
-
- ✅ Scroll Area, Accordion, Collapsible
|
|
55
|
-
- ✅ Resizable, Aspect Ratio
|
|
56
|
-
|
|
57
|
-
**Other (4개):**
|
|
58
|
-
|
|
59
|
-
- ✅ Carousel, Toggle, Toggle Group, Sonner
|
|
60
|
-
|
|
61
|
-
### 3. 문서화 및 가이드
|
|
62
|
-
|
|
63
|
-
- ✅ 컴포넌트 가이드 페이지 완성 (`/admin/shadcn-guide`)
|
|
64
|
-
- 48개 컴포넌트 각각 Card로 구성
|
|
65
|
-
- 실제 동작하는 UI 예시
|
|
66
|
-
- 사용 방법 코드 스니펫 포함
|
|
67
|
-
- ✅ `COMPONENTS_LIST.md` - 전체 컴포넌트 목록 및 CLI 명령어
|
|
68
|
-
- ✅ `COMPONENTS_STATUS.md` - 설치 현황 추적
|
|
69
|
-
- ✅ `README.md` - 패키지 사용 가이드
|
|
70
|
-
- ✅ `SETUP_GUIDE.md` - 초기 설정 가이드
|
|
71
|
-
|
|
72
|
-
### 4. 기존 시스템 분석
|
|
73
|
-
|
|
74
|
-
- ✅ useTypeForm 사용 패턴 분석 완료
|
|
75
|
-
- ✅ useListParams 사용 패턴 분석 완료
|
|
76
|
-
|
|
77
|
-
**분석 결과:**
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
// 기존 useTypeForm 패턴
|
|
81
|
-
const { form, setForm, register } = useTypeForm(ZodSchema, initialValues);
|
|
82
|
-
|
|
83
|
-
// 기존 useListParams 패턴
|
|
84
|
-
const { listParams, register } = useListParams(ZodSchema, initialValues);
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 5. 의존성 설치
|
|
88
|
-
|
|
89
|
-
- ✅ react-hook-form, @hookform/resolvers 설치 완료
|
|
90
|
-
- ✅ date-fns 설치 완료
|
|
91
|
-
- ✅ 모든 @radix-ui 컴포넌트 의존성 자동 설치됨
|
|
92
|
-
- ✅ lucide-react (아이콘), class-variance-authority, clsx, tailwind-merge 등
|
|
93
|
-
|
|
94
|
-
## 🚀 다음 단계 (Phase 2 - Hooks 재구현)
|
|
95
|
-
|
|
96
|
-
### 1. react-hook-form 기반 useTypeForm 재구현
|
|
97
|
-
|
|
98
|
-
**목표:**
|
|
99
|
-
|
|
100
|
-
- 기존 API와 호환성 유지
|
|
101
|
-
- shadcn/ui Form 컴포넌트와 통합
|
|
102
|
-
- Zod 스키마 기반 타입 안정성
|
|
103
|
-
|
|
104
|
-
**구현 계획:**
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
// packages/react-components/src/hooks/use-type-form.ts
|
|
108
|
-
|
|
109
|
-
import { useForm } from "react-hook-form";
|
|
110
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
111
|
-
import { z } from "zod";
|
|
112
|
-
|
|
113
|
-
export function useTypeForm<T extends z.ZodType>(
|
|
114
|
-
schema: T,
|
|
115
|
-
defaultValues: z.infer<T>
|
|
116
|
-
) {
|
|
117
|
-
const form = useForm<z.infer<T>>({
|
|
118
|
-
resolver: zodResolver(schema),
|
|
119
|
-
defaultValues,
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// semantic-ui-react register 호환 래퍼
|
|
123
|
-
const register = (name: keyof z.infer<T>) => ({
|
|
124
|
-
name,
|
|
125
|
-
value: form.watch(name),
|
|
126
|
-
onChange: (e: any, { value }: any) => {
|
|
127
|
-
form.setValue(name, value);
|
|
128
|
-
},
|
|
129
|
-
error: !!form.formState.errors[name],
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
form: form.watch(),
|
|
134
|
-
setForm: (values: Partial<z.infer<T>>) => {
|
|
135
|
-
Object.entries(values).forEach(([key, value]) => {
|
|
136
|
-
form.setValue(key as any, value);
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
register,
|
|
140
|
-
rhfForm: form, // react-hook-form 네이티브 폼 객체
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### 2. useListParams URL 연동 재구현
|
|
146
|
-
|
|
147
|
-
**목표:**
|
|
148
|
-
|
|
149
|
-
- URL 쿼리 파라미터와 동기화
|
|
150
|
-
- tanstack-router의 search params와 통합
|
|
151
|
-
- 페이지네이션, 정렬, 필터링 지원
|
|
152
|
-
|
|
153
|
-
**구현 계획:**
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
// packages/react-components/src/hooks/use-list-params.ts
|
|
157
|
-
|
|
158
|
-
import { useNavigate, useSearch } from "@tanstack/react-router";
|
|
159
|
-
import { z } from "zod";
|
|
160
|
-
import { useCallback } from "react";
|
|
161
|
-
|
|
162
|
-
export function useListParams<T extends z.ZodType>(
|
|
163
|
-
schema: T,
|
|
164
|
-
defaultValues: z.infer<T>
|
|
165
|
-
) {
|
|
166
|
-
const navigate = useNavigate();
|
|
167
|
-
const searchParams = useSearch({ strict: false });
|
|
168
|
-
|
|
169
|
-
// URL에서 파라미터 파싱
|
|
170
|
-
const listParams = schema.parse({
|
|
171
|
-
...defaultValues,
|
|
172
|
-
...searchParams,
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// 파라미터 업데이트 함수
|
|
176
|
-
const updateParams = useCallback(
|
|
177
|
-
(updates: Partial<z.infer<T>>) => {
|
|
178
|
-
navigate({
|
|
179
|
-
search: (prev) => ({ ...prev, ...updates }),
|
|
180
|
-
});
|
|
181
|
-
},
|
|
182
|
-
[navigate]
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
// register 호환 함수
|
|
186
|
-
const register = (name: keyof z.infer<T>) => ({
|
|
187
|
-
name,
|
|
188
|
-
value: listParams[name],
|
|
189
|
-
onChange: (e: any, { value }: any) => {
|
|
190
|
-
updateParams({ [name]: value } as any);
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
listParams,
|
|
196
|
-
updateParams,
|
|
197
|
-
register,
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### 3. 필수 의존성 추가 (✅ 완료)
|
|
203
|
-
|
|
204
|
-
~~필요한 의존성은 모두 설치 완료~~
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
# ✅ 이미 설치됨
|
|
208
|
-
react-hook-form @hookform/resolvers
|
|
209
|
-
date-fns
|
|
210
|
-
zod (이미 프로젝트에 존재)
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## 🎯 Phase 3 - tanstack-router 마이그레이션
|
|
214
|
-
|
|
215
|
-
### 1. 라우터 기본 설정
|
|
216
|
-
|
|
217
|
-
```typescript
|
|
218
|
-
// packages/react-components/src/router/routes.ts
|
|
219
|
-
|
|
220
|
-
import { createRootRoute, createRoute } from "@tanstack/react-router";
|
|
221
|
-
|
|
222
|
-
// 기본 route tree 구성
|
|
223
|
-
// Admin 영역과 Public 영역 분리
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### 2. 점진적 마이그레이션 전략
|
|
227
|
-
|
|
228
|
-
1. **공존 단계**: react-router-dom과 tanstack-router 병행 사용
|
|
229
|
-
2. **부분 교체**: Admin 페이지 한 섹션을 완전히 교체
|
|
230
|
-
3. **전체 교체**: 모든 페이지를 tanstack-router로 전환
|
|
231
|
-
|
|
232
|
-
## 🔄 Phase 4 - 점진적 컴포넌트 마이그레이션
|
|
233
|
-
|
|
234
|
-
### 우선순위
|
|
235
|
-
|
|
236
|
-
1. **Form 관련 페이지** (가장 많이 사용)
|
|
237
|
-
|
|
238
|
-
- `/admin/antimicrobials/form`
|
|
239
|
-
- `/admin/patients/form`
|
|
240
|
-
- 등등...
|
|
241
|
-
|
|
242
|
-
2. **List 페이지**
|
|
243
|
-
|
|
244
|
-
- `/admin/antimicrobials`
|
|
245
|
-
- `/admin/patients`
|
|
246
|
-
- 등등...
|
|
247
|
-
|
|
248
|
-
3. **기타 페이지**
|
|
249
|
-
|
|
250
|
-
### 마이그레이션 체크리스트 (페이지당)
|
|
251
|
-
|
|
252
|
-
- [ ] Form.Input → Form + Input (shadcn/ui)
|
|
253
|
-
- [ ] Form.Select → Form + Select (shadcn/ui)
|
|
254
|
-
- [ ] Dropdown → Select (shadcn/ui)
|
|
255
|
-
- [ ] Button → Button (shadcn/ui)
|
|
256
|
-
- [ ] Table → Table (shadcn/ui)
|
|
257
|
-
- [ ] Modal → Dialog (shadcn/ui)
|
|
258
|
-
- [ ] useTypeForm → useTypeForm (new)
|
|
259
|
-
- [ ] useListParams → useListParams (new)
|
|
260
|
-
|
|
261
|
-
## 📦 Phase 5 - sonamu/ui로 이전
|
|
262
|
-
|
|
263
|
-
### 준비 작업
|
|
264
|
-
|
|
265
|
-
1. **패키지 독립성 검증**
|
|
266
|
-
|
|
267
|
-
- web 프로젝트 특정 코드 제거
|
|
268
|
-
- 순수한 UI 라이브러리로 정리
|
|
269
|
-
|
|
270
|
-
2. **문서화**
|
|
271
|
-
|
|
272
|
-
- README.md 완성
|
|
273
|
-
- 컴포넌트별 사용 예제
|
|
274
|
-
- Storybook 추가 고려
|
|
275
|
-
|
|
276
|
-
3. **빌드 설정**
|
|
277
|
-
|
|
278
|
-
- TypeScript 빌드
|
|
279
|
-
- CSS 번들링
|
|
280
|
-
- ESM/CJS 동시 지원
|
|
281
|
-
|
|
282
|
-
4. **이전 실행**
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
# sonamu/ui 리포지토리로 이동
|
|
286
|
-
cp -r packages/react-components/* sonamu/ui/
|
|
287
|
-
|
|
288
|
-
# web 프로젝트에서는 npm 패키지로 사용
|
|
289
|
-
# web/package.json
|
|
290
|
-
{
|
|
291
|
-
"dependencies": {
|
|
292
|
-
"@sonamu/ui": "^1.0.0"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
## ⚠️ 주의사항
|
|
298
|
-
|
|
299
|
-
### 스타일 충돌 방지
|
|
300
|
-
|
|
301
|
-
- semantic-ui-css와 tailwindcss 공존 시 CSS 우선순위 문제
|
|
302
|
-
- 점진적 마이그레이션 시 스타일 격리 필요
|
|
303
|
-
- Tailwind의 reset CSS가 기존 스타일에 영향
|
|
304
|
-
|
|
305
|
-
### API 호환성
|
|
306
|
-
|
|
307
|
-
- 기존 코드 변경 최소화를 위해 register API 호환성 유지
|
|
308
|
-
- 하지만 새로운 기능은 react-hook-form 네이티브 API 사용 권장
|
|
309
|
-
|
|
310
|
-
### 테스트
|
|
311
|
-
|
|
312
|
-
- 각 마이그레이션 단계마다 철저한 테스트
|
|
313
|
-
- Form validation 동작 확인
|
|
314
|
-
- URL 파라미터 동기화 확인
|
|
315
|
-
|
|
316
|
-
## 📊 현재 진행 상황
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
[██████████] 100% - Phase 1 완료! 🎉
|
|
320
|
-
[░░░░░░░░░░] 0% - Phase 2 준비 완료, 구현 대기
|
|
321
|
-
[░░░░░░░░░░] 0% - Phase 3 대기
|
|
322
|
-
[░░░░░░░░░░] 0% - Phase 4 대기
|
|
323
|
-
[░░░░░░░░░░] 0% - Phase 5 대기
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### 🎯 현재 상태 요약
|
|
327
|
-
|
|
328
|
-
- ✅ **48개 컴포넌트** 설치 및 테스트 완료
|
|
329
|
-
- ✅ **전체 가이드 페이지** 구현 완료
|
|
330
|
-
- ✅ **경로 문제** 완벽 해결
|
|
331
|
-
- ✅ **TypeScript 설정** 최적화
|
|
332
|
-
- ✅ **의존성** 모두 설치
|
|
333
|
-
- ⏳ **Hooks 구현** 시작 준비 완료
|
|
334
|
-
|
|
335
|
-
## 🎓 학습 리소스
|
|
336
|
-
|
|
337
|
-
- [shadcn/ui 공식 문서](https://ui.shadcn.com)
|
|
338
|
-
- [react-hook-form 공식 문서](https://react-hook-form.com)
|
|
339
|
-
- [TanStack Router 공식 문서](https://tanstack.com/router)
|
|
340
|
-
- [Zod 공식 문서](https://zod.dev)
|
|
341
|
-
|
|
342
|
-
## 💡 다음 작업 제안
|
|
343
|
-
|
|
344
|
-
### 🎯 Phase 2 시작 준비 완료!
|
|
345
|
-
|
|
346
|
-
**Option 1: useTypeForm 먼저 구현 (추천 ⭐)**
|
|
347
|
-
|
|
348
|
-
1. **useTypeForm Hook 구현**
|
|
349
|
-
|
|
350
|
-
```typescript
|
|
351
|
-
// packages/react-components/src/hooks/use-type-form.ts
|
|
352
|
-
// react-hook-form 기반
|
|
353
|
-
// 기존 API 호환성 유지
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
2. **테스트 페이지 생성**
|
|
357
|
-
|
|
358
|
-
```typescript
|
|
359
|
-
// src/pages/admin/form-test.tsx
|
|
360
|
-
// 간단한 Form으로 PoC
|
|
361
|
-
// 기존 페이지와 비교
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
3. **실제 페이지 적용**
|
|
365
|
-
```typescript
|
|
366
|
-
// 예: antimicrobials/form
|
|
367
|
-
// 기존 코드와 병행 테스트
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
**Option 2: useListParams 먼저 구현**
|
|
371
|
-
|
|
372
|
-
1. **tanstack-router 기본 설정**
|
|
373
|
-
2. **useListParams Hook 구현**
|
|
374
|
-
3. **List 페이지 테스트**
|
|
375
|
-
|
|
376
|
-
**Option 3: 간단한 페이지 전체 마이그레이션**
|
|
377
|
-
|
|
378
|
-
1. 작은 Form 페이지 선택
|
|
379
|
-
2. 처음부터 끝까지 완전히 교체
|
|
380
|
-
3. 실전 경험 축적
|
|
381
|
-
|
|
382
|
-
---
|
|
383
|
-
|
|
384
|
-
### 📝 진행 방식
|
|
385
|
-
|
|
386
|
-
- ✅ Phase 1 완료로 모든 준비 완료
|
|
387
|
-
- 🎯 작은 단위로 점진적 진행
|
|
388
|
-
- 🔄 각 단계마다 동작 확인
|
|
389
|
-
- 🤝 기존 코드 유지하면서 새 코드 추가
|
|
390
|
-
|
|
391
|
-
### 🚀 바로 시작할 수 있는 첫 작업
|
|
392
|
-
|
|
393
|
-
```typescript
|
|
394
|
-
// 1단계: useTypeForm 구현
|
|
395
|
-
// packages/react-components/src/hooks/use-type-form.ts 생성
|
|
396
|
-
|
|
397
|
-
// 2단계: hooks export에 추가
|
|
398
|
-
// packages/react-components/src/hooks/index.ts
|
|
399
|
-
|
|
400
|
-
// 3단계: 테스트 페이지로 검증
|
|
401
|
-
// src/pages/admin/form-test.tsx
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
어떤 작업부터 시작하시겠어요? 🎯
|
package/SETUP_GUIDE.md
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# @sonamu-kit/react-components 설정 가이드
|
|
2
|
-
|
|
3
|
-
## 완료된 작업 ✅
|
|
4
|
-
|
|
5
|
-
### 1. 기본 구조 생성
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
packages/react-components/
|
|
9
|
-
├── src/
|
|
10
|
-
│ ├── components/
|
|
11
|
-
│ │ ├── ui/
|
|
12
|
-
│ │ │ └── button.tsx
|
|
13
|
-
│ │ └── index.ts
|
|
14
|
-
│ ├── hooks/
|
|
15
|
-
│ │ └── index.ts
|
|
16
|
-
│ ├── lib/
|
|
17
|
-
│ │ ├── utils.ts
|
|
18
|
-
│ │ └── index.ts
|
|
19
|
-
│ ├── router/
|
|
20
|
-
│ │ └── index.ts
|
|
21
|
-
│ └── styles/
|
|
22
|
-
│ └── globals.css
|
|
23
|
-
├── package.json
|
|
24
|
-
├── tsconfig.json
|
|
25
|
-
├── tailwind.config.ts
|
|
26
|
-
├── postcss.config.js
|
|
27
|
-
└── components.json
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### 2. 의존성 설치
|
|
31
|
-
|
|
32
|
-
- ✅ tailwindcss
|
|
33
|
-
- ✅ @tanstack/react-router
|
|
34
|
-
- ✅ shadcn/ui 관련 패키지 (clsx, tailwind-merge, cva, lucide-react)
|
|
35
|
-
- ✅ tailwindcss-animate
|
|
36
|
-
|
|
37
|
-
### 3. Workspace 연결
|
|
38
|
-
|
|
39
|
-
- ✅ web/package.json에 workspaces 설정
|
|
40
|
-
- ✅ @sonamu-kit/react-components를 web 프로젝트에서 사용 가능
|
|
41
|
-
|
|
42
|
-
### 4. PoC 테스트 페이지
|
|
43
|
-
|
|
44
|
-
- ✅ `/admin/shadcn-test` 페이지 생성
|
|
45
|
-
- ✅ Button 컴포넌트 테스트
|
|
46
|
-
|
|
47
|
-
## 테스트 방법
|
|
48
|
-
|
|
49
|
-
1. 개발 서버 실행:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
cd /Users/sehyeal/Development/amr/web
|
|
53
|
-
yarn dev
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
2. 브라우저에서 접속:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
http://localhost:22001/admin/shadcn-test
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## 다음 단계 🚀
|
|
63
|
-
|
|
64
|
-
### 1. tanstack-router 기본 설정
|
|
65
|
-
|
|
66
|
-
- Router 설정 파일 생성
|
|
67
|
-
- 기본 route 구조 설계
|
|
68
|
-
- react-router-dom과의 마이그레이션 전략
|
|
69
|
-
|
|
70
|
-
### 2. useTypeForm, useListParams 통합 hooks
|
|
71
|
-
|
|
72
|
-
- 기존 @sonamu-kit/react-sui의 hooks 분석
|
|
73
|
-
- shadcn/ui와 통합되는 새로운 hooks 설계
|
|
74
|
-
- Form 관련 컴포넌트 생성
|
|
75
|
-
|
|
76
|
-
### 3. 추가 컴포넌트
|
|
77
|
-
|
|
78
|
-
shadcn/ui CLI를 사용하여 필요한 컴포넌트 추가:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
cd packages/react-components
|
|
82
|
-
npx shadcn@latest add input
|
|
83
|
-
npx shadcn@latest add form
|
|
84
|
-
npx shadcn@latest add select
|
|
85
|
-
npx shadcn@latest add table
|
|
86
|
-
# ... 등등
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### 4. Figma Maker 코드 통합
|
|
90
|
-
|
|
91
|
-
- 디자이너와 협업하여 생성된 Figma 코드 통합
|
|
92
|
-
- 컴포넌트 스타일 커스터마이징
|
|
93
|
-
|
|
94
|
-
### 5. 점진적 마이그레이션
|
|
95
|
-
|
|
96
|
-
- Admin 페이지 중 하나를 선택하여 완전히 교체
|
|
97
|
-
- semantic-ui-react → shadcn/ui 마이그레이션
|
|
98
|
-
- react-router-dom → tanstack-router 마이그레이션
|
|
99
|
-
|
|
100
|
-
### 6. sonamu/ui로 이전 준비
|
|
101
|
-
|
|
102
|
-
- 독립적인 패키지로 완성
|
|
103
|
-
- 문서화
|
|
104
|
-
- 테스트 코드 작성
|
|
105
|
-
- npm 퍼블리시 준비
|
|
106
|
-
|
|
107
|
-
## 주의사항 ⚠️
|
|
108
|
-
|
|
109
|
-
1. **Peer Dependencies 경고**
|
|
110
|
-
|
|
111
|
-
- 현재 @sonamu-kit/react-components가 react, react-dom을 찾지 못하는 경고가 있음
|
|
112
|
-
- 실제 동작에는 문제 없음 (web 프로젝트의 react 사용)
|
|
113
|
-
- 필요시 shadcn-ui/package.json에 react, react-dom을 devDependencies에 추가 가능
|
|
114
|
-
|
|
115
|
-
2. **스타일 충돌**
|
|
116
|
-
|
|
117
|
-
- 기존 semantic-ui-css와 tailwindcss가 공존할 수 있음
|
|
118
|
-
- 점진적 마이그레이션 시 스타일 충돌 주의
|
|
119
|
-
|
|
120
|
-
3. **Import Path**
|
|
121
|
-
- `@sonamu-kit/react-components/components` - 컴포넌트
|
|
122
|
-
- `@sonamu-kit/react-components/hooks` - 훅스
|
|
123
|
-
- `@sonamu-kit/react-components/lib` - 유틸리티
|
|
124
|
-
- `@sonamu-kit/react-components/router` - 라우터 설정
|
|
125
|
-
- `@sonamu-kit/react-components/styles` - 스타일 (entry point에서 한 번만 import)
|
package/components.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "default",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "tailwind.config.ts",
|
|
8
|
-
"css": "src/styles/globals.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils",
|
|
16
|
-
"ui": "@/components/ui",
|
|
17
|
-
"lib": "@/lib",
|
|
18
|
-
"hooks": "@/hooks"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|