@x-plat/design-system 0.5.0 → 0.5.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/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 +4 -2
|
@@ -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.5.
|
|
3
|
+
"version": "0.5.2",
|
|
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",
|