@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/index.mjs CHANGED
@@ -412,6 +412,276 @@ var tokenMap = /* @__PURE__ */ Object.freeze({
412
412
  "value": "#FDE047",
413
413
  "cssVariable": "--eds-color-stroke-warning-weak"
414
414
  },
415
+ "radius-1": {
416
+ "name": "radius-1",
417
+ "type": "dimension",
418
+ "value": {
419
+ "value": 2,
420
+ "unit": "px"
421
+ },
422
+ "cssVariable": "--eds-radius-1"
423
+ },
424
+ "radius-10": {
425
+ "name": "radius-10",
426
+ "type": "dimension",
427
+ "value": {
428
+ "value": 999,
429
+ "unit": "px"
430
+ },
431
+ "cssVariable": "--eds-radius-10"
432
+ },
433
+ "radius-2": {
434
+ "name": "radius-2",
435
+ "type": "dimension",
436
+ "value": {
437
+ "value": 4,
438
+ "unit": "px"
439
+ },
440
+ "cssVariable": "--eds-radius-2"
441
+ },
442
+ "radius-3": {
443
+ "name": "radius-3",
444
+ "type": "dimension",
445
+ "value": {
446
+ "value": 6,
447
+ "unit": "px"
448
+ },
449
+ "cssVariable": "--eds-radius-3"
450
+ },
451
+ "radius-4": {
452
+ "name": "radius-4",
453
+ "type": "dimension",
454
+ "value": {
455
+ "value": 8,
456
+ "unit": "px"
457
+ },
458
+ "cssVariable": "--eds-radius-4"
459
+ },
460
+ "radius-5": {
461
+ "name": "radius-5",
462
+ "type": "dimension",
463
+ "value": {
464
+ "value": 10,
465
+ "unit": "px"
466
+ },
467
+ "cssVariable": "--eds-radius-5"
468
+ },
469
+ "radius-6": {
470
+ "name": "radius-6",
471
+ "type": "dimension",
472
+ "value": {
473
+ "value": 12,
474
+ "unit": "px"
475
+ },
476
+ "cssVariable": "--eds-radius-6"
477
+ },
478
+ "radius-7": {
479
+ "name": "radius-7",
480
+ "type": "dimension",
481
+ "value": {
482
+ "value": 14,
483
+ "unit": "px"
484
+ },
485
+ "cssVariable": "--eds-radius-7"
486
+ },
487
+ "radius-8": {
488
+ "name": "radius-8",
489
+ "type": "dimension",
490
+ "value": {
491
+ "value": 16,
492
+ "unit": "px"
493
+ },
494
+ "cssVariable": "--eds-radius-8"
495
+ },
496
+ "radius-9": {
497
+ "name": "radius-9",
498
+ "type": "dimension",
499
+ "value": {
500
+ "value": 20,
501
+ "unit": "px"
502
+ },
503
+ "cssVariable": "--eds-radius-9"
504
+ },
505
+ "radius-none": {
506
+ "name": "radius-none",
507
+ "type": "dimension",
508
+ "value": {
509
+ "value": 0,
510
+ "unit": "px"
511
+ },
512
+ "cssVariable": "--eds-radius-none"
513
+ },
514
+ "spacing-0.5": {
515
+ "name": "spacing-0.5",
516
+ "type": "dimension",
517
+ "value": {
518
+ "value": 2,
519
+ "unit": "px"
520
+ },
521
+ "cssVariable": "--eds-spacing-0\\.5"
522
+ },
523
+ "spacing-1": {
524
+ "name": "spacing-1",
525
+ "type": "dimension",
526
+ "value": {
527
+ "value": 4,
528
+ "unit": "px"
529
+ },
530
+ "cssVariable": "--eds-spacing-1"
531
+ },
532
+ "spacing-1.5": {
533
+ "name": "spacing-1.5",
534
+ "type": "dimension",
535
+ "value": {
536
+ "value": 6,
537
+ "unit": "px"
538
+ },
539
+ "cssVariable": "--eds-spacing-1\\.5"
540
+ },
541
+ "spacing-10": {
542
+ "name": "spacing-10",
543
+ "type": "dimension",
544
+ "value": {
545
+ "value": 40,
546
+ "unit": "px"
547
+ },
548
+ "cssVariable": "--eds-spacing-10"
549
+ },
550
+ "spacing-11": {
551
+ "name": "spacing-11",
552
+ "type": "dimension",
553
+ "value": {
554
+ "value": 44,
555
+ "unit": "px"
556
+ },
557
+ "cssVariable": "--eds-spacing-11"
558
+ },
559
+ "spacing-12": {
560
+ "name": "spacing-12",
561
+ "type": "dimension",
562
+ "value": {
563
+ "value": 48,
564
+ "unit": "px"
565
+ },
566
+ "cssVariable": "--eds-spacing-12"
567
+ },
568
+ "spacing-2": {
569
+ "name": "spacing-2",
570
+ "type": "dimension",
571
+ "value": {
572
+ "value": 8,
573
+ "unit": "px"
574
+ },
575
+ "cssVariable": "--eds-spacing-2"
576
+ },
577
+ "spacing-2.5": {
578
+ "name": "spacing-2.5",
579
+ "type": "dimension",
580
+ "value": {
581
+ "value": 10,
582
+ "unit": "px"
583
+ },
584
+ "cssVariable": "--eds-spacing-2\\.5"
585
+ },
586
+ "spacing-3": {
587
+ "name": "spacing-3",
588
+ "type": "dimension",
589
+ "value": {
590
+ "value": 12,
591
+ "unit": "px"
592
+ },
593
+ "cssVariable": "--eds-spacing-3"
594
+ },
595
+ "spacing-3.5": {
596
+ "name": "spacing-3.5",
597
+ "type": "dimension",
598
+ "value": {
599
+ "value": 14,
600
+ "unit": "px"
601
+ },
602
+ "cssVariable": "--eds-spacing-3\\.5"
603
+ },
604
+ "spacing-4": {
605
+ "name": "spacing-4",
606
+ "type": "dimension",
607
+ "value": {
608
+ "value": 16,
609
+ "unit": "px"
610
+ },
611
+ "cssVariable": "--eds-spacing-4"
612
+ },
613
+ "spacing-4.5": {
614
+ "name": "spacing-4.5",
615
+ "type": "dimension",
616
+ "value": {
617
+ "value": 18,
618
+ "unit": "px"
619
+ },
620
+ "cssVariable": "--eds-spacing-4\\.5"
621
+ },
622
+ "spacing-5": {
623
+ "name": "spacing-5",
624
+ "type": "dimension",
625
+ "value": {
626
+ "value": 20,
627
+ "unit": "px"
628
+ },
629
+ "cssVariable": "--eds-spacing-5"
630
+ },
631
+ "spacing-6": {
632
+ "name": "spacing-6",
633
+ "type": "dimension",
634
+ "value": {
635
+ "value": 24,
636
+ "unit": "px"
637
+ },
638
+ "cssVariable": "--eds-spacing-6"
639
+ },
640
+ "spacing-7": {
641
+ "name": "spacing-7",
642
+ "type": "dimension",
643
+ "value": {
644
+ "value": 28,
645
+ "unit": "px"
646
+ },
647
+ "cssVariable": "--eds-spacing-7"
648
+ },
649
+ "spacing-7.5": {
650
+ "name": "spacing-7.5",
651
+ "type": "dimension",
652
+ "value": {
653
+ "value": 30,
654
+ "unit": "px"
655
+ },
656
+ "cssVariable": "--eds-spacing-7\\.5"
657
+ },
658
+ "spacing-8": {
659
+ "name": "spacing-8",
660
+ "type": "dimension",
661
+ "value": {
662
+ "value": 32,
663
+ "unit": "px"
664
+ },
665
+ "cssVariable": "--eds-spacing-8"
666
+ },
667
+ "spacing-9": {
668
+ "name": "spacing-9",
669
+ "type": "dimension",
670
+ "value": {
671
+ "value": 36,
672
+ "unit": "px"
673
+ },
674
+ "cssVariable": "--eds-spacing-9"
675
+ },
676
+ "spacing-none": {
677
+ "name": "spacing-none",
678
+ "type": "dimension",
679
+ "value": {
680
+ "value": 0,
681
+ "unit": "px"
682
+ },
683
+ "cssVariable": "--eds-spacing-none"
684
+ },
415
685
  "typography-body1-fontFamily": {
416
686
  "name": "typography-body1-fontFamily",
417
687
  "type": "fontFamily",
@@ -1214,6 +1484,36 @@ var tokenNames = /* @__PURE__ */ Object.freeze([
1214
1484
  "color-stroke-positive-weak",
1215
1485
  "color-stroke-warning-primary",
1216
1486
  "color-stroke-warning-weak",
1487
+ "radius-1",
1488
+ "radius-10",
1489
+ "radius-2",
1490
+ "radius-3",
1491
+ "radius-4",
1492
+ "radius-5",
1493
+ "radius-6",
1494
+ "radius-7",
1495
+ "radius-8",
1496
+ "radius-9",
1497
+ "radius-none",
1498
+ "spacing-0.5",
1499
+ "spacing-1",
1500
+ "spacing-1.5",
1501
+ "spacing-10",
1502
+ "spacing-11",
1503
+ "spacing-12",
1504
+ "spacing-2",
1505
+ "spacing-2.5",
1506
+ "spacing-3",
1507
+ "spacing-3.5",
1508
+ "spacing-4",
1509
+ "spacing-4.5",
1510
+ "spacing-5",
1511
+ "spacing-6",
1512
+ "spacing-7",
1513
+ "spacing-7.5",
1514
+ "spacing-8",
1515
+ "spacing-9",
1516
+ "spacing-none",
1217
1517
  "typography-body1-fontFamily",
1218
1518
  "typography-body1-fontSize",
1219
1519
  "typography-body1-fontWeight",
@@ -1304,7 +1604,7 @@ function cssVar(name) {
1304
1604
  if (!tokenNames.includes(name)) {
1305
1605
  throw new Error("Unknown semantic token: " + name);
1306
1606
  }
1307
- return "var(--eds-" + name + ")";
1607
+ return "var(" + tokenMap[name].cssVariable + ")";
1308
1608
  }
1309
1609
  var buttonIcons = {
1310
1610
  ArrowLeft,
package/dist/tokens.css CHANGED
@@ -68,6 +68,36 @@
68
68
  --eds-color-stroke-positive-weak: #BBF7D0;
69
69
  --eds-color-stroke-warning-primary: #EAB308;
70
70
  --eds-color-stroke-warning-weak: #FDE047;
71
+ --eds-radius-1: 2px;
72
+ --eds-radius-10: 999px;
73
+ --eds-radius-2: 4px;
74
+ --eds-radius-3: 6px;
75
+ --eds-radius-4: 8px;
76
+ --eds-radius-5: 10px;
77
+ --eds-radius-6: 12px;
78
+ --eds-radius-7: 14px;
79
+ --eds-radius-8: 16px;
80
+ --eds-radius-9: 20px;
81
+ --eds-radius-none: 0px;
82
+ --eds-spacing-0\.5: 2px;
83
+ --eds-spacing-1: 4px;
84
+ --eds-spacing-1\.5: 6px;
85
+ --eds-spacing-10: 40px;
86
+ --eds-spacing-11: 44px;
87
+ --eds-spacing-12: 48px;
88
+ --eds-spacing-2: 8px;
89
+ --eds-spacing-2\.5: 10px;
90
+ --eds-spacing-3: 12px;
91
+ --eds-spacing-3\.5: 14px;
92
+ --eds-spacing-4: 16px;
93
+ --eds-spacing-4\.5: 18px;
94
+ --eds-spacing-5: 20px;
95
+ --eds-spacing-6: 24px;
96
+ --eds-spacing-7: 28px;
97
+ --eds-spacing-7\.5: 30px;
98
+ --eds-spacing-8: 32px;
99
+ --eds-spacing-9: 36px;
100
+ --eds-spacing-none: 0px;
71
101
  --eds-typography-body1-fontFamily: Pretendard, system-ui, sans-serif;
72
102
  --eds-typography-body1-fontSize: 1.125rem;
73
103
  --eds-typography-body1-fontWeight: 500;
package/dist/tokens.d.mts CHANGED
@@ -1,16 +1,20 @@
1
- type SemanticTokenName = "color-bg-brand-primary" | "color-bg-brand-primary-hover" | "color-bg-brand-weak" | "color-bg-brand-weak-hover" | "color-bg-critical-primary" | "color-bg-critical-primary-hover" | "color-bg-critical-weak" | "color-bg-critical-weak-hover" | "color-bg-disabled" | "color-bg-informative-primary" | "color-bg-informative-primary-hover" | "color-bg-informative-weak" | "color-bg-informative-weak-hover" | "color-bg-layer-basement" | "color-bg-layer-basement-hover" | "color-bg-layer-default" | "color-bg-layer-default-hover" | "color-bg-layer-floating" | "color-bg-layer-floating-hover" | "color-bg-neutral-inverted" | "color-bg-neutral-inverted-hover" | "color-bg-neutral-primary" | "color-bg-neutral-primary-hover" | "color-bg-neutral-weak" | "color-bg-neutral-weak-hover" | "color-bg-positive-primary" | "color-bg-positive-primary-hover" | "color-bg-positive-weak" | "color-bg-positive-weak-hover" | "color-bg-transparent" | "color-bg-transparent-hover" | "color-bg-warning-primary" | "color-bg-warning-primary-hover" | "color-bg-warning-weak" | "color-bg-warning-weak-hover" | "color-fg-brand" | "color-fg-brand-contrast" | "color-fg-critical" | "color-fg-critical-contrast" | "color-fg-disabled" | "color-fg-focus" | "color-fg-informative" | "color-fg-informative-contrast" | "color-fg-neutral" | "color-fg-neutral-inverted" | "color-fg-neutral-secondary" | "color-fg-neutral-tertiary" | "color-fg-placeholder" | "color-fg-positive" | "color-fg-positive-contrast" | "color-fg-warning" | "color-fg-warning-contrast" | "color-stroke-brand-primary" | "color-stroke-brand-weak" | "color-stroke-critical-primary" | "color-stroke-critical-weak" | "color-stroke-focusRing" | "color-stroke-informative-primary" | "color-stroke-informative-weak" | "color-stroke-neutral-contrast" | "color-stroke-neutral-primary" | "color-stroke-neutral-secondary" | "color-stroke-neutral-tertiary" | "color-stroke-neutral-weak" | "color-stroke-positive-primary" | "color-stroke-positive-weak" | "color-stroke-warning-primary" | "color-stroke-warning-weak" | "typography-body1-fontFamily" | "typography-body1-fontSize" | "typography-body1-fontWeight" | "typography-body1-letterSpacing" | "typography-body1-lineHeight" | "typography-body2-fontFamily" | "typography-body2-fontSize" | "typography-body2-fontWeight" | "typography-body2-letterSpacing" | "typography-body2-lineHeight" | "typography-body3-fontFamily" | "typography-body3-fontSize" | "typography-body3-fontWeight" | "typography-body3-letterSpacing" | "typography-body3-lineHeight" | "typography-body4-fontFamily" | "typography-body4-fontSize" | "typography-body4-fontWeight" | "typography-body4-letterSpacing" | "typography-body4-lineHeight" | "typography-caption1-fontFamily" | "typography-caption1-fontSize" | "typography-caption1-fontWeight" | "typography-caption1-letterSpacing" | "typography-caption1-lineHeight" | "typography-caption2-fontFamily" | "typography-caption2-fontSize" | "typography-caption2-fontWeight" | "typography-caption2-letterSpacing" | "typography-caption2-lineHeight" | "typography-caption3-fontFamily" | "typography-caption3-fontSize" | "typography-caption3-fontWeight" | "typography-caption3-letterSpacing" | "typography-caption3-lineHeight" | "typography-display1-fontFamily" | "typography-display1-fontSize" | "typography-display1-fontWeight" | "typography-display1-letterSpacing" | "typography-display1-lineHeight" | "typography-display2-fontFamily" | "typography-display2-fontSize" | "typography-display2-fontWeight" | "typography-display2-letterSpacing" | "typography-display2-lineHeight" | "typography-heading1-fontFamily" | "typography-heading1-fontSize" | "typography-heading1-fontWeight" | "typography-heading1-letterSpacing" | "typography-heading1-lineHeight" | "typography-heading2-fontFamily" | "typography-heading2-fontSize" | "typography-heading2-fontWeight" | "typography-heading2-letterSpacing" | "typography-heading2-lineHeight" | "typography-heading3-fontFamily" | "typography-heading3-fontSize" | "typography-heading3-fontWeight" | "typography-heading3-letterSpacing" | "typography-heading3-lineHeight" | "typography-heading4-fontFamily" | "typography-heading4-fontSize" | "typography-heading4-fontWeight" | "typography-heading4-letterSpacing" | "typography-heading4-lineHeight" | "typography-title1-fontFamily" | "typography-title1-fontSize" | "typography-title1-fontWeight" | "typography-title1-letterSpacing" | "typography-title1-lineHeight" | "typography-title2-fontFamily" | "typography-title2-fontSize" | "typography-title2-fontWeight" | "typography-title2-letterSpacing" | "typography-title2-lineHeight" | "typography-title3-fontFamily" | "typography-title3-fontSize" | "typography-title3-fontWeight" | "typography-title3-letterSpacing" | "typography-title3-lineHeight" | "typography-title4-fontFamily" | "typography-title4-fontSize" | "typography-title4-fontWeight" | "typography-title4-letterSpacing" | "typography-title4-lineHeight";
1
+ type SemanticTokenName = "color-bg-brand-primary" | "color-bg-brand-primary-hover" | "color-bg-brand-weak" | "color-bg-brand-weak-hover" | "color-bg-critical-primary" | "color-bg-critical-primary-hover" | "color-bg-critical-weak" | "color-bg-critical-weak-hover" | "color-bg-disabled" | "color-bg-informative-primary" | "color-bg-informative-primary-hover" | "color-bg-informative-weak" | "color-bg-informative-weak-hover" | "color-bg-layer-basement" | "color-bg-layer-basement-hover" | "color-bg-layer-default" | "color-bg-layer-default-hover" | "color-bg-layer-floating" | "color-bg-layer-floating-hover" | "color-bg-neutral-inverted" | "color-bg-neutral-inverted-hover" | "color-bg-neutral-primary" | "color-bg-neutral-primary-hover" | "color-bg-neutral-weak" | "color-bg-neutral-weak-hover" | "color-bg-positive-primary" | "color-bg-positive-primary-hover" | "color-bg-positive-weak" | "color-bg-positive-weak-hover" | "color-bg-transparent" | "color-bg-transparent-hover" | "color-bg-warning-primary" | "color-bg-warning-primary-hover" | "color-bg-warning-weak" | "color-bg-warning-weak-hover" | "color-fg-brand" | "color-fg-brand-contrast" | "color-fg-critical" | "color-fg-critical-contrast" | "color-fg-disabled" | "color-fg-focus" | "color-fg-informative" | "color-fg-informative-contrast" | "color-fg-neutral" | "color-fg-neutral-inverted" | "color-fg-neutral-secondary" | "color-fg-neutral-tertiary" | "color-fg-placeholder" | "color-fg-positive" | "color-fg-positive-contrast" | "color-fg-warning" | "color-fg-warning-contrast" | "color-stroke-brand-primary" | "color-stroke-brand-weak" | "color-stroke-critical-primary" | "color-stroke-critical-weak" | "color-stroke-focusRing" | "color-stroke-informative-primary" | "color-stroke-informative-weak" | "color-stroke-neutral-contrast" | "color-stroke-neutral-primary" | "color-stroke-neutral-secondary" | "color-stroke-neutral-tertiary" | "color-stroke-neutral-weak" | "color-stroke-positive-primary" | "color-stroke-positive-weak" | "color-stroke-warning-primary" | "color-stroke-warning-weak" | "radius-1" | "radius-10" | "radius-2" | "radius-3" | "radius-4" | "radius-5" | "radius-6" | "radius-7" | "radius-8" | "radius-9" | "radius-none" | "spacing-0.5" | "spacing-1" | "spacing-1.5" | "spacing-10" | "spacing-11" | "spacing-12" | "spacing-2" | "spacing-2.5" | "spacing-3" | "spacing-3.5" | "spacing-4" | "spacing-4.5" | "spacing-5" | "spacing-6" | "spacing-7" | "spacing-7.5" | "spacing-8" | "spacing-9" | "spacing-none" | "typography-body1-fontFamily" | "typography-body1-fontSize" | "typography-body1-fontWeight" | "typography-body1-letterSpacing" | "typography-body1-lineHeight" | "typography-body2-fontFamily" | "typography-body2-fontSize" | "typography-body2-fontWeight" | "typography-body2-letterSpacing" | "typography-body2-lineHeight" | "typography-body3-fontFamily" | "typography-body3-fontSize" | "typography-body3-fontWeight" | "typography-body3-letterSpacing" | "typography-body3-lineHeight" | "typography-body4-fontFamily" | "typography-body4-fontSize" | "typography-body4-fontWeight" | "typography-body4-letterSpacing" | "typography-body4-lineHeight" | "typography-caption1-fontFamily" | "typography-caption1-fontSize" | "typography-caption1-fontWeight" | "typography-caption1-letterSpacing" | "typography-caption1-lineHeight" | "typography-caption2-fontFamily" | "typography-caption2-fontSize" | "typography-caption2-fontWeight" | "typography-caption2-letterSpacing" | "typography-caption2-lineHeight" | "typography-caption3-fontFamily" | "typography-caption3-fontSize" | "typography-caption3-fontWeight" | "typography-caption3-letterSpacing" | "typography-caption3-lineHeight" | "typography-display1-fontFamily" | "typography-display1-fontSize" | "typography-display1-fontWeight" | "typography-display1-letterSpacing" | "typography-display1-lineHeight" | "typography-display2-fontFamily" | "typography-display2-fontSize" | "typography-display2-fontWeight" | "typography-display2-letterSpacing" | "typography-display2-lineHeight" | "typography-heading1-fontFamily" | "typography-heading1-fontSize" | "typography-heading1-fontWeight" | "typography-heading1-letterSpacing" | "typography-heading1-lineHeight" | "typography-heading2-fontFamily" | "typography-heading2-fontSize" | "typography-heading2-fontWeight" | "typography-heading2-letterSpacing" | "typography-heading2-lineHeight" | "typography-heading3-fontFamily" | "typography-heading3-fontSize" | "typography-heading3-fontWeight" | "typography-heading3-letterSpacing" | "typography-heading3-lineHeight" | "typography-heading4-fontFamily" | "typography-heading4-fontSize" | "typography-heading4-fontWeight" | "typography-heading4-letterSpacing" | "typography-heading4-lineHeight" | "typography-title1-fontFamily" | "typography-title1-fontSize" | "typography-title1-fontWeight" | "typography-title1-letterSpacing" | "typography-title1-lineHeight" | "typography-title2-fontFamily" | "typography-title2-fontSize" | "typography-title2-fontWeight" | "typography-title2-letterSpacing" | "typography-title2-lineHeight" | "typography-title3-fontFamily" | "typography-title3-fontSize" | "typography-title3-fontWeight" | "typography-title3-letterSpacing" | "typography-title3-lineHeight" | "typography-title4-fontFamily" | "typography-title4-fontSize" | "typography-title4-fontWeight" | "typography-title4-letterSpacing" | "typography-title4-lineHeight";
2
2
  type SemanticTokenType = "color" | "dimension" | "fontFamily" | "fontWeight";
3
- type SemanticTokenCssVariable = `--eds-${SemanticTokenName}`;
3
+ type EscapeCssDots<Name extends string> = Name extends `${infer Head}.${infer Tail}` ? `${Head}\\.${EscapeCssDots<Tail>}` : Name;
4
+ type SemanticTokenCssVariable = `--eds-${EscapeCssDots<SemanticTokenName>}`;
4
5
  type SemanticTokenCssReference = `var(${SemanticTokenCssVariable})`;
5
6
  interface SemanticToken {
6
7
  readonly name: SemanticTokenName;
7
8
  readonly type: SemanticTokenType;
9
+ /** 빌드 시 해석된 참고용 값입니다. 스타일에는 cssVariable 또는 cssVar()를 씁니다. */
8
10
  readonly value: unknown;
9
11
  readonly cssVariable: string;
10
12
  }
11
13
  type SemanticTokenMap = Readonly<Record<SemanticTokenName, SemanticToken>>;
14
+ /** 공개 token manifest입니다. 이름 목록은 tokenNames, CSS 참조는 cssVar()입니다. */
12
15
  declare const tokens: SemanticTokenMap;
13
16
  declare const tokenNames: readonly SemanticTokenName[];
17
+ /** 공개 token 이름을 var(--eds-…) 참조로 바꿉니다. 이름은 SemanticTokenName 리터럴로 전달하며, tokenNames에 없는 문자열은 런타임 오류입니다. */
14
18
  declare function cssVar(name: SemanticTokenName): SemanticTokenCssReference;
15
19
 
16
- export { type SemanticToken, type SemanticTokenCssReference, type SemanticTokenCssVariable, type SemanticTokenMap, type SemanticTokenName, type SemanticTokenType, cssVar, tokenNames, tokens };
20
+ export { type EscapeCssDots, type SemanticToken, type SemanticTokenCssReference, type SemanticTokenCssVariable, type SemanticTokenMap, type SemanticTokenName, type SemanticTokenType, cssVar, tokenNames, tokens };
package/dist/tokens.d.ts CHANGED
@@ -1,16 +1,20 @@
1
- type SemanticTokenName = "color-bg-brand-primary" | "color-bg-brand-primary-hover" | "color-bg-brand-weak" | "color-bg-brand-weak-hover" | "color-bg-critical-primary" | "color-bg-critical-primary-hover" | "color-bg-critical-weak" | "color-bg-critical-weak-hover" | "color-bg-disabled" | "color-bg-informative-primary" | "color-bg-informative-primary-hover" | "color-bg-informative-weak" | "color-bg-informative-weak-hover" | "color-bg-layer-basement" | "color-bg-layer-basement-hover" | "color-bg-layer-default" | "color-bg-layer-default-hover" | "color-bg-layer-floating" | "color-bg-layer-floating-hover" | "color-bg-neutral-inverted" | "color-bg-neutral-inverted-hover" | "color-bg-neutral-primary" | "color-bg-neutral-primary-hover" | "color-bg-neutral-weak" | "color-bg-neutral-weak-hover" | "color-bg-positive-primary" | "color-bg-positive-primary-hover" | "color-bg-positive-weak" | "color-bg-positive-weak-hover" | "color-bg-transparent" | "color-bg-transparent-hover" | "color-bg-warning-primary" | "color-bg-warning-primary-hover" | "color-bg-warning-weak" | "color-bg-warning-weak-hover" | "color-fg-brand" | "color-fg-brand-contrast" | "color-fg-critical" | "color-fg-critical-contrast" | "color-fg-disabled" | "color-fg-focus" | "color-fg-informative" | "color-fg-informative-contrast" | "color-fg-neutral" | "color-fg-neutral-inverted" | "color-fg-neutral-secondary" | "color-fg-neutral-tertiary" | "color-fg-placeholder" | "color-fg-positive" | "color-fg-positive-contrast" | "color-fg-warning" | "color-fg-warning-contrast" | "color-stroke-brand-primary" | "color-stroke-brand-weak" | "color-stroke-critical-primary" | "color-stroke-critical-weak" | "color-stroke-focusRing" | "color-stroke-informative-primary" | "color-stroke-informative-weak" | "color-stroke-neutral-contrast" | "color-stroke-neutral-primary" | "color-stroke-neutral-secondary" | "color-stroke-neutral-tertiary" | "color-stroke-neutral-weak" | "color-stroke-positive-primary" | "color-stroke-positive-weak" | "color-stroke-warning-primary" | "color-stroke-warning-weak" | "typography-body1-fontFamily" | "typography-body1-fontSize" | "typography-body1-fontWeight" | "typography-body1-letterSpacing" | "typography-body1-lineHeight" | "typography-body2-fontFamily" | "typography-body2-fontSize" | "typography-body2-fontWeight" | "typography-body2-letterSpacing" | "typography-body2-lineHeight" | "typography-body3-fontFamily" | "typography-body3-fontSize" | "typography-body3-fontWeight" | "typography-body3-letterSpacing" | "typography-body3-lineHeight" | "typography-body4-fontFamily" | "typography-body4-fontSize" | "typography-body4-fontWeight" | "typography-body4-letterSpacing" | "typography-body4-lineHeight" | "typography-caption1-fontFamily" | "typography-caption1-fontSize" | "typography-caption1-fontWeight" | "typography-caption1-letterSpacing" | "typography-caption1-lineHeight" | "typography-caption2-fontFamily" | "typography-caption2-fontSize" | "typography-caption2-fontWeight" | "typography-caption2-letterSpacing" | "typography-caption2-lineHeight" | "typography-caption3-fontFamily" | "typography-caption3-fontSize" | "typography-caption3-fontWeight" | "typography-caption3-letterSpacing" | "typography-caption3-lineHeight" | "typography-display1-fontFamily" | "typography-display1-fontSize" | "typography-display1-fontWeight" | "typography-display1-letterSpacing" | "typography-display1-lineHeight" | "typography-display2-fontFamily" | "typography-display2-fontSize" | "typography-display2-fontWeight" | "typography-display2-letterSpacing" | "typography-display2-lineHeight" | "typography-heading1-fontFamily" | "typography-heading1-fontSize" | "typography-heading1-fontWeight" | "typography-heading1-letterSpacing" | "typography-heading1-lineHeight" | "typography-heading2-fontFamily" | "typography-heading2-fontSize" | "typography-heading2-fontWeight" | "typography-heading2-letterSpacing" | "typography-heading2-lineHeight" | "typography-heading3-fontFamily" | "typography-heading3-fontSize" | "typography-heading3-fontWeight" | "typography-heading3-letterSpacing" | "typography-heading3-lineHeight" | "typography-heading4-fontFamily" | "typography-heading4-fontSize" | "typography-heading4-fontWeight" | "typography-heading4-letterSpacing" | "typography-heading4-lineHeight" | "typography-title1-fontFamily" | "typography-title1-fontSize" | "typography-title1-fontWeight" | "typography-title1-letterSpacing" | "typography-title1-lineHeight" | "typography-title2-fontFamily" | "typography-title2-fontSize" | "typography-title2-fontWeight" | "typography-title2-letterSpacing" | "typography-title2-lineHeight" | "typography-title3-fontFamily" | "typography-title3-fontSize" | "typography-title3-fontWeight" | "typography-title3-letterSpacing" | "typography-title3-lineHeight" | "typography-title4-fontFamily" | "typography-title4-fontSize" | "typography-title4-fontWeight" | "typography-title4-letterSpacing" | "typography-title4-lineHeight";
1
+ type SemanticTokenName = "color-bg-brand-primary" | "color-bg-brand-primary-hover" | "color-bg-brand-weak" | "color-bg-brand-weak-hover" | "color-bg-critical-primary" | "color-bg-critical-primary-hover" | "color-bg-critical-weak" | "color-bg-critical-weak-hover" | "color-bg-disabled" | "color-bg-informative-primary" | "color-bg-informative-primary-hover" | "color-bg-informative-weak" | "color-bg-informative-weak-hover" | "color-bg-layer-basement" | "color-bg-layer-basement-hover" | "color-bg-layer-default" | "color-bg-layer-default-hover" | "color-bg-layer-floating" | "color-bg-layer-floating-hover" | "color-bg-neutral-inverted" | "color-bg-neutral-inverted-hover" | "color-bg-neutral-primary" | "color-bg-neutral-primary-hover" | "color-bg-neutral-weak" | "color-bg-neutral-weak-hover" | "color-bg-positive-primary" | "color-bg-positive-primary-hover" | "color-bg-positive-weak" | "color-bg-positive-weak-hover" | "color-bg-transparent" | "color-bg-transparent-hover" | "color-bg-warning-primary" | "color-bg-warning-primary-hover" | "color-bg-warning-weak" | "color-bg-warning-weak-hover" | "color-fg-brand" | "color-fg-brand-contrast" | "color-fg-critical" | "color-fg-critical-contrast" | "color-fg-disabled" | "color-fg-focus" | "color-fg-informative" | "color-fg-informative-contrast" | "color-fg-neutral" | "color-fg-neutral-inverted" | "color-fg-neutral-secondary" | "color-fg-neutral-tertiary" | "color-fg-placeholder" | "color-fg-positive" | "color-fg-positive-contrast" | "color-fg-warning" | "color-fg-warning-contrast" | "color-stroke-brand-primary" | "color-stroke-brand-weak" | "color-stroke-critical-primary" | "color-stroke-critical-weak" | "color-stroke-focusRing" | "color-stroke-informative-primary" | "color-stroke-informative-weak" | "color-stroke-neutral-contrast" | "color-stroke-neutral-primary" | "color-stroke-neutral-secondary" | "color-stroke-neutral-tertiary" | "color-stroke-neutral-weak" | "color-stroke-positive-primary" | "color-stroke-positive-weak" | "color-stroke-warning-primary" | "color-stroke-warning-weak" | "radius-1" | "radius-10" | "radius-2" | "radius-3" | "radius-4" | "radius-5" | "radius-6" | "radius-7" | "radius-8" | "radius-9" | "radius-none" | "spacing-0.5" | "spacing-1" | "spacing-1.5" | "spacing-10" | "spacing-11" | "spacing-12" | "spacing-2" | "spacing-2.5" | "spacing-3" | "spacing-3.5" | "spacing-4" | "spacing-4.5" | "spacing-5" | "spacing-6" | "spacing-7" | "spacing-7.5" | "spacing-8" | "spacing-9" | "spacing-none" | "typography-body1-fontFamily" | "typography-body1-fontSize" | "typography-body1-fontWeight" | "typography-body1-letterSpacing" | "typography-body1-lineHeight" | "typography-body2-fontFamily" | "typography-body2-fontSize" | "typography-body2-fontWeight" | "typography-body2-letterSpacing" | "typography-body2-lineHeight" | "typography-body3-fontFamily" | "typography-body3-fontSize" | "typography-body3-fontWeight" | "typography-body3-letterSpacing" | "typography-body3-lineHeight" | "typography-body4-fontFamily" | "typography-body4-fontSize" | "typography-body4-fontWeight" | "typography-body4-letterSpacing" | "typography-body4-lineHeight" | "typography-caption1-fontFamily" | "typography-caption1-fontSize" | "typography-caption1-fontWeight" | "typography-caption1-letterSpacing" | "typography-caption1-lineHeight" | "typography-caption2-fontFamily" | "typography-caption2-fontSize" | "typography-caption2-fontWeight" | "typography-caption2-letterSpacing" | "typography-caption2-lineHeight" | "typography-caption3-fontFamily" | "typography-caption3-fontSize" | "typography-caption3-fontWeight" | "typography-caption3-letterSpacing" | "typography-caption3-lineHeight" | "typography-display1-fontFamily" | "typography-display1-fontSize" | "typography-display1-fontWeight" | "typography-display1-letterSpacing" | "typography-display1-lineHeight" | "typography-display2-fontFamily" | "typography-display2-fontSize" | "typography-display2-fontWeight" | "typography-display2-letterSpacing" | "typography-display2-lineHeight" | "typography-heading1-fontFamily" | "typography-heading1-fontSize" | "typography-heading1-fontWeight" | "typography-heading1-letterSpacing" | "typography-heading1-lineHeight" | "typography-heading2-fontFamily" | "typography-heading2-fontSize" | "typography-heading2-fontWeight" | "typography-heading2-letterSpacing" | "typography-heading2-lineHeight" | "typography-heading3-fontFamily" | "typography-heading3-fontSize" | "typography-heading3-fontWeight" | "typography-heading3-letterSpacing" | "typography-heading3-lineHeight" | "typography-heading4-fontFamily" | "typography-heading4-fontSize" | "typography-heading4-fontWeight" | "typography-heading4-letterSpacing" | "typography-heading4-lineHeight" | "typography-title1-fontFamily" | "typography-title1-fontSize" | "typography-title1-fontWeight" | "typography-title1-letterSpacing" | "typography-title1-lineHeight" | "typography-title2-fontFamily" | "typography-title2-fontSize" | "typography-title2-fontWeight" | "typography-title2-letterSpacing" | "typography-title2-lineHeight" | "typography-title3-fontFamily" | "typography-title3-fontSize" | "typography-title3-fontWeight" | "typography-title3-letterSpacing" | "typography-title3-lineHeight" | "typography-title4-fontFamily" | "typography-title4-fontSize" | "typography-title4-fontWeight" | "typography-title4-letterSpacing" | "typography-title4-lineHeight";
2
2
  type SemanticTokenType = "color" | "dimension" | "fontFamily" | "fontWeight";
3
- type SemanticTokenCssVariable = `--eds-${SemanticTokenName}`;
3
+ type EscapeCssDots<Name extends string> = Name extends `${infer Head}.${infer Tail}` ? `${Head}\\.${EscapeCssDots<Tail>}` : Name;
4
+ type SemanticTokenCssVariable = `--eds-${EscapeCssDots<SemanticTokenName>}`;
4
5
  type SemanticTokenCssReference = `var(${SemanticTokenCssVariable})`;
5
6
  interface SemanticToken {
6
7
  readonly name: SemanticTokenName;
7
8
  readonly type: SemanticTokenType;
9
+ /** 빌드 시 해석된 참고용 값입니다. 스타일에는 cssVariable 또는 cssVar()를 씁니다. */
8
10
  readonly value: unknown;
9
11
  readonly cssVariable: string;
10
12
  }
11
13
  type SemanticTokenMap = Readonly<Record<SemanticTokenName, SemanticToken>>;
14
+ /** 공개 token manifest입니다. 이름 목록은 tokenNames, CSS 참조는 cssVar()입니다. */
12
15
  declare const tokens: SemanticTokenMap;
13
16
  declare const tokenNames: readonly SemanticTokenName[];
17
+ /** 공개 token 이름을 var(--eds-…) 참조로 바꿉니다. 이름은 SemanticTokenName 리터럴로 전달하며, tokenNames에 없는 문자열은 런타임 오류입니다. */
14
18
  declare function cssVar(name: SemanticTokenName): SemanticTokenCssReference;
15
19
 
16
- export { type SemanticToken, type SemanticTokenCssReference, type SemanticTokenCssVariable, type SemanticTokenMap, type SemanticTokenName, type SemanticTokenType, cssVar, tokenNames, tokens };
20
+ export { type EscapeCssDots, type SemanticToken, type SemanticTokenCssReference, type SemanticTokenCssVariable, type SemanticTokenMap, type SemanticTokenName, type SemanticTokenType, cssVar, tokenNames, tokens };