@phcdevworks/spectre-tokens 2.6.0 → 2.7.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.
15
-
16
- [Contributing](CONTRIBUTING.md) | [Changelog](CHANGELOG.md) |
17
- [Token Contract](TOKEN_CONTRACT.md) | [Roadmap](ROADMAP.md) |
18
- [Security Policy](SECURITY.md)
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.
17
+
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
 
package/dist/index.cjs CHANGED
@@ -329,7 +329,7 @@ var coreTokens = {
329
329
  "badge": {
330
330
  "neutralBg": "{colors.neutral.700}",
331
331
  "neutralBgHover": "{colors.neutral.600}",
332
- "neutralText": "{colors.neutral.100}",
332
+ "neutralText": "{colors.neutral.50}",
333
333
  "infoBg": "{colors.info.800}",
334
334
  "infoBgHover": "{colors.info.700}",
335
335
  "infoText": "{colors.info.100}",
@@ -500,13 +500,17 @@ var coreTokens = {
500
500
  "sm": "2px",
501
501
  "md": "4px",
502
502
  "lg": "8px",
503
+ "xl": "12px",
504
+ "2xl": "16px",
503
505
  "pill": "999px"
504
506
  },
505
507
  "shadows": {
506
508
  "none": "none",
507
509
  "sm": "0 1px 2px 0 {colors.black} / 0.06",
508
510
  "md": "0 2px 6px -1px {colors.black} / 0.08",
509
- "lg": "0 6px 16px -4px {colors.black} / 0.12"
511
+ "lg": "0 6px 16px -4px {colors.black} / 0.12",
512
+ "xl": "0 12px 24px -6px {colors.black} / 0.15",
513
+ "2xl": "0 20px 48px -12px {colors.black} / 0.20"
510
514
  },
511
515
  "breakpoints": {
512
516
  "sm": "640px",
@@ -523,64 +527,69 @@ var coreTokens = {
523
527
  "overlay": "1300",
524
528
  "modal": "1400",
525
529
  "popover": "1500",
526
- "tooltip": "1600"
530
+ "tooltip": "1600",
531
+ "toast": "1700"
527
532
  },
528
533
  "transitions": {
529
534
  "duration": {
530
535
  "instant": "75ms",
531
536
  "fast": "150ms",
532
537
  "base": "200ms",
538
+ "relaxed": "250ms",
533
539
  "moderate": "300ms",
534
540
  "slow": "500ms",
535
- "slower": "700ms"
541
+ "slower": "700ms",
542
+ "long": "1000ms",
543
+ "slowest": "1200ms"
536
544
  },
537
545
  "easing": {
538
546
  "linear": "linear",
539
547
  "in": "cubic-bezier(0.4, 0, 1, 1)",
540
548
  "out": "cubic-bezier(0, 0, 0.2, 1)",
541
549
  "inOut": "cubic-bezier(0.4, 0, 0.2, 1)",
542
- "spring": "cubic-bezier(0.4, 0, 0.2, 1)"
550
+ "spring": "cubic-bezier(0.4, 0, 0.2, 1)",
551
+ "overshoot": "cubic-bezier(0.34, 1.56, 0.64, 1)"
543
552
  }
544
553
  },
545
554
  "animations": {
546
555
  "fadeIn": {
547
- "duration": "200ms",
548
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
556
+ "duration": "{transitions.duration.base}",
557
+ "easing": "{transitions.easing.out}",
549
558
  "keyframes": "fade-in"
550
559
  },
551
560
  "fadeOut": {
552
- "duration": "150ms",
553
- "easing": "cubic-bezier(0.4, 0, 1, 1)",
561
+ "duration": "{transitions.duration.fast}",
562
+ "easing": "{transitions.easing.in}",
554
563
  "keyframes": "fade-out"
555
564
  },
556
565
  "slideUp": {
557
- "duration": "300ms",
558
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
566
+ "duration": "{transitions.duration.moderate}",
567
+ "easing": "{transitions.easing.out}",
559
568
  "keyframes": "slide-up"
560
569
  },
561
570
  "slideDown": {
562
- "duration": "300ms",
563
- "easing": "cubic-bezier(0, 0, 0.2, 1)",
571
+ "duration": "{transitions.duration.moderate}",
572
+ "easing": "{transitions.easing.out}",
564
573
  "keyframes": "slide-down"
565
574
  },
566
575
  "scaleIn": {
567
- "duration": "200ms",
568
- "easing": "cubic-bezier(0.34, 1.56, 0.64, 1)",
576
+ "duration": "{transitions.duration.base}",
577
+ "easing": "{transitions.easing.overshoot}",
569
578
  "keyframes": "scale-in"
570
579
  },
571
580
  "bounce": {
572
- "duration": "300ms",
573
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
581
+ "duration": "{transitions.duration.moderate}",
582
+ "easing": "{transitions.easing.spring}",
574
583
  "keyframes": "bounce"
575
584
  },
576
585
  "shake": {
577
- "duration": "250ms",
578
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
586
+ "duration": "{transitions.duration.relaxed}",
587
+ "easing": "{transitions.easing.spring}",
579
588
  "keyframes": "shake"
580
589
  },
581
590
  "pulse": {
582
- "duration": "1200ms",
583
- "easing": "cubic-bezier(0.4, 0, 0.2, 1)",
591
+ "duration": "{transitions.duration.slowest}",
592
+ "easing": "{transitions.easing.spring}",
584
593
  "keyframes": "pulse"
585
594
  }
586
595
  },
@@ -588,6 +597,7 @@ var coreTokens = {
588
597
  "disabled": "0.38",
589
598
  "hover": "0.92",
590
599
  "active": "0.84",
600
+ "loading": "0.6",
591
601
  "focus": "1",
592
602
  "overlay": "0.5",
593
603
  "tooltip": "0.95"
@@ -595,6 +605,7 @@ var coreTokens = {
595
605
  "aspectRatios": {
596
606
  "square": "1/1",
597
607
  "video": "16/9",
608
+ "classic": "3/2",
598
609
  "portrait": "3/4",
599
610
  "landscape": "4/3",
600
611
  "ultrawide": "21/9",
@@ -622,6 +633,10 @@ var coreTokens = {
622
633
  "width": {
623
634
  "base": "1px",
624
635
  "thick": "2px"
636
+ },
637
+ "style": {
638
+ "none": "none",
639
+ "solid": "solid"
625
640
  }
626
641
  },
627
642
  "surface": {
@@ -685,47 +700,56 @@ var coreTokens = {
685
700
  "sm": {
686
701
  "size": "0.875rem",
687
702
  "lineHeight": "1.5rem",
688
- "weight": 400
703
+ "weight": 400,
704
+ "letterSpacing": "0em"
689
705
  },
690
706
  "md": {
691
707
  "size": "1rem",
692
708
  "lineHeight": "1.75rem",
693
- "weight": 500
709
+ "weight": 500,
710
+ "letterSpacing": "0em"
694
711
  },
695
712
  "lg": {
696
713
  "size": "1.25rem",
697
714
  "lineHeight": "2rem",
698
- "weight": 600
715
+ "weight": 600,
716
+ "letterSpacing": "0em"
699
717
  },
700
718
  "xl": {
701
719
  "size": "1.5rem",
702
720
  "lineHeight": "2.125rem",
703
- "weight": 600
721
+ "weight": 600,
722
+ "letterSpacing": "0em"
704
723
  },
705
724
  "2xl": {
706
725
  "size": "1.875rem",
707
726
  "lineHeight": "2.5rem",
708
- "weight": 700
727
+ "weight": 700,
728
+ "letterSpacing": "0em"
709
729
  },
710
730
  "3xl": {
711
731
  "size": "2.25rem",
712
732
  "lineHeight": "2.75rem",
713
- "weight": 700
733
+ "weight": 700,
734
+ "letterSpacing": "0em"
714
735
  },
715
736
  "4xl": {
716
737
  "size": "3rem",
717
738
  "lineHeight": "3.5rem",
718
- "weight": 800
739
+ "weight": 800,
740
+ "letterSpacing": "0em"
719
741
  },
720
742
  "5xl": {
721
743
  "size": "3.75rem",
722
744
  "lineHeight": "4.25rem",
723
- "weight": 800
745
+ "weight": 800,
746
+ "letterSpacing": "0em"
724
747
  },
725
748
  "6xl": {
726
749
  "size": "4.5rem",
727
750
  "lineHeight": "5rem",
728
- "weight": 900
751
+ "weight": 900,
752
+ "letterSpacing": "0em"
729
753
  }
730
754
  },
731
755
  "typography": {
@@ -744,47 +768,56 @@ var coreTokens = {
744
768
  "sm": {
745
769
  "fontSize": "0.875rem",
746
770
  "lineHeight": "1.5rem",
747
- "fontWeight": 400
771
+ "fontWeight": 400,
772
+ "letterSpacing": "0em"
748
773
  },
749
774
  "md": {
750
775
  "fontSize": "1rem",
751
776
  "lineHeight": "1.75rem",
752
- "fontWeight": 500
777
+ "fontWeight": 500,
778
+ "letterSpacing": "0em"
753
779
  },
754
780
  "lg": {
755
781
  "fontSize": "1.25rem",
756
782
  "lineHeight": "2rem",
757
- "fontWeight": 600
783
+ "fontWeight": 600,
784
+ "letterSpacing": "0em"
758
785
  },
759
786
  "xl": {
760
787
  "fontSize": "1.5rem",
761
788
  "lineHeight": "2.125rem",
762
- "fontWeight": 600
789
+ "fontWeight": 600,
790
+ "letterSpacing": "0em"
763
791
  },
764
792
  "2xl": {
765
793
  "fontSize": "1.875rem",
766
794
  "lineHeight": "2.5rem",
767
- "fontWeight": 700
795
+ "fontWeight": 700,
796
+ "letterSpacing": "0em"
768
797
  },
769
798
  "3xl": {
770
799
  "fontSize": "2.25rem",
771
800
  "lineHeight": "2.75rem",
772
- "fontWeight": 700
801
+ "fontWeight": 700,
802
+ "letterSpacing": "0em"
773
803
  },
774
804
  "4xl": {
775
805
  "fontSize": "3rem",
776
806
  "lineHeight": "3.5rem",
777
- "fontWeight": 800
807
+ "fontWeight": 800,
808
+ "letterSpacing": "0em"
778
809
  },
779
810
  "5xl": {
780
811
  "fontSize": "3.75rem",
781
812
  "lineHeight": "4.25rem",
782
- "fontWeight": 800
813
+ "fontWeight": 800,
814
+ "letterSpacing": "0em"
783
815
  },
784
816
  "6xl": {
785
817
  "fontSize": "4.5rem",
786
818
  "lineHeight": "5rem",
787
- "fontWeight": 900
819
+ "fontWeight": 900,
820
+ "letterSpacing": "0em"
788
821
  }
789
822
  }
790
823
  }
@@ -927,6 +960,11 @@ var createCssVariableMap = (tokens2, options = {}) => {
927
960
  assign(toVariableName(prefix, "border", "width", key), value);
928
961
  });
929
962
  }
963
+ if (border?.style) {
964
+ Object.entries(border.style).forEach(([key, value]) => {
965
+ assign(toVariableName(prefix, "border", "style", key), value);
966
+ });
967
+ }
930
968
  Object.entries(baseTokens.radii).forEach(([key, value]) => {
931
969
  assign(toVariableName(prefix, "radius", key), value);
932
970
  });
@@ -952,27 +990,6 @@ var createCssVariableMap = (tokens2, options = {}) => {
952
990
  const scaleEntry = entry;
953
991
  assign(toVariableName(prefix, "font", key, "letter-spacing"), scaleEntry.letterSpacing);
954
992
  });
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
993
  Object.entries(baseTokens.shadows).forEach(([key, value]) => {
977
994
  assign(toVariableName(prefix, "shadow", key), value);
978
995
  });