@x-plat/design-system 0.4.6 → 0.5.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/dist/components/Accordion/index.cjs +4 -4
- package/dist/components/Accordion/index.css +11 -11
- package/dist/components/Accordion/index.js +4 -4
- package/dist/components/Alert/index.css +19 -19
- package/dist/components/Avatar/index.cjs +11 -5
- package/dist/components/Avatar/index.css +41 -11
- package/dist/components/Avatar/index.d.cts +1 -2
- package/dist/components/Avatar/index.d.ts +1 -2
- package/dist/components/Avatar/index.js +11 -5
- package/dist/components/Badge/index.cjs +3 -4
- package/dist/components/Badge/index.css +32 -19
- package/dist/components/Badge/index.d.cts +3 -2
- package/dist/components/Badge/index.d.ts +3 -2
- package/dist/components/Badge/index.js +3 -4
- package/dist/components/Breadcrumb/index.css +6 -6
- package/dist/components/Button/index.cjs +1 -3
- package/dist/components/Button/index.css +67 -23
- package/dist/components/Button/index.d.cts +2 -3
- package/dist/components/Button/index.d.ts +2 -3
- package/dist/components/Button/index.js +1 -3
- package/dist/components/Calendar/index.cjs +10 -10
- package/dist/components/Calendar/index.css +51 -52
- package/dist/components/Calendar/index.d.cts +3 -3
- package/dist/components/Calendar/index.d.ts +3 -3
- package/dist/components/Calendar/index.js +10 -10
- package/dist/components/Card/index.css +6 -6
- package/dist/components/CardTab/index.css +28 -28
- package/dist/components/Chart/index.cjs +228 -14548
- package/dist/components/Chart/index.css +57 -0
- package/dist/components/Chart/index.d.cts +3 -2
- package/dist/components/Chart/index.d.ts +3 -2
- package/dist/components/Chart/index.js +219 -14541
- package/dist/components/CheckBox/index.cjs +13 -8
- package/dist/components/CheckBox/index.css +50 -27
- package/dist/components/CheckBox/index.d.cts +3 -2
- package/dist/components/CheckBox/index.d.ts +3 -2
- package/dist/components/CheckBox/index.js +13 -8
- package/dist/components/Chip/index.cjs +1 -3
- package/dist/components/Chip/index.css +35 -23
- package/dist/components/Chip/index.d.cts +2 -3
- package/dist/components/Chip/index.d.ts +2 -3
- package/dist/components/Chip/index.js +1 -3
- package/dist/components/DatePicker/index.cjs +37 -46
- package/dist/components/DatePicker/index.css +175 -122
- package/dist/components/DatePicker/index.d.cts +2 -3
- package/dist/components/DatePicker/index.d.ts +2 -3
- package/dist/components/DatePicker/index.js +37 -46
- package/dist/components/Divider/index.css +2 -2
- package/dist/components/Drawer/index.css +7 -7
- package/dist/components/Dropdown/index.css +10 -10
- package/dist/components/EmptyState/index.css +8 -9
- package/dist/components/FileUpload/index.cjs +4 -4
- package/dist/components/FileUpload/index.css +13 -14
- package/dist/components/FileUpload/index.js +4 -4
- package/dist/components/HtmlTypeWriter/index.cjs +10 -10
- package/dist/components/HtmlTypeWriter/index.css +3 -3
- package/dist/components/HtmlTypeWriter/index.js +10 -10
- package/dist/components/ImageSelector/index.cjs +4 -4
- package/dist/components/ImageSelector/index.css +15 -15
- package/dist/components/ImageSelector/index.js +4 -4
- package/dist/components/Input/index.css +37 -26
- package/dist/components/Modal/index.css +5 -4
- package/dist/components/Pagination/index.cjs +9 -10
- package/dist/components/Pagination/index.css +37 -26
- package/dist/components/Pagination/index.d.cts +3 -2
- package/dist/components/Pagination/index.d.ts +3 -2
- package/dist/components/Pagination/index.js +9 -10
- package/dist/components/PopOver/index.css +3 -3
- package/dist/components/Progress/index.cjs +4 -5
- package/dist/components/Progress/index.css +23 -9
- package/dist/components/Progress/index.d.cts +3 -2
- package/dist/components/Progress/index.d.ts +3 -2
- package/dist/components/Progress/index.js +4 -5
- package/dist/components/Radio/index.cjs +3 -4
- package/dist/components/Radio/index.css +61 -29
- package/dist/components/Radio/index.d.cts +3 -2
- package/dist/components/Radio/index.d.ts +3 -2
- package/dist/components/Radio/index.js +3 -4
- package/dist/components/Select/index.cjs +4 -4
- package/dist/components/Select/index.css +46 -40
- package/dist/components/Select/index.js +4 -4
- package/dist/components/Skeleton/index.css +3 -3
- package/dist/components/Spinner/index.cjs +2 -3
- package/dist/components/Spinner/index.css +22 -8
- package/dist/components/Spinner/index.d.cts +3 -2
- package/dist/components/Spinner/index.d.ts +3 -2
- package/dist/components/Spinner/index.js +2 -3
- package/dist/components/Steps/index.cjs +8 -9
- package/dist/components/Steps/index.css +77 -22
- package/dist/components/Steps/index.d.cts +3 -2
- package/dist/components/Steps/index.d.ts +3 -2
- package/dist/components/Steps/index.js +8 -9
- package/dist/components/Swiper/index.css +10 -10
- package/dist/components/Switch/index.cjs +4 -5
- package/dist/components/Switch/index.css +58 -26
- package/dist/components/Switch/index.d.cts +3 -2
- package/dist/components/Switch/index.d.ts +3 -2
- package/dist/components/Switch/index.js +4 -5
- package/dist/components/Tab/index.css +15 -15
- package/dist/components/Table/index.cjs +0 -3
- package/dist/components/Table/index.css +15 -15
- package/dist/components/Table/index.d.cts +1 -2
- package/dist/components/Table/index.d.ts +1 -2
- package/dist/components/Table/index.js +0 -3
- package/dist/components/Tag/index.cjs +23 -10
- package/dist/components/Tag/index.css +58 -17
- package/dist/components/Tag/index.d.cts +5 -2
- package/dist/components/Tag/index.d.ts +5 -2
- package/dist/components/Tag/index.js +23 -10
- package/dist/components/TextArea/index.css +20 -9
- package/dist/components/Toast/index.css +22 -22
- package/dist/components/Tooltip/index.cjs +1 -3
- package/dist/components/Tooltip/index.css +6 -6
- package/dist/components/Tooltip/index.d.cts +1 -2
- package/dist/components/Tooltip/index.d.ts +1 -2
- package/dist/components/Tooltip/index.js +1 -3
- package/dist/components/Video/index.css +5 -5
- package/dist/components/index.cjs +970 -15289
- package/dist/components/index.css +2167 -1061
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +871 -15192
- package/dist/index.cjs +1077 -15378
- package/dist/index.css +2164 -1058
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +877 -15182
- package/dist/layout/Grid/FullGrid/index.cjs +9 -18
- package/dist/layout/Grid/FullGrid/index.d.cts +1 -1
- package/dist/layout/Grid/FullGrid/index.d.ts +1 -1
- package/dist/layout/Grid/FullGrid/index.js +9 -18
- package/dist/layout/Grid/FullScreen/index.cjs +9 -18
- package/dist/layout/Grid/FullScreen/index.d.cts +3 -3
- package/dist/layout/Grid/FullScreen/index.d.ts +3 -3
- package/dist/layout/Grid/FullScreen/index.js +9 -18
- package/dist/layout/Grid/index.cjs +34 -20
- package/dist/layout/Grid/index.js +34 -20
- package/dist/layout/index.cjs +34 -20
- package/dist/layout/index.css +1000 -295
- package/dist/layout/index.js +34 -20
- package/dist/tokens/index.cjs +33 -142
- package/dist/tokens/index.d.cts +23 -6
- package/dist/tokens/index.d.ts +23 -6
- package/dist/tokens/index.js +29 -140
- package/guidelines/Guidelines.md +57 -0
- package/guidelines/components/accordion.md +72 -0
- package/guidelines/components/avatar.md +35 -0
- package/guidelines/components/button.md +58 -0
- package/guidelines/components/card.md +28 -0
- package/guidelines/components/chart.md +58 -0
- package/guidelines/components/chip-tag.md +49 -0
- package/guidelines/components/data-display.md +96 -0
- package/guidelines/components/datepicker.md +60 -0
- package/guidelines/components/dropdown.md +49 -0
- package/guidelines/components/feedback.md +64 -0
- package/guidelines/components/file-media.md +95 -0
- package/guidelines/components/form.md +60 -0
- package/guidelines/components/html-typewriter.md +38 -0
- package/guidelines/components/input.md +55 -0
- package/guidelines/components/navigation.md +80 -0
- package/guidelines/components/overlay.md +72 -0
- package/guidelines/components/select.md +44 -0
- package/guidelines/components/swiper.md +84 -0
- package/guidelines/components/table.md +62 -0
- package/guidelines/composition/grid.md +95 -0
- package/guidelines/composition/layout.md +30 -0
- package/guidelines/foundations/color.md +81 -0
- package/guidelines/foundations/icons.md +55 -0
- package/guidelines/foundations/spacing.md +51 -0
- package/guidelines/foundations/typography.md +63 -0
- package/guidelines/setup.md +42 -0
- package/package.json +5 -5
- package/dist/colors-CY4JXVHj.d.cts +0 -137
- package/dist/colors-CY4JXVHj.d.ts +0 -137
- package/dist/layout/Grid/GapGrid/index.cjs +0 -32
- package/dist/layout/Grid/GapGrid/index.d.cts +0 -12
- package/dist/layout/Grid/GapGrid/index.d.ts +0 -12
- package/dist/layout/Grid/GapGrid/index.js +0 -11
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
**Select.Item만 children으로 허용한다.**
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Select placeholder="선택하세요" onChange={(value, label) => console.log(value)}>
|
|
7
|
+
<Select.Item value="apple">사과</Select.Item>
|
|
8
|
+
<Select.Item value="banana">바나나</Select.Item>
|
|
9
|
+
</Select>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## onChange
|
|
13
|
+
|
|
14
|
+
`onChange(value: string, label: string)` 형태로 선택된 값과 라벨을 전달한다.
|
|
15
|
+
|
|
16
|
+
## Controlled / Uncontrolled
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
// controlled
|
|
20
|
+
<Select value={selected} onChange={(v) => setSelected(v)}>
|
|
21
|
+
<Select.Item value="a">A</Select.Item>
|
|
22
|
+
</Select>
|
|
23
|
+
|
|
24
|
+
// uncontrolled
|
|
25
|
+
<Select defaultValue="a">
|
|
26
|
+
<Select.Item value="a">A</Select.Item>
|
|
27
|
+
</Select>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 상태
|
|
31
|
+
|
|
32
|
+
| 상태 | 설명 |
|
|
33
|
+
|------|------|
|
|
34
|
+
| error | 에러 표시 |
|
|
35
|
+
| disabled | 비활성화 |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 유사 컴포넌트 구분
|
|
40
|
+
|
|
41
|
+
| 목적 | 사용할 것 |
|
|
42
|
+
|------|----------|
|
|
43
|
+
| 값 선택 (onChange) | Select |
|
|
44
|
+
| 액션 메뉴 (onClick per item) | Dropdown |
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Swiper
|
|
2
|
+
|
|
3
|
+
슬라이더/캐러셀을 표시한다. 드래그, 자동 재생, 루프를 지원하며 controlled/uncontrolled 모두 가능하다.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Swiper } from "@xplat/design-system";
|
|
7
|
+
import type { SwiperHandle } from "@xplat/design-system";
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | 타입 | 기본값 | 설명 |
|
|
13
|
+
|------|------|--------|------|
|
|
14
|
+
| renderItems | `ReactNode[]` | `[]` | 슬라이드 아이템 배열 |
|
|
15
|
+
| viewItemCount | `number` | `1` | 한 번에 보이는 아이템 수 |
|
|
16
|
+
| maxItems | `number` | — | 최대 아이템 수 (초과 시 잘림) |
|
|
17
|
+
| spaceBetween | `number` | `16` | 슬라이드 간격 (px) |
|
|
18
|
+
| speed | `number` | `300` | 전환 속도 (ms) |
|
|
19
|
+
| slideBy | `number` | `1` | 한 번에 이동할 슬라이드 수 |
|
|
20
|
+
| auto | `boolean` | `false` | 자동 슬라이딩 |
|
|
21
|
+
| autoplayDelay | `number` | `3000` | 오토플레이 간격 (ms) |
|
|
22
|
+
| loop | `boolean` | `false` | 무한 루프 |
|
|
23
|
+
| showProgress | `boolean` | `false` | 진행바 표시 |
|
|
24
|
+
| index | `number` | — | 현재 인덱스 (controlled) |
|
|
25
|
+
| onChange | `(index: number) => void` | — | 슬라이드 변경 콜백 |
|
|
26
|
+
| swiperRef | `RefObject<SwiperHandle>` | — | 명령형 제어 ref |
|
|
27
|
+
|
|
28
|
+
### SwiperHandle
|
|
29
|
+
|
|
30
|
+
| 메서드 | 설명 |
|
|
31
|
+
|--------|------|
|
|
32
|
+
| `slidePrev()` | 이전 슬라이드로 이동 |
|
|
33
|
+
| `slideNext()` | 다음 슬라이드로 이동 |
|
|
34
|
+
| `slideTo(index)` | 특정 인덱스로 이동 |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 사용 예시
|
|
39
|
+
|
|
40
|
+
### 기본
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<Swiper
|
|
44
|
+
renderItems={[
|
|
45
|
+
<img src="/img1.jpg" />,
|
|
46
|
+
<img src="/img2.jpg" />,
|
|
47
|
+
<img src="/img3.jpg" />,
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 자동 재생 + 루프 + 진행바
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Swiper
|
|
56
|
+
renderItems={slides}
|
|
57
|
+
auto
|
|
58
|
+
loop
|
|
59
|
+
showProgress
|
|
60
|
+
autoplayDelay={5000}
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 명령형 제어
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
const ref = useRef<SwiperHandle>(null);
|
|
68
|
+
|
|
69
|
+
<Swiper swiperRef={ref} renderItems={slides} />
|
|
70
|
+
|
|
71
|
+
<button onClick={() => ref.current?.slidePrev()}>이전</button>
|
|
72
|
+
<button onClick={() => ref.current?.slideNext()}>다음</button>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 다중 아이템 뷰
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Swiper
|
|
79
|
+
renderItems={cards}
|
|
80
|
+
viewItemCount={3}
|
|
81
|
+
spaceBetween={24}
|
|
82
|
+
slideBy={3}
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
**반드시 `Table > TableHead/TableBody > TableRow > TableCell` 구조를 따른다.**
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Table>
|
|
7
|
+
<TableHead>
|
|
8
|
+
<TableRow>
|
|
9
|
+
<TableCell>이름</TableCell>
|
|
10
|
+
<TableCell>나이</TableCell>
|
|
11
|
+
</TableRow>
|
|
12
|
+
</TableHead>
|
|
13
|
+
<TableBody>
|
|
14
|
+
<TableRow>
|
|
15
|
+
<TableCell>홍길동</TableCell>
|
|
16
|
+
<TableCell>30</TableCell>
|
|
17
|
+
</TableRow>
|
|
18
|
+
</TableBody>
|
|
19
|
+
</Table>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | 설명 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| headerSticky | 헤더 고정 |
|
|
27
|
+
| isSticky | 특정 셀 고정 |
|
|
28
|
+
|
|
29
|
+
## TableRow type
|
|
30
|
+
|
|
31
|
+
| type | 용도 |
|
|
32
|
+
|------|------|
|
|
33
|
+
| primary | 기본 행 |
|
|
34
|
+
| secondary | 보조 행 (배경색 구분) |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 올바른 예시
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
<Table headerSticky>
|
|
42
|
+
<TableHead>
|
|
43
|
+
<TableRow>
|
|
44
|
+
<TableCell isSticky>이름</TableCell>
|
|
45
|
+
<TableCell>부서</TableCell>
|
|
46
|
+
<TableCell>직급</TableCell>
|
|
47
|
+
</TableRow>
|
|
48
|
+
</TableHead>
|
|
49
|
+
<TableBody>
|
|
50
|
+
<TableRow type="primary">
|
|
51
|
+
<TableCell isSticky>홍길동</TableCell>
|
|
52
|
+
<TableCell>개발팀</TableCell>
|
|
53
|
+
<TableCell>선임</TableCell>
|
|
54
|
+
</TableRow>
|
|
55
|
+
<TableRow type="secondary">
|
|
56
|
+
<TableCell isSticky>김철수</TableCell>
|
|
57
|
+
<TableCell>디자인팀</TableCell>
|
|
58
|
+
<TableCell>책임</TableCell>
|
|
59
|
+
</TableRow>
|
|
60
|
+
</TableBody>
|
|
61
|
+
</Table>
|
|
62
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Grid 시스템
|
|
2
|
+
|
|
3
|
+
페이지 레이아웃과 컴포넌트 내부 배치 모두 Grid를 사용한다.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { FullGrid, FullScreen, GridItem } from "@x-plat/design-system/layout";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 컴포넌트
|
|
10
|
+
|
|
11
|
+
| 컴포넌트 | 용도 |
|
|
12
|
+
|---------|------|
|
|
13
|
+
| FullGrid | 12컬럼 그리드 컨테이너 |
|
|
14
|
+
| FullScreen | 전체 화면 그리드 |
|
|
15
|
+
| GridItem | 그리드 아이템 |
|
|
16
|
+
|
|
17
|
+
## gap
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<FullGrid gap={16}>
|
|
21
|
+
<GridItem column={6}>왼쪽</GridItem>
|
|
22
|
+
<GridItem column={6}>오른쪽</GridItem>
|
|
23
|
+
</FullGrid>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 반응형 브레이크포인트
|
|
29
|
+
|
|
30
|
+
| 브레이크포인트 | 범위 | 최대 컬럼 |
|
|
31
|
+
|---------------|------|-----------|
|
|
32
|
+
| laptop (default) | 1024px ~ | 12 |
|
|
33
|
+
| tablet | 768px ~ 1024px | 8 |
|
|
34
|
+
| mobile | ~ 768px | 4 |
|
|
35
|
+
|
|
36
|
+
## Column 상속 규칙
|
|
37
|
+
|
|
38
|
+
하위 브레이크포인트를 지정하지 않으면 상위 값을 상속한다.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
<GridItem column={{ default: 6, tablet: 4, mobile: 4 }}>
|
|
42
|
+
내용
|
|
43
|
+
</GridItem>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 위젯 패턴
|
|
49
|
+
|
|
50
|
+
### 대시보드
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<FullGrid>
|
|
54
|
+
<GridItem column={{ default: 4, tablet: 4, mobile: 4 }}>
|
|
55
|
+
<Card>위젯 A</Card>
|
|
56
|
+
</GridItem>
|
|
57
|
+
<GridItem column={{ default: 4, tablet: 4, mobile: 4 }}>
|
|
58
|
+
<Card>위젯 B</Card>
|
|
59
|
+
</GridItem>
|
|
60
|
+
<GridItem column={{ default: 4, tablet: 8, mobile: 4 }}>
|
|
61
|
+
<Card>위젯 C</Card>
|
|
62
|
+
</GridItem>
|
|
63
|
+
</FullGrid>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 폼
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<FullGrid>
|
|
70
|
+
<GridItem column={{ default: 6, tablet: 4, mobile: 4 }}>
|
|
71
|
+
<Input placeholder="이름" />
|
|
72
|
+
</GridItem>
|
|
73
|
+
<GridItem column={{ default: 6, tablet: 4, mobile: 4 }}>
|
|
74
|
+
<Input placeholder="이메일" type="email" />
|
|
75
|
+
</GridItem>
|
|
76
|
+
<GridItem column={{ default: 12, tablet: 8, mobile: 4 }}>
|
|
77
|
+
<Button type="primary">저장</Button>
|
|
78
|
+
</GridItem>
|
|
79
|
+
</FullGrid>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 중첩 Grid
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Card title="사용자 정보">
|
|
86
|
+
<FullGrid>
|
|
87
|
+
<GridItem column={{ default: 3, tablet: 2, mobile: 4 }}>
|
|
88
|
+
<Avatar name="홍길동" size="lg" />
|
|
89
|
+
</GridItem>
|
|
90
|
+
<GridItem column={{ default: 9, tablet: 6, mobile: 4 }}>
|
|
91
|
+
<Input placeholder="이름" />
|
|
92
|
+
</GridItem>
|
|
93
|
+
</FullGrid>
|
|
94
|
+
</Card>
|
|
95
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Layout / Header / SideBar
|
|
2
|
+
|
|
3
|
+
## 페이지 레이아웃 구조
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Layout, Header, SideBar } from "@x-plat/design-system/layout";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Layout은 Header와 SideBar를 포함하는 페이지 전체 구조를 제공한다.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 예시
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<Layout>
|
|
17
|
+
<Header title="대시보드" />
|
|
18
|
+
<SideBar>
|
|
19
|
+
<SideBar.Item>메뉴 1</SideBar.Item>
|
|
20
|
+
<SideBar.Item>메뉴 2</SideBar.Item>
|
|
21
|
+
</SideBar>
|
|
22
|
+
<Layout.Content>
|
|
23
|
+
<FullGrid>
|
|
24
|
+
<GridItem column={12}>
|
|
25
|
+
<p>페이지 내용</p>
|
|
26
|
+
</GridItem>
|
|
27
|
+
</FullGrid>
|
|
28
|
+
</Layout.Content>
|
|
29
|
+
</Layout>
|
|
30
|
+
```
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# 컬러 토큰 시스템
|
|
2
|
+
|
|
3
|
+
## 4레이어 구조
|
|
4
|
+
|
|
5
|
+
| 레이어 | 접두사 | 역할 |
|
|
6
|
+
|--------|--------|------|
|
|
7
|
+
| Primitive | `--primitive-*` | 기초 팔레트 (hex) |
|
|
8
|
+
| Brand | `--brand-*` | 브랜드 색상 |
|
|
9
|
+
| System | `--system-*` | 상태 색상 (success/error/warning/info) |
|
|
10
|
+
| Semantic | `--semantic-*` | 용도 기반 최종 토큰 (brand+system 참조) |
|
|
11
|
+
|
|
12
|
+
컴포넌트는 **semantic 토큰만** 소비한다. primitive/brand/system을 직접 참조하지 않는다.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Tailwind 클래스 사용 (소비 프로젝트)
|
|
17
|
+
|
|
18
|
+
소비 프로젝트에서 직접 만드는 UI에만 사용한다.
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
// 텍스트
|
|
22
|
+
<p className="text-semantic-text-strong">강조 텍스트</p>
|
|
23
|
+
<p className="text-semantic-text-subtle">보조 텍스트</p>
|
|
24
|
+
<p className="text-semantic-text-error">에러 메시지</p>
|
|
25
|
+
|
|
26
|
+
// 배경
|
|
27
|
+
<div className="bg-semantic-surface-neutral-default">기본 배경</div>
|
|
28
|
+
<div className="bg-semantic-surface-brand-subtle">브랜드 배경</div>
|
|
29
|
+
|
|
30
|
+
// 테두리
|
|
31
|
+
<div className="border border-semantic-border-default">기본 테두리</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Semantic 토큰 목록
|
|
37
|
+
|
|
38
|
+
### Text
|
|
39
|
+
|
|
40
|
+
`--semantic-text-{strong, subtle, muted, brand, disabled, inverse, success, error, warning, info, link, sunday, saturday}`
|
|
41
|
+
|
|
42
|
+
### Surface
|
|
43
|
+
|
|
44
|
+
- Neutral: `--semantic-surface-neutral-{subtle, default, strong}`
|
|
45
|
+
- Brand: `--semantic-surface-brand-{subtle, default, strong}`
|
|
46
|
+
- Success: `--semantic-surface-success-{subtle, default, strong}`
|
|
47
|
+
- Error: `--semantic-surface-error-{subtle, default, strong}`
|
|
48
|
+
- Warning: `--semantic-surface-warning-{subtle, default, strong}`
|
|
49
|
+
- Info: `--semantic-surface-info-{subtle, default, strong}`
|
|
50
|
+
|
|
51
|
+
### Border
|
|
52
|
+
|
|
53
|
+
`--semantic-border-{default, strong, subtle, disabled, focus, error, success}`
|
|
54
|
+
|
|
55
|
+
### Icon
|
|
56
|
+
|
|
57
|
+
`--semantic-icon-{default, subtle, disabled, inverse, brand, success, warning, error, info}`
|
|
58
|
+
|
|
59
|
+
### Emphasis
|
|
60
|
+
|
|
61
|
+
`--semantic-emphasis-{brand, success, error, warning, info}`
|
|
62
|
+
|
|
63
|
+
### Interaction
|
|
64
|
+
|
|
65
|
+
`--semantic-interaction-{primary, primary-hover, primary-active, primary-disabled, secondary, secondary-hover, secondary-active, danger, danger-hover, danger-active}`
|
|
66
|
+
|
|
67
|
+
### Categorical
|
|
68
|
+
|
|
69
|
+
`--semantic-categorical-{1, 2, 3, 4, 5, 6, 7, 8}`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 잘못된 사용
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
/* 금지: primitive 토큰 직접 사용 */
|
|
77
|
+
color: var(--primitive-blue-500);
|
|
78
|
+
|
|
79
|
+
/* 올바른 방법: semantic 토큰 사용 */
|
|
80
|
+
color: var(--semantic-text-brand);
|
|
81
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 아이콘 시스템
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { DeleteIcon, ChevronDownIcon, BellIcon } from "@x-plat/design-system";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 크기/색상 제어
|
|
10
|
+
|
|
11
|
+
부모의 `font-size`로 크기, `color`로 색상을 제어한다.
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<span style={{ fontSize: "1.5rem", color: "var(--semantic-icon-error)" }}>
|
|
15
|
+
<ErrorIcon />
|
|
16
|
+
</span>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 카테고리별 용도
|
|
22
|
+
|
|
23
|
+
| 카테고리 | 용도 | 예시 |
|
|
24
|
+
|---------|------|------|
|
|
25
|
+
| action | CRUD 액션 | DeleteIcon, SaveIcon, EditIcon, SearchIcon |
|
|
26
|
+
| arrow | 방향/화살표 | ChevronDownIcon, ArrowLeftIcon |
|
|
27
|
+
| status | 상태/검증 | CheckCircleIcon, ErrorIcon, XIcon, PlusIcon |
|
|
28
|
+
| form | 폼 UI | EyeIcon, SettingsIcon, ToggleLeftIcon |
|
|
29
|
+
| communication | 알림/메시지 | BellIcon, MessageCircleIcon |
|
|
30
|
+
| commerce | 결제/배송 | ShoppingCartIcon, CreditCardIcon |
|
|
31
|
+
| chart | 차트/통계 | BarChartIcon, TrendingUpIcon |
|
|
32
|
+
| file | 파일/문서 | FileIcon, FolderIcon |
|
|
33
|
+
| media | 미디어 | PlayIcon, CameraIcon, ImageIcon |
|
|
34
|
+
| user | 사용자/인증 | UserIcon, LogOutIcon, LockIcon |
|
|
35
|
+
| layout | 레이아웃/메뉴 | MenuIcon, GridIcon |
|
|
36
|
+
| social | 소셜 | GithubIcon, FacebookIcon |
|
|
37
|
+
| dev | 개발 | CodeIcon, TerminalIcon |
|
|
38
|
+
| edit | 편집 | CopyIcon, ClipboardIcon |
|
|
39
|
+
| date | 날짜 | CalendarIcon, ClockIcon |
|
|
40
|
+
| call | 통화 | PhoneIcon, PhoneOffIcon |
|
|
41
|
+
| device | 디바이스 | MonitorIcon, SmartphoneIcon |
|
|
42
|
+
| weather | 날씨 | SunIcon, CloudIcon |
|
|
43
|
+
| shape | 도형 | CircleIcon, SquareIcon |
|
|
44
|
+
| misc | 기타 | HashIcon, LinkIcon |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 아이콘 선택 의사결정
|
|
49
|
+
|
|
50
|
+
| 상황 | 카테고리 |
|
|
51
|
+
|------|---------|
|
|
52
|
+
| CRUD 동작 (생성/조회/수정/삭제) | action |
|
|
53
|
+
| 방향 표시, 펼침/접힘 | arrow |
|
|
54
|
+
| 상태 피드백 (성공/에러/경고) | status |
|
|
55
|
+
| 폼 입력 보조 | form |
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# 스페이싱 토큰 시스템
|
|
2
|
+
|
|
3
|
+
## 3레이어 구조
|
|
4
|
+
|
|
5
|
+
| 레이어 | 역할 |
|
|
6
|
+
|--------|------|
|
|
7
|
+
| Primitive | 기초 수치 (4px 단위) |
|
|
8
|
+
| Brand | 브랜드별 커스텀 |
|
|
9
|
+
| Semantic | 컴포넌트가 소비하는 최종 토큰 |
|
|
10
|
+
|
|
11
|
+
컴포넌트는 **semantic spacing만** 사용한다.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Space
|
|
16
|
+
|
|
17
|
+
| 토큰 | 값 |
|
|
18
|
+
|------|-----|
|
|
19
|
+
| `--spacing-space-none` | 0 |
|
|
20
|
+
| `--spacing-space-1` ~ `--spacing-space-16` | 4px ~ 64px (4px 단위) |
|
|
21
|
+
|
|
22
|
+
## Control Height
|
|
23
|
+
|
|
24
|
+
| 토큰 | 용도 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| `--spacing-control-height-xs` | 초소형 컨트롤 |
|
|
27
|
+
| `--spacing-control-height-sm` | 소형 컨트롤 |
|
|
28
|
+
| `--spacing-control-height-md` | 기본 컨트롤 |
|
|
29
|
+
| `--spacing-control-height-lg` | 대형 컨트롤 |
|
|
30
|
+
|
|
31
|
+
## Radius
|
|
32
|
+
|
|
33
|
+
`--spacing-radius-{none, xs, sm, md, lg, xl, 2xl, full}`
|
|
34
|
+
|
|
35
|
+
## Stroke
|
|
36
|
+
|
|
37
|
+
`--spacing-stroke-{none, xs, sm, md, lg, xl, 2xl}`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 잘못된 사용
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
/* 금지: 하드코딩 */
|
|
45
|
+
padding: 16px;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
|
|
48
|
+
/* 올바른 방법: semantic 토큰 사용 */
|
|
49
|
+
padding: var(--spacing-space-4);
|
|
50
|
+
gap: var(--spacing-space-2);
|
|
51
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 타이포그래피 토큰 시스템
|
|
2
|
+
|
|
3
|
+
## 3레이어 구조
|
|
4
|
+
|
|
5
|
+
| 레이어 | 역할 |
|
|
6
|
+
|--------|------|
|
|
7
|
+
| Primitive | 기초 폰트 수치 |
|
|
8
|
+
| Brand | 브랜드별 커스텀 |
|
|
9
|
+
| Semantic | 컴포넌트가 소비하는 최종 토큰 |
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Font Family
|
|
14
|
+
|
|
15
|
+
| 토큰 | 용도 |
|
|
16
|
+
|------|------|
|
|
17
|
+
| `--font-family-sans` | 기본 산세리프 |
|
|
18
|
+
| `--font-family-serif` | 세리프 |
|
|
19
|
+
| `--font-family-suit` | SUIT 폰트 |
|
|
20
|
+
|
|
21
|
+
## Font Size
|
|
22
|
+
|
|
23
|
+
`--font-size-{xs, sm, md, lg, xl, 2xl, 3xl, 4xl}`
|
|
24
|
+
|
|
25
|
+
## Line Height (Density)
|
|
26
|
+
|
|
27
|
+
3단계 밀도를 지원한다.
|
|
28
|
+
|
|
29
|
+
| 밀도 | 용도 |
|
|
30
|
+
|------|------|
|
|
31
|
+
| compact | 정보 밀집 UI |
|
|
32
|
+
| default | 기본 |
|
|
33
|
+
| airy | 여유 있는 UI |
|
|
34
|
+
|
|
35
|
+
## Font Weight
|
|
36
|
+
|
|
37
|
+
| 토큰 | 값 |
|
|
38
|
+
|------|-----|
|
|
39
|
+
| `--font-weight-regular` | 400 |
|
|
40
|
+
| `--font-weight-medium` | 500 |
|
|
41
|
+
| `--font-weight-semibold` | 600 |
|
|
42
|
+
| `--font-weight-bold` | 700 |
|
|
43
|
+
|
|
44
|
+
## Letter Spacing
|
|
45
|
+
|
|
46
|
+
| 토큰 | 용도 |
|
|
47
|
+
|------|------|
|
|
48
|
+
| `--letter-spacing-tight` | 좁은 자간 |
|
|
49
|
+
| `--letter-spacing-normal` | 기본 자간 |
|
|
50
|
+
| `--letter-spacing-wide` | 넓은 자간 |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Semantic Text Styles
|
|
55
|
+
|
|
56
|
+
| 스타일 | 용도 |
|
|
57
|
+
|--------|------|
|
|
58
|
+
| display | 대형 타이틀, 히어로 |
|
|
59
|
+
| title | 페이지 타이틀 |
|
|
60
|
+
| heading | 섹션 타이틀 |
|
|
61
|
+
| body | 본문 텍스트 |
|
|
62
|
+
| label | 폼 라벨, 버튼 텍스트 |
|
|
63
|
+
| caption | 부가 설명, 힌트 |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 설치 및 설정
|
|
2
|
+
|
|
3
|
+
## CSS Import
|
|
4
|
+
|
|
5
|
+
앱 진입점에서 1회 import한다.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import "@x-plat/design-system/style.css";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 컴포넌트 Import
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
// barrel import
|
|
15
|
+
import { Button, Select, Modal } from "@x-plat/design-system/components";
|
|
16
|
+
|
|
17
|
+
// deep import
|
|
18
|
+
import { Button } from "@x-plat/design-system/components/Button";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 레이아웃 Import
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Layout, Header, SideBar } from "@x-plat/design-system/layout";
|
|
25
|
+
import { FullGrid, GridItem } from "@x-plat/design-system/layout";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ToastProvider 설정
|
|
29
|
+
|
|
30
|
+
앱 최상위에 ToastProvider를 배치한다.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { ToastProvider } from "@x-plat/design-system/components";
|
|
34
|
+
|
|
35
|
+
function App() {
|
|
36
|
+
return (
|
|
37
|
+
<ToastProvider position="top-right">
|
|
38
|
+
<MyApp />
|
|
39
|
+
</ToastProvider>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-plat/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "XPLAT UI Design System",
|
|
5
5
|
"author": "XPLAT WOONG",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -47,7 +47,9 @@
|
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"dist",
|
|
50
|
-
"global.d.ts"
|
|
50
|
+
"global.d.ts",
|
|
51
|
+
".npmrc",
|
|
52
|
+
"guidelines"
|
|
51
53
|
],
|
|
52
54
|
"scripts": {
|
|
53
55
|
"generate-grid": "tsx generate_grid.ts",
|
|
@@ -62,13 +64,11 @@
|
|
|
62
64
|
"react-dom": ">=18"
|
|
63
65
|
},
|
|
64
66
|
"dependencies": {
|
|
67
|
+
"@x-plat/tokens-core": "*",
|
|
65
68
|
"@x-plat/tokens-default": "*"
|
|
66
69
|
},
|
|
67
70
|
"devDependencies": {
|
|
68
|
-
"chart.js": "^4.5.1",
|
|
69
|
-
"chartjs-plugin-datalabels": "^2.2.0",
|
|
70
71
|
"framer-motion": "^12.23.19",
|
|
71
|
-
"react-chartjs-2": "^5.3.1",
|
|
72
72
|
"@types/node": "^24.10.1",
|
|
73
73
|
"@types/react": "^19.1.13",
|
|
74
74
|
"@types/react-dom": "^19.1.9",
|