@ncds/ui-admin-mcp 1.0.0-alpha.20 → 1.0.0-alpha.22

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.
@@ -70,6 +70,32 @@ const buildTokenNameSet = (tokenData) => {
70
70
  }
71
71
  return names;
72
72
  };
73
+ /** token prefix → 카테고리 역방향 맵 — invalid_token suggestion에 카테고리 명시용 */
74
+ const buildPrefixCategoryMap = (tokenData) => {
75
+ const map = new Map();
76
+ for (const group of tokenData.groups) {
77
+ for (const token of group.tokens) {
78
+ const stripped = token.name.replace(/^--/, '');
79
+ const segments = stripped.split('-');
80
+ if (segments.length >= 2)
81
+ map.set(`--${segments.slice(0, 2).join('-')}`, group.category);
82
+ if (segments.length >= 1)
83
+ map.set(`--${segments[0]}`, group.category);
84
+ }
85
+ }
86
+ return map;
87
+ };
88
+ /** var 이름의 prefix에서 카테고리 추론 — 더 긴 prefix 우선 */
89
+ const inferCategoryFromVarName = (varName, prefixCategoryMap) => {
90
+ const stripped = varName.replace(/^--/, '');
91
+ const segments = stripped.split('-');
92
+ if (segments.length >= 2) {
93
+ const cat = prefixCategoryMap.get(`--${segments.slice(0, 2).join('-')}`);
94
+ if (cat)
95
+ return cat;
96
+ }
97
+ return prefixCategoryMap.get(`--${segments[0]}`);
98
+ };
73
99
  /** inline style + <style> 블록의 CSS 텍스트를 하나로 합침 */
