@sanity/ui 3.4.3 → 3.4.5
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/refractor.cjs +18 -0
- package/dist/_chunks/refractor.cjs.map +1 -0
- package/dist/_chunks/refractor.js +9 -7
- package/dist/_chunks/refractor.js.map +1 -1
- package/dist/_chunks/{tabList.mjs → tabList.cjs} +922 -431
- package/dist/_chunks/tabList.cjs.map +1 -0
- package/dist/_chunks/tabList.js +471 -880
- package/dist/_chunks/tabList.js.map +1 -1
- package/dist/_chunks/{theme.mjs → theme.cjs} +266 -11
- package/dist/_chunks/theme.cjs.map +1 -0
- package/dist/_chunks/{theme.d.mts → theme.d.cts} +11 -11
- package/dist/_chunks/{theme.d.mts.map → theme.d.cts.map} +1 -1
- package/dist/_chunks/theme.d.ts +10 -10
- package/dist/_chunks/theme.js +10 -265
- package/dist/_chunks/theme.js.map +1 -1
- package/dist/_chunks/{useTheme.d.mts → useTheme.d.cts} +26 -26
- package/dist/_chunks/{useTheme.d.mts.map → useTheme.d.cts.map} +1 -1
- package/dist/_chunks/useTheme.d.ts +24 -24
- package/dist/_visual-editing.cjs +3 -0
- package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +1 -1
- package/dist/_visual-editing.js +2 -3
- package/dist/{index.mjs → index.cjs} +513 -511
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +12 -12
- package/dist/{index.d.mts.map → index.d.cts.map} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +521 -501
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +3 -0
- package/dist/{theme.d.mts → theme.d.cts} +1 -1
- package/dist/theme.js +2 -3
- package/package.json +22 -23
- package/dist/_chunks/refractor.mjs +0 -20
- package/dist/_chunks/refractor.mjs.map +0 -1
- package/dist/_chunks/tabList.mjs.map +0 -1
- package/dist/_chunks/theme.mjs.map +0 -1
- package/dist/_visual-editing.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/theme.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let _sanity_color = require("@sanity/color");
|
|
2
2
|
function createSelectableTones(opts, base, dark, solid, muted) {
|
|
3
3
|
return {
|
|
4
4
|
default: _createSelectableStates(opts, base, dark, solid, muted, "default"),
|
|
@@ -1987,18 +1987,18 @@ const THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multi
|
|
|
1987
1987
|
"hovered",
|
|
1988
1988
|
"readOnly",
|
|
1989
1989
|
"disabled"
|
|
1990
|
-
], THEME_COLOR_AVATAR_COLORS = COLOR_HUES;
|
|
1990
|
+
], THEME_COLOR_AVATAR_COLORS = _sanity_color.COLOR_HUES;
|
|
1991
1991
|
/** @internal */
|
|
1992
1992
|
function isColorBlendModeValue(str) {
|
|
1993
1993
|
return THEME_COLOR_BLEND_MODES.includes(str);
|
|
1994
1994
|
}
|
|
1995
1995
|
/** @internal */
|
|
1996
1996
|
function isColorHueKey(str) {
|
|
1997
|
-
return COLOR_HUES.includes(str);
|
|
1997
|
+
return _sanity_color.COLOR_HUES.includes(str);
|
|
1998
1998
|
}
|
|
1999
1999
|
/** @internal */
|
|
2000
2000
|
function isColorTintKey(str) {
|
|
2001
|
-
return COLOR_TINTS.includes(str);
|
|
2001
|
+
return _sanity_color.COLOR_TINTS.includes(str);
|
|
2002
2002
|
}
|
|
2003
2003
|
/** @internal */
|
|
2004
2004
|
function isColorButtonMode(str) {
|
|
@@ -2729,7 +2729,7 @@ function resolveBaseColorTones(inputTokens, tone) {
|
|
|
2729
2729
|
return {
|
|
2730
2730
|
...spec,
|
|
2731
2731
|
_hue: hue,
|
|
2732
|
-
avatar: COLOR_HUES.reduce((acc, hue) => ({
|
|
2732
|
+
avatar: _sanity_color.COLOR_HUES.reduce((acc, hue) => ({
|
|
2733
2733
|
...acc,
|
|
2734
2734
|
[hue]: merge({ _hue: hue }, spec.avatar?.["*"], spec.avatar?.[hue])
|
|
2735
2735
|
}), {}),
|
|
@@ -2763,7 +2763,7 @@ function resolveButtonStateColorTokens(inputTokens, tone, mode, state) {
|
|
|
2763
2763
|
return {
|
|
2764
2764
|
...spec,
|
|
2765
2765
|
_hue: hue,
|
|
2766
|
-
avatar: COLOR_HUES.reduce((acc, hue) => ({
|
|
2766
|
+
avatar: _sanity_color.COLOR_HUES.reduce((acc, hue) => ({
|
|
2767
2767
|
...acc,
|
|
2768
2768
|
[hue]: merge({ _hue: hue }, spec.avatar?.["*"], spec.avatar?.[hue])
|
|
2769
2769
|
}), {}),
|
|
@@ -2809,7 +2809,7 @@ function resolveSelectableStateColorTokens(inputTokens, tone, state) {
|
|
|
2809
2809
|
return {
|
|
2810
2810
|
...spec,
|
|
2811
2811
|
_hue: hue,
|
|
2812
|
-
avatar: COLOR_HUES.reduce((acc, hue) => ({
|
|
2812
|
+
avatar: _sanity_color.COLOR_HUES.reduce((acc, hue) => ({
|
|
2813
2813
|
...acc,
|
|
2814
2814
|
[hue]: merge({ _hue: hue }, spec.avatar?.["*"], spec.avatar?.[hue])
|
|
2815
2815
|
}), {}),
|
|
@@ -3195,7 +3195,7 @@ function buildSyntaxColorTheme(options, config) {
|
|
|
3195
3195
|
variable: resolveColorTokenValue(context, tokens?.variable)
|
|
3196
3196
|
};
|
|
3197
3197
|
}
|
|
3198
|
-
const defaultColorPalette = color;
|
|
3198
|
+
const defaultColorPalette = _sanity_color.color;
|
|
3199
3199
|
function mixChannel(b, s, weight) {
|
|
3200
3200
|
return b + (s - b) * weight;
|
|
3201
3201
|
}
|
|
@@ -3550,7 +3550,7 @@ function renderThemeColorKBD(value, options) {
|
|
|
3550
3550
|
}
|
|
3551
3551
|
function renderThemeColorAvatar(value, options) {
|
|
3552
3552
|
let colorAvatar = {};
|
|
3553
|
-
for (let hue of COLOR_HUES) colorAvatar[hue] = renderThemeColorAvatarColor(value[hue], options);
|
|
3553
|
+
for (let hue of _sanity_color.COLOR_HUES) colorAvatar[hue] = renderThemeColorAvatarColor(value[hue], options);
|
|
3554
3554
|
return colorAvatar;
|
|
3555
3555
|
}
|
|
3556
3556
|
function renderThemeColorAvatarColor(value, options) {
|
|
@@ -3846,6 +3846,261 @@ function _setCachedTheme(rootTheme, scheme, tone, theme) {
|
|
|
3846
3846
|
let schemeCache = cache.get(scheme);
|
|
3847
3847
|
schemeCache.has(tone) || schemeCache.set(tone, /* @__PURE__ */ new WeakMap()), schemeCache.get(tone).set(rootTheme, theme);
|
|
3848
3848
|
}
|
|
3849
|
-
|
|
3849
|
+
Object.defineProperty(exports, "A", {
|
|
3850
|
+
enumerable: !0,
|
|
3851
|
+
get: function() {
|
|
3852
|
+
return COLOR_CONFIG_STATES;
|
|
3853
|
+
}
|
|
3854
|
+
}), Object.defineProperty(exports, "B", {
|
|
3855
|
+
enumerable: !0,
|
|
3856
|
+
get: function() {
|
|
3857
|
+
return THEME_COLOR_CARD_TONES;
|
|
3858
|
+
}
|
|
3859
|
+
}), Object.defineProperty(exports, "C", {
|
|
3860
|
+
enumerable: !0,
|
|
3861
|
+
get: function() {
|
|
3862
|
+
return parseTokenKey;
|
|
3863
|
+
}
|
|
3864
|
+
}), Object.defineProperty(exports, "D", {
|
|
3865
|
+
enumerable: !0,
|
|
3866
|
+
get: function() {
|
|
3867
|
+
return COLOR_CONFIG_CARD_TONES;
|
|
3868
|
+
}
|
|
3869
|
+
}), Object.defineProperty(exports, "E", {
|
|
3870
|
+
enumerable: !0,
|
|
3871
|
+
get: function() {
|
|
3872
|
+
return COLOR_CONFIG_CARD_KEYS;
|
|
3873
|
+
}
|
|
3874
|
+
}), Object.defineProperty(exports, "F", {
|
|
3875
|
+
enumerable: !0,
|
|
3876
|
+
get: function() {
|
|
3877
|
+
return isColorHueKey;
|
|
3878
|
+
}
|
|
3879
|
+
}), Object.defineProperty(exports, "G", {
|
|
3880
|
+
enumerable: !0,
|
|
3881
|
+
get: function() {
|
|
3882
|
+
return THEME_COLOR_STATE_TONES;
|
|
3883
|
+
}
|
|
3884
|
+
}), Object.defineProperty(exports, "H", {
|
|
3885
|
+
enumerable: !0,
|
|
3886
|
+
get: function() {
|
|
3887
|
+
return THEME_COLOR_INPUT_STATES;
|
|
3888
|
+
}
|
|
3889
|
+
}), Object.defineProperty(exports, "I", {
|
|
3890
|
+
enumerable: !0,
|
|
3891
|
+
get: function() {
|
|
3892
|
+
return isColorTintKey;
|
|
3893
|
+
}
|
|
3894
|
+
}), Object.defineProperty(exports, "J", {
|
|
3895
|
+
enumerable: !0,
|
|
3896
|
+
get: function() {
|
|
3897
|
+
return is_v2;
|
|
3898
|
+
}
|
|
3899
|
+
}), Object.defineProperty(exports, "K", {
|
|
3900
|
+
enumerable: !0,
|
|
3901
|
+
get: function() {
|
|
3902
|
+
return v2_v0;
|
|
3903
|
+
}
|
|
3904
|
+
}), Object.defineProperty(exports, "L", {
|
|
3905
|
+
enumerable: !0,
|
|
3906
|
+
get: function() {
|
|
3907
|
+
return THEME_COLOR_AVATAR_COLORS;
|
|
3908
|
+
}
|
|
3909
|
+
}), Object.defineProperty(exports, "M", {
|
|
3910
|
+
enumerable: !0,
|
|
3911
|
+
get: function() {
|
|
3912
|
+
return COLOR_CONFIG_STATE_TONES;
|
|
3913
|
+
}
|
|
3914
|
+
}), Object.defineProperty(exports, "N", {
|
|
3915
|
+
enumerable: !0,
|
|
3916
|
+
get: function() {
|
|
3917
|
+
return isColorBlendModeValue;
|
|
3918
|
+
}
|
|
3919
|
+
}), Object.defineProperty(exports, "O", {
|
|
3920
|
+
enumerable: !0,
|
|
3921
|
+
get: function() {
|
|
3922
|
+
return COLOR_CONFIG_INPUT_MODES;
|
|
3923
|
+
}
|
|
3924
|
+
}), Object.defineProperty(exports, "P", {
|
|
3925
|
+
enumerable: !0,
|
|
3926
|
+
get: function() {
|
|
3927
|
+
return isColorButtonMode;
|
|
3928
|
+
}
|
|
3929
|
+
}), Object.defineProperty(exports, "R", {
|
|
3930
|
+
enumerable: !0,
|
|
3931
|
+
get: function() {
|
|
3932
|
+
return THEME_COLOR_BLEND_MODES;
|
|
3933
|
+
}
|
|
3934
|
+
}), Object.defineProperty(exports, "S", {
|
|
3935
|
+
enumerable: !0,
|
|
3936
|
+
get: function() {
|
|
3937
|
+
return parseTokenValue;
|
|
3938
|
+
}
|
|
3939
|
+
}), Object.defineProperty(exports, "T", {
|
|
3940
|
+
enumerable: !0,
|
|
3941
|
+
get: function() {
|
|
3942
|
+
return COLOR_CONFIG_BLEND_KEYS;
|
|
3943
|
+
}
|
|
3944
|
+
}), Object.defineProperty(exports, "U", {
|
|
3945
|
+
enumerable: !0,
|
|
3946
|
+
get: function() {
|
|
3947
|
+
return THEME_COLOR_SCHEMES;
|
|
3948
|
+
}
|
|
3949
|
+
}), Object.defineProperty(exports, "V", {
|
|
3950
|
+
enumerable: !0,
|
|
3951
|
+
get: function() {
|
|
3952
|
+
return THEME_COLOR_INPUT_MODES;
|
|
3953
|
+
}
|
|
3954
|
+
}), Object.defineProperty(exports, "W", {
|
|
3955
|
+
enumerable: !0,
|
|
3956
|
+
get: function() {
|
|
3957
|
+
return THEME_COLOR_STATES;
|
|
3958
|
+
}
|
|
3959
|
+
}), Object.defineProperty(exports, "X", {
|
|
3960
|
+
enumerable: !0,
|
|
3961
|
+
get: function() {
|
|
3962
|
+
return getTheme_v2;
|
|
3963
|
+
}
|
|
3964
|
+
}), Object.defineProperty(exports, "Y", {
|
|
3965
|
+
enumerable: !0,
|
|
3966
|
+
get: function() {
|
|
3967
|
+
return is_v0;
|
|
3968
|
+
}
|
|
3969
|
+
}), Object.defineProperty(exports, "Z", {
|
|
3970
|
+
enumerable: !0,
|
|
3971
|
+
get: function() {
|
|
3972
|
+
return createColorTheme;
|
|
3973
|
+
}
|
|
3974
|
+
}), Object.defineProperty(exports, "_", {
|
|
3975
|
+
enumerable: !0,
|
|
3976
|
+
get: function() {
|
|
3977
|
+
return isColorConfigStateKey;
|
|
3978
|
+
}
|
|
3979
|
+
}), Object.defineProperty(exports, "a", {
|
|
3980
|
+
enumerable: !0,
|
|
3981
|
+
get: function() {
|
|
3982
|
+
return parseColor;
|
|
3983
|
+
}
|
|
3984
|
+
}), Object.defineProperty(exports, "b", {
|
|
3985
|
+
enumerable: !0,
|
|
3986
|
+
get: function() {
|
|
3987
|
+
return isColorTokenValue;
|
|
3988
|
+
}
|
|
3989
|
+
}), Object.defineProperty(exports, "c", {
|
|
3990
|
+
enumerable: !0,
|
|
3991
|
+
get: function() {
|
|
3992
|
+
return rgbToHex;
|
|
3993
|
+
}
|
|
3994
|
+
}), Object.defineProperty(exports, "d", {
|
|
3995
|
+
enumerable: !0,
|
|
3996
|
+
get: function() {
|
|
3997
|
+
return screen;
|
|
3998
|
+
}
|
|
3999
|
+
}), Object.defineProperty(exports, "f", {
|
|
4000
|
+
enumerable: !0,
|
|
4001
|
+
get: function() {
|
|
4002
|
+
return multiply;
|
|
4003
|
+
}
|
|
4004
|
+
}), Object.defineProperty(exports, "g", {
|
|
4005
|
+
enumerable: !0,
|
|
4006
|
+
get: function() {
|
|
4007
|
+
return isColorConfigBlendKey;
|
|
4008
|
+
}
|
|
4009
|
+
}), Object.defineProperty(exports, "h", {
|
|
4010
|
+
enumerable: !0,
|
|
4011
|
+
get: function() {
|
|
4012
|
+
return isColorConfigBaseTone;
|
|
4013
|
+
}
|
|
4014
|
+
}), Object.defineProperty(exports, "i", {
|
|
4015
|
+
enumerable: !0,
|
|
4016
|
+
get: function() {
|
|
4017
|
+
return getContrastRatio;
|
|
4018
|
+
}
|
|
4019
|
+
}), Object.defineProperty(exports, "j", {
|
|
4020
|
+
enumerable: !0,
|
|
4021
|
+
get: function() {
|
|
4022
|
+
return COLOR_CONFIG_STATE_KEYS;
|
|
4023
|
+
}
|
|
4024
|
+
}), Object.defineProperty(exports, "k", {
|
|
4025
|
+
enumerable: !0,
|
|
4026
|
+
get: function() {
|
|
4027
|
+
return COLOR_CONFIG_INPUT_STATES;
|
|
4028
|
+
}
|
|
4029
|
+
}), Object.defineProperty(exports, "l", {
|
|
4030
|
+
enumerable: !0,
|
|
4031
|
+
get: function() {
|
|
4032
|
+
return rgbToHsl;
|
|
4033
|
+
}
|
|
4034
|
+
}), Object.defineProperty(exports, "m", {
|
|
4035
|
+
enumerable: !0,
|
|
4036
|
+
get: function() {
|
|
4037
|
+
return isColorConfigBaseKey;
|
|
4038
|
+
}
|
|
4039
|
+
}), Object.defineProperty(exports, "n", {
|
|
4040
|
+
enumerable: !0,
|
|
4041
|
+
get: function() {
|
|
4042
|
+
return buildTheme;
|
|
4043
|
+
}
|
|
4044
|
+
}), Object.defineProperty(exports, "o", {
|
|
4045
|
+
enumerable: !0,
|
|
4046
|
+
get: function() {
|
|
4047
|
+
return hexToRgb;
|
|
4048
|
+
}
|
|
4049
|
+
}), Object.defineProperty(exports, "p", {
|
|
4050
|
+
enumerable: !0,
|
|
4051
|
+
get: function() {
|
|
4052
|
+
return mix;
|
|
4053
|
+
}
|
|
4054
|
+
}), Object.defineProperty(exports, "q", {
|
|
4055
|
+
enumerable: !0,
|
|
4056
|
+
get: function() {
|
|
4057
|
+
return v0_v2;
|
|
4058
|
+
}
|
|
4059
|
+
}), Object.defineProperty(exports, "r", {
|
|
4060
|
+
enumerable: !0,
|
|
4061
|
+
get: function() {
|
|
4062
|
+
return rgba;
|
|
4063
|
+
}
|
|
4064
|
+
}), Object.defineProperty(exports, "s", {
|
|
4065
|
+
enumerable: !0,
|
|
4066
|
+
get: function() {
|
|
4067
|
+
return hslToRgb;
|
|
4068
|
+
}
|
|
4069
|
+
}), Object.defineProperty(exports, "t", {
|
|
4070
|
+
enumerable: !0,
|
|
4071
|
+
get: function() {
|
|
4072
|
+
return getScopedTheme;
|
|
4073
|
+
}
|
|
4074
|
+
}), Object.defineProperty(exports, "u", {
|
|
4075
|
+
enumerable: !0,
|
|
4076
|
+
get: function() {
|
|
4077
|
+
return rgbaToRGBA;
|
|
4078
|
+
}
|
|
4079
|
+
}), Object.defineProperty(exports, "v", {
|
|
4080
|
+
enumerable: !0,
|
|
4081
|
+
get: function() {
|
|
4082
|
+
return isColorConfigStateTone;
|
|
4083
|
+
}
|
|
4084
|
+
}), Object.defineProperty(exports, "w", {
|
|
4085
|
+
enumerable: !0,
|
|
4086
|
+
get: function() {
|
|
4087
|
+
return COLOR_CONFIG_AVATAR_COLORS;
|
|
4088
|
+
}
|
|
4089
|
+
}), Object.defineProperty(exports, "x", {
|
|
4090
|
+
enumerable: !0,
|
|
4091
|
+
get: function() {
|
|
4092
|
+
return isColorValue;
|
|
4093
|
+
}
|
|
4094
|
+
}), Object.defineProperty(exports, "y", {
|
|
4095
|
+
enumerable: !0,
|
|
4096
|
+
get: function() {
|
|
4097
|
+
return isColorOpacityValue;
|
|
4098
|
+
}
|
|
4099
|
+
}), Object.defineProperty(exports, "z", {
|
|
4100
|
+
enumerable: !0,
|
|
4101
|
+
get: function() {
|
|
4102
|
+
return THEME_COLOR_BUTTON_MODES;
|
|
4103
|
+
}
|
|
4104
|
+
});
|
|
3850
4105
|
|
|
3851
|
-
//# sourceMappingURL=theme.
|
|
4106
|
+
//# sourceMappingURL=theme.cjs.map
|