@xsolla/switch-theme-customization 0.161.3 → 0.162.0-pr320.1780402460

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;
@@ -481,13 +441,616 @@ interface ThemeScheme {
481
441
  }
482
442
  type PresetName = string;
483
443
 
444
+ var heading = {
445
+ h1: {
446
+ fontSize: "450",
447
+ lineHeight: "display/450",
448
+ fontWeight: 700
449
+ },
450
+ h2: {
451
+ fontSize: "350",
452
+ lineHeight: "display/350",
453
+ fontWeight: 700
454
+ },
455
+ h3: {
456
+ fontSize: "300",
457
+ lineHeight: "display/300",
458
+ fontWeight: 700
459
+ },
460
+ h4: {
461
+ fontSize: "250",
462
+ lineHeight: "display/250",
463
+ fontWeight: 700
464
+ },
465
+ h5: {
466
+ fontSize: "200",
467
+ lineHeight: "display/200",
468
+ fontWeight: 700
469
+ }
470
+ };
471
+ var basic = {
472
+ display: {
473
+ fontFamily: "compact",
474
+ fontSize: "300",
475
+ lineHeight: "compact/300",
476
+ fontWeight: 500
477
+ },
478
+ bodyLg: {
479
+ fontSize: "175",
480
+ lineHeight: "compact/175",
481
+ "default": {
482
+ fontWeight: 400
483
+ },
484
+ accent: {
485
+ fontWeight: 500
486
+ },
487
+ paragraph: {
488
+ spacing: "spacing/250",
489
+ lineHeight: "text/175"
490
+ }
491
+ },
492
+ bodyMd: {
493
+ fontSize: "150",
494
+ lineHeight: "compact/150",
495
+ "default": {
496
+ fontWeight: 400
497
+ },
498
+ accent: {
499
+ fontWeight: 500
500
+ },
501
+ paragraph: {
502
+ spacing: "spacing/200",
503
+ lineHeight: "text/150"
504
+ }
505
+ },
506
+ bodySm: {
507
+ fontSize: "125",
508
+ lineHeight: "compact/125",
509
+ "default": {
510
+ fontWeight: 400
511
+ },
512
+ accent: {
513
+ fontWeight: 500
514
+ },
515
+ paragraph: {
516
+ spacing: "spacing/150",
517
+ lineHeight: "text/125"
518
+ }
519
+ },
520
+ bodyXs: {
521
+ fontSize: "100",
522
+ lineHeight: "compact/100",
523
+ "default": {
524
+ fontWeight: 400
525
+ },
526
+ accent: {
527
+ fontWeight: 500
528
+ },
529
+ paragraph: {
530
+ spacing: "spacing/100",
531
+ lineHeight: "text/100"
532
+ }
533
+ },
534
+ bodyXxs: {
535
+ fontSize: "75",
536
+ lineHeight: "compact/75",
537
+ "default": {
538
+ fontWeight: 400
539
+ },
540
+ accent: {
541
+ fontWeight: 500
542
+ },
543
+ paragraph: {
544
+ spacing: "spacing/75",
545
+ lineHeight: "text/75"
546
+ }
547
+ }
548
+ };
549
+ var control = {
550
+ button: {
551
+ xl: {
552
+ scale: "600"
553
+ },
554
+ lg: {
555
+ scale: "500"
556
+ },
557
+ md: {
558
+ scale: "400"
559
+ },
560
+ sm: {
561
+ scale: "300"
562
+ },
563
+ xs: {
564
+ scale: "200"
565
+ }
566
+ },
567
+ input: {
568
+ xl: {
569
+ scale: "600"
570
+ },
571
+ lg: {
572
+ scale: "500"
573
+ },
574
+ md: {
575
+ scale: "400"
576
+ },
577
+ sm: {
578
+ scale: "300"
579
+ },
580
+ xs: {
581
+ scale: "200"
582
+ }
583
+ },
584
+ checkbox: {
585
+ xl: {
586
+ scale: "600"
587
+ },
588
+ lg: {
589
+ scale: "500"
590
+ },
591
+ md: {
592
+ scale: "400"
593
+ },
594
+ sm: {
595
+ scale: "300"
596
+ }
597
+ },
598
+ tab: {
599
+ xl: {
600
+ scale: "600"
601
+ },
602
+ lg: {
603
+ scale: "500"
604
+ },
605
+ md: {
606
+ scale: "400"
607
+ },
608
+ sm: {
609
+ scale: "300"
610
+ },
611
+ xs: {
612
+ scale: "300"
613
+ }
614
+ },
615
+ radio: {
616
+ xl: {
617
+ scale: "600"
618
+ },
619
+ lg: {
620
+ scale: "500"
621
+ },
622
+ md: {
623
+ scale: "400"
624
+ },
625
+ sm: {
626
+ scale: "300"
627
+ }
628
+ },
629
+ segmentedItem: {
630
+ xl: {
631
+ scale: "500"
632
+ },
633
+ lg: {
634
+ scale: "400"
635
+ },
636
+ md: {
637
+ scale: "300"
638
+ },
639
+ sm: {
640
+ scale: "200"
641
+ }
642
+ },
643
+ tag: {
644
+ xl: {
645
+ scale: "600"
646
+ },
647
+ lg: {
648
+ scale: "500"
649
+ },
650
+ md: {
651
+ scale: "400"
652
+ },
653
+ sm: {
654
+ scale: "300"
655
+ },
656
+ xs: {
657
+ scale: "200"
658
+ }
659
+ },
660
+ toggleButton: {
661
+ xl: {
662
+ scale: "600"
663
+ },
664
+ lg: {
665
+ scale: "500"
666
+ },
667
+ md: {
668
+ scale: "400"
669
+ },
670
+ sm: {
671
+ scale: "300"
672
+ },
673
+ xs: {
674
+ scale: "200"
675
+ }
676
+ }
677
+ };
678
+ var typoPrimitives = {
679
+ heading: heading,
680
+ basic: basic,
681
+ control: control
682
+ };
683
+
684
+ var button = {
685
+ xl: {
686
+ borderRadius: "radius/100",
687
+ borderWidth: "stroke/1"
688
+ },
689
+ lg: {
690
+ borderRadius: "radius/100",
691
+ borderWidth: "stroke/1"
692
+ },
693
+ md: {
694
+ borderRadius: "radius/75",
695
+ borderWidth: "stroke/1"
696
+ },
697
+ sm: {
698
+ borderRadius: "radius/50",
699
+ borderWidth: "stroke/1"
700
+ },
701
+ xs: {
702
+ borderRadius: "radius/50",
703
+ borderWidth: "stroke/1"
704
+ }
705
+ };
706
+ var checkbox = {
707
+ xl: {
708
+ borderRadius: "radius/50",
709
+ borderWidth: "stroke/1"
710
+ },
711
+ lg: {
712
+ borderRadius: "radius/50",
713
+ borderWidth: "stroke/1"
714
+ },
715
+ md: {
716
+ borderRadius: "radius/50",
717
+ borderWidth: "stroke/1"
718
+ },
719
+ sm: {
720
+ borderRadius: "radius/50",
721
+ borderWidth: "stroke/1"
722
+ }
723
+ };
724
+ var input = {
725
+ xl: {
726
+ borderRadius: "radius/100",
727
+ borderWidth: "stroke/1"
728
+ },
729
+ lg: {
730
+ borderRadius: "radius/100",
731
+ borderWidth: "stroke/1"
732
+ },
733
+ md: {
734
+ borderRadius: "radius/100",
735
+ borderWidth: "stroke/1"
736
+ },
737
+ sm: {
738
+ borderRadius: "radius/50",
739
+ borderWidth: "stroke/1"
740
+ },
741
+ xs: {
742
+ borderRadius: "radius/50",
743
+ borderWidth: "stroke/1"
744
+ }
745
+ };
746
+ var cell = {
747
+ borderRadius: "radius/100",
748
+ borderWidth: "stroke/1"
749
+ };
750
+ var modal = {
751
+ borderRadius: "radius/100"
752
+ };
753
+ var toast = {
754
+ borderRadius: "radius/50",
755
+ borderWidth: "0px"
756
+ };
757
+ var segmentedItem = {
758
+ xl: {
759
+ borderRadius: "radius/50",
760
+ borderWidth: "stroke/1"
761
+ },
762
+ lg: {
763
+ borderRadius: "radius/50",
764
+ borderWidth: "stroke/1"
765
+ },
766
+ md: {
767
+ borderRadius: "radius/50",
768
+ borderWidth: "stroke/1"
769
+ },
770
+ sm: {
771
+ borderRadius: "radius/25",
772
+ borderWidth: "stroke/1"
773
+ }
774
+ };
775
+ var segmented = {
776
+ xl: {
777
+ borderRadius: "radius/100",
778
+ borderWidth: "stroke/1"
779
+ },
780
+ lg: {
781
+ borderRadius: "radius/100",
782
+ borderWidth: "stroke/1"
783
+ },
784
+ md: {
785
+ borderRadius: "radius/100",
786
+ borderWidth: "stroke/1"
787
+ },
788
+ sm: {
789
+ borderRadius: "radius/50",
790
+ borderWidth: "stroke/1"
791
+ }
792
+ };
793
+ var knob = {
794
+ xl: {
795
+ borderRadius: "radius/25"
796
+ },
797
+ lg: {
798
+ borderRadius: "radius/25"
799
+ },
800
+ md: {
801
+ borderRadius: "radius/25"
802
+ },
803
+ sm: {
804
+ borderRadius: "radius/25"
805
+ }
806
+ };
807
+ var tabItem = {
808
+ xl: {
809
+ borderRadius: "radius/100"
810
+ },
811
+ lg: {
812
+ borderRadius: "radius/100"
813
+ },
814
+ md: {
815
+ borderRadius: "radius/50"
816
+ },
817
+ sm: {
818
+ borderRadius: "radius/50"
819
+ }
820
+ };
821
+ var tag = {
822
+ xl: {
823
+ borderRadius: "radius/100",
824
+ borderWidth: "stroke/1"
825
+ },
826
+ lg: {
827
+ borderRadius: "radius/100",
828
+ borderWidth: "stroke/1"
829
+ },
830
+ md: {
831
+ borderRadius: "radius/75",
832
+ borderWidth: "stroke/1"
833
+ },
834
+ sm: {
835
+ borderRadius: "radius/50",
836
+ borderWidth: "stroke/1"
837
+ },
838
+ xs: {
839
+ borderRadius: "radius/50",
840
+ borderWidth: "stroke/1"
841
+ }
842
+ };
843
+ var tagLabel = {
844
+ borderRadius: "0px"
845
+ };
846
+ var tooltip = {
847
+ xl: {
848
+ borderRadius: "radius/100"
849
+ },
850
+ lg: {
851
+ borderRadius: "radius/100"
852
+ },
853
+ md: {
854
+ borderRadius: "radius/100"
855
+ },
856
+ sm: {
857
+ borderRadius: "radius/50"
858
+ }
859
+ };
860
+ var radio = {
861
+ xl: {
862
+ borderRadius: "radius/999",
863
+ borderWidth: "stroke/1"
864
+ },
865
+ lg: {
866
+ borderRadius: "radius/999",
867
+ borderWidth: "stroke/1"
868
+ },
869
+ md: {
870
+ borderRadius: "radius/999",
871
+ borderWidth: "stroke/1"
872
+ },
873
+ sm: {
874
+ borderRadius: "radius/999",
875
+ borderWidth: "stroke/1"
876
+ }
877
+ };
878
+ var contextMenu = {
879
+ xl: {
880
+ borderRadius: "radius/100"
881
+ },
882
+ lg: {
883
+ borderRadius: "radius/100"
884
+ },
885
+ md: {
886
+ borderRadius: "radius/100"
887
+ },
888
+ sm: {
889
+ borderRadius: "radius/50"
890
+ }
891
+ };
892
+ var avatar = {
893
+ xl: {
894
+ borderRadius: "radius/100",
895
+ borderWidth: "stroke/2"
896
+ },
897
+ lg: {
898
+ borderRadius: "radius/75",
899
+ borderWidth: "stroke/2"
900
+ },
901
+ md: {
902
+ borderRadius: "radius/75",
903
+ borderWidth: "stroke/2"
904
+ },
905
+ sm: {
906
+ borderRadius: "radius/50",
907
+ borderWidth: "stroke/2"
908
+ },
909
+ xs: {
910
+ borderRadius: "radius/50",
911
+ borderWidth: "stroke/2"
912
+ },
913
+ xxs: {
914
+ borderRadius: "radius/25",
915
+ borderWidth: "stroke/2"
916
+ }
917
+ };
918
+ var toggleButtonGroup = {
919
+ xl: {
920
+ borderRadius: "radius/100",
921
+ borderWidth: "stroke/1"
922
+ },
923
+ lg: {
924
+ borderRadius: "radius/100",
925
+ borderWidth: "stroke/1"
926
+ },
927
+ md: {
928
+ borderRadius: "radius/75",
929
+ borderWidth: "stroke/1"
930
+ },
931
+ sm: {
932
+ borderRadius: "radius/50",
933
+ borderWidth: "stroke/1"
934
+ },
935
+ xs: {
936
+ borderRadius: "radius/50",
937
+ borderWidth: "stroke/1"
938
+ }
939
+ };
940
+ var shapePrimitives = {
941
+ button: button,
942
+ checkbox: checkbox,
943
+ input: input,
944
+ cell: cell,
945
+ modal: modal,
946
+ toast: toast,
947
+ segmentedItem: segmentedItem,
948
+ segmented: segmented,
949
+ "switch": {
950
+ xl: {
951
+ borderRadius: "radius/50",
952
+ borderWidth: "stroke/1"
953
+ },
954
+ lg: {
955
+ borderRadius: "radius/50",
956
+ borderWidth: "stroke/1"
957
+ },
958
+ md: {
959
+ borderRadius: "radius/50",
960
+ borderWidth: "stroke/1"
961
+ },
962
+ sm: {
963
+ borderRadius: "radius/50",
964
+ borderWidth: "stroke/1"
965
+ }
966
+ },
967
+ knob: knob,
968
+ tabItem: tabItem,
969
+ tag: tag,
970
+ tagLabel: tagLabel,
971
+ tooltip: tooltip,
972
+ radio: radio,
973
+ contextMenu: contextMenu,
974
+ avatar: avatar,
975
+ toggleButtonGroup: toggleButtonGroup
976
+ };
977
+
978
+ type TypoPrimitives = typeof typoPrimitives;
979
+ type ShapePrimitives = typeof shapePrimitives;
980
+
981
+ type GlobalStyles = "switch" | "brand" | "publisherV2" | "influencerAccount" | "lightstream" | "pentagram";
982
+ interface Theme {
983
+ colors: Colors$1<string>;
984
+ typo: Typography;
985
+ misc: Misc;
986
+ shadows: Shadows;
987
+ typoMobile?: Typography;
988
+ typoTablet?: Typography;
989
+ globalStyle?: GlobalStyles;
990
+ }
991
+ interface PentagramTheme {
992
+ colors: ThemeScheme;
993
+ typo: TypoPrimitives;
994
+ shape: ShapePrimitives;
995
+ shadows: Shadows;
996
+ globalStyle?: GlobalStyles;
997
+ }
998
+ type ThemeVariant = Pick<Theme, "colors">;
999
+
1000
+ type Size = 'sm' | 'md' | 'lg';
1001
+
1002
+ declare const paystation4: Theme;
1003
+ declare const paystation4Dark: Theme;
1004
+ declare const paystation4Take2: Theme;
1005
+ declare const paystation4Gaijin: Theme;
1006
+ declare const paystation4Nexters: Theme;
1007
+ declare const paystation4Themes: {
1008
+ light: Theme;
1009
+ dark: Theme;
1010
+ take2: Theme;
1011
+ gaijin: Theme;
1012
+ nexters: Theme;
1013
+ };
1014
+
1015
+ declare const publisherV2: Theme;
1016
+ declare const publisherV2Dark: Theme;
1017
+ declare const publisherV2Themes: {
1018
+ light: Theme;
1019
+ dark: Theme;
1020
+ };
1021
+
1022
+ declare const emails: Theme;
1023
+ declare const emailsDark: Theme;
1024
+ declare const emailsThemes: {
1025
+ light: Theme;
1026
+ dark: Theme;
1027
+ };
1028
+
1029
+ declare const themesBaseColorsArray: {
1030
+ theme: string;
1031
+ baseColors: BaseColors<colord.Colord>;
1032
+ }[];
1033
+ declare const themesBaseColors: Record<string, BaseColors>;
1034
+ declare const themesColorsScheme: Record<string, (base: BaseColors) => void>;
1035
+
1036
+ /**
1037
+ * Mapped LIGHT scheme from new to old set of variables
1038
+ */
1039
+ declare const paystation4PentagramLightLegacyCompatible: Theme;
1040
+ /**
1041
+ * Mapped DARK scheme from new to old set of variables
1042
+ */
1043
+ declare const paystation4PentagramDarkLegacyCompatible: Theme;
1044
+ declare const paystation4PentagramLight: PentagramTheme;
1045
+ declare const paystation4PentagramDark: PentagramTheme;
1046
+
484
1047
  declare const baseDark: PentagramBaseColors;
