@phcdevworks/spectre-tokens 2.6.0 → 2.8.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/README.md CHANGED
@@ -1,21 +1,23 @@
1
1
  # @phcdevworks/spectre-tokens
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@phcdevworks/spectre-tokens)](https://www.npmjs.com/package/@phcdevworks/spectre-tokens)
4
- [![CI](https://img.shields.io/github/actions/workflow/status/phcdevworks/spectre-tokens/ci.yml?branch=main&label=CI)](https://github.com/phcdevworks/spectre-tokens/actions/workflows/ci.yml)
5
- [![License](https://img.shields.io/github/license/phcdevworks/spectre-tokens)](LICENSE)
6
- [![Node](https://img.shields.io/badge/node-%5E22.12.0%20%7C%7C%20%3E%3D24.0.0-brightgreen)](https://nodejs.org)
4
+ [![CI](https://github.com/phcdevworks/spectre-tokens/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/phcdevworks/spectre-tokens/actions/workflows/ci.yml)
5
+ [![License](https://img.shields.io/npm/l/@phcdevworks/spectre-tokens)](LICENSE)
6
+ [![Node](https://img.shields.io/node/v/@phcdevworks/spectre-tokens)](https://nodejs.org)
7
7
 
8
- `@phcdevworks/spectre-tokens` is the design-token package of the Spectre system
9
- for downstream Spectre packages and compatible applications.
8
+ `@phcdevworks/spectre-tokens` is the design-token package of the Spectre system.
9
+ It provides a complete, UI-ready token surface for downstream Spectre packages
10
+ and compatible applications.
10
11
 
11
12
  Maintained by PHCDevworks, it defines the visual language, semantic roles, and
12
- token contracts consumed downstream. It keeps visual meaning centralized in
13
- token data while downstream UI packages define structure and adapter packages
14
- translate those contracts for specific frameworks and runtimes.
13
+ token contracts that downstream consumers can rely on without filling gaps with
14
+ raw palette values or local token inventions. Downstream UI packages define
15
+ structure; adapter packages translate Spectre contracts for specific frameworks
16
+ and runtimes.
15
17
 
16
- [Contributing](CONTRIBUTING.md) | [Changelog](CHANGELOG.md) |
17
- [Token Contract](TOKEN_CONTRACT.md) | [Roadmap](ROADMAP.md) |
18
- [Security Policy](SECURITY.md)
18
+ [Contributing](CONTRIBUTING.md) | [Code of Conduct](CODE_OF_CONDUCT.md) |
19
+ [Changelog](CHANGELOG.md) | [Token Contract](TOKEN_CONTRACT.md) |
20
+ [Roadmap](ROADMAP.md) | [Security Policy](SECURITY.md)
19
21
 
20
22
  ## Source of truth
21
23
 
@@ -425,14 +427,14 @@ npm install
425
427
  npm run check
426
428
  ```
427
429
 
428
- This project expects Node.js `^22.12.0 || >=24.0.0` and npm `11.14.1`.
430
+ This project expects Node.js `^22.12.0 || >=24.0.0` and npm `11.16.0`.
429
431
 
430
432
  ### Common commands
431
433
 
432
434
  | Command | What it does |
433
435
  |---|---|
434
436
  | `npm run build` | Regenerate all outputs — run after any token source change |
435
- | `npm run check` | Full validation gate — all 14 steps must pass before commit |
437
+ | `npm run check` | Full validation gate — all 15 steps must pass before commit |
436
438
  | `npm run lint` | Run ESLint against all source files |
437
439
  | `npm run format` | Apply Prettier formatting to all files |
438
440
  | `npm run generate` | Regenerate `src/generated/tokens.ts` from token sources only |
package/dist/index.cjs CHANGED
@@ -134,7 +134,8 @@ var coreTokens = {
134
134
  "bgDisabled": "{colors.error.200}",
135
135
  "text": "{colors.white}",
136
136
  "textDisabled": "{colors.neutral.400}",
137
- "focusRing": "{colors.error.500} / 0.4"
137
+ "focusRing": "{colors.error.500} / 0.4",
138
+ "focusVisible": "{colors.error.500} / 0.4"
138
139
  },
139
140
  "success": {
140
141
  "bg": "{colors.success.700}",
@@ -143,7 +144,8 @@ var coreTokens = {
143
144
  "bgDisabled": "{colors.success.200}",
144
145
  "text": "{colors.white}",
145
146
  "textDisabled": "{colors.neutral.400}",
146
- "focusRing": "{colors.success.500} / 0.4"
147
+ "focusRing": "{colors.success.500} / 0.4",
148
+ "focusVisible": "{colors.success.500} / 0.4"
147
149
  },
148
150
  "cta": {
149
151
  "bg": "{colors.brand.600}",
@@ -329,7 +331,7 @@ var coreTokens = {
329
331
  "badge": {
330
332
  "neutralBg": "{colors.neutral.700}",
331
333
  "neutralBgHover": "{colors.neutral.600}",
332
- "neutralText": "{colors.neutral.100}",
334
+ "neutralText": "{colors.neutral.50}",
333
335
  "infoBg": "{colors.info.800}",
334
336
  "infoBgHover": "{colors.info.700}",
335
337
  "infoText": "{colors.info.100}",
@@ -472,26 +474,33 @@ var coreTokens = {
472
474
  "600": "#6f3fd7"
473
475
  },
474
476
  "focus": {
475
- "primary": "#336df4",
476
- "error": "#ef4444",
477
- "info": "#0369a1"
477
+ "primary": "{colors.brand.500}",
478
+ "error": "{colors.error.500}",
479
+ "info": "{colors.info.600}"
478
480
  },
479
481
  "white": "#ffffff",
480
482
  "black": "#000000"
481
483
  },
482
484
  "space": {
483
485
  "0": "0rem",
486
+ "1": "0.0625rem",
487
+ "2": "0.125rem",
484
488
  "4": "0.25rem",
489
+ "6": "0.375rem",
485
490
  "8": "0.5rem",
491
+ "10": "0.625rem",
486
492
  "12": "0.75rem",
493
+ "14": "0.875rem",
487
494
  "16": "1rem",
488
495
  "20": "1.25rem",
489
496
  "24": "1.5rem",
497
+ "28": "1.75rem",
490
498
  "32": "2rem",
491
499
  "40": "2.5rem",
492
500
  "48": "3rem",
493
501
  "56": "3.5rem",
494
502
  "64": "4rem",
503
+ "72": "4.5rem",
495
504
  "80": "5rem",
496
505
  "96": "6rem"
497
506
  },
@@ -500,13 +509,19 @@ var coreTokens = {
500
509
  "sm": "2px",
501
510
  "md": "4px",
502
511
  "lg": "8px",
512
+ "xl": "12px",
513
+ "2xl": "16px",
514
+ "3xl": "24px",
515
+ "4xl": "32px",
503
516
  "pill": "999px"
504
517
  },
505
518
  "shadows": {
506
519
  "none": "none",
507
520
  "sm": "0 1px 2px 0 {colors.black} / 0.06",
508
521
  "md": "0 2px 6px -1px {colors.black} / 0.08",
509
- "lg": "0 6px 16px -4px {colors.black} / 0.12"
522
+ "lg": "0 6px 16px -4px {colors.black} / 0.12",
523
+ "xl": "0 12px 24px -6px {colors.black} / 0.15",
524
+ "2xl": "0 20px 48px -12px {colors.black} / 0.20"
510
525
  },
511
526
  "breakpoints": {
512
527
  "sm": "640px",
@@ -523,64 +538,69 @@ var coreTokens = {
523
538
  "overlay": "1300",
524
539
  "modal": "1400",
525
540
  "popover": "1500",
526
- "tooltip": "1600"
541
+ "tooltip": "1600",
542
+ "toast": "1700"
527
543
  },
528
544
  "transitions": {
529
545
  "duration": {
530
546
  "instant": "75ms",
531
547
  "fast": "150ms",
532
548
  "base": "200ms",
549
+ "relaxed": "250ms",
533
550
  "moderate": "300ms",
534
551
  "slow": "500ms",
535
- "slower": "700ms"
552
+ "slower": "700ms",
553
+ "long": "1000ms",
554
+ "slowest": "1200ms"
536
555
  },
537
556
  "easing": {
538
557
  "linear": "linear",
539
558
  "in": "cubic-bezier(0.4, 0, 1, 1)",
540
559
  "out": "cubic-bezier(0, 0, 0.2, 1)",
541
560
  "inOut": "cubic-bezier(0.4, 0, 0.2, 1)",
542
- "spring": "cubic-bezier(0.4, 0, 0.2, 1)"
561
+ "spring": "cubic-bezier(0.4, 0, 0.2, 1)",
562
+ "overshoot": "cubic-bezier(0.34, 1.56, 0.64, 1)"
543
563
  }
544
564
  },
545
565
  "animations": {
546
566
  "fadeIn": {
547
- "duration": "200ms",
548
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
567
+ "duration": "{transitions.duration.base}",
568
+ "easing": "{transitions.easing.out}",
549
569
  "keyframes": "fade-in"
550
570
  },
551
571
  "fadeOut": {
552
- "duration": "150ms",
553
- "easing": "cubic-bezier(0.4, 0, 1, 1)",
572
+ "duration": "{transitions.duration.fast}",
573
+ "easing": "{transitions.easing.in}",
554
574
  "keyframes": "fade-out"
555
575
  },
556
576
  "slideUp": {
557
- "duration": "300ms",
558
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
577
+ "duration": "{transitions.duration.moderate}",
578
+ "easing": "{transitions.easing.out}",
559
579
  "keyframes": "slide-up"
560
580
  },
561
581
  "slideDown": {
562
- "duration": "300ms",
563
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
582
+ "duration": "{transitions.duration.moderate}",
583
+ "easing": "{transitions.easing.out}",
564
584
  "keyframes": "slide-down"
565
585
  },
566
586
  "scaleIn": {
567
- "duration": "200ms",
568
- "easing": "cubic-bezier(0.34, 1.56, 0.64, 1)",
587
+ "duration": "{transitions.duration.base}",
588
+ "easing": "{transitions.easing.overshoot}",
569
589
  "keyframes": "scale-in"
570
590
  },
571
591
  "bounce": {
572
- "duration": "300ms",
573
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
592
+ "duration": "{transitions.duration.moderate}",
593
+ "easing": "{transitions.easing.spring}",
574
594
  "keyframes": "bounce"
575
595
  },
576
596
  "shake": {
577
- "duration": "250ms",
578
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
597
+ "duration": "{transitions.duration.relaxed}",
598
+ "easing": "{transitions.easing.spring}",
579
599
  "keyframes": "shake"
580
600
  },
581
601
  "pulse": {
582
- "duration": "1200ms",
583
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
602
+ "duration": "{transitions.duration.slowest}",
603
+ "easing": "{transitions.easing.spring}",
584
604
  "keyframes": "pulse"
585
605
  }
586
606
  },
@@ -588,6 +608,7 @@ var coreTokens = {
588
608
  "disabled": "0.38",
589
609
  "hover": "0.92",
590
610
  "active": "0.84",
611
+ "loading": "0.6",
591
612
  "focus": "1",
592
613
  "overlay": "0.5",
593
614
  "tooltip": "0.95"
@@ -595,6 +616,7 @@ var coreTokens = {
595
616
  "aspectRatios": {
596
617
  "square": "1/1",
597
618
  "video": "16/9",
619
+ "classic": "3/2",
598
620
  "portrait": "3/4",
599
621
  "landscape": "4/3",
600
622
  "ultrawide": "21/9",
@@ -620,8 +642,15 @@ var coreTokens = {
620
642
  },
621
643
  "border": {
622
644
  "width": {
645
+ "none": "0",
623
646
  "base": "1px",
624
647
  "thick": "2px"
648
+ },
649
+ "style": {
650
+ "none": "none",
651
+ "solid": "solid",
652
+ "dashed": "dashed",
653
+ "dotted": "dotted"
625
654
  }
626
655
  },
627
656
  "surface": {
@@ -685,47 +714,56 @@ var coreTokens = {
685
714
  "sm": {
686
715
  "size": "0.875rem",
687
716
  "lineHeight": "1.5rem",
688
- "weight": 400
717
+ "weight": 400,
718
+ "letterSpacing": "0em"
689
719
  },
690
720
  "md": {
691
721
  "size": "1rem",
692
722
  "lineHeight": "1.75rem",
693
- "weight": 500
723
+ "weight": 500,
724
+ "letterSpacing": "0em"
694
725
  },
695
726
  "lg": {
696
727
  "size": "1.25rem",
697
728
  "lineHeight": "2rem",
698
- "weight": 600
729
+ "weight": 600,
730
+ "letterSpacing": "0em"
699
731
  },
700
732
  "xl": {
701
733
  "size": "1.5rem",
702
734
  "lineHeight": "2.125rem",
703
- "weight": 600
735
+ "weight": 600,
736
+ "letterSpacing": "0em"
704
737
  },
705
738
  "2xl": {
706
739
  "size": "1.875rem",
707
740
  "lineHeight": "2.5rem",
708
- "weight": 700
741
+ "weight": 700,
742
+ "letterSpacing": "0em"
709
743
  },
710
744
  "3xl": {
711
745
  "size": "2.25rem",
712
746
  "lineHeight": "2.75rem",
713
- "weight": 700
747
+ "weight": 700,
748
+ "letterSpacing": "0em"
714
749
  },
715
750
  "4xl": {
716
751
  "size": "3rem",
717
752
  "lineHeight": "3.5rem",
718
- "weight": 800
753
+ "weight": 800,
754
+ "letterSpacing": "0em"
719
755
  },
720
756
  "5xl": {
721
757
  "size": "3.75rem",
722
758
  "lineHeight": "4.25rem",
723
- "weight": 800
759
+ "weight": 800,
760
+ "letterSpacing": "0em"
724
761
  },
725
762
  "6xl": {
726
763
  "size": "4.5rem",
727
764
  "lineHeight": "5rem",
728
- "weight": 900
765
+ "weight": 900,
766
+ "letterSpacing": "0em"
729
767
  }
730
768
  },
731
769
  "typography": {
@@ -744,47 +782,56 @@ var coreTokens = {
744
782
  "sm": {
745
783
  "fontSize": "0.875rem",
746
784
  "lineHeight": "1.5rem",
747
- "fontWeight": 400
785
+ "fontWeight": 400,
786
+ "letterSpacing": "0em"
748
787
  },
749
788
  "md": {
750
789
  "fontSize": "1rem",
751
790
  "lineHeight": "1.75rem",
752
- "fontWeight": 500
791
+ "fontWeight": 500,
792
+ "letterSpacing": "0em"
753
793
  },
754
794
  "lg": {
755
795
  "fontSize": "1.25rem",
756
796
  "lineHeight": "2rem",
757
- "fontWeight": 600
797
+ "fontWeight": 600,
798
+ "letterSpacing": "0em"
758
799
  },
759
800
  "xl": {
760
801
  "fontSize": "1.5rem",
761
802
  "lineHeight": "2.125rem",
762
- "fontWeight": 600
803
+ "fontWeight": 600,
804
+ "letterSpacing": "0em"
763
805
  },
764
806
  "2xl": {
765
807
  "fontSize": "1.875rem",
766
808
  "lineHeight": "2.5rem",
767
- "fontWeight": 700
809
+ "fontWeight": 700,
810
+ "letterSpacing": "0em"
768
811
  },
769
812
  "3xl": {
770
813
  "fontSize": "2.25rem",
771
814
  "lineHeight": "2.75rem",
772
- "fontWeight": 700
815
+ "fontWeight": 700,
816
+ "letterSpacing": "0em"
773
817
  },
774
818
  "4xl": {
775
819
  "fontSize": "3rem",
776
820
  "lineHeight": "3.5rem",
777
- "fontWeight": 800
821
+ "fontWeight": 800,
822
+ "letterSpacing": "0em"
778
823
  },
779
824
  "5xl": {
780
825
  "fontSize": "3.75rem",
781
826
  "lineHeight": "4.25rem",
782
- "fontWeight": 800
827
+ "fontWeight": 800,
828
+ "letterSpacing": "0em"
783
829
  },
784
830
  "6xl": {
785
831
  "fontSize": "4.5rem",
786
832
  "lineHeight": "5rem",
787
- "fontWeight": 900
833
+ "fontWeight": 900,
834
+ "letterSpacing": "0em"
788
835
  }
789
836
  }
790
837
  }
@@ -927,6 +974,11 @@ var createCssVariableMap = (tokens2, options = {}) => {
927
974
  assign(toVariableName(prefix, "border", "width", key), value);
928
975
  });
929
976
  }
977
+ if (border?.style) {
978
+ Object.entries(border.style).forEach(([key, value]) => {
979
+ assign(toVariableName(prefix, "border", "style", key), value);
980
+ });
981
+ }
930
982
  Object.entries(baseTokens.radii).forEach(([key, value]) => {
931
983
  assign(toVariableName(prefix, "radius", key), value);
932
984
  });
@@ -952,27 +1004,6 @@ var createCssVariableMap = (tokens2, options = {}) => {
952
1004
  const scaleEntry = entry;
953
1005
  assign(toVariableName(prefix, "font", key, "letter-spacing"), scaleEntry.letterSpacing);
954
1006
  });
955
- assign(toVariableName(prefix, "text", "on", "page", "default"), tokens2.text.onPage.default);
956
- assign(toVariableName(prefix, "text", "on", "page", "muted"), tokens2.text.onPage.muted);
957
- assign(toVariableName(prefix, "text", "on", "page", "subtle"), tokens2.text.onPage.subtle);
958
- assign(toVariableName(prefix, "text", "on", "page", "meta"), tokens2.text.onPage.meta);
959
- assign(toVariableName(prefix, "text", "on", "surface", "default"), tokens2.text.onSurface.default);
960
- assign(toVariableName(prefix, "text", "on", "surface", "muted"), tokens2.text.onSurface.muted);
961
- assign(toVariableName(prefix, "text", "on", "surface", "subtle"), tokens2.text.onSurface.subtle);
962
- assign(toVariableName(prefix, "text", "on", "surface", "meta"), tokens2.text.onSurface.meta);
963
- const badge = tokens2.component?.badge;
964
- if (badge) {
965
- BADGE_VARIANTS.forEach(({ variant, bgKey, textKey }) => {
966
- assign(toVariableName(prefix, "badge", variant, "bg"), badge[bgKey]);
967
- assign(toVariableName(prefix, "badge", variant, "text"), badge[textKey]);
968
- });
969
- }
970
- const iconBox = tokens2.component?.iconBox;
971
- if (iconBox) {
972
- ICON_BOX_FIELDS.forEach(({ name, tokenKey }) => {
973
- assign(toVariableName(prefix, "icon-box", name), iconBox[tokenKey]);
974
- });
975
- }
976
1007
  Object.entries(baseTokens.shadows).forEach(([key, value]) => {
977
1008
  assign(toVariableName(prefix, "shadow", key), value);
978
1009
  });