@sanity/ui 2.8.8 → 2.8.9
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/dist/_chunks-cjs/getTheme_v2.js +7 -10
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +7 -10
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +7 -10
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.esm.js +94 -144
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +94 -144
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -144
- package/dist/index.mjs.map +1 -1
- package/dist/theme.esm.js +218 -235
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +218 -235
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +218 -235
- package/dist/theme.mjs.map +1 -1
- package/package.json +32 -32
package/dist/theme.esm.js
CHANGED
|
@@ -981,7 +981,7 @@ function v0_v2(v0) {
|
|
|
981
981
|
...input.switch
|
|
982
982
|
}
|
|
983
983
|
},
|
|
984
|
-
layer: layer
|
|
984
|
+
layer: layer ?? defaultThemeConfig.layer,
|
|
985
985
|
media,
|
|
986
986
|
radius,
|
|
987
987
|
shadow,
|
|
@@ -1301,8 +1301,7 @@ function isColorConfigBlendKey(str) {
|
|
|
1301
1301
|
return COLOR_CONFIG_BLEND_KEYS.includes(str);
|
|
1302
1302
|
}
|
|
1303
1303
|
function isColorTokenValue(str) {
|
|
1304
|
-
|
|
1305
|
-
return ((_a = parseTokenValue(str)) == null ? void 0 : _a.type) === "color" || ((_b = parseTokenValue(str)) == null ? void 0 : _b.type) === "hue";
|
|
1304
|
+
return parseTokenValue(str)?.type === "color" || parseTokenValue(str)?.type === "hue";
|
|
1306
1305
|
}
|
|
1307
1306
|
function isColorValue(str) {
|
|
1308
1307
|
return str === "black" || str === "white";
|
|
@@ -1995,47 +1994,46 @@ function resolveBaseColorTokens(sparseTokens) {
|
|
|
1995
1994
|
return tokens;
|
|
1996
1995
|
}
|
|
1997
1996
|
function resolveBaseColorTones(inputTokens, tone) {
|
|
1998
|
-
|
|
1999
|
-
const spec = merge((_a = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _a["*"], (_b = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _b[tone]), hue = spec._hue || ((_d = (_c = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _c[tone]) == null ? void 0 : _d._hue) || "gray";
|
|
1997
|
+
const spec = merge(inputTokens?.base?.["*"], inputTokens?.base?.[tone]), hue = spec._hue || inputTokens?.base?.[tone]?._hue || "gray";
|
|
2000
1998
|
return {
|
|
2001
1999
|
...spec,
|
|
2002
2000
|
_hue: hue,
|
|
2003
2001
|
avatar: {
|
|
2004
|
-
gray: merge({ _hue: "gray" },
|
|
2005
|
-
blue: merge({ _hue: "blue" },
|
|
2006
|
-
purple: merge({ _hue: "purple" },
|
|
2007
|
-
magenta: merge({ _hue: "magenta" },
|
|
2008
|
-
red: merge({ _hue: "red" },
|
|
2009
|
-
orange: merge({ _hue: "orange" },
|
|
2010
|
-
yellow: merge({ _hue: "yellow" },
|
|
2011
|
-
green: merge({ _hue: "green" },
|
|
2012
|
-
cyan: merge({ _hue: "cyan" },
|
|
2002
|
+
gray: merge({ _hue: "gray" }, spec.avatar?.["*"], spec.avatar?.gray),
|
|
2003
|
+
blue: merge({ _hue: "blue" }, spec.avatar?.["*"], spec.avatar?.blue),
|
|
2004
|
+
purple: merge({ _hue: "purple" }, spec.avatar?.["*"], spec.avatar?.purple),
|
|
2005
|
+
magenta: merge({ _hue: "magenta" }, spec.avatar?.["*"], spec.avatar?.magenta),
|
|
2006
|
+
red: merge({ _hue: "red" }, spec.avatar?.["*"], spec.avatar?.red),
|
|
2007
|
+
orange: merge({ _hue: "orange" }, spec.avatar?.["*"], spec.avatar?.orange),
|
|
2008
|
+
yellow: merge({ _hue: "yellow" }, spec.avatar?.["*"], spec.avatar?.yellow),
|
|
2009
|
+
green: merge({ _hue: "green" }, spec.avatar?.["*"], spec.avatar?.green),
|
|
2010
|
+
cyan: merge({ _hue: "cyan" }, spec.avatar?.["*"], spec.avatar?.cyan)
|
|
2013
2011
|
},
|
|
2014
2012
|
badge: {
|
|
2015
2013
|
default: {
|
|
2016
|
-
_hue:
|
|
2017
|
-
...
|
|
2018
|
-
...
|
|
2014
|
+
_hue: inputTokens?.base?.default?._hue || hue,
|
|
2015
|
+
...spec.badge?.["*"],
|
|
2016
|
+
...spec.badge?.default
|
|
2019
2017
|
},
|
|
2020
2018
|
primary: {
|
|
2021
|
-
_hue:
|
|
2022
|
-
...
|
|
2023
|
-
...
|
|
2019
|
+
_hue: inputTokens?.base?.primary?._hue || hue,
|
|
2020
|
+
...spec.badge?.["*"],
|
|
2021
|
+
...spec.badge?.primary
|
|
2024
2022
|
},
|
|
2025
2023
|
positive: {
|
|
2026
|
-
_hue:
|
|
2027
|
-
...
|
|
2028
|
-
...
|
|
2024
|
+
_hue: inputTokens?.base?.positive?._hue || hue,
|
|
2025
|
+
...spec.badge?.["*"],
|
|
2026
|
+
...spec.badge?.positive
|
|
2029
2027
|
},
|
|
2030
2028
|
caution: {
|
|
2031
|
-
_hue:
|
|
2032
|
-
...
|
|
2033
|
-
...
|
|
2029
|
+
_hue: inputTokens?.base?.caution?._hue || hue,
|
|
2030
|
+
...spec.badge?.["*"],
|
|
2031
|
+
...spec.badge?.caution
|
|
2034
2032
|
},
|
|
2035
2033
|
critical: {
|
|
2036
|
-
_hue:
|
|
2037
|
-
...
|
|
2038
|
-
...
|
|
2034
|
+
_hue: inputTokens?.base?.critical?._hue || hue,
|
|
2035
|
+
...spec.badge?.["*"],
|
|
2036
|
+
...spec.badge?.critical
|
|
2039
2037
|
}
|
|
2040
2038
|
}
|
|
2041
2039
|
};
|
|
@@ -2059,52 +2057,51 @@ function resolveButtonModeColorTokens(inputTokens, mode, tone) {
|
|
|
2059
2057
|
return tokens;
|
|
2060
2058
|
}
|
|
2061
2059
|
function resolveButtonStateColorTokens(inputTokens, tone, mode, state) {
|
|
2062
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z;
|
|
2063
2060
|
const spec = merge(
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
), hue = spec._hue ||
|
|
2061
|
+
inputTokens?.button?.[mode]?.["*"]?.["*"],
|
|
2062
|
+
inputTokens?.button?.[mode]?.[tone]?.["*"],
|
|
2063
|
+
inputTokens?.button?.[mode]?.["*"]?.[state],
|
|
2064
|
+
inputTokens?.button?.[mode]?.[tone]?.[state]
|
|
2065
|
+
), hue = spec._hue || inputTokens?.base?.[tone]?._hue;
|
|
2069
2066
|
return {
|
|
2070
2067
|
...spec,
|
|
2071
2068
|
_hue: hue,
|
|
2072
2069
|
avatar: {
|
|
2073
|
-
gray: merge({ _hue: "gray" },
|
|
2074
|
-
blue: merge({ _hue: "blue" },
|
|
2075
|
-
purple: merge({ _hue: "purple" },
|
|
2076
|
-
magenta: merge({ _hue: "magenta" },
|
|
2077
|
-
red: merge({ _hue: "red" },
|
|
2078
|
-
orange: merge({ _hue: "orange" },
|
|
2079
|
-
yellow: merge({ _hue: "yellow" },
|
|
2080
|
-
green: merge({ _hue: "green" },
|
|
2081
|
-
cyan: merge({ _hue: "cyan" },
|
|
2070
|
+
gray: merge({ _hue: "gray" }, spec.avatar?.["*"], spec.avatar?.gray),
|
|
2071
|
+
blue: merge({ _hue: "blue" }, spec.avatar?.["*"], spec.avatar?.blue),
|
|
2072
|
+
purple: merge({ _hue: "purple" }, spec.avatar?.["*"], spec.avatar?.purple),
|
|
2073
|
+
magenta: merge({ _hue: "magenta" }, spec.avatar?.["*"], spec.avatar?.magenta),
|
|
2074
|
+
red: merge({ _hue: "red" }, spec.avatar?.["*"], spec.avatar?.red),
|
|
2075
|
+
orange: merge({ _hue: "orange" }, spec.avatar?.["*"], spec.avatar?.orange),
|
|
2076
|
+
yellow: merge({ _hue: "yellow" }, spec.avatar?.["*"], spec.avatar?.yellow),
|
|
2077
|
+
green: merge({ _hue: "green" }, spec.avatar?.["*"], spec.avatar?.green),
|
|
2078
|
+
cyan: merge({ _hue: "cyan" }, spec.avatar?.["*"], spec.avatar?.cyan)
|
|
2082
2079
|
},
|
|
2083
2080
|
badge: {
|
|
2084
2081
|
default: {
|
|
2085
|
-
_hue:
|
|
2086
|
-
...
|
|
2087
|
-
...
|
|
2082
|
+
_hue: inputTokens?.base?.default?._hue,
|
|
2083
|
+
...spec.badge?.["*"],
|
|
2084
|
+
...spec.badge?.default
|
|
2088
2085
|
},
|
|
2089
2086
|
primary: {
|
|
2090
|
-
_hue:
|
|
2091
|
-
...
|
|
2092
|
-
...
|
|
2087
|
+
_hue: inputTokens?.base?.primary?._hue,
|
|
2088
|
+
...spec.badge?.["*"],
|
|
2089
|
+
...spec.badge?.primary
|
|
2093
2090
|
},
|
|
2094
2091
|
positive: {
|
|
2095
|
-
_hue:
|
|
2096
|
-
...
|
|
2097
|
-
...
|
|
2092
|
+
_hue: inputTokens?.base?.positive?._hue,
|
|
2093
|
+
...spec.badge?.["*"],
|
|
2094
|
+
...spec.badge?.positive
|
|
2098
2095
|
},
|
|
2099
2096
|
caution: {
|
|
2100
|
-
_hue:
|
|
2101
|
-
...
|
|
2102
|
-
...
|
|
2097
|
+
_hue: inputTokens?.base?.caution?._hue,
|
|
2098
|
+
...spec.badge?.["*"],
|
|
2099
|
+
...spec.badge?.caution
|
|
2103
2100
|
},
|
|
2104
2101
|
critical: {
|
|
2105
|
-
_hue:
|
|
2106
|
-
...
|
|
2107
|
-
...
|
|
2102
|
+
_hue: inputTokens?.base?.critical?._hue,
|
|
2103
|
+
...spec.badge?.["*"],
|
|
2104
|
+
...spec.badge?.critical
|
|
2108
2105
|
}
|
|
2109
2106
|
}
|
|
2110
2107
|
};
|
|
@@ -2122,13 +2119,12 @@ function resolveInputModeColorTokens(inputTokens, mode) {
|
|
|
2122
2119
|
return states;
|
|
2123
2120
|
}
|
|
2124
2121
|
function resolveInputStateColorTokens(inputTokens, mode, state) {
|
|
2125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2126
2122
|
const spec = merge(
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
), hue = spec._hue ||
|
|
2123
|
+
inputTokens?.input?.["*"]?.["*"],
|
|
2124
|
+
inputTokens?.input?.[mode]?.["*"],
|
|
2125
|
+
inputTokens?.input?.["*"]?.[state],
|
|
2126
|
+
inputTokens?.input?.[mode]?.[state]
|
|
2127
|
+
), hue = spec._hue || inputTokens?.input?.[mode]?._hue;
|
|
2132
2128
|
return { ...spec, _hue: hue };
|
|
2133
2129
|
}
|
|
2134
2130
|
function resolveSelectableColorTokens(inputTokens) {
|
|
@@ -2138,61 +2134,59 @@ function resolveSelectableColorTokens(inputTokens) {
|
|
|
2138
2134
|
return tokens;
|
|
2139
2135
|
}
|
|
2140
2136
|
function resolveSelectableToneColorTokens(inputTokens, tone) {
|
|
2141
|
-
var _a, _b, _c, _d;
|
|
2142
2137
|
const states = {
|
|
2143
|
-
_hue:
|
|
2138
|
+
_hue: inputTokens?.selectable?.[tone]?._hue || inputTokens?.base?.[tone]?._hue
|
|
2144
2139
|
};
|
|
2145
2140
|
for (const state of THEME_COLOR_STATES)
|
|
2146
2141
|
states[state] = resolveSelectableStateColorTokens(inputTokens, tone, state);
|
|
2147
2142
|
return states;
|
|
2148
2143
|
}
|
|
2149
2144
|
function resolveSelectableStateColorTokens(inputTokens, tone, state) {
|
|
2150
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V;
|
|
2151
2145
|
const spec = merge(
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
), hue = spec._hue ||
|
|
2146
|
+
inputTokens?.selectable?.["*"]?.["*"],
|
|
2147
|
+
inputTokens?.selectable?.[tone]?.["*"],
|
|
2148
|
+
inputTokens?.selectable?.["*"]?.[state],
|
|
2149
|
+
inputTokens?.selectable?.[tone]?.[state]
|
|
2150
|
+
), hue = spec._hue || inputTokens?.base?.[tone]?._hue;
|
|
2157
2151
|
return {
|
|
2158
2152
|
...spec,
|
|
2159
2153
|
_hue: hue,
|
|
2160
2154
|
avatar: {
|
|
2161
|
-
gray: merge({ _hue: "gray" },
|
|
2162
|
-
blue: merge({ _hue: "blue" },
|
|
2163
|
-
purple: merge({ _hue: "purple" },
|
|
2164
|
-
magenta: merge({ _hue: "magenta" },
|
|
2165
|
-
red: merge({ _hue: "red" },
|
|
2166
|
-
orange: merge({ _hue: "orange" },
|
|
2167
|
-
yellow: merge({ _hue: "yellow" },
|
|
2168
|
-
green: merge({ _hue: "green" },
|
|
2169
|
-
cyan: merge({ _hue: "cyan" },
|
|
2155
|
+
gray: merge({ _hue: "gray" }, spec.avatar?.["*"], spec.avatar?.gray),
|
|
2156
|
+
blue: merge({ _hue: "blue" }, spec.avatar?.["*"], spec.avatar?.blue),
|
|
2157
|
+
purple: merge({ _hue: "purple" }, spec.avatar?.["*"], spec.avatar?.purple),
|
|
2158
|
+
magenta: merge({ _hue: "magenta" }, spec.avatar?.["*"], spec.avatar?.magenta),
|
|
2159
|
+
red: merge({ _hue: "red" }, spec.avatar?.["*"], spec.avatar?.red),
|
|
2160
|
+
orange: merge({ _hue: "orange" }, spec.avatar?.["*"], spec.avatar?.orange),
|
|
2161
|
+
yellow: merge({ _hue: "yellow" }, spec.avatar?.["*"], spec.avatar?.yellow),
|
|
2162
|
+
green: merge({ _hue: "green" }, spec.avatar?.["*"], spec.avatar?.green),
|
|
2163
|
+
cyan: merge({ _hue: "cyan" }, spec.avatar?.["*"], spec.avatar?.cyan)
|
|
2170
2164
|
},
|
|
2171
2165
|
badge: {
|
|
2172
2166
|
default: {
|
|
2173
|
-
_hue:
|
|
2174
|
-
...
|
|
2175
|
-
...
|
|
2167
|
+
_hue: inputTokens?.base?.default?._hue,
|
|
2168
|
+
...spec.badge?.["*"],
|
|
2169
|
+
...spec.badge?.default
|
|
2176
2170
|
},
|
|
2177
2171
|
primary: {
|
|
2178
|
-
_hue:
|
|
2179
|
-
...
|
|
2180
|
-
...
|
|
2172
|
+
_hue: inputTokens?.base?.primary?._hue,
|
|
2173
|
+
...spec.badge?.["*"],
|
|
2174
|
+
...spec.badge?.primary
|
|
2181
2175
|
},
|
|
2182
2176
|
positive: {
|
|
2183
|
-
_hue:
|
|
2184
|
-
...
|
|
2185
|
-
...
|
|
2177
|
+
_hue: inputTokens?.base?.positive?._hue,
|
|
2178
|
+
...spec.badge?.["*"],
|
|
2179
|
+
...spec.badge?.positive
|
|
2186
2180
|
},
|
|
2187
2181
|
caution: {
|
|
2188
|
-
_hue:
|
|
2189
|
-
...
|
|
2190
|
-
...
|
|
2182
|
+
_hue: inputTokens?.base?.caution?._hue,
|
|
2183
|
+
...spec.badge?.["*"],
|
|
2184
|
+
...spec.badge?.caution
|
|
2191
2185
|
},
|
|
2192
2186
|
critical: {
|
|
2193
|
-
_hue:
|
|
2194
|
-
...
|
|
2195
|
-
...
|
|
2187
|
+
_hue: inputTokens?.base?.critical?._hue,
|
|
2188
|
+
...spec.badge?.["*"],
|
|
2189
|
+
...spec.badge?.critical
|
|
2196
2190
|
}
|
|
2197
2191
|
}
|
|
2198
2192
|
};
|
|
@@ -2200,7 +2194,7 @@ function resolveSelectableStateColorTokens(inputTokens, tone, state) {
|
|
|
2200
2194
|
function buildColorTheme(config) {
|
|
2201
2195
|
const resolvedConfig = {
|
|
2202
2196
|
...config,
|
|
2203
|
-
color: resolveColorTokens(config
|
|
2197
|
+
color: resolveColorTokens(config?.color)
|
|
2204
2198
|
};
|
|
2205
2199
|
return {
|
|
2206
2200
|
light: buildColorScheme({ scheme: "light" }, resolvedConfig),
|
|
@@ -2219,57 +2213,55 @@ function buildColorScheme(options, config) {
|
|
|
2219
2213
|
};
|
|
2220
2214
|
}
|
|
2221
2215
|
function buildCardColorTheme(options, config) {
|
|
2222
|
-
|
|
2223
|
-
const { scheme, tone } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
|
|
2216
|
+
const { scheme, tone } = options, tokens = config?.color?.base?.[tone], context = { hue: tokens?._hue || "gray", scheme };
|
|
2224
2217
|
return {
|
|
2225
|
-
_blend: (
|
|
2218
|
+
_blend: (tokens?._blend || ["multiply", "screen"])[scheme === "light" ? 0 : 1],
|
|
2226
2219
|
_dark: scheme === "dark",
|
|
2227
2220
|
accent: {
|
|
2228
|
-
fg: resolveColorTokenValue(context,
|
|
2221
|
+
fg: resolveColorTokenValue(context, tokens?.accent?.fg)
|
|
2229
2222
|
},
|
|
2230
2223
|
avatar: buildAvatarColorTheme({ scheme }, tokens),
|
|
2231
|
-
backdrop: resolveColorTokenValue(context, tokens
|
|
2232
|
-
badge: buildBadgeColorTheme(tokens
|
|
2233
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2234
|
-
border: resolveColorTokenValue(context, tokens
|
|
2224
|
+
backdrop: resolveColorTokenValue(context, tokens?.backdrop),
|
|
2225
|
+
badge: buildBadgeColorTheme(tokens?.badge, { scheme }, config),
|
|
2226
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2227
|
+
border: resolveColorTokenValue(context, tokens?.border),
|
|
2235
2228
|
button: buildButtonColorTheme({ scheme }, config),
|
|
2236
2229
|
code: {
|
|
2237
|
-
bg: resolveColorTokenValue(context,
|
|
2238
|
-
fg: resolveColorTokenValue(context,
|
|
2230
|
+
bg: resolveColorTokenValue(context, tokens?.code?.bg),
|
|
2231
|
+
fg: resolveColorTokenValue(context, tokens?.code?.fg)
|
|
2239
2232
|
},
|
|
2240
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2241
|
-
focusRing: resolveColorTokenValue(context, tokens
|
|
2242
|
-
icon: resolveColorTokenValue(context, tokens
|
|
2233
|
+
fg: resolveColorTokenValue(context, tokens?.fg),
|
|
2234
|
+
focusRing: resolveColorTokenValue(context, tokens?.focusRing),
|
|
2235
|
+
icon: resolveColorTokenValue(context, tokens?.icon),
|
|
2243
2236
|
input: buildInputColorTheme({ scheme, tone }, config),
|
|
2244
2237
|
kbd: {
|
|
2245
|
-
bg: resolveColorTokenValue(context,
|
|
2246
|
-
fg: resolveColorTokenValue(context,
|
|
2247
|
-
border: resolveColorTokenValue(context,
|
|
2238
|
+
bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
|
|
2239
|
+
fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
|
|
2240
|
+
border: resolveColorTokenValue(context, tokens?.kbd?.border)
|
|
2248
2241
|
},
|
|
2249
2242
|
link: {
|
|
2250
|
-
fg: resolveColorTokenValue(context,
|
|
2243
|
+
fg: resolveColorTokenValue(context, tokens?.link?.fg)
|
|
2251
2244
|
},
|
|
2252
2245
|
muted: {
|
|
2253
|
-
bg: resolveColorTokenValue(context,
|
|
2254
|
-
fg: resolveColorTokenValue(context,
|
|
2246
|
+
bg: resolveColorTokenValue(context, tokens?.muted?.bg),
|
|
2247
|
+
fg: resolveColorTokenValue(context, tokens?.muted?.fg)
|
|
2255
2248
|
},
|
|
2256
2249
|
selectable: buildSelectableColorTheme({ scheme }, config),
|
|
2257
2250
|
shadow: buildShadowColorTheme({ scheme, tone }, config),
|
|
2258
2251
|
skeleton: {
|
|
2259
|
-
from: resolveColorTokenValue(context,
|
|
2260
|
-
to: resolveColorTokenValue(context,
|
|
2252
|
+
from: resolveColorTokenValue(context, tokens?.skeleton?.from),
|
|
2253
|
+
to: resolveColorTokenValue(context, tokens?.skeleton?.to)
|
|
2261
2254
|
},
|
|
2262
2255
|
syntax: buildSyntaxColorTheme({ scheme }, config)
|
|
2263
2256
|
};
|
|
2264
2257
|
}
|
|
2265
2258
|
function buildShadowColorTheme(options, config) {
|
|
2266
|
-
|
|
2267
|
-
const { scheme, tone } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
|
|
2259
|
+
const { scheme, tone } = options, tokens = config?.color?.base?.[tone], context = { hue: tokens?._hue || "gray", scheme };
|
|
2268
2260
|
return {
|
|
2269
|
-
outline: resolveColorTokenValue(context,
|
|
2270
|
-
umbra: resolveColorTokenValue(context,
|
|
2271
|
-
penumbra: resolveColorTokenValue(context,
|
|
2272
|
-
ambient: resolveColorTokenValue(context,
|
|
2261
|
+
outline: resolveColorTokenValue(context, tokens?.shadow?.outline),
|
|
2262
|
+
umbra: resolveColorTokenValue(context, tokens?.shadow?.umbra),
|
|
2263
|
+
penumbra: resolveColorTokenValue(context, tokens?.shadow?.penumbra),
|
|
2264
|
+
ambient: resolveColorTokenValue(context, tokens?.shadow?.ambient)
|
|
2273
2265
|
};
|
|
2274
2266
|
}
|
|
2275
2267
|
function buildAvatarColorTheme(options, stateTokens) {
|
|
@@ -2287,12 +2279,11 @@ function buildAvatarColorTheme(options, stateTokens) {
|
|
|
2287
2279
|
};
|
|
2288
2280
|
}
|
|
2289
2281
|
function _buildAvatarColorTheme(options, stateTokens) {
|
|
2290
|
-
|
|
2291
|
-
const { color: color2, scheme } = options, tokens = (_a = stateTokens == null ? void 0 : stateTokens.avatar) == null ? void 0 : _a[color2], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
|
|
2282
|
+
const { color: color2, scheme } = options, tokens = stateTokens?.avatar?.[color2], context = { hue: tokens?._hue || "gray", scheme };
|
|
2292
2283
|
return {
|
|
2293
|
-
_blend: (
|
|
2294
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2295
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2284
|
+
_blend: (tokens?._blend || ["screen", "multiply"])[scheme === "light" ? 0 : 1],
|
|
2285
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2286
|
+
fg: resolveColorTokenValue(context, tokens?.fg)
|
|
2296
2287
|
};
|
|
2297
2288
|
}
|
|
2298
2289
|
function buildBadgeColorTheme(tokens, options, config) {
|
|
@@ -2306,13 +2297,12 @@ function buildBadgeColorTheme(tokens, options, config) {
|
|
|
2306
2297
|
};
|
|
2307
2298
|
}
|
|
2308
2299
|
function _buildBadgeColorTheme(parentTokens, options, config) {
|
|
2309
|
-
|
|
2310
|
-
const { scheme, tone } = options, tokens = parentTokens == null ? void 0 : parentTokens[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || ((_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone]) == null ? void 0 : _c._hue) || "gray", scheme };
|
|
2300
|
+
const { scheme, tone } = options, tokens = parentTokens?.[tone], context = { hue: tokens?._hue || config?.color?.base?.[tone]?._hue || "gray", scheme };
|
|
2311
2301
|
return {
|
|
2312
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2313
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2314
|
-
dot: resolveColorTokenValue(context, tokens
|
|
2315
|
-
icon: resolveColorTokenValue(context, tokens
|
|
2302
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2303
|
+
fg: resolveColorTokenValue(context, tokens?.fg),
|
|
2304
|
+
dot: resolveColorTokenValue(context, tokens?.dot),
|
|
2305
|
+
icon: resolveColorTokenValue(context, tokens?.icon)
|
|
2316
2306
|
};
|
|
2317
2307
|
}
|
|
2318
2308
|
function buildButtonColorTheme(options, config) {
|
|
@@ -2334,38 +2324,37 @@ function buildButtonStatesColorTheme(options, config) {
|
|
|
2334
2324
|
return states;
|
|
2335
2325
|
}
|
|
2336
2326
|
function buildButtonStateColorTheme(options, config) {
|
|
2337
|
-
|
|
2338
|
-
const { mode, tone, scheme, state } = options, tokens = (_d = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.button) == null ? void 0 : _b[mode]) == null ? void 0 : _c[tone]) == null ? void 0 : _d[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
|
|
2327
|
+
const { mode, tone, scheme, state } = options, tokens = config?.color?.button?.[mode]?.[tone]?.[state], hue = tokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = { hue, scheme };
|
|
2339
2328
|
return {
|
|
2340
2329
|
_blend: blendMode[scheme === "light" ? 0 : 1],
|
|
2341
2330
|
accent: {
|
|
2342
|
-
fg: resolveColorTokenValue(context,
|
|
2331
|
+
fg: resolveColorTokenValue(context, tokens?.accent?.fg)
|
|
2343
2332
|
},
|
|
2344
2333
|
avatar: buildAvatarColorTheme({ scheme }, tokens),
|
|
2345
|
-
badge: buildBadgeColorTheme(tokens
|
|
2346
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2347
|
-
border: resolveColorTokenValue(context, tokens
|
|
2334
|
+
badge: buildBadgeColorTheme(tokens?.badge, { scheme }, config),
|
|
2335
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2336
|
+
border: resolveColorTokenValue(context, tokens?.border),
|
|
2348
2337
|
code: {
|
|
2349
|
-
bg: resolveColorTokenValue(context,
|
|
2350
|
-
fg: resolveColorTokenValue(context,
|
|
2338
|
+
bg: resolveColorTokenValue(context, tokens?.code?.bg),
|
|
2339
|
+
fg: resolveColorTokenValue(context, tokens?.code?.fg)
|
|
2351
2340
|
},
|
|
2352
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2353
|
-
icon: resolveColorTokenValue(context, tokens
|
|
2341
|
+
fg: resolveColorTokenValue(context, tokens?.fg),
|
|
2342
|
+
icon: resolveColorTokenValue(context, tokens?.icon),
|
|
2354
2343
|
muted: {
|
|
2355
|
-
bg: resolveColorTokenValue(context,
|
|
2356
|
-
fg: resolveColorTokenValue(context,
|
|
2344
|
+
bg: resolveColorTokenValue(context, tokens?.muted?.bg),
|
|
2345
|
+
fg: resolveColorTokenValue(context, tokens?.muted?.fg)
|
|
2357
2346
|
},
|
|
2358
2347
|
kbd: {
|
|
2359
|
-
bg: resolveColorTokenValue(context,
|
|
2360
|
-
fg: resolveColorTokenValue(context,
|
|
2361
|
-
border: resolveColorTokenValue(context,
|
|
2348
|
+
bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
|
|
2349
|
+
fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
|
|
2350
|
+
border: resolveColorTokenValue(context, tokens?.kbd?.border)
|
|
2362
2351
|
},
|
|
2363
2352
|
link: {
|
|
2364
|
-
fg: resolveColorTokenValue(context,
|
|
2353
|
+
fg: resolveColorTokenValue(context, tokens?.link?.fg)
|
|
2365
2354
|
},
|
|
2366
2355
|
skeleton: {
|
|
2367
|
-
from: resolveColorTokenValue(context,
|
|
2368
|
-
to: resolveColorTokenValue(context,
|
|
2356
|
+
from: resolveColorTokenValue(context, tokens?.skeleton?.from),
|
|
2357
|
+
to: resolveColorTokenValue(context, tokens?.skeleton?.to)
|
|
2369
2358
|
}
|
|
2370
2359
|
};
|
|
2371
2360
|
}
|
|
@@ -2386,17 +2375,16 @@ function buildInputStatesColorTheme(options, config) {
|
|
|
2386
2375
|
};
|
|
2387
2376
|
}
|
|
2388
2377
|
function buildInputStateColorTheme(options, config) {
|
|
2389
|
-
|
|
2390
|
-
const { mode, tone, scheme, state } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.input) == null ? void 0 : _b[mode]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || ((_f = (_e = (_d = config == null ? void 0 : config.color) == null ? void 0 : _d.base) == null ? void 0 : _e[tone]) == null ? void 0 : _f._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
|
|
2378
|
+
const { mode, tone, scheme, state } = options, tokens = config?.color?.input?.[mode]?.[state], hue = tokens?._hue || config?.color?.base?.[tone]?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = { hue, scheme };
|
|
2391
2379
|
return {
|
|
2392
2380
|
_blend: blendMode[scheme === "light" ? 0 : 1],
|
|
2393
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2394
|
-
border: resolveColorTokenValue(context, tokens
|
|
2395
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2381
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2382
|
+
border: resolveColorTokenValue(context, tokens?.border),
|
|
2383
|
+
fg: resolveColorTokenValue(context, tokens?.fg),
|
|
2396
2384
|
muted: {
|
|
2397
|
-
bg: resolveColorTokenValue(context,
|
|
2385
|
+
bg: resolveColorTokenValue(context, tokens?.muted?.bg)
|
|
2398
2386
|
},
|
|
2399
|
-
placeholder: resolveColorTokenValue(context, tokens
|
|
2387
|
+
placeholder: resolveColorTokenValue(context, tokens?.placeholder)
|
|
2400
2388
|
};
|
|
2401
2389
|
}
|
|
2402
2390
|
function buildSelectableColorTheme(options, config) {
|
|
@@ -2412,81 +2400,79 @@ function buildSelectableStatesColorTheme(options, config) {
|
|
|
2412
2400
|
return states;
|
|
2413
2401
|
}
|
|
2414
2402
|
function buildSelectableStateColorTheme(options, config) {
|
|
2415
|
-
|
|
2416
|
-
const { scheme, state, tone } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.selectable) == null ? void 0 : _b[tone]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
|
|
2403
|
+
const { scheme, state, tone } = options, tokens = config?.color?.selectable?.[tone]?.[state], hue = tokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = { hue, scheme };
|
|
2417
2404
|
return {
|
|
2418
2405
|
_blend: blendMode[scheme === "light" ? 0 : 1],
|
|
2419
2406
|
accent: {
|
|
2420
|
-
fg: resolveColorTokenValue(context,
|
|
2407
|
+
fg: resolveColorTokenValue(context, tokens?.accent?.fg)
|
|
2421
2408
|
},
|
|
2422
2409
|
avatar: buildAvatarColorTheme({ scheme }, tokens),
|
|
2423
|
-
badge: buildBadgeColorTheme(tokens
|
|
2424
|
-
bg: resolveColorTokenValue(context, tokens
|
|
2425
|
-
border: resolveColorTokenValue(context, tokens
|
|
2410
|
+
badge: buildBadgeColorTheme(tokens?.badge, { scheme }, config),
|
|
2411
|
+
bg: resolveColorTokenValue(context, tokens?.bg),
|
|
2412
|
+
border: resolveColorTokenValue(context, tokens?.border),
|
|
2426
2413
|
code: {
|
|
2427
|
-
bg: resolveColorTokenValue(context,
|
|
2428
|
-
fg: resolveColorTokenValue(context,
|
|
2414
|
+
bg: resolveColorTokenValue(context, tokens?.code?.bg),
|
|
2415
|
+
fg: resolveColorTokenValue(context, tokens?.code?.fg)
|
|
2429
2416
|
},
|
|
2430
|
-
fg: resolveColorTokenValue(context, tokens
|
|
2431
|
-
icon: resolveColorTokenValue(context, tokens
|
|
2417
|
+
fg: resolveColorTokenValue(context, tokens?.fg),
|
|
2418
|
+
icon: resolveColorTokenValue(context, tokens?.icon),
|
|
2432
2419
|
muted: {
|
|
2433
|
-
bg: resolveColorTokenValue(context,
|
|
2434
|
-
fg: resolveColorTokenValue(context,
|
|
2420
|
+
bg: resolveColorTokenValue(context, tokens?.muted?.bg),
|
|
2421
|
+
fg: resolveColorTokenValue(context, tokens?.muted?.fg)
|
|
2435
2422
|
},
|
|
2436
2423
|
kbd: {
|
|
2437
|
-
bg: resolveColorTokenValue(context,
|
|
2438
|
-
fg: resolveColorTokenValue(context,
|
|
2439
|
-
border: resolveColorTokenValue(context,
|
|
2424
|
+
bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
|
|
2425
|
+
fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
|
|
2426
|
+
border: resolveColorTokenValue(context, tokens?.kbd?.border)
|
|
2440
2427
|
},
|
|
2441
2428
|
link: {
|
|
2442
|
-
fg: resolveColorTokenValue(context,
|
|
2429
|
+
fg: resolveColorTokenValue(context, tokens?.link?.fg)
|
|
2443
2430
|
},
|
|
2444
2431
|
skeleton: {
|
|
2445
|
-
from: resolveColorTokenValue(context,
|
|
2446
|
-
to: resolveColorTokenValue(context,
|
|
2432
|
+
from: resolveColorTokenValue(context, tokens?.skeleton?.from),
|
|
2433
|
+
to: resolveColorTokenValue(context, tokens?.skeleton?.to)
|
|
2447
2434
|
}
|
|
2448
2435
|
};
|
|
2449
2436
|
}
|
|
2450
2437
|
function buildSyntaxColorTheme(options, config) {
|
|
2451
|
-
|
|
2452
|
-
const { scheme } = options, tokens = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.syntax, context = { hue: "gray", scheme };
|
|
2438
|
+
const { scheme } = options, tokens = config?.color?.syntax, context = { hue: "gray", scheme };
|
|
2453
2439
|
return {
|
|
2454
|
-
atrule: resolveColorTokenValue(context, tokens
|
|
2455
|
-
attrName: resolveColorTokenValue(context, tokens
|
|
2456
|
-
attrValue: resolveColorTokenValue(context, tokens
|
|
2457
|
-
attribute: resolveColorTokenValue(context, tokens
|
|
2458
|
-
boolean: resolveColorTokenValue(context, tokens
|
|
2459
|
-
builtin: resolveColorTokenValue(context, tokens
|
|
2460
|
-
cdata: resolveColorTokenValue(context, tokens
|
|
2461
|
-
char: resolveColorTokenValue(context, tokens
|
|
2462
|
-
class: resolveColorTokenValue(context, tokens
|
|
2463
|
-
className: resolveColorTokenValue(context, tokens
|
|
2464
|
-
comment: resolveColorTokenValue(context, tokens
|
|
2465
|
-
constant: resolveColorTokenValue(context, tokens
|
|
2466
|
-
deleted: resolveColorTokenValue(context, tokens
|
|
2467
|
-
doctype: resolveColorTokenValue(context, tokens
|
|
2468
|
-
entity: resolveColorTokenValue(context, tokens
|
|
2469
|
-
function: resolveColorTokenValue(context, tokens
|
|
2470
|
-
hexcode: resolveColorTokenValue(context, tokens
|
|
2471
|
-
id: resolveColorTokenValue(context, tokens
|
|
2472
|
-
important: resolveColorTokenValue(context, tokens
|
|
2473
|
-
inserted: resolveColorTokenValue(context, tokens
|
|
2474
|
-
keyword: resolveColorTokenValue(context, tokens
|
|
2475
|
-
number: resolveColorTokenValue(context, tokens
|
|
2476
|
-
operator: resolveColorTokenValue(context, tokens
|
|
2477
|
-
prolog: resolveColorTokenValue(context, tokens
|
|
2478
|
-
property: resolveColorTokenValue(context, tokens
|
|
2479
|
-
pseudoClass: resolveColorTokenValue(context, tokens
|
|
2480
|
-
pseudoElement: resolveColorTokenValue(context, tokens
|
|
2481
|
-
punctuation: resolveColorTokenValue(context, tokens
|
|
2482
|
-
regex: resolveColorTokenValue(context, tokens
|
|
2483
|
-
selector: resolveColorTokenValue(context, tokens
|
|
2484
|
-
string: resolveColorTokenValue(context, tokens
|
|
2485
|
-
symbol: resolveColorTokenValue(context, tokens
|
|
2486
|
-
tag: resolveColorTokenValue(context, tokens
|
|
2487
|
-
unit: resolveColorTokenValue(context, tokens
|
|
2488
|
-
url: resolveColorTokenValue(context, tokens
|
|
2489
|
-
variable: resolveColorTokenValue(context, tokens
|
|
2440
|
+
atrule: resolveColorTokenValue(context, tokens?.atrule),
|
|
2441
|
+
attrName: resolveColorTokenValue(context, tokens?.attrName),
|
|
2442
|
+
attrValue: resolveColorTokenValue(context, tokens?.attrValue),
|
|
2443
|
+
attribute: resolveColorTokenValue(context, tokens?.attribute),
|
|
2444
|
+
boolean: resolveColorTokenValue(context, tokens?.boolean),
|
|
2445
|
+
builtin: resolveColorTokenValue(context, tokens?.builtin),
|
|
2446
|
+
cdata: resolveColorTokenValue(context, tokens?.cdata),
|
|
2447
|
+
char: resolveColorTokenValue(context, tokens?.char),
|
|
2448
|
+
class: resolveColorTokenValue(context, tokens?.class),
|
|
2449
|
+
className: resolveColorTokenValue(context, tokens?.className),
|
|
2450
|
+
comment: resolveColorTokenValue(context, tokens?.comment),
|
|
2451
|
+
constant: resolveColorTokenValue(context, tokens?.constant),
|
|
2452
|
+
deleted: resolveColorTokenValue(context, tokens?.deleted),
|
|
2453
|
+
doctype: resolveColorTokenValue(context, tokens?.doctype),
|
|
2454
|
+
entity: resolveColorTokenValue(context, tokens?.entity),
|
|
2455
|
+
function: resolveColorTokenValue(context, tokens?.function),
|
|
2456
|
+
hexcode: resolveColorTokenValue(context, tokens?.hexcode),
|
|
2457
|
+
id: resolveColorTokenValue(context, tokens?.id),
|
|
2458
|
+
important: resolveColorTokenValue(context, tokens?.important),
|
|
2459
|
+
inserted: resolveColorTokenValue(context, tokens?.inserted),
|
|
2460
|
+
keyword: resolveColorTokenValue(context, tokens?.keyword),
|
|
2461
|
+
number: resolveColorTokenValue(context, tokens?.number),
|
|
2462
|
+
operator: resolveColorTokenValue(context, tokens?.operator),
|
|
2463
|
+
prolog: resolveColorTokenValue(context, tokens?.prolog),
|
|
2464
|
+
property: resolveColorTokenValue(context, tokens?.property),
|
|
2465
|
+
pseudoClass: resolveColorTokenValue(context, tokens?.pseudoClass),
|
|
2466
|
+
pseudoElement: resolveColorTokenValue(context, tokens?.pseudoElement),
|
|
2467
|
+
punctuation: resolveColorTokenValue(context, tokens?.punctuation),
|
|
2468
|
+
regex: resolveColorTokenValue(context, tokens?.regex),
|
|
2469
|
+
selector: resolveColorTokenValue(context, tokens?.selector),
|
|
2470
|
+
string: resolveColorTokenValue(context, tokens?.string),
|
|
2471
|
+
symbol: resolveColorTokenValue(context, tokens?.symbol),
|
|
2472
|
+
tag: resolveColorTokenValue(context, tokens?.tag),
|
|
2473
|
+
unit: resolveColorTokenValue(context, tokens?.unit),
|
|
2474
|
+
url: resolveColorTokenValue(context, tokens?.url),
|
|
2475
|
+
variable: resolveColorTokenValue(context, tokens?.variable)
|
|
2490
2476
|
};
|
|
2491
2477
|
}
|
|
2492
2478
|
const defaultColorPalette = color;
|
|
@@ -2676,8 +2662,7 @@ function renderColorHex(color2) {
|
|
|
2676
2662
|
return typeof color2 == "string" ? color2 : color2.hex;
|
|
2677
2663
|
}
|
|
2678
2664
|
function renderThemeColorSchemes(value, config) {
|
|
2679
|
-
|
|
2680
|
-
const colorPalette = (_a = config == null ? void 0 : config.palette) != null ? _a : defaultColorPalette;
|
|
2665
|
+
const colorPalette = config?.palette ?? defaultColorPalette;
|
|
2681
2666
|
return {
|
|
2682
2667
|
light: renderThemeColorScheme(colorPalette, value.light),
|
|
2683
2668
|
dark: renderThemeColorScheme(colorPalette, value.dark)
|
|
@@ -2854,7 +2839,6 @@ function renderThemeColorButtonStates(value, options) {
|
|
|
2854
2839
|
};
|
|
2855
2840
|
}
|
|
2856
2841
|
function renderThemeColorState(value, options) {
|
|
2857
|
-
var _a, _b;
|
|
2858
2842
|
const { baseBg, blendMode: rootBlendMode, colorPalette } = options, blendMode = value._blend || "multiply", rootOptions = {
|
|
2859
2843
|
bg: baseBg,
|
|
2860
2844
|
blendMode: rootBlendMode,
|
|
@@ -2892,8 +2876,8 @@ function renderThemeColorState(value, options) {
|
|
|
2892
2876
|
border: renderColorValue(value.kbd.border, colorOptions)
|
|
2893
2877
|
},
|
|
2894
2878
|
skeleton: {
|
|
2895
|
-
from: renderColorValue(
|
|
2896
|
-
to: renderColorValue(
|
|
2879
|
+
from: renderColorValue(value.skeleton?.from, colorOptions),
|
|
2880
|
+
to: renderColorValue(value.skeleton?.to, colorOptions)
|
|
2897
2881
|
}
|
|
2898
2882
|
};
|
|
2899
2883
|
}
|
|
@@ -2984,27 +2968,26 @@ function renderSyntaxColorTheme(value, options) {
|
|
|
2984
2968
|
};
|
|
2985
2969
|
}
|
|
2986
2970
|
function buildTheme(config) {
|
|
2987
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
2988
2971
|
const colorTheme = buildColorTheme(config), v2 = {
|
|
2989
2972
|
_version: 2,
|
|
2990
|
-
avatar:
|
|
2991
|
-
button:
|
|
2992
|
-
card:
|
|
2973
|
+
avatar: config?.avatar ?? defaultThemeConfig.avatar,
|
|
2974
|
+
button: config?.button ?? defaultThemeConfig.button,
|
|
2975
|
+
card: config?.card ?? defaultThemeConfig.card,
|
|
2993
2976
|
// How colors are generated:
|
|
2994
2977
|
// 1. Merge custom tokens with default tokens
|
|
2995
2978
|
// 2. Generate tree of color keys (gray/500, black, white, etc.)
|
|
2996
2979
|
// 3. Apply mixing and render to hex values
|
|
2997
2980
|
// render(build(mergeWithDefaults()))
|
|
2998
2981
|
color: renderThemeColorSchemes(colorTheme, config),
|
|
2999
|
-
container:
|
|
3000
|
-
font:
|
|
3001
|
-
input:
|
|
3002
|
-
layer:
|
|
3003
|
-
media:
|
|
3004
|
-
radius:
|
|
3005
|
-
shadow:
|
|
3006
|
-
space:
|
|
3007
|
-
style:
|
|
2982
|
+
container: config?.container ?? defaultThemeConfig.container,
|
|
2983
|
+
font: config?.font ?? defaultThemeFonts,
|
|
2984
|
+
input: config?.input ?? defaultThemeConfig.input,
|
|
2985
|
+
layer: config?.layer ?? defaultThemeConfig.layer,
|
|
2986
|
+
media: config?.media ?? defaultThemeConfig.media,
|
|
2987
|
+
radius: config?.radius ?? defaultThemeConfig.radius,
|
|
2988
|
+
shadow: config?.shadow ?? defaultThemeConfig.shadow,
|
|
2989
|
+
space: config?.space ?? defaultThemeConfig.space,
|
|
2990
|
+
style: config?.style ?? defaultThemeConfig.style
|
|
3008
2991
|
};
|
|
3009
2992
|
return v2_v0(v2);
|
|
3010
2993
|
}
|