@xsolla/switch-theme-customization 0.187.3 → 0.188.1
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 +5 -5
- package/index.d.mts +221 -173
- package/index.d.ts +221 -173
- package/index.js +386 -199
- package/index.js.map +1 -1
- package/index.mjs +367 -198
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1937,45 +1937,51 @@ var themesColorsScheme = {
|
|
|
1937
1937
|
emailsDark: emailsDarkScheme
|
|
1938
1938
|
};
|
|
1939
1939
|
|
|
1940
|
-
// src/
|
|
1940
|
+
// src/xui-primitives/typo-primitives.json
|
|
1941
1941
|
var typo_primitives_default = {
|
|
1942
1942
|
heading: {
|
|
1943
1943
|
h1: {
|
|
1944
|
-
|
|
1945
|
-
|
|
1944
|
+
fontFamily: "font-family/display",
|
|
1945
|
+
fontSize: "font-size/450",
|
|
1946
|
+
lineHeight: "line-height-display/450",
|
|
1946
1947
|
fontWeight: 700
|
|
1947
1948
|
},
|
|
1948
1949
|
h2: {
|
|
1949
|
-
|
|
1950
|
-
|
|
1950
|
+
fontFamily: "font-family/display",
|
|
1951
|
+
fontSize: "font-size/350",
|
|
1952
|
+
lineHeight: "line-height-display/350",
|
|
1951
1953
|
fontWeight: 700
|
|
1952
1954
|
},
|
|
1953
1955
|
h3: {
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
+
fontFamily: "font-family/display",
|
|
1957
|
+
fontSize: "font-size/300",
|
|
1958
|
+
lineHeight: "line-height-display/300",
|
|
1956
1959
|
fontWeight: 700
|
|
1957
1960
|
},
|
|
1958
1961
|
h4: {
|
|
1959
|
-
|
|
1960
|
-
|
|
1962
|
+
fontFamily: "font-family/display",
|
|
1963
|
+
fontSize: "font-size/250",
|
|
1964
|
+
lineHeight: "line-height-display/250",
|
|
1961
1965
|
fontWeight: 700
|
|
1962
1966
|
},
|
|
1963
1967
|
h5: {
|
|
1964
|
-
|
|
1965
|
-
|
|
1968
|
+
fontFamily: "font-family/display",
|
|
1969
|
+
fontSize: "font-size/200",
|
|
1970
|
+
lineHeight: "line-height-display/200",
|
|
1966
1971
|
fontWeight: 700
|
|
1967
1972
|
}
|
|
1968
1973
|
},
|
|
1969
1974
|
basic: {
|
|
1970
1975
|
display: {
|
|
1971
|
-
fontFamily: "compact",
|
|
1972
|
-
fontSize: "300",
|
|
1973
|
-
lineHeight: "compact/300",
|
|
1976
|
+
fontFamily: "font-family/compact",
|
|
1977
|
+
fontSize: "font-size/300",
|
|
1978
|
+
lineHeight: "line-height-compact/300",
|
|
1974
1979
|
fontWeight: 500
|
|
1975
1980
|
},
|
|
1976
1981
|
bodyLg: {
|
|
1977
|
-
|
|
1978
|
-
|
|
1982
|
+
fontFamily: "font-family/compact",
|
|
1983
|
+
fontSize: "font-size/175",
|
|
1984
|
+
lineHeight: "line-height-compact/175",
|
|
1979
1985
|
default: {
|
|
1980
1986
|
fontWeight: 400
|
|
1981
1987
|
},
|
|
@@ -1984,12 +1990,13 @@ var typo_primitives_default = {
|
|
|
1984
1990
|
},
|
|
1985
1991
|
paragraph: {
|
|
1986
1992
|
spacing: "spacing/250",
|
|
1987
|
-
lineHeight: "text/175"
|
|
1993
|
+
lineHeight: "line-height-text/175"
|
|
1988
1994
|
}
|
|
1989
1995
|
},
|
|
1990
1996
|
bodyMd: {
|
|
1991
|
-
|
|
1992
|
-
|
|
1997
|
+
fontFamily: "font-family/compact",
|
|
1998
|
+
fontSize: "font-size/150",
|
|
1999
|
+
lineHeight: "line-height-compact/150",
|
|
1993
2000
|
default: {
|
|
1994
2001
|
fontWeight: 400
|
|
1995
2002
|
},
|
|
@@ -1998,12 +2005,13 @@ var typo_primitives_default = {
|
|
|
1998
2005
|
},
|
|
1999
2006
|
paragraph: {
|
|
2000
2007
|
spacing: "spacing/200",
|
|
2001
|
-
lineHeight: "text/150"
|
|
2008
|
+
lineHeight: "line-height-text/150"
|
|
2002
2009
|
}
|
|
2003
2010
|
},
|
|
2004
2011
|
bodySm: {
|
|
2005
|
-
|
|
2006
|
-
|
|
2012
|
+
fontFamily: "font-family/compact",
|
|
2013
|
+
fontSize: "font-size/125",
|
|
2014
|
+
lineHeight: "line-height-compact/125",
|
|
2007
2015
|
default: {
|
|
2008
2016
|
fontWeight: 400
|
|
2009
2017
|
},
|
|
@@ -2012,12 +2020,13 @@ var typo_primitives_default = {
|
|
|
2012
2020
|
},
|
|
2013
2021
|
paragraph: {
|
|
2014
2022
|
spacing: "spacing/150",
|
|
2015
|
-
lineHeight: "text/125"
|
|
2023
|
+
lineHeight: "line-height-text/125"
|
|
2016
2024
|
}
|
|
2017
2025
|
},
|
|
2018
2026
|
bodyXs: {
|
|
2019
|
-
|
|
2020
|
-
|
|
2027
|
+
fontFamily: "font-family/compact",
|
|
2028
|
+
fontSize: "font-size/100",
|
|
2029
|
+
lineHeight: "line-height-compact/100",
|
|
2021
2030
|
default: {
|
|
2022
2031
|
fontWeight: 400
|
|
2023
2032
|
},
|
|
@@ -2026,12 +2035,13 @@ var typo_primitives_default = {
|
|
|
2026
2035
|
},
|
|
2027
2036
|
paragraph: {
|
|
2028
2037
|
spacing: "spacing/100",
|
|
2029
|
-
lineHeight: "text/100"
|
|
2038
|
+
lineHeight: "line-height-text/100"
|
|
2030
2039
|
}
|
|
2031
2040
|
},
|
|
2032
2041
|
bodyXxs: {
|
|
2033
|
-
|
|
2034
|
-
|
|
2042
|
+
fontFamily: "font-family/compact",
|
|
2043
|
+
fontSize: "font-size/75",
|
|
2044
|
+
lineHeight: "line-height-compact/75",
|
|
2035
2045
|
default: {
|
|
2036
2046
|
fontWeight: 400
|
|
2037
2047
|
},
|
|
@@ -2040,68 +2050,179 @@ var typo_primitives_default = {
|
|
|
2040
2050
|
},
|
|
2041
2051
|
paragraph: {
|
|
2042
2052
|
spacing: "spacing/75",
|
|
2043
|
-
lineHeight: "text/75"
|
|
2053
|
+
lineHeight: "line-height-text/75"
|
|
2044
2054
|
}
|
|
2045
2055
|
}
|
|
2046
2056
|
},
|
|
2047
2057
|
control: {
|
|
2048
2058
|
button: {
|
|
2049
|
-
xl: {
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2059
|
+
xl: {
|
|
2060
|
+
fontSize: "component-scale-font-size/600",
|
|
2061
|
+
lineHeight: "component-scale-line-height/600"
|
|
2062
|
+
},
|
|
2063
|
+
lg: {
|
|
2064
|
+
fontSize: "component-scale-font-size/500",
|
|
2065
|
+
lineHeight: "component-scale-line-height/500"
|
|
2066
|
+
},
|
|
2067
|
+
md: {
|
|
2068
|
+
fontSize: "component-scale-font-size/400",
|
|
2069
|
+
lineHeight: "component-scale-line-height/400"
|
|
2070
|
+
},
|
|
2071
|
+
sm: {
|
|
2072
|
+
fontSize: "component-scale-font-size/300",
|
|
2073
|
+
lineHeight: "component-scale-line-height/300"
|
|
2074
|
+
},
|
|
2075
|
+
xs: {
|
|
2076
|
+
fontSize: "component-scale-font-size/200",
|
|
2077
|
+
lineHeight: "component-scale-line-height/200"
|
|
2078
|
+
}
|
|
2054
2079
|
},
|
|
2055
2080
|
input: {
|
|
2056
|
-
xl: {
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2081
|
+
xl: {
|
|
2082
|
+
fontSize: "component-scale-font-size/600",
|
|
2083
|
+
lineHeight: "component-scale-line-height/600"
|
|
2084
|
+
},
|
|
2085
|
+
lg: {
|
|
2086
|
+
fontSize: "component-scale-font-size/500",
|
|
2087
|
+
lineHeight: "component-scale-line-height/500"
|
|
2088
|
+
},
|
|
2089
|
+
md: {
|
|
2090
|
+
fontSize: "component-scale-font-size/400",
|
|
2091
|
+
lineHeight: "component-scale-line-height/400"
|
|
2092
|
+
},
|
|
2093
|
+
sm: {
|
|
2094
|
+
fontSize: "component-scale-font-size/300",
|
|
2095
|
+
lineHeight: "component-scale-line-height/300"
|
|
2096
|
+
},
|
|
2097
|
+
xs: {
|
|
2098
|
+
fontSize: "component-scale-font-size/200",
|
|
2099
|
+
lineHeight: "component-scale-line-height/200"
|
|
2100
|
+
}
|
|
2061
2101
|
},
|
|
2062
2102
|
checkbox: {
|
|
2063
|
-
xl: {
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2103
|
+
xl: {
|
|
2104
|
+
fontSize: "component-scale-font-size/600",
|
|
2105
|
+
lineHeight: "component-scale-line-height/600"
|
|
2106
|
+
},
|
|
2107
|
+
lg: {
|
|
2108
|
+
fontSize: "component-scale-font-size/500",
|
|
2109
|
+
lineHeight: "component-scale-line-height/500"
|
|
2110
|
+
},
|
|
2111
|
+
md: {
|
|
2112
|
+
fontSize: "component-scale-font-size/400",
|
|
2113
|
+
lineHeight: "component-scale-line-height/400"
|
|
2114
|
+
},
|
|
2115
|
+
sm: {
|
|
2116
|
+
fontSize: "component-scale-font-size/300",
|
|
2117
|
+
lineHeight: "component-scale-line-height/300"
|
|
2118
|
+
}
|
|
2067
2119
|
},
|
|
2068
2120
|
tab: {
|
|
2069
|
-
xl: {
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2121
|
+
xl: {
|
|
2122
|
+
fontSize: "component-scale-font-size/600",
|
|
2123
|
+
lineHeight: "component-scale-line-height/600"
|
|
2124
|
+
},
|
|
2125
|
+
lg: {
|
|
2126
|
+
fontSize: "component-scale-font-size/500",
|
|
2127
|
+
lineHeight: "component-scale-line-height/500"
|
|
2128
|
+
},
|
|
2129
|
+
md: {
|
|
2130
|
+
fontSize: "component-scale-font-size/400",
|
|
2131
|
+
lineHeight: "component-scale-line-height/400"
|
|
2132
|
+
},
|
|
2133
|
+
sm: {
|
|
2134
|
+
fontSize: "component-scale-font-size/300",
|
|
2135
|
+
lineHeight: "component-scale-line-height/300"
|
|
2136
|
+
},
|
|
2137
|
+
xs: {
|
|
2138
|
+
fontSize: "component-scale-font-size/300",
|
|
2139
|
+
lineHeight: "component-scale-line-height/300"
|
|
2140
|
+
}
|
|
2074
2141
|
},
|
|
2075
2142
|
radio: {
|
|
2076
|
-
xl: {
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2143
|
+
xl: {
|
|
2144
|
+
fontSize: "component-scale-font-size/600",
|
|
2145
|
+
lineHeight: "component-scale-line-height/600"
|
|
2146
|
+
},
|
|
2147
|
+
lg: {
|
|
2148
|
+
fontSize: "component-scale-font-size/500",
|
|
2149
|
+
lineHeight: "component-scale-line-height/500"
|
|
2150
|
+
},
|
|
2151
|
+
md: {
|
|
2152
|
+
fontSize: "component-scale-font-size/400",
|
|
2153
|
+
lineHeight: "component-scale-line-height/400"
|
|
2154
|
+
},
|
|
2155
|
+
sm: {
|
|
2156
|
+
fontSize: "component-scale-font-size/300",
|
|
2157
|
+
lineHeight: "component-scale-line-height/300"
|
|
2158
|
+
}
|
|
2080
2159
|
},
|
|
2081
2160
|
segmentedItem: {
|
|
2082
|
-
xl: {
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2161
|
+
xl: {
|
|
2162
|
+
fontSize: "component-scale-font-size/500",
|
|
2163
|
+
lineHeight: "component-scale-line-height/500"
|
|
2164
|
+
},
|
|
2165
|
+
lg: {
|
|
2166
|
+
fontSize: "component-scale-font-size/400",
|
|
2167
|
+
lineHeight: "component-scale-line-height/400"
|
|
2168
|
+
},
|
|
2169
|
+
md: {
|
|
2170
|
+
fontSize: "component-scale-font-size/300",
|
|
2171
|
+
lineHeight: "component-scale-line-height/300"
|
|
2172
|
+
},
|
|
2173
|
+
sm: {
|
|
2174
|
+
fontSize: "component-scale-font-size/200",
|
|
2175
|
+
lineHeight: "component-scale-line-height/200"
|
|
2176
|
+
}
|
|
2086
2177
|
},
|
|
2087
2178
|
tag: {
|
|
2088
|
-
xl: {
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2179
|
+
xl: {
|
|
2180
|
+
fontSize: "component-scale-font-size/600",
|
|
2181
|
+
lineHeight: "component-scale-line-height/600"
|
|
2182
|
+
},
|
|
2183
|
+
lg: {
|
|
2184
|
+
fontSize: "component-scale-font-size/500",
|
|
2185
|
+
lineHeight: "component-scale-line-height/500"
|
|
2186
|
+
},
|
|
2187
|
+
md: {
|
|
2188
|
+
fontSize: "component-scale-font-size/400",
|
|
2189
|
+
lineHeight: "component-scale-line-height/400"
|
|
2190
|
+
},
|
|
2191
|
+
sm: {
|
|
2192
|
+
fontSize: "component-scale-font-size/300",
|
|
2193
|
+
lineHeight: "component-scale-line-height/300"
|
|
2194
|
+
},
|
|
2195
|
+
xs: {
|
|
2196
|
+
fontSize: "component-scale-font-size/200",
|
|
2197
|
+
lineHeight: "component-scale-line-height/200"
|
|
2198
|
+
}
|
|
2093
2199
|
},
|
|
2094
2200
|
toggleButton: {
|
|
2095
|
-
xl: {
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2201
|
+
xl: {
|
|
2202
|
+
fontSize: "component-scale-font-size/600",
|
|
2203
|
+
lineHeight: "component-scale-line-height/600"
|
|
2204
|
+
},
|
|
2205
|
+
lg: {
|
|
2206
|
+
fontSize: "component-scale-font-size/500",
|
|
2207
|
+
lineHeight: "component-scale-line-height/500"
|
|
2208
|
+
},
|
|
2209
|
+
md: {
|
|
2210
|
+
fontSize: "component-scale-font-size/400",
|
|
2211
|
+
lineHeight: "component-scale-line-height/400"
|
|
2212
|
+
},
|
|
2213
|
+
sm: {
|
|
2214
|
+
fontSize: "component-scale-font-size/300",
|
|
2215
|
+
lineHeight: "component-scale-line-height/300"
|
|
2216
|
+
},
|
|
2217
|
+
xs: {
|
|
2218
|
+
fontSize: "component-scale-font-size/200",
|
|
2219
|
+
lineHeight: "component-scale-line-height/200"
|
|
2220
|
+
}
|
|
2100
2221
|
}
|
|
2101
2222
|
}
|
|
2102
2223
|
};
|
|
2103
2224
|
|
|
2104
|
-
// src/
|
|
2225
|
+
// src/xui-primitives/shape-primitives.json
|
|
2105
2226
|
var shape_primitives_default = {
|
|
2106
2227
|
button: {
|
|
2107
2228
|
xl: {
|
|
@@ -2379,7 +2500,7 @@ var shape_primitives_default = {
|
|
|
2379
2500
|
}
|
|
2380
2501
|
};
|
|
2381
2502
|
|
|
2382
|
-
// src/
|
|
2503
|
+
// src/xui-to-legacy/xui-resolver.ts
|
|
2383
2504
|
var FONT_SIZE_SCALE = {
|
|
2384
2505
|
"75": { desktop: "10px", mobile: "10px" },
|
|
2385
2506
|
"100": { desktop: "12px", mobile: "11px" },
|
|
@@ -2441,18 +2562,20 @@ var LINE_HEIGHT_TEXT = {
|
|
|
2441
2562
|
"750": { desktop: "88px", mobile: "72px" }
|
|
2442
2563
|
};
|
|
2443
2564
|
var TYPOGRAPHY_SCALE_FONT_SIZE = {
|
|
2444
|
-
"
|
|
2445
|
-
"
|
|
2446
|
-
"
|
|
2447
|
-
"
|
|
2448
|
-
"
|
|
2565
|
+
"100": "10px",
|
|
2566
|
+
"200": "12px",
|
|
2567
|
+
"300": "14px",
|
|
2568
|
+
"400": "16px",
|
|
2569
|
+
"500": "18px",
|
|
2570
|
+
"600": "20px"
|
|
2449
2571
|
};
|
|
2450
2572
|
var TYPOGRAPHY_SCALE_LINE_HEIGHT = {
|
|
2451
|
-
"
|
|
2452
|
-
"
|
|
2453
|
-
"
|
|
2454
|
-
"
|
|
2455
|
-
"
|
|
2573
|
+
"100": "12px",
|
|
2574
|
+
"200": "14px",
|
|
2575
|
+
"300": "16px",
|
|
2576
|
+
"400": "18px",
|
|
2577
|
+
"500": "20px",
|
|
2578
|
+
"600": "22px"
|
|
2456
2579
|
};
|
|
2457
2580
|
var SPACING_SCALE = {
|
|
2458
2581
|
"50": "2px",
|
|
@@ -2487,7 +2610,7 @@ var STROKE_SCALE = {
|
|
|
2487
2610
|
"2": "2px",
|
|
2488
2611
|
"3": "3px"
|
|
2489
2612
|
};
|
|
2490
|
-
var
|
|
2613
|
+
var XuiResolver = class {
|
|
2491
2614
|
device;
|
|
2492
2615
|
constructor(device = "desktop") {
|
|
2493
2616
|
this.device = device;
|
|
@@ -2556,10 +2679,41 @@ var PentagramResolver = class {
|
|
|
2556
2679
|
const step = alias.replace("typography-scale/line-height/", "");
|
|
2557
2680
|
return TYPOGRAPHY_SCALE_LINE_HEIGHT[step] ?? alias;
|
|
2558
2681
|
}
|
|
2682
|
+
if (alias.startsWith("scale/")) {
|
|
2683
|
+
const step = alias.replace("scale/", "");
|
|
2684
|
+
return context === "lineHeight" ? TYPOGRAPHY_SCALE_LINE_HEIGHT[step] ?? alias : TYPOGRAPHY_SCALE_FONT_SIZE[step] ?? alias;
|
|
2685
|
+
}
|
|
2686
|
+
if (alias.startsWith("line-height-display/")) {
|
|
2687
|
+
const step = alias.replace("line-height-display/", "");
|
|
2688
|
+
const value = LINE_HEIGHT_DISPLAY[step];
|
|
2689
|
+
return value ? value[this.device] : alias;
|
|
2690
|
+
}
|
|
2691
|
+
if (alias.startsWith("line-height-compact/")) {
|
|
2692
|
+
const step = alias.replace("line-height-compact/", "");
|
|
2693
|
+
const value = LINE_HEIGHT_COMPACT[step];
|
|
2694
|
+
return value ? value[this.device] : alias;
|
|
2695
|
+
}
|
|
2696
|
+
if (alias.startsWith("line-height-text/")) {
|
|
2697
|
+
const step = alias.replace("line-height-text/", "");
|
|
2698
|
+
const value = LINE_HEIGHT_TEXT[step];
|
|
2699
|
+
return value ? value[this.device] : alias;
|
|
2700
|
+
}
|
|
2701
|
+
if (alias.startsWith("component-scale-font-size/")) {
|
|
2702
|
+
const step = alias.replace("component-scale-font-size/", "");
|
|
2703
|
+
return TYPOGRAPHY_SCALE_FONT_SIZE[step] ?? alias;
|
|
2704
|
+
}
|
|
2705
|
+
if (alias.startsWith("component-scale-line-height/")) {
|
|
2706
|
+
const step = alias.replace("component-scale-line-height/", "");
|
|
2707
|
+
return TYPOGRAPHY_SCALE_LINE_HEIGHT[step] ?? alias;
|
|
2708
|
+
}
|
|
2559
2709
|
if (alias.startsWith("spacing/")) {
|
|
2560
2710
|
const step = alias.replace("spacing/", "");
|
|
2561
2711
|
return SPACING_SCALE[step] ?? alias;
|
|
2562
2712
|
}
|
|
2713
|
+
if (alias.startsWith("font-family/")) {
|
|
2714
|
+
const key = alias.replace("font-family/", "");
|
|
2715
|
+
return FONT_FAMILY[key] ?? alias;
|
|
2716
|
+
}
|
|
2563
2717
|
if (FONT_FAMILY[alias]) {
|
|
2564
2718
|
return FONT_FAMILY[alias];
|
|
2565
2719
|
}
|
|
@@ -2620,16 +2774,16 @@ var PentagramResolver = class {
|
|
|
2620
2774
|
}
|
|
2621
2775
|
};
|
|
2622
2776
|
function createResolver(device = "desktop") {
|
|
2623
|
-
return new
|
|
2777
|
+
return new XuiResolver(device);
|
|
2624
2778
|
}
|
|
2625
2779
|
function resolveForDesktop(obj) {
|
|
2626
|
-
return new
|
|
2780
|
+
return new XuiResolver("desktop").resolvePrimitives(obj);
|
|
2627
2781
|
}
|
|
2628
2782
|
function resolveForMobile(obj) {
|
|
2629
|
-
return new
|
|
2783
|
+
return new XuiResolver("mobile").resolvePrimitives(obj);
|
|
2630
2784
|
}
|
|
2631
2785
|
|
|
2632
|
-
// src/
|
|
2786
|
+
// src/xui-to-legacy/map-xui-typo-to-legacy.ts
|
|
2633
2787
|
function extractControlTypo(size, defaultFontWeight = 400) {
|
|
2634
2788
|
if (!size) {
|
|
2635
2789
|
return {
|
|
@@ -2660,8 +2814,8 @@ function buildParagraphStyle(variant) {
|
|
|
2660
2814
|
};
|
|
2661
2815
|
}
|
|
2662
2816
|
var DEFAULT_FONT_FAMILY = `'GraphikLCWebUikit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif`;
|
|
2663
|
-
function
|
|
2664
|
-
const { heading, basic, control } =
|
|
2817
|
+
function mapXuiTypoToLegacy(xui, fontFamily = DEFAULT_FONT_FAMILY) {
|
|
2818
|
+
const { heading, basic, control } = xui;
|
|
2665
2819
|
return {
|
|
2666
2820
|
fontFamily,
|
|
2667
2821
|
core: {
|
|
@@ -2748,7 +2902,7 @@ var DELETED_LEGACY_TYPO_VARS = [
|
|
|
2748
2902
|
"core.bodyLg"
|
|
2749
2903
|
];
|
|
2750
2904
|
|
|
2751
|
-
// src/
|
|
2905
|
+
// src/xui-to-legacy/map-xui-shape-to-legacy.ts
|
|
2752
2906
|
function getShapeBorderRadius(shape, preferredSize = "md", fallback = "8px") {
|
|
2753
2907
|
if (!shape) return fallback;
|
|
2754
2908
|
const size = shape[preferredSize] ?? shape["lg"] ?? shape["sm"] ?? Object.values(shape)[0];
|
|
@@ -2759,17 +2913,17 @@ function getShapeBorderWidth(shape, preferredSize = "md", fallback = "1px") {
|
|
|
2759
2913
|
const size = shape[preferredSize] ?? shape["lg"] ?? shape["sm"] ?? Object.values(shape)[0];
|
|
2760
2914
|
return size?.borderWidth ?? fallback;
|
|
2761
2915
|
}
|
|
2762
|
-
function
|
|
2763
|
-
const buttonRadius = getShapeBorderRadius(
|
|
2764
|
-
const inputRadius = getShapeBorderRadius(
|
|
2765
|
-
const checkboxRadius = getShapeBorderRadius(
|
|
2766
|
-
const tagRadius = getShapeBorderRadius(
|
|
2767
|
-
const popupRadius =
|
|
2768
|
-
const borderWidth = getShapeBorderWidth(
|
|
2769
|
-
const buttonSm =
|
|
2770
|
-
const buttonMd =
|
|
2771
|
-
const buttonLg =
|
|
2772
|
-
const buttonXl =
|
|
2916
|
+
function mapXuiShapeToLegacy(xui, existingMisc) {
|
|
2917
|
+
const buttonRadius = getShapeBorderRadius(xui.button, "md", "8px");
|
|
2918
|
+
const inputRadius = getShapeBorderRadius(xui.input, "md", "8px");
|
|
2919
|
+
const checkboxRadius = getShapeBorderRadius(xui.checkbox, "md", "4px");
|
|
2920
|
+
const tagRadius = getShapeBorderRadius(xui.tag, "md", "8px");
|
|
2921
|
+
const popupRadius = xui.modal?.borderRadius ?? xui.contextMenu?.md?.borderRadius ?? xui.tooltip?.md?.borderRadius ?? "8px";
|
|
2922
|
+
const borderWidth = getShapeBorderWidth(xui.button, "md", "2px");
|
|
2923
|
+
const buttonSm = xui.button?.sm?.borderRadius ?? "4px";
|
|
2924
|
+
const buttonMd = xui.button?.md?.borderRadius ?? "6px";
|
|
2925
|
+
const buttonLg = xui.button?.lg?.borderRadius ?? "8px";
|
|
2926
|
+
const buttonXl = xui.button?.xl?.borderRadius ?? "8px";
|
|
2773
2927
|
return {
|
|
2774
2928
|
borderRadiusScale: {
|
|
2775
2929
|
sm: existingMisc?.borderRadiusScale?.sm ?? buttonSm,
|
|
@@ -2791,7 +2945,7 @@ function mapPentagramShapeToLegacy(pentagram, existingMisc) {
|
|
|
2791
2945
|
}
|
|
2792
2946
|
};
|
|
2793
2947
|
}
|
|
2794
|
-
function
|
|
2948
|
+
function flattenXuiShapeToVars(xui) {
|
|
2795
2949
|
const vars = {};
|
|
2796
2950
|
function addSizedComponent(name, shape) {
|
|
2797
2951
|
if (!shape) return;
|
|
@@ -2804,32 +2958,32 @@ function flattenPentagramShapeToVars(pentagram) {
|
|
|
2804
2958
|
}
|
|
2805
2959
|
}
|
|
2806
2960
|
}
|
|
2807
|
-
addSizedComponent("button",
|
|
2808
|
-
addSizedComponent("input",
|
|
2809
|
-
addSizedComponent("checkbox",
|
|
2810
|
-
addSizedComponent("tab",
|
|
2811
|
-
addSizedComponent("tag",
|
|
2812
|
-
addSizedComponent("radio",
|
|
2813
|
-
addSizedComponent("switch",
|
|
2814
|
-
addSizedComponent("segmented",
|
|
2815
|
-
addSizedComponent("segmentedItem",
|
|
2816
|
-
addSizedComponent("tooltip",
|
|
2817
|
-
addSizedComponent("contextMenu",
|
|
2818
|
-
addSizedComponent("avatar",
|
|
2819
|
-
addSizedComponent("toggleButtonGroup",
|
|
2820
|
-
if (
|
|
2821
|
-
vars["shape-modal-borderRadius"] =
|
|
2961
|
+
addSizedComponent("button", xui.button);
|
|
2962
|
+
addSizedComponent("input", xui.input);
|
|
2963
|
+
addSizedComponent("checkbox", xui.checkbox);
|
|
2964
|
+
addSizedComponent("tab", xui.tabItem);
|
|
2965
|
+
addSizedComponent("tag", xui.tag);
|
|
2966
|
+
addSizedComponent("radio", xui.radio);
|
|
2967
|
+
addSizedComponent("switch", xui.switch);
|
|
2968
|
+
addSizedComponent("segmented", xui.segmented);
|
|
2969
|
+
addSizedComponent("segmentedItem", xui.segmentedItem);
|
|
2970
|
+
addSizedComponent("tooltip", xui.tooltip);
|
|
2971
|
+
addSizedComponent("contextMenu", xui.contextMenu);
|
|
2972
|
+
addSizedComponent("avatar", xui.avatar);
|
|
2973
|
+
addSizedComponent("toggleButtonGroup", xui.toggleButtonGroup);
|
|
2974
|
+
if (xui.modal?.borderRadius) {
|
|
2975
|
+
vars["shape-modal-borderRadius"] = xui.modal.borderRadius;
|
|
2822
2976
|
}
|
|
2823
|
-
if (
|
|
2824
|
-
vars["shape-cell-borderRadius"] =
|
|
2977
|
+
if (xui.cell?.borderRadius) {
|
|
2978
|
+
vars["shape-cell-borderRadius"] = xui.cell.borderRadius;
|
|
2825
2979
|
}
|
|
2826
|
-
if (
|
|
2827
|
-
vars["shape-toast-borderRadius"] =
|
|
2980
|
+
if (xui.toast?.borderRadius) {
|
|
2981
|
+
vars["shape-toast-borderRadius"] = xui.toast.borderRadius;
|
|
2828
2982
|
}
|
|
2829
2983
|
return vars;
|
|
2830
2984
|
}
|
|
2831
2985
|
|
|
2832
|
-
// src/themes/
|
|
2986
|
+
// src/themes/xui/mappers/scheme-to-legacy.ts
|
|
2833
2987
|
function mapThemeSchemeToLegacy(colors) {
|
|
2834
2988
|
return {
|
|
2835
2989
|
core: {
|
|
@@ -2839,9 +2993,9 @@ function mapThemeSchemeToLegacy(colors) {
|
|
|
2839
2993
|
ghost: colors.overlay.mono,
|
|
2840
2994
|
tone: colors.layer.scrim,
|
|
2841
2995
|
selection: "transparent",
|
|
2842
|
-
// deleted in
|
|
2996
|
+
// deleted in XUI
|
|
2843
2997
|
hover: "transparent",
|
|
2844
|
-
// deleted in
|
|
2998
|
+
// deleted in XUI
|
|
2845
2999
|
brand: colors.background.brand.secondary,
|
|
2846
3000
|
brandSecondary: colors.background.brandExtra.secondary,
|
|
2847
3001
|
success: colors.background.success.secondary,
|
|
@@ -2947,8 +3101,8 @@ function mapThemeSchemeToLegacy(colors) {
|
|
|
2947
3101
|
};
|
|
2948
3102
|
}
|
|
2949
3103
|
|
|
2950
|
-
// src/
|
|
2951
|
-
function
|
|
3104
|
+
// src/xui-to-legacy/map-xui-theme-to-legacy.ts
|
|
3105
|
+
function buildBaseColorsFromXui(colors) {
|
|
2952
3106
|
return {
|
|
2953
3107
|
content: colors.content.primary,
|
|
2954
3108
|
surface: colors.background.primary,
|
|
@@ -2962,22 +3116,22 @@ function buildBaseColorsFromPentagram(colors) {
|
|
|
2962
3116
|
neutral: colors.content.neutral.primary
|
|
2963
3117
|
};
|
|
2964
3118
|
}
|
|
2965
|
-
function
|
|
3119
|
+
function mapXuiThemeToLegacy(xui, device = "desktop") {
|
|
2966
3120
|
const resolver = createResolver(device);
|
|
2967
|
-
const resolvedTypo = resolver.resolvePrimitives(
|
|
2968
|
-
const resolvedShape = resolver.resolvePrimitives(
|
|
3121
|
+
const resolvedTypo = resolver.resolvePrimitives(xui.text);
|
|
3122
|
+
const resolvedShape = resolver.resolvePrimitives(xui.shape);
|
|
2969
3123
|
return {
|
|
2970
3124
|
colors: {
|
|
2971
|
-
base:
|
|
2972
|
-
...mapThemeSchemeToLegacy(
|
|
3125
|
+
base: buildBaseColorsFromXui(xui.color),
|
|
3126
|
+
...mapThemeSchemeToLegacy(xui.color)
|
|
2973
3127
|
},
|
|
2974
|
-
typo:
|
|
2975
|
-
misc:
|
|
2976
|
-
shadows:
|
|
3128
|
+
typo: mapXuiTypoToLegacy(resolvedTypo),
|
|
3129
|
+
misc: mapXuiShapeToLegacy(resolvedShape),
|
|
3130
|
+
shadows: xui.shadow
|
|
2977
3131
|
};
|
|
2978
3132
|
}
|
|
2979
3133
|
|
|
2980
|
-
// src/themes/
|
|
3134
|
+
// src/themes/xui/presets/pay-station-dark.ts
|
|
2981
3135
|
import { colord as colord10 } from "colord";
|
|
2982
3136
|
var baseDark = {
|
|
2983
3137
|
content: colord10("#ffffff"),
|
|
@@ -3000,7 +3154,7 @@ var baseDark = {
|
|
|
3000
3154
|
onAlert: colord10("#000000"),
|
|
3001
3155
|
onNeutral: colord10("#000000")
|
|
3002
3156
|
};
|
|
3003
|
-
var
|
|
3157
|
+
var xuiDarkScheme = (b) => ({
|
|
3004
3158
|
base: {
|
|
3005
3159
|
content: b.content.toRgbString(),
|
|
3006
3160
|
contentInverse: b.contentInverse.toRgbString(),
|
|
@@ -3332,9 +3486,9 @@ var pentagramDarkScheme = (b) => ({
|
|
|
3332
3486
|
}
|
|
3333
3487
|
}
|
|
3334
3488
|
});
|
|
3335
|
-
var
|
|
3489
|
+
var xuiDark = xuiDarkScheme(baseDark);
|
|
3336
3490
|
|
|
3337
|
-
// src/themes/
|
|
3491
|
+
// src/themes/xui/presets/pay-station-light.ts
|
|
3338
3492
|
import { colord as colord11 } from "colord";
|
|
3339
3493
|
var base10 = {
|
|
3340
3494
|
content: colord11("#000000"),
|
|
@@ -3357,7 +3511,7 @@ var base10 = {
|
|
|
3357
3511
|
onAlert: colord11("#000000"),
|
|
3358
3512
|
onNeutral: colord11("#000000")
|
|
3359
3513
|
};
|
|
3360
|
-
var
|
|
3514
|
+
var xuiLightScheme = (b) => ({
|
|
3361
3515
|
base: {
|
|
3362
3516
|
content: b.content.toRgbString(),
|
|
3363
3517
|
contentInverse: b.contentInverse.toRgbString(),
|
|
@@ -3689,21 +3843,21 @@ var pentagramLightScheme = (b) => ({
|
|
|
3689
3843
|
}
|
|
3690
3844
|
}
|
|
3691
3845
|
});
|
|
3692
|
-
var
|
|
3846
|
+
var xuiLight = xuiLightScheme(base10);
|
|
3693
3847
|
|
|
3694
|
-
// src/themes/
|
|
3695
|
-
function convertToLegacyBase(
|
|
3848
|
+
// src/themes/xui/xui.ts
|
|
3849
|
+
function convertToLegacyBase(xuiBase) {
|
|
3696
3850
|
return {
|
|
3697
|
-
content:
|
|
3698
|
-
surface:
|
|
3699
|
-
project:
|
|
3700
|
-
accent:
|
|
3701
|
-
phantom:
|
|
3702
|
-
path:
|
|
3703
|
-
success:
|
|
3704
|
-
warning:
|
|
3705
|
-
alert:
|
|
3706
|
-
neutral:
|
|
3851
|
+
content: xuiBase.content.toRgbString(),
|
|
3852
|
+
surface: xuiBase.background.toRgbString(),
|
|
3853
|
+
project: xuiBase.brand.toRgbString(),
|
|
3854
|
+
accent: xuiBase.brandExtra.toRgbString(),
|
|
3855
|
+
phantom: xuiBase.mono.toRgbString(),
|
|
3856
|
+
path: xuiBase.brand.toRgbString(),
|
|
3857
|
+
success: xuiBase.success.toRgbString(),
|
|
3858
|
+
warning: xuiBase.warning.toRgbString(),
|
|
3859
|
+
alert: xuiBase.alert.toRgbString(),
|
|
3860
|
+
neutral: xuiBase.neutral.toRgbString()
|
|
3707
3861
|
};
|
|
3708
3862
|
}
|
|
3709
3863
|
var desktopResolver = createResolver("desktop");
|
|
@@ -3711,41 +3865,41 @@ var resolvedTypoDesktop = desktopResolver.resolvePrimitives(
|
|
|
3711
3865
|
typo_primitives_default
|
|
3712
3866
|
);
|
|
3713
3867
|
var resolvedShapeDesktop = desktopResolver.resolvePrimitives(shape_primitives_default);
|
|
3714
|
-
var
|
|
3715
|
-
var
|
|
3716
|
-
var
|
|
3868
|
+
var xuiTypo = mapXuiTypoToLegacy(resolvedTypoDesktop);
|
|
3869
|
+
var xuiMisc = mapXuiShapeToLegacy(resolvedShapeDesktop);
|
|
3870
|
+
var paystationXuiLightLegacyCompatible = {
|
|
3717
3871
|
colors: {
|
|
3718
3872
|
base: convertToLegacyBase(base10),
|
|
3719
|
-
...mapThemeSchemeToLegacy(
|
|
3873
|
+
...mapThemeSchemeToLegacy(xuiLight)
|
|
3720
3874
|
},
|
|
3721
|
-
typo:
|
|
3722
|
-
misc:
|
|
3875
|
+
typo: xuiTypo,
|
|
3876
|
+
misc: xuiMisc,
|
|
3723
3877
|
shadows: shadowsDefault,
|
|
3724
|
-
globalStyle: "
|
|
3878
|
+
globalStyle: "xui"
|
|
3725
3879
|
};
|
|
3726
|
-
var
|
|
3880
|
+
var paystationXuiDarkLegacyCompatible = {
|
|
3727
3881
|
colors: {
|
|
3728
3882
|
base: convertToLegacyBase(baseDark),
|
|
3729
|
-
...mapThemeSchemeToLegacy(
|
|
3883
|
+
...mapThemeSchemeToLegacy(xuiDark)
|
|
3730
3884
|
},
|
|
3731
|
-
typo:
|
|
3732
|
-
misc:
|
|
3885
|
+
typo: xuiTypo,
|
|
3886
|
+
misc: xuiMisc,
|
|
3733
3887
|
shadows: shadowsDefault,
|
|
3734
|
-
globalStyle: "
|
|
3888
|
+
globalStyle: "xui"
|
|
3735
3889
|
};
|
|
3736
|
-
var
|
|
3737
|
-
|
|
3890
|
+
var paystationXuiLight = {
|
|
3891
|
+
color: xuiLight,
|
|
3738
3892
|
shape: shape_primitives_default,
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
globalStyle: "
|
|
3893
|
+
text: typo_primitives_default,
|
|
3894
|
+
shadow: shadowsDefault,
|
|
3895
|
+
globalStyle: "xui"
|
|
3742
3896
|
};
|
|
3743
|
-
var
|
|
3744
|
-
|
|
3897
|
+
var paystationXuiDark = {
|
|
3898
|
+
color: xuiDark,
|
|
3745
3899
|
shape: shape_primitives_default,
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
globalStyle: "
|
|
3900
|
+
text: typo_primitives_default,
|
|
3901
|
+
shadow: shadowsDefault,
|
|
3902
|
+
globalStyle: "xui"
|
|
3749
3903
|
};
|
|
3750
3904
|
|
|
3751
3905
|
// src/themes/index.ts
|
|
@@ -3926,15 +4080,15 @@ var palettes = {
|
|
|
3926
4080
|
// src/generators/themeGenerator.ts
|
|
3927
4081
|
import { colord as colord12 } from "colord";
|
|
3928
4082
|
import merge from "lodash.merge";
|
|
3929
|
-
var
|
|
4083
|
+
var xuiBaseColors = {
|
|
3930
4084
|
payStationLight: base10,
|
|
3931
4085
|
payStationDark: baseDark
|
|
3932
4086
|
};
|
|
3933
|
-
var
|
|
3934
|
-
payStationLight:
|
|
3935
|
-
payStationDark:
|
|
4087
|
+
var xuiColorsScheme = {
|
|
4088
|
+
payStationLight: xuiLightScheme,
|
|
4089
|
+
payStationDark: xuiDarkScheme
|
|
3936
4090
|
};
|
|
3937
|
-
var
|
|
4091
|
+
var xuiBaseColorsKeys = [
|
|
3938
4092
|
"content",
|
|
3939
4093
|
"contentInverse",
|
|
3940
4094
|
"background",
|
|
@@ -3983,12 +4137,9 @@ var generateWithScheme = ({
|
|
|
3983
4137
|
};
|
|
3984
4138
|
function themeGenerator(props) {
|
|
3985
4139
|
const { schemeName, baseColors } = props;
|
|
3986
|
-
if (schemeName in
|
|
3987
|
-
const schemeBase = baseColors ?
|
|
3988
|
-
|
|
3989
|
-
baseColors
|
|
3990
|
-
) : { ...pentagramBaseColors[schemeName] };
|
|
3991
|
-
return pentagramColorsScheme[schemeName](schemeBase);
|
|
4140
|
+
if (schemeName in xuiColorsScheme) {
|
|
4141
|
+
const schemeBase = baseColors ? applyXuiColors(xuiBaseColors[schemeName], baseColors) : { ...xuiBaseColors[schemeName] };
|
|
4142
|
+
return xuiColorsScheme[schemeName](schemeBase);
|
|
3992
4143
|
}
|
|
3993
4144
|
const { customParams, parentTheme: propParentTheme } = props;
|
|
3994
4145
|
const parentTheme = propParentTheme || themes[schemeName] || {};
|
|
@@ -4007,44 +4158,58 @@ function themeGenerator(props) {
|
|
|
4007
4158
|
}
|
|
4008
4159
|
return generateTheme;
|
|
4009
4160
|
}
|
|
4010
|
-
var
|
|
4161
|
+
var applyXuiColors = (schemeBase, overrides) => {
|
|
4011
4162
|
const result = { ...schemeBase };
|
|
4012
|
-
|
|
4163
|
+
xuiBaseColorsKeys.forEach((key) => {
|
|
4013
4164
|
if (overrides[key]) result[key] = colord12(overrides[key]);
|
|
4014
4165
|
});
|
|
4015
4166
|
return result;
|
|
4016
4167
|
};
|
|
4017
4168
|
export {
|
|
4018
4169
|
DELETED_LEGACY_TYPO_VARS,
|
|
4019
|
-
PentagramResolver,
|
|
4170
|
+
XuiResolver as PentagramResolver,
|
|
4171
|
+
XuiResolver,
|
|
4020
4172
|
base10 as base,
|
|
4021
4173
|
baseDark,
|
|
4022
|
-
buildBaseColorsFromPentagram,
|
|
4174
|
+
buildBaseColorsFromXui as buildBaseColorsFromPentagram,
|
|
4175
|
+
buildBaseColorsFromXui,
|
|
4023
4176
|
createResolver,
|
|
4024
4177
|
emails,
|
|
4025
4178
|
emailsDark,
|
|
4026
4179
|
emailsThemes,
|
|
4027
|
-
flattenPentagramShapeToVars,
|
|
4180
|
+
flattenXuiShapeToVars as flattenPentagramShapeToVars,
|
|
4181
|
+
flattenXuiShapeToVars,
|
|
4028
4182
|
generateWithScheme,
|
|
4029
|
-
mapPentagramShapeToLegacy,
|
|
4030
|
-
mapPentagramThemeToLegacy,
|
|
4031
|
-
mapPentagramTypoToLegacy,
|
|
4183
|
+
mapXuiShapeToLegacy as mapPentagramShapeToLegacy,
|
|
4184
|
+
mapXuiThemeToLegacy as mapPentagramThemeToLegacy,
|
|
4185
|
+
mapXuiTypoToLegacy as mapPentagramTypoToLegacy,
|
|
4032
4186
|
mapThemeSchemeToLegacy,
|
|
4187
|
+
mapXuiShapeToLegacy,
|
|
4188
|
+
mapXuiThemeToLegacy,
|
|
4189
|
+
mapXuiTypoToLegacy,
|
|
4033
4190
|
palettes,
|
|
4034
4191
|
paystation4,
|
|
4035
4192
|
paystation4Dark,
|
|
4036
4193
|
paystation4Gaijin,
|
|
4037
4194
|
paystation4Nexters,
|
|
4038
|
-
paystation4PentagramDark,
|
|
4039
|
-
paystation4PentagramDarkLegacyCompatible,
|
|
4040
|
-
paystation4PentagramLight,
|
|
4041
|
-
paystation4PentagramLightLegacyCompatible,
|
|
4195
|
+
paystationXuiDark as paystation4PentagramDark,
|
|
4196
|
+
paystationXuiDarkLegacyCompatible as paystation4PentagramDarkLegacyCompatible,
|
|
4197
|
+
paystationXuiLight as paystation4PentagramLight,
|
|
4198
|
+
paystationXuiLightLegacyCompatible as paystation4PentagramLightLegacyCompatible,
|
|
4042
4199
|
paystation4Take2,
|
|
4043
4200
|
paystation4Themes,
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4201
|
+
paystationXuiDark as paystation4XuiDark,
|
|
4202
|
+
paystationXuiDarkLegacyCompatible as paystation4XuiDarkLegacyCompatible,
|
|
4203
|
+
paystationXuiLight as paystation4XuiLight,
|
|
4204
|
+
paystationXuiLightLegacyCompatible as paystation4XuiLightLegacyCompatible,
|
|
4205
|
+
paystationXuiDark,
|
|
4206
|
+
paystationXuiDarkLegacyCompatible,
|
|
4207
|
+
paystationXuiLight,
|
|
4208
|
+
paystationXuiLightLegacyCompatible,
|
|
4209
|
+
xuiDark as pentagramDark,
|
|
4210
|
+
xuiDarkScheme as pentagramDarkScheme,
|
|
4211
|
+
xuiLight as pentagramLight,
|
|
4212
|
+
xuiLightScheme as pentagramLightScheme,
|
|
4048
4213
|
primaryPalette,
|
|
4049
4214
|
publisherV2,
|
|
4050
4215
|
publisherV2Dark,
|
|
@@ -4057,6 +4222,10 @@ export {
|
|
|
4057
4222
|
themesBaseColors,
|
|
4058
4223
|
themesBaseColorsArray,
|
|
4059
4224
|
themesColorsScheme,
|
|
4060
|
-
typo_primitives_default as typoPrimitives
|
|
4225
|
+
typo_primitives_default as typoPrimitives,
|
|
4226
|
+
xuiDark,
|
|
4227
|
+
xuiDarkScheme,
|
|
4228
|
+
xuiLight,
|
|
4229
|
+
xuiLightScheme
|
|
4061
4230
|
};
|
|
4062
4231
|
//# sourceMappingURL=index.mjs.map
|