@x-plat/design-system 0.7.0 → 0.7.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.
@@ -594,7 +594,7 @@ CSS 변수 `--semantic-{category}-{role}` 사용.
594
594
  | 카테고리 | 컴포넌트 |
595
595
  |---|---|
596
596
  | 입력 | `Button`, `Input`, `PasswordInput`, `TextArea`, `Select`, `CheckBox`, `Radio`, `Switch`, `DatePicker`, `Calendar` |
597
- | 표시 | `Table`, `Card`, `Tag`, `Chip`, `Avatar`, `Badge`, `Skeleton`, `Spinner`, `Divider`, `EmptyState`, `Progress` |
597
+ | 표시 | `Table`, `Card`, `Tag`, `Chip`, `Avatar`, `NotificationBadge`, `Skeleton`, `Spinner`, `Divider`, `EmptyState`, `Progress` |
598
598
  | 오버레이 | `Modal`, `Drawer`, `PopOver`, `Tooltip`, `Alert`, `Toast` (`ToastProvider` 필요) |
599
599
  | 네비 | `Tab`, `CardTab`, `Breadcrumb`, `Pagination`, `Steps`, `Dropdown` |
600
600
  | 미디어 | `Video`, `FileUpload`, `ImageSelector`, `Swiper` |
@@ -52,7 +52,7 @@ React 기반 디자인 시스템 라이브러리이다. Figma Make Kit과 1:1
52
52
  - [Input](./components/input.md) - Input, PasswordInput, TextArea
53
53
  - [Select](./components/select.md)
54
54
  - [Table](./components/table.md)
55
- - [피드백](./components/feedback.md) - Alert, Toast, Badge
55
+ - [피드백](./components/feedback.md) - Alert, Toast, NotificationBadge
56
56
  - [오버레이](./components/overlay.md) - Modal, Drawer, PopOver, Tooltip
57
57
  - [폼 컨트롤](./components/form.md) - CheckBox, Radio, Switch
58
58
  - [Chip & Tag](./components/chip-tag.md)
@@ -1,4 +1,4 @@
1
- # 피드백: Alert / Toast / Badge
1
+ # 피드백: Alert / Toast / NotificationBadge
2
2
 
3
3
  ## Alert
4
4
 
@@ -38,20 +38,46 @@ toast("error", "오류 발생", 5000);
38
38
 
39
39
  ---
40
40
 
41
- ## Badge
41
+ ## NotificationBadge
42
42
 
43
- 카운트 또는 도트를 표시한다.
43
+ 다른 요소의 **우상단 모서리에 얹히는 작은 원**이다. 아이콘·버튼 위에 읽지 않은
44
+ 개수나 상태 점을 표시한다.
45
+
46
+ **`children` 은 뱃지 내용이 아니라 뱃지가 올라탈 대상이다.**
44
47
 
45
48
  ```tsx
46
- <Badge type="error" count={5}><BellIcon /></Badge>
47
- <Badge type="success" dot><UserIcon /></Badge>
49
+ <NotificationBadge type="error" count={5}><BellIcon /></NotificationBadge>
50
+ <NotificationBadge type="success" dot><UserIcon /></NotificationBadge>
48
51
  ```
49
52
 
50
- | Prop | 설명 |
51
- |------|------|
52
- | type | `"error" \| "success" \| "warning" \| "info" \| "brand"` |
53
- | count | 숫자 표시 |
54
- | dot | 도트만 표시 |
53
+ <!-- props:NotificationBadge -->
54
+ | Prop | 타입 | 기본값 | 설명 |
55
+ |------|------|--------|------|
56
+ | children * | `ReactNode` | - | 뱃지가 올라탈 **대상**. 뱃지에 표시할 내용이 아니다. 보통 아이콘이나 버튼을 넣는다. |
57
+ | count | `number` | - | 표시할 개수. `count` 나 `dot` 중 하나가 없으면 **뱃지가 렌더되지 않는다** (`type` 을 줘도 아무 일도 일어나지 않는다). `count={0}` 도 표시하지 않는다 — 읽지 않은 항목이 없으면 숨기는 동작이다. |
58
+ | dot | `boolean` | `false` | 개수 대신 점만 표시한다. `count` 없이 "새 항목 있음" 만 알릴 때 쓴다 |
59
+ | type | `"error" \| "success" \| "warning" \| "info" \| "brand"` | `"error"` | 뱃지 색. 뱃지가 렌더될 때만 의미가 있다 |
60
+ | maxCount | `number` | `99` | `count` 가 이 값을 넘으면 `99+` 처럼 표시한다 |
61
+ | size | `"sm" \| "md" \| "lg"` | `"md"` | 뱃지 크기. 대상의 크기가 아니다 |
62
+
63
+ `*` = 필수
64
+ <!-- /props:NotificationBadge -->
65
+
66
+ ### 흔한 오용
67
+
68
+ 알약 모양 상태 라벨로 쓰면 **조용히 실패한다.** `count` 도 `dot` 도 없으면
69
+ 뱃지가 렌더되지 않고 `children` 만 그대로 통과한다. `type` 을 줘도 무시된다.
70
+
71
+ ```tsx
72
+ <NotificationBadge type="success">진행중</NotificationBadge>
73
+ // → <div class="lib-xplat-notification-badge md">진행중</div> — 아무 모양 없는 맨 글자
74
+
75
+ <Chip type="success">진행중</Chip> // ✅ 알약 라벨은 Chip
76
+ <Tag onClose={fn}>진행중</Tag> // ✅ 제거 가능한 태그는 Tag
77
+ ```
78
+
79
+ > 이전 이름은 `Badge` 였다. 알약 라벨로 오해되어 바뀌었다. `Badge` 와
80
+ > `components/Badge` 경로는 기존 사용처를 위해 남아 있지만 새 코드에는 쓰지 않는다.
55
81
 
