@xsolla/xui-core 0.216.0 → 0.217.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/index.d.mts +79 -23
- package/index.d.ts +79 -23
- package/index.js +141 -37
- package/index.js.map +1 -1
- package/index.mjs +140 -37
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2624,18 +2624,36 @@ var colors = {
|
|
|
2624
2624
|
};
|
|
2625
2625
|
|
|
2626
2626
|
// src/tokens/spacing.ts
|
|
2627
|
+
var spacingScale = {
|
|
2628
|
+
"25": 2,
|
|
2629
|
+
"50": 4,
|
|
2630
|
+
"75": 6,
|
|
2631
|
+
"100": 8,
|
|
2632
|
+
"150": 12,
|
|
2633
|
+
"200": 16,
|
|
2634
|
+
"250": 20,
|
|
2635
|
+
"300": 24,
|
|
2636
|
+
"350": 28,
|
|
2637
|
+
"400": 32,
|
|
2638
|
+
"450": 36,
|
|
2639
|
+
"500": 40,
|
|
2640
|
+
"600": 48,
|
|
2641
|
+
"700": 56,
|
|
2642
|
+
"800": 64,
|
|
2643
|
+
"900": 72
|
|
2644
|
+
};
|
|
2627
2645
|
var spacing = {
|
|
2628
|
-
xs:
|
|
2629
|
-
sm:
|
|
2630
|
-
md:
|
|
2631
|
-
lg:
|
|
2632
|
-
xl:
|
|
2646
|
+
xs: spacingScale["50"],
|
|
2647
|
+
sm: spacingScale["100"],
|
|
2648
|
+
md: spacingScale["200"],
|
|
2649
|
+
lg: spacingScale["300"],
|
|
2650
|
+
xl: spacingScale["400"],
|
|
2633
2651
|
/** @deprecated Use `sm` instead (same 8px). Kept for backwards compatibility. */
|
|
2634
|
-
s:
|
|
2652
|
+
s: spacingScale["100"],
|
|
2635
2653
|
/** @deprecated Use `md` instead (same 16px). Kept for backwards compatibility. */
|
|
2636
|
-
m:
|
|
2654
|
+
m: spacingScale["200"],
|
|
2637
2655
|
/** @deprecated Use `lg` instead (same 24px). Kept for backwards compatibility. */
|
|
2638
|
-
l:
|
|
2656
|
+
l: spacingScale["300"]
|
|
2639
2657
|
};
|
|
2640
2658
|
var radius = {
|
|
2641
2659
|
button: 4,
|
|
@@ -2700,7 +2718,8 @@ var shape = {
|
|
|
2700
2718
|
xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2701
2719
|
lg: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2702
2720
|
md: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2703
|
-
sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
|
|
2721
|
+
sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] },
|
|
2722
|
+
xs: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
|
|
2704
2723
|
},
|
|
2705
2724
|
switch: {
|
|
2706
2725
|
xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
@@ -2763,7 +2782,9 @@ var shape = {
|
|
|
2763
2782
|
borderRadius: radiusScale["100"]
|
|
2764
2783
|
},
|
|
2765
2784
|
toast: {
|
|
2766
|
-
borderRadius: radiusScale["50"]
|
|
2785
|
+
borderRadius: radiusScale["50"],
|
|
2786
|
+
/** Figma "toast/frame/border-width" is 0 — toast is borderless by design. */
|
|
2787
|
+
borderWidth: 0
|
|
2767
2788
|
},
|
|
2768
2789
|
toggleButtonGroup: {
|
|
2769
2790
|
xl: { borderRadius: radiusScale["100"], borderWidth: stroke["1"] },
|
|
@@ -2922,6 +2943,92 @@ var responsiveTypographyScale = {
|
|
|
2922
2943
|
};
|
|
2923
2944
|
|
|
2924
2945
|
// src/tokens/typography.ts
|
|
2946
|
+
var displayVariants = {
|
|
2947
|
+
b2c: {
|
|
2948
|
+
"display-lg": {
|
|
2949
|
+
fontSize: fontSize["900"].common,
|
|
2950
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
2951
|
+
fontWeight: 700,
|
|
2952
|
+
scaleStep: "900",
|
|
2953
|
+
lineHeightCategory: "display",
|
|
2954
|
+
letterSpacing: -4,
|
|
2955
|
+
fontRole: "display"
|
|
2956
|
+
},
|
|
2957
|
+
"display-md": {
|
|
2958
|
+
fontSize: fontSize["850"].common,
|
|
2959
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
2960
|
+
fontWeight: 700,
|
|
2961
|
+
scaleStep: "850",
|
|
2962
|
+
lineHeightCategory: "display",
|
|
2963
|
+
letterSpacing: -3,
|
|
2964
|
+
fontRole: "display"
|
|
2965
|
+
},
|
|
2966
|
+
"display-sm": {
|
|
2967
|
+
fontSize: fontSize["300"].common,
|
|
2968
|
+
lineHeight: `${lineHeightCompact["300"].common}px`,
|
|
2969
|
+
fontWeight: 500,
|
|
2970
|
+
scaleStep: "300",
|
|
2971
|
+
lineHeightCategory: "compact",
|
|
2972
|
+
fontRole: "compact"
|
|
2973
|
+
}
|
|
2974
|
+
},
|
|
2975
|
+
b2b: {
|
|
2976
|
+
"display-lg": {
|
|
2977
|
+
fontSize: fontSize["900"].common,
|
|
2978
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
2979
|
+
fontWeight: 300,
|
|
2980
|
+
scaleStep: "900",
|
|
2981
|
+
lineHeightCategory: "display",
|
|
2982
|
+
letterSpacing: -4,
|
|
2983
|
+
fontRole: "display"
|
|
2984
|
+
},
|
|
2985
|
+
"display-md": {
|
|
2986
|
+
fontSize: fontSize["850"].common,
|
|
2987
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
2988
|
+
fontWeight: 300,
|
|
2989
|
+
scaleStep: "850",
|
|
2990
|
+
lineHeightCategory: "display",
|
|
2991
|
+
letterSpacing: -3,
|
|
2992
|
+
fontRole: "display"
|
|
2993
|
+
},
|
|
2994
|
+
"display-sm": {
|
|
2995
|
+
fontSize: fontSize["750"].common,
|
|
2996
|
+
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
2997
|
+
fontWeight: 400,
|
|
2998
|
+
scaleStep: "750",
|
|
2999
|
+
lineHeightCategory: "display",
|
|
3000
|
+
fontRole: "display"
|
|
3001
|
+
}
|
|
3002
|
+
},
|
|
3003
|
+
corpsite: {
|
|
3004
|
+
"display-lg": {
|
|
3005
|
+
fontSize: fontSize["900"].common,
|
|
3006
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3007
|
+
fontWeight: 300,
|
|
3008
|
+
scaleStep: "900",
|
|
3009
|
+
lineHeightCategory: "display",
|
|
3010
|
+
letterSpacing: -4,
|
|
3011
|
+
fontRole: "display"
|
|
3012
|
+
},
|
|
3013
|
+
"display-md": {
|
|
3014
|
+
fontSize: fontSize["850"].common,
|
|
3015
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
3016
|
+
fontWeight: 300,
|
|
3017
|
+
scaleStep: "850",
|
|
3018
|
+
lineHeightCategory: "display",
|
|
3019
|
+
letterSpacing: -3,
|
|
3020
|
+
fontRole: "display"
|
|
3021
|
+
},
|
|
3022
|
+
"display-sm": {
|
|
3023
|
+
fontSize: fontSize["750"].common,
|
|
3024
|
+
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
3025
|
+
fontWeight: 400,
|
|
3026
|
+
scaleStep: "750",
|
|
3027
|
+
lineHeightCategory: "display",
|
|
3028
|
+
fontRole: "display"
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
2925
3032
|
var typographyTokens = {
|
|
2926
3033
|
b2c: {
|
|
2927
3034
|
heading: {
|
|
@@ -2962,13 +3069,8 @@ var typographyTokens = {
|
|
|
2962
3069
|
}
|
|
2963
3070
|
},
|
|
2964
3071
|
basic: {
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
lineHeight: `${lineHeightDisplay["550"].common}px`,
|
|
2968
|
-
fontWeight: 800,
|
|
2969
|
-
scaleStep: "550",
|
|
2970
|
-
lineHeightCategory: "display"
|
|
2971
|
-
},
|
|
3072
|
+
...displayVariants.b2c,
|
|
3073
|
+
display: displayVariants.b2c["display-lg"],
|
|
2972
3074
|
"body-lg": {
|
|
2973
3075
|
fontSize: fontSize["175"].common,
|
|
2974
3076
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3075,13 +3177,8 @@ var typographyTokens = {
|
|
|
3075
3177
|
}
|
|
3076
3178
|
},
|
|
3077
3179
|
basic: {
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
3081
|
-
fontWeight: 400,
|
|
3082
|
-
scaleStep: "750",
|
|
3083
|
-
lineHeightCategory: "display"
|
|
3084
|
-
},
|
|
3180
|
+
...displayVariants.b2b,
|
|
3181
|
+
display: displayVariants.b2b["display-lg"],
|
|
3085
3182
|
"body-lg": {
|
|
3086
3183
|
fontSize: fontSize["175"].common,
|
|
3087
3184
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3188,16 +3285,8 @@ var typographyTokens = {
|
|
|
3188
3285
|
}
|
|
3189
3286
|
},
|
|
3190
3287
|
basic: {
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
// display-lg (step 900) — the largest, matching Figma's primary display.
|
|
3194
|
-
display: {
|
|
3195
|
-
fontSize: fontSize["900"].common,
|
|
3196
|
-
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3197
|
-
fontWeight: 300,
|
|
3198
|
-
scaleStep: "900",
|
|
3199
|
-
lineHeightCategory: "display"
|
|
3200
|
-
},
|
|
3288
|
+
...displayVariants.corpsite,
|
|
3289
|
+
display: displayVariants.corpsite["display-lg"],
|
|
3201
3290
|
"body-lg": {
|
|
3202
3291
|
fontSize: fontSize["175"].common,
|
|
3203
3292
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3275,8 +3364,18 @@ var getTypographyVariant = (productContext, variant) => {
|
|
|
3275
3364
|
if (variant in tokens.heading) {
|
|
3276
3365
|
return tokens.heading[variant];
|
|
3277
3366
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3367
|
+
const displayVariantMap = {
|
|
3368
|
+
display: "display-lg",
|
|
3369
|
+
displayLg: "display-lg",
|
|
3370
|
+
displayMd: "display-md",
|
|
3371
|
+
displaySm: "display-sm",
|
|
3372
|
+
"display-lg": "display-lg",
|
|
3373
|
+
"display-md": "display-md",
|
|
3374
|
+
"display-sm": "display-sm"
|
|
3375
|
+
};
|
|
3376
|
+
const displayKey = displayVariantMap[variant];
|
|
3377
|
+
if (displayKey) {
|
|
3378
|
+
return tokens.basic[displayKey];
|
|
3280
3379
|
}
|
|
3281
3380
|
const bodyVariantMap = {
|
|
3282
3381
|
bodyLg: "body-lg",
|
|
@@ -4955,7 +5054,10 @@ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
|
|
|
4955
5054
|
triggerGap: 12,
|
|
4956
5055
|
triggerMinHeight: 56,
|
|
4957
5056
|
surfaceRadius: radiusScale["50"],
|
|
4958
|
-
|
|
5057
|
+
// Must match surfaceRadius: the root clips with `overflow: hidden`, so a
|
|
5058
|
+
// larger cell radius makes the trigger cell's corners show through the
|
|
5059
|
+
// smaller root arc (XUITSD-55).
|
|
5060
|
+
cellRadius: radiusScale["50"],
|
|
4959
5061
|
iconSlotSize: 32,
|
|
4960
5062
|
iconSlotRadius: radiusScale["50"],
|
|
4961
5063
|
chevronSize: 24,
|
|
@@ -5201,6 +5303,7 @@ export {
|
|
|
5201
5303
|
shadow,
|
|
5202
5304
|
shape,
|
|
5203
5305
|
spacing,
|
|
5306
|
+
spacingScale,
|
|
5204
5307
|
stroke,
|
|
5205
5308
|
themeConfig,
|
|
5206
5309
|
typography,
|