@sanity/ui 2.0.0-alpha.34 → 2.0.0-alpha.36
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/index.cjs.mjs +4 -3
- package/dist/index.d.ts +29 -22
- package/dist/index.esm.js +397 -518
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +413 -534
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +10 -4
- package/dist/theme.d.ts +489 -201
- package/dist/theme.esm.js +2934 -2748
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +2943 -2751
- package/dist/theme.js.map +1 -1
- package/package.json +3 -3
- package/src/core/_compat.ts +7 -7
- package/src/core/components/dialog/dialog.tsx +5 -5
- package/src/core/components/dialog/styles.ts +4 -5
- package/src/core/components/hotkeys/hotkeys.tsx +4 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
- package/src/core/components/menu/__workshop__/index.ts +5 -0
- package/src/core/components/menu/menuItem.tsx +7 -1
- package/src/core/components/skeleton/textSkeleton.tsx +12 -14
- package/src/core/components/tree/style.ts +14 -17
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -3
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -3
- package/src/core/primitives/_selectable/style.ts +18 -18
- package/src/core/primitives/avatar/avatar.tsx +3 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +4 -4
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/avatar/styles.ts +7 -8
- package/src/core/primitives/avatar/types.ts +2 -2
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -1
- package/src/core/primitives/badge/badge.tsx +1 -1
- package/src/core/primitives/badge/styles.ts +5 -6
- package/src/core/primitives/button/button.tsx +3 -4
- package/src/core/primitives/button/styles.ts +22 -23
- package/src/core/primitives/card/__workshop__/selected.tsx +15 -15
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/styles.ts +22 -22
- package/src/core/primitives/checkbox/styles.ts +21 -22
- package/src/core/primitives/code/styles.ts +4 -1
- package/src/core/primitives/container/styles.ts +2 -3
- package/src/core/primitives/heading/styles.ts +4 -2
- package/src/core/primitives/inline/styles.ts +6 -6
- package/src/core/primitives/kbd/kbd.tsx +7 -11
- package/src/core/primitives/label/styles.ts +4 -3
- package/src/core/primitives/popover/helpers.ts +3 -4
- package/src/core/primitives/popover/popover.tsx +8 -4
- package/src/core/primitives/popover/types.ts +1 -1
- package/src/core/primitives/radio/styles.ts +17 -19
- package/src/core/primitives/select/styles.ts +27 -32
- package/src/core/primitives/stack/styles.ts +2 -3
- package/src/core/primitives/switch/__workshop__/props.tsx +11 -31
- package/src/core/primitives/switch/styles.ts +18 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +10 -10
- package/src/core/primitives/text/styles.ts +9 -4
- package/src/core/primitives/tooltip/tooltip.tsx +3 -3
- package/src/core/styles/border/borderStyle.ts +6 -11
- package/src/core/styles/box/boxStyle.ts +5 -9
- package/src/core/styles/card/_cardColorStyle.ts +99 -0
- package/src/core/styles/card/index.ts +1 -0
- package/src/core/styles/flex/flexItemStyle.ts +2 -3
- package/src/core/styles/flex/flexStyle.ts +6 -11
- package/src/core/styles/font/responsiveFont.ts +4 -4
- package/src/core/styles/font/textAlignStyle.ts +3 -3
- package/src/core/styles/grid/gridItemStyle.ts +7 -13
- package/src/core/styles/grid/gridStyle.ts +9 -17
- package/src/core/styles/helpers.ts +5 -3
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +6 -6
- package/src/core/styles/input/textInputStyle.ts +36 -40
- package/src/core/styles/margin/marginsStyle.test.ts +2 -3
- package/src/core/styles/padding/paddingStyle.test.ts +2 -3
- package/src/core/styles/radius/radiusStyle.ts +2 -3
- package/src/core/styles/shadow/shadowStyle.ts +4 -5
- package/src/core/theme/__workshop__/build/Root.tsx +24 -20
- package/src/core/theme/__workshop__/build/story.tsx +22 -26
- package/src/core/theme/__workshop__/canvas.tsx +21 -40
- package/src/core/theme/theme.test.tsx +2 -35
- package/src/core/theme/themeColorProvider.tsx +2 -2
- package/src/core/theme/themeContext.ts +2 -2
- package/src/core/theme/themeProvider.tsx +25 -25
- package/src/core/theme/types.ts +3 -2
- package/src/core/theme/useRootTheme.ts +1 -9
- package/src/core/theme/useTheme.ts +8 -1
- package/src/core/types/card.ts +2 -2
- package/src/core/utils/arrow/arrow.tsx +3 -3
- package/src/core/utils/elementQuery/elementQuery.tsx +3 -3
- package/src/core/utils/virtualList/virtualList.tsx +2 -2
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.test.ts +14 -15
- package/src/theme/build/buildColorTheme.ts +239 -292
- package/src/theme/build/buildTheme.test.ts +9 -7
- package/src/theme/build/buildTheme.ts +12 -9
- package/src/theme/build/colorToken.ts +3 -1
- package/src/theme/build/lib/color-fns/contrastRatio.ts +1 -0
- package/src/theme/build/lib/isRecord.ts +3 -0
- package/src/theme/build/merge.ts +18 -13
- package/src/theme/build/renderColorTheme.ts +205 -213
- package/src/theme/build/renderColorValue.ts +15 -8
- package/src/theme/build/resolveColorTokens.ts +177 -198
- package/src/theme/build/theme.test.ts +27 -0
- package/src/theme/config/helpers.ts +16 -8
- package/src/theme/config/system.ts +46 -17
- package/src/theme/config/tokens/color/types.ts +55 -32
- package/src/theme/config/tokens/types.ts +11 -4
- package/src/theme/config/types.ts +5 -11
- package/src/theme/{build/defaults → defaults}/colorPalette.ts +1 -1
- package/src/theme/{build/defaults → defaults}/colorTokens.ts +189 -136
- package/src/theme/{build/defaults → defaults}/config.ts +14 -12
- package/src/theme/{build/defaults → defaults}/fonts.ts +6 -6
- package/src/theme/getScopedTheme.ts +81 -0
- package/src/theme/index.ts +9 -1
- package/src/theme/system/avatar.ts +1 -1
- package/src/theme/system/color/_constants.ts +11 -11
- package/src/theme/system/color/_system.ts +10 -71
- package/src/theme/system/color/avatar.ts +22 -10
- package/src/theme/system/color/badge.ts +18 -7
- package/src/theme/system/color/button.ts +17 -23
- package/src/theme/system/color/color.ts +34 -0
- package/src/theme/system/color/index.ts +3 -10
- package/src/theme/system/color/input.ts +13 -11
- package/src/theme/system/color/kbd.ts +3 -3
- package/src/theme/system/color/selectable.ts +13 -19
- package/src/theme/system/color/shadow.ts +7 -0
- package/src/theme/system/color/state.ts +37 -0
- package/src/theme/system/css.ts +9 -0
- package/src/theme/system/focusRing.ts +7 -0
- package/src/theme/system/index.ts +5 -1
- package/src/theme/system/input.ts +1 -1
- package/src/theme/system/layer.ts +1 -2
- package/src/theme/system/shadow.ts +1 -0
- package/src/theme/system/styles.ts +19 -0
- package/src/theme/system/theme.ts +128 -0
- package/src/theme/system/{color → v0/color}/_generic.ts +2 -1
- package/src/theme/system/v0/color/_system.ts +13 -0
- package/src/theme/system/{color → v0/color}/base.ts +2 -0
- package/src/theme/system/v0/color/button.ts +42 -0
- package/src/theme/system/{color → v0/color}/card.ts +2 -1
- package/src/theme/system/v0/color/color.ts +40 -0
- package/src/theme/system/v0/color/index.ts +11 -0
- package/src/theme/system/v0/color/input.ts +34 -0
- package/src/theme/system/{color/_deprecated → v0/color}/muted.ts +1 -1
- package/src/theme/system/v0/color/selectable.ts +31 -0
- package/src/theme/system/{color/_deprecated → v0/color}/solid.ts +1 -1
- package/src/theme/system/v0/color/spot.ts +13 -0
- package/src/theme/system/v0/index.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +38 -0
- package/src/theme/versioning/index.ts +5 -0
- package/src/theme/versioning/is_v0.ts +6 -0
- package/src/theme/versioning/is_v2.ts +6 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
- package/src/theme/versioning/v0_v2.ts +72 -0
- package/src/theme/versioning/v2_v0.ts +126 -0
- package/src/core/styles/colorVars/colorVarsStyle.ts +0 -43
- package/src/core/styles/colorVars/index.ts +0 -1
- package/src/core/theme/defaults.ts +0 -7
- package/src/theme/system/_system.ts +0 -95
- package/src/theme/system/color/_deprecated/spot.ts +0 -13
- package/src/theme/themes/studio/config.ts +0 -69
- package/src/theme/themes/studio/fonts.ts +0 -219
- package/src/theme/themes/studio/index.ts +0 -1
- package/src/theme/themes/studio/studioTheme.test.ts +0 -27
- package/src/theme/themes/studio/studioTheme.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ function _getArrayProp(val, defaultVal) {
|
|
|
46
46
|
if (val === void 0) return defaultVal || EMPTY_ARRAY;
|
|
47
47
|
return Array.isArray(val) ? val : [val];
|
|
48
48
|
}
|
|
49
|
-
function _getResponsiveSpace(theme, props) {
|
|
49
|
+
function _getResponsiveSpace(theme$1, props) {
|
|
50
50
|
let spaceIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_ARRAY;
|
|
51
51
|
if (!Array.isArray(spaceIndexes)) {
|
|
52
52
|
throw new Error("the property must be array of numbers");
|
|
@@ -54,23 +54,26 @@ function _getResponsiveSpace(theme, props) {
|
|
|
54
54
|
if (spaceIndexes.length === 0) {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const {
|
|
58
|
+
media,
|
|
59
|
+
space
|
|
60
|
+
} = theme.getTheme_v2(theme$1);
|
|
61
|
+
return _responsive(media, spaceIndexes, spaceIndex => _fillCSSObject(props, rem(space[spaceIndex])));
|
|
58
62
|
}
|
|
59
63
|
function responsiveFont(fontKey, props) {
|
|
60
64
|
const {
|
|
61
65
|
$size,
|
|
62
|
-
$weight
|
|
63
|
-
theme
|
|
66
|
+
$weight
|
|
64
67
|
} = props;
|
|
65
68
|
const {
|
|
66
|
-
|
|
69
|
+
font,
|
|
67
70
|
media
|
|
68
|
-
} = theme.
|
|
71
|
+
} = theme.getTheme_v2(props.theme);
|
|
69
72
|
const {
|
|
70
73
|
family,
|
|
71
74
|
sizes,
|
|
72
75
|
weights
|
|
73
|
-
} =
|
|
76
|
+
} = font[fontKey];
|
|
74
77
|
const fontWeight = $weight && weights[$weight] || weights.regular;
|
|
75
78
|
const defaultSize = sizes[2];
|
|
76
79
|
const base = {
|
|
@@ -157,9 +160,9 @@ function responsiveLabelFont(props) {
|
|
|
157
160
|
}
|
|
158
161
|
function responsiveTextAlignStyle(props) {
|
|
159
162
|
const {
|
|
160
|
-
|
|
161
|
-
} = props;
|
|
162
|
-
return _responsive(
|
|
163
|
+
media
|
|
164
|
+
} = theme.getTheme_v2(props.theme);
|
|
165
|
+
return _responsive(media, props.$align, textAlign => {
|
|
163
166
|
return {
|
|
164
167
|
textAlign
|
|
165
168
|
};
|
|
@@ -838,17 +841,6 @@ function useGlobalKeyDown(onKeyDown) {
|
|
|
838
841
|
return () => removeEventListener("keydown", onKeyDown);
|
|
839
842
|
}, [onKeyDown]);
|
|
840
843
|
}
|
|
841
|
-
const DEFAULT_THEME_LAYER = {
|
|
842
|
-
dialog: {
|
|
843
|
-
zOffset: 600
|
|
844
|
-
},
|
|
845
|
-
popover: {
|
|
846
|
-
zOffset: 400
|
|
847
|
-
},
|
|
848
|
-
tooltip: {
|
|
849
|
-
zOffset: 200
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
844
|
function getGlobalScope() {
|
|
853
845
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
854
846
|
if (typeof window !== "undefined") return window;
|
|
@@ -865,57 +857,40 @@ function ThemeProvider(props) {
|
|
|
865
857
|
const {
|
|
866
858
|
children,
|
|
867
859
|
scheme = (parentTheme == null ? void 0 : parentTheme.scheme) || "light",
|
|
868
|
-
theme:
|
|
860
|
+
theme: rootTheme = (parentTheme == null ? void 0 : parentTheme.theme) || null,
|
|
869
861
|
tone = (parentTheme == null ? void 0 : parentTheme.tone) || "default"
|
|
870
862
|
} = props;
|
|
871
|
-
const
|
|
872
|
-
if (!
|
|
873
|
-
const {
|
|
874
|
-
color: rootColor,
|
|
875
|
-
layer: rootLayer,
|
|
876
|
-
...restTheme
|
|
877
|
-
} = themeProp;
|
|
878
|
-
const colorScheme = rootColor[scheme] || rootColor.light;
|
|
879
|
-
const color = colorScheme[tone] || colorScheme.default;
|
|
880
|
-
const layer = rootLayer || DEFAULT_THEME_LAYER;
|
|
863
|
+
const themeContext = react.useMemo(() => {
|
|
864
|
+
if (!rootTheme) return null;
|
|
881
865
|
return {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}
|
|
866
|
+
version: 0,
|
|
867
|
+
theme: rootTheme,
|
|
868
|
+
scheme,
|
|
869
|
+
tone
|
|
887
870
|
};
|
|
888
|
-
}, [
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
theme
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}, [themeProp, scheme, tone]);
|
|
895
|
-
if (!theme) {
|
|
871
|
+
}, [rootTheme, scheme, tone]);
|
|
872
|
+
const theme$1 = react.useMemo(() => {
|
|
873
|
+
if (!rootTheme) return null;
|
|
874
|
+
return theme.getScopedTheme(rootTheme, scheme, tone);
|
|
875
|
+
}, [scheme, rootTheme, tone]);
|
|
876
|
+
if (!theme$1) {
|
|
896
877
|
return /* @__PURE__ */jsxRuntime.jsx("pre", {
|
|
897
878
|
children: 'ThemeProvider: no "theme" property provided'
|
|
898
879
|
});
|
|
899
880
|
}
|
|
900
881
|
return /* @__PURE__ */jsxRuntime.jsx(ThemeContext.Provider, {
|
|
901
|
-
value,
|
|
882
|
+
value: themeContext,
|
|
902
883
|
children: /* @__PURE__ */jsxRuntime.jsx(styled.ThemeProvider, {
|
|
903
|
-
theme,
|
|
884
|
+
theme: theme$1,
|
|
904
885
|
children
|
|
905
886
|
})
|
|
906
887
|
});
|
|
907
888
|
}
|
|
908
|
-
function isRecord(value) {
|
|
909
|
-
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
910
|
-
}
|
|
911
889
|
function useRootTheme() {
|
|
912
890
|
const value = react.useContext(ThemeContext);
|
|
913
891
|
if (!value) {
|
|
914
892
|
throw new Error("useRootTheme(): missing context value");
|
|
915
893
|
}
|
|
916
|
-
if (!isRecord(value) || value.version !== 0) {
|
|
917
|
-
throw new Error("useRootTheme(): the context value is not compatible");
|
|
918
|
-
}
|
|
919
894
|
return value;
|
|
920
895
|
}
|
|
921
896
|
function ThemeColorProvider(props) {
|
|
@@ -935,6 +910,9 @@ function ThemeColorProvider(props) {
|
|
|
935
910
|
function useTheme() {
|
|
936
911
|
return styled.useTheme();
|
|
937
912
|
}
|
|
913
|
+
function useTheme_v2() {
|
|
914
|
+
return theme.getTheme_v2(styled.useTheme());
|
|
915
|
+
}
|
|
938
916
|
const MEDIA_STORE_CACHE = /* @__PURE__ */new WeakMap();
|
|
939
917
|
function _getMediaQuery(media, index) {
|
|
940
918
|
if (index === 0) {
|
|
@@ -996,10 +974,9 @@ function getServerSnapshot$2() {
|
|
|
996
974
|
return 0;
|
|
997
975
|
}
|
|
998
976
|
function useMediaIndex() {
|
|
999
|
-
const theme = useTheme();
|
|
1000
977
|
const {
|
|
1001
978
|
media
|
|
1002
|
-
} =
|
|
979
|
+
} = useTheme_v2();
|
|
1003
980
|
let store = MEDIA_STORE_CACHE.get(media);
|
|
1004
981
|
if (!store) {
|
|
1005
982
|
store = _createMediaStore(media);
|
|
@@ -1074,13 +1051,10 @@ function responsiveBorderStyle() {
|
|
|
1074
1051
|
}
|
|
1075
1052
|
function border(props) {
|
|
1076
1053
|
var _a, _b;
|
|
1077
|
-
const {
|
|
1078
|
-
theme
|
|
1079
|
-
} = props;
|
|
1080
1054
|
const {
|
|
1081
1055
|
card,
|
|
1082
1056
|
media
|
|
1083
|
-
} = theme.
|
|
1057
|
+
} = theme.getTheme_v2(props.theme);
|
|
1084
1058
|
const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
|
|
1085
1059
|
return _responsive(media, props.$border, value => value ? {
|
|
1086
1060
|
"&&": {
|
|
@@ -1094,13 +1068,10 @@ function border(props) {
|
|
|
1094
1068
|
}
|
|
1095
1069
|
function borderTop(props) {
|
|
1096
1070
|
var _a, _b;
|
|
1097
|
-
const {
|
|
1098
|
-
theme
|
|
1099
|
-
} = props;
|
|
1100
1071
|
const {
|
|
1101
1072
|
card,
|
|
1102
1073
|
media
|
|
1103
|
-
} = theme.
|
|
1074
|
+
} = theme.getTheme_v2(props.theme);
|
|
1104
1075
|
const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
|
|
1105
1076
|
return _responsive(media, props.$borderTop, value => value ? {
|
|
1106
1077
|
"&&": {
|
|
@@ -1114,13 +1085,10 @@ function borderTop(props) {
|
|
|
1114
1085
|
}
|
|
1115
1086
|
function borderRight(props) {
|
|
1116
1087
|
var _a, _b;
|
|
1117
|
-
const {
|
|
1118
|
-
theme
|
|
1119
|
-
} = props;
|
|
1120
1088
|
const {
|
|
1121
1089
|
card,
|
|
1122
1090
|
media
|
|
1123
|
-
} = theme.
|
|
1091
|
+
} = theme.getTheme_v2(props.theme);
|
|
1124
1092
|
const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
|
|
1125
1093
|
return _responsive(media, props.$borderRight, value => value ? {
|
|
1126
1094
|
"&&": {
|
|
@@ -1134,13 +1102,10 @@ function borderRight(props) {
|
|
|
1134
1102
|
}
|
|
1135
1103
|
function borderBottom(props) {
|
|
1136
1104
|
var _a, _b;
|
|
1137
|
-
const {
|
|
1138
|
-
theme
|
|
1139
|
-
} = props;
|
|
1140
1105
|
const {
|
|
1141
1106
|
card,
|
|
1142
1107
|
media
|
|
1143
|
-
} = theme.
|
|
1108
|
+
} = theme.getTheme_v2(props.theme);
|
|
1144
1109
|
const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
|
|
1145
1110
|
return _responsive(media, props.$borderBottom, value => value ? {
|
|
1146
1111
|
"&&": {
|
|
@@ -1154,13 +1119,10 @@ function borderBottom(props) {
|
|
|
1154
1119
|
}
|
|
1155
1120
|
function borderLeft(props) {
|
|
1156
1121
|
var _a, _b;
|
|
1157
|
-
const {
|
|
1158
|
-
theme
|
|
1159
|
-
} = props;
|
|
1160
1122
|
const {
|
|
1161
1123
|
card,
|
|
1162
1124
|
media
|
|
1163
|
-
} = theme.
|
|
1125
|
+
} = theme.getTheme_v2(props.theme);
|
|
1164
1126
|
const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
|
|
1165
1127
|
return _responsive(media, props.$borderLeft, value => value ? {
|
|
1166
1128
|
"&&": {
|
|
@@ -1192,12 +1154,9 @@ function responsiveBoxStyle() {
|
|
|
1192
1154
|
return [responsiveBoxSizingStyle, responsiveBoxHeightStyle, responsiveBoxOverflowStyle, responsiveBoxDisplayStyle];
|
|
1193
1155
|
}
|
|
1194
1156
|
function responsiveBoxDisplayStyle(props) {
|
|
1195
|
-
const {
|
|
1196
|
-
theme
|
|
1197
|
-
} = props;
|
|
1198
1157
|
const {
|
|
1199
1158
|
media
|
|
1200
|
-
} = theme.
|
|
1159
|
+
} = theme.getTheme_v2(props.theme);
|
|
1201
1160
|
return _responsive(media, props.$display, display => ({
|
|
1202
1161
|
"&:not([hidden])": {
|
|
1203
1162
|
display
|
|
@@ -1205,34 +1164,25 @@ function responsiveBoxDisplayStyle(props) {
|
|
|
1205
1164
|
}));
|
|
1206
1165
|
}
|
|
1207
1166
|
function responsiveBoxSizingStyle(props) {
|
|
1208
|
-
const {
|
|
1209
|
-
theme
|
|
1210
|
-
} = props;
|
|
1211
1167
|
const {
|
|
1212
1168
|
media
|
|
1213
|
-
} = theme.
|
|
1169
|
+
} = theme.getTheme_v2(props.theme);
|
|
1214
1170
|
return _responsive(media, props.$sizing, sizing => ({
|
|
1215
1171
|
boxSizing: BOX_SIZING[sizing]
|
|
1216
1172
|
}));
|
|
1217
1173
|
}
|
|
1218
1174
|
function responsiveBoxHeightStyle(props) {
|
|
1219
|
-
const {
|
|
1220
|
-
theme
|
|
1221
|
-
} = props;
|
|
1222
1175
|
const {
|
|
1223
1176
|
media
|
|
1224
|
-
} = theme.
|
|
1177
|
+
} = theme.getTheme_v2(props.theme);
|
|
1225
1178
|
return _responsive(media, props.$height, height => ({
|
|
1226
1179
|
height: BOX_HEIGHT[height]
|
|
1227
1180
|
}));
|
|
1228
1181
|
}
|
|
1229
1182
|
function responsiveBoxOverflowStyle(props) {
|
|
1230
|
-
const {
|
|
1231
|
-
theme
|
|
1232
|
-
} = props;
|
|
1233
1183
|
const {
|
|
1234
1184
|
media
|
|
1235
|
-
} = theme.
|
|
1185
|
+
} = theme.getTheme_v2(props.theme);
|
|
1236
1186
|
return _responsive(media, props.$overflow, overflow => ({
|
|
1237
1187
|
overflow
|
|
1238
1188
|
}));
|
|
@@ -1246,12 +1196,9 @@ function responsiveFlexStyle() {
|
|
|
1246
1196
|
return [BASE_STYLE$3, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
|
|
1247
1197
|
}
|
|
1248
1198
|
function responsiveFlexAlignStyle(props) {
|
|
1249
|
-
const {
|
|
1250
|
-
theme
|
|
1251
|
-
} = props;
|
|
1252
1199
|
const {
|
|
1253
1200
|
media
|
|
1254
|
-
} = theme.
|
|
1201
|
+
} = theme.getTheme_v2(props.theme);
|
|
1255
1202
|
return _responsive(media, props.$align, align => {
|
|
1256
1203
|
return {
|
|
1257
1204
|
alignItems: align
|
|
@@ -1259,24 +1206,18 @@ function responsiveFlexAlignStyle(props) {
|
|
|
1259
1206
|
});
|
|
1260
1207
|
}
|
|
1261
1208
|
function responsiveFlexGapStyle(props) {
|
|
1262
|
-
const {
|
|
1263
|
-
theme
|
|
1264
|
-
} = props;
|
|
1265
1209
|
const {
|
|
1266
1210
|
media,
|
|
1267
1211
|
space
|
|
1268
|
-
} = theme.
|
|
1212
|
+
} = theme.getTheme_v2(props.theme);
|
|
1269
1213
|
return _responsive(media, props.$gap, gap => ({
|
|
1270
1214
|
gap: gap ? rem(space[gap]) : void 0
|
|
1271
1215
|
}));
|
|
1272
1216
|
}
|
|
1273
1217
|
function responsiveFlexWrapStyle(props) {
|
|
1274
|
-
const {
|
|
1275
|
-
theme
|
|
1276
|
-
} = props;
|
|
1277
1218
|
const {
|
|
1278
1219
|
media
|
|
1279
|
-
} = theme.
|
|
1220
|
+
} = theme.getTheme_v2(props.theme);
|
|
1280
1221
|
return _responsive(media, props.$wrap, wrap => {
|
|
1281
1222
|
return {
|
|
1282
1223
|
flexWrap: wrap
|
|
@@ -1284,12 +1225,9 @@ function responsiveFlexWrapStyle(props) {
|
|
|
1284
1225
|
});
|
|
1285
1226
|
}
|
|
1286
1227
|
function responsiveFlexJustifyStyle(props) {
|
|
1287
|
-
const {
|
|
1288
|
-
theme
|
|
1289
|
-
} = props;
|
|
1290
1228
|
const {
|
|
1291
1229
|
media
|
|
1292
|
-
} = theme.
|
|
1230
|
+
} = theme.getTheme_v2(props.theme);
|
|
1293
1231
|
return _responsive(media, props.$justify, justify => {
|
|
1294
1232
|
return {
|
|
1295
1233
|
justifyContent: justify
|
|
@@ -1297,12 +1235,9 @@ function responsiveFlexJustifyStyle(props) {
|
|
|
1297
1235
|
});
|
|
1298
1236
|
}
|
|
1299
1237
|
function responsiveFlexDirectionStyle(props) {
|
|
1300
|
-
const {
|
|
1301
|
-
theme
|
|
1302
|
-
} = props;
|
|
1303
1238
|
const {
|
|
1304
1239
|
media
|
|
1305
|
-
} = theme.
|
|
1240
|
+
} = theme.getTheme_v2(props.theme);
|
|
1306
1241
|
return _responsive(media, props.$direction, direction => {
|
|
1307
1242
|
return {
|
|
1308
1243
|
flexDirection: direction
|
|
@@ -1317,12 +1252,9 @@ function flexItemStyle() {
|
|
|
1317
1252
|
return [BASE_STYLE$2, responsiveFlexItemStyle];
|
|
1318
1253
|
}
|
|
1319
1254
|
function responsiveFlexItemStyle(props) {
|
|
1320
|
-
const {
|
|
1321
|
-
theme
|
|
1322
|
-
} = props;
|
|
1323
1255
|
const {
|
|
1324
1256
|
media
|
|
1325
|
-
} = theme.
|
|
1257
|
+
} = theme.getTheme_v2(props.theme);
|
|
1326
1258
|
if (!props.$flex) return EMPTY_ARRAY;
|
|
1327
1259
|
return _responsive(media, props.$flex, flex => ({
|
|
1328
1260
|
flex
|
|
@@ -1366,92 +1298,68 @@ function responsiveGridStyle() {
|
|
|
1366
1298
|
return [GRID_CSS, responsiveGridAutoFlowStyle, responsiveGridAutoRowsStyle, responsiveGridAutoColsStyle, responsiveGridColumnsStyle, responsiveGridRowsStyle, responsiveGridGapStyle, responsiveGridGapXStyle, responsiveGridGapYStyle];
|
|
1367
1299
|
}
|
|
1368
1300
|
function responsiveGridAutoFlowStyle(props) {
|
|
1369
|
-
const {
|
|
1370
|
-
theme
|
|
1371
|
-
} = props;
|
|
1372
1301
|
const {
|
|
1373
1302
|
media
|
|
1374
|
-
} = theme.
|
|
1303
|
+
} = theme.getTheme_v2(props.theme);
|
|
1375
1304
|
return _responsive(media, props.$autoFlow, autoFlow => ({
|
|
1376
1305
|
gridAutoFlow: autoFlow
|
|
1377
1306
|
}));
|
|
1378
1307
|
}
|
|
1379
1308
|
function responsiveGridAutoRowsStyle(props) {
|
|
1380
|
-
const {
|
|
1381
|
-
theme
|
|
1382
|
-
} = props;
|
|
1383
1309
|
const {
|
|
1384
1310
|
media
|
|
1385
|
-
} = theme.
|
|
1311
|
+
} = theme.getTheme_v2(props.theme);
|
|
1386
1312
|
return _responsive(media, props.$autoRows, autoRows => ({
|
|
1387
1313
|
gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
|
|
1388
1314
|
}));
|
|
1389
1315
|
}
|
|
1390
1316
|
function responsiveGridAutoColsStyle(props) {
|
|
1391
|
-
const {
|
|
1392
|
-
theme
|
|
1393
|
-
} = props;
|
|
1394
1317
|
const {
|
|
1395
1318
|
media
|
|
1396
|
-
} = theme.
|
|
1319
|
+
} = theme.getTheme_v2(props.theme);
|
|
1397
1320
|
return _responsive(media, props.$autoCols, autoCols => ({
|
|
1398
1321
|
gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
|
|
1399
1322
|
}));
|
|
1400
1323
|
}
|
|
1401
1324
|
function responsiveGridColumnsStyle(props) {
|
|
1402
|
-
const {
|
|
1403
|
-
theme
|
|
1404
|
-
} = props;
|
|
1405
1325
|
const {
|
|
1406
1326
|
media
|
|
1407
|
-
} = theme.
|
|
1327
|
+
} = theme.getTheme_v2(props.theme);
|
|
1408
1328
|
return _responsive(media, props.$columns, columns => ({
|
|
1409
1329
|
gridTemplateColumns: columns && "repeat(".concat(columns, ",minmax(0,1fr));")
|
|
1410
1330
|
}));
|
|
1411
1331
|
}
|
|
1412
1332
|
function responsiveGridRowsStyle(props) {
|
|
1413
|
-
const {
|
|
1414
|
-
theme
|
|
1415
|
-
} = props;
|
|
1416
1333
|
const {
|
|
1417
1334
|
media
|
|
1418
|
-
} = theme.
|
|
1335
|
+
} = theme.getTheme_v2(props.theme);
|
|
1419
1336
|
return _responsive(media, props.$rows, rows => ({
|
|
1420
1337
|
gridTemplateRows: rows && "repeat(".concat(rows, ",minmax(0,1fr));")
|
|
1421
1338
|
}));
|
|
1422
1339
|
}
|
|
1423
1340
|
function responsiveGridGapStyle(props) {
|
|
1424
|
-
const {
|
|
1425
|
-
theme
|
|
1426
|
-
} = props;
|
|
1427
1341
|
const {
|
|
1428
1342
|
media,
|
|
1429
1343
|
space
|
|
1430
|
-
} = theme.
|
|
1344
|
+
} = theme.getTheme_v2(props.theme);
|
|
1431
1345
|
return _responsive(media, props.$gap, gap => ({
|
|
1432
1346
|
gridGap: gap ? rem(space[gap]) : void 0
|
|
1433
1347
|
}));
|
|
1434
1348
|
}
|
|
1435
1349
|
function responsiveGridGapXStyle(props) {
|
|
1436
|
-
const {
|
|
1437
|
-
theme
|
|
1438
|
-
} = props;
|
|
1439
1350
|
const {
|
|
1440
1351
|
media,
|
|
1441
1352
|
space
|
|
1442
|
-
} = theme.
|
|
1353
|
+
} = theme.getTheme_v2(props.theme);
|
|
1443
1354
|
return _responsive(media, props.$gapX, gapX => ({
|
|
1444
1355
|
columnGap: gapX ? rem(space[gapX]) : void 0
|
|
1445
1356
|
}));
|
|
1446
1357
|
}
|
|
1447
1358
|
function responsiveGridGapYStyle(props) {
|
|
1448
|
-
const {
|
|
1449
|
-
theme
|
|
1450
|
-
} = props;
|
|
1451
1359
|
const {
|
|
1452
1360
|
media,
|
|
1453
1361
|
space
|
|
1454
|
-
} = theme.
|
|
1362
|
+
} = theme.getTheme_v2(props.theme);
|
|
1455
1363
|
return _responsive(media, props.$gapY, gapY => ({
|
|
1456
1364
|
rowGap: gapY ? rem(space[gapY]) : void 0
|
|
1457
1365
|
}));
|
|
@@ -1468,12 +1376,9 @@ const GRID_ITEM_COLUMN = {
|
|
|
1468
1376
|
full: "1 / -1"
|
|
1469
1377
|
};
|
|
1470
1378
|
function responsiveGridItemRowStyle(props) {
|
|
1471
|
-
const {
|
|
1472
|
-
theme
|
|
1473
|
-
} = props;
|
|
1474
1379
|
const {
|
|
1475
1380
|
media
|
|
1476
|
-
} = theme.
|
|
1381
|
+
} = theme.getTheme_v2(props.theme);
|
|
1477
1382
|
return _responsive(media, props.$row, row => {
|
|
1478
1383
|
if (typeof row === "number") {
|
|
1479
1384
|
return {
|
|
@@ -1486,34 +1391,25 @@ function responsiveGridItemRowStyle(props) {
|
|
|
1486
1391
|
});
|
|
1487
1392
|
}
|
|
1488
1393
|
function responsiveGridItemRowStartStyle(props) {
|
|
1489
|
-
const {
|
|
1490
|
-
theme
|
|
1491
|
-
} = props;
|
|
1492
1394
|
const {
|
|
1493
1395
|
media
|
|
1494
|
-
} = theme.
|
|
1396
|
+
} = theme.getTheme_v2(props.theme);
|
|
1495
1397
|
return _responsive(media, props.$rowStart, rowStart => ({
|
|
1496
1398
|
gridRowStart: rowStart
|
|
1497
1399
|
}));
|
|
1498
1400
|
}
|
|
1499
1401
|
function responsiveGridItemRowEndStyle(props) {
|
|
1500
|
-
const {
|
|
1501
|
-
theme
|
|
1502
|
-
} = props;
|
|
1503
1402
|
const {
|
|
1504
1403
|
media
|
|
1505
|
-
} = theme.
|
|
1404
|
+
} = theme.getTheme_v2(props.theme);
|
|
1506
1405
|
return _responsive(media, props.$rowEnd, rowEnd => ({
|
|
1507
1406
|
gridRowEnd: rowEnd
|
|
1508
1407
|
}));
|
|
1509
1408
|
}
|
|
1510
1409
|
function responsiveGridItemColumnStyle(props) {
|
|
1511
|
-
const {
|
|
1512
|
-
theme
|
|
1513
|
-
} = props;
|
|
1514
1410
|
const {
|
|
1515
1411
|
media
|
|
1516
|
-
} = theme.
|
|
1412
|
+
} = theme.getTheme_v2(props.theme);
|
|
1517
1413
|
return _responsive(media, props.$column, column => {
|
|
1518
1414
|
if (typeof column === "number") {
|
|
1519
1415
|
return {
|
|
@@ -1526,23 +1422,17 @@ function responsiveGridItemColumnStyle(props) {
|
|
|
1526
1422
|
});
|
|
1527
1423
|
}
|
|
1528
1424
|
function responsiveGridItemColumnStartStyle(props) {
|
|
1529
|
-
const {
|
|
1530
|
-
theme
|
|
1531
|
-
} = props;
|
|
1532
1425
|
const {
|
|
1533
1426
|
media
|
|
1534
|
-
} = theme.
|
|
1427
|
+
} = theme.getTheme_v2(props.theme);
|
|
1535
1428
|
return _responsive(media, props.$columnStart, columnStart => ({
|
|
1536
1429
|
gridColumnStart: columnStart
|
|
1537
1430
|
}));
|
|
1538
1431
|
}
|
|
1539
1432
|
function responsiveGridItemColumnEndStyle(props) {
|
|
1540
|
-
const {
|
|
1541
|
-
theme
|
|
1542
|
-
} = props;
|
|
1543
1433
|
const {
|
|
1544
1434
|
media
|
|
1545
|
-
} = theme.
|
|
1435
|
+
} = theme.getTheme_v2(props.theme);
|
|
1546
1436
|
return _responsive(media, props.$columnEnd, columnEnd => ({
|
|
1547
1437
|
gridColumnEnd: columnEnd
|
|
1548
1438
|
}));
|
|
@@ -1553,14 +1443,13 @@ function responsiveInputPaddingStyle(props) {
|
|
|
1553
1443
|
$iconLeft,
|
|
1554
1444
|
$iconRight,
|
|
1555
1445
|
$padding,
|
|
1556
|
-
$space
|
|
1557
|
-
theme
|
|
1446
|
+
$space
|
|
1558
1447
|
} = props;
|
|
1559
1448
|
const {
|
|
1560
|
-
|
|
1449
|
+
font,
|
|
1561
1450
|
media,
|
|
1562
|
-
space
|
|
1563
|
-
} = theme.
|
|
1451
|
+
space
|
|
1452
|
+
} = theme.getTheme_v2(props.theme);
|
|
1564
1453
|
const len = Math.max($padding.length, $space.length, $fontSize.length);
|
|
1565
1454
|
const _padding = [];
|
|
1566
1455
|
const _space = [];
|
|
@@ -1571,10 +1460,10 @@ function responsiveInputPaddingStyle(props) {
|
|
|
1571
1460
|
_space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
|
|
1572
1461
|
}
|
|
1573
1462
|
return _responsive(media, _padding, (_, i) => {
|
|
1574
|
-
const size =
|
|
1463
|
+
const size = font.text.sizes[_fontSize[i]] || font.text.sizes[2];
|
|
1575
1464
|
const emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight;
|
|
1576
|
-
const p =
|
|
1577
|
-
const s =
|
|
1465
|
+
const p = space[_padding[i]];
|
|
1466
|
+
const s = space[_space[i]];
|
|
1578
1467
|
const styles = {
|
|
1579
1468
|
paddingTop: rem(p - size.ascenderHeight),
|
|
1580
1469
|
paddingRight: rem(p),
|
|
@@ -1604,25 +1493,23 @@ function textInputRootStyle() {
|
|
|
1604
1493
|
}
|
|
1605
1494
|
function textInputBaseStyle(props) {
|
|
1606
1495
|
const {
|
|
1607
|
-
theme,
|
|
1608
1496
|
$scheme,
|
|
1609
1497
|
$tone,
|
|
1610
1498
|
$weight
|
|
1611
1499
|
} = props;
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
|
|
1500
|
+
const {
|
|
1501
|
+
color,
|
|
1502
|
+
font
|
|
1503
|
+
} = theme.getTheme_v2(props.theme);
|
|
1504
|
+
return styled.css(_b$n || (_b$n = __template$D(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ", ";\n font-weight: ", ";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='", "'][data-tone='", "'] {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n }\n "])), font.text.family, $weight && font.text.weights[$weight] || font.text.weights.regular, $scheme, $tone, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.disabled.fg, color.input.default.disabled.placeholder, color.input.invalid.enabled.fg, color.input.invalid.enabled.placeholder, color.input.default.readOnly.fg, color.input.default.readOnly.placeholder);
|
|
1615
1505
|
}
|
|
1616
1506
|
function textInputFontSizeStyle(props) {
|
|
1617
1507
|
const {
|
|
1618
|
-
|
|
1619
|
-
} = props;
|
|
1620
|
-
const {
|
|
1621
|
-
fonts,
|
|
1508
|
+
font,
|
|
1622
1509
|
media
|
|
1623
|
-
} = theme.
|
|
1510
|
+
} = theme.getTheme_v2(props.theme);
|
|
1624
1511
|
return _responsive(media, props.$fontSize, sizeIndex => {
|
|
1625
|
-
const size =
|
|
1512
|
+
const size = font.text.sizes[sizeIndex] || font.text.sizes[2];
|
|
1626
1513
|
return {
|
|
1627
1514
|
fontSize: rem(size.fontSize),
|
|
1628
1515
|
lineHeight: size.lineHeight / size.fontSize
|
|
@@ -1635,35 +1522,31 @@ function textInputRepresentationStyle(props) {
|
|
|
1635
1522
|
$hasSuffix,
|
|
1636
1523
|
$scheme,
|
|
1637
1524
|
$tone,
|
|
1638
|
-
$unstableDisableFocusRing
|
|
1639
|
-
theme
|
|
1525
|
+
$unstableDisableFocusRing
|
|
1640
1526
|
} = props;
|
|
1641
1527
|
const {
|
|
1528
|
+
color,
|
|
1642
1529
|
input
|
|
1643
|
-
} = theme.
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
} = input.text;
|
|
1647
|
-
const color = theme.sanity.color.input;
|
|
1648
|
-
return styled.css(_c$c || (_c$c = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
1649
|
-
color: color.default.enabled.border,
|
|
1530
|
+
} = theme.getTheme_v2(props.theme);
|
|
1531
|
+
return styled.css(_c$c || (_c$c = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
1532
|
+
color: color.input.default.enabled.border,
|
|
1650
1533
|
width: input.border.width
|
|
1651
|
-
}), color.invalid.enabled.bg, color.invalid.enabled.fg, focusRingBorderStyle({
|
|
1652
|
-
color: color.invalid.enabled.border,
|
|
1534
|
+
}), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
|
|
1535
|
+
color: color.input.invalid.enabled.border,
|
|
1653
1536
|
width: input.border.width
|
|
1654
1537
|
}), $unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1655
1538
|
border: {
|
|
1656
|
-
color: color.default.enabled.border,
|
|
1539
|
+
color: color.input.default.enabled.border,
|
|
1657
1540
|
width: input.border.width
|
|
1658
1541
|
},
|
|
1659
|
-
focusRing
|
|
1542
|
+
focusRing: input.text.focusRing
|
|
1660
1543
|
}), $unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1661
|
-
focusRing
|
|
1662
|
-
}), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
|
|
1663
|
-
color: color.default.disabled.border,
|
|
1544
|
+
focusRing: input.text.focusRing
|
|
1545
|
+
}), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1546
|
+
color: color.input.default.disabled.border,
|
|
1664
1547
|
width: input.border.width
|
|
1665
|
-
}), color.default.readOnly.bg, color.default.readOnly.fg, color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
|
|
1666
|
-
color: color.default.hovered.border,
|
|
1548
|
+
}), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
|
|
1549
|
+
color: color.input.default.hovered.border,
|
|
1667
1550
|
width: input.border.width
|
|
1668
1551
|
}));
|
|
1669
1552
|
}
|
|
@@ -1680,13 +1563,10 @@ function responsivePaddingStyle(props) {
|
|
|
1680
1563
|
return [_getResponsiveSpace(theme, ["padding"], props.$padding), _getResponsiveSpace(theme, ["paddingLeft", "paddingRight"], props.$paddingX), _getResponsiveSpace(theme, ["paddingTop", "paddingBottom"], props.$paddingY), _getResponsiveSpace(theme, ["paddingTop"], props.$paddingTop), _getResponsiveSpace(theme, ["paddingRight"], props.$paddingRight), _getResponsiveSpace(theme, ["paddingBottom"], props.$paddingBottom), _getResponsiveSpace(theme, ["paddingLeft"], props.$paddingLeft)].filter(Boolean);
|
|
1681
1564
|
}
|
|
1682
1565
|
function responsiveRadiusStyle(props) {
|
|
1683
|
-
const {
|
|
1684
|
-
theme
|
|
1685
|
-
} = props;
|
|
1686
1566
|
const {
|
|
1687
1567
|
media,
|
|
1688
1568
|
radius
|
|
1689
|
-
} = theme.
|
|
1569
|
+
} = theme.getTheme_v2(props.theme);
|
|
1690
1570
|
return _responsive(media, props.$radius, value => {
|
|
1691
1571
|
let borderRadius = 0;
|
|
1692
1572
|
if (typeof value === "number") {
|
|
@@ -1715,15 +1595,12 @@ function shadowStyle(shadow) {
|
|
|
1715
1595
|
};
|
|
1716
1596
|
}
|
|
1717
1597
|
function responsiveShadowStyle(props) {
|
|
1718
|
-
const {
|
|
1719
|
-
theme
|
|
1720
|
-
} = props;
|
|
1721
1598
|
const {
|
|
1722
1599
|
card,
|
|
1723
1600
|
media,
|
|
1724
|
-
|
|
1725
|
-
} = theme.
|
|
1726
|
-
return _responsive(media, props.$shadow,
|
|
1601
|
+
shadow
|
|
1602
|
+
} = theme.getTheme_v2(props.theme);
|
|
1603
|
+
return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
|
|
1727
1604
|
}
|
|
1728
1605
|
var __freeze$C = Object.freeze;
|
|
1729
1606
|
var __defProp$D = Object.defineProperty;
|
|
@@ -1734,13 +1611,12 @@ var _a$C, _b$m, _c$b;
|
|
|
1734
1611
|
function labelBaseStyle(props) {
|
|
1735
1612
|
const {
|
|
1736
1613
|
$accent,
|
|
1737
|
-
$muted
|
|
1738
|
-
theme
|
|
1614
|
+
$muted
|
|
1739
1615
|
} = props;
|
|
1740
1616
|
const {
|
|
1741
|
-
|
|
1742
|
-
} = theme.
|
|
1743
|
-
return styled.css(_c$b || (_c$b = __template$C(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$m || (_b$m = __template$C(["\n color: var(--card-muted-fg-color);\n "]))),
|
|
1617
|
+
font
|
|
1618
|
+
} = theme.getTheme_v2(props.theme);
|
|
1619
|
+
return styled.css(_c$b || (_c$b = __template$C(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$m || (_b$m = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
|
|
1744
1620
|
}
|
|
1745
1621
|
var __freeze$B = Object.freeze;
|
|
1746
1622
|
var __defProp$C = Object.defineProperty;
|
|
@@ -1830,17 +1706,15 @@ function avatarArrowStyle() {
|
|
|
1830
1706
|
};
|
|
1831
1707
|
}
|
|
1832
1708
|
function avatarRootStyle(props) {
|
|
1833
|
-
var _a, _b, _c, _d;
|
|
1834
1709
|
const {
|
|
1835
|
-
$color
|
|
1836
|
-
theme
|
|
1710
|
+
$color
|
|
1837
1711
|
} = props;
|
|
1838
1712
|
const {
|
|
1839
|
-
|
|
1840
|
-
} = theme.
|
|
1713
|
+
avatar
|
|
1714
|
+
} = theme.getTheme_v2(props.theme);
|
|
1841
1715
|
return {
|
|
1842
|
-
"--avatar-bg-color": ((
|
|
1843
|
-
"--avatar-fg-color": ((
|
|
1716
|
+
"--avatar-bg-color": "var(--card-avatar-".concat($color, "-bg-color)"),
|
|
1717
|
+
"--avatar-fg-color": "var(--card-avatar-".concat($color, "-fg-color)"),
|
|
1844
1718
|
backgroundColor: "var(--avatar-bg-color)",
|
|
1845
1719
|
position: "relative",
|
|
1846
1720
|
boxSizing: "border-box",
|
|
@@ -1868,7 +1742,7 @@ function avatarRootStyle(props) {
|
|
|
1868
1742
|
// @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
|
|
1869
1743
|
"&:focus": {
|
|
1870
1744
|
boxShadow: focusRingStyle({
|
|
1871
|
-
focusRing
|
|
1745
|
+
focusRing: avatar.focusRing
|
|
1872
1746
|
})
|
|
1873
1747
|
},
|
|
1874
1748
|
"&:focus:not(:focus-visible)": {
|
|
@@ -1878,13 +1752,10 @@ function avatarRootStyle(props) {
|
|
|
1878
1752
|
};
|
|
1879
1753
|
}
|
|
1880
1754
|
function responsiveAvatarSizeStyle(props) {
|
|
1881
|
-
const {
|
|
1882
|
-
theme
|
|
1883
|
-
} = props;
|
|
1884
1755
|
const {
|
|
1885
1756
|
avatar,
|
|
1886
1757
|
media
|
|
1887
|
-
} = theme.
|
|
1758
|
+
} = theme.getTheme_v2(props.theme);
|
|
1888
1759
|
return _responsive(media, props.$size, size => {
|
|
1889
1760
|
const avatarSize = avatar.sizes[size] || avatar.sizes[0];
|
|
1890
1761
|
return {
|
|
@@ -1961,8 +1832,10 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1961
1832
|
} = props;
|
|
1962
1833
|
const as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div";
|
|
1963
1834
|
const size = useArrayProp(sizeProp);
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1835
|
+
const {
|
|
1836
|
+
avatar
|
|
1837
|
+
} = useTheme_v2();
|
|
1838
|
+
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
|
|
1966
1839
|
const _sizeRem = avatarSize.size;
|
|
1967
1840
|
const _radius = _sizeRem / 2;
|
|
1968
1841
|
const elementId = react.useId();
|
|
@@ -2061,13 +1934,12 @@ var _a$A, _b$l, _c$a;
|
|
|
2061
1934
|
function textBaseStyle(props) {
|
|
2062
1935
|
const {
|
|
2063
1936
|
$accent,
|
|
2064
|
-
$muted
|
|
2065
|
-
theme
|
|
1937
|
+
$muted
|
|
2066
1938
|
} = props;
|
|
2067
1939
|
const {
|
|
2068
|
-
|
|
2069
|
-
} = theme.
|
|
2070
|
-
return styled.css(_c$a || (_c$a = __template$A(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n }\n "])), $accent && styled.css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))),
|
|
1940
|
+
font
|
|
1941
|
+
} = theme.getTheme_v2(props.theme);
|
|
1942
|
+
return styled.css(_c$a || (_c$a = __template$A(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])), $accent && styled.css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
|
|
2071
1943
|
}
|
|
2072
1944
|
var __freeze$z = Object.freeze;
|
|
2073
1945
|
var __defProp$A = Object.defineProperty;
|
|
@@ -2115,13 +1987,10 @@ var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
|
|
|
2115
1987
|
}));
|
|
2116
1988
|
var _a$y;
|
|
2117
1989
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
2118
|
-
const {
|
|
2119
|
-
theme
|
|
2120
|
-
} = props;
|
|
2121
1990
|
const {
|
|
2122
1991
|
avatar,
|
|
2123
1992
|
media
|
|
2124
|
-
} = theme.
|
|
1993
|
+
} = theme.getTheme_v2(props.theme);
|
|
2125
1994
|
return _responsive(media, props.$size, size => {
|
|
2126
1995
|
const avatarSize = avatar.sizes[size];
|
|
2127
1996
|
if (!avatarSize) return EMPTY_RECORD;
|
|
@@ -2134,9 +2003,9 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
2134
2003
|
}
|
|
2135
2004
|
function _avatarCounterBaseStyle(props) {
|
|
2136
2005
|
const {
|
|
2137
|
-
|
|
2138
|
-
} = props;
|
|
2139
|
-
return styled.css(_a$y || (_a$y = __template$y(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(
|
|
2006
|
+
space
|
|
2007
|
+
} = theme.getTheme_v2(props.theme);
|
|
2008
|
+
return styled.css(_a$y || (_a$y = __template$y(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(space[2]));
|
|
2140
2009
|
}
|
|
2141
2010
|
const Root$A = styled__default.default.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
|
|
2142
2011
|
const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
|
|
@@ -2173,13 +2042,10 @@ function avatarStackStyle() {
|
|
|
2173
2042
|
return BASE_STYLES;
|
|
2174
2043
|
}
|
|
2175
2044
|
function responsiveAvatarStackSizeStyle(props) {
|
|
2176
|
-
const {
|
|
2177
|
-
theme
|
|
2178
|
-
} = props;
|
|
2179
2045
|
const {
|
|
2180
2046
|
avatar,
|
|
2181
2047
|
media
|
|
2182
|
-
} = theme.
|
|
2048
|
+
} = theme.getTheme_v2(props.theme);
|
|
2183
2049
|
return _responsive(media, props.$size, size => {
|
|
2184
2050
|
const avatarSize = avatar.sizes[size];
|
|
2185
2051
|
if (!avatarSize) return EMPTY_RECORD;
|
|
@@ -2292,19 +2158,17 @@ const Box = react.forwardRef(function Box2(props, ref) {
|
|
|
2292
2158
|
});
|
|
2293
2159
|
});
|
|
2294
2160
|
function badgeStyle(props) {
|
|
2295
|
-
var _a;
|
|
2296
2161
|
const {
|
|
2297
|
-
$tone
|
|
2298
|
-
theme
|
|
2162
|
+
$tone
|
|
2299
2163
|
} = props;
|
|
2300
|
-
const color = ((_a = theme.sanity.color.badge) == null ? void 0 : _a[$tone]) || theme.sanity.color.muted[$tone].enabled;
|
|
2301
2164
|
return {
|
|
2302
|
-
"--card-bg-color":
|
|
2303
|
-
"--card-fg-color":
|
|
2165
|
+
"--card-bg-color": "var(--card-badge-".concat($tone, "-bg-color)"),
|
|
2166
|
+
"--card-fg-color": "var(--card-badge-".concat($tone, "-fg-color)"),
|
|
2304
2167
|
backgroundColor: "var(--card-bg-color)",
|
|
2305
2168
|
cursor: "default",
|
|
2306
2169
|
"&:not([hidden])": {
|
|
2307
|
-
display: "inline-block"
|
|
2170
|
+
display: "inline-block",
|
|
2171
|
+
verticalAlign: "top"
|
|
2308
2172
|
}
|
|
2309
2173
|
};
|
|
2310
2174
|
}
|
|
@@ -2316,7 +2180,7 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
|
|
|
2316
2180
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2317
2181
|
mode: _deprecated_mode,
|
|
2318
2182
|
padding = 1,
|
|
2319
|
-
radius =
|
|
2183
|
+
radius = "full",
|
|
2320
2184
|
tone = "default",
|
|
2321
2185
|
...restProps
|
|
2322
2186
|
} = props;
|
|
@@ -2377,33 +2241,73 @@ const Spinner = react.forwardRef(function Spinner2(props, ref) {
|
|
|
2377
2241
|
children: /* @__PURE__ */jsxRuntime.jsx(icons.SpinnerIcon, {})
|
|
2378
2242
|
});
|
|
2379
2243
|
});
|
|
2380
|
-
function
|
|
2244
|
+
function _cardColorStyle(base, color) {
|
|
2381
2245
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2382
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2383
2246
|
return {
|
|
2384
|
-
//
|
|
2385
|
-
|
|
2247
|
+
// from base
|
|
2248
|
+
"--card-focus-ring-color": base.focusRing,
|
|
2386
2249
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
2387
2250
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
2388
2251
|
"--card-shadow-penumbra-color": base.shadow.penumbra,
|
|
2389
2252
|
"--card-shadow-ambient-color": base.shadow.ambient,
|
|
2390
|
-
|
|
2391
|
-
"--card-
|
|
2392
|
-
|
|
2253
|
+
// from state
|
|
2254
|
+
"--card-accent-fg-color": color.accent.fg,
|
|
2255
|
+
"--card-avatar-gray-bg-color": color.avatar.gray.bg,
|
|
2256
|
+
"--card-avatar-gray-fg-color": color.avatar.gray.fg,
|
|
2257
|
+
"--card-avatar-blue-bg-color": color.avatar.blue.bg,
|
|
2258
|
+
"--card-avatar-blue-fg-color": color.avatar.blue.fg,
|
|
2259
|
+
"--card-avatar-purple-bg-color": color.avatar.purple.bg,
|
|
2260
|
+
"--card-avatar-purple-fg-color": color.avatar.purple.fg,
|
|
2261
|
+
"--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
|
|
2262
|
+
"--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
|
|
2263
|
+
"--card-avatar-red-bg-color": color.avatar.red.bg,
|
|
2264
|
+
"--card-avatar-red-fg-color": color.avatar.red.fg,
|
|
2265
|
+
"--card-avatar-orange-bg-color": color.avatar.orange.bg,
|
|
2266
|
+
"--card-avatar-orange-fg-color": color.avatar.orange.fg,
|
|
2267
|
+
"--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
|
|
2268
|
+
"--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
|
|
2269
|
+
"--card-avatar-green-bg-color": color.avatar.green.bg,
|
|
2270
|
+
"--card-avatar-green-fg-color": color.avatar.green.fg,
|
|
2271
|
+
"--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
|
|
2272
|
+
"--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
|
|
2393
2273
|
"--card-bg-color": color.bg,
|
|
2394
|
-
"--card-
|
|
2395
|
-
"--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
|
|
2396
|
-
"--card-fg-color": color.fg,
|
|
2274
|
+
"--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.muted.bg, " 0% 50%)") : void 0,
|
|
2397
2275
|
"--card-border-color": color.border,
|
|
2398
|
-
"--card-
|
|
2399
|
-
"--card-
|
|
2400
|
-
"--card-
|
|
2401
|
-
"--card-
|
|
2402
|
-
"--card-
|
|
2403
|
-
"--card-
|
|
2404
|
-
"--card-
|
|
2405
|
-
|
|
2406
|
-
"--card-
|
|
2276
|
+
"--card-badge-default-bg-color": color.badge.default.bg,
|
|
2277
|
+
"--card-badge-default-dot-color": color.badge.default.dot,
|
|
2278
|
+
"--card-badge-default-fg-color": color.badge.default.fg,
|
|
2279
|
+
"--card-badge-default-icon-color": color.badge.default.icon,
|
|
2280
|
+
"--card-badge-primary-bg-color": color.badge.primary.bg,
|
|
2281
|
+
"--card-badge-primary-dot-color": color.badge.primary.dot,
|
|
2282
|
+
"--card-badge-primary-fg-color": color.badge.primary.fg,
|
|
2283
|
+
"--card-badge-primary-icon-color": color.badge.primary.icon,
|
|
2284
|
+
"--card-badge-positive-bg-color": color.badge.positive.bg,
|
|
2285
|
+
"--card-badge-positive-dot-color": color.badge.positive.dot,
|
|
2286
|
+
"--card-badge-positive-fg-color": color.badge.positive.fg,
|
|
2287
|
+
"--card-badge-positive-icon-color": color.badge.positive.icon,
|
|
2288
|
+
"--card-badge-caution-bg-color": color.badge.caution.bg,
|
|
2289
|
+
"--card-badge-caution-dot-color": color.badge.caution.dot,
|
|
2290
|
+
"--card-badge-caution-fg-color": color.badge.caution.fg,
|
|
2291
|
+
"--card-badge-caution-icon-color": color.badge.caution.icon,
|
|
2292
|
+
"--card-badge-critical-bg-color": color.badge.critical.bg,
|
|
2293
|
+
"--card-badge-critical-dot-color": color.badge.critical.dot,
|
|
2294
|
+
"--card-badge-critical-fg-color": color.badge.critical.fg,
|
|
2295
|
+
"--card-badge-critical-icon-color": color.badge.critical.icon,
|
|
2296
|
+
"--card-code-bg-color": color.code.bg,
|
|
2297
|
+
"--card-code-fg-color": color.code.fg,
|
|
2298
|
+
"--card-fg-color": color.fg,
|
|
2299
|
+
"--card-icon-color": color.icon,
|
|
2300
|
+
"--card-kbd-bg-color": color.kbd.bg,
|
|
2301
|
+
"--card-kbd-border-color": color.kbd.border,
|
|
2302
|
+
"--card-kbd-fg-color": color.kbd.fg,
|
|
2303
|
+
"--card-link-fg-color": color.link.fg,
|
|
2304
|
+
"--card-muted-bg-color": color.muted.bg,
|
|
2305
|
+
"--card-muted-fg-color": color.muted.fg,
|
|
2306
|
+
"--card-skeleton-color-from": color.skeleton.from,
|
|
2307
|
+
"--card-skeleton-color-to": color.skeleton.to,
|
|
2308
|
+
// deprecated variables (kept for legacy)
|
|
2309
|
+
"--card-bg2-color": color.muted.bg,
|
|
2310
|
+
"--card-link-color": color.link.fg,
|
|
2407
2311
|
"--card-hairline-soft-color": color.border,
|
|
2408
2312
|
"--card-hairline-hard-color": color.border
|
|
2409
2313
|
};
|
|
@@ -2414,15 +2318,14 @@ var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
|
|
|
2414
2318
|
value: __freeze$v(raw || cooked.slice())
|
|
2415
2319
|
}));
|
|
2416
2320
|
var _a$v, _b$j;
|
|
2417
|
-
function buttonBaseStyles(
|
|
2418
|
-
|
|
2419
|
-
$width
|
|
2420
|
-
|
|
2421
|
-
} = _ref2;
|
|
2321
|
+
function buttonBaseStyles(props) {
|
|
2322
|
+
const {
|
|
2323
|
+
$width
|
|
2324
|
+
} = props;
|
|
2422
2325
|
const {
|
|
2423
|
-
|
|
2424
|
-
} = theme.
|
|
2425
|
-
return styled.css(_b$j || (_b$j = __template$v(["\n ", ";\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ", "\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])),
|
|
2326
|
+
style
|
|
2327
|
+
} = theme.getTheme_v2(props.theme);
|
|
2328
|
+
return styled.css(_b$j || (_b$j = __template$v(["\n ", ";\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ", "\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])), style == null ? void 0 : style.button, $width === "fill" && styled.css(_a$v || (_a$v = __template$v(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
|
|
2426
2329
|
}
|
|
2427
2330
|
function combineBoxShadow() {
|
|
2428
2331
|
for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -2431,49 +2334,51 @@ function combineBoxShadow() {
|
|
|
2431
2334
|
return boxShadows.filter(Boolean).join(",");
|
|
2432
2335
|
}
|
|
2433
2336
|
function buttonColorStyles(props) {
|
|
2434
|
-
var _a2
|
|
2337
|
+
var _a2;
|
|
2435
2338
|
const {
|
|
2436
|
-
$mode
|
|
2437
|
-
theme
|
|
2339
|
+
$mode
|
|
2438
2340
|
} = props;
|
|
2439
|
-
const
|
|
2341
|
+
const {
|
|
2342
|
+
button,
|
|
2343
|
+
color: baseColor,
|
|
2344
|
+
style
|
|
2345
|
+
} = theme.getTheme_v2(props.theme);
|
|
2440
2346
|
const shadow = props.$mode === "ghost";
|
|
2441
|
-
const
|
|
2442
|
-
const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
|
|
2347
|
+
const mode = baseColor.button[$mode] || baseColor.button.default;
|
|
2443
2348
|
const color = mode[props.$tone] || mode.default;
|
|
2444
2349
|
const border = {
|
|
2445
|
-
width:
|
|
2350
|
+
width: button.border.width,
|
|
2446
2351
|
color: "var(--card-border-color)"
|
|
2447
2352
|
};
|
|
2448
2353
|
const defaultBoxShadow = void 0;
|
|
2449
|
-
return [
|
|
2354
|
+
return [_cardColorStyle(baseColor, color.enabled), {
|
|
2450
2355
|
backgroundColor: "var(--card-bg-color)",
|
|
2451
2356
|
color: "var(--card-fg-color)",
|
|
2452
2357
|
boxShadow: focusRingBorderStyle(border),
|
|
2453
|
-
'&:disabled, &[data-disabled="true"]':
|
|
2358
|
+
'&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
|
|
2454
2359
|
"&:not([data-disabled='true'])": {
|
|
2455
2360
|
boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
|
|
2456
2361
|
"&:focus": {
|
|
2457
2362
|
boxShadow: focusRingStyle({
|
|
2458
|
-
base,
|
|
2363
|
+
base: baseColor,
|
|
2459
2364
|
border: {
|
|
2460
2365
|
width: 2,
|
|
2461
|
-
color:
|
|
2366
|
+
color: baseColor.bg
|
|
2462
2367
|
},
|
|
2463
|
-
focusRing:
|
|
2368
|
+
focusRing: button.focusRing
|
|
2464
2369
|
})
|
|
2465
2370
|
},
|
|
2466
2371
|
"&:focus:not(:focus-visible)": {
|
|
2467
2372
|
boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
|
|
2468
2373
|
},
|
|
2469
2374
|
"@media (hover: hover)": {
|
|
2470
|
-
"&:hover":
|
|
2471
|
-
"&:active":
|
|
2472
|
-
"&[data-hovered]":
|
|
2375
|
+
"&:hover": _cardColorStyle(baseColor, color.hovered),
|
|
2376
|
+
"&:active": _cardColorStyle(baseColor, color.pressed),
|
|
2377
|
+
"&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
|
|
2473
2378
|
},
|
|
2474
|
-
"&[data-selected]":
|
|
2379
|
+
"&[data-selected]": _cardColorStyle(baseColor, color.pressed)
|
|
2475
2380
|
}
|
|
2476
|
-
}, (
|
|
2381
|
+
}, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
|
|
2477
2382
|
}
|
|
2478
2383
|
var __freeze$u = Object.freeze;
|
|
2479
2384
|
var __defProp$v = Object.defineProperty;
|
|
@@ -2511,6 +2416,9 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2511
2416
|
width,
|
|
2512
2417
|
...restProps
|
|
2513
2418
|
} = props;
|
|
2419
|
+
const {
|
|
2420
|
+
button
|
|
2421
|
+
} = useTheme_v2();
|
|
2514
2422
|
const justify = useArrayProp(justifyProp);
|
|
2515
2423
|
const padding = useArrayProp(paddingProp);
|
|
2516
2424
|
const paddingX = useArrayProp(paddingXProp);
|
|
@@ -2521,7 +2429,6 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2521
2429
|
const paddingRight = useArrayProp(paddingRightProp);
|
|
2522
2430
|
const radius = useArrayProp(radiusProp);
|
|
2523
2431
|
const space = useArrayProp(spaceProp);
|
|
2524
|
-
const theme = useTheme();
|
|
2525
2432
|
const boxProps = react.useMemo(() => ({
|
|
2526
2433
|
// flex: 1,
|
|
2527
2434
|
padding,
|
|
@@ -2563,7 +2470,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2563
2470
|
align: textAlign,
|
|
2564
2471
|
size: fontSize,
|
|
2565
2472
|
textOverflow: "ellipsis",
|
|
2566
|
-
weight:
|
|
2473
|
+
weight: button.textWeight,
|
|
2567
2474
|
children: text
|
|
2568
2475
|
})
|
|
2569
2476
|
}), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
@@ -2589,40 +2496,37 @@ function cardStyle(props) {
|
|
|
2589
2496
|
}
|
|
2590
2497
|
function cardBaseStyle(props) {
|
|
2591
2498
|
const {
|
|
2592
|
-
$checkered
|
|
2593
|
-
theme
|
|
2499
|
+
$checkered
|
|
2594
2500
|
} = props;
|
|
2595
|
-
const
|
|
2501
|
+
const {
|
|
2502
|
+
space
|
|
2503
|
+
} = theme.getTheme_v2(props.theme);
|
|
2596
2504
|
return styled.css(_b$i || (_b$i = __template$t(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && styled.css(_a$t || (_a$t = __template$t(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
|
|
2597
2505
|
}
|
|
2598
2506
|
function cardColorStyle(props) {
|
|
2599
|
-
var _a2
|
|
2507
|
+
var _a2;
|
|
2600
2508
|
const {
|
|
2601
2509
|
$checkered,
|
|
2602
|
-
$focusRing
|
|
2603
|
-
theme
|
|
2510
|
+
$focusRing
|
|
2604
2511
|
} = props;
|
|
2605
2512
|
const {
|
|
2606
|
-
focusRing
|
|
2607
|
-
} = theme.sanity.card;
|
|
2608
|
-
const {
|
|
2609
|
-
base,
|
|
2610
2513
|
card,
|
|
2611
|
-
|
|
2612
|
-
|
|
2514
|
+
color,
|
|
2515
|
+
style
|
|
2516
|
+
} = theme.getTheme_v2(props.theme);
|
|
2613
2517
|
const border = {
|
|
2614
|
-
width:
|
|
2518
|
+
width: card.border.width,
|
|
2615
2519
|
color: "var(--card-border-color)"
|
|
2616
2520
|
};
|
|
2617
|
-
return styled.css(_c$9 || (_c$9 = __template$t(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])),
|
|
2618
|
-
base,
|
|
2521
|
+
return styled.css(_c$9 || (_c$9 = __template$t(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), color._dark ? "dark" : "light", _cardColorStyle(color, color, $checkered), _cardColorStyle(color, color.selectable.default.disabled, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), _cardColorStyle(color, color.selectable.default.selected, $checkered), _cardColorStyle(color, color.selectable.default.hovered, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
2522
|
+
base: color,
|
|
2619
2523
|
border,
|
|
2620
|
-
focusRing
|
|
2621
|
-
}) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0,
|
|
2622
|
-
base,
|
|
2524
|
+
focusRing: card.focusRing
|
|
2525
|
+
}) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, _cardColorStyle(color, color.selectable.default.disabled, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), _cardColorStyle(color, color.selectable.default.selected, $checkered), _cardColorStyle(color, color.selectable.default.hovered, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
2526
|
+
base: color,
|
|
2623
2527
|
border,
|
|
2624
|
-
focusRing
|
|
2625
|
-
}) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (
|
|
2528
|
+
focusRing: card.focusRing
|
|
2529
|
+
}) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
|
|
2626
2530
|
}
|
|
2627
2531
|
const Root$t = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
2628
2532
|
const Card = react.forwardRef(function Card2(props, ref) {
|
|
@@ -2685,48 +2589,45 @@ function checkboxBaseStyles() {
|
|
|
2685
2589
|
}
|
|
2686
2590
|
function inputElementStyles(props) {
|
|
2687
2591
|
const {
|
|
2688
|
-
|
|
2689
|
-
} = props;
|
|
2690
|
-
const color = theme.sanity.color.input;
|
|
2691
|
-
const {
|
|
2592
|
+
color,
|
|
2692
2593
|
input,
|
|
2693
2594
|
radius
|
|
2694
|
-
} = theme.
|
|
2595
|
+
} = theme.getTheme_v2(props.theme);
|
|
2695
2596
|
const {
|
|
2696
2597
|
focusRing
|
|
2697
2598
|
} = input.checkbox;
|
|
2698
2599
|
return styled.css(_b$h || (_b$h = __template$s(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.5px !important;\n }\n }\n }\n\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
|
|
2699
|
-
color: color.default.enabled.border,
|
|
2600
|
+
color: color.input.default.enabled.border,
|
|
2700
2601
|
width: input.border.width
|
|
2701
|
-
}), rem(radius[2]), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
2702
|
-
color: color.default.enabled.fg,
|
|
2602
|
+
}), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
2603
|
+
color: color.input.default.enabled.fg,
|
|
2703
2604
|
width: input.border.width
|
|
2704
|
-
}), color.default.enabled.bg, focusRingStyle({
|
|
2605
|
+
}), color.input.default.enabled.bg, focusRingStyle({
|
|
2705
2606
|
focusRing
|
|
2706
2607
|
}), focusRingStyle({
|
|
2707
2608
|
focusRing: {
|
|
2708
2609
|
width: 1,
|
|
2709
2610
|
offset: 1
|
|
2710
2611
|
}
|
|
2711
|
-
}), color.invalid.enabled.border, focusRingBorderStyle({
|
|
2612
|
+
}), color.input.invalid.enabled.border, focusRingBorderStyle({
|
|
2712
2613
|
width: input.border.width,
|
|
2713
|
-
color: color.invalid.enabled.
|
|
2714
|
-
}), color.default.disabled.fg, color.invalid.enabled.
|
|
2614
|
+
color: color.input.invalid.enabled.muted.bg
|
|
2615
|
+
}), color.input.default.disabled.fg, color.input.invalid.enabled.muted.bg, color.input.default.enabled.bg, focusRingStyle({
|
|
2715
2616
|
border: {
|
|
2716
2617
|
width: input.border.width,
|
|
2717
|
-
color: color.invalid.readOnly.
|
|
2618
|
+
color: color.input.invalid.readOnly.muted.bg
|
|
2718
2619
|
},
|
|
2719
2620
|
focusRing: {
|
|
2720
2621
|
width: 1,
|
|
2721
2622
|
offset: 1
|
|
2722
2623
|
}
|
|
2723
|
-
}), color.default.disabled.bg, focusRingBorderStyle({
|
|
2624
|
+
}), color.input.default.disabled.bg, focusRingBorderStyle({
|
|
2724
2625
|
width: input.border.width,
|
|
2725
|
-
color: color.default.disabled.border
|
|
2726
|
-
}), color.default.disabled.fg, color.default.disabled.
|
|
2626
|
+
color: color.input.default.disabled.border
|
|
2627
|
+
}), color.input.default.disabled.fg, color.input.default.disabled.muted.bg, color.input.default.readOnly.bg, focusRingBorderStyle({
|
|
2727
2628
|
width: input.border.width,
|
|
2728
|
-
color: color.default.readOnly.border
|
|
2729
|
-
}), color.default.readOnly.fg, color.default.readOnly.
|
|
2629
|
+
color: color.input.default.readOnly.border
|
|
2630
|
+
}), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
|
|
2730
2631
|
}
|
|
2731
2632
|
const Root$s = styled__default.default.div(checkboxBaseStyles);
|
|
2732
2633
|
const Input$5 = styled__default.default.input(inputElementStyles);
|
|
@@ -2772,11 +2673,15 @@ var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
|
|
|
2772
2673
|
value: __freeze$r(raw || cooked.slice())
|
|
2773
2674
|
}));
|
|
2774
2675
|
var _a$r;
|
|
2775
|
-
function codeSyntaxHighlightingStyle(
|
|
2676
|
+
function codeSyntaxHighlightingStyle(_ref2) {
|
|
2776
2677
|
let {
|
|
2777
|
-
theme
|
|
2778
|
-
} =
|
|
2779
|
-
const
|
|
2678
|
+
theme: theme$1
|
|
2679
|
+
} = _ref2;
|
|
2680
|
+
const {
|
|
2681
|
+
color: {
|
|
2682
|
+
syntax: color
|
|
2683
|
+
}
|
|
2684
|
+
} = theme.getTheme_v2(theme$1);
|
|
2780
2685
|
return {
|
|
2781
2686
|
"&.atrule": {
|
|
2782
2687
|
color: color.atrule
|
|
@@ -2925,13 +2830,10 @@ function containerBaseStyle() {
|
|
|
2925
2830
|
return BASE_STYLE$1;
|
|
2926
2831
|
}
|
|
2927
2832
|
function responsiveContainerWidthStyle(props) {
|
|
2928
|
-
const {
|
|
2929
|
-
theme
|
|
2930
|
-
} = props;
|
|
2931
2833
|
const {
|
|
2932
2834
|
container,
|
|
2933
2835
|
media
|
|
2934
|
-
} = theme.
|
|
2836
|
+
} = theme.getTheme_v2(props.theme);
|
|
2935
2837
|
return _responsive(media, props.$width, val => ({
|
|
2936
2838
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2937
2839
|
}));
|
|
@@ -2992,10 +2894,12 @@ var _a$q, _b$g, _c$8;
|
|
|
2992
2894
|
function headingBaseStyle(props) {
|
|
2993
2895
|
const {
|
|
2994
2896
|
$accent,
|
|
2995
|
-
$muted
|
|
2996
|
-
theme
|
|
2897
|
+
$muted
|
|
2997
2898
|
} = props;
|
|
2998
|
-
|
|
2899
|
+
const {
|
|
2900
|
+
font
|
|
2901
|
+
} = theme.getTheme_v2(props.theme);
|
|
2902
|
+
return styled.css(_c$8 || (_c$8 = __template$q(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$q || (_a$q = __template$q(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$g || (_b$g = __template$q(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
|
|
2999
2903
|
}
|
|
3000
2904
|
var __freeze$p = Object.freeze;
|
|
3001
2905
|
var __defProp$q = Object.defineProperty;
|
|
@@ -3050,14 +2954,15 @@ function inlineBaseStyle() {
|
|
|
3050
2954
|
}
|
|
3051
2955
|
function inlineSpaceStyle(props) {
|
|
3052
2956
|
const {
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
2957
|
+
media,
|
|
2958
|
+
space
|
|
2959
|
+
} = theme.getTheme_v2(props.theme);
|
|
2960
|
+
return _responsive(media, props.$space, spaceIndex => {
|
|
2961
|
+
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
|
|
3057
2962
|
return {
|
|
3058
|
-
margin: "-".concat(
|
|
2963
|
+
margin: "-".concat(_space, " 0 0 -").concat(_space),
|
|
3059
2964
|
"& > div": {
|
|
3060
|
-
padding: "".concat(
|
|
2965
|
+
padding: "".concat(_space, " 0 0 ").concat(_space)
|
|
3061
2966
|
}
|
|
3062
2967
|
};
|
|
3063
2968
|
});
|
|
@@ -3088,12 +2993,8 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
|
|
|
3088
2993
|
value: __freeze$o(raw || cooked.slice())
|
|
3089
2994
|
}));
|
|
3090
2995
|
var _a$o;
|
|
3091
|
-
function kbdStyle(
|
|
3092
|
-
|
|
3093
|
-
theme
|
|
3094
|
-
} = props;
|
|
3095
|
-
const color = theme.sanity.color.kbd || theme.sanity.color.base;
|
|
3096
|
-
return styled.css(_a$o || (_a$o = __template$o(["\n --card-fg-color: ", ";\n --kbd-box-bg: ", ";\n --kbd-box-shadow: ", ";\n\n box-shadow: inset 0 0 0 1px var(--kbd-box-shadow);\n background: var(--kbd-box-bg);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])), color.fg, color.bg, color.border);
|
|
2996
|
+
function kbdStyle() {
|
|
2997
|
+
return styled.css(_a$o || (_a$o = __template$o(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
3097
2998
|
}
|
|
3098
2999
|
const Root$m = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
|
|
3099
3000
|
const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
@@ -3115,7 +3016,7 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
|
3115
3016
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
3116
3017
|
as: "span",
|
|
3117
3018
|
size: fontSize,
|
|
3118
|
-
weight: "
|
|
3019
|
+
weight: "semibold",
|
|
3119
3020
|
children
|
|
3120
3021
|
})
|
|
3121
3022
|
})
|
|
@@ -3181,10 +3082,10 @@ var __template$n = (cooked, raw) => __freeze$n(__defProp$o(cooked, "raw", {
|
|
|
3181
3082
|
value: __freeze$n(raw || cooked.slice())
|
|
3182
3083
|
}));
|
|
3183
3084
|
var _a$n, _b$f, _c$7;
|
|
3184
|
-
const Root$l = styled__default.default.div(
|
|
3085
|
+
const Root$l = styled__default.default.div(_ref3 => {
|
|
3185
3086
|
let {
|
|
3186
3087
|
$w: w
|
|
3187
|
-
} =
|
|
3088
|
+
} = _ref3;
|
|
3188
3089
|
return styled.css(_a$n || (_a$n = __template$n(["\n position: absolute;\n width: ", "px;\n height: ", "px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n\n & > svg {\n transform: rotate(0);\n }\n }\n\n [data-placement^='right'] > & {\n left: -", "px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -", "px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -", "px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n "])), w, w, w / 2, w / 2, w, w, w, w);
|
|
3189
3090
|
});
|
|
3190
3091
|
const StrokePath = styled__default.default.path(_b$f || (_b$f = __template$n(["\n stroke: var(--card-shadow-outline-color);\n"])));
|
|
@@ -3196,8 +3097,10 @@ const Arrow = react.forwardRef(function Arrow2(props, ref) {
|
|
|
3196
3097
|
radius = 0,
|
|
3197
3098
|
...restProps
|
|
3198
3099
|
} = props;
|
|
3199
|
-
const
|
|
3200
|
-
|
|
3100
|
+
const {
|
|
3101
|
+
card
|
|
3102
|
+
} = useTheme_v2();
|
|
3103
|
+
const strokeWidth = card.shadow.outline;
|
|
3201
3104
|
const center = w / 2;
|
|
3202
3105
|
const points = [{
|
|
3203
3106
|
x: 0,
|
|
@@ -3266,6 +3169,9 @@ function BoundaryElementProvider(props) {
|
|
|
3266
3169
|
children
|
|
3267
3170
|
});
|
|
3268
3171
|
}
|
|
3172
|
+
function isRecord(value) {
|
|
3173
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
3174
|
+
}
|
|
3269
3175
|
const DEFAULT_VALUE = {
|
|
3270
3176
|
version: 0,
|
|
3271
3177
|
element: null
|
|
@@ -3298,10 +3204,10 @@ function findMinBreakpoints(media, width) {
|
|
|
3298
3204
|
return ret;
|
|
3299
3205
|
}
|
|
3300
3206
|
const ElementQuery = react.forwardRef(function ElementQuery2(props, ref) {
|
|
3301
|
-
const theme =
|
|
3207
|
+
const theme = useTheme_v2();
|
|
3302
3208
|
const {
|
|
3303
3209
|
children,
|
|
3304
|
-
media = theme.
|
|
3210
|
+
media = theme.media,
|
|
3305
3211
|
...restProps
|
|
3306
3212
|
} = props;
|
|
3307
3213
|
const forwardedRef = useForwardedRef(ref);
|
|
@@ -3743,7 +3649,7 @@ const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
|
|
|
3743
3649
|
} = props;
|
|
3744
3650
|
const {
|
|
3745
3651
|
space
|
|
3746
|
-
} =
|
|
3652
|
+
} = useTheme_v2();
|
|
3747
3653
|
const forwardedRef = useForwardedRef(ref);
|
|
3748
3654
|
const wrapperRef = react.useRef(null);
|
|
3749
3655
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -3936,13 +3842,13 @@ function size(options) {
|
|
|
3936
3842
|
}
|
|
3937
3843
|
function calcCurrentWidth(params) {
|
|
3938
3844
|
const {
|
|
3845
|
+
container,
|
|
3939
3846
|
mediaIndex,
|
|
3940
|
-
theme,
|
|
3941
3847
|
width
|
|
3942
3848
|
} = params;
|
|
3943
3849
|
const w = width[mediaIndex];
|
|
3944
3850
|
const currentWidth = w === void 0 ? width[width.length - 1] : w;
|
|
3945
|
-
return typeof currentWidth === "number" ?
|
|
3851
|
+
return typeof currentWidth === "number" ? container[currentWidth] : void 0;
|
|
3946
3852
|
}
|
|
3947
3853
|
function calcMaxWidth(params) {
|
|
3948
3854
|
const {
|
|
@@ -4037,8 +3943,11 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
4037
3943
|
}));
|
|
4038
3944
|
PopoverCard.displayName = "PopoverCard";
|
|
4039
3945
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
4040
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
4041
|
-
const
|
|
3946
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3947
|
+
const {
|
|
3948
|
+
container,
|
|
3949
|
+
layer
|
|
3950
|
+
} = useTheme_v2();
|
|
4042
3951
|
const boundaryElementContext = useBoundaryElement();
|
|
4043
3952
|
const {
|
|
4044
3953
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
@@ -4066,11 +3975,11 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
4066
3975
|
shadow: shadowProp = 3,
|
|
4067
3976
|
tone = "inherit",
|
|
4068
3977
|
width: widthProp = "auto",
|
|
4069
|
-
zOffset: zOffsetProp =
|
|
3978
|
+
zOffset: zOffsetProp = layer.popover.zOffset,
|
|
4070
3979
|
updateRef,
|
|
4071
3980
|
...restProps
|
|
4072
3981
|
} = props;
|
|
4073
|
-
const boundarySize = (
|
|
3982
|
+
const boundarySize = (_e = useElementSize(boundaryElement)) == null ? void 0 : _e.border;
|
|
4074
3983
|
const padding = useArrayProp(paddingProp);
|
|
4075
3984
|
const radius = useArrayProp(radiusProp);
|
|
4076
3985
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -4082,8 +3991,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
4082
3991
|
const mediaIndex = useMediaIndex();
|
|
4083
3992
|
const boundaryWidth = constrainSize || preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0;
|
|
4084
3993
|
const width = calcCurrentWidth({
|
|
3994
|
+
container,
|
|
4085
3995
|
mediaIndex,
|
|
4086
|
-
theme,
|
|
4087
3996
|
width: widthArrayProp
|
|
4088
3997
|
});
|
|
4089
3998
|
const widthRef = react.useRef(width);
|
|
@@ -4129,13 +4038,13 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
4129
4038
|
}));
|
|
4130
4039
|
if (constrainSize || matchReferenceWidth) {
|
|
4131
4040
|
ret.push(size({
|
|
4132
|
-
apply(
|
|
4041
|
+
apply(_ref4) {
|
|
4133
4042
|
let {
|
|
4134
4043
|
availableWidth,
|
|
4135
4044
|
availableHeight,
|
|
4136
4045
|
elements,
|
|
4137
4046
|
referenceWidth
|
|
4138
|
-
} =
|
|
4047
|
+
} = _ref4;
|
|
4139
4048
|
referenceWidthRef.current = referenceWidth;
|
|
4140
4049
|
const _currentWidth = widthRef.current;
|
|
4141
4050
|
const _maxWidth = maxWidthRef.current;
|
|
@@ -4189,9 +4098,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
4189
4098
|
placement: placementProp,
|
|
4190
4099
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
4191
4100
|
});
|
|
4192
|
-
const referenceHidden = (
|
|
4193
|
-
const arrowX = (
|
|
4194
|
-
const arrowY = (
|
|
4101
|
+
const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
|
|
4102
|
+
const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
|
|
4103
|
+
const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
|
|
4195
4104
|
const setArrow = react.useCallback(arrowEl => {
|
|
4196
4105
|
arrowRef.current = arrowEl;
|
|
4197
4106
|
}, []);
|
|
@@ -4275,32 +4184,26 @@ function radioBaseStyle() {
|
|
|
4275
4184
|
}
|
|
4276
4185
|
function inputElementStyle(props) {
|
|
4277
4186
|
const {
|
|
4278
|
-
|
|
4279
|
-
} = props;
|
|
4280
|
-
const {
|
|
4187
|
+
color,
|
|
4281
4188
|
input
|
|
4282
|
-
} = theme.
|
|
4283
|
-
const {
|
|
4284
|
-
focusRing
|
|
4285
|
-
} = input.radio;
|
|
4286
|
-
const color = theme.sanity.color.input;
|
|
4189
|
+
} = theme.getTheme_v2(props.theme);
|
|
4287
4190
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
4288
|
-
return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
|
|
4289
|
-
color: color.default.enabled.border,
|
|
4191
|
+
return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.input.default.enabled.bg, focusRingBorderStyle({
|
|
4192
|
+
color: color.input.default.enabled.border,
|
|
4290
4193
|
width: input.border.width
|
|
4291
|
-
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
|
|
4194
|
+
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.input.default.enabled.fg, focusRingStyle({
|
|
4292
4195
|
border: {
|
|
4293
4196
|
width: input.border.width,
|
|
4294
|
-
color: color.default.enabled.border
|
|
4197
|
+
color: color.input.default.enabled.border
|
|
4295
4198
|
},
|
|
4296
|
-
focusRing
|
|
4199
|
+
focusRing: input.radio.focusRing
|
|
4297
4200
|
}), focusRingBorderStyle({
|
|
4298
|
-
color: color.default.enabled.border,
|
|
4201
|
+
color: color.input.default.enabled.border,
|
|
4299
4202
|
width: input.border.width
|
|
4300
|
-
}), color.invalid.enabled.border, focusRingBorderStyle({
|
|
4203
|
+
}), color.input.invalid.enabled.border, focusRingBorderStyle({
|
|
4301
4204
|
width: input.border.width,
|
|
4302
|
-
color: color.invalid.enabled.
|
|
4303
|
-
}), color.invalid.enabled.
|
|
4205
|
+
color: color.input.invalid.enabled.muted.bg
|
|
4206
|
+
}), color.input.invalid.enabled.muted.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg, color.input.default.readOnly.border, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.disabled.border);
|
|
4304
4207
|
}
|
|
4305
4208
|
const Root$g = styled__default.default.div(radioBaseStyle);
|
|
4306
4209
|
const Input$4 = styled__default.default.input(inputElementStyle);
|
|
@@ -4341,39 +4244,32 @@ function rootStyle() {
|
|
|
4341
4244
|
}
|
|
4342
4245
|
function inputBaseStyle(props) {
|
|
4343
4246
|
const {
|
|
4344
|
-
|
|
4345
|
-
} = props;
|
|
4346
|
-
|
|
4347
|
-
return styled.css(_b$c || (_b$c = __template$j(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.family);
|
|
4247
|
+
font
|
|
4248
|
+
} = theme.getTheme_v2(props.theme);
|
|
4249
|
+
return styled.css(_b$c || (_b$c = __template$j(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.text.family);
|
|
4348
4250
|
}
|
|
4349
4251
|
function inputColorStyle(props) {
|
|
4350
4252
|
const {
|
|
4351
|
-
|
|
4352
|
-
} = props;
|
|
4353
|
-
const {
|
|
4253
|
+
color,
|
|
4354
4254
|
input
|
|
4355
|
-
} = theme.
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
} = input.select;
|
|
4359
|
-
const color = theme.sanity.color.input;
|
|
4360
|
-
return styled.css(_c$6 || (_c$6 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
4361
|
-
color: color.default.enabled.border,
|
|
4255
|
+
} = theme.getTheme_v2(props.theme);
|
|
4256
|
+
return styled.css(_c$6 || (_c$6 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
4257
|
+
color: color.input.default.enabled.border,
|
|
4362
4258
|
width: input.border.width
|
|
4363
|
-
}), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
|
|
4364
|
-
color: color.default.hovered.border,
|
|
4259
|
+
}), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
|
|
4260
|
+
color: color.input.default.hovered.border,
|
|
4365
4261
|
width: input.border.width
|
|
4366
4262
|
}), focusRingStyle({
|
|
4367
4263
|
border: {
|
|
4368
4264
|
width: input.border.width,
|
|
4369
|
-
color: color.default.enabled.border
|
|
4265
|
+
color: color.input.default.enabled.border
|
|
4370
4266
|
},
|
|
4371
|
-
focusRing
|
|
4372
|
-
}), color.default.readOnly.bg, color.default.readOnly.fg, focusRingBorderStyle({
|
|
4373
|
-
color: color.default.readOnly.border,
|
|
4267
|
+
focusRing: input.select.focusRing
|
|
4268
|
+
}), color.input.default.readOnly.bg, color.input.default.readOnly.fg, focusRingBorderStyle({
|
|
4269
|
+
color: color.input.default.readOnly.border,
|
|
4374
4270
|
width: input.border.width
|
|
4375
|
-
}), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
|
|
4376
|
-
color: color.default.disabled.border,
|
|
4271
|
+
}), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
4272
|
+
color: color.input.default.disabled.border,
|
|
4377
4273
|
width: input.border.width
|
|
4378
4274
|
}));
|
|
4379
4275
|
}
|
|
@@ -4385,23 +4281,22 @@ function textSize(size) {
|
|
|
4385
4281
|
}
|
|
4386
4282
|
function inputTextSizeStyle(props) {
|
|
4387
4283
|
const {
|
|
4388
|
-
theme,
|
|
4389
4284
|
$fontSize
|
|
4390
4285
|
} = props;
|
|
4391
4286
|
const {
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4287
|
+
font,
|
|
4288
|
+
media
|
|
4289
|
+
} = theme.getTheme_v2(props.theme);
|
|
4290
|
+
return _responsive(media, $fontSize, sizeIndex => textSize(font.text.sizes[sizeIndex] || font.text.sizes[2]));
|
|
4395
4291
|
}
|
|
4396
4292
|
function inputStyle() {
|
|
4397
4293
|
return [responsiveRadiusStyle, inputBaseStyle, inputColorStyle, inputTextSizeStyle, responsiveInputPaddingIconRightStyle];
|
|
4398
4294
|
}
|
|
4399
4295
|
function iconBoxStyle(props) {
|
|
4400
4296
|
const {
|
|
4401
|
-
|
|
4402
|
-
} = props;
|
|
4403
|
-
|
|
4404
|
-
return styled.css(_d$5 || (_d$5 = __template$j(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ", ";\n }\n "])), color.default.enabled.fg, color.default.hovered.fg, color.default.disabled.fg, color.default.readOnly.fg);
|
|
4297
|
+
color
|
|
4298
|
+
} = theme.getTheme_v2(props.theme);
|
|
4299
|
+
return styled.css(_d$5 || (_d$5 = __template$j(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ", ";\n }\n "])), color.input.default.enabled.fg, color.input.default.hovered.fg, color.input.default.disabled.fg, color.input.default.readOnly.fg);
|
|
4405
4300
|
}
|
|
4406
4301
|
const selectStyle = {
|
|
4407
4302
|
root: rootStyle,
|
|
@@ -4461,13 +4356,10 @@ function stackBaseStyle() {
|
|
|
4461
4356
|
return BASE_STYLE;
|
|
4462
4357
|
}
|
|
4463
4358
|
function responsiveStackSpaceStyle(props) {
|
|
4464
|
-
const {
|
|
4465
|
-
theme
|
|
4466
|
-
} = props;
|
|
4467
4359
|
const {
|
|
4468
4360
|
media,
|
|
4469
4361
|
space
|
|
4470
|
-
} = theme.
|
|
4362
|
+
} = theme.getTheme_v2(props.theme);
|
|
4471
4363
|
return _responsive(media, props.$space, spaceIndex => ({
|
|
4472
4364
|
gridGap: rem(space[spaceIndex])
|
|
4473
4365
|
}));
|
|
@@ -4502,36 +4394,26 @@ function switchInputStyles() {
|
|
|
4502
4394
|
}
|
|
4503
4395
|
function switchRepresentationStyles(props) {
|
|
4504
4396
|
const {
|
|
4505
|
-
|
|
4506
|
-
} = props;
|
|
4507
|
-
const {
|
|
4397
|
+
color,
|
|
4508
4398
|
input
|
|
4509
|
-
} = theme.
|
|
4510
|
-
|
|
4511
|
-
focusRing
|
|
4512
|
-
}
|
|
4513
|
-
const color = theme.sanity.color.input;
|
|
4514
|
-
return styled.css(_c$5 || (_c$5 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.border, color.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
|
|
4515
|
-
focusRing
|
|
4516
|
-
}), color.default.enabled.fg, color.default.enabled.bg, color.default.hovered.border, color.default.hovered.bg, color.default.enabled.fg, color.default.enabled.bg, color.default.disabled.border, color.default.disabled.bg, color.default.readOnly.border, color.default.readOnly.bg);
|
|
4399
|
+
} = theme.getTheme_v2(props.theme);
|
|
4400
|
+
return styled.css(_c$5 || (_c$5 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.input.default.enabled.border, color.input.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
|
|
4401
|
+
focusRing: input.switch.focusRing
|
|
4402
|
+
}), color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.hovered.border, color.input.default.hovered.bg, color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg);
|
|
4517
4403
|
}
|
|
4518
4404
|
function switchTrackStyles(props) {
|
|
4519
|
-
const {
|
|
4520
|
-
theme
|
|
4521
|
-
} = props;
|
|
4522
4405
|
const {
|
|
4523
4406
|
input
|
|
4524
|
-
} = theme.
|
|
4407
|
+
} = theme.getTheme_v2(props.theme);
|
|
4525
4408
|
return styled.css(_d$4 || (_d$4 = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2));
|
|
4526
4409
|
}
|
|
4527
4410
|
function switchThumbStyles(props) {
|
|
4528
4411
|
const {
|
|
4529
|
-
$indeterminate
|
|
4530
|
-
theme
|
|
4412
|
+
$indeterminate
|
|
4531
4413
|
} = props;
|
|
4532
4414
|
const {
|
|
4533
4415
|
input
|
|
4534
|
-
} = theme.
|
|
4416
|
+
} = theme.getTheme_v2(props.theme);
|
|
4535
4417
|
const trackWidth = input.switch.width;
|
|
4536
4418
|
const trackHeight = input.switch.height;
|
|
4537
4419
|
const trackPadding = input.switch.padding;
|
|
@@ -4825,12 +4707,12 @@ function useDelayedState(initialState) {
|
|
|
4825
4707
|
}, []);
|
|
4826
4708
|
return [state, onStateChange];
|
|
4827
4709
|
}
|
|
4828
|
-
function ConditionalWrapper(
|
|
4710
|
+
function ConditionalWrapper(_ref5) {
|
|
4829
4711
|
let {
|
|
4830
4712
|
children,
|
|
4831
4713
|
condition,
|
|
4832
4714
|
wrapper
|
|
4833
|
-
} =
|
|
4715
|
+
} = _ref5;
|
|
4834
4716
|
if (!condition) {
|
|
4835
4717
|
return children;
|
|
4836
4718
|
}
|
|
@@ -4891,16 +4773,18 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
|
|
|
4891
4773
|
value: __freeze$f(raw || cooked.slice())
|
|
4892
4774
|
}));
|
|
4893
4775
|
var _a$f;
|
|
4894
|
-
const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])),
|
|
4776
|
+
const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref6 => {
|
|
4895
4777
|
let {
|
|
4896
4778
|
$maxWidth
|
|
4897
|
-
} =
|
|
4779
|
+
} = _ref6;
|
|
4898
4780
|
return $maxWidth;
|
|
4899
4781
|
});
|
|
4900
4782
|
const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
4901
|
-
var _a2, _b, _c, _d, _e
|
|
4783
|
+
var _a2, _b, _c, _d, _e;
|
|
4902
4784
|
const boundaryElementContext = useBoundaryElement();
|
|
4903
|
-
const
|
|
4785
|
+
const {
|
|
4786
|
+
layer
|
|
4787
|
+
} = useTheme_v2();
|
|
4904
4788
|
const {
|
|
4905
4789
|
arrow: arrowProp = false,
|
|
4906
4790
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
@@ -4914,7 +4798,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4914
4798
|
radius = 2,
|
|
4915
4799
|
scheme,
|
|
4916
4800
|
shadow = 2,
|
|
4917
|
-
zOffset =
|
|
4801
|
+
zOffset = layer.tooltip.zOffset,
|
|
4918
4802
|
delay,
|
|
4919
4803
|
animate = false,
|
|
4920
4804
|
...restProps
|
|
@@ -4925,7 +4809,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4925
4809
|
const arrowRef = react.useRef(null);
|
|
4926
4810
|
const rootBoundary = "viewport";
|
|
4927
4811
|
const portal = usePortal();
|
|
4928
|
-
const portalElement = typeof portalProp === "string" ? ((
|
|
4812
|
+
const portalElement = typeof portalProp === "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element;
|
|
4929
4813
|
const tooltipWidth = react.useMemo(() => {
|
|
4930
4814
|
const availableWidths = [...(boundaryElement ? [boundaryElement.offsetWidth] : []), (portalElement == null ? void 0 : portalElement.offsetWidth) || document.body.offsetWidth];
|
|
4931
4815
|
return Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2;
|
|
@@ -4965,8 +4849,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4965
4849
|
placement: placementProp,
|
|
4966
4850
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
4967
4851
|
});
|
|
4968
|
-
const arrowX = (
|
|
4969
|
-
const arrowY = (
|
|
4852
|
+
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
4853
|
+
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
4970
4854
|
const arrowStyle = react.useMemo(() => ({
|
|
4971
4855
|
left: arrowX !== null ? arrowX : void 0,
|
|
4972
4856
|
top: arrowY !== null ? arrowY : void 0,
|
|
@@ -5310,10 +5194,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
5310
5194
|
query,
|
|
5311
5195
|
value
|
|
5312
5196
|
} = state;
|
|
5313
|
-
const defaultRenderOption = react.useCallback(
|
|
5197
|
+
const defaultRenderOption = react.useCallback(_ref7 => {
|
|
5314
5198
|
let {
|
|
5315
5199
|
value: value2
|
|
5316
|
-
} =
|
|
5200
|
+
} = _ref7;
|
|
5317
5201
|
return /* @__PURE__ */jsxRuntime.jsx(Card, {
|
|
5318
5202
|
"data-as": "button",
|
|
5319
5203
|
padding: paddingProp,
|
|
@@ -5772,11 +5656,13 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
|
|
|
5772
5656
|
value: __freeze$c(raw || cooked.slice())
|
|
5773
5657
|
}));
|
|
5774
5658
|
var _a$c, _b$7;
|
|
5775
|
-
function dialogStyle(
|
|
5659
|
+
function dialogStyle(_ref8) {
|
|
5776
5660
|
let {
|
|
5777
|
-
theme
|
|
5778
|
-
} =
|
|
5779
|
-
const
|
|
5661
|
+
theme: theme$1
|
|
5662
|
+
} = _ref8;
|
|
5663
|
+
const {
|
|
5664
|
+
color
|
|
5665
|
+
} = theme.getTheme_v2(theme$1);
|
|
5780
5666
|
return {
|
|
5781
5667
|
"&:not([hidden])": {
|
|
5782
5668
|
display: "flex"
|
|
@@ -5788,16 +5674,13 @@ function dialogStyle(_ref9) {
|
|
|
5788
5674
|
alignItems: "center",
|
|
5789
5675
|
justifyContent: "center",
|
|
5790
5676
|
outline: "none",
|
|
5791
|
-
background: color.
|
|
5677
|
+
background: color.backdrop
|
|
5792
5678
|
};
|
|
5793
5679
|
}
|
|
5794
5680
|
function responsiveDialogPositionStyle(props) {
|
|
5795
|
-
const {
|
|
5796
|
-
theme
|
|
5797
|
-
} = props;
|
|
5798
5681
|
const {
|
|
5799
5682
|
media
|
|
5800
|
-
} = theme.
|
|
5683
|
+
} = theme.getTheme_v2(props.theme);
|
|
5801
5684
|
return _responsive(media, props.$position, position => ({
|
|
5802
5685
|
"&&": {
|
|
5803
5686
|
position
|
|
@@ -5949,14 +5832,16 @@ const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
|
5949
5832
|
});
|
|
5950
5833
|
});
|
|
5951
5834
|
const Dialog = react.forwardRef(function Dialog2(props, ref) {
|
|
5952
|
-
var _a2
|
|
5835
|
+
var _a2;
|
|
5953
5836
|
const dialog = useDialog();
|
|
5954
|
-
const
|
|
5837
|
+
const {
|
|
5838
|
+
layer
|
|
5839
|
+
} = useTheme_v2();
|
|
5955
5840
|
const {
|
|
5956
5841
|
__unstable_autoFocus: autoFocus = true,
|
|
5957
5842
|
__unstable_hideCloseButton: hideCloseButton = false,
|
|
5958
|
-
cardRadius: cardRadiusProp =
|
|
5959
|
-
cardShadow =
|
|
5843
|
+
cardRadius: cardRadiusProp = 4,
|
|
5844
|
+
cardShadow = 3,
|
|
5960
5845
|
children,
|
|
5961
5846
|
contentRef,
|
|
5962
5847
|
footer,
|
|
@@ -5971,12 +5856,12 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
|
|
|
5971
5856
|
position: positionProp = dialog.position || "fixed",
|
|
5972
5857
|
scheme,
|
|
5973
5858
|
width: widthProp = 0,
|
|
5974
|
-
zOffset: zOffsetProp = dialog.zOffset ||
|
|
5859
|
+
zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
|
|
5975
5860
|
animate = false,
|
|
5976
5861
|
...restProps
|
|
5977
5862
|
} = props;
|
|
5978
5863
|
const portal = usePortal();
|
|
5979
|
-
const portalElement = portalProp ? ((
|
|
5864
|
+
const portalElement = portalProp ? ((_a2 = portal.elements) == null ? void 0 : _a2[portalProp]) || null : portal.element;
|
|
5980
5865
|
const boundaryElement = useBoundaryElement().element;
|
|
5981
5866
|
const cardRadius = useArrayProp(cardRadiusProp);
|
|
5982
5867
|
const padding = useArrayProp(paddingProp);
|
|
@@ -6087,7 +5972,7 @@ var __template$a = (cooked, raw) => __freeze$a(__defProp$a(cooked, "raw", {
|
|
|
6087
5972
|
value: __freeze$a(raw || cooked.slice())
|
|
6088
5973
|
}));
|
|
6089
5974
|
var _a$a, _b$5;
|
|
6090
|
-
const Root$6 = styled__default.default.kbd(_a$a || (_a$a = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n
|
|
5975
|
+
const Root$6 = styled__default.default.kbd(_a$a || (_a$a = __template$a(["\n font: inherit;\n padding: 1px;\n\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
6091
5976
|
const Key = styled__default.default(KBD)(_b$5 || (_b$5 = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
6092
5977
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
6093
5978
|
const {
|
|
@@ -6095,7 +5980,7 @@ const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
|
6095
5980
|
keys,
|
|
6096
5981
|
padding,
|
|
6097
5982
|
radius,
|
|
6098
|
-
space: spaceProp =
|
|
5983
|
+
space: spaceProp = 0.5,
|
|
6099
5984
|
...restProps
|
|
6100
5985
|
} = props;
|
|
6101
5986
|
const space = useArrayProp(spaceProp);
|
|
@@ -6565,18 +6450,16 @@ function selectableBaseStyle() {
|
|
|
6565
6450
|
return styled.css(_a$7 || (_a$7 = __template$7(["\n background-color: inherit;\n color: inherit;\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n text-decoration: none;\n }\n "])));
|
|
6566
6451
|
}
|
|
6567
6452
|
function selectableColorStyle(props) {
|
|
6568
|
-
var _a2
|
|
6453
|
+
var _a2;
|
|
6569
6454
|
const {
|
|
6570
|
-
$tone
|
|
6571
|
-
theme
|
|
6455
|
+
$tone
|
|
6572
6456
|
} = props;
|
|
6573
6457
|
const {
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
return styled.css(_b$4 || (_b$4 = __template$7(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
|
|
6458
|
+
color,
|
|
6459
|
+
style
|
|
6460
|
+
} = theme.getTheme_v2(props.theme);
|
|
6461
|
+
const tone = color.selectable[$tone];
|
|
6462
|
+
return styled.css(_b$4 || (_b$4 = __template$7(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _cardColorStyle(color, tone.enabled), _cardColorStyle(color, tone.disabled), _cardColorStyle(color, tone.pressed), _cardColorStyle(color, tone.selected), _cardColorStyle(color, tone.hovered), _cardColorStyle(color, tone.pressed), _cardColorStyle(color, tone.disabled), _cardColorStyle(color, tone.pressed), _cardColorStyle(color, tone.selected), _cardColorStyle(color, tone.hovered), _cardColorStyle(color, tone.pressed), (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
|
|
6580
6463
|
}
|
|
6581
6464
|
const Selectable = styled__default.default(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
|
|
6582
6465
|
function useMenu() {
|
|
@@ -6779,6 +6662,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6779
6662
|
paddingBottom,
|
|
6780
6663
|
paddingLeft
|
|
6781
6664
|
}), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]);
|
|
6665
|
+
const hotkeysFontSize = useArrayProp(fontSize).map(s => s - 1);
|
|
6782
6666
|
const setRef = react.useCallback(el => {
|
|
6783
6667
|
ref.current = el;
|
|
6784
6668
|
setRootElement(el);
|
|
@@ -6820,7 +6704,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6820
6704
|
children: text
|
|
6821
6705
|
})
|
|
6822
6706
|
}), hotkeys && /* @__PURE__ */jsxRuntime.jsx(Hotkeys, {
|
|
6823
|
-
fontSize,
|
|
6707
|
+
fontSize: hotkeysFontSize,
|
|
6824
6708
|
keys: hotkeys,
|
|
6825
6709
|
style: {
|
|
6826
6710
|
marginTop: -4,
|
|
@@ -6845,15 +6729,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
6845
6729
|
var _a$6, _b$3, _c$1, _d;
|
|
6846
6730
|
const keyframe = styled.keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
6847
6731
|
const animation = styled.css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
|
|
6848
|
-
const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])),
|
|
6732
|
+
const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref9 => {
|
|
6849
6733
|
let {
|
|
6850
6734
|
$visible
|
|
6851
|
-
} =
|
|
6735
|
+
} = _ref9;
|
|
6852
6736
|
return $visible ? 1 : 0;
|
|
6853
|
-
},
|
|
6737
|
+
}, _ref10 => {
|
|
6854
6738
|
let {
|
|
6855
6739
|
$animated
|
|
6856
|
-
} =
|
|
6740
|
+
} = _ref10;
|
|
6857
6741
|
return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
6858
6742
|
});
|
|
6859
6743
|
const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -6884,18 +6768,18 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
|
6884
6768
|
ref
|
|
6885
6769
|
});
|
|
6886
6770
|
});
|
|
6887
|
-
const Root$3 = styled__default.default(Skeleton)(
|
|
6888
|
-
|
|
6771
|
+
const Root$3 = styled__default.default(Skeleton)(props => {
|
|
6772
|
+
const {
|
|
6889
6773
|
$size,
|
|
6890
|
-
$style
|
|
6891
|
-
|
|
6892
|
-
} = _ref12;
|
|
6774
|
+
$style
|
|
6775
|
+
} = props;
|
|
6893
6776
|
const {
|
|
6777
|
+
font,
|
|
6894
6778
|
media
|
|
6895
|
-
} = theme.
|
|
6896
|
-
const
|
|
6779
|
+
} = theme.getTheme_v2(props.theme);
|
|
6780
|
+
const fontStyle = font[$style];
|
|
6897
6781
|
const styles = _responsive(media, $size, sizeIndex => {
|
|
6898
|
-
const fontSize =
|
|
6782
|
+
const fontSize = fontStyle.sizes[sizeIndex];
|
|
6899
6783
|
const capHeight = fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight;
|
|
6900
6784
|
return {
|
|
6901
6785
|
height: capHeight
|
|
@@ -7238,12 +7122,12 @@ function ToastProvider(props) {
|
|
|
7238
7122
|
paddingY,
|
|
7239
7123
|
children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
7240
7124
|
initial: false,
|
|
7241
|
-
children: state.map(
|
|
7125
|
+
children: state.map(_ref11 => {
|
|
7242
7126
|
let {
|
|
7243
7127
|
dismiss,
|
|
7244
7128
|
id,
|
|
7245
7129
|
params
|
|
7246
|
-
} =
|
|
7130
|
+
} = _ref11;
|
|
7247
7131
|
return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
|
|
7248
7132
|
animate: {
|
|
7249
7133
|
opacity: 1,
|
|
@@ -7537,26 +7421,20 @@ function treeItemRootStyle() {
|
|
|
7537
7421
|
return styled.css(_a$1 || (_a$1 = __template$1(["\n &[role='none'] > [role='treeitem'] {\n outline: none;\n cursor: default;\n border-radius: 3px;\n\n background-color: var(--card-bg-color);\n color: var(--treeitem-fg-color);\n\n &:focus {\n position: relative;\n }\n }\n\n &[role='treeitem'] {\n outline: none;\n\n & > div {\n cursor: default;\n border-radius: 3px;\n\n background-color: var(--card-bg-color);\n color: var(--treeitem-fg-color);\n }\n\n &:focus > div {\n position: relative;\n }\n }\n "])));
|
|
7538
7422
|
}
|
|
7539
7423
|
function treeItemRootColorStyle(props) {
|
|
7540
|
-
const {
|
|
7541
|
-
theme
|
|
7542
|
-
} = props;
|
|
7543
7424
|
const $tone = "default";
|
|
7544
7425
|
const {
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
} =
|
|
7549
|
-
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
7550
|
-
return styled.css(_b || (_b = __template$1(['\n /* <div role="none"><a data-ui="TreeItem__box" role="treeitem" tabIndex="0"></div> */\n &[role=\'none\'] {\n & > [role=\'treeitem\'] {\n ', "\n }\n\n &[data-selected] > [role='treeitem'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) > [role='treeitem']:not(:focus):hover {\n ", "\n }\n\n & > [role='treeitem']:focus {\n ", '\n }\n }\n }\n\n /* <div role="treeitem" tabIndex="0"><div data-ui="TreeItem__box"></div> */\n &[role=\'treeitem\'] {\n & > [data-ui=\'TreeItem__box\'] {\n ', "\n }\n\n &[data-selected] > [data-ui='TreeItem__box'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {\n ", "\n }\n\n &:focus > [data-ui='TreeItem__box'] {\n ", "\n }\n }\n }\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected));
|
|
7426
|
+
color
|
|
7427
|
+
} = theme.getTheme_v2(props.theme);
|
|
7428
|
+
const tone = color.selectable[$tone];
|
|
7429
|
+
return styled.css(_b || (_b = __template$1(["\n &[role='none'] {\n & > [role='treeitem'] {\n ", "\n }\n\n &[data-selected] > [role='treeitem'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) > [role='treeitem']:not(:focus):hover {\n ", "\n }\n\n & > [role='treeitem']:focus {\n ", "\n }\n }\n }\n\n &[role='treeitem'] {\n & > [data-ui='TreeItem__box'] {\n ", "\n }\n\n &[data-selected] > [data-ui='TreeItem__box'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {\n ", "\n }\n\n &:focus > [data-ui='TreeItem__box'] {\n ", "\n }\n }\n }\n "])), _cardColorStyle(color, tone.enabled), _cardColorStyle(color, tone.pressed), _cardColorStyle(color, tone.hovered), _cardColorStyle(color, tone.selected), _cardColorStyle(color, tone.enabled), _cardColorStyle(color, tone.pressed), _cardColorStyle(color, tone.hovered), _cardColorStyle(color, tone.selected));
|
|
7551
7430
|
}
|
|
7552
7431
|
function treeItemBoxStyle(props) {
|
|
7553
7432
|
const {
|
|
7554
|
-
$level
|
|
7555
|
-
theme
|
|
7433
|
+
$level
|
|
7556
7434
|
} = props;
|
|
7557
7435
|
const {
|
|
7558
7436
|
space
|
|
7559
|
-
} = theme.
|
|
7437
|
+
} = theme.getTheme_v2(props.theme);
|
|
7560
7438
|
return styled.css(_c || (_c = __template$1(["\n padding-left: ", ";\n\n &[data-as='a'] {\n text-decoration: none;\n }\n "])), rem(space[2] * $level));
|
|
7561
7439
|
}
|
|
7562
7440
|
function useTree() {
|
|
@@ -7743,22 +7621,22 @@ const TreeItem = react.memo(function TreeItem2(props) {
|
|
|
7743
7621
|
})]
|
|
7744
7622
|
});
|
|
7745
7623
|
});
|
|
7746
|
-
Object.defineProperty(exports, '
|
|
7624
|
+
Object.defineProperty(exports, 'COLOR_CONFIG_BLEND_KEYS', {
|
|
7747
7625
|
enumerable: true,
|
|
7748
7626
|
get: function () {
|
|
7749
|
-
return theme.
|
|
7627
|
+
return theme.COLOR_CONFIG_BLEND_KEYS;
|
|
7750
7628
|
}
|
|
7751
7629
|
});
|
|
7752
|
-
Object.defineProperty(exports, '
|
|
7630
|
+
Object.defineProperty(exports, 'COLOR_CONFIG_CARD_KEYS', {
|
|
7753
7631
|
enumerable: true,
|
|
7754
7632
|
get: function () {
|
|
7755
|
-
return theme.
|
|
7633
|
+
return theme.COLOR_CONFIG_CARD_KEYS;
|
|
7756
7634
|
}
|
|
7757
7635
|
});
|
|
7758
|
-
Object.defineProperty(exports, '
|
|
7636
|
+
Object.defineProperty(exports, 'COLOR_CONFIG_CARD_TONES', {
|
|
7759
7637
|
enumerable: true,
|
|
7760
7638
|
get: function () {
|
|
7761
|
-
return theme.
|
|
7639
|
+
return theme.COLOR_CONFIG_CARD_TONES;
|
|
7762
7640
|
}
|
|
7763
7641
|
});
|
|
7764
7642
|
Object.defineProperty(exports, 'COLOR_CONFIG_STATE_KEYS', {
|
|
@@ -7773,12 +7651,6 @@ Object.defineProperty(exports, 'COLOR_CONFIG_STATE_TONES', {
|
|
|
7773
7651
|
return theme.COLOR_CONFIG_STATE_TONES;
|
|
7774
7652
|
}
|
|
7775
7653
|
});
|
|
7776
|
-
Object.defineProperty(exports, 'THEME_COLOR_BASE_TONES', {
|
|
7777
|
-
enumerable: true,
|
|
7778
|
-
get: function () {
|
|
7779
|
-
return theme.THEME_COLOR_BASE_TONES;
|
|
7780
|
-
}
|
|
7781
|
-
});
|
|
7782
7654
|
Object.defineProperty(exports, 'THEME_COLOR_BLEND_MODES', {
|
|
7783
7655
|
enumerable: true,
|
|
7784
7656
|
get: function () {
|
|
@@ -7791,6 +7663,12 @@ Object.defineProperty(exports, 'THEME_COLOR_BUTTON_MODES', {
|
|
|
7791
7663
|
return theme.THEME_COLOR_BUTTON_MODES;
|
|
7792
7664
|
}
|
|
7793
7665
|
});
|
|
7666
|
+
Object.defineProperty(exports, 'THEME_COLOR_CARD_TONES', {
|
|
7667
|
+
enumerable: true,
|
|
7668
|
+
get: function () {
|
|
7669
|
+
return theme.THEME_COLOR_CARD_TONES;
|
|
7670
|
+
}
|
|
7671
|
+
});
|
|
7794
7672
|
Object.defineProperty(exports, 'THEME_COLOR_STATES', {
|
|
7795
7673
|
enumerable: true,
|
|
7796
7674
|
get: function () {
|
|
@@ -7956,7 +7834,7 @@ Object.defineProperty(exports, 'screen', {
|
|
|
7956
7834
|
Object.defineProperty(exports, 'studioTheme', {
|
|
7957
7835
|
enumerable: true,
|
|
7958
7836
|
get: function () {
|
|
7959
|
-
return theme.
|
|
7837
|
+
return theme.defaultTheme;
|
|
7960
7838
|
}
|
|
7961
7839
|
});
|
|
7962
7840
|
exports.Arrow = Arrow;
|
|
@@ -8066,6 +7944,7 @@ exports.usePrefersDark = usePrefersDark;
|
|
|
8066
7944
|
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|
|
8067
7945
|
exports.useRootTheme = useRootTheme;
|
|
8068
7946
|
exports.useTheme = useTheme;
|
|
7947
|
+
exports.useTheme_v2 = useTheme_v2;
|
|
8069
7948
|
exports.useToast = useToast;
|
|
8070
7949
|
exports.useTooltipDelayGroup = useTooltipDelayGroup;
|
|
8071
7950
|
exports.useTree = useTree;
|