@xsolla/switch-theme-customization 0.165.0 → 0.167.0-pr315.1780550581

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/index.d.mts CHANGED
@@ -171,54 +171,6 @@ interface Typography {
171
171
  };
172
172
  }
173
173
 
174
- type GlobalStyles = 'switch' | 'brand' | 'publisherV2' | 'influencerAccount' | 'lightstream' | 'pentagram';
175
- interface Theme {
176
- colors: Colors$1<string>;
177
- typo: Typography;
178
- misc: Misc;
179
- shadows: Shadows;
180
- typoMobile?: Typography;
181
- typoTablet?: Typography;
182
- globalStyle?: GlobalStyles;
183
- }
184
- type ThemeVariant = Pick<Theme, 'colors'>;
185
-
186
- type Size = 'sm' | 'md' | 'lg';
187
-
188
- declare const paystation4: Theme;
189
- declare const paystation4Dark: Theme;
190
- declare const paystation4Take2: Theme;
191
- declare const paystation4Gaijin: Theme;
192
- declare const paystation4Nexters: Theme;
193
- declare const paystation4Themes: {
194
- light: Theme;
195
- dark: Theme;
196
- take2: Theme;
197
- gaijin: Theme;
198
- nexters: Theme;
199
- };
200
-
201
- declare const publisherV2: Theme;
202
- declare const publisherV2Dark: Theme;
203
- declare const publisherV2Themes: {
204
- light: Theme;
205
- dark: Theme;
206
- };
207
-
208
- declare const emails: Theme;
209
- declare const emailsDark: Theme;
210
- declare const emailsThemes: {
211
- light: Theme;
212
- dark: Theme;
213
- };
214
-
215
- declare const themesBaseColorsArray: {
216
- theme: string;
217
- baseColors: BaseColors<colord.Colord>;
218
- }[];
219
- declare const themesBaseColors: Record<string, BaseColors>;
220
- declare const themesColorsScheme: Record<string, (base: BaseColors) => void>;
221
-
222
174
  interface PentagramBaseColors {
223
175
  content: Colord;
224
176
  contentInverse: Colord;
@@ -240,6 +192,9 @@ interface PentagramBaseColors {
240
192
  onAlert: Colord;
241
193
  onNeutral: Colord;
242
194
  }
195
+ type PentagramBaseColorsHsl = {
196
+ [K in keyof PentagramBaseColors]: string;
197
+ };
243
198
  interface ControlVariant {
244
199
  bg: string;
245
200
  bgHover: string;
@@ -253,6 +208,7 @@ interface ControlVariantWithDisable extends ControlVariant {
253
208
  borderDisable: string;
254
209
  }
255
210
  interface ThemeScheme {
211
+ base: PentagramBaseColorsHsl;
256
212
  background: {
257
213
  primary: string;
258
214
  secondary: string;
@@ -442,7 +398,11 @@ interface ThemeScheme {
442
398
  knob: {
443
399
  bg: string;
444
400
  bgHover: string;
401
+ bgActive: string;
402
+ bgActiveHover: string;
445
403
  bgInactive: string;
404
+ bgInactiveHover: string;
405
+ bgDisable: string;
446
406
  };
447
407
  text: {
448
408
  primary: string;
@@ -480,14 +440,634 @@ interface ThemeScheme {
480
440
  };
481
441
  }
482
442
  type PresetName = string;
443
+ /** Canonical pentagram colors in DB / themeContentPentagram (scheme output without seed `base`). */
444
+ type ThemeSchemeColors = Omit<ThemeScheme, "base">;
445
+
446
+ var heading = {
447
+ h1: {
448
+ fontSize: "450",
449
+ lineHeight: "display/450",
450
+ fontWeight: 700
451
+ },
452
+ h2: {
453
+ fontSize: "350",
454
+ lineHeight: "display/350",
455
+ fontWeight: 700
456
+ },
457
+ h3: {
458
+ fontSize: "300",
459
+ lineHeight: "display/300",
460
+ fontWeight: 700
461
+ },
462
+ h4: {
463
+ fontSize: "250",
464
+ lineHeight: "display/250",
465
+ fontWeight: 700
466
+ },
467
+ h5: {
468
+ fontSize: "200",
469
+ lineHeight: "display/200",
470
+ fontWeight: 700
471
+ }
472
+ };
473
+ var basic = {
474
+ display: {
475
+ fontFamily: "compact",
476
+ fontSize: "300",
477
+ lineHeight: "compact/300",
478
+ fontWeight: 500
479
+ },
480
+ bodyLg: {
481
+ fontSize: "175",
482
+ lineHeight: "compact/175",
483
+ "default": {
484
+ fontWeight: 400
485
+ },
486
+ accent: {
487
+ fontWeight: 500
488
+ },
489
+ paragraph: {
490
+ spacing: "spacing/250",
491
+ lineHeight: "text/175"
492
+ }
493
+ },
494
+ bodyMd: {
495
+ fontSize: "150",
496
+ lineHeight: "compact/150",
497
+ "default": {
498
+ fontWeight: 400
499
+ },
500
+ accent: {
501
+ fontWeight: 500
502
+ },
503
+ paragraph: {
504
+ spacing: "spacing/200",
505
+ lineHeight: "text/150"
506
+ }
507
+ },
508
+ bodySm: {
509
+ fontSize: "125",
510
+ lineHeight: "compact/125",
511
+ "default": {
512
+ fontWeight: 400
513
+ },
514
+ accent: {
515
+ fontWeight: 500
516
+ },
517
+ paragraph: {
518
+ spacing: "spacing/150",
519
+ lineHeight: "text/125"
520
+ }
521
+ },
522
+ bodyXs: {
523
+ fontSize: "100",
524
+ lineHeight: "compact/100",
525
+ "default": {
526
+ fontWeight: 400
527
+ },
528
+ accent: {
529
+ fontWeight: 500
530
+ },
531
+ paragraph: {
532
+ spacing: "spacing/100",
533
+ lineHeight: "text/100"
534
+ }
535
+ },
536
+ bodyXxs: {
537
+ fontSize: "75",
538
+ lineHeight: "compact/75",
539
+ "default": {
540
+ fontWeight: 400
541
+ },
542
+ accent: {
543
+ fontWeight: 500
544
+ },
545
+ paragraph: {
546
+ spacing: "spacing/75",
547
+ lineHeight: "text/75"
548
+ }
549
+ }
550
+ };
551
+ var control = {
552
+ button: {
553
+ xl: {
554
+ scale: "600"
555
+ },
556
+ lg: {
557
+ scale: "500"
558
+ },
559
+ md: {
560
+ scale: "400"
561
+ },
562
+ sm: {
563
+ scale: "300"
564
+ },
565
+ xs: {
566
+ scale: "200"
567
+ }
568
+ },
569
+ input: {
570
+ xl: {
571
+ scale: "600"
572
+ },
573
+ lg: {
574
+ scale: "500"
575
+ },
576
+ md: {
577
+ scale: "400"
578
+ },
579
+ sm: {
580
+ scale: "300"
581
+ },
582
+ xs: {
583
+ scale: "200"
584
+ }
585
+ },
586
+ checkbox: {
587
+ xl: {
588
+ scale: "600"
589
+ },
590
+ lg: {
591
+ scale: "500"
592
+ },
593
+ md: {
594
+ scale: "400"
595
+ },
596
+ sm: {
597
+ scale: "300"
598
+ }
599
+ },
600
+ tab: {
601
+ xl: {
602
+ scale: "600"
603
+ },
604
+ lg: {
605
+ scale: "500"
606
+ },
607
+ md: {
608
+ scale: "400"
609
+ },
610
+ sm: {
611
+ scale: "300"
612
+ },
613
+ xs: {
614
+ scale: "300"
615
+ }
616
+ },
617
+ radio: {
618
+ xl: {
619
+ scale: "600"
620
+ },
621
+ lg: {
622
+ scale: "500"
623
+ },
624
+ md: {
625
+ scale: "400"
626
+ },
627
+ sm: {
628
+ scale: "300"
629
+ }
630
+ },
631
+ segmentedItem: {
632
+ xl: {
633
+ scale: "500"
634
+ },
635
+ lg: {
636
+ scale: "400"
637
+ },
638
+ md: {
639
+ scale: "300"
640
+ },
641
+ sm: {
642
+ scale: "200"
643
+ }
644
+ },
645
+ tag: {
646
+ xl: {
647
+ scale: "600"
648
+ },
649
+ lg: {
650
+ scale: "500"
651
+ },
652
+ md: {
653
+ scale: "400"
654
+ },
655
+ sm: {
656
+ scale: "300"
657
+ },
658
+ xs: {
659
+ scale: "200"
660
+ }
661
+ },
662
+ toggleButton: {
663
+ xl: {
664
+ scale: "600"
665
+ },
666
+ lg: {
667
+ scale: "500"
668
+ },
669
+ md: {
670
+ scale: "400"
671
+ },
672
+ sm: {
673
+ scale: "300"
674
+ },
675
+ xs: {
676
+ scale: "200"
677
+ }
678
+ }
679
+ };
680
+ var typoPrimitives = {
681
+ heading: heading,
682
+ basic: basic,
683
+ control: control
684
+ };
685
+
686
+ var button = {
687
+ xl: {
688
+ borderRadius: "radius/100",
689
+ borderWidth: "stroke/1"
690
+ },
691
+ lg: {
692
+ borderRadius: "radius/100",
693
+ borderWidth: "stroke/1"
694
+ },
695
+ md: {
696
+ borderRadius: "radius/75",
697
+ borderWidth: "stroke/1"
698
+ },
699
+ sm: {
700
+ borderRadius: "radius/50",
701
+ borderWidth: "stroke/1"
702
+ },
703
+ xs: {
704
+ borderRadius: "radius/50",
705
+ borderWidth: "stroke/1"
706
+ }
707
+ };
708
+ var checkbox = {
709
+ xl: {
710
+ borderRadius: "radius/50",
711
+ borderWidth: "stroke/1"
712
+ },
713
+ lg: {
714
+ borderRadius: "radius/50",
715
+ borderWidth: "stroke/1"
716
+ },
717
+ md: {
718
+ borderRadius: "radius/50",
719
+ borderWidth: "stroke/1"
720
+ },
721
+ sm: {
722
+ borderRadius: "radius/50",
723
+ borderWidth: "stroke/1"
724
+ }
725
+ };
726
+ var input = {
727
+ xl: {
728
+ borderRadius: "radius/100",
729
+ borderWidth: "stroke/1"
730
+ },
731
+ lg: {
732
+ borderRadius: "radius/100",
733
+ borderWidth: "stroke/1"
734
+ },
735
+ md: {
736
+ borderRadius: "radius/100",
737
+ borderWidth: "stroke/1"
738
+ },
739
+ sm: {
740
+ borderRadius: "radius/50",
741
+ borderWidth: "stroke/1"
742
+ },
743
+ xs: {
744
+ borderRadius: "radius/50",
745
+ borderWidth: "stroke/1"
746
+ }
747
+ };
748
+ var cell = {
749
+ borderRadius: "radius/100",
750
+ borderWidth: "stroke/1"
751
+ };
752
+ var modal = {
753
+ borderRadius: "radius/100"
754
+ };
755
+ var toast = {
756
+ borderRadius: "radius/50",
757
+ borderWidth: "0px"
758
+ };
759
+ var segmentedItem = {
760
+ xl: {
761
+ borderRadius: "radius/50",
762
+ borderWidth: "stroke/1"
763
+ },
764
+ lg: {
765
+ borderRadius: "radius/50",
766
+ borderWidth: "stroke/1"
767
+ },
768
+ md: {
769
+ borderRadius: "radius/50",
770
+ borderWidth: "stroke/1"
771
+ },
772
+ sm: {
773
+ borderRadius: "radius/25",
774
+ borderWidth: "stroke/1"
775
+ }
776
+ };
777
+ var segmented = {
778
+ xl: {
779
+ borderRadius: "radius/100",
780
+ borderWidth: "stroke/1"
781
+ },
782
+ lg: {
783
+ borderRadius: "radius/100",
784
+ borderWidth: "stroke/1"
785
+ },
786
+ md: {
787
+ borderRadius: "radius/100",
788
+ borderWidth: "stroke/1"
789
+ },
790
+ sm: {
791
+ borderRadius: "radius/50",
792
+ borderWidth: "stroke/1"
793
+ }
794
+ };
795
+ var knob = {
796
+ xl: {
797
+ borderRadius: "radius/25"
798
+ },
799
+ lg: {
800
+ borderRadius: "radius/25"
801
+ },
802
+ md: {
803
+ borderRadius: "radius/25"
804
+ },
805
+ sm: {
806
+ borderRadius: "radius/25"
807
+ }
808
+ };
809
+ var tabItem = {
810
+ xl: {
811
+ borderRadius: "radius/100"
812
+ },
813
+ lg: {
814
+ borderRadius: "radius/100"
815
+ },
816
+ md: {
817
+ borderRadius: "radius/50"
818
+ },
819
+ sm: {
820
+ borderRadius: "radius/50"
821
+ }
822
+ };
823
+ var tag = {
824
+ xl: {
825
+ borderRadius: "radius/100",
826
+ borderWidth: "stroke/1"
827
+ },
828
+ lg: {
829
+ borderRadius: "radius/100",
830
+ borderWidth: "stroke/1"
831
+ },
832
+ md: {
833
+ borderRadius: "radius/75",
834
+ borderWidth: "stroke/1"
835
+ },
836
+ sm: {
837
+ borderRadius: "radius/50",
838
+ borderWidth: "stroke/1"
839
+ },
840
+ xs: {
841
+ borderRadius: "radius/50",
842
+ borderWidth: "stroke/1"
843
+ }
844
+ };
845
+ var tagLabel = {
846
+ borderRadius: "0px"
847
+ };
848
+ var tooltip = {
849
+ xl: {
850
+ borderRadius: "radius/100"
851
+ },
852
+ lg: {
853
+ borderRadius: "radius/100"
854
+ },
855
+ md: {
856
+ borderRadius: "radius/100"
857
+ },
858
+ sm: {
859
+ borderRadius: "radius/50"
860
+ }
861
+ };
862
+ var radio = {
863
+ xl: {
864
+ borderRadius: "radius/999",
865
+ borderWidth: "stroke/1"
866
+ },
867
+ lg: {
868
+ borderRadius: "radius/999",
869
+ borderWidth: "stroke/1"
870
+ },
871
+ md: {
872
+ borderRadius: "radius/999",
873
+ borderWidth: "stroke/1"
874
+ },
875
+ sm: {
876
+ borderRadius: "radius/999",
877
+ borderWidth: "stroke/1"
878
+ }
879
+ };
880
+ var contextMenu = {
881
+ xl: {
882
+ borderRadius: "radius/100"
883
+ },
884
+ lg: {
885
+ borderRadius: "radius/100"
886
+ },
887
+ md: {
888
+ borderRadius: "radius/100"
889
+ },
890
+ sm: {
891
+ borderRadius: "radius/50"
892
+ }
893
+ };
894
+ var avatar = {
895
+ xl: {
896
+ borderRadius: "radius/100",
897
+ borderWidth: "stroke/2"
898
+ },
899
+ lg: {
900
+ borderRadius: "radius/75",
901
+ borderWidth: "stroke/2"
902
+ },
903
+ md: {
904
+ borderRadius: "radius/75",
905
+ borderWidth: "stroke/2"
906
+ },
907
+ sm: {
908
+ borderRadius: "radius/50",
909
+ borderWidth: "stroke/2"
910
+ },
911
+ xs: {
912
+ borderRadius: "radius/50",
913
+ borderWidth: "stroke/2"
914
+ },
915
+ xxs: {
916
+ borderRadius: "radius/25",
917
+ borderWidth: "stroke/2"
918
+ }
919
+ };
920
+ var toggleButtonGroup = {
921
+ xl: {
922
+ borderRadius: "radius/100",
923
+ borderWidth: "stroke/1"
924
+ },
925
+ lg: {
926
+ borderRadius: "radius/100",
927
+ borderWidth: "stroke/1"
928
+ },
929
+ md: {
930
+ borderRadius: "radius/75",
931
+ borderWidth: "stroke/1"
932
+ },
933
+ sm: {
934
+ borderRadius: "radius/50",
935
+ borderWidth: "stroke/1"
936
+ },
937
+ xs: {
938
+ borderRadius: "radius/50",
939
+ borderWidth: "stroke/1"
940
+ }
941
+ };
942
+ var shapePrimitives = {
943
+ button: button,
944
+ checkbox: checkbox,
945
+ input: input,
946
+ cell: cell,
947
+ modal: modal,
948
+ toast: toast,
949
+ segmentedItem: segmentedItem,
950
+ segmented: segmented,
951
+ "switch": {
952
+ xl: {
953
+ borderRadius: "radius/50",
954
+ borderWidth: "stroke/1"
955
+ },
956
+ lg: {
957
+ borderRadius: "radius/50",
958
+ borderWidth: "stroke/1"
959
+ },
960
+ md: {
961
+ borderRadius: "radius/50",
962
+ borderWidth: "stroke/1"
963
+ },
964
+ sm: {
965
+ borderRadius: "radius/50",
966
+ borderWidth: "stroke/1"
967
+ }
968
+ },
969
+ knob: knob,
970
+ tabItem: tabItem,
971
+ tag: tag,
972
+ tagLabel: tagLabel,
973
+ tooltip: tooltip,
974
+ radio: radio,
975
+ contextMenu: contextMenu,
976
+ avatar: avatar,
977
+ toggleButtonGroup: toggleButtonGroup
978
+ };
979
+
980
+ type TypoPrimitives = typeof typoPrimitives;
981
+ type ShapePrimitives = typeof shapePrimitives;
982
+
983
+ type GlobalStyles = "switch" | "brand" | "publisherV2" | "influencerAccount" | "lightstream" | "pentagram";
984
+ interface Theme {
985
+ colors: Colors$1<string>;
986
+ typo: Typography;
987
+ misc: Misc;
988
+ shadows: Shadows;
989
+ typoMobile?: Typography;
990
+ typoTablet?: Typography;
991
+ globalStyle?: GlobalStyles;
992
+ }
993
+ interface PentagramTheme {
994
+ colors: ThemeScheme;
995
+ typo: TypoPrimitives;
996
+ shape: ShapePrimitives;
997
+ shadows: Shadows;
998
+ globalStyle?: GlobalStyles;
999
+ }
1000
+ type ThemeVariant = Pick<Theme, "colors">;
1001
+
1002
+ type Size = 'sm' | 'md' | 'lg';
1003
+
1004
+ declare const paystation4: Theme;
1005
+ declare const paystation4Dark: Theme;
1006
+ declare const paystation4Take2: Theme;
1007
+ declare const paystation4Gaijin: Theme;
1008
+ declare const paystation4Nexters: Theme;
1009
+ declare const paystation4Themes: {
1010
+ light: Theme;
1011
+ dark: Theme;
1012
+ take2: Theme;
1013
+ gaijin: Theme;
1014
+ nexters: Theme;
1015
+ };
1016
+
1017
+ declare const publisherV2: Theme;
1018
+ declare const publisherV2Dark: Theme;
1019
+ declare const publisherV2Themes: {
1020
+ light: Theme;
1021
+ dark: Theme;
1022
+ };
1023
+
1024
+ declare const emails: Theme;
1025
+ declare const emailsDark: Theme;
1026
+ declare const emailsThemes: {
1027
+ light: Theme;
1028
+ dark: Theme;
1029
+ };
1030
+
1031
+ declare const themesBaseColorsArray: {
1032
+ theme: string;
1033
+ baseColors: BaseColors<colord.Colord>;
1034
+ }[];
1035
+ declare const themesBaseColors: Record<string, BaseColors>;
1036
+ declare const themesColorsScheme: Record<string, (base: BaseColors) => void>;
1037
+
1038
+ /**
1039
+ * Mapped LIGHT scheme from new to old set of variables
1040
+ */
1041
+ declare const paystation4PentagramLightLegacyCompatible: Theme;
1042
+ /**
1043
+ * Mapped DARK scheme from new to old set of variables
1044
+ */
1045
+ declare const paystation4PentagramDarkLegacyCompatible: Theme;
1046
+ declare const paystation4PentagramLight: PentagramTheme;
1047
+ declare const paystation4PentagramDark: PentagramTheme;
483
1048
 
484
1049
  declare const baseDark: PentagramBaseColors;
485
- declare const createDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
486
- declare const payStationDarkScheme: ThemeScheme;
1050
+ declare const pentagramDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
1051
+ declare const pentagramDark: ThemeScheme;
487
1052
 
488
1053
  declare const base: PentagramBaseColors;
489
- declare const createScheme: (b: PentagramBaseColors) => ThemeScheme;
490
- declare const payStationScheme: ThemeScheme;
1054
+ declare const pentagramLightScheme: (b: PentagramBaseColors) => ThemeScheme;
1055
+ declare const pentagramLight: ThemeScheme;
1056
+
1057
+ /**
1058
+ * Maps Pentagram colors → legacy Switch Colors structure.
1059
+ *
1060
+ * Converts `themeContentPentagram.colors` (nested ThemeSchemeColors)
1061
+ * to the legacy format so products on the old variable set keep working.
1062
+ *
1063
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
1064
+ */
1065
+
1066
+ /**
1067
+ * @param colors Pentagram colors from DB or generated scheme (without seed `base`)
1068
+ * @returns Legacy colors without `base` (seed colors are added separately)
1069
+ */
1070
+ declare function mapThemeSchemeToLegacy(colors: ThemeSchemeColors): Pick<Colors$1<string>, "core" | "control">;
491
1071
 
492
1072
  declare const themes: Record<string, Theme>;
493
1073
 
@@ -1964,4 +2544,313 @@ declare function themeGenerator(props: {
1964
2544
  }): ThemeScheme;
1965
2545
  declare function themeGenerator(props: ThemeFunctionType): Theme;
1966
2546
 
1967
- export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, type Misc, type PentagramBaseColors, type PresetName, type Shadows, type Size, type Theme, type ThemeFunctionType, type ThemeScheme, type ThemeVariant, type Typography, base, baseDark, createDarkScheme, createScheme, emails, emailsDark, emailsThemes, generateWithScheme, palettes, payStationDarkScheme, payStationScheme, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4Take2, paystation4Themes, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme };
2547
+ /**
2548
+ * Resolves Pentagram design token aliases to concrete CSS values.
2549
+ *
2550
+ * Source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2551
+ * Scale tables: see FONT_SIZE_SCALE and LINE_HEIGHT_* constants below.
2552
+ *
2553
+ * This resolver converts aliases like "font-size/300" → "28px" (desktop) or "24px" (mobile).
2554
+ * It is used BEFORE the mappers (mapPentagramTypoToLegacy, mapPentagramShapeToLegacy).
2555
+ *
2556
+ * @example
2557
+ * ```typescript
2558
+ * const resolver = new PentagramResolver('desktop');
2559
+ * const resolvedTypo = resolver.resolvePrimitives(themeContentPentagram.typo);
2560
+ * const legacyTypo = mapPentagramTypoToLegacy(resolvedTypo);
2561
+ * ```
2562
+ */
2563
+ type Device = "desktop" | "mobile";
2564
+ declare class PentagramResolver {
2565
+ private device;
2566
+ constructor(device?: Device);
2567
+ setDevice(device: Device): void;
2568
+ /**
2569
+ * Resolve a single alias to a concrete value.
2570
+ *
2571
+ * @param alias - Alias string like "300" (fontSize), "display/300" (lineHeight), or "radius/100"
2572
+ * @param context - Optional context hint: 'fontSize' or 'lineHeight'
2573
+ * @returns Resolved value (e.g., "28px") or original if not an alias
2574
+ */
2575
+ resolve(alias: string | number, context?: "fontSize" | "lineHeight"): string | number;
2576
+ /**
2577
+ * Recursively resolve all aliases in an object.
2578
+ *
2579
+ * @param obj - Object containing alias strings
2580
+ * @returns New object with all aliases resolved to concrete values
2581
+ */
2582
+ resolvePrimitives<T>(obj: T): T;
2583
+ /**
2584
+ * Check if a value is already resolved (not an alias).
2585
+ */
2586
+ private isResolved;
2587
+ }
2588
+ /**
2589
+ * Create a resolver for the given device.
2590
+ *
2591
+ * @param device - 'desktop' (default) or 'mobile'
2592
+ * @returns PentagramResolver instance
2593
+ *
2594
+ * @example
2595
+ * ```typescript
2596
+ * const resolver = createResolver('desktop');
2597
+ * const resolved = resolver.resolvePrimitives(pentagramTypo);
2598
+ * ```
2599
+ */
2600
+ declare function createResolver(device?: Device): PentagramResolver;
2601
+ /**
2602
+ * Resolve all aliases in a Pentagram primitives object for desktop device.
2603
+ * Convenience function for the most common case.
2604
+ *
2605
+ * @example
2606
+ * ```typescript
2607
+ * const resolvedTypo = resolveForDesktop(themeContentPentagram.typo);
2608
+ * ```
2609
+ */
2610
+ declare function resolveForDesktop<T>(obj: T): T;
2611
+ /**
2612
+ * Resolve all aliases in a Pentagram primitives object for mobile device.
2613
+ */
2614
+ declare function resolveForMobile<T>(obj: T): T;
2615
+
2616
+ /**
2617
+ * Maps Pentagram Typography → Legacy Typography structure.
2618
+ *
2619
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2620
+ *
2621
+ * Used for themes that have themeContentPentagram.typo (new set).
2622
+ * Converts to themeContent.typo (old set) so that Pay Station 4 keeps working.
2623
+ *
2624
+ * NOTE: This mapper expects RESOLVED values (px), not aliases like "font-size/300".
2625
+ * Use PentagramResolver to resolve aliases before calling this mapper.
2626
+ */
2627
+ interface TypographyStyle {
2628
+ fontSize: string;
2629
+ lineHeight: string;
2630
+ fontWeight?: number;
2631
+ textTransform?: string;
2632
+ [key: string]: string | number | undefined;
2633
+ }
2634
+ interface PentagramTypoBasicVariant {
2635
+ fontSize: string;
2636
+ lineHeight: string;
2637
+ default?: {
2638
+ fontWeight: number;
2639
+ };
2640
+ accent?: {
2641
+ fontWeight: number;
2642
+ };
2643
+ paragraph?: {
2644
+ spacing?: string;
2645
+ lineHeight?: string;
2646
+ };
2647
+ }
2648
+ /** Resolved control size (after PentagramResolver expands `{ scale: "400" }`). */
2649
+ type PentagramTypoControlSize = Pick<TypographyStyle, "fontSize" | "lineHeight">;
2650
+ /**
2651
+ * Pentagram Typography structure (from themeContentPentagram.typo)
2652
+ */
2653
+ interface PentagramTypo {
2654
+ heading: {
2655
+ h1: TypographyStyle;
2656
+ h2: TypographyStyle;
2657
+ h3: TypographyStyle;
2658
+ h4: TypographyStyle;
2659
+ h5: TypographyStyle;
2660
+ };
2661
+ basic: {
2662
+ display: TypographyStyle & {
2663
+ fontFamily?: string;
2664
+ };
2665
+ bodyLg: PentagramTypoBasicVariant;
2666
+ bodyMd: PentagramTypoBasicVariant;
2667
+ bodySm: PentagramTypoBasicVariant;
2668
+ bodyXs: PentagramTypoBasicVariant;
2669
+ bodyXxs: PentagramTypoBasicVariant;
2670
+ };
2671
+ control: {
2672
+ button: Record<string, PentagramTypoControlSize>;
2673
+ input: Record<string, PentagramTypoControlSize>;
2674
+ checkbox: Record<string, PentagramTypoControlSize>;
2675
+ tab: Record<string, PentagramTypoControlSize>;
2676
+ radio: Record<string, PentagramTypoControlSize>;
2677
+ segmentedItem?: Record<string, PentagramTypoControlSize>;
2678
+ tag?: Record<string, PentagramTypoControlSize>;
2679
+ toggleButton?: Record<string, PentagramTypoControlSize>;
2680
+ };
2681
+ }
2682
+ /**
2683
+ * Legacy Typography structure (themeContent.typo)
2684
+ */
2685
+ interface LegacyTypo {
2686
+ fontFamily: string;
2687
+ core: {
2688
+ h1: TypographyStyle;
2689
+ h2: TypographyStyle;
2690
+ h3: TypographyStyle;
2691
+ h4: TypographyStyle;
2692
+ bodyMd: TypographyStyle;
2693
+ bodyMdAccent: TypographyStyle;
2694
+ bodyLg: TypographyStyle;
2695
+ bodyLgAccent: TypographyStyle;
2696
+ paragraph: TypographyStyle;
2697
+ label: TypographyStyle;
2698
+ minor: TypographyStyle;
2699
+ strong: TypographyStyle;
2700
+ };
2701
+ components: {
2702
+ button: Record<string, TypographyStyle>;
2703
+ input: Record<string, TypographyStyle>;
2704
+ tab: Record<string, TypographyStyle>;
2705
+ check: Record<string, TypographyStyle>;
2706
+ label: Record<string, TypographyStyle>;
2707
+ };
2708
+ }
2709
+ /**
2710
+ * Maps Pentagram typography to legacy typography structure.
2711
+ *
2712
+ * @param pentagram - Pentagram typography (RESOLVED values, not aliases)
2713
+ * @param fontFamily - Optional custom font family (defaults to GraphikLCWebUikit)
2714
+ * @returns Legacy typography structure for themeContent.typo
2715
+ *
2716
+ * @example
2717
+ * ```typescript
2718
+ * // First resolve aliases
2719
+ * const resolver = new PentagramResolver('desktop');
2720
+ * const resolvedTypo = resolver.resolvePrimitives(themeContentPentagram.typo);
2721
+ *
2722
+ * // Then map to legacy
2723
+ * const legacyTypo = mapPentagramTypoToLegacy(resolvedTypo);
2724
+ * ```
2725
+ */
2726
+ declare function mapPentagramTypoToLegacy(pentagram: PentagramTypo, fontFamily?: string): LegacyTypo;
2727
+ /**
2728
+ * These legacy variables are DELETED in Pentagram and should NOT be mapped:
2729
+ *
2730
+ * - components.heading (sm/md/lg) — was uppercase labels, not used in PS4
2731
+ * - components.fieldGroup (sm/md/lg) — never used in PS4
2732
+ * - core.strong — never used in PS4
2733
+ * - core.bodyLg — replaced by bodyLgAccent (only accent variant used)
2734
+ *
2735
+ * If PS4 code still references these variables, it will fall back to
2736
+ * default CSS values from design-typography-variables.scss
2737
+ */
2738
+ declare const DELETED_LEGACY_TYPO_VARS: readonly ["components.heading", "components.fieldGroup", "core.strong", "core.bodyLg"];
2739
+
2740
+ /**
2741
+ * Maps Pentagram Shape → Legacy Misc structure.
2742
+ *
2743
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2744
+ *
2745
+ * Pentagram has per-component, per-size shape tokens (button.xl.borderRadius, etc).
2746
+ * Legacy misc has single borderRadius per component type (borderRadius.button).
2747
+ *
2748
+ * This mapper uses the "md" size as default for legacy compatibility.
2749
+ *
2750
+ * NOTE: This mapper expects RESOLVED values (px), not aliases like "radius/100".
2751
+ * Use PentagramResolver to resolve aliases before calling this mapper.
2752
+ */
2753
+ interface PentagramShapeSize {
2754
+ borderRadius?: string;
2755
+ borderWidth?: string;
2756
+ }
2757
+ interface PentagramShape {
2758
+ button?: Record<string, PentagramShapeSize>;
2759
+ checkbox?: Record<string, PentagramShapeSize>;
2760
+ input?: Record<string, PentagramShapeSize>;
2761
+ cell?: PentagramShapeSize;
2762
+ modal?: PentagramShapeSize;
2763
+ toast?: PentagramShapeSize;
2764
+ segmentedItem?: Record<string, PentagramShapeSize>;
2765
+ segmented?: Record<string, PentagramShapeSize>;
2766
+ switch?: Record<string, PentagramShapeSize>;
2767
+ knob?: Record<string, {
2768
+ borderRadius?: string;
2769
+ }>;
2770
+ tabItem?: Record<string, PentagramShapeSize>;
2771
+ tag?: Record<string, PentagramShapeSize>;
2772
+ tagLabel?: {
2773
+ borderRadius?: string;
2774
+ };
2775
+ tooltip?: Record<string, PentagramShapeSize>;
2776
+ radio?: Record<string, PentagramShapeSize>;
2777
+ contextMenu?: Record<string, PentagramShapeSize>;
2778
+ avatar?: Record<string, PentagramShapeSize>;
2779
+ toggleButtonGroup?: Record<string, PentagramShapeSize>;
2780
+ }
2781
+ interface LegacyMisc {
2782
+ borderRadiusScale: {
2783
+ sm: string;
2784
+ md: string;
2785
+ lg: string;
2786
+ xl: string;
2787
+ };
2788
+ borderWidth: string;
2789
+ borderRadius: {
2790
+ input: string;
2791
+ button: string;
2792
+ buttonIcon: string;
2793
+ popup: string;
2794
+ checkbox: string;
2795
+ tag: string;
2796
+ };
2797
+ minWidth: {
2798
+ button: string;
2799
+ };
2800
+ }
2801
+ /**
2802
+ * Maps Pentagram shape to legacy misc structure.
2803
+ *
2804
+ * @param pentagram - Pentagram shape (RESOLVED values, not aliases)
2805
+ * @param existingMisc - Optional existing misc to merge with (preserves non-shape values)
2806
+ * @returns Legacy misc structure for themeContent.misc
2807
+ *
2808
+ * @example
2809
+ * ```typescript
2810
+ * // First resolve aliases
2811
+ * const resolver = new PentagramResolver('desktop');
2812
+ * const resolvedShape = resolver.resolvePrimitives(themeContentPentagram.shape);
2813
+ *
2814
+ * // Then map to legacy
2815
+ * const legacyMisc = mapPentagramShapeToLegacy(resolvedShape);
2816
+ * ```
2817
+ */
2818
+ declare function mapPentagramShapeToLegacy(pentagram: PentagramShape, existingMisc?: Partial<LegacyMisc>): LegacyMisc;
2819
+ /**
2820
+ * If PS4 adopts per-size CSS variables (--shape-button-md-borderRadius),
2821
+ * this function can generate them directly from Pentagram shape.
2822
+ *
2823
+ * This is for future use when PS4 migrates to granular shape tokens.
2824
+ */
2825
+ declare function flattenPentagramShapeToVars(pentagram: PentagramShape): Record<string, string>;
2826
+
2827
+ /**
2828
+ * Orchestrator: maps full themeContentPentagram → legacy themeContent.
2829
+ *
2830
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2831
+ */
2832
+
2833
+ interface PentagramThemeContent {
2834
+ colors: ThemeSchemeColors;
2835
+ typo: PentagramTypo;
2836
+ shape: PentagramShape;
2837
+ shadows?: Shadows;
2838
+ }
2839
+ interface LegacyThemeContent {
2840
+ colors: Colors$1<string>;
2841
+ typo: LegacyTypo;
2842
+ misc: LegacyMisc;
2843
+ shadows?: Shadows;
2844
+ }
2845
+ /**
2846
+ * Builds legacy `base` seed colors from Pentagram colors.
2847
+ * See Variables mapping table → base.* section.
2848
+ */
2849
+ declare function buildBaseColorsFromPentagram(colors: ThemeSchemeColors): BaseColors<string>;
2850
+ /**
2851
+ * Maps full themeContentPentagram to legacy themeContent.
2852
+ * Resolves typo/shape aliases to absolute values before mapping.
2853
+ */
2854
+ declare function mapPentagramThemeToLegacy(pentagram: PentagramThemeContent, device?: Device): LegacyThemeContent;
2855
+
2856
+ export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, DELETED_LEGACY_TYPO_VARS, type Device, type LegacyMisc, type LegacyThemeContent, type LegacyTypo, type Misc, type PentagramBaseColors, type PentagramBaseColorsHsl, PentagramResolver, type PentagramShape, type PentagramThemeContent, type PentagramTypo, type PresetName, type Shadows, type ShapePrimitives, type Size, type Theme, type ThemeFunctionType, type ThemeScheme, type ThemeSchemeColors, type ThemeVariant, type TypoPrimitives, type Typography, type TypographyStyle, base, baseDark, buildBaseColorsFromPentagram, createResolver, emails, emailsDark, emailsThemes, flattenPentagramShapeToVars, generateWithScheme, mapPentagramShapeToLegacy, mapPentagramThemeToLegacy, mapPentagramTypoToLegacy, mapThemeSchemeToLegacy, palettes, paystation4, paystation4Dark, paystation4Gaijin, paystation4Nexters, paystation4PentagramDark, paystation4PentagramDarkLegacyCompatible, paystation4PentagramLight, paystation4PentagramLightLegacyCompatible, paystation4Take2, paystation4Themes, pentagramDark, pentagramDarkScheme, pentagramLight, pentagramLightScheme, primaryPalette, publisherV2, publisherV2Dark, publisherV2Themes, resolveForDesktop, resolveForMobile, shapePrimitives, themeGenerator, themes, themesBaseColors, themesBaseColorsArray, themesColorsScheme, typoPrimitives };