@spectrabrain/eds 0.0.3 → 0.1.0
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/AI.md +43 -16
- package/AI_CONTEXT.json +159 -0
- package/CHANGELOG.md +58 -0
- package/CONSUMER_AGENT.md +230 -0
- package/QUICKSTART.md +47 -0
- package/README.md +33 -10
- package/TAILWIND_V4.md +233 -0
- package/TOKEN_CONTEXT.md +71 -0
- package/consumer/cli.mjs +107 -0
- package/consumer/css-root.mjs +239 -0
- package/consumer/doctor.mjs +178 -0
- package/consumer/generate-tailwind.mjs +83 -0
- package/consumer/init.mjs +172 -0
- package/consumer/managed-block.mjs +120 -0
- package/consumer/paths.mjs +211 -0
- package/consumer/register-scripts.mjs +124 -0
- package/consumer/scan-classes.mjs +70 -0
- package/consumer/sync.mjs +133 -0
- package/consumer/update-agent-context.mjs +87 -0
- package/consumer-postinstall.mjs +59 -0
- package/dist/base.css +4 -0
- package/dist/components/Button/README.md +29 -10
- package/dist/components/Button/spec.json +64 -7
- package/dist/components.css +0 -2
- package/dist/index.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +120 -6266
- package/dist/index.mjs +122 -6268
- package/dist/styles.css +1 -0
- package/dist/tokens.css +19 -10
- package/dist/tokens.d.mts +3 -3
- package/dist/tokens.d.ts +3 -3
- package/dist/tokens.js +92 -17
- package/dist/tokens.json +104 -10
- package/dist/tokens.mjs +92 -17
- package/llms.txt +15 -7
- package/package.json +33 -2
package/dist/tokens.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/generated/tokens.ts
|
|
2
|
-
var tokenMap = {
|
|
2
|
+
var tokenMap = /* @__PURE__ */ Object.freeze({
|
|
3
3
|
"color-bg-brand-primary": {
|
|
4
4
|
"name": "color-bg-brand-primary",
|
|
5
5
|
"type": "color",
|
|
@@ -12,6 +12,18 @@ var tokenMap = {
|
|
|
12
12
|
"value": "#DB3700",
|
|
13
13
|
"cssVariable": "--eds-color-bg-brand-primary-hover"
|
|
14
14
|
},
|
|
15
|
+
"color-bg-brand-weak": {
|
|
16
|
+
"name": "color-bg-brand-weak",
|
|
17
|
+
"type": "color",
|
|
18
|
+
"value": "#FFA081",
|
|
19
|
+
"cssVariable": "--eds-color-bg-brand-weak"
|
|
20
|
+
},
|
|
21
|
+
"color-bg-brand-weak-hover": {
|
|
22
|
+
"name": "color-bg-brand-weak-hover",
|
|
23
|
+
"type": "color",
|
|
24
|
+
"value": "#FF7141",
|
|
25
|
+
"cssVariable": "--eds-color-bg-brand-weak-hover"
|
|
26
|
+
},
|
|
15
27
|
"color-bg-critical-primary": {
|
|
16
28
|
"name": "color-bg-critical-primary",
|
|
17
29
|
"type": "color",
|
|
@@ -27,13 +39,13 @@ var tokenMap = {
|
|
|
27
39
|
"color-bg-critical-weak": {
|
|
28
40
|
"name": "color-bg-critical-weak",
|
|
29
41
|
"type": "color",
|
|
30
|
-
"value": "#
|
|
42
|
+
"value": "#FEE2E2",
|
|
31
43
|
"cssVariable": "--eds-color-bg-critical-weak"
|
|
32
44
|
},
|
|
33
45
|
"color-bg-critical-weak-hover": {
|
|
34
46
|
"name": "color-bg-critical-weak-hover",
|
|
35
47
|
"type": "color",
|
|
36
|
-
"value": "#
|
|
48
|
+
"value": "#FECACA",
|
|
37
49
|
"cssVariable": "--eds-color-bg-critical-weak-hover"
|
|
38
50
|
},
|
|
39
51
|
"color-bg-disabled": {
|
|
@@ -57,13 +69,13 @@ var tokenMap = {
|
|
|
57
69
|
"color-bg-informative-weak": {
|
|
58
70
|
"name": "color-bg-informative-weak",
|
|
59
71
|
"type": "color",
|
|
60
|
-
"value": "#
|
|
72
|
+
"value": "#DBEAFE",
|
|
61
73
|
"cssVariable": "--eds-color-bg-informative-weak"
|
|
62
74
|
},
|
|
63
75
|
"color-bg-informative-weak-hover": {
|
|
64
76
|
"name": "color-bg-informative-weak-hover",
|
|
65
77
|
"type": "color",
|
|
66
|
-
"value": "#
|
|
78
|
+
"value": "#BFDBFE",
|
|
67
79
|
"cssVariable": "--eds-color-bg-informative-weak-hover"
|
|
68
80
|
},
|
|
69
81
|
"color-bg-layer-basement": {
|
|
@@ -72,6 +84,12 @@ var tokenMap = {
|
|
|
72
84
|
"value": "#F3F4F6",
|
|
73
85
|
"cssVariable": "--eds-color-bg-layer-basement"
|
|
74
86
|
},
|
|
87
|
+
"color-bg-layer-basement-hover": {
|
|
88
|
+
"name": "color-bg-layer-basement-hover",
|
|
89
|
+
"type": "color",
|
|
90
|
+
"value": "#ECEEF1",
|
|
91
|
+
"cssVariable": "--eds-color-bg-layer-basement-hover"
|
|
92
|
+
},
|
|
75
93
|
"color-bg-layer-default": {
|
|
76
94
|
"name": "color-bg-layer-default",
|
|
77
95
|
"type": "color",
|
|
@@ -147,13 +165,13 @@ var tokenMap = {
|
|
|
147
165
|
"color-bg-positive-weak": {
|
|
148
166
|
"name": "color-bg-positive-weak",
|
|
149
167
|
"type": "color",
|
|
150
|
-
"value": "#
|
|
168
|
+
"value": "#DCFCE7",
|
|
151
169
|
"cssVariable": "--eds-color-bg-positive-weak"
|
|
152
170
|
},
|
|
153
171
|
"color-bg-positive-weak-hover": {
|
|
154
172
|
"name": "color-bg-positive-weak-hover",
|
|
155
173
|
"type": "color",
|
|
156
|
-
"value": "#
|
|
174
|
+
"value": "#BBF7D0",
|
|
157
175
|
"cssVariable": "--eds-color-bg-positive-weak-hover"
|
|
158
176
|
},
|
|
159
177
|
"color-bg-transparent": {
|
|
@@ -183,13 +201,13 @@ var tokenMap = {
|
|
|
183
201
|
"color-bg-warning-weak": {
|
|
184
202
|
"name": "color-bg-warning-weak",
|
|
185
203
|
"type": "color",
|
|
186
|
-
"value": "#
|
|
204
|
+
"value": "#FEF9C3",
|
|
187
205
|
"cssVariable": "--eds-color-bg-warning-weak"
|
|
188
206
|
},
|
|
189
207
|
"color-bg-warning-weak-hover": {
|
|
190
208
|
"name": "color-bg-warning-weak-hover",
|
|
191
209
|
"type": "color",
|
|
192
|
-
"value": "#
|
|
210
|
+
"value": "#FEF08A",
|
|
193
211
|
"cssVariable": "--eds-color-bg-warning-weak-hover"
|
|
194
212
|
},
|
|
195
213
|
"color-fg-brand": {
|
|
@@ -291,7 +309,7 @@ var tokenMap = {
|
|
|
291
309
|
"color-fg-warning-contrast": {
|
|
292
310
|
"name": "color-fg-warning-contrast",
|
|
293
311
|
"type": "color",
|
|
294
|
-
"value": "#
|
|
312
|
+
"value": "#A16207",
|
|
295
313
|
"cssVariable": "--eds-color-fg-warning-contrast"
|
|
296
314
|
},
|
|
297
315
|
"color-stroke-brand-primary": {
|
|
@@ -351,9 +369,15 @@ var tokenMap = {
|
|
|
351
369
|
"color-stroke-neutral-secondary": {
|
|
352
370
|
"name": "color-stroke-neutral-secondary",
|
|
353
371
|
"type": "color",
|
|
354
|
-
"value": "#
|
|
372
|
+
"value": "#9CA3AF",
|
|
355
373
|
"cssVariable": "--eds-color-stroke-neutral-secondary"
|
|
356
374
|
},
|
|
375
|
+
"color-stroke-neutral-tertiary": {
|
|
376
|
+
"name": "color-stroke-neutral-tertiary",
|
|
377
|
+
"type": "color",
|
|
378
|
+
"value": "#E5E7EB",
|
|
379
|
+
"cssVariable": "--eds-color-stroke-neutral-tertiary"
|
|
380
|
+
},
|
|
357
381
|
"color-stroke-neutral-weak": {
|
|
358
382
|
"name": "color-stroke-neutral-weak",
|
|
359
383
|
"type": "color",
|
|
@@ -900,6 +924,49 @@ var tokenMap = {
|
|
|
900
924
|
},
|
|
901
925
|
"cssVariable": "--eds-typography-heading3-lineHeight"
|
|
902
926
|
},
|
|
927
|
+
"typography-heading4-fontFamily": {
|
|
928
|
+
"name": "typography-heading4-fontFamily",
|
|
929
|
+
"type": "fontFamily",
|
|
930
|
+
"value": [
|
|
931
|
+
"Pretendard",
|
|
932
|
+
"system-ui",
|
|
933
|
+
"sans-serif"
|
|
934
|
+
],
|
|
935
|
+
"cssVariable": "--eds-typography-heading4-fontFamily"
|
|
936
|
+
},
|
|
937
|
+
"typography-heading4-fontSize": {
|
|
938
|
+
"name": "typography-heading4-fontSize",
|
|
939
|
+
"type": "dimension",
|
|
940
|
+
"value": {
|
|
941
|
+
"value": 1.25,
|
|
942
|
+
"unit": "rem"
|
|
943
|
+
},
|
|
944
|
+
"cssVariable": "--eds-typography-heading4-fontSize"
|
|
945
|
+
},
|
|
946
|
+
"typography-heading4-fontWeight": {
|
|
947
|
+
"name": "typography-heading4-fontWeight",
|
|
948
|
+
"type": "fontWeight",
|
|
949
|
+
"value": 550,
|
|
950
|
+
"cssVariable": "--eds-typography-heading4-fontWeight"
|
|
951
|
+
},
|
|
952
|
+
"typography-heading4-letterSpacing": {
|
|
953
|
+
"name": "typography-heading4-letterSpacing",
|
|
954
|
+
"type": "dimension",
|
|
955
|
+
"value": {
|
|
956
|
+
"value": -0.2,
|
|
957
|
+
"unit": "px"
|
|
958
|
+
},
|
|
959
|
+
"cssVariable": "--eds-typography-heading4-letterSpacing"
|
|
960
|
+
},
|
|
961
|
+
"typography-heading4-lineHeight": {
|
|
962
|
+
"name": "typography-heading4-lineHeight",
|
|
963
|
+
"type": "dimension",
|
|
964
|
+
"value": {
|
|
965
|
+
"value": 2,
|
|
966
|
+
"unit": "rem"
|
|
967
|
+
},
|
|
968
|
+
"cssVariable": "--eds-typography-heading4-lineHeight"
|
|
969
|
+
},
|
|
903
970
|
"typography-title1-fontFamily": {
|
|
904
971
|
"name": "typography-title1-fontFamily",
|
|
905
972
|
"type": "fontFamily",
|
|
@@ -1072,11 +1139,13 @@ var tokenMap = {
|
|
|
1072
1139
|
},
|
|
1073
1140
|
"cssVariable": "--eds-typography-title4-lineHeight"
|
|
1074
1141
|
}
|
|
1075
|
-
};
|
|
1076
|
-
var tokens =
|
|
1077
|
-
var tokenNames = Object.freeze([
|
|
1142
|
+
});
|
|
1143
|
+
var tokens = tokenMap;
|
|
1144
|
+
var tokenNames = /* @__PURE__ */ Object.freeze([
|
|
1078
1145
|
"color-bg-brand-primary",
|
|
1079
1146
|
"color-bg-brand-primary-hover",
|
|
1147
|
+
"color-bg-brand-weak",
|
|
1148
|
+
"color-bg-brand-weak-hover",
|
|
1080
1149
|
"color-bg-critical-primary",
|
|
1081
1150
|
"color-bg-critical-primary-hover",
|
|
1082
1151
|
"color-bg-critical-weak",
|
|
@@ -1087,6 +1156,7 @@ var tokenNames = Object.freeze([
|
|
|
1087
1156
|
"color-bg-informative-weak",
|
|
1088
1157
|
"color-bg-informative-weak-hover",
|
|
1089
1158
|
"color-bg-layer-basement",
|
|
1159
|
+
"color-bg-layer-basement-hover",
|
|
1090
1160
|
"color-bg-layer-default",
|
|
1091
1161
|
"color-bg-layer-default-hover",
|
|
1092
1162
|
"color-bg-layer-floating",
|
|
@@ -1134,6 +1204,7 @@ var tokenNames = Object.freeze([
|
|
|
1134
1204
|
"color-stroke-neutral-contrast",
|
|
1135
1205
|
"color-stroke-neutral-primary",
|
|
1136
1206
|
"color-stroke-neutral-secondary",
|
|
1207
|
+
"color-stroke-neutral-tertiary",
|
|
1137
1208
|
"color-stroke-neutral-weak",
|
|
1138
1209
|
"color-stroke-positive-primary",
|
|
1139
1210
|
"color-stroke-positive-weak",
|
|
@@ -1199,6 +1270,11 @@ var tokenNames = Object.freeze([
|
|
|
1199
1270
|
"typography-heading3-fontWeight",
|
|
1200
1271
|
"typography-heading3-letterSpacing",
|
|
1201
1272
|
"typography-heading3-lineHeight",
|
|
1273
|
+
"typography-heading4-fontFamily",
|
|
1274
|
+
"typography-heading4-fontSize",
|
|
1275
|
+
"typography-heading4-fontWeight",
|
|
1276
|
+
"typography-heading4-letterSpacing",
|
|
1277
|
+
"typography-heading4-lineHeight",
|
|
1202
1278
|
"typography-title1-fontFamily",
|
|
1203
1279
|
"typography-title1-fontSize",
|
|
1204
1280
|
"typography-title1-fontWeight",
|
|
@@ -1221,11 +1297,10 @@ var tokenNames = Object.freeze([
|
|
|
1221
1297
|
"typography-title4-lineHeight"
|
|
1222
1298
|
]);
|
|
1223
1299
|
function cssVar(name) {
|
|
1224
|
-
|
|
1225
|
-
if (!token) {
|
|
1300
|
+
if (!tokenNames.includes(name)) {
|
|
1226
1301
|
throw new Error("Unknown semantic token: " + name);
|
|
1227
1302
|
}
|
|
1228
|
-
return "var(" +
|
|
1303
|
+
return "var(--eds-" + name + ")";
|
|
1229
1304
|
}
|
|
1230
1305
|
|
|
1231
1306
|
export { cssVar, tokenNames, tokens };
|
package/llms.txt
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# EVA Design System AI 문서 인덱스
|
|
2
2
|
|
|
3
|
-
이 패키지는 React 웹용 EVA 디자인 시스템입니다. 다음 순서로 문서를 읽습니다.
|
|
3
|
+
이 패키지는 React 웹용 EVA 디자인 시스템입니다. 소비처 AI는 `require.resolve("@spectrabrain/eds/package.json")`로 설치된 package root를 찾은 뒤 다음 순서로 문서를 읽습니다. 아래 경로는 모두 package root 기준 파일 경로입니다. 필수 읽기는 1번 하나이며 나머지는 조건에 해당할 때만 읽습니다. 읽기 순서와 조건의 기계용 원천은 `AI_CONTEXT.json`의 `readOrder`이며, 이 문서와 다르면 `AI_CONTEXT.json`을 따릅니다.
|
|
4
4
|
|
|
5
|
-
1.
|
|
6
|
-
2.
|
|
7
|
-
3.
|
|
8
|
-
4.
|
|
9
|
-
5.
|
|
5
|
+
1. `QUICKSTART.md`: 규칙, 명령, 더 읽을 문서의 조건입니다. 필수입니다.
|
|
6
|
+
2. `CONSUMER_AGENT.md`: setup·sync·doctor를 다룰 때 managed block, 패키지 매니저별 `init`, font 정책, 보고 형식을 확인합니다.
|
|
7
|
+
3. `AI.md`: 공개 범위와 금지 사례를 확인할 때 읽습니다.
|
|
8
|
+
4. `TOKEN_CONTEXT.md`: token을 직접 고를 때 semantic color·typography의 역할을 확인합니다.
|
|
9
|
+
5. `TAILWIND_V4.md`: Tailwind CSS v4에서 token을 사용할 때 읽습니다.
|
|
10
|
+
6. `dist/tokens.json`: token, CSS variable, Tailwind alias를 고를 때 설치된 버전의 공개 token 이름을 확인합니다.
|
|
11
|
+
7. `dist/components/Button/README.md`: Button을 사용할 때 개요·사용 맥락·API를 읽습니다.
|
|
12
|
+
8. `dist/components/Button/spec.json`: Button API나 접근성 동작을 구현할 때 허용 조합, 접근성 계약, `api.iconNames` 아이콘 목록을 확인합니다.
|
|
13
|
+
9. `CHANGELOG.md`: EDS 버전을 올린 뒤 바뀐 내용을 확인할 때 읽습니다.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
설치 방법과 CSS 진입점은 `README.md`에서 확인합니다. `dist/` 아래 파일은 `@spectrabrain/eds/tokens.json`, `@spectrabrain/eds/components/Button/spec.json`처럼 `dist/`를 뗀 export 경로로도 읽을 수 있습니다.
|
|
16
|
+
|
|
17
|
+
npm 10·11에서는 EDS `postinstall`이 소비처 `package.json`에 `sync:eds`·`eds:doctor` script를 등록하고, 그 밖의 환경에서는 `npx @spectrabrain/eds init`이 같은 script를 등록합니다. 설치·업데이트 후 소비처는 `npm run sync:eds`를 명시적으로 실행해 Tailwind root CSS import, Tailwind alias, `AGENTS.md` managed block을 갱신하며, `npm run eds:doctor`로 동기화 상태를 점검합니다. EDS text style은 `@spectrabrain/eds/fonts.css`가 선언하는 font family를 참조하므로 `styles.css` 또는 `fonts.css` import를 생략하지 않습니다.
|
|
18
|
+
|
|
19
|
+
문서에 없는 API나 시각 상태를 추측하지 않습니다. 구현보다 공개 문서와 TypeScript contract를 우선합니다.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrabrain/eds",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "EVA services' shared React design system",
|
|
5
5
|
"author": "SpectraBrain",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -8,13 +8,31 @@
|
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"module": "./dist/index.mjs",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
+
"typesVersions": {
|
|
12
|
+
"*": {
|
|
13
|
+
"tokens": [
|
|
14
|
+
"./dist/tokens.d.ts"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
11
18
|
"files": [
|
|
12
19
|
"dist",
|
|
13
20
|
"README.md",
|
|
14
21
|
"AI.md",
|
|
22
|
+
"AI_CONTEXT.json",
|
|
23
|
+
"CONSUMER_AGENT.md",
|
|
24
|
+
"TOKEN_CONTEXT.md",
|
|
15
25
|
"llms.txt",
|
|
26
|
+
"TAILWIND_V4.md",
|
|
27
|
+
"QUICKSTART.md",
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"consumer-postinstall.mjs",
|
|
30
|
+
"consumer",
|
|
16
31
|
"NOTICE"
|
|
17
32
|
],
|
|
33
|
+
"bin": {
|
|
34
|
+
"eds": "./consumer/cli.mjs"
|
|
35
|
+
},
|
|
18
36
|
"scripts": {
|
|
19
37
|
"tokens:generate": "tsx scripts/build-tokens.ts",
|
|
20
38
|
"components:generate": "tsx scripts/build-components.ts",
|
|
@@ -22,6 +40,7 @@
|
|
|
22
40
|
"tokens:validate": "tsx scripts/build-tokens.ts --validate",
|
|
23
41
|
"tokens:connectivity": "tsx scripts/check-token-connectivity.ts",
|
|
24
42
|
"tokens:connectivity:strict": "npm run tokens:connectivity -- --strict",
|
|
43
|
+
"tokens:contrast": "npm run tokens:generate && tsx scripts/check-token-contrast.ts",
|
|
25
44
|
"library:build": "tsup",
|
|
26
45
|
"fonts:build": "tsx scripts/build-font-assets.ts",
|
|
27
46
|
"tokens:build": "npm run typecheck && npm run library:build && npm run component-manifest:generate && npm run fonts:build && npm run public-boundary:check",
|
|
@@ -32,6 +51,7 @@
|
|
|
32
51
|
"typecheck": "npm run tokens:generate && npm run components:generate && npm run component-manifest:generate && tsc --noEmit",
|
|
33
52
|
"build": "npm run tokens:build",
|
|
34
53
|
"package:check": "node scripts/check-package-exports.mjs",
|
|
54
|
+
"postinstall": "node ./consumer-postinstall.mjs",
|
|
35
55
|
"prepack": "npm run tokens:build",
|
|
36
56
|
"test:unit": "vitest run",
|
|
37
57
|
"test": "npm run tokens:build && npm run test:unit"
|
|
@@ -45,7 +65,9 @@
|
|
|
45
65
|
"sideEffects": [
|
|
46
66
|
"./dist/tokens.css",
|
|
47
67
|
"./dist/styles.css",
|
|
48
|
-
"./dist/fonts.css"
|
|
68
|
+
"./dist/fonts.css",
|
|
69
|
+
"./dist/components.css",
|
|
70
|
+
"./dist/base.css"
|
|
49
71
|
],
|
|
50
72
|
"peerDependencies": {
|
|
51
73
|
"react": ">=18.2 <20"
|
|
@@ -105,10 +127,19 @@
|
|
|
105
127
|
"./tokens.css": "./dist/tokens.css",
|
|
106
128
|
"./styles.css": "./dist/styles.css",
|
|
107
129
|
"./fonts.css": "./dist/fonts.css",
|
|
130
|
+
"./components.css": "./dist/components.css",
|
|
131
|
+
"./base.css": "./dist/base.css",
|
|
108
132
|
"./tokens.json": "./dist/tokens.json",
|
|
109
133
|
"./components/Button/README.md": "./dist/components/Button/README.md",
|
|
110
134
|
"./components/Button/spec.json": "./dist/components/Button/spec.json",
|
|
135
|
+
"./CONSUMER_AGENT.md": "./CONSUMER_AGENT.md",
|
|
136
|
+
"./AI.md": "./AI.md",
|
|
137
|
+
"./CHANGELOG.md": "./CHANGELOG.md",
|
|
138
|
+
"./AI_CONTEXT.json": "./AI_CONTEXT.json",
|
|
139
|
+
"./TOKEN_CONTEXT.md": "./TOKEN_CONTEXT.md",
|
|
111
140
|
"./llms.txt": "./llms.txt",
|
|
141
|
+
"./TAILWIND_V4.md": "./TAILWIND_V4.md",
|
|
142
|
+
"./QUICKSTART.md": "./QUICKSTART.md",
|
|
112
143
|
"./package.json": "./package.json"
|
|
113
144
|
}
|
|
114
145
|
}
|