@mzc-fe/design-system 0.0.5 → 0.0.7-rc.0

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.
Files changed (174) hide show
  1. package/components/accordion/accordion.tsx +114 -0
  2. package/components/accordion/index.ts +1 -0
  3. package/components/alert/alert.tsx +97 -0
  4. package/components/alert/index.ts +1 -0
  5. package/components/alert-dialog/alert-dialog.tsx +190 -0
  6. package/components/alert-dialog/index.ts +1 -0
  7. package/components/aspect-ratio/aspect-ratio.tsx +23 -0
  8. package/components/aspect-ratio/index.ts +1 -0
  9. package/components/avatar/avatar.tsx +62 -0
  10. package/components/avatar/index.ts +1 -0
  11. package/components/badge/badge.tsx +58 -0
  12. package/components/badge/index.ts +1 -0
  13. package/components/breadcrumb/breadcrumb.tsx +132 -0
  14. package/components/breadcrumb/index.ts +1 -0
  15. package/components/button/button.tsx +77 -0
  16. package/components/button/index.ts +1 -0
  17. package/components/button-group/button-group.tsx +99 -0
  18. package/components/button-group/index.ts +1 -0
  19. package/components/calendar/calendar.tsx +235 -0
  20. package/components/calendar/index.ts +1 -0
  21. package/components/card/card.tsx +107 -0
  22. package/components/card/index.ts +1 -0
  23. package/components/carousel/carousel.tsx +263 -0
  24. package/components/carousel/index.ts +1 -0
  25. package/components/chart/chart.tsx +377 -0
  26. package/components/chart/index.ts +1 -0
  27. package/components/checkbox/checkbox.tsx +41 -0
  28. package/components/checkbox/index.ts +1 -0
  29. package/components/collapsible/collapsible.tsx +44 -0
  30. package/components/collapsible/index.ts +1 -0
  31. package/components/command/command.tsx +201 -0
  32. package/components/command/index.ts +1 -0
  33. package/components/context-menu/context-menu.tsx +270 -0
  34. package/components/context-menu/index.ts +1 -0
  35. package/components/dialog/dialog.tsx +166 -0
  36. package/components/dialog/index.ts +1 -0
  37. package/components/drawer/drawer.tsx +154 -0
  38. package/components/drawer/index.ts +1 -0
  39. package/components/dropdown-menu/dropdown-menu.tsx +276 -0
  40. package/components/dropdown-menu/index.ts +1 -0
  41. package/components/empty/empty.tsx +129 -0
  42. package/components/empty/index.ts +1 -0
  43. package/components/field/field.tsx +272 -0
  44. package/components/field/index.ts +1 -0
  45. package/components/form/form.tsx +197 -0
  46. package/components/form/index.ts +1 -0
  47. package/components/hover-card/hover-card.tsx +57 -0
  48. package/components/hover-card/index.ts +1 -0
  49. package/components/input/index.ts +1 -0
  50. package/components/input/input.tsx +31 -0
  51. package/components/input-group/index.ts +1 -0
  52. package/components/input-group/input-group.tsx +189 -0
  53. package/components/input-otp/index.ts +1 -0
  54. package/components/input-otp/input-otp.tsx +99 -0
  55. package/components/item/index.ts +1 -0
  56. package/components/item/item.tsx +225 -0
  57. package/components/kbd/index.ts +1 -0
  58. package/components/kbd/kbd.tsx +38 -0
  59. package/components/label/index.ts +1 -0
  60. package/components/label/label.tsx +33 -0
  61. package/components/menubar/index.ts +1 -0
  62. package/components/menubar/menubar.tsx +299 -0
  63. package/components/navigation-menu/index.ts +1 -0
  64. package/components/navigation-menu/navigation-menu.tsx +194 -0
  65. package/components/pagination/index.ts +1 -0
  66. package/components/pagination/pagination.tsx +153 -0
  67. package/components/popover/index.ts +1 -0
  68. package/components/popover/popover.tsx +106 -0
  69. package/components/progress/index.ts +1 -0
  70. package/components/progress/progress.tsx +39 -0
  71. package/components/radio-group/index.ts +1 -0
  72. package/components/radio-group/radio-group.tsx +57 -0
  73. package/components/resizable/index.ts +1 -0
  74. package/components/resizable/resizable.tsx +73 -0
  75. package/components/scroll-area/index.ts +1 -0
  76. package/components/scroll-area/scroll-area.tsx +72 -0
  77. package/components/select/index.ts +1 -0
  78. package/components/select/select.tsx +213 -0
  79. package/components/separator/index.ts +1 -0
  80. package/components/separator/separator.tsx +39 -0
  81. package/components/sheet/index.ts +1 -0
  82. package/components/sheet/sheet.tsx +160 -0
  83. package/components/sidebar/index.ts +1 -0
  84. package/components/sidebar/sidebar.tsx +776 -0
  85. package/components/skeleton/index.ts +1 -0
  86. package/components/skeleton/skeleton.tsx +21 -0
  87. package/components/slider/index.ts +1 -0
  88. package/components/slider/slider.tsx +75 -0
  89. package/components/sonner/index.ts +2 -0
  90. package/components/sonner/sonner.tsx +52 -0
  91. package/components/spinner/index.ts +1 -0
  92. package/components/spinner/spinner.tsx +26 -0
  93. package/components/switch/index.ts +1 -0
  94. package/components/switch/switch.tsx +39 -0
  95. package/components/table/index.ts +1 -0
  96. package/components/table/table.tsx +140 -0
  97. package/components/tabs/index.ts +1 -0
  98. package/components/tabs/tabs.tsx +94 -0
  99. package/components/textarea/index.ts +1 -0
  100. package/components/textarea/textarea.tsx +26 -0
  101. package/components/toggle/index.ts +1 -0
  102. package/components/toggle/toggle.tsx +58 -0
  103. package/components/toggle-group/index.ts +1 -0
  104. package/components/toggle-group/toggle-group.tsx +97 -0
  105. package/components/tooltip/index.ts +1 -0
  106. package/components/tooltip/tooltip.tsx +82 -0
  107. package/dist/components/accordion/accordion.d.ts +50 -0
  108. package/dist/components/alert/alert.d.ts +31 -0
  109. package/dist/components/alert-dialog/alert-dialog.d.ts +35 -0
  110. package/dist/components/aspect-ratio/aspect-ratio.d.ts +12 -0
  111. package/dist/components/avatar/avatar.d.ts +11 -0
  112. package/dist/components/badge/badge.d.ts +12 -0
  113. package/dist/components/breadcrumb/breadcrumb.d.ts +23 -0
  114. package/dist/components/button/button.d.ts +15 -0
  115. package/dist/components/button-group/button-group.d.ts +16 -0
  116. package/dist/components/calendar/calendar.d.ts +15 -0
  117. package/dist/components/card/card.d.ts +15 -0
  118. package/dist/components/carousel/carousel.d.ts +24 -0
  119. package/dist/components/chart/chart.d.ts +20 -0
  120. package/dist/components/checkbox/checkbox.d.ts +9 -0
  121. package/dist/components/collapsible/collapsible.d.ts +13 -0
  122. package/dist/components/command/command.d.ts +18 -0
  123. package/dist/components/context-menu/context-menu.d.ts +18 -0
  124. package/dist/components/dialog/dialog.d.ts +25 -0
  125. package/dist/components/drawer/drawer.d.ts +18 -0
  126. package/dist/components/dropdown-menu/dropdown-menu.d.ts +21 -0
  127. package/dist/components/empty/empty.d.ts +25 -0
  128. package/dist/components/field/field.d.ts +26 -0
  129. package/dist/components/form/form.d.ts +30 -1
  130. package/dist/components/hover-card/hover-card.d.ts +13 -0
  131. package/dist/components/input/input.d.ts +10 -0
  132. package/dist/components/input-group/input-group.d.ts +19 -0
  133. package/dist/components/input-otp/input-otp.d.ts +23 -0
  134. package/dist/components/item/item.d.ts +33 -1
  135. package/dist/components/kbd/kbd.d.ts +10 -0
  136. package/dist/components/label/label.d.ts +9 -0
  137. package/dist/components/menubar/menubar.d.ts +25 -0
  138. package/dist/components/navigation-menu/navigation-menu.d.ts +26 -0
  139. package/dist/components/pagination/pagination.d.ts +26 -0
  140. package/dist/components/popover/popover.d.ts +17 -0
  141. package/dist/components/progress/progress.d.ts +10 -0
  142. package/dist/components/radio-group/radio-group.d.ts +12 -0
  143. package/dist/components/resizable/resizable.d.ts +19 -0
  144. package/dist/components/scroll-area/scroll-area.d.ts +14 -0
  145. package/dist/components/select/select.d.ts +25 -0
  146. package/dist/components/separator/separator.d.ts +11 -0
  147. package/dist/components/sheet/sheet.d.ts +23 -0
  148. package/dist/components/sidebar/sidebar.d.ts +50 -0
  149. package/dist/components/skeleton/skeleton.d.ts +8 -0
  150. package/dist/components/slider/slider.d.ts +12 -0
  151. package/dist/components/sonner/sonner.d.ts +14 -0
  152. package/dist/components/spinner/spinner.d.ts +9 -0
  153. package/dist/components/switch/switch.d.ts +8 -0
  154. package/dist/components/table/table.d.ts +26 -0
  155. package/dist/components/tabs/tabs.d.ts +16 -6
  156. package/dist/components/textarea/textarea.d.ts +8 -0
  157. package/dist/components/toggle/toggle.d.ts +13 -0
  158. package/dist/components/toggle-group/toggle-group.d.ts +1 -0
  159. package/dist/components/tooltip/tooltip.d.ts +21 -0
  160. package/dist/design-system.css +1 -1
  161. package/dist/design-system.es.js +3493 -28470
  162. package/dist/design-system.umd.js +4 -257
  163. package/dist/index.d.ts +1 -1
  164. package/foundations/ThemeProvider.tsx +77 -0
  165. package/foundations/color.css +232 -0
  166. package/foundations/palette.css +249 -0
  167. package/foundations/spacing.css +8 -0
  168. package/foundations/typography.css +143 -0
  169. package/hooks/use-mobile.ts +19 -0
  170. package/index.css +173 -0
  171. package/index.ts +339 -0
  172. package/lib/utils.ts +6 -0
  173. package/package.json +40 -19
  174. package/README.md +0 -184