74
100
  const extractAllCss = (root) => {
75
101
  const parts = [];
@@ -125,7 +151,7 @@ const collectTokenNotUsedErrors = (css, tokenValueMap) => {
125
151
  return { errors, missing };
126
152
  };
127
153
  /** var() 참조 → invalid_token 에러 수집 + correct 카운트 */
128
- const collectInvalidTokenErrors = (css, tokenNameSet, tokenPrefixSet) => {
154
+ const collectInvalidTokenErrors = (css, tokenNameSet, tokenPrefixSet, prefixCategoryMap) => {
129
155
  const errors = [];
130
156
  let correct = 0;
131
157
  let invalid = 0;
@@ -139,12 +165,16 @@ const collectInvalidTokenErrors = (css, tokenNameSet, tokenPrefixSet) => {
139
165
  }
140
166
  else {
141
167
  invalid++;
168
+ const category = inferCategoryFromVarName(varName, prefixCategoryMap);
169
+ const suggestion = category
170
+ ? `Call get_design_tokens('${category}') to see available ${category} tokens.`
171
+ : 'Call get_design_tokens to see available tokens.';
142
172
  errors.push({
143
173
  type: 'invalid_token',
144
174
  target: `var(${varName})`,
145
175
  component: '(inline-style)',
146
176
  message: `Token '${varName}' does not exist in the design system.`,
147
- suggestion: "Call get_design_tokens('color') to see available tokens.",
177
+ suggestion,
148
178
  });
149
179
  }
150
180
  }
@@ -155,7 +185,7 @@ const detectTokenIssues = (params) => {
155
185
  const { root, tokenData, tokenValueMap } = params;
156
186
  const allCss = extractAllCss(root);
157
187
  const notUsed = collectTokenNotUsedErrors(allCss, tokenValueMap);
158
- const invalidResult = collectInvalidTokenErrors(allCss, buildTokenNameSet(tokenData), buildTokenPrefixSet(tokenData));
188
+ const invalidResult = collectInvalidTokenErrors(allCss, buildTokenNameSet(tokenData), buildTokenPrefixSet(tokenData), buildPrefixCategoryMap(tokenData));
159
189
  return {
160
190
  errors: [...notUsed.errors, ...invalidResult.errors],
161
191
  tokenUsage: { correct: invalidResult.correct, missing: notUsed.missing, invalid: invalidResult.invalid },
package/bin/version.d.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  * scripts/generate-version-ts.ts 가 ui-admin/package.json 의 version 으로부터 자동 생성한다.
4
4
  * 수동 편집 금지 — 빌드(`pnpm generate:version-ts` 또는 `pnpm build`) 시 덮어쓰여진다.
5
5
  */
6
- export declare const VERSION = "1.8.7";
6
+ export declare const VERSION = "1.8.9";
package/bin/version.js CHANGED
@@ -6,4 +6,4 @@ exports.VERSION = void 0;
6
6
  * scripts/generate-version-ts.ts 가 ui-admin/package.json 의 version 으로부터 자동 생성한다.
7
7
  * 수동 편집 금지 — 빌드(`pnpm generate:version-ts` 또는 `pnpm build`) 시 덮어쓰여진다.
8
8
  */
9
- exports.VERSION = '1.8.7';
9
+ exports.VERSION = '1.8.9';
@@ -129,7 +129,7 @@
129
129
  },
130
130
  "label": {
131
131
  "type": "string",
132
- "required": true
132
+ "required": false
133
133
  },
134
134
  "leadingIcon": {
135
135
  "type": "object",
@@ -286,13 +286,13 @@
286
286
  "usage": {
287
287
  "import": "import { BadgeGroup } from '@ncds/ui-admin';",
288
288
  "react": {
289
- "default": "<BadgeGroup groupLabel=\"\" label=\"\" />",
290
- "color:error": "<BadgeGroup color=\"error\" groupLabel=\"\" label=\"\" />",
291
- "color:neutral": "<BadgeGroup color=\"neutral\" groupLabel=\"\" label=\"\" />",
292
- "color:success": "<BadgeGroup color=\"success\" groupLabel=\"\" label=\"\" />",
293
- "color:warning": "<BadgeGroup color=\"warning\" groupLabel=\"\" label=\"\" />",
294
- "size:sm": "<BadgeGroup size=\"sm\" groupLabel=\"\" label=\"\" />",
295
- "size:xs": "<BadgeGroup size=\"xs\" groupLabel=\"\" label=\"\" />"
289
+ "default": "<BadgeGroup groupLabel=\"\" />",
290
+ "color:error": "<BadgeGroup color=\"error\" groupLabel=\"\" />",
291
+ "color:neutral": "<BadgeGroup color=\"neutral\" groupLabel=\"\" />",
292
+ "color:success": "<BadgeGroup color=\"success\" groupLabel=\"\" />",
293
+ "color:warning": "<BadgeGroup color=\"warning\" groupLabel=\"\" />",
294
+ "size:sm": "<BadgeGroup size=\"sm\" groupLabel=\"\" />",
295
+ "size:xs": "<BadgeGroup size=\"xs\" groupLabel=\"\" />"
296
296
  }
297
297
  }
298
298
  }
package/data/badge.json CHANGED
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "label": {
78
78
  "type": "string",
79
- "required": true
79
+ "required": false
80
80
  },
81
81
  "leadingIcon": {
82
82
  "type": "object",
@@ -218,6 +218,7 @@
218
218
  "type": "enum",
219
219
  "required": false,
220
220
  "values": [
221
+ "new-badge",
221
222
  "pill-dark-color",
222
223
  "pill-outline"
223
224
  ],
@@ -232,6 +233,8 @@
232
233
  "ncua-badge--error",
233
234
  "ncua-badge--md",
234
235
  "ncua-badge--neutral",
236
+ "ncua-badge--new-badge",
237
+ "ncua-badge--new-badge-",
235
238
  "ncua-badge--pill-dark-color",
236
239
  "ncua-badge--pill-outline",
237
240
  "ncua-badge--pink",
@@ -244,19 +247,20 @@
244
247
  "usage": {
245
248
  "import": "import { Badge } from '@ncds/ui-admin';",
246
249
  "react": {
247
- "default": "<Badge label=\"\" />",
248
- "color:blue": "<Badge color=\"blue\" label=\"\" />",
249
- "color:disabled": "<Badge color=\"disabled\" label=\"\" />",
250
- "color:error": "<Badge color=\"error\" label=\"\" />",
251
- "color:neutral": "<Badge color=\"neutral\" label=\"\" />",
252
- "color:pink": "<Badge color=\"pink\" label=\"\" />",
253
- "color:success": "<Badge color=\"success\" label=\"\" />",
254
- "color:warning": "<Badge color=\"warning\" label=\"\" />",
255
- "size:md": "<Badge size=\"md\" label=\"\" />",
256
- "size:sm": "<Badge size=\"sm\" label=\"\" />",
257
- "size:xs": "<Badge size=\"xs\" label=\"\" />",
258
- "type:pill-dark-color": "<Badge type=\"pill-dark-color\" label=\"\" />",
259
- "type:pill-outline": "<Badge type=\"pill-outline\" label=\"\" />"
250
+ "default": "<Badge />",
251
+ "color:blue": "<Badge color=\"blue\" />",
252
+ "color:disabled": "<Badge color=\"disabled\" />",
253
+ "color:error": "<Badge color=\"error\" />",
254
+ "color:neutral": "<Badge color=\"neutral\" />",
255
+ "color:pink": "<Badge color=\"pink\" />",
256
+ "color:success": "<Badge color=\"success\" />",
257
+ "color:warning": "<Badge color=\"warning\" />",
258
+ "size:md": "<Badge size=\"md\" />",
259
+ "size:sm": "<Badge size=\"sm\" />",
260
+ "size:xs": "<Badge size=\"xs\" />",
261
+ "type:new-badge": "<Badge type=\"new-badge\" />",
262
+ "type:pill-dark-color": "<Badge type=\"pill-dark-color\" />",
263
+ "type:pill-outline": "<Badge type=\"pill-outline\" />"
260
264
  }
261
265
  }
262
266
  }
@@ -58,6 +58,7 @@
58
58
  "type": "object",
59
59
  "required": true,
60
60
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/navigation/bread-crumb/BreadCrumb\").BreadcrumbItemProps[]",
61
+ "isArray": true,
61
62
  "properties": {
62
63
  "href": {
63
64
  "type": "string",
@@ -88,6 +88,10 @@
88
88
  "type": "function",
89
89
  "required": false
90
90
  },
91
+ "onComplete": {
92
+ "type": "function",
93
+ "required": false
94
+ },
91
95
  "onEdit": {
92
96
  "type": "function",
93
97
  "required": false
@@ -100,6 +104,7 @@
100
104
  "type": "object",
101
105
  "required": false,
102
106
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/types/dropdown/option\").OptionType[] | undefined",
107
+ "isArray": true,
103
108
  "properties": {
104
109
  "id": {
105
110
  "type": "string",
@@ -116,11 +116,13 @@
116
116
  "type": "object",
117
117
  "required": true,
118
118
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/overlays/dropdown/Dropdown\").DropdownGroup[]",
119
+ "isArray": true,
119
120
  "properties": {
120
121
  "items": {
121
122
  "type": "object",
122
123
  "required": true,
123
124
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/overlays/dropdown/Dropdown\").DropdownItemType[]",
125
+ "isArray": true,
124
126
  "properties": {
125
127
  "id": {
126
128
  "type": "string",
@@ -64,7 +64,8 @@
64
64
  "hintItems": {
65
65
  "type": "object",
66
66
  "required": false,
67
- "rawType": "string[] | undefined"
67
+ "rawType": "string[] | undefined",
68
+ "isArray": true
68
69
  },
69
70
  "hintText": {
70
71
  "type": "string",
@@ -299,7 +300,8 @@
299
300
  "value": {
300
301
  "type": "object",
301
302
  "required": false,
302
- "rawType": "File[] | undefined"
303
+ "rawType": "File[] | undefined",
304
+ "isArray": true
303
305
  }
304
306
  },
305
307
  "html": {},
@@ -61,6 +61,7 @@
61
61
  "type": "object",
62
62
  "required": false,
63
63
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/tab/TabButton\").TabButtonProps[] | undefined",
64
+ "isArray": true,
64
65
  "properties": {
65
66
  "id": {
66
67
  "type": "string",
@@ -101,12 +102,13 @@
101
102
  "properties": {
102
103
  "label": {
103
104
  "type": "string",
104
- "required": true
105
+ "required": false
105
106
  },
106
107
  "type": {
107
108
  "type": "enum",
108
109
  "required": false,
109
110
  "values": [
111
+ "new-badge",
110
112
  "pill-dark-color",
111
113
  "pill-outline"
112
114
  ]
@@ -67,7 +67,8 @@
67
67
  "hintItems": {
68
68
  "type": "object",
69
69
  "required": false,
70
- "rawType": "string[] | undefined"
70
+ "rawType": "string[] | undefined",
71
+ "isArray": true
71
72
  },
72
73
  "hintText": {
73
74
  "type": "string",
@@ -322,7 +323,8 @@
322
323
  "value": {
323
324
  "type": "object",
324
325
  "required": false,
325
- "rawType": "File[] | undefined"
326
+ "rawType": "File[] | undefined",
327
+ "isArray": true
326
328
  }
327
329
  },
328
330
  "html": {},
@@ -338,6 +340,7 @@
338
340
  "ncua-image-file-input__empty-slot-wrapper",
339
341
  "ncua-image-file-input__preview-container",
340
342
  "ncua-image-file-input__previews",
343
+ "ncua-image-file-input__slot-tooltip",
341
344
  "ncua-input__help-icon"
342
345
  ],
343
346
  "usage": {
@@ -46,6 +46,7 @@
46
46
  "type": "object",
47
47
  "required": false,
48
48
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/overlays/notification/Notification\").NotificationAction[] | undefined",
49
+ "isArray": true,
49
50
  "properties": {
50
51
  "label": {
51
52
  "type": "string",
@@ -57,6 +57,7 @@
57
57
  "type": "object",
58
58
  "required": false,
59
59
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/layout/page-title/PageTitle\").PageTitleBreadcrumbItem[] | undefined",
60
+ "isArray": true,
60
61
  "properties": {
61
62
  "label": {
62
63
  "type": "string",
@@ -53,6 +53,7 @@
53
53
  "type": "object",
54
54
  "required": false,
55
55
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/feedback-and-status/progress-bar/types\").ProgressSegment[] | undefined",
56
+ "isArray": true,
56
57
  "properties": {
57
58
  "value": {
58
59
  "type": "number",
@@ -2,7 +2,7 @@
2
2
  "name": "range-date-picker-with-buttons",
3
3
  "exportName": "RangeDatePickerWithButtons",
4
4
  "importPath": "@ncds/ui-admin",
5
- "jsRequired": false,
5
+ "jsRequired": true,
6
6
  "category": "forms-and-input",
7
7
  "description": "기간 옵션 버튼이 내장된 RangeDatePicker 확장 컴포넌트로 빠른 기간 설정을 지원합니다",
8
8
  "aliases": [
@@ -126,7 +126,8 @@
126
126
  "periodKeys": {
127
127
  "type": "object",
128
128
  "required": true,
129
- "rawType": "(keyof T & string)[]"
129
+ "rawType": "(keyof T & string)[]",
130
+ "isArray": true
130
131
  },
131
132
  "setCurrentButtonId": {
132
133
  "type": "function",
@@ -2,7 +2,7 @@
2
2
  "name": "range-date-picker",
3
3
  "exportName": "RangeDatePicker",
4
4
  "importPath": "@ncds/ui-admin",
5
- "jsRequired": false,
5
+ "jsRequired": true,
6
6
  "category": "forms-and-input",
7
7
  "description": "RangeDatePicker는 시작일~종료일 기간 범위를 선택해야 하는 경우 사용하는 복합 선택 위젯입니다. 검색 기간 설정, 노출 기간 설정, 이벤트 기간 설정 등 두 날짜의 쌍(Pair)이 필요한 모든 상황에서 사용합니다.",
8
8
  "aliases": [
@@ -109,6 +109,10 @@
109
109
  "type": "function",
110
110
  "required": false
111
111
  },
112
+ "onComplete": {
113
+ "type": "function",
114
+ "required": false
115
+ },
112
116
  "onEdit": {
113
117
  "type": "function",
114
118
  "required": false
@@ -117,6 +121,7 @@
117
121
  "type": "object",
118
122
  "required": false,
119
123
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/types/dropdown/option\").OptionType[] | undefined",
124
+ "isArray": true,
120
125
  "properties": {
121
126
  "id": {
122
127
  "type": "string",
package/data/select.json CHANGED
@@ -58,6 +58,7 @@
58
58
  "type": "object",
59
59
  "required": false,
60
60
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/types/dropdown/option\").OptionType[] | undefined",
61
+ "isArray": true,
61
62
  "properties": {
62
63
  "id": {
63
64
  "type": "string",
package/data/table.json CHANGED
@@ -226,12 +226,14 @@
226
226
  "minWidths": {
227
227
  "type": "object",
228
228
  "required": false,
229
- "rawType": "(string | number)[] | undefined"
229
+ "rawType": "(string | number)[] | undefined",
230
+ "isArray": true
230
231
  },
231
232
  "widths": {
232
233
  "type": "object",
233
234
  "required": true,
234
- "rawType": "(string | number)[]"
235
+ "rawType": "(string | number)[]",
236
+ "isArray": true
235
237
  }
236
238
  }
237
239
  },
package/data/tooltip.json CHANGED
@@ -87,6 +87,10 @@
87
87
  ],
88
88
  "default": "stroke"
89
89
  },
90
+ "panelClassName": {
91
+ "type": "string",
92
+ "required": false
93
+ },
90
94
  "position": {
91
95
  "type": "enum",
92
96
  "required": false,
@@ -60,6 +60,7 @@
60
60
  "type": "object",
61
61
  "required": false,
62
62
  "rawType": "import(\"/home/runner/_work/ncds/ncds/packages/ui-admin/src/components/tab/TabButton\").TabButtonProps[] | undefined",
63
+ "isArray": true,
63
64
  "properties": {
64
65
  "id": {
65
66
  "type": "string",
@@ -100,12 +101,13 @@
100
101
  "properties": {
101
102
  "label": {
102
103
  "type": "string",
103
- "required": true
104
+ "required": false
104
105
  },
105
106
  "type": {
106
107
  "type": "enum",
107
108
  "required": false,
108
109
  "values": [
110
+ "new-badge",
109
111
  "pill-dark-color",
110
112
  "pill-outline"
111
113
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncds/ui-admin-mcp",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.22",
4
4
  "description": "NCDS UI Admin MCP 서버 — AI 에이전트가 NCUA 컴포넌트를 조회하고 HTML을 검증할 수 있는 MCP 서버",
5
5
  "bin": {
6
6
  "ncua-mcp": "./bin/server.mjs"
@@ -12,7 +12,7 @@
12
12
  "README.md"
13
13
  ],
14
14
  "engines": {
15
- "node": ">=20"
15
+ "node": ">=22.0.0"
16
16
  },
17
17
  "scripts": {
18
18
  "extract": "tsx scripts/extract-mcp-data.ts",
@@ -23,7 +23,7 @@ cp node_modules/@ncds/ui-admin-mcp/templates/.mcp.json.example .mcp.json
23
23
 
24
24
  ## 요구사항
25
25
 
26
- - Node.js 20 이상
26
+ - Node.js 22 이상
27
27
 
28
28
  ## 확인 방법
29
29