@bigtablet/design-system 1.10.0 → 1.11.1

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/README.md CHANGED
@@ -1,331 +1,786 @@
1
1
  # Bigtablet Design System
2
2
 
3
- Bigtablet의 공통 UI 컴포넌트 및 디자인 시스템입니다.
4
- Foundation(디자인 토큰)과 Components(UI 컴포넌트)를 분리하여 관리하며,
5
- Storybook 기반 문서화와 Chromatic을 통한 시각적 테스트를 제공합니다.
3
+ [![npm version](https://img.shields.io/npm/v/@bigtablet/design-system.svg)](https://www.npmjs.com/package/@bigtablet/design-system)
4
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
5
 
7
- ---
6
+ Bigtablet의 공식 디자인 시스템으로, Foundation(디자인 토큰)과 Components(UI 컴포넌트)로 구성된 통합 UI 라이브러리입니다.
8
7
 
9
- ## Features
8
+ > **현재 버전**: v1.10.0 | **최근 업데이트**: 2025년 1월 7일
10
9
 
11
- - Foundation / Components 구조 분리
12
- - Storybook 8 기반 문서화
13
- - Chromatic 시각적 회귀 테스트
14
- - Pure React / Next.js 분리 번들
15
- - SCSS 기반 Design Token 관리
16
- - pnpm + GitHub Actions 자동 배포
10
+ [깃허브 링크](https://github.com/Bigtablet/bigtablet-design-system) | [📦 NPM 패키지](https://www.npmjs.com/package/@bigtablet/design-system)
17
11
 
18
12
  ---
19
13
 
20
- ## Tech Stack
14
+ ## 목차
21
15
 
22
- | Category | Technology |
23
- |--------|-----------|
24
- | Framework | React 19 |
25
- | Styling | SCSS |
26
- | Documentation | Storybook 8 |
27
- | Visual Test | Chromatic |
28
- | Build | tsup |
29
- | Package Manager | pnpm |
30
- | CI / CD | GitHub Actions |
16
+ - [주요 특징](#주요-특징)
17
+ - [설치](#설치)
18
+ - [빠른 시작](#빠른-시작)
19
+ - [프로젝트 구조](#프로젝트-구조)
20
+ - [Foundation (디자인 토큰)](#foundation-디자인-토큰)
21
+ - [Components (UI 컴포넌트)](#components-ui-컴포넌트)
22
+ - [개발 가이드](#개발-가이드)
23
+ - [기여하기](#기여하기)
24
+ - [라이센스](#라이센스)
31
25
 
32
26
  ---
33
27
 
34
- ## Project Structure
28
+ ## 주요 특징
35
29
 
36
- ```bash
37
- src/
38
- ├── styles/
39
- │ ├── ts/ # Foundation Tokens (TypeScript)
40
- │ │ ├── colors.ts
41
- │ │ ├── spacing.ts
42
- │ │ ├── typography.ts
43
- │ │ ├── radius.ts
44
- │ │ ├── shadows.ts
45
- │ │ ├── motion.ts
46
- │ │ ├── z-index.ts
47
- │ │ ├── breakpoints.ts
48
- │ │ └── a11y.ts
49
- │ └── scss/ # SCSS Token & Mixins
50
-
51
- ├── ui/
52
- │ ├── form/ # TextField, Checkbox, Radio, Switch, FileInput
53
- │ ├── feedback/ # Alert, Toast, Loading
54
- │ ├── navigation/ # Pagination, Sidebar
55
- │ ├── overlay/ # Modal
56
- │ ├── display/ # Card
57
- │ ├── general/ # Button, Select
58
- │ ├── skeleton/ # SkeletonCard, SkeletonList
59
- │ └── styles/ # Shared component styles
60
-
61
- ├── index.ts # Pure React exports
62
- └── next.ts # Next.js specific exports
63
- ```
64
-
65
- ## Design System Structure
66
-
67
- Bigtablet Design System은 **Foundation**과 **Components** 두 레이어로 구성됩니다.
68
- Foundation은 디자인의 기준과 규칙을 정의하고,
69
- Components는 이 기준을 사용해 실제 UI를 구성합니다.
30
+ **체계적인 구조**
31
+ - Foundation과 Components의 명확한 분리
32
+ - TypeScript 기반 타입 안정성
33
+ - SCSS 기반 스타일 토큰 관리
34
+
35
+ **개발자 경험**
36
+ - Storybook 8 기반 인터랙티브 문서화
37
+ - Chromatic 시각적 회귀 테스트
38
+ - Pure React / Next.js 전용 번들 제공
39
+
40
+ **최신 기술 스택**
41
+ - React 19 지원
42
+ - pnpm 워크스페이스
43
+ - GitHub Actions 자동 배포
44
+ - Changesets 기반 버전 관리
45
+
46
+ **디자인 시스템**
47
+ - 일관된 디자인 토큰 (색상, 타이포그래피, 간격 등)
48
+ - 접근성(a11y) 기본 지원
49
+ - 다크모드 준비중
70
50
 
71
51
  ---
72
52
 
73
- ## Foundation
53
+ ## 설치
74
54
 
75
- Storybook 경로:
55
+ ### npm
76
56
  ```bash
77
- src/styles/ts/colors.ts
57
+ npm install @bigtablet/design-system
78
58
  ```
79
- Foundation은 **모든 컴포넌트에서 공통으로 사용하는 디자인 기준**입니다.
80
- 컴포넌트 구현 시, 임의의 값 사용을 금지하고 반드시 Foundation 토큰을 사용해야 합니다.
81
-
82
- ### Colors
83
- - 브랜드, 배경, 텍스트, 상태(success / error / warning) 색상
84
- - 직접 색상 값 사용 금지
85
59
 
86
- 파일:
60
+ ### yarn
87
61
  ```bash
88
- src/styles/ts/colors.ts
62
+ yarn add @bigtablet/design-system
89
63
  ```
90
- ---
91
-
92
- ### Spacing
93
- - margin, padding, gap 기준 스케일
94
- - 레이아웃 일관성 유지 목적
95
64
 
96
- 파일:
65
+ ### pnpm
97
66
  ```bash
98
- src/styles/ts/spacing.ts
67
+ pnpm add @bigtablet/design-system
99
68
  ```
100
69
 
101
70
  ---
102
71
 
103
- ### Typography
104
- - 폰트 패밀리
105
- - 폰트 크기, 굵기, 줄 간격
106
- - Heading / Body / Caption 기준
72
+ ## 빠른 시작
73
+
74
+ ### Pure React 프로젝트
75
+
76
+ ```tsx
77
+ import { Button, TextField } from '@bigtablet/design-system';
78
+ import '@bigtablet/design-system/styles';
79
+
80
+ function App() {
81
+ return (
82
+ <div>
83
+ <TextField
84
+ label="이메일"
85
+ type="email"
86
+ placeholder="email@example.com"
87
+ />
88
+ <Button variant="primary" size="md">
89
+ 제출하기
90
+ </Button>
91
+ </div>
92
+ );
93
+ }
94
+ ```
107
95
 
108
- 파일:
109
- ```bash
110
- src/styles/ts/typography.ts
96
+ ### Next.js 프로젝트
97
+
98
+ ```tsx
99
+ import { Sidebar, Button } from '@bigtablet/design-system/next';
100
+ import '@bigtablet/design-system/styles';
101
+
102
+ export default function Layout({ children }) {
103
+ return (
104
+ <div>
105
+ <Sidebar
106
+ items={[
107
+ { label: '홈', href: '/' },
108
+ { label: '대시보드', href: '/dashboard' }
109
+ ]}
110
+ />
111
+ <main>{children}</main>
112
+ </div>
113
+ );
114
+ }
111
115
  ```
112
116
 
113
- ---
117
+ ### Foundation 토큰 사용
114
118
 
115
- ### Radius
116
- - 컴포넌트 모서리 둥글기 기준
117
- - 카드, 버튼, 입력 필드 등 공통 사용
119
+ ```tsx
120
+ import { colors, spacing, typography } from '@bigtablet/design-system/foundation';
118
121
 
119
- 파일:
120
- ```bash
121
- src/styles/ts/radius.ts
122
+ const StyledComponent = styled.div`
123
+ color: ${colors.brand.primary};
124
+ padding: ${spacing.md};
125
+ font-size: ${typography.body.fontSize};
126
+ `;
122
127
  ```
123
128
 
124
129
  ---
125
130
 
126
- ### Shadows
127
- - elevation 레벨 정의
128
- - 카드, 모달, 드롭다운 등 깊이 표현
131
+ ## 프로젝트 구조
129
132
 
130
- 파일:
131
- ```bash
132
- src/styles/ts/shadows.ts
133
+ ```
134
+ bigtablet-design-system/
135
+ ├── .changeset/ # 버전 관리 설정
136
+ ├── .github/
137
+ │ └── workflows/ # CI/CD 파이프라인
138
+ ├── .storybook/ # Storybook 설정
139
+ ├── public/ # 정적 리소스
140
+ ├── scripts/ # 빌드 및 배포 스크립트
141
+ ├── src/
142
+ │ ├── styles/
143
+ │ │ ├── ts/ # TypeScript 디자인 토큰
144
+ │ │ │ ├── colors.ts
145
+ │ │ │ ├── spacing.ts
146
+ │ │ │ ├── typography.ts
147
+ │ │ │ ├── radius.ts
148
+ │ │ │ ├── shadows.ts
149
+ │ │ │ ├── motion.ts
150
+ │ │ │ ├── z-index.ts
151
+ │ │ │ ├── breakpoints.ts
152
+ │ │ │ └── a11y.ts
153
+ │ │ └── scss/ # SCSS 믹스인 및 변수
154
+ │ ├── ui/
155
+ │ │ ├── form/ # 입력 컴포넌트
156
+ │ │ │ ├── Button/
157
+ │ │ │ ├── TextField/
158
+ │ │ │ ├── Checkbox/
159
+ │ │ │ ├── Radio/
160
+ │ │ │ ├── Switch/
161
+ │ │ │ ├── Select/
162
+ │ │ │ └── FileInput/
163
+ │ │ ├── feedback/ # 피드백 컴포넌트
164
+ │ │ │ ├── Alert/
165
+ │ │ │ ├── Toast/
166
+ │ │ │ └── Loading/
167
+ │ │ ├── navigation/ # 네비게이션 컴포넌트
168
+ │ │ │ ├── Pagination/
169
+ │ │ │ └── Sidebar/
170
+ │ │ ├── overlay/ # 오버레이 컴포넌트
171
+ │ │ │ └── Modal/
172
+ │ │ ├── display/ # 표시 컴포넌트
173
+ │ │ │ └── Card/
174
+ │ │ └── skeleton/ # 스켈레톤 컴포넌트
175
+ │ │ ├── SkeletonCard/
176
+ │ │ └── SkeletonList/
177
+ │ ├── index.ts # Pure React 진입점
178
+ │ └── next.ts # Next.js 진입점
179
+ ├── package.json
180
+ ├── tsconfig.json
181
+ ├── tsup.config.ts
182
+ └── README.md
133
183
  ```
134
184
 
135
185
  ---
136
186
 
137
- ### Motion
138
- - transition duration
139
- - easing curve 기준
187
+ ## Foundation (디자인 토큰)
188
+
189
+ Foundation은 **모든 컴포넌트의 기반이 되는 디자인 규칙**입니다. 컴포넌트 구현 시 임의의 값을 사용하지 않고 반드시 Foundation 토큰을 사용해야 합니다.
190
+
191
+ ### 1. Colors (색상)
192
+
193
+ 브랜드 색상, 배경색, 텍스트 색상, 상태 색상을 정의합니다.
194
+
195
+ ```typescript
196
+ // src/styles/ts/colors.ts
197
+ export const colors = {
198
+ brand: {
199
+ primary: '#0066FF',
200
+ secondary: '#00C896',
201
+ },
202
+ background: {
203
+ primary: '#FFFFFF',
204
+ secondary: '#F5F5F5',
205
+ },
206
+ text: {
207
+ primary: '#1A1A1A',
208
+ secondary: '#666666',
209
+ },
210
+ status: {
211
+ success: '#22C55E',
212
+ error: '#EF4444',
213
+ warning: '#F59E0B',
214
+ }
215
+ };
216
+ ```
140
217
 
141
- 파일:
142
- ```bash
143
- src/styles/ts/motion.ts
218
+ **사용 예시:**
219
+ ```tsx
220
+ <Button style={{ backgroundColor: colors.brand.primary }}>
221
+ 클릭
222
+ </Button>
144
223
  ```
145
224
 
146
- ---
225
+ ### 2. Spacing (간격)
147
226
 
148
- ### Z-Index
149
- - 레이어 우선순위 정의
150
- - modal, toast, dropdown 등
227
+ 일관된 레이아웃을 위한 margin, padding, gap 기준을 정의합니다.
151
228
 
152
- 파일:
153
- ```bash
154
- src/styles/ts/z-index.ts
229
+ ```typescript
230
+ // src/styles/ts/spacing.ts
231
+ export const spacing = {
232
+ xs: '4px',
233
+ sm: '8px',
234
+ md: '16px',
235
+ lg: '24px',
236
+ xl: '32px',
237
+ xxl: '48px',
238
+ };
155
239
  ```
156
240
 
157
- ---
241
+ ### 3. Typography (타이포그래피)
242
+
243
+ 폰트 패밀리, 크기, 굵기, 줄 간격을 정의합니다.
244
+
245
+ ```typescript
246
+ // src/styles/ts/typography.ts
247
+ export const typography = {
248
+ fontFamily: {
249
+ base: 'Pretendard, -apple-system, sans-serif',
250
+ mono: 'Fira Code, monospace',
251
+ },
252
+ heading: {
253
+ h1: { fontSize: '32px', lineHeight: '40px', fontWeight: 700 },
254
+ h2: { fontSize: '24px', lineHeight: '32px', fontWeight: 700 },
255
+ h3: { fontSize: '20px', lineHeight: '28px', fontWeight: 600 },
256
+ },
257
+ body: {
258
+ large: { fontSize: '16px', lineHeight: '24px', fontWeight: 400 },
259
+ medium: { fontSize: '14px', lineHeight: '20px', fontWeight: 400 },
260
+ small: { fontSize: '12px', lineHeight: '16px', fontWeight: 400 },
261
+ }
262
+ };
263
+ ```
158
264
 
159
- ### Breakpoints
160
- - 반응형 기준 해상도
265
+ ### 4. Radius (둥근 모서리)
161
266
 
162
- 권장 구분:
163
- - mobile
164
- - tablet
165
- - laptop
166
- - desktop
267
+ 컴포넌트의 모서리 둥글기 기준을 정의합니다.
167
268
 
168
- 파일:
169
- ```bash
170
- src/styles/ts/breakpoints.ts
269
+ ```typescript
270
+ // src/styles/ts/radius.ts
271
+ export const radius = {
272
+ none: '0',
273
+ sm: '4px',
274
+ md: '8px',
275
+ lg: '12px',
276
+ full: '9999px',
277
+ };
171
278
  ```
172
- ---
173
279
 
174
- ### Accessibility (A11y)
175
- - 포커스 링 스타일
176
- - 최소 터치 영역 크기
177
- - 접근성 기준 토큰
280
+ ### 5. Shadows (그림자)
178
281
 
179
- 파일:
180
- ```bash
181
- src/styles/ts/a11y.ts
282
+ elevation 레벨에 따른 그림자를 정의합니다.
283
+
284
+ ```typescript
285
+ // src/styles/ts/shadows.ts
286
+ export const shadows = {
287
+ sm: '0 1px 2px rgba(0, 0, 0, 0.05)',
288
+ md: '0 4px 6px rgba(0, 0, 0, 0.1)',
289
+ lg: '0 10px 15px rgba(0, 0, 0, 0.1)',
290
+ xl: '0 20px 25px rgba(0, 0, 0, 0.15)',
291
+ };
182
292
  ```
183
- 예시:
184
- ```ts
185
- focusRing
186
- focusRingError
187
- tapMinSize
293
+
294
+ ### 6. Motion (애니메이션)
295
+
296
+ transition duration과 easing curve를 정의합니다.
297
+
298
+ ```typescript
299
+ // src/styles/ts/motion.ts
300
+ export const motion = {
301
+ duration: {
302
+ fast: '150ms',
303
+ normal: '300ms',
304
+ slow: '500ms',
305
+ },
306
+ easing: {
307
+ ease: 'ease',
308
+ easeIn: 'ease-in',
309
+ easeOut: 'ease-out',
310
+ easeInOut: 'ease-in-out',
311
+ }
312
+ };
188
313
  ```
189
- ---
190
314
 
191
- ## Components
315
+ ### 7. Z-Index (레이어 우선순위)
192
316
 
193
- Storybook 경로 규칙:
194
- ```bash
195
- src/stories/components/name.stoires.tsx
317
+ 컴포넌트 레이어의 우선순위를 정의합니다.
318
+
319
+ ```typescript
320
+ // src/styles/ts/z-index.ts
321
+ export const zIndex = {
322
+ base: 0,
323
+ dropdown: 1000,
324
+ sticky: 1100,
325
+ modal: 1300,
326
+ toast: 1400,
327
+ tooltip: 1500,
328
+ };
196
329
  ```
197
- Components는 Foundation 토큰을 기반으로 구현된 **실제 UI 컴포넌트 레이어**입니다.
198
- 모든 컴포넌트는 다음 원칙을 따릅니다.
199
330
 
200
- - Foundation 토큰(colors, spacing, typography 등)만 사용
201
- - 상태(hover, active, disabled, error 등) 명확히 정의
202
- - 접근성(a11y) 기본 고려
203
- - Storybook 문서 필수 제공
331
+ ### 8. Breakpoints (반응형 기준)
332
+
333
+ 반응형 디자인을 위한 화면 크기 기준을 정의합니다.
334
+
335
+ ```typescript
336
+ // src/styles/ts/breakpoints.ts
337
+ export const breakpoints = {
338
+ mobile: '320px',
339
+ tablet: '768px',
340
+ laptop: '1024px',
341
+ desktop: '1440px',
342
+ };
343
+ ```
344
+
345
+ ### 9. Accessibility (접근성)
346
+
347
+ 접근성을 위한 기준을 정의합니다.
348
+
349
+ ```typescript
350
+ // src/styles/ts/a11y.ts
351
+ export const a11y = {
352
+ focusRing: '0 0 0 3px rgba(0, 102, 255, 0.3)',
353
+ focusRingError: '0 0 0 3px rgba(239, 68, 68, 0.3)',
354
+ tapMinSize: '44px', // 최소 터치 영역
355
+ };
356
+ ```
204
357
 
205
358
  ---
206
359
 
207
- ### Form
360
+ ## Components (UI 컴포넌트)
361
+
362
+ Components는 Foundation 토큰을 기반으로 구현된 실제 UI 요소입니다.
208
363
 
209
- 사용자 입력을 담당하는 컴포넌트들입니다.
364
+ ### Form (입력 컴포넌트)
210
365
 
211
366
  #### Button
212
- - 기본 액션 버튼
213
- - variant: primary / secondary / ghost / danger
214
- - size: sm / md / lg
367
+
368
+ ```tsx
369
+ <Button variant="primary" size="md" onClick={() => alert('클릭!')}>
370
+ 기본 버튼
371
+ </Button>
372
+ ```
373
+
374
+ **Props:**
375
+ - `variant`: `primary` | `secondary` | `ghost` | `danger`
376
+ - `size`: `sm` | `md` | `lg`
377
+ - `disabled`: `boolean`
378
+ - `loading`: `boolean`
215
379
 
216
380
  #### TextField
217
- - 텍스트 입력 필드
218
- - label, helperText 지원
219
- - error / success 상태 지원
220
- - leftIcon / rightIcon 지원
381
+
382
+ ```tsx
383
+ <TextField
384
+ label="이메일"
385
+ type="email"
386
+ placeholder="email@example.com"
387
+ helperText="이메일을 입력해주세요"
388
+ error={false}
389
+ leftIcon={<EmailIcon />}
390
+ />
391
+ ```
392
+
393
+ **Props:**
394
+ - `label`: `string`
395
+ - `type`: `text` | `email` | `password` | `number`
396
+ - `error`: `boolean`
397
+ - `helperText`: `string`
398
+ - `leftIcon` / `rightIcon`: `ReactNode`
221
399
 
222
400
  #### Checkbox
223
- - 다중 선택 입력
224
- - indeterminate 상태 지원
401
+
402
+ ```tsx
403
+ <Checkbox
404
+ checked={isChecked}
405
+ onChange={(e) => setIsChecked(e.target.checked)}
406
+ label="동의합니다"
407
+ indeterminate={false}
408
+ />
409
+ ```
225
410
 
226
411
  #### Radio
227
- - 단일 선택 입력
228
- - 동일한 name으로 그룹 구성
412
+
413
+ ```tsx
414
+ <Radio
415
+ name="option"
416
+ value="1"
417
+ checked={selected === '1'}
418
+ onChange={(e) => setSelected(e.target.value)}
419
+ label="옵션 1"
420
+ />
421
+ ```
229
422
 
230
423
  #### Switch
231
- - ON / OFF 토글 입력
232
- - controlled / uncontrolled 모두 지원
424
+
425
+ ```tsx
426
+ <Switch
427
+ checked={isOn}
428
+ onChange={(checked) => setIsOn(checked)}
429
+ label="알림 받기"
430
+ />
431
+ ```
233
432
 
234
433
  #### Select
235
- - 드롭다운 선택 컴포넌트
236
- - 키보드 및 마우스 인터랙션 지원
237
- - controlled / uncontrolled 모두 지원
434
+
435
+ ```tsx
436
+ <Select
437
+ options={[
438
+ { value: '1', label: '옵션 1' },
439
+ { value: '2', label: '옵션 2' },
440
+ ]}
441
+ value={selected}
442
+ onChange={(value) => setSelected(value)}
443
+ placeholder="선택하세요"
444
+ />
445
+ ```
238
446
 
239
447
  #### FileInput
240
- - 파일 선택 입력
241
- - 커스텀 UI 제공
242
448
 
243
- ---
449
+ ```tsx
450
+ <FileInput
451
+ accept="image/*"
452
+ onChange={(file) => console.log(file)}
453
+ label="파일 선택"
454
+ />
455
+ ```
244
456
 
245
- ### Feedback
457
+ ---
246
458
 
247
- 사용자에게 상태 피드백을 전달하는 컴포넌트들입니다.
459
+ ### Feedback (피드백 컴포넌트)
248
460
 
249
461
  #### Alert
250
- - 모달 형태의 알림
251
- - info / success / warning / error variant
252
- - confirm / cancel 액션 지원
253
- - useAlert 훅 기반
462
+
463
+ ```tsx
464
+ import { useAlert } from '@bigtablet/design-system';
465
+
466
+ function Component() {
467
+ const alert = useAlert();
468
+
469
+ const handleClick = () => {
470
+ alert.show({
471
+ title: '알림',
472
+ message: '작업이 완료되었습니다.',
473
+ variant: 'success',
474
+ onConfirm: () => console.log('확인'),
475
+ onCancel: () => console.log('취소'),
476
+ });
477
+ };
478
+ }
479
+ ```
480
+
481
+ **Variants:** `info` | `success` | `warning` | `error`
482
+
483
+ #### Toast
484
+
485
+ ```tsx
486
+ import { ToastProvider, useToast } from '@bigtablet/design-system';
487
+
488
+ function App() {
489
+ return (
490
+ <ToastProvider>
491
+ <YourComponent />
492
+ </ToastProvider>
493
+ );
494
+ }
495
+
496
+ function YourComponent() {
497
+ const toast = useToast();
498
+
499
+ return (
500
+ <button onClick={() => toast.success('저장되었습니다')}>
501
+ 저장
502
+ </button>
503
+ );
504
+ }
505
+ ```
506
+
507
+ **메서드:**
508
+ - `toast.success(message)`
509
+ - `toast.error(message)`
510
+ - `toast.warning(message)`
511
+ - `toast.info(message)`
512
+ - `toast.message(message)`
254
513
 
255
514
  #### Loading
256
- - 인라인 로딩 스피너
257
- - 크기 조절 가능
258
515
 
259
- #### ToastProvider / useToast
260
- - 전역 토스트 메시지
261
- - success / error / warning / info / message 타입 제공
262
- - 내부적으로 react-toastify 사용
516
+ ```tsx
517
+ <Loading size="md" />
518
+ ```
263
519
 
264
- ---
520
+ **Props:**
521
+ - `size`: `sm` | `md` | `lg`
265
522
 
266
- ### Navigation
523
+ ---
267
524
 
268
- 페이지 이동 흐름 제어 컴포넌트입니다.
525
+ ### Navigation (네비게이션 컴포넌트)
269
526
 
270
527
  #### Pagination
271
- - Prev / Next 기반 페이지네이션
272
- - controlled 방식으로 상태 관리
273
528
 
274
- #### Sidebar
275
- - 좌측 네비게이션 메뉴
276
- - 활성 경로 표시
277
- - match 모드 지원 (startsWith / exact)
278
- - Next.js 전용 컴포넌트
529
+ ```tsx
530
+ <Pagination
531
+ currentPage={page}
532
+ totalPages={10}
533
+ onPageChange={(newPage) => setPage(newPage)}
534
+ />
535
+ ```
279
536
 
280
- ---
537
+ #### Sidebar (Next.js 전용)
281
538
 
282
- ### Overlay
539
+ ```tsx
540
+ import { Sidebar } from '@bigtablet/design-system/next';
283
541
 
284
- 콘텐츠 위에 표시되는 레이어 컴포넌트입니다.
542
+ <Sidebar
543
+ items={[
544
+ { label: '홈', href: '/', icon: <HomeIcon /> },
545
+ { label: '대시보드', href: '/dashboard', icon: <DashboardIcon /> },
546
+ ]}
547
+ matchMode="startsWith" // 'startsWith' | 'exact'
548
+ />
549
+ ```
550
+
551
+ ---
552
+
553
+ ### Overlay (오버레이 컴포넌트)
285
554
 
286
555
  #### Modal
287
- - 중앙 정렬 오버레이
288
- - ESC / 오버레이 클릭 닫기 지원
289
- - 제목 영역 optional
290
556
 
291
- ---
557
+ ```tsx
558
+ <Modal
559
+ isOpen={isOpen}
560
+ onClose={() => setIsOpen(false)}
561
+ title="모달 제목"
562
+ >
563
+ <p>모달 내용</p>
564
+ </Modal>
565
+ ```
292
566
 
293
- ### Display
567
+ **Props:**
568
+ - `isOpen`: `boolean`
569
+ - `onClose`: `() => void`
570
+ - `title`: `string` (optional)
571
+ - `closeOnOverlayClick`: `boolean` (default: `true`)
572
+ - `closeOnEsc`: `boolean` (default: `true`)
294
573
 
295
- 정보를 시각적으로 표현하는 컴포넌트입니다.
574
+ ---
575
+
576
+ ### Display (표시 컴포넌트)
296
577
 
297
578
  #### Card
298
- - 콘텐츠 그룹화용 컨테이너
299
- - elevation 및 padding 포함
300
579
 
301
- ---
580
+ ```tsx
581
+ <Card elevation="md" padding="lg">
582
+ <h3>카드 제목</h3>
583
+ <p>카드 내용</p>
584
+ </Card>
585
+ ```
302
586
 
303
- ### Skeleton
587
+ **Props:**
588
+ - `elevation`: `sm` | `md` | `lg` | `xl`
589
+ - `padding`: `sm` | `md` | `lg` | `xl`
304
590
 
305
- 로딩 중 UI를 표현하는 컴포넌트입니다.
591
+ ---
592
+
593
+ ### Skeleton (로딩 상태 컴포넌트)
306
594
 
307
595
  #### SkeletonCard
308
- - 카드 형태 스켈레톤
596
+
597
+ ```tsx
598
+ <SkeletonCard />
599
+ ```
309
600
 
310
601
  #### SkeletonList
311
- - 리스트 형태 스켈레톤
602
+
603
+ ```tsx
604
+ <SkeletonList count={5} />
605
+ ```
606
+
607
+ ---
608
+
609
+ ## 개발 가이드
610
+
611
+ ### 로컬 개발 환경 설정
612
+
613
+ ```bash
614
+ # 저장소 클론
615
+ git clone https://github.com/Bigtablet/bigtablet-design-system.git
616
+ cd bigtablet-design-system
617
+
618
+ # 의존성 설치
619
+ pnpm install
620
+
621
+ # Storybook 실행
622
+ pnpm storybook
623
+
624
+ # 빌드
625
+ pnpm build
626
+
627
+ # 테스트
628
+ pnpm test
629
+ ```
630
+
631
+ ### Storybook 가이드라인
632
+
633
+ 1. **Title 규칙**
634
+ - Foundation: `foundation/Colors`, `foundation/Typography`
635
+ - Components: `components/Button`, `components/TextField`
636
+
637
+ 2. **Story 작성 원칙**
638
+ - 기본 상태(Default) 필수 포함
639
+ - 모든 variant와 size 예시 제공
640
+ - 실제 사용 사례 중심으로 작성
641
+ - 명확한 설명과 문서화
642
+
643
+ 3. **예시**
644
+
645
+ ```tsx
646
+ // Button.stories.tsx
647
+ import type { Meta, StoryObj } from '@storybook/react';
648
+ import { Button } from './Button';
649
+
650
+ const meta: Meta<typeof Button> = {
651
+ title: 'components/Button',
652
+ component: Button,
653
+ tags: ['autodocs'],
654
+ };
655
+
656
+ export default meta;
657
+ type Story = StoryObj<typeof Button>;
658
+
659
+ export const Default: Story = {
660
+ args: {
661
+ children: '기본 버튼',
662
+ variant: 'primary',
663
+ size: 'md',
664
+ },
665
+ };
666
+
667
+ export const Variants: Story = {
668
+ render: () => (
669
+ <>
670
+ <Button variant="primary">Primary</Button>
671
+ <Button variant="secondary">Secondary</Button>
672
+ <Button variant="ghost">Ghost</Button>
673
+ <Button variant="danger">Danger</Button>
674
+ </>
675
+ ),
676
+ };
677
+ ```
678
+
679
+ ### 컴포넌트 개발 원칙
680
+
681
+ 1. **Foundation 토큰 사용 필수**
682
+ - 직접적인 색상/크기 값 사용 금지
683
+ - 모든 스타일은 토큰을 통해 정의
684
+
685
+ 2. **접근성(a11y) 고려**
686
+ - 키보드 네비게이션 지원
687
+ - 스크린 리더 호환
688
+ - 적절한 ARIA 속성 사용
689
+
690
+ 3. **상태 관리**
691
+ - hover, active, disabled, error 등 명확히 정의
692
+ - loading 상태 제공
693
+
694
+ 4. **TypeScript 타입**
695
+ - Props 타입 명확히 정의
696
+ - Generic 타입 적절히 활용
312
697
 
313
698
  ---
314
699
 
315
- ## Storybook Guidelines
700
+ ## 기여하기
701
+
702
+ 기여는 언제나 환영합니다! 다음 절차를 따라주세요:
703
+
704
+ 1. Fork the repository
705
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
706
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
707
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
708
+ 5. Open a Pull Request
709
+
710
+ ### Commit Convention
711
+
712
+ ```
713
+ feat: 새로운 기능 추가
714
+ fix: 버그 수정
715
+ docs: 문서 수정
716
+ style: 코드 포맷팅, 세미콜론 누락 등
717
+ refactor: 코드 리팩토링
718
+ test: 테스트 코드
719
+ chore: 빌드 업무, 패키지 매니저 설정 등
720
+ ```
721
+
722
+ ---
723
+
724
+ ## 버전 관리
725
+
726
+ 이 프로젝트는 [Changesets](https://github.com/changesets/changesets)를 사용하여 버전을 관리합니다.
727
+
728
+ ### 변경사항 추가
316
729
 
317
- ### Title 규칙
318
730
  ```bash
319
- foundation/
320
- components/
731
+ pnpm changeset
321
732
  ```
322
733
 
323
734
  ---
324
735
 
325
- ### Story 작성 원칙
736
+ ## 기술 스택
737
+
738
+ | Category | Technology |
739
+ |----------|------------|
740
+ | **Framework** | React 19 |
741
+ | **Language** | TypeScript |
742
+ | **Styling** | SCSS |
743
+ | **Documentation** | Storybook 8 |
744
+ | **Visual Test** | Chromatic |
745
+ | **Build** | tsup |
746
+ | **Package Manager** | pnpm |
747
+ | **CI/CD** | GitHub Actions |
748
+ | **Version Management** | Changesets |
749
+
750
+ ---
751
+
752
+ ## 브라우저 지원
753
+
754
+ - Chrome (최신 2개 버전)
755
+ - Firefox (최신 2개 버전)
756
+ - Safari (최신 2개 버전)
757
+ - Edge (최신 2개 버전)
758
+
759
+ ---
760
+
761
+ ## 라이센스
762
+
763
+ [Bigtablet License](https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md) 를 참고해주세요
764
+
765
+ ---
766
+
767
+ ## 링크
768
+
769
+ - [Github Link](https://bigtablet.github.io/bigtablet-design-system)
770
+ - [NPM 패키지](https://www.npmjs.com/package/@bigtablet/design-system)
771
+ - [이슈 트래커](https://github.com/Bigtablet/bigtablet-design-system/issues)
772
+ - [토론](https://github.com/Bigtablet/bigtablet-design-system/discussions)
773
+
774
+ ---
775
+
776
+ ## 팀
777
+
778
+ 이 프로젝트는 5명의 기여자들에 의해 관리되고 있습니다.
779
+
780
+ ---
781
+
782
+ <div align="center">
783
+
784
+ Made with by Bigtablet, Icn.
326
785
 
327
- - 기본 상태(Default) 반드시 포함
328
- - size / variant / state 예제 포함
329
- - 디자이너가 봐도 이해 가능한 설명 작성
330
- - 실제 사용 예제 위주 구성
331
- - 불필요한 control 노출 지양
786
+ </div>
package/dist/index.css CHANGED
@@ -964,7 +964,7 @@
964
964
  align-items: center;
965
965
  justify-content: center;
966
966
  gap: 0.5rem;
967
- margin-top: 2rem;
967
+ margin-top: 1.75rem;
968
968
  }
969
969
  .pagination_item {
970
970
  border: 1px solid #e5e5e5;
@@ -1,25 +1,34 @@
1
+ /* Primary */
1
2
  $color_primary: #000000;
2
3
  $color_primary_hover: #333333;
3
4
 
5
+ /* Background */
4
6
  $color_background: #ffffff;
5
7
  $color_background_secondary: #fafafa;
8
+ $color_background_neutral: #F3F3F3;
9
+ $color_background_muted: #f0f0f0;
10
+ $color_background_primary: #47555E;
6
11
 
12
+ /* Text */
7
13
  $color_text_primary: #1a1a1a;
8
14
  $color_text_secondary: #666666;
9
15
  $color_text_tertiary: #999999;
10
16
 
17
+ $text_strong: #1f2937;
18
+ $text_normal: #3b3b3b;
19
+ $text_subtle: #6b7280;
20
+ $text_disabled: #9ca3af;
21
+ $text_inverse: #ffffff;
22
+
23
+ /* Border */
11
24
  $color_border: #e5e5e5;
12
25
  $color_border_light: rgba(0, 0, 0, 0.08);
13
26
 
27
+ /* Status */
14
28
  $color_success: #10b981;
15
29
  $color_error: #ef4444;
16
30
  $color_warning: #f59e0b;
17
31
  $color_info: #3b82f6;
18
32
 
19
- $color_overlay: rgba(0, 0, 0, 0.5);
20
-
21
- $text_strong: #1f2937;
22
- $text_normal: #3b3b3b;
23
- $text_subtle: #6b7280;
24
- $text_disabled: #9ca3af;
25
- $text_inverse: #ffffff;
33
+ /* Overlay */
34
+ $color_overlay: rgba(0, 0, 0, 0.5);
@@ -1,9 +1,12 @@
1
- $spacing_xs: 0.25rem;
2
- $spacing_sm: 0.5rem;
3
- $spacing_md: 0.75rem;
4
- $spacing_lg: 1rem;
5
- $spacing_xl: 1.25rem;
6
- $spacing_2xl: 1.5rem;
7
- $spacing_3xl: 2rem;
8
- $spacing-4xl: 2.5rem;
9
- $spacing-5xl: 3rem;
1
+ $spacing_xs: 0.25rem; // 4px
2
+ $spacing_sm: 0.5rem; // 8px
3
+ $spacing_md: 0.75rem; // 12px
4
+ $spacing_lg: 1rem; // 16px
5
+ $spacing_xl: 1.25rem; // 20px
6
+ $spacing_2xl: 1.5rem; // 24px
7
+ $spacing_3xl: 1.75rem; // 28px
8
+ $spacing_4xl: 2rem; // 32px
9
+ $spacing_5xl: 2.25rem; // 36px
10
+ $spacing_6xl: 2.5rem; // 40px
11
+ $spacing_7xl: 2.75rem; // 44px
12
+ $spacing_8xl: 3rem; // 48px
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -1,25 +1,34 @@
1
+ /* Primary */
1
2
  $color_primary: #000000;
2
3
  $color_primary_hover: #333333;
3
4
 
5
+ /* Background */
4
6
  $color_background: #ffffff;
5
7
  $color_background_secondary: #fafafa;
8
+ $color_background_neutral: #F3F3F3;
9
+ $color_background_muted: #f0f0f0;
10
+ $color_background_primary: #47555E;
6
11
 
12
+ /* Text */
7
13
  $color_text_primary: #1a1a1a;
8
14
  $color_text_secondary: #666666;
9
15
  $color_text_tertiary: #999999;
10
16
 
17
+ $text_strong: #1f2937;
18
+ $text_normal: #3b3b3b;
19
+ $text_subtle: #6b7280;
20
+ $text_disabled: #9ca3af;
21
+ $text_inverse: #ffffff;
22
+
23
+ /* Border */
11
24
  $color_border: #e5e5e5;
12
25
  $color_border_light: rgba(0, 0, 0, 0.08);
13
26
 
27
+ /* Status */
14
28
  $color_success: #10b981;
15
29
  $color_error: #ef4444;
16
30
  $color_warning: #f59e0b;
17
31
  $color_info: #3b82f6;
18
32
 
19
- $color_overlay: rgba(0, 0, 0, 0.5);
20
-
21
- $text_strong: #1f2937;
22
- $text_normal: #3b3b3b;
23
- $text_subtle: #6b7280;
24
- $text_disabled: #9ca3af;
25
- $text_inverse: #ffffff;
33
+ /* Overlay */
34
+ $color_overlay: rgba(0, 0, 0, 0.5);
@@ -1,9 +1,12 @@
1
- $spacing_xs: 0.25rem;
2
- $spacing_sm: 0.5rem;
3
- $spacing_md: 0.75rem;
4
- $spacing_lg: 1rem;
5
- $spacing_xl: 1.25rem;
6
- $spacing_2xl: 1.5rem;
7
- $spacing_3xl: 2rem;
8
- $spacing-4xl: 2.5rem;
9
- $spacing-5xl: 3rem;
1
+ $spacing_xs: 0.25rem; // 4px
2
+ $spacing_sm: 0.5rem; // 8px
3
+ $spacing_md: 0.75rem; // 12px
4
+ $spacing_lg: 1rem; // 16px
5
+ $spacing_xl: 1.25rem; // 20px
6
+ $spacing_2xl: 1.5rem; // 24px
7
+ $spacing_3xl: 1.75rem; // 28px
8
+ $spacing_4xl: 2rem; // 32px
9
+ $spacing_5xl: 2.25rem; // 36px
10
+ $spacing_6xl: 2.5rem; // 40px
11
+ $spacing_7xl: 2.75rem; // 44px
12
+ $spacing_8xl: 3rem; // 48px