485
- declare const createDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
486
- declare const payStationDarkScheme: ThemeScheme;
1048
+ declare const pentagramDarkScheme: (b: PentagramBaseColors) => ThemeScheme;
1049
+ declare const pentagramDark: ThemeScheme;
487
1050
 
488
1051
  declare const base: PentagramBaseColors;
489
- declare const createScheme: (b: PentagramBaseColors) => ThemeScheme;
490
- declare const payStationScheme: ThemeScheme;
1052
+ declare const pentagramLightScheme: (b: PentagramBaseColors) => ThemeScheme;
1053
+ declare const pentagramLight: ThemeScheme;
491
1054
 
492
1055
  declare const themes: Record<string, Theme>;
493
1056
 
@@ -1964,4 +2527,615 @@ declare function themeGenerator(props: {
1964
2527
  }): ThemeScheme;
1965
2528
  declare function themeGenerator(props: ThemeFunctionType): Theme;
1966
2529
 
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 };
2530
+ /**
2531
+ * Resolves Pentagram design token aliases to concrete CSS values.
2532
+ *
2533
+ * Source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2534
+ * Scale tables: see FONT_SIZE_SCALE and LINE_HEIGHT_* constants below.
2535
+ *
2536
+ * This resolver converts aliases like "font-size/300" → "28px" (desktop) or "24px" (mobile).
2537
+ * It is used BEFORE the mappers (mapPentagramTypoToLegacy, mapPentagramShapeToLegacy).
2538
+ *
2539
+ * @example
2540
+ * ```typescript
2541
+ * const resolver = new PentagramResolver('desktop');
2542
+ * const resolvedTypo = resolver.resolvePrimitives(themeContentPentagram.typo);
2543
+ * const legacyTypo = mapPentagramTypoToLegacy(resolvedTypo);
2544
+ * ```
2545
+ */
2546
+ type Device = "desktop" | "mobile";
2547
+ declare class PentagramResolver {
2548
+ private device;
2549
+ constructor(device?: Device);
2550
+ setDevice(device: Device): void;
2551
+ /**
2552
+ * Resolve a single alias to a concrete value.
2553
+ *
2554
+ * @param alias - Alias string like "300" (fontSize), "display/300" (lineHeight), or "radius/100"
2555
+ * @param context - Optional context hint: 'fontSize' or 'lineHeight'
2556
+ * @returns Resolved value (e.g., "28px") or original if not an alias
2557
+ */
2558
+ resolve(alias: string | number, context?: "fontSize" | "lineHeight"): string | number;
2559
+ /**
2560
+ * Recursively resolve all aliases in an object.
2561
+ *
2562
+ * @param obj - Object containing alias strings
2563
+ * @returns New object with all aliases resolved to concrete values
2564
+ */
2565
+ resolvePrimitives<T>(obj: T): T;
2566
+ /**
2567
+ * Check if a value is already resolved (not an alias).
2568
+ */
2569
+ private isResolved;
2570
+ }
2571
+ /**
2572
+ * Create a resolver for the given device.
2573
+ *
2574
+ * @param device - 'desktop' (default) or 'mobile'
2575
+ * @returns PentagramResolver instance
2576
+ *
2577
+ * @example
2578
+ * ```typescript
2579
+ * const resolver = createResolver('desktop');
2580
+ * const resolved = resolver.resolvePrimitives(pentagramTypo);
2581
+ * ```
2582
+ */
2583
+ declare function createResolver(device?: Device): PentagramResolver;
2584
+ /**
2585
+ * Resolve all aliases in a Pentagram primitives object for desktop device.
2586
+ * Convenience function for the most common case.
2587
+ *
2588
+ * @example
2589
+ * ```typescript
2590
+ * const resolvedTypo = resolveForDesktop(themeContentPentagram.typo);
2591
+ * ```
2592
+ */
2593
+ declare function resolveForDesktop<T>(obj: T): T;
2594
+ /**
2595
+ * Resolve all aliases in a Pentagram primitives object for mobile device.
2596
+ */
2597
+ declare function resolveForMobile<T>(obj: T): T;
2598
+
2599
+ /**
2600
+ * Maps Pentagram Typography → Legacy Typography structure.
2601
+ *
2602
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2603
+ *
2604
+ * Used for themes that have themeContentPentagram.typo (new set).
2605
+ * Converts to themeContent.typo (old set) so that Pay Station 4 keeps working.
2606
+ *
2607
+ * NOTE: This mapper expects RESOLVED values (px), not aliases like "font-size/300".
2608
+ * Use PentagramResolver to resolve aliases before calling this mapper.
2609
+ */
2610
+ interface TypographyStyle {
2611
+ fontSize: string;
2612
+ lineHeight: string;
2613
+ fontWeight?: number;
2614
+ textTransform?: string;
2615
+ [key: string]: string | number | undefined;
2616
+ }
2617
+ interface PentagramTypoBasicVariant {
2618
+ fontSize: string;
2619
+ lineHeight: string;
2620
+ default?: {
2621
+ fontWeight: number;
2622
+ };
2623
+ accent?: {
2624
+ fontWeight: number;
2625
+ };
2626
+ paragraph?: {
2627
+ spacing?: string;
2628
+ lineHeight?: string;
2629
+ };
2630
+ }
2631
+ /** Resolved control size (after PentagramResolver expands `{ scale: "400" }`). */
2632
+ type PentagramTypoControlSize = Pick<TypographyStyle, "fontSize" | "lineHeight">;
2633
+ /**
2634
+ * Pentagram Typography structure (from themeContentPentagram.typo)
2635
+ */
2636
+ interface PentagramTypo {
2637
+ heading: {
2638
+ h1: TypographyStyle;
2639
+ h2: TypographyStyle;
2640
+ h3: TypographyStyle;
2641
+ h4: TypographyStyle;
2642
+ h5: TypographyStyle;
2643
+ };
2644
+ basic: {
2645
+ display: TypographyStyle & {
2646
+ fontFamily?: string;
2647
+ };
2648
+ bodyLg: PentagramTypoBasicVariant;
2649
+ bodyMd: PentagramTypoBasicVariant;
2650
+ bodySm: PentagramTypoBasicVariant;
2651
+ bodyXs: PentagramTypoBasicVariant;
2652
+ bodyXxs: PentagramTypoBasicVariant;
2653
+ };
2654
+ control: {
2655
+ button: Record<string, PentagramTypoControlSize>;
2656
+ input: Record<string, PentagramTypoControlSize>;
2657
+ checkbox: Record<string, PentagramTypoControlSize>;
2658
+ tab: Record<string, PentagramTypoControlSize>;
2659
+ radio: Record<string, PentagramTypoControlSize>;
2660
+ segmentedItem?: Record<string, PentagramTypoControlSize>;
2661
+ tag?: Record<string, PentagramTypoControlSize>;
2662
+ toggleButton?: Record<string, PentagramTypoControlSize>;
2663
+ };
2664
+ }
2665
+ /**
2666
+ * Legacy Typography structure (themeContent.typo)
2667
+ */
2668
+ interface LegacyTypo {
2669
+ fontFamily: string;
2670
+ core: {
2671
+ h1: TypographyStyle;
2672
+ h2: TypographyStyle;
2673
+ h3: TypographyStyle;
2674
+ h4: TypographyStyle;
2675
+ bodyMd: TypographyStyle;
2676
+ bodyMdAccent: TypographyStyle;
2677
+ bodyLg: TypographyStyle;
2678
+ bodyLgAccent: TypographyStyle;
2679
+ paragraph: TypographyStyle;
2680
+ label: TypographyStyle;
2681
+ minor: TypographyStyle;
2682
+ strong: TypographyStyle;
2683
+ };
2684
+ components: {
2685
+ button: Record<string, TypographyStyle>;
2686
+ input: Record<string, TypographyStyle>;
2687
+ tab: Record<string, TypographyStyle>;
2688
+ check: Record<string, TypographyStyle>;
2689
+ label: Record<string, TypographyStyle>;
2690
+ };
2691
+ }
2692
+ /**
2693
+ * Maps Pentagram typography to legacy typography structure.
2694
+ *
2695
+ * @param pentagram - Pentagram typography (RESOLVED values, not aliases)
2696
+ * @param fontFamily - Optional custom font family (defaults to GraphikLCWebUikit)
2697
+ * @returns Legacy typography structure for themeContent.typo
2698
+ *
2699
+ * @example
2700
+ * ```typescript
2701
+ * // First resolve aliases
2702
+ * const resolver = new PentagramResolver('desktop');
2703
+ * const resolvedTypo = resolver.resolvePrimitives(themeContentPentagram.typo);
2704
+ *
2705
+ * // Then map to legacy
2706
+ * const legacyTypo = mapPentagramTypoToLegacy(resolvedTypo);
2707
+ * ```
2708
+ */
2709
+ declare function mapPentagramTypoToLegacy(pentagram: PentagramTypo, fontFamily?: string): LegacyTypo;
2710
+ /**
2711
+ * These legacy variables are DELETED in Pentagram and should NOT be mapped:
2712
+ *
2713
+ * - components.heading (sm/md/lg) — was uppercase labels, not used in PS4
2714
+ * - components.fieldGroup (sm/md/lg) — never used in PS4
2715
+ * - core.strong — never used in PS4
2716
+ * - core.bodyLg — replaced by bodyLgAccent (only accent variant used)
2717
+ *
2718
+ * If PS4 code still references these variables, it will fall back to
2719
+ * default CSS values from design-typography-variables.scss
2720
+ */
2721
+ declare const DELETED_LEGACY_TYPO_VARS: readonly ["components.heading", "components.fieldGroup", "core.strong", "core.bodyLg"];
2722
+
2723
+ /**
2724
+ * Maps Pentagram Shape → Legacy Misc structure.
2725
+ *
2726
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2727
+ *
2728
+ * Pentagram has per-component, per-size shape tokens (button.xl.borderRadius, etc).
2729
+ * Legacy misc has single borderRadius per component type (borderRadius.button).
2730
+ *
2731
+ * This mapper uses the "md" size as default for legacy compatibility.
2732
+ *
2733
+ * NOTE: This mapper expects RESOLVED values (px), not aliases like "radius/100".
2734
+ * Use PentagramResolver to resolve aliases before calling this mapper.
2735
+ */
2736
+ interface PentagramShapeSize {
2737
+ borderRadius?: string;
2738
+ borderWidth?: string;
2739
+ }
2740
+ interface PentagramShape {
2741
+ button?: Record<string, PentagramShapeSize>;
2742
+ checkbox?: Record<string, PentagramShapeSize>;
2743
+ input?: Record<string, PentagramShapeSize>;
2744
+ cell?: PentagramShapeSize;
2745
+ modal?: PentagramShapeSize;
2746
+ toast?: PentagramShapeSize;
2747
+ segmentedItem?: Record<string, PentagramShapeSize>;
2748
+ segmented?: Record<string, PentagramShapeSize>;
2749
+ switch?: Record<string, PentagramShapeSize>;
2750
+ knob?: Record<string, {
2751
+ borderRadius?: string;
2752
+ }>;
2753
+ tabItem?: Record<string, PentagramShapeSize>;
2754
+ tag?: Record<string, PentagramShapeSize>;
2755
+ tagLabel?: {
2756
+ borderRadius?: string;
2757
+ };
2758
+ tooltip?: Record<string, PentagramShapeSize>;
2759
+ radio?: Record<string, PentagramShapeSize>;
2760
+ contextMenu?: Record<string, PentagramShapeSize>;
2761
+ avatar?: Record<string, PentagramShapeSize>;
2762
+ toggleButtonGroup?: Record<string, PentagramShapeSize>;
2763
+ }
2764
+ interface LegacyMisc {
2765
+ borderRadiusScale: {
2766
+ sm: string;
2767
+ md: string;
2768
+ lg: string;
2769
+ xl: string;
2770
+ };
2771
+ borderWidth: string;
2772
+ borderRadius: {
2773
+ input: string;
2774
+ button: string;
2775
+ buttonIcon: string;
2776
+ popup: string;
2777
+ checkbox: string;
2778
+ tag: string;
2779
+ };
2780
+ minWidth: {
2781
+ button: string;
2782
+ };
2783
+ }
2784
+ /**
2785
+ * Maps Pentagram shape to legacy misc structure.
2786
+ *
2787
+ * @param pentagram - Pentagram shape (RESOLVED values, not aliases)
2788
+ * @param existingMisc - Optional existing misc to merge with (preserves non-shape values)
2789
+ * @returns Legacy misc structure for themeContent.misc
2790
+ *
2791
+ * @example
2792
+ * ```typescript
2793
+ * // First resolve aliases
2794
+ * const resolver = new PentagramResolver('desktop');
2795
+ * const resolvedShape = resolver.resolvePrimitives(themeContentPentagram.shape);
2796
+ *
2797
+ * // Then map to legacy
2798
+ * const legacyMisc = mapPentagramShapeToLegacy(resolvedShape);
2799
+ * ```
2800
+ */
2801
+ declare function mapPentagramShapeToLegacy(pentagram: PentagramShape, existingMisc?: Partial<LegacyMisc>): LegacyMisc;
2802
+ /**
2803
+ * If PS4 adopts per-size CSS variables (--shape-button-md-borderRadius),
2804
+ * this function can generate them directly from Pentagram shape.
2805
+ *
2806
+ * This is for future use when PS4 migrates to granular shape tokens.
2807
+ */
2808
+ declare function flattenPentagramShapeToVars(pentagram: PentagramShape): Record<string, string>;
2809
+
2810
+ /**
2811
+ * Maps hand-crafted Pentagram colors → legacy Switch Colors structure.
2812
+ *
2813
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
2814
+ *
2815
+ * Used for default themes that are hand-crafted (not auto-generated via themeGenerator).
2816
+ * Converts themeContentPentagram.colors (new set) → themeContent.colors (old set),
2817
+ * so that products still on the legacy variable set (Chat, Proxy Page) keep working.
2818
+ */
2819
+
2820
+ /**
2821
+ * Hand-crafted Pentagram colors structure (from Figma export)
2822
+ */
2823
+ interface HandCraftedPentagramColors {
2824
+ content: {
2825
+ primary: string;
2826
+ secondary: string;
2827
+ tertiary: string;
2828
+ brandPrimary: string;
2829
+ brandSecondary: string;
2830
+ brandExtraPrimary: string;
2831
+ brandExtraSecondary: string;
2832
+ inverse: string;
2833
+ staticLight: string;
2834
+ staticDark: string;
2835
+ successPrimary: string;
2836
+ successSecondary: string;
2837
+ warningPrimary: string;
2838
+ warningSecondary: string;
2839
+ alertPrimary: string;
2840
+ alertSecondary: string;
2841
+ neutralPrimary: string;
2842
+ neutralSecondary: string;
2843
+ onBrand: string;
2844
+ onBrandExtra: string;
2845
+ onSuccess: string;
2846
+ onWarning: string;
2847
+ onAlert: string;
2848
+ onNeutral: string;
2849
+ };
2850
+ background: {
2851
+ primary: string;
2852
+ secondary: string;
2853
+ brandPrimary: string;
2854
+ brandSecondary: string;
2855
+ brandExtraPrimary: string;
2856
+ brandExtraSecondary: string;
2857
+ inverse: string;
2858
+ staticDark: string;
2859
+ staticLight: string;
2860
+ successPrimary: string;
2861
+ successSecondary: string;
2862
+ warningPrimary: string;
2863
+ warningSecondary: string;
2864
+ alertPrimary: string;
2865
+ alertSecondary: string;
2866
+ neutralPrimary: string;
2867
+ neutralSecondary: string;
2868
+ };
2869
+ border: {
2870
+ primary: string;
2871
+ secondary: string;
2872
+ brand: string;
2873
+ brandExtra: string;
2874
+ inverse: string;
2875
+ success: string;
2876
+ warning: string;
2877
+ alert: string;
2878
+ neutral: string;
2879
+ };
2880
+ overlay: {
2881
+ mono: string;
2882
+ brand: string;
2883
+ brandExtra: string;
2884
+ success: string;
2885
+ warning: string;
2886
+ alert: string;
2887
+ neutral: string;
2888
+ };
2889
+ control: {
2890
+ input: {
2891
+ bg: string;
2892
+ bgHover: string;
2893
+ bgDisable: string;
2894
+ border: string;
2895
+ borderHover: string;
2896
+ borderDisable: string;
2897
+ text: string;
2898
+ placeholder: string;
2899
+ textDisable: string;
2900
+ };
2901
+ focus: {
2902
+ bg: string;
2903
+ border: string;
2904
+ };
2905
+ check: {
2906
+ bg: string;
2907
+ bgHover: string;
2908
+ bgDisable: string;
2909
+ border: string;
2910
+ borderHover: string;
2911
+ borderDisable: string;
2912
+ icon: string;
2913
+ };
2914
+ faint: {
2915
+ bg: string;
2916
+ bgHover: string;
2917
+ border: string;
2918
+ borderHover: string;
2919
+ };
2920
+ text: {
2921
+ primary: string;
2922
+ disable: string;
2923
+ };
2924
+ link: {
2925
+ primary: string;
2926
+ primaryHover: string;
2927
+ secondary: string;
2928
+ secondaryHover: string;
2929
+ };
2930
+ switch: {
2931
+ bg: string;
2932
+ bgHover: string;
2933
+ bgDisable: string;
2934
+ border: string;
2935
+ borderHover: string;
2936
+ borderDisable: string;
2937
+ };
2938
+ slider: {
2939
+ bg: string;
2940
+ bgHover: string;
2941
+ bgDisable: string;
2942
+ };
2943
+ knob: {
2944
+ bg: string;
2945
+ bgActive: string;
2946
+ bgHover: string;
2947
+ bgInactive: string;
2948
+ bgDisable: string;
2949
+ };
2950
+ segmented: {
2951
+ bg: string;
2952
+ bgHover: string;
2953
+ bgActive: string;
2954
+ border: string;
2955
+ borderHover: string;
2956
+ borderActive: string;
2957
+ text: string;
2958
+ textDisable: string;
2959
+ };
2960
+ toggleButton: {
2961
+ bg: string;
2962
+ bgHover: string;
2963
+ bgActive: string;
2964
+ bgDisable: string;
2965
+ border: string;
2966
+ borderHover: string;
2967
+ borderActive: string;
2968
+ borderDisable: string;
2969
+ text: string;
2970
+ textActive: string;
2971
+ textDisable: string;
2972
+ };
2973
+ brand: {
2974
+ primary: {
2975
+ bg: string;
2976
+ bgHover: string;
2977
+ bgPress: string;
2978
+ bgDisable: string;
2979
+ border: string;
2980
+ borderHover: string;
2981
+ borderPress: string;
2982
+ borderDisable: string;
2983
+ };
2984
+ secondary: {
2985
+ bg: string;
2986
+ bgHover: string;
2987
+ bgPress: string;
2988
+ border: string;
2989
+ borderHover: string;
2990
+ borderPress: string;
2991
+ };
2992
+ tertiary: {
2993
+ bg: string;
2994
+ bgHover: string;
2995
+ bgPress: string;
2996
+ border: string;
2997
+ borderHover: string;
2998
+ borderPress: string;
2999
+ };
3000
+ text: {
3001
+ primary: string;
3002
+ secondary: string;
3003
+ tertiary: string;
3004
+ disable: string;
3005
+ };
3006
+ };
3007
+ mono: {
3008
+ primary: {
3009
+ bg: string;
3010
+ bgHover: string;
3011
+ bgPress: string;
3012
+ border: string;
3013
+ borderHover: string;
3014
+ borderPress: string;
3015
+ };
3016
+ secondary: {
3017
+ bg: string;
3018
+ bgHover: string;
3019
+ bgPress: string;
3020
+ border: string;
3021
+ borderHover: string;
3022
+ borderPress: string;
3023
+ };
3024
+ tertiary: {
3025
+ bg: string;
3026
+ bgHover: string;
3027
+ bgPress: string;
3028
+ border: string;
3029
+ borderHover: string;
3030
+ borderPress: string;
3031
+ };
3032
+ text: {
3033
+ primary: string;
3034
+ secondary: string;
3035
+ tertiary: string;
3036
+ };
3037
+ };
3038
+ brandExtra: {
3039
+ primary: {
3040
+ bg: string;
3041
+ bgHover: string;
3042
+ bgPress: string;
3043
+ border: string;
3044
+ borderHover: string;
3045
+ borderPress: string;
3046
+ };
3047
+ secondary: {
3048
+ bg: string;
3049
+ bgHover: string;
3050
+ bgPress: string;
3051
+ border: string;
3052
+ borderHover: string;
3053
+ borderPress: string;
3054
+ };
3055
+ tertiary: {
3056
+ bg: string;
3057
+ bgHover: string;
3058
+ bgPress: string;
3059
+ border: string;
3060
+ borderHover: string;
3061
+ borderPress: string;
3062
+ };
3063
+ text: {
3064
+ primary: string;
3065
+ secondary: string;
3066
+ tertiary: string;
3067
+ };
3068
+ };
3069
+ alert: {
3070
+ primary: {
3071
+ bg: string;
3072
+ bgHover: string;
3073
+ bgPress: string;
3074
+ border: string;
3075
+ borderHover: string;
3076
+ borderPress: string;
3077
+ };
3078
+ secondary: {
3079
+ bg: string;
3080
+ bgHover: string;
3081
+ bgPress: string;
3082
+ border: string;
3083
+ borderHover: string;
3084
+ borderPress: string;
3085
+ };
3086
+ tertiary: {
3087
+ bg: string;
3088
+ bgHover: string;
3089
+ bgPress: string;
3090
+ border: string;
3091
+ borderHover: string;
3092
+ borderPress: string;
3093
+ };
3094
+ text: {
3095
+ primary: string;
3096
+ secondary: string;
3097
+ tertiary: string;
3098
+ };
3099
+ };
3100
+ };
3101
+ layer: {
3102
+ scrim: string;
3103
+ float: string;
3104
+ };
3105
+ }
3106
+ /**
3107
+ * @param pentagram Hand-crafted Pentagram color scheme (all values already RGB strings).
3108
+ * @returns Legacy colors without 'base' (seed colors not needed for hand-crafted themes).
3109
+ */
3110
+ declare function mapHandCraftedPentagramToLegacy(pentagram: HandCraftedPentagramColors): Omit<Colors$1<string>, "base">;
3111
+
3112
+ /**
3113
+ * Orchestrator: maps full themeContentPentagram → legacy themeContent.
3114
+ *
3115
+ * Mapping source: https://xsolla.atlassian.net/wiki/spaces/SDS/pages/23998955662/Variables+mapping
3116
+ */
3117
+
3118
+ interface PentagramThemeContent {
3119
+ colors: HandCraftedPentagramColors;
3120
+ typo: PentagramTypo;
3121
+ shape: PentagramShape;
3122
+ shadows?: Shadows;
3123
+ }
3124
+ interface LegacyThemeContent {
3125
+ colors: Colors$1<string>;
3126
+ typo: LegacyTypo;
3127
+ misc: LegacyMisc;
3128
+ shadows?: Shadows;
3129
+ }
3130
+ /**
3131
+ * Builds legacy `base` seed colors from Pentagram colors.
3132
+ * See Variables mapping table → base.* section.
3133
+ */
3134
+ declare function buildBaseColorsFromPentagram(colors: HandCraftedPentagramColors): BaseColors<string>;
3135
+ /**
3136
+ * Maps full themeContentPentagram to legacy themeContent.
3137
+ * Resolves typo/shape aliases to absolute values before mapping.
3138
+ */
3139
+ declare function mapPentagramThemeToLegacy(pentagram: PentagramThemeContent, device?: Device): LegacyThemeContent;
3140
+
3141
+ export { type BaseColors, type BaseColorsIndex, type ColorValue, type Colors$1 as Colors, type ComponentBaseColors$1 as ComponentBaseColors, DELETED_LEGACY_TYPO_VARS, type Device, type HandCraftedPentagramColors, 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 ThemeVariant, type TypoPrimitives, type Typography, type TypographyStyle, base, baseDark, buildBaseColorsFromPentagram, createResolver, emails, emailsDark, emailsThemes, flattenPentagramShapeToVars, generateWithScheme, mapHandCraftedPentagramToLegacy, mapPentagramShapeToLegacy, mapPentagramThemeToLegacy, mapPentagramTypoToLegacy, 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 };