@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 +15 -13
- package/dist/index.cjs +96 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +36 -25
- package/dist/index.d.cts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +96 -65
- package/dist/index.js.map +1 -1
- package/dist/tokens.dtcg.json +2478 -0
- package/package.json +19 -11
- package/tokens/components.json +6 -0
- package/tokens/modes.json +1 -1
- package/tokens/palette.json +3 -3
- package/tokens/primitives.json +47 -20
- package/tokens/typography.json +36 -18
package/dist/index.js
CHANGED
|
@@ -104,7 +104,8 @@ var coreTokens = {
|
|
|
104
104
|
"bgDisabled": "{colors.error.200}",
|
|
105
105
|
"text": "{colors.white}",
|
|
106
106
|
"textDisabled": "{colors.neutral.400}",
|
|
107
|
-
"focusRing": "{colors.error.500} / 0.4"
|
|
107
|
+
"focusRing": "{colors.error.500} / 0.4",
|
|
108
|
+
"focusVisible": "{colors.error.500} / 0.4"
|
|
108
109
|
},
|
|
109
110
|
"success": {
|
|
110
111
|
"bg": "{colors.success.700}",
|
|
@@ -113,7 +114,8 @@ var coreTokens = {
|
|
|
113
114
|
"bgDisabled": "{colors.success.200}",
|
|
114
115
|
"text": "{colors.white}",
|
|
115
116
|
"textDisabled": "{colors.neutral.400}",
|
|
116
|
-
"focusRing": "{colors.success.500} / 0.4"
|
|
117
|
+
"focusRing": "{colors.success.500} / 0.4",
|
|
118
|
+
"focusVisible": "{colors.success.500} / 0.4"
|
|
117
119
|
},
|
|
118
120
|
"cta": {
|
|
119
121
|
"bg": "{colors.brand.600}",
|
|
@@ -299,7 +301,7 @@ var coreTokens = {
|
|
|
299
301
|
"badge": {
|
|
300
302
|
"neutralBg": "{colors.neutral.700}",
|
|
301
303
|
"neutralBgHover": "{colors.neutral.600}",
|
|
302
|
-
"neutralText": "{colors.neutral.
|
|
304
|
+
"neutralText": "{colors.neutral.50}",
|
|
303
305
|
"infoBg": "{colors.info.800}",
|
|
304
306
|
"infoBgHover": "{colors.info.700}",
|
|
305
307
|
"infoText": "{colors.info.100}",
|
|
@@ -442,26 +444,33 @@ var coreTokens = {
|
|
|
442
444
|
"600": "#6f3fd7"
|
|
443
445
|
},
|
|
444
446
|
"focus": {
|
|
445
|
-
"primary": "
|
|
446
|
-
"error": "
|
|
447
|
-
"info": "
|
|
447
|
+
"primary": "{colors.brand.500}",
|
|
448
|
+
"error": "{colors.error.500}",
|
|
449
|
+
"info": "{colors.info.600}"
|
|
448
450
|
},
|
|
449
451
|
"white": "#ffffff",
|
|
450
452
|
"black": "#000000"
|
|
451
453
|
},
|
|
452
454
|
"space": {
|
|
453
455
|
"0": "0rem",
|
|
456
|
+
"1": "0.0625rem",
|
|
457
|
+
"2": "0.125rem",
|
|
454
458
|
"4": "0.25rem",
|
|
459
|
+
"6": "0.375rem",
|
|
455
460
|
"8": "0.5rem",
|
|
461
|
+
"10": "0.625rem",
|
|
456
462
|
"12": "0.75rem",
|
|
463
|
+
"14": "0.875rem",
|
|
457
464
|
"16": "1rem",
|
|
458
465
|
"20": "1.25rem",
|
|
459
466
|
"24": "1.5rem",
|
|
467
|
+
"28": "1.75rem",
|
|
460
468
|
"32": "2rem",
|
|
461
469
|
"40": "2.5rem",
|
|
462
470
|
"48": "3rem",
|
|
463
471
|
"56": "3.5rem",
|
|
464
472
|
"64": "4rem",
|
|
473
|
+
"72": "4.5rem",
|
|
465
474
|
"80": "5rem",
|
|
466
475
|
"96": "6rem"
|
|
467
476
|
},
|
|
@@ -470,13 +479,19 @@ var coreTokens = {
|
|
|
470
479
|
"sm": "2px",
|
|
471
480
|
"md": "4px",
|
|
472
481
|
"lg": "8px",
|
|
482
|
+
"xl": "12px",
|
|
483
|
+
"2xl": "16px",
|
|
484
|
+
"3xl": "24px",
|
|
485
|
+
"4xl": "32px",
|
|
473
486
|
"pill": "999px"
|
|
474
487
|
},
|
|
475
488
|
"shadows": {
|
|
476
489
|
"none": "none",
|
|
477
490
|
"sm": "0 1px 2px 0 {colors.black} / 0.06",
|
|
478
491
|
"md": "0 2px 6px -1px {colors.black} / 0.08",
|
|
479
|
-
"lg": "0 6px 16px -4px {colors.black} / 0.12"
|
|
492
|
+
"lg": "0 6px 16px -4px {colors.black} / 0.12",
|
|
493
|
+
"xl": "0 12px 24px -6px {colors.black} / 0.15",
|
|
494
|
+
"2xl": "0 20px 48px -12px {colors.black} / 0.20"
|
|
480
495
|
},
|
|
481
496
|
"breakpoints": {
|
|
482
497
|
"sm": "640px",
|
|
@@ -493,64 +508,69 @@ var coreTokens = {
|
|
|
493
508
|
"overlay": "1300",
|
|
494
509
|
"modal": "1400",
|
|
495
510
|
"popover": "1500",
|
|
496
|
-
"tooltip": "1600"
|
|
511
|
+
"tooltip": "1600",
|
|
512
|
+
"toast": "1700"
|
|
497
513
|
},
|
|
498
514
|
"transitions": {
|
|
499
515
|
"duration": {
|
|
500
516
|
"instant": "75ms",
|
|
501
517
|
"fast": "150ms",
|
|
502
518
|
"base": "200ms",
|
|
519
|
+
"relaxed": "250ms",
|
|
503
520
|
"moderate": "300ms",
|
|
504
521
|
"slow": "500ms",
|
|
505
|
-
"slower": "700ms"
|
|
522
|
+
"slower": "700ms",
|
|
523
|
+
"long": "1000ms",
|
|
524
|
+
"slowest": "1200ms"
|
|
506
525
|
},
|
|
507
526
|
"easing": {
|
|
508
527
|
"linear": "linear",
|
|
509
528
|
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
510
529
|
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
511
530
|
"inOut": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
512
|
-
"spring": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
531
|
+
"spring": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
532
|
+
"overshoot": "cubic-bezier(0.34, 1.56, 0.64, 1)"
|
|
513
533
|
}
|
|
514
534
|
},
|
|
515
535
|
"animations": {
|
|
516
536
|
"fadeIn": {
|
|
517
|
-
"duration": "
|
|
518
|
-
"easing": "
|
|
537
|
+
"duration": "{transitions.duration.base}",
|
|
538
|
+
"easing": "{transitions.easing.out}",
|
|
519
539
|
"keyframes": "fade-in"
|
|
520
540
|
},
|
|
521
541
|
"fadeOut": {
|
|
522
|
-
"duration": "
|
|
523
|
-
"easing": "
|
|
542
|
+
"duration": "{transitions.duration.fast}",
|
|
543
|
+
"easing": "{transitions.easing.in}",
|
|
524
544
|
"keyframes": "fade-out"
|
|
525
545
|
},
|
|
526
546
|
"slideUp": {
|
|
527
|
-
"duration": "
|
|
528
|
-
"easing": "
|
|
547
|
+
"duration": "{transitions.duration.moderate}",
|
|
548
|
+
"easing": "{transitions.easing.out}",
|
|
529
549
|
"keyframes": "slide-up"
|
|
530
550
|
},
|
|
531
551
|
"slideDown": {
|
|
532
|
-
"duration": "
|
|
533
|
-
"easing": "
|
|
552
|
+
"duration": "{transitions.duration.moderate}",
|
|
553
|
+
"easing": "{transitions.easing.out}",
|
|
534
554
|
"keyframes": "slide-down"
|
|
535
555
|
},
|
|
536
556
|
"scaleIn": {
|
|
537
|
-
"duration": "
|
|
538
|
-
"easing": "
|
|
557
|
+
"duration": "{transitions.duration.base}",
|
|
558
|
+
"easing": "{transitions.easing.overshoot}",
|
|
539
559
|
"keyframes": "scale-in"
|
|
540
560
|
},
|
|
541
561
|
"bounce": {
|
|
542
|
-
"duration": "
|
|
543
|
-
"easing": "
|
|
562
|
+
"duration": "{transitions.duration.moderate}",
|
|
563
|
+
"easing": "{transitions.easing.spring}",
|
|
544
564
|
"keyframes": "bounce"
|
|
545
565
|
},
|
|
546
566
|
"shake": {
|
|
547
|
-
"duration": "
|
|
548
|
-
"easing": "
|
|
567
|
+
"duration": "{transitions.duration.relaxed}",
|
|
568
|
+
"easing": "{transitions.easing.spring}",
|
|
549
569
|
"keyframes": "shake"
|
|
550
570
|
},
|
|
551
571
|
"pulse": {
|
|
552
|
-
"duration": "
|
|
553
|
-
"easing": "
|
|
572
|
+
"duration": "{transitions.duration.slowest}",
|
|
573
|
+
"easing": "{transitions.easing.spring}",
|
|
554
574
|
"keyframes": "pulse"
|
|
555
575
|
}
|
|
556
576
|
},
|
|
@@ -558,6 +578,7 @@ var coreTokens = {
|
|
|
558
578
|
"disabled": "0.38",
|
|
559
579
|
"hover": "0.92",
|
|
560
580
|
"active": "0.84",
|
|
581
|
+
"loading": "0.6",
|
|
561
582
|
"focus": "1",
|
|
562
583
|
"overlay": "0.5",
|
|
563
584
|
"tooltip": "0.95"
|
|
@@ -565,6 +586,7 @@ var coreTokens = {
|
|
|
565
586
|
"aspectRatios": {
|
|
566
587
|
"square": "1/1",
|
|
567
588
|
"video": "16/9",
|
|
589
|
+
"classic": "3/2",
|
|
568
590
|
"portrait": "3/4",
|
|
569
591
|
"landscape": "4/3",
|
|
570
592
|
"ultrawide": "21/9",
|
|
@@ -590,8 +612,15 @@ var coreTokens = {
|
|
|
590
612
|
},
|
|
591
613
|
"border": {
|
|
592
614
|
"width": {
|
|
615
|
+
"none": "0",
|
|
593
616
|
"base": "1px",
|
|
594
617
|
"thick": "2px"
|
|
618
|
+
},
|
|
619
|
+
"style": {
|
|
620
|
+
"none": "none",
|
|
621
|
+
"solid": "solid",
|
|
622
|
+
"dashed": "dashed",
|
|
623
|
+
"dotted": "dotted"
|
|
595
624
|
}
|
|
596
625
|
},
|
|
597
626
|
"surface": {
|
|
@@ -655,47 +684,56 @@ var coreTokens = {
|
|
|
655
684
|
"sm": {
|
|
656
685
|
"size": "0.875rem",
|
|
657
686
|
"lineHeight": "1.5rem",
|
|
658
|
-
"weight": 400
|
|
687
|
+
"weight": 400,
|
|
688
|
+
"letterSpacing": "0em"
|
|
659
689
|
},
|
|
660
690
|
"md": {
|
|
661
691
|
"size": "1rem",
|
|
662
692
|
"lineHeight": "1.75rem",
|
|
663
|
-
"weight": 500
|
|
693
|
+
"weight": 500,
|
|
694
|
+
"letterSpacing": "0em"
|
|
664
695
|
},
|
|
665
696
|
"lg": {
|
|
666
697
|
"size": "1.25rem",
|
|
667
698
|
"lineHeight": "2rem",
|
|
668
|
-
"weight": 600
|
|
699
|
+
"weight": 600,
|
|
700
|
+
"letterSpacing": "0em"
|
|
669
701
|
},
|
|
670
702
|
"xl": {
|
|
671
703
|
"size": "1.5rem",
|
|
672
704
|
"lineHeight": "2.125rem",
|
|
673
|
-
"weight": 600
|
|
705
|
+
"weight": 600,
|
|
706
|
+
"letterSpacing": "0em"
|
|
674
707
|
},
|
|
675
708
|
"2xl": {
|
|
676
709
|
"size": "1.875rem",
|
|
677
710
|
"lineHeight": "2.5rem",
|
|
678
|
-
"weight": 700
|
|
711
|
+
"weight": 700,
|
|
712
|
+
"letterSpacing": "0em"
|
|
679
713
|
},
|
|
680
714
|
"3xl": {
|
|
681
715
|
"size": "2.25rem",
|
|
682
716
|
"lineHeight": "2.75rem",
|
|
683
|
-
"weight": 700
|
|
717
|
+
"weight": 700,
|
|
718
|
+
"letterSpacing": "0em"
|
|
684
719
|
},
|
|
685
720
|
"4xl": {
|
|
686
721
|
"size": "3rem",
|
|
687
722
|
"lineHeight": "3.5rem",
|
|
688
|
-
"weight": 800
|
|
723
|
+
"weight": 800,
|
|
724
|
+
"letterSpacing": "0em"
|
|
689
725
|
},
|
|
690
726
|
"5xl": {
|
|
691
727
|
"size": "3.75rem",
|
|
692
728
|
"lineHeight": "4.25rem",
|
|
693
|
-
"weight": 800
|
|
729
|
+
"weight": 800,
|
|
730
|
+
"letterSpacing": "0em"
|
|
694
731
|
},
|
|
695
732
|
"6xl": {
|
|
696
733
|
"size": "4.5rem",
|
|
697
734
|
"lineHeight": "5rem",
|
|
698
|
-
"weight": 900
|
|
735
|
+
"weight": 900,
|
|
736
|
+
"letterSpacing": "0em"
|
|
699
737
|
}
|
|
700
738
|
},
|
|
701
739
|
"typography": {
|
|
@@ -714,47 +752,56 @@ var coreTokens = {
|
|
|
714
752
|
"sm": {
|
|
715
753
|
"fontSize": "0.875rem",
|
|
716
754
|
"lineHeight": "1.5rem",
|
|
717
|
-
"fontWeight": 400
|
|
755
|
+
"fontWeight": 400,
|
|
756
|
+
"letterSpacing": "0em"
|
|
718
757
|
},
|
|
719
758
|
"md": {
|
|
720
759
|
"fontSize": "1rem",
|
|
721
760
|
"lineHeight": "1.75rem",
|
|
722
|
-
"fontWeight": 500
|
|
761
|
+
"fontWeight": 500,
|
|
762
|
+
"letterSpacing": "0em"
|
|
723
763
|
},
|
|
724
764
|
"lg": {
|
|
725
765
|
"fontSize": "1.25rem",
|
|
726
766
|
"lineHeight": "2rem",
|
|
727
|
-
"fontWeight": 600
|
|
767
|
+
"fontWeight": 600,
|
|
768
|
+
"letterSpacing": "0em"
|
|
728
769
|
},
|
|
729
770
|
"xl": {
|
|
730
771
|
"fontSize": "1.5rem",
|
|
731
772
|
"lineHeight": "2.125rem",
|
|
732
|
-
"fontWeight": 600
|
|
773
|
+
"fontWeight": 600,
|
|
774
|
+
"letterSpacing": "0em"
|
|
733
775
|
},
|
|
734
776
|
"2xl": {
|
|
735
777
|
"fontSize": "1.875rem",
|
|
736
778
|
"lineHeight": "2.5rem",
|
|
737
|
-
"fontWeight": 700
|
|
779
|
+
"fontWeight": 700,
|
|
780
|
+
"letterSpacing": "0em"
|
|
738
781
|
},
|
|
739
782
|
"3xl": {
|
|
740
783
|
"fontSize": "2.25rem",
|
|
741
784
|
"lineHeight": "2.75rem",
|
|
742
|
-
"fontWeight": 700
|
|
785
|
+
"fontWeight": 700,
|
|
786
|
+
"letterSpacing": "0em"
|
|
743
787
|
},
|
|
744
788
|
"4xl": {
|
|
745
789
|
"fontSize": "3rem",
|
|
746
790
|
"lineHeight": "3.5rem",
|
|
747
|
-
"fontWeight": 800
|
|
791
|
+
"fontWeight": 800,
|
|
792
|
+
"letterSpacing": "0em"
|
|
748
793
|
},
|
|
749
794
|
"5xl": {
|
|
750
795
|
"fontSize": "3.75rem",
|
|
751
796
|
"lineHeight": "4.25rem",
|
|
752
|
-
"fontWeight": 800
|
|
797
|
+
"fontWeight": 800,
|
|
798
|
+
"letterSpacing": "0em"
|
|
753
799
|
},
|
|
754
800
|
"6xl": {
|
|
755
801
|
"fontSize": "4.5rem",
|
|
756
802
|
"lineHeight": "5rem",
|
|
757
|
-
"fontWeight": 900
|
|
803
|
+
"fontWeight": 900,
|
|
804
|
+
"letterSpacing": "0em"
|
|
758
805
|
}
|
|
759
806
|
}
|
|
760
807
|
}
|
|
@@ -897,6 +944,11 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
897
944
|
assign(toVariableName(prefix, "border", "width", key), value);
|
|
898
945
|
});
|
|
899
946
|
}
|
|
947
|
+
if (border?.style) {
|
|
948
|
+
Object.entries(border.style).forEach(([key, value]) => {
|
|
949
|
+
assign(toVariableName(prefix, "border", "style", key), value);
|
|
950
|
+
});
|
|
951
|
+
}
|
|
900
952
|
Object.entries(baseTokens.radii).forEach(([key, value]) => {
|
|
901
953
|
assign(toVariableName(prefix, "radius", key), value);
|
|
902
954
|
});
|
|
@@ -922,27 +974,6 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
922
974
|
const scaleEntry = entry;
|
|
923
975
|
assign(toVariableName(prefix, "font", key, "letter-spacing"), scaleEntry.letterSpacing);
|
|
924
976
|
});
|
|
925
|
-
assign(toVariableName(prefix, "text", "on", "page", "default"), tokens2.text.onPage.default);
|
|
926
|
-
assign(toVariableName(prefix, "text", "on", "page", "muted"), tokens2.text.onPage.muted);
|
|
927
|
-
assign(toVariableName(prefix, "text", "on", "page", "subtle"), tokens2.text.onPage.subtle);
|
|
928
|
-
assign(toVariableName(prefix, "text", "on", "page", "meta"), tokens2.text.onPage.meta);
|
|
929
|
-
assign(toVariableName(prefix, "text", "on", "surface", "default"), tokens2.text.onSurface.default);
|
|
930
|
-
assign(toVariableName(prefix, "text", "on", "surface", "muted"), tokens2.text.onSurface.muted);
|
|
931
|
-
assign(toVariableName(prefix, "text", "on", "surface", "subtle"), tokens2.text.onSurface.subtle);
|
|
932
|
-
assign(toVariableName(prefix, "text", "on", "surface", "meta"), tokens2.text.onSurface.meta);
|
|
933
|
-
const badge = tokens2.component?.badge;
|
|
934
|
-
if (badge) {
|
|
935
|
-
BADGE_VARIANTS.forEach(({ variant, bgKey, textKey }) => {
|
|
936
|
-
assign(toVariableName(prefix, "badge", variant, "bg"), badge[bgKey]);
|
|
937
|
-
assign(toVariableName(prefix, "badge", variant, "text"), badge[textKey]);
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
const iconBox = tokens2.component?.iconBox;
|
|
941
|
-
if (iconBox) {
|
|
942
|
-
ICON_BOX_FIELDS.forEach(({ name, tokenKey }) => {
|
|
943
|
-
assign(toVariableName(prefix, "icon-box", name), iconBox[tokenKey]);
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
977
|
Object.entries(baseTokens.shadows).forEach(([key, value]) => {
|
|
947
978
|
assign(toVariableName(prefix, "shadow", key), value);
|
|
948
979
|
});
|