@spectrabrain/eds 0.1.0 → 0.2.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.
Files changed (62) hide show
  1. package/AI.md +13 -63
  2. package/AI_CONTEXT.json +26 -95
  3. package/CHANGELOG.md +70 -4
  4. package/CONSUMER_AGENT.md +86 -164
  5. package/FRONTEND_CONVENTIONS.md +252 -0
  6. package/QUICKSTART.md +24 -29
  7. package/README.md +29 -73
  8. package/TAILWIND_V4.md +52 -184
  9. package/TOKEN_CONTEXT.md +79 -36
  10. package/consumer/align/templates/components.json +21 -0
  11. package/consumer/align/templates/env.mock +1 -0
  12. package/consumer/align/templates/eslint.config.js +35 -0
  13. package/consumer/align/templates/package.scripts.json +10 -0
  14. package/consumer/align/templates/prettierignore +2 -0
  15. package/consumer/align/templates/prettierrc.json +7 -0
  16. package/consumer/align/templates/src/app/App.tsx +16 -0
  17. package/consumer/align/templates/src/app/main.tsx +27 -0
  18. package/consumer/align/templates/src/app/providers/ErrorBoundary.tsx +58 -0
  19. package/consumer/align/templates/src/app/providers/ErrorHandler.tsx +29 -0
  20. package/consumer/align/templates/src/app/router/index.tsx +23 -0
  21. package/consumer/align/templates/src/app/styles/index.css +2 -0
  22. package/consumer/align/templates/src/mocks/browser.ts +5 -0
  23. package/consumer/align/templates/src/mocks/handlers.ts +4 -0
  24. package/consumer/align/templates/src/shared/api/index.ts +23 -0
  25. package/consumer/align/templates/src/shared/api/queryClient.ts +24 -0
  26. package/consumer/align/templates/src/shared/lib/eventBus.ts +44 -0
  27. package/consumer/align/templates/src/shared/lib/utils/index.ts +6 -0
  28. package/consumer/align/templates/src/vite-env.d.ts +2 -0
  29. package/consumer/align/templates/tsconfig.json +22 -0
  30. package/consumer/align/templates/vite.config.babel.ts +36 -0
  31. package/consumer/align/templates/vite.config.rolldown.ts +35 -0
  32. package/consumer/align-analysis.mjs +1159 -0
  33. package/consumer/align-plan.mjs +377 -0
  34. package/consumer/align-rules.mjs +473 -0
  35. package/consumer/align.mjs +401 -0
  36. package/consumer/cli.mjs +90 -40
  37. package/consumer/css-root.mjs +24 -4
  38. package/consumer/doctor.mjs +47 -21
  39. package/consumer/generate-tailwind.mjs +41 -1
  40. package/consumer/init.mjs +39 -25
  41. package/consumer/managed-block.mjs +11 -5
  42. package/consumer/paths.mjs +69 -14
  43. package/consumer/register-scripts.mjs +17 -12
  44. package/consumer/scan-classes.mjs +24 -5
  45. package/consumer/sync.mjs +35 -13
  46. package/consumer/update-agent-context.mjs +63 -7
  47. package/consumer-postinstall.mjs +8 -7
  48. package/dist/components/Button/README.md +66 -95
  49. package/dist/components/Button/spec.json +19 -138
  50. package/dist/components.css +102 -366
  51. package/dist/index.d.mts +20 -18
  52. package/dist/index.d.ts +20 -18
  53. package/dist/index.js +301 -1
  54. package/dist/index.mjs +301 -1
  55. package/dist/tokens.css +30 -0
  56. package/dist/tokens.d.mts +7 -3
  57. package/dist/tokens.d.ts +7 -3
  58. package/dist/tokens.js +301 -1
  59. package/dist/tokens.json +360 -0
  60. package/dist/tokens.mjs +301 -1
  61. package/llms.txt +20 -14
  62. package/package.json +3 -1
