@uniai-fe/uds-primitives 0.3.28 → 0.3.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-primitives",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "UNIAI Design System; Primitives Components Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -15,7 +15,7 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "packageManager": "pnpm@10.30.2",
18
+ "packageManager": "pnpm@10.30.3",
19
19
  "engines": {
20
20
  "node": ">=24",
21
21
  "pnpm": ">=10"
@@ -91,34 +91,42 @@ export interface TableColgroupProps extends ComponentPropsWithoutRef<"colgroup">
91
91
 
92
92
  /**
93
93
  * Table Types; Container column data
94
+ * @template RowData column dataKey가 참조할 row 데이터 타입
95
+ * @template DataKey row 데이터에서 허용할 key 타입
94
96
  * @property {string} key column 고유 key
97
+ * @property {string} dataKey column 데이터 property 키
98
+ * @property {React.ReactNode} cellContents 헤더 셀 콘텐츠
95
99
  * @property {number | string} [width] width 값
96
- * @property {string} [dataKey] tbody loop 렌더링 시 데이터 매핑(property key)용 식별자 및 data-key attr 값
97
- * @property {React.ReactNode} [cellContents] 헤더 셀 콘텐츠
98
100
  * @property {"left" | "center" | "right" | "normal" | "start" | "end" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "stretch"} [alignX] 헤더 가로 정렬(CSS `justify-content` 값과 매핑)
99
101
  * @property {"top" | "center" | "bottom" | "normal" | "stretch" | "start" | "end" | "flex-start" | "flex-end" | "self-start" | "self-end" | "baseline"} [alignY] 헤더 세로 정렬(CSS `align-items` 값과 매핑)
100
102
  */
101
- export interface TableColumnData {
103
+ export interface TableColumnData<
104
+ RowData extends Record<string, unknown> = Record<string, unknown>,
105
+ DataKey extends Extract<keyof RowData, string> = Extract<
106
+ keyof RowData,
107
+ string
108
+ >,
109
+ > {
102
110
  /**
103
111
  * column 고유 key
104
112
  */
105
113
  key: string;
106
114
  /**
107
- * width
115
+ * column 데이터 property 키
108
116
  */
109
- width?: number | string;
117
+ dataKey: DataKey;
110
118
  /**
111
- * tbody loop 렌더링 시 데이터 매핑(property key)용 식별자 및 data-key attr 값
119
+ * 헤더 콘텐츠
112
120
  */
113
- dataKey?: string;
121
+ cellContents: React.ReactNode;
114
122
  /**
115
- * col className
123
+ * width
116
124
  */
117
- className?: string;
125
+ width?: number | string;
118
126
  /**
119
- * 헤더 셀 콘텐츠
127
+ * col className
120
128
  */
121
- cellContents?: React.ReactNode;
129
+ className?: string;
122
130
  /**
123
131
  * 헤더 가로 정렬
124
132
  */
@@ -131,7 +139,8 @@ export interface TableColumnData {
131
139
 
132
140
  /**
133
141
  * Table Types; Container props
134
- * @property {TableColumnData[]} [columns] colgroup/head 자동 렌더링용 column 데이터
142
+ * @template RowData columns dataKey가 참조할 row 데이터 타입
143
+ * @property {TableColumnData<RowData>[]} [columns] colgroup/head 자동 렌더링용 column 데이터
135
144
  * @property {boolean} [isCustomBody] true면 body wrapper 없이 children을 직접 렌더링
136
145
  * @property {boolean} [scrollable=false] true면 외부 스크롤 래퍼를 추가한다.
137
146
  * @property {"x" | "y" | "both"} [scrollAxis="x"] scrollable일 때 스크롤 축
@@ -139,11 +148,13 @@ export interface TableColumnData {
139
148
  * @property {React.ReactNode} [footer] footer 노드
140
149
  * @property {React.ReactNode} [children] body 콘텐츠
141
150
  */
142
- export interface TableContainerProps extends TableRootProps {
151
+ export interface TableContainerProps<
152
+ RowData extends Record<string, unknown> = Record<string, unknown>,
153
+ > extends TableRootProps {
143
154
  /**
144
155
  * colgroup/head 자동 렌더링용 column 데이터
145
156
  */
146
- columns?: TableColumnData[];
157
+ columns?: TableColumnData<RowData>[];
147
158
  /**
148
159
  * true면 body wrapper 없이 children을 직접 렌더링
149
160
  */