package/README.md DELETED
@@ -1,184 +0,0 @@
1
- # MZC Design System
2
-
3
- MZC 디자인 시스템은 React와 TypeScript로 구축된 재사용 가능한 컴포넌트 라이브러리입니다. Tailwind CSS와 Radix UI를 기반으로 하여 일관성 있고 접근성이 뛰어난 UI 컴포넌트를 제공합니다.
4
-
5
- ## 🚀 주요 특징
6
-
7
- - **TypeScript 지원**: 완전한 타입 안정성과 개발자 경험 향상
8
- - **Tailwind CSS**: 유틸리티 우선의 스타일링 시스템
9
- - **Radix UI**: 접근성이 뛰어난 헤드리스 UI 컴포넌트
10
- - **Storybook**: 컴포넌트 문서화 및 개발 환경
11
- - **다크 모드**: 테마 전환 기능 지원
12
- - **Variant 기반**: class-variance-authority를 활용한 유연한 컴포넌트 변형
13
-
14
- ## 📦 설치
15
-
16
- ```bash
17
- npm install @mzc-fe/design-system
18
- # 또는
19
- yarn add @mzc-fe/design-system
20
- ```
21
-
22
- ## 🛠️ 사용법
23
-
24
- ### 기본 설정
25
-
26
- ```tsx
27
- import { ThemeProvider } from "@mzc-fe/design-system";
28
- import "@mzc-fe/design-system/dist/design-system.css";
29
-
30
- function App() {
31
- return (
32
- <ThemeProvider defaultTheme="light">{/* 앱 컴포넌트들 */}</ThemeProvider>
33
- );
34
- }
35
- ```
36
-
37
- > **⚠️ Tailwind CSS 사용 시 주의사항**
38
- >
39
- > 프로젝트에서 Tailwind CSS를 함께 사용하는 경우, `design-system.css`가 **반드시** `@import 'tailwindcss'`보다 **먼저** import되어야 합니다. 순서가 잘못되면 디자인 시스템의 스타일이 Tailwind에 의해 덮어씌워질 수 있습니다.
40
- >
41
- > ```css
42
- > /* ✅ 올바른 순서 */
43
- > @import "@mzc-fe/design-system/dist/design-system.css";
44
- > @import "tailwindcss";
45
- >
46
- > /* ❌ 잘못된 순서 */
47
- > @import "tailwindcss";
48
- > @import "@mzc-fe/design-system/dist/design-system.css";
49
- > ```
50
-
51
- ### 디자인 토큰 사용
52
-
53
- ```tsx
54
- // CSS 클래스로 디자인 토큰 사용
55
- <div className="bg-main text-main p-2">
56
- <h1 className="font-h1-700">제목</h1>
57
- <p className="font-subtitle1-700">부제목</p>
58
- </div>
59
-
60
- // CSS 변수로 직접 사용
61
- <div style={{
62
- backgroundColor: 'var(--background-color-main)',
63
- color: 'var(--text-color-main)',
64
- padding: 'var(--spacing)'
65
- }}>
66
- 커스텀 스타일
67
- </div>
68
- ```
69
-
70
- ## 🎯 개발
71
-
72
- ### 개발 환경 설정
73
-
74
- ```bash
75
- # 의존성 설치
76
- yarn install
77
-
78
- # 개발 서버 실행
79
- yarn storybook
80
-
81
- # 빌드
82
- yarn build
83
-
84
- # 린트 검사
85
- yarn lint
86
- ```
87
-
88
- ### 로컬 테스트 (yalc)
89
-
90
- 다른 프로젝트에서 배포 전 디자인 시스템을 테스트하려면 [yalc](https://github.com/wclr/yalc)를 사용합니다.
91
-
92
- ```bash
93
- # yalc 전역 설치 (최초 1회)
94
- npm install -g yalc
95
-
96
- # 디자인 시스템 빌드 및 로컬 배포
97
- yarn publish:local
98
- ```
99
-
100
- 테스트할 프로젝트에서:
101
-
102
- ```bash
103
- # 디자인 시스템 로컬 버전 연결
104
- yalc add @mzc-fe/design-system
105
-
106
- # 의존성 재설치
107
- yarn install
108
- ```
109
-
110
- 테스트 완료 후 정리:
111
-
112
- ```bash
113
- # 로컬 버전 연결 해제
114
- yalc remove @mzc-fe/design-system
115
-
116
- # 또는 모든 yalc 패키지 제거
117
- yalc remove --all
118
- ```
119
-
120
- > **💡 Tip**: 디자인 시스템을 수정할 때마다 `yarn publish:local`을 실행하고, 테스트 프로젝트에서 `yalc update`를 실행하면 변경사항이 반영됩니다.
121
-
122
- ### 프로젝트 구조
123
-
124
- ```
125
- src/
126
- ├── components/ # 재사용 가능한 컴포넌트
127
- │ └── Button/ # Button 컴포넌트
128
- │ └── ... # Button 컴포넌트
129
- ├── foundations/ # 디자인 토큰 및 테마
130
- │ ├── color.css # 색상 토큰
131
- │ ├── spacing.css # 간격 토큰
132
- │ ├── typography.css # 타이포그래피 토큰
133
- │ └── ThemeProvider.tsx # 테마 관리
134
- └── lib/ # 유틸리티 함수
135
- └── utils.ts # 공통 유틸리티
136
- ```
137
-
138
- ## 🎨 디자인 토큰
139
-
140
- 프로젝트는 `@theme inline`과 CSS 변수를 활용한 디자인 토큰 시스템을 사용합니다:
141
-
142
- ### 색상 시스템 (`color.css`)
143
-
144
- - **토큰 매핑**: `@theme inline`을 통해 CSS 변수를 Tailwind 클래스에 매핑
145
- - **테마 지원**: 라이트/다크 모드 자동 전환
146
- - **자동 클래스 생성**: `--background-color-*`, `--text-color-*` 패턴으로 `bg-*`, `text-*` 클래스 자동 생성
147
-
148
- ```css
149
- /* 사용 예시 */
150
- .bg-main {
151
- background-color: var(--background-color-main);
152
- }
153
- .text-main {
154
- color: var(--text-color-main);
155
- }
156
- ```
157
-
158
- ### 간격 시스템 (`spacing.css`)
159
-
160
- - **기본 단위**: 4px 기준의 일관된 간격 시스템
161
- - **Tailwind 통합**: `p-2` → `padding: 8px` 자동 변환
162
-
163
- ### 타이포그래피 (`typography.css`)
164
-
165
- - **유틸리티 클래스**: `@utility`를 사용한 재사용 가능한 텍스트 스타일
166
- - **폰트 패밀리**: Pretendard 폰트 사용
167
- - **일관된 스타일**: `font-h1-700`, `font-subtitle1-700` 등 체계적인 명명 규칙
168
-
169
- ## 📚 Storybook
170
-
171
- 컴포넌트 문서화와 개발을 위해 Storybook을 사용합니다:
172
-
173
- ```bash
174
- yarn storybook
175
- ```
176
-
177
- Storybook을 통해 각 컴포넌트의 다양한 상태와 사용법을 확인할 수 있습니다.
178
-
179
- ## 🔗 관련 링크
180
-
181
- - [Tailwind CSS](https://tailwindcss.com/)
182
- - [Radix UI](https://www.radix-ui.com/)
183
- - [Storybook](https://storybook.js.org/)
184
- - [class-variance-authority](https://cva.style/)