package/dist/tokens.mjs CHANGED
@@ -408,6 +408,276 @@ var tokenMap = /* @__PURE__ */ Object.freeze({
408
408
  "value": "#FDE047",
409
409
  "cssVariable": "--eds-color-stroke-warning-weak"
410
410
  },
411
+ "radius-1": {
412
+ "name": "radius-1",
413
+ "type": "dimension",
414
+ "value": {
415
+ "value": 2,
416
+ "unit": "px"
417
+ },
418
+ "cssVariable": "--eds-radius-1"
419
+ },
420
+ "radius-10": {
421
+ "name": "radius-10",
422
+ "type": "dimension",
423
+ "value": {
424
+ "value": 999,
425
+ "unit": "px"
426
+ },
427
+ "cssVariable": "--eds-radius-10"
428
+ },
429
+ "radius-2": {
430
+ "name": "radius-2",
431
+ "type": "dimension",
432
+ "value": {
433
+ "value": 4,
434
+ "unit": "px"
435
+ },
436
+ "cssVariable": "--eds-radius-2"
437
+ },
438
+ "radius-3": {
439
+ "name": "radius-3",
440
+ "type": "dimension",
441
+ "value": {
442
+ "value": 6,
443
+ "unit": "px"
444
+ },
445
+ "cssVariable": "--eds-radius-3"
446
+ },
447
+ "radius-4": {
448
+ "name": "radius-4",
449
+ "type": "dimension",
450
+ "value": {
451
+ "value": 8,
452
+ "unit": "px"
453
+ },
454
+ "cssVariable": "--eds-radius-4"
455
+ },
456
+ "radius-5": {
457
+ "name": "radius-5",
458
+ "type": "dimension",
459
+ "value": {
460
+ "value": 10,
461
+ "unit": "px"
462
+ },
463
+ "cssVariable": "--eds-radius-5"
464
+ },
465
+ "radius-6": {
466
+ "name": "radius-6",
467
+ "type": "dimension",
468
+ "value": {
469
+ "value": 12,
470
+ "unit": "px"
471
+ },
472
+ "cssVariable": "--eds-radius-6"
473
+ },
474
+ "radius-7": {
475
+ "name": "radius-7",
476
+ "type": "dimension",
477
+ "value": {
478
+ "value": 14,
479
+ "unit": "px"
480
+ },
481
+ "cssVariable": "--eds-radius-7"
482
+ },
483
+ "radius-8": {
484
+ "name": "radius-8",
485
+ "type": "dimension",
486
+ "value": {
487
+ "value": 16,
488
+ "unit": "px"
489
+ },
490
+ "cssVariable": "--eds-radius-8"
491
+ },
492
+ "radius-9": {
493
+ "name": "radius-9",
494
+ "type": "dimension",
495
+ "value": {
496
+ "value": 20,
497
+ "unit": "px"
498
+ },
499
+ "cssVariable": "--eds-radius-9"
500
+ },
501
+ "radius-none": {
502
+ "name": "radius-none",
503
+ "type": "dimension",
504
+ "value": {
505
+ "value": 0,
506
+ "unit": "px"
507
+ },
508
+ "cssVariable": "--eds-radius-none"
509
+ },
510
+ "spacing-0.5": {
511
+ "name": "spacing-0.5",
512
+ "type": "dimension",
513
+ "value": {
514
+ "value": 2,
515
+ "unit": "px"
516
+ },
517
+ "cssVariable": "--eds-spacing-0\\.5"
518
+ },
519
+ "spacing-1": {
520
+ "name": "spacing-1",
521
+ "type": "dimension",
522
+ "value": {
523
+ "value": 4,
524
+ "unit": "px"
525
+ },
526
+ "cssVariable": "--eds-spacing-1"
527
+ },
528
+ "spacing-1.5": {
529
+ "name": "spacing-1.5",
530
+ "type": "dimension",
531
+ "value": {
532
+ "value": 6,
533
+ "unit": "px"
534
+ },
535
+ "cssVariable": "--eds-spacing-1\\.5"
536
+ },
537
+ "spacing-10": {
538
+ "name": "spacing-10",
539
+ "type": "dimension",
540
+ "value": {
541
+ "value": 40,
542
+ "unit": "px"
543
+ },
544
+ "cssVariable": "--eds-spacing-10"
545
+ },
546
+ "spacing-11": {
547
+ "name": "spacing-11",
548
+ "type": "dimension",
549
+ "value": {
550
+ "value": 44,
551
+ "unit": "px"
552
+ },
553
+ "cssVariable": "--eds-spacing-11"
554
+ },
555
+ "spacing-12": {
556
+ "name": "spacing-12",
557
+ "type": "dimension",
558
+ "value": {
559
+ "value": 48,
560
+ "unit": "px"
561
+ },
562
+ "cssVariable": "--eds-spacing-12"
563
+ },
564
+ "spacing-2": {
565
+ "name": "spacing-2",
566
+ "type": "dimension",
567
+ "value": {
568
+ "value": 8,
569
+ "unit": "px"
570
+ },
571
+ "cssVariable": "--eds-spacing-2"
572
+ },
573
+ "spacing-2.5": {
574
+ "name": "spacing-2.5",
575
+ "type": "dimension",
576
+ "value": {
577
+ "value": 10,
578
+ "unit": "px"
579
+ },
580
+ "cssVariable": "--eds-spacing-2\\.5"
581
+ },
582
+ "spacing-3": {
583
+ "name": "spacing-3",
584
+ "type": "dimension",
585
+ "value": {
586
+ "value": 12,
587
+ "unit": "px"
588
+ },
589
+ "cssVariable": "--eds-spacing-3"
590
+ },
591
+ "spacing-3.5": {
592
+ "name": "spacing-3.5",
593
+ "type": "dimension",
594
+ "value": {
595
+ "value": 14,
596
+ "unit": "px"
597
+ },
598
+ "cssVariable": "--eds-spacing-3\\.5"
599
+ },
600
+ "spacing-4": {
601
+ "name": "spacing-4",
602
+ "type": "dimension",
603
+ "value": {
604
+ "value": 16,
605
+ "unit": "px"
606
+ },
607
+ "cssVariable": "--eds-spacing-4"
608
+ },
609
+ "spacing-4.5": {
610
+ "name": "spacing-4.5",
611
+ "type": "dimension",
612
+ "value": {
613
+ "value": 18,
614
+ "unit": "px"
615
+ },
616
+ "cssVariable": "--eds-spacing-4\\.5"
617
+ },
618
+ "spacing-5": {
619
+ "name": "spacing-5",
620
+ "type": "dimension",
621
+ "value": {
622
+ "value": 20,
623
+ "unit": "px"
624
+ },
625
+ "cssVariable": "--eds-spacing-5"
626
+ },
627
+ "spacing-6": {
628
+ "name": "spacing-6",
629
+ "type": "dimension",
630
+ "value": {
631
+ "value": 24,
632
+ "unit": "px"
633
+ },
634
+ "cssVariable": "--eds-spacing-6"
635
+ },
636
+ "spacing-7": {
637
+ "name": "spacing-7",
638
+ "type": "dimension",
639
+ "value": {
640
+ "value": 28,
641
+ "unit": "px"
642
+ },
643
+ "cssVariable": "--eds-spacing-7"
644
+ },
645
+ "spacing-7.5": {
646
+ "name": "spacing-7.5",
647
+ "type": "dimension",
648
+ "value": {
649
+ "value": 30,
650
+ "unit": "px"
651
+ },
652
+ "cssVariable": "--eds-spacing-7\\.5"
653
+ },
654
+ "spacing-8": {
655
+ "name": "spacing-8",
656
+ "type": "dimension",
657
+ "value": {
658
+ "value": 32,
659
+ "unit": "px"
660
+ },
661
+ "cssVariable": "--eds-spacing-8"
662
+ },
663
+ "spacing-9": {
664
+ "name": "spacing-9",
665
+ "type": "dimension",
666
+ "value": {
667
+ "value": 36,
668
+ "unit": "px"
669
+ },
670
+ "cssVariable": "--eds-spacing-9"
671
+ },
672
+ "spacing-none": {
673
+ "name": "spacing-none",
674
+ "type": "dimension",
675
+ "value": {
676
+ "value": 0,
677
+ "unit": "px"
678
+ },
679
+ "cssVariable": "--eds-spacing-none"
680
+ },
411
681
  "typography-body1-fontFamily": {
412
682
  "name": "typography-body1-fontFamily",
413
683
  "type": "fontFamily",
@@ -1210,6 +1480,36 @@ var tokenNames = /* @__PURE__ */ Object.freeze([
1210
1480
  "color-stroke-positive-weak",
1211
1481
  "color-stroke-warning-primary",
1212
1482
  "color-stroke-warning-weak",
1483
+ "radius-1",
1484
+ "radius-10",
1485
+ "radius-2",
1486
+ "radius-3",
1487
+ "radius-4",
1488
+ "radius-5",
1489
+ "radius-6",
1490
+ "radius-7",
1491
+ "radius-8",
1492
+ "radius-9",
1493
+ "radius-none",
1494
+ "spacing-0.5",
1495
+ "spacing-1",
1496
+ "spacing-1.5",
1497
+ "spacing-10",
1498
+ "spacing-11",
1499
+ "spacing-12",
1500
+ "spacing-2",
1501
+ "spacing-2.5",
1502
+ "spacing-3",
1503
+ "spacing-3.5",
1504
+ "spacing-4",
1505
+ "spacing-4.5",
1506
+ "spacing-5",
1507
+ "spacing-6",
1508
+ "spacing-7",
1509
+ "spacing-7.5",
1510
+ "spacing-8",
1511
+ "spacing-9",
1512
+ "spacing-none",
1213
1513
  "typography-body1-fontFamily",
1214
1514
  "typography-body1-fontSize",
1215
1515
  "typography-body1-fontWeight",
@@ -1300,7 +1600,7 @@ function cssVar(name) {
1300
1600
  if (!tokenNames.includes(name)) {
1301
1601
  throw new Error("Unknown semantic token: " + name);
1302
1602
  }
1303
- return "var(--eds-" + name + ")";
1603
+ return "var(" + tokenMap[name].cssVariable + ")";
1304
1604
  }
1305
1605
 
1306
1606
  export { cssVar, tokenNames, tokens };
package/llms.txt CHANGED
@@ -1,19 +1,25 @@
1
- # EVA Design System AI 문서 인덱스
1
+ # EVA Design System (@spectrabrain/eds)
2
2
 
3
- 이 패키지는 React 웹용 EVA 디자인 시스템입니다. 소비처 AI는 `require.resolve("@spectrabrain/eds/package.json")`로 설치된 package root를 찾은 뒤 다음 순서로 문서를 읽습니다. 아래 경로는 모두 package root 기준 파일 경로입니다. 필수 읽기는 1번 하나이며 나머지는 조건에 해당할 때만 읽습니다. 읽기 순서와 조건의 기계용 원천은 `AI_CONTEXT.json`의 `readOrder`이며, 이 문서와 다르면 `AI_CONTEXT.json`을 따릅니다.
3
+ > React 웹용 EVA 디자인 시스템 패키지입니다. 소비처 AI는 package root(`require.resolve("@spectrabrain/eds/package.json")`의 디렉터리)의 `QUICKSTART.md` 하나를 먼저 읽고, 나머지는 아래 조건에 해당할 때만 읽습니다. 같은 목록의 기계용 원천은 `AI_CONTEXT.json`의 `readOrder`입니다.
4
4
 
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 버전을 올린 뒤 바뀐 내용을 확인할 때 읽습니다.
5
+ EDS 내부 소스로 동작을 추론하지 않고 공개 문서와 TypeScript contract를 기준으로 합니다. 링크는 모두 package root 기준 경로입니다.
14
6
 
15
- 설치 방법과 CSS 진입점은 `README.md`에서 확인합니다. `dist/` 아래 파일은 `@spectrabrain/eds/tokens.json`, `@spectrabrain/eds/components/Button/spec.json`처럼 `dist/`를 뗀 export 경로로도 읽을 수 있습니다.
7
+ ## 필수
16
8
 
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를 생략하지 않습니다.
9
+ - [QUICKSTART.md](./QUICKSTART.md): UI 작업 규칙, 완료 기준과 doctor 실패 시 복구 순서, 명령(`npm run sync:eds`, `npm run eds:doctor`), 조건부 문서 목록입니다.
18
10
 
19
- 문서에 없는 API나 시각 상태를 추측하지 않습니다. 구현보다 공개 문서와 TypeScript contract를 우선합니다.
11
+ ## 조건부
12
+
13
+ - [CONSUMER_AGENT.md](./CONSUMER_AGENT.md): 소비처 `AGENTS.md`에 `<!-- EDS:BEGIN -->` block이 없거나, sync·doctor가 exit 2이거나 sync 뒤에도 doctor가 exit 1이거나, EDS 버전을 올렸거나, 사용자가 프로토타입을 EVA 구조로 정리하라고 요청했을 때(`eds align`) 읽습니다.
14
+ - [TOKEN_CONTEXT.md](./TOKEN_CONTEXT.md): EDS 컴포넌트 prop 밖에서 color·typography·spacing·radius token을 지정하거나 바꿀 때 읽습니다. Tailwind 없이 CSS variable이나 `cssVar()`로 쓰는 경우도 포함합니다.
15
+ - [TAILWIND_V4.md](./TAILWIND_V4.md): Tailwind CSS v4 adapter나 root CSS 배선을 설정하거나 고칠 때 읽습니다.
16
+ - [AI.md](./AI.md): 요청이 dark theme, 생성된 class 밖의 Tailwind utility, `AI_CONTEXT.json` `components`에 없는 컴포넌트를 요구할 때 읽습니다.
17
+ - [FRONTEND_CONVENTIONS.md](./FRONTEND_CONVENTIONS.md): `.eds/align/PLAN.md`가 있거나(`eds align` 진행 중), 소비처 `AGENTS.md`가 구조·라이브러리·코드 패턴 변경에 이 문서를 가리킬 때 읽습니다.
18
+ - [dist/components/Button/README.md](./dist/components/Button/README.md): Button을 쓸 때 사용 맥락, role·variant 선택, prop, 접근성, 목록 밖 아이콘 규칙을 읽습니다.
19
+ - [dist/components/Button/spec.json](./dist/components/Button/spec.json): `api.iconNames`의 아이콘 이름을 확인하거나 도구가 기계용 계약을 읽을 때 씁니다.
20
+ - [dist/tokens.json](./dist/tokens.json): 도구·스크립트가 기계용 token manifest와 public 이름→CSS variable mapping을 읽거나, Tailwind 없이 쓸 `var(--eds-*)` 이름을 확인할 때 씁니다. class 이름은 `src/styles/eds-tokens.css`에 있습니다.
21
+ - [CHANGELOG.md](./CHANGELOG.md): EDS 버전을 올렸을 때(설치된 버전이 `AGENTS.md`의 `EDS:VERSION` 줄보다 높을 때) 읽습니다.
22
+
23
+ ## Optional
24
+
25
+ - [README.md](./README.md): 사람을 위한 설치 안내와 공개 경로 표입니다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrabrain/eds",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "EVA services' shared React design system",
5
5
  "author": "SpectraBrain",
6
6
  "license": "UNLICENSED",
@@ -25,6 +25,7 @@
25
25
  "llms.txt",
26
26
  "TAILWIND_V4.md",
27
27
  "QUICKSTART.md",
28
+ "FRONTEND_CONVENTIONS.md",
28
29
  "CHANGELOG.md",
29
30
  "consumer-postinstall.mjs",
30
31
  "consumer",
@@ -140,6 +141,7 @@
140
141
  "./llms.txt": "./llms.txt",
141
142
  "./TAILWIND_V4.md": "./TAILWIND_V4.md",
142
143
  "./QUICKSTART.md": "./QUICKSTART.md",
144
+ "./FRONTEND_CONVENTIONS.md": "./FRONTEND_CONVENTIONS.md",
143
145
  "./package.json": "./package.json"
144
146
  }
145
147
  }