56
82
  ---
57
83
 
@@ -61,4 +87,6 @@ toast("error", "오류 발생", 5000);
61
87
  |------|----------|
62
88
  | 인라인 알림 (페이지 내 고정) | Alert |
63
89
  | 일시적 알림 (자동 사라짐) | Toast |
64
- | 카운트/상태 표시 | Badge |
90
+ | 아이콘 위 카운트/상태 점 | `NotificationBadge` |
91
+ | 알약 모양 상태 라벨 | `Chip` |
92
+ | 제거 가능한 태그 | `Tag` |
@@ -21,18 +21,81 @@
21
21
 
22
22
  ## Props
23
23
 
24
- | Prop | 설명 |
25
- |------|------|
26
- | headerSticky | 헤더 고정 |
27
- | isSticky | 특정 셀 고정 |
24
+ ### Table
25
+
26
+ <!-- props:Table -->
27
+ | Prop | 타입 | 기본값 | 설명 |
28
+ |------|------|--------|------|
29
+ | children * | `ReactNode` | - | |
30
+ | size | `"sm" \| "md" \| "lg"` | `"md"` | |
31
+ | rowBorderUse | `boolean` | `true` | |
32
+ | colBorderUse | `boolean` | `true` | |
33
+ | headerSticky | `boolean` | `false` | |
34
+ | stickyShadow | `boolean` | `true` | |
35
+
36
+ `*` = 필수
37
+ <!-- /props:Table -->
38
+
39
+ ### TableHead
40
+
41
+ <!-- props:Table.TableHead -->
42
+ | Prop | 타입 | 기본값 | 설명 |
43
+ |------|------|--------|------|
44
+ | children * | `ReactNode` | - | |
45
+ | cellHover | `boolean` | `false` | |
46
+
47
+ `*` = 필수
48
+ <!-- /props:Table.TableHead -->
49
+
50
+ ### TableRow
51
+
52
+ <!-- props:Table.TableRow -->
53
+ | Prop | 타입 | 기본값 | 설명 |
54
+ |------|------|--------|------|
55
+ | children * | `ReactNode` | - | |
56
+ | type | `"primary" \| "secondary" \| "success" \| "error" \| "warning" \| "info"` | `"secondary"` | |
57
+ | color | `1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| "neutral"` | - | |
58
+ | isHover | `boolean` | - | |
59
+ | onClick | `(e: MouseEvent<HTMLTableRowElement>) => void` | - | |
28
60
 
29
- ## TableRow type
61
+ `*` = 필수
62
+ <!-- /props:Table.TableRow -->
30
63
 
31
64
  | type | 용도 |
32
65
  |------|------|
33
66
  | primary | 기본 행 |
34
67
  | secondary | 보조 행 (배경색 구분) |
35
68
 
69
+ ### TableCell
70
+
71
+ <!-- props:Table.TableCell -->
72
+ | Prop | 타입 | 기본값 | 설명 |
73
+ |------|------|--------|------|
74
+ | children * | `ReactNode` | - | |
75
+ | align | `"start" \| "center" \| "end"` | `"center"` | |
76
+ | isSticky | `boolean` | `false` | |
77
+ | width | `string \| number` | - | |
78
+ | nowrap | `boolean` | `false` | |
79
+ | scope | `"col" \| "row"` | `"col"` | th 로 렌더될 때의 scope. 기본 "col" (thead 안에서만 의미가 있다) |
80
+ | colSpan | `number` | - | 가로로 합칠 칸 수. 합계 행처럼 표 안에서 칸을 합칠 때 쓴다 |
81
+ | onClick | `(e: MouseEvent<HTMLTableCellElement>) => void` | - | |
82
+
83
+ `*` = 필수
84
+ <!-- /props:Table.TableCell -->
85
+
86
+ - `TableHead` 안의 `TableCell` 은 자동으로 `<th scope="col">` 로 렌더된다. 별도 prop 이 필요 없다.
87
+ - `align` 기본값은 `center` 다. 왼쪽 정렬이 필요하면 칸마다 `align="start"` 를 준다.
88
+ - `colSpan` 은 합계 행처럼 표 **안**에서 칸을 합칠 때 쓴다. "데이터 없음" 같은 빈 상태는
89
+ 표를 비우고 바깥에 `EmptyState` 를 두는 쪽이 낫다.
90
+
91
+ ```tsx
92
+ // 합계 행 — 앞 2칸을 합쳐 라벨, 마지막 칸에 값
93
+ <TableRow type="secondary">
94
+ <TableCell colSpan={2} align="start">합계</TableCell>
95
+ <TableCell align="end">1,240,000</TableCell>
96
+ </TableRow>
97
+ ```
98
+
36
99
  ---
37
100
 
38
101
  ## 올바른 예